projects
/
NextIRCd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
push
[NextIRCd.git]
/
src
/
main.c
diff --git
a/src/main.c
b/src/main.c
index b8e0d6cccb6a5fdcaca926e200fb52c97aea921a..848023a0e5a62e9126d3701d862e03a4edbb9be9 100644
(file)
--- a/
src/main.c
+++ b/
src/main.c
@@
-1,5
+1,5
@@
-/* main.c -
IOMultiplexer
- * Copyright (C) 2012 Philipp Kreil (pk910)
+/* main.c -
NextIRCd
+ * Copyright (C) 2012
-2013
Philipp Kreil (pk910)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@
-15,39
+15,28
@@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "ircd_config.h"
+#include "ircd_sock.h"
+#include "IOHandler/IOHandler.h"
+#include "IOHandler/IOLog.h"
+
+#include <stdlib.h>
#include <stdio.h>
#include <stdio.h>
-#include "IOHandler.h"
-static IOHANDLER_CALLBACK(io_callback);
-static IOHANDLER_LOG_BACKEND(io_log);
+static IOLOG_CALLBACK(io_log);
int main(int argc, char *argv[]) {
int main(int argc, char *argv[]) {
- iolog_backend = io_log;
-
- iohandler_connect("pk910.de", 6667, 0, NULL, io_callback);
+ iohandler_init();
+ iolog_register_callback(io_log);
- struct IODescriptor *iofd;
- iofd = iohandler_add(0, IOTYPE_STDIN, NULL, io_callback);
- iofd->read_lines = 1;
- while(1) {
- iohandler_poll();
- }
-}
-
-static IOHANDLER_CALLBACK(io_callback) {
- switch(event->type) {
- case IOEVENT_CONNECTED:
- printf("[connect]\n");
- break;
- case IOEVENT_RECV:
- printf("[in] %s\n", event->data.recv_str);
- break;
- default:
- break;
- }
+ init_config(NULL);
+ init_sockets();
+
+ iohandler_run();
+ return 0;
}
}
-static IO
HANDLER_LOG_BACKEND
(io_log) {
-
printf("%s\n", lin
e);
+static IO
LOG_CALLBACK
(io_log) {
+
printf("%s", messag
e);
}
}