PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ gserialized2_is_empty_recurse()

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

Definition at line 225 of file gserialized2.c.

226{
227 int i;
228 int32_t type, num;
229
230 memcpy(&type, p, 4);
231 memcpy(&num, p+4, 4);
232
233 if (lwtype_is_collection(type))
234 {
235 size_t lz = 8;
236 for ( i = 0; i < num; i++ )
237 {
238 lz += gserialized2_is_empty_recurse(p+lz, isempty);
239 if (!*isempty)
240 return lz;
241 }
242 *isempty = LW_TRUE;
243 return lz;
244 }
245 else
246 {
247 *isempty = (num == 0 ? LW_TRUE : LW_FALSE);
248 return 8;
249 }
250}
static size_t gserialized2_is_empty_recurse(const uint8_t *p, int *isempty)
#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:1196
#define LW_TRUE
Return types for functions with status returns.
Definition liblwgeom.h:93

References gserialized2_is_empty_recurse(), LW_FALSE, LW_TRUE, and lwtype_is_collection().

Referenced by gserialized2_is_empty(), and gserialized2_is_empty_recurse().

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