Skip to content

Commit 0bf57e2

Browse files
committed
use .gh file extension for generated help topics header file
1 parent 0648964 commit 0bf57e2

File tree

9 files changed

+62
-33
lines changed

9 files changed

+62
-33
lines changed

bld/browser/h/brwhelp.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
*
33
* Open Watcom Project
44
*
5+
* Copyright (c) 2002-2020 The Open Watcom Contributors. All Rights Reserved.
56
* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
67
*
78
* ========================================================================
@@ -31,7 +32,7 @@
3132

3233

3334
#include "wsyshelp.hpp"
34-
#include "wbrw.h"
35+
#include "wbrw.gh"
3536

3637
#define BRH_SELECT_ROOTS HLP_MANIPULATING_THE_TREE_VIEWS
3738
#define BRH_QUERY_CONFIGURATION HLP_GLOBAL_SYMBOL_QUERIES

bld/browser/master.mif

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ browse_trmem = 1
88

99
docs_host_dir = $(docs_dir)/$(host_os)
1010

11-
additional_clean = $(docs_host_dir)/wbrw.h
11+
additional_clean = $(docs_host_dir)/wbrw.gh
1212

1313
.extensions: .gpp
1414

@@ -99,7 +99,7 @@ objs_dbg = debuglog.obj
9999
#
100100
# EXE
101101
#
102-
exetarg_prebuild_objs = $(docs_host_dir)/wbrw.h
102+
exetarg_prebuild_objs = $(docs_host_dir)/wbrw.gh
103103
exetarg_objs = $(objs) $(objs_dbg)
104104
exetarg_libs_dos = $(ui_lib)
105105
exetarg_libs = $(gui_lib) $(exetarg_libs_$(host_os)) $(dwarfr_lib) $(wclass_lib)
@@ -142,7 +142,7 @@ curr_dir=$+$(%__CWD__)$-
142142
$(docs_host_dir) : .SYMBOLIC
143143
$(noecho)cd $@
144144

145-
$(docs_host_dir)/wbrw.h : $(docs_host_dir) .ALWAYS
145+
$(docs_host_dir)/wbrw.gh : $(docs_host_dir) .ALWAYS
146146
$(noecho)!$(nested_wmake) -h -f ../mif/onebook.mif hbook=wbrw header=1 dotarget=$(host_os)
147147
$(noecho)cd $(curr_dir)
148148

bld/ide/ide/cpp/vpemain.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
#include "wflashp.hpp"
7070
#include "vhelpstk.hpp"
7171
#include "veditdlg.hpp"
72-
#include "ide.h"
72+
#include "ide.gh"
7373
#include "autoenv.h"
7474

7575
#include "clibext.h"

bld/ide/ide/cpp/vpemain2.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
#include "wflashp.hpp"
7272
#include "vhelpstk.hpp"
7373
#include "veditdlg.hpp"
74-
#include "ide.h"
74+
#include "ide.gh"
7575
#include "mitem.hpp"
7676
#include "inifile.hpp"
7777

bld/ide/ide/master.mif

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ target_win = win
1212

1313
docs_host_dir = $(docs_dir)/$(host_os)
1414

15-
additional_clean = $(docs_host_dir)/ide.h
15+
additional_clean = $(docs_host_dir)/ide.gh
1616

1717
!include cproj.mif
1818
!include defrule.mif
@@ -70,7 +70,7 @@ extra_l_flags = op eliminate op description 'Open Watcom IDE'
7070
#
7171
# EXE
7272
#
73-
exetarg_prebuild_objs = $(docs_host_dir)/ide.h
73+
exetarg_prebuild_objs = $(docs_host_dir)/ide.gh
7474
exetarg_objs = $(objs)
7575
exetarg_libs = $(idelib_lib) $(wclass_lib) $(gui_lib) $(wres_lib)
7676
exetarg_res_version_res_exe_nt_386 = exever.res
@@ -102,6 +102,6 @@ curr_dir=$+$(%__CWD__)$-
102102
$(docs_host_dir) : .SYMBOLIC
103103
$(noecho)cd $@
104104

105-
$(docs_host_dir)/ide.h: $(docs_host_dir) .ALWAYS
105+
$(docs_host_dir)/ide.gh : $(docs_host_dir) .ALWAYS
106106
$(noecho)!$(nested_wmake) -h -f ../mif/onebook.mif hbook=ide header=1 dotarget=$(host_os)
107107
$(noecho)cd $(curr_dir)

bld/whpcvt/c/whpcvt.c

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
*
33
* Open Watcom Project
44
*
5-
* Copyright (c) 2002-2019 The Open Watcom Contributors. All Rights Reserved.
5+
* Copyright (c) 2002-2020 The Open Watcom Contributors. All Rights Reserved.
66
* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
77
*
88
* ========================================================================
@@ -57,6 +57,7 @@
5757
pick( ARG_OL, "ol" ) \
5858
pick( ARG_UL, "ul" ) \
5959
pick( ARG_H, "h" ) \
60+
pick( ARG_HF, "hf" ) \
6061
pick( ARG_HH, "hh" ) \
6162
pick( ARG_HN, "hn" ) \
6263
pick( ARG_B, "b" ) \
@@ -136,6 +137,8 @@ const char Fonttype_courier[] = "courier";
136137

137138
/* local variables */
138139

140+
static char *h_file_name = NULL;
141+
139142
static const char *Help_info[] = {
140143
"Usage: whpcvt [options] <in_file> [<out_file>]",
141144
" Options for all help file types:",
@@ -502,6 +505,14 @@ static int process_args( int argc, char *argv[] )
502505
case ARG_H:
503506
Do_def = true;
504507
break;
508+
case ARG_HF:
509+
start_arg++;
510+
if( start_arg < argc ) {
511+
h_file_name = normalize_fname( h_file_name, argv[start_arg], NULL );
512+
} else {
513+
error_err( ERR_BAD_ARGS );
514+
}
515+
break;
505516
case ARG_HH:
506517
Do_hdef = true;
507518
break;
@@ -2058,8 +2069,12 @@ int main( int argc, char *argv[] )
20582069
In_file = NULL;
20592070

20602071
if( Do_ctx_ids ) {
2061-
strcpy( strrchr( file, '.' ), EXT_DEF_FILE );
2062-
In_file = fopen( file, "r" );
2072+
if( h_file_name != NULL ) {
2073+
In_file = fopen( h_file_name, "r" );
2074+
} else {
2075+
strcpy( strrchr( file, '.' ), EXT_DEF_FILE );
2076+
In_file = fopen( file, "r" );
2077+
}
20632078
if( In_file != NULL ) {
20642079
read_ctx_ids();
20652080
fclose( In_file );
@@ -2069,11 +2084,19 @@ int main( int argc, char *argv[] )
20692084
set_ctx_ids();
20702085

20712086
if( Do_def ) {
2072-
strcpy( strrchr( file, '.' ), EXT_DEF_FILE );
2073-
Def_file = fopen( file, "w" );
2074-
if( Def_file == NULL ) {
2075-
printf( "Could not open define file: %s\n", file );
2076-
goto error_exit;
2087+
if( h_file_name != NULL ) {
2088+
Def_file = fopen( h_file_name, "w" );
2089+
if( Def_file == NULL ) {
2090+
printf( "Could not open define file: %s\n", h_file_name );
2091+
goto error_exit;
2092+
}
2093+
} else {
2094+
strcpy( strrchr( file, '.' ), EXT_DEF_FILE );
2095+
Def_file = fopen( file, "w" );
2096+
if( Def_file == NULL ) {
2097+
printf( "Could not open define file: %s\n", file );
2098+
goto error_exit;
2099+
}
20772100
}
20782101
}
20792102

@@ -2139,6 +2162,9 @@ int main( int argc, char *argv[] )
21392162

21402163
error_exit:
21412164

2165+
if( h_file_name != NULL ) {
2166+
free( h_file_name );
2167+
}
21422168
if( Header_File != NULL ) {
21432169
free( Header_File );
21442170
}

docs/makehhp.awk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ BEGIN {
2828
gsub( /\"> (.*) <\/h.>/, "", file )
2929

3030
# "Index_of_Topics" should be included since it is
31-
# defined in the .h file, but we'll place it last
31+
# defined in the .gh file, but we'll place it last
3232
# since it shouldn't be our first page
3333
if (file == "Index_of_Topics") {
3434
last_file = file
@@ -64,7 +64,7 @@ END {
6464
print ""
6565

6666
print "[MAP]"
67-
print "#include " hbook ".h"
67+
print "#include " hbook ".gh"
6868
print ""
6969

7070
# Directly write aliases into the project rather

docs/mif/clean.mif

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ clean : .procedure
66
@if exist *.bmp rm -f *.bmp
77
@if exist *.hlp rm -f *.hlp
88
@if exist *.cnt rm -f *.cnt
9-
@if exist *.h rm -f *.h
9+
@if exist *.gh rm -f *.gh
1010
@if exist *.ipf rm -f *.ipf
1111
@if exist *.inf rm -f *.inf
1212
@if exist *.tmp rm -f *.tmp

docs/mif/onebook.mif

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -71,22 +71,22 @@ bmp2eps = bmp2eps
7171
#
7272

7373
!ifeq header 1
74-
dep_nt = $(hbook).h
74+
dep_nt = $(hbook).gh
7575
!else ifneq hc_nt
7676
dep_nt = $(hbook).hlp $(hbook).cnt
7777
!endif
7878
!ifeq header 1
79-
dep_win = $(hbook).h
79+
dep_win = $(hbook).gh
8080
!else
8181
dep_win = $(hbook).hlp
8282
!endif
8383
!ifeq header 1
84-
dep_os2 = $(hbook).h
84+
dep_os2 = $(hbook).gh
8585
!else
8686
dep_os2 = $(hbook).inf $(hbook).hlp
8787
!endif
8888
!ifeq header 1
89-
dep_dos = $(hbook).h
89+
dep_dos = $(hbook).gh
9090
!else
9191
dep_dos = $(hbook).ihp
9292
!endif
@@ -193,7 +193,7 @@ $(hbook).cnt : $(hbook).cn1
193193
awk -f ../makecnt2.awk -v file=$(hbook).hlp -v title="$(book_title)" -v multi=$(book_multi_chapter) $[@ > $(hbook).cnt
194194
!endif
195195

196-
$(hbook).rtf $(hbook).cn1 $(hbook).h $(hbook).hh : $(book_objs) $(proj_objs)
196+
$(hbook).rtf $(hbook).cn1 $(hbook).gh $(hbook).hh : $(book_objs) $(proj_objs)
197197
@%make compile_gml_to_xxx
198198

199199
####################################################
@@ -211,7 +211,7 @@ $(hbook).hlp : $(hbook).hpj $(hbook).rtf $(hbook).hh
211211
$(hbook).hpj : $(proj_objs)
212212
@%make compile_hpj_win
213213

214-
$(hbook).rtf $(hbook).h $(hbook).hh : $(book_objs) $(proj_objs)
214+
$(hbook).rtf $(hbook).gh $(hbook).hh : $(book_objs) $(proj_objs)
215215
@%make compile_gml_to_xxx
216216

217217
####################################################
@@ -226,7 +226,7 @@ $(hbook).rtf $(hbook).h $(hbook).hh : $(book_objs) $(proj_objs)
226226
$(hbook).ihp : $(hbook).ib
227227
$(hcdos) -h 25 -w 80 $(hbook).ib $(hbook).ihp
228228

229-
$(hbook).ib $(hbook).h : $(book_objs) $(proj_objs)
229+
$(hbook).ib $(hbook).gh : $(book_objs) $(proj_objs)
230230
@%make compile_gml_to_xxx
231231

232232

@@ -246,12 +246,12 @@ $(hbook).ib $(hbook).h : $(book_objs) $(proj_objs)
246246

247247
.EXTENSIONS: .chm
248248

249-
$(hbook).chm : $(hbook).htm $(hbook).h
249+
$(hbook).chm : $(hbook).htm $(hbook).gh
250250
@if not exist $(hbook) mkdir $(hbook)
251251
!ifdef book_bmroot
252252
$(noecho)cp -f $(book_bmroot)/*.bmp $(hbook)/ > $(nulldevice)
253253
!endif
254-
cp -f $(hbook).h $(hbook)/$(hbook).h > $(nulldevice)
254+
cp -f $(hbook).gh $(hbook)/$(hbook).gh > $(nulldevice)
255255
awk -f ../splithtm.awk -v dir=$(hbook) $(hbook).htm
256256
awk -f ../makehha.awk $(hbook).htm >$(hbook)/$(hbook).hha
257257
awk -f ../makehhc.awk $(hbook).htm >$(hbook)/$(hbook).hhc
@@ -323,7 +323,7 @@ $(hbook).hlp : $(hbook).ipf
323323
$(hbook).hlp : .symbolic
324324
!endif
325325

326-
$(hbook).ipf $(hbook).h : $(book_objs) $(proj_objs)
326+
$(hbook).ipf $(hbook).gh : $(book_objs) $(proj_objs)
327327
@%make compile_gml_to_xxx
328328

329329
!endif
@@ -363,7 +363,7 @@ $(hbook).ps : $(book_objs) $(book_objs_ps) $(proj_objs)
363363

364364
.EXTENSIONS: .htm
365365

366-
$(hbook).h $(hbook).htm : $(book_objs) $(proj_objs)
366+
$(hbook).gh $(hbook).htm : $(book_objs) $(proj_objs)
367367
!ifneq dotarget htmlhelp
368368
!ifdef book_bmroot
369369
$(noecho)cp -f $(book_bmroot)/*.bmp . > $(nulldevice)
@@ -413,6 +413,8 @@ prepare_whpcvt_opts : .PROCEDURE
413413
@%append $(whpcvt_optfile) -k
414414
@%append $(whpcvt_optfile) -up
415415
!endif
416+
@%append $(whpcvt_optfile) -hf
417+
@%append $(whpcvt_optfile) $*.gh
416418
@%append $(whpcvt_optfile) -hn
417419
@%append $(whpcvt_optfile) -i
418420

@@ -574,8 +576,8 @@ compile_gml_to_xxx : .PROCEDURE
574576
$(noecho)%ren $(wgml_tmpfile) $*.ptf
575577
@if exist $*.mix @%erase $*.mix
576578
@%ren $(wgml_sysfile_01) $*.mix
577-
@if exist $*.h @%erase $*.h
578-
@%ren $(wgml_sysfile_02) $*.h
579+
@if exist $*.gh @%erase $*.gh
580+
@%ren $(wgml_sysfile_02) $*.gh
579581
@if exist $*.cn1 @%erase $*.cn1
580582
@%ren $(wgml_sysfile_03) $*.cn1
581583
whpcvt -h -@ $(whpcvt_optfile) $*.ptf

0 commit comments

Comments
 (0)