diff options
author | Michael Zucci <zucchi@src.gnome.org> | 2004-09-20 13:59:55 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2004-09-20 13:59:55 +0800 |
commit | ef6a3af717132e0750f226fa8a0ee0f3c98e19f0 (patch) | |
tree | f4ed25f7a247a8ccb855a8d940777e7a3d21a3e3 /camel | |
parent | 96111b1f1487ca3fe454b340a73ba927cc6bfb83 (diff) | |
download | gsoc2013-evolution-ef6a3af717132e0750f226fa8a0ee0f3c98e19f0.tar gsoc2013-evolution-ef6a3af717132e0750f226fa8a0ee0f3c98e19f0.tar.gz gsoc2013-evolution-ef6a3af717132e0750f226fa8a0ee0f3c98e19f0.tar.bz2 gsoc2013-evolution-ef6a3af717132e0750f226fa8a0ee0f3c98e19f0.tar.lz gsoc2013-evolution-ef6a3af717132e0750f226fa8a0ee0f3c98e19f0.tar.xz gsoc2013-evolution-ef6a3af717132e0750f226fa8a0ee0f3c98e19f0.tar.zst gsoc2013-evolution-ef6a3af717132e0750f226fa8a0ee0f3c98e19f0.zip |
Merged notzed-eplugin-2-branch to head.
svn path=/trunk/; revision=27300
Diffstat (limited to 'camel')
74 files changed, 666 insertions, 116 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog index f2e820ad58..cb8f2adc3e 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -310,6 +310,60 @@ CAMEL_GROUPWISE_CFLAGS. (libcamelgroupwise_la_LIBADD): use CAMEL_GROUPWISE_LIBS. +2004-09-07 Not Zed <NotZed@Ximian.com> + + * providers/groupwise/camel-groupwise-provider.c: put the options + in their own section. + +2004-09-06 Not Zed <NotZed@Ximian.com> + + * camel-search-private.c (utf8_get): remove this, and make the + code use camel_utf8_getc instead. Quite a bit faster esp if + optimising with inlines. + + * camel-object.c (check_magic_fail): change the check_magic code + to mostly run from a macro, its worth it. + +2004-09-04 Not Zed <NotZed@Ximian.com> + + * providers/local/camel-mbox-summary.c (message_info_new): fix + cast issue. + + * providers/pop3/camel-pop3-engine.c (get_capabilities): remove + some unused variables. + + * camel-object.h: remove camel-i18n.h, fixed all c files where + appropriate. + +2004-08-25 Not Zed <NotZed@Ximian.com> + + * camel-list-utils.[ch]: Copied e_dlist* stuff to here, part of + removing e-util dependency on camel. + +2004-08-05 Not Zed <NotZed@Ximian.com> + + * providers/local/camel-local-provider.c: same. + + * providers/imap/camel-imap-provider.c: put the extra stuff into a + 'general' section. + + * providers/imapp/camel-imapp-provider.c: same. + + * providers/pop3/camel-pop3-provider.c: make sure each section + start has a name. + +2004-08-03 Not Zed <NotZed@Ximian.com> + + * camel-url.c (camel_url_set_param): when clearing a param, use + remove_data instead of set_data_full. craptatious glib at it + again. + + * providers/nntp/camel-nntp-provider.c: turn on ssl option. + +2004-07-07 Not Zed <NotZed@Ximian.com> + + * camel-folder.c: removed filter-rule.h ugh. + 2004-07-02 Christian Neumair <chris@gnome-de.org> * camel-smime-context.c: s/Can't/Cannot/. diff --git a/camel/Makefile.am b/camel/Makefile.am index 2811d95d56..51ec97cfcb 100644 --- a/camel/Makefile.am +++ b/camel/Makefile.am @@ -76,6 +76,7 @@ libcamel_la_SOURCES = \ camel-multipart.c \ camel-multipart-encrypted.c \ camel-multipart-signed.c \ + camel-list-utils.c \ camel-object.c \ camel-operation.c \ camel-partition-table.c \ @@ -181,6 +182,7 @@ libcamelinclude_HEADERS = \ camel-multipart.h \ camel-multipart-encrypted.h \ camel-multipart-signed.h \ + camel-list-utils.h \ camel-object.h \ camel-operation.h \ camel-partition-table.h \ diff --git a/camel/camel-cipher-context.c b/camel/camel-cipher-context.c index f2c017e9c3..212120a5f5 100644 --- a/camel/camel-cipher-context.c +++ b/camel/camel-cipher-context.c @@ -29,6 +29,7 @@ #include <glib.h> +#include "camel-i18n.h" #include "camel-cipher-context.h" #include "camel-stream.h" #include "camel-operation.h" diff --git a/camel/camel-data-cache.c b/camel/camel-data-cache.c index 3a2586e3a9..c531741009 100644 --- a/camel/camel-data-cache.c +++ b/camel/camel-data-cache.c @@ -34,6 +34,7 @@ #include <alloca.h> #endif +#include "camel-i18n.h" #include "camel-data-cache.h" #include "camel-exception.h" #include "camel-stream-fs.h" diff --git a/camel/camel-disco-diary.c b/camel/camel-disco-diary.c index 5080ddea8e..b7bc3d10da 100644 --- a/camel/camel-disco-diary.c +++ b/camel/camel-disco-diary.c @@ -29,6 +29,7 @@ #include <stdio.h> #include <errno.h> +#include "camel-i18n.h" #include "camel-disco-diary.h" #include "camel-disco-folder.h" #include "camel-disco-store.h" diff --git a/camel/camel-disco-folder.c b/camel/camel-disco-folder.c index d45a4da850..7e4e653492 100644 --- a/camel/camel-disco-folder.c +++ b/camel/camel-disco-folder.c @@ -30,6 +30,7 @@ #include "camel-exception.h" #include "camel-session.h" +#include "camel-i18n.h" #define CF_CLASS(o) (CAMEL_FOLDER_CLASS (CAMEL_OBJECT_GET_CLASS (o))) #define CDF_CLASS(o) (CAMEL_DISCO_FOLDER_CLASS (CAMEL_OBJECT_GET_CLASS (o))) diff --git a/camel/camel-disco-store.c b/camel/camel-disco-store.c index a4e2e4990e..c602c1cab8 100644 --- a/camel/camel-disco-store.c +++ b/camel/camel-disco-store.c @@ -32,6 +32,7 @@ #include "camel-disco-folder.h" #include "camel-exception.h" #include "camel-session.h" +#include "camel-i18n.h" #define d(x) diff --git a/camel/camel-filter-driver.c b/camel/camel-filter-driver.c index fb54e4ad6f..cf9889491e 100644 --- a/camel/camel-filter-driver.c +++ b/camel/camel-filter-driver.c @@ -44,8 +44,8 @@ #include "camel-stream-fs.h" #include "camel-stream-mem.h" #include "camel-mime-message.h" - #include "camel-debug.h" +#include "camel-i18n.h" #include "e-util/e-sexp.h" #include "e-util/e-memory.h" diff --git a/camel/camel-filter-search.c b/camel/camel-filter-search.c index a279b9dd96..2d057efc36 100644 --- a/camel/camel-filter-search.c +++ b/camel/camel-filter-search.c @@ -55,7 +55,7 @@ #include "camel-stream-mem.h" #include "camel-stream-fs.h" #include "camel-search-private.h" - +#include "camel-i18n.h" #include "camel-url.h" #define d(x) diff --git a/camel/camel-folder-search.c b/camel/camel-folder-search.c index ab901f3cc8..bb570b8e44 100644 --- a/camel/camel-folder-search.c +++ b/camel/camel-folder-search.c @@ -45,6 +45,7 @@ #include "camel-stream-mem.h" #include "e-util/e-memory.h" #include "camel-search-private.h" +#include "camel-i18n.h" #define d(x) #define r(x) diff --git a/camel/camel-folder.c b/camel/camel-folder.c index b7b01edf5c..30e5ab6b77 100644 --- a/camel/camel-folder.c +++ b/camel/camel-folder.c @@ -33,15 +33,13 @@ #include "camel-store.h" #include "camel-mime-message.h" #include "camel-debug.h" - #include "e-util/e-memory.h" #include "camel-operation.h" - #include "camel-session.h" #include "camel-filter-driver.h" #include "camel-private.h" #include "camel-vtrash-folder.h" -#include "filter/filter-rule.h" +#include "camel-i18n.h" #define d(x) #define w(x) @@ -1822,7 +1820,7 @@ folder_changed (CamelObject *obj, gpointer event_data) && changed->uid_recent->len > 0) driver = camel_session_get_filter_driver(session, (folder->folder_flags & CAMEL_FOLDER_FILTER_RECENT) - ? FILTER_SOURCE_INCOMING : FILTER_SOURCE_JUNKTEST, NULL); + ? "incoming":"junktest", NULL); if (driver) { recents = g_ptr_array_new(); diff --git a/camel/camel-gpg-context.c b/camel/camel-gpg-context.c index c03b095e6e..5dee244fd4 100644 --- a/camel/camel-gpg-context.c +++ b/camel/camel-gpg-context.c @@ -56,9 +56,9 @@ #include "camel-operation.h" #include "camel-mime-part.h" #include "camel-mime-filter-canon.h" - #include "camel-multipart-signed.h" #include "camel-multipart-encrypted.h" +#include "camel-i18n.h" #define d(x) diff --git a/camel/camel-list-utils.c b/camel/camel-list-utils.c new file mode 100644 index 0000000000..36818099e5 --- /dev/null +++ b/camel/camel-list-utils.c @@ -0,0 +1,271 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* + * Authors: Michael Zucchi <notzed@ximian.com> + * + * Copyright 2004 Novell, Inc. (www.novell.com) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU General Public + * License as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + */ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#include <glib.h> + +#include "camel-list-utils.h" + +/** + * camel_dlist_init: + * @v: + * + * Initialise a double-linked list header. All list headers must be + * initialised before use. + **/ +void camel_dlist_init(CamelDList *v) +{ + v->head = (CamelDListNode *)&v->tail; + v->tail = 0; + v->tailpred = (CamelDListNode *)&v->head; +} + +/** + * camel_dlist_addhead: + * @l: An initialised list header. + * @n: A node, the next and prev pointers will be overwritten. + * + * Add the list node @n to the head (start) of the list @l. + * + * Return value: @n. + **/ +CamelDListNode *camel_dlist_addhead(CamelDList *l, CamelDListNode *n) +{ + n->next = l->head; + n->prev = (CamelDListNode *)&l->head; + l->head->prev = n; + l->head = n; + return n; +} + +/** + * camel_dlist_addtail: + * @l: An intialised list header. + * @n: A node, the next and prev pointers will be overwritten. + * + * Add the list onde @n to the tail (end) of the list @l. + * + * Return value: @n. + **/ +CamelDListNode *camel_dlist_addtail(CamelDList *l, CamelDListNode *n) +{ + n->next = (CamelDListNode *)&l->tail; + n->prev = l->tailpred; + l->tailpred->next = n; + l->tailpred = n; + return n; +} + +/** + * camel_dlist_remove: + * @n: A node which is part of a list. + * + * Remove @n from the list it's in. @n must belong to a list. + * + * Return value: @n. + **/ +CamelDListNode *camel_dlist_remove(CamelDListNode *n) +{ + n->next->prev = n->prev; + n->prev->next = n->next; + return n; +} + +/** + * camel_dlist_remhead: + * @l: An initialised list, maybe containing items. + * + * Remove the head node (start) of the list. + * + * xReturn value: The previously first-node in the list, or NULLif @l + * is an empty list. + **/ +CamelDListNode *camel_dlist_remhead(CamelDList *l) +{ + CamelDListNode *n, *nn; + + n = l->head; + nn = n->next; + if (nn) { + nn->prev = n->prev; + l->head = nn; + return n; + } + return NULL; +} + +/** + * camel_dlist_remtail: + * @l: An initialised list, maybe containing items. + * + * Remove the last node in the list. + * + * Return value: The previously last-node in the list, or NULL if @l + * is an empty list. + **/ +CamelDListNode *camel_dlist_remtail(CamelDList *l) +{ + CamelDListNode *n, *np; + + n = l->tailpred; + np = n->prev; + if (np) { + np->next = n->next; + l->tailpred = np; + return n; + } + return NULL; +} + +/** + * camel_dlist_empty: + * @l: An initialised list header. + * + * Returns %TRUE if @l is an empty list. + * + * Return value: %TRUE if @l is an empty list, %FALSE otherwise. + **/ +int camel_dlist_empty(CamelDList *l) +{ + return (l->head == (CamelDListNode *)&l->tail); +} + +/** + * camel_dlist_length: + * @l: An initialised list header. + * + * Returns the number of nodes in the list @l. + * + * Return value: The number of nodes. + **/ +int camel_dlist_length(CamelDList *l) +{ + CamelDListNode *n, *nn; + int count = 0; + + n = l->head; + nn = n->next; + while (nn) { + count++; + n = nn; + nn = n->next; + } + + return count; +} + +/* This is just for orthogonal completeness */ + +void camel_slist_init(CamelSList *v) +{ + v->head = NULL; +} + +CamelSListNode *camel_slist_addhead(CamelSList *l, CamelSListNode *n) +{ + n->next = l->head; + l->head = n; + + return n; +} + +CamelSListNode *camel_slist_addtail(CamelSList *l, CamelSListNode *n) +{ + CamelSListNode *p; + + p = (CamelSListNode *)l; + while (p->next) + p = p->next; + n->next = NULL; + p->next = n; + + return n; +} + +CamelSListNode *camel_slist_remove(CamelSList *l, CamelSListNode *n) +{ + CamelSListNode *p, *q; + + p = (CamelSListNode *)l; + while ( (q = p->next) ) { + if (q == n) { + p->next = n->next; + return n; + } + p = q; + } + + g_warning("Trying to remove SList node not present in SList"); + + return NULL; +} + +CamelSListNode *camel_slist_remhead(CamelSList *l) +{ + CamelSListNode *n; + + n = l->head; + if (n) + l->head = n->next; + + return n; +} + +CamelSListNode *camel_slist_remtail(CamelSList *l) +{ + CamelSListNode *n, *p; + + n = l->head; + if (l->head == NULL) + return NULL; + p = (CamelSListNode *)l; + while (n->next) { + p = n; + n = n->next; + } + p->next = NULL; + + return n; +} + +int camel_slist_empty(CamelSList *l) +{ + return (l->head == NULL); +} + +int camel_slist_length(CamelSList *l) +{ + CamelSListNode *n; + int count = 0; + + n = l->head; + while (n) { + count++; + n = n->next; + } + + return count; +} + diff --git a/camel/camel-list-utils.h b/camel/camel-list-utils.h new file mode 100644 index 0000000000..6613e15dd0 --- /dev/null +++ b/camel/camel-list-utils.h @@ -0,0 +1,126 @@ +/* + * Authors: Michael Zucchi <notzed@ximian.com> + * + * Copyright 2004 Novell, Inc. (www.novell.com) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU General Public + * License as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + */ + +#ifndef _CAMEL_LIST_UTILS_H +#define _CAMEL_LIST_UTILS_H + +/* This is a copy of Amiga's Exec lists, the head and tail nodes are + * overlapped and merged into a single list header. All operations + * are O(1), including node removal and addition from/to either end of + * the list. It can be used to implement O(1) queues, fifo's and + * normal lists. You don't need the list header to remove the node. */ + +typedef struct _CamelDList CamelDList; +typedef struct _CamelDListNode CamelDListNode; + +/** + * struct _CamelDListNode - A double-linked list node. + * + * @next: The next node link. + * @prev: The previous node link. + * + * A double-linked list node header. Put this at the start of the + * list node structure. Data is stored in the list by subclassing the + * node header rather than using a pointer. Or more normally by just + * duplicating the next and previous pointers for better type safety. + **/ +struct _CamelDListNode { + struct _CamelDListNode *next; + struct _CamelDListNode *prev; +}; + +/** + * struct _CamelDList - A double-linked list header. + * + * @head: The head node's next pointer. + * @tail: The tail node's next pointer. + * @tailpred: The previous node to the tail node. + * + * This is the merging of two separate head and tail nodes into a + * single structure. i.e. if you ahve a NULL terminated head and tail + * node such as head = { first, NULL } and tail = { NULL, last } then + * overlap them at the common NULL, you get this structure. + * + * The list header must be initialised with camel_dlist_init, or by + * using the static CAMEL_DLIST_INITIALISER macro. + **/ +struct _CamelDList { + struct _CamelDListNode *head; + struct _CamelDListNode *tail; + struct _CamelDListNode *tailpred; +}; + +#define CAMEL_DLIST_INITIALISER(l) { (CamelDListNode *)&l.tail, 0, (CamelDListNode *)&l.head } + +void camel_dlist_init(CamelDList *v); +CamelDListNode *camel_dlist_addhead(CamelDList *l, CamelDListNode *n); +CamelDListNode *camel_dlist_addtail(CamelDList *l, CamelDListNode *n); +CamelDListNode *camel_dlist_remove(CamelDListNode *n); +CamelDListNode *camel_dlist_remhead(CamelDList *l); +CamelDListNode *camel_dlist_remtail(CamelDList *l); +int camel_dlist_empty(CamelDList *l); +int camel_dlist_length(CamelDList *l); + +/* This is provided mostly for orthogonality with the dlist structure. + * By making the nodes contain all of the data themselves it + * simplifies memory management. Removing and adding from/to the head + * of the list is O(1), the rest of the operations are O(n). */ + +typedef struct _CamelSListNode CamelSListNode; +typedef struct _CamelSList CamelSList; + +/** + * struct _CamelSListNode - A single-linked list node. + * + * @next: The next node in the list. + * + * A single-linked list node header. Put this at hte start of the + * actual list node structure, or more commonly, just a next pointer. + * Data is stored in the list node by subclassing the node-header + * rather than using a pointer. + **/ +struct _CamelSListNode { + struct _CamelSListNode *next; +}; + +/** + * struct _CamelSList - A single-linked list header. + * + * @head: The head of the list. + * + * This is the header of a single-linked list. + **/ +struct _CamelSList { + struct _CamelSListNode *head; +}; + +#define CAMEL_SLIST_INITIALISER(l) { 0 } + +void camel_slist_init(CamelSList *l); +CamelSListNode *camel_slist_addhead(CamelSList *l, CamelSListNode *n); +CamelSListNode *camel_slist_addtail(CamelSList *l, CamelSListNode *n); +CamelSListNode *camel_slist_remove(CamelSList *l, CamelSListNode *n); +CamelSListNode *camel_slist_remhead(CamelSList *l); +CamelSListNode *camel_slist_remtail(CamelSList *l); +int camel_slist_empty(CamelSList *l); +int camel_slist_length(CamelSList *l); + +#endif diff --git a/camel/camel-movemail.c b/camel/camel-movemail.c index 70807195e5..521d21d0ca 100644 --- a/camel/camel-movemail.c +++ b/camel/camel-movemail.c @@ -42,12 +42,11 @@ #include "camel-movemail.h" #include "camel-exception.h" - #include "camel-mime-parser.h" #include "camel-mime-filter.h" #include "camel-mime-filter-from.h" - #include "camel-lock-client.h" +#include "camel-i18n.h" #define d(x) diff --git a/camel/camel-multipart-encrypted.c b/camel/camel-multipart-encrypted.c index aa036bec23..44ff8a0262 100644 --- a/camel/camel-multipart-encrypted.c +++ b/camel/camel-multipart-encrypted.c @@ -35,6 +35,7 @@ #include "camel-stream-fs.h" #include "camel-mime-utils.h" #include "camel-mime-part.h" +#include "camel-i18n.h" static void camel_multipart_encrypted_class_init (CamelMultipartEncryptedClass *klass); static void camel_multipart_encrypted_init (gpointer object, gpointer klass); diff --git a/camel/camel-multipart-signed.c b/camel/camel-multipart-signed.c index 5dca448a7f..e25f1c46a4 100644 --- a/camel/camel-multipart-signed.c +++ b/camel/camel-multipart-signed.c @@ -49,6 +49,7 @@ #include "camel-seekable-substream.h" #include "camel-mime-filter-crlf.h" #include "camel-mime-filter-canon.h" +#include "camel-i18n.h" #define d(x) /*(printf("%s(%d): ", __FILE__, __LINE__),(x)) #include <stdio.h>;*/ diff --git a/camel/camel-object.c b/camel/camel-object.c index ed62737c23..a866ae95a2 100644 --- a/camel/camel-object.c +++ b/camel/camel-object.c @@ -863,7 +863,7 @@ CamelType camel_name_to_type(const char *name) } static char * -desc_data(CamelObject *o, int ok) +desc_data(CamelObject *o, guint32 ok) { char *what; @@ -885,17 +885,22 @@ desc_data(CamelObject *o, int ok) return what; } +#define check_magic(o, ctype, omagic) \ + ( ((CamelObject *)(o))->magic == (omagic) \ + && (ctype)->magic == CAMEL_OBJECT_CLASS_MAGIC) \ + ? 1 : check_magic_fail(o, ctype, omagic) + static gboolean -check_magic(void *o, CamelType ctype, int isob) +check_magic_fail(void *o, CamelType ctype, guint32 omagic) { char *what, *to; - what = desc_data(o, isob?CAMEL_OBJECT_MAGIC:CAMEL_OBJECT_CLASS_MAGIC); + what = desc_data(o, omagic); to = desc_data((CamelObject *)ctype, CAMEL_OBJECT_CLASS_MAGIC); if (what || to) { if (what == NULL) { - if (isob) + if (omagic == CAMEL_OBJECT_MAGIC) what = g_strdup_printf("OBJECT '%s'", ((CamelObject *)o)->klass->name); else what = g_strdup_printf("OBJECT '%s'", ((CamelObjectClass *)o)->name); @@ -917,7 +922,7 @@ camel_object_is(CamelObject *o, CamelType ctype) { CamelObjectClass *k; - g_return_val_if_fail(check_magic(o, ctype, TRUE), FALSE); + g_return_val_if_fail(check_magic(o, ctype, CAMEL_OBJECT_MAGIC), FALSE); k = o->klass; while (k) { @@ -932,7 +937,7 @@ camel_object_is(CamelObject *o, CamelType ctype) gboolean camel_object_class_is(CamelObjectClass *k, CamelType ctype) { - g_return_val_if_fail(check_magic(k, ctype, FALSE), FALSE); + g_return_val_if_fail(check_magic(k, ctype, CAMEL_OBJECT_CLASS_MAGIC), FALSE); while (k) { if (k == ctype) @@ -948,7 +953,7 @@ camel_object_cast(CamelObject *o, CamelType ctype) { CamelObjectClass *k; - g_return_val_if_fail(check_magic(o, ctype, TRUE), NULL); + g_return_val_if_fail(check_magic(o, ctype, CAMEL_OBJECT_MAGIC), NULL); k = o->klass; while (k) { @@ -967,7 +972,7 @@ camel_object_class_cast(CamelObjectClass *k, CamelType ctype) { CamelObjectClass *r = k; - g_return_val_if_fail(check_magic(k, ctype, FALSE), NULL); + g_return_val_if_fail(check_magic(k, ctype, CAMEL_OBJECT_CLASS_MAGIC), NULL); while (k) { if (k == ctype) @@ -1330,6 +1335,55 @@ int camel_object_get(void *vo, CamelException *ex, ...) return ret; } +void *camel_object_get_ptr(void *vo, CamelException *ex, int tag) +{ + CamelObject *o = vo; + CamelArgGetV args; + CamelObjectClass *klass = o->klass; + int ret = 0; + void *val = NULL; + + g_return_val_if_fail(CAMEL_IS_OBJECT(o), NULL); + g_return_val_if_fail((tag & CAMEL_ARG_TYPE) == CAMEL_ARG_OBJ + || (tag & CAMEL_ARG_TYPE) == CAMEL_ARG_STR + || (tag & CAMEL_ARG_TYPE) == CAMEL_ARG_PTR, 0); + + /* woefully inefficient, *shrug */ + args.argc = 1; + args.argv[0].tag = tag; + args.argv[0].ca_ptr = &val; + + ret = klass->getv(o, ex, &args); + if (ret != 0) + return NULL; + else + return val; +} + +int camel_object_get_int(void *vo, CamelException *ex, int tag) +{ + CamelObject *o = vo; + CamelArgGetV args; + CamelObjectClass *klass = o->klass; + int ret = 0; + int val = 0; + + g_return_val_if_fail(CAMEL_IS_OBJECT(o), 0); + g_return_val_if_fail((tag & CAMEL_ARG_TYPE) == CAMEL_ARG_INT + || (tag & CAMEL_ARG_TYPE) == CAMEL_ARG_BOO, 0); + + /* woefully inefficient, *shrug */ + args.argc = 1; + args.argv[0].tag = tag; + args.argv[0].ca_int = &val; + + ret = klass->getv(o, ex, &args); + if (ret != 0) + return 0; + else + return val; +} + int camel_object_getv(void *vo, CamelException *ex, CamelArgGetV *args) { g_return_val_if_fail(CAMEL_IS_OBJECT(vo), -1); diff --git a/camel/camel-object.h b/camel/camel-object.h index cbdf9fdb2c..9ee9c45345 100644 --- a/camel/camel-object.h +++ b/camel/camel-object.h @@ -39,9 +39,6 @@ extern "C" { #include <camel/camel-arg.h> #include <camel/camel-types.h> /* this is a @##$@#SF stupid header */ -/* this crap shouldn't be here */ -#include <camel/camel-i18n.h> - /* turn on so that camel_object_class_dump_tree() dumps object instances as well */ #define CAMEL_OBJECT_TRACK_INSTANCES @@ -235,6 +232,10 @@ int camel_object_setv(void *obj, struct _CamelException *ex, CamelArgV *); int camel_object_get(void *obj, struct _CamelException *ex, ...); int camel_object_getv(void *obj, struct _CamelException *ex, CamelArgGetV *); +/* not very efficient one-time calls */ +void *camel_object_get_ptr(void *vo, CamelException *ex, int tag); +int camel_object_get_int(void *vo, CamelException *ex, int tag); + /* meta-data for user-specific data */ char *camel_object_meta_get(void *vo, const char * name); gboolean camel_object_meta_set(void *vo, const char * name, const char *value); diff --git a/camel/camel-provider.c b/camel/camel-provider.c index e2cc71523c..889188f672 100644 --- a/camel/camel-provider.c +++ b/camel/camel-provider.c @@ -41,8 +41,8 @@ #include "camel-exception.h" #include "camel-string-utils.h" #include "camel-vee-store.h" - #include "e-util/e-msgport.h" +#include "camel-i18n.h" /* table of CamelProviderModule's */ static GHashTable *module_table; diff --git a/camel/camel-provider.h b/camel/camel-provider.h index 46977d4844..c61398133d 100644 --- a/camel/camel-provider.h +++ b/camel/camel-provider.h @@ -160,6 +160,9 @@ typedef struct { /* Flags describing the provider, flags describing its URLs */ int flags, url_flags; + + /* The ConfEntry and AutoDetect functions will probably be + * DEPRECATED in a future release */ /* Extra configuration information */ CamelProviderConfEntry *extra_conf; diff --git a/camel/camel-sasl-anonymous.c b/camel/camel-sasl-anonymous.c index 9b97fdbc07..c0957831b2 100644 --- a/camel/camel-sasl-anonymous.c +++ b/camel/camel-sasl-anonymous.c @@ -29,7 +29,7 @@ #include "camel-sasl-anonymous.h" #include "camel-internet-address.h" #include <string.h> - +#include "camel-i18n.h" CamelServiceAuthType camel_sasl_anonymous_authtype = { N_("Anonymous"), diff --git a/camel/camel-sasl-cram-md5.c b/camel/camel-sasl-cram-md5.c index f544d48a22..611c54178b 100644 --- a/camel/camel-sasl-cram-md5.c +++ b/camel/camel-sasl-cram-md5.c @@ -30,6 +30,7 @@ #include "camel-mime-utils.h" #include "camel-service.h" #include <e-util/md5-utils.h> +#include "camel-i18n.h" CamelServiceAuthType camel_sasl_cram_md5_authtype = { N_("CRAM-MD5"), diff --git a/camel/camel-sasl-digest-md5.c b/camel/camel-sasl-digest-md5.c index e421bd5294..36fd2f5808 100644 --- a/camel/camel-sasl-digest-md5.c +++ b/camel/camel-sasl-digest-md5.c @@ -37,6 +37,7 @@ #include "camel-charset-map.h" #include "camel-mime-utils.h" #include "camel-sasl-digest-md5.h" +#include "camel-i18n.h" #define d(x) diff --git a/camel/camel-sasl-login.c b/camel/camel-sasl-login.c index f6c3c9e5f8..ffe8f645bd 100644 --- a/camel/camel-sasl-login.c +++ b/camel/camel-sasl-login.c @@ -27,6 +27,7 @@ #include <string.h> #include "camel-sasl-login.h" #include "camel-service.h" +#include "camel-i18n.h" CamelServiceAuthType camel_sasl_login_authtype = { N_("Login"), diff --git a/camel/camel-sasl-ntlm.c b/camel/camel-sasl-ntlm.c index ad341353c4..32c47aebd1 100644 --- a/camel/camel-sasl-ntlm.c +++ b/camel/camel-sasl-ntlm.c @@ -22,11 +22,12 @@ #include <config.h> #endif -#include "camel-sasl-ntlm.h" - #include <ctype.h> #include <string.h> +#include "camel-sasl-ntlm.h" +#include "camel-i18n.h" + CamelServiceAuthType camel_sasl_ntlm_authtype = { N_("NTLM / SPA"), diff --git a/camel/camel-sasl-plain.c b/camel/camel-sasl-plain.c index 48d1fc9a01..debff64abd 100644 --- a/camel/camel-sasl-plain.c +++ b/camel/camel-sasl-plain.c @@ -27,6 +27,7 @@ #include <string.h> #include "camel-sasl-plain.h" #include "camel-service.h" +#include "camel-i18n.h" CamelServiceAuthType camel_sasl_plain_authtype = { N_("PLAIN"), diff --git a/camel/camel-sasl-popb4smtp.c b/camel/camel-sasl-popb4smtp.c index fb940b012a..6eebf5873e 100644 --- a/camel/camel-sasl-popb4smtp.c +++ b/camel/camel-sasl-popb4smtp.c @@ -31,6 +31,7 @@ #include "camel-sasl-popb4smtp.h" #include "camel-service.h" #include "camel-session.h" +#include "camel-i18n.h" CamelServiceAuthType camel_sasl_popb4smtp_authtype = { N_("POP before SMTP"), diff --git a/camel/camel-search-private.c b/camel/camel-search-private.c index 2ba908bea3..d3805f6a7f 100644 --- a/camel/camel-search-private.c +++ b/camel/camel-search-private.c @@ -41,13 +41,50 @@ #include "camel-multipart.h" #include "camel-stream-mem.h" #include "e-util/e-sexp.h" - #include "camel-search-private.h" +#include "camel-i18n.h" #include <glib/gunicode.h> #define d(x) +static inline guint32 +camel_utf8_getc(const unsigned char **ptr) +{ + register unsigned char *p = (unsigned char *)*ptr; + register unsigned char c, r; + register guint32 v, m; + +again: + r = *p++; +loop: + if (r < 0x80) { + *ptr = p; + v = r; + } else if (r < 0xfe) { /* valid start char? */ + v = r; + m = 0x7f80; /* used to mask out the length bits */ + do { + c = *p++; + if ((c & 0xc0) != 0x80) { + r = c; + goto loop; + } + v = (v<<6) | (c & 0x3f); + r<<=1; + m<<=5; + } while (r & 0x40); + + *ptr = p; + + v &= ~m; + } else { + goto again; + } + + return v; +} + /* builds the regex into pattern */ /* taken from camel-folder-search, with added isregex & exception parameter */ /* Basically, we build a new regex, either based on subset regex's, or substrings, @@ -195,28 +232,12 @@ header_soundex (const char *header, const char *match) return truth; } -/* FIXME: This is stupidly slow and needs to be removed */ -static gunichar -utf8_get (const char **inp) -{ - const unsigned char *p = *inp; - gunichar c; - - if (p == NULL) - return 0; - - c = g_utf8_get_char (p); - *inp = g_unichar_validate (c) ? g_utf8_next_char (p) : NULL; - - return c; -} - const char * camel_ustrstrcase (const char *haystack, const char *needle) { gunichar *nuni, *puni; gunichar u; - const char *p; + const unsigned char *p; g_return_val_if_fail (haystack != NULL, NULL); g_return_val_if_fail (needle != NULL, NULL); @@ -229,25 +250,25 @@ camel_ustrstrcase (const char *haystack, const char *needle) puni = nuni = g_alloca (sizeof (gunichar) * strlen (needle)); p = needle; - while ((u = utf8_get (&p))) + while ((u = camel_utf8_getc(&p))) *puni++ = g_unichar_tolower (u); /* NULL means there was illegal utf-8 sequence */ if (!p) return NULL; - p = haystack; - while ((u = utf8_get (&p))) { + p = (const unsigned char *)haystack; + while ((u = camel_utf8_getc(&p))) { gunichar c; c = g_unichar_tolower (u); /* We have valid stripped char */ if (c == nuni[0]) { - const gchar *q = p; + const unsigned char *q = p; gint npos = 1; while (nuni + npos < puni) { - u = utf8_get (&q); + u = camel_utf8_getc(&q); if (!q || !u) return NULL; @@ -283,8 +304,8 @@ camel_ustrcasecmp (const char *s1, const char *s2) CAMEL_SEARCH_COMPARE (s1, s2, NULL); - u1 = utf8_get (&s1); - u2 = utf8_get (&s2); + u1 = camel_utf8_getc((const unsigned char **)&s1); + u2 = camel_utf8_getc((const unsigned char **)&s2); while (u1 && u2) { u1 = g_unichar_tolower (u1); u2 = g_unichar_tolower (u2); @@ -293,8 +314,8 @@ camel_ustrcasecmp (const char *s1, const char *s2) else if (u1 > u2) return 1; - u1 = utf8_get (&s1); - u2 = utf8_get (&s2); + u1 = camel_utf8_getc((const unsigned char **)&s1); + u2 = camel_utf8_getc((const unsigned char **)&s2); } /* end of one of the strings ? */ @@ -313,8 +334,8 @@ camel_ustrncasecmp (const char *s1, const char *s2, size_t len) CAMEL_SEARCH_COMPARE (s1, s2, NULL); - u1 = utf8_get (&s1); - u2 = utf8_get (&s2); + u1 = camel_utf8_getc((const unsigned char **)&s1); + u2 = camel_utf8_getc((const unsigned char **)&s2); while (len > 0 && u1 && u2) { u1 = g_unichar_tolower (u1); u2 = g_unichar_tolower (u2); @@ -324,8 +345,8 @@ camel_ustrncasecmp (const char *s1, const char *s2, size_t len) return 1; len--; - u1 = utf8_get (&s1); - u2 = utf8_get (&s2); + u1 = camel_utf8_getc((const unsigned char **)&s1); + u2 = camel_utf8_getc((const unsigned char **)&s2); } if (len == 0) @@ -344,7 +365,7 @@ camel_ustrncasecmp (const char *s1, const char *s2, size_t len) static int header_match(const char *value, const char *match, camel_search_match_t how) { - const char *p; + const unsigned char *p; int vlen, mlen; if (how == CAMEL_SEARCH_MATCH_SOUNDEX) @@ -357,7 +378,7 @@ header_match(const char *value, const char *match, camel_search_match_t how) /* from dan the man, if we have mixed case, perform a case-sensitive match, otherwise not */ - p = match; + p = (const unsigned char *)match; while (*p) { if (isupper(*p)) { switch (how) { @@ -495,43 +516,6 @@ camel_search_message_body_contains (CamelDataWrapper *object, regex_t *pattern) return truth; } -static inline guint32 -camel_utf8_getc(const unsigned char **ptr) -{ - register unsigned char *p = (unsigned char *)*ptr; - register unsigned char c, r; - register guint32 v, m; - -again: - r = *p++; -loop: - if (r < 0x80) { - *ptr = p; - v = r; - } else if (r < 0xfe) { /* valid start char? */ - v = r; - m = 0x7f80; /* used to mask out the length bits */ - do { - c = *p++; - if ((c & 0xc0) != 0x80) { - r = c; - goto loop; - } - v = (v<<6) | (c & 0x3f); - r<<=1; - m<<=5; - } while (r & 0x40); - - *ptr = p; - - v &= ~m; - } else { - goto again; - } - - return v; -} - static void output_c(GString *w, guint32 c, int *type) { diff --git a/camel/camel-service.c b/camel/camel-service.c index d108f124c0..11f97cd2a6 100644 --- a/camel/camel-service.c +++ b/camel/camel-service.c @@ -35,7 +35,6 @@ #include <errno.h> #include "e-util/e-msgport.h" - #include "e-util/e-host-utils.h" #include "camel-service.h" @@ -43,6 +42,7 @@ #include "camel-exception.h" #include "camel-operation.h" #include "camel-private.h" +#include "camel-i18n.h" #define d(x) #define w(x) diff --git a/camel/camel-session.c b/camel/camel-session.c index 5a1b8799f1..73cfe72afd 100644 --- a/camel/camel-session.c +++ b/camel/camel-session.c @@ -41,6 +41,7 @@ #include "camel-file-utils.h" #include "camel-string-utils.h" #include "camel-url.h" +#include "camel-i18n.h" #include "camel-private.h" diff --git a/camel/camel-smime-context.c b/camel/camel-smime-context.c index 019d16d1d9..d1c228a4a9 100644 --- a/camel/camel-smime-context.c +++ b/camel/camel-smime-context.c @@ -56,6 +56,7 @@ #include "camel-smime-context.h" #include "camel-operation.h" +#include "camel-i18n.h" #define d(x) diff --git a/camel/camel-store.c b/camel/camel-store.c index 677e92a7cb..4075170eb8 100644 --- a/camel/camel-store.c +++ b/camel/camel-store.c @@ -39,6 +39,7 @@ #include "camel-vtrash-folder.h" #include "camel-exception.h" #include "camel-private.h" +#include "camel-i18n.h" #define d(x) #define w(x) diff --git a/camel/camel-tcp-stream-ssl.c b/camel/camel-tcp-stream-ssl.c index 791083186c..ef89d8c88e 100644 --- a/camel/camel-tcp-stream-ssl.c +++ b/camel/camel-tcp-stream-ssl.c @@ -61,6 +61,7 @@ #include "camel-session.h" #include "camel-certdb.h" #include "camel-operation.h" +#include "camel-i18n.h" /* from md5-utils.h */ void md5_get_digest (const char *buffer, int buffer_size, unsigned char digest[16]); diff --git a/camel/camel-url.c b/camel/camel-url.c index 7033913ea0..4e3e600981 100644 --- a/camel/camel-url.c +++ b/camel/camel-url.c @@ -37,6 +37,7 @@ #include "camel-mime-utils.h" #include "camel-object.h" #include "camel-string-utils.h" +#include "camel-i18n.h" static void copy_param (GQuark key_id, gpointer data, gpointer user_data); static void output_param (GQuark key_id, gpointer data, gpointer user_data); @@ -428,7 +429,10 @@ camel_url_set_port (CamelURL *url, int port) void camel_url_set_param (CamelURL *url, const char *name, const char *value) { - g_datalist_set_data_full (&url->params, name, value ? g_strdup (value) : NULL, g_free); + if (value) + g_datalist_set_data_full (&url->params, name, g_strdup(value), g_free); + else + g_datalist_remove_data(&url->params, name); } const char * diff --git a/camel/camel-vee-folder.c b/camel/camel-vee-folder.c index c74b001cc9..1475c1da25 100644 --- a/camel/camel-vee-folder.c +++ b/camel/camel-vee-folder.c @@ -38,6 +38,7 @@ #include "camel-vee-store.h" /* for open flags */ #include "camel-private.h" #include "camel-debug.h" +#include "camel-i18n.h" #include "e-util/md5-utils.h" diff --git a/camel/camel-vee-store.c b/camel/camel-vee-store.c index d0ef62aff4..770a0239c1 100644 --- a/camel/camel-vee-store.c +++ b/camel/camel-vee-store.c @@ -27,6 +27,7 @@ #include "camel-vee-folder.h" #include "camel-private.h" +#include "camel-i18n.h" #include <string.h> diff --git a/camel/camel-vtrash-folder.c b/camel/camel-vtrash-folder.c index 667b574646..91e4b8a3a1 100644 --- a/camel/camel-vtrash-folder.c +++ b/camel/camel-vtrash-folder.c @@ -27,6 +27,7 @@ #include "camel-store.h" #include "camel-vee-store.h" #include "camel-mime-message.h" +#include "camel-i18n.h" #include <string.h> diff --git a/camel/providers/groupwise/camel-groupwise-provider.c b/camel/providers/groupwise/camel-groupwise-provider.c index 4a426bc3d5..cd6f2e8071 100644 --- a/camel/providers/groupwise/camel-groupwise-provider.c +++ b/camel/providers/groupwise/camel-groupwise-provider.c @@ -37,6 +37,7 @@ #include "camel-url.h" #include "camel-sasl.h" #include "camel-gw-listener.h" +#include "camel-i18n.h" static void add_hash (guint *hash, char *s); static guint groupwise_url_hash (gconstpointer key); @@ -55,6 +56,7 @@ CamelProviderConfEntry groupwise_conf_entries[] = { N_("Check for new messages in all folders"), "1" }, { CAMEL_PROVIDER_CONF_SECTION_END }, + { CAMEL_PROVIDER_CONF_SECTION_START, "general", NULL, N_("Options") }, { CAMEL_PROVIDER_CONF_CHECKBOX, "filter", NULL, N_("Apply filters to new messages in Inbox on this server"), "0" }, { CAMEL_PROVIDER_CONF_CHECKBOX, "filter_junk", NULL, @@ -63,6 +65,7 @@ CamelProviderConfEntry groupwise_conf_entries[] = { N_("Only check for Junk messages in the INBOX folder"), "0" }, { CAMEL_PROVIDER_CONF_CHECKBOX, "offline_sync", NULL, N_("Automatically synchronize remote mail locally"), "0" }, + { CAMEL_PROVIDER_CONF_SECTION_END }, /* extra Groupwise configuration settings */ {CAMEL_PROVIDER_CONF_SECTION_START, "soapport", NULL, @@ -82,7 +85,6 @@ CamelProviderConfEntry groupwise_conf_entries[] = { { CAMEL_PROVIDER_CONF_SECTION_END }, - { CAMEL_PROVIDER_CONF_END } }; diff --git a/camel/providers/imap/camel-imap-command.c b/camel/providers/imap/camel-imap-command.c index e7cfc051a5..0e8db51896 100644 --- a/camel/providers/imap/camel-imap-command.c +++ b/camel/providers/imap/camel-imap-command.c @@ -43,7 +43,7 @@ #include <camel/camel-private.h> #include <camel/camel-utf8.h> #include <camel/camel-session.h> - +#include "camel-i18n.h" extern int camel_verbose_debug; diff --git a/camel/providers/imap/camel-imap-folder.c b/camel/providers/imap/camel-imap-folder.c index f7a33e6ab4..5eaafcbf13 100644 --- a/camel/providers/imap/camel-imap-folder.c +++ b/camel/providers/imap/camel-imap-folder.c @@ -23,7 +23,6 @@ * USA */ - #ifdef HAVE_CONFIG_H #include <config.h> #endif @@ -70,6 +69,7 @@ #include "camel-string-utils.h" #include "camel-file-utils.h" #include "camel-debug.h" +#include "camel-i18n.h" #define d(x) x diff --git a/camel/providers/imap/camel-imap-message-cache.c b/camel/providers/imap/camel-imap-message-cache.c index 559c6d2f88..17fa9ca5c8 100644 --- a/camel/providers/imap/camel-imap-message-cache.c +++ b/camel/providers/imap/camel-imap-message-cache.c @@ -36,6 +36,7 @@ #include "camel-data-wrapper.h" #include "camel-exception.h" #include "camel-stream-fs.h" +#include "camel-i18n.h" static void finalize (CamelImapMessageCache *cache); static void stream_finalize (CamelObject *stream, gpointer event_data, gpointer user_data); diff --git a/camel/providers/imap/camel-imap-provider.c b/camel/providers/imap/camel-imap-provider.c index bef15f681f..3539fa2cd7 100644 --- a/camel/providers/imap/camel-imap-provider.c +++ b/camel/providers/imap/camel-imap-provider.c @@ -32,6 +32,7 @@ #include "camel-session.h" #include "camel-url.h" #include "camel-sasl.h" +#include "camel-i18n.h" static void add_hash (guint *hash, char *s); static guint imap_url_hash (gconstpointer key); @@ -60,6 +61,7 @@ CamelProviderConfEntry imap_conf_entries[] = { { CAMEL_PROVIDER_CONF_ENTRY, "namespace", "override_namespace", N_("Namespace") }, { CAMEL_PROVIDER_CONF_SECTION_END }, + { CAMEL_PROVIDER_CONF_SECTION_START, "general", NULL, N_("Options") }, { CAMEL_PROVIDER_CONF_CHECKBOX, "filter", NULL, N_("Apply filters to new messages in INBOX on this server"), "0" }, { CAMEL_PROVIDER_CONF_CHECKBOX, "filter_junk", NULL, @@ -68,6 +70,7 @@ CamelProviderConfEntry imap_conf_entries[] = { N_("Only check for Junk messages in the INBOX folder"), "0" }, { CAMEL_PROVIDER_CONF_CHECKBOX, "offline_sync", NULL, N_("Automatically synchronize remote mail locally"), "0" }, + { CAMEL_PROVIDER_CONF_SECTION_END }, { CAMEL_PROVIDER_CONF_END } }; diff --git a/camel/providers/imap/camel-imap-store.c b/camel/providers/imap/camel-imap-store.c index af031bdc47..85e8b8fc04 100644 --- a/camel/providers/imap/camel-imap-store.c +++ b/camel/providers/imap/camel-imap-store.c @@ -24,7 +24,6 @@ * */ - #ifdef HAVE_CONFIG_H #include <config.h> #endif @@ -59,11 +58,10 @@ #include "camel-sasl.h" #include "camel-utf8.h" #include "camel-string-utils.h" - #include "camel-imap-private.h" #include "camel-private.h" - #include "camel-debug.h" +#include "camel-i18n.h" #define d(x) diff --git a/camel/providers/imapp/camel-imapp-provider.c b/camel/providers/imapp/camel-imapp-provider.c index b8d6e53374..21ec24cb77 100644 --- a/camel/providers/imapp/camel-imapp-provider.c +++ b/camel/providers/imapp/camel-imapp-provider.c @@ -31,11 +31,12 @@ #include "camel/camel-session.h" #include "camel/camel-url.h" #include "camel/camel-sasl.h" +#include "camel/camel-i18n.h" #include "camel-imapp-store.h" CamelProviderConfEntry imapp_conf_entries[] = { - { CAMEL_PROVIDER_CONF_SECTION_START, NULL, NULL, + { CAMEL_PROVIDER_CONF_SECTION_START, "storage", NULL, N_("Message storage") }, { CAMEL_PROVIDER_CONF_SECTION_END }, { CAMEL_PROVIDER_CONF_END } diff --git a/camel/providers/imapp/camel-imapp-store.c b/camel/providers/imapp/camel-imapp-store.c index 290d3c0a17..3c0dac5456 100644 --- a/camel/providers/imapp/camel-imapp-store.c +++ b/camel/providers/imapp/camel-imapp-store.c @@ -48,6 +48,7 @@ #ifdef HAVE_SSL #include "camel/camel-tcp-stream-ssl.h" #endif +#include "camel/camel-i18n.h" #include "camel-imapp-store-summary.h" #include "camel-imapp-store.h" diff --git a/camel/providers/local/camel-local-folder.c b/camel/providers/local/camel-local-folder.c index 2f5cc53223..f18e6c1015 100644 --- a/camel/providers/local/camel-local-folder.c +++ b/camel/providers/local/camel-local-folder.c @@ -48,6 +48,7 @@ #include "camel-stream-filter.h" #include "camel-mime-filter-from.h" #include "camel-exception.h" +#include "camel-i18n.h" #include "camel-local-private.h" diff --git a/camel/providers/local/camel-local-provider.c b/camel/providers/local/camel-local-provider.c index 27fae76695..7411d8f639 100644 --- a/camel/providers/local/camel-local-provider.c +++ b/camel/providers/local/camel-local-provider.c @@ -34,13 +34,16 @@ #include "camel-mbox-store.h" #include "camel-maildir-store.h" #include "camel-spool-store.h" +#include "camel-i18n.h" #define d(x) static CamelProviderConfEntry mh_conf_entries[] = { CAMEL_PROVIDER_CONF_DEFAULT_PATH, + { CAMEL_PROVIDER_CONF_SECTION_START, "general", NULL, N_("Options") }, { CAMEL_PROVIDER_CONF_CHECKBOX, "dotfolders", NULL, N_("Use the `.folders' folder summary file (exmh)"), "0" }, + { CAMEL_PROVIDER_CONF_SECTION_END }, { CAMEL_PROVIDER_CONF_END } }; @@ -73,8 +76,10 @@ static CamelProvider mbox_provider = { static CamelProviderConfEntry maildir_conf_entries[] = { CAMEL_PROVIDER_CONF_DEFAULT_PATH, + { CAMEL_PROVIDER_CONF_SECTION_START, "general", NULL, N_("Options") }, { CAMEL_PROVIDER_CONF_CHECKBOX, "filter", NULL, N_("Apply filters to new messages in INBOX"), "0" }, + { CAMEL_PROVIDER_CONF_SECTION_END }, { CAMEL_PROVIDER_CONF_END } }; @@ -91,8 +96,10 @@ static CamelProvider maildir_provider = { static CamelProviderConfEntry spool_conf_entries[] = { CAMEL_PROVIDER_CONF_DEFAULT_PATH, + { CAMEL_PROVIDER_CONF_SECTION_START, "general", NULL, N_("Options") }, { CAMEL_PROVIDER_CONF_CHECKBOX, "filter", NULL, N_("Apply filters to new messages in INBOX"), "0" }, { CAMEL_PROVIDER_CONF_CHECKBOX, "xstatus", NULL, N_("Store status headers in Elm/Pine/Mutt format"), "0" }, + { CAMEL_PROVIDER_CONF_SECTION_END }, { CAMEL_PROVIDER_CONF_END } }; diff --git a/camel/providers/local/camel-local-store.c b/camel/providers/local/camel-local-store.c index f39f597f08..a89fee16c5 100644 --- a/camel/providers/local/camel-local-store.c +++ b/camel/providers/local/camel-local-store.c @@ -36,6 +36,7 @@ #include "camel-local-store.h" #include "camel-exception.h" #include "camel-url.h" +#include "camel-i18n.h" #include "camel-local-folder.h" #include <camel/camel-text-index.h> diff --git a/camel/providers/local/camel-local-summary.c b/camel/providers/local/camel-local-summary.c index a1f4831675..e515dd54c6 100644 --- a/camel/providers/local/camel-local-summary.c +++ b/camel/providers/local/camel-local-summary.c @@ -35,6 +35,7 @@ #include "camel/camel-mime-message.h" #include "camel/camel-stream-null.h" #include "camel/camel-file-utils.h" +#include "camel/camel-i18n.h" #define w(x) #define io(x) diff --git a/camel/providers/local/camel-maildir-folder.c b/camel/providers/local/camel-maildir-folder.c index 17bc081f94..bd38dcf3d7 100644 --- a/camel/providers/local/camel-maildir-folder.c +++ b/camel/providers/local/camel-maildir-folder.c @@ -39,6 +39,7 @@ #include "camel-data-wrapper.h" #include "camel-mime-message.h" #include "camel-exception.h" +#include "camel-i18n.h" #define d(x) /*(printf("%s(%d): ", __FILE__, __LINE__),(x))*/ diff --git a/camel/providers/local/camel-maildir-store.c b/camel/providers/local/camel-maildir-store.c index 40cdc07e75..9c4097a3cb 100644 --- a/camel/providers/local/camel-maildir-store.c +++ b/camel/providers/local/camel-maildir-store.c @@ -37,6 +37,7 @@ #include "camel-url.h" #include "camel-private.h" #include "camel-maildir-summary.h" +#include "camel-i18n.h" #define d(x) diff --git a/camel/providers/local/camel-maildir-summary.c b/camel/providers/local/camel-maildir-summary.c index edc81a5230..8b15c2b991 100644 --- a/camel/providers/local/camel-maildir-summary.c +++ b/camel/providers/local/camel-maildir-summary.c @@ -42,6 +42,7 @@ #include "camel-private.h" #include "e-util/e-memory.h" +#include "camel-i18n.h" #define d(x) /*(printf("%s(%d): ", __FILE__, __LINE__),(x))*/ @@ -279,7 +280,7 @@ static CamelMessageInfo *message_info_new(CamelFolderSummary * s, struct _camel_ if (info) { d(printf("already seen uid '%s', just summarising instead\n", uid)); camel_folder_summary_info_free(s, mi); - mdi = (CamelMaildirMessageInfo *)mi = info; + mdi = (CamelMaildirMessageInfo *)(mi = info); } /* with maildir we know the real received date, from the filename */ diff --git a/camel/providers/local/camel-mbox-folder.c b/camel/providers/local/camel-mbox-folder.c index 0d86b6d766..a28db10951 100644 --- a/camel/providers/local/camel-mbox-folder.c +++ b/camel/providers/local/camel-mbox-folder.c @@ -42,6 +42,7 @@ #include "camel-stream-filter.h" #include "camel-mime-filter-from.h" #include "camel-exception.h" +#include "camel-i18n.h" #define d(x) /*(printf("%s(%d): ", __FILE__, __LINE__),(x))*/ diff --git a/camel/providers/local/camel-mbox-store.c b/camel/providers/local/camel-mbox-store.c index a2bafd4ab0..76811949fd 100644 --- a/camel/providers/local/camel-mbox-store.c +++ b/camel/providers/local/camel-mbox-store.c @@ -37,6 +37,7 @@ #include "camel-text-index.h" #include "camel-exception.h" #include "camel-url.h" +#include "camel-i18n.h" #define d(x) diff --git a/camel/providers/local/camel-mbox-summary.c b/camel/providers/local/camel-mbox-summary.c index c34df06114..60dcf34c1c 100644 --- a/camel/providers/local/camel-mbox-summary.c +++ b/camel/providers/local/camel-mbox-summary.c @@ -41,6 +41,7 @@ #include "camel/camel-file-utils.h" #include "camel/camel-mime-message.h" #include "camel/camel-operation.h" +#include "camel-i18n.h" #define io(x) #define d(x) /*(printf("%s(%d): ", __FILE__, __LINE__),(x))*/ @@ -255,7 +256,7 @@ message_info_new(CamelFolderSummary *s, struct _camel_header_raw *h) if ((info->flags & CAMEL_MESSAGE_FOLDER_NOTSEEN)) { info->flags &= ~CAMEL_MESSAGE_FOLDER_NOTSEEN; camel_folder_summary_info_free(s, mi); - mbi = (CamelMboxMessageInfo *)mi = info; + mbi = (CamelMboxMessageInfo *)(mi = info); } else { add = 7; d(printf("seen '%s' before, adding anew\n", uid)); diff --git a/camel/providers/local/camel-mh-folder.c b/camel/providers/local/camel-mh-folder.c index 83a11e24e2..5f71ab09ea 100644 --- a/camel/providers/local/camel-mh-folder.c +++ b/camel/providers/local/camel-mh-folder.c @@ -39,6 +39,7 @@ #include "camel-data-wrapper.h" #include "camel-mime-message.h" #include "camel-exception.h" +#include "camel-i18n.h" #define d(x) /*(printf("%s(%d): ", __FILE__, __LINE__),(x))*/ diff --git a/camel/providers/local/camel-mh-store.c b/camel/providers/local/camel-mh-store.c index ee35d8ec25..cc2f3ce9c9 100644 --- a/camel/providers/local/camel-mh-store.c +++ b/camel/providers/local/camel-mh-store.c @@ -34,6 +34,7 @@ #include "camel-exception.h" #include "camel-url.h" #include "camel-private.h" +#include "camel-i18n.h" #include <camel/camel-stream-fs.h> #include <camel/camel-stream-buffer.h> diff --git a/camel/providers/local/camel-mh-summary.c b/camel/providers/local/camel-mh-summary.c index 5dd26ac9ba..d51bf7a108 100644 --- a/camel/providers/local/camel-mh-summary.c +++ b/camel/providers/local/camel-mh-summary.c @@ -40,6 +40,7 @@ #include <camel/camel-mime-message.h> #include "camel-private.h" +#include "camel-i18n.h" #define d(x) /*(printf("%s(%d): ", __FILE__, __LINE__),(x))*/ diff --git a/camel/providers/local/camel-spool-folder.c b/camel/providers/local/camel-spool-folder.c index a1b1901142..026d99402e 100644 --- a/camel/providers/local/camel-spool-folder.c +++ b/camel/providers/local/camel-spool-folder.c @@ -41,10 +41,9 @@ #include "camel-stream-filter.h" #include "camel-mime-filter-from.h" #include "camel-exception.h" - #include "camel-lock-client.h" - #include "camel-local-private.h" +#include "camel-i18n.h" #define d(x) /*(printf("%s(%d): ", __FILE__, __LINE__),(x))*/ diff --git a/camel/providers/local/camel-spool-store.c b/camel/providers/local/camel-spool-store.c index 96278bf538..f1f715e404 100644 --- a/camel/providers/local/camel-spool-store.c +++ b/camel/providers/local/camel-spool-store.c @@ -41,6 +41,7 @@ #include "camel-exception.h" #include "camel-url.h" #include "camel-private.h" +#include "camel-i18n.h" #define d(x) diff --git a/camel/providers/local/camel-spool-summary.c b/camel/providers/local/camel-spool-summary.c index 7991a881cc..3e4fb533ab 100644 --- a/camel/providers/local/camel-spool-summary.c +++ b/camel/providers/local/camel-spool-summary.c @@ -38,6 +38,7 @@ #include "camel-mime-message.h" #include "camel-file-utils.h" #include "camel-operation.h" +#include "camel-i18n.h" #define io(x) #define d(x) /*(printf("%s(%d): ", __FILE__, __LINE__),(x))*/ diff --git a/camel/providers/nntp/camel-nntp-folder.c b/camel/providers/nntp/camel-nntp-folder.c index 04855a2a78..40abfcf5f2 100644 --- a/camel/providers/nntp/camel-nntp-folder.c +++ b/camel/providers/nntp/camel-nntp-folder.c @@ -21,7 +21,6 @@ * USA */ - #ifdef HAVE_CONFIG_H #include <config.h> #endif @@ -50,6 +49,7 @@ #include "camel/camel-multipart.h" #include "camel/camel-mime-part.h" #include "camel/camel-stream-buffer.h" +#include "camel/camel-i18n.h" #include "camel-nntp-summary.h" #include "camel-nntp-store.h" diff --git a/camel/providers/nntp/camel-nntp-provider.c b/camel/providers/nntp/camel-nntp-provider.c index f2b4c1a24d..5780c41f9d 100644 --- a/camel/providers/nntp/camel-nntp-provider.c +++ b/camel/providers/nntp/camel-nntp-provider.c @@ -30,6 +30,7 @@ #include "camel-nntp-store.h" #include "camel-provider.h" #include "camel-session.h" +#include "camel-i18n.h" static void add_hash (guint *hash, char *s); static guint nntp_url_hash (gconstpointer key); @@ -57,7 +58,7 @@ static CamelProvider news_provider = { "news", CAMEL_PROVIDER_IS_REMOTE | CAMEL_PROVIDER_IS_SOURCE | - CAMEL_PROVIDER_IS_STORAGE, + CAMEL_PROVIDER_IS_STORAGE | CAMEL_PROVIDER_SUPPORTS_SSL, CAMEL_URL_NEED_HOST | CAMEL_URL_ALLOW_USER | CAMEL_URL_ALLOW_PASSWORD | CAMEL_URL_ALLOW_AUTH, diff --git a/camel/providers/nntp/camel-nntp-store.c b/camel/providers/nntp/camel-nntp-store.c index 31048e7a12..6d8490d453 100644 --- a/camel/providers/nntp/camel-nntp-store.c +++ b/camel/providers/nntp/camel-nntp-store.c @@ -21,7 +21,6 @@ * USA */ - #ifdef HAVE_CONFIG_H #include <config.h> #endif @@ -52,6 +51,7 @@ #include "camel-nntp-folder.h" #include "camel-nntp-private.h" #include "camel-nntp-resp-codes.h" +#include "camel-i18n.h" #define w(x) extern int camel_verbose_debug; diff --git a/camel/providers/nntp/camel-nntp-summary.c b/camel/providers/nntp/camel-nntp-summary.c index d30fdc6267..6a1d208760 100644 --- a/camel/providers/nntp/camel-nntp-summary.c +++ b/camel/providers/nntp/camel-nntp-summary.c @@ -36,6 +36,7 @@ #include "camel/camel-stream-null.h" #include "camel/camel-operation.h" #include "camel/camel-data-cache.h" +#include "camel/camel-i18n.h" #include "camel-nntp-summary.h" #include "camel-nntp-folder.h" diff --git a/camel/providers/pop3/camel-pop3-engine.c b/camel/providers/pop3/camel-pop3-engine.c index 9c3f8423e9..e79a382359 100644 --- a/camel/providers/pop3/camel-pop3-engine.c +++ b/camel/providers/pop3/camel-pop3-engine.c @@ -33,8 +33,9 @@ #include "camel-pop3-engine.h" #include "camel-pop3-stream.h" -#include <camel/camel-service.h> -#include <camel/camel-sasl.h> +#include "camel-service.h" +#include "camel-sasl.h" +#include "camel-i18n.h" /* max 'outstanding' bytes in output stream, so we can't deadlock waiting for the server to accept our data when pipelining */ @@ -224,8 +225,6 @@ static void get_capabilities(CamelPOP3Engine *pe) { CamelPOP3Command *pc; - unsigned char *line; - unsigned int len; if (!(pe->flags & CAMEL_POP3_ENGINE_DISABLE_EXTENSIONS)) { pc = camel_pop3_engine_command_new(pe, CAMEL_POP3_COMMAND_MULTI, cmd_capa, NULL, "CAPA\r\n"); diff --git a/camel/providers/pop3/camel-pop3-folder.c b/camel/providers/pop3/camel-pop3-folder.c index 1c17079006..23a5bc7d88 100644 --- a/camel/providers/pop3/camel-pop3-folder.c +++ b/camel/providers/pop3/camel-pop3-folder.c @@ -37,6 +37,7 @@ #include "camel-mime-message.h" #include "camel-operation.h" #include "camel-data-cache.h" +#include "camel-i18n.h" #include <e-util/md5-utils.h> diff --git a/camel/providers/pop3/camel-pop3-provider.c b/camel/providers/pop3/camel-pop3-provider.c index 7c3db155a7..7253edfbf4 100644 --- a/camel/providers/pop3/camel-pop3-provider.c +++ b/camel/providers/pop3/camel-pop3-provider.c @@ -32,9 +32,10 @@ #include "camel-session.h" #include "camel-url.h" #include "camel-sasl.h" +#include "camel-i18n.h" CamelProviderConfEntry pop3_conf_entries[] = { - { CAMEL_PROVIDER_CONF_SECTION_START, NULL, NULL, + { CAMEL_PROVIDER_CONF_SECTION_START, "storage", NULL, N_("Message storage") }, { CAMEL_PROVIDER_CONF_CHECKBOX, "keep_on_server", NULL, N_("Leave messages on server"), "0" }, diff --git a/camel/providers/pop3/camel-pop3-store.c b/camel/providers/pop3/camel-pop3-store.c index 96f9295b52..a63aa137e1 100644 --- a/camel/providers/pop3/camel-pop3-store.c +++ b/camel/providers/pop3/camel-pop3-store.c @@ -54,6 +54,7 @@ #ifdef HAVE_SSL #include "camel-tcp-stream-ssl.h" #endif +#include "camel-i18n.h" /* Specified in RFC 1939 */ #define POP3_PORT 110 diff --git a/camel/providers/sendmail/camel-sendmail-provider.c b/camel/providers/sendmail/camel-sendmail-provider.c index 36cbf88a77..0aeb367cf3 100644 --- a/camel/providers/sendmail/camel-sendmail-provider.c +++ b/camel/providers/sendmail/camel-sendmail-provider.c @@ -30,6 +30,7 @@ #include "camel-sendmail-transport.h" #include "camel-session.h" #include "camel-url.h" +#include "camel-i18n.h" static CamelProvider sendmail_provider = { "sendmail", diff --git a/camel/providers/sendmail/camel-sendmail-transport.c b/camel/providers/sendmail/camel-sendmail-transport.c index fbf6f08a6b..a776b9729e 100644 --- a/camel/providers/sendmail/camel-sendmail-transport.c +++ b/camel/providers/sendmail/camel-sendmail-transport.c @@ -40,6 +40,7 @@ #include "camel-data-wrapper.h" #include "camel-stream-fs.h" #include "camel-exception.h" +#include "camel-i18n.h" static char *get_name (CamelService *service, gboolean brief); diff --git a/camel/providers/smtp/camel-smtp-provider.c b/camel/providers/smtp/camel-smtp-provider.c index e9eff37a9d..bff1d847d0 100644 --- a/camel/providers/smtp/camel-smtp-provider.c +++ b/camel/providers/smtp/camel-smtp-provider.c @@ -31,6 +31,7 @@ #include "camel-session.h" #include "camel-url.h" #include "camel-sasl.h" +#include "camel-i18n.h" static CamelProvider smtp_provider = { "smtp", diff --git a/camel/providers/smtp/camel-smtp-transport.c b/camel/providers/smtp/camel-smtp-transport.c index 3245cc68a1..53a2d2cb68 100644 --- a/camel/providers/smtp/camel-smtp-transport.c +++ b/camel/providers/smtp/camel-smtp-transport.c @@ -55,7 +55,7 @@ #include "camel-session.h" #include "camel-exception.h" #include "camel-sasl.h" - +#include "camel-i18n.h" extern int camel_verbose_debug; #define d(x) (camel_verbose_debug ? (x) : 0) |