Skip to content

Commit 8a9c399

Browse files
committed
makehtml devel
1 parent 472ca78 commit 8a9c399

3 files changed

Lines changed: 131 additions & 63 deletions

File tree

utilities/makehtml/makehtml.lpr

Lines changed: 2 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -16,59 +16,8 @@
1616
{$ENDIF}
1717
Classes, SysUtils, IniFiles, StrUtils,
1818
{ you can add units after this }
19-
Version, PasExt, BinTree, CfgOpts;
20-
21-
type
22-
TListType = (lfUnknown, lfExclude, lfSubPart);
23-
24-
var
25-
ListType : TListType;
26-
27-
procedure ProcessFile(Filename : String);
28-
var
29-
Ext : String;
30-
begin
31-
Ext:=UpperCase(ExtractFileExt(FileName));
32-
ListType := lfUnknown;
33-
if (Length(Ext) = 2) and ((Ext >= '.B') and (Ext <= '.Z')) then
34-
ListType:=lfSubPart
35-
else if (Length(Ext) = 3) and ((Ext >= '.ZA') and (Ext <= '.ZZ')) then
36-
ListType:=lfSubPart
37-
else if (Length(Ext) = 4) and ((Ext >= '.ZZA') and (Ext <= '.ZZZ')) then
38-
ListType:=lfSubPart
39-
else case UpperCase(ExtractFileBase(FileName)) of
40-
'CATEGORY' : if Ext = '.KEY' then ListType:=lfExclude;
41-
'LICENSE' : if Ext = '' then ListType:=lfExclude;
42-
'README' : if Ext = '.NOW' then ListType:=lfExclude;
43-
'BIBLIO',
44-
'CMOS',
45-
'FAQ',
46-
'FARCALL',
47-
'GLOSSARY',
48-
'I2C',
49-
'LINKS',
50-
'MEMORY',
51-
'MSR',
52-
'OVERVIEW',
53-
'PORTS',
54-
'SMM',
55-
'TABLES' : if (Ext = '.LST') or (Ext = '.A') then ListType:=lfExclude;
56-
'INTERRUP' : case Ext of
57-
'.PRI' : ListType:=lfExclude;
58-
'.1ST' : ListType:=lfExclude;
59-
'.LST',
60-
'.A' : ListType:=lfExclude;
61-
end;
62-
end;
63-
if ListType = lfExclude then begin
64-
LogMessage(vbExcessive, 'Skip file: ' + Filename);
65-
Exit;
66-
end;
67-
if ListType = lfUnknown then begin
68-
LogMessage(vbNormal, 'Unrecognized file: ' + Filename);
69-
Exit;
70-
end;
71-
end;
19+
Version, PasExt, BinTree,
20+
CfgOpts, SrcData;
7221

7322
procedure Conversion;
7423
var

utilities/makehtml/makehtml.lps

Lines changed: 35 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@
77
<Unit>
88
<Filename Value="makehtml.lpr"/>
99
<IsPartOfProject Value="True"/>
10-
<IsVisibleTab Value="True"/>
11-
<TopLine Value="16"/>
12-
<CursorPos Y="27"/>
10+
<TopLine Value="2"/>
11+
<CursorPos Y="22"/>
1312
<UsageCount Value="74"/>
1413
<Loaded Value="True"/>
1514
</Unit>
@@ -23,7 +22,7 @@
2322
<Unit>
2423
<Filename Value="cfgopts.pas"/>
2524
<UnitName Value="CfgOpts"/>
26-
<EditorIndex Value="2"/>
25+
<EditorIndex Value="3"/>
2726
<TopLine Value="37"/>
2827
<CursorPos Y="68"/>
2928
<UsageCount Value="20"/>
@@ -32,14 +31,24 @@
3231
<Unit>
3332
<Filename Value="pasext.pp"/>
3433
<UnitName Value="PasExt"/>
35-
<EditorIndex Value="1"/>
34+
<EditorIndex Value="2"/>
3635
<TopLine Value="888"/>
3736
<CursorPos X="31" Y="258"/>
3837
<UsageCount Value="19"/>
3938
<Loaded Value="True"/>
4039
</Unit>
40+
<Unit>
41+
<Filename Value="srcdata.pas"/>
42+
<UnitName Value="SrcData"/>
43+
<IsVisibleTab Value="True"/>
44+
<EditorIndex Value="1"/>
45+
<TopLine Value="14"/>
46+
<CursorPos X="21" Y="36"/>
47+
<UsageCount Value="10"/>
48+
<Loaded Value="True"/>
49+
</Unit>
4150
</Units>
42-
<JumpHistory HistoryIndex="18">
51+
<JumpHistory HistoryIndex="22">
4352
<Position>
4453
<Filename Value="makehtml.lpr"/>
4554
<Caret Line="26" Column="10"/>
@@ -59,10 +68,6 @@
5968
<Position>
6069
<Filename Value="pasext.pp"/>
6170
</Position>
62-
<Position>
63-
<Filename Value="pasext.pp"/>
64-
<Caret Line="256" Column="11" TopLine="264"/>
65-
</Position>
6671
<Position>
6772
<Filename Value="makehtml.lpr"/>
6873
<Caret Line="25" Column="27"/>
@@ -115,6 +120,26 @@
115120
<Filename Value="makehtml.lpr"/>
116121
<Caret Line="56" Column="43" TopLine="15"/>
117122
</Position>
123+
<Position>
124+
<Filename Value="makehtml.lpr"/>
125+
<Caret Line="76" Column="25" TopLine="32"/>
126+
</Position>
127+
<Position>
128+
<Filename Value="srcdata.pas"/>
129+
<Caret Line="50" TopLine="25"/>
130+
</Position>
131+
<Position>
132+
<Filename Value="srcdata.pas"/>
133+
<Caret Line="88" Column="2" TopLine="14"/>
134+
</Position>
135+
<Position>
136+
<Filename Value="srcdata.pas"/>
137+
<Caret Line="85" Column="14"/>
138+
</Position>
139+
<Position>
140+
<Filename Value="srcdata.pas"/>
141+
<Caret Line="30" TopLine="14"/>
142+
</Position>
118143
</JumpHistory>
119144
<RunParams>
120145
<FormatVersion Value="2"/>

utilities/makehtml/srcdata.pas

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
// Copyright 2026, Jerome Shidel
2+
// The Clear BSD License
3+
// All rights reserved.
4+
5+
unit SrcData;
6+
7+
{$mode objfpc}{$H+}
8+
9+
{$I patches.pp} // Various compiler directives to "fix" things.
10+
{$I version.def} // Version information defines
11+
12+
interface
13+
14+
uses
15+
{$IFDEF USES_CWString} cwstring, {$ENDIF}
16+
{$IFDEF UNIX}
17+
cthreads,
18+
{$ENDIF}
19+
SysUtils,
20+
{ you can add units after this }
21+
Version, PasExt;
22+
23+
type
24+
TListType = (lfUnknown, lfExclude, lfSubPart, lfList);
25+
26+
var
27+
ListType : TListType;
28+
29+
procedure ProcessList(FileName : String);
30+
procedure ProcessFile(Filename : String);
31+
32+
implementation
33+
34+
procedure ProcessList(FileName : String);
35+
begin
36+
WriteLn(FileName);
37+
end;
38+
39+
procedure ProcessFile(Filename : String);
40+
var
41+
Ext : String;
42+
begin
43+
Ext:=UpperCase(ExtractFileExt(FileName));
44+
ListType := lfUnknown;
45+
if (Length(Ext) = 2) and ((Ext >= '.B') and (Ext <= '.Z')) then
46+
ListType:=lfSubPart
47+
else if (Length(Ext) = 3) and ((Ext >= '.ZA') and (Ext <= '.ZZ')) then
48+
ListType:=lfSubPart
49+
else if (Length(Ext) = 4) and ((Ext >= '.ZZA') and (Ext <= '.ZZZ')) then
50+
ListType:=lfSubPart
51+
else case UpperCase(ExtractFileBase(FileName)) of
52+
'CATEGORY' : if Ext = '.KEY' then ListType:=lfExclude;
53+
'LICENSE' : if Ext = '' then ListType:=lfExclude;
54+
'README' : if Ext = '.NOW' then ListType:=lfExclude;
55+
'BIBLIO',
56+
'CMOS',
57+
'FAQ',
58+
'FARCALL',
59+
'GLOSSARY',
60+
'I2C',
61+
'LINKS',
62+
'MEMORY',
63+
'MSR',
64+
'OVERVIEW',
65+
'PORTS',
66+
'SMM',
67+
'TABLES' : if (Ext = '.LST') or (Ext = '.A') then ListType:=lfExclude;
68+
'INTERRUP' : case Ext of
69+
'.PRI' : ListType:=lfExclude;
70+
'.1ST' : ListType:=lfExclude;
71+
'.LST',
72+
'.A' : ListType:=lfList;
73+
end;
74+
end;
75+
case ListType of
76+
lfExclude : begin
77+
LogMessage(vbExcessive, 'Skip file: ' + Filename);
78+
Exit;
79+
end;
80+
lfUnknown : begin
81+
LogMessage(vbNormal, 'Unrecognized file: ' + Filename);
82+
Exit;
83+
end;
84+
lfSubPart : Exit;
85+
lfList : ProcessList(Filename);
86+
end;
87+
end;
88+
89+
90+
initialization
91+
92+
finalization
93+
94+
end.

0 commit comments

Comments
 (0)