PostGIS  3.3.9dev-r@@SVN_REVISION@@
rtpostgis.h
Go to the documentation of this file.
1 /*
2  *
3  * WKTRaster - Raster Types for PostGIS
4  * http://trac.osgeo.org/postgis/wiki/WKTRaster
5  *
6  * Copyright (C) 2010-2011 Jorge Arevalo <jorge.arevalo@deimos-space.com>
7  * Copyright (C) 2010-2011 David Zwarg <dzwarg@azavea.com>
8  * Copyright (C) 2009-2011 Pierre Racine <pierre.racine@sbf.ulaval.ca>
9  * Copyright (C) 2009-2011 Mateusz Loskot <mateusz@loskot.net>
10  * Copyright (C) 2008-2009 Sandro Santilli <strk@kbt.io>
11  *
12  * This program is free software; you can redistribute it and/or
13  * modify it under the terms of the GNU General Public License
14  * as published by the Free Software Foundation; either version 2
15  * of the License, or (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * You should have received a copy of the GNU General Public License
23  * along with this program; if not, write to the Free Software Foundation,
24  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
25  *
26  */
27 
28 #ifndef RTPOSTGIS_H_INCLUDED
29 #define RTPOSTGIS_H_INCLUDED
30 
31 /* Quiet build noise by stripping duplicate MACRO defns */
32 /* coming from include files */
33 #undef PACKAGE_BUGREPORT
34 #undef PACKAGE_NAME
35 #undef PACKAGE_STRING
36 #undef PACKAGE_TARNAME
37 #undef PACKAGE_VERSION
38 
39 #include "postgres.h"
40 #include "fmgr.h"
41 #include "funcapi.h"
42 
43 #include "librtcore.h"
44 
45 #if POSTGIS_PGSQL_VERSION >= 160
46 #include "varatt.h"
47 #endif
48 
49 /* Debugging macros */
50 #if POSTGIS_DEBUG_LEVEL > 0
51 
52 /* Display a simple message at NOTICE level */
53 #define POSTGIS_RT_DEBUG(level, msg) \
54  do { \
55  if (POSTGIS_DEBUG_LEVEL >= level) \
56  ereport((level < 1 || level > 5) ? DEBUG5 : (LOG - level), (errmsg_internal("[%s:%s:%d] " msg, __FILE__, __func__, __LINE__))); \
57  } while (0);
58 
59 /* Display a formatted message at NOTICE level (like printf, with variadic arguments) */
60 #define POSTGIS_RT_DEBUGF(level, msg, ...) \
61  do { \
62  if (POSTGIS_DEBUG_LEVEL >= level) \
63  ereport((level < 1 || level > 5) ? DEBUG5 : (LOG - level), (errmsg_internal("[%s:%s:%d] " msg, __FILE__, __func__, __LINE__, __VA_ARGS__))); \
64  } while (0);
65 
66 #else
67 
68 /* Empty prototype that can be optimised away by the compiler for non-debug builds */
69 #define POSTGIS_RT_DEBUG(level, msg) \
70  ((void) 0)
71 
72 /* Empty prototype that can be optimised away by the compiler for non-debug builds */
73 #define POSTGIS_RT_DEBUGF(level, msg, ...) \
74  ((void) 0)
75 
76 #endif
77 
78 /* Header of PostgreSQL-stored RASTER value,
79  * and binary representation of it */
80 typedef struct rt_raster_serialized_t rt_pgraster;
81 
82 /* maximum char length required to hold any double or long long value */
83 #define MAX_DBL_CHARLEN (3 + DBL_MANT_DIG - DBL_MIN_EXP)
84 #define MAX_INT_CHARLEN 32
85 
86 
87 #endif /* RTPOSTGIS_H_INCLUDED */
This library is the generic raster handling section of PostGIS.
Struct definitions.
Definition: librtcore.h:2396