Ethereal-dev: Re: [Ethereal-dev] ethereal plugin interface

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Matthijs Melchior <mmelchior@xxxxxxxxx>
Date: Wed, 23 Jul 2003 23:02:10 +0200
Guy Harris wrote:

By the way, is gcc really doing anything more than just reformatting
some function declarations, by

	putting them on one line;

	adding a comment used to filter out uninteresting declaratons;

	adding "extern";

	removing parameter names from parameter declarations?

Yes, it is also used to create consistent whitespace, which is not
required by C, and which is used to find the name being declared....


If so, then perhaps we don't really need it - just have a
"plugin_api_list" file, with a requirement that function declarations
not be split between lines, and use that as the input from the Python
script.  That might simplify the build procedure, allowing us not to
have to worry about whether you have GCC or not, and to have the files
generated from "plugin_api_list" not be in the CVS tree (just as other
files generated by Python scripts aren't in the CVS tree) but have them
be in the source tarball (just as the other files generated by Python
scripts are).
Yes, this is certainly possible. This "plugin_api_list" file is currently
called "xyzzy" and is generated from plugin_api_list.c. I had meant to
let this happen only when making xyzzy, but I see there still is a
dependency in plugins/Makefile.nmake of Xplugin_api.c on xyzzy.  If you
would remove that, have an up to date xyzzy file in the relaese, than
gcc will never be invoked automatically.

My reason for using "gcc -aux-info" is that I do not want to require
whitespace formatting other than that is required by C.  To require
each declatation not to be split over a line is reasonable, but to
require exact whitespace formatting is too error prone, I think.

Look at the following 4 examples:

void (*except_unhandled_catcher (void (*) (except_t *))) (except_t *);
void *except_take_data (except_t *);
void except_set_allocator (void *(*) (size_t), void (*) (void *));
struct except_stacknode *except_pop (void);

I have not been able to find one RE to extract the declared name
from all these without using the whitespace as it is present.

The current RE, '\w* .*?(\w*) \(.*', is compilcated enough...

To summarize:
   Change dependency xyzzy on Xplugin_api.c such that it
      gives a waring i.s.o. using gcc.
   Do not have the X* files in CVS.
   Only plugin_api_list.c needs to be stored in CVS.
   Let the release procedure generate an up to date xyzzy file,
      as well as matching X* files for inclusion in the tar.
   Maybe rename file "xyzzy" to "plugin_api_list" in the makefiles
      and the README file.

Thanks.

--
Regards,
----------------------------------------------------------------  -o)
Matthijs Melchior                                       Maarssen  /\\
mmelchior@xxxxxxxxx          +31 346 570616          Netherlands _\_v
---------------------------------------------------------------- ----