aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--camel/ChangeLog5
-rw-r--r--camel/camel-service.c27
-rw-r--r--camel/camel-service.h4
-rw-r--r--camel/providers/pop3/camel-pop3-store.c9
4 files changed, 42 insertions, 3 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index 669a71e114..d70074b805 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,5 +1,10 @@
2000-03-27 Dan Winship <danw@helixcode.com>
+ * camel-service.c (camel_service_free_auth_types): new routine to
+ free the data allocated by camel_service_query_auth_types.
+
+ * providers/pop3/camel-pop3-store.c (free_auth_types): implement
+
* camel-stream-mem.c (camel_stream_mem_new_with_buffer): rename
camel_stream_mem_new_with_buffer to ..._with_byte_array and add a
new ..._with_buffer that takes a char * rather than a GByteArray.
diff --git a/camel/camel-service.c b/camel/camel-service.c
index 19683782c5..394a163ae0 100644
--- a/camel/camel-service.c
+++ b/camel/camel-service.c
@@ -39,6 +39,7 @@ static gboolean _connect_with_url (CamelService *service, Gurl *url,
static gboolean _disconnect(CamelService *service, CamelException *ex);
static gboolean _is_connected (CamelService *service);
static GList * _query_auth_types (CamelService *service);
+static void _free_auth_types (CamelService *service, GList *authtypes);
static void _finalize (GtkObject *object);
static gboolean _set_url (CamelService *service, Gurl *url,
CamelException *ex);
@@ -57,6 +58,7 @@ camel_service_class_init (CamelServiceClass *camel_service_class)
camel_service_class->disconnect = _disconnect;
camel_service_class->is_connected = _is_connected;
camel_service_class->query_auth_types = _query_auth_types;
+ camel_service_class->free_auth_types = _free_auth_types;
/* virtual method overload */
gtk_object_class->finalize = _finalize;
@@ -388,10 +390,31 @@ _query_auth_types (CamelService *service)
* and query what authentication mechanisms it supports.
*
* Return value: a list of CamelServiceAuthType records. The caller
- * must free the list when it is done.
+ * must free the list by calling camel_service_free_auth_types when
+ * it is done.
**/
GList *
camel_service_query_auth_types (CamelService *service)
{
- return CSERV_CLASS(service)->query_auth_types(service);
+ return CSERV_CLASS (service)->query_auth_types (service);
+}
+
+static void
+_free_auth_types (CamelService *service, GList *authtypes)
+{
+ ;
+}
+
+/**
+ * camel_service_free_auth_types: free a type list returned by
+ * camel_service_query_auth_types.
+ * @service: the service
+ * @authtypes: the list of authtypes
+ *
+ * This frees the data allocated by camel_service_query_auth_types.
+ **/
+void
+camel_service_free_auth_types (CamelService *service, GList *authtypes)
+{
+ CSERV_CLASS (service)->free_auth_types (service, authtypes);
}
diff --git a/camel/camel-service.h b/camel/camel-service.h
index d09524c8c4..521db58104 100644
--- a/camel/camel-service.h
+++ b/camel/camel-service.h
@@ -71,6 +71,8 @@ typedef struct {
gboolean (*is_connected) (CamelService *service);
GList * (*query_auth_types) (CamelService *service);
+ void (*free_auth_types) (CamelService *service,
+ GList *authtypes);
} CamelServiceClass;
@@ -109,6 +111,8 @@ char * camel_service_get_url (CamelService *service);
CamelSession * camel_service_get_session (CamelService *service);
GList * camel_service_query_auth_types (CamelService *service);
+void camel_service_free_auth_types (CamelService *service,
+ GList *authtypes);
/* Standard Gtk function */
GtkType camel_service_get_type (void);
diff --git a/camel/providers/pop3/camel-pop3-store.c b/camel/providers/pop3/camel-pop3-store.c
index 019e314ce7..6935c70c9b 100644
--- a/camel/providers/pop3/camel-pop3-store.c
+++ b/camel/providers/pop3/camel-pop3-store.c
@@ -1,5 +1,5 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* camel-pop3-store.c : class for an pop3 store */
+/* camel-pop3-store.c : class for a pop3 store */
/*
* Authors:
@@ -47,6 +47,7 @@
static gboolean pop3_connect (CamelService *service, CamelException *ex);
static GList *query_auth_types (CamelService *service);
+void free_auth_types (CamelService *service, GList *authtypes);
static CamelFolder *get_folder (CamelStore *store, const gchar *folder_name,
CamelException *ex);
@@ -63,6 +64,7 @@ camel_pop3_store_class_init (CamelPop3StoreClass *camel_pop3_store_class)
/* virtual method overload */
camel_service_class->connect = pop3_connect;
camel_service_class->query_auth_types = query_auth_types;
+ camel_service_class->free_auth_types = free_auth_types;
camel_store_class->get_root_folder = camel_pop3_folder_new;
camel_store_class->get_default_folder = camel_pop3_folder_new;
@@ -126,6 +128,11 @@ static GList *query_auth_types (CamelService *service)
return ret;
}
+static void free_auth_types (CamelService *service, GList *authtypes)
+{
+ g_list_free (authtypes);
+}
+
static gboolean
pop3_connect (CamelService *service, CamelException *ex)
{