aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/deep.h17
-rw-r--r--src/tools.h6
2 files changed, 18 insertions, 5 deletions
diff --git a/src/deep.h b/src/deep.h
new file mode 100644
index 0000000..39f501c
--- /dev/null
+++ b/src/deep.h
@@ -0,0 +1,17 @@
1#ifndef __LANES_DEEP_H__
2#define __LANES_DEEP_H__ 1
3
4/*
5 * public 'deep' API to be used by external modules if they want to implement Lanes-aware userdata
6 * said modules will have to link against lanes (it is not really possible to separate the 'deep userdata' implementation from the rest of Lanes)
7 */
8
9
10#include "lua.h"
11
12typedef void (*luaG_IdFunction)( lua_State *L, char const * const which);
13
14int luaG_deep_userdata( lua_State *L, luaG_IdFunction idfunc);
15void *luaG_todeep( lua_State *L, luaG_IdFunction idfunc, int index);
16
17#endif // __LANES_DEEP_H__ \ No newline at end of file
diff --git a/src/tools.h b/src/tools.h
index 43582c5..4a77a6a 100644
--- a/src/tools.h
+++ b/src/tools.h
@@ -6,6 +6,7 @@
6 6
7#include "lauxlib.h" 7#include "lauxlib.h"
8#include "threading.h" 8#include "threading.h"
9#include "deep.h"
9 // MUTEX_T 10 // MUTEX_T
10 11
11#include <assert.h> 12#include <assert.h>
@@ -63,15 +64,10 @@
63 64
64#define luaG_isany(L,i) (!lua_isnil(L,i)) 65#define luaG_isany(L,i) (!lua_isnil(L,i))
65 66
66typedef void (*luaG_IdFunction)( lua_State *L, char const * const which);
67
68void luaG_dump( lua_State* L ); 67void luaG_dump( lua_State* L );
69 68
70lua_State* luaG_newstate( char const* libs, lua_CFunction _on_state_create); 69lua_State* luaG_newstate( char const* libs, lua_CFunction _on_state_create);
71 70
72int luaG_deep_userdata( lua_State *L, luaG_IdFunction idfunc);
73void *luaG_todeep( lua_State *L, luaG_IdFunction idfunc, int index );
74
75typedef struct { 71typedef struct {
76 volatile int refcount; 72 volatile int refcount;
77 void *deep; 73 void *deep;