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

Miscellaneous macro definitions. More...

#include <stddef.h>
+ Include dependency graph for dbDefs.h:

Go to the source code of this file.

Macros

#define TRUE   1
 
#define FALSE   0
 
#define LOCAL   static
 Deprecated synonym for static. More...
 
#define NELEMENTS(array)   (sizeof (array) / sizeof ((array) [0]))
 Number of elements in array. More...
 
#define OFFSET(structure, member)   offsetof(structure, member)
 Deprecated synonym for offsetof. More...
 
#define CONTAINER(ptr, structure, member)   ((structure*)((char*)(ptr) - offsetof(structure, member)))
 Find parent object from a member pointer. More...
 
#define PVNAME_STRINGSZ   61
 Size of a record name including the nil terminator. More...
 
#define PVNAME_SZ   (PVNAME_STRINGSZ - 1)
 Size of a record name without the nil terminator. More...
 
#define PVLINK_STRINGSZ   1024
 Buffer size for the string representation of a DBF_*LINK field. More...
 
#define DB_MAX_CHOICES   30
 dbAccess enums/menus can have up to this many choices More...
 

Detailed Description

Miscellaneous macro definitions.

Author
Marty Kraimer

This file defines several miscellaneous macros.

Definition in file dbDefs.h.

Macro Definition Documentation

#define CONTAINER (   ptr,
  structure,
  member 
)    ((structure*)((char*)(ptr) - offsetof(structure, member)))

Find parent object from a member pointer.

Subtracts the byte offset of the member in the structure from the pointer to the member itself, giving a pointer to parent strucure.

Parameters
ptrPointer to a member data field of a structure
structureType name of the parent structure
memberField name of the data member
Returns
Pointer to the parent structure
Note
Both GCC and Clang will type-check this macro.

Definition at line 66 of file dbDefs.h.

#define DB_MAX_CHOICES   30

dbAccess enums/menus can have up to this many choices

Definition at line 81 of file dbDefs.h.

#define FALSE   0

Definition at line 32 of file dbDefs.h.

#define LOCAL   static

Deprecated synonym for static.

Definition at line 36 of file dbDefs.h.

#define NELEMENTS (   array)    (sizeof (array) / sizeof ((array) [0]))

Number of elements in array.

Definition at line 41 of file dbDefs.h.

#define OFFSET (   structure,
  member 
)    offsetof(structure, member)

Deprecated synonym for offsetof.

Definition at line 46 of file dbDefs.h.

#define PVLINK_STRINGSZ   1024

Buffer size for the string representation of a DBF_*LINK field.

Definition at line 78 of file dbDefs.h.

#define PVNAME_STRINGSZ   61

Size of a record name including the nil terminator.

Definition at line 72 of file dbDefs.h.

#define PVNAME_SZ   (PVNAME_STRINGSZ - 1)

Size of a record name without the nil terminator.

Definition at line 74 of file dbDefs.h.

#define TRUE   1

Definition at line 27 of file dbDefs.h.