language

some fools attempt at an interpreted language
Log | Files | Refs | README

proc.h (1590B)


      1 /* `proc.h` - Provide running process to evaluate bytecode
      2  */
      3 
      4 #ifndef PROC_H
      5 #define PROC_H
      6 
      7 #include <stdlib.h>
      8 #include <stdio.h>
      9 
     10 #include "rt.h"
     11 #include "ins_def.h"
     12 #include "bc.h"
     13 #include "stk.h"
     14 #include "var.h"
     15 #include "ns.h"
     16 #include "pc.h"
     17 #include "helper.h"
     18 
     19 /* Initializes process, returns runtime context.
     20  *  char* - Filename of valid bytecode
     21  */
     22 rt_t* proc_init(char*);
     23 
     24 /* Starts execution loop for a runtime context
     25  * rt_t* - Runtime context
     26  */
     27 void proc_run(rt_t*);
     28 
     29 /* Runs exection loop until a return is reached
     30  */
     31 void proc_run_to_return(rt_t*);
     32 
     33 /* Calls runtime context elements to free memory and terminate
     34  *  rt_t* - Runtime context
     35  */
     36 void proc_clean(rt_t*);
     37 
     38 /* Set a variable subroutine
     39  *  rt_t*     - Runtime context
     40  *  int       - Scope
     41  *  ns_addr   - Name of variable
     42  *
     43  *  This function is used to support an interface to multithreaded instances
     44  */
     45 void proc_decvar(rt_t*, b_type, int, ns_addr);
     46 
     47 /* Set a variable subroutine
     48  *  rt_t*     - Runtime context
     49  *  int       - Scope
     50  *  ns_addr   - Name of variable
     51  *  var_cont* - Variable container
     52  *
     53  *  This function is used to support an interface to multithreaded instances
     54  */
     55 void proc_setvar(rt_t*, int, ns_addr, var_cont*);
     56 
     57 /* Get a variable subroutine
     58  *  rt_t*   - Runtime context
     59  *  int     - Scope
     60  *  ns_addr - Name of variable
     61  *
     62  *  This function is used to support an interface to multithreaded instances
     63  */
     64 var_cont* proc_getvar(rt_t*, int, ns_addr);
     65 
     66 void proc_function_call(rt_t*, int, ns_addr);
     67 
     68 void proc_function_call_handle(rt_t*, var_data_func*);
     69 
     70 #endif //PROC_H