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

epicsExportSharedSymbols
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:

epicsExportAddress(dset, devMyName);
Note that the typ parameter for a device support entry table must be spelled dset even if the obj was actually declared as some other type, say using typed_dset .

A driver support source file must contain a statement like:

epicsExportAddress(drvet, drvName);

A variable named in a DBD variable statement must be declared with:

int myDebug = 0;
epicsExportAddress(int, myDebug);
Only int and double are 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 registrar statement. 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 function statement 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)