|
From: <cli...@li...> - 2007-05-22 07:50:17
|
Revision: 61
http://cligg.svn.sourceforge.net/cligg/?rev=61&view=rev
Author: sithhell
Date: 2007-05-22 00:50:16 -0700 (Tue, 22 May 2007)
Log Message:
-----------
slowly it grows ...
Modified Paths:
--------------
src/bin/cligg.c
src/bin/cligg_mainloop.c
src/lib/cligg_btree.c
src/lib/cligg_hashmap.c
src/modules/print/print.c
src/modules/read/read.c
Modified: src/bin/cligg.c
===================================================================
--- src/bin/cligg.c 2007-05-21 21:21:57 UTC (rev 60)
+++ src/bin/cligg.c 2007-05-22 07:50:16 UTC (rev 61)
@@ -56,15 +56,15 @@
/* init module system */
ret = cligg_init_modulehandler();
- if(!cligg_trigger_event("test", NULL))
- fprintf(stderr, "Error loading module\n");
+ /*if(!cligg_trigger_event("test", NULL))
+ fprintf(stderr, "Error loading module\n");*/
- cligg_trigger_event("load_module", "test");
- cligg_trigger_event("load_module", "/home/heller/projekte/cligg/src/modules/dummy/dummy.so");
+ /*cligg_trigger_event("load_module", "test");*/
+ /*cligg_trigger_event("load_module", "/home/heller/projekte/cligg/src/modules/dummy/dummy.so");*/
cligg_trigger_event("load_module", "/home/heller/projekte/cligg/src/modules/print/print.so");
cligg_trigger_event("load_module", "/home/heller/projekte/cligg/src/modules/read/read.so");
cligg_trigger_event("read", NULL);
- cligg_trigger_event("quit_cligg", NULL);
+ /*cligg_trigger_event("quit_cligg", NULL);*/
/* TODO load the config */
Modified: src/bin/cligg_mainloop.c
===================================================================
--- src/bin/cligg_mainloop.c 2007-05-21 21:21:57 UTC (rev 60)
+++ src/bin/cligg_mainloop.c 2007-05-22 07:50:16 UTC (rev 61)
@@ -56,6 +56,7 @@
cb = cligg_lookup_event(new->name);
free(new->name);
+ printf("adress of function: %x\n", cb);
if(cb == NULL) {
fprintf(stderr, "No Callback specified!\n");
}
Modified: src/lib/cligg_btree.c
===================================================================
--- src/lib/cligg_btree.c 2007-05-21 21:21:57 UTC (rev 60)
+++ src/lib/cligg_btree.c 2007-05-22 07:50:16 UTC (rev 61)
@@ -2,6 +2,8 @@
#include <stdio.h>
#include <cligg_btree.h>
#include <cligg_list.h>
+#include <cligg_event.h>
+#include <cligg_hashmap.h>
CLIGG cligg_btree *
cligg_btree_new(free_func_cb free_func,
@@ -87,6 +89,7 @@
while(tmp2) {
tmp1 = tmp2;
test = tree->cmp_func(data, tmp2->data);
+ printf("%d\n", test);
if(test == 0) {
fprintf(stderr, "Cannot insert two equal elements!\n");
free(new);
@@ -95,7 +98,7 @@
if(test < 0)
tmp2 = tmp2->left;
else
- tmp2 = tmp2->left;
+ tmp2 = tmp2->right;
}
new->parent = tmp1;
@@ -103,7 +106,7 @@
if(tmp1 == NULL)
tree->root = new;
else {
- if(tree->cmp_func(data, tmp1->data))
+ if(tree->cmp_func(data, tmp1->data) < 0)
tmp1->left = new;
else
tmp1->right = new;
@@ -183,6 +186,7 @@
tmp = tmp->left;
break;
case 0:
+ printf("hurray!\n");
/*element found*/
return tmp;
}
Modified: src/lib/cligg_hashmap.c
===================================================================
--- src/lib/cligg_hashmap.c 2007-05-21 21:21:57 UTC (rev 60)
+++ src/lib/cligg_hashmap.c 2007-05-22 07:50:16 UTC (rev 61)
@@ -108,6 +108,7 @@
return NULL;
new->data = data;
new->hash = hash_func(data);
+ printf("hash value of: %ld\n", new->hash);
new->free_func = free_func;
return new;
Modified: src/modules/print/print.c
===================================================================
--- src/modules/print/print.c 2007-05-21 21:21:57 UTC (rev 60)
+++ src/modules/print/print.c 2007-05-22 07:50:16 UTC (rev 61)
@@ -2,7 +2,7 @@
#include <cligg_module.h>
#include <cligg_eventhandler.h>
-int print(void *);
+static int print(void *);
cligg_module_init print_init(void)
{
@@ -10,7 +10,7 @@
cligg_register_event("print",print);
}
-int print(void *data)
+static int print(void *data)
{
fprintf(stderr,"test\n");
printf("out: %s\n",(char *)data);
Modified: src/modules/read/read.c
===================================================================
--- src/modules/read/read.c 2007-05-21 21:21:57 UTC (rev 60)
+++ src/modules/read/read.c 2007-05-22 07:50:16 UTC (rev 61)
@@ -3,15 +3,16 @@
#include <cligg_module.h>
#include <cligg_eventhandler.h>
-int read(void *data);
+static int read(void *data);
cligg_module_init print_init(void)
{
fprintf(stderr, "Read Module is loaded!\n");
cligg_register_event("read", read);
+ printf("ergister event cb: %x\n", read);
}
-int read(void *data)
+static int read(void *data)
{
char inp[101];
printf("input: ");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|