next up previous contents
: Bibliography : Design and Implementation of : How to join in   Ìܼ¡

OX servers as a C library

In some OX servers, one can use the OX server as a C library. The API to the C library is similar to Asir OX client API such as ox_push_cmo(), ox_pop_cmo().

CMO should be converted into the binary encoded form to call these functions.

  int xxx_ox_init(int type)

This function initializes the library interface. type specifies the byte order to send int32 to the OX server xxx. If type is equal to 0, the native byte order will be used. If type is equal to 1, the network byte order will be used. In case of error, -1 will be returned.

  void xxx_ox_push_cmo(void *cmo)

Push the binary encoded CMO cmo onto the stack of the OX server xxx.

  int xxx_ox_pop_cmo(void cmo, int limit)

Pop a binary encoded CMO from the OX server xxx and write it at cmo. The return value is the size of the CMO in bytes. In case of the stack underflow, the return value is 0. If the size exceeds the limit, -1 will be returned and the CMO is not popped and will not be written to cmo.

  int xxx_ox_peek_cmo_size()

Return the size of the CMO at the top of the stack.

 void xxx_ox_push_cmd(int cmd)
This function sends a stack machine command (OX_COMMAND,int32 cmd) to a server.

 void xxx_ox_execute_string(char *s)
This function requests a server to execute a command expressed by a string s. s should be acceptable by the parser of the server.

Sample source codes to use the library mode interface can be found in OpenXM/doc/oxlib.


next up previous contents
: Bibliography : Design and Implementation of : How to join in   Ìܼ¡
Nobuki Takayama Heisei 17.2.10.