2004-10-18 [christoph] 0.9.12cvs127
authorChristoph Hohmann <reboot@gmx.ch>
Mon, 18 Oct 2004 16:24:17 +0000 (16:24 +0000)
committerChristoph Hohmann <reboot@gmx.ch>
Mon, 18 Oct 2004 16:24:17 +0000 (16:24 +0000)
* src/addrbook.c
* src/addrcache.c
* src/addressbook.c
* src/codeconv.c
* src/compose.c
* src/customheader.c
* src/editaddress.c
* src/editgroup.c
* src/exporthtml.c
* src/folder.c
* src/folderview.c
* src/imap.c
* src/jpilot.c
* src/main.c
* src/matcher_parser_parse.y
* src/mbox.c
* src/pop.c
* src/prefs_account.c
* src/prefs_gtk.c
* src/prefs_msg_colors.c
* src/procheader.c
* src/procmime.[ch]
* src/procmsg.c
* src/summaryview.c
* src/textview.c
* src/common/base64.c
* src/common/partial_download.c
* src/common/socket.c
* src/common/sylpheed.c
* src/common/utils.[ch]
* src/gtk/filesel.c
* src/gtk/pluginwindow.c
* src/gtk/quicksearch.c
* src/plugins/pgpmime/pgpmime.c
* src/plugins/pgpmime/plugin.c
* src/plugins/pgpmime/select-keys.c
* src/plugins/pgpmime/sgpgme.c
* src/plugins/spamassassin/libspamc.c
* src/plugins/trayicon/trayicon.c
* src/plugins/trayicon/libeggtrayicon/eggtrayicon.[ch]
* src/plugins/trayicon/libeggtrayicon/gtkplugxembed.c
o don't use any GNU C extensions
o fix warnings
o replace some non-POSIX functions

* src/plugins/spamassassin/spamassassin.[ch]
* src/plugins/spamassassin/spamassassin_gtk.c
* src/plugins/clamav/clamav_plugin.[ch]
* src/plugins/clamav/clamav_plugin_gtk.c
replace statusbar_print_all() from common code because it is a
GUI function

53 files changed:
ChangeLog.claws
PATCHSETS
configure.ac
src/addrbook.c
src/addrcache.c
src/addressbook.c
src/codeconv.c
src/common/base64.c
src/common/partial_download.c
src/common/socket.c
src/common/sylpheed.c
src/common/utils.c
src/common/utils.h
src/compose.c
src/customheader.c
src/editaddress.c
src/editgroup.c
src/exporthtml.c
src/folder.c
src/folderview.c
src/gtk/filesel.c
src/gtk/pluginwindow.c
src/gtk/quicksearch.c
src/imap.c
src/jpilot.c
src/main.c
src/matcher_parser_parse.y
src/mbox.c
src/plugins/clamav/clamav_plugin.c
src/plugins/clamav/clamav_plugin.h
src/plugins/clamav/clamav_plugin_gtk.c
src/plugins/pgpmime/pgpmime.c
src/plugins/pgpmime/plugin.c
src/plugins/pgpmime/select-keys.c
src/plugins/pgpmime/sgpgme.c
src/plugins/spamassassin/libspamc.c
src/plugins/spamassassin/spamassassin.c
src/plugins/spamassassin/spamassassin.h
src/plugins/spamassassin/spamassassin_gtk.c
src/plugins/trayicon/libeggtrayicon/eggtrayicon.c
src/plugins/trayicon/libeggtrayicon/eggtrayicon.h
src/plugins/trayicon/libeggtrayicon/gtkplugxembed.c
src/plugins/trayicon/trayicon.c
src/pop.c
src/prefs_account.c
src/prefs_gtk.c
src/prefs_msg_colors.c
src/procheader.c
src/procmime.c
src/procmime.h
src/procmsg.c
src/summaryview.c
src/textview.c

index 804d3f944e001d42651a9fe4c01dd951d59f84f6..742699e1833799b410fc0a6b41f7af18d9d4cfc2 100644 (file)
@@ -1,3 +1,57 @@
+2004-10-18 [christoph] 0.9.12cvs127
+
+       * src/addrbook.c
+       * src/addrcache.c
+       * src/addressbook.c
+       * src/codeconv.c
+       * src/compose.c
+       * src/customheader.c
+       * src/editaddress.c
+       * src/editgroup.c
+       * src/exporthtml.c
+       * src/folder.c
+       * src/folderview.c
+       * src/imap.c
+       * src/jpilot.c
+       * src/main.c
+       * src/matcher_parser_parse.y
+       * src/mbox.c
+       * src/pop.c
+       * src/prefs_account.c
+       * src/prefs_gtk.c
+       * src/prefs_msg_colors.c
+       * src/procheader.c
+       * src/procmime.[ch]
+       * src/procmsg.c
+       * src/summaryview.c
+       * src/textview.c
+       * src/common/base64.c
+       * src/common/partial_download.c
+       * src/common/socket.c
+       * src/common/sylpheed.c
+       * src/common/utils.[ch]
+       * src/gtk/filesel.c
+       * src/gtk/pluginwindow.c
+       * src/gtk/quicksearch.c
+       * src/plugins/pgpmime/pgpmime.c
+       * src/plugins/pgpmime/plugin.c
+       * src/plugins/pgpmime/select-keys.c
+       * src/plugins/pgpmime/sgpgme.c
+       * src/plugins/spamassassin/libspamc.c
+       * src/plugins/trayicon/trayicon.c
+       * src/plugins/trayicon/libeggtrayicon/eggtrayicon.[ch]
+       * src/plugins/trayicon/libeggtrayicon/gtkplugxembed.c
+               o don't use any GNU C extensions
+               o fix warnings
+               o replace some non-POSIX functions
+
+       * src/plugins/spamassassin/spamassassin.[ch]
+       * src/plugins/spamassassin/spamassassin_gtk.c
+       * src/plugins/clamav/clamav_plugin.[ch]
+       * src/plugins/clamav/clamav_plugin_gtk.c
+               replace statusbar_print_all() from common code because it is a
+               GUI function
+
 2004-10-17 [paul]
 
        * po/es.po
index 689797ff989e2a84488147306f3b5be16a27bb52..521bc581023f592c5908f446d72cb9d7802c6c54 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.1 -r 1.2 m4/spamassassin.m4; cvs diff -u -r 1.443 -r 1.444 src/compose.c; ) > 0.9.12cvs124.patchset
 ( cvs diff -u -r 1.73 -r 1.74 po/POTFILES.in; ) > 0.9.12cvs125.patchset
 ( cvs diff -u -r 1.444 -r 1.445 src/compose.c; ) > 0.9.12cvs126.patchset
+( cvs diff -u -r 1.23 -r 1.24 src/addrbook.c; cvs diff -u -r 1.16 -r 1.17 src/addrcache.c; cvs diff -u -r 1.74 -r 1.75 src/addressbook.c; cvs diff -u -r 1.72 -r 1.73 src/codeconv.c; cvs diff -u -r 1.445 -r 1.446 src/compose.c; cvs diff -u -r 1.7 -r 1.8 src/customheader.c; cvs diff -u -r 1.14 -r 1.15 src/editaddress.c; cvs diff -u -r 1.11 -r 1.12 src/editgroup.c; cvs diff -u -r 1.5 -r 1.6 src/exporthtml.c; cvs diff -u -r 1.260 -r 1.261 src/folder.c; cvs diff -u -r 1.249 -r 1.250 src/folderview.c; cvs diff -u -r 1.207 -r 1.208 src/imap.c; cvs diff -u -r 1.19 -r 1.20 src/jpilot.c; cvs diff -u -r 1.146 -r 1.147 src/main.c; cvs diff -u -r 1.35 -r 1.36 src/matcher_parser_parse.y; cvs diff -u -r 1.29 -r 1.30 src/mbox.c; cvs diff -u -r 1.68 -r 1.69 src/pop.c; cvs diff -u -r 1.115 -r 1.116 src/prefs_account.c; cvs diff -u -r 1.12 -r 1.13 src/prefs_gtk.c; cvs diff -u -r 1.2 -r 1.3 src/prefs_msg_colors.c; cvs diff -u -r 1.59 -r 1.60 src/procheader.c; cvs diff -u -r 1.86 -r 1.87 src/procmime.c; cvs diff -u -r 1.31 -r 1.32 src/procmime.h; cvs diff -u -r 1.168 -r 1.169 src/procmsg.c; cvs diff -u -r 1.448 -r 1.449 src/summaryview.c; cvs diff -u -r 1.125 -r 1.126 src/textview.c; cvs diff -u -r 1.2 -r 1.3 src/common/base64.c; cvs diff -u -r 1.4 -r 1.5 src/common/partial_download.c; cvs diff -u -r 1.15 -r 1.16 src/common/socket.c; cvs diff -u -r 1.10 -r 1.11 src/common/sylpheed.c; cvs diff -u -r 1.53 -r 1.54 src/common/utils.c; cvs diff -u -r 1.31 -r 1.32 src/common/utils.h; cvs diff -u -r 1.5 -r 1.6 src/gtk/filesel.c; cvs diff -u -r 1.7 -r 1.8 src/gtk/pluginwindow.c; cvs diff -u -r 1.8 -r 1.9 src/gtk/quicksearch.c; cvs diff -u -r 1.25 -r 1.26 src/plugins/clamav/clamav_plugin.c; cvs diff -u -r 1.3 -r 1.4 src/plugins/clamav/clamav_plugin.h; cvs diff -u -r 1.11 -r 1.12 src/plugins/clamav/clamav_plugin_gtk.c; cvs diff -u -r 1.5 -r 1.6 src/plugins/pgpmime/pgpmime.c; cvs diff -u -r 1.4 -r 1.5 src/plugins/pgpmime/plugin.c; cvs diff -u -r 1.1 -r 1.2 src/plugins/pgpmime/select-keys.c; cvs diff -u -r 1.3 -r 1.4 src/plugins/pgpmime/sgpgme.c; cvs diff -u -r 1.7 -r 1.8 src/plugins/spamassassin/libspamc.c; cvs diff -u -r 1.23 -r 1.24 src/plugins/spamassassin/spamassassin.c; cvs diff -u -r 1.5 -r 1.6 src/plugins/spamassassin/spamassassin.h; cvs diff -u -r 1.26 -r 1.27 src/plugins/spamassassin/spamassassin_gtk.c; cvs diff -u -r 1.16 -r 1.17 src/plugins/trayicon/trayicon.c; cvs diff -u -r 1.1 -r 1.2 src/plugins/trayicon/libeggtrayicon/eggtrayicon.c; cvs diff -u -r 1.1 -r 1.2 src/plugins/trayicon/libeggtrayicon/eggtrayicon.h; cvs diff -u -r 1.1 -r 1.2 src/plugins/trayicon/libeggtrayicon/gtkplugxembed.c; ) > 0.9.12cvs127.patchset
index b027c137fa1aecab300e44dca246e0d18291d76e..dd35bd06bee49a80ef67cd0122be2981cadf37e5 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=12
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=126
+EXTRA_VERSION=127
 EXTRA_RELEASE=
 
 if test \( $EXTRA_VERSION -eq 0 \) -o \( "x$EXTRA_RELEASE" != "x" \); then
index b7ced22f79988d72dbd31f01d8f4d51b35bef3cb..7235b4935373fa9a71d4542395634a5f89d36e99 100644 (file)
@@ -1935,7 +1935,7 @@ GList *addrbook_get_bookfile_list(AddressBookFile *book) {
                strcpy(buf, adbookdir);
                strcat(buf, entry->d_name);
                stat(buf, &statbuf);
-               if (S_IFREG & statbuf.st_mode) {
+               if (S_ISREG(statbuf.st_mode)) {
                        if (strncmp(
                                entry->d_name,
                                ADDRBOOK_PREFIX, lenpre) == 0)
index 1943ae3e2444e02b0f9c7220fae07aa457143a96..9efede68168503b3812f0470d2ffcb19ae318280 100644 (file)
@@ -270,7 +270,7 @@ gboolean addrcache_check_file( AddressCache *cache, gchar *path ) {
        struct stat filestat;
        retVal = TRUE;
        if( path ) {
-               if( 0 == lstat( path, &filestat ) ) {
+               if( 0 == stat( path, &filestat ) ) {
                        if( filestat.st_mtime == cache->modifyTime ) retVal = FALSE;
                }
        }
@@ -285,7 +285,7 @@ gboolean addrcache_mark_file( AddressCache *cache, gchar *path ) {
        gboolean retVal = FALSE;
        struct stat filestat;
        if( path ) {
-               if( 0 == lstat( path, &filestat ) ) {
+               if( 0 == stat( path, &filestat ) ) {
                        cache->modifyTime = filestat.st_mtime;
                        retVal = TRUE;
                }
index 5d4a79a2ea432e0951a3aca8079ff29c06ef01b2..f0732a416dd5847488dd51aa6faaadae2abc5c0c 100644 (file)
@@ -279,8 +279,6 @@ static void addressbook_treenode_remove_item        ( void );
 
 static AddressDataSource *addressbook_find_datasource
                                                (GtkCTreeNode   *node );
-static AddressDataSource *addressbook_find_datasource_for_object
-                                               ( AddrItemObject *ao );
 
 static AddressBookFile *addressbook_get_book_file(void);
 
@@ -3474,7 +3472,7 @@ static gint addressbook_treenode_compare_func(
        if( cell2 ) name2 = cell2->u.text;
        if( ! name1 ) return ( name2 != NULL );
        if( ! name2 ) return -1;
-       return strcasecmp( name1, name2 );
+       return g_strcasecmp( name1, name2 );
 }
 
 /*
@@ -3495,7 +3493,7 @@ static gint addressbook_list_compare_func(
                /* Order by name */
                if( ! name1 ) return ( name2 != NULL );
                if( ! name2 ) return -1;
-               return strcasecmp( name1, name2 );
+               return g_strcasecmp( name1, name2 );
        }
        else {
                /* Order groups before person */
@@ -4648,18 +4646,6 @@ static void addressbook_drag_leave_cb(GtkWidget      *widget,
        }
 }
 
-static AddressBookFile *get_rawDataSource(ItemFolder *item)
-{
-       AdapterDSource *ads = NULL;
-       AddressDataSource *ds = NULL;
-       ads = ADAPTER_DSOURCE(item);
-       if (ads == NULL ) return NULL;
-       ds = ads->dataSource;
-       if (ds == NULL ) return NULL;
-
-       return ds->rawDataSource;
-}
-
 static void addressbook_drag_received_cb(GtkWidget        *widget,
                                        GdkDragContext   *drag_context,
                                        gint              x,
@@ -4680,9 +4666,6 @@ static void addressbook_drag_received_cb(GtkWidget        *widget,
                AddressObject *obj = NULL;
                AdapterDSource *ads = NULL;
                AddressDataSource *ds = NULL;
-               AddrBookBase *adbase = NULL;
-               AddressCache *cache = NULL;
-
                
                if (gtk_clist_get_selection_info
                        (GTK_CLIST(widget), x - 24, y - 24, &row, &column) == 0) {
index fca77e2731fab1b20421337bcd5ce82d6366b1df..a54cc1744d3d7c254e2d991395d5172b63a7cbb9 100644 (file)
@@ -246,7 +246,7 @@ void conv_euctojis(gchar *outbuf, gint outlen, const gchar *inbuf)
        JISState state = JIS_ASCII;
 
        while (*in != '\0') {
-               if (isascii(*in)) {
+               if (IS_ASCII(*in)) {
                        K_OUT();
                        *out++ = *in++;
                } else if (iseuckanji(*in)) {
@@ -258,7 +258,7 @@ void conv_euctojis(gchar *outbuf, gint outlen, const gchar *inbuf)
                                K_OUT();
                                *out++ = SUBST_CHAR;
                                in++;
-                               if (*in != '\0' && !isascii(*in)) {
+                               if (*in != '\0' && !IS_ASCII(*in)) {
                                        *out++ = SUBST_CHAR;
                                        in++;
                                }
@@ -294,7 +294,7 @@ void conv_euctojis(gchar *outbuf, gint outlen, const gchar *inbuf)
                        } else {
                                K_OUT();
                                in++;
-                               if (*in != '\0' && !isascii(*in)) {
+                               if (*in != '\0' && !IS_ASCII(*in)) {
                                        *out++ = SUBST_CHAR;
                                        in++;
                                }
@@ -307,10 +307,10 @@ void conv_euctojis(gchar *outbuf, gint outlen, const gchar *inbuf)
                                *out++ = *in++ & 0x7f;
                        } else {
                                K_OUT();
-                               if (*in != '\0' && !isascii(*in)) {
+                               if (*in != '\0' && !IS_ASCII(*in)) {
                                        *out++ = SUBST_CHAR;
                                        in++;
-                                       if (*in != '\0' && !isascii(*in)) {
+                                       if (*in != '\0' && !IS_ASCII(*in)) {
                                                *out++ = SUBST_CHAR;
                                                in++;
                                        }
@@ -333,7 +333,7 @@ void conv_sjistoeuc(gchar *outbuf, gint outlen, const gchar *inbuf)
        guchar *out = outbuf;
 
        while (*in != '\0') {
-               if (isascii(*in)) {
+               if (IS_ASCII(*in)) {
                        *out++ = *in++;
                } else if (issjiskanji1(*in)) {
                        if (issjiskanji2(*(in + 1))) {
@@ -356,7 +356,7 @@ void conv_sjistoeuc(gchar *outbuf, gint outlen, const gchar *inbuf)
                        } else {
                                *out++ = SUBST_CHAR;
                                in++;
-                               if (*in != '\0' && !isascii(*in)) {
+                               if (*in != '\0' && !IS_ASCII(*in)) {
                                        *out++ = SUBST_CHAR;
                                        in++;
                                }
@@ -487,7 +487,7 @@ void conv_unreadable_eucjp(gchar *str)
        register guchar *p = str;
 
        while (*p != '\0') {
-               if (isascii(*p)) {
+               if (IS_ASCII(*p)) {
                        /* convert CR+LF -> LF */
                        if (*p == '\r' && *(p + 1) == '\n')
                                memmove(p, p + 1, strlen(p));
@@ -501,7 +501,7 @@ void conv_unreadable_eucjp(gchar *str)
                                /* substitute unprintable code */
                                *p++ = SUBST_CHAR;
                                if (*p != '\0') {
-                                       if (isascii(*p))
+                                       if (IS_ASCII(*p))
                                                p++;
                                        else
                                                *p++ = SUBST_CHAR;
@@ -533,7 +533,7 @@ void conv_unreadable_8bit(gchar *str)
                /* convert CR+LF -> LF */
                if (*p == '\r' && *(p + 1) == '\n')
                        memmove(p, p + 1, strlen(p));
-               else if (!isascii(*p)) *p = SUBST_CHAR;
+               else if (!IS_ASCII(*p)) *p = SUBST_CHAR;
                p++;
        }
 }
@@ -656,7 +656,7 @@ CharSet conv_guess_ja_encoding(const gchar *str)
                        if (guessed == C_US_ASCII)
                                return C_ISO_2022_JP;
                        p += 2;
-               } else if (isascii(*p)) {
+               } else if (IS_ASCII(*p)) {
                        p++;
                } else if (iseuckanji(*p) && iseuckanji(*(p + 1))) {
                        if (*p >= 0xfd && *p <= 0xfe)
@@ -907,11 +907,11 @@ gchar *conv_iconv_strdup(const gchar *inbuf,
                dest_code = conv_get_current_charset_str();
 
        /* don't convert if current codeset is US-ASCII */
-       if (!strcasecmp(dest_code, CS_US_ASCII))
+       if (!g_strcasecmp(dest_code, CS_US_ASCII))
                return g_strdup(inbuf);
 
        /* don't convert if src and dest codeset are identical */
-       if (!strcasecmp(src_code, dest_code))
+       if (!g_strcasecmp(src_code, dest_code))
                return g_strdup(inbuf);
 
        cd = iconv_open(dest_code, src_code);
@@ -1315,14 +1315,14 @@ CharSet conv_get_current_charset(void)
 
                /* "ja_JP.EUC" matches with "ja_JP.eucJP", "ja_JP.EUC" and
                   "ja_JP". "ja_JP" matches with "ja_JP.xxxx" and "ja" */
-               if (!strncasecmp(cur_locale, locale_table[i].locale,
+               if (!g_strncasecmp(cur_locale, locale_table[i].locale,
                                 strlen(locale_table[i].locale))) {
                        cur_charset = locale_table[i].charset;
                        return cur_charset;
                } else if ((p = strchr(locale_table[i].locale, '_')) &&
                         !strchr(p + 1, '.')) {
                        if (strlen(cur_locale) == 2 &&
-                           !strncasecmp(cur_locale, locale_table[i].locale, 2)) {
+                           !g_strncasecmp(cur_locale, locale_table[i].locale, 2)) {
                                cur_charset = locale_table[i].charset;
                                return cur_charset;
                        }
@@ -1367,14 +1367,14 @@ CharSet conv_get_outgoing_charset(void)
        for (i = 0; i < sizeof(locale_table) / sizeof(locale_table[0]); i++) {
                const gchar *p;
 
-               if (!strncasecmp(cur_locale, locale_table[i].locale,
+               if (!g_strncasecmp(cur_locale, locale_table[i].locale,
                                 strlen(locale_table[i].locale))) {
                        out_charset = locale_table[i].out_charset;
                        break;
                } else if ((p = strchr(locale_table[i].locale, '_')) &&
                         !strchr(p + 1, '.')) {
                        if (strlen(cur_locale) == 2 &&
-                           !strncasecmp(cur_locale, locale_table[i].locale, 2)) {
+                           !g_strncasecmp(cur_locale, locale_table[i].locale, 2)) {
                                out_charset = locale_table[i].out_charset;
                                break;
                        }
index 484cd286abba40a12b7c6e293d4b5070bdd67747..fca6e3e2d1dcfe12a20d57d082240671c81d8455 100644 (file)
@@ -22,6 +22,7 @@
 #include <string.h>
 
 #include "base64.h"
+#include "utils.h"
 
 static const gchar base64char[64] =
        "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
@@ -37,7 +38,7 @@ static const gchar base64val[128] = {
        41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1
 };
 
-#define BASE64VAL(c)   (isascii((guchar)c) ? base64val[(gint)(c)] : -1)
+#define BASE64VAL(c)   (IS_ASCII(c) ? base64val[(gint) (c)] : -1)
 
 void base64_encode(gchar *out, const guchar *in, gint inlen)
 {
index 1599d1a444e23001e824e4017e6aeedc51b113dd..65f6e3e8b56739777974049977ffb703641f7379 100644 (file)
@@ -204,9 +204,9 @@ static int partial_uidl_mark_mail(MsgInfo *msginfo, int download)
                                g_free(folder_id);
                        }
                        else if (download == POP3_PARTIAL_DLOAD_UNKN)
-                               stat = strdup("1");
+                               stat = g_strdup("1");
                        else if (download == POP3_PARTIAL_DLOAD_DELE)
-                               stat = strdup("0");
+                               stat = g_strdup("0");
                        
                        fprintf(fpnew, "%s\t%ld\t%s\n", 
                                uidl, recv_time, stat);
@@ -283,7 +283,7 @@ int partial_unmark(MsgInfo *msginfo)
 
 void partial_delete_old(const gchar *file) 
 {
-       gchar *id = strdup(file);
+       gchar *id = g_strdup(file);
        gchar *snum = strrchr(file, ':');
        int num = 0;
        FolderItem *item = NULL;
@@ -355,7 +355,7 @@ gchar *partial_get_filename(const gchar *server, const gchar *login,
                        }
                }
                if (!strcmp(muidl, uidl)) {
-                       result = strdup(tmp);
+                       result = g_strdup(tmp);
                        break;
                }
        }
index 5ed315e0d4f5712ee019f073e466835aab3e0b68..fd4e23d81e8319957f81eec1cd9b0a83168c1644 100644 (file)
@@ -994,8 +994,6 @@ static SockInfo *sockinfo_from_fd(const gchar *hostname,
        sockinfo->port = port;
        sockinfo->state = CONN_ESTABLISHED;
 
-       usleep(100000);
-
        return sockinfo;
 }
 
index 4e2ee2e9396755b4a28fc657597f1692f964a7a5..b39043e5981aee01d6e75020ffa1d69d14b4eb1f 100644 (file)
@@ -104,7 +104,7 @@ gboolean sylpheed_init(int *argc, char ***argv)
                }
        }
 
-       srandom((gint)time(NULL));
+       srand((gint) time(NULL));
 
 #if USE_OPENSSL
        ssl_init();
index a62bfea1fb0500d5dd41fba41d9448b9bd1fb250..80a5167b08a63118236c5fabeefcd9dfc2508ab8 100644 (file)
@@ -42,6 +42,7 @@
 #include <dirent.h>
 #include <time.h>
 #include <regex.h>
+#include <sys/utsname.h>
 
 #include "intl.h"
 #include "utils.h"
@@ -112,7 +113,7 @@ void hash_free_value_mem(GHashTable *table)
 
 gint str_case_equal(gconstpointer v, gconstpointer v2)
 {
-       return strcasecmp((const gchar *)v, (const gchar *)v2) == 0;
+       return g_strcasecmp((const gchar *)v, (const gchar *)v2) == 0;
 }
 
 guint str_case_hash(gconstpointer key)
@@ -276,7 +277,7 @@ gchar *strcasestr(const gchar *haystack, const gchar *needle)
                return NULL;
 
        while (haystack_len >= needle_len) {
-               if (!strncasecmp(haystack, needle, needle_len))
+               if (!g_strncasecmp(haystack, needle, needle_len))
                        return (gchar *)haystack;
                else {
                        haystack++;
@@ -570,7 +571,7 @@ gint subject_compare_for_sort(const gchar *s1, const gchar *s2)
        trim_subject_for_sort(str1);
        trim_subject_for_sort(str2);
 
-       return strcasecmp(str1, str2);
+       return g_strcasecmp(str1, str2);
 }
 
 void trim_subject_for_compare(gchar *str)
@@ -1717,17 +1718,16 @@ gchar *get_domain_name(void)
        static gchar *domain_name = NULL;
 
        if (!domain_name) {
-               gchar buf[128] = "";
                struct hostent *hp;
+               struct utsname uts;
 
-               if (gethostname(buf, sizeof(buf)) < 0) {
+               if (uname(&uts) < 0) {
                        perror("gethostname");
                        domain_name = "unknown";
                } else {
-                       buf[sizeof(buf) - 1] = '\0';
-                       if ((hp = my_gethostbyname(buf)) == NULL) {
+                       if ((hp = my_gethostbyname(uts.nodename)) == NULL) {
                                perror("gethostbyname");
-                               domain_name = g_strdup(buf);
+                               domain_name = g_strdup(uts.nodename);
                        } else {
                                domain_name = g_strdup(hp->h_name);
                        }
@@ -2526,6 +2526,8 @@ gint copy_file_part(FILE *fp, off_t offset, size_t length, const gchar *dest)
                unlink(dest);
                return -1;
        }
+
+       return 0;
 }
 
 /* convert line endings into CRLF. If the last line doesn't end with
@@ -2841,7 +2843,7 @@ gchar *generate_mime_boundary(const gchar *prefix)
         * doesn't do any harm.
         */
        for (i = 0; i < sizeof(buf_uniq) - 1; i++)
-               buf_uniq[i] = tbl[(random() ^ pid) % (sizeof(tbl) - 1)];
+               buf_uniq[i] = tbl[(rand() ^ pid) % (sizeof(tbl) - 1)];
        buf_uniq[i] = '\0';
 
        get_rfc822_date(buf_date, sizeof(buf_date));
@@ -3221,7 +3223,7 @@ time_t remote_tzoffset_sec(const gchar *zone)
                remoteoffset = 0;
        } else if (strlen(zone3) == 3) {
                for (p = ustzstr; *p != '\0'; p += 3) {
-                       if (!strncasecmp(p, zone3, 3)) {
+                       if (!g_strncasecmp(p, zone3, 3)) {
                                iustz = ((gint)(p - ustzstr) / 3 + 1) / 2 - 8;
                                remoteoffset = iustz * 3600;
                                break;
@@ -3483,7 +3485,7 @@ gint g_stricase_equal(gconstpointer gptr1, gconstpointer gptr2)
        const char *str1 = gptr1;
        const char *str2 = gptr2;
 
-       return !strcasecmp(str1, str2);
+       return !g_strcasecmp(str1, str2);
 }
 
 gint g_int_compare(gconstpointer a, gconstpointer b)
@@ -3514,7 +3516,7 @@ gchar *generate_msgid(const gchar *address, gchar *buf, gint len)
                   lt->tm_year + 1900, lt->tm_mon + 1,
                   lt->tm_mday, lt->tm_hour,
                   lt->tm_min, lt->tm_sec,
-                  (guint)random(), addr);
+                  (guint) rand(), addr);
 
        g_free(addr);
        return buf;
index 84de0d8b8917e1ffbcf83688499fc901f237f3b2..1dcd8a05d79dc30131186280c0440ea3919daa55 100644 (file)
        perror(func); \
 }
 
+#define IS_ASCII(c) (((guchar) c) <= 0177 ? 1 : 0)
+
 #ifdef __cplusplus
 extern "C" {
 #endif
index 17f52279cd5421cddb8f35c0041e11dcd6f22abc..e736b4ecf93d0e12fd05bbac516d1c3031b6f7ed 100644 (file)
@@ -2138,7 +2138,7 @@ static void compose_attach_append(Compose *compose, const gchar *file,
 
        if (content_type) {
                ainfo->content_type = g_strdup(content_type);
-               if (!strcasecmp(content_type, "message/rfc822")) {
+               if (!g_strcasecmp(content_type, "message/rfc822")) {
                        MsgInfo *msginfo;
                        MsgFlags flags = {0, 0};
                        gchar *name;
@@ -2251,7 +2251,7 @@ static void compose_attach_parts(Compose *compose, MsgInfo *msginfo)
                debug_print("First text part found\n");
        } else if (compose->mode == COMPOSE_REEDIT &&
                 child->type == MIMETYPE_APPLICATION &&
-                !strcasecmp(child->subtype, "pgp-encrypted")) {
+                !g_strcasecmp(child->subtype, "pgp-encrypted")) {
                AlertValue val;
                val = alertpanel(_("Encrypted message"),
                                 _("Cannot re-edit an encrypted message. \n"
@@ -3347,7 +3347,7 @@ static gint compose_write_to_file(Compose *compose, FILE *fp, gint action)
         mimemsg->type = MIMETYPE_MESSAGE;
         mimemsg->subtype = g_strdup("rfc822");
        mimemsg->content = MIMECONTENT_MEM;
-       mimemsg->data = compose_get_header(compose);
+       mimemsg->data.mem = compose_get_header(compose);
 
        /* Create text part MimeInfo */
        /* get all composed text */
@@ -3361,7 +3361,7 @@ static gint compose_write_to_file(Compose *compose, FILE *fp, gint action)
                const gchar *src_codeset;
 
                out_codeset = conv_get_outgoing_charset_str();
-               if (!strcasecmp(out_codeset, CS_US_ASCII))
+               if (!g_strcasecmp(out_codeset, CS_US_ASCII))
                        out_codeset = CS_ISO_8859_1;
 
                if (prefs_common.encoding_method == CTE_BASE64)
@@ -3376,7 +3376,7 @@ static gint compose_write_to_file(Compose *compose, FILE *fp, gint action)
                src_codeset = conv_get_current_charset_str();
                /* if current encoding is US-ASCII, set it the same as
                   outgoing one to prevent code conversion failure */
-               if (!strcasecmp(src_codeset, CS_US_ASCII))
+               if (!g_strcasecmp(src_codeset, CS_US_ASCII))
                        src_codeset = out_codeset;
 
                debug_print("src encoding = %s, out encoding = %s, transfer encoding = %s\n",
@@ -3414,7 +3414,7 @@ static gint compose_write_to_file(Compose *compose, FILE *fp, gint action)
 
        mimetext = procmime_mimeinfo_new();
        mimetext->content = MIMECONTENT_MEM;
-       mimetext->data = buf;
+       mimetext->data.mem = buf;
        mimetext->type = MIMETYPE_TEXT;
        mimetext->subtype = g_strdup("plain");
        g_hash_table_insert(mimetext->typeparameters, g_strdup("charset"),
@@ -3745,7 +3745,7 @@ static void compose_add_attachments(Compose *compose, MimeInfo *parent)
             row++) {
                mimepart = procmime_mimeinfo_new();
                mimepart->content = MIMECONTENT_FILE;
-               mimepart->filename = g_strdup(ainfo->file);
+               mimepart->data.filename = g_strdup(ainfo->file);
                mimepart->offset = 0;
 
                stat(ainfo->file, &statbuf);
@@ -4111,7 +4111,7 @@ static void compose_generate_msgid(gchar *buf, gint len)
                   lt->tm_year + 1900, lt->tm_mon + 1,
                   lt->tm_mday, lt->tm_hour,
                   lt->tm_min, lt->tm_sec,
-                  (guint)random(), addr);
+                  (guint) rand(), addr);
 
        debug_print("generated Message-ID: %s\n", buf);
 
index 803d62deae9cbc0375dd87eeb1b03c981dc94047..0337455bd4b6afb604ee23b4a1d4c36ae8773cad 100644 (file)
@@ -83,7 +83,7 @@ CustomHeader *custom_header_find(GSList *header_list, const gchar *header)
 
        for (cur = header_list; cur != NULL; cur = cur->next) {
                chdr = (CustomHeader *)cur->data;
-               if (!strcasecmp(chdr->name, header))
+               if (!g_strcasecmp(chdr->name, header))
                        return chdr;
        }
 
@@ -103,16 +103,16 @@ gboolean custom_header_is_allowed(const gchar *header)
 {
        g_return_val_if_fail(header != NULL, FALSE);
 
-       if (strcasecmp(header, "Date")         != 0 &&
-           strcasecmp(header, "From")         != 0 &&
-           strcasecmp(header, "To")           != 0 &&
-        /* strcasecmp(header, "Sender")       != 0 && */
-           strcasecmp(header, "Message-ID")   != 0 &&
-           strcasecmp(header, "In-Reply-To")  != 0 &&
-           strcasecmp(header, "References")   != 0 &&
-           strcasecmp(header, "Mime-Version") != 0 &&
-           strcasecmp(header, "Content-Type") != 0 &&
-           strcasecmp(header, "Content-Transfer-Encoding")
+       if (g_strcasecmp(header, "Date")         != 0 &&
+           g_strcasecmp(header, "From")         != 0 &&
+           g_strcasecmp(header, "To")           != 0 &&
+        /* g_strcasecmp(header, "Sender")       != 0 && */
+           g_strcasecmp(header, "Message-ID")   != 0 &&
+           g_strcasecmp(header, "In-Reply-To")  != 0 &&
+           g_strcasecmp(header, "References")   != 0 &&
+           g_strcasecmp(header, "Mime-Version") != 0 &&
+           g_strcasecmp(header, "Content-Type") != 0 &&
+           g_strcasecmp(header, "Content-Transfer-Encoding")
            != 0)
                return TRUE;
 
index 10e1be6479a1e1aa0cdd763a76e0c48110950050..09209f06fa37fb039cbd8570c245759807680fd4 100644 (file)
@@ -344,7 +344,7 @@ static gint edit_person_attrib_compare_func(
        if( cell2 ) name2 = cell2->u.text;
        if( ! name1 ) return ( name2 != NULL );
        if( ! name2 ) return -1;
-       return strcasecmp( name1, name2 );
+       return g_strcasecmp( name1, name2 );
 }
 
 /*
index a86bbf95cfceddb631c3105a4f893fc73f3edb21..d86b135d4703f1a4fccecfe34a2b0c3876a89d6a 100644 (file)
@@ -223,7 +223,7 @@ static gint edit_group_list_compare_func( GtkCList *clist, gconstpointer ptr1, g
        if( cell2 ) name2 = cell2->u.text;
        if( ! name1 ) return ( name2 != NULL );
        if( ! name2 ) return -1;
-       return strcasecmp( name1, name2 );
+       return g_strcasecmp( name1, name2 );
 }
 
 static void addressbook_edit_group_create( gboolean *cancelled ) {
index c57b026067b8222e1797971db1567422e4bc95bc..a0c28c936d2cfd899ea29dd66ce9741174793657 100644 (file)
@@ -438,7 +438,7 @@ static gint exporthtml_compare_name(
        if( item2 ) name2 = ADDRITEM_NAME( item2 );
        if( ! name1 ) return ( name2 != NULL );
        if( ! name2 ) return -1;
-       return strcasecmp( name1, name2 );
+       return g_strcasecmp( name1, name2 );
 }
 
 /*
@@ -454,7 +454,7 @@ static gint exporthtml_compare_email(
        if( email2 ) name2 = email2->address;
        if( ! name1 ) return ( name2 != NULL );
        if( ! name2 ) return -1;
-       return strcasecmp( name1, name2 );
+       return g_strcasecmp( name1, name2 );
 }
 
 /*
@@ -470,7 +470,7 @@ static gint exporthtml_compare_attrib(
        if( attr2 ) name2 = attr2->name;
        if( ! name1 ) return ( name2 != NULL );
        if( ! name2 ) return -1;
-       return strcasecmp( name1, name2 );
+       return g_strcasecmp( name1, name2 );
 }
 
 /*
index d05b7907f3c9075c4959d66a81dd2d320c307b37..130858e0962a2beb638aaa8d8f73a3ea9087f2f4 100644 (file)
@@ -413,17 +413,17 @@ void folder_item_set_xml(Folder *folder, FolderItem *item, XMLTag *tag)
 
                if (!attr || !attr->name || !attr->value) continue;
                if (!strcmp(attr->name, "type")) {
-                       if (!strcasecmp(attr->value, "normal"))
+                       if (!g_strcasecmp(attr->value, "normal"))
                                item->stype = F_NORMAL;
-                       else if (!strcasecmp(attr->value, "inbox"))
+                       else if (!g_strcasecmp(attr->value, "inbox"))
                                item->stype = F_INBOX;
-                       else if (!strcasecmp(attr->value, "outbox"))
+                       else if (!g_strcasecmp(attr->value, "outbox"))
                                item->stype = F_OUTBOX;
-                       else if (!strcasecmp(attr->value, "draft"))
+                       else if (!g_strcasecmp(attr->value, "draft"))
                                item->stype = F_DRAFT;
-                       else if (!strcasecmp(attr->value, "queue"))
+                       else if (!g_strcasecmp(attr->value, "queue"))
                                item->stype = F_QUEUE;
-                       else if (!strcasecmp(attr->value, "trash"))
+                       else if (!g_strcasecmp(attr->value, "trash"))
                                item->stype = F_TRASH;
                } else if (!strcmp(attr->name, "name")) {
                        if (item->name != NULL)
index 2c8713efcb032793e28e31bf9a6d5c2152a56fec..0e54913ac473db655f52d39015719739e2759169 100644 (file)
@@ -62,6 +62,7 @@
 #include "statusbar.h"
 #include "hooks.h"
 #include "folderutils.h"
+#include "common/partial_download.h"
 
 typedef enum
 {
index c830613bd7fec7e059f501258146cba807b06501..77855f1f4183fc49d3ab4531dab32b0283dc9628 100644 (file)
@@ -60,7 +60,7 @@ gchar *filesel_select_file(const gchar *title, const gchar *file)
        static gchar *filename = NULL;
        static gchar *cwd = NULL;
        gchar *startdir = NULL;
-       gchar *realfile = NULL;
+       const gchar *realfile = NULL;
 
        filesel_create(title, FALSE);
 
index 12b2d52dc6808787ecc136067e9a0f80ab5f9652..dd1cbde6a67994e8de8de6ced636979700f5dea1 100644 (file)
@@ -30,6 +30,7 @@
 
 #include "filesel.h"
 #include "alertpanel.h"
+#include "../inc.h"
 
 typedef struct _PluginWindow
 {
index 13961149deab0104ef833ef618c68dfe7ea892db..7744969ba99c1e98d8f2ff18a2b06c10b2a09aef 100644 (file)
@@ -21,6 +21,8 @@
 #  include "config.h"
 #endif
 
+#include <ctype.h>
+
 #include <gtk/gtk.h>
 #include <gdk/gdkkeysyms.h>
 
index c363db2e346ecd09ba56afb6c3bfcdb0f1596936..f7a0cd7c29b97573930109f92d85e8b71211354e 100644 (file)
@@ -1370,16 +1370,16 @@ static gint imap_scan_tree_recursive(IMAPSession *session, FolderItem *item)
 
                        base = g_basename(new_item->path);
 
-                       if (!folder->outbox && !strcasecmp(base, "Sent")) {
+                       if (!folder->outbox && !g_strcasecmp(base, "Sent")) {
                                new_item->stype = F_OUTBOX;
                                folder->outbox = new_item;
-                       } else if (!folder->draft && !strcasecmp(base, "Drafts")) {
+                       } else if (!folder->draft && !g_strcasecmp(base, "Drafts")) {
                                new_item->stype = F_DRAFT;
                                folder->draft = new_item;
-                       } else if (!folder->queue && !strcasecmp(base, "Queue")) {
+                       } else if (!folder->queue && !g_strcasecmp(base, "Queue")) {
                                new_item->stype = F_QUEUE;
                                folder->queue = new_item;
-                       } else if (!folder->trash && !strcasecmp(base, "Trash")) {
+                       } else if (!folder->trash && !g_strcasecmp(base, "Trash")) {
                                new_item->stype = F_TRASH;
                                folder->trash = new_item;
                        }
@@ -3188,10 +3188,10 @@ static gint imap_cmd_ok(IMAPSession *session, GPtrArray *argbuf)
 
        while ((ok = imap_gen_recv(session, &buf))
               == IMAP_SUCCESS) {
-               // make sure data is long enough for any substring of buf
+               /* make sure data is long enough for any substring of buf */
                data = alloca(strlen(buf) + 1);
 
-               // untagged line read
+               /* untagged line read */
                if (buf[0] == '*' && buf[1] == ' ') {
                        gint num;
                        if (argbuf)
@@ -3208,14 +3208,14 @@ static gint imap_cmd_ok(IMAPSession *session, GPtrArray *argbuf)
                                        session->folder_content_changed = TRUE;
                                }
                        }
-               // tagged line with correct tag and OK response found
+               /* tagged line with correct tag and OK response found */
                } else if ((sscanf(buf, "%d %s", &cmd_num, data) >= 2) &&
                           (cmd_num == session->cmd_count) &&
                           !strcmp(data, "OK")) {
                        if (argbuf)
                                g_ptr_array_add(argbuf, g_strdup(buf));
                        break;
-               // everything else
+               /* everything else */
                } else {
                        ok = IMAP_ERROR;
                        break;
@@ -3241,7 +3241,7 @@ static void imap_gen_send(IMAPSession *session, const gchar *format, ...)
        session->cmd_count++;
 
        buf = g_strdup_printf("%d %s\r\n", session->cmd_count, tmp);
-       if (!strncasecmp(tmp, "LOGIN ", 6) && (p = strchr(tmp + 6, ' '))) {
+       if (!g_strncasecmp(tmp, "LOGIN ", 6) && (p = strchr(tmp + 6, ' '))) {
                *p = '\0';
                log_print("IMAP4> %d %s ********\n", session->cmd_count, tmp);
        } else
@@ -3493,7 +3493,7 @@ static gchar *imap_locale_to_modified_utf7(const gchar *from)
        Xalloca(norm_utf7, norm_utf7_len + 1, return g_strdup(from));
        norm_utf7_p = norm_utf7;
 
-#define IS_PRINT(ch) (isprint(ch) && isascii(ch))
+#define IS_PRINT(ch) (isprint(ch) && IS_ASCII(ch))
 
        while (from_len > 0) {
                if (*from_tmp == '+') {
index 42cc1172f434bca3b5db680d1a089c899bccb851..66b329f09a9ec302f0c40798d3f13022a54bcd6b 100644 (file)
@@ -339,7 +339,7 @@ static gboolean jpilot_mark_files( JPilotFile *pilotFile ) {
        pilotFile->pc3ModifyTime = 0;
        pcFile = jpilot_get_pc3_file( pilotFile );
        if( pcFile == NULL ) return retVal;
-       if( 0 == lstat( pcFile, &filestat ) ) {
+       if( 0 == stat( pcFile, &filestat ) ) {
                pilotFile->havePC3 = TRUE;
                pilotFile->pc3ModifyTime = filestat.st_mtime;
                retVal = TRUE;
@@ -368,7 +368,7 @@ static gboolean jpilot_check_files( JPilotFile *pilotFile ) {
        pcFile = jpilot_get_pc3_file( pilotFile );
        if( pcFile == NULL ) return FALSE;
 
-       if( 0 == lstat( pcFile, &filestat ) ) {
+       if( 0 == stat( pcFile, &filestat ) ) {
                if( filestat.st_mtime == pilotFile->pc3ModifyTime ) retVal = FALSE;
        }
        g_free( pcFile );
index ab9dce3ae6c91a01e5b837c2bc357bcf50428f00..99bb2b5ddd669bc63a310e2475c1e66fc6199518 100644 (file)
@@ -23,6 +23,8 @@
 
 #include "defs.h"
 
+#include <features.h>
+
 #include <glib.h>
 #include <gtk/gtkmain.h>
 #include <gtk/gtkrc.h>
index 07d95bb563ad192d87454febd19f6e12bd7305da..47394fb20d32dc6ac81cff715200a5eea9b10778 100644 (file)
@@ -44,7 +44,6 @@ static MatcherProp *prop;
 static GSList *matchers_list = NULL;
 
 static MatcherList *cond;
-static gint score = 0;
 static GSList *action_list = NULL;
 static FilteringAction *action = NULL;
 
index e3acab8078e09f334e1db1caa7775d2720d3b23f..4527a3e52e33e7325834d66db9212801760b5be8 100644 (file)
@@ -355,17 +355,14 @@ gint copy_mbox(const gchar *src, const gchar *dest)
 
 void empty_mbox(const gchar *mbox)
 {
-       if (truncate(mbox, 0) < 0) {
-               FILE *fp;
-
-               FILE_OP_ERROR(mbox, "truncate");
-               if ((fp = fopen(mbox, "wb")) == NULL) {
-                       FILE_OP_ERROR(mbox, "fopen");
-                       g_warning("can't truncate mailbox to zero.\n");
-                       return;
-               }
-               fclose(fp);
+       FILE *fp;
+
+       if ((fp = fopen(mbox, "wb")) == NULL) {
+               FILE_OP_ERROR(mbox, "fopen");
+               g_warning("can't truncate mailbox to zero.\n");
+               return;
        }
+       fclose(fp);
 }
 
 /* read all messages in SRC, and store them into one MBOX file. */
index 35be5cf22f40d0b2a3e3ac6e94b2e458641a8e22..4116bb12602d7a06b3ffd12c3e46cc3beb1b7f2d 100644 (file)
@@ -41,6 +41,7 @@
 #include "clamav_plugin.h"
 
 static guint hook_id;
+static MessageCallback message_callback;
 
 static ClamAvConfig config;
 
@@ -113,7 +114,8 @@ static gboolean mail_filtering_hook(gpointer source, gpointer data)
        if (!mimeinfo) return FALSE;
 
        debug_print("Scanning message %d for viruses\n", msginfo->msgnum);
-       statusbar_print_all(_("ClamAV: scanning message..."));
+       if (message_callback != NULL)
+               message_callback(_("ClamAV: scanning message..."));
 
        params.is_infected = FALSE;
        params.root = NULL;
@@ -186,6 +188,11 @@ void clamav_save_config(void)
        prefs_file_close(pfile);
 }
 
+void clamav_set_message_callback(MessageCallback callback)
+{
+       message_callback = callback;
+}
+
 gint plugin_init(gchar **error)
 {
        if ((sylpheed_get_version() > VERSION_NUMERIC)) {
index c2ed7d7dd58c5b3708f0c6eaf9ec538ac88deffb..61fe2be5d1ef205a53071754b78fda3e2ed7a399 100644 (file)
@@ -24,6 +24,8 @@
 
 typedef struct _ClamAvConfig ClamAvConfig;
 
+typedef void (*MessageCallback) (gchar *);
+
 struct _ClamAvConfig
 {
        gboolean         clamav_enable;
@@ -33,7 +35,8 @@ struct _ClamAvConfig
        gchar           *clamav_save_folder;
 };
 
-ClamAvConfig *clamav_get_config                (void);
-void         clamav_save_config        (void);
+ClamAvConfig *clamav_get_config                  (void);
+void         clamav_save_config          (void);
+void         clamav_set_message_callback (MessageCallback callback);
 
 #endif
index ad13090110e4246a35ad4ab3a0ca83c486c5d4b0..2d0ac1391e7ed595092a2c7a8fcd25fb50af56a6 100644 (file)
@@ -36,6 +36,7 @@
 #include "prefs_gtk.h"
 #include "foldersel.h"
 #include "clamav_plugin.h"
+#include "statusbar.h"
 
 struct ClamAvPage
 {
@@ -225,6 +226,11 @@ static void clamav_save_func(PrefsPage *_page)
 
 static struct ClamAvPage clamav_page;
 
+static void gtk_message_callback(gchar *message)
+{
+       statusbar_print_all(message);
+}
+
 gint plugin_init(gchar **error)
 {
        static gchar *path[3];
@@ -250,6 +256,7 @@ gint plugin_init(gchar **error)
        clamav_page.page.weight = 35.0;
        
        prefs_gtk_register_page((PrefsPage *) &clamav_page);
+       clamav_set_message_callback(gtk_message_callback);
 
        debug_print("ClamAV GTK plugin loaded\n");
        return 0;       
@@ -257,6 +264,7 @@ gint plugin_init(gchar **error)
 
 void plugin_done(void)
 {
+       clamav_set_message_callback(NULL);
        prefs_gtk_unregister_page((PrefsPage *) &clamav_page);
 
        debug_print("ClamAV GTK plugin unloaded\n");
index 947c5f94f2e5986170a680d47cc39c02bcb08066..caa11f915f077d0a70f13245acd00e0e621389e4 100644 (file)
@@ -171,7 +171,7 @@ static gint pgpmime_check_signature(MimeInfo *mimeinfo)
        debug_print("Checking PGP/MIME signature\n");
        parent = procmime_mimeinfo_parent(mimeinfo);
 
-       fp = fopen(parent->filename, "rb");
+       fp = fopen(parent->data.filename, "rb");
        g_return_val_if_fail(fp != NULL, SIGNATURE_INVALID);
        
        boundary = g_hash_table_lookup(parent->typeparameters, "boundary");
@@ -474,8 +474,8 @@ gboolean pgpmime_sign(MimeInfo *mimeinfo)
        newinfo->type = MIMETYPE_APPLICATION;
        newinfo->subtype = g_strdup("pgp-signature");
        newinfo->content = MIMECONTENT_MEM;
-       newinfo->data = g_memdup(sigcontent, len + 1);
-       newinfo->data[len] = '\0';
+       newinfo->data.mem = g_memdup(sigcontent, len + 1);
+       newinfo->data.mem[len] = '\0';
        g_node_append(sigmultipart->node, newinfo->node);
 
        g_free(sigcontent);
@@ -560,15 +560,15 @@ gboolean pgpmime_encrypt(MimeInfo *mimeinfo, const gchar *encrypt_data)
        newinfo->type = MIMETYPE_APPLICATION;
        newinfo->subtype = g_strdup("pgp-encrypted");
        newinfo->content = MIMECONTENT_MEM;
-       newinfo->data = g_strdup("Version: 1\n");
+       newinfo->data.mem = g_strdup("Version: 1\n");
        g_node_append(encmultipart->node, newinfo->node);
 
        newinfo = procmime_mimeinfo_new();
        newinfo->type = MIMETYPE_APPLICATION;
        newinfo->subtype = g_strdup("octet-stream");
        newinfo->content = MIMECONTENT_MEM;
-       newinfo->data = g_memdup(enccontent, len + 1);
-       newinfo->data[len] = '\0';
+       newinfo->data.mem = g_memdup(enccontent, len + 1);
+       newinfo->data.mem[len] = '\0';
        g_node_append(encmultipart->node, newinfo->node);
 
        g_free(enccontent);
index 7a2f4c741a823cc68927b6232692d47fda3d4239..15b4f30bbbe737b04b565b1ed65d722e18ac0ced 100644 (file)
@@ -26,6 +26,7 @@
 #include "intl.h"
 
 #include "version.h"
+#include "common/sylpheed.h"
 #include "sgpgme.h"
 #include "pgpmime.h"
 #include "prefs_gpg.h"
index 00da2e04556de5c8d782d387d136c77137a0471b..b1923ce986e095da37b87deb553e122da40c127f 100644 (file)
@@ -486,7 +486,7 @@ cmp_attr (gconstpointer pa, gconstpointer pb, GpgmeAttr attr)
         return !!sb;
     if (!sb)
         return -1;
-    return strcasecmp(sa, sb);
+    return g_strcasecmp(sa, sb);
 }
 
 static gint 
index 80827d75b54999eb7901732b37dc5da208613570..2e98724587e36cd409b46ca1230c91264aeecb3b 100644 (file)
@@ -235,7 +235,7 @@ GpgmeData sgpgme_data_from_mimeinfo(MimeInfo *mimeinfo)
        GpgmeData data;
        
        gpgme_data_new_from_filepart(&data,
-               mimeinfo->filename,
+               mimeinfo->data.filename,
                NULL,
                mimeinfo->offset,
                mimeinfo->length);
index 4d479878522c409587f083b597d7c8b0bb56d5ec..a650702edb76ee870f5c098b1ee208f930a43818 100644 (file)
@@ -1182,7 +1182,7 @@ int transport_setup(struct transport *tp, int flags)
     char **addrp;
 
 #ifdef _WIN32
-    // Start Winsock up
+    /* Start Winsock up */
     WSADATA wsaData;
     int nCode;
     if ((nCode = WSAStartup(MAKEWORD(1, 1), &wsaData)) != 0) {
@@ -1300,11 +1300,11 @@ libspamc_log (int flags, int level, char *msg, ...)
     va_start(ap, msg);
 
     if ((flags & SPAMC_LOG_TO_STDERR) != 0) {
-        // create a log-line buffer
+        /* create a log-line buffer */
         len = snprintf(buf, LOG_BUFSIZ, "spamc: ");
         len += vsnprintf(buf+len, LOG_BUFSIZ-len, msg, ap);
 
-        // avoid buffer overflow
+        /* avoid buffer overflow */
         if (len > (LOG_BUFSIZ-2)) { len = (LOG_BUFSIZ-3); }
 
         len += snprintf(buf+len, LOG_BUFSIZ-len, "\n");
index e9223402554b0d67df813bbcee8319d146990d2c..a9860d0e4dc0adfaf77a7f6d49b27e43ac5981f4 100644 (file)
@@ -76,6 +76,7 @@ enum {
 static guint hook_id;
 static int flags = SPAMC_RAW_MODE | SPAMC_SAFE_FALLBACK | SPAMC_CHECK_ONLY;
 static gchar *username = NULL;
+static MessageCallback message_callback;
 
 static SpamAssassinConfig config;
 
@@ -178,7 +179,8 @@ static gboolean mail_filtering_hook(gpointer source, gpointer data)
                return FALSE;
 
        debug_print("Filtering message %d\n", msginfo->msgnum);
-       statusbar_print_all(_("SpamAssassin: filtering message..."));
+       if (message_callback != NULL)
+               message_callback(_("SpamAssassin: filtering message..."));
 
        if ((fp = procmsg_open_message(msginfo)) == NULL) {
                debug_print("failed to open message file\n");
@@ -269,6 +271,11 @@ void spamassassin_save_config(void)
        prefs_file_close(pfile);
 }
 
+void spamassassin_set_message_callback(MessageCallback callback)
+{
+       message_callback = callback;
+}
+
 gint plugin_init(gchar **error)
 {
        if ((sylpheed_get_version() > VERSION_NUMERIC)) {
index 3e4ac97449614075c1d6cb7adad344fbe71dbad9..79d63735774fea6a8e6f5e1aa65766466415a094 100644 (file)
@@ -24,6 +24,8 @@
 
 typedef struct _SpamAssassinConfig SpamAssassinConfig;
 
+typedef void (*MessageCallback) (gchar *);
+
 typedef enum {
        SPAMASSASSIN_DISABLED            = 0,
        SPAMASSASSIN_TRANSPORT_LOCALHOST = 1,
@@ -43,7 +45,8 @@ struct _SpamAssassinConfig
        guint                    timeout;
 };
 
-SpamAssassinConfig *spamassassin_get_config    (void);
-void               spamassassin_save_config    (void);
+SpamAssassinConfig *spamassassin_get_config          (void);
+void               spamassassin_save_config          (void);
+void               spamassassin_set_message_callback (MessageCallback callback);
 
 #endif
index 687976c876fe867cb2a3a1c70e9c5e6320c7e3c6..794b22938eac9334474fb9fb22a429092391cca6 100644 (file)
@@ -36,6 +36,7 @@
 #include "prefs_gtk.h"
 #include "foldersel.h"
 #include "spamassassin.h"
+#include "statusbar.h"
 
 struct SpamAssassinPage
 {
@@ -436,6 +437,11 @@ static void spamassassin_save_func(PrefsPage *_page)
        spamassassin_save_config();
 }
 
+static void gtk_message_callback(gchar *message)
+{
+       statusbar_print_all(message);
+}
+
 static struct SpamAssassinPage spamassassin_page;
 
 gint plugin_init(gchar **error)
@@ -463,6 +469,7 @@ gint plugin_init(gchar **error)
        spamassassin_page.page.weight = 35.0;
 
        prefs_gtk_register_page((PrefsPage *) &spamassassin_page);
+       spamassassin_set_message_callback(gtk_message_callback);
 
        debug_print("SpamAssassin GTK plugin loaded\n");
        return 0;       
@@ -470,6 +477,7 @@ gint plugin_init(gchar **error)
 
 void plugin_done(void)
 {
+       spamassassin_set_message_callback(NULL);
        prefs_gtk_unregister_page((PrefsPage *) &spamassassin_page);
 
        debug_print("SpamAssassin GTK plugin unloaded\n");
index 4217fd8be8a59f09194daf60023ec64161358fcd..b7e674e87f1b686aad9a3a229f9e98f00c2ebfc6 100644 (file)
@@ -67,7 +67,7 @@ egg_tray_icon_init (EggTrayIcon *icon)
 static void
 egg_tray_icon_class_init (EggTrayIconClass *klass)
 {
-       //parent_class = g_type_class_peek_parent (klass);
+       /* parent_class = g_type_class_peek_parent (klass); */
        parent_class = gtk_type_class(gtk_plug_xembed_get_type());
 }
 
@@ -114,7 +114,7 @@ egg_tray_icon_send_manager_message (EggTrayIcon *icon,
   ev.window = window;
   ev.message_type = icon->system_tray_opcode_atom;
   ev.format = 32;
-  ev.data.l[0] = GDK_CURRENT_TIME; //gdk_x11_get_server_time (GTK_WIDGET (icon)->window);
+  ev.data.l[0] = GDK_CURRENT_TIME; /* gdk_x11_get_server_time (GTK_WIDGET (icon)->window); */
   ev.data.l[1] = message;
   ev.data.l[2] = data1;
   ev.data.l[3] = data2;
@@ -238,7 +238,7 @@ egg_tray_icon_new_for_xscreen (Screen *xscreen, const char *name)
 #if HAVE_GTK_MULTIHEAD
   root_window = gdk_screen_get_root_window (screen);
 #else
-  root_window = GDK_ROOT_PARENT(); //gdk_window_lookup (gdk_x11_get_default_root_xwindow ());
+  root_window = GDK_ROOT_PARENT(); /* gdk_window_lookup (gdk_x11_get_default_root_xwindow ()); */
 #endif
   
   /* Add a root window filter so that we get changes on MANAGER */
index 7d0c6e2d64faaae63ef864f2c2a040ec5717f22c..ed66ea1ef27d7dc7f6812943cf0229250cfb1158 100644 (file)
@@ -32,8 +32,8 @@ extern "C" {
 #define EGG_TRAY_ICON(obj)             (GTK_CHECK_CAST ((obj), EGG_TYPE_TRAY_ICON, EggTrayIcon))
 #define EGG_TRAY_ICON_CLASS(klass)     (GTK_CHECK_CLASS_CAST ((klass), EGG_TYPE_TRAY_ICON, EggTrayIconClass))
 #define EGG_IS_TRAY_ICON(obj)          (GTK_CHECK_TYPE ((obj), EGG_TYPE_TRAY_ICON))
-//#define EGG_IS_TRAY_ICON_CLASS(klass)        (GTK_TYPE_CHECK_CLASS_TYPE ((klass), EGG_TYPE_TRAY_ICON))
-//#define EGG_TRAY_ICON_GET_CLASS(obj) (GTK_TYPE_INSTANCE_GET_CLASS ((obj), EGG_TYPE_TRAY_ICON, EggTrayIconClass))
+/* #define EGG_IS_TRAY_ICON_CLASS(klass)       (GTK_TYPE_CHECK_CLASS_TYPE ((klass), EGG_TYPE_TRAY_ICON)) */
+/* #define EGG_TRAY_ICON_GET_CLASS(obj)        (GTK_TYPE_INSTANCE_GET_CLASS ((obj), EGG_TYPE_TRAY_ICON, EggTrayIconClass)) */
        
 typedef struct _EggTrayIcon      EggTrayIcon;
 typedef struct _EggTrayIconClass  EggTrayIconClass;
index 7160142d2596b393b5a7de9fd027f7fab2b9dd4e..81cef68f717639b22670695d9dea7a076c7ee9a3 100644 (file)
@@ -926,7 +926,7 @@ handle_modality_on (GtkPlugXEmbed *plug)
       gtk_grab_add (plug->modality_window);
     }
 #else
-  // g_print("Modality On for plug %p\n", plug);
+  /* g_print("Modality On for plug %p\n", plug); */
 #endif
 }
 
@@ -940,7 +940,7 @@ handle_modality_off (GtkPlugXEmbed *plug)
       plug->modality_window = NULL;
     }
 #else
-  // g_print("Modality Off for plug %p\n", plug);
+  /* g_print("Modality Off for plug %p\n", plug); */
 #endif
 }
 
index cb6f9d2362c07ce38003b4e93921ec48c078d939..0371d2803d06b88ab9a89d1fa025d7abb7f80d49 100644 (file)
@@ -36,6 +36,7 @@
 #include "prefs_common.h"
 #include "main.h"
 #include "alertpanel.h"
+#include "gtk/manage_window.h"
 
 #include "eggtrayicon.h"
 #include "newmail.xpm"
index e1b75be34af74047b36dd78468e27ba27d789623..c630365175e2a42bccade665e8c81ce866c58e85 100644 (file)
--- a/src/pop.c
+++ b/src/pop.c
@@ -477,7 +477,7 @@ static void pop3_gen_send(Pop3Session *session, const gchar *format, ...)
        g_vsnprintf(buf, sizeof(buf) - 2, format, args);
        va_end(args);
 
-       if (!strncasecmp(buf, "PASS ", 5))
+       if (!g_strncasecmp(buf, "PASS ", 5))
                log_print("POP3> PASS ********\n");
        else
                log_print("POP3> %s\n", buf);
index 1bd8bef94592b1965f5602dd7c2cfd76a68b8724..c3e66f7d0628fe91bea18ca2575c37550b6b8852 100644 (file)
@@ -1631,20 +1631,9 @@ static void prefs_account_compose_create(void)
 static void prefs_account_privacy_create(void)
 {
        GtkWidget *vbox1;
-       GtkWidget *frame_mode;
-       GtkWidget *vbox_mode;
-       GtkWidget *frame1;
        GtkWidget *vbox2;
-       GtkWidget *hbox1;
-       GtkWidget *label;
        GtkWidget *default_encrypt_chkbtn;
        GtkWidget *default_sign_chkbtn;
-       GtkWidget *gnupg_mime_radiobtn;
-       GtkWidget *gnupg_inline_radiobtn;
-       GtkWidget *defaultkey_radiobtn;
-       GtkWidget *emailkey_radiobtn;
-       GtkWidget *customkey_radiobtn;
-       GtkWidget *customkey_entry;
 
        vbox1 = gtk_vbox_new (FALSE, VSPACING);
        gtk_widget_show (vbox1);
index 24f3f6b2e53b338e8ffde6154a3dc23bc606ac12..40ad43aa21ee5260886e6582c8fc2056c547f8c0 100644 (file)
@@ -107,7 +107,7 @@ void prefs_config_parse_one_line(PrefParam *param, const gchar *buf)
 
        for (i = 0; param[i].name != NULL; i++) {
                name_len = strlen(param[i].name);
-               if (strncasecmp(buf, param[i].name, name_len))
+               if (g_strncasecmp(buf, param[i].name, name_len))
                        continue;
                if (buf[name_len] != '=')
                        continue;
@@ -332,7 +332,7 @@ void prefs_set_default(PrefParam *param)
                case P_PASSWORD:
                        g_free(*((gchar **)param[i].data));
                        if (param[i].defval != NULL) {
-                               if (!strncasecmp(param[i].defval, "ENV_", 4))
+                               if (!g_strncasecmp(param[i].defval, "ENV_", 4))
                                        *((gchar **)param[i].data) =
                                                g_strdup(g_getenv(param[i].defval + 4));
                                else if (param[i].defval[0] == '~')
@@ -357,7 +357,7 @@ void prefs_set_default(PrefParam *param)
                        break;
                case P_BOOL:
                        if (param[i].defval != NULL) {
-                               if (!strcasecmp(param[i].defval, "TRUE"))
+                               if (!g_strcasecmp(param[i].defval, "TRUE"))
                                        *((gboolean *)param[i].data) = TRUE;
                                else
                                        *((gboolean *)param[i].data) =
@@ -519,7 +519,7 @@ void prefs_set_dialog_to_default(PrefParam *param)
                case P_STRING:
                case P_PASSWORD:
                        if (tmpparam.defval) {
-                               if (!strncasecmp(tmpparam.defval, "ENV_", 4)) {
+                               if (!g_strncasecmp(tmpparam.defval, "ENV_", 4)) {
                                        str_data = g_strdup(g_getenv(param[i].defval + 4));
                                        tmpparam.data = &str_data;
                                        break;
@@ -550,7 +550,7 @@ void prefs_set_dialog_to_default(PrefParam *param)
                        break;
                case P_BOOL:
                        if (tmpparam.defval) {
-                               if (!strcasecmp(tmpparam.defval, "TRUE"))
+                               if (!g_strcasecmp(tmpparam.defval, "TRUE"))
                                        bool_data = TRUE;
                                else
                                        bool_data = atoi(tmpparam.defval)
index 7417f129161c512727ed410f0824e10fa6850ae6..22207db24566a96cdfeda1eb0c19e8705489e39e 100644 (file)
@@ -60,9 +60,6 @@ typedef struct _MsgColorsPage
 
 static GtkWidget *color_dialog;
 
-static void prefs_quote_colors_key_pressed     (GtkWidget      *widget,
-                                                GdkEventKey    *event,
-                                                gpointer        data);
 static void quote_color_set_dialog             (GtkWidget      *widget,
                                                 gpointer        data);
 static void quote_colors_set_dialog_ok         (GtkWidget      *widget,
@@ -224,13 +221,6 @@ void prefs_msg_colors_create_widget(PrefsPage *_page, GtkWindow *window,
        prefs_msg_colors->page.widget = table;
 }
 
-static void prefs_quote_colors_key_pressed(GtkWidget *widget,
-                                          GdkEventKey *event, gpointer data)
-{
-       if (event && event->keyval == GDK_Escape)
-               gtk_main_quit();
-}
-
 static void quote_color_set_dialog(GtkWidget *widget, gpointer data)
 {
        gchar *type = (gchar *)data;
index f9f57843acc6b5abbb5519ef9c7477179441dbb7..0cbf557ce5d35ebe72908f4c9f31e46e4273336d 100644 (file)
@@ -118,7 +118,7 @@ static gint generic_get_one_field(gchar *buf, gint len, void *data,
 
                        for (hp = hentry, hnum = 0; hp->name != NULL;
                             hp++, hnum++) {
-                               if (!strncasecmp(hp->name, buf,
+                               if (!g_strncasecmp(hp->name, buf,
                                                 strlen(hp->name)))
                                        break;
                        }
@@ -681,7 +681,7 @@ static MsgInfo *parse_stream(void *data, gboolean isstring, MsgFlags flags,
                        }
                        break;
                case H_CONTENT_TYPE:
-                       if (!strncasecmp(hp, "multipart/", 10))
+                       if (!g_strncasecmp(hp, "multipart/", 10))
                                MSG_SET_TMP_FLAGS(msginfo->flags, MSG_MULTIPART);
                        break;
 #ifdef ALLOW_HEADER_HINT                       
@@ -914,7 +914,7 @@ time_t procheader_date_parse(gchar *dest, const gchar *src, gint len)
 
        month[3] = '\0';
        for (p = monthstr; *p != '\0'; p += 3) {
-               if (!strncasecmp(p, month, 3)) {
+               if (!g_strncasecmp(p, month, 3)) {
                        dmonth = (gint)(p - monthstr) / 3 + 1;
                        break;
                }
index b2ad79e1588d26a3bf4d76315997d5db0cf7bae2..9550dc5228c27f952074f7739e247fe11bbaa612 100644 (file)
@@ -56,7 +56,7 @@ MimeInfo *procmime_mimeinfo_new(void)
 
        mimeinfo = g_new0(MimeInfo, 1);
        mimeinfo->content        = MIMECONTENT_EMPTY;
-       mimeinfo->filename       = NULL;
+       mimeinfo->data.filename  = NULL;
 
        mimeinfo->type           = MIMETYPE_UNKNOWN;
        mimeinfo->encoding_type  = ENC_UNKNOWN;
@@ -103,13 +103,13 @@ static gboolean free_func(GNode *node, gpointer data)
        switch (mimeinfo->content) {
        case MIMECONTENT_FILE:
                if (mimeinfo->tmp)
-                       unlink(mimeinfo->filename);
-               g_free(mimeinfo->filename);
+                       unlink(mimeinfo->data.filename);
+               g_free(mimeinfo->data.filename);
                break;
 
        case MIMECONTENT_MEM:
                if (mimeinfo->tmp)
-                       g_free(mimeinfo->data);
+                       g_free(mimeinfo->data.mem);
        default:
                break;
        }
@@ -284,7 +284,7 @@ gboolean procmime_decode_content(MimeInfo *mimeinfo)
            encoding == ENC_BINARY)
                return TRUE;
 
-       infp = fopen(mimeinfo->filename, "rb");
+       infp = fopen(mimeinfo->data.filename, "rb");
        if (!infp) {
                perror("fopen");
                return FALSE;
@@ -350,11 +350,11 @@ gboolean procmime_decode_content(MimeInfo *mimeinfo)
        fclose(infp);
 
        stat(tmpfilename, &statbuf);
-       if (mimeinfo->tmp && (mimeinfo->filename != NULL))
-               unlink(mimeinfo->filename);
-       if (mimeinfo->filename != NULL)
-               g_free(mimeinfo->filename);
-       mimeinfo->filename = tmpfilename;
+       if (mimeinfo->tmp && (mimeinfo->data.filename != NULL))
+               unlink(mimeinfo->data.filename);
+       if (mimeinfo->data.filename != NULL)
+               g_free(mimeinfo->data.filename);
+       mimeinfo->data.filename = tmpfilename;
        mimeinfo->tmp = TRUE;
        mimeinfo->offset = 0;
        mimeinfo->length = statbuf.st_size;
@@ -388,8 +388,8 @@ gboolean procmime_encode_content(MimeInfo *mimeinfo, EncodingType encoding)
                return FALSE;
        }
 
-       if ((infp = fopen(mimeinfo->filename, "rb")) == NULL) {
-               g_warning("Can't open file %s\n", mimeinfo->filename);
+       if ((infp = fopen(mimeinfo->data.filename, "rb")) == NULL) {
+               g_warning("Can't open file %s\n", mimeinfo->data.filename);
                return FALSE;
        }
 
@@ -428,10 +428,10 @@ gboolean procmime_encode_content(MimeInfo *mimeinfo, EncodingType encoding)
        fclose(infp);
 
        stat(tmpfilename, &statbuf);
-       if (mimeinfo->tmp && (mimeinfo->filename != NULL))
-               unlink(mimeinfo->filename);
-       g_free(mimeinfo->filename);
-       mimeinfo->filename = tmpfilename;
+       if (mimeinfo->tmp && (mimeinfo->data.filename != NULL))
+               unlink(mimeinfo->data.filename);
+       g_free(mimeinfo->data.filename);
+       mimeinfo->data.filename = tmpfilename;
        mimeinfo->tmp = TRUE;
        mimeinfo->offset = 0;
        mimeinfo->length = statbuf.st_size;
@@ -452,12 +452,12 @@ gint procmime_get_part(const gchar *outfile, MimeInfo *mimeinfo)
        if (mimeinfo->encoding_type != ENC_BINARY && !procmime_decode_content(mimeinfo))
                return -1;
 
-       if ((infp = fopen(mimeinfo->filename, "rb")) == NULL) {
-               FILE_OP_ERROR(mimeinfo->filename, "fopen");
+       if ((infp = fopen(mimeinfo->data.filename, "rb")) == NULL) {
+               FILE_OP_ERROR(mimeinfo->data.filename, "fopen");
                return -1;
        }
        if (fseek(infp, mimeinfo->offset, SEEK_SET) < 0) {
-               FILE_OP_ERROR(mimeinfo->filename, "fseek");
+               FILE_OP_ERROR(mimeinfo->data.filename, "fseek");
                fclose(infp);
                return -1;
        }
@@ -873,7 +873,7 @@ static gint procmime_str_equal(gconstpointer gptr1, gconstpointer gptr2)
        const char *str1 = gptr1;
        const char *str2 = gptr2;
 
-       return !strcasecmp(str1, str2);
+       return !g_strcasecmp(str1, str2);
 }
 
 static GHashTable *procmime_get_mime_type_table(void)
@@ -974,14 +974,14 @@ EncodingType procmime_get_encoding_for_charset(const gchar *charset)
 {
        if (!charset)
                return ENC_8BIT;
-       else if (!strncasecmp(charset, "ISO-2022-", 9) ||
-                !strcasecmp(charset, "US-ASCII"))
+       else if (!g_strncasecmp(charset, "ISO-2022-", 9) ||
+                !g_strcasecmp(charset, "US-ASCII"))
                return ENC_7BIT;
-       else if (!strcasecmp(charset, "ISO-8859-5") ||
-                !strncasecmp(charset, "KOI8-", 5) ||
-                !strcasecmp(charset, "Windows-1251"))
+       else if (!g_strcasecmp(charset, "ISO-8859-5") ||
+                !g_strncasecmp(charset, "KOI8-", 5) ||
+                !g_strcasecmp(charset, "Windows-1251"))
                return ENC_8BIT;
-       else if (!strncasecmp(charset, "ISO-8859-", 9))
+       else if (!g_strncasecmp(charset, "ISO-8859-", 9))
                return ENC_QUOTED_PRINTABLE;
        else
                return ENC_8BIT;
@@ -1126,9 +1126,9 @@ void procmime_parse_message_rfc822(MimeInfo *mimeinfo)
 
        procmime_decode_content(mimeinfo);
 
-       fp = fopen(mimeinfo->filename, "rb");
+       fp = fopen(mimeinfo->data.filename, "rb");
        if (fp == NULL) {
-               FILE_OP_ERROR(mimeinfo->filename, "fopen");
+               FILE_OP_ERROR(mimeinfo->data.filename, "fopen");
                return;
        }
        fseek(fp, mimeinfo->offset, SEEK_SET);
@@ -1149,7 +1149,7 @@ void procmime_parse_message_rfc822(MimeInfo *mimeinfo)
                                        hentry[0].body, hentry[1].body,
                                        hentry[2].body, hentry[3].body, 
                                        hentry[4].body, 
-                                       mimeinfo->filename, content_start,
+                                       mimeinfo->data.filename, content_start,
                                        mimeinfo->length - (content_start - mimeinfo->offset));
        } else {
                MimeInfo *subinfo;
@@ -1158,7 +1158,7 @@ void procmime_parse_message_rfc822(MimeInfo *mimeinfo)
                subinfo->encoding_type = ENC_UNKNOWN;
                subinfo->type = MIMETYPE_TEXT;
                subinfo->subtype = g_strdup("plain");
-               subinfo->filename = g_strdup(mimeinfo->filename);
+               subinfo->data.filename = g_strdup(mimeinfo->data.filename);
                subinfo->offset = content_start;
                subinfo->length = mimeinfo->length - (content_start - mimeinfo->offset);
 
@@ -1195,9 +1195,9 @@ void procmime_parse_multipart(MimeInfo *mimeinfo)
 
        procmime_decode_content(mimeinfo);
 
-       fp = fopen(mimeinfo->filename, "rb");
+       fp = fopen(mimeinfo->data.filename, "rb");
        if (fp == NULL) {
-               FILE_OP_ERROR(mimeinfo->filename, "fopen");
+               FILE_OP_ERROR(mimeinfo->data.filename, "fopen");
                return;
        }
        fseek(fp, mimeinfo->offset, SEEK_SET);
@@ -1211,7 +1211,7 @@ void procmime_parse_multipart(MimeInfo *mimeinfo)
                                                        hentry[0].body, hentry[1].body,
                                                        hentry[2].body, hentry[3].body, 
                                                        hentry[4].body, 
-                                                       mimeinfo->filename, lastoffset,
+                                                       mimeinfo->data.filename, lastoffset,
                                                        (ftell(fp) - strlen(buf)) - lastoffset - 1);
                        }
                        
@@ -1378,7 +1378,7 @@ void procmime_parse_mimepart(MimeInfo *parent,
        mimeinfo->content = MIMECONTENT_FILE;
        if (parent != NULL)
                g_node_append(parent->node, mimeinfo->node);
-       mimeinfo->filename = g_strdup(filename);
+       mimeinfo->data.filename = g_strdup(filename);
        mimeinfo->offset = offset;
        mimeinfo->length = length;
 
@@ -1471,7 +1471,7 @@ MimeInfo *procmime_scan_file_with_offset(const gchar *filename, int offset)
        mimeinfo->encoding_type = ENC_UNKNOWN;
        mimeinfo->type = MIMETYPE_MESSAGE;
        mimeinfo->subtype = g_strdup("rfc822");
-       mimeinfo->filename = g_strdup(filename);
+       mimeinfo->data.filename = g_strdup(filename);
        mimeinfo->offset = offset;
        mimeinfo->length = buf.st_size - offset;
 
@@ -1583,8 +1583,8 @@ gint procmime_write_message_rfc822(MimeInfo *mimeinfo, FILE *fp)
        /* write header */
        switch (mimeinfo->content) {
        case MIMECONTENT_FILE:
-               if ((infp = fopen(mimeinfo->filename, "rb")) == NULL) {
-                       FILE_OP_ERROR(mimeinfo->filename, "fopen");
+               if ((infp = fopen(mimeinfo->data.filename, "rb")) == NULL) {
+                       FILE_OP_ERROR(mimeinfo->data.filename, "fopen");
                        return -1;
                }
                fseek(infp, mimeinfo->offset, SEEK_SET);
@@ -1609,7 +1609,7 @@ gint procmime_write_message_rfc822(MimeInfo *mimeinfo, FILE *fp)
                break;
 
        case MIMECONTENT_MEM:
-               fwrite(mimeinfo->data, strlen(mimeinfo->data), sizeof(gchar), fp);
+               fwrite(mimeinfo->data.mem, strlen(mimeinfo->data.mem), sizeof(gchar), fp);
                break;
 
        default:
@@ -1640,8 +1640,8 @@ gint procmime_write_multipart(MimeInfo *mimeinfo, FILE *fp)
 
        switch (mimeinfo->content) {
        case MIMECONTENT_FILE:
-               if ((infp = fopen(mimeinfo->filename, "rb")) == NULL) {
-                       FILE_OP_ERROR(mimeinfo->filename, "fopen");
+               if ((infp = fopen(mimeinfo->data.filename, "rb")) == NULL) {
+                       FILE_OP_ERROR(mimeinfo->data.filename, "fopen");
                        return -1;
                }
                fseek(infp, mimeinfo->offset, SEEK_SET);
@@ -1654,7 +1654,7 @@ gint procmime_write_multipart(MimeInfo *mimeinfo, FILE *fp)
                break;
 
        case MIMECONTENT_MEM:
-               str = g_strdup(mimeinfo->data);
+               str = g_strdup(mimeinfo->data.mem);
                if (((str2 = strstr(str, boundary)) != NULL) && ((str2 - str) >= 2) &&
                    (*(str2 - 1) == '-') && (*(str2 - 2) == '-'))
                        *(str2 - 2) = '\0';
@@ -1697,8 +1697,8 @@ gint procmime_write_mimeinfo(MimeInfo *mimeinfo, FILE *fp)
        if (G_NODE_IS_LEAF(mimeinfo->node)) {
                switch (mimeinfo->content) {
                case MIMECONTENT_FILE:
-                       if ((infp = fopen(mimeinfo->filename, "rb")) == NULL) {
-                               FILE_OP_ERROR(mimeinfo->filename, "fopen");
+                       if ((infp = fopen(mimeinfo->data.filename, "rb")) == NULL) {
+                               FILE_OP_ERROR(mimeinfo->data.filename, "fopen");
                                return -1;
                        }
                        copy_file_part_to_fp(infp, mimeinfo->offset, mimeinfo->length, fp);
@@ -1706,7 +1706,7 @@ gint procmime_write_mimeinfo(MimeInfo *mimeinfo, FILE *fp)
                        return 0;
 
                case MIMECONTENT_MEM:
-                       fwrite(mimeinfo->data, strlen(mimeinfo->data), sizeof(gchar), fp);
+                       fwrite(mimeinfo->data.mem, strlen(mimeinfo->data.mem), sizeof(gchar), fp);
                        return 0;
 
                default:
index 354391bfbfce2d966e05084f4b4e8309610b4684..a22be1c4998bfcf965368f7c643aa45ade166fa5 100644 (file)
@@ -105,8 +105,8 @@ struct _MimeInfo
        union
        {
                gchar *filename;
-               gchar *data;
-       };
+               gchar *mem;
+       } data;
        gboolean tmp;
 
        GNode *node;
index c89b2cf4136a64fe7ba9e8639e9e6d62e68509ff..9e5d41180abe95c277c179fd2a982943cd274726 100644 (file)
@@ -721,7 +721,7 @@ gint procmsg_save_to_outbox(FolderItem *outbox, const gchar *file,
                gchar tmp[MAXPATHLEN + 1];
 
                g_snprintf(tmp, sizeof(tmp), "%s%ctmpmsg.out.%08x",
-                          get_rc_dir(), G_DIR_SEPARATOR, (guint)random());
+                          get_rc_dir(), G_DIR_SEPARATOR, (guint) rand());
                
                if (procmsg_remove_special_headers(file, tmp) !=0)
                        return -1;
index 35400b4f5c855c038dfa681d9d696c77f9c87ea1..17f3e2e3ebd45616ed10cc1adecfa9a0234bb6d9 100644 (file)
@@ -4783,7 +4783,7 @@ static gint func_name(GtkCList *clist,                                     \
        if (!msginfo2->var_name)                                         \
                return -1;                                               \
                                                                         \
-       return strcasecmp(msginfo1->var_name, msginfo2->var_name);       \
+       return g_strcasecmp(msginfo1->var_name, msginfo2->var_name);     \
 }
 
 CMP_FUNC_DEF(summary_cmp_by_to, to);
@@ -4825,7 +4825,7 @@ static gint summary_cmp_by_from(GtkCList *clist, gconstpointer ptr1,
        if (!str2)
                return -1;
  
-       return strcasecmp(str1, str2);
+       return g_strcasecmp(str1, str2);
 }
  
 static gint summary_cmp_by_simplified_subject
index d6f2dae5938440c89270af4c09a772e5f66a0535..c95c9f64d8f74589d9c88b1f806ae70c4790d9bc 100644 (file)
@@ -395,7 +395,7 @@ static void textview_add_part(TextView *textview, MimeInfo *mimeinfo)
        if ((mimeinfo->type == MIMETYPE_MESSAGE) && !g_strcasecmp(mimeinfo->subtype, "rfc822")) {
                FILE *fp;
 
-               fp = fopen(mimeinfo->filename, "rb");
+               fp = fopen(mimeinfo->data.filename, "rb");
                fseek(fp, mimeinfo->offset, SEEK_SET);
                headers = textview_scan_header(textview, fp);
                if (headers) {
@@ -451,7 +451,7 @@ static void recursive_add_parts(TextView *textview, GNode *node)
             (mimeinfo->type != MIMETYPE_MESSAGE))
                 return;
         
-        if (strcasecmp(mimeinfo->subtype, "alternative") == 0) {
+        if (g_strcasecmp(mimeinfo->subtype, "alternative") == 0) {
                 GNode * prefered_body;
                 int prefered_score;
                 
@@ -474,7 +474,7 @@ static void recursive_add_parts(TextView *textview, GNode *node)
                                 score = 2;
                         
                         if (submime->subtype != NULL) {
-                                if (strcasecmp(submime->subtype, "plain") == 0)
+                                if (g_strcasecmp(submime->subtype, "plain") == 0)
                                         score = 3;
                         }
                         
@@ -595,7 +595,7 @@ static void textview_write_body(TextView *textview, MimeInfo *mimeinfo)
                }
                g_free(filename);
        } else {
-               tmpfp = fopen(mimeinfo->filename, "rb");
+               tmpfp = fopen(mimeinfo->data.filename, "rb");
                fseek(tmpfp, mimeinfo->offset, SEEK_SET);
                debug_print("Viewing text content of type: %s (length: %d)\n", mimeinfo->subtype, mimeinfo->length);
                while ((fgets(buf, sizeof(buf), tmpfp) != NULL) && 
@@ -625,7 +625,7 @@ static void textview_show_html(TextView *textview, FILE *fp,
                                 * if still inside an <a>, but already parsed past HREF */
                                str = strtok(str, " ");
                                if (str) { 
-                                       parser->href = strdup(str);
+                                       parser->href = g_strdup(str);
                                        /* the URL may (or not) be followed by the
                                         * referenced text */
                                        str = strtok(NULL, "");
@@ -672,7 +672,7 @@ static gboolean get_uri_part(const gchar *start, const gchar *scanpos,
        /* find end point of URI */
        for (ep_ = scanpos; *ep_ != '\0'; ep_++) {
                if (!isgraph(*(const guchar *)ep_) ||
-                   !isascii(*(const guchar *)ep_) ||
+                   !IS_ASCII(*(const guchar *)ep_) ||
                    strchr("()<>\"", *ep_))
                        break;
        }
@@ -704,14 +704,14 @@ static gchar *make_uri_string(const gchar *bp, const gchar *ep)
 
 /* valid mail address characters */
 #define IS_RFC822_CHAR(ch) \
-       (isascii(ch) && \
+       (IS_ASCII(ch) && \
         (ch) > 32   && \
         (ch) != 127 && \
         !isspace(ch) && \
         !strchr("(),;<>\"", (ch)))
 
 /* alphabet and number within 7bit ASCII */
-#define IS_ASCII_ALNUM(ch)     (isascii(ch) && isalnum(ch))
+#define IS_ASCII_ALNUM(ch)     (IS_ASCII(ch) && isalnum(ch))
 #define IS_QUOTE(ch) ((ch) == '\'' || (ch) == '"')
 
 static GHashTable *create_domain_tab(void)