#include /* # if !defined OLC93SU523_H # include "olc93su523.h" # endif */ #include "f93olc.h" # if !defined OLC3COMMON_H # include "olc3common.h" # endif # if !defined STATE_H # include "state.h" # endif /* ** StateFirst ** StateNext ** StateDelete */ STANDARDROUTINES(State,ST) FUNCTION4( hcg_key StateCreate, const char *, StatesName, hcg_key, SMid, const char *, StatesActionRoutineName, ActionRoutine *, StatesActionRoutine ) { hcg_key STid; #ifdef GENV7 char databuffer[BUFSIZE]; KEYBUFFER(STkey); KEYBUFFER(SMkey); decode(SMkey, &SMid); pr_gen_pkey("JuicePlant", ST, STkey); sprintf(databuffer, " %s %s %.*s %d %.*s", STkey, SMkey, StatesActionRoutineNameMaxLen, StatesActionRoutineName, StatesActionRoutine, StatesNameMaxLen, StatesName); pr_add("JuicePlant", databuffer); encode(STkey, &STid); #else struct ST *ST_elt; ST_elt = pr_create(ST); pr_set_key(ST_elt, SMid, SMid); pr_set_str(ST_elt, ActName, StatesActionRoutineName); /*OWEN*/ #if 0 pr_set_int(ST_elt, ActFunc, (int )StatesActionRoutine); #else ST_elt->ActFunc = (ActionRoutine *)StatesActionRoutine ; #endif pr_set_str(ST_elt, Name, StatesName); pr_add("JuicePlant", ST, ST_elt); STid = pr_get_key(ST_elt, STid); #endif return STid; } GETROUTINE(hcg_key,State,ST,SMid) GETROUTINE(const char *,State,ST,ActName) GETROUTINE(const char *,State,ST,Name) GETROUTINE(ActionRoutine *,State,ST,ActFunc) COPYROUTINE(State,ST,Name) COPYROUTINE(State,ST,ActName)