I am more into C than perl - (sorry, but I have to) - and feel like I need the power of perl now.
I have a large set of C source files, and need to empty out all the function bodies - but just the bodies. Everything else should be left untouched.
Does anybody know a quick way to do that?
I read the C::Scan library and it can extract quite a lot of structures out of a c file. The thing is, not to delete anything, except the function bodies. Ok, it offers structs like:
defines_args fdecls, etc. and one would be able to print those. But the order is important, and the printed output should include everything.
I need to change this:
#define IN_LIBXML #include "libxml.h" struct _xmlLink { struct _xmlLink *next; struct _xmlLink *prev; void *data; }; static int xmlLinkCompare(const void *data0, const void *data1); static int xmlLinkCompare(const void *data0, const void *data1) { if (data0 < data1) return (-1); else if (data0 == data1) return (0); return (1); }
-----------
into:
#define IN_LIBXML #include "libxml.h" struct _xmlLink { struct _xmlLink *next; struct _xmlLink *prev; void *data; }; static int xmlLinkCompare(const void *data0, const void *data1); static int xmlLinkCompare(const void *data0, const void *data1) { }
Any suggestions??
Frank
In reply to empty out C function bodies by biocc
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |