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

Diff for /OpenXM/src/ox_math/mlo.c between version 1.3 and 1.5

version 1.3, 1999/12/14 09:31:55 version 1.5, 2000/01/22 06:29:18
Line 1 
Line 1 
 /* -*- mode: C; coding: euc-japan -*- */  /* -*- mode: C -*- */
 /* $OpenXM: OpenXM/src/ox_math/mlo.c,v 1.2 1999/12/09 22:50:56 ohara Exp $ */  /* $OpenXM: OpenXM/src/ox_math/mlo.c,v 1.4 2000/01/05 06:09:11 ohara Exp $ */
   
 /* Open Mathematica サーバ */  /*
 /* ファイルディスクリプタ 3, 4 は open されていると仮定して動作する. */     Copyright (C) Katsuyoshi OHARA, 2000.
      Portions copyright 1999 Wolfram Research, Inc.
   
 /* MathLink との通信部分 */     You must see OpenXM/Copyright/Copyright.generic.
      The MathLink Library is licensed from Wolfram Research Inc..
      See OpenXM/Copyright/Copyright.mathlink for detail.
   */
   
 #include <stdio.h>  #include <stdio.h>
 #include <stdlib.h>  #include <stdlib.h>
Line 13 
Line 17 
 #include <mathlink.h>  #include <mathlink.h>
 #include "oxtag.h"  #include "oxtag.h"
 #include "ox.h"  #include "ox.h"
 #include "parse.h"  
 #include "mlo.h"  #include "mlo.h"
 #include "serv2.h"  #include "serv2.h"
   
   /* If this flag sets then we identify MLTKSYM to CMO_INDETERMINATE. */
 int flag_mlo_symbol = FLAG_MLTKSYM_IS_INDETERMINATE;  int flag_mlo_symbol = FLAG_MLTKSYM_IS_INDETERMINATE;
   
 /* MLINK はポインタ型. */  /* MLINK is a indentifier of MathLink connection. */
 MLINK stdlink;  MLINK stdlink;
   
 mlo *receive_mlo_zz()  mlo *receive_mlo_zz()
Line 131  cmo *receive_mlo_symbol()
Line 135  cmo *receive_mlo_symbol()
     return ob;      return ob;
 }  }
   
 /* Mathematica との通信を開始する. */  /* starting a MathLink connection. */
 int ml_init()  int ml_init()
 {  {
     int argc = 2;      int argc = 2;
Line 145  int ml_init()
Line 149  int ml_init()
     return 0;      return 0;
 }  }
   
 /* Mathematica との通信を終了する. */  /* closing a MathLink connection. */
 int ml_exit()  int ml_exit()
 {  {
     /* quit Mathematica then close the link */      /* quit Mathematica then close the link */
Line 153  int ml_exit()
Line 157  int ml_exit()
     MLClose(stdlink);      MLClose(stdlink);
 }  }
   
 /* receive_mlo() する前に必ず ml_select() しなければならない */  /* Never forget call ml_select() before calling receive_mlo(). */
 int ml_select()  int ml_select()
 {  {
     /* skip any packets before the first ReturnPacket */      /* skip any packets before the first ReturnPacket */
Line 163  int ml_select()
Line 167  int ml_select()
     }      }
 }  }
   
 /* send_mlo() した後で必ず ml_flush() しなければならない */  /* Never forget call ml_flush() after calling send_mlo(). */
 int ml_flush()  int ml_flush()
 {  {
     MLEndPacket(stdlink);      MLEndPacket(stdlink);
Line 180  cmo *receive_mlo()
Line 184  cmo *receive_mlo()
     case MLTKSTR:      case MLTKSTR:
         return receive_mlo_string();          return receive_mlo_string();
     case MLTKREAL:      case MLTKREAL:
         /* double はまだ... */          /* Yet we have no implementation of CMO_DOUBLE... */
         fprintf(stderr, "--debug: MLO == MLTKREAL.\n");          fprintf(stderr, "--debug: MLO == MLTKREAL.\n");
         MLGetString(stdlink, &s);          MLGetString(stdlink, &s);
         return (cmo *)new_cmo_string(s);          return (cmo *)new_cmo_string(s);

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.5

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