PostGIS  2.4.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 "librtcore.h"
40 
41 /* Debugging macros */
42 #if POSTGIS_DEBUG_LEVEL > 0
43 
44 /* Display a simple message at NOTICE level */
45 #define POSTGIS_RT_DEBUG(level, msg) \
46  do { \
47  if (POSTGIS_DEBUG_LEVEL >= level) \
48  ereport((level < 1 || level > 5) ? DEBUG5 : (LOG - level), (errmsg_internal("[%s:%s:%d] " msg, __FILE__, __func__, __LINE__))); \
49  } while (0);
50 
51 /* Display a formatted message at NOTICE level (like printf, with variadic arguments) */
52 #define POSTGIS_RT_DEBUGF(level, msg, ...) \
53  do { \
54  if (POSTGIS_DEBUG_LEVEL >= level) \
55  ereport((level < 1 || level > 5) ? DEBUG5 : (LOG - level), (errmsg_internal("[%s:%s:%d] " msg, __FILE__, __func__, __LINE__, __VA_ARGS__))); \
56  } while (0);
57 
58 #else
59 
60 /* Empty prototype that can be optimised away by the compiler for non-debug builds */
61 #define POSTGIS_RT_DEBUG(level, msg) \
62  ((void) 0)
63 
64 /* Empty prototype that can be optimised away by the compiler for non-debug builds */
65 #define POSTGIS_RT_DEBUGF(level, msg, ...) \
66  ((void) 0)
67 
68 #endif
69 
70 /* Header of PostgreSQL-stored RASTER value,
71  * and binary representation of it */
73 
74 /* maximum char length required to hold any double or long long value */
75 #define MAX_DBL_CHARLEN (3 + DBL_MANT_DIG - DBL_MIN_EXP)
76 #define MAX_INT_CHARLEN 32
77 
78 #endif /* RTPOSTGIS_H_INCLUDED */
Struct definitions.
Definition: librtcore.h:2201
This library is the generic raster handling section of PostGIS.