81#define VAR_VAL(V) (V)->val
101typedef enum var_type_t_ {
131typedef struct ncx_var_t_ {
149typedef enum var_side_t_ {
172 (*var_getvar_fn_t) (
const xmlChar *varname,
354 const xmlChar *valstr,
496 const xmlChar *name);
508 const xmlChar *name);
561 const xmlChar **name,
592 const xmlChar *strval,
631 const xmlChar *strval,
665 const xmlChar *strval,
667 boolean handleEscapedCharacters,
692 const xmlChar *varname,
708 const xmlChar *varname,
742extern const xmlChar *
command line interpreter parsing to internal val_value_t format
dlq provides general double-linked list and queue support:
status_t
global error return code
Definition: status_enum.h:210
uint16 xmlns_id_t
integer handle for registered namespaces
Definition: xmlns.h:89
val_value_t *(* cli_xml_buffer_fn_t)(const xmlChar *xmlbuff, obj_template_t *targetobj, status_t *res)
Read an XML buffer and convert it into a real data structure.
Definition: cli.h:152
val_value_t * var_check_script_val(runstack_context_t *rcxt, obj_template_t *obj, const xmlChar *strval, boolean istop, boolean handleEscapedCharacters, cli_xml_buffer_fn_t cbfn, status_t *res)
Create a val_value_t struct for a parameter assignment within the script processing mode,...
Definition: var.c:2481
void var_init(void)
Init the var module.
Definition: var.c:2954
ncx_var_t * var_find_global(runstack_context_t *rcxt, const xmlChar *varname, uint32 namelen, xmlns_id_t nsid)
Find a complete var struct for use with XPath or data templates.
Definition: var.c:2820
val_value_t * var_get_script_val_ex(runstack_context_t *rcxt, obj_template_t *parentobj, obj_template_t *obj, val_value_t *val, const xmlChar *strval, boolean istop, val_value_t *fillval, status_t *res)
Create or fill in a val_value_t struct for a parameter assignment within the script processing mode A...
Definition: var.c:2133
var_type_t
different types of variables supported
Definition: var.h:101
ncx_var_t * var_find(runstack_context_t *rcxt, const xmlChar *varname, xmlns_id_t nsid)
Find a complete var struct for use with XPath.
Definition: var.c:2781
status_t var_set_str(runstack_context_t *rcxt, const xmlChar *name, uint32 namelen, const val_value_t *value, var_type_t vartype)
Find and set (or create a new) global user variable.
Definition: var.c:1238
void var_free(ncx_var_t *var)
Free a ncx_var_t struct.
Definition: var.c:1154
ncx_var_t * var_get_que_raw(dlq_hdr_t *varQ, xmlns_id_t nsid, const xmlChar *name)
Find a Q-based user variable; return the var struct instead of just the value.
Definition: var.c:1854
const xmlChar * var_get_name(const ncx_var_t *curvar)
Get the name string for the specified variable.
Definition: var.c:2913
val_value_t * var_get(runstack_context_t *rcxt, const xmlChar *name, var_type_t vartype)
Find a local or global user variable.
Definition: var.c:1688
status_t var_set(runstack_context_t *rcxt, const xmlChar *name, const val_value_t *value, var_type_t vartype)
Find and set (or create a new) global user variable.
Definition: var.c:1277
val_value_t * var_get_str(runstack_context_t *rcxt, const xmlChar *name, uint32 namelen, var_type_t vartype)
Find a global user variable.
Definition: var.c:1637
status_t var_unset(runstack_context_t *rcxt, const xmlChar *name, uint32 namelen, var_type_t vartype)
Find and remove a local or global user variable.
Definition: var.c:1556
var_type_t var_get_type_str(runstack_context_t *rcxt, const xmlChar *name, uint32 namelen, boolean globalonly)
Find a user variable; get its var type.
Definition: var.c:1717
boolean var_string_is_var_expr(const xmlChar *varstring, uint32 varlen, boolean *plainvar)
Check if the string is a variable reference.
Definition: var.c:3023
status_t var_set_que(dlq_hdr_t *varQ, const xmlChar *name, const val_value_t *value)
Find and set (or create a new) Q-based user variable.
Definition: var.c:1338
void * var_get_getvar_cb_cookie(void)
Get the cookie parameter for the getvar callback function used for data templates.
Definition: var.c:3007
status_t var_check_ref(runstack_context_t *rcxt, const xmlChar *line, var_side_t side, uint32 *len, var_type_t *vartype, const xmlChar **name, uint32 *namelen, val_value_t **foundval)
Check if the immediate command sub-string is a variable reference.
Definition: var.c:1959
val_value_t * var_get_local(runstack_context_t *rcxt, const xmlChar *name)
Find a local user variable.
Definition: var.c:1880
status_t var_set_str_que(dlq_hdr_t *varQ, const xmlChar *name, uint32 namelen, const val_value_t *value)
Find and set (or create a new) global user variable.
Definition: var.c:1305
status_t var_set_move_que(dlq_hdr_t *varQ, const xmlChar *name, val_value_t *value)
Find or create and set a Q-based user variable.
Definition: var.c:1364
var_side_t
values for isleft parameter in var_check_ref
Definition: var.h:149
status_t var_set_from_string(runstack_context_t *rcxt, const xmlChar *name, const xmlChar *valstr, var_type_t vartype)
Find and set (or create a new) global user variable from a string value instead of a val_value_t stru...
Definition: var.c:1493
ncx_var_t *(* var_getvar_fn_t)(const xmlChar *varname, uint32 varlen, void *cookie, status_t *res)
Get Variable Callback.
Definition: var.h:172
status_t var_set_move(runstack_context_t *rcxt, const xmlChar *name, uint32 namelen, var_type_t vartype, val_value_t *value)
Find and set (or create a new) global user variable.
Definition: var.c:1424
ncx_var_t * var_get_next(ncx_var_t *curvar)
Find the next local or global variable.
Definition: var.c:2890
void var_cvt_generic(dlq_hdr_t *varQ)
Cleanup after a yangcli session has ended.
Definition: var.c:2741
status_t var_unset_que(dlq_hdr_t *varQ, const xmlChar *name, uint32 namelen, xmlns_id_t nsid)
Find and remove a Q-based user variable.
Definition: var.c:1601
var_getvar_fn_t var_get_getvar_cb(void)
Get the getvar callback function used for data templates.
Definition: var.c:2990
void var_clean_varQ(dlq_hdr_t *varQ)
Clean a Q of ncx_var_t.
Definition: var.c:1176
var_type_t var_get_vartype(const ncx_var_t *curvar)
Get the variable type for the specified variable.
Definition: var.c:2936
val_value_t * var_get_str_que(dlq_hdr_t *varQ, const xmlChar *name, uint32 namelen, xmlns_id_t nsid)
Find a global user variable in a varQ.
Definition: var.c:1787
var_type_t var_get_type(runstack_context_t *rcxt, const xmlChar *name, boolean globalonly)
Get the var type of a specified var name.
Definition: var.c:1759
void var_set_getvar_cb(var_getvar_fn_t getcb, void *cookie)
Set the getvar callback function used for data templates.
Definition: var.c:2972
status_t var_set_move_que_global(dlq_hdr_t *varQ, const xmlChar *name, val_value_t *value)
Find or create and set a Q-based user variable.
Definition: var.c:1392
val_value_t * var_get_script_val(runstack_context_t *rcxt, obj_template_t *obj, val_value_t *val, const xmlChar *strval, boolean istop, status_t *res)
Create or fill in a val_value_t struct for a parameter assignment within the script processing mode.
Definition: var.c:2078
void var_clean_type_from_varQ(dlq_hdr_t *varQ, var_type_t vartype)
Clean all entries of one type from a Q of ncx_var_t.
Definition: var.c:1200
val_value_t * var_get_que(dlq_hdr_t *varQ, const xmlChar *name, xmlns_id_t nsid)
Find a Q-based user variable in q varQ.
Definition: var.c:1820
status_t var_replace_subtree(runstack_context_t *rcxt, val_value_t *val)
Replace all the simple node variable usage with the var value.
Definition: var.c:3080
status_t var_set_sys(runstack_context_t *rcxt, const xmlChar *name, const val_value_t *value)
Find and set (or create a new) global system variable.
Definition: var.c:1457
val_value_t * var_get_local_str(runstack_context_t *rcxt, const xmlChar *name, uint32 namelen)
Find a local user variable, count-based name string.
Definition: var.c:1910
ncx_var_t * var_get_first(runstack_context_t *rcxt, boolean islocal)
Find the first local or global variable.
Definition: var.c:2855
@ VAR_TYP_SYSTEM
system variables are read-only and cannot even be set, let alone deleted by a user
Definition: var.h:123
@ VAR_TYP_GLOBAL
user global variables are visible in every context stack frame and can persist across program reboots
Definition: var.h:118
@ VAR_TYP_NONE
not set
Definition: var.h:102
@ VAR_TYP_QUEUE
queue variables are used internally DO NOT USE
Definition: var.h:126
@ VAR_TYP_LOCAL
local variables have one dollar sign like $foo They exist only in the current runstack frame and get ...
Definition: var.h:108
@ VAR_TYP_CONFIG
config variables are used within yangcli-pro and yp-shell for its own CLI parameters.
Definition: var.h:113
@ ISLEFT
left-hand-side
Definition: var.h:151
@ ISRIGHT
right-hand-side
Definition: var.h:150
YANG module data structures Many internal representations of YANG module constructs.
struct of NCX user variable mapping for yangcli
Definition: var.h:131
xmlChar * name
variable name
Definition: var.h:141
dlq_hdr_t hdr
queue header
Definition: var.h:132
val_value_t * val
variable value
Definition: var.h:144
var_type_t vartype
variable type for this entry
Definition: var.h:135
xmlns_id_t nsid
namespace ID for this variable
Definition: var.h:138
One YANG data-def-stmt.
Definition: obj.h:1229
Main runstact context control block used by yangcli to process script input loops and conditional sta...
Definition: runstack.h:256
one value to match one type
Definition: val.h:912
Value Node Basic Support.