EPICS Base  7.0.6.1
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
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 * SPDX-License-Identifier: EPICS
7 * EPICS BASE is distributed subject to a Software License Agreement found
8 * in file LICENSE that is included with this distribution.
9 \*************************************************************************/
10 
20 #ifndef INC_dbDefs_H
21 #define INC_dbDefs_H
22 
23 #include <stddef.h>
24 
25 #ifdef TRUE
26 # undef TRUE
27 #endif
28 #define TRUE 1
29 
30 #ifdef FALSE
31 # undef FALSE
32 #endif
33 #define FALSE 0
34 
36 #ifndef LOCAL
37 # define LOCAL static
38 #endif
39 
41 #ifndef NELEMENTS
42 # define NELEMENTS(array) (sizeof (array) / sizeof ((array) [0]))
43 #endif
44 
46 #ifndef OFFSET
47 # define OFFSET(structure, member) offsetof(structure, member)
48 #endif
49 
60 #ifndef CONTAINER
61 # ifdef __GNUC__
62 # define CONTAINER(ptr, structure, member) ({ \
63  const __typeof(((structure*)0)->member) *_ptr = (ptr); \
64  (structure*)((char*)_ptr - offsetof(structure, member)); \
65  })
66 # else
67 # define CONTAINER(ptr, structure, member) \
68  ((structure*)((char*)(ptr) - offsetof(structure, member)))
69 # endif
70 #endif
71 
73 #define PVNAME_STRINGSZ 61
74 
75 #define PVNAME_SZ (PVNAME_STRINGSZ - 1)
76 
79 #define PVLINK_STRINGSZ 1024
80 
82 #define DB_MAX_CHOICES 30
83 
84 #endif /* INC_dbDefs_H */