Mail Archives: djgpp/1999/07/10/17:15:28.1
Anton Helm (tony AT nt DOT tuwien DOT ac DOT at) wrote:
: I have a (C-)program that uses 3 different flex/bison pairs to
: parse diferent input files. This works fine with renaming the
: yy_ to something else by commandline switch.
:
: Now I would like to put some parts of the program into a library.
: The goal is to hide all internal functions of the library from
: the user (using statics and local variables only).
: But flex and bison use global variables to exchange information
: (and define some others too).
: Any idea how to hide these global variables and functions from
: the user of the library, so they don't conflict with any functions
: and globals on the user's part of the program ?
The easiest solution is not to hide them at all, but use the feature
you mentioned and name them __anton_helm_yy_something_or_other.
An another way (which I don't know works) could be #include the C
files (yes, this is BAD) into one single file and make a little sed
script that makes the global varables static.
Skunk Anansie, Paranoid & Sunburnt,
MartinS
- Raw text -