aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/libraries
diff options
context:
space:
mode:
authorDavid Walter Seikel2014-05-13 13:15:42 +1000
committerDavid Walter Seikel2014-05-13 13:15:42 +1000
commitafd126e1d207c8fe7933562227f16684b00bfc7c (patch)
tree0f34168d20e485738fcfd1b5d67cf5e0d1bb8113 /src/libraries
parentDedicating my lifes work to my girl Boots. (diff)
downloadSledjHamr-afd126e1d207c8fe7933562227f16684b00bfc7c.zip
SledjHamr-afd126e1d207c8fe7933562227f16684b00bfc7c.tar.gz
SledjHamr-afd126e1d207c8fe7933562227f16684b00bfc7c.tar.bz2
SledjHamr-afd126e1d207c8fe7933562227f16684b00bfc7c.tar.xz
Finish separating out love.
Diffstat (limited to 'src/libraries')
-rw-r--r--src/libraries/Runnr.c34
-rw-r--r--src/libraries/Runnr.h4
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
337void 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
354void 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);
15int pull_lua(lua_State *L, int i, char *params, ...); 16int pull_lua(lua_State *L, int i, char *params, ...);
16int push_lua(lua_State *L, char *params, ...); 17int push_lua(lua_State *L, char *params, ...);
17 18
19void sendBack(Ecore_Con_Client *client, const char *SID, const char *message, ...);
20void sendForth(Ecore_Con_Server *server, const char *SID, const char *message, ...);
21
18#endif 22#endif