This is Unofficial EPICS BASE Doxygen Site
epicsExport.h File Reference

Exporting IOC objects. More...

#include <shareLib.h>
+ Include dependency graph for epicsExport.h:

Go to the source code of this file.

Macros

#define epicsExportSharedSymbols
 
#define EPICS_EXPORT_POBJ(typ, obj)   pvar_ ## typ ## _ ## obj
 
#define EPICS_EXPORT_PFUNC(fun)   EPICS_EXPORT_POBJ(func, fun)
 
#define epicsExportAddress(typ, obj)
 Declare an object for exporting. More...
 
#define epicsExportRegistrar(fun)   epicsShareFunc REGISTRAR EPICS_EXPORT_PFUNC(fun) = (REGISTRAR) &fun
 Declare a registrar function for exporting. More...
 
#define epicsRegisterFunction(fun)
 Declare and register a function for exporting. More...
 

Typedefs

typedef void(* REGISTRAR) (void)
 

Detailed Description

Exporting IOC objects.

This header is unique, as it defines epicsExportSharedSymbols and thus triggers a transition between importing declarations from other libraries, to exporting symbols from our own library. The comments in shareLib.h provide more information.

This header should be included with a trailing comment to make it stand out from other includes, something like this:

#include <epicsExport.h> // defines epicsExportSharedSymbols

Definition in file epicsExport.h.

Macro Definition Documentation

#define EPICS_EXPORT_PFUNC (   fun)    EPICS_EXPORT_POBJ(func, fun)

Definition at line 39 of file epicsExport.h.

#define EPICS_EXPORT_POBJ (   typ,
  obj 
)    pvar_ ## typ ## _ ## obj

Definition at line 38 of file epicsExport.h.

#define epicsExportAddress (   typ,
  obj 
)
Value:
epicsShareDef typ *EPICS_EXPORT_POBJ(typ, obj) = (typ *) (char *) &obj
#define EPICS_EXPORT_POBJ(typ, obj)
Definition: epicsExport.h:38
#define epicsShareExtern
Definition: shareLib.h:204
#define epicsShareDef
Definition: shareLib.h:207

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:

1 epicsExportAddress(rset, myRSET);

A device support source file must contain a statement like:

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

1 epicsExportAddress(drvet, drvName);

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

1 int myDebug = 0;
2 epicsExportAddress(int, myDebug);

Only int and double are currently supported for DBD variables.

Parameters
typObject's data type.
objObject's name.
Note
C++ code needs to wrap with
1 extern "C" { }

Definition at line 75 of file epicsExport.h.

#define epicsExportRegistrar (   fun)    epicsShareFunc REGISTRAR EPICS_EXPORT_PFUNC(fun) = (REGISTRAR) &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:

1 static void myRegistrar(void) {
2  ...
3 }
4 epicsExportRegistrar(myRegistrar);
Parameters
funRegistrar function's name.
Note
C++ code needs to wrap with
1 extern "C" { }

Definition at line 94 of file epicsExport.h.

#define epicsExportSharedSymbols

Definition at line 29 of file epicsExport.h.

#define epicsRegisterFunction (   fun)
Value:
static void register_func_ ## fun(void) \
{ \
} \
epicsExportRegistrar(register_func_ ## fun)
void(* REGISTRYFUNCTION)(void)
#define epicsExportRegistrar(fun)
Declare a registrar function for exporting.
Definition: epicsExport.h:94
epicsShareFunc int registryFunctionAdd(const char *name, REGISTRYFUNCTION func)

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:

1 epicsRegisterFunction(mySubInit);
2 epicsRegisterFunction(mySubProcess);
Parameters
funFunction's name
Note
C++ code needs to wrap with
1 extern "C" { }

Definition at line 111 of file epicsExport.h.

Typedef Documentation

typedef void(* REGISTRAR) (void)

Definition at line 36 of file epicsExport.h.