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

◆ postgis_typmod_type()

Datum postgis_typmod_type ( PG_FUNCTION_ARGS  )

Definition at line 357 of file gserialized_typmod.c.

358{
359 int32 typmod = PG_GETARG_INT32(0);
360 int32 type = TYPMOD_GET_TYPE(typmod);
361 char *s = (char*)palloc(64);
362 char *ptr = s;
363 text *stext;
364
365 /* Has type? */
366 if ( typmod < 0 || type == 0 )
367 ptr += sprintf(ptr, "Geometry");
368 else
369 ptr += sprintf(ptr, "%s", lwtype_name(type));
370
371 /* Has Z? */
372 if ( typmod >= 0 && TYPMOD_GET_Z(typmod) )
373 ptr += sprintf(ptr, "%s", "Z");
374
375 /* Has M? */
376 if ( typmod >= 0 && TYPMOD_GET_M(typmod) )
377 ptr += sprintf(ptr, "%s", "M");
378
379 stext = cstring_to_text(s);
380 pfree(s);
381 PG_RETURN_TEXT_P(stext);
382}
char * s
Definition cu_in_wkt.c:23
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
Definition lwutil.c:216
#define TYPMOD_GET_M(typmod)
Definition liblwgeom.h:212
#define TYPMOD_GET_TYPE(typmod)
Definition liblwgeom.h:208
#define TYPMOD_GET_Z(typmod)
Definition liblwgeom.h:210
unsigned int int32
Definition shpopen.c:273

References lwtype_name(), s, TYPMOD_GET_M, TYPMOD_GET_TYPE, and TYPMOD_GET_Z.

Here is the call graph for this function: