I need to remove a bunch of function prototypes from several .h files, and I was wondering if there is some kind of bash script/program to look for the prototypes that are not in the .c file and automatically remove them.
This is really useful for source code cleaning purposes when you have a big project and you did not keep track of all the changes.
Note that the it does not have anything to do with the binary, I want to remove them from the code.
I don't know of any program that fits your need exactly; but with some neat lateral thinking, you arrive at cproto, which sort of does what you need. Just remove the current header file, run cproto to get a new one only containing the relevant prototypes, and put in whatever macros and typedefs you need from your preamble.
You could use makeheaders to generate header files with the correct list of prototypes in and either use those headers, or cut'n'paste the definitions to replace the ones in your existing headers
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With