commit a39040ba9b3351aa682c906a7dc668caf2192582
parent d9bbb0b1f1ca89d172318e90eb9867b3328b3c69
Author: Joris Vink <joris@coders.se>
Date: Wed, 1 May 2013 16:11:10 +0200
build kore as -rdynamic so we can properly load modules.
implement kore_module_handler_find().
Diffstat:
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
@@ -11,7 +11,7 @@ CFLAGS+=-I/usr/local/ssl/include
CFLAGS+=-Wall -Wstrict-prototypes -Wmissing-prototypes
CFLAGS+=-Wmissing-declarations -Wshadow -Wpointer-arith -Wcast-qual
CFLAGS+=-Wsign-compare -Iincludes -g
-LDFLAGS=-Llibs -lssl -lcrypto -ldl -lz
+LDFLAGS=-rdynamic -Llibs -lssl -lcrypto -ldl -lz
light: $(S_OBJS)
$(CC) $(CFLAGS) $(S_OBJS) $(LDFLAGS) -o $(BIN)
diff --git a/src/module.c b/src/module.c
@@ -97,5 +97,12 @@ kore_module_handler_new(char *uri, char *func, int type)
void *
kore_module_handler_find(char *uri)
{
+ struct kore_module_handle *hdlr;
+
+ TAILQ_FOREACH(hdlr, &handlers, list) {
+ if (!strcmp(hdlr->uri, uri))
+ return (hdlr->func);
+ }
+
return (NULL);
}