EPICS Base  7.0.6.1
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
dbBase.h
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 /*
11  * Current Author: Marty Kraimer
12  * Date: 03-19-92
13  */
14 
15 #ifndef INCdbBaseh
16 #define INCdbBaseh 1
17 
18 #include "epicsTypes.h"
19 #include "dbFldTypes.h"
20 #include "ellLib.h"
21 #include "dbDefs.h"
22 #include "recSup.h"
23 #include "devSup.h"
24 
25 typedef struct dbMenu {
26  ELLNODE node;
27  char *name;
28  int nChoice;
29  char **papChoiceName;
30  char **papChoiceValue;
31 }dbMenu;
32 
33 typedef struct drvSup {
34  ELLNODE node;
35  char *name;
36  struct drvet *pdrvet;
37 }drvSup;
38 
39 typedef struct devSup {
40  ELLNODE node;
41  char *name;
42  char *choice;
43  int link_type;
44  /*Following only available on run time system*/
45  dset *pdset;
46  struct dsxt *pdsxt; /* Extended device support */
47 }devSup;
48 
49 typedef struct linkSup {
50  ELLNODE node;
51  char *name;
52  char *jlif_name;
53  struct jlif *pjlif;
54 } linkSup;
55 
56 typedef struct dbDeviceMenu {
57  int nChoice;
58  char **papChoice;
60 
61 /* conversion types*/
62 typedef enum {CT_DECIMAL,CT_HEX} ctType;
63 /* access level types */
64 typedef enum {ASL0,ASL1} asLevel;
65 
66 /*Breakpoint Tables */
67 typedef struct brkInt{ /* breakpoint interval */
68  double raw; /*raw value for beginning of interval */
69  double slope; /*slope for interval */
70  double eng; /*converted value for beginning of interval*/
71 }brkInt;
72 
73 typedef struct brkTable { /* breakpoint table */
74  ELLNODE node;
75  char *name; /*breakpoint table name */
76  long number; /*number of brkInt in this table */
77  struct brkInt *paBrkInt; /* ptr to array of brkInts */
78 }brkTable;
79 
80 typedef struct dbFldDes{ /* field description */
81  char *prompt; /*Prompt string for DCT */
82  char *name; /*Field name */
83  char *extra; /*C def for DBF_NOACCESS */
84  struct dbRecordType *pdbRecordType;
85  short indRecordType; /*within dbRecordType.papFldDes */
86  short special; /*Special processing requirements */
87  dbfType field_type; /*Field type as defined in dbFldTypes.h */
88  unsigned int process_passive:1;/*should dbPutField process passive */
89  unsigned int prop:1; /*field is a metadata, post DBE_PROPERTY on change*/
90  unsigned int isDevLink:1; /* true for INP/OUT fields */
91  ctType base; /*base for integer to string conversions*/
92  short promptgroup; /*prompt, i.e. gui group */
93  short interest; /*interest level */
94  asLevel as_level; /*access security level */
95  char *initial; /*initial value */
96  /*If (DBF_MENU,DBF_DEVICE) ftPvt is (pdbMenu,pdbDeviceMenu) */
97  void *ftPvt;
98  /*On no runtime following only set for STRING */
99  short size; /*length in bytes of a field element */
100  /*The following are only available on run time system*/
101  unsigned short offset; /*Offset in bytes from beginning of record*/
102 }dbFldDes;
103 
104 typedef struct dbInfoNode { /*non-field per-record information*/
105  ELLNODE node;
106  char *name;
107  char *string;
108  void *pointer;
109 }dbInfoNode;
110 
111 #define DBRN_FLAGS_VISIBLE 1
112 #define DBRN_FLAGS_ISALIAS 2
113 #define DBRN_FLAGS_HASALIAS 4
114 
115 typedef struct dbRecordNode {
116  ELLNODE node;
117  void *precord;
118  char *recordname;
119  ELLLIST infoList; /*LIST head of info nodes*/
120  int flags;
121  struct dbRecordNode *aliasedRecnode; /* NULL unless flags|DBRN_FLAGS_ISALIAS */
122 }dbRecordNode;
123 
124 /*dbRecordAttribute is for "psuedo" fields */
125 /*pdbFldDes is so that other access routines work correctly*/
126 /*Until base supports char * value MUST be fixed length string*/
127 typedef struct dbRecordAttribute {
128  ELLNODE node;
129  char *name;
130  dbFldDes *pdbFldDes;
131  char value[MAX_STRING_SIZE];
133 
134 typedef struct dbText {
135  ELLNODE node;
136  char *text;
137 }dbText;
138 
139 typedef struct dbVariableDef {
140  ELLNODE node;
141  char *name;
142  char *type;
143 
145 
146 typedef struct dbRecordType {
147  ELLNODE node;
148  ELLLIST attributeList; /*LIST head of attributes*/
149  ELLLIST recList; /*LIST head of sorted dbRecordNodes*/
150  ELLLIST devList; /*List of associated device support*/
151  ELLLIST cdefList; /*LIST of Cdef text items*/
152  char *name;
153  short no_fields; /* number of fields defined */
154  short no_prompt; /* number of fields to configure*/
155  short no_links; /* number of links */
156  short no_aliases; /* number of aliases in recList */
157  short *link_ind; /* addr of array of ind in papFldDes*/
158  char **papsortFldName;/* ptr to array of ptr to fld names*/
159  short *sortFldInd; /* addr of array of ind in papFldDes*/
160  dbFldDes *pvalFldDes; /*pointer dbFldDes for VAL field*/
161  short indvalFlddes; /*ind in papFldDes*/
162  dbFldDes **papFldDes; /* ptr to array of ptr to fldDes*/
163  /*The following are only available on run time system*/
164  rset *prset;
165  int rec_size; /*record size in bytes */
166 }dbRecordType;
167 
168 struct dbPvd; /* Contents private to dbPvdLib code */
169 struct gphPvt; /* Contents private to gpHashLib code */
170 
171 typedef struct dbBase {
172  ELLLIST menuList;
173  ELLLIST recordTypeList;
174  ELLLIST drvList;
175  ELLLIST linkList;
176  ELLLIST registrarList;
177  ELLLIST functionList;
178  ELLLIST variableList;
179  ELLLIST bptList;
180  ELLLIST filterList;
181  ELLLIST guiGroupList;
182  void *pathPvt;
183  struct dbPvd *ppvd;
184  struct gphPvt *pgpHash;
185  short ignoreMissingMenus;
186  short loadCdefs;
187 }dbBase;
188 #endif
Definition: devSup.h:118
Definition: link.h:175
List node type.
Definition: ellLib.h:46
The core data types used by epics.
Definition: dbBase.h:25
Definition: drvSup.h:46
Definition: dbBase.h:33
Definition: devSup.h:141
A doubly-linked list library.
Definition: dbBase.h:39
List header type.
Definition: ellLib.h:57
Definition: dbBase.h:134
Device support routines.
Definition: dbBase.h:171
Definition: dbBase.h:67
Definition: dbJLink.h:49
Definition: recSup.h:68
Miscellaneous macro definitions.