From c2152928fa27eabed1ebba7f10a998e5e5dc7ab3 Mon Sep 17 00:00:00 2001
From: "Ryan C. Gordon" <[EMAIL REDACTED]>
Date: Wed, 24 Mar 2021 10:46:05 -0400
Subject: [PATCH] wikiheaders.pl: Mark some sections as wiki-only so we don't
lose them.
---
build-scripts/wikiheaders.pl | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/build-scripts/wikiheaders.pl b/build-scripts/wikiheaders.pl
index ead91a8ec..dc332a819 100755
--- a/build-scripts/wikiheaders.pl
+++ b/build-scripts/wikiheaders.pl
@@ -233,13 +233,21 @@ sub usage {
'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 @@ sub usage {
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};