This is Unofficial EPICS BASE Doxygen Site
caput.c
Go to the documentation of this file.
1 /*************************************************************************\
2 * Copyright (c) 2009 Helmholtz-Zentrum Berlin fuer Materialien und Energie.
3 * Copyright (c) 2006 Diamond Light Source Ltd.
4 * Copyright (c) 2002 The University of Chicago, as Operator of Argonne
5 * National Laboratory.
6 * Copyright (c) 2002 The Regents of the University of California, as
7 * Operator of Los Alamos National Laboratory.
8 * Copyright (c) 2002 Berliner Elektronenspeicherringgesellschaft fuer
9 * Synchrotronstrahlung.
10 * EPICS BASE is distributed subject to a Software License Agreement found
11 * in file LICENSE that is included with this distribution.
12 \*************************************************************************/
13 
14 /*
15  * Author: Ralph Lange (BESSY)
16  *
17  * Modification History
18  * 2006/01/17 Malcolm Walters (Tessella/Diamond Light Source)
19  * Added put_callback option - heavily based on caget
20  * 2008/03/06 Andy Foster (OSL/Diamond Light Source)
21  * Remove timeout dependency of ca_put_callback by using an EPICS event
22  * (semaphore), i.e. remove ca_pend_event time slicing.
23  * 2008/04/16 Ralph Lange (BESSY)
24  * Updated usage info
25  * 2009/03/31 Larry Hoff (BNL)
26  * Added field separators
27  * 2009/04/01 Ralph Lange (HZB/BESSY)
28  * Added support for long strings (array of char) and quoting of nonprintable characters
29  *
30  */
31 
32 #include <stdio.h>
33 #include <string.h>
34 #include <epicsStdlib.h>
35 
36 #include <cadef.h>
37 #include <epicsGetopt.h>
38 #include <epicsEvent.h>
39 #include <epicsString.h>
40 #include "epicsVersion.h"
41 
42 #include "tool_lib.h"
43 
44 #define VALID_DOUBLE_DIGITS 18 /* Max usable precision for a double */
45 
46 /* Different output formats */
47 typedef enum { plain, terse, all } OutputT;
48 
49 /* Different request types */
50 typedef enum { get, callback } RequestT;
51 
52 /* Valid EPICS string */
53 typedef char EpicsStr[MAX_STRING_SIZE];
54 
55 static int nConn = 0; /* Number of connected PVs */
56 static epicsEventId epId;
57 
58 void usage (void)
59 {
60  fprintf (stderr, "\nUsage: caput [options] <PV name> <PV value> ...\n"
61  " caput -a [options] <PV name> <no of values> <PV value> ...\n\n"
62  " -h: Help: Print this message\n"
63  " -V: Version: Show EPICS and CA versions\n"
64  "Channel Access options:\n"
65  " -w <sec>: Wait time, specifies CA timeout, default is %f second(s)\n"
66  " -c: Asynchronous put (use ca_put_callback and wait for completion)\n"
67  " -p <prio>: CA priority (0-%u, default 0=lowest)\n"
68  "Format options:\n"
69  " -t: Terse mode - print only sucessfully written value, without name\n"
70  " -l: Long mode \"name timestamp value stat sevr\" (read PVs as DBR_TIME_xxx)\n"
71  "Enum format:\n"
72  " Default: Auto - try value as ENUM string, then as index number\n"
73  " -n: Force interpretation of values as numbers\n"
74  " -s: Force interpretation of values as strings\n"
75  "Arrays:\n"
76  " Default: Put scalar\n"
77  " Value format: all value arguments concatenated with spaces\n"
78  " -S: Put string as an array of chars (long string)\n"
79  " -a: Put array\n"
80  " Value format: number of values, then list of values\n"
81  "Alternate output field separator:\n"
82  " -F <ofs>: Use <ofs> as an alternate output field separator\n"
83  "\nExample: caput my_channel 1.2\n"
84  " (puts 1.2 to my_channel)\n\n"
86 }
87 
88 
89 /*+**************************************************************************
90  *
91  * Function: put_event_handler
92  *
93  * Description: CA event_handler for request type callback
94  * Sets status flags and marks as done.
95  *
96  * Arg(s) In: args - event handler args (see CA manual)
97  *
98  **************************************************************************-*/
99 
101 {
102  /* Retrieve pv from event handler structure */
103  pv* pPv = args.usr;
104 
105  /* Store status, then give EPICS event */
106  pPv->status = args.status;
107  epicsEventSignal( epId );
108 }
109 
110 
111 /*+**************************************************************************
112  *
113  * Function: caget
114  *
115  * Description: Issue read request, wait for incoming data
116  * and print the data
117  *
118  * Arg(s) In: pvs - Pointer to an array of pv structures
119  * nPvs - Number of elements in the pvs array
120  * format - Output format
121  * dbrType - Requested dbr type
122  * reqElems - Requested number of (array) elements
123  *
124  * Return(s): Error code: 0 = OK, 1 = Error
125  *
126  **************************************************************************-*/
127 
128 int caget (pv *pvs, int nPvs, OutputT format,
129  chtype dbrType, unsigned long reqElems)
130 {
131  unsigned int i;
132  int n, result;
133 
134  for (n = 0; n < nPvs; n++) {
135 
136  /* Set up pvs structure */
137  /* -------------------- */
138 
139  /* Get natural type and array count */
140  pvs[n].nElems = ca_element_count(pvs[n].chid);
141  pvs[n].dbfType = ca_field_type(pvs[n].chid);
142  pvs[n].dbrType = dbrType;
143 
144  /* Set up value structures */
145  pvs[n].dbrType = dbf_type_to_DBR_TIME(pvs[n].dbfType); /* Use native type */
146  if (dbr_type_is_ENUM(pvs[n].dbrType)) /* Enums honour -n option */
147  {
148  if (enumAsNr) pvs[n].dbrType = DBR_TIME_INT;
149  else pvs[n].dbrType = DBR_TIME_STRING;
150  }
151 
152  if (reqElems == 0 || pvs[n].nElems < reqElems) /* Adjust array count */
153  pvs[n].reqElems = pvs[n].nElems;
154  else
155  pvs[n].reqElems = reqElems;
156 
157  /* Issue CA request */
158  /* ---------------- */
159 
160  if (ca_state(pvs[n].chid) == cs_conn)
161  {
162  nConn++;
163  pvs[n].onceConnected = 1;
164  /* Allocate value structure */
165  pvs[n].value = calloc(1, dbr_size_n(pvs[n].dbrType, pvs[n].reqElems));
166  if(!pvs[n].value){
167  fprintf(stderr,"Allocation failed\n");
168  exit(1);
169  }
170  result = ca_array_get(pvs[n].dbrType,
171  pvs[n].reqElems,
172  pvs[n].chid,
173  pvs[n].value);
174  pvs[n].status = result;
175  } else {
176  pvs[n].status = ECA_DISCONN;
177  }
178  }
179  if (!nConn) return 1; /* No connection? We're done. */
180 
181  /* Wait for completion */
182  /* ------------------- */
183 
184  result = ca_pend_io(caTimeout);
185  if (result == ECA_TIMEOUT)
186  fprintf(stderr, "Read operation timed out: PV data was not read.\n");
187 
188  /* Print the data */
189  /* -------------- */
190 
191  for (n = 0; n < nPvs; n++) {
192 
193  switch (format) {
194  case plain: /* Emulate old caput behaviour */
195  if (pvs[n].reqElems <= 1 && fieldSeparator == ' ') printf("%-30s", pvs[n].name);
196  else printf("%s", pvs[n].name);
197  printf("%c", fieldSeparator);
198  case terse:
199  if (pvs[n].status == ECA_DISCONN)
200  printf("*** not connected\n");
201  else if (pvs[n].status == ECA_NORDACCESS)
202  printf("*** no read access\n");
203  else if (pvs[n].status != ECA_NORMAL)
204  printf("*** CA error %s\n", ca_message(pvs[n].status));
205  else if (pvs[n].value == 0)
206  printf("*** no data available (timeout)\n");
207  else
208  {
209  if (charArrAsStr && dbr_type_is_CHAR(pvs[n].dbrType) && (reqElems || pvs[n].reqElems > 1)) {
210  dbr_char_t *s = (dbr_char_t*) dbr_value_ptr(pvs[n].value, pvs[n].dbrType);
211  int dlen = epicsStrnEscapedFromRawSize((char*)s, strlen((char*)s));
212  char *d = calloc(dlen+1, sizeof(char));
213  if(!d){
214  fprintf(stderr,"Allocation failed\n");
215  exit(1);
216  }
217  epicsStrnEscapedFromRaw(d, dlen+1, (char*)s, strlen((char*)s));
218  printf("%s", d);
219  free(d);
220  } else {
221  if (reqElems || pvs[n].nElems > 1) printf("%lu%c", pvs[n].reqElems, fieldSeparator);
222  for (i=0; i<pvs[n].reqElems; ++i) {
223  if (i) printf ("%c", fieldSeparator);
224  printf("%s", val2str(pvs[n].value, pvs[n].dbrType, i));
225  }
226  }
227  printf("\n");
228  }
229  break;
230  case all:
231  print_time_val_sts(&pvs[n], reqElems);
232  break;
233  default :
234  break;
235  }
236  }
237  return 0;
238 }
239 
240 
241 
242 /*+**************************************************************************
243  *
244  * Function: main
245  *
246  * Description: caput main()
247  * Evaluate command line options, set up CA, connect the
248  * channel, put and print the data
249  *
250  * Arg(s) In: [options] <pv-name> <pv-value> ...
251  *
252  * Arg(s) Out: none
253  *
254  * Return(s): Standard return code (0=success, 1=error)
255  *
256  **************************************************************************-*/
257 
258 int main (int argc, char *argv[])
259 {
260  int i;
261  int result; /* CA result */
262  OutputT format = plain; /* User specified format */
263  RequestT request = get; /* User specified request type */
264  int isArray = 0; /* Flag for array operation */
265  int enumAsString = 0; /* Force ENUM values to be strings */
266 
267  int count = 1;
268  int opt; /* getopt() current option */
269  chtype dbrType = DBR_STRING;
270  char *pend;
271  EpicsStr *sbuf;
272  double *dbuf;
273  char *cbuf = 0;
274  char *ebuf = 0;
275  void *pbuf;
276  int len = 0;
277  int waitStatus;
278  struct dbr_gr_enum bufGrEnum;
279 
280  int nPvs; /* Number of PVs */
281  pv* pvs; /* Array of PV structures */
282 
283  LINE_BUFFER(stdout); /* Configure stdout buffering */
284  putenv("POSIXLY_CORRECT="); /* Behave correct on GNU getopt systems */
285 
286  while ((opt = getopt(argc, argv, ":cnlhatsVS#:w:p:F:")) != -1) {
287  switch (opt) {
288  case 'h': /* Print usage */
289  usage();
290  return 0;
291  case 'V':
292  printf( "\nEPICS Version %s, CA Protocol version %s\n", EPICS_VERSION_STRING, ca_version() );
293  return 0;
294  case 'n': /* Force interpret ENUM as index number */
295  enumAsNr = 1;
296  enumAsString = 0;
297  break;
298  case 's': /* Force interpret ENUM as menu string */
299  enumAsString = 1;
300  enumAsNr = 0;
301  break;
302  case 'S': /* Treat char array as (long) string */
303  charArrAsStr = 1;
304  isArray = 0;
305  break;
306  case 't': /* Select terse output format */
307  format = terse;
308  break;
309  case 'l': /* Select long output format */
310  format = all;
311  break;
312  case 'a': /* Select array mode */
313  isArray = 1;
314  charArrAsStr = 0;
315  break;
316  case 'c': /* Select put_callback mode */
317  request = callback;
318  break;
319  case 'w': /* Set CA timeout value */
320  if(epicsScanDouble(optarg, &caTimeout) != 1)
321  {
322  fprintf(stderr, "'%s' is not a valid timeout value "
323  "- ignored. ('caput -h' for help.)\n", optarg);
325  }
326  break;
327  case '#': /* Array count */
328  if (sscanf(optarg,"%d", &count) != 1)
329  {
330  fprintf(stderr, "'%s' is not a valid array element count "
331  "- ignored. ('caput -h' for help.)\n", optarg);
332  count = 0;
333  }
334  break;
335  case 'p': /* CA priority */
336  if (sscanf(optarg,"%u", &caPriority) != 1)
337  {
338  fprintf(stderr, "'%s' is not a valid CA priority "
339  "- ignored. ('caget -h' for help.)\n", optarg);
341  }
343  break;
344  case 'F': /* Store this for output and tool_lib formatting */
345  fieldSeparator = (char) *optarg;
346  break;
347  case '?':
348  fprintf(stderr,
349  "Unrecognized option: '-%c'. ('caput -h' for help.)\n",
350  optopt);
351  return 1;
352  case ':':
353  fprintf(stderr,
354  "Option '-%c' requires an argument. ('caput -h' for help.)\n",
355  optopt);
356  return 1;
357  default :
358  usage();
359  return 1;
360  }
361  }
362 
363  nPvs = argc - optind; /* Remaining arg list are PV names and values */
364 
365  if (nPvs < 1) {
366  fprintf(stderr, "No pv name specified. ('caput -h' for help.)\n");
367  return 1;
368  }
369  if (nPvs == 1) {
370  fprintf(stderr, "No value specified. ('caput -h' for help.)\n");
371  return 1;
372  }
373 
374  nPvs = 1; /* One PV - the rest is value(s) */
375 
376  epId = epicsEventCreate(epicsEventEmpty); /* Create empty EPICS event (semaphore) */
377 
378  /* Start up Channel Access */
379 
381  if (result != ECA_NORMAL) {
382  fprintf(stderr, "CA error %s occurred while trying "
383  "to start channel access.\n", ca_message(result));
384  return 1;
385  }
386  /* Allocate PV structure array */
387 
388  pvs = calloc (nPvs, sizeof(pv));
389  if (!pvs) {
390  fprintf(stderr, "Memory allocation for channel structure failed.\n");
391  return 1;
392  }
393  /* Connect channels */
394 
395  pvs[0].name = argv[optind] ; /* Copy PV name from command line */
396 
397  result = connect_pvs(pvs, nPvs); /* If the connection fails, we're done */
398  if (result) {
400  return result;
401  }
402 
403  /* Get values from command line */
404  optind++;
405 
406  if (isArray) {
407  optind++; /* In case of array skip first value (nr
408  * of elements) - actual number of values is used */
409  count = argc - optind;
410 
411  } else { /* Concatenate the remaining line to one string
412  * (sucks but is compatible to the former version) */
413  for (i = optind; i < argc; i++) {
414  len += strlen(argv[i]);
415  len++;
416  }
417  cbuf = calloc(len, sizeof(char));
418  if (!cbuf) {
419  fprintf(stderr, "Memory allocation failed.\n");
420  return 1;
421  }
422  strcpy(cbuf, argv[optind]);
423 
424  if (argc > optind+1) {
425  for (i = optind + 1; i < argc; i++) {
426  strcat(cbuf, " ");
427  strcat(cbuf, argv[i]);
428  }
429  }
430 
431  if ((argc - optind) >= 1)
432  count = 1;
433  argv[optind] = cbuf;
434  }
435 
436  sbuf = calloc (count, sizeof(EpicsStr));
437  dbuf = calloc (count, sizeof(double));
438  if(!sbuf || !dbuf) {
439  fprintf(stderr, "Memory allocation failed\n");
440  return 1;
441  }
442 
443  /* ENUM? Special treatment */
444 
445  if (ca_field_type(pvs[0].chid) == DBR_ENUM) {
446 
447  /* Get the ENUM strings */
448 
449  result = ca_array_get (DBR_GR_ENUM, 1, pvs[0].chid, &bufGrEnum);
450  result = ca_pend_io(caTimeout);
451  if (result == ECA_TIMEOUT) {
452  fprintf(stderr, "Read operation timed out: ENUM data was not read.\n");
453  return 1;
454  }
455 
456  if (enumAsNr) { /* Interpret values as numbers */
457 
458  for (i = 0; i < count; ++i) {
459  dbuf[i] = epicsStrtod(*(argv+optind+i), &pend);
460  if (*(argv+optind+i) == pend) { /* Conversion didn't work */
461  fprintf(stderr, "Enum index value '%s' is not a number.\n",
462  *(argv+optind+i));
463  return 1;
464  }
465  if (dbuf[i] >= bufGrEnum.no_str) {
466  fprintf(stderr, "Warning: enum index value '%s' may be too large.\n",
467  *(argv+optind+i));
468  }
469  }
470  dbrType = DBR_DOUBLE;
471 
472  } else { /* Interpret values as strings */
473 
474  for (i = 0; i < count; ++i) {
475  epicsStrnRawFromEscaped(sbuf[i], sizeof(EpicsStr), *(argv+optind+i), sizeof(EpicsStr));
476  *( sbuf[i]+sizeof(EpicsStr)-1 ) = '\0';
477  dbrType = DBR_STRING;
478 
479  /* Compare to ENUM strings */
480  for (len = 0; len < bufGrEnum.no_str; len++)
481  if (!strcmp(sbuf[i], bufGrEnum.strs[len]))
482  break;
483 
484  if (len >= bufGrEnum.no_str) {
485  /* Not a string? Try as number */
486  dbuf[i] = epicsStrtod(sbuf[i], &pend);
487  if (sbuf[i] == pend || enumAsString) {
488  fprintf(stderr, "Enum string value '%s' invalid.\n", sbuf[i]);
489  return 1;
490  }
491  if (dbuf[i] >= bufGrEnum.no_str) {
492  fprintf(stderr, "Warning: enum index value '%s' may be too large.\n", sbuf[i]);
493  }
494  dbrType = DBR_DOUBLE;
495  }
496  }
497  }
498 
499  } else { /* Not an ENUM */
500 
501  if (charArrAsStr) {
502  dbrType = DBR_CHAR;
503  ebuf = calloc(len, sizeof(char));
504  if(!ebuf) {
505  fprintf(stderr, "Memory allocation failed\n");
506  return 1;
507  }
508  count = epicsStrnRawFromEscaped(ebuf, len, cbuf, len-1) + 1;
509  } else {
510  for (i = 0; i < count; ++i) {
511  epicsStrnRawFromEscaped(sbuf[i], sizeof(EpicsStr), *(argv+optind+i), sizeof(EpicsStr));
512  *( sbuf[i]+sizeof(EpicsStr)-1 ) = '\0';
513  }
514  dbrType = DBR_STRING;
515  }
516  }
517 
518  /* Read and print old data */
519  if (format != terse) {
520  printf("Old : ");
521  result = caget(pvs, nPvs, format, 0, 0);
522  }
523 
524  /* Write new data */
525  if (dbrType == DBR_STRING) pbuf = sbuf;
526  else if (dbrType == DBR_CHAR) pbuf = ebuf;
527  else pbuf = dbuf;
528 
529  if (request == callback) {
530  /* Use callback version of put */
531  pvs[0].status = ECA_NORMAL; /* All ok at the moment */
532  result = ca_array_put_callback (
533  dbrType, count, pvs[0].chid, pbuf, put_event_handler, (void *) pvs);
534  } else {
535  /* Use standard put with defined timeout */
536  result = ca_array_put (dbrType, count, pvs[0].chid, pbuf);
537  }
538  if (result != ECA_NORMAL) {
539  fprintf(stderr, "Error from put operation: %s\n", ca_message(result));
540  return 1;
541  }
542 
543  result = ca_pend_io(caTimeout);
544  if (result == ECA_TIMEOUT) {
545  fprintf(stderr, "Write operation timed out: Data was not written.\n");
546  return 1;
547  }
548  if (request == callback) { /* Also wait for callbacks */
549  waitStatus = epicsEventWaitWithTimeout( epId, caTimeout );
550  if (waitStatus)
551  fprintf(stderr, "Write callback operation timed out\n");
552 
553  /* retrieve status from callback */
554  result = pvs[0].status;
555  }
556 
557  if (result != ECA_NORMAL) {
558  fprintf(stderr, "Error occured writing data: %s\n", ca_message(result));
559  return 1;
560  }
561 
562  /* Read and print new data */
563  if (format != terse)
564  printf("New : ");
565 
566  result = caget(pvs, nPvs, format, 0, 0);
567 
568  /* Shut down Channel Access */
570 
571  return result;
572 }
RequestT
Definition: caget.c:48
#define DBR_CHAR
Definition: db_access.h:74
RequestT
Definition: caput.c:50
#define DBR_STRING
Definition: db_access.h:69
int getopt(int nargc, char *const *nargv, const char *ostr)
Definition: epicsGetopt.c:65
void print_time_val_sts(pv *pv, unsigned long reqElems)
Definition: tool_lib.c:503
#define dbr_type_is_ENUM(type)
Definition: db_access.h:664
Definition: link.h:174
pvac::PutEvent result
Definition: clientSync.cpp:117
std::string request
capri caPriority
Definition: tool_lib.c:56
long dbfType
Definition: tool_lib.h:71
Definition: caput.c:50
pvd::Status status
char fieldSeparator
Definition: tool_lib.c:51
OutputT
Definition: caput.c:47
size_t epicsStrnEscapedFromRawSize(const char *src, size_t srclen)
Definition: epicsString.c:170
int i
Definition: scan.c:967
#define DEFAULT_TIMEOUT
Definition: tool_lib.h:50
LIBCA_API int epicsStdCall ca_array_put_callback(chtype type, unsigned long count, chid chanId, const void *pValue, caEventCallBackFunc *pFunc, void *pArg)
int optind
Definition: epicsGetopt.c:50
#define DBR_GR_ENUM
Definition: db_access.h:97
LIBCA_API unsigned long epicsStdCall ca_element_count(chid chan)
LIBCA_API enum channel_state epicsStdCall ca_state(chid chan)
#define CA_PRIORITY_MAX
Definition: cadef.h:190
Definition: tool_lib.h:67
int epicsStdCall ca_pend_io(ca_real timeout)
Definition: access.cpp:484
#define printf
Definition: epicsStdio.h:41
void * value
Definition: tool_lib.h:76
LIBCOM_API epicsEventStatus epicsEventWaitWithTimeout(epicsEventId id, double timeOut)
Wait an the event or until the specified timeout period is over.
Definition: osdEvent.c:117
Definition: cadef.h:166
#define DBR_TIME_INT
Definition: db_access.h:86
dbfType
Definition: dbFldTypes.h:24
int status
Definition: tool_lib.h:75
int charArrAsStr
Definition: tool_lib.c:54
#define epicsStrtod
Definition: osdStrtod.h:15
OutputT
Definition: caget.c:45
#define LINE_BUFFER(stream)
Definition: tool_lib.h:53
#define epicsScanDouble(str, to)
Definition: epicsStdlib.h:78
LIBCA_API short epicsStdCall ca_field_type(chid chan)
#define ECA_DISCONN
Definition: caerr.h:101
#define dbr_type_is_CHAR(type)
Definition: db_access.h:667
int optopt
Definition: epicsGetopt.c:50
#define dbr_value_ptr(PDBR, DBR_TYPE)
Definition: db_access.h:540
int epicsStdCall ca_context_create(ca_preemptive_callback_select premptiveCallbackSelect)
Definition: access.cpp:172
#define ECA_NORMAL
Definition: caerr.h:77
#define epicsEventSignal(ID)
A synonym for epicsEventTrigger().
Definition: epicsEvent.h:172
Definition: caput.c:47
LIBCA_API int epicsStdCall ca_array_put(chtype type, unsigned long count, chid chanId, const void *pValue)
#define DEFAULT_CA_PRIORITY
Definition: tool_lib.h:49
int caget(pv *pvs, int nPvs, OutputT format, chtype dbrType, unsigned long reqElems)
Definition: caput.c:128
#define DBR_TIME_STRING
Definition: db_access.h:85
long dbrType
Definition: tool_lib.h:72
#define DBR_DOUBLE
Definition: db_access.h:76
LIBCA_API int epicsStdCall ca_array_get(chtype type, unsigned long count, chid chanId, void *pValue)
char onceConnected
Definition: tool_lib.h:80
int main(int argc, char *argv[])
Definition: caput.c:258
char * val2str(const void *v, unsigned type, int index)
Definition: tool_lib.c:109
int putenv(char *)
#define stdout
Definition: epicsStdio.h:30
dbr_short_t no_str
Definition: db_access.h:353
unsigned long nElems
Definition: tool_lib.h:73
int connect_pvs(pv *pvs, int nPvs)
Definition: tool_lib.c:621
epicsUInt8 dbr_char_t
Definition: db_access.h:39
APIs for the epicsEvent binary semaphore.
#define DBR_ENUM
Definition: db_access.h:73
const char *epicsStdCall ca_message(long ca_status)
Definition: access.cpp:561
const char *epicsStdCall ca_version()
Definition: access.cpp:641
long chtype
Definition: cadef.h:47
void usage(void)
Definition: caput.c:58
Definition: caput.c:47
#define MAX_STRING_SIZE
Definition: epicsTypes.h:65
#define dbr_size_n(TYPE, COUNT)
Definition: db_access.h:518
unsigned long reqElems
Definition: tool_lib.h:74
#define ECA_NORDACCESS
Definition: caerr.h:123
#define ECA_TIMEOUT
Definition: caerr.h:87
char EpicsStr[MAX_STRING_SIZE]
Definition: caput.c:53
Definition: caput.c:47
#define stderr
Definition: epicsStdio.h:32
char * name
Definition: tool_lib.h:69
void epicsStdCall ca_context_destroy()
Definition: access.cpp:232
int enumAsNr
Definition: tool_lib.c:53
void put_event_handler(struct event_handler_args args)
Definition: caput.c:100
char * optarg
Definition: epicsGetopt.c:55
LIBCOM_API epicsEventId epicsEventCreate(epicsEventInitialState initialState)
Create an epicsEvent for use from C code, or return NULL.
Definition: osdEvent.c:47
void * usr
Definition: cadef.h:85
double caTimeout
Definition: tool_lib.c:55
int epicsStrnEscapedFromRaw(char *dst, size_t dstlen, const char *src, size_t srclen)
Definition: epicsString.c:129
int epicsStrnRawFromEscaped(char *dst, size_t dstlen, const char *src, size_t srclen)
Definition: epicsString.c:37
char strs[MAX_ENUM_STATES][MAX_ENUM_STRING_SIZE]
Definition: db_access.h:354
#define dbf_type_to_DBR_TIME(type)
Definition: db_access.h:705