wikiheaders.pl: Mark some sections as wiki-only so we don't lose them.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
diff --git a/build-scripts/wikiheaders.pl b/build-scripts/wikiheaders.pl
index ead91a8..dc332a8 100755
--- a/build-scripts/wikiheaders.pl
+++ b/build-scripts/wikiheaders.pl
@@ -233,13 +233,21 @@ my @standard_wiki_sections = (
'Draft',
'[Brief]',
'Syntax',
- 'Remarks',
'Function Parameters',
'Return Value',
+ 'Remarks',
'Version',
+ 'Code Examples',
'Related Functions'
);
+# Sections that only ever exist in the wiki and shouldn't be deleted when
+# not found in the headers.
+my %only_wiki_sections = ( # The ones don't mean anything, I just need to check for key existence.
+ 'Draft', 1,
+ 'Code Examples', 1
+);
+
my %headers = (); # $headers{"SDL_audio.h"} -> reference to an array of all lines of text in SDL_audio.h.
my %headerfuncs = (); # $headerfuncs{"SDL_OpenAudio"} -> string of header documentation for SDL_OpenAudio, with comment '*' bits stripped from the start. Newlines embedded!
@@ -761,7 +769,9 @@ if ($copy_direction == 1) { # --copy-to-headers
foreach (@standard_wiki_sections) {
# drop sections we either replaced or removed from the original wiki's contents.
- delete($$sectionsref{$_});
+ if (not defined $only_wiki_sections{$_}) {
+ delete($$sectionsref{$_});
+ }
}
my $wikisectionorderref = $wikisectionorder{$fn};