MobilityDB 1.1
Data Structures | Functions
type_in.c File Reference
#include <assert.h>
#include <float.h>
#include <postgres.h>
#include <meos.h>
#include <meos_internal.h>
#include "general/pg_types.h"
#include "general/set.h"
#include "general/tbox.h"
#include "general/type_parser.h"
#include "general/type_util.h"
#include "point/stbox.h"
#include "point/tpoint_spatialfuncs.h"
Include dependency graph for type_in.c:

Data Structures

struct  wkb_parse_state
 Input of temporal types in WKT, MF-JSON, WKB, EWKB, and HexWKB format. More...
 

Functions

static Datum basevalue_from_wkb_state (wkb_parse_state *s)
 Return a base value from its WKB representation. More...
 
static void bounds_from_wkb_state (uint8_t wkb_bounds, bool *lower_inc, bool *upper_inc)
 Set the bound flags from their WKB representation. More...
 
char byte_from_wkb_state (wkb_parse_state *s)
 Read a byte and advance the parse state forward. More...
 
Datum datum_from_hexwkb (const char *hexwkb, int size, meosType type)
 Return a temporal type from its HexEWKB representation. More...
 
Datum datum_from_wkb (const uint8_t *wkb, int size, meosType type)
 Return a value from its Well-Known Binary (WKB) representation. More...
 
double double_from_wkb_state (wkb_parse_state *s)
 Read an 8-byte double and advance the parse state forward. More...
 
static void ensure_temptype_mfjson (const char *typestr)
 
json_object * findMemberByName (json_object *poObj, const char *pszName)
 Return the JSON member corresponding to the name. More...
 
uint16_t int16_from_wkb_state (wkb_parse_state *s)
 Read a 2-byte integer and advance the parse state forward. More...
 
uint32_t int32_from_wkb_state (wkb_parse_state *s)
 Read a 4-byte integer and advance the parse state forward. More...
 
uint64_t int64_from_wkb_state (wkb_parse_state *s)
 Read an 8-byte integer and advance the parse state forward. More...
 
static Datum parse_mfjson_coord (json_object *poObj, int srid, bool geodetic)
 Return a single point from its MF-JSON coordinates. More...
 
static TimestampTzparse_mfjson_datetimes (json_object *mfjson, int *count)
 Return an array of timestamps from its MF-JSON datetimes values. More...
 
static Datumparse_mfjson_points (json_object *mfjson, int srid, bool geodetic, int *count)
 Return an array of points from its MF-JSON coordinates. More...
 
static Datumparse_mfjson_values (json_object *mfjson, meosType temptype, int *count)
 Return an array of points from its MF-JSON coordinates. More...
 
Datum point_from_wkb_state (wkb_parse_state *s)
 Return a point from its WKB representation. More...
 
void set_flags_from_wkb_state (wkb_parse_state *s, uint8_t wkb_flags)
 Parse the WKB flags. More...
 
Setset_from_hexwkb (const char *hexwkb)
 Return a set from its WKB representation in hex-encoded ASCII. More...
 
Setset_from_wkb (const uint8_t *wkb, int size)
 Return a set from its Well-Known Binary (WKB) representation. More...
 
static Setset_from_wkb_state (wkb_parse_state *s)
 Return a set from its WKB representation. More...
 
static size_t span_basevalue_from_wkb_size (wkb_parse_state *s)
 Return the size of a span base value from its WKB representation. More...
 
Spanspan_from_hexwkb (const char *hexwkb)
 Return a span from its WKB representation in hex-encoded ASCII. More...
 
Spanspan_from_wkb (const uint8_t *wkb, int size)
 Return a span from its Well-Known Binary (WKB) representation. More...
 
Spanspan_from_wkb_state (wkb_parse_state *s)
 Return a span from its WKB representation. More...
 
static Spanspan_from_wkb_state1 (wkb_parse_state *s)
 Return a span from its WKB representation when reading components spans in a span set (which does not repeat the spantype for every component. More...
 
SpanSetspanset_from_hexwkb (const char *hexwkb)
 Return a period set from its WKB representation in hex-encoded ASCII. More...
 
SpanSetspanset_from_wkb (const uint8_t *wkb, int size)
 Return a period set from its Well-Known Binary (WKB) representation. More...
 
static SpanSetspanset_from_wkb_state (wkb_parse_state *s)
 Return a span set from its WKB representation. More...
 
static void stbox_flags_from_wkb_state (wkb_parse_state *s, uint8_t wkb_flags)
 Set the state flags according to a box byte flag read from the buffer. More...
 
STBoxstbox_from_hexwkb (const char *hexwkb)
 Return a spatiotemporal box from its WKB representation in hex-encoded ASCII. More...
 
STBoxstbox_from_wkb (const uint8_t *wkb, int size)
 Return a spatiotemporal box from its Well-Known Binary (WKB) representation. More...
 
static STBoxstbox_from_wkb_state (wkb_parse_state *s)
 Return a spatiotemporal box from its WKB representation. More...
 
TInstanttboolinst_from_mfjson (json_object *mfjson)
 Return a temporal instant boolean from its MF-JSON representation. More...
 
TSequencetboolseq_from_mfjson (json_object *mfjson)
 Return a temporal sequence boolean from its MF-JSON representation. More...
 
TSequenceSettboolseqset_from_mfjson (json_object *mfjson)
 Return a temporal sequence set boolean from its MF-JSON representation. More...
 
static void tbox_flags_from_wkb_state (wkb_parse_state *s, uint8_t wkb_flags)
 Set the state flags according to a box byte flag read from the buffer. More...
 
TBoxtbox_from_hexwkb (const char *hexwkb)
 Return a temporal box from its WKB representation in hex-encoded ASCII. More...
 
TBoxtbox_from_wkb (const uint8_t *wkb, int size)
 Return a temporal box from its Well-Known Binary (WKB) representation. More...
 
static TBoxtbox_from_wkb_state (wkb_parse_state *s)
 Return a temporal box from its WKB representation. More...
 
void temporal_flags_from_wkb_state (wkb_parse_state *s, uint8_t wkb_flags)
 Take in an unknown kind of WKB type number and ensure it comes out as an extended WKB type number (with Z/GEODETIC/SRID/LINEAR_INTERP flags masked onto the high bits). More...
 
Temporaltemporal_from_hexwkb (const char *hexwkb)
 Return a temporal value from its HexEWKB representation. More...
 
Temporaltemporal_from_mfjson (const char *mfjson)
 Return a temporal point from its MF-JSON representation. More...
 
Temporaltemporal_from_wkb (const uint8_t *wkb, int size)
 Return a temporal value from its Well-Known Binary (WKB) representation. More...
 
static Temporaltemporal_from_wkb_state (wkb_parse_state *s)
 Return a temporal value from its WKB representation. More...
 
texttext_from_wkb_state (wkb_parse_state *s)
 Read a text and advance the parse state forward. More...
 
TInstanttfloatinst_from_mfjson (json_object *mfjson)
 Return a temporal instant float from its MF-JSON representation. More...
 
TSequencetfloatseq_from_mfjson (json_object *mfjson, interpType interp)
 Return a temporal sequence float from its MF-JSON representation. More...
 
TSequenceSettfloatseqset_from_mfjson (json_object *mfjson, interpType interp)
 Return a temporal sequence set float from its MF-JSON representation. More...
 
TInstanttgeogpointinst_from_mfjson (json_object *mfjson, int srid)
 Return a temporal instant geographic point from its MF-JSON representation. More...
 
TSequencetgeogpointseq_from_mfjson (json_object *mfjson, int srid, interpType interp)
 Return a temporal sequence geographic point from its MF-JSON representation. More...
 
TSequenceSettgeogpointseqset_from_mfjson (json_object *mfjson, int srid, interpType interp)
 Return a temporal sequence set geographic point from its MF-JSON representation. More...
 
TInstanttgeompointinst_from_mfjson (json_object *mfjson, int srid)
 Return a temporal instant geometric point from its MF-JSON representation. More...
 
TSequencetgeompointseq_from_mfjson (json_object *mfjson, int srid, interpType interp)
 Return a temporal sequence geometric point from its MF-JSON representation. More...
 
TSequenceSettgeompointseqset_from_mfjson (json_object *mfjson, int srid, interpType interp)
 Return a temporal sequence set geometric point from its MF-JSON representation. More...
 
TimestampTz timestamp_from_wkb_state (wkb_parse_state *s)
 Read an 8-byte timestamp and advance the parse state forward. More...
 
TInstanttinstant_from_mfjson (json_object *mfjson, bool isgeo, int srid, meosType temptype)
 Return a temporal instant from its MF-JSON representation. More...
 
static TInstanttinstant_from_wkb_state (wkb_parse_state *s)
 Return a temporal instant point from its WKB representation. More...
 
static TInstant ** tinstarr_from_mfjson (json_object *mfjson, bool isgeo, int srid, meosType temptype, int *count)
 Return array of temporal instant points from its MF-JSON representation. More...
 
static TInstant ** tinstarr_from_wkb_state (wkb_parse_state *s, int count)
 Return a temporal instant array from its WKB representation. More...
 
TInstanttintinst_from_mfjson (json_object *mfjson)
 Return a temporal instant integer from its MF-JSON representation. More...
 
TSequencetintseq_from_mfjson (json_object *mfjson)
 Return a temporal sequence integer from its MF-JSON representation. More...
 
TSequenceSettintseqset_from_mfjson (json_object *mfjson)
 Return a temporal sequence set integer from its MF-JSON representation. More...
 
TSequencetsequence_from_mfjson (json_object *mfjson, bool isgeo, int srid, meosType temptype, interpType interp)
 Return a temporal sequence point from its MF-JSON representation. More...
 
static TSequencetsequence_from_wkb_state (wkb_parse_state *s)
 Return a temporal sequence value from its WKB representation. More...
 
TSequenceSettsequenceset_from_mfjson (json_object *mfjson, bool isgeo, int srid, meosType temptype, interpType interp)
 Return a temporal sequence set point from its MF-JSON representation. More...
 
static TSequenceSettsequenceset_from_wkb_state (wkb_parse_state *s)
 Return a temporal sequence set value from its WKB representation. More...
 
TInstantttextinst_from_mfjson (json_object *mfjson)
 Return a temporal instant text from its MF-JSON representation. More...
 
TSequencettextseq_from_mfjson (json_object *mfjson)
 Return a temporal sequence text from its MF-JSON representation. More...
 
TSequenceSetttextseqset_from_mfjson (json_object *mfjson)
 Return a temporal sequence set text from its MF-JSON representation. More...
 
static void wkb_parse_state_check (wkb_parse_state *s, size_t next)
 Check that we are not about to read off the end of the WKB array. More...