Fix: SE029 Problem: FHS 2.0 support should have a seperate file area for human readable documentation (currently license and Guidebook.txt are included in this category). Compatible with: Slash'EM 0.0.5E7 Author: J. Ali Harlow, ali@avrc.city.ac.uk Date: 3 Dec 1999 *** doc/window.doc.orig Thu Dec 2 15:00:45 1999 --- doc/window.doc Thu Dec 2 18:01:28 1999 *************** *** 172,180 **** player_selection() offers a Quit option, it is its responsibility to clean up and terminate the process. You need to fill in pl_character[0]. display_file(str, boolean complain) -- Display the file named str. Complain about missing files ! iff complain is TRUE. update_inventory() -- Indicate to the window port that the inventory has been changed. --- 172,188 ---- player_selection() offers a Quit option, it is its responsibility to clean up and terminate the process. You need to fill in pl_character[0]. + #ifdef FILE_AREAS + display_file(area, str, boolean complain) + #else display_file(str, boolean complain) + #endif -- Display the file named str. Complain about missing files ! iff complain is TRUE. If FILE_AREAS is defined then the ! file should be found in the named area. Note that vanilla ! does not define FILE_AREAS and therefore window ports ! defined in this way will be compatible with both Slash'EM ! and vanilla NetHack. update_inventory() -- Indicate to the window port that the inventory has been changed. *** include/global.h.orig Thu Dec 2 15:00:45 1999 --- include/global.h Fri Dec 3 13:54:26 1999 *************** *** 34,40 **** #define HISTORY "history" /* a file giving nethack's history */ #define HISTORY_AREA FILE_AREA_SHARE #define LICENSE "license" /* file with license information */ ! #define LICENSE_AREA FILE_AREA_SHARE #define OPTIONFILE "opthelp" /* a file explaining runtime options */ #define OPTIONAREA FILE_AREA_SHARE #define OPTIONS_USED "options" /* compile-time options, for #version */ --- 34,40 ---- #define HISTORY "history" /* a file giving nethack's history */ #define HISTORY_AREA FILE_AREA_SHARE #define LICENSE "license" /* file with license information */ ! #define LICENSE_AREA FILE_AREA_DOC #define OPTIONFILE "opthelp" /* a file explaining runtime options */ #define OPTIONAREA FILE_AREA_SHARE #define OPTIONS_USED "options" /* compile-time options, for #version */ *************** *** 44,50 **** #else #define GUIDEBOOK "Guidebook.txt" /* Nethack Guidebook*/ #endif ! #define GUIDEBOOK_AREA FILE_AREA_SHARE #define LEV_EXT ".lev" /* extension for special level files */ --- 44,50 ---- #else #define GUIDEBOOK "Guidebook.txt" /* Nethack Guidebook*/ #endif ! #define GUIDEBOOK_AREA FILE_AREA_DOC #define LEV_EXT ".lev" /* extension for special level files */ *** include/qt_win.h.orig Thu Dec 2 15:00:45 1999 --- include/qt_win.h Thu Dec 2 18:21:30 1999 *************** *** 702,708 **** --- 702,712 ---- static void qt_destroy_nhwindow(winid wid); static void qt_curs(winid wid, int x, int y); static void qt_putstr(winid wid, int attr, const char *text); + #ifdef FILE_AREAS + static void qt_display_file(const char *filearea, const char *filename, BOOLEAN_P must_exist); + #else static void qt_display_file(const char *filename, BOOLEAN_P must_exist); + #endif static void qt_start_menu(winid wid); static void qt_add_menu(winid wid, int glyph, const ANY_P * identifier, CHAR_P ch, CHAR_P gch, int attr, *** include/trampoli.h.orig Thu Dec 2 15:00:45 1999 --- include/trampoli.h Thu Dec 2 18:23:11 1999 *************** *** 313,319 **** --- 313,323 ---- #define tty_destroy_nhwindow(x) tty_destroy_nhwindow_(x) #define tty_curs(x,y,z) tty_curs_(x,y,z) #define tty_putstr(x,y,z) tty_putstr_(x,y,z) + #ifdef FILE_AREAS + #define tty_display_file(x,y,z) tty_display_file_(x,y,z) + #else #define tty_display_file(x,y) tty_display_file_(x,y) + #endif #define tty_start_menu(x) tty_start_menu_(x) #define tty_add_menu(a,b,c,d,e,f,g,h) tty_add_menu_(a,b,c,d,e,f,g,h) #define tty_end_menu(a,b) tty_end_menu_(a,b) *** include/unixconf.h.orig Thu Dec 2 15:00:45 1999 --- include/unixconf.h Fri Dec 3 14:07:03 1999 *************** *** 80,86 **** * * File areas can be used to place different Slash'EM files in different * directories. This is necessary to comply with Linux's FSSTD 1.2 and its ! * replacement FS 2.0. Currently, these are only implemented for UNIX, but * other ports could follow suit by including similar defines in their port * specific config files and implementing the relevent functions. * --- 80,86 ---- * * File areas can be used to place different Slash'EM files in different * directories. This is necessary to comply with Linux's FSSTD 1.2 and its ! * replacement FHS 2.0. Currently, these are only implemented for UNIX, but * other ports could follow suit by including similar defines in their port * specific config files and implementing the relevent functions. * *************** *** 98,103 **** --- 98,104 ---- * FILE_AREA_VAR For other files which may be modified by Slash'EM * FILE_AREA_SHARE For read-only, architechure independent, files * FILE_AREA_UNSHARE For read-only, architechure dependent, files + * FILE_AREA_DOC For human-readable documentation */ /* #define FILE_AREAS /* Use file areas */ *************** *** 114,119 **** --- 115,121 ---- /* #define FILE_AREA_SAVE "/var/lib/games/slashem/save/" /* */ /* #define FILE_AREA_SHARE "/usr/lib/games/slashem/" /* */ /* #define FILE_AREA_UNSHARE "/usr/lib/games/slashem/" /* */ + /* #define FILE_AREA_DOC "/usr/doc/slashem/" /* */ /* * File areas compatible with FHS 2.0 *************** *** 123,128 **** --- 125,131 ---- #define FILE_AREA_SAVE "/var/games/slashem/save/" /* */ #define FILE_AREA_SHARE "/usr/share/games/slashem/" /* */ #define FILE_AREA_UNSHARE "/usr/lib/games/slashem/" /* */ + #define FILE_AREA_DOC "/usr/share/doc/slashem/" /* */ #define FILE_AREA_BONES FILE_AREA_VAR #define FILE_AREA_LEVL FILE_AREA_VAR *** include/winX.h.orig Thu Dec 2 15:00:45 1999 --- include/winX.h Thu Dec 2 18:22:33 1999 *************** *** 367,373 **** --- 367,377 ---- E void FDECL(X11_destroy_nhwindow, (winid)); E void FDECL(X11_curs, (winid,int,int)); E void FDECL(X11_putstr, (winid, int, const char *)); + #ifdef FILE_AREAS + E void FDECL(X11_display_file, (const char *, const char *, BOOLEAN_P)); + #else E void FDECL(X11_display_file, (const char *, BOOLEAN_P)); + #endif E void FDECL(X11_start_menu, (winid)); E void FDECL(X11_add_menu, (winid,int,const ANY_P *, CHAR_P, CHAR_P, int, const char *, BOOLEAN_P)); *** include/winprocs.h.orig Thu Dec 2 15:00:45 1999 --- include/winprocs.h Fri Dec 3 10:55:15 1999 *************** *** 20,26 **** --- 20,30 ---- void FDECL((*win_destroy_nhwindow), (winid)); void FDECL((*win_curs), (winid,int,int)); void FDECL((*win_putstr), (winid, int, const char *)); + #ifdef FILE_AREAS + void FDECL((*win_display_file), (const char *, const char *, BOOLEAN_P)); + #else void FDECL((*win_display_file), (const char *, BOOLEAN_P)); + #endif void FDECL((*win_start_menu), (winid)); void FDECL((*win_add_menu), (winid,int,const ANY_P *, CHAR_P,CHAR_P,int,const char *, BOOLEAN_P)); *************** *** 81,86 **** --- 85,95 ---- #define curs (*windowprocs.win_curs) #define putstr (*windowprocs.win_putstr) #define display_file (*windowprocs.win_display_file) + #ifdef FILE_AREAS + #define display_file_area(area,file,complain) display_file(area,file,complain) + #else + #define display_file_area(area,file,complain) display_file(file,complain) + #endif #define start_menu (*windowprocs.win_start_menu) #define add_menu (*windowprocs.win_add_menu) #define end_menu (*windowprocs.win_end_menu) *** include/wintty.h.orig Thu Dec 2 15:00:45 1999 --- include/wintty.h Thu Dec 2 18:22:15 1999 *************** *** 180,186 **** --- 180,190 ---- E void FDECL(tty_destroy_nhwindow, (winid)); E void FDECL(tty_curs, (winid,int,int)); E void FDECL(tty_putstr, (winid, int, const char *)); + #ifdef FILE_AREAS + E void FDECL(tty_display_file, (const char *, const char *, BOOLEAN_P)); + #else E void FDECL(tty_display_file, (const char *, BOOLEAN_P)); + #endif E void FDECL(tty_start_menu, (winid)); E void FDECL(tty_add_menu, (winid,int,const ANY_P *, CHAR_P,CHAR_P,int,const char *, BOOLEAN_P)); *** src/allmain.c.orig Thu Dec 2 15:00:46 1999 --- src/allmain.c Fri Dec 3 10:57:05 1999 *************** *** 571,577 **** (void) signal(SIGINT, (SIG_RET_TYPE) done1); #endif #ifdef NEWS ! if(iflags.news) display_file(NEWS, FALSE); #endif load_qtlist(); /* load up the quest text info */ --- 571,577 ---- (void) signal(SIGINT, (SIG_RET_TYPE) done1); #endif #ifdef NEWS ! if(iflags.news) display_file_area(NEWS_AREA, NEWS, FALSE); #endif load_qtlist(); /* load up the quest text info */ *** src/gypsy.c.orig Thu Dec 2 15:00:46 1999 --- src/gypsy.c Fri Dec 3 10:57:24 1999 *************** *** 832,838 **** tarocchi(mtmp); break; case '?': ! display_file("gypsy.txt", TRUE); break; } --- 832,838 ---- tarocchi(mtmp); break; case '?': ! display_file_area(FILE_AREA_SHARE, "gypsy.txt", TRUE); break; } *** src/mail.c.orig Thu Dec 2 15:00:46 1999 --- src/mail.c Fri Dec 3 10:57:46 1999 *************** *** 514,520 **** } # else # ifndef AMS /* AMS mailboxes are directories */ ! display_file(mailbox, TRUE); # endif /* AMS */ # endif /* DEF_MAILREADER */ --- 514,520 ---- } # else # ifndef AMS /* AMS mailboxes are directories */ ! display_file_area(NULL, mailbox, TRUE); # endif /* AMS */ # endif /* DEF_MAILREADER */ *** src/pager.c.orig Thu Dec 2 15:00:46 1999 --- src/pager.c Fri Dec 3 10:58:04 1999 *************** *** 703,722 **** if (help_menu(&sel)) { switch (sel) { ! case 0: display_file(HELP, TRUE); break; ! case 1: display_file(SHELP, TRUE); break; case 2: (void) dohistory(); break; case 3: (void) dowhatis(); break; case 4: (void) dowhatdoes(); break; case 5: option_help(); break; ! case 6: display_file(OPTIONFILE, TRUE); break; case 7: (void) doextlist(); break; ! case 8: display_file(LICENSE, TRUE); break; /*WAC add guidebook.*/ ! case 9: display_file(GUIDEBOOK, TRUE); break; #ifdef WIZARD /* handle slot 10 or 11 */ ! default: display_file(DEBUGHELP, TRUE); break; #endif #ifdef PORT_HELP case PORT_HELP_ID: port_help(); break; --- 703,732 ---- if (help_menu(&sel)) { switch (sel) { ! case 0: display_file_area(HELP_AREA, HELP, TRUE); ! break; ! case 1: display_file_area(SHELP_AREA, SHELP, TRUE); ! break; case 2: (void) dohistory(); break; case 3: (void) dowhatis(); break; case 4: (void) dowhatdoes(); break; case 5: option_help(); break; ! case 6: display_file_area(OPTIONAREA, ! OPTIONFILE, TRUE); ! break; case 7: (void) doextlist(); break; ! case 8: display_file_area(LICENSE_AREA, ! LICENSE, TRUE); ! break; /*WAC add guidebook.*/ ! case 9: display_file_area(GUIDEBOOK_AREA, ! GUIDEBOOK, TRUE); ! break; #ifdef WIZARD /* handle slot 10 or 11 */ ! default: display_file_area(DEBUGHELP_AREA, ! DEBUGHELP, TRUE); ! break; #endif #ifdef PORT_HELP case PORT_HELP_ID: port_help(); break; *************** *** 729,735 **** int dohistory() { ! display_file(HISTORY, TRUE); return 0; } --- 739,745 ---- int dohistory() { ! display_file_area(HISTORY_AREA, HISTORY, TRUE); return 0; } *** src/version.c.orig Thu Dec 2 15:00:46 1999 --- src/version.c Fri Dec 3 10:58:35 1999 *************** *** 34,40 **** int doextversion() { ! display_file(OPTIONS_USED, TRUE); return 0; } --- 34,40 ---- int doextversion() { ! display_file_area(OPTIONS_USED_AREA, OPTIONS_USED, TRUE); return 0; } *** sys/share/pcmain.c.orig Thu Dec 2 15:00:48 1999 --- sys/share/pcmain.c Fri Dec 3 10:59:25 1999 *************** *** 328,334 **** #endif #ifdef NEWS if(iflags.news){ ! display_file(NEWS, FALSE); iflags.news = FALSE; } #endif --- 328,334 ---- #endif #ifdef NEWS if(iflags.news){ ! display_file_area(NEWS_AREA, NEWS, FALSE); iflags.news = FALSE; } #endif *************** *** 553,559 **** port_help() { /* display port specific help file */ ! display_file( PORT_HELP, 1 ); } # endif /* MSDOS || WIN32 */ #endif /* PORT_HELP */ --- 553,559 ---- port_help() { /* display port specific help file */ ! display_file_area(FILE_AREA_SHARE, PORT_HELP, 1 ); } # endif /* MSDOS || WIN32 */ #endif /* PORT_HELP */ *** sys/unix/Makefile.top.orig Thu Dec 2 15:00:48 1999 --- sys/unix/Makefile.top Thu Dec 2 18:06:37 1999 *************** *** 41,46 **** --- 41,47 ---- FILE_AREA_SAVE = $(GAMEDIR)/save FILE_AREA_SHARE = $(GAMEDIR) FILE_AREA_UNSHARE = $(GAMEDIR) + FILE_AREA_DOC = $(GAMEDIR) FILE_AREA_BONES = $(FILE_AREA_VAR) FILE_AREA_LEVL = $(FILE_AREA_VAR) SHELLDIR = /usr/local/bin *************** *** 50,55 **** --- 51,57 ---- # FILE_AREA_SAVE = /var/lib/games/slashem/save # FILE_AREA_SHARE = /usr/lib/games/slashem # FILE_AREA_UNSHARE = /usr/lib/games/slashem + # FILE_AREA_DOC = /usr/doc/slashem # FILE_AREA_BONES = $(FILE_AREA_VAR) # FILE_AREA_LEVL = $(FILE_AREA_VAR) # SHELLDIR = /usr/games *************** *** 59,64 **** --- 61,67 ---- # FILE_AREA_SAVE = /var/games/slashem/save # FILE_AREA_SHARE = /usr/share/games/slashem # FILE_AREA_UNSHARE = /usr/lib/games/slashem + # FILE_AREA_DOC = /usr/share/doc/slashem # FILE_AREA_BONES = $(FILE_AREA_VAR) # FILE_AREA_LEVL = $(FILE_AREA_VAR) # SHELLDIR = /usr/games *************** *** 97,103 **** # end of configuration # ! DATHELP = help hh cmdhelp history opthelp wizhelp SPEC_LEVS = asmodeus.lev baalz.lev bigrm-?.lev castle.lev fakewiz?.lev \ juiblex.lev knox.lev medusa-?.lev minefill.lev minend-1.lev \ --- 100,106 ---- # end of configuration # ! DATHELP = help hh cmdhelp history opthelp wizhelp gypsy.txt SPEC_LEVS = asmodeus.lev baalz.lev bigrm-?.lev castle.lev fakewiz?.lev \ juiblex.lev knox.lev medusa-?.lev minefill.lev minend-1.lev \ *************** *** 115,121 **** #QUEST_LEVS = ?-goal.lev ?-fill?.lev ?-locate.lev ?-start.lev QUEST_LEVS = ???-goal.lev ???-fil?.lev ???-loca.lev ???-strt.lev ! SHARE_DATNODLB = $(CNF_SHARE_DATND) license UNSHARE_DATNODLB = SHARE_DATDLB = $(DATHELP) $(CNF_SHARE_DATD) UNSHARE_DATDLB = dungeon $(SPEC_LEVS) $(QUEST_LEVS) --- 118,124 ---- #QUEST_LEVS = ?-goal.lev ?-fill?.lev ?-locate.lev ?-start.lev QUEST_LEVS = ???-goal.lev ???-fil?.lev ???-loca.lev ???-strt.lev ! SHARE_DATNODLB = $(CNF_SHARE_DATND) UNSHARE_DATNODLB = SHARE_DATDLB = $(DATHELP) $(CNF_SHARE_DATD) UNSHARE_DATDLB = dungeon $(SPEC_LEVS) $(QUEST_LEVS) *************** *** 200,206 **** -e '$$s/.*/nodlb/p' < dat/options` ; \ $(MAKE) dofiles-$${target-nodlb} cp src/$(GAME) $(FILE_AREA_UNSHARE) ! cp doc/Guidebook.txt $(FILE_AREA_SHARE) # cp win/Qt/KDE/kslashem.kdelnk $(KDEDIR)/share/applnk/Games -rm -f $(SHELLDIR)/$(GAME) sed -e 's;/usr/games/lib/nethackdir;$(FILE_AREA_UNSHARE);' \ --- 203,209 ---- -e '$$s/.*/nodlb/p' < dat/options` ; \ $(MAKE) dofiles-$${target-nodlb} cp src/$(GAME) $(FILE_AREA_UNSHARE) ! cp license doc/Guidebook.txt $(FILE_AREA_DOC) # cp win/Qt/KDE/kslashem.kdelnk $(KDEDIR)/share/applnk/Games -rm -f $(SHELLDIR)/$(GAME) sed -e 's;/usr/games/lib/nethackdir;$(FILE_AREA_UNSHARE);' \ *************** *** 211,219 **** -( cd $(FILE_AREA_UNSHARE) ; $(CHOWN) $(GAMEUID) $(GAME) ; \ $(CHGRP) $(GAMEGRP) $(GAME) ) chmod $(GAMEPERM) $(FILE_AREA_UNSHARE)/$(GAME) ! $(CHOWN) $(GAMEUID) $(FILE_AREA_SHARE)/Guidebook.txt ! $(CHGRP) $(GAMEGRP) $(FILE_AREA_SHARE)/Guidebook.txt ! chmod $(FILEPERM) $(FILE_AREA_SHARE)/Guidebook.txt -$(CHOWN) $(GAMEUID) $(SHELLDIR)/$(GAME) $(CHGRP) $(GAMEGRP) $(SHELLDIR)/$(GAME) chmod $(EXEPERM) $(SHELLDIR)/$(GAME) --- 214,223 ---- -( cd $(FILE_AREA_UNSHARE) ; $(CHOWN) $(GAMEUID) $(GAME) ; \ $(CHGRP) $(GAMEGRP) $(GAME) ) chmod $(GAMEPERM) $(FILE_AREA_UNSHARE)/$(GAME) ! -( cd $(FILE_AREA_DOC) ; \ ! $(CHOWN) $(GAMEUID) license Guidebook.txt ; \ ! $(CHGRP) $(GAMEGRP) license Guidebook.txt ; \ ! chmod $(FILEPERM) license Guidebook.txt ) -$(CHOWN) $(GAMEUID) $(SHELLDIR)/$(GAME) $(CHGRP) $(GAMEGRP) $(SHELLDIR)/$(GAME) chmod $(EXEPERM) $(SHELLDIR)/$(GAME) *************** *** 264,271 **** --- 268,277 ---- -mkdir $(SHELLDIR) -rm -rf $(FILE_AREA_VAR) $(FILE_AREA_BONES) $(FILE_AREA_SAVE) -rm -rf $(FILE_AREA_LEVL) $(FILE_AREA_SHARE) $(FILE_AREA_UNSHARE) + -rm -rf $(FILE_AREA_DOC) -mkdir $(FILE_AREA_VAR) $(FILE_AREA_BONES) $(FILE_AREA_SAVE) -mkdir $(FILE_AREA_LEVL) $(FILE_AREA_SHARE) $(FILE_AREA_UNSHARE) + -mkdir $(FILE_AREA_DOC) -$(CHOWN) $(GAMEUID) $(FILE_AREA_VAR) $(FILE_AREA_BONES) $(FILE_AREA_SAVE) $(CHGRP) $(GAMEGRP) $(FILE_AREA_VAR) $(FILE_AREA_BONES) $(FILE_AREA_SAVE) chmod $(DIRPERM) $(FILE_AREA_VAR) $(FILE_AREA_BONES) $(FILE_AREA_SAVE) *** sys/unix/unixmain.c.orig Thu Dec 2 15:00:48 1999 --- sys/unix/unixmain.c Fri Dec 3 11:00:02 1999 *************** *** 230,236 **** (void) signal(SIGINT, (SIG_RET_TYPE) done1); #ifdef NEWS if(iflags.news) { ! display_file(NEWS, FALSE); iflags.news = FALSE; /* in case dorecover() fails */ } #endif --- 230,236 ---- (void) signal(SIGINT, (SIG_RET_TYPE) done1); #ifdef NEWS if(iflags.news) { ! display_file_area(NEWS_AREA, NEWS, FALSE); iflags.news = FALSE; /* in case dorecover() fails */ } #endif *************** *** 431,437 **** * Display unix-specific help. Just show contents of the helpfile * named by PORT_HELP. */ ! display_file(PORT_HELP, TRUE); } #endif --- 431,437 ---- * Display unix-specific help. Just show contents of the helpfile * named by PORT_HELP. */ ! display_file_area(FILE_AREA_SHARE, PORT_HELP, TRUE); } #endif *** sys/vms/vmsmain.c.orig Thu Dec 2 15:00:48 1999 --- sys/vms/vmsmain.c Fri Dec 3 11:00:27 1999 *************** *** 189,195 **** (void) signal(SIGINT, (SIG_RET_TYPE) done1); #ifdef NEWS if(iflags.news) { ! display_file(NEWS, FALSE); iflags.news = FALSE; /* in case dorecover() fails */ } #endif --- 189,195 ---- (void) signal(SIGINT, (SIG_RET_TYPE) done1); #ifdef NEWS if(iflags.news) { ! display_file_area(NEWS_AREA, NEWS, FALSE); iflags.news = FALSE; /* in case dorecover() fails */ } #endif *************** *** 408,414 **** * Display VMS-specific help. Just show contents of the helpfile * named by PORT_HELP. */ ! display_file(PORT_HELP, TRUE); } #endif /* PORT_HELP */ --- 408,414 ---- * Display VMS-specific help. Just show contents of the helpfile * named by PORT_HELP. */ ! display_file_area(FILE_AREA_SHARE, PORT_HELP, TRUE); } #endif /* PORT_HELP */ *** win/Qt/qt_win.cpp.orig Thu Dec 2 15:00:49 1999 --- win/Qt/qt_win.cpp Thu Dec 2 17:56:52 1999 *************** *** 3271,3277 **** --- 3271,3281 ---- window->PutStr(attr,text); } + #ifdef FILE_AREAS + void NetHackQtBind::qt_display_file(const char *filearea, const char *filename, BOOLEAN_P must_exist) + #else void NetHackQtBind::qt_display_file(const char *filename, BOOLEAN_P must_exist) + #endif { NetHackQtTextWindow* window=new NetHackQtTextWindow(keybuffer); bool complain = FALSE; *************** *** 3283,3289 **** char *cr; window->Clear(); ! f = dlb_fopen_area(FILE_AREA_SHARE, filename, "r"); if (!f) { complain = must_exist; } else { --- 3287,3297 ---- char *cr; window->Clear(); ! #ifdef FILE_AREAS ! f = dlb_fopen_area(filearea, filename, "r"); ! #else ! f = dlb_fopen(filename, "r"); ! #endif if (!f) { complain = must_exist; } else { *************** *** 3304,3310 **** QFile file(filename); #else char *path; ! path = make_file_name(FILE_AREA_SHARE, filename); QFile file(path); #endif --- 3312,3318 ---- QFile file(filename); #else char *path; ! path = make_file_name(filearea, filename); QFile file(path); #endif *** win/Qt/qt_win.h.orig Thu Dec 2 15:00:49 1999 --- win/Qt/qt_win.h Thu Dec 2 17:57:18 1999 *************** *** 702,708 **** --- 702,712 ---- static void qt_destroy_nhwindow(winid wid); static void qt_curs(winid wid, int x, int y); static void qt_putstr(winid wid, int attr, const char *text); + #ifdef FILE_AREAS + static void qt_display_file(const char *filearea, const char *filename, BOOLEAN_P must_exist); + #else static void qt_display_file(const char *filename, BOOLEAN_P must_exist); + #endif static void qt_start_menu(winid wid); static void qt_add_menu(winid wid, int glyph, const ANY_P * identifier, CHAR_P ch, CHAR_P gch, int attr, *** win/X11/winX.c.orig Thu Dec 2 15:00:49 1999 --- win/X11/winX.c Fri Dec 3 13:48:54 1999 *************** *** 1283,1289 **** --- 1283,1294 ---- } void + #ifdef FILE_AREAS + X11_display_file(area, str, complain) + const char *area; + #else X11_display_file(str, complain) + #endif const char *str; boolean complain; { *************** *** 1301,1307 **** int charcount; /* Use the port-independent file opener to see if the file exists. */ ! fp = dlb_fopen_area(FILE_AREA_SHARE, str, RDTMODE); if (!fp) { if(complain) pline("Cannot open %s. Sorry.", str); --- 1306,1316 ---- int charcount; /* Use the port-independent file opener to see if the file exists. */ ! #ifdef FILE_AREAS ! fp = dlb_fopen_area(area, str, RDTMODE); ! #else ! fp = dlb_fopen(str, RDTMODE); ! #endif if (!fp) { if(complain) pline("Cannot open %s. Sorry.", str); *************** *** 1335,1341 **** textlines = (char *) alloc((unsigned int) charcount); textlines[0] = '\0'; ! fp = dlb_fopen_area(FILE_AREA_SHARE, str, RDTMODE); while (dlb_fgets(line, LLEN, fp)) { (void) strcat(textlines, line); --- 1344,1354 ---- textlines = (char *) alloc((unsigned int) charcount); textlines[0] = '\0'; ! #ifdef FILE_AREAS ! fp = dlb_fopen_area(area, str, RDTMODE); ! #else ! fp = dlb_fopen(str, RDTMODE); ! #endif while (dlb_fgets(line, LLEN, fp)) { (void) strcat(textlines, line); *** win/tty/wintty.c.orig Thu Dec 2 15:00:49 1999 --- win/tty/wintty.c Fri Dec 3 13:57:15 1999 *************** *** 1992,2005 **** --- 1992,2014 ---- } void + #ifdef FILE_AREAS + tty_display_file(farea, fname, complain) + const char *farea; + #else tty_display_file(fname, complain) + #endif const char *fname; boolean complain; { #ifdef DEF_PAGER /* this implies that UNIX is defined */ { /* use external pager; this may give security problems */ + #ifdef FILE_AREAS + register int fd = open_area(farea, fname, 0, 0); + #else register int fd = open(fname, 0); + #endif if(fd < 0) { if(complain) pline("Cannot open %s.", fname); *************** *** 2029,2035 **** char *cr; tty_clear_nhwindow(WIN_MESSAGE); ! f = dlb_fopen_area(FILE_AREA_SHARE, fname, "r"); if (!f) { if(complain) { home(); tty_mark_synch(); tty_raw_print(""); --- 2038,2048 ---- char *cr; tty_clear_nhwindow(WIN_MESSAGE); ! #ifdef FILE_AREAS ! f = dlb_fopen_area(farea, fname, "r"); ! #else ! f = dlb_fopen(fname, "r"); ! #endif if (!f) { if(complain) { home(); tty_mark_synch(); tty_raw_print(""); *** win/win32/nhprocs.c.orig Thu Dec 2 15:00:49 1999 --- win/win32/nhprocs.c Thu Dec 2 17:52:49 1999 *************** *** 552,558 **** --- 552,563 ---- } void + #ifdef FILE_AREAS + win32_display_file(farea, fname, complain) + const char *farea; + #else win32_display_file(fname, complain) + #endif const char *fname; boolean complain; { *** win/win32/nhwin32.h.orig Thu Dec 2 15:00:49 1999 --- win/win32/nhwin32.h Thu Dec 2 17:53:13 1999 *************** *** 252,258 **** --- 252,262 ---- E void FDECL(win32_destroy_nhwindow, (winid)); E void FDECL(win32_curs, (winid,int,int)); E void FDECL(win32_putstr, (winid, int, const char *)); + #ifdef FILE_AREAS + E void FDECL(win32_display_file, (const char *, const char *, BOOLEAN_P)); + #else E void FDECL(win32_display_file, (const char *, BOOLEAN_P)); + #endif E void FDECL(win32_start_menu, (winid)); E void FDECL(win32_add_menu, (winid,int,const ANY_P, CHAR_P,int,const char *, BOOLEAN_P));