| author | Tero Marttila <terom@fixme.fi> |
| Tue, 31 Mar 2009 20:33:31 +0300 | |
| changeset 95 | 6bb8ef294689 |
| parent 93 | 42ade8285570 |
| child 103 | 454aea1e4f11 |
| permissions | -rw-r--r-- |
|
53
12d806823775
add irc_client module, plus nexus.h header
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
1 |
#ifndef NEXUS_H |
|
12d806823775
add irc_client module, plus nexus.h header
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
2 |
#define NEXUS_H |
|
12d806823775
add irc_client module, plus nexus.h header
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
3 |
|
|
12d806823775
add irc_client module, plus nexus.h header
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
4 |
/** |
| 87 | 5 |
* @file |
6 |
* |
|
|
53
12d806823775
add irc_client module, plus nexus.h header
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
7 |
* A nexus is the central brain of the application; the place where the main() method is implemented |
|
12d806823775
add irc_client module, plus nexus.h header
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
8 |
*/ |
|
57
ce1accba5fc7
slight cleanup to move module funcs to a 'struct module_funcs'
Tero Marttila <terom@fixme.fi>
parents:
55
diff
changeset
|
9 |
struct nexus; |
|
ce1accba5fc7
slight cleanup to move module funcs to a 'struct module_funcs'
Tero Marttila <terom@fixme.fi>
parents:
55
diff
changeset
|
10 |
|
|
53
12d806823775
add irc_client module, plus nexus.h header
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
11 |
#include <event2/event.h> |
|
70
a9a4c5e6aa30
implement module unloading, although module_destroy is currently never called
Tero Marttila <terom@fixme.fi>
parents:
57
diff
changeset
|
12 |
#include "signals.h" |
|
92
99661e5aac91
add a simple interactive readline console
Tero Marttila <terom@fixme.fi>
parents:
87
diff
changeset
|
13 |
#include "console.h" |
|
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:
92
diff
changeset
|
14 |
#include "lua_console.h" |
|
55
6f7f6ae729d0
'working' modules code, and convert irc_log to use said interface, but we've hit the limits on our Makefile, and the compiled module doesn't really work
Tero Marttila <terom@fixme.fi>
parents:
53
diff
changeset
|
15 |
#include "module.h" |
|
53
12d806823775
add irc_client module, plus nexus.h header
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
16 |
#include "irc_client.h" |
|
12d806823775
add irc_client module, plus nexus.h header
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
17 |
|
|
12d806823775
add irc_client module, plus nexus.h header
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
18 |
/** |
| 87 | 19 |
* The central brain, as created in the main() function. |
|
53
12d806823775
add irc_client module, plus nexus.h header
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
20 |
*/ |
|
55
6f7f6ae729d0
'working' modules code, and convert irc_log to use said interface, but we've hit the limits on our Makefile, and the compiled module doesn't really work
Tero Marttila <terom@fixme.fi>
parents:
53
diff
changeset
|
21 |
struct nexus {
|
|
53
12d806823775
add irc_client module, plus nexus.h header
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
22 |
/** The libevent base */ |
|
12d806823775
add irc_client module, plus nexus.h header
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
23 |
struct event_base *ev_base; |
|
12d806823775
add irc_client module, plus nexus.h header
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
24 |
|
|
70
a9a4c5e6aa30
implement module unloading, although module_destroy is currently never called
Tero Marttila <terom@fixme.fi>
parents:
57
diff
changeset
|
25 |
/** Our signal handlers */ |
|
a9a4c5e6aa30
implement module unloading, although module_destroy is currently never called
Tero Marttila <terom@fixme.fi>
parents:
57
diff
changeset
|
26 |
struct signals *signals; |
|
a9a4c5e6aa30
implement module unloading, although module_destroy is currently never called
Tero Marttila <terom@fixme.fi>
parents:
57
diff
changeset
|
27 |
|
|
92
99661e5aac91
add a simple interactive readline console
Tero Marttila <terom@fixme.fi>
parents:
87
diff
changeset
|
28 |
/** Our console */ |
|
99661e5aac91
add a simple interactive readline console
Tero Marttila <terom@fixme.fi>
parents:
87
diff
changeset
|
29 |
struct console *console; |
|
99661e5aac91
add a simple interactive readline console
Tero Marttila <terom@fixme.fi>
parents:
87
diff
changeset
|
30 |
|
|
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:
92
diff
changeset
|
31 |
/** Our lua 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:
92
diff
changeset
|
32 |
struct lua_console *lua_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:
92
diff
changeset
|
33 |
|
|
55
6f7f6ae729d0
'working' modules code, and convert irc_log to use said interface, but we've hit the limits on our Makefile, and the compiled module doesn't really work
Tero Marttila <terom@fixme.fi>
parents:
53
diff
changeset
|
34 |
/** Our loaded modules */ |
|
6f7f6ae729d0
'working' modules code, and convert irc_log to use said interface, but we've hit the limits on our Makefile, and the compiled module doesn't really work
Tero Marttila <terom@fixme.fi>
parents:
53
diff
changeset
|
35 |
struct modules *modules; |
|
6f7f6ae729d0
'working' modules code, and convert irc_log to use said interface, but we've hit the limits on our Makefile, and the compiled module doesn't really work
Tero Marttila <terom@fixme.fi>
parents:
53
diff
changeset
|
36 |
|
|
53
12d806823775
add irc_client module, plus nexus.h header
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
37 |
/** The IRC client state */ |
|
12d806823775
add irc_client module, plus nexus.h header
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
38 |
struct irc_client *client; |
|
12d806823775
add irc_client module, plus nexus.h header
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
39 |
}; |
|
12d806823775
add irc_client module, plus nexus.h header
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
40 |
|
|
12d806823775
add irc_client module, plus nexus.h header
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
41 |
/** |
|
12d806823775
add irc_client module, plus nexus.h header
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
42 |
* The nexus main function, application entry point, etc. |
|
12d806823775
add irc_client module, plus nexus.h header
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
43 |
*/ |
|
12d806823775
add irc_client module, plus nexus.h header
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
44 |
int main (int argc, char **argv); |
|
12d806823775
add irc_client module, plus nexus.h header
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
45 |
|
|
12d806823775
add irc_client module, plus nexus.h header
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
46 |
#endif /* NEXUS_H */ |