Commit f6d10655 authored by Sébastien Bianti's avatar Sébastien Bianti Committed by Jens Georg
Browse files

Add API for retrieving device class identifiers

https://bugzilla.gnome.org/show_bug.cgi?id=700947
parent 2982f46f
......@@ -926,6 +926,39 @@ resource_type_match (const char *query,
return (query_ver <= base_ver);
}
/**
* gupnp_device_info_list_dlna_device_class_identifier:
* @info: A #GUPnPDeviceInfo
*
* Get a #GList of strings that represent the device class and version as
* announced in the device description file using the &lt;dlna:X_DLNADOC&gt;
* element.
* Returns: (transfer full) (element-type utf8): a #GList of newly allocated strings or
* %NULL if the device description doesn't contain the &lt;dlna:X_DLNADOC&gt;
* element.
**/
GList *
gupnp_device_info_list_dlna_device_class_identifier (GUPnPDeviceInfo *info)
{
xmlNode *element;
GList *list = NULL;
g_return_val_if_fail (GUPNP_IS_DEVICE_INFO (info), NULL);
element = info->priv->element;
for (element = element->children; element; element = element->next) {
/* No early exit since the node explicitly may appear multiple
* times: 7.2.10.3 */
if (!strcmp ("X_DLNADOC", (char *) element->name))
list = g_list_prepend (list,
xmlNodeGetContent(element));
}
/* Return in order of appearance in document */
return g_list_reverse (list);
}
/**
* gupnp_device_info_list_dlna_capabilities:
* @info: A #GUPnPDeviceInfo
......
......@@ -151,6 +151,9 @@ gupnp_device_info_get_icon_url (GUPnPDeviceInfo *info,
char *
gupnp_device_info_get_presentation_url (GUPnPDeviceInfo *info);
GList *
gupnp_device_info_list_dlna_device_class_identifier (GUPnPDeviceInfo *info);
GList *
gupnp_device_info_list_dlna_capabilities (GUPnPDeviceInfo *info);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment