28c28 < extern int pr_replay(char*, char*, int, int); --- > extern int pr_replay(char *, char *, int, int); 110c110 < if (strncmp(pkey,hcg_table_seq_list[hcg_tbl_idx].ttabbrev,HCG_ABBR_SIZE) == 0) --- > if (strncmp(pkey,hcg_table_seq_list[hcg_tbl_idx].ttabbrev,HCG_ABBR_SIZE) == 0) 112,113c112,113 < for (hcg_tbl_idx=0; hcg_tbl_idx < HCG_NUM_TABLES; hcg_tbl_idx++) < if (strncmp(pkey,hcg_table_seq_list[hcg_tbl_idx].ttabbrev,HCG_ABBR_SIZE) == 0) --- > for (hcg_tbl_idx=0; hcg_tbl_idx < HCG_NUM_TABLES; hcg_tbl_idx++) > if (strncmp(pkey,hcg_table_seq_list[hcg_tbl_idx].ttabbrev,HCG_ABBR_SIZE) == 0) 115,116c115,116 < hcg_tbl_idx = 0; < return(0); --- > hcg_tbl_idx = 0; > return(0); 127c127 < if (strcmp(viewname,hcg_view_list.view_list[hcg_view_idx].view_name) == 0) --- > if (strcmp(viewname,hcg_view_list.view_list[hcg_view_idx].view_name) == 0) 129,130c129,130 < for (hcg_view_idx=0; hcg_view_idx < hcg_view_list.num_views; hcg_view_idx++) < { if (strcmp(viewname,hcg_view_list.view_list[hcg_view_idx].view_name) == 0) --- > for (hcg_view_idx=0; hcg_view_idx < hcg_view_list.num_views; hcg_view_idx++) > { if (strcmp(viewname,hcg_view_list.view_list[hcg_view_idx].view_name) == 0) 132,134c132,134 < } < hcg_view_idx = 0; < return(0); --- > } > hcg_view_idx = 0; > return(0); 1582c1582 < { --- > { 1585,1587c1585,1587 < } < lut_init(&hcg_table_abbrev_lut, ABBR_TBL_TYPE); < abbr_lut_create(&hcg_table_abbrev_lut, hcg_tbl_abbr, HCG_NUM_TABLES); --- > } > lut_init(&hcg_table_abbrev_lut, ABBR_TBL_TYPE); > abbr_lut_create(&hcg_table_abbrev_lut, hcg_tbl_abbr, HCG_NUM_TABLES); 1590,1591c1590,1591 < { hcg_table_seq_list[hcg_tbl_idx].rcount = < hcg_table_seq_list[hcg_tbl_idx].maxver = 0; --- > { hcg_table_seq_list[hcg_tbl_idx].rcount = > hcg_table_seq_list[hcg_tbl_idx].maxver = 0; 1593,1594c1593,1595 < for(i=0; i < MAXVIEWS; i++) < hcg_view_list.view_list[i].view_name[0]='\0'; --- > > for(i=0; i < MAXVIEWS; i++) > hcg_view_list.view_list[i].view_name[0]='\0'; 1637c1638 < } --- > } 1640c1641 < printf("Warning: invalid keysize %d for key %s, must be %d, ignored.\n", (int)strlen(hcg_t), hcg_t, HCG_KEY_SIZE); --- > printf("Warning: invalid keysize %d for key %s, must be %d, ignored.\n", (int)strlen(hcg_t), hcg_t, HCG_KEY_SIZE); 1643c1644 < } --- > } 1645,1647c1646,1648 < if(HCG_KEY_SIZE == 8) < ver_chars = 2; < else ver_chars = 3; --- > if(HCG_KEY_SIZE == 8) > ver_chars = 2; > else ver_chars = 3; 2259,2262c2260 < void do_pr_add (char* viewname, char* tbl_abbrv, hcg_ptr tbl_ptr) < //char viewname[]; < //char tbl_abbrv[]; < //hcg_ptr tbl_ptr; --- > void do_pr_add (char *viewname, char *tbl_abbrv, hcg_ptr tbl_ptr) 2435c2433 < int load_data(char* viewname) --- > int load_data( char *viewname) 2450,2466c2448,2457 < /* Get the first token and check for ["SR" or] a pkey: < * RJL 020501: Here is where we need to insert a hook that < * recognizes the "SR" command instead of encoding it as a pkey, < * and returns from load_data. pr_load closes the file and exits now. < * Load_data returns doReplay= 1 or 0 so pr_load can call pr_replay < * atfter closing the file. pr_replay is at pr_log.c:2011 - RJL 020502 . < */ < if (strlen(hcg_t) == 2) { < if (strcmp(hcg_t, "SR") == 0) { < #ifdef DEBUG < printf(StartLog command found: \n"); < printf(Replay logfile is %s\n", logfile); < #endif < return 1; < } < } < else --- > if ( strlen(hcg_t) == 2 ) { > if( strcmp( hcg_t, "SR") == 0 ) { > #ifdef DEBUG > printf("StartLog command found: \n"); > printf("Replay logfile is %s \n", logfile); > #endif > return 1; > } > } > else 2470,2471c2461 < printf("Warning: unknown table (%s) found in datafile, ignored.\n", < temp_verstring); --- > printf("Warning: unknown table (%s) found in datafile, ignored.\n",temp_verstring); 2478,2480c2468 < printf( < "Warning:invalid key ignored: size %d, key=%s must be %d.\n", < (int)strlen(hcg_t), hcg_t, HCG_KEY_SIZE); --- > printf("Warning: invalid keysize %d for key %s, must be %d, ignored.\n", (int)strlen(hcg_t), hcg_t, HCG_KEY_SIZE); 2486c2474 < ver_chars = 2; --- > ver_chars = 2; 2500,2501c2488,2489 < if (((char) hcg_version) != < hcg_view_list.view_list[hcg_view_idx].version_list[hcg_tbl_idx]) --- > > if (((char) hcg_version) != hcg_view_list.view_list[hcg_view_idx].version_list[hcg_tbl_idx]) 2520c2508 < } // end load_data --- > } 2530,2532c2518 < < void pr_parse (char viewname[], char buffer[], < int tbl_encoding, int idx, hcg_key hcg_k) --- > void pr_parse (char viewname[], char buffer[], int tbl_encoding, int idx, hcg_key hcg_k) 2738c2724 < }; // end switch --- > } 2740c2726 < } // end pr_parse --- > } 2754,2759c2740,2744 < int doReplay; /* flag: true => replay takes over */ < /* RJL 020502: I made logging of pr_load conditional on hcg_log==1 */ < if (hcg_log==1) { < logwait(); < sprintf(log_text,"LD %s %s\n", viewname, file_name); < logstr(log_text); --- > int doReplay; > if ( hcg_log == 1 ) { > logwait(); > sprintf(log_text,"LD %s %s\n", viewname, file_name); > logstr(log_text); 2761,2762c2746 < } < --- > } 2765c2749 < printf("Error: pr_load() called when database is not yet initialized.\n"); --- > printf("Error: pr_load() called when database is not yet initialized.\n"); 2769,2773c2753,2757 < if (!find_view_idx(viewname)) < { < printf("Error: view %s passed to pr_load is not defined.\n",viewname); < exit(2); < } --- > if (!find_view_idx(viewname)) > { > printf("Error: view %s passed to pr_load is not defined.\n",viewname); > exit(2); > } 2776,2777c2760,2761 < printf("can not open %s\n", file_name); < exit(2); --- > printf("can not open %s\n", file_name); > exit(2); 2780,2784d2763 < < /* RJL 020501: if load_data returns flag doReplay < * then pr_replay is called after fclose: < * see note at start of pr_replay. < */ 2786,2796c2765,2768 < /* prepare to replay this logfile (a callback calls replay_log) */ < /* pr_replay arg2 = near_realtime, arg3 = int take_endsnapshot */ < /* this will never return - X11 does it now - RJL 020506: */ < if (doReplay) { /* load_data found "SR" command: */ < replayStatus = pr_replay(viewname, file_name, 1 /*near_realtime*/, < 1 /*take_endsnapshot*/); //RJL 020506 (last 2 args were reversed) < /* this will never return - X11 does callback - RJL 020506 */ < } < < } // end pr_load < --- > if( doReplay ) { > replayStatus = pr_replay(viewname, file_name, 1, 1); > } > }