2004-10-19 [colin] 0.9.12cvs128.1
authorColin Leroy <colin@colino.net>
Tue, 19 Oct 2004 07:28:20 +0000 (07:28 +0000)
committerColin Leroy <colin@colino.net>
Tue, 19 Oct 2004 07:28:20 +0000 (07:28 +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.c
* src/procmime.h
* 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.c
* src/common/utils.h
* src/gtk/pluginwindow.c
* src/gtk/quicksearch.c
* src/plugins/clamav/clamav_plugin.c
* src/plugins/clamav/clamav_plugin.h
* src/plugins/clamav/clamav_plugin_gtk.c
* src/plugins/pgpmime/passphrase.c
* src/plugins/pgpmime/pgpmime.c
* src/plugins/pgpmime/plugin.c
* src/plugins/pgpmime/prefs_gpg.c
* src/plugins/pgpmime/prefs_gpg.h
* 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/trayicon.c
* src/plugins/trayicon/libeggtrayicon/gtkplugxembed.c
Sync with HEAD

53 files changed:
ChangeLog-gtk2.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/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/passphrase.c
src/plugins/pgpmime/pgpmime.c
src/plugins/pgpmime/plugin.c
src/plugins/pgpmime/prefs_gpg.c
src/plugins/pgpmime/prefs_gpg.h
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/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 ea3009eed34804df80222d84216ca2981c9ab3ec..fb40a2de11d861da3bb4957ebd23371df689ef32 100644 (file)
@@ -1,3 +1,57 @@
+2004-10-19 [colin]     0.9.12cvs128.1
+
+       * 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.c
+       * src/procmime.h
+       * 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.c
+       * src/common/utils.h
+       * src/gtk/pluginwindow.c
+       * src/gtk/quicksearch.c
+       * src/plugins/clamav/clamav_plugin.c
+       * src/plugins/clamav/clamav_plugin.h
+       * src/plugins/clamav/clamav_plugin_gtk.c
+       * src/plugins/pgpmime/passphrase.c
+       * src/plugins/pgpmime/pgpmime.c
+       * src/plugins/pgpmime/plugin.c
+       * src/plugins/pgpmime/prefs_gpg.c
+       * src/plugins/pgpmime/prefs_gpg.h
+       * 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/trayicon.c
+       * src/plugins/trayicon/libeggtrayicon/gtkplugxembed.c
+               Sync with HEAD
+
 2004-10-14 [colin]     0.9.12cvs126.2
 
        * src/codeconv.c
index f92076a45a0abca3844e7557d64348409c91f10e..da7ce51b6a57fcf58beb849d66136c25892a8853 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.53.2.6 -r 1.53.2.7 po/POTFILES.in; ) > 0.9.12cvs125.1.patchset
 ( cvs diff -u -r 1.382.2.50 -r 1.382.2.51 src/compose.c; ) > 0.9.12cvs126.1.patchset
 ( cvs diff -u -r 1.65.2.13 -r 1.65.2.15 src/codeconv.c; cvs diff -u -r 1.96.2.21 -r 1.96.2.22 src/textview.c; ) > 0.9.12cvs126.2.patchset
+( cvs diff -u -r 1.22.2.1 -r 1.22.2.2 src/addrbook.c; cvs diff -u -r 1.15.2.1 -r 1.15.2.2 src/addrcache.c; cvs diff -u -r 1.60.2.11 -r 1.60.2.12 src/addressbook.c; cvs diff -u -r 1.65.2.15 -r 1.65.2.16 src/codeconv.c; cvs diff -u -r 1.382.2.51 -r 1.382.2.52 src/compose.c; cvs diff -u -r 1.5.2.2 -r 1.5.2.3 src/customheader.c; cvs diff -u -r 1.14.2.2 -r 1.14.2.3 src/editaddress.c; cvs diff -u -r 1.11.2.2 -r 1.11.2.3 src/editgroup.c; cvs diff -u -r 1.5 -r 1.6 src/exporthtml.c; cvs diff -u -r 1.213.2.17 -r 1.213.2.18 src/folder.c; cvs diff -u -r 1.207.2.18 -r 1.207.2.19 src/folderview.c; cvs diff -u -r 1.179.2.8 -r 1.179.2.9 src/imap.c; cvs diff -u -r 1.18.2.2 -r 1.18.2.3 src/jpilot.c; cvs diff -u -r 1.115.2.20 -r 1.115.2.21 src/main.c; cvs diff -u -r 1.25.2.4 -r 1.25.2.5 src/matcher_parser_parse.y; cvs diff -u -r 1.28.2.1 -r 1.28.2.2 src/mbox.c; cvs diff -u -r 1.56.2.25 -r 1.56.2.26 src/pop.c; cvs diff -u -r 1.105.2.9 -r 1.105.2.10 src/prefs_account.c; cvs diff -u -r 1.10.2.6 -r 1.10.2.7 src/prefs_gtk.c; cvs diff -u -r 1.1.2.4 -r 1.1.2.5 src/prefs_msg_colors.c; cvs diff -u -r 1.47.2.9 -r 1.47.2.10 src/procheader.c; cvs diff -u -r 1.49.2.10 -r 1.49.2.11 src/procmime.c; cvs diff -u -r 1.17.2.5 -r 1.17.2.6 src/procmime.h; cvs diff -u -r 1.150.2.10 -r 1.150.2.11 src/procmsg.c; cvs diff -u -r 1.395.2.35 -r 1.395.2.36 src/summaryview.c; cvs diff -u -r 1.96.2.22 -r 1.96.2.23 src/textview.c; cvs diff -u -r 1.1.4.1 -r 1.1.4.2 src/common/base64.c; cvs diff -u -r 1.1.2.4 -r 1.1.2.5 src/common/partial_download.c; cvs diff -u -r 1.13.2.9 -r 1.13.2.10 src/common/socket.c; cvs diff -u -r 1.7.2.2 -r 1.7.2.3 src/common/sylpheed.c; cvs diff -u -r 1.36.2.8 -r 1.36.2.9 src/common/utils.c; cvs diff -u -r 1.20.2.7 -r 1.20.2.8 src/common/utils.h; cvs diff -u -r 1.5.2.5 -r 1.5.2.6 src/gtk/pluginwindow.c; cvs diff -u -r 1.1.2.11 -r 1.1.2.12 src/gtk/quicksearch.c; cvs diff -u -r 1.13.2.3 -r 1.13.2.4 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.9.2.4 -r 1.9.2.5 src/plugins/clamav/clamav_plugin_gtk.c; cvs diff -u -r 1.1.2.1 -r 1.1.2.2 src/plugins/pgpmime/passphrase.c; cvs diff -u -r 1.1.2.5 -r 1.1.2.6 src/plugins/pgpmime/pgpmime.c; cvs diff -u -r 1.1.2.4 -r 1.1.2.5 src/plugins/pgpmime/plugin.c; cvs diff -u -r 1.1.2.1 -r 1.1.2.2 src/plugins/pgpmime/prefs_gpg.c; cvs diff -u -r 1.1.2.1 -r 1.1.2.2 src/plugins/pgpmime/prefs_gpg.h; cvs diff -u -r 1.1.2.1 -r 1.1.2.2 src/plugins/pgpmime/select-keys.c; cvs diff -u -r 1.1.2.3 -r 1.1.2.4 src/plugins/pgpmime/sgpgme.c; cvs diff -u -r 1.4.2.2 -r 1.4.2.3 src/plugins/spamassassin/libspamc.c; cvs diff -u -r 1.18.2.3 -r 1.18.2.4 src/plugins/spamassassin/spamassassin.c; cvs diff -u -r 1.4.2.1 -r 1.4.2.2 src/plugins/spamassassin/spamassassin.h; cvs diff -u -r 1.23.2.5 -r 1.23.2.6 src/plugins/spamassassin/spamassassin_gtk.c; cvs diff -u -r 1.14.2.11 -r 1.14.2.12 src/plugins/trayicon/trayicon.c; cvs diff -u -r 1.1.4.1 -r 1.1.4.2 src/plugins/trayicon/libeggtrayicon/gtkplugxembed.c; ) > 0.9.12cvs128.1.patchset
index 275327b99dd4e8ccda40c5edbea2fef6d4b5d70a..28e5b5b53c4d1942c95716e2f3d6ff190b09052d 100644 (file)
@@ -11,9 +11,9 @@ MINOR_VERSION=9
 MICRO_VERSION=12
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=126
+EXTRA_VERSION=128
 EXTRA_RELEASE=
-EXTRA_GTK2_VERSION=.2
+EXTRA_GTK2_VERSION=.1
 
 if test \( $EXTRA_VERSION -eq 0 \) -o \( "x$EXTRA_RELEASE" != "x" \); then
     VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}${EXTRA_RELEASE}${EXTRA_GTK2_VERSION}
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 c13a0abffee2ae0d434b021baee45dec7b2a7b8e..aa163d38eecb00ae3405ddb5d44ed06c60241ebb 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);
 
@@ -3486,7 +3484,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 );
 }
 
 /*
@@ -3507,7 +3505,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 */
@@ -4660,18 +4658,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,
@@ -4692,9 +4678,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 c634b0dbf330bbbaf84fa7f9585e7cbd2f377713..a8580c8953235733d67d7e92baa3c94ed49952b7 100644 (file)
@@ -242,7 +242,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)) {
@@ -254,7 +254,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++;
                                }
@@ -290,7 +290,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++;
                                }
@@ -303,10 +303,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++;
                                        }
@@ -329,7 +329,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))) {
@@ -352,7 +352,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++;
                                }
@@ -509,7 +509,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));
@@ -523,7 +523,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;
@@ -555,7 +555,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++;
        }
 }
@@ -697,7 +697,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)
@@ -937,11 +937,11 @@ gchar *conv_iconv_strdup(const gchar *inbuf,
                dest_code = (char *)idest_code;
 
        /* 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);
 
        /* FIXME: unchecked inbuf? Can't see at this level. */
@@ -1291,14 +1291,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;
                        }
@@ -1343,14 +1343,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 2b8773bb8df0b2e6b987aca8a25313b19a5c8bf9..45e96963b1ccb20c19a32a383cf54cad4723ca95 100644 (file)
@@ -1010,8 +1010,6 @@ static SockInfo *sockinfo_from_fd(const gchar *hostname,
        sockinfo->port = port;
        sockinfo->state = CONN_ESTABLISHED;
 
-       usleep(100000);
-
        return sockinfo;
 }
 
index 304e041f72fd5865ab65318dee7fcfce8a943efe..d4d83df0e0182e0e926b4cc834968dc5d08b541e 100644 (file)
@@ -107,7 +107,7 @@ gboolean sylpheed_init(int *argc, char ***argv)
                }
        }
 
-       srandom((gint)time(NULL));
+       srand((gint) time(NULL));
 
 #if USE_OPENSSL
        ssl_init();
index b8151a21cc523217a67a52ed8a34b255874451d8..fa121f9ba753379f57e90bd5cd876779a63f8dea 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"
@@ -113,7 +114,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)
@@ -277,7 +278,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++;
@@ -571,7 +572,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)
@@ -1738,17 +1739,16 @@ const 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);
                        }
@@ -2547,6 +2547,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
@@ -2862,7 +2864,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));
@@ -3260,7 +3262,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;
@@ -3522,7 +3524,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)
@@ -3553,7 +3555,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 0adb6e5f0838adafd6d6f48ae6d3108f19a21a78..59560aeff017d0db8a007a84c45748e0b83c1b6e 100644 (file)
        perror(func); \
 }
 
+#define IS_ASCII(c) (((guchar) c) <= 0177 ? 1 : 0)
+
 #ifdef __cplusplus
 extern "C" {
 #endif
index ea20b479028e15314e20366e95a0a8e54d1f5219..4895d5075b066c64945dc4509bd5a0a1df2aded7 100644 (file)
@@ -2208,7 +2208,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};
                        const gchar *name;
@@ -2321,7 +2321,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"
@@ -3520,7 +3520,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 */
@@ -3537,7 +3537,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)
@@ -3552,7 +3552,7 @@ static gint compose_write_to_file(Compose *compose, FILE *fp, gint action)
                src_codeset = CS_UTF_8;
                /* 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",
@@ -3590,7 +3590,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"),
@@ -3934,7 +3934,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);
@@ -4308,7 +4308,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 c3033deb4fff40f5bc5f5ec8a7f7b251220e7c74..0d18362bd87b7eb51ed43b3880d7c43d13b907ce 100644 (file)
@@ -345,7 +345,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 e35a2abf3848205dd1c6f6d2c75c5aa4d7d4e76b..8f4f1e1bf4d2056912a424e7b132d9cead80f0b3 100644 (file)
@@ -226,7 +226,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 8d023be4662047b48b1cf30ca2753a31da994516..8289532b19ad1543713bd72e18bbf405f0c5d631 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 effe5f446543019b5eb3fc93b31f2e99e02bfbdc..b0f8edd7721a64aa6d61fb335260a151c2999dc2 100644 (file)
@@ -62,6 +62,7 @@
 #include "statusbar.h"
 #include "hooks.h"
 #include "folderutils.h"
+#include "common/partial_download.h"
 
 typedef enum
 {
index 4b098e22b8abfe03fd9302239148939d4039808f..46f4887debd2d6f864d32fad36407dd670b4be5e 100644 (file)
@@ -30,6 +30,7 @@
 
 #include "filesel.h"
 #include "alertpanel.h"
+#include "../inc.h"
 
 typedef struct _PluginWindow
 {
index 9f88fc54247e6c107d6f942a53e07fd3897006ec..e2ac5ef2e47eea0b756dcf1f3b920bc8f400a6a9 100644 (file)
@@ -21,6 +21,8 @@
 #  include "config.h"
 #endif
 
+#include <ctype.h>
+
 #include <gtk/gtk.h>
 #include <gdk/gdkkeysyms.h>
 
index 89e8549c47f8c38d6ddd65709a38926a75a3eeec..01e4e75d1a9ff63f9f79d84eea877daa0777eeb3 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
@@ -3490,7 +3490,7 @@ static gchar *imap_utf8_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 b639fe3f4679e2ce586e57f97cf359f370dd918e..683932d892371c0c1b6446ac5ce3a4e97837e966 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 5ba2971517710647dd1fbcf738d63d09d2b95d9d..046d98f01ec9ae50045a8332188cc3daa5b966d4 100644 (file)
@@ -23,6 +23,8 @@
 
 #include "defs.h"
 
+#include <features.h>
+
 #include <glib.h>
 #include <gtk/gtkmain.h>
 #include <gtk/gtkrc.h>
index ed313557266dc769ff865623b579a45ab1b1c708..ff423054328afab01bfee7ec2028b99b2b67a339 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 4de53d57e4d5130266cca4d2b3cf95e6d0ebe9eb..133f915161c0d1129b6eb293e3ab267c7227bb6f 100644 (file)
@@ -36,6 +36,7 @@
 #include "prefs_gtk.h"
 #include "foldersel.h"
 #include "clamav_plugin.h"
+#include "statusbar.h"
 
 struct ClamAvPage
 {
@@ -226,6 +227,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];
@@ -251,6 +257,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;       
@@ -258,6 +265,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 24fdfa52c48facecea1365f30f0392a33f14fbc4..4fdeb2ade3649b5182f1db7b9d761982b8e38255 100644 (file)
@@ -49,8 +49,6 @@
 #include "utils.h"
 #include "prefs_gpg.h"
 
-extern struct GPGConfig prefs_gpg;
-
 static int grab_all = 0;
 
 static gboolean pass_ack;
@@ -311,11 +309,11 @@ gpgmegtk_passphrase_cb (void *opaque, const char *desc, void **r_hd)
         /* FIXME: cleanup by looking at *r_hd */
         return NULL;
     }
-    if (prefs_gpg.store_passphrase && last_pass != NULL &&
+    if (prefs_gpg_get_config()->store_passphrase && last_pass != NULL &&
         strncmp(desc, "TRY_AGAIN", 9) != 0)
         return g_strdup(last_pass);
 
-    gpgmegtk_set_passphrase_grab (prefs_gpg.passphrase_grab);
+    gpgmegtk_set_passphrase_grab (prefs_gpg_get_config()->passphrase_grab);
     debug_print ("%% requesting passphrase for `%s': ", desc);
     pass = passphrase_mbox (desc);
     gpgmegtk_free_passphrase();
@@ -324,13 +322,13 @@ gpgmegtk_passphrase_cb (void *opaque, const char *desc, void **r_hd)
         gpgme_cancel (ctx);
     }
     else {
-        if (prefs_gpg.store_passphrase) {
+        if (prefs_gpg_get_config()->store_passphrase) {
             last_pass = g_strdup(pass);
             if (mlock(last_pass, strlen(last_pass)) == -1)
                 debug_print("%% locking passphrase failed");
 
-            if (prefs_gpg.store_passphrase_timeout > 0) {
-                gtk_timeout_add(prefs_gpg.store_passphrase_timeout*60*1000,
+            if (prefs_gpg_get_config()->store_passphrase_timeout > 0) {
+                gtk_timeout_add(prefs_gpg_get_config()->store_passphrase_timeout*60*1000,
                                 free_passphrase, NULL);
             }
         }
index 947c5f94f2e5986170a680d47cc39c02bcb08066..2e0ee5089ae518d008046beee0a32c9bb03468b8 100644 (file)
@@ -37,8 +37,6 @@
 #include "prefs_gpg.h"
 #include "passphrase.h"
 
-extern struct GPGConfig prefs_gpg;
-
 typedef struct _PrivacyDataPGP PrivacyDataPGP;
 
 struct _PrivacyDataPGP
@@ -171,7 +169,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");
@@ -202,7 +200,7 @@ static SignatureStatus pgpmime_get_sig_status(MimeInfo *mimeinfo)
        g_return_val_if_fail(data != NULL, SIGNATURE_INVALID);
 
        if (data->sigstatus == GPGME_SIG_STAT_NONE && 
-           prefs_gpg.auto_check_signatures)
+           prefs_gpg_get_config()->auto_check_signatures)
                pgpmime_check_signature(mimeinfo);
        
        return sgpgme_sigstat_gpgme_to_privacy(data->ctx, data->sigstatus);
@@ -215,7 +213,7 @@ static gchar *pgpmime_get_sig_info_short(MimeInfo *mimeinfo)
        g_return_val_if_fail(data != NULL, g_strdup("Error"));
 
        if (data->sigstatus == GPGME_SIG_STAT_NONE && 
-           prefs_gpg.auto_check_signatures)
+           prefs_gpg_get_config()->auto_check_signatures)
                pgpmime_check_signature(mimeinfo);
        
        return sgpgme_sigstat_info_short(data->ctx, data->sigstatus);
@@ -228,7 +226,7 @@ static gchar *pgpmime_get_sig_info_full(MimeInfo *mimeinfo)
        g_return_val_if_fail(data != NULL, g_strdup("Error"));
 
        if (data->sigstatus == GPGME_SIG_STAT_NONE && 
-           prefs_gpg.auto_check_signatures)
+           prefs_gpg_get_config()->auto_check_signatures)
                pgpmime_check_signature(mimeinfo);
        
        return sgpgme_sigstat_info_full(data->ctx, data->sigstatus);
@@ -474,8 +472,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 +558,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 7e10f985cb805c22b87b5844bb56563d53e22007..6e8402e44916e8c7c9465fa3a4cd7dc7b347f1eb 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 958e32c0c5021d20a09270b10c5eb90029c90216..351c8038ed7f0815e346239bb5267a606c540d3f 100644 (file)
@@ -38,115 +38,189 @@ static PrefParam param[] = {
        {"store_passphrase_timeout", "0",
         &prefs_gpg.store_passphrase_timeout, P_INT,
         NULL, NULL, NULL},
-#ifndef __MINGW32__
        {"passphrase_grab", "FALSE", &prefs_gpg.passphrase_grab, P_BOOL,
         NULL, NULL, NULL},
-#endif /* __MINGW32__ */
        {"gpg_warning", "TRUE", &prefs_gpg.gpg_warning, P_BOOL,
         NULL, NULL, NULL},
 
        {NULL, NULL, NULL, P_OTHER, NULL, NULL, NULL}
 };
 
-static void prefs_privacy_create(void)
+struct GPGPage
 {
-       GtkWidget *vbox1;
-       GtkWidget *vbox2;
-       GtkWidget *vbox3;
-       GtkWidget *hbox1;
-       GtkWidget *hbox_spc;
-       GtkWidget *label;
+       PrefsPage page;
+
        GtkWidget *checkbtn_auto_check_signatures;
+        GtkWidget *checkbtn_store_passphrase;  
+        GtkWidget *spinbtn_store_passphrase;  
+        GtkWidget *checkbtn_passphrase_grab;  
+        GtkWidget *checkbtn_gpg_warning;
+};
+
+static void prefs_gpg_create_widget_func(PrefsPage *_page,
+                                        GtkWindow *window,
+                                        gpointer data)
+{
+       struct GPGPage *page = (struct GPGPage *) _page;
+       struct GPGConfig *config;
+
+        /*
+         * BEGIN GLADE CODE 
+         * DO NOT EDIT 
+         */
+       GtkWidget *table;
+       GtkWidget *checkbtn_passphrase_grab;
        GtkWidget *checkbtn_store_passphrase;
+       GtkWidget *checkbtn_auto_check_signatures;
+       GtkWidget *checkbtn_gpg_warning;
+       GtkWidget *label7;
+       GtkWidget *label6;
+       GtkWidget *label9;
+       GtkWidget *label10;
+       GtkWidget *hbox1;
+       GtkWidget *label11;
        GtkObject *spinbtn_store_passphrase_adj;
        GtkWidget *spinbtn_store_passphrase;
-       GtkTooltips *store_tooltip;
-       GtkWidget *checkbtn_passphrase_grab;
-       GtkWidget *checkbtn_gpg_warning;
-
-       vbox1 = gtk_vbox_new (FALSE, VSPACING);
-       gtk_widget_show (vbox1);
-       gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
-
-       vbox2 = gtk_vbox_new (FALSE, 0);
-       gtk_widget_show (vbox2);
-       gtk_box_pack_start (GTK_BOX (vbox1), vbox2, FALSE, FALSE, 0);
-
-       PACK_CHECK_BUTTON (vbox2, checkbtn_auto_check_signatures,
-                          _("Automatically check signatures"));
-
-       PACK_CHECK_BUTTON (vbox2, checkbtn_store_passphrase,
-                          _("Store passphrase in memory temporarily"));
-
-       vbox3 = gtk_vbox_new (FALSE, 0);
-       gtk_widget_show (vbox3);
-       gtk_box_pack_start (GTK_BOX (vbox2), vbox3, FALSE, FALSE, 0);
-
-       hbox1 = gtk_hbox_new (FALSE, 8);
-       gtk_widget_show (hbox1);
-       gtk_box_pack_start (GTK_BOX (vbox3), hbox1, FALSE, FALSE, 0);
-
-       hbox_spc = gtk_hbox_new (FALSE, 0);
-       gtk_widget_show (hbox_spc);
-       gtk_box_pack_start (GTK_BOX (hbox1), hbox_spc, FALSE, FALSE, 0);
-       gtk_widget_set_size_request (hbox_spc, 12, -1);
-
-       label = gtk_label_new (_("Expire after"));
-       gtk_widget_show (label);
-       gtk_box_pack_start (GTK_BOX (hbox1), label, FALSE, FALSE, 0);
-
-       store_tooltip = gtk_tooltips_new();
-
-       spinbtn_store_passphrase_adj = gtk_adjustment_new (0, 0, 1440, 1, 5, 5);
-       spinbtn_store_passphrase = gtk_spin_button_new
-               (GTK_ADJUSTMENT (spinbtn_store_passphrase_adj), 1, 0);
-       gtk_widget_show (spinbtn_store_passphrase);
-       gtk_tooltips_set_tip(GTK_TOOLTIPS(store_tooltip), spinbtn_store_passphrase,
-                            _("Setting to '0' will store the passphrase"
-                              " for the whole session"),
+       GtkWidget *label12;
+       GtkTooltips *tooltips;
+
+       tooltips = gtk_tooltips_new();
+
+       table = gtk_table_new(5, 2, FALSE);
+       gtk_widget_show(table);
+       gtk_container_set_border_width(GTK_CONTAINER(table), 8);
+       gtk_table_set_row_spacings(GTK_TABLE(table), 4);
+       gtk_table_set_col_spacings(GTK_TABLE(table), 8);
+
+       checkbtn_passphrase_grab = gtk_check_button_new_with_label("");
+       gtk_widget_show(checkbtn_passphrase_grab);
+       gtk_table_attach(GTK_TABLE(table), checkbtn_passphrase_grab, 0, 1,
+                        3, 4, (GtkAttachOptions) (GTK_SHRINK | GTK_FILL),
+                        (GtkAttachOptions) (GTK_SHRINK), 0, 0);
+
+       checkbtn_store_passphrase = gtk_check_button_new_with_label("");
+       gtk_widget_show(checkbtn_store_passphrase);
+       gtk_table_attach(GTK_TABLE(table), checkbtn_store_passphrase, 0, 1,
+                        1, 2, (GtkAttachOptions) (GTK_SHRINK | GTK_FILL),
+                        (GtkAttachOptions) (GTK_SHRINK), 0, 0);
+
+       checkbtn_auto_check_signatures =
+           gtk_check_button_new_with_label("");
+       gtk_widget_show(checkbtn_auto_check_signatures);
+       gtk_table_attach(GTK_TABLE(table), checkbtn_auto_check_signatures,
+                        0, 1, 0, 1,
+                        (GtkAttachOptions) (GTK_SHRINK | GTK_FILL),
+                        (GtkAttachOptions) (GTK_SHRINK), 0, 0);
+
+       checkbtn_gpg_warning = gtk_check_button_new_with_label("");
+       gtk_widget_show(checkbtn_gpg_warning);
+       gtk_table_attach(GTK_TABLE(table), checkbtn_gpg_warning, 0, 1, 4,
+                        5, (GtkAttachOptions) (GTK_SHRINK | GTK_FILL),
+                        (GtkAttachOptions) (GTK_SHRINK), 0, 0);
+
+       label7 = gtk_label_new(_("Store passphrase in memory"));
+       gtk_widget_show(label7);
+       gtk_table_attach(GTK_TABLE(table), label7, 1, 2, 1, 2,
+                        (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
+                        (GtkAttachOptions) (GTK_SHRINK), 0, 0);
+       gtk_misc_set_alignment(GTK_MISC(label7), 0, 0.5);
+
+       label6 = gtk_label_new(_("Automatically check signatures"));
+       gtk_widget_show(label6);
+       gtk_table_attach(GTK_TABLE(table), label6, 1, 2, 0, 1,
+                        (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
+                        (GtkAttachOptions) (GTK_SHRINK), 0, 0);
+       gtk_misc_set_alignment(GTK_MISC(label6), 0, 0.5);
+
+       label9 =
+           gtk_label_new(_("Grab input while entering a passphrase"));
+       gtk_widget_show(label9);
+       gtk_table_attach(GTK_TABLE(table), label9, 1, 2, 3, 4,
+                        (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
+                        (GtkAttachOptions) (GTK_SHRINK), 0, 0);
+       gtk_misc_set_alignment(GTK_MISC(label9), 0, 0.5);
+
+       label10 =
+           gtk_label_new(_
+                         ("Display warning on startup if GnuPG doesn't work"));
+       gtk_widget_show(label10);
+       gtk_table_attach(GTK_TABLE(table), label10, 1, 2, 4, 5,
+                        (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
+                        (GtkAttachOptions) (GTK_SHRINK), 0, 0);
+       gtk_misc_set_alignment(GTK_MISC(label10), 0, 0.5);
+
+       hbox1 = gtk_hbox_new(FALSE, 8);
+       gtk_widget_show(hbox1);
+       gtk_table_attach(GTK_TABLE(table), hbox1, 1, 2, 2, 3,
+                        (GtkAttachOptions) (GTK_SHRINK | GTK_FILL),
+                        (GtkAttachOptions) (GTK_SHRINK), 0, 0);
+
+       label11 = gtk_label_new(_("Expire after"));
+       gtk_widget_show(label11);
+       gtk_box_pack_start(GTK_BOX(hbox1), label11, FALSE, FALSE, 0);
+
+       spinbtn_store_passphrase_adj =
+           gtk_adjustment_new(1, 0, 1440, 1, 10, 10);
+       spinbtn_store_passphrase =
+           gtk_spin_button_new(GTK_ADJUSTMENT
+                               (spinbtn_store_passphrase_adj), 1, 0);
+       gtk_widget_show(spinbtn_store_passphrase);
+       gtk_box_pack_start(GTK_BOX(hbox1), spinbtn_store_passphrase, FALSE,
+                          FALSE, 0);
+       gtk_widget_set_usize(spinbtn_store_passphrase, 64, -2);
+       gtk_tooltips_set_tip(tooltips, spinbtn_store_passphrase,
+                            _
+                            ("Setting to '0' will store the passphrase for the whole session"),
                             NULL);
-       gtk_box_pack_start (GTK_BOX (hbox1), spinbtn_store_passphrase, FALSE, FALSE, 0);
-       gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbtn_store_passphrase),
-                                    TRUE);
-       gtk_widget_set_size_request (spinbtn_store_passphrase, 64, -1);
-
-       label = gtk_label_new (_("minute(s) "));
-       gtk_widget_show (label);
-       gtk_box_pack_start (GTK_BOX (hbox1), label, FALSE, FALSE, 0);
-
-       hbox1 = gtk_hbox_new (FALSE, 8);
-       gtk_widget_show (hbox1);
-       gtk_box_pack_start (GTK_BOX (vbox3), hbox1, FALSE, FALSE, 0);
-
-       hbox_spc = gtk_hbox_new (FALSE, 0);
-       gtk_widget_show (hbox_spc);
-       gtk_box_pack_start (GTK_BOX (hbox1), hbox_spc, FALSE, FALSE, 0);
-       gtk_widget_set_size_request (hbox_spc, 12, -1);
-
-       SET_TOGGLE_SENSITIVITY (checkbtn_store_passphrase, vbox3);
-
-#ifndef __MINGW32__
-       PACK_CHECK_BUTTON (vbox2, checkbtn_passphrase_grab,
-                          _("Grab input while entering a passphrase"));
-#endif
-
-       PACK_CHECK_BUTTON
-               (vbox2, checkbtn_gpg_warning,
-                _("Display warning on startup if GnuPG doesn't work"));
+       gtk_spin_button_set_numeric(GTK_SPIN_BUTTON
+                                   (spinbtn_store_passphrase), TRUE);
+
+       label12 = gtk_label_new(_("minute(s)"));
+       gtk_widget_show(label12);
+       gtk_box_pack_start(GTK_BOX(hbox1), label12, TRUE, TRUE, 0);
+       gtk_misc_set_alignment(GTK_MISC(label12), 0.0, 0.5);
+        /* 
+         * END GLADE CODE
+         */
+
+       config = prefs_gpg_get_config();
+
+       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_auto_check_signatures), config->auto_check_signatures);
+       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_store_passphrase), config->store_passphrase);
+       gtk_spin_button_set_value(GTK_SPIN_BUTTON(spinbtn_store_passphrase), (float) config->store_passphrase_timeout);
+       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_passphrase_grab), config->passphrase_grab);
+       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_gpg_warning), config->gpg_warning);
+
+       page->checkbtn_auto_check_signatures = checkbtn_auto_check_signatures;
+       page->checkbtn_store_passphrase = checkbtn_store_passphrase;
+       page->spinbtn_store_passphrase = spinbtn_store_passphrase;
+       page->checkbtn_passphrase_grab = checkbtn_passphrase_grab;
+       page->checkbtn_gpg_warning = checkbtn_gpg_warning;
+
+       page->page.widget = table;
+}
 
-       hbox1 = gtk_hbox_new (FALSE, 8);
-       gtk_widget_show (hbox1);
-       gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
+static void prefs_gpg_destroy_widget_func(PrefsPage *_page)
+{
+}
 
-/*
-       privacy.checkbtn_auto_check_signatures
-                                            = checkbtn_auto_check_signatures;
-       privacy.checkbtn_store_passphrase    = checkbtn_store_passphrase;
-       privacy.spinbtn_store_passphrase     = spinbtn_store_passphrase;
-       privacy.spinbtn_store_passphrase_adj = spinbtn_store_passphrase_adj;
-       privacy.checkbtn_passphrase_grab     = checkbtn_passphrase_grab;
-       privacy.checkbtn_gpg_warning         = checkbtn_gpg_warning;
-*/
+static void prefs_gpg_save_func(PrefsPage *_page)
+{
+       struct GPGPage *page = (struct GPGPage *) _page;
+       GPGConfig *config = prefs_gpg_get_config();
+
+       config->auto_check_signatures =
+               gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->checkbtn_auto_check_signatures));
+       config->store_passphrase = 
+               gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->checkbtn_store_passphrase));
+       config->store_passphrase_timeout = 
+               gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(page->spinbtn_store_passphrase));
+       config->passphrase_grab = 
+               gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->checkbtn_passphrase_grab));
+       config->gpg_warning = 
+               gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->checkbtn_gpg_warning));
+
+       prefs_gpg_save_config();
 }
 
 GPGConfig *prefs_gpg_get_config(void)
@@ -159,16 +233,16 @@ void prefs_gpg_save_config(void)
        PrefFile *pfile;
        gchar *rcpath;
 
-       debug_print("Saving GPGME config\n");
+       debug_print("Saving GPG config\n");
 
        rcpath = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, COMMON_RC, NULL);
        pfile = prefs_write_open(rcpath);
        g_free(rcpath);
-       if (!pfile || (prefs_set_block_label(pfile, "GPGME") < 0))
+       if (!pfile || (prefs_set_block_label(pfile, "GPG") < 0))
                return;
 
        if (prefs_write_param(param, pfile->fp) < 0) {
-               g_warning("failed to write GPGME configuration to file\n");
+               g_warning("failed to write GPG configuration to file\n");
                prefs_file_close_revert(pfile);
                return;
        }
@@ -177,12 +251,29 @@ void prefs_gpg_save_config(void)
        prefs_file_close(pfile);
 }
 
+static struct GPGPage gpg_page;
+
 void prefs_gpg_init()
 {
+       static gchar *path[3];
+
        prefs_set_default(param);
-       prefs_read_config(param, "GPGME", COMMON_RC);
+       prefs_read_config(param, "GPG", COMMON_RC);
+
+        path[0] = _("Privacy");
+        path[1] = _("GPG");
+        path[2] = NULL;
+
+        gpg_page.page.path = path;
+        gpg_page.page.create_widget = prefs_gpg_create_widget_func;
+        gpg_page.page.destroy_widget = prefs_gpg_destroy_widget_func;
+        gpg_page.page.save_page = prefs_gpg_save_func;
+        gpg_page.page.weight = 30.0;
+
+        prefs_gtk_register_page((PrefsPage *) &gpg_page);
 }
 
 void prefs_gpg_done()
 {
+       prefs_gtk_unregister_page((PrefsPage *) &gpg_page);
 }
index 055f22756a9737e168bce7c71917ce4eeb3efa11..2952e4a2e8ba93f842cd433ffb41516861d2bbba 100644 (file)
@@ -22,12 +22,13 @@ typedef struct GPGConfig GPGConfig;
 struct GPGConfig
 {
        gboolean auto_check_signatures;
-       gboolean gpg_signature_popup;
        gboolean store_passphrase;
        gint store_passphrase_timeout;
        gboolean passphrase_grab;
        gboolean gpg_warning;
 };
 
-void prefs_gpg_init();
-void prefs_gpg_done();
+void prefs_gpg_init(void);
+void prefs_gpg_done(void);
+void prefs_gpg_save_config(void);
+struct GPGConfig *prefs_gpg_get_config();
index 0d09c845e10de89d26c7d96b0f75b2b0560a1a6c..3b72e7c61fe97df510c7a490d63f6b84adea101d 100644 (file)
@@ -487,7 +487,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..271a6ad3709f2a056814f96d9f9d112bdb6b02bc 100644 (file)
@@ -37,8 +37,6 @@
 #include "prefs_gpg.h"
 #include "select-keys.h"
 
-extern struct GPGConfig prefs_gpg;
-
 static void idle_function_for_gpgme(void)
 {
        while (gtk_events_pending())
@@ -235,7 +233,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);
@@ -313,7 +311,7 @@ void sgpgme_init()
                debug_print("gpgme_engine_version:\n%s\n",
                            gpgme_get_engine_info());
 
-               if (prefs_gpg.gpg_warning) {
+               if (prefs_gpg_get_config()->gpg_warning) {
                        AlertValue val;
 
                        val = alertpanel_message_with_disable
@@ -322,7 +320,7 @@ void sgpgme_init()
                                   "to be upgraded.\n"
                                   "OpenPGP support disabled."), ALERT_WARNING);
                        if (val & G_ALERTDISABLE)
-                               prefs_gpg.gpg_warning = FALSE;
+                               prefs_gpg_get_config()->gpg_warning = FALSE;
                }
        }
 
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 9416003ba7379c45b5d789a13af849003c98da48..f7aaab6f56beae5fae305602d93f02e5ead2a77c 100644 (file)
@@ -36,6 +36,7 @@
 #include "prefs_gtk.h"
 #include "foldersel.h"
 #include "spamassassin.h"
+#include "statusbar.h"
 #include "menu.h"
 
 struct SpamAssassinPage
@@ -438,6 +439,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)
@@ -465,6 +471,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;       
@@ -472,6 +479,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 fae0c2b279fdb355a263a07edfe4740d3c73b8f6..5db6d7843ddead5252217d8a7b0d2698ef71b5f2 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 c7add0aff50f3b7218ef9c57506e4d7074617efc..eadeed90ddc4aa913fc137a8c39353ffda12d97c 100644 (file)
@@ -40,6 +40,7 @@
 #include "prefs_common.h"
 #include "main.h"
 #include "alertpanel.h"
+#include "gtk/manage_window.h"
 
 #include "eggtrayicon.h"
 #include "newmail.xpm"
index f0c3cf903fc9018fa657d6a009e63c513c1211a1..fa7492b204148cb09211a9de561748e59717e7bf 100644 (file)
--- a/src/pop.c
+++ b/src/pop.c
@@ -476,7 +476,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 146ddcd3f36c79bc8dd7226841dba293d45b2f5b..fa622b7032343ffab3473c0389254a7659b96b00 100644 (file)
@@ -1633,20 +1633,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 98bc2cbb53b26112bc62b50a3d5add88a3c560b3..a8eff16907a91eada8d8ac9712107fc46b91c613 100644 (file)
@@ -108,7 +108,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;
@@ -395,7 +395,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) =
@@ -557,7 +557,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;
@@ -588,7 +588,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 1999f58fee7cdc71c3dc2947e264cccb4656eaff..d18a9c0ecb6b2249a53d48c9fd0a716466196448 100644 (file)
@@ -60,9 +60,6 @@ typedef struct _MsgColorsPage
 
 static GtkWidget *color_dialog;
 
-static gboolean 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,14 +221,6 @@ void prefs_msg_colors_create_widget(PrefsPage *_page, GtkWindow *window,
        prefs_msg_colors->page.widget = table;
 }
 
-static gboolean prefs_quote_colors_key_pressed(GtkWidget *widget,
-                                          GdkEventKey *event, gpointer data)
-{
-       if (event && event->keyval == GDK_Escape)
-               gtk_main_quit();
-       return FALSE;
-}
-
 static void quote_color_set_dialog(GtkWidget *widget, gpointer data)
 {
        gchar *type = (gchar *)data;
index 89ee463005daa335a5024c49cfd4def85cd4533f..7aaae5e4ae8aa58395da2f4bb36c946b734ef684 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 157094d6e98e044098141e08d4f666d7e55c37f8..1fdead7ec186da26eb2a1a4c5be209f58a826a77 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;
@@ -349,11 +349,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;
@@ -385,8 +385,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;
        }
 
@@ -425,10 +425,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;
@@ -449,12 +449,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;
        }
@@ -872,7 +872,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)
@@ -973,14 +973,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;
@@ -1125,9 +1125,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);
@@ -1148,7 +1148,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;
@@ -1157,7 +1157,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);
 
@@ -1194,9 +1194,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);
@@ -1210,7 +1210,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);
                        }
                        
@@ -1377,7 +1377,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;
 
@@ -1470,7 +1470,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;
 
@@ -1582,8 +1582,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);
@@ -1608,7 +1608,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:
@@ -1639,8 +1639,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);
@@ -1653,7 +1653,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';
@@ -1696,8 +1696,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);
@@ -1705,7 +1705,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 ce4bbdefb4da9ae366a23a2d1d34cdf1e8bf9d01..8fc152a14c0866041d69bde86a32e10e7ca71826 100644 (file)
@@ -4844,7 +4844,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);
@@ -4886,7 +4886,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 e23d2a32621e19b4142e2313db14207e8d81a46b..8ec158b460e27afb253d487a9bf333af13f5e1fd 100644 (file)
@@ -372,7 +372,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) {
@@ -422,7 +422,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;
                 
@@ -445,7 +445,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;
                         }
                         
@@ -570,7 +570,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) && 
@@ -600,7 +600,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, "");
@@ -647,7 +647,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;
        }
@@ -679,14 +679,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)