This is Unofficial EPICS BASE Doxygen Site
catimeMain.c
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 Versions 3.13.7
7 * and higher are distributed subject to a Software License Agreement found
8 * in file LICENSE that is included with this distribution.
9 \*************************************************************************/
10 
11 #include <stdio.h>
12 #include <stdlib.h>
13 
14 #include "caDiagnostics.h"
15 
16 static const unsigned defaultIterations = 10000u;
17 
18 int main ( int argc, char **argv )
19 {
20  const char *pUsage = "<PV name> [<channel count> [<append number to pv name if true>]]";
21 
22  if ( argc > 1 ) {
23  char *pname = argv[1];
24  if ( argc > 2 ) {
25  int iterations = atoi (argv[2]);
26  if ( iterations > 0) {
27  if ( argc > 3 ) {
28  if ( argc == 4 ) {
29  int status;
30  unsigned appendNumberBool;
31  status = sscanf ( argv[3], " %u ", &appendNumberBool );
32  if ( status == 1 ) {
33  if ( appendNumberBool ) {
34  return catime ( pname, (unsigned) iterations, appendNumber );
35  }
36  else {
37  return catime ( pname, (unsigned) iterations, dontAppendNumber );
38  }
39  }
40  }
41  }
42  else {
43  return catime ( pname, (unsigned) iterations, dontAppendNumber );
44  }
45  }
46  }
47  else {
48  return catime ( pname, defaultIterations, dontAppendNumber );
49  }
50  }
51  printf ( "usage: %s %s\n", argv[0], pUsage);
52  return -1;
53 }
pvd::Status status
#define printf
Definition: epicsStdio.h:41
int main(int argc, char **argv)
Definition: catimeMain.c:18
const std::string pname
int catime(const char *channelName, unsigned channelCount, enum appendNumberFlag appNF)
Definition: catime.c:531