PostGIS  3.0.6dev-r@@SVN_REVISION@@

◆ gserialized1_is_empty_recurse()

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

Definition at line 176 of file gserialized1.c.

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