MobilityDB 1.1
set.h
Go to the documentation of this file.
1/*****************************************************************************
2 *
3 * This MobilityDB code is provided under The PostgreSQL License.
4 * Copyright (c) 2016-2023, 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-2023, 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 __SET_H__
35#define __SET_H__
36
37/*****************************************************************************/
38
39/*
40 * fmgr macros for ordered set types
41 */
42
43/* PostgreSQL */
44#include <postgres.h>
45/* MEOS */
46#include <meos.h>
47
48#if MEOS
49 #define DatumGetSetP(X) ((Set *) DatumGetPointer(X))
50#else
51 #define DatumGetSetP(X) ((Set *) PG_DETOAST_DATUM(X))
52#endif /* MEOS */
53#define SetPGetDatum(X) PointerGetDatum(X)
54#define PG_GETARG_SET_P(X) ((Set *) PG_GETARG_VARLENA_P(X))
55#define PG_RETURN_SET_P(X) PG_RETURN_POINTER(X)
56
57#define MINIDX 0
58#define MAXIDX count - 1
59
60/*****************************************************************************
61 * Struct definition for the unnest operation
62 *****************************************************************************/
63
68typedef struct
69{
70 bool done;
71 int i;
72 int count;
73 Set *set; /* Set to unnest */
74 Datum *values; /* Values obtained by getValues(temp) */
76
77
78/*****************************************************************************/
79
80/* General functions */
81
82extern bool set_find_value(const Set *s, Datum, int *loc);
83
84/*****************************************************************************/
85
86#endif /* __SET_H__ */
bool set_find_value(const Set *s, Datum, int *loc)
General functions for set values composed of an ordered list of distinct values.
Definition: set.c:82
uintptr_t Datum
Definition: pg_ext_defs.in.h:4
int i
Definition: set.h:71
int count
Definition: set.h:72
Datum * values
Definition: set.h:74
Set * set
Definition: set.h:73
bool done
Definition: set.h:70
Structure to represent information about an entry that can be placed to either group without affectin...
Definition: set.h:69
API of the Mobility Engine Open Source (MEOS) library.
Definition: meos.h:56