summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/include')
-rw-r--r--src/include/catalog/catversion.h4
-rw-r--r--src/include/catalog/pg_language.h16
-rw-r--r--src/include/fmgr.h46
-rw-r--r--src/include/utils/fmgrtab.h4
-rw-r--r--src/include/utils/lsyscache.h5
5 files changed, 55 insertions, 20 deletions
diff --git a/src/include/catalog/catversion.h b/src/include/catalog/catversion.h
index e3f4c6ff89..558feef575 100644
--- a/src/include/catalog/catversion.h
+++ b/src/include/catalog/catversion.h
@@ -37,7 +37,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: catversion.h,v 1.61 2000/11/20 05:18:40 vadim Exp $
+ * $Id: catversion.h,v 1.62 2000/11/20 20:36:50 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -53,6 +53,6 @@
*/
/* yyyymmddN */
-#define CATALOG_VERSION_NO 200011191
+#define CATALOG_VERSION_NO 200011201
#endif
diff --git a/src/include/catalog/pg_language.h b/src/include/catalog/pg_language.h
index 0d597d8c4d..423f2e9470 100644
--- a/src/include/catalog/pg_language.h
+++ b/src/include/catalog/pg_language.h
@@ -8,7 +8,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: pg_language.h,v 1.11 2000/05/28 17:56:16 tgl Exp $
+ * $Id: pg_language.h,v 1.12 2000/11/20 20:36:50 tgl Exp $
*
* NOTES
* the genbki.sh script reads this file and generates .bki
@@ -63,18 +63,12 @@ typedef FormData_pg_language *Form_pg_language;
* ----------------
*/
-DATA(insert OID = 11 ( internal f f 0 "n/a" ));
-DESCR("old-style built-in functions");
-#define INTERNALlanguageId 11
-DATA(insert OID = 12 ( newinternal f f 0 "n/a" ));
-DESCR("new-style built-in functions");
-#define NEWINTERNALlanguageId 12
+DATA(insert OID = 12 ( internal f f 0 "n/a" ));
+DESCR("Built-in functions");
+#define INTERNALlanguageId 12
DATA(insert OID = 13 ( "C" f f 0 "/bin/cc" ));
-DESCR("Dynamically-loaded old-style C functions");
+DESCR("Dynamically-loaded C functions");
#define ClanguageId 13
-DATA(insert OID = 10 ( "newC" f f 0 "/bin/cc" ));
-DESCR("Dynamically-loaded new-style C functions");
-#define NEWClanguageId 10
DATA(insert OID = 14 ( "sql" f f 0 "postgres"));
DESCR("SQL-language functions");
#define SQLlanguageId 14
diff --git a/src/include/fmgr.h b/src/include/fmgr.h
index 28634262bc..08faf95629 100644
--- a/src/include/fmgr.h
+++ b/src/include/fmgr.h
@@ -11,7 +11,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: fmgr.h,v 1.10 2000/08/24 03:29:11 tgl Exp $
+ * $Id: fmgr.h,v 1.11 2000/11/20 20:36:50 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -209,6 +209,43 @@ extern struct varlena * pg_detoast_datum_copy(struct varlena * datum);
/*-------------------------------------------------------------------------
+ * Support for detecting call convention of dynamically-loaded functions
+ *
+ * Dynamically loaded functions may use either the version-1 ("new style")
+ * or version-0 ("old style") calling convention. Version 1 is the call
+ * convention defined in this header file; version 0 is the old "plain C"
+ * convention. A version-1 function must be accompanied by the macro call
+ *
+ * PG_FUNCTION_INFO_V1(function_name);
+ *
+ * Note that internal functions do not need this decoration since they are
+ * assumed to be version-1.
+ *
+ *-------------------------------------------------------------------------
+ */
+
+typedef struct
+{
+ int api_version; /* specifies call convention version number */
+ /* More fields may be added later, for version numbers > 1. */
+} Pg_finfo_record;
+
+/* Expected signature of an info function */
+typedef Pg_finfo_record * (*PGFInfoFunction) (void);
+
+/* Macro to build an info function associated with the given function name */
+
+#define PG_FUNCTION_INFO_V1(funcname) \
+extern Pg_finfo_record * CppConcat(pg_finfo_,funcname) (void); \
+Pg_finfo_record * \
+CppConcat(pg_finfo_,funcname) (void) \
+{ \
+ static Pg_finfo_record my_finfo = { 1 }; \
+ return &my_finfo; \
+}
+
+
+/*-------------------------------------------------------------------------
* Support routines and macros for callers of fmgr-compatible functions
*-------------------------------------------------------------------------
*/
@@ -297,13 +334,14 @@ extern Datum OidFunctionCall9(Oid functionId, Datum arg1, Datum arg2,
/*
* Routines in fmgr.c
*/
-extern Oid fmgr_internal_language(const char *proname);
+extern Pg_finfo_record *fetch_finfo_record(char *filename, char *funcname);
+extern Oid fmgr_internal_function(const char *proname);
/*
* Routines in dfmgr.c
*/
-extern PGFunction fmgr_dynamic(Oid functionId);
-extern PGFunction load_external_function(char *filename, char *funcname);
+extern PGFunction load_external_function(char *filename, char *funcname,
+ bool signalNotFound);
extern void load_file(char *filename);
diff --git a/src/include/utils/fmgrtab.h b/src/include/utils/fmgrtab.h
index e6cfe51965..9d46aeae69 100644
--- a/src/include/utils/fmgrtab.h
+++ b/src/include/utils/fmgrtab.h
@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: fmgrtab.h,v 1.13 2000/05/28 17:56:20 tgl Exp $
+ * $Id: fmgrtab.h,v 1.14 2000/11/20 20:36:51 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -28,7 +28,7 @@ typedef struct
const char *funcName; /* C name of the function */
short nargs; /* 0..FUNC_MAX_ARGS, or -1 if variable count */
bool strict; /* T if function is "strict" */
- bool oldstyle; /* T if function uses old fmgr interface */
+ bool retset; /* T if function returns a set */
PGFunction func; /* pointer to compiled function */
} FmgrBuiltin;
diff --git a/src/include/utils/lsyscache.h b/src/include/utils/lsyscache.h
index f8547baa88..903e09aaf9 100644
--- a/src/include/utils/lsyscache.h
+++ b/src/include/utils/lsyscache.h
@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: lsyscache.h,v 1.27 2000/11/16 22:30:49 tgl Exp $
+ * $Id: lsyscache.h,v 1.28 2000/11/20 20:36:51 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -39,6 +39,9 @@ extern char *get_rel_name(Oid relid);
extern int16 get_typlen(Oid typid);
extern bool get_typbyval(Oid typid);
extern void get_typlenbyval(Oid typid, int16 *typlen, bool *typbyval);
+extern char get_typstorage(Oid typid);
extern Datum get_typdefault(Oid typid);
+#define TypeIsToastable(typid) (get_typstorage(typid) != 'p')
+
#endif /* LSYSCACHE_H */