[BACK]Return to dm.c CVS log [TXT][DIR] Up to [local] / OpenXM / src / k097

Annotation of OpenXM/src/k097/dm.c, Revision 1.4

1.4     ! takayama    1: /* $OpenXM: OpenXM/src/k097/dm.c,v 1.3 2003/07/21 12:41:22 takayama Exp $ */
1.1       maekawa     2: #include <stdio.h>
                      3: #include "d.h"
                      4:
                      5: int K00_verbose = 0;
                      6: extern int DebugMode;
                      7:
                      8: /* dm.c main program of d. */
                      9: main(int argc, char *argv[]) {
                     10:   int i;
                     11:   DebugMode = 0;
                     12:   if (argc >= 2) {
                     13:     for (i=1; i < argc; i++) {
                     14:       if (strcmp(argv[i],"-DebugMode") == 0) {
                     15:        /* fprintf(stderr,"DebugMode = 1\n"); */
                     16:        DebugMode = 1;
                     17:       }else{
                     18:        fprintf(stderr,"d0 -DebugMode\n");
                     19:       }
                     20:     }
                     21:   }
                     22:   parseAfile(stdin);
                     23:   /*  parseAstring("print(1+2);\nx=1+2;\n"); tests */
                     24:   KCparse();
                     25:   exit(0);
                     26: }
                     27:
                     28:
                     29: void pkkan(s)
                     30: char *s;
                     31: {
                     32:   printf("%s",s);
                     33: }
                     34:
                     35: void *mymalloc(int size) {
                     36:   return((void *)malloc(size));
                     37: }
                     38:
                     39: void *GC_malloc(int size) {
                     40:   return((void *)malloc(size));
1.3       takayama   41: }
                     42: void *sGC_malloc(int size) {
                     43:   return ((void *) GC_malloc(size));
1.1       maekawa    44: }
                     45:
                     46: sendKan(int p) { /* do nothing */ }
                     47:
                     48: /*           test new function           */
                     49: void testNewFunction(objectp op)
                     50: {
                     51:   if (op->tag != Sstring) {
                     52:     fprintf(stderr,"The argument must be given as an argment of load.\n");
                     53:     return;
                     54:   }
                     55:   fprintf(stderr,"Now execute .. <<%s>> \n",op->lc.str);
                     56:   parseAstring(op->lc.str);
                     57:   fprintf(stderr,"\nDone.\n");
                     58: }
                     59:
                     60: struct object KSpop() {
1.4     ! takayama   61:   struct object obj = OINIT;
1.1       maekawa    62:   obj.tag = 0;
                     63:   fprintf(stderr," Do not use Test.\n");
                     64:   return(obj);
                     65: }
                     66:
                     67: void pkdebug(char *s0,char *s1, char *s2,char *s3) {
                     68:   if (DebugMode) {
                     69:     pkkan(" db.DebugStack setstack $");
                     70:     pkkan(s0); pkkan(s1); pkkan(s2); pkkan(s3);
                     71:     pkkan("$  stdstack \n");
                     72:   }
                     73: }
                     74:
                     75: void pkdebug2(void) {
                     76:   if (DebugMode) {
                     77:     pkkan(" db.DebugStack setstack pop stdstack \n");
                     78:   }
                     79: }
                     80:

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