* utility
****************************************************************/
-extern uint32 get_uint32(const uchar *loc);
-extern int32 get_int32(const uchar *loc);
+extern uint32 lw_get_uint32(const uchar *loc);
+extern int32 lw_get_int32(const uchar *loc);
extern void printBOX3D(BOX3D *b);
extern void printPA(POINTARRAY *pa);
extern void printLWPOINT(LWPOINT *point);
#ifdef PGIS_DEBUG\r
lwnotice("lwcurve_deserialize: input has srid");\r
#endif\r
- result->SRID = get_int32(loc); \r
+ result->SRID = lw_get_int32(loc); \r
loc += 4; /* type + SRID */\r
}\r
else\r
\r
/* we've read the type (1 byte) and SRID (4 bytes, if present) */\r
\r
- npoints = get_uint32(loc);\r
+ npoints = lw_get_uint32(loc);\r
#ifdef PGIS_DEBUG\r
lwnotice("curve npoints = %d", npoints);\r
#endif \r
}\r
\r
/* we've read the type (1 byte) and SRID (4 bytes, if present) */\r
- npoints = get_uint32(loc);\r
+ npoints = lw_get_uint32(loc);\r
result += sizeof(uint32); /* npoints */\r
\r
result += TYPE_NDIMS(type) * sizeof(double) * npoints;\r
/* handle missaligned unsigned int32 data */
uint32
-get_uint32(const uchar *loc)
+lw_get_uint32(const uchar *loc)
{
uint32 result;
/* handle missaligned signed int32 data */
int32
-get_int32(const uchar *loc)
+lw_get_int32(const uchar *loc)
{
int32 result;
if ( lwgeom_hasSRID(typefl) )
{
- result->SRID = get_int32(loc);
+ result->SRID = lw_get_int32(loc);
loc += 4;
}
/* its a GeometryCollection or multi* geometry */
- result->ngeometries = get_uint32(loc);
+ result->ngeometries = lw_get_uint32(loc);
loc +=4;
#ifdef PGIS_DEBUG
loc += 4;
}
/* its a GeometryCollection or multi* geometry */
- return get_uint32(loc);
+ return lw_get_uint32(loc);
}
/*
}
- ngeoms = get_uint32(loc);
+ ngeoms = lw_get_uint32(loc);
loc +=4;
result += 4; /* numgeoms */
loc +=4;
}
- ngeoms = get_uint32(loc);
+ ngeoms = lw_get_uint32(loc);
loc += 4;
/* each sub-type */
loc += sizeof(BOX2DFLOAT4);
}
- return get_int32(loc);
+ return lw_get_int32(loc);
}
char
loc += sizeof(BOX2DFLOAT4);
}
- return get_int32(loc);
+ return lw_get_int32(loc);
}
if ( lwgeom_hasSRID(type))
{
/*lwnotice("line has srid"); */
- result->SRID = get_int32(loc);
+ result->SRID = lw_get_int32(loc);
loc +=4; /* type + SRID */
}
else
/* we've read the type (1 byte) and SRID (4 bytes, if present) */
- npoints = get_uint32(loc);
+ npoints = lw_get_uint32(loc);
/*lwnotice("line npoints = %d", npoints); */
loc +=4;
pa = pointArray_construct(loc, TYPE_HASZ(type), TYPE_HASM(type), npoints);
}
/* we've read the type (1 byte) and SRID (4 bytes, if present) */
- npoints = get_uint32(loc);
+ npoints = lw_get_uint32(loc);
result += sizeof(uint32); /* npoints */
result += TYPE_NDIMS(type) * sizeof(double) * npoints;
#ifdef PGIS_DEBUG
lwnotice("lwpoint_deserialize: input has SRID");
#endif
- result->SRID = get_int32(loc);
+ result->SRID = lw_get_int32(loc);
loc += 4; /* type + SRID */
}
else
if ( lwgeom_hasSRID(type))
{
- result->SRID = get_int32(loc);
+ result->SRID = lw_get_int32(loc);
loc +=4; /* type + SRID */
}
else
result->SRID = -1;
}
- nrings = get_uint32(loc);
+ nrings = lw_get_uint32(loc);
result->nrings = nrings;
loc +=4;
result->rings = (POINTARRAY**) lwalloc(nrings* sizeof(POINTARRAY*));
for (t =0;t<nrings;t++)
{
/* read in a single ring and make a PA */
- npoints = get_uint32(loc);
+ npoints = lw_get_uint32(loc);
loc +=4;
result->rings[t] = pointArray_construct(loc, hasz, hasm, npoints);
}
- nrings = get_uint32(loc);
+ nrings = lw_get_uint32(loc);
loc +=4;
result +=4;
for (t =0;t<nrings;t++)
{
/* read in a single ring and make a PA */
- npoints = get_uint32(loc);
+ npoints = lw_get_uint32(loc);
loc += 4;
result += 4;