PostGIS  2.2.8dev-r@@SVN_REVISION@@

◆ convert_bytes_to_hex()

char * convert_bytes_to_hex ( uint8_t *  ewkb,
size_t  size 
)

Binary to hexewkb conversion function.

Definition at line 685 of file pgsql2shp-core.c.

References deparse_hex(), and malloc().

Referenced by ShpLoaderGenerateShapeRow().

686 {
687  int i;
688  char *hexewkb;
689 
690  /* Convert the byte stream to a hex string using liblwgeom's deparse_hex function */
691  hexewkb = malloc(size * 2 + 1);
692  for (i=0; i<size; ++i) deparse_hex(ewkb[i], &hexewkb[i * 2]);
693  hexewkb[size * 2] = '\0';
694 
695  return hexewkb;
696 }
void deparse_hex(uint8_t str, char *result)
Convert a char into a human readable hex digit.
Definition: lwgeom_api.c:774
void * malloc(YYSIZE_T)
Here is the call graph for this function:
Here is the caller graph for this function: