src/nexus.h
author Tero Marttila <terom@fixme.fi>
Mon, 16 Mar 2009 23:34:05 +0200
changeset 70 a9a4c5e6aa30
parent 57 ce1accba5fc7
child 87 f0db6ebf18b9
permissions -rw-r--r--
implement module unloading, although module_destroy is currently never called
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
/**
12d806823775 add irc_client module, plus nexus.h header
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
     5
 * 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
     6
 */
57
ce1accba5fc7 slight cleanup to move module funcs to a 'struct module_funcs'
Tero Marttila <terom@fixme.fi>
parents: 55
diff changeset
     7
ce1accba5fc7 slight cleanup to move module funcs to a 'struct module_funcs'
Tero Marttila <terom@fixme.fi>
parents: 55
diff changeset
     8
struct nexus;
ce1accba5fc7 slight cleanup to move module funcs to a 'struct module_funcs'
Tero Marttila <terom@fixme.fi>
parents: 55
diff changeset
     9
53
12d806823775 add irc_client module, plus nexus.h header
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    10
#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
    11
#include "signals.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
    12
#include "module.h"
53
12d806823775 add irc_client module, plus nexus.h header
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    13
#include "irc_client.h"
12d806823775 add irc_client module, plus nexus.h header
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    14
12d806823775 add irc_client module, plus nexus.h header
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    15
/**
12d806823775 add irc_client module, plus nexus.h header
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    16
 * Context for async nexus operation
12d806823775 add irc_client module, plus nexus.h header
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    17
 */
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
    18
struct nexus {
53
12d806823775 add irc_client module, plus nexus.h header
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    19
    /** The libevent base */
12d806823775 add irc_client module, plus nexus.h header
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    20
    struct event_base *ev_base;
12d806823775 add irc_client module, plus nexus.h header
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    21
70
a9a4c5e6aa30 implement module unloading, although module_destroy is currently never called
Tero Marttila <terom@fixme.fi>
parents: 57
diff changeset
    22
    /** Our signal handlers */
a9a4c5e6aa30 implement module unloading, although module_destroy is currently never called
Tero Marttila <terom@fixme.fi>
parents: 57
diff changeset
    23
    struct signals *signals;
a9a4c5e6aa30 implement module unloading, although module_destroy is currently never called
Tero Marttila <terom@fixme.fi>
parents: 57
diff changeset
    24
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
    25
    /** 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
    26
    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
    27
53
12d806823775 add irc_client module, plus nexus.h header
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    28
    /** The IRC client state */
12d806823775 add irc_client module, plus nexus.h header
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    29
    struct irc_client *client;
12d806823775 add irc_client module, plus nexus.h header
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    30
};
12d806823775 add irc_client module, plus nexus.h header
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    31
12d806823775 add irc_client module, plus nexus.h header
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    32
/**
12d806823775 add irc_client module, plus nexus.h header
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    33
 * 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
    34
 */
12d806823775 add irc_client module, plus nexus.h header
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    35
int main (int argc, char **argv);
12d806823775 add irc_client module, plus nexus.h header
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    36
12d806823775 add irc_client module, plus nexus.h header
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    37
#endif /* NEXUS_H */