This is Unofficial EPICS BASE Doxygen Site
dbDefs.h
Go to the documentation of this file.
1 /*************************************************************************\
2 * Copyright (c) 2009 UChicago Argonne LLC, as Operator of Argonne
3 * National Laboratory.
4 * Copyright (c) 2002 The Regents of the University of California, as
5 * Operator of Los Alamos National Laboratory.
6 * EPICS BASE is distributed subject to a Software License Agreement found
7 * in file LICENSE that is included with this distribution.
8 \*************************************************************************/
9 
19 #ifndef INC_dbDefs_H
20 #define INC_dbDefs_H
21 
22 #include <stddef.h>
23 
24 #ifdef TRUE
25 # undef TRUE
26 #endif
27 #define TRUE 1
28 
29 #ifdef FALSE
30 # undef FALSE
31 #endif
32 #define FALSE 0
33 
35 #ifndef LOCAL
36 # define LOCAL static
37 #endif
38 
40 #ifndef NELEMENTS
41 # define NELEMENTS(array) (sizeof (array) / sizeof ((array) [0]))
42 #endif
43 
45 #ifndef OFFSET
46 # define OFFSET(structure, member) offsetof(structure, member)
47 #endif
48 
59 #ifndef CONTAINER
60 # ifdef __GNUC__
61 # define CONTAINER(ptr, structure, member) ({ \
62  const __typeof(((structure*)0)->member) *_ptr = (ptr); \
63  (structure*)((char*)_ptr - offsetof(structure, member)); \
64  })
65 # else
66 # define CONTAINER(ptr, structure, member) \
67  ((structure*)((char*)(ptr) - offsetof(structure, member)))
68 # endif
69 #endif
70 
72 #define PVNAME_STRINGSZ 61
73 
74 #define PVNAME_SZ (PVNAME_STRINGSZ - 1)
75 
78 #define PVLINK_STRINGSZ 1024
79 
81 #define DB_MAX_CHOICES 30
82 
83 #endif /* INC_dbDefs_H */