aa580a1b88a6f7f08b069f7453f629eeede53b69 kent Wed Jan 15 18:00:32 2014 -0800 Making pmHubMultilineQuery return a slName list instead of a slRef list with string values. This saves about 8 freez() calls and is a bit tidier overall. diff --git src/parasol/inc/paraMessage.h src/parasol/inc/paraMessage.h index 447188e..7e5fa06 100644 --- src/parasol/inc/paraMessage.h +++ src/parasol/inc/paraMessage.h @@ -1,113 +1,113 @@ /* paraMessage - routines to pack and unpack messages in * the parasol system, and also to send them via sockets. */ #ifndef PARAMESSAGE_H #define PARAMESSAGE_H #ifndef RUDP_H #include "rudp.h" #endif struct paraMessage /* A parasol message. */ { struct paraMessage *next; /* Next in list. */ struct sockaddr_in ipAddress; /* IP address of machine message is from/to */ int size; /* Size of data. */ char data[rudpMaxSize+1]; /* Data. Extra byte for zero tag at end. */ }; struct paraMultiMessage /* A parasol multi-packet response message. */ { struct paraMessage *pm; struct sockaddr_in ipAddress; /* IP address of machine message is from/to */ bits32 id; /* Message id. Returned with ack. */ }; void pmInit(struct paraMessage *pm, rudpHost ipAddress, bits16 port); /* Initialize message (that might be on stack). ipAddress is in host * order. */ void pmInitFromName(struct paraMessage *pm, char *hostName, bits16 port); /* Initialize message with ascii ip address. */ struct paraMessage *pmNew(rudpHost ipAddress, bits16 port); /* Create new message in memory. ipAddress is in host order. */ struct paraMessage *pmNewFromName(char *hostName, bits16 port); /* Create new message in memory */ void pmFree(struct paraMessage **pPm); /* Free up message. */ void pmClear(struct paraMessage *pm); /* Clear out data buffer. */ void pmSet(struct paraMessage *pm, char *message); /* Set message in data buffer. */ void pmPrintf(struct paraMessage *pm, char *format, ...) /* Print message into end of data buffer. Warn if it goes * past limit. */ #if defined(__GNUC__) __attribute__((format(printf, 2, 3))) #endif ; boolean pmSend(struct paraMessage *pm, struct rudp *ru); /* Send out message. Print warning message and return FALSE if * there is a problem. */ boolean pmSendString(struct paraMessage *pm, struct rudp *ru, char *string); /* Send out given message strng. Print warning message and return FALSE if * there is a problem. */ boolean pmReceive(struct paraMessage *pm, struct rudp *ru); /* Receive message. Print warning message and return FALSE if * there is a problem. */ boolean pmReceiveTimeOut(struct paraMessage *pm, struct rudp *ru, int timeOut); /* Wait up to timeOut microseconds for message. To wait forever * set timeOut to zero. */ void pmmInit(struct paraMultiMessage *pmm, struct paraMessage *pm, struct in_addr sin_addr); /* Initialize structure for multi-message response */ boolean pmmReceiveTimeOut(struct paraMultiMessage *pmm, struct rudp *ru, int timeOut); /* Multi-message receive * Wait up to timeOut microseconds for message. To wait forever * set timeOut to zero. For multi-message response * We know the ip, and can track the port for continuity * and the packet id for sequential series. */ boolean pmmReceive(struct paraMultiMessage *pmm, struct rudp *ru); /* Receive multi message. Print warning message and return FALSE if * there is a problem. */ void pmFetchOpenFile(struct paraMessage *pm, struct rudp *ru, char *fileName); /* Read everything you can from socket and output to file. */ void pmFetchFile(char *host, char *sourceName, char *destName); /* Fetch small file. */ boolean pmSendStringWithRetries(struct paraMessage *pm, struct rudp *ru, char *string); /* Send out given message strng. Print warning message and return FALSE if * there is a problem. Try up to 5 times sleeping for 60 seconds in between. * This is an attempt to help automated processes. */ char *pmHubSendSimple(char *message, char *host); /* Send message to host, no response. */ char *pmHubSingleLineQuery(char *query, char *host); /* Send message to hub and get single line response. * This should be freeMem'd when done. */ -struct slRef *pmHubMultilineQuery(char *query, char *host); +struct slName *pmHubMultilineQuery(char *query, char *host); /* Send a command with a multiline response to hub, * and return response as a list of strings. */ #endif /* PARAMESSAGE_H */