Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit f94dec7

Browse files
committed
1 parent 226d0a6 commit f94dec7

File tree

1 file changed

+31
-55
lines changed

1 file changed

+31
-55
lines changed

src/backend/catalog/genbki.pl

Lines changed: 31 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -439,25 +439,9 @@
439439
open my $def, '>', $def_file . $tmpext
440440
or die "can't open $def_file$tmpext: $!";
441441
442-
# Opening boilerplate for pg_*_d.h
443-
printf $def <<EOM, $catname, $catname, uc $catname, uc $catname;
444-
/*-------------------------------------------------------------------------
445-
*
446-
* %s_d.h
447-
* Macro definitions for %s
448-
*
449-
* Portions Copyright (c) 1996-2023, PostgreSQL Global Development Group
450-
* Portions Copyright (c) 1994, Regents of the University of California
451-
*
452-
* NOTES
453-
* ******************************
454-
* *** DO NOT EDIT THIS FILE! ***
455-
* ******************************
456-
*
457-
* It has been GENERATED by src/backend/catalog/genbki.pl
458-
*
459-
*-------------------------------------------------------------------------
460-
*/
442+
print_boilerplate($def, "${catname}_d.h",
443+
"Macro definitions for $catname");
444+
printf $def <<EOM, uc $catname, uc $catname;
461445
#ifndef %s_D_H
462446
#define %s_D_H
463447
@@ -705,25 +689,9 @@
705689

706690
# Now generate schemapg.h
707691

708-
# Opening boilerplate for schemapg.h
692+
print_boilerplate($schemapg, "schemapg.h",
693+
"Schema_pg_xxx macros for use by relcache.c");
709694
print $schemapg <<EOM;
710-
/*-------------------------------------------------------------------------
711-
*
712-
* schemapg.h
713-
* Schema_pg_xxx macros for use by relcache.c
714-
*
715-
* Portions Copyright (c) 1996-2023, PostgreSQL Global Development Group
716-
* Portions Copyright (c) 1994, Regents of the University of California
717-
*
718-
* NOTES
719-
* ******************************
720-
* *** DO NOT EDIT THIS FILE! ***
721-
* ******************************
722-
*
723-
* It has been GENERATED by src/backend/catalog/genbki.pl
724-
*
725-
*-------------------------------------------------------------------------
726-
*/
727695
#ifndef SCHEMAPG_H
728696
#define SCHEMAPG_H
729697
EOM
@@ -741,25 +709,9 @@
741709

742710
# Now generate system_fk_info.h
743711

744-
# Opening boilerplate for system_fk_info.h
712+
print_boilerplate($fk_info, "system_fk_info.h",
713+
"Data about the foreign-key relationships in the system catalogs");
745714
print $fk_info <<EOM;
746-
/*-------------------------------------------------------------------------
747-
*
748-
* system_fk_info.h
749-
* Data about the foreign-key relationships in the system catalogs
750-
*
751-
* Portions Copyright (c) 1996-2023, PostgreSQL Global Development Group
752-
* Portions Copyright (c) 1994, Regents of the University of California
753-
*
754-
* NOTES
755-
* ******************************
756-
* *** DO NOT EDIT THIS FILE! ***
757-
* ******************************
758-
*
759-
* It has been GENERATED by src/backend/catalog/genbki.pl
760-
*
761-
*-------------------------------------------------------------------------
762-
*/
763715
#ifndef SYSTEM_FK_INFO_H
764716
#define SYSTEM_FK_INFO_H
765717
@@ -1121,6 +1073,30 @@ sub assign_next_oid
11211073
return $result;
11221074
}
11231075

1076+
sub print_boilerplate
1077+
{
1078+
my ($fh, $fname, $descr) = @_;
1079+
printf $fh <<EOM, $fname, $descr;
1080+
/*-------------------------------------------------------------------------
1081+
*
1082+
* %s
1083+
* %s
1084+
*
1085+
* Portions Copyright (c) 1996-2023, PostgreSQL Global Development Group
1086+
* Portions Copyright (c) 1994, Regents of the University of California
1087+
*
1088+
* NOTES
1089+
* ******************************
1090+
* *** DO NOT EDIT THIS FILE! ***
1091+
* ******************************
1092+
*
1093+
* It has been GENERATED by src/backend/catalog/genbki.pl
1094+
*
1095+
*-------------------------------------------------------------------------
1096+
*/
1097+
EOM
1098+
}
1099+
11241100
sub usage
11251101
{
11261102
die <<EOM;

0 commit comments

Comments
 (0)