1 #include "defs.h"
2 
3 # define PSP    2000000
4 # define SVSP   600000
5 # define  NPT    32767
6 # define  MP     1000
7 # define  MB      80
8 
9 char heqg,words,fullg,check,inf1[80],inf2[80],inf3[80],outf0[80],outf[80];
10 /* inf1 = gpname.outperm = inf2
11    inf3=gpname.inperm (in default case for inf1 only)
12    inf1=inf2 if -e set
13    outf defined by user of program interactively
14    outf0 used to remember groupname.
15 */
16 short  perm[PSP],sv[SVSP],cp[10*NPT],actgen[MP],orb[NPT+1],
17        base[MB],lorbc[MB],lorbg[MB],lorbh[MB],pno[MP/2],*pptr[MP],
18        *svptr1[MB],*svptr2[MB],*svptr3[MB],scpf[MB],scps[MB],sadpt[MB],
19        mp=MP,mb=MB-1;
20 int psp=PSP,svsp=SVSP;
21 
22 int
main(int argc,char * argv[])23 main (int argc, char *argv[])
24 { short arg;  char c,d,err;
25   check=err=words=heqg=0; arg=1; if (argc<=arg) {err=1; goto error;}
26   while ((c=argv[arg][0])=='-')
27   { d=argv[arg][1]; arg++; if (argc<=arg) {err=1;goto error;}
28     if (d=='e') heqg=1; else if (d=='w') words=1;
29     else if (d=='t') check=1;
30     else {err=1; goto error;}
31   }
32   strcpy(inf1,argv[arg]); strcat(inf1,"."); strcpy(outf0,inf1);
33   strcpy(inf2,inf1); strcpy(inf3,inf1); strcat(inf3,"inperm");
34   if (heqg==0)
35   { arg++; if (argc<=arg) heqg=1; else strcat(inf2,argv[arg]); }
36   arg++; if (argc<=arg) {fullg=1; strcat(inf1,"outperm");}
37   else { strcat(inf1,argv[arg]); fullg=0; }
38   if (optprog()== -1) exit(1);
39 error:  if (err)
40   { fprintf(stderr,"Usage:   optrun [-e] [-w] [-t] gpname [inf2] [inf1].\n");
41     exit(1);
42   }
43   exit(0);
44 }
45