|
From: <cli...@li...> - 2007-05-15 21:54:34
|
Revision: 51
http://cligg.svn.sourceforge.net/cligg/?rev=51&view=rev
Author: sithhell
Date: 2007-05-15 14:54:32 -0700 (Tue, 15 May 2007)
Log Message:
-----------
error correction, segfault still remains ...
Modified Paths:
--------------
src/bin/cligg.c
src/bin/cligg_eventhandler.c
src/lib/cligg_event.c
src/lib/cligg_hashmap.c
Modified: src/bin/cligg.c
===================================================================
--- src/bin/cligg.c 2007-05-15 20:58:37 UTC (rev 50)
+++ src/bin/cligg.c 2007-05-15 21:54:32 UTC (rev 51)
@@ -51,6 +51,9 @@
/* init module system */
ret = cligg_init_modulehandler();
+ if(!cligg_trigger_event("test", NULL))
+ fprintf(stderr, "Error laoding module\n");
+
/* TODO load the config */
/* TODO process the config */
Modified: src/bin/cligg_eventhandler.c
===================================================================
--- src/bin/cligg_eventhandler.c 2007-05-15 20:58:37 UTC (rev 50)
+++ src/bin/cligg_eventhandler.c 2007-05-15 21:54:32 UTC (rev 51)
@@ -23,7 +23,7 @@
static unsigned long
hash(void *data) /* this is the sdbm hashing algorithm */
{
- char *str = (char *)data;
+ char *str = ((char *)((cligg_event_function *)data)->name);
unsigned long hash = 0;
int c;
while((c = *str++))
Modified: src/lib/cligg_event.c
===================================================================
--- src/lib/cligg_event.c 2007-05-15 20:58:37 UTC (rev 50)
+++ src/lib/cligg_event.c 2007-05-15 21:54:32 UTC (rev 51)
@@ -43,6 +43,7 @@
strcpy(new->name, name);
+
new->event_cb = event_cb;
return new;
Modified: src/lib/cligg_hashmap.c
===================================================================
--- src/lib/cligg_hashmap.c 2007-05-15 20:58:37 UTC (rev 50)
+++ src/lib/cligg_hashmap.c 2007-05-15 21:54:32 UTC (rev 51)
@@ -1,6 +1,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <cligg_hashmap.h>
+#include <cligg_event.h>
static int
cmp(void *_a,
@@ -61,7 +62,7 @@
cligg_hashmap_add_element(cligg_hashmap *map,
void *data)
{
- cligg_hashmap_element *new = malloc(sizeof(cligg_hashmap_element));
+ cligg_hashmap_element *new = (cligg_hashmap_element *)malloc(sizeof(cligg_hashmap_element));
new->hash = map->hash_func(data);
new->data = data;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|