genbki.pl: Factor out boilerplate generation
Discussion: https://www.postgresql.org/message-id/flat/75ae5875-3abc-dafc-8aec-73247ed41cde@eisentraut.org
This commit is contained in:
parent
226d0a6b98
commit
f94dec76cc
@ -439,25 +439,9 @@ foreach my $catname (@catnames)
|
|||||||
open my $def, '>', $def_file . $tmpext
|
open my $def, '>', $def_file . $tmpext
|
||||||
or die "can't open $def_file$tmpext: $!";
|
or die "can't open $def_file$tmpext: $!";
|
||||||
|
|
||||||
# Opening boilerplate for pg_*_d.h
|
print_boilerplate($def, "${catname}_d.h",
|
||||||
printf $def <<EOM, $catname, $catname, uc $catname, uc $catname;
|
"Macro definitions for $catname");
|
||||||
/*-------------------------------------------------------------------------
|
printf $def <<EOM, uc $catname, uc $catname;
|
||||||
*
|
|
||||||
* %s_d.h
|
|
||||||
* Macro definitions for %s
|
|
||||||
*
|
|
||||||
* Portions Copyright (c) 1996-2023, PostgreSQL Global Development Group
|
|
||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
|
||||||
*
|
|
||||||
* NOTES
|
|
||||||
* ******************************
|
|
||||||
* *** DO NOT EDIT THIS FILE! ***
|
|
||||||
* ******************************
|
|
||||||
*
|
|
||||||
* It has been GENERATED by src/backend/catalog/genbki.pl
|
|
||||||
*
|
|
||||||
*-------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
#ifndef %s_D_H
|
#ifndef %s_D_H
|
||||||
#define %s_D_H
|
#define %s_D_H
|
||||||
|
|
||||||
@ -705,25 +689,9 @@ foreach my $c (@system_constraints)
|
|||||||
|
|
||||||
# Now generate schemapg.h
|
# Now generate schemapg.h
|
||||||
|
|
||||||
# Opening boilerplate for schemapg.h
|
print_boilerplate($schemapg, "schemapg.h",
|
||||||
|
"Schema_pg_xxx macros for use by relcache.c");
|
||||||
print $schemapg <<EOM;
|
print $schemapg <<EOM;
|
||||||
/*-------------------------------------------------------------------------
|
|
||||||
*
|
|
||||||
* schemapg.h
|
|
||||||
* Schema_pg_xxx macros for use by relcache.c
|
|
||||||
*
|
|
||||||
* Portions Copyright (c) 1996-2023, PostgreSQL Global Development Group
|
|
||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
|
||||||
*
|
|
||||||
* NOTES
|
|
||||||
* ******************************
|
|
||||||
* *** DO NOT EDIT THIS FILE! ***
|
|
||||||
* ******************************
|
|
||||||
*
|
|
||||||
* It has been GENERATED by src/backend/catalog/genbki.pl
|
|
||||||
*
|
|
||||||
*-------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
#ifndef SCHEMAPG_H
|
#ifndef SCHEMAPG_H
|
||||||
#define SCHEMAPG_H
|
#define SCHEMAPG_H
|
||||||
EOM
|
EOM
|
||||||
@ -741,25 +709,9 @@ print $schemapg "\n#endif\t\t\t\t\t\t\t/* SCHEMAPG_H */\n";
|
|||||||
|
|
||||||
# Now generate system_fk_info.h
|
# Now generate system_fk_info.h
|
||||||
|
|
||||||
# Opening boilerplate for system_fk_info.h
|
print_boilerplate($fk_info, "system_fk_info.h",
|
||||||
|
"Data about the foreign-key relationships in the system catalogs");
|
||||||
print $fk_info <<EOM;
|
print $fk_info <<EOM;
|
||||||
/*-------------------------------------------------------------------------
|
|
||||||
*
|
|
||||||
* system_fk_info.h
|
|
||||||
* Data about the foreign-key relationships in the system catalogs
|
|
||||||
*
|
|
||||||
* Portions Copyright (c) 1996-2023, PostgreSQL Global Development Group
|
|
||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
|
||||||
*
|
|
||||||
* NOTES
|
|
||||||
* ******************************
|
|
||||||
* *** DO NOT EDIT THIS FILE! ***
|
|
||||||
* ******************************
|
|
||||||
*
|
|
||||||
* It has been GENERATED by src/backend/catalog/genbki.pl
|
|
||||||
*
|
|
||||||
*-------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
#ifndef SYSTEM_FK_INFO_H
|
#ifndef SYSTEM_FK_INFO_H
|
||||||
#define SYSTEM_FK_INFO_H
|
#define SYSTEM_FK_INFO_H
|
||||||
|
|
||||||
@ -1121,6 +1073,30 @@ sub assign_next_oid
|
|||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub print_boilerplate
|
||||||
|
{
|
||||||
|
my ($fh, $fname, $descr) = @_;
|
||||||
|
printf $fh <<EOM, $fname, $descr;
|
||||||
|
/*-------------------------------------------------------------------------
|
||||||
|
*
|
||||||
|
* %s
|
||||||
|
* %s
|
||||||
|
*
|
||||||
|
* Portions Copyright (c) 1996-2023, PostgreSQL Global Development Group
|
||||||
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
|
*
|
||||||
|
* NOTES
|
||||||
|
* ******************************
|
||||||
|
* *** DO NOT EDIT THIS FILE! ***
|
||||||
|
* ******************************
|
||||||
|
*
|
||||||
|
* It has been GENERATED by src/backend/catalog/genbki.pl
|
||||||
|
*
|
||||||
|
*-------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
EOM
|
||||||
|
}
|
||||||
|
|
||||||
sub usage
|
sub usage
|
||||||
{
|
{
|
||||||
die <<EOM;
|
die <<EOM;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user