PostGIS  3.0.6dev-r@@SVN_REVISION@@
lwutil.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <ctype.h>
#include "../postgis_config.h"
#include "liblwgeom_internal.h"
#include "lwgeom_log.h"
Include dependency graph for lwutil.c:

Go to the source code of this file.

Data Structures

struct  geomtype_struct
 

Macros

#define LW_MSG_MAXLEN   256
 
#define GEOMTYPE_STRUCT_ARRAY_LEN   (sizeof geomtype_struct_array/sizeof(struct geomtype_struct))
 

Functions

static void * default_allocator (size_t size)
 
static void default_freeor (void *mem)
 
static void * default_reallocator (void *mem, size_t size)
 
static void default_noticereporter (const char *fmt, va_list ap)
 
static void default_errorreporter (const char *fmt, va_list ap)
 
static void default_debuglogger (int level, const char *fmt, va_list ap)
 
void lwgeom_set_handlers (lwallocator allocator, lwreallocator reallocator, lwfreeor freeor, lwreporter errorreporter, lwreporter noticereporter)
 This function is called by programs which want to set up custom handling for memory management and error reporting. More...
 
void lwgeom_set_debuglogger (lwdebuglogger debuglogger)
 
void lwnotice (const char *fmt,...)
 Write a notice out to the notice handler. More...
 
void lwerror (const char *fmt,...)
 Write a notice out to the error handler. More...
 
void lwdebug (int level, const char *fmt,...)
 Write a debug message out. More...
 
const char * lwtype_name (uint8_t type)
 Return the type name string associated with a type number (e.g. More...
 
void * lwalloc (size_t size)
 
void * lwrealloc (void *mem, size_t size)
 
void lwfree (void *mem)
 
char * lwstrdup (const char *a)
 
char * lwmessage_truncate (char *str, int startpos, int endpos, int maxlength, int truncdirection)
 
int32_t clamp_srid (int32_t srid)
 Return a valid SRID from an arbitrary integer Raises a notice if what comes out is different from what went in. More...
 
static char dumb_toupper (int in)
 
lwflags_t lwflags (int hasz, int hasm, int geodetic)
 Construct a new flags bitmask. More...
 
int geometry_type_from_string (const char *str, uint8_t *type, int *z, int *m)
 Calculate type integer and dimensional flags from string input. More...
 

Variables

lwallocator lwalloc_var = default_allocator
 
lwreallocator lwrealloc_var = default_reallocator
 
lwfreeor lwfree_var = default_freeor
 
lwreporter lwnotice_var = default_noticereporter
 
lwreporter lwerror_var = default_errorreporter
 
lwdebuglogger lwdebug_var = default_debuglogger
 
static char * lwgeomTypeName []
 
struct geomtype_struct geomtype_struct_array []
 
const char dumb_upper_map [128] = "................................................0123456789.......ABCDEFGHIJKLMNOPQRSTUVWXYZ......ABCDEFGHIJKLMNOPQRSTUVWXYZ....."