[BACK]Return to ox_asir.c CVS log [TXT][DIR] Up to [local] / OpenXM_contrib2 / asir2000 / io

Diff for /OpenXM_contrib2/asir2000/io/ox_asir.c between version 1.10 and 1.11

version 1.10, 2000/03/16 01:07:00 version 1.11, 2000/03/16 04:55:21
Line 1 
Line 1 
 /* $OpenXM: OpenXM_contrib2/asir2000/io/ox_asir.c,v 1.9 2000/03/10 06:42:23 noro Exp $ */  /* $OpenXM: OpenXM_contrib2/asir2000/io/ox_asir.c,v 1.10 2000/03/16 01:07:00 noro Exp $ */
 #include "ca.h"  #include "ca.h"
 #include "parse.h"  #include "parse.h"
 #include "signal.h"  #include "signal.h"
Line 9 
Line 9 
 #endif  #endif
   
 void ox_usr1_handler();  void ox_usr1_handler();
   void asir_ox_init();
   
   
 extern jmp_buf environnement;  extern jmp_buf environnement;
   
 extern int do_message;  extern int do_message;
Line 18  extern int ox_flushing;
Line 18  extern int ox_flushing;
 extern jmp_buf ox_env;  extern jmp_buf ox_env;
 extern MATHCAP my_mathcap;  extern MATHCAP my_mathcap;
   
   extern int little_endian,ox_sock_id;
   
 int ox_sock_id;  int ox_sock_id;
   int lib_ox_need_conv;
   
 static int asir_OperandStackSize;  static int asir_OperandStackSize;
 static Obj *asir_OperandStack;  static Obj *asir_OperandStack;
Line 646  static void ox_asir_init(int argc,char **argv)
Line 649  static void ox_asir_init(int argc,char **argv)
   
 static void ox_io_init() {  static void ox_io_init() {
         unsigned char c,rc;          unsigned char c,rc;
         extern int little_endian,ox_sock_id;  
   
         endian_init();          endian_init();
 #if defined(VISUAL)  #if defined(VISUAL)
Line 702  int asir_ox_pop_cmo(void *cmo, int limit)
Line 704  int asir_ox_pop_cmo(void *cmo, int limit)
 {  {
         Obj obj;          Obj obj;
         int len;          int len;
           ERR err;
   
         obj = asir_pop_one();          obj = asir_pop_one();
         if ( !valid_as_cmo(obj) ) {          if ( !valid_as_cmo(obj) ) {
                 fprintf(stderr,"The object at the stack top is invalid as a CMO.\n");                  asir_push_one(obj);
                 return -1;                  create_error(&err,0,"The object at the stack top is invalid as a CMO.");
                   obj = (Obj)err;
         }          }
         len = count_as_cmo(obj);          len = count_as_cmo(obj);
         if ( len <= limit ) {          if ( len <= limit ) {
Line 769  int asir_ox_peek_cmo_size()
Line 773  int asir_ox_peek_cmo_size()
         int len;          int len;
   
         obj = asir_pop_one();          obj = asir_pop_one();
           asir_push_one(obj);
         if ( !valid_as_cmo(obj) ) {          if ( !valid_as_cmo(obj) ) {
                 fprintf(stderr,"The object at the stack top is invalid as a CMO.\n");                  fprintf(stderr,"The object at the stack top is invalid as a CMO.\n");
                 return 0;                  return 0;
         }          }
         len = count_as_cmo(obj);          len = count_as_cmo(obj);
         asir_push_one(obj);  
         return len;          return len;
 }  }
   
 /*  /*
  * Initialization.   * Initialization.
  * byteorder = 1 : little endian   * byteorder=0 => native
  *             0 : big endian   *          =1 => network byte order
  */   */
   
 void asir_ox_io_init();  
   
 void asir_ox_init(int byteorder)  void asir_ox_init(int byteorder)
 {  {
         int tmp;          int tmp;
Line 850  void asir_ox_init(int byteorder)
Line 852  void asir_ox_init(int byteorder)
                 fclose(ifp);                  fclose(ifp);
         }          }
         input_init(0,"string");          input_init(0,"string");
         asir_ox_io_init(byteorder);  
         create_my_mathcap("ox_asir");  
 }  
   
 void asir_ox_io_init(byteorder)  
 int byteorder;  
 {  
         unsigned char c;  
         extern int little_endian;  
         extern int lib_ox_initialized;  
   
         endian_init();  
         asir_OperandStackSize = BUFSIZ;          asir_OperandStackSize = BUFSIZ;
         asir_OperandStack = (Obj *)CALLOC(asir_OperandStackSize,sizeof(Obj));          asir_OperandStack = (Obj *)CALLOC(asir_OperandStackSize,sizeof(Obj));
         asir_OperandStackPtr = -1;          asir_OperandStackPtr = -1;
         if ( little_endian )          if ( little_endian && byteorder )
                 c = 1;                  lib_ox_need_conv = 1;
         else          else
                 c = 0;                  lib_ox_need_conv = 0;
         iofp[0].conv = c == byteorder ? 0 : 1;  
         lib_ox_initialized = 1;  
         do_message = 0;          do_message = 0;
           create_my_mathcap("ox_asir");
 }  }

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.11

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