1 #include "defs.h"
2
3 # define NPT 25000
4 # define PSP 1000000
5 # define SVSP 500000
6 # define MP 500
7 # define MB 80
8
9 /* NPT = max no of points, MP = max no of perms, PSP = space for perms,
10 SVSP = space for Schreier vectors, MB-1 = max no of base pts.
11 */
12 char wrd,nt,isbase,inf[80],outf1[80],outf2[80],fixed[NPT+1];
13 /* defaults: inf gpname.inperm
14 outf1 gpname.outperm
15 outf2 gpname.words
16 */
17 int perm[PSP],sv[SVSP],cp[5*NPT],actgen[MP],orb[NPT+1],
18 base[MB],lorb[MB],order[MB],pno[MP/2], *pptr[MP],*svptr[MB],
19 mp=MP,mb=MB-1,mnpt=NPT;
20 int psp=PSP,svsp=SVSP;
21
22 int
main(int argc,char * argv[])23 main (int argc, char *argv[])
24 { int arg; char d,err;
25 nt=wrd=isbase=0; err=0; arg=1;
26 if (argc<=arg) {err=1; goto error;}
27 while (argv[arg][0]=='-')
28 { d=argv[arg][1]; arg++;
29 if (d=='w') wrd=1; else if (d=='n') nt=1;
30 else if (d=='b') isbase=1;
31 else {err=1;goto error;}
32 if (argc<=arg) {err=1;goto error;}
33 }
34 strcpy(inf,argv[arg]); strcat(inf,"."); strcpy(outf1,inf);
35 if (wrd) {strcpy(outf2,inf); strcat(outf2,"words");}
36 arg++; if (argc<=arg) strcat(inf,"inperm"); else strcat(inf,argv[arg]);
37 arg++; if (argc<=arg) strcat(outf1,"outperm"); else strcat(outf1,argv[arg]);
38 if (gpprog()== -1) exit(1);
39 error:
40 if (err)
41 { fprintf(stderr,"Usage: gprun [-n] [-w] [-b] gpname [inf] [outf1].\n");
42 exit(1);
43 }
44 else exit(0);
45 }
46