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