summaryrefslogtreecommitdiff
path: root/src/xml/xml.h
diff options
context:
space:
mode:
authorsanine <sanine.not@pm.me>2023-02-03 23:55:45 -0600
committersanine <sanine.not@pm.me>2023-02-03 23:55:45 -0600
commitb183f50a84efc495b322370976b22bad486800f3 (patch)
tree581116a19816f6da06cb4502204a85822899f32d /src/xml/xml.h
parent414bc3c6db05ec6d5127967eae39dbaa7f48ad2c (diff)
add kai_tag_attr_to_long
Diffstat (limited to 'src/xml/xml.h')
-rw-r--r--src/xml/xml.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/xml/xml.h b/src/xml/xml.h
index e2abf8f..ac956aa 100644
--- a/src/xml/xml.h
+++ b/src/xml/xml.h
@@ -13,4 +13,13 @@ struct kai_tag_t * kai_parse_string(const char *str);
*/
char * kai_tag_get_attr(struct kai_tag_t *t, const char *attr);
+
+/* find an attribute and convert to long. if not found, return "base" instead.
+ * if flag is not NULL, then it is set to 0 when taking the value from an
+ * attribute and 1 when taking the value from "base"
+ */
+long kai_tag_attr_to_long(
+ struct kai_tag_t *t, const char *attr,
+ long base, int *flag);
+
#endif