=================================================================== RCS file: /home/cvs/OpenXM/src/kxx/ox_texmacs.c,v retrieving revision 1.40 retrieving revision 1.42 diff -u -p -r1.40 -r1.42 --- OpenXM/src/kxx/ox_texmacs.c 2016/08/24 22:38:12 1.40 +++ 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.39 2016/03/31 05:27:34 takayama Exp $ */ +/* $OpenXM: OpenXM/src/kxx/ox_texmacs.c,v 1.41 2018/09/07 00:28:53 takayama Exp $ */ #include #include @@ -29,37 +29,43 @@ #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:", + "", "" }; char *Data_begin_p[] = { "", "\002prompt:", "\002prompt:", + "", "" }; char *Data_begin_ps[] = { "", "\002ps:", "\002ps:", + "", "" }; char *Data_end[] = { "", "\005", "\n\005", /* \n is not a part of the protocol. */ - "" + "", + "" /* SAGE */ }; /* todo: start_of_input */ @@ -68,9 +74,19 @@ 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 + 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 @@ -98,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); @@ -113,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); @@ -149,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