va_end(ap);
}
-void rt_init_allocators(void) {
+static void
+rt_init_allocators(void) {
rt_set_handlers(
default_rt_allocator,
default_rt_reallocator,
* of non-PostGIS applications using rt_core.
*
* Programs using this library should set up the default memory managers and error
- * handlers by implementing an rt_init_allocators() function, which can be as
- * a wrapper around the rt_install_default_allocators() function if you want
- * no special handling for memory management and error reporting.
+ * handlers by calling rt_set_handlers() function, or rt_install_default_allocators()
+ * if you want no special handling for memory management and error reporting.
*
**/
typedef void (*rt_message_handler)(const char* string, va_list ap)
__attribute__ (( format(printf,1,0) ));
-/****************************************************************************
- * Functions that must be implemented for the raster core function's caller
- * (for example: rt_pg functions, test functions, future loader/exporter)
- ****************************************************************************/
-
-/**
- * Supply the memory management and error handling functions you want your
- * application to use
- */
-extern void rt_init_allocators(void);
-
-/*********************************************************************/
-
-
/*******************************************************************
* Functions that may be used by the raster core function's caller
* (for example: rt_pg functions, test functions, future loader/exporter)
*******************************************************************/
/**
* Apply the default memory management (malloc() and free()) and error handlers.
- * Called inside rt_init_allocators() generally.
*/
extern void rt_install_default_allocators(void);
/**
- * This function is normally called by rt_init_allocators when no special memory
- * management is needed. Useful in raster core testing and in the (future)
+ * Useful in raster core testing and in the (future)
* loader, when we need to use raster core functions but we don't have
* PostgreSQL backend behind. We must take care of memory by ourselves in those
* situations
/**
- * This function is called by rt_init_allocators when the PostgreSQL backend is
+ * This function is called when the PostgreSQL backend is
* taking care of the memory and we want to use palloc family
*/
void
}
-void
-rt_init_allocators(void)
-{
- /* raster callback - install raster handlers */
- rt_set_handlers(rt_pg_alloc, rt_pg_realloc, rt_pg_free, rt_pg_error,
- rt_pg_debug, rt_pg_notice);
-}
-
-
/* ---------------------------------------------------------------- */
/* PostGIS raster GUCs */
/* ---------------------------------------------------------------- */
char *disable_all = GDAL_DISABLE_ALL;
char *enabled = "GTiff JPEG PNG";
- char *enabled_vsi = "GTiff JPEG PNG VSICURL";
+ // char *enabled_vsi = "GTiff JPEG PNG VSICURL";
rt_util_gdal_register_all(1);
/* install the custom error handler */
lwgeom_set_handlers(0, 0, 0, cu_error_reporter, 0);
+ rt_set_handlers(
+ default_rt_allocator,
+ default_rt_reallocator,
+ default_rt_deallocator,
+ cu_error_reporter,
+ default_rt_info_handler,
+ default_rt_warning_handler
+ );
+
/* initialize the CUnit test registry */
if (CUE_SUCCESS != CU_initialize_registry())
{
return band;
}
-void rt_init_allocators(void) {
- rt_set_handlers(
- default_rt_allocator,
- default_rt_reallocator,
- default_rt_deallocator,
- cu_error_reporter,
- default_rt_info_handler,
- default_rt_warning_handler
- );
-}