aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers/local/camel-local-folder.h
diff options
context:
space:
mode:
authorNot Zed <NotZed@HelixCode.com>2000-11-16 21:27:21 +0800
committerMichael Zucci <zucchi@src.gnome.org>2000-11-16 21:27:21 +0800
commitd424adcf6301d996942eef1332f3a61e16b709c2 (patch)
tree6f6bf5d6aaf3e2bf1eb463458f4f3ac96832874c /camel/providers/local/camel-local-folder.h
parentbe8b8b1cea99ef242c42b751c271c579b53ae2e5 (diff)
downloadgsoc2013-evolution-d424adcf6301d996942eef1332f3a61e16b709c2.tar
gsoc2013-evolution-d424adcf6301d996942eef1332f3a61e16b709c2.tar.gz
gsoc2013-evolution-d424adcf6301d996942eef1332f3a61e16b709c2.tar.bz2
gsoc2013-evolution-d424adcf6301d996942eef1332f3a61e16b709c2.tar.lz
gsoc2013-evolution-d424adcf6301d996942eef1332f3a61e16b709c2.tar.xz
gsoc2013-evolution-d424adcf6301d996942eef1332f3a61e16b709c2.tar.zst
gsoc2013-evolution-d424adcf6301d996942eef1332f3a61e16b709c2.zip
Check the uid string is all digits before trying to write a 'standard'
2000-11-16 Not Zed <NotZed@HelixCode.com> * providers/local/camel-local-summary.c (local_summary_encode_x_evolution): Check the uid string is all digits before trying to write a 'standard' x-ev header. * providers/local/camel-maildir-summary.c (camel_maildir_summary_info_to_name): Convert an info into a maildir name:info filename. (camel_maildir_summary_name_to_info): Convert a name:info filename into an info, and tell us if it didn't match it. (message_info_new): When creating a new filename, gets its info from the flags field. Likewise if creating from an existing file, extract the flags. (maildir_summary_sync): Remove a small memleak. Also, if our flags and that requires a filename change, perform that here. (message_info_new): Get the received date from the filename. Also, dont overwirte the uid if we have one. (maildir_summary_check): Sort the summary in received order before completion. (maildir_summary_next_uid_string): Test the name for collusions before we give it out. Retry, and if that fails, well, I guess we collide :( * providers/local/camel-mbox-folder.c (mbox_lock): Implement mbox locking. (mbox_unlock): And unlocking. (mbox_append_message): Lock the folder for write before doing anything. (mbox_get_message): Lock the folder for read before doing anything. * providers/local/camel-local-folder.c (camel_local_folder_lock): Implement something here. We handle the recursive ability but pass the locking to the folder itself. (camel_local_folder_unlock): Likewise for unlocking. (local_lock): Default - do nothing, return success. (local_unlock): Same. (local_sync): Changed slightly for locking api changes, and also, only lock around the sync process itself. * camel-lock.c: New file - utility functions for locking using different strategies and/or for locking folders safely. * Makefile.am (libcamel_la_SOURCES): Adde camel-lock.[ch] svn path=/trunk/; revision=6592
Diffstat (limited to 'camel/providers/local/camel-local-folder.h')
-rw-r--r--camel/providers/local/camel-local-folder.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/camel/providers/local/camel-local-folder.h b/camel/providers/local/camel-local-folder.h
index fa0ad34e84..914f996f9a 100644
--- a/camel/providers/local/camel-local-folder.h
+++ b/camel/providers/local/camel-local-folder.h
@@ -32,6 +32,7 @@ extern "C" {
#include <camel/camel-folder-search.h>
#include <libibex/ibex.h>
#include "camel-local-summary.h"
+#include "camel-lock.h"
/* #include "camel-store.h" */
@@ -46,6 +47,7 @@ typedef struct {
guint32 flags; /* open mode flags */
int locked; /* lock counter */
+ CamelLockType locktype; /* what type of lock we have */
char *base_path; /* base path of the local folder */
char *folder_path; /* the path to the folder itself */
@@ -67,10 +69,10 @@ typedef struct {
CamelLocalSummary *(*create_summary)(const char *path, const char *folder, ibex *index);
/* Lock the folder for my operations */
- int (*lock)(CamelLocalFolder *);
+ int (*lock)(CamelLocalFolder *, CamelLockType type, CamelException *ex);
/* Unlock the folder for my operations */
- int (*unlock)(CamelLocalFolder *);
+ void (*unlock)(CamelLocalFolder *);
} CamelLocalFolderClass;
@@ -84,8 +86,8 @@ CamelType camel_local_folder_get_type(void);
/* Lock the folder for internal use. May be called repeatedly */
/* UNIMPLEMENTED */
-int camel_local_folder_lock(CamelLocalFolder *lf, CamelException *ex);
-int camel_local_folder_unlock(CamelLocalFolder *lf, CamelException *ex);
+int camel_local_folder_lock(CamelLocalFolder *lf, CamelLockType type, CamelException *ex);
+int camel_local_folder_unlock(CamelLocalFolder *lf);
#ifdef __cplusplus
}