version 1.10, 2004/03/03 06:09:29 |
version 1.13, 2004/03/04 06:29:16 |
|
|
/* $OpenXM: OpenXM/src/kxx/ox_texmacs.c,v 1.9 2004/03/03 02:31:50 takayama Exp $ */ |
/* $OpenXM: OpenXM/src/kxx/ox_texmacs.c,v 1.12 2004/03/03 12:27:31 takayama Exp $ */ |
|
|
#include <stdio.h> |
#include <stdio.h> |
#include <setjmp.h> |
#include <setjmp.h> |
Line 103 main(int argc,char *argv[]) { |
|
Line 103 main(int argc,char *argv[]) { |
|
}else if (strcmp(argv[i],"--k0") == 0) { |
}else if (strcmp(argv[i],"--k0") == 0) { |
TM_Engine = K0; |
TM_Engine = K0; |
}else{ |
}else{ |
printv("Unknown option\n"); |
/* printv("Unknown option\n"); */ |
} |
} |
} |
} |
|
|
Line 192 main(int argc,char *argv[]) { |
|
Line 192 main(int argc,char *argv[]) { |
|
else printv("Output is too large.\n"); |
else printv("Output is too large.\n"); |
}else{ |
}else{ |
KSexecuteString(" ox.engine 1 oxpops "); /* Discard the result. */ |
KSexecuteString(" ox.engine 1 oxpops "); /* Discard the result. */ |
|
/* Push and pop dummy data to wait until the computation finishes. */ |
|
KSexecuteString(" ox.engine 0 oxpushcmo ox.engine oxpopcmo "); |
|
ob = KSpop(); |
printv(""); |
printv(""); |
} |
} |
} |
} |
Line 219 static char *readString(FILE *fp, char *prolog, char * |
|
Line 222 static char *readString(FILE *fp, char *prolog, char * |
|
int i; |
int i; |
int m; |
int m; |
int start; |
int start; |
|
struct object ob; |
if (limit == 0) { |
if (limit == 0) { |
limit = 1024; |
limit = 1024; |
s = (char *)sGC_malloc(limit); |
s = (char *)sGC_malloc(limit); |
Line 252 static char *readString(FILE *fp, char *prolog, char * |
|
Line 256 static char *readString(FILE *fp, char *prolog, char * |
|
s[n++] = c; s[n] = 0; m++; |
s[n++] = c; s[n] = 0; m++; |
INC_BUF ; |
INC_BUF ; |
} |
} |
if (s[n-1] == '$' && TM_Engine == ASIR) { |
|
TM_do_not_print = 1; s[n-1] = ' '; |
|
} else if (s[n-1] == ';' && TM_Engine == SM1) { |
|
TM_do_not_print = 1; s[n-1] = ' '; |
|
} else TM_do_not_print = 0; |
|
/* Check the escape sequence */ |
/* Check the escape sequence */ |
if (strcmp(&(s[start]),"!quit;") == 0) { |
if (strcmp(&(s[start]),"!quit;") == 0) { |
printv("Terminated the process ox_texmacs.\n"); |
printv("Terminated the process ox_texmacs.\n"); |
exit(0); |
exit(0); |
} |
} |
/* Check the escape sequence to change the globa env. */ |
/* Check the escape sequence to change the global env. */ |
if (strcmp(&(s[start]),"!verbatim;") == 0) { |
if (strcmp(&(s[start]),"!verbatim;") == 0) { |
printv("Output mode is changed to verbatim mode."); |
printv("Output mode is changed to verbatim mode."); |
Format=0; |
Format=0; |
Line 288 static char *readString(FILE *fp, char *prolog, char * |
|
Line 287 static char *readString(FILE *fp, char *prolog, char * |
|
TM_Engine=K0; startEngine(TM_Engine,"k0"); |
TM_Engine=K0; startEngine(TM_Engine,"k0"); |
return NULL; |
return NULL; |
} |
} |
|
if (strcmp(&(s[start]),"!reset;") == 0) { |
|
printf("%s",DATA_BEGIN_V); |
|
KSexecuteString(" ox.engine oxreset ox.engine oxpopcmo "); |
|
ob = KSpop(); |
|
printf("%s",DATA_END); fflush(stdout); |
|
return NULL; |
|
} |
|
|
|
/* Set TM_do_no_print */ |
|
if (s[n-1] == '$' && TM_Engine == ASIR) { |
|
TM_do_not_print = 1; s[n-1] = ' '; |
|
} else if (s[n-1] == ';' && TM_Engine == SM1) { |
|
TM_do_not_print = 1; s[n-1] = ' '; |
|
} else TM_do_not_print = 0; |
|
|
for (i=0; i < strlen(epilog); i++) { |
for (i=0; i < strlen(epilog); i++) { |
s[n++] = epilog[i]; s[n] = 0; |
s[n++] = epilog[i]; s[n] = 0; |
INC_BUF ; |
INC_BUF ; |
Line 321 static void printp(char *s) { |
|
Line 334 static void printp(char *s) { |
|
static void printCopyright(char *s) { |
static void printCopyright(char *s) { |
printf("%s",DATA_BEGIN_V); |
printf("%s",DATA_BEGIN_V); |
printf("OpenXM engine (ox engine) interface for TeXmacs\n2004 (C) openxm.org"); |
printf("OpenXM engine (ox engine) interface for TeXmacs\n2004 (C) openxm.org"); |
printf(" under the BSD licence. !asir; !sm1; !k0; !verbatim;"); |
printf(" under the BSD licence. !asir; !sm1; !k0; !verbatim;\n"); |
|
printf("Type in !reset; when the engine gets confused. "); |
printf("%s",s); |
printf("%s",s); |
printf("%s",DATA_END); |
printf("%s",DATA_END); |
fflush(NULL); |
fflush(NULL); |