ayttm-commits
[Top][All Lists]
Advanced

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

[Ayttm-commits] CVS: ayttm/modules/icq icq.c,1.5,1.6


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

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

Modified Files:
        icq.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: icq.c
===================================================================
RCS file: /cvsroot/ayttm/ayttm/modules/icq/icq.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- icq.c       17 Jan 2003 23:29:06 -0000      1.5
+++ icq.c       24 Jan 2003 11:44:05 -0000      1.6
@@ -28,21 +28,13 @@
 #define __IN_PLUGIN__
 #endif
 #include "intl.h" 
-#include <gtk/gtk.h>
-#if defined( _WIN32 ) && !defined(__MINGW32__)
-#include "../libicq/libicq.h"
-#else
-#include "libicq/libicq.h"
-#include "libicq/send.h"
-#endif
 
-#include "message_parse.h"
 #include <assert.h>
 #include <stdlib.h>
 #include <string.h>
 #include <errno.h>
 #include <ctype.h>
-#include <sys/types.h>
+
 #ifdef __MINGW32__
 #include <winsock2.h>
 #else
@@ -50,22 +42,27 @@
 #include <netinet/in.h>
 #include <arpa/inet.h>
 #endif
+
+#include "message_parse.h"
 #include "status.h"
-#include "service.h"
 #include "icq_mod.h"
 #include "libicq/tcp.h"
-#include "chat_window.h"
 #include "info_window.h"
 #include "gtk_eb_html.h"
 #include "src/util.h"
 #include "value_pair.h"
 #include "dialog.h"
-#include "chat_room.h"
 #include "gtk_globals.h"
-#include "input_list.h"
 #include "plugin_api.h"
 #include "smileys.h"
 
+#if defined( _WIN32 ) && !defined(__MINGW32__)
+#include "../libicq/libicq.h"
+#else
+#include "libicq/libicq.h"
+#include "libicq/send.h"
+#endif
+
 #include "pixmaps/icq_online.xpm"
 #include "pixmaps/icq_away.xpm"
 
@@ -82,13 +79,13 @@
 #define plugin_finish icq_LTX_plugin_finish
 
 /* Function Prototypes */
-int plugin_init();
-int plugin_finish();
+static int plugin_init();
+static int plugin_finish();
 
 static int ref_count = 0;
 static char icq_server[MAX_PREF_LEN] = "icq.mirabilis.com";
 static char icq_port[MAX_PREF_LEN] = "4000";
-int do_icq_debug=0;
+static int do_icq_debug=0;
 
 
 /*  Module Exports */
@@ -107,7 +104,7 @@
 
 static char *eb_icq_get_color(void) { static char color[]="#008800"; return 
color; }
 
-int plugin_init()
+static int plugin_init()
 {
        input_list * il = g_new0(input_list, 1);
        eb_debug(DBG_MOD, "ICQ\n");
@@ -134,7 +131,7 @@
        return(0);
 }
 
-int plugin_finish()
+static int plugin_finish()
 {
        eb_debug(DBG_MOD, "Returning the ref_count: %i\n", ref_count);
        return(ref_count);
@@ -150,9 +147,11 @@
 static eb_local_account * icq_user_account = NULL;
 static gchar* ICQ_STATUS_STRINGS[] = {"", "(Away)", "(N/A)", "(Occ)", "(DND)", 
"(Offline)", "(Invis)", "(Chat)"};
 
-GList * icq_buddies = NULL;
+static GList * icq_buddies = NULL;
 
+/*     There are no prefs for ICQ at the moment.
 static input_list * icq_prefs = NULL;
+*/
 
 /*
  * Now here is just some stuff to deal with ICQ group chat
@@ -178,9 +177,9 @@
 } icq_info_data;
 
 
-GList * icq_chat_messages = NULL;
+static GList * icq_chat_messages = NULL;
 
-icq_buff * find_icq_buff( unsigned long uin )
+static icq_buff * find_icq_buff( unsigned long uin )
 {
        GList * node;
        for( node = icq_chat_messages; node; node = node->next )
@@ -196,7 +195,7 @@
 
 /*this is to make things look pretty*/
 
-char * icq_to_html( char  * r, char * g, char * b, char * style, char * input, 
int len )
+static char * icq_to_html( char  * r, char * g, char * b, char * style, char * 
input, int len )
 {
        GString * string = g_string_sized_new( 2048 );
        int i;
@@ -323,10 +322,10 @@
     gint select_id;
 } icq_local_account;
 
-gint connection = STATUS_OFFLINE;
+static gint connection = STATUS_OFFLINE;
 
 
-CONTACT_PTR getContact( glong uin )
+static CONTACT_PTR getContact( glong uin )
 {
        int i;
        for(i=0; i < Num_Contacts; i++)
@@ -337,13 +336,13 @@
        return 0;
 }
 
-gint icq_get_current_state(eb_local_account * account );
-void icq_logout( eb_local_account * account );
-void icq_login( eb_local_account * account );
-eb_chat_room * icq_make_chat_room( gchar * name, eb_local_account * account );
-void icq_info_update(info_window *iw); 
-void icq_info_data_cleanup(info_window *iw);
-void icq_get_info( eb_local_account * account_from, eb_account * account_to);
+static gint icq_get_current_state(eb_local_account * account );
+static void icq_logout( eb_local_account * account );
+static void icq_login( eb_local_account * account );
+static eb_chat_room * icq_make_chat_room( gchar * name, eb_local_account * 
account );
+static void icq_info_update(info_window *iw); 
+static void icq_info_data_cleanup(info_window *iw);
+static void icq_get_info( eb_local_account * account_from, eb_account * 
account_to);
 
 
 static void authorize_callback( GtkWidget * widget, gpointer data )
@@ -361,7 +360,7 @@
 /* the callbacks that get used by libicq  and get 
    triggered on incomming events*/
 
-void EventLogin( void * ignore )
+static void EventLogin( void * ignore )
 {
     eb_debug(DBG_ICQ, "EventLogin\n");
        set_status=STATUS_ONLINE;
@@ -393,7 +392,7 @@
 #define SRV_WHAT_THE_HELL 0x0064
 
 
-void EventDisconnect(void*data)
+static void EventDisconnect(void*data)
 {
        eb_debug(DBG_ICQ, "EventDisconnect\n");
        icq_logout(icq_user_account);
@@ -626,7 +625,7 @@
 
 }
 
-void EventMessage(void*data)
+static void EventMessage(void*data)
 {
        gchar buff[255];
        gchar message[1024];
@@ -740,7 +739,7 @@
 
 }
 
-void EventChangeStatus(void * data)
+static void EventChangeStatus(void * data)
 {
        USER_UPDATE_PTR user_update;
        eb_account * ea;
@@ -787,12 +786,12 @@
     eb_debug(DBG_ICQ, "EventChangeStatus %d %d\n", user_update->uin, 
user_update->status);
 }
 
-void EventSearchResults( void * ignore )
+static void EventSearchResults( void * ignore )
 {
     eb_debug(DBG_ICQ, "EventSearchResults\n");
 }
 
-void EventInfo(void*data)
+static void EventInfo(void*data)
 {
        gchar buff[255];
         USER_INFO_PTR ui = data;
@@ -850,7 +849,7 @@
        
 }
 
-void EventExtInfo( void * data )
+static void EventExtInfo( void * data )
 {
 
         USER_EXT_INFO_PTR ui = data;
@@ -890,7 +889,7 @@
     eb_debug(DBG_ICQ, "EventExtInfo\n");
 }
 
-void RegisterCallbacks()
+static void RegisterCallbacks()
 {
   ICQ_Register_Callback(EVENT_LOGIN, EventLogin);
   ICQ_Register_Callback(EVENT_DISCONNECT, EventDisconnect);
@@ -923,13 +922,13 @@
   return TRUE;
 }
 
-void RemoveTimers(icq_local_account * ila )
+static void RemoveTimers(icq_local_account * ila )
 {
        eb_timeout_remove(ila->select_id);
        eb_timeout_remove(ila->timeout_id);
 }
 
-void AddTimers(icq_local_account * ila)
+static void AddTimers(icq_local_account * ila)
 {
                ila->select_id = eb_timeout_add(100, SelectServer, NULL);
                ila->timeout_id = eb_timeout_add((guint32)60000, KeepAlive, 
NULL);
@@ -937,7 +936,7 @@
 
 /* the callbacks that get used by EveryBuddy */
 
-void icq_send_chat_room_message( eb_chat_room * room, char * message )
+static void icq_send_chat_room_message( eb_chat_room * room, char * message )
 {
        GList * node;
        icq_buff * ib;
@@ -957,7 +956,7 @@
 }
        
        
-gboolean icq_query_connected (eb_account * account)
+static gboolean icq_query_connected (eb_account * account)
 {
        CONTACT_PTR contact = getContact(atol(account->handle));
        struct icq_account_data * iad = account->protocol_account_data;
@@ -981,7 +980,7 @@
 
 }
 
-void icq_add_user( eb_account * account )
+static void icq_add_user( eb_account * account )
 {
        assert(eb_services[account->service_id].protocol_id == 
SERVICE_INFO.protocol_id);
        icq_buddies = g_list_append(icq_buddies, account->handle );
@@ -991,7 +990,7 @@
        }
 }
 
-eb_account * icq_new_account( gchar * account )
+static eb_account * icq_new_account( gchar * account )
 {
        eb_account * a = g_new0(eb_account, 1);
        struct icq_account_data * iad = g_new(struct icq_account_data, 1);
@@ -1004,13 +1003,13 @@
        return a;
 }
        
-void icq_del_user( eb_account * account )
+static void icq_del_user( eb_account * account )
 {
        assert(eb_services[account->service_id].protocol_id == 
SERVICE_INFO.protocol_id);
        ICQ_Delete_User( atol(account->handle));
 }
 
-void icq_login( eb_local_account * account)
+static void icq_login( eb_local_account * account)
 {
        GList * node;
        icq_local_account * ila;
@@ -1039,7 +1038,7 @@
        }
 }
 
-eb_account * icq_read_config(GList *config, struct contact *contact)
+static eb_account * icq_read_config(GList *config, struct contact *contact)
 {
        eb_account * ea = g_new0(eb_account, 1 );
        struct icq_account_data * iad =  g_new0(struct icq_account_data,1);
@@ -1066,7 +1065,7 @@
 }
        
        
-eb_local_account * icq_read_local_config(GList * pairs)
+static eb_local_account * icq_read_local_config(GList * pairs)
 {
        
        eb_local_account * ela = g_new0(eb_local_account, 1);
@@ -1088,7 +1087,7 @@
 }
 
        
-GList * icq_write_local_config( eb_local_account * account )
+static GList * icq_write_local_config( eb_local_account * account )
 {
        icq_local_account * ila = account->protocol_local_account_data;
        GList * list = NULL;
@@ -1111,7 +1110,7 @@
        return list;
 }
 
-void icq_logout( eb_local_account * account )
+static void icq_logout( eb_local_account * account )
 {
        GList * l;
        icq_local_account * ila;
@@ -1133,7 +1132,7 @@
        ref_count--;
 }
 
-void icq_send_im( eb_local_account * account_from,
+static void icq_send_im( eb_local_account * account_from,
                                  eb_account * account_to,
                                  gchar *message )
 {
@@ -1160,7 +1159,7 @@
        ICQ_Send_Message(contact->uin, message);
 }
 
-GList * icq_get_states()
+static GList * icq_get_states()
 {
        GList  * states = NULL;
        states = g_list_append(states, "Online");
@@ -1173,7 +1172,7 @@
        return states;
 }
 
-gint icq_get_current_state(eb_local_account * account )
+static gint icq_get_current_state(eb_local_account * account )
 {
        assert( eb_services[account->service_id].protocol_id  == 
SERVICE_INFO.protocol_id );
        switch(set_status)
@@ -1201,7 +1200,7 @@
        }
 }
 
-void icq_set_current_state(eb_local_account * account, gint state )
+static void icq_set_current_state(eb_local_account * account, gint state )
 {
        assert( eb_services[account->service_id].protocol_id  == 
SERVICE_INFO.protocol_id );
        switch(state)
@@ -1265,7 +1264,7 @@
        }
 }
 
-char * icq_check_login(char * user, char * pass)
+static char * icq_check_login(char * user, char * pass)
 {
        return NULL;
 }
@@ -1275,7 +1274,7 @@
 static GdkPixmap * icq_pixmap[ICQ_FREE_CHAT+1];
 static GdkBitmap * icq_bitmap[ICQ_FREE_CHAT+1];
 
-void icq_init_pixmaps()
+static void icq_init_pixmaps()
 {
        gint i;
        gchar ** xpm;
@@ -1310,7 +1309,7 @@
        pixmaps = 1;
 }
 
-void icq_get_status_pixmap( eb_account * account, GdkPixmap ** pm, GdkBitmap 
** bm )
+static void icq_get_status_pixmap( eb_account * account, GdkPixmap ** pm, 
GdkBitmap ** bm )
 {
        struct icq_account_data * iad;
        gint icq_status;
@@ -1353,7 +1352,7 @@
        *bm = icq_bitmap[icq_status];
 }
 
-gchar * icq_get_status_string( eb_account * account )
+static gchar * icq_get_status_string( eb_account * account )
 {
 
        struct icq_account_data * iad = account->protocol_account_data;
@@ -1393,7 +1392,7 @@
        }
 }
 
-void icq_set_idle(eb_local_account * account, gint idle )
+static void icq_set_idle(eb_local_account * account, gint idle )
 {
        if((idle == 0) && icq_get_current_state(account) == ICQ_AWAY )
        {
@@ -1426,7 +1425,7 @@
        }
 }
 
-void icq_send_file( eb_local_account * from, eb_account * to, char * file )
+static void icq_send_file( eb_local_account * from, eb_account * to, char * 
file )
 {
        int i;
        long remote_uin = atol(to->handle);
@@ -1446,14 +1445,14 @@
        }
 }
 
-void icq_send_invite( eb_local_account * account, eb_chat_room * room,
+static void icq_send_invite( eb_local_account * account, eb_chat_room * room,
                                           char * user, char * message )
 {
        long uin = atol(user);
        ICQ_Request_Chat(uin, message);
 }
 
-eb_chat_room * icq_make_chat_room( gchar * name, eb_local_account * account )
+static eb_chat_room * icq_make_chat_room( gchar * name, eb_local_account * 
account )
 {
        eb_chat_room * ecr = find_chat_room_by_id("ICQ");
        
@@ -1475,13 +1474,13 @@
        return ecr;
 }
 
-void icq_join_chat_room( eb_chat_room * room )
+static void icq_join_chat_room( eb_chat_room * room )
 {
        /* nothing to see here... */
        return;
 }
 
-void icq_leave_chat_room( eb_chat_room * room )
+static void icq_leave_chat_room( eb_chat_room * room )
 {
        GList * node;
 
@@ -1497,7 +1496,7 @@
 }
 
        
-void icq_accept_invite( eb_local_account * account, void * invitation )
+static void icq_accept_invite( eb_local_account * account, void * invitation )
 {
        long uin = (long)invitation;
        eb_chat_room * ecr = icq_make_chat_room("", icq_user_account ); 
@@ -1514,13 +1513,13 @@
 }
 
                
-void icq_decline_invite( eb_local_account * account, void * invitation )
+static void icq_decline_invite( eb_local_account * account, void * invitation )
 {
        long uin = (long)invitation;
        ICQ_Refuse_Chat(uin);
 }
 
-void icq_set_away( eb_local_account * account, gchar * message)
+static void icq_set_away( eb_local_account * account, gchar * message)
 {
        if (message)
        {
@@ -1551,7 +1550,7 @@
        }
 }
 
-void icq_get_info( eb_local_account * account_from, eb_account * account_to) {
+static void icq_get_info( eb_local_account * account_from, eb_account * 
account_to) {
   long remote_uin = atol(account_to->handle);
   if(!account_to->infowindow){
      account_to->infowindow = eb_info_window_new(account_from, account_to);
@@ -1575,10 +1574,10 @@
   //ICQ_Get_Away_Message(remote_uin);
 }
 
-void icq_info_update(info_window *iw) {
+static void icq_info_update(info_window *iw) {
      gchar buff[255];
      icq_info_data * iid = (icq_info_data *)iw->info_data;
-     clear_info_window(iw);
+     eb_info_window_clear(iw);
 
      gtk_eb_html_add(EXT_GTK_TEXT(iw->info),_("ICQ Info:<BR>"),0,0,0);
      if(iid->away != NULL) {
@@ -1627,19 +1626,22 @@
      
gtk_adjustment_set_value(gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(iw->scrollwindow)),0);
 }
 
-void icq_info_data_cleanup(info_window *iw){
+static void icq_info_data_cleanup(info_window *iw){
   icq_info_data *iid = (icq_info_data *)iw->info_data;
   if(iid->ext_info != NULL) free (iid->ext_info);
   if(iid->user_info != NULL) free (iid->user_info);
   if(iid->away != NULL) free (iid->away);
 }
 
-input_list * eb_icq_get_prefs()
+/*     There are no prefs for ICQ at the moment.
+
+static input_list * eb_icq_get_prefs()
 {
        return icq_prefs;
 }
+*/
 
-void eb_icq_read_prefs_config(GList * values)
+static void eb_icq_read_prefs_config(GList * values)
 {
        char * c;
        c = value_pair_get_value(values, "server");
@@ -1659,7 +1661,7 @@
        }
 }
 
-GList * eb_icq_write_prefs_config()
+static GList * eb_icq_write_prefs_config()
 {
        GList * config = NULL;
        char buffer[5];
@@ -1711,11 +1713,9 @@
        sc->read_prefs_config = eb_icq_read_prefs_config;
        sc->write_prefs_config = eb_icq_write_prefs_config;
 
-        sc->get_color=eb_icq_get_color;
-        sc->get_smileys=eb_default_smileys;
-
+       sc->get_color=eb_icq_get_color;
+       sc->get_smileys=eb_default_smileys;
 
        return sc;
 }
-
 





reply via email to

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