PostGIS  2.5.2dev-r@@SVN_REVISION@@

◆ gserialized_is_empty_recurse()

static size_t gserialized_is_empty_recurse ( const uint8_t p,
int *  isempty 
)
static

Definition at line 152 of file g_serialized.c.

References LW_FALSE, LW_TRUE, lwtype_is_collection(), and ovdump::type.

Referenced by gserialized_copy(), and gserialized_is_empty().

153 {
154  int i;
155  int32_t type, num;
156 
157  memcpy(&type, p, 4);
158  memcpy(&num, p+4, 4);
159 
160  if ( lwtype_is_collection(type) )
161  {
162  size_t lz = 8;
163  for ( i = 0; i < num; i++ )
164  {
165  lz += gserialized_is_empty_recurse(p+lz, isempty);
166  if ( ! *isempty )
167  return lz;
168  }
169  *isempty = LW_TRUE;
170  return lz;
171  }
172  else
173  {
174  *isempty = (num == 0 ? LW_TRUE : LW_FALSE);
175  return 8;
176  }
177 }
static size_t gserialized_is_empty_recurse(const uint8_t *p, int *isempty)
Definition: g_serialized.c:152
#define LW_FALSE
Definition: liblwgeom.h:76
#define LW_TRUE
Return types for functions with status returns.
Definition: liblwgeom.h:75
int lwtype_is_collection(uint8_t type)
Determine whether a type number is a collection or not.
Definition: lwgeom.c:1093
type
Definition: ovdump.py:41
Here is the call graph for this function:
Here is the caller graph for this function: