PostGIS  3.4.0dev-r@@SVN_REVISION@@

◆ gserialized1_is_empty_recurse()

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

Definition at line 177 of file gserialized1.c.

178 {
179  int i;
180  int32_t type, num;
181 
182  memcpy(&type, p, 4);
183  memcpy(&num, p+4, 4);
184 
185  if ( lwtype_is_collection(type) )
186  {
187  size_t lz = 8;
188  for ( i = 0; i < num; i++ )
189  {
190  lz += gserialized1_is_empty_recurse(p+lz, isempty);
191  if ( ! *isempty )
192  return lz;
193  }
194  *isempty = LW_TRUE;
195  return lz;
196  }
197  else
198  {
199  *isempty = (num == 0 ? LW_TRUE : LW_FALSE);
200  return 8;
201  }
202 }
static size_t gserialized1_is_empty_recurse(const uint8_t *p, int *isempty)
Definition: gserialized1.c:177
#define LW_FALSE
Definition: liblwgeom.h:94
int lwtype_is_collection(uint8_t type)
Determine whether a type number is a collection or not.
Definition: lwgeom.c:1105
#define LW_TRUE
Return types for functions with status returns.
Definition: liblwgeom.h:93
type
Definition: ovdump.py:42

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

Referenced by gserialized1_is_empty().

Here is the call graph for this function:
Here is the caller graph for this function: