[m-dev.] special module initialisation code
David Overton
dmo at ender.cs.mu.oz.au
Tue Mar 21 12:47:25 AEDT 2000
Hi,
I am currently in the process of writing a new module to integrate
Peter Schachte's C implementation of ROBDDs with Mercury. The
interface to Peter's code is declarative, except that an
initialisation procedure needs to be called to set up some tables
before any of the other procedures in the module can be used.
It would be nice if there were some way of automatically getting this
procedure called at program startup if the ROBDD module has been
imported.
I believe a C function `mercury__<module>__init()' is generated for
each module and called when the program starts up. This seems like a
logical place to put such code.
One possibility is to add a new pragma, `c_init_code', which is
similar to `pragma c_header_code', except that it puts the code inside
the `mercury__<module>__init()' function instead of at the top of the
.c file.
How does this sound? Does anyone have any alternative suggestions?
David
--
David Overton Department of Computer Science & Software Engineering
PhD Student The University of Melbourne, Victoria 3010, Australia
+61 3 8344 9159 http://www.cs.mu.oz.au/~dmo
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to: mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions: mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------
More information about the developers
mailing list