[evolution-data-server] Add camel_imapx_list_response_ref_extended_item().
- From: Matthew Barnes <mbarnes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] Add camel_imapx_list_response_ref_extended_item().
- Date: Wed, 7 Aug 2013 14:01:40 +0000 (UTC)
commit 4e7612bac91a4b964aa80069812e06ebdc5251b0
Author: Matthew Barnes <mbarnes redhat com>
Date: Wed Aug 7 13:29:29 2013 +0200
Add camel_imapx_list_response_ref_extended_item().
Returns the extended item value for the given tag as a GVariant.
The type of the GVariant depends on the extended item. If no value
for the given tag exists, the function returns NULL.
camel/camel-imapx-list-response.c | 33 +++++++++++++++++++++++++++++++
camel/camel-imapx-list-response.h | 3 ++
docs/reference/camel/camel-sections.txt | 1 +
3 files changed, 37 insertions(+), 0 deletions(-)
---
diff --git a/camel/camel-imapx-list-response.c b/camel/camel-imapx-list-response.c
index 105fe8a..a3727bb 100644
--- a/camel/camel-imapx-list-response.c
+++ b/camel/camel-imapx-list-response.c
@@ -634,6 +634,39 @@ camel_imapx_list_response_has_attribute (CamelIMAPXListResponse *response,
}
/**
+ * camel_imapx_list_response_ref_extended_item:
+ * @response: a #CamelIMAPXListResponse
+ * @extended_item_tag: an extended item tag
+ *
+ * Returns the extended item value for @extended_item_tag as a #GVariant.
+ * The type of the #GVariant depends on the extended item. If no value
+ * for @extended_item_tag exists, the function returns %NULL.
+ *
+ * The returned #GVariant is referenced for thread-safety and should
+ * be unreferenced with g_variant_unref() when finished with it.
+ *
+ * Returns: a #GVariant, or %NULL
+ *
+ * Since: 3.10
+ **/
+GVariant *
+camel_imapx_list_response_ref_extended_item (CamelIMAPXListResponse *response,
+ const gchar *extended_item_tag)
+{
+ GHashTable *extended_items;
+ GVariant *value;
+
+ g_return_val_if_fail (CAMEL_IS_IMAPX_LIST_RESPONSE (response), NULL);
+ g_return_val_if_fail (extended_item_tag != NULL, NULL);
+
+ extended_items = response->priv->extended_items;
+
+ value = g_hash_table_lookup (extended_items, extended_item_tag);
+
+ return (value != NULL) ? g_variant_ref (value) : NULL;
+}
+
+/**
* camel_imapx_list_response_get_summary_flags:
* @response: a #CamelIMAPXListResponse
*
diff --git a/camel/camel-imapx-list-response.h b/camel/camel-imapx-list-response.h
index a9e8db7..ed845fe 100644
--- a/camel/camel-imapx-list-response.h
+++ b/camel/camel-imapx-list-response.h
@@ -105,6 +105,9 @@ void camel_imapx_list_response_add_attribute
gboolean camel_imapx_list_response_has_attribute
(CamelIMAPXListResponse *response,
const gchar *attribute);
+GVariant * camel_imapx_list_response_ref_extended_item
+ (CamelIMAPXListResponse *response,
+ const gchar *extended_item_tag);
CamelStoreInfoFlags
camel_imapx_list_response_get_summary_flags
(CamelIMAPXListResponse *response);
diff --git a/docs/reference/camel/camel-sections.txt b/docs/reference/camel/camel-sections.txt
index 2304c14..96662b6 100644
--- a/docs/reference/camel/camel-sections.txt
+++ b/docs/reference/camel/camel-sections.txt
@@ -836,6 +836,7 @@ CAMEL_IMAPX_LIST_ATTR_HASCHILDREN
CAMEL_IMAPX_LIST_ATTR_HASNOCHILDREN
camel_imapx_list_response_add_attribute
camel_imapx_list_response_has_attribute
+camel_imapx_list_response_ref_extended_item
camel_imapx_list_response_get_summary_flags
<SUBSECTION Standard>
CAMEL_IMAPX_LIST_RESPONSE
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]