[BACK]Return to stackmachine.tex CVS log [TXT][DIR] Up to [local] / OpenXM / doc / OpenXM-specs

Diff for /OpenXM/doc/OpenXM-specs/stackmachine.tex between version 1.1 and 1.2

version 1.1, 2000/01/20 08:52:46 version 1.2, 2000/01/21 06:24:49
Line 1 
Line 1 
 %% $OpenXM$  
 //&jp \section{ OX スタックマシン }  //&jp \section{ OX スタックマシン }
 //&eg \section{ OX stackmachine }  (This section has not yet been translated.)  //&eg \section{ OX stackmachine }  (This section has not yet been translated.)
   
Line 17  open XM ライブラリとしてリンクして使用する場合の
Line 16  open XM ライブラリとしてリンクして使用する場合の
 この原則に基づいて分散計算のプログラミングをおこなう.  この原則に基づいて分散計算のプログラミングをおこなう.
 イベントドリブンなプログラム法とはちがうことに  イベントドリブンなプログラム法とはちがうことに
 注意しよう.  注意しよう.
   */
   
   /*&eg
   In this section we describe the OX stack machine operators.  In
   the descriptions OX messages are represented by th standard encoding
   scheme on TCP/IP sockets.  In principle, an OX stack machine never
   sends data to the output stream unless it receives {\tt SM\_pop*}
   commands.  Note that the programming style should be different from
   that for event-driven programming.
   */
   
 \subsection{サーバスタックマシン }  //&jp \subsection{サーバスタックマシン }
   //&eg \subsection{Server stack machine}
   
   /*&jp
 サンプルサーバである {\tt oxserver00.c}  サンプルサーバである {\tt oxserver00.c}
 は以下の仕様の C の関数を用意して,  は以下の仕様の C の関数を用意して,
 {\tt nullstackmachine.c } を置き換えれば一応動作するはずである.  {\tt nullstackmachine.c } を置き換えれば一応動作するはずである.
   */
   /*&eg
   {\tt oxserver00.c} is implemented as a sample server.
   If you want to implement you own server,
   write the following functions and use them instead of
   those in {\tt nullstackmachine.c }.
   */
   
   //&jp \subsubsection{サーバスタックマシンのグループ SMobject/Basic0 に属するオペレータ}
   //&eg \subsubsection{Operators in the group SMobject/Basic0}
   
   /*&jp
 \noindent  \noindent
 \subsubsection{サーバスタックマシンのグループ SMobject/Basic0  
 に属するオペレータ}  
   
   
 \noindent  
 サーバスタックマシンは最低で1本のスタック  サーバスタックマシンは最低で1本のスタック
 \begin{verbatim}  \begin{verbatim}
 Object xxx_OperandStack[SIZE];  Object xxx_OperandStack[SIZE];
 \end{verbatim}  \end{verbatim}
 をもつ.  をもつ.  ここで, {\tt Object} はそのシステム固有の Object 型で構わない.
 ここで, {\tt Object}  はそのシステム固有の Object 型で構わない.  CMObject は各サーバ固有のローカルオブジェクトに変換してスタックへプッ
 CMObject は各サーバ固有のローカルオブジェクトに変換して  シュしてよい.  ただし変換, 逆変換を合成したものは恒等写像であることが
 スタックへプッシュしてよい.  のぞましい.  CMObject をどのように (local) Object に変換するか, Object
 ただし変換, 逆変換を合成したものは恒等写像であることがのぞましい.  が受け付けるメッセージの定義は,各システムが独自にきめて文書化しておく
 CMObject をどのように (local) Object  に変換するか,  ものとする.  つまりすべてのメッセージは, private である.  たとえば,
 Object が受け付けるメッセージの定義は,  {\tt add } のような基本的な メッセージにたいしても, OX スタックマシン
 各システムが独自にきめて文書化しておくものとする.  はなにもきめていない.  将来的には open math \cite{openmath} のように
 つまりすべてのメッセージは, private である.  CMObject に対する最大公約数的なメッセージの仕様をcontent dictionary
 たとえば, {\tt add } のような基本的な メッセージにたいしても,  (CD) の形で定義したい.
 OX スタックマシンはなにもきめていない.  
 将来的には open math \cite{openmath} のように  
 CMObject に対する最大公約数的なメッセージの仕様を  
 content dictionary (CD) の形で定義したい.  
   
   
 以下, \verb+ xxx_ + は誤解の恐れがないときは省略する.  以下, \verb+ xxx_ + は誤解の恐れがないときは省略する.
 \verb+ xxx_ + は local サーバシステムに固有の識別子である.  \verb+ xxx_ + は local サーバシステムに固有の識別子である.
 {\tt Asir} の場合は \verb+ Asir_ + を用いる.  {\tt Asir} の場合は \verb+ Asir_ + を用いる.  {\tt kan/sm1} の場合は
 {\tt kan/sm1} の場合は  \verb+ Sm1_ + を用いる.  \verb+ Sm1_ + を用いる.  関数名, タグ名は長いので省略形を用いてもよい.
 関数名, タグ名は長いので省略形を用いてもよい.  
   
 以下では次のようにパケットを記述する.  以下では次のようにパケットを記述する.  各フィールドは,
 各フィールドは,  \fbox{データ型 \quad  データ} なる形式
 \fbox{データ型 \quad  データ} なる形式で書く.  で書く.  たとえば, {\tt int32 OX\_DATA} は 32 bit network byte order
 たとえば,  の数字 {\tt OX\_DATA}という意味である.  ``イタリックで書かれているフィー
 {\tt int32 OX\_DATA}  ルドは,定義が別のところでなされているか解釈に誤解のないような自然言語
 は 32 bit network byte order の数字 {\tt OX\_DATA}  で説明されている object を表す.''  たとえば, {\it String commandName}
 という意味である.  は, String データ型の local object {\it commandName} を意味する.  (サー
 ``イタリックで書かれているフィールドは,  バスタックマシン上の object は, CMO 形式の objectとは限らないことに注
 定義が別のところでなされているか解釈に誤解のないような自然言語  意.  CMO 形式で書いてあっても, それはサーバスタックマシンのlocal 形式
 で説明されている object を表す.''  でスタック上にあると解釈して下さい.)
 たとえば,  
 {\it String commandName}  
 は, String データ型の local object  {\it commandName}  
 を意味する.  
 (サーバスタックマシン上の object は, CMO 形式の object  
 とは限らないことに注意.  
 CMO 形式で書いてあっても, それはサーバスタックマシンの  
 local 形式でスタック上にあると解釈して下さい.)  
   
 すべてのサーバスタックマシンは  すべてのサーバスタックマシンは以下の関数を実装していないといけない.
 以下の関数を実装していないといけない.  */
 \begin{enumerate}  
   
   /*&eg
   \noindent
   Any OX stack machine has at least one stack.
   \begin{verbatim}
   Object xxx_OperandStack[SIZE];
   \end{verbatim}
   Here {\tt Object} may be local to the system {\tt xxx} wrapped by the stack
   machine.
   That is, the server may translate CMObjects into local its
   objects and push them onto the stack.  However, it is preferable that
   the composition of such a translation and its inverse is equal to the
   identity map. The translation scheme is called the phrase book of the
   server and it should be documented for each stack machine.  In OpenXM,
   any message is private.  In future we will provide a content
   dictionary (CD; see OpenMath \cite{openmath}) for basic specifications
   of CMObjects.
   
   In the following, \verb+ xxx_ + may be omitted if no confusion occurs.
   As the names of functions and tags are long, one may use abbreviated
   names.  Message packets are represented as follows.  Each field is
   shown as \fbox{data type \quad data}.  For example {\tt int32
   OX\_DATA} denotes a number {\tt OX\_DATA} which is represented by a 32
   bit network byte order.  If a field is displayed by italic characters,
   it should be defined elsewhere or its meaning should be clear.  For
   example {\it String commandName} denotes a local object {\it
   commandName} whose data type is String.  Note that an object on the
   stack may have a local data type even if it is represented as CMO.
   
   Any server stack machine has to implement the following operations.
   */
   
   \begin{enumerate}
 \item  \item
 CMObject/Basic0 の CMO データのうち必須のもの,  /*&jp
 {\tt CMO\_ERROR2}, {\tt CMO\_NULL}, {\tt CMO\_INT32},  CMObject/Basic0 の CMO データのうち必須のもの, {\tt CMO\_ERROR2}, {\tt
 {\tt CMO\_STRING}, {\tt CMO\_LIST}  CMO\_NULL}, {\tt CMO\_INT32}, {\tt CMO\_STRING}, {\tt CMO\_LIST}がおく
 がおくられて来た場合  られて来た場合それをスタックに push する.  たとえば, {\tt CMO\_NULL}
 それをスタックに push する.  あるいは {\tt CMO\_String} の場合次のようになる.
 たとえば, {\tt CMO\_NULL} の場合次のようになる.  */
 \\ Request:  /*&eg
   Any server should accept CMObjects in the group CMObject/Basic0.
   The server pushes such data onto the stack.
   The following examples show the states of the stack after receiving
   {\tt CMO\_NULL} or {\tt CMO\_String} respectively.
   */
   
   Request:
 \begin{tabular}{|c|c|}  \hline  \begin{tabular}{|c|c|}  \hline
 {\tt int32 OX\_DATA} & {\tt int32 CMO\_NULL} \\  {\tt int32 OX\_DATA} & {\tt int32 CMO\_NULL} \\
 \hline  \hline
 \end{tabular}  \end{tabular}
 \\ Stack after the request:  
   Stack after the request:
 \begin{tabular}{|c|}  \hline  \begin{tabular}{|c|}  \hline
 {\it NULL} \\  {\it NULL} \\
 \hline  \hline
 \end{tabular}  \end{tabular}
 \\ Result:  なし.  
   
 たとえば, {\tt CMO\_String} の場合次のようになる.  //&jp Result:  なし.
 \\ Request:  //&eg Result:  none.
   
   Request:
 \begin{tabular}{|c|c|c|c|c|c|}  \hline  \begin{tabular}{|c|c|c|c|c|c|}  \hline
 {\tt int32 OX\_DATA} & {\tt int32 CMO\_String} &{\tt int32} {\rm size}  {\tt int32 OX\_DATA} & {\tt int32 CMO\_String} &{\tt int32} {\rm size}
 &{\tt byte} {\rm s1} & $\cdots$ &{\tt byte} {\rm ssize}\\  &{\tt byte} {\rm s1} & $\cdots$ &{\tt byte} {\rm ssize}\\
 \hline  \hline
 \end{tabular}  \end{tabular}
 \\ Stack after the request:  
   Stack after the request:
 \begin{tabular}{|c|}  \hline  \begin{tabular}{|c|}  \hline
 {\it String s} \\  {\it String s} \\
 \hline  \hline
 \end{tabular}  \end{tabular}
 \\ Result:  なし.  
   
 CMO データの受け取りに失敗した時のみ  \\  //&jp Result:  なし.
   //&eg Result:  none.
   
   //&jp CMO データの受け取りに失敗した時のみ  \\
   //&eg If the server fails to receive a CMO data,
 \begin{tabular}{|c|c|c|}  \hline  \begin{tabular}{|c|c|c|}  \hline
 {\tt int32 OX\_DATA} & {\tt int32 CMO\_ERROR2} & {\it CMObject} ob\\  {\tt int32 OX\_DATA} & {\tt int32 CMO\_ERROR2} & {\it CMObject} ob\\
 \hline  \hline
 \end{tabular}  \end{tabular}
 \\  \\
   /*&jp
 をスタックへ push する.  をスタックへ push する.
 現在のところ, ob には, \\  現在のところ, ob には, \\
 \centerline{  \centerline{
Line 128  CMO データの受け取りに失敗した時のみ  \\
Line 174  CMO データの受け取りに失敗した時のみ  \\
 }  }
 なるリストを入れる (CMO 形式でかいてあるが, これはサーバ独自の形式でよい.  なるリストを入れる (CMO 形式でかいてあるが, これはサーバ独自の形式でよい.
 CMO として送出されるときこのような形式でないといけないという意味である.)  CMO として送出されるときこのような形式でないといけないという意味である.)
   */
   /*&eg
   is pushed onto the stack.
   Currently ob is a list\\
   \centerline{
   [{\sl Integer32} OX serial number, {\sl Integer32} error code,
   {\sl CMObject} optional information]
   }
   */
   
   
   
 \item  \item
 \begin{verbatim}  \begin{verbatim}
 void *xxx_mathCap()  SM_mathcap
 \end{verbatim}  \end{verbatim}
 このサーバの mathcap をもどす (termcap のまね).  /*&jp
 サーバのタイプ, サーバスタックマシンの能力を知ることができる.  このサーバの mathcap をもどす (termcap のまね).  サーバのタイプ, サー
 C 言語で実装する場合は, mathCap の構造体をシステム毎にきめるものとし,  バスタックマシンの能力を知ることができる.  C 言語で実装する場合は,
 この関数はその構造体へのポインタを戻す.  mathCap の構造体をシステム毎にきめるものとし,この関数はその構造体への
 (open sm1 では {\tt struct mathCap} を用いている.  ポインタを戻す.  (open sm1 では {\tt struct mathCap} を用いている.
   */
   /*&eg
   It request to push the mathcap of the server.
   The mathcap is similar to the termcap. One can know the server type
   and the capability of the server from the mathcap.
   */
 @plugin/mathcap.h)  @plugin/mathcap.h)
 \\ Request:  
   Request:
 \begin{tabular}{|c|c|}  \hline  \begin{tabular}{|c|c|}  \hline
 {\tt int32 OX\_COMMAND} & {\tt int32 SM\_mathcap}  \\  {\tt int32 OX\_COMMAND} & {\tt int32 SM\_mathcap}  \\
 \hline  \hline
 \end{tabular}  \end{tabular}
 \\ Result:  
   Result:
 \begin{tabular}{|c|c|}  \hline  \begin{tabular}{|c|c|}  \hline
 {\tt int32 OX\_DATA} & {\sl Mathcap}  mathCapOb \\  {\tt int32 OX\_DATA} & {\sl Mathcap}  mathCapOb \\
 \hline  \hline
Line 154  C 言語で実装する場合は, mathCap の構造体をシステム毎に
Line 215  C 言語で実装する場合は, mathCap の構造体をシステム毎に
   
 \item  \item
 \begin{verbatim}  \begin{verbatim}
 xxx_setMathCap(void *m)  SM_setMathCap
 \end{verbatim}  \end{verbatim}
 受け取った Mathcap {\tt m} を  /*&jp
 自分のシステムに設定して, 相手側が理解不能な CMO をおくらないように  受け取った Mathcap {\tt m} を自分のシステムに設定して, 相手側が理解不
 する.  能な CMO をおくらないようにする.  C 言語で実装する場合は, mathCap の構
 C 言語で実装する場合は, mathCap の構造体をシステム毎にきめるものとし,  造体をシステム毎にきめるものとし,この関数はその構造体へのポインタを引
 この関数はその構造体へのポインタを引数とする.  数とする.  (open sm1 では {\tt struct mathCap} を用いている.
 (open sm1 では {\tt struct mathCap} を用いている.  */
   /*&eg
   It requests to register the peer's mathcap {\tt m} in the server.
   The server can avoid to send OX messages unknown to its peer.
   */
 @plugin/mathcap.h)  @plugin/mathcap.h)
 \\ Request:  
   Request:
 \begin{tabular}{|c|c|}  \hline  \begin{tabular}{|c|c|}  \hline
 {\tt int32 OX\_DATA} & {\sl Mathcap} m  \\ \hline  {\tt int32 OX\_DATA} & {\sl Mathcap} m  \\ \hline
 {\tt int32 OX\_COMMAND} & {\tt int32 SM\_setMathCap}  \\  {\tt int32 OX\_COMMAND} & {\tt int32 SM\_setMathCap}  \\
 \hline  \hline
 \end{tabular}  \end{tabular}
 \\ Result:  なし. \\  
   //&jp Result:  なし. \\
   //&eg Result:  none. \\
   /*&jp
   \noindent
 注意: mathcap は一般にクライアント主体で設定する.  注意: mathcap は一般にクライアント主体で設定する.
 クライアントがサーバに {\tt SM\_mathcap} をおくり,  クライアントがサーバに {\tt SM\_mathcap} をおくり,
 サーバ側の mathcap を得る.  サーバ側の mathcap を得る.
Line 177  C 言語で実装する場合は, mathCap の構造体をシステム毎に
Line 247  C 言語で実装する場合は, mathCap の構造体をシステム毎に
 設定する.  設定する.
 次に, クライアントはサーバに自分の mathcap を  次に, クライアントはサーバに自分の mathcap を
 {\tt SM\_setMathCap} でおくり, 自分の mathcap を設定させる.  {\tt SM\_setMathCap} でおくり, 自分の mathcap を設定させる.
   */
   /*&eg
   \noindent
   Remark: In general the exchange of mathcaps is triggered by a client.
   A client sends {\tt SM\_mathcap} to a server and obtains the server's
   mathcap. Then the client registers the mathcap. Finally the client
   sends its own mathcap by {\tt SM\_setMathCap} and the server
   registers it.
   */
   
   
 \item  \item
 \begin{verbatim}  \begin{verbatim}
 int xxx_executeStringByLocalParser(char *s)  SM_executeStringByLocalParser
 \end{verbatim}  \end{verbatim}
 文字列 $s$ をシステム xxx の文法(サーバスタックマシンの組み込みローカル  /*&jp
 言語)にしたがったコマンドとして実行する.  文字列 $s$ をシステム xxx の文法(サーバスタックマシンの組み込みローカ
 ただし, コマンドの実行の結果の最後に戻り値があるときは,  ル言語)にしたがったコマンドとして実行する.  ただし, コマンドの実行の結
 {\tt OperandStack} に戻り値を push する.  果の最後に戻り値があるときは, {\tt OperandStack} に戻り値を push する.
 正常終了なら 0 を, 異常終了なら -1 をもどす.  正常終了なら 0 を, 異常終了なら -1 をもどす.  debug モードにはいった場
 debug モードにはいった場合, -2 を戻す.  合, -2 を戻す. エラーの時 Error2 Objectを stack へ push する.\\ {\tt
 エラーの時  Error2 Object  kan/sm1} の場合, サーバスタックマシンの組み込みローカル言語は{\tt sm1}
 を stack へ push する.\\  ポストスクリプト言語である.  サーバスタックマシンと, {\tt sm1} ポスト
 {\tt kan/sm1} の場合, サーバスタックマシンの組み込みローカル言語は  スクリプト言語はスタックを共有するように実装されている.  実際の計算は
 {\tt sm1} ポストスクリプト言語である.  {\tt executeStringByLocalParser} により実行される.  open XM では, 現在
 サーバスタックマシンと, {\tt sm1} ポストスクリプト言語はスタックを  のところ関数名の標準化はおこなっていない.  したがって, 実際の計算コマ
 共有するように実装されている.  ンドの送出は mathcap をみてクライアントが正しいコマンドを選択する必要
 実際の計算は  がある. (しかしながら, 共通関数名がないために, 共通仕様のサーバスタッ
 {\tt executeStringByLocalParser} により実行される.  クマシンの実装はきわめて簡単である. 関数名の共通化は将来の課題.) \\割
 open XM では, 現在のところ関数名の標準化はおこなっていない.  込みに関しては, -1 を戻すように ハンドラを書く.
 したがって, 実際の計算コマンドの送出は mathcap をみてクライアントが  executeStringByLocalParser() を再帰的に呼んだときも 割り込みのハンドラ
 正しいコマンドを選択する必要がある.  が正しく動作するようにこの関数は書かれるべきである.  この関数を呼び出
 (しかしながら, 共通関数名がないために, 共通仕様のサーバスタックマシンの  したのち, signal, setjmp の再設定を呼び出し側でやらないといけない. \\
 実装はきわめて簡単である. 関数名の共通化は将来の課題.) \\  この関数および {\tt popString} の機能を実現すれば, 最低限の open XM の
 割込みに関しては, -1 を戻すように ハンドラを書く.  サーバになれる.  実装では, まずこの二つの関数の機能を実現すべきである.
 executeStringByLocalParser() を再帰的に呼んだときも 割り込みのハンドラが  */
 正しく動作するようにこの関数は書かれるべきである.  /*&eg
 この関数を呼び出したのち, signal, setjmp の再設定を呼び出し側でやらないと  A character string $s$ is parsed by the local parser of the stack
 いけない. \\  machine and interpreted by the local interpreter.
 この関数および {\tt popString} の機能を実現すれば, 最低限の  If the exececution produces a result, it is pushed onto
 open XM のサーバになれる.   実装では, まずこの二つの関数の機能を  {\tt OperandStack}.
 実現すべきである.  If an error has occured,  Error2 Object is pushed onto the stack.
 \\ Stack before the request:  OpenXM does not provide standard function names.
   If this operation and {\tt SM\_popString} is implemented, the stack machine
   can be used as an OX server.
   */
   
   Stack before the request:
 \\  \\
 \begin{tabular}{|c|}  \hline  \begin{tabular}{|c|}  \hline
 {\it String commandString} \\  {\it String commandString} \\
 \hline  \hline
 \end{tabular}  \end{tabular}
 \\Request:  
   Request:
 \begin{tabular}{|c|c|}  \hline  \begin{tabular}{|c|c|}  \hline
 {\tt int32 OX\_COMMAND}& {\tt int32 SM\_executeStringByLocalParser} \\  {\tt int32 OX\_COMMAND}& {\tt int32 SM\_executeStringByLocalParser} \\
 \hline  \hline
 \end{tabular}  \end{tabular}
 \\ Result:  なし.  
 \\ 参考: \  実行前のスタックのデータは,  //&jp Result:  なし.
 {\it String commandString} なる local stackmachine の object として  //&eg Result:  none.
 スタック上にあるが, TCP/IP の通信路では, 次のようなデータがまずながれて  /*&jp
   \noindent
   参考: \  実行前のスタックのデータは,
   {\it String commandString} なる local stackmachine の object としてス
   タック上にあるが, TCP/IP の通信路では, 次のようなデータがまずながれて
 {\it commandName} がスタックに push される:  {\it commandName} がスタックに push される:
 \\  */
   /*&eg
   \noindent
   Remark: Before this request, one has to push {\it String commandString}
   onto the stack. It is done by sending the following OX data message.
   */
 \begin{tabular}{|c|c|c|}  \hline  \begin{tabular}{|c|c|c|}  \hline
 {\tt int32 OX\_DATA} & {\tt int32 CMO\_string} & {\it size and the string commandString} \\  {\tt int32 OX\_DATA} & {\tt int32 CMO\_string} & {\it size and the string commandString} \\
 \hline  \hline
Line 234  open XM のサーバになれる.   実装では, まずこの二つの関
Line 327  open XM のサーバになれる.   実装では, まずこの二つの関
   
 \item  \item
 \begin{verbatim}  \begin{verbatim}
 int xxx_executeStringByLocalParserInBatchMode(char *s)  SM_executeStringByLocalParserInBatchMode
 \end{verbatim}  \end{verbatim}
 スタックに副作用がない(スタックにたいしてなんの操作もしない)  /*&jp
 ことを除き上とまったく同じ関数である.  スタックに副作用がない(スタックにたいしてなんの操作もしない)ことを除き
 エラーの時のみ, Error2 Object をスタックへプッシュする.  上とまったく同じ関数である.  エラーの時のみ, Error2 Object をスタック
   へプッシュする.
   */
   /*&eg
   This is the same request as {\tt SM\_executeStringByLocalParser}
   except that it does not modify the stack. It pushes an Error2 Object
   if an error has occured.
   */
 \item  \item
 \begin{verbatim}  \begin{verbatim}
 char *xxx_popString(void)  SM_popString
 void xxx_popString(ox_stream  out)  
 \end{verbatim}  \end{verbatim}
 最初の関数はライブラリとしてリンクして使用する場合の関数である.  /*&jp
 {\tt OperandStack} より Object を pop し, それを xxx の出力  {\tt OperandStack} より Object を pop し, それを xxx の出力規則にしたがい文
 規則にしたがい文字列型に変換して戻す.  字列型に変換して送信する.  スタックが空のときは, {\tt (char *)NULL} を戻す.
 スタックが空のときは, {\tt (char *)NULL} を戻す.  文字列は {\tt ox\_stream out}へ CMO のデー
 呼出側の関数は, 戻り値のメモリー領域を操作してはいけない.  タとして送信する.  エラーの場合は {\tt CMO\_ERROR2} を戻すべきである.
 また, 再度 サーバスタックマシンが呼ばれたときは, 戻り値のメモリ領域  */
 は変更されているかもしれない.  /*&eg
   It requests for a server to pop an object from {\tt OperandStack},
   to convert it into a character string according to the output format
   of the local system, and to send the character string via TCP/IP stream.
   {\tt (char *)NULL} is returned when the stack is empty.
   The returned strings is sent as a CMO string data.
   {\tt CMO\_ERROR2} should be returned if an error has occured.
   */
   
 2 番目の関数は, TCP/IP を用いて通信する場合の関数である.  Stack before the request:
 変換されてでてきた文字列を値として返すのではなく,  
 {\tt ox\_stream out}  
 へ CMO のデータとして送信する.  
 エラーの場合は {\tt CMO\_ERROR2} を戻すべきである.  
 \\ Stack before the request:  
 \begin{tabular}{|c|}  \hline  \begin{tabular}{|c|}  \hline
 {\it Object} \\  {\it Object} \\
 \hline  \hline
 \end{tabular}  \end{tabular}
 \\ Request:  
   Request:
 \begin{tabular}{|c|c|}  \hline  \begin{tabular}{|c|c|}  \hline
 {\tt int32 OX\_COMMAND} & {\tt int32 SM\_popString} \\  {\tt int32 OX\_COMMAND} & {\tt int32 SM\_popString} \\
 \hline  \hline
 \end{tabular}  \end{tabular}
 \\ Result:  
   Result:
 \begin{tabular}{|c|c|c|}  \hline  \begin{tabular}{|c|c|c|}  \hline
 {\tt int32 OX\_DATA} & {\tt int32 CMO\_STRING} & {\it size and the string s} \\  {\tt int32 OX\_DATA} & {\tt int32 CMO\_STRING} & {\it size and the string s} \\
 \hline  \hline
Line 276  void xxx_popString(ox_stream  out)
Line 378  void xxx_popString(ox_stream  out)
   
 \item  \item
 \begin{verbatim}  \begin{verbatim}
 int xxx_getsp(void)  SM_getsp
 \end{verbatim}  \end{verbatim}
 現在のスタックポインタの位置をもどす.  /*&jp
 スタート時点での位置は 0 であり, object が push されたばあい,  現在のスタックポインタの位置をもどす.  スタート時点での位置は 0 であり,
 1 づつ増えるものとする.  object が push されたばあい, 1 づつ増えるものとする.
 \\ Stack before the request:  */
   /*&eg
   It request to push the current stack pointer onto the stack.
   The stack pointer is represented by a non-negative integer.
   Its initial value is 0 and a push operation increments the
   stack pointer by 1.
   */
   
   Stack before the request:
 \begin{tabular}{|c|}  \hline  \begin{tabular}{|c|}  \hline
 {\it Object} \\  {\it Object} \\
 \hline  \hline
 \end{tabular}  \end{tabular}
 \\ Request:  
   Request:
 \begin{tabular}{|c|c|}  \hline  \begin{tabular}{|c|c|}  \hline
 {\tt int32 OX\_COMMAND} & {\tt int32 SM\_getsp} \\  {\tt int32 OX\_COMMAND} & {\tt int32 SM\_getsp} \\
 \hline  \hline
 \end{tabular}  \end{tabular}
 \\ Result:  
   Result:
 \begin{tabular}{|c|c|c|}  \hline  \begin{tabular}{|c|c|c|}  \hline
 {\tt int32 OX\_DATA} & {\tt int32 CMO\_INT32} & {\it stack pointer value} \\  {\tt int32 OX\_DATA} & {\tt int32 CMO\_INT32} & {\it stack pointer value} \\
 \hline  \hline
Line 299  int xxx_getsp(void)
Line 411  int xxx_getsp(void)
   
 \item  \item
 \begin{verbatim}  \begin{verbatim}
 object xxx_dupErrors(void)  SM_dupErrors
 \end{verbatim}  \end{verbatim}
 スタック上のエラーオブジェクトをリストにして戻す.  /*&jp
 スタック自体は変化させない.  スタック上のエラーオブジェクトをリストにして戻す.  スタック自体は変化
 \\ Stack before the request:  させない.
   */
   /*&eg
   It requests to push a list object containing all error objects on the stack.
   */
   
   Stack before the request:
 \begin{tabular}{|c|}  \hline  \begin{tabular}{|c|}  \hline
 {\it Object} \\  {\it Object} \\
 \hline  \hline
 \end{tabular}  \end{tabular}
 \\ Request:  
   Request:
 \begin{tabular}{|c|c|}  \hline  \begin{tabular}{|c|c|}  \hline
 {\tt int32 OX\_COMMAND} & {\tt int32 SM\_dupErrors} \\  {\tt int32 OX\_COMMAND} & {\tt int32 SM\_dupErrors} \\
 \hline  \hline
 \end{tabular}  \end{tabular}
 \\ Result:  
   Result:
 \begin{tabular}{|c|c|c|}  \hline  \begin{tabular}{|c|c|c|}  \hline
 {\tt int32 OX\_DATA} & {\sl CMObject} \ a list of errors\\  {\tt int32 OX\_DATA} & {\sl CMObject} \ a list of errors\\
 \hline  \hline
 \end{tabular}  \end{tabular}
   
 \item  
 \begin{verbatim}  
 int xxx_start()  
 \end{verbatim}  
 xxx の初期化をおこなう.  
   
 \end{enumerate}  \end{enumerate}
   
 \noindent  
 {\bf 例}: \  
 次は, 標準入力よりの入力を asir に送り評価した結果を表示するプログラム  
 である.  
 \begin{verbatim}  
 #include <stdio.h>  
   
 main() {  
   char tmp[1024];  
   Asir_start();  
   while (gets(tmp) != NULL) {  
      if (Asir_executeStringByLocalParser(tmp) != 0) {  
         printf("%s\n",Asir_popString());  
      }  
   }  
 }  
   
 \end{verbatim}  
   
 \medbreak  \medbreak
 \noindent  \noindent
   /*&jp
 {\bf 例}: \  {\bf 例}: \
 mathcap の問い合わせに対して, {\tt ox\_sm1} は次のように答える.  mathcap の問い合わせに対して, {\tt ox\_sm1} は次のように答える.
   */
   /*&eg
   {\bf Example}: \
   {\tt ox\_sm1} returns the following data as its mathcap.
   */
 %%Prog: [(cmoMathCap)] extension ::  %%Prog: [(cmoMathCap)] extension ::
 \begin{verbatim}  \begin{verbatim}
 Class.mathcap  Class.mathcap
Line 360  Class.mathcap 
Line 460  Class.mathcap 
              25 , 26 , 30 , 31 , 60 , 61 , 27 , 33 , 40 , 34 ]]]               25 , 26 , 30 , 31 , 60 , 61 , 27 , 33 , 40 , 34 ]]]
 \end{verbatim}  \end{verbatim}
   
 mathcap は 3つの要素をもつリストである.  /*&jp
 まづ, 最初の要素を見よう.  mathcap は 3つの要素をもつリストである.  まづ, 最初の要素を見よう.
 Ox\_system は open xxx システム名である.  Ox\_system は open xxx システム名である.  読み込むライブラリがちがって
 読み込むライブラリがちがっていて, 関数名(または シンボル)の意味がちがうときは  いて, 関数名(または シンボル)の意味がちがうときはこの名前もかえる. た
 この名前もかえる.  とえば, open math の basic content dictionary 対応の関数定義マクロを読
 たとえば, open math の basic content dictionary 対応の関数定義マクロを  みこんだ sm1 は, ox\_sm1\_basicCD なる名前にする.  HOSTTYPE値は, CPU
 読みこんだ sm1 は,  の種類をあらわしunix では環境変数\verb+$HOSTTYPE+ の値である.  2 番目
 ox\_sm1\_basicCD なる名前にする.  の要素は 利用可能な SM コマンドをあつめたリストである.  3 番目のリスト
 HOSTTYPE値は, CPU の種類をあらわし  は, 処理可能な数学データの形式, およびCMOの場合なら処理可能なCMOのタグ
 unix では環境変数\verb+$HOSTTYPE+ の値である.  のリストが続く.  上の例では, 514 は {\tt OX\_DATA} をあらわし, 数学デー
 2 番目の要素は 利用可能な SM コマンドをあつめたリストである.  タのフォマットは(サイズ情報なしの) CMO であることを示す.
 3 番目のリストは, 処理可能な数学データの形式, およびCMOの場合なら  */
 処理可能なCMOのタグのリストが続く.  /*&eg
 上の例では, 514 は {\tt OX\_DATA} をあらわし, 数学データのフォマットは  A mathcap has three components. The first one contains informations
 (サイズ情報なしの) CMO であることを示す.  to identify the system and hosts on which the application runs.
   In the above example, Ox\_system denotes the system name.
   HOSTTYPE represents the OS type and taken from \verb+$HOSTTYPE+
   enviroment variable.
   The second component consists of avaiable SM commands.
   The third component is a list of pairs. Each pair consists
   of an OX message tag and the available message tags.
   Again in the above example, 514 is the value of {\tt OX\_DATA}
   and it indicates that the server accepts CMO (without size information)
   as mathematical data messages. In this case the subsequent
   list represents available CMO tags.
   */
   
   
 \medbreak  \medbreak
 \noindent  \noindent
 {\bf 例}: \  //&jp {\bf 例}: \
   //&eg {\bf Example}: \
 %%Prog: (ox.sm1) run  sm1connectr  [(oxWatch) ox.ccc] extension  %%Prog: (ox.sm1) run  sm1connectr  [(oxWatch) ox.ccc] extension
 %%Prog: ox.ccc (122345; ) oxsubmit ;  %%Prog: ox.ccc (122345; ) oxsubmit ;
 {\tt message\_body} の実例をあげる.   シリアル番号部は除いてある.  //&jp {\tt message\_body} の実例をあげる.   シリアル番号部は除いてある.
   //&eg {\tt message\_body} の実例をあげる.   シリアル番号部は除いてある.
 \begin{enumerate}  \begin{enumerate}
 \item  {\tt executeStringByLocalParser("12345 ;");}  \item  {\tt executeStringByLocalParser("12345 ;");}
   /*&jp
 は次のようなパケットに変換される. 各数字は 16進1バイトをあらわす.  は次のようなパケットに変換される. 各数字は 16進1バイトをあらわす.
 {\tt xx(yy)} のなかの {\tt (yy)} は対応するアスキーコードをあわらす.  {\tt xx(yy)} のなかの {\tt (yy)} は対応するアスキーコードをあわらす.
   */
   /*&eg
   は次のようなパケットに変換される. 各数字は 16進1バイトをあらわす.
   {\tt xx(yy)} のなかの {\tt (yy)} は対応するアスキーコードをあわらす.
   */
 \begin{verbatim}  \begin{verbatim}
 0   0   2   2   0   0   0   4   0   0   0   7  0   0   2   2   0   0   0   4   0   0   0   7
 31(1)  32(2)  33(3)  34(4)  35(5)  20  3b(;)  31(1)  32(2)  33(3)  34(4)  35(5)  20  3b(;)
 0   0   2   1   0   0   1   c  0   0   2   1   0   0   1   c
 \end{verbatim}  \end{verbatim}
   /*&jp
 ここで,  ここで,
 \verb+ 0 0 2 2 0 0 0 4 + は, network byte order で,  \verb+ 0 0 2 2 0 0 0 4 + は, network byte order で,
 順番に {\tt OX\_DATA} それから,  順番に {\tt OX\_DATA} それから,
Line 400  CMO のタグの, {\tt CMO\_STRING} を表す.
Line 519  CMO のタグの, {\tt CMO\_STRING} を表す.
 最後に 文字列 {\tt 12345 ;} が来る.  最後に 文字列 {\tt 12345 ;} が来る.
 ここで, \verb+ 0 0 1 c + は, network byte order で,  ここで, \verb+ 0 0 1 c + は, network byte order で,
 {\tt OX\_executeString} を表す.  {\tt OX\_executeString} を表す.
   */
   /*&eg
   ここで,
   \verb+ 0 0 2 2 0 0 0 4 + は, network byte order で,
   順番に {\tt OX\_DATA} それから,
   CMO のタグの, {\tt CMO\_STRING} を表す.
   \verb+ 0  0  0  7 + は文字数,
   最後に 文字列 {\tt 12345 ;} が来る.
   ここで, \verb+ 0 0 1 c + は, network byte order で,
   {\tt OX\_executeString} を表す.
   */
   
 まとめると次のようになる.  //&jp まとめると次のようになる.
   //&eg まとめると次のようになる.
 \begin{verbatim}  \begin{verbatim}
 0   0   2   2  (OX_DATA) 0   0   0   4  (CMO_STRING)  0   0   2   2  (OX_DATA) 0   0   0   4  (CMO_STRING)
 0   0   0   7  (size)  0   0   0   7  (size)
Line 409  CMO のタグの, {\tt CMO\_STRING} を表す.
Line 540  CMO のタグの, {\tt CMO\_STRING} を表す.
 0   0   2   1  (OX_COMMAND)  0   0   2   1  (OX_COMMAND)
 0   0   1   c  (SM_executeStringByLocalParser)  0   0   1   c  (SM_executeStringByLocalParser)
 \end{verbatim}  \end{verbatim}
 これを OXexpression で表記すると次のようになる.  //&jp これを OXexpression で表記すると次のようになる.
   //&eg これを OXexpression で表記すると次のようになる.
 \begin{center}  \begin{center}
 (OX\_DATA, (CMO\_STRING, 7, "12345 ;"))  (OX\_DATA, (CMO\_STRING, 7, "12345 ;"))
 \end{center}  \end{center}
Line 417  CMO のタグの, {\tt CMO\_STRING} を表す.
Line 549  CMO のタグの, {\tt CMO\_STRING} を表す.
 (OX\_COMMAND, (SM\_executeStringByLocalParser))  (OX\_COMMAND, (SM\_executeStringByLocalParser))
 \end{center}  \end{center}
   
 \item  {\tt popString()}  を要請するメッセージ:  //&jp \item  {\tt popString()}  を要請するメッセージ:
   //&eg \item  {\tt popString()}  を要請するメッセージ:
 \begin{verbatim}  \begin{verbatim}
 0   0   2   1  (OX_COMMAND)  0   0   2   1  (OX_COMMAND)
 0   0   1   7  (SM_popString)  0   0   1   7  (SM_popString)
Line 426  OXexpression では
Line 559  OXexpression では
 (OX\_COMMAND, (SM\_popString)).  (OX\_COMMAND, (SM\_popString)).
   
 \noindent  \noindent
 これにたいして次の返答メッセージがくる.  //&jp これにたいして次の返答メッセージがくる.
   //&eg これにたいして次の返答メッセージがくる.
 \begin{verbatim}  \begin{verbatim}
 0   0   2   2   (OX_DATA)  0   0   2   2   (OX_DATA)
 0   0   0   4   (CMO_STRING) 0   0   0   5  (size)  0   0   0   4   (CMO_STRING) 0   0   0   5  (size)
 31(1)  32(2)  33(3)  34(4)  35(5)  31(1)  32(2)  33(3)  34(4)  35(5)
 \end{verbatim}  \end{verbatim}
 OXexpression でかくと,  //&jp OXexpression でかくと,
   //&eg OXexpression でかくと,
 (OX\_DATA, (CMO\_STRING, 7, "12345 ;")).  (OX\_DATA, (CMO\_STRING, 7, "12345 ;")).
   
   
   
 \end{enumerate}  \end{enumerate}
   
 \subsubsection{グループ SMobject/Basic1 に属するオペレータ}  //&jp \subsubsection{グループ SMobject/Basic1 に属するオペレータ}
   //&eg \subsubsection{グループ SMobject/Basic1 に属するオペレータ}
   
   
 \begin{enumerate}  \begin{enumerate}
   
 \item  \item
 \begin{verbatim}  \begin{verbatim}
 void xxx_pops(int n)  void xxx_pops(int n)
 \end{verbatim}  \end{verbatim}
 operand stack より, {\it n} 個の元  /*&jp
 ({\it obj1, obj2, $\ldots$, objn}) を pop して捨てる.  operand stack より, {\it n} 個の元 ({\it obj1, obj2, $\ldots$, objn})
 \\ Stack before the request: (右が stack のトップである.) \\  を pop して捨てる.
   */
   /*&eg
   operand stack より, {\it n} 個の元 ({\it obj1, obj2, $\ldots$, objn})
   を pop して捨てる.
   */
   
   //&jp Stack before the request: (右が stack のトップである.) \\
   //&eg Stack before the request: (右が stack のトップである.) \\
 \begin{tabular}{|c|c|c|c|c|}  \hline  \begin{tabular}{|c|c|c|c|c|}  \hline
 {\it obj1} & {\it  obj2}  & $\cdots$ & {\it objn}  &{\it INT32 n} \\  {\it obj1} & {\it  obj2}  & $\cdots$ & {\it objn}  &{\it INT32 n} \\
 \hline  \hline
 \end{tabular}  \end{tabular}
 \\ Request:  
   Request:
 \begin{tabular}{|c|c|}  \hline  \begin{tabular}{|c|c|}  \hline
 {\tt int32 OX\_COMMAND} & {\tt int32 SM\_pops } \\  {\tt int32 OX\_COMMAND} & {\tt int32 SM\_pops } \\
 \hline  \hline
 \end{tabular}  \end{tabular}
 \\ Result:  なし.  
   
   //&jp Result:  なし.
   //&eg Result:  none.
   
   
 \item  \item
 \begin{verbatim}  \begin{verbatim}
 int xxx_setName(char *name)  int xxx_setName(char *name)
 \end{verbatim}  \end{verbatim}
 (これは本当に必要な関数??)  /*&jp
 {\tt OperandStack} より {\it name} を pop し, つぎに  {\tt OperandStack} より {\it name} を pop し, つぎに{\tt OperandStack}
 {\tt OperandStack} より {\it obj} を pop し, それを  より {\it obj} を pop し, それを現在の名前空間で変数 {\it name} に
 現在の名前空間で変数 {\it name} に bind する.  bind する.  正常終了なら 0 を, 異常終了なら -1 をもどす.  TCP/IP によ
 正常終了なら 0 を, 異常終了なら -1 をもどす.  る通信では, 異常終了の時のみ, {\tt CMO\_ERROR2} をstack へ push する.
 TCP/IP による通信では, 異常終了の時のみ, {\tt CMO\_ERROR2} を  */
 stack へ push する.  /*&eg
 \\ Stack before the request: (右が stack の top.)  {\tt OperandStack} より {\it name} を pop し, つぎに{\tt OperandStack}
   より {\it obj} を pop し, それを現在の名前空間で変数 {\it name} に
   bind する.  正常終了なら 0 を, 異常終了なら -1 をもどす.  TCP/IP によ
   る通信では, 異常終了の時のみ, {\tt CMO\_ERROR2} をstack へ push する.
   */
   //&jp Stack before the request: (右が stack の top.)
   //&eg Stack before the request: (右が stack の top.)
 \begin{tabular}{|c|c|}  \hline  \begin{tabular}{|c|c|}  \hline
 {\it obj} & {\it String name}  \\  {\it obj} & {\it String name}  \\
 \hline  \hline
 \end{tabular}  \end{tabular}
 \\ Request:  
   Request:
 \begin{tabular}{|c|c|}  \hline  \begin{tabular}{|c|c|}  \hline
 {\tt int32 OX\_COMMAND} & {\tt int32 SM\_setName} \\  {\tt int32 OX\_COMMAND} & {\tt int32 SM\_setName} \\
 \hline  \hline
 \end{tabular}  \end{tabular}
 \\ Result: なし.  
   
   //&jp Result: なし.
   //&eg Result: none.
   
 \item  \item
 \begin{verbatim}  \begin{verbatim}
 int xxx_evalName(char *name)  int xxx_evalName(char *name)
 \end{verbatim}  \end{verbatim}
 (これは本当に必要な関数??)  /*&jp
 現在の名前空間で変数 {\it name} を評価する.  現在の名前空間で変数 {\it name} を評価する.  評価の結果 {\it
 評価の結果 {\it resultObj} をスタックへ戻す.  resultObj} をスタックへ戻す.  関数自体は正常終了なら 0 を, 異常終了な
 関数自体は正常終了なら 0 を, 異常終了なら -1 をもどす.  ら -1 をもどす.  TCP/IP の場合, 異常終了の場合のみ {\tt CMO\_ERROR2}
 TCP/IP の場合, 異常終了の場合のみ {\tt CMO\_ERROR2} を stack へ push する.  を stack へ push する.
 \\ Stack before the request: (右が stack の top.)  */
   /*&eg
   現在の名前空間で変数 {\it name} を評価する.  評価の結果 {\it
   resultObj} をスタックへ戻す.  関数自体は正常終了なら 0 を, 異常終了な
   ら -1 をもどす.  TCP/IP の場合, 異常終了の場合のみ {\tt CMO\_ERROR2}
   を stack へ push する.
   */
   
   //&jp Stack before the request: (右が stack の top.)
   //&eg Stack before the request: (右が stack の top.)
 \begin{tabular}{|c|}  \hline  \begin{tabular}{|c|}  \hline
 {\it String name}  \\  {\it String name}  \\
 \hline  \hline
 \end{tabular}  \end{tabular}
 \\ Request:  
   Request:
 \begin{tabular}{|c|c|}  \hline  \begin{tabular}{|c|c|}  \hline
 {\tt int32 OX\_COMMAND} & {\tt int32 SM\_evalName} \\  {\tt int32 OX\_COMMAND} & {\tt int32 SM\_evalName} \\
 \hline  \hline
 \end{tabular}  \end{tabular}
 \\ Stack after the request: (右が stack の top.)  
   //&jp Stack after the request: (右が stack の top.)
   //&eg Stack after the request: (右が stack の top.)
 \begin{tabular}{|c|}  \hline  \begin{tabular}{|c|}  \hline
 {\it resultObj} \\  {\it resultObj} \\
 \hline  \hline
 \end{tabular}  \end{tabular}
 \\ Result:  なし.  
   
   //&jp Result:  なし.
   //&eg Result:  none.
   
 \item  \item
 \begin{verbatim}  \begin{verbatim}
 int xxx_executeFunction(char *s, int n)  int xxx_executeFunction(char *s, int n)
 \end{verbatim}  \end{verbatim}
 スタックより {\it n} 個のデータを pop して, サーバのローカル関数  /*&jp
 {\it s} を実行する.  スタックより {\it n} 個のデータを pop して, サーバのローカル関数{\it
 エラーのときのみ {\tt CMO\_ERROR2} を stack へ push する.  s} を実行する.  エラーのときのみ {\tt CMO\_ERROR2} を stack へ push す
 \\ Stack before the request: (右が stack の top.) \\  る.
   */
   /*&eg
   スタックより {\it n} 個のデータを pop して, サーバのローカル関数{\it
   s} を実行する.  エラーのときのみ {\tt CMO\_ERROR2} を stack へ push す
   る.
   */
   
   //&jp Stack before the request: (右が stack の top.) \\
   //&eg Stack before the request: (右が stack の top.) \\
 \begin{tabular}{|c|c|c|c|c|}  \hline  \begin{tabular}{|c|c|c|c|c|}  \hline
 {\it objn} & $\cdots$ & {\it obj1} & {\it INT32 n} & {\it String s} \\  {\it objn} & $\cdots$ & {\it obj1} & {\it INT32 n} & {\it String s} \\
 \hline  \hline
 \end{tabular}  \end{tabular}
 \\ Request:  
   Request:
 \begin{tabular}{|c|c|}  \hline  \begin{tabular}{|c|c|}  \hline
 {\tt int32 OX\_COMMAND} & {\tt int32 SM\_executeFunction}  \\  {\tt int32 OX\_COMMAND} & {\tt int32 SM\_executeFunction}  \\
 \hline  \hline
 \end{tabular}  \end{tabular}
 \\ Stack after the request:  
 関数実行の結果.  
 \\ Result: なし.  
   
   //&jp Stack after the request: 関数実行の結果.
   //&eg Stack after the request: 関数実行の結果.
   
   //&jp Result: なし.
   //&eg Result: none.
   
   
   
 \item  \item
 \begin{verbatim}  \begin{verbatim}
 bytes *xxx_popSerializedLocalObject(void)  bytes *xxx_popSerializedLocalObject(void)
 void popSerializedLocalObject(ox_stream out)  void popSerializedLocalObject(ox_stream out)
 \end{verbatim}  \end{verbatim}
 最初の関数はライブラリとしてリンクして使用するための関数である.  /*&jp
 スタックより pop した object を local 形式の serialization して  最初の関数はライブラリとしてリンクして使用するための関数である.  スタッ
 byte 列で戻す.  クより pop した object を local 形式の serialization してbyte 列で戻す.
 2 番目の関数は Socket で通信するための同機能の関数であり,  2 番目の関数は Socket で通信するための同機能の関数であり,
 serialization された byte 列を  serialization された byte 列を{\tt ox\_stream out} へ出力する.  この場
 {\tt ox\_stream out} へ出力する.  合, header {\tt int32 OX\_DATA}, {\tt int32 CMO\_LOCAL\_OBJECT} をつけ
 この場合,  てから, byte 列を送る. この関数はおもに, homogeneous な分散システムで
 header  用いる.  次に, サーバスタックマシンの関数が実行されるまでは,戻り
 {\tt int32 OX\_DATA}, {\tt int32 CMO\_LOCAL\_OBJECT}  object の内容は保証されないといけない.
 をつけてから, byte 列を送る.  */
 この関数はおもに, homogeneous な分散システムで用いる.  /*&eg
 次に, サーバスタックマシンの関数が実行されるまでは,  最初の関数はライブラリとしてリンクして使用するための関数である.  スタッ
 戻り object の内容は保証されないといけない.  クより pop した object を local 形式の serialization してbyte 列で戻す.
   2 番目の関数は Socket で通信するための同機能の関数であり,
   serialization された byte 列を{\tt ox\_stream out} へ出力する.  この場
   合, header {\tt int32 OX\_DATA}, {\tt int32 CMO\_LOCAL\_OBJECT} をつけ
   てから, byte 列を送る. この関数はおもに, homogeneous な分散システムで
   用いる.  次に, サーバスタックマシンの関数が実行されるまでは,戻り
   object の内容は保証されないといけない.
   */
 \item  \item
 local serialized object, および サポートする CMO object を  /*&jp
 {\tt OX\_DATA} として受信した場合, {\tt OperandStack} へ  local serialized object, および サポートする CMO object を{\tt
 push する.  OX\_DATA} として受信した場合, {\tt OperandStack} へpush する.  受信エ
 受信エラーを起こしたときのみ, {\tt CMO\_ERROR2} を stack へ push する.  ラーを起こしたときのみ, {\tt CMO\_ERROR2} を stack へ push する.
   */
   /*&eg
   local serialized object, および サポートする CMO object を{\tt
   OX\_DATA} として受信した場合, {\tt OperandStack} へpush する.  受信エ
   ラーを起こしたときのみ, {\tt CMO\_ERROR2} を stack へ push する.
   */
   
   
 \item  \item
 \begin{verbatim}  \begin{verbatim}
 bytes *xxx_popCMO(void)  bytes *xxx_popCMO(void)
 void xxx_popCMO(ox_stream out)  void xxx_popCMO(ox_stream out)
 \end{verbatim}  \end{verbatim}
   
 最初の関数はライブラリとしてリンクして使用するための関数である.  /*&jp
 {\tt OperandStack} より object を pop し CMO 形式の  最初の関数はライブラリとしてリンクして使用するための関数である.  {\tt
 serialized object を byte 列として戻す.  OperandStack} より object を pop し CMO 形式の serialized object を
 2 番目の関数は Socket で通信するための同機能の関数であり,  byte 列として戻す.  2 番目の関数は Socket で通信するための同機能の関数
 {\tt ox\_stream out } へ, そのデータを header  であり, {\tt ox\_stream out } へ, そのデータを header {\tt OX\_DATA}
 {\tt OX\_DATA}  をつけてながす.  をつけてながす.  この関数はおもに, heterotic な分散システムで用いる.
 この関数はおもに, heterotic な分散システムで用いる.  次に, サーバスタックマシンの関数が実行されるまでは,戻り object の内容
 次に, サーバスタックマシンの関数が実行されるまでは,  は保証されないといけない.
 戻り object の内容は保証されないといけない.  */
 \\ Request:  /*&eg
   最初の関数はライブラリとしてリンクして使用するための関数である.  {\tt
   OperandStack} より object を pop し CMO 形式の serialized object を
   byte 列として戻す.  2 番目の関数は Socket で通信するための同機能の関数
   であり, {\tt ox\_stream out } へ, そのデータを header {\tt OX\_DATA}
   をつけてながす.  この関数はおもに, heterotic な分散システムで用いる.
   次に, サーバスタックマシンの関数が実行されるまでは,戻り object の内容
   は保証されないといけない.
   */
   
   Request:
 \begin{tabular}{|c|c|}  \hline  \begin{tabular}{|c|c|}  \hline
 {\tt int32 OX\_COMMAND} & {\tt int32 OX\_popCMO}  \\  {\tt int32 OX\_COMMAND} & {\tt int32 OX\_popCMO}  \\
 \hline  \hline
 \end{tabular}  \end{tabular}
 \\ Result:  
   Result:
 \begin{tabular}{|c|c|}  \hline  \begin{tabular}{|c|c|}  \hline
 {\tt int32 OX\_DATA} &   {\it Serialized CMO} \\  {\tt int32 OX\_DATA} &   {\it Serialized CMO} \\
 \hline  \hline
 \end{tabular}  \end{tabular}
   
 以下で, {\tt ox\_stream} はサンプルサーバの場合,  //&jp 以下で, {\tt ox\_stream} はサンプルサーバの場合,
   //&eg 以下で, {\tt ox\_stream} はサンプルサーバの場合,
 \begin{verbatim}  \begin{verbatim}
 typedef FILE2 * ox_stream;  typedef FILE2 * ox_stream;
 \end{verbatim}  \end{verbatim}
 である (cf. {\tt file2.h}). これは処理系によりちがってよい.  //&jp である (cf. {\tt file2.h}). これは処理系によりちがってよい.
 {\tt ox\_asir} では, {\tt FILE *} を用いている.  //&jp {\tt ox\_asir} では, {\tt FILE *} を用いている.
   //&eg である (cf. {\tt file2.h}). これは処理系によりちがってよい.
   //&eg {\tt ox\_asir} では, {\tt FILE *} を用いている.
   
 \end{enumerate}  \end{enumerate}
   
 */  
   

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

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