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

Lines changed: 5 additions & 10 deletions
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

Lines changed: 7 additions & 1 deletion
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

Lines changed: 7 additions & 1 deletion
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

Lines changed: 7 additions & 1 deletion
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

Lines changed: 9 additions & 4 deletions
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

Lines changed: 1 addition & 3 deletions
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

Lines changed: 1 addition & 12 deletions
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

Lines changed: 4 additions & 0 deletions
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

Lines changed: 5 additions & 0 deletions
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

Lines changed: 5 additions & 0 deletions
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))

0 commit comments

Comments
 (0)