diff options
author | Not Zed <NotZed@Ximian.com> | 2003-08-28 03:50:25 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2003-08-28 03:50:25 +0800 |
commit | 7dea6c9dc22d7be2f2069bb2372d2df9df2abdd5 (patch) | |
tree | fe3c66020637a15c20a71b2ef0fbe71a73c2631d /camel/camel-file-utils.c | |
parent | 6b615eaf55a664686b2513f0ae6701e338ace46b (diff) | |
download | gsoc2013-evolution-7dea6c9dc22d7be2f2069bb2372d2df9df2abdd5.tar.gz gsoc2013-evolution-7dea6c9dc22d7be2f2069bb2372d2df9df2abdd5.tar.zst gsoc2013-evolution-7dea6c9dc22d7be2f2069bb2372d2df9df2abdd5.zip |
implement PERSISTENT_PROPERTIES, for index mode.
2003-08-27 Not Zed <NotZed@Ximian.com>
* providers/local/camel-local-folder.c (local_getv): implement
PERSISTENT_PROPERTIES, for index mode.
* camel-object.c (cobject_state_read): Also add property reading,
and bump version to 1.
(cobject_state_write): add persistent property writing.
2003-08-26 Not Zed <NotZed@Ximian.com>
* camel-folder.c (folder_getv): chain up properly.
* camel-file-utils.c (camel_file_util_savename): helper to create
a .#filename filename.
* providers/local/camel-local-folder.c
(camel_local_folder_construct): init meta-data for local folders.
(local_getv): chain up properly, if args are not processed, rather
than don't if they aren't.
2003-08-23 Not Zed <NotZed@Ximian.com>
* camel-object.c (cobject_class_init): added a new event,
meta_changed.
(camel_object_meta_set, camel_object_meta_get): meta-data api.
(camel_object_free_hooks): Free meta-data if it is set on the
object.
* providers/local/camel-local-folder.c
(camel_local_folder_get_type): setup a property list for local
folders, just 'index_body' at present.
svn path=/trunk/; revision=22388
Diffstat (limited to 'camel/camel-file-utils.c')
-rw-r--r-- | camel/camel-file-utils.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/camel/camel-file-utils.c b/camel/camel-file-utils.c index c6e2a0fea2..540fef2739 100644 --- a/camel/camel-file-utils.c +++ b/camel/camel-file-utils.c @@ -514,3 +514,33 @@ camel_write (int fd, const char *buf, size_t n) return written; } + +/** + * camel_file_util_savename: + * @filename: + * + * Builds a filename of the form ".#" + @filename, used to create + * a two-stage commit file write. + * + * Return value: ".#" + filename. It must be free'd with g_free(). + **/ +char * +camel_file_util_savename(const char *filename) +{ + char *name, *slash; + int off; + + name = g_malloc(strlen(filename)+3); + slash = strrchr(filename, '/'); + if (slash) { + off = slash-filename; + + memcpy(name, filename, off+1); + memcpy(name + off+1, ".#", 2); + strcpy(name + off+3, filename+off+1); + } else { + sprintf(name, ".#%s", filename); + } + + return name; +} |