PostGIS  2.2.7dev-r@@SVN_REVISION@@
static size_t gserialized_is_empty_recurse ( const uint8_t *  p,
int *  isempty 
)
static

Definition at line 112 of file g_serialized.c.

References LW_FALSE, LW_TRUE, and lwtype_is_collection().

Referenced by gserialized_is_empty().

113 {
114  int i;
115  int32_t type, num;
116 
117  memcpy(&type, p, 4);
118  memcpy(&num, p+4, 4);
119 
120  if ( lwtype_is_collection(type) )
121  {
122  size_t lz = 8;
123  for ( i = 0; i < num; i++ )
124  {
125  lz += gserialized_is_empty_recurse(p+lz, isempty);
126  if ( ! *isempty )
127  return lz;
128  }
129  *isempty = LW_TRUE;
130  return lz;
131  }
132  else
133  {
134  *isempty = (num == 0 ? LW_TRUE : LW_FALSE);
135  return 8;
136  }
137 }
static size_t gserialized_is_empty_recurse(const uint8_t *p, int *isempty)
Definition: g_serialized.c:112
#define LW_FALSE
Definition: liblwgeom.h:62
#define LW_TRUE
Return types for functions with status returns.
Definition: liblwgeom.h:61
int lwtype_is_collection(uint8_t type)
Determine whether a type number is a collection or not.
Definition: lwgeom.c:999

Here is the call graph for this function:

Here is the caller graph for this function: