=================================================================== RCS file: /home/cvs/OpenXM/src/ox_math/mlo.c,v retrieving revision 1.12 retrieving revision 1.14 diff -u -p -r1.12 -r1.14 --- OpenXM/src/ox_math/mlo.c 2003/01/15 05:08:10 1.12 +++ OpenXM/src/ox_math/mlo.c 2003/01/17 11:31:10 1.14 @@ -1,5 +1,5 @@ /* -*- mode: C -*- */ -/* $OpenXM: OpenXM/src/ox_math/mlo.c,v 1.11 2003/01/13 12:04:53 ohara Exp $ */ +/* $OpenXM: OpenXM/src/ox_math/mlo.c,v 1.13 2003/01/15 10:46:09 ohara Exp $ */ /* Copyright (C) Katsuyoshi OHARA, 2000. @@ -33,7 +33,7 @@ static mlo *ml_return0(); /* #define STATE_NONE */ #define STATE_INTERRUPTED 1 #define STATE_ABORTED 2 -#define STATE_RESERVE_INTERRUTION 4 +#define STATE_RESERVE_INTERRUPTION 4 #define STATE_RESERVE_ABORTION 8 #define STATE_IDLE 16 @@ -41,6 +41,8 @@ static unsigned state = 0; static int ml_current_packet = -1; +static double mathkernel_version; + /* If this flag sets then we identify MLTKSYM to CMO_INDETERMINATE. */ int flag_mlo_symbol = FLAG_MLTKSYM_IS_INDETERMINATE; @@ -51,11 +53,19 @@ mlo *receive_mlo_real() { char *s; cmo *ob; + +#if 1 + double d; + MLGetReal(stdlink, &d); + ox_printf("MLTKREAL(%lf)", d); + ob = new_cmo_double(d); +#else /* Yet we have no implementation of CMO_DOUBLE... */ MLGetString(stdlink, &s); ox_printf("MLTKREAL(%s)", s); ob = (cmo *)new_cmo_string(s); MLDisownString(stdlink, s); +#endif return ob; } @@ -186,6 +196,10 @@ int ml_init() ox_printf("Mathematica Kernel not found.\n"); exit(1); } + /* set the version of Mathematica kernel. */ + ml_evaluateStringByLocalParser("$VersionNumber"); + mathkernel_version = ((cmo_double *)ml_return())->d; + ox_printf("Kernel Version = %lf\n", mathkernel_version); return 0; } @@ -202,7 +216,7 @@ int ml_select() { while(!MLReady(stdlink)) { #if 0 - if (state == STATE_RESERVE_INTERRUTION) { + if (state == STATE_RESERVE_INTERRUPTION) { ml_interrupt(); }else if (state == STATE_RESERVE_ABORTION) { ml_abort();