aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/luaproc/luaproc.h
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/luaproc/luaproc.h')
-rw-r--r--libraries/luaproc/luaproc.h100
1 files changed, 0 insertions, 100 deletions
diff --git a/libraries/luaproc/luaproc.h b/libraries/luaproc/luaproc.h
deleted file mode 100644
index 1286107..0000000
--- a/libraries/luaproc/luaproc.h
+++ /dev/null
@@ -1,100 +0,0 @@
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#include <Ecore.h>
33
34/* process is idle */
35#define LUAPROC_STAT_IDLE 0
36/* process is ready to run */
37#define LUAPROC_STAT_READY 1
38/* process is blocked on send */
39#define LUAPROC_STAT_BLOCKED_SEND 2
40/* process is blocked on receive */
41#define LUAPROC_STAT_BLOCKED_RECV 3
42/* process is finished */
43#define LUAPROC_STAT_FINISHED 4
44
45/* lua process pointer type */
46typedef struct stluaproc *luaproc;
47
48void luaprocInit(void);
49void luaprocRegister(lua_State *L);
50int newProc(const char *code, int file, Ecore_Cb callback, void *data);
51
52
53/* return a process' status */
54int luaproc_get_status( luaproc lp );
55
56/* set a process' status */
57void luaproc_set_status( luaproc lp, int status );
58
59/* return a process' state */
60lua_State *luaproc_get_state( luaproc lp );
61
62/* return the number of arguments expected by a given a process */
63int luaproc_get_args( luaproc lp );
64
65/* set the number of arguments expected by a given process */
66void luaproc_set_args( luaproc lp, int n );
67
68/* create luaproc (from scheduler) */
69luaproc luaproc_create_sched( char *code );
70
71/* register luaproc's functions in a lua_State */
72void luaproc_register_funcs( lua_State *L );
73
74/* allow registering of luaproc's functions in c main prog */
75void luaproc_register_lib( lua_State *L );
76
77/* queue a luaproc that tried to send a message */
78void luaproc_queue_sender( luaproc lp );
79
80const char *sendToChannel(const char *chname, const char *message, luaproc *dst, channel *chn);
81
82/* queue a luaproc that tried to receive a message */
83void luaproc_queue_receiver( luaproc lp );
84
85/* unlock a channel's access */
86void luaproc_unlock_channel( channel chan );
87
88/* return a luaproc's channel */
89channel luaproc_get_channel( luaproc lp );
90
91/* return status (boolean) indicating if worker thread should be destroyed after luaproc execution */
92int luaproc_get_destroyworker( luaproc lp );
93
94/* return status (boolean) indicating if lua process should be recycled */
95luaproc luaproc_recycle_pop( void );
96
97/* add a lua process to the recycle list */
98int luaproc_recycle_push( luaproc lp );
99
100#endif