author | Tero Marttila <terom@fixme.fi> |
Thu, 21 May 2009 16:57:56 +0300 | |
changeset 213 | f0e52e026197 |
parent 205 | c13d2fc7b480 |
child 217 | 7728d6ec3abf |
permissions | -rw-r--r-- |
93
42ade8285570
add some rudimentary lua support, by having a simple interactive console, and providing access to irc_client_quit
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
1 |
#include "lua_console.h" |
42ade8285570
add some rudimentary lua support, by having a simple interactive console, and providing access to irc_client_quit
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
2 |
#include "lua_objs.h" |
42ade8285570
add some rudimentary lua support, by having a simple interactive console, and providing access to irc_client_quit
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
3 |
#include "log.h" |
42ade8285570
add some rudimentary lua support, by having a simple interactive console, and providing access to irc_client_quit
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
4 |
|
42ade8285570
add some rudimentary lua support, by having a simple interactive console, and providing access to irc_client_quit
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
5 |
#include <stdlib.h> |
42ade8285570
add some rudimentary lua support, by having a simple interactive console, and providing access to irc_client_quit
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
6 |
|
42ade8285570
add some rudimentary lua support, by having a simple interactive console, and providing access to irc_client_quit
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
7 |
#include <lua5.1/lauxlib.h> |
42ade8285570
add some rudimentary lua support, by having a simple interactive console, and providing access to irc_client_quit
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
8 |
|
203
ffdf53fd0337
implement lua_threads, nexus:sleep test func, and basic support in console/lua_console... doesn't actually work yet
Tero Marttila <terom@fixme.fi>
parents:
170
diff
changeset
|
9 |
struct lua_console { |
ffdf53fd0337
implement lua_threads, nexus:sleep test func, and basic support in console/lua_console... doesn't actually work yet
Tero Marttila <terom@fixme.fi>
parents:
170
diff
changeset
|
10 |
/** The lowlevel line-based console */ |
ffdf53fd0337
implement lua_threads, nexus:sleep test func, and basic support in console/lua_console... doesn't actually work yet
Tero Marttila <terom@fixme.fi>
parents:
170
diff
changeset
|
11 |
struct console *console; |
ffdf53fd0337
implement lua_threads, nexus:sleep test func, and basic support in console/lua_console... doesn't actually work yet
Tero Marttila <terom@fixme.fi>
parents:
170
diff
changeset
|
12 |
|
ffdf53fd0337
implement lua_threads, nexus:sleep test func, and basic support in console/lua_console... doesn't actually work yet
Tero Marttila <terom@fixme.fi>
parents:
170
diff
changeset
|
13 |
/** Our lua state */ |
ffdf53fd0337
implement lua_threads, nexus:sleep test func, and basic support in console/lua_console... doesn't actually work yet
Tero Marttila <terom@fixme.fi>
parents:
170
diff
changeset
|
14 |
struct nexus_lua *lua; |
ffdf53fd0337
implement lua_threads, nexus:sleep test func, and basic support in console/lua_console... doesn't actually work yet
Tero Marttila <terom@fixme.fi>
parents:
170
diff
changeset
|
15 |
|
ffdf53fd0337
implement lua_threads, nexus:sleep test func, and basic support in console/lua_console... doesn't actually work yet
Tero Marttila <terom@fixme.fi>
parents:
170
diff
changeset
|
16 |
/** Coroutine state */ |
ffdf53fd0337
implement lua_threads, nexus:sleep test func, and basic support in console/lua_console... doesn't actually work yet
Tero Marttila <terom@fixme.fi>
parents:
170
diff
changeset
|
17 |
struct lua_thread thread; |
ffdf53fd0337
implement lua_threads, nexus:sleep test func, and basic support in console/lua_console... doesn't actually work yet
Tero Marttila <terom@fixme.fi>
parents:
170
diff
changeset
|
18 |
}; |
ffdf53fd0337
implement lua_threads, nexus:sleep test func, and basic support in console/lua_console... doesn't actually work yet
Tero Marttila <terom@fixme.fi>
parents:
170
diff
changeset
|
19 |
|
ffdf53fd0337
implement lua_threads, nexus:sleep test func, and basic support in console/lua_console... doesn't actually work yet
Tero Marttila <terom@fixme.fi>
parents:
170
diff
changeset
|
20 |
/** |
ffdf53fd0337
implement lua_threads, nexus:sleep test func, and basic support in console/lua_console... doesn't actually work yet
Tero Marttila <terom@fixme.fi>
parents:
170
diff
changeset
|
21 |
* Line finished execution |
ffdf53fd0337
implement lua_threads, nexus:sleep test func, and basic support in console/lua_console... doesn't actually work yet
Tero Marttila <terom@fixme.fi>
parents:
170
diff
changeset
|
22 |
*/ |
205
c13d2fc7b480
fix lua_console to use new lua_thread API
Tero Marttila <terom@fixme.fi>
parents:
203
diff
changeset
|
23 |
static void lua_console_on_thread (const error_t *err, void *arg) |
93
42ade8285570
add some rudimentary lua support, by having a simple interactive console, and providing access to irc_client_quit
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
24 |
{ |
42ade8285570
add some rudimentary lua support, by having a simple interactive console, and providing access to irc_client_quit
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
25 |
struct lua_console *lc = arg; |
203
ffdf53fd0337
implement lua_threads, nexus:sleep test func, and basic support in console/lua_console... doesn't actually work yet
Tero Marttila <terom@fixme.fi>
parents:
170
diff
changeset
|
26 |
|
ffdf53fd0337
implement lua_threads, nexus:sleep test func, and basic support in console/lua_console... doesn't actually work yet
Tero Marttila <terom@fixme.fi>
parents:
170
diff
changeset
|
27 |
if (err) |
ffdf53fd0337
implement lua_threads, nexus:sleep test func, and basic support in console/lua_console... doesn't actually work yet
Tero Marttila <terom@fixme.fi>
parents:
170
diff
changeset
|
28 |
// display error message |
ffdf53fd0337
implement lua_threads, nexus:sleep test func, and basic support in console/lua_console... doesn't actually work yet
Tero Marttila <terom@fixme.fi>
parents:
170
diff
changeset
|
29 |
console_print(lc->console, error_msg(err)); |
ffdf53fd0337
implement lua_threads, nexus:sleep test func, and basic support in console/lua_console... doesn't actually work yet
Tero Marttila <terom@fixme.fi>
parents:
170
diff
changeset
|
30 |
|
ffdf53fd0337
implement lua_threads, nexus:sleep test func, and basic support in console/lua_console... doesn't actually work yet
Tero Marttila <terom@fixme.fi>
parents:
170
diff
changeset
|
31 |
// XXX: display return value? |
ffdf53fd0337
implement lua_threads, nexus:sleep test func, and basic support in console/lua_console... doesn't actually work yet
Tero Marttila <terom@fixme.fi>
parents:
170
diff
changeset
|
32 |
|
ffdf53fd0337
implement lua_threads, nexus:sleep test func, and basic support in console/lua_console... doesn't actually work yet
Tero Marttila <terom@fixme.fi>
parents:
170
diff
changeset
|
33 |
// un-wait console |
ffdf53fd0337
implement lua_threads, nexus:sleep test func, and basic support in console/lua_console... doesn't actually work yet
Tero Marttila <terom@fixme.fi>
parents:
170
diff
changeset
|
34 |
console_continue(lc->console); |
ffdf53fd0337
implement lua_threads, nexus:sleep test func, and basic support in console/lua_console... doesn't actually work yet
Tero Marttila <terom@fixme.fi>
parents:
170
diff
changeset
|
35 |
} |
ffdf53fd0337
implement lua_threads, nexus:sleep test func, and basic support in console/lua_console... doesn't actually work yet
Tero Marttila <terom@fixme.fi>
parents:
170
diff
changeset
|
36 |
|
ffdf53fd0337
implement lua_threads, nexus:sleep test func, and basic support in console/lua_console... doesn't actually work yet
Tero Marttila <terom@fixme.fi>
parents:
170
diff
changeset
|
37 |
/** |
ffdf53fd0337
implement lua_threads, nexus:sleep test func, and basic support in console/lua_console... doesn't actually work yet
Tero Marttila <terom@fixme.fi>
parents:
170
diff
changeset
|
38 |
* Got a line to exec from the console |
ffdf53fd0337
implement lua_threads, nexus:sleep test func, and basic support in console/lua_console... doesn't actually work yet
Tero Marttila <terom@fixme.fi>
parents:
170
diff
changeset
|
39 |
*/ |
ffdf53fd0337
implement lua_threads, nexus:sleep test func, and basic support in console/lua_console... doesn't actually work yet
Tero Marttila <terom@fixme.fi>
parents:
170
diff
changeset
|
40 |
static enum console_line_status lua_console_on_line (const char *line, void *arg) |
ffdf53fd0337
implement lua_threads, nexus:sleep test func, and basic support in console/lua_console... doesn't actually work yet
Tero Marttila <terom@fixme.fi>
parents:
170
diff
changeset
|
41 |
{ |
ffdf53fd0337
implement lua_threads, nexus:sleep test func, and basic support in console/lua_console... doesn't actually work yet
Tero Marttila <terom@fixme.fi>
parents:
170
diff
changeset
|
42 |
struct lua_console *lc = arg; |
ffdf53fd0337
implement lua_threads, nexus:sleep test func, and basic support in console/lua_console... doesn't actually work yet
Tero Marttila <terom@fixme.fi>
parents:
170
diff
changeset
|
43 |
error_t err; |
205
c13d2fc7b480
fix lua_console to use new lua_thread API
Tero Marttila <terom@fixme.fi>
parents:
203
diff
changeset
|
44 |
int ret; |
93
42ade8285570
add some rudimentary lua support, by having a simple interactive console, and providing access to irc_client_quit
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
45 |
|
42ade8285570
add some rudimentary lua support, by having a simple interactive console, and providing access to irc_client_quit
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
46 |
// ignore empty lines and EOF |
42ade8285570
add some rudimentary lua support, by having a simple interactive console, and providing access to irc_client_quit
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
47 |
if (!line || !(*line)) |
203
ffdf53fd0337
implement lua_threads, nexus:sleep test func, and basic support in console/lua_console... doesn't actually work yet
Tero Marttila <terom@fixme.fi>
parents:
170
diff
changeset
|
48 |
return CONSOLE_CONTINUE; |
93
42ade8285570
add some rudimentary lua support, by having a simple interactive console, and providing access to irc_client_quit
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
49 |
|
203
ffdf53fd0337
implement lua_threads, nexus:sleep test func, and basic support in console/lua_console... doesn't actually work yet
Tero Marttila <terom@fixme.fi>
parents:
170
diff
changeset
|
50 |
// exec it in our thread |
205
c13d2fc7b480
fix lua_console to use new lua_thread API
Tero Marttila <terom@fixme.fi>
parents:
203
diff
changeset
|
51 |
if ((ret = lua_thread_start(&lc->thread, line, &err)) < 0) { |
203
ffdf53fd0337
implement lua_threads, nexus:sleep test func, and basic support in console/lua_console... doesn't actually work yet
Tero Marttila <terom@fixme.fi>
parents:
170
diff
changeset
|
52 |
// display error message |
137
c607c357c486
implement console_print and log_set_func
Tero Marttila <terom@fixme.fi>
parents:
136
diff
changeset
|
53 |
console_print(lc->console, error_msg(&err)); |
93
42ade8285570
add some rudimentary lua support, by having a simple interactive console, and providing access to irc_client_quit
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
54 |
|
203
ffdf53fd0337
implement lua_threads, nexus:sleep test func, and basic support in console/lua_console... doesn't actually work yet
Tero Marttila <terom@fixme.fi>
parents:
170
diff
changeset
|
55 |
return CONSOLE_CONTINUE; |
205
c13d2fc7b480
fix lua_console to use new lua_thread API
Tero Marttila <terom@fixme.fi>
parents:
203
diff
changeset
|
56 |
} |
203
ffdf53fd0337
implement lua_threads, nexus:sleep test func, and basic support in console/lua_console... doesn't actually work yet
Tero Marttila <terom@fixme.fi>
parents:
170
diff
changeset
|
57 |
|
205
c13d2fc7b480
fix lua_console to use new lua_thread API
Tero Marttila <terom@fixme.fi>
parents:
203
diff
changeset
|
58 |
// waiting? |
c13d2fc7b480
fix lua_console to use new lua_thread API
Tero Marttila <terom@fixme.fi>
parents:
203
diff
changeset
|
59 |
if (ret) |
c13d2fc7b480
fix lua_console to use new lua_thread API
Tero Marttila <terom@fixme.fi>
parents:
203
diff
changeset
|
60 |
return CONSOLE_WAIT; |
c13d2fc7b480
fix lua_console to use new lua_thread API
Tero Marttila <terom@fixme.fi>
parents:
203
diff
changeset
|
61 |
|
c13d2fc7b480
fix lua_console to use new lua_thread API
Tero Marttila <terom@fixme.fi>
parents:
203
diff
changeset
|
62 |
else |
c13d2fc7b480
fix lua_console to use new lua_thread API
Tero Marttila <terom@fixme.fi>
parents:
203
diff
changeset
|
63 |
return CONSOLE_CONTINUE; |
93
42ade8285570
add some rudimentary lua support, by having a simple interactive console, and providing access to irc_client_quit
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
64 |
} |
42ade8285570
add some rudimentary lua support, by having a simple interactive console, and providing access to irc_client_quit
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
65 |
|
170
1b2f28e26eef
replace old SIGINT handling with SIGTERM, and have SIGINT just abort the console input line. Now EOF (^D) will cause lua_console to nexus_shutdown
Tero Marttila <terom@fixme.fi>
parents:
137
diff
changeset
|
66 |
static void lua_console_on_eof (void *arg) |
1b2f28e26eef
replace old SIGINT handling with SIGTERM, and have SIGINT just abort the console input line. Now EOF (^D) will cause lua_console to nexus_shutdown
Tero Marttila <terom@fixme.fi>
parents:
137
diff
changeset
|
67 |
{ |
1b2f28e26eef
replace old SIGINT handling with SIGTERM, and have SIGINT just abort the console input line. Now EOF (^D) will cause lua_console to nexus_shutdown
Tero Marttila <terom@fixme.fi>
parents:
137
diff
changeset
|
68 |
struct lua_console *lc = arg; |
1b2f28e26eef
replace old SIGINT handling with SIGTERM, and have SIGINT just abort the console input line. Now EOF (^D) will cause lua_console to nexus_shutdown
Tero Marttila <terom@fixme.fi>
parents:
137
diff
changeset
|
69 |
|
1b2f28e26eef
replace old SIGINT handling with SIGTERM, and have SIGINT just abort the console input line. Now EOF (^D) will cause lua_console to nexus_shutdown
Tero Marttila <terom@fixme.fi>
parents:
137
diff
changeset
|
70 |
// exit the process |
1b2f28e26eef
replace old SIGINT handling with SIGTERM, and have SIGINT just abort the console input line. Now EOF (^D) will cause lua_console to nexus_shutdown
Tero Marttila <terom@fixme.fi>
parents:
137
diff
changeset
|
71 |
nexus_shutdown(lc->lua->nexus); |
1b2f28e26eef
replace old SIGINT handling with SIGTERM, and have SIGINT just abort the console input line. Now EOF (^D) will cause lua_console to nexus_shutdown
Tero Marttila <terom@fixme.fi>
parents:
137
diff
changeset
|
72 |
} |
1b2f28e26eef
replace old SIGINT handling with SIGTERM, and have SIGINT just abort the console input line. Now EOF (^D) will cause lua_console to nexus_shutdown
Tero Marttila <terom@fixme.fi>
parents:
137
diff
changeset
|
73 |
|
213
f0e52e026197
implement lua_console_on_interrupt to abort any executing thread
Tero Marttila <terom@fixme.fi>
parents:
205
diff
changeset
|
74 |
static void lua_console_on_interrupt (void *arg) |
f0e52e026197
implement lua_console_on_interrupt to abort any executing thread
Tero Marttila <terom@fixme.fi>
parents:
205
diff
changeset
|
75 |
{ |
f0e52e026197
implement lua_console_on_interrupt to abort any executing thread
Tero Marttila <terom@fixme.fi>
parents:
205
diff
changeset
|
76 |
struct lua_console *lc = arg; |
f0e52e026197
implement lua_console_on_interrupt to abort any executing thread
Tero Marttila <terom@fixme.fi>
parents:
205
diff
changeset
|
77 |
|
f0e52e026197
implement lua_console_on_interrupt to abort any executing thread
Tero Marttila <terom@fixme.fi>
parents:
205
diff
changeset
|
78 |
// abort thread so we can _start again |
f0e52e026197
implement lua_console_on_interrupt to abort any executing thread
Tero Marttila <terom@fixme.fi>
parents:
205
diff
changeset
|
79 |
lua_thread_abort(&lc->thread); |
f0e52e026197
implement lua_console_on_interrupt to abort any executing thread
Tero Marttila <terom@fixme.fi>
parents:
205
diff
changeset
|
80 |
|
f0e52e026197
implement lua_console_on_interrupt to abort any executing thread
Tero Marttila <terom@fixme.fi>
parents:
205
diff
changeset
|
81 |
// inform user |
f0e52e026197
implement lua_console_on_interrupt to abort any executing thread
Tero Marttila <terom@fixme.fi>
parents:
205
diff
changeset
|
82 |
console_print(lc->console, "Execution aborted."); |
f0e52e026197
implement lua_console_on_interrupt to abort any executing thread
Tero Marttila <terom@fixme.fi>
parents:
205
diff
changeset
|
83 |
|
f0e52e026197
implement lua_console_on_interrupt to abort any executing thread
Tero Marttila <terom@fixme.fi>
parents:
205
diff
changeset
|
84 |
// accept input |
f0e52e026197
implement lua_console_on_interrupt to abort any executing thread
Tero Marttila <terom@fixme.fi>
parents:
205
diff
changeset
|
85 |
console_continue(lc->console); |
f0e52e026197
implement lua_console_on_interrupt to abort any executing thread
Tero Marttila <terom@fixme.fi>
parents:
205
diff
changeset
|
86 |
} |
f0e52e026197
implement lua_console_on_interrupt to abort any executing thread
Tero Marttila <terom@fixme.fi>
parents:
205
diff
changeset
|
87 |
|
93
42ade8285570
add some rudimentary lua support, by having a simple interactive console, and providing access to irc_client_quit
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
88 |
static struct console_callbacks _console_callbacks = { |
213
f0e52e026197
implement lua_console_on_interrupt to abort any executing thread
Tero Marttila <terom@fixme.fi>
parents:
205
diff
changeset
|
89 |
.on_line = lua_console_on_line, |
f0e52e026197
implement lua_console_on_interrupt to abort any executing thread
Tero Marttila <terom@fixme.fi>
parents:
205
diff
changeset
|
90 |
.on_eof = lua_console_on_eof, |
f0e52e026197
implement lua_console_on_interrupt to abort any executing thread
Tero Marttila <terom@fixme.fi>
parents:
205
diff
changeset
|
91 |
.on_interrupt = lua_console_on_interrupt, |
93
42ade8285570
add some rudimentary lua support, by having a simple interactive console, and providing access to irc_client_quit
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
92 |
}; |
42ade8285570
add some rudimentary lua support, by having a simple interactive console, and providing access to irc_client_quit
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
93 |
|
105
b6b183fbf373
implement a separate nexus_lua module
Tero Marttila <terom@fixme.fi>
parents:
93
diff
changeset
|
94 |
err_t lua_console_create (struct lua_console **lc_ptr, struct console *console, struct nexus_lua *lua, struct error_info *err) |
93
42ade8285570
add some rudimentary lua support, by having a simple interactive console, and providing access to irc_client_quit
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
95 |
{ |
42ade8285570
add some rudimentary lua support, by having a simple interactive console, and providing access to irc_client_quit
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
96 |
struct lua_console *lc; |
42ade8285570
add some rudimentary lua support, by having a simple interactive console, and providing access to irc_client_quit
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
97 |
|
42ade8285570
add some rudimentary lua support, by having a simple interactive console, and providing access to irc_client_quit
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
98 |
// allocate |
42ade8285570
add some rudimentary lua support, by having a simple interactive console, and providing access to irc_client_quit
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
99 |
if ((lc = calloc(1, sizeof(*lc))) == NULL) |
42ade8285570
add some rudimentary lua support, by having a simple interactive console, and providing access to irc_client_quit
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
100 |
return SET_ERROR(err, ERR_CALLOC); |
42ade8285570
add some rudimentary lua support, by having a simple interactive console, and providing access to irc_client_quit
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
101 |
|
42ade8285570
add some rudimentary lua support, by having a simple interactive console, and providing access to irc_client_quit
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
102 |
// store |
42ade8285570
add some rudimentary lua support, by having a simple interactive console, and providing access to irc_client_quit
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
103 |
lc->console = console; |
105
b6b183fbf373
implement a separate nexus_lua module
Tero Marttila <terom@fixme.fi>
parents:
93
diff
changeset
|
104 |
lc->lua = lua; |
93
42ade8285570
add some rudimentary lua support, by having a simple interactive console, and providing access to irc_client_quit
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
105 |
|
42ade8285570
add some rudimentary lua support, by having a simple interactive console, and providing access to irc_client_quit
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
106 |
// set our console callbacks |
42ade8285570
add some rudimentary lua support, by having a simple interactive console, and providing access to irc_client_quit
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
107 |
console_set_callbacks(console, &_console_callbacks, lc); |
42ade8285570
add some rudimentary lua support, by having a simple interactive console, and providing access to irc_client_quit
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
108 |
|
203
ffdf53fd0337
implement lua_threads, nexus:sleep test func, and basic support in console/lua_console... doesn't actually work yet
Tero Marttila <terom@fixme.fi>
parents:
170
diff
changeset
|
109 |
// init thread |
ffdf53fd0337
implement lua_threads, nexus:sleep test func, and basic support in console/lua_console... doesn't actually work yet
Tero Marttila <terom@fixme.fi>
parents:
170
diff
changeset
|
110 |
lua_thread_init(&lc->thread, lua, lua_console_on_thread, lc); |
ffdf53fd0337
implement lua_threads, nexus:sleep test func, and basic support in console/lua_console... doesn't actually work yet
Tero Marttila <terom@fixme.fi>
parents:
170
diff
changeset
|
111 |
|
93
42ade8285570
add some rudimentary lua support, by having a simple interactive console, and providing access to irc_client_quit
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
112 |
// ok |
42ade8285570
add some rudimentary lua support, by having a simple interactive console, and providing access to irc_client_quit
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
113 |
*lc_ptr = lc; |
42ade8285570
add some rudimentary lua support, by having a simple interactive console, and providing access to irc_client_quit
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
114 |
|
42ade8285570
add some rudimentary lua support, by having a simple interactive console, and providing access to irc_client_quit
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
115 |
return SUCCESS; |
42ade8285570
add some rudimentary lua support, by having a simple interactive console, and providing access to irc_client_quit
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
116 |
} |
42ade8285570
add some rudimentary lua support, by having a simple interactive console, and providing access to irc_client_quit
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
117 |
|
42ade8285570
add some rudimentary lua support, by having a simple interactive console, and providing access to irc_client_quit
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
118 |
void lua_console_destroy (struct lua_console *lc) |
42ade8285570
add some rudimentary lua support, by having a simple interactive console, and providing access to irc_client_quit
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
119 |
{ |
105
b6b183fbf373
implement a separate nexus_lua module
Tero Marttila <terom@fixme.fi>
parents:
93
diff
changeset
|
120 |
// the console |
93
42ade8285570
add some rudimentary lua support, by having a simple interactive console, and providing access to irc_client_quit
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
121 |
console_destroy(lc->console); |
42ade8285570
add some rudimentary lua support, by having a simple interactive console, and providing access to irc_client_quit
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
122 |
|
42ade8285570
add some rudimentary lua support, by having a simple interactive console, and providing access to irc_client_quit
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
123 |
free(lc); |
42ade8285570
add some rudimentary lua support, by having a simple interactive console, and providing access to irc_client_quit
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
124 |
} |