/* hif_y.y yacc syntactical description of Piper-modified H.I.F.F. */ typedef struct { unsigned char value[512]; int type; } stack_block; #define YYSTYPE stack_block #define HIF 1 #if 0 #define HIF_DEBUG_2 1 #endif #if 0 #define OD_DEBUG 1 #endif #if 0 #define TRAP_DEBUG #endif # define NUM 257 # define QTYCOLUMN 258 # define QTYROW 259 # define FALSE 260 # define TRUE 261 # define OPEN_LINE 262 # define CLOSED_LINE 263 # define RECTANGLE_BUTTON 264 # define POLYGON_BUTTON 265 # define CMD_QUEUE_SIGNAL 266 # define WINDOW 267 # define CARD 268 # define CARD_FIELD 269 # define CARD_BUTTON 270 # define CARD_SEGMENT 271 # define CMD_DELETE_CARD 272 # define SIZE 273 # define NUMBER_CARDS 274 # define SCRIPT 275 # define STRING 276 # define CMD_SEND_SIGNAL 277 # define CMD_OPEN_OBJECT 278 # define NAME 279 # define NUMBER 280 # define ID 281 # define CANTDELETE 282 # define CARDFIELDS 283 # define CARDBUTTONS 284 # define LINESTYLE 285 # define LINETYPE 286 # define CMD_START_TRAP 287 # define CMD_BEEP 288 # define CMD_OPEN_SFILE 289 # define CMD_STRCPY 290 # define SHOWFRAME 291 # define LINECOLOR 292 # define CMD_SET_STATUS_VAR 293 # define CMD_HIDE_FIELD 294 # define CMD_SHOW_FIELD 295 # define CMD_POP_CARD 296 # define CMD_END_TRAP 297 # define STACK_OD 298 # define CARD_OD 299 # define FIELD_OD 300 # define BUTTON_OD 301 # define PLAY 302 # define PAUSE 303 # define SEEK 304 # define SET_SIGNAL 305 # define RECT 306 # define STYLE 307 # define LOCKTEXT 308 # define SHOWLINES 309 # define WIDEMARGINS 310 # define AUTOTAB 311 # define TEXTHEIGHT 312 # define TEXTFONT 313 # define TEXTSIZE 314 # define TEXTSTYLE 315 # define TEXTCOLOR 316 # define VISIBLE 317 # define SHOWFILL 318 # define FILLBACK 319 # define FILLFORE 320 # define FILLCOLOR 321 # define FILLPAT 322 # define SHOWPEN 323 # define PENFORE 324 # define CMD_CHANGE_COLOR 325 # define CMD_REWRITE_FIELD 326 # define CMD_REDRAW_SEGMENT 327 # define SHOWNAME 328 # define HILITE 329 # define AUTOHILITE 330 # define TEXTALIGN 331 # define POINTLIST 332 # define CMD_GOTO_RECORD 333 # define CMD_SEARCH_INDEX 334 # define CMD_GO_TO_CARD_REL 335 # define CMD_GO_TO_CARD 336 # define CMD_OPEN_MAP 337 # define CMD_EXIT 338 # define CMD_EXIT_IIS 339 # define CMD_PUSH_CARD 340 # define CMD_CD_PLAYER 341 # define CMD_WAIT_FOR_SIGNAL 342 # define CMD_CLOSE_SFILE 343 # define CMD_PUY_CMMD_TO_CDP 344 #include #include #include #ifdef __cplusplus #ifndef yy6error void yy6error(const char *); #endif #ifndef yy6lex #ifdef __EXTERN_C__ extern "C" { int yy6lex(void); } #else int yy6lex(void); #endif #endif int yy6parse(void); #endif #define yy6clearin yy6char = -1 #define yy6errok yy6errflag = 0 extern int yy6char; extern int yy6errflag; #ifndef YYSTYPE #define YYSTYPE int #endif YYSTYPE yy6lval; YYSTYPE yy6val; typedef int yy6tabelem; #ifndef YYMAXDEPTH #define YYMAXDEPTH 150 #endif #if YYMAXDEPTH > 0 int yy6_yy6s[YYMAXDEPTH], *yy6s = yy6_yy6s; YYSTYPE yy6_yy6v[YYMAXDEPTH], *yy6v = yy6_yy6v; #else /* user does initial allocation */ int *yy6s; YYSTYPE *yy6v; #endif static int yy6maxdepth = YYMAXDEPTH; # define YYERRCODE 256 #include #include #include #include #include "tcl.h" #include "tk.h" #include "nra_defs.h" #include "nra_type.h" #include "nra_srv.h" #include "nra_service.h" #include "rep_hif.h" #include "srch_idx.h" #define TIME_TICKS 70000 #define SEARCH_IDX 0 /* flag for calling start_search */ #define NEXT_REC 1 /* flag for calling start_search */ static Tk_Window mainWindow; TRAP_STRUCT c_traps[MAX_NUM_TRAPS]; /* Holds all the card traps & associated od's */ TRAP_STRUCT cf_traps[MAX_NUM_BUTTONS][MAX_NUM_TRAPS]; /* Holds all the card_field traps & associated od's */ TRAP_STRUCT cb_traps[MAX_NUM_BUTTONS][MAX_NUM_TRAPS]; /* Holds all the card_button traps & associated od's */ struct idx_info cur_info; unsigned char temp_str[200]; unsigned char err_str[20][100]; int counting_od = 0; int current_od_count = 0; int counting_points = 0; int current_point_count = 0; int c_trap_count = 0; int cf_trap_count = 0; int cb_trap_count = 0; int od_num = 1; int changed_stack = 1; unsigned int c_status_var = 0; int in_name = 0; int a_card_found = 0; extern unsigned char tmp_hif[1000000]; extern int Button_down; extern int Button_number; extern int Redraw_request; extern int Exit_request; extern int Update_request; extern int starting_stack; extern int starting_card; int Highlight_request=0; int tcl_interactive; int segment_id; extern unsigned char country[100]; extern int just_checking; extern int check_card; extern int using_rpl; extern int using_hif; extern int current_card; extern int current_stack; extern unsigned char current_card_type[]; extern int rep_interactive; int current_pal; extern unsigned char pict_names[MAX_OPEN_PICTS][256]; extern unsigned char* start_search (int, int, unsigned char *, struct idx_info *, int); extern int strUnfont(unsigned char *, char *, int, unsigned short *); int back_map[1000]; unsigned char pixmap_names[1000][100]; unsigned char nra_colors[17][40]; struct { int sym; int page; int color; int offx; int offy; } esym_list[10000]; int el_index = 0; HIF_FIELDS hif_fields[MAX_NUM_FIELDS]; HIF_BUTTONS hif_buttons[MAX_NUM_BUTTONS]; HIF_DRAW_SEGMENTS hif_draw_segments[MAX_NUM_SEGMENTS]; struct { int x1, y1, x2, y2; } current_rectangle; int current_cf; int current_cb = 0; int current_cs; int current_hif_card; int current_background; int current_button_type; unsigned char current_point_list[MAX_NUM_POINTS*8]; int cbs_index = 0; struct { int field; int button; unsigned char string[100]; int pal; } cb_strings[1000]; int hif_card_on = 0; unsigned char foo_bits[1000][1000]; unsigned char e_foo_bits[1000][1000]; static unsigned char texture_bits[16][8]; unsigned char hif_strings[1000][1000]; int hif_strings_pal[1000]; int search_return; int tmp_hif_index = 0; #include "hif_l.c" Tcl_Interp *rep_interp; /* temporary expediant */ unsigned char bitmap_list[1000][20]; int bl_color[1000]; int bl_index = 0; /* draw parameter code */ #include "dprmdoc.h" #include #include #include #include "alpo.h" #include "nrautil.h" struct { unsigned char drawparm_hdr[DPARM_HDR_SIZE]; unsigned short size_layer; unsigned short size_sym; unsigned short size_esym; unsigned short size_pset; unsigned short size_cpalt; unsigned short size_tpalt; unsigned short size_lpalt; unsigned short num_layer; unsigned short num_sym; unsigned short num_esym; unsigned short num_pset; unsigned short num_cpalt; unsigned short num_tpalt; unsigned short num_lpalt; unsigned char *popttl; unsigned char *pslut; unsigned char *peslut; unsigned char *ppset; unsigned char *pclut; unsigned char *ptlut; unsigned char *pllut; } m_drawparm; BOOL DprmDoc(char* ); yy6error() { if (using_hif) printf("Hif file line %d\n",yy6lineno); sprintf(err_str[0],"Syntax error in hif simulation."); sprintf(err_str[1],yy6text); rep_error(HIF); /* we hope that yy6parse simply doesn't recover, and returns 1 */ } error_dump() { printf("Line %d\n",yy6lineno); printf("*****\n"); printf("*****\n"); printf(tmp_hif); printf("*****\n"); printf("*****\n"); printf("Line %d\n",yy6lineno); } void LoadColEntry(ColorPalette *, unsigned char* , unsigned short ); init_tcl() { unsigned char string[1000]; int rc,i; rep_interp = Tcl_CreateInterp(); mainWindow = Tk_CreateMainWindow(rep_interp, 0, "rep", "Tk"); if (mainWindow == NULL) { printf("Failed window creation.\n"); fprintf(stderr, "%s\n", rep_interp->result); exit(1); } if (Tcl_Init(rep_interp) == TCL_ERROR) { printf("Tcl_Init failed\n"); printf("%s\n",rep_interp->result); exit(1); } if (Tk_Init(rep_interp) == TCL_ERROR) { printf("Tk_Init failed\n"); printf("%s\n",rep_interp->result); exit(1); } Tk_GeometryRequest(mainWindow, 200, 200); Tcl_LinkVar(rep_interp,"Button_down", (unsigned char *) &Button_down, TCL_LINK_INT); Tcl_LinkVar(rep_interp,"Button_number", (unsigned char *) &Button_number, TCL_LINK_INT); Tcl_LinkVar(rep_interp,"Redraw_request", (unsigned char *) &Redraw_request, TCL_LINK_INT); Tcl_LinkVar(rep_interp,"Exit_request", (unsigned char *) &Exit_request, TCL_LINK_INT); Tcl_LinkVar(rep_interp,"Highlight_request", (unsigned char *) &Highlight_request, TCL_LINK_INT); Tcl_LinkVar(rep_interp,"tcl_interactive", (unsigned char *) &tcl_interactive, TCL_LINK_INT); Tcl_LinkVar(rep_interp,"segment_id", (unsigned char *) &segment_id, TCL_LINK_INT); Button_down = 0; Button_number = 0; Redraw_request = 0; Exit_request = 0; Highlight_request = 0; tcl_interactive =1; segment_id = 0; if (DprmDoc((char *)country) == 0) { printf("Something's wrong with the drawparm file %s.dpm\n",country); exit(1); } load_bitmaps(); load_textures(); /* create canvas */ strcpy(string,"canvas .c -background white -width 360 -height 240"); rc = Tcl_Eval(rep_interp, string); if (rc == TCL_ERROR) { printf("Could not create canvas.\n"); printf("%s\n",rep_interp->result); exit(1); } current_background = -1; memset(back_map,0,sizeof(back_map)); /* create Redraw (based on above links) and Exit buttons */ strcpy(string,"button .d -text ReDraw -background honeydew -command { set Redraw_request 1 }"); rc = Tcl_Eval(rep_interp, string); if (rc == TCL_ERROR) { printf("Could not create redraw button.\n"); printf("%s\n",rep_interp->result); exit(1); } strcpy(string,"checkbutton .e -text \" Toggle Switch Highlight \" -background honeydew -variable Highlight_request -command { set Redraw_request 1 }"); rc = Tcl_Eval(rep_interp, string); if (rc == TCL_ERROR) { printf("Could not create redraw button.\n"); printf("%s\n",rep_interp->result); exit(1); } strcpy(string,"button .f -text Exit -background LightGoldenrodYellow -command { do_exit; set Exit_request 1 }"); rc = Tcl_Eval(rep_interp, string); if (rc == TCL_ERROR) { printf("Could not create exit button.\n"); printf("%s\n",rep_interp->result); exit(1); } /* create point log button */ strcpy(string,"checkbutton .log -text \" Log points to point_log \" -variable log"); rc = Tcl_Eval(rep_interp, string); if (rc == TCL_ERROR) { printf("Could not create log button.\n"); printf("%s\n",rep_interp->result); exit(1); } /* create position readout canvas */ strcpy(string,"canvas .g -background white -width 360 -height 235"); rc = Tcl_Eval(rep_interp, string); if (rc == TCL_ERROR) { printf("Could not create readout canvas.\n"); printf("%s\n",rep_interp->result); exit(1); } /* other position readout code */ strcpy(string,"bind .c { \ set a %x \n\ set b %y \n\ incr a -20 \n\ incr b -15 \n\ .g create text 20 5 -text \"X_Coordinate: $a\" -anchor nw -tag readout \n\ .g create text 20 20 -text \"Y_Coordinate: $b\" -anchor nw -tag readout \n\ if { $log > 0 } { \n\ set index [lindex [.point_list.l curselection] 0] \n\ if { $index == \"\" } { unset index; set index end; } \n\ .point_list.l insert $index \" $a $b\" \n\ draw_line \n\ .point_list.l select clear \n\ } \n\ } \n\ bind .c { \n\ set a %x \n\ set b %y \n\ incr a -20 \n\ incr b -15 \n\ .g delete readout \n\ .g create text 20 5 -text \"X_Coordinate: $a\" -anchor nw -tag readout \n\ .g create text 20 20 -text \"Y_Coordinate: $b\" -anchor nw -tag readout } \n\ bind .c { .g delete readout } "); rc = Tcl_Eval(rep_interp, string); if (rc == TCL_ERROR) { printf("Could not run position readout code.\n"); printf("%s\n",rep_interp->result); exit(1); } #if 0 /* create rpldef and rpldef-data screens, blank */ strcpy(string,"canvas .f -background white"); rc = Tcl_Eval(rep_interp, string); if (rc == TCL_ERROR) { printf("Could not create rpldef screen.\n"); printf("%s\n",rep_interp->result); exit(1); } strcpy(string,"canvas .g -background grey"); rc = Tcl_Eval(rep_interp, string); if (rc == TCL_ERROR) { printf("Could not create rpldef-data screen.\n"); printf("%s\n",rep_interp->result); exit(1); } /* pack everything */ strcpy(string,"pack .c .d .e .f .g -fill x"); rc = Tcl_Eval(rep_interp, string); if (rc == TCL_ERROR) { printf("Could not pack display.\n"); printf("%s\n",rep_interp->result); exit(1); } #endif /* pack everything */ strcpy(string,"pack .c .d .e .log .f .g -fill x"); rc = Tcl_Eval(rep_interp, string); if (rc == TCL_ERROR) { printf("Could not pack display.\n"); printf("%s\n",rep_interp->result); exit(1); } /* Generate point list window */ strcpy(string, "toplevel .point_list \n\ listbox .point_list.l -relief raised -bd 2 -yscrollcommand \".point_list.scroll set\" \n\ scrollbar .point_list.scroll -command \".point_list.l yview\" \n\ pack .point_list.l -side left -in .point_list \n\ pack .point_list.scroll -side right -fill y -in .point_list \n"); rc = Tcl_Eval(rep_interp, string); if (rc == TCL_ERROR) { printf("Could not create point_list window.\n"); printf("%s\n",rep_interp->result); exit(1); } strcpy(string, "bind .point_list.l { \n\ if { [.point_list.l curselection] != \"\" } { \n\ set temp \"\" \n\ foreach x [.point_list.l curselection] { \n\ set temp [linsert $temp 0 $x] \n\ } \n\ foreach x $temp { \n\ .point_list.l delete $x \n\ } \n\ draw_line \n\ .point_list.l select clear \n\ } \n\ }"); rc = Tcl_Eval(rep_interp, string); if (rc == TCL_ERROR) { printf("Could not create point_list window.\n"); printf("%s\n",rep_interp->result); exit(1); } strcpy(string, "proc draw_line {} { \n\ .c delete Line \n\ set length [.point_list.l size] \n\ if { $length > 1 } { \n\ set index 0 \n\ while { $index < $length } { \n\ set x [lindex [.point_list.l get $index] 0] \n\ set y [lindex [.point_list.l get $index] 1] \n\ incr x 20 \n\ incr y 15 \n\ append points \"$x $y \" \n\ incr index \n\ } \n\ set cmd \".c create line $points -width 2 -tag Line\" \n\ eval $cmd \n\ unset points \n\ unset index \n\ } \n\ unset length \n\ }"); rc = Tcl_Eval(rep_interp, string); if (rc == TCL_ERROR) { printf("Could not create point_list window.\n"); printf("%s\n",rep_interp->result); exit(1); } strcpy(string, "proc do_exit {} { \n\ global log \n\ if { $log > 0 } { \n\ set file [open point_list w] \n\ set length [.point_list.l size] \n\ set index 0 \n\ while { $index < $length } { \n\ set x [lindex [.point_list.l get $index] 0] \n\ set y [lindex [.point_list.l get $index] 1] \n\ puts $file \"$x, $y\" \n\ incr index \n\ } \n\ close $file \n\ } \n\ }"); rc = Tcl_Eval(rep_interp, string); if (rc == TCL_ERROR) { printf("Could not create point_list window.\n"); printf("%s\n",rep_interp->result); exit(1); } set_pal(8); UPDATE_DISPLAY } set_pal(int pnum) { int i; ColorPalette Pal; memset(nra_colors,0,sizeof(nra_colors)); LoadColEntry(&Pal, m_drawparm.pclut, pnum); current_pal = pnum; for (i=0; i<16;i++) { sprintf(nra_colors[i],"%02x%02x%02x", Pal.rgb888[i].red, Pal.rgb888[i].green, Pal.rgb888[i].blue); } } int round_number = 0; int simulate_tmp() { unsigned char string[1000]; int i,j, rc; CMD_ODS *this_od, *next_od; int yret = 0; struct draw_segment *seg_info; for (i=0; i < MAX_NUM_TRAPS; i++) { next_od = c_traps[i].trap_od; while ( next_od != (CMD_ODS *) NULL ) { this_od = next_od; next_od = next_od->next_od; if (this_od->numeric_args) free(this_od->numeric_args); if (this_od->string_arg) free(this_od->string_arg); free(this_od); } for(j=0; j < MAX_NUM_BUTTONS; j++) { next_od = cb_traps[j][i].trap_od; while ( next_od != (CMD_ODS *) NULL ) { this_od = next_od; next_od = next_od->next_od; if (this_od->numeric_args) free(this_od->numeric_args); if (this_od->string_arg) free(this_od->string_arg); free(this_od); } } /* End for j */ for(j=0; j < MAX_NUM_FIELDS; j++) { next_od = cf_traps[j][i].trap_od; while ( next_od != (CMD_ODS *) NULL ) { this_od = next_od; next_od = next_od->next_od; if (this_od->numeric_args) free(this_od->numeric_args); if (this_od->string_arg) free(this_od->string_arg); free(this_od); } } /* End for j */ } /* End for i */ for (i = 0; i < MAX_NUM_FIELDS; i++) { if (hif_fields[i].content) { free(hif_fields[i].content); } } search_return = 0; memset(hif_strings,0,sizeof(hif_strings)); memset(hif_strings_pal,0,sizeof(hif_strings_pal)); memset(hif_buttons,0,sizeof(hif_buttons)); memset(hif_fields,0,sizeof(hif_fields)); memset(hif_draw_segments,0,sizeof(hif_draw_segments)); memset(cb_strings,0,sizeof(cb_strings)); memset(temp_str,0,sizeof(temp_str)); memset(c_traps,0,sizeof(c_traps)); memset(cb_traps,0,sizeof(cb_traps)); memset(cf_traps,0,sizeof(cf_traps)); cbs_index = 0; tmp_hif_index = 0; in_name = 0; yy6char = -1; yy6errflag = 0; yy6previous = YYNEWLINE; yy6lineno = 1; a_card_found = 0; counting_od = 0; current_od_count = 0; counting_points = 0; current_point_count = 0; current_button_type = 0; current_cb = current_cf = 0; /* ... if using_rpl, update rpldef and rpldef-data screens */ /* ... if using_hif, blank rpldef and rpldef-data screens (destroy text) */ /* destroy old stuff on screen */ if (!just_checking) { strcpy(string,".c delete cardtag card_button card_field cardSegment"); rc = Tcl_Eval(rep_interp, string); if (rc == TCL_ERROR) { printf("Could not delete cardtag items.\n"); printf("%s\n",rep_interp->result); exit(1); } } /* destroy old "stack card" line */ if (round_number && !just_checking) { strcpy(string,".g delete stackcard"); rc = Tcl_Eval(rep_interp, string); if (rc == TCL_ERROR) { printf("Could not delete stack card line.\n"); printf("%s\n",rep_interp->result); exit(1); } } /* make new "stack card" line */ if (!just_checking) { sprintf(string,".g create text 20 35 -text {Stack %d Card %d} -fill black -anchor nw -tag stackcard", current_stack, current_card); rc = Tcl_Eval(rep_interp, string); if (rc == TCL_ERROR) { printf("Could not create stack card line.\n"); printf("%s\n",rep_interp->result); exit(1); } sprintf(string,".g create text 20 50 -text {%s} -fill black -anchor nw -tag stackcard", current_card_type); rc = Tcl_Eval(rep_interp, string); if (rc == TCL_ERROR) { printf("Could not create 'current card type' line.\n"); printf("%s\n",rep_interp->result); exit(1); } } if (using_rpl) hif_card_on = 1; yret = 0; yret = yy6parse(); if (hif_card_on || (using_hif && !just_checking)) { /* initially_visible doesn't really work for us if ( initially_visible() ) { printf("Could not create initially visible items\n"); exit(1); } */ if (changed_stack) { /* we changed stacks so issue open card stack signal */ dispatch_signal(CANVAS_BUTTON, OPEN_CS_SIG); } dispatch_signal(CANVAS_BUTTON, OPEN_CARD_SIG); /* create button-1 binding to whole canvas for IIS event signal */ sprintf(string,".c bind [.c create rectangle %d %d %d %d -fill {} -outline {} -tag card_button] { \ set Button_down 1 \n\ set Button_number %d }",0,0,360,240,CANVAS_BUTTON); #ifdef OD_DEBUG printf("tcl string is **%s**\n",string); #endif rc = Tcl_Eval(rep_interp, string); if (rc == TCL_ERROR) { sprintf(err_str[0],"Whole canvas rectangle button creation unsuccessful.\n"); sprintf(err_str[1],"%s",rep_interp->result); sprintf(err_str[2],""); rep_error(HIF); return 1; } if ( create_buttons() ) { printf("Could not create buttons\n"); exit(1); } } if (using_rpl) hif_card_on = 0; /* update */ if (!just_checking) { sprintf(string,"update"); rc = Tcl_Eval(rep_interp, string); if (rc == TCL_ERROR) { printf("Could not update.\n"); printf("%s\n",rep_interp->result); exit(1); } } round_number++; if (!just_checking && yret) return 1; return search_return; } rep_err_erase() { unsigned char string[1000]; int rc; strcpy(string,".g delete reperror"); rc = Tcl_Eval(rep_interp, string); if (rc == TCL_ERROR) { printf("Could not delete reperror.\n"); printf("%s\n",rep_interp->result); exit(1); } } extern int tmp_count; extern int tmp_to_template[100000]; rep_error(int type) { int i; unsigned char string[1000]; int rc; printf("In card %d, card type %s\n",current_card,current_card_type); if (rep_interactive) { rep_err_erase(); sprintf(string,".g create text 20 65 -text {Stack %d Card %d} -fill red -anchor nw -tag reperror", current_stack, current_card); rc = Tcl_Eval(rep_interp, string); if (rc == TCL_ERROR) { printf("Could not create error stack card line.\n"); printf("%s\n",rep_interp->result); exit(1); } sprintf(string,".g create text 20 80 -text {%s} -fill red -anchor nw -tag reperror", current_card_type); rc = Tcl_Eval(rep_interp, string); if (rc == TCL_ERROR) { printf("Could not create error card type line.\n"); printf("%s\n",rep_interp->result); exit(1); } if (type == HIF) { if (tmp_to_template[yy6lineno] < 0) { sprintf(string,".g create text 20 95 -text \ {From RICH TEXT} -fill red -anchor nw -tag reperror"); rc = Tcl_Eval(rep_interp, string); if (rc == TCL_ERROR) { printf("Could not write template Rich Text error.\n"); printf("%s\n",rep_interp->result); exit(1); } } else { sprintf(string,".g create text 20 95 -text \ {From template line %d} -fill red -anchor nw -tag reperror", tmp_to_template[yy6lineno]); rc = Tcl_Eval(rep_interp, string); if (rc == TCL_ERROR) { printf("Could not write template line number.\n"); printf("%s\n",rep_interp->result); exit(1); } } } for ( i=0; strlen(err_str[i]) && (i < 8); i++) { sprintf(string,".g create text 20 %d -text {%s} -fill red -anchor nw -tag reperror", (i*15) + 110, err_str[i]); rc = Tcl_Eval(rep_interp, string); if (rc == TCL_ERROR) { printf("Could not create error line.\n"); printf("%s\n",rep_interp->result); exit(1); } } for (i=0;strlen(err_str[i]) && i < 8; i++) { printf("%s\n",err_str[i]); } } else { for (i=0;strlen(err_str[i]) && i < 8; i++) { printf("%s\n",err_str[i]); } } } int process_sig(int signal_num, TRAP_STRUCT *traps, unsigned int *status_var) { int i; # ifdef TRAP_DEBUG printf("process_sig: signal_num = %d status_var = %u\n",signal_num,*status_var); # endif for(i = 0; i < MAX_NUM_TRAPS; i++,traps++) { # ifdef TRAP_DEBUG printf("Does signal %d == %d\n",traps->trap_signal,signal_num); # endif if ( (traps->trap_signal == signal_num) && ((traps->object_status_var & traps->mask) == *status_var) ) { if ( simulate_od(traps->trap_od,status_var) ) { printf("Could not simulate OD\n"); exit(1); } return 1; /* signal was trapped */ break; } } return 0; /* signal was not trapped */ } dispatch_signal(int OD_num, int signal_num) { int trapped = 0, field_num, button_num; #ifdef TRAP_DEBUG printf("\ndispatch_signal: OD_num = %d signal_num = %d\n",OD_num,signal_num); #endif switch (signal_num) { case START_IIS_SIG : case QUIT_IIS_SIG : case OPEN_CS_SIG : case CLOSE_CS_SIG : case OPEN_CARD_SIG : case CLOSE_CARD_SIG : case FOUND_REC_SIG : case NOT_FOUND_REC_SIG : case NO_MORE_CARD : case NO_MORE_RECORD : case OPEN_MAP : case EVENT_EOS : case CANT_ACCEPT : case CANT_EXECUTE : case ILLEGAL_PRIMITIVE: # ifdef TRAP_DEBUG printf("dispatch_signal: routing signal to card\n"); # endif trapped = process_sig(signal_num,c_traps,&c_status_var); break; case IIS_EVENT_SIG: if (OD_num > 0) { /* only send the signal to the button traps if the button # is > 0 */ /* First send the signal to the card button ods */ for (button_num = 0; button_num < MAX_NUM_BUTTONS; button_num++) { if (hif_buttons[button_num].OD == OD_num) { # ifdef TRAP_DEBUG printf("dispatch_signal: routing signal to card_button.\n"); # endif trapped = process_sig(signal_num,cb_traps[button_num],&hif_buttons[button_num].status_var); break; } } if (!trapped) { /* send the signal to the card field ods */ for (field_num = 0; field_num < MAX_NUM_FIELDS; field_num++) { if (hif_fields[field_num].OD == OD_num) { # ifdef TRAP_DEBUG printf("dispatch_signal: routing signal to card_field.\n"); # endif trapped = process_sig(signal_num,cf_traps[field_num],&hif_fields[field_num].status_var); break; } } } } if (!trapped) { # ifdef TRAP_DEBUG printf("dispatch_signal: routing signal to card\n"); # endif process_sig(signal_num,c_traps,&c_status_var); /* always pass the signal to the card traps */ } break; default: } /* end switch */ } int draw_string_or_symbol(unsigned char *item, int field_num) { unsigned char bmp_string[40]; unsigned char string[1000]; int rc, len, i; int x1, y1, x2, y2, rows, columns, color, fill_pat, fill_fore, fill_back, show_fill, show_pen, pen_fore; x1 = hif_fields[field_num].x1; y1 = hif_fields[field_num].y1; x2 = hif_fields[field_num].x2; y2 = hif_fields[field_num].y2; rows = hif_fields[field_num].rows; columns = hif_fields[field_num].columns; color = hif_fields[field_num].text_color - 1; fill_pat = hif_fields[field_num].fill_pat; fill_fore = hif_fields[field_num].fill_fore - 1; fill_back = hif_fields[field_num].fill_back - 1; show_fill = hif_fields[field_num].show_fill; show_pen = hif_fields[field_num].show_pen; pen_fore = hif_fields[field_num].pen_fore - 1; if (color == -1) color = DEFAULT_COLOR; if (strlen(item)) { /* check for icon. */ if (item[0] == '^') { /* Strip trailing circumflex and upper case the string. */ len = strlen(item); if (item[len-1] == '^') { int i; item[len-1] = '\0'; for (i=0;item[i];i++) { if (isalpha(item[i])) { item[i] = toupper(item[i]); } } } /* check for regular symbol */ sprintf(bmp_string,"bmp%s",&item[1]); for (i=0;iresult); sprintf(err_str[3],""); rep_error(HIF); return 1; } } else { /* expansion symbol or error */ int this_sym, this_x, this_y; sscanf(&item[1],"%4x",&this_sym); /* check for expansion symbol */ for (i=0;iresult); sprintf(err_str[3],""); rep_error(HIF); return 1; } } } else { /* error */ sprintf(err_str[0],"NO SYMBOL %X in .DPM.\n",this_sym); sprintf(err_str[1],""); rep_error(HIF); return 1; } } } else { /* it's a string */ int went_over = 0; int went_over_at = 0; int this_height; int loop_x, loop_y; int max_char = 0; int pos; if ( show_fill ) /* Draw background for character field */ { sprintf(string,".c create rectangle %d %d %d %d \ -fill #%s -outline #%s -tag {cardtag cftag%d}", x1 + NSRA_X, y1 + NSRA_Y, x2 + NSRA_X, y2 + NSRA_Y, nra_colors[fill_back], nra_colors[fill_back], field_num); # ifdef HIF_DEBUG_2 printf("tcl string is **%s**\n",string); # endif rc = Tcl_Eval(rep_interp, string); if (rc == TCL_ERROR) { sprintf(err_str[0],"Drawing character field background returns unsuccessfully"); sprintf(err_str[1],"%s",string); sprintf(err_str[2],"%s",rep_interp->result); sprintf(err_str[3],""); rep_error(HIF); printf("Drawing character field background returns unsuccessfully"); } } if ( show_pen ) /* Draw the outline of the character field */ { sprintf(string,".c create rectangle %d %d %d %d \ -outline #%s -tag {cardtag cftag%d}", x1 + NSRA_X, y1 + NSRA_Y, x2 + NSRA_X, y2 + NSRA_Y, nra_colors[pen_fore], field_num); # ifdef HIF_DEBUG_2 printf("tcl string is **%s**\n",string); # endif rc = Tcl_Eval(rep_interp, string); if (rc == TCL_ERROR) { sprintf(err_str[0],"Drawing character field outline returns unsuccessfully"); sprintf(err_str[1],"%s",string); sprintf(err_str[2],"%s",rep_interp->result); sprintf(err_str[3],""); rep_error(HIF); printf("Drawing character field outline returns unsuccessfully"); } } len = strlen(item); item[len] = '\0'; if (color == 0) { sprintf(err_str[0],"Textcolor 1 will not result in drawn text"); sprintf(err_str[1],"String: %s",item); sprintf(err_str[2],""); rep_error(HIF); return 1; } this_height = (y2-y1); /* draw each character bitmap */ loop_y = y1+NSRA_Y + (y2-y1)/rows; loop_x = x1+NSRA_X + ((x2-x1)/columns); max_char = (columns - 1) * (rows-1); # ifdef HIF_DEBUG_2 printf("Before loop\n"); printf("rect = %d, %d, %d, %d\n",x1,y1,x2,y2); printf("Rows = %d Columns = %d\n",rows,columns); # endif for (i=0, pos = 1;item[i];i++) { char quoted = 0; # ifdef HIF_DEBUG_2 printf("\n %4X = %c\n",item[i],item[i]); printf(" loop_x = %d loop_y = %d\n",loop_x,loop_y); # endif if (item[i] == '*') /* convert to a space */ item[i] = ' '; if (item[i] == '\\') /* skip this backslash */ continue; sprintf(bmp_string,"bmp%4X",item[i]+0xfa60); if (item[i] >= 161 && item[i]<= 255) sprintf(bmp_string,"bmp%4X",item[i]+0xf8df); if (item[i] == 170) sprintf(bmp_string,"bmp%4X",0xfa9c); if (!((pos-1) % (columns - 1)) && (pos-1)) { loop_x = x1+NSRA_X + ((x2-x1)/columns); /* loop_y += ((y2-y1)/(rows - 1)); */ loop_y += (y2-y1)/rows; } else if ((pos-1) && ((pos-1) % (columns - 1))) { loop_x = loop_x + ((x2-x1)/(columns)); } if (pos > max_char) break; sprintf(string,".c create bitmap %d %d \ -bitmap %s -mask %s -anchor center \ -foreground #%s -tag {cardtag cftag%d}", loop_x, loop_y, bmp_string, bmp_string, nra_colors[color], field_num); # ifdef HIF_DEBUG_2 printf("tcl string is **%s**\n",string); # endif rc = Tcl_Eval(rep_interp, string); if (rc == TCL_ERROR) { /* replace bitmap with a "space" */ sprintf(err_str[0],"Drawing string character returns unsuccessfully"); sprintf(err_str[1],"%s",string); sprintf(err_str[2],"%s",rep_interp->result); sprintf(err_str[3],""); rep_error(HIF); printf("Unable to find bitmap %s. Substituting space character\n",bmp_string); sprintf(bmp_string,"bmp%4X",' ' + 0xfa60); sprintf(string,".c create bitmap %d %d \ -bitmap %s -mask %s -anchor center \ -foreground #%s -tag {cardtag cftag%d}", loop_x, loop_y, bmp_string, bmp_string, nra_colors[color], field_num); rc = Tcl_Eval(rep_interp, string); } pos++; } } } if (Button_down) { strcpy(string,"update"); rc = Tcl_Eval(rep_interp, string); if (rc == TCL_ERROR) { printf("update returns unsuccessfully\n"); printf("%s\n",rep_interp->result); exit(1); } } hif_fields[field_num].isdrawn = 1; return 0; } hif_bell() { XBell(Tk_Display(mainWindow),0); } labSymbol data[MAX_SYMBOL_LAYERS]; /* load all those bitmaps into tk, named by upper-case hex-numbers, prefixed by "bmp", suffixed by -# if esym */ load_bitmaps() { int a, i, j, rc; int sym, e_sym; unsigned short targetSym; unsigned char string[1000]; unsigned short row, mask, maskleft, one; int code, foo_width, foo_height, foo_index; int e_foo_width, e_foo_height, e_foo_index; struct sym_dat* pSymTab = (struct sym_dat*)m_drawparm.pslut; struct esym_dat* pESymTab = (struct esym_dat*)m_drawparm.peslut; memset(foo_bits,0,sizeof(foo_bits)); for (sym=0; sym<(int)m_drawparm.num_sym; sym++) { targetSym = GET_NRA_SHORT(&pSymTab->sym_code); memset(&data,0,MAX_SYMBOL_LAYERS*sizeof(labSymbol)); rc = getSymbol(targetSym, data, MAX_SYMBOL_LAYERS); if (!rc) { printf("Very strange ... getSymbol failed. Corrupt .dpm?\nCan't find %X\n",targetSym); exit(1); } /* load into a static bitmap */ foo_index = 0; for (i=0; i<16; i++) { /* swap bits */ row = 0; one = 1; maskleft = 1; for (j=0;j<16;j++) { /* get bit j */ mask = one << 15-j; if (data[0].bits[i] & mask) row |= maskleft; maskleft = maskleft << 1; } foo_bits[sym][foo_index++] = row; row = row >> 8; foo_bits[sym][foo_index++] = row; } /* define */ foo_height = 16; foo_width = 16; sprintf(string,"bmp%4X",targetSym); # ifdef HIF_DEBUG_2 printf("%s\n",string); # endif strcpy(bitmap_list[bl_index],string); bl_color[bl_index++] = data[0].color; Tk_DefineBitmap(rep_interp,Tk_GetUid(string), foo_bits[sym], foo_width, foo_height); pSymTab++; } /* e-syms */ memset(e_foo_bits,0,sizeof(e_foo_bits)); for (e_sym=0; e_sym<(int)m_drawparm.num_esym; e_sym++) { targetSym = GET_NRA_SHORT(&pESymTab->esym_code); # ifdef HIF_DEBUG_2 printf("Esym: %x\n",targetSym); # endif memset(&data,0,MAX_SYMBOL_LAYERS*sizeof(labSymbol)); rc = getSymbol(targetSym, data, MAX_SYMBOL_LAYERS); if (!rc) { printf("Very strange ... getSymbol failed. Corrupt .dpm?\nCan't find %X\n",targetSym); exit(1); } for (a=1;a> 8; e_foo_bits[el_index][e_foo_index++] = row; } /* define */ e_foo_height = 16; e_foo_width = 16; sprintf(string,"bmp%4X_%d",targetSym,a); # ifdef HIF_DEBUG_2 printf("%s\n",string); # endif esym_list[el_index].sym = (int) targetSym; esym_list[el_index].page = a; esym_list[el_index].color = data[a].color; esym_list[el_index].offx = data[a].offx; esym_list[el_index].offy = data[a].offy; Tk_DefineBitmap(rep_interp,Tk_GetUid(string), e_foo_bits[el_index++], e_foo_width, e_foo_height); } pESymTab++; } } /*/////////////////////////////////////////////////////////////////////////// // CDprmDoc // ///////////////////////////////////////////////////////////////////////////// */ /* ParseHdr() // // Perform appropriate unsigned char swapping while parsing the drawparm header to // fill out the m_drawparm structure. */ /**/ BOOL ParseHdr(FILE* dpFile) { m_drawparm.size_layer = GET_NRA_SHORT(&m_drawparm.drawparm_hdr[4]); m_drawparm.size_sym = GET_NRA_SHORT(&m_drawparm.drawparm_hdr[10]); m_drawparm.size_esym = GET_NRA_SHORT(&m_drawparm.drawparm_hdr[16]); m_drawparm.size_pset = GET_NRA_SHORT(&m_drawparm.drawparm_hdr[22]); m_drawparm.size_cpalt = GET_NRA_SHORT(&m_drawparm.drawparm_hdr[28]); m_drawparm.size_tpalt = GET_NRA_SHORT(&m_drawparm.drawparm_hdr[34]); m_drawparm.size_lpalt = GET_NRA_SHORT(&m_drawparm.drawparm_hdr[40]); m_drawparm.popttl = (unsigned char*)malloc(m_drawparm.size_layer); if (!m_drawparm.popttl) return 0; fseek(dpFile, (long) GET_NRA_SHORT(m_drawparm.drawparm_hdr + 0), 0); fread( m_drawparm.popttl, 1, m_drawparm.size_layer, dpFile); m_drawparm.num_layer = GET_NRA_UCHAR(m_drawparm.drawparm_hdr + 3); m_drawparm.pslut = (unsigned char*)malloc(m_drawparm.size_sym); if (!m_drawparm.pslut) return 0; fseek(dpFile, (long) GET_NRA_SHORT(m_drawparm.drawparm_hdr + 6), 0); fread( m_drawparm.pslut, 1, m_drawparm.size_sym, dpFile); m_drawparm.num_sym = GET_NRA_SHORT(m_drawparm.drawparm_hdr + 8); m_drawparm.peslut = (unsigned char*)malloc(m_drawparm.size_esym); if (!m_drawparm.peslut) return 0; fseek(dpFile, (long) GET_NRA_SHORT(m_drawparm.drawparm_hdr + 12), 0); fread( m_drawparm.peslut, 1, m_drawparm.size_esym, dpFile); m_drawparm.num_esym = GET_NRA_SHORT(m_drawparm.drawparm_hdr + 14); m_drawparm.ppset = (unsigned char*)malloc(m_drawparm.size_pset); if (!m_drawparm.ppset) return 0; fseek(dpFile, (long) GET_NRA_SHORT(m_drawparm.drawparm_hdr + 18), 0); fread( m_drawparm.ppset, 1, m_drawparm.size_pset, dpFile); m_drawparm.num_pset = GET_NRA_UCHAR(m_drawparm.drawparm_hdr + 21); m_drawparm.pclut = (unsigned char*)malloc(m_drawparm.size_cpalt); if (!m_drawparm.pclut) return 0; fseek(dpFile, (long) GET_NRA_SHORT(m_drawparm.drawparm_hdr + 24), 0); fread( m_drawparm.pclut, 1, m_drawparm.size_cpalt, dpFile); m_drawparm.num_cpalt = GET_NRA_UCHAR(m_drawparm.drawparm_hdr + 27); m_drawparm.ptlut = (unsigned char*)malloc(m_drawparm.size_tpalt); if (!m_drawparm.ptlut) return 0; fseek(dpFile, (long) GET_NRA_SHORT(m_drawparm.drawparm_hdr + 30), 0); fread( m_drawparm.ptlut, 1, m_drawparm.size_tpalt, dpFile); m_drawparm.num_tpalt = GET_NRA_UCHAR(m_drawparm.drawparm_hdr + 33); m_drawparm.pllut = (unsigned char*)malloc(m_drawparm.size_lpalt); if (!m_drawparm.pllut) return 0; fseek(dpFile, (long) GET_NRA_SHORT(m_drawparm.drawparm_hdr + 36), 0); fread( m_drawparm.pllut, 1, m_drawparm.size_lpalt, dpFile); m_drawparm.num_lpalt = GET_NRA_UCHAR(m_drawparm.drawparm_hdr + 39); return 1; } void FreeBuffers() { if(m_drawparm.popttl) free(m_drawparm.popttl); if(m_drawparm.pslut) free(m_drawparm.pslut); if(m_drawparm.peslut) free(m_drawparm.peslut); if(m_drawparm.ppset) free(m_drawparm.ppset); if(m_drawparm.pclut) free(m_drawparm.pclut); if(m_drawparm.ptlut) free(m_drawparm.ptlut); if(m_drawparm.pllut) free(m_drawparm.pllut); memset ((void *)&m_drawparm, 0, sizeof (m_drawparm)); } BOOL ReadDpmFile(FILE* dpFile) { fseek(dpFile, 0L, 0); if (fread(m_drawparm.drawparm_hdr,1,DPARM_HDR_SIZE,dpFile) < DPARM_HDR_SIZE) return 0; /* figure out where option layers, palettes, etc. are; malloc the space // and read them in. */ return (ParseHdr(dpFile)); } /**/ BOOL OnOpenDocument(char* pszPathName) { FILE* dpFile; if (!(dpFile = nraOpen((char *)pszPathName, ".dpm", "rb"))) { return (0); } if (ReadDpmFile(dpFile) == 0) { FreeBuffers(); return 0; } fclose(dpFile); return 1; } /***** Vection Icon Cache Function Prototypes *******/ static void InitViconCache(void); static void FreeViconCache(void); /****************************************************/ /* CDprmDoc construction/destruction */ BOOL DprmDoc(char* pszPathName) { InitViconCache(); return OnOpenDocument(pszPathName); } void DprmDocDestroy() { FreeBuffers(); FreeViconCache(); } /*/////////////////////////////////////////////////////////////////////////// */ void LoadColEntry(ColorPalette *pPal, unsigned char* pclut, unsigned short num_cpalt) { unsigned short i; struct nra_colors *pcolors = (struct nra_colors *)(pclut + (sizeof(struct cpalt_dat) * num_cpalt)); for (i=0; i<16; i++) { pPal->rgb888[i].red = NRA_TO_TRUE_COLOR((pcolors->red)&0x0f); pPal->rgb888[i].green = NRA_TO_TRUE_COLOR( ((int)(pcolors->green_blue)&0x00f0)>>4 ); pPal->rgb888[i].blue = NRA_TO_TRUE_COLOR((pcolors->green_blue)&0x0f); pcolors++; } } /*/////////////////////////////////////////////////////////////////////////// */ LineStyle LoadLineEntry(unsigned char* pllut, unsigned short num_lpalt, unsigned short num_lstyle) { struct lpalt_dat *pLP = (struct lpalt_dat*)(pllut + (sizeof(struct lpalt_dat) * num_lpalt)); LineStyle style; style = GET_NRA_SHORT(&pLP->lpalt_pat[num_lstyle]); return style; } /*/////////////////////////////////////////////////////////////////////////// */ void LoadTextureEntry(TextureStyle* pTexture, unsigned char* ptlut, unsigned short num_tpalt, unsigned short num_tstyle) { int i; struct tpalt_dat *pTP = (struct tpalt_dat*)(ptlut + (sizeof(struct tpalt_dat) * num_tpalt)); for (i=0; i<8; i++) { pTexture->dotMap8[i] = pTP->tpalt_pat[num_tstyle].tpat_bytes[i]; } } /*/////////////////////////////////////////////////////////////////////////// */ /* Function returns FALSE if no match found; else TRUE and pBitMap filled in */ BOOL LoadSymbolEntry(SymBitMap* pBitMap, unsigned char* pslut, unsigned short symCode) { int i; int sym; unsigned short targetSym; struct sym_dat* pSymTab = (struct sym_dat*)pslut;; for (sym=0; sym<(int)m_drawparm.num_sym; sym++) { targetSym = GET_NRA_SHORT(&pSymTab->sym_code); if (targetSym == symCode) { /* Found sym, retrieve bitmap and return TRUE */ for (i=0; i<16; i++) { pBitMap->dotSym16[i] = GET_NRA_SHORT(&pSymTab->sym_pattern[i]); } return 1; } pSymTab++; } return 0; } /*/////////////////////////////////////////////////////////////////////////// */ /* Function returns NULL ptr if no match found */ struct asym_dat* SearchESymbolEntry(unsigned char* peslut, unsigned short eSymCode) { int eSym; unsigned short targetESym; struct asym_dat* pAsymDat = (struct asym_dat*)0; struct esym_dat* pESymTab = (struct esym_dat*)peslut; for (eSym=0; eSym<(int)m_drawparm.num_esym; eSym++) { targetESym = GET_NRA_SHORT(&pESymTab->esym_code); if (targetESym == eSymCode) { /* Found eSym, compute and return ptr to found eSym's record */ pAsymDat = (struct asym_dat*)(peslut + GET_NRA_SHORT(&pESymTab->esym_off)); break; } pESymTab++; } return pAsymDat; } /*/////////////////////////////////////////////////////////////////////////// */ BOOL getNextSym(GetSymControlBlock* pCB) { struct bsym_dat* p; if (pCB->control.aSymMax == 0) { /* beginning of a series, return the base symbol now */ p = (struct bsym_dat*)pCB->control.pASymNext; pCB->control.aSymMax = GET_NRA_UCHAR(&p->bsym_count); pCB->colorCode = GET_NRA_UCHAR(&p->bsym_color); pCB->symCode = GET_NRA_SHORT(&p->bsym_code); pCB->xOffset = 0; pCB->yOffset = 0; pCB->control.aSymNext = 1; pCB->control.pASymNext = (struct asym_dat*)(++p); } else { /* series already in progress, return the next additional symbol */ pCB->colorCode = GET_NRA_SHORT(&pCB->control.pASymNext->asym_data); pCB->symCode = GET_NRA_SHORT(&pCB->control.pASymNext->asym_code); pCB->xOffset = (unsigned int)(pCB->colorCode & 0xfc00) >> 10; pCB->yOffset = (unsigned int)(pCB->colorCode & 0x03f0) >> 4; if (pCB->xOffset > 0x20) pCB->xOffset = 0xffc0 | pCB->xOffset; if (pCB->yOffset > 0x20) pCB->yOffset = 0xffc0 | pCB->yOffset; pCB->colorCode = pCB->colorCode & 0x0f; pCB->control.aSymNext++; pCB->control.pASymNext++; } /* Now pick up the bitmap from the sym table */ if (LoadSymbolEntry(&pCB->symBits, m_drawparm.pslut, pCB->symCode)) { if (pCB->control.aSymNext < pCB->control.aSymMax) pCB->cmdStatus = GETSYM_MORE_SYM; /* good status and more sym */ else pCB->cmdStatus = GETSYM_OK; /* good status and no more sym */ return 1; } return 0; /* Sym code in expanded symbol not found in sym table */ } /*/////////////////////////////////////////////////////////////////////////// */ BOOL getFirstSym(GetSymControlBlock* pCB) { /* Look in the symbol table first. If not found, try esym table */ if (LoadSymbolEntry(&pCB->symBits, m_drawparm.pslut, pCB->symCode)) { pCB->cmdStatus = GETSYM_OK; return 1; } if (pCB->control.pASymNext = SearchESymbolEntry(m_drawparm.peslut, pCB->symCode)) { /* set up to retrieve base sym and each additional sym later */ pCB->control.aSymMax = 0; /* flag base symbol to be returned next */ return (getNextSym(pCB)); } pCB->cmdStatus = GETSYM_ERROR; /* symbol not found */ return 0; } struct pset_dat* findPset(unsigned char* ppsets, unsigned short numPsets, unsigned short level, unsigned short vs) { struct pset_dat* ppset = (struct pset_dat*)ppsets; unsigned char discriminator; int i; vs = vs - 'a' + 10; discriminator = ((unsigned char)level) << 4; discriminator |= (unsigned char) vs; for (i=0; i<(int)numPsets; i++) { if (ppset->pset_disc == discriminator) return ppset; ppset++; } return (struct pset_dat*)NULL; } int getColorPaletteNum(unsigned short level, unsigned short vs) { struct pset_dat* ppset; ppset = findPset(m_drawparm.ppset, m_drawparm.num_pset, level, vs); if (ppset) return (int)ppset->pset_cpalt; else return -1; /* Not Found */ } /*/////////////////////////////////////////////////////////////// // // Public Functions: // */ int getColorPalette(ColorPalette* pPal, unsigned short level, unsigned short vs) { int palNumber; /* palNumber depends on level, vs */ if ((palNumber = getColorPaletteNum(level, vs)) != -1) { LoadColEntry(pPal, m_drawparm.pclut, palNumber); return 1; } else return 0; } /*/////////////////////////////////////////////////////////////////////////// */ LineStyle getLineStyle(unsigned short level, unsigned short vs, unsigned short num_lstyle) { unsigned short palNumber = 0; if (num_lstyle < NRA_RESERVED_LINE_STYLES) return 0; /* palNumber depends on level, vs */ return LoadLineEntry(m_drawparm.pllut, palNumber, num_lstyle); } /*/////////////////////////////////////////////////////////////////////////// */ void getTextureStyle(TextureStyle* pTexture, unsigned short level, unsigned short vs, unsigned short style) { unsigned short palNumber = 0; /* palNumber depends on level, vs */ LoadTextureEntry(pTexture, m_drawparm.ptlut, palNumber, style); } /*/////////////////////////////////////////////////////////////////////////// */ /* Function returns FALSE on error condition; else it returns TRUE */ BOOL getSymFont(GetSymControlBlock* pCB) { switch(pCB->cmdStatus) { case GETSYM_GET_FIRST_SYM: return (getFirstSym(pCB)); case GETSYM_GET_NEXT_SYM: return (getNextSym(pCB)); default: pCB->cmdStatus = GETSYM_ERROR; return 0; } } /**************************************************************************/ /* */ /* U S E M E !!!! - I'm a handy envelope function to get symbols! */ /* */ /* This routine will read one regular symbol or one expanded symbol from */ /* the draw parameters file. 'code' is the symbol code to read. 'data' */ /* is an arry of 'max' size provided by caller. Each element in 'data' */ /* corresponds to a bit image (card) for symbol. Of course, only expanded*/ /* symbols will have more than one bit image. The function returns the */ /* number of elements in 'data' that were filled in. Return code of 0 */ /* means some sort of error happended. */ /* Historical note: This routine was extracted from mapLab and donated */ /* to the public domain to better humanity. The infamous 'labH' parameter*/ /* was removed (used to log errors). The caller should watch the return */ /* code and make their error messages. */ /* Callers, please use 'MAX_SYMBOL_LAYERS' when sizing your 'data'! */ /* */ /**************************************************************************/ int getSymbol(int code, labSymbol *data, int max) { int count, i; GetSymControlBlock symCB; unsigned char s[200]; count = 0; symCB.symCode = (unsigned short)code; symCB.cmdStatus = GETSYM_GET_FIRST_SYM; if (getSymFont(&symCB)) { if (symCB.cmdStatus != GETSYM_ERROR) { data[0].color = (int)symCB.colorCode; data[0].offx = 0; data[0].offy = 0; for (i = 0 ; i < 16 ; i++) data[0].bits[i] = symCB.symBits.dotSym16[i]; count++; while (symCB.cmdStatus == GETSYM_MORE_SYM) { symCB.cmdStatus = GETSYM_GET_NEXT_SYM; if (getSymFont(&symCB)) { if (count < max) { data[count].color = (int)symCB.colorCode; data[count].offx = symCB.xOffset; data[count].offy = symCB.yOffset; for (i = 0 ; i < 16 ; i++) data[count].bits[i] = symCB.symBits.dotSym16[i]; count++; } } else { /* labLogMsg(labH, "getSymFont() returned failure: get next symbol"); */ /* symCB.cmdStatus = GETSYM_ERROR; */ return(0); } } } else return(0); /* labLogMsg(labH, "getSymFont() returned with status GETSYM_ERROR"); */ } else { /* sprintf(s, "getSymFont() returned failure: status = %d", symCB.cmdStatus); labLogMsg(labH, s); */ return(0); } /* if (count == 0) { sprintf(s, "Symbol Code for above error is %04x", code); labLogMsg(labH, s); } */ return(count); } /**************************************************************************/ /* Calculate bounding box for visible portion of symbol. */ /* 'code' is a symbol or expanded symbol drawparm code. */ /* 'width' and 'height' are filled in. Return 0 for success. */ /* 'offx' and 'offy' give the offset for the center of this symbol's bbox */ /* relative to the lower left corner of the first card (i.e. the base */ /* point). Positive values mean center is above and/or to the right. */ /* Example: offx,offy == 0,0 means that symbol is centered over base pt. */ /* Since drawparm symbols are bitmaps, width and height are in terms of */ /* bits. These bits may or may not correspond to pixels when drawn on */ /* mapLab, NRA players, etc. Only the visible portion of the symbol is */ /* looked at. Blank cards and blank portions of cards are ignored. */ /* Fine print: Symbol doesn't have to be centered around base point for */ /* this routine to work. Assuming standard magnification (16 by 16) */ /* only. This routine not recommended for fonts, only pictures. */ /**************************************************************************/ int getSymbol_bbox(int code, int *width, int *height, int *offx, int *offy) { int sx, sy, llx, lly, urx, ury; labSymbol data[MAX_SYMBOL_LAYERS]; int rc, i; /* Get the "card" or "cards" for this symbol */ rc = getSymbol(code, data, MAX_SYMBOL_LAYERS); if (!rc) return(1); /* Let's draw our symbol on a classic Cartesian grid. sx, sy is */ /* our cursor which moves for each card and is the lower left */ /* corner. We'll start with the origin. */ sx = 0; sy = 0; /* Initialize icon's bbox */ llx = lly = 30000; urx = ury = -30000; /* Scan each "card" for visible bits */ for (i = 0 ; i < rc ; i++) { sx = sx + data[i].offx; sy = sy + data[i].offy; /* Look at this card. If there are visible bits, */ /* then update the icon's bbox. */ { int tx, ty; unsigned short row; int ii, ij; /* scan card row by row, starting at upper left corner */ tx = sx; ty = sy + 15; for (ii = 0 ; ii < 16 ; ii++) { row = data[i].bits[ii]; for (ij = 0 ; ij < 16 ; ij++) { if (row & 0x8000) { if (tx < llx) llx = tx; if (tx > urx) urx = tx; if (ty < lly) lly = ty; if (ty > ury) ury = ty; } tx++; row = row << 1; } tx = sx; ty--; } } } if (urx > -30000) { *width = urx - llx; *height = ury - lly; *offx = (urx + llx) / 2; *offy = (ury + lly) / 2; } else *width = *height = *offx = *offy = 0; return(0); } /**************************************************************************/ /* Custom line getter for the dxf reader routine. */ /**************************************************************************/ static unsigned char *fgets_custom(unsigned char *s, int n, FILE *fp) { int i; unsigned char c; i = 0; n--; while ((i < n) && (((char)c = getc(fp)) != EOF)) { if ((c < (unsigned char)0x0a) || (c > (unsigned char)0x7f)) continue; if ((c == '\r') || (c == '\n')) n = -1; else s[i++] = c; } s[i] = 0; if (((char)c == EOF) && (i == 0)) return(NULL); else return(s); } /**************************************************************************/ /* dxf reader routine for the getVectorIcon routine. */ /* Grabs lines and polylines, placing them into 'data', no more than 'max'*/ /* 'name' is the filename and 'layer' is name of the layer to get. Other */ /* layers are ignored. */ /**************************************************************************/ static int readDXF(char *fn, char *layer, IconVector *data, int max) { #define SKIP 1 #define LINE 2 #define POLYLINE 3 #define DONE 4 FILE *fp; unsigned char sc[100], sd[100]; int i, state, count, code; /* 'count' overruns 'max' sometimes. Do this until proper fix. */ max = max - 4; fp = fopen(fn, "r"); if (!fp) return(0); state = SKIP; count = 0; while (state != DONE) { if (!fgets_custom(sc, 100, fp)) return(0); if (!fgets_custom(sd, 100, fp)) return(0); code = atoi(sc); if ((state == SKIP) && (code != 0)) continue; switch (code) { case 0: if (!strcmp(sd, "EOF")) { state = DONE; } else if (!strcmp(sd, "LINE")) { state = LINE; } else if (!strcmp(sd, "POLYLINE")) { state = POLYLINE; } else if (!strcmp(sd, "VERTEX")) { if ((state != SKIP) && (count >= max)) { data[count-1].end = (unsigned char)1; state = DONE; } } else if (!strcmp(sd, "SEQEND")) { if (state != SKIP) { data[count-1].end = (unsigned char)1; state = SKIP; } } break; case 8: if (strcmp(sd, layer)) state = SKIP; break; case 10: data[count].x = atof(sd); break; case 20: data[count].y = atof(sd); data[count++].end = (unsigned char)0; break; case 11: if (state != LINE) break; data[count].x = atof(sd); break; case 21: if (state != LINE) break; data[count].y = atof(sd); data[count++].end = (unsigned char)1; state = SKIP; break; } } fclose(fp); return(count); } /*************************************************************/ /* Vector Icon Cache Code Follows */ /* Least Recently Used (LRU) method */ /*************************************************************/ #define VICON_CACHE_SIZE 7 /* Number of icons that can be cached */ typedef struct { char fn[MAX_FILENAME]; /* filename of cached icon */ char layer[MAX_ASSOC_STR]; /* layer name of cached icon */ long age; /* -1: not used >=0: age, 0 is youngest */ IconVector *data; /* data of cached icon */ int size; /* point count of data */ } ViconCacheType; static int ViconCacheInitialized = 0; /* Boolean to insure proper initialization */ static ViconCacheType ViconCache[VICON_CACHE_SIZE]; /* The icon cache */ static void InitViconCache(void) { int i; if (ViconCacheInitialized) return; for (i = 0 ; i < VICON_CACHE_SIZE ; i++) ViconCache[i].age = -1; ViconCacheInitialized = 1; } static void FreeViconCache(void) { int i; if (!ViconCacheInitialized) return; for (i = 0 ; i < VICON_CACHE_SIZE ; i++) if (ViconCache[i].age >= 0) free(ViconCache[i].data); ViconCacheInitialized = 0; } static int readViconCache(char *fn, char *layer, IconVector *data, int max) { int i, j, n; for (i = 0 ; i < VICON_CACHE_SIZE ; i++) if ((ViconCache[i].age >= 0) && (ViconCache[i].age < 30000)) ViconCache[i].age++; for (i = 0 ; i < VICON_CACHE_SIZE ; i++) if (ViconCache[i].age >= 0) if (!strcmp(fn, ViconCache[i].fn) && !strcmp(layer, ViconCache[i].layer)) break; if (i == VICON_CACHE_SIZE) return(0); ViconCache[i].age = 0; n = ViconCache[i].size; if (n > max) n = max; for (j = 0 ; j < n ; j++) data[j] = ViconCache[i].data[j]; return(n); } static void writeViconCache(char *fn, char *layer, IconVector *data, int count) { int i, j, old; for (i = 0 ; i < VICON_CACHE_SIZE ; i++) if (ViconCache[i].age < 0) break; if (i < VICON_CACHE_SIZE) { ViconCache[i].data = (IconVector *)malloc(sizeof(IconVector) * MAX_VECTOR_ICON_PTS); if (!ViconCache[i].data) return; } else { old = -1; for (j = 0 ; j < VICON_CACHE_SIZE ; j++) if (ViconCache[j].age > old) { i = j; old = ViconCache[j].age; } } strncpy(ViconCache[i].fn, fn, MAX_FILENAME); strncpy(ViconCache[i].layer, layer, MAX_ASSOC_STR); ViconCache[i].age = 0; if (count > MAX_VECTOR_ICON_PTS) count = MAX_VECTOR_ICON_PTS; for (j = 0 ; j < count ; j++) ViconCache[i].data[j] = data[j]; ViconCache[i].size = count; } /*************************************************************/ /* End of Cache Code */ /*************************************************************/ /**************************************************************************/ /* Get a vector icon from file. 'name' is the filename of the dxf file. */ /* 'layer' is the name of the layer to retrieve data for. Data for other */ /* layers will be ignored. There is supposed to be one vector icon per */ /* layer, enabling multiple icons to exist in one dxf file. On input, */ /* the first two elements in 'data' (lower left and upper right) specify */ /* the destination bbox to fit (scale and translate) the vector icon */ /* points into. On output, the points are placed in 'data'. 'max' is */ /* the maximum number of points to place in 'data'. The number of points */ /* retrieved is returned or zero if there is an error. Callers please */ /* use MAX_VECTOR_ICON_PTS to dimension your arrays with. */ /**************************************************************************/ int getVectorIcon(char *name, char *layer, IconVector *data, int max) { IconVector llDest, urDest; IconVector llSrc, urSrc; int count, i; IconVector ratio; /* Save destination bbox where source pts will be translated and scaled into */ llDest = data[0]; urDest = data[1]; if (1) /* Use Vector Icon Cache */ { InitViconCache(); /* (in case drawparm module wasn't initialized) */ count = readViconCache(name, layer, data, max); if (!count) { count = readDXF(name, layer, data, max); if (!count) return(0); writeViconCache(name, layer, data, count); } } else { count = readDXF(name, layer, data, max); if (!count) return(0); } /* Determine bbox for source points */ llSrc.x = llSrc.y = 10e20; urSrc.x = urSrc.y = 10e-20; for (i = 0 ; i < count ; i++) { if (data[i].x < llSrc.x) llSrc.x = data[i].x; if (data[i].x > urSrc.x) urSrc.x = data[i].x; if (data[i].y < llSrc.y) llSrc.y = data[i].y; if (data[i].y > urSrc.y) urSrc.y = data[i].y; } /* Get scaling factor, but don't divide by zero. */ if ((urSrc.x - llSrc.x == 0.0) || (urSrc.y - llSrc.y == 0.0)) { ratio.x = 0.0; ratio.y = 0.0; } else { ratio.x = (urDest.x - llDest.x) / (urSrc.x - llSrc.x); ratio.y = (urDest.y - llDest.y) / (urSrc.y - llSrc.y); } /* Scale, translate each point from source bbox to dest bbox */ for (i = 0 ; i < count ; i++) { data[i].x = (data[i].x - llSrc.x) * ratio.x + llDest.x; data[i].y = (data[i].y - llSrc.y) * ratio.y + llDest.y; } return(count); } /*/////////////////////////////////////////////////////////////////////////// */ void DumpSymBitMap(GetSymControlBlock* pCB) { int i; printf("Color = %x, Xoff = %x, yOff = %x\n",pCB->colorCode,pCB->xOffset,pCB->yOffset); for (i=0; i<16; i++) { printf("%04x\n", pCB->symBits.dotSym16[i]); } } #if 0 int main() { unsigned short styleNum; unsigned short style; ColorPalette Pal; TextureStyle tStyle; int i; GetSymControlBlock symCB; if (DprmDoc("fl_ga") == 0) { printf("Something's wrong with the drawparm file paris.dpm\n"); return 1; } /* check out line styles */ for (styleNum=0; styleNum<16; styleNum++) { style = getLineStyle(0, 'c', styleNum); printf("\nStyle = %04X\n", style); } /* check out color palettes */ getColorPalette(&Pal, 0, 'c'); printf("\nRED GREEN BLUE\n"); for (i=0; i<16;i++) { printf("%02x %02x %02x\n", Pal.rgb888[i].red, Pal.rgb888[i].green, Pal.rgb888[i].blue); } /* check out texture styles */ for (styleNum=0; styleNum<16; styleNum++) { printf("\n Style # %d\n", styleNum); getTextureStyle(&tStyle, 0, 'c', styleNum); for (i=0; i<8;i++) { printf("%02x ", tStyle.dotMap8[i]); } } /* check out symbols */ /* Hardcoding for testing. I know the first sym is this! */ for (symCB.symCode = 0xf048; symCB.symCode<0xf04b; symCB.symCode++) { printf("\n Symbol %04x\n", symCB.symCode); symCB.cmdStatus = GETSYM_GET_FIRST_SYM; if (getSymFont(&symCB)) { printf("*** SUCCESS ... status = %d***\n", symCB.cmdStatus); if (symCB.cmdStatus == GETSYM_OK) { for (i=0; i<16;i++) { printf("%04x\n", symCB.symBits.dotSym16[i]); } } } else printf("*** FAIL ... status = %d***\n", symCB.cmdStatus); } /* check out Expanded symbols */ /* Hardcoding for testing. I know the first sym is this! */ for (symCB.symCode = 0xf249; symCB.symCode<0xf24c; symCB.symCode++) { printf("\n Symbol %04x\n", symCB.symCode); symCB.cmdStatus = GETSYM_GET_FIRST_SYM; if (getSymFont(&symCB)) { printf("*** SUCCESS ... status = %d***\n", symCB.cmdStatus); if (symCB.cmdStatus == GETSYM_ERROR) continue; /* probably sym not found, do next eSym */ /* display the bitmap of base sym */ DumpSymBitMap(&symCB); /* if status == GETSYM_OK, meaning 1 sym only, continue with next eSym */ /* Otherwise, loop until status != GETSYM_MORE_SYM */ while (symCB.cmdStatus == GETSYM_MORE_SYM) { symCB.cmdStatus = GETSYM_GET_NEXT_SYM; if (getSymFont(&symCB)) { DumpSymBitMap(&symCB); } else { printf("*** ERROR getting Additional Sym ***\n"); break; } } } else printf("*** FAIL ... status = %d***\n", symCB.cmdStatus); } return 0; } main (int argc, char **argv) { char string[1000]; Tcl_Interp *interp; int code, foo_width, foo_height, foo_index; labSymbol data[MAX_SYMBOL_LAYERS]; static char foo_bits[1000]; int i,j, rc; unsigned short styleNum; unsigned short style; ColorPalette Pal; TextureStyle tStyle; GetSymControlBlock symCB; unsigned short row, mask, maskleft, one; if (argc < 2) { printf("must give icon number on command line\n"); exit(1); } sscanf(argv[1],"%x",&code); if (DprmDoc("fl-ga") == 0) { printf("Something's wrong with the drawparm file fl-ga.dpm\n"); return 1; } /* Get the "card" or "cards" for this symbol */ rc = getSymbol(code, data, MAX_SYMBOL_LAYERS); if (!rc) { printf("getSymbol failed\n"); return(1); } /* load into a static bitmap */ memset(foo_bits,0,1000); foo_index = 0; for (i=0; i<16; i++) { /* swap bits */ row = 0; one = 1; maskleft = 1; for (j=0;j<16;j++) { /* get bit j */ mask = one << 15-j; if (data->bits[i] & mask) row |= maskleft; maskleft = maskleft << 1; } foo_bits[foo_index++] = row; row = row >> 8; foo_bits[foo_index++] = row; printf("--%x\n",row); } /* define */ foo_height = 16; foo_width = 16; interp = Tcl_CreateInterp(); mainWindow = Tk_CreateMainWindow(interp, 0, "dpex", "Tk"); if (mainWindow == NULL) { printf("Failed window creation.\n"); fprintf(stderr, "%s\n", interp->result); exit(1); } Tk_GeometryRequest(mainWindow, 200, 200); Tk_DefineBitmap(interp,Tk_GetUid("foo"), foo_bits, foo_width, foo_height); strcpy(string,"canvas .c -background white"); rc = Tcl_Eval(interp, string); if (rc == TCL_ERROR) printf("Exiting unsuccessfully\n"); if (rc == TCL_OK) printf("Exiting successfully\n"); strcpy(string,"pack .c"); rc = Tcl_Eval(interp, string); if (rc == TCL_ERROR) printf("Exiting unsuccessfully\n"); if (rc == TCL_OK) printf("Exiting successfully\n"); strcpy(string,".c create bitmap 30 30 -bitmap foo"); rc = Tcl_Eval(interp, string); if (rc == TCL_ERROR) printf("Exiting unsuccessfully\n"); if (rc == TCL_OK) printf("Exiting successfully\n"); Tk_MainLoop(); } /* Draw a symbol or one card of an expanded symbol. The input coordinate */ /* is the lower left corner. */ /**************************************************************************/ static void labDrawSymbolBits(labSymbol *data, int mag, int x, int y, Display *dpy, Window xwin, GC gc) { int tx, ty, numpts; XPoint pts[512]; unsigned short row; int i, j, use; tx = x; ty = y - (labCharDim(mag, FALSE, FALSE) - 1); numpts = 0; for (i = 0 ; i < 16 ; i++) if ((mag != 0) || !(i % 2)) { row = data->bits[i]; for (j = 0 ; j < 16 ; j++) { use = (mag > 1) || !(j % 2); if (use && (row & 0x8000)) { pts[numpts].x = tx; pts[numpts++].y = ty; if (mag == 3) { pts[numpts].x = tx+1; pts[numpts++].y = ty; } } if (use) tx++; if (mag == 3) tx++; row = row << 1; } tx = x; ty++; } XDrawPoints(dpy, xwin, gc, pts, numpts, CoordModeOrigin); } #endif static void repDrawSymbolBits(labSymbol *data, int x, int y, Display *dpy, Window xwin, GC gc) { int tx, ty, numpts; XPoint pts[512]; unsigned short row; int i, j, use; tx = x; ty = y; numpts = 0; for (i = 0 ; i < 16 ; i++) if (!(i % 2)) { row = data->bits[i]; for (j = 0 ; j < 16 ; j++) { use = !(j % 2); if (use && (row & 0x8000)) { pts[numpts].x = tx; pts[numpts++].y = ty; } if (use) tx++; row = row << 1; } tx = x; ty++; } XDrawPoints(dpy, xwin, gc, pts, numpts, CoordModeOrigin); } int change_background(picture_num) { unsigned char string[300]; int background,rc; background = back_map[picture_num]; #ifdef OD_DEBUG printf("Current background picture num is %d\n",picture_num); #endif if (current_background != -1 && current_background != background) { strcpy(string,".c delete pixback"); rc = Tcl_Eval(rep_interp, string); if (rc == TCL_ERROR) { printf("Could not delete background bitmap.\n"); printf("%s\n",rep_interp->result); exit(1); } } if (current_background != background) { int index; index = load_picture(picture_num); if (index == -1) return; sprintf(string,"set bitmap_id [.c create bitmap 0 0 -bitmap @%s -anchor nw -tag pixback]",pict_names[index]); rc = Tcl_Eval(rep_interp, string); if (rc == TCL_ERROR) { sprintf(err_str[0],"Could not create background bitmap."); sprintf(err_str[1],"%s",string); sprintf(err_str[2],"%s",rep_interp->result); sprintf(err_str[3],""); rep_error(HIF); return 1; } sprintf(string,".c raise cardSegment $bitmap_id"); rc = Tcl_Eval(rep_interp, string); if (rc == TCL_ERROR) { sprintf(err_str[0],"Could not create background bitmap."); sprintf(err_str[1],"%s",string); sprintf(err_str[2],"%s",rep_interp->result); sprintf(err_str[3],""); rep_error(HIF); return 1; } } } int store_od( CMD_ODS **od_list, int cmd_name, unsigned char *numeric_args, unsigned char *string_arg ) { CMD_ODS *this_od, *next_od; if (*od_list == (CMD_ODS *) NULL) /* First Cmd to Store */ { if ( (*od_list = (CMD_ODS *) malloc(sizeof(CMD_ODS))) == NULL ) { sprintf(err_str[0],"Could not allocate memory for cmd_od\n"); sprintf(err_str[1],""); sprintf(err_str[2],""); sprintf(err_str[3],""); rep_error(HIF); return 1; } (**od_list).nra_od = cmd_name; if (numeric_args) { (**od_list).numeric_args = (unsigned char *) malloc(strlen(numeric_args) + 1); strcpy((**od_list).numeric_args, numeric_args); } else { (**od_list).numeric_args = NULL; } if (string_arg) { (**od_list).string_arg = (unsigned char *) malloc(strlen(string_arg) + 1); strcpy((**od_list).string_arg, string_arg); } else { (**od_list).string_arg = NULL; } (**od_list).next_od = (CMD_ODS *) NULL; return 0; } this_od = *od_list; while (this_od->next_od != (CMD_ODS *) NULL) { this_od = this_od->next_od; } if ( (next_od = (CMD_ODS *) malloc(sizeof(CMD_ODS))) == NULL ) { sprintf(err_str[0],"Could not allocate memory for cmd_od\n"); sprintf(err_str[1],""); sprintf(err_str[2],""); sprintf(err_str[3],""); rep_error(HIF); return 1; } next_od->nra_od = cmd_name; if (numeric_args) { next_od->numeric_args = (unsigned char *) malloc(strlen(numeric_args) + 1); strcpy(next_od->numeric_args, numeric_args); } else { next_od->numeric_args = NULL; } if (string_arg) { next_od->string_arg = (unsigned char *) malloc(strlen(string_arg) + 1); strcpy(next_od->string_arg, string_arg); } else { next_od->string_arg = NULL; } next_od->next_od = (CMD_ODS *) NULL; this_od->next_od = next_od; return 0; } /* end store_od () */ int simulate_od( CMD_ODS *these_ods, unsigned int *status_var ) { int arg1, arg2, arg3, arg4, rc; int i; unsigned int time; char string[256], *source_str, *dest_str, *temp_str1, *source_str1; unsigned char *tstring; /* struct idx_info cur_info;*/ unsigned short fnt, pfnt; while( these_ods != (CMD_ODS *) NULL ) { switch (these_ods->nra_od) { case CMD_QUEUE_SIGNAL : # ifdef OD_DEBUG printf("Serving CMD_QUEUE_SIGNAL\n"); printf("Numeric args are %s\n",these_ods->numeric_args); # endif sscanf(these_ods->numeric_args, "%d", &arg1); switch(arg1) { case STACK_OD: sscanf(these_ods->numeric_args, "%d %d", &arg1, &arg2); # ifdef OD_DEBUG printf("Serving CMD_QUEUE_SIGNAL: to stack od.\n"); # endif break; case CARD_OD: sscanf(these_ods->numeric_args, "%d %d", &arg1, &arg2); /* Send signal to card OD */ process_sig(arg2,c_traps,&c_status_var); break; case FIELD_OD: sscanf(these_ods->numeric_args, "%d %d %d", &arg1, &arg2, &arg3); /* Send signal to field ODs */ process_sig(arg3,cf_traps[arg2],&hif_fields[arg2].status_var); break; case BUTTON_OD: sscanf(these_ods->numeric_args, "%d %d %d", &arg1, &arg2, &arg3); /* Send signal to button ODs */ process_sig(arg3,cb_traps[arg2],&hif_buttons[arg2].status_var); break; } break; break; case CMD_DELETE_CARD : # ifdef OD_DEBUG printf("Serving CMD_DELETE_CARD\n"); # endif break; case CMD_OPEN_OBJECT : # ifdef OD_DEBUG printf("Serving CMD_OPEN_OBJECT\n"); # endif break; case CMD_CD_PLAYER : # ifdef OD_DEBUG printf("Serving CMD_CD_PLAYER\n"); # endif break; case CMD_PUY_CMMD_TO_CDP : # ifdef OD_DEBUG printf("Serving CMD_PUY_CMMD_TO_CDP\n"); # endif break; case CMD_WAIT_FOR_SIGNAL : arg1 = atoi(these_ods->numeric_args); # ifdef OD_DEBUG printf("Serving CMD_WAIT_FOR_SIGNAL\n"); printf("Number of ticks = %d\n",arg1); # endif for (i=0; i < arg1; i++) { time = 0; while(time++ < TIME_TICKS); } break; case CMD_BEEP : # ifdef OD_DEBUG printf("Serving CMD_BEEP\n"); # endif break; case CMD_CHANGE_COLOR : # ifdef OD_DEBUG printf("Serving CMD_CHANGE_COLOR\n"); printf("New pallet number is %d\n",atoi(these_ods->numeric_args)); # endif set_pal(atoi(these_ods->numeric_args)); break; case CMD_CLOSE_SFILE : # ifdef OD_DEBUG printf("Serving CMD_CLOSE_SFILE\n"); # endif break; case CMD_OPEN_SFILE : # ifdef OD_DEBUG printf("Serving CMD_OPEN_SFILE\n"); # endif change_background(atoi(these_ods->numeric_args)); UPDATE_DISPLAY break; case CMD_OPEN_MAP : # ifdef OD_DEBUG printf("Serving CMD_OPEN_MAP\n"); # endif break; case CMD_STRCPY : # ifdef OD_DEBUG printf("Serving CMD_STRCPY\n"); # endif if ( !these_ods->string_arg ) { /* source is a character field */ sscanf(these_ods->numeric_args, "%d %d %d",&arg1,&arg2,&arg3); source_str = hif_fields[arg3].content; } else { /* source is given as a string */ sscanf(these_ods->numeric_args, "%d %d", &arg1, &arg2); source_str = these_ods->string_arg; } switch( ((unsigned)(arg1 & 0xf0)) >> 4) { case 0: /* replaced old content */ if (hif_fields[arg2].content) { free(hif_fields[arg2].content); } # ifdef OD_DEBUG printf("card_field: %d source_str is 1>%s<\n",arg2,source_str); # endif if (source_str) { hif_fields[arg2].content = (char *) calloc(strlen(source_str) + 1,1); strcpy(hif_fields[arg2].content, source_str); } else { hif_fields[arg2].content = ""; } break; case 1: /* append string to end of old content */ if (hif_fields[arg2].content) { /* field has stuff in it already */ # ifdef OD_DEBUG printf("debug strcpy 1\n"); # endif if(!source_str) source_str=""; temp_str1= (unsigned char *) calloc(strlen(source_str) + strlen(hif_fields[arg2].content) + 1, 1); strcpy(temp_str1, hif_fields[arg2].content); strcat(temp_str1, source_str); # ifdef OD_DEBUG printf("card_field: %d source_str is 2>%s<\n",arg2,source_str); printf("original str is >%s<\n",hif_fields[arg2].content); printf("new str is >%s<\n",temp_str1); # endif free(hif_fields[arg2].content); } else { /* field is empty */ if (source_str) { temp_str1 = (unsigned char *) calloc(strlen(source_str) + 1, 1); strcpy(temp_str1, source_str); } else { temp_str1= ""; } # ifdef OD_DEBUG printf("card_field: %d source_str is 3>%s<\n",arg2,source_str); printf("original str is empty\n"); printf("new str is >%s<\n",temp_str1); # endif } hif_fields[arg2].content = temp_str1; break; case 2: /* prepend string to front of old content */ if (hif_fields[arg2].content) { /* field has stuff in it already */ if(!source_str) source_str=""; temp_str1 = (char *) calloc(strlen(source_str) + strlen(hif_fields[arg2].content) + 1, 1); strcpy(temp_str1, source_str); strcat(temp_str1, hif_fields[arg2].content); # ifdef OD_DEBUG printf("card_field: %d source_str is 4>%s<\n",arg2,source_str); printf("original str is >%s<\n",hif_fields[arg2].content); printf("new str is >%s<\n",temp_str1); # endif free(hif_fields[arg2].content); } else { /* field is empty */ if (source_str) { temp_str1 = (unsigned char *) calloc(strlen(source_str) + 1, 1); strcpy(temp_str1, source_str); } else { temp_str1= ""; } # ifdef OD_DEBUG printf("card_field: %d source_str is >%s<\n",arg2,source_str); printf("original str is empty\n"); printf("new str is >%s<\n",temp_str1); # endif } hif_fields[arg2].content = temp_str1; break; default: printf("Unknown CMD_STRCPY mode: %d.\n",arg1); return 1; break; } if ( hif_fields[arg2].isdrawn && (hif_fields[arg2].content[0] != '^') ) { /* Delete the graphical objects associated with this field, for strings only */ sprintf(string,".c delete cftag%d",arg2); rc = Tcl_Eval(rep_interp, string); #ifdef OD_DEBUG printf("tcl string is **%s**\n",string); #endif if (rc == TCL_ERROR) { sprintf(err_str[0],"Deleting card field objects returns unsuccessfully."); sprintf(err_str[1],"%s",rep_interp->result); sprintf(err_str[2],""); rep_error(HIF); return 1; } } if ( hif_fields[arg2].visible ) { /* Only draw string if the card_field is visible */ if ( draw_string_or_symbol(hif_fields[arg2].content, arg2) ) { printf("Problem simulating CMD_STRCPY\n"); return 1; } UPDATE_DISPLAY } break; case CMD_SET_STATUS_VAR : # ifdef OD_DEBUG printf("Serving CMD_SET_STATUS_VAR\n"); # endif sscanf(these_ods->numeric_args, "%d %d", &arg1, &arg2); switch(arg1) { case 1: *status_var = arg2; break; case 2: *status_var += arg2; break; case 3: *status_var -= arg2; break; default: printf("Unrecognized mode %d for CMD_SET_STATUS_VAR. Must be 1, 2 or 3.\n",arg1); exit(1); } break; case CMD_SEND_SIGNAL : # ifdef OD_DEBUG printf("Serving CMD_SEND_SIGNAL\n"); # endif sscanf(these_ods->numeric_args, "%d", &arg1); switch(arg1) { case STACK_OD: sscanf(these_ods->numeric_args, "%d %d", &arg1, &arg2); # ifdef OD_DEBUG printf("Serving CMD_SEND_SIGNAL: to stack od.\n"); # endif break; case CARD_OD: sscanf(these_ods->numeric_args, "%d %d", &arg1, &arg2); /* Send signal to card OD */ process_sig(arg2,c_traps,&c_status_var); break; case FIELD_OD: sscanf(these_ods->numeric_args, "%d %d %d", &arg1, &arg2, &arg3); /* Send signal to field ODs */ process_sig(arg3,cf_traps[arg2],&hif_fields[arg2].status_var); break; case BUTTON_OD: sscanf(these_ods->numeric_args, "%d %d %d", &arg1, &arg2, &arg3); /* Send signal to button ODs */ process_sig(arg3,cb_traps[arg2],&hif_buttons[arg2].status_var); break; } break; case CMD_HIDE_FIELD : # ifdef OD_DEBUG printf("Serving CMD_HIDE_FIELD\n"); # endif sscanf(these_ods->numeric_args, "%d %d", &arg1, &arg2); for(i=0; i < arg2; i++) { if ( hif_fields[arg1+i].isdrawn ) { /* Delete the bitmap */ sprintf(string,".c delete cftag%d",arg1+i); rc = Tcl_Eval(rep_interp, string); #ifdef OD_DEBUG printf("tcl string is **%s**\n",string); #endif if (rc == TCL_ERROR) { sprintf(err_str[0],"Deleting card field objects returns unsuccessfully."); sprintf(err_str[1],"%s",rep_interp->result); sprintf(err_str[2],""); rep_error(HIF); return 1; } } } UPDATE_DISPLAY break; case CMD_SHOW_FIELD : # ifdef OD_DEBUG printf("Serving CMD_SHOW_FIELD\n"); # endif break; case CMD_SEARCH_INDEX : # ifdef OD_DEBUG printf("Serving CMD_SEARCH_INDEX\n"); # endif sscanf(these_ods->numeric_args, "%d %d %d %d", &arg1, &arg2, &arg3, &arg4); # ifdef OD_DEBUG printf("arg1 : %d, arg2 : %d, arg3 : %d, arg4 : %d\n", arg1, arg2, arg3, arg4); # endif if (source_str1) free(source_str1); source_str1 = hif_fields[arg4].content; # ifdef OD_DEBUG printf("source_str1 : ^%s^\n", source_str1); # endif cur_info.tnum = arg1; dest_str = start_search(arg1, arg2, source_str1, &cur_info,SEARCH_IDX); # ifdef OD_DEBUG printf("dest_str : %s\n", dest_str); # endif if (hif_fields[arg3].content) free(hif_fields[arg3].content); hif_fields[arg3].content = (char *) calloc(strlen(dest_str) + 1, 1); strcpy(hif_fields[arg3].content, dest_str); if (dest_str) free (dest_str); break; case CMD_GOTO_RECORD : # ifdef OD_DEBUG printf("Serving CMD_GOTO_RECORD\n"); # endif sscanf(these_ods->numeric_args, "%d %d %d",&arg1,&arg2,&arg3); # ifdef OD_DEBUG printf("arg1 : %d, arg2 : %d, arg3 : %d\n", arg1, arg2, arg3); printf("debug hif_y.y cur_info.tnum:%d\n",cur_info.tnum); # endif dest_str = start_search(arg1, arg2, source_str1, &cur_info,NEXT_REC); # ifdef OD_DEBUG printf("length of dest_str:%d\n", strlen(dest_str)); printf("dest_str : \n"); # endif tstring=(unsigned char *)calloc(256,1); if (tstring == NULL){ perror("calloc"); exit(0); } strUnfont(dest_str, tstring, strlen(dest_str), &pfnt); if(dest_str) free(dest_str); # ifdef OD_DEBUG printf("tstring:^%s^\n",tstring); # endif if (hif_fields[arg3].content) free(hif_fields[arg3].content); hif_fields[arg3].content = (char *) calloc(strlen(tstring) + 1, 1); strcpy(hif_fields[arg3].content, tstring); if (tstring) free (tstring); # ifdef OD_DEBUG printf("hif_fields[arg3].content:%s\n",hif_fields[arg3].content); # endif if ( hif_fields[arg3].visible ) { if ( hif_fields[arg3].isdrawn ) { sprintf(string,".c delete cftag%d",arg3); rc = Tcl_Eval(rep_interp, string); #ifdef OD_DEBUG printf("tcl string is **%s**\n",string); #endif if (rc == TCL_ERROR) { sprintf(err_str[0],"Deleting card field objects returns unsuccessfully."); sprintf(err_str[1],"%s",rep_interp->result); sprintf(err_str[2],""); rep_error(HIF); return 1; } } if ( draw_string_or_symbol(hif_fields[arg3].content, arg3) ) { printf("Problem simulating CMD_STRCPY\n"); return 1; } UPDATE_DISPLAY } break; case CMD_REWRITE_FIELD : sscanf(these_ods->numeric_args, "%d", &arg1); sscanf(these_ods->string_arg, "%x", &arg2); # ifdef OD_DEBUG printf("Serving CMD_REWRITE_FIELD\n"); printf("Numeric_args = %s\n",these_ods->numeric_args); printf("String_args = %s\n",these_ods->string_arg); printf("arg1 = %d arg2 = %x\n",arg1, arg2); # endif hif_fields[arg1].text_color = ( (arg2 & 0xf000) >> 12 ) + 1; hif_fields[arg1].pen_fore = ( (arg2 & 0x0f00) >> 8 ) + 1; hif_fields[arg1].fill_back = ( (arg2 & 0x00f0) >> 4 ) + 1; hif_fields[arg1].fill_fore = (arg2 & 0x000f) + 1; if ( hif_fields[arg1].visible && hif_fields[arg1].content ) { /* Only draw string if the card_field is visible */ if ( draw_string_or_symbol(hif_fields[arg1].content, arg1) ) { printf("Problem simulating CMD_STRCPY\n"); return 1; } UPDATE_DISPLAY } break; case CMD_REDRAW_SEGMENT : sscanf(these_ods->numeric_args, "%d 0x%x", &arg1, &arg2); # ifdef OD_DEBUG printf("Serving CMD_REDRAW_SEGMENT\n"); printf("Numeric_args = %s\n",these_ods->numeric_args); printf("arg1 = %d arg2 = %x\n",arg1, arg2); # endif if ( redraw_segment(arg1, arg2) ) { fprintf(stderr, "Could not complete redraw_segment\n"); return 1; } UPDATE_DISPLAY break; case CMD_POP_CARD : # ifdef OD_DEBUG printf("Serving CMD_POP_CARD\n"); # endif break; case CMD_PUSH_CARD : # ifdef OD_DEBUG printf("Serving CMD_PUSH_CARD\n"); # endif break; case CMD_EXIT : # ifdef OD_DEBUG printf("Serving CMD_EXIT\n"); # endif break; case CMD_EXIT_IIS : # ifdef OD_DEBUG printf("Serving CMD_EXIT_IIS\n"); # endif break; case CMD_GO_TO_CARD_REL : dispatch_signal(CANVAS_BUTTON, CLOSE_CARD_SIG); changed_stack = 0; starting_stack = current_stack; starting_card = current_card + atoi(these_ods->numeric_args); Update_request = 1; # ifdef OD_DEBUG printf("Serving CMD_GO_TO_CARD_REL\n"); printf("starting_stack = %d starting_card = %d.\n",starting_stack, starting_card); # endif break; case CMD_GO_TO_CARD : dispatch_signal(CANVAS_BUTTON, CLOSE_CARD_SIG); dispatch_signal(CANVAS_BUTTON, CLOSE_CS_SIG); sscanf(these_ods->numeric_args, "%d %d", &arg1, &arg2); if (arg1 != current_stack) { changed_stack = 1; } else { changed_stack = 0; } starting_stack = arg1; starting_card = arg2; Update_request = 1; # ifdef OD_DEBUG printf("Serving CMD_GO_TO_CARD\n"); printf("starting_stack = %d starting_card = %d.\n",starting_stack, starting_card); # endif break; default : printf("Unknown OD type\n"); return 1; } /* end switch() */ these_ods = these_ods->next_od; } /* end while() */ return 0; } /* end simulate_od */ int create_buttons ( void ) { unsigned char string[(MAX_NUM_POINTS*8) + 300]; unsigned char *button_color, *button_outline, *button_pattern; int rc; int button_num, field_num; #ifdef OD_DEBUG printf("reached create_buttons\n"); #endif if (Highlight_request) { button_color = (unsigned char *) " HotPink "; button_outline = (unsigned char *) " MidnightBlue "; button_pattern = (unsigned char *) " texture6 "; } else { button_color = (unsigned char *) " {} "; button_outline = (unsigned char *) " {} "; button_pattern = (unsigned char *) " {} "; } for ( field_num = 0; field_num < MAX_NUM_FIELDS; field_num++) { if (!hif_fields[field_num].OD) { continue; } sprintf(string,".c bind [.c create rectangle %d %d %d %d -fill %s -outline %s -stipple %s -tag card_field] { \ set Button_down 1 \n\ set Button_number %d }", hif_fields[field_num].x1 + NSRA_X, hif_fields[field_num].y1 + NSRA_Y, hif_fields[field_num].x2 + NSRA_X, hif_fields[field_num].y2 + NSRA_Y, button_color, button_outline, button_pattern, hif_fields[field_num].OD); #ifdef OD_DEBUG printf("tcl string is **%s**\n",string); #endif rc = Tcl_Eval(rep_interp, string); if (rc == TCL_ERROR) { sprintf(err_str[0],"card field rectangle creation returns unsuccessfully."); sprintf(err_str[1],"%s",rep_interp->result); sprintf(err_str[2],""); rep_error(HIF); return 1; } } for ( button_num = 0; button_num < MAX_NUM_BUTTONS; button_num++) { if (!hif_buttons[button_num].OD) { continue; } switch (hif_buttons[button_num].button_type) { case RECTANGLE_BUTTON : sprintf(string,".c bind [.c create rectangle %d %d %d %d -fill %s -outline %s -stipple %s -tag card_button] { \ set Button_down 1 \n\ set Button_number %d }", hif_buttons[button_num].x1, hif_buttons[button_num].y1, hif_buttons[button_num].x2, hif_buttons[button_num].y2, button_color, button_outline, button_pattern, hif_buttons[button_num].OD); #ifdef OD_DEBUG printf("tcl string is **%s**\n",string); #endif rc = Tcl_Eval(rep_interp, string); if (rc == TCL_ERROR) { sprintf(err_str[0],"Button rectangle creation returns unsuccessfully."); sprintf(err_str[1],"%s",rep_interp->result); sprintf(err_str[2],""); rep_error(HIF); return 1; } break; case POLYGON_BUTTON : sprintf(string,".c bind [.c create polygon %s -fill %s -stipple %s -tag card_button] { \ set Button_down 1 \n\ set Button_number %d }", hif_buttons[button_num].point_list, button_color, button_pattern, hif_buttons[button_num].OD); free(hif_buttons[button_num].point_list); #ifdef OD_DEBUG printf("tcl string is **%s**\n",string); #endif rc = Tcl_Eval(rep_interp, string); if (rc == TCL_ERROR) { sprintf(err_str[0],"Polygon Button creation returns unsuccessfully."); sprintf(err_str[1],"%s",rep_interp->result); sprintf(err_str[2],""); rep_error(HIF); return 1; } break; default : break; } /* end switch */ } /* end for */ UPDATE_DISPLAY return 0; } /* end create_buttons */ int initially_visible ( void ) { unsigned char string[(MAX_NUM_POINTS*8) + 300]; struct draw_segment *seg_info; int rc, fill_pat; unsigned char texture_str[10]; unsigned char line_color[10], fill_color[10], frame_color[10], line_thickness[5]; /* Do draw segment initial values */ for( seg_info = &hif_draw_segments[0] ; seg_info < &hif_draw_segments[MAX_NUM_SEGMENTS]; seg_info++) { if ( seg_info->visible ) { sprintf(line_color, "#%s", nra_colors[seg_info->lineColor]); #ifdef OD_DEBUG printf("lineColor is %d\n",seg_info->lineColor); printf("line_color is %s\n",line_color); #endif sprintf(fill_color, "#%s", nra_colors[seg_info->fillColor]); #ifdef OD_DEBUG printf("fillColor is %d\n",seg_info->fillColor); printf("fill_color is %s\n",fill_color); #endif if ( seg_info->lineType == OPEN_LINE ) { sprintf(string,".c itemconfigure %d -fill %s", seg_info->id, line_color); #ifdef OD_DEBUG printf("tcl string is **%s**\n",string); #endif rc = Tcl_Eval(rep_interp, string); if (rc == TCL_ERROR) { sprintf(err_str[0],"Line segment creation returns unsuccessfully."); sprintf(err_str[1],"%s",rep_interp->result); sprintf(err_str[2],""); rep_error(HIF); return 1; } } else { /* fill polygon area */ sprintf(string,".c itemconfigure %d -fill %s", seg_info->id, fill_color); #ifdef OD_DEBUG printf("tcl string is **%s**\n",string); #endif rc = Tcl_Eval(rep_interp, string); if (rc == TCL_ERROR) { sprintf(err_str[0],"Polygon draw segment creation returns unsuccessfully."); sprintf(err_str[1],"%s",rep_interp->result); sprintf(err_str[2],""); rep_error(HIF); return 1; } if ( seg_info->showFrame ) { /* draw the frame of the polygon in the specified color */ sprintf(string,".c itemconfigure %d -fill %s", seg_info->frame_id, line_color); #ifdef OD_DEBUG printf("tcl string is **%s**\n",string); #endif rc = Tcl_Eval(rep_interp, string); if (rc == TCL_ERROR) { sprintf(err_str[0],"Frame segment creation returns unsuccessfully."); sprintf(err_str[1],"%s",rep_interp->result); sprintf(err_str[2],""); rep_error(HIF); return 1; } } } } } /* end for loop */ UPDATE_DISPLAY return 0; } /* end initially_visible () */ int load_textures( void ) { TextureStyle texture; int i, loop, loop2; unsigned char texture_str[20]; memset(texture_bits,0,sizeof(texture_bits)); for( i=0; i < 16; i++) { LoadTextureEntry(&texture, m_drawparm.ptlut, 0, i); memcpy(texture_bits[i], (char *) &texture.dotMap8[0], 8); #ifdef OD_DEBUG printf("current bitmap is\n"); for (loop = 7; loop >= 0; loop--) { for (loop2 = 0; loop2 < 8; loop2++) printf("%d", ( texture_bits[i][loop] >> loop2 ) & 0x1); printf("\n"); } #endif sprintf(texture_str,"texture%d",i); #ifdef OD_DEBUG printf("texture_str is %s\n",texture_str); #endif if ( Tk_DefineBitmap(rep_interp, Tk_GetUid(texture_str), (char *) &texture_bits[i], 8, 8) != TCL_OK ) { sprintf(err_str[0],"Texture bitmap creation returns unsuccessfully."); sprintf(err_str[1],"%s",rep_interp->result); sprintf(err_str[2],""); rep_error(HIF); return 1; } } /* end for loop */ } /* end load_textures */ int redraw_segment( int segment_num, int redraw_color ) { unsigned char string[(MAX_NUM_POINTS*8) + 300]; struct draw_segment *seg_info; unsigned int color_index, rc; unsigned char line_color[10], fill_color[10], frame_color[10]; seg_info = &hif_draw_segments[segment_num]; if ( seg_info->lineType == OPEN_LINE ) { color_index = redraw_color & 0x000f; sprintf(line_color, "#%s", nra_colors[color_index]); #ifdef OD_DEBUG printf("color_index is %d\n",color_index); printf("line_color is %s\n",line_color); #endif sprintf(string,".c itemconfigure %d -fill %s", hif_draw_segments[segment_num].id, line_color); #ifdef OD_DEBUG printf("tcl string is **%s**\n",string); #endif rc = Tcl_Eval(rep_interp, string); if (rc == TCL_ERROR) { sprintf(err_str[0],"Line segment creation returns unsuccessfully."); sprintf(err_str[1],"%s",rep_interp->result); sprintf(err_str[2],""); rep_error(HIF); return 1; } } else { /* fill polygon area and show frame if desired */ color_index = redraw_color & 0x000f; sprintf(fill_color, "#%s", nra_colors[color_index]); #ifdef OD_DEBUG printf("color_index is %d\n",color_index); printf("fill_color is %s\n",fill_color); #endif sprintf(string,".c itemconfigure %d -fill %s", hif_draw_segments[segment_num].id, fill_color); #ifdef OD_DEBUG printf("tcl string is **%s**\n",string); #endif rc = Tcl_Eval(rep_interp, string); if (rc == TCL_ERROR) { sprintf(err_str[0],"Polygon draw segment creation returns unsuccessfully."); sprintf(err_str[1],"%s",rep_interp->result); sprintf(err_str[2],""); rep_error(HIF); return 1; } if ( redraw_color & 0x8000 ) { /* draw the frame of the polygon in the specified color */ color_index = ( redraw_color & 0x0f00 ) >> 8; sprintf(line_color, "#%s", nra_colors[color_index]); #ifdef OD_DEBUG printf("line_color is %s\n",line_color); #endif sprintf(string,".c itemconfigure %d -fill %s", hif_draw_segments[segment_num].frame_id, line_color); #ifdef OD_DEBUG printf("tcl string is **%s**\n",string); #endif rc = Tcl_Eval(rep_interp, string); if (rc == TCL_ERROR) { sprintf(err_str[0],"Frame segment creation returns unsuccessfully."); sprintf(err_str[1],"%s",rep_interp->result); sprintf(err_str[2],""); rep_error(HIF); return 1; } } } /* end else */ return 0; } /* end redraw_segment */ int raise_buttons (void) { unsigned char string[100]; unsigned int rc; if (!just_checking && (current_cf || current_cb)) { /* first raise the fields */ strcpy(string,".c raise card_field cardtag"); rc = Tcl_Eval(rep_interp, string); if ( strncmp(rep_interp->result,"tagOrId \"cardtag\" doesn't match any items",20) ) { if (rc == TCL_ERROR) { printf("Could not raise card_field items above the cardtag items.\n"); printf("%s\n",rep_interp->result); sprintf(err_str[0],"Could not delete card_field items."); sprintf(err_str[1],"%s",rep_interp->result); sprintf(err_str[2],""); rep_error(HIF); return 1; } } /* Then raise the buttons */ strcpy(string,".c raise card_button cardtag"); rc = Tcl_Eval(rep_interp, string); if ( strncmp(rep_interp->result,"tagOrId \"cardtag\" doesn't match any items",20) ) { if (rc == TCL_ERROR) { printf("Could not raise card_button card_field / cardtag items.\n"); printf("%s\n",rep_interp->result); sprintf(err_str[0],"Could not delete card_button items."); sprintf(err_str[1],"%s",rep_interp->result); sprintf(err_str[2],""); rep_error(HIF); return 1; } } } return 0; } yy6tabelem yy6exca[] ={ -1, 1, 0, -1, -2, 0, }; # define YYNPROD 215 # define YYLAST 930 yy6tabelem yy6act[]={ 482, 475, 392, 446, 363, 360, 330, 659, 377, 476, 477, 478, 479, 483, 484, 485, 486, 302, 34, 378, 385, 727, 27, 28, 29, 30, 31, 32, 419, 364, 370, 373, 375, 344, 720, 376, 379, 380, 383, 390, 728, 22, 23, 24, 345, 352, 713, 646, 633, 190, 189, 178, 177, 721, 331, 337, 340, 342, 97, 782, 343, 346, 347, 350, 357, 714, 781, 371, 381, 382, 9, 10, 11, 12, 13, 365, 366, 388, 389, 374, 386, 387, 384, 367, 369, 372, 368, 233, 232, 780, 137, 469, 338, 348, 349, 443, 779, 778, 777, 764, 332, 333, 355, 356, 341, 353, 354, 351, 334, 336, 339, 335, 395, 102, 763, 762, 761, 760, 759, 238, 758, 757, 756, 755, 726, 725, 724, 723, 722, 719, 718, 717, 716, 715, 712, 691, 711, 710, 709, 708, 707, 85, 86, 87, 377, 706, 705, 89, 90, 704, 661, 660, 658, 94, 88, 378, 385, 657, 656, 655, 787, 654, 653, 652, 651, 364, 370, 373, 375, 344, 650, 376, 379, 380, 383, 390, 649, 648, 647, 91, 345, 352, 645, 93, 92, 644, 643, 642, 641, 640, 331, 337, 340, 342, 96, 639, 343, 346, 347, 350, 357, 638, 637, 371, 381, 382, 22, 23, 24, 636, 635, 365, 366, 388, 389, 374, 386, 387, 384, 367, 369, 372, 368, 393, 138, 111, 634, 361, 338, 348, 349, 632, 631, 630, 629, 628, 332, 333, 355, 356, 341, 353, 354, 351, 334, 336, 339, 335, 627, 626, 625, 624, 623, 309, 622, 621, 620, 619, 618, 308, 546, 545, 544, 34, 310, 326, 543, 27, 28, 29, 30, 31, 32, 542, 303, 312, 314, 316, 541, 309, 317, 318, 319, 322, 327, 308, 540, 537, 536, 535, 310, 326, 534, 533, 532, 531, 530, 529, 527, 526, 303, 312, 314, 316, 525, 524, 317, 318, 319, 322, 327, 523, 315, 320, 321, 139, 522, 521, 520, 396, 304, 305, 324, 325, 519, 518, 517, 323, 306, 311, 313, 307, 514, 513, 512, 511, 420, 510, 315, 320, 321, 509, 508, 507, 506, 504, 304, 305, 324, 325, 503, 502, 501, 323, 306, 311, 313, 307, 41, 40, 500, 499, 498, 497, 496, 444, 495, 447, 494, 493, 492, 491, 490, 489, 488, 61, 157, 481, 480, 37, 38, 39, 474, 473, 472, 393, 361, 358, 328, 300, 236, 235, 230, 229, 470, 228, 227, 222, 221, 220, 219, 218, 213, 212, 211, 487, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 53, 54, 55, 56, 57, 207, 58, 59, 60, 205, 505, 41, 40, 204, 203, 52, 200, 199, 198, 515, 516, 197, 196, 195, 187, 186, 185, 184, 61, 183, 180, 188, 37, 38, 39, 179, 175, 528, 174, 171, 170, 169, 156, 155, 110, 678, 538, 539, 176, 82, 394, 298, 297, 65, 66, 67, 296, 295, 294, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 53, 54, 55, 56, 57, 293, 58, 59, 60, 292, 291, 68, 69, 290, 289, 52, 286, 285, 73, 74, 75, 77, 78, 82, 284, 283, 282, 65, 66, 67, 281, 280, 279, 70, 71, 72, 76, 81, 278, 277, 275, 274, 273, 271, 270, 85, 86, 87, 269, 268, 267, 89, 90, 266, 68, 69, 265, 94, 88, 264, 263, 73, 74, 75, 77, 78, 262, 261, 260, 259, 258, 257, 256, 255, 254, 252, 70, 71, 72, 76, 81, 251, 250, 91, 249, 248, 246, 93, 92, 245, 244, 243, 242, 241, 240, 208, 172, 225, 96, 224, 191, 192, 193, 194, 209, 181, 168, 167, 214, 166, 201, 202, 165, 164, 163, 206, 162, 161, 160, 159, 154, 153, 152, 151, 150, 149, 215, 216, 217, 148, 147, 146, 145, 144, 223, 143, 142, 141, 136, 135, 134, 133, 132, 131, 130, 234, 129, 128, 237, 127, 126, 125, 124, 123, 122, 121, 120, 119, 118, 117, 116, 115, 114, 113, 109, 108, 107, 106, 105, 104, 101, 100, 99, 19, 18, 17, 16, 15, 84, 64, 775, 771, 768, 774, 770, 767, 751, 743, 735, 750, 742, 734, 776, 772, 766, 752, 749, 744, 741, 733, 732, 731, 697, 696, 695, 694, 693, 692, 684, 683, 682, 681, 680, 679, 671, 670, 669, 668, 667, 666, 665, 664, 663, 662, 617, 615, 614, 613, 612, 609, 608, 607, 601, 599, 598, 597, 596, 595, 593, 592, 591, 590, 587, 140, 586, 585, 579, 577, 576, 575, 574, 573, 571, 570, 569, 568, 567, 566, 559, 558, 557, 556, 158, 554, 553, 552, 551, 549, 548, 547, 471, 445, 442, 418, 276, 253, 239, 786, 785, 784, 783, 773, 769, 765, 754, 753, 748, 747, 746, 745, 740, 739, 738, 737, 736, 730, 729, 703, 702, 701, 700, 699, 698, 690, 689, 688, 687, 686, 685, 677, 676, 675, 674, 673, 672, 616, 611, 610, 606, 605, 604, 603, 602, 600, 594, 589, 588, 584, 583, 582, 581, 580, 578, 572, 565, 564, 563, 562, 561, 560, 555, 550, 468, 467, 466, 465, 464, 463, 462, 461, 460, 459, 458, 457, 456, 455, 454, 453, 452, 451, 450, 449, 448, 441, 440, 439, 438, 437, 436, 435, 434, 433, 432, 431, 430, 429, 428, 427, 426, 425, 424, 423, 422, 421, 417, 416, 415, 414, 413, 412, 411, 410, 409, 408, 407, 406, 405, 404, 403, 402, 401, 400, 399, 398, 397, 36, 26, 21, 3, 362, 288, 14, 359, 287, 80, 79, 210, 391, 299, 95, 231, 226, 329, 272, 62, 182, 301, 247, 98, 33, 173, 83, 103, 63, 35, 25, 20, 8, 7, 6, 5, 112, 4, 2, 1 }; yy6tabelem yy6pact[]={ -197,-10000000, -197,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000, 539, 538, 537, 536, 535,-10000000, -232, -257, 169, 233, -138, -67,-10000000, 534, 533, 532, -12,-10000000, 531, 530, 529, 528, 527, 526,-10000000, 203, 100,-10000000, 525, 524, 523, 522, 521, 520, 519, 518, 517, 516, 515, 514, 513, 512, 511, 509, 508, 506, 505, 504, 503, 502, 501, 500, -33,-10000000, 190,-10000000, 499, 498, 497, 495, 494, 493, 492, 491, 487, 486, 485, 484, 483, 482,-10000000, -10000000, 202, 201, 251,-10000000, 481, 480, 479, 478, 476, 475, 474, 471, 469, 468,-10000000, 200,-10000000,-10000000, 199, 198, 456,-10000000,-10000000,-10000000, 197, 195, -209, 194, 189, 467,-10000000,-10000000,-10000000, 188, 186, 185, 184, 183, -215, -209, -209, -209, -209, 182, 181, 180, 177, 176, 175, -209, -209, 173, 172, 168, -209, 164, 455, 466,-10000000, -10000000,-10000000, 147, 146, 145, -215, -209, -209, -209, 144, 143, 142, 141, 140, -209, 461, 459,-10000000,-10000000,-10000000, 139, 138, 136, 135, -175, -209, 134, 133, -209, -4, 717, 454,-10000000, 453, 452, 451, 450,-10000000,-10000000, 449, 446,-10000000, 445, 444, 442, 441, 435, 716, 434,-10000000, -10000000, 433, 432, 431, 430, 429, 428, 427, 426, 420, 419, 416, 413, 410, 409, 408, 404, 403,-10000000,-10000000, 402, 401, 400, 715, 399, 398, 392, 391, 390, 386, 385, 384, 377, 376,-10000000,-10000000, 374, 373, 370, 369, 365, 349,-10000000,-10000000, 348, 347, 343, 342,-10000000, 132, -10000000,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000, 13,-10000000,-10000000, -10000000,-10000000,-10000000, 131,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000, -10000000,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000, -10000000,-10000000, -233,-10000000,-10000000,-10000000, 130,-10000000,-10000000,-10000000, -10000000,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000, 129, -258,-10000000, -10000000,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000, 128, 341, -13,-10000000, 849, 848, 847, 846, 845, 844, 843, 842, 841, 840, 839, 838, 837, 836, 835, 834, 833, 832, 831,-10000000,-10000000, 830, 829,-10000000,-10000000, 714, -97, -10000000, 828, 827, 826, 825, 824, 823, 822, 821, 820, 819, 818, 817, 816, 815, 814, 813, 812, 811, 810, -10000000,-10000000,-10000000,-10000000,-10000000, 809, 808,-10000000, 713, -30, -10000000, 712, -122,-10000000, 807, 806, 805, 804, 803, 802, 801, 800, 799, 798, 797, 796, 795, 794, 793, 792, 791, 790, 789,-10000000,-10000000,-10000000,-10000000,-10000000, 788, 787, -10000000, -34,-10000000, 711,-10000000,-10000000,-10000000, 127, 126, 125, -293, 121, 120, -285, -285, 117, 116, 115, 114, 113, 112, 111, 109, 107, 106, 105, 104, 103, 95,-10000000, -10000000, 94, 93, 88, -293, 87, 86, 85, 84, 80, 78, 77, 76, 75, -285, -285, 69, 68, 67, 61, 60, 59, 54,-10000000,-10000000, 48,-10000000,-10000000, 47, 42, 41, -293, 40, 39, 38, 37, 36, 35, 32, 31, 30, -285, -285, 29, 21, 16, 9, 5, 4,-10000000, -10000000, 3, 710, 709, 708, 785,-10000000,-10000000, 707, 706, 705, 704, 784, 702, 701, 700, 699, 783, 782, 781, 780, 779, 778, 698, 697, 696, 695, 694, 693, 777, 692, 691, 690, 689, 688, 776, 687, 775, 774, 773, 772, 771, 686, 685, 683, 770, 769, 682, 681, 680, 679, 768, 678, 677,-10000000, 676, 675, 674, 767, 673, 766, 765, 764, 763, 762, 672, 671, 670, 761, 760, 669, 668, 667, 666, 759, 665,-10000000, 1, 0, -1, -10000000, -2, -3, -5, -6,-10000000, -7, -8, -9, -22, -10000000,-10000000,-10000000,-10000000,-10000000,-10000000, -23, -24, -25, -26, -228, -31,-10000000, -47, -48, -55, -56, -62,-10000000, -68, -10000000,-10000000,-10000000,-10000000,-10000000, -69, -70, -71,-10000000,-10000000, -72, -75, -229, -79,-10000000, -80, -81, -87, -93, -94, -10000000, -95,-10000000,-10000000,-10000000,-10000000,-10000000, -96, -98, -99, -10000000,-10000000, -100, -105, -269, -106,-10000000, -107, 664, 663, 662, 661, 660, 659, 658,-10000000,-10000000, 657, 656, 655, 758, 757, 756, 755, 754, 753, 336, 654, 653, 652, 651, 650, 649, 752, 751, 750, 749, 748, 747, 10, 648, 647, 646, 645, 644, 643, 746, 745, 744, 743, 742, 741, -108, -111, -112, -117, -118, -119, -120, -121, -123, -211,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000, -124, -125, -126, -127, -128, -223,-10000000,-10000000,-10000000,-10000000,-10000000, -10000000,-10000000, -129, -130, -131, -132, -133, -236,-10000000,-10000000, -10000000,-10000000,-10000000,-10000000, 740, 739, 642, 641, 640, 632, 738,-10000000,-10000000, 737, 736, 735, 734, 639, 631, 638, 733, 732, 731, 730, 637, 630, 636, 729, 728,-10000000, -10000000, -134, -135, -136, -137,-10000000,-10000000,-10000000,-10000000,-10000000, -10000000, -139, -140,-10000000, -141,-10000000,-10000000,-10000000,-10000000, -142, -143,-10000000, -158,-10000000,-10000000, 727,-10000000, 635, 626, 726, 625, 634, 725, 624, 633,-10000000, -159, -160,-10000000,-10000000, -161,-10000000, -168,-10000000, -191,-10000000, -198,-10000000, 724, 723, 722, 721, 119,-10000000,-10000000,-10000000,-10000000,-10000000 }; yy6tabelem yy6pgo[]={ 0, 929, 928, 893, 927, 925, 924, 923, 922, 921, 920, 919, 918, 916, 892, 891, 890, 664, 663, 915, 464, 914, 912, 911, 17, 1, 0, 910, 447, 909, 908, 907, 6, 906, 905, 904, 903, 902, 2, 901, 900, 899, 898, 897, 5, 895, 894, 4 }; yy6tabelem yy6r1[]={ 0, 1, 2, 2, 3, 3, 3, 3, 3, 4, 5, 6, 7, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 14, 19, 15, 15, 15, 15, 15, 15, 15, 22, 21, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 25, 25, 25, 25, 26, 26, 26, 26, 27, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 30, 29, 31, 31, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 33, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 34, 34, 36, 35, 37, 37, 38, 39, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 42, 40, 43, 43, 44, 45, 41, 46, 46, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 20, 20, 28, 28 }; yy6tabelem yy6r2[]={ 0, 2, 2, 4, 2, 2, 2, 2, 2, 9, 8, 8, 8, 8, 2, 4, 2, 4, 2, 4, 2, 4, 2, 4, 12, 8, 6, 1, 9, 9, 8, 8, 8, 8, 2, 1, 13, 3, 5, 17, 17, 21, 9, 25, 21, 17, 17, 9, 9, 9, 9, 9, 9, 9, 17, 17, 13, 13, 13, 13, 13, 3, 3, 9, 13, 3, 3, 3, 3, 15, 19, 7, 7, 11, 11, 1, 9, 9, 8, 9, 9, 21, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 7, 2, 1, 13, 3, 5, 17, 17, 21, 9, 25, 21, 17, 9, 9, 9, 9, 9, 25, 17, 17, 13, 9, 9, 13, 13, 13, 13, 3, 3, 3, 3, 3, 9, 13, 3, 1, 9, 9, 8, 9, 9, 9, 9, 9, 9, 9, 2, 3, 3, 1, 13, 3, 5, 7, 1, 9, 9, 8, 21, 9, 8, 8, 8, 8, 8, 8, 8, 8, 8, 2, 2, 1, 13, 3, 5, 7, 1, 13, 3, 5, 17, 17, 21, 9, 25, 21, 17, 9, 9, 9, 9, 9, 25, 17, 17, 13, 9, 9, 13, 13, 13, 13, 3, 3, 3, 3, 3, 9, 13, 3, 3, 3, 3, 3 }; yy6tabelem yy6chk[]={ -10000000, -1, -2, -3, -4, -5, -6, -7, -8, 267, 268, 269, 270, 271, -3, 123, 123, 123, 123, 123, -9, -14, 273, 274, 275, -10, -15, 279, 280, 281, 282, 283, 284, -21, 275, -11, -16, 279, 280, 281, 259, 258, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 331, 316, 317, 318, 319, 320, 322, 323, 324, 275, -29, -12, -17, 279, 280, 281, 306, 307, 328, 329, 330, 313, 314, 315, 331, 316, 317, -40, -41, 332, 275, -13, -18, 279, 280, 281, 292, 285, 286, 317, 322, 321, 291, -35, 332, 125, -14, 123, 123, 123, 125, -15, 123, 123, 123, 123, 123, 123, 257, 125, -16, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 257, 125, -17, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 257, 257, 125, -18, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 257, 257, 257, 125, -19, 257, 257, -20, 261, 260, 257, 257, 123, -27, 257, 257, 257, 257, 257, -28, 265, 264, -20, -20, -20, -20, 257, 257, 257, 257, 257, 257, -20, -20, 257, 257, 257, -20, 257, 125, 123, -39, 257, 257, 257, -28, -20, -20, -20, 257, 257, 257, 257, 257, -20, 123, 123, -33, 257, 257, 257, 257, -34, 263, 262, -20, 257, 257, -20, 123, 44, 125, 125, 125, 125, 125, 125, 125, -22, 125, 125, 125, 125, 125, 44, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, -30, 125, 125, 125, 44, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, -42, -45, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, -36, 257, -23, -24, 287, 333, 334, 341, 344, 272, 266, 277, 342, 288, 343, 289, 325, 290, 293, 294, 295, 326, 327, 296, 340, 335, 336, 278, 297, 257, -31, -32, 287, 333, 334, 341, 344, 342, 288, 325, 343, 289, 337, 290, 293, 266, 277, 294, 295, 326, 327, 296, 340, 278, 338, 339, 335, 336, 297, 257, -43, -44, 257, -46, -47, 287, 333, 334, 341, 344, 342, 288, 325, 343, 289, 337, 290, 293, 266, 277, 294, 295, 326, 327, 296, 340, 278, 338, 339, 335, 336, 297, -37, -38, 257, 125, 125, -24, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 44, 125, -32, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 44, 125, -44, 44, 125, -47, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 125, -38, 44, 257, 257, 257, -25, 302, 303, 304, 305, 257, 257, -26, 298, 299, 300, 301, -26, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, -25, 257, 257, 257, 257, 257, 257, 257, 257, 257, -26, -26, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, -25, 257, 257, 257, 257, 257, 257, 257, 257, 257, -26, -26, 257, 257, 257, 257, 257, 257, 257, 44, 44, 44, 41, 44, 44, 44, 44, 41, 44, 44, 44, 44, 41, 41, 41, 41, 41, 41, 44, 44, 44, 44, 44, 44, 41, 44, 44, 44, 44, 44, 41, 44, 41, 41, 41, 41, 41, 44, 44, 44, 41, 41, 44, 44, 44, 44, 41, 44, 44, 44, 44, 44, 41, 44, 41, 41, 41, 41, 41, 44, 44, 44, 41, 41, 44, 44, 44, 44, 41, 44, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 276, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 276, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 276, 257, 257, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 41, 41, 41, 41, 41, 41, 125, 44, 44, 44, 44, 44, 44, 41, 41, 41, 41, 41, 41, 125, 44, 44, 44, 44, 44, 44, 41, 41, 41, 41, 41, 41, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 276, 257, 257, 257, 257, 257, 257, 276, 257, 257, 257, 257, 257, 257, 276, 41, 41, 44, 44, 44, 44, 41, 41, 41, 41, 41, 41, 44, 44, 41, 44, 41, 41, 41, 41, 44, 44, 41, 44, 41, 41, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 41, 44, 44, 41, 41, 44, 41, 44, 41, 44, 41, 44, 257, 257, 257, 257, 257, 257, 41, 41, 41, 41, 41 }; yy6tabelem yy6def[]={ 0, -2, 1, 2, 4, 5, 6, 7, 8, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 34, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 101, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 170, 171, 0, 0, 0, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 147, 0, 9, 15, 0, 0, 0, 10, 17, 27, 0, 0, 0, 0, 0, 0, 11, 19, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 21, 155, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 23, 136, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, 0, 0, 0, 0, 211, 212, 0, 0, 35, 0, 0, 0, 0, 0, 0, 0, 213, 214, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 172, 177, 0, 0, 0, 0, 0, 0, 148, 149, 0, 0, 0, 0, 150, 0, 25, 28, 29, 30, 31, 32, 33, 0, 76, 77, 78, 79, 80, 0, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 0, 156, 157, 158, 0, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 0, 0, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 0, 0, 0, 37, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 61, 62, 0, 0, 65, 66, 0, 0, 104, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 129, 130, 131, 132, 0, 0, 135, 0, 0, 174, 0, 0, 179, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 203, 204, 205, 206, 207, 0, 0, 210, 0, 152, 0, 24, 36, 38, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 103, 105, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 173, 175, 0, 178, 180, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 151, 153, 0, 0, 0, 0, 0, 67, 68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 176, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 154, 0, 0, 0, 42, 0, 0, 0, 0, 47, 0, 0, 0, 0, 48, 49, 50, 51, 52, 53, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 0, 0, 109, 0, 113, 114, 115, 116, 117, 0, 0, 0, 122, 123, 0, 0, 0, 0, 133, 0, 0, 0, 0, 0, 184, 0, 188, 189, 190, 191, 192, 0, 0, 0, 197, 198, 0, 0, 0, 0, 208, 0, 0, 0, 0, 0, 0, 0, 0, 71, 72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 56, 57, 58, 59, 60, 64, 81, 0, 0, 0, 0, 0, 0, 121, 124, 125, 126, 127, 134, 159, 0, 0, 0, 0, 0, 0, 196, 199, 200, 201, 202, 209, 0, 0, 0, 0, 0, 0, 0, 73, 74, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 39, 40, 0, 0, 0, 0, 46, 45, 54, 55, 106, 107, 0, 0, 112, 0, 119, 120, 181, 182, 0, 0, 187, 0, 194, 195, 0, 69, 0, 0, 0, 0, 0, 0, 0, 0, 41, 0, 0, 44, 108, 0, 111, 0, 183, 0, 186, 0, 70, 0, 0, 0, 0, 0, 43, 110, 118, 185, 193 }; typedef struct #ifdef __cplusplus yy6toktype #endif { char *t_name; int t_val; } yy6toktype; #ifndef YYDEBUG # define YYDEBUG 0 /* don't allow debugging */ #endif #if YYDEBUG yy6toktype yy6toks[] = { "NUM", 257, "QTYCOLUMN", 258, "QTYROW", 259, "FALSE", 260, "TRUE", 261, "OPEN_LINE", 262, "CLOSED_LINE", 263, "RECTANGLE_BUTTON", 264, "POLYGON_BUTTON", 265, "CMD_QUEUE_SIGNAL", 266, "WINDOW", 267, "CARD", 268, "CARD_FIELD", 269, "CARD_BUTTON", 270, "CARD_SEGMENT", 271, "CMD_DELETE_CARD", 272, "SIZE", 273, "NUMBER_CARDS", 274, "SCRIPT", 275, "STRING", 276, "CMD_SEND_SIGNAL", 277, "CMD_OPEN_OBJECT", 278, "NAME", 279, "NUMBER", 280, "ID", 281, "CANTDELETE", 282, "CARDFIELDS", 283, "CARDBUTTONS", 284, "LINESTYLE", 285, "LINETYPE", 286, "CMD_START_TRAP", 287, "CMD_BEEP", 288, "CMD_OPEN_SFILE", 289, "CMD_STRCPY", 290, "SHOWFRAME", 291, "LINECOLOR", 292, "CMD_SET_STATUS_VAR", 293, "CMD_HIDE_FIELD", 294, "CMD_SHOW_FIELD", 295, "CMD_POP_CARD", 296, "CMD_END_TRAP", 297, "STACK_OD", 298, "CARD_OD", 299, "FIELD_OD", 300, "BUTTON_OD", 301, "PLAY", 302, "PAUSE", 303, "SEEK", 304, "SET_SIGNAL", 305, "RECT", 306, "STYLE", 307, "LOCKTEXT", 308, "SHOWLINES", 309, "WIDEMARGINS", 310, "AUTOTAB", 311, "TEXTHEIGHT", 312, "TEXTFONT", 313, "TEXTSIZE", 314, "TEXTSTYLE", 315, "TEXTCOLOR", 316, "VISIBLE", 317, "SHOWFILL", 318, "FILLBACK", 319, "FILLFORE", 320, "FILLCOLOR", 321, "FILLPAT", 322, "SHOWPEN", 323, "PENFORE", 324, "CMD_CHANGE_COLOR", 325, "CMD_REWRITE_FIELD", 326, "CMD_REDRAW_SEGMENT", 327, "SHOWNAME", 328, "HILITE", 329, "AUTOHILITE", 330, "TEXTALIGN", 331, "POINTLIST", 332, "CMD_GOTO_RECORD", 333, "CMD_SEARCH_INDEX", 334, "CMD_GO_TO_CARD_REL", 335, "CMD_GO_TO_CARD", 336, "CMD_OPEN_MAP", 337, "CMD_EXIT", 338, "CMD_EXIT_IIS", 339, "CMD_PUSH_CARD", 340, "CMD_CD_PLAYER", 341, "CMD_WAIT_FOR_SIGNAL", 342, "CMD_CLOSE_SFILE", 343, "CMD_PUY_CMMD_TO_CDP", 344, "-unknown-", -1 /* ends search */ }; char * yy6reds[] = { "-no such reduction-", "hif : blocks", "blocks : block", "blocks : blocks block", "block : window_block", "block : card_block", "block : card_field_block", "block : card_button_block", "block : card_segment_block", "window_block : WINDOW '{' w_statements '}'", "card_block : CARD '{' c_statements '}'", "card_field_block : CARD_FIELD '{' cf_statements '}'", "card_button_block : CARD_BUTTON '{' cb_statements '}'", "card_segment_block : CARD_SEGMENT '{' cs_statements '}'", "w_statements : w_statement", "w_statements : w_statements w_statement", "c_statements : c_statement", "c_statements : c_statements c_statement", "cf_statements : cf_statement", "cf_statements : cf_statements cf_statement", "cb_statements : cb_statement", "cb_statements : cb_statements cb_statement", "cs_statements : cs_statement", "cs_statements : cs_statements cs_statement", "w_statement : SIZE '{' NUM ',' NUM '}'", "w_statement : NUMBER_CARDS '{' NUM '}'", "w_statement : SCRIPT '{' '}'", "c_statement : NAME '{'", "c_statement : NAME '{' '}'", "c_statement : NUMBER '{' NUM '}'", "c_statement : ID '{' NUM '}'", "c_statement : CANTDELETE '{' boolean '}'", "c_statement : CARDFIELDS '{' NUM '}'", "c_statement : CARDBUTTONS '{' NUM '}'", "c_statement : c_script", "c_script : SCRIPT NUM '{'", "c_script : SCRIPT NUM '{' c_script_statements '}'", "c_script_statements : c_script_statement", "c_script_statements : c_script_statements c_script_statement", "c_script_statement : CMD_START_TRAP '(' NUM ',' NUM ',' NUM ')'", "c_script_statement : CMD_GOTO_RECORD '(' NUM ',' NUM ',' NUM ')'", "c_script_statement : CMD_SEARCH_INDEX '(' NUM ',' NUM ',' NUM ',' NUM ')'", "c_script_statement : CMD_CD_PLAYER '(' cd_player_args ')'", "c_script_statement : CMD_PUY_CMMD_TO_CDP '(' NUM ',' NUM ',' NUM ',' NUM ',' NUM ')'", "c_script_statement : CMD_PUY_CMMD_TO_CDP '(' NUM ',' NUM ',' NUM ',' NUM ')'", "c_script_statement : CMD_DELETE_CARD '(' NUM ',' NUM ',' NUM ')'", "c_script_statement : CMD_PUY_CMMD_TO_CDP '(' NUM ',' NUM ',' NUM ')'", "c_script_statement : CMD_QUEUE_SIGNAL '(' signal_args ')'", "c_script_statement : CMD_SEND_SIGNAL '(' signal_args ')'", "c_script_statement : CMD_WAIT_FOR_SIGNAL '(' NUM ')'", "c_script_statement : CMD_BEEP '(' NUM ')'", "c_script_statement : CMD_CLOSE_SFILE '(' NUM ')'", "c_script_statement : CMD_OPEN_SFILE '(' NUM ')'", "c_script_statement : CMD_CHANGE_COLOR '(' NUM ')'", "c_script_statement : CMD_STRCPY '(' NUM ',' NUM ',' NUM ')'", "c_script_statement : CMD_STRCPY '(' NUM ',' NUM ',' STRING ')'", "c_script_statement : CMD_SET_STATUS_VAR '(' NUM ',' NUM ')'", "c_script_statement : CMD_HIDE_FIELD '(' NUM ',' NUM ')'", "c_script_statement : CMD_SHOW_FIELD '(' NUM ',' NUM ')'", "c_script_statement : CMD_REWRITE_FIELD '(' NUM ',' STRING ')'", "c_script_statement : CMD_REDRAW_SEGMENT '(' NUM ',' NUM ')'", "c_script_statement : CMD_POP_CARD", "c_script_statement : CMD_PUSH_CARD", "c_script_statement : CMD_GO_TO_CARD_REL '(' NUM ')'", "c_script_statement : CMD_GO_TO_CARD '(' NUM ',' NUM ')'", "c_script_statement : CMD_OPEN_OBJECT", "c_script_statement : CMD_END_TRAP", "cd_player_args : PLAY", "cd_player_args : PAUSE", "cd_player_args : SEEK ',' NUM ',' NUM ',' NUM", "cd_player_args : SET_SIGNAL ',' NUM ',' NUM ',' NUM ',' NUM", "signal_args : STACK_OD ',' NUM", "signal_args : CARD_OD ',' NUM", "signal_args : FIELD_OD ',' NUM ',' NUM", "signal_args : BUTTON_OD ',' NUM ',' NUM", "cf_statement : NAME '{'", "cf_statement : NAME '{' '}'", "cf_statement : NUMBER '{' NUM '}'", "cf_statement : ID '{' NUM '}'", "cf_statement : QTYROW '{' NUM '}'", "cf_statement : QTYCOLUMN '{' NUM '}'", "cf_statement : RECT '{' NUM ',' NUM ',' NUM ',' NUM '}'", "cf_statement : STYLE '{' styles '}'", "cf_statement : LOCKTEXT '{' boolean '}'", "cf_statement : SHOWLINES '{' boolean '}'", "cf_statement : WIDEMARGINS '{' boolean '}'", "cf_statement : AUTOTAB '{' boolean '}'", "cf_statement : TEXTHEIGHT '{' NUM '}'", "cf_statement : TEXTFONT '{' NUM '}'", "cf_statement : TEXTSIZE '{' NUM '}'", "cf_statement : TEXTSTYLE '{' NUM '}'", "cf_statement : TEXTALIGN '{' NUM '}'", "cf_statement : TEXTCOLOR '{' NUM '}'", "cf_statement : VISIBLE '{' boolean '}'", "cf_statement : SHOWFILL '{' boolean '}'", "cf_statement : FILLBACK '{' NUM '}'", "cf_statement : FILLFORE '{' NUM '}'", "cf_statement : FILLPAT '{' NUM '}'", "cf_statement : SHOWPEN '{' boolean '}'", "cf_statement : PENFORE '{' NUM '}'", "cf_statement : SCRIPT '{' '}'", "cf_statement : cf_script", "cf_script : SCRIPT NUM '{'", "cf_script : SCRIPT NUM '{' cf_script_statements '}'", "cf_script_statements : cf_script_statement", "cf_script_statements : cf_script_statements cf_script_statement", "cf_script_statement : CMD_START_TRAP '(' NUM ',' NUM ',' NUM ')'", "cf_script_statement : CMD_GOTO_RECORD '(' NUM ',' NUM ',' NUM ')'", "cf_script_statement : CMD_SEARCH_INDEX '(' NUM ',' NUM ',' NUM ',' NUM ')'", "cf_script_statement : CMD_CD_PLAYER '(' cd_player_args ')'", "cf_script_statement : CMD_PUY_CMMD_TO_CDP '(' NUM ',' NUM ',' NUM ',' NUM ',' NUM ')'", "cf_script_statement : CMD_PUY_CMMD_TO_CDP '(' NUM ',' NUM ',' NUM ',' NUM ')'", "cf_script_statement : CMD_PUY_CMMD_TO_CDP '(' NUM ',' NUM ',' NUM ')'", "cf_script_statement : CMD_WAIT_FOR_SIGNAL '(' NUM ')'", "cf_script_statement : CMD_BEEP '(' NUM ')'", "cf_script_statement : CMD_CHANGE_COLOR '(' NUM ')'", "cf_script_statement : CMD_CLOSE_SFILE '(' NUM ')'", "cf_script_statement : CMD_OPEN_SFILE '(' NUM ')'", "cf_script_statement : CMD_OPEN_MAP '(' NUM ',' NUM ',' NUM ',' NUM ',' NUM ')'", "cf_script_statement : CMD_STRCPY '(' NUM ',' NUM ',' NUM ')'", "cf_script_statement : CMD_STRCPY '(' NUM ',' NUM ',' STRING ')'", "cf_script_statement : CMD_SET_STATUS_VAR '(' NUM ',' NUM ')'", "cf_script_statement : CMD_QUEUE_SIGNAL '(' signal_args ')'", "cf_script_statement : CMD_SEND_SIGNAL '(' signal_args ')'", "cf_script_statement : CMD_HIDE_FIELD '(' NUM ',' NUM ')'", "cf_script_statement : CMD_SHOW_FIELD '(' NUM ',' NUM ')'", "cf_script_statement : CMD_REWRITE_FIELD '(' NUM ',' STRING ')'", "cf_script_statement : CMD_REDRAW_SEGMENT '(' NUM ',' NUM ')'", "cf_script_statement : CMD_POP_CARD", "cf_script_statement : CMD_PUSH_CARD", "cf_script_statement : CMD_OPEN_OBJECT", "cf_script_statement : CMD_EXIT", "cf_script_statement : CMD_EXIT_IIS", "cf_script_statement : CMD_GO_TO_CARD_REL '(' NUM ')'", "cf_script_statement : CMD_GO_TO_CARD '(' NUM ',' NUM ')'", "cf_script_statement : CMD_END_TRAP", "cs_statement : NAME '{'", "cs_statement : NAME '{' '}'", "cs_statement : NUMBER '{' NUM '}'", "cs_statement : ID '{' NUM '}'", "cs_statement : LINECOLOR '{' NUM '}'", "cs_statement : LINESTYLE '{' NUM '}'", "cs_statement : LINETYPE '{' cs_linetypes '}'", "cs_statement : VISIBLE '{' boolean '}'", "cs_statement : FILLPAT '{' NUM '}'", "cs_statement : FILLCOLOR '{' NUM '}'", "cs_statement : SHOWFRAME '{' boolean '}'", "cs_statement : cs_pointlist", "cs_linetypes : CLOSED_LINE", "cs_linetypes : OPEN_LINE", "cs_pointlist : POINTLIST NUM '{'", "cs_pointlist : POINTLIST NUM '{' cs_points '}'", "cs_points : cs_point", "cs_points : cs_points cs_point", "cs_point : NUM ',' NUM", "cb_statement : NAME '{'", "cb_statement : NAME '{' '}'", "cb_statement : NUMBER '{' NUM '}'", "cb_statement : ID '{' NUM '}'", "cb_statement : RECT '{' NUM ',' NUM ',' NUM ',' NUM '}'", "cb_statement : STYLE '{' styles '}'", "cb_statement : SHOWNAME '{' boolean '}'", "cb_statement : HILITE '{' boolean '}'", "cb_statement : AUTOHILITE '{' boolean '}'", "cb_statement : TEXTFONT '{' NUM '}'", "cb_statement : TEXTSIZE '{' NUM '}'", "cb_statement : TEXTSTYLE '{' NUM '}'", "cb_statement : TEXTALIGN '{' NUM '}'", "cb_statement : TEXTCOLOR '{' NUM '}'", "cb_statement : VISIBLE '{' boolean '}'", "cb_statement : cb_pointlist", "cb_statement : cb_script", "cb_pointlist : POINTLIST NUM '{'", "cb_pointlist : POINTLIST NUM '{' cb_points '}'", "cb_points : cb_point", "cb_points : cb_points cb_point", "cb_point : NUM ',' NUM", "cb_script : SCRIPT NUM '{'", "cb_script : SCRIPT NUM '{' cb_script_statements '}'", "cb_script_statements : cb_script_statement", "cb_script_statements : cb_script_statements cb_script_statement", "cb_script_statement : CMD_START_TRAP '(' NUM ',' NUM ',' NUM ')'", "cb_script_statement : CMD_GOTO_RECORD '(' NUM ',' NUM ',' NUM ')'", "cb_script_statement : CMD_SEARCH_INDEX '(' NUM ',' NUM ',' NUM ',' NUM ')'", "cb_script_statement : CMD_CD_PLAYER '(' cd_player_args ')'", "cb_script_statement : CMD_PUY_CMMD_TO_CDP '(' NUM ',' NUM ',' NUM ',' NUM ',' NUM ')'", "cb_script_statement : CMD_PUY_CMMD_TO_CDP '(' NUM ',' NUM ',' NUM ',' NUM ')'", "cb_script_statement : CMD_PUY_CMMD_TO_CDP '(' NUM ',' NUM ',' NUM ')'", "cb_script_statement : CMD_WAIT_FOR_SIGNAL '(' NUM ')'", "cb_script_statement : CMD_BEEP '(' NUM ')'", "cb_script_statement : CMD_CHANGE_COLOR '(' NUM ')'", "cb_script_statement : CMD_CLOSE_SFILE '(' NUM ')'", "cb_script_statement : CMD_OPEN_SFILE '(' NUM ')'", "cb_script_statement : CMD_OPEN_MAP '(' NUM ',' NUM ',' NUM ',' NUM ',' NUM ')'", "cb_script_statement : CMD_STRCPY '(' NUM ',' NUM ',' NUM ')'", "cb_script_statement : CMD_STRCPY '(' NUM ',' NUM ',' STRING ')'", "cb_script_statement : CMD_SET_STATUS_VAR '(' NUM ',' NUM ')'", "cb_script_statement : CMD_QUEUE_SIGNAL '(' signal_args ')'", "cb_script_statement : CMD_SEND_SIGNAL '(' signal_args ')'", "cb_script_statement : CMD_HIDE_FIELD '(' NUM ',' NUM ')'", "cb_script_statement : CMD_SHOW_FIELD '(' NUM ',' NUM ')'", "cb_script_statement : CMD_REWRITE_FIELD '(' NUM ',' STRING ')'", "cb_script_statement : CMD_REDRAW_SEGMENT '(' NUM ',' NUM ')'", "cb_script_statement : CMD_POP_CARD", "cb_script_statement : CMD_PUSH_CARD", "cb_script_statement : CMD_OPEN_OBJECT", "cb_script_statement : CMD_EXIT", "cb_script_statement : CMD_EXIT_IIS", "cb_script_statement : CMD_GO_TO_CARD_REL '(' NUM ')'", "cb_script_statement : CMD_GO_TO_CARD '(' NUM ',' NUM ')'", "cb_script_statement : CMD_END_TRAP", "boolean : TRUE", "boolean : FALSE", "styles : POLYGON_BUTTON", "styles : RECTANGLE_BUTTON", }; #endif /* YYDEBUG */ #if !defined(lint) && !defined(__cplusplus) static char __yaccpar_sccsid1[] = "@(#) 7/13/94 yaccpar 6.11 Copyr 1991 Sun Micro"; #endif /* ** Skeleton parser driver for yacc output */ /* ** yacc user known macros and defines */ #define YYERROR goto yy6errlab #define YYACCEPT return(0) #define YYABORT return(1) #define YYBACKUP( newtoken, newvalue )\ {\ if ( yy6char >= 0 || ( yy6r2[ yy6tmp ] >> 1 ) != 1 )\ {\ yy6error( "syntax error - cannot backup" );\ goto yy6errlab;\ }\ yy6char = newtoken;\ yy6state = *yy6ps;\ yy6lval = newvalue;\ goto yy6newstate;\ } #define YYRECOVERING() (!!yy6errflag) #define YYNEW(type) malloc(sizeof(type) * yy6newmax) #define YYCOPY(to, from, type) \ (type *) memcpy(to, (char *) from, yy6newmax * sizeof(type)) #define YYENLARGE( from, type) \ (type *) realloc((char *) from, yy6newmax * sizeof(type)) #ifndef YYDEBUG # define YYDEBUG 1 /* make debugging available */ #endif /* ** user known globals */ int yy6debug; /* set to 1 to get debugging */ /* ** driver internal defines */ #define YYFLAG (-10000000) /* ** global variables used by the parser */ YYSTYPE *yy6pv; /* top of value stack */ int *yy6ps; /* top of state stack */ int yy6state; /* current state */ int yy6tmp; /* extra var (lasts between blocks) */ int yy6nerrs; /* number of errors */ int yy6errflag; /* error recovery flag */ int yy6char; /* current input token number */ #ifdef YYNMBCHARS #define YYLEX() yy6cvtok(yy6lex()) /* ** yy6cvtok - return a token if i is a wchar_t value that exceeds 255. ** If i<255, i itself is the token. If i>255 but the neither ** of the 30th or 31st bit is on, i is already a token. */ #if defined(__STDC__) || defined(__cplusplus) int yy6cvtok(int i) #else int yy6cvtok(i) int i; #endif { int first = 0; int last = YYNMBCHARS - 1; int mid; wchar_t j; if(i&0x60000000){/*Must convert to a token. */ if( yy6mbchars[last].character < i ){ return i;/*Giving up*/ } while ((last>=first)&&(first>=0)) {/*Binary search loop*/ mid = (first+last)/2; j = yy6mbchars[mid].character; if( j==i ){/*Found*/ return yy6mbchars[mid].tvalue; }else if( j= 0; yy6_i++ ) { if ( yy6toks[yy6_i].t_val == yy6char ) break; } printf( "%s\n", yy6toks[yy6_i].t_name ); } } #endif /* YYDEBUG */ if ( ++yy6_ps >= &yy6s[ yy6maxdepth ] ) /* room on stack? */ { /* ** reallocate and recover. Note that pointers ** have to be reset, or bad things will happen */ int yy6ps_index = (yy6_ps - yy6s); int yy6pv_index = (yy6_pv - yy6v); int yy6pvt_index = (yy6pvt - yy6v); int yy6newmax; #ifdef YYEXPAND yy6newmax = YYEXPAND(yy6maxdepth); #else yy6newmax = 2 * yy6maxdepth; /* double table size */ if (yy6maxdepth == YYMAXDEPTH) /* first time growth */ { char *newyy6s = (char *)YYNEW(int); char *newyy6v = (char *)YYNEW(YYSTYPE); if (newyy6s != 0 && newyy6v != 0) { yy6s = YYCOPY(newyy6s, yy6s, int); yy6v = YYCOPY(newyy6v, yy6v, YYSTYPE); } else yy6newmax = 0; /* failed */ } else /* not first time */ { yy6s = YYENLARGE(yy6s, int); yy6v = YYENLARGE(yy6v, YYSTYPE); if (yy6s == 0 || yy6v == 0) yy6newmax = 0; /* failed */ } #endif if (yy6newmax <= yy6maxdepth) /* tables not expanded */ { yy6error( "yacc stack overflow" ); YYABORT; } yy6maxdepth = yy6newmax; yy6_ps = yy6s + yy6ps_index; yy6_pv = yy6v + yy6pv_index; yy6pvt = yy6v + yy6pvt_index; } *yy6_ps = yy6_state; *++yy6_pv = yy6val; /* ** we have a new state - find out what to do */ yy6_newstate: if ( ( yy6_n = yy6pact[ yy6_state ] ) <= YYFLAG ) goto yy6default; /* simple state */ #if YYDEBUG /* ** if debugging, need to mark whether new token grabbed */ yy6tmp = yy6char < 0; #endif if ( ( yy6char < 0 ) && ( ( yy6char = YYLEX() ) < 0 ) ) yy6char = 0; /* reached EOF */ #if YYDEBUG if ( yy6debug && yy6tmp ) { register int yy6_i; printf( "Received token " ); if ( yy6char == 0 ) printf( "end-of-file\n" ); else if ( yy6char < 0 ) printf( "-none-\n" ); else { for ( yy6_i = 0; yy6toks[yy6_i].t_val >= 0; yy6_i++ ) { if ( yy6toks[yy6_i].t_val == yy6char ) break; } printf( "%s\n", yy6toks[yy6_i].t_name ); } } #endif /* YYDEBUG */ if ( ( ( yy6_n += yy6char ) < 0 ) || ( yy6_n >= YYLAST ) ) goto yy6default; if ( yy6chk[ yy6_n = yy6act[ yy6_n ] ] == yy6char ) /*valid shift*/ { yy6char = -1; yy6val = yy6lval; yy6_state = yy6_n; if ( yy6errflag > 0 ) yy6errflag--; goto yy6_stack; } yy6default: if ( ( yy6_n = yy6def[ yy6_state ] ) == -2 ) { #if YYDEBUG yy6tmp = yy6char < 0; #endif if ( ( yy6char < 0 ) && ( ( yy6char = YYLEX() ) < 0 ) ) yy6char = 0; /* reached EOF */ #if YYDEBUG if ( yy6debug && yy6tmp ) { register int yy6_i; printf( "Received token " ); if ( yy6char == 0 ) printf( "end-of-file\n" ); else if ( yy6char < 0 ) printf( "-none-\n" ); else { for ( yy6_i = 0; yy6toks[yy6_i].t_val >= 0; yy6_i++ ) { if ( yy6toks[yy6_i].t_val == yy6char ) { break; } } printf( "%s\n", yy6toks[yy6_i].t_name ); } } #endif /* YYDEBUG */ /* ** look through exception table */ { register int *yy6xi = yy6exca; while ( ( *yy6xi != -1 ) || ( yy6xi[1] != yy6_state ) ) { yy6xi += 2; } while ( ( *(yy6xi += 2) >= 0 ) && ( *yy6xi != yy6char ) ) ; if ( ( yy6_n = yy6xi[1] ) < 0 ) YYACCEPT; } } /* ** check for syntax error */ if ( yy6_n == 0 ) /* have an error */ { /* no worry about speed here! */ switch ( yy6errflag ) { case 0: /* new error */ yy6error( "syntax error" ); goto skip_init; yy6errlab: /* ** get globals into registers. ** we have a user generated syntax type error */ yy6_pv = yy6pv; yy6_ps = yy6ps; yy6_state = yy6state; skip_init: yy6nerrs++; /* FALLTHRU */ case 1: case 2: /* incompletely recovered error */ /* try again... */ yy6errflag = 3; /* ** find state where "error" is a legal ** shift action */ while ( yy6_ps >= yy6s ) { yy6_n = yy6pact[ *yy6_ps ] + YYERRCODE; if ( yy6_n >= 0 && yy6_n < YYLAST && yy6chk[yy6act[yy6_n]] == YYERRCODE) { /* ** simulate shift of "error" */ yy6_state = yy6act[ yy6_n ]; goto yy6_stack; } /* ** current state has no shift on ** "error", pop stack */ #if YYDEBUG # define _POP_ "Error recovery pops state %d, uncovers state %d\n" if ( yy6debug ) printf( _POP_, *yy6_ps, yy6_ps[-1] ); # undef _POP_ #endif yy6_ps--; yy6_pv--; } /* ** there is no state on stack with "error" as ** a valid shift. give up. */ YYABORT; case 3: /* no shift yet; eat a token */ #if YYDEBUG /* ** if debugging, look up token in list of ** pairs. 0 and negative shouldn't occur, ** but since timing doesn't matter when ** debugging, it doesn't hurt to leave the ** tests here. */ if ( yy6debug ) { register int yy6_i; printf( "Error recovery discards " ); if ( yy6char == 0 ) printf( "token end-of-file\n" ); else if ( yy6char < 0 ) printf( "token -none-\n" ); else { for ( yy6_i = 0; yy6toks[yy6_i].t_val >= 0; yy6_i++ ) { if ( yy6toks[yy6_i].t_val == yy6char ) { break; } } printf( "token %s\n", yy6toks[yy6_i].t_name ); } } #endif /* YYDEBUG */ if ( yy6char == 0 ) /* reached EOF. quit */ YYABORT; yy6char = -1; goto yy6_newstate; } }/* end if ( yy6_n == 0 ) */ /* ** reduction by production yy6_n ** put stack tops, etc. so things right after switch */ #if YYDEBUG /* ** if debugging, print the string that is the user's ** specification of the reduction which is just about ** to be done. */ if ( yy6debug ) printf( "Reduce by (%d) \"%s\"\n", yy6_n, yy6reds[ yy6_n ] ); #endif yy6tmp = yy6_n; /* value to switch over */ yy6pvt = yy6_pv; /* $vars top of value stack */ /* ** Look in goto table for next state ** Sorry about using yy6_state here as temporary ** register variable, but why not, if it works... ** If yy6r2[ yy6_n ] doesn't have the low order bit ** set, then there is no action to be done for ** this reduction. So, no saving & unsaving of ** registers done. The only difference between the ** code just after the if and the body of the if is ** the goto yy6_stack in the body. This way the test ** can be made before the choice of what to do is needed. */ { /* length of production doubled with extra bit */ register int yy6_len = yy6r2[ yy6_n ]; if ( !( yy6_len & 01 ) ) { yy6_len >>= 1; yy6val = ( yy6_pv -= yy6_len )[1]; /* $$ = $1 */ yy6_state = yy6pgo[ yy6_n = yy6r1[ yy6_n ] ] + *( yy6_ps -= yy6_len ) + 1; if ( yy6_state >= YYLAST || yy6chk[ yy6_state = yy6act[ yy6_state ] ] != -yy6_n ) { yy6_state = yy6act[ yy6pgo[ yy6_n ] ]; } goto yy6_stack; } yy6_len >>= 1; yy6val = ( yy6_pv -= yy6_len )[1]; /* $$ = $1 */ yy6_state = yy6pgo[ yy6_n = yy6r1[ yy6_n ] ] + *( yy6_ps -= yy6_len ) + 1; if ( yy6_state >= YYLAST || yy6chk[ yy6_state = yy6act[ yy6_state ] ] != -yy6_n ) { yy6_state = yy6act[ yy6pgo[ yy6_n ] ]; } } /* save until reenter driver code */ yy6state = yy6_state; yy6ps = yy6_ps; yy6pv = yy6_pv; } /* ** code supplied by user is placed in this switch */ switch( yy6tmp ) { case 9: { if (!using_hif) { sprintf(err_str[0],"Template error: window statement cannot be used here."); sprintf(err_str[1],""); rep_error(HIF); return 1; } } break; case 27: { in_name = 1; } break; case 28: { in_name = 0; } break; case 29: { c_status_var = 0; current_hif_card = atoi(yy6pvt[-1].value); if (using_hif && hif_card_on) { hif_card_on = 0; return 0; } if (using_hif && just_checking) { if (atoi(yy6pvt[-1].value) == check_card) { search_return = 1; return 0; } } if (using_hif && !just_checking) { if (atoi(yy6pvt[-1].value) == check_card) { hif_card_on = 1; } } } break; case 35: { if (hif_card_on) { counting_od = 1; c_trap_count = 0; } } break; case 36: { int num; if (hif_card_on) { counting_od = 0; num = atoi(yy6pvt[-4].value); if (num != current_od_count) { sprintf(err_str[0],"Number of lines in card script is %d.",current_od_count); sprintf(err_str[1],"Doesn't match declared number %d.",num); sprintf(err_str[2],""); rep_error(HIF); current_od_count = 0; return 1; } current_od_count = 0; } } break; case 37: { if (hif_card_on && counting_od) current_od_count++; } break; case 38: { if (hif_card_on && counting_od) current_od_count++; } break; case 39: { if (hif_card_on) { # ifdef OD_DEBUG printf("Storing card_od: CMD_START_TRAP\n"); printf("trap_signal = %d\n",atoi(yy6pvt[-5].value)); printf("object_status_var = %d\n",atoi(yy6pvt[-3].value)); printf("mask = %d\n",atoi(yy6pvt[-1].value)); # endif c_traps[c_trap_count].trap_signal = atoi(yy6pvt[-5].value); c_traps[c_trap_count].object_status_var = atoi(yy6pvt[-3].value); c_traps[c_trap_count].mask = atoi(yy6pvt[-1].value); } } break; case 40: { if (hif_card_on) { sprintf(temp_str,"%s %s %s",yy6pvt[-5].value, yy6pvt[-3].value, yy6pvt[-1].value); # ifdef OD_DEBUG printf("Storing card_od: CMD_GOTO_RECORD\n"); # endif if ( store_od(&(c_traps[c_trap_count].trap_od), CMD_GOTO_RECORD, temp_str, NULL) ) return 1; } } break; case 41: { if (hif_card_on) { sprintf(temp_str,"%s %s %s %s",yy6pvt[-7].value, yy6pvt[-5].value, yy6pvt[-3].value, yy6pvt[-1].value); # ifdef OD_DEBUG printf("Storing card_od: CMD_SEARCH_INDEX\n"); # endif if ( store_od(&(c_traps[c_trap_count].trap_od), CMD_SEARCH_INDEX, temp_str, NULL) ) return 1; } } break; case 42: { if (hif_card_on) { # ifdef OD_DEBUG printf("Storing card_od: CMD_CD_PLAYER\n"); # endif if ( store_od(&(c_traps[c_trap_count].trap_od), CMD_CD_PLAYER, temp_str, NULL) ) return 1; } } break; case 43: { if (hif_card_on) { sprintf(temp_str,"%s %s %s %s %s",yy6pvt[-9].value, yy6pvt[-7].value, yy6pvt[-5].value, yy6pvt[-3].value, yy6pvt[-1].value); # ifdef OD_DEBUG printf("Storing card_od: CMD_PUY_CMMD_TO_CDP\n"); # endif if ( store_od(&(c_traps[c_trap_count].trap_od), CMD_PUY_CMMD_TO_CDP, temp_str, NULL) ) return 1; } } break; case 44: { if (hif_card_on) { sprintf(temp_str,"%s %s %s %s",yy6pvt[-7].value, yy6pvt[-5].value, yy6pvt[-3].value, yy6pvt[-1].value); # ifdef OD_DEBUG printf("Storing card_od: CMD_PUY_CMMD_TO_CDP\n"); # endif if ( store_od(&(c_traps[c_trap_count].trap_od), CMD_PUY_CMMD_TO_CDP, temp_str, NULL) ) return 1; } } break; case 45: { if (hif_card_on) { sprintf(temp_str,"%s %s %s",yy6pvt[-5].value, yy6pvt[-3].value, yy6pvt[-1].value); # ifdef OD_DEBUG printf("Storing card_od: CMD_DELETE_CARD\n"); # endif if ( store_od(&(c_traps[c_trap_count].trap_od), CMD_DELETE_CARD, temp_str, NULL) ) return 1; } } break; case 46: { if (hif_card_on) { sprintf(temp_str,"%s %s %s",yy6pvt[-5].value, yy6pvt[-3].value, yy6pvt[-1].value); # ifdef OD_DEBUG printf("Storing card_od: CMD_PUY_CMMD_TO_CDP\n"); # endif if ( store_od(&(c_traps[c_trap_count].trap_od), CMD_PUY_CMMD_TO_CDP, temp_str, NULL) ) return 1; } } break; case 47: { if (hif_card_on) { # ifdef OD_DEBUG printf("Storing card_od: CMD_QUEUE_SIGNAL\n"); # endif if ( store_od(&(c_traps[c_trap_count].trap_od), CMD_QUEUE_SIGNAL, temp_str, NULL) ) return 1; } } break; case 48: { if (hif_card_on) { # ifdef OD_DEBUG printf("Storing card_od: CMD_SEND_SIGNAL\n"); # endif if ( store_od(&(c_traps[c_trap_count].trap_od), CMD_SEND_SIGNAL, temp_str, NULL) ) return 1; } } break; case 49: { if (hif_card_on) { sprintf(temp_str,"%s",yy6pvt[-1].value); # ifdef OD_DEBUG printf("Storing card_od: CMD_WAIT_FOR_SIGNAL\n"); # endif if ( store_od(&(c_traps[c_trap_count].trap_od), CMD_WAIT_FOR_SIGNAL, temp_str, NULL) ) return 1; } } break; case 50: { if (hif_card_on) { sprintf(temp_str,"%s",yy6pvt[-1].value); # ifdef OD_DEBUG printf("Storing card_od: CMD_BEEP\n"); # endif if ( store_od(&(c_traps[c_trap_count].trap_od), CMD_BEEP, temp_str, NULL) ) return 1; } } break; case 51: { if (hif_card_on) { sprintf(temp_str,"%s",yy6pvt[-1].value); # ifdef OD_DEBUG printf("Storing card_od: CMD_CLOSE_SFILE\n"); # endif if ( store_od(&(c_traps[c_trap_count].trap_od), CMD_CLOSE_SFILE, temp_str, NULL) ) return 1; } } break; case 52: { if (hif_card_on) { sprintf(temp_str,"%s",yy6pvt[-1].value); # ifdef OD_DEBUG printf("Storing card_od: CMD_OPEN_SFILE\n"); # endif if ( store_od(&(c_traps[c_trap_count].trap_od), CMD_OPEN_SFILE, temp_str, NULL) ) return 1; } } break; case 53: { if (hif_card_on) { set_pal(atoi(yy6pvt[-1].value)); sprintf(temp_str,"%s", yy6pvt[-1].value); # ifdef OD_DEBUG printf("Storing card_od: CMD_CHANGE_COLOR\n"); # endif if ( store_od(&(c_traps[c_trap_count].trap_od), CMD_CHANGE_COLOR, temp_str, NULL) ) return 1; } } break; case 54: { if (hif_card_on) { sprintf(temp_str,"%s %s %s", yy6pvt[-5].value, yy6pvt[-3].value, yy6pvt[-1].value); # ifdef OD_DEBUG printf("Storing card_od: CMD_STRCPY\n"); # endif if ( store_od(&(c_traps[c_trap_count].trap_od), CMD_STRCPY, temp_str, NULL) ) return 1; } } break; case 55: { if (hif_card_on) { sprintf(temp_str,"%s %s", yy6pvt[-5].value, yy6pvt[-3].value); # ifdef OD_DEBUG printf("Storing card_od: CMD_STRCPY\n"); # endif if ( store_od(&(c_traps[c_trap_count].trap_od), CMD_STRCPY, temp_str, yy6pvt[-1].value) ) return 1; } } break; case 56: { if (hif_card_on) { sprintf(temp_str,"%s %s", yy6pvt[-3].value, yy6pvt[-1].value); # ifdef OD_DEBUG printf("Storing card_od: CMD_SET_STATUS_VAR\n"); # endif if ( store_od(&(c_traps[c_trap_count].trap_od), CMD_SET_STATUS_VAR, temp_str, NULL) ) return 1; } } break; case 57: { if (hif_card_on) { sprintf(temp_str,"%s %s", yy6pvt[-3].value, yy6pvt[-1].value); # ifdef OD_DEBUG printf("Storing card_od: CMD_HIDE_FIELD\n"); # endif if ( store_od(&(c_traps[c_trap_count].trap_od), CMD_HIDE_FIELD, temp_str, NULL) ) return 1; } } break; case 58: { if (hif_card_on) { sprintf(temp_str,"%s %s", yy6pvt[-3].value, yy6pvt[-1].value); # ifdef OD_DEBUG printf("Storing card_od: CMD_SHOW_FIELD\n"); # endif if ( store_od(&(c_traps[c_trap_count].trap_od), CMD_SHOW_FIELD, temp_str, NULL) ) return 1; } } break; case 59: { if (hif_card_on) { sprintf(temp_str,"%s",yy6pvt[-3].value); # ifdef OD_DEBUG printf("Storing card_od: CMD_REWRITE_FIELD\n"); # endif if ( store_od(&(c_traps[c_trap_count].trap_od), CMD_REWRITE_FIELD, temp_str, yy6pvt[-1].value) ) return 1; } } break; case 60: { if (hif_card_on) { sprintf(temp_str,"%s %s", yy6pvt[-3].value, yy6pvt[-1].value); # ifdef OD_DEBUG printf("Storing card_od: CMD_REDRAW_SEGMENT\n"); # endif if ( store_od(&(c_traps[c_trap_count].trap_od), CMD_REDRAW_SEGMENT, temp_str, NULL) ) return 1; } } break; case 61: { if (hif_card_on) { # ifdef OD_DEBUG printf("Storing card_od: CMD_POP_CARD\n"); # endif if ( store_od(&(c_traps[c_trap_count].trap_od), CMD_POP_CARD, NULL, NULL) ) return 1; } } break; case 62: { if (hif_card_on) { # ifdef OD_DEBUG printf("Storing card_od: CMD_PUSH_CARD\n"); # endif if ( store_od(&(c_traps[c_trap_count].trap_od), CMD_PUSH_CARD, NULL, NULL) ) return 1; } } break; case 63: { if (hif_card_on) { sprintf(temp_str,"%s",yy6pvt[-1].value); # ifdef OD_DEBUG printf("Storing card_od: CMD_GO_TO_CARD_REL\n"); # endif if ( store_od(&(c_traps[c_trap_count].trap_od), CMD_GO_TO_CARD_REL, temp_str, NULL) ) return 1; } } break; case 64: { if (hif_card_on) { sprintf(temp_str,"%s %s",yy6pvt[-3].value, yy6pvt[-1].value); # ifdef OD_DEBUG printf("Storing card_od: CMD_GO_TO_CARD\n"); # endif if ( store_od(&(c_traps[c_trap_count].trap_od), CMD_GO_TO_CARD, temp_str, NULL) ) return 1; } } break; case 65: { if (hif_card_on) { # ifdef OD_DEBUG printf("Storing card_od: CMD_OPEN_OBJECT\n"); # endif if ( store_od(&(c_traps[c_trap_count].trap_od), CMD_OPEN_OBJECT, NULL, NULL) ) return 1; } } break; case 66: { if (hif_card_on) { c_trap_count++; } } break; case 67: { sprintf(temp_str,"%d",PLAY); } break; case 68: { sprintf(temp_str,"%d",PAUSE); } break; case 69: { sprintf(temp_str,"%d %s %s %s",SEEK,yy6pvt[-4].value,yy6pvt[-2].value,yy6pvt[-0].value); } break; case 70: { sprintf(temp_str,"%d %s %s %s %s",SET_SIGNAL,yy6pvt[-6].value,yy6pvt[-4].value,yy6pvt[-2].value,yy6pvt[-0].value); } break; case 71: { sprintf(temp_str,"%d %s",STACK_OD,yy6pvt[-0].value); } break; case 72: { sprintf(temp_str,"%d %s",CARD_OD,yy6pvt[-0].value); } break; case 73: { sprintf(temp_str,"%d %s %s",FIELD_OD,yy6pvt[-2].value,yy6pvt[-0].value); } break; case 74: { sprintf(temp_str,"%d %s %s",BUTTON_OD,yy6pvt[-2].value,yy6pvt[-0].value); } break; case 75: { in_name = 1; } break; case 76: { in_name = 0; } break; case 77: { if (hif_card_on) { current_cf = atoi(yy6pvt[-1].value); } } break; case 79: { if (hif_card_on) { hif_fields[current_cf].rows = atoi(yy6pvt[-1].value); } } break; case 80: { if (hif_card_on) { hif_fields[current_cf].columns = atoi(yy6pvt[-1].value); } } break; case 81: { if (hif_card_on) { hif_fields[current_cf].x1 = atoi(yy6pvt[-7].value); hif_fields[current_cf].y1 = atoi(yy6pvt[-5].value); hif_fields[current_cf].x2 = atoi(yy6pvt[-3].value); hif_fields[current_cf].y2 = atoi(yy6pvt[-1].value); } } break; case 92: { if (hif_card_on) { int value; value = atoi(yy6pvt[-1].value); if (value > 16) value = 16; if (value < 1) { sprintf(err_str[0],"Nothing less than 1 may be used as a text color.\n"); sprintf(err_str[1],""); rep_error(HIF); return 1; } hif_fields[current_cf].text_color = value; } } break; case 93: { if (hif_card_on) { hif_fields[current_cf].visible = yy6pvt[-1].type; } } break; case 94: { if (hif_card_on) { hif_fields[current_cf].show_fill = yy6pvt[-1].type; } } break; case 95: { if (hif_card_on) { hif_fields[current_cf].fill_back = atoi(yy6pvt[-1].value); } } break; case 96: { if (hif_card_on) { hif_fields[current_cf].fill_fore = atoi(yy6pvt[-1].value); } } break; case 97: { if (hif_card_on) { hif_fields[current_cf].fill_pat = atoi(yy6pvt[-1].value); } } break; case 98: { if (hif_card_on) { hif_fields[current_cf].show_pen = yy6pvt[-1].type; } } break; case 99: { if (hif_card_on) { hif_fields[current_cf].pen_fore = atoi(yy6pvt[-1].value); } } break; case 100: { if (hif_card_on) { hif_fields[current_cf].OD = 0; } } break; case 102: { if (hif_card_on) { counting_od = 1; cf_trap_count = 0; hif_fields[current_cf].OD = od_num++; } } break; case 103: { int num; if (hif_card_on) { counting_od = 0; num = atoi(yy6pvt[-4].value); if (num != current_od_count) { sprintf(err_str[0],"Number of lines in card field script is %d.",current_od_count); sprintf(err_str[1],"Doesn't match declared number %d.",num); sprintf(err_str[2],""); rep_error(HIF); counting_od = 0; current_od_count = 0; return 1; } current_od_count = 0; } } break; case 104: { if (hif_card_on && counting_od) current_od_count++; } break; case 105: { if (hif_card_on && counting_od) current_od_count++; } break; case 106: { if (hif_card_on) # ifdef OD_DEBUG printf("Storing card_field: CMD_START_TRAP\n"); printf("trap_signal = %d\n",atoi(yy6pvt[-5].value)); printf("object_status_var = %d\n",atoi(yy6pvt[-3].value)); printf("mask = %d\n",atoi(yy6pvt[-1].value)); # endif { cf_traps[current_cf][cf_trap_count].trap_signal = atoi(yy6pvt[-5].value); cf_traps[current_cf][cf_trap_count].object_status_var = atoi(yy6pvt[-3].value); cf_traps[current_cf][cf_trap_count].mask = atoi(yy6pvt[-1].value); } } break; case 107: { if (hif_card_on) { sprintf(temp_str,"%s %s %s",yy6pvt[-5].value, yy6pvt[-3].value, yy6pvt[-1].value); if ( store_od(&(cf_traps[current_cf][cf_trap_count].trap_od), CMD_GOTO_RECORD, temp_str, NULL) ) return 1; } } break; case 108: { if (hif_card_on) { sprintf(temp_str,"%s %s %s %s",yy6pvt[-7].value, yy6pvt[-5].value, yy6pvt[-3].value, yy6pvt[-1].value); if ( store_od(&(cf_traps[current_cf][cf_trap_count].trap_od), CMD_SEARCH_INDEX, temp_str, NULL) ) return 1; } } break; case 109: { if (hif_card_on) { # ifdef OD_DEBUG printf("Storing card_field od: CMD_CD_PLAYER\n"); # endif if ( store_od(&(cf_traps[current_cf][cf_trap_count].trap_od), CMD_CD_PLAYER, temp_str, NULL) ) return 1; } } break; case 110: { if (hif_card_on) { sprintf(temp_str,"%s %s %s %s %s",yy6pvt[-9].value, yy6pvt[-7].value, yy6pvt[-5].value, yy6pvt[-3].value, yy6pvt[-1].value); if ( store_od(&(cf_traps[current_cf][cf_trap_count].trap_od), CMD_PUY_CMMD_TO_CDP, temp_str, NULL) ) return 1; } } break; case 111: { if (hif_card_on) { sprintf(temp_str,"%s %s %s %s ",yy6pvt[-7].value, yy6pvt[-5].value, yy6pvt[-3].value, yy6pvt[-1].value); if ( store_od(&(cf_traps[current_cf][cf_trap_count].trap_od), CMD_PUY_CMMD_TO_CDP, temp_str, NULL) ) return 1; } } break; case 112: { if (hif_card_on) { sprintf(temp_str,"%s %s %s",yy6pvt[-5].value, yy6pvt[-3].value, yy6pvt[-1].value); if ( store_od(&(cf_traps[current_cf][cf_trap_count].trap_od), CMD_PUY_CMMD_TO_CDP, temp_str, NULL) ) return 1; } } break; case 113: { if (hif_card_on) { sprintf(temp_str,"%s",yy6pvt[-1].value); if ( store_od(&(cf_traps[current_cf][cf_trap_count].trap_od), CMD_WAIT_FOR_SIGNAL, temp_str, NULL) ) return 1; } } break; case 114: { if (hif_card_on) { sprintf(temp_str,"%s",yy6pvt[-1].value); if ( store_od(&(cf_traps[current_cf][cf_trap_count].trap_od), CMD_BEEP, temp_str, NULL) ) return 1; } } break; case 115: { if (hif_card_on) { sprintf(temp_str,"%s",yy6pvt[-1].value); if ( store_od(&(cf_traps[current_cf][cf_trap_count].trap_od), CMD_CHANGE_COLOR, temp_str, NULL) ) return 1; } } break; case 116: { if (hif_card_on) { sprintf(temp_str,"%s",yy6pvt[-1].value); if ( store_od(&(cf_traps[current_cf][cf_trap_count].trap_od), CMD_CLOSE_SFILE, temp_str, NULL) ) return 1; } } break; case 117: { if (hif_card_on) { sprintf(temp_str,"%s",yy6pvt[-1].value); if ( store_od(&(cf_traps[current_cf][cf_trap_count].trap_od), CMD_OPEN_SFILE, temp_str, NULL) ) return 1; } } break; case 118: { if (hif_card_on) { sprintf(temp_str,"%s %s %s %s %s",yy6pvt[-9].value, yy6pvt[-7].value, yy6pvt[-5].value, yy6pvt[-3].value, yy6pvt[-1].value); if ( store_od(&(cf_traps[current_cf][cf_trap_count].trap_od), CMD_OPEN_MAP, temp_str, NULL) ) return 1; } } break; case 119: { if (hif_card_on) { sprintf(temp_str,"%s %s %s",yy6pvt[-5].value, yy6pvt[-3].value, yy6pvt[-1].value); if ( store_od(&(cf_traps[current_cf][cf_trap_count].trap_od), CMD_STRCPY, temp_str, NULL) ) return 1; } } break; case 120: { if (hif_card_on) { sprintf(temp_str,"%s %s",yy6pvt[-5].value, yy6pvt[-3].value); if ( store_od(&(cf_traps[current_cf][cf_trap_count].trap_od), CMD_STRCPY, temp_str, yy6pvt[-1].value) ) return 1; } } break; case 121: { if (hif_card_on) { sprintf(temp_str,"%s %s",yy6pvt[-3].value, yy6pvt[-1].value); if ( store_od(&(cf_traps[current_cf][cf_trap_count].trap_od), CMD_SET_STATUS_VAR, temp_str, NULL) ) return 1; } } break; case 122: { if (hif_card_on) { if ( store_od(&(cf_traps[current_cf][cf_trap_count].trap_od), CMD_QUEUE_SIGNAL, temp_str, NULL) ) return 1; } } break; case 123: { if (hif_card_on) { if ( store_od(&(cf_traps[current_cf][cf_trap_count].trap_od), CMD_SEND_SIGNAL, temp_str, NULL) ) return 1; } } break; case 124: { if (hif_card_on) { sprintf(temp_str,"%s %s",yy6pvt[-3].value, yy6pvt[-1].value); if ( store_od(&(cf_traps[current_cf][cf_trap_count].trap_od), CMD_HIDE_FIELD, temp_str, NULL) ) return 1; } } break; case 125: { if (hif_card_on) { sprintf(temp_str,"%s %s",yy6pvt[-3].value, yy6pvt[-1].value); if ( store_od(&(cf_traps[current_cf][cf_trap_count].trap_od), CMD_SHOW_FIELD, temp_str, NULL) ) return 1; } } break; case 126: { if (hif_card_on) { sprintf(temp_str,"%s",yy6pvt[-3].value); if ( store_od(&(cf_traps[current_cf][cf_trap_count].trap_od), CMD_REWRITE_FIELD, temp_str, yy6pvt[-1].value) ) return 1; } } break; case 127: { if (hif_card_on) { sprintf(temp_str,"%s %s",yy6pvt[-3].value, yy6pvt[-1].value); if ( store_od(&(cf_traps[current_cf][cf_trap_count].trap_od), CMD_REDRAW_SEGMENT, temp_str, NULL) ) return 1; } } break; case 128: { if (hif_card_on) { if ( store_od(&(cf_traps[current_cf][cf_trap_count].trap_od), CMD_POP_CARD, NULL, NULL) ) return 1; } } break; case 129: { if (hif_card_on) { if ( store_od(&(cf_traps[current_cf][cf_trap_count].trap_od), CMD_PUSH_CARD, NULL, NULL) ) return 1; } } break; case 130: { if (hif_card_on) { if ( store_od(&(cf_traps[current_cf][cf_trap_count].trap_od), CMD_OPEN_OBJECT, NULL, NULL) ) return 1; } } break; case 131: { if (hif_card_on) { if ( store_od(&(cf_traps[current_cf][cf_trap_count].trap_od), CMD_EXIT, NULL, NULL) ) return 1; } } break; case 132: { if (hif_card_on) { if ( store_od(&(cf_traps[current_cf][cf_trap_count].trap_od), CMD_EXIT_IIS, NULL, NULL) ) return 1; } } break; case 133: { if (hif_card_on) { sprintf(temp_str,"%s",yy6pvt[-1].value); if ( store_od(&(cf_traps[current_cf][cf_trap_count].trap_od), CMD_GO_TO_CARD_REL, temp_str, NULL) ) return 1; } } break; case 134: { if (hif_card_on) { sprintf(temp_str,"%s %s",yy6pvt[-3].value, yy6pvt[-1].value); if ( store_od(&(cf_traps[current_cf][cf_trap_count].trap_od), CMD_GO_TO_CARD, temp_str, NULL) ) return 1; } } break; case 135: { if (hif_card_on) { cf_trap_count++; } } break; case 136: { in_name = 1; } break; case 137: { in_name = 0; } break; case 138: { if (hif_card_on) { current_cs = atoi(yy6pvt[-1].value); } } break; case 140: { if (hif_card_on) { if ( (atoi(yy6pvt[-1].value) > 16) || (atoi(yy6pvt[-1].value) < 1) ) { sprintf(err_str[0],"Invalid lineColor = %s\n", yy6pvt[-1].value); sprintf(err_str[1],"LineColor values must be between 1 and 16.\n"); sprintf(err_str[2],""); rep_error(HIF); return 1; } hif_draw_segments[current_cs].lineColor = atoi(yy6pvt[-1].value) - 1; } } break; case 141: { if (hif_card_on) { if ( (atoi(yy6pvt[-1].value) > 16) || (atoi(yy6pvt[-1].value) < 1) ) { sprintf(err_str[0],"Invalid lineStyle = %s\n", yy6pvt[-1].value); sprintf(err_str[1],"LineStyle values must be between 1 and 16.\n"); sprintf(err_str[2],""); rep_error(HIF); return 1; } hif_draw_segments[current_cs].lineStyle = atoi(yy6pvt[-1].value) - 1; } } break; case 142: { if (hif_card_on) { hif_draw_segments[current_cs].lineType = yy6pvt[-1].type; } } break; case 143: { if (hif_card_on) { hif_draw_segments[current_cs].visible = yy6pvt[-1].type; } } break; case 144: { if (hif_card_on) { if ( (atoi(yy6pvt[-1].value) > 16) || (atoi(yy6pvt[-1].value) < 1) ) { sprintf(err_str[0],"Invalid fillPat = %s\n", yy6pvt[-1].value); sprintf(err_str[1],"fillPat values must be between 1 and 16.\n"); sprintf(err_str[2],""); rep_error(HIF); return 1; } hif_draw_segments[current_cs].fillPat = atoi(yy6pvt[-1].value) - 1; } } break; case 145: { if (hif_card_on) { if ( (atoi(yy6pvt[-1].value) > 16) || (atoi(yy6pvt[-1].value) < 1) ) { sprintf(err_str[0],"Invalid fillColor = %s\n", yy6pvt[-1].value); sprintf(err_str[1],"fillColor values must be between 1 and 16.\n"); sprintf(err_str[2],""); rep_error(HIF); return 1; } hif_draw_segments[current_cs].fillColor = atoi(yy6pvt[-1].value) - 1; } } break; case 146: { if (hif_card_on) { hif_draw_segments[current_cs].showFrame = yy6pvt[-1].type; } } break; case 148: { yy6val.type = CLOSED_LINE; } break; case 149: { yy6val.type = OPEN_LINE; } break; case 150: { if (hif_card_on) { if (atoi(yy6pvt[-1].value) > MAX_NUM_POINTS) { sprintf(err_str[0],"Too many points declared for draw segment line."); sprintf(err_str[1],"The max number of points is %d.",MAX_NUM_POINTS); sprintf(err_str[2],""); rep_error(HIF); return (1); } else { counting_points = 1; memset(current_point_list,0,sizeof(current_point_list)); } } } break; case 151: { unsigned char string[(MAX_NUM_POINTS*8) + 300]; unsigned char line_thickness[10], texture_str[10]; unsigned int fill_pat, rc; if (hif_card_on) { counting_points = 0; if (atoi(yy6pvt[-4].value) != current_point_count) { sprintf(err_str[0],"Number of points in card segment pointlist is %d.",current_point_count); sprintf(err_str[1],"Doesn't match declared number %d.", atoi(yy6pvt[-4].value)); sprintf(err_str[2],""); rep_error(HIF); current_point_count = 0; return 1; } current_point_count = 0; /* create line segment with no color */ /* for now only support lineStyle 1-4 */ if ( hif_draw_segments[current_cs].lineStyle < 4 ) { sprintf(line_thickness, "%d", hif_draw_segments[current_cs].lineStyle + 1); } else { /* default to 1 pixel thick line */ strcpy(line_thickness, "1"); } #ifdef OD_DEBUG printf("line_thickness is %s\n",line_thickness); #endif if ( hif_draw_segments[current_cs].lineType == OPEN_LINE ) { sprintf(string,"set segment_id [.c create line %s -fill {} -width %s -tag cardSegment]", current_point_list, line_thickness); #ifdef OD_DEBUG printf("tcl string is **%s**\n",string); #endif rc = Tcl_Eval(rep_interp, string); if (rc == TCL_ERROR) { sprintf(err_str[0],"Line segment creation returns unsuccessfully."); sprintf(err_str[1],"%s",rep_interp->result); sprintf(err_str[2],""); rep_error(HIF); return 1; } #ifdef OD_DEBUG printf("segment_id is **%d** for segment# %d\n",segment_id,current_cs); #endif hif_draw_segments[current_cs].id = segment_id; } else { /* create polygon area */ fill_pat = hif_draw_segments[current_cs].fillPat; sprintf(texture_str,"texture%d",fill_pat); sprintf(string,"set segment_id [.c create polygon %s -fill {} -stipple %s -tag cardSegment]", current_point_list, texture_str); #ifdef OD_DEBUG printf("tcl string is **%s**\n",string); #endif rc = Tcl_Eval(rep_interp, string); if (rc == TCL_ERROR) { sprintf(err_str[0],"Polygon draw segment creation returns unsuccessfully."); sprintf(err_str[1],"%s",rep_interp->result); sprintf(err_str[2],""); rep_error(HIF); return 1; } #ifdef OD_DEBUG printf("segment_id is **%d** for segment# %d\n",segment_id,current_cs); #endif hif_draw_segments[current_cs].id = segment_id; if ( hif_draw_segments[current_cs].showFrame ) { /* create the frame of the polygon */ sprintf(string,"set segment_id [.c create line %s -fill {} -width 1 -tag cardSegment]", current_point_list); #ifdef OD_DEBUG printf("tcl string is **%s**\n",string); #endif rc = Tcl_Eval(rep_interp, string); if (rc == TCL_ERROR) { sprintf(err_str[0],"Frame segment creation returns unsuccessfully."); sprintf(err_str[1],"%s",rep_interp->result); sprintf(err_str[2],""); rep_error(HIF); return 1; } #ifdef OD_DEBUG printf("frame segment_id is **%d** for segment# %d\n",segment_id,current_cs); #endif hif_draw_segments[current_cs].frame_id = segment_id; } else { hif_draw_segments[current_cs].frame_id = 0; } } /* end else */ } } break; case 152: { if (hif_card_on && counting_points) current_point_count++; } break; case 153: { if (hif_card_on && counting_points) current_point_count++; } break; case 154: { if (hif_card_on) { unsigned char this_point[10]; sprintf(this_point,"%d %d ",atoi(yy6pvt[-2].value) + NSRA_X, atoi(yy6pvt[-0].value) + NSRA_Y); strcat(current_point_list, this_point); } } break; case 155: { in_name = 1; } break; case 156: { in_name = 0; } break; case 157: { if (hif_card_on) { hif_buttons[current_cb].status_var = 0; current_cb = atoi(yy6pvt[-1].value); } } break; case 159: { if (hif_card_on) { hif_buttons[current_cb].x1 = atoi(yy6pvt[-7].value) + NSRA_X; hif_buttons[current_cb].y1 = atoi(yy6pvt[-5].value) + NSRA_Y; hif_buttons[current_cb].x2 = atoi(yy6pvt[-3].value) + NSRA_X; hif_buttons[current_cb].y2 = atoi(yy6pvt[-1].value) + NSRA_Y; } } break; case 160: { if (hif_card_on) { current_button_type = yy6pvt[-1].type; hif_buttons[current_cb].button_type = yy6pvt[-1].type; hif_buttons[current_cb].point_list = NULL; } } break; case 172: { if (hif_card_on) { if (atoi(yy6pvt[-1].value) > MAX_NUM_POINTS) { sprintf(err_str[0],"Too many points declared for polygon card button."); sprintf(err_str[1],"The max number of points is %d.",MAX_NUM_POINTS); sprintf(err_str[2],""); rep_error(HIF); return (1); } else if (current_button_type == RECTANGLE_BUTTON) { sprintf(err_str[0],"Point list found for a button declared as a rectangle"); sprintf(err_str[1],""); sprintf(err_str[2],""); rep_error(HIF); current_button_type = 0; return (1); } else { counting_points = 1; memset(current_point_list,0,sizeof(current_point_list)); } } } break; case 173: { if (hif_card_on) { counting_points = 0; if (current_point_count != atoi(yy6pvt[-4].value) ) { sprintf(err_str[0],"Number of points in card button pointlist is %d.",current_point_count); sprintf(err_str[1],"Doesn't match declared number %d.",atoi(yy6pvt[-4].value)); sprintf(err_str[2],""); rep_error(HIF); current_point_count = 0; return 1; } current_point_count = 0; if (current_point_list) { hif_buttons[current_cb].point_list = malloc(strlen(current_point_list) + 1); strcpy(hif_buttons[current_cb].point_list, current_point_list); } } } break; case 174: { if (hif_card_on && counting_points) current_point_count++; } break; case 175: { if (hif_card_on && counting_points) current_point_count++; } break; case 176: { if (hif_card_on) { unsigned char this_point[10]; int x, y; x = atoi(yy6pvt[-2].value) + NSRA_X; y = atoi(yy6pvt[-0].value) + NSRA_Y; if ( (x < hif_buttons[current_cb].x1) || (x > hif_buttons[current_cb].x2) || (y < hif_buttons[current_cb].y1) || (y > hif_buttons[current_cb].y2) ) { sprintf(err_str[0],"Point outside of bounding box for polygon button."); sprintf(err_str[1],"Point is %d, %d for button #%d",atoi(yy6pvt[-2].value),atoi(yy6pvt[-0].value),current_cb); sprintf(err_str[2],""); rep_error(HIF); return 1; } sprintf(this_point,"%d %d ", x, y); strcat(current_point_list, this_point); } } break; case 177: { if (hif_card_on) { counting_od = 1; cb_trap_count = 0; hif_buttons[current_cb].OD = od_num++; } } break; case 178: { int num; if (hif_card_on) { counting_od = 0; num = atoi(yy6pvt[-4].value); if (num != current_od_count) { sprintf(err_str[0],"Number of lines in button script is %d.",current_od_count); sprintf(err_str[1],"Doesn't match declared number %d.",num); sprintf(err_str[2],""); rep_error(HIF); counting_od = 0; current_od_count = 0; return 1; } current_od_count = 0; } } break; case 179: { if (hif_card_on && counting_od) current_od_count++; } break; case 180: { if (hif_card_on && counting_od) current_od_count++; } break; case 181: { if (hif_card_on) # ifdef OD_DEBUG printf("Storing card_button_od: CMD_START_TRAP\n"); printf("trap_signal = %d\n",atoi(yy6pvt[-5].value)); printf("object_status_var = %d\n",atoi(yy6pvt[-3].value)); printf("mask = %d\n",atoi(yy6pvt[-1].value)); # endif { cb_traps[current_cb][cb_trap_count].trap_signal = atoi(yy6pvt[-5].value); cb_traps[current_cb][cb_trap_count].object_status_var = atoi(yy6pvt[-3].value); cb_traps[current_cb][cb_trap_count].mask = atoi(yy6pvt[-1].value); } } break; case 182: { if (hif_card_on) { sprintf(temp_str,"%s %s %s",yy6pvt[-5].value, yy6pvt[-3].value, yy6pvt[-1].value); if ( store_od(&(cb_traps[current_cb][cb_trap_count].trap_od), CMD_GOTO_RECORD, temp_str, NULL) ) return 1; } } break; case 183: { if (hif_card_on) { sprintf(temp_str,"%s %s %s %s",yy6pvt[-7].value, yy6pvt[-5].value, yy6pvt[-3].value, yy6pvt[-1].value); if ( store_od(&(cb_traps[current_cb][cb_trap_count].trap_od), CMD_SEARCH_INDEX, temp_str, NULL) ) return 1; } } break; case 184: { if (hif_card_on) { # ifdef OD_DEBUG printf("Storing card_od: CMD_CD_PLAYER\n"); # endif if ( store_od(&(cb_traps[current_cb][cb_trap_count].trap_od), CMD_CD_PLAYER, temp_str, NULL) ) return 1; } } break; case 185: { if (hif_card_on) { sprintf(temp_str,"%s %s %s %s %s",yy6pvt[-9].value, yy6pvt[-7].value, yy6pvt[-5].value, yy6pvt[-3].value, yy6pvt[-1].value); if ( store_od(&(cb_traps[current_cb][cb_trap_count].trap_od), CMD_PUY_CMMD_TO_CDP, temp_str, NULL) ) return 1; } } break; case 186: { if (hif_card_on) { sprintf(temp_str,"%s %s %s %s ",yy6pvt[-7].value, yy6pvt[-5].value, yy6pvt[-3].value, yy6pvt[-1].value); if ( store_od(&(cb_traps[current_cb][cb_trap_count].trap_od), CMD_PUY_CMMD_TO_CDP, temp_str, NULL) ) return 1; } } break; case 187: { if (hif_card_on) { sprintf(temp_str,"%s %s %s",yy6pvt[-5].value, yy6pvt[-3].value, yy6pvt[-1].value); if ( store_od(&(cb_traps[current_cb][cb_trap_count].trap_od), CMD_PUY_CMMD_TO_CDP, temp_str, NULL) ) return 1; } } break; case 188: { if (hif_card_on) { sprintf(temp_str,"%s",yy6pvt[-1].value); if ( store_od(&(cb_traps[current_cb][cb_trap_count].trap_od), CMD_WAIT_FOR_SIGNAL, temp_str, NULL) ) return 1; } } break; case 189: { if (hif_card_on) { sprintf(temp_str,"%s",yy6pvt[-1].value); if ( store_od(&(cb_traps[current_cb][cb_trap_count].trap_od), CMD_BEEP, temp_str, NULL) ) return 1; } } break; case 190: { if (hif_card_on) { sprintf(temp_str,"%s",yy6pvt[-1].value); if ( store_od(&(cb_traps[current_cb][cb_trap_count].trap_od), CMD_CHANGE_COLOR, temp_str, NULL) ) return 1; } } break; case 191: { if (hif_card_on) { sprintf(temp_str,"%s",yy6pvt[-1].value); if ( store_od(&(cb_traps[current_cb][cb_trap_count].trap_od), CMD_CLOSE_SFILE, temp_str, NULL) ) return 1; } } break; case 192: { if (hif_card_on) { sprintf(temp_str,"%s",yy6pvt[-1].value); if ( store_od(&(cb_traps[current_cb][cb_trap_count].trap_od), CMD_OPEN_SFILE, temp_str, NULL) ) return 1; } } break; case 193: { if (hif_card_on) { sprintf(temp_str,"%s %s %s %s %s",yy6pvt[-9].value, yy6pvt[-7].value, yy6pvt[-5].value, yy6pvt[-3].value, yy6pvt[-1].value); if ( store_od(&(cb_traps[current_cb][cb_trap_count].trap_od), CMD_OPEN_MAP, temp_str, NULL) ) return 1; } } break; case 194: { if (hif_card_on) { sprintf(temp_str,"%s %s %s",yy6pvt[-5].value, yy6pvt[-3].value, yy6pvt[-1].value); if ( store_od(&(cb_traps[current_cb][cb_trap_count].trap_od), CMD_STRCPY, temp_str, NULL) ) return 1; } } break; case 195: { if (hif_card_on) { sprintf(temp_str,"%s %s",yy6pvt[-5].value, yy6pvt[-3].value); if ( store_od(&(cb_traps[current_cb][cb_trap_count].trap_od), CMD_STRCPY, temp_str, yy6pvt[-1].value) ) return 1; } } break; case 196: { if (hif_card_on) { sprintf(temp_str,"%s %s",yy6pvt[-3].value, yy6pvt[-1].value); if ( store_od(&(cb_traps[current_cb][cb_trap_count].trap_od), CMD_SET_STATUS_VAR, temp_str, NULL) ) return 1; } } break; case 197: { if (hif_card_on) { if ( store_od(&(cb_traps[current_cb][cb_trap_count].trap_od), CMD_QUEUE_SIGNAL, temp_str, NULL) ) return 1; } } break; case 198: { if (hif_card_on) { if ( store_od(&(cb_traps[current_cb][cb_trap_count].trap_od), CMD_SEND_SIGNAL, temp_str, NULL) ) return 1; } } break; case 199: { if (hif_card_on) { sprintf(temp_str,"%s %s",yy6pvt[-3].value, yy6pvt[-1].value); if ( store_od(&(cb_traps[current_cb][cb_trap_count].trap_od), CMD_HIDE_FIELD, temp_str, NULL) ) return 1; } } break; case 200: { if (hif_card_on) { sprintf(temp_str,"%s %s",yy6pvt[-3].value, yy6pvt[-1].value); if ( store_od(&(cb_traps[current_cb][cb_trap_count].trap_od), CMD_SHOW_FIELD, temp_str, NULL) ) return 1; } } break; case 201: { if (hif_card_on) { sprintf(temp_str,"%s",yy6pvt[-3].value); if ( store_od(&(cb_traps[current_cb][cb_trap_count].trap_od), CMD_REWRITE_FIELD, temp_str, yy6pvt[-1].value) ) return 1; } } break; case 202: { if (hif_card_on) { sprintf(temp_str,"%s %s",yy6pvt[-3].value, yy6pvt[-1].value); if ( store_od(&(cb_traps[current_cb][cb_trap_count].trap_od), CMD_REDRAW_SEGMENT, temp_str, NULL) ) return 1; } } break; case 203: { if (hif_card_on) { if ( store_od(&(cb_traps[current_cb][cb_trap_count].trap_od), CMD_POP_CARD, NULL, NULL) ) return 1; } } break; case 204: { if (hif_card_on) { if ( store_od(&(cb_traps[current_cb][cb_trap_count].trap_od), CMD_PUSH_CARD, NULL, NULL) ) return 1; } } break; case 205: { if (hif_card_on) { if ( store_od(&(cb_traps[current_cb][cb_trap_count].trap_od), CMD_OPEN_OBJECT, NULL, NULL) ) return 1; } } break; case 206: { if (hif_card_on) { if ( store_od(&(cb_traps[current_cb][cb_trap_count].trap_od), CMD_EXIT, NULL, NULL) ) return 1; } } break; case 207: { if (hif_card_on) { if ( store_od(&(cb_traps[current_cb][cb_trap_count].trap_od), CMD_EXIT_IIS, NULL, NULL) ) return 1; } } break; case 208: { if (hif_card_on) { sprintf(temp_str,"%s",yy6pvt[-1].value); if ( store_od(&(cb_traps[current_cb][cb_trap_count].trap_od), CMD_GO_TO_CARD_REL, temp_str, NULL) ) return 1; } } break; case 209: { if (hif_card_on) { sprintf(temp_str,"%s %s",yy6pvt[-3].value, yy6pvt[-1].value); if ( store_od(&(cb_traps[current_cb][cb_trap_count].trap_od), CMD_GO_TO_CARD, temp_str, NULL) ) return 1; } } break; case 210: { if (hif_card_on) { cb_trap_count++; } } break; case 211: { yy6val.type = 1; } break; case 212: { yy6val.type = 0; } break; case 213: { yy6val.type = POLYGON_BUTTON; } break; case 214: { yy6val.type = RECTANGLE_BUTTON; } break; } goto yy6stack; /* reset registers in driver code */ }