From afd126e1d207c8fe7933562227f16684b00bfc7c Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Tue, 13 May 2014 13:15:42 +1000 Subject: Finish separating out love. --- src/libraries/Runnr.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'src/libraries/Runnr.c') diff --git a/src/libraries/Runnr.c b/src/libraries/Runnr.c index f316755..8109dd8 100644 --- a/src/libraries/Runnr.c +++ b/src/libraries/Runnr.c @@ -333,3 +333,37 @@ int push_lua(lua_State *L, char *params, ...) // Stack usage [-0, +n, em] free(f); return n; } + +void sendBack(Ecore_Con_Client *client, const char *SID, const char *message, ...) +{ + va_list args; + char buf[PATH_MAX]; + int length = strlen(SID); + + strncpy(buf, SID, length); + buf[length++] = '.'; + va_start(args, message); + length += vsprintf(&buf[length], message, args); + va_end(args); + buf[length++] = '\n'; + buf[length++] = '\0'; + ecore_con_client_send(client, buf, strlen(buf)); + ecore_con_client_flush(client); +} + +void sendForth(Ecore_Con_Server *server, const char *SID, const char *message, ...) +{ + va_list args; + char buf[PATH_MAX]; + int length = strlen(SID); + + strncpy(buf, SID, length); + buf[length++] = '.'; + va_start(args, message); + length += vsprintf(&buf[length], message, args); + va_end(args); + buf[length++] = '\n'; + buf[length++] = '\0'; + ecore_con_server_send(server, buf, strlen(buf)); + ecore_con_server_flush(server); +} -- cgit v1.1