EPICS Base 7.0.8.0
Loading...
Searching...
No Matches
Macros | Typedefs
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.
 
#define epicsExportRegistrar(fun)    epicsShareFunc REGISTRAR EPICS_EXPORT_PFUNC(fun) = (REGISTRAR) &fun
 Declare a registrar function for exporting.
 
#define epicsRegisterFunction(fun)
 Declare and register a function for exporting.
 

Typedefs

typedef void(* REGISTRAR) (void)
 

Detailed Description

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
Exporting IOC objects.
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 makeAPIheader.pl or run makeAPIheader.pl -h.

Definition in file epicsExport.h.

Macro Definition Documentation

◆ epicsExportSharedSymbols

#define epicsExportSharedSymbols

Definition at line 35 of file epicsExport.h.

◆ EPICS_EXPORT_POBJ

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

Definition at line 44 of file epicsExport.h.

◆ EPICS_EXPORT_PFUNC

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

Definition at line 45 of file epicsExport.h.

◆ epicsExportAddress

#define epicsExportAddress (   typ,
  obj 
)
Value:
epicsShareExtern typ *EPICS_EXPORT_POBJ(typ,obj); \
epicsShareDef typ *EPICS_EXPORT_POBJ(typ, obj) = (typ *) (char *) &obj
Provides an RAII style lock/unlock of a mutex.
Definition epicsGuard.h:53

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:

#define epicsExportAddress(typ, obj)
Declare an object for exporting.
Definition epicsExport.h:81
Definition recSup.h:68

A device support source file must contain a statement like:

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:

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

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
extern "C" { }

Definition at line 81 of file epicsExport.h.

◆ epicsExportRegistrar

#define epicsExportRegistrar (   fun)     epicsShareFunc REGISTRAR EPICS_EXPORT_PFUNC(fun) = (REGISTRAR) &fun

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) {
...
}
#define epicsExportRegistrar(fun)
Declare a registrar function for exporting.
Parameters
funRegistrar function's name.
Note
C++ code needs to wrap with
extern "C" { }

Definition at line 100 of file epicsExport.h.

◆ epicsRegisterFunction

#define epicsRegisterFunction (   fun)
Value:
static void register_func_ ## fun(void) \
{ \
registryFunctionAdd(#fun, (REGISTRYFUNCTION) fun); \
} \

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:

#define epicsRegisterFunction(fun)
Declare and register a function for exporting.
Parameters
funFunction's name
Note
C++ code needs to wrap with
extern "C" { }

Definition at line 117 of file epicsExport.h.

Typedef Documentation

◆ REGISTRAR

typedef void(* REGISTRAR) (void)

Definition at line 42 of file epicsExport.h.