diff options
author | David Walter Seikel | 2012-01-23 23:36:30 +1000 |
---|---|---|
committer | David Walter Seikel | 2012-01-23 23:36:30 +1000 |
commit | 6523585c66c04cea54df50013df8886b589847d8 (patch) | |
tree | 0b22aee7064166d88595eda260ca2d17c0773da5 /libraries/luaproc/luaproc.h | |
parent | Update the EFL to what I'm actually using, coz I'm using some stuff not yet r... (diff) | |
download | SledjHamr-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.h | 92 |
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 | |||
3 | Copyright 2008 Alexandre Skyrme, Noemi Rodriguez, Roberto Ierusalimschy | ||
4 | |||
5 | Permission is hereby granted, free of charge, to any person obtaining a copy | ||
6 | of this software and associated documentation files (the "Software"), to deal | ||
7 | in the Software without restriction, including without limitation the rights | ||
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
9 | copies of the Software, and to permit persons to whom the Software is | ||
10 | furnished to do so, subject to the following conditions: | ||
11 | |||
12 | The above copyright notice and this permission notice shall be included in | ||
13 | all copies or substantial portions of the Software. | ||
14 | |||
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
21 | THE 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 */ | ||
45 | typedef struct stluaproc *luaproc; | ||
46 | |||
47 | /* return a process' status */ | ||
48 | int luaproc_get_status( luaproc lp ); | ||
49 | |||
50 | /* set a process' status */ | ||
51 | void luaproc_set_status( luaproc lp, int status ); | ||
52 | |||
53 | /* return a process' state */ | ||
54 | lua_State *luaproc_get_state( luaproc lp ); | ||
55 | |||
56 | /* return the number of arguments expected by a given a process */ | ||
57 | int luaproc_get_args( luaproc lp ); | ||
58 | |||
59 | /* set the number of arguments expected by a given process */ | ||
60 | void luaproc_set_args( luaproc lp, int n ); | ||
61 | |||
62 | /* create luaproc (from scheduler) */ | ||
63 | luaproc luaproc_create_sched( char *code ); | ||
64 | |||
65 | /* register luaproc's functions in a lua_State */ | ||
66 | void luaproc_register_funcs( lua_State *L ); | ||
67 | |||
68 | /* allow registering of luaproc's functions in c main prog */ | ||
69 | void luaproc_register_lib( lua_State *L ); | ||
70 | |||
71 | /* queue a luaproc that tried to send a message */ | ||
72 | void luaproc_queue_sender( luaproc lp ); | ||
73 | |||
74 | /* queue a luaproc that tried to receive a message */ | ||
75 | void luaproc_queue_receiver( luaproc lp ); | ||
76 | |||
77 | /* unlock a channel's access */ | ||
78 | void luaproc_unlock_channel( channel chan ); | ||
79 | |||
80 | /* return a luaproc's channel */ | ||
81 | channel luaproc_get_channel( luaproc lp ); | ||
82 | |||
83 | /* return status (boolean) indicating if worker thread should be destroyed after luaproc execution */ | ||
84 | int luaproc_get_destroyworker( luaproc lp ); | ||
85 | |||
86 | /* return status (boolean) indicating if lua process should be recycled */ | ||
87 | luaproc luaproc_recycle_pop( void ); | ||
88 | |||
89 | /* add a lua process to the recycle list */ | ||
90 | int luaproc_recycle_push( luaproc lp ); | ||
91 | |||
92 | #endif | ||