=================================================================== RCS file: /home/cvs/OpenXM/doc/OpenXM-specs/stackmachine.tex,v retrieving revision 1.2 retrieving revision 1.7 diff -u -p -r1.2 -r1.7 --- OpenXM/doc/OpenXM-specs/stackmachine.tex 2000/01/21 06:24:49 1.2 +++ OpenXM/doc/OpenXM-specs/stackmachine.tex 2000/09/08 20:00:46 1.7 @@ -1,6 +1,6 @@ //&jp \section{ OX ¥¹¥¿¥Ã¥¯¥Þ¥·¥ó } -//&eg \section{ OX stackmachine } (This section has not yet been translated.) - +//&eg \section{ OX stack machine } +\label{sec:stackmachine} /*&jp ¤³¤ÎÀá¤Ç¤Ï, OX ¥¹¥¿¥Ã¥¯¥Þ¥·¥ó operator ¤ÎÀâÌÀ (TCP/IP ¥½¥±¥Ã¥È¾å¤Ç¤Îɸ½à encoding Ë¡ ¤òÍѤ¤¤ë), @@ -39,11 +39,11 @@ that for event-driven programming. {\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 }. +those in {\tt nullstackmachine.c}. */ -//&jp \subsubsection{¥µ¡¼¥Ð¥¹¥¿¥Ã¥¯¥Þ¥·¥ó¤Î¥°¥ë¡¼¥× SMobject/Basic0 ¤Ë°¤¹¤ë¥ª¥Ú¥ì¡¼¥¿} -//&eg \subsubsection{Operators in the group SMobject/Basic0} +//&jp \subsubsection{¥µ¡¼¥Ð¥¹¥¿¥Ã¥¯¥Þ¥·¥ó¤Î¥°¥ë¡¼¥× SMobject/Primitive ¤Ë°¤¹¤ë¥ª¥Ú¥ì¡¼¥¿} +//&eg \subsubsection{Operators in the group SMobject/Primitive} /*&jp \noindent @@ -78,7 +78,9 @@ CMObject ¤ËÂФ¹¤ëºÇÂç¸øÌó¿ôŪ¤Ê¥á¥Ã¥»¡¼¥¸¤Î»ÅÍͤòconte °Õ. CMO ·Á¼°¤Ç½ñ¤¤¤Æ¤¢¤Ã¤Æ¤â, ¤½¤ì¤Ï¥µ¡¼¥Ð¥¹¥¿¥Ã¥¯¥Þ¥·¥ó¤Îlocal ·Á¼° ¤Ç¥¹¥¿¥Ã¥¯¾å¤Ë¤¢¤ë¤È²ò¼á¤·¤Æ²¼¤µ¤¤.) -¤¹¤Ù¤Æ¤Î¥µ¡¼¥Ð¥¹¥¿¥Ã¥¯¥Þ¥·¥ó¤Ï°Ê²¼¤Î´Ø¿ô¤ò¼ÂÁõ¤·¤Æ¤¤¤Ê¤¤¤È¤¤¤±¤Ê¤¤. +¤¹¤Ù¤Æ¤Î¥µ¡¼¥Ð¥¹¥¿¥Ã¥¯¥Þ¥·¥ó¤Ï°Ê²¼¤ÎÁàºî¤ò¼ÂÁõ¤·¤Æ¤¤¤Ê¤¤¤È¤¤¤±¤Ê¤¤. +³ÆÁàºî¤ËÂФ·, ¤½¤ÎÁ°¸å¤Ë¤ª¤±¤ë¥¹¥¿¥Ã¥¯¤Î¾õÂÖ¤ò¼¨¤¹. ¿Þ¤Ë¤ª¤¤¤Æ, +±¦Ã¼¤Î¥ª¥Ö¥¸¥§¥¯¥È¤¬¥¹¥¿¥Ã¥¯¤Î¥È¥Ã¥×¤ËÂбþ¤¹¤ë. */ /*&eg @@ -89,39 +91,44 @@ 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 +That is, the server may translate CMObjects into its local +objects and push them onto the stack. 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 +identity map. The translation scheme is called the {\it 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 +any message is private to a connection. 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. +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 integer with the 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. +For each operation we show the states of the stack before and after +the operation. In the figures the rightmost object corresponds to the +top of the stack. Only the modified part of the stack are shown. */ \begin{enumerate} \item /*&jp -CMObject/Basic0 ¤Î CMO ¥Ç¡¼¥¿¤Î¤¦¤Áɬ¿Ü¤Î¤â¤Î, {\tt CMO\_ERROR2}, {\tt +CMObject/Primitive ¤Î CMO ¥Ç¡¼¥¿¤Î¤¦¤Áɬ¿Ü¤Î¤â¤Î, {\tt CMO\_ERROR2}, {\tt CMO\_NULL}, {\tt CMO\_INT32}, {\tt CMO\_STRING}, {\tt CMO\_LIST}¤¬¤ª¤¯ ¤é¤ì¤ÆÍ褿¾ì¹ç¤½¤ì¤ò¥¹¥¿¥Ã¥¯¤Ë push ¤¹¤ë. ¤¿¤È¤¨¤Ð, {\tt CMO\_NULL} ¤¢¤ë¤¤¤Ï {\tt CMO\_String} ¤Î¾ì¹ç¼¡¤Î¤è¤¦¤Ë¤Ê¤ë. */ /*&eg -Any server should accept CMObjects in the group CMObject/Basic0. +Any server should accept CMObjects in the group CMObject/Primitive. 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. @@ -139,10 +146,9 @@ Stack after the request: \hline \end{tabular} -//&jp Result: ¤Ê¤·. -//&eg Result: none. +Output: none. -Request: +Request:\\ \begin{tabular}{|c|c|c|c|c|c|} \hline {\tt int32 OX\_DATA} & {\tt int32 CMO\_String} &{\tt int32} {\rm size} &{\tt byte} {\rm s1} & $\cdots$ &{\tt byte} {\rm ssize}\\ @@ -155,11 +161,10 @@ Stack after the request: \hline \end{tabular} -//&jp Result: ¤Ê¤·. -//&eg Result: none. +Output: none. //&jp CMO ¥Ç¡¼¥¿¤Î¼õ¤±¼è¤ê¤Ë¼ºÇÔ¤·¤¿»þ¤Î¤ß \\ -//&eg If the server fails to receive a CMO data, +//&eg If the server fails to receive a CMO data,\\ \begin{tabular}{|c|c|c|} \hline {\tt int32 OX\_DATA} & {\tt int32 CMO\_ERROR2} & {\it CMObject} ob\\ \hline @@ -191,11 +196,11 @@ SM_mathcap /*&jp ¤³¤Î¥µ¡¼¥Ð¤Î mathcap ¤ò¤â¤É¤¹ (termcap ¤Î¤Þ¤Í). ¥µ¡¼¥Ð¤Î¥¿¥¤¥×, ¥µ¡¼ ¥Ð¥¹¥¿¥Ã¥¯¥Þ¥·¥ó¤ÎǽÎϤòÃΤ뤳¤È¤¬¤Ç¤­¤ë. C ¸À¸ì¤Ç¼ÂÁõ¤¹¤ë¾ì¹ç¤Ï, -mathCap ¤Î¹½Â¤ÂΤò¥·¥¹¥Æ¥àËè¤Ë¤­¤á¤ë¤â¤Î¤È¤·,¤³¤Î´Ø¿ô¤Ï¤½¤Î¹½Â¤ÂΤؤΠ-¥Ý¥¤¥ó¥¿¤òÌ᤹. (open sm1 ¤Ç¤Ï {\tt struct mathCap} ¤òÍѤ¤¤Æ¤¤¤ë. +mathcap ¤Î¹½Â¤ÂΤò¥·¥¹¥Æ¥àËè¤Ë¤­¤á¤ë¤â¤Î¤È¤·,¤³¤Î´Ø¿ô¤Ï¤½¤Î¹½Â¤ÂΤؤΠ+¥Ý¥¤¥ó¥¿¤òÌ᤹. (open sm1 ¤Ç¤Ï {\tt struct mathcap} ¤òÍѤ¤¤Æ¤¤¤ë. */ /*&eg -It request to push the mathcap of the server. +It requests a server 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. */ @@ -207,37 +212,43 @@ Request: \hline \end{tabular} -Result: +Stack after the request: \begin{tabular}{|c|c|} \hline {\tt int32 OX\_DATA} & {\sl Mathcap} mathCapOb \\ \hline \end{tabular} +Output: none. + \item \begin{verbatim} -SM_setMathCap +SM_setMathcap \end{verbatim} /*&jp ¼õ¤±¼è¤Ã¤¿ Mathcap {\tt m} ¤ò¼«Ê¬¤Î¥·¥¹¥Æ¥à¤ËÀßÄꤷ¤Æ, Áê¼ê¦¤¬Íý²òÉÔ -ǽ¤Ê CMO ¤ò¤ª¤¯¤é¤Ê¤¤¤è¤¦¤Ë¤¹¤ë. C ¸À¸ì¤Ç¼ÂÁõ¤¹¤ë¾ì¹ç¤Ï, mathCap ¤Î¹½ +ǽ¤Ê CMO ¤ò¤ª¤¯¤é¤Ê¤¤¤è¤¦¤Ë¤¹¤ë. 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. +It requests a server 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) +Stack before the request: +\begin{tabular}{|c|} \hline +{\it Mathcap m} \\ +\hline +\end{tabular}\\ Request: \begin{tabular}{|c|c|} \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 \end{tabular} -//&jp Result: ¤Ê¤·. \\ -//&eg Result: none. \\ +Output: none. /*&jp \noindent Ãí°Õ: mathcap ¤Ï°ìÈ̤˥¯¥é¥¤¥¢¥ó¥È¼çÂΤÇÀßÄꤹ¤ë. @@ -246,14 +257,14 @@ Request: ¤½¤ì¤ò, ¥¯¥é¥¤¥¢¥ó¥È¤Ï¤½¤Î¥µ¡¼¥Ð¤ËÉտ路¤¿ 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 +sends its own mathcap by {\tt SM\_setMathcap} and the server registers it. */ @@ -262,35 +273,24 @@ registers it. SM_executeStringByLocalParser \end{verbatim} /*&jp -ʸ»úÎó $s$ ¤ò¥·¥¹¥Æ¥à xxx ¤Îʸˡ(¥µ¡¼¥Ð¥¹¥¿¥Ã¥¯¥Þ¥·¥ó¤ÎÁȤ߹þ¤ß¥í¡¼¥« -¥ë¸À¸ì)¤Ë¤·¤¿¤¬¤Ã¤¿¥³¥Þ¥ó¥É¤È¤·¤Æ¼Â¹Ô¤¹¤ë. ¤¿¤À¤·, ¥³¥Þ¥ó¥É¤Î¼Â¹Ô¤Î·ë +ʸ»úÎó {\tt s} ¤ò stack ¤«¤é pop ¤·, +¤½¤Îʸ»úÎó¤ò¥·¥¹¥Æ¥à¸ÇÍ­¤Îʸˡ(¥µ¡¼¥Ð¥¹¥¿¥Ã¥¯¥Þ¥·¥ó¤ÎÁȤ߹þ¤ß¥í¡¼¥« +¥ë¸À¸ì)¤Ë¤·¤¿¤¬¤Ã¤¿¥³¥Þ¥ó¥É¤È¤·¤Æ¼Â¹Ô¤¹¤ë. ¥³¥Þ¥ó¥É¤Î¼Â¹Ô¤Î·ë ²Ì¤ÎºÇ¸å¤ËÌá¤êÃͤ¬¤¢¤ë¤È¤­¤Ï, {\tt OperandStack} ¤ËÌá¤êÃͤò push ¤¹¤ë. -Àµ¾ï½ªÎ»¤Ê¤é 0 ¤ò, °Û¾ï½ªÎ»¤Ê¤é -1 ¤ò¤â¤É¤¹. debug ¥â¡¼¥É¤Ë¤Ï¤¤¤Ã¤¿¾ì -¹ç, -2 ¤òÌ᤹. ¥¨¥é¡¼¤Î»þ Error2 Object¤ò stack ¤Ø push ¤¹¤ë.\\ {\tt -kan/sm1} ¤Î¾ì¹ç, ¥µ¡¼¥Ð¥¹¥¿¥Ã¥¯¥Þ¥·¥ó¤ÎÁȤ߹þ¤ß¥í¡¼¥«¥ë¸À¸ì¤Ï{\tt sm1} -¥Ý¥¹¥È¥¹¥¯¥ê¥×¥È¸À¸ì¤Ç¤¢¤ë. ¥µ¡¼¥Ð¥¹¥¿¥Ã¥¯¥Þ¥·¥ó¤È, {\tt sm1} ¥Ý¥¹¥È -¥¹¥¯¥ê¥×¥È¸À¸ì¤Ï¥¹¥¿¥Ã¥¯¤ò¶¦Í­¤¹¤ë¤è¤¦¤Ë¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë. ¼ÂºÝ¤Î·×»»¤Ï -{\tt executeStringByLocalParser} ¤Ë¤è¤ê¼Â¹Ô¤µ¤ì¤ë. open XM ¤Ç¤Ï, ¸½ºß -¤Î¤È¤³¤í´Ø¿ô̾¤Îɸ½à²½¤Ï¤ª¤³¤Ê¤Ã¤Æ¤¤¤Ê¤¤. ¤·¤¿¤¬¤Ã¤Æ, ¼ÂºÝ¤Î·×»»¥³¥Þ -¥ó¥É¤ÎÁ÷½Ð¤Ï mathcap ¤ò¤ß¤Æ¥¯¥é¥¤¥¢¥ó¥È¤¬Àµ¤·¤¤¥³¥Þ¥ó¥É¤òÁªÂò¤¹¤ëɬÍ× -¤¬¤¢¤ë. (¤·¤«¤·¤Ê¤¬¤é, ¶¦ÄÌ´Ø¿ô̾¤¬¤Ê¤¤¤¿¤á¤Ë, ¶¦ÄÌ»ÅÍͤΥµ¡¼¥Ð¥¹¥¿¥Ã -¥¯¥Þ¥·¥ó¤Î¼ÂÁõ¤Ï¤­¤ï¤á¤Æ´Êñ¤Ç¤¢¤ë. ´Ø¿ô̾¤Î¶¦Ä̲½¤Ï¾­Íè¤Î²ÝÂê.) \\³ä -¹þ¤ß¤Ë´Ø¤·¤Æ¤Ï, -1 ¤òÌ᤹¤è¤¦¤Ë ¥Ï¥ó¥É¥é¤ò½ñ¤¯. -executeStringByLocalParser() ¤òºÆµ¢Åª¤Ë¸Æ¤ó¤À¤È¤­¤â ³ä¤ê¹þ¤ß¤Î¥Ï¥ó¥É¥é -¤¬Àµ¤·¤¯Æ°ºî¤¹¤ë¤è¤¦¤Ë¤³¤Î´Ø¿ô¤Ï½ñ¤«¤ì¤ë¤Ù¤­¤Ç¤¢¤ë. ¤³¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð -¤·¤¿¤Î¤Á, signal, setjmp ¤ÎºÆÀßÄê¤ò¸Æ¤Ó½Ð¤·Â¦¤Ç¤ä¤é¤Ê¤¤¤È¤¤¤±¤Ê¤¤. \\ +OpenXM ¤Ç¤Ï, ¸½ºß¤Î¤È¤³¤í´Ø¿ô̾¤Îɸ½à²½¤Ï¤ª¤³¤Ê¤Ã¤Æ¤¤¤Ê¤¤. ¤³¤Î´Ø¿ô¤ª¤è¤Ó {\tt popString} ¤Îµ¡Ç½¤ò¼Â¸½¤¹¤ì¤Ð, ºÇÄã¸Â¤Î open XM ¤Î ¥µ¡¼¥Ð¤Ë¤Ê¤ì¤ë. ¼ÂÁõ¤Ç¤Ï, ¤Þ¤º¤³¤ÎÆó¤Ä¤Î´Ø¿ô¤Îµ¡Ç½¤ò¼Â¸½¤¹¤Ù¤­¤Ç¤¢¤ë. */ /*&eg -A character string $s$ is parsed by the local parser of the stack -machine and interpreted by the local interpreter. -If the exececution produces a result, it is pushed onto +It requests a server to pop a character string {\tt s}, to +parse it by the local parser of the stack machine, and +to interpret by the local interpreter. +If the execution produces a Output, it is pushed onto {\tt OperandStack}. -If an error has occured, Error2 Object is pushed onto the stack. +If an error has occurred, Error2 Object is pushed onto the stack. 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. +is ready to be used as an OX server. */ Stack before the request: @@ -306,12 +306,11 @@ Request: \hline \end{tabular} -//&jp Result: ¤Ê¤·. -//&eg Result: none. +Output: none. /*&jp \noindent »²¹Í: \ ¼Â¹ÔÁ°¤Î¥¹¥¿¥Ã¥¯¤Î¥Ç¡¼¥¿¤Ï, -{\it String commandString} ¤Ê¤ë local stackmachine ¤Î object ¤È¤·¤Æ¥¹ +{\it String commandString} ¤Ê¤ë local stack machine ¤Î object ¤È¤·¤Æ¥¹ ¥¿¥Ã¥¯¾å¤Ë¤¢¤ë¤¬, TCP/IP ¤ÎÄÌ¿®Ï©¤Ç¤Ï, ¼¡¤Î¤è¤¦¤Ê¥Ç¡¼¥¿¤¬¤Þ¤º¤Ê¤¬¤ì¤Æ {\it commandName} ¤¬¥¹¥¿¥Ã¥¯¤Ë push ¤µ¤ì¤ë: */ @@ -337,7 +336,7 @@ SM_executeStringByLocalParserInBatchMode /*&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. +if an error has occurred. */ \item \begin{verbatim} @@ -346,16 +345,16 @@ SM_popString /*&jp {\tt OperandStack} ¤è¤ê Object ¤ò pop ¤·, ¤½¤ì¤ò xxx ¤Î½ÐÎϵ¬Â§¤Ë¤·¤¿¤¬¤¤Ê¸ »úÎ󷿤ËÊÑ´¹¤·¤ÆÁ÷¿®¤¹¤ë. ¥¹¥¿¥Ã¥¯¤¬¶õ¤Î¤È¤­¤Ï, {\tt (char *)NULL} ¤òÌ᤹. -ʸ»úÎó¤Ï {\tt ox\_stream out}¤Ø CMO ¤Î¥Ç¡¼ +ʸ»úÎó¤Ï TCP/IP stream ¤Ø CMO ¤Î¥Ç¡¼ ¥¿¤È¤·¤ÆÁ÷¿®¤¹¤ë. ¥¨¥é¡¼¤Î¾ì¹ç¤Ï {\tt CMO\_ERROR2} ¤òÌ᤹¤Ù¤­¤Ç¤¢¤ë. */ /*&eg -It requests for a server to pop an object from {\tt OperandStack}, +It requests 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. +The returned string is sent as a CMO string data. +{\tt CMO\_ERROR2} should be returned if an error has occurred. */ Stack before the request: @@ -370,7 +369,7 @@ Request: \hline \end{tabular} -Result: +Output: \begin{tabular}{|c|c|c|} \hline {\tt int32 OX\_DATA} & {\tt int32 CMO\_STRING} & {\it size and the string s} \\ \hline @@ -385,7 +384,7 @@ SM_getsp object ¤¬ push ¤µ¤ì¤¿¤Ð¤¢¤¤, 1 ¤Å¤ÄÁý¤¨¤ë¤â¤Î¤È¤¹¤ë. */ /*&eg -It request to push the current stack pointer onto the stack. +It requests a server 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. @@ -403,12 +402,14 @@ Request: \hline \end{tabular} -Result: +Stack after the request: \begin{tabular}{|c|c|c|} \hline {\tt int32 OX\_DATA} & {\tt int32 CMO\_INT32} & {\it stack pointer value} \\ \hline \end{tabular} +Output: none. + \item \begin{verbatim} SM_dupErrors @@ -418,26 +419,54 @@ SM_dupErrors ¤µ¤»¤Ê¤¤. */ /*&eg -It requests to push a list object containing all error objects on the stack. +It requests a server to push a list object containing all error objects on the stack. */ -Stack before the request: -\begin{tabular}{|c|} \hline -{\it Object} \\ +Request: +\begin{tabular}{|c|c|} \hline +{\tt int32 OX\_COMMAND} & {\tt int32 SM\_dupErrors} \\ \hline \end{tabular} +Stack after the request: +\begin{tabular}{|c|c|c|} \hline +{\tt int32 OX\_DATA} & {\sl CMObject} \ a list of errors\\ +\hline +\end{tabular} + +Output: none. + +\item +\begin{verbatim} +SM_pushCMOtag +\end{verbatim} +/*&jp +¥¹¥¿¥Ã¥¯¤ÎÀèƬ¥ª¥Ö¥¸¥§¥¯¥È¤¬ CMO ¤ËÊÑ´¹¤µ¤ì¤¿¾ì¹ç¤Î CMO tag ¤ò +{\tt CMO\_INT32} ¤È¤·¤Æ¥¹¥¿¥Ã¥¯¤Ø push ¤¹¤ë. +ÀèƬ¥ª¥Ö¥¸¥§¥¯¥È¤Ï¥¹¥¿¥Ã¥¯¤Ëα¤Þ¤ë. +ÀèƬ¥ª¥Ö¥¸¥§¥¯¥È¤òCMO ¤ØÊÑ´¹¤¹¤ëÊýË¡¤¬Ìµ¤¤¾ì¹ç¤Ï, ¥¨¥é¡¼ object ¤òÀѤà. +*/ +/*&eg +It requests a server to push the CMO tag of the top object on the server +stack. The tag is pushed as {\tt CMO\_INT32}. +The top object remains on the stack. +If there is no way to translate the object into CMO, +push an error object. +*/ + Request: \begin{tabular}{|c|c|} \hline -{\tt int32 OX\_COMMAND} & {\tt int32 SM\_dupErrors} \\ +{\tt int32 OX\_COMMAND} & {\tt int32 SM\_pushCMOtag} \\ \hline \end{tabular} -Result: +Stack after the request: \begin{tabular}{|c|c|c|} \hline -{\tt int32 OX\_DATA} & {\sl CMObject} \ a list of errors\\ +{\tt int32 OX\_DATA} & {\sl CMO\_INT32} \ tag\\ \hline \end{tabular} + +Output: none. \end{enumerate} \medbreak @@ -450,7 +479,7 @@ mathcap ¤ÎÌ䤤¹ç¤ï¤»¤ËÂФ·¤Æ, {\tt ox\_sm1} ¤Ï¼¡¤Î¤è¤¦ {\bf Example}: \ {\tt ox\_sm1} returns the following data as its mathcap. */ -%%Prog: [(cmoMathCap)] extension :: +%%Prog: [(cmoMathcap)] extension :: \begin{verbatim} Class.mathcap [ [199909080 , $Ox_system=ox_sm1.plain$ , $Version=2.990911$ , @@ -462,10 +491,13 @@ Class.mathcap /*&jp mathcap ¤Ï 3¤Ä¤ÎÍ×ÁǤò¤â¤Ä¥ê¥¹¥È¤Ç¤¢¤ë. ¤Þ¤Å, ºÇ½é¤ÎÍ×ÁǤò¸«¤è¤¦. -Ox\_system ¤Ï open xxx ¥·¥¹¥Æ¥à̾¤Ç¤¢¤ë. Æɤ߹þ¤à¥é¥¤¥Ö¥é¥ê¤¬¤Á¤¬¤Ã¤Æ +ºÇ½é¤Î¿ô»ú¤Ï OpenXM ¥×¥í¥È¥³¥ë¤Î¥Ð¡¼¥¸¥ç¥ó¤Ç¤¢¤ë. +¸½ºß¤Ç¤Ï 1.1.3 Åù¤Î¥Ð¡¼¥¸¥ç¥ó¤¬ 001001003 ¤È¿ô»ú¤Ë¥¨¥ó¥³¡¼¥É¤µ¤ì¤Æ +¤³¤³¤Ë³ÊǼ¤µ¤ì¤ë. +Ox\_system ¤Ï openXM ¥·¥¹¥Æ¥à̾¤Ç¤¢¤ë. Æɤ߹þ¤à¥é¥¤¥Ö¥é¥ê¤¬¤Á¤¬¤Ã¤Æ ¤¤¤Æ, ´Ø¿ô̾(¤Þ¤¿¤Ï ¥·¥ó¥Ü¥ë)¤Î°ÕÌ£¤¬¤Á¤¬¤¦¤È¤­¤Ï¤³¤Î̾Á°¤â¤«¤¨¤ë. ¤¿ ¤È¤¨¤Ð, open math ¤Î basic content dictionary Âбþ¤Î´Ø¿ôÄêµÁ¥Þ¥¯¥í¤òÆÉ -¤ß¤³¤ó¤À sm1 ¤Ï, ox\_sm1\_basicCD ¤Ê¤ë̾Á°¤Ë¤¹¤ë. HOSTTYPEÃͤÏ, CPU +¤ß¤³¤ó¤À sm1 ¤Ï, ox\_sm1\_basicCD ¤Ê¤ë̾Á°¤Ë¤¹¤ë. HOSTTYPE ÃͤÏ, CPU ¤Î¼ïÎà¤ò¤¢¤é¤ï¤·unix ¤Ç¤Ï´Ä¶­ÊÑ¿ô\verb+$HOSTTYPE+ ¤ÎÃͤǤ¢¤ë. 2 ÈÖÌÜ ¤ÎÍ×ÁÇ¤Ï ÍøÍѲÄǽ¤Ê SM ¥³¥Þ¥ó¥É¤ò¤¢¤Ä¤á¤¿¥ê¥¹¥È¤Ç¤¢¤ë. 3 ÈÖÌܤΥꥹ¥È ¤Ï, ½èÍý²Äǽ¤Ê¿ô³Ø¥Ç¡¼¥¿¤Î·Á¼°, ¤ª¤è¤ÓCMO¤Î¾ì¹ç¤Ê¤é½èÍý²Äǽ¤ÊCMO¤Î¥¿¥° @@ -474,13 +506,14 @@ Ox\_system ¤Ï open xxx ¥·¥¹¥Æ¥à̾¤Ç¤¢¤ë. Æɤ߹þ¤à¥é¥¤ */ /*&eg A mathcap has three components. The first one contains informations -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+ +to identify the version number of the OpenXM protocol, +the system and hosts on which the application runs. +In the above example, {\tt Ox\_system} denotes the system name. +{\tt 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. +of an OX message tag and the list of 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 @@ -494,7 +527,7 @@ list represents available CMO tags. %%Prog: (ox.sm1) run sm1connectr [(oxWatch) ox.ccc] extension %%Prog: ox.ccc (122345; ) oxsubmit ; //&jp {\tt message\_body} ¤Î¼ÂÎã¤ò¤¢¤²¤ë. ¥·¥ê¥¢¥ëÈÖ¹æÉô¤Ï½ü¤¤¤Æ¤¢¤ë. -//&eg {\tt message\_body} ¤Î¼ÂÎã¤ò¤¢¤²¤ë. ¥·¥ê¥¢¥ëÈÖ¹æÉô¤Ï½ü¤¤¤Æ¤¢¤ë. +//&eg We show examples of {\tt message\_body}. Serial numbers are omitted. \begin{enumerate} \item {\tt executeStringByLocalParser("12345 ;");} /*&jp @@ -502,8 +535,9 @@ list represents available CMO tags. {\tt xx(yy)} ¤Î¤Ê¤«¤Î {\tt (yy)} ¤ÏÂбþ¤¹¤ë¥¢¥¹¥­¡¼¥³¡¼¥É¤ò¤¢¤ï¤é¤¹. */ /*&eg -¤Ï¼¡¤Î¤è¤¦¤Ê¥Ñ¥±¥Ã¥È¤ËÊÑ´¹¤µ¤ì¤ë. ³Æ¿ô»ú¤Ï 16¿Ê1¥Ð¥¤¥È¤ò¤¢¤é¤ï¤¹. -{\tt xx(yy)} ¤Î¤Ê¤«¤Î {\tt (yy)} ¤ÏÂбþ¤¹¤ë¥¢¥¹¥­¡¼¥³¡¼¥É¤ò¤¢¤ï¤é¤¹. +is converted into the following packet. Each number denotes +one byte in hexadecimal representation. +{\tt (yy)} in {\tt xx(yy)} represents the corresponding ASCII code. */ \begin{verbatim} 0 0 2 2 0 0 0 4 0 0 0 7 @@ -511,28 +545,12 @@ list represents available CMO tags. 0 0 2 1 0 0 1 c \end{verbatim} /*&jp -¤³¤³¤Ç, -\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} ¤òɽ¤¹. +¤½¤ì¤¾¤ì¤Î¥Ç¡¼¥¿¤Î°ÕÌ£¤Ï¼¡¤Î¤È¤ª¤ê¤Ç¤¢¤ë. */ /*&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} ¤òɽ¤¹. +Each data has the following meaning. */ -//&jp ¤Þ¤È¤á¤ë¤È¼¡¤Î¤è¤¦¤Ë¤Ê¤ë. -//&eg ¤Þ¤È¤á¤ë¤È¼¡¤Î¤è¤¦¤Ë¤Ê¤ë. \begin{verbatim} 0 0 2 2 (OX_DATA) 0 0 0 4 (CMO_STRING) 0 0 0 7 (size) @@ -541,7 +559,7 @@ CMO ¤Î¥¿¥°¤Î, {\tt CMO\_STRING} ¤òɽ¤¹. 0 0 1 c (SM_executeStringByLocalParser) \end{verbatim} //&jp ¤³¤ì¤ò OXexpression ¤Çɽµ­¤¹¤ë¤È¼¡¤Î¤è¤¦¤Ë¤Ê¤ë. -//&eg ¤³¤ì¤ò OXexpression ¤Çɽµ­¤¹¤ë¤È¼¡¤Î¤è¤¦¤Ë¤Ê¤ë. +//&eg This is expressed by OXexpression as follows. \begin{center} (OX\_DATA, (CMO\_STRING, 7, "12345 ;")) \end{center} @@ -550,48 +568,49 @@ CMO ¤Î¥¿¥°¤Î, {\tt CMO\_STRING} ¤òɽ¤¹. \end{center} //&jp \item {\tt popString()} ¤òÍ×ÀÁ¤¹¤ë¥á¥Ã¥»¡¼¥¸: -//&eg \item {\tt popString()} ¤òÍ×ÀÁ¤¹¤ë¥á¥Ã¥»¡¼¥¸: +//&eg \item A message which requests {\tt SM\_popString}: \begin{verbatim} 0 0 2 1 (OX_COMMAND) 0 0 1 7 (SM_popString) \end{verbatim} -OXexpression ¤Ç¤Ï +//&jp OXexpression ¤Ç¤Ï +//&eg In OXexpression it is represented as (OX\_COMMAND, (SM\_popString)). \noindent //&jp ¤³¤ì¤Ë¤¿¤¤¤·¤Æ¼¡¤ÎÊÖÅú¥á¥Ã¥»¡¼¥¸¤¬¤¯¤ë. -//&eg ¤³¤ì¤Ë¤¿¤¤¤·¤Æ¼¡¤ÎÊÖÅú¥á¥Ã¥»¡¼¥¸¤¬¤¯¤ë. +//&eg The server returns the following reply message: \begin{verbatim} 0 0 2 2 (OX_DATA) 0 0 0 4 (CMO_STRING) 0 0 0 5 (size) 31(1) 32(2) 33(3) 34(4) 35(5) \end{verbatim} //&jp OXexpression ¤Ç¤«¤¯¤È, -//&eg OXexpression ¤Ç¤«¤¯¤È, +//&eg In OXexpression it is represented as (OX\_DATA, (CMO\_STRING, 7, "12345 ;")). \end{enumerate} -//&jp \subsubsection{¥°¥ë¡¼¥× SMobject/Basic1 ¤Ë°¤¹¤ë¥ª¥Ú¥ì¡¼¥¿} -//&eg \subsubsection{¥°¥ë¡¼¥× SMobject/Basic1 ¤Ë°¤¹¤ë¥ª¥Ú¥ì¡¼¥¿} +//&jp \subsubsection{¥°¥ë¡¼¥× SMobject/Basic ¤Ë°¤¹¤ë¥ª¥Ú¥ì¡¼¥¿} +//&eg \subsubsection{Operators in the group SMobject/Basic} \begin{enumerate} \item \begin{verbatim} -void xxx_pops(int n) +SM_pops \end{verbatim} /*&jp -operand stack ¤è¤ê, {\it n} ¸Ä¤Î¸µ ({\it obj1, obj2, $\ldots$, objn}) +operand stack ¤è¤ê, {\it n} ¸Ä¤Î¸µ ({\it obj1, obj2, $\ldots$, objn} ¤ò pop ¤·¤Æ¼Î¤Æ¤ë. */ /*&eg -operand stack ¤è¤ê, {\it n} ¸Ä¤Î¸µ ({\it obj1, obj2, $\ldots$, objn}) -¤ò pop ¤·¤Æ¼Î¤Æ¤ë. +It requests a server to pop {\it n} and to discard elements {\it obj1, obj2, +$\ldots$, objn} from the stack. */ -//&jp Stack before the request: (±¦¤¬ stack ¤Î¥È¥Ã¥×¤Ç¤¢¤ë.) \\ -//&eg Stack before the request: (±¦¤¬ stack ¤Î¥È¥Ã¥×¤Ç¤¢¤ë.) \\ +//&jp Stack before the request: \\ +//&eg Stack before the request: \\ \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 Integer32 n} \\ \hline \end{tabular} @@ -601,13 +620,12 @@ Request: \hline \end{tabular} -//&jp Result: ¤Ê¤·. -//&eg Result: none. +Output: none. \item \begin{verbatim} -int xxx_setName(char *name) +int SM_setName \end{verbatim} /*&jp {\tt OperandStack} ¤è¤ê {\it name} ¤ò pop ¤·, ¤Ä¤®¤Ë{\tt OperandStack} @@ -616,13 +634,13 @@ bind ¤¹¤ë. Àµ¾ï½ªÎ»¤Ê¤é 0 ¤ò, °Û¾ï½ªÎ»¤Ê¤é -1 ¤ò¤â¤É¤ ¤ëÄÌ¿®¤Ç¤Ï, °Û¾ï½ªÎ»¤Î»þ¤Î¤ß, {\tt CMO\_ERROR2} ¤òstack ¤Ø push ¤¹¤ë. */ /*&eg -{\tt OperandStack} ¤è¤ê {\it name} ¤ò pop ¤·, ¤Ä¤®¤Ë{\tt OperandStack} -¤è¤ê {\it obj} ¤ò pop ¤·, ¤½¤ì¤ò¸½ºß¤Î̾Á°¶õ´Ö¤ÇÊÑ¿ô {\it name} ¤Ë -bind ¤¹¤ë. Àµ¾ï½ªÎ»¤Ê¤é 0 ¤ò, °Û¾ï½ªÎ»¤Ê¤é -1 ¤ò¤â¤É¤¹. TCP/IP ¤Ë¤è -¤ëÄÌ¿®¤Ç¤Ï, °Û¾ï½ªÎ»¤Î»þ¤Î¤ß, {\tt CMO\_ERROR2} ¤òstack ¤Ø push ¤¹¤ë. +It requests a server to pop {\it name}, to pop {\it obj}, and to +bind {\it obj} to a variable {\it name} in the current name space +of the server. +If an error has occurred {\tt CMO\_ERROR2} is pushed onto the stack. */ -//&jp Stack before the request: (±¦¤¬ stack ¤Î top.) -//&eg Stack before the request: (±¦¤¬ stack ¤Î top.) +//&jp Stack before the request: +//&eg Stack before the request: \begin{tabular}{|c|c|} \hline {\it obj} & {\it String name} \\ \hline @@ -634,28 +652,29 @@ Request: \hline \end{tabular} -//&jp Result: ¤Ê¤·. -//&eg Result: none. +Output: none. \item \begin{verbatim} -int xxx_evalName(char *name) +SM_evalName \end{verbatim} + /*&jp ¸½ºß¤Î̾Á°¶õ´Ö¤ÇÊÑ¿ô {\it name} ¤òɾ²Á¤¹¤ë. ɾ²Á¤Î·ë²Ì {\it -resultObj} ¤ò¥¹¥¿¥Ã¥¯¤ØÌ᤹. ´Ø¿ô¼«ÂΤÏÀµ¾ï½ªÎ»¤Ê¤é 0 ¤ò, °Û¾ï½ªÎ»¤Ê +OutputObj} ¤ò¥¹¥¿¥Ã¥¯¤ØÌ᤹. ´Ø¿ô¼«ÂΤÏÀµ¾ï½ªÎ»¤Ê¤é 0 ¤ò, °Û¾ï½ªÎ»¤Ê ¤é -1 ¤ò¤â¤É¤¹. TCP/IP ¤Î¾ì¹ç, °Û¾ï½ªÎ»¤Î¾ì¹ç¤Î¤ß {\tt CMO\_ERROR2} ¤ò stack ¤Ø push ¤¹¤ë. */ + /*&eg -¸½ºß¤Î̾Á°¶õ´Ö¤ÇÊÑ¿ô {\it name} ¤òɾ²Á¤¹¤ë. ɾ²Á¤Î·ë²Ì {\it -resultObj} ¤ò¥¹¥¿¥Ã¥¯¤ØÌ᤹. ´Ø¿ô¼«ÂΤÏÀµ¾ï½ªÎ»¤Ê¤é 0 ¤ò, °Û¾ï½ªÎ»¤Ê -¤é -1 ¤ò¤â¤É¤¹. TCP/IP ¤Î¾ì¹ç, °Û¾ï½ªÎ»¤Î¾ì¹ç¤Î¤ß {\tt CMO\_ERROR2} -¤ò stack ¤Ø push ¤¹¤ë. +It requests a server to pop {\it name} and to evaluate a variable +{\it name} in the current name space. The Output of the evaluation +{\it OutputObj} is pushed to the stack. +If an error has occurred {\tt CMO\_ERROR2} is pushed onto the stack. */ -//&jp Stack before the request: (±¦¤¬ stack ¤Î top.) -//&eg Stack before the request: (±¦¤¬ stack ¤Î top.) +//&jp Stack before the request: +//&eg Stack before the request: \begin{tabular}{|c|} \hline {\it String name} \\ \hline @@ -667,19 +686,18 @@ Request: \hline \end{tabular} -//&jp Stack after the request: (±¦¤¬ stack ¤Î top.) -//&eg Stack after the request: (±¦¤¬ stack ¤Î top.) +//&jp Stack after the request: +//&eg Stack after the request: \begin{tabular}{|c|} \hline -{\it resultObj} \\ +{\it OutputObj} \\ \hline \end{tabular} -//&jp Result: ¤Ê¤·. -//&eg Result: none. +Output: none. \item \begin{verbatim} -int xxx_executeFunction(char *s, int n) +SM_executeFunction \end{verbatim} /*&jp ¥¹¥¿¥Ã¥¯¤è¤ê {\it n} ¸Ä¤Î¥Ç¡¼¥¿¤ò pop ¤·¤Æ, ¥µ¡¼¥Ð¤Î¥í¡¼¥«¥ë´Ø¿ô{\it @@ -687,13 +705,15 @@ s} ¤ò¼Â¹Ô¤¹¤ë. ¥¨¥é¡¼¤Î¤È¤­¤Î¤ß {\tt CMO\_ERROR2} ¤ò ¤ë. */ /*&eg -¥¹¥¿¥Ã¥¯¤è¤ê {\it n} ¸Ä¤Î¥Ç¡¼¥¿¤ò pop ¤·¤Æ, ¥µ¡¼¥Ð¤Î¥í¡¼¥«¥ë´Ø¿ô{\it -s} ¤ò¼Â¹Ô¤¹¤ë. ¥¨¥é¡¼¤Î¤È¤­¤Î¤ß {\tt CMO\_ERROR2} ¤ò stack ¤Ø push ¤¹ -¤ë. +It requests a server to pop {\it s} as a function name, +to pop {\it n} as the number of arguments and to execute +a local function {\it s} with {\it n} arguments popped from +the stack. +If an error has occurred {\tt CMO\_ERROR2} is pushed to the stack. */ -//&jp Stack before the request: (±¦¤¬ stack ¤Î top.) \\ -//&eg Stack before the request: (±¦¤¬ stack ¤Î top.) \\ +//&jp Stack before the request: \\ +//&eg Stack before the request: \\ \begin{tabular}{|c|c|c|c|c|} \hline {\it objn} & $\cdots$ & {\it obj1} & {\it INT32 n} & {\it String s} \\ \hline @@ -706,71 +726,44 @@ Request: \end{tabular} //&jp Stack after the request: ´Ø¿ô¼Â¹Ô¤Î·ë²Ì. -//&eg Stack after the request: ´Ø¿ô¼Â¹Ô¤Î·ë²Ì. +//&eg Stack after the request: The Output of the execution. -//&jp Result: ¤Ê¤·. -//&eg Result: none. +Output: none. \item \begin{verbatim} -bytes *xxx_popSerializedLocalObject(void) -void popSerializedLocalObject(ox_stream out) +SM_popSerializedLocalObject \end{verbatim} + /*&jp -ºÇ½é¤Î´Ø¿ô¤Ï¥é¥¤¥Ö¥é¥ê¤È¤·¤Æ¥ê¥ó¥¯¤·¤Æ»ÈÍѤ¹¤ë¤¿¤á¤Î´Ø¿ô¤Ç¤¢¤ë. ¥¹¥¿¥Ã -¥¯¤è¤ê 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 ¤ÎÆâÍƤÏÊݾڤµ¤ì¤Ê¤¤¤È¤¤¤±¤Ê¤¤. +¥¹¥¿¥Ã¥¯¤è¤ê pop ¤·¤¿ object ¤ò local ·Á¼°¤Ç serialization ¤·¤Æ +OX message ¤È¤·¤Æ stream ¤Ø½ÐÎϤ¹¤ë. OX message tag ¤È¤·¤Æ¤Ï, +local ·Á¼°¤ËÂбþ¤·¤¿¤â¤Î¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¤³¤È¤¬É¬ÍפǤ¢¤ë. +¤³¤Î´Ø¿ô¤Ï¤ª¤â¤Ë, homogeneous ¤Êʬ»¶¥·¥¹¥Æ¥à¤ÇÍѤ¤¤ë. */ /*&eg -ºÇ½é¤Î´Ø¿ô¤Ï¥é¥¤¥Ö¥é¥ê¤È¤·¤Æ¥ê¥ó¥¯¤·¤Æ»ÈÍѤ¹¤ë¤¿¤á¤Î´Ø¿ô¤Ç¤¢¤ë. ¥¹¥¿¥Ã -¥¯¤è¤ê 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 ¤ÎÆâÍƤÏÊݾڤµ¤ì¤Ê¤¤¤È¤¤¤±¤Ê¤¤. +It requests a sever to pop an object, to convert it into a +serialized form according to a local serialization scheme, and +to send it to the stream as an OX message. +An OX message tag corresponding to +the local data format must be sent prior to the serialized data +itself. +This operation is used mainly on homogeneous distributed systems. */ -\item -/*&jp -local serialized object, ¤ª¤è¤Ó ¥µ¥Ý¡¼¥È¤¹¤ë CMO object ¤ò{\tt -OX\_DATA} ¤È¤·¤Æ¼õ¿®¤·¤¿¾ì¹ç, {\tt OperandStack} ¤Øpush ¤¹¤ë. ¼õ¿®¥¨ -¥é¡¼¤òµ¯¤³¤·¤¿¤È¤­¤Î¤ß, {\tt CMO\_ERROR2} ¤ò stack ¤Ø push ¤¹¤ë. -*/ -/*&eg -local serialized object, ¤ª¤è¤Ó ¥µ¥Ý¡¼¥È¤¹¤ë CMO object ¤ò{\tt -OX\_DATA} ¤È¤·¤Æ¼õ¿®¤·¤¿¾ì¹ç, {\tt OperandStack} ¤Øpush ¤¹¤ë. ¼õ¿®¥¨ -¥é¡¼¤òµ¯¤³¤·¤¿¤È¤­¤Î¤ß, {\tt CMO\_ERROR2} ¤ò stack ¤Ø push ¤¹¤ë. -*/ \item \begin{verbatim} -bytes *xxx_popCMO(void) -void xxx_popCMO(ox_stream out) +SM_popCMO \end{verbatim} /*&jp -ºÇ½é¤Î´Ø¿ô¤Ï¥é¥¤¥Ö¥é¥ê¤È¤·¤Æ¥ê¥ó¥¯¤·¤Æ»ÈÍѤ¹¤ë¤¿¤á¤Î´Ø¿ô¤Ç¤¢¤ë. {\tt -OperandStack} ¤è¤ê object ¤ò pop ¤· CMO ·Á¼°¤Î serialized object ¤ò -byte Îó¤È¤·¤ÆÌ᤹. 2 ÈÖÌܤδؿô¤Ï Socket ¤ÇÄÌ¿®¤¹¤ë¤¿¤á¤ÎƱµ¡Ç½¤Î´Ø¿ô -¤Ç¤¢¤ê, {\tt ox\_stream out } ¤Ø, ¤½¤Î¥Ç¡¼¥¿¤ò header {\tt OX\_DATA} -¤ò¤Ä¤±¤Æ¤Ê¤¬¤¹. ¤³¤Î´Ø¿ô¤Ï¤ª¤â¤Ë, heterotic ¤Êʬ»¶¥·¥¹¥Æ¥à¤ÇÍѤ¤¤ë. -¼¡¤Ë, ¥µ¡¼¥Ð¥¹¥¿¥Ã¥¯¥Þ¥·¥ó¤Î´Ø¿ô¤¬¼Â¹Ô¤µ¤ì¤ë¤Þ¤Ç¤Ï,Ìá¤ê object ¤ÎÆâÍÆ -¤ÏÊݾڤµ¤ì¤Ê¤¤¤È¤¤¤±¤Ê¤¤. +{\tt OperandStack} ¤è¤ê object ¤ò pop ¤· CMO ·Á¼°¤Î serialized object ¤ò +stream ¤Ø header {\tt OX\_DATA} ¤ò¤Ä¤±¤Æ¤Ê¤¬¤¹. */ /*&eg -ºÇ½é¤Î´Ø¿ô¤Ï¥é¥¤¥Ö¥é¥ê¤È¤·¤Æ¥ê¥ó¥¯¤·¤Æ»ÈÍѤ¹¤ë¤¿¤á¤Î´Ø¿ô¤Ç¤¢¤ë. {\tt -OperandStack} ¤è¤ê object ¤ò pop ¤· CMO ·Á¼°¤Î serialized object ¤ò -byte Îó¤È¤·¤ÆÌ᤹. 2 ÈÖÌܤδؿô¤Ï Socket ¤ÇÄÌ¿®¤¹¤ë¤¿¤á¤ÎƱµ¡Ç½¤Î´Ø¿ô -¤Ç¤¢¤ê, {\tt ox\_stream out } ¤Ø, ¤½¤Î¥Ç¡¼¥¿¤ò header {\tt OX\_DATA} -¤ò¤Ä¤±¤Æ¤Ê¤¬¤¹. ¤³¤Î´Ø¿ô¤Ï¤ª¤â¤Ë, heterotic ¤Êʬ»¶¥·¥¹¥Æ¥à¤ÇÍѤ¤¤ë. -¼¡¤Ë, ¥µ¡¼¥Ð¥¹¥¿¥Ã¥¯¥Þ¥·¥ó¤Î´Ø¿ô¤¬¼Â¹Ô¤µ¤ì¤ë¤Þ¤Ç¤Ï,Ìá¤ê object ¤ÎÆâÍÆ -¤ÏÊݾڤµ¤ì¤Ê¤¤¤È¤¤¤±¤Ê¤¤. +It requests a server to pop an object from the stack, to convert +it into a serialized form according to the standard CMO encoding scheme, +and to send it to the stream with the {\tt OX\_DATA} header. */ Request: @@ -779,21 +772,11 @@ Request: \hline \end{tabular} -Result: +Output: \begin{tabular}{|c|c|} \hline {\tt int32 OX\_DATA} & {\it Serialized CMO} \\ \hline \end{tabular} - -//&jp °Ê²¼¤Ç, {\tt ox\_stream} ¤Ï¥µ¥ó¥×¥ë¥µ¡¼¥Ð¤Î¾ì¹ç, -//&eg °Ê²¼¤Ç, {\tt ox\_stream} ¤Ï¥µ¥ó¥×¥ë¥µ¡¼¥Ð¤Î¾ì¹ç, -\begin{verbatim} -typedef FILE2 * ox_stream; -\end{verbatim} -//&jp ¤Ç¤¢¤ë (cf. {\tt file2.h}). ¤³¤ì¤Ï½èÍý·Ï¤Ë¤è¤ê¤Á¤¬¤Ã¤Æ¤è¤¤. -//&jp {\tt ox\_asir} ¤Ç¤Ï, {\tt FILE *} ¤òÍѤ¤¤Æ¤¤¤ë. -//&eg ¤Ç¤¢¤ë (cf. {\tt file2.h}). ¤³¤ì¤Ï½èÍý·Ï¤Ë¤è¤ê¤Á¤¬¤Ã¤Æ¤è¤¤. -//&eg {\tt ox\_asir} ¤Ç¤Ï, {\tt FILE *} ¤òÍѤ¤¤Æ¤¤¤ë. \end{enumerate}