xl_get_attribute
This commit is contained in:
parent
c5343219bb
commit
e5b592e29a
2 changed files with 14 additions and 0 deletions
|
|
@ -71,6 +71,8 @@ XLDECL int xl_parse(xemil_t* handle);
|
|||
|
||||
XLDECL void xl_close(xemil_t* handle);
|
||||
|
||||
XLDECL char* xl_get_attribute(xl_node_t* node, const char* key);
|
||||
|
||||
/* file.c */
|
||||
XLDECL xl_driver_t* xl_driver_file;
|
||||
|
||||
|
|
|
|||
12
src/core.c
12
src/core.c
|
|
@ -569,3 +569,15 @@ void xl_close(xemil_t* handle) {
|
|||
handle->driver->close(handle);
|
||||
free(handle);
|
||||
}
|
||||
|
||||
char* xl_get_attribute(xl_node_t* node, const char* key){
|
||||
xl_attribute_t* attr = node->first_attribute;
|
||||
|
||||
while(attr != NULL){
|
||||
if(strcmp(attr->key, key) == 0) return attr->value;
|
||||
|
||||
attr = attr->next;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue