-for my $f (@seenf) {
- my $F = uc $f;
- my $ifdef = "#ifdef HAS_${F}_R\n";
- my $endif = "#endif /* HAS_${F}_R */\n";
- if (exists $seena{$f}) {
- my @p = @{$seena{$f}};
- if ($f =~ /^(asctime|ctime|getlogin|setlocale|strerror|ttyname)$/) {
+# The following loop accumulates the "ssif" (struct, size, init, free)
+# sections that declare the struct members (in reentr.h), and the buffer
+# size initialization, buffer initialization (malloc), and buffer
+# release (free) code (in reentr.c).
+#
+# The loop also contains a lot of intrinsic logic about groups of
+# functions (since functions of certain kind operate the same way).
+
+for my $func (@seenf) {
+ my $FUNC = uc $func;
+ my $ifdef = "#ifdef HAS_${FUNC}_R\n";
+ my $endif = "#endif /* HAS_${FUNC}_R */\n";
+ if (exists $seena{$func}) {
+ my @p = @{$seena{$func}};
+ if ($func =~ /^(asctime|ctime|getlogin|setlocale|strerror|ttyname)$/) {