Mercurial > pidgin.yaz
changeset 19034:8b627694bf4a
- Add purple_certificate_pool_usable to check whether a pool's
dependencies are loaded.
author | William Ehlhardt <williamehlhardt@gmail.com> |
---|---|
date | Thu, 19 Jul 2007 07:17:24 +0000 |
parents | 6b4e874e47c1 |
children | 284199d26040 |
files | libpurple/certificate.c libpurple/certificate.h |
diffstat | 2 files changed, 26 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/libpurple/certificate.c Wed Jul 18 23:50:46 2007 +0000 +++ b/libpurple/certificate.c Thu Jul 19 07:17:24 2007 +0000 @@ -286,6 +286,20 @@ } gboolean +purple_certificate_pool_usable(PurpleCertificatePool *pool) +{ + g_return_val_if_fail(pool, FALSE); + g_return_val_if_fail(pool->scheme_name, FALSE); + + /* Check that the pool's scheme is loaded */ + if (purple_certificate_find_scheme(pool->scheme_name) == NULL) { + return FALSE; + } + + return TRUE; +} + +gboolean purple_certificate_pool_contains(PurpleCertificatePool *pool, const gchar *id) { g_return_val_if_fail(pool, FALSE);
--- a/libpurple/certificate.h Wed Jul 18 23:50:46 2007 +0000 +++ b/libpurple/certificate.h Thu Jul 19 07:17:24 2007 +0000 @@ -495,6 +495,18 @@ purple_certificate_pool_mkpath(PurpleCertificatePool *pool, const gchar *id); /** + * Determines whether a pool can be used. + * + * Checks whether the associated CertificateScheme is loaded. + * + * @param pool Pool to check + * + * @return TRUE if the pool can be used, otherwise FALSE + */ +gboolean +purple_certificate_pool_usable(PurpleCertificatePool *pool); + +/** * Check for presence of an ID in a pool. * @param pool Pool to look in * @param id ID to look for