aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/LuaSL/src/LuaSL_test.c
diff options
context:
space:
mode:
Diffstat (limited to 'LuaSL/src/LuaSL_test.c')
-rw-r--r--LuaSL/src/LuaSL_test.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/LuaSL/src/LuaSL_test.c b/LuaSL/src/LuaSL_test.c
index ec7824a..19f6bcd 100644
--- a/LuaSL/src/LuaSL_test.c
+++ b/LuaSL/src/LuaSL_test.c
@@ -2,18 +2,6 @@
2#include "LuaSL.h" 2#include "LuaSL.h"
3 3
4 4
5typedef struct
6{
7 char SID[PATH_MAX];
8 char fileName[PATH_MAX];
9 struct timeval startTime;
10 float compileTime;
11 int bugs, warnings;
12 boolean running;
13
14} script;
15
16
17static Eina_Strbuf *clientStream; 5static Eina_Strbuf *clientStream;
18static int scriptCount = 0; 6static int scriptCount = 0;
19static int compiledCount = 0; 7static int compiledCount = 0;
@@ -99,10 +87,10 @@ static void dirList_compile(const char *name, const char *path, void *data)
99 87
100 scriptCount++; 88 scriptCount++;
101 gettimeofday(&me->startTime, NULL); 89 gettimeofday(&me->startTime, NULL);
102 snprintf(me->SID, sizeof(me->SID), "%s/%s", path, name); 90 snprintf(me->SID, sizeof(me->SID), "%08lx-%04lx-%04lx-%04lx-%012lx", random(), random() % 0xFFFF, random() % 0xFFFF, random() % 0xFFFF, random());
103 snprintf(me->fileName, sizeof(me->fileName), "%s/%s", path, name); 91 snprintf(me->fileName, sizeof(me->fileName), "%s/%s", path, name);
104 eina_hash_add(game->scripts, me->SID, me); 92 eina_hash_add(game->scripts, me->SID, me);
105 sendForth(game, me->SID, "compile()"); 93 sendForth(game, me->SID, "compile(%s)", me->fileName);
106 } 94 }
107 } 95 }
108} 96}
@@ -158,7 +146,7 @@ static Eina_Bool _data(void *data, int type __UNUSED__, Ecore_Con_Event_Server_D
158 strncpy(SID, command, length + 1); 146 strncpy(SID, command, length + 1);
159 SID[length] = '\0'; 147 SID[length] = '\0';
160 eina_strbuf_remove(clientStream, 0, length + 1); 148 eina_strbuf_remove(clientStream, 0, length + 1);
161 ext = rindex(SID, '.'); 149 ext = index(SID, '.');
162 if (ext) 150 if (ext)
163 { 151 {
164 script *me; 152 script *me;