/* * $ZEL$ */ #include "test_3100.h" u_int32_t* buf; int bufsize; struct path* pathes; int numpathes; static void printusage(int argc, char* argv[]) { printf("usage: %s [-h] pathnames...\n", argv[0]); } static void printhelp(int argc, char* argv[]) { printf("printhelp not yet implemented\n"); } static int getoptions(int argc, char* argv[]) { extern char *optarg; extern int optind; extern int opterr; extern int optopt; int errflag, c, i; const char* args="h"; optarg=0; errflag=0; while (!errflag && ((c=getopt(argc, argv, args))!=-1)) { switch (c) { case 'h': printhelp(argc, argv); break; default: errflag++; } } if (errflag || optind==argc) { printusage(argc, argv); return -1; } numpathes=argc-optind; pathes=malloc(numpathes*sizeof(struct path)); for (i=0; i0 printf("%s is compiled for version %d.%d of sis1100 driver\n", argv[0], MAJORVERSION, MINORVERSION); #else printf("the version %s is compiled for is not known; we assume %d.%d\n", argv[0], MAJORVERSION, MINORVERSION); #endif if (getoptions(argc, argv)<0) return 1; bufsize=1024000; buf=calloc(bufsize, 4); if (!buf) { printf("\ncannot allocate %d words\n", bufsize); return -1; } srandom(17); for (i=0; i