mirror of https://github.com/postgres/postgres
inclusions in src/include/catalog/*.h files. The main idea here is to push function declarations for src/backend/catalog/*.c files into separate headers, rather than sticking them into the corresponding catalog definition file as has been done in the past. This commit only carries out that idea fully for pg_proc, pg_type and pg_conversion, but that's enough for the moment --- if pg_list.h ever becomes unsafe for frontend code to include, we'll need to work a bit more. Zdenek KotalaREL8_5_ALPHA1_BRANCH
parent
73b0300b2a
commit
039dfbfd5d
@ -0,0 +1,39 @@ |
||||
/*-------------------------------------------------------------------------
|
||||
* |
||||
* genbki.h |
||||
* Required include file for all POSTGRES catalog header files |
||||
* |
||||
* genbki.h defines CATALOG(), DATA(), BKI_BOOTSTRAP and related macros |
||||
* so that the catalog header files can be read by the C compiler. |
||||
* (These same words are recognized by genbki.sh to build the BKI |
||||
* bootstrap file from these header files.) |
||||
* |
||||
* |
||||
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group |
||||
* Portions Copyright (c) 1994, Regents of the University of California |
||||
* |
||||
* $PostgreSQL: pgsql/src/include/catalog/genbki.h,v 1.1 2008/03/27 03:57:34 tgl Exp $ |
||||
* |
||||
*------------------------------------------------------------------------- |
||||
*/ |
||||
#ifndef GENBKI_H |
||||
#define GENBKI_H |
||||
|
||||
/* Introduces a catalog's structure definition */ |
||||
#define CATALOG(name,oid) typedef struct CppConcat(FormData_,name) |
||||
|
||||
/* Options that may appear after CATALOG (on the same line) */ |
||||
#define BKI_BOOTSTRAP |
||||
#define BKI_SHARED_RELATION |
||||
#define BKI_WITHOUT_OIDS |
||||
|
||||
/* Declarations that provide the initial content of a catalog */ |
||||
/* In C, these need to expand into some harmless, repeatable declaration */ |
||||
#define DATA(x) extern int no_such_variable |
||||
#define DESCR(x) extern int no_such_variable |
||||
#define SHDESCR(x) extern int no_such_variable |
||||
|
||||
/* PHONY type definition for use in catalog structure definitions only */ |
||||
typedef int aclitem; |
||||
|
||||
#endif /* GENBKI_H */ |
@ -0,0 +1,28 @@ |
||||
/*-------------------------------------------------------------------------
|
||||
* |
||||
* pg_conversion_fn.h |
||||
* prototypes for functions in catalog/pg_conversion.c |
||||
* |
||||
* |
||||
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group |
||||
* Portions Copyright (c) 1994, Regents of the University of California |
||||
* |
||||
* $PostgreSQL: pgsql/src/include/catalog/pg_conversion_fn.h,v 1.1 2008/03/27 03:57:34 tgl Exp $ |
||||
* |
||||
*------------------------------------------------------------------------- |
||||
*/ |
||||
#ifndef PG_CONVERSION_FN_H |
||||
#define PG_CONVERSION_FN_H |
||||
|
||||
#include "nodes/parsenodes.h" |
||||
|
||||
extern Oid ConversionCreate(const char *conname, Oid connamespace, |
||||
Oid conowner, |
||||
int32 conforencoding, int32 contoencoding, |
||||
Oid conproc, bool def); |
||||
extern void ConversionDrop(Oid conversionOid, DropBehavior behavior); |
||||
extern void RemoveConversionById(Oid conversionOid); |
||||
extern Oid FindConversion(const char *conname, Oid connamespace); |
||||
extern Oid FindDefaultConversion(Oid connamespace, int32 for_encoding, int32 to_encoding); |
||||
|
||||
#endif /* PG_CONVERSION_FN_H */ |
@ -0,0 +1,40 @@ |
||||
/*-------------------------------------------------------------------------
|
||||
* |
||||
* pg_proc_fn.h |
||||
* prototypes for functions in catalog/pg_proc.c |
||||
* |
||||
* |
||||
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group |
||||
* Portions Copyright (c) 1994, Regents of the University of California |
||||
* |
||||
* $PostgreSQL: pgsql/src/include/catalog/pg_proc_fn.h,v 1.1 2008/03/27 03:57:34 tgl Exp $ |
||||
* |
||||
*------------------------------------------------------------------------- |
||||
*/ |
||||
#ifndef PG_PROC_FN_H |
||||
#define PG_PROC_FN_H |
||||
|
||||
extern Oid ProcedureCreate(const char *procedureName, |
||||
Oid procNamespace, |
||||
bool replace, |
||||
bool returnsSet, |
||||
Oid returnType, |
||||
Oid languageObjectId, |
||||
Oid languageValidator, |
||||
const char *prosrc, |
||||
const char *probin, |
||||
bool isAgg, |
||||
bool security_definer, |
||||
bool isStrict, |
||||
char volatility, |
||||
oidvector *parameterTypes, |
||||
Datum allParameterTypes, |
||||
Datum parameterModes, |
||||
Datum parameterNames, |
||||
Datum proconfig, |
||||
float4 procost, |
||||
float4 prorows); |
||||
|
||||
extern bool function_parse_error_transpose(const char *prosrc); |
||||
|
||||
#endif /* PG_PROC_FN_H */ |
@ -0,0 +1,76 @@ |
||||
/*-------------------------------------------------------------------------
|
||||
* |
||||
* pg_type_fn.h |
||||
* prototypes for functions in catalog/pg_type.c |
||||
* |
||||
* |
||||
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group |
||||
* Portions Copyright (c) 1994, Regents of the University of California |
||||
* |
||||
* $PostgreSQL: pgsql/src/include/catalog/pg_type_fn.h,v 1.1 2008/03/27 03:57:34 tgl Exp $ |
||||
* |
||||
*------------------------------------------------------------------------- |
||||
*/ |
||||
#ifndef PG_TYPE_FN_H |
||||
#define PG_TYPE_FN_H |
||||
|
||||
#include "nodes/nodes.h" |
||||
|
||||
|
||||
extern Oid TypeShellMake(const char *typeName, Oid typeNamespace); |
||||
|
||||
extern Oid TypeCreate(Oid newTypeOid, |
||||
const char *typeName, |
||||
Oid typeNamespace, |
||||
Oid relationOid, |
||||
char relationKind, |
||||
int16 internalSize, |
||||
char typeType, |
||||
char typDelim, |
||||
Oid inputProcedure, |
||||
Oid outputProcedure, |
||||
Oid receiveProcedure, |
||||
Oid sendProcedure, |
||||
Oid typmodinProcedure, |
||||
Oid typmodoutProcedure, |
||||
Oid analyzeProcedure, |
||||
Oid elementType, |
||||
bool isImplicitArray, |
||||
Oid arrayType, |
||||
Oid baseType, |
||||
const char *defaultTypeValue, |
||||
char *defaultTypeBin, |
||||
bool passedByValue, |
||||
char alignment, |
||||
char storage, |
||||
int32 typeMod, |
||||
int32 typNDims, |
||||
bool typeNotNull); |
||||
|
||||
extern void GenerateTypeDependencies(Oid typeNamespace, |
||||
Oid typeObjectId, |
||||
Oid relationOid, |
||||
char relationKind, |
||||
Oid owner, |
||||
Oid inputProcedure, |
||||
Oid outputProcedure, |
||||
Oid receiveProcedure, |
||||
Oid sendProcedure, |
||||
Oid typmodinProcedure, |
||||
Oid typmodoutProcedure, |
||||
Oid analyzeProcedure, |
||||
Oid elementType, |
||||
bool isImplicitArray, |
||||
Oid baseType, |
||||
Node *defaultExpr, |
||||
bool rebuild); |
||||
|
||||
extern void RenameTypeInternal(Oid typeOid, const char *newTypeName, |
||||
Oid typeNamespace); |
||||
|
||||
extern char *makeArrayTypeName(const char *typeName, Oid typeNamespace); |
||||
|
||||
extern bool moveArrayTypeName(Oid typeOid, const char *typeName, |
||||
Oid typeNamespace); |
||||
|
||||
#endif /* PG_TYPE_FN_H */ |
Loading…
Reference in new issue