]> granicus.if.org Git - postgis/commitdiff
Added missing prototypes.
authorSandro Santilli <strk@keybit.net>
Mon, 7 Jun 2004 09:16:06 +0000 (09:16 +0000)
committerSandro Santilli <strk@keybit.net>
Mon, 7 Jun 2004 09:16:06 +0000 (09:16 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@597 b70326c6-7e19-0410-871a-916f4a2858ee

lwgeom/wktparse.lex
lwgeom/wktunparse.c

index 5273ac8b2ec6bb2b30b7c604a8ace2aac4bbdb66..ae694ac06bb37bac53cd3d73af52dbcd272bbcd5 100644 (file)
 %{
 #include "wktparse.tab.h"
 
+void init_parser(const char *src);
+void close_parser(void);
+int lwg_parse_yywrap(void);
+
 static YY_BUFFER_STATE buf_state;
    void init_parser(const char *src) { BEGIN(0);buf_state = lwg_parse_yy_scan_string(src); }
    void close_parser() { lwg_parse_yy_delete_buffer(buf_state); }
index f6df8be077ae58a9f60c4c35adb835b277f422ef..cf4084313e38515c5b59947b13641435503c6a46 100644 (file)
 
 static int endian_check_int = 1; // dont modify this!!!
 
-#define LITTLE_ENDIAN 1
+#define LITTLE_ENDIAN_CHECK 1
 static char getMachineEndian()
 {
        return *((char *) &endian_check_int); // 0 = big endian, 1 = little endian
 }
 
+//-- Typedefs ----------------------------------------------
 
 typedef unsigned long int4;
+typedef byte* (*outfunc)(byte*,int);
+typedef byte* (*outwkbfunc)(byte*);
+
+//-- Prototypes --------------------------------------------
+
+void ensure(int chars);
+void to_end(void);
+void write_str(const char* str);
+void write_double(double val);
+void write_int(int i);
+int4 read_int(byte** geom);
+double read_double(byte** geom);
+byte* output_point(byte* geom,int supress);
+byte* output_single(byte* geom,int supress);
+byte* output_collection(byte* geom,outfunc func,int supress);
+byte* output_collection_2(byte* geom,int suppress);
+byte* output_multipoint(byte* geom,int suppress);
+void write_wkb_bytes(byte* ptr,int cnt);
+byte* output_wkb_point(byte* geom);
+void write_wkb_int(int i);
+byte* output_wkb_collection(byte* geom,outwkbfunc func);
+byte* output_wkb_collection_2(byte* geom);
+byte* output_wkb(byte* geom);
+
+//-- Globals -----------------------------------------------
 
 static int dims;
 static allocator local_malloc;
@@ -36,6 +62,10 @@ static char*  out_pos;
 static int len;
 static int lwgi;
 
+//----------------------------------------------------------
+
+
+
 void ensure(int chars){
 
        int pos = out_pos - out_start;
@@ -80,7 +110,7 @@ void write_int(int i){
 int4 read_int(byte** geom){
        int4 ret;
 #ifdef SHRINK_INTS
-       if ( getMachineEndian() == LITTLE_ENDIAN ){
+       if ( getMachineEndian() == LITTLE_ENDIAN_CHECK ){
                if( (**geom)& 0x01){
                        ret = **geom >>1;
                        (*geom)++;
@@ -98,7 +128,7 @@ int4 read_int(byte** geom){
        memcpy(&ret,*geom,4);
 
 #ifdef SHRINK_INTS
-       if ( getMachineEndian() == LITTLE_ENDIAN ){
+       if ( getMachineEndian() == LITTLE_ENDIAN_CHECK ){
                ret >>= 1;
        }
 #endif
@@ -125,8 +155,6 @@ double read_double(byte** geom){
        }
 }
            
-typedef byte* (*outfunc)(byte*,int);
-
 byte* output_point(byte* geom,int supress){
        int i;
 
@@ -290,8 +318,6 @@ byte* output_wkb_point(byte* geom){
        }
 }
 
-typedef byte* (*outwkbfunc)(byte*);
-
 void write_wkb_int(int i){
        write_wkb_bytes((byte*)&i,4);
 }
@@ -330,7 +356,7 @@ byte* output_wkb(byte* geom){
        else if (dims==4)
                 type |=0x40000000;
 
-       if ( getMachineEndian() != LITTLE_ENDIAN ){
+       if ( getMachineEndian() != LITTLE_ENDIAN_CHECK ){
                byte endian=0;
                write_wkb_bytes(&endian,1);
        }