yang_cvec_set(y, cvv) added

This commit is contained in:
Olof hagsand 2019-04-24 09:56:07 +02:00
parent 1e1eabbc06
commit 7847e74c5e
3 changed files with 28 additions and 1 deletions

View file

@ -61,7 +61,7 @@
* Change all y->ys_keyword to yang_keyword_get(y)
* Change all y->ys_argument to yang_argument_get(y)
* Change all y->ys_cv to yang_cv_get(y)
* Change all y->ys_cvec to yang_cvec_get(y)
* Change all y->ys_cvec to yang_cvec_get(y) or yang_cvec_set(y, cvv)
* xmldb_get() removed unnecessary config option:
* Change all calls to dbget from: `xmldb_get(h, db, xpath, 0|1, &xret, msd)` to `xmldb_get(h, db, xpath, &xret, msd)`

View file

@ -234,6 +234,7 @@ enum rfc_6020 yang_keyword_get(yang_stmt *ys);
char *yang_argument_get(yang_stmt *ys);
cg_var *yang_cv_get(yang_stmt *ys);
cvec *yang_cvec_get(yang_stmt *ys);
int yang_cvec_set(yang_stmt *ys, cvec *cvv);
void *yang_regex_cache_get(yang_stmt *ys);
int yang_regex_cache_set(yang_stmt *ys, void *regex);

View file

@ -223,12 +223,38 @@ yang_cvec_get(yang_stmt *ys)
return ys->ys_cvec;
}
/*! Set yang statement CLIgen variable vector
* @param[in] ys Yang statement node
* @param[in] cvec CLIgen vector
* @retval 0 OK
* @retval -1 Error
*/
int
yang_cvec_set(yang_stmt *ys,
cvec *cvv)
{
if (ys->ys_cvec)
cvec_free(ys->ys_cvec);
ys->ys_cvec = cvv;
return 0;
}
/*! Get regular expression cache - the compiled regex
* @param[in] ys Yang statement node
* @retval re Compiled regex
* @see regcomp
*/
void*
yang_regex_cache_get(yang_stmt *ys)
{
return ys->ys_regex_cache;
}
/*! Set regular expression cache - the compiled regex
* @param[in] ys Yang statement node
* @param[in] re Compiled regex
* @see regcomp
*/
int
yang_regex_cache_set(yang_stmt *ys,
void *regex)