This is Unofficial EPICS BASE Doxygen Site
ascheck.c File Reference
#include <stdlib.h>
#include <stddef.h>
#include <stdio.h>
#include <string.h>
#include "asLib.h"
#include "dbStaticLib.h"
#include "errlog.h"
+ Include dependency graph for ascheck.c:

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 21 of file ascheck.c.

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