added regexp free routines, replaced regexp mode string with symbol
This commit is contained in:
parent
5706703ab4
commit
2ae9529a3e
10 changed files with 115 additions and 35 deletions
|
|
@ -284,7 +284,7 @@ yang2cli_var_pattern(clicon_handle h,
|
|||
cbuf *cb)
|
||||
{
|
||||
int retval = -1;
|
||||
char *mode;
|
||||
enum regexp_mode mode;
|
||||
cg_var *cvp;
|
||||
char *pattern;
|
||||
int invert;
|
||||
|
|
@ -295,7 +295,7 @@ yang2cli_var_pattern(clicon_handle h,
|
|||
while ((cvp = cvec_each(patterns, cvp)) != NULL){
|
||||
pattern = cv_string_get(cvp);
|
||||
invert = cv_flag(cvp, V_INVERT);
|
||||
if (strcmp(mode, "posix") == 0){
|
||||
if (mode == REGEXP_POSIX){
|
||||
posix = NULL;
|
||||
if (regexp_xsd2posix(pattern, &posix) < 0)
|
||||
goto done;
|
||||
|
|
|
|||
|
|
@ -446,7 +446,7 @@ main(int argc, char **argv)
|
|||
if (help)
|
||||
usage(h, argv[0]);
|
||||
|
||||
if (strcmp(clicon_yang_regexp(h), "libxml2")==0){
|
||||
if (clicon_yang_regexp(h) == REGEXP_LIBXML2){
|
||||
#ifdef HAVE_LIBXML2
|
||||
/* Enable XSD libxml2 regex engine */
|
||||
cligen_regex_xsd_set(cli_cligen(h), 1);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue