* Added clicon_handle as parameter to all validate functions

* Added libxml2 XSD regexp mode as alternative to posix translation
* Added `CLICON_YANG_REGEXP` option with possible values libxml2 and posix
This commit is contained in:
Olof hagsand 2019-05-23 22:48:33 +02:00
parent 69f2eb30f1
commit a804e05375
27 changed files with 501 additions and 289 deletions

View file

@ -359,12 +359,18 @@ yang2cli_var_sub(clicon_handle h,
goto done;
}
if (options & YANG_OPTIONS_PATTERN){
char *posix = NULL;
if (regexp_xsd2posix(pattern, &posix) < 0)
goto done;
cprintf(cb, " regexp:\"%s\"", posix);
if (posix)
free(posix);
char *mode;
mode = clicon_yang_regexp(h);
if (strcmp(mode, "posix") == 0){
char *posix = NULL;
if (regexp_xsd2posix(pattern, &posix) < 0)
goto done;
cprintf(cb, " regexp:\"%s\"", posix);
if (posix)
free(posix);
}
else
cprintf(cb, " regexp:\"%s\"", pattern);
}
cprintf(cb, ">");
if (helptext)