[BACK]Return to ox.h CVS log [TXT][DIR] Up to [local] / OpenXM / src / ox_toolkit

Diff for /OpenXM/src/ox_toolkit/Attic/ox.h between version 1.1 and 1.7

version 1.1, 1999/12/09 22:44:56 version 1.7, 2000/01/20 15:39:58
Line 1 
Line 1 
 /* -*- mode: C; coding: euc-japan -*- */  /* -*- mode: C; coding: euc-japan -*- */
 /* $OpenXM$ */  /* $OpenXM: OpenXM/src/ox_toolkit/ox.h,v 1.6 2000/01/17 19:55:55 ohara Exp $ */
   
   /*
      Some commnets is written in Japanese by the EUC-JP coded
      character set.
   */
   
 #ifndef _OX_H_  #ifndef _OX_H_
   
 #define _OX_H_  #define _OX_H_
Line 8 
Line 13 
 #include <gmp.h>  #include <gmp.h>
 #include "oxtag.h"  #include "oxtag.h"
   
 /*  #define LOGFILE  "/tmp/oxtk.XXXXXX"
 関数の名前付け規約(その2)  
 (1) receive_cmo 関数はCMOタグとデータ本体を受信する. この関数は CMOタグの  
 値が事前に分からないときに使用する. 返り値として、cmo へのポインタを返す。  
 (2) receive_cmo_XXX 関数は, CMOタグを親の関数で受信してから呼び出される関  
 数で、データ本体のみを受信し、cmo_XXX へのポインタを返す。しかも、  
 関数内部で new_cmo_XXX 関数を呼び出す。  
 (3) send_cmo 関数はCMOタグとデータ本体を送信する.  
 (4) send_cmo_XXX 関数はCMOタグを親の関数で送信してから呼び出される関数で、  
 データ本体のみを送信する.  
   
 ----  
 (5) receive_ox_XXX 関数は存在しない(作らない).  receive_cmo を利用する.  
 (6) send_ox_XXX 関数は OX タグを含めて送信する.  
 (7) ox_XXX 関数は一連の送受信を含むより抽象的な操作を表現する.  
 ox_XXX 関数は、第一引数として、ox_file_t型の変数 sv をとる.  
   
 (8) YYY_cmo 関数と YYY_cmo_XXX 関数の関係は次の通り:  
 まず YYY_cmo 関数で cmo のタグを処理し、タグを除いた残りの部分を  
 YYY_cmo_XXX 関数が処理する。cmo の内部に cmo_ZZZ へのポインタが  
 あるときには、その種類によらずに YYY_cmo 関数を呼び出す  
 */  
   
 #define DEFAULT_LOGFILE  "/tmp/result"  
   
 /* Open Xm File Descripter */  /* Open Xm File Descripter */
 typedef int oxfd;  typedef int oxfd;
   
 #if 0  #if 0
 /* そのうちこちらに移行したい... */  
 typedef struct {  typedef struct {
     int fd_read;      int fd;
     int fd_write;  
     int byteorder;      int byteorder;
 } oxfile;  } oxfile;
 typedef oxfile *oxfd;  typedef oxfile *oxfd;
 #endif  #endif
   
 /* サーバーとの通信路に用いるファイルディスクリプタのペア. */  /* descripter pair. (needed by a client) */
 typedef struct {  typedef struct {
     oxfd stream;      oxfd stream;
     oxfd control;      oxfd control;
Line 54  typedef struct {
Line 34  typedef struct {
   
 typedef __ox_file_struct *ox_file_t;  typedef __ox_file_struct *ox_file_t;
   
 /*  
 警告:  
 cmo_list 型のリストには破壊的な代入をしてはいけない.  
 cmo_list の各メンバに直接アクセスしてはいけない.  
 メソッド(..._cmo_list 関数)を用いること.  
 */  
   
 /* ここからは新しい定義 */  
 typedef struct {  typedef struct {
     int tag;      int tag;
 } cmo;  } cmo;
Line 102  typedef struct cell {
Line 74  typedef struct cell {
   
 typedef struct {  typedef struct {
     int tag;      int tag;
     int length;   /* リストの長さ(必要??) */      int length;   /* length of this list (unnecessary) */
     cell head[1];      cell head[1];
 } cmo_list;  } cmo_list;
   
Line 121  typedef struct {
Line 93  typedef struct {
   
 typedef struct {  typedef struct {
     int tag;      int tag;
     cmo *num;  /* 分子 (cmo_zz) */      cmo *num;  /* Bunshi (cmo_zz) */
     cmo *den;  /* 分母 (cmo_zz) */      cmo *den;  /* Bunbo (cmo_zz) */
 } cmo_qq;  } cmo_qq;
   
 /* cmo_list の派生. append_cmo_list を使ってよい. */  /* The following is a derived class from cmo_list.
      that is, append_cmo_list can be used. */
 typedef struct {  typedef struct {
     int tag;      int tag;
     int length;    /* number of monomials */      int length;    /* number of monomials */
Line 157  cmo_monomial32*    new_cmo_monomial32_size(int size);
Line 130  cmo_monomial32*    new_cmo_monomial32_size(int size);
 cmo_zz*            new_cmo_zz();  cmo_zz*            new_cmo_zz();
 cmo_zz*            new_cmo_zz_size(int size);  cmo_zz*            new_cmo_zz_size(int size);
 cmo_zz*            new_cmo_zz_set_si(int integer);  cmo_zz*            new_cmo_zz_set_si(int integer);
   cmo_zz*            new_cmo_zz_set_mpz(mpz_ptr z);
 cmo_zz*            new_cmo_zz_noinit();  cmo_zz*            new_cmo_zz_noinit();
   cmo_zz*            new_cmo_zz_set_string(char* s);
 cmo_zero*          new_cmo_zero();  cmo_zero*          new_cmo_zero();
 cmo_distributed_polynomial* new_cmo_distributed_polynomial();  cmo_distributed_polynomial* new_cmo_distributed_polynomial();
 cmo_dms_generic*   new_cmo_dms_generic();  cmo_dms_generic*   new_cmo_dms_generic();
Line 167  cmo_error2*        new_cmo_error2(cmo* ob);
Line 142  cmo_error2*        new_cmo_error2(cmo* ob);
   
 ox_data*           new_ox_data(cmo* c);  ox_data*           new_ox_data(cmo* c);
 ox_command*        new_ox_command(int sm_code);  ox_command*        new_ox_command(int sm_code);
   ox_sync_ball*      new_ox_sync_ball();
   
 cmo_error2*        make_error_object(int err_code, cmo *ob);  char*              new_string_set_cmo(cmo* m);
   
   cmo_error2*        make_error_object(int err_code, cmo* ob);
 cmo*               make_mathcap_object(int version, char *id_string);  cmo*               make_mathcap_object(int version, char *id_string);
   
   /* Low level API */
 cmo*               receive_cmo(int fd);  cmo*               receive_cmo(int fd);
 cmo*               receive_cmo2(int fd);  
 int                receive_int32(int fd);  int                receive_int32(int fd);
 int                receive_ox_tag(int fd);  int                receive_ox_tag(int fd);
   
 int           send_cmo(int fd, cmo* m);  int                send_cmo(int fd, cmo* m);
 int           send_int32(int fd, int integer);  int                send_int32(int fd, int integer);
 int           send_ox(ox_file_t s, ox* m);  int                send_ox(int fd, ox* m);
 int           send_ox_cmo(int fd, cmo* m);  int                send_ox_cmo(int fd, cmo* m);
 void          send_ox_command(int fd, int sm_command);  void               send_ox_command(int fd, int sm_command);
 int           send_ox_tag(int fd, int tag);  int                send_ox_tag(int fd, int tag);
   
 int           append_cmo_list(cmo_list* this, cmo *ob);  int                decideByteOrderClient(int fd, int order);
 int           length_cmo_list(cmo_list* this);  int                decideByteOrderServer(int fd, int order);
 cell*         next_cell(cell *this);  int                next_serial();
 int           cmolen_cmo(cmo* m);  void               setCmotypeDisable(int type);
   cell*              new_cell();
   cmo*               nth_cmo_list(cmo_list* this, int n);
   int                set_current_fd(int fd);
   
 void          ox_close(ox_file_t sv);  /* High level API */
 void          ox_executeStringByLocalParser(ox_file_t sv, char* str);  ox_file_t          ox_start(char* host, char* prog1, char* prog2);
 cmo_mathcap*  ox_mathcap(ox_file_t sv);  ox_file_t          ox_start_insecure_nonreverse(char* host, short portControl, short portStream);
 char*         ox_popString(ox_file_t sv, int fd);  ox_file_t          ox_start_remote_with_ssh(char *dat_prog, char* host);
 cmo*          ox_pop_cmo(ox_file_t sv, int fd);  
 void          ox_reset(ox_file_t sv);  
 ox_file_t     ox_start(char* host, char* prog1, char* prog2);  
 ox_file_t     ox_start_insecure_nonreverse(char* host, short portControl, short portStream);  
   
 int           init_dump_buff(char *buff);  void               ox_close(ox_file_t sv);
 int           dump_cmo(cmo* m);  void               ox_shutdown(ox_file_t sv);
 int           dump_ox_command(ox_command* m);  void               ox_reset(ox_file_t sv);
 int           dump_ox_data(ox_data* m);  void               ox_execute_string(ox_file_t sv, char* str);
   cmo_mathcap*       ox_mathcap(ox_file_t sv);
   char*              ox_popString(ox_file_t sv);
   int                ox_pops(ox_file_t sv, int num);
   cmo*               ox_pop_cmo(ox_file_t sv);
   void               ox_push_cmo(ox_file_t sv, cmo *c);
   void               ox_push_cmd(ox_file_t sv, int sm_code);
   int                ox_cmo_rpc(ox_file_t sv, char *function, int argc, cmo *argv[]);
   int                ox_flush(ox_file_t sv);
   
 int           print_cmo(cmo* c);  int                append_cmo_list(cmo_list* this, cmo *ob);
 int           print_cmo_int32(cmo_int32* c);  int                length_cmo_list(cmo_list* this);
 int           print_cmo_list(cmo_list* li);  cell*              next_cell(cell *this);
 int           print_cmo_mathcap(cmo_mathcap* c);  int                cmolen_cmo(cmo* m);
 int           print_cmo_string(cmo_string* c);  int                init_dump_buff(char *buff);
   int                dump_cmo(cmo* m);
   int                dump_ox_command(ox_command* m);
   int                dump_ox_data(ox_data* m);
   
 int           decideByteOrderClient(oxfd fd, int order);  int                print_cmo(cmo* c);
 int           decideByteOrderServer(oxfd fd, int order);  
 int           next_serial();  
 void          setCmotypeDisable(int type);  
   
 cmo_zz*       new_cmo_zz_set_string(char *s);  typedef cmo *(*hook_t)(int, cmo *);
 char*         convert_zz_to_string(cmo_zz *c);  
 char*         convert_cmo_to_string(cmo *m);  int add_hook_before_send_cmo(hook_t func);
 char*         convert_null_to_string();  int add_hook_after_send_cmo(hook_t func);
 char*         convert_int_to_string(int integer);  
   
 #endif /* _OX_H_ */  #endif /* _OX_H_ */

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.7

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