aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbeber <beber>2005-10-08 22:35:53 +0000
committerbeber <beber>2005-10-08 22:35:53 +0000
commit425c49731be282bd126fb933da09a2677095be18 (patch)
treea2742a2a30ddcd0064c662a1fddb223208031ca3 /src
parentreally fuck them (diff)
downloadespik-425c49731be282bd126fb933da09a2677095be18.tar.xz
add /nick
move global.h -> espik_global.h
Diffstat (limited to 'src')
-rw-r--r--src/espik.c2
-rw-r--r--src/espik_irc.c30
-rw-r--r--src/espik_irc.h20
-rw-r--r--src/global.h1
4 files changed, 45 insertions, 8 deletions
diff --git a/src/espik.c b/src/espik.c
index a976767..64aa00c 100644
--- a/src/espik.c
+++ b/src/espik.c
@@ -9,7 +9,7 @@
//#include <Ecore_Con.h> /* Socket lib */
/* Ebic Stuff */
-#include "global.h"
+#include "espik_global.h"
#include "espik_config.h"
#include "espik_irc.h"
#include "espik_common_handler.h"
diff --git a/src/espik_irc.c b/src/espik_irc.c
index 84208f0..e26359f 100644
--- a/src/espik_irc.c
+++ b/src/espik_irc.c
@@ -21,13 +21,14 @@ typedef struct
} cmd_t;
cmd_t cmd_tab[] = {
- {"JOIN", irc_join},
- {"PART", irc_part},
- {"PRIVMSG", irc_privmsg},
- {"QUIT", irc_quit},
- {"RAW", irc_raw},
-/* {"ACTION", irc_action}, */
- {0, 0}
+ { "JOIN", irc_join },
+ { "PART", irc_part },
+ { "PRIVMSG", irc_privmsg },
+ { "QUIT", irc_quit },
+ { "RAW", irc_raw },
+ { "NICK", irc_nick },
+/* { "ACTION", irc_action }, */
+ { 0, 0 }
};
char** separate_commandline (char *msg)
@@ -162,6 +163,21 @@ char* irc_raw (char* chan __UNUSED__, char* msg)
return (msg);
}
+char* irc_nick (char* chan __UNUSED__, char* nick)
+{
+ char* out;
+ int len;
+
+ len = strlen ("NICK") + 2
+ + strlen (nick) + 1;
+
+ out = malloc (sizeof (char*) * len);
+
+ snprintf (out, len, "NICK :%s", nick);
+
+ printf ("NICK CHANGED REQUEST: %s\n", nick);
+}
+
/*
Ecore_Con_Server* irc_connect (char* host __UNUSED__, int port __UNUSED__)
{
diff --git a/src/espik_irc.h b/src/espik_irc.h
new file mode 100644
index 0000000..a02387e
--- /dev/null
+++ b/src/espik_irc.h
@@ -0,0 +1,20 @@
+#ifndef _HAVE_ESPIK_IRC_H
+#define _HAVE_ESPIK_IRC_H
+
+unsigned short sendmsg_len (char *);
+char *irc_send (char *);
+char *irc_privmsg (char *, char *);
+
+//char *irc_action (char *, char *);
+char *irc_join (char *, char *);
+char *irc_part (char *, char *);
+char *irc_quit (char *, char *);
+char *irc_raw (char *, char *);
+char* irc_nick(char*, char*);
+char **separate_commandline (char *);
+void string_upper (char *);
+
+//Ecore_Con_Server *irc_connect (char *, int);
+//void irc_disconnect (Ecore_Con_Server *);
+
+#endif /* _HAVE_ESPIK_IRC_H */
diff --git a/src/global.h b/src/global.h
index 0869c3e..e7b5bc0 100644
--- a/src/global.h
+++ b/src/global.h
@@ -5,6 +5,7 @@
#define ESPIK_VERSION "0.0.1"
#define MAX_LEN 512
+#define STDIN_FILENO 1
#define __UNUSED__ __attribute__((unused))