MobilityDB 1.3
Loading...
Searching...
No Matches
type_parser.h
Go to the documentation of this file.
1/*****************************************************************************
2 *
3 * This MobilityDB code is provided under The PostgreSQL License.
4 * Copyright (c) 2016-2025, Université libre de Bruxelles and MobilityDB
5 * contributors
6 *
7 * MobilityDB includes portions of PostGIS version 3 source code released
8 * under the GNU General Public License (GPLv2 or later).
9 * Copyright (c) 2001-2025, PostGIS contributors
10 *
11 * Permission to use, copy, modify, and distribute this software and its
12 * documentation for any purpose, without fee, and without a written
13 * agreement is hereby granted, provided that the above copyright notice and
14 * this paragraph and the following two paragraphs appear in all copies.
15 *
16 * IN NO EVENT SHALL UNIVERSITE LIBRE DE BRUXELLES BE LIABLE TO ANY PARTY FOR
17 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING
18 * LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION,
19 * EVEN IF UNIVERSITE LIBRE DE BRUXELLES HAS BEEN ADVISED OF THE POSSIBILITY
20 * OF SUCH DAMAGE.
21 *
22 * UNIVERSITE LIBRE DE BRUXELLES SPECIFICALLY DISCLAIMS ANY WARRANTIES,
23 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
24 * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON
25 * AN "AS IS" BASIS, AND UNIVERSITE LIBRE DE BRUXELLES HAS NO OBLIGATIONS TO
26 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
27 *
28 *****************************************************************************/
29
34#ifndef __TYPE_PARSER_H__
35#define __TYPE_PARSER_H__
36
37/* MEOS */
38#include <meos.h>
39#include "temporal/meos_catalog.h"
40
41/*****************************************************************************/
42
43extern bool ensure_end_input(const char **str, const char *type);
44extern void p_whitespace(const char **str);
45extern bool p_delimchar(const char **str, char delim);
46extern bool p_obrace(const char **str);
47extern bool ensure_obrace(const char **str, const char *type);
48extern bool p_cbrace(const char **str);
49extern bool ensure_cbrace(const char **str, const char *type);
50extern bool p_obracket(const char **str);
51extern bool p_cbracket(const char **str);
52extern bool p_oparen(const char **str);
53extern bool ensure_oparen(const char **str, const char *type);
54extern bool p_cparen(const char **str);
55extern bool ensure_cparen(const char **str, const char *type);
56extern bool p_comma(const char **str);
57extern bool basetype_parse(const char **str, meosType basetypid, char delim,
58 Datum *result);
59extern bool double_parse(const char **str, double *result);
60extern bool elem_parse(const char **str, meosType basetype, Datum *result);
61extern Set *set_parse(const char **str, meosType basetype);
62extern bool span_parse(const char **str, meosType spantype, bool end,
63 Span *span);
64extern SpanSet *spanset_parse(const char **str, meosType spantype);
65extern TBox *tbox_parse(const char **str);
66extern TimestampTz timestamp_parse(const char **str);
67extern bool tinstant_parse(const char **str, meosType temptype, bool end,
68 TInstant **result);
69extern TSequence *tdiscseq_parse(const char **str, meosType temptype);
70extern bool tcontseq_parse(const char **str, meosType temptype,
71 interpType interp, bool end, TSequence **result);
72extern TSequenceSet *tsequenceset_parse(const char **str, meosType temptype,
73 interpType interp);
74extern Temporal *temporal_parse(const char **str, meosType temptype);
75
76/*****************************************************************************/
77
78#endif /* __TYPE_PARSER_H__ */
meosType
Enumeration that defines the built-in and temporal types used in MobilityDB.
Definition: meos_catalog.h:55
interpType
Enumeration that defines the interpolation types used in MEOS.
Definition: meos.h:161
External API of the Mobility Engine Open Source (MEOS) library.
int64 TimestampTz
Definition: postgres_ext_defs.in.h:22
uintptr_t Datum
Definition: postgres_ext_defs.in.h:7
Structure to represent sets of values.
Definition: meos.h:80
Structure to represent span sets.
Definition: meos.h:108
Structure to represent spans (a.k.a.
Definition: meos.h:94
Structure to represent temporal boxes.
Definition: meos.h:124
Structure to represent temporal values of instant subtype.
Definition: meos.h:185
Structure to represent temporal values of sequence set subtype.
Definition: meos.h:224
Structure to represent temporal values of sequence subtype.
Definition: meos.h:202
Structure to represent the common structure of temporal values of any temporal subtype.
Definition: meos.h:173
bool p_oparen(const char **str)
Input an opening parenthesis from the buffer.
Definition: type_parser.c:188
bool ensure_oparen(const char **str, const char *type)
Ensure to input an opening parenthesis from the buffer.
Definition: type_parser.c:203
TBox * tbox_parse(const char **str)
Parse a temporal box value from the buffer.
Definition: type_parser.c:331
bool ensure_obrace(const char **str, const char *type)
Ensure to input an opening brace from the buffer.
Definition: type_parser.c:113
bool elem_parse(const char **str, meosType basetype, Datum *result)
Parse a element value from the buffer.
Definition: type_parser.c:452
bool ensure_cbrace(const char **str, const char *type)
Ensure to input a closing brace from the buffer.
Definition: type_parser.c:143
Set * set_parse(const char **str, meosType basetype)
Parse a set value from the buffer.
Definition: type_parser.c:488
bool p_obrace(const char **str)
Input an opening brace from the buffer.
Definition: type_parser.c:98
bool p_comma(const char **str)
Input a comma from the buffer.
Definition: type_parser.c:248
bool double_parse(const char **str, double *result)
Input a double from the buffer.
Definition: type_parser.c:266
bool tinstant_parse(const char **str, meosType temptype, bool end, TInstant **result)
Parse a temporal instant value from the buffer.
Definition: type_parser.c:664
bool tcontseq_parse(const char **str, meosType temptype, interpType interp, bool end, TSequence **result)
Parse a temporal sequence value from the buffer.
Definition: type_parser.c:741
TSequence * tdiscseq_parse(const char **str, meosType temptype)
Parse a temporal discrete sequence from the buffer.
Definition: type_parser.c:695
bool basetype_parse(const char **str, meosType basetypid, char delim, Datum *result)
Parse a base value from the buffer.
Definition: type_parser.c:285
bool p_cparen(const char **str)
Input a closing parenthesis from the buffer.
Definition: type_parser.c:218
SpanSet * spanset_parse(const char **str, meosType spantype)
Parse a span set value from the buffer.
Definition: type_parser.c:618
bool p_cbrace(const char **str)
Input a closing brace from the buffer.
Definition: type_parser.c:128
TSequenceSet * tsequenceset_parse(const char **str, meosType temptype, interpType interp)
Parse a temporal sequence set from the buffer.
Definition: type_parser.c:804
Temporal * temporal_parse(const char **str, meosType temptype)
Parse a temporal value from the buffer (dispatch function)
Definition: type_parser.c:845
bool p_delimchar(const char **str, char delim)
Input an opening brace from the buffer.
Definition: type_parser.c:83
bool ensure_end_input(const char **str, const char *type)
Functions for parsing temporal types.
Definition: type_parser.c:56
bool ensure_cparen(const char **str, const char *type)
Ensure to input a closing parenthesis from the buffer.
Definition: type_parser.c:233
bool span_parse(const char **str, meosType spantype, bool end, Span *span)
Parse a span value from the buffer.
Definition: type_parser.c:572
bool p_cbracket(const char **str)
Input a closing bracket from the buffer.
Definition: type_parser.c:173
TimestampTz timestamp_parse(const char **str)
Parse a timestamp value from the buffer.
Definition: type_parser.c:426
bool p_obracket(const char **str)
Input an opening bracket from the buffer.
Definition: type_parser.c:158
void p_whitespace(const char **str)
Input a white space from the buffer.
Definition: type_parser.c:72