yumapro
24.10-2
YumaPro SDK
|
A stack of CLI contexts. More...
Data Structures | |
struct | runstack_ifcb_t |
control the conditional state for 1 if...end sequence More... | |
struct | runstack_line_t |
save 1 line for looping purposes More... | |
struct | runstack_loopcb_t |
control the looping for 1 while - end sequence More... | |
struct | runstack_condcb_t |
control the looping for 1 while - end sequence More... | |
struct | runstack_entry_t |
one script run level context entry each time a 'run script' command is encountered, a new stack context is created, unless max_script_level is reached More... | |
struct | runstack_context_t |
Main runstact context control block used by yangcli to process script input loops and conditional statements in scripts. More... | |
Enumerations | |
enum | runstack_src_t { RUNSTACK_SRC_NONE , RUNSTACK_SRC_USER , RUNSTACK_SRC_SCRIPT , RUNSTACK_SRC_LOOP } |
identify the runstack input source More... | |
enum | runstack_condtype_t { RUNSTACK_COND_NONE , RUNSTACK_COND_IF , RUNSTACK_COND_LOOP } |
identify the runstack conditional control block type More... | |
enum | runstack_ifstate_t { RUNSTACK_IF_NONE , RUNSTACK_IF_IF , RUNSTACK_IF_ELIF , RUNSTACK_IF_ELSE } |
keep track of the if,elif,else,end sequence More... | |
enum | runstack_loopstate_t { RUNSTACK_LOOP_NONE , RUNSTACK_LOOP_COLLECTING , RUNSTACK_LOOP_LOOPING } |
keep track of the while,end sequence More... | |
enum | runstack_queue_type_t { RUNSTACK_QUE_NONE , RUNSTACK_QUE_LOCAL , RUNSTACK_QUE_SESSION , RUNSTACK_QUE_GROUP , RUNSTACK_QUE_GLOBAL } |
different queues of variables for que selection More... | |
Functions | |
uint32 | runstack_level (runstack_context_t *rcxt) |
Get the current stack level. More... | |
status_t | runstack_push (runstack_context_t *rcxt, const xmlChar *source, FILE *fp) |
Add a script nest level context to the stack. More... | |
void | runstack_pop (runstack_context_t *rcxt) |
Remove a script nest level context from the stack Call just after script is completed. More... | |
xmlChar * | runstack_get_cmd (runstack_context_t *rcxt, status_t *res) |
Read the current runstack context and construct a command string for processing by do_run_script. More... | |
void | runstack_cancel (runstack_context_t *rcxt) |
Cancel all running scripts. More... | |
void | runstack_clear_cancel (runstack_context_t *rcxt) |
Clear the cancel flags. More... | |
dlq_hdr_t * | runstack_get_que (runstack_context_t *rcxt, runstack_queue_type_t quetype) |
Read the current runstack context and figure out which queue to get. More... | |
dlq_hdr_t * | runstack_get_parm_que (runstack_context_t *rcxt) |
Get the parameter queue for the current stack level. More... | |
void | runstack_init (void) |
Initialize this module. More... | |
void | runstack_cleanup (void) |
Cleanup this module. More... | |
void | runstack_clean_context (runstack_context_t *rcxt) |
Clean the runstack context. More... | |
void | runstack_free_context (runstack_context_t *rcxt) |
Clean and free the runstack context. More... | |
void | runstack_init_context (runstack_context_t *rcxt) |
Initialize a pre-malloced runstack context. More... | |
runstack_context_t * | runstack_new_context (void) |
Malloc and init a new runstack context. More... | |
void | runstack_session_cleanup (runstack_context_t *rcxt) |
Cleanup after a yangcli session has ended. More... | |
runstack_src_t | runstack_get_source (runstack_context_t *rcxt) |
Get the current input source for the runstack context. More... | |
status_t | runstack_save_line (runstack_context_t *rcxt, const xmlChar *line) |
Save the current line if needed if a loop is active. More... | |
xmlChar * | runstack_get_loop_cmd (runstack_context_t *rcxt, status_t *res) |
Get the next command during loop processing. More... | |
boolean | runstack_get_cond_state (runstack_context_t *rcxt) |
Get the current conditional code state for the context. More... | |
status_t | runstack_handle_while (runstack_context_t *rcxt, uint32 maxloops, struct xpath_pcb_t_ *xpathpcb, val_value_t *docroot) |
Process the current command, which is a 'while' command. More... | |
status_t | runstack_handle_if (runstack_context_t *rcxt, boolean startcond) |
Handle the if command for the specific runstack context. More... | |
status_t | runstack_handle_elif (runstack_context_t *rcxt, boolean startcond) |
Handle the elif command for the specific runstack context. More... | |
status_t | runstack_handle_else (runstack_context_t *rcxt) |
Handle the elsecommand for the specific runstack context. More... | |
status_t | runstack_handle_end (runstack_context_t *rcxt) |
Handle the end command for the specific runstack context. More... | |
boolean | runstack_get_if_used (runstack_context_t *rcxt) |
Check if the run context, which should be inside an if-stmt now, has used the 'true' block already. More... | |
void | runstack_set_sessionQ (runstack_context_t *rcxt, dlq_hdr_t *sessionQ) |
Set the current session-specific variable Q. More... | |
void | runstack_set_groupQ (runstack_context_t *rcxt, dlq_hdr_t *groupQ) |
Set the current group-specific variable Q. More... | |
A stack of CLI contexts.
Each 'run' command causes a new context to be created on the stack.
enum runstack_condtype_t |
enum runstack_ifstate_t |
enum runstack_loopstate_t |
enum runstack_src_t |
void runstack_cancel | ( | runstack_context_t * | rcxt | ) |
Cancel all running scripts.
rcxt | runstack context to use |
void runstack_clean_context | ( | runstack_context_t * | rcxt | ) |
Clean the runstack context.
rcxt | runstack context to clean, but not free |
void runstack_cleanup | ( | void | ) |
Cleanup this module.
Must cleanup this module after using it!!!
void runstack_clear_cancel | ( | runstack_context_t * | rcxt | ) |
Clear the cancel flags.
rcxt | runstack context to use |
void runstack_free_context | ( | runstack_context_t * | rcxt | ) |
Clean and free the runstack context.
rcxt | runstack context to free |
xmlChar * runstack_get_cmd | ( | runstack_context_t * | rcxt, |
status_t * | res | ||
) |
Read the current runstack context and construct a command string for processing by do_run_script.
rcxt | runstack context to use | |
[out] | res | address of status result
|
boolean runstack_get_cond_state | ( | runstack_context_t * | rcxt | ) |
Get the current conditional code state for the context.
rcxt | runstack context to use |
boolean runstack_get_if_used | ( | runstack_context_t * | rcxt | ) |
Check if the run context, which should be inside an if-stmt now, has used the 'true' block already.
rcxt | runstack context to use |
xmlChar * runstack_get_loop_cmd | ( | runstack_context_t * | rcxt, |
status_t * | res | ||
) |
Get the next command during loop processing.
This function is called after the while loop end has been reached, and buffered commands are used
rcxt | runstack context to use | |
[out] | res | address of status result
|
dlq_hdr_t * runstack_get_parm_que | ( | runstack_context_t * | rcxt | ) |
Get the parameter queue for the current stack level.
rcxt | runstack context to use |
dlq_hdr_t * runstack_get_que | ( | runstack_context_t * | rcxt, |
runstack_queue_type_t | quetype | ||
) |
Read the current runstack context and figure out which queue to get.
rcxt | runstack context to use |
quetype | runstack_queue_type_t enumeration |
runstack_src_t runstack_get_source | ( | runstack_context_t * | rcxt | ) |
Get the current input source for the runstack context.
rcxt | runstack context to use |
status_t runstack_handle_elif | ( | runstack_context_t * | rcxt, |
boolean | startcond | ||
) |
Handle the elif command for the specific runstack context.
rcxt | runstack context to use |
startcond | start condition state for this if block may be FALSE because the current conditional state is already FALSE |
status_t runstack_handle_else | ( | runstack_context_t * | rcxt | ) |
Handle the elsecommand for the specific runstack context.
rcxt | runstack context to use |
status_t runstack_handle_end | ( | runstack_context_t * | rcxt | ) |
Handle the end command for the specific runstack context.
rcxt | runstack context to use |
status_t runstack_handle_if | ( | runstack_context_t * | rcxt, |
boolean | startcond | ||
) |
Handle the if command for the specific runstack context.
rcxt | runstack context to use |
startcond | start condition state for this if block may be FALSE because the current conditional state is already FALSE |
status_t runstack_handle_while | ( | runstack_context_t * | rcxt, |
uint32 | maxloops, | ||
struct xpath_pcb_t_ * | xpathpcb, | ||
val_value_t * | docroot | ||
) |
Process the current command, which is a 'while' command.
This must be called before the next command is retrieved during runstack context processing
rcxt | runstack context to use |
maxloops | max number of loop iterations |
xpathpcb | XPath control block to save which contains the expression to be processed. !!! this memory is handed off here; it will !!! be freed as part of the loopcb context |
docroot | docroot var struct that represents the XML document to run the XPath expr against !!! this memory is handed off here; it will !!! be freed as part of the loopcb context |
void runstack_init | ( | void | ) |
Initialize this module.
Must Init this module before using it!!!
void runstack_init_context | ( | runstack_context_t * | rcxt | ) |
Initialize a pre-malloced runstack context.
rcxt | runstack context to free |
uint32 runstack_level | ( | runstack_context_t * | rcxt | ) |
Get the current stack level.
rcxt | runstack context to use |
runstack_context_t * runstack_new_context | ( | void | ) |
Malloc and init a new runstack context.
void runstack_pop | ( | runstack_context_t * | rcxt | ) |
Remove a script nest level context from the stack Call just after script is completed.
rcxt | runstack context to use |
status_t runstack_push | ( | runstack_context_t * | rcxt, |
const xmlChar * | source, | ||
FILE * | fp | ||
) |
Add a script nest level context to the stack.
Call just after the file is opened and before the first line has been read
Still need to add the script parameters (if any) with the runstack_setparm
rcxt | runstack context to use |
source | file source |
fp | file pointer |
status_t runstack_save_line | ( | runstack_context_t * | rcxt, |
const xmlChar * | line | ||
) |
Save the current line if needed if a loop is active.
rcxt | runstack context to use |
line | line to save, a copy will be made |
void runstack_session_cleanup | ( | runstack_context_t * | rcxt | ) |
Cleanup after a yangcli session has ended.
rcxt | runstack context to use |
void runstack_set_groupQ | ( | runstack_context_t * | rcxt, |
dlq_hdr_t * | groupQ | ||
) |
Set the current group-specific variable Q.
rcxt | runstack context to use |
groupQ | pointer to Q of ncx_var_t to use as current group vars NULL to clear the current sessionQ |
void runstack_set_sessionQ | ( | runstack_context_t * | rcxt, |
dlq_hdr_t * | sessionQ | ||
) |
Set the current session-specific variable Q.
rcxt | runstack context to use |
sessionQ | pointer to Q of ncx_var_t to use as current session vars NULL to clear the current sessionQ |