Closed smytht closed 1 year ago
Chris has requested that a new header file ctl.h be created and the functions and declarations be moved into that ... I will re-draft the pull request... on this basis...
Folks I moved all ctl.c references in externs.h to ctl.h and updated files(with #include ctl.h) that relied on functions or declarations that were moved from externs.h to ctl.ch
sorry some edits did not make it into my revised pull request I have resolved this now Thanks
removed unnecessary modification of route.c as it does not need to include ctl.h
Using 'static' declarations in a head file means every .c file which includes the header will contain a copy of the data in the compiled .o file.
Instead I would suggest to keep the definitions in ctl.c and declare the symbols as extern in ctl.h. Like I have done here:
https://github.com/stspdotname/nsh/commit/4d42d8625eca5fc3319383ab3b075a38c70bf7a1
Ok I have implemented both Chris and Stefans Feedback and tested build and ctl test functionality
move definition of ctl daemons from ctl.c to externs.h move ctl tests for daemon config syntax from ctl.c to externs.h this is to facilitate using ctl tests from other files such as commands.c modify function declaration to include static to avoid duplicate symbols at compile time ...