new routine to free the data allocated by camel_service_query_auth_types.

* 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

svn path=/trunk/; revision=2190
This commit is contained in:
Dan Winship
2000-03-27 16:59:46 +00:00
parent f8c580e8fd
commit 07f3a40ef0
4 changed files with 42 additions and 3 deletions
+5
View File
@@ -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.
+25 -2
View File
@@ -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);
}
+4
View File
@@ -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);
+8 -1
View File
@@ -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)
{