From d0a6ed17b65560ed07ed005b38fab449dc507aef Mon Sep 17 00:00:00 2001 From: Not Zed Date: Mon, 3 Jun 2002 02:56:35 +0000 Subject: setup/free the mech string. 2002-06-02 Not Zed * camel-sasl.c (camel_sasl_new): (camel_sasl_finalize): setup/free the mech string. * camel-sasl.h: Added 'mech' mechanism string. 2002-06-01 Not Zed * providers/imap/camel-imap-folder.c (imap_getv): Implement. Only the object_description arg. (camel_imap_folder_get_type): Init parent_class holder. * providers/local/camel-local-folder.c (local_getv): Implement, object_description arg. * camel-folder.c (folder_getv): Implement, add a bunch of args you can get -> camel_folder_get_unread_count etc will be going RSN i hope. (camel_folder_finalize): Free cached description string. * camel-object.c (cobject_getv): Implement CAMEL_OBJECT_ARG_DESCRIPTION, just return the classname of the object. (camel_object_getv): (camel_object_get): (camel_object_setv): (camel_object_set): Take object = void *, to simplify usage. (camel_object_setv): Removed unecessary locals. (camel_object_getv): Same. (camel_object_free): New method, free an arg, upto implementations whether args are static/const or not. (cobject_free): Implement a dummy do nothing free. 2002-05-31 Not Zed * camel-vee-folder.c (camel_vee_folder_get_location): new function to get the real location (folder) (and uid) of a vfolder object. Using the folderinfo, since we already have it, maybe it should use the uid. svn path=/trunk/; revision=17073 --- camel/camel-object.h | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'camel/camel-object.h') diff --git a/camel/camel-object.h b/camel/camel-object.h index cf574fe9f6..fddc778dd3 100644 --- a/camel/camel-object.h +++ b/camel/camel-object.h @@ -88,6 +88,15 @@ typedef void (*CamelObjectEventHookFunc) (CamelObject *, gpointer, gpointer); #define CAMEL_INVALID_TYPE (NULL) +/* camel object args */ +enum { + CAMEL_OBJECT_ARG_DESCRIPTION = CAMEL_ARG_FIRST, +}; + +enum { + CAMEL_OBJECT_DESCRIPTION = CAMEL_OBJECT_ARG_DESCRIPTION | CAMEL_ARG_STR, +}; + enum _CamelObjectFlags { CAMEL_OBJECT_DESTROY = (1<<0), }; @@ -147,6 +156,8 @@ struct _CamelObjectClass /* get/set interface */ int (*setv)(struct _CamelObject *, struct _CamelException *ex, CamelArgV *args); int (*getv)(struct _CamelObject *, struct _CamelException *ex, CamelArgGetV *args); + /* we only free 1 at a time, and only pointer types, obviously */ + void (*free)(struct _CamelObject *, guint32 tag, void *ptr); }; /* The type system .... it's pretty simple..... */ @@ -196,10 +207,13 @@ void camel_object_unhook_event(CamelObject *obj, const char *name, CamelObjectEv void camel_object_trigger_event(CamelObject *obj, const char *name, void *event_data); /* get/set methods */ -int camel_object_set(CamelObject *obj, struct _CamelException *ex, ...); -int camel_object_setv(CamelObject *obj, struct _CamelException *ex, CamelArgV *); -int camel_object_get(CamelObject *obj, struct _CamelException *ex, ...); -int camel_object_getv(CamelObject *obj, struct _CamelException *ex, CamelArgGetV *); +int camel_object_set(void *obj, struct _CamelException *ex, ...); +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 *); + +/* free a bunch of objects, list must be 0 terminated */ +void camel_object_free(void *vo, guint32 tag, void *value); #ifdef __cplusplus } -- cgit