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