From fe99fce9a3953b2ec3ab33bbfe9bc08f56e2aa2b Mon Sep 17 00:00:00 2001 From: decafcode Date: Sat, 9 Dec 2023 10:11:01 -0500 Subject: [PATCH] feat(573file): add prop_search_child_const --- 573file/prop.c | 5 +++++ 573file/prop.h | 2 ++ 2 files changed, 7 insertions(+) diff --git a/573file/prop.c b/573file/prop.c index 0339192..68c0e48 100644 --- a/573file/prop.c +++ b/573file/prop.c @@ -300,6 +300,11 @@ const char *prop_get_value_str(const struct prop *p) { } struct prop *prop_search_child(struct prop *p, const char *name) { + return (struct prop *)prop_search_child_const(p, name); +} + +const struct prop *prop_search_child_const(const struct prop *p, + const char *name) { struct list_node *pos; struct prop *child; diff --git a/573file/prop.h b/573file/prop.h index b09eb51..7e59cb5 100644 --- a/573file/prop.h +++ b/573file/prop.h @@ -26,6 +26,8 @@ struct prop *prop_get_parent(struct prop *p); enum prop_type prop_get_type(const struct prop *p); const char *prop_get_value_str(const struct prop *p); struct prop *prop_search_child(struct prop *p, const char *name); +const struct prop *prop_search_child_const(const struct prop *p, + const char *name); int prop_set_attr(struct prop *p, const char *key, const char *val); const struct attr *attr_get_next_sibling(const struct attr *a);