parsing C code
I would like to know if there is any way to parse C code so I can automatically generate template code (such as header files). For example I would like to generate enums for each global variable and have them modified through a single function as follows:
then generate the appropriate GUI function so I can manipulate them. I'm sure someone at some point would have done this to account for the numerous amount of variables one might have.
// set the variable 'vname' to the specified value
int s_set_option( enum s_opt vname, void *new_value);
// return the variable 'vname' value
void *s_get_option( enum s_opt vname);
such a tool would make a lovely addition to my make file for future projects.
I am working with Ubuntu
You should have a "protoize", which is part of the gcc package.
Here's some info: