diff -r be88e543c8ff -r 4c4c906cc649 src/nexus.c --- a/src/nexus.c Sun Feb 22 08:21:22 2009 +0200 +++ b/src/nexus.c Sun Feb 22 08:48:21 2009 +0200 @@ -7,6 +7,7 @@ #include #include +#include #include "sock.h" #include "line_proto.h" @@ -16,22 +17,27 @@ #define LINE_LENGTH 512 int main (int argc, char **argv) { + struct event_base *ev_base; struct sock_stream *sock; struct line_proto *lp; char line_buf[LINE_LENGTH + 1]; - struct error_info err; + struct error_info _err; - // initialize - if (sock_init(&err)) - errx(1, "sock_init: %s", error_msg(&err)); + // initialize libevent + if ((ev_base = event_base_new()) == NULL) + err(1, "event_base_new"); + + // initialize sock module + if (sock_init(ev_base, &_err)) + errx(1, "sock_init: %s", error_msg(&_err)); // over-simplified connect - if (sock_gnutls_connect(&sock, CONNECT_HOST, CONNECT_SERV, &err)) - errx(1, "sock_gnutls_connect: %s", error_msg(&err)); + if (sock_gnutls_connect(&sock, CONNECT_HOST, CONNECT_SERV, &_err)) + errx(1, "sock_gnutls_connect: %s", error_msg(&_err)); // line protocol - if (line_proto_create(&lp, sock, &err)) - errx(1, "line_proto_create: %s", error_msg(&err)); + if (line_proto_create(&lp, sock, &_err)) + errx(1, "line_proto_create: %s", error_msg(&_err)); // read lines and dump them out do {