/*
- * Parser global check flags - a bitmap of flags that determine which checks the parser will perform
+ * Parser current instance check flags - a bitmap of flags that determine which checks are enabled during the current parse
* (see liblwgeom.h for the related PARSER_CHECK constants)
*/
-int parser_check_flags;
+int current_parser_check_flags;
/* Parser state flags - these are set automatically by the parser */
popc(void)
{
/* If the minimum point check has been enabled, perform it */
- if (parser_check_flags & PARSER_CHECK_MINPOINTS) {
+ if (current_parser_check_flags & PARSER_CHECK_MINPOINTS) {
if ( the_geom.stack->uu.nn.num < minpoints){
error("geometry requires more points");
}
}
/* If the odd number point check has been enabled, perform it */
- if (parser_check_flags & PARSER_CHECK_ODD) {
+ if (current_parser_check_flags & PARSER_CHECK_ODD) {
if(isodd != -1 && the_geom.stack->uu.nn.num % 2 != isodd) {
error("geometry must have an odd number of points");
}
}
/* If the polygon closure check has been enabled, perform it */
- if (parser_check_flags & PARSER_CHECK_CLOSURE) {
+ if (current_parser_check_flags & PARSER_CHECK_CLOSURE) {
if ( checkclosed && first_point && last_point) {
if ( memcmp(first_point, last_point,
sizeof(double)*the_geom.ndims) )
ferror_occured = 0;
/* Setup the inital parser flags and empty the return struct */
- parser_check_flags = flags;
+ current_parser_check_flags = flags;
lwg_parser_result->serialized_lwgeom = NULL;
lwg_parser_result->size = 0;
void (*write_wkb_bytes)(uchar* ptr,unsigned int cnt,size_t size);
/*
- * Parser global check flags - a bitmap of flags that determine which checks the parser will perform
+ * Unparser current instance check flags - a bitmap of flags that determine which checks are enabled during the current unparse
* (see liblwgeom.h for the related PARSER_CHECK constants)
*/
-int unparser_check_flags;
+int current_unparser_check_flags;
/*
* Unparser result structure
int cnt = read_int(&geom);
/* Ensure that LINESTRING has a minimum of 2 points */
- if ((unparser_check_flags & PARSER_CHECK_MINPOINTS) && cnt < 2)
+ if ((current_unparser_check_flags & PARSER_CHECK_MINPOINTS) && cnt < 2)
lwerror("geometry requires more points");
if ( cnt == 0 ){
/* Check if they are the same... */
if (memcmp(&first_point, &last_point, sizeof(double) * dims) &&
- (unparser_check_flags & PARSER_CHECK_CLOSURE))
+ (current_unparser_check_flags & PARSER_CHECK_CLOSURE))
lwerror("geometry contains non-closed rings");
}
int cnt = read_int(&geom);
/* Ensure that a CIRCULARSTRING has a minimum of 3 points */
- if ((unparser_check_flags & PARSER_CHECK_MINPOINTS) && cnt < 3)
+ if ((current_unparser_check_flags & PARSER_CHECK_MINPOINTS) && cnt < 3)
lwerror("geometry requires more points");
/* Ensure that a CIRCULARSTRING has an odd number of points */
- if ((unparser_check_flags & PARSER_CHECK_ODD) && cnt % 2 != 1)
+ if ((current_unparser_check_flags & PARSER_CHECK_ODD) && cnt % 2 != 1)
lwerror("geometry must have an odd number of points");
if ( cnt == 0 ){
return 0;
/* Setup the inital parser flags and empty the return struct */
- unparser_check_flags = flags;
+ current_unparser_check_flags = flags;
lwg_unparser_result->wkoutput = NULL;
lwg_unparser_result->size = 0;
LWDEBUGF(2, "output_wkb_line_collection: %d iterations loop", cnt);
/* Ensure that LINESTRING has a minimum of 2 points */
- if ((unparser_check_flags & PARSER_CHECK_MINPOINTS) && cnt < 2)
+ if ((current_unparser_check_flags & PARSER_CHECK_MINPOINTS) && cnt < 2)
lwerror("geometry requires more points");
write_wkb_int(cnt);
/* Check if they are the same... */
if (memcmp(&first_point, &last_point, sizeof(double) * dims) &&
- (unparser_check_flags & PARSER_CHECK_CLOSURE))
+ (current_unparser_check_flags & PARSER_CHECK_CLOSURE))
lwerror("geometry contains non-closed rings");
return geom;
LWDEBUGF(2, "output_wkb_curve_collection: %d iterations loop", cnt);
/* Ensure that a CIRCULARSTRING has a minimum of 3 points */
- if ((unparser_check_flags & PARSER_CHECK_MINPOINTS) && cnt < 3)
+ if ((current_unparser_check_flags & PARSER_CHECK_MINPOINTS) && cnt < 3)
lwerror("geometry requires more points");
/* Ensure that a CIRCULARSTRING has an odd number of points */
- if ((unparser_check_flags & PARSER_CHECK_ODD) && cnt % 2 != 1)
+ if ((current_unparser_check_flags & PARSER_CHECK_ODD) && cnt % 2 != 1)
lwerror("geometry must have an odd number of points");
write_wkb_int(cnt);
return 0;
/* Setup the inital parser flags and empty the return struct */
- unparser_check_flags = flags;
+ current_unparser_check_flags = flags;
lwg_unparser_result->wkoutput = NULL;
lwg_unparser_result->size = 0;