This is Unofficial EPICS BASE Doxygen Site
acctstRegister.cpp
Go to the documentation of this file.
1 /*************************************************************************\
2 * Copyright (c) 2002 The University of Chicago, 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 
10 /*
11  * CA client library diagnostics IOC shell registration
12  * Authors:
13  * Jeff Hill
14  */
15 
16 #include <iocsh.h>
17 #include "caDiagnostics.h"
18 
19 /* Information needed by iocsh */
20 static const iocshArg acctstArg0 = { "channel name", iocshArgString };
21 static const iocshArg acctstArg1 = { "interest level", iocshArgInt };
22 static const iocshArg acctstArg2 = { "channel count", iocshArgInt };
23 static const iocshArg acctstArg3 = { "repetition count", iocshArgInt };
24 static const iocshArg acctstArg4 = { "preemptive callback select", iocshArgInt };
25 
26 static const iocshArg *acctstArgs[] =
27 {
28  &acctstArg0,
29  &acctstArg1,
30  &acctstArg2,
31  &acctstArg3,
32  &acctstArg4
33 };
34 static const iocshFuncDef acctstFuncDef = {"acctst", 5, acctstArgs};
35 
36 
37 /* Wrapper called by iocsh, selects the argument types that print needs */
38 static void acctstCallFunc(const iocshArgBuf *args) {
39  if ( args[1].ival < 0 ) {
40  printf ( "negative interest level not allowed\n" );
41  return;
42  }
43  if ( args[2].ival < 0 ) {
44  printf ( "negative channel count not allowed\n" );
45  return;
46  }
47  if ( args[3].ival < 0 ) {
48  printf ( "negative repetition count not allowed\n" );
49  return;
50  }
51  acctst (
52  args[0].sval, /* channel name */
53  ( unsigned ) args[1].ival, /* interest level */
54  ( unsigned ) args[2].ival, /* channel count */
55  ( unsigned ) args[3].ival, /* repetition count */
56  ( ca_preemptive_callback_select ) args[4].ival ); /* preemptive callback select */
57 }
58 
59 struct AutoInit {
60  AutoInit ();
61 };
62 
64 {
65  iocshRegister ( &acctstFuncDef, acctstCallFunc );
66 }
67 
69 
ca_preemptive_callback_select
Definition: cadef.h:175
#define printf
Definition: epicsStdio.h:41
void epicsStdCall iocshRegister(const iocshFuncDef *piocshFuncDef, iocshCallFunc func)
Definition: iocsh.cpp:111
AutoInit autoInit
int acctst(const char *pName, unsigned interestLevel, unsigned channelCount, unsigned repetitionCount, enum ca_preemptive_callback_select select)
Definition: acctst.c:3398
Definition: iocsh.h:56