Browse Source

Move functions copypasted from SysRepo to sr_copypaste.c

Serj Kalichev 1 year ago
parent
commit
06a5a287a8
2 changed files with 1 additions and 68 deletions
  1. 1 5
      pline.c
  2. 0 63
      ytree.c

+ 1 - 5
pline.c

@@ -17,6 +17,7 @@
 #include <faux/list.h>
 #include <faux/argv.h>
 
+#include "sr_copypaste.h"
 #include "pline.h"
 
 #define NODETYPE_CONF (LYS_CONTAINER | LYS_LIST | LYS_LEAF | LYS_LEAFLIST)
@@ -205,11 +206,6 @@ void pline_debug(pline_t *pline)
 }
 
 
-int sr_ly_module_is_internal(const struct lys_module *ly_mod);
-
-int sr_module_is_internal(const struct lys_module *ly_mod);
-
-
 // Don't use standard lys_find_child() because it checks given module to be
 // equal to found node's module. So augmented nodes will not be found.
 static const struct lysc_node *find_child(const struct lysc_node *node,

+ 0 - 63
ytree.c

@@ -1,9 +1,6 @@
 #include <stdlib.h>
 #include <stdio.h>
 
-//#include <libyang/libyang.h>
-//#include <libyang/tree_schema.h>
-
 #include <sysrepo.h>
 #include <sysrepo/xpath.h>
 
@@ -13,66 +10,6 @@
 #include "pline.h"
 
 
-static int
-sr_ly_module_is_internal(const struct lys_module *ly_mod)
-{
-    if (!ly_mod->revision) {
-        return 0;
-    }
-
-    if (!strcmp(ly_mod->name, "ietf-yang-metadata") && !strcmp(ly_mod->revision, "2016-08-05")) {
-        return 1;
-    } else if (!strcmp(ly_mod->name, "yang") && !strcmp(ly_mod->revision, "2021-04-07")) {
-        return 1;
-    } else if (!strcmp(ly_mod->name, "ietf-inet-types") && !strcmp(ly_mod->revision, "2013-07-15")) {
-        return 1;
-    } else if (!strcmp(ly_mod->name, "ietf-yang-types") && !strcmp(ly_mod->revision, "2013-07-15")) {
-        return 1;
-    }
-
-    return 0;
-}
-
-
-int
-sr_module_is_internal(const struct lys_module *ly_mod)
-{
-    if (!ly_mod->revision) {
-        return 0;
-    }
-
-    if (sr_ly_module_is_internal(ly_mod)) {
-        return 1;
-    }
-
-    if (!strcmp(ly_mod->name, "ietf-datastores") && !strcmp(ly_mod->revision, "2018-02-14")) {
-        return 1;
-    } else if (!strcmp(ly_mod->name, "ietf-yang-schema-mount")) {
-        return 1;
-    } else if (!strcmp(ly_mod->name, "ietf-yang-library")) {
-        return 1;
-    } else if (!strcmp(ly_mod->name, "ietf-netconf")) {
-        return 1;
-    } else if (!strcmp(ly_mod->name, "ietf-netconf-with-defaults") && !strcmp(ly_mod->revision, "2011-06-01")) {
-        return 1;
-    } else if (!strcmp(ly_mod->name, "ietf-origin") && !strcmp(ly_mod->revision, "2018-02-14")) {
-        return 1;
-    } else if (!strcmp(ly_mod->name, "ietf-netconf-notifications") && !strcmp(ly_mod->revision, "2012-02-06")) {
-        return 1;
-    } else if (!strcmp(ly_mod->name, "sysrepo")) {
-        return 1;
-    } else if (!strcmp(ly_mod->name, "sysrepo-monitoring")) {
-        return 1;
-    } else if (!strcmp(ly_mod->name, "sysrepo-plugind")) {
-        return 1;
-    } else if (!strcmp(ly_mod->name, "ietf-netconf-acm")) {
-        return 1;
-    }
-
-    return 0;
-}
-
-
 int main(int argc, char **argv)
 {
 	int ret = -1;