Index: src/fileio.cc =================================================================== RCS file: /usr/proj3/case/95s523/95sbde/base/Master/bde/src/fileio.cc,v retrieving revision 1.39 diff -b -i -t -w -r1.39 fileio.cc 3c3 < // line 1688: dostate inits to Node Create; TBD: make it Node Move or HG_select? --- > // line 2163: dostate inits to Node Create; TBD: make it Node Move or HG_select? 682a683 > 712c713 < // 94sbde_schema.h: #include "dprint.h" --- > // and in 94sbde_schema.h: #include "dprint.h" 726d726 < 728a729 > /* But why declare them here? no longer called in fileio.cc -RJL060726*/ 734c735 < #endif --- > #endif //BDELOG 738,739c739 < //extern void SetStateOfGraphExistence(int);//GraphIsDisplayed now-RJL 031023 < void updatedisplaylist(struct HG *cHG); --- > void updatedisplaylist(struct HG *cHG);//fwd ref 822c822 < --- > /* TBD: make printrowcounts viewname-generic and move it to pr_util_*log. */ 829c829,834 < void printrowcounts(char* viewname) --- > /* Clients (060805): CreateHGDialogBox and real_load, in fileio.cc. */ > /* CLient of: find_view_idx(viewname) (via get_rcount macro) */ > /* Uses hcg_view_idx from find_view_idx and hcg_table_idx from find_tbl_idx;*/ > /* get_rcount REQUIRES find_tbl_idx to update hcg_tbl_idx.*/ > /* E.g.: in get_rcount: ((find_view_idx(viewname)&&find_tbl_idx(#tbl)) ? */ > void printrowcounts(char* viewname) /*:831-855:)*/ 837,846c842,851 < dprintsd("\t%s:\t%d\n", "FO", pr_rcount("94sbdeview", FO)); < dprintsd("\t%s:\t%d\n", "GD", pr_rcount("94sbdeview", GD)); < dprintsd("\t%s:\t%d\n", "HG", pr_rcount("94sbdeview", HG)); < dprintsd("\t%s:\t%d\n", "HN", pr_rcount("94sbdeview", HN)); < dprintsd("\t%s:\t%d\n", "HA", pr_rcount("94sbdeview", HA)); < dprintsd("\t%s:\t%d\n", "HL", pr_rcount("94sbdeview", HL)); < dprintsd("\t%s:\t%d\n", "HP", pr_rcount("94sbdeview", HP)); < dprintsd("\t%s:\t%d\n", "HI", pr_rcount("94sbdeview", HI)); < dprintsd("\t%s:\t%d\n", "CG", pr_rcount("94sbdeview", CG)); < dprintsd("\t%s:\t%d\n", "GX", pr_rcount("94sbdeview", GX)); --- > dprintsd("\t%s:\t%d\n", "FO", get_rcount("94sbdeview", FO)); > dprintsd("\t%s:\t%d\n", "GD", get_rcount("94sbdeview", GD)); > dprintsd("\t%s:\t%d\n", "HG", get_rcount("94sbdeview", HG)); > dprintsd("\t%s:\t%d\n", "HN", get_rcount("94sbdeview", HN)); > dprintsd("\t%s:\t%d\n", "HA", get_rcount("94sbdeview", HA)); > dprintsd("\t%s:\t%d\n", "HL", get_rcount("94sbdeview", HL)); > dprintsd("\t%s:\t%d\n", "HP", get_rcount("94sbdeview", HP)); > dprintsd("\t%s:\t%d\n", "HI", get_rcount("94sbdeview", HI)); > dprintsd("\t%s:\t%d\n", "CG", get_rcount("94sbdeview", CG)); > dprintsd("\t%s:\t%d\n", "GX", get_rcount("94sbdeview", GX)); 852c857 < LP;} // end printrowcounts --- > LP;} // end printrowcounts (:831-855:) 854c859 < /* --- > /* :854- 883,884d887 < < 894,895c897 < Note that the widget does not get mananged. < --- > Note that the widget does not get managed. 897,898c899,903 < */ < --- > */ // fileio.cc:897-933 > // Bug060615-26: getenv("DEFAULT_LIB_PATH") call inside Xm/XT arg1 > // is truncated to "D" or to "FAULT_LIB_PATH"! ?? > // I removed direct defin. DEFAULT_LIB_PATH = '../lib' in fileio.cc(-r1.6?) > // since getenv looks elsewhere for that. - RJL060626 904c909 < --- > char* tempDLibPath; 907a913,931 > DP; // Error Msg (Linux060621.2225): No symbol "argv" in current context. > tempDLibPath = getenv("DEFAULT_LIB_PATH"); > dprints("DEFAULT_LIB_PATH from getenv(\"DEFAULT_LIB_PATH\") is %s\n", > tempDLibPath); > // setenv( DEFAULT_LIB_PATH, "../lib", 0); //saturn: g++ aborts: - RJL060705: > // fileio.cc:912: implicit declaration of function `int setenv(...)' > > #if 0 > if (tempDLibPath!=NULL) { > dprints("getenv(\"DEFAULT_LIB_PATH\") returns %s\n", > getenv("DEFAULT_LIB_PATH")); > } > else { > tempDLibPath = "../lib"; > setenv( DEFAULT_LIB_PATH, "../lib", 1); > dprints("getenv(\"DEFAULT_LIB_PATH|\") is NULL ptr. Using %s\n", tempDLibPath); > } > #endif > 928c952 < LP;} // end create_load_dialogbox --- > LP;} // end create_load_dialogbox (:854-947:) 1025c1049 < * Function :real_saveas (998-1083) --- > * Function :real_saveas (1049-1133) 1032c1056 < /*:1002-1079 : */ --- > /*:1056-1133 : */ 1068c1092 < // FOloaded = 0; // reset to indicate table FO not loaded (why? -RJL050606) --- > // FOloaded = 0; // reset to indicate table FO was deleted -RJL050606) 1109c1133 < LP;} // end real_saveas 1002-1079 --- > LP;} // end real_saveas 1049-1133 1125a1150,1154 > /* canvas-drawing-related functions : fileio.cc:1145- > * > * (TBD: move to new canvasio.cc ?) > */ > 1165c1194 < void clearObjects() --- > void clearObjects() /* :1194: */ 1270c1299 < HGrowcnt = pr_rcount("94sbdeview", HG);//indep of HG* HG==NULL-RJL060228 --- > HGrowcnt = get_rcount("94sbdeview", HG);//indep of HG* HG==NULL-RJL060228 1438c1467 < * --- > * fileio.cc:1443-1494; 1467c1496 < assert(HNcurr != NULL); //RJL060309 --- > assert(HNcurr != NULL); //RJL060309 (loop is skipped if no children) 1552c1581 < /*********************** (1522- *********************************** --- > /*********************** (1557-1629) *********************************** 1559a1589,1591 > * Post-conditions: > * Updates HGcurr > * (:1627) returns 1 and displays selected row, or (:1607)returns 0. 1563c1595 < **************************************************************************/ --- > ************************************************************************/ 1567,1568c1599,1600 < int i; < int RealDisplayGraph(char* tmptr) --- > int i; //:1572 > int RealDisplayGraph(char* tmptr) //fileio.cc :1573-1629 1587c1619 < for (i=2; i<8; i++) assert(isdigit(hg_string[i])); --- > for (i=2; i LP;return(0);//:1607 1615d1646 < 1618d1648 < 1622,1624c1652,1654 < LP;return(1); < } // end if HGcurr!=0 < LP;} // end RealDisplayGraph (1522-1594) --- > LP;return(1);//1627 > } // end if HGcurr!=NULL > LP;} // end RealDisplayGraph (1573-1629) 1661c1691 < /********************* 1631-1860 ***************************************** --- > /********************* 1667-1909 ***************************************** 1692c1722 < void CreateHGDialogBox(char *infile) --- > void CreateHGDialogBox(char *infile) //:1698-1909 1697a1728,1730 > // Bug 2006: HG table fails to display, HGrow not selectable. > // bdelog skips this if HGrow is a singleton, bde does not. > // WHY CALL pr_init and pr_load INSIDE this fcn??????-RJL060507 1707c1740 < int number_of_graphs; // update to pr_rcount("94sbdeview", HG) --- > int number_of_graphs; // update via get_rcount("94sbdeview", HG) 1753c1786 < } // end 'if infile == NULL' --- > } // end 'if infile == NULL'; 1755c1788,1789 < else //pr_init and pr_load infile. (Is fopen guaranteed to pass?-RJL060304) --- > if (infile != NULL) //test again: infile MAY be non-NULL current_filename now.- RJL060508 > //pr_init and pr_load infile. (Is fopen guaranteed to pass?-RJL060304) 1774c1808 < HGrowcnt = pr_rcount("94sbdeview", HG);//indep of HG* HG==NULL --- > HGrowcnt = get_rcount("94sbdeview", HG);//indep of HG* HG==NULL; see:1819 numberofgraphs 1775a1810,1811 > DP;dprint("Calling pr_dump to bdeabort.dat \n"); > DP; pr_dump("94sbdeview", "bdeabort.dat", new_version, "w"); 1810,1811c1846,1847 < // TBD: pr_load(view, {infile or current_filename})? < // What is pr_rcount(..,HG) if infile is empty? (is number_of_graphs==0?) --- > // TBD: pr_load(view, {infile or current_filename})? (done above) > // What is get_rcount(..,HG) if infile is empty? (is number_of_graphs==0?) 1813,1815c1849,1851 < < number_of_graphs = pr_rcount("94sbdeview", HG); // valid AFTER pr_loading? < DP;dprintd("pr_rcount(viewname, HG) is %d\n", number_of_graphs); --- > //Next line 1819 equiv. to line 1778 HGrowcnt above? > number_of_graphs = get_rcount("94sbdeview", HG); // valid AFTER pr_loading? > DP;dprintd("get_rcount(viewname, HG) is %d\n", number_of_graphs); 1829c1865 < LP;return; //:1787; was :1628 --- > LP;return; //:1841; was :1787; was :1628 1832c1868,1870 < //else more than one HG-row: --- > //else more than one HG-row: [or NO HGrows - RJL060511] > else if (number_of_graphs >= 2) { > 1840c1878 < table_loop("94sbdeview", HG) /* get character info from each HG row */ --- > table_loop("94sbdeview", HG) /* get character info from each HG row [if any] */ 1889,1890c1927,1933 < < LP;} // end CreateHGDialogBox - lines 1631-1860: --- > } // end (>= 2 HG-rows) > else { > displayMessage("No HG-rows were found in this file - exit or redo FILE OPEN"); > dprint("No HG-rows were found in this file - exit or redo FILE OPEN\n"); > LP;return; > } // end No HG-rows > LP;} // end CreateHGDialogBox - lines 1698-1909: 1911c1954 < //(:1877-1918:) --- > //(:1930-1971:) 1932c1975 < else --- > else //NULL char* error_msg: clear canvas: 1952c1995 < LP;} // end real_load (:1877-1918:) --- > LP;} // end real_load (:1930-1971:) 2005,2006c2048 < LP;} < --- > LP;} // end help_dialog 2008c2050 < /******************* 1978:2105 ******************************************** --- > /******************* 1978:2105 -->2044- *********************************** 2162c2204 < char filename[PATH_MAX /*+ FILENAME_MAX*/]; // maximum path space allocated --- > char filename[PATH_MAX]; /*+ FILENAME_MAX?*/ // maximum path space allocated 2180c2222,2224 < // not present, a null pointer is returned. --- > // not present, a null pointer is returned (not a ptr to null string - RJL060626). > // 5 SLOC below skipped 0606?? to 060625, restored 060626: > if (getenv("DEFAULT_LIB_PATH") != (char*)NULL) 2182c2226 < if (LibPath == (char*)NULL) //work-around if getenv fails. --- > else //work-around if getenv fails. 2183a2228,2229 > //strcpy(LibPath,getenv("DEFAULT_LIB_PATH")); > /* (:2220:) */ 2222c2268 < /*************************** 2177-2208 ************************************* --- > /*************************** 2177-2208 -->2264-2294 ************************* 2252c2298 < LP;} // end dosave :2177-2208 --- > LP;} // end dosave :2177-2208 --> 2264-2294 2254,2255c2300 < < ///////////////////////////////////////////////////////////////////// --- > ////////////////////////:2297-2893 EOF:///////////////////////////////////// 2443c2488 < LP;} // end GetBDENewDatFile --- > LP;} // end GetBDENewDatFile fileio.cc:-2485 2474c2519 < char LibPath[PATH_MAX] = "";; // PATH_MAX=1023, in --- > char LibPath[PATH_MAX] = ""; // PATH_MAX=1023, in 2481,2485c2526,2537 < // if (LibPath == (char*)NULL) < // strcpy(LibPath, getenv("DEFAULT_LIB_PATH")); < if (getenv("DEFAULT_LIB_PATH")== (char*)NULL) //getenv returns NULL on fail < strcpy(LibPath, "../lib/"); //make the path "../lib" < else strcpy(LibPath, getenv("DEFAULT_LIB_PATH"));//use DEFAULT_LIB_PATH --- > #if 0 > if ( getenv("DEFAULT_LIB_PATH")!= (char*)NULL) { > if (strlen((char*)getenv("DEFAULT_LIB_PATH")) > 0) > strcpy(LibPath, getenv("DEFAULT_LIB_PATH")); // custom path > } > #endif > //Above buggy; Replacement below is from GetBDENewDatFile .-RJL060615 > if (getenv("DEFAULT_LIB_PATH")!= (char*)NULL) > strcpy(LibPath, getenv("DEFAULT_LIB_PATH")); > else > strcpy(LibPath, "../lib"); > 2714c2766 < //:2672-2712) --- > //:2714-2754) 2735c2787 < else --- > else // NULL char* error_msg: 2754c2806 < LP;} // end real_replay (:2672-2712) --- > LP;} // end real_replay (:2714-2754) 2758c2810 < /*************************** 2531:2583 ************************************** --- > /***************************************************************** 2780c2832 < void Replay_LoadGraph(char *infile) // (:2750-2815:) --- > void Replay_LoadGraph(char *infile) // (:2828-2894:) 2819c2871 < HGrowcnt = pr_rcount("94sbdeview", HG);//indep of HG* HG==NULL --- > HGrowcnt = get_rcount("94sbdeview", HG);//indep of HG* HG==NULL 2845c2897 < LP;} // end Replay_LoadGraph (:2750-2815:) --- > LP;} // end Replay_LoadGraph (:2828-2894:)