# HG changeset patch # User William Ehlhardt # Date 1182628078 0 # Node ID 617447a71ab7d93b8de21946c67db080ae829333 # Parent fa42d8fa7873cef32e0573ddd67fe13c79db14bb - Add certificate_destroy and certificate_destroy_list diff -r fa42d8fa7873 -r 617447a71ab7 libpurple/certificate.c --- 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) { diff -r fa42d8fa7873 -r 617447a71ab7 libpurple/certificate.h --- 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); + /*@}*/ /*****************************************************************************/