Changes to get JPsim/olc/test/twostate/test_architecture.exe up-and-running: files affected: *********** *pr_load.c* *********** /*ADDED*/ typedef void (ActionRoutine)(hcg_key); <<<<<<<<<<<<< void pr_parse (viewname, buffer, tbl_encoding, idx, hcg_k) char viewname[]; char buffer[]; int tbl_encoding; int idx; hcg_key hcg_k; { . . . case 2 : /* encoding of ST */ STelt = pr_create(ST); STelt->STid = hcg_k; hcg_parse(buffer, hcg_t, &idx); encode(hcg_t, &hcg_k); STelt->SMid = hcg_k; hcg_parse(buffer,hcg_t,&idx); mystrcpy(STelt->ActName,hcg_t,32,1); hcg_parse(buffer,hcg_t,&idx); /*CHANGED*/ #ifdef ORIGINAL_VERSION pr_set_int(STelt,ActFunc,atoi(hcg_t)); #else STelt->ActFunc = (ActionRoutine *)atoi(hcg_t) ; <<<<<<< #endif mystrcpy(STelt->Name,buffer+idx,80,1); break; ************** *olc93su523.h* *f93olc.h * ************** /******************************************************************************/ /* Table: ST */ /******************************************************************************/ hcg_extern struct ST /* states */ { hcg_key STid; /* the primary key */ hcg_key SMid; /* The state machine */ char ActName[33]; /* Action Routine Name */ #ifdef ORIGINAL_VERSION int ActFunc /* C pointer to function */ #else void (* ActFunc)(hcg_key); /* C pointer to function */ <<<<<<<<<< #endif char Name[81]; /* The name of the state */ struct SM *SMid_pp; struct dummy_type *SMid_fpp; struct dummy_type *SMid_bpp; struct TR *TRid1_fcp; struct TR *TRid1_bcp; struct TR *TRid2_fcp; struct TR *TRid2_bcp; struct ST *prev_ptr; struct ST *next_ptr; } hcg_declare(ST); ********* *state.c* ********* struct ST *ST_elt; ST_elt = pr_create(ST); pr_set_key(ST_elt, SMid, SMid); pr_set_str(ST_elt, ActName, StatesActionRoutineName); #ifdef ORIGINAL_VERSION 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);