示例#1
0
/*!
  \brief Searches for a gfloat starting from an XML node and 
  stores in the dest var
  \param node is the pointer to the XML node
  \param name is the key to find
  \param dest is the pointer to the place to store the read value
  */
gboolean generic_xml_gfloat_find(xmlNode *node, const gchar *name, gpointer dest)
{
	gfloat *val = NULL;
	xmlNode *cur_node = NULL;
	gboolean found = FALSE;
	g_return_val_if_fail(node,FALSE);
	g_return_val_if_fail(dest,FALSE);
	g_return_val_if_fail(node->children,FALSE);

	ENTER();
	val = (gfloat *)dest;
	cur_node = node->children;
	while (cur_node->next)
	{
		if (cur_node->type == XML_ELEMENT_NODE)
		{
			if (g_ascii_strcasecmp((gchar *)cur_node->name,name) == 0)
			{
				generic_xml_gfloat_import(cur_node,val);
				found = TRUE;
			}
		}
		cur_node = cur_node->next;
	}
	EXIT();
	return found;
}
示例#2
0
void mtx_gauge_gfloat_import(MtxGaugeFace *gauge, xmlNode *node, gpointer dest,gboolean api_compat)
{
	generic_xml_gfloat_import(node,dest);
}