libyang NEW xpath evaluation
Not tested once.
diff --git a/src/tree_schema.c b/src/tree_schema.c
index daf0a56..c034581 100644
--- a/src/tree_schema.c
+++ b/src/tree_schema.c
@@ -216,12 +216,10 @@
return NULL;
}
-
-
API char *
-lysc_path(struct lysc_node *node, LY_PATH_TYPE pathtype, char *buffer, size_t buflen)
+lysc_path(const struct lysc_node *node, LYSC_PATH_TYPE pathtype, char *buffer, size_t buflen)
{
- struct lysc_node *iter;
+ const struct lysc_node *iter;
char *path = NULL;
int len = 0;
@@ -231,26 +229,12 @@
}
switch (pathtype) {
- case LY_PATH_LOG:
+ case LYSC_PATH_LOG:
for (iter = node; iter && len >= 0; iter = iter->parent) {
char *s = buffer ? strdup(buffer) : path;
char *id;
- switch (iter->nodetype) {
- case LYS_USES:
- asprintf(&id, "{uses='%s'}", iter->name);
- break;
- case LYS_GROUPING:
- asprintf(&id, "{grouping='%s'}", iter->name);
- break;
- case LYS_AUGMENT:
- asprintf(&id, "{augment='%s'}", iter->name);
- break;
- default:
- id = strdup(iter->name);
- break;
- }
-
+ id = strdup(iter->name);
if (!iter->parent || iter->parent->module != iter->module) {
/* print prefix */
if (buffer) {