[BACK]Return to sm.c CVS log [TXT][DIR] Up to [local] / OpenXM / src / kan96xx / Kan

Annotation of OpenXM/src/kan96xx/Kan/sm.c, Revision 1.29

1.29    ! takayama    1: /* sm.c   $OpenXM: OpenXM/src/kan96xx/Kan/sm.c,v 1.28 2015/09/19 09:56:06 takayama Exp $ */
1.26      takayama    2: #define DATE "2005/06/15"
                      3: #define RELEASE "3.050615"    /* This "string" must be an increasing seq.*/
1.15      takayama    4: /* You should write the same string in global.c
                      5:                      VersionString for ox_sm1.
                      6:                  Change also OxVersion in plugin/oxmisc.c
                      7:                  if you install new openXM protocol.*/
1.1       maekawa     8:
                      9: #include <stdio.h>
1.27      ohara      10: #include <stdlib.h>
1.1       maekawa    11: #include "datatype.h"
                     12: #include "stackm.h"
                     13: #include "extern.h"
                     14: /*  Release 2.981108 (1998, 11/8 --Sunday) ftp, source, binary-linux
                     15:                      packages; bfunction, hol, gkz, appell.
                     16:     Release 2.981117 (1998, 11/17 --Tuesday)
                     17:                      packages; resol0, r-interface (new), oxasir(new)
                     18:                      bugfix : KdefaultPolyRing, hilbert.c
                     19:     Release 2.981123 bugfix : flush for solaris. bugfix : lockctrlCForOx().
                     20:     Release 2.981217 Rather stable release.
1.15      takayama   21:     New project on CMO starts.
1.1       maekawa    22:
                     23: */
                     24:
                     25: extern int StandardMacros;
                     26: extern int StartAFile;
                     27: extern char *StartFile;
                     28: extern int StartAString;
                     29: extern char *StartString;
                     30: extern int Quiet;
                     31: extern char *VersionString;
1.28      takayama   32: //extern unsigned int GC_version;
1.1       maekawa    33:
                     34: main(argc,argv)
1.15      takayama   35:      int argc;
                     36:      char *argv[];
1.1       maekawa    37: {
                     38:   int i;
1.28      takayama   39:   int gc_version;
1.1       maekawa    40:   StandardMacros = 1;
                     41:   VersionString = RELEASE;
                     42:   if (argc > 1) {
                     43:     for (i=1; i<argc; i++) {
                     44:       if (strcmp(argv[i],"-standardmacros") == 0) {
1.15      takayama   45:         StandardMacros = 0; /* disable of the standard macros */
1.1       maekawa    46:       }else if (strcmp(argv[i],"-f") == 0) {
1.15      takayama   47:         StartAFile = 1;
                     48:         i++;
                     49:         if (i >= argc) {
                     50:           fprintf(stderr,"Usage: 1. sm1\n2. sm1 -f filename\n");
                     51:           fprintf(stderr,"3. sm1 -standardmacros\n");
                     52:           exit(15);
                     53:         }
                     54:         StartFile = argv[i];
1.1       maekawa    55:       }else if (strcmp(argv[i],"-s") == 0) {
1.15      takayama   56:         StartAString = 1;
                     57:         i++;
                     58:         if (i >= argc) {
                     59:           fprintf(stderr,"Usage: 1. sm1\n2. sm1 -f filename\n");
                     60:           fprintf(stderr,"3. sm1 -standardmacros\n");
                     61:           fprintf(stderr,"4. sm1 -q  (quiet)\n");
                     62:           fprintf(stderr,"5. sm1 -s \"command strings\" \n");
                     63:           exit(15);
                     64:         }
                     65:         StartString = argv[i];
1.1       maekawa    66:       } else if (strcmp(argv[i],"-q") == 0) {
1.15      takayama   67:         Quiet = 1;
1.1       maekawa    68:       }else{
1.15      takayama   69:         fprintf(stderr,"Usage: 1. sm1\n2. sm1 -f filename\n");
                     70:         fprintf(stderr,"3. sm1 -standardmacros\n");
                     71:         fprintf(stderr,"4. sm1 -q  (quiet)\n");
                     72:         fprintf(stderr,"5. sm1 -s \"command strings\" \n");
                     73:         exit(15);
1.1       maekawa    74:       }
                     75:     }
                     76:   }
                     77:
1.29    ! takayama   78:   stackmachine_init(); /* GC is also initialized here */
1.28      takayama   79:   gc_version = GC_get_version();
1.1       maekawa    80:   if (!Quiet) {
                     81:     fprintf(Fstack,"\n");
                     82:     fprintf(Fstack,"Kan/StackMachine1");
1.25      takayama   83:     fprintf(Fstack,"                         1991 April --- 2004.\n");
1.1       maekawa    84:     fprintf(Fstack,"                              Release %s (C) N. Takayama\n",
1.15      takayama   85:             RELEASE);
1.28      takayama   86:     fprintf(Fstack,"gc %d.%d-%d (C) Boehm, Demers, Xerox, SGI, HP,\nGNU MP 4.1 (C) Free Software Foundation,\n",gc_version >>16, (gc_version >> 8)&0xff,gc_version & 0xff);
1.20      takayama   87:     fprintf(Fstack,"OpenXM RFC100, 101, 103 (C) OpenXM developing team. \n");
1.25      takayama   88:     fprintf(Fstack,"This software may be freely distributed  ");
1.20      takayama   89:     fprintf(Fstack,"with no warranty expressed. \nSee OpenXM/Copyright/Copyright.generic\n");
1.1       maekawa    90:     fprintf(Fstack,"Info: http://www.math.kobe-u.ac.jp/KAN, kan@math.kobe-u.ac.jp. ? for help.\n");
                     91: #ifdef NOGC
                     92:     fprintf(Fstack,"No garbage collector is installed.\n");
                     93: #endif
                     94:   }
                     95:   KinitKan();
                     96:   if (!Quiet) {
                     97:     fprintf(Fstack,"\nReady\n\n");
                     98:   }
                     99:   scanner();
                    100:   Kclose();  stackmachine_close();
                    101: }
                    102:
                    103:
                    104:

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>