-
Notifications
You must be signed in to change notification settings - Fork 16
/
gist.h
152 lines (122 loc) · 3.58 KB
/
gist.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
#ifndef __PGS_GIST_H__
#define __PGS_GIST_H__
#include "key.h"
/*
* GIST index declarations
*/
/* An alias for unsigned char */
typedef unsigned char uchar;
/* PGS_KEY_REL Key relationships */
#define SCKEY_DISJ 0 /* two keys are disjunct */
#define SCKEY_OVERLAP 1 /* two keys are overlapping */
#define SCKEY_IN 2 /* first key contains second key */
#define SCKEY_SAME 3 /* keys are equal */
uchar spherekey_interleave(const int32 *k1, const int32 *k2);
/*
* For given "query" of "pgstype" of PGS_DATA_TYPES type, puts key of cached
* query into "key" pointer. Returns true when given query is equal to
* current query.
*/
bool gq_cache_get_value(unsigned pgstype, const void *query, int32 **key);
/*
* Copy current query, type and its key value to cache.
*/
void gq_cache_set_value(unsigned pgstype, const void *query, const int32 *key);
/*
* Input function of key value. Just a dummy. But PostgreSQL need this
* function to create a data type.
*/
Datum spherekey_in(PG_FUNCTION_ARGS);
/*
* Output function of key value. Just a dummy. But PostgreSQL need this
* function to create a data type.
*/
Datum spherekey_out(PG_FUNCTION_ARGS);
/*
* GIST's decompress method. This function does nothing.
*/
Datum g_spherekey_decompress(PG_FUNCTION_ARGS);
/*
* GIST's compress method for circle. Creates the key value from a spherical
* circle.
*/
Datum g_scircle_compress(PG_FUNCTION_ARGS);
/*
* GIST's compress method for point. Creates the key value from a spherical point.
*/
Datum g_spoint_compress(PG_FUNCTION_ARGS);
/*
* GIST's compress method for line. Creates the key value from a spherical line.
*/
Datum g_sline_compress(PG_FUNCTION_ARGS);
/*
* GIST's compress method for path. Creates the key value from a spherical path.
*/
Datum g_spath_compress(PG_FUNCTION_ARGS);
/*
* GIST's compress method for polygon. Creates the key value from a spherical
* polygon.
*/
Datum g_spoly_compress(PG_FUNCTION_ARGS);
/*
* GIST's compress method for ellipse. Creates the key value from a spherical
* ellipse.
*/
Datum g_sellipse_compress(PG_FUNCTION_ARGS);
/*
* GIST's compress method for box. Creates the key value from a spherical box.
*/
Datum g_sbox_compress(PG_FUNCTION_ARGS);
/*
* The GiST Union method for boxes. Returns the minimal bounding box that
* encloses all the entries in entryvec.
*/
Datum g_spherekey_union(PG_FUNCTION_ARGS);
/*
* GIST's equality method.
*/
Datum g_spherekey_same(PG_FUNCTION_ARGS);
/*
* GIST's consistent method for a point.
*/
Datum g_spoint_consistent(PG_FUNCTION_ARGS);
/*
* GIST's consistent method for a circle.
*/
Datum g_scircle_consistent(PG_FUNCTION_ARGS);
/*
* GIST's consistent method for a line.
*/
Datum g_sline_consistent(PG_FUNCTION_ARGS);
/*
* GIST's consistent method for a path.
*/
Datum g_spath_consistent(PG_FUNCTION_ARGS);
/*
* GIST's consistent method for a polygon.
*/
Datum g_spoly_consistent(PG_FUNCTION_ARGS);
/*
* GIST's consistent method for an ellipse.
*/
Datum g_sellipse_consistent(PG_FUNCTION_ARGS);
/*
* GIST's consistent method for a box.
*/
Datum g_sbox_consistent(PG_FUNCTION_ARGS);
/*
* GIST's penalty method.
*/
Datum g_spherekey_penalty(PG_FUNCTION_ARGS);
/*
* GIST's picksplit method. This method is using the double sorting node
* splitting algorithm for R-Trees. See "A new double sorting-based node
* splitting algorithm for R-tree", A. Korotkov.
*/
Datum g_spherekey_picksplit(PG_FUNCTION_ARGS);
Datum pointkey_in(PG_FUNCTION_ARGS);
Datum pointkey_out(PG_FUNCTION_ARGS);
Datum pointkey_volume(PG_FUNCTION_ARGS);
Datum pointkey_area(PG_FUNCTION_ARGS);
Datum pointkey_perimeter(PG_FUNCTION_ARGS);
#endif