]> granicus.if.org Git - postgis/commitdiff
Remove stringBuffer.* from build/repository.
authorPaul Ramsey <pramsey@cleverelephant.ca>
Wed, 15 Oct 2008 17:59:18 +0000 (17:59 +0000)
committerPaul Ramsey <pramsey@cleverelephant.ca>
Wed, 15 Oct 2008 17:59:18 +0000 (17:59 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@3114 b70326c6-7e19-0410-871a-916f4a2858ee

lwgeom/Makefile.in
lwgeom/lwgeom_gist.c
lwgeom/stringBuffer.c [deleted file]
lwgeom/stringBuffer.h [deleted file]

index 7ea3e13d12d2adba4cc4f87f2e6e7de305e59380..9422654aad1df7e7fc02d3b587cef5144962e413 100644 (file)
@@ -32,7 +32,6 @@ PG_OBJS=lwgeom_pg.o \
        lwgeom_gist.o \
        lwgeom_btree.o \
        lwgeom_transform.o \
-       stringBuffer.o \
        lwgeom_box.o \
        lwgeom_box3d.o \
        lwgeom_box2dfloat4.o \
index 1f3b040b7ae8e76d726d6202552cfaff4bb784e9..061003bf8037063e19971f5a838951e4cf3c4a3f 100644 (file)
@@ -94,6 +94,8 @@ Datum LWGEOM_overlap(PG_FUNCTION_ARGS)
        BOX2DFLOAT4 box1;
        BOX2DFLOAT4 box2;
 
+       POSTGIS_DEBUG(2, "GIST: LWGEOM_overlap --entry");
+
        if ( pglwgeom_getSRID(lwgeom1) != pglwgeom_getSRID(lwgeom2) )
        {
                PG_FREE_IF_COPY(lwgeom1, 0);
diff --git a/lwgeom/stringBuffer.c b/lwgeom/stringBuffer.c
deleted file mode 100644 (file)
index 07cd5fd..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-#include <postgres.h>
-
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <memory.h>
-
-#include "stringBuffer.h"
-
-#define DEFAULT_STR_LENGTH_PADDING 10
-#define DEFAULT_PERCENT_SIZE_INCREASE 0.25
-
-/*NOTE: buffer->length does NOT include the null!!! */
-
-
-
-
-/*constructor for the string buffer */
-STRBUFF * new_strBUFF(int size) {
-       STRBUFF * buffer;
-       buffer = (STRBUFF *)palloc(sizeof(STRBUFF));
-       buffer->string = (char * )palloc(size);
-       buffer->size = size;
-       buffer->length = 0;
-       return buffer;
-}
-
-/*destructor */
-void delete_StrBUFF(STRBUFF* buffer) {
-       pfree(buffer->string);
-       pfree(buffer);
-}
-
-/*returns a CString contained in the buffer */
-char* to_CString(STRBUFF* buffer) {
-       char* resultStr;
-       if(buffer->length == 0) {
-               return NULL;
-       }
-
-       resultStr = (char * )palloc(buffer->length+1);
-       memcpy(resultStr, buffer->string, buffer->length+1);
-       return resultStr;
-}
-
-/*add a string to the buffer- calls catenate */
-void add_str_simple(STRBUFF* buffer, char* str) {
-       if(str == NULL) {
-               return;
-       }
-       catenate(buffer, str, strlen(str));
-}
-
-/* 
- * Adds the new string to the existing string in the buffer allocates
- */
-void catenate(STRBUFF *buffer, char* str, int strLength)
-{
-       /* not big enough to hold this + null termination */
-       if  (buffer->size <= (buffer->length+strLength)  )
-       {
-               /*need to re-allocate the buffer so its bigger */
-               char *old_buffer = buffer->string;
-               int  new_size    = getSize(buffer->size, buffer->length, strLength);  /*new size (always big enough) */
-
-               buffer->string = palloc(new_size);
-               buffer->size = new_size;
-               memcpy(buffer->string, old_buffer, buffer->length+1); /* copy old string (+1 = null term) */
-
-                       /* buff is exactly the same as it was, except it has a bigger string buffer */
-               pfree(old_buffer);
-       }
-
-               /*add new info */
-       memcpy(buffer->string + buffer->length, str, strLength);
-       buffer->length += strLength;
-       buffer->string[buffer->length] = 0;/* force null-terminated */
-}
-
-
-/*
- * get new buffer size
- *  new size =    <big enough to put in the requested info> +
- *      10 +                                 -- just a little constant
- *      25% * <current buffer size>          -- exponential growth
- */
-int getSize(int buffer_size, int buffer_length, int strLength)
-{
-       /* extra space required in buffer */
-       int needed_extra = strLength - (buffer_size-buffer_length);
-
-       return buffer_size + needed_extra + DEFAULT_STR_LENGTH_PADDING + buffer_size*DEFAULT_PERCENT_SIZE_INCREASE;
-}
-
diff --git a/lwgeom/stringBuffer.h b/lwgeom/stringBuffer.h
deleted file mode 100644 (file)
index f323767..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-
-typedef struct {
-       char * string;
-       int length; /* length of string, EXCLUDING null termination */
-       int size;   /* size of buffer -can be longer than */
-} STRBUFF;
-
-
-extern STRBUFF * new_strBUFF(int size);
-extern void delete_StrBUFF(STRBUFF* buff);
-extern char* to_CString(STRBUFF * buffer);
-extern void add_str_simple(STRBUFF* buffer, char* str);
-extern void catenate(STRBUFF *buffer, char* str, int length);
-extern int getSize(int buffer_size, int buffer_length, int strLength);