aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/luaproc/luaproc.h
diff options
context:
space:
mode:
authorDavid Walter Seikel2012-01-23 23:36:30 +1000
committerDavid Walter Seikel2012-01-23 23:36:30 +1000
commit6523585c66c04cea54df50013df8886b589847d8 (patch)
tree0b22aee7064166d88595eda260ca2d17c0773da5 /libraries/luaproc/luaproc.h
parentUpdate the EFL to what I'm actually using, coz I'm using some stuff not yet r... (diff)
downloadSledjHamr-6523585c66c04cea54df50013df8886b589847d8.zip
SledjHamr-6523585c66c04cea54df50013df8886b589847d8.tar.gz
SledjHamr-6523585c66c04cea54df50013df8886b589847d8.tar.bz2
SledjHamr-6523585c66c04cea54df50013df8886b589847d8.tar.xz
Add luaproc and LuaJIT libraries.
Two versions of LuaJIT, the stable release, and the dev version. Try the dev version first, until ih fails badly.
Diffstat (limited to '')
-rw-r--r--libraries/luaproc/luaproc.h92
1 files changed, 92 insertions, 0 deletions
diff --git a/libraries/luaproc/luaproc.h b/libraries/luaproc/luaproc.h
new file mode 100644
index 0000000..86617a9
--- /dev/null
+++ b/libraries/luaproc/luaproc.h
@@ -0,0 +1,92 @@
1/***************************************************
2
3Copyright 2008 Alexandre Skyrme, Noemi Rodriguez, Roberto Ierusalimschy
4
5Permission is hereby granted, free of charge, to any person obtaining a copy
6of this software and associated documentation files (the "Software"), to deal
7in the Software without restriction, including without limitation the rights
8to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9copies of the Software, and to permit persons to whom the Software is
10furnished to do so, subject to the following conditions:
11
12The above copyright notice and this permission notice shall be included in
13all copies or substantial portions of the Software.
14
15THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21THE SOFTWARE.
22
23*****************************************************
24
25[luaproc.h]
26
27****************************************************/
28#ifndef _LUAPROC_H_
29#define _LUAPROC_H_
30
31#include "channel.h"
32
33/* process is idle */
34#define LUAPROC_STAT_IDLE 0
35/* process is ready to run */
36#define LUAPROC_STAT_READY 1
37/* process is blocked on send */
38#define LUAPROC_STAT_BLOCKED_SEND 2
39/* process is blocked on receive */
40#define LUAPROC_STAT_BLOCKED_RECV 3
41/* process is finished */
42#define LUAPROC_STAT_FINISHED 4
43
44/* lua process pointer type */
45typedef struct stluaproc *luaproc;
46
47/* return a process' status */
48int luaproc_get_status( luaproc lp );
49
50/* set a process' status */
51void luaproc_set_status( luaproc lp, int status );
52
53/* return a process' state */
54lua_State *luaproc_get_state( luaproc lp );
55
56/* return the number of arguments expected by a given a process */
57int luaproc_get_args( luaproc lp );
58
59/* set the number of arguments expected by a given process */
60void luaproc_set_args( luaproc lp, int n );
61
62/* create luaproc (from scheduler) */
63luaproc luaproc_create_sched( char *code );
64
65/* register luaproc's functions in a lua_State */
66void luaproc_register_funcs( lua_State *L );
67
68/* allow registering of luaproc's functions in c main prog */
69void luaproc_register_lib( lua_State *L );
70
71/* queue a luaproc that tried to send a message */
72void luaproc_queue_sender( luaproc lp );
73
74/* queue a luaproc that tried to receive a message */
75void luaproc_queue_receiver( luaproc lp );
76
77/* unlock a channel's access */
78void luaproc_unlock_channel( channel chan );
79
80/* return a luaproc's channel */
81channel luaproc_get_channel( luaproc lp );
82
83/* return status (boolean) indicating if worker thread should be destroyed after luaproc execution */
84int luaproc_get_destroyworker( luaproc lp );
85
86/* return status (boolean) indicating if lua process should be recycled */
87luaproc luaproc_recycle_pop( void );
88
89/* add a lua process to the recycle list */
90int luaproc_recycle_push( luaproc lp );
91
92#endif