xml CHANGE lyxml_unlink API function
Also lyxml_free_elem refactored to lyxml_free.
diff --git a/src/xml.c b/src/xml.c
index d816b11..e67fcf1 100644
--- a/src/xml.c
+++ b/src/xml.c
@@ -308,6 +308,16 @@
elem->prev = elem;
}
+API void
+lyxml_unlink(struct ly_ctx *ctx, struct lyxml_elem *elem)
+{
+ if (!elem) {
+ return;
+ }
+
+ lyxml_unlink_elem(ctx, elem, 1);
+}
+
void
lyxml_free_attr(struct ly_ctx *ctx, struct lyxml_elem *parent, struct lyxml_attr *attr)
{
@@ -383,7 +393,7 @@
}
API void
-lyxml_free_elem(struct ly_ctx *ctx, struct lyxml_elem *elem)
+lyxml_free(struct ly_ctx *ctx, struct lyxml_elem *elem)
{
if (!elem) {
return;
@@ -1064,7 +1074,7 @@
return elem;
error:
- lyxml_free_elem(ctx, elem);
+ lyxml_free(ctx, elem);
return NULL;
}