AnsweredAssumed Answered

Inclusion of local userdefined functions

Question asked by kelting on Mar 10, 2003
Latest reply on Mar 17, 2003 by kelting
I am Klaus Kelting from Infineon Technologies AG, Munich, Germany, and I have a little problem with our userdefined functions. Well, it is an inconvenience. Each time I get a new ICCAP release I have to modify the source code (userc.c, userc.h, userc_io.c, user_meas.cxx, Makefile) distributed with ICCAP. Of cause, these days the modifications are done by a shell script

I modify the source code to include some more source code from different files. As a result, the source of e.g. "userc.c" extends over more than one file. In order to make the inclusion of userdefined functions more simple I propose to put "#include" statements at certain strategic positions of the above mentioned files.

For example, the file "userc.c" might include a file "userc.c.local" right after the call of the function "add_userc_io_funcs();". By default, userc.c.local consists of a C style comment claiming that this is the place to include any local functions (by means of yet another include statement). The file "userc.h" could include a file "userc.h.local" right before its final "#endif" statement.  Similarly, the last statement in the function "add_userc_io_funcs" might include the file "userc_io.c.local". The method "add_users_drivers()" in the file "user_meas.cxx" could be the contents of a file "user_meas.cxx.local" which has to be included at the position of "add_users_drivers()".

This way, an ICCAP user who wants to extend the functionality of ICCAP could modify the "*.local" files and store the modified files at a safe place. Whenever the user installs a new ICCAP release he/she overwrites the "*.local" files distributed with the new release using his/her own copy of the files and creates custom-made copies of the library files.

The modification of the Makefile are more difficult, I think. One has to live with several included files for the Makefile or maybe the local userdefined functions get placed in separate libraries which will be included into the "libicuser*" libraries.
The making of those separate libraries could be ruled by a separate and local Makefile.

Does anybody have a better idea for an easy implementation of userdefined (&& downloaded from somewhere else) functions?