This is Unofficial EPICS BASE Doxygen Site
ascheck.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 is distributed subject to a Software License Agreement found
7 * in file LICENSE that is included with this distribution.
8 \*************************************************************************/
9 
10 /* Author: Marty Kraimer Date: 03-24-94 */
11 
12 #include <stdlib.h>
13 #include <stddef.h>
14 #include <stdio.h>
15 #include <string.h>
16 
17 #include "asLib.h"
18 #include "dbStaticLib.h"
19 #include "errlog.h"
20 
21 int main(int argc,char **argv)
22 {
23  int argn = 1;
24  char *sub = NULL;
25  int subLength = 0;
26  char **pstr;
27  char *psep;
28  int *len;
29  long status = 0;
30  static char *subSep = ",";
31 
32  /* Look for -Smacro=value options */
33  while (argc>argn && (strncmp(argv[argn], "-S", 2)==0)) {
34  pstr = &sub;
35  psep = subSep;
36  len = &subLength;
37  if (strlen(argv[argn])==2) {
38  dbCatString(pstr, len, argv[++argn], psep);
39  } else {
40  dbCatString(pstr, len, argv[argn]+2, psep);
41  }
42  argn++;
43  }
44  if (argc == argn) {
45  status = asInitFP(stdin, sub);
46  if(status) errlogPrintf("ascheck: Access Security File failed.\n");
47  } else if (argc == argn+1) {
48  status = asInitFile(argv[argn], sub);
49  if(status) errlogPrintf("ascheck: Access Security File failed.\n");
50  } else {
51  printf("usage: ascheck [-Smac=sub ...] [<] file\n");
52  status = -1;
53  }
54  errlogFlush();
55  return status;
56 }
void errlogFlush(void)
Definition: errlog.c:529
LIBCOM_API long epicsStdCall asInitFile(const char *filename, const char *substitutions)
pvd::Status status
#define printf
Definition: epicsStdio.h:41
void dbCatString(char **string, int *stringLength, char *src, char *separator)
Definition: dbStaticLib.c:375
#define NULL
Definition: catime.c:38
LIBCOM_API long epicsStdCall asInitFP(FILE *fp, const char *substitutions)
int errlogPrintf(const char *pFormat,...)
Definition: errlog.c:105
#define stdin
Definition: epicsStdio.h:28
int main(int argc, char **argv)
Definition: ascheck.c:21