PostGIS  2.5.1dev-r@@SVN_REVISION@@

◆ gserialized_is_empty_recurse()

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

Definition at line 151 of file g_serialized.c.

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

Referenced by gserialized_copy(), and gserialized_is_empty().

152 {
153  int i;
154  int32_t type, num;
155 
156  memcpy(&type, p, 4);
157  memcpy(&num, p+4, 4);
158 
159  if ( lwtype_is_collection(type) )
160  {
161  size_t lz = 8;
162  for ( i = 0; i < num; i++ )
163  {
164  lz += gserialized_is_empty_recurse(p+lz, isempty);
165  if ( ! *isempty )
166  return lz;
167  }
168  *isempty = LW_TRUE;
169  return lz;
170  }
171  else
172  {
173  *isempty = (num == 0 ? LW_TRUE : LW_FALSE);
174  return 8;
175  }
176 }
static size_t gserialized_is_empty_recurse(const uint8_t *p, int *isempty)
Definition: g_serialized.c:151
#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: