From b1a4da002f0414ceb1c8f579edba47c600762a9c Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Tue, 2 Jan 2001 22:07:44 +0000 Subject: IMAP randomness. * providers/imap/camel-imap-stream.[ch]: Remove. To be replaced. * providers/imap/Makefile.am (libcamelimapinclude_HEADERS): Remove camel-imap-stream.h * providers/imap/camel-imap-utils.c (imap_parse_flag_list): Take a char ** instead of char *, to return the position at the end of parsing like the string parsing functions. (imap_parse_string_generic): New function to parse a string, nstring, or astring. (imap_parse_nstring, imap_parse_astring): Now macros (imap_parse_string): Added * providers/imap/camel-imap-folder.h: Remove the "exists" field from CamelImapFolder. * providers/imap/camel-imap-folder.c: Remove unused include of camel-imap-stream.h. (camel_imap_folder_init): Remove no-longer-relevant summary initialization. (camel_imap_folder_new): Update for imap_parse_flag_list change, exists removal, and imap_rescan. (imap_rescan): New function that does most of the work of the old imap_refresh_info, but taking "exists" as an argument instead of getting it from the folder. Also calls camel_imap_folder_changed to do the summary updating and signalling, rather than duplicating that code. (imap_refresh_info): Just call imap_rescan (using the size of the folder summary as "exists"). (imap_update_summary): Update for imap_parse_flag_list change (camel_imap_folder_changed): Update for "exists" change. svn path=/trunk/; revision=7216 --- camel/providers/imap/camel-imap-utils.h | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'camel/providers/imap/camel-imap-utils.h') diff --git a/camel/providers/imap/camel-imap-utils.h b/camel/providers/imap/camel-imap-utils.h index 015ad91e16..d6df958ac9 100644 --- a/camel/providers/imap/camel-imap-utils.h +++ b/camel/providers/imap/camel-imap-utils.h @@ -28,7 +28,7 @@ extern "C" { #pragma } #endif /* __cplusplus }*/ -#include +#include "camel-folder-summary.h" char *imap_next_word (const char *buf); @@ -39,10 +39,16 @@ char *imap_next_word (const char *buf); gboolean imap_parse_list_response (const char *buf, int *flags, char *sep, char **folder); char *imap_create_flag_list (guint32 flags); -guint32 imap_parse_flag_list (const char *flag_list); - -char *imap_parse_nstring (char **str_p, int *len); -char *imap_parse_astring (char **str_p, int *len); +guint32 imap_parse_flag_list (char **flag_list); + +enum { IMAP_STRING, IMAP_NSTRING, IMAP_ASTRING }; +char *imap_parse_string_generic (char **str_p, int *len, int type); +#define imap_parse_string(str_p, len_p) \ + imap_parse_string_generic (str_p, len_p, IMAP_STRING) +#define imap_parse_nstring(str_p, len_p) \ + imap_parse_string_generic (str_p, len_p, IMAP_NSTRING) +#define imap_parse_astring(str_p, len_p) \ + imap_parse_string_generic (str_p, len_p, IMAP_ASTRING) char *imap_quote_string (const char *str); -- cgit v1.2.3