geo_decls.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444
  1. /*-------------------------------------------------------------------------
  2. *
  3. * geo_decls.h - Declarations for various 2D constructs.
  4. *
  5. *
  6. * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
  7. * Portions Copyright (c) 1994, Regents of the University of California
  8. *
  9. * src/include/utils/geo_decls.h
  10. *
  11. * NOTE
  12. * These routines do *not* use the float types from adt/.
  13. *
  14. * XXX These routines were not written by a numerical analyst.
  15. *
  16. * XXX I have made some attempt to flesh out the operators
  17. * and data types. There are still some more to do. - tgl 97/04/19
  18. *
  19. *-------------------------------------------------------------------------
  20. */
  21. #ifndef GEO_DECLS_H
  22. #define GEO_DECLS_H
  23. #include <math.h>
  24. #include "fmgr.h"
  25. /*--------------------------------------------------------------------
  26. * Useful floating point utilities and constants.
  27. *-------------------------------------------------------------------*/
  28. #define EPSILON 1.0E-06
  29. #ifdef EPSILON
  30. #define FPzero(A) (fabs(A) <= EPSILON)
  31. #define FPeq(A,B) (fabs((A) - (B)) <= EPSILON)
  32. #define FPne(A,B) (fabs((A) - (B)) > EPSILON)
  33. #define FPlt(A,B) ((B) - (A) > EPSILON)
  34. #define FPle(A,B) ((A) - (B) <= EPSILON)
  35. #define FPgt(A,B) ((A) - (B) > EPSILON)
  36. #define FPge(A,B) ((B) - (A) <= EPSILON)
  37. #else
  38. #define FPzero(A) ((A) == 0)
  39. #define FPeq(A,B) ((A) == (B))
  40. #define FPne(A,B) ((A) != (B))
  41. #define FPlt(A,B) ((A) < (B))
  42. #define FPle(A,B) ((A) <= (B))
  43. #define FPgt(A,B) ((A) > (B))
  44. #define FPge(A,B) ((A) >= (B))
  45. #endif
  46. #define HYPOT(A, B) pg_hypot(A, B)
  47. /*---------------------------------------------------------------------
  48. * Point - (x,y)
  49. *-------------------------------------------------------------------*/
  50. typedef struct
  51. {
  52. double x,
  53. y;
  54. } Point;
  55. /*---------------------------------------------------------------------
  56. * LSEG - A straight line, specified by endpoints.
  57. *-------------------------------------------------------------------*/
  58. typedef struct
  59. {
  60. Point p[2];
  61. } LSEG;
  62. /*---------------------------------------------------------------------
  63. * PATH - Specified by vertex points.
  64. *-------------------------------------------------------------------*/
  65. typedef struct
  66. {
  67. int32 vl_len_; /* varlena header (do not touch directly!) */
  68. int32 npts;
  69. int32 closed; /* is this a closed polygon? */
  70. int32 dummy; /* padding to make it double align */
  71. Point p[FLEXIBLE_ARRAY_MEMBER];
  72. } PATH;
  73. /*---------------------------------------------------------------------
  74. * LINE - Specified by its general equation (Ax+By+C=0).
  75. *-------------------------------------------------------------------*/
  76. typedef struct
  77. {
  78. double A,
  79. B,
  80. C;
  81. } LINE;
  82. /*---------------------------------------------------------------------
  83. * BOX - Specified by two corner points, which are
  84. * sorted to save calculation time later.
  85. *-------------------------------------------------------------------*/
  86. typedef struct
  87. {
  88. Point high,
  89. low; /* corner POINTs */
  90. } BOX;
  91. /*---------------------------------------------------------------------
  92. * POLYGON - Specified by an array of doubles defining the points,
  93. * keeping the number of points and the bounding box for
  94. * speed purposes.
  95. *-------------------------------------------------------------------*/
  96. typedef struct
  97. {
  98. int32 vl_len_; /* varlena header (do not touch directly!) */
  99. int32 npts;
  100. BOX boundbox;
  101. Point p[FLEXIBLE_ARRAY_MEMBER];
  102. } POLYGON;
  103. /*---------------------------------------------------------------------
  104. * CIRCLE - Specified by a center point and radius.
  105. *-------------------------------------------------------------------*/
  106. typedef struct
  107. {
  108. Point center;
  109. double radius;
  110. } CIRCLE;
  111. /*
  112. * fmgr interface macros
  113. *
  114. * Path and Polygon are toastable varlena types, the others are just
  115. * fixed-size pass-by-reference types.
  116. */
  117. #define DatumGetPointP(X) ((Point *) DatumGetPointer(X))
  118. #define PointPGetDatum(X) PointerGetDatum(X)
  119. #define PG_GETARG_POINT_P(n) DatumGetPointP(PG_GETARG_DATUM(n))
  120. #define PG_RETURN_POINT_P(x) return PointPGetDatum(x)
  121. #define DatumGetLsegP(X) ((LSEG *) DatumGetPointer(X))
  122. #define LsegPGetDatum(X) PointerGetDatum(X)
  123. #define PG_GETARG_LSEG_P(n) DatumGetLsegP(PG_GETARG_DATUM(n))
  124. #define PG_RETURN_LSEG_P(x) return LsegPGetDatum(x)
  125. #define DatumGetPathP(X) ((PATH *) PG_DETOAST_DATUM(X))
  126. #define DatumGetPathPCopy(X) ((PATH *) PG_DETOAST_DATUM_COPY(X))
  127. #define PathPGetDatum(X) PointerGetDatum(X)
  128. #define PG_GETARG_PATH_P(n) DatumGetPathP(PG_GETARG_DATUM(n))
  129. #define PG_GETARG_PATH_P_COPY(n) DatumGetPathPCopy(PG_GETARG_DATUM(n))
  130. #define PG_RETURN_PATH_P(x) return PathPGetDatum(x)
  131. #define DatumGetLineP(X) ((LINE *) DatumGetPointer(X))
  132. #define LinePGetDatum(X) PointerGetDatum(X)
  133. #define PG_GETARG_LINE_P(n) DatumGetLineP(PG_GETARG_DATUM(n))
  134. #define PG_RETURN_LINE_P(x) return LinePGetDatum(x)
  135. #define DatumGetBoxP(X) ((BOX *) DatumGetPointer(X))
  136. #define BoxPGetDatum(X) PointerGetDatum(X)
  137. #define PG_GETARG_BOX_P(n) DatumGetBoxP(PG_GETARG_DATUM(n))
  138. #define PG_RETURN_BOX_P(x) return BoxPGetDatum(x)
  139. #define DatumGetPolygonP(X) ((POLYGON *) PG_DETOAST_DATUM(X))
  140. #define DatumGetPolygonPCopy(X) ((POLYGON *) PG_DETOAST_DATUM_COPY(X))
  141. #define PolygonPGetDatum(X) PointerGetDatum(X)
  142. #define PG_GETARG_POLYGON_P(n) DatumGetPolygonP(PG_GETARG_DATUM(n))
  143. #define PG_GETARG_POLYGON_P_COPY(n) DatumGetPolygonPCopy(PG_GETARG_DATUM(n))
  144. #define PG_RETURN_POLYGON_P(x) return PolygonPGetDatum(x)
  145. #define DatumGetCircleP(X) ((CIRCLE *) DatumGetPointer(X))
  146. #define CirclePGetDatum(X) PointerGetDatum(X)
  147. #define PG_GETARG_CIRCLE_P(n) DatumGetCircleP(PG_GETARG_DATUM(n))
  148. #define PG_RETURN_CIRCLE_P(x) return CirclePGetDatum(x)
  149. /*
  150. * in geo_ops.h
  151. */
  152. /* public point routines */
  153. extern Datum point_in(PG_FUNCTION_ARGS);
  154. extern Datum point_out(PG_FUNCTION_ARGS);
  155. extern Datum point_recv(PG_FUNCTION_ARGS);
  156. extern Datum point_send(PG_FUNCTION_ARGS);
  157. extern Datum construct_point(PG_FUNCTION_ARGS);
  158. extern Datum point_left(PG_FUNCTION_ARGS);
  159. extern Datum point_right(PG_FUNCTION_ARGS);
  160. extern Datum point_above(PG_FUNCTION_ARGS);
  161. extern Datum point_below(PG_FUNCTION_ARGS);
  162. extern Datum point_vert(PG_FUNCTION_ARGS);
  163. extern Datum point_horiz(PG_FUNCTION_ARGS);
  164. extern Datum point_eq(PG_FUNCTION_ARGS);
  165. extern Datum point_ne(PG_FUNCTION_ARGS);
  166. extern Datum point_distance(PG_FUNCTION_ARGS);
  167. extern Datum point_slope(PG_FUNCTION_ARGS);
  168. extern Datum point_add(PG_FUNCTION_ARGS);
  169. extern Datum point_sub(PG_FUNCTION_ARGS);
  170. extern Datum point_mul(PG_FUNCTION_ARGS);
  171. extern Datum point_div(PG_FUNCTION_ARGS);
  172. /* private routines */
  173. extern double point_dt(Point *pt1, Point *pt2);
  174. extern double point_sl(Point *pt1, Point *pt2);
  175. extern double pg_hypot(double x, double y);
  176. /* public lseg routines */
  177. extern Datum lseg_in(PG_FUNCTION_ARGS);
  178. extern Datum lseg_out(PG_FUNCTION_ARGS);
  179. extern Datum lseg_recv(PG_FUNCTION_ARGS);
  180. extern Datum lseg_send(PG_FUNCTION_ARGS);
  181. extern Datum lseg_intersect(PG_FUNCTION_ARGS);
  182. extern Datum lseg_parallel(PG_FUNCTION_ARGS);
  183. extern Datum lseg_perp(PG_FUNCTION_ARGS);
  184. extern Datum lseg_vertical(PG_FUNCTION_ARGS);
  185. extern Datum lseg_horizontal(PG_FUNCTION_ARGS);
  186. extern Datum lseg_eq(PG_FUNCTION_ARGS);
  187. extern Datum lseg_ne(PG_FUNCTION_ARGS);
  188. extern Datum lseg_lt(PG_FUNCTION_ARGS);
  189. extern Datum lseg_le(PG_FUNCTION_ARGS);
  190. extern Datum lseg_gt(PG_FUNCTION_ARGS);
  191. extern Datum lseg_ge(PG_FUNCTION_ARGS);
  192. extern Datum lseg_construct(PG_FUNCTION_ARGS);
  193. extern Datum lseg_length(PG_FUNCTION_ARGS);
  194. extern Datum lseg_distance(PG_FUNCTION_ARGS);
  195. extern Datum lseg_center(PG_FUNCTION_ARGS);
  196. extern Datum lseg_interpt(PG_FUNCTION_ARGS);
  197. extern Datum dist_pl(PG_FUNCTION_ARGS);
  198. extern Datum dist_ps(PG_FUNCTION_ARGS);
  199. extern Datum dist_ppath(PG_FUNCTION_ARGS);
  200. extern Datum dist_pb(PG_FUNCTION_ARGS);
  201. extern Datum dist_sl(PG_FUNCTION_ARGS);
  202. extern Datum dist_sb(PG_FUNCTION_ARGS);
  203. extern Datum dist_lb(PG_FUNCTION_ARGS);
  204. extern Datum close_lseg(PG_FUNCTION_ARGS);
  205. extern Datum close_pl(PG_FUNCTION_ARGS);
  206. extern Datum close_ps(PG_FUNCTION_ARGS);
  207. extern Datum close_pb(PG_FUNCTION_ARGS);
  208. extern Datum close_sl(PG_FUNCTION_ARGS);
  209. extern Datum close_sb(PG_FUNCTION_ARGS);
  210. extern Datum close_ls(PG_FUNCTION_ARGS);
  211. extern Datum close_lb(PG_FUNCTION_ARGS);
  212. extern Datum on_pl(PG_FUNCTION_ARGS);
  213. extern Datum on_ps(PG_FUNCTION_ARGS);
  214. extern Datum on_pb(PG_FUNCTION_ARGS);
  215. extern Datum on_ppath(PG_FUNCTION_ARGS);
  216. extern Datum on_sl(PG_FUNCTION_ARGS);
  217. extern Datum on_sb(PG_FUNCTION_ARGS);
  218. extern Datum inter_sl(PG_FUNCTION_ARGS);
  219. extern Datum inter_sb(PG_FUNCTION_ARGS);
  220. extern Datum inter_lb(PG_FUNCTION_ARGS);
  221. /* public line routines */
  222. extern Datum line_in(PG_FUNCTION_ARGS);
  223. extern Datum line_out(PG_FUNCTION_ARGS);
  224. extern Datum line_recv(PG_FUNCTION_ARGS);
  225. extern Datum line_send(PG_FUNCTION_ARGS);
  226. extern Datum line_interpt(PG_FUNCTION_ARGS);
  227. extern Datum line_distance(PG_FUNCTION_ARGS);
  228. extern Datum line_construct_pp(PG_FUNCTION_ARGS);
  229. extern Datum line_intersect(PG_FUNCTION_ARGS);
  230. extern Datum line_parallel(PG_FUNCTION_ARGS);
  231. extern Datum line_perp(PG_FUNCTION_ARGS);
  232. extern Datum line_vertical(PG_FUNCTION_ARGS);
  233. extern Datum line_horizontal(PG_FUNCTION_ARGS);
  234. extern Datum line_eq(PG_FUNCTION_ARGS);
  235. /* public box routines */
  236. extern Datum box_in(PG_FUNCTION_ARGS);
  237. extern Datum box_out(PG_FUNCTION_ARGS);
  238. extern Datum box_recv(PG_FUNCTION_ARGS);
  239. extern Datum box_send(PG_FUNCTION_ARGS);
  240. extern Datum box_same(PG_FUNCTION_ARGS);
  241. extern Datum box_overlap(PG_FUNCTION_ARGS);
  242. extern Datum box_left(PG_FUNCTION_ARGS);
  243. extern Datum box_overleft(PG_FUNCTION_ARGS);
  244. extern Datum box_right(PG_FUNCTION_ARGS);
  245. extern Datum box_overright(PG_FUNCTION_ARGS);
  246. extern Datum box_below(PG_FUNCTION_ARGS);
  247. extern Datum box_overbelow(PG_FUNCTION_ARGS);
  248. extern Datum box_above(PG_FUNCTION_ARGS);
  249. extern Datum box_overabove(PG_FUNCTION_ARGS);
  250. extern Datum box_contained(PG_FUNCTION_ARGS);
  251. extern Datum box_contain(PG_FUNCTION_ARGS);
  252. extern Datum box_contain_pt(PG_FUNCTION_ARGS);
  253. extern Datum box_below_eq(PG_FUNCTION_ARGS);
  254. extern Datum box_above_eq(PG_FUNCTION_ARGS);
  255. extern Datum box_lt(PG_FUNCTION_ARGS);
  256. extern Datum box_gt(PG_FUNCTION_ARGS);
  257. extern Datum box_eq(PG_FUNCTION_ARGS);
  258. extern Datum box_le(PG_FUNCTION_ARGS);
  259. extern Datum box_ge(PG_FUNCTION_ARGS);
  260. extern Datum box_area(PG_FUNCTION_ARGS);
  261. extern Datum box_width(PG_FUNCTION_ARGS);
  262. extern Datum box_height(PG_FUNCTION_ARGS);
  263. extern Datum box_distance(PG_FUNCTION_ARGS);
  264. extern Datum box_center(PG_FUNCTION_ARGS);
  265. extern Datum box_intersect(PG_FUNCTION_ARGS);
  266. extern Datum box_diagonal(PG_FUNCTION_ARGS);
  267. extern Datum points_box(PG_FUNCTION_ARGS);
  268. extern Datum box_add(PG_FUNCTION_ARGS);
  269. extern Datum box_sub(PG_FUNCTION_ARGS);
  270. extern Datum box_mul(PG_FUNCTION_ARGS);
  271. extern Datum box_div(PG_FUNCTION_ARGS);
  272. extern Datum point_box(PG_FUNCTION_ARGS);
  273. extern Datum boxes_bound_box(PG_FUNCTION_ARGS);
  274. /* public path routines */
  275. extern Datum path_area(PG_FUNCTION_ARGS);
  276. extern Datum path_in(PG_FUNCTION_ARGS);
  277. extern Datum path_out(PG_FUNCTION_ARGS);
  278. extern Datum path_recv(PG_FUNCTION_ARGS);
  279. extern Datum path_send(PG_FUNCTION_ARGS);
  280. extern Datum path_n_lt(PG_FUNCTION_ARGS);
  281. extern Datum path_n_gt(PG_FUNCTION_ARGS);
  282. extern Datum path_n_eq(PG_FUNCTION_ARGS);
  283. extern Datum path_n_le(PG_FUNCTION_ARGS);
  284. extern Datum path_n_ge(PG_FUNCTION_ARGS);
  285. extern Datum path_inter(PG_FUNCTION_ARGS);
  286. extern Datum path_distance(PG_FUNCTION_ARGS);
  287. extern Datum path_length(PG_FUNCTION_ARGS);
  288. extern Datum path_isclosed(PG_FUNCTION_ARGS);
  289. extern Datum path_isopen(PG_FUNCTION_ARGS);
  290. extern Datum path_npoints(PG_FUNCTION_ARGS);
  291. extern Datum path_close(PG_FUNCTION_ARGS);
  292. extern Datum path_open(PG_FUNCTION_ARGS);
  293. extern Datum path_add(PG_FUNCTION_ARGS);
  294. extern Datum path_add_pt(PG_FUNCTION_ARGS);
  295. extern Datum path_sub_pt(PG_FUNCTION_ARGS);
  296. extern Datum path_mul_pt(PG_FUNCTION_ARGS);
  297. extern Datum path_div_pt(PG_FUNCTION_ARGS);
  298. extern Datum path_center(PG_FUNCTION_ARGS);
  299. extern Datum path_poly(PG_FUNCTION_ARGS);
  300. /* public polygon routines */
  301. extern Datum poly_in(PG_FUNCTION_ARGS);
  302. extern Datum poly_out(PG_FUNCTION_ARGS);
  303. extern Datum poly_recv(PG_FUNCTION_ARGS);
  304. extern Datum poly_send(PG_FUNCTION_ARGS);
  305. extern Datum poly_left(PG_FUNCTION_ARGS);
  306. extern Datum poly_overleft(PG_FUNCTION_ARGS);
  307. extern Datum poly_right(PG_FUNCTION_ARGS);
  308. extern Datum poly_overright(PG_FUNCTION_ARGS);
  309. extern Datum poly_below(PG_FUNCTION_ARGS);
  310. extern Datum poly_overbelow(PG_FUNCTION_ARGS);
  311. extern Datum poly_above(PG_FUNCTION_ARGS);
  312. extern Datum poly_overabove(PG_FUNCTION_ARGS);
  313. extern Datum poly_same(PG_FUNCTION_ARGS);
  314. extern Datum poly_overlap(PG_FUNCTION_ARGS);
  315. extern Datum poly_contain(PG_FUNCTION_ARGS);
  316. extern Datum poly_contained(PG_FUNCTION_ARGS);
  317. extern Datum poly_contain_pt(PG_FUNCTION_ARGS);
  318. extern Datum pt_contained_poly(PG_FUNCTION_ARGS);
  319. extern Datum poly_distance(PG_FUNCTION_ARGS);
  320. extern Datum poly_npoints(PG_FUNCTION_ARGS);
  321. extern Datum poly_center(PG_FUNCTION_ARGS);
  322. extern Datum poly_box(PG_FUNCTION_ARGS);
  323. extern Datum poly_path(PG_FUNCTION_ARGS);
  324. extern Datum box_poly(PG_FUNCTION_ARGS);
  325. /* public circle routines */
  326. extern Datum circle_in(PG_FUNCTION_ARGS);
  327. extern Datum circle_out(PG_FUNCTION_ARGS);
  328. extern Datum circle_recv(PG_FUNCTION_ARGS);
  329. extern Datum circle_send(PG_FUNCTION_ARGS);
  330. extern Datum circle_same(PG_FUNCTION_ARGS);
  331. extern Datum circle_overlap(PG_FUNCTION_ARGS);
  332. extern Datum circle_overleft(PG_FUNCTION_ARGS);
  333. extern Datum circle_left(PG_FUNCTION_ARGS);
  334. extern Datum circle_right(PG_FUNCTION_ARGS);
  335. extern Datum circle_overright(PG_FUNCTION_ARGS);
  336. extern Datum circle_contained(PG_FUNCTION_ARGS);
  337. extern Datum circle_contain(PG_FUNCTION_ARGS);
  338. extern Datum circle_below(PG_FUNCTION_ARGS);
  339. extern Datum circle_above(PG_FUNCTION_ARGS);
  340. extern Datum circle_overbelow(PG_FUNCTION_ARGS);
  341. extern Datum circle_overabove(PG_FUNCTION_ARGS);
  342. extern Datum circle_eq(PG_FUNCTION_ARGS);
  343. extern Datum circle_ne(PG_FUNCTION_ARGS);
  344. extern Datum circle_lt(PG_FUNCTION_ARGS);
  345. extern Datum circle_gt(PG_FUNCTION_ARGS);
  346. extern Datum circle_le(PG_FUNCTION_ARGS);
  347. extern Datum circle_ge(PG_FUNCTION_ARGS);
  348. extern Datum circle_contain_pt(PG_FUNCTION_ARGS);
  349. extern Datum pt_contained_circle(PG_FUNCTION_ARGS);
  350. extern Datum circle_add_pt(PG_FUNCTION_ARGS);
  351. extern Datum circle_sub_pt(PG_FUNCTION_ARGS);
  352. extern Datum circle_mul_pt(PG_FUNCTION_ARGS);
  353. extern Datum circle_div_pt(PG_FUNCTION_ARGS);
  354. extern Datum circle_diameter(PG_FUNCTION_ARGS);
  355. extern Datum circle_radius(PG_FUNCTION_ARGS);
  356. extern Datum circle_distance(PG_FUNCTION_ARGS);
  357. extern Datum dist_pc(PG_FUNCTION_ARGS);
  358. extern Datum dist_cpoint(PG_FUNCTION_ARGS);
  359. extern Datum dist_cpoly(PG_FUNCTION_ARGS);
  360. extern Datum dist_ppoly(PG_FUNCTION_ARGS);
  361. extern Datum dist_polyp(PG_FUNCTION_ARGS);
  362. extern Datum circle_center(PG_FUNCTION_ARGS);
  363. extern Datum cr_circle(PG_FUNCTION_ARGS);
  364. extern Datum box_circle(PG_FUNCTION_ARGS);
  365. extern Datum circle_box(PG_FUNCTION_ARGS);
  366. extern Datum poly_circle(PG_FUNCTION_ARGS);
  367. extern Datum circle_poly(PG_FUNCTION_ARGS);
  368. extern Datum circle_area(PG_FUNCTION_ARGS);
  369. /* support routines for the GiST access method (access/gist/gistproc.c) */
  370. extern Datum gist_box_compress(PG_FUNCTION_ARGS);
  371. extern Datum gist_box_decompress(PG_FUNCTION_ARGS);
  372. extern Datum gist_box_union(PG_FUNCTION_ARGS);
  373. extern Datum gist_box_picksplit(PG_FUNCTION_ARGS);
  374. extern Datum gist_box_consistent(PG_FUNCTION_ARGS);
  375. extern Datum gist_box_penalty(PG_FUNCTION_ARGS);
  376. extern Datum gist_box_same(PG_FUNCTION_ARGS);
  377. extern Datum gist_box_fetch(PG_FUNCTION_ARGS);
  378. extern Datum gist_poly_compress(PG_FUNCTION_ARGS);
  379. extern Datum gist_poly_consistent(PG_FUNCTION_ARGS);
  380. extern Datum gist_poly_distance(PG_FUNCTION_ARGS);
  381. extern Datum gist_circle_compress(PG_FUNCTION_ARGS);
  382. extern Datum gist_circle_consistent(PG_FUNCTION_ARGS);
  383. extern Datum gist_circle_distance(PG_FUNCTION_ARGS);
  384. extern Datum gist_point_compress(PG_FUNCTION_ARGS);
  385. extern Datum gist_point_consistent(PG_FUNCTION_ARGS);
  386. extern Datum gist_point_distance(PG_FUNCTION_ARGS);
  387. extern Datum gist_point_fetch(PG_FUNCTION_ARGS);
  388. /* utils/adt/geo_spgist.c */
  389. Datum spg_box_quad_config(PG_FUNCTION_ARGS);
  390. Datum spg_box_quad_choose(PG_FUNCTION_ARGS);
  391. Datum spg_box_quad_picksplit(PG_FUNCTION_ARGS);
  392. Datum spg_box_quad_inner_consistent(PG_FUNCTION_ARGS);
  393. Datum spg_box_quad_leaf_consistent(PG_FUNCTION_ARGS);
  394. /* geo_selfuncs.c */
  395. extern Datum areasel(PG_FUNCTION_ARGS);
  396. extern Datum areajoinsel(PG_FUNCTION_ARGS);
  397. extern Datum positionsel(PG_FUNCTION_ARGS);
  398. extern Datum positionjoinsel(PG_FUNCTION_ARGS);
  399. extern Datum contsel(PG_FUNCTION_ARGS);
  400. extern Datum contjoinsel(PG_FUNCTION_ARGS);
  401. #endif /* GEO_DECLS_H */