=================================================================== RCS file: /home/cvs/OpenXM/src/kxx/ox_texmacs.c,v retrieving revision 1.39 retrieving revision 1.42 diff -u -p -r1.39 -r1.42 --- OpenXM/src/kxx/ox_texmacs.c 2016/03/31 05:27:34 1.39 +++ OpenXM/src/kxx/ox_texmacs.c 2018/09/07 01:21:31 1.42 @@ -1,4 +1,4 @@ -/* $OpenXM: OpenXM/src/kxx/ox_texmacs.c,v 1.38 2015/10/10 11:29:46 takayama Exp $ */ +/* $OpenXM: OpenXM/src/kxx/ox_texmacs.c,v 1.41 2018/09/07 00:28:53 takayama Exp $ */ #include #include @@ -28,32 +28,44 @@ #define GENERIC 0 /* DEBUG, xml */ #define V_TEXMACS 1 #define V_CFEP 2 +#define V_QFEP 3 +#define V_SAGE 4 int View = V_TEXMACS ; char *Data_begin_v[] = { "", "\002verbatim:", "\002", + "", + "" }; char *Data_begin_l[] = { "", "\002latex:", - "\002latex:" + "\002latex:", + "", + "" }; char *Data_begin_p[] = { "", "\002prompt:", - "\002prompt:" + "\002prompt:", + "", + "" }; char *Data_begin_ps[] = { "", "\002ps:", - "\002ps:" + "\002ps:", + "", + "" }; char *Data_end[] = { "", "\005", - "\n\005" /* \n is not a part of the protocol. */ + "\n\005", /* \n is not a part of the protocol. */ + "", + "" /* SAGE */ }; /* todo: start_of_input */ @@ -61,9 +73,20 @@ char *Data_end[] = { char End_of_input[] = { 0x5, /* Use ^E and Return to end the input. */ '\n', /* TEXMACS_END_OF_INPUT. 0xd should be used for multiple lines. */ - 0x5 /* CFEP_END_OF_INPUT */ + 0x5, /* CFEP_END_OF_INPUT */ + 0x5, + '\n' /* SAGE cf. __init__ */ }; +char *Prompt[]={ + "generic>", /* generic */ + "", /* texmacs */ + "", /* cfep */ + "", /* qfep */ + "\nasir>" /* SAGE */ +}; + + /* Table for the engine type. */ #define ASIR 1 #define SM1 2 @@ -91,6 +114,7 @@ int EngineLogToStdout = 0; /* Do not run the ox engi char *AsirInitFile = NULL; char *LanguageResource = NULL; +int TM_quiet = 0; void ctrlC(); struct object KpoString(char *s); @@ -106,6 +130,7 @@ static int startEngine(int type,char *msg); static int isPS(char *s); static int end_of_input(int c); static void setDefaultParameterForCfep(); +static void setDefaultParameterForSage(); static void myEncoder(int c); static void myEncoderS(unsigned char *s); @@ -142,10 +167,19 @@ main(int argc,char *argv[]) { #ifdef DEBUG2 Dfp = fopen("/tmp/debug-texmacs.txt","w"); #endif - - /* Initialize kanlib (gc is also initialized) */ - KSstart(); + TM_quiet=0; + for (i=1; i