diff options
author | David Walter Seikel | 2014-05-13 13:15:42 +1000 |
---|---|---|
committer | David Walter Seikel | 2014-05-13 13:15:42 +1000 |
commit | afd126e1d207c8fe7933562227f16684b00bfc7c (patch) | |
tree | 0f34168d20e485738fcfd1b5d67cf5e0d1bb8113 /src/libraries | |
parent | Dedicating my lifes work to my girl Boots. (diff) | |
download | SledjHamr-afd126e1d207c8fe7933562227f16684b00bfc7c.zip SledjHamr-afd126e1d207c8fe7933562227f16684b00bfc7c.tar.gz SledjHamr-afd126e1d207c8fe7933562227f16684b00bfc7c.tar.bz2 SledjHamr-afd126e1d207c8fe7933562227f16684b00bfc7c.tar.xz |
Finish separating out love.
Diffstat (limited to '')
-rw-r--r-- | src/libraries/Runnr.c | 34 | ||||
-rw-r--r-- | src/libraries/Runnr.h | 4 |
2 files changed, 38 insertions, 0 deletions
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] | |||
333 | free(f); | 333 | free(f); |
334 | return n; | 334 | return n; |
335 | } | 335 | } |
336 | |||
337 | void sendBack(Ecore_Con_Client *client, const char *SID, const char *message, ...) | ||
338 | { | ||
339 | va_list args; | ||
340 | char buf[PATH_MAX]; | ||
341 | int length = strlen(SID); | ||
342 | |||
343 | strncpy(buf, SID, length); | ||
344 | buf[length++] = '.'; | ||
345 | va_start(args, message); | ||
346 | length += vsprintf(&buf[length], message, args); | ||
347 | va_end(args); | ||
348 | buf[length++] = '\n'; | ||
349 | buf[length++] = '\0'; | ||
350 | ecore_con_client_send(client, buf, strlen(buf)); | ||
351 | ecore_con_client_flush(client); | ||
352 | } | ||
353 | |||
354 | void sendForth(Ecore_Con_Server *server, const char *SID, const char *message, ...) | ||
355 | { | ||
356 | va_list args; | ||
357 | char buf[PATH_MAX]; | ||
358 | int length = strlen(SID); | ||
359 | |||
360 | strncpy(buf, SID, length); | ||
361 | buf[length++] = '.'; | ||
362 | va_start(args, message); | ||
363 | length += vsprintf(&buf[length], message, args); | ||
364 | va_end(args); | ||
365 | buf[length++] = '\n'; | ||
366 | buf[length++] = '\0'; | ||
367 | ecore_con_server_send(server, buf, strlen(buf)); | ||
368 | ecore_con_server_flush(server); | ||
369 | } | ||
diff --git a/src/libraries/Runnr.h b/src/libraries/Runnr.h index ac22039..d7386f6 100644 --- a/src/libraries/Runnr.h +++ b/src/libraries/Runnr.h | |||
@@ -4,6 +4,7 @@ | |||
4 | #include <ctype.h> | 4 | #include <ctype.h> |
5 | 5 | ||
6 | #include <Eina.h> | 6 | #include <Eina.h> |
7 | #include <Ecore_Con.h> | ||
7 | 8 | ||
8 | #include <lua.h> | 9 | #include <lua.h> |
9 | #include <luajit.h> | 10 | #include <luajit.h> |
@@ -15,4 +16,7 @@ void dumpStack(lua_State *L, int i); | |||
15 | int pull_lua(lua_State *L, int i, char *params, ...); | 16 | int pull_lua(lua_State *L, int i, char *params, ...); |
16 | int push_lua(lua_State *L, char *params, ...); | 17 | int push_lua(lua_State *L, char *params, ...); |
17 | 18 | ||
19 | void sendBack(Ecore_Con_Client *client, const char *SID, const char *message, ...); | ||
20 | void sendForth(Ecore_Con_Server *server, const char *SID, const char *message, ...); | ||
21 | |||
18 | #endif | 22 | #endif |