aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBertrand Jacquin (Beber) <beber@setibzh.com>2006-01-23 01:36:53 +0100
committerBertrand Jacquin (Beber) <beber@setibzh.com>2006-01-23 01:36:53 +0100
commitf14f1b6fc32c6c1aa409a8eda5cdc33808f21861 (patch)
tree86c93987d26b61ae84195832f0bdecdf4bd96f82
parentadd a espik_free to avoid mem leak (diff)
downloadespik-f14f1b6fc32c6c1aa409a8eda5cdc33808f21861.tar.xz
Start reorganise all things
1. Input handler
-rw-r--r--src/Makefile.am8
-rw-r--r--src/espik.c8
-rw-r--r--src/espik_common_handler.c29
-rw-r--r--src/espik_config.c6
-rw-r--r--src/espik_debug.c3
-rw-r--r--src/espik_debug.h3
6 files changed, 16 insertions, 41 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index fdb137b..13b6393 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -7,23 +7,23 @@ AM_CFLAGS = \
ESPIKHEADERS = \
espik.h \
- espik_irc.h \
- espik_net.h \
espik_config.h \
espik_common_handler.h \
espik_error.h \
espik_debug.h \
espik_global.h
+## espik_net.h \
+## espik_irc.h \
espik_SOURCES = \
espik.c \
- espik_irc.c \
- espik_net.c \
espik_config.c \
espik_common_handler.c \
espik_error.c \
espik_debug.c \
$(ESPIKHEADERS)
+## espik_irc.c \
+## espik_net.c \
espik_LDADD = \
$(DEBUG_LDFLAGS) \
diff --git a/src/espik.c b/src/espik.c
index f991095..0628de2 100644
--- a/src/espik.c
+++ b/src/espik.c
@@ -66,17 +66,11 @@ int del_backslash (char *msg)
int main (int argc, char **argv)
{
Ecore_Fd_Handler *fd_kb;
-#ifdef _ESPIK_DEBUG_
- __indent_level = 0;
-#endif
espik_enter();
printf ("Welcome to %s %s\n", APPS_NAME, ESPIK_VERSION);
espik_init();
-#ifdef _ESPIK_DEBUG_
- //espik_debug_init();
-#endif
if (!ecore_init ())
{
printf ("Cannot init ecore; %d\n", 1);
@@ -134,7 +128,9 @@ int main (int argc, char **argv)
(Handler_Func) server_data, NULL);
*/
+ /*
espik_con_init (a_infos);
+ */
/* Init IRC connection */
diff --git a/src/espik_common_handler.c b/src/espik_common_handler.c
index 118b757..3f3ee2e 100644
--- a/src/espik_common_handler.c
+++ b/src/espik_common_handler.c
@@ -71,7 +71,7 @@ static char* convert_unicode_utf(const wchar_t *punicode)
}
#endif
-
+#if 0
int server_data (void* data __UNUSED__, int ev_type __UNUSED__,
Ecore_Con_Event_Server_Data* ev)
{
@@ -114,11 +114,11 @@ int server_data (void* data __UNUSED__, int ev_type __UNUSED__,
espik_leave();
return (0);
}
+#endif
int kb_get (void* data __UNUSED__, Ecore_Fd_Handler* fd_handler)
{
char* kb;
- char* tmp;
int count;
espik_enter();
@@ -133,13 +133,8 @@ int kb_get (void* data __UNUSED__, Ecore_Fd_Handler* fd_handler)
if (count > 1)
{
del_backslash (kb);
- tmp = irc_send (kb);
- if (tmp)
- {
- espik_raw_send (tmp);
- free (tmp);
- }
+ espik_debug_print ("%s", kb);
}
}
while (count >= 198);
@@ -147,24 +142,6 @@ int kb_get (void* data __UNUSED__, Ecore_Fd_Handler* fd_handler)
if (count == -1)
perror ("read");
- if (count == 0)
- {
- tmp = irc_quit (NULL, "^D pressed");
- espik_debug_print ("tmp: %s", tmp);
- espik_raw_send (tmp);
- espik_debug_print ("AFTER espik_raw_send");
- //espik_raw_send (tmp);
-
- /*
- irc_disconnect();
- */
- espik_con_shutdown ();
-
- free (tmp);
- espik_leave();
- return (0);
- }
-
espik_leave();
return (1);
}
diff --git a/src/espik_config.c b/src/espik_config.c
index 6587b98..b8f7f71 100644
--- a/src/espik_config.c
+++ b/src/espik_config.c
@@ -87,10 +87,8 @@ void espik_config_init ()
if ((ret = ecore_config_init (APPS_NAME)) != ECORE_CONFIG_ERR_SUCC)
{
espik_debug_print ("Init ecore_config failed (%d)", ret);
- kill_me (2);
- /*
- exit (ret);
- */
+ //kill_me (2);
+ //exit (ret);
}
if ((ret = ecore_config_load ()) != ECORE_CONFIG_ERR_SUCC)
diff --git a/src/espik_debug.c b/src/espik_debug.c
index 9badbd4..dfb7cdd 100644
--- a/src/espik_debug.c
+++ b/src/espik_debug.c
@@ -12,6 +12,7 @@
#include <signal.h>
#endif /* _ESPIK_DEBUG_ */
+#if 0
inline void espik_debug_bt (int num)
{
#if 0
@@ -65,3 +66,5 @@ void kill_me (short num)
espik_debug_bt(num);
exit (num);
}
+
+#endif
diff --git a/src/espik_debug.h b/src/espik_debug.h
index fa28452..52c8ce0 100644
--- a/src/espik_debug.h
+++ b/src/espik_debug.h
@@ -21,7 +21,6 @@
#endif /* _ESPIK_DEBUG_ && __GNUC__ */
#ifdef _ESPIK_DEBUG_
-int __indent_level;
/*
#define espik_enter() \
@@ -55,8 +54,10 @@ int __indent_level;
#endif /* _ESPIK_DEBUG_ */
+#if 0
inline void espik_bt (void);
void espik_debug_init();
void kill_me (short num);
+#endif
#endif /* HAVE_ESPIK_DEBUG_H */