#include <stdio.h>
#include <string.h>
#include <stddef.h>
#include <stdlib.h>
#include <unistd.h>
#include <ctype.h>
#include <pthread.h>
#include <sys/file.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/select.h>
#include <sys/time.h>
#include <netinet/in.h>
#include <sys/un.h>
#include <errno.h>
#include <signal.h>
#include <netdb.h>
#include <fcntl.h>
#include <sys/uio.h>
#include "VOClient.h"
Defines | |
#define | _VOCLIENT_LIB_ |
#define | SELWIDTH 32 |
#define | SZ_CHUNK 4096 |
#define | SZ_BULKDATA 1024000 |
Functions | |
vocMsg_t * | msg_newCallMsg (ObjectID objid, char *method, int nparams) |
Create a CALL message structure initialized w/ parameters. | |
vocMsg_t * | msg_newResultMsg (int status, int type, int nitems) |
Create a RESULT message structure initialized w/ parameters. | |
vocMsg_t * | msg_newMsg (char *msgclass, char *str) |
Create a MSG message initialized w/ parameters. | |
vocMsg_t * | msg_shutdownMsg () |
Create a END message to shutdown the server. | |
vocMsg_t * | msg_quitMsg () |
Create a QUIT message. | |
vocMsg_t * | msg_ackMsg () |
Create an ACK message. | |
vocMsg_t * | msg_noackMsg () |
Create a NOACK message. | |
vocRes_t * | msg_sendMsg (int fd, vocMsg_t *msg) |
Send the message to the VOClient server. | |
int | msg_sendRawMsg (int fd, vocMsg_t *msg) |
Send the message to the VOClient server. | |
vocRes_t * | msg_getResult (int fd) |
Read and parse a result message. | |
vocRes_t * | msg_getResultToFile (int fd, char *fname, int overwrite) |
Read and parse a result message, saving data to named file. | |
void | msg_addIntParam (vocMsg_t *msg, int ival) |
Add a int parameter to an outgoing CALL message. | |
void | msg_addFloatParam (vocMsg_t *msg, double dval) |
Add a float parameter to an outgoing CALL message. | |
void | msg_addStringParam (vocMsg_t *msg, char *str) |
Add a string parameter to an outgoing CALL message. | |
void | msg_addIntResult (vocMsg_t *msg, int ival) |
Add a integer value to a RESULT string. | |
void | msg_addFloatResult (vocMsg_t *msg, double dval) |
void | msg_addStringResult (vocMsg_t *msg, char *str) |
Add a string value to a RESULT string. | |
int | msg_resultStatus (vocRes_t *res) |
Get result status. | |
int | msg_resultType (vocRes_t *res) |
Get result type. | |
int | msg_resultLength (vocRes_t *res) |
Get result length. | |
int | msg_getIntResult (vocRes_t *res, int index) |
Get an integer result by index. | |
double | msg_getFloatResult (vocRes_t *res, int index) |
Get a float result by index. | |
char * | msg_getStringResult (vocRes_t *res, int index) |
Get a string result by index. | |
void * | msg_getBuffer (vocRes_t *res) |
Get result buffer. | |
Variables | |
VOClient * | vo |
msg = newCallMsg (objid, method, nparams) msg = newResultMsg (status, type, nitems) msg = newMsg (msgclass, str)
msgAddIntParam (msg, ival) msgAddFloatParam (msg, dval) msgAddStringParam (msg, str)
msgAddIntResult (msg, ival) msgAddFloatResult (msg, dval) msgAddStringResult (msg, str)
sendMsg (fd, msg) freeMsg (msg)
res = getResult (fd) # for reading RESULT msgs freeResult (res)
stat = resultStatus (res) type = resultType (res) nitems = resultLength (res)
ival = getIntResult (res, index) dval = getFloatResult (res, index) str = getStringResult (res, index)
msg msg_ackMsg | ( | void | ) |
Create an ACK message.
MSG_ACKMSG -- Create an ACK message to the VOClient Server.
msg_addFloatParam | ( | vocMsg_t * | msg, | |
double | dval | |||
) |
Add a float parameter to an outgoing CALL message.
MSG_ADDFLOATPARAM -- Add a float parameter to an outgoing CALL message. We simply append to an existing message.
msg | outgoing message | |
dval | double value |
msg_addIntParam | ( | vocMsg_t * | msg, | |
int | ival | |||
) |
Add a int parameter to an outgoing CALL message.
MSG_ADDINTPARAM -- Add a int parameter to an outgoing CALL message. We simply append to an existing message.
msg | outgoing message | |
ival | integer value |
msg_addIntResult | ( | vocMsg_t * | msg, | |
int | ival | |||
) |
Add a integer value to a RESULT string.
MSG_ADDINTRESULT -- Add an integer value to a RESULT string.
msg | result string | |
ival | integer value |
msg_addStringParam | ( | vocMsg_t * | msg, | |
char * | str | |||
) |
Add a string parameter to an outgoing CALL message.
MSG_ADDSTRINGPARAM -- Add a string parameter to an outgoing CALL message. We simply append to an existing message.
msg | outgoing message | |
str | string value |
msg_addStringResult | ( | vocMsg_t * | msg, | |
char * | str | |||
) |
Add a string value to a RESULT string.
MSG_ADDSTRINGRESULT -- Add a string value to a RESULT string.
msg | result string | |
str | string value |
len msg_getBuffer | ( | vocRes_t * | res | ) |
Get result buffer.
MSG_GETBUFFER -- Get result buffer.
res | result message |
dval msg_getFloatResult | ( | vocRes_t * | res, | |
int | index | |||
) |
Get a float result by index.
MSG_GETFLOATRESULT -- Get a float result by index.
res | result message | |
index | result index |
ival msg_getIntResult | ( | vocRes_t * | res, | |
int | index | |||
) |
Get an integer result by index.
MSG_GETINTRESULT -- Get an integer result by index.
res | result message | |
index | result index |
res msg_getResult | ( | int | fd | ) |
Read and parse a result message.
MSG_GETRESULT -- Read and parse a result message.
fd | message channel descriptor |
res msg_getResultToFile | ( | int | fd, | |
char * | fname, | |||
int | overwrite | |||
) |
Read and parse a result message, saving data to named file.
MSG_GETRESULTTOFILE -- Read and parse a result message, save bulk data to the named file.
fd | message channel descriptor |
str msg_getStringResult | ( | vocRes_t * | res, | |
int | index | |||
) |
Get a string result by index.
MSG_GETSTRINGRESULT -- Get a string result by index.
res | result message | |
index | result index |
msg msg_newCallMsg | ( | ObjectID | objid, | |
char * | method, | |||
int | nparams | |||
) |
Create a CALL message structure initialized w/ parameters.
MSG_NEWCALLMSG -- Create a CALL message structure and initialize with the requested parameters. Structures are allocated dynamically, the caller is responsible for freeing the struct when finished.
objid | object id | |
method | name of method to call | |
nparams | number of parameters in message |
msg msg_newMsg | ( | char * | msgclass, | |
char * | str | |||
) |
Create a MSG message initialized w/ parameters.
MSG_NEWMSG -- Create a new MSG message context and initialize with the requested parameters. The caller is responsible for freeing the struct when complete.
msgclass | message class | |
str | message string |
msg msg_newResultMsg | ( | int | status, | |
int | type, | |||
int | nitems | |||
) |
Create a RESULT message structure initialized w/ parameters.
MSG_NEWRESULTMSG -- Create a new RESULT message context and initialize with the requested parameters. The caller is responsible for freeing the struct when complete.
status | result status | |
type | result type | |
nitems | number of items in message |
msg msg_noackMsg | ( | void | ) |
Create a NOACK message.
MSG_NOACKMSG -- Create an NO-ACK message to the VOClient Server.
msg msg_quitMsg | ( | void | ) |
Create a QUIT message.
MSG_QUITMSG -- Create a QUIT message to the VOClient Server to tell it we're leaving but that it should keep running
len msg_resultLength | ( | vocRes_t * | res | ) |
Get result length.
MSG_RESULTLENGTH -- Get result length.
msg | result string |
status msg_resultStatus | ( | vocRes_t * | res | ) |
Get result status.
MSG_RESULTSTATUS -- Get result status.
msg | result string |
type msg_resultType | ( | vocRes_t * | res | ) |
Get result type.
MSG_RESULTTYPE -- Get result type.
msg | result string |
msg msg_sendMsg | ( | int | fd, | |
vocMsg_t * | msg | |||
) |
Send the message to the VOClient server.
MSG_SENDMSG -- Send the message to the VOClient Server and wait for the ACK. The simple form of the message returns the result handle, for the raw message we only send to allow to a bullk return object.
fd | message channel descriptor | |
str | message string |
len msg_sendRawMsg | ( | int | fd, | |
vocMsg_t * | msg | |||
) |
Send the message to the VOClient server.
MSG_SENDRAWMSG -- Send the message to the VOClient Server.
fd | message channel descriptor | |
str | message string |
msg msg_shutdownMsg | ( | void | ) |
Create a END message to shutdown the server.
MSG_SHUTDOWNMSG -- Create an END message to the VOClient Server to shut it down.