From a2c0e716fd8cdbe7e4d6e2274c2abb9d26e7a491 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Esteban=20Zim=C3=A1nyi?= Date: Tue, 27 Oct 2026 23:22:22 +0100 Subject: [PATCH] Take the headers of the flat layer from the catalog tools/codegen.py binds every non-vendored catalog function of a bound family whose header the libmeos prefix installs, one Go file per header, as JMEOS FunctionsGenerator binds every catalog function of an enabled family: the headers come from the catalog's file field, a family leaves with =OFF in the environment, and the installed headers are the names pkg-config gives for the meos prefix, read as PyMEOS-CFFI get_installed_headers reads them, names only. The preambles include those headers, meos.h first, and the generator holds no list of headers. Each run writes the Go file of each header its plan names and removes the others. The flat layer binds meos_raster.h, meos_s2cell.h, meos_cellindex.h and the pg_*.h headers of the base types, so the object layer reaches 1524 methods and defers 67. The 227 internal functions of pgtypes.h and pgsql_compat.h, headers the prefix does not install, are named in the report and not bound. tools/refresh.conf gives the generator the prefix it builds, so a header installed under /usr/local decides nothing. Measured over MobilityDB master a23e01a60b and MEOS-API master: 4612 wrappers, every header the generated files include present in the prefix; go build of functions and types, go test of the root examples with TZ=UTC as CI sets it, and the parity test pass. --- functions/cgo.go | 22 +- functions/meos_meos.go | 22 +- functions/meos_meos_catalog.go | 22 +- functions/meos_meos_cbuffer.go | 22 +- functions/meos_meos_cellindex.go | 172 +++ functions/meos_meos_geo.go | 22 +- functions/meos_meos_h3.go | 22 +- functions/meos_meos_internal.go | 22 +- functions/meos_meos_internal_geo.go | 22 +- functions/meos_meos_json.go | 22 +- functions/meos_meos_npoint.go | 22 +- functions/meos_meos_pointcloud.go | 22 +- functions/meos_meos_pose.go | 22 +- functions/meos_meos_quadbin.go | 22 +- functions/meos_meos_raster.go | 1530 ++++++++++++++++++++++ functions/meos_meos_rgeo.go | 22 +- functions/meos_meos_s2cell.go | 1364 ++++++++++++++++++++ functions/meos_pg_bool.go | 205 +++ functions/meos_pg_date.go | 671 ++++++++++ functions/meos_pg_float.go | 542 ++++++++ functions/meos_pg_int.go | 1836 +++++++++++++++++++++++++++ functions/meos_pg_interval.go | 352 +++++ functions/meos_pg_text.go | 668 ++++++++++ functions/meos_pg_time.go | 633 +++++++++ functions/meos_pg_timestamp.go | 792 ++++++++++++ functions/types.go | 36 +- tools/README.md | 15 +- tools/codegen.py | 133 +- tools/refresh.conf | 5 +- types/geo.go | 18 + types/raquet.go | 275 ++++ types/raster.go | 473 +++++++ types/tbigint.go | 9 + types/tgeogpoint.go | 18 + types/tgeompoint.go | 18 + 35 files changed, 9940 insertions(+), 133 deletions(-) create mode 100644 functions/meos_meos_cellindex.go create mode 100644 functions/meos_meos_raster.go create mode 100644 functions/meos_meos_s2cell.go create mode 100644 functions/meos_pg_bool.go create mode 100644 functions/meos_pg_date.go create mode 100644 functions/meos_pg_float.go create mode 100644 functions/meos_pg_int.go create mode 100644 functions/meos_pg_interval.go create mode 100644 functions/meos_pg_text.go create mode 100644 functions/meos_pg_time.go create mode 100644 functions/meos_pg_timestamp.go diff --git a/functions/cgo.go b/functions/cgo.go index aad5f25..120ca4a 100644 --- a/functions/cgo.go +++ b/functions/cgo.go @@ -24,17 +24,29 @@ package functions #include #include "meos.h" #include "meos_catalog.h" +#include "meos_cbuffer.h" +#include "meos_cellindex.h" #include "meos_geo.h" +#include "meos_h3.h" #include "meos_internal.h" #include "meos_internal_geo.h" +#include "meos_json.h" #include "meos_npoint.h" -#include "meos_cbuffer.h" +#include "meos_pointcloud.h" #include "meos_pose.h" -#include "meos_rgeo.h" -#include "meos_h3.h" #include "meos_quadbin.h" -#include "meos_json.h" -#include "meos_pointcloud.h" +#include "meos_raster.h" +#include "meos_rgeo.h" +#include "meos_s2cell.h" +#include "pg_basetypes.h" +#include "pg_bool.h" +#include "pg_date.h" +#include "pg_float.h" +#include "pg_int.h" +#include "pg_interval.h" +#include "pg_text.h" +#include "pg_time.h" +#include "pg_timestamp.h" */ import "C" diff --git a/functions/meos_meos.go b/functions/meos_meos.go index d911fc4..6798070 100644 --- a/functions/meos_meos.go +++ b/functions/meos_meos.go @@ -4,17 +4,29 @@ package functions #include #include "meos.h" #include "meos_catalog.h" +#include "meos_cbuffer.h" +#include "meos_cellindex.h" #include "meos_geo.h" +#include "meos_h3.h" #include "meos_internal.h" #include "meos_internal_geo.h" +#include "meos_json.h" #include "meos_npoint.h" -#include "meos_cbuffer.h" +#include "meos_pointcloud.h" #include "meos_pose.h" -#include "meos_rgeo.h" -#include "meos_h3.h" #include "meos_quadbin.h" -#include "meos_json.h" -#include "meos_pointcloud.h" +#include "meos_raster.h" +#include "meos_rgeo.h" +#include "meos_s2cell.h" +#include "pg_basetypes.h" +#include "pg_bool.h" +#include "pg_date.h" +#include "pg_float.h" +#include "pg_int.h" +#include "pg_interval.h" +#include "pg_text.h" +#include "pg_time.h" +#include "pg_timestamp.h" // cgo reads C.union_* as a union TYPE; alias the union operators so C.g resolves them as functions. #define gunion_bigint_set union_bigint_set diff --git a/functions/meos_meos_catalog.go b/functions/meos_meos_catalog.go index 35b7bb6..e4ee5eb 100644 --- a/functions/meos_meos_catalog.go +++ b/functions/meos_meos_catalog.go @@ -4,17 +4,29 @@ package functions #include #include "meos.h" #include "meos_catalog.h" +#include "meos_cbuffer.h" +#include "meos_cellindex.h" #include "meos_geo.h" +#include "meos_h3.h" #include "meos_internal.h" #include "meos_internal_geo.h" +#include "meos_json.h" #include "meos_npoint.h" -#include "meos_cbuffer.h" +#include "meos_pointcloud.h" #include "meos_pose.h" -#include "meos_rgeo.h" -#include "meos_h3.h" #include "meos_quadbin.h" -#include "meos_json.h" -#include "meos_pointcloud.h" +#include "meos_raster.h" +#include "meos_rgeo.h" +#include "meos_s2cell.h" +#include "pg_basetypes.h" +#include "pg_bool.h" +#include "pg_date.h" +#include "pg_float.h" +#include "pg_int.h" +#include "pg_interval.h" +#include "pg_text.h" +#include "pg_time.h" +#include "pg_timestamp.h" // cgo reads C.union_* as a union TYPE; alias the union operators so C.g resolves them as functions. #define gunion_bigint_set union_bigint_set diff --git a/functions/meos_meos_cbuffer.go b/functions/meos_meos_cbuffer.go index 976b7c2..90b6f07 100644 --- a/functions/meos_meos_cbuffer.go +++ b/functions/meos_meos_cbuffer.go @@ -4,17 +4,29 @@ package functions #include #include "meos.h" #include "meos_catalog.h" +#include "meos_cbuffer.h" +#include "meos_cellindex.h" #include "meos_geo.h" +#include "meos_h3.h" #include "meos_internal.h" #include "meos_internal_geo.h" +#include "meos_json.h" #include "meos_npoint.h" -#include "meos_cbuffer.h" +#include "meos_pointcloud.h" #include "meos_pose.h" -#include "meos_rgeo.h" -#include "meos_h3.h" #include "meos_quadbin.h" -#include "meos_json.h" -#include "meos_pointcloud.h" +#include "meos_raster.h" +#include "meos_rgeo.h" +#include "meos_s2cell.h" +#include "pg_basetypes.h" +#include "pg_bool.h" +#include "pg_date.h" +#include "pg_float.h" +#include "pg_int.h" +#include "pg_interval.h" +#include "pg_text.h" +#include "pg_time.h" +#include "pg_timestamp.h" // cgo reads C.union_* as a union TYPE; alias the union operators so C.g resolves them as functions. #define gunion_bigint_set union_bigint_set diff --git a/functions/meos_meos_cellindex.go b/functions/meos_meos_cellindex.go new file mode 100644 index 0000000..a7fa92d --- /dev/null +++ b/functions/meos_meos_cellindex.go @@ -0,0 +1,172 @@ +package functions + +/* +#include +#include "meos.h" +#include "meos_catalog.h" +#include "meos_cbuffer.h" +#include "meos_cellindex.h" +#include "meos_geo.h" +#include "meos_h3.h" +#include "meos_internal.h" +#include "meos_internal_geo.h" +#include "meos_json.h" +#include "meos_npoint.h" +#include "meos_pointcloud.h" +#include "meos_pose.h" +#include "meos_quadbin.h" +#include "meos_raster.h" +#include "meos_rgeo.h" +#include "meos_s2cell.h" +#include "pg_basetypes.h" +#include "pg_bool.h" +#include "pg_date.h" +#include "pg_float.h" +#include "pg_int.h" +#include "pg_interval.h" +#include "pg_text.h" +#include "pg_time.h" +#include "pg_timestamp.h" + +// cgo reads C.union_* as a union TYPE; alias the union operators so C.g resolves them as functions. +#define gunion_bigint_set union_bigint_set +#define gunion_bigint_span union_bigint_span +#define gunion_bigint_spanset union_bigint_spanset +#define gunion_cbuffer_set union_cbuffer_set +#define gunion_date_set union_date_set +#define gunion_date_span union_date_span +#define gunion_date_spanset union_date_spanset +#define gunion_float_set union_float_set +#define gunion_float_span union_float_span +#define gunion_float_spanset union_float_spanset +#define gunion_geo_set union_geo_set +#define gunion_h3index_set union_h3index_set +#define gunion_int_set union_int_set +#define gunion_int_span union_int_span +#define gunion_int_spanset union_int_spanset +#define gunion_jsonb_set union_jsonb_set +#define gunion_npoint_set union_npoint_set +#define gunion_pcpatch_set union_pcpatch_set +#define gunion_pcpoint_set union_pcpoint_set +#define gunion_pose_set union_pose_set +#define gunion_posechain_set union_posechain_set +#define gunion_quadbin_set union_quadbin_set +#define gunion_s2cell_set union_s2cell_set +#define gunion_set_bigint union_set_bigint +#define gunion_set_cbuffer union_set_cbuffer +#define gunion_set_date union_set_date +#define gunion_set_float union_set_float +#define gunion_set_geo union_set_geo +#define gunion_set_h3index union_set_h3index +#define gunion_set_int union_set_int +#define gunion_set_jsonb union_set_jsonb +#define gunion_set_npoint union_set_npoint +#define gunion_set_pcpatch union_set_pcpatch +#define gunion_set_pcpoint union_set_pcpoint +#define gunion_set_pose union_set_pose +#define gunion_set_posechain union_set_posechain +#define gunion_set_quadbin union_set_quadbin +#define gunion_set_s2cell union_set_s2cell +#define gunion_set_set union_set_set +#define gunion_set_text union_set_text +#define gunion_set_timestamptz union_set_timestamptz +#define gunion_set_value union_set_value +#define gunion_span_bigint union_span_bigint +#define gunion_span_date union_span_date +#define gunion_span_float union_span_float +#define gunion_span_int union_span_int +#define gunion_span_span union_span_span +#define gunion_span_spanset union_span_spanset +#define gunion_span_timestamptz union_span_timestamptz +#define gunion_span_value union_span_value +#define gunion_spanset_bigint union_spanset_bigint +#define gunion_spanset_date union_spanset_date +#define gunion_spanset_float union_spanset_float +#define gunion_spanset_int union_spanset_int +#define gunion_spanset_span union_spanset_span +#define gunion_spanset_spanset union_spanset_spanset +#define gunion_spanset_timestamptz union_spanset_timestamptz +#define gunion_spanset_value union_spanset_value +#define gunion_stbox_stbox union_stbox_stbox +#define gunion_tbox_tbox union_tbox_tbox +#define gunion_text_set union_text_set +#define gunion_timestamptz_set union_timestamptz_set +#define gunion_timestamptz_span union_timestamptz_span +#define gunion_timestamptz_spanset union_timestamptz_spanset +#define gunion_tpcbox_tpcbox union_tpcbox_tpcbox +#define gunion_value_set union_value_set +#define gunion_value_span union_value_span +#define gunion_value_spanset union_value_spanset +*/ +import "C" +import ( + "unsafe" +) + +var _ = unsafe.Pointer(nil) + +// TcellindexGetResolution wraps MEOS C function tcellindex_get_resolution. +func TcellindexGetResolution(temp *Temporal) (_r0 *Temporal, _err error) { + C.meos_errno_reset() + _cret := C.tcellindex_get_resolution(temp._inner) + if _err = meosError(); _err != nil { + return + } + return &Temporal{_inner: _cret}, nil +} + + +// TcellindexIsValidCell wraps MEOS C function tcellindex_is_valid_cell. +func TcellindexIsValidCell(temp *Temporal) (_r0 *Temporal, _err error) { + C.meos_errno_reset() + _cret := C.tcellindex_is_valid_cell(temp._inner) + if _err = meosError(); _err != nil { + return + } + return &Temporal{_inner: _cret}, nil +} + + +// TcellindexCellToParent wraps MEOS C function tcellindex_cell_to_parent. +func TcellindexCellToParent(temp *Temporal, resolution int32) (_r0 *Temporal, _err error) { + C.meos_errno_reset() + _cret := C.tcellindex_cell_to_parent(temp._inner, C.int32(resolution)) + if _err = meosError(); _err != nil { + return + } + return &Temporal{_inner: _cret}, nil +} + + +// TcellindexCellToPoint wraps MEOS C function tcellindex_cell_to_point. +func TcellindexCellToPoint(temp *Temporal) (_r0 *Temporal, _err error) { + C.meos_errno_reset() + _cret := C.tcellindex_cell_to_point(temp._inner) + if _err = meosError(); _err != nil { + return + } + return &Temporal{_inner: _cret}, nil +} + + +// TcellindexCellToBoundary wraps MEOS C function tcellindex_cell_to_boundary. +func TcellindexCellToBoundary(temp *Temporal) (_r0 *Temporal, _err error) { + C.meos_errno_reset() + _cret := C.tcellindex_cell_to_boundary(temp._inner) + if _err = meosError(); _err != nil { + return + } + return &Temporal{_inner: _cret}, nil +} + + +// TcellindexCellArea wraps MEOS C function tcellindex_cell_area. +func TcellindexCellArea(temp *Temporal) (_r0 *Temporal, _err error) { + C.meos_errno_reset() + _cret := C.tcellindex_cell_area(temp._inner) + if _err = meosError(); _err != nil { + return + } + return &Temporal{_inner: _cret}, nil +} + diff --git a/functions/meos_meos_geo.go b/functions/meos_meos_geo.go index a9c1bdf..1f1fd6a 100644 --- a/functions/meos_meos_geo.go +++ b/functions/meos_meos_geo.go @@ -4,17 +4,29 @@ package functions #include #include "meos.h" #include "meos_catalog.h" +#include "meos_cbuffer.h" +#include "meos_cellindex.h" #include "meos_geo.h" +#include "meos_h3.h" #include "meos_internal.h" #include "meos_internal_geo.h" +#include "meos_json.h" #include "meos_npoint.h" -#include "meos_cbuffer.h" +#include "meos_pointcloud.h" #include "meos_pose.h" -#include "meos_rgeo.h" -#include "meos_h3.h" #include "meos_quadbin.h" -#include "meos_json.h" -#include "meos_pointcloud.h" +#include "meos_raster.h" +#include "meos_rgeo.h" +#include "meos_s2cell.h" +#include "pg_basetypes.h" +#include "pg_bool.h" +#include "pg_date.h" +#include "pg_float.h" +#include "pg_int.h" +#include "pg_interval.h" +#include "pg_text.h" +#include "pg_time.h" +#include "pg_timestamp.h" // cgo reads C.union_* as a union TYPE; alias the union operators so C.g resolves them as functions. #define gunion_bigint_set union_bigint_set diff --git a/functions/meos_meos_h3.go b/functions/meos_meos_h3.go index 238901e..a2805b2 100644 --- a/functions/meos_meos_h3.go +++ b/functions/meos_meos_h3.go @@ -4,17 +4,29 @@ package functions #include #include "meos.h" #include "meos_catalog.h" +#include "meos_cbuffer.h" +#include "meos_cellindex.h" #include "meos_geo.h" +#include "meos_h3.h" #include "meos_internal.h" #include "meos_internal_geo.h" +#include "meos_json.h" #include "meos_npoint.h" -#include "meos_cbuffer.h" +#include "meos_pointcloud.h" #include "meos_pose.h" -#include "meos_rgeo.h" -#include "meos_h3.h" #include "meos_quadbin.h" -#include "meos_json.h" -#include "meos_pointcloud.h" +#include "meos_raster.h" +#include "meos_rgeo.h" +#include "meos_s2cell.h" +#include "pg_basetypes.h" +#include "pg_bool.h" +#include "pg_date.h" +#include "pg_float.h" +#include "pg_int.h" +#include "pg_interval.h" +#include "pg_text.h" +#include "pg_time.h" +#include "pg_timestamp.h" // cgo reads C.union_* as a union TYPE; alias the union operators so C.g resolves them as functions. #define gunion_bigint_set union_bigint_set diff --git a/functions/meos_meos_internal.go b/functions/meos_meos_internal.go index d38ecd3..e86005a 100644 --- a/functions/meos_meos_internal.go +++ b/functions/meos_meos_internal.go @@ -4,17 +4,29 @@ package functions #include #include "meos.h" #include "meos_catalog.h" +#include "meos_cbuffer.h" +#include "meos_cellindex.h" #include "meos_geo.h" +#include "meos_h3.h" #include "meos_internal.h" #include "meos_internal_geo.h" +#include "meos_json.h" #include "meos_npoint.h" -#include "meos_cbuffer.h" +#include "meos_pointcloud.h" #include "meos_pose.h" -#include "meos_rgeo.h" -#include "meos_h3.h" #include "meos_quadbin.h" -#include "meos_json.h" -#include "meos_pointcloud.h" +#include "meos_raster.h" +#include "meos_rgeo.h" +#include "meos_s2cell.h" +#include "pg_basetypes.h" +#include "pg_bool.h" +#include "pg_date.h" +#include "pg_float.h" +#include "pg_int.h" +#include "pg_interval.h" +#include "pg_text.h" +#include "pg_time.h" +#include "pg_timestamp.h" // cgo reads C.union_* as a union TYPE; alias the union operators so C.g resolves them as functions. #define gunion_bigint_set union_bigint_set diff --git a/functions/meos_meos_internal_geo.go b/functions/meos_meos_internal_geo.go index 426f2b4..9b2b264 100644 --- a/functions/meos_meos_internal_geo.go +++ b/functions/meos_meos_internal_geo.go @@ -4,17 +4,29 @@ package functions #include #include "meos.h" #include "meos_catalog.h" +#include "meos_cbuffer.h" +#include "meos_cellindex.h" #include "meos_geo.h" +#include "meos_h3.h" #include "meos_internal.h" #include "meos_internal_geo.h" +#include "meos_json.h" #include "meos_npoint.h" -#include "meos_cbuffer.h" +#include "meos_pointcloud.h" #include "meos_pose.h" -#include "meos_rgeo.h" -#include "meos_h3.h" #include "meos_quadbin.h" -#include "meos_json.h" -#include "meos_pointcloud.h" +#include "meos_raster.h" +#include "meos_rgeo.h" +#include "meos_s2cell.h" +#include "pg_basetypes.h" +#include "pg_bool.h" +#include "pg_date.h" +#include "pg_float.h" +#include "pg_int.h" +#include "pg_interval.h" +#include "pg_text.h" +#include "pg_time.h" +#include "pg_timestamp.h" // cgo reads C.union_* as a union TYPE; alias the union operators so C.g resolves them as functions. #define gunion_bigint_set union_bigint_set diff --git a/functions/meos_meos_json.go b/functions/meos_meos_json.go index 90648b9..23e3964 100644 --- a/functions/meos_meos_json.go +++ b/functions/meos_meos_json.go @@ -4,17 +4,29 @@ package functions #include #include "meos.h" #include "meos_catalog.h" +#include "meos_cbuffer.h" +#include "meos_cellindex.h" #include "meos_geo.h" +#include "meos_h3.h" #include "meos_internal.h" #include "meos_internal_geo.h" +#include "meos_json.h" #include "meos_npoint.h" -#include "meos_cbuffer.h" +#include "meos_pointcloud.h" #include "meos_pose.h" -#include "meos_rgeo.h" -#include "meos_h3.h" #include "meos_quadbin.h" -#include "meos_json.h" -#include "meos_pointcloud.h" +#include "meos_raster.h" +#include "meos_rgeo.h" +#include "meos_s2cell.h" +#include "pg_basetypes.h" +#include "pg_bool.h" +#include "pg_date.h" +#include "pg_float.h" +#include "pg_int.h" +#include "pg_interval.h" +#include "pg_text.h" +#include "pg_time.h" +#include "pg_timestamp.h" // cgo reads C.union_* as a union TYPE; alias the union operators so C.g resolves them as functions. #define gunion_bigint_set union_bigint_set diff --git a/functions/meos_meos_npoint.go b/functions/meos_meos_npoint.go index a9956fb..e8ce3a6 100644 --- a/functions/meos_meos_npoint.go +++ b/functions/meos_meos_npoint.go @@ -4,17 +4,29 @@ package functions #include #include "meos.h" #include "meos_catalog.h" +#include "meos_cbuffer.h" +#include "meos_cellindex.h" #include "meos_geo.h" +#include "meos_h3.h" #include "meos_internal.h" #include "meos_internal_geo.h" +#include "meos_json.h" #include "meos_npoint.h" -#include "meos_cbuffer.h" +#include "meos_pointcloud.h" #include "meos_pose.h" -#include "meos_rgeo.h" -#include "meos_h3.h" #include "meos_quadbin.h" -#include "meos_json.h" -#include "meos_pointcloud.h" +#include "meos_raster.h" +#include "meos_rgeo.h" +#include "meos_s2cell.h" +#include "pg_basetypes.h" +#include "pg_bool.h" +#include "pg_date.h" +#include "pg_float.h" +#include "pg_int.h" +#include "pg_interval.h" +#include "pg_text.h" +#include "pg_time.h" +#include "pg_timestamp.h" // cgo reads C.union_* as a union TYPE; alias the union operators so C.g resolves them as functions. #define gunion_bigint_set union_bigint_set diff --git a/functions/meos_meos_pointcloud.go b/functions/meos_meos_pointcloud.go index 889b3a1..a00aead 100644 --- a/functions/meos_meos_pointcloud.go +++ b/functions/meos_meos_pointcloud.go @@ -4,17 +4,29 @@ package functions #include #include "meos.h" #include "meos_catalog.h" +#include "meos_cbuffer.h" +#include "meos_cellindex.h" #include "meos_geo.h" +#include "meos_h3.h" #include "meos_internal.h" #include "meos_internal_geo.h" +#include "meos_json.h" #include "meos_npoint.h" -#include "meos_cbuffer.h" +#include "meos_pointcloud.h" #include "meos_pose.h" -#include "meos_rgeo.h" -#include "meos_h3.h" #include "meos_quadbin.h" -#include "meos_json.h" -#include "meos_pointcloud.h" +#include "meos_raster.h" +#include "meos_rgeo.h" +#include "meos_s2cell.h" +#include "pg_basetypes.h" +#include "pg_bool.h" +#include "pg_date.h" +#include "pg_float.h" +#include "pg_int.h" +#include "pg_interval.h" +#include "pg_text.h" +#include "pg_time.h" +#include "pg_timestamp.h" // cgo reads C.union_* as a union TYPE; alias the union operators so C.g resolves them as functions. #define gunion_bigint_set union_bigint_set diff --git a/functions/meos_meos_pose.go b/functions/meos_meos_pose.go index a9cbe5b..a970bd4 100644 --- a/functions/meos_meos_pose.go +++ b/functions/meos_meos_pose.go @@ -4,17 +4,29 @@ package functions #include #include "meos.h" #include "meos_catalog.h" +#include "meos_cbuffer.h" +#include "meos_cellindex.h" #include "meos_geo.h" +#include "meos_h3.h" #include "meos_internal.h" #include "meos_internal_geo.h" +#include "meos_json.h" #include "meos_npoint.h" -#include "meos_cbuffer.h" +#include "meos_pointcloud.h" #include "meos_pose.h" -#include "meos_rgeo.h" -#include "meos_h3.h" #include "meos_quadbin.h" -#include "meos_json.h" -#include "meos_pointcloud.h" +#include "meos_raster.h" +#include "meos_rgeo.h" +#include "meos_s2cell.h" +#include "pg_basetypes.h" +#include "pg_bool.h" +#include "pg_date.h" +#include "pg_float.h" +#include "pg_int.h" +#include "pg_interval.h" +#include "pg_text.h" +#include "pg_time.h" +#include "pg_timestamp.h" // cgo reads C.union_* as a union TYPE; alias the union operators so C.g resolves them as functions. #define gunion_bigint_set union_bigint_set diff --git a/functions/meos_meos_quadbin.go b/functions/meos_meos_quadbin.go index 7d4a55f..2b787fb 100644 --- a/functions/meos_meos_quadbin.go +++ b/functions/meos_meos_quadbin.go @@ -4,17 +4,29 @@ package functions #include #include "meos.h" #include "meos_catalog.h" +#include "meos_cbuffer.h" +#include "meos_cellindex.h" #include "meos_geo.h" +#include "meos_h3.h" #include "meos_internal.h" #include "meos_internal_geo.h" +#include "meos_json.h" #include "meos_npoint.h" -#include "meos_cbuffer.h" +#include "meos_pointcloud.h" #include "meos_pose.h" -#include "meos_rgeo.h" -#include "meos_h3.h" #include "meos_quadbin.h" -#include "meos_json.h" -#include "meos_pointcloud.h" +#include "meos_raster.h" +#include "meos_rgeo.h" +#include "meos_s2cell.h" +#include "pg_basetypes.h" +#include "pg_bool.h" +#include "pg_date.h" +#include "pg_float.h" +#include "pg_int.h" +#include "pg_interval.h" +#include "pg_text.h" +#include "pg_time.h" +#include "pg_timestamp.h" // cgo reads C.union_* as a union TYPE; alias the union operators so C.g resolves them as functions. #define gunion_bigint_set union_bigint_set diff --git a/functions/meos_meos_raster.go b/functions/meos_meos_raster.go new file mode 100644 index 0000000..f8ae8b9 --- /dev/null +++ b/functions/meos_meos_raster.go @@ -0,0 +1,1530 @@ +package functions + +/* +#include +#include "meos.h" +#include "meos_catalog.h" +#include "meos_cbuffer.h" +#include "meos_cellindex.h" +#include "meos_geo.h" +#include "meos_h3.h" +#include "meos_internal.h" +#include "meos_internal_geo.h" +#include "meos_json.h" +#include "meos_npoint.h" +#include "meos_pointcloud.h" +#include "meos_pose.h" +#include "meos_quadbin.h" +#include "meos_raster.h" +#include "meos_rgeo.h" +#include "meos_s2cell.h" +#include "pg_basetypes.h" +#include "pg_bool.h" +#include "pg_date.h" +#include "pg_float.h" +#include "pg_int.h" +#include "pg_interval.h" +#include "pg_text.h" +#include "pg_time.h" +#include "pg_timestamp.h" + +// cgo reads C.union_* as a union TYPE; alias the union operators so C.g resolves them as functions. +#define gunion_bigint_set union_bigint_set +#define gunion_bigint_span union_bigint_span +#define gunion_bigint_spanset union_bigint_spanset +#define gunion_cbuffer_set union_cbuffer_set +#define gunion_date_set union_date_set +#define gunion_date_span union_date_span +#define gunion_date_spanset union_date_spanset +#define gunion_float_set union_float_set +#define gunion_float_span union_float_span +#define gunion_float_spanset union_float_spanset +#define gunion_geo_set union_geo_set +#define gunion_h3index_set union_h3index_set +#define gunion_int_set union_int_set +#define gunion_int_span union_int_span +#define gunion_int_spanset union_int_spanset +#define gunion_jsonb_set union_jsonb_set +#define gunion_npoint_set union_npoint_set +#define gunion_pcpatch_set union_pcpatch_set +#define gunion_pcpoint_set union_pcpoint_set +#define gunion_pose_set union_pose_set +#define gunion_posechain_set union_posechain_set +#define gunion_quadbin_set union_quadbin_set +#define gunion_s2cell_set union_s2cell_set +#define gunion_set_bigint union_set_bigint +#define gunion_set_cbuffer union_set_cbuffer +#define gunion_set_date union_set_date +#define gunion_set_float union_set_float +#define gunion_set_geo union_set_geo +#define gunion_set_h3index union_set_h3index +#define gunion_set_int union_set_int +#define gunion_set_jsonb union_set_jsonb +#define gunion_set_npoint union_set_npoint +#define gunion_set_pcpatch union_set_pcpatch +#define gunion_set_pcpoint union_set_pcpoint +#define gunion_set_pose union_set_pose +#define gunion_set_posechain union_set_posechain +#define gunion_set_quadbin union_set_quadbin +#define gunion_set_s2cell union_set_s2cell +#define gunion_set_set union_set_set +#define gunion_set_text union_set_text +#define gunion_set_timestamptz union_set_timestamptz +#define gunion_set_value union_set_value +#define gunion_span_bigint union_span_bigint +#define gunion_span_date union_span_date +#define gunion_span_float union_span_float +#define gunion_span_int union_span_int +#define gunion_span_span union_span_span +#define gunion_span_spanset union_span_spanset +#define gunion_span_timestamptz union_span_timestamptz +#define gunion_span_value union_span_value +#define gunion_spanset_bigint union_spanset_bigint +#define gunion_spanset_date union_spanset_date +#define gunion_spanset_float union_spanset_float +#define gunion_spanset_int union_spanset_int +#define gunion_spanset_span union_spanset_span +#define gunion_spanset_spanset union_spanset_spanset +#define gunion_spanset_timestamptz union_spanset_timestamptz +#define gunion_spanset_value union_spanset_value +#define gunion_stbox_stbox union_stbox_stbox +#define gunion_tbox_tbox union_tbox_tbox +#define gunion_text_set union_text_set +#define gunion_timestamptz_set union_timestamptz_set +#define gunion_timestamptz_span union_timestamptz_span +#define gunion_timestamptz_spanset union_timestamptz_spanset +#define gunion_tpcbox_tpcbox union_tpcbox_tpcbox +#define gunion_value_set union_value_set +#define gunion_value_span union_value_span +#define gunion_value_spanset union_value_spanset +*/ +import "C" +import ( + "unsafe" +) + +var _ = unsafe.Pointer(nil) + +// RaquetPixtypeSize wraps MEOS C function raquet_pixtype_size. +func RaquetPixtypeSize(pixtype MeosPixType) (_r0 uint, _err error) { + C.meos_errno_reset() + _cret := C.raquet_pixtype_size(C.MeosPixType(pixtype)) + if _err = meosError(); _err != nil { + return + } + return uint(_cret), nil +} + + +// RaquetPixtypeFromString wraps MEOS C function raquet_pixtype_from_string. +func RaquetPixtypeFromString(str string) (_r0 MeosPixType, _err error) { + _c_str := C.CString(str) + defer C.free(unsafe.Pointer(_c_str)) + C.meos_errno_reset() + _cret := C.raquet_pixtype_from_string(_c_str) + if _err = meosError(); _err != nil { + return + } + return MeosPixType(_cret), nil +} + + +// RaquetIn wraps MEOS C function raquet_in. +func RaquetIn(str string) (_r0 unsafe.Pointer, _err error) { + _c_str := C.CString(str) + defer C.free(unsafe.Pointer(_c_str)) + C.meos_errno_reset() + _cret := C.raquet_in(_c_str) + if _err = meosError(); _err != nil { + return + } + return unsafe.Pointer(_cret), nil +} + + +// RaquetOut wraps MEOS C function raquet_out. +func RaquetOut(rq unsafe.Pointer) (_r0 string, _err error) { + C.meos_errno_reset() + _cret := C.raquet_out((*C.Raquet)(unsafe.Pointer(rq))) + if _err = meosError(); _err != nil { + return + } + defer C.free(unsafe.Pointer(_cret)) + return C.GoString(_cret), nil +} + + +// RaquetFromWKB wraps MEOS C function raquet_from_wkb. +func RaquetFromWKB(wkb unsafe.Pointer, size uint) (_r0 unsafe.Pointer, _err error) { + C.meos_errno_reset() + _cret := C.raquet_from_wkb((*C.uint8_t)(unsafe.Pointer(wkb)), C.size_t(size)) + if _err = meosError(); _err != nil { + return + } + return unsafe.Pointer(_cret), nil +} + + +// RaquetFromHexwkb wraps MEOS C function raquet_from_hexwkb. +func RaquetFromHexwkb(hexwkb string) (_r0 unsafe.Pointer, _err error) { + _c_hexwkb := C.CString(hexwkb) + defer C.free(unsafe.Pointer(_c_hexwkb)) + C.meos_errno_reset() + _cret := C.raquet_from_hexwkb(_c_hexwkb) + if _err = meosError(); _err != nil { + return + } + return unsafe.Pointer(_cret), nil +} + + +// RaquetAsWKB wraps MEOS C function raquet_as_wkb. +func RaquetAsWKB(rq unsafe.Pointer, variant uint8, size_out unsafe.Pointer) (_r0 unsafe.Pointer, _err error) { + C.meos_errno_reset() + _cret := C.raquet_as_wkb((*C.Raquet)(unsafe.Pointer(rq)), C.uint8_t(variant), (*C.size_t)(unsafe.Pointer(size_out))) + if _err = meosError(); _err != nil { + return + } + return unsafe.Pointer(_cret), nil +} + + +// RaquetAsHexwkb wraps MEOS C function raquet_as_hexwkb. +func RaquetAsHexwkb(rq unsafe.Pointer, variant uint8, size_out unsafe.Pointer) (_r0 string, _err error) { + C.meos_errno_reset() + _cret := C.raquet_as_hexwkb((*C.Raquet)(unsafe.Pointer(rq)), C.uint8_t(variant), (*C.size_t)(unsafe.Pointer(size_out))) + if _err = meosError(); _err != nil { + return + } + defer C.free(unsafe.Pointer(_cret)) + return C.GoString(_cret), nil +} + + +// RaquetMake wraps MEOS C function raquet_make. +func RaquetMake(quadbin uint64, width int32, height int32, pixtype MeosPixType, nodata float64, has_nodata bool, pixels unsafe.Pointer, pixels_size uint) (_r0 unsafe.Pointer, _err error) { + C.meos_errno_reset() + _cret := C.raquet_make(C.uint64_t(quadbin), C.int32(width), C.int32(height), C.MeosPixType(pixtype), C.double(nodata), C.bool(has_nodata), (*C.uint8_t)(unsafe.Pointer(pixels)), C.size_t(pixels_size)) + if _err = meosError(); _err != nil { + return + } + return unsafe.Pointer(_cret), nil +} + + +// RaquetCopy wraps MEOS C function raquet_copy. +func RaquetCopy(rq unsafe.Pointer) (_r0 unsafe.Pointer, _err error) { + C.meos_errno_reset() + _cret := C.raquet_copy((*C.Raquet)(unsafe.Pointer(rq))) + if _err = meosError(); _err != nil { + return + } + return unsafe.Pointer(_cret), nil +} + + +// RaquetRead wraps MEOS C function raquet_read. +func RaquetRead(path string, quadbin uint64) (_r0 unsafe.Pointer, _err error) { + _c_path := C.CString(path) + defer C.free(unsafe.Pointer(_c_path)) + C.meos_errno_reset() + _cret := C.raquet_read(_c_path, C.uint64_t(quadbin)) + if _err = meosError(); _err != nil { + return + } + return unsafe.Pointer(_cret), nil +} + + +// RaquetReadBytes wraps MEOS C function raquet_read_bytes. +func RaquetReadBytes(data unsafe.Pointer, size uint, quadbin uint64) (_r0 unsafe.Pointer, _err error) { + C.meos_errno_reset() + _cret := C.raquet_read_bytes((*C.uint8_t)(unsafe.Pointer(data)), C.size_t(size), C.uint64_t(quadbin)) + if _err = meosError(); _err != nil { + return + } + return unsafe.Pointer(_cret), nil +} + + +// RaquetQuadbin wraps MEOS C function raquet_quadbin. +func RaquetQuadbin(rq unsafe.Pointer) (_r0 uint64, _err error) { + C.meos_errno_reset() + _cret := C.raquet_quadbin((*C.Raquet)(unsafe.Pointer(rq))) + if _err = meosError(); _err != nil { + return + } + return uint64(_cret), nil +} + + +// RaquetWidth wraps MEOS C function raquet_width. +func RaquetWidth(rq unsafe.Pointer) (_r0 int, _err error) { + C.meos_errno_reset() + _cret := C.raquet_width((*C.Raquet)(unsafe.Pointer(rq))) + if _err = meosError(); _err != nil { + return + } + return int(_cret), nil +} + + +// RaquetHeight wraps MEOS C function raquet_height. +func RaquetHeight(rq unsafe.Pointer) (_r0 int, _err error) { + C.meos_errno_reset() + _cret := C.raquet_height((*C.Raquet)(unsafe.Pointer(rq))) + if _err = meosError(); _err != nil { + return + } + return int(_cret), nil +} + + +// RaquetBandPixelType wraps MEOS C function raquet_band_pixel_type. +func RaquetBandPixelType(rq unsafe.Pointer) (_r0 string, _err error) { + C.meos_errno_reset() + _cret := C.raquet_band_pixel_type((*C.Raquet)(unsafe.Pointer(rq))) + if _err = meosError(); _err != nil { + return + } + defer C.free(unsafe.Pointer(_cret)) + return C.GoString(_cret), nil +} + + +// RaquetBandHasNodataValue wraps MEOS C function raquet_band_has_nodata_value. +func RaquetBandHasNodataValue(rq unsafe.Pointer) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.raquet_band_has_nodata_value((*C.Raquet)(unsafe.Pointer(rq))) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// RaquetBandNodataValue wraps MEOS C function raquet_band_nodata_value. +func RaquetBandNodataValue(rq unsafe.Pointer) (_r0 bool, _r1 float64, _err error) { + var _out_result C.double + C.meos_errno_reset() + _cret := C.raquet_band_nodata_value((*C.Raquet)(unsafe.Pointer(rq)), &_out_result) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), float64(_out_result), nil +} + + +// RaquetPixels wraps MEOS C function raquet_pixels. +func RaquetPixels(rq unsafe.Pointer, size_out unsafe.Pointer) (_r0 unsafe.Pointer, _err error) { + C.meos_errno_reset() + _cret := C.raquet_pixels((*C.Raquet)(unsafe.Pointer(rq)), (*C.size_t)(unsafe.Pointer(size_out))) + if _err = meosError(); _err != nil { + return + } + return unsafe.Pointer(_cret), nil +} + + +// RaquetHash wraps MEOS C function raquet_hash. +func RaquetHash(rq unsafe.Pointer) (_r0 uint32, _err error) { + C.meos_errno_reset() + _cret := C.raquet_hash((*C.Raquet)(unsafe.Pointer(rq))) + if _err = meosError(); _err != nil { + return + } + return uint32(_cret), nil +} + + +// RaquetHashExtended wraps MEOS C function raquet_hash_extended. +func RaquetHashExtended(rq unsafe.Pointer, seed uint64) (_r0 uint64, _err error) { + C.meos_errno_reset() + _cret := C.raquet_hash_extended((*C.Raquet)(unsafe.Pointer(rq)), C.uint64_t(seed)) + if _err = meosError(); _err != nil { + return + } + return uint64(_cret), nil +} + + +// RaquetMemSize wraps MEOS C function raquet_mem_size. +func RaquetMemSize(rq unsafe.Pointer) (_r0 int, _err error) { + C.meos_errno_reset() + _cret := C.raquet_mem_size((*C.Raquet)(unsafe.Pointer(rq))) + if _err = meosError(); _err != nil { + return + } + return int(_cret), nil +} + + +// RasterFromWKB wraps MEOS C function raster_from_wkb. +func RasterFromWKB(wkb unsafe.Pointer, size uint) (_r0 unsafe.Pointer, _err error) { + C.meos_errno_reset() + _cret := C.raster_from_wkb((*C.uint8_t)(unsafe.Pointer(wkb)), C.size_t(size)) + if _err = meosError(); _err != nil { + return + } + return unsafe.Pointer(_cret), nil +} + + +// RasterFromHexwkb wraps MEOS C function raster_from_hexwkb. +func RasterFromHexwkb(hexwkb string) (_r0 unsafe.Pointer, _err error) { + _c_hexwkb := C.CString(hexwkb) + defer C.free(unsafe.Pointer(_c_hexwkb)) + C.meos_errno_reset() + _cret := C.raster_from_hexwkb(_c_hexwkb) + if _err = meosError(); _err != nil { + return + } + return unsafe.Pointer(_cret), nil +} + + +// RasterAsWKB wraps MEOS C function raster_as_wkb. +func RasterAsWKB(rast unsafe.Pointer, variant uint8, size_out unsafe.Pointer) (_r0 unsafe.Pointer, _err error) { + C.meos_errno_reset() + _cret := C.raster_as_wkb((*C.Raster)(unsafe.Pointer(rast)), C.uint8_t(variant), (*C.size_t)(unsafe.Pointer(size_out))) + if _err = meosError(); _err != nil { + return + } + return unsafe.Pointer(_cret), nil +} + + +// RasterAsHexwkb wraps MEOS C function raster_as_hexwkb. +func RasterAsHexwkb(rast unsafe.Pointer, variant uint8, size_out unsafe.Pointer) (_r0 string, _err error) { + C.meos_errno_reset() + _cret := C.raster_as_hexwkb((*C.Raster)(unsafe.Pointer(rast)), C.uint8_t(variant), (*C.size_t)(unsafe.Pointer(size_out))) + if _err = meosError(); _err != nil { + return + } + defer C.free(unsafe.Pointer(_cret)) + return C.GoString(_cret), nil +} + + +// RasterCopy wraps MEOS C function raster_copy. +func RasterCopy(rast unsafe.Pointer) (_r0 unsafe.Pointer, _err error) { + C.meos_errno_reset() + _cret := C.raster_copy((*C.Raster)(unsafe.Pointer(rast))) + if _err = meosError(); _err != nil { + return + } + return unsafe.Pointer(_cret), nil +} + + +// RasterMake wraps MEOS C function raster_make. +func RasterMake(width int, height int, upperleftx float64, upperlefty float64, scalex float64, scaley float64, skewx float64, skewy float64, srid int32, pixeltype string, nodataval float64, has_nodata bool, pixels unsafe.Pointer, size uint) (_r0 unsafe.Pointer, _err error) { + _c_pixeltype := C.CString(pixeltype) + defer C.free(unsafe.Pointer(_c_pixeltype)) + C.meos_errno_reset() + _cret := C.raster_make(C.int(width), C.int(height), C.double(upperleftx), C.double(upperlefty), C.double(scalex), C.double(scaley), C.double(skewx), C.double(skewy), C.int32_t(srid), _c_pixeltype, C.double(nodataval), C.bool(has_nodata), (*C.uint8_t)(unsafe.Pointer(pixels)), C.size_t(size)) + if _err = meosError(); _err != nil { + return + } + return unsafe.Pointer(_cret), nil +} + + +// RasterMakeEmpty wraps MEOS C function raster_make_empty. +func RasterMakeEmpty(width int, height int, upperleftx float64, upperlefty float64, scalex float64, scaley float64, skewx float64, skewy float64, srid int32) (_r0 unsafe.Pointer, _err error) { + C.meos_errno_reset() + _cret := C.raster_make_empty(C.int(width), C.int(height), C.double(upperleftx), C.double(upperlefty), C.double(scalex), C.double(scaley), C.double(skewx), C.double(skewy), C.int32_t(srid)) + if _err = meosError(); _err != nil { + return + } + return unsafe.Pointer(_cret), nil +} + + +// RasterAddBand wraps MEOS C function raster_add_band. +func RasterAddBand(rast unsafe.Pointer, index int, pixeltype string, initialvalue float64, nodataval float64, has_nodata bool) (_r0 unsafe.Pointer, _err error) { + _c_pixeltype := C.CString(pixeltype) + defer C.free(unsafe.Pointer(_c_pixeltype)) + C.meos_errno_reset() + _cret := C.raster_add_band((*C.Raster)(unsafe.Pointer(rast)), C.int(index), _c_pixeltype, C.double(initialvalue), C.double(nodataval), C.bool(has_nodata)) + if _err = meosError(); _err != nil { + return + } + return unsafe.Pointer(_cret), nil +} + + +// RasterAddBandRaster wraps MEOS C function raster_add_band_raster. +func RasterAddBandRaster(torast unsafe.Pointer, fromrast unsafe.Pointer, fromband int, toindex int) (_r0 unsafe.Pointer, _err error) { + C.meos_errno_reset() + _cret := C.raster_add_band_raster((*C.Raster)(unsafe.Pointer(torast)), (*C.Raster)(unsafe.Pointer(fromrast)), C.int(fromband), C.int(toindex)) + if _err = meosError(); _err != nil { + return + } + return unsafe.Pointer(_cret), nil +} + + +// RasterMemSize wraps MEOS C function raster_mem_size. +func RasterMemSize(rast unsafe.Pointer) (_r0 int, _err error) { + C.meos_errno_reset() + _cret := C.raster_mem_size((*C.Raster)(unsafe.Pointer(rast))) + if _err = meosError(); _err != nil { + return + } + return int(_cret), nil +} + + +// RasterNumBands wraps MEOS C function raster_num_bands. +func RasterNumBands(rast unsafe.Pointer) (_r0 int, _err error) { + C.meos_errno_reset() + _cret := C.raster_num_bands((*C.Raster)(unsafe.Pointer(rast))) + if _err = meosError(); _err != nil { + return + } + return int(_cret), nil +} + + +// RasterWidth wraps MEOS C function raster_width. +func RasterWidth(rast unsafe.Pointer) (_r0 int, _err error) { + C.meos_errno_reset() + _cret := C.raster_width((*C.Raster)(unsafe.Pointer(rast))) + if _err = meosError(); _err != nil { + return + } + return int(_cret), nil +} + + +// RasterHeight wraps MEOS C function raster_height. +func RasterHeight(rast unsafe.Pointer) (_r0 int, _err error) { + C.meos_errno_reset() + _cret := C.raster_height((*C.Raster)(unsafe.Pointer(rast))) + if _err = meosError(); _err != nil { + return + } + return int(_cret), nil +} + + +// RasterSRID wraps MEOS C function raster_srid. +func RasterSRID(rast unsafe.Pointer) (_r0 int32, _err error) { + C.meos_errno_reset() + _cret := C.raster_srid((*C.Raster)(unsafe.Pointer(rast))) + if _err = meosError(); _err != nil { + return + } + return int32(_cret), nil +} + + +// RasterUpperLeftX wraps MEOS C function raster_upper_left_x. +func RasterUpperLeftX(rast unsafe.Pointer) (_r0 float64, _err error) { + C.meos_errno_reset() + _cret := C.raster_upper_left_x((*C.Raster)(unsafe.Pointer(rast))) + if _err = meosError(); _err != nil { + return + } + return float64(_cret), nil +} + + +// RasterUpperLeftY wraps MEOS C function raster_upper_left_y. +func RasterUpperLeftY(rast unsafe.Pointer) (_r0 float64, _err error) { + C.meos_errno_reset() + _cret := C.raster_upper_left_y((*C.Raster)(unsafe.Pointer(rast))) + if _err = meosError(); _err != nil { + return + } + return float64(_cret), nil +} + + +// RasterScaleX wraps MEOS C function raster_scale_x. +func RasterScaleX(rast unsafe.Pointer) (_r0 float64, _err error) { + C.meos_errno_reset() + _cret := C.raster_scale_x((*C.Raster)(unsafe.Pointer(rast))) + if _err = meosError(); _err != nil { + return + } + return float64(_cret), nil +} + + +// RasterScaleY wraps MEOS C function raster_scale_y. +func RasterScaleY(rast unsafe.Pointer) (_r0 float64, _err error) { + C.meos_errno_reset() + _cret := C.raster_scale_y((*C.Raster)(unsafe.Pointer(rast))) + if _err = meosError(); _err != nil { + return + } + return float64(_cret), nil +} + + +// RasterSkewX wraps MEOS C function raster_skew_x. +func RasterSkewX(rast unsafe.Pointer) (_r0 float64, _err error) { + C.meos_errno_reset() + _cret := C.raster_skew_x((*C.Raster)(unsafe.Pointer(rast))) + if _err = meosError(); _err != nil { + return + } + return float64(_cret), nil +} + + +// RasterSkewY wraps MEOS C function raster_skew_y. +func RasterSkewY(rast unsafe.Pointer) (_r0 float64, _err error) { + C.meos_errno_reset() + _cret := C.raster_skew_y((*C.Raster)(unsafe.Pointer(rast))) + if _err = meosError(); _err != nil { + return + } + return float64(_cret), nil +} + + +// RasterBandPixelType wraps MEOS C function raster_band_pixel_type. +func RasterBandPixelType(rast unsafe.Pointer, band int) (_r0 string, _err error) { + C.meos_errno_reset() + _cret := C.raster_band_pixel_type((*C.Raster)(unsafe.Pointer(rast)), C.int(band)) + if _err = meosError(); _err != nil { + return + } + defer C.free(unsafe.Pointer(_cret)) + return C.GoString(_cret), nil +} + + +// RasterBandHasNodataValue wraps MEOS C function raster_band_has_nodata_value. +func RasterBandHasNodataValue(rast unsafe.Pointer, band int) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.raster_band_has_nodata_value((*C.Raster)(unsafe.Pointer(rast)), C.int(band)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// RasterBandNodataValue wraps MEOS C function raster_band_nodata_value. +func RasterBandNodataValue(rast unsafe.Pointer, band int) (_r0 bool, _r1 float64, _err error) { + var _out_result C.double + C.meos_errno_reset() + _cret := C.raster_band_nodata_value((*C.Raster)(unsafe.Pointer(rast)), C.int(band), &_out_result) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), float64(_out_result), nil +} + + +// RasterBandPixels wraps MEOS C function raster_band_pixels. +func RasterBandPixels(rast unsafe.Pointer, band int, size_out unsafe.Pointer) (_r0 unsafe.Pointer, _err error) { + C.meos_errno_reset() + _cret := C.raster_band_pixels((*C.Raster)(unsafe.Pointer(rast)), C.int(band), (*C.size_t)(unsafe.Pointer(size_out))) + if _err = meosError(); _err != nil { + return + } + return unsafe.Pointer(_cret), nil +} + + +// BandstatsCount wraps MEOS C function bandstats_count. +func BandstatsCount(stats unsafe.Pointer) (_r0 int64, _err error) { + C.meos_errno_reset() + _cret := C.bandstats_count((*C.BandStats)(unsafe.Pointer(stats))) + if _err = meosError(); _err != nil { + return + } + return int64(_cret), nil +} + + +// BandstatsSum wraps MEOS C function bandstats_sum. +func BandstatsSum(stats unsafe.Pointer) (_r0 bool, _r1 float64, _err error) { + var _out_result C.double + C.meos_errno_reset() + _cret := C.bandstats_sum((*C.BandStats)(unsafe.Pointer(stats)), &_out_result) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), float64(_out_result), nil +} + + +// BandstatsMean wraps MEOS C function bandstats_mean. +func BandstatsMean(stats unsafe.Pointer) (_r0 bool, _r1 float64, _err error) { + var _out_result C.double + C.meos_errno_reset() + _cret := C.bandstats_mean((*C.BandStats)(unsafe.Pointer(stats)), &_out_result) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), float64(_out_result), nil +} + + +// BandstatsStddev wraps MEOS C function bandstats_stddev. +func BandstatsStddev(stats unsafe.Pointer) (_r0 bool, _r1 float64, _err error) { + var _out_result C.double + C.meos_errno_reset() + _cret := C.bandstats_stddev((*C.BandStats)(unsafe.Pointer(stats)), &_out_result) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), float64(_out_result), nil +} + + +// BandstatsMin wraps MEOS C function bandstats_min. +func BandstatsMin(stats unsafe.Pointer) (_r0 bool, _r1 float64, _err error) { + var _out_result C.double + C.meos_errno_reset() + _cret := C.bandstats_min((*C.BandStats)(unsafe.Pointer(stats)), &_out_result) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), float64(_out_result), nil +} + + +// BandstatsMax wraps MEOS C function bandstats_max. +func BandstatsMax(stats unsafe.Pointer) (_r0 bool, _r1 float64, _err error) { + var _out_result C.double + C.meos_errno_reset() + _cret := C.bandstats_max((*C.BandStats)(unsafe.Pointer(stats)), &_out_result) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), float64(_out_result), nil +} + + +// RasterClip wraps MEOS C function raster_clip. +func RasterClip(rast unsafe.Pointer, bands unsafe.Pointer, nbands int, gs *Geom, nodata unsafe.Pointer, nnodata int, crop bool, touched bool) (_r0 unsafe.Pointer, _err error) { + C.meos_errno_reset() + _cret := C.raster_clip((*C.Raster)(unsafe.Pointer(rast)), (*C.int)(unsafe.Pointer(bands)), C.int(nbands), gs._inner, (*C.double)(unsafe.Pointer(nodata)), C.int(nnodata), C.bool(crop), C.bool(touched)) + if _err = meosError(); _err != nil { + return + } + return unsafe.Pointer(_cret), nil +} + + +// RasterTransform wraps MEOS C function raster_transform. +func RasterTransform(rast unsafe.Pointer, srid int32, algorithm *string, max_err float64, scale_x float64, scale_y float64) (_r0 unsafe.Pointer, _err error) { + var _c_algorithm *C.char + if algorithm != nil { + _c_algorithm = C.CString(*algorithm) + defer C.free(unsafe.Pointer(_c_algorithm)) + } + C.meos_errno_reset() + _cret := C.raster_transform((*C.Raster)(unsafe.Pointer(rast)), C.int32_t(srid), _c_algorithm, C.double(max_err), C.double(scale_x), C.double(scale_y)) + if _err = meosError(); _err != nil { + return + } + return unsafe.Pointer(_cret), nil +} + + +// RasterTransformPipeline wraps MEOS C function raster_transform_pipeline. +func RasterTransformPipeline(rast unsafe.Pointer, pipelinestr string, srid int32, is_forward bool, algorithm *string, max_err float64, scale_x float64, scale_y float64) (_r0 unsafe.Pointer, _err error) { + _c_pipelinestr := C.CString(pipelinestr) + defer C.free(unsafe.Pointer(_c_pipelinestr)) + var _c_algorithm *C.char + if algorithm != nil { + _c_algorithm = C.CString(*algorithm) + defer C.free(unsafe.Pointer(_c_algorithm)) + } + C.meos_errno_reset() + _cret := C.raster_transform_pipeline((*C.Raster)(unsafe.Pointer(rast)), _c_pipelinestr, C.int32_t(srid), C.bool(is_forward), _c_algorithm, C.double(max_err), C.double(scale_x), C.double(scale_y)) + if _err = meosError(); _err != nil { + return + } + return unsafe.Pointer(_cret), nil +} + + +// RasterTransformRaster wraps MEOS C function raster_transform_raster. +func RasterTransformRaster(rast unsafe.Pointer, alignto unsafe.Pointer, algorithm *string, max_err float64) (_r0 unsafe.Pointer, _err error) { + var _c_algorithm *C.char + if algorithm != nil { + _c_algorithm = C.CString(*algorithm) + defer C.free(unsafe.Pointer(_c_algorithm)) + } + C.meos_errno_reset() + _cret := C.raster_transform_raster((*C.Raster)(unsafe.Pointer(rast)), (*C.Raster)(unsafe.Pointer(alignto)), _c_algorithm, C.double(max_err)) + if _err = meosError(); _err != nil { + return + } + return unsafe.Pointer(_cret), nil +} + + +// RasterRescale wraps MEOS C function raster_rescale. +func RasterRescale(rast unsafe.Pointer, scale_x float64, scale_y float64, algorithm *string, max_err float64) (_r0 unsafe.Pointer, _err error) { + var _c_algorithm *C.char + if algorithm != nil { + _c_algorithm = C.CString(*algorithm) + defer C.free(unsafe.Pointer(_c_algorithm)) + } + C.meos_errno_reset() + _cret := C.raster_rescale((*C.Raster)(unsafe.Pointer(rast)), C.double(scale_x), C.double(scale_y), _c_algorithm, C.double(max_err)) + if _err = meosError(); _err != nil { + return + } + return unsafe.Pointer(_cret), nil +} + + +// RasterDumpAsPolygons wraps MEOS C function raster_dump_as_polygons. +func RasterDumpAsPolygons(rast unsafe.Pointer, band int, exclude_nodata bool, count unsafe.Pointer) (_r0 unsafe.Pointer, _err error) { + C.meos_errno_reset() + _cret := C.raster_dump_as_polygons((*C.Raster)(unsafe.Pointer(rast)), C.int(band), C.bool(exclude_nodata), (*C.int)(unsafe.Pointer(count))) + if _err = meosError(); _err != nil { + return + } + return unsafe.Pointer(_cret), nil +} + + +// RasterDumpValues wraps MEOS C function raster_dump_values. +func RasterDumpValues(rast unsafe.Pointer, band int, exclude_nodata bool, nodata unsafe.Pointer, count unsafe.Pointer) (_r0 unsafe.Pointer, _err error) { + C.meos_errno_reset() + _cret := C.raster_dump_values((*C.Raster)(unsafe.Pointer(rast)), C.int(band), C.bool(exclude_nodata), (**C.bool)(unsafe.Pointer(nodata)), (*C.int)(unsafe.Pointer(count))) + if _err = meosError(); _err != nil { + return + } + return unsafe.Pointer(_cret), nil +} + + +// RasterPixelAsPoints wraps MEOS C function raster_pixel_as_points. +func RasterPixelAsPoints(rast unsafe.Pointer, band int, exclude_nodata bool, count unsafe.Pointer) (_r0 unsafe.Pointer, _err error) { + C.meos_errno_reset() + _cret := C.raster_pixel_as_points((*C.Raster)(unsafe.Pointer(rast)), C.int(band), C.bool(exclude_nodata), (*C.int)(unsafe.Pointer(count))) + if _err = meosError(); _err != nil { + return + } + return unsafe.Pointer(_cret), nil +} + + +// RasterSummaryStats wraps MEOS C function raster_summary_stats. +func RasterSummaryStats(rast unsafe.Pointer, band int, exclude_nodata bool) (_r0 unsafe.Pointer, _err error) { + C.meos_errno_reset() + _cret := C.raster_summary_stats((*C.Raster)(unsafe.Pointer(rast)), C.int(band), C.bool(exclude_nodata)) + if _err = meosError(); _err != nil { + return + } + return unsafe.Pointer(_cret), nil +} + + +// RasterValueCount wraps MEOS C function raster_value_count. +func RasterValueCount(rast unsafe.Pointer, band int, exclude_nodata bool, searchvalues unsafe.Pointer, nsearch int, roundto float64, count unsafe.Pointer) (_r0 unsafe.Pointer, _err error) { + C.meos_errno_reset() + _cret := C.raster_value_count((*C.Raster)(unsafe.Pointer(rast)), C.int(band), C.bool(exclude_nodata), (*C.double)(unsafe.Pointer(searchvalues)), C.int(nsearch), C.double(roundto), (*C.int)(unsafe.Pointer(count))) + if _err = meosError(); _err != nil { + return + } + return unsafe.Pointer(_cret), nil +} + + +// RasterSetValues wraps MEOS C function raster_set_values. +func RasterSetValues(rast unsafe.Pointer, band int, x int, y int, width int, height int, values unsafe.Pointer, nodata unsafe.Pointer, noset unsafe.Pointer, count int, keepnodata bool) (_r0 unsafe.Pointer, _err error) { + C.meos_errno_reset() + _cret := C.raster_set_values((*C.Raster)(unsafe.Pointer(rast)), C.int(band), C.int(x), C.int(y), C.int(width), C.int(height), (*C.double)(unsafe.Pointer(values)), (*C.bool)(unsafe.Pointer(nodata)), (*C.bool)(unsafe.Pointer(noset)), C.int(count), C.bool(keepnodata)) + if _err = meosError(); _err != nil { + return + } + return unsafe.Pointer(_cret), nil +} + + +// RasterReclass wraps MEOS C function raster_reclass. +func RasterReclass(rast unsafe.Pointer, band int, expr string, pixeltype string, has_nodata bool, nodataval float64) (_r0 unsafe.Pointer, _err error) { + _c_expr := C.CString(expr) + defer C.free(unsafe.Pointer(_c_expr)) + _c_pixeltype := C.CString(pixeltype) + defer C.free(unsafe.Pointer(_c_pixeltype)) + C.meos_errno_reset() + _cret := C.raster_reclass((*C.Raster)(unsafe.Pointer(rast)), C.int(band), _c_expr, _c_pixeltype, C.bool(has_nodata), C.double(nodataval)) + if _err = meosError(); _err != nil { + return + } + return unsafe.Pointer(_cret), nil +} + + +// RasterSlope wraps MEOS C function raster_slope. +func RasterSlope(rast unsafe.Pointer, band int, customextent unsafe.Pointer, pixeltype string, units string, scale float64, interpolate_nodata bool) (_r0 unsafe.Pointer, _err error) { + _c_pixeltype := C.CString(pixeltype) + defer C.free(unsafe.Pointer(_c_pixeltype)) + _c_units := C.CString(units) + defer C.free(unsafe.Pointer(_c_units)) + C.meos_errno_reset() + _cret := C.raster_slope((*C.Raster)(unsafe.Pointer(rast)), C.int(band), (*C.Raster)(unsafe.Pointer(customextent)), _c_pixeltype, _c_units, C.double(scale), C.bool(interpolate_nodata)) + if _err = meosError(); _err != nil { + return + } + return unsafe.Pointer(_cret), nil +} + + +// RasterTpi wraps MEOS C function raster_tpi. +func RasterTpi(rast unsafe.Pointer, band int, customextent unsafe.Pointer, pixeltype string, interpolate_nodata bool) (_r0 unsafe.Pointer, _err error) { + _c_pixeltype := C.CString(pixeltype) + defer C.free(unsafe.Pointer(_c_pixeltype)) + C.meos_errno_reset() + _cret := C.raster_tpi((*C.Raster)(unsafe.Pointer(rast)), C.int(band), (*C.Raster)(unsafe.Pointer(customextent)), _c_pixeltype, C.bool(interpolate_nodata)) + if _err = meosError(); _err != nil { + return + } + return unsafe.Pointer(_cret), nil +} + + +// RasterTri wraps MEOS C function raster_tri. +func RasterTri(rast unsafe.Pointer, band int, customextent unsafe.Pointer, pixeltype string, interpolate_nodata bool) (_r0 unsafe.Pointer, _err error) { + _c_pixeltype := C.CString(pixeltype) + defer C.free(unsafe.Pointer(_c_pixeltype)) + C.meos_errno_reset() + _cret := C.raster_tri((*C.Raster)(unsafe.Pointer(rast)), C.int(band), (*C.Raster)(unsafe.Pointer(customextent)), _c_pixeltype, C.bool(interpolate_nodata)) + if _err = meosError(); _err != nil { + return + } + return unsafe.Pointer(_cret), nil +} + + +// RasterMapAlgebra wraps MEOS C function raster_map_algebra. +func RasterMapAlgebra(rast unsafe.Pointer, band int, stat string, pixeltype *string, extenttype *string, customextent unsafe.Pointer, distancex int32, distancey int32) (_r0 unsafe.Pointer, _err error) { + _c_stat := C.CString(stat) + defer C.free(unsafe.Pointer(_c_stat)) + var _c_pixeltype *C.char + if pixeltype != nil { + _c_pixeltype = C.CString(*pixeltype) + defer C.free(unsafe.Pointer(_c_pixeltype)) + } + var _c_extenttype *C.char + if extenttype != nil { + _c_extenttype = C.CString(*extenttype) + defer C.free(unsafe.Pointer(_c_extenttype)) + } + C.meos_errno_reset() + _cret := C.raster_map_algebra((*C.Raster)(unsafe.Pointer(rast)), C.int(band), _c_stat, _c_pixeltype, _c_extenttype, (*C.Raster)(unsafe.Pointer(customextent)), C.int32(distancex), C.int32(distancey)) + if _err = meosError(); _err != nil { + return + } + return unsafe.Pointer(_cret), nil +} + + +// GeomvalArrFree wraps MEOS C function geomval_arr_free. +func GeomvalArrFree(gvarr unsafe.Pointer, count int) (_err error) { + C.meos_errno_reset() + C.geomval_arr_free((*C.GeomVal)(unsafe.Pointer(gvarr)), C.int(count)) + if _err = meosError(); _err != nil { + return + } + return nil +} + + +// PixelArrFree wraps MEOS C function pixel_arr_free. +func PixelArrFree(pixarr unsafe.Pointer, count int) (_err error) { + C.meos_errno_reset() + C.pixel_arr_free((*C.Pixel)(unsafe.Pointer(pixarr)), C.int(count)) + if _err = meosError(); _err != nil { + return + } + return nil +} + + +// AddFloatRaster wraps MEOS C function add_float_raster. +func AddFloatRaster(d float64, rast unsafe.Pointer) (_r0 unsafe.Pointer, _err error) { + C.meos_errno_reset() + _cret := C.add_float_raster(C.double(d), (*C.Raster)(unsafe.Pointer(rast))) + if _err = meosError(); _err != nil { + return + } + return unsafe.Pointer(_cret), nil +} + + +// AddRasterFloat wraps MEOS C function add_raster_float. +func AddRasterFloat(rast unsafe.Pointer, d float64) (_r0 unsafe.Pointer, _err error) { + C.meos_errno_reset() + _cret := C.add_raster_float((*C.Raster)(unsafe.Pointer(rast)), C.double(d)) + if _err = meosError(); _err != nil { + return + } + return unsafe.Pointer(_cret), nil +} + + +// AddRasterRaster wraps MEOS C function add_raster_raster. +func AddRasterRaster(rast1 unsafe.Pointer, rast2 unsafe.Pointer) (_r0 unsafe.Pointer, _err error) { + C.meos_errno_reset() + _cret := C.add_raster_raster((*C.Raster)(unsafe.Pointer(rast1)), (*C.Raster)(unsafe.Pointer(rast2))) + if _err = meosError(); _err != nil { + return + } + return unsafe.Pointer(_cret), nil +} + + +// DivFloatRaster wraps MEOS C function div_float_raster. +func DivFloatRaster(d float64, rast unsafe.Pointer) (_r0 unsafe.Pointer, _err error) { + C.meos_errno_reset() + _cret := C.div_float_raster(C.double(d), (*C.Raster)(unsafe.Pointer(rast))) + if _err = meosError(); _err != nil { + return + } + return unsafe.Pointer(_cret), nil +} + + +// DivRasterFloat wraps MEOS C function div_raster_float. +func DivRasterFloat(rast unsafe.Pointer, d float64) (_r0 unsafe.Pointer, _err error) { + C.meos_errno_reset() + _cret := C.div_raster_float((*C.Raster)(unsafe.Pointer(rast)), C.double(d)) + if _err = meosError(); _err != nil { + return + } + return unsafe.Pointer(_cret), nil +} + + +// DivRasterRaster wraps MEOS C function div_raster_raster. +func DivRasterRaster(rast1 unsafe.Pointer, rast2 unsafe.Pointer) (_r0 unsafe.Pointer, _err error) { + C.meos_errno_reset() + _cret := C.div_raster_raster((*C.Raster)(unsafe.Pointer(rast1)), (*C.Raster)(unsafe.Pointer(rast2))) + if _err = meosError(); _err != nil { + return + } + return unsafe.Pointer(_cret), nil +} + + +// MulFloatRaster wraps MEOS C function mul_float_raster. +func MulFloatRaster(d float64, rast unsafe.Pointer) (_r0 unsafe.Pointer, _err error) { + C.meos_errno_reset() + _cret := C.mul_float_raster(C.double(d), (*C.Raster)(unsafe.Pointer(rast))) + if _err = meosError(); _err != nil { + return + } + return unsafe.Pointer(_cret), nil +} + + +// MulRasterFloat wraps MEOS C function mul_raster_float. +func MulRasterFloat(rast unsafe.Pointer, d float64) (_r0 unsafe.Pointer, _err error) { + C.meos_errno_reset() + _cret := C.mul_raster_float((*C.Raster)(unsafe.Pointer(rast)), C.double(d)) + if _err = meosError(); _err != nil { + return + } + return unsafe.Pointer(_cret), nil +} + + +// MulRasterRaster wraps MEOS C function mul_raster_raster. +func MulRasterRaster(rast1 unsafe.Pointer, rast2 unsafe.Pointer) (_r0 unsafe.Pointer, _err error) { + C.meos_errno_reset() + _cret := C.mul_raster_raster((*C.Raster)(unsafe.Pointer(rast1)), (*C.Raster)(unsafe.Pointer(rast2))) + if _err = meosError(); _err != nil { + return + } + return unsafe.Pointer(_cret), nil +} + + +// SubFloatRaster wraps MEOS C function sub_float_raster. +func SubFloatRaster(d float64, rast unsafe.Pointer) (_r0 unsafe.Pointer, _err error) { + C.meos_errno_reset() + _cret := C.sub_float_raster(C.double(d), (*C.Raster)(unsafe.Pointer(rast))) + if _err = meosError(); _err != nil { + return + } + return unsafe.Pointer(_cret), nil +} + + +// SubRasterFloat wraps MEOS C function sub_raster_float. +func SubRasterFloat(rast unsafe.Pointer, d float64) (_r0 unsafe.Pointer, _err error) { + C.meos_errno_reset() + _cret := C.sub_raster_float((*C.Raster)(unsafe.Pointer(rast)), C.double(d)) + if _err = meosError(); _err != nil { + return + } + return unsafe.Pointer(_cret), nil +} + + +// SubRasterRaster wraps MEOS C function sub_raster_raster. +func SubRasterRaster(rast1 unsafe.Pointer, rast2 unsafe.Pointer) (_r0 unsafe.Pointer, _err error) { + C.meos_errno_reset() + _cret := C.sub_raster_raster((*C.Raster)(unsafe.Pointer(rast1)), (*C.Raster)(unsafe.Pointer(rast2))) + if _err = meosError(); _err != nil { + return + } + return unsafe.Pointer(_cret), nil +} + + +// RasterSameAlignment wraps MEOS C function raster_same_alignment. +func RasterSameAlignment(rast1 unsafe.Pointer, rast2 unsafe.Pointer) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.raster_same_alignment((*C.Raster)(unsafe.Pointer(rast1)), (*C.Raster)(unsafe.Pointer(rast2))) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// RasterNotSameAlignmentReason wraps MEOS C function raster_not_same_alignment_reason. +func RasterNotSameAlignmentReason(rast1 unsafe.Pointer, rast2 unsafe.Pointer) (_r0 string, _err error) { + C.meos_errno_reset() + _cret := C.raster_not_same_alignment_reason((*C.Raster)(unsafe.Pointer(rast1)), (*C.Raster)(unsafe.Pointer(rast2))) + if _err = meosError(); _err != nil { + return + } + defer C.free(unsafe.Pointer(_cret)) + return C.GoString(_cret), nil +} + + +// RasterSameAlignmentCombinefn wraps MEOS C function raster_same_alignment_combinefn. +func RasterSameAlignmentCombinefn(state1 unsafe.Pointer, state2 unsafe.Pointer) (_r0 unsafe.Pointer, _err error) { + C.meos_errno_reset() + _cret := C.raster_same_alignment_combinefn((*C.RasterAlignState)(unsafe.Pointer(state1)), (*C.RasterAlignState)(unsafe.Pointer(state2))) + if _err = meosError(); _err != nil { + return + } + return unsafe.Pointer(_cret), nil +} + + +// RasterSameAlignmentFinalfn wraps MEOS C function raster_same_alignment_finalfn. +func RasterSameAlignmentFinalfn(state unsafe.Pointer) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.raster_same_alignment_finalfn((*C.RasterAlignState)(unsafe.Pointer(state))) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// RasterSameAlignmentTransfn wraps MEOS C function raster_same_alignment_transfn. +func RasterSameAlignmentTransfn(state unsafe.Pointer, rast unsafe.Pointer) (_r0 unsafe.Pointer, _err error) { + C.meos_errno_reset() + _cret := C.raster_same_alignment_transfn((*C.RasterAlignState)(unsafe.Pointer(state)), (*C.Raster)(unsafe.Pointer(rast))) + if _err = meosError(); _err != nil { + return + } + return unsafe.Pointer(_cret), nil +} + + +// RasterSummaryStatsCombinefn wraps MEOS C function raster_summary_stats_combinefn. +func RasterSummaryStatsCombinefn(state1 unsafe.Pointer, state2 unsafe.Pointer) (_r0 unsafe.Pointer, _err error) { + C.meos_errno_reset() + _cret := C.raster_summary_stats_combinefn((*C.RasterStatsState)(unsafe.Pointer(state1)), (*C.RasterStatsState)(unsafe.Pointer(state2))) + if _err = meosError(); _err != nil { + return + } + return unsafe.Pointer(_cret), nil +} + + +// RasterSummaryStatsFinalfn wraps MEOS C function raster_summary_stats_finalfn. +func RasterSummaryStatsFinalfn(state unsafe.Pointer) (_r0 unsafe.Pointer, _err error) { + C.meos_errno_reset() + _cret := C.raster_summary_stats_finalfn((*C.RasterStatsState)(unsafe.Pointer(state))) + if _err = meosError(); _err != nil { + return + } + return unsafe.Pointer(_cret), nil +} + + +// RasterSummaryStatsTransfn wraps MEOS C function raster_summary_stats_transfn. +func RasterSummaryStatsTransfn(state unsafe.Pointer, rast unsafe.Pointer, band int, exclude_nodata bool) (_r0 unsafe.Pointer, _err error) { + C.meos_errno_reset() + _cret := C.raster_summary_stats_transfn((*C.RasterStatsState)(unsafe.Pointer(state)), (*C.Raster)(unsafe.Pointer(rast)), C.int(band), C.bool(exclude_nodata)) + if _err = meosError(); _err != nil { + return + } + return unsafe.Pointer(_cret), nil +} + + +// RasterUnionCombinefn wraps MEOS C function raster_union_combinefn. +func RasterUnionCombinefn(state1 unsafe.Pointer, state2 unsafe.Pointer) (_r0 unsafe.Pointer, _err error) { + C.meos_errno_reset() + _cret := C.raster_union_combinefn((*C.RasterUnionState)(unsafe.Pointer(state1)), (*C.RasterUnionState)(unsafe.Pointer(state2))) + if _err = meosError(); _err != nil { + return + } + return unsafe.Pointer(_cret), nil +} + + +// RasterUnionFinalfn wraps MEOS C function raster_union_finalfn. +func RasterUnionFinalfn(state unsafe.Pointer) (_r0 unsafe.Pointer, _err error) { + C.meos_errno_reset() + _cret := C.raster_union_finalfn((*C.RasterUnionState)(unsafe.Pointer(state))) + if _err = meosError(); _err != nil { + return + } + return unsafe.Pointer(_cret), nil +} + + +// RasterUnionTransfn wraps MEOS C function raster_union_transfn. +func RasterUnionTransfn(state unsafe.Pointer, rast unsafe.Pointer, band int, uniontype *string) (_r0 unsafe.Pointer, _err error) { + var _c_uniontype *C.char + if uniontype != nil { + _c_uniontype = C.CString(*uniontype) + defer C.free(unsafe.Pointer(_c_uniontype)) + } + C.meos_errno_reset() + _cret := C.raster_union_transfn((*C.RasterUnionState)(unsafe.Pointer(state)), (*C.Raster)(unsafe.Pointer(rast)), C.int(band), _c_uniontype) + if _err = meosError(); _err != nil { + return + } + return unsafe.Pointer(_cret), nil +} + + +// RasteralignstateDeserialize wraps MEOS C function rasteralignstate_deserialize. +func RasteralignstateDeserialize(bytes unsafe.Pointer, size uint) (_r0 unsafe.Pointer, _err error) { + C.meos_errno_reset() + _cret := C.rasteralignstate_deserialize((*C.uint8_t)(unsafe.Pointer(bytes)), C.size_t(size)) + if _err = meosError(); _err != nil { + return + } + return unsafe.Pointer(_cret), nil +} + + +// RasteralignstateSerialize wraps MEOS C function rasteralignstate_serialize. +func RasteralignstateSerialize(state unsafe.Pointer, size_out unsafe.Pointer) (_r0 unsafe.Pointer, _err error) { + C.meos_errno_reset() + _cret := C.rasteralignstate_serialize((*C.RasterAlignState)(unsafe.Pointer(state)), (*C.size_t)(unsafe.Pointer(size_out))) + if _err = meosError(); _err != nil { + return + } + return unsafe.Pointer(_cret), nil +} + + +// RasterstatsstateDeserialize wraps MEOS C function rasterstatsstate_deserialize. +func RasterstatsstateDeserialize(bytes unsafe.Pointer, size uint) (_r0 unsafe.Pointer, _err error) { + C.meos_errno_reset() + _cret := C.rasterstatsstate_deserialize((*C.uint8_t)(unsafe.Pointer(bytes)), C.size_t(size)) + if _err = meosError(); _err != nil { + return + } + return unsafe.Pointer(_cret), nil +} + + +// RasterstatsstateSerialize wraps MEOS C function rasterstatsstate_serialize. +func RasterstatsstateSerialize(state unsafe.Pointer, size_out unsafe.Pointer) (_r0 unsafe.Pointer, _err error) { + C.meos_errno_reset() + _cret := C.rasterstatsstate_serialize((*C.RasterStatsState)(unsafe.Pointer(state)), (*C.size_t)(unsafe.Pointer(size_out))) + if _err = meosError(); _err != nil { + return + } + return unsafe.Pointer(_cret), nil +} + + +// RasterunionstateDeserialize wraps MEOS C function rasterunionstate_deserialize. +func RasterunionstateDeserialize(bytes unsafe.Pointer, size uint) (_r0 unsafe.Pointer, _err error) { + C.meos_errno_reset() + _cret := C.rasterunionstate_deserialize((*C.uint8_t)(unsafe.Pointer(bytes)), C.size_t(size)) + if _err = meosError(); _err != nil { + return + } + return unsafe.Pointer(_cret), nil +} + + +// RasterunionstateSerialize wraps MEOS C function rasterunionstate_serialize. +func RasterunionstateSerialize(state unsafe.Pointer, size_out unsafe.Pointer) (_r0 unsafe.Pointer, _err error) { + C.meos_errno_reset() + _cret := C.rasterunionstate_serialize((*C.RasterUnionState)(unsafe.Pointer(state)), (*C.size_t)(unsafe.Pointer(size_out))) + if _err = meosError(); _err != nil { + return + } + return unsafe.Pointer(_cret), nil +} + + +// RaquetToSTBOX wraps MEOS C function raquet_to_stbox. +func RaquetToSTBOX(rq unsafe.Pointer) (_r0 *STBox, _err error) { + C.meos_errno_reset() + _cret := C.raquet_to_stbox((*C.Raquet)(unsafe.Pointer(rq))) + if _err = meosError(); _err != nil { + return + } + return &STBox{_inner: _cret}, nil +} + + +// RasterToSTBOX wraps MEOS C function raster_to_stbox. +func RasterToSTBOX(rast unsafe.Pointer) (_r0 *STBox, _err error) { + C.meos_errno_reset() + _cret := C.raster_to_stbox((*C.Raster)(unsafe.Pointer(rast))) + if _err = meosError(); _err != nil { + return + } + return &STBox{_inner: _cret}, nil +} + + +// RaquetCmp wraps MEOS C function raquet_cmp. +func RaquetCmp(rq1 unsafe.Pointer, rq2 unsafe.Pointer) (_r0 int, _err error) { + C.meos_errno_reset() + _cret := C.raquet_cmp((*C.Raquet)(unsafe.Pointer(rq1)), (*C.Raquet)(unsafe.Pointer(rq2))) + if _err = meosError(); _err != nil { + return + } + return int(_cret), nil +} + + +// RaquetEq wraps MEOS C function raquet_eq. +func RaquetEq(rq1 unsafe.Pointer, rq2 unsafe.Pointer) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.raquet_eq((*C.Raquet)(unsafe.Pointer(rq1)), (*C.Raquet)(unsafe.Pointer(rq2))) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// RaquetNe wraps MEOS C function raquet_ne. +func RaquetNe(rq1 unsafe.Pointer, rq2 unsafe.Pointer) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.raquet_ne((*C.Raquet)(unsafe.Pointer(rq1)), (*C.Raquet)(unsafe.Pointer(rq2))) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// RaquetLt wraps MEOS C function raquet_lt. +func RaquetLt(rq1 unsafe.Pointer, rq2 unsafe.Pointer) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.raquet_lt((*C.Raquet)(unsafe.Pointer(rq1)), (*C.Raquet)(unsafe.Pointer(rq2))) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// RaquetLe wraps MEOS C function raquet_le. +func RaquetLe(rq1 unsafe.Pointer, rq2 unsafe.Pointer) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.raquet_le((*C.Raquet)(unsafe.Pointer(rq1)), (*C.Raquet)(unsafe.Pointer(rq2))) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// RaquetGe wraps MEOS C function raquet_ge. +func RaquetGe(rq1 unsafe.Pointer, rq2 unsafe.Pointer) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.raquet_ge((*C.Raquet)(unsafe.Pointer(rq1)), (*C.Raquet)(unsafe.Pointer(rq2))) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// RaquetGt wraps MEOS C function raquet_gt. +func RaquetGt(rq1 unsafe.Pointer, rq2 unsafe.Pointer) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.raquet_gt((*C.Raquet)(unsafe.Pointer(rq1)), (*C.Raquet)(unsafe.Pointer(rq2))) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// RasterValue wraps MEOS C function raster_value. +func RasterValue(traj *Temporal, rast unsafe.Pointer, band int, exclude_nodata bool, resample *string) (_r0 *Temporal, _err error) { + var _c_resample *C.char + if resample != nil { + _c_resample = C.CString(*resample) + defer C.free(unsafe.Pointer(_c_resample)) + } + C.meos_errno_reset() + _cret := C.raster_value(traj._inner, (*C.Raster)(unsafe.Pointer(rast)), C.int(band), C.bool(exclude_nodata), _c_resample) + if _err = meosError(); _err != nil { + return + } + return &Temporal{_inner: _cret}, nil +} + + +// RasterAtValue wraps MEOS C function raster_at_value. +func RasterAtValue(traj *Temporal, rast unsafe.Pointer, band int, vspan *Span) (_r0 *Temporal, _err error) { + C.meos_errno_reset() + _cret := C.raster_at_value(traj._inner, (*C.Raster)(unsafe.Pointer(rast)), C.int(band), vspan._inner) + if _err = meosError(); _err != nil { + return + } + return &Temporal{_inner: _cret}, nil +} + + +// RasterMinusValue wraps MEOS C function raster_minus_value. +func RasterMinusValue(traj *Temporal, rast unsafe.Pointer, band int, vspan *Span) (_r0 *Temporal, _err error) { + C.meos_errno_reset() + _cret := C.raster_minus_value(traj._inner, (*C.Raster)(unsafe.Pointer(rast)), C.int(band), vspan._inner) + if _err = meosError(); _err != nil { + return + } + return &Temporal{_inner: _cret}, nil +} + + +// ErasterValue wraps MEOS C function eraster_value. +func ErasterValue(traj *Temporal, rast unsafe.Pointer, band int, vspan *Span) (_r0 int, _err error) { + C.meos_errno_reset() + _cret := C.eraster_value(traj._inner, (*C.Raster)(unsafe.Pointer(rast)), C.int(band), vspan._inner) + if _err = meosError(); _err != nil { + return + } + return int(_cret), nil +} + + +// ArasterValue wraps MEOS C function araster_value. +func ArasterValue(traj *Temporal, rast unsafe.Pointer, band int, vspan *Span) (_r0 int, _err error) { + C.meos_errno_reset() + _cret := C.araster_value(traj._inner, (*C.Raster)(unsafe.Pointer(rast)), C.int(band), vspan._inner) + if _err = meosError(); _err != nil { + return + } + return int(_cret), nil +} + + +// RasterValueGdal wraps MEOS C function raster_value_gdal. +func RasterValueGdal(traj *Temporal, path string, band int) (_r0 *Temporal, _err error) { + _c_path := C.CString(path) + defer C.free(unsafe.Pointer(_c_path)) + C.meos_errno_reset() + _cret := C.raster_value_gdal(traj._inner, _c_path, C.int(band)) + if _err = meosError(); _err != nil { + return + } + return &Temporal{_inner: _cret}, nil +} + + +// RasterAtValueGdal wraps MEOS C function raster_at_value_gdal. +func RasterAtValueGdal(traj *Temporal, path string, band int, vspan *Span) (_r0 *Temporal, _err error) { + _c_path := C.CString(path) + defer C.free(unsafe.Pointer(_c_path)) + C.meos_errno_reset() + _cret := C.raster_at_value_gdal(traj._inner, _c_path, C.int(band), vspan._inner) + if _err = meosError(); _err != nil { + return + } + return &Temporal{_inner: _cret}, nil +} + + +// RasterMinusValueGdal wraps MEOS C function raster_minus_value_gdal. +func RasterMinusValueGdal(traj *Temporal, path string, band int, vspan *Span) (_r0 *Temporal, _err error) { + _c_path := C.CString(path) + defer C.free(unsafe.Pointer(_c_path)) + C.meos_errno_reset() + _cret := C.raster_minus_value_gdal(traj._inner, _c_path, C.int(band), vspan._inner) + if _err = meosError(); _err != nil { + return + } + return &Temporal{_inner: _cret}, nil +} + + +// ErasterValueGdal wraps MEOS C function eraster_value_gdal. +func ErasterValueGdal(traj *Temporal, path string, band int, vspan *Span) (_r0 int, _err error) { + _c_path := C.CString(path) + defer C.free(unsafe.Pointer(_c_path)) + C.meos_errno_reset() + _cret := C.eraster_value_gdal(traj._inner, _c_path, C.int(band), vspan._inner) + if _err = meosError(); _err != nil { + return + } + return int(_cret), nil +} + + +// ArasterValueGdal wraps MEOS C function araster_value_gdal. +func ArasterValueGdal(traj *Temporal, path string, band int, vspan *Span) (_r0 int, _err error) { + _c_path := C.CString(path) + defer C.free(unsafe.Pointer(_c_path)) + C.meos_errno_reset() + _cret := C.araster_value_gdal(traj._inner, _c_path, C.int(band), vspan._inner) + if _err = meosError(); _err != nil { + return + } + return int(_cret), nil +} + + +// RasterTileValueQuadbin wraps MEOS C function raster_tile_value_quadbin. +func RasterTileValueQuadbin(traj *Temporal, pixels unsafe.Pointer, pixels_size uint, width int32, height int32, quadbin uint64, pixtype MeosPixType, nodata float64, has_nodata bool) (_r0 *Temporal, _err error) { + C.meos_errno_reset() + _cret := C.raster_tile_value_quadbin(traj._inner, (*C.uint8_t)(unsafe.Pointer(pixels)), C.size_t(pixels_size), C.int32(width), C.int32(height), C.uint64_t(quadbin), C.MeosPixType(pixtype), C.double(nodata), C.bool(has_nodata)) + if _err = meosError(); _err != nil { + return + } + return &Temporal{_inner: _cret}, nil +} + + +// RasterTileValue wraps MEOS C function raster_tile_value. +func RasterTileValue(traj *Temporal, rq unsafe.Pointer) (_r0 *Temporal, _err error) { + C.meos_errno_reset() + _cret := C.raster_tile_value(traj._inner, (*C.Raquet)(unsafe.Pointer(rq))) + if _err = meosError(); _err != nil { + return + } + return &Temporal{_inner: _cret}, nil +} + + +// RasterTileValueArray wraps MEOS C function raster_tile_value_array. +func RasterTileValueArray(traj *Temporal, rqarr unsafe.Pointer, count int) (_r0 *Temporal, _err error) { + C.meos_errno_reset() + _cret := C.raster_tile_value_array(traj._inner, (**C.Raquet)(unsafe.Pointer(rqarr)), C.int(count)) + if _err = meosError(); _err != nil { + return + } + return &Temporal{_inner: _cret}, nil +} + diff --git a/functions/meos_meos_rgeo.go b/functions/meos_meos_rgeo.go index 84db804..a84655c 100644 --- a/functions/meos_meos_rgeo.go +++ b/functions/meos_meos_rgeo.go @@ -4,17 +4,29 @@ package functions #include #include "meos.h" #include "meos_catalog.h" +#include "meos_cbuffer.h" +#include "meos_cellindex.h" #include "meos_geo.h" +#include "meos_h3.h" #include "meos_internal.h" #include "meos_internal_geo.h" +#include "meos_json.h" #include "meos_npoint.h" -#include "meos_cbuffer.h" +#include "meos_pointcloud.h" #include "meos_pose.h" -#include "meos_rgeo.h" -#include "meos_h3.h" #include "meos_quadbin.h" -#include "meos_json.h" -#include "meos_pointcloud.h" +#include "meos_raster.h" +#include "meos_rgeo.h" +#include "meos_s2cell.h" +#include "pg_basetypes.h" +#include "pg_bool.h" +#include "pg_date.h" +#include "pg_float.h" +#include "pg_int.h" +#include "pg_interval.h" +#include "pg_text.h" +#include "pg_time.h" +#include "pg_timestamp.h" // cgo reads C.union_* as a union TYPE; alias the union operators so C.g resolves them as functions. #define gunion_bigint_set union_bigint_set diff --git a/functions/meos_meos_s2cell.go b/functions/meos_meos_s2cell.go new file mode 100644 index 0000000..fa04a15 --- /dev/null +++ b/functions/meos_meos_s2cell.go @@ -0,0 +1,1364 @@ +package functions + +/* +#include +#include "meos.h" +#include "meos_catalog.h" +#include "meos_cbuffer.h" +#include "meos_cellindex.h" +#include "meos_geo.h" +#include "meos_h3.h" +#include "meos_internal.h" +#include "meos_internal_geo.h" +#include "meos_json.h" +#include "meos_npoint.h" +#include "meos_pointcloud.h" +#include "meos_pose.h" +#include "meos_quadbin.h" +#include "meos_raster.h" +#include "meos_rgeo.h" +#include "meos_s2cell.h" +#include "pg_basetypes.h" +#include "pg_bool.h" +#include "pg_date.h" +#include "pg_float.h" +#include "pg_int.h" +#include "pg_interval.h" +#include "pg_text.h" +#include "pg_time.h" +#include "pg_timestamp.h" + +// cgo reads C.union_* as a union TYPE; alias the union operators so C.g resolves them as functions. +#define gunion_bigint_set union_bigint_set +#define gunion_bigint_span union_bigint_span +#define gunion_bigint_spanset union_bigint_spanset +#define gunion_cbuffer_set union_cbuffer_set +#define gunion_date_set union_date_set +#define gunion_date_span union_date_span +#define gunion_date_spanset union_date_spanset +#define gunion_float_set union_float_set +#define gunion_float_span union_float_span +#define gunion_float_spanset union_float_spanset +#define gunion_geo_set union_geo_set +#define gunion_h3index_set union_h3index_set +#define gunion_int_set union_int_set +#define gunion_int_span union_int_span +#define gunion_int_spanset union_int_spanset +#define gunion_jsonb_set union_jsonb_set +#define gunion_npoint_set union_npoint_set +#define gunion_pcpatch_set union_pcpatch_set +#define gunion_pcpoint_set union_pcpoint_set +#define gunion_pose_set union_pose_set +#define gunion_posechain_set union_posechain_set +#define gunion_quadbin_set union_quadbin_set +#define gunion_s2cell_set union_s2cell_set +#define gunion_set_bigint union_set_bigint +#define gunion_set_cbuffer union_set_cbuffer +#define gunion_set_date union_set_date +#define gunion_set_float union_set_float +#define gunion_set_geo union_set_geo +#define gunion_set_h3index union_set_h3index +#define gunion_set_int union_set_int +#define gunion_set_jsonb union_set_jsonb +#define gunion_set_npoint union_set_npoint +#define gunion_set_pcpatch union_set_pcpatch +#define gunion_set_pcpoint union_set_pcpoint +#define gunion_set_pose union_set_pose +#define gunion_set_posechain union_set_posechain +#define gunion_set_quadbin union_set_quadbin +#define gunion_set_s2cell union_set_s2cell +#define gunion_set_set union_set_set +#define gunion_set_text union_set_text +#define gunion_set_timestamptz union_set_timestamptz +#define gunion_set_value union_set_value +#define gunion_span_bigint union_span_bigint +#define gunion_span_date union_span_date +#define gunion_span_float union_span_float +#define gunion_span_int union_span_int +#define gunion_span_span union_span_span +#define gunion_span_spanset union_span_spanset +#define gunion_span_timestamptz union_span_timestamptz +#define gunion_span_value union_span_value +#define gunion_spanset_bigint union_spanset_bigint +#define gunion_spanset_date union_spanset_date +#define gunion_spanset_float union_spanset_float +#define gunion_spanset_int union_spanset_int +#define gunion_spanset_span union_spanset_span +#define gunion_spanset_spanset union_spanset_spanset +#define gunion_spanset_timestamptz union_spanset_timestamptz +#define gunion_spanset_value union_spanset_value +#define gunion_stbox_stbox union_stbox_stbox +#define gunion_tbox_tbox union_tbox_tbox +#define gunion_text_set union_text_set +#define gunion_timestamptz_set union_timestamptz_set +#define gunion_timestamptz_span union_timestamptz_span +#define gunion_timestamptz_spanset union_timestamptz_spanset +#define gunion_tpcbox_tpcbox union_tpcbox_tpcbox +#define gunion_value_set union_value_set +#define gunion_value_span union_value_span +#define gunion_value_spanset union_value_spanset +*/ +import "C" +import ( + "unsafe" +) + +var _ = unsafe.Pointer(nil) + +// S2cellAsHexwkb wraps MEOS C function s2cell_as_hexwkb. +func S2cellAsHexwkb(cell uint64, variant uint8, size_out unsafe.Pointer) (_r0 string, _err error) { + C.meos_errno_reset() + _cret := C.s2cell_as_hexwkb(C.uint64_t(cell), C.uint8_t(variant), (*C.size_t)(unsafe.Pointer(size_out))) + if _err = meosError(); _err != nil { + return + } + defer C.free(unsafe.Pointer(_cret)) + return C.GoString(_cret), nil +} + + +// S2cellAsWKB wraps MEOS C function s2cell_as_wkb. +func S2cellAsWKB(cell uint64, variant uint8, size_out unsafe.Pointer) (_r0 unsafe.Pointer, _err error) { + C.meos_errno_reset() + _cret := C.s2cell_as_wkb(C.uint64_t(cell), C.uint8_t(variant), (*C.size_t)(unsafe.Pointer(size_out))) + if _err = meosError(); _err != nil { + return + } + return unsafe.Pointer(_cret), nil +} + + +// S2cellFromHexwkb wraps MEOS C function s2cell_from_hexwkb. +func S2cellFromHexwkb(hexwkb string) (_r0 uint64, _err error) { + _c_hexwkb := C.CString(hexwkb) + defer C.free(unsafe.Pointer(_c_hexwkb)) + C.meos_errno_reset() + _cret := C.s2cell_from_hexwkb(_c_hexwkb) + if _err = meosError(); _err != nil { + return + } + return uint64(_cret), nil +} + + +// S2cellFromWKB wraps MEOS C function s2cell_from_wkb. +func S2cellFromWKB(wkb unsafe.Pointer, size uint) (_r0 uint64, _err error) { + C.meos_errno_reset() + _cret := C.s2cell_from_wkb((*C.uint8_t)(unsafe.Pointer(wkb)), C.size_t(size)) + if _err = meosError(); _err != nil { + return + } + return uint64(_cret), nil +} + + +// S2cellIn wraps MEOS C function s2cell_in. +func S2cellIn(str string) (_r0 uint64, _err error) { + _c_str := C.CString(str) + defer C.free(unsafe.Pointer(_c_str)) + C.meos_errno_reset() + _cret := C.s2cell_in(_c_str) + if _err = meosError(); _err != nil { + return + } + return uint64(_cret), nil +} + + +// BigintToS2cell wraps MEOS C function bigint_to_s2cell. +func BigintToS2cell(i int64) (_r0 uint64, _err error) { + C.meos_errno_reset() + _cret := C.bigint_to_s2cell(C.int64_t(i)) + if _err = meosError(); _err != nil { + return + } + return uint64(_cret), nil +} + + +// S2cellOut wraps MEOS C function s2cell_out. +func S2cellOut(cell uint64) (_r0 string, _err error) { + C.meos_errno_reset() + _cret := C.s2cell_out(C.uint64_t(cell)) + if _err = meosError(); _err != nil { + return + } + defer C.free(unsafe.Pointer(_cret)) + return C.GoString(_cret), nil +} + + +// S2cellEq wraps MEOS C function s2cell_eq. +func S2cellEq(a uint64, b uint64) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.s2cell_eq(C.uint64_t(a), C.uint64_t(b)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// S2cellNe wraps MEOS C function s2cell_ne. +func S2cellNe(a uint64, b uint64) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.s2cell_ne(C.uint64_t(a), C.uint64_t(b)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// S2cellLt wraps MEOS C function s2cell_lt. +func S2cellLt(a uint64, b uint64) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.s2cell_lt(C.uint64_t(a), C.uint64_t(b)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// S2cellLe wraps MEOS C function s2cell_le. +func S2cellLe(a uint64, b uint64) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.s2cell_le(C.uint64_t(a), C.uint64_t(b)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// S2cellGt wraps MEOS C function s2cell_gt. +func S2cellGt(a uint64, b uint64) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.s2cell_gt(C.uint64_t(a), C.uint64_t(b)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// S2cellGe wraps MEOS C function s2cell_ge. +func S2cellGe(a uint64, b uint64) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.s2cell_ge(C.uint64_t(a), C.uint64_t(b)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// S2cellCmp wraps MEOS C function s2cell_cmp. +func S2cellCmp(a uint64, b uint64) (_r0 int, _err error) { + C.meos_errno_reset() + _cret := C.s2cell_cmp(C.uint64_t(a), C.uint64_t(b)) + if _err = meosError(); _err != nil { + return + } + return int(_cret), nil +} + + +// S2cellHash wraps MEOS C function s2cell_hash. +func S2cellHash(cell uint64) (_r0 uint32, _err error) { + C.meos_errno_reset() + _cret := C.s2cell_hash(C.uint64_t(cell)) + if _err = meosError(); _err != nil { + return + } + return uint32(_cret), nil +} + + +// S2cellHashExtended wraps MEOS C function s2cell_hash_extended. +func S2cellHashExtended(cell uint64, seed uint64) (_r0 uint64, _err error) { + C.meos_errno_reset() + _cret := C.s2cell_hash_extended(C.uint64_t(cell), C.uint64_t(seed)) + if _err = meosError(); _err != nil { + return + } + return uint64(_cret), nil +} + + +// S2cellIsValidCell wraps MEOS C function s2cell_is_valid_cell. +func S2cellIsValidCell(cell uint64) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.s2cell_is_valid_cell(C.uint64_t(cell)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// S2cellCellToToken wraps MEOS C function s2cell_cell_to_token. +func S2cellCellToToken(cell uint64) (_r0 string, _err error) { + C.meos_errno_reset() + _cret := C.s2cell_cell_to_token(C.uint64_t(cell)) + if _err = meosError(); _err != nil { + return + } + defer C.free(unsafe.Pointer(_cret)) + return C.GoString(_cret), nil +} + + +// S2cellTokenToCell wraps MEOS C function s2cell_token_to_cell. +func S2cellTokenToCell(token string) (_r0 uint64, _err error) { + _c_token := C.CString(token) + defer C.free(unsafe.Pointer(_c_token)) + C.meos_errno_reset() + _cret := C.s2cell_token_to_cell(_c_token) + if _err = meosError(); _err != nil { + return + } + return uint64(_cret), nil +} + + +// S2cellGetResolution wraps MEOS C function s2cell_get_resolution. +func S2cellGetResolution(cell uint64) (_r0 uint32, _err error) { + C.meos_errno_reset() + _cret := C.s2cell_get_resolution(C.uint64_t(cell)) + if _err = meosError(); _err != nil { + return + } + return uint32(_cret), nil +} + + +// S2cellGetFace wraps MEOS C function s2cell_get_face. +func S2cellGetFace(cell uint64) (_r0 uint32, _err error) { + C.meos_errno_reset() + _cret := C.s2cell_get_face(C.uint64_t(cell)) + if _err = meosError(); _err != nil { + return + } + return uint32(_cret), nil +} + + +// S2cellCellToParent wraps MEOS C function s2cell_cell_to_parent. +func S2cellCellToParent(cell uint64, level uint32) (_r0 uint64, _err error) { + C.meos_errno_reset() + _cret := C.s2cell_cell_to_parent(C.uint64_t(cell), C.uint32_t(level)) + if _err = meosError(); _err != nil { + return + } + return uint64(_cret), nil +} + + +// S2cellCellToChild wraps MEOS C function s2cell_cell_to_child. +func S2cellCellToChild(cell uint64, level uint32, position uint32) (_r0 uint64, _err error) { + C.meos_errno_reset() + _cret := C.s2cell_cell_to_child(C.uint64_t(cell), C.uint32_t(level), C.uint32_t(position)) + if _err = meosError(); _err != nil { + return + } + return uint64(_cret), nil +} + + +// S2cellCellToChildren wraps MEOS C function s2cell_cell_to_children. +func S2cellCellToChildren(cell uint64, level uint32, count unsafe.Pointer) (_r0 unsafe.Pointer, _err error) { + C.meos_errno_reset() + _cret := C.s2cell_cell_to_children(C.uint64_t(cell), C.uint32_t(level), (*C.int)(unsafe.Pointer(count))) + if _err = meosError(); _err != nil { + return + } + return unsafe.Pointer(_cret), nil +} + + +// S2cellCellContains wraps MEOS C function s2cell_cell_contains. +func S2cellCellContains(cell uint64, other uint64) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.s2cell_cell_contains(C.uint64_t(cell), C.uint64_t(other)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// S2cellCommonAncestorLevel wraps MEOS C function s2cell_common_ancestor_level. +func S2cellCommonAncestorLevel(a uint64, b uint64) (_r0 int, _err error) { + C.meos_errno_reset() + _cret := C.s2cell_common_ancestor_level(C.uint64_t(a), C.uint64_t(b)) + if _err = meosError(); _err != nil { + return + } + return int(_cret), nil +} + + +// S2cellRangeMin wraps MEOS C function s2cell_range_min. +func S2cellRangeMin(cell uint64) (_r0 uint64, _err error) { + C.meos_errno_reset() + _cret := C.s2cell_range_min(C.uint64_t(cell)) + if _err = meosError(); _err != nil { + return + } + return uint64(_cret), nil +} + + +// S2cellRangeMax wraps MEOS C function s2cell_range_max. +func S2cellRangeMax(cell uint64) (_r0 uint64, _err error) { + C.meos_errno_reset() + _cret := C.s2cell_range_max(C.uint64_t(cell)) + if _err = meosError(); _err != nil { + return + } + return uint64(_cret), nil +} + + +// S2cellEdgeNeighbors wraps MEOS C function s2cell_edge_neighbors. +func S2cellEdgeNeighbors(cell uint64, count unsafe.Pointer) (_r0 unsafe.Pointer, _err error) { + C.meos_errno_reset() + _cret := C.s2cell_edge_neighbors(C.uint64_t(cell), (*C.int)(unsafe.Pointer(count))) + if _err = meosError(); _err != nil { + return + } + return unsafe.Pointer(_cret), nil +} + + +// S2cellPointToCell wraps MEOS C function s2cell_point_to_cell. +func S2cellPointToCell(longitude float64, latitude float64, level uint32) (_r0 uint64, _err error) { + C.meos_errno_reset() + _cret := C.s2cell_point_to_cell(C.double(longitude), C.double(latitude), C.uint32_t(level)) + if _err = meosError(); _err != nil { + return + } + return uint64(_cret), nil +} + + +// S2cellCellArea wraps MEOS C function s2cell_cell_area. +func S2cellCellArea(cell uint64) (_r0 float64, _err error) { + C.meos_errno_reset() + _cret := C.s2cell_cell_area(C.uint64_t(cell)) + if _err = meosError(); _err != nil { + return + } + return float64(_cret), nil +} + + +// S2cellEdgeLength wraps MEOS C function s2cell_edge_length. +func S2cellEdgeLength(cell uint64, edge uint32) (_r0 float64, _err error) { + C.meos_errno_reset() + _cret := C.s2cell_edge_length(C.uint64_t(cell), C.uint32_t(edge)) + if _err = meosError(); _err != nil { + return + } + return float64(_cret), nil +} + + +// GeoToS2cellCell wraps MEOS C function geo_to_s2cell_cell. +func GeoToS2cellCell(point *Geom, level int32) (_r0 uint64, _err error) { + C.meos_errno_reset() + _cret := C.geo_to_s2cell_cell(point._inner, C.int32(level)) + if _err = meosError(); _err != nil { + return + } + return uint64(_cret), nil +} + + +// GeoToS2cellSet wraps MEOS C function geo_to_s2cell_set. +func GeoToS2cellSet(gs *Geom, level int32) (_r0 *Set, _err error) { + C.meos_errno_reset() + _cret := C.geo_to_s2cell_set(gs._inner, C.int32(level)) + if _err = meosError(); _err != nil { + return + } + return &Set{_inner: _cret}, nil +} + + +// S2cellCellToGeogpoint wraps MEOS C function s2cell_cell_to_geogpoint. +func S2cellCellToGeogpoint(cell uint64) (_r0 *Geom, _err error) { + C.meos_errno_reset() + _cret := C.s2cell_cell_to_geogpoint(C.uint64_t(cell)) + if _err = meosError(); _err != nil { + return + } + return &Geom{_inner: _cret}, nil +} + + +// S2cellCellToGeog wraps MEOS C function s2cell_cell_to_geog. +func S2cellCellToGeog(cell uint64) (_r0 *Geom, _err error) { + C.meos_errno_reset() + _cret := C.s2cell_cell_to_geog(C.uint64_t(cell)) + if _err = meosError(); _err != nil { + return + } + return &Geom{_inner: _cret}, nil +} + + +// EverEqS2cellsetTs2cell wraps MEOS C function ever_eq_s2cellset_ts2cell. +func EverEqS2cellsetTs2cell(cells *Set, temp *Temporal) (_r0 int, _err error) { + C.meos_errno_reset() + _cret := C.ever_eq_s2cellset_ts2cell(cells._inner, temp._inner) + if _err = meosError(); _err != nil { + return + } + return int(_cret), nil +} + + +// EverEqTs2cellS2cellset wraps MEOS C function ever_eq_ts2cell_s2cellset. +func EverEqTs2cellS2cellset(temp *Temporal, cells *Set) (_r0 int, _err error) { + C.meos_errno_reset() + _cret := C.ever_eq_ts2cell_s2cellset(temp._inner, cells._inner) + if _err = meosError(); _err != nil { + return + } + return int(_cret), nil +} + + +// S2cellToSTBOX wraps MEOS C function s2cell_to_stbox. +func S2cellToSTBOX(cell uint64) (_r0 *STBox, _err error) { + C.meos_errno_reset() + _cret := C.s2cell_to_stbox(C.uint64_t(cell)) + if _err = meosError(); _err != nil { + return + } + return &STBox{_inner: _cret}, nil +} + + +// S2cellTimestamptzToSTBOX wraps MEOS C function s2cell_timestamptz_to_stbox. +func S2cellTimestamptzToSTBOX(cell uint64, t int64) (_r0 *STBox, _err error) { + C.meos_errno_reset() + _cret := C.s2cell_timestamptz_to_stbox(C.uint64_t(cell), C.TimestampTz(t)) + if _err = meosError(); _err != nil { + return + } + return &STBox{_inner: _cret}, nil +} + + +// S2cellTstzspanToSTBOX wraps MEOS C function s2cell_tstzspan_to_stbox. +func S2cellTstzspanToSTBOX(cell uint64, s *Span) (_r0 *STBox, _err error) { + C.meos_errno_reset() + _cret := C.s2cell_tstzspan_to_stbox(C.uint64_t(cell), s._inner) + if _err = meosError(); _err != nil { + return + } + return &STBox{_inner: _cret}, nil +} + + +// S2cellEdgeNeighborsSet wraps MEOS C function s2cell_edge_neighbors_set. +func S2cellEdgeNeighborsSet(cell uint64) (_r0 *Set, _err error) { + C.meos_errno_reset() + _cret := C.s2cell_edge_neighbors_set(C.uint64_t(cell)) + if _err = meosError(); _err != nil { + return + } + return &Set{_inner: _cret}, nil +} + + +// S2cellCellToChildrenSet wraps MEOS C function s2cell_cell_to_children_set. +func S2cellCellToChildrenSet(cell uint64, children_level int) (_r0 *Set, _err error) { + C.meos_errno_reset() + _cret := C.s2cell_cell_to_children_set(C.uint64_t(cell), C.int(children_level)) + if _err = meosError(); _err != nil { + return + } + return &Set{_inner: _cret}, nil +} + + +// S2cellsetCompactCells wraps MEOS C function s2cellset_compact_cells. +func S2cellsetCompactCells(cells *Set) (_r0 *Set, _err error) { + C.meos_errno_reset() + _cret := C.s2cellset_compact_cells(cells._inner) + if _err = meosError(); _err != nil { + return + } + return &Set{_inner: _cret}, nil +} + + +// S2cellsetUncompactCells wraps MEOS C function s2cellset_uncompact_cells. +func S2cellsetUncompactCells(cells *Set, resolution int) (_r0 *Set, _err error) { + C.meos_errno_reset() + _cret := C.s2cellset_uncompact_cells(cells._inner, C.int(resolution)) + if _err = meosError(); _err != nil { + return + } + return &Set{_inner: _cret}, nil +} + + +// S2cellCellToCover wraps MEOS C function s2cell_cell_to_cover. +func S2cellCellToCover(cell uint64, resolution int) (_r0 *Set, _err error) { + C.meos_errno_reset() + _cret := C.s2cell_cell_to_cover(C.uint64_t(cell), C.int(resolution)) + if _err = meosError(); _err != nil { + return + } + return &Set{_inner: _cret}, nil +} + + +// S2cellsetCoverCells wraps MEOS C function s2cellset_cover_cells. +func S2cellsetCoverCells(cells *Set, resolution int) (_r0 *Set, _err error) { + C.meos_errno_reset() + _cret := C.s2cellset_cover_cells(cells._inner, C.int(resolution)) + if _err = meosError(); _err != nil { + return + } + return &Set{_inner: _cret}, nil +} + + +// S2cellsetIn wraps MEOS C function s2cellset_in. +func S2cellsetIn(str string) (_r0 *Set, _err error) { + _c_str := C.CString(str) + defer C.free(unsafe.Pointer(_c_str)) + C.meos_errno_reset() + _cret := C.s2cellset_in(_c_str) + if _err = meosError(); _err != nil { + return + } + return &Set{_inner: _cret}, nil +} + + +// S2cellsetOut wraps MEOS C function s2cellset_out. +func S2cellsetOut(s *Set) (_r0 string, _err error) { + C.meos_errno_reset() + _cret := C.s2cellset_out(s._inner) + if _err = meosError(); _err != nil { + return + } + defer C.free(unsafe.Pointer(_cret)) + return C.GoString(_cret), nil +} + + +// S2cellsetMake wraps MEOS C function s2cellset_make. +func S2cellsetMake(values unsafe.Pointer, count int) (_r0 *Set, _err error) { + C.meos_errno_reset() + _cret := C.s2cellset_make((*C.uint64_t)(unsafe.Pointer(values)), C.int(count)) + if _err = meosError(); _err != nil { + return + } + return &Set{_inner: _cret}, nil +} + + +// S2cellsetEndValue wraps MEOS C function s2cellset_end_value. +func S2cellsetEndValue(s *Set) (_r0 uint64, _err error) { + C.meos_errno_reset() + _cret := C.s2cellset_end_value(s._inner) + if _err = meosError(); _err != nil { + return + } + return uint64(_cret), nil +} + + +// S2cellsetStartValue wraps MEOS C function s2cellset_start_value. +func S2cellsetStartValue(s *Set) (_r0 uint64, _err error) { + C.meos_errno_reset() + _cret := C.s2cellset_start_value(s._inner) + if _err = meosError(); _err != nil { + return + } + return uint64(_cret), nil +} + + +// S2cellsetValueN wraps MEOS C function s2cellset_value_n. +func S2cellsetValueN(s *Set, n int) (_r0 bool, _r1 uint64, _err error) { + var _out_result C.uint64_t + C.meos_errno_reset() + _cret := C.s2cellset_value_n(s._inner, C.int(n), &_out_result) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), uint64(_out_result), nil +} + + +// S2cellsetValues wraps MEOS C function s2cellset_values. +func S2cellsetValues(s *Set, count unsafe.Pointer) (_r0 unsafe.Pointer, _err error) { + C.meos_errno_reset() + _cret := C.s2cellset_values(s._inner, (*C.int)(unsafe.Pointer(count))) + if _err = meosError(); _err != nil { + return + } + return unsafe.Pointer(_cret), nil +} + + +// ContainedS2cellSet wraps MEOS C function contained_s2cell_set. +func ContainedS2cellSet(cell uint64, s *Set) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.contained_s2cell_set(C.uint64_t(cell), s._inner) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// ContainsSetS2cell wraps MEOS C function contains_set_s2cell. +func ContainsSetS2cell(s *Set, cell uint64) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.contains_set_s2cell(s._inner, C.uint64_t(cell)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// IntersectionS2cellSet wraps MEOS C function intersection_s2cell_set. +func IntersectionS2cellSet(cell uint64, s *Set) (_r0 *Set, _err error) { + C.meos_errno_reset() + _cret := C.intersection_s2cell_set(C.uint64_t(cell), s._inner) + if _err = meosError(); _err != nil { + return + } + return &Set{_inner: _cret}, nil +} + + +// IntersectionSetS2cell wraps MEOS C function intersection_set_s2cell. +func IntersectionSetS2cell(s *Set, cell uint64) (_r0 *Set, _err error) { + C.meos_errno_reset() + _cret := C.intersection_set_s2cell(s._inner, C.uint64_t(cell)) + if _err = meosError(); _err != nil { + return + } + return &Set{_inner: _cret}, nil +} + + +// MinusS2cellSet wraps MEOS C function minus_s2cell_set. +func MinusS2cellSet(cell uint64, s *Set) (_r0 *Set, _err error) { + C.meos_errno_reset() + _cret := C.minus_s2cell_set(C.uint64_t(cell), s._inner) + if _err = meosError(); _err != nil { + return + } + return &Set{_inner: _cret}, nil +} + + +// MinusSetS2cell wraps MEOS C function minus_set_s2cell. +func MinusSetS2cell(s *Set, cell uint64) (_r0 *Set, _err error) { + C.meos_errno_reset() + _cret := C.minus_set_s2cell(s._inner, C.uint64_t(cell)) + if _err = meosError(); _err != nil { + return + } + return &Set{_inner: _cret}, nil +} + + +// UnionS2cellSet wraps MEOS C function union_s2cell_set. +func UnionS2cellSet(cell uint64, s *Set) (_r0 *Set, _err error) { + C.meos_errno_reset() + _cret := C.gunion_s2cell_set(C.uint64_t(cell), s._inner) + if _err = meosError(); _err != nil { + return + } + return &Set{_inner: _cret}, nil +} + + +// UnionSetS2cell wraps MEOS C function union_set_s2cell. +func UnionSetS2cell(s *Set, cell uint64) (_r0 *Set, _err error) { + C.meos_errno_reset() + _cret := C.gunion_set_s2cell(s._inner, C.uint64_t(cell)) + if _err = meosError(); _err != nil { + return + } + return &Set{_inner: _cret}, nil +} + + +// S2cellUnionTransfn wraps MEOS C function s2cell_union_transfn. +func S2cellUnionTransfn(state *Set, cell uint64) (_r0 *Set, _err error) { + C.meos_errno_reset() + _cret := C.s2cell_union_transfn(state._inner, C.uint64_t(cell)) + if _err = meosError(); _err != nil { + return + } + return &Set{_inner: _cret}, nil +} + + +// Ts2cellIn wraps MEOS C function ts2cell_in. +func Ts2cellIn(str string) (_r0 *Temporal, _err error) { + _c_str := C.CString(str) + defer C.free(unsafe.Pointer(_c_str)) + C.meos_errno_reset() + _cret := C.ts2cell_in(_c_str) + if _err = meosError(); _err != nil { + return + } + return &Temporal{_inner: _cret}, nil +} + + +// Ts2cellinstIn wraps MEOS C function ts2cellinst_in. +func Ts2cellinstIn(str string) (_r0 *TInstant, _err error) { + _c_str := C.CString(str) + defer C.free(unsafe.Pointer(_c_str)) + C.meos_errno_reset() + _cret := C.ts2cellinst_in(_c_str) + if _err = meosError(); _err != nil { + return + } + return &TInstant{_inner: _cret}, nil +} + + +// Ts2cellseqIn wraps MEOS C function ts2cellseq_in. +func Ts2cellseqIn(str string, interp Interpolation) (_r0 *TSequence, _err error) { + _c_str := C.CString(str) + defer C.free(unsafe.Pointer(_c_str)) + C.meos_errno_reset() + _cret := C.ts2cellseq_in(_c_str, C.interpType(interp)) + if _err = meosError(); _err != nil { + return + } + return &TSequence{_inner: _cret}, nil +} + + +// Ts2cellseqsetIn wraps MEOS C function ts2cellseqset_in. +func Ts2cellseqsetIn(str string) (_r0 *TSequenceSet, _err error) { + _c_str := C.CString(str) + defer C.free(unsafe.Pointer(_c_str)) + C.meos_errno_reset() + _cret := C.ts2cellseqset_in(_c_str) + if _err = meosError(); _err != nil { + return + } + return &TSequenceSet{_inner: _cret}, nil +} + + +// Ts2cellOut wraps MEOS C function ts2cell_out. +func Ts2cellOut(temp *Temporal) (_r0 string, _err error) { + C.meos_errno_reset() + _cret := C.ts2cell_out(temp._inner) + if _err = meosError(); _err != nil { + return + } + defer C.free(unsafe.Pointer(_cret)) + return C.GoString(_cret), nil +} + + +// Ts2cellFromMFJSON wraps MEOS C function ts2cell_from_mfjson. +func Ts2cellFromMFJSON(mfjson string) (_r0 *Temporal, _err error) { + _c_mfjson := C.CString(mfjson) + defer C.free(unsafe.Pointer(_c_mfjson)) + C.meos_errno_reset() + _cret := C.ts2cell_from_mfjson(_c_mfjson) + if _err = meosError(); _err != nil { + return + } + return &Temporal{_inner: _cret}, nil +} + + +// Ts2cellMake wraps MEOS C function ts2cell_make. +func Ts2cellMake(value uint64, t int64) (_r0 *Temporal, _err error) { + C.meos_errno_reset() + _cret := C.ts2cell_make(C.uint64_t(value), C.TimestampTz(t)) + if _err = meosError(); _err != nil { + return + } + return &Temporal{_inner: _cret}, nil +} + + +// Ts2cellinstMake wraps MEOS C function ts2cellinst_make. +func Ts2cellinstMake(value uint64, t int64) (_r0 *TInstant, _err error) { + C.meos_errno_reset() + _cret := C.ts2cellinst_make(C.uint64_t(value), C.TimestampTz(t)) + if _err = meosError(); _err != nil { + return + } + return &TInstant{_inner: _cret}, nil +} + + +// Ts2cellFromBaseTemp wraps MEOS C function ts2cell_from_base_temp. +func Ts2cellFromBaseTemp(value uint64, temp *Temporal) (_r0 *Temporal, _err error) { + C.meos_errno_reset() + _cret := C.ts2cell_from_base_temp(C.uint64_t(value), temp._inner) + if _err = meosError(); _err != nil { + return + } + return &Temporal{_inner: _cret}, nil +} + + +// Ts2cellseqFromBaseTstzset wraps MEOS C function ts2cellseq_from_base_tstzset. +func Ts2cellseqFromBaseTstzset(value uint64, s *Set) (_r0 *TSequence, _err error) { + C.meos_errno_reset() + _cret := C.ts2cellseq_from_base_tstzset(C.uint64_t(value), s._inner) + if _err = meosError(); _err != nil { + return + } + return &TSequence{_inner: _cret}, nil +} + + +// Ts2cellseqFromBaseTstzspan wraps MEOS C function ts2cellseq_from_base_tstzspan. +func Ts2cellseqFromBaseTstzspan(value uint64, s *Span) (_r0 *TSequence, _err error) { + C.meos_errno_reset() + _cret := C.ts2cellseq_from_base_tstzspan(C.uint64_t(value), s._inner) + if _err = meosError(); _err != nil { + return + } + return &TSequence{_inner: _cret}, nil +} + + +// Ts2cellseqsetFromBaseTstzspanset wraps MEOS C function ts2cellseqset_from_base_tstzspanset. +func Ts2cellseqsetFromBaseTstzspanset(value uint64, ss *SpanSet) (_r0 *TSequenceSet, _err error) { + C.meos_errno_reset() + _cret := C.ts2cellseqset_from_base_tstzspanset(C.uint64_t(value), ss._inner) + if _err = meosError(); _err != nil { + return + } + return &TSequenceSet{_inner: _cret}, nil +} + + +// Ts2cellseqMake wraps MEOS C function ts2cellseq_make. +func Ts2cellseqMake(values unsafe.Pointer, times unsafe.Pointer, count int, lower_inc bool, upper_inc bool) (_r0 *TSequence, _err error) { + C.meos_errno_reset() + _cret := C.ts2cellseq_make((*C.uint64_t)(unsafe.Pointer(values)), (*C.TimestampTz)(unsafe.Pointer(times)), C.int(count), C.bool(lower_inc), C.bool(upper_inc)) + if _err = meosError(); _err != nil { + return + } + return &TSequence{_inner: _cret}, nil +} + + +// Ts2cellseqsetMake wraps MEOS C function ts2cellseqset_make. +func Ts2cellseqsetMake(sequences unsafe.Pointer, count int) (_r0 *TSequenceSet, _err error) { + C.meos_errno_reset() + _cret := C.ts2cellseqset_make((**C.TSequence)(unsafe.Pointer(sequences)), C.int(count)) + if _err = meosError(); _err != nil { + return + } + return &TSequenceSet{_inner: _cret}, nil +} + + +// Ts2cellStartValue wraps MEOS C function ts2cell_start_value. +func Ts2cellStartValue(temp *Temporal) (_r0 uint64, _err error) { + C.meos_errno_reset() + _cret := C.ts2cell_start_value(temp._inner) + if _err = meosError(); _err != nil { + return + } + return uint64(_cret), nil +} + + +// Ts2cellEndValue wraps MEOS C function ts2cell_end_value. +func Ts2cellEndValue(temp *Temporal) (_r0 uint64, _err error) { + C.meos_errno_reset() + _cret := C.ts2cell_end_value(temp._inner) + if _err = meosError(); _err != nil { + return + } + return uint64(_cret), nil +} + + +// Ts2cellValue wraps MEOS C function ts2cell_value. +func Ts2cellValue(temp *Temporal) (_r0 uint64, _err error) { + C.meos_errno_reset() + _cret := C.ts2cell_value(temp._inner) + if _err = meosError(); _err != nil { + return + } + return uint64(_cret), nil +} + + +// Ts2cellValueN wraps MEOS C function ts2cell_value_n. +func Ts2cellValueN(temp *Temporal, n int) (_r0 bool, _r1 uint64, _err error) { + var _out_result C.uint64_t + C.meos_errno_reset() + _cret := C.ts2cell_value_n(temp._inner, C.int(n), &_out_result) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), uint64(_out_result), nil +} + + +// Ts2cellValues wraps MEOS C function ts2cell_values. +func Ts2cellValues(temp *Temporal, count unsafe.Pointer) (_r0 unsafe.Pointer, _err error) { + C.meos_errno_reset() + _cret := C.ts2cell_values(temp._inner, (*C.int)(unsafe.Pointer(count))) + if _err = meosError(); _err != nil { + return + } + return unsafe.Pointer(_cret), nil +} + + +// Ts2cellUnnest wraps MEOS C function ts2cell_unnest. +func Ts2cellUnnest(temp *Temporal, values unsafe.Pointer, count unsafe.Pointer) (_r0 unsafe.Pointer, _err error) { + C.meos_errno_reset() + _cret := C.ts2cell_unnest(temp._inner, (**C.uint64_t)(unsafe.Pointer(values)), (*C.int)(unsafe.Pointer(count))) + if _err = meosError(); _err != nil { + return + } + return unsafe.Pointer(_cret), nil +} + + +// Ts2cellValueAtTimestamptz wraps MEOS C function ts2cell_value_at_timestamptz. +func Ts2cellValueAtTimestamptz(temp *Temporal, t int64, strict bool) (_r0 bool, _r1 uint64, _err error) { + var _out_result C.uint64_t + C.meos_errno_reset() + _cret := C.ts2cell_value_at_timestamptz(temp._inner, C.TimestampTz(t), C.bool(strict), &_out_result) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), uint64(_out_result), nil +} + + +// S2cellToSet wraps MEOS C function s2cell_to_set. +func S2cellToSet(cell uint64) (_r0 *Set, _err error) { + C.meos_errno_reset() + _cret := C.s2cell_to_set(C.uint64_t(cell)) + if _err = meosError(); _err != nil { + return + } + return &Set{_inner: _cret}, nil +} + + +// TbigintToTs2cell wraps MEOS C function tbigint_to_ts2cell. +func TbigintToTs2cell(temp *Temporal) (_r0 *Temporal, _err error) { + C.meos_errno_reset() + _cret := C.tbigint_to_ts2cell(temp._inner) + if _err = meosError(); _err != nil { + return + } + return &Temporal{_inner: _cret}, nil +} + + +// Ts2cellToTbigint wraps MEOS C function ts2cell_to_tbigint. +func Ts2cellToTbigint(temp *Temporal) (_r0 *Temporal, _err error) { + C.meos_errno_reset() + _cret := C.ts2cell_to_tbigint(temp._inner) + if _err = meosError(); _err != nil { + return + } + return &Temporal{_inner: _cret}, nil +} + + +// TgeogpointToTs2cell wraps MEOS C function tgeogpoint_to_ts2cell. +func TgeogpointToTs2cell(temp *Temporal, level int32, border_inc bool) (_r0 *Temporal, _err error) { + C.meos_errno_reset() + _cret := C.tgeogpoint_to_ts2cell(temp._inner, C.int32(level), C.bool(border_inc)) + if _err = meosError(); _err != nil { + return + } + return &Temporal{_inner: _cret}, nil +} + + +// TgeompointToTs2cell wraps MEOS C function tgeompoint_to_ts2cell. +func TgeompointToTs2cell(temp *Temporal, level int32, border_inc bool) (_r0 *Temporal, _err error) { + C.meos_errno_reset() + _cret := C.tgeompoint_to_ts2cell(temp._inner, C.int32(level), C.bool(border_inc)) + if _err = meosError(); _err != nil { + return + } + return &Temporal{_inner: _cret}, nil +} + + +// TgeogpointS2cellSplit wraps MEOS C function tgeogpoint_s2cell_split. +func TgeogpointS2cellSplit(temp *Temporal, level int32, border_inc bool, cells unsafe.Pointer, count unsafe.Pointer) (_r0 unsafe.Pointer, _err error) { + C.meos_errno_reset() + _cret := C.tgeogpoint_s2cell_split(temp._inner, C.int32(level), C.bool(border_inc), (**C.uint64_t)(unsafe.Pointer(cells)), (*C.int)(unsafe.Pointer(count))) + if _err = meosError(); _err != nil { + return + } + return unsafe.Pointer(_cret), nil +} + + +// TgeompointS2cellSplit wraps MEOS C function tgeompoint_s2cell_split. +func TgeompointS2cellSplit(temp *Temporal, level int32, border_inc bool, cells unsafe.Pointer, count unsafe.Pointer) (_r0 unsafe.Pointer, _err error) { + C.meos_errno_reset() + _cret := C.tgeompoint_s2cell_split(temp._inner, C.int32(level), C.bool(border_inc), (**C.uint64_t)(unsafe.Pointer(cells)), (*C.int)(unsafe.Pointer(count))) + if _err = meosError(); _err != nil { + return + } + return unsafe.Pointer(_cret), nil +} + + +// Ts2cellAtValue wraps MEOS C function ts2cell_at_value. +func Ts2cellAtValue(temp *Temporal, cell uint64) (_r0 *Temporal, _err error) { + C.meos_errno_reset() + _cret := C.ts2cell_at_value(temp._inner, C.uint64_t(cell)) + if _err = meosError(); _err != nil { + return + } + return &Temporal{_inner: _cret}, nil +} + + +// Ts2cellMinusValue wraps MEOS C function ts2cell_minus_value. +func Ts2cellMinusValue(temp *Temporal, cell uint64) (_r0 *Temporal, _err error) { + C.meos_errno_reset() + _cret := C.ts2cell_minus_value(temp._inner, C.uint64_t(cell)) + if _err = meosError(); _err != nil { + return + } + return &Temporal{_inner: _cret}, nil +} + + +// EverEqS2cellTs2cell wraps MEOS C function ever_eq_s2cell_ts2cell. +func EverEqS2cellTs2cell(cell uint64, temp *Temporal) (_r0 int, _err error) { + C.meos_errno_reset() + _cret := C.ever_eq_s2cell_ts2cell(C.uint64_t(cell), temp._inner) + if _err = meosError(); _err != nil { + return + } + return int(_cret), nil +} + + +// EverEqTs2cellS2cell wraps MEOS C function ever_eq_ts2cell_s2cell. +func EverEqTs2cellS2cell(temp *Temporal, cell uint64) (_r0 int, _err error) { + C.meos_errno_reset() + _cret := C.ever_eq_ts2cell_s2cell(temp._inner, C.uint64_t(cell)) + if _err = meosError(); _err != nil { + return + } + return int(_cret), nil +} + + +// EverNeS2cellTs2cell wraps MEOS C function ever_ne_s2cell_ts2cell. +func EverNeS2cellTs2cell(cell uint64, temp *Temporal) (_r0 int, _err error) { + C.meos_errno_reset() + _cret := C.ever_ne_s2cell_ts2cell(C.uint64_t(cell), temp._inner) + if _err = meosError(); _err != nil { + return + } + return int(_cret), nil +} + + +// EverNeTs2cellS2cell wraps MEOS C function ever_ne_ts2cell_s2cell. +func EverNeTs2cellS2cell(temp *Temporal, cell uint64) (_r0 int, _err error) { + C.meos_errno_reset() + _cret := C.ever_ne_ts2cell_s2cell(temp._inner, C.uint64_t(cell)) + if _err = meosError(); _err != nil { + return + } + return int(_cret), nil +} + + +// AlwaysEqS2cellTs2cell wraps MEOS C function always_eq_s2cell_ts2cell. +func AlwaysEqS2cellTs2cell(cell uint64, temp *Temporal) (_r0 int, _err error) { + C.meos_errno_reset() + _cret := C.always_eq_s2cell_ts2cell(C.uint64_t(cell), temp._inner) + if _err = meosError(); _err != nil { + return + } + return int(_cret), nil +} + + +// AlwaysEqTs2cellS2cell wraps MEOS C function always_eq_ts2cell_s2cell. +func AlwaysEqTs2cellS2cell(temp *Temporal, cell uint64) (_r0 int, _err error) { + C.meos_errno_reset() + _cret := C.always_eq_ts2cell_s2cell(temp._inner, C.uint64_t(cell)) + if _err = meosError(); _err != nil { + return + } + return int(_cret), nil +} + + +// AlwaysNeS2cellTs2cell wraps MEOS C function always_ne_s2cell_ts2cell. +func AlwaysNeS2cellTs2cell(cell uint64, temp *Temporal) (_r0 int, _err error) { + C.meos_errno_reset() + _cret := C.always_ne_s2cell_ts2cell(C.uint64_t(cell), temp._inner) + if _err = meosError(); _err != nil { + return + } + return int(_cret), nil +} + + +// AlwaysNeTs2cellS2cell wraps MEOS C function always_ne_ts2cell_s2cell. +func AlwaysNeTs2cellS2cell(temp *Temporal, cell uint64) (_r0 int, _err error) { + C.meos_errno_reset() + _cret := C.always_ne_ts2cell_s2cell(temp._inner, C.uint64_t(cell)) + if _err = meosError(); _err != nil { + return + } + return int(_cret), nil +} + + +// EverEqTs2cellTs2cell wraps MEOS C function ever_eq_ts2cell_ts2cell. +func EverEqTs2cellTs2cell(temp1 *Temporal, temp2 *Temporal) (_r0 int, _err error) { + C.meos_errno_reset() + _cret := C.ever_eq_ts2cell_ts2cell(temp1._inner, temp2._inner) + if _err = meosError(); _err != nil { + return + } + return int(_cret), nil +} + + +// EverNeTs2cellTs2cell wraps MEOS C function ever_ne_ts2cell_ts2cell. +func EverNeTs2cellTs2cell(temp1 *Temporal, temp2 *Temporal) (_r0 int, _err error) { + C.meos_errno_reset() + _cret := C.ever_ne_ts2cell_ts2cell(temp1._inner, temp2._inner) + if _err = meosError(); _err != nil { + return + } + return int(_cret), nil +} + + +// AlwaysEqTs2cellTs2cell wraps MEOS C function always_eq_ts2cell_ts2cell. +func AlwaysEqTs2cellTs2cell(temp1 *Temporal, temp2 *Temporal) (_r0 int, _err error) { + C.meos_errno_reset() + _cret := C.always_eq_ts2cell_ts2cell(temp1._inner, temp2._inner) + if _err = meosError(); _err != nil { + return + } + return int(_cret), nil +} + + +// AlwaysNeTs2cellTs2cell wraps MEOS C function always_ne_ts2cell_ts2cell. +func AlwaysNeTs2cellTs2cell(temp1 *Temporal, temp2 *Temporal) (_r0 int, _err error) { + C.meos_errno_reset() + _cret := C.always_ne_ts2cell_ts2cell(temp1._inner, temp2._inner) + if _err = meosError(); _err != nil { + return + } + return int(_cret), nil +} + + +// TeqS2cellTs2cell wraps MEOS C function teq_s2cell_ts2cell. +func TeqS2cellTs2cell(cell uint64, temp *Temporal) (_r0 *Temporal, _err error) { + C.meos_errno_reset() + _cret := C.teq_s2cell_ts2cell(C.uint64_t(cell), temp._inner) + if _err = meosError(); _err != nil { + return + } + return &Temporal{_inner: _cret}, nil +} + + +// TeqTs2cellS2cell wraps MEOS C function teq_ts2cell_s2cell. +func TeqTs2cellS2cell(temp *Temporal, cell uint64) (_r0 *Temporal, _err error) { + C.meos_errno_reset() + _cret := C.teq_ts2cell_s2cell(temp._inner, C.uint64_t(cell)) + if _err = meosError(); _err != nil { + return + } + return &Temporal{_inner: _cret}, nil +} + + +// TeqTs2cellTs2cell wraps MEOS C function teq_ts2cell_ts2cell. +func TeqTs2cellTs2cell(temp1 *Temporal, temp2 *Temporal) (_r0 *Temporal, _err error) { + C.meos_errno_reset() + _cret := C.teq_ts2cell_ts2cell(temp1._inner, temp2._inner) + if _err = meosError(); _err != nil { + return + } + return &Temporal{_inner: _cret}, nil +} + + +// TneS2cellTs2cell wraps MEOS C function tne_s2cell_ts2cell. +func TneS2cellTs2cell(cell uint64, temp *Temporal) (_r0 *Temporal, _err error) { + C.meos_errno_reset() + _cret := C.tne_s2cell_ts2cell(C.uint64_t(cell), temp._inner) + if _err = meosError(); _err != nil { + return + } + return &Temporal{_inner: _cret}, nil +} + + +// TneTs2cellS2cell wraps MEOS C function tne_ts2cell_s2cell. +func TneTs2cellS2cell(temp *Temporal, cell uint64) (_r0 *Temporal, _err error) { + C.meos_errno_reset() + _cret := C.tne_ts2cell_s2cell(temp._inner, C.uint64_t(cell)) + if _err = meosError(); _err != nil { + return + } + return &Temporal{_inner: _cret}, nil +} + + +// TneTs2cellTs2cell wraps MEOS C function tne_ts2cell_ts2cell. +func TneTs2cellTs2cell(temp1 *Temporal, temp2 *Temporal) (_r0 *Temporal, _err error) { + C.meos_errno_reset() + _cret := C.tne_ts2cell_ts2cell(temp1._inner, temp2._inner) + if _err = meosError(); _err != nil { + return + } + return &Temporal{_inner: _cret}, nil +} + + +// Ts2cellCellToToken wraps MEOS C function ts2cell_cell_to_token. +func Ts2cellCellToToken(temp *Temporal) (_r0 *Temporal, _err error) { + C.meos_errno_reset() + _cret := C.ts2cell_cell_to_token(temp._inner) + if _err = meosError(); _err != nil { + return + } + return &Temporal{_inner: _cret}, nil +} + diff --git a/functions/meos_pg_bool.go b/functions/meos_pg_bool.go new file mode 100644 index 0000000..f641a68 --- /dev/null +++ b/functions/meos_pg_bool.go @@ -0,0 +1,205 @@ +package functions + +/* +#include +#include "meos.h" +#include "meos_catalog.h" +#include "meos_cbuffer.h" +#include "meos_cellindex.h" +#include "meos_geo.h" +#include "meos_h3.h" +#include "meos_internal.h" +#include "meos_internal_geo.h" +#include "meos_json.h" +#include "meos_npoint.h" +#include "meos_pointcloud.h" +#include "meos_pose.h" +#include "meos_quadbin.h" +#include "meos_raster.h" +#include "meos_rgeo.h" +#include "meos_s2cell.h" +#include "pg_basetypes.h" +#include "pg_bool.h" +#include "pg_date.h" +#include "pg_float.h" +#include "pg_int.h" +#include "pg_interval.h" +#include "pg_text.h" +#include "pg_time.h" +#include "pg_timestamp.h" + +// cgo reads C.union_* as a union TYPE; alias the union operators so C.g resolves them as functions. +#define gunion_bigint_set union_bigint_set +#define gunion_bigint_span union_bigint_span +#define gunion_bigint_spanset union_bigint_spanset +#define gunion_cbuffer_set union_cbuffer_set +#define gunion_date_set union_date_set +#define gunion_date_span union_date_span +#define gunion_date_spanset union_date_spanset +#define gunion_float_set union_float_set +#define gunion_float_span union_float_span +#define gunion_float_spanset union_float_spanset +#define gunion_geo_set union_geo_set +#define gunion_h3index_set union_h3index_set +#define gunion_int_set union_int_set +#define gunion_int_span union_int_span +#define gunion_int_spanset union_int_spanset +#define gunion_jsonb_set union_jsonb_set +#define gunion_npoint_set union_npoint_set +#define gunion_pcpatch_set union_pcpatch_set +#define gunion_pcpoint_set union_pcpoint_set +#define gunion_pose_set union_pose_set +#define gunion_posechain_set union_posechain_set +#define gunion_quadbin_set union_quadbin_set +#define gunion_s2cell_set union_s2cell_set +#define gunion_set_bigint union_set_bigint +#define gunion_set_cbuffer union_set_cbuffer +#define gunion_set_date union_set_date +#define gunion_set_float union_set_float +#define gunion_set_geo union_set_geo +#define gunion_set_h3index union_set_h3index +#define gunion_set_int union_set_int +#define gunion_set_jsonb union_set_jsonb +#define gunion_set_npoint union_set_npoint +#define gunion_set_pcpatch union_set_pcpatch +#define gunion_set_pcpoint union_set_pcpoint +#define gunion_set_pose union_set_pose +#define gunion_set_posechain union_set_posechain +#define gunion_set_quadbin union_set_quadbin +#define gunion_set_s2cell union_set_s2cell +#define gunion_set_set union_set_set +#define gunion_set_text union_set_text +#define gunion_set_timestamptz union_set_timestamptz +#define gunion_set_value union_set_value +#define gunion_span_bigint union_span_bigint +#define gunion_span_date union_span_date +#define gunion_span_float union_span_float +#define gunion_span_int union_span_int +#define gunion_span_span union_span_span +#define gunion_span_spanset union_span_spanset +#define gunion_span_timestamptz union_span_timestamptz +#define gunion_span_value union_span_value +#define gunion_spanset_bigint union_spanset_bigint +#define gunion_spanset_date union_spanset_date +#define gunion_spanset_float union_spanset_float +#define gunion_spanset_int union_spanset_int +#define gunion_spanset_span union_spanset_span +#define gunion_spanset_spanset union_spanset_spanset +#define gunion_spanset_timestamptz union_spanset_timestamptz +#define gunion_spanset_value union_spanset_value +#define gunion_stbox_stbox union_stbox_stbox +#define gunion_tbox_tbox union_tbox_tbox +#define gunion_text_set union_text_set +#define gunion_timestamptz_set union_timestamptz_set +#define gunion_timestamptz_span union_timestamptz_span +#define gunion_timestamptz_spanset union_timestamptz_spanset +#define gunion_tpcbox_tpcbox union_tpcbox_tpcbox +#define gunion_value_set union_value_set +#define gunion_value_span union_value_span +#define gunion_value_spanset union_value_spanset +*/ +import "C" +import ( + "unsafe" +) + +var _ = unsafe.Pointer(nil) + +// BoolEq wraps MEOS C function bool_eq. +func BoolEq(arg1 bool, arg2 bool) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.bool_eq(C.bool(arg1), C.bool(arg2)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// BoolGe wraps MEOS C function bool_ge. +func BoolGe(arg1 bool, arg2 bool) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.bool_ge(C.bool(arg1), C.bool(arg2)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// BoolGt wraps MEOS C function bool_gt. +func BoolGt(arg1 bool, arg2 bool) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.bool_gt(C.bool(arg1), C.bool(arg2)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// BoolHash wraps MEOS C function bool_hash. +func BoolHash(arg bool) (_r0 uint32, _err error) { + C.meos_errno_reset() + _cret := C.bool_hash(C.bool(arg)) + if _err = meosError(); _err != nil { + return + } + return uint32(_cret), nil +} + + +// BoolHashExtended wraps MEOS C function bool_hash_extended. +func BoolHashExtended(arg bool, seed int64) (_r0 uint64, _err error) { + C.meos_errno_reset() + _cret := C.bool_hash_extended(C.bool(arg), C.int64_t(seed)) + if _err = meosError(); _err != nil { + return + } + return uint64(_cret), nil +} + + +// BoolLe wraps MEOS C function bool_le. +func BoolLe(arg1 bool, arg2 bool) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.bool_le(C.bool(arg1), C.bool(arg2)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// BoolLt wraps MEOS C function bool_lt. +func BoolLt(arg1 bool, arg2 bool) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.bool_lt(C.bool(arg1), C.bool(arg2)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// BoolNe wraps MEOS C function bool_ne. +func BoolNe(arg1 bool, arg2 bool) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.bool_ne(C.bool(arg1), C.bool(arg2)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// BoolToText wraps MEOS C function bool_to_text. +func BoolToText(b bool) (_r0 string, _err error) { + C.meos_errno_reset() + _cret := C.bool_to_text(C.bool(b)) + if _err = meosError(); _err != nil { + return + } + return C.GoString(C.text_to_cstring(_cret)), nil +} + diff --git a/functions/meos_pg_date.go b/functions/meos_pg_date.go new file mode 100644 index 0000000..8149878 --- /dev/null +++ b/functions/meos_pg_date.go @@ -0,0 +1,671 @@ +package functions + +/* +#include +#include "meos.h" +#include "meos_catalog.h" +#include "meos_cbuffer.h" +#include "meos_cellindex.h" +#include "meos_geo.h" +#include "meos_h3.h" +#include "meos_internal.h" +#include "meos_internal_geo.h" +#include "meos_json.h" +#include "meos_npoint.h" +#include "meos_pointcloud.h" +#include "meos_pose.h" +#include "meos_quadbin.h" +#include "meos_raster.h" +#include "meos_rgeo.h" +#include "meos_s2cell.h" +#include "pg_basetypes.h" +#include "pg_bool.h" +#include "pg_date.h" +#include "pg_float.h" +#include "pg_int.h" +#include "pg_interval.h" +#include "pg_text.h" +#include "pg_time.h" +#include "pg_timestamp.h" + +// cgo reads C.union_* as a union TYPE; alias the union operators so C.g resolves them as functions. +#define gunion_bigint_set union_bigint_set +#define gunion_bigint_span union_bigint_span +#define gunion_bigint_spanset union_bigint_spanset +#define gunion_cbuffer_set union_cbuffer_set +#define gunion_date_set union_date_set +#define gunion_date_span union_date_span +#define gunion_date_spanset union_date_spanset +#define gunion_float_set union_float_set +#define gunion_float_span union_float_span +#define gunion_float_spanset union_float_spanset +#define gunion_geo_set union_geo_set +#define gunion_h3index_set union_h3index_set +#define gunion_int_set union_int_set +#define gunion_int_span union_int_span +#define gunion_int_spanset union_int_spanset +#define gunion_jsonb_set union_jsonb_set +#define gunion_npoint_set union_npoint_set +#define gunion_pcpatch_set union_pcpatch_set +#define gunion_pcpoint_set union_pcpoint_set +#define gunion_pose_set union_pose_set +#define gunion_posechain_set union_posechain_set +#define gunion_quadbin_set union_quadbin_set +#define gunion_s2cell_set union_s2cell_set +#define gunion_set_bigint union_set_bigint +#define gunion_set_cbuffer union_set_cbuffer +#define gunion_set_date union_set_date +#define gunion_set_float union_set_float +#define gunion_set_geo union_set_geo +#define gunion_set_h3index union_set_h3index +#define gunion_set_int union_set_int +#define gunion_set_jsonb union_set_jsonb +#define gunion_set_npoint union_set_npoint +#define gunion_set_pcpatch union_set_pcpatch +#define gunion_set_pcpoint union_set_pcpoint +#define gunion_set_pose union_set_pose +#define gunion_set_posechain union_set_posechain +#define gunion_set_quadbin union_set_quadbin +#define gunion_set_s2cell union_set_s2cell +#define gunion_set_set union_set_set +#define gunion_set_text union_set_text +#define gunion_set_timestamptz union_set_timestamptz +#define gunion_set_value union_set_value +#define gunion_span_bigint union_span_bigint +#define gunion_span_date union_span_date +#define gunion_span_float union_span_float +#define gunion_span_int union_span_int +#define gunion_span_span union_span_span +#define gunion_span_spanset union_span_spanset +#define gunion_span_timestamptz union_span_timestamptz +#define gunion_span_value union_span_value +#define gunion_spanset_bigint union_spanset_bigint +#define gunion_spanset_date union_spanset_date +#define gunion_spanset_float union_spanset_float +#define gunion_spanset_int union_spanset_int +#define gunion_spanset_span union_spanset_span +#define gunion_spanset_spanset union_spanset_spanset +#define gunion_spanset_timestamptz union_spanset_timestamptz +#define gunion_spanset_value union_spanset_value +#define gunion_stbox_stbox union_stbox_stbox +#define gunion_tbox_tbox union_tbox_tbox +#define gunion_text_set union_text_set +#define gunion_timestamptz_set union_timestamptz_set +#define gunion_timestamptz_span union_timestamptz_span +#define gunion_timestamptz_spanset union_timestamptz_spanset +#define gunion_tpcbox_tpcbox union_tpcbox_tpcbox +#define gunion_value_set union_value_set +#define gunion_value_span union_value_span +#define gunion_value_spanset union_value_spanset +*/ +import "C" +import ( + "unsafe" +) + +var _ = unsafe.Pointer(nil) + +// AddDateInt wraps MEOS C function add_date_int. +func AddDateInt(date int32, days int32) (_r0 int32, _err error) { + C.meos_errno_reset() + _cret := C.add_date_int(C.DateADT(date), C.int32(days)) + if _err = meosError(); _err != nil { + return + } + return int32(_cret), nil +} + + +// AddDateInterval wraps MEOS C function add_date_interval. +func AddDateInterval(date int32, interv *Interval) (_r0 int32, _err error) { + C.meos_errno_reset() + _cret := C.add_date_interval(C.DateADT(date), interv._inner) + if _err = meosError(); _err != nil { + return + } + return int32(_cret), nil +} + + +// CmpDateTimestamp wraps MEOS C function cmp_date_timestamp. +func CmpDateTimestamp(date int32, ts int64) (_r0 int32, _err error) { + C.meos_errno_reset() + _cret := C.cmp_date_timestamp(C.DateADT(date), C.Timestamp(ts)) + if _err = meosError(); _err != nil { + return + } + return int32(_cret), nil +} + + +// CmpDateDate wraps MEOS C function cmp_date_date. +func CmpDateDate(date1 int32, date2 int32) (_r0 int, _err error) { + C.meos_errno_reset() + _cret := C.cmp_date_date(C.DateADT(date1), C.DateADT(date2)) + if _err = meosError(); _err != nil { + return + } + return int(_cret), nil +} + + +// CmpDateTimestamptz wraps MEOS C function cmp_date_timestamptz. +func CmpDateTimestamptz(date int32, tstz int64) (_r0 int32, _err error) { + C.meos_errno_reset() + _cret := C.cmp_date_timestamptz(C.DateADT(date), C.TimestampTz(tstz)) + if _err = meosError(); _err != nil { + return + } + return int32(_cret), nil +} + + +// CmpTimestampDate wraps MEOS C function cmp_timestamp_date. +func CmpTimestampDate(ts int64, date int32) (_r0 int32, _err error) { + C.meos_errno_reset() + _cret := C.cmp_timestamp_date(C.Timestamp(ts), C.DateADT(date)) + if _err = meosError(); _err != nil { + return + } + return int32(_cret), nil +} + + +// CmpTimestamptzDate wraps MEOS C function cmp_timestamptz_date. +func CmpTimestamptzDate(tstz int64, date int32) (_r0 int32, _err error) { + C.meos_errno_reset() + _cret := C.cmp_timestamptz_date(C.TimestampTz(tstz), C.DateADT(date)) + if _err = meosError(); _err != nil { + return + } + return int32(_cret), nil +} + + +// TODO date_extract: unsupported return type Numeric +// func DateExtract(...) { /* not yet handled by codegen */ } + + +// DateHash wraps MEOS C function date_hash. +func DateHash(date int32) (_r0 uint32, _err error) { + C.meos_errno_reset() + _cret := C.date_hash(C.DateADT(date)) + if _err = meosError(); _err != nil { + return + } + return uint32(_cret), nil +} + + +// DateHashExtended wraps MEOS C function date_hash_extended. +func DateHashExtended(date int32, seed int64) (_r0 uint64, _err error) { + C.meos_errno_reset() + _cret := C.date_hash_extended(C.DateADT(date), C.int64_t(seed)) + if _err = meosError(); _err != nil { + return + } + return uint64(_cret), nil +} + + +// DateIsFinite wraps MEOS C function date_is_finite. +func DateIsFinite(date int32) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.date_is_finite(C.DateADT(date)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// DateLarger wraps MEOS C function date_larger. +func DateLarger(date1 int32, date2 int32) (_r0 int32, _err error) { + C.meos_errno_reset() + _cret := C.date_larger(C.DateADT(date1), C.DateADT(date2)) + if _err = meosError(); _err != nil { + return + } + return int32(_cret), nil +} + + +// DateMake wraps MEOS C function date_make. +func DateMake(year int, mon int, mday int) (_r0 int32, _err error) { + C.meos_errno_reset() + _cret := C.date_make(C.int(year), C.int(mon), C.int(mday)) + if _err = meosError(); _err != nil { + return + } + return int32(_cret), nil +} + + +// DateSmaller wraps MEOS C function date_smaller. +func DateSmaller(date1 int32, date2 int32) (_r0 int32, _err error) { + C.meos_errno_reset() + _cret := C.date_smaller(C.DateADT(date1), C.DateADT(date2)) + if _err = meosError(); _err != nil { + return + } + return int32(_cret), nil +} + + +// DateTimeToTimestamp wraps MEOS C function date_time_to_timestamp. +func DateTimeToTimestamp(date int32, time int64) (_r0 int64, _err error) { + C.meos_errno_reset() + _cret := C.date_time_to_timestamp(C.DateADT(date), C.TimeADT(time)) + if _err = meosError(); _err != nil { + return + } + return int64(_cret), nil +} + + +// DateToTimestamp wraps MEOS C function date_to_timestamp. +func DateToTimestamp(date int32) (_r0 int64, _err error) { + C.meos_errno_reset() + _cret := C.date_to_timestamp(C.DateADT(date)) + if _err = meosError(); _err != nil { + return + } + return int64(_cret), nil +} + + +// DateToTimestamptz wraps MEOS C function date_to_timestamptz. +func DateToTimestamptz(date int32) (_r0 int64, _err error) { + C.meos_errno_reset() + _cret := C.date_to_timestamptz(C.DateADT(date)) + if _err = meosError(); _err != nil { + return + } + return int64(_cret), nil +} + + +// EqDateDate wraps MEOS C function eq_date_date. +func EqDateDate(date1 int32, date2 int32) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.eq_date_date(C.DateADT(date1), C.DateADT(date2)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// EqDateTimestamp wraps MEOS C function eq_date_timestamp. +func EqDateTimestamp(date int32, ts int64) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.eq_date_timestamp(C.DateADT(date), C.Timestamp(ts)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// EqDateTimestamptz wraps MEOS C function eq_date_timestamptz. +func EqDateTimestamptz(date int32, tstz int64) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.eq_date_timestamptz(C.DateADT(date), C.TimestampTz(tstz)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// EqTimestampDate wraps MEOS C function eq_timestamp_date. +func EqTimestampDate(ts int64, date int32) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.eq_timestamp_date(C.Timestamp(ts), C.DateADT(date)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// EqTimestamptzDate wraps MEOS C function eq_timestamptz_date. +func EqTimestamptzDate(tstz int64, date int32) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.eq_timestamptz_date(C.TimestampTz(tstz), C.DateADT(date)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// GeDateDate wraps MEOS C function ge_date_date. +func GeDateDate(date1 int32, date2 int32) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.ge_date_date(C.DateADT(date1), C.DateADT(date2)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// GeDateTimestamp wraps MEOS C function ge_date_timestamp. +func GeDateTimestamp(date int32, ts int64) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.ge_date_timestamp(C.DateADT(date), C.Timestamp(ts)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// GeDateTimestamptz wraps MEOS C function ge_date_timestamptz. +func GeDateTimestamptz(date int32, tstz int64) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.ge_date_timestamptz(C.DateADT(date), C.TimestampTz(tstz)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// GeTimestampDate wraps MEOS C function ge_timestamp_date. +func GeTimestampDate(ts int64, date int32) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.ge_timestamp_date(C.Timestamp(ts), C.DateADT(date)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// GeTimestamptzDate wraps MEOS C function ge_timestamptz_date. +func GeTimestamptzDate(tstz int64, date int32) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.ge_timestamptz_date(C.TimestampTz(tstz), C.DateADT(date)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// GtDateDate wraps MEOS C function gt_date_date. +func GtDateDate(date1 int32, date2 int32) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.gt_date_date(C.DateADT(date1), C.DateADT(date2)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// GtDateTimestamp wraps MEOS C function gt_date_timestamp. +func GtDateTimestamp(date int32, ts int64) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.gt_date_timestamp(C.DateADT(date), C.Timestamp(ts)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// GtDateTimestamptz wraps MEOS C function gt_date_timestamptz. +func GtDateTimestamptz(date int32, tstz int64) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.gt_date_timestamptz(C.DateADT(date), C.TimestampTz(tstz)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// GtTimestampDate wraps MEOS C function gt_timestamp_date. +func GtTimestampDate(ts int64, date int32) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.gt_timestamp_date(C.Timestamp(ts), C.DateADT(date)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// GtTimestamptzDate wraps MEOS C function gt_timestamptz_date. +func GtTimestamptzDate(tstz int64, date int32) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.gt_timestamptz_date(C.TimestampTz(tstz), C.DateADT(date)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// LeDateDate wraps MEOS C function le_date_date. +func LeDateDate(date1 int32, date2 int32) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.le_date_date(C.DateADT(date1), C.DateADT(date2)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// LeDateTimestamp wraps MEOS C function le_date_timestamp. +func LeDateTimestamp(date int32, ts int64) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.le_date_timestamp(C.DateADT(date), C.Timestamp(ts)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// LeDateTimestamptz wraps MEOS C function le_date_timestamptz. +func LeDateTimestamptz(date int32, tstz int64) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.le_date_timestamptz(C.DateADT(date), C.TimestampTz(tstz)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// LeTimestampDate wraps MEOS C function le_timestamp_date. +func LeTimestampDate(ts int64, date int32) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.le_timestamp_date(C.Timestamp(ts), C.DateADT(date)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// LeTimestamptzDate wraps MEOS C function le_timestamptz_date. +func LeTimestamptzDate(tstz int64, date int32) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.le_timestamptz_date(C.TimestampTz(tstz), C.DateADT(date)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// LtDateDate wraps MEOS C function lt_date_date. +func LtDateDate(date1 int32, date2 int32) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.lt_date_date(C.DateADT(date1), C.DateADT(date2)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// LtDateTimestamp wraps MEOS C function lt_date_timestamp. +func LtDateTimestamp(date int32, ts int64) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.lt_date_timestamp(C.DateADT(date), C.Timestamp(ts)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// LtDateTimestamptz wraps MEOS C function lt_date_timestamptz. +func LtDateTimestamptz(date int32, tstz int64) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.lt_date_timestamptz(C.DateADT(date), C.TimestampTz(tstz)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// LtTimestampDate wraps MEOS C function lt_timestamp_date. +func LtTimestampDate(ts int64, date int32) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.lt_timestamp_date(C.Timestamp(ts), C.DateADT(date)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// LtTimestamptzDate wraps MEOS C function lt_timestamptz_date. +func LtTimestamptzDate(tstz int64, date int32) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.lt_timestamptz_date(C.TimestampTz(tstz), C.DateADT(date)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// MinusDateDate wraps MEOS C function minus_date_date. +func MinusDateDate(date1 int32, date2 int32) (_r0 int32, _err error) { + C.meos_errno_reset() + _cret := C.minus_date_date(C.DateADT(date1), C.DateADT(date2)) + if _err = meosError(); _err != nil { + return + } + return int32(_cret), nil +} + + +// MinusDateInt wraps MEOS C function minus_date_int. +func MinusDateInt(date int32, days int32) (_r0 int32, _err error) { + C.meos_errno_reset() + _cret := C.minus_date_int(C.DateADT(date), C.int32(days)) + if _err = meosError(); _err != nil { + return + } + return int32(_cret), nil +} + + +// MinusDateInterval wraps MEOS C function minus_date_interval. +func MinusDateInterval(date int32, span *Interval) (_r0 int32, _err error) { + C.meos_errno_reset() + _cret := C.minus_date_interval(C.DateADT(date), span._inner) + if _err = meosError(); _err != nil { + return + } + return int32(_cret), nil +} + + +// NeDateDate wraps MEOS C function ne_date_date. +func NeDateDate(date1 int32, date2 int32) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.ne_date_date(C.DateADT(date1), C.DateADT(date2)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// NeDateTimestamp wraps MEOS C function ne_date_timestamp. +func NeDateTimestamp(date int32, ts int64) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.ne_date_timestamp(C.DateADT(date), C.Timestamp(ts)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// NeDateTimestamptz wraps MEOS C function ne_date_timestamptz. +func NeDateTimestamptz(date int32, tstz int64) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.ne_date_timestamptz(C.DateADT(date), C.TimestampTz(tstz)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// NeTimestampDate wraps MEOS C function ne_timestamp_date. +func NeTimestampDate(ts int64, date int32) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.ne_timestamp_date(C.Timestamp(ts), C.DateADT(date)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// NeTimestamptzDate wraps MEOS C function ne_timestamptz_date. +func NeTimestamptzDate(tstz int64, date int32) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.ne_timestamptz_date(C.TimestampTz(tstz), C.DateADT(date)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// TimestampToDate wraps MEOS C function timestamp_to_date. +func TimestampToDate(ts int64) (_r0 int32, _err error) { + C.meos_errno_reset() + _cret := C.timestamp_to_date(C.Timestamp(ts)) + if _err = meosError(); _err != nil { + return + } + return int32(_cret), nil +} + + +// TimestamptzToDate wraps MEOS C function timestamptz_to_date. +func TimestamptzToDate(tstz int64) (_r0 int32, _err error) { + C.meos_errno_reset() + _cret := C.timestamptz_to_date(C.TimestampTz(tstz)) + if _err = meosError(); _err != nil { + return + } + return int32(_cret), nil +} + diff --git a/functions/meos_pg_float.go b/functions/meos_pg_float.go new file mode 100644 index 0000000..a2b6e82 --- /dev/null +++ b/functions/meos_pg_float.go @@ -0,0 +1,542 @@ +package functions + +/* +#include +#include "meos.h" +#include "meos_catalog.h" +#include "meos_cbuffer.h" +#include "meos_cellindex.h" +#include "meos_geo.h" +#include "meos_h3.h" +#include "meos_internal.h" +#include "meos_internal_geo.h" +#include "meos_json.h" +#include "meos_npoint.h" +#include "meos_pointcloud.h" +#include "meos_pose.h" +#include "meos_quadbin.h" +#include "meos_raster.h" +#include "meos_rgeo.h" +#include "meos_s2cell.h" +#include "pg_basetypes.h" +#include "pg_bool.h" +#include "pg_date.h" +#include "pg_float.h" +#include "pg_int.h" +#include "pg_interval.h" +#include "pg_text.h" +#include "pg_time.h" +#include "pg_timestamp.h" + +// cgo reads C.union_* as a union TYPE; alias the union operators so C.g resolves them as functions. +#define gunion_bigint_set union_bigint_set +#define gunion_bigint_span union_bigint_span +#define gunion_bigint_spanset union_bigint_spanset +#define gunion_cbuffer_set union_cbuffer_set +#define gunion_date_set union_date_set +#define gunion_date_span union_date_span +#define gunion_date_spanset union_date_spanset +#define gunion_float_set union_float_set +#define gunion_float_span union_float_span +#define gunion_float_spanset union_float_spanset +#define gunion_geo_set union_geo_set +#define gunion_h3index_set union_h3index_set +#define gunion_int_set union_int_set +#define gunion_int_span union_int_span +#define gunion_int_spanset union_int_spanset +#define gunion_jsonb_set union_jsonb_set +#define gunion_npoint_set union_npoint_set +#define gunion_pcpatch_set union_pcpatch_set +#define gunion_pcpoint_set union_pcpoint_set +#define gunion_pose_set union_pose_set +#define gunion_posechain_set union_posechain_set +#define gunion_quadbin_set union_quadbin_set +#define gunion_s2cell_set union_s2cell_set +#define gunion_set_bigint union_set_bigint +#define gunion_set_cbuffer union_set_cbuffer +#define gunion_set_date union_set_date +#define gunion_set_float union_set_float +#define gunion_set_geo union_set_geo +#define gunion_set_h3index union_set_h3index +#define gunion_set_int union_set_int +#define gunion_set_jsonb union_set_jsonb +#define gunion_set_npoint union_set_npoint +#define gunion_set_pcpatch union_set_pcpatch +#define gunion_set_pcpoint union_set_pcpoint +#define gunion_set_pose union_set_pose +#define gunion_set_posechain union_set_posechain +#define gunion_set_quadbin union_set_quadbin +#define gunion_set_s2cell union_set_s2cell +#define gunion_set_set union_set_set +#define gunion_set_text union_set_text +#define gunion_set_timestamptz union_set_timestamptz +#define gunion_set_value union_set_value +#define gunion_span_bigint union_span_bigint +#define gunion_span_date union_span_date +#define gunion_span_float union_span_float +#define gunion_span_int union_span_int +#define gunion_span_span union_span_span +#define gunion_span_spanset union_span_spanset +#define gunion_span_timestamptz union_span_timestamptz +#define gunion_span_value union_span_value +#define gunion_spanset_bigint union_spanset_bigint +#define gunion_spanset_date union_spanset_date +#define gunion_spanset_float union_spanset_float +#define gunion_spanset_int union_spanset_int +#define gunion_spanset_span union_spanset_span +#define gunion_spanset_spanset union_spanset_spanset +#define gunion_spanset_timestamptz union_spanset_timestamptz +#define gunion_spanset_value union_spanset_value +#define gunion_stbox_stbox union_stbox_stbox +#define gunion_tbox_tbox union_tbox_tbox +#define gunion_text_set union_text_set +#define gunion_timestamptz_set union_timestamptz_set +#define gunion_timestamptz_span union_timestamptz_span +#define gunion_timestamptz_spanset union_timestamptz_spanset +#define gunion_tpcbox_tpcbox union_tpcbox_tpcbox +#define gunion_value_set union_value_set +#define gunion_value_span union_value_span +#define gunion_value_spanset union_value_spanset +*/ +import "C" +import ( + "unsafe" +) + +var _ = unsafe.Pointer(nil) + +// TODO add_float4_float4: unsupported return type float4 +// func AddFloat4Float4(...) { /* not yet handled by codegen */ } + + +// TODO add_float4_float8: unsupported return type float8 +// func AddFloat4Float8(...) { /* not yet handled by codegen */ } + + +// TODO add_float8_float4: unsupported return type float8 +// func AddFloat8Float4(...) { /* not yet handled by codegen */ } + + +// TODO add_float8_float8: unsupported return type float8 +// func AddFloat8Float8(...) { /* not yet handled by codegen */ } + + +// TODO div_float4_float4: unsupported return type float4 +// func DivFloat4Float4(...) { /* not yet handled by codegen */ } + + +// TODO div_float4_float8: unsupported return type float8 +// func DivFloat4Float8(...) { /* not yet handled by codegen */ } + + +// TODO div_float8_float4: unsupported return type float8 +// func DivFloat8Float4(...) { /* not yet handled by codegen */ } + + +// TODO div_float8_float8: unsupported return type float8 +// func DivFloat8Float8(...) { /* not yet handled by codegen */ } + + +// TODO eq_float4_float4: unsupported param float4 +// func EqFloat4Float4(...) { /* not yet handled by codegen */ } + + +// TODO eq_float4_float8: unsupported param float4 +// func EqFloat4Float8(...) { /* not yet handled by codegen */ } + + +// TODO eq_float8_float4: unsupported param float8 +// func EqFloat8Float4(...) { /* not yet handled by codegen */ } + + +// TODO eq_float8_float8: unsupported param float8 +// func EqFloat8Float8(...) { /* not yet handled by codegen */ } + + +// TODO float4_abs: unsupported return type float4 +// func Float4Abs(...) { /* not yet handled by codegen */ } + + +// TODO float4_cmp: unsupported param float4 +// func Float4Cmp(...) { /* not yet handled by codegen */ } + + +// TODO float4_hash: unsupported param float4 +// func Float4Hash(...) { /* not yet handled by codegen */ } + + +// TODO float4_hash_extended: unsupported param float4 +// func Float4HashExtended(...) { /* not yet handled by codegen */ } + + +// TODO float4_in: unsupported return type float4 +// func Float4In(...) { /* not yet handled by codegen */ } + + +// TODO float4_larger: unsupported return type float4 +// func Float4Larger(...) { /* not yet handled by codegen */ } + + +// TODO float4_out: unsupported param float4 +// func Float4Out(...) { /* not yet handled by codegen */ } + + +// TODO float4_smaller: unsupported return type float4 +// func Float4Smaller(...) { /* not yet handled by codegen */ } + + +// TODO float4_to_float8: unsupported return type float8 +// func Float4ToFloat8(...) { /* not yet handled by codegen */ } + + +// TODO float4_to_int16: unsupported param float4 +// func Float4ToInt16(...) { /* not yet handled by codegen */ } + + +// TODO float4_to_int32: unsupported param float4 +// func Float4ToInt32(...) { /* not yet handled by codegen */ } + + +// TODO float4_um: unsupported return type float4 +// func Float4Um(...) { /* not yet handled by codegen */ } + + +// TODO float4_up: unsupported return type float4 +// func Float4Up(...) { /* not yet handled by codegen */ } + + +// TODO float8_abs: unsupported return type float8 +// func Float8Abs(...) { /* not yet handled by codegen */ } + + +// TODO float8_acos: unsupported return type float8 +// func Float8Acos(...) { /* not yet handled by codegen */ } + + +// TODO float8_acosd: unsupported return type float8 +// func Float8Acosd(...) { /* not yet handled by codegen */ } + + +// TODO float8_acosh: unsupported return type float8 +// func Float8Acosh(...) { /* not yet handled by codegen */ } + + +// TODO float8_asin: unsupported return type float8 +// func Float8Asin(...) { /* not yet handled by codegen */ } + + +// TODO float8_asind: unsupported return type float8 +// func Float8Asind(...) { /* not yet handled by codegen */ } + + +// TODO float8_asinh: unsupported return type float8 +// func Float8Asinh(...) { /* not yet handled by codegen */ } + + +// TODO float8_atan: unsupported return type float8 +// func Float8Atan(...) { /* not yet handled by codegen */ } + + +// TODO float8_atan2: unsupported return type float8 +// func Float8Atan2(...) { /* not yet handled by codegen */ } + + +// TODO float8_atan2d: unsupported return type float8 +// func Float8Atan2d(...) { /* not yet handled by codegen */ } + + +// TODO float8_atand: unsupported return type float8 +// func Float8Atand(...) { /* not yet handled by codegen */ } + + +// TODO float8_atanh: unsupported return type float8 +// func Float8Atanh(...) { /* not yet handled by codegen */ } + + +// TODO float8_cbrt: unsupported return type float8 +// func Float8Cbrt(...) { /* not yet handled by codegen */ } + + +// TODO float8_ceil: unsupported return type float8 +// func Float8Ceil(...) { /* not yet handled by codegen */ } + + +// TODO float8_cmp: unsupported param float8 +// func Float8Cmp(...) { /* not yet handled by codegen */ } + + +// TODO float8_cos: unsupported return type float8 +// func Float8Cos(...) { /* not yet handled by codegen */ } + + +// TODO float8_cosd: unsupported return type float8 +// func Float8Cosd(...) { /* not yet handled by codegen */ } + + +// TODO float8_cosh: unsupported return type float8 +// func Float8Cosh(...) { /* not yet handled by codegen */ } + + +// TODO float8_cot: unsupported return type float8 +// func Float8Cot(...) { /* not yet handled by codegen */ } + + +// TODO float8_cotd: unsupported return type float8 +// func Float8Cotd(...) { /* not yet handled by codegen */ } + + +// TODO float8_degrees: unsupported return type float8 +// func Float8Degrees(...) { /* not yet handled by codegen */ } + + +// TODO float8_exp: unsupported return type float8 +// func Float8Exp(...) { /* not yet handled by codegen */ } + + +// TODO float8_floor: unsupported return type float8 +// func Float8Floor(...) { /* not yet handled by codegen */ } + + +// TODO float8_gamma: unsupported return type float8 +// func Float8Gamma(...) { /* not yet handled by codegen */ } + + +// TODO float8_hash: unsupported param float8 +// func Float8Hash(...) { /* not yet handled by codegen */ } + + +// TODO float8_hash_extended: unsupported param float8 +// func Float8HashExtended(...) { /* not yet handled by codegen */ } + + +// TODO float8_in: unsupported return type float8 +// func Float8In(...) { /* not yet handled by codegen */ } + + +// TODO float8_larger: unsupported return type float8 +// func Float8Larger(...) { /* not yet handled by codegen */ } + + +// TODO float8_lgamma: unsupported return type float8 +// func Float8Lgamma(...) { /* not yet handled by codegen */ } + + +// TODO float8_ln: unsupported return type float8 +// func Float8Ln(...) { /* not yet handled by codegen */ } + + +// TODO float8_log10: unsupported return type float8 +// func Float8Log10(...) { /* not yet handled by codegen */ } + + +// TODO float8_pi: unsupported return type float8 +// func Float8Pi(...) { /* not yet handled by codegen */ } + + +// TODO float8_pow: unsupported return type float8 +// func Float8Pow(...) { /* not yet handled by codegen */ } + + +// TODO float8_radians: unsupported return type float8 +// func Float8Radians(...) { /* not yet handled by codegen */ } + + +// TODO float8_rint: unsupported return type float8 +// func Float8Rint(...) { /* not yet handled by codegen */ } + + +// TODO float8_round: unsupported return type float8 +// func Float8Round(...) { /* not yet handled by codegen */ } + + +// TODO float8_sign: unsupported return type float8 +// func Float8Sign(...) { /* not yet handled by codegen */ } + + +// TODO float8_sin: unsupported return type float8 +// func Float8Sin(...) { /* not yet handled by codegen */ } + + +// TODO float8_sind: unsupported return type float8 +// func Float8Sind(...) { /* not yet handled by codegen */ } + + +// TODO float8_sinh: unsupported return type float8 +// func Float8Sinh(...) { /* not yet handled by codegen */ } + + +// TODO float8_smaller: unsupported return type float8 +// func Float8Smaller(...) { /* not yet handled by codegen */ } + + +// TODO float8_sqrt: unsupported return type float8 +// func Float8Sqrt(...) { /* not yet handled by codegen */ } + + +// TODO float8_tan: unsupported return type float8 +// func Float8Tan(...) { /* not yet handled by codegen */ } + + +// TODO float8_tand: unsupported return type float8 +// func Float8Tand(...) { /* not yet handled by codegen */ } + + +// TODO float8_tanh: unsupported return type float8 +// func Float8Tanh(...) { /* not yet handled by codegen */ } + + +// TODO float8_to_float4: unsupported return type float4 +// func Float8ToFloat4(...) { /* not yet handled by codegen */ } + + +// TODO float8_to_int16: unsupported param float8 +// func Float8ToInt16(...) { /* not yet handled by codegen */ } + + +// TODO float8_to_int32: unsupported param float8 +// func Float8ToInt32(...) { /* not yet handled by codegen */ } + + +// TODO float8_trunc: unsupported return type float8 +// func Float8Trunc(...) { /* not yet handled by codegen */ } + + +// TODO float8_um: unsupported return type float8 +// func Float8Um(...) { /* not yet handled by codegen */ } + + +// TODO float8_up: unsupported return type float8 +// func Float8Up(...) { /* not yet handled by codegen */ } + + +// TODO float8_width_bucket: unsupported param float8 +// func Float8WidthBucket(...) { /* not yet handled by codegen */ } + + +// TODO ge_float4_float4: unsupported param float4 +// func GeFloat4Float4(...) { /* not yet handled by codegen */ } + + +// TODO ge_float4_float8: unsupported param float4 +// func GeFloat4Float8(...) { /* not yet handled by codegen */ } + + +// TODO ge_float8_float4: unsupported param float8 +// func GeFloat8Float4(...) { /* not yet handled by codegen */ } + + +// TODO ge_float8_float8: unsupported param float8 +// func GeFloat8Float8(...) { /* not yet handled by codegen */ } + + +// TODO gt_float4_float4: unsupported param float4 +// func GtFloat4Float4(...) { /* not yet handled by codegen */ } + + +// TODO gt_float4_float8: unsupported param float4 +// func GtFloat4Float8(...) { /* not yet handled by codegen */ } + + +// TODO gt_float8_float4: unsupported param float8 +// func GtFloat8Float4(...) { /* not yet handled by codegen */ } + + +// TODO gt_float8_float8: unsupported param float8 +// func GtFloat8Float8(...) { /* not yet handled by codegen */ } + + +// TODO int16_to_float4: unsupported return type float4 +// func Int16ToFloat4(...) { /* not yet handled by codegen */ } + + +// TODO int16_to_float8: unsupported return type float8 +// func Int16ToFloat8(...) { /* not yet handled by codegen */ } + + +// TODO int32_to_float4: unsupported return type float4 +// func Int32ToFloat4(...) { /* not yet handled by codegen */ } + + +// TODO int32_to_float8: unsupported return type float8 +// func Int32ToFloat8(...) { /* not yet handled by codegen */ } + + +// TODO le_float4_float4: unsupported param float4 +// func LeFloat4Float4(...) { /* not yet handled by codegen */ } + + +// TODO le_float4_float8: unsupported param float4 +// func LeFloat4Float8(...) { /* not yet handled by codegen */ } + + +// TODO le_float8_float4: unsupported param float8 +// func LeFloat8Float4(...) { /* not yet handled by codegen */ } + + +// TODO le_float8_float8: unsupported param float8 +// func LeFloat8Float8(...) { /* not yet handled by codegen */ } + + +// TODO lt_float4_float4: unsupported param float4 +// func LtFloat4Float4(...) { /* not yet handled by codegen */ } + + +// TODO lt_float4_float8: unsupported param float4 +// func LtFloat4Float8(...) { /* not yet handled by codegen */ } + + +// TODO lt_float8_float4: unsupported param float8 +// func LtFloat8Float4(...) { /* not yet handled by codegen */ } + + +// TODO lt_float8_float8: unsupported param float8 +// func LtFloat8Float8(...) { /* not yet handled by codegen */ } + + +// TODO minus_float4_float4: unsupported return type float4 +// func MinusFloat4Float4(...) { /* not yet handled by codegen */ } + + +// TODO minus_float4_float8: unsupported return type float8 +// func MinusFloat4Float8(...) { /* not yet handled by codegen */ } + + +// TODO minus_float8_float4: unsupported return type float8 +// func MinusFloat8Float4(...) { /* not yet handled by codegen */ } + + +// TODO minus_float8_float8: unsupported return type float8 +// func MinusFloat8Float8(...) { /* not yet handled by codegen */ } + + +// TODO mul_float4_float4: unsupported return type float4 +// func MulFloat4Float4(...) { /* not yet handled by codegen */ } + + +// TODO mul_float4_float8: unsupported return type float8 +// func MulFloat4Float8(...) { /* not yet handled by codegen */ } + + +// TODO mul_float8_float4: unsupported return type float8 +// func MulFloat8Float4(...) { /* not yet handled by codegen */ } + + +// TODO mul_float8_float8: unsupported return type float8 +// func MulFloat8Float8(...) { /* not yet handled by codegen */ } + + +// TODO ne_float4_float4: unsupported param float4 +// func NeFloat4Float4(...) { /* not yet handled by codegen */ } + + +// TODO ne_float4_float8: unsupported param float4 +// func NeFloat4Float8(...) { /* not yet handled by codegen */ } + + +// TODO ne_float8_float4: unsupported param float8 +// func NeFloat8Float4(...) { /* not yet handled by codegen */ } + + +// TODO ne_float8_float8: unsupported param float8 +// func NeFloat8Float8(...) { /* not yet handled by codegen */ } + diff --git a/functions/meos_pg_int.go b/functions/meos_pg_int.go new file mode 100644 index 0000000..ba103ea --- /dev/null +++ b/functions/meos_pg_int.go @@ -0,0 +1,1836 @@ +package functions + +/* +#include +#include "meos.h" +#include "meos_catalog.h" +#include "meos_cbuffer.h" +#include "meos_cellindex.h" +#include "meos_geo.h" +#include "meos_h3.h" +#include "meos_internal.h" +#include "meos_internal_geo.h" +#include "meos_json.h" +#include "meos_npoint.h" +#include "meos_pointcloud.h" +#include "meos_pose.h" +#include "meos_quadbin.h" +#include "meos_raster.h" +#include "meos_rgeo.h" +#include "meos_s2cell.h" +#include "pg_basetypes.h" +#include "pg_bool.h" +#include "pg_date.h" +#include "pg_float.h" +#include "pg_int.h" +#include "pg_interval.h" +#include "pg_text.h" +#include "pg_time.h" +#include "pg_timestamp.h" + +// cgo reads C.union_* as a union TYPE; alias the union operators so C.g resolves them as functions. +#define gunion_bigint_set union_bigint_set +#define gunion_bigint_span union_bigint_span +#define gunion_bigint_spanset union_bigint_spanset +#define gunion_cbuffer_set union_cbuffer_set +#define gunion_date_set union_date_set +#define gunion_date_span union_date_span +#define gunion_date_spanset union_date_spanset +#define gunion_float_set union_float_set +#define gunion_float_span union_float_span +#define gunion_float_spanset union_float_spanset +#define gunion_geo_set union_geo_set +#define gunion_h3index_set union_h3index_set +#define gunion_int_set union_int_set +#define gunion_int_span union_int_span +#define gunion_int_spanset union_int_spanset +#define gunion_jsonb_set union_jsonb_set +#define gunion_npoint_set union_npoint_set +#define gunion_pcpatch_set union_pcpatch_set +#define gunion_pcpoint_set union_pcpoint_set +#define gunion_pose_set union_pose_set +#define gunion_posechain_set union_posechain_set +#define gunion_quadbin_set union_quadbin_set +#define gunion_s2cell_set union_s2cell_set +#define gunion_set_bigint union_set_bigint +#define gunion_set_cbuffer union_set_cbuffer +#define gunion_set_date union_set_date +#define gunion_set_float union_set_float +#define gunion_set_geo union_set_geo +#define gunion_set_h3index union_set_h3index +#define gunion_set_int union_set_int +#define gunion_set_jsonb union_set_jsonb +#define gunion_set_npoint union_set_npoint +#define gunion_set_pcpatch union_set_pcpatch +#define gunion_set_pcpoint union_set_pcpoint +#define gunion_set_pose union_set_pose +#define gunion_set_posechain union_set_posechain +#define gunion_set_quadbin union_set_quadbin +#define gunion_set_s2cell union_set_s2cell +#define gunion_set_set union_set_set +#define gunion_set_text union_set_text +#define gunion_set_timestamptz union_set_timestamptz +#define gunion_set_value union_set_value +#define gunion_span_bigint union_span_bigint +#define gunion_span_date union_span_date +#define gunion_span_float union_span_float +#define gunion_span_int union_span_int +#define gunion_span_span union_span_span +#define gunion_span_spanset union_span_spanset +#define gunion_span_timestamptz union_span_timestamptz +#define gunion_span_value union_span_value +#define gunion_spanset_bigint union_spanset_bigint +#define gunion_spanset_date union_spanset_date +#define gunion_spanset_float union_spanset_float +#define gunion_spanset_int union_spanset_int +#define gunion_spanset_span union_spanset_span +#define gunion_spanset_spanset union_spanset_spanset +#define gunion_spanset_timestamptz union_spanset_timestamptz +#define gunion_spanset_value union_spanset_value +#define gunion_stbox_stbox union_stbox_stbox +#define gunion_tbox_tbox union_tbox_tbox +#define gunion_text_set union_text_set +#define gunion_timestamptz_set union_timestamptz_set +#define gunion_timestamptz_span union_timestamptz_span +#define gunion_timestamptz_spanset union_timestamptz_spanset +#define gunion_tpcbox_tpcbox union_tpcbox_tpcbox +#define gunion_value_set union_value_set +#define gunion_value_span union_value_span +#define gunion_value_spanset union_value_spanset +*/ +import "C" +import ( + "unsafe" +) + +var _ = unsafe.Pointer(nil) + +// AddInt16Int16 wraps MEOS C function add_int16_int16. +func AddInt16Int16(num1 int16, num2 int16) (_r0 int16, _err error) { + C.meos_errno_reset() + _cret := C.add_int16_int16(C.int16(num1), C.int16(num2)) + if _err = meosError(); _err != nil { + return + } + return int16(_cret), nil +} + + +// AddInt16Int32 wraps MEOS C function add_int16_int32. +func AddInt16Int32(num1 int16, num2 int32) (_r0 int32, _err error) { + C.meos_errno_reset() + _cret := C.add_int16_int32(C.int16(num1), C.int32(num2)) + if _err = meosError(); _err != nil { + return + } + return int32(_cret), nil +} + + +// AddInt16Int64 wraps MEOS C function add_int16_int64. +func AddInt16Int64(num1 int16, num2 int64) (_r0 int64, _err error) { + C.meos_errno_reset() + _cret := C.add_int16_int64(C.int16(num1), C.int64_t(num2)) + if _err = meosError(); _err != nil { + return + } + return int64(_cret), nil +} + + +// AddInt32Int16 wraps MEOS C function add_int32_int16. +func AddInt32Int16(num1 int32, num2 int16) (_r0 int32, _err error) { + C.meos_errno_reset() + _cret := C.add_int32_int16(C.int32(num1), C.int16(num2)) + if _err = meosError(); _err != nil { + return + } + return int32(_cret), nil +} + + +// AddInt32Int32 wraps MEOS C function add_int32_int32. +func AddInt32Int32(num1 int32, num2 int32) (_r0 int32, _err error) { + C.meos_errno_reset() + _cret := C.add_int32_int32(C.int32(num1), C.int32(num2)) + if _err = meosError(); _err != nil { + return + } + return int32(_cret), nil +} + + +// AddInt32Int64 wraps MEOS C function add_int32_int64. +func AddInt32Int64(num1 int32, num2 int64) (_r0 int64, _err error) { + C.meos_errno_reset() + _cret := C.add_int32_int64(C.int32(num1), C.int64_t(num2)) + if _err = meosError(); _err != nil { + return + } + return int64(_cret), nil +} + + +// AddInt64Int16 wraps MEOS C function add_int64_int16. +func AddInt64Int16(num1 int64, num2 int16) (_r0 int64, _err error) { + C.meos_errno_reset() + _cret := C.add_int64_int16(C.int64_t(num1), C.int16(num2)) + if _err = meosError(); _err != nil { + return + } + return int64(_cret), nil +} + + +// AddInt64Int32 wraps MEOS C function add_int64_int32. +func AddInt64Int32(num1 int64, num2 int32) (_r0 int64, _err error) { + C.meos_errno_reset() + _cret := C.add_int64_int32(C.int64_t(num1), C.int32(num2)) + if _err = meosError(); _err != nil { + return + } + return int64(_cret), nil +} + + +// AddInt64Int64 wraps MEOS C function add_int64_int64. +func AddInt64Int64(num1 int64, num2 int64) (_r0 int64, _err error) { + C.meos_errno_reset() + _cret := C.add_int64_int64(C.int64_t(num1), C.int64_t(num2)) + if _err = meosError(); _err != nil { + return + } + return int64(_cret), nil +} + + +// BoolToInt32 wraps MEOS C function bool_to_int32. +func BoolToInt32(b bool) (_r0 int32, _err error) { + C.meos_errno_reset() + _cret := C.bool_to_int32(C.bool(b)) + if _err = meosError(); _err != nil { + return + } + return int32(_cret), nil +} + + +// DivInt16Int16 wraps MEOS C function div_int16_int16. +func DivInt16Int16(num1 int16, num2 int16) (_r0 int16, _err error) { + C.meos_errno_reset() + _cret := C.div_int16_int16(C.int16(num1), C.int16(num2)) + if _err = meosError(); _err != nil { + return + } + return int16(_cret), nil +} + + +// DivInt16Int32 wraps MEOS C function div_int16_int32. +func DivInt16Int32(num1 int16, num2 int32) (_r0 int32, _err error) { + C.meos_errno_reset() + _cret := C.div_int16_int32(C.int16(num1), C.int32(num2)) + if _err = meosError(); _err != nil { + return + } + return int32(_cret), nil +} + + +// DivInt16Int64 wraps MEOS C function div_int16_int64. +func DivInt16Int64(num1 int16, num2 int64) (_r0 int64, _err error) { + C.meos_errno_reset() + _cret := C.div_int16_int64(C.int16(num1), C.int64_t(num2)) + if _err = meosError(); _err != nil { + return + } + return int64(_cret), nil +} + + +// DivInt32Int16 wraps MEOS C function div_int32_int16. +func DivInt32Int16(num1 int32, num2 int16) (_r0 int32, _err error) { + C.meos_errno_reset() + _cret := C.div_int32_int16(C.int32(num1), C.int16(num2)) + if _err = meosError(); _err != nil { + return + } + return int32(_cret), nil +} + + +// DivInt32Int32 wraps MEOS C function div_int32_int32. +func DivInt32Int32(num1 int32, num2 int32) (_r0 int32, _err error) { + C.meos_errno_reset() + _cret := C.div_int32_int32(C.int32(num1), C.int32(num2)) + if _err = meosError(); _err != nil { + return + } + return int32(_cret), nil +} + + +// DivInt32Int64 wraps MEOS C function div_int32_int64. +func DivInt32Int64(num1 int32, num2 int64) (_r0 int64, _err error) { + C.meos_errno_reset() + _cret := C.div_int32_int64(C.int32(num1), C.int64_t(num2)) + if _err = meosError(); _err != nil { + return + } + return int64(_cret), nil +} + + +// DivInt64Int16 wraps MEOS C function div_int64_int16. +func DivInt64Int16(num1 int64, num2 int16) (_r0 int64, _err error) { + C.meos_errno_reset() + _cret := C.div_int64_int16(C.int64_t(num1), C.int16(num2)) + if _err = meosError(); _err != nil { + return + } + return int64(_cret), nil +} + + +// DivInt64Int32 wraps MEOS C function div_int64_int32. +func DivInt64Int32(num1 int64, num2 int32) (_r0 int64, _err error) { + C.meos_errno_reset() + _cret := C.div_int64_int32(C.int64_t(num1), C.int32(num2)) + if _err = meosError(); _err != nil { + return + } + return int64(_cret), nil +} + + +// DivInt64Int64 wraps MEOS C function div_int64_int64. +func DivInt64Int64(num1 int64, num2 int64) (_r0 int64, _err error) { + C.meos_errno_reset() + _cret := C.div_int64_int64(C.int64_t(num1), C.int64_t(num2)) + if _err = meosError(); _err != nil { + return + } + return int64(_cret), nil +} + + +// EqInt16Int16 wraps MEOS C function eq_int16_int16. +func EqInt16Int16(num1 int16, num2 int16) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.eq_int16_int16(C.int16(num1), C.int16(num2)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// EqInt16Int32 wraps MEOS C function eq_int16_int32. +func EqInt16Int32(num1 int16, num2 int32) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.eq_int16_int32(C.int16(num1), C.int32(num2)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// EqInt16Int64 wraps MEOS C function eq_int16_int64. +func EqInt16Int64(num1 int16, num2 int64) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.eq_int16_int64(C.int16(num1), C.int64_t(num2)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// EqInt32Int16 wraps MEOS C function eq_int32_int16. +func EqInt32Int16(num1 int32, num2 int16) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.eq_int32_int16(C.int32(num1), C.int16(num2)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// EqInt32Int32 wraps MEOS C function eq_int32_int32. +func EqInt32Int32(num1 int32, num2 int32) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.eq_int32_int32(C.int32(num1), C.int32(num2)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// EqInt32Int64 wraps MEOS C function eq_int32_int64. +func EqInt32Int64(num1 int32, num2 int64) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.eq_int32_int64(C.int32(num1), C.int64_t(num2)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// EqInt64Int16 wraps MEOS C function eq_int64_int16. +func EqInt64Int16(num1 int64, num2 int16) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.eq_int64_int16(C.int64_t(num1), C.int16(num2)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// EqInt64Int32 wraps MEOS C function eq_int64_int32. +func EqInt64Int32(num1 int64, num2 int32) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.eq_int64_int32(C.int64_t(num1), C.int32(num2)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// EqInt64Int64 wraps MEOS C function eq_int64_int64. +func EqInt64Int64(num1 int64, num2 int64) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.eq_int64_int64(C.int64_t(num1), C.int64_t(num2)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// TODO float4_to_int64: unsupported param float4 +// func Float4ToInt64(...) { /* not yet handled by codegen */ } + + +// TODO float8_to_int64: unsupported param float8 +// func Float8ToInt64(...) { /* not yet handled by codegen */ } + + +// GeInt16Int16 wraps MEOS C function ge_int16_int16. +func GeInt16Int16(num1 int16, num2 int16) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.ge_int16_int16(C.int16(num1), C.int16(num2)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// GeInt16Int32 wraps MEOS C function ge_int16_int32. +func GeInt16Int32(num1 int16, num2 int32) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.ge_int16_int32(C.int16(num1), C.int32(num2)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// GeInt16Int64 wraps MEOS C function ge_int16_int64. +func GeInt16Int64(num1 int16, num2 int64) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.ge_int16_int64(C.int16(num1), C.int64_t(num2)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// GeInt32Int16 wraps MEOS C function ge_int32_int16. +func GeInt32Int16(num1 int32, num2 int16) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.ge_int32_int16(C.int32(num1), C.int16(num2)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// GeInt32Int32 wraps MEOS C function ge_int32_int32. +func GeInt32Int32(num1 int32, num2 int32) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.ge_int32_int32(C.int32(num1), C.int32(num2)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// GeInt32Int64 wraps MEOS C function ge_int32_int64. +func GeInt32Int64(num1 int32, num2 int64) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.ge_int32_int64(C.int32(num1), C.int64_t(num2)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// GeInt64Int16 wraps MEOS C function ge_int64_int16. +func GeInt64Int16(num1 int64, num2 int16) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.ge_int64_int16(C.int64_t(num1), C.int16(num2)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// GeInt64Int32 wraps MEOS C function ge_int64_int32. +func GeInt64Int32(num1 int64, num2 int32) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.ge_int64_int32(C.int64_t(num1), C.int32(num2)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// GeInt64Int64 wraps MEOS C function ge_int64_int64. +func GeInt64Int64(num1 int64, num2 int64) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.ge_int64_int64(C.int64_t(num1), C.int64_t(num2)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// GtInt16Int16 wraps MEOS C function gt_int16_int16. +func GtInt16Int16(num1 int16, num2 int16) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.gt_int16_int16(C.int16(num1), C.int16(num2)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// GtInt16Int32 wraps MEOS C function gt_int16_int32. +func GtInt16Int32(num1 int16, num2 int32) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.gt_int16_int32(C.int16(num1), C.int32(num2)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// GtInt16Int64 wraps MEOS C function gt_int16_int64. +func GtInt16Int64(num1 int16, num2 int64) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.gt_int16_int64(C.int16(num1), C.int64_t(num2)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// GtInt32Int16 wraps MEOS C function gt_int32_int16. +func GtInt32Int16(num1 int32, num2 int16) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.gt_int32_int16(C.int32(num1), C.int16(num2)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// GtInt32Int32 wraps MEOS C function gt_int32_int32. +func GtInt32Int32(num1 int32, num2 int32) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.gt_int32_int32(C.int32(num1), C.int32(num2)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// GtInt32Int64 wraps MEOS C function gt_int32_int64. +func GtInt32Int64(num1 int32, num2 int64) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.gt_int32_int64(C.int32(num1), C.int64_t(num2)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// GtInt64Int16 wraps MEOS C function gt_int64_int16. +func GtInt64Int16(num1 int64, num2 int16) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.gt_int64_int16(C.int64_t(num1), C.int16(num2)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// GtInt64Int32 wraps MEOS C function gt_int64_int32. +func GtInt64Int32(num1 int64, num2 int32) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.gt_int64_int32(C.int64_t(num1), C.int32(num2)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// GtInt64Int64 wraps MEOS C function gt_int64_int64. +func GtInt64Int64(num1 int64, num2 int64) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.gt_int64_int64(C.int64_t(num1), C.int64_t(num2)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// Int16Abs wraps MEOS C function int16_abs. +func Int16Abs(num int16) (_r0 int16, _err error) { + C.meos_errno_reset() + _cret := C.int16_abs(C.int16(num)) + if _err = meosError(); _err != nil { + return + } + return int16(_cret), nil +} + + +// Int16And wraps MEOS C function int16_and. +func Int16And(num1 int16, num2 int16) (_r0 int16, _err error) { + C.meos_errno_reset() + _cret := C.int16_and(C.int16(num1), C.int16(num2)) + if _err = meosError(); _err != nil { + return + } + return int16(_cret), nil +} + + +// Int16Hash wraps MEOS C function int16_hash. +func Int16Hash(val int16) (_r0 uint32, _err error) { + C.meos_errno_reset() + _cret := C.int16_hash(C.int16(val)) + if _err = meosError(); _err != nil { + return + } + return uint32(_cret), nil +} + + +// Int16HashExtended wraps MEOS C function int16_hash_extended. +func Int16HashExtended(val int16, seed uint64) (_r0 uint64, _err error) { + C.meos_errno_reset() + _cret := C.int16_hash_extended(C.int16(val), C.uint64_t(seed)) + if _err = meosError(); _err != nil { + return + } + return uint64(_cret), nil +} + + +// Int16In wraps MEOS C function int16_in. +func Int16In(str string) (_r0 int16, _err error) { + _c_str := C.CString(str) + defer C.free(unsafe.Pointer(_c_str)) + C.meos_errno_reset() + _cret := C.int16_in(_c_str) + if _err = meosError(); _err != nil { + return + } + return int16(_cret), nil +} + + +// Int16Larger wraps MEOS C function int16_larger. +func Int16Larger(num1 int16, num2 int16) (_r0 int16, _err error) { + C.meos_errno_reset() + _cret := C.int16_larger(C.int16(num1), C.int16(num2)) + if _err = meosError(); _err != nil { + return + } + return int16(_cret), nil +} + + +// Int16Mod wraps MEOS C function int16_mod. +func Int16Mod(num1 int16, num2 int16) (_r0 int16, _err error) { + C.meos_errno_reset() + _cret := C.int16_mod(C.int16(num1), C.int16(num2)) + if _err = meosError(); _err != nil { + return + } + return int16(_cret), nil +} + + +// Int16Not wraps MEOS C function int16_not. +func Int16Not(num int16) (_r0 int16, _err error) { + C.meos_errno_reset() + _cret := C.int16_not(C.int16(num)) + if _err = meosError(); _err != nil { + return + } + return int16(_cret), nil +} + + +// Int16Or wraps MEOS C function int16_or. +func Int16Or(num1 int16, num2 int16) (_r0 int16, _err error) { + C.meos_errno_reset() + _cret := C.int16_or(C.int16(num1), C.int16(num2)) + if _err = meosError(); _err != nil { + return + } + return int16(_cret), nil +} + + +// Int16Out wraps MEOS C function int16_out. +func Int16Out(num int16) (_r0 string, _err error) { + C.meos_errno_reset() + _cret := C.int16_out(C.int16(num)) + if _err = meosError(); _err != nil { + return + } + defer C.free(unsafe.Pointer(_cret)) + return C.GoString(_cret), nil +} + + +// Int16Shl wraps MEOS C function int16_shl. +func Int16Shl(num1 int16, num2 int32) (_r0 int16, _err error) { + C.meos_errno_reset() + _cret := C.int16_shl(C.int16(num1), C.int32(num2)) + if _err = meosError(); _err != nil { + return + } + return int16(_cret), nil +} + + +// Int16Shr wraps MEOS C function int16_shr. +func Int16Shr(num1 int16, num2 int32) (_r0 int16, _err error) { + C.meos_errno_reset() + _cret := C.int16_shr(C.int16(num1), C.int32(num2)) + if _err = meosError(); _err != nil { + return + } + return int16(_cret), nil +} + + +// Int16Smaller wraps MEOS C function int16_smaller. +func Int16Smaller(num1 int16, num2 int16) (_r0 int16, _err error) { + C.meos_errno_reset() + _cret := C.int16_smaller(C.int16(num1), C.int16(num2)) + if _err = meosError(); _err != nil { + return + } + return int16(_cret), nil +} + + +// Int16ToInt32 wraps MEOS C function int16_to_int32. +func Int16ToInt32(num int16) (_r0 int32, _err error) { + C.meos_errno_reset() + _cret := C.int16_to_int32(C.int16(num)) + if _err = meosError(); _err != nil { + return + } + return int32(_cret), nil +} + + +// Int16ToInt64 wraps MEOS C function int16_to_int64. +func Int16ToInt64(num int16) (_r0 int64, _err error) { + C.meos_errno_reset() + _cret := C.int16_to_int64(C.int16(num)) + if _err = meosError(); _err != nil { + return + } + return int64(_cret), nil +} + + +// Int16Uminus wraps MEOS C function int16_uminus. +func Int16Uminus(num int16) (_r0 int16, _err error) { + C.meos_errno_reset() + _cret := C.int16_uminus(C.int16(num)) + if _err = meosError(); _err != nil { + return + } + return int16(_cret), nil +} + + +// Int16Uplus wraps MEOS C function int16_uplus. +func Int16Uplus(num int16) (_r0 int16, _err error) { + C.meos_errno_reset() + _cret := C.int16_uplus(C.int16(num)) + if _err = meosError(); _err != nil { + return + } + return int16(_cret), nil +} + + +// Int16Xor wraps MEOS C function int16_xor. +func Int16Xor(num1 int16, num2 int16) (_r0 int16, _err error) { + C.meos_errno_reset() + _cret := C.int16_xor(C.int16(num1), C.int16(num2)) + if _err = meosError(); _err != nil { + return + } + return int16(_cret), nil +} + + +// Int32Abs wraps MEOS C function int32_abs. +func Int32Abs(num int32) (_r0 int32, _err error) { + C.meos_errno_reset() + _cret := C.int32_abs(C.int32(num)) + if _err = meosError(); _err != nil { + return + } + return int32(_cret), nil +} + + +// Int32And wraps MEOS C function int32_and. +func Int32And(num1 int32, num2 int32) (_r0 int32, _err error) { + C.meos_errno_reset() + _cret := C.int32_and(C.int32(num1), C.int32(num2)) + if _err = meosError(); _err != nil { + return + } + return int32(_cret), nil +} + + +// Int32Cmp wraps MEOS C function int32_cmp. +func Int32Cmp(l int32, r int32) (_r0 int, _err error) { + C.meos_errno_reset() + _cret := C.int32_cmp(C.int32(l), C.int32(r)) + if _err = meosError(); _err != nil { + return + } + return int(_cret), nil +} + + +// Int32Gcd wraps MEOS C function int32_gcd. +func Int32Gcd(num1 int32, num2 int32) (_r0 int32, _err error) { + C.meos_errno_reset() + _cret := C.int32_gcd(C.int32(num1), C.int32(num2)) + if _err = meosError(); _err != nil { + return + } + return int32(_cret), nil +} + + +// Int32Hash wraps MEOS C function int32_hash. +func Int32Hash(val int32) (_r0 uint32, _err error) { + C.meos_errno_reset() + _cret := C.int32_hash(C.int32(val)) + if _err = meosError(); _err != nil { + return + } + return uint32(_cret), nil +} + + +// Int32HashExtended wraps MEOS C function int32_hash_extended. +func Int32HashExtended(val int32, seed uint64) (_r0 uint64, _err error) { + C.meos_errno_reset() + _cret := C.int32_hash_extended(C.int32(val), C.uint64_t(seed)) + if _err = meosError(); _err != nil { + return + } + return uint64(_cret), nil +} + + +// Int32In wraps MEOS C function int32_in. +func Int32In(str string) (_r0 int32, _err error) { + _c_str := C.CString(str) + defer C.free(unsafe.Pointer(_c_str)) + C.meos_errno_reset() + _cret := C.int32_in(_c_str) + if _err = meosError(); _err != nil { + return + } + return int32(_cret), nil +} + + +// Int32Inc wraps MEOS C function int32_inc. +func Int32Inc(num int32) (_r0 int32, _err error) { + C.meos_errno_reset() + _cret := C.int32_inc(C.int32(num)) + if _err = meosError(); _err != nil { + return + } + return int32(_cret), nil +} + + +// Int32Larger wraps MEOS C function int32_larger. +func Int32Larger(num1 int32, num2 int32) (_r0 int32, _err error) { + C.meos_errno_reset() + _cret := C.int32_larger(C.int32(num1), C.int32(num2)) + if _err = meosError(); _err != nil { + return + } + return int32(_cret), nil +} + + +// Int32Lcm wraps MEOS C function int32_lcm. +func Int32Lcm(num1 int32, num2 int32) (_r0 int32, _err error) { + C.meos_errno_reset() + _cret := C.int32_lcm(C.int32(num1), C.int32(num2)) + if _err = meosError(); _err != nil { + return + } + return int32(_cret), nil +} + + +// Int32Mod wraps MEOS C function int32_mod. +func Int32Mod(num1 int32, num2 int32) (_r0 int32, _err error) { + C.meos_errno_reset() + _cret := C.int32_mod(C.int32(num1), C.int32(num2)) + if _err = meosError(); _err != nil { + return + } + return int32(_cret), nil +} + + +// Int32Not wraps MEOS C function int32_not. +func Int32Not(num int32) (_r0 int32, _err error) { + C.meos_errno_reset() + _cret := C.int32_not(C.int32(num)) + if _err = meosError(); _err != nil { + return + } + return int32(_cret), nil +} + + +// Int32Or wraps MEOS C function int32_or. +func Int32Or(num1 int32, num2 int32) (_r0 int32, _err error) { + C.meos_errno_reset() + _cret := C.int32_or(C.int32(num1), C.int32(num2)) + if _err = meosError(); _err != nil { + return + } + return int32(_cret), nil +} + + +// Int32Out wraps MEOS C function int32_out. +func Int32Out(num int32) (_r0 string, _err error) { + C.meos_errno_reset() + _cret := C.int32_out(C.int32(num)) + if _err = meosError(); _err != nil { + return + } + defer C.free(unsafe.Pointer(_cret)) + return C.GoString(_cret), nil +} + + +// Int32Shl wraps MEOS C function int32_shl. +func Int32Shl(num1 int32, num2 int32) (_r0 int32, _err error) { + C.meos_errno_reset() + _cret := C.int32_shl(C.int32(num1), C.int32(num2)) + if _err = meosError(); _err != nil { + return + } + return int32(_cret), nil +} + + +// Int32Shr wraps MEOS C function int32_shr. +func Int32Shr(num1 int32, num2 int32) (_r0 int32, _err error) { + C.meos_errno_reset() + _cret := C.int32_shr(C.int32(num1), C.int32(num2)) + if _err = meosError(); _err != nil { + return + } + return int32(_cret), nil +} + + +// Int32Smaller wraps MEOS C function int32_smaller. +func Int32Smaller(num1 int32, num2 int32) (_r0 int32, _err error) { + C.meos_errno_reset() + _cret := C.int32_smaller(C.int32(num1), C.int32(num2)) + if _err = meosError(); _err != nil { + return + } + return int32(_cret), nil +} + + +// Int32ToBool wraps MEOS C function int32_to_bool. +func Int32ToBool(num int32) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.int32_to_bool(C.int32(num)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// Int32ToInt16 wraps MEOS C function int32_to_int16. +func Int32ToInt16(num int32) (_r0 int16, _err error) { + C.meos_errno_reset() + _cret := C.int32_to_int16(C.int32(num)) + if _err = meosError(); _err != nil { + return + } + return int16(_cret), nil +} + + +// Int32ToInt64 wraps MEOS C function int32_to_int64. +func Int32ToInt64(num int32) (_r0 int64, _err error) { + C.meos_errno_reset() + _cret := C.int32_to_int64(C.int32(num)) + if _err = meosError(); _err != nil { + return + } + return int64(_cret), nil +} + + +// Int32Uminus wraps MEOS C function int32_uminus. +func Int32Uminus(num int32) (_r0 int32, _err error) { + C.meos_errno_reset() + _cret := C.int32_uminus(C.int32(num)) + if _err = meosError(); _err != nil { + return + } + return int32(_cret), nil +} + + +// Int32Uplus wraps MEOS C function int32_uplus. +func Int32Uplus(num int32) (_r0 int32, _err error) { + C.meos_errno_reset() + _cret := C.int32_uplus(C.int32(num)) + if _err = meosError(); _err != nil { + return + } + return int32(_cret), nil +} + + +// Int32Xor wraps MEOS C function int32_xor. +func Int32Xor(num1 int32, num2 int32) (_r0 int32, _err error) { + C.meos_errno_reset() + _cret := C.int32_xor(C.int32(num1), C.int32(num2)) + if _err = meosError(); _err != nil { + return + } + return int32(_cret), nil +} + + +// Int64Abs wraps MEOS C function int64_abs. +func Int64Abs(num int64) (_r0 int64, _err error) { + C.meos_errno_reset() + _cret := C.int64_abs(C.int64_t(num)) + if _err = meosError(); _err != nil { + return + } + return int64(_cret), nil +} + + +// Int64And wraps MEOS C function int64_and. +func Int64And(num1 int64, num2 int64) (_r0 int64, _err error) { + C.meos_errno_reset() + _cret := C.int64_and(C.int64_t(num1), C.int64_t(num2)) + if _err = meosError(); _err != nil { + return + } + return int64(_cret), nil +} + + +// Int64Cmp wraps MEOS C function int64_cmp. +func Int64Cmp(l int64, r int64) (_r0 int, _err error) { + C.meos_errno_reset() + _cret := C.int64_cmp(C.int64_t(l), C.int64_t(r)) + if _err = meosError(); _err != nil { + return + } + return int(_cret), nil +} + + +// Int64Dec wraps MEOS C function int64_dec. +func Int64Dec(num int64) (_r0 int64, _err error) { + C.meos_errno_reset() + _cret := C.int64_dec(C.int64_t(num)) + if _err = meosError(); _err != nil { + return + } + return int64(_cret), nil +} + + +// Int64Gcd wraps MEOS C function int64_gcd. +func Int64Gcd(num1 int64, num2 int64) (_r0 int64, _err error) { + C.meos_errno_reset() + _cret := C.int64_gcd(C.int64_t(num1), C.int64_t(num2)) + if _err = meosError(); _err != nil { + return + } + return int64(_cret), nil +} + + +// Int64Hash wraps MEOS C function int64_hash. +func Int64Hash(num int64) (_r0 uint32, _err error) { + C.meos_errno_reset() + _cret := C.int64_hash(C.int64_t(num)) + if _err = meosError(); _err != nil { + return + } + return uint32(_cret), nil +} + + +// Int64HashExtended wraps MEOS C function int64_hash_extended. +func Int64HashExtended(num int64, seed uint64) (_r0 uint64, _err error) { + C.meos_errno_reset() + _cret := C.int64_hash_extended(C.int64_t(num), C.uint64_t(seed)) + if _err = meosError(); _err != nil { + return + } + return uint64(_cret), nil +} + + +// Int64In wraps MEOS C function int64_in. +func Int64In(str string) (_r0 int64, _err error) { + _c_str := C.CString(str) + defer C.free(unsafe.Pointer(_c_str)) + C.meos_errno_reset() + _cret := C.int64_in(_c_str) + if _err = meosError(); _err != nil { + return + } + return int64(_cret), nil +} + + +// Int64Inc wraps MEOS C function int64_inc. +func Int64Inc(num int64) (_r0 int64, _err error) { + C.meos_errno_reset() + _cret := C.int64_inc(C.int64_t(num)) + if _err = meosError(); _err != nil { + return + } + return int64(_cret), nil +} + + +// Int64Larger wraps MEOS C function int64_larger. +func Int64Larger(num1 int64, num2 int64) (_r0 int64, _err error) { + C.meos_errno_reset() + _cret := C.int64_larger(C.int64_t(num1), C.int64_t(num2)) + if _err = meosError(); _err != nil { + return + } + return int64(_cret), nil +} + + +// Int64Lcm wraps MEOS C function int64_lcm. +func Int64Lcm(num1 int64, num2 int64) (_r0 int64, _err error) { + C.meos_errno_reset() + _cret := C.int64_lcm(C.int64_t(num1), C.int64_t(num2)) + if _err = meosError(); _err != nil { + return + } + return int64(_cret), nil +} + + +// Int64Mod wraps MEOS C function int64_mod. +func Int64Mod(num1 int64, num2 int64) (_r0 int64, _err error) { + C.meos_errno_reset() + _cret := C.int64_mod(C.int64_t(num1), C.int64_t(num2)) + if _err = meosError(); _err != nil { + return + } + return int64(_cret), nil +} + + +// Int64Not wraps MEOS C function int64_not. +func Int64Not(num int64) (_r0 int64, _err error) { + C.meos_errno_reset() + _cret := C.int64_not(C.int64_t(num)) + if _err = meosError(); _err != nil { + return + } + return int64(_cret), nil +} + + +// Int64Or wraps MEOS C function int64_or. +func Int64Or(num1 int64, num2 int64) (_r0 int64, _err error) { + C.meos_errno_reset() + _cret := C.int64_or(C.int64_t(num1), C.int64_t(num2)) + if _err = meosError(); _err != nil { + return + } + return int64(_cret), nil +} + + +// Int64Out wraps MEOS C function int64_out. +func Int64Out(num int64) (_r0 string, _err error) { + C.meos_errno_reset() + _cret := C.int64_out(C.int64_t(num)) + if _err = meosError(); _err != nil { + return + } + defer C.free(unsafe.Pointer(_cret)) + return C.GoString(_cret), nil +} + + +// Int64Shl wraps MEOS C function int64_shl. +func Int64Shl(num1 int64, num2 int32) (_r0 int64, _err error) { + C.meos_errno_reset() + _cret := C.int64_shl(C.int64_t(num1), C.int32(num2)) + if _err = meosError(); _err != nil { + return + } + return int64(_cret), nil +} + + +// Int64Shr wraps MEOS C function int64_shr. +func Int64Shr(num1 int64, num2 int32) (_r0 int64, _err error) { + C.meos_errno_reset() + _cret := C.int64_shr(C.int64_t(num1), C.int32(num2)) + if _err = meosError(); _err != nil { + return + } + return int64(_cret), nil +} + + +// Int64Smaller wraps MEOS C function int64_smaller. +func Int64Smaller(num1 int64, num2 int64) (_r0 int64, _err error) { + C.meos_errno_reset() + _cret := C.int64_smaller(C.int64_t(num1), C.int64_t(num2)) + if _err = meosError(); _err != nil { + return + } + return int64(_cret), nil +} + + +// TODO int64_to_float4: unsupported return type float4 +// func Int64ToFloat4(...) { /* not yet handled by codegen */ } + + +// TODO int64_to_float8: unsupported return type float8 +// func Int64ToFloat8(...) { /* not yet handled by codegen */ } + + +// Int64ToInt16 wraps MEOS C function int64_to_int16. +func Int64ToInt16(num int64) (_r0 int16, _err error) { + C.meos_errno_reset() + _cret := C.int64_to_int16(C.int64_t(num)) + if _err = meosError(); _err != nil { + return + } + return int16(_cret), nil +} + + +// Int64ToInt32 wraps MEOS C function int64_to_int32. +func Int64ToInt32(num int64) (_r0 int32, _err error) { + C.meos_errno_reset() + _cret := C.int64_to_int32(C.int64_t(num)) + if _err = meosError(); _err != nil { + return + } + return int32(_cret), nil +} + + +// Int64Uminus wraps MEOS C function int64_uminus. +func Int64Uminus(num int64) (_r0 int64, _err error) { + C.meos_errno_reset() + _cret := C.int64_uminus(C.int64_t(num)) + if _err = meosError(); _err != nil { + return + } + return int64(_cret), nil +} + + +// Int64Uplus wraps MEOS C function int64_uplus. +func Int64Uplus(num int64) (_r0 int64, _err error) { + C.meos_errno_reset() + _cret := C.int64_uplus(C.int64_t(num)) + if _err = meosError(); _err != nil { + return + } + return int64(_cret), nil +} + + +// Int64Xor wraps MEOS C function int64_xor. +func Int64Xor(num1 int64, num2 int64) (_r0 int64, _err error) { + C.meos_errno_reset() + _cret := C.int64_xor(C.int64_t(num1), C.int64_t(num2)) + if _err = meosError(); _err != nil { + return + } + return int64(_cret), nil +} + + +// LeInt16Int16 wraps MEOS C function le_int16_int16. +func LeInt16Int16(num1 int16, num2 int16) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.le_int16_int16(C.int16(num1), C.int16(num2)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// LeInt16Int32 wraps MEOS C function le_int16_int32. +func LeInt16Int32(num1 int16, num2 int32) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.le_int16_int32(C.int16(num1), C.int32(num2)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// LeInt16Int64 wraps MEOS C function le_int16_int64. +func LeInt16Int64(num1 int16, num2 int64) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.le_int16_int64(C.int16(num1), C.int64_t(num2)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// LeInt32Int16 wraps MEOS C function le_int32_int16. +func LeInt32Int16(num1 int32, num2 int16) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.le_int32_int16(C.int32(num1), C.int16(num2)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// LeInt32Int32 wraps MEOS C function le_int32_int32. +func LeInt32Int32(num1 int32, num2 int32) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.le_int32_int32(C.int32(num1), C.int32(num2)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// LeInt32Int64 wraps MEOS C function le_int32_int64. +func LeInt32Int64(num1 int32, num2 int64) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.le_int32_int64(C.int32(num1), C.int64_t(num2)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// LeInt64Int16 wraps MEOS C function le_int64_int16. +func LeInt64Int16(num1 int64, num2 int16) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.le_int64_int16(C.int64_t(num1), C.int16(num2)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// LeInt64Int32 wraps MEOS C function le_int64_int32. +func LeInt64Int32(num1 int64, num2 int32) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.le_int64_int32(C.int64_t(num1), C.int32(num2)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// LeInt64Int64 wraps MEOS C function le_int64_int64. +func LeInt64Int64(num1 int64, num2 int64) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.le_int64_int64(C.int64_t(num1), C.int64_t(num2)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// LtInt16Int16 wraps MEOS C function lt_int16_int16. +func LtInt16Int16(num1 int16, num2 int16) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.lt_int16_int16(C.int16(num1), C.int16(num2)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// LtInt16Int32 wraps MEOS C function lt_int16_int32. +func LtInt16Int32(num1 int16, num2 int32) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.lt_int16_int32(C.int16(num1), C.int32(num2)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// LtInt16Int64 wraps MEOS C function lt_int16_int64. +func LtInt16Int64(num1 int16, num2 int64) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.lt_int16_int64(C.int16(num1), C.int64_t(num2)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// LtInt32Int16 wraps MEOS C function lt_int32_int16. +func LtInt32Int16(num1 int32, num2 int16) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.lt_int32_int16(C.int32(num1), C.int16(num2)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// LtInt32Int32 wraps MEOS C function lt_int32_int32. +func LtInt32Int32(num1 int32, num2 int32) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.lt_int32_int32(C.int32(num1), C.int32(num2)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// LtInt32Int64 wraps MEOS C function lt_int32_int64. +func LtInt32Int64(num1 int32, num2 int64) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.lt_int32_int64(C.int32(num1), C.int64_t(num2)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// LtInt64Int16 wraps MEOS C function lt_int64_int16. +func LtInt64Int16(num1 int64, num2 int16) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.lt_int64_int16(C.int64_t(num1), C.int16(num2)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// LtInt64Int32 wraps MEOS C function lt_int64_int32. +func LtInt64Int32(num1 int64, num2 int32) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.lt_int64_int32(C.int64_t(num1), C.int32(num2)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// LtInt64Int64 wraps MEOS C function lt_int64_int64. +func LtInt64Int64(num1 int64, num2 int64) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.lt_int64_int64(C.int64_t(num1), C.int64_t(num2)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// MinusInt16Int16 wraps MEOS C function minus_int16_int16. +func MinusInt16Int16(num1 int16, num2 int16) (_r0 int16, _err error) { + C.meos_errno_reset() + _cret := C.minus_int16_int16(C.int16(num1), C.int16(num2)) + if _err = meosError(); _err != nil { + return + } + return int16(_cret), nil +} + + +// MinusInt16Int32 wraps MEOS C function minus_int16_int32. +func MinusInt16Int32(num1 int16, num2 int32) (_r0 int32, _err error) { + C.meos_errno_reset() + _cret := C.minus_int16_int32(C.int16(num1), C.int32(num2)) + if _err = meosError(); _err != nil { + return + } + return int32(_cret), nil +} + + +// MinusInt16Int64 wraps MEOS C function minus_int16_int64. +func MinusInt16Int64(num1 int16, num2 int64) (_r0 int64, _err error) { + C.meos_errno_reset() + _cret := C.minus_int16_int64(C.int16(num1), C.int64_t(num2)) + if _err = meosError(); _err != nil { + return + } + return int64(_cret), nil +} + + +// MinusInt32Int16 wraps MEOS C function minus_int32_int16. +func MinusInt32Int16(num1 int32, num2 int16) (_r0 int32, _err error) { + C.meos_errno_reset() + _cret := C.minus_int32_int16(C.int32(num1), C.int16(num2)) + if _err = meosError(); _err != nil { + return + } + return int32(_cret), nil +} + + +// MinusInt32Int32 wraps MEOS C function minus_int32_int32. +func MinusInt32Int32(num1 int32, num2 int32) (_r0 int32, _err error) { + C.meos_errno_reset() + _cret := C.minus_int32_int32(C.int32(num1), C.int32(num2)) + if _err = meosError(); _err != nil { + return + } + return int32(_cret), nil +} + + +// MinusInt32Int64 wraps MEOS C function minus_int32_int64. +func MinusInt32Int64(num1 int32, num2 int64) (_r0 int64, _err error) { + C.meos_errno_reset() + _cret := C.minus_int32_int64(C.int32(num1), C.int64_t(num2)) + if _err = meosError(); _err != nil { + return + } + return int64(_cret), nil +} + + +// MinusInt64Int16 wraps MEOS C function minus_int64_int16. +func MinusInt64Int16(num1 int64, num2 int16) (_r0 int64, _err error) { + C.meos_errno_reset() + _cret := C.minus_int64_int16(C.int64_t(num1), C.int16(num2)) + if _err = meosError(); _err != nil { + return + } + return int64(_cret), nil +} + + +// MinusInt64Int32 wraps MEOS C function minus_int64_int32. +func MinusInt64Int32(num1 int64, num2 int32) (_r0 int64, _err error) { + C.meos_errno_reset() + _cret := C.minus_int64_int32(C.int64_t(num1), C.int32(num2)) + if _err = meosError(); _err != nil { + return + } + return int64(_cret), nil +} + + +// MinusInt64Int64 wraps MEOS C function minus_int64_int64. +func MinusInt64Int64(num1 int64, num2 int64) (_r0 int64, _err error) { + C.meos_errno_reset() + _cret := C.minus_int64_int64(C.int64_t(num1), C.int64_t(num2)) + if _err = meosError(); _err != nil { + return + } + return int64(_cret), nil +} + + +// MulInt16Int16 wraps MEOS C function mul_int16_int16. +func MulInt16Int16(num1 int16, num2 int16) (_r0 int16, _err error) { + C.meos_errno_reset() + _cret := C.mul_int16_int16(C.int16(num1), C.int16(num2)) + if _err = meosError(); _err != nil { + return + } + return int16(_cret), nil +} + + +// MulInt16Int32 wraps MEOS C function mul_int16_int32. +func MulInt16Int32(num1 int16, num2 int32) (_r0 int32, _err error) { + C.meos_errno_reset() + _cret := C.mul_int16_int32(C.int16(num1), C.int32(num2)) + if _err = meosError(); _err != nil { + return + } + return int32(_cret), nil +} + + +// MulInt16Int64 wraps MEOS C function mul_int16_int64. +func MulInt16Int64(num1 int16, num2 int64) (_r0 int64, _err error) { + C.meos_errno_reset() + _cret := C.mul_int16_int64(C.int16(num1), C.int64_t(num2)) + if _err = meosError(); _err != nil { + return + } + return int64(_cret), nil +} + + +// MulInt32Int16 wraps MEOS C function mul_int32_int16. +func MulInt32Int16(num1 int32, num2 int16) (_r0 int32, _err error) { + C.meos_errno_reset() + _cret := C.mul_int32_int16(C.int32(num1), C.int16(num2)) + if _err = meosError(); _err != nil { + return + } + return int32(_cret), nil +} + + +// MulInt32Int32 wraps MEOS C function mul_int32_int32. +func MulInt32Int32(num1 int32, num2 int32) (_r0 int32, _err error) { + C.meos_errno_reset() + _cret := C.mul_int32_int32(C.int32(num1), C.int32(num2)) + if _err = meosError(); _err != nil { + return + } + return int32(_cret), nil +} + + +// MulInt32Int64 wraps MEOS C function mul_int32_int64. +func MulInt32Int64(num1 int32, num2 int64) (_r0 int64, _err error) { + C.meos_errno_reset() + _cret := C.mul_int32_int64(C.int32(num1), C.int64_t(num2)) + if _err = meosError(); _err != nil { + return + } + return int64(_cret), nil +} + + +// MulInt64Int16 wraps MEOS C function mul_int64_int16. +func MulInt64Int16(num1 int64, num2 int16) (_r0 int64, _err error) { + C.meos_errno_reset() + _cret := C.mul_int64_int16(C.int64_t(num1), C.int16(num2)) + if _err = meosError(); _err != nil { + return + } + return int64(_cret), nil +} + + +// MulInt64Int32 wraps MEOS C function mul_int64_int32. +func MulInt64Int32(num1 int64, num2 int32) (_r0 int64, _err error) { + C.meos_errno_reset() + _cret := C.mul_int64_int32(C.int64_t(num1), C.int32(num2)) + if _err = meosError(); _err != nil { + return + } + return int64(_cret), nil +} + + +// MulInt64Int64 wraps MEOS C function mul_int64_int64. +func MulInt64Int64(num1 int64, num2 int64) (_r0 int64, _err error) { + C.meos_errno_reset() + _cret := C.mul_int64_int64(C.int64_t(num1), C.int64_t(num2)) + if _err = meosError(); _err != nil { + return + } + return int64(_cret), nil +} + + +// NeInt16Int16 wraps MEOS C function ne_int16_int16. +func NeInt16Int16(num1 int16, num2 int16) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.ne_int16_int16(C.int16(num1), C.int16(num2)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// NeInt16Int32 wraps MEOS C function ne_int16_int32. +func NeInt16Int32(num1 int16, num2 int32) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.ne_int16_int32(C.int16(num1), C.int32(num2)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// NeInt16Int64 wraps MEOS C function ne_int16_int64. +func NeInt16Int64(num1 int16, num2 int64) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.ne_int16_int64(C.int16(num1), C.int64_t(num2)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// NeInt32Int16 wraps MEOS C function ne_int32_int16. +func NeInt32Int16(num1 int32, num2 int16) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.ne_int32_int16(C.int32(num1), C.int16(num2)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// NeInt32Int32 wraps MEOS C function ne_int32_int32. +func NeInt32Int32(num1 int32, num2 int32) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.ne_int32_int32(C.int32(num1), C.int32(num2)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// NeInt32Int64 wraps MEOS C function ne_int32_int64. +func NeInt32Int64(num1 int32, num2 int64) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.ne_int32_int64(C.int32(num1), C.int64_t(num2)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// NeInt64Int16 wraps MEOS C function ne_int64_int16. +func NeInt64Int16(num1 int64, num2 int16) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.ne_int64_int16(C.int64_t(num1), C.int16(num2)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// NeInt64Int32 wraps MEOS C function ne_int64_int32. +func NeInt64Int32(num1 int64, num2 int32) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.ne_int64_int32(C.int64_t(num1), C.int32(num2)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// NeInt64Int64 wraps MEOS C function ne_int64_int64. +func NeInt64Int64(num1 int64, num2 int64) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.ne_int64_int64(C.int64_t(num1), C.int64_t(num2)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + diff --git a/functions/meos_pg_interval.go b/functions/meos_pg_interval.go new file mode 100644 index 0000000..988d214 --- /dev/null +++ b/functions/meos_pg_interval.go @@ -0,0 +1,352 @@ +package functions + +/* +#include +#include "meos.h" +#include "meos_catalog.h" +#include "meos_cbuffer.h" +#include "meos_cellindex.h" +#include "meos_geo.h" +#include "meos_h3.h" +#include "meos_internal.h" +#include "meos_internal_geo.h" +#include "meos_json.h" +#include "meos_npoint.h" +#include "meos_pointcloud.h" +#include "meos_pose.h" +#include "meos_quadbin.h" +#include "meos_raster.h" +#include "meos_rgeo.h" +#include "meos_s2cell.h" +#include "pg_basetypes.h" +#include "pg_bool.h" +#include "pg_date.h" +#include "pg_float.h" +#include "pg_int.h" +#include "pg_interval.h" +#include "pg_text.h" +#include "pg_time.h" +#include "pg_timestamp.h" + +// cgo reads C.union_* as a union TYPE; alias the union operators so C.g resolves them as functions. +#define gunion_bigint_set union_bigint_set +#define gunion_bigint_span union_bigint_span +#define gunion_bigint_spanset union_bigint_spanset +#define gunion_cbuffer_set union_cbuffer_set +#define gunion_date_set union_date_set +#define gunion_date_span union_date_span +#define gunion_date_spanset union_date_spanset +#define gunion_float_set union_float_set +#define gunion_float_span union_float_span +#define gunion_float_spanset union_float_spanset +#define gunion_geo_set union_geo_set +#define gunion_h3index_set union_h3index_set +#define gunion_int_set union_int_set +#define gunion_int_span union_int_span +#define gunion_int_spanset union_int_spanset +#define gunion_jsonb_set union_jsonb_set +#define gunion_npoint_set union_npoint_set +#define gunion_pcpatch_set union_pcpatch_set +#define gunion_pcpoint_set union_pcpoint_set +#define gunion_pose_set union_pose_set +#define gunion_posechain_set union_posechain_set +#define gunion_quadbin_set union_quadbin_set +#define gunion_s2cell_set union_s2cell_set +#define gunion_set_bigint union_set_bigint +#define gunion_set_cbuffer union_set_cbuffer +#define gunion_set_date union_set_date +#define gunion_set_float union_set_float +#define gunion_set_geo union_set_geo +#define gunion_set_h3index union_set_h3index +#define gunion_set_int union_set_int +#define gunion_set_jsonb union_set_jsonb +#define gunion_set_npoint union_set_npoint +#define gunion_set_pcpatch union_set_pcpatch +#define gunion_set_pcpoint union_set_pcpoint +#define gunion_set_pose union_set_pose +#define gunion_set_posechain union_set_posechain +#define gunion_set_quadbin union_set_quadbin +#define gunion_set_s2cell union_set_s2cell +#define gunion_set_set union_set_set +#define gunion_set_text union_set_text +#define gunion_set_timestamptz union_set_timestamptz +#define gunion_set_value union_set_value +#define gunion_span_bigint union_span_bigint +#define gunion_span_date union_span_date +#define gunion_span_float union_span_float +#define gunion_span_int union_span_int +#define gunion_span_span union_span_span +#define gunion_span_spanset union_span_spanset +#define gunion_span_timestamptz union_span_timestamptz +#define gunion_span_value union_span_value +#define gunion_spanset_bigint union_spanset_bigint +#define gunion_spanset_date union_spanset_date +#define gunion_spanset_float union_spanset_float +#define gunion_spanset_int union_spanset_int +#define gunion_spanset_span union_spanset_span +#define gunion_spanset_spanset union_spanset_spanset +#define gunion_spanset_timestamptz union_spanset_timestamptz +#define gunion_spanset_value union_spanset_value +#define gunion_stbox_stbox union_stbox_stbox +#define gunion_tbox_tbox union_tbox_tbox +#define gunion_text_set union_text_set +#define gunion_timestamptz_set union_timestamptz_set +#define gunion_timestamptz_span union_timestamptz_span +#define gunion_timestamptz_spanset union_timestamptz_spanset +#define gunion_tpcbox_tpcbox union_tpcbox_tpcbox +#define gunion_value_set union_value_set +#define gunion_value_span union_value_span +#define gunion_value_spanset union_value_spanset +*/ +import "C" +import ( + "unsafe" +) + +var _ = unsafe.Pointer(nil) + +// AddIntervalInterval wraps MEOS C function add_interval_interval. +func AddIntervalInterval(interv1 *Interval, interv2 *Interval) (_r0 *Interval, _err error) { + C.meos_errno_reset() + _cret := C.add_interval_interval(interv1._inner, interv2._inner) + if _err = meosError(); _err != nil { + return + } + return &Interval{_inner: _cret}, nil +} + + +// TODO div_interval_float8: unsupported param float8 +// func DivIntervalFloat8(...) { /* not yet handled by codegen */ } + + +// IntervalCopy wraps MEOS C function interval_copy. +func IntervalCopy(interv *Interval) (_r0 *Interval, _err error) { + C.meos_errno_reset() + _cret := C.interval_copy(interv._inner) + if _err = meosError(); _err != nil { + return + } + return &Interval{_inner: _cret}, nil +} + + +// IntervalEq wraps MEOS C function interval_eq. +func IntervalEq(interv1 *Interval, interv2 *Interval) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.interval_eq(interv1._inner, interv2._inner) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// TODO interval_extract: unsupported return type Numeric +// func IntervalExtract(...) { /* not yet handled by codegen */ } + + +// IntervalGe wraps MEOS C function interval_ge. +func IntervalGe(interv1 *Interval, interv2 *Interval) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.interval_ge(interv1._inner, interv2._inner) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// IntervalGt wraps MEOS C function interval_gt. +func IntervalGt(interv1 *Interval, interv2 *Interval) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.interval_gt(interv1._inner, interv2._inner) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// IntervalHash wraps MEOS C function interval_hash. +func IntervalHash(interv *Interval) (_r0 uint32, _err error) { + C.meos_errno_reset() + _cret := C.interval_hash(interv._inner) + if _err = meosError(); _err != nil { + return + } + return uint32(_cret), nil +} + + +// IntervalHashExtended wraps MEOS C function interval_hash_extended. +func IntervalHashExtended(interv *Interval, seed uint64) (_r0 uint64, _err error) { + C.meos_errno_reset() + _cret := C.interval_hash_extended(interv._inner, C.uint64_t(seed)) + if _err = meosError(); _err != nil { + return + } + return uint64(_cret), nil +} + + +// IntervalIsFinite wraps MEOS C function interval_is_finite. +func IntervalIsFinite(interv *Interval) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.interval_is_finite(interv._inner) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// IntervalJustifyDays wraps MEOS C function interval_justify_days. +func IntervalJustifyDays(interv *Interval) (_r0 *Interval, _err error) { + C.meos_errno_reset() + _cret := C.interval_justify_days(interv._inner) + if _err = meosError(); _err != nil { + return + } + return &Interval{_inner: _cret}, nil +} + + +// IntervalJustifyHours wraps MEOS C function interval_justify_hours. +func IntervalJustifyHours(interv *Interval) (_r0 *Interval, _err error) { + C.meos_errno_reset() + _cret := C.interval_justify_hours(interv._inner) + if _err = meosError(); _err != nil { + return + } + return &Interval{_inner: _cret}, nil +} + + +// IntervalJustifyInterval wraps MEOS C function interval_justify_interval. +func IntervalJustifyInterval(interv *Interval) (_r0 *Interval, _err error) { + C.meos_errno_reset() + _cret := C.interval_justify_interval(interv._inner) + if _err = meosError(); _err != nil { + return + } + return &Interval{_inner: _cret}, nil +} + + +// IntervalLarger wraps MEOS C function interval_larger. +func IntervalLarger(interv1 *Interval, interv2 *Interval) (_r0 *Interval, _err error) { + C.meos_errno_reset() + _cret := C.interval_larger(interv1._inner, interv2._inner) + if _err = meosError(); _err != nil { + return + } + return &Interval{_inner: _cret}, nil +} + + +// IntervalLe wraps MEOS C function interval_le. +func IntervalLe(interv1 *Interval, interv2 *Interval) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.interval_le(interv1._inner, interv2._inner) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// IntervalLt wraps MEOS C function interval_lt. +func IntervalLt(interv1 *Interval, interv2 *Interval) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.interval_lt(interv1._inner, interv2._inner) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// TODO interval_make: unsupported param float8 +// func IntervalMake(...) { /* not yet handled by codegen */ } + + +// IntervalNe wraps MEOS C function interval_ne. +func IntervalNe(interv1 *Interval, interv2 *Interval) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.interval_ne(interv1._inner, interv2._inner) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// IntervalNegate wraps MEOS C function interval_negate. +func IntervalNegate(interv *Interval) (_r0 *Interval, _err error) { + C.meos_errno_reset() + _cret := C.interval_negate(interv._inner) + if _err = meosError(); _err != nil { + return + } + return &Interval{_inner: _cret}, nil +} + + +// TODO interval_part: unsupported return type float8 +// func IntervalPart(...) { /* not yet handled by codegen */ } + + +// IntervalScale wraps MEOS C function interval_scale. +func IntervalScale(interv *Interval, typmod int32) (_r0 *Interval, _err error) { + C.meos_errno_reset() + _cret := C.interval_scale(interv._inner, C.int32(typmod)) + if _err = meosError(); _err != nil { + return + } + return &Interval{_inner: _cret}, nil +} + + +// IntervalSmaller wraps MEOS C function interval_smaller. +func IntervalSmaller(interv1 *Interval, interv2 *Interval) (_r0 *Interval, _err error) { + C.meos_errno_reset() + _cret := C.interval_smaller(interv1._inner, interv2._inner) + if _err = meosError(); _err != nil { + return + } + return &Interval{_inner: _cret}, nil +} + + +// IntervalTrunc wraps MEOS C function interval_trunc. +func IntervalTrunc(interv *Interval, units string) (_r0 *Interval, _err error) { + _c_units := C.cstring_to_text(C.CString(units)) + defer C.free(unsafe.Pointer(_c_units)) + C.meos_errno_reset() + _cret := C.interval_trunc(interv._inner, _c_units) + if _err = meosError(); _err != nil { + return + } + return &Interval{_inner: _cret}, nil +} + + +// MinusIntervalInterval wraps MEOS C function minus_interval_interval. +func MinusIntervalInterval(interv1 *Interval, interv2 *Interval) (_r0 *Interval, _err error) { + C.meos_errno_reset() + _cret := C.minus_interval_interval(interv1._inner, interv2._inner) + if _err = meosError(); _err != nil { + return + } + return &Interval{_inner: _cret}, nil +} + + +// TODO mul_float8_interval: unsupported param float8 +// func MulFloat8Interval(...) { /* not yet handled by codegen */ } + + +// TODO mul_interval_float8: unsupported param float8 +// func MulIntervalFloat8(...) { /* not yet handled by codegen */ } + diff --git a/functions/meos_pg_text.go b/functions/meos_pg_text.go new file mode 100644 index 0000000..b702331 --- /dev/null +++ b/functions/meos_pg_text.go @@ -0,0 +1,668 @@ +package functions + +/* +#include +#include "meos.h" +#include "meos_catalog.h" +#include "meos_cbuffer.h" +#include "meos_cellindex.h" +#include "meos_geo.h" +#include "meos_h3.h" +#include "meos_internal.h" +#include "meos_internal_geo.h" +#include "meos_json.h" +#include "meos_npoint.h" +#include "meos_pointcloud.h" +#include "meos_pose.h" +#include "meos_quadbin.h" +#include "meos_raster.h" +#include "meos_rgeo.h" +#include "meos_s2cell.h" +#include "pg_basetypes.h" +#include "pg_bool.h" +#include "pg_date.h" +#include "pg_float.h" +#include "pg_int.h" +#include "pg_interval.h" +#include "pg_text.h" +#include "pg_time.h" +#include "pg_timestamp.h" + +// cgo reads C.union_* as a union TYPE; alias the union operators so C.g resolves them as functions. +#define gunion_bigint_set union_bigint_set +#define gunion_bigint_span union_bigint_span +#define gunion_bigint_spanset union_bigint_spanset +#define gunion_cbuffer_set union_cbuffer_set +#define gunion_date_set union_date_set +#define gunion_date_span union_date_span +#define gunion_date_spanset union_date_spanset +#define gunion_float_set union_float_set +#define gunion_float_span union_float_span +#define gunion_float_spanset union_float_spanset +#define gunion_geo_set union_geo_set +#define gunion_h3index_set union_h3index_set +#define gunion_int_set union_int_set +#define gunion_int_span union_int_span +#define gunion_int_spanset union_int_spanset +#define gunion_jsonb_set union_jsonb_set +#define gunion_npoint_set union_npoint_set +#define gunion_pcpatch_set union_pcpatch_set +#define gunion_pcpoint_set union_pcpoint_set +#define gunion_pose_set union_pose_set +#define gunion_posechain_set union_posechain_set +#define gunion_quadbin_set union_quadbin_set +#define gunion_s2cell_set union_s2cell_set +#define gunion_set_bigint union_set_bigint +#define gunion_set_cbuffer union_set_cbuffer +#define gunion_set_date union_set_date +#define gunion_set_float union_set_float +#define gunion_set_geo union_set_geo +#define gunion_set_h3index union_set_h3index +#define gunion_set_int union_set_int +#define gunion_set_jsonb union_set_jsonb +#define gunion_set_npoint union_set_npoint +#define gunion_set_pcpatch union_set_pcpatch +#define gunion_set_pcpoint union_set_pcpoint +#define gunion_set_pose union_set_pose +#define gunion_set_posechain union_set_posechain +#define gunion_set_quadbin union_set_quadbin +#define gunion_set_s2cell union_set_s2cell +#define gunion_set_set union_set_set +#define gunion_set_text union_set_text +#define gunion_set_timestamptz union_set_timestamptz +#define gunion_set_value union_set_value +#define gunion_span_bigint union_span_bigint +#define gunion_span_date union_span_date +#define gunion_span_float union_span_float +#define gunion_span_int union_span_int +#define gunion_span_span union_span_span +#define gunion_span_spanset union_span_spanset +#define gunion_span_timestamptz union_span_timestamptz +#define gunion_span_value union_span_value +#define gunion_spanset_bigint union_spanset_bigint +#define gunion_spanset_date union_spanset_date +#define gunion_spanset_float union_spanset_float +#define gunion_spanset_int union_spanset_int +#define gunion_spanset_span union_spanset_span +#define gunion_spanset_spanset union_spanset_spanset +#define gunion_spanset_timestamptz union_spanset_timestamptz +#define gunion_spanset_value union_spanset_value +#define gunion_stbox_stbox union_stbox_stbox +#define gunion_tbox_tbox union_tbox_tbox +#define gunion_text_set union_text_set +#define gunion_timestamptz_set union_timestamptz_set +#define gunion_timestamptz_span union_timestamptz_span +#define gunion_timestamptz_spanset union_timestamptz_spanset +#define gunion_tpcbox_tpcbox union_tpcbox_tpcbox +#define gunion_value_set union_value_set +#define gunion_value_span union_value_span +#define gunion_value_spanset union_value_spanset +*/ +import "C" +import ( + "unsafe" +) + +var _ = unsafe.Pointer(nil) + +// TODO char_hash: unsupported param char +// func CharHash(...) { /* not yet handled by codegen */ } + + +// TODO char_hash_extended: unsupported param char +// func CharHashExtended(...) { /* not yet handled by codegen */ } + + +// IcuUnicodeVersion wraps MEOS C function icu_unicode_version. +func IcuUnicodeVersion() (_r0 string, _err error) { + C.meos_errno_reset() + _cret := C.icu_unicode_version() + if _err = meosError(); _err != nil { + return + } + return C.GoString(C.text_to_cstring(_cret)), nil +} + + +// Int32ToBin wraps MEOS C function int32_to_bin. +func Int32ToBin(num int32) (_r0 string, _err error) { + C.meos_errno_reset() + _cret := C.int32_to_bin(C.int32(num)) + if _err = meosError(); _err != nil { + return + } + return C.GoString(C.text_to_cstring(_cret)), nil +} + + +// Int32ToHex wraps MEOS C function int32_to_hex. +func Int32ToHex(num int32) (_r0 string, _err error) { + C.meos_errno_reset() + _cret := C.int32_to_hex(C.int32(num)) + if _err = meosError(); _err != nil { + return + } + return C.GoString(C.text_to_cstring(_cret)), nil +} + + +// Int32ToOct wraps MEOS C function int32_to_oct. +func Int32ToOct(num int32) (_r0 string, _err error) { + C.meos_errno_reset() + _cret := C.int32_to_oct(C.int32(num)) + if _err = meosError(); _err != nil { + return + } + return C.GoString(C.text_to_cstring(_cret)), nil +} + + +// Int64ToBin wraps MEOS C function int64_to_bin. +func Int64ToBin(num int64) (_r0 string, _err error) { + C.meos_errno_reset() + _cret := C.int64_to_bin(C.int64_t(num)) + if _err = meosError(); _err != nil { + return + } + return C.GoString(C.text_to_cstring(_cret)), nil +} + + +// Int64ToHex wraps MEOS C function int64_to_hex. +func Int64ToHex(num int64) (_r0 string, _err error) { + C.meos_errno_reset() + _cret := C.int64_to_hex(C.int64_t(num)) + if _err = meosError(); _err != nil { + return + } + return C.GoString(C.text_to_cstring(_cret)), nil +} + + +// Int64ToOct wraps MEOS C function int64_to_oct. +func Int64ToOct(num int64) (_r0 string, _err error) { + C.meos_errno_reset() + _cret := C.int64_to_oct(C.int64_t(num)) + if _err = meosError(); _err != nil { + return + } + return C.GoString(C.text_to_cstring(_cret)), nil +} + + +// TextCat wraps MEOS C function text_cat. +func TextCat(txt1 string, txt2 string) (_r0 string, _err error) { + _c_txt1 := C.cstring_to_text(C.CString(txt1)) + defer C.free(unsafe.Pointer(_c_txt1)) + _c_txt2 := C.cstring_to_text(C.CString(txt2)) + defer C.free(unsafe.Pointer(_c_txt2)) + C.meos_errno_reset() + _cret := C.text_cat(_c_txt1, _c_txt2) + if _err = meosError(); _err != nil { + return + } + return C.GoString(C.text_to_cstring(_cret)), nil +} + + +// TextConcat wraps MEOS C function text_concat. +func TextConcat(textarr unsafe.Pointer, count int) (_r0 string, _err error) { + C.meos_errno_reset() + _cret := C.text_concat((**C.text)(unsafe.Pointer(textarr)), C.int(count)) + if _err = meosError(); _err != nil { + return + } + return C.GoString(C.text_to_cstring(_cret)), nil +} + + +// TextConcatWs wraps MEOS C function text_concat_ws. +func TextConcatWs(textarr unsafe.Pointer, count int, sep string) (_r0 string, _err error) { + _c_sep := C.cstring_to_text(C.CString(sep)) + defer C.free(unsafe.Pointer(_c_sep)) + C.meos_errno_reset() + _cret := C.text_concat_ws((**C.text)(unsafe.Pointer(textarr)), C.int(count), _c_sep) + if _err = meosError(); _err != nil { + return + } + return C.GoString(C.text_to_cstring(_cret)), nil +} + + +// TextEq wraps MEOS C function text_eq. +func TextEq(txt1 string, txt2 string) (_r0 bool, _err error) { + _c_txt1 := C.cstring_to_text(C.CString(txt1)) + defer C.free(unsafe.Pointer(_c_txt1)) + _c_txt2 := C.cstring_to_text(C.CString(txt2)) + defer C.free(unsafe.Pointer(_c_txt2)) + C.meos_errno_reset() + _cret := C.text_eq(_c_txt1, _c_txt2) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// TextGe wraps MEOS C function text_ge. +func TextGe(txt1 string, txt2 string) (_r0 bool, _err error) { + _c_txt1 := C.cstring_to_text(C.CString(txt1)) + defer C.free(unsafe.Pointer(_c_txt1)) + _c_txt2 := C.cstring_to_text(C.CString(txt2)) + defer C.free(unsafe.Pointer(_c_txt2)) + C.meos_errno_reset() + _cret := C.text_ge(_c_txt1, _c_txt2) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// TextGt wraps MEOS C function text_gt. +func TextGt(txt1 string, txt2 string) (_r0 bool, _err error) { + _c_txt1 := C.cstring_to_text(C.CString(txt1)) + defer C.free(unsafe.Pointer(_c_txt1)) + _c_txt2 := C.cstring_to_text(C.CString(txt2)) + defer C.free(unsafe.Pointer(_c_txt2)) + C.meos_errno_reset() + _cret := C.text_gt(_c_txt1, _c_txt2) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// TODO text_hash: unsupported param Oid +// func TextHash(...) { /* not yet handled by codegen */ } + + +// TODO text_hash_extended: unsupported param Oid +// func TextHashExtended(...) { /* not yet handled by codegen */ } + + +// TextLarger wraps MEOS C function text_larger. +func TextLarger(txt1 string, txt2 string) (_r0 string, _err error) { + _c_txt1 := C.cstring_to_text(C.CString(txt1)) + defer C.free(unsafe.Pointer(_c_txt1)) + _c_txt2 := C.cstring_to_text(C.CString(txt2)) + defer C.free(unsafe.Pointer(_c_txt2)) + C.meos_errno_reset() + _cret := C.text_larger(_c_txt1, _c_txt2) + if _err = meosError(); _err != nil { + return + } + return C.GoString(C.text_to_cstring(_cret)), nil +} + + +// TextLe wraps MEOS C function text_le. +func TextLe(txt1 string, txt2 string) (_r0 bool, _err error) { + _c_txt1 := C.cstring_to_text(C.CString(txt1)) + defer C.free(unsafe.Pointer(_c_txt1)) + _c_txt2 := C.cstring_to_text(C.CString(txt2)) + defer C.free(unsafe.Pointer(_c_txt2)) + C.meos_errno_reset() + _cret := C.text_le(_c_txt1, _c_txt2) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// TextLeft wraps MEOS C function text_left. +func TextLeft(txt string, n int) (_r0 string, _err error) { + _c_txt := C.cstring_to_text(C.CString(txt)) + defer C.free(unsafe.Pointer(_c_txt)) + C.meos_errno_reset() + _cret := C.text_left(_c_txt, C.int(n)) + if _err = meosError(); _err != nil { + return + } + return C.GoString(C.text_to_cstring(_cret)), nil +} + + +// TextLen wraps MEOS C function text_len. +func TextLen(txt string) (_r0 int32, _err error) { + _c_txt := C.cstring_to_text(C.CString(txt)) + defer C.free(unsafe.Pointer(_c_txt)) + C.meos_errno_reset() + _cret := C.text_len(_c_txt) + if _err = meosError(); _err != nil { + return + } + return int32(_cret), nil +} + + +// TextLt wraps MEOS C function text_lt. +func TextLt(txt1 string, txt2 string) (_r0 bool, _err error) { + _c_txt1 := C.cstring_to_text(C.CString(txt1)) + defer C.free(unsafe.Pointer(_c_txt1)) + _c_txt2 := C.cstring_to_text(C.CString(txt2)) + defer C.free(unsafe.Pointer(_c_txt2)) + C.meos_errno_reset() + _cret := C.text_lt(_c_txt1, _c_txt2) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// TextNe wraps MEOS C function text_ne. +func TextNe(txt1 string, txt2 string) (_r0 bool, _err error) { + _c_txt1 := C.cstring_to_text(C.CString(txt1)) + defer C.free(unsafe.Pointer(_c_txt1)) + _c_txt2 := C.cstring_to_text(C.CString(txt2)) + defer C.free(unsafe.Pointer(_c_txt2)) + C.meos_errno_reset() + _cret := C.text_ne(_c_txt1, _c_txt2) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// TextOctetlen wraps MEOS C function text_octetlen. +func TextOctetlen(txt string) (_r0 int32, _err error) { + _c_txt := C.cstring_to_text(C.CString(txt)) + defer C.free(unsafe.Pointer(_c_txt)) + C.meos_errno_reset() + _cret := C.text_octetlen(_c_txt) + if _err = meosError(); _err != nil { + return + } + return int32(_cret), nil +} + + +// TextOverlay wraps MEOS C function text_overlay. +func TextOverlay(txt1 string, txt2 string, from int, count int) (_r0 string, _err error) { + _c_txt1 := C.cstring_to_text(C.CString(txt1)) + defer C.free(unsafe.Pointer(_c_txt1)) + _c_txt2 := C.cstring_to_text(C.CString(txt2)) + defer C.free(unsafe.Pointer(_c_txt2)) + C.meos_errno_reset() + _cret := C.text_overlay(_c_txt1, _c_txt2, C.int(from), C.int(count)) + if _err = meosError(); _err != nil { + return + } + return C.GoString(C.text_to_cstring(_cret)), nil +} + + +// TextOverlayNoLen wraps MEOS C function text_overlay_no_len. +func TextOverlayNoLen(txt1 string, txt2 string, from int) (_r0 string, _err error) { + _c_txt1 := C.cstring_to_text(C.CString(txt1)) + defer C.free(unsafe.Pointer(_c_txt1)) + _c_txt2 := C.cstring_to_text(C.CString(txt2)) + defer C.free(unsafe.Pointer(_c_txt2)) + C.meos_errno_reset() + _cret := C.text_overlay_no_len(_c_txt1, _c_txt2, C.int(from)) + if _err = meosError(); _err != nil { + return + } + return C.GoString(C.text_to_cstring(_cret)), nil +} + + +// TextPatternGe wraps MEOS C function text_pattern_ge. +func TextPatternGe(txt1 string, txt2 string) (_r0 bool, _err error) { + _c_txt1 := C.cstring_to_text(C.CString(txt1)) + defer C.free(unsafe.Pointer(_c_txt1)) + _c_txt2 := C.cstring_to_text(C.CString(txt2)) + defer C.free(unsafe.Pointer(_c_txt2)) + C.meos_errno_reset() + _cret := C.text_pattern_ge(_c_txt1, _c_txt2) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// TextPatternGt wraps MEOS C function text_pattern_gt. +func TextPatternGt(txt1 string, txt2 string) (_r0 bool, _err error) { + _c_txt1 := C.cstring_to_text(C.CString(txt1)) + defer C.free(unsafe.Pointer(_c_txt1)) + _c_txt2 := C.cstring_to_text(C.CString(txt2)) + defer C.free(unsafe.Pointer(_c_txt2)) + C.meos_errno_reset() + _cret := C.text_pattern_gt(_c_txt1, _c_txt2) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// TextPatternLe wraps MEOS C function text_pattern_le. +func TextPatternLe(txt1 string, txt2 string) (_r0 bool, _err error) { + _c_txt1 := C.cstring_to_text(C.CString(txt1)) + defer C.free(unsafe.Pointer(_c_txt1)) + _c_txt2 := C.cstring_to_text(C.CString(txt2)) + defer C.free(unsafe.Pointer(_c_txt2)) + C.meos_errno_reset() + _cret := C.text_pattern_le(_c_txt1, _c_txt2) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// TextPatternLt wraps MEOS C function text_pattern_lt. +func TextPatternLt(txt1 string, txt2 string) (_r0 bool, _err error) { + _c_txt1 := C.cstring_to_text(C.CString(txt1)) + defer C.free(unsafe.Pointer(_c_txt1)) + _c_txt2 := C.cstring_to_text(C.CString(txt2)) + defer C.free(unsafe.Pointer(_c_txt2)) + C.meos_errno_reset() + _cret := C.text_pattern_lt(_c_txt1, _c_txt2) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// TextPos wraps MEOS C function text_pos. +func TextPos(txt string, search string) (_r0 int32, _err error) { + _c_txt := C.cstring_to_text(C.CString(txt)) + defer C.free(unsafe.Pointer(_c_txt)) + _c_search := C.cstring_to_text(C.CString(search)) + defer C.free(unsafe.Pointer(_c_search)) + C.meos_errno_reset() + _cret := C.text_pos(_c_txt, _c_search) + if _err = meosError(); _err != nil { + return + } + return int32(_cret), nil +} + + +// TextReplace wraps MEOS C function text_replace. +func TextReplace(txt string, from string, to string) (_r0 string, _err error) { + _c_txt := C.cstring_to_text(C.CString(txt)) + defer C.free(unsafe.Pointer(_c_txt)) + _c_from := C.cstring_to_text(C.CString(from)) + defer C.free(unsafe.Pointer(_c_from)) + _c_to := C.cstring_to_text(C.CString(to)) + defer C.free(unsafe.Pointer(_c_to)) + C.meos_errno_reset() + _cret := C.text_replace(_c_txt, _c_from, _c_to) + if _err = meosError(); _err != nil { + return + } + return C.GoString(C.text_to_cstring(_cret)), nil +} + + +// TextReverse wraps MEOS C function text_reverse. +func TextReverse(txt string) (_r0 string, _err error) { + _c_txt := C.cstring_to_text(C.CString(txt)) + defer C.free(unsafe.Pointer(_c_txt)) + C.meos_errno_reset() + _cret := C.text_reverse(_c_txt) + if _err = meosError(); _err != nil { + return + } + return C.GoString(C.text_to_cstring(_cret)), nil +} + + +// TextRight wraps MEOS C function text_right. +func TextRight(txt string, n int) (_r0 string, _err error) { + _c_txt := C.cstring_to_text(C.CString(txt)) + defer C.free(unsafe.Pointer(_c_txt)) + C.meos_errno_reset() + _cret := C.text_right(_c_txt, C.int(n)) + if _err = meosError(); _err != nil { + return + } + return C.GoString(C.text_to_cstring(_cret)), nil +} + + +// TextSmaller wraps MEOS C function text_smaller. +func TextSmaller(txt1 string, txt2 string) (_r0 string, _err error) { + _c_txt1 := C.cstring_to_text(C.CString(txt1)) + defer C.free(unsafe.Pointer(_c_txt1)) + _c_txt2 := C.cstring_to_text(C.CString(txt2)) + defer C.free(unsafe.Pointer(_c_txt2)) + C.meos_errno_reset() + _cret := C.text_smaller(_c_txt1, _c_txt2) + if _err = meosError(); _err != nil { + return + } + return C.GoString(C.text_to_cstring(_cret)), nil +} + + +// TextSplitPart wraps MEOS C function text_split_part. +func TextSplitPart(txt string, sep string, fldnum int) (_r0 string, _err error) { + _c_txt := C.cstring_to_text(C.CString(txt)) + defer C.free(unsafe.Pointer(_c_txt)) + _c_sep := C.cstring_to_text(C.CString(sep)) + defer C.free(unsafe.Pointer(_c_sep)) + C.meos_errno_reset() + _cret := C.text_split_part(_c_txt, _c_sep, C.int(fldnum)) + if _err = meosError(); _err != nil { + return + } + return C.GoString(C.text_to_cstring(_cret)), nil +} + + +// TextStartsWith wraps MEOS C function text_starts_with. +func TextStartsWith(txt1 string, txt2 string) (_r0 bool, _err error) { + _c_txt1 := C.cstring_to_text(C.CString(txt1)) + defer C.free(unsafe.Pointer(_c_txt1)) + _c_txt2 := C.cstring_to_text(C.CString(txt2)) + defer C.free(unsafe.Pointer(_c_txt2)) + C.meos_errno_reset() + _cret := C.text_starts_with(_c_txt1, _c_txt2) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// TextSubstr wraps MEOS C function text_substr. +func TextSubstr(txt string, start int32, length int32) (_r0 string, _err error) { + _c_txt := C.cstring_to_text(C.CString(txt)) + defer C.free(unsafe.Pointer(_c_txt)) + C.meos_errno_reset() + _cret := C.text_substr(_c_txt, C.int32(start), C.int32(length)) + if _err = meosError(); _err != nil { + return + } + return C.GoString(C.text_to_cstring(_cret)), nil +} + + +// TextSubstrNoLen wraps MEOS C function text_substr_no_len. +func TextSubstrNoLen(txt string, start int32) (_r0 string, _err error) { + _c_txt := C.cstring_to_text(C.CString(txt)) + defer C.free(unsafe.Pointer(_c_txt)) + C.meos_errno_reset() + _cret := C.text_substr_no_len(_c_txt, C.int32(start)) + if _err = meosError(); _err != nil { + return + } + return C.GoString(C.text_to_cstring(_cret)), nil +} + + +// UnicodeAssigned wraps MEOS C function unicode_assigned. +func UnicodeAssigned(txt string) (_r0 bool, _err error) { + _c_txt := C.cstring_to_text(C.CString(txt)) + defer C.free(unsafe.Pointer(_c_txt)) + C.meos_errno_reset() + _cret := C.unicode_assigned(_c_txt) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// UnicodeIsNormalized wraps MEOS C function unicode_is_normalized. +func UnicodeIsNormalized(txt string, fmt string) (_r0 bool, _err error) { + _c_txt := C.cstring_to_text(C.CString(txt)) + defer C.free(unsafe.Pointer(_c_txt)) + _c_fmt := C.cstring_to_text(C.CString(fmt)) + defer C.free(unsafe.Pointer(_c_fmt)) + C.meos_errno_reset() + _cret := C.unicode_is_normalized(_c_txt, _c_fmt) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// UnicodeNormalizeFunc wraps MEOS C function unicode_normalize_func. +func UnicodeNormalizeFunc(txt string, fmt string) (_r0 string, _err error) { + _c_txt := C.cstring_to_text(C.CString(txt)) + defer C.free(unsafe.Pointer(_c_txt)) + _c_fmt := C.cstring_to_text(C.CString(fmt)) + defer C.free(unsafe.Pointer(_c_fmt)) + C.meos_errno_reset() + _cret := C.unicode_normalize_func(_c_txt, _c_fmt) + if _err = meosError(); _err != nil { + return + } + return C.GoString(C.text_to_cstring(_cret)), nil +} + + +// UnicodeVersion wraps MEOS C function unicode_version. +func UnicodeVersion() (_r0 string, _err error) { + C.meos_errno_reset() + _cret := C.unicode_version() + if _err = meosError(); _err != nil { + return + } + return C.GoString(C.text_to_cstring(_cret)), nil +} + + +// Unistr wraps MEOS C function unistr. +func Unistr(txt string) (_r0 string, _err error) { + _c_txt := C.cstring_to_text(C.CString(txt)) + defer C.free(unsafe.Pointer(_c_txt)) + C.meos_errno_reset() + _cret := C.unistr(_c_txt) + if _err = meosError(); _err != nil { + return + } + return C.GoString(C.text_to_cstring(_cret)), nil +} + diff --git a/functions/meos_pg_time.go b/functions/meos_pg_time.go new file mode 100644 index 0000000..ca7df7a --- /dev/null +++ b/functions/meos_pg_time.go @@ -0,0 +1,633 @@ +package functions + +/* +#include +#include "meos.h" +#include "meos_catalog.h" +#include "meos_cbuffer.h" +#include "meos_cellindex.h" +#include "meos_geo.h" +#include "meos_h3.h" +#include "meos_internal.h" +#include "meos_internal_geo.h" +#include "meos_json.h" +#include "meos_npoint.h" +#include "meos_pointcloud.h" +#include "meos_pose.h" +#include "meos_quadbin.h" +#include "meos_raster.h" +#include "meos_rgeo.h" +#include "meos_s2cell.h" +#include "pg_basetypes.h" +#include "pg_bool.h" +#include "pg_date.h" +#include "pg_float.h" +#include "pg_int.h" +#include "pg_interval.h" +#include "pg_text.h" +#include "pg_time.h" +#include "pg_timestamp.h" + +// cgo reads C.union_* as a union TYPE; alias the union operators so C.g resolves them as functions. +#define gunion_bigint_set union_bigint_set +#define gunion_bigint_span union_bigint_span +#define gunion_bigint_spanset union_bigint_spanset +#define gunion_cbuffer_set union_cbuffer_set +#define gunion_date_set union_date_set +#define gunion_date_span union_date_span +#define gunion_date_spanset union_date_spanset +#define gunion_float_set union_float_set +#define gunion_float_span union_float_span +#define gunion_float_spanset union_float_spanset +#define gunion_geo_set union_geo_set +#define gunion_h3index_set union_h3index_set +#define gunion_int_set union_int_set +#define gunion_int_span union_int_span +#define gunion_int_spanset union_int_spanset +#define gunion_jsonb_set union_jsonb_set +#define gunion_npoint_set union_npoint_set +#define gunion_pcpatch_set union_pcpatch_set +#define gunion_pcpoint_set union_pcpoint_set +#define gunion_pose_set union_pose_set +#define gunion_posechain_set union_posechain_set +#define gunion_quadbin_set union_quadbin_set +#define gunion_s2cell_set union_s2cell_set +#define gunion_set_bigint union_set_bigint +#define gunion_set_cbuffer union_set_cbuffer +#define gunion_set_date union_set_date +#define gunion_set_float union_set_float +#define gunion_set_geo union_set_geo +#define gunion_set_h3index union_set_h3index +#define gunion_set_int union_set_int +#define gunion_set_jsonb union_set_jsonb +#define gunion_set_npoint union_set_npoint +#define gunion_set_pcpatch union_set_pcpatch +#define gunion_set_pcpoint union_set_pcpoint +#define gunion_set_pose union_set_pose +#define gunion_set_posechain union_set_posechain +#define gunion_set_quadbin union_set_quadbin +#define gunion_set_s2cell union_set_s2cell +#define gunion_set_set union_set_set +#define gunion_set_text union_set_text +#define gunion_set_timestamptz union_set_timestamptz +#define gunion_set_value union_set_value +#define gunion_span_bigint union_span_bigint +#define gunion_span_date union_span_date +#define gunion_span_float union_span_float +#define gunion_span_int union_span_int +#define gunion_span_span union_span_span +#define gunion_span_spanset union_span_spanset +#define gunion_span_timestamptz union_span_timestamptz +#define gunion_span_value union_span_value +#define gunion_spanset_bigint union_spanset_bigint +#define gunion_spanset_date union_spanset_date +#define gunion_spanset_float union_spanset_float +#define gunion_spanset_int union_spanset_int +#define gunion_spanset_span union_spanset_span +#define gunion_spanset_spanset union_spanset_spanset +#define gunion_spanset_timestamptz union_spanset_timestamptz +#define gunion_spanset_value union_spanset_value +#define gunion_stbox_stbox union_stbox_stbox +#define gunion_tbox_tbox union_tbox_tbox +#define gunion_text_set union_text_set +#define gunion_timestamptz_set union_timestamptz_set +#define gunion_timestamptz_span union_timestamptz_span +#define gunion_timestamptz_spanset union_timestamptz_spanset +#define gunion_tpcbox_tpcbox union_tpcbox_tpcbox +#define gunion_value_set union_value_set +#define gunion_value_span union_value_span +#define gunion_value_spanset union_value_spanset +*/ +import "C" +import ( + "unsafe" +) + +var _ = unsafe.Pointer(nil) + +// DateTimetzToTimestamptz wraps MEOS C function date_timetz_to_timestamptz. +func DateTimetzToTimestamptz(date int32, timetz unsafe.Pointer) (_r0 int64, _err error) { + C.meos_errno_reset() + _cret := C.date_timetz_to_timestamptz(C.DateADT(date), (*C.TimeTzADT)(unsafe.Pointer(timetz))) + if _err = meosError(); _err != nil { + return + } + return int64(_cret), nil +} + + +// IntervalToTime wraps MEOS C function interval_to_time. +func IntervalToTime(interv *Interval) (_r0 int64, _err error) { + C.meos_errno_reset() + _cret := C.interval_to_time(interv._inner) + if _err = meosError(); _err != nil { + return + } + return int64(_cret), nil +} + + +// MinusTimeInterval wraps MEOS C function minus_time_interval. +func MinusTimeInterval(time int64, interv *Interval) (_r0 int64, _err error) { + C.meos_errno_reset() + _cret := C.minus_time_interval(C.TimeADT(time), interv._inner) + if _err = meosError(); _err != nil { + return + } + return int64(_cret), nil +} + + +// MinusTimeTime wraps MEOS C function minus_time_time. +func MinusTimeTime(time1 int64, time2 int64) (_r0 *Interval, _err error) { + C.meos_errno_reset() + _cret := C.minus_time_time(C.TimeADT(time1), C.TimeADT(time2)) + if _err = meosError(); _err != nil { + return + } + return &Interval{_inner: _cret}, nil +} + + +// MinusTimetzInterval wraps MEOS C function minus_timetz_interval. +func MinusTimetzInterval(timetz unsafe.Pointer, interv *Interval) (_r0 unsafe.Pointer, _err error) { + C.meos_errno_reset() + _cret := C.minus_timetz_interval((*C.TimeTzADT)(unsafe.Pointer(timetz)), interv._inner) + if _err = meosError(); _err != nil { + return + } + return unsafe.Pointer(_cret), nil +} + + +// PlusTimeInterval wraps MEOS C function plus_time_interval. +func PlusTimeInterval(time int64, interv *Interval) (_r0 int64, _err error) { + C.meos_errno_reset() + _cret := C.plus_time_interval(C.TimeADT(time), interv._inner) + if _err = meosError(); _err != nil { + return + } + return int64(_cret), nil +} + + +// PlusTimetzInterval wraps MEOS C function plus_timetz_interval. +func PlusTimetzInterval(timetz unsafe.Pointer, interv *Interval) (_r0 unsafe.Pointer, _err error) { + C.meos_errno_reset() + _cret := C.plus_timetz_interval((*C.TimeTzADT)(unsafe.Pointer(timetz)), interv._inner) + if _err = meosError(); _err != nil { + return + } + return unsafe.Pointer(_cret), nil +} + + +// TimeCmp wraps MEOS C function time_cmp. +func TimeCmp(time1 int64, time2 int64) (_r0 int, _err error) { + C.meos_errno_reset() + _cret := C.time_cmp(C.TimeADT(time1), C.TimeADT(time2)) + if _err = meosError(); _err != nil { + return + } + return int(_cret), nil +} + + +// TimeEq wraps MEOS C function time_eq. +func TimeEq(time1 int64, time2 int64) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.time_eq(C.TimeADT(time1), C.TimeADT(time2)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// TODO time_extract: unsupported return type Numeric +// func TimeExtract(...) { /* not yet handled by codegen */ } + + +// TimeGe wraps MEOS C function time_ge. +func TimeGe(time1 int64, time2 int64) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.time_ge(C.TimeADT(time1), C.TimeADT(time2)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// TimeGt wraps MEOS C function time_gt. +func TimeGt(time1 int64, time2 int64) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.time_gt(C.TimeADT(time1), C.TimeADT(time2)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// TimeHash wraps MEOS C function time_hash. +func TimeHash(time int64) (_r0 uint32, _err error) { + C.meos_errno_reset() + _cret := C.time_hash(C.TimeADT(time)) + if _err = meosError(); _err != nil { + return + } + return uint32(_cret), nil +} + + +// TimeHashExtended wraps MEOS C function time_hash_extended. +func TimeHashExtended(time int64, seed int32) (_r0 uint64, _err error) { + C.meos_errno_reset() + _cret := C.time_hash_extended(C.TimeADT(time), C.int32(seed)) + if _err = meosError(); _err != nil { + return + } + return uint64(_cret), nil +} + + +// TimeLarger wraps MEOS C function time_larger. +func TimeLarger(time1 int64, time2 int64) (_r0 int64, _err error) { + C.meos_errno_reset() + _cret := C.time_larger(C.TimeADT(time1), C.TimeADT(time2)) + if _err = meosError(); _err != nil { + return + } + return int64(_cret), nil +} + + +// TimeLe wraps MEOS C function time_le. +func TimeLe(time1 int64, time2 int64) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.time_le(C.TimeADT(time1), C.TimeADT(time2)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// TimeLt wraps MEOS C function time_lt. +func TimeLt(time1 int64, time2 int64) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.time_lt(C.TimeADT(time1), C.TimeADT(time2)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// TimeMake wraps MEOS C function time_make. +func TimeMake(tm_hour int, tm_min int, sec float64) (_r0 int64, _err error) { + C.meos_errno_reset() + _cret := C.time_make(C.int(tm_hour), C.int(tm_min), C.double(sec)) + if _err = meosError(); _err != nil { + return + } + return int64(_cret), nil +} + + +// TimeNe wraps MEOS C function time_ne. +func TimeNe(time1 int64, time2 int64) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.time_ne(C.TimeADT(time1), C.TimeADT(time2)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// TimeOverlaps wraps MEOS C function time_overlaps. +func TimeOverlaps(ts1 int64, te1 int64, ts2 int64, te2 int64) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.time_overlaps(C.TimeADT(ts1), C.TimeADT(te1), C.TimeADT(ts2), C.TimeADT(te2)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// TODO time_part: unsupported return type float8 +// func TimePart(...) { /* not yet handled by codegen */ } + + +// TimeScale wraps MEOS C function time_scale. +func TimeScale(date int64, typmod int32) (_r0 int64, _err error) { + C.meos_errno_reset() + _cret := C.time_scale(C.TimeADT(date), C.int32(typmod)) + if _err = meosError(); _err != nil { + return + } + return int64(_cret), nil +} + + +// TimeSmaller wraps MEOS C function time_smaller. +func TimeSmaller(time1 int64, time2 int64) (_r0 int64, _err error) { + C.meos_errno_reset() + _cret := C.time_smaller(C.TimeADT(time1), C.TimeADT(time2)) + if _err = meosError(); _err != nil { + return + } + return int64(_cret), nil +} + + +// TimeToInterval wraps MEOS C function time_to_interval. +func TimeToInterval(time int64) (_r0 *Interval, _err error) { + C.meos_errno_reset() + _cret := C.time_to_interval(C.TimeADT(time)) + if _err = meosError(); _err != nil { + return + } + return &Interval{_inner: _cret}, nil +} + + +// TimeToTimetz wraps MEOS C function time_to_timetz. +func TimeToTimetz(time int64) (_r0 unsafe.Pointer, _err error) { + C.meos_errno_reset() + _cret := C.time_to_timetz(C.TimeADT(time)) + if _err = meosError(); _err != nil { + return + } + return unsafe.Pointer(_cret), nil +} + + +// TimestampToTime wraps MEOS C function timestamp_to_time. +func TimestampToTime(ts int64) (_r0 int64, _err error) { + C.meos_errno_reset() + _cret := C.timestamp_to_time(C.Timestamp(ts)) + if _err = meosError(); _err != nil { + return + } + return int64(_cret), nil +} + + +// TimestamptzToTime wraps MEOS C function timestamptz_to_time. +func TimestamptzToTime(tztz int64) (_r0 int64, _err error) { + C.meos_errno_reset() + _cret := C.timestamptz_to_time(C.TimestampTz(tztz)) + if _err = meosError(); _err != nil { + return + } + return int64(_cret), nil +} + + +// TimestamptzToTimetz wraps MEOS C function timestamptz_to_timetz. +func TimestamptzToTimetz(tztz int64) (_r0 unsafe.Pointer, _err error) { + C.meos_errno_reset() + _cret := C.timestamptz_to_timetz(C.TimestampTz(tztz)) + if _err = meosError(); _err != nil { + return + } + return unsafe.Pointer(_cret), nil +} + + +// TimetzAtLocal wraps MEOS C function timetz_at_local. +func TimetzAtLocal(timetz unsafe.Pointer) (_r0 unsafe.Pointer, _err error) { + C.meos_errno_reset() + _cret := C.timetz_at_local((*C.TimeTzADT)(unsafe.Pointer(timetz))) + if _err = meosError(); _err != nil { + return + } + return unsafe.Pointer(_cret), nil +} + + +// TimetzCmp wraps MEOS C function timetz_cmp. +func TimetzCmp(timetz1 unsafe.Pointer, timetz2 unsafe.Pointer) (_r0 int32, _err error) { + C.meos_errno_reset() + _cret := C.timetz_cmp((*C.TimeTzADT)(unsafe.Pointer(timetz1)), (*C.TimeTzADT)(unsafe.Pointer(timetz2))) + if _err = meosError(); _err != nil { + return + } + return int32(_cret), nil +} + + +// TimetzEq wraps MEOS C function timetz_eq. +func TimetzEq(timetz1 unsafe.Pointer, timetz2 unsafe.Pointer) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.timetz_eq((*C.TimeTzADT)(unsafe.Pointer(timetz1)), (*C.TimeTzADT)(unsafe.Pointer(timetz2))) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// TODO timetz_extract: unsupported return type Numeric +// func TimetzExtract(...) { /* not yet handled by codegen */ } + + +// TimetzGe wraps MEOS C function timetz_ge. +func TimetzGe(timetz1 unsafe.Pointer, timetz2 unsafe.Pointer) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.timetz_ge((*C.TimeTzADT)(unsafe.Pointer(timetz1)), (*C.TimeTzADT)(unsafe.Pointer(timetz2))) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// TimetzGt wraps MEOS C function timetz_gt. +func TimetzGt(timetz1 unsafe.Pointer, timetz2 unsafe.Pointer) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.timetz_gt((*C.TimeTzADT)(unsafe.Pointer(timetz1)), (*C.TimeTzADT)(unsafe.Pointer(timetz2))) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// TimetzHash wraps MEOS C function timetz_hash. +func TimetzHash(timetz unsafe.Pointer) (_r0 uint32, _err error) { + C.meos_errno_reset() + _cret := C.timetz_hash((*C.TimeTzADT)(unsafe.Pointer(timetz))) + if _err = meosError(); _err != nil { + return + } + return uint32(_cret), nil +} + + +// TimetzHashExtended wraps MEOS C function timetz_hash_extended. +func TimetzHashExtended(timetz unsafe.Pointer, seed int64) (_r0 uint64, _err error) { + C.meos_errno_reset() + _cret := C.timetz_hash_extended((*C.TimeTzADT)(unsafe.Pointer(timetz)), C.int64_t(seed)) + if _err = meosError(); _err != nil { + return + } + return uint64(_cret), nil +} + + +// TimetzIn wraps MEOS C function timetz_in. +func TimetzIn(str string, typmod int32) (_r0 unsafe.Pointer, _err error) { + _c_str := C.CString(str) + defer C.free(unsafe.Pointer(_c_str)) + C.meos_errno_reset() + _cret := C.timetz_in(_c_str, C.int32(typmod)) + if _err = meosError(); _err != nil { + return + } + return unsafe.Pointer(_cret), nil +} + + +// TimetzIzone wraps MEOS C function timetz_izone. +func TimetzIzone(timetz unsafe.Pointer, zone *Interval) (_r0 unsafe.Pointer, _err error) { + C.meos_errno_reset() + _cret := C.timetz_izone((*C.TimeTzADT)(unsafe.Pointer(timetz)), zone._inner) + if _err = meosError(); _err != nil { + return + } + return unsafe.Pointer(_cret), nil +} + + +// TimetzLarger wraps MEOS C function timetz_larger. +func TimetzLarger(timetz1 unsafe.Pointer, timetz2 unsafe.Pointer) (_r0 unsafe.Pointer, _err error) { + C.meos_errno_reset() + _cret := C.timetz_larger((*C.TimeTzADT)(unsafe.Pointer(timetz1)), (*C.TimeTzADT)(unsafe.Pointer(timetz2))) + if _err = meosError(); _err != nil { + return + } + return unsafe.Pointer(_cret), nil +} + + +// TimetzLe wraps MEOS C function timetz_le. +func TimetzLe(timetz1 unsafe.Pointer, timetz2 unsafe.Pointer) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.timetz_le((*C.TimeTzADT)(unsafe.Pointer(timetz1)), (*C.TimeTzADT)(unsafe.Pointer(timetz2))) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// TimetzLt wraps MEOS C function timetz_lt. +func TimetzLt(timetz1 unsafe.Pointer, timetz2 unsafe.Pointer) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.timetz_lt((*C.TimeTzADT)(unsafe.Pointer(timetz1)), (*C.TimeTzADT)(unsafe.Pointer(timetz2))) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// TimetzNe wraps MEOS C function timetz_ne. +func TimetzNe(timetz1 unsafe.Pointer, timetz2 unsafe.Pointer) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.timetz_ne((*C.TimeTzADT)(unsafe.Pointer(timetz1)), (*C.TimeTzADT)(unsafe.Pointer(timetz2))) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// TimetzCopy wraps MEOS C function timetz_copy. +func TimetzCopy(timetz unsafe.Pointer) (_r0 unsafe.Pointer, _err error) { + C.meos_errno_reset() + _cret := C.timetz_copy((*C.TimeTzADT)(unsafe.Pointer(timetz))) + if _err = meosError(); _err != nil { + return + } + return unsafe.Pointer(_cret), nil +} + + +// TimetzOut wraps MEOS C function timetz_out. +func TimetzOut(timetz unsafe.Pointer) (_r0 string, _err error) { + C.meos_errno_reset() + _cret := C.timetz_out((*C.TimeTzADT)(unsafe.Pointer(timetz))) + if _err = meosError(); _err != nil { + return + } + defer C.free(unsafe.Pointer(_cret)) + return C.GoString(_cret), nil +} + + +// TimetzOverlaps wraps MEOS C function timetz_overlaps. +func TimetzOverlaps(ts1 unsafe.Pointer, te1 unsafe.Pointer, ts2 unsafe.Pointer, te2 unsafe.Pointer) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.timetz_overlaps((*C.TimeTzADT)(unsafe.Pointer(ts1)), (*C.TimeTzADT)(unsafe.Pointer(te1)), (*C.TimeTzADT)(unsafe.Pointer(ts2)), (*C.TimeTzADT)(unsafe.Pointer(te2))) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// TODO timetz_part: unsupported return type float8 +// func TimetzPart(...) { /* not yet handled by codegen */ } + + +// TimetzScale wraps MEOS C function timetz_scale. +func TimetzScale(timetz unsafe.Pointer, typmod int32) (_r0 unsafe.Pointer, _err error) { + C.meos_errno_reset() + _cret := C.timetz_scale((*C.TimeTzADT)(unsafe.Pointer(timetz)), C.int32(typmod)) + if _err = meosError(); _err != nil { + return + } + return unsafe.Pointer(_cret), nil +} + + +// TimetzSmaller wraps MEOS C function timetz_smaller. +func TimetzSmaller(timetz1 unsafe.Pointer, timetz2 unsafe.Pointer) (_r0 unsafe.Pointer, _err error) { + C.meos_errno_reset() + _cret := C.timetz_smaller((*C.TimeTzADT)(unsafe.Pointer(timetz1)), (*C.TimeTzADT)(unsafe.Pointer(timetz2))) + if _err = meosError(); _err != nil { + return + } + return unsafe.Pointer(_cret), nil +} + + +// TimetzToTime wraps MEOS C function timetz_to_time. +func TimetzToTime(timetz unsafe.Pointer) (_r0 int64, _err error) { + C.meos_errno_reset() + _cret := C.timetz_to_time((*C.TimeTzADT)(unsafe.Pointer(timetz))) + if _err = meosError(); _err != nil { + return + } + return int64(_cret), nil +} + + +// TimetzZone wraps MEOS C function timetz_zone. +func TimetzZone(timetz unsafe.Pointer, zone string) (_r0 unsafe.Pointer, _err error) { + _c_zone := C.cstring_to_text(C.CString(zone)) + defer C.free(unsafe.Pointer(_c_zone)) + C.meos_errno_reset() + _cret := C.timetz_zone((*C.TimeTzADT)(unsafe.Pointer(timetz)), _c_zone) + if _err = meosError(); _err != nil { + return + } + return unsafe.Pointer(_cret), nil +} + diff --git a/functions/meos_pg_timestamp.go b/functions/meos_pg_timestamp.go new file mode 100644 index 0000000..1488197 --- /dev/null +++ b/functions/meos_pg_timestamp.go @@ -0,0 +1,792 @@ +package functions + +/* +#include +#include "meos.h" +#include "meos_catalog.h" +#include "meos_cbuffer.h" +#include "meos_cellindex.h" +#include "meos_geo.h" +#include "meos_h3.h" +#include "meos_internal.h" +#include "meos_internal_geo.h" +#include "meos_json.h" +#include "meos_npoint.h" +#include "meos_pointcloud.h" +#include "meos_pose.h" +#include "meos_quadbin.h" +#include "meos_raster.h" +#include "meos_rgeo.h" +#include "meos_s2cell.h" +#include "pg_basetypes.h" +#include "pg_bool.h" +#include "pg_date.h" +#include "pg_float.h" +#include "pg_int.h" +#include "pg_interval.h" +#include "pg_text.h" +#include "pg_time.h" +#include "pg_timestamp.h" + +// cgo reads C.union_* as a union TYPE; alias the union operators so C.g resolves them as functions. +#define gunion_bigint_set union_bigint_set +#define gunion_bigint_span union_bigint_span +#define gunion_bigint_spanset union_bigint_spanset +#define gunion_cbuffer_set union_cbuffer_set +#define gunion_date_set union_date_set +#define gunion_date_span union_date_span +#define gunion_date_spanset union_date_spanset +#define gunion_float_set union_float_set +#define gunion_float_span union_float_span +#define gunion_float_spanset union_float_spanset +#define gunion_geo_set union_geo_set +#define gunion_h3index_set union_h3index_set +#define gunion_int_set union_int_set +#define gunion_int_span union_int_span +#define gunion_int_spanset union_int_spanset +#define gunion_jsonb_set union_jsonb_set +#define gunion_npoint_set union_npoint_set +#define gunion_pcpatch_set union_pcpatch_set +#define gunion_pcpoint_set union_pcpoint_set +#define gunion_pose_set union_pose_set +#define gunion_posechain_set union_posechain_set +#define gunion_quadbin_set union_quadbin_set +#define gunion_s2cell_set union_s2cell_set +#define gunion_set_bigint union_set_bigint +#define gunion_set_cbuffer union_set_cbuffer +#define gunion_set_date union_set_date +#define gunion_set_float union_set_float +#define gunion_set_geo union_set_geo +#define gunion_set_h3index union_set_h3index +#define gunion_set_int union_set_int +#define gunion_set_jsonb union_set_jsonb +#define gunion_set_npoint union_set_npoint +#define gunion_set_pcpatch union_set_pcpatch +#define gunion_set_pcpoint union_set_pcpoint +#define gunion_set_pose union_set_pose +#define gunion_set_posechain union_set_posechain +#define gunion_set_quadbin union_set_quadbin +#define gunion_set_s2cell union_set_s2cell +#define gunion_set_set union_set_set +#define gunion_set_text union_set_text +#define gunion_set_timestamptz union_set_timestamptz +#define gunion_set_value union_set_value +#define gunion_span_bigint union_span_bigint +#define gunion_span_date union_span_date +#define gunion_span_float union_span_float +#define gunion_span_int union_span_int +#define gunion_span_span union_span_span +#define gunion_span_spanset union_span_spanset +#define gunion_span_timestamptz union_span_timestamptz +#define gunion_span_value union_span_value +#define gunion_spanset_bigint union_spanset_bigint +#define gunion_spanset_date union_spanset_date +#define gunion_spanset_float union_spanset_float +#define gunion_spanset_int union_spanset_int +#define gunion_spanset_span union_spanset_span +#define gunion_spanset_spanset union_spanset_spanset +#define gunion_spanset_timestamptz union_spanset_timestamptz +#define gunion_spanset_value union_spanset_value +#define gunion_stbox_stbox union_stbox_stbox +#define gunion_tbox_tbox union_tbox_tbox +#define gunion_text_set union_text_set +#define gunion_timestamptz_set union_timestamptz_set +#define gunion_timestamptz_span union_timestamptz_span +#define gunion_timestamptz_spanset union_timestamptz_spanset +#define gunion_tpcbox_tpcbox union_tpcbox_tpcbox +#define gunion_value_set union_value_set +#define gunion_value_span union_value_span +#define gunion_value_spanset union_value_spanset +*/ +import "C" +import ( + "unsafe" +) + +var _ = unsafe.Pointer(nil) + +// AddTimestampInterval wraps MEOS C function add_timestamp_interval. +func AddTimestampInterval(ts int64, interv *Interval) (_r0 int64, _err error) { + C.meos_errno_reset() + _cret := C.add_timestamp_interval(C.Timestamp(ts), interv._inner) + if _err = meosError(); _err != nil { + return + } + return int64(_cret), nil +} + + +// AddTimestamptzInterval wraps MEOS C function add_timestamptz_interval. +func AddTimestamptzInterval(tstz int64, interv *Interval) (_r0 int64, _err error) { + C.meos_errno_reset() + _cret := C.add_timestamptz_interval(C.TimestampTz(tstz), interv._inner) + if _err = meosError(); _err != nil { + return + } + return int64(_cret), nil +} + + +// AddTimestamptzIntervalAtZone wraps MEOS C function add_timestamptz_interval_at_zone. +func AddTimestamptzIntervalAtZone(tstz int64, interv *Interval, zone string) (_r0 int64, _err error) { + _c_zone := C.cstring_to_text(C.CString(zone)) + defer C.free(unsafe.Pointer(_c_zone)) + C.meos_errno_reset() + _cret := C.add_timestamptz_interval_at_zone(C.TimestampTz(tstz), interv._inner, _c_zone) + if _err = meosError(); _err != nil { + return + } + return int64(_cret), nil +} + + +// CmpTimestampTimestamp wraps MEOS C function cmp_timestamp_timestamp. +func CmpTimestampTimestamp(ts1 int64, ts2 int64) (_r0 int32, _err error) { + C.meos_errno_reset() + _cret := C.cmp_timestamp_timestamp(C.Timestamp(ts1), C.Timestamp(ts2)) + if _err = meosError(); _err != nil { + return + } + return int32(_cret), nil +} + + +// CmpTimestampTimestamptz wraps MEOS C function cmp_timestamp_timestamptz. +func CmpTimestampTimestamptz(ts int64, tstz int64) (_r0 int32, _err error) { + C.meos_errno_reset() + _cret := C.cmp_timestamp_timestamptz(C.Timestamp(ts), C.TimestampTz(tstz)) + if _err = meosError(); _err != nil { + return + } + return int32(_cret), nil +} + + +// CmpTimestamptzTimestamp wraps MEOS C function cmp_timestamptz_timestamp. +func CmpTimestamptzTimestamp(tstz int64, ts int64) (_r0 int32, _err error) { + C.meos_errno_reset() + _cret := C.cmp_timestamptz_timestamp(C.TimestampTz(tstz), C.Timestamp(ts)) + if _err = meosError(); _err != nil { + return + } + return int32(_cret), nil +} + + +// EqTimestampTimestamp wraps MEOS C function eq_timestamp_timestamp. +func EqTimestampTimestamp(ts1 int64, ts2 int64) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.eq_timestamp_timestamp(C.Timestamp(ts1), C.Timestamp(ts2)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// EqTimestampTimestamptz wraps MEOS C function eq_timestamp_timestamptz. +func EqTimestampTimestamptz(ts int64, tstz int64) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.eq_timestamp_timestamptz(C.Timestamp(ts), C.TimestampTz(tstz)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// EqTimestamptzTimestamp wraps MEOS C function eq_timestamptz_timestamp. +func EqTimestamptzTimestamp(tstz int64, ts int64) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.eq_timestamptz_timestamp(C.TimestampTz(tstz), C.Timestamp(ts)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// EqTimestamptzTimestamptz wraps MEOS C function eq_timestamptz_timestamptz. +func EqTimestamptzTimestamptz(tstz1 int64, tstz2 int64) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.eq_timestamptz_timestamptz(C.TimestampTz(tstz1), C.TimestampTz(tstz2)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// TODO float8_to_timestamptz: unsupported param float8 +// func Float8ToTimestamptz(...) { /* not yet handled by codegen */ } + + +// GtTimestampTimestamp wraps MEOS C function gt_timestamp_timestamp. +func GtTimestampTimestamp(ts1 int64, ts2 int64) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.gt_timestamp_timestamp(C.Timestamp(ts1), C.Timestamp(ts2)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// GtTimestampTimestamptz wraps MEOS C function gt_timestamp_timestamptz. +func GtTimestampTimestamptz(ts int64, tstz int64) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.gt_timestamp_timestamptz(C.Timestamp(ts), C.TimestampTz(tstz)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// GtTimestamptzTimestamp wraps MEOS C function gt_timestamptz_timestamp. +func GtTimestamptzTimestamp(tstz int64, ts int64) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.gt_timestamptz_timestamp(C.TimestampTz(tstz), C.Timestamp(ts)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// GeTimestampTimestamp wraps MEOS C function ge_timestamp_timestamp. +func GeTimestampTimestamp(ts1 int64, ts2 int64) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.ge_timestamp_timestamp(C.Timestamp(ts1), C.Timestamp(ts2)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// GeTimestampTimestamptz wraps MEOS C function ge_timestamp_timestamptz. +func GeTimestampTimestamptz(ts int64, tstz int64) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.ge_timestamp_timestamptz(C.Timestamp(ts), C.TimestampTz(tstz)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// GeTimestamptzTimestamp wraps MEOS C function ge_timestamptz_timestamp. +func GeTimestamptzTimestamp(tstz int64, ts int64) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.ge_timestamptz_timestamp(C.TimestampTz(tstz), C.Timestamp(ts)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// LeTimestampTimestamp wraps MEOS C function le_timestamp_timestamp. +func LeTimestampTimestamp(ts1 int64, ts2 int64) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.le_timestamp_timestamp(C.Timestamp(ts1), C.Timestamp(ts2)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// LeTimestampTimestamptz wraps MEOS C function le_timestamp_timestamptz. +func LeTimestampTimestamptz(ts int64, tstz int64) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.le_timestamp_timestamptz(C.Timestamp(ts), C.TimestampTz(tstz)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// LeTimestamptzTimestamp wraps MEOS C function le_timestamptz_timestamp. +func LeTimestamptzTimestamp(tstz int64, ts int64) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.le_timestamptz_timestamp(C.TimestampTz(tstz), C.Timestamp(ts)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// LtTimestampTimestamp wraps MEOS C function lt_timestamp_timestamp. +func LtTimestampTimestamp(ts1 int64, ts2 int64) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.lt_timestamp_timestamp(C.Timestamp(ts1), C.Timestamp(ts2)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// LtTimestampTimestamptz wraps MEOS C function lt_timestamp_timestamptz. +func LtTimestampTimestamptz(ts int64, tstz int64) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.lt_timestamp_timestamptz(C.Timestamp(ts), C.TimestampTz(tstz)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// LtTimestamptzTimestamp wraps MEOS C function lt_timestamptz_timestamp. +func LtTimestamptzTimestamp(tstz int64, ts int64) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.lt_timestamptz_timestamp(C.TimestampTz(tstz), C.Timestamp(ts)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// MinusTimestampInterval wraps MEOS C function minus_timestamp_interval. +func MinusTimestampInterval(ts int64, interv *Interval) (_r0 int64, _err error) { + C.meos_errno_reset() + _cret := C.minus_timestamp_interval(C.Timestamp(ts), interv._inner) + if _err = meosError(); _err != nil { + return + } + return int64(_cret), nil +} + + +// MinusTimestampTimestamp wraps MEOS C function minus_timestamp_timestamp. +func MinusTimestampTimestamp(ts1 int64, ts2 int64) (_r0 *Interval, _err error) { + C.meos_errno_reset() + _cret := C.minus_timestamp_timestamp(C.Timestamp(ts1), C.Timestamp(ts2)) + if _err = meosError(); _err != nil { + return + } + return &Interval{_inner: _cret}, nil +} + + +// MinusTimestamptzInterval wraps MEOS C function minus_timestamptz_interval. +func MinusTimestamptzInterval(tstz int64, interv *Interval) (_r0 int64, _err error) { + C.meos_errno_reset() + _cret := C.minus_timestamptz_interval(C.TimestampTz(tstz), interv._inner) + if _err = meosError(); _err != nil { + return + } + return int64(_cret), nil +} + + +// MinusTimestamptzIntervalAtZone wraps MEOS C function minus_timestamptz_interval_at_zone. +func MinusTimestamptzIntervalAtZone(tstz int64, interv *Interval, zone string) (_r0 int64, _err error) { + _c_zone := C.cstring_to_text(C.CString(zone)) + defer C.free(unsafe.Pointer(_c_zone)) + C.meos_errno_reset() + _cret := C.minus_timestamptz_interval_at_zone(C.TimestampTz(tstz), interv._inner, _c_zone) + if _err = meosError(); _err != nil { + return + } + return int64(_cret), nil +} + + +// MinusTimestamptzTimestamptz wraps MEOS C function minus_timestamptz_timestamptz. +func MinusTimestamptzTimestamptz(tstz1 int64, tstz2 int64) (_r0 *Interval, _err error) { + C.meos_errno_reset() + _cret := C.minus_timestamptz_timestamptz(C.TimestampTz(tstz1), C.TimestampTz(tstz2)) + if _err = meosError(); _err != nil { + return + } + return &Interval{_inner: _cret}, nil +} + + +// NeTimestampTimestamp wraps MEOS C function ne_timestamp_timestamp. +func NeTimestampTimestamp(ts1 int64, ts2 int64) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.ne_timestamp_timestamp(C.Timestamp(ts1), C.Timestamp(ts2)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// NeTimestampTimestamptz wraps MEOS C function ne_timestamp_timestamptz. +func NeTimestampTimestamptz(ts int64, tstz int64) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.ne_timestamp_timestamptz(C.Timestamp(ts), C.TimestampTz(tstz)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// NeTimestamptzTimestamp wraps MEOS C function ne_timestamptz_timestamp. +func NeTimestamptzTimestamp(tstz int64, ts int64) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.ne_timestamptz_timestamp(C.TimestampTz(tstz), C.Timestamp(ts)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// TimestampAge wraps MEOS C function timestamp_age. +func TimestampAge(ts1 int64, ts2 int64) (_r0 *Interval, _err error) { + C.meos_errno_reset() + _cret := C.timestamp_age(C.Timestamp(ts1), C.Timestamp(ts2)) + if _err = meosError(); _err != nil { + return + } + return &Interval{_inner: _cret}, nil +} + + +// TimestampAtLocal wraps MEOS C function timestamp_at_local. +func TimestampAtLocal(ts int64) (_r0 int64, _err error) { + C.meos_errno_reset() + _cret := C.timestamp_at_local(C.Timestamp(ts)) + if _err = meosError(); _err != nil { + return + } + return int64(_cret), nil +} + + +// TimestampBin wraps MEOS C function timestamp_bin. +func TimestampBin(ts int64, stride *Interval, origin int64) (_r0 int64, _err error) { + C.meos_errno_reset() + _cret := C.timestamp_bin(C.Timestamp(ts), stride._inner, C.Timestamp(origin)) + if _err = meosError(); _err != nil { + return + } + return int64(_cret), nil +} + + +// TODO timestamp_extract: unsupported return type Numeric +// func TimestampExtract(...) { /* not yet handled by codegen */ } + + +// TimestampHash wraps MEOS C function timestamp_hash. +func TimestampHash(ts int64) (_r0 uint32, _err error) { + C.meos_errno_reset() + _cret := C.timestamp_hash(C.Timestamp(ts)) + if _err = meosError(); _err != nil { + return + } + return uint32(_cret), nil +} + + +// TimestampHashExtended wraps MEOS C function timestamp_hash_extended. +func TimestampHashExtended(tstz int64, seed uint64) (_r0 uint64, _err error) { + C.meos_errno_reset() + _cret := C.timestamp_hash_extended(C.TimestampTz(tstz), C.uint64_t(seed)) + if _err = meosError(); _err != nil { + return + } + return uint64(_cret), nil +} + + +// TimestampIsFinite wraps MEOS C function timestamp_is_finite. +func TimestampIsFinite(ts int64) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.timestamp_is_finite(C.Timestamp(ts)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// TimestampIzone wraps MEOS C function timestamp_izone. +func TimestampIzone(ts int64, zone *Interval) (_r0 int64, _err error) { + C.meos_errno_reset() + _cret := C.timestamp_izone(C.Timestamp(ts), zone._inner) + if _err = meosError(); _err != nil { + return + } + return int64(_cret), nil +} + + +// TimeOfDay wraps MEOS C function time_of_day. +func TimeOfDay() (_r0 string, _err error) { + C.meos_errno_reset() + _cret := C.time_of_day() + if _err = meosError(); _err != nil { + return + } + return C.GoString(C.text_to_cstring(_cret)), nil +} + + +// TimestampLarger wraps MEOS C function timestamp_larger. +func TimestampLarger(ts1 int64, ts2 int64) (_r0 int64, _err error) { + C.meos_errno_reset() + _cret := C.timestamp_larger(C.Timestamp(ts1), C.Timestamp(ts2)) + if _err = meosError(); _err != nil { + return + } + return int64(_cret), nil +} + + +// TODO timestamp_make: unsupported param float8 +// func TimestampMake(...) { /* not yet handled by codegen */ } + + +// TimestampOverlaps wraps MEOS C function timestamp_overlaps. +func TimestampOverlaps(ts1 int64, te1 int64, ts2 int64, te2 int64) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.timestamp_overlaps(C.Timestamp(ts1), C.Timestamp(te1), C.Timestamp(ts2), C.Timestamp(te2)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// TODO timestamp_part: unsupported return type float8 +// func TimestampPart(...) { /* not yet handled by codegen */ } + + +// TimestampScale wraps MEOS C function timestamp_scale. +func TimestampScale(ts int64, typmod int32) (_r0 int64, _err error) { + C.meos_errno_reset() + _cret := C.timestamp_scale(C.Timestamp(ts), C.int32(typmod)) + if _err = meosError(); _err != nil { + return + } + return int64(_cret), nil +} + + +// TimestampSmaller wraps MEOS C function timestamp_smaller. +func TimestampSmaller(ts1 int64, ts2 int64) (_r0 int64, _err error) { + C.meos_errno_reset() + _cret := C.timestamp_smaller(C.Timestamp(ts1), C.Timestamp(ts2)) + if _err = meosError(); _err != nil { + return + } + return int64(_cret), nil +} + + +// TimestampToTimestamptz wraps MEOS C function timestamp_to_timestamptz. +func TimestampToTimestamptz(ts int64) (_r0 int64, _err error) { + C.meos_errno_reset() + _cret := C.timestamp_to_timestamptz(C.Timestamp(ts)) + if _err = meosError(); _err != nil { + return + } + return int64(_cret), nil +} + + +// TimestampTrunc wraps MEOS C function timestamp_trunc. +func TimestampTrunc(ts int64, units string) (_r0 int64, _err error) { + _c_units := C.cstring_to_text(C.CString(units)) + defer C.free(unsafe.Pointer(_c_units)) + C.meos_errno_reset() + _cret := C.timestamp_trunc(C.Timestamp(ts), _c_units) + if _err = meosError(); _err != nil { + return + } + return int64(_cret), nil +} + + +// TimestampZone wraps MEOS C function timestamp_zone. +func TimestampZone(ts int64, zone string) (_r0 int64, _err error) { + _c_zone := C.cstring_to_text(C.CString(zone)) + defer C.free(unsafe.Pointer(_c_zone)) + C.meos_errno_reset() + _cret := C.timestamp_zone(C.Timestamp(ts), _c_zone) + if _err = meosError(); _err != nil { + return + } + return int64(_cret), nil +} + + +// TimestamptzAge wraps MEOS C function timestamptz_age. +func TimestamptzAge(tstz1 int64, tstz2 int64) (_r0 *Interval, _err error) { + C.meos_errno_reset() + _cret := C.timestamptz_age(C.TimestampTz(tstz1), C.TimestampTz(tstz2)) + if _err = meosError(); _err != nil { + return + } + return &Interval{_inner: _cret}, nil +} + + +// TimestamptzAtLocal wraps MEOS C function timestamptz_at_local. +func TimestamptzAtLocal(tstz int64) (_r0 int64, _err error) { + C.meos_errno_reset() + _cret := C.timestamptz_at_local(C.TimestampTz(tstz)) + if _err = meosError(); _err != nil { + return + } + return int64(_cret), nil +} + + +// TimestamptzBin wraps MEOS C function timestamptz_bin. +func TimestamptzBin(tstz int64, stride *Interval, origin int64) (_r0 int64, _err error) { + C.meos_errno_reset() + _cret := C.timestamptz_bin(C.TimestampTz(tstz), stride._inner, C.TimestampTz(origin)) + if _err = meosError(); _err != nil { + return + } + return int64(_cret), nil +} + + +// TODO timestamptz_extract: unsupported return type Numeric +// func TimestamptzExtract(...) { /* not yet handled by codegen */ } + + +// TimestamptzHash wraps MEOS C function timestamptz_hash. +func TimestamptzHash(tstz int64) (_r0 int32, _err error) { + C.meos_errno_reset() + _cret := C.timestamptz_hash(C.TimestampTz(tstz)) + if _err = meosError(); _err != nil { + return + } + return int32(_cret), nil +} + + +// TimestamptzHashExtended wraps MEOS C function timestamptz_hash_extended. +func TimestamptzHashExtended(tstz int64, seed uint64) (_r0 uint64, _err error) { + C.meos_errno_reset() + _cret := C.timestamptz_hash_extended(C.TimestampTz(tstz), C.uint64_t(seed)) + if _err = meosError(); _err != nil { + return + } + return uint64(_cret), nil +} + + +// TimestamptzIzone wraps MEOS C function timestamptz_izone. +func TimestamptzIzone(tstz int64, zone *Interval) (_r0 int64, _err error) { + C.meos_errno_reset() + _cret := C.timestamptz_izone(C.TimestampTz(tstz), zone._inner) + if _err = meosError(); _err != nil { + return + } + return int64(_cret), nil +} + + +// TODO timestamptz_make: unsupported param float8 +// func TimestamptzMake(...) { /* not yet handled by codegen */ } + + +// TODO timestamptz_make_at_timezone: unsupported param float8 +// func TimestamptzMakeAtTimezone(...) { /* not yet handled by codegen */ } + + +// TimestamptzOverlaps wraps MEOS C function timestamptz_overlaps. +func TimestamptzOverlaps(ts1 int64, te1 int64, ts2 int64, te2 int64) (_r0 bool, _err error) { + C.meos_errno_reset() + _cret := C.timestamptz_overlaps(C.TimestampTz(ts1), C.TimestampTz(te1), C.TimestampTz(ts2), C.TimestampTz(te2)) + if _err = meosError(); _err != nil { + return + } + return bool(_cret), nil +} + + +// TODO timestamptz_part: unsupported return type float8 +// func TimestamptzPart(...) { /* not yet handled by codegen */ } + + +// TimestamptzScale wraps MEOS C function timestamptz_scale. +func TimestamptzScale(tstz int64, typmod int32) (_r0 int64, _err error) { + C.meos_errno_reset() + _cret := C.timestamptz_scale(C.TimestampTz(tstz), C.int32(typmod)) + if _err = meosError(); _err != nil { + return + } + return int64(_cret), nil +} + + +// TimestamptzShift wraps MEOS C function timestamptz_shift. +func TimestamptzShift(tstz int64, interv *Interval) (_r0 int64, _err error) { + C.meos_errno_reset() + _cret := C.timestamptz_shift(C.TimestampTz(tstz), interv._inner) + if _err = meosError(); _err != nil { + return + } + return int64(_cret), nil +} + + +// TimestamptzToTimestamp wraps MEOS C function timestamptz_to_timestamp. +func TimestamptzToTimestamp(tstz int64) (_r0 int64, _err error) { + C.meos_errno_reset() + _cret := C.timestamptz_to_timestamp(C.TimestampTz(tstz)) + if _err = meosError(); _err != nil { + return + } + return int64(_cret), nil +} + + +// TimestamptzTrunc wraps MEOS C function timestamptz_trunc. +func TimestamptzTrunc(tstz int64, units string) (_r0 int64, _err error) { + _c_units := C.cstring_to_text(C.CString(units)) + defer C.free(unsafe.Pointer(_c_units)) + C.meos_errno_reset() + _cret := C.timestamptz_trunc(C.TimestampTz(tstz), _c_units) + if _err = meosError(); _err != nil { + return + } + return int64(_cret), nil +} + + +// TimestamptzTruncZone wraps MEOS C function timestamptz_trunc_zone. +func TimestamptzTruncZone(tstz int64, units string, zone string) (_r0 int64, _err error) { + _c_units := C.cstring_to_text(C.CString(units)) + defer C.free(unsafe.Pointer(_c_units)) + _c_zone := C.cstring_to_text(C.CString(zone)) + defer C.free(unsafe.Pointer(_c_zone)) + C.meos_errno_reset() + _cret := C.timestamptz_trunc_zone(C.TimestampTz(tstz), _c_units, _c_zone) + if _err = meosError(); _err != nil { + return + } + return int64(_cret), nil +} + + +// TimestamptzZone wraps MEOS C function timestamptz_zone. +func TimestamptzZone(tstz int64, zone string) (_r0 int64, _err error) { + _c_zone := C.cstring_to_text(C.CString(zone)) + defer C.free(unsafe.Pointer(_c_zone)) + C.meos_errno_reset() + _cret := C.timestamptz_zone(C.TimestampTz(tstz), _c_zone) + if _err = meosError(); _err != nil { + return + } + return int64(_cret), nil +} + diff --git a/functions/types.go b/functions/types.go index 6b1b41b..a430b3b 100644 --- a/functions/types.go +++ b/functions/types.go @@ -4,17 +4,29 @@ package functions #include #include "meos.h" #include "meos_catalog.h" +#include "meos_cbuffer.h" +#include "meos_cellindex.h" #include "meos_geo.h" +#include "meos_h3.h" #include "meos_internal.h" #include "meos_internal_geo.h" +#include "meos_json.h" #include "meos_npoint.h" -#include "meos_cbuffer.h" +#include "meos_pointcloud.h" #include "meos_pose.h" -#include "meos_rgeo.h" -#include "meos_h3.h" #include "meos_quadbin.h" -#include "meos_json.h" -#include "meos_pointcloud.h" +#include "meos_raster.h" +#include "meos_rgeo.h" +#include "meos_s2cell.h" +#include "pg_basetypes.h" +#include "pg_bool.h" +#include "pg_date.h" +#include "pg_float.h" +#include "pg_int.h" +#include "pg_interval.h" +#include "pg_text.h" +#include "pg_time.h" +#include "pg_timestamp.h" */ import "C" import ( @@ -334,3 +346,17 @@ const ( NullHandleType_NULL_DELETE NullHandleType = 3 NullHandleType_NULL_RETURN NullHandleType = 4 ) +type MeosPixType C.MeosPixType +const ( + MeosPixType_MEOS_PT_UINT8 MeosPixType = 0 + MeosPixType_MEOS_PT_INT16 MeosPixType = 1 + MeosPixType_MEOS_PT_INT32 MeosPixType = 2 + MeosPixType_MEOS_PT_FLOAT32 MeosPixType = 3 + MeosPixType_MEOS_PT_FLOAT64 MeosPixType = 4 + MeosPixType_MEOS_PT_INT8 MeosPixType = 5 + MeosPixType_MEOS_PT_UINT16 MeosPixType = 6 + MeosPixType_MEOS_PT_UINT32 MeosPixType = 7 + MeosPixType_MEOS_PT_INT64 MeosPixType = 8 + MeosPixType_MEOS_PT_UINT64 MeosPixType = 9 + MeosPixType_MEOS_PT_FLOAT16 MeosPixType = 10 +) diff --git a/tools/README.md b/tools/README.md index 1c65019..4be41d1 100644 --- a/tools/README.md +++ b/tools/README.md @@ -15,11 +15,16 @@ python3 tools/codegen.py ## Coverage today -2369 candidate functions across the six public headers. 2199 emit -cleanly; 170 are excluded as `Datum`-bearing internal helpers (the -hand-written surface exposes those through typed overloads which the -codegen cannot synthesise from the IDL). Zero unresolved TODOs and -zero explicit skips remain. The skiplist primitives that take +The generator binds every non-vendored catalog function of a bound family +(the catalog's `family`, all on, `=OFF` in the environment to drop +one) whose header the libmeos prefix installs, one Go file per header, the +headers taken from the catalog's `file` field (`header_plan`). Against +MobilityDB master it emits 4612 wrappers; 144 shapes stay unresolved, 191 +are excluded as `Datum`-bearing internal helpers (the hand-written surface +exposes those through typed overloads which the codegen cannot synthesise +from the IDL), and the 227 internal functions of `pgtypes.h` and +`pgsql_compat.h`, headers the prefix does not install, are named in its +report and not bound. The skiplist primitives that take function-pointer arguments (`comp_fn`, `merge_fn`, `datum_func2`) or operate on `void **` element arrays surface as `unsafe.Pointer`, matching how PyMEOS-CFFI exposes them as `_ffi.CData` and MEOS.NET as diff --git a/tools/codegen.py b/tools/codegen.py index f8dc652..d1c0d31 100644 --- a/tools/codegen.py +++ b/tools/codegen.py @@ -20,26 +20,66 @@ from __future__ import annotations import json +import os import re +import subprocess import sys from dataclasses import dataclass from pathlib import Path -HEADER_FILES = [ - "meos.h", - "meos_catalog.h", - "meos_geo.h", - "meos_internal.h", - "meos_internal_geo.h", - "meos_npoint.h", - "meos_cbuffer.h", - "meos_pose.h", - "meos_rgeo.h", - "meos_h3.h", - "meos_quadbin.h", - "meos_json.h", - "meos_pointcloud.h", -] + +def _family_enabled(entry: dict) -> bool: + """Whether the family of a catalog entry is bound, as #familyEnabled of JMEOS + ``FunctionsGenerator.java`` decides it: every family is, unless the environment + names it OFF (``H3=OFF``), and the core always is.""" + family = entry.get("family") + return not family or family == "CORE" or \ + os.environ.get(family, "").upper() not in ("OFF", "0", "FALSE") + + +def _installed_headers() -> set[str] | None: + """The names of the headers the libmeos prefix installs at the top of its include + directory, as #get_installed_headers of PyMEOS-CFFI ``builder/build_header.py`` + lists them: names only, no header is read. The directory is the one + ``pkg-config --variable=includedir meos`` names, which ``MEOS_INCLUDEDIR`` + overrides; None when no prefix is at hand.""" + include_dir = os.environ.get("MEOS_INCLUDEDIR") + if not include_dir: + try: + include_dir = subprocess.check_output( + ["pkg-config", "--variable=includedir", "meos"], text=True).strip() + except (OSError, subprocess.CalledProcessError): + return None + path = Path(include_dir) + if not path.is_dir(): + return None + return {f.name for f in path.iterdir() if f.suffix == ".h"} + + +def _meos_first(header: str) -> tuple[bool, str]: + """The order of the headers, meos.h first as the others build on its types, the + key #header_files of PyMEOS-CFFI ``builder/build_pymeos.py`` sorts by.""" + return header != "meos.h", header + + +def header_plan(idl: dict) -> tuple[list[str], list[str], list[str]]: + """``(groups, includes, uninstalled)``: the headers declaring a non-vendored + catalog function of a bound family that the prefix installs, one Go file each; + the headers the preamble includes, those of the non-vendored functions, + structures and enumerations that the prefix installs; and the headers declaring + such a function that the prefix does not install, whose functions the flat + layer does not bind and the report names. No sibling routine builds the lists; + #generate reads them.""" + declaring = {f["file"] for f in idl["functions"] + if not f.get("vendored") and _family_enabled(f)} + wanted = declaring | {e["file"] for kind in ("structs", "enums") + for e in idl.get(kind, []) if not e.get("vendored")} + installed = _installed_headers() + includes = wanted if installed is None else wanted & installed + groups = declaring & set(includes) + return (sorted(groups, key=_meos_first), sorted(includes, key=_meos_first), + sorted(declaring - groups, key=_meos_first)) + # Forward-declared opaque types we never wrap (mirrors the cdef skip list # the PyMEOS-CFFI builder applies). @@ -321,8 +361,9 @@ def configure(idl: dict) -> None: go_name, f"C.{c_name}({{}})", f"{go_name}({{}})") -def emit_types(idl: dict, corpus: str) -> str: - """Emit the type layer the flat wrappers depend on: one opaque handle +def emit_types(idl: dict, corpus: str, include_block: str) -> str: + """Emit the type layer the flat wrappers depend on, under the preamble whose + ``include_block`` #generate builds from #header_plan: one opaque handle struct per MEOS wrapper type and one Go type + const block per catalog enum. This is the meos-rs / JMEOS opaque-handle pattern (no OO interface, no runtime subtype dispatch) expressed in Go: every MEOS struct is a @@ -384,7 +425,8 @@ def referenced(go_name: str) -> bool: out.append(f"\t{go_name}_{v['name']} {go_name} = {int(v['value'])}") out.append(")") - header = _PER_HEADER_PREAMBLE + "\n".join(out) + "\n" + header = (_PER_HEADER_PREAMBLE.replace("@INCLUDES@", include_block) + + "\n".join(out) + "\n") return header @@ -1124,19 +1166,7 @@ def _todo_stub(c_name: str, reason: str) -> str: #cgo linux CFLAGS: -I/usr/include/h3 #include -#include "meos.h" -#include "meos_catalog.h" -#include "meos_geo.h" -#include "meos_internal.h" -#include "meos_internal_geo.h" -#include "meos_npoint.h" -#include "meos_cbuffer.h" -#include "meos_pose.h" -#include "meos_rgeo.h" -#include "meos_h3.h" -#include "meos_quadbin.h" -#include "meos_json.h" -#include "meos_pointcloud.h" +@INCLUDES@ */ import "C" @@ -1178,19 +1208,7 @@ def _todo_stub(c_name: str, reason: str) -> str: /* #include -#include "meos.h" -#include "meos_catalog.h" -#include "meos_geo.h" -#include "meos_internal.h" -#include "meos_internal_geo.h" -#include "meos_npoint.h" -#include "meos_cbuffer.h" -#include "meos_pose.h" -#include "meos_rgeo.h" -#include "meos_h3.h" -#include "meos_quadbin.h" -#include "meos_json.h" -#include "meos_pointcloud.h" +@INCLUDES@ */ import "C" import ( @@ -1207,17 +1225,27 @@ def generate(idl_path: Path, out_dir: Path) -> dict: configure(idl) out_dir.mkdir(parents=True, exist_ok=True) - entries_by_file: dict[str, list[dict]] = {h: [] for h in HEADER_FILES} - for entry in idl["functions"]: + groups, includes, uninstalled = header_plan(idl) + # One file per header the plan names, so the files of a header it no longer names + # leave with the run that drops it + for stale in out_dir.glob("meos_*.go"): + stale.unlink() + include_block = "\n".join(f'#include "{h}"' for h in includes) + bound = [e for e in idl["functions"] + if not e.get("vendored") and _family_enabled(e)] + entries_by_file: dict[str, list[dict]] = {h: [] for h in groups} + for entry in bound: if entry["file"] in entries_by_file: entries_by_file[entry["file"]].append(entry) - stats = {"emitted": 0, "skipped": 0, "explicit_skip": 0, "datum": 0, "by_header": {}} + stats = {"emitted": 0, "skipped": 0, "explicit_skip": 0, "datum": 0, "by_header": {}, + "uninstalled": {h: sum(e["file"] == h for e in bound) for h in uninstalled}} corpus_parts: list[str] = [] # The shared per-file cgo preamble, with the union-operator aliases spliced # into the C block so every file that calls a ``C.gunion_*`` resolves it. - preamble = _PER_HEADER_PREAMBLE.replace("*/", _union_alias_block(idl) + "\n*/", 1) - for header in HEADER_FILES: + preamble = _PER_HEADER_PREAMBLE.replace("@INCLUDES@", include_block) + preamble = preamble.replace("*/", _union_alias_block(idl) + "\n*/", 1) + for header in groups: emitted_funcs = [] local_emit = local_skip = local_explicit = local_datum = 0 for entry in entries_by_file[header]: @@ -1254,11 +1282,12 @@ def generate(idl_path: Path, out_dir: Path) -> dict: # The single cgo preamble file with all #includes lives next to the # generated wrappers; Go's cgo machinery merges directives across files. - (out_dir / "cgo.go").write_text(_CGO_FILE) + (out_dir / "cgo.go").write_text(_CGO_FILE.replace("@INCLUDES@", include_block)) # The type layer (opaque handle structs + enums) the wrappers depend on, # restricted to the types the emitted wrappers actually reference. - (out_dir / "types.go").write_text(emit_types(idl, "\n".join(corpus_parts))) + (out_dir / "types.go").write_text( + emit_types(idl, "\n".join(corpus_parts), include_block)) return stats @@ -1273,5 +1302,7 @@ def generate(idl_path: Path, out_dir: Path) -> dict: print(f"Skipped {stats['skipped']} as TODO (unresolved signature shape)") print(f"Excluded {stats['explicit_skip']} via meta/meos-meta.json shape.skip declarations") print(f"Excluded {stats['datum']} as Datum-bearing internal helpers") + for h, n in stats["uninstalled"].items(): + print(f"Not bound: {n} functions of {h}, a header the prefix does not install") for h, (e, s, sk, d) in stats["by_header"].items(): print(f" {h}: {e} emitted, {s} TODO, {sk} explicit-skip, {d} Datum") diff --git a/tools/refresh.conf b/tools/refresh.conf index 47fe948..7e8d066 100644 --- a/tools/refresh.conf +++ b/tools/refresh.conf @@ -6,7 +6,8 @@ # and projects the catalog's object model into types/. One command regenerates both, so neither # can be refreshed without the other -- types/ calls the wrappers codegen emits. # -# PKG_CONFIG_PATH names the prefix this run just built. functions/cgo.go says +# PKG_CONFIG_PATH names the prefix this run just built, for the generator, which includes the +# catalog's headers that prefix installs, and for cgo. functions/cgo.go says # `#cgo pkg-config: meos`, so cgo resolves whichever meos.pc the default search path answers # with -- an older install under /usr/local otherwise wins, and it publishes none of the # -D=1 defines the fresh meos.pc carries. Each declaration then stays behind its @@ -17,6 +18,6 @@ ENGINE=go BUILD_DIR=. BUILD_LIBMEOS=true CATALOG_DEST=tools/meos-idl.json -BUILD_CMD='python3 tools/objectgen.py +BUILD_CMD='PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig" python3 tools/objectgen.py PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig" CGO_LDFLAGS="-L$PREFIX/lib -lmeos" LD_LIBRARY_PATH="$PREFIX/lib" go build ./functions ./types [ -n "${SKIP_TESTS:-}" ] || CGO_ENABLED=0 go test ./tools/parity/' diff --git a/types/geo.go b/types/geo.go index e24620f..16dae43 100644 --- a/types/geo.go +++ b/types/geo.go @@ -571,3 +571,21 @@ func GeoToQuadbinSet(gs *TRGeometrySeqSet, resolution int32) (*Set, error) { } return SetFromPointer(_r0.Pointer()), nil } + +// GeoToS2cellCell is MEOS geo_to_s2cell_cell. +func GeoToS2cellCell(point *TRGeometrySeqSet, level int32) (uint64, error) { + _r0, _err := functions.GeoToS2cellCell(functions.GeomFromPointer(point.Pointer()), level) + if _err != nil { + return 0, _err + } + return _r0, nil +} + +// GeoToS2cellSet is MEOS geo_to_s2cell_set. +func GeoToS2cellSet(gs *TRGeometrySeqSet, level int32) (*Set, error) { + _r0, _err := functions.GeoToS2cellSet(functions.GeomFromPointer(gs.Pointer()), level) + if _err != nil { + return nil, _err + } + return SetFromPointer(_r0.Pointer()), nil +} diff --git a/types/raquet.go b/types/raquet.go index 6b3b0cb..b5eab6d 100644 --- a/types/raquet.go +++ b/types/raquet.go @@ -4,6 +4,8 @@ package types import ( "unsafe" + + "github.com/MobilityDB/GoMEOS/functions" ) type Raquet struct { @@ -20,3 +22,276 @@ func RaquetFromPointer(p unsafe.Pointer) *Raquet { v.ptr = p return v } + +// RaquetPixtypeSize is MEOS raquet_pixtype_size. +func RaquetPixtypeSize(pixtype functions.MeosPixType) (uint, error) { + _r0, _err := functions.RaquetPixtypeSize(pixtype) + if _err != nil { + return 0, _err + } + return _r0, nil +} + +// RaquetPixtypeFromString is MEOS raquet_pixtype_from_string. +func RaquetPixtypeFromString(str string) (functions.MeosPixType, error) { + _r0, _err := functions.RaquetPixtypeFromString(str) + if _err != nil { + return 0, _err + } + return _r0, nil +} + +// RaquetIn is MEOS raquet_in. +func RaquetIn(str string) (unsafe.Pointer, error) { + _r0, _err := functions.RaquetIn(str) + if _err != nil { + return nil, _err + } + return _r0, nil +} + +// RaquetOut is MEOS raquet_out. +func RaquetOut(rq unsafe.Pointer) (string, error) { + _r0, _err := functions.RaquetOut(rq) + if _err != nil { + return "", _err + } + return _r0, nil +} + +// RaquetFromWKB is MEOS raquet_from_wkb. +func RaquetFromWKB(wkb unsafe.Pointer, size uint) (unsafe.Pointer, error) { + _r0, _err := functions.RaquetFromWKB(wkb, size) + if _err != nil { + return nil, _err + } + return _r0, nil +} + +// RaquetFromHEXWKB is MEOS raquet_from_hexwkb. +func RaquetFromHEXWKB(hexwkb string) (unsafe.Pointer, error) { + _r0, _err := functions.RaquetFromHexwkb(hexwkb) + if _err != nil { + return nil, _err + } + return _r0, nil +} + +// RaquetAsWKB is MEOS raquet_as_wkb. +func RaquetAsWKB(rq unsafe.Pointer, variant uint8, size_out unsafe.Pointer) (unsafe.Pointer, error) { + _r0, _err := functions.RaquetAsWKB(rq, variant, size_out) + if _err != nil { + return nil, _err + } + return _r0, nil +} + +// RaquetAsHEXWKB is MEOS raquet_as_hexwkb. +func RaquetAsHEXWKB(rq unsafe.Pointer, variant uint8, size_out unsafe.Pointer) (string, error) { + _r0, _err := functions.RaquetAsHexwkb(rq, variant, size_out) + if _err != nil { + return "", _err + } + return _r0, nil +} + +// RaquetMake is MEOS raquet_make. +func RaquetMake(quadbin uint64, width int32, height int32, pixtype functions.MeosPixType, nodata float64, has_nodata bool, pixels unsafe.Pointer, pixels_size uint) (unsafe.Pointer, error) { + _r0, _err := functions.RaquetMake(quadbin, width, height, pixtype, nodata, has_nodata, pixels, pixels_size) + if _err != nil { + return nil, _err + } + return _r0, nil +} + +// RaquetCopy is MEOS raquet_copy. +func RaquetCopy(rq unsafe.Pointer) (unsafe.Pointer, error) { + _r0, _err := functions.RaquetCopy(rq) + if _err != nil { + return nil, _err + } + return _r0, nil +} + +// RaquetRead is MEOS raquet_read. +func RaquetRead(path string, quadbin uint64) (unsafe.Pointer, error) { + _r0, _err := functions.RaquetRead(path, quadbin) + if _err != nil { + return nil, _err + } + return _r0, nil +} + +// RaquetReadBytes is MEOS raquet_read_bytes. +func RaquetReadBytes(data unsafe.Pointer, size uint, quadbin uint64) (unsafe.Pointer, error) { + _r0, _err := functions.RaquetReadBytes(data, size, quadbin) + if _err != nil { + return nil, _err + } + return _r0, nil +} + +// RaquetQuadbin is MEOS raquet_quadbin. +func RaquetQuadbin(rq unsafe.Pointer) (uint64, error) { + _r0, _err := functions.RaquetQuadbin(rq) + if _err != nil { + return 0, _err + } + return _r0, nil +} + +// RaquetWidth is MEOS raquet_width. +func RaquetWidth(rq unsafe.Pointer) (int, error) { + _r0, _err := functions.RaquetWidth(rq) + if _err != nil { + return 0, _err + } + return _r0, nil +} + +// RaquetHeight is MEOS raquet_height. +func RaquetHeight(rq unsafe.Pointer) (int, error) { + _r0, _err := functions.RaquetHeight(rq) + if _err != nil { + return 0, _err + } + return _r0, nil +} + +// RaquetBandPixelType is MEOS raquet_band_pixel_type. +func RaquetBandPixelType(rq unsafe.Pointer) (string, error) { + _r0, _err := functions.RaquetBandPixelType(rq) + if _err != nil { + return "", _err + } + return _r0, nil +} + +// RaquetBandHasNodataValue is MEOS raquet_band_has_nodata_value. +func RaquetBandHasNodataValue(rq unsafe.Pointer) (bool, error) { + _r0, _err := functions.RaquetBandHasNodataValue(rq) + if _err != nil { + return false, _err + } + return _r0, nil +} + +// RaquetBandNodataValue is MEOS raquet_band_nodata_value. +func RaquetBandNodataValue(rq unsafe.Pointer) (float64, bool, error) { + _found, _value, _err := functions.RaquetBandNodataValue(rq) + if _err != nil { + return 0, false, _err + } + if !_found { + return 0, false, nil + } + return _value, true, nil +} + +// RaquetPixels is MEOS raquet_pixels. +func RaquetPixels(rq unsafe.Pointer, size_out unsafe.Pointer) (unsafe.Pointer, error) { + _r0, _err := functions.RaquetPixels(rq, size_out) + if _err != nil { + return nil, _err + } + return _r0, nil +} + +// RaquetHash is MEOS raquet_hash. +func RaquetHash(rq unsafe.Pointer) (uint32, error) { + _r0, _err := functions.RaquetHash(rq) + if _err != nil { + return 0, _err + } + return _r0, nil +} + +// RaquetHashExtended is MEOS raquet_hash_extended. +func RaquetHashExtended(rq unsafe.Pointer, seed uint64) (uint64, error) { + _r0, _err := functions.RaquetHashExtended(rq, seed) + if _err != nil { + return 0, _err + } + return _r0, nil +} + +// RaquetMemSize is MEOS raquet_mem_size. +func RaquetMemSize(rq unsafe.Pointer) (int, error) { + _r0, _err := functions.RaquetMemSize(rq) + if _err != nil { + return 0, _err + } + return _r0, nil +} + +// RaquetToStbox is MEOS raquet_to_stbox. +func RaquetToStbox(rq unsafe.Pointer) (*STBox, error) { + _r0, _err := functions.RaquetToSTBOX(rq) + if _err != nil { + return nil, _err + } + return STBoxFromPointer(_r0.Pointer()), nil +} + +// RaquetCmp is MEOS raquet_cmp. +func RaquetCmp(rq1 unsafe.Pointer, rq2 unsafe.Pointer) (int, error) { + _r0, _err := functions.RaquetCmp(rq1, rq2) + if _err != nil { + return 0, _err + } + return _r0, nil +} + +// RaquetEq is MEOS raquet_eq. +func RaquetEq(rq1 unsafe.Pointer, rq2 unsafe.Pointer) (bool, error) { + _r0, _err := functions.RaquetEq(rq1, rq2) + if _err != nil { + return false, _err + } + return _r0, nil +} + +// RaquetNe is MEOS raquet_ne. +func RaquetNe(rq1 unsafe.Pointer, rq2 unsafe.Pointer) (bool, error) { + _r0, _err := functions.RaquetNe(rq1, rq2) + if _err != nil { + return false, _err + } + return _r0, nil +} + +// RaquetLt is MEOS raquet_lt. +func RaquetLt(rq1 unsafe.Pointer, rq2 unsafe.Pointer) (bool, error) { + _r0, _err := functions.RaquetLt(rq1, rq2) + if _err != nil { + return false, _err + } + return _r0, nil +} + +// RaquetLe is MEOS raquet_le. +func RaquetLe(rq1 unsafe.Pointer, rq2 unsafe.Pointer) (bool, error) { + _r0, _err := functions.RaquetLe(rq1, rq2) + if _err != nil { + return false, _err + } + return _r0, nil +} + +// RaquetGe is MEOS raquet_ge. +func RaquetGe(rq1 unsafe.Pointer, rq2 unsafe.Pointer) (bool, error) { + _r0, _err := functions.RaquetGe(rq1, rq2) + if _err != nil { + return false, _err + } + return _r0, nil +} + +// RaquetGt is MEOS raquet_gt. +func RaquetGt(rq1 unsafe.Pointer, rq2 unsafe.Pointer) (bool, error) { + _r0, _err := functions.RaquetGt(rq1, rq2) + if _err != nil { + return false, _err + } + return _r0, nil +} diff --git a/types/raster.go b/types/raster.go index e0d0455..d05299c 100644 --- a/types/raster.go +++ b/types/raster.go @@ -4,6 +4,8 @@ package types import ( "unsafe" + + "github.com/MobilityDB/GoMEOS/functions" ) type Raster struct { @@ -20,3 +22,474 @@ func RasterFromPointer(p unsafe.Pointer) *Raster { v.ptr = p return v } + +// RasterFromWKB is MEOS raster_from_wkb. +func RasterFromWKB(wkb unsafe.Pointer, size uint) (unsafe.Pointer, error) { + _r0, _err := functions.RasterFromWKB(wkb, size) + if _err != nil { + return nil, _err + } + return _r0, nil +} + +// RasterFromHEXWKB is MEOS raster_from_hexwkb. +func RasterFromHEXWKB(hexwkb string) (unsafe.Pointer, error) { + _r0, _err := functions.RasterFromHexwkb(hexwkb) + if _err != nil { + return nil, _err + } + return _r0, nil +} + +// RasterAsWKB is MEOS raster_as_wkb. +func RasterAsWKB(rast unsafe.Pointer, variant uint8, size_out unsafe.Pointer) (unsafe.Pointer, error) { + _r0, _err := functions.RasterAsWKB(rast, variant, size_out) + if _err != nil { + return nil, _err + } + return _r0, nil +} + +// RasterAsHEXWKB is MEOS raster_as_hexwkb. +func RasterAsHEXWKB(rast unsafe.Pointer, variant uint8, size_out unsafe.Pointer) (string, error) { + _r0, _err := functions.RasterAsHexwkb(rast, variant, size_out) + if _err != nil { + return "", _err + } + return _r0, nil +} + +// RasterCopy is MEOS raster_copy. +func RasterCopy(rast unsafe.Pointer) (unsafe.Pointer, error) { + _r0, _err := functions.RasterCopy(rast) + if _err != nil { + return nil, _err + } + return _r0, nil +} + +// RasterMake is MEOS raster_make. +func RasterMake(width int, height int, upperleftx float64, upperlefty float64, scalex float64, scaley float64, skewx float64, skewy float64, srid int32, pixeltype string, nodataval float64, has_nodata bool, pixels unsafe.Pointer, size uint) (unsafe.Pointer, error) { + _r0, _err := functions.RasterMake(width, height, upperleftx, upperlefty, scalex, scaley, skewx, skewy, srid, pixeltype, nodataval, has_nodata, pixels, size) + if _err != nil { + return nil, _err + } + return _r0, nil +} + +// RasterMakeEmpty is MEOS raster_make_empty. +func RasterMakeEmpty(width int, height int, upperleftx float64, upperlefty float64, scalex float64, scaley float64, skewx float64, skewy float64, srid int32) (unsafe.Pointer, error) { + _r0, _err := functions.RasterMakeEmpty(width, height, upperleftx, upperlefty, scalex, scaley, skewx, skewy, srid) + if _err != nil { + return nil, _err + } + return _r0, nil +} + +// RasterAddBand is MEOS raster_add_band. +func RasterAddBand(rast unsafe.Pointer, index int, pixeltype string, initialvalue float64, nodataval float64, has_nodata bool) (unsafe.Pointer, error) { + _r0, _err := functions.RasterAddBand(rast, index, pixeltype, initialvalue, nodataval, has_nodata) + if _err != nil { + return nil, _err + } + return _r0, nil +} + +// RasterAddBandRaster is MEOS raster_add_band_raster. +func RasterAddBandRaster(torast unsafe.Pointer, fromrast unsafe.Pointer, fromband int, toindex int) (unsafe.Pointer, error) { + _r0, _err := functions.RasterAddBandRaster(torast, fromrast, fromband, toindex) + if _err != nil { + return nil, _err + } + return _r0, nil +} + +// RasterMemSize is MEOS raster_mem_size. +func RasterMemSize(rast unsafe.Pointer) (int, error) { + _r0, _err := functions.RasterMemSize(rast) + if _err != nil { + return 0, _err + } + return _r0, nil +} + +// RasterNumBands is MEOS raster_num_bands. +func RasterNumBands(rast unsafe.Pointer) (int, error) { + _r0, _err := functions.RasterNumBands(rast) + if _err != nil { + return 0, _err + } + return _r0, nil +} + +// RasterWidth is MEOS raster_width. +func RasterWidth(rast unsafe.Pointer) (int, error) { + _r0, _err := functions.RasterWidth(rast) + if _err != nil { + return 0, _err + } + return _r0, nil +} + +// RasterHeight is MEOS raster_height. +func RasterHeight(rast unsafe.Pointer) (int, error) { + _r0, _err := functions.RasterHeight(rast) + if _err != nil { + return 0, _err + } + return _r0, nil +} + +// RasterSRID is MEOS raster_srid. +func RasterSRID(rast unsafe.Pointer) (int32, error) { + _r0, _err := functions.RasterSRID(rast) + if _err != nil { + return 0, _err + } + return _r0, nil +} + +// RasterUpperLeftX is MEOS raster_upper_left_x. +func RasterUpperLeftX(rast unsafe.Pointer) (float64, error) { + _r0, _err := functions.RasterUpperLeftX(rast) + if _err != nil { + return 0, _err + } + return _r0, nil +} + +// RasterUpperLeftY is MEOS raster_upper_left_y. +func RasterUpperLeftY(rast unsafe.Pointer) (float64, error) { + _r0, _err := functions.RasterUpperLeftY(rast) + if _err != nil { + return 0, _err + } + return _r0, nil +} + +// RasterScaleX is MEOS raster_scale_x. +func RasterScaleX(rast unsafe.Pointer) (float64, error) { + _r0, _err := functions.RasterScaleX(rast) + if _err != nil { + return 0, _err + } + return _r0, nil +} + +// RasterScaleY is MEOS raster_scale_y. +func RasterScaleY(rast unsafe.Pointer) (float64, error) { + _r0, _err := functions.RasterScaleY(rast) + if _err != nil { + return 0, _err + } + return _r0, nil +} + +// RasterSkewX is MEOS raster_skew_x. +func RasterSkewX(rast unsafe.Pointer) (float64, error) { + _r0, _err := functions.RasterSkewX(rast) + if _err != nil { + return 0, _err + } + return _r0, nil +} + +// RasterSkewY is MEOS raster_skew_y. +func RasterSkewY(rast unsafe.Pointer) (float64, error) { + _r0, _err := functions.RasterSkewY(rast) + if _err != nil { + return 0, _err + } + return _r0, nil +} + +// RasterBandPixelType is MEOS raster_band_pixel_type. +func RasterBandPixelType(rast unsafe.Pointer, band int) (string, error) { + _r0, _err := functions.RasterBandPixelType(rast, band) + if _err != nil { + return "", _err + } + return _r0, nil +} + +// RasterBandHasNodataValue is MEOS raster_band_has_nodata_value. +func RasterBandHasNodataValue(rast unsafe.Pointer, band int) (bool, error) { + _r0, _err := functions.RasterBandHasNodataValue(rast, band) + if _err != nil { + return false, _err + } + return _r0, nil +} + +// RasterBandNodataValue is MEOS raster_band_nodata_value. +func RasterBandNodataValue(rast unsafe.Pointer, band int) (float64, bool, error) { + _found, _value, _err := functions.RasterBandNodataValue(rast, band) + if _err != nil { + return 0, false, _err + } + if !_found { + return 0, false, nil + } + return _value, true, nil +} + +// RasterBandPixels is MEOS raster_band_pixels. +func RasterBandPixels(rast unsafe.Pointer, band int, size_out unsafe.Pointer) (unsafe.Pointer, error) { + _r0, _err := functions.RasterBandPixels(rast, band, size_out) + if _err != nil { + return nil, _err + } + return _r0, nil +} + +// RasterClip is MEOS raster_clip. +func RasterClip(rast unsafe.Pointer, bands unsafe.Pointer, nbands int, gs *TRGeometrySeqSet, nodata unsafe.Pointer, nnodata int, crop bool, touched bool) (unsafe.Pointer, error) { + _r0, _err := functions.RasterClip(rast, bands, nbands, functions.GeomFromPointer(gs.Pointer()), nodata, nnodata, crop, touched) + if _err != nil { + return nil, _err + } + return _r0, nil +} + +// RasterTransform is MEOS raster_transform. +func RasterTransform(rast unsafe.Pointer, srid int32, algorithm *string, max_err float64, scale_x float64, scale_y float64) (unsafe.Pointer, error) { + _r0, _err := functions.RasterTransform(rast, srid, algorithm, max_err, scale_x, scale_y) + if _err != nil { + return nil, _err + } + return _r0, nil +} + +// RasterTransformPipeline is MEOS raster_transform_pipeline. +func RasterTransformPipeline(rast unsafe.Pointer, pipelinestr string, srid int32, is_forward bool, algorithm *string, max_err float64, scale_x float64, scale_y float64) (unsafe.Pointer, error) { + _r0, _err := functions.RasterTransformPipeline(rast, pipelinestr, srid, is_forward, algorithm, max_err, scale_x, scale_y) + if _err != nil { + return nil, _err + } + return _r0, nil +} + +// RasterTransformRaster is MEOS raster_transform_raster. +func RasterTransformRaster(rast unsafe.Pointer, alignto unsafe.Pointer, algorithm *string, max_err float64) (unsafe.Pointer, error) { + _r0, _err := functions.RasterTransformRaster(rast, alignto, algorithm, max_err) + if _err != nil { + return nil, _err + } + return _r0, nil +} + +// RasterRescale is MEOS raster_rescale. +func RasterRescale(rast unsafe.Pointer, scale_x float64, scale_y float64, algorithm *string, max_err float64) (unsafe.Pointer, error) { + _r0, _err := functions.RasterRescale(rast, scale_x, scale_y, algorithm, max_err) + if _err != nil { + return nil, _err + } + return _r0, nil +} + +// RasterDumpAsPolygons is MEOS raster_dump_as_polygons. +func RasterDumpAsPolygons(rast unsafe.Pointer, band int, exclude_nodata bool, count unsafe.Pointer) (unsafe.Pointer, error) { + _r0, _err := functions.RasterDumpAsPolygons(rast, band, exclude_nodata, count) + if _err != nil { + return nil, _err + } + return _r0, nil +} + +// RasterDumpValues is MEOS raster_dump_values. +func RasterDumpValues(rast unsafe.Pointer, band int, exclude_nodata bool, nodata unsafe.Pointer, count unsafe.Pointer) (unsafe.Pointer, error) { + _r0, _err := functions.RasterDumpValues(rast, band, exclude_nodata, nodata, count) + if _err != nil { + return nil, _err + } + return _r0, nil +} + +// RasterPixelAsPoints is MEOS raster_pixel_as_points. +func RasterPixelAsPoints(rast unsafe.Pointer, band int, exclude_nodata bool, count unsafe.Pointer) (unsafe.Pointer, error) { + _r0, _err := functions.RasterPixelAsPoints(rast, band, exclude_nodata, count) + if _err != nil { + return nil, _err + } + return _r0, nil +} + +// RasterSummaryStats is MEOS raster_summary_stats. +func RasterSummaryStats(rast unsafe.Pointer, band int, exclude_nodata bool) (unsafe.Pointer, error) { + _r0, _err := functions.RasterSummaryStats(rast, band, exclude_nodata) + if _err != nil { + return nil, _err + } + return _r0, nil +} + +// RasterValueCount is MEOS raster_value_count. +func RasterValueCount(rast unsafe.Pointer, band int, exclude_nodata bool, searchvalues unsafe.Pointer, nsearch int, roundto float64, count unsafe.Pointer) (unsafe.Pointer, error) { + _r0, _err := functions.RasterValueCount(rast, band, exclude_nodata, searchvalues, nsearch, roundto, count) + if _err != nil { + return nil, _err + } + return _r0, nil +} + +// RasterSetValues is MEOS raster_set_values. +func RasterSetValues(rast unsafe.Pointer, band int, x int, y int, width int, height int, values unsafe.Pointer, nodata unsafe.Pointer, noset unsafe.Pointer, count int, keepnodata bool) (unsafe.Pointer, error) { + _r0, _err := functions.RasterSetValues(rast, band, x, y, width, height, values, nodata, noset, count, keepnodata) + if _err != nil { + return nil, _err + } + return _r0, nil +} + +// RasterReclass is MEOS raster_reclass. +func RasterReclass(rast unsafe.Pointer, band int, expr string, pixeltype string, has_nodata bool, nodataval float64) (unsafe.Pointer, error) { + _r0, _err := functions.RasterReclass(rast, band, expr, pixeltype, has_nodata, nodataval) + if _err != nil { + return nil, _err + } + return _r0, nil +} + +// RasterSlope is MEOS raster_slope. +func RasterSlope(rast unsafe.Pointer, band int, customextent unsafe.Pointer, pixeltype string, units string, scale float64, interpolate_nodata bool) (unsafe.Pointer, error) { + _r0, _err := functions.RasterSlope(rast, band, customextent, pixeltype, units, scale, interpolate_nodata) + if _err != nil { + return nil, _err + } + return _r0, nil +} + +// RasterTpi is MEOS raster_tpi. +func RasterTpi(rast unsafe.Pointer, band int, customextent unsafe.Pointer, pixeltype string, interpolate_nodata bool) (unsafe.Pointer, error) { + _r0, _err := functions.RasterTpi(rast, band, customextent, pixeltype, interpolate_nodata) + if _err != nil { + return nil, _err + } + return _r0, nil +} + +// RasterTri is MEOS raster_tri. +func RasterTri(rast unsafe.Pointer, band int, customextent unsafe.Pointer, pixeltype string, interpolate_nodata bool) (unsafe.Pointer, error) { + _r0, _err := functions.RasterTri(rast, band, customextent, pixeltype, interpolate_nodata) + if _err != nil { + return nil, _err + } + return _r0, nil +} + +// RasterMapAlgebra is MEOS raster_map_algebra. +func RasterMapAlgebra(rast unsafe.Pointer, band int, stat string, pixeltype *string, extenttype *string, customextent unsafe.Pointer, distancex int32, distancey int32) (unsafe.Pointer, error) { + _r0, _err := functions.RasterMapAlgebra(rast, band, stat, pixeltype, extenttype, customextent, distancex, distancey) + if _err != nil { + return nil, _err + } + return _r0, nil +} + +// RasterSameAlignment is MEOS raster_same_alignment. +func RasterSameAlignment(rast1 unsafe.Pointer, rast2 unsafe.Pointer) (bool, error) { + _r0, _err := functions.RasterSameAlignment(rast1, rast2) + if _err != nil { + return false, _err + } + return _r0, nil +} + +// RasterNotSameAlignmentReason is MEOS raster_not_same_alignment_reason. +func RasterNotSameAlignmentReason(rast1 unsafe.Pointer, rast2 unsafe.Pointer) (string, error) { + _r0, _err := functions.RasterNotSameAlignmentReason(rast1, rast2) + if _err != nil { + return "", _err + } + return _r0, nil +} + +// RasterToStbox is MEOS raster_to_stbox. +func RasterToStbox(rast unsafe.Pointer) (*STBox, error) { + _r0, _err := functions.RasterToSTBOX(rast) + if _err != nil { + return nil, _err + } + return STBoxFromPointer(_r0.Pointer()), nil +} + +// RasterValue is MEOS raster_value. +func RasterValue(traj *Temporal, rast unsafe.Pointer, band int, exclude_nodata bool, resample *string) (*Temporal, error) { + _r0, _err := functions.RasterValue(functions.TemporalFromPointer(traj.Pointer()), rast, band, exclude_nodata, resample) + if _err != nil { + return nil, _err + } + return TemporalFromPointer(_r0.Pointer()), nil +} + +// RasterAtValue is MEOS raster_at_value. +func RasterAtValue(traj *Temporal, rast unsafe.Pointer, band int, vspan *Span) (*Temporal, error) { + _r0, _err := functions.RasterAtValue(functions.TemporalFromPointer(traj.Pointer()), rast, band, functions.SpanFromPointer(vspan.Pointer())) + if _err != nil { + return nil, _err + } + return TemporalFromPointer(_r0.Pointer()), nil +} + +// RasterMinusValue is MEOS raster_minus_value. +func RasterMinusValue(traj *Temporal, rast unsafe.Pointer, band int, vspan *Span) (*Temporal, error) { + _r0, _err := functions.RasterMinusValue(functions.TemporalFromPointer(traj.Pointer()), rast, band, functions.SpanFromPointer(vspan.Pointer())) + if _err != nil { + return nil, _err + } + return TemporalFromPointer(_r0.Pointer()), nil +} + +// RasterValueGdal is MEOS raster_value_gdal. +func RasterValueGdal(traj *Temporal, path string, band int) (*Temporal, error) { + _r0, _err := functions.RasterValueGdal(functions.TemporalFromPointer(traj.Pointer()), path, band) + if _err != nil { + return nil, _err + } + return TemporalFromPointer(_r0.Pointer()), nil +} + +// RasterAtValueGdal is MEOS raster_at_value_gdal. +func RasterAtValueGdal(traj *Temporal, path string, band int, vspan *Span) (*Temporal, error) { + _r0, _err := functions.RasterAtValueGdal(functions.TemporalFromPointer(traj.Pointer()), path, band, functions.SpanFromPointer(vspan.Pointer())) + if _err != nil { + return nil, _err + } + return TemporalFromPointer(_r0.Pointer()), nil +} + +// RasterMinusValueGdal is MEOS raster_minus_value_gdal. +func RasterMinusValueGdal(traj *Temporal, path string, band int, vspan *Span) (*Temporal, error) { + _r0, _err := functions.RasterMinusValueGdal(functions.TemporalFromPointer(traj.Pointer()), path, band, functions.SpanFromPointer(vspan.Pointer())) + if _err != nil { + return nil, _err + } + return TemporalFromPointer(_r0.Pointer()), nil +} + +// RasterTileValueQuadbin is MEOS raster_tile_value_quadbin. +func RasterTileValueQuadbin(traj *Temporal, pixels unsafe.Pointer, pixels_size uint, width int32, height int32, quadbin uint64, pixtype functions.MeosPixType, nodata float64, has_nodata bool) (*Temporal, error) { + _r0, _err := functions.RasterTileValueQuadbin(functions.TemporalFromPointer(traj.Pointer()), pixels, pixels_size, width, height, quadbin, pixtype, nodata, has_nodata) + if _err != nil { + return nil, _err + } + return TemporalFromPointer(_r0.Pointer()), nil +} + +// RasterTileValue is MEOS raster_tile_value. +func RasterTileValue(traj *Temporal, rq unsafe.Pointer) (*Temporal, error) { + _r0, _err := functions.RasterTileValue(functions.TemporalFromPointer(traj.Pointer()), rq) + if _err != nil { + return nil, _err + } + return TemporalFromPointer(_r0.Pointer()), nil +} + +// RasterTileValueArray is MEOS raster_tile_value_array. +func RasterTileValueArray(traj *Temporal, rqarr unsafe.Pointer, count int) (*Temporal, error) { + _r0, _err := functions.RasterTileValueArray(functions.TemporalFromPointer(traj.Pointer()), rqarr, count) + if _err != nil { + return nil, _err + } + return TemporalFromPointer(_r0.Pointer()), nil +} diff --git a/types/tbigint.go b/types/tbigint.go index 9848dff..43d184f 100644 --- a/types/tbigint.go +++ b/types/tbigint.go @@ -253,3 +253,12 @@ func (x *TBigint) ToTquadbin() (*Temporal, error) { } return TemporalFromPointer(_r0.Pointer()), nil } + +// ToTs2cell is MEOS tbigint_to_ts2cell. +func (x *TBigint) ToTs2cell() (*Temporal, error) { + _r0, _err := functions.TbigintToTs2cell(functions.TemporalFromPointer(x.Pointer())) + if _err != nil { + return nil, _err + } + return TemporalFromPointer(_r0.Pointer()), nil +} diff --git a/types/tgeogpoint.go b/types/tgeogpoint.go index 5724223..1c74a2d 100644 --- a/types/tgeogpoint.go +++ b/types/tgeogpoint.go @@ -103,3 +103,21 @@ func (x *TGeogPoint) QuadbinSplit(resolution int32, border_inc bool, cells unsaf } return _r0, nil } + +// ToTs2cell is MEOS tgeogpoint_to_ts2cell. +func (x *TGeogPoint) ToTs2cell(level int32, border_inc bool) (*Temporal, error) { + _r0, _err := functions.TgeogpointToTs2cell(functions.TemporalFromPointer(x.Pointer()), level, border_inc) + if _err != nil { + return nil, _err + } + return TemporalFromPointer(_r0.Pointer()), nil +} + +// S2cellSplit is MEOS tgeogpoint_s2cell_split. +func (x *TGeogPoint) S2cellSplit(level int32, border_inc bool, cells unsafe.Pointer, count unsafe.Pointer) (unsafe.Pointer, error) { + _r0, _err := functions.TgeogpointS2cellSplit(functions.TemporalFromPointer(x.Pointer()), level, border_inc, cells, count) + if _err != nil { + return nil, _err + } + return _r0, nil +} diff --git a/types/tgeompoint.go b/types/tgeompoint.go index 0baffe7..0b13b08 100644 --- a/types/tgeompoint.go +++ b/types/tgeompoint.go @@ -103,3 +103,21 @@ func (x *TGeomPoint) QuadbinSplit(resolution int32, border_inc bool, cells unsaf } return _r0, nil } + +// ToTs2cell is MEOS tgeompoint_to_ts2cell. +func (x *TGeomPoint) ToTs2cell(level int32, border_inc bool) (*Temporal, error) { + _r0, _err := functions.TgeompointToTs2cell(functions.TemporalFromPointer(x.Pointer()), level, border_inc) + if _err != nil { + return nil, _err + } + return TemporalFromPointer(_r0.Pointer()), nil +} + +// S2cellSplit is MEOS tgeompoint_s2cell_split. +func (x *TGeomPoint) S2cellSplit(level int32, border_inc bool, cells unsafe.Pointer, count unsafe.Pointer) (unsafe.Pointer, error) { + _r0, _err := functions.TgeompointS2cellSplit(functions.TemporalFromPointer(x.Pointer()), level, border_inc, cells, count) + if _err != nil { + return nil, _err + } + return _r0, nil +}