1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-31 22:04:40 +03:00

Restructure some header files a bit, in particular heapam.h, by removing some

unnecessary #include lines in it.  Also, move some tuple routine prototypes and
macros to htup.h, which allows removal of heapam.h inclusion from some .c
files.

For this to work, a new header file access/sysattr.h needed to be created,
initially containing attribute numbers of system columns, for pg_dump usage.

While at it, make contrib ltree, intarray and hstore header files more
consistent with our header style.
This commit is contained in:
Alvaro Herrera
2008-05-12 00:00:54 +00:00
parent a86a9bf9fe
commit f8c4d7db60
153 changed files with 542 additions and 386 deletions

View File

@ -1,15 +1,10 @@
/*
* $PostgreSQL: pgsql/contrib/hstore/hstore.h,v 1.6 2008/05/12 00:00:42 alvherre Exp $
*/
#ifndef __HSTORE_H__
#define __HSTORE_H__
#include "postgres.h"
#include "funcapi.h"
#include "access/gist.h"
#include "access/itup.h"
#include "utils/elog.h"
#include "utils/palloc.h"
#include "utils/builtins.h"
#include "storage/bufpage.h"
#include "fmgr.h"
typedef struct
@ -53,4 +48,4 @@ int uniquePairs(Pairs * a, int4 l, int4 *buflen);
#define HStoreContainsStrategyNumber 7
#define HStoreExistsStrategyNumber 9
#endif
#endif /* __HSTORE_H__ */

View File

@ -1,7 +1,13 @@
#include "hstore.h"
/*
* $PostgreSQL: pgsql/contrib/hstore/hstore_gin.c,v 1.4 2008/05/12 00:00:42 alvherre Exp $
*/
#include "postgres.h"
#include "access/gin.h"
#include "hstore.h"
#define KEYFLAG 'K'
#define VALFLAG 'V'
#define NULLFLAG 'N'

View File

@ -1,9 +1,15 @@
#include "hstore.h"
/*
* $PostgreSQL: pgsql/contrib/hstore/hstore_gist.c,v 1.9 2008/05/12 00:00:42 alvherre Exp $
*/
#include "postgres.h"
#include "access/gist.h"
#include "access/itup.h"
#include "access/skey.h"
#include "crc32.h"
#include "hstore.h"
/* bigint defines */
#define BITBYTE 8
#define SIGLENINT 4 /* >122 => key will toast, so very slow!!! */

View File

@ -1,6 +1,12 @@
#include "hstore.h"
/*
* $PostgreSQL: pgsql/contrib/hstore/hstore_io.c,v 1.8 2008/05/12 00:00:42 alvherre Exp $
*/
#include "postgres.h"
#include <ctype.h>
#include "hstore.h"
PG_MODULE_MAGIC;
typedef struct

View File

@ -1,9 +1,14 @@
#include "hstore.h"
#include "utils/array.h"
/*
* $PostgreSQL
*/
#include "postgres.h"
#include "catalog/pg_type.h"
#include "funcapi.h"
#include <access/heapam.h>
#include <fmgr.h>
#include "utils/array.h"
#include "utils/builtins.h"
#include "hstore.h"
static HEntry *

View File

@ -5,7 +5,7 @@
* DMN Digital Music Network.
* www.dmn.com
*
* $PostgreSQL: pgsql/contrib/intagg/int_aggregate.c,v 1.26 2007/02/27 23:48:06 tgl Exp $
* $PostgreSQL: pgsql/contrib/intagg/int_aggregate.c,v 1.27 2008/05/12 00:00:42 alvherre Exp $
*
* Copyright (C) Digital Music Network
* December 20, 2001
@ -19,8 +19,6 @@
#include <ctype.h>
#include <sys/types.h>
#include "access/heapam.h"
#include "access/tupmacs.h"
#include "access/xact.h"
#include "catalog/indexing.h"
#include "catalog/pg_proc.h"

View File

@ -1,18 +1,7 @@
#ifndef ___INT_H__
#define ___INT_H__
#include "postgres.h"
#include <float.h>
#include "access/gist.h"
#include "access/itup.h"
#include "access/skey.h"
#include "catalog/pg_type.h"
#include "utils/array.h"
#include "utils/builtins.h"
#include "storage/bufpage.h"
#include "lib/stringinfo.h"
/* number ranges for compression */
#define MAXNUMRANGE 100
@ -173,4 +162,4 @@ if (ARRNELEMS(a) > 1) \
qsort((void*)ARRPTR(a), ARRNELEMS(a),sizeof(int4), \
(direction) ? compASC : compDESC )
#endif
#endif /* ___INT_H__ */

View File

@ -1,3 +1,7 @@
#include "postgres.h"
#include "utils/builtins.h"
#include "_int.h"
PG_FUNCTION_INFO_V1(bqarr_in);

View File

@ -1,3 +1,8 @@
#include "postgres.h"
#include "access/gist.h"
#include "access/skey.h"
#include "_int.h"
PG_FUNCTION_INFO_V1(ginint4_queryextract);

View File

@ -1,3 +1,8 @@
#include "postgres.h"
#include "access/gist.h"
#include "access/skey.h"
#include "_int.h"
#define GETENTRY(vec,pos) ((ArrayType *) DatumGetPointer((vec)->vector[(pos)].key))

View File

@ -1,7 +1,10 @@
#include "_int.h"
#include "postgres.h"
#include "lib/stringinfo.h"
#include "_int.h"
PG_MODULE_MAGIC;
PG_FUNCTION_INFO_V1(_int_different);

View File

@ -1,3 +1,7 @@
#include "postgres.h"
#include "catalog/pg_type.h"
#include "_int.h"

View File

@ -1,3 +1,8 @@
#include "postgres.h"
#include "access/gist.h"
#include "access/skey.h"
#include "_int.h"
#define GETENTRY(vec,pos) ((GISTTYPE *) DatumGetPointer((vec)->vector[(pos)].key))

View File

@ -2,13 +2,14 @@
* GiST support for ltree[]
* Teodor Sigaev <teodor@stack.net>
*/
#include "postgres.h"
#include "ltree.h"
#include "access/gist.h"
#include "access/skey.h"
#include "utils/array.h"
#include "crc32.h"
#include "ltree.h"
PG_FUNCTION_INFO_V1(_ltree_compress);
Datum _ltree_compress(PG_FUNCTION_ARGS);

View File

@ -2,10 +2,12 @@
* op function for ltree[]
* Teodor Sigaev <teodor@stack.net>
*/
#include "postgres.h"
#include "ltree.h"
#include <ctype.h>
#include "utils/array.h"
#include "ltree.h"
PG_FUNCTION_INFO_V1(_ltree_isparent);
PG_FUNCTION_INFO_V1(_ltree_r_isparent);

View File

@ -1,12 +1,14 @@
/*
* op function for ltree and lquery
* Teodor Sigaev <teodor@stack.net>
* $PostgreSQL: pgsql/contrib/ltree/lquery_op.c,v 1.11 2006/10/04 00:29:45 momjian Exp $
* $PostgreSQL: pgsql/contrib/ltree/lquery_op.c,v 1.12 2008/05/12 00:00:42 alvherre Exp $
*/
#include "postgres.h"
#include "ltree.h"
#include <ctype.h>
#include "utils/array.h"
#include "ltree.h"
PG_FUNCTION_INFO_V1(ltq_regex);
PG_FUNCTION_INFO_V1(ltq_rregex);

View File

@ -1,11 +1,9 @@
/* $PostgreSQL: pgsql/contrib/ltree/ltree.h,v 1.19 2007/11/16 00:13:02 momjian Exp $ */
/* $PostgreSQL: pgsql/contrib/ltree/ltree.h,v 1.20 2008/05/12 00:00:42 alvherre Exp $ */
#ifndef __LTREE_H__
#define __LTREE_H__
#include "postgres.h"
#include "utils/builtins.h"
#include "fmgr.h"
typedef struct
{

View File

@ -1,15 +1,16 @@
/*
* GiST support for ltree
* Teodor Sigaev <teodor@stack.net>
* $PostgreSQL: pgsql/contrib/ltree/ltree_gist.c,v 1.23 2008/04/14 17:05:32 tgl Exp $
* $PostgreSQL: pgsql/contrib/ltree/ltree_gist.c,v 1.24 2008/05/12 00:00:42 alvherre Exp $
*/
#include "postgres.h"
#include "ltree.h"
#include "access/gist.h"
#include "access/nbtree.h"
#include "access/skey.h"
#include "utils/array.h"
#include "crc32.h"
#include "ltree.h"
#define NEXTVAL(x) ( (lquery*)( (char*)(x) + INTALIGN( VARSIZE(x) ) ) )

View File

@ -1,11 +1,13 @@
/*
* in/out function for ltree and lquery
* Teodor Sigaev <teodor@stack.net>
* $PostgreSQL: pgsql/contrib/ltree/ltree_io.c,v 1.15 2008/04/11 22:52:05 tgl Exp $
* $PostgreSQL: pgsql/contrib/ltree/ltree_io.c,v 1.16 2008/05/12 00:00:43 alvherre Exp $
*/
#include "postgres.h"
#include <ctype.h>
#include "ltree.h"
#include <ctype.h>
#include "crc32.h"
PG_FUNCTION_INFO_V1(ltree_in);

View File

@ -1,17 +1,18 @@
/*
* op function for ltree
* Teodor Sigaev <teodor@stack.net>
* $PostgreSQL: pgsql/contrib/ltree/ltree_op.c,v 1.18 2008/03/25 22:42:41 tgl Exp $
* $PostgreSQL: pgsql/contrib/ltree/ltree_op.c,v 1.19 2008/05/12 00:00:43 alvherre Exp $
*/
#include "ltree.h"
#include "postgres.h"
#include <ctype.h>
#include "catalog/pg_statistic.h"
#include "utils/builtins.h"
#include "utils/lsyscache.h"
#include "utils/selfuncs.h"
#include "utils/syscache.h"
#include "ltree.h"
PG_MODULE_MAGIC;

View File

@ -1,12 +1,14 @@
/*
* txtquery io
* Teodor Sigaev <teodor@stack.net>
* $PostgreSQL: pgsql/contrib/ltree/ltxtquery_io.c,v 1.14 2007/11/15 22:25:14 momjian Exp $
* $PostgreSQL: pgsql/contrib/ltree/ltxtquery_io.c,v 1.15 2008/05/12 00:00:43 alvherre Exp $
*/
#include "postgres.h"
#include "ltree.h"
#include <ctype.h>
#include "crc32.h"
#include "ltree.h"
PG_FUNCTION_INFO_V1(ltxtq_in);
Datum ltxtq_in(PG_FUNCTION_ARGS);

View File

@ -1,11 +1,13 @@
/*
* txtquery operations with ltree
* Teodor Sigaev <teodor@stack.net>
* $PostgreSQL: pgsql/contrib/ltree/ltxtquery_op.c,v 1.7 2007/11/15 22:25:14 momjian Exp $
* $PostgreSQL: pgsql/contrib/ltree/ltxtquery_op.c,v 1.8 2008/05/12 00:00:43 alvherre Exp $
*/
#include "postgres.h"
#include <ctype.h>
#include "ltree.h"
#include <ctype.h>
PG_FUNCTION_INFO_V1(ltxtq_exec);
PG_FUNCTION_INFO_V1(ltxtq_rexec);

View File

@ -30,6 +30,7 @@
#include "catalog/pg_type.h"
#include "funcapi.h"
#include "miscadmin.h"
#include "storage/bufmgr.h"
#include "utils/builtins.h"

View File

@ -8,21 +8,22 @@
* Copyright (c) 2007-2008, PostgreSQL Global Development Group
*
* IDENTIFICATION
* $PostgreSQL: pgsql/contrib/pageinspect/rawpage.c,v 1.5 2008/03/25 22:42:41 tgl Exp $
* $PostgreSQL: pgsql/contrib/pageinspect/rawpage.c,v 1.6 2008/05/12 00:00:43 alvherre Exp $
*
*-------------------------------------------------------------------------
*/
#include "postgres.h"
#include "fmgr.h"
#include "funcapi.h"
#include "access/heapam.h"
#include "access/transam.h"
#include "catalog/namespace.h"
#include "catalog/pg_type.h"
#include "utils/builtins.h"
#include "fmgr.h"
#include "funcapi.h"
#include "miscadmin.h"
#include "storage/bufmgr.h"
#include "utils/builtins.h"
PG_MODULE_MAGIC;

View File

@ -3,15 +3,16 @@
* pg_freespacemap.c
* display some contents of the free space relation and page maps.
*
* $PostgreSQL: pgsql/contrib/pg_freespacemap/pg_freespacemap.c,v 1.9 2006/10/19 18:32:46 tgl Exp $
* $PostgreSQL: pgsql/contrib/pg_freespacemap/pg_freespacemap.c,v 1.10 2008/05/12 00:00:43 alvherre Exp $
*-------------------------------------------------------------------------
*/
#include "postgres.h"
#include "funcapi.h"
#include "access/heapam.h"
#include "access/htup.h"
#include "catalog/pg_type.h"
#include "funcapi.h"
#include "storage/freespace.h"
#include "storage/lmgr.h"
#define NUM_FREESPACE_PAGES_ELEM 5

View File

@ -1,5 +1,5 @@
/*
* $PostgreSQL: pgsql/contrib/pgrowlocks/pgrowlocks.c,v 1.9 2008/03/26 21:10:36 alvherre Exp $
* $PostgreSQL: pgsql/contrib/pgrowlocks/pgrowlocks.c,v 1.10 2008/05/12 00:00:43 alvherre Exp $
*
* Copyright (c) 2005-2006 Tatsuo Ishii
*
@ -30,6 +30,7 @@
#include "catalog/namespace.h"
#include "funcapi.h"
#include "miscadmin.h"
#include "storage/bufmgr.h"
#include "storage/procarray.h"
#include "utils/acl.h"
#include "utils/builtins.h"

View File

@ -29,6 +29,7 @@
#include "catalog/namespace.h"
#include "funcapi.h"
#include "miscadmin.h"
#include "storage/bufmgr.h"
#include "utils/builtins.h"

View File

@ -1,5 +1,5 @@
/*
* $PostgreSQL: pgsql/contrib/pgstattuple/pgstattuple.c,v 1.33 2008/03/26 21:10:36 alvherre Exp $
* $PostgreSQL: pgsql/contrib/pgstattuple/pgstattuple.c,v 1.34 2008/05/12 00:00:43 alvherre Exp $
*
* Copyright (c) 2001,2002 Tatsuo Ishii
*
@ -27,10 +27,12 @@
#include "access/gist_private.h"
#include "access/hash.h"
#include "access/heapam.h"
#include "access/htup.h"
#include "access/nbtree.h"
#include "catalog/namespace.h"
#include "funcapi.h"
#include "miscadmin.h"
#include "storage/bufmgr.h"
#include "utils/builtins.h"
#include "utils/tqual.h"