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

Commit f8c4d7d

Browse files
committed
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.
1 parent a86a9bf commit f8c4d7d

File tree

153 files changed

+541
-385
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

153 files changed

+541
-385
lines changed

contrib/hstore/hstore.h

+5-10
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
1+
/*
2+
* $PostgreSQL: pgsql/contrib/hstore/hstore.h,v 1.6 2008/05/12 00:00:42 alvherre Exp $
3+
*/
14
#ifndef __HSTORE_H__
25
#define __HSTORE_H__
36

4-
#include "postgres.h"
5-
6-
#include "funcapi.h"
7-
#include "access/gist.h"
8-
#include "access/itup.h"
9-
#include "utils/elog.h"
10-
#include "utils/palloc.h"
11-
#include "utils/builtins.h"
12-
#include "storage/bufpage.h"
7+
#include "fmgr.h"
138

149

1510
typedef struct
@@ -53,4 +48,4 @@ int uniquePairs(Pairs * a, int4 l, int4 *buflen);
5348
#define HStoreContainsStrategyNumber 7
5449
#define HStoreExistsStrategyNumber 9
5550

56-
#endif
51+
#endif /* __HSTORE_H__ */

contrib/hstore/hstore_gin.c

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
1-
#include "hstore.h"
1+
/*
2+
* $PostgreSQL: pgsql/contrib/hstore/hstore_gin.c,v 1.4 2008/05/12 00:00:42 alvherre Exp $
3+
*/
4+
#include "postgres.h"
25

36
#include "access/gin.h"
47

8+
#include "hstore.h"
9+
10+
511
#define KEYFLAG 'K'
612
#define VALFLAG 'V'
713
#define NULLFLAG 'N'

contrib/hstore/hstore_gist.c

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
1-
#include "hstore.h"
1+
/*
2+
* $PostgreSQL: pgsql/contrib/hstore/hstore_gist.c,v 1.9 2008/05/12 00:00:42 alvherre Exp $
3+
*/
4+
#include "postgres.h"
25

36
#include "access/gist.h"
47
#include "access/itup.h"
8+
#include "access/skey.h"
59
#include "crc32.h"
610

11+
#include "hstore.h"
12+
713
/* bigint defines */
814
#define BITBYTE 8
915
#define SIGLENINT 4 /* >122 => key will toast, so very slow!!! */

contrib/hstore/hstore_io.c

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1-
#include "hstore.h"
1+
/*
2+
* $PostgreSQL: pgsql/contrib/hstore/hstore_io.c,v 1.8 2008/05/12 00:00:42 alvherre Exp $
3+
*/
4+
#include "postgres.h"
5+
26
#include <ctype.h>
37

8+
#include "hstore.h"
9+
410
PG_MODULE_MAGIC;
511

612
typedef struct

contrib/hstore/hstore_op.c

+9-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1-
#include "hstore.h"
2-
#include "utils/array.h"
1+
/*
2+
* $PostgreSQL
3+
*/
4+
#include "postgres.h"
5+
36
#include "catalog/pg_type.h"
47
#include "funcapi.h"
5-
#include <access/heapam.h>
6-
#include <fmgr.h>
8+
#include "utils/array.h"
9+
#include "utils/builtins.h"
10+
11+
#include "hstore.h"
712

813

914
static HEntry *

contrib/intagg/int_aggregate.c

+1-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* DMN Digital Music Network.
66
* www.dmn.com
77
*
8-
* $PostgreSQL: pgsql/contrib/intagg/int_aggregate.c,v 1.26 2007/02/27 23:48:06 tgl Exp $
8+
* $PostgreSQL: pgsql/contrib/intagg/int_aggregate.c,v 1.27 2008/05/12 00:00:42 alvherre Exp $
99
*
1010
* Copyright (C) Digital Music Network
1111
* December 20, 2001
@@ -19,8 +19,6 @@
1919
#include <ctype.h>
2020
#include <sys/types.h>
2121

22-
#include "access/heapam.h"
23-
#include "access/tupmacs.h"
2422
#include "access/xact.h"
2523
#include "catalog/indexing.h"
2624
#include "catalog/pg_proc.h"

contrib/intarray/_int.h

+1-12
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,7 @@
11
#ifndef ___INT_H__
22
#define ___INT_H__
33

4-
#include "postgres.h"
5-
6-
#include <float.h>
7-
8-
#include "access/gist.h"
9-
#include "access/itup.h"
10-
#include "access/skey.h"
11-
#include "catalog/pg_type.h"
124
#include "utils/array.h"
13-
#include "utils/builtins.h"
14-
#include "storage/bufpage.h"
15-
#include "lib/stringinfo.h"
165

176
/* number ranges for compression */
187
#define MAXNUMRANGE 100
@@ -173,4 +162,4 @@ if (ARRNELEMS(a) > 1) \
173162
qsort((void*)ARRPTR(a), ARRNELEMS(a),sizeof(int4), \
174163
(direction) ? compASC : compDESC )
175164

176-
#endif
165+
#endif /* ___INT_H__ */

contrib/intarray/_int_bool.c

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
#include "postgres.h"
2+
3+
#include "utils/builtins.h"
4+
15
#include "_int.h"
26

37
PG_FUNCTION_INFO_V1(bqarr_in);

contrib/intarray/_int_gin.c

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
#include "postgres.h"
2+
3+
#include "access/gist.h"
4+
#include "access/skey.h"
5+
16
#include "_int.h"
27

38
PG_FUNCTION_INFO_V1(ginint4_queryextract);

contrib/intarray/_int_gist.c

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
#include "postgres.h"
2+
3+
#include "access/gist.h"
4+
#include "access/skey.h"
5+
16
#include "_int.h"
27

38
#define GETENTRY(vec,pos) ((ArrayType *) DatumGetPointer((vec)->vector[(pos)].key))

contrib/intarray/_int_op.c

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
#include "_int.h"
1+
#include "postgres.h"
22

33
#include "lib/stringinfo.h"
44

5+
#include "_int.h"
6+
7+
58
PG_MODULE_MAGIC;
69

710
PG_FUNCTION_INFO_V1(_int_different);

contrib/intarray/_int_tool.c

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
#include "postgres.h"
2+
3+
#include "catalog/pg_type.h"
4+
15
#include "_int.h"
26

37

contrib/intarray/_intbig_gist.c

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
#include "postgres.h"
2+
3+
#include "access/gist.h"
4+
#include "access/skey.h"
5+
16
#include "_int.h"
27

38
#define GETENTRY(vec,pos) ((GISTTYPE *) DatumGetPointer((vec)->vector[(pos)].key))

contrib/ltree/_ltree_gist.c

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22
* GiST support for ltree[]
33
* Teodor Sigaev <teodor@stack.net>
44
*/
5+
#include "postgres.h"
56

6-
#include "ltree.h"
77
#include "access/gist.h"
88
#include "access/skey.h"
99
#include "utils/array.h"
10-
1110
#include "crc32.h"
11+
#include "ltree.h"
12+
1213

1314
PG_FUNCTION_INFO_V1(_ltree_compress);
1415
Datum _ltree_compress(PG_FUNCTION_ARGS);

contrib/ltree/_ltree_op.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22
* op function for ltree[]
33
* Teodor Sigaev <teodor@stack.net>
44
*/
5+
#include "postgres.h"
56

6-
#include "ltree.h"
77
#include <ctype.h>
8+
89
#include "utils/array.h"
10+
#include "ltree.h"
911

1012
PG_FUNCTION_INFO_V1(_ltree_isparent);
1113
PG_FUNCTION_INFO_V1(_ltree_r_isparent);

contrib/ltree/lquery_op.c

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
/*
22
* op function for ltree and lquery
33
* Teodor Sigaev <teodor@stack.net>
4-
* $PostgreSQL: pgsql/contrib/ltree/lquery_op.c,v 1.11 2006/10/04 00:29:45 momjian Exp $
4+
* $PostgreSQL: pgsql/contrib/ltree/lquery_op.c,v 1.12 2008/05/12 00:00:42 alvherre Exp $
55
*/
6+
#include "postgres.h"
67

7-
#include "ltree.h"
88
#include <ctype.h>
9+
910
#include "utils/array.h"
11+
#include "ltree.h"
1012

1113
PG_FUNCTION_INFO_V1(ltq_regex);
1214
PG_FUNCTION_INFO_V1(ltq_rregex);

contrib/ltree/ltree.h

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
/* $PostgreSQL: pgsql/contrib/ltree/ltree.h,v 1.19 2007/11/16 00:13:02 momjian Exp $ */
1+
/* $PostgreSQL: pgsql/contrib/ltree/ltree.h,v 1.20 2008/05/12 00:00:42 alvherre Exp $ */
22

33
#ifndef __LTREE_H__
44
#define __LTREE_H__
55

6-
#include "postgres.h"
7-
8-
#include "utils/builtins.h"
6+
#include "fmgr.h"
97

108
typedef struct
119
{

contrib/ltree/ltree_gist.c

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
/*
22
* GiST support for ltree
33
* Teodor Sigaev <teodor@stack.net>
4-
* $PostgreSQL: pgsql/contrib/ltree/ltree_gist.c,v 1.23 2008/04/14 17:05:32 tgl Exp $
4+
* $PostgreSQL: pgsql/contrib/ltree/ltree_gist.c,v 1.24 2008/05/12 00:00:42 alvherre Exp $
55
*/
6+
#include "postgres.h"
67

7-
#include "ltree.h"
88
#include "access/gist.h"
99
#include "access/nbtree.h"
1010
#include "access/skey.h"
1111
#include "utils/array.h"
1212
#include "crc32.h"
13+
#include "ltree.h"
1314

1415
#define NEXTVAL(x) ( (lquery*)( (char*)(x) + INTALIGN( VARSIZE(x) ) ) )
1516

contrib/ltree/ltree_io.c

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
/*
22
* in/out function for ltree and lquery
33
* Teodor Sigaev <teodor@stack.net>
4-
* $PostgreSQL: pgsql/contrib/ltree/ltree_io.c,v 1.15 2008/04/11 22:52:05 tgl Exp $
4+
* $PostgreSQL: pgsql/contrib/ltree/ltree_io.c,v 1.16 2008/05/12 00:00:43 alvherre Exp $
55
*/
6+
#include "postgres.h"
67

7-
#include "ltree.h"
88
#include <ctype.h>
9+
10+
#include "ltree.h"
911
#include "crc32.h"
1012

1113
PG_FUNCTION_INFO_V1(ltree_in);

contrib/ltree/ltree_op.c

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
/*
22
* op function for ltree
33
* Teodor Sigaev <teodor@stack.net>
4-
* $PostgreSQL: pgsql/contrib/ltree/ltree_op.c,v 1.18 2008/03/25 22:42:41 tgl Exp $
4+
* $PostgreSQL: pgsql/contrib/ltree/ltree_op.c,v 1.19 2008/05/12 00:00:43 alvherre Exp $
55
*/
6-
7-
#include "ltree.h"
6+
#include "postgres.h"
87

98
#include <ctype.h>
109

1110
#include "catalog/pg_statistic.h"
11+
#include "utils/builtins.h"
1212
#include "utils/lsyscache.h"
1313
#include "utils/selfuncs.h"
1414
#include "utils/syscache.h"
15+
#include "ltree.h"
1516

1617
PG_MODULE_MAGIC;
1718

contrib/ltree/ltxtquery_io.c

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
/*
22
* txtquery io
33
* Teodor Sigaev <teodor@stack.net>
4-
* $PostgreSQL: pgsql/contrib/ltree/ltxtquery_io.c,v 1.14 2007/11/15 22:25:14 momjian Exp $
4+
* $PostgreSQL: pgsql/contrib/ltree/ltxtquery_io.c,v 1.15 2008/05/12 00:00:43 alvherre Exp $
55
*/
6+
#include "postgres.h"
67

7-
#include "ltree.h"
88
#include <ctype.h>
9+
910
#include "crc32.h"
11+
#include "ltree.h"
1012

1113
PG_FUNCTION_INFO_V1(ltxtq_in);
1214
Datum ltxtq_in(PG_FUNCTION_ARGS);

contrib/ltree/ltxtquery_op.c

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
/*
22
* txtquery operations with ltree
33
* Teodor Sigaev <teodor@stack.net>
4-
* $PostgreSQL: pgsql/contrib/ltree/ltxtquery_op.c,v 1.7 2007/11/15 22:25:14 momjian Exp $
4+
* $PostgreSQL: pgsql/contrib/ltree/ltxtquery_op.c,v 1.8 2008/05/12 00:00:43 alvherre Exp $
55
*/
6+
#include "postgres.h"
67

7-
#include "ltree.h"
88
#include <ctype.h>
99

10+
#include "ltree.h"
11+
1012
PG_FUNCTION_INFO_V1(ltxtq_exec);
1113
PG_FUNCTION_INFO_V1(ltxtq_rexec);
1214

contrib/pageinspect/btreefuncs.c

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#include "catalog/pg_type.h"
3131
#include "funcapi.h"
3232
#include "miscadmin.h"
33+
#include "storage/bufmgr.h"
3334
#include "utils/builtins.h"
3435

3536

contrib/pageinspect/rawpage.c

+5-4
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,22 @@
88
* Copyright (c) 2007-2008, PostgreSQL Global Development Group
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/contrib/pageinspect/rawpage.c,v 1.5 2008/03/25 22:42:41 tgl Exp $
11+
* $PostgreSQL: pgsql/contrib/pageinspect/rawpage.c,v 1.6 2008/05/12 00:00:43 alvherre Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
1515

1616
#include "postgres.h"
1717

18-
#include "fmgr.h"
19-
#include "funcapi.h"
2018
#include "access/heapam.h"
2119
#include "access/transam.h"
2220
#include "catalog/namespace.h"
2321
#include "catalog/pg_type.h"
24-
#include "utils/builtins.h"
22+
#include "fmgr.h"
23+
#include "funcapi.h"
2524
#include "miscadmin.h"
25+
#include "storage/bufmgr.h"
26+
#include "utils/builtins.h"
2627

2728
PG_MODULE_MAGIC;
2829

contrib/pg_freespacemap/pg_freespacemap.c

+4-3
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,16 @@
33
* pg_freespacemap.c
44
* display some contents of the free space relation and page maps.
55
*
6-
* $PostgreSQL: pgsql/contrib/pg_freespacemap/pg_freespacemap.c,v 1.9 2006/10/19 18:32:46 tgl Exp $
6+
* $PostgreSQL: pgsql/contrib/pg_freespacemap/pg_freespacemap.c,v 1.10 2008/05/12 00:00:43 alvherre Exp $
77
*-------------------------------------------------------------------------
88
*/
99
#include "postgres.h"
1010

11-
#include "funcapi.h"
12-
#include "access/heapam.h"
11+
#include "access/htup.h"
1312
#include "catalog/pg_type.h"
13+
#include "funcapi.h"
1414
#include "storage/freespace.h"
15+
#include "storage/lmgr.h"
1516

1617

1718
#define NUM_FREESPACE_PAGES_ELEM 5

0 commit comments

Comments
 (0)