changeset 18946:617447a71ab7

- Add certificate_destroy and certificate_destroy_list
author William Ehlhardt <williamehlhardt@gmail.com>
date Sat, 23 Jun 2007 19:47:58 +0000
parents fa42d8fa7873
children 3c6bf77bf7c4
files libpurple/certificate.c libpurple/certificate.h
diffstat 2 files changed, 43 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/certificate.c	Sat Jun 23 19:28:57 2007 +0000
+++ b/libpurple/certificate.c	Sat Jun 23 19:47:58 2007 +0000
@@ -73,6 +73,33 @@
 	(verifier->start_verification)(vrq);
 }
 
+void
+purple_certificate_destroy (PurpleCertificate *crt)
+{
+	PurpleCertificateScheme *scheme;
+	
+	if (NULL == crt) return;
+
+	scheme = crt->scheme;
+
+	(scheme->destroy_certificate)(crt);
+}
+
+void
+purple_certificate_destroy_list (GList * crt_list)
+{
+	PurpleCertificate *crt;
+	GList *l;
+
+	for (l=crt_list; l; l = l->next) {
+		crt = (PurpleCertificate *) l->data;
+		purple_certificate_destroy(crt);
+	}
+
+	g_list_free(crt_list);
+}
+
+
 PurpleCertificateScheme *
 purple_certificate_find_scheme(const gchar *name)
 {
--- a/libpurple/certificate.h	Sat Jun 23 19:28:57 2007 +0000
+++ b/libpurple/certificate.h	Sat Jun 23 19:47:58 2007 +0000
@@ -262,6 +262,22 @@
 			   PurpleCertificateVerifiedCallback cb,
 			   gpointer cb_data);
 
+/**
+ * Destroys and free()'s a Certificate
+ *
+ * @param crt        Instance to destroy. May be NULL.
+ */
+void
+purple_certificate_destroy (PurpleCertificate *crt);
+
+/**
+ * Destroy an entire list of Certificate instances and the containing list
+ *
+ * @param crt_list   List of certificates to destroy. May be NULL.
+ */
+void
+purple_certificate_destroy_list (GList * crt_list);
+
 /*@}*/
 
 /*****************************************************************************/