SDL: wikiheaders: Renamed "Related Functions" section to "See Also"

From 34f4484f48b1cdc51703eaf4ba5dd5176bdbfb71 Mon Sep 17 00:00:00 2001
From: "Ryan C. Gordon" <[EMAIL REDACTED]>
Date: Sat, 6 Apr 2024 23:25:37 -0400
Subject: [PATCH] wikiheaders: Renamed "Related Functions" section to "See
 Also"

It's not all functions now!
---
 build-scripts/wikiheaders.pl | 22 +++++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)

diff --git a/build-scripts/wikiheaders.pl b/build-scripts/wikiheaders.pl
index a7ae074a652c0..ecf35251362a8 100755
--- a/build-scripts/wikiheaders.pl
+++ b/build-scripts/wikiheaders.pl
@@ -510,7 +510,7 @@ sub usage {
     'Thread Safety',
     'Version',
     'Code Examples',
-    'Related Functions'
+    'See Also'
 );
 
 # Sections that only ever exist in the wiki and shouldn't be deleted when
@@ -863,6 +863,14 @@ sub print_undocumented_section {
         $sections{$_} .= "\n";
     }
 
+    # older section name we used, migrate over from it.
+    if (defined $sections{'Related Functions'}) {
+        if (not defined $sections{'See Also'}) {
+            $sections{'See Also'} = $sections{'Related Functions'};
+        }
+        delete $sections{'Related Functions'};
+    }
+
     if (0) {
         foreach (@section_order) {
             print("$sym SECTION '$_':\n");
@@ -922,7 +930,7 @@ sub print_undocumented_section {
         my $returns = $sectionsref->{'Return Value'};
         my $threadsafety = $sectionsref->{'Thread Safety'};
         my $version = $sectionsref->{'Version'};
-        my $related = $sectionsref->{'Related Functions'};
+        my $related = $sectionsref->{'See Also'};
         my $deprecated = $sectionsref->{'Deprecated'};
         my $brief = $sectionsref->{'[Brief]'};
         my $addblank = 0;
@@ -1326,11 +1334,11 @@ sub print_undocumented_section {
             } elsif ($l =~ /\A\\sa\s+(.*)\Z/) {
                 my $sa = $1;
                 $sa =~ s/\(\)\Z//;  # Convert "SDL_Func()" to "SDL_Func"
-                $sections{'Related Functions'} = '' if not defined $sections{'Related Functions'};
+                $sections{'See Also'} = '' if not defined $sections{'See Also'};
                 if ($wikitype eq 'mediawiki') {
-                    $sections{'Related Functions'} .= ":[[$sa]]\n";
+                    $sections{'See Also'} .= ":[[$sa]]\n";
                 } elsif ($wikitype eq 'md') {
-                    $sections{'Related Functions'} .= "* [$sa]($sa)\n";
+                    $sections{'See Also'} .= "* [$sa]($sa)\n";
                 } else { die("Expected wikitype '$wikitype'\n"); }
             }
         }
@@ -1340,7 +1348,7 @@ sub print_undocumented_section {
         $sections{'Header File'} = "$hfiletext\n";
 
         # Make sure this ends with a double-newline.
-        $sections{'Related Functions'} .= "\n" if defined $sections{'Related Functions'};
+        $sections{'See Also'} .= "\n" if defined $sections{'See Also'};
 
         # We can build the wiki table now that we have all the data.
         if (scalar(@params) > 0) {
@@ -1590,7 +1598,7 @@ sub print_undocumented_section {
         my $returns = $sectionsref->{'Return Value'};
         my $version = $sectionsref->{'Version'};
         my $threadsafety = $sectionsref->{'Thread Safety'};
-        my $related = $sectionsref->{'Related Functions'};
+        my $related = $sectionsref->{'See Also'};
         my $examples = $sectionsref->{'Code Examples'};
         my $deprecated = $sectionsref->{'Deprecated'};
         my $headerfile = $manpageheaderfiletext;