Added support for the TEXT command to the C client.

This commit is contained in:
Jason Watkins
2015-04-07 14:48:19 -07:00
parent 453ea65619
commit 46913596c5
3 changed files with 42 additions and 4 deletions

View File

@@ -419,6 +419,20 @@ short sendpCTRL(struct xpcSocket recfd, short numArgs, float valueArray[], char
return 0;
}
short sendTEXT(struct xpcSocket sendfd, char* msg, int x, int y)
{
char buf[269] = { 0 };
size_t msgLen = strnlen(msg, 255);
size_t len = 14 + msgLen;
strcpy(buf, "TEXT");
memcpy(buf + 5, &x, sizeof(int));
memcpy(buf + 9, &y, sizeof(int));
buf[13] = msgLen;
strncpy(buf + 14, msg, msgLen);
sendUDP(sendfd, buf, len);
}
//READ
//----------------------------------------
short readUDP(struct xpcSocket recfd, char *dataRef, struct sockaddr *recvaddr)

View File

@@ -81,7 +81,11 @@
short requestDREF(struct xpcSocket sendfd, struct xpcSocket recfd, char DREFArray[][100], short DREFSizes[], short listLength, float *resultArray[], short arraySizes[]);
int parseGETD(const char my_message[], char *DREFArray[], int DREFSizes[]);
short parseRequest(const char my_message[], float *resultArray[], short arraySizes[]);
short readRequest(struct xpcSocket recfd, float *dataRef[], short arraySizes[], struct sockaddr *recvaddr);
short readRequest(struct xpcSocket recfd, float *dataRef[], short arraySizes[], struct sockaddr *recvaddr);
// Screen Text
short sendTEXT(struct xpcSocket sendfd, int x, int y, char* msg);
#endif //ifdef _h