diff options
| author | Benoit Germain <bnt.germain@gmail.com> | 2012-11-18 16:22:49 +0100 |
|---|---|---|
| committer | Benoit Germain <bnt.germain@gmail.com> | 2012-11-18 16:22:49 +0100 |
| commit | 2ff1905501d19199ddbb7d035f36ca7a41705a6a (patch) | |
| tree | d52f9eeebf6317a66cdf529273c6a0860366b9c6 /src | |
| parent | 518d7ba7bf9ff18fb60e9f304465164c9b068a99 (diff) | |
| download | lanes-2ff1905501d19199ddbb7d035f36ca7a41705a6a.tar.gz lanes-2ff1905501d19199ddbb7d035f36ca7a41705a6a.tar.bz2 lanes-2ff1905501d19199ddbb7d035f36ca7a41705a6a.zip | |
Separated public "deep" API declarations in a dedicated header.
Diffstat (limited to 'src')
| -rw-r--r-- | src/deep.h | 17 | ||||
| -rw-r--r-- | src/tools.h | 6 |
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 | |||
| 12 | typedef void (*luaG_IdFunction)( lua_State *L, char const * const which); | ||
| 13 | |||
| 14 | int luaG_deep_userdata( lua_State *L, luaG_IdFunction idfunc); | ||
| 15 | void *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 | ||
| 66 | typedef void (*luaG_IdFunction)( lua_State *L, char const * const which); | ||
| 67 | |||
| 68 | void luaG_dump( lua_State* L ); | 67 | void luaG_dump( lua_State* L ); |
| 69 | 68 | ||
| 70 | lua_State* luaG_newstate( char const* libs, lua_CFunction _on_state_create); | 69 | lua_State* luaG_newstate( char const* libs, lua_CFunction _on_state_create); |
| 71 | 70 | ||
| 72 | int luaG_deep_userdata( lua_State *L, luaG_IdFunction idfunc); | ||
| 73 | void *luaG_todeep( lua_State *L, luaG_IdFunction idfunc, int index ); | ||
| 74 | |||
| 75 | typedef struct { | 71 | typedef struct { |
| 76 | volatile int refcount; | 72 | volatile int refcount; |
| 77 | void *deep; | 73 | void *deep; |
