diff options
author | Benoit Germain <bnt.germain@gmail.com> | 2011-02-18 20:33:43 +0100 |
---|---|---|
committer | Benoit Germain <bnt.germain@gmail.com> | 2011-02-18 20:33:43 +0100 |
commit | 1760eafa1d2ebce8f07e11414a53d4a251af5b8e (patch) | |
tree | 18f2fcd400bb35528212930c4e61be04be31bea0 /docs | |
parent | ab233d0c9a1edc34836e2249c1eb6d714f1066b5 (diff) | |
download | lanes-1760eafa1d2ebce8f07e11414a53d4a251af5b8e.tar.gz lanes-1760eafa1d2ebce8f07e11414a53d4a251af5b8e.tar.bz2 lanes-1760eafa1d2ebce8f07e11414a53d4a251af5b8e.zip |
* keeper.lua is now embedded in text form instead of bytecode to improve LuaJIT2-compatibility (but this is not enough).
* moved keeper-related code in a separate source file
Diffstat (limited to 'docs')
-rw-r--r-- | docs/index.html | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/docs/index.html b/docs/index.html index 03c91f7..a28dd41 100644 --- a/docs/index.html +++ b/docs/index.html | |||
@@ -799,8 +799,31 @@ can be used for custom userdata as well. Here's what to do. | |||
799 | </p> | 799 | </p> |
800 | <ol> | 800 | <ol> |
801 | <li>Provide an <i>identity function</i> for your userdata, in C. This function is | 801 | <li>Provide an <i>identity function</i> for your userdata, in C. This function is |
802 | used for creation and deletion of your deep userdata (the shared resource), | 802 | used for creation and deletion of your deep userdata (the shared resource), |
803 | and for making metatables for the state-specific proxies for accessing it. | 803 | and for making metatables for the state-specific proxies for accessing it. The |
804 | prototype is | ||
805 | <table border="1" bgcolor="#E0E0FF" cellpadding="10"> | ||
806 | <tr> | ||
807 | <td> | ||
808 | <code>void idfunc( lua_State *L, char const * const which);</code> | ||
809 | </table> | ||
810 | <tt>which</tt> can be one of: | ||
811 | <ul> | ||
812 | <li> | ||
813 | <tt>"new"</tt>: requests the creation of a new object, whose pointer is pushed on the stack | ||
814 | as a light userdata. | ||
815 | </li> | ||
816 | <li> | ||
817 | <tt>"delete"</tt>: receives this same pointer on the stack, and should cleanup the object.</li> | ||
818 | <li> | ||
819 | <tt>"metatable"</tt>: should build a metatable for the object. Don't cache the metatable | ||
820 | yourself, Lanes takes care of it ("metatable" should only be invoked once).</li> | ||
821 | <li> | ||
822 | <tt>"module"</tt>: is the name of the module that exports the idfunc, | ||
823 | to be pushed on the stack as a string. It is necessary so that Lanes can require it in | ||
824 | any Lane and keeper state that receives a userdata. This is to prevent crashes in situations | ||
825 | where the module could be unloaded while the idfunc pointer is still held.</li> | ||
826 | </ul> | ||
804 | Take a look at <tt>linda_id</tt> in <tt>lanes.c</tt>. | 827 | Take a look at <tt>linda_id</tt> in <tt>lanes.c</tt>. |
805 | </li> | 828 | </li> |
806 | <li>Instanciate your userdata using <tt>luaG_deep_userdata()</tt>, | 829 | <li>Instanciate your userdata using <tt>luaG_deep_userdata()</tt>, |