aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/LuaSL/LuaSL.h
blob: d43d6cd0960e71a3a7d5ca32bcac68548e92f6c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#ifdef HAVE_CONFIG_H
#include "config.h"
#else
//#define PACKAGE_EXAMPLES_DIR "."
#define __UNUSED__
#endif

#include <Eet.h>
#include <Ecore.h>
#include <Ecore_Con.h>
#include <Ecore_File.h>
#include <stdio.h>
#include <ctype.h>

#include <lua.h>
#include <luajit.h>
#include <lualib.h>
#include <lauxlib.h>

typedef struct _script script;			// Define this here, so LuaSL_threads.h can use it.
typedef struct _gameGlobals gameGlobals;	// Define this here, so LuaSL_threads.h can use it.

#include "LuaSL_threads.h"
#include "LumbrJack.h"


struct _gameGlobals
{
    Ecore_Con_Server	*server;
    Eina_Hash		*scripts, *names;
    const char		*address;
    int			port;
};

struct _script
{
    Eina_Clist		node;
    gameGlobals		*game;
    char		SID[PATH_MAX];
    char		fileName[PATH_MAX];
    char		*name;
    lua_State		*L;
    struct timeval	startTime;
    float		timerTime;
    int			status;
    int			args;
    Eina_Clist		messages;
    Ecore_Con_Client	*client;
    Ecore_Timer		*timer;
};

typedef struct
{
  Eina_Clist	node;
  script	*script;
  const char	message[PATH_MAX];
} scriptMessage;


void scriptSendBack(void * data);

#include "LuaSL_LSL_tree.h"