epicsExport.h
Exporting IOC objects.
This header defines macros that allow registering IOC shell commands, subroutines, device support, etc.
Because this header defines the epicsExportSharedSymbols macro, it triggers a transition between importing declarations from other libraries, to exporting symbols from our own library. For this reason, it must be included last, after all other EPICS-related includes. The comments in shareLib.h provide more information. It is recommended to mark this with a comment, e.g.
#include <epicsExport.h> // defines epicsExportSharedSymbols, do not move
Note
Do not use this header solely to enable exporting of symbols. If you are implementing a library and need to handle the differences in shared libraries between Linux and Windows, refer to the documentation within or run makeAPIheader.pl -h.
Defines
-
EPICS_EXPORT_POBJ(typ, obj)
-
EPICS_EXPORT_PFUNC(fun)
-
epicsExportAddress(typ, obj)
Declare an object for exporting.
The epicsExportAddress() macro must be used to declare any IOC object that is also named in a DBD file. For example a record support source file must contain a statement like:
epicsExportAddress(rset, myRSET);
A device support source file must contain a statement like:
Note that theepicsExportAddress(dset, devMyName);
typparameter for a device support entry table must be spelleddseteven if theobjwas actually declared as some other type, say usingtyped_dset.A driver support source file must contain a statement like:
epicsExportAddress(drvet, drvName);
A variable named in a DBD
variablestatement must be declared with:Onlyint myDebug = 0; epicsExportAddress(int, myDebug);
intanddoubleare currently supported for DBD variables.- Parameters:
typ – Object’s data type.
obj – Object’s name.
-
epicsExportRegistrar(fun)
Declare a registrar function for exporting.
The epicsExportRegistrar() macro must be used to declare a registrar function that is named in a DBD
registrarstatement. For example:static void myRegistrar(void) { ... } epicsExportRegistrar(myRegistrar);
- Parameters:
fun – Registrar function’s name.
-
epicsRegisterFunction(fun)
Declare and register a function for exporting.
The epicsRegisterFunction() macro must be used to declare and register a function that is named in a DBD
functionstatement and called by one or more subroutine or aSub records. For example:epicsRegisterFunction(mySubInit); epicsRegisterFunction(mySubProcess);
- Parameters:
fun – Function’s name
Typedefs
-
typedef void (*REGISTRAR)(void)