xl_get_attribute

This commit is contained in:
Nishi 2026-03-01 02:55:27 +09:00
commit e5b592e29a
Signed by: nishi
GPG key ID: 27EF69B208EB9343
2 changed files with 14 additions and 0 deletions

View file

@ -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;

View file

@ -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;
}