ayttm-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Ayttm-commits] CVS: ayttm/modules/irc irc.c,1.3,1.4


From: Andy Maloney <address@hidden>
Subject: [Ayttm-commits] CVS: ayttm/modules/irc irc.c,1.3,1.4
Date: Fri, 24 Jan 2003 06:44:09 -0500

Update of /cvsroot/ayttm/ayttm/modules/irc
In directory subversions:/tmp/cvs-serv28701/modules/irc

Modified Files:
        irc.c 
Log Message:
Yet more include cleanups and addition of statics
Changed name of clear_info_window() to eb_info_window_clear() for consistency


Index: irc.c
===================================================================
RCS file: /cvsroot/ayttm/ayttm/modules/irc/irc.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- irc.c       16 Jan 2003 09:51:03 -0000      1.3
+++ irc.c       24 Jan 2003 11:44:05 -0000      1.4
@@ -1,7 +1,7 @@
 /*
  * IRC protocol support for Everybuddy
  *
- * Copyright (C) 2001, Erik Inge Bolsø <address@hidden>
+ * Copyright (C) 2001, Erik Inge Bolso <address@hidden>
  *                     and others
  *
  * This program is free software; you can redistribute it and/or modify
@@ -23,12 +23,9 @@
 /*
  * irc.c
  */
-#ifdef HAVE_CONFIG_H
-#    include <config.h>
-#endif
 
 #include "intl.h"
-#include <gtk/gtk.h>
+
 #include <string.h>
 #include <strings.h>
 #include <sys/types.h>
@@ -42,10 +39,10 @@
 #endif
 #include <unistd.h>
 #include <stdlib.h>
-#include <stdio.h>
 #include <ctype.h>
 #include <errno.h>
 #include <fcntl.h>
+
 #include "gtk_globals.h"
 #include "service.h"
 #include "util.h"
@@ -76,8 +73,8 @@
 #define plugin_finish irc_LTX_plugin_finish
 
 /* Function Prototypes */
-int plugin_init();
-int plugin_finish();
+static int plugin_init();
+static int plugin_finish();
 
 static int ref_count = 0;
 
@@ -97,14 +94,14 @@
 
 static char *eb_irc_get_color(void) { static char color[]="#880088"; return 
color; }
 
-int plugin_init()
+static int plugin_init()
 {
        eb_debug(DBG_MOD, "IRC\n");
        ref_count=0;
        return(0);
 }
 
-int plugin_finish()
+static int plugin_finish()
 {
        eb_debug(DBG_MOD, "Returning the ref_count: %i\n", ref_count);
        return(ref_count);
@@ -173,7 +170,7 @@
        IRC_OFFLINE
 };
 
-char *irc_states[] =
+static char *irc_states[] =
 {
        "",
        "(Away)",
@@ -185,44 +182,44 @@
 /* Local prototypes */
 static unsigned char *strip_color (unsigned char *text);
            static int sendall(int s, char *buf, int len);
-             gboolean irc_query_connected (eb_account * account);
+      static gboolean irc_query_connected (eb_account * account);
           static void irc_parse_incoming_message (eb_local_account * ela, 
gchar *buff);
           static void irc_parse (eb_local_account * ela, gchar *buff);
-                 void irc_callback (void *data, int source, eb_input_condition 
condition);
+          static void irc_callback (void *data, int source, eb_input_condition 
condition);
           static void irc_ask_after_users ( eb_local_account * account );
           static gint irc_keep_alive( gpointer data );
-                 void irc_login( eb_local_account * account);
-                 void irc_logout( eb_local_account * ela );
-                 void irc_send_im( eb_local_account * account_from, eb_account 
* account_to,gchar *message );
-   eb_local_account * irc_read_local_config(GList * pairs);
-              GList * irc_write_local_config( eb_local_account * account );
-         eb_account * irc_read_config(GList *config, struct contact *contact);
-              GList * irc_get_states();
-                 gint irc_get_current_state(eb_local_account * account );
-                 void irc_set_current_state(eb_local_account * account, gint 
state );
-              char * irc_check_login(char * user, char * pass);
-                 void irc_add_user( eb_account * account );
-                 void irc_del_user( eb_account * account );
-             gboolean irc_is_suitable (eb_local_account *local, eb_account 
*remote);
-         eb_account * irc_new_account( gchar * account );
-              gchar * irc_get_status_string( eb_account * account );
-                 void irc_init_pixmaps();
-                 void irc_get_status_pixmap( eb_account * account, GdkPixmap 
** pm, GdkBitmap ** bm );
-                 void irc_set_idle(eb_local_account * account, gint idle );
-                 void irc_set_away( eb_local_account * account, gchar * 
message);
-                 void irc_send_file( eb_local_account * from, eb_account * to, 
char * file );
-                 void irc_info_update(info_window * iw);
-                 void irc_info_data_cleanup(info_window * iw);
-                 void irc_get_info( eb_local_account * account_from, 
eb_account * account_to);
-                 void irc_join_chat_room(eb_chat_room *room);
-                 void irc_leave_chat_room(eb_chat_room *room);
-                 void irc_send_chat_room_message(eb_chat_room *room, gchar 
*message);
-                 void irc_send_invite( eb_local_account * account, 
eb_chat_room * room, gchar * user, gchar * message);
-       eb_chat_room * irc_make_chat_room(gchar * name, eb_local_account * 
account);
-                 void irc_accept_invite( eb_local_account * account, void * 
invitation );
-                 void irc_decline_invite( eb_local_account * account, void * 
invitation );
-                 void eb_irc_read_prefs_config(GList * values);
-              GList * eb_irc_write_prefs_config();
+          static void irc_login( eb_local_account * account);
+          static void irc_logout( eb_local_account * ela );
+          static void irc_send_im( eb_local_account * account_from, eb_account 
* account_to,gchar *message );
+static eb_local_account * irc_read_local_config(GList * pairs);
+       static GList * irc_write_local_config( eb_local_account * account );
+  static eb_account * irc_read_config(GList *config, struct contact *contact);
+       static GList * irc_get_states();
+          static gint irc_get_current_state(eb_local_account * account );
+          static void irc_set_current_state(eb_local_account * account, gint 
state );
+        static char * irc_check_login(char * user, char * pass);
+          static void irc_add_user( eb_account * account );
+          static void irc_del_user( eb_account * account );
+      static gboolean irc_is_suitable (eb_local_account *local, eb_account 
*remote);
+  static eb_account * irc_new_account( gchar * account );
+       static gchar * irc_get_status_string( eb_account * account );
+          static void irc_init_pixmaps();
+          static void irc_get_status_pixmap( eb_account * account, GdkPixmap 
** pm, GdkBitmap ** bm );
+          static void irc_set_idle(eb_local_account * account, gint idle );
+          static void irc_set_away( eb_local_account * account, gchar * 
message);
+          static void irc_send_file( eb_local_account * from, eb_account * to, 
char * file );
+          static void irc_info_update(info_window * iw);
+          static void irc_info_data_cleanup(info_window * iw);
+          static void irc_get_info( eb_local_account * account_from, 
eb_account * account_to);
+          static void irc_join_chat_room(eb_chat_room *room);
+          static void irc_leave_chat_room(eb_chat_room *room);
+          static void irc_send_chat_room_message(eb_chat_room *room, gchar 
*message);
+          static void irc_send_invite( eb_local_account * account, 
eb_chat_room * room, gchar * user, gchar * message);
+static eb_chat_room * irc_make_chat_room(gchar * name, eb_local_account * 
account);
+          static void irc_accept_invite( eb_local_account * account, void * 
invitation );
+          static void irc_decline_invite( eb_local_account * account, void * 
invitation );
+          static void eb_irc_read_prefs_config(GList * values);
+       static GList * eb_irc_write_prefs_config();
 
 /* taken from X-Chat 1.6.4: src/common/util.c */
 /* Added: stripping of CTCP/2 color/formatting attributes, which is
@@ -318,7 +315,7 @@
     return n==-1?-1:total; // return -1 on failure, bytes sent on success
 }
 
-gboolean irc_query_connected (eb_account * account)
+static gboolean irc_query_connected (eb_account * account)
 {
        irc_account * ia = NULL;
 
@@ -958,7 +955,7 @@
        return;
 }
 
-void irc_callback (void *data, int source, eb_input_condition condition)
+static void irc_callback (void *data, int source, eb_input_condition condition)
 {
        eb_local_account * ela = (eb_local_account *) data;
        irc_local_account * ila = (irc_local_account *) 
ela->protocol_local_account_data;
@@ -1107,7 +1104,7 @@
        return TRUE;
 }
 
-void irc_login( eb_local_account * account)
+static void irc_login( eb_local_account * account)
 {
        irc_local_account * ila = (irc_local_account *) 
account->protocol_local_account_data;
 
@@ -1187,7 +1184,7 @@
        return;
 }
 
-void irc_logout( eb_local_account * ela )
+static void irc_logout( eb_local_account * ela )
 {
        irc_local_account * ila = (irc_local_account *) 
ela->protocol_local_account_data;
 
@@ -1239,7 +1236,7 @@
        return;
 }
 
-void irc_send_im( eb_local_account * account_from,
+static void irc_send_im( eb_local_account * account_from,
                         eb_account * account_to,
                               gchar *message )
 {
@@ -1266,7 +1263,7 @@
        return;
 }
 
-eb_local_account * irc_read_local_config(GList * pairs)
+static eb_local_account * irc_read_local_config(GList * pairs)
 {
        eb_local_account * ela = g_new0(eb_local_account, 1);
        irc_local_account * ila = g_new0(irc_local_account, 1);
@@ -1322,7 +1319,7 @@
        return NULL;
 }
 
-GList * irc_write_local_config( eb_local_account * account )
+static GList * irc_write_local_config( eb_local_account * account )
 {
        GList * list = NULL;
        value_pair * vp;
@@ -1344,7 +1341,7 @@
        return list;
 }
 
-eb_account * irc_read_config(GList *config, struct contact *contact)
+static eb_account * irc_read_config(GList *config, struct contact *contact)
 {
        eb_account * ea = g_new0(eb_account, 1 );
        irc_account * ia = g_new0(irc_account, 1);
@@ -1399,7 +1396,7 @@
        return ea;
 }
 
-GList * irc_get_states()
+static GList * irc_get_states()
 {
        GList  * states = NULL;
        states = g_list_append(states, "Online");
@@ -1408,20 +1405,20 @@
        return states;
 }
 
-char * irc_check_login(char * user, char * pass)
+static char * irc_check_login(char * user, char * pass)
 {
        return NULL;
 }
 
 
-gint irc_get_current_state(eb_local_account * account )
+static gint irc_get_current_state(eb_local_account * account )
 {
        irc_local_account * ila = (irc_local_account *) 
account->protocol_local_account_data;
 
        return ila->status;
 }
 
-void irc_set_current_state(eb_local_account * account, gint state )
+static void irc_set_current_state(eb_local_account * account, gint state )
 {
        irc_local_account * ila = (irc_local_account *) 
account->protocol_local_account_data;
 
@@ -1442,7 +1439,7 @@
        return;
 }
 
-void irc_add_user( eb_account * account )
+static void irc_add_user( eb_account * account )
 {
        /* find the proper local account */
        irc_account *ia = (irc_account *) account->protocol_account_data;
@@ -1466,7 +1463,7 @@
        return;
 }
 
-void irc_del_user( eb_account * account )
+static void irc_del_user( eb_account * account )
 {
        /* find the proper local account */
        irc_account *ia = (irc_account *) account->protocol_account_data;
@@ -1490,7 +1487,7 @@
        return;
 }
 
-gboolean irc_is_suitable (eb_local_account *local, eb_account *remote)
+static gboolean irc_is_suitable (eb_local_account *local, eb_account *remote)
 {
        irc_account *ia = (irc_account *)remote->protocol_account_data;
        irc_local_account *ila = (irc_local_account 
*)local->protocol_local_account_data;
@@ -1500,7 +1497,7 @@
        return FALSE;
 }
 
-eb_local_account * irc_search_for_local_account (char *server)
+static eb_local_account * irc_search_for_local_account (char *server)
 {
        GList *node;
        
@@ -1522,7 +1519,7 @@
 /* This func expects account names of the form address@hidden,
    for example address@hidden, and will return
    NULL otherwise, very probably causing a crash. */
-eb_account * irc_new_account( gchar * account )
+static eb_account * irc_new_account( gchar * account )
 {
        eb_account * ea = g_new0(eb_account, 1);
        irc_account * ia = g_new0(irc_account, 1);
@@ -1571,7 +1568,7 @@
        return ea;
 }
 
-gchar * irc_get_status_string( eb_account * account )
+static gchar * irc_get_status_string( eb_account * account )
 {
        irc_account * ia = (irc_account *) account->protocol_account_data;
        static gchar string[255];
@@ -1614,7 +1611,7 @@
 static GdkPixmap * eb_irc_pixmap[IRC_OFFLINE+1];
 static GdkBitmap * eb_irc_bitmap[IRC_OFFLINE+1];
 
-void irc_init_pixmaps()
+static void irc_init_pixmaps()
 {
        gint i;
        gchar ** xpm;
@@ -1636,7 +1633,7 @@
        return;
 }
 
-void irc_get_status_pixmap( eb_account * account, GdkPixmap ** pm, GdkBitmap 
** bm )
+static void irc_get_status_pixmap( eb_account * account, GdkPixmap ** pm, 
GdkBitmap ** bm )
 {
        irc_account * ia;
        
@@ -1651,12 +1648,12 @@
 }
 
 /* Not needed with IRC, the server detects our idleness */
-void irc_set_idle(eb_local_account * account, gint idle )
+static void irc_set_idle(eb_local_account * account, gint idle )
 {
        return;
 }
 
-void irc_set_away( eb_local_account * account, gchar * message)
+static void irc_set_away( eb_local_account * account, gchar * message)
 {
        irc_local_account *ila = (irc_local_account 
*)account->protocol_local_account_data;
        char buf[BUF_LEN];
@@ -1706,12 +1703,12 @@
        return;
 }
 
-void irc_send_file( eb_local_account * from, eb_account * to, char * file )
+static void irc_send_file( eb_local_account * from, eb_account * to, char * 
file )
 {
        return;
 }
 
-void irc_info_update(info_window * iw)
+static void irc_info_update(info_window * iw)
 {
        gchar message[BUF_LEN*4];
        gchar temp[BUF_LEN];
@@ -1739,7 +1736,7 @@
                strcat(message, temp);
        }
 
-       clear_info_window(iw);
+       eb_info_window_clear(iw);
 
        if (ii->fullmessage)
        {
@@ -1753,7 +1750,7 @@
        return;
 }
 
-void irc_info_data_cleanup(info_window * iw)
+static void irc_info_data_cleanup(info_window * iw)
 {
        if (((irc_info *)(iw->info_data))->whois_info != NULL)
        {
@@ -1765,7 +1762,7 @@
        return;
 }
 
-void irc_get_info( eb_local_account * account_from, eb_account * account_to)
+static void irc_get_info( eb_local_account * account_from, eb_account * 
account_to)
 {
        char    *nick;
        char    *alpha;
@@ -1810,7 +1807,7 @@
        return;
 }
 
-void irc_join_chat_room(eb_chat_room *room)
+static void irc_join_chat_room(eb_chat_room *room)
 {
        gchar buff[BUF_LEN];
        signed int ret;
@@ -1823,7 +1820,7 @@
        return;
 }
 
-void irc_leave_chat_room(eb_chat_room *room)
+static void irc_leave_chat_room(eb_chat_room *room)
 {
        gchar buff[BUF_LEN];
        signed int ret;
@@ -1836,7 +1833,7 @@
        return;
 }
 
-void irc_send_chat_room_message(eb_chat_room *room, gchar *message)
+static void irc_send_chat_room_message(eb_chat_room *room, gchar *message)
 {
        gchar buff[BUF_LEN];
        char nick[255];
@@ -1858,7 +1855,7 @@
        return;
 }
 
-void irc_send_invite( eb_local_account * account, eb_chat_room * room,
+static void irc_send_invite( eb_local_account * account, eb_chat_room * room,
                                gchar * user, gchar * message)
 {
        gchar buff[BUF_LEN];
@@ -1887,7 +1884,7 @@
        return;
 }
 
-eb_chat_room * irc_make_chat_room(gchar * name, eb_local_account * account)
+static eb_chat_room * irc_make_chat_room(gchar * name, eb_local_account * 
account)
 {
        GList * node;
        eb_chat_room * ecr;
@@ -1954,7 +1951,7 @@
        return ecr;
 }
 
-void irc_accept_invite( eb_local_account * account, void * invitation )
+static void irc_accept_invite( eb_local_account * account, void * invitation )
 {
        eb_chat_room * ecr = irc_make_chat_room((char *) invitation, account);
        free(invitation);
@@ -1966,18 +1963,18 @@
        return;
 }
 
-void irc_decline_invite( eb_local_account * account, void * invitation )
+static void irc_decline_invite( eb_local_account * account, void * invitation )
 {
        free(invitation);
        return;
 }
 
-void eb_irc_read_prefs_config(GList * values)
+static void eb_irc_read_prefs_config(GList * values)
 {
        return;
 }
 
-GList * eb_irc_write_prefs_config()
+static GList * eb_irc_write_prefs_config()
 {
        return (NULL);
 }
@@ -2021,8 +2018,8 @@
        /* Done */ sc->write_prefs_config = eb_irc_write_prefs_config;
        sc->add_importers = NULL;
 
-        sc->get_color=eb_irc_get_color;
-        sc->get_smileys=eb_default_smileys;
+       sc->get_color=eb_irc_get_color;
+       sc->get_smileys=eb_default_smileys;
 
        return sc;
 }





reply via email to

[Prev in Thread] Current Thread [Next in Thread]