yumapro  24.10-2
YumaPro SDK
Loading...
Searching...
No Matches
runstack.h File Reference

CLI run stack manager. More...

#include "dlq.h"
#include "status.h"
#include "val.h"
Include dependency graph for runstack.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

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...
 
union  runstack_condcb_t::u_
 loop or if-stmt condition used but not both 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...
 

Macros

#define RUNSTACK_MAX_PARMS   9
 this is an arbitrary limit, but it must match the yangcli:run rpc P1 - Pn variables, currently set to 9 $1 to $9 parameters passed by yangcli to next script
 
#define RUNSTACK_MAX_NEST   512
 this is an arbitrary max to limit resources and run-away scripts that are called recursively
 
#define RUNSTACK_MAX_LOOP   65535
 this is an arbitrary max to limit run-away scripts that have bugs
 

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_trunstack_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...
 

Detailed Description

CLI run stack manager.