In some OX servers, one can use the OX server as a C library. The interface functions of the C library are similar to Asir OX client functions 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.
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)These function requests a server to execute a string s. s should be acceptable by the parser of the server.