/* OS_ElementExist: v1.0: 2005/02/26
- * Check if a element exists
+ * Check if a element exists
* The element_name must be NULL terminated (last char)
*/
int OS_ElementExist(OS_XML *_lxml, char **element_name)
/* RootElementExist: v1.0: 2005/02/26
- * Check if a root element exists
+ * Check if a root element exists
*/
int OS_RootElementExist(OS_XML *_lxml, char *element_name)
{
{
uniqret = ret[0];
}
-
+
/* Freeing memory */
while(ret[i])
{
i++;
}
free(ret);
-
+
return(uniqret);
}
/* OS_GetAttributeContent: v0.1: 2005/03/01
- * Get one value for a specific attribute
+ * Get one value for a specific attribute
*/
char *OS_GetAttributeContent(OS_XML *_lxml, char **element_name,
char *attribute_name)
}
if(success)
return(uniqret);
-
+
return(NULL);
}
}
i = _lxml->fol;
}
- else
+ else
{
i = 0;
}
if(matched !=1)
break;
}
-
+
/* Setting maximum depth of 16. */
if(j > 16)
return(NULL);
}
}
-
+
/* If the element name matches what we are looking for. */
else if(strcmp(_lxml->el[i], element_name[j]) == 0)
{
{
break;
}
-
+
if(strcmp(attr, _lxml->el[k]) == 0)
{
i = k;
{
return(NULL);
}
-
+
/* Adding new entry. */
ret[k] = strdup(_lxml->ct[i]);
ret[k + 1] = NULL;
free(ret);
return(NULL);
}
-
+
matched = 1;
k++;
-
+
if(attr != NULL)
{
- break;
+ break;
}
-
+
else if(_lxml->fol != 0)
{
_lxml->fol = i+1;
matched = 0;
}
}
-
+
if(ret == NULL)
return(NULL);