aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbeber <beber>2005-10-12 21:06:11 +0000
committerbeber <beber>2005-10-12 21:06:11 +0000
commitffb0b0bb55de21a09814502243e6d60ac01c3f37 (patch)
tree00f9eea80288f9e239f64a5f39edd4a259b95247
parentDude ! (diff)
downloadespik-ffb0b0bb55de21a09814502243e6d60ac01c3f37.tar.xz
How could I used #ifndef for #if ?
-rw-r--r--src/espik.c2
-rw-r--r--src/espik_common_handler.c6
-rw-r--r--src/espik_global.h6
-rw-r--r--src/espik_irc.c8
-rw-r--r--src/espik_net.c12
5 files changed, 18 insertions, 16 deletions
diff --git a/src/espik.c b/src/espik.c
index a51c66c..c19472f 100644
--- a/src/espik.c
+++ b/src/espik.c
@@ -60,7 +60,7 @@ int main (int argc, char **argv)
espik_config_set (a_infos);
-#ifdef _D_
+#if _ESPIK_DEBUG_
printf ("host: %s\n", a_infos.server->host);
printf ("port: %hd\n", a_infos.server->port);
printf ("nick: %s\n", a_infos.client->nickname);
diff --git a/src/espik_common_handler.c b/src/espik_common_handler.c
index 1075102..86d80f7 100644
--- a/src/espik_common_handler.c
+++ b/src/espik_common_handler.c
@@ -21,7 +21,7 @@ int server_data (void* data __UNUSED__, int ev_type __UNUSED__,
msg = strdup((char*)ev->data);
-#ifdef _D_
+#if _ESPIK_DEBUG_
printf ("%s\n", msg);
#endif
@@ -72,11 +72,11 @@ int kb_get (void* data __UNUSED__, Ecore_Fd_Handler* fd_handler)
if (count == 0)
{
tmp = irc_quit ("", "^D pressed");
-#ifdef _D_
+#if _ESPIK_DEBUG_
printf ("kb_get:\ntmp: %s\n", tmp);
#endif
espik_raw_send (tmp);
-#ifdef _D_
+#if _ESPIK_DEBUG_
printf ("AFTER espik_raw_send\n");
#endif
espik_raw_send (tmp);
diff --git a/src/espik_global.h b/src/espik_global.h
index 52ca34f..3bad3be 100644
--- a/src/espik_global.h
+++ b/src/espik_global.h
@@ -1,12 +1,12 @@
#ifndef _HAVE_ESPIK_GLOBAL_H
#define _HAVE_ESPIK_GLOBAL_H
-#define APPS_NAME "espik"
+#define APPS_NAME "espik"
#define ESPIK_VERSION "0.0.1"
-#define MAX_LEN 512
+#define MAX_LEN 512
-#define _D_ 0
+#define _ESPIK_DEBUG_ 1
#define __UNUSED__ __attribute__((unused))
diff --git a/src/espik_irc.c b/src/espik_irc.c
index 6ba01e4..4da2139 100644
--- a/src/espik_irc.c
+++ b/src/espik_irc.c
@@ -64,7 +64,7 @@ void string_upper (char *str)
if (str[i] >= 0x61 && str[i] <= 0x7A)
str[i] -= 0x20;
}
-#ifdef _D_
+#if _ESPIK_DEBUG_
printf("string_upper: %s\n", str);
#endif
}
@@ -155,7 +155,7 @@ char* irc_quit (char* chan __UNUSED__, char* msg)
snprintf (out.buf, out.len, "QUIT :%s", msg);
-#ifdef _D_
+#if _ESPIK_DEBUG_
printf ("msg : %s\nout: %s\n", msg, out.buf);
#endif
@@ -183,7 +183,7 @@ char* irc_nick (char* chan __UNUSED__, char* nick)
snprintf (out.buf, out.len, "NICK %s", nick);
-#ifdef _D_
+#if _ESPIK_DEBUG_
printf ("NICK CHANGED REQUEST: %s\n", nick);
#endif
@@ -219,7 +219,7 @@ char* irc_send (char* msg)
cmd_and_message = separate_commandline (msg + 1);
-#if _D_
+#if _ESPIK_DEBUG_
printf ("irc_send: <separate_commandline\n");
#endif
diff --git a/src/espik_net.c b/src/espik_net.c
index 14ef5fe..510ead1 100644
--- a/src/espik_net.c
+++ b/src/espik_net.c
@@ -4,11 +4,11 @@
#include <Ecore.h>
#include <Ecore_Con.h>
+#include "espik_global.h"
#include "espik_net.h"
#include "espik_common_handler.h"
#include "espik_error.h"
#include "espik.h"
-#include "espik_global.h"
#include <unistd.h>
#include <stdlib.h>
@@ -35,13 +35,13 @@ void espik_con_init (t_info serv_info)
void espik_con_shutdown ()
{
-#ifdef _D_
+#if _ESPIK_DEBUG_
printf ("> espik_con_shutdown\n");
#endif
ecore_con_server_del (con_sock);
ecore_con_shutdown ();
-#ifdef _D_
+#if _ESPIK_DEBUG_
printf ("< espik_con_shutdown\n");
#endif
/* ecore_main_loop_quit (); */
@@ -58,16 +58,18 @@ void espik_raw_send (char *msg)
snprintf (out, len, "%s\r\n", msg);
-#ifdef _D_
+#if _ESPIK_DEBUG_
printf ("espik_raw_send:\nmsg: %s\nout: %s\n", msg, out);
+#endif
/*
printf ("out[len-3]: 0x%X\n", out[len - 3]);
printf ("out[len-2]: 0x%X\n", out[len - 2]);
printf ("out[len-1]: 0x%X\n", out[len - 1]);
*/
+#if _ESPIK_DEBUG_
printf ("ecore_con_server_send: %d\n", ecore_con_server_send (con_sock,
- out, strlen (out)));
+ out, strlen (out)));
#endif
free (out);