httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From (Ralf S. Engelschall)
Subject Re: Global Renaming: Let us start!
Date Thu, 02 Apr 1998 11:59:32 GMT

In article <> you wrote:

> In article <> you wrote:

Ok guys, I've finished the first cut for the renaming programs.  I've looked
at a lot of programs today (ctags, c-utils, id-utils, cxref, etc.) but it is
unbelievable: A lot of programs parse ANSI C, but no one changes it. On the
other hand my initial quick-and-dirty Perl script really converted too much
stuff (e.g. ``#include "fnmatch.h"'' to ``#include "ap_fnmatch.h"'' :-(, etc.)
So, my current solution is the following one:

1. I took the program chilight from c-utils 1.5.2 and changed
   it into a generic symbol substitution program for ANSI C code:
   $ csubst -s oldsymbol:newsymbol ... -o outfile infile

2. I wrote a wrapper which parses a
   file (holding the renaming scheme) and runs csubst
   with the source files in a loop while giving some
   overview of substituted symbols.

3. I created via
   a) taking the information in hide.h
   b) adding manually some special stuff like aplog_error, etc.
   c) created the possibility to specifiy generic prefixes (API_, APX_ and
      APM_) while the top of the file defines the actual ones. So we
      can change the prefixes at the last minute. 

4. I wrote a program which updates
   according to a src/ID file (generated via "mkid" from GNU id-utils) by
   configuring that all symbols xxx translate to API_xxx when they are
   declared API_EXPORT in the source and APX_xxx if not. The APM_
   variants I've created manually.

5. I've tested the stuff and works great, except for the APM_ stuff
   which is currently not used because this needs changes
   to mod_so, Configure, etc.

6. I've committed this to
   so you can play with it _AND_ especially adjust the file manually
   to fit what we really want in the API. But make sure that you write down
   changes because when you change a function from to API_xxx we later need to
   add API_EXPORT in the source and if you change to APX_xxx we need to remove

So, what now?
                                       Ralf S. Engelschall

View raw message