PostGIS  2.3.8dev-r@@SVN_REVISION@@

◆ gserialized_is_empty_recurse()

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

Definition at line 126 of file g_serialized.c.

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

Referenced by gserialized_copy(), and gserialized_is_empty().

127 {
128  int i;
129  int32_t type, num;
130 
131  memcpy(&type, p, 4);
132  memcpy(&num, p+4, 4);
133 
134  if ( lwtype_is_collection(type) )
135  {
136  size_t lz = 8;
137  for ( i = 0; i < num; i++ )
138  {
139  lz += gserialized_is_empty_recurse(p+lz, isempty);
140  if ( ! *isempty )
141  return lz;
142  }
143  *isempty = LW_TRUE;
144  return lz;
145  }
146  else
147  {
148  *isempty = (num == 0 ? LW_TRUE : LW_FALSE);
149  return 8;
150  }
151 }
static size_t gserialized_is_empty_recurse(const uint8_t *p, int *isempty)
Definition: g_serialized.c:126
#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:1012
type
Definition: ovdump.py:41
Here is the call graph for this function:
Here is the caller graph for this function: