diff --git a/.github/workflows/build_pymeos_cffi.yml b/.github/workflows/build_pymeos_cffi.yml index 87e1ce1..6202790 100644 --- a/.github/workflows/build_pymeos_cffi.yml +++ b/.github/workflows/build_pymeos_cffi.yml @@ -16,6 +16,7 @@ jobs: is_rc: ${{ steps.check_rc.outputs.is_rc }} is_prerelease: ${{ steps.check_prerelease.outputs.is_prerelease }} branch: ${{ steps.check_branch.outputs.branch }} + meos_branch: ${{ steps.check_branch.outputs.meos_branch }} version: ${{ steps.check_version.outputs.version }} steps: @@ -29,7 +30,7 @@ jobs: run: | VERSION=${GITHUB_REF#refs/tags/} - if [[ $VERSION =~ ^v[0-9]+\.[0-9]+\.[0-9]+-alpha ]]; then + if [[ $VERSION =~ ^v[0-9]+\.[0-9]+\.[0-9]+a[0-9]+ ]]; then echo "Releasing an alpha version." echo "is_alpha=true" >> "$GITHUB_OUTPUT" else @@ -41,7 +42,7 @@ jobs: run: | VERSION=${GITHUB_REF#refs/tags/} - if [[ $VERSION =~ ^v[0-9]+\.[0-9]+\.[0-9]+-beta ]]; then + if [[ $VERSION =~ ^v[0-9]+\.[0-9]+\.[0-9]+b[0-9]+ ]]; then echo "Releasing a beta version." echo "is_beta=true" >> "$GITHUB_OUTPUT" else @@ -53,7 +54,7 @@ jobs: run: | VERSION=${GITHUB_REF#refs/tags/} - if [[ $VERSION =~ ^v[0-9]+\.[0-9]+\.[0-9]+-rc ]]; then + if [[ $VERSION =~ ^v[0-9]+\.[0-9]+\.[0-9]+rc[0-9]+ ]]; then echo "Releasing an rc version." echo "is_rc=true" >> "$GITHUB_OUTPUT" else @@ -68,7 +69,7 @@ jobs: is_rc=${{ steps.check_rc.outputs.is_rc }} if [ "$is_alpha" == "true" ] || [ "$is_beta" == "true" ] || [ "$is_rc" == "true" ]; then - echo "Releasing an prerelease version." + echo "Releasing a prerelease version." echo "is_prerelease=true" >> "$GITHUB_OUTPUT" else echo "is_prerelease=false" >> "$GITHUB_OUTPUT" @@ -90,8 +91,19 @@ jobs: run: | raw=$(git branch -r --contains ${{ github.ref }}) branch=${raw##*/} - echo "branch=$branch" >> $GITHUB_OUTPUT echo "Branch is $branch." + if [ -z "$branch" ]; then + branch="master" + echo "Branch not found. Using master." + fi + echo "branch=$branch" >> $GITHUB_OUTPUT + exists=$(git ls-remote https://github.com/MobilityDB/MobilityDB $branch) + meos_branch="master" + if [ -n "$exists" ]; then + meos_branch=$branch + fi + echo "MEOS branch is $meos_branch." + echo "meos_branch=$meos_branch" >> $GITHUB_OUTPUT - name: Check version id: check_version @@ -112,7 +124,7 @@ jobs: - name: Install Python uses: actions/setup-python@v5 with: - python-version: 3.8 + python-version: "3.10" cache: "pip" - name: Setup pip @@ -137,8 +149,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: -# os: [ ubuntu-latest, macos-13, macos-14 ] - os: [ ubuntu-latest, macos-14 ] + os: [ ubuntu-latest, macos-13, macos-14 ] include: - ld_prefix: "/usr/local" - os: macos-14 @@ -156,11 +167,7 @@ jobs: - name: Update brew if: matrix.os == 'macos-13' - # Necessary to avoid issue with macOS runners. See - # https://github.com/actions/runner-images/issues/4020 run: | - brew reinstall python@3.12 || brew link --overwrite python@3.12 - brew reinstall python@3.11 || brew link --overwrite python@3.11 brew update - name: Get PROJ version @@ -174,7 +181,7 @@ jobs: - name: Install MEOS if: runner.os == 'macOS' run: | - git clone --depth 1 --branch ${{ needs.checks.outputs.branch }} https://github.com/MobilityDB/MobilityDB + git clone --depth 1 https://github.com/MobilityDB/MobilityDB mkdir MobilityDB/build cd MobilityDB/build export MACOSX_DEPLOYMENT_TARGET="${{ matrix.os == 'macos-14' && 14 || 13.6 }}" @@ -185,10 +192,11 @@ jobs: - name: Setup Python uses: actions/setup-python@v5 with: + python-version: "3.11" cache: "pip" - name: Install cibuildwheel - run: python -m pip install cibuildwheel==2.22.0 + run: python -m pip install cibuildwheel~=3.0 - name: Set PROJ_DATA (macOS) if: runner.os == 'macOS' @@ -211,25 +219,19 @@ jobs: export PACKAGE_DATA=1 python -m cibuildwheel --output-dir wheelhouse env: - # Disable PyPy builds - # Disable builds on musllinux + # Disable builds on musllinux and python 3.8, 3.9 and 3.14 + CIBW_SKIP: "*musllinux* cp38* cp39* cp314*" # Disable builds in linux architectures other than x86_64 - CIBW_SKIP: "pp* *musllinux*" CIBW_ARCHS_LINUX: "x86_64" CIBW_ENVIRONMENT_PASS_LINUX: PACKAGE_DATA LD_LIBRARY_PATH PROJ_DATA C_INCLUDE_PATH CIBW_ENVIRONMENT_MACOS: > MACOSX_DEPLOYMENT_TARGET="${{ matrix.os == 'macos-14' && 14 || 13.6 }}" CIBW_BEFORE_ALL_LINUX: > - yum -y install https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm && - yum -y update && - yum -y install gcc gcc-c++ make cmake postgresql13-devel proj81-devel geos39-devel gsl-devel && - git clone --branch json-c-0.17 --depth 1 https://github.com/json-c/json-c && - mkdir json-c-build && - cd json-c-build && - cmake ../json-c && - make && - make install && - git clone --depth 1 --branch ${{ needs.checks.outputs.branch }} https://github.com/MobilityDB/MobilityDB && + dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm && + dnf -qy module disable postgresql && + dnf -y update && + dnf -y install gcc gcc-c++ make cmake postgresql16-devel proj81-devel geos39-devel gsl-devel json-c-devel && + git clone --depth 1 --branch ${{ needs.checks.outputs.meos_branch }} https://github.com/MobilityDB/MobilityDB && mkdir MobilityDB/build && cd MobilityDB/build && cmake .. -DMEOS=on -DGEOS_INCLUDE_DIR=/usr/geos39/include/ -DGEOS_LIBRARY=/usr/geos39/lib64/libgeos_c.so -DGEOS_CONFIG=/usr/geos39/bin/geos-config -DPROJ_INCLUDE_DIRS=/usr/proj81/include/ -DPROJ_LIBRARIES=/usr/proj81/lib/libproj.so && @@ -252,9 +254,8 @@ jobs: strategy: fail-fast: false matrix: - python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12", "3.13" ] -# os: [ ubuntu-latest, macos-13, macos-14 ] - os: [ ubuntu-latest, macos-14 ] + python-version: [ "3.10", "3.11", "3.12", "3.13" ] + os: [ ubuntu-latest, macos-13, macos-14 ] steps: - name: Checkout @@ -280,7 +281,7 @@ jobs: - name: Run PyMEOS-CFFI check run: | python -c "import pymeos_cffi; print(pymeos_cffi.__version__);" - python -c "from pymeos_cffi import *; meos_initialize(None); print(tpoint_out(tgeompoint_in('POINT(2 3)@2000-01-01'), 3)); meos_finalize();" + python -c "from pymeos_cffi import *; meos_initialize(None); print(tgeo_out(tgeompoint_in('POINT(2 3)@2000-01-01'), 3)); meos_finalize();" upload_pypi: name: Upload to PyPI diff --git a/.github/workflows/ruff.yml b/.github/workflows/ruff.yml new file mode 100644 index 0000000..981e8fd --- /dev/null +++ b/.github/workflows/ruff.yml @@ -0,0 +1,26 @@ +name: Lint code with Ruff + +on: + push: + branches: [ "master", "stable-[0-9]+.[0-9]+" ] + pull_request: + branches: [ "master", "stable-[0-9]+.[0-9]+" ] + +jobs: + lint: + name: Lint code with Ruff + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v4 + + - name: Install Ruff + uses: astral-sh/ruff-action@v3 + with: + args: "--version" + + - name: Check rules + run: "ruff check" + + - name: Check format + run: "ruff format --check --diff" diff --git a/builder/build_header.py b/builder/build_header.py index d327d8d..e7c612a 100644 --- a/builder/build_header.py +++ b/builder/build_header.py @@ -3,7 +3,15 @@ import re import subprocess import sys -from typing import Set, Tuple, Match + +header_files = [ + "meos.h", + "meos_catalog.h", + "meos_geo.h", + "meos_internal.h", + "meos_internal_geo.h", + "meos_npoint.h", +] def get_defined_functions(library_path): @@ -20,9 +28,7 @@ def remove_undefined_functions(content, so_path): def remove_if_not_defined(m): function = m.group(0).split("(")[0].strip().split(" ")[-1].strip("*") - if function in defined or ( - sys.platform == "darwin" and ("_" + function) in defined - ): + if function in defined or (sys.platform == "darwin" and ("_" + function) in defined): for t in undefined_types: if t in m.group(0): print(f"Removing function due to undefined type {t}: {function}") @@ -41,10 +47,8 @@ def remove_if_not_defined(m): return content -def remove_repeated_functions( - content: str, seen_functions: set -) -> Tuple[str, Set[str]]: - def remove_if_repeated(m: Match): +def remove_repeated_functions(content: str, seen_functions: set) -> tuple[str, set[str]]: + def remove_if_repeated(m: re.Match): function = m.group("function") if function in seen_functions: print(f"Removing repeated function: {function}") @@ -63,7 +67,6 @@ def remove_if_repeated(m: Match): def build_header_file(include_dir, so_path=None, destination_path="builder/meos.h"): - files = ["meos.h", "meos_catalog.h", "meos_internal.h"] global_content = """ typedef struct { @@ -89,9 +92,9 @@ def build_header_file(include_dir, so_path=None, destination_path="builder/meos. """ functions = set() - for file_name in files: + for file_name in header_files: file_path = os.path.join(include_dir, file_name) - with open(file_path, "r") as f: + with open(file_path) as f: content = f.read() # Remove comments content = re.sub(r"//.*", "", content) @@ -105,9 +108,7 @@ def build_header_file(include_dir, so_path=None, destination_path="builder/meos. content, flags=re.RegexFlag.MULTILINE, ) - content = re.sub( - r"//#ifdef.*?//#endif", "", content, flags=re.RegexFlag.DOTALL - ) + content = re.sub(r"//#ifdef.*?//#endif", "", content, flags=re.RegexFlag.DOTALL) content = content.replace("//#endif", "") content = re.sub(r"//# *\w+ +([\w,()]+) *((?:\\\n|.)*?)\n", "", content) diff --git a/builder/build_pymeos.py b/builder/build_pymeos.py index 56f6a72..ba96f78 100644 --- a/builder/build_pymeos.py +++ b/builder/build_pymeos.py @@ -2,9 +2,18 @@ from cffi import FFI +header_files = [ + "meos.h", + "meos_catalog.h", + "meos_geo.h", + "meos_internal.h", + "meos_internal_geo.h", + "meos_npoint.h", +] + ffibuilder = FFI() -with open(os.path.join(os.path.dirname(__file__), "meos.h"), "r") as f: +with open(os.path.join(os.path.dirname(__file__), "meos.h")) as f: content = f.read() ffibuilder.cdef(content) @@ -22,7 +31,7 @@ def get_include_dirs(): ffibuilder.set_source( "_meos_cffi", - '#include "meos.h"\n' '#include "meos_catalog.h"\n' '#include "meos_internal.h"', + "\n".join(f'#include "{h}"' for h in header_files), libraries=["meos"], library_dirs=get_library_dirs(), include_dirs=get_include_dirs(), diff --git a/builder/build_pymeos_functions.py b/builder/build_pymeos_functions.py index 7f7b7c5..cf30396 100644 --- a/builder/build_pymeos_functions.py +++ b/builder/build_pymeos_functions.py @@ -1,9 +1,8 @@ import os.path import sys -from typing import List from build_pymeos_functions_modifiers import * -from objects import conversion_map, Conversion +from objects import Conversion, conversion_map class Parameter: @@ -13,7 +12,7 @@ def __init__( converted_name: str, ctype: str, ptype: str, - cp_conversion: Optional[str], + cp_conversion: str | None, ) -> None: super().__init__() self.name = name @@ -23,9 +22,7 @@ def __init__( self.cp_conversion = cp_conversion def is_interoperable(self): - return any( - self.ctype.startswith(x) for x in ["int", "bool", "double", "TimestampTz"] - ) + return any(self.ctype.startswith(x) for x in ["int", "bool", "double", "TimestampTz"]) def get_ptype_without_pointers(self): if self.is_interoperable(): @@ -34,14 +31,11 @@ def get_ptype_without_pointers(self): return self.ptype def __str__(self) -> str: - return ( - f"{self.name=}, {self.converted_name=}, {self.ctype=}, {self.ptype=}, " - f"{self.cp_conversion=}" - ) + return f"{self.name=}, {self.converted_name=}, {self.ctype=}, {self.ptype=}, {self.cp_conversion=}" class ReturnType: - def __init__(self, ctype: str, ptype: str, conversion: Optional[str]) -> None: + def __init__(self, ctype: str, ptype: str, conversion: str | None) -> None: super().__init__() self.ctype = ctype self.return_type = ptype @@ -90,6 +84,7 @@ def __init__(self, ctype: str, ptype: str, conversion: Optional[str]) -> None: "textset_make": textset_make_modifier, "geoset_make": array_length_remover_modifier("values", "count"), "tsequenceset_make_gaps": array_length_remover_modifier("instants", "count"), + "mi_span_span": mi_span_span_modifier, } # List of result function parameters in tuples of (function, parameter) @@ -98,7 +93,7 @@ def __init__(self, ctype: str, ptype: str, conversion: Optional[str]) -> None: ("ttext_value_at_timestamptz", "value"), ("tint_value_at_timestamptz", "value"), ("tfloat_value_at_timestamptz", "value"), - ("tpoint_value_at_timestamptz", "value"), + ("tgeo_value_at_timestamptz", "value"), } # List of output function parameters in tuples of (function, parameter). @@ -107,9 +102,9 @@ def __init__(self, ctype: str, ptype: str, conversion: Optional[str]) -> None: output_parameters = { ("temporal_time_split", "time_bins"), ("temporal_time_split", "count"), - ("tint_value_split", "value_bins"), + ("tint_value_split", "bins"), ("tint_value_split", "count"), - ("tfloat_value_split", "value_bins"), + ("tfloat_value_split", "bins"), ("tfloat_value_split", "count"), ("tint_value_time_split", "value_bins"), ("tint_value_time_split", "time_bins"), @@ -117,11 +112,11 @@ def __init__(self, ctype: str, ptype: str, conversion: Optional[str]) -> None: ("tfloat_value_time_split", "value_bins"), ("tfloat_value_time_split", "time_bins"), ("tfloat_value_time_split", "count"), - ("tpoint_space_split", "space_bins"), - ("tpoint_space_split", "count"), - ("tpoint_space_time_split", "space_bins"), - ("tpoint_space_time_split", "time_bins"), - ("tpoint_space_time_split", "count"), + ("tgeo_space_split", "space_bins"), + ("tgeo_space_split", "count"), + ("tgeo_space_time_split", "space_bins"), + ("tgeo_space_time_split", "time_bins"), + ("tgeo_space_time_split", "count"), ("tbox_as_hexwkb", "size"), ("stbox_as_hexwkb", "size"), ("tintbox_value_time_tiles", "count"), @@ -151,7 +146,7 @@ def __init__(self, ctype: str, ptype: str, conversion: Optional[str]) -> None: ("temporal_tcount_transfn", "state"), ("temporal_extent_transfn", "p"), ("tnumber_extent_transfn", "box"), - ("tpoint_extent_transfn", "box"), + ("tspatial_extent_transfn", "box"), ("tbool_tand_transfn", "state"), ("tbool_tor_transfn", "state"), ("tbox_shift_scale_time", "shift"), @@ -182,6 +177,7 @@ def __init__(self, ctype: str, ptype: str, conversion: Optional[str]) -> None: ("tfloatbox_value_time_tiles", "torigin"), ("stbox_make", "s"), ("tsequenceset_make_gaps", "maxt"), + ("geo_as_geojson", "srs"), } @@ -206,30 +202,34 @@ def is_output_parameter(function: str, parameter: Parameter) -> bool: return (function, parameter.name) in output_parameters -def check_modifiers(functions: List[str]) -> None: - for func in function_modifiers.keys(): +def check_modifiers(functions: list[str]) -> None: + for func in function_modifiers: if func not in functions: print(f"Modifier defined for non-existent function {func}") for func, param in result_parameters: if func not in functions: - print( - f"Result parameter defined for non-existent function {func} ({param})" - ) + print(f"Result parameter defined for non-existent function {func} ({param})") for func, param in output_parameters: if func not in functions: - print( - f"Output parameter defined for non-existent function {func} ({param})" - ) + print(f"Output parameter defined for non-existent function {func} ({param})") for func, param in nullable_parameters: if func not in functions: - print( - f"Nullable Parameter defined for non-existent function {func} ({param})" - ) + print(f"Nullable Parameter defined for non-existent function {func} ({param})") + + +def remove_c_comments(code: str) -> str: + code = re.sub(r"/\*.*?\*/", "", code, flags=re.DOTALL) + code = re.sub(r"//.*?$", "", code, flags=re.MULTILINE) + return code def build_pymeos_functions(header_path="builder/meos.h"): with open(header_path) as f: content = f.read() + + # Remove C comments from the header file + content = remove_c_comments(content) + # Regex lines: # 1st line: Match beginning of function with optional "extern", "static" and # "inline" @@ -240,14 +240,12 @@ def build_pymeos_functions(header_path="builder/meos.h"): # spaces and asterisks between parenthesis and end with a semicolon. # (Parameter decomposition will be performed later) f_regex = ( - r"(?:extern )?(?:static )?(?:inline )?" + r"(?(?:const )?\w+(?: \*+)?)" - r"\s*(?P\w+)" + r"\s*(?P\w+)\s*" r"\((?P[\w\s,\*]*)\);" ) - matches = re.finditer( - f_regex, "".join(content.splitlines()), flags=re.RegexFlag.MULTILINE - ) + matches = re.finditer(f_regex, "".join(content.splitlines())) file_path = os.path.dirname(__file__) template_path = os.path.join(file_path, "templates/functions.py") @@ -275,7 +273,7 @@ def build_pymeos_functions(header_path="builder/meos.h"): file.write("\n\n\n") functions = [] - with open(functions_path, "r") as funcs: + with open(functions_path) as funcs: content = funcs.read() matches = list(re.finditer(r"def (\w+)\(", content)) function_text = "" @@ -292,27 +290,21 @@ def build_pymeos_functions(header_path="builder/meos.h"): check_modifiers(functions) -def get_params(function: str, inner_params: str) -> List[Parameter]: +def get_params(function: str, inner_params: str) -> list[Parameter]: if not inner_params: return [] - return [ - p - for p in ( - get_param(function, param.strip()) for param in inner_params.split(",") - ) - if p is not None - ] + return [p for p in (get_param(function, param.strip()) for param in inner_params.split(",")) if p is not None] -# Creates Parameter object from a function parameter -def get_param(function: str, inner_param: str) -> Optional[Parameter]: +# Creates a Parameter object from a function parameter +def get_param(function: str, inner_param: str) -> Parameter | None: # Split param name and type split = inner_param.split(" ") - # Type is everything except last word + # Type is everything except the last word param_type = " ".join(split[:-1]) - # Check if parameter is pointer and fix type and name accordingly + # Check if the parameter is a pointer and fix type and name accordingly param_name = split[-1].lstrip("*") pointer_level = len(split[-1]) - len(param_name) if pointer_level > 0: @@ -333,8 +325,7 @@ def get_param(function: str, inner_param: str) -> Optional[Parameter]: # Check if parameter is nullable nullable = is_nullable_parameter(function, param_name) - # If no conversion is needed between c and python types, use parameter name also as - # converted name + # If no conversion is needed from Python to C, use the parameter name also as converted name if conversion.p_to_c is None: # If nullable, add null check if nullable: @@ -342,21 +333,19 @@ def get_param(function: str, inner_param: str) -> Optional[Parameter]: param_name, f"{param_name}_converted", param_type, - f"'Optional[{conversion.p_type}]'", - f"{param_name}_converted = {param_name} if {param_name} is " - f"not None else _ffi.NULL", + f"{conversion.p_type} | None", + f"{param_name}_converted = {param_name} if {param_name} is not None else _ffi.NULL", ) return Parameter(param_name, param_name, param_type, conversion.p_type, None) - # If a conversion is needed, create new name and add the conversion + # If a conversion is needed, create a new name and add the conversion if nullable: return Parameter( param_name, f"{param_name}_converted", param_type, - f'"Optional[{conversion.p_type}]"', - f"{param_name}_converted = {conversion.p_to_c(param_name)} " - f"if {param_name} is not None else _ffi.NULL", + f"{conversion.p_type} | None", + f"{param_name}_converted = {conversion.p_to_c(param_name)} if {param_name} is not None else _ffi.NULL", ) return Parameter( param_name, @@ -369,16 +358,16 @@ def get_param(function: str, inner_param: str) -> Optional[Parameter]: # Returns a conversion for a type def get_param_conversion(param_type: str) -> Conversion: - # Check if type is known + # Check if the type is known if param_type in conversion_map: return conversion_map[param_type] # Otherwise, create a new conversion - # If it's a double pointer, cast as array + # If it's a double pointer, cast as an array if param_type.endswith("**"): return Conversion( param_type, - f"'{param_type}'", + f"Annotated[list, '{param_type}']", lambda name: f"[_ffi.cast('{param_type[:-1]}', x) for x in {name}]", lambda name: name, ) @@ -387,7 +376,7 @@ def get_param_conversion(param_type: str) -> Conversion: else: return Conversion( param_type, - f"'{param_type}'", + f"Annotated[_ffi.CData, '{param_type}']", lambda name: f"_ffi.cast('{param_type}', {name})", lambda name: name, ) @@ -404,14 +393,12 @@ def get_return_type(inner_return_type) -> ReturnType: conversion.c_to_p("result") if conversion.c_to_p else None, ) # Otherwise, don't transform anything - return ReturnType(inner_return_type, f"'{inner_return_type}'", None) + return ReturnType(inner_return_type, "_ffi.CData", None) -def build_function_string( - function_name: str, return_type: ReturnType, parameters: List[Parameter] -) -> str: - # Check if there is a result param, i.e. output parameters that are the actual - # product of the function, instead of whatever the function returns (typically +def build_function_string(function_name: str, return_type: ReturnType, parameters: list[Parameter]) -> str: + # Check if there is a result param, i.e., output parameters that are the actual + # product of the function, instead of whatever the function returns (typically # void or bool/int indicating the success or failure of the function) result_param = None if len(parameters) > 1 and is_result_parameter(function_name, parameters[-1]): @@ -426,21 +413,15 @@ def build_function_string( out_params = [p for p in parameters if is_output_parameter(function_name, p)] # Create wrapper function parameter list - params = ", ".join( - f"{p.name}: {p.ptype}" for p in parameters if p not in out_params - ) + params = ", ".join(f"{p.name}: {p.ptype}" for p in parameters if p not in out_params) # Create necessary conversions for the parameters param_conversions = "\n ".join( - p.cp_conversion - for p in parameters - if p.cp_conversion is not None and p not in out_params + p.cp_conversion for p in parameters if p.cp_conversion is not None and p not in out_params ) # Create CFFI function parameter list - inner_params = ", ".join( - pc.name if pc in out_params else pc.converted_name for pc in parameters - ) + inner_params = ", ".join(pc.name if pc in out_params else pc.converted_name for pc in parameters) # Add result conversion if necessary result_manipulation = None @@ -450,11 +431,12 @@ def build_function_string( # Initialize the function return type to the python type unless it needs no # conversion (where the C type gives extra information while being interoperable), # or the function is void - function_return_type = ( - return_type.return_type - if return_type.conversion is not None or return_type.return_type == "None" - else f"'{return_type.ctype}'" - ) + function_return_type = f"Annotated[{return_type.return_type}, '{return_type.ctype}']" + # function_return_type = ( + # return_type.return_type + # if return_type.conversion is not None or return_type.return_type == "None" + # else f"'{return_type.ctype}'" + # ) # If there is a result param if result_param is not None: # Create the CFFI object to hold it @@ -480,18 +462,14 @@ def build_function_string( # Otherwise, just return it normally else: result_manipulation = ( - (result_manipulation or "") - + f" return {returning_object} if {returning_object}" - f"!= _ffi.NULL else None\n" - ) + result_manipulation or "" + ) + f" return {returning_object} if {returning_object}!= _ffi.NULL else None\n" # Set the return type as the Python type, removing the pointer modifier if # necessary function_return_type = result_param.get_ptype_without_pointers() # Otherwise, return the result normally (if needed) elif return_type.return_type != "None": - result_manipulation = ( - result_manipulation or "" - ) + " return result if result != _ffi.NULL else None" + result_manipulation = (result_manipulation or "") + " return result if result != _ffi.NULL else None" # For each output param for out_param in out_params: @@ -503,9 +481,9 @@ def build_function_string( # Add it to the return statement result_manipulation += f", {out_param.name}[0]" - # If there are output params, wrap function return type in a Tuple + # If there are output params, wrap the function return type in a tuple if len(out_params) > 0: - function_return_type = f'"Tuple[{function_return_type}]"' + function_return_type = f"tuple[{function_return_type}]" # Add padding to param conversions if len(param_conversions) > 0: @@ -518,19 +496,16 @@ def build_function_string( # Create common part of function string (note, name, parameters, return type and # parameter conversions). - base = ( - f"{note}def {function_name}({params}) -> {function_return_type}:\n" - f"{param_conversions}" - ) + base = f"{note}def {function_name}({params}) -> {function_return_type}:\n{param_conversions}" # If the function didn't return anything, just add the function call to the base if return_type.return_type == "None": - function_string = f"{base}" f" _lib.{function_name}({inner_params})" + function_string = f"{base} _lib.{function_name}({inner_params})" # Otherwise, store the result in a variable else: - function_string = f"{base}" f" result = _lib.{function_name}({inner_params})" + function_string = f"{base} result = _lib.{function_name}({inner_params})" # Add error handling - function_string += f"\n _check_error()" + function_string += "\n _check_error()" # Add whatever manipulation the result needs (maybe empty) if result_manipulation is not None: diff --git a/builder/build_pymeos_functions_modifiers.py b/builder/build_pymeos_functions_modifiers.py index 9ad4176..df851e1 100644 --- a/builder/build_pymeos_functions_modifiers.py +++ b/builder/build_pymeos_functions_modifiers.py @@ -1,26 +1,20 @@ import re -from typing import Callable, Optional +from collections.abc import Callable -def array_length_remover_modifier( - list_name: str, length_param_name: str = "count" -) -> Callable[[str], str]: +def array_length_remover_modifier(list_name: str, length_param_name: str = "count") -> Callable[[str], str]: return lambda function: function.replace(f", {length_param_name}: int", "").replace( f", {length_param_name}", f", len({list_name})" ) -def array_parameter_modifier( - list_name: str, length_param_name: Optional[str] = None -) -> Callable[[str], str]: +def array_parameter_modifier(list_name: str, length_param_name: str | None = None) -> Callable[[str], str]: def custom_array_modifier(function: str) -> str: - type_regex = list_name + r": '([\w \*]+)'" + type_regex = list_name + r": Annotated\[(?:(?:_ffi\.CData)|(?:list)), '([\w \*]+)'\]" match = next(re.finditer(type_regex, function)) whole_type = match.group(1) base_type = " ".join(whole_type.split(" ")[:-1]) - function = function.replace( - match.group(0), f"{list_name}: 'List[{base_type}]'" - ).replace( + function = function.replace(match.group(0), f"{list_name}: 'list[{base_type}]'").replace( f"_ffi.cast('{whole_type}', {list_name})", f"_ffi.new('{base_type} []', {list_name})", ) @@ -36,22 +30,31 @@ def custom_array_modifier(function: str) -> str: def textset_make_modifier(function: str) -> str: function = array_parameter_modifier("values", "count")(function) return function.replace("_ffi.cast('const text *', x)", "cstring2text(x)").replace( - "'List[const text]'", "List[str]" + "'list[const text]'", "list[str]" ) def meos_initialize_modifier(_: str) -> str: - return """def meos_initialize(tz_str: "Optional[str]") -> None: + return """def meos_initialize(tz_str: str | None) -> None: if "PROJ_DATA" not in os.environ and "PROJ_LIB" not in os.environ: proj_dir = os.path.join(os.path.dirname(__file__), "proj_data") if os.path.exists(proj_dir): # Assume we are in a wheel and the PROJ data is in the package os.environ["PROJ_DATA"] = proj_dir os.environ["PROJ_LIB"] = proj_dir - + _lib.meos_initialize() - tz_str_converted = tz_str.encode('utf-8') if tz_str is not None else _ffi.NULL - _lib.meos_initialize_timezone(tz_str_converted) + + # Check if local spatial ref system csv exists (meaning wheel installation). If it does, use it. + wheel_path = os.path.join( + os.path.dirname(__file__), "meos_data", "spatial_ref_sys.csv" + ) + if os.path.exists(wheel_path): + _lib.meos_set_spatial_ref_sys_csv(wheel_path.encode("utf-8")) + + # Timezone is already initialized by meos_initialize, so we only need to set it if tz_str is provided + if tz_str is not None: + _lib.meos_initialize_timezone(tz_str.encode('utf-8')) _lib.meos_initialize_error_handler(_lib.py_error_handler)""" @@ -83,9 +86,7 @@ def from_wkb_modifier(function: str, return_type: str) -> Callable[[str], str]: def as_wkb_modifier(function: str) -> str: - return function.replace( - "-> \"Tuple['uint8_t *', 'size_t *']\":", "-> bytes:" - ).replace( + return function.replace("-> \"Tuple['uint8_t *', 'size_t *']\":", "-> bytes:").replace( "return result if result != _ffi.NULL else None, size_out[0]", "result_converted = bytes(result[i] for i in range(size_out[0])) if result != _ffi.NULL else None\n" " return result_converted", @@ -94,7 +95,7 @@ def as_wkb_modifier(function: str) -> str: def tstzset_make_modifier(function: str) -> str: return ( - function.replace("values: int", "values: List[int]") + function.replace("values: int", "values: list[int]") .replace(", count: int", "") .replace( "values_converted = _ffi.cast('const TimestampTz *', values)", @@ -106,7 +107,15 @@ def tstzset_make_modifier(function: str) -> str: def spanset_make_modifier(function: str) -> str: return ( - function.replace("spans: 'Span *', count: int", "spans: 'List[Span *]'") + function.replace( + "spans: Annotated[_ffi.CData, 'Span *'], count: int", "spans: list[Annotated[_ffi.CData, 'Span *']]" + ) .replace("_ffi.cast('Span *', spans)", "_ffi.new('Span []', spans)") .replace(", count", ", len(spans)") ) + + +def mi_span_span_modifier(function: str) -> str: + return function.replace( + '-> Annotated[_ffi.CData, "Span *"]', '-> tuple[Annotated[_ffi.CData, "Span *"], int]' + ).replace("return out_result", "return out_result, result") diff --git a/builder/meos.h b/builder/meos.h index c029ae7..07baee7 100644 --- a/builder/meos.h +++ b/builder/meos.h @@ -25,7 +25,6 @@ typedef struct pj_ctx PJ_CONTEXT; //#include //#include -//#include typedef char *Pointer; typedef uintptr_t Datum; @@ -67,7 +66,6 @@ extern DateADT date_in(const char *str); extern char *date_out(DateADT d); extern int interval_cmp(const Interval *interv1, const Interval *interv2); extern Interval *interval_in(const char *str, int32 typmod); -extern Interval *interval_make(int32 years, int32 months, int32 weeks, int32 days, int32 hours, int32 mins, double secs); extern char *interval_out(const Interval *interv); extern TimeADT time_in(const char *str, int32 typmod); extern char *time_out(TimeADT t); @@ -76,2302 +74,2544 @@ extern char *timestamp_out(Timestamp t); extern TimestampTz timestamptz_in(const char *str, int32 typmod); extern char *timestamptz_out(TimestampTz t); - - -typedef uint16_t lwflags_t; - -typedef struct { - double afac, bfac, cfac, dfac, efac, ffac, gfac, hfac, ifac, xoff, yoff, zoff; -} AFFINE; + typedef struct { - double xmin, ymin, zmin; - double xmax, ymax, zmax; - int32_t srid; -} -BOX3D; + int32 vl_len_; + uint8 settype; + uint8 basetype; + int16 flags; + int32 count; + int32 maxcount; + int16 bboxsize; +} Set; typedef struct { - lwflags_t flags; - double xmin; - double xmax; - double ymin; - double ymax; - double zmin; - double zmax; - double mmin; - double mmax; -} GBOX; + uint8 spantype; + uint8 basetype; + bool lower_inc; + bool upper_inc; + char padding[4]; + Datum lower; + Datum upper; +} Span; typedef struct { - double a; - double b; - double f; - double e; - double e_sq; - double radius; - char name[20]; -} -SPHEROID; + int32 vl_len_; + uint8 spansettype; + uint8 spantype; + uint8 basetype; + char padding; + int32 count; + int32 maxcount; + Span span; + Span elems[1]; +} SpanSet; typedef struct { - double x, y; -} -POINT2D; + Span period; + Span span; + int16 flags; +} TBox; typedef struct { - double x, y, z; -} -POINT3DZ; + Span period; + double xmin; + double ymin; + double zmin; + double xmax; + double ymax; + double zmax; + int32_t srid; + int16 flags; +} STBox; -typedef struct +typedef enum { - double x, y, z; -} -POINT3D; + ANYTEMPSUBTYPE = 0, + TINSTANT = 1, + TSEQUENCE = 2, + TSEQUENCESET = 3, +} tempSubtype; -typedef struct +typedef enum { - double x, y, m; -} -POINT3DM; + INTERP_NONE = 0, + DISCRETE = 1, + STEP = 2, + LINEAR = 3, +} interpType; typedef struct { - double x, y, z, m; -} -POINT4D; + int32 vl_len_; + uint8 temptype; + uint8 subtype; + int16 flags; + +} Temporal; typedef struct { - uint32_t npoints; - uint32_t maxpoints; - - - lwflags_t flags; - - - uint8_t *serialized_pointlist; -} -POINTARRAY; + int32 vl_len_; + uint8 temptype; + uint8 subtype; + int16 flags; + TimestampTz t; + Datum value; + +} TInstant; typedef struct { - uint32_t size; - uint8_t srid[3]; - uint8_t gflags; - uint8_t data[1]; -} GSERIALIZED; + int32 vl_len_; + uint8 temptype; + uint8 subtype; + int16 flags; + int32 count; + int32 maxcount; + int16 bboxsize; + char padding[6]; + Span period; + +} TSequence; typedef struct { - GBOX *bbox; - void *data; - int32_t srid; - lwflags_t flags; - uint8_t type; - char pad[1]; -} -LWGEOM; + int32 vl_len_; + uint8 temptype; + uint8 subtype; + int16 flags; + int32 count; + int32 totalcount; + int32 maxcount; + int16 bboxsize; + int16 padding; + Span period; + +} TSequenceSet; typedef struct { - GBOX *bbox; - POINTARRAY *point; - int32_t srid; - lwflags_t flags; - uint8_t type; - char pad[1]; -} -LWPOINT; + int i; + int j; +} Match; +#define SKIPLIST_MAXLEVEL 32 typedef struct { - GBOX *bbox; - POINTARRAY *points; - int32_t srid; - lwflags_t flags; - uint8_t type; - char pad[1]; -} -LWLINE; + void *value; + int height; + int next[SKIPLIST_MAXLEVEL]; +} SkipListElem; typedef struct { - GBOX *bbox; - POINTARRAY *points; - int32_t srid; - lwflags_t flags; - uint8_t type; - char pad[1]; -} -LWTRIANGLE; + int capacity; + int next; + int length; + int *freed; + int freecount; + int freecap; + int tail; + void *extra; + size_t extrasize; + SkipListElem *elems; +} SkipList; -typedef struct -{ - GBOX *bbox; - POINTARRAY *points; - int32_t srid; - lwflags_t flags; - uint8_t type; - char pad[1]; -} -LWCIRCSTRING; +typedef struct RTree RTree; -typedef struct +typedef enum { - GBOX *bbox; - POINTARRAY **rings; - int32_t srid; - lwflags_t flags; - uint8_t type; - char pad[1]; - uint32_t nrings; - uint32_t maxrings; -} -LWPOLY; + MEOS_SUCCESS = 0, + + MEOS_ERR_INTERNAL_ERROR = 1, + MEOS_ERR_INTERNAL_TYPE_ERROR = 2, + MEOS_ERR_VALUE_OUT_OF_RANGE = 3, + MEOS_ERR_DIVISION_BY_ZERO = 4, + MEOS_ERR_MEMORY_ALLOC_ERROR = 5, + MEOS_ERR_AGGREGATION_ERROR = 6, + MEOS_ERR_DIRECTORY_ERROR = 7, + MEOS_ERR_FILE_ERROR = 8, + + MEOS_ERR_INVALID_ARG = 10, + MEOS_ERR_INVALID_ARG_TYPE = 11, + MEOS_ERR_INVALID_ARG_VALUE = 12, + MEOS_ERR_FEATURE_NOT_SUPPORTED = 13, + + MEOS_ERR_MFJSON_INPUT = 20, + MEOS_ERR_MFJSON_OUTPUT = 21, + MEOS_ERR_TEXT_INPUT = 22, + MEOS_ERR_TEXT_OUTPUT = 23, + MEOS_ERR_WKB_INPUT = 24, + MEOS_ERR_WKB_OUTPUT = 25, + MEOS_ERR_GEOJSON_INPUT = 26, + MEOS_ERR_GEOJSON_OUTPUT = 27, -typedef struct -{ - GBOX *bbox; - LWPOINT **geoms; - int32_t srid; - lwflags_t flags; - uint8_t type; - char pad[1]; - uint32_t ngeoms; - uint32_t maxgeoms; -} -LWMPOINT; +} errorCode; -typedef struct -{ - GBOX *bbox; - LWLINE **geoms; - int32_t srid; - lwflags_t flags; - uint8_t type; - char pad[1]; - uint32_t ngeoms; - uint32_t maxgeoms; -} -LWMLINE; +extern void meos_error(int errlevel, int errcode, const char *format, ...); -typedef struct -{ - GBOX *bbox; - LWPOLY **geoms; - int32_t srid; - lwflags_t flags; - uint8_t type; - char pad[1]; - uint32_t ngeoms; - uint32_t maxgeoms; -} -LWMPOLY; - -typedef struct -{ - GBOX *bbox; - LWGEOM **geoms; - int32_t srid; - lwflags_t flags; - uint8_t type; - char pad[1]; - uint32_t ngeoms; - uint32_t maxgeoms; -} -LWCOLLECTION; - -typedef struct -{ - GBOX *bbox; - LWGEOM **geoms; - int32_t srid; - lwflags_t flags; - uint8_t type; - char pad[1]; - uint32_t ngeoms; - uint32_t maxgeoms; -} -LWCOMPOUND; - -typedef struct -{ - GBOX *bbox; - LWGEOM **rings; - int32_t srid; - lwflags_t flags; - uint8_t type; - char pad[1]; - uint32_t nrings; - uint32_t maxrings; -} -LWCURVEPOLY; - -typedef struct -{ - GBOX *bbox; - LWGEOM **geoms; - int32_t srid; - lwflags_t flags; - uint8_t type; - char pad[1]; - uint32_t ngeoms; - uint32_t maxgeoms; -} -LWMCURVE; - -typedef struct -{ - GBOX *bbox; - LWGEOM **geoms; - int32_t srid; - lwflags_t flags; - uint8_t type; - char pad[1]; - uint32_t ngeoms; - uint32_t maxgeoms; -} -LWMSURFACE; +extern int meos_errno(void); +extern int meos_errno_set(int err); +extern int meos_errno_restore(int err); +extern int meos_errno_reset(void); -typedef struct -{ - GBOX *bbox; - LWPOLY **geoms; - int32_t srid; - lwflags_t flags; - uint8_t type; - char pad[1]; - uint32_t ngeoms; - uint32_t maxgeoms; -} -LWPSURFACE; +typedef void (*error_handler_fn)(int, int, const char *); -typedef struct -{ - GBOX *bbox; - LWTRIANGLE **geoms; - int32_t srid; - lwflags_t flags; - uint8_t type; - char pad[1]; - uint32_t ngeoms; - uint32_t maxgeoms; -} -LWTIN; +extern void meos_initialize_timezone(const char *name); +extern void meos_initialize_error_handler(error_handler_fn err_handler); +extern void meos_finalize_timezone(void); +extern void meos_finalize_projsrs(void); +extern void meos_finalize_ways(void); -/* extern int32 geo_get_srid(const GSERIALIZED *g); (undefined) */ +extern bool meos_set_datestyle(const char *newval, void *extra); +extern bool meos_set_intervalstyle(const char *newval, int extra); +extern char *meos_get_datestyle(void); +extern char *meos_get_intervalstyle(void); -struct PJconsts; -typedef struct PJconsts PJ; +extern void meos_set_spatial_ref_sys_csv(const char* path); -typedef struct LWPROJ -{ - PJ* pj; +extern void meos_initialize(void); +extern void meos_finalize(void); - - bool pipeline_is_forward; +extern DateADT add_date_int(DateADT d, int32 days); +extern Interval *add_interval_interval(const Interval *interv1, const Interval *interv2); +extern TimestampTz add_timestamptz_interval(TimestampTz t, const Interval *interv); +extern bool bool_in(const char *str); +extern char *bool_out(bool b); +extern text *cstring2text(const char *str); +extern Timestamp date_to_timestamp(DateADT dateVal); +extern TimestampTz date_to_timestamptz(DateADT d); +extern double float_exp(double d); +extern double float_ln(double d); +extern double float_log10(double d); +extern double float_round(double d, int maxdd); +extern Interval *interval_make(int32 years, int32 months, int32 weeks, int32 days, int32 hours, int32 mins, double secs); +extern Interval *minus_date_date(DateADT d1, DateADT d2); +extern DateADT minus_date_int(DateADT d, int32 days); +extern TimestampTz minus_timestamptz_interval(TimestampTz t, const Interval *interv); +extern Interval *minus_timestamptz_timestamptz(TimestampTz t1, TimestampTz t2); +extern Interval *mul_interval_double(const Interval *interv, double factor); +extern DateADT pg_date_in(const char *str); +extern char *pg_date_out(DateADT d); +extern int pg_interval_cmp(const Interval *interv1, const Interval *interv2); +extern Interval *pg_interval_in(const char *str, int32 typmod); +extern char *pg_interval_out(const Interval *interv); +extern Timestamp pg_timestamp_in(const char *str, int32 typmod); +extern char *pg_timestamp_out(Timestamp t); +extern TimestampTz pg_timestamptz_in(const char *str, int32 typmod); +extern char *pg_timestamptz_out(TimestampTz t); +extern char *text2cstring(const text *txt); +extern int text_cmp(const text *txt1, const text *txt2); +extern text *text_copy(const text *txt); +extern text *text_initcap(const text *txt); +extern text *text_lower(const text *txt); +extern char *text_out(const text *txt); +extern text *text_upper(const text *txt); +extern text *textcat_text_text(const text *txt1, const text *txt2); +extern TimestampTz timestamptz_shift(TimestampTz t, const Interval *interv); +extern DateADT timestamp_to_date(Timestamp t); +extern DateADT timestamptz_to_date(TimestampTz t); - - uint8_t source_is_latlong; - - double source_semi_major_metre; - double source_semi_minor_metre; -} LWPROJ; +extern Set *bigintset_in(const char *str); +extern char *bigintset_out(const Set *set); +extern Span *bigintspan_in(const char *str); +extern char *bigintspan_out(const Span *s); +extern SpanSet *bigintspanset_in(const char *str); +extern char *bigintspanset_out(const SpanSet *ss); +extern Set *dateset_in(const char *str); +extern char *dateset_out(const Set *s); +extern Span *datespan_in(const char *str); +extern char *datespan_out(const Span *s); +extern SpanSet *datespanset_in(const char *str); +extern char *datespanset_out(const SpanSet *ss); +extern Set *floatset_in(const char *str); +extern char *floatset_out(const Set *set, int maxdd); +extern Span *floatspan_in(const char *str); +extern char *floatspan_out(const Span *s, int maxdd); +extern SpanSet *floatspanset_in(const char *str); +extern char *floatspanset_out(const SpanSet *ss, int maxdd); +extern Set *intset_in(const char *str); +extern char *intset_out(const Set *set); +extern Span *intspan_in(const char *str); +extern char *intspan_out(const Span *s); +extern SpanSet *intspanset_in(const char *str); +extern char *intspanset_out(const SpanSet *ss); +extern char *set_as_hexwkb(const Set *s, uint8_t variant, size_t *size_out); +extern uint8_t *set_as_wkb(const Set *s, uint8_t variant, size_t *size_out); +extern Set *set_from_hexwkb(const char *hexwkb); +extern Set *set_from_wkb(const uint8_t *wkb, size_t size); +extern char *span_as_hexwkb(const Span *s, uint8_t variant, size_t *size_out); +extern uint8_t *span_as_wkb(const Span *s, uint8_t variant, size_t *size_out); +extern Span *span_from_hexwkb(const char *hexwkb); +extern Span *span_from_wkb(const uint8_t *wkb, size_t size); +extern char *spanset_as_hexwkb(const SpanSet *ss, uint8_t variant, size_t *size_out); +extern uint8_t *spanset_as_wkb(const SpanSet *ss, uint8_t variant, size_t *size_out); +extern SpanSet *spanset_from_hexwkb(const char *hexwkb); +extern SpanSet *spanset_from_wkb(const uint8_t *wkb, size_t size); +extern Set *textset_in(const char *str); +extern char *textset_out(const Set *set); +extern Set *tstzset_in(const char *str); +extern char *tstzset_out(const Set *set); +extern Span *tstzspan_in(const char *str); +extern char *tstzspan_out(const Span *s); +extern SpanSet *tstzspanset_in(const char *str); +extern char *tstzspanset_out(const SpanSet *ss); - +extern Set *bigintset_make(const int64 *values, int count); +extern Span *bigintspan_make(int64 lower, int64 upper, bool lower_inc, bool upper_inc); +extern Set *dateset_make(const DateADT *values, int count); +extern Span *datespan_make(DateADT lower, DateADT upper, bool lower_inc, bool upper_inc); +extern Set *floatset_make(const double *values, int count); +extern Span *floatspan_make(double lower, double upper, bool lower_inc, bool upper_inc); +extern Set *intset_make(const int *values, int count); +extern Span *intspan_make(int lower, int upper, bool lower_inc, bool upper_inc); +extern Set *set_copy(const Set *s); +extern Span *span_copy(const Span *s); +extern SpanSet *spanset_copy(const SpanSet *ss); +extern SpanSet *spanset_make(Span *spans, int count); +extern Set *textset_make(const text **values, int count); +extern Set *tstzset_make(const TimestampTz *values, int count); +extern Span *tstzspan_make(TimestampTz lower, TimestampTz upper, bool lower_inc, bool upper_inc); -typedef struct -{ - int32 vl_len_; - uint8 settype; - uint8 basetype; - int16 flags; - int32 count; - int32 maxcount; - int16 bboxsize; -} Set; +extern Set *bigint_to_set(int64 i); +extern Span *bigint_to_span(int i); +extern SpanSet *bigint_to_spanset(int i); +extern Set *date_to_set(DateADT d); +extern Span *date_to_span(DateADT d); +extern SpanSet *date_to_spanset(DateADT d); +extern Set *dateset_to_tstzset(const Set *s); +extern Span *datespan_to_tstzspan(const Span *s); +extern SpanSet *datespanset_to_tstzspanset(const SpanSet *ss); +extern Set *float_to_set(double d); +extern Span *float_to_span(double d); +extern SpanSet *float_to_spanset(double d); +extern Set *floatset_to_intset(const Set *s); +extern Span *floatspan_to_intspan(const Span *s); +extern SpanSet *floatspanset_to_intspanset(const SpanSet *ss); +extern Set *int_to_set(int i); +extern Span *int_to_span(int i); +extern SpanSet *int_to_spanset(int i); +extern Set *intset_to_floatset(const Set *s); +extern Span *intspan_to_floatspan(const Span *s); +extern SpanSet *intspanset_to_floatspanset(const SpanSet *ss); +extern Span *set_to_span(const Set *s); +extern SpanSet *set_to_spanset(const Set *s); +extern SpanSet *span_to_spanset(const Span *s); +extern Set *text_to_set(const text *txt); +extern Set *timestamptz_to_set(TimestampTz t); +extern Span *timestamptz_to_span(TimestampTz t); +extern SpanSet *timestamptz_to_spanset(TimestampTz t); +extern Set *tstzset_to_dateset(const Set *s); +extern Span *tstzspan_to_datespan(const Span *s); +extern SpanSet *tstzspanset_to_datespanset(const SpanSet *ss); -typedef struct -{ - uint8 spantype; - uint8 basetype; - bool lower_inc; - bool upper_inc; - char padding[4]; - Datum lower; - Datum upper; -} Span; - -typedef struct -{ - int32 vl_len_; - uint8 spansettype; - uint8 spantype; - uint8 basetype; - char padding; - int32 count; - int32 maxcount; - Span span; - Span elems[1]; -} SpanSet; - -typedef struct -{ - Span period; - Span span; - int16 flags; -} TBox; +extern int64 bigintset_end_value(const Set *s); +extern int64 bigintset_start_value(const Set *s); +extern bool bigintset_value_n(const Set *s, int n, int64 *result); +extern int64 *bigintset_values(const Set *s); +extern int64 bigintspan_lower(const Span *s); +extern int64 bigintspan_upper(const Span *s); +extern int64 bigintspan_width(const Span *s); +extern int64 bigintspanset_lower(const SpanSet *ss); +extern int64 bigintspanset_upper(const SpanSet *ss); +extern int64 bigintspanset_width(const SpanSet *ss, bool boundspan); +extern DateADT dateset_end_value(const Set *s); +extern DateADT dateset_start_value(const Set *s); +extern bool dateset_value_n(const Set *s, int n, DateADT *result); +extern DateADT *dateset_values(const Set *s); +extern Interval *datespan_duration(const Span *s); +extern DateADT datespan_lower(const Span *s); +extern DateADT datespan_upper(const Span *s); +extern bool datespanset_date_n(const SpanSet *ss, int n, DateADT *result); +extern Set *datespanset_dates(const SpanSet *ss); +extern Interval *datespanset_duration(const SpanSet *ss, bool boundspan); +extern DateADT datespanset_end_date(const SpanSet *ss); +extern int datespanset_num_dates(const SpanSet *ss); +extern DateADT datespanset_start_date(const SpanSet *ss); +extern double floatset_end_value(const Set *s); +extern double floatset_start_value(const Set *s); +extern bool floatset_value_n(const Set *s, int n, double *result); +extern double *floatset_values(const Set *s); +extern double floatspan_lower(const Span *s); +extern double floatspan_upper(const Span *s); +extern double floatspan_width(const Span *s); +extern double floatspanset_lower(const SpanSet *ss); +extern double floatspanset_upper(const SpanSet *ss); +extern double floatspanset_width(const SpanSet *ss, bool boundspan); +extern int intset_end_value(const Set *s); +extern int intset_start_value(const Set *s); +extern bool intset_value_n(const Set *s, int n, int *result); +extern int *intset_values(const Set *s); +extern int intspan_lower(const Span *s); +extern int intspan_upper(const Span *s); +extern int intspan_width(const Span *s); +extern int intspanset_lower(const SpanSet *ss); +extern int intspanset_upper(const SpanSet *ss); +extern int intspanset_width(const SpanSet *ss, bool boundspan); +extern uint32 set_hash(const Set *s); +extern uint64 set_hash_extended(const Set *s, uint64 seed); +extern int set_num_values(const Set *s); +extern uint32 span_hash(const Span *s); +extern uint64 span_hash_extended(const Span *s, uint64 seed); +extern bool span_lower_inc(const Span *s); +extern bool span_upper_inc(const Span *s); +extern Span *spanset_end_span(const SpanSet *ss); +extern uint32 spanset_hash(const SpanSet *ss); +extern uint64 spanset_hash_extended(const SpanSet *ss, uint64 seed); +extern bool spanset_lower_inc(const SpanSet *ss); +extern int spanset_num_spans(const SpanSet *ss); +extern Span *spanset_span(const SpanSet *ss); +extern Span *spanset_span_n(const SpanSet *ss, int i); +extern Span **spanset_spanarr(const SpanSet *ss); +extern Span *spanset_start_span(const SpanSet *ss); +extern bool spanset_upper_inc(const SpanSet *ss); +extern text *textset_end_value(const Set *s); +extern text *textset_start_value(const Set *s); +extern bool textset_value_n(const Set *s, int n, text **result); +extern text **textset_values(const Set *s); +extern TimestampTz tstzset_end_value(const Set *s); +extern TimestampTz tstzset_start_value(const Set *s); +extern bool tstzset_value_n(const Set *s, int n, TimestampTz *result); +extern TimestampTz *tstzset_values(const Set *s); +extern Interval *tstzspan_duration(const Span *s); +extern TimestampTz tstzspan_lower(const Span *s); +extern TimestampTz tstzspan_upper(const Span *s); +extern Interval *tstzspanset_duration(const SpanSet *ss, bool boundspan); +extern TimestampTz tstzspanset_end_timestamptz(const SpanSet *ss); +extern TimestampTz tstzspanset_lower(const SpanSet *ss); +extern int tstzspanset_num_timestamps(const SpanSet *ss); +extern TimestampTz tstzspanset_start_timestamptz(const SpanSet *ss); +extern Set *tstzspanset_timestamps(const SpanSet *ss); +extern bool tstzspanset_timestamptz_n(const SpanSet *ss, int n, TimestampTz *result); +extern TimestampTz tstzspanset_upper(const SpanSet *ss); -typedef struct -{ - Span period; - double xmin; - double ymin; - double zmin; - double xmax; - double ymax; - double zmax; - int32_t srid; - int16 flags; -} STBox; +extern Set *bigintset_shift_scale(const Set *s, int64 shift, int64 width, bool hasshift, bool haswidth); +extern Span *bigintspan_shift_scale(const Span *s, int64 shift, int64 width, bool hasshift, bool haswidth); +extern SpanSet *bigintspanset_shift_scale(const SpanSet *ss, int64 shift, int64 width, bool hasshift, bool haswidth); +extern Set *dateset_shift_scale(const Set *s, int shift, int width, bool hasshift, bool haswidth); +extern Span *datespan_shift_scale(const Span *s, int shift, int width, bool hasshift, bool haswidth); +extern SpanSet *datespanset_shift_scale(const SpanSet *ss, int shift, int width, bool hasshift, bool haswidth); +extern Set *floatset_ceil(const Set *s); +extern Set *floatset_degrees(const Set *s, bool normalize); +extern Set *floatset_floor(const Set *s); +extern Set *floatset_radians(const Set *s); +extern Set *floatset_shift_scale(const Set *s, double shift, double width, bool hasshift, bool haswidth); +extern Span *floatspan_ceil(const Span *s); +extern Span *floatspan_degrees(const Span *s, bool normalize); +extern Span *floatspan_floor(const Span *s); +extern Span *floatspan_radians(const Span *s); +extern Span *floatspan_round(const Span *s, int maxdd); +extern Span *floatspan_shift_scale(const Span *s, double shift, double width, bool hasshift, bool haswidth); +extern SpanSet *floatspanset_ceil(const SpanSet *ss); +extern SpanSet *floatspanset_floor(const SpanSet *ss); +extern SpanSet *floatspanset_degrees(const SpanSet *ss, bool normalize); +extern SpanSet *floatspanset_radians(const SpanSet *ss); +extern SpanSet *floatspanset_round(const SpanSet *ss, int maxdd); +extern SpanSet *floatspanset_shift_scale(const SpanSet *ss, double shift, double width, bool hasshift, bool haswidth); +extern Set *intset_shift_scale(const Set *s, int shift, int width, bool hasshift, bool haswidth); +extern Span *intspan_shift_scale(const Span *s, int shift, int width, bool hasshift, bool haswidth); +extern SpanSet *intspanset_shift_scale(const SpanSet *ss, int shift, int width, bool hasshift, bool haswidth); +extern Span *numspan_expand(const Span *s, Datum value); +extern Span *tstzspan_expand(const Span *s, const Interval *interv); +extern Set *set_round(const Set *s, int maxdd); +extern Set *textcat_text_textset(const text *txt, const Set *s); +extern Set *textcat_textset_text(const Set *s, const text *txt); +extern Set *textset_initcap(const Set *s); +extern Set *textset_lower(const Set *s); +extern Set *textset_upper(const Set *s); +extern TimestampTz timestamptz_tprecision(TimestampTz t, const Interval *duration, TimestampTz torigin); +extern Set *tstzset_shift_scale(const Set *s, const Interval *shift, const Interval *duration); +extern Set *tstzset_tprecision(const Set *s, const Interval *duration, TimestampTz torigin); +extern Span *tstzspan_shift_scale(const Span *s, const Interval *shift, const Interval *duration); +extern Span *tstzspan_tprecision(const Span *s, const Interval *duration, TimestampTz torigin); +extern SpanSet *tstzspanset_shift_scale(const SpanSet *ss, const Interval *shift, const Interval *duration); +extern SpanSet *tstzspanset_tprecision(const SpanSet *ss, const Interval *duration, TimestampTz torigin); -typedef enum -{ - ANYTEMPSUBTYPE = 0, - TINSTANT = 1, - TSEQUENCE = 2, - TSEQUENCESET = 3, -} tempSubtype; +extern int set_cmp(const Set *s1, const Set *s2); +extern bool set_eq(const Set *s1, const Set *s2); +extern bool set_ge(const Set *s1, const Set *s2); +extern bool set_gt(const Set *s1, const Set *s2); +extern bool set_le(const Set *s1, const Set *s2); +extern bool set_lt(const Set *s1, const Set *s2); +extern bool set_ne(const Set *s1, const Set *s2); +extern int span_cmp(const Span *s1, const Span *s2); +extern bool span_eq(const Span *s1, const Span *s2); +extern bool span_ge(const Span *s1, const Span *s2); +extern bool span_gt(const Span *s1, const Span *s2); +extern bool span_le(const Span *s1, const Span *s2); +extern bool span_lt(const Span *s1, const Span *s2); +extern bool span_ne(const Span *s1, const Span *s2); +extern int spanset_cmp(const SpanSet *ss1, const SpanSet *ss2); +extern bool spanset_eq(const SpanSet *ss1, const SpanSet *ss2); +extern bool spanset_ge(const SpanSet *ss1, const SpanSet *ss2); +extern bool spanset_gt(const SpanSet *ss1, const SpanSet *ss2); +extern bool spanset_le(const SpanSet *ss1, const SpanSet *ss2); +extern bool spanset_lt(const SpanSet *ss1, const SpanSet *ss2); +extern bool spanset_ne(const SpanSet *ss1, const SpanSet *ss2); -typedef enum -{ - INTERP_NONE = 0, - DISCRETE = 1, - STEP = 2, - LINEAR = 3, -} interpType; +extern Span *set_spans(const Set *s); +extern Span *set_split_each_n_spans(const Set *s, int elems_per_span, int *count); +extern Span *set_split_n_spans(const Set *s, int span_count, int *count); +extern Span *spanset_spans(const SpanSet *ss); +extern Span *spanset_split_each_n_spans(const SpanSet *ss, int elems_per_span, int *count); +extern Span *spanset_split_n_spans(const SpanSet *ss, int span_count, int *count); -typedef enum -{ - INTERSECTS = 0, - CONTAINS = 1, - TOUCHES = 2, - COVERS = 3, -} spatialRel; +extern bool adjacent_span_bigint(const Span *s, int64 i); +extern bool adjacent_span_date(const Span *s, DateADT d); +extern bool adjacent_span_float(const Span *s, double d); +extern bool adjacent_span_int(const Span *s, int i); +extern bool adjacent_span_span(const Span *s1, const Span *s2); +extern bool adjacent_span_spanset(const Span *s, const SpanSet *ss); +extern bool adjacent_span_timestamptz(const Span *s, TimestampTz t); +extern bool adjacent_spanset_bigint(const SpanSet *ss, int64 i); +extern bool adjacent_spanset_date(const SpanSet *ss, DateADT d); +extern bool adjacent_spanset_float(const SpanSet *ss, double d); +extern bool adjacent_spanset_int(const SpanSet *ss, int i); +extern bool adjacent_spanset_timestamptz(const SpanSet *ss, TimestampTz t); +extern bool adjacent_spanset_span(const SpanSet *ss, const Span *s); +extern bool adjacent_spanset_spanset(const SpanSet *ss1, const SpanSet *ss2); +extern bool contained_bigint_set(int64 i, const Set *s); +extern bool contained_bigint_span(int64 i, const Span *s); +extern bool contained_bigint_spanset(int64 i, const SpanSet *ss); +extern bool contained_date_set(DateADT d, const Set *s); +extern bool contained_date_span(DateADT d, const Span *s); +extern bool contained_date_spanset(DateADT d, const SpanSet *ss); +extern bool contained_float_set(double d, const Set *s); +extern bool contained_float_span(double d, const Span *s); +extern bool contained_float_spanset(double d, const SpanSet *ss); +extern bool contained_int_set(int i, const Set *s); +extern bool contained_int_span(int i, const Span *s); +extern bool contained_int_spanset(int i, const SpanSet *ss); +extern bool contained_set_set(const Set *s1, const Set *s2); +extern bool contained_span_span(const Span *s1, const Span *s2); +extern bool contained_span_spanset(const Span *s, const SpanSet *ss); +extern bool contained_spanset_span(const SpanSet *ss, const Span *s); +extern bool contained_spanset_spanset(const SpanSet *ss1, const SpanSet *ss2); +extern bool contained_text_set(const text *txt, const Set *s); +extern bool contained_timestamptz_set(TimestampTz t, const Set *s); +extern bool contained_timestamptz_span(TimestampTz t, const Span *s); +extern bool contained_timestamptz_spanset(TimestampTz t, const SpanSet *ss); +extern bool contains_set_bigint(const Set *s, int64 i); +extern bool contains_set_date(const Set *s, DateADT d); +extern bool contains_set_float(const Set *s, double d); +extern bool contains_set_int(const Set *s, int i); +extern bool contains_set_set(const Set *s1, const Set *s2); +extern bool contains_set_text(const Set *s, text *t); +extern bool contains_set_timestamptz(const Set *s, TimestampTz t); +extern bool contains_span_bigint(const Span *s, int64 i); +extern bool contains_span_date(const Span *s, DateADT d); +extern bool contains_span_float(const Span *s, double d); +extern bool contains_span_int(const Span *s, int i); +extern bool contains_span_span(const Span *s1, const Span *s2); +extern bool contains_span_spanset(const Span *s, const SpanSet *ss); +extern bool contains_span_timestamptz(const Span *s, TimestampTz t); +extern bool contains_spanset_bigint(const SpanSet *ss, int64 i); +extern bool contains_spanset_date(const SpanSet *ss, DateADT d); +extern bool contains_spanset_float(const SpanSet *ss, double d); +extern bool contains_spanset_int(const SpanSet *ss, int i); +extern bool contains_spanset_span(const SpanSet *ss, const Span *s); +extern bool contains_spanset_spanset(const SpanSet *ss1, const SpanSet *ss2); +extern bool contains_spanset_timestamptz(const SpanSet *ss, TimestampTz t); +extern bool overlaps_set_set(const Set *s1, const Set *s2); +extern bool overlaps_span_span(const Span *s1, const Span *s2); +extern bool overlaps_span_spanset(const Span *s, const SpanSet *ss); +extern bool overlaps_spanset_span(const SpanSet *ss, const Span *s); +extern bool overlaps_spanset_spanset(const SpanSet *ss1, const SpanSet *ss2); -typedef struct -{ - int32 vl_len_; - uint8 temptype; - uint8 subtype; - int16 flags; - -} Temporal; +extern bool after_date_set(DateADT d, const Set *s); +extern bool after_date_span(DateADT d, const Span *s); +extern bool after_date_spanset(DateADT d, const SpanSet *ss); +extern bool after_set_date(const Set *s, DateADT d); +extern bool after_set_timestamptz(const Set *s, TimestampTz t); +extern bool after_span_date(const Span *s, DateADT d); +extern bool after_span_timestamptz(const Span *s, TimestampTz t); +extern bool after_spanset_date(const SpanSet *ss, DateADT d); +extern bool after_spanset_timestamptz(const SpanSet *ss, TimestampTz t); +extern bool after_timestamptz_set(TimestampTz t, const Set *s); +extern bool after_timestamptz_span(TimestampTz t, const Span *s); +extern bool after_timestamptz_spanset(TimestampTz t, const SpanSet *ss); +extern bool before_date_set(DateADT d, const Set *s); +extern bool before_date_span(DateADT d, const Span *s); +extern bool before_date_spanset(DateADT d, const SpanSet *ss); +extern bool before_set_date(const Set *s, DateADT d); +extern bool before_set_timestamptz(const Set *s, TimestampTz t); +extern bool before_span_date(const Span *s, DateADT d); +extern bool before_span_timestamptz(const Span *s, TimestampTz t); +extern bool before_spanset_date(const SpanSet *ss, DateADT d); +extern bool before_spanset_timestamptz(const SpanSet *ss, TimestampTz t); +extern bool before_timestamptz_set(TimestampTz t, const Set *s); +extern bool before_timestamptz_span(TimestampTz t, const Span *s); +extern bool before_timestamptz_spanset(TimestampTz t, const SpanSet *ss); +extern bool left_bigint_set(int64 i, const Set *s); +extern bool left_bigint_span(int64 i, const Span *s); +extern bool left_bigint_spanset(int64 i, const SpanSet *ss); +extern bool left_float_set(double d, const Set *s); +extern bool left_float_span(double d, const Span *s); +extern bool left_float_spanset(double d, const SpanSet *ss); +extern bool left_int_set(int i, const Set *s); +extern bool left_int_span(int i, const Span *s); +extern bool left_int_spanset(int i, const SpanSet *ss); +extern bool left_set_bigint(const Set *s, int64 i); +extern bool left_set_float(const Set *s, double d); +extern bool left_set_int(const Set *s, int i); +extern bool left_set_set(const Set *s1, const Set *s2); +extern bool left_set_text(const Set *s, text *txt); +extern bool left_span_bigint(const Span *s, int64 i); +extern bool left_span_float(const Span *s, double d); +extern bool left_span_int(const Span *s, int i); +extern bool left_span_span(const Span *s1, const Span *s2); +extern bool left_span_spanset(const Span *s, const SpanSet *ss); +extern bool left_spanset_bigint(const SpanSet *ss, int64 i); +extern bool left_spanset_float(const SpanSet *ss, double d); +extern bool left_spanset_int(const SpanSet *ss, int i); +extern bool left_spanset_span(const SpanSet *ss, const Span *s); +extern bool left_spanset_spanset(const SpanSet *ss1, const SpanSet *ss2); +extern bool left_text_set(const text *txt, const Set *s); +extern bool overafter_date_set(DateADT d, const Set *s); +extern bool overafter_date_span(DateADT d, const Span *s); +extern bool overafter_date_spanset(DateADT d, const SpanSet *ss); +extern bool overafter_set_date(const Set *s, DateADT d); +extern bool overafter_set_timestamptz(const Set *s, TimestampTz t); +extern bool overafter_span_date(const Span *s, DateADT d); +extern bool overafter_span_timestamptz(const Span *s, TimestampTz t); +extern bool overafter_spanset_date(const SpanSet *ss, DateADT d); +extern bool overafter_spanset_timestamptz(const SpanSet *ss, TimestampTz t); +extern bool overafter_timestamptz_set(TimestampTz t, const Set *s); +extern bool overafter_timestamptz_span(TimestampTz t, const Span *s); +extern bool overafter_timestamptz_spanset(TimestampTz t, const SpanSet *ss); +extern bool overbefore_date_set(DateADT d, const Set *s); +extern bool overbefore_date_span(DateADT d, const Span *s); +extern bool overbefore_date_spanset(DateADT d, const SpanSet *ss); +extern bool overbefore_set_date(const Set *s, DateADT d); +extern bool overbefore_set_timestamptz(const Set *s, TimestampTz t); +extern bool overbefore_span_date(const Span *s, DateADT d); +extern bool overbefore_span_timestamptz(const Span *s, TimestampTz t); +extern bool overbefore_spanset_date(const SpanSet *ss, DateADT d); +extern bool overbefore_spanset_timestamptz(const SpanSet *ss, TimestampTz t); +extern bool overbefore_timestamptz_set(TimestampTz t, const Set *s); +extern bool overbefore_timestamptz_span(TimestampTz t, const Span *s); +extern bool overbefore_timestamptz_spanset(TimestampTz t, const SpanSet *ss); +extern bool overleft_bigint_set(int64 i, const Set *s); +extern bool overleft_bigint_span(int64 i, const Span *s); +extern bool overleft_bigint_spanset(int64 i, const SpanSet *ss); +extern bool overleft_float_set(double d, const Set *s); +extern bool overleft_float_span(double d, const Span *s); +extern bool overleft_float_spanset(double d, const SpanSet *ss); +extern bool overleft_int_set(int i, const Set *s); +extern bool overleft_int_span(int i, const Span *s); +extern bool overleft_int_spanset(int i, const SpanSet *ss); +extern bool overleft_set_bigint(const Set *s, int64 i); +extern bool overleft_set_float(const Set *s, double d); +extern bool overleft_set_int(const Set *s, int i); +extern bool overleft_set_set(const Set *s1, const Set *s2); +extern bool overleft_set_text(const Set *s, text *txt); +extern bool overleft_span_bigint(const Span *s, int64 i); +extern bool overleft_span_float(const Span *s, double d); +extern bool overleft_span_int(const Span *s, int i); +extern bool overleft_span_span(const Span *s1, const Span *s2); +extern bool overleft_span_spanset(const Span *s, const SpanSet *ss); +extern bool overleft_spanset_bigint(const SpanSet *ss, int64 i); +extern bool overleft_spanset_float(const SpanSet *ss, double d); +extern bool overleft_spanset_int(const SpanSet *ss, int i); +extern bool overleft_spanset_span(const SpanSet *ss, const Span *s); +extern bool overleft_spanset_spanset(const SpanSet *ss1, const SpanSet *ss2); +extern bool overleft_text_set(const text *txt, const Set *s); +extern bool overright_bigint_set(int64 i, const Set *s); +extern bool overright_bigint_span(int64 i, const Span *s); +extern bool overright_bigint_spanset(int64 i, const SpanSet *ss); +extern bool overright_float_set(double d, const Set *s); +extern bool overright_float_span(double d, const Span *s); +extern bool overright_float_spanset(double d, const SpanSet *ss); +extern bool overright_int_set(int i, const Set *s); +extern bool overright_int_span(int i, const Span *s); +extern bool overright_int_spanset(int i, const SpanSet *ss); +extern bool overright_set_bigint(const Set *s, int64 i); +extern bool overright_set_float(const Set *s, double d); +extern bool overright_set_int(const Set *s, int i); +extern bool overright_set_set(const Set *s1, const Set *s2); +extern bool overright_set_text(const Set *s, text *txt); +extern bool overright_span_bigint(const Span *s, int64 i); +extern bool overright_span_float(const Span *s, double d); +extern bool overright_span_int(const Span *s, int i); +extern bool overright_span_span(const Span *s1, const Span *s2); +extern bool overright_span_spanset(const Span *s, const SpanSet *ss); +extern bool overright_spanset_bigint(const SpanSet *ss, int64 i); +extern bool overright_spanset_float(const SpanSet *ss, double d); +extern bool overright_spanset_int(const SpanSet *ss, int i); +extern bool overright_spanset_span(const SpanSet *ss, const Span *s); +extern bool overright_spanset_spanset(const SpanSet *ss1, const SpanSet *ss2); +extern bool overright_text_set(const text *txt, const Set *s); +extern bool right_bigint_set(int64 i, const Set *s); +extern bool right_bigint_span(int64 i, const Span *s); +extern bool right_bigint_spanset(int64 i, const SpanSet *ss); +extern bool right_float_set(double d, const Set *s); +extern bool right_float_span(double d, const Span *s); +extern bool right_float_spanset(double d, const SpanSet *ss); +extern bool right_int_set(int i, const Set *s); +extern bool right_int_span(int i, const Span *s); +extern bool right_int_spanset(int i, const SpanSet *ss); +extern bool right_set_bigint(const Set *s, int64 i); +extern bool right_set_float(const Set *s, double d); +extern bool right_set_int(const Set *s, int i); +extern bool right_set_set(const Set *s1, const Set *s2); +extern bool right_set_text(const Set *s, text *txt); +extern bool right_span_bigint(const Span *s, int64 i); +extern bool right_span_float(const Span *s, double d); +extern bool right_span_int(const Span *s, int i); +extern bool right_span_span(const Span *s1, const Span *s2); +extern bool right_span_spanset(const Span *s, const SpanSet *ss); +extern bool right_spanset_bigint(const SpanSet *ss, int64 i); +extern bool right_spanset_float(const SpanSet *ss, double d); +extern bool right_spanset_int(const SpanSet *ss, int i); +extern bool right_spanset_span(const SpanSet *ss, const Span *s); +extern bool right_spanset_spanset(const SpanSet *ss1, const SpanSet *ss2); +extern bool right_text_set(const text *txt, const Set *s); -typedef struct -{ - int32 vl_len_; - uint8 temptype; - uint8 subtype; - int16 flags; - TimestampTz t; - Datum value; - -} TInstant; +extern Set *intersection_bigint_set(int64 i, const Set *s); +extern Set *intersection_date_set(DateADT d, const Set *s); +extern Set *intersection_float_set(double d, const Set *s); +extern Set *intersection_int_set(int i, const Set *s); +extern Set *intersection_set_bigint(const Set *s, int64 i); +extern Set *intersection_set_date(const Set *s, DateADT d); +extern Set *intersection_set_float(const Set *s, double d); +extern Set *intersection_set_int(const Set *s, int i); +extern Set *intersection_set_set(const Set *s1, const Set *s2); +extern Set *intersection_set_text(const Set *s, const text *txt); +extern Set *intersection_set_timestamptz(const Set *s, TimestampTz t); +extern Span *intersection_span_bigint(const Span *s, int64 i); +extern Span *intersection_span_date(const Span *s, DateADT d); +extern Span *intersection_span_float(const Span *s, double d); +extern Span *intersection_span_int(const Span *s, int i); +extern Span *intersection_span_span(const Span *s1, const Span *s2); +extern SpanSet *intersection_span_spanset(const Span *s, const SpanSet *ss); +extern Span *intersection_span_timestamptz(const Span *s, TimestampTz t); +extern SpanSet *intersection_spanset_bigint(const SpanSet *ss, int64 i); +extern SpanSet *intersection_spanset_date(const SpanSet *ss, DateADT d); +extern SpanSet *intersection_spanset_float(const SpanSet *ss, double d); +extern SpanSet *intersection_spanset_int(const SpanSet *ss, int i); +extern SpanSet *intersection_spanset_span(const SpanSet *ss, const Span *s); +extern SpanSet *intersection_spanset_spanset(const SpanSet *ss1, const SpanSet *ss2); +extern SpanSet *intersection_spanset_timestamptz(const SpanSet *ss, TimestampTz t); +extern Set *intersection_text_set(const text *txt, const Set *s); +extern Set *intersection_timestamptz_set(TimestampTz t, const Set *s); +extern Set *minus_bigint_set(int64 i, const Set *s); +extern SpanSet *minus_bigint_span(int64 i, const Span *s); +extern SpanSet *minus_bigint_spanset(int64 i, const SpanSet *ss); +extern Set *minus_date_set(DateADT d, const Set *s); +extern SpanSet *minus_date_span(DateADT d, const Span *s); +extern SpanSet *minus_date_spanset(DateADT d, const SpanSet *ss); +extern Set *minus_float_set(double d, const Set *s); +extern SpanSet *minus_float_span(double d, const Span *s); +extern SpanSet *minus_float_spanset(double d, const SpanSet *ss); +extern Set *minus_int_set(int i, const Set *s); +extern SpanSet *minus_int_span(int i, const Span *s); +extern SpanSet *minus_int_spanset(int i, const SpanSet *ss); +extern Set *minus_set_bigint(const Set *s, int64 i); +extern Set *minus_set_date(const Set *s, DateADT d); +extern Set *minus_set_float(const Set *s, double d); +extern Set *minus_set_int(const Set *s, int i); +extern Set *minus_set_set(const Set *s1, const Set *s2); +extern Set *minus_set_text(const Set *s, const text *txt); +extern Set *minus_set_timestamptz(const Set *s, TimestampTz t); +extern SpanSet *minus_span_bigint(const Span *s, int64 i); +extern SpanSet *minus_span_date(const Span *s, DateADT d); +extern SpanSet *minus_span_float(const Span *s, double d); +extern SpanSet *minus_span_int(const Span *s, int i); +extern SpanSet *minus_span_span(const Span *s1, const Span *s2); +extern SpanSet *minus_span_spanset(const Span *s, const SpanSet *ss); +extern SpanSet *minus_span_timestamptz(const Span *s, TimestampTz t); +extern SpanSet *minus_spanset_bigint(const SpanSet *ss, int64 i); +extern SpanSet *minus_spanset_date(const SpanSet *ss, DateADT d); +extern SpanSet *minus_spanset_float(const SpanSet *ss, double d); +extern SpanSet *minus_spanset_int(const SpanSet *ss, int i); +extern SpanSet *minus_spanset_span(const SpanSet *ss, const Span *s); +extern SpanSet *minus_spanset_spanset(const SpanSet *ss1, const SpanSet *ss2); +extern SpanSet *minus_spanset_timestamptz(const SpanSet *ss, TimestampTz t); +extern Set *minus_text_set(const text *txt, const Set *s); +extern Set *minus_timestamptz_set(TimestampTz t, const Set *s); +extern SpanSet *minus_timestamptz_span(TimestampTz t, const Span *s); +extern SpanSet *minus_timestamptz_spanset(TimestampTz t, const SpanSet *ss); +extern Set *union_bigint_set(int64 i, const Set *s); +extern SpanSet *union_bigint_span(const Span *s, int64 i); +extern SpanSet *union_bigint_spanset(int64 i, SpanSet *ss); +extern Set *union_date_set(DateADT d, const Set *s); +extern SpanSet *union_date_span(const Span *s, DateADT d); +extern SpanSet *union_date_spanset(DateADT d, SpanSet *ss); +extern Set *union_float_set(double d, const Set *s); +extern SpanSet *union_float_span(const Span *s, double d); +extern SpanSet *union_float_spanset(double d, SpanSet *ss); +extern Set *union_int_set(int i, const Set *s); +extern SpanSet *union_int_span(int i, const Span *s); +extern SpanSet *union_int_spanset(int i, SpanSet *ss); +extern Set *union_set_bigint(const Set *s, int64 i); +extern Set *union_set_date(const Set *s, DateADT d); +extern Set *union_set_float(const Set *s, double d); +extern Set *union_set_int(const Set *s, int i); +extern Set *union_set_set(const Set *s1, const Set *s2); +extern Set *union_set_text(const Set *s, const text *txt); +extern Set *union_set_timestamptz(const Set *s, TimestampTz t); +extern SpanSet *union_span_bigint(const Span *s, int64 i); +extern SpanSet *union_span_date(const Span *s, DateADT d); +extern SpanSet *union_span_float(const Span *s, double d); +extern SpanSet *union_span_int(const Span *s, int i); +extern SpanSet *union_span_span(const Span *s1, const Span *s2); +extern SpanSet *union_span_spanset(const Span *s, const SpanSet *ss); +extern SpanSet *union_span_timestamptz(const Span *s, TimestampTz t); +extern SpanSet *union_spanset_bigint(const SpanSet *ss, int64 i); +extern SpanSet *union_spanset_date(const SpanSet *ss, DateADT d); +extern SpanSet *union_spanset_float(const SpanSet *ss, double d); +extern SpanSet *union_spanset_int(const SpanSet *ss, int i); +extern SpanSet *union_spanset_span(const SpanSet *ss, const Span *s); +extern SpanSet *union_spanset_spanset(const SpanSet *ss1, const SpanSet *ss2); +extern SpanSet *union_spanset_timestamptz(const SpanSet *ss, TimestampTz t); +extern Set *union_text_set(const text *txt, const Set *s); +extern Set *union_timestamptz_set(TimestampTz t, const Set *s); +extern SpanSet *union_timestamptz_span(TimestampTz t, const Span *s); +extern SpanSet *union_timestamptz_spanset(TimestampTz t, SpanSet *ss); -typedef struct -{ - int32 vl_len_; - uint8 temptype; - uint8 subtype; - int16 flags; - int32 count; - int32 maxcount; - int16 bboxsize; - char padding[6]; - Span period; - -} TSequence; +extern int64 distance_bigintset_bigintset(const Set *s1, const Set *s2); +extern int64 distance_bigintspan_bigintspan(const Span *s1, const Span *s2); +extern int64 distance_bigintspanset_bigintspan(const SpanSet *ss, const Span *s); +extern int64 distance_bigintspanset_bigintspanset(const SpanSet *ss1, const SpanSet *ss2); +extern int distance_dateset_dateset(const Set *s1, const Set *s2); +extern int distance_datespan_datespan(const Span *s1, const Span *s2); +extern int distance_datespanset_datespan(const SpanSet *ss, const Span *s); +extern int distance_datespanset_datespanset(const SpanSet *ss1, const SpanSet *ss2); +extern double distance_floatset_floatset(const Set *s1, const Set *s2); +extern double distance_floatspan_floatspan(const Span *s1, const Span *s2); +extern double distance_floatspanset_floatspan(const SpanSet *ss, const Span *s); +extern double distance_floatspanset_floatspanset(const SpanSet *ss1, const SpanSet *ss2); +extern int distance_intset_intset(const Set *s1, const Set *s2); +extern int distance_intspan_intspan(const Span *s1, const Span *s2); +extern int distance_intspanset_intspan(const SpanSet *ss, const Span *s); +extern int distance_intspanset_intspanset(const SpanSet *ss1, const SpanSet *ss2); +extern int64 distance_set_bigint(const Set *s, int64 i); +extern int distance_set_date(const Set *s, DateADT d); +extern double distance_set_float(const Set *s, double d); +extern int distance_set_int(const Set *s, int i); +extern double distance_set_timestamptz(const Set *s, TimestampTz t); +extern int64 distance_span_bigint(const Span *s, int64 i); +extern int distance_span_date(const Span *s, DateADT d); +extern double distance_span_float(const Span *s, double d); +extern int distance_span_int(const Span *s, int i); +extern double distance_span_timestamptz(const Span *s, TimestampTz t); +extern int64 distance_spanset_bigint(const SpanSet *ss, int64 i); +extern int distance_spanset_date(const SpanSet *ss, DateADT d); +extern double distance_spanset_float(const SpanSet *ss, double d); +extern int distance_spanset_int(const SpanSet *ss, int i); +extern double distance_spanset_timestamptz(const SpanSet *ss, TimestampTz t); +extern double distance_tstzset_tstzset(const Set *s1, const Set *s2); +extern double distance_tstzspan_tstzspan(const Span *s1, const Span *s2); +extern double distance_tstzspanset_tstzspan(const SpanSet *ss, const Span *s); +extern double distance_tstzspanset_tstzspanset(const SpanSet *ss1, const SpanSet *ss2); -typedef struct -{ - int32 vl_len_; - uint8 temptype; - uint8 subtype; - int16 flags; - int32 count; - int32 totalcount; - int32 maxcount; - int16 bboxsize; - int16 padding; - Span period; - -} TSequenceSet; +extern Span *bigint_extent_transfn(Span *state, int64 i); +extern Set *bigint_union_transfn(Set *state, int64 i); +extern Span *date_extent_transfn(Span *state, DateADT d); +extern Set *date_union_transfn(Set *state, DateADT d); +extern Span *float_extent_transfn(Span *state, double d); +extern Set *float_union_transfn(Set *state, double d); +extern Span *int_extent_transfn(Span *state, int i); +extern Set *int_union_transfn(Set *state, int32 i); +extern Span *set_extent_transfn(Span *state, const Set *s); +extern Set *set_union_finalfn(Set *state); +extern Set *set_union_transfn(Set *state, Set *s); +extern Span *span_extent_transfn(Span *state, const Span *s); +extern SpanSet *span_union_transfn(SpanSet *state, const Span *s); +extern Span *spanset_extent_transfn(Span *state, const SpanSet *ss); +extern SpanSet *spanset_union_finalfn(SpanSet *state); +extern SpanSet *spanset_union_transfn(SpanSet *state, const SpanSet *ss); +extern Set *text_union_transfn(Set *state, const text *txt); +extern Span *timestamptz_extent_transfn(Span *state, TimestampTz t); +extern Set *timestamptz_union_transfn(Set *state, TimestampTz t); -typedef struct -{ - int i; - int j; -} Match; +extern int64 bigint_get_bin(int64 value, int64 vsize, int64 vorigin); +extern Span *bigintspan_bins(const Span *s, int64 vsize, int64 vorigin, int *count); +extern Span *bigintspanset_bins(const SpanSet *ss, int64 vsize, int64 vorigin, int *count); +extern DateADT date_get_bin(DateADT d, const Interval *duration, DateADT torigin); +extern Span *datespan_bins(const Span *s, const Interval *duration, DateADT torigin, int *count); +extern Span *datespanset_bins(const SpanSet *ss, const Interval *duration, DateADT torigin, int *count); +extern double float_get_bin(double value, double vsize, double vorigin); +extern Span *floatspan_bins(const Span *s, double vsize, double vorigin, int *count); +extern Span *floatspanset_bins(const SpanSet *ss, double vsize, double vorigin, int *count); +extern int int_get_bin(int value, int vsize, int vorigin); +extern Span *intspan_bins(const Span *s, int vsize, int vorigin, int *count); +extern Span *intspanset_bins(const SpanSet *ss, int vsize, int vorigin, int *count); +extern TimestampTz timestamptz_get_bin(TimestampTz t, const Interval *duration, TimestampTz torigin); +extern Span *tstzspan_bins(const Span *s, const Interval *duration, TimestampTz origin, int *count); +extern Span *tstzspanset_bins(const SpanSet *ss, const Interval *duration, TimestampTz torigin, int *count); -#define SKIPLIST_MAXLEVEL 32 -typedef struct -{ - void *value; - int height; - int next[SKIPLIST_MAXLEVEL]; -} SkipListElem; +extern char *tbox_as_hexwkb(const TBox *box, uint8_t variant, size_t *size); +extern uint8_t *tbox_as_wkb(const TBox *box, uint8_t variant, size_t *size_out); +extern TBox *tbox_from_hexwkb(const char *hexwkb); +extern TBox *tbox_from_wkb(const uint8_t *wkb, size_t size); +extern TBox *tbox_in(const char *str); +extern char *tbox_out(const TBox *box, int maxdd); -typedef struct -{ - int capacity; - int next; - int length; - int *freed; - int freecount; - int freecap; - int tail; - void *extra; - size_t extrasize; - SkipListElem *elems; -} SkipList; +extern TBox *float_timestamptz_to_tbox(double d, TimestampTz t); +extern TBox *float_tstzspan_to_tbox(double d, const Span *s); +extern TBox *int_timestamptz_to_tbox(int i, TimestampTz t); +extern TBox *int_tstzspan_to_tbox(int i, const Span *s); +extern TBox *numspan_tstzspan_to_tbox(const Span *span, const Span *s); +extern TBox *numspan_timestamptz_to_tbox(const Span *span, TimestampTz t); +extern TBox *tbox_copy(const TBox *box); +extern TBox *tbox_make(const Span *s, const Span *p); -typedef struct RTree RTree; +extern TBox *float_to_tbox(double d); +extern TBox *int_to_tbox(int i); +extern TBox *set_to_tbox(const Set *s); +extern TBox *span_to_tbox(const Span *s); +extern TBox *spanset_to_tbox(const SpanSet *ss); +extern Span *tbox_to_intspan(const TBox *box); +extern Span *tbox_to_floatspan(const TBox *box); +extern Span *tbox_to_tstzspan(const TBox *box); +extern TBox *timestamptz_to_tbox(TimestampTz t); -typedef enum -{ - MEOS_SUCCESS = 0, - - MEOS_ERR_INTERNAL_ERROR = 1, - MEOS_ERR_INTERNAL_TYPE_ERROR = 2, - MEOS_ERR_VALUE_OUT_OF_RANGE = 3, - MEOS_ERR_DIVISION_BY_ZERO = 4, - MEOS_ERR_MEMORY_ALLOC_ERROR = 5, - MEOS_ERR_AGGREGATION_ERROR = 6, - MEOS_ERR_DIRECTORY_ERROR = 7, - MEOS_ERR_FILE_ERROR = 8, - - MEOS_ERR_INVALID_ARG = 10, - MEOS_ERR_INVALID_ARG_TYPE = 11, - MEOS_ERR_INVALID_ARG_VALUE = 12, - - MEOS_ERR_MFJSON_INPUT = 20, - MEOS_ERR_MFJSON_OUTPUT = 21, - MEOS_ERR_TEXT_INPUT = 22, - MEOS_ERR_TEXT_OUTPUT = 23, - MEOS_ERR_WKB_INPUT = 24, - MEOS_ERR_WKB_OUTPUT = 25, - MEOS_ERR_GEOJSON_INPUT = 26, - MEOS_ERR_GEOJSON_OUTPUT = 27, +extern bool tbox_hast(const TBox *box); +extern bool tbox_hasx(const TBox *box); +extern bool tbox_tmax(const TBox *box, TimestampTz *result); +extern bool tbox_tmax_inc(const TBox *box, bool *result); +extern bool tbox_tmin(const TBox *box, TimestampTz *result); +extern bool tbox_tmin_inc(const TBox *box, bool *result); +extern bool tbox_xmax(const TBox *box, double *result); +extern bool tbox_xmax_inc(const TBox *box, bool *result); +extern bool tbox_xmin(const TBox *box, double *result); +extern bool tbox_xmin_inc(const TBox *box, bool *result); +extern bool tboxfloat_xmax(const TBox *box, double *result); +extern bool tboxfloat_xmin(const TBox *box, double *result); +extern bool tboxint_xmax(const TBox *box, int *result); +extern bool tboxint_xmin(const TBox *box, int *result); -} errorCode; +extern TBox *tbox_expand_float(const TBox *box, double d); +extern TBox *tbox_expand_int(const TBox *box, int i); +extern TBox *tbox_expand_time(const TBox *box, const Interval *interv); +extern TBox *tbox_round(const TBox *box, int maxdd); +extern TBox *tbox_shift_scale_float(const TBox *box, double shift, double width, bool hasshift, bool haswidth); +extern TBox *tbox_shift_scale_int(const TBox *box, int shift, int width, bool hasshift, bool haswidth); +extern TBox *tbox_shift_scale_time(const TBox *box, const Interval *shift, const Interval *duration); -extern void meos_error(int errlevel, int errcode, const char *format, ...); +extern TBox *union_tbox_tbox(const TBox *box1, const TBox *box2, bool strict); +extern TBox *intersection_tbox_tbox(const TBox *box1, const TBox *box2); -extern int meos_errno(void); -extern int meos_errno_set(int err); -extern int meos_errno_restore(int err); -extern int meos_errno_reset(void); +extern bool adjacent_tbox_tbox(const TBox *box1, const TBox *box2); +extern bool contained_tbox_tbox(const TBox *box1, const TBox *box2); +extern bool contains_tbox_tbox(const TBox *box1, const TBox *box2); +extern bool overlaps_tbox_tbox(const TBox *box1, const TBox *box2); +extern bool same_tbox_tbox(const TBox *box1, const TBox *box2); -typedef void (*error_handler_fn)(int, int, const char *); +extern bool after_tbox_tbox(const TBox *box1, const TBox *box2); +extern bool before_tbox_tbox(const TBox *box1, const TBox *box2); +extern bool left_tbox_tbox(const TBox *box1, const TBox *box2); +extern bool overafter_tbox_tbox(const TBox *box1, const TBox *box2); +extern bool overbefore_tbox_tbox(const TBox *box1, const TBox *box2); +extern bool overleft_tbox_tbox(const TBox *box1, const TBox *box2); +extern bool overright_tbox_tbox(const TBox *box1, const TBox *box2); +extern bool right_tbox_tbox(const TBox *box1, const TBox *box2); -extern void meos_initialize_timezone(const char *name); -extern void meos_initialize_error_handler(error_handler_fn err_handler); -extern void meos_finalize_timezone(void); +extern int tbox_cmp(const TBox *box1, const TBox *box2); +extern bool tbox_eq(const TBox *box1, const TBox *box2); +extern bool tbox_ge(const TBox *box1, const TBox *box2); +extern bool tbox_gt(const TBox *box1, const TBox *box2); +extern bool tbox_le(const TBox *box1, const TBox *box2); +extern bool tbox_lt(const TBox *box1, const TBox *box2); +extern bool tbox_ne(const TBox *box1, const TBox *box2); -extern bool meos_set_datestyle(const char *newval, void *extra); -extern bool meos_set_intervalstyle(const char *newval, int extra); -extern char *meos_get_datestyle(void); -extern char *meos_get_intervalstyle(void); +extern Temporal *tbool_from_mfjson(const char *str); +extern Temporal *tbool_in(const char *str); +extern char *tbool_out(const Temporal *temp); +extern char *temporal_as_hexwkb(const Temporal *temp, uint8_t variant, size_t *size_out); +extern char *temporal_as_mfjson(const Temporal *temp, bool with_bbox, int flags, int precision, const char *srs); +extern uint8_t *temporal_as_wkb(const Temporal *temp, uint8_t variant, size_t *size_out); +extern Temporal *temporal_from_hexwkb(const char *hexwkb); +extern Temporal *temporal_from_wkb(const uint8_t *wkb, size_t size); +extern Temporal *tfloat_from_mfjson(const char *str); +extern Temporal *tfloat_in(const char *str); +extern char *tfloat_out(const Temporal *temp, int maxdd); +extern Temporal *tint_from_mfjson(const char *str); +extern Temporal *tint_in(const char *str); +extern char *tint_out(const Temporal *temp); +extern Temporal *ttext_from_mfjson(const char *str); +extern Temporal *ttext_in(const char *str); +extern char *ttext_out(const Temporal *temp); -extern void meos_initialize(void); -extern void meos_finalize(void); +extern Temporal *tbool_from_base_temp(bool b, const Temporal *temp); +extern TInstant *tboolinst_make(bool b, TimestampTz t); +extern TSequence *tboolseq_from_base_tstzset(bool b, const Set *s); +extern TSequence *tboolseq_from_base_tstzspan(bool b, const Span *s); +extern TSequenceSet *tboolseqset_from_base_tstzspanset(bool b, const SpanSet *ss); +extern Temporal *temporal_copy(const Temporal *temp); +extern Temporal *tfloat_from_base_temp(double d, const Temporal *temp); +extern TInstant *tfloatinst_make(double d, TimestampTz t); +extern TSequence *tfloatseq_from_base_tstzset(double d, const Set *s); +extern TSequence *tfloatseq_from_base_tstzspan(double d, const Span *s, interpType interp); +extern TSequenceSet *tfloatseqset_from_base_tstzspanset(double d, const SpanSet *ss, interpType interp); +extern Temporal *tint_from_base_temp(int i, const Temporal *temp); +extern TInstant *tintinst_make(int i, TimestampTz t); +extern TSequence *tintseq_from_base_tstzset(int i, const Set *s); +extern TSequence *tintseq_from_base_tstzspan(int i, const Span *s); +extern TSequenceSet *tintseqset_from_base_tstzspanset(int i, const SpanSet *ss); +extern TSequence *tsequence_make(const TInstant **instants, int count, bool lower_inc, bool upper_inc, interpType interp, bool normalize); +extern TSequenceSet *tsequenceset_make(const TSequence **sequences, int count, bool normalize); +extern TSequenceSet *tsequenceset_make_gaps(const TInstant **instants, int count, interpType interp, const Interval *maxt, double maxdist); +extern Temporal *ttext_from_base_temp(const text *txt, const Temporal *temp); +extern TInstant *ttextinst_make(const text *txt, TimestampTz t); +extern TSequence *ttextseq_from_base_tstzset(const text *txt, const Set *s); +extern TSequence *ttextseq_from_base_tstzspan(const text *txt, const Span *s); +extern TSequenceSet *ttextseqset_from_base_tstzspanset(const text *txt, const SpanSet *ss); -extern DateADT add_date_int(DateADT d, int32 days); -extern Interval *add_interval_interval(const Interval *interv1, const Interval *interv2); -extern TimestampTz add_timestamptz_interval(TimestampTz t, const Interval *interv); -extern bool bool_in(const char *str); -extern char *bool_out(bool b); -extern text *cstring2text(const char *str); -extern Timestamp date_to_timestamp(DateADT dateVal); -extern TimestampTz date_to_timestamptz(DateADT d); -extern Interval *minus_date_date(DateADT d1, DateADT d2); -extern DateADT minus_date_int(DateADT d, int32 days); -extern TimestampTz minus_timestamptz_interval(TimestampTz t, const Interval *interv); -extern Interval *minus_timestamptz_timestamptz(TimestampTz t1, TimestampTz t2); -extern Interval *mult_interval_double(const Interval *interv, double factor); +extern Temporal *tbool_to_tint(const Temporal *temp); +extern Span *temporal_to_tstzspan(const Temporal *temp); +extern Temporal *tfloat_to_tint(const Temporal *temp); +extern Temporal *tint_to_tfloat(const Temporal *temp); +extern Span *tnumber_to_span(const Temporal *temp); +extern TBox *tnumber_to_tbox (const Temporal *temp); -extern char *text2cstring(const text *txt); -extern int text_cmp(const text *txt1, const text *txt2); -extern text *text_copy(const text *txt); -extern text *text_initcap(const text *txt); -extern text *text_lower(const text *txt); -extern char *text_out(const text *txt); -extern text *text_upper(const text *txt); -extern text *textcat_text_text(const text *txt1, const text *txt2); -extern DateADT timestamp_to_date(Timestamp t); -extern DateADT timestamptz_to_date(TimestampTz t); +extern bool tbool_end_value(const Temporal *temp); +extern bool tbool_start_value(const Temporal *temp); +extern bool tbool_value_at_timestamptz(const Temporal *temp, TimestampTz t, bool strict, bool *value); +extern bool tbool_value_n(const Temporal *temp, int n, bool *result); +extern bool *tbool_values(const Temporal *temp, int *count); +extern Interval *temporal_duration(const Temporal *temp, bool boundspan); +extern TInstant *temporal_end_instant(const Temporal *temp); +extern TSequence *temporal_end_sequence(const Temporal *temp); +extern TimestampTz temporal_end_timestamptz(const Temporal *temp); +extern uint32 temporal_hash(const Temporal *temp); +extern TInstant *temporal_instant_n(const Temporal *temp, int n); +extern TInstant **temporal_instants(const Temporal *temp, int *count); +extern const char *temporal_interp(const Temporal *temp); +extern bool temporal_lower_inc(const Temporal *temp); +extern TInstant *temporal_max_instant(const Temporal *temp); +extern TInstant *temporal_min_instant(const Temporal *temp); +extern int temporal_num_instants(const Temporal *temp); +extern int temporal_num_sequences(const Temporal *temp); +extern int temporal_num_timestamps(const Temporal *temp); +extern TSequence **temporal_segments(const Temporal *temp, int *count); +extern TSequence *temporal_sequence_n(const Temporal *temp, int i); +extern TSequence **temporal_sequences(const Temporal *temp, int *count); +extern TInstant *temporal_start_instant(const Temporal *temp); +extern TSequence *temporal_start_sequence(const Temporal *temp); +extern TimestampTz temporal_start_timestamptz(const Temporal *temp); +extern TSequenceSet *temporal_stops(const Temporal *temp, double maxdist, const Interval *minduration); +extern const char *temporal_subtype(const Temporal *temp); +extern SpanSet *temporal_time(const Temporal *temp); +extern TimestampTz *temporal_timestamps(const Temporal *temp, int *count); +extern bool temporal_timestamptz_n(const Temporal *temp, int n, TimestampTz *result); +extern bool temporal_upper_inc(const Temporal *temp); +extern double tfloat_end_value(const Temporal *temp); +extern double tfloat_max_value(const Temporal *temp); +extern double tfloat_min_value(const Temporal *temp); +extern double tfloat_start_value(const Temporal *temp); +extern bool tfloat_value_at_timestamptz(const Temporal *temp, TimestampTz t, bool strict, double *value); +extern bool tfloat_value_n(const Temporal *temp, int n, double *result); +extern double *tfloat_values(const Temporal *temp, int *count); +extern int tint_end_value(const Temporal *temp); +extern int tint_max_value(const Temporal *temp); +extern int tint_min_value(const Temporal *temp); +extern int tint_start_value(const Temporal *temp); +extern bool tint_value_at_timestamptz(const Temporal *temp, TimestampTz t, bool strict, int *value); +extern bool tint_value_n(const Temporal *temp, int n, int *result); +extern int *tint_values(const Temporal *temp, int *count); +extern double tnumber_integral(const Temporal *temp); +extern double tnumber_twavg(const Temporal *temp); +extern SpanSet *tnumber_valuespans(const Temporal *temp); +extern text *ttext_end_value(const Temporal *temp); +extern text *ttext_max_value(const Temporal *temp); +extern text *ttext_min_value(const Temporal *temp); +extern text *ttext_start_value(const Temporal *temp); +extern bool ttext_value_at_timestamptz(const Temporal *temp, TimestampTz t, bool strict, text **value); +extern bool ttext_value_n(const Temporal *temp, int n, text **result); +extern text **ttext_values(const Temporal *temp, int *count); -extern Set *bigintset_in(const char *str); -extern char *bigintset_out(const Set *set); -extern Span *bigintspan_in(const char *str); -extern char *bigintspan_out(const Span *s); -extern SpanSet *bigintspanset_in(const char *str); -extern char *bigintspanset_out(const SpanSet *ss); -extern Set *dateset_in(const char *str); -extern char *dateset_out(const Set *s); -extern Span *datespan_in(const char *str); -extern char *datespan_out(const Span *s); -extern SpanSet *datespanset_in(const char *str); -extern char *datespanset_out(const SpanSet *ss); -extern Set *floatset_in(const char *str); -extern char *floatset_out(const Set *set, int maxdd); -extern Span *floatspan_in(const char *str); -extern char *floatspan_out(const Span *s, int maxdd); -extern SpanSet *floatspanset_in(const char *str); -extern char *floatspanset_out(const SpanSet *ss, int maxdd); -extern Set *geogset_in(const char *str); -extern Set *geomset_in(const char *str); -extern char *geoset_as_ewkt(const Set *set, int maxdd); -extern char *geoset_as_text(const Set *set, int maxdd); -extern char *geoset_out(const Set *set, int maxdd); -extern Set *intset_in(const char *str); -extern char *intset_out(const Set *set); -extern Span *intspan_in(const char *str); -extern char *intspan_out(const Span *s); -extern SpanSet *intspanset_in(const char *str); -extern char *intspanset_out(const SpanSet *ss); -extern char *set_as_hexwkb(const Set *s, uint8_t variant, size_t *size_out); -extern uint8_t *set_as_wkb(const Set *s, uint8_t variant, size_t *size_out); -extern Set *set_from_hexwkb(const char *hexwkb); -extern Set *set_from_wkb(const uint8_t *wkb, size_t size); -extern char *span_as_hexwkb(const Span *s, uint8_t variant, size_t *size_out); -extern uint8_t *span_as_wkb(const Span *s, uint8_t variant, size_t *size_out); -extern Span *span_from_hexwkb(const char *hexwkb); -extern Span *span_from_wkb(const uint8_t *wkb, size_t size); -extern char *spanset_as_hexwkb(const SpanSet *ss, uint8_t variant, size_t *size_out); -extern uint8_t *spanset_as_wkb(const SpanSet *ss, uint8_t variant, size_t *size_out); -extern SpanSet *spanset_from_hexwkb(const char *hexwkb); -extern SpanSet *spanset_from_wkb(const uint8_t *wkb, size_t size); -extern Set *textset_in(const char *str); -extern char *textset_out(const Set *set); -extern Set *tstzset_in(const char *str); -extern char *tstzset_out(const Set *set); -extern Span *tstzspan_in(const char *str); -extern char *tstzspan_out(const Span *s); -extern SpanSet *tstzspanset_in(const char *str); -extern char *tstzspanset_out(const SpanSet *ss); +extern double float_degrees(double value, bool normalize); +extern Temporal **temparr_round(const Temporal **temp, int count, int maxdd); +extern Temporal *temporal_round(const Temporal *temp, int maxdd); +extern Temporal *temporal_scale_time(const Temporal *temp, const Interval *duration); +extern Temporal *temporal_set_interp(const Temporal *temp, interpType interp); +extern Temporal *temporal_shift_scale_time(const Temporal *temp, const Interval *shift, const Interval *duration); +extern Temporal *temporal_shift_time(const Temporal *temp, const Interval *shift); +extern TInstant *temporal_to_tinstant(const Temporal *temp); +extern TSequence *temporal_to_tsequence(const Temporal *temp, interpType interp); +extern TSequenceSet *temporal_to_tsequenceset(const Temporal *temp, interpType interp); +extern Temporal *tfloat_ceil(const Temporal *temp); +extern Temporal *tfloat_degrees(const Temporal *temp, bool normalize); +extern Temporal *tfloat_floor(const Temporal *temp); +extern Temporal *tfloat_radians(const Temporal *temp); +extern Temporal *tfloat_scale_value(const Temporal *temp, double width); +extern Temporal *tfloat_shift_scale_value(const Temporal *temp, double shift, double width); +extern Temporal *tfloat_shift_value(const Temporal *temp, double shift); +extern Temporal *tint_scale_value(const Temporal *temp, int width); +extern Temporal *tint_shift_scale_value(const Temporal *temp, int shift, int width); +extern Temporal *tint_shift_value(const Temporal *temp, int shift); -extern Set *bigintset_make(const int64 *values, int count); -extern Span *bigintspan_make(int64 lower, int64 upper, bool lower_inc, bool upper_inc); -extern Set *dateset_make(const DateADT *values, int count); -extern Span *datespan_make(DateADT lower, DateADT upper, bool lower_inc, bool upper_inc); -extern Set *floatset_make(const double *values, int count); -extern Span *floatspan_make(double lower, double upper, bool lower_inc, bool upper_inc); -extern Set *geoset_make(const GSERIALIZED **values, int count); -extern Set *intset_make(const int *values, int count); -extern Span *intspan_make(int lower, int upper, bool lower_inc, bool upper_inc); -extern Set *set_copy(const Set *s); -extern Span *span_copy(const Span *s); -extern SpanSet *spanset_copy(const SpanSet *ss); -extern SpanSet *spanset_make(Span *spans, int count, bool normalize, bool order); -extern Set *textset_make(const text **values, int count); -extern Set *tstzset_make(const TimestampTz *values, int count); -extern Span *tstzspan_make(TimestampTz lower, TimestampTz upper, bool lower_inc, bool upper_inc); +extern Temporal *temporal_append_tinstant(Temporal *temp, const TInstant *inst, interpType interp, double maxdist, const Interval *maxt, bool expand); +extern Temporal *temporal_append_tsequence(Temporal *temp, const TSequence *seq, bool expand); +extern Temporal *temporal_delete_timestamptz(const Temporal *temp, TimestampTz t, bool connect); +extern Temporal *temporal_delete_tstzset(const Temporal *temp, const Set *s, bool connect); +extern Temporal *temporal_delete_tstzspan(const Temporal *temp, const Span *s, bool connect); +extern Temporal *temporal_delete_tstzspanset(const Temporal *temp, const SpanSet *ss, bool connect); +extern Temporal *temporal_insert(const Temporal *temp1, const Temporal *temp2, bool connect); +extern Temporal *temporal_merge(const Temporal *temp1, const Temporal *temp2); +extern Temporal *temporal_merge_array(const Temporal **temparr, int count); +extern Temporal *temporal_update(const Temporal *temp1, const Temporal *temp2, bool connect); -extern Set *bigint_to_set(int64 i); -extern Span *bigint_to_span(int i); -extern SpanSet *bigint_to_spanset(int i); -extern Set *date_to_set(DateADT d); -extern Span *date_to_span(DateADT d); -extern SpanSet *date_to_spanset(DateADT d); -extern Set *dateset_to_tstzset(const Set *s); -extern Span *datespan_to_tstzspan(const Span *s); -extern SpanSet *datespanset_to_tstzspanset(const SpanSet *ss); -extern Set *float_to_set(double d); -extern Span *float_to_span(double d); -extern SpanSet *float_to_spanset(double d); -extern Set *floatset_to_intset(const Set *s); -extern Span *floatspan_to_intspan(const Span *s); -extern SpanSet *floatspanset_to_intspanset(const SpanSet *ss); -extern Set *geo_to_set(GSERIALIZED *gs); -extern Set *int_to_set(int i); -extern Span *int_to_span(int i); -extern SpanSet *int_to_spanset(int i); -extern Set *intset_to_floatset(const Set *s); -extern Span *intspan_to_floatspan(const Span *s); -extern SpanSet *intspanset_to_floatspanset(const SpanSet *ss); -extern SpanSet *set_to_spanset(const Set *s); -extern SpanSet *span_to_spanset(const Span *s); -extern Set *text_to_set(text *txt); -extern Set *timestamptz_to_set(TimestampTz t); -extern Span *timestamptz_to_span(TimestampTz t); -extern SpanSet *timestamptz_to_spanset(TimestampTz t); -extern Set *tstzset_to_dateset(const Set *s); -extern Span *tstzspan_to_datespan(const Span *s); -extern SpanSet *tstzspanset_to_datespanset(const SpanSet *ss); +extern Temporal *tbool_at_value(const Temporal *temp, bool b); +extern Temporal *tbool_minus_value(const Temporal *temp, bool b); +extern Temporal *temporal_at_max(const Temporal *temp); +extern Temporal *temporal_at_min(const Temporal *temp); +extern Temporal *temporal_at_timestamptz(const Temporal *temp, TimestampTz t); +extern Temporal *temporal_at_tstzset(const Temporal *temp, const Set *s); +extern Temporal *temporal_at_tstzspan(const Temporal *temp, const Span *s); +extern Temporal *temporal_at_tstzspanset(const Temporal *temp, const SpanSet *ss); +extern Temporal *temporal_at_values(const Temporal *temp, const Set *set); +extern Temporal *temporal_minus_max(const Temporal *temp); +extern Temporal *temporal_minus_min(const Temporal *temp); +extern Temporal *temporal_minus_timestamptz(const Temporal *temp, TimestampTz t); +extern Temporal *temporal_minus_tstzset(const Temporal *temp, const Set *s); +extern Temporal *temporal_minus_tstzspan(const Temporal *temp, const Span *s); +extern Temporal *temporal_minus_tstzspanset(const Temporal *temp, const SpanSet *ss); +extern Temporal *temporal_minus_values(const Temporal *temp, const Set *set); +extern Temporal *tfloat_at_value(const Temporal *temp, double d); +extern Temporal *tfloat_minus_value(const Temporal *temp, double d); +extern Temporal *tint_at_value(const Temporal *temp, int i); +extern Temporal *tint_minus_value(const Temporal *temp, int i); +extern Temporal *tnumber_at_span(const Temporal *temp, const Span *span); +extern Temporal *tnumber_at_spanset(const Temporal *temp, const SpanSet *ss); +extern Temporal *tnumber_at_tbox(const Temporal *temp, const TBox *box); +extern Temporal *tnumber_minus_span(const Temporal *temp, const Span *span); +extern Temporal *tnumber_minus_spanset(const Temporal *temp, const SpanSet *ss); +extern Temporal *tnumber_minus_tbox(const Temporal *temp, const TBox *box); +extern Temporal *ttext_at_value(const Temporal *temp, text *txt); +extern Temporal *ttext_minus_value(const Temporal *temp, text *txt); -extern int64 bigintset_end_value(const Set *s); -extern int64 bigintset_start_value(const Set *s); -extern bool bigintset_value_n(const Set *s, int n, int64 *result); -extern int64 *bigintset_values(const Set *s); -extern int64 bigintspan_lower(const Span *s); -extern int64 bigintspan_upper(const Span *s); -extern int64 bigintspan_width(const Span *s); -extern int64 bigintspanset_lower(const SpanSet *ss); -extern int64 bigintspanset_upper(const SpanSet *ss); -extern int64 bigintspanset_width(const SpanSet *ss, bool boundspan); -extern DateADT dateset_end_value(const Set *s); -extern DateADT dateset_start_value(const Set *s); -extern bool dateset_value_n(const Set *s, int n, DateADT *result); -extern DateADT *dateset_values(const Set *s); -extern Interval *datespan_duration(const Span *s); -extern DateADT datespan_lower(const Span *s); -extern DateADT datespan_upper(const Span *s); -extern bool datespanset_date_n(const SpanSet *ss, int n, DateADT *result); -extern Set *datespanset_dates(const SpanSet *ss); -extern Interval *datespanset_duration(const SpanSet *ss, bool boundspan); -extern DateADT datespanset_end_date(const SpanSet *ss); -extern int datespanset_num_dates(const SpanSet *ss); -extern DateADT datespanset_start_date(const SpanSet *ss); -extern double floatset_end_value(const Set *s); -extern double floatset_start_value(const Set *s); -extern bool floatset_value_n(const Set *s, int n, double *result); -extern double *floatset_values(const Set *s); -extern double floatspan_lower(const Span *s); -extern double floatspan_upper(const Span *s); -extern double floatspan_width(const Span *s); -extern double floatspanset_lower(const SpanSet *ss); -extern double floatspanset_upper(const SpanSet *ss); -extern double floatspanset_width(const SpanSet *ss, bool boundspan); -extern GSERIALIZED *geoset_end_value(const Set *s); -extern int32_t geoset_srid(const Set *s); -extern GSERIALIZED *geoset_start_value(const Set *s); -extern bool geoset_value_n(const Set *s, int n, GSERIALIZED **result); -extern GSERIALIZED **geoset_values(const Set *s); -extern int intset_end_value(const Set *s); -extern int intset_start_value(const Set *s); -extern bool intset_value_n(const Set *s, int n, int *result); -extern int *intset_values(const Set *s); -extern int intspan_lower(const Span *s); -extern int intspan_upper(const Span *s); -extern int intspan_width(const Span *s); -extern int intspanset_lower(const SpanSet *ss); -extern int intspanset_upper(const SpanSet *ss); -extern int intspanset_width(const SpanSet *ss, bool boundspan); -extern uint32 set_hash(const Set *s); -extern uint64 set_hash_extended(const Set *s, uint64 seed); -extern int set_num_values(const Set *s); -extern Span *set_to_span(const Set *s); -extern uint32 span_hash(const Span *s); -extern uint64 span_hash_extended(const Span *s, uint64 seed); -extern bool span_lower_inc(const Span *s); -extern bool span_upper_inc(const Span *s); -extern Span *spanset_end_span(const SpanSet *ss); -extern uint32 spanset_hash(const SpanSet *ss); -extern uint64 spanset_hash_extended(const SpanSet *ss, uint64 seed); -extern bool spanset_lower_inc(const SpanSet *ss); -extern int spanset_num_spans(const SpanSet *ss); -extern Span *spanset_span(const SpanSet *ss); -extern Span *spanset_span_n(const SpanSet *ss, int i); -extern Span **spanset_spanarr(const SpanSet *ss); -extern Span *spanset_start_span(const SpanSet *ss); -extern bool spanset_upper_inc(const SpanSet *ss); -extern text *textset_end_value(const Set *s); -extern text *textset_start_value(const Set *s); -extern bool textset_value_n(const Set *s, int n, text **result); -extern text **textset_values(const Set *s); -extern TimestampTz tstzset_end_value(const Set *s); -extern TimestampTz tstzset_start_value(const Set *s); -extern bool tstzset_value_n(const Set *s, int n, TimestampTz *result); -extern TimestampTz *tstzset_values(const Set *s); -extern Interval *tstzspan_duration(const Span *s); -extern TimestampTz tstzspan_lower(const Span *s); -extern TimestampTz tstzspan_upper(const Span *s); -extern Interval *tstzspanset_duration(const SpanSet *ss, bool boundspan); -extern TimestampTz tstzspanset_end_timestamptz(const SpanSet *ss); -extern TimestampTz tstzspanset_lower(const SpanSet *ss); -extern int tstzspanset_num_timestamps(const SpanSet *ss); -extern TimestampTz tstzspanset_start_timestamptz(const SpanSet *ss); -extern bool tstzspanset_timestamptz_n(const SpanSet *ss, int n, TimestampTz *result); -extern Set *tstzspanset_timestamps(const SpanSet *ss); -extern TimestampTz tstzspanset_upper(const SpanSet *ss); +extern int temporal_cmp(const Temporal *temp1, const Temporal *temp2); +extern bool temporal_eq(const Temporal *temp1, const Temporal *temp2); +extern bool temporal_ge(const Temporal *temp1, const Temporal *temp2); +extern bool temporal_gt(const Temporal *temp1, const Temporal *temp2); +extern bool temporal_le(const Temporal *temp1, const Temporal *temp2); +extern bool temporal_lt(const Temporal *temp1, const Temporal *temp2); +extern bool temporal_ne(const Temporal *temp1, const Temporal *temp2); -extern Set *bigintset_shift_scale(const Set *s, int64 shift, int64 width, bool hasshift, bool haswidth); -extern Span *bigintspan_shift_scale(const Span *s, int64 shift, int64 width, bool hasshift, bool haswidth); -extern SpanSet *bigintspanset_shift_scale(const SpanSet *ss, int64 shift, int64 width, bool hasshift, bool haswidth); -extern Set *dateset_shift_scale(const Set *s, int shift, int width, bool hasshift, bool haswidth); -extern Span *datespan_shift_scale(const Span *s, int shift, int width, bool hasshift, bool haswidth); -extern SpanSet *datespanset_shift_scale(const SpanSet *ss, int shift, int width, bool hasshift, bool haswidth); -extern Set *floatset_ceil(const Set *s); -extern Set *floatset_floor(const Set *s); -extern Set *floatset_degrees(const Set *s, bool normalize); -extern Set *floatset_radians(const Set *s); -extern Set *floatset_round(const Set *s, int maxdd); -extern Set *floatset_shift_scale(const Set *s, double shift, double width, bool hasshift, bool haswidth); -extern Span *floatspan_ceil(const Span *s); -extern Span *floatspan_floor(const Span *s); -extern Span *floatspan_round(const Span *s, int maxdd); -extern Span *floatspan_shift_scale(const Span *s, double shift, double width, bool hasshift, bool haswidth); -extern SpanSet *floatspanset_ceil(const SpanSet *ss); -extern SpanSet *floatspanset_floor(const SpanSet *ss); -extern SpanSet *floatspanset_round(const SpanSet *ss, int maxdd); -extern SpanSet *floatspanset_shift_scale(const SpanSet *ss, double shift, double width, bool hasshift, bool haswidth); -extern Set *geoset_round(const Set *s, int maxdd); -extern Set *geoset_set_srid(const Set *s, int32_t srid); -extern Set *geoset_transform(const Set *s, int32_t srid); -extern Set *geoset_transform_pipeline(const Set *s, const char *pipelinestr, int32_t srid, bool is_forward); -extern Set *intset_shift_scale(const Set *s, int shift, int width, bool hasshift, bool haswidth); -extern Span *intspan_shift_scale(const Span *s, int shift, int width, bool hasshift, bool haswidth); -extern SpanSet *intspanset_shift_scale(const SpanSet *ss, int shift, int width, bool hasshift, bool haswidth); -extern GSERIALIZED *point_transform(const GSERIALIZED *gs, int32_t srid); -extern GSERIALIZED *point_transform_pipeline(const GSERIALIZED *gs, const char *pipelinestr, int32_t srid, bool is_forward); -extern Span *set_spans(const Set *s); -extern Span *set_split_each_n_spans(const Set *s, int elem_count, int *count); -extern Span *set_split_n_spans(const Set *s, int span_count, int *count); -extern Span *spanset_spans(const SpanSet *ss); -extern Span *spanset_split_each_n_spans(const SpanSet *ss, int elem_count, int *count); -extern Span *spanset_split_n_spans(const SpanSet *ss, int span_count, int *count); -extern Set *textset_initcap(const Set *s); -extern Set *textset_lower(const Set *s); -extern Set *textset_upper(const Set *s); -extern Set *textcat_textset_text(const Set *s, const text *txt); -extern Set *textcat_text_textset(const text *txt, const Set *s); -extern TimestampTz timestamptz_tprecision(TimestampTz t, const Interval *duration, TimestampTz torigin); -extern Set *tstzset_shift_scale(const Set *s, const Interval *shift, const Interval *duration); -extern Set *tstzset_tprecision(const Set *s, const Interval *duration, TimestampTz torigin); -extern Span *tstzspan_shift_scale(const Span *s, const Interval *shift, const Interval *duration); -extern Span *tstzspan_tprecision(const Span *s, const Interval *duration, TimestampTz torigin); -extern SpanSet *tstzspanset_shift_scale(const SpanSet *ss, const Interval *shift, const Interval *duration); -extern SpanSet *tstzspanset_tprecision(const SpanSet *ss, const Interval *duration, TimestampTz torigin); +extern int always_eq_bool_tbool(bool b, const Temporal *temp); +extern int always_eq_float_tfloat(double d, const Temporal *temp); +extern int always_eq_int_tint(int i, const Temporal *temp); +extern int always_eq_tbool_bool(const Temporal *temp, bool b); +extern int always_eq_temporal_temporal(const Temporal *temp1, const Temporal *temp2); +extern int always_eq_text_ttext(const text *txt, const Temporal *temp); +extern int always_eq_tfloat_float(const Temporal *temp, double d); +extern int always_eq_tint_int(const Temporal *temp, int i); +extern int always_eq_ttext_text(const Temporal *temp, const text *txt); +extern int always_ge_float_tfloat(double d, const Temporal *temp); +extern int always_ge_int_tint(int i, const Temporal *temp); +extern int always_ge_temporal_temporal(const Temporal *temp1, const Temporal *temp2); +extern int always_ge_text_ttext(const text *txt, const Temporal *temp); +extern int always_ge_tfloat_float(const Temporal *temp, double d); +extern int always_ge_tint_int(const Temporal *temp, int i); +extern int always_ge_ttext_text(const Temporal *temp, const text *txt); +extern int always_gt_float_tfloat(double d, const Temporal *temp); +extern int always_gt_int_tint(int i, const Temporal *temp); +extern int always_gt_temporal_temporal(const Temporal *temp1, const Temporal *temp2); +extern int always_gt_text_ttext(const text *txt, const Temporal *temp); +extern int always_gt_tfloat_float(const Temporal *temp, double d); +extern int always_gt_tint_int(const Temporal *temp, int i); +extern int always_gt_ttext_text(const Temporal *temp, const text *txt); +extern int always_le_float_tfloat(double d, const Temporal *temp); +extern int always_le_int_tint(int i, const Temporal *temp); +extern int always_le_temporal_temporal(const Temporal *temp1, const Temporal *temp2); +extern int always_le_text_ttext(const text *txt, const Temporal *temp); +extern int always_le_tfloat_float(const Temporal *temp, double d); +extern int always_le_tint_int(const Temporal *temp, int i); +extern int always_le_ttext_text(const Temporal *temp, const text *txt); +extern int always_lt_float_tfloat(double d, const Temporal *temp); +extern int always_lt_int_tint(int i, const Temporal *temp); +extern int always_lt_temporal_temporal(const Temporal *temp1, const Temporal *temp2); +extern int always_lt_text_ttext(const text *txt, const Temporal *temp); +extern int always_lt_tfloat_float(const Temporal *temp, double d); +extern int always_lt_tint_int(const Temporal *temp, int i); +extern int always_lt_ttext_text(const Temporal *temp, const text *txt); +extern int always_ne_bool_tbool(bool b, const Temporal *temp); +extern int always_ne_float_tfloat(double d, const Temporal *temp); +extern int always_ne_int_tint(int i, const Temporal *temp); +extern int always_ne_tbool_bool(const Temporal *temp, bool b); +extern int always_ne_temporal_temporal(const Temporal *temp1, const Temporal *temp2); +extern int always_ne_text_ttext(const text *txt, const Temporal *temp); +extern int always_ne_tfloat_float(const Temporal *temp, double d); +extern int always_ne_tint_int(const Temporal *temp, int i); +extern int always_ne_ttext_text(const Temporal *temp, const text *txt); +extern int ever_eq_bool_tbool(bool b, const Temporal *temp); +extern int ever_eq_float_tfloat(double d, const Temporal *temp); +extern int ever_eq_int_tint(int i, const Temporal *temp); +extern int ever_eq_tbool_bool(const Temporal *temp, bool b); +extern int ever_eq_temporal_temporal(const Temporal *temp1, const Temporal *temp2); +extern int ever_eq_text_ttext(const text *txt, const Temporal *temp); +extern int ever_eq_tfloat_float(const Temporal *temp, double d); +extern int ever_eq_tint_int(const Temporal *temp, int i); +extern int ever_eq_ttext_text(const Temporal *temp, const text *txt); +extern int ever_ge_float_tfloat(double d, const Temporal *temp); +extern int ever_ge_int_tint(int i, const Temporal *temp); +extern int ever_ge_temporal_temporal(const Temporal *temp1, const Temporal *temp2); +extern int ever_ge_text_ttext(const text *txt, const Temporal *temp); +extern int ever_ge_tfloat_float(const Temporal *temp, double d); +extern int ever_ge_tint_int(const Temporal *temp, int i); +extern int ever_ge_ttext_text(const Temporal *temp, const text *txt); +extern int ever_gt_float_tfloat(double d, const Temporal *temp); +extern int ever_gt_int_tint(int i, const Temporal *temp); +extern int ever_gt_temporal_temporal(const Temporal *temp1, const Temporal *temp2); +extern int ever_gt_text_ttext(const text *txt, const Temporal *temp); +extern int ever_gt_tfloat_float(const Temporal *temp, double d); +extern int ever_gt_tint_int(const Temporal *temp, int i); +extern int ever_gt_ttext_text(const Temporal *temp, const text *txt); +extern int ever_le_float_tfloat(double d, const Temporal *temp); +extern int ever_le_int_tint(int i, const Temporal *temp); +extern int ever_le_temporal_temporal(const Temporal *temp1, const Temporal *temp2); +extern int ever_le_text_ttext(const text *txt, const Temporal *temp); +extern int ever_le_tfloat_float(const Temporal *temp, double d); +extern int ever_le_tint_int(const Temporal *temp, int i); +extern int ever_le_ttext_text(const Temporal *temp, const text *txt); +extern int ever_lt_float_tfloat(double d, const Temporal *temp); +extern int ever_lt_int_tint(int i, const Temporal *temp); +extern int ever_lt_temporal_temporal(const Temporal *temp1, const Temporal *temp2); +extern int ever_lt_text_ttext(const text *txt, const Temporal *temp); +extern int ever_lt_tfloat_float(const Temporal *temp, double d); +extern int ever_lt_tint_int(const Temporal *temp, int i); +extern int ever_lt_ttext_text(const Temporal *temp, const text *txt); +extern int ever_ne_bool_tbool(bool b, const Temporal *temp); +extern int ever_ne_float_tfloat(double d, const Temporal *temp); +extern int ever_ne_int_tint(int i, const Temporal *temp); +extern int ever_ne_tbool_bool(const Temporal *temp, bool b); +extern int ever_ne_temporal_temporal(const Temporal *temp1, const Temporal *temp2); +extern int ever_ne_text_ttext(const text *txt, const Temporal *temp); +extern int ever_ne_tfloat_float(const Temporal *temp, double d); +extern int ever_ne_tint_int(const Temporal *temp, int i); +extern int ever_ne_ttext_text(const Temporal *temp, const text *txt); -extern int set_cmp(const Set *s1, const Set *s2); -extern bool set_eq(const Set *s1, const Set *s2); -extern bool set_ge(const Set *s1, const Set *s2); -extern bool set_gt(const Set *s1, const Set *s2); -extern bool set_le(const Set *s1, const Set *s2); -extern bool set_lt(const Set *s1, const Set *s2); -extern bool set_ne(const Set *s1, const Set *s2); -extern int span_cmp(const Span *s1, const Span *s2); -extern bool span_eq(const Span *s1, const Span *s2); -extern bool span_ge(const Span *s1, const Span *s2); -extern bool span_gt(const Span *s1, const Span *s2); -extern bool span_le(const Span *s1, const Span *s2); -extern bool span_lt(const Span *s1, const Span *s2); -extern bool span_ne(const Span *s1, const Span *s2); -extern int spanset_cmp(const SpanSet *ss1, const SpanSet *ss2); -extern bool spanset_eq(const SpanSet *ss1, const SpanSet *ss2); -extern bool spanset_ge(const SpanSet *ss1, const SpanSet *ss2); -extern bool spanset_gt(const SpanSet *ss1, const SpanSet *ss2); -extern bool spanset_le(const SpanSet *ss1, const SpanSet *ss2); -extern bool spanset_lt(const SpanSet *ss1, const SpanSet *ss2); -extern bool spanset_ne(const SpanSet *ss1, const SpanSet *ss2); +extern Temporal *teq_bool_tbool(bool b, const Temporal *temp); +extern Temporal *teq_float_tfloat(double d, const Temporal *temp); +extern Temporal *teq_int_tint(int i, const Temporal *temp); +extern Temporal *teq_tbool_bool(const Temporal *temp, bool b); +extern Temporal *teq_temporal_temporal(const Temporal *temp1, const Temporal *temp2); +extern Temporal *teq_text_ttext(const text *txt, const Temporal *temp); +extern Temporal *teq_tfloat_float(const Temporal *temp, double d); +extern Temporal *teq_tint_int(const Temporal *temp, int i); +extern Temporal *teq_ttext_text(const Temporal *temp, const text *txt); +extern Temporal *tge_float_tfloat(double d, const Temporal *temp); +extern Temporal *tge_int_tint(int i, const Temporal *temp); +extern Temporal *tge_temporal_temporal(const Temporal *temp1, const Temporal *temp2); +extern Temporal *tge_text_ttext(const text *txt, const Temporal *temp); +extern Temporal *tge_tfloat_float(const Temporal *temp, double d); +extern Temporal *tge_tint_int(const Temporal *temp, int i); +extern Temporal *tge_ttext_text(const Temporal *temp, const text *txt); +extern Temporal *tgt_float_tfloat(double d, const Temporal *temp); +extern Temporal *tgt_int_tint(int i, const Temporal *temp); +extern Temporal *tgt_temporal_temporal(const Temporal *temp1, const Temporal *temp2); +extern Temporal *tgt_text_ttext(const text *txt, const Temporal *temp); +extern Temporal *tgt_tfloat_float(const Temporal *temp, double d); +extern Temporal *tgt_tint_int(const Temporal *temp, int i); +extern Temporal *tgt_ttext_text(const Temporal *temp, const text *txt); +extern Temporal *tle_float_tfloat(double d, const Temporal *temp); +extern Temporal *tle_int_tint(int i, const Temporal *temp); +extern Temporal *tle_temporal_temporal(const Temporal *temp1, const Temporal *temp2); +extern Temporal *tle_text_ttext(const text *txt, const Temporal *temp); +extern Temporal *tle_tfloat_float(const Temporal *temp, double d); +extern Temporal *tle_tint_int(const Temporal *temp, int i); +extern Temporal *tle_ttext_text(const Temporal *temp, const text *txt); +extern Temporal *tlt_float_tfloat(double d, const Temporal *temp); +extern Temporal *tlt_int_tint(int i, const Temporal *temp); +extern Temporal *tlt_temporal_temporal(const Temporal *temp1, const Temporal *temp2); +extern Temporal *tlt_text_ttext(const text *txt, const Temporal *temp); +extern Temporal *tlt_tfloat_float(const Temporal *temp, double d); +extern Temporal *tlt_tint_int(const Temporal *temp, int i); +extern Temporal *tlt_ttext_text(const Temporal *temp, const text *txt); +extern Temporal *tne_bool_tbool(bool b, const Temporal *temp); +extern Temporal *tne_float_tfloat(double d, const Temporal *temp); +extern Temporal *tne_int_tint(int i, const Temporal *temp); +extern Temporal *tne_tbool_bool(const Temporal *temp, bool b); +extern Temporal *tne_temporal_temporal(const Temporal *temp1, const Temporal *temp2); +extern Temporal *tne_text_ttext(const text *txt, const Temporal *temp); +extern Temporal *tne_tfloat_float(const Temporal *temp, double d); +extern Temporal *tne_tint_int(const Temporal *temp, int i); +extern Temporal *tne_ttext_text(const Temporal *temp, const text *txt); -extern bool adjacent_span_bigint(const Span *s, int64 i); -extern bool adjacent_span_date(const Span *s, DateADT d); -extern bool adjacent_span_float(const Span *s, double d); -extern bool adjacent_span_int(const Span *s, int i); -extern bool adjacent_span_span(const Span *s1, const Span *s2); -extern bool adjacent_span_spanset(const Span *s, const SpanSet *ss); -extern bool adjacent_span_timestamptz(const Span *s, TimestampTz t); -extern bool adjacent_spanset_bigint(const SpanSet *ss, int64 i); -extern bool adjacent_spanset_date(const SpanSet *ss, DateADT d); -extern bool adjacent_spanset_float(const SpanSet *ss, double d); -extern bool adjacent_spanset_int(const SpanSet *ss, int i); -extern bool adjacent_spanset_timestamptz(const SpanSet *ss, TimestampTz t); -extern bool adjacent_spanset_span(const SpanSet *ss, const Span *s); -extern bool adjacent_spanset_spanset(const SpanSet *ss1, const SpanSet *ss2); -extern bool contained_bigint_set(int64 i, const Set *s); -extern bool contained_bigint_span(int64 i, const Span *s); -extern bool contained_bigint_spanset(int64 i, const SpanSet *ss); -extern bool contained_date_set(DateADT d, const Set *s); -extern bool contained_date_span(DateADT d, const Span *s); -extern bool contained_date_spanset(DateADT d, const SpanSet *ss); -extern bool contained_float_set(double d, const Set *s); -extern bool contained_float_span(double d, const Span *s); -extern bool contained_float_spanset(double d, const SpanSet *ss); -extern bool contained_geo_set(GSERIALIZED *gs, const Set *s); -extern bool contained_int_set(int i, const Set *s); -extern bool contained_int_span(int i, const Span *s); -extern bool contained_int_spanset(int i, const SpanSet *ss); -extern bool contained_set_set(const Set *s1, const Set *s2); -extern bool contained_span_span(const Span *s1, const Span *s2); -extern bool contained_span_spanset(const Span *s, const SpanSet *ss); -extern bool contained_spanset_span(const SpanSet *ss, const Span *s); -extern bool contained_spanset_spanset(const SpanSet *ss1, const SpanSet *ss2); -extern bool contained_text_set(text *txt, const Set *s); -extern bool contained_timestamptz_set(TimestampTz t, const Set *s); -extern bool contained_timestamptz_span(TimestampTz t, const Span *s); -extern bool contained_timestamptz_spanset(TimestampTz t, const SpanSet *ss); -extern bool contains_set_bigint(const Set *s, int64 i); -extern bool contains_set_date(const Set *s, DateADT d); -extern bool contains_set_float(const Set *s, double d); -extern bool contains_set_geo(const Set *s, GSERIALIZED *gs); -extern bool contains_set_int(const Set *s, int i); -extern bool contains_set_set(const Set *s1, const Set *s2); -extern bool contains_set_text(const Set *s, text *t); -extern bool contains_set_timestamptz(const Set *s, TimestampTz t); -extern bool contains_span_bigint(const Span *s, int64 i); -extern bool contains_span_date(const Span *s, DateADT d); -extern bool contains_span_float(const Span *s, double d); -extern bool contains_span_int(const Span *s, int i); -extern bool contains_span_span(const Span *s1, const Span *s2); -extern bool contains_span_spanset(const Span *s, const SpanSet *ss); -extern bool contains_span_timestamptz(const Span *s, TimestampTz t); -extern bool contains_spanset_bigint(const SpanSet *ss, int64 i); -extern bool contains_spanset_date(const SpanSet *ss, DateADT d); -extern bool contains_spanset_float(const SpanSet *ss, double d); -extern bool contains_spanset_int(const SpanSet *ss, int i); -extern bool contains_spanset_span(const SpanSet *ss, const Span *s); -extern bool contains_spanset_spanset(const SpanSet *ss1, const SpanSet *ss2); -extern bool contains_spanset_timestamptz(const SpanSet *ss, TimestampTz t); -extern bool overlaps_set_set(const Set *s1, const Set *s2); -extern bool overlaps_span_span(const Span *s1, const Span *s2); -extern bool overlaps_span_spanset(const Span *s, const SpanSet *ss); -extern bool overlaps_spanset_span(const SpanSet *ss, const Span *s); -extern bool overlaps_spanset_spanset(const SpanSet *ss1, const SpanSet *ss2); +extern Span *temporal_spans(const Temporal *temp, int *count); +extern Span *temporal_split_each_n_spans(const Temporal *temp, int elem_count, int *count); +extern Span *temporal_split_n_spans(const Temporal *temp, int span_count, int *count); +extern TBox *tnumber_split_each_n_tboxes(const Temporal *temp, int elem_count, int *count); +extern TBox *tnumber_split_n_tboxes(const Temporal *temp, int box_count, int *count); +extern TBox *tnumber_tboxes(const Temporal *temp, int *count); -extern bool after_date_set(DateADT d, const Set *s); -extern bool after_date_span(DateADT d, const Span *s); -extern bool after_date_spanset(DateADT d, const SpanSet *ss); -extern bool after_set_date(const Set *s, DateADT d); -extern bool after_set_timestamptz(const Set *s, TimestampTz t); -extern bool after_span_date(const Span *s, DateADT d); -extern bool after_span_timestamptz(const Span *s, TimestampTz t); -extern bool after_spanset_date(const SpanSet *ss, DateADT d); -extern bool after_spanset_timestamptz(const SpanSet *ss, TimestampTz t); -extern bool after_timestamptz_set(TimestampTz t, const Set *s); -extern bool after_timestamptz_span(TimestampTz t, const Span *s); -extern bool after_timestamptz_spanset(TimestampTz t, const SpanSet *ss); -extern bool before_date_set(DateADT d, const Set *s); -extern bool before_date_span(DateADT d, const Span *s); -extern bool before_date_spanset(DateADT d, const SpanSet *ss); -extern bool before_set_date(const Set *s, DateADT d); -extern bool before_set_timestamptz(const Set *s, TimestampTz t); -extern bool before_span_date(const Span *s, DateADT d); -extern bool before_span_timestamptz(const Span *s, TimestampTz t); -extern bool before_spanset_date(const SpanSet *ss, DateADT d); -extern bool before_spanset_timestamptz(const SpanSet *ss, TimestampTz t); -extern bool before_timestamptz_set(TimestampTz t, const Set *s); -extern bool before_timestamptz_span(TimestampTz t, const Span *s); -extern bool before_timestamptz_spanset(TimestampTz t, const SpanSet *ss); -extern bool left_bigint_set(int64 i, const Set *s); -extern bool left_bigint_span(int64 i, const Span *s); -extern bool left_bigint_spanset(int64 i, const SpanSet *ss); -extern bool left_float_set(double d, const Set *s); -extern bool left_float_span(double d, const Span *s); -extern bool left_float_spanset(double d, const SpanSet *ss); -extern bool left_int_set(int i, const Set *s); -extern bool left_int_span(int i, const Span *s); -extern bool left_int_spanset(int i, const SpanSet *ss); -extern bool left_set_bigint(const Set *s, int64 i); -extern bool left_set_float(const Set *s, double d); -extern bool left_set_int(const Set *s, int i); -extern bool left_set_set(const Set *s1, const Set *s2); -extern bool left_set_text(const Set *s, text *txt); -extern bool left_span_bigint(const Span *s, int64 i); -extern bool left_span_float(const Span *s, double d); -extern bool left_span_int(const Span *s, int i); -extern bool left_span_span(const Span *s1, const Span *s2); -extern bool left_span_spanset(const Span *s, const SpanSet *ss); -extern bool left_spanset_bigint(const SpanSet *ss, int64 i); -extern bool left_spanset_float(const SpanSet *ss, double d); -extern bool left_spanset_int(const SpanSet *ss, int i); -extern bool left_spanset_span(const SpanSet *ss, const Span *s); -extern bool left_spanset_spanset(const SpanSet *ss1, const SpanSet *ss2); -extern bool left_text_set(text *txt, const Set *s); -extern bool overafter_date_set(DateADT d, const Set *s); -extern bool overafter_date_span(DateADT d, const Span *s); -extern bool overafter_date_spanset(DateADT d, const SpanSet *ss); -extern bool overafter_set_date(const Set *s, DateADT d); -extern bool overafter_set_timestamptz(const Set *s, TimestampTz t); -extern bool overafter_span_date(const Span *s, DateADT d); -extern bool overafter_span_timestamptz(const Span *s, TimestampTz t); -extern bool overafter_spanset_date(const SpanSet *ss, DateADT d); -extern bool overafter_spanset_timestamptz(const SpanSet *ss, TimestampTz t); -extern bool overafter_timestamptz_set(TimestampTz t, const Set *s); -extern bool overafter_timestamptz_span(TimestampTz t, const Span *s); -extern bool overafter_timestamptz_spanset(TimestampTz t, const SpanSet *ss); -extern bool overbefore_date_set(DateADT d, const Set *s); -extern bool overbefore_date_span(DateADT d, const Span *s); -extern bool overbefore_date_spanset(DateADT d, const SpanSet *ss); -extern bool overbefore_set_date(const Set *s, DateADT d); -extern bool overbefore_set_timestamptz(const Set *s, TimestampTz t); -extern bool overbefore_span_date(const Span *s, DateADT d); -extern bool overbefore_span_timestamptz(const Span *s, TimestampTz t); -extern bool overbefore_spanset_date(const SpanSet *ss, DateADT d); -extern bool overbefore_spanset_timestamptz(const SpanSet *ss, TimestampTz t); -extern bool overbefore_timestamptz_set(TimestampTz t, const Set *s); -extern bool overbefore_timestamptz_span(TimestampTz t, const Span *s); -extern bool overbefore_timestamptz_spanset(TimestampTz t, const SpanSet *ss); -extern bool overleft_bigint_set(int64 i, const Set *s); -extern bool overleft_bigint_span(int64 i, const Span *s); -extern bool overleft_bigint_spanset(int64 i, const SpanSet *ss); -extern bool overleft_float_set(double d, const Set *s); -extern bool overleft_float_span(double d, const Span *s); -extern bool overleft_float_spanset(double d, const SpanSet *ss); -extern bool overleft_int_set(int i, const Set *s); -extern bool overleft_int_span(int i, const Span *s); -extern bool overleft_int_spanset(int i, const SpanSet *ss); -extern bool overleft_set_bigint(const Set *s, int64 i); -extern bool overleft_set_float(const Set *s, double d); -extern bool overleft_set_int(const Set *s, int i); -extern bool overleft_set_set(const Set *s1, const Set *s2); -extern bool overleft_set_text(const Set *s, text *txt); -extern bool overleft_span_bigint(const Span *s, int64 i); -extern bool overleft_span_float(const Span *s, double d); -extern bool overleft_span_int(const Span *s, int i); -extern bool overleft_span_span(const Span *s1, const Span *s2); -extern bool overleft_span_spanset(const Span *s, const SpanSet *ss); -extern bool overleft_spanset_bigint(const SpanSet *ss, int64 i); -extern bool overleft_spanset_float(const SpanSet *ss, double d); -extern bool overleft_spanset_int(const SpanSet *ss, int i); -extern bool overleft_spanset_span(const SpanSet *ss, const Span *s); -extern bool overleft_spanset_spanset(const SpanSet *ss1, const SpanSet *ss2); -extern bool overleft_text_set(text *txt, const Set *s); -extern bool overright_bigint_set(int64 i, const Set *s); -extern bool overright_bigint_span(int64 i, const Span *s); -extern bool overright_bigint_spanset(int64 i, const SpanSet *ss); -extern bool overright_float_set(double d, const Set *s); -extern bool overright_float_span(double d, const Span *s); -extern bool overright_float_spanset(double d, const SpanSet *ss); -extern bool overright_int_set(int i, const Set *s); -extern bool overright_int_span(int i, const Span *s); -extern bool overright_int_spanset(int i, const SpanSet *ss); -extern bool overright_set_bigint(const Set *s, int64 i); -extern bool overright_set_float(const Set *s, double d); -extern bool overright_set_int(const Set *s, int i); -extern bool overright_set_set(const Set *s1, const Set *s2); -extern bool overright_set_text(const Set *s, text *txt); -extern bool overright_span_bigint(const Span *s, int64 i); -extern bool overright_span_float(const Span *s, double d); -extern bool overright_span_int(const Span *s, int i); -extern bool overright_span_span(const Span *s1, const Span *s2); -extern bool overright_span_spanset(const Span *s, const SpanSet *ss); -extern bool overright_spanset_bigint(const SpanSet *ss, int64 i); -extern bool overright_spanset_float(const SpanSet *ss, double d); -extern bool overright_spanset_int(const SpanSet *ss, int i); -extern bool overright_spanset_span(const SpanSet *ss, const Span *s); -extern bool overright_spanset_spanset(const SpanSet *ss1, const SpanSet *ss2); -extern bool overright_text_set(text *txt, const Set *s); -extern bool right_bigint_set(int64 i, const Set *s); -extern bool right_bigint_span(int64 i, const Span *s); -extern bool right_bigint_spanset(int64 i, const SpanSet *ss); -extern bool right_float_set(double d, const Set *s); -extern bool right_float_span(double d, const Span *s); -extern bool right_float_spanset(double d, const SpanSet *ss); -extern bool right_int_set(int i, const Set *s); -extern bool right_int_span(int i, const Span *s); -extern bool right_int_spanset(int i, const SpanSet *ss); -extern bool right_set_bigint(const Set *s, int64 i); -extern bool right_set_float(const Set *s, double d); -extern bool right_set_int(const Set *s, int i); -extern bool right_set_set(const Set *s1, const Set *s2); -extern bool right_set_text(const Set *s, text *txt); -extern bool right_span_bigint(const Span *s, int64 i); -extern bool right_span_float(const Span *s, double d); -extern bool right_span_int(const Span *s, int i); -extern bool right_span_span(const Span *s1, const Span *s2); -extern bool right_span_spanset(const Span *s, const SpanSet *ss); -extern bool right_spanset_bigint(const SpanSet *ss, int64 i); -extern bool right_spanset_float(const SpanSet *ss, double d); -extern bool right_spanset_int(const SpanSet *ss, int i); -extern bool right_spanset_span(const SpanSet *ss, const Span *s); -extern bool right_spanset_spanset(const SpanSet *ss1, const SpanSet *ss2); -extern bool right_text_set(text *txt, const Set *s); +extern bool adjacent_numspan_tnumber(const Span *s, const Temporal *temp); +extern bool adjacent_tbox_tnumber(const TBox *box, const Temporal *temp); +extern bool adjacent_temporal_temporal(const Temporal *temp1, const Temporal *temp2); +extern bool adjacent_temporal_tstzspan(const Temporal *temp, const Span *s); +extern bool adjacent_tnumber_numspan(const Temporal *temp, const Span *s); +extern bool adjacent_tnumber_tbox(const Temporal *temp, const TBox *box); +extern bool adjacent_tnumber_tnumber(const Temporal *temp1, const Temporal *temp2); +extern bool adjacent_tstzspan_temporal(const Span *s, const Temporal *temp); +extern bool contained_numspan_tnumber(const Span *s, const Temporal *temp); +extern bool contained_tbox_tnumber(const TBox *box, const Temporal *temp); +extern bool contained_temporal_temporal(const Temporal *temp1, const Temporal *temp2); +extern bool contained_temporal_tstzspan(const Temporal *temp, const Span *s); +extern bool contained_tnumber_numspan(const Temporal *temp, const Span *s); +extern bool contained_tnumber_tbox(const Temporal *temp, const TBox *box); +extern bool contained_tnumber_tnumber(const Temporal *temp1, const Temporal *temp2); +extern bool contained_tstzspan_temporal(const Span *s, const Temporal *temp); +extern bool contains_numspan_tnumber(const Span *s, const Temporal *temp); +extern bool contains_tbox_tnumber(const TBox *box, const Temporal *temp); +extern bool contains_temporal_tstzspan(const Temporal *temp, const Span *s); +extern bool contains_temporal_temporal(const Temporal *temp1, const Temporal *temp2); +extern bool contains_tnumber_numspan(const Temporal *temp, const Span *s); +extern bool contains_tnumber_tbox(const Temporal *temp, const TBox *box); +extern bool contains_tnumber_tnumber(const Temporal *temp1, const Temporal *temp2); +extern bool contains_tstzspan_temporal(const Span *s, const Temporal *temp); +extern bool overlaps_numspan_tnumber(const Span *s, const Temporal *temp); +extern bool overlaps_tbox_tnumber(const TBox *box, const Temporal *temp); +extern bool overlaps_temporal_temporal(const Temporal *temp1, const Temporal *temp2); +extern bool overlaps_temporal_tstzspan(const Temporal *temp, const Span *s); +extern bool overlaps_tnumber_numspan(const Temporal *temp, const Span *s); +extern bool overlaps_tnumber_tbox(const Temporal *temp, const TBox *box); +extern bool overlaps_tnumber_tnumber(const Temporal *temp1, const Temporal *temp2); +extern bool overlaps_tstzspan_temporal(const Span *s, const Temporal *temp); +extern bool same_numspan_tnumber(const Span *s, const Temporal *temp); +extern bool same_tbox_tnumber(const TBox *box, const Temporal *temp); +extern bool same_temporal_temporal(const Temporal *temp1, const Temporal *temp2); +extern bool same_temporal_tstzspan(const Temporal *temp, const Span *s); +extern bool same_tnumber_numspan(const Temporal *temp, const Span *s); +extern bool same_tnumber_tbox(const Temporal *temp, const TBox *box); +extern bool same_tnumber_tnumber(const Temporal *temp1, const Temporal *temp2); +extern bool same_tstzspan_temporal(const Span *s, const Temporal *temp); -extern Set *intersection_bigint_set(int64 i, const Set *s); -extern Set *intersection_date_set(const DateADT d, const Set *s); -extern Set *intersection_float_set(double d, const Set *s); -extern Set *intersection_geo_set(const GSERIALIZED *gs, const Set *s); -extern Set *intersection_int_set(int i, const Set *s); -extern Set *intersection_set_bigint(const Set *s, int64 i); -extern Set *intersection_set_date(const Set *s, DateADT d); -extern Set *intersection_set_float(const Set *s, double d); -extern Set *intersection_set_geo(const Set *s, const GSERIALIZED *gs); -extern Set *intersection_set_int(const Set *s, int i); -extern Set *intersection_set_set(const Set *s1, const Set *s2); -extern Set *intersection_set_text(const Set *s, const text *txt); -extern Set *intersection_set_timestamptz(const Set *s, TimestampTz t); -extern Span *intersection_span_bigint(const Span *s, int64 i); -extern Span *intersection_span_date(const Span *s, DateADT d); -extern Span *intersection_span_float(const Span *s, double d); -extern Span *intersection_span_int(const Span *s, int i); -extern Span *intersection_span_span(const Span *s1, const Span *s2); -extern SpanSet *intersection_span_spanset(const Span *s, const SpanSet *ss); -extern Span *intersection_span_timestamptz(const Span *s, TimestampTz t); -extern SpanSet *intersection_spanset_bigint(const SpanSet *ss, int64 i); -extern SpanSet *intersection_spanset_date(const SpanSet *ss, DateADT d); -extern SpanSet *intersection_spanset_float(const SpanSet *ss, double d); -extern SpanSet *intersection_spanset_int(const SpanSet *ss, int i); -extern SpanSet *intersection_spanset_span(const SpanSet *ss, const Span *s); -extern SpanSet *intersection_spanset_spanset(const SpanSet *ss1, const SpanSet *ss2); -extern SpanSet *intersection_spanset_timestamptz(const SpanSet *ss, TimestampTz t); -extern Set *intersection_text_set(const text *txt, const Set *s); -extern Set *intersection_timestamptz_set(const TimestampTz t, const Set *s); -extern Set *minus_bigint_set(int64 i, const Set *s); -extern SpanSet *minus_bigint_span(int64 i, const Span *s); -extern SpanSet *minus_bigint_spanset(int64 i, const SpanSet *ss); -extern Set *minus_date_set(DateADT d, const Set *s); -extern SpanSet *minus_date_span(DateADT d, const Span *s); -extern SpanSet *minus_date_spanset(DateADT d, const SpanSet *ss); -extern Set *minus_float_set(double d, const Set *s); -extern SpanSet *minus_float_span(double d, const Span *s); -extern SpanSet *minus_float_spanset(double d, const SpanSet *ss); -extern Set *minus_geo_set(const GSERIALIZED *gs, const Set *s); -extern Set *minus_int_set(int i, const Set *s); -extern SpanSet *minus_int_span(int i, const Span *s); -extern SpanSet *minus_int_spanset(int i, const SpanSet *ss); -extern Set *minus_set_bigint(const Set *s, int64 i); -extern Set *minus_set_date(const Set *s, DateADT d); -extern Set *minus_set_float(const Set *s, double d); -extern Set *minus_set_geo(const Set *s, const GSERIALIZED *gs); -extern Set *minus_set_int(const Set *s, int i); -extern Set *minus_set_set(const Set *s1, const Set *s2); -extern Set *minus_set_text(const Set *s, const text *txt); -extern Set *minus_set_timestamptz(const Set *s, TimestampTz t); -extern SpanSet *minus_span_bigint(const Span *s, int64 i); -extern SpanSet *minus_span_date(const Span *s, DateADT d); -extern SpanSet *minus_span_float(const Span *s, double d); -extern SpanSet *minus_span_int(const Span *s, int i); -extern SpanSet *minus_span_span(const Span *s1, const Span *s2); -extern SpanSet *minus_span_spanset(const Span *s, const SpanSet *ss); -extern SpanSet *minus_span_timestamptz(const Span *s, TimestampTz t); -extern SpanSet *minus_spanset_bigint(const SpanSet *ss, int64 i); -extern SpanSet *minus_spanset_date(const SpanSet *ss, DateADT d); -extern SpanSet *minus_spanset_float(const SpanSet *ss, double d); -extern SpanSet *minus_spanset_int(const SpanSet *ss, int i); -extern SpanSet *minus_spanset_span(const SpanSet *ss, const Span *s); -extern SpanSet *minus_spanset_spanset(const SpanSet *ss1, const SpanSet *ss2); -extern SpanSet *minus_spanset_timestamptz(const SpanSet *ss, TimestampTz t); -extern Set *minus_text_set(const text *txt, const Set *s); -extern Set *minus_timestamptz_set(TimestampTz t, const Set *s); -extern SpanSet *minus_timestamptz_span(TimestampTz t, const Span *s); -extern SpanSet *minus_timestamptz_spanset(TimestampTz t, const SpanSet *ss); -extern Set *union_bigint_set(int64 i, const Set *s); -extern SpanSet *union_bigint_span(const Span *s, int64 i); -extern SpanSet *union_bigint_spanset(int64 i, SpanSet *ss); -extern Set *union_date_set(const DateADT d, const Set *s); -extern SpanSet *union_date_span(const Span *s, DateADT d); -extern SpanSet *union_date_spanset(DateADT d, SpanSet *ss); -extern Set *union_float_set(double d, const Set *s); -extern SpanSet *union_float_span(const Span *s, double d); -extern SpanSet *union_float_spanset(double d, SpanSet *ss); -extern Set *union_geo_set(const GSERIALIZED *gs, const Set *s); -extern Set *union_int_set(int i, const Set *s); -extern SpanSet *union_int_span(int i, const Span *s); -extern SpanSet *union_int_spanset(int i, SpanSet *ss); -extern Set *union_set_bigint(const Set *s, int64 i); -extern Set *union_set_date(const Set *s, DateADT d); -extern Set *union_set_float(const Set *s, double d); -extern Set *union_set_geo(const Set *s, const GSERIALIZED *gs); -extern Set *union_set_int(const Set *s, int i); -extern Set *union_set_set(const Set *s1, const Set *s2); -extern Set *union_set_text(const Set *s, const text *txt); -extern Set *union_set_timestamptz(const Set *s, const TimestampTz t); -extern SpanSet *union_span_bigint(const Span *s, int64 i); -extern SpanSet *union_span_date(const Span *s, DateADT d); -extern SpanSet *union_span_float(const Span *s, double d); -extern SpanSet *union_span_int(const Span *s, int i); -extern SpanSet *union_span_span(const Span *s1, const Span *s2); -extern SpanSet *union_span_spanset(const Span *s, const SpanSet *ss); -extern SpanSet *union_span_timestamptz(const Span *s, TimestampTz t); -extern SpanSet *union_spanset_bigint(const SpanSet *ss, int64 i); -extern SpanSet *union_spanset_date(const SpanSet *ss, DateADT d); -extern SpanSet *union_spanset_float(const SpanSet *ss, double d); -extern SpanSet *union_spanset_int(const SpanSet *ss, int i); -extern SpanSet *union_spanset_span(const SpanSet *ss, const Span *s); -extern SpanSet *union_spanset_spanset(const SpanSet *ss1, const SpanSet *ss2); -extern SpanSet *union_spanset_timestamptz(const SpanSet *ss, TimestampTz t); -extern Set *union_text_set(const text *txt, const Set *s); -extern Set *union_timestamptz_set(const TimestampTz t, const Set *s); -extern SpanSet *union_timestamptz_span(TimestampTz t, const Span *s); -extern SpanSet *union_timestamptz_spanset(TimestampTz t, SpanSet *ss); +extern bool after_tbox_tnumber(const TBox *box, const Temporal *temp); +extern bool after_temporal_tstzspan(const Temporal *temp, const Span *s); +extern bool after_temporal_temporal(const Temporal *temp1, const Temporal *temp2); +extern bool after_tnumber_tbox(const Temporal *temp, const TBox *box); +extern bool after_tnumber_tnumber(const Temporal *temp1, const Temporal *temp2); +extern bool after_tstzspan_temporal(const Span *s, const Temporal *temp); +extern bool before_tbox_tnumber(const TBox *box, const Temporal *temp); +extern bool before_temporal_tstzspan(const Temporal *temp, const Span *s); +extern bool before_temporal_temporal(const Temporal *temp1, const Temporal *temp2); +extern bool before_tnumber_tbox(const Temporal *temp, const TBox *box); +extern bool before_tnumber_tnumber(const Temporal *temp1, const Temporal *temp2); +extern bool before_tstzspan_temporal(const Span *s, const Temporal *temp); +extern bool left_tbox_tnumber(const TBox *box, const Temporal *temp); +extern bool left_numspan_tnumber(const Span *s, const Temporal *temp); +extern bool left_tnumber_numspan(const Temporal *temp, const Span *s); +extern bool left_tnumber_tbox(const Temporal *temp, const TBox *box); +extern bool left_tnumber_tnumber(const Temporal *temp1, const Temporal *temp2); +extern bool overafter_tbox_tnumber(const TBox *box, const Temporal *temp); +extern bool overafter_temporal_tstzspan(const Temporal *temp, const Span *s); +extern bool overafter_temporal_temporal(const Temporal *temp1, const Temporal *temp2); +extern bool overafter_tnumber_tbox(const Temporal *temp, const TBox *box); +extern bool overafter_tnumber_tnumber(const Temporal *temp1, const Temporal *temp2); +extern bool overafter_tstzspan_temporal(const Span *s, const Temporal *temp); +extern bool overbefore_tbox_tnumber(const TBox *box, const Temporal *temp); +extern bool overbefore_temporal_tstzspan(const Temporal *temp, const Span *s); +extern bool overbefore_temporal_temporal(const Temporal *temp1, const Temporal *temp2); +extern bool overbefore_tnumber_tbox(const Temporal *temp, const TBox *box); +extern bool overbefore_tnumber_tnumber(const Temporal *temp1, const Temporal *temp2); +extern bool overbefore_tstzspan_temporal(const Span *s, const Temporal *temp); +extern bool overleft_numspan_tnumber(const Span *s, const Temporal *temp); +extern bool overleft_tbox_tnumber(const TBox *box, const Temporal *temp); +extern bool overleft_tnumber_numspan(const Temporal *temp, const Span *s); +extern bool overleft_tnumber_tbox(const Temporal *temp, const TBox *box); +extern bool overleft_tnumber_tnumber(const Temporal *temp1, const Temporal *temp2); +extern bool overright_numspan_tnumber(const Span *s, const Temporal *temp); +extern bool overright_tbox_tnumber(const TBox *box, const Temporal *temp); +extern bool overright_tnumber_numspan(const Temporal *temp, const Span *s); +extern bool overright_tnumber_tbox(const Temporal *temp, const TBox *box); +extern bool overright_tnumber_tnumber(const Temporal *temp1, const Temporal *temp2); +extern bool right_numspan_tnumber(const Span *s, const Temporal *temp); +extern bool right_tbox_tnumber(const TBox *box, const Temporal *temp); +extern bool right_tnumber_numspan(const Temporal *temp, const Span *s); +extern bool right_tnumber_tbox(const Temporal *temp, const TBox *box); +extern bool right_tnumber_tnumber(const Temporal *temp1, const Temporal *temp2); + +extern Temporal *tand_bool_tbool(bool b, const Temporal *temp); +extern Temporal *tand_tbool_bool(const Temporal *temp, bool b); +extern Temporal *tand_tbool_tbool(const Temporal *temp1, const Temporal *temp2); +extern SpanSet *tbool_when_true(const Temporal *temp); +extern Temporal *tnot_tbool(const Temporal *temp); +extern Temporal *tor_bool_tbool(bool b, const Temporal *temp); +extern Temporal *tor_tbool_bool(const Temporal *temp, bool b); +extern Temporal *tor_tbool_tbool(const Temporal *temp1, const Temporal *temp2); + +extern Temporal *add_float_tfloat(double d, const Temporal *tnumber); +extern Temporal *add_int_tint(int i, const Temporal *tnumber); +extern Temporal *add_tfloat_float(const Temporal *tnumber, double d); +extern Temporal *add_tint_int(const Temporal *tnumber, int i); +extern Temporal *add_tnumber_tnumber(const Temporal *tnumber1, const Temporal *tnumber2); +extern Temporal *div_float_tfloat(double d, const Temporal *tnumber); +extern Temporal *div_int_tint(int i, const Temporal *tnumber); +extern Temporal *div_tfloat_float(const Temporal *tnumber, double d); +extern Temporal *div_tint_int(const Temporal *tnumber, int i); +extern Temporal *div_tnumber_tnumber(const Temporal *tnumber1, const Temporal *tnumber2); +extern Temporal *mult_float_tfloat(double d, const Temporal *tnumber); +extern Temporal *mult_int_tint(int i, const Temporal *tnumber); +extern Temporal *mult_tfloat_float(const Temporal *tnumber, double d); +extern Temporal *mult_tint_int(const Temporal *tnumber, int i); +extern Temporal *mult_tnumber_tnumber(const Temporal *tnumber1, const Temporal *tnumber2); +extern Temporal *sub_float_tfloat(double d, const Temporal *tnumber); +extern Temporal *sub_int_tint(int i, const Temporal *tnumber); +extern Temporal *sub_tfloat_float(const Temporal *tnumber, double d); +extern Temporal *sub_tint_int(const Temporal *tnumber, int i); +extern Temporal *sub_tnumber_tnumber(const Temporal *tnumber1, const Temporal *tnumber2); +extern Temporal *temporal_derivative(const Temporal *temp); +extern Temporal *tfloat_exp(const Temporal *temp); +extern Temporal *tfloat_ln(const Temporal *temp); +extern Temporal *tfloat_log10(const Temporal *temp); +extern Temporal *tnumber_abs(const Temporal *temp); +extern double float_angular_difference(double degrees1, double degrees2); +extern Temporal *tnumber_angular_difference(const Temporal *temp); +extern Temporal *tnumber_delta_value(const Temporal *temp); + +extern Temporal *textcat_text_ttext(const text *txt, const Temporal *temp); +extern Temporal *textcat_ttext_text(const Temporal *temp, const text *txt); +extern Temporal *textcat_ttext_ttext(const Temporal *temp1, const Temporal *temp2); +extern Temporal *ttext_initcap(const Temporal *temp); +extern Temporal *ttext_upper(const Temporal *temp); +extern Temporal *ttext_lower(const Temporal *temp); + +extern Temporal *tdistance_tfloat_float(const Temporal *temp, double d); +extern Temporal *tdistance_tint_int(const Temporal *temp, int i); +extern Temporal *tdistance_tnumber_tnumber(const Temporal *temp1, const Temporal *temp2); +extern double nad_tboxfloat_tboxfloat(const TBox *box1, const TBox *box2); +extern int nad_tboxint_tboxint(const TBox *box1, const TBox *box2); +extern double nad_tfloat_float(const Temporal *temp, double d); +extern double nad_tfloat_tfloat(const Temporal *temp1, const Temporal *temp2); +extern double nad_tfloat_tbox(const Temporal *temp, const TBox *box); +extern int nad_tint_int(const Temporal *temp, int i); +extern int nad_tint_tbox(const Temporal *temp, const TBox *box); +extern int nad_tint_tint(const Temporal *temp1, const Temporal *temp2); + +extern SkipList *tbool_tand_transfn(SkipList *state, const Temporal *temp); +extern SkipList *tbool_tor_transfn(SkipList *state, const Temporal *temp); +extern Span *temporal_extent_transfn(Span *s, const Temporal *temp); +extern Temporal *temporal_tagg_finalfn(SkipList *state); +extern SkipList *temporal_tcount_transfn(SkipList *state, const Temporal *temp); +extern SkipList *tfloat_tmax_transfn(SkipList *state, const Temporal *temp); +extern SkipList *tfloat_tmin_transfn(SkipList *state, const Temporal *temp); +extern SkipList *tfloat_tsum_transfn(SkipList *state, const Temporal *temp); +extern SkipList *tfloat_wmax_transfn(SkipList *state, const Temporal *temp, const Interval *interv); +extern SkipList *tfloat_wmin_transfn(SkipList *state, const Temporal *temp, const Interval *interv); +extern SkipList *tfloat_wsum_transfn(SkipList *state, const Temporal *temp, const Interval *interv); +extern SkipList *timestamptz_tcount_transfn(SkipList *state, TimestampTz t); +extern SkipList *tint_tmax_transfn(SkipList *state, const Temporal *temp); +extern SkipList *tint_tmin_transfn(SkipList *state, const Temporal *temp); +extern SkipList *tint_tsum_transfn(SkipList *state, const Temporal *temp); +extern SkipList *tint_wmax_transfn(SkipList *state, const Temporal *temp, const Interval *interv); +extern SkipList *tint_wmin_transfn(SkipList *state, const Temporal *temp, const Interval *interv); +extern SkipList *tint_wsum_transfn(SkipList *state, const Temporal *temp, const Interval *interv); +extern TBox *tnumber_extent_transfn(TBox *box, const Temporal *temp); +extern Temporal *tnumber_tavg_finalfn(SkipList *state); +extern SkipList *tnumber_tavg_transfn(SkipList *state, const Temporal *temp); +extern SkipList *tnumber_wavg_transfn(SkipList *state, const Temporal *temp, const Interval *interv); +extern SkipList *tstzset_tcount_transfn(SkipList *state, const Set *s); +extern SkipList *tstzspan_tcount_transfn(SkipList *state, const Span *s); +extern SkipList *tstzspanset_tcount_transfn(SkipList *state, const SpanSet *ss); +extern SkipList *ttext_tmax_transfn(SkipList *state, const Temporal *temp); +extern SkipList *ttext_tmin_transfn(SkipList *state, const Temporal *temp); + +extern Temporal *temporal_simplify_dp(const Temporal *temp, double eps_dist, bool synchronized); +extern Temporal *temporal_simplify_max_dist(const Temporal *temp, double eps_dist, bool synchronized); +extern Temporal *temporal_simplify_min_dist(const Temporal *temp, double dist); +extern Temporal *temporal_simplify_min_tdelta(const Temporal *temp, const Interval *mint); + +extern Temporal *temporal_tprecision(const Temporal *temp, const Interval *duration, TimestampTz origin); +extern Temporal *temporal_tsample(const Temporal *temp, const Interval *duration, TimestampTz origin, interpType interp); + +extern double temporal_dyntimewarp_distance(const Temporal *temp1, const Temporal *temp2); +extern Match *temporal_dyntimewarp_path(const Temporal *temp1, const Temporal *temp2, int *count); +extern double temporal_frechet_distance(const Temporal *temp1, const Temporal *temp2); +extern Match *temporal_frechet_path(const Temporal *temp1, const Temporal *temp2, int *count); +extern double temporal_hausdorff_distance(const Temporal *temp1, const Temporal *temp2); + +extern Span *temporal_time_bins(const Temporal *temp, const Interval *duration, TimestampTz origin, int *count); +extern Temporal **temporal_time_split(const Temporal *temp, const Interval *duration, TimestampTz torigin, TimestampTz **time_bins, int *count); +extern TBox *tfloat_time_boxes(const Temporal *temp, const Interval *duration, TimestampTz torigin, int *count); +extern Span *tfloat_value_bins(const Temporal *temp, double vsize, double vorigin, int *count); +extern TBox *tfloat_value_boxes(const Temporal *temp, double vsize, double vorigin, int *count); +extern Temporal **tfloat_value_split(const Temporal *temp, double size, double origin, double **bins, int *count); +extern TBox *tfloat_value_time_boxes(const Temporal *temp, double vsize, const Interval *duration, double vorigin, TimestampTz torigin, int *count); +extern Temporal **tfloat_value_time_split(const Temporal *temp, double vsize, const Interval *duration, double vorigin, TimestampTz torigin, double **value_bins, TimestampTz **time_bins, int *count); +extern TBox *tfloatbox_time_tiles(const TBox *box, const Interval *duration, TimestampTz torigin, int *count); +extern TBox *tfloatbox_value_tiles(const TBox *box, double vsize, double vorigin, int *count); +extern TBox *tfloatbox_value_time_tiles(const TBox *box, double vsize, const Interval *duration, double vorigin, TimestampTz torigin, int *count); +extern TBox *tint_time_boxes(const Temporal *temp, const Interval *duration, TimestampTz torigin, int *count); +extern Span *tint_value_bins(const Temporal *temp, int vsize, int vorigin, int *count); +extern TBox *tint_value_boxes(const Temporal *temp, int vsize, int vorigin, int *count); +extern Temporal **tint_value_split(const Temporal *temp, int vsize, int vorigin, int **bins, int *count); +extern TBox *tint_value_time_boxes(const Temporal *temp, int vsize, const Interval *duration, int vorigin, TimestampTz torigin, int *count); +extern Temporal **tint_value_time_split(const Temporal *temp, int size, const Interval *duration, int vorigin, TimestampTz torigin, int **value_bins, TimestampTz **time_bins, int *count); +extern TBox *tintbox_time_tiles(const TBox *box, const Interval *duration, TimestampTz torigin, int *count); +extern TBox *tintbox_value_tiles(const TBox *box, int xsize, int xorigin, int *count); +extern TBox *tintbox_value_time_tiles(const TBox *box, int xsize, const Interval *duration, int xorigin, TimestampTz torigin, int *count); + +//-------------------- meos_catalog.h -------------------- + + +//#include + +typedef signed short int16; + +//#include + +typedef enum +{ + T_UNKNOWN = 0, + T_BOOL = 1, + T_DATE = 2, + T_DATEMULTIRANGE = 3, + T_DATERANGE = 4, + T_DATESET = 5, + T_DATESPAN = 6, + T_DATESPANSET = 7, + T_DOUBLE2 = 8, + T_DOUBLE3 = 9, + T_DOUBLE4 = 10, + T_FLOAT8 = 11, + T_FLOATSET = 12, + T_FLOATSPAN = 13, + T_FLOATSPANSET = 14, + T_INT4 = 15, + T_INT4MULTIRANGE = 16, + T_INT4RANGE = 17, + T_INTSET = 18, + T_INTSPAN = 19, + T_INTSPANSET = 20, + T_INT8 = 21, + T_INT8MULTIRANGE = 52, + T_INT8RANGE = 53, + T_BIGINTSET = 22, + T_BIGINTSPAN = 23, + T_BIGINTSPANSET = 24, + T_STBOX = 25, + T_TBOOL = 26, + T_TBOX = 27, + T_TDOUBLE2 = 28, + T_TDOUBLE3 = 29, + T_TDOUBLE4 = 30, + T_TEXT = 31, + T_TEXTSET = 32, + T_TFLOAT = 33, + T_TIMESTAMPTZ = 34, + T_TINT = 35, + T_TSTZMULTIRANGE = 36, + T_TSTZRANGE = 37, + T_TSTZSET = 38, + T_TSTZSPAN = 39, + T_TSTZSPANSET = 40, + T_TTEXT = 41, + T_GEOMETRY = 42, + T_GEOMSET = 43, + T_GEOGRAPHY = 44, + T_GEOGSET = 45, + T_TGEOMPOINT = 46, + T_TGEOGPOINT = 47, + T_NPOINT = 48, + T_NPOINTSET = 49, + T_NSEGMENT = 50, + T_TNPOINT = 51, + T_POSE = 54, + T_POSESET = 55, + T_TPOSE = 56, + T_CBUFFER = 57, + T_CBUFFERSET = 58, + T_TCBUFFER = 59, + T_TGEOMETRY = 60, + T_TGEOGRAPHY = 61, + T_TRGEOMETRY = 62, +} meosType; + +#define NO_MEOS_TYPES 63 +typedef enum +{ + UNKNOWN_OP = 0, + EQ_OP = 1, + NE_OP = 2, + LT_OP = 3, + LE_OP = 4, + GT_OP = 5, + GE_OP = 6, + ADJACENT_OP = 7, + UNION_OP = 8, + MINUS_OP = 9, + INTERSECT_OP = 10, + OVERLAPS_OP = 11, + CONTAINS_OP = 12, + CONTAINED_OP = 13, + SAME_OP = 14, + LEFT_OP = 15, + OVERLEFT_OP = 16, + RIGHT_OP = 17, + OVERRIGHT_OP = 18, + BELOW_OP = 19, + OVERBELOW_OP = 20, + ABOVE_OP = 21, + OVERABOVE_OP = 22, + FRONT_OP = 23, + OVERFRONT_OP = 24, + BACK_OP = 25, + OVERBACK_OP = 26, + BEFORE_OP = 27, + OVERBEFORE_OP = 28, + AFTER_OP = 29, + OVERAFTER_OP = 30, + EVEREQ_OP = 31, + EVERNE_OP = 32, + EVERLT_OP = 33, + EVERLE_OP = 34, + EVERGT_OP = 35, + EVERGE_OP = 36, + ALWAYSEQ_OP = 37, + ALWAYSNE_OP = 38, + ALWAYSLT_OP = 39, + ALWAYSLE_OP = 40, + ALWAYSGT_OP = 41, + ALWAYSGE_OP = 42, +} meosOper; + +typedef struct +{ + meosType temptype; + meosType basetype; +} temptype_catalog_struct; + +typedef struct +{ + meosType settype; + meosType basetype; +} settype_catalog_struct; + +typedef struct +{ + meosType spantype; + meosType basetype; +} spantype_catalog_struct; + +typedef struct +{ + meosType spansettype; + meosType spantype; +} spansettype_catalog_struct; + +/* extern bool temptype_subtype(tempSubtype subtype); (undefined) */ +/* extern bool temptype_subtype_all(tempSubtype subtype); (undefined) */ + +extern const char *tempsubtype_name(tempSubtype subtype); +extern bool tempsubtype_from_string(const char *str, int16 *subtype); +extern const char *meosoper_name(meosOper oper); +extern meosOper meosoper_from_string(const char *name); +extern const char *interptype_name(interpType interp); +extern interpType interptype_from_string(const char *interp_str); + +extern const char *meostype_name(meosType type); +extern meosType temptype_basetype(meosType type); +extern meosType settype_basetype(meosType type); +extern meosType spantype_basetype(meosType type); +extern meosType spantype_spansettype(meosType type); +extern meosType spansettype_spantype(meosType type); +extern meosType basetype_spantype(meosType type); +extern meosType basetype_settype(meosType type); -extern int64 distance_bigintset_bigintset(const Set *s1, const Set *s2); -extern int64 distance_bigintspan_bigintspan(const Span *s1, const Span *s2); -extern int64 distance_bigintspanset_bigintspan(const SpanSet *ss, const Span *s); -extern int64 distance_bigintspanset_bigintspanset(const SpanSet *ss1, const SpanSet *ss2); -extern int distance_dateset_dateset(const Set *s1, const Set *s2); -extern int distance_datespan_datespan(const Span *s1, const Span *s2); -extern int distance_datespanset_datespan(const SpanSet *ss, const Span *s); -extern int distance_datespanset_datespanset(const SpanSet *ss1, const SpanSet *ss2); -extern double distance_floatset_floatset(const Set *s1, const Set *s2); -extern double distance_floatspan_floatspan(const Span *s1, const Span *s2); -extern double distance_floatspanset_floatspan(const SpanSet *ss, const Span *s); -extern double distance_floatspanset_floatspanset(const SpanSet *ss1, const SpanSet *ss2); -extern int distance_intset_intset(const Set *s1, const Set *s2); -extern int distance_intspan_intspan(const Span *s1, const Span *s2); -extern int distance_intspanset_intspan(const SpanSet *ss, const Span *s); -extern int distance_intspanset_intspanset(const SpanSet *ss1, const SpanSet *ss2); -extern int64 distance_set_bigint(const Set *s, int64 i); -extern int distance_set_date(const Set *s, DateADT d); -extern double distance_set_float(const Set *s, double d); -extern int distance_set_int(const Set *s, int i); -extern double distance_set_timestamptz(const Set *s, TimestampTz t); -extern int64 distance_span_bigint(const Span *s, int64 i); -extern int distance_span_date(const Span *s, DateADT d); -extern double distance_span_float(const Span *s, double d); -extern int distance_span_int(const Span *s, int i); -extern double distance_span_timestamptz(const Span *s, TimestampTz t); -extern int64 distance_spanset_bigint(const SpanSet *ss, int64 i); -extern int distance_spanset_date(const SpanSet *ss, DateADT d); -extern double distance_spanset_float(const SpanSet *ss, double d); -extern int distance_spanset_int(const SpanSet *ss, int i); -extern double distance_spanset_timestamptz(const SpanSet *ss, TimestampTz t); -extern double distance_tstzset_tstzset(const Set *s1, const Set *s2); -extern double distance_tstzspan_tstzspan(const Span *s1, const Span *s2); -extern double distance_tstzspanset_tstzspan(const SpanSet *ss, const Span *s); -extern double distance_tstzspanset_tstzspanset(const SpanSet *ss1, const SpanSet *ss2); +extern bool tnumber_basetype(meosType type); +extern bool geo_basetype(meosType type); +/* extern bool meos_basetype(meosType type); (undefined) */ +/* extern bool alphanum_basetype(meosType type); (undefined) */ +/* extern bool alphanum_temptype(meosType type); (undefined) */ -extern Span *bigint_extent_transfn(Span *state, int64 i); -extern Set *bigint_union_transfn(Set *state, int64 i); -extern Span *date_extent_transfn(Span *state, DateADT d); -extern Set *date_union_transfn(Set *state, DateADT d); -extern Span *float_extent_transfn(Span *state, double d); -extern Set *float_union_transfn(Set *state, double d); -extern Span *int_extent_transfn(Span *state, int i); -extern Set *int_union_transfn(Set *state, int32 i); -extern Span *set_extent_transfn(Span *state, const Set *s); -extern Set *set_union_finalfn(Set *state); -extern Set *set_union_transfn(Set *state, Set *s); -extern Span *span_extent_transfn(Span *state, const Span *s); -extern SpanSet *span_union_transfn(SpanSet *state, const Span *s); -extern Span *spanset_extent_transfn(Span *state, const SpanSet *ss); -extern SpanSet *spanset_union_finalfn(SpanSet *state); -extern SpanSet *spanset_union_transfn(SpanSet *state, const SpanSet *ss); -extern Set *text_union_transfn(Set *state, const text *txt); -extern Span *timestamptz_extent_transfn(Span *state, TimestampTz t); -extern Set *timestamptz_union_transfn(Set *state, TimestampTz t); +extern bool time_type(meosType type); +/* extern bool set_basetype(meosType type); (undefined) */ -extern TBox *tbox_in(const char *str); -extern char *tbox_out(const TBox *box, int maxdd); -extern TBox *tbox_from_wkb(const uint8_t *wkb, size_t size); -extern TBox *tbox_from_hexwkb(const char *hexwkb); -extern STBox *stbox_from_wkb(const uint8_t *wkb, size_t size); -extern STBox *stbox_from_hexwkb(const char *hexwkb); -extern uint8_t *tbox_as_wkb(const TBox *box, uint8_t variant, size_t *size_out); -extern char *tbox_as_hexwkb(const TBox *box, uint8_t variant, size_t *size); -extern uint8_t *stbox_as_wkb(const STBox *box, uint8_t variant, size_t *size_out); -extern char *stbox_as_hexwkb(const STBox *box, uint8_t variant, size_t *size); -extern STBox *stbox_in(const char *str); -extern char *stbox_out(const STBox *box, int maxdd); +extern bool set_type(meosType type); +extern bool numset_type(meosType type); +extern bool ensure_numset_type(meosType type); +extern bool timeset_type(meosType type); +extern bool set_spantype(meosType type); +extern bool ensure_set_spantype(meosType type); +extern bool alphanumset_type(meosType settype); +extern bool geoset_type(meosType type); +extern bool ensure_geoset_type(meosType type); +extern bool spatialset_type(meosType type); +extern bool ensure_spatialset_type(meosType type); -extern TBox *float_tstzspan_to_tbox(double d, const Span *s); -extern TBox *float_timestamptz_to_tbox(double d, TimestampTz t); -extern STBox *geo_tstzspan_to_stbox(const GSERIALIZED *gs, const Span *s); -extern STBox *geo_timestamptz_to_stbox(const GSERIALIZED *gs, TimestampTz t); -extern TBox *int_tstzspan_to_tbox(int i, const Span *s); -extern TBox *int_timestamptz_to_tbox(int i, TimestampTz t); -extern TBox *numspan_tstzspan_to_tbox(const Span *span, const Span *s); -extern TBox *numspan_timestamptz_to_tbox(const Span *span, TimestampTz t); -extern STBox *stbox_copy(const STBox *box); -extern STBox *stbox_make(bool hasx, bool hasz, bool geodetic, int32 srid, double xmin, double xmax, double ymin, double ymax, double zmin, double zmax, const Span *s); -extern TBox *tbox_copy(const TBox *box); -extern TBox *tbox_make(const Span *s, const Span *p); +extern bool span_basetype(meosType type); +extern bool span_canon_basetype(meosType type); +extern bool span_type(meosType type); +extern bool type_span_bbox(meosType type); +extern bool span_tbox_type(meosType type); +extern bool ensure_span_tbox_type(meosType type); +extern bool numspan_basetype(meosType type); +extern bool numspan_type(meosType type); +extern bool ensure_numspan_type(meosType type); +extern bool timespan_basetype(meosType type); +extern bool timespan_type(meosType type); -extern TBox *float_to_tbox(double d); -extern STBox *geo_to_stbox(const GSERIALIZED *gs); -extern TBox *int_to_tbox(int i); -extern TBox *set_to_tbox(const Set *s); -extern TBox *span_to_tbox(const Span *s); -extern TBox *spanset_to_tbox(const SpanSet *ss); -extern STBox *spatialset_to_stbox(const Set *s); -extern GBOX *stbox_to_gbox(const STBox *box); -extern BOX3D *stbox_to_box3d(const STBox *box); -extern GSERIALIZED *stbox_to_geo(const STBox *box); -extern Span *stbox_to_tstzspan(const STBox *box); -extern Span *tbox_to_intspan(const TBox *box); -extern Span *tbox_to_floatspan(const TBox *box); -extern Span *tbox_to_tstzspan(const TBox *box); -extern STBox *timestamptz_to_stbox(TimestampTz t); -extern TBox *timestamptz_to_tbox(TimestampTz t); -extern STBox *tstzset_to_stbox(const Set *s); -extern STBox *tstzspan_to_stbox(const Span *s); -extern STBox *tstzspanset_to_stbox(const SpanSet *ss); -extern TBox *tnumber_to_tbox(const Temporal *temp); -extern STBox *tpoint_to_stbox(const Temporal *temp); +extern bool spanset_type(meosType type); +extern bool timespanset_type(meosType type); +extern bool ensure_timespanset_type(meosType type); -extern double stbox_area(const STBox *box, bool spheroid); -extern bool stbox_hast(const STBox *box); -extern bool stbox_hasx(const STBox *box); -extern bool stbox_hasz(const STBox *box); -extern bool stbox_isgeodetic(const STBox *box); -extern double stbox_perimeter(const STBox *box, bool spheroid); -extern int32_t stbox_srid(const STBox *box); -extern bool stbox_tmax(const STBox *box, TimestampTz *result); -extern bool stbox_tmax_inc(const STBox *box, bool *result); -extern bool stbox_tmin(const STBox *box, TimestampTz *result); -extern bool stbox_tmin_inc(const STBox *box, bool *result); -extern double stbox_volume(const STBox *box); -extern bool stbox_xmax(const STBox *box, double *result); -extern bool stbox_xmin(const STBox *box, double *result); -extern bool stbox_ymax(const STBox *box, double *result); -extern bool stbox_ymin(const STBox *box, double *result); -extern bool stbox_zmax(const STBox *box, double *result); -extern bool stbox_zmin(const STBox *box, double *result); -extern bool tbox_hast(const TBox *box); -extern bool tbox_hasx(const TBox *box); -extern bool tbox_tmax(const TBox *box, TimestampTz *result); -extern bool tbox_tmax_inc(const TBox *box, bool *result); -extern bool tbox_tmin(const TBox *box, TimestampTz *result); -extern bool tbox_tmin_inc(const TBox *box, bool *result); -extern bool tbox_xmax(const TBox *box, double *result); -extern bool tbox_xmax_inc(const TBox *box, bool *result); -extern bool tbox_xmin(const TBox *box, double *result); -extern bool tbox_xmin_inc(const TBox *box, bool *result); -extern bool tboxfloat_xmax(const TBox *box, double *result); -extern bool tboxfloat_xmin(const TBox *box, double *result); -extern bool tboxint_xmax(const TBox *box, int *result); -extern bool tboxint_xmin(const TBox *box, int *result); +extern bool temporal_type(meosType type); +/* extern bool temporal_basetype(meosType type); (undefined) */ -extern STBox *stbox_expand_space(const STBox *box, double d); -extern STBox *stbox_expand_time(const STBox *box, const Interval *interv); -extern STBox *stbox_get_space(const STBox *box); -extern STBox *stbox_quad_split(const STBox *box, int *count); -extern STBox *stbox_round(const STBox *box, int maxdd); -extern STBox *stbox_set_srid(const STBox *box, int32_t srid); -extern STBox *stbox_shift_scale_time(const STBox *box, const Interval *shift, const Interval *duration); -extern STBox *stbox_transform(const STBox *box, int32_t srid); -extern STBox *stbox_transform_pipeline(const STBox *box, const char *pipelinestr, int32_t srid, bool is_forward); -extern STBox *stboxarr_round(const STBox *boxarr, int count, int maxdd); -extern TBox *tbox_expand_time(const TBox *box, const Interval *interv); -extern TBox *tbox_expand_float(const TBox *box, const double d); -extern TBox *tbox_expand_int(const TBox *box, const int i); -extern TBox *tbox_round(const TBox *box, int maxdd); -extern TBox *tbox_shift_scale_float(const TBox *box, double shift, double width, bool hasshift, bool haswidth); -extern TBox *tbox_shift_scale_int(const TBox *box, int shift, int width, bool hasshift, bool haswidth); -extern TBox *tbox_shift_scale_time(const TBox *box, const Interval *shift, const Interval *duration); +extern bool temptype_continuous(meosType type); +extern bool basetype_byvalue(meosType type); +extern bool basetype_varlength(meosType type); +extern int16 basetype_length(meosType type); +/* extern bool talphanum_type(meosType type); (undefined) */ -extern TBox *union_tbox_tbox(const TBox *box1, const TBox *box2, bool strict); -extern TBox *intersection_tbox_tbox(const TBox *box1, const TBox *box2); -extern STBox *union_stbox_stbox(const STBox *box1, const STBox *box2, bool strict); -extern STBox *intersection_stbox_stbox(const STBox *box1, const STBox *box2); +extern bool talpha_type(meosType type); +extern bool tnumber_type(meosType type); +extern bool ensure_tnumber_type(meosType type); +extern bool ensure_tnumber_basetype(meosType type); +extern bool tnumber_spantype(meosType type); +extern bool spatial_basetype(meosType type); +extern bool tspatial_type(meosType type); +extern bool ensure_tspatial_type(meosType type); +extern bool tpoint_type(meosType type); +extern bool ensure_tpoint_type(meosType type); +extern bool tgeo_type(meosType type); +extern bool ensure_tgeo_type(meosType type); +extern bool tgeo_type_all(meosType type); +extern bool ensure_tgeo_type_all(meosType type); +extern bool tgeometry_type(meosType type); +extern bool ensure_tgeometry_type(meosType type); +extern bool tgeodetic_type(meosType type); +extern bool ensure_tgeodetic_type(meosType type); +extern bool ensure_tnumber_tpoint_type(meosType type); + + + +//-------------------- meos_geo.h -------------------- + + +//#include +//#include + +typedef uint16_t lwflags_t; + +typedef struct { + double afac, bfac, cfac, dfac, efac, ffac, gfac, hfac, ifac, xoff, yoff, zoff; +} AFFINE; + +typedef struct +{ + double xmin, ymin, zmin; + double xmax, ymax, zmax; + int32_t srid; +} +BOX3D; + +typedef struct +{ + lwflags_t flags; + double xmin; + double xmax; + double ymin; + double ymax; + double zmin; + double zmax; + double mmin; + double mmax; +} GBOX; + +typedef struct +{ + double a; + double b; + double f; + double e; + double e_sq; + double radius; + char name[20]; +} +SPHEROID; + +typedef struct +{ + double x, y; +} +POINT2D; + +typedef struct +{ + double x, y, z; +} +POINT3DZ; + +typedef struct +{ + double x, y, z; +} +POINT3D; -extern RTree * rtree_create_stbox(); -extern void rtree_insert (RTree *rtree ,STBox *box, int64 id); -extern int * rtree_search ( const RTree* rtree,const STBox * query, int * count); -extern void rtree_free(RTree* rtree); +typedef struct +{ + double x, y, m; +} +POINT3DM; -extern bool adjacent_stbox_stbox(const STBox *box1, const STBox *box2); -extern bool adjacent_tbox_tbox(const TBox *box1, const TBox *box2); -extern bool contained_tbox_tbox(const TBox *box1, const TBox *box2); -extern bool contained_stbox_stbox(const STBox *box1, const STBox *box2); -extern bool contains_stbox_stbox(const STBox *box1, const STBox *box2); -extern bool contains_tbox_tbox(const TBox *box1, const TBox *box2); -extern bool overlaps_tbox_tbox(const TBox *box1, const TBox *box2); -extern bool overlaps_stbox_stbox(const STBox *box1, const STBox *box2); -extern bool same_tbox_tbox(const TBox *box1, const TBox *box2); -extern bool same_stbox_stbox(const STBox *box1, const STBox *box2); +typedef struct +{ + double x, y, z, m; +} +POINT4D; -extern bool left_tbox_tbox(const TBox *box1, const TBox *box2); -extern bool overleft_tbox_tbox(const TBox *box1, const TBox *box2); -extern bool right_tbox_tbox(const TBox *box1, const TBox *box2); -extern bool overright_tbox_tbox(const TBox *box1, const TBox *box2); -extern bool before_tbox_tbox(const TBox *box1, const TBox *box2); -extern bool overbefore_tbox_tbox(const TBox *box1, const TBox *box2); -extern bool after_tbox_tbox(const TBox *box1, const TBox *box2); -extern bool overafter_tbox_tbox(const TBox *box1, const TBox *box2); -extern bool left_stbox_stbox(const STBox *box1, const STBox *box2); -extern bool overleft_stbox_stbox(const STBox *box1, const STBox *box2); -extern bool right_stbox_stbox(const STBox *box1, const STBox *box2); -extern bool overright_stbox_stbox(const STBox *box1, const STBox *box2); -extern bool below_stbox_stbox(const STBox *box1, const STBox *box2); -extern bool overbelow_stbox_stbox(const STBox *box1, const STBox *box2); -extern bool above_stbox_stbox(const STBox *box1, const STBox *box2); -extern bool overabove_stbox_stbox(const STBox *box1, const STBox *box2); -extern bool front_stbox_stbox(const STBox *box1, const STBox *box2); -extern bool overfront_stbox_stbox(const STBox *box1, const STBox *box2); -extern bool back_stbox_stbox(const STBox *box1, const STBox *box2); -extern bool overback_stbox_stbox(const STBox *box1, const STBox *box2); -extern bool before_stbox_stbox(const STBox *box1, const STBox *box2); -extern bool overbefore_stbox_stbox(const STBox *box1, const STBox *box2); -extern bool after_stbox_stbox(const STBox *box1, const STBox *box2); -extern bool overafter_stbox_stbox(const STBox *box1, const STBox *box2); +typedef struct +{ + uint32_t npoints; + uint32_t maxpoints; -extern bool tbox_eq(const TBox *box1, const TBox *box2); -extern bool tbox_ne(const TBox *box1, const TBox *box2); -extern int tbox_cmp(const TBox *box1, const TBox *box2); -extern bool tbox_lt(const TBox *box1, const TBox *box2); -extern bool tbox_le(const TBox *box1, const TBox *box2); -extern bool tbox_ge(const TBox *box1, const TBox *box2); -extern bool tbox_gt(const TBox *box1, const TBox *box2); -extern bool stbox_eq(const STBox *box1, const STBox *box2); -extern bool stbox_ne(const STBox *box1, const STBox *box2); -extern int stbox_cmp(const STBox *box1, const STBox *box2); -extern bool stbox_lt(const STBox *box1, const STBox *box2); -extern bool stbox_le(const STBox *box1, const STBox *box2); -extern bool stbox_ge(const STBox *box1, const STBox *box2); -extern bool stbox_gt(const STBox *box1, const STBox *box2); + + lwflags_t flags; -extern Temporal *tbool_in(const char *str); -extern Temporal *tint_in(const char *str); -extern Temporal *tfloat_in(const char *str); -extern Temporal *ttext_in(const char *str); -extern Temporal *tgeompoint_in(const char *str); -extern Temporal *tgeogpoint_in(const char *str); -extern Temporal *tbool_from_mfjson(const char *str); -extern Temporal *tint_from_mfjson(const char *str); -extern Temporal *tfloat_from_mfjson(const char *str); -extern Temporal *ttext_from_mfjson(const char *str); -extern Temporal *tgeompoint_from_mfjson(const char *str); -extern Temporal *tgeogpoint_from_mfjson(const char *str); -extern Temporal *temporal_from_wkb(const uint8_t *wkb, size_t size); -extern Temporal *temporal_from_hexwkb(const char *hexwkb); + + uint8_t *serialized_pointlist; +} +POINTARRAY; -extern char *tbool_out(const Temporal *temp); -extern char *tint_out(const Temporal *temp); -extern char *tfloat_out(const Temporal *temp, int maxdd); -extern char *ttext_out(const Temporal *temp); -extern char *tpoint_out(const Temporal *temp, int maxdd); -extern char *tpoint_as_text(const Temporal *temp, int maxdd); -extern char *tpoint_as_ewkt(const Temporal *temp, int maxdd); -extern char *temporal_as_mfjson(const Temporal *temp, bool with_bbox, int flags, int precision, const char *srs); -extern uint8_t *temporal_as_wkb(const Temporal *temp, uint8_t variant, size_t *size_out); -extern char *temporal_as_hexwkb(const Temporal *temp, uint8_t variant, size_t *size_out); +typedef struct +{ + uint32_t size; + uint8_t srid[3]; + uint8_t gflags; + uint8_t data[1]; +} GSERIALIZED; -extern Temporal *tbool_from_base_temp(bool b, const Temporal *temp); -extern TInstant *tboolinst_make(bool b, TimestampTz t); -extern TSequence *tboolseq_from_base_tstzset(bool b, const Set *s); -extern TSequence *tboolseq_from_base_tstzspan(bool b, const Span *s); -extern TSequenceSet *tboolseqset_from_base_tstzspanset(bool b, const SpanSet *ss); -extern Temporal *temporal_copy(const Temporal *temp); -extern Temporal *tfloat_from_base_temp(double d, const Temporal *temp); -extern TInstant *tfloatinst_make(double d, TimestampTz t); -extern TSequence *tfloatseq_from_base_tstzspan(double d, const Span *s, interpType interp); -extern TSequence *tfloatseq_from_base_tstzset(double d, const Set *s); -extern TSequenceSet *tfloatseqset_from_base_tstzspanset(double d, const SpanSet *ss, interpType interp); -extern Temporal *tint_from_base_temp(int i, const Temporal *temp); -extern TInstant *tintinst_make(int i, TimestampTz t); -extern TSequence *tintseq_from_base_tstzspan(int i, const Span *s); -extern TSequence *tintseq_from_base_tstzset(int i, const Set *s); -extern TSequenceSet *tintseqset_from_base_tstzspanset(int i, const SpanSet *ss); -extern Temporal *tpoint_from_base_temp(const GSERIALIZED *gs, const Temporal *temp); -extern TInstant *tpointinst_make(const GSERIALIZED *gs, TimestampTz t); -extern TSequence *tpointseq_from_base_tstzspan(const GSERIALIZED *gs, const Span *s, interpType interp); -extern TSequence *tpointseq_from_base_tstzset(const GSERIALIZED *gs, const Set *s); -extern TSequenceSet *tpointseqset_from_base_tstzspanset(const GSERIALIZED *gs, const SpanSet *ss, interpType interp); -extern TSequence *tsequence_make(const TInstant **instants, int count, bool lower_inc, bool upper_inc, interpType interp, bool normalize); -extern TSequenceSet *tsequenceset_make(const TSequence **sequences, int count, bool normalize); -extern TSequenceSet *tsequenceset_make_gaps(const TInstant **instants, int count, interpType interp, const Interval *maxt, double maxdist); -extern Temporal *ttext_from_base_temp(const text *txt, const Temporal *temp); -extern TInstant *ttextinst_make(const text *txt, TimestampTz t); -extern TSequence *ttextseq_from_base_tstzspan(const text *txt, const Span *s); -extern TSequence *ttextseq_from_base_tstzset(const text *txt, const Set *s); -extern TSequenceSet *ttextseqset_from_base_tstzspanset(const text *txt, const SpanSet *ss); +typedef struct +{ + GBOX *bbox; + void *data; + int32_t srid; + lwflags_t flags; + uint8_t type; + char pad[1]; +} +LWGEOM; -extern Span *temporal_to_tstzspan(const Temporal *temp); -extern Temporal *tfloat_to_tint(const Temporal *temp); -extern Temporal *tint_to_tfloat(const Temporal *temp); -extern Span *tnumber_to_span(const Temporal *temp); +typedef struct +{ + GBOX *bbox; + POINTARRAY *point; + int32_t srid; + lwflags_t flags; + uint8_t type; + char pad[1]; +} +LWPOINT; -extern bool tbool_end_value(const Temporal *temp); -extern bool tbool_start_value(const Temporal *temp); -extern bool tbool_value_at_timestamptz(const Temporal *temp, TimestampTz t, bool strict, bool *value); -extern bool tbool_value_n(const Temporal *temp, int n, bool *result); -extern bool *tbool_values(const Temporal *temp, int *count); -extern Interval *temporal_duration(const Temporal *temp, bool boundspan); -extern TInstant *temporal_end_instant(const Temporal *temp); -extern TSequence *temporal_end_sequence(const Temporal *temp); -extern TimestampTz temporal_end_timestamptz(const Temporal *temp); -extern uint32 temporal_hash(const Temporal *temp); -extern TInstant *temporal_instant_n(const Temporal *temp, int n); -extern TInstant **temporal_instants(const Temporal *temp, int *count); -extern const char *temporal_interp(const Temporal *temp); -extern TInstant *temporal_max_instant(const Temporal *temp); -extern TInstant *temporal_min_instant(const Temporal *temp); -extern int temporal_num_instants(const Temporal *temp); -extern int temporal_num_sequences(const Temporal *temp); -extern int temporal_num_timestamps(const Temporal *temp); -extern TSequence **temporal_segments(const Temporal *temp, int *count); -extern TSequence *temporal_sequence_n(const Temporal *temp, int i); -extern TSequence **temporal_sequences(const Temporal *temp, int *count); -extern bool temporal_lower_inc(const Temporal *temp); -extern bool temporal_upper_inc(const Temporal *temp); -extern TInstant *temporal_start_instant(const Temporal *temp); -extern TSequence *temporal_start_sequence(const Temporal *temp); -extern TimestampTz temporal_start_timestamptz(const Temporal *temp); -extern TSequenceSet *temporal_stops(const Temporal *temp, double maxdist, const Interval *minduration); -extern const char *temporal_subtype(const Temporal *temp); -extern SpanSet *temporal_time(const Temporal *temp); -extern bool temporal_timestamptz_n(const Temporal *temp, int n, TimestampTz *result); -extern TimestampTz *temporal_timestamps(const Temporal *temp, int *count); -extern double tfloat_end_value(const Temporal *temp); -extern double tfloat_max_value(const Temporal *temp); -extern double tfloat_min_value(const Temporal *temp); -extern double tfloat_start_value(const Temporal *temp); -extern bool tfloat_value_at_timestamptz(const Temporal *temp, TimestampTz t, bool strict, double *value); -extern bool tfloat_value_n(const Temporal *temp, int n, double *result); -extern double *tfloat_values(const Temporal *temp, int *count); -extern int tint_end_value(const Temporal *temp); -extern int tint_max_value(const Temporal *temp); -extern int tint_min_value(const Temporal *temp); -extern int tint_start_value(const Temporal *temp); -extern bool tint_value_at_timestamptz(const Temporal *temp, TimestampTz t, bool strict, int *value); -extern bool tint_value_n(const Temporal *temp, int n, int *result); -extern int *tint_values(const Temporal *temp, int *count); -extern double tnumber_integral(const Temporal *temp); -extern double tnumber_twavg(const Temporal *temp); -extern SpanSet *tnumber_valuespans(const Temporal *temp); -extern GSERIALIZED *tpoint_end_value(const Temporal *temp); -extern GSERIALIZED *tpoint_start_value(const Temporal *temp); -extern bool tpoint_value_at_timestamptz(const Temporal *temp, TimestampTz t, bool strict, GSERIALIZED **value); -extern bool tpoint_value_n(const Temporal *temp, int n, GSERIALIZED **result); -extern GSERIALIZED **tpoint_values(const Temporal *temp, int *count); -extern text *ttext_end_value(const Temporal *temp); -extern text *ttext_max_value(const Temporal *temp); -extern text *ttext_min_value(const Temporal *temp); -extern text *ttext_start_value(const Temporal *temp); -extern bool ttext_value_at_timestamptz(const Temporal *temp, TimestampTz t, bool strict, text **value); -extern bool ttext_value_n(const Temporal *temp, int n, text **result); -extern text **ttext_values(const Temporal *temp, int *count); +typedef struct +{ + GBOX *bbox; + POINTARRAY *points; + int32_t srid; + lwflags_t flags; + uint8_t type; + char pad[1]; +} +LWLINE; -extern double float_degrees(double value, bool normalize); -extern bool meos_srid_is_latlong(int32_t srid); -extern Temporal *temporal_scale_time(const Temporal *temp, const Interval *duration); -extern Temporal *temporal_set_interp(const Temporal *temp, interpType interp); -extern Temporal *temporal_shift_scale_time(const Temporal *temp, const Interval *shift, const Interval *duration); -extern Temporal *temporal_shift_time(const Temporal *temp, const Interval *shift); -extern TInstant *temporal_to_tinstant(const Temporal *temp); -extern TSequence *temporal_to_tsequence(const Temporal *temp, const char *interp_str); -extern TSequenceSet *temporal_to_tsequenceset(const Temporal *temp, const char *interp_str); -extern Temporal *tfloat_floor(const Temporal *temp); -extern Temporal *tfloat_ceil(const Temporal *temp); -extern Temporal *tfloat_degrees(const Temporal *temp, bool normalize); -extern Temporal *tfloat_radians(const Temporal *temp); -extern Temporal *tfloat_round(const Temporal *temp, int maxdd); -extern Temporal *tfloat_scale_value(const Temporal *temp, double width); -extern Temporal *tfloat_shift_scale_value(const Temporal *temp, double shift, double width); -extern Temporal *tfloat_shift_value(const Temporal *temp, double shift); -extern Temporal **tfloatarr_round(const Temporal **temp, int count, int maxdd); -extern Temporal *tint_scale_value(const Temporal *temp, int width); -extern Temporal *tint_shift_scale_value(const Temporal *temp, int shift, int width); -extern Temporal *tint_shift_value(const Temporal *temp, int shift); -extern Temporal *tpoint_round(const Temporal *temp, int maxdd); -extern Temporal *tpoint_transform(const Temporal *temp, int32 srid); -extern Temporal *tpoint_transform_pipeline(const Temporal *temp, const char *pipelinestr, int32 srid, bool is_forward); -extern Temporal *tpoint_transform_pj(const Temporal *temp, int32 srid, const LWPROJ *pj); -extern LWPROJ *lwproj_transform(int32 srid_from, int32 srid_to); -extern Temporal **tpointarr_round(const Temporal **temp, int count, int maxdd); - -extern Temporal *temporal_append_tinstant(Temporal *temp, const TInstant *inst, double maxdist, const Interval *maxt, bool expand); -extern Temporal *temporal_append_tsequence(Temporal *temp, const TSequence *seq, bool expand); -extern Temporal *temporal_delete_tstzspan(const Temporal *temp, const Span *s, bool connect); -extern Temporal *temporal_delete_tstzspanset(const Temporal *temp, const SpanSet *ss, bool connect); -extern Temporal *temporal_delete_timestamptz(const Temporal *temp, TimestampTz t, bool connect); -extern Temporal *temporal_delete_tstzset(const Temporal *temp, const Set *s, bool connect); -extern Temporal *temporal_insert(const Temporal *temp1, const Temporal *temp2, bool connect); -extern Temporal *temporal_merge(const Temporal *temp1, const Temporal *temp2); -extern Temporal *temporal_merge_array(const Temporal **temparr, int count); -extern Temporal *temporal_update(const Temporal *temp1, const Temporal *temp2, bool connect); +typedef struct +{ + GBOX *bbox; + POINTARRAY *points; + int32_t srid; + lwflags_t flags; + uint8_t type; + char pad[1]; +} +LWTRIANGLE; + +typedef struct +{ + GBOX *bbox; + POINTARRAY *points; + int32_t srid; + lwflags_t flags; + uint8_t type; + char pad[1]; +} +LWCIRCSTRING; -extern Temporal *tbool_at_value(const Temporal *temp, bool b); -extern Temporal *tbool_minus_value(const Temporal *temp, bool b); -extern Temporal *temporal_at_max(const Temporal *temp); -extern Temporal *temporal_at_min(const Temporal *temp); -extern Temporal *temporal_at_tstzspan(const Temporal *temp, const Span *s); -extern Temporal *temporal_at_tstzspanset(const Temporal *temp, const SpanSet *ss); -extern Temporal *temporal_at_timestamptz(const Temporal *temp, TimestampTz t); -extern Temporal *temporal_at_tstzset(const Temporal *temp, const Set *s); -extern Temporal *temporal_at_values(const Temporal *temp, const Set *set); -extern Temporal *temporal_minus_max(const Temporal *temp); -extern Temporal *temporal_minus_min(const Temporal *temp); -extern Temporal *temporal_minus_tstzspan(const Temporal *temp, const Span *s); -extern Temporal *temporal_minus_tstzspanset(const Temporal *temp, const SpanSet *ss); -extern Temporal *temporal_minus_timestamptz(const Temporal *temp, TimestampTz t); -extern Temporal *temporal_minus_tstzset(const Temporal *temp, const Set *s); -extern Temporal *temporal_minus_values(const Temporal *temp, const Set *set); -extern Temporal *tfloat_at_value(const Temporal *temp, double d); -extern Temporal *tfloat_minus_value(const Temporal *temp, double d); -extern Temporal *tint_at_value(const Temporal *temp, int i); -extern Temporal *tint_minus_value(const Temporal *temp, int i); -extern Temporal *tnumber_at_span(const Temporal *temp, const Span *span); -extern Temporal *tnumber_at_spanset(const Temporal *temp, const SpanSet *ss); -extern Temporal *tnumber_at_tbox(const Temporal *temp, const TBox *box); -extern Temporal *tnumber_minus_span(const Temporal *temp, const Span *span); -extern Temporal *tnumber_minus_spanset(const Temporal *temp, const SpanSet *ss); -extern Temporal *tnumber_minus_tbox(const Temporal *temp, const TBox *box); -extern Temporal *tpoint_at_geom(const Temporal *temp, const GSERIALIZED *gs, const Span *zspan); -extern Temporal *tpoint_at_stbox(const Temporal *temp, const STBox *box, bool border_inc); -extern Temporal *tpoint_at_value(const Temporal *temp, GSERIALIZED *gs); -extern Temporal *tpoint_minus_geom(const Temporal *temp, const GSERIALIZED *gs, const Span *zspan); -extern Temporal *tpoint_minus_stbox(const Temporal *temp, const STBox *box, bool border_inc); -extern Temporal *tpoint_minus_value(const Temporal *temp, GSERIALIZED *gs); -extern Temporal *ttext_at_value(const Temporal *temp, text *txt); -extern Temporal *ttext_minus_value(const Temporal *temp, text *txt); +typedef struct +{ + GBOX *bbox; + POINTARRAY **rings; + int32_t srid; + lwflags_t flags; + uint8_t type; + char pad[1]; + uint32_t nrings; + uint32_t maxrings; +} +LWPOLY; -extern int temporal_cmp(const Temporal *temp1, const Temporal *temp2); -extern bool temporal_eq(const Temporal *temp1, const Temporal *temp2); -extern bool temporal_ge(const Temporal *temp1, const Temporal *temp2); -extern bool temporal_gt(const Temporal *temp1, const Temporal *temp2); -extern bool temporal_le(const Temporal *temp1, const Temporal *temp2); -extern bool temporal_lt(const Temporal *temp1, const Temporal *temp2); -extern bool temporal_ne(const Temporal *temp1, const Temporal *temp2); +typedef struct +{ + GBOX *bbox; + LWPOINT **geoms; + int32_t srid; + lwflags_t flags; + uint8_t type; + char pad[1]; + uint32_t ngeoms; + uint32_t maxgeoms; +} +LWMPOINT; -extern int always_eq_bool_tbool(bool b, const Temporal *temp); -extern int always_eq_float_tfloat(double d, const Temporal *temp); -extern int always_eq_int_tint(int i, const Temporal *temp); -extern int always_eq_point_tpoint(const GSERIALIZED *gs, const Temporal *temp); -extern int always_eq_tbool_bool(const Temporal *temp, bool b); -extern int always_eq_temporal_temporal(const Temporal *temp1, const Temporal *temp2); -extern int always_eq_text_ttext(const text *txt, const Temporal *temp); -extern int always_eq_tfloat_float(const Temporal *temp, double d); -extern int always_eq_tint_int(const Temporal *temp, int i); -extern int always_eq_tpoint_point(const Temporal *temp, const GSERIALIZED *gs); -extern int always_eq_tpoint_tpoint(const Temporal *temp1, const Temporal *temp2); -extern int always_eq_ttext_text(const Temporal *temp, const text *txt); -extern int always_ne_bool_tbool(bool b, const Temporal *temp); -extern int always_ne_float_tfloat(double d, const Temporal *temp); -extern int always_ne_int_tint(int i, const Temporal *temp); -extern int always_ne_point_tpoint(const GSERIALIZED *gs, const Temporal *temp); -extern int always_ne_tbool_bool(const Temporal *temp, bool b); -extern int always_ne_temporal_temporal(const Temporal *temp1, const Temporal *temp2); -extern int always_ne_text_ttext(const text *txt, const Temporal *temp); -extern int always_ne_tfloat_float(const Temporal *temp, double d); -extern int always_ne_tint_int(const Temporal *temp, int i); -extern int always_ne_tpoint_point(const Temporal *temp, const GSERIALIZED *gs); -extern int always_ne_tpoint_tpoint(const Temporal *temp1, const Temporal *temp2); -extern int always_ne_ttext_text(const Temporal *temp, const text *txt); -extern int always_ge_float_tfloat(double d, const Temporal *temp); -extern int always_ge_int_tint(int i, const Temporal *temp); -extern int always_ge_temporal_temporal(const Temporal *temp1, const Temporal *temp2); -extern int always_ge_text_ttext(const text *txt, const Temporal *temp); -extern int always_ge_tfloat_float(const Temporal *temp, double d); -extern int always_ge_tint_int(const Temporal *temp, int i); -extern int always_ge_ttext_text(const Temporal *temp, const text *txt); -extern int always_gt_float_tfloat(double d, const Temporal *temp); -extern int always_gt_int_tint(int i, const Temporal *temp); -extern int always_gt_temporal_temporal(const Temporal *temp1, const Temporal *temp2); -extern int always_gt_text_ttext(const text *txt, const Temporal *temp); -extern int always_gt_tfloat_float(const Temporal *temp, double d); -extern int always_gt_tint_int(const Temporal *temp, int i); -extern int always_gt_ttext_text(const Temporal *temp, const text *txt); -extern int always_le_float_tfloat(double d, const Temporal *temp); -extern int always_le_int_tint(int i, const Temporal *temp); -extern int always_le_temporal_temporal(const Temporal *temp1, const Temporal *temp2); -extern int always_le_text_ttext(const text *txt, const Temporal *temp); -extern int always_le_tfloat_float(const Temporal *temp, double d); -extern int always_le_tint_int(const Temporal *temp, int i); -extern int always_le_ttext_text(const Temporal *temp, const text *txt); -extern int always_lt_float_tfloat(double d, const Temporal *temp); -extern int always_lt_int_tint(int i, const Temporal *temp); -extern int always_lt_temporal_temporal(const Temporal *temp1, const Temporal *temp2); -extern int always_lt_text_ttext(const text *txt, const Temporal *temp); -extern int always_lt_tfloat_float(const Temporal *temp, double d); -extern int always_lt_tint_int(const Temporal *temp, int i); -extern int always_lt_ttext_text(const Temporal *temp, const text *txt); -extern int ever_eq_bool_tbool(bool b, const Temporal *temp); -extern int ever_eq_float_tfloat(double d, const Temporal *temp); -extern int ever_eq_int_tint(int i, const Temporal *temp); -extern int ever_eq_point_tpoint(const GSERIALIZED *gs, const Temporal *temp); -extern int ever_eq_tbool_bool(const Temporal *temp, bool b); -extern int ever_eq_temporal_temporal(const Temporal *temp1, const Temporal *temp2); -extern int ever_eq_text_ttext(const text *txt, const Temporal *temp); -extern int ever_eq_tfloat_float(const Temporal *temp, double d); -extern int ever_eq_tint_int(const Temporal *temp, int i); -extern int ever_eq_tpoint_point(const Temporal *temp, const GSERIALIZED *gs); -extern int ever_eq_tpoint_tpoint(const Temporal *temp1, const Temporal *temp2); -extern int ever_eq_ttext_text(const Temporal *temp, const text *txt); -extern int ever_ge_float_tfloat(double d, const Temporal *temp); -extern int ever_ge_int_tint(int i, const Temporal *temp); -extern int ever_ge_temporal_temporal(const Temporal *temp1, const Temporal *temp2); -extern int ever_ge_text_ttext(const text *txt, const Temporal *temp); -extern int ever_ge_tfloat_float(const Temporal *temp, double d); -extern int ever_ge_tint_int(const Temporal *temp, int i); -extern int ever_ge_ttext_text(const Temporal *temp, const text *txt); -extern int ever_gt_float_tfloat(double d, const Temporal *temp); -extern int ever_gt_int_tint(int i, const Temporal *temp); -extern int ever_gt_temporal_temporal(const Temporal *temp1, const Temporal *temp2); -extern int ever_gt_text_ttext(const text *txt, const Temporal *temp); -extern int ever_gt_tfloat_float(const Temporal *temp, double d); -extern int ever_gt_tint_int(const Temporal *temp, int i); -extern int ever_gt_ttext_text(const Temporal *temp, const text *txt); -extern int ever_le_float_tfloat(double d, const Temporal *temp); -extern int ever_le_int_tint(int i, const Temporal *temp); -extern int ever_le_temporal_temporal(const Temporal *temp1, const Temporal *temp2); -extern int ever_le_text_ttext(const text *txt, const Temporal *temp); -extern int ever_le_tfloat_float(const Temporal *temp, double d); -extern int ever_le_tint_int(const Temporal *temp, int i); -extern int ever_le_ttext_text(const Temporal *temp, const text *txt); -extern int ever_lt_float_tfloat(double d, const Temporal *temp); -extern int ever_lt_int_tint(int i, const Temporal *temp); -extern int ever_lt_temporal_temporal(const Temporal *temp1, const Temporal *temp2); -extern int ever_lt_text_ttext(const text *txt, const Temporal *temp); -extern int ever_lt_tfloat_float(const Temporal *temp, double d); -extern int ever_lt_tint_int(const Temporal *temp, int i); -extern int ever_lt_ttext_text(const Temporal *temp, const text *txt); -extern int ever_ne_bool_tbool(bool b, const Temporal *temp); -extern int ever_ne_float_tfloat(double d, const Temporal *temp); -extern int ever_ne_int_tint(int i, const Temporal *temp); -extern int ever_ne_point_tpoint(const GSERIALIZED *gs, const Temporal *temp); -extern int ever_ne_tbool_bool(const Temporal *temp, bool b); -extern int ever_ne_temporal_temporal(const Temporal *temp1, const Temporal *temp2); -extern int ever_ne_text_ttext(const text *txt, const Temporal *temp); -extern int ever_ne_tfloat_float(const Temporal *temp, double d); -extern int ever_ne_tint_int(const Temporal *temp, int i); -extern int ever_ne_tpoint_point(const Temporal *temp, const GSERIALIZED *gs); -extern int ever_ne_tpoint_tpoint(const Temporal *temp1, const Temporal *temp2); -extern int ever_ne_ttext_text(const Temporal *temp, const text *txt); +typedef struct +{ + GBOX *bbox; + LWLINE **geoms; + int32_t srid; + lwflags_t flags; + uint8_t type; + char pad[1]; + uint32_t ngeoms; + uint32_t maxgeoms; +} +LWMLINE; -extern Temporal *teq_bool_tbool(bool b, const Temporal *temp); -extern Temporal *teq_float_tfloat(double d, const Temporal *temp); -extern Temporal *teq_int_tint(int i, const Temporal *temp); -extern Temporal *teq_point_tpoint(const GSERIALIZED *gs, const Temporal *temp); -extern Temporal *teq_tbool_bool(const Temporal *temp, bool b); -extern Temporal *teq_temporal_temporal(const Temporal *temp1, const Temporal *temp2); -extern Temporal *teq_text_ttext(const text *txt, const Temporal *temp); -extern Temporal *teq_tfloat_float(const Temporal *temp, double d); -extern Temporal *teq_tpoint_point(const Temporal *temp, const GSERIALIZED *gs); -extern Temporal *teq_tint_int(const Temporal *temp, int i); -extern Temporal *teq_ttext_text(const Temporal *temp, const text *txt); -extern Temporal *tge_float_tfloat(double d, const Temporal *temp); -extern Temporal *tge_int_tint(int i, const Temporal *temp); -extern Temporal *tge_temporal_temporal(const Temporal *temp1, const Temporal *temp2); -extern Temporal *tge_text_ttext(const text *txt, const Temporal *temp); -extern Temporal *tge_tfloat_float(const Temporal *temp, double d); -extern Temporal *tge_tint_int(const Temporal *temp, int i); -extern Temporal *tge_ttext_text(const Temporal *temp, const text *txt); -extern Temporal *tgt_float_tfloat(double d, const Temporal *temp); -extern Temporal *tgt_int_tint(int i, const Temporal *temp); -extern Temporal *tgt_temporal_temporal(const Temporal *temp1, const Temporal *temp2); -extern Temporal *tgt_text_ttext(const text *txt, const Temporal *temp); -extern Temporal *tgt_tfloat_float(const Temporal *temp, double d); -extern Temporal *tgt_tint_int(const Temporal *temp, int i); -extern Temporal *tgt_ttext_text(const Temporal *temp, const text *txt); -extern Temporal *tle_float_tfloat(double d, const Temporal *temp); -extern Temporal *tle_int_tint(int i, const Temporal *temp); -extern Temporal *tle_temporal_temporal(const Temporal *temp1, const Temporal *temp2); -extern Temporal *tle_text_ttext(const text *txt, const Temporal *temp); -extern Temporal *tle_tfloat_float(const Temporal *temp, double d); -extern Temporal *tle_tint_int(const Temporal *temp, int i); -extern Temporal *tle_ttext_text(const Temporal *temp, const text *txt); -extern Temporal *tlt_float_tfloat(double d, const Temporal *temp); -extern Temporal *tlt_int_tint(int i, const Temporal *temp); -extern Temporal *tlt_temporal_temporal(const Temporal *temp1, const Temporal *temp2); -extern Temporal *tlt_text_ttext(const text *txt, const Temporal *temp); -extern Temporal *tlt_tfloat_float(const Temporal *temp, double d); -extern Temporal *tlt_tint_int(const Temporal *temp, int i); -extern Temporal *tlt_ttext_text(const Temporal *temp, const text *txt); -extern Temporal *tne_bool_tbool(bool b, const Temporal *temp); -extern Temporal *tne_float_tfloat(double d, const Temporal *temp); -extern Temporal *tne_int_tint(int i, const Temporal *temp); -extern Temporal *tne_point_tpoint(const GSERIALIZED *gs, const Temporal *temp); -extern Temporal *tne_tbool_bool(const Temporal *temp, bool b); -extern Temporal *tne_temporal_temporal(const Temporal *temp1, const Temporal *temp2); -extern Temporal *tne_text_ttext(const text *txt, const Temporal *temp); -extern Temporal *tne_tfloat_float(const Temporal *temp, double d); -extern Temporal *tne_tpoint_point(const Temporal *temp, const GSERIALIZED *gs); -extern Temporal *tne_tint_int(const Temporal *temp, int i); -extern Temporal *tne_ttext_text(const Temporal *temp, const text *txt); +typedef struct +{ + GBOX *bbox; + LWPOLY **geoms; + int32_t srid; + lwflags_t flags; + uint8_t type; + char pad[1]; + uint32_t ngeoms; + uint32_t maxgeoms; +} +LWMPOLY; + +typedef struct +{ + GBOX *bbox; + LWGEOM **geoms; + int32_t srid; + lwflags_t flags; + uint8_t type; + char pad[1]; + uint32_t ngeoms; + uint32_t maxgeoms; +} +LWCOLLECTION; + +typedef struct +{ + GBOX *bbox; + LWGEOM **geoms; + int32_t srid; + lwflags_t flags; + uint8_t type; + char pad[1]; + uint32_t ngeoms; + uint32_t maxgeoms; +} +LWCOMPOUND; -extern Span *temporal_spans(const Temporal *temp, int *count); -extern Span *temporal_split_each_n_spans(const Temporal *temp, int elem_count, int *count); -extern Span *temporal_split_n_spans(const Temporal *temp, int span_count, int *count); -extern TBox *tnumber_tboxes(const Temporal *temp, int *count); -extern TBox *tnumber_split_each_n_tboxes(const Temporal *temp, int elem_count, int *count); -extern TBox *tnumber_split_n_tboxes(const Temporal *temp, int box_count, int *count); -extern STBox *tpoint_stboxes(const Temporal *temp, int *count); -extern STBox *tpoint_space_boxes(const Temporal *temp, double xsize, double ysize, double zsize, const GSERIALIZED *sorigin, bool bitmatrix, bool border_inc, int *count); -extern STBox *tpoint_space_time_boxes(const Temporal *temp, double xsize, double ysize, double zsize, const Interval *duration, const GSERIALIZED *sorigin, TimestampTz torigin, bool bitmatrix, bool border_inc, int *count); -extern STBox *tpoint_split_each_n_stboxes(const Temporal *temp, int elem_count, int *count); -extern STBox *tpoint_split_n_stboxes(const Temporal *temp, int box_count, int *count); -extern GBOX *geo_split_each_n_gboxes(const GSERIALIZED *gs, int elem_count, int *count); -extern GBOX *geo_split_n_gboxes(const GSERIALIZED *gs, int box_count, int *count); +typedef struct +{ + GBOX *bbox; + LWGEOM **rings; + int32_t srid; + lwflags_t flags; + uint8_t type; + char pad[1]; + uint32_t nrings; + uint32_t maxrings; +} +LWCURVEPOLY; -extern bool adjacent_numspan_tnumber(const Span *s, const Temporal *temp); -extern bool adjacent_stbox_tpoint(const STBox *box, const Temporal *temp); -extern bool adjacent_tbox_tnumber(const TBox *box, const Temporal *temp); -extern bool adjacent_temporal_temporal(const Temporal *temp1, const Temporal *temp2); -extern bool adjacent_temporal_tstzspan(const Temporal *temp, const Span *s); -extern bool adjacent_tnumber_numspan(const Temporal *temp, const Span *s); -extern bool adjacent_tnumber_tbox(const Temporal *temp, const TBox *box); -extern bool adjacent_tnumber_tnumber(const Temporal *temp1, const Temporal *temp2); -extern bool adjacent_tpoint_stbox(const Temporal *temp, const STBox *box); -extern bool adjacent_tpoint_tpoint(const Temporal *temp1, const Temporal *temp2); -extern bool adjacent_tstzspan_temporal(const Span *s, const Temporal *temp); -extern bool contained_numspan_tnumber(const Span *s, const Temporal *temp); -extern bool contained_stbox_tpoint(const STBox *box, const Temporal *temp); -extern bool contained_tbox_tnumber(const TBox *box, const Temporal *temp); -extern bool contained_temporal_temporal(const Temporal *temp1, const Temporal *temp2); -extern bool contained_temporal_tstzspan(const Temporal *temp, const Span *s); -extern bool contained_tnumber_numspan(const Temporal *temp, const Span *s); -extern bool contained_tnumber_tbox(const Temporal *temp, const TBox *box); -extern bool contained_tnumber_tnumber(const Temporal *temp1, const Temporal *temp2); -extern bool contained_tpoint_stbox(const Temporal *temp, const STBox *box); -extern bool contained_tpoint_tpoint(const Temporal *temp1, const Temporal *temp2); -extern bool contained_tstzspan_temporal(const Span *s, const Temporal *temp); -extern bool contains_numspan_tnumber(const Span *s, const Temporal *temp); -extern bool contains_stbox_tpoint(const STBox *box, const Temporal *temp); -extern bool contains_tbox_tnumber(const TBox *box, const Temporal *temp); -extern bool contains_temporal_tstzspan(const Temporal *temp, const Span *s); -extern bool contains_temporal_temporal(const Temporal *temp1, const Temporal *temp2); -extern bool contains_tnumber_numspan(const Temporal *temp, const Span *s); -extern bool contains_tnumber_tbox(const Temporal *temp, const TBox *box); -extern bool contains_tnumber_tnumber(const Temporal *temp1, const Temporal *temp2); -extern bool contains_tpoint_stbox(const Temporal *temp, const STBox *box); -extern bool contains_tpoint_tpoint(const Temporal *temp1, const Temporal *temp2); -extern bool contains_tstzspan_temporal(const Span *s, const Temporal *temp); -extern bool overlaps_numspan_tnumber(const Span *s, const Temporal *temp); -extern bool overlaps_stbox_tpoint(const STBox *box, const Temporal *temp); -extern bool overlaps_tbox_tnumber(const TBox *box, const Temporal *temp); -extern bool overlaps_temporal_temporal(const Temporal *temp1, const Temporal *temp2); -extern bool overlaps_temporal_tstzspan(const Temporal *temp, const Span *s); -extern bool overlaps_tnumber_numspan(const Temporal *temp, const Span *s); -extern bool overlaps_tnumber_tbox(const Temporal *temp, const TBox *box); -extern bool overlaps_tnumber_tnumber(const Temporal *temp1, const Temporal *temp2); -extern bool overlaps_tpoint_stbox(const Temporal *temp, const STBox *box); -extern bool overlaps_tpoint_tpoint(const Temporal *temp1, const Temporal *temp2); -extern bool overlaps_tstzspan_temporal(const Span *s, const Temporal *temp); -extern bool same_numspan_tnumber(const Span *s, const Temporal *temp); -extern bool same_stbox_tpoint(const STBox *box, const Temporal *temp); -extern bool same_tbox_tnumber(const TBox *box, const Temporal *temp); -extern bool same_temporal_temporal(const Temporal *temp1, const Temporal *temp2); -extern bool same_temporal_tstzspan(const Temporal *temp, const Span *s); -extern bool same_tnumber_numspan(const Temporal *temp, const Span *s); -extern bool same_tnumber_tbox(const Temporal *temp, const TBox *box); -extern bool same_tnumber_tnumber(const Temporal *temp1, const Temporal *temp2); -extern bool same_tpoint_stbox(const Temporal *temp, const STBox *box); -extern bool same_tpoint_tpoint(const Temporal *temp1, const Temporal *temp2); -extern bool same_tstzspan_temporal(const Span *s, const Temporal *temp); +typedef struct +{ + GBOX *bbox; + LWGEOM **geoms; + int32_t srid; + lwflags_t flags; + uint8_t type; + char pad[1]; + uint32_t ngeoms; + uint32_t maxgeoms; +} +LWMCURVE; -extern bool above_stbox_tpoint(const STBox *box, const Temporal *temp); -extern bool above_tpoint_stbox(const Temporal *temp, const STBox *box); -extern bool above_tpoint_tpoint(const Temporal *temp1, const Temporal *temp2); -extern bool after_stbox_tpoint(const STBox *box, const Temporal *temp); -extern bool after_tbox_tnumber(const TBox *box, const Temporal *temp); -extern bool after_temporal_tstzspan(const Temporal *temp, const Span *s); -extern bool after_temporal_temporal(const Temporal *temp1, const Temporal *temp2); -extern bool after_tnumber_tbox(const Temporal *temp, const TBox *box); -extern bool after_tnumber_tnumber(const Temporal *temp1, const Temporal *temp2); -extern bool after_tpoint_stbox(const Temporal *temp, const STBox *box); -extern bool after_tpoint_tpoint(const Temporal *temp1, const Temporal *temp2); -extern bool after_tstzspan_temporal(const Span *s, const Temporal *temp); -extern bool back_stbox_tpoint(const STBox *box, const Temporal *temp); -extern bool back_tpoint_stbox(const Temporal *temp, const STBox *box); -extern bool back_tpoint_tpoint(const Temporal *temp1, const Temporal *temp2); -extern bool before_stbox_tpoint(const STBox *box, const Temporal *temp); -extern bool before_tbox_tnumber(const TBox *box, const Temporal *temp); -extern bool before_temporal_tstzspan(const Temporal *temp, const Span *s); -extern bool before_temporal_temporal(const Temporal *temp1, const Temporal *temp2); -extern bool before_tnumber_tbox(const Temporal *temp, const TBox *box); -extern bool before_tnumber_tnumber(const Temporal *temp1, const Temporal *temp2); -extern bool before_tpoint_stbox(const Temporal *temp, const STBox *box); -extern bool before_tpoint_tpoint(const Temporal *temp1, const Temporal *temp2); -extern bool before_tstzspan_temporal(const Span *s, const Temporal *temp); -extern bool below_stbox_tpoint(const STBox *box, const Temporal *temp); -extern bool below_tpoint_stbox(const Temporal *temp, const STBox *box); -extern bool below_tpoint_tpoint(const Temporal *temp1, const Temporal *temp2); -extern bool front_stbox_tpoint(const STBox *box, const Temporal *temp); -extern bool front_tpoint_stbox(const Temporal *temp, const STBox *box); -extern bool front_tpoint_tpoint(const Temporal *temp1, const Temporal *temp2); -extern bool left_stbox_tpoint(const STBox *box, const Temporal *temp); -extern bool left_tbox_tnumber(const TBox *box, const Temporal *temp); -extern bool left_numspan_tnumber(const Span *s, const Temporal *temp); -extern bool left_tnumber_numspan(const Temporal *temp, const Span *s); -extern bool left_tnumber_tbox(const Temporal *temp, const TBox *box); -extern bool left_tnumber_tnumber(const Temporal *temp1, const Temporal *temp2); -extern bool left_tpoint_stbox(const Temporal *temp, const STBox *box); -extern bool left_tpoint_tpoint(const Temporal *temp1, const Temporal *temp2); -extern bool overabove_stbox_tpoint(const STBox *box, const Temporal *temp); -extern bool overabove_tpoint_stbox(const Temporal *temp, const STBox *box); -extern bool overabove_tpoint_tpoint(const Temporal *temp1, const Temporal *temp2); -extern bool overafter_stbox_tpoint(const STBox *box, const Temporal *temp); -extern bool overafter_tbox_tnumber(const TBox *box, const Temporal *temp); -extern bool overafter_temporal_tstzspan(const Temporal *temp, const Span *s); -extern bool overafter_temporal_temporal(const Temporal *temp1, const Temporal *temp2); -extern bool overafter_tnumber_tbox(const Temporal *temp, const TBox *box); -extern bool overafter_tnumber_tnumber(const Temporal *temp1, const Temporal *temp2); -extern bool overafter_tpoint_stbox(const Temporal *temp, const STBox *box); -extern bool overafter_tpoint_tpoint(const Temporal *temp1, const Temporal *temp2); -extern bool overafter_tstzspan_temporal(const Span *s, const Temporal *temp); -extern bool overback_stbox_tpoint(const STBox *box, const Temporal *temp); -extern bool overback_tpoint_stbox(const Temporal *temp, const STBox *box); -extern bool overback_tpoint_tpoint(const Temporal *temp1, const Temporal *temp2); -extern bool overbefore_stbox_tpoint(const STBox *box, const Temporal *temp); -extern bool overbefore_tbox_tnumber(const TBox *box, const Temporal *temp); -extern bool overbefore_temporal_tstzspan(const Temporal *temp, const Span *s); -extern bool overbefore_temporal_temporal(const Temporal *temp1, const Temporal *temp2); -extern bool overbefore_tnumber_tbox(const Temporal *temp, const TBox *box); -extern bool overbefore_tnumber_tnumber(const Temporal *temp1, const Temporal *temp2); -extern bool overbefore_tpoint_stbox(const Temporal *temp, const STBox *box); -extern bool overbefore_tpoint_tpoint(const Temporal *temp1, const Temporal *temp2); -extern bool overbefore_tstzspan_temporal(const Span *s, const Temporal *temp); -extern bool overbelow_stbox_tpoint(const STBox *box, const Temporal *temp); -extern bool overbelow_tpoint_stbox(const Temporal *temp, const STBox *box); -extern bool overbelow_tpoint_tpoint(const Temporal *temp1, const Temporal *temp2); -extern bool overfront_stbox_tpoint(const STBox *box, const Temporal *temp); -extern bool overfront_tpoint_stbox(const Temporal *temp, const STBox *box); -extern bool overfront_tpoint_tpoint(const Temporal *temp1, const Temporal *temp2); -extern bool overleft_numspan_tnumber(const Span *s, const Temporal *temp); -extern bool overleft_stbox_tpoint(const STBox *box, const Temporal *temp); -extern bool overleft_tbox_tnumber(const TBox *box, const Temporal *temp); -extern bool overleft_tnumber_numspan(const Temporal *temp, const Span *s); -extern bool overleft_tnumber_tbox(const Temporal *temp, const TBox *box); -extern bool overleft_tnumber_tnumber(const Temporal *temp1, const Temporal *temp2); -extern bool overleft_tpoint_stbox(const Temporal *temp, const STBox *box); -extern bool overleft_tpoint_tpoint(const Temporal *temp1, const Temporal *temp2); -extern bool overright_numspan_tnumber(const Span *s, const Temporal *temp); -extern bool overright_stbox_tpoint(const STBox *box, const Temporal *temp); -extern bool overright_tbox_tnumber(const TBox *box, const Temporal *temp); -extern bool overright_tnumber_numspan(const Temporal *temp, const Span *s); -extern bool overright_tnumber_tbox(const Temporal *temp, const TBox *box); -extern bool overright_tnumber_tnumber(const Temporal *temp1, const Temporal *temp2); -extern bool overright_tpoint_stbox(const Temporal *temp, const STBox *box); -extern bool overright_tpoint_tpoint(const Temporal *temp1, const Temporal *temp2); -extern bool right_numspan_tnumber(const Span *s, const Temporal *temp); -extern bool right_stbox_tpoint(const STBox *box, const Temporal *temp); -extern bool right_tbox_tnumber(const TBox *box, const Temporal *temp); -extern bool right_tnumber_numspan(const Temporal *temp, const Span *s); -extern bool right_tnumber_tbox(const Temporal *temp, const TBox *box); -extern bool right_tnumber_tnumber(const Temporal *temp1, const Temporal *temp2); -extern bool right_tpoint_stbox(const Temporal *temp, const STBox *box); -extern bool right_tpoint_tpoint(const Temporal *temp1, const Temporal *temp2); +typedef struct +{ + GBOX *bbox; + LWGEOM **geoms; + int32_t srid; + lwflags_t flags; + uint8_t type; + char pad[1]; + uint32_t ngeoms; + uint32_t maxgeoms; +} +LWMSURFACE; -extern Temporal *tand_bool_tbool(bool b, const Temporal *temp); -extern Temporal *tand_tbool_bool(const Temporal *temp, bool b); -extern Temporal *tand_tbool_tbool(const Temporal *temp1, const Temporal *temp2); -extern SpanSet *tbool_when_true(const Temporal *temp); -extern Temporal *tnot_tbool(const Temporal *temp); -extern Temporal *tor_bool_tbool(bool b, const Temporal *temp); -extern Temporal *tor_tbool_bool(const Temporal *temp, bool b); -extern Temporal *tor_tbool_tbool(const Temporal *temp1, const Temporal *temp2); +typedef struct +{ + GBOX *bbox; + LWPOLY **geoms; + int32_t srid; + lwflags_t flags; + uint8_t type; + char pad[1]; + uint32_t ngeoms; + uint32_t maxgeoms; +} +LWPSURFACE; -extern Temporal *add_float_tfloat(double d, const Temporal *tnumber); -extern Temporal *add_int_tint(int i, const Temporal *tnumber); -extern Temporal *add_tfloat_float(const Temporal *tnumber, double d); -extern Temporal *add_tint_int(const Temporal *tnumber, int i); -extern Temporal *add_tnumber_tnumber(const Temporal *tnumber1, const Temporal *tnumber2); -extern Temporal *div_float_tfloat(double d, const Temporal *tnumber); -extern Temporal *div_int_tint(int i, const Temporal *tnumber); -extern Temporal *div_tfloat_float(const Temporal *tnumber, double d); -extern Temporal *div_tint_int(const Temporal *tnumber, int i); -extern Temporal *div_tnumber_tnumber(const Temporal *tnumber1, const Temporal *tnumber2); -extern Temporal *mult_float_tfloat(double d, const Temporal *tnumber); -extern Temporal *mult_int_tint(int i, const Temporal *tnumber); -extern Temporal *mult_tfloat_float(const Temporal *tnumber, double d); -extern Temporal *mult_tint_int(const Temporal *tnumber, int i); -extern Temporal *mult_tnumber_tnumber(const Temporal *tnumber1, const Temporal *tnumber2); -extern Temporal *sub_float_tfloat(double d, const Temporal *tnumber); -extern Temporal *sub_int_tint(int i, const Temporal *tnumber); -extern Temporal *sub_tfloat_float(const Temporal *tnumber, double d); -extern Temporal *sub_tint_int(const Temporal *tnumber, int i); -extern Temporal *sub_tnumber_tnumber(const Temporal *tnumber1, const Temporal *tnumber2); -extern Temporal *tfloat_derivative(const Temporal *temp); -extern Temporal *tnumber_abs(const Temporal *temp); -extern Temporal *tnumber_angular_difference(const Temporal *temp); -extern Temporal *tnumber_delta_value(const Temporal *temp); +typedef struct +{ + GBOX *bbox; + LWTRIANGLE **geoms; + int32_t srid; + lwflags_t flags; + uint8_t type; + char pad[1]; + uint32_t ngeoms; + uint32_t maxgeoms; +} +LWTIN; -extern Temporal *textcat_text_ttext(const text *txt, const Temporal *temp); -extern Temporal *textcat_ttext_text(const Temporal *temp, const text *txt); -extern Temporal *textcat_ttext_ttext(const Temporal *temp1, const Temporal *temp2); -extern Temporal *ttext_upper(const Temporal *temp); -extern Temporal *ttext_lower(const Temporal *temp); -extern Temporal *ttext_initcap(const Temporal *temp); +/* extern int32 geo_get_srid(const GSERIALIZED *g); (undefined) */ -extern Temporal *distance_tfloat_float(const Temporal *temp, double d); -extern Temporal *distance_tint_int(const Temporal *temp, int i); -extern Temporal *distance_tnumber_tnumber(const Temporal *temp1, const Temporal *temp2); -extern Temporal *distance_tpoint_point(const Temporal *temp, const GSERIALIZED *gs); -extern Temporal *distance_tpoint_tpoint(const Temporal *temp1, const Temporal *temp2); -extern double nad_stbox_geo(const STBox *box, const GSERIALIZED *gs); -extern double nad_stbox_stbox(const STBox *box1, const STBox *box2); -extern int nad_tint_int(const Temporal *temp, int i); -extern int nad_tint_tbox(const Temporal *temp, const TBox *box); -extern int nad_tint_tint(const Temporal *temp1, const Temporal *temp2); -extern int nad_tboxint_tboxint(const TBox *box1, const TBox *box2); -extern double nad_tfloat_float(const Temporal *temp, double d); -extern double nad_tfloat_tfloat(const Temporal *temp1, const Temporal *temp2); -extern double nad_tfloat_tbox(const Temporal *temp, const TBox *box); -extern double nad_tboxfloat_tboxfloat(const TBox *box1, const TBox *box2); -extern double nad_tpoint_geo(const Temporal *temp, const GSERIALIZED *gs); -extern double nad_tpoint_stbox(const Temporal *temp, const STBox *box); -extern double nad_tpoint_tpoint(const Temporal *temp1, const Temporal *temp2); -extern TInstant *nai_tpoint_geo(const Temporal *temp, const GSERIALIZED *gs); -extern TInstant *nai_tpoint_tpoint(const Temporal *temp1, const Temporal *temp2); -extern GSERIALIZED *shortestline_tpoint_geo(const Temporal *temp, const GSERIALIZED *gs); -extern GSERIALIZED *shortestline_tpoint_tpoint(const Temporal *temp1, const Temporal *temp2); +struct PJconsts; +typedef struct PJconsts PJ; -extern bool bearing_point_point(const GSERIALIZED *gs1, const GSERIALIZED *gs2, double *result); -extern Temporal *bearing_tpoint_point(const Temporal *temp, const GSERIALIZED *gs, bool invert); -extern Temporal *bearing_tpoint_tpoint(const Temporal *temp1, const Temporal *temp2); -extern GBOX *geo_gboxes(const GSERIALIZED *gs, int *count); -extern Temporal *tpoint_angular_difference(const Temporal *temp); -extern Temporal *tpoint_azimuth(const Temporal *temp); -extern GSERIALIZED *tpoint_convex_hull(const Temporal *temp); -extern Temporal *tpoint_cumulative_length(const Temporal *temp); -extern bool tpoint_direction(const Temporal *temp, double *result); -extern Temporal *tpoint_get_x(const Temporal *temp); -extern Temporal *tpoint_get_y(const Temporal *temp); -extern Temporal *tpoint_get_z(const Temporal *temp); -extern bool tpoint_is_simple(const Temporal *temp); -extern double tpoint_length(const Temporal *temp); -extern Temporal *tpoint_speed(const Temporal *temp); -extern int32_t tpoint_srid(const Temporal *temp); -extern GSERIALIZED *tpoint_trajectory(const Temporal *temp); -extern GSERIALIZED *tpoint_twcentroid(const Temporal *temp); +typedef struct LWPROJ +{ + PJ* pj; -extern STBox *geo_expand_space(const GSERIALIZED *gs, double d); -extern Temporal *geomeas_to_tpoint(const GSERIALIZED *gs); -extern Temporal *tgeogpoint_to_tgeompoint(const Temporal *temp); -extern Temporal *tgeompoint_to_tgeogpoint(const Temporal *temp); -extern bool tpoint_AsMVTGeom(const Temporal *temp, const STBox *bounds, int32_t extent, int32_t buffer, bool clip_geom, GSERIALIZED **gsarr, int64 **timesarr, int *count); -extern STBox *tpoint_expand_space(const Temporal *temp, double d); -extern Temporal **tpoint_make_simple(const Temporal *temp, int *count); -extern Temporal *tpoint_set_srid(const Temporal *temp, int32_t srid); -extern bool tpoint_tfloat_to_geomeas(const Temporal *tpoint, const Temporal *measure, bool segmentize, GSERIALIZED **result); + + bool pipeline_is_forward; -extern int acontains_geo_tpoint(const GSERIALIZED *gs, const Temporal *temp); -extern int adisjoint_tpoint_geo(const Temporal *temp, const GSERIALIZED *gs); -extern int adisjoint_tpoint_tpoint(const Temporal *temp1, const Temporal *temp2); -extern int adwithin_tpoint_geo(const Temporal *temp, const GSERIALIZED *gs, double dist); -extern int adwithin_tpoint_tpoint(const Temporal *temp1, const Temporal *temp2, double dist); -extern int aintersects_tpoint_geo(const Temporal *temp, const GSERIALIZED *gs); -extern int aintersects_tpoint_tpoint(const Temporal *temp1, const Temporal *temp2); -extern int atouches_tpoint_geo(const Temporal *temp, const GSERIALIZED *gs); -extern int econtains_geo_tpoint(const GSERIALIZED *gs, const Temporal *temp); -extern int edisjoint_tpoint_geo(const Temporal *temp, const GSERIALIZED *gs); -extern int edisjoint_tpoint_tpoint(const Temporal *temp1, const Temporal *temp2); -extern int edwithin_tpoint_geo(const Temporal *temp, const GSERIALIZED *gs, double dist); -extern int edwithin_tpoint_tpoint(const Temporal *temp1, const Temporal *temp2, double dist); -extern int eintersects_tpoint_geo(const Temporal *temp, const GSERIALIZED *gs); -extern int eintersects_tpoint_tpoint(const Temporal *temp1, const Temporal *temp2); -extern int etouches_tpoint_geo(const Temporal *temp, const GSERIALIZED *gs); + + uint8_t source_is_latlong; + + double source_semi_major_metre; + double source_semi_minor_metre; +} LWPROJ; -extern Temporal *tcontains_geo_tpoint(const GSERIALIZED *gs, const Temporal *temp, bool restr, bool atvalue); -extern Temporal *tdisjoint_tpoint_geo(const Temporal *temp, const GSERIALIZED *gs, bool restr, bool atvalue); -extern Temporal *tdisjoint_tpoint_tpoint (const Temporal *temp1, const Temporal *temp2, bool restr, bool atvalue); -extern Temporal *tdwithin_tpoint_geo(const Temporal *temp, const GSERIALIZED *gs, double dist, bool restr, bool atvalue); -extern Temporal *tdwithin_tpoint_tpoint(const Temporal *temp1, const Temporal *temp2, double dist, bool restr, bool atvalue); -extern Temporal *tintersects_tpoint_geo(const Temporal *temp, const GSERIALIZED *gs, bool restr, bool atvalue); -extern Temporal *tintersects_tpoint_tpoint (const Temporal *temp1, const Temporal *temp2, bool restr, bool atvalue); -extern Temporal *ttouches_tpoint_geo(const Temporal *temp, const GSERIALIZED *gs, bool restr, bool atvalue); + -extern SkipList *tbool_tand_transfn(SkipList *state, const Temporal *temp); -extern SkipList *tbool_tor_transfn(SkipList *state, const Temporal *temp); -extern Span *temporal_extent_transfn(Span *s, const Temporal *temp); -extern Temporal *temporal_tagg_finalfn(SkipList *state); -extern SkipList *temporal_tcount_transfn(SkipList *state, const Temporal *temp); -extern SkipList *tfloat_tmax_transfn(SkipList *state, const Temporal *temp); -extern SkipList *tfloat_tmin_transfn(SkipList *state, const Temporal *temp); -extern SkipList *tfloat_tsum_transfn(SkipList *state, const Temporal *temp); -extern SkipList *tfloat_wmax_transfn(SkipList *state, const Temporal *temp, const Interval *interv); -extern SkipList *tfloat_wmin_transfn(SkipList *state, const Temporal *temp, const Interval *interv); -extern SkipList *tfloat_wsum_transfn(SkipList *state, const Temporal *temp, const Interval *interv); -extern SkipList *timestamptz_tcount_transfn(SkipList *state, TimestampTz t); -extern SkipList *tint_tmax_transfn(SkipList *state, const Temporal *temp); -extern SkipList *tint_tmin_transfn(SkipList *state, const Temporal *temp); -extern SkipList *tint_tsum_transfn(SkipList *state, const Temporal *temp); -extern SkipList *tint_wmax_transfn(SkipList *state, const Temporal *temp, const Interval *interv); -extern SkipList *tint_wmin_transfn(SkipList *state, const Temporal *temp, const Interval *interv); -extern SkipList *tint_wsum_transfn(SkipList *state, const Temporal *temp, const Interval *interv); +//#include + +typedef enum +{ + INTERSECTS = 0, + CONTAINS = 1, + TOUCHES = 2, + COVERS = 3, +} spatialRel; -extern TBox *tnumber_extent_transfn(TBox *box, const Temporal *temp); -extern Temporal *tnumber_tavg_finalfn(SkipList *state); -extern SkipList *tnumber_tavg_transfn(SkipList *state, const Temporal *temp); -extern SkipList *tnumber_wavg_transfn(SkipList *state, const Temporal *temp, const Interval *interv); -extern STBox *tpoint_extent_transfn(STBox *box, const Temporal *temp); -extern Temporal *tpoint_tcentroid_finalfn(SkipList *state); -extern SkipList *tpoint_tcentroid_transfn(SkipList *state, Temporal *temp); -extern SkipList *tstzset_tcount_transfn(SkipList *state, const Set *s); -extern SkipList *tstzspan_tcount_transfn(SkipList *state, const Span *s); -extern SkipList *tstzspanset_tcount_transfn(SkipList *state, const SpanSet *ss); -extern SkipList *ttext_tmax_transfn(SkipList *state, const Temporal *temp); -extern SkipList *ttext_tmin_transfn(SkipList *state, const Temporal *temp); + //#else + + + //#else + + + //#else + + + //#else + + + //#else + + + //#else + + + //#else + + + //#else + + + //#else + + + //#else + + + //#else + + + //#else + + + //#else + + +extern uint8_t *geo_as_ewkb(const GSERIALIZED *gs, const char *endian, size_t *size); +extern char *geo_as_ewkt(const GSERIALIZED *gs, int precision); +extern char *geo_as_geojson(const GSERIALIZED *gs, int option, int precision, const char *srs); +extern char *geo_as_hexewkb(const GSERIALIZED *gs, const char *endian); +extern char *geo_as_text(const GSERIALIZED *gs, int precision); +extern GSERIALIZED *geo_from_ewkb(const uint8_t *wkb, size_t wkb_size, int32 srid); +extern GSERIALIZED *geo_from_geojson(const char *geojson); +extern GSERIALIZED *geo_from_text(const char *wkt, int32_t srid); +extern char *geo_out(const GSERIALIZED *gs); +extern GSERIALIZED *geog_from_binary(const char *wkb_bytea); +extern GSERIALIZED *geog_from_hexewkb(const char *wkt); +extern GSERIALIZED *geog_in(const char *str, int32 typmod); +extern GSERIALIZED *geom_from_hexewkb(const char *wkt); +extern GSERIALIZED *geom_in(const char *str, int32 typmod); + +extern GSERIALIZED *geo_copy(const GSERIALIZED *g); +extern GSERIALIZED *geogpoint_make2d(int32_t srid, double x, double y); +extern GSERIALIZED *geogpoint_make3dz(int32_t srid, double x, double y, double z); +extern GSERIALIZED *geompoint_make2d(int32_t srid, double x, double y); +extern GSERIALIZED *geompoint_make3dz(int32_t srid, double x, double y, double z); + +extern GSERIALIZED *geom_to_geog(const GSERIALIZED *geom); +extern GSERIALIZED *geog_to_geom(const GSERIALIZED *geog); + +extern bool geo_is_empty(const GSERIALIZED *g); +/* extern bool geo_is_unitary(const GSERIALIZED *gs); (undefined) */ + +extern const char *geo_typename(int type); +extern double geog_area(const GSERIALIZED *g, bool use_spheroid); +extern GSERIALIZED *geog_centroid(const GSERIALIZED *g, bool use_spheroid); +extern double geog_length(const GSERIALIZED *g, bool use_spheroid); +extern double geog_perimeter(const GSERIALIZED *g, bool use_spheroid); +extern bool geom_azimuth(const GSERIALIZED *gs1, const GSERIALIZED *gs2, double *result); +extern double geom_length(const GSERIALIZED *gs); +extern double geom_perimeter(const GSERIALIZED *gs); +extern int line_numpoints(const GSERIALIZED *gs); +extern GSERIALIZED *line_point_n(const GSERIALIZED *geom, int n); + +extern GSERIALIZED *geo_reverse(const GSERIALIZED *gs); +extern GSERIALIZED *geo_round(const GSERIALIZED *gs, int maxdd); + +extern GSERIALIZED *geo_set_srid(const GSERIALIZED *gs, int32_t srid); +extern int32_t geo_srid(const GSERIALIZED *gs); +extern GSERIALIZED *geo_transform(GSERIALIZED *geom, int32_t srid_to); +extern GSERIALIZED *geo_transform_pipeline(const GSERIALIZED *gs, char *pipeline, int32_t srid_to, bool is_forward); + +extern GSERIALIZED *geo_collect_garray(GSERIALIZED **gsarr, int count); +extern GSERIALIZED *geo_makeline_garray(GSERIALIZED **gsarr, int count); +extern int geo_npoints(const GSERIALIZED *gs); +extern int geo_ngeos(const GSERIALIZED *gs); +extern GSERIALIZED *geo_geoN(const GSERIALIZED *geom, int n); +/* extern GSERIALIZED **geo_pointarr(const GSERIALIZED *gs, int *count); (undefined) */ +/* extern GSERIALIZED *geo_points(const GSERIALIZED *gs); (undefined) */ + +extern GSERIALIZED *geom_array_union(GSERIALIZED **gsarr, int count); +extern GSERIALIZED *geom_boundary(const GSERIALIZED *gs); +extern GSERIALIZED *geom_buffer(const GSERIALIZED *gs, double size, char *params); +extern GSERIALIZED *geom_centroid(const GSERIALIZED *gs); +extern GSERIALIZED *geom_convex_hull(const GSERIALIZED *gs); +extern GSERIALIZED *geom_difference2d(const GSERIALIZED *gs1, const GSERIALIZED *gs2); +extern GSERIALIZED *geom_intersection2d(const GSERIALIZED *gs1, const GSERIALIZED *gs2); +/* extern GSERIALIZED *geom_intersection2d_coll(const GSERIALIZED *gs1, const GSERIALIZED *gs2); (undefined) */ +/* extern GSERIALIZED *geom_min_bounding_radius(const GSERIALIZED *geom, double *radius); (undefined) */ + +extern GSERIALIZED *geom_shortestline2d(const GSERIALIZED *gs1, const GSERIALIZED *s2); +extern GSERIALIZED *geom_shortestline3d(const GSERIALIZED *gs1, const GSERIALIZED *s2); +extern GSERIALIZED *geom_unary_union(GSERIALIZED *gs, double prec); +extern GSERIALIZED *line_interpolate_point(GSERIALIZED *gs, double distance_fraction, bool repeat); +extern double line_locate_point(const GSERIALIZED *gs1, const GSERIALIZED *gs2); +extern GSERIALIZED *line_substring(const GSERIALIZED *gs, double from, double to); + +extern bool geog_dwithin(const GSERIALIZED *g1, const GSERIALIZED *g2, double tolerance, bool use_spheroid); +extern bool geog_intersects(const GSERIALIZED *gs1, const GSERIALIZED *gs2, bool use_spheroid); +extern bool geom_contains(const GSERIALIZED *gs1, const GSERIALIZED *gs2); +extern bool geom_covers(const GSERIALIZED *gs1, const GSERIALIZED *gs2); +extern bool geom_disjoint2d(const GSERIALIZED *gs1, const GSERIALIZED *gs2); +extern bool geom_dwithin2d(const GSERIALIZED *gs1, const GSERIALIZED *gs2, double tolerance); +extern bool geom_dwithin3d(const GSERIALIZED *gs1, const GSERIALIZED *gs2, double tolerance); +extern bool geom_intersects2d(const GSERIALIZED *gs1, const GSERIALIZED *gs2); +extern bool geom_intersects3d(const GSERIALIZED *gs1, const GSERIALIZED *gs2); +extern bool geom_relate_pattern(const GSERIALIZED *gs1, const GSERIALIZED *gs2, char *patt); +extern bool geom_touches(const GSERIALIZED *gs1, const GSERIALIZED *gs2); + +extern STBox *geo_stboxes(const GSERIALIZED *gs, int *count); +extern STBox *geo_split_each_n_stboxes(const GSERIALIZED *gs, int elem_count, int *count); +extern STBox *geo_split_n_stboxes(const GSERIALIZED *gs, int box_count, int *count); + +extern double geog_distance(const GSERIALIZED *g1, const GSERIALIZED *g2); +extern double geom_distance2d(const GSERIALIZED *gs1, const GSERIALIZED *gs2); +extern double geom_distance3d(const GSERIALIZED *gs1, const GSERIALIZED *gs2); + +extern int geo_equals(const GSERIALIZED *gs1, const GSERIALIZED *gs2); +extern bool geo_same(const GSERIALIZED *gs1, const GSERIALIZED *gs2); -extern Temporal *temporal_simplify_dp(const Temporal *temp, double eps_dist, bool synchronized); -extern Temporal *temporal_simplify_max_dist(const Temporal *temp, double eps_dist, bool synchronized); -extern Temporal *temporal_simplify_min_dist(const Temporal *temp, double dist); -extern Temporal *temporal_simplify_min_tdelta(const Temporal *temp, const Interval *mint); +extern Set *geogset_in(const char *str); +extern Set *geomset_in(const char *str); +extern char *spatialset_as_text(const Set *set, int maxdd); +extern char *spatialset_as_ewkt(const Set *set, int maxdd); -extern Temporal *temporal_tprecision(const Temporal *temp, const Interval *duration, TimestampTz origin); -extern Temporal *temporal_tsample(const Temporal *temp, const Interval *duration, TimestampTz origin, interpType interp); +extern Set *geoset_make(const GSERIALIZED **values, int count); -extern double temporal_dyntimewarp_distance(const Temporal *temp1, const Temporal *temp2); -extern Match *temporal_dyntimewarp_path(const Temporal *temp1, const Temporal *temp2, int *count); -extern double temporal_frechet_distance(const Temporal *temp1, const Temporal *temp2); -extern Match *temporal_frechet_path(const Temporal *temp1, const Temporal *temp2, int *count); -extern double temporal_hausdorff_distance(const Temporal *temp1, const Temporal *temp2); +extern Set *geo_to_set(const GSERIALIZED *gs); -extern int64 bigint_get_bin(int64 value, int64 vsize, int64 vorigin); -/* extern Span *bigintspan_bins(const Span *s, int64 vsize, int64 vorigin, int *count); (undefined) */ -/* extern Span *bigintspanset_bins(const SpanSet *ss, int64 vsize, int64 vorigin, int *count); (undefined) */ -extern Span *bigintspanset_value_spans(const SpanSet *ss, int64 vsize, int64 vorigin, int *count); -extern DateADT date_get_bin(DateADT d, const Interval *duration, DateADT torigin); -extern Span *datespan_bins(const Span *s, const Interval *duration, DateADT torigin, int *count); -/* extern Span *datespanset_bins(const SpanSet *ss, const Interval *duration, DateADT torigin, int *count); (undefined) */ -extern Span *datespanset_time_spans(const SpanSet *ss, const Interval *duration, DateADT torigin, int *count); -extern double float_get_bin(double value, double vsize, double vorigin); -extern Span *floatspan_bins(const Span *s, double vsize, double vorigin, int *count); -/* extern Span *floatspanset_bins(const SpanSet *ss, double vsize, double vorigin, - int *count); (undefined) */ -extern Span *floatspanset_value_spans(const SpanSet *ss, double vsize, double vorigin, int *count); -extern int int_get_bin(int value, int vsize, int vorigin); -extern Span *intspan_bins(const Span *s, int vsize, int vorigin, int *count); -/* extern Span *intspanset_bins(const SpanSet *ss, int vsize, int vorigin, int *count); (undefined) */ -extern Span *intspanset_value_spans(const SpanSet *ss, int vsize, int vorigin, int *count); -extern TimestampTz timestamptz_get_bin(TimestampTz t, const Interval *duration, TimestampTz torigin); -extern Span *tstzspan_bins(const Span *s, const Interval *duration, TimestampTz origin, int *count); -/* extern Span *tstzspanset_bins(const SpanSet *ss, const Interval *duration, TimestampTz torigin, int *count); (undefined) */ -extern Span *tstzspanset_time_spans(const SpanSet *ss, const Interval *duration, TimestampTz torigin, int *count); +extern GSERIALIZED *geoset_end_value(const Set *s); +extern GSERIALIZED *geoset_start_value(const Set *s); +extern bool geoset_value_n(const Set *s, int n, GSERIALIZED **result); +extern GSERIALIZED **geoset_values(const Set *s); -extern STBox *stbox_get_space_tile(const GSERIALIZED *point, double xsize, double ysize, double zsize, const GSERIALIZED *sorigin); -extern STBox *stbox_get_space_time_tile(const GSERIALIZED *point, TimestampTz t, double xsize, double ysize, double zsize, const Interval *duration, const GSERIALIZED *sorigin, TimestampTz torigin); -extern STBox *stbox_get_time_tile(TimestampTz t, const Interval *duration, TimestampTz torigin); -extern STBox *stbox_space_tiles(const STBox *bounds, double xsize, double ysize, double zsize, const GSERIALIZED *sorigin, bool border_inc, int *count); -extern STBox *stbox_space_time_tiles(const STBox *bounds, double xsize, double ysize, double zsize, const Interval *duration, const GSERIALIZED *sorigin, TimestampTz torigin, bool border_inc, int *count); -/* extern STBox *stbox_time_tiles(const STBox *bounds, const Interval *duration, TimestampTz torigin, bool border_inc, int *count); (undefined) */ -extern Span *temporal_time_spans(const Temporal *temp, const Interval *duration, TimestampTz origin, int *count); -extern Temporal **temporal_time_split(const Temporal *temp, const Interval *duration, TimestampTz torigin, TimestampTz **time_bins, int *count); -extern Span *tfloat_value_spans(const Temporal *temp, double vsize, double vorigin, int *count); -extern Temporal **tfloat_value_split(const Temporal *temp, double vsize, double vorigin, double **value_bins, int *count); -extern Temporal **tfloat_value_time_split(const Temporal *temp, double vsize, const Interval *duration, double vorigin, TimestampTz torigin, double **value_bins, TimestampTz **time_bins, int *count); -extern TBox *tfloatbox_get_time_tile(TimestampTz t, const Interval *duration, TimestampTz torigin); -extern TBox *tfloatbox_get_value_tile(double value, double vsize, double vorigin); -extern TBox *tfloatbox_get_value_time_tile(double value, TimestampTz t, double vsize, const Interval *duration, double vorigin, TimestampTz torigin); -/* extern TBox *tfloatbox_time_tiles(const TBox *box, const Interval *duration, TimestampTz torigin, int *count); (undefined) */ -/* extern TBox *tfloatbox_value_tiles(const TBox *box, double vsize, double vorigin, int *count); (undefined) */ -extern TBox *tfloatbox_value_time_tiles(const TBox *box, double vsize, const Interval *duration, double vorigin, TimestampTz torigin, int *count); -/* extern TimestampTz timestamptz_get_bin(TimestampTz timestamp, const Interval *duration, TimestampTz torigin); (repeated) */ -extern Span *tint_value_spans(const Temporal *temp, int vsize, int vorigin, int *count); -extern Temporal **tint_value_split(const Temporal *temp, int vsize, int vorigin, int **value_bins, int *count); -extern Temporal **tint_value_time_split(const Temporal *temp, int size, const Interval *duration, int vorigin, TimestampTz torigin, int **value_bins, TimestampTz **time_bins, int *count); -extern TBox *tintbox_get_time_tile(TimestampTz t, const Interval *duration, TimestampTz torigin); -extern TBox *tintbox_get_value_tile(int value, int vsize, int vorigin); -extern TBox *tintbox_get_value_time_tile(int value, TimestampTz t, int vsize, const Interval *duration, int vorigin, TimestampTz torigin); -/* extern TBox *tintbox_time_tiles(const TBox *box, const Interval *duration, TimestampTz torigin, int *count); (undefined) */ -/* extern TBox *tintbox_value_tiles(const TBox *box, int xsize, int xorigin, int *count); (undefined) */ -extern TBox *tintbox_value_time_tiles(const TBox *box, int xsize, const Interval *duration, int xorigin, TimestampTz torigin, int *count); -extern Temporal **tpoint_space_split(const Temporal *temp, double xsize, double ysize, double zsize, const GSERIALIZED *sorigin, bool bitmatrix, bool border_inc, GSERIALIZED ***space_bins, int *count); -extern Temporal **tpoint_space_time_split(const Temporal *temp, double xsize, double ysize, double zsize, const Interval *duration, const GSERIALIZED *sorigin, TimestampTz torigin, bool bitmatrix, bool border_inc, GSERIALIZED ***space_bins, TimestampTz **time_bins, int *count); -/* extern Temporal **tpoint_time_split(const Temporal *temp, const Interval *duration, TimestampTz torigin, bool border_inc, TimestampTz **time_bins, int *count); (undefined) */ +extern bool contained_geo_set(const GSERIALIZED *gs, const Set *s); +extern bool contains_set_geo(const Set *s, GSERIALIZED *gs); +extern Set *geo_union_transfn(Set *state, const GSERIALIZED *gs); +extern Set *intersection_geo_set(const GSERIALIZED *gs, const Set *s); +extern Set *intersection_set_geo(const Set *s, const GSERIALIZED *gs); +extern Set *minus_geo_set(const GSERIALIZED *gs, const Set *s); +extern Set *minus_set_geo(const Set *s, const GSERIALIZED *gs); +extern Set *union_geo_set(const GSERIALIZED *gs, const Set *s); +extern Set *union_set_geo(const Set *s, const GSERIALIZED *gs); -//-------------------- meos_catalog.h -------------------- +extern Set *spatialset_set_srid(const Set *s, int32_t srid); +extern int32_t spatialset_srid(const Set *s); +extern Set *spatialset_transform(const Set *s, int32_t srid); +extern Set *spatialset_transform_pipeline(const Set *s, const char *pipelinestr, int32_t srid, bool is_forward); +extern char *stbox_as_hexwkb(const STBox *box, uint8_t variant, size_t *size); +extern uint8_t *stbox_as_wkb(const STBox *box, uint8_t variant, size_t *size_out); +extern STBox *stbox_from_hexwkb(const char *hexwkb); +extern STBox *stbox_from_wkb(const uint8_t *wkb, size_t size); +extern STBox *stbox_in(const char *str); +extern char *stbox_out(const STBox *box, int maxdd); -//#include +extern STBox *geo_timestamptz_to_stbox(const GSERIALIZED *gs, TimestampTz t); +extern STBox *geo_tstzspan_to_stbox(const GSERIALIZED *gs, const Span *s); +extern STBox *stbox_copy(const STBox *box); +extern STBox *stbox_make(bool hasx, bool hasz, bool geodetic, int32 srid, double xmin, double xmax, double ymin, double ymax, double zmin, double zmax, const Span *s); -typedef signed short int16; +extern STBox *geo_to_stbox(const GSERIALIZED *gs); +extern STBox *spatialset_to_stbox(const Set *s); +extern BOX3D *stbox_to_box3d(const STBox *box); +extern GBOX *stbox_to_gbox(const STBox *box); +extern GSERIALIZED *stbox_to_geo(const STBox *box); +extern Span *stbox_to_tstzspan(const STBox *box); +extern STBox *timestamptz_to_stbox(TimestampTz t); +extern STBox *tstzset_to_stbox(const Set *s); +extern STBox *tstzspan_to_stbox(const Span *s); +extern STBox *tstzspanset_to_stbox(const SpanSet *ss); -//#include +extern double stbox_area(const STBox *box, bool spheroid); +extern bool stbox_hast(const STBox *box); +extern bool stbox_hasx(const STBox *box); +extern bool stbox_hasz(const STBox *box); +extern bool stbox_isgeodetic(const STBox *box); +extern double stbox_perimeter(const STBox *box, bool spheroid); +extern bool stbox_tmax(const STBox *box, TimestampTz *result); +extern bool stbox_tmax_inc(const STBox *box, bool *result); +extern bool stbox_tmin(const STBox *box, TimestampTz *result); +extern bool stbox_tmin_inc(const STBox *box, bool *result); +extern double stbox_volume(const STBox *box); +extern bool stbox_xmax(const STBox *box, double *result); +extern bool stbox_xmin(const STBox *box, double *result); +extern bool stbox_ymax(const STBox *box, double *result); +extern bool stbox_ymin(const STBox *box, double *result); +extern bool stbox_zmax(const STBox *box, double *result); +extern bool stbox_zmin(const STBox *box, double *result); -typedef enum -{ - T_UNKNOWN = 0, - T_BOOL = 1, - T_DATE = 2, - T_DATEMULTIRANGE = 3, - T_DATERANGE = 4, - T_DATESET = 5, - T_DATESPAN = 6, - T_DATESPANSET = 7, - T_DOUBLE2 = 8, - T_DOUBLE3 = 9, - T_DOUBLE4 = 10, - T_FLOAT8 = 11, - T_FLOATSET = 12, - T_FLOATSPAN = 13, - T_FLOATSPANSET = 14, - T_INT4 = 15, - T_INT4MULTIRANGE = 16, - T_INT4RANGE = 17, - T_INTSET = 18, - T_INTSPAN = 19, - T_INTSPANSET = 20, - T_INT8 = 21, - T_INT8MULTIRANGE = 52, - T_INT8RANGE = 53, - T_BIGINTSET = 22, - T_BIGINTSPAN = 23, - T_BIGINTSPANSET = 24, - T_STBOX = 25, - T_TBOOL = 26, - T_TBOX = 27, - T_TDOUBLE2 = 28, - T_TDOUBLE3 = 29, - T_TDOUBLE4 = 30, - T_TEXT = 31, - T_TEXTSET = 32, - T_TFLOAT = 33, - T_TIMESTAMPTZ = 34, - T_TINT = 35, - T_TSTZMULTIRANGE = 36, - T_TSTZRANGE = 37, - T_TSTZSET = 38, - T_TSTZSPAN = 39, - T_TSTZSPANSET = 40, - T_TTEXT = 41, - T_GEOMETRY = 42, - T_GEOMSET = 43, - T_GEOGRAPHY = 44, - T_GEOGSET = 45, - T_TGEOMPOINT = 46, - T_TGEOGPOINT = 47, - T_NPOINT = 48, - T_NPOINTSET = 49, - T_NSEGMENT = 50, - T_TNPOINT = 51, - T_POSE = 54, - T_TPOSE = 55, -} meosType; +extern STBox *stbox_expand_space(const STBox *box, double d); +extern STBox *stbox_expand_time(const STBox *box, const Interval *interv); +extern STBox *stbox_get_space(const STBox *box); +extern STBox *stbox_quad_split(const STBox *box, int *count); +extern STBox *stbox_round(const STBox *box, int maxdd); +extern STBox *stbox_shift_scale_time(const STBox *box, const Interval *shift, const Interval *duration); +extern STBox *stboxarr_round(const STBox *boxarr, int count, int maxdd); -#define NO_MEOS_TYPES 56 -typedef enum -{ - UNKNOWN_OP = 0, - EQ_OP = 1, - NE_OP = 2, - LT_OP = 3, - LE_OP = 4, - GT_OP = 5, - GE_OP = 6, - ADJACENT_OP = 7, - UNION_OP = 8, - MINUS_OP = 9, - INTERSECT_OP = 10, - OVERLAPS_OP = 11, - CONTAINS_OP = 12, - CONTAINED_OP = 13, - SAME_OP = 14, - LEFT_OP = 15, - OVERLEFT_OP = 16, - RIGHT_OP = 17, - OVERRIGHT_OP = 18, - BELOW_OP = 19, - OVERBELOW_OP = 20, - ABOVE_OP = 21, - OVERABOVE_OP = 22, - FRONT_OP = 23, - OVERFRONT_OP = 24, - BACK_OP = 25, - OVERBACK_OP = 26, - BEFORE_OP = 27, - OVERBEFORE_OP = 28, - AFTER_OP = 29, - OVERAFTER_OP = 30, - EVEREQ_OP = 31, - EVERNE_OP = 32, - EVERLT_OP = 33, - EVERLE_OP = 34, - EVERGT_OP = 35, - EVERGE_OP = 36, - ALWAYSEQ_OP = 37, - ALWAYSNE_OP = 38, - ALWAYSLT_OP = 39, - ALWAYSLE_OP = 40, - ALWAYSGT_OP = 41, - ALWAYSGE_OP = 42, -} meosOper; +extern STBox *stbox_set_srid(const STBox *box, int32_t srid); +extern int32_t stbox_srid(const STBox *box); +extern STBox *stbox_transform(const STBox *box, int32_t srid); +extern STBox *stbox_transform_pipeline(const STBox *box, const char *pipelinestr, int32_t srid, bool is_forward); -typedef struct -{ - meosType temptype; - meosType basetype; -} temptype_catalog_struct; +extern bool adjacent_stbox_stbox(const STBox *box1, const STBox *box2); +extern bool contained_stbox_stbox(const STBox *box1, const STBox *box2); +extern bool contains_stbox_stbox(const STBox *box1, const STBox *box2); +extern bool overlaps_stbox_stbox(const STBox *box1, const STBox *box2); +extern bool same_stbox_stbox(const STBox *box1, const STBox *box2); -typedef struct -{ - meosType settype; - meosType basetype; -} settype_catalog_struct; +extern bool above_stbox_stbox(const STBox *box1, const STBox *box2); +extern bool after_stbox_stbox(const STBox *box1, const STBox *box2); +extern bool back_stbox_stbox(const STBox *box1, const STBox *box2); +extern bool before_stbox_stbox(const STBox *box1, const STBox *box2); +extern bool below_stbox_stbox(const STBox *box1, const STBox *box2); +extern bool front_stbox_stbox(const STBox *box1, const STBox *box2); +extern bool left_stbox_stbox(const STBox *box1, const STBox *box2); +extern bool overabove_stbox_stbox(const STBox *box1, const STBox *box2); +extern bool overafter_stbox_stbox(const STBox *box1, const STBox *box2); +extern bool overback_stbox_stbox(const STBox *box1, const STBox *box2); +extern bool overbefore_stbox_stbox(const STBox *box1, const STBox *box2); +extern bool overbelow_stbox_stbox(const STBox *box1, const STBox *box2); +extern bool overfront_stbox_stbox(const STBox *box1, const STBox *box2); +extern bool overleft_stbox_stbox(const STBox *box1, const STBox *box2); +extern bool overright_stbox_stbox(const STBox *box1, const STBox *box2); +extern bool right_stbox_stbox(const STBox *box1, const STBox *box2); -typedef struct -{ - meosType spantype; - meosType basetype; -} spantype_catalog_struct; +extern STBox *union_stbox_stbox(const STBox *box1, const STBox *box2, bool strict); +extern STBox *intersection_stbox_stbox(const STBox *box1, const STBox *box2); + +extern int stbox_cmp(const STBox *box1, const STBox *box2); +extern bool stbox_eq(const STBox *box1, const STBox *box2); +extern bool stbox_ge(const STBox *box1, const STBox *box2); +extern bool stbox_gt(const STBox *box1, const STBox *box2); +extern bool stbox_le(const STBox *box1, const STBox *box2); +extern bool stbox_lt(const STBox *box1, const STBox *box2); +extern bool stbox_ne(const STBox *box1, const STBox *box2); -typedef struct -{ - meosType spansettype; - meosType spantype; -} spansettype_catalog_struct; +extern RTree *rtree_create_stbox(); +extern void rtree_free(RTree *rtree); +extern void rtree_insert(RTree *rtree, STBox *box, int64 id); +extern int *rtree_search(const RTree *rtree,const STBox *query, int *count); -/* extern bool temptype_subtype(tempSubtype subtype); (undefined) */ -/* extern bool temptype_subtype_all(tempSubtype subtype); (undefined) */ -extern const char *tempsubtype_name(tempSubtype subtype); -extern bool tempsubtype_from_string(const char *str, int16 *subtype); -extern const char *meosoper_name(meosOper oper); -extern meosOper meosoper_from_string(const char *name); -extern const char *interptype_name(interpType interp); -extern interpType interptype_from_string(const char *interp_str); +extern char *tgeo_out(const Temporal *temp, int maxdd); +extern Temporal *tgeogpoint_from_mfjson(const char *str); +extern Temporal *tgeogpoint_in(const char *str); +extern Temporal *tgeography_from_mfjson(const char *mfjson); +extern Temporal *tgeography_in(const char *str); +extern Temporal *tgeometry_from_mfjson(const char *str); +extern Temporal *tgeometry_in(const char *str); +extern Temporal *tgeompoint_from_mfjson(const char *str); +extern Temporal *tgeompoint_in(const char *str); +extern char *tspatial_as_ewkt(const Temporal *temp, int maxdd); +extern char *tspatial_as_text(const Temporal *temp, int maxdd); + +extern Temporal *tgeo_from_base_temp(const GSERIALIZED *gs, const Temporal *temp); +extern TInstant *tgeoinst_make(const GSERIALIZED *gs, TimestampTz t); +extern TSequence *tgeoseq_from_base_tstzset(const GSERIALIZED *gs, const Set *s); +extern TSequence *tgeoseq_from_base_tstzspan(const GSERIALIZED *gs, const Span *s, interpType interp); +extern TSequenceSet *tgeoseqset_from_base_tstzspanset(const GSERIALIZED *gs, const SpanSet *ss, interpType interp); +extern Temporal *tpoint_from_base_temp(const GSERIALIZED *gs, const Temporal *temp); +extern TInstant *tpointinst_make(const GSERIALIZED *gs, TimestampTz t); +extern TSequence *tpointseq_from_base_tstzset(const GSERIALIZED *gs, const Set *s); +extern TSequence *tpointseq_from_base_tstzspan(const GSERIALIZED *gs, const Span *s, interpType interp); +extern TSequence *tpointseq_make_coords(const double *xcoords, const double *ycoords, const double *zcoords, const TimestampTz *times, int count, int32 srid, bool geodetic, bool lower_inc, bool upper_inc, interpType interp, bool normalize); +extern TSequenceSet *tpointseqset_from_base_tstzspanset(const GSERIALIZED *gs, const SpanSet *ss, interpType interp); -extern const char *meostype_name(meosType type); -extern meosType temptype_basetype(meosType type); -extern meosType settype_basetype(meosType type); -extern meosType spantype_basetype(meosType type); -extern meosType spantype_spansettype(meosType type); -extern meosType spansettype_spantype(meosType type); -extern meosType basetype_spantype(meosType type); -extern meosType basetype_settype(meosType type); +extern STBox *box3d_to_stbox(const BOX3D *box); +extern STBox *gbox_to_stbox(const GBOX *box); +extern Temporal *geomeas_to_tpoint(const GSERIALIZED *gs); +extern Temporal *tgeogpoint_to_tgeography(const Temporal *temp); +extern Temporal *tgeography_to_tgeogpoint(const Temporal *temp); +extern Temporal *tgeography_to_tgeometry(const Temporal *temp); +extern Temporal *tgeometry_to_tgeography(const Temporal *temp); +extern Temporal *tgeometry_to_tgeompoint(const Temporal *temp); +extern Temporal *tgeompoint_to_tgeometry(const Temporal *temp); +extern bool tpoint_as_mvtgeom(const Temporal *temp, const STBox *bounds, int32_t extent, int32_t buffer, bool clip_geom, GSERIALIZED **gsarr, int64 **timesarr, int *count); +extern bool tpoint_tfloat_to_geomeas(const Temporal *tpoint, const Temporal *measure, bool segmentize, GSERIALIZED **result); +extern STBox *tspatial_to_stbox(const Temporal *temp); -/* extern bool meos_basetype(meosType type); (undefined) */ -/* extern bool alpha_basetype(meosType type); (undefined) */ -extern bool tnumber_basetype(meosType type); -/* extern bool alphanum_basetype(meosType type); (undefined) */ -extern bool geo_basetype(meosType type); -extern bool spatial_basetype(meosType type); +extern bool bearing_point_point(const GSERIALIZED *gs1, const GSERIALIZED *gs2, double *result); +extern Temporal *bearing_tpoint_point(const Temporal *temp, const GSERIALIZED *gs, bool invert); +extern Temporal *bearing_tpoint_tpoint(const Temporal *temp1, const Temporal *temp2); +extern Temporal *tgeo_centroid(const Temporal *temp); +extern GSERIALIZED *tgeo_convex_hull(const Temporal *temp); +extern GSERIALIZED *tgeo_end_value(const Temporal *temp); +extern GSERIALIZED *tgeo_start_value(const Temporal *temp); +extern GSERIALIZED *tgeo_traversed_area(const Temporal *temp, bool unary_union); +extern bool tgeo_value_at_timestamptz(const Temporal *temp, TimestampTz t, bool strict, GSERIALIZED **value); +extern bool tgeo_value_n(const Temporal *temp, int n, GSERIALIZED **result); +extern GSERIALIZED **tgeo_values(const Temporal *temp, int *count); +extern Temporal *tpoint_angular_difference(const Temporal *temp); +extern Temporal *tpoint_azimuth(const Temporal *temp); +extern Temporal *tpoint_cumulative_length(const Temporal *temp); +extern bool tpoint_direction(const Temporal *temp, double *result); +extern Temporal *tpoint_get_x(const Temporal *temp); +extern Temporal *tpoint_get_y(const Temporal *temp); +extern Temporal *tpoint_get_z(const Temporal *temp); +extern bool tpoint_is_simple(const Temporal *temp); +extern double tpoint_length(const Temporal *temp); +extern Temporal *tpoint_speed(const Temporal *temp); +extern GSERIALIZED *tpoint_trajectory(const Temporal *temp, bool unary_union); +extern GSERIALIZED *tpoint_twcentroid(const Temporal *temp); -extern bool time_type(meosType type); -/* extern bool set_basetype(meosType type); (undefined) */ +extern Temporal *tgeo_affine(const Temporal *temp, const AFFINE *a); +extern Temporal *tgeo_scale(const Temporal *temp, const GSERIALIZED *scale, const GSERIALIZED *sorigin); +extern Temporal **tpoint_make_simple(const Temporal *temp, int *count); -extern bool set_type(meosType type); -extern bool numset_type(meosType type); -extern bool ensure_numset_type(meosType type); -extern bool timeset_type(meosType type); -/* extern bool ensure_timeset_type(meosType type); (undefined) */ -extern bool set_spantype(meosType type); -extern bool ensure_set_spantype(meosType type); -extern bool alphanumset_type(meosType settype); -extern bool geoset_type(meosType type); -extern bool ensure_geoset_type(meosType type); -extern bool spatialset_type(meosType type); -extern bool ensure_spatialset_type(meosType type); +int32_t tspatial_srid(const Temporal *temp); +extern Temporal *tspatial_set_srid(const Temporal *temp, int32_t srid); +extern Temporal *tspatial_transform(const Temporal *temp, int32_t srid); +extern Temporal *tspatial_transform_pipeline(const Temporal *temp, const char *pipelinestr, int32_t srid, bool is_forward); + +extern Temporal *tgeo_at_geom(const Temporal *temp, const GSERIALIZED *gs); +extern Temporal *tgeo_at_stbox(const Temporal *temp, const STBox *box, bool border_inc); +extern Temporal *tgeo_at_value(const Temporal *temp, GSERIALIZED *gs); +extern Temporal *tgeo_minus_geom(const Temporal *temp, const GSERIALIZED *gs); +extern Temporal *tgeo_minus_stbox(const Temporal *temp, const STBox *box, bool border_inc); +extern Temporal *tgeo_minus_value(const Temporal *temp, GSERIALIZED *gs); +extern Temporal *tpoint_at_geom(const Temporal *temp, const GSERIALIZED *gs, const Span *zspan); +extern Temporal *tpoint_at_value(const Temporal *temp, GSERIALIZED *gs); +extern Temporal *tpoint_minus_geom(const Temporal *temp, const GSERIALIZED *gs, const Span *zspan); +extern Temporal *tpoint_minus_value(const Temporal *temp, GSERIALIZED *gs); -extern bool span_basetype(meosType type); -extern bool span_canon_basetype(meosType type); -extern bool span_type(meosType type); -/* extern bool span_bbox_type(meosType type); (undefined) */ -extern bool numspan_basetype(meosType type); -extern bool numspan_type(meosType type); -extern bool ensure_numspan_type(meosType type); -extern bool timespan_basetype(meosType type); -extern bool timespan_type(meosType type); -/* extern bool ensure_timespan_type(meosType type); (undefined) */ +extern int always_eq_geo_tgeo(const GSERIALIZED *gs, const Temporal *temp); +extern int always_eq_tgeo_geo(const Temporal *temp, const GSERIALIZED *gs); +extern int always_eq_tgeo_tgeo(const Temporal *temp1, const Temporal *temp2); +extern int always_ne_geo_tgeo(const GSERIALIZED *gs, const Temporal *temp); +extern int always_ne_tgeo_geo(const Temporal *temp, const GSERIALIZED *gs); +extern int always_ne_tgeo_tgeo(const Temporal *temp1, const Temporal *temp2); +extern int ever_eq_geo_tgeo(const GSERIALIZED *gs, const Temporal *temp); +extern int ever_eq_tgeo_geo(const Temporal *temp, const GSERIALIZED *gs); +extern int ever_eq_tgeo_tgeo(const Temporal *temp1, const Temporal *temp2); +extern int ever_ne_geo_tgeo(const GSERIALIZED *gs, const Temporal *temp); +extern int ever_ne_tgeo_geo(const Temporal *temp, const GSERIALIZED *gs); +extern int ever_ne_tgeo_tgeo(const Temporal *temp1, const Temporal *temp2); + +extern Temporal *teq_geo_tgeo(const GSERIALIZED *gs, const Temporal *temp); +extern Temporal *teq_tgeo_geo(const Temporal *temp, const GSERIALIZED *gs); +extern Temporal *tne_geo_tgeo(const GSERIALIZED *gs, const Temporal *temp); +extern Temporal *tne_tgeo_geo(const Temporal *temp, const GSERIALIZED *gs); + +extern STBox *tgeo_stboxes(const Temporal *temp, int *count); +extern STBox *tgeo_space_boxes(const Temporal *temp, double xsize, double ysize, double zsize, const GSERIALIZED *sorigin, bool bitmatrix, bool border_inc, int *count); +extern STBox *tgeo_space_time_boxes(const Temporal *temp, double xsize, double ysize, double zsize, const Interval *duration, const GSERIALIZED *sorigin, TimestampTz torigin, bool bitmatrix, bool border_inc, int *count); +extern STBox *tgeo_split_each_n_stboxes(const Temporal *temp, int elem_count, int *count); +extern STBox *tgeo_split_n_stboxes(const Temporal *temp, int box_count, int *count); + +extern bool adjacent_stbox_tspatial(const STBox *box, const Temporal *temp); +extern bool adjacent_tspatial_stbox(const Temporal *temp, const STBox *box); +extern bool adjacent_tspatial_tspatial(const Temporal *temp1, const Temporal *temp2); +extern bool contained_stbox_tspatial(const STBox *box, const Temporal *temp); +extern bool contained_tspatial_stbox(const Temporal *temp, const STBox *box); +extern bool contained_tspatial_tspatial(const Temporal *temp1, const Temporal *temp2); +extern bool contains_stbox_tspatial(const STBox *box, const Temporal *temp); +extern bool contains_tspatial_stbox(const Temporal *temp, const STBox *box); +extern bool contains_tspatial_tspatial(const Temporal *temp1, const Temporal *temp2); +extern bool overlaps_stbox_tspatial(const STBox *box, const Temporal *temp); +extern bool overlaps_tspatial_stbox(const Temporal *temp, const STBox *box); +extern bool overlaps_tspatial_tspatial(const Temporal *temp1, const Temporal *temp2); +extern bool same_stbox_tspatial(const STBox *box, const Temporal *temp); +extern bool same_tspatial_stbox(const Temporal *temp, const STBox *box); +extern bool same_tspatial_tspatial(const Temporal *temp1, const Temporal *temp2); + +extern bool above_stbox_tspatial(const STBox *box, const Temporal *temp); +extern bool above_tspatial_stbox(const Temporal *temp, const STBox *box); +extern bool above_tspatial_tspatial(const Temporal *temp1, const Temporal *temp2); +extern bool after_stbox_tspatial(const STBox *box, const Temporal *temp); +extern bool after_tspatial_stbox(const Temporal *temp, const STBox *box); +extern bool after_tspatial_tspatial(const Temporal *temp1, const Temporal *temp2); +extern bool back_stbox_tspatial(const STBox *box, const Temporal *temp); +extern bool back_tspatial_stbox(const Temporal *temp, const STBox *box); +extern bool back_tspatial_tspatial(const Temporal *temp1, const Temporal *temp2); +extern bool before_stbox_tspatial(const STBox *box, const Temporal *temp); +extern bool before_tspatial_stbox(const Temporal *temp, const STBox *box); +extern bool before_tspatial_tspatial(const Temporal *temp1, const Temporal *temp2); +extern bool below_stbox_tspatial(const STBox *box, const Temporal *temp); +extern bool below_tspatial_stbox(const Temporal *temp, const STBox *box); +extern bool below_tspatial_tspatial(const Temporal *temp1, const Temporal *temp2); +extern bool front_stbox_tspatial(const STBox *box, const Temporal *temp); +extern bool front_tspatial_stbox(const Temporal *temp, const STBox *box); +extern bool front_tspatial_tspatial(const Temporal *temp1, const Temporal *temp2); +extern bool left_stbox_tspatial(const STBox *box, const Temporal *temp); +extern bool left_tspatial_stbox(const Temporal *temp, const STBox *box); +extern bool left_tspatial_tspatial(const Temporal *temp1, const Temporal *temp2); +extern bool overabove_stbox_tspatial(const STBox *box, const Temporal *temp); +extern bool overabove_tspatial_stbox(const Temporal *temp, const STBox *box); +extern bool overabove_tspatial_tspatial(const Temporal *temp1, const Temporal *temp2); +extern bool overafter_stbox_tspatial(const STBox *box, const Temporal *temp); +extern bool overafter_tspatial_stbox(const Temporal *temp, const STBox *box); +extern bool overafter_tspatial_tspatial(const Temporal *temp1, const Temporal *temp2); +extern bool overback_stbox_tspatial(const STBox *box, const Temporal *temp); +extern bool overback_tspatial_stbox(const Temporal *temp, const STBox *box); +extern bool overback_tspatial_tspatial(const Temporal *temp1, const Temporal *temp2); +extern bool overbefore_stbox_tspatial(const STBox *box, const Temporal *temp); +extern bool overbefore_tspatial_stbox(const Temporal *temp, const STBox *box); +extern bool overbefore_tspatial_tspatial(const Temporal *temp1, const Temporal *temp2); +extern bool overbelow_stbox_tspatial(const STBox *box, const Temporal *temp); +extern bool overbelow_tspatial_stbox(const Temporal *temp, const STBox *box); +extern bool overbelow_tspatial_tspatial(const Temporal *temp1, const Temporal *temp2); +extern bool overfront_stbox_tspatial(const STBox *box, const Temporal *temp); +extern bool overfront_tspatial_stbox(const Temporal *temp, const STBox *box); +extern bool overfront_tspatial_tspatial(const Temporal *temp1, const Temporal *temp2); +extern bool overleft_stbox_tspatial(const STBox *box, const Temporal *temp); +extern bool overleft_tspatial_stbox(const Temporal *temp, const STBox *box); +extern bool overleft_tspatial_tspatial(const Temporal *temp1, const Temporal *temp2); +extern bool overright_stbox_tspatial(const STBox *box, const Temporal *temp); +extern bool overright_tspatial_stbox(const Temporal *temp, const STBox *box); +extern bool overright_tspatial_tspatial(const Temporal *temp1, const Temporal *temp2); +extern bool right_stbox_tspatial(const STBox *box, const Temporal *temp); +extern bool right_tspatial_stbox(const Temporal *temp, const STBox *box); +extern bool right_tspatial_tspatial(const Temporal *temp1, const Temporal *temp2); + +extern int acontains_geo_tgeo(const GSERIALIZED *gs, const Temporal *temp); +extern int acontains_tgeo_geo(const Temporal *temp, const GSERIALIZED *gs); +extern int acontains_tgeo_tgeo(const Temporal *temp1, const Temporal *temp2); +extern int adisjoint_tgeo_geo(const Temporal *temp, const GSERIALIZED *gs); +extern int adisjoint_tgeo_tgeo(const Temporal *temp1, const Temporal *temp2); +extern int adwithin_tgeo_geo(const Temporal *temp, const GSERIALIZED *gs, double dist); +extern int adwithin_tgeo_tgeo(const Temporal *temp1, const Temporal *temp2, double dist); +extern int aintersects_tgeo_geo(const Temporal *temp, const GSERIALIZED *gs); +extern int aintersects_tgeo_tgeo(const Temporal *temp1, const Temporal *temp2); +extern int atouches_tgeo_geo(const Temporal *temp, const GSERIALIZED *gs); +extern int atouches_tgeo_tgeo(const Temporal *temp1, const Temporal *temp2); +extern int atouches_tpoint_geo(const Temporal *temp, const GSERIALIZED *gs); +extern int econtains_geo_tgeo(const GSERIALIZED *gs, const Temporal *temp); +extern int econtains_tgeo_geo(const Temporal *temp, const GSERIALIZED *gs); +extern int econtains_tgeo_tgeo(const Temporal *temp1, const Temporal *temp2); +extern int ecovers_geo_tgeo(const GSERIALIZED *gs, const Temporal *temp); +extern int ecovers_tgeo_geo(const Temporal *temp, const GSERIALIZED *gs); +extern int ecovers_tgeo_tgeo(const Temporal *temp1, const Temporal *temp2); +extern int edisjoint_tgeo_geo(const Temporal *temp, const GSERIALIZED *gs); +extern int edisjoint_tgeo_tgeo(const Temporal *temp1, const Temporal *temp2); +extern int edwithin_tgeo_geo(const Temporal *temp, const GSERIALIZED *gs, double dist); +extern int edwithin_tgeo_tgeo(const Temporal *temp1, const Temporal *temp2, double dist); +extern int eintersects_tgeo_geo(const Temporal *temp, const GSERIALIZED *gs); +extern int eintersects_tgeo_tgeo(const Temporal *temp1, const Temporal *temp2); +extern int etouches_tgeo_geo(const Temporal *temp, const GSERIALIZED *gs); +extern int etouches_tgeo_tgeo(const Temporal *temp1, const Temporal *temp2); +extern int etouches_tpoint_geo(const Temporal *temp, const GSERIALIZED *gs); -extern bool spanset_type(meosType type); -/* extern bool numspanset_type(meosType type); (undefined) */ -extern bool timespanset_type(meosType type); -extern bool ensure_timespanset_type(meosType type); +extern Temporal *tcontains_geo_tgeo(const GSERIALIZED *gs, const Temporal *temp, bool restr, bool atvalue); +extern Temporal *tcontains_tgeo_geo(const Temporal *temp, const GSERIALIZED *gs, bool restr, bool atvalue); +extern Temporal *tcontains_tgeo_tgeo(const Temporal *temp1, const Temporal *temp2, bool restr, bool atvalue); +extern Temporal *tcovers_geo_tgeo(const GSERIALIZED *gs, const Temporal *temp, bool restr, bool atvalue); +extern Temporal *tcovers_tgeo_geo(const Temporal *temp, const GSERIALIZED *gs, bool restr, bool atvalue); +extern Temporal *tcovers_tgeo_tgeo(const Temporal *temp1, const Temporal *temp2, bool restr, bool atvalue); +extern Temporal *tdisjoint_geo_tgeo(const GSERIALIZED *gs, const Temporal *temp, bool restr, bool atvalue); +extern Temporal *tdisjoint_tgeo_geo(const Temporal *temp, const GSERIALIZED *gs, bool restr, bool atvalue); +extern Temporal *tdisjoint_tgeo_tgeo(const Temporal *temp1, const Temporal *temp2, bool restr, bool atvalue); +extern Temporal *tdwithin_geo_tgeo(const GSERIALIZED *gs, const Temporal *temp, double dist, bool restr, bool atvalue); +extern Temporal *tdwithin_tgeo_geo(const Temporal *temp, const GSERIALIZED *gs, double dist, bool restr, bool atvalue); +extern Temporal *tdwithin_tgeo_tgeo(const Temporal *temp1, const Temporal *temp2, double dist, bool restr, bool atvalue); +extern Temporal *tintersects_geo_tgeo(const GSERIALIZED *gs, const Temporal *temp, bool restr, bool atvalue); +extern Temporal *tintersects_tgeo_geo(const Temporal *temp, const GSERIALIZED *gs, bool restr, bool atvalue); +extern Temporal *tintersects_tgeo_tgeo(const Temporal *temp1, const Temporal *temp2, bool restr, bool atvalue); +extern Temporal *ttouches_geo_tgeo(const GSERIALIZED *gs, const Temporal *temp, bool restr, bool atvalue); +extern Temporal *ttouches_tgeo_geo(const Temporal *temp, const GSERIALIZED *gs, bool restr, bool atvalue); +extern Temporal *ttouches_tgeo_tgeo(const Temporal *temp1, const Temporal *temp2, bool restr, bool atvalue); + +extern Temporal *tdistance_tgeo_geo(const Temporal *temp, const GSERIALIZED *gs); +extern Temporal *tdistance_tgeo_tgeo(const Temporal *temp1, const Temporal *temp2); +extern double nad_stbox_geo(const STBox *box, const GSERIALIZED *gs); +extern double nad_stbox_stbox(const STBox *box1, const STBox *box2); +extern double nad_tgeo_geo(const Temporal *temp, const GSERIALIZED *gs); +extern double nad_tgeo_stbox(const Temporal *temp, const STBox *box); +extern double nad_tgeo_tgeo(const Temporal *temp1, const Temporal *temp2); +extern TInstant *nai_tgeo_geo(const Temporal *temp, const GSERIALIZED *gs); +extern TInstant *nai_tgeo_tgeo(const Temporal *temp1, const Temporal *temp2); +extern GSERIALIZED *shortestline_tgeo_geo(const Temporal *temp, const GSERIALIZED *gs); +extern GSERIALIZED *shortestline_tgeo_tgeo(const Temporal *temp1, const Temporal *temp2); -extern bool temporal_type(meosType type); -/* extern bool temporal_basetype(meosType type); (undefined) */ -extern bool temptype_continuous(meosType type); -extern bool basetype_byvalue(meosType type); -extern bool basetype_varlength(meosType type); -extern int16 basetype_length(meosType type); -/* extern bool talphanum_type(meosType type); (undefined) */ -extern bool talpha_type(meosType type); -extern bool tnumber_type(meosType type); -extern bool ensure_tnumber_type(meosType type); -extern bool ensure_tnumber_basetype(meosType type); -/* extern bool tnumber_settype(meosType type); (undefined) */ -extern bool tnumber_spantype(meosType type); -extern bool tnumber_spansettype(meosType type); -extern bool tspatial_type(meosType type); -extern bool ensure_tspatial_type(meosType type); -extern bool tspatial_basetype(meosType type); -extern bool tgeo_type(meosType type); -extern bool ensure_tgeo_type(meosType type); -extern bool ensure_tnumber_tgeo_type(meosType type); +extern Temporal *tpoint_tcentroid_finalfn(SkipList *state); +extern SkipList *tpoint_tcentroid_transfn(SkipList *state, Temporal *temp); +extern STBox *tspatial_extent_transfn(STBox *box, const Temporal *temp); - +extern STBox *stbox_get_space_tile(const GSERIALIZED *point, double xsize, double ysize, double zsize, const GSERIALIZED *sorigin); +extern STBox *stbox_get_space_time_tile(const GSERIALIZED *point, TimestampTz t, double xsize, double ysize, double zsize, const Interval *duration, const GSERIALIZED *sorigin, TimestampTz torigin); +extern STBox *stbox_get_time_tile(TimestampTz t, const Interval *duration, TimestampTz torigin); +extern STBox *stbox_space_tiles(const STBox *bounds, double xsize, double ysize, double zsize, const GSERIALIZED *sorigin, bool border_inc, int *count); +extern STBox *stbox_space_time_tiles(const STBox *bounds, double xsize, double ysize, double zsize, const Interval *duration, const GSERIALIZED *sorigin, TimestampTz torigin, bool border_inc, int *count); +extern STBox *stbox_time_tiles(const STBox *bounds, const Interval *duration, TimestampTz torigin, bool border_inc, int *count); +extern Temporal **tgeo_space_split(const Temporal *temp, double xsize, double ysize, double zsize, const GSERIALIZED *sorigin, bool bitmatrix, bool border_inc, GSERIALIZED ***space_bins, int *count); +extern Temporal **tgeo_space_time_split(const Temporal *temp, double xsize, double ysize, double zsize, const Interval *duration, const GSERIALIZED *sorigin, TimestampTz torigin, bool bitmatrix, bool border_inc, GSERIALIZED ***space_bins, TimestampTz **time_bins, int *count); + +extern int *geo_cluster_kmeans(const GSERIALIZED **geoms, uint32_t ngeoms, uint32_t k); +extern uint32_t *geo_cluster_dbscan(const GSERIALIZED **geoms, uint32_t ngeoms, double tolerance, int minpoints); +extern GSERIALIZED **geo_cluster_intersecting(const GSERIALIZED **geoms, uint32_t ngeoms, int *count); +extern GSERIALIZED **geo_cluster_within(const GSERIALIZED **geoms, uint32_t ngeoms, double tolerance, int *count); //-------------------- meos_internal.h -------------------- @@ -2388,21 +2628,108 @@ extern bool ensure_tnumber_tgeo_type(meosType type); //#include //#include "meos_catalog.h" + //#else + + + //#else + + + //#else + + + //#else + + + //#else + + + //#else + + + //#else + + + //#else + + + //#else + + + //#else + + + //#else + + + //#else + + + //#else + + + //#else + + + //#else + + + //#else + + + //#else + + + //#else + + + //#else + + + //#else + + + //#else + + + //#else + + + //#else + + + //#else + + + //#else + + +/* extern void *SET_BBOX_PTR(const Set *s); (undefined) */ +/* extern size_t *SET_OFFSETS_PTR(const Set *s); (undefined) */ +/* extern Datum SET_VAL_N(const Set *s, int index); (undefined) */ +/* extern const Span *SPANSET_SP_N(const SpanSet *ss, int index); (undefined) */ +//#else + +/* extern size_t *TSEQUENCE_OFFSETS_PTR(const TSequence *seq); (undefined) */ +/* extern const TInstant *TSEQUENCE_INST_N(const TSequence *seq, int index); (undefined) */ +/* extern size_t *TSEQUENCESET_OFFSETS_PTR(const TSequenceSet *ss); (undefined) */ +/* extern const TSequence *TSEQUENCESET_SEQ_N(const TSequenceSet *ss, int index); (undefined) */ +//#else + + + extern gsl_rng *gsl_get_generation_rng(void); extern gsl_rng *gsl_get_aggregation_rng(void); -extern PJ_CONTEXT *proj_get_context(void); - -extern Datum datum_floor(Datum d); extern Datum datum_ceil(Datum d); extern Datum datum_degrees(Datum d, Datum normalize); -extern Datum datum_radians(Datum d); +extern Datum datum_float_round(Datum value, Datum size); +extern Datum datum_floor(Datum d); extern uint32 datum_hash(Datum d, meosType basetype); extern uint64 datum_hash_extended(Datum d, meosType basetype, uint64 seed); - - +extern Datum datum_radians(Datum d); +extern void floatspan_round_set(const Span *s, int maxdd, Span *result); extern Set *set_in(const char *str, meosType basetype); extern char *set_out(const Set *s, int maxdd); @@ -2411,36 +2738,20 @@ extern char *span_out(const Span *s, int maxdd); extern SpanSet *spanset_in(const char *str, meosType spantype); extern char *spanset_out(const SpanSet *ss, int maxdd); -extern Set *set_cp(const Set *s); extern Set *set_make(const Datum *values, int count, meosType basetype, bool order); extern Set *set_make_exp(const Datum *values, int count, int maxcount, meosType basetype, bool order); extern Set *set_make_free(Datum *values, int count, meosType basetype, bool order); -extern Span *span_cp(const Span *s); extern Span *span_make(Datum lower, Datum upper, bool lower_inc, bool upper_inc, meosType basetype); extern void span_set(Datum lower, Datum upper, bool lower_inc, bool upper_inc, meosType basetype, meosType spantype, Span *s); -extern SpanSet *spanset_cp(const SpanSet *ss); extern SpanSet *spanset_make_exp(Span *spans, int count, int maxcount, bool normalize, bool order); extern SpanSet *spanset_make_free(Span *spans, int count, bool normalize, bool order); -extern Set *dateset_tstzset(const Set *s); -extern Span *datespan_tstzspan(const Span *s); -extern SpanSet *datespanset_tstzspanset(const SpanSet *ss); -extern Set *floatset_intset(const Set *s); -extern Span *floatspan_intspan(const Span *s); -extern SpanSet *floatspanset_intspanset(const SpanSet *ss); -extern Set *intset_floatset(const Set *s); -extern Span *intspan_floatspan(const Span *s); -extern SpanSet *intspanset_floatspanset(const SpanSet *ss); extern Span *set_span(const Set *s); extern SpanSet *set_spanset(const Set *s); -extern SpanSet *span_spanset(const Span *s); -extern Set *tstzset_dateset(const Set *s); -extern Span *tstzspan_datespan(const Span *s); -extern SpanSet *tstzspanset_datespanset(const SpanSet *ss); extern void value_set_span(Datum value, meosType basetype, Span *s); -extern Set *value_to_set(Datum d, meosType basetype); -extern Span *value_to_span(Datum d, meosType basetype); -extern SpanSet *value_to_spanset(Datum d, meosType basetype); +extern Set *value_set(Datum d, meosType basetype); +extern Span *value_span(Datum d, meosType basetype); +extern SpanSet *value_spanset(Datum d, meosType basetype); extern Datum numspan_width(const Span *s); extern Datum numspanset_width(const SpanSet *ss, bool boundspan); @@ -2458,11 +2769,6 @@ extern const Span **spanset_sps(const SpanSet *ss); extern Datum spanset_upper(const SpanSet *ss); extern void datespan_set_tstzspan(const Span *s1, Span *s2); -extern Set * floatset_deg(const Set *s, bool normalize); -extern Set * floatset_rad(const Set *s); -extern Set * floatset_rnd(const Set *s, int size); -extern Span *floatspan_rnd(const Span *s, int size); -extern SpanSet *floatspanset_rnd(const SpanSet *ss, int size); extern void floatspan_set_intspan(const Span *s1, Span *s2); extern void intspan_set_floatspan(const Span *s1, Span *s2); extern Set *numset_shift_scale(const Set *s, Datum shift, Datum width, bool hasshift, bool haswidth); @@ -2471,20 +2777,13 @@ extern SpanSet *numspanset_shift_scale(const SpanSet *ss, Datum shift, Datum wid extern Set *set_compact(const Set *s); extern void span_expand(const Span *s1, Span *s2); extern SpanSet *spanset_compact(const SpanSet *ss); +extern TBox *tbox_expand_value(const TBox *box, Datum value, meosType basetyp); extern Set *textcat_textset_text_int(const Set *s, const text *txt, bool invert); extern void tstzspan_set_datespan(const Span *s1, Span *s2); -extern int set_cmp_int(const Set *s1, const Set *s2); -extern int span_cmp_int(const Span *s1, const Span *s2); -extern bool span_eq_int(const Span *s1, const Span *s2); -extern int spanset_cmp_int(const SpanSet *ss1, const SpanSet *ss2); -extern bool spanset_eq_int(const SpanSet *ss1, const SpanSet *ss2); - -extern bool adj_span_span(const Span *s1, const Span *s2); extern bool adjacent_span_value(const Span *s, Datum value); extern bool adjacent_spanset_value(const SpanSet *ss, Datum value); extern bool adjacent_value_spanset(Datum value, const SpanSet *ss); -extern bool cont_span_span(const Span *s1, const Span *s2); extern bool contained_value_set(Datum value, const Set *s); extern bool contained_value_span(Datum value, const Span *s); extern bool contained_value_spanset(Datum value, const SpanSet *ss); @@ -2492,7 +2791,6 @@ extern bool contains_set_value(const Set *s, Datum value); extern bool contains_span_value(const Span *s, Datum value); extern bool contains_spanset_value(const SpanSet *ss, Datum value); extern bool ovadj_span_span(const Span *s1, const Span *s2); -extern bool over_span_span(const Span *s1, const Span *s2); extern bool left_set_value(const Set *s, Datum value); extern bool left_span_value(const Span *s, Datum value); @@ -2500,7 +2798,6 @@ extern bool left_spanset_value(const SpanSet *ss, Datum value); extern bool left_value_set(Datum value, const Set *s); extern bool left_value_span(Datum value, const Span *s); extern bool left_value_spanset(Datum value, const SpanSet *ss); -extern bool lf_span_span(const Span *s1, const Span *s2); extern bool lfnadj_span_span(const Span *s1, const Span *s2); extern bool overleft_set_value(const Set *s, Datum value); extern bool overleft_span_value(const Span *s, Datum value); @@ -2514,9 +2811,6 @@ extern bool overright_spanset_value(const SpanSet *ss, Datum value); extern bool overright_value_set(Datum value, const Set *s); extern bool overright_value_span(Datum value, const Span *s); extern bool overright_value_spanset(Datum value, const SpanSet *ss); -extern bool ovlf_span_span(const Span *s1, const Span *s2); -extern bool ovri_span_span(const Span *s1, const Span *s2); -extern bool ri_span_span(const Span *s1, const Span *s2); extern bool right_value_set(Datum value, const Set *s); extern bool right_set_value(const Set *s, Datum value); extern bool right_value_span(Datum value, const Span *s); @@ -2540,15 +2834,13 @@ extern Set *minus_value_set(Datum value, const Set *s); extern SpanSet *minus_value_span(Datum value, const Span *s); extern SpanSet *minus_value_spanset(Datum value, const SpanSet *ss); extern Span *super_union_span_span(const Span *s1, const Span *s2); -extern Set *union_set_value(const Set *s, const Datum value); +extern Set *union_set_value(const Set *s, Datum value); extern SpanSet *union_span_value(const Span *s, Datum value); extern SpanSet *union_spanset_value(const SpanSet *ss, Datum value); -extern Set *union_value_set(const Datum value, const Set *s); +extern Set *union_value_set(Datum value, const Set *s); extern SpanSet *union_value_span(Datum value, const Span *s); extern SpanSet *union_value_spanset(Datum value, const SpanSet *ss); -extern Datum dist_set_set(const Set *s1, const Set *s2); -extern Datum dist_span_span(const Span *s1, const Span *s2); extern Datum distance_set_set(const Set *s1, const Set *s2); extern Datum distance_set_value(const Set *s, Datum value); extern Datum distance_span_span(const Span *s1, const Span *s2); @@ -2563,122 +2855,74 @@ extern Set *value_union_transfn(Set *state, Datum value, meosType basetype); extern TBox *number_tstzspan_to_tbox(Datum d, meosType basetype, const Span *s); extern TBox *number_timestamptz_to_tbox(Datum d, meosType basetype, TimestampTz t); -extern STBox *stbox_cp(const STBox *box); -extern void stbox_set(bool hasx, bool hasz, bool geodetic, int32 srid, double xmin, double xmax, double ymin, double ymax, double zmin, double zmax, const Span *s, STBox *box); -extern TBox *tbox_cp(const TBox *box); extern void tbox_set(const Span *s, const Span *p, TBox *box); -extern STBox *box3d_to_stbox(const BOX3D *box); -extern STBox *gbox_to_stbox(const GBOX *box); extern void float_set_tbox(double d, TBox *box); -extern void gbox_set_stbox(const GBOX *box, int srid, STBox *result); -extern bool geo_set_stbox(const GSERIALIZED *gs, STBox *box); -extern void geoarr_set_stbox(const Datum *values, int count, STBox *box); extern void int_set_tbox(int i, TBox *box); extern void number_set_tbox(Datum d, meosType basetype, TBox *box); -extern TBox *number_to_tbox(Datum value, meosType basetype); +extern TBox *number_tbox(Datum value, meosType basetype); extern void numset_set_tbox(const Set *s, TBox *box); extern void numspan_set_tbox(const Span *span, TBox *box); -extern void numspanset_set_tbox(const SpanSet *ss, TBox *box); -extern void spatialset_set_stbox(const Set *set, STBox *box); -extern void stbox_set_box3d(const STBox *box, BOX3D *box3d); -extern void stbox_set_gbox(const STBox *box, GBOX *gbox); -extern void timestamptz_set_stbox(TimestampTz t, STBox *box); extern void timestamptz_set_tbox(TimestampTz t, TBox *box); -extern void tstzset_set_stbox(const Set *s, STBox *box); extern void tstzset_set_tbox(const Set *s, TBox *box); -extern void tstzspan_set_stbox(const Span *s, STBox *box); extern void tstzspan_set_tbox(const Span *s, TBox *box); -extern void tstzspanset_set_stbox(const SpanSet *ss, STBox *box); -extern void tstzspanset_set_tbox(const SpanSet *ss, TBox *box); extern TBox *tbox_shift_scale_value(const TBox *box, Datum shift, Datum width, bool hasshift, bool haswidth); -extern void stbox_expand(const STBox *box1, STBox *box2); extern void tbox_expand(const TBox *box1, TBox *box2); -extern bool inter_stbox_stbox(const STBox *box1, const STBox *box2, STBox *result); extern bool inter_tbox_tbox(const TBox *box1, const TBox *box2, TBox *result); -extern char **geoarr_as_text(const Datum *geoarr, int count, int maxdd, bool extended); -extern char *tboolinst_as_mfjson(const TInstant *inst, bool with_bbox); /* extern TInstant *tboolinst_from_mfjson(json_object *mfjson); (undefined type json_object) */ extern TInstant *tboolinst_in(const char *str); -extern char *tboolseq_as_mfjson(const TSequence *seq, bool with_bbox); /* extern TSequence *tboolseq_from_mfjson(json_object *mfjson); (undefined type json_object) */ extern TSequence *tboolseq_in(const char *str, interpType interp); -extern char *tboolseqset_as_mfjson(const TSequenceSet *ss, bool with_bbox); /* extern TSequenceSet *tboolseqset_from_mfjson(json_object *mfjson); (undefined type json_object) */ extern TSequenceSet *tboolseqset_in(const char *str); extern Temporal *temporal_in(const char *str, meosType temptype); extern char *temporal_out(const Temporal *temp, int maxdd); extern char **temparr_out(const Temporal **temparr, int count, int maxdd); -extern char *tfloatinst_as_mfjson(const TInstant *inst, bool with_bbox, int precision); /* extern TInstant *tfloatinst_from_mfjson(json_object *mfjson); (undefined type json_object) */ extern TInstant *tfloatinst_in(const char *str); -extern char *tfloatseq_as_mfjson(const TSequence *seq, bool with_bbox, int precision); /* extern TSequence *tfloatseq_from_mfjson(json_object *mfjson, interpType interp); (undefined type json_object) */ extern TSequence *tfloatseq_in(const char *str, interpType interp); -extern char *tfloatseqset_as_mfjson(const TSequenceSet *ss, bool with_bbox, int precision); /* extern TSequenceSet *tfloatseqset_from_mfjson(json_object *mfjson, interpType interp); (undefined type json_object) */ extern TSequenceSet *tfloatseqset_in(const char *str); -/* extern TInstant *tgeogpointinst_from_mfjson(json_object *mfjson, int srid); (undefined type json_object) */ -extern TInstant *tgeogpointinst_in(const char *str); -/* extern TSequence *tgeogpointseq_from_mfjson(json_object *mfjson, int srid, interpType interp); (undefined type json_object) */ -extern TSequence *tgeogpointseq_in(const char *str, interpType interp); -/* extern TSequenceSet *tgeogpointseqset_from_mfjson(json_object *mfjson, int srid, interpType interp); (undefined type json_object) */ -extern TSequenceSet *tgeogpointseqset_in(const char *str); -/* extern TInstant *tgeompointinst_from_mfjson(json_object *mfjson, int srid); (undefined type json_object) */ -extern TInstant *tgeompointinst_in(const char *str); -/* extern TSequence *tgeompointseq_from_mfjson(json_object *mfjson, int srid, interpType interp); (undefined type json_object) */ -extern TSequence *tgeompointseq_in(const char *str, interpType interp); -/* extern TSequenceSet *tgeompointseqset_from_mfjson(json_object *mfjson, int srid, interpType interp); (undefined type json_object) */ -extern TSequenceSet *tgeompointseqset_in(const char *str); -/* extern TInstant *tinstant_from_mfjson(json_object *mfjson, bool isgeo, int srid, meosType temptype); (undefined type json_object) */ +/* extern TInstant *tinstant_from_mfjson(json_object *mfjson, bool spatial, int32_t srid, meosType temptype); (undefined type json_object) */ extern TInstant *tinstant_in(const char *str, meosType temptype); extern char *tinstant_out(const TInstant *inst, int maxdd); -extern char *tintinst_as_mfjson(const TInstant *inst, bool with_bbox); /* extern TInstant *tintinst_from_mfjson(json_object *mfjson); (undefined type json_object) */ extern TInstant *tintinst_in(const char *str); -extern char *tintseq_as_mfjson(const TSequence *seq, bool with_bbox); /* extern TSequence *tintseq_from_mfjson(json_object *mfjson); (undefined type json_object) */ extern TSequence *tintseq_in(const char *str, interpType interp); -extern char *tintseqset_as_mfjson(const TSequenceSet *ss, bool with_bbox); /* extern TSequenceSet *tintseqset_from_mfjson(json_object *mfjson); (undefined type json_object) */ extern TSequenceSet *tintseqset_in(const char *str); -extern char **tpointarr_as_text(const Temporal **temparr, int count, int maxdd, bool extended); -extern char *tpointinst_as_mfjson(const TInstant *inst, bool with_bbox, int precision, char *srs); -extern char *tpointseq_as_mfjson(const TSequence *seq, bool with_bbox, int precision, char *srs); -extern char *tpointseqset_as_mfjson(const TSequenceSet *ss, bool with_bbox, int precision, char *srs); -/* extern TSequence *tsequence_from_mfjson(json_object *mfjson, bool isgeo, int srid, meosType temptype, interpType interp); (undefined type json_object) */ +/* extern TSequence *tsequence_from_mfjson(json_object *mfjson, bool spatial, int32_t srid, meosType temptype, interpType interp); (undefined type json_object) */ extern TSequence *tsequence_in(const char *str, meosType temptype, interpType interp); extern char *tsequence_out(const TSequence *seq, int maxdd); -/* extern TSequenceSet *tsequenceset_from_mfjson(json_object *mfjson, bool isgeo, int srid, meosType temptype, interpType interp); (undefined type json_object) */ +/* extern TSequenceSet *tsequenceset_from_mfjson(json_object *mfjson, bool spatial, int32_t srid, meosType temptype, interpType interp); (undefined type json_object) */ extern TSequenceSet *tsequenceset_in(const char *str, meosType temptype, interpType interp); extern char *tsequenceset_out(const TSequenceSet *ss, int maxdd); -extern char *ttextinst_as_mfjson(const TInstant *inst, bool with_bbox); /* extern TInstant *ttextinst_from_mfjson(json_object *mfjson); (undefined type json_object) */ extern TInstant *ttextinst_in(const char *str); -extern char *ttextseq_as_mfjson(const TSequence *seq, bool with_bbox); /* extern TSequence *ttextseq_from_mfjson(json_object *mfjson); (undefined type json_object) */ extern TSequence *ttextseq_in(const char *str, interpType interp); -extern char *ttextseqset_as_mfjson(const TSequenceSet *ss, bool with_bbox); /* extern TSequenceSet *ttextseqset_from_mfjson(json_object *mfjson); (undefined type json_object) */ extern TSequenceSet *ttextseqset_in(const char *str); extern Temporal *temporal_from_mfjson(const char *mfjson, meosType temptype); -extern Temporal *temporal_cp(const Temporal *temp); extern Temporal *temporal_from_base_temp(Datum value, meosType temptype, const Temporal *temp); extern TInstant *tinstant_copy(const TInstant *inst); extern TInstant *tinstant_make(Datum value, meosType temptype, TimestampTz t); extern TInstant *tinstant_make_free(Datum value, meosType temptype, TimestampTz t); -extern TSequence *tpointseq_make_coords(const double *xcoords, const double *ycoords, const double *zcoords, const TimestampTz *times, int count, int32 srid, bool geodetic, bool lower_inc, bool upper_inc, interpType interp, bool normalize); extern TSequence *tsequence_copy(const TSequence *seq); -extern TSequence *tsequence_from_base_tstzset(Datum value, meosType temptype, const Set *ss); +extern TSequence *tsequence_from_base_temp(Datum value, meosType temptype, const TSequence *seq); +extern TSequence *tsequence_from_base_tstzset(Datum value, meosType temptype, const Set *s); extern TSequence *tsequence_from_base_tstzspan(Datum value, meosType temptype, const Span *s, interpType interp); extern TSequence *tsequence_make_exp(const TInstant **instants, int count, int maxcount, bool lower_inc, bool upper_inc, interpType interp, bool normalize); extern TSequence *tsequence_make_free(TInstant **instants, int count, bool lower_inc, bool upper_inc, interpType interp, bool normalize); extern TSequenceSet *tsequenceset_copy(const TSequenceSet *ss); extern TSequenceSet *tseqsetarr_to_tseqset(TSequenceSet **seqsets, int count, int totalseqs); +extern TSequenceSet *tsequenceset_from_base_temp(Datum value, meosType temptype, const TSequenceSet *ss); extern TSequenceSet *tsequenceset_from_base_tstzspanset(Datum value, meosType temptype, const SpanSet *ss, interpType interp); extern TSequenceSet *tsequenceset_make_exp(const TSequence **sequences, int count, int maxcount, bool normalize); extern TSequenceSet *tsequenceset_make_free(TSequence **sequences, int count, bool normalize); @@ -2686,22 +2930,24 @@ extern TSequenceSet *tsequenceset_make_free(TSequence **sequences, int count, bo extern void temporal_set_tstzspan(const Temporal *temp, Span *s); extern void tinstant_set_tstzspan(const TInstant *inst, Span *s); extern void tnumber_set_tbox(const Temporal *temp, TBox *box); -extern Span *tnumber_span(const Temporal *temp); extern void tnumberinst_set_tbox(const TInstant *inst, TBox *box); extern void tnumberseq_set_tbox(const TSequence *seq, TBox *box); extern void tnumberseqset_set_tbox(const TSequenceSet *ss, TBox *box); extern void tsequence_set_tstzspan(const TSequence *seq, Span *s); extern void tsequenceset_set_tstzspan(const TSequenceSet *ss, Span *s); +extern const TInstant *temporal_end_inst(const Temporal *temp); extern Datum temporal_end_value(const Temporal *temp); -extern const TInstant **temporal_insts(const Temporal *temp, int *count); +extern const TInstant *temporal_inst_n(const Temporal *temp, int n); +extern const TInstant **temporal_instants_p(const Temporal *temp, int *count); extern Datum temporal_max_value(const Temporal *temp); extern size_t temporal_mem_size(const Temporal *temp); extern Datum temporal_min_value(const Temporal *temp); -extern const TSequence **temporal_seqs(const Temporal *temp, int *count); +extern const TSequence **temporal_sequences_p(const Temporal *temp, int *count); extern void temporal_set_bbox(const Temporal *temp, void *box); -extern Datum temporal_start_value (const Temporal *temp); -extern Datum *temporal_vals(const Temporal *temp, int *count); +extern const TInstant *temporal_start_inst(const Temporal *temp); +extern Datum temporal_start_value(const Temporal *temp); +extern Datum *temporal_values_p(const Temporal *temp, int *count); extern bool temporal_value_n(const Temporal *temp, int n, Datum *result); extern Datum *temporal_values(const Temporal *temp, int *count); extern uint32 tinstant_hash(const TInstant *inst); @@ -2709,10 +2955,10 @@ extern const TInstant **tinstant_insts(const TInstant *inst, int *count); extern void tinstant_set_bbox(const TInstant *inst, void *box); extern SpanSet *tinstant_time(const TInstant *inst); extern TimestampTz *tinstant_timestamps(const TInstant *inst, int *count); -extern Datum tinstant_val(const TInstant *inst); +extern Datum tinstant_value_p(const TInstant *inst); extern Datum tinstant_value(const TInstant *inst); extern bool tinstant_value_at_timestamptz(const TInstant *inst, TimestampTz t, Datum *result); -extern Datum *tinstant_vals(const TInstant *inst, int *count); +extern Datum *tinstant_values_p(const TInstant *inst, int *count); extern void tnumber_set_span(const Temporal *temp, Span *span); extern SpanSet *tnumberinst_valuespans(const TInstant *inst); extern SpanSet *tnumberseq_valuespans(const TSequence *seq); @@ -2720,7 +2966,7 @@ extern SpanSet *tnumberseqset_valuespans(const TSequenceSet *ss); extern Interval *tsequence_duration(const TSequence *seq); extern TimestampTz tsequence_end_timestamptz(const TSequence *seq); extern uint32 tsequence_hash(const TSequence *seq); -extern const TInstant **tsequence_insts(const TSequence *seq); +extern const TInstant **tsequence_insts_p(const TSequence *seq); extern const TInstant *tsequence_max_inst(const TSequence *seq); extern Datum tsequence_max_val(const TSequence *seq); extern const TInstant *tsequence_min_inst(const TSequence *seq); @@ -2731,12 +2977,12 @@ extern TimestampTz tsequence_start_timestamptz(const TSequence *seq); extern SpanSet *tsequence_time(const TSequence *seq); extern TimestampTz *tsequence_timestamps(const TSequence *seq, int *count); extern bool tsequence_value_at_timestamptz(const TSequence *seq, TimestampTz t, bool strict, Datum *result); -extern Datum *tsequence_vals(const TSequence *seq, int *count); +extern Datum *tsequence_values_p(const TSequence *seq, int *count); extern Interval *tsequenceset_duration(const TSequenceSet *ss, bool boundspan); extern TimestampTz tsequenceset_end_timestamptz(const TSequenceSet *ss); extern uint32 tsequenceset_hash(const TSequenceSet *ss); extern const TInstant *tsequenceset_inst_n(const TSequenceSet *ss, int n); -extern const TInstant **tsequenceset_insts(const TSequenceSet *ss); +extern const TInstant **tsequenceset_insts_p(const TSequenceSet *ss); extern const TInstant *tsequenceset_max_inst(const TSequenceSet *ss); extern Datum tsequenceset_max_val(const TSequenceSet *ss); extern const TInstant *tsequenceset_min_inst(const TSequenceSet *ss); @@ -2744,14 +2990,14 @@ extern Datum tsequenceset_min_val(const TSequenceSet *ss); extern int tsequenceset_num_instants(const TSequenceSet *ss); extern int tsequenceset_num_timestamps(const TSequenceSet *ss); extern TSequence **tsequenceset_segments(const TSequenceSet *ss, int *count); -extern const TSequence **tsequenceset_seqs(const TSequenceSet *ss); +extern const TSequence **tsequenceset_sequences_p(const TSequenceSet *ss); extern TimestampTz tsequenceset_start_timestamptz(const TSequenceSet *ss); extern SpanSet *tsequenceset_time(const TSequenceSet *ss); extern bool tsequenceset_timestamptz_n(const TSequenceSet *ss, int n, TimestampTz *result); extern TimestampTz *tsequenceset_timestamps(const TSequenceSet *ss, int *count); extern bool tsequenceset_value_at_timestamptz(const TSequenceSet *ss, TimestampTz t, bool strict, Datum *result); extern bool tsequenceset_value_n(const TSequenceSet *ss, int n, Datum *result); -extern Datum *tsequenceset_vals(const TSequenceSet *ss, int *count); +extern Datum *tsequenceset_values_p(const TSequenceSet *ss, int *count); extern void temporal_restart(Temporal *temp, int count); extern TSequence *temporal_tsequence(const Temporal *temp, interpType interp); @@ -2802,10 +3048,6 @@ extern TSequenceSet *tsequenceset_insert(const TSequenceSet *ss1, const TSequenc extern TSequenceSet *tsequenceset_merge(const TSequenceSet *ss1, const TSequenceSet *ss2); extern TSequenceSet *tsequenceset_merge_array(const TSequenceSet **seqsets, int count); -extern void tspatial_set_stbox(const Temporal *temp, STBox *box); -extern void tpointinst_set_stbox(const TInstant *inst, STBox *box); -extern void tspatialseq_set_stbox(const TSequence *seq, STBox *box); -extern void tspatialseqset_set_stbox(const TSequenceSet *ss, STBox *box); extern void tsequence_expand_bbox(TSequence *seq, const TInstant *inst); extern void tsequence_set_bbox(const TSequence *seq, void *box); extern void tsequenceset_expand_bbox(TSequenceSet *ss, const TSequence *seq); @@ -2834,16 +3076,6 @@ extern TInstant *tnumberinst_restrict_span(const TInstant *inst, const Span *spa extern TInstant *tnumberinst_restrict_spanset(const TInstant *inst, const SpanSet *ss, bool atfunc); extern TSequenceSet *tnumberseqset_restrict_span(const TSequenceSet *ss, const Span *span, bool atfunc); extern TSequenceSet *tnumberseqset_restrict_spanset(const TSequenceSet *ss, const SpanSet *spanset, bool atfunc); -extern Temporal *tnpoint_restrict_geom(const Temporal *temp, const GSERIALIZED *gs, const Span *zspan, const bool atfunc); -extern Temporal *tnpoint_restrict_stbox(const Temporal *temp, const STBox *box, bool border_inc, bool atfunc); -extern Temporal *tpoint_restrict_geom(const Temporal *temp, const GSERIALIZED *gs, const Span *zspan, const bool atfunc); -extern Temporal *tpoint_restrict_stbox(const Temporal *temp, const STBox *box, bool border_inc, bool atfunc); -extern TInstant *tpointinst_restrict_geom(const TInstant *inst, const GSERIALIZED *gs, const Span *zspan, bool atfunc); -extern TInstant *tpointinst_restrict_stbox(const TInstant *inst, const STBox *box, bool border_inc, bool atfunc); -extern Temporal *tpointseq_restrict_geom(const TSequence *seq, const GSERIALIZED *gs, const Span *zspan, bool atfunc); -extern Temporal *tpointseq_restrict_stbox(const TSequence *seq, const STBox *box, bool border_inc, bool atfunc); -extern TSequenceSet *tpointseqset_restrict_geom(const TSequenceSet *ss, const GSERIALIZED *gs, const Span *zspan, bool atfunc); -extern TSequenceSet *tpointseqset_restrict_stbox(const TSequenceSet *ss, const STBox *box, bool border_inc, bool atfunc); extern TInstant *tsequence_at_timestamptz(const TSequence *seq, TimestampTz t); extern Temporal *tsequence_restrict_tstzspan(const TSequence *seq, const Span *s, bool atfunc); extern Temporal *tsequence_restrict_tstzspanset(const TSequence *seq, const SpanSet *ss, bool atfunc); @@ -2887,8 +3119,6 @@ extern int ever_le_temporal_base(const Temporal *temp, Datum value); extern int ever_lt_base_temporal(Datum value, const Temporal *temp); extern int ever_lt_temporal_base(const Temporal *temp, Datum value); -extern TSequence *tfloatseq_derivative(const TSequence *seq); -extern TSequenceSet *tfloatseqset_derivative(const TSequenceSet *ss); extern TInstant *tnumberinst_abs(const TInstant *inst); extern TSequence *tnumberseq_abs(const TSequence *seq); extern TSequence *tnumberseq_angular_difference(const TSequence *seq); @@ -2897,73 +3127,312 @@ extern TSequenceSet *tnumberseqset_abs(const TSequenceSet *ss); extern TSequence *tnumberseqset_angular_difference(const TSequenceSet *ss); extern TSequenceSet *tnumberseqset_delta_value(const TSequenceSet *ss); -extern Temporal *distance_tnumber_number(const Temporal *temp, Datum value); -extern Datum nad_tbox_tbox(const TBox *box1, const TBox *box2); -extern Datum nad_tnumber_number(const Temporal *temp, Datum value); -extern Datum nad_tnumber_tbox(const Temporal *temp, const TBox *box); -extern Datum nad_tnumber_tnumber(const Temporal *temp1, const Temporal *temp2); +extern Temporal *tdistance_tnumber_number(const Temporal *temp, Datum value); +extern double nad_tbox_tbox(const TBox *box1, const TBox *box2); +extern double nad_tnumber_number(const Temporal *temp, Datum value); +extern double nad_tnumber_tbox(const Temporal *temp, const TBox *box); +extern double nad_tnumber_tnumber(const Temporal *temp1, const Temporal *temp2); + +extern double tnumberseq_integral(const TSequence *seq); +extern double tnumberseq_twavg(const TSequence *seq); +extern double tnumberseqset_integral(const TSequenceSet *ss); +extern double tnumberseqset_twavg(const TSequenceSet *ss); + +extern Temporal *temporal_compact(const Temporal *temp); +extern TSequence *tsequence_compact(const TSequence *seq); +extern TSequenceSet *tsequenceset_compact(const TSequenceSet *ss); + +extern void skiplist_free(SkipList *list); +extern Temporal *temporal_app_tinst_transfn(Temporal *state, const TInstant *inst, interpType interp, double maxdist, const Interval *maxt); +extern Temporal *temporal_app_tseq_transfn(Temporal *state, const TSequence *seq); + +extern Span *span_bins(const Span *s, Datum size, Datum origin, int *count); +extern Span *spanset_bins(const SpanSet *ss, Datum size, Datum origin, int *count); +extern Span *tnumber_value_bins(const Temporal *temp, Datum size, Datum origin, int *count); +extern TBox *tnumber_value_time_boxes(const Temporal *temp, Datum vsize, const Interval *duration, Datum vorigin, TimestampTz torigin, int *count); +extern Temporal **tnumber_value_split(const Temporal *temp, Datum vsize, Datum vorigin, Datum **bins, int *count); +extern TBox *tbox_get_value_time_tile(Datum value, TimestampTz t, Datum vsize, const Interval *duration, Datum vorigin, TimestampTz torigin, meosType basetype, meosType spantype); +extern Temporal **tnumber_value_time_split(const Temporal *temp, Datum size, const Interval *duration, Datum vorigin, TimestampTz torigin, Datum **value_bins, TimestampTz **time_bins, int *count); + + +//-------------------- meos_internal_geo.h -------------------- + + +//#include + +//#include + +//#include + +//#include +//#include +//#include + +extern PJ_CONTEXT *proj_get_context(void); + +extern Datum datum_geo_round(Datum value, Datum size); +extern GSERIALIZED *point_round(const GSERIALIZED *gs, int maxdd); + +extern void stbox_set(bool hasx, bool hasz, bool geodetic, int32 srid, double xmin, double xmax, double ymin, double ymax, double zmin, double zmax, const Span *s, STBox *box); + +extern void gbox_set_stbox(const GBOX *box, int32_t srid, STBox *result); +extern bool geo_set_stbox(const GSERIALIZED *gs, STBox *box); +extern void geoarr_set_stbox(const Datum *values, int count, STBox *box); +extern bool spatial_set_stbox(Datum d, meosType basetype, STBox *box); +extern void spatialset_set_stbox(const Set *set, STBox *box); +extern void stbox_set_box3d(const STBox *box, BOX3D *box3d); +extern void stbox_set_gbox(const STBox *box, GBOX *gbox); +extern void tstzset_set_stbox(const Set *s, STBox *box); +extern void tstzspan_set_stbox(const Span *s, STBox *box); +extern void tstzspanset_set_stbox(const SpanSet *s, STBox *box); + +extern void stbox_expand(const STBox *box1, STBox *box2); + +extern bool inter_stbox_stbox(const STBox *box1, const STBox *box2, STBox *result); +extern GSERIALIZED *stbox_geo(const STBox *box); + +/* extern TInstant *tgeogpointinst_from_mfjson(json_object *mfjson, int32_t srid); (undefined type json_object) */ +extern TInstant *tgeogpointinst_in(const char *str); +/* extern TSequence *tgeogpointseq_from_mfjson(json_object *mfjson, int32_t srid, interpType interp); (undefined type json_object) */ +extern TSequence *tgeogpointseq_in(const char *str, interpType interp); +/* extern TSequenceSet *tgeogpointseqset_from_mfjson(json_object *mfjson, int32_t srid, interpType interp); (undefined type json_object) */ +extern TSequenceSet *tgeogpointseqset_in(const char *str); +/* extern TInstant *tgeompointinst_from_mfjson(json_object *mfjson, int32_t srid); (undefined type json_object) */ +extern TInstant *tgeompointinst_in(const char *str); +/* extern TSequence *tgeompointseq_from_mfjson(json_object *mfjson, int32_t srid, interpType interp); (undefined type json_object) */ +extern TSequence *tgeompointseq_in(const char *str, interpType interp); +/* extern TSequenceSet *tgeompointseqset_from_mfjson(json_object *mfjson, int32_t srid, interpType interp); (undefined type json_object) */ +extern TSequenceSet *tgeompointseqset_in(const char *str); +/* extern TInstant *tgeographyinst_from_mfjson(json_object *mfjson, int32_t srid); (undefined type json_object) */ +extern TInstant *tgeographyinst_in(const char *str); +/* extern TSequence *tgeographyseq_from_mfjson(json_object *mfjson, int32_t srid, interpType interp); (undefined type json_object) */ +extern TSequence *tgeographyseq_in(const char *str, interpType interp); +/* extern TSequenceSet *tgeographyseqset_from_mfjson(json_object *mfjson, int32_t srid, interpType interp); (undefined type json_object) */ +extern TSequenceSet *tgeographyseqset_in(const char *str); +/* extern TInstant *tgeometryinst_from_mfjson(json_object *mfjson, int32_t srid); (undefined type json_object) */ +extern TInstant *tgeometryinst_in(const char *str); +/* extern TSequence *tgeometryseq_from_mfjson(json_object *mfjson, int32_t srid, interpType interp); (undefined type json_object) */ +extern TSequence *tgeometryseq_in(const char *str, interpType interp); +/* extern TSequenceSet *tgeometryseqset_from_mfjson(json_object *mfjson, int32_t srid, interpType interp); (undefined type json_object) */ +extern TSequenceSet *tgeometryseqset_in(const char *str); + +extern void tspatial_set_stbox(const Temporal *temp, STBox *box); +extern void tgeoinst_set_stbox(const TInstant *inst, STBox *box); +extern void tspatialseq_set_stbox(const TSequence *seq, STBox *box); +extern void tspatialseqset_set_stbox(const TSequenceSet *ss, STBox *box); -extern int tpointinst_srid(const TInstant *inst); -extern GSERIALIZED *tpointseq_trajectory(const TSequence *seq); +extern Temporal *tgeo_restrict_geom(const Temporal *temp, const GSERIALIZED *gs, const Span *zspan, bool atfunc); +extern Temporal *tgeo_restrict_stbox(const Temporal *temp, const STBox *box, bool border_inc, bool atfunc); +extern TInstant *tgeoinst_restrict_geom(const TInstant *inst, const GSERIALIZED *gs, const Span *zspan, bool atfunc); +extern TInstant *tgeoinst_restrict_stbox(const TInstant *inst, const STBox *box, bool border_inc, bool atfunc); +extern Temporal *tgeoseq_restrict_geom(const TSequence *seq, const GSERIALIZED *gs, const Span *zspan, bool atfunc); +extern Temporal *tgeoseq_restrict_stbox(const TSequence *seq, const STBox *box, bool border_inc, bool atfunc); +extern TSequenceSet *tgeoseqset_restrict_geom(const TSequenceSet *ss, const GSERIALIZED *gs, const Span *zspan, bool atfunc); +extern TSequenceSet *tgeoseqset_restrict_stbox(const TSequenceSet *ss, const STBox *box, bool border_inc, bool atfunc); + +extern int32_t spatial_srid(Datum d, meosType basetype); +extern bool spatial_set_srid(Datum d, meosType basetype, int32_t srid); +extern int tspatialinst_srid(const TInstant *inst); extern TSequenceSet *tpointseq_azimuth(const TSequence *seq); extern TSequence *tpointseq_cumulative_length(const TSequence *seq, double prevlength); extern bool tpointseq_is_simple(const TSequence *seq); extern double tpointseq_length(const TSequence *seq); -extern TSequence *tpointseq_speed(const TSequence *seq); -extern int tpointseq_srid(const TSequence *seq); -extern STBox *tpointseq_stboxes(const TSequence *seq, int *count); -extern STBox *tpointseq_split_n_stboxes(const TSequence *seq, int max_count, int *count); +extern GSERIALIZED *tpointseq_linear_trajectory(const TSequence *seq, bool unary_union); +extern STBox *tgeoseq_stboxes(const TSequence *seq, int *count); +extern STBox *tgeoseq_split_n_stboxes(const TSequence *seq, int max_count, int *count); extern TSequenceSet *tpointseqset_azimuth(const TSequenceSet *ss); extern TSequenceSet *tpointseqset_cumulative_length(const TSequenceSet *ss); extern bool tpointseqset_is_simple(const TSequenceSet *ss); extern double tpointseqset_length(const TSequenceSet *ss); -extern TSequenceSet *tpointseqset_speed(const TSequenceSet *ss); -extern int tpointseqset_srid(const TSequenceSet *ss); -extern STBox *tpointseqset_stboxes(const TSequenceSet *ss, int *count); -extern STBox *tpointseqset_split_n_stboxes(const TSequenceSet *ss, int max_count, int *count); -extern GSERIALIZED *tpointseqset_trajectory(const TSequenceSet *ss); +extern STBox *tgeoseqset_stboxes(const TSequenceSet *ss, int *count); +extern STBox *tgeoseqset_split_n_stboxes(const TSequenceSet *ss, int max_count, int *count); extern Temporal *tpoint_get_coord(const Temporal *temp, int coord); -extern TInstant *tgeompointinst_tgeogpointinst(const TInstant *inst, bool oper); -extern TSequence *tgeompointseq_tgeogpointseq(const TSequence *seq, bool oper); -extern TSequenceSet *tgeompointseqset_tgeogpointseqset(const TSequenceSet *ss, bool oper); -extern Temporal *tgeompoint_tgeogpoint(const Temporal *temp, bool oper); -extern Temporal *tgeompoint_tnpoint(const Temporal *temp); -extern Temporal *tnpoint_tgeompoint(const Temporal *temp); -extern TInstant *tpointinst_set_srid(const TInstant *inst, int32 srid); +extern TInstant *tgeominst_tgeoginst(const TInstant *inst, bool oper); +extern TSequence *tgeomseq_tgeogseq(const TSequence *seq, bool oper); +extern TSequenceSet *tgeomseqset_tgeogseqset(const TSequenceSet *ss, bool oper); +extern Temporal *tgeom_tgeog(const Temporal *temp, bool oper); +extern Temporal *tgeo_tpoint(const Temporal *temp, bool oper); +extern void tspatialinst_set_srid(TInstant *inst, int32_t srid); extern TSequence **tpointseq_make_simple(const TSequence *seq, int *count); -extern TSequence *tpointseq_set_srid(const TSequence *seq, int32 srid); +extern void tspatialseq_set_srid(TSequence *seq, int32_t srid); extern TSequence **tpointseqset_make_simple(const TSequenceSet *ss, int *count); -extern TSequenceSet *tpointseqset_set_srid(const TSequenceSet *ss, int32 srid); +extern void tspatialseqset_set_srid(TSequenceSet *ss, int32_t srid); -extern double tnumberseq_integral(const TSequence *seq); -extern double tnumberseq_twavg(const TSequence *seq); -extern double tnumberseqset_integral(const TSequenceSet *ss); -extern double tnumberseqset_twavg(const TSequenceSet *ss); extern GSERIALIZED *tpointseq_twcentroid(const TSequence *seq); extern GSERIALIZED *tpointseqset_twcentroid(const TSequenceSet *ss); -extern Temporal *temporal_compact(const Temporal *temp); -extern TSequence *tsequence_compact(const TSequence *seq); -extern TSequenceSet *tsequenceset_compact(const TSequenceSet *ss); + +//-------------------- meos_npoint.h -------------------- -extern void skiplist_free(SkipList *list); -extern Temporal *temporal_app_tinst_transfn(Temporal *state, const TInstant *inst, double maxdist, const Interval *maxt); -extern Temporal *temporal_app_tseq_transfn(Temporal *state, const TSequence *seq); -/* extern Span *numspanset_spans(const SpanSet *ss, Datum vsize, Datum vorigin, int *count); (undefined) */ -extern Span *spanset_time_spans(const SpanSet *ss, const Interval *duration, Datum torigin, int *count); -extern Span *spanset_value_spans(const SpanSet *ss, Datum vsize, Datum vorigin, int *count); -/* extern Span *timespanset_spans(const SpanSet *ss, const Interval *duration, Datum torigin, int *count); (undefined) */ -extern Span *tnumber_value_spans(const Temporal *temp, Datum size, Datum origin, int *count); -/* extern TBox *tnumber_value_boxes(const Temporal *temp, Datum vsize, Datum vorigin, int *count); (undefined) */ -/* extern TBox *tnumber_time_boxes(const Temporal *temp, const Interval *duration, TimestampTz torigin, int *count); (undefined) */ -extern TBox *tnumber_value_time_boxes(const Temporal *temp, Datum vsize, const Interval *duration, Datum vorigin, TimestampTz torigin, int *count); -extern Temporal **tnumber_value_split(const Temporal *temp, Datum vsize, Datum vorigin, Datum **bins, int *count); -extern TBox *tbox_get_value_time_tile(Datum value, TimestampTz t, Datum vsize, const Interval *duration, Datum vorigin, TimestampTz torigin, meosType basetype, meosType spantype); -extern Temporal **tnumber_value_time_split(const Temporal *temp, Datum size, const Interval *duration, Datum vorigin, TimestampTz torigin, Datum **value_bins, TimestampTz **time_bins, int *count); +//#include +//#include + +//#include +//#include +//#include + +typedef struct +{ + int64 rid; + double pos; +} Npoint; + +typedef struct +{ + int64 rid; + double pos1; + double pos2; +} Nsegment; + + //#else + + + //#else + + +extern char *npoint_as_ewkt(const Npoint *np, int maxdd); +extern char *npoint_as_hexwkb(const Npoint *np, uint8_t variant, size_t *size_out); +extern char *npoint_as_text(const Npoint *np, int maxdd); +extern uint8_t *npoint_as_wkb(const Npoint *np, uint8_t variant, size_t *size_out); +extern Npoint *npoint_from_hexwkb(const char *hexwkb); +extern Npoint *npoint_from_wkb(const uint8_t *wkb, size_t size); +extern Npoint *npoint_in(const char *str); +extern char *npoint_out(const Npoint *np, int maxdd); +extern Nsegment *nsegment_in(const char *str); +extern char *nsegment_out(const Nsegment *ns, int maxdd); + +extern Npoint *npoint_make(int64 rid, double pos); +extern Nsegment *nsegment_make(int64 rid, double pos1, double pos2); + +extern Npoint *geompoint_to_npoint(const GSERIALIZED *gs); +extern Nsegment *geom_to_nsegment(const GSERIALIZED *gs); +extern GSERIALIZED *npoint_to_geompoint(const Npoint *np); +extern Nsegment *npoint_to_nsegment(const Npoint *np); +extern STBox *npoint_to_stbox(const Npoint *np); +extern GSERIALIZED *nsegment_to_geom(const Nsegment *ns); +extern STBox *nsegment_to_stbox(const Nsegment *np); + +extern uint32 npoint_hash(const Npoint *np); +extern uint64 npoint_hash_extended(const Npoint *np, uint64 seed); +extern double npoint_position(const Npoint *np); +extern int64 npoint_route(const Npoint *np); +extern double nsegment_end_position(const Nsegment *ns); +extern int64 nsegment_route(const Nsegment *ns); +extern double nsegment_start_position(const Nsegment *ns); + +extern bool route_exists(int64 rid); +extern GSERIALIZED *route_geom(int64 rid); +extern double route_length(int64 rid); + +extern Npoint *npoint_round(const Npoint *np, int maxdd); +extern Nsegment *nsegment_round(const Nsegment *ns, int maxdd); + +extern int32_t get_srid_ways(void); +extern int32_t npoint_srid(const Npoint *np); +extern int32_t nsegment_srid(const Nsegment *ns); + +extern STBox *npoint_timestamptz_to_stbox(const Npoint *np, TimestampTz t); +extern STBox *npoint_tstzspan_to_stbox(const Npoint *np, const Span *s); + +extern int npoint_cmp(const Npoint *np1, const Npoint *np2); +extern bool npoint_eq(const Npoint *np1, const Npoint *np2); +extern bool npoint_ge(const Npoint *np1, const Npoint *np2); +extern bool npoint_gt(const Npoint *np1, const Npoint *np2); +extern bool npoint_le(const Npoint *np1, const Npoint *np2); +extern bool npoint_lt(const Npoint *np1, const Npoint *np2); +extern bool npoint_ne(const Npoint *np1, const Npoint *np2); +extern bool npoint_same(const Npoint *np1, const Npoint *np2); +extern int nsegment_cmp(const Nsegment *ns1, const Nsegment *ns2); +extern bool nsegment_eq(const Nsegment *ns1, const Nsegment *ns2); +extern bool nsegment_ge(const Nsegment *ns1, const Nsegment *ns2); +extern bool nsegment_gt(const Nsegment *ns1, const Nsegment *ns2); +extern bool nsegment_le(const Nsegment *ns1, const Nsegment *ns2); +extern bool nsegment_lt(const Nsegment *ns1, const Nsegment *ns2); +extern bool nsegment_ne(const Nsegment *ns1, const Nsegment *ns2); + +extern Set *npointset_in(const char *str); +extern char *npointset_out(const Set *s, int maxdd); + +extern Set *npointset_make(const Npoint **values, int count); + +extern Set *npoint_to_set(const Npoint *np); + +extern Npoint *npointset_end_value(const Set *s); +extern Set *npointset_routes(const Set *s); +extern Npoint *npointset_start_value(const Set *s); +extern bool npointset_value_n(const Set *s, int n, Npoint **result); +extern Npoint **npointset_values(const Set *s); + +extern bool contained_npoint_set(const Npoint *np, const Set *s); +extern bool contains_set_npoint(const Set *s, Npoint *np); +extern Set *intersection_npoint_set(const Npoint *np, const Set *s); +extern Set *intersection_set_npoint(const Set *s, const Npoint *np); +extern Set *minus_npoint_set(const Npoint *np, const Set *s); +extern Set *minus_set_npoint(const Set *s, const Npoint *np); +extern Set *npoint_union_transfn(Set *state, const Npoint *np); +extern Set *union_npoint_set(const Npoint *np, const Set *s); +extern Set *union_set_npoint(const Set *s, const Npoint *np); + +extern Temporal *tnpoint_in(const char *str); +extern char *tnpoint_out(const Temporal *temp, int maxdd); + +extern TInstant *tnpointinst_make(const Npoint *np, TimestampTz t); + +extern Temporal *tgeompoint_to_tnpoint(const Temporal *temp); +extern Temporal *tnpoint_to_tgeompoint(const Temporal *temp); + +extern Temporal *tnpoint_cumulative_length(const Temporal *temp); +extern double tnpoint_length(const Temporal *temp); +extern Nsegment **tnpoint_positions(const Temporal *temp, int *count); +extern int64 tnpoint_route(const Temporal *temp); +extern Set *tnpoint_routes(const Temporal *temp); +extern Temporal *tnpoint_speed(const Temporal *temp); +extern GSERIALIZED *tnpoint_trajectory(const Temporal *temp); +extern GSERIALIZED *tnpoint_twcentroid(const Temporal *temp); + +extern Temporal *tnpoint_at_geom(const Temporal *temp, const GSERIALIZED *gs); +extern Temporal *tnpoint_at_npoint(const Temporal *temp, const Npoint *np); +extern Temporal *tnpoint_at_npointset(const Temporal *temp, const Set *s); +extern Temporal *tnpoint_at_stbox(const Temporal *temp, const STBox *box, bool border_inc); +extern Temporal *tnpoint_minus_geom(const Temporal *temp, const GSERIALIZED *gs); +extern Temporal *tnpoint_minus_npoint(const Temporal *temp, const Npoint *np); +extern Temporal *tnpoint_minus_npointset(const Temporal *temp, const Set *s); +extern Temporal *tnpoint_minus_stbox(const Temporal *temp, const STBox *box, bool border_inc); + +extern Temporal *tdistance_tnpoint_npoint(const Temporal *temp, const Npoint *np); +extern Temporal *tdistance_tnpoint_point(const Temporal *temp, const GSERIALIZED *gs); +extern Temporal *tdistance_tnpoint_tnpoint(const Temporal *temp1, const Temporal *temp2); +extern double nad_tnpoint_geo(const Temporal *temp, const GSERIALIZED *gs); +extern double nad_tnpoint_npoint(const Temporal *temp, const Npoint *np); +extern double nad_tnpoint_stbox(const Temporal *temp, const STBox *box); +extern double nad_tnpoint_tnpoint(const Temporal *temp1, const Temporal *temp2); +extern TInstant *nai_tnpoint_geo(const Temporal *temp, const GSERIALIZED *gs); +extern TInstant *nai_tnpoint_npoint(const Temporal *temp, const Npoint *np); +extern TInstant *nai_tnpoint_tnpoint(const Temporal *temp1, const Temporal *temp2); +extern GSERIALIZED *shortestline_tnpoint_geo(const Temporal *temp, const GSERIALIZED *gs); +extern GSERIALIZED *shortestline_tnpoint_npoint(const Temporal *temp, const Npoint *np); +extern GSERIALIZED *shortestline_tnpoint_tnpoint(const Temporal *temp1, const Temporal *temp2); + +extern SkipList *tnpoint_tcentroid_transfn(SkipList *state, Temporal *temp); + +extern int always_eq_npoint_tnpoint(const Npoint *np, const Temporal *temp); +extern int always_eq_tnpoint_npoint(const Temporal *temp, const Npoint *np); +extern int always_eq_tnpoint_tnpoint(const Temporal *temp1, const Temporal *temp2); +extern int always_ne_npoint_tnpoint(const Npoint *np, const Temporal *temp); +extern int always_ne_tnpoint_npoint(const Temporal *temp, const Npoint *np); +extern int always_ne_tnpoint_tnpoint(const Temporal *temp1, const Temporal *temp2); +extern int ever_eq_npoint_tnpoint(const Npoint *np, const Temporal *temp); +extern int ever_eq_tnpoint_npoint(const Temporal *temp, const Npoint *np); +extern int ever_eq_tnpoint_tnpoint(const Temporal *temp1, const Temporal *temp2); +extern int ever_ne_npoint_tnpoint(const Npoint *np, const Temporal *temp); +extern int ever_ne_tnpoint_npoint(const Temporal *temp, const Npoint *np); +extern int ever_ne_tnpoint_tnpoint(const Temporal *temp1, const Temporal *temp2); + +extern Temporal *teq_tnpoint_npoint(const Temporal *temp, const Npoint *np); +extern Temporal *tne_tnpoint_npoint(const Temporal *temp, const Npoint *np); - extern "Python" void py_error_handler(int, int, char*); \ No newline at end of file diff --git a/builder/objects.py b/builder/objects.py index 487c083..cc4da83 100644 --- a/builder/objects.py +++ b/builder/objects.py @@ -1,4 +1,4 @@ -from typing import Callable, Dict, Optional +from collections.abc import Callable class Conversion: @@ -6,8 +6,8 @@ def __init__( self, c_type: str, p_type: str, - p_to_c: Optional[Callable[[str], str]], - c_to_p: Optional[Callable[[str], str]], + p_to_c: Callable[[str], str] | None, + c_to_p: Callable[[str], str] | None, ) -> None: super().__init__() self.c_type = c_type @@ -16,7 +16,7 @@ def __init__( self.c_to_p = c_to_p -conversion_map: Dict[str, Conversion] = { +conversion_map: dict[str, Conversion] = { "void": Conversion("void", "None", None, None), "bool": Conversion("bool", "bool", None, None), "double": Conversion("double", "float", None, None), @@ -57,39 +57,18 @@ def __init__( lambda c_obj: f"text2cstring({c_obj})", ), "int": Conversion("int", "int", None, None), - "int8": Conversion( - "int8", "int", lambda p_obj: f"_ffi.cast('int8', {p_obj})", None - ), - "int16": Conversion( - "int16", "int", lambda p_obj: f"_ffi.cast('int16', {p_obj})", None - ), - "int32": Conversion( - "int32", "int", lambda p_obj: f"_ffi.cast('int32', {p_obj})", None - ), - "int64": Conversion( - "int64", "int", lambda p_obj: f"_ffi.cast('int64', {p_obj})", None - ), - "uint8": Conversion( - "uint8", "int", lambda p_obj: f"_ffi.cast('uint8', {p_obj})", None - ), - "uint16": Conversion( - "uint16", "int", lambda p_obj: f"_ffi.cast('uint16', {p_obj})", None - ), - "uint32": Conversion( - "uint32", "int", lambda p_obj: f"_ffi.cast('uint32', {p_obj})", None - ), - "uint64": Conversion( - "uint64", "int", lambda p_obj: f"_ffi.cast('uint64', {p_obj})", None - ), - "uint8_t": Conversion( - "uint8_t", "int", lambda p_obj: f"_ffi.cast('uint8_t', {p_obj})", None - ), - "Timestamp": Conversion( - "Timestamp", "int", lambda p_obj: f"_ffi.cast('Timestamp', {p_obj})", None - ), - "TimestampTz": Conversion( - "TimestampTz", "int", lambda p_obj: f"_ffi.cast('TimestampTz', {p_obj})", None - ), + "int8": Conversion("int8", "int", lambda p_obj: f"_ffi.cast('int8', {p_obj})", None), + "int16": Conversion("int16", "int", lambda p_obj: f"_ffi.cast('int16', {p_obj})", None), + "int32": Conversion("int32", "int", lambda p_obj: f"_ffi.cast('int32', {p_obj})", None), + "int64": Conversion("int64", "int", lambda p_obj: f"_ffi.cast('int64', {p_obj})", None), + "uint8": Conversion("uint8", "int", lambda p_obj: f"_ffi.cast('uint8', {p_obj})", None), + "uint16": Conversion("uint16", "int", lambda p_obj: f"_ffi.cast('uint16', {p_obj})", None), + "uint32": Conversion("uint32", "int", lambda p_obj: f"_ffi.cast('uint32', {p_obj})", None), + "uint64": Conversion("uint64", "int", lambda p_obj: f"_ffi.cast('uint64', {p_obj})", None), + "uint8_t": Conversion("uint8_t", "int", lambda p_obj: f"_ffi.cast('uint8_t', {p_obj})", None), + "DateADT": Conversion("DateADT", "int", lambda p_obj: f"_ffi.cast('DateADT', {p_obj})", None), + "Timestamp": Conversion("Timestamp", "int", lambda p_obj: f"_ffi.cast('Timestamp', {p_obj})", None), + "TimestampTz": Conversion("TimestampTz", "int", lambda p_obj: f"_ffi.cast('TimestampTz', {p_obj})", None), "TimestampTz *": Conversion( "TimestampTz *", "int", @@ -108,7 +87,6 @@ def __init__( lambda p_obj: f"_ffi.cast('const TimestampTz *', {p_obj})", None, ), - "TimeOffset": Conversion( - "TimeOffset", "int", lambda p_obj: f"_ffi.cast('TimeOffset', {p_obj})", None - ), + "TimeOffset": Conversion("TimeOffset", "int", lambda p_obj: f"_ffi.cast('TimeOffset', {p_obj})", None), + "interpType": Conversion("interpType", "InterpolationType", None, None), } diff --git a/builder/templates/functions.py b/builder/templates/functions.py index e79c4f8..dcb2e73 100644 --- a/builder/templates/functions.py +++ b/builder/templates/functions.py @@ -1,23 +1,23 @@ import logging import os - -from datetime import datetime, timedelta, date -from typing import Any, Tuple, Optional, List +from datetime import date, datetime, timedelta +from typing import Annotated, Any import _meos_cffi import shapely.geometry as spg from dateutil.parser import parse -from shapely import wkt, get_srid, set_srid +from shapely import get_srid, set_srid, wkt from shapely.geometry.base import BaseGeometry +from .enums import InterpolationType from .errors import report_meos_exception _ffi = _meos_cffi.ffi _lib = _meos_cffi.lib -_error: Optional[int] = None -_error_level: Optional[int] = None -_error_message: Optional[str] = None +_error: int | None = None +_error_level: int | None = None +_error_message: str | None = None logger = logging.getLogger("pymeos_cffi") @@ -40,34 +40,30 @@ def py_error_handler(error_level, error_code, error_msg): _error = error_code _error_level = error_level _error_message = _ffi.string(error_msg).decode("utf-8") - logger.debug( - f"ERROR Handler called: Level: {_error} | Code: {_error_level} | Message: {_error_message}" - ) + logger.debug(f"ERROR Handler called: Level: {_error} | Code: {_error_level} | Message: {_error_message}") -def create_pointer(object: "Any", type: str) -> "Any *": +def create_pointer(object: "Any", type: str) -> Annotated[_ffi.CData, "Any *"]: return _ffi.new(f"{type} *", object) -def get_address(value: "Any") -> "Any *": +def get_address(value: "Any") -> Annotated[_ffi.CData, "Any *"]: return _ffi.addressof(value) -def datetime_to_timestamptz(dt: datetime) -> "TimestampTz": - return _lib.pg_timestamptz_in( - dt.strftime("%Y-%m-%d %H:%M:%S%z").encode("utf-8"), -1 - ) +def datetime_to_timestamptz(dt: datetime) -> Annotated[int, "TimestampTz"]: + return _lib.pg_timestamptz_in(dt.strftime("%Y-%m-%d %H:%M:%S%z").encode("utf-8"), -1) -def timestamptz_to_datetime(ts: "TimestampTz") -> datetime: +def timestamptz_to_datetime(ts: Annotated[int, "TimestampTz"]) -> datetime: return parse(pg_timestamptz_out(ts)) -def date_to_date_adt(dt: date) -> "DateADT": +def date_to_date_adt(dt: date) -> Annotated[int, "DateADT"]: return _lib.pg_date_in(dt.strftime("%Y-%m-%d").encode("utf-8")) -def date_adt_to_date(ts: "DateADT") -> date: +def date_adt_to_date(ts: Annotated[int, "DateADT"]) -> date: return parse(pg_date_out(ts)).date() @@ -83,60 +79,56 @@ def interval_to_timedelta(interval: Any) -> timedelta: return timedelta(days=interval.day, microseconds=interval.time) -def geo_to_gserialized(geom: BaseGeometry, geodetic: bool) -> "GSERIALIZED *": +def geo_to_gserialized(geom: BaseGeometry, geodetic: bool) -> Annotated[_ffi.CData, "GSERIALIZED *"]: if geodetic: return geography_to_gserialized(geom) else: return geometry_to_gserialized(geom) -def geometry_to_gserialized(geom: BaseGeometry) -> "GSERIALIZED *": +def geometry_to_gserialized(geom: BaseGeometry) -> Annotated[_ffi.CData, "GSERIALIZED *"]: text = wkt.dumps(geom) if get_srid(geom) > 0: text = f"SRID={get_srid(geom)};{text}" - gs = pgis_geometry_in(text, -1) + gs = geom_in(text, -1) return gs -def geography_to_gserialized(geom: BaseGeometry) -> "GSERIALIZED *": +def geography_to_gserialized(geom: BaseGeometry) -> Annotated[_ffi.CData, "GSERIALIZED *"]: text = wkt.dumps(geom) if get_srid(geom) > 0: text = f"SRID={get_srid(geom)};{text}" - gs = pgis_geography_in(text, -1) + gs = geog_in(text, -1) return gs -def gserialized_to_shapely_point( - geom: "const GSERIALIZED *", precision: int = 15 -) -> spg.Point: +def gserialized_to_shapely_point(geom: "const GSERIALIZED *", precision: int = 15) -> spg.Point: text = geo_as_text(geom, precision) geometry = wkt.loads(text) - srid = geo_get_srid(geom) + srid = geo_srid(geom) if srid > 0: geometry = set_srid(geometry, srid) return geometry -def gserialized_to_shapely_geometry( - geom: "const GSERIALIZED *", precision: int = 15 -) -> BaseGeometry: +def gserialized_to_shapely_geometry(geom: "const GSERIALIZED *", precision: int = 15) -> BaseGeometry: text = geo_as_text(geom, precision) geometry = wkt.loads(text) - srid = geo_get_srid(geom) + srid = geo_srid(geom) if srid > 0: geometry = set_srid(geometry, srid) return geometry -def as_tinstant(temporal: "Temporal *") -> "TInstant *": +def as_tinstant(temporal: Annotated[_ffi.CData, "Temporal *"]) -> Annotated[_ffi.CData, "TInstant *"]: return _ffi.cast("TInstant *", temporal) -def as_tsequence(temporal: "Temporal *") -> "TSequence *": +def as_tsequence(temporal: Annotated[_ffi.CData, "Temporal *"]) -> Annotated[_ffi.CData, "TSequence *"]: return _ffi.cast("TSequence *", temporal) -def as_tsequenceset(temporal: "Temporal *") -> "TSequenceSet *": +def as_tsequenceset(temporal: Annotated[_ffi.CData, "Temporal *"]) -> Annotated[_ffi.CData, "TSequenceSet *"]: return _ffi.cast("TSequenceSet *", temporal) diff --git a/builder/templates/init.py b/builder/templates/init.py index f51b67d..e44b1c9 100644 --- a/builder/templates/init.py +++ b/builder/templates/init.py @@ -1,8 +1,8 @@ -from .functions import * from .enums import * from .errors import * +from .functions import * -__version__ = "1.3.0-alpha.1" +__version__ = "1.3.0a1" __all__ = [ # Exceptions "MeosException", diff --git a/dev-requirements.txt b/dev-requirements.txt index 1218dcd..cae8abc 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -1,4 +1,5 @@ cffi python-dateutil shapely -build \ No newline at end of file +build +ruff \ No newline at end of file diff --git a/pymeos_cffi/__init__.py b/pymeos_cffi/__init__.py index 7d0f0d6..61df1c6 100644 --- a/pymeos_cffi/__init__.py +++ b/pymeos_cffi/__init__.py @@ -1,8 +1,8 @@ -from .functions import * from .enums import * from .errors import * +from .functions import * -__version__ = "1.3.0-alpha.1" +__version__ = "1.3.0a1" __all__ = [ # Exceptions "MeosException", @@ -55,7 +55,6 @@ "date_out", "interval_cmp", "interval_in", - "interval_make", "interval_out", "time_in", "time_out", @@ -63,15 +62,17 @@ "timestamp_out", "timestamptz_in", "timestamptz_out", - "geo_get_srid", "meos_errno", "meos_errno_set", "meos_errno_restore", "meos_errno_reset", + "meos_finalize_projsrs", + "meos_finalize_ways", "meos_set_datestyle", "meos_set_intervalstyle", "meos_get_datestyle", "meos_get_intervalstyle", + "meos_set_spatial_ref_sys_csv", "meos_initialize", "meos_finalize", "add_date_int", @@ -82,11 +83,25 @@ "cstring2text", "date_to_timestamp", "date_to_timestamptz", + "float_exp", + "float_ln", + "float_log10", + "float_round", + "interval_make", "minus_date_date", "minus_date_int", "minus_timestamptz_interval", "minus_timestamptz_timestamptz", - "mult_interval_double", + "mul_interval_double", + "pg_date_in", + "pg_date_out", + "pg_interval_cmp", + "pg_interval_in", + "pg_interval_out", + "pg_timestamp_in", + "pg_timestamp_out", + "pg_timestamptz_in", + "pg_timestamptz_out", "text2cstring", "text_cmp", "text_copy", @@ -95,6 +110,7 @@ "text_out", "text_upper", "textcat_text_text", + "timestamptz_shift", "timestamp_to_date", "timestamptz_to_date", "bigintset_in", @@ -115,11 +131,6 @@ "floatspan_out", "floatspanset_in", "floatspanset_out", - "geogset_in", - "geomset_in", - "geoset_as_ewkt", - "geoset_as_text", - "geoset_out", "intset_in", "intset_out", "intspan_in", @@ -152,7 +163,6 @@ "datespan_make", "floatset_make", "floatspan_make", - "geoset_make", "intset_make", "intspan_make", "set_copy", @@ -177,13 +187,13 @@ "floatset_to_intset", "floatspan_to_intspan", "floatspanset_to_intspanset", - "geo_to_set", "int_to_set", "int_to_span", "int_to_spanset", "intset_to_floatset", "intspan_to_floatspan", "intspanset_to_floatspanset", + "set_to_span", "set_to_spanset", "span_to_spanset", "text_to_set", @@ -226,11 +236,6 @@ "floatspanset_lower", "floatspanset_upper", "floatspanset_width", - "geoset_end_value", - "geoset_srid", - "geoset_start_value", - "geoset_value_n", - "geoset_values", "intset_end_value", "intset_start_value", "intset_value_n", @@ -244,7 +249,6 @@ "set_hash", "set_hash_extended", "set_num_values", - "set_to_span", "span_hash", "span_hash_extended", "span_lower_inc", @@ -275,8 +279,8 @@ "tstzspanset_lower", "tstzspanset_num_timestamps", "tstzspanset_start_timestamptz", - "tstzspanset_timestamptz_n", "tstzspanset_timestamps", + "tstzspanset_timestamptz_n", "tstzspanset_upper", "bigintset_shift_scale", "bigintspan_shift_scale", @@ -285,39 +289,33 @@ "datespan_shift_scale", "datespanset_shift_scale", "floatset_ceil", - "floatset_floor", "floatset_degrees", + "floatset_floor", "floatset_radians", - "floatset_round", "floatset_shift_scale", "floatspan_ceil", + "floatspan_degrees", "floatspan_floor", + "floatspan_radians", "floatspan_round", "floatspan_shift_scale", "floatspanset_ceil", "floatspanset_floor", + "floatspanset_degrees", + "floatspanset_radians", "floatspanset_round", "floatspanset_shift_scale", - "geoset_round", - "geoset_set_srid", - "geoset_transform", - "geoset_transform_pipeline", "intset_shift_scale", "intspan_shift_scale", "intspanset_shift_scale", - "point_transform", - "point_transform_pipeline", - "set_spans", - "set_split_each_n_spans", - "set_split_n_spans", - "spanset_spans", - "spanset_split_each_n_spans", - "spanset_split_n_spans", + "numspan_expand", + "tstzspan_expand", + "set_round", + "textcat_text_textset", + "textcat_textset_text", "textset_initcap", "textset_lower", "textset_upper", - "textcat_textset_text", - "textcat_text_textset", "timestamptz_tprecision", "tstzset_shift_scale", "tstzset_tprecision", @@ -346,6 +344,12 @@ "spanset_le", "spanset_lt", "spanset_ne", + "set_spans", + "set_split_each_n_spans", + "set_split_n_spans", + "spanset_spans", + "spanset_split_each_n_spans", + "spanset_split_n_spans", "adjacent_span_bigint", "adjacent_span_date", "adjacent_span_float", @@ -369,7 +373,6 @@ "contained_float_set", "contained_float_span", "contained_float_spanset", - "contained_geo_set", "contained_int_set", "contained_int_span", "contained_int_spanset", @@ -385,7 +388,6 @@ "contains_set_bigint", "contains_set_date", "contains_set_float", - "contains_set_geo", "contains_set_int", "contains_set_set", "contains_set_text", @@ -560,12 +562,10 @@ "intersection_bigint_set", "intersection_date_set", "intersection_float_set", - "intersection_geo_set", "intersection_int_set", "intersection_set_bigint", "intersection_set_date", "intersection_set_float", - "intersection_set_geo", "intersection_set_int", "intersection_set_set", "intersection_set_text", @@ -595,14 +595,12 @@ "minus_float_set", "minus_float_span", "minus_float_spanset", - "minus_geo_set", "minus_int_set", "minus_int_span", "minus_int_spanset", "minus_set_bigint", "minus_set_date", "minus_set_float", - "minus_set_geo", "minus_set_int", "minus_set_set", "minus_set_text", @@ -634,14 +632,12 @@ "union_float_set", "union_float_span", "union_float_spanset", - "union_geo_set", "union_int_set", "union_int_span", "union_int_spanset", "union_set_bigint", "union_set_date", "union_set_float", - "union_set_geo", "union_set_int", "union_set_set", "union_set_text", @@ -718,69 +714,44 @@ "text_union_transfn", "timestamptz_extent_transfn", "timestamptz_union_transfn", + "bigint_get_bin", + "bigintspan_bins", + "bigintspanset_bins", + "date_get_bin", + "datespan_bins", + "datespanset_bins", + "float_get_bin", + "floatspan_bins", + "floatspanset_bins", + "int_get_bin", + "intspan_bins", + "intspanset_bins", + "timestamptz_get_bin", + "tstzspan_bins", + "tstzspanset_bins", + "tbox_as_hexwkb", + "tbox_as_wkb", + "tbox_from_hexwkb", + "tbox_from_wkb", "tbox_in", "tbox_out", - "tbox_from_wkb", - "tbox_from_hexwkb", - "stbox_from_wkb", - "stbox_from_hexwkb", - "tbox_as_wkb", - "tbox_as_hexwkb", - "stbox_as_wkb", - "stbox_as_hexwkb", - "stbox_in", - "stbox_out", - "float_tstzspan_to_tbox", "float_timestamptz_to_tbox", - "geo_tstzspan_to_stbox", - "geo_timestamptz_to_stbox", - "int_tstzspan_to_tbox", + "float_tstzspan_to_tbox", "int_timestamptz_to_tbox", + "int_tstzspan_to_tbox", "numspan_tstzspan_to_tbox", "numspan_timestamptz_to_tbox", - "stbox_copy", - "stbox_make", "tbox_copy", "tbox_make", "float_to_tbox", - "geo_to_stbox", "int_to_tbox", "set_to_tbox", "span_to_tbox", "spanset_to_tbox", - "spatialset_to_stbox", - "stbox_to_gbox", - "stbox_to_box3d", - "stbox_to_geo", - "stbox_to_tstzspan", "tbox_to_intspan", "tbox_to_floatspan", "tbox_to_tstzspan", - "timestamptz_to_stbox", "timestamptz_to_tbox", - "tstzset_to_stbox", - "tstzspan_to_stbox", - "tstzspanset_to_stbox", - "tnumber_to_tbox", - "tpoint_to_stbox", - "stbox_area", - "stbox_hast", - "stbox_hasx", - "stbox_hasz", - "stbox_isgeodetic", - "stbox_perimeter", - "stbox_srid", - "stbox_tmax", - "stbox_tmax_inc", - "stbox_tmin", - "stbox_tmin_inc", - "stbox_volume", - "stbox_xmax", - "stbox_xmin", - "stbox_ymax", - "stbox_ymin", - "stbox_zmax", - "stbox_zmin", "tbox_hast", "tbox_hasx", "tbox_tmax", @@ -795,101 +766,52 @@ "tboxfloat_xmin", "tboxint_xmax", "tboxint_xmin", - "stbox_expand_space", - "stbox_expand_time", - "stbox_get_space", - "stbox_quad_split", - "stbox_round", - "stbox_set_srid", - "stbox_shift_scale_time", - "stbox_transform", - "stbox_transform_pipeline", - "stboxarr_round", - "tbox_expand_time", "tbox_expand_float", "tbox_expand_int", + "tbox_expand_time", "tbox_round", "tbox_shift_scale_float", "tbox_shift_scale_int", "tbox_shift_scale_time", "union_tbox_tbox", "intersection_tbox_tbox", - "union_stbox_stbox", - "intersection_stbox_stbox", - "rtree_create_stbox", - "rtree_free", - "adjacent_stbox_stbox", "adjacent_tbox_tbox", "contained_tbox_tbox", - "contained_stbox_stbox", - "contains_stbox_stbox", "contains_tbox_tbox", "overlaps_tbox_tbox", - "overlaps_stbox_stbox", "same_tbox_tbox", - "same_stbox_stbox", + "after_tbox_tbox", + "before_tbox_tbox", "left_tbox_tbox", + "overafter_tbox_tbox", + "overbefore_tbox_tbox", "overleft_tbox_tbox", - "right_tbox_tbox", "overright_tbox_tbox", - "before_tbox_tbox", - "overbefore_tbox_tbox", - "after_tbox_tbox", - "overafter_tbox_tbox", - "left_stbox_stbox", - "overleft_stbox_stbox", - "right_stbox_stbox", - "overright_stbox_stbox", - "below_stbox_stbox", - "overbelow_stbox_stbox", - "above_stbox_stbox", - "overabove_stbox_stbox", - "front_stbox_stbox", - "overfront_stbox_stbox", - "back_stbox_stbox", - "overback_stbox_stbox", - "before_stbox_stbox", - "overbefore_stbox_stbox", - "after_stbox_stbox", - "overafter_stbox_stbox", - "tbox_eq", - "tbox_ne", + "right_tbox_tbox", "tbox_cmp", - "tbox_lt", - "tbox_le", + "tbox_eq", "tbox_ge", "tbox_gt", - "stbox_eq", - "stbox_ne", - "stbox_cmp", - "stbox_lt", - "stbox_le", - "stbox_ge", - "stbox_gt", + "tbox_le", + "tbox_lt", + "tbox_ne", + "tbool_from_mfjson", "tbool_in", - "tint_in", + "tbool_out", + "temporal_as_hexwkb", + "temporal_as_mfjson", + "temporal_as_wkb", + "temporal_from_hexwkb", + "temporal_from_wkb", + "tfloat_from_mfjson", "tfloat_in", - "ttext_in", - "tgeompoint_in", - "tgeogpoint_in", - "tbool_from_mfjson", + "tfloat_out", "tint_from_mfjson", - "tfloat_from_mfjson", - "ttext_from_mfjson", - "tgeompoint_from_mfjson", - "tgeogpoint_from_mfjson", - "temporal_from_wkb", - "temporal_from_hexwkb", - "tbool_out", + "tint_in", "tint_out", - "tfloat_out", + "ttext_from_mfjson", + "ttext_in", "ttext_out", - "tpoint_out", - "tpoint_as_text", - "tpoint_as_ewkt", - "temporal_as_mfjson", - "temporal_as_wkb", - "temporal_as_hexwkb", "tbool_from_base_temp", "tboolinst_make", "tboolseq_from_base_tstzset", @@ -898,31 +820,28 @@ "temporal_copy", "tfloat_from_base_temp", "tfloatinst_make", - "tfloatseq_from_base_tstzspan", "tfloatseq_from_base_tstzset", + "tfloatseq_from_base_tstzspan", "tfloatseqset_from_base_tstzspanset", "tint_from_base_temp", "tintinst_make", - "tintseq_from_base_tstzspan", "tintseq_from_base_tstzset", + "tintseq_from_base_tstzspan", "tintseqset_from_base_tstzspanset", - "tpoint_from_base_temp", - "tpointinst_make", - "tpointseq_from_base_tstzspan", - "tpointseq_from_base_tstzset", - "tpointseqset_from_base_tstzspanset", "tsequence_make", "tsequenceset_make", "tsequenceset_make_gaps", "ttext_from_base_temp", "ttextinst_make", - "ttextseq_from_base_tstzspan", "ttextseq_from_base_tstzset", + "ttextseq_from_base_tstzspan", "ttextseqset_from_base_tstzspanset", + "tbool_to_tint", "temporal_to_tstzspan", "tfloat_to_tint", "tint_to_tfloat", "tnumber_to_span", + "tnumber_to_tbox", "tbool_end_value", "tbool_start_value", "tbool_value_at_timestamptz", @@ -936,6 +855,7 @@ "temporal_instant_n", "temporal_instants", "temporal_interp", + "temporal_lower_inc", "temporal_max_instant", "temporal_min_instant", "temporal_num_instants", @@ -944,16 +864,15 @@ "temporal_segments", "temporal_sequence_n", "temporal_sequences", - "temporal_lower_inc", - "temporal_upper_inc", "temporal_start_instant", "temporal_start_sequence", "temporal_start_timestamptz", "temporal_stops", "temporal_subtype", "temporal_time", - "temporal_timestamptz_n", "temporal_timestamps", + "temporal_timestamptz_n", + "temporal_upper_inc", "tfloat_end_value", "tfloat_max_value", "tfloat_min_value", @@ -971,11 +890,6 @@ "tnumber_integral", "tnumber_twavg", "tnumber_valuespans", - "tpoint_end_value", - "tpoint_start_value", - "tpoint_value_at_timestamptz", - "tpoint_value_n", - "tpoint_values", "ttext_end_value", "ttext_max_value", "ttext_min_value", @@ -984,7 +898,8 @@ "ttext_value_n", "ttext_values", "float_degrees", - "meos_srid_is_latlong", + "temparr_round", + "temporal_round", "temporal_scale_time", "temporal_set_interp", "temporal_shift_scale_time", @@ -992,30 +907,22 @@ "temporal_to_tinstant", "temporal_to_tsequence", "temporal_to_tsequenceset", - "tfloat_floor", "tfloat_ceil", "tfloat_degrees", + "tfloat_floor", "tfloat_radians", - "tfloat_round", "tfloat_scale_value", "tfloat_shift_scale_value", "tfloat_shift_value", - "tfloatarr_round", "tint_scale_value", "tint_shift_scale_value", "tint_shift_value", - "tpoint_round", - "tpoint_transform", - "tpoint_transform_pipeline", - "tpoint_transform_pj", - "lwproj_transform", - "tpointarr_round", "temporal_append_tinstant", "temporal_append_tsequence", - "temporal_delete_tstzspan", - "temporal_delete_tstzspanset", "temporal_delete_timestamptz", "temporal_delete_tstzset", + "temporal_delete_tstzspan", + "temporal_delete_tstzspanset", "temporal_insert", "temporal_merge", "temporal_merge_array", @@ -1024,17 +931,17 @@ "tbool_minus_value", "temporal_at_max", "temporal_at_min", - "temporal_at_tstzspan", - "temporal_at_tstzspanset", "temporal_at_timestamptz", "temporal_at_tstzset", + "temporal_at_tstzspan", + "temporal_at_tstzspanset", "temporal_at_values", "temporal_minus_max", "temporal_minus_min", - "temporal_minus_tstzspan", - "temporal_minus_tstzspanset", "temporal_minus_timestamptz", "temporal_minus_tstzset", + "temporal_minus_tstzspan", + "temporal_minus_tstzspanset", "temporal_minus_values", "tfloat_at_value", "tfloat_minus_value", @@ -1046,12 +953,6 @@ "tnumber_minus_span", "tnumber_minus_spanset", "tnumber_minus_tbox", - "tpoint_at_geom", - "tpoint_at_stbox", - "tpoint_at_value", - "tpoint_minus_geom", - "tpoint_minus_stbox", - "tpoint_minus_value", "ttext_at_value", "ttext_minus_value", "temporal_cmp", @@ -1064,27 +965,12 @@ "always_eq_bool_tbool", "always_eq_float_tfloat", "always_eq_int_tint", - "always_eq_point_tpoint", "always_eq_tbool_bool", "always_eq_temporal_temporal", "always_eq_text_ttext", "always_eq_tfloat_float", "always_eq_tint_int", - "always_eq_tpoint_point", - "always_eq_tpoint_tpoint", "always_eq_ttext_text", - "always_ne_bool_tbool", - "always_ne_float_tfloat", - "always_ne_int_tint", - "always_ne_point_tpoint", - "always_ne_tbool_bool", - "always_ne_temporal_temporal", - "always_ne_text_ttext", - "always_ne_tfloat_float", - "always_ne_tint_int", - "always_ne_tpoint_point", - "always_ne_tpoint_tpoint", - "always_ne_ttext_text", "always_ge_float_tfloat", "always_ge_int_tint", "always_ge_temporal_temporal", @@ -1113,17 +999,23 @@ "always_lt_tfloat_float", "always_lt_tint_int", "always_lt_ttext_text", + "always_ne_bool_tbool", + "always_ne_float_tfloat", + "always_ne_int_tint", + "always_ne_tbool_bool", + "always_ne_temporal_temporal", + "always_ne_text_ttext", + "always_ne_tfloat_float", + "always_ne_tint_int", + "always_ne_ttext_text", "ever_eq_bool_tbool", "ever_eq_float_tfloat", "ever_eq_int_tint", - "ever_eq_point_tpoint", "ever_eq_tbool_bool", "ever_eq_temporal_temporal", "ever_eq_text_ttext", "ever_eq_tfloat_float", "ever_eq_tint_int", - "ever_eq_tpoint_point", - "ever_eq_tpoint_tpoint", "ever_eq_ttext_text", "ever_ge_float_tfloat", "ever_ge_int_tint", @@ -1156,24 +1048,19 @@ "ever_ne_bool_tbool", "ever_ne_float_tfloat", "ever_ne_int_tint", - "ever_ne_point_tpoint", "ever_ne_tbool_bool", "ever_ne_temporal_temporal", "ever_ne_text_ttext", "ever_ne_tfloat_float", "ever_ne_tint_int", - "ever_ne_tpoint_point", - "ever_ne_tpoint_tpoint", "ever_ne_ttext_text", "teq_bool_tbool", "teq_float_tfloat", "teq_int_tint", - "teq_point_tpoint", "teq_tbool_bool", "teq_temporal_temporal", "teq_text_ttext", "teq_tfloat_float", - "teq_tpoint_point", "teq_tint_int", "teq_ttext_text", "tge_float_tfloat", @@ -1207,174 +1094,102 @@ "tne_bool_tbool", "tne_float_tfloat", "tne_int_tint", - "tne_point_tpoint", "tne_tbool_bool", "tne_temporal_temporal", "tne_text_ttext", "tne_tfloat_float", - "tne_tpoint_point", "tne_tint_int", "tne_ttext_text", "temporal_spans", "temporal_split_each_n_spans", "temporal_split_n_spans", - "tnumber_tboxes", "tnumber_split_each_n_tboxes", "tnumber_split_n_tboxes", - "tpoint_stboxes", - "tpoint_space_boxes", - "tpoint_space_time_boxes", - "tpoint_split_each_n_stboxes", - "tpoint_split_n_stboxes", - "geo_split_each_n_gboxes", - "geo_split_n_gboxes", + "tnumber_tboxes", "adjacent_numspan_tnumber", - "adjacent_stbox_tpoint", "adjacent_tbox_tnumber", "adjacent_temporal_temporal", "adjacent_temporal_tstzspan", "adjacent_tnumber_numspan", "adjacent_tnumber_tbox", "adjacent_tnumber_tnumber", - "adjacent_tpoint_stbox", - "adjacent_tpoint_tpoint", "adjacent_tstzspan_temporal", "contained_numspan_tnumber", - "contained_stbox_tpoint", "contained_tbox_tnumber", "contained_temporal_temporal", "contained_temporal_tstzspan", "contained_tnumber_numspan", "contained_tnumber_tbox", "contained_tnumber_tnumber", - "contained_tpoint_stbox", - "contained_tpoint_tpoint", "contained_tstzspan_temporal", "contains_numspan_tnumber", - "contains_stbox_tpoint", "contains_tbox_tnumber", "contains_temporal_tstzspan", "contains_temporal_temporal", "contains_tnumber_numspan", "contains_tnumber_tbox", "contains_tnumber_tnumber", - "contains_tpoint_stbox", - "contains_tpoint_tpoint", "contains_tstzspan_temporal", "overlaps_numspan_tnumber", - "overlaps_stbox_tpoint", "overlaps_tbox_tnumber", "overlaps_temporal_temporal", "overlaps_temporal_tstzspan", "overlaps_tnumber_numspan", "overlaps_tnumber_tbox", "overlaps_tnumber_tnumber", - "overlaps_tpoint_stbox", - "overlaps_tpoint_tpoint", "overlaps_tstzspan_temporal", "same_numspan_tnumber", - "same_stbox_tpoint", "same_tbox_tnumber", "same_temporal_temporal", "same_temporal_tstzspan", "same_tnumber_numspan", "same_tnumber_tbox", "same_tnumber_tnumber", - "same_tpoint_stbox", - "same_tpoint_tpoint", "same_tstzspan_temporal", - "above_stbox_tpoint", - "above_tpoint_stbox", - "above_tpoint_tpoint", - "after_stbox_tpoint", "after_tbox_tnumber", "after_temporal_tstzspan", "after_temporal_temporal", "after_tnumber_tbox", "after_tnumber_tnumber", - "after_tpoint_stbox", - "after_tpoint_tpoint", "after_tstzspan_temporal", - "back_stbox_tpoint", - "back_tpoint_stbox", - "back_tpoint_tpoint", - "before_stbox_tpoint", "before_tbox_tnumber", "before_temporal_tstzspan", "before_temporal_temporal", "before_tnumber_tbox", "before_tnumber_tnumber", - "before_tpoint_stbox", - "before_tpoint_tpoint", "before_tstzspan_temporal", - "below_stbox_tpoint", - "below_tpoint_stbox", - "below_tpoint_tpoint", - "front_stbox_tpoint", - "front_tpoint_stbox", - "front_tpoint_tpoint", - "left_stbox_tpoint", "left_tbox_tnumber", "left_numspan_tnumber", "left_tnumber_numspan", "left_tnumber_tbox", "left_tnumber_tnumber", - "left_tpoint_stbox", - "left_tpoint_tpoint", - "overabove_stbox_tpoint", - "overabove_tpoint_stbox", - "overabove_tpoint_tpoint", - "overafter_stbox_tpoint", "overafter_tbox_tnumber", "overafter_temporal_tstzspan", "overafter_temporal_temporal", "overafter_tnumber_tbox", "overafter_tnumber_tnumber", - "overafter_tpoint_stbox", - "overafter_tpoint_tpoint", "overafter_tstzspan_temporal", - "overback_stbox_tpoint", - "overback_tpoint_stbox", - "overback_tpoint_tpoint", - "overbefore_stbox_tpoint", "overbefore_tbox_tnumber", "overbefore_temporal_tstzspan", "overbefore_temporal_temporal", "overbefore_tnumber_tbox", "overbefore_tnumber_tnumber", - "overbefore_tpoint_stbox", - "overbefore_tpoint_tpoint", "overbefore_tstzspan_temporal", - "overbelow_stbox_tpoint", - "overbelow_tpoint_stbox", - "overbelow_tpoint_tpoint", - "overfront_stbox_tpoint", - "overfront_tpoint_stbox", - "overfront_tpoint_tpoint", "overleft_numspan_tnumber", - "overleft_stbox_tpoint", "overleft_tbox_tnumber", "overleft_tnumber_numspan", "overleft_tnumber_tbox", "overleft_tnumber_tnumber", - "overleft_tpoint_stbox", - "overleft_tpoint_tpoint", "overright_numspan_tnumber", - "overright_stbox_tpoint", "overright_tbox_tnumber", "overright_tnumber_numspan", "overright_tnumber_tbox", "overright_tnumber_tnumber", - "overright_tpoint_stbox", - "overright_tpoint_tpoint", "right_numspan_tnumber", - "right_stbox_tpoint", "right_tbox_tnumber", "right_tnumber_numspan", "right_tnumber_tbox", "right_tnumber_tnumber", - "right_tpoint_stbox", - "right_tpoint_tpoint", "tand_bool_tbool", "tand_tbool_bool", "tand_tbool_tbool", @@ -1403,87 +1218,31 @@ "sub_tfloat_float", "sub_tint_int", "sub_tnumber_tnumber", - "tfloat_derivative", + "temporal_derivative", + "tfloat_exp", + "tfloat_ln", + "tfloat_log10", "tnumber_abs", + "float_angular_difference", "tnumber_angular_difference", "tnumber_delta_value", "textcat_text_ttext", "textcat_ttext_text", "textcat_ttext_ttext", + "ttext_initcap", "ttext_upper", "ttext_lower", - "ttext_initcap", - "distance_tfloat_float", - "distance_tint_int", - "distance_tnumber_tnumber", - "distance_tpoint_point", - "distance_tpoint_tpoint", - "nad_stbox_geo", - "nad_stbox_stbox", - "nad_tint_int", - "nad_tint_tbox", - "nad_tint_tint", + "tdistance_tfloat_float", + "tdistance_tint_int", + "tdistance_tnumber_tnumber", + "nad_tboxfloat_tboxfloat", "nad_tboxint_tboxint", "nad_tfloat_float", "nad_tfloat_tfloat", "nad_tfloat_tbox", - "nad_tboxfloat_tboxfloat", - "nad_tpoint_geo", - "nad_tpoint_stbox", - "nad_tpoint_tpoint", - "nai_tpoint_geo", - "nai_tpoint_tpoint", - "shortestline_tpoint_geo", - "shortestline_tpoint_tpoint", - "bearing_point_point", - "bearing_tpoint_point", - "bearing_tpoint_tpoint", - "geo_gboxes", - "tpoint_angular_difference", - "tpoint_azimuth", - "tpoint_convex_hull", - "tpoint_cumulative_length", - "tpoint_direction", - "tpoint_get_x", - "tpoint_get_y", - "tpoint_get_z", - "tpoint_is_simple", - "tpoint_length", - "tpoint_speed", - "tpoint_srid", - "tpoint_trajectory", - "tpoint_twcentroid", - "geo_expand_space", - "geomeas_to_tpoint", - "tgeogpoint_to_tgeompoint", - "tgeompoint_to_tgeogpoint", - "tpoint_AsMVTGeom", - "tpoint_expand_space", - "tpoint_make_simple", - "tpoint_set_srid", - "tpoint_tfloat_to_geomeas", - "acontains_geo_tpoint", - "adisjoint_tpoint_geo", - "adisjoint_tpoint_tpoint", - "adwithin_tpoint_geo", - "adwithin_tpoint_tpoint", - "aintersects_tpoint_geo", - "aintersects_tpoint_tpoint", - "atouches_tpoint_geo", - "econtains_geo_tpoint", - "edisjoint_tpoint_geo", - "edisjoint_tpoint_tpoint", - "edwithin_tpoint_geo", - "edwithin_tpoint_tpoint", - "eintersects_tpoint_geo", - "eintersects_tpoint_tpoint", - "etouches_tpoint_geo", - "tcontains_geo_tpoint", - "tdisjoint_tpoint_geo", - "tdwithin_tpoint_geo", - "tdwithin_tpoint_tpoint", - "tintersects_tpoint_geo", - "ttouches_tpoint_geo", + "nad_tint_int", + "nad_tint_tbox", + "nad_tint_tint", "tbool_tand_transfn", "tbool_tor_transfn", "temporal_extent_transfn", @@ -1506,9 +1265,6 @@ "tnumber_tavg_finalfn", "tnumber_tavg_transfn", "tnumber_wavg_transfn", - "tpoint_extent_transfn", - "tpoint_tcentroid_finalfn", - "tpoint_tcentroid_transfn", "tstzset_tcount_transfn", "tstzspan_tcount_transfn", "tstzspanset_tcount_transfn", @@ -1525,58 +1281,26 @@ "temporal_frechet_distance", "temporal_frechet_path", "temporal_hausdorff_distance", - "bigint_get_bin", - "bigintspan_bins", - "bigintspanset_bins", - "bigintspanset_value_spans", - "date_get_bin", - "datespan_bins", - "datespanset_bins", - "datespanset_time_spans", - "float_get_bin", - "floatspan_bins", - "floatspanset_bins", - "floatspanset_value_spans", - "int_get_bin", - "intspan_bins", - "intspanset_bins", - "intspanset_value_spans", - "timestamptz_get_bin", - "tstzspan_bins", - "tstzspanset_bins", - "tstzspanset_time_spans", - "stbox_get_space_tile", - "stbox_get_space_time_tile", - "stbox_get_time_tile", - "stbox_space_tiles", - "stbox_space_time_tiles", - "stbox_time_tiles", - "temporal_time_spans", + "temporal_time_bins", "temporal_time_split", - "tfloat_value_spans", + "tfloat_time_boxes", + "tfloat_value_bins", + "tfloat_value_boxes", "tfloat_value_split", + "tfloat_value_time_boxes", "tfloat_value_time_split", - "tfloatbox_get_time_tile", - "tfloatbox_get_value_tile", - "tfloatbox_get_value_time_tile", "tfloatbox_time_tiles", "tfloatbox_value_tiles", "tfloatbox_value_time_tiles", - "timestamptz_get_bin", - "tint_value_spans", + "tint_time_boxes", + "tint_value_bins", + "tint_value_boxes", "tint_value_split", + "tint_value_time_boxes", "tint_value_time_split", - "tintbox_get_time_tile", - "tintbox_get_value_tile", - "tintbox_get_value_time_tile", "tintbox_time_tiles", "tintbox_value_tiles", "tintbox_value_time_tiles", - "tpoint_space_split", - "tpoint_space_time_split", - "tpoint_time_split", - "temptype_subtype", - "temptype_subtype_all", "tempsubtype_name", "tempsubtype_from_string", "meosoper_name", @@ -1591,19 +1315,13 @@ "spansettype_spantype", "basetype_spantype", "basetype_settype", - "meos_basetype", - "alpha_basetype", "tnumber_basetype", - "alphanum_basetype", "geo_basetype", - "spatial_basetype", "time_type", - "set_basetype", "set_type", "numset_type", "ensure_numset_type", "timeset_type", - "ensure_timeset_type", "set_spantype", "ensure_set_spantype", "alphanumset_type", @@ -1614,81 +1332,479 @@ "span_basetype", "span_canon_basetype", "span_type", - "span_bbox_type", + "type_span_bbox", + "span_tbox_type", + "ensure_span_tbox_type", "numspan_basetype", "numspan_type", "ensure_numspan_type", "timespan_basetype", "timespan_type", - "ensure_timespan_type", "spanset_type", - "numspanset_type", "timespanset_type", "ensure_timespanset_type", "temporal_type", - "temporal_basetype", "temptype_continuous", "basetype_byvalue", "basetype_varlength", "basetype_length", - "talphanum_type", "talpha_type", "tnumber_type", "ensure_tnumber_type", "ensure_tnumber_basetype", - "tnumber_settype", "tnumber_spantype", - "tnumber_spansettype", + "spatial_basetype", "tspatial_type", "ensure_tspatial_type", - "tspatial_basetype", + "tpoint_type", + "ensure_tpoint_type", "tgeo_type", "ensure_tgeo_type", - "ensure_tnumber_tgeo_type", + "tgeo_type_all", + "ensure_tgeo_type_all", + "tgeometry_type", + "ensure_tgeometry_type", + "tgeodetic_type", + "ensure_tgeodetic_type", + "ensure_tnumber_tpoint_type", + "geo_as_ewkb", + "geo_as_ewkt", + "geo_as_geojson", + "geo_as_hexewkb", + "geo_as_text", + "geo_from_ewkb", + "geo_from_geojson", + "geo_from_text", + "geo_out", + "geog_from_binary", + "geog_from_hexewkb", + "geog_in", + "geom_from_hexewkb", + "geom_in", + "geo_copy", + "geogpoint_make2d", + "geogpoint_make3dz", + "geompoint_make2d", + "geompoint_make3dz", + "geom_to_geog", + "geog_to_geom", + "geo_is_empty", + "geo_typename", + "geog_area", + "geog_centroid", + "geog_length", + "geog_perimeter", + "geom_azimuth", + "geom_length", + "geom_perimeter", + "line_numpoints", + "line_point_n", + "geo_reverse", + "geo_round", + "geo_set_srid", + "geo_srid", + "geo_transform", + "geo_transform_pipeline", + "geo_collect_garray", + "geo_makeline_garray", + "geo_npoints", + "geo_ngeos", + "geo_geoN", + "geom_array_union", + "geom_boundary", + "geom_buffer", + "geom_centroid", + "geom_convex_hull", + "geom_difference2d", + "geom_intersection2d", + "geom_shortestline2d", + "geom_shortestline3d", + "geom_unary_union", + "line_interpolate_point", + "line_locate_point", + "line_substring", + "geog_dwithin", + "geog_intersects", + "geom_contains", + "geom_covers", + "geom_disjoint2d", + "geom_dwithin2d", + "geom_dwithin3d", + "geom_intersects2d", + "geom_intersects3d", + "geom_relate_pattern", + "geom_touches", + "geo_stboxes", + "geo_split_each_n_stboxes", + "geo_split_n_stboxes", + "geog_distance", + "geom_distance2d", + "geom_distance3d", + "geo_equals", + "geo_same", + "geogset_in", + "geomset_in", + "spatialset_as_text", + "spatialset_as_ewkt", + "geoset_make", + "geo_to_set", + "geoset_end_value", + "geoset_start_value", + "geoset_value_n", + "geoset_values", + "contained_geo_set", + "contains_set_geo", + "geo_union_transfn", + "intersection_geo_set", + "intersection_set_geo", + "minus_geo_set", + "minus_set_geo", + "union_geo_set", + "union_set_geo", + "spatialset_set_srid", + "spatialset_srid", + "spatialset_transform", + "spatialset_transform_pipeline", + "stbox_as_hexwkb", + "stbox_as_wkb", + "stbox_from_hexwkb", + "stbox_from_wkb", + "stbox_in", + "stbox_out", + "geo_timestamptz_to_stbox", + "geo_tstzspan_to_stbox", + "stbox_copy", + "stbox_make", + "geo_to_stbox", + "spatialset_to_stbox", + "stbox_to_box3d", + "stbox_to_gbox", + "stbox_to_geo", + "stbox_to_tstzspan", + "timestamptz_to_stbox", + "tstzset_to_stbox", + "tstzspan_to_stbox", + "tstzspanset_to_stbox", + "stbox_area", + "stbox_hast", + "stbox_hasx", + "stbox_hasz", + "stbox_isgeodetic", + "stbox_perimeter", + "stbox_tmax", + "stbox_tmax_inc", + "stbox_tmin", + "stbox_tmin_inc", + "stbox_volume", + "stbox_xmax", + "stbox_xmin", + "stbox_ymax", + "stbox_ymin", + "stbox_zmax", + "stbox_zmin", + "stbox_expand_space", + "stbox_expand_time", + "stbox_get_space", + "stbox_quad_split", + "stbox_round", + "stbox_shift_scale_time", + "stboxarr_round", + "stbox_set_srid", + "stbox_srid", + "stbox_transform", + "stbox_transform_pipeline", + "adjacent_stbox_stbox", + "contained_stbox_stbox", + "contains_stbox_stbox", + "overlaps_stbox_stbox", + "same_stbox_stbox", + "above_stbox_stbox", + "after_stbox_stbox", + "back_stbox_stbox", + "before_stbox_stbox", + "below_stbox_stbox", + "front_stbox_stbox", + "left_stbox_stbox", + "overabove_stbox_stbox", + "overafter_stbox_stbox", + "overback_stbox_stbox", + "overbefore_stbox_stbox", + "overbelow_stbox_stbox", + "overfront_stbox_stbox", + "overleft_stbox_stbox", + "overright_stbox_stbox", + "right_stbox_stbox", + "union_stbox_stbox", + "intersection_stbox_stbox", + "stbox_cmp", + "stbox_eq", + "stbox_ge", + "stbox_gt", + "stbox_le", + "stbox_lt", + "stbox_ne", + "rtree_create_stbox", + "rtree_free", + "rtree_insert", + "rtree_search", + "tgeo_out", + "tgeogpoint_from_mfjson", + "tgeogpoint_in", + "tgeography_from_mfjson", + "tgeography_in", + "tgeometry_from_mfjson", + "tgeometry_in", + "tgeompoint_from_mfjson", + "tgeompoint_in", + "tspatial_as_ewkt", + "tspatial_as_text", + "tgeo_from_base_temp", + "tgeoinst_make", + "tgeoseq_from_base_tstzset", + "tgeoseq_from_base_tstzspan", + "tgeoseqset_from_base_tstzspanset", + "tpoint_from_base_temp", + "tpointinst_make", + "tpointseq_from_base_tstzset", + "tpointseq_from_base_tstzspan", + "tpointseq_make_coords", + "tpointseqset_from_base_tstzspanset", + "box3d_to_stbox", + "gbox_to_stbox", + "geomeas_to_tpoint", + "tgeogpoint_to_tgeography", + "tgeography_to_tgeogpoint", + "tgeography_to_tgeometry", + "tgeometry_to_tgeography", + "tgeometry_to_tgeompoint", + "tgeompoint_to_tgeometry", + "tpoint_as_mvtgeom", + "tpoint_tfloat_to_geomeas", + "tspatial_to_stbox", + "bearing_point_point", + "bearing_tpoint_point", + "bearing_tpoint_tpoint", + "tgeo_centroid", + "tgeo_convex_hull", + "tgeo_end_value", + "tgeo_start_value", + "tgeo_traversed_area", + "tgeo_value_at_timestamptz", + "tgeo_value_n", + "tgeo_values", + "tpoint_angular_difference", + "tpoint_azimuth", + "tpoint_cumulative_length", + "tpoint_direction", + "tpoint_get_x", + "tpoint_get_y", + "tpoint_get_z", + "tpoint_is_simple", + "tpoint_length", + "tpoint_speed", + "tpoint_trajectory", + "tpoint_twcentroid", + "tgeo_affine", + "tgeo_scale", + "tpoint_make_simple", + "tspatial_srid", + "tspatial_set_srid", + "tspatial_transform", + "tspatial_transform_pipeline", + "tgeo_at_geom", + "tgeo_at_stbox", + "tgeo_at_value", + "tgeo_minus_geom", + "tgeo_minus_stbox", + "tgeo_minus_value", + "tpoint_at_geom", + "tpoint_at_value", + "tpoint_minus_geom", + "tpoint_minus_value", + "always_eq_geo_tgeo", + "always_eq_tgeo_geo", + "always_eq_tgeo_tgeo", + "always_ne_geo_tgeo", + "always_ne_tgeo_geo", + "always_ne_tgeo_tgeo", + "ever_eq_geo_tgeo", + "ever_eq_tgeo_geo", + "ever_eq_tgeo_tgeo", + "ever_ne_geo_tgeo", + "ever_ne_tgeo_geo", + "ever_ne_tgeo_tgeo", + "teq_geo_tgeo", + "teq_tgeo_geo", + "tne_geo_tgeo", + "tne_tgeo_geo", + "tgeo_stboxes", + "tgeo_space_boxes", + "tgeo_space_time_boxes", + "tgeo_split_each_n_stboxes", + "tgeo_split_n_stboxes", + "adjacent_stbox_tspatial", + "adjacent_tspatial_stbox", + "adjacent_tspatial_tspatial", + "contained_stbox_tspatial", + "contained_tspatial_stbox", + "contained_tspatial_tspatial", + "contains_stbox_tspatial", + "contains_tspatial_stbox", + "contains_tspatial_tspatial", + "overlaps_stbox_tspatial", + "overlaps_tspatial_stbox", + "overlaps_tspatial_tspatial", + "same_stbox_tspatial", + "same_tspatial_stbox", + "same_tspatial_tspatial", + "above_stbox_tspatial", + "above_tspatial_stbox", + "above_tspatial_tspatial", + "after_stbox_tspatial", + "after_tspatial_stbox", + "after_tspatial_tspatial", + "back_stbox_tspatial", + "back_tspatial_stbox", + "back_tspatial_tspatial", + "before_stbox_tspatial", + "before_tspatial_stbox", + "before_tspatial_tspatial", + "below_stbox_tspatial", + "below_tspatial_stbox", + "below_tspatial_tspatial", + "front_stbox_tspatial", + "front_tspatial_stbox", + "front_tspatial_tspatial", + "left_stbox_tspatial", + "left_tspatial_stbox", + "left_tspatial_tspatial", + "overabove_stbox_tspatial", + "overabove_tspatial_stbox", + "overabove_tspatial_tspatial", + "overafter_stbox_tspatial", + "overafter_tspatial_stbox", + "overafter_tspatial_tspatial", + "overback_stbox_tspatial", + "overback_tspatial_stbox", + "overback_tspatial_tspatial", + "overbefore_stbox_tspatial", + "overbefore_tspatial_stbox", + "overbefore_tspatial_tspatial", + "overbelow_stbox_tspatial", + "overbelow_tspatial_stbox", + "overbelow_tspatial_tspatial", + "overfront_stbox_tspatial", + "overfront_tspatial_stbox", + "overfront_tspatial_tspatial", + "overleft_stbox_tspatial", + "overleft_tspatial_stbox", + "overleft_tspatial_tspatial", + "overright_stbox_tspatial", + "overright_tspatial_stbox", + "overright_tspatial_tspatial", + "right_stbox_tspatial", + "right_tspatial_stbox", + "right_tspatial_tspatial", + "acontains_geo_tgeo", + "acontains_tgeo_geo", + "acontains_tgeo_tgeo", + "adisjoint_tgeo_geo", + "adisjoint_tgeo_tgeo", + "adwithin_tgeo_geo", + "adwithin_tgeo_tgeo", + "aintersects_tgeo_geo", + "aintersects_tgeo_tgeo", + "atouches_tgeo_geo", + "atouches_tgeo_tgeo", + "atouches_tpoint_geo", + "econtains_geo_tgeo", + "econtains_tgeo_geo", + "econtains_tgeo_tgeo", + "ecovers_geo_tgeo", + "ecovers_tgeo_geo", + "ecovers_tgeo_tgeo", + "edisjoint_tgeo_geo", + "edisjoint_tgeo_tgeo", + "edwithin_tgeo_geo", + "edwithin_tgeo_tgeo", + "eintersects_tgeo_geo", + "eintersects_tgeo_tgeo", + "etouches_tgeo_geo", + "etouches_tgeo_tgeo", + "etouches_tpoint_geo", + "tcontains_geo_tgeo", + "tcontains_tgeo_geo", + "tcontains_tgeo_tgeo", + "tcovers_geo_tgeo", + "tcovers_tgeo_geo", + "tcovers_tgeo_tgeo", + "tdisjoint_geo_tgeo", + "tdisjoint_tgeo_geo", + "tdisjoint_tgeo_tgeo", + "tdwithin_geo_tgeo", + "tdwithin_tgeo_geo", + "tdwithin_tgeo_tgeo", + "tintersects_geo_tgeo", + "tintersects_tgeo_geo", + "tintersects_tgeo_tgeo", + "ttouches_geo_tgeo", + "ttouches_tgeo_geo", + "ttouches_tgeo_tgeo", + "tdistance_tgeo_geo", + "tdistance_tgeo_tgeo", + "nad_stbox_geo", + "nad_stbox_stbox", + "nad_tgeo_geo", + "nad_tgeo_stbox", + "nad_tgeo_tgeo", + "nai_tgeo_geo", + "nai_tgeo_tgeo", + "shortestline_tgeo_geo", + "shortestline_tgeo_tgeo", + "tpoint_tcentroid_finalfn", + "tpoint_tcentroid_transfn", + "tspatial_extent_transfn", + "stbox_get_space_tile", + "stbox_get_space_time_tile", + "stbox_get_time_tile", + "stbox_space_tiles", + "stbox_space_time_tiles", + "stbox_time_tiles", + "tgeo_space_split", + "tgeo_space_time_split", + "geo_cluster_kmeans", + "geo_cluster_dbscan", + "geo_cluster_intersecting", + "geo_cluster_within", "gsl_get_generation_rng", "gsl_get_aggregation_rng", - "proj_get_context", - "datum_floor", "datum_ceil", "datum_degrees", - "datum_radians", + "datum_float_round", + "datum_floor", "datum_hash", "datum_hash_extended", + "datum_radians", + "floatspan_round_set", "set_in", "set_out", "span_in", "span_out", "spanset_in", "spanset_out", - "set_cp", "set_make", "set_make_exp", "set_make_free", - "span_cp", "span_make", "span_set", - "spanset_cp", "spanset_make_exp", "spanset_make_free", - "dateset_tstzset", - "datespan_tstzspan", - "datespanset_tstzspanset", - "floatset_intset", - "floatspan_intspan", - "floatspanset_intspanset", - "intset_floatset", - "intspan_floatspan", - "intspanset_floatspanset", "set_span", "set_spanset", - "span_spanset", - "tstzset_dateset", - "tstzspan_datespan", - "tstzspanset_datespanset", "value_set_span", - "value_to_set", - "value_to_span", - "value_to_spanset", + "value_set", + "value_span", + "value_spanset", "numspan_width", "numspanset_width", "set_end_value", @@ -1704,11 +1820,6 @@ "spanset_sps", "spanset_upper", "datespan_set_tstzspan", - "floatset_deg", - "floatset_rad", - "floatset_rnd", - "floatspan_rnd", - "floatspanset_rnd", "floatspan_set_intspan", "intspan_set_floatspan", "numset_shift_scale", @@ -1717,18 +1828,12 @@ "set_compact", "span_expand", "spanset_compact", + "tbox_expand_value", "textcat_textset_text_int", "tstzspan_set_datespan", - "set_cmp_int", - "span_cmp_int", - "span_eq_int", - "spanset_cmp_int", - "spanset_eq_int", - "adj_span_span", "adjacent_span_value", "adjacent_spanset_value", "adjacent_value_spanset", - "cont_span_span", "contained_value_set", "contained_value_span", "contained_value_spanset", @@ -1736,14 +1841,12 @@ "contains_span_value", "contains_spanset_value", "ovadj_span_span", - "over_span_span", "left_set_value", "left_span_value", "left_spanset_value", "left_value_set", "left_value_span", "left_value_spanset", - "lf_span_span", "lfnadj_span_span", "overleft_set_value", "overleft_span_value", @@ -1757,9 +1860,6 @@ "overright_value_set", "overright_value_span", "overright_value_spanset", - "ovlf_span_span", - "ovri_span_span", - "ri_span_span", "right_value_set", "right_set_value", "right_value_span", @@ -1788,8 +1888,6 @@ "union_value_set", "union_value_span", "union_value_spanset", - "dist_set_set", - "dist_span_span", "distance_set_set", "distance_set_value", "distance_span_span", @@ -1802,137 +1900,77 @@ "value_union_transfn", "number_tstzspan_to_tbox", "number_timestamptz_to_tbox", - "stbox_cp", - "stbox_set", - "tbox_cp", "tbox_set", - "box3d_to_stbox", - "gbox_to_stbox", "float_set_tbox", - "gbox_set_stbox", - "geo_set_stbox", - "geoarr_set_stbox", "int_set_tbox", "number_set_tbox", - "number_to_tbox", + "number_tbox", "numset_set_tbox", "numspan_set_tbox", - "numspanset_set_tbox", - "spatialset_set_stbox", - "stbox_set_box3d", - "stbox_set_gbox", - "timestamptz_set_stbox", "timestamptz_set_tbox", - "tstzset_set_stbox", "tstzset_set_tbox", - "tstzspan_set_stbox", "tstzspan_set_tbox", - "tstzspanset_set_stbox", - "tstzspanset_set_tbox", "tbox_shift_scale_value", - "stbox_expand", "tbox_expand", - "inter_stbox_stbox", "inter_tbox_tbox", - "geoarr_as_text", - "tboolinst_as_mfjson", - "tboolinst_from_mfjson", "tboolinst_in", - "tboolseq_as_mfjson", - "tboolseq_from_mfjson", "tboolseq_in", - "tboolseqset_as_mfjson", - "tboolseqset_from_mfjson", "tboolseqset_in", "temporal_in", "temporal_out", "temparr_out", - "tfloatinst_as_mfjson", - "tfloatinst_from_mfjson", "tfloatinst_in", - "tfloatseq_as_mfjson", - "tfloatseq_from_mfjson", "tfloatseq_in", - "tfloatseqset_as_mfjson", - "tfloatseqset_from_mfjson", "tfloatseqset_in", - "tgeogpointinst_from_mfjson", - "tgeogpointinst_in", - "tgeogpointseq_from_mfjson", - "tgeogpointseq_in", - "tgeogpointseqset_from_mfjson", - "tgeogpointseqset_in", - "tgeompointinst_from_mfjson", - "tgeompointinst_in", - "tgeompointseq_from_mfjson", - "tgeompointseq_in", - "tgeompointseqset_from_mfjson", - "tgeompointseqset_in", - "tinstant_from_mfjson", "tinstant_in", "tinstant_out", - "tintinst_as_mfjson", - "tintinst_from_mfjson", "tintinst_in", - "tintseq_as_mfjson", - "tintseq_from_mfjson", "tintseq_in", - "tintseqset_as_mfjson", - "tintseqset_from_mfjson", "tintseqset_in", - "tpointarr_as_text", - "tpointinst_as_mfjson", - "tpointseq_as_mfjson", - "tpointseqset_as_mfjson", - "tsequence_from_mfjson", "tsequence_in", "tsequence_out", - "tsequenceset_from_mfjson", "tsequenceset_in", "tsequenceset_out", - "ttextinst_as_mfjson", - "ttextinst_from_mfjson", "ttextinst_in", - "ttextseq_as_mfjson", - "ttextseq_from_mfjson", "ttextseq_in", - "ttextseqset_as_mfjson", - "ttextseqset_from_mfjson", "ttextseqset_in", "temporal_from_mfjson", - "temporal_cp", "temporal_from_base_temp", "tinstant_copy", "tinstant_make", "tinstant_make_free", - "tpointseq_make_coords", "tsequence_copy", + "tsequence_from_base_temp", "tsequence_from_base_tstzset", "tsequence_from_base_tstzspan", "tsequence_make_exp", "tsequence_make_free", "tsequenceset_copy", "tseqsetarr_to_tseqset", + "tsequenceset_from_base_temp", "tsequenceset_from_base_tstzspanset", "tsequenceset_make_exp", "tsequenceset_make_free", "temporal_set_tstzspan", "tinstant_set_tstzspan", "tnumber_set_tbox", - "tnumber_span", "tnumberinst_set_tbox", "tnumberseq_set_tbox", "tnumberseqset_set_tbox", "tsequence_set_tstzspan", "tsequenceset_set_tstzspan", + "temporal_end_inst", "temporal_end_value", - "temporal_insts", + "temporal_inst_n", + "temporal_instants_p", "temporal_max_value", "temporal_mem_size", "temporal_min_value", - "temporal_seqs", + "temporal_sequences_p", "temporal_set_bbox", - "temporal_vals", + "temporal_start_inst", + "temporal_start_value", + "temporal_values_p", "temporal_value_n", "temporal_values", "tinstant_hash", @@ -1940,10 +1978,10 @@ "tinstant_set_bbox", "tinstant_time", "tinstant_timestamps", - "tinstant_val", + "tinstant_value_p", "tinstant_value", "tinstant_value_at_timestamptz", - "tinstant_vals", + "tinstant_values_p", "tnumber_set_span", "tnumberinst_valuespans", "tnumberseq_valuespans", @@ -1951,7 +1989,7 @@ "tsequence_duration", "tsequence_end_timestamptz", "tsequence_hash", - "tsequence_insts", + "tsequence_insts_p", "tsequence_max_inst", "tsequence_max_val", "tsequence_min_inst", @@ -1962,12 +2000,12 @@ "tsequence_time", "tsequence_timestamps", "tsequence_value_at_timestamptz", - "tsequence_vals", + "tsequence_values_p", "tsequenceset_duration", "tsequenceset_end_timestamptz", "tsequenceset_hash", "tsequenceset_inst_n", - "tsequenceset_insts", + "tsequenceset_insts_p", "tsequenceset_max_inst", "tsequenceset_max_val", "tsequenceset_min_inst", @@ -1975,14 +2013,14 @@ "tsequenceset_num_instants", "tsequenceset_num_timestamps", "tsequenceset_segments", - "tsequenceset_seqs", + "tsequenceset_sequences_p", "tsequenceset_start_timestamptz", "tsequenceset_time", "tsequenceset_timestamptz_n", "tsequenceset_timestamps", "tsequenceset_value_at_timestamptz", "tsequenceset_value_n", - "tsequenceset_vals", + "tsequenceset_values_p", "temporal_restart", "temporal_tsequence", "temporal_tsequenceset", @@ -2030,10 +2068,6 @@ "tsequenceset_insert", "tsequenceset_merge", "tsequenceset_merge_array", - "tspatial_set_stbox", - "tpointinst_set_stbox", - "tspatialseq_set_stbox", - "tspatialseqset_set_stbox", "tsequence_expand_bbox", "tsequence_set_bbox", "tsequenceset_expand_bbox", @@ -2061,16 +2095,6 @@ "tnumberinst_restrict_spanset", "tnumberseqset_restrict_span", "tnumberseqset_restrict_spanset", - "tnpoint_restrict_geom", - "tnpoint_restrict_stbox", - "tpoint_restrict_geom", - "tpoint_restrict_stbox", - "tpointinst_restrict_geom", - "tpointinst_restrict_stbox", - "tpointseq_restrict_geom", - "tpointseq_restrict_stbox", - "tpointseqset_restrict_geom", - "tpointseqset_restrict_stbox", "tsequence_at_timestamptz", "tsequence_restrict_tstzspan", "tsequence_restrict_tstzspanset", @@ -2111,8 +2135,6 @@ "ever_le_temporal_base", "ever_lt_base_temporal", "ever_lt_temporal_base", - "tfloatseq_derivative", - "tfloatseqset_derivative", "tnumberinst_abs", "tnumberseq_abs", "tnumberseq_angular_difference", @@ -2120,63 +2142,214 @@ "tnumberseqset_abs", "tnumberseqset_angular_difference", "tnumberseqset_delta_value", - "distance_tnumber_number", + "tdistance_tnumber_number", "nad_tbox_tbox", "nad_tnumber_number", "nad_tnumber_tbox", "nad_tnumber_tnumber", - "tpointinst_srid", - "tpointseq_trajectory", - "tpointseq_azimuth", - "tpointseq_cumulative_length", - "tpointseq_is_simple", - "tpointseq_length", - "tpointseq_speed", - "tpointseq_srid", - "tpointseq_stboxes", - "tpointseq_split_n_stboxes", - "tpointseqset_azimuth", - "tpointseqset_cumulative_length", - "tpointseqset_is_simple", - "tpointseqset_length", - "tpointseqset_speed", - "tpointseqset_srid", - "tpointseqset_stboxes", - "tpointseqset_split_n_stboxes", - "tpointseqset_trajectory", - "tpoint_get_coord", - "tgeompointinst_tgeogpointinst", - "tgeompointseq_tgeogpointseq", - "tgeompointseqset_tgeogpointseqset", - "tgeompoint_tgeogpoint", - "tgeompoint_tnpoint", - "tnpoint_tgeompoint", - "tpointinst_set_srid", - "tpointseq_make_simple", - "tpointseq_set_srid", - "tpointseqset_make_simple", - "tpointseqset_set_srid", "tnumberseq_integral", "tnumberseq_twavg", "tnumberseqset_integral", "tnumberseqset_twavg", - "tpointseq_twcentroid", - "tpointseqset_twcentroid", "temporal_compact", "tsequence_compact", "tsequenceset_compact", "skiplist_free", "temporal_app_tinst_transfn", "temporal_app_tseq_transfn", - "numspanset_spans", - "spanset_time_spans", - "spanset_value_spans", - "timespanset_spans", - "tnumber_value_spans", - "tnumber_value_boxes", - "tnumber_time_boxes", + "span_bins", + "spanset_bins", + "tnumber_value_bins", "tnumber_value_time_boxes", "tnumber_value_split", "tbox_get_value_time_tile", "tnumber_value_time_split", + "proj_get_context", + "datum_geo_round", + "point_round", + "stbox_set", + "gbox_set_stbox", + "geo_set_stbox", + "geoarr_set_stbox", + "spatial_set_stbox", + "spatialset_set_stbox", + "stbox_set_box3d", + "stbox_set_gbox", + "tstzset_set_stbox", + "tstzspan_set_stbox", + "tstzspanset_set_stbox", + "stbox_expand", + "inter_stbox_stbox", + "stbox_geo", + "tgeogpointinst_in", + "tgeogpointseq_in", + "tgeogpointseqset_in", + "tgeompointinst_in", + "tgeompointseq_in", + "tgeompointseqset_in", + "tgeographyinst_in", + "tgeographyseq_in", + "tgeographyseqset_in", + "tgeometryinst_in", + "tgeometryseq_in", + "tgeometryseqset_in", + "tspatial_set_stbox", + "tgeoinst_set_stbox", + "tspatialseq_set_stbox", + "tspatialseqset_set_stbox", + "tgeo_restrict_geom", + "tgeo_restrict_stbox", + "tgeoinst_restrict_geom", + "tgeoinst_restrict_stbox", + "tgeoseq_restrict_geom", + "tgeoseq_restrict_stbox", + "tgeoseqset_restrict_geom", + "tgeoseqset_restrict_stbox", + "spatial_srid", + "spatial_set_srid", + "tspatialinst_srid", + "tpointseq_azimuth", + "tpointseq_cumulative_length", + "tpointseq_is_simple", + "tpointseq_length", + "tpointseq_linear_trajectory", + "tgeoseq_stboxes", + "tgeoseq_split_n_stboxes", + "tpointseqset_azimuth", + "tpointseqset_cumulative_length", + "tpointseqset_is_simple", + "tpointseqset_length", + "tgeoseqset_stboxes", + "tgeoseqset_split_n_stboxes", + "tpoint_get_coord", + "tgeominst_tgeoginst", + "tgeomseq_tgeogseq", + "tgeomseqset_tgeogseqset", + "tgeom_tgeog", + "tgeo_tpoint", + "tspatialinst_set_srid", + "tpointseq_make_simple", + "tspatialseq_set_srid", + "tpointseqset_make_simple", + "tspatialseqset_set_srid", + "tpointseq_twcentroid", + "tpointseqset_twcentroid", + "npoint_as_ewkt", + "npoint_as_hexwkb", + "npoint_as_text", + "npoint_as_wkb", + "npoint_from_hexwkb", + "npoint_from_wkb", + "npoint_in", + "npoint_out", + "nsegment_in", + "nsegment_out", + "npoint_make", + "nsegment_make", + "geompoint_to_npoint", + "geom_to_nsegment", + "npoint_to_geompoint", + "npoint_to_nsegment", + "npoint_to_stbox", + "nsegment_to_geom", + "nsegment_to_stbox", + "npoint_hash", + "npoint_hash_extended", + "npoint_position", + "npoint_route", + "nsegment_end_position", + "nsegment_route", + "nsegment_start_position", + "route_exists", + "route_geom", + "route_length", + "npoint_round", + "nsegment_round", + "get_srid_ways", + "npoint_srid", + "nsegment_srid", + "npoint_timestamptz_to_stbox", + "npoint_tstzspan_to_stbox", + "npoint_cmp", + "npoint_eq", + "npoint_ge", + "npoint_gt", + "npoint_le", + "npoint_lt", + "npoint_ne", + "npoint_same", + "nsegment_cmp", + "nsegment_eq", + "nsegment_ge", + "nsegment_gt", + "nsegment_le", + "nsegment_lt", + "nsegment_ne", + "npointset_in", + "npointset_out", + "npointset_make", + "npoint_to_set", + "npointset_end_value", + "npointset_routes", + "npointset_start_value", + "npointset_value_n", + "npointset_values", + "contained_npoint_set", + "contains_set_npoint", + "intersection_npoint_set", + "intersection_set_npoint", + "minus_npoint_set", + "minus_set_npoint", + "npoint_union_transfn", + "union_npoint_set", + "union_set_npoint", + "tnpoint_in", + "tnpoint_out", + "tnpointinst_make", + "tgeompoint_to_tnpoint", + "tnpoint_to_tgeompoint", + "tnpoint_cumulative_length", + "tnpoint_length", + "tnpoint_positions", + "tnpoint_route", + "tnpoint_routes", + "tnpoint_speed", + "tnpoint_trajectory", + "tnpoint_twcentroid", + "tnpoint_at_geom", + "tnpoint_at_npoint", + "tnpoint_at_npointset", + "tnpoint_at_stbox", + "tnpoint_minus_geom", + "tnpoint_minus_npoint", + "tnpoint_minus_npointset", + "tnpoint_minus_stbox", + "tdistance_tnpoint_npoint", + "tdistance_tnpoint_point", + "tdistance_tnpoint_tnpoint", + "nad_tnpoint_geo", + "nad_tnpoint_npoint", + "nad_tnpoint_stbox", + "nad_tnpoint_tnpoint", + "nai_tnpoint_geo", + "nai_tnpoint_npoint", + "nai_tnpoint_tnpoint", + "shortestline_tnpoint_geo", + "shortestline_tnpoint_npoint", + "shortestline_tnpoint_tnpoint", + "tnpoint_tcentroid_transfn", + "always_eq_npoint_tnpoint", + "always_eq_tnpoint_npoint", + "always_eq_tnpoint_tnpoint", + "always_ne_npoint_tnpoint", + "always_ne_tnpoint_npoint", + "always_ne_tnpoint_tnpoint", + "ever_eq_npoint_tnpoint", + "ever_eq_tnpoint_npoint", + "ever_eq_tnpoint_tnpoint", + "ever_ne_npoint_tnpoint", + "ever_ne_tnpoint_npoint", + "ever_ne_tnpoint_tnpoint", + "teq_tnpoint_npoint", + "tne_tnpoint_npoint", ] diff --git a/pymeos_cffi/enums.py b/pymeos_cffi/enums.py index 18b2903..94c8d65 100644 --- a/pymeos_cffi/enums.py +++ b/pymeos_cffi/enums.py @@ -1,6 +1,7 @@ -from _meos_cffi import lib as _lib from enum import IntEnum +from _meos_cffi import lib as _lib + class MeosType(IntEnum): T_UNKNOWN = _lib.T_UNKNOWN diff --git a/pymeos_cffi/errors.py b/pymeos_cffi/errors.py index b003c6d..1830472 100644 --- a/pymeos_cffi/errors.py +++ b/pymeos_cffi/errors.py @@ -1,5 +1,7 @@ import logging + from _meos_cffi import lib as _lib + from .enums import ErrorLevel logger = logging.getLogger("pymeos_cffi") diff --git a/pymeos_cffi/functions.py b/pymeos_cffi/functions.py index 9294971..b5d46eb 100644 --- a/pymeos_cffi/functions.py +++ b/pymeos_cffi/functions.py @@ -1,23 +1,23 @@ import logging import os - -from datetime import datetime, timedelta, date -from typing import Any, Tuple, Optional, List +from datetime import date, datetime, timedelta +from typing import Annotated, Any import _meos_cffi import shapely.geometry as spg from dateutil.parser import parse -from shapely import wkt, get_srid, set_srid +from shapely import get_srid, set_srid, wkt from shapely.geometry.base import BaseGeometry +from .enums import InterpolationType from .errors import report_meos_exception _ffi = _meos_cffi.ffi _lib = _meos_cffi.lib -_error: Optional[int] = None -_error_level: Optional[int] = None -_error_message: Optional[str] = None +_error: int | None = None +_error_level: int | None = None +_error_message: str | None = None logger = logging.getLogger("pymeos_cffi") @@ -40,34 +40,30 @@ def py_error_handler(error_level, error_code, error_msg): _error = error_code _error_level = error_level _error_message = _ffi.string(error_msg).decode("utf-8") - logger.debug( - f"ERROR Handler called: Level: {_error} | Code: {_error_level} | Message: {_error_message}" - ) + logger.debug(f"ERROR Handler called: Level: {_error} | Code: {_error_level} | Message: {_error_message}") -def create_pointer(object: "Any", type: str) -> "Any *": +def create_pointer(object: "Any", type: str) -> Annotated[_ffi.CData, "Any *"]: return _ffi.new(f"{type} *", object) -def get_address(value: "Any") -> "Any *": +def get_address(value: "Any") -> Annotated[_ffi.CData, "Any *"]: return _ffi.addressof(value) -def datetime_to_timestamptz(dt: datetime) -> "TimestampTz": - return _lib.pg_timestamptz_in( - dt.strftime("%Y-%m-%d %H:%M:%S%z").encode("utf-8"), -1 - ) +def datetime_to_timestamptz(dt: datetime) -> Annotated[int, "TimestampTz"]: + return _lib.pg_timestamptz_in(dt.strftime("%Y-%m-%d %H:%M:%S%z").encode("utf-8"), -1) -def timestamptz_to_datetime(ts: "TimestampTz") -> datetime: +def timestamptz_to_datetime(ts: Annotated[int, "TimestampTz"]) -> datetime: return parse(pg_timestamptz_out(ts)) -def date_to_date_adt(dt: date) -> "DateADT": +def date_to_date_adt(dt: date) -> Annotated[int, "DateADT"]: return _lib.pg_date_in(dt.strftime("%Y-%m-%d").encode("utf-8")) -def date_adt_to_date(ts: "DateADT") -> date: +def date_adt_to_date(ts: Annotated[int, "DateADT"]) -> date: return parse(pg_date_out(ts)).date() @@ -83,74 +79,70 @@ def interval_to_timedelta(interval: Any) -> timedelta: return timedelta(days=interval.day, microseconds=interval.time) -def geo_to_gserialized(geom: BaseGeometry, geodetic: bool) -> "GSERIALIZED *": +def geo_to_gserialized(geom: BaseGeometry, geodetic: bool) -> Annotated[_ffi.CData, "GSERIALIZED *"]: if geodetic: return geography_to_gserialized(geom) else: return geometry_to_gserialized(geom) -def geometry_to_gserialized(geom: BaseGeometry) -> "GSERIALIZED *": +def geometry_to_gserialized(geom: BaseGeometry) -> Annotated[_ffi.CData, "GSERIALIZED *"]: text = wkt.dumps(geom) if get_srid(geom) > 0: text = f"SRID={get_srid(geom)};{text}" - gs = pgis_geometry_in(text, -1) + gs = geom_in(text, -1) return gs -def geography_to_gserialized(geom: BaseGeometry) -> "GSERIALIZED *": +def geography_to_gserialized(geom: BaseGeometry) -> Annotated[_ffi.CData, "GSERIALIZED *"]: text = wkt.dumps(geom) if get_srid(geom) > 0: text = f"SRID={get_srid(geom)};{text}" - gs = pgis_geography_in(text, -1) + gs = geog_in(text, -1) return gs -def gserialized_to_shapely_point( - geom: "const GSERIALIZED *", precision: int = 15 -) -> spg.Point: +def gserialized_to_shapely_point(geom: "const GSERIALIZED *", precision: int = 15) -> spg.Point: text = geo_as_text(geom, precision) geometry = wkt.loads(text) - srid = geo_get_srid(geom) + srid = geo_srid(geom) if srid > 0: geometry = set_srid(geometry, srid) return geometry -def gserialized_to_shapely_geometry( - geom: "const GSERIALIZED *", precision: int = 15 -) -> BaseGeometry: +def gserialized_to_shapely_geometry(geom: "const GSERIALIZED *", precision: int = 15) -> BaseGeometry: text = geo_as_text(geom, precision) geometry = wkt.loads(text) - srid = geo_get_srid(geom) + srid = geo_srid(geom) if srid > 0: geometry = set_srid(geometry, srid) return geometry -def as_tinstant(temporal: "Temporal *") -> "TInstant *": +def as_tinstant(temporal: Annotated[_ffi.CData, "Temporal *"]) -> Annotated[_ffi.CData, "TInstant *"]: return _ffi.cast("TInstant *", temporal) -def as_tsequence(temporal: "Temporal *") -> "TSequence *": +def as_tsequence(temporal: Annotated[_ffi.CData, "Temporal *"]) -> Annotated[_ffi.CData, "TSequence *"]: return _ffi.cast("TSequence *", temporal) -def as_tsequenceset(temporal: "Temporal *") -> "TSequenceSet *": +def as_tsequenceset(temporal: Annotated[_ffi.CData, "Temporal *"]) -> Annotated[_ffi.CData, "TSequenceSet *"]: return _ffi.cast("TSequenceSet *", temporal) # ----------------------------------------------------------------------------- # ----------------------End of manually-defined functions---------------------- # ----------------------------------------------------------------------------- -def date_in(string: str) -> "DateADT": +def date_in(string: str) -> Annotated[int, "DateADT"]: string_converted = string.encode("utf-8") result = _lib.date_in(string_converted) _check_error() return result if result != _ffi.NULL else None -def date_out(d: "DateADT") -> str: +def date_out(d: int) -> Annotated[str, "char *"]: d_converted = _ffi.cast("DateADT", d) result = _lib.date_out(d_converted) _check_error() @@ -158,7 +150,9 @@ def date_out(d: "DateADT") -> str: return result if result != _ffi.NULL else None -def interval_cmp(interv1: "const Interval *", interv2: "const Interval *") -> "int": +def interval_cmp( + interv1: Annotated[_ffi.CData, "const Interval *"], interv2: Annotated[_ffi.CData, "const Interval *"] +) -> Annotated[int, "int"]: interv1_converted = _ffi.cast("const Interval *", interv1) interv2_converted = _ffi.cast("const Interval *", interv2) result = _lib.interval_cmp(interv1_converted, interv2_converted) @@ -166,7 +160,7 @@ def interval_cmp(interv1: "const Interval *", interv2: "const Interval *") -> "i return result if result != _ffi.NULL else None -def interval_in(string: str, typmod: int) -> "Interval *": +def interval_in(string: str, typmod: int) -> Annotated[_ffi.CData, "Interval *"]: string_converted = string.encode("utf-8") typmod_converted = _ffi.cast("int32", typmod) result = _lib.interval_in(string_converted, typmod_converted) @@ -174,29 +168,7 @@ def interval_in(string: str, typmod: int) -> "Interval *": return result if result != _ffi.NULL else None -def interval_make( - years: int, months: int, weeks: int, days: int, hours: int, mins: int, secs: float -) -> "Interval *": - years_converted = _ffi.cast("int32", years) - months_converted = _ffi.cast("int32", months) - weeks_converted = _ffi.cast("int32", weeks) - days_converted = _ffi.cast("int32", days) - hours_converted = _ffi.cast("int32", hours) - mins_converted = _ffi.cast("int32", mins) - result = _lib.interval_make( - years_converted, - months_converted, - weeks_converted, - days_converted, - hours_converted, - mins_converted, - secs, - ) - _check_error() - return result if result != _ffi.NULL else None - - -def interval_out(interv: "const Interval *") -> str: +def interval_out(interv: Annotated[_ffi.CData, "const Interval *"]) -> Annotated[str, "char *"]: interv_converted = _ffi.cast("const Interval *", interv) result = _lib.interval_out(interv_converted) _check_error() @@ -204,7 +176,7 @@ def interval_out(interv: "const Interval *") -> str: return result if result != _ffi.NULL else None -def time_in(string: str, typmod: int) -> "TimeADT": +def time_in(string: str, typmod: int) -> Annotated[_ffi.CData, "TimeADT"]: string_converted = string.encode("utf-8") typmod_converted = _ffi.cast("int32", typmod) result = _lib.time_in(string_converted, typmod_converted) @@ -212,7 +184,7 @@ def time_in(string: str, typmod: int) -> "TimeADT": return result if result != _ffi.NULL else None -def time_out(t: "TimeADT") -> str: +def time_out(t: Annotated[_ffi.CData, "TimeADT"]) -> Annotated[str, "char *"]: t_converted = _ffi.cast("TimeADT", t) result = _lib.time_out(t_converted) _check_error() @@ -220,7 +192,7 @@ def time_out(t: "TimeADT") -> str: return result if result != _ffi.NULL else None -def timestamp_in(string: str, typmod: int) -> "Timestamp": +def timestamp_in(string: str, typmod: int) -> Annotated[int, "Timestamp"]: string_converted = string.encode("utf-8") typmod_converted = _ffi.cast("int32", typmod) result = _lib.timestamp_in(string_converted, typmod_converted) @@ -228,7 +200,7 @@ def timestamp_in(string: str, typmod: int) -> "Timestamp": return result if result != _ffi.NULL else None -def timestamp_out(t: int) -> str: +def timestamp_out(t: int) -> Annotated[str, "char *"]: t_converted = _ffi.cast("Timestamp", t) result = _lib.timestamp_out(t_converted) _check_error() @@ -236,7 +208,7 @@ def timestamp_out(t: int) -> str: return result if result != _ffi.NULL else None -def timestamptz_in(string: str, typmod: int) -> "TimestampTz": +def timestamptz_in(string: str, typmod: int) -> Annotated[int, "TimestampTz"]: string_converted = string.encode("utf-8") typmod_converted = _ffi.cast("int32", typmod) result = _lib.timestamptz_in(string_converted, typmod_converted) @@ -244,7 +216,7 @@ def timestamptz_in(string: str, typmod: int) -> "TimestampTz": return result if result != _ffi.NULL else None -def timestamptz_out(t: int) -> str: +def timestamptz_out(t: int) -> Annotated[str, "char *"]: t_converted = _ffi.cast("TimestampTz", t) result = _lib.timestamptz_out(t_converted) _check_error() @@ -252,38 +224,41 @@ def timestamptz_out(t: int) -> str: return result if result != _ffi.NULL else None -def geo_get_srid(g: "const GSERIALIZED *") -> "int32": - g_converted = _ffi.cast("const GSERIALIZED *", g) - result = _lib.geo_get_srid(g_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def meos_errno() -> "int": +def meos_errno() -> Annotated[int, "int"]: result = _lib.meos_errno() _check_error() return result if result != _ffi.NULL else None -def meos_errno_set(err: int) -> "int": +def meos_errno_set(err: int) -> Annotated[int, "int"]: result = _lib.meos_errno_set(err) _check_error() return result if result != _ffi.NULL else None -def meos_errno_restore(err: int) -> "int": +def meos_errno_restore(err: int) -> Annotated[int, "int"]: result = _lib.meos_errno_restore(err) _check_error() return result if result != _ffi.NULL else None -def meos_errno_reset() -> "int": +def meos_errno_reset() -> Annotated[int, "int"]: result = _lib.meos_errno_reset() _check_error() return result if result != _ffi.NULL else None -def meos_set_datestyle(newval: str, extra: "void *") -> "bool": +def meos_finalize_projsrs() -> Annotated[None, "void"]: + _lib.meos_finalize_projsrs() + _check_error() + + +def meos_finalize_ways() -> Annotated[None, "void"]: + _lib.meos_finalize_ways() + _check_error() + + +def meos_set_datestyle(newval: str, extra: Annotated[_ffi.CData, "void *"]) -> Annotated[bool, "bool"]: newval_converted = newval.encode("utf-8") extra_converted = _ffi.cast("void *", extra) result = _lib.meos_set_datestyle(newval_converted, extra_converted) @@ -291,7 +266,7 @@ def meos_set_datestyle(newval: str, extra: "void *") -> "bool": return result if result != _ffi.NULL else None -def meos_set_intervalstyle(newval: str, extra: "Optional[int]") -> "bool": +def meos_set_intervalstyle(newval: str, extra: int | None) -> Annotated[bool, "bool"]: newval_converted = newval.encode("utf-8") extra_converted = extra if extra is not None else _ffi.NULL result = _lib.meos_set_intervalstyle(newval_converted, extra_converted) @@ -299,21 +274,27 @@ def meos_set_intervalstyle(newval: str, extra: "Optional[int]") -> "bool": return result if result != _ffi.NULL else None -def meos_get_datestyle() -> str: +def meos_get_datestyle() -> Annotated[str, "char *"]: result = _lib.meos_get_datestyle() _check_error() result = _ffi.string(result).decode("utf-8") return result if result != _ffi.NULL else None -def meos_get_intervalstyle() -> str: +def meos_get_intervalstyle() -> Annotated[str, "char *"]: result = _lib.meos_get_intervalstyle() _check_error() result = _ffi.string(result).decode("utf-8") return result if result != _ffi.NULL else None -def meos_initialize(tz_str: "Optional[str]") -> None: +def meos_set_spatial_ref_sys_csv(path: Annotated[_ffi.CData, "const char*"]) -> Annotated[None, "void"]: + path_converted = _ffi.cast("const char*", path) + _lib.meos_set_spatial_ref_sys_csv(path_converted) + _check_error() + + +def meos_initialize(tz_str: str | None) -> None: if "PROJ_DATA" not in os.environ and "PROJ_LIB" not in os.environ: proj_dir = os.path.join(os.path.dirname(__file__), "proj_data") if os.path.exists(proj_dir): @@ -322,17 +303,24 @@ def meos_initialize(tz_str: "Optional[str]") -> None: os.environ["PROJ_LIB"] = proj_dir _lib.meos_initialize() - tz_str_converted = tz_str.encode("utf-8") if tz_str is not None else _ffi.NULL - _lib.meos_initialize_timezone(tz_str_converted) + + # Check if local spatial ref system csv exists (meaning wheel installation). If it does, use it. + wheel_path = os.path.join(os.path.dirname(__file__), "meos_data", "spatial_ref_sys.csv") + if os.path.exists(wheel_path): + _lib.meos_set_spatial_ref_sys_csv(wheel_path.encode("utf-8")) + + # Timezone is already initialized by meos_initialize, so we only need to set it if tz_str is provided + if tz_str is not None: + _lib.meos_initialize_timezone(tz_str.encode("utf-8")) _lib.meos_initialize_error_handler(_lib.py_error_handler) -def meos_finalize() -> None: +def meos_finalize() -> Annotated[None, "void"]: _lib.meos_finalize() _check_error() -def add_date_int(d: "DateADT", days: int) -> "DateADT": +def add_date_int(d: int, days: int) -> Annotated[int, "DateADT"]: d_converted = _ffi.cast("DateADT", d) days_converted = _ffi.cast("int32", days) result = _lib.add_date_int(d_converted, days_converted) @@ -341,8 +329,8 @@ def add_date_int(d: "DateADT", days: int) -> "DateADT": def add_interval_interval( - interv1: "const Interval *", interv2: "const Interval *" -) -> "Interval *": + interv1: Annotated[_ffi.CData, "const Interval *"], interv2: Annotated[_ffi.CData, "const Interval *"] +) -> Annotated[_ffi.CData, "Interval *"]: interv1_converted = _ffi.cast("const Interval *", interv1) interv2_converted = _ffi.cast("const Interval *", interv2) result = _lib.add_interval_interval(interv1_converted, interv2_converted) @@ -350,7 +338,9 @@ def add_interval_interval( return result if result != _ffi.NULL else None -def add_timestamptz_interval(t: int, interv: "const Interval *") -> "TimestampTz": +def add_timestamptz_interval( + t: int, interv: Annotated[_ffi.CData, "const Interval *"] +) -> Annotated[int, "TimestampTz"]: t_converted = _ffi.cast("TimestampTz", t) interv_converted = _ffi.cast("const Interval *", interv) result = _lib.add_timestamptz_interval(t_converted, interv_converted) @@ -358,14 +348,14 @@ def add_timestamptz_interval(t: int, interv: "const Interval *") -> "TimestampTz return result if result != _ffi.NULL else None -def bool_in(string: str) -> "bool": +def bool_in(string: str) -> Annotated[bool, "bool"]: string_converted = string.encode("utf-8") result = _lib.bool_in(string_converted) _check_error() return result if result != _ffi.NULL else None -def bool_out(b: bool) -> str: +def bool_out(b: bool) -> Annotated[str, "char *"]: result = _lib.bool_out(b) _check_error() result = _ffi.string(result).decode("utf-8") @@ -378,21 +368,61 @@ def cstring2text(cstring: str) -> "text *": return result -def date_to_timestamp(dateVal: "DateADT") -> "Timestamp": +def date_to_timestamp(dateVal: int) -> Annotated[int, "Timestamp"]: dateVal_converted = _ffi.cast("DateADT", dateVal) result = _lib.date_to_timestamp(dateVal_converted) _check_error() return result if result != _ffi.NULL else None -def date_to_timestamptz(d: "DateADT") -> "TimestampTz": +def date_to_timestamptz(d: int) -> Annotated[int, "TimestampTz"]: d_converted = _ffi.cast("DateADT", d) result = _lib.date_to_timestamptz(d_converted) _check_error() return result if result != _ffi.NULL else None -def minus_date_date(d1: "DateADT", d2: "DateADT") -> "Interval *": +def float_exp(d: float) -> Annotated[float, "double"]: + result = _lib.float_exp(d) + _check_error() + return result if result != _ffi.NULL else None + + +def float_ln(d: float) -> Annotated[float, "double"]: + result = _lib.float_ln(d) + _check_error() + return result if result != _ffi.NULL else None + + +def float_log10(d: float) -> Annotated[float, "double"]: + result = _lib.float_log10(d) + _check_error() + return result if result != _ffi.NULL else None + + +def float_round(d: float, maxdd: int) -> Annotated[float, "double"]: + result = _lib.float_round(d, maxdd) + _check_error() + return result if result != _ffi.NULL else None + + +def interval_make( + years: int, months: int, weeks: int, days: int, hours: int, mins: int, secs: float +) -> Annotated[_ffi.CData, "Interval *"]: + years_converted = _ffi.cast("int32", years) + months_converted = _ffi.cast("int32", months) + weeks_converted = _ffi.cast("int32", weeks) + days_converted = _ffi.cast("int32", days) + hours_converted = _ffi.cast("int32", hours) + mins_converted = _ffi.cast("int32", mins) + result = _lib.interval_make( + years_converted, months_converted, weeks_converted, days_converted, hours_converted, mins_converted, secs + ) + _check_error() + return result if result != _ffi.NULL else None + + +def minus_date_date(d1: int, d2: int) -> Annotated[_ffi.CData, "Interval *"]: d1_converted = _ffi.cast("DateADT", d1) d2_converted = _ffi.cast("DateADT", d2) result = _lib.minus_date_date(d1_converted, d2_converted) @@ -400,7 +430,7 @@ def minus_date_date(d1: "DateADT", d2: "DateADT") -> "Interval *": return result if result != _ffi.NULL else None -def minus_date_int(d: "DateADT", days: int) -> "DateADT": +def minus_date_int(d: int, days: int) -> Annotated[int, "DateADT"]: d_converted = _ffi.cast("DateADT", d) days_converted = _ffi.cast("int32", days) result = _lib.minus_date_int(d_converted, days_converted) @@ -408,7 +438,9 @@ def minus_date_int(d: "DateADT", days: int) -> "DateADT": return result if result != _ffi.NULL else None -def minus_timestamptz_interval(t: int, interv: "const Interval *") -> "TimestampTz": +def minus_timestamptz_interval( + t: int, interv: Annotated[_ffi.CData, "const Interval *"] +) -> Annotated[int, "TimestampTz"]: t_converted = _ffi.cast("TimestampTz", t) interv_converted = _ffi.cast("const Interval *", interv) result = _lib.minus_timestamptz_interval(t_converted, interv_converted) @@ -416,7 +448,7 @@ def minus_timestamptz_interval(t: int, interv: "const Interval *") -> "Timestamp return result if result != _ffi.NULL else None -def minus_timestamptz_timestamptz(t1: int, t2: int) -> "Interval *": +def minus_timestamptz_timestamptz(t1: int, t2: int) -> Annotated[_ffi.CData, "Interval *"]: t1_converted = _ffi.cast("TimestampTz", t1) t2_converted = _ffi.cast("TimestampTz", t2) result = _lib.minus_timestamptz_timestamptz(t1_converted, t2_converted) @@ -424,10 +456,85 @@ def minus_timestamptz_timestamptz(t1: int, t2: int) -> "Interval *": return result if result != _ffi.NULL else None -def mult_interval_double(interv: "const Interval *", factor: float) -> "Interval *": +def mul_interval_double( + interv: Annotated[_ffi.CData, "const Interval *"], factor: float +) -> Annotated[_ffi.CData, "Interval *"]: + interv_converted = _ffi.cast("const Interval *", interv) + result = _lib.mul_interval_double(interv_converted, factor) + _check_error() + return result if result != _ffi.NULL else None + + +def pg_date_in(string: str) -> Annotated[int, "DateADT"]: + string_converted = string.encode("utf-8") + result = _lib.pg_date_in(string_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def pg_date_out(d: int) -> Annotated[str, "char *"]: + d_converted = _ffi.cast("DateADT", d) + result = _lib.pg_date_out(d_converted) + _check_error() + result = _ffi.string(result).decode("utf-8") + return result if result != _ffi.NULL else None + + +def pg_interval_cmp( + interv1: Annotated[_ffi.CData, "const Interval *"], interv2: Annotated[_ffi.CData, "const Interval *"] +) -> Annotated[int, "int"]: + interv1_converted = _ffi.cast("const Interval *", interv1) + interv2_converted = _ffi.cast("const Interval *", interv2) + result = _lib.pg_interval_cmp(interv1_converted, interv2_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def pg_interval_in(string: str, typmod: int) -> Annotated[_ffi.CData, "Interval *"]: + string_converted = string.encode("utf-8") + typmod_converted = _ffi.cast("int32", typmod) + result = _lib.pg_interval_in(string_converted, typmod_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def pg_interval_out(interv: Annotated[_ffi.CData, "const Interval *"]) -> Annotated[str, "char *"]: interv_converted = _ffi.cast("const Interval *", interv) - result = _lib.mult_interval_double(interv_converted, factor) + result = _lib.pg_interval_out(interv_converted) + _check_error() + result = _ffi.string(result).decode("utf-8") + return result if result != _ffi.NULL else None + + +def pg_timestamp_in(string: str, typmod: int) -> Annotated[int, "Timestamp"]: + string_converted = string.encode("utf-8") + typmod_converted = _ffi.cast("int32", typmod) + result = _lib.pg_timestamp_in(string_converted, typmod_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def pg_timestamp_out(t: int) -> Annotated[str, "char *"]: + t_converted = _ffi.cast("Timestamp", t) + result = _lib.pg_timestamp_out(t_converted) + _check_error() + result = _ffi.string(result).decode("utf-8") + return result if result != _ffi.NULL else None + + +def pg_timestamptz_in(string: str, typmod: int) -> Annotated[int, "TimestampTz"]: + string_converted = string.encode("utf-8") + typmod_converted = _ffi.cast("int32", typmod) + result = _lib.pg_timestamptz_in(string_converted, typmod_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def pg_timestamptz_out(t: int) -> Annotated[str, "char *"]: + t_converted = _ffi.cast("TimestampTz", t) + result = _lib.pg_timestamptz_out(t_converted) _check_error() + result = _ffi.string(result).decode("utf-8") return result if result != _ffi.NULL else None @@ -437,7 +544,7 @@ def text2cstring(textptr: "text *") -> str: return result -def text_cmp(txt1: str, txt2: str) -> "int": +def text_cmp(txt1: str, txt2: str) -> Annotated[int, "int"]: txt1_converted = cstring2text(txt1) txt2_converted = cstring2text(txt2) result = _lib.text_cmp(txt1_converted, txt2_converted) @@ -445,7 +552,7 @@ def text_cmp(txt1: str, txt2: str) -> "int": return result if result != _ffi.NULL else None -def text_copy(txt: str) -> str: +def text_copy(txt: str) -> Annotated[str, "text *"]: txt_converted = cstring2text(txt) result = _lib.text_copy(txt_converted) _check_error() @@ -453,7 +560,7 @@ def text_copy(txt: str) -> str: return result if result != _ffi.NULL else None -def text_initcap(txt: str) -> str: +def text_initcap(txt: str) -> Annotated[str, "text *"]: txt_converted = cstring2text(txt) result = _lib.text_initcap(txt_converted) _check_error() @@ -461,7 +568,7 @@ def text_initcap(txt: str) -> str: return result if result != _ffi.NULL else None -def text_lower(txt: str) -> str: +def text_lower(txt: str) -> Annotated[str, "text *"]: txt_converted = cstring2text(txt) result = _lib.text_lower(txt_converted) _check_error() @@ -469,7 +576,7 @@ def text_lower(txt: str) -> str: return result if result != _ffi.NULL else None -def text_out(txt: str) -> str: +def text_out(txt: str) -> Annotated[str, "char *"]: txt_converted = cstring2text(txt) result = _lib.text_out(txt_converted) _check_error() @@ -477,7 +584,7 @@ def text_out(txt: str) -> str: return result if result != _ffi.NULL else None -def text_upper(txt: str) -> str: +def text_upper(txt: str) -> Annotated[str, "text *"]: txt_converted = cstring2text(txt) result = _lib.text_upper(txt_converted) _check_error() @@ -485,7 +592,7 @@ def text_upper(txt: str) -> str: return result if result != _ffi.NULL else None -def textcat_text_text(txt1: str, txt2: str) -> str: +def textcat_text_text(txt1: str, txt2: str) -> Annotated[str, "text *"]: txt1_converted = cstring2text(txt1) txt2_converted = cstring2text(txt2) result = _lib.textcat_text_text(txt1_converted, txt2_converted) @@ -494,28 +601,36 @@ def textcat_text_text(txt1: str, txt2: str) -> str: return result if result != _ffi.NULL else None -def timestamp_to_date(t: int) -> "DateADT": +def timestamptz_shift(t: int, interv: Annotated[_ffi.CData, "const Interval *"]) -> Annotated[int, "TimestampTz"]: + t_converted = _ffi.cast("TimestampTz", t) + interv_converted = _ffi.cast("const Interval *", interv) + result = _lib.timestamptz_shift(t_converted, interv_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def timestamp_to_date(t: int) -> Annotated[int, "DateADT"]: t_converted = _ffi.cast("Timestamp", t) result = _lib.timestamp_to_date(t_converted) _check_error() return result if result != _ffi.NULL else None -def timestamptz_to_date(t: int) -> "DateADT": +def timestamptz_to_date(t: int) -> Annotated[int, "DateADT"]: t_converted = _ffi.cast("TimestampTz", t) result = _lib.timestamptz_to_date(t_converted) _check_error() return result if result != _ffi.NULL else None -def bigintset_in(string: str) -> "Set *": +def bigintset_in(string: str) -> Annotated[_ffi.CData, "Set *"]: string_converted = string.encode("utf-8") result = _lib.bigintset_in(string_converted) _check_error() return result if result != _ffi.NULL else None -def bigintset_out(set: "const Set *") -> str: +def bigintset_out(set: Annotated[_ffi.CData, "const Set *"]) -> Annotated[str, "char *"]: set_converted = _ffi.cast("const Set *", set) result = _lib.bigintset_out(set_converted) _check_error() @@ -523,14 +638,14 @@ def bigintset_out(set: "const Set *") -> str: return result if result != _ffi.NULL else None -def bigintspan_in(string: str) -> "Span *": +def bigintspan_in(string: str) -> Annotated[_ffi.CData, "Span *"]: string_converted = string.encode("utf-8") result = _lib.bigintspan_in(string_converted) _check_error() return result if result != _ffi.NULL else None -def bigintspan_out(s: "const Span *") -> str: +def bigintspan_out(s: Annotated[_ffi.CData, "const Span *"]) -> Annotated[str, "char *"]: s_converted = _ffi.cast("const Span *", s) result = _lib.bigintspan_out(s_converted) _check_error() @@ -538,14 +653,14 @@ def bigintspan_out(s: "const Span *") -> str: return result if result != _ffi.NULL else None -def bigintspanset_in(string: str) -> "SpanSet *": +def bigintspanset_in(string: str) -> Annotated[_ffi.CData, "SpanSet *"]: string_converted = string.encode("utf-8") result = _lib.bigintspanset_in(string_converted) _check_error() return result if result != _ffi.NULL else None -def bigintspanset_out(ss: "const SpanSet *") -> str: +def bigintspanset_out(ss: Annotated[_ffi.CData, "const SpanSet *"]) -> Annotated[str, "char *"]: ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.bigintspanset_out(ss_converted) _check_error() @@ -553,14 +668,14 @@ def bigintspanset_out(ss: "const SpanSet *") -> str: return result if result != _ffi.NULL else None -def dateset_in(string: str) -> "Set *": +def dateset_in(string: str) -> Annotated[_ffi.CData, "Set *"]: string_converted = string.encode("utf-8") result = _lib.dateset_in(string_converted) _check_error() return result if result != _ffi.NULL else None -def dateset_out(s: "const Set *") -> str: +def dateset_out(s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[str, "char *"]: s_converted = _ffi.cast("const Set *", s) result = _lib.dateset_out(s_converted) _check_error() @@ -568,14 +683,14 @@ def dateset_out(s: "const Set *") -> str: return result if result != _ffi.NULL else None -def datespan_in(string: str) -> "Span *": +def datespan_in(string: str) -> Annotated[_ffi.CData, "Span *"]: string_converted = string.encode("utf-8") result = _lib.datespan_in(string_converted) _check_error() return result if result != _ffi.NULL else None -def datespan_out(s: "const Span *") -> str: +def datespan_out(s: Annotated[_ffi.CData, "const Span *"]) -> Annotated[str, "char *"]: s_converted = _ffi.cast("const Span *", s) result = _lib.datespan_out(s_converted) _check_error() @@ -583,14 +698,14 @@ def datespan_out(s: "const Span *") -> str: return result if result != _ffi.NULL else None -def datespanset_in(string: str) -> "SpanSet *": +def datespanset_in(string: str) -> Annotated[_ffi.CData, "SpanSet *"]: string_converted = string.encode("utf-8") result = _lib.datespanset_in(string_converted) _check_error() return result if result != _ffi.NULL else None -def datespanset_out(ss: "const SpanSet *") -> str: +def datespanset_out(ss: Annotated[_ffi.CData, "const SpanSet *"]) -> Annotated[str, "char *"]: ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.datespanset_out(ss_converted) _check_error() @@ -598,14 +713,14 @@ def datespanset_out(ss: "const SpanSet *") -> str: return result if result != _ffi.NULL else None -def floatset_in(string: str) -> "Set *": +def floatset_in(string: str) -> Annotated[_ffi.CData, "Set *"]: string_converted = string.encode("utf-8") result = _lib.floatset_in(string_converted) _check_error() return result if result != _ffi.NULL else None -def floatset_out(set: "const Set *", maxdd: int) -> str: +def floatset_out(set: Annotated[_ffi.CData, "const Set *"], maxdd: int) -> Annotated[str, "char *"]: set_converted = _ffi.cast("const Set *", set) result = _lib.floatset_out(set_converted, maxdd) _check_error() @@ -613,14 +728,14 @@ def floatset_out(set: "const Set *", maxdd: int) -> str: return result if result != _ffi.NULL else None -def floatspan_in(string: str) -> "Span *": +def floatspan_in(string: str) -> Annotated[_ffi.CData, "Span *"]: string_converted = string.encode("utf-8") result = _lib.floatspan_in(string_converted) _check_error() return result if result != _ffi.NULL else None -def floatspan_out(s: "const Span *", maxdd: int) -> str: +def floatspan_out(s: Annotated[_ffi.CData, "const Span *"], maxdd: int) -> Annotated[str, "char *"]: s_converted = _ffi.cast("const Span *", s) result = _lib.floatspan_out(s_converted, maxdd) _check_error() @@ -628,14 +743,14 @@ def floatspan_out(s: "const Span *", maxdd: int) -> str: return result if result != _ffi.NULL else None -def floatspanset_in(string: str) -> "SpanSet *": +def floatspanset_in(string: str) -> Annotated[_ffi.CData, "SpanSet *"]: string_converted = string.encode("utf-8") result = _lib.floatspanset_in(string_converted) _check_error() return result if result != _ffi.NULL else None -def floatspanset_out(ss: "const SpanSet *", maxdd: int) -> str: +def floatspanset_out(ss: Annotated[_ffi.CData, "const SpanSet *"], maxdd: int) -> Annotated[str, "char *"]: ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.floatspanset_out(ss_converted, maxdd) _check_error() @@ -643,52 +758,14 @@ def floatspanset_out(ss: "const SpanSet *", maxdd: int) -> str: return result if result != _ffi.NULL else None -def geogset_in(string: str) -> "Set *": - string_converted = string.encode("utf-8") - result = _lib.geogset_in(string_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def geomset_in(string: str) -> "Set *": - string_converted = string.encode("utf-8") - result = _lib.geomset_in(string_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def geoset_as_ewkt(set: "const Set *", maxdd: int) -> str: - set_converted = _ffi.cast("const Set *", set) - result = _lib.geoset_as_ewkt(set_converted, maxdd) - _check_error() - result = _ffi.string(result).decode("utf-8") - return result if result != _ffi.NULL else None - - -def geoset_as_text(set: "const Set *", maxdd: int) -> str: - set_converted = _ffi.cast("const Set *", set) - result = _lib.geoset_as_text(set_converted, maxdd) - _check_error() - result = _ffi.string(result).decode("utf-8") - return result if result != _ffi.NULL else None - - -def geoset_out(set: "const Set *", maxdd: int) -> str: - set_converted = _ffi.cast("const Set *", set) - result = _lib.geoset_out(set_converted, maxdd) - _check_error() - result = _ffi.string(result).decode("utf-8") - return result if result != _ffi.NULL else None - - -def intset_in(string: str) -> "Set *": +def intset_in(string: str) -> Annotated[_ffi.CData, "Set *"]: string_converted = string.encode("utf-8") result = _lib.intset_in(string_converted) _check_error() return result if result != _ffi.NULL else None -def intset_out(set: "const Set *") -> str: +def intset_out(set: Annotated[_ffi.CData, "const Set *"]) -> Annotated[str, "char *"]: set_converted = _ffi.cast("const Set *", set) result = _lib.intset_out(set_converted) _check_error() @@ -696,14 +773,14 @@ def intset_out(set: "const Set *") -> str: return result if result != _ffi.NULL else None -def intspan_in(string: str) -> "Span *": +def intspan_in(string: str) -> Annotated[_ffi.CData, "Span *"]: string_converted = string.encode("utf-8") result = _lib.intspan_in(string_converted) _check_error() return result if result != _ffi.NULL else None -def intspan_out(s: "const Span *") -> str: +def intspan_out(s: Annotated[_ffi.CData, "const Span *"]) -> Annotated[str, "char *"]: s_converted = _ffi.cast("const Span *", s) result = _lib.intspan_out(s_converted) _check_error() @@ -711,14 +788,14 @@ def intspan_out(s: "const Span *") -> str: return result if result != _ffi.NULL else None -def intspanset_in(string: str) -> "SpanSet *": +def intspanset_in(string: str) -> Annotated[_ffi.CData, "SpanSet *"]: string_converted = string.encode("utf-8") result = _lib.intspanset_in(string_converted) _check_error() return result if result != _ffi.NULL else None -def intspanset_out(ss: "const SpanSet *") -> str: +def intspanset_out(ss: Annotated[_ffi.CData, "const SpanSet *"]) -> Annotated[str, "char *"]: ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.intspanset_out(ss_converted) _check_error() @@ -726,7 +803,9 @@ def intspanset_out(ss: "const SpanSet *") -> str: return result if result != _ffi.NULL else None -def set_as_hexwkb(s: "const Set *", variant: int) -> "Tuple[str, 'size_t *']": +def set_as_hexwkb( + s: Annotated[_ffi.CData, "const Set *"], variant: int +) -> tuple[Annotated[str, "char *"], Annotated[_ffi.CData, "size_t *"]]: s_converted = _ffi.cast("const Set *", s) variant_converted = _ffi.cast("uint8_t", variant) size_out = _ffi.new("size_t *") @@ -736,19 +815,19 @@ def set_as_hexwkb(s: "const Set *", variant: int) -> "Tuple[str, 'size_t *']": return result if result != _ffi.NULL else None, size_out[0] -def set_as_wkb(s: "const Set *", variant: int) -> bytes: +def set_as_wkb( + s: Annotated[_ffi.CData, "const Set *"], variant: int +) -> tuple[Annotated[_ffi.CData, "uint8_t *"], Annotated[_ffi.CData, "size_t *"]]: s_converted = _ffi.cast("const Set *", s) variant_converted = _ffi.cast("uint8_t", variant) size_out = _ffi.new("size_t *") result = _lib.set_as_wkb(s_converted, variant_converted, size_out) _check_error() - result_converted = ( - bytes(result[i] for i in range(size_out[0])) if result != _ffi.NULL else None - ) + result_converted = bytes(result[i] for i in range(size_out[0])) if result != _ffi.NULL else None return result_converted -def set_from_hexwkb(hexwkb: str) -> "Set *": +def set_from_hexwkb(hexwkb: str) -> Annotated[_ffi.CData, "Set *"]: hexwkb_converted = hexwkb.encode("utf-8") result = _lib.set_from_hexwkb(hexwkb_converted) _check_error() @@ -761,7 +840,9 @@ def set_from_wkb(wkb: bytes) -> "Set *": return result if result != _ffi.NULL else None -def span_as_hexwkb(s: "const Span *", variant: int) -> "Tuple[str, 'size_t *']": +def span_as_hexwkb( + s: Annotated[_ffi.CData, "const Span *"], variant: int +) -> tuple[Annotated[str, "char *"], Annotated[_ffi.CData, "size_t *"]]: s_converted = _ffi.cast("const Span *", s) variant_converted = _ffi.cast("uint8_t", variant) size_out = _ffi.new("size_t *") @@ -771,19 +852,19 @@ def span_as_hexwkb(s: "const Span *", variant: int) -> "Tuple[str, 'size_t *']": return result if result != _ffi.NULL else None, size_out[0] -def span_as_wkb(s: "const Span *", variant: int) -> bytes: +def span_as_wkb( + s: Annotated[_ffi.CData, "const Span *"], variant: int +) -> tuple[Annotated[_ffi.CData, "uint8_t *"], Annotated[_ffi.CData, "size_t *"]]: s_converted = _ffi.cast("const Span *", s) variant_converted = _ffi.cast("uint8_t", variant) size_out = _ffi.new("size_t *") result = _lib.span_as_wkb(s_converted, variant_converted, size_out) _check_error() - result_converted = ( - bytes(result[i] for i in range(size_out[0])) if result != _ffi.NULL else None - ) + result_converted = bytes(result[i] for i in range(size_out[0])) if result != _ffi.NULL else None return result_converted -def span_from_hexwkb(hexwkb: str) -> "Span *": +def span_from_hexwkb(hexwkb: str) -> Annotated[_ffi.CData, "Span *"]: hexwkb_converted = hexwkb.encode("utf-8") result = _lib.span_from_hexwkb(hexwkb_converted) _check_error() @@ -796,7 +877,9 @@ def span_from_wkb(wkb: bytes) -> "Span *": return result if result != _ffi.NULL else None -def spanset_as_hexwkb(ss: "const SpanSet *", variant: int) -> "Tuple[str, 'size_t *']": +def spanset_as_hexwkb( + ss: Annotated[_ffi.CData, "const SpanSet *"], variant: int +) -> tuple[Annotated[str, "char *"], Annotated[_ffi.CData, "size_t *"]]: ss_converted = _ffi.cast("const SpanSet *", ss) variant_converted = _ffi.cast("uint8_t", variant) size_out = _ffi.new("size_t *") @@ -806,19 +889,19 @@ def spanset_as_hexwkb(ss: "const SpanSet *", variant: int) -> "Tuple[str, 'size_ return result if result != _ffi.NULL else None, size_out[0] -def spanset_as_wkb(ss: "const SpanSet *", variant: int) -> bytes: +def spanset_as_wkb( + ss: Annotated[_ffi.CData, "const SpanSet *"], variant: int +) -> tuple[Annotated[_ffi.CData, "uint8_t *"], Annotated[_ffi.CData, "size_t *"]]: ss_converted = _ffi.cast("const SpanSet *", ss) variant_converted = _ffi.cast("uint8_t", variant) size_out = _ffi.new("size_t *") result = _lib.spanset_as_wkb(ss_converted, variant_converted, size_out) _check_error() - result_converted = ( - bytes(result[i] for i in range(size_out[0])) if result != _ffi.NULL else None - ) + result_converted = bytes(result[i] for i in range(size_out[0])) if result != _ffi.NULL else None return result_converted -def spanset_from_hexwkb(hexwkb: str) -> "SpanSet *": +def spanset_from_hexwkb(hexwkb: str) -> Annotated[_ffi.CData, "SpanSet *"]: hexwkb_converted = hexwkb.encode("utf-8") result = _lib.spanset_from_hexwkb(hexwkb_converted) _check_error() @@ -831,14 +914,14 @@ def spanset_from_wkb(wkb: bytes) -> "SpanSet *": return result if result != _ffi.NULL else None -def textset_in(string: str) -> "Set *": +def textset_in(string: str) -> Annotated[_ffi.CData, "Set *"]: string_converted = string.encode("utf-8") result = _lib.textset_in(string_converted) _check_error() return result if result != _ffi.NULL else None -def textset_out(set: "const Set *") -> str: +def textset_out(set: Annotated[_ffi.CData, "const Set *"]) -> Annotated[str, "char *"]: set_converted = _ffi.cast("const Set *", set) result = _lib.textset_out(set_converted) _check_error() @@ -846,14 +929,14 @@ def textset_out(set: "const Set *") -> str: return result if result != _ffi.NULL else None -def tstzset_in(string: str) -> "Set *": +def tstzset_in(string: str) -> Annotated[_ffi.CData, "Set *"]: string_converted = string.encode("utf-8") result = _lib.tstzset_in(string_converted) _check_error() return result if result != _ffi.NULL else None -def tstzset_out(set: "const Set *") -> str: +def tstzset_out(set: Annotated[_ffi.CData, "const Set *"]) -> Annotated[str, "char *"]: set_converted = _ffi.cast("const Set *", set) result = _lib.tstzset_out(set_converted) _check_error() @@ -861,14 +944,14 @@ def tstzset_out(set: "const Set *") -> str: return result if result != _ffi.NULL else None -def tstzspan_in(string: str) -> "Span *": +def tstzspan_in(string: str) -> Annotated[_ffi.CData, "Span *"]: string_converted = string.encode("utf-8") result = _lib.tstzspan_in(string_converted) _check_error() return result if result != _ffi.NULL else None -def tstzspan_out(s: "const Span *") -> str: +def tstzspan_out(s: Annotated[_ffi.CData, "const Span *"]) -> Annotated[str, "char *"]: s_converted = _ffi.cast("const Span *", s) result = _lib.tstzspan_out(s_converted) _check_error() @@ -876,14 +959,14 @@ def tstzspan_out(s: "const Span *") -> str: return result if result != _ffi.NULL else None -def tstzspanset_in(string: str) -> "SpanSet *": +def tstzspanset_in(string: str) -> Annotated[_ffi.CData, "SpanSet *"]: string_converted = string.encode("utf-8") result = _lib.tstzspanset_in(string_converted) _check_error() return result if result != _ffi.NULL else None -def tstzspanset_out(ss: "const SpanSet *") -> str: +def tstzspanset_out(ss: Annotated[_ffi.CData, "const SpanSet *"]) -> Annotated[str, "char *"]: ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.tstzspanset_out(ss_converted) _check_error() @@ -891,35 +974,29 @@ def tstzspanset_out(ss: "const SpanSet *") -> str: return result if result != _ffi.NULL else None -def bigintset_make(values: "List[const int64]") -> "Set *": +def bigintset_make(values: "list[const int64]") -> Annotated[_ffi.CData, "Set *"]: values_converted = _ffi.new("const int64 []", values) result = _lib.bigintset_make(values_converted, len(values)) _check_error() return result if result != _ffi.NULL else None -def bigintspan_make( - lower: int, upper: int, lower_inc: bool, upper_inc: bool -) -> "Span *": +def bigintspan_make(lower: int, upper: int, lower_inc: bool, upper_inc: bool) -> Annotated[_ffi.CData, "Span *"]: lower_converted = _ffi.cast("int64", lower) upper_converted = _ffi.cast("int64", upper) - result = _lib.bigintspan_make( - lower_converted, upper_converted, lower_inc, upper_inc - ) + result = _lib.bigintspan_make(lower_converted, upper_converted, lower_inc, upper_inc) _check_error() return result if result != _ffi.NULL else None -def dateset_make(values: "List[const DateADT]") -> "Set *": +def dateset_make(values: "list[const DateADT]") -> Annotated[_ffi.CData, "Set *"]: values_converted = _ffi.new("const DateADT []", values) result = _lib.dateset_make(values_converted, len(values)) _check_error() return result if result != _ffi.NULL else None -def datespan_make( - lower: "DateADT", upper: "DateADT", lower_inc: bool, upper_inc: bool -) -> "Span *": +def datespan_make(lower: int, upper: int, lower_inc: bool, upper_inc: bool) -> Annotated[_ffi.CData, "Span *"]: lower_converted = _ffi.cast("DateADT", lower) upper_converted = _ffi.cast("DateADT", upper) result = _lib.datespan_make(lower_converted, upper_converted, lower_inc, upper_inc) @@ -927,84 +1004,75 @@ def datespan_make( return result if result != _ffi.NULL else None -def floatset_make(values: "List[const double]") -> "Set *": +def floatset_make(values: "list[const double]") -> Annotated[_ffi.CData, "Set *"]: values_converted = _ffi.new("const double []", values) result = _lib.floatset_make(values_converted, len(values)) _check_error() return result if result != _ffi.NULL else None -def floatspan_make( - lower: float, upper: float, lower_inc: bool, upper_inc: bool -) -> "Span *": +def floatspan_make(lower: float, upper: float, lower_inc: bool, upper_inc: bool) -> Annotated[_ffi.CData, "Span *"]: result = _lib.floatspan_make(lower, upper, lower_inc, upper_inc) _check_error() return result if result != _ffi.NULL else None -def geoset_make(values: "const GSERIALIZED **") -> "Set *": - values_converted = [_ffi.cast("const GSERIALIZED *", x) for x in values] - result = _lib.geoset_make(values_converted, len(values)) - _check_error() - return result if result != _ffi.NULL else None - - -def intset_make(values: "List[const int]") -> "Set *": +def intset_make(values: "list[const int]") -> Annotated[_ffi.CData, "Set *"]: values_converted = _ffi.new("const int []", values) result = _lib.intset_make(values_converted, len(values)) _check_error() return result if result != _ffi.NULL else None -def intspan_make(lower: int, upper: int, lower_inc: bool, upper_inc: bool) -> "Span *": +def intspan_make(lower: int, upper: int, lower_inc: bool, upper_inc: bool) -> Annotated[_ffi.CData, "Span *"]: result = _lib.intspan_make(lower, upper, lower_inc, upper_inc) _check_error() return result if result != _ffi.NULL else None -def set_copy(s: "const Set *") -> "Set *": +def set_copy(s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[_ffi.CData, "Set *"]: s_converted = _ffi.cast("const Set *", s) result = _lib.set_copy(s_converted) _check_error() return result if result != _ffi.NULL else None -def span_copy(s: "const Span *") -> "Span *": +def span_copy(s: Annotated[_ffi.CData, "const Span *"]) -> Annotated[_ffi.CData, "Span *"]: s_converted = _ffi.cast("const Span *", s) result = _lib.span_copy(s_converted) _check_error() return result if result != _ffi.NULL else None -def spanset_copy(ss: "const SpanSet *") -> "SpanSet *": +def spanset_copy(ss: Annotated[_ffi.CData, "const SpanSet *"]) -> Annotated[_ffi.CData, "SpanSet *"]: ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.spanset_copy(ss_converted) _check_error() return result if result != _ffi.NULL else None -def spanset_make(spans: "List[Span *]", normalize: bool, order: bool) -> "SpanSet *": +def spanset_make(spans: list[Annotated[_ffi.CData, "Span *"]]) -> Annotated[_ffi.CData, "SpanSet *"]: spans_converted = _ffi.new("Span []", spans) - result = _lib.spanset_make(spans_converted, len(spans), normalize, order) + result = _lib.spanset_make(spans_converted, len(spans)) _check_error() return result if result != _ffi.NULL else None -def textset_make(values: List[str]) -> "Set *": +def textset_make(values: list[str]) -> Annotated[_ffi.CData, "Set *"]: values_converted = [cstring2text(x) for x in values] result = _lib.textset_make(values_converted, len(values)) _check_error() return result if result != _ffi.NULL else None -def tstzset_make(values: List[int]) -> "Set *": +def tstzset_make(values: list[int]) -> Annotated[_ffi.CData, "Set *"]: values_converted = [_ffi.cast("const TimestampTz", x) for x in values] result = _lib.tstzset_make(values_converted, len(values)) _check_error() return result if result != _ffi.NULL else None -def tstzspan_make(lower: int, upper: int, lower_inc: bool, upper_inc: bool) -> "Span *": +def tstzspan_make(lower: int, upper: int, lower_inc: bool, upper_inc: bool) -> Annotated[_ffi.CData, "Span *"]: lower_converted = _ffi.cast("TimestampTz", lower) upper_converted = _ffi.cast("TimestampTz", upper) result = _lib.tstzspan_make(lower_converted, upper_converted, lower_inc, upper_inc) @@ -1012,230 +1080,230 @@ def tstzspan_make(lower: int, upper: int, lower_inc: bool, upper_inc: bool) -> " return result if result != _ffi.NULL else None -def bigint_to_set(i: int) -> "Set *": +def bigint_to_set(i: int) -> Annotated[_ffi.CData, "Set *"]: i_converted = _ffi.cast("int64", i) result = _lib.bigint_to_set(i_converted) _check_error() return result if result != _ffi.NULL else None -def bigint_to_span(i: int) -> "Span *": +def bigint_to_span(i: int) -> Annotated[_ffi.CData, "Span *"]: result = _lib.bigint_to_span(i) _check_error() return result if result != _ffi.NULL else None -def bigint_to_spanset(i: int) -> "SpanSet *": +def bigint_to_spanset(i: int) -> Annotated[_ffi.CData, "SpanSet *"]: result = _lib.bigint_to_spanset(i) _check_error() return result if result != _ffi.NULL else None -def date_to_set(d: "DateADT") -> "Set *": +def date_to_set(d: int) -> Annotated[_ffi.CData, "Set *"]: d_converted = _ffi.cast("DateADT", d) result = _lib.date_to_set(d_converted) _check_error() return result if result != _ffi.NULL else None -def date_to_span(d: "DateADT") -> "Span *": +def date_to_span(d: int) -> Annotated[_ffi.CData, "Span *"]: d_converted = _ffi.cast("DateADT", d) result = _lib.date_to_span(d_converted) _check_error() return result if result != _ffi.NULL else None -def date_to_spanset(d: "DateADT") -> "SpanSet *": +def date_to_spanset(d: int) -> Annotated[_ffi.CData, "SpanSet *"]: d_converted = _ffi.cast("DateADT", d) result = _lib.date_to_spanset(d_converted) _check_error() return result if result != _ffi.NULL else None -def dateset_to_tstzset(s: "const Set *") -> "Set *": +def dateset_to_tstzset(s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[_ffi.CData, "Set *"]: s_converted = _ffi.cast("const Set *", s) result = _lib.dateset_to_tstzset(s_converted) _check_error() return result if result != _ffi.NULL else None -def datespan_to_tstzspan(s: "const Span *") -> "Span *": +def datespan_to_tstzspan(s: Annotated[_ffi.CData, "const Span *"]) -> Annotated[_ffi.CData, "Span *"]: s_converted = _ffi.cast("const Span *", s) result = _lib.datespan_to_tstzspan(s_converted) _check_error() return result if result != _ffi.NULL else None -def datespanset_to_tstzspanset(ss: "const SpanSet *") -> "SpanSet *": +def datespanset_to_tstzspanset(ss: Annotated[_ffi.CData, "const SpanSet *"]) -> Annotated[_ffi.CData, "SpanSet *"]: ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.datespanset_to_tstzspanset(ss_converted) _check_error() return result if result != _ffi.NULL else None -def float_to_set(d: float) -> "Set *": +def float_to_set(d: float) -> Annotated[_ffi.CData, "Set *"]: result = _lib.float_to_set(d) _check_error() return result if result != _ffi.NULL else None -def float_to_span(d: float) -> "Span *": +def float_to_span(d: float) -> Annotated[_ffi.CData, "Span *"]: result = _lib.float_to_span(d) _check_error() return result if result != _ffi.NULL else None -def float_to_spanset(d: float) -> "SpanSet *": +def float_to_spanset(d: float) -> Annotated[_ffi.CData, "SpanSet *"]: result = _lib.float_to_spanset(d) _check_error() return result if result != _ffi.NULL else None -def floatset_to_intset(s: "const Set *") -> "Set *": +def floatset_to_intset(s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[_ffi.CData, "Set *"]: s_converted = _ffi.cast("const Set *", s) result = _lib.floatset_to_intset(s_converted) _check_error() return result if result != _ffi.NULL else None -def floatspan_to_intspan(s: "const Span *") -> "Span *": +def floatspan_to_intspan(s: Annotated[_ffi.CData, "const Span *"]) -> Annotated[_ffi.CData, "Span *"]: s_converted = _ffi.cast("const Span *", s) result = _lib.floatspan_to_intspan(s_converted) _check_error() return result if result != _ffi.NULL else None -def floatspanset_to_intspanset(ss: "const SpanSet *") -> "SpanSet *": +def floatspanset_to_intspanset(ss: Annotated[_ffi.CData, "const SpanSet *"]) -> Annotated[_ffi.CData, "SpanSet *"]: ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.floatspanset_to_intspanset(ss_converted) _check_error() return result if result != _ffi.NULL else None -def geo_to_set(gs: "GSERIALIZED *") -> "Set *": - gs_converted = _ffi.cast("GSERIALIZED *", gs) - result = _lib.geo_to_set(gs_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def int_to_set(i: int) -> "Set *": +def int_to_set(i: int) -> Annotated[_ffi.CData, "Set *"]: result = _lib.int_to_set(i) _check_error() return result if result != _ffi.NULL else None -def int_to_span(i: int) -> "Span *": +def int_to_span(i: int) -> Annotated[_ffi.CData, "Span *"]: result = _lib.int_to_span(i) _check_error() return result if result != _ffi.NULL else None -def int_to_spanset(i: int) -> "SpanSet *": +def int_to_spanset(i: int) -> Annotated[_ffi.CData, "SpanSet *"]: result = _lib.int_to_spanset(i) _check_error() return result if result != _ffi.NULL else None -def intset_to_floatset(s: "const Set *") -> "Set *": +def intset_to_floatset(s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[_ffi.CData, "Set *"]: s_converted = _ffi.cast("const Set *", s) result = _lib.intset_to_floatset(s_converted) _check_error() return result if result != _ffi.NULL else None -def intspan_to_floatspan(s: "const Span *") -> "Span *": +def intspan_to_floatspan(s: Annotated[_ffi.CData, "const Span *"]) -> Annotated[_ffi.CData, "Span *"]: s_converted = _ffi.cast("const Span *", s) result = _lib.intspan_to_floatspan(s_converted) _check_error() return result if result != _ffi.NULL else None -def intspanset_to_floatspanset(ss: "const SpanSet *") -> "SpanSet *": +def intspanset_to_floatspanset(ss: Annotated[_ffi.CData, "const SpanSet *"]) -> Annotated[_ffi.CData, "SpanSet *"]: ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.intspanset_to_floatspanset(ss_converted) _check_error() return result if result != _ffi.NULL else None -def set_to_spanset(s: "const Set *") -> "SpanSet *": +def set_to_span(s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[_ffi.CData, "Span *"]: + s_converted = _ffi.cast("const Set *", s) + result = _lib.set_to_span(s_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def set_to_spanset(s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[_ffi.CData, "SpanSet *"]: s_converted = _ffi.cast("const Set *", s) result = _lib.set_to_spanset(s_converted) _check_error() return result if result != _ffi.NULL else None -def span_to_spanset(s: "const Span *") -> "SpanSet *": +def span_to_spanset(s: Annotated[_ffi.CData, "const Span *"]) -> Annotated[_ffi.CData, "SpanSet *"]: s_converted = _ffi.cast("const Span *", s) result = _lib.span_to_spanset(s_converted) _check_error() return result if result != _ffi.NULL else None -def text_to_set(txt: str) -> "Set *": +def text_to_set(txt: str) -> Annotated[_ffi.CData, "Set *"]: txt_converted = cstring2text(txt) result = _lib.text_to_set(txt_converted) _check_error() return result if result != _ffi.NULL else None -def timestamptz_to_set(t: int) -> "Set *": +def timestamptz_to_set(t: int) -> Annotated[_ffi.CData, "Set *"]: t_converted = _ffi.cast("TimestampTz", t) result = _lib.timestamptz_to_set(t_converted) _check_error() return result if result != _ffi.NULL else None -def timestamptz_to_span(t: int) -> "Span *": +def timestamptz_to_span(t: int) -> Annotated[_ffi.CData, "Span *"]: t_converted = _ffi.cast("TimestampTz", t) result = _lib.timestamptz_to_span(t_converted) _check_error() return result if result != _ffi.NULL else None -def timestamptz_to_spanset(t: int) -> "SpanSet *": +def timestamptz_to_spanset(t: int) -> Annotated[_ffi.CData, "SpanSet *"]: t_converted = _ffi.cast("TimestampTz", t) result = _lib.timestamptz_to_spanset(t_converted) _check_error() return result if result != _ffi.NULL else None -def tstzset_to_dateset(s: "const Set *") -> "Set *": +def tstzset_to_dateset(s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[_ffi.CData, "Set *"]: s_converted = _ffi.cast("const Set *", s) result = _lib.tstzset_to_dateset(s_converted) _check_error() return result if result != _ffi.NULL else None -def tstzspan_to_datespan(s: "const Span *") -> "Span *": +def tstzspan_to_datespan(s: Annotated[_ffi.CData, "const Span *"]) -> Annotated[_ffi.CData, "Span *"]: s_converted = _ffi.cast("const Span *", s) result = _lib.tstzspan_to_datespan(s_converted) _check_error() return result if result != _ffi.NULL else None -def tstzspanset_to_datespanset(ss: "const SpanSet *") -> "SpanSet *": +def tstzspanset_to_datespanset(ss: Annotated[_ffi.CData, "const SpanSet *"]) -> Annotated[_ffi.CData, "SpanSet *"]: ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.tstzspanset_to_datespanset(ss_converted) _check_error() return result if result != _ffi.NULL else None -def bigintset_end_value(s: "const Set *") -> "int64": +def bigintset_end_value(s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[int, "int64"]: s_converted = _ffi.cast("const Set *", s) result = _lib.bigintset_end_value(s_converted) _check_error() return result if result != _ffi.NULL else None -def bigintset_start_value(s: "const Set *") -> "int64": +def bigintset_start_value(s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[int, "int64"]: s_converted = _ffi.cast("const Set *", s) result = _lib.bigintset_start_value(s_converted) _check_error() return result if result != _ffi.NULL else None -def bigintset_value_n(s: "const Set *", n: int) -> "int64": +def bigintset_value_n(s: Annotated[_ffi.CData, "const Set *"], n: int) -> Annotated[_ffi.CData, "int64"]: s_converted = _ffi.cast("const Set *", s) out_result = _ffi.new("int64 *") result = _lib.bigintset_value_n(s_converted, n, out_result) @@ -1245,70 +1313,70 @@ def bigintset_value_n(s: "const Set *", n: int) -> "int64": return None -def bigintset_values(s: "const Set *") -> "int64 *": +def bigintset_values(s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[_ffi.CData, "int64 *"]: s_converted = _ffi.cast("const Set *", s) result = _lib.bigintset_values(s_converted) _check_error() return result if result != _ffi.NULL else None -def bigintspan_lower(s: "const Span *") -> "int64": +def bigintspan_lower(s: Annotated[_ffi.CData, "const Span *"]) -> Annotated[int, "int64"]: s_converted = _ffi.cast("const Span *", s) result = _lib.bigintspan_lower(s_converted) _check_error() return result if result != _ffi.NULL else None -def bigintspan_upper(s: "const Span *") -> "int64": +def bigintspan_upper(s: Annotated[_ffi.CData, "const Span *"]) -> Annotated[int, "int64"]: s_converted = _ffi.cast("const Span *", s) result = _lib.bigintspan_upper(s_converted) _check_error() return result if result != _ffi.NULL else None -def bigintspan_width(s: "const Span *") -> "int64": +def bigintspan_width(s: Annotated[_ffi.CData, "const Span *"]) -> Annotated[int, "int64"]: s_converted = _ffi.cast("const Span *", s) result = _lib.bigintspan_width(s_converted) _check_error() return result if result != _ffi.NULL else None -def bigintspanset_lower(ss: "const SpanSet *") -> "int64": +def bigintspanset_lower(ss: Annotated[_ffi.CData, "const SpanSet *"]) -> Annotated[int, "int64"]: ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.bigintspanset_lower(ss_converted) _check_error() return result if result != _ffi.NULL else None -def bigintspanset_upper(ss: "const SpanSet *") -> "int64": +def bigintspanset_upper(ss: Annotated[_ffi.CData, "const SpanSet *"]) -> Annotated[int, "int64"]: ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.bigintspanset_upper(ss_converted) _check_error() return result if result != _ffi.NULL else None -def bigintspanset_width(ss: "const SpanSet *", boundspan: bool) -> "int64": +def bigintspanset_width(ss: Annotated[_ffi.CData, "const SpanSet *"], boundspan: bool) -> Annotated[int, "int64"]: ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.bigintspanset_width(ss_converted, boundspan) _check_error() return result if result != _ffi.NULL else None -def dateset_end_value(s: "const Set *") -> "DateADT": +def dateset_end_value(s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[int, "DateADT"]: s_converted = _ffi.cast("const Set *", s) result = _lib.dateset_end_value(s_converted) _check_error() return result if result != _ffi.NULL else None -def dateset_start_value(s: "const Set *") -> "DateADT": +def dateset_start_value(s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[int, "DateADT"]: s_converted = _ffi.cast("const Set *", s) result = _lib.dateset_start_value(s_converted) _check_error() return result if result != _ffi.NULL else None -def dateset_value_n(s: "const Set *", n: int) -> "DateADT *": +def dateset_value_n(s: Annotated[_ffi.CData, "const Set *"], n: int) -> Annotated[_ffi.CData, "DateADT *"]: s_converted = _ffi.cast("const Set *", s) out_result = _ffi.new("DateADT *") result = _lib.dateset_value_n(s_converted, n, out_result) @@ -1318,35 +1386,35 @@ def dateset_value_n(s: "const Set *", n: int) -> "DateADT *": return None -def dateset_values(s: "const Set *") -> "DateADT *": +def dateset_values(s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[_ffi.CData, "DateADT *"]: s_converted = _ffi.cast("const Set *", s) result = _lib.dateset_values(s_converted) _check_error() return result if result != _ffi.NULL else None -def datespan_duration(s: "const Span *") -> "Interval *": +def datespan_duration(s: Annotated[_ffi.CData, "const Span *"]) -> Annotated[_ffi.CData, "Interval *"]: s_converted = _ffi.cast("const Span *", s) result = _lib.datespan_duration(s_converted) _check_error() return result if result != _ffi.NULL else None -def datespan_lower(s: "const Span *") -> "DateADT": +def datespan_lower(s: Annotated[_ffi.CData, "const Span *"]) -> Annotated[int, "DateADT"]: s_converted = _ffi.cast("const Span *", s) result = _lib.datespan_lower(s_converted) _check_error() return result if result != _ffi.NULL else None -def datespan_upper(s: "const Span *") -> "DateADT": +def datespan_upper(s: Annotated[_ffi.CData, "const Span *"]) -> Annotated[int, "DateADT"]: s_converted = _ffi.cast("const Span *", s) result = _lib.datespan_upper(s_converted) _check_error() return result if result != _ffi.NULL else None -def datespanset_date_n(ss: "const SpanSet *", n: int) -> "DateADT *": +def datespanset_date_n(ss: Annotated[_ffi.CData, "const SpanSet *"], n: int) -> Annotated[_ffi.CData, "DateADT *"]: ss_converted = _ffi.cast("const SpanSet *", ss) out_result = _ffi.new("DateADT *") result = _lib.datespanset_date_n(ss_converted, n, out_result) @@ -1356,56 +1424,58 @@ def datespanset_date_n(ss: "const SpanSet *", n: int) -> "DateADT *": return None -def datespanset_dates(ss: "const SpanSet *") -> "Set *": +def datespanset_dates(ss: Annotated[_ffi.CData, "const SpanSet *"]) -> Annotated[_ffi.CData, "Set *"]: ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.datespanset_dates(ss_converted) _check_error() return result if result != _ffi.NULL else None -def datespanset_duration(ss: "const SpanSet *", boundspan: bool) -> "Interval *": +def datespanset_duration( + ss: Annotated[_ffi.CData, "const SpanSet *"], boundspan: bool +) -> Annotated[_ffi.CData, "Interval *"]: ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.datespanset_duration(ss_converted, boundspan) _check_error() return result if result != _ffi.NULL else None -def datespanset_end_date(ss: "const SpanSet *") -> "DateADT": +def datespanset_end_date(ss: Annotated[_ffi.CData, "const SpanSet *"]) -> Annotated[int, "DateADT"]: ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.datespanset_end_date(ss_converted) _check_error() return result if result != _ffi.NULL else None -def datespanset_num_dates(ss: "const SpanSet *") -> "int": +def datespanset_num_dates(ss: Annotated[_ffi.CData, "const SpanSet *"]) -> Annotated[int, "int"]: ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.datespanset_num_dates(ss_converted) _check_error() return result if result != _ffi.NULL else None -def datespanset_start_date(ss: "const SpanSet *") -> "DateADT": +def datespanset_start_date(ss: Annotated[_ffi.CData, "const SpanSet *"]) -> Annotated[int, "DateADT"]: ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.datespanset_start_date(ss_converted) _check_error() return result if result != _ffi.NULL else None -def floatset_end_value(s: "const Set *") -> "double": +def floatset_end_value(s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[float, "double"]: s_converted = _ffi.cast("const Set *", s) result = _lib.floatset_end_value(s_converted) _check_error() return result if result != _ffi.NULL else None -def floatset_start_value(s: "const Set *") -> "double": +def floatset_start_value(s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[float, "double"]: s_converted = _ffi.cast("const Set *", s) result = _lib.floatset_start_value(s_converted) _check_error() return result if result != _ffi.NULL else None -def floatset_value_n(s: "const Set *", n: int) -> "double": +def floatset_value_n(s: Annotated[_ffi.CData, "const Set *"], n: int) -> Annotated[_ffi.CData, "double"]: s_converted = _ffi.cast("const Set *", s) out_result = _ffi.new("double *") result = _lib.floatset_value_n(s_converted, n, out_result) @@ -1415,108 +1485,70 @@ def floatset_value_n(s: "const Set *", n: int) -> "double": return None -def floatset_values(s: "const Set *") -> "double *": +def floatset_values(s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[_ffi.CData, "double *"]: s_converted = _ffi.cast("const Set *", s) result = _lib.floatset_values(s_converted) _check_error() return result if result != _ffi.NULL else None -def floatspan_lower(s: "const Span *") -> "double": +def floatspan_lower(s: Annotated[_ffi.CData, "const Span *"]) -> Annotated[float, "double"]: s_converted = _ffi.cast("const Span *", s) result = _lib.floatspan_lower(s_converted) _check_error() return result if result != _ffi.NULL else None -def floatspan_upper(s: "const Span *") -> "double": +def floatspan_upper(s: Annotated[_ffi.CData, "const Span *"]) -> Annotated[float, "double"]: s_converted = _ffi.cast("const Span *", s) result = _lib.floatspan_upper(s_converted) _check_error() return result if result != _ffi.NULL else None -def floatspan_width(s: "const Span *") -> "double": +def floatspan_width(s: Annotated[_ffi.CData, "const Span *"]) -> Annotated[float, "double"]: s_converted = _ffi.cast("const Span *", s) result = _lib.floatspan_width(s_converted) _check_error() return result if result != _ffi.NULL else None -def floatspanset_lower(ss: "const SpanSet *") -> "double": +def floatspanset_lower(ss: Annotated[_ffi.CData, "const SpanSet *"]) -> Annotated[float, "double"]: ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.floatspanset_lower(ss_converted) _check_error() return result if result != _ffi.NULL else None -def floatspanset_upper(ss: "const SpanSet *") -> "double": +def floatspanset_upper(ss: Annotated[_ffi.CData, "const SpanSet *"]) -> Annotated[float, "double"]: ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.floatspanset_upper(ss_converted) _check_error() return result if result != _ffi.NULL else None -def floatspanset_width(ss: "const SpanSet *", boundspan: bool) -> "double": +def floatspanset_width(ss: Annotated[_ffi.CData, "const SpanSet *"], boundspan: bool) -> Annotated[float, "double"]: ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.floatspanset_width(ss_converted, boundspan) _check_error() return result if result != _ffi.NULL else None -def geoset_end_value(s: "const Set *") -> "GSERIALIZED *": - s_converted = _ffi.cast("const Set *", s) - result = _lib.geoset_end_value(s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def geoset_srid(s: "const Set *") -> "int32_t": - s_converted = _ffi.cast("const Set *", s) - result = _lib.geoset_srid(s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def geoset_start_value(s: "const Set *") -> "GSERIALIZED *": - s_converted = _ffi.cast("const Set *", s) - result = _lib.geoset_start_value(s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def geoset_value_n(s: "const Set *", n: int) -> "GSERIALIZED **": - s_converted = _ffi.cast("const Set *", s) - out_result = _ffi.new("GSERIALIZED **") - result = _lib.geoset_value_n(s_converted, n, out_result) - _check_error() - if result: - return out_result if out_result != _ffi.NULL else None - return None - - -def geoset_values(s: "const Set *") -> "GSERIALIZED **": - s_converted = _ffi.cast("const Set *", s) - result = _lib.geoset_values(s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def intset_end_value(s: "const Set *") -> "int": +def intset_end_value(s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[int, "int"]: s_converted = _ffi.cast("const Set *", s) result = _lib.intset_end_value(s_converted) _check_error() return result if result != _ffi.NULL else None -def intset_start_value(s: "const Set *") -> "int": +def intset_start_value(s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[int, "int"]: s_converted = _ffi.cast("const Set *", s) result = _lib.intset_start_value(s_converted) _check_error() return result if result != _ffi.NULL else None -def intset_value_n(s: "const Set *", n: int) -> "int": +def intset_value_n(s: Annotated[_ffi.CData, "const Set *"], n: int) -> Annotated[_ffi.CData, "int"]: s_converted = _ffi.cast("const Set *", s) out_result = _ffi.new("int *") result = _lib.intset_value_n(s_converted, n, out_result) @@ -1526,63 +1558,63 @@ def intset_value_n(s: "const Set *", n: int) -> "int": return None -def intset_values(s: "const Set *") -> "int *": +def intset_values(s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[_ffi.CData, "int *"]: s_converted = _ffi.cast("const Set *", s) result = _lib.intset_values(s_converted) _check_error() return result if result != _ffi.NULL else None -def intspan_lower(s: "const Span *") -> "int": +def intspan_lower(s: Annotated[_ffi.CData, "const Span *"]) -> Annotated[int, "int"]: s_converted = _ffi.cast("const Span *", s) result = _lib.intspan_lower(s_converted) _check_error() return result if result != _ffi.NULL else None -def intspan_upper(s: "const Span *") -> "int": +def intspan_upper(s: Annotated[_ffi.CData, "const Span *"]) -> Annotated[int, "int"]: s_converted = _ffi.cast("const Span *", s) result = _lib.intspan_upper(s_converted) _check_error() return result if result != _ffi.NULL else None -def intspan_width(s: "const Span *") -> "int": +def intspan_width(s: Annotated[_ffi.CData, "const Span *"]) -> Annotated[int, "int"]: s_converted = _ffi.cast("const Span *", s) result = _lib.intspan_width(s_converted) _check_error() return result if result != _ffi.NULL else None -def intspanset_lower(ss: "const SpanSet *") -> "int": +def intspanset_lower(ss: Annotated[_ffi.CData, "const SpanSet *"]) -> Annotated[int, "int"]: ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.intspanset_lower(ss_converted) _check_error() return result if result != _ffi.NULL else None -def intspanset_upper(ss: "const SpanSet *") -> "int": +def intspanset_upper(ss: Annotated[_ffi.CData, "const SpanSet *"]) -> Annotated[int, "int"]: ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.intspanset_upper(ss_converted) _check_error() return result if result != _ffi.NULL else None -def intspanset_width(ss: "const SpanSet *", boundspan: bool) -> "int": +def intspanset_width(ss: Annotated[_ffi.CData, "const SpanSet *"], boundspan: bool) -> Annotated[int, "int"]: ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.intspanset_width(ss_converted, boundspan) _check_error() return result if result != _ffi.NULL else None -def set_hash(s: "const Set *") -> "uint32": +def set_hash(s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[int, "uint32"]: s_converted = _ffi.cast("const Set *", s) result = _lib.set_hash(s_converted) _check_error() return result if result != _ffi.NULL else None -def set_hash_extended(s: "const Set *", seed: int) -> "uint64": +def set_hash_extended(s: Annotated[_ffi.CData, "const Set *"], seed: int) -> Annotated[int, "uint64"]: s_converted = _ffi.cast("const Set *", s) seed_converted = _ffi.cast("uint64", seed) result = _lib.set_hash_extended(s_converted, seed_converted) @@ -1590,28 +1622,21 @@ def set_hash_extended(s: "const Set *", seed: int) -> "uint64": return result if result != _ffi.NULL else None -def set_num_values(s: "const Set *") -> "int": +def set_num_values(s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[int, "int"]: s_converted = _ffi.cast("const Set *", s) result = _lib.set_num_values(s_converted) _check_error() return result if result != _ffi.NULL else None -def set_to_span(s: "const Set *") -> "Span *": - s_converted = _ffi.cast("const Set *", s) - result = _lib.set_to_span(s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def span_hash(s: "const Span *") -> "uint32": +def span_hash(s: Annotated[_ffi.CData, "const Span *"]) -> Annotated[int, "uint32"]: s_converted = _ffi.cast("const Span *", s) result = _lib.span_hash(s_converted) _check_error() return result if result != _ffi.NULL else None -def span_hash_extended(s: "const Span *", seed: int) -> "uint64": +def span_hash_extended(s: Annotated[_ffi.CData, "const Span *"], seed: int) -> Annotated[int, "uint64"]: s_converted = _ffi.cast("const Span *", s) seed_converted = _ffi.cast("uint64", seed) result = _lib.span_hash_extended(s_converted, seed_converted) @@ -1619,35 +1644,35 @@ def span_hash_extended(s: "const Span *", seed: int) -> "uint64": return result if result != _ffi.NULL else None -def span_lower_inc(s: "const Span *") -> "bool": +def span_lower_inc(s: Annotated[_ffi.CData, "const Span *"]) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Span *", s) result = _lib.span_lower_inc(s_converted) _check_error() return result if result != _ffi.NULL else None -def span_upper_inc(s: "const Span *") -> "bool": +def span_upper_inc(s: Annotated[_ffi.CData, "const Span *"]) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Span *", s) result = _lib.span_upper_inc(s_converted) _check_error() return result if result != _ffi.NULL else None -def spanset_end_span(ss: "const SpanSet *") -> "Span *": +def spanset_end_span(ss: Annotated[_ffi.CData, "const SpanSet *"]) -> Annotated[_ffi.CData, "Span *"]: ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.spanset_end_span(ss_converted) _check_error() return result if result != _ffi.NULL else None -def spanset_hash(ss: "const SpanSet *") -> "uint32": +def spanset_hash(ss: Annotated[_ffi.CData, "const SpanSet *"]) -> Annotated[int, "uint32"]: ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.spanset_hash(ss_converted) _check_error() return result if result != _ffi.NULL else None -def spanset_hash_extended(ss: "const SpanSet *", seed: int) -> "uint64": +def spanset_hash_extended(ss: Annotated[_ffi.CData, "const SpanSet *"], seed: int) -> Annotated[int, "uint64"]: ss_converted = _ffi.cast("const SpanSet *", ss) seed_converted = _ffi.cast("uint64", seed) result = _lib.spanset_hash_extended(ss_converted, seed_converted) @@ -1655,56 +1680,56 @@ def spanset_hash_extended(ss: "const SpanSet *", seed: int) -> "uint64": return result if result != _ffi.NULL else None -def spanset_lower_inc(ss: "const SpanSet *") -> "bool": +def spanset_lower_inc(ss: Annotated[_ffi.CData, "const SpanSet *"]) -> Annotated[bool, "bool"]: ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.spanset_lower_inc(ss_converted) _check_error() return result if result != _ffi.NULL else None -def spanset_num_spans(ss: "const SpanSet *") -> "int": +def spanset_num_spans(ss: Annotated[_ffi.CData, "const SpanSet *"]) -> Annotated[int, "int"]: ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.spanset_num_spans(ss_converted) _check_error() return result if result != _ffi.NULL else None -def spanset_span(ss: "const SpanSet *") -> "Span *": +def spanset_span(ss: Annotated[_ffi.CData, "const SpanSet *"]) -> Annotated[_ffi.CData, "Span *"]: ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.spanset_span(ss_converted) _check_error() return result if result != _ffi.NULL else None -def spanset_span_n(ss: "const SpanSet *", i: int) -> "Span *": +def spanset_span_n(ss: Annotated[_ffi.CData, "const SpanSet *"], i: int) -> Annotated[_ffi.CData, "Span *"]: ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.spanset_span_n(ss_converted, i) _check_error() return result if result != _ffi.NULL else None -def spanset_spanarr(ss: "const SpanSet *") -> "Span **": +def spanset_spanarr(ss: Annotated[_ffi.CData, "const SpanSet *"]) -> Annotated[_ffi.CData, "Span **"]: ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.spanset_spanarr(ss_converted) _check_error() return result if result != _ffi.NULL else None -def spanset_start_span(ss: "const SpanSet *") -> "Span *": +def spanset_start_span(ss: Annotated[_ffi.CData, "const SpanSet *"]) -> Annotated[_ffi.CData, "Span *"]: ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.spanset_start_span(ss_converted) _check_error() return result if result != _ffi.NULL else None -def spanset_upper_inc(ss: "const SpanSet *") -> "bool": +def spanset_upper_inc(ss: Annotated[_ffi.CData, "const SpanSet *"]) -> Annotated[bool, "bool"]: ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.spanset_upper_inc(ss_converted) _check_error() return result if result != _ffi.NULL else None -def textset_end_value(s: "const Set *") -> str: +def textset_end_value(s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[str, "text *"]: s_converted = _ffi.cast("const Set *", s) result = _lib.textset_end_value(s_converted) _check_error() @@ -1712,7 +1737,7 @@ def textset_end_value(s: "const Set *") -> str: return result if result != _ffi.NULL else None -def textset_start_value(s: "const Set *") -> str: +def textset_start_value(s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[str, "text *"]: s_converted = _ffi.cast("const Set *", s) result = _lib.textset_start_value(s_converted) _check_error() @@ -1720,7 +1745,7 @@ def textset_start_value(s: "const Set *") -> str: return result if result != _ffi.NULL else None -def textset_value_n(s: "const Set *", n: int) -> "text **": +def textset_value_n(s: Annotated[_ffi.CData, "const Set *"], n: int) -> Annotated[list, "text **"]: s_converted = _ffi.cast("const Set *", s) out_result = _ffi.new("text **") result = _lib.textset_value_n(s_converted, n, out_result) @@ -1730,28 +1755,28 @@ def textset_value_n(s: "const Set *", n: int) -> "text **": return None -def textset_values(s: "const Set *") -> "text **": +def textset_values(s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[_ffi.CData, "text **"]: s_converted = _ffi.cast("const Set *", s) result = _lib.textset_values(s_converted) _check_error() return result if result != _ffi.NULL else None -def tstzset_end_value(s: "const Set *") -> "TimestampTz": +def tstzset_end_value(s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[int, "TimestampTz"]: s_converted = _ffi.cast("const Set *", s) result = _lib.tstzset_end_value(s_converted) _check_error() return result if result != _ffi.NULL else None -def tstzset_start_value(s: "const Set *") -> "TimestampTz": +def tstzset_start_value(s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[int, "TimestampTz"]: s_converted = _ffi.cast("const Set *", s) result = _lib.tstzset_start_value(s_converted) _check_error() return result if result != _ffi.NULL else None -def tstzset_value_n(s: "const Set *", n: int) -> int: +def tstzset_value_n(s: Annotated[_ffi.CData, "const Set *"], n: int) -> int: s_converted = _ffi.cast("const Set *", s) out_result = _ffi.new("TimestampTz *") result = _lib.tstzset_value_n(s_converted, n, out_result) @@ -1761,70 +1786,79 @@ def tstzset_value_n(s: "const Set *", n: int) -> int: return None -def tstzset_values(s: "const Set *") -> "TimestampTz *": +def tstzset_values(s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[int, "TimestampTz *"]: s_converted = _ffi.cast("const Set *", s) result = _lib.tstzset_values(s_converted) _check_error() return result if result != _ffi.NULL else None -def tstzspan_duration(s: "const Span *") -> "Interval *": +def tstzspan_duration(s: Annotated[_ffi.CData, "const Span *"]) -> Annotated[_ffi.CData, "Interval *"]: s_converted = _ffi.cast("const Span *", s) result = _lib.tstzspan_duration(s_converted) _check_error() return result if result != _ffi.NULL else None -def tstzspan_lower(s: "const Span *") -> "TimestampTz": +def tstzspan_lower(s: Annotated[_ffi.CData, "const Span *"]) -> Annotated[int, "TimestampTz"]: s_converted = _ffi.cast("const Span *", s) result = _lib.tstzspan_lower(s_converted) _check_error() return result if result != _ffi.NULL else None -def tstzspan_upper(s: "const Span *") -> "TimestampTz": +def tstzspan_upper(s: Annotated[_ffi.CData, "const Span *"]) -> Annotated[int, "TimestampTz"]: s_converted = _ffi.cast("const Span *", s) result = _lib.tstzspan_upper(s_converted) _check_error() return result if result != _ffi.NULL else None -def tstzspanset_duration(ss: "const SpanSet *", boundspan: bool) -> "Interval *": +def tstzspanset_duration( + ss: Annotated[_ffi.CData, "const SpanSet *"], boundspan: bool +) -> Annotated[_ffi.CData, "Interval *"]: ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.tstzspanset_duration(ss_converted, boundspan) _check_error() return result if result != _ffi.NULL else None -def tstzspanset_end_timestamptz(ss: "const SpanSet *") -> "TimestampTz": +def tstzspanset_end_timestamptz(ss: Annotated[_ffi.CData, "const SpanSet *"]) -> Annotated[int, "TimestampTz"]: ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.tstzspanset_end_timestamptz(ss_converted) _check_error() return result if result != _ffi.NULL else None -def tstzspanset_lower(ss: "const SpanSet *") -> "TimestampTz": +def tstzspanset_lower(ss: Annotated[_ffi.CData, "const SpanSet *"]) -> Annotated[int, "TimestampTz"]: ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.tstzspanset_lower(ss_converted) _check_error() return result if result != _ffi.NULL else None -def tstzspanset_num_timestamps(ss: "const SpanSet *") -> "int": +def tstzspanset_num_timestamps(ss: Annotated[_ffi.CData, "const SpanSet *"]) -> Annotated[int, "int"]: ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.tstzspanset_num_timestamps(ss_converted) _check_error() return result if result != _ffi.NULL else None -def tstzspanset_start_timestamptz(ss: "const SpanSet *") -> "TimestampTz": +def tstzspanset_start_timestamptz(ss: Annotated[_ffi.CData, "const SpanSet *"]) -> Annotated[int, "TimestampTz"]: ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.tstzspanset_start_timestamptz(ss_converted) _check_error() return result if result != _ffi.NULL else None -def tstzspanset_timestamptz_n(ss: "const SpanSet *", n: int) -> int: +def tstzspanset_timestamps(ss: Annotated[_ffi.CData, "const SpanSet *"]) -> Annotated[_ffi.CData, "Set *"]: + ss_converted = _ffi.cast("const SpanSet *", ss) + result = _lib.tstzspanset_timestamps(ss_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def tstzspanset_timestamptz_n(ss: Annotated[_ffi.CData, "const SpanSet *"], n: int) -> int: ss_converted = _ffi.cast("const SpanSet *", ss) out_result = _ffi.new("TimestampTz *") result = _lib.tstzspanset_timestamptz_n(ss_converted, n, out_result) @@ -1834,14 +1868,7 @@ def tstzspanset_timestamptz_n(ss: "const SpanSet *", n: int) -> int: return None -def tstzspanset_timestamps(ss: "const SpanSet *") -> "Set *": - ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.tstzspanset_timestamps(ss_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def tstzspanset_upper(ss: "const SpanSet *") -> "TimestampTz": +def tstzspanset_upper(ss: Annotated[_ffi.CData, "const SpanSet *"]) -> Annotated[int, "TimestampTz"]: ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.tstzspanset_upper(ss_converted) _check_error() @@ -1849,47 +1876,41 @@ def tstzspanset_upper(ss: "const SpanSet *") -> "TimestampTz": def bigintset_shift_scale( - s: "const Set *", shift: int, width: int, hasshift: bool, haswidth: bool -) -> "Set *": + s: Annotated[_ffi.CData, "const Set *"], shift: int, width: int, hasshift: bool, haswidth: bool +) -> Annotated[_ffi.CData, "Set *"]: s_converted = _ffi.cast("const Set *", s) shift_converted = _ffi.cast("int64", shift) width_converted = _ffi.cast("int64", width) - result = _lib.bigintset_shift_scale( - s_converted, shift_converted, width_converted, hasshift, haswidth - ) + result = _lib.bigintset_shift_scale(s_converted, shift_converted, width_converted, hasshift, haswidth) _check_error() return result if result != _ffi.NULL else None def bigintspan_shift_scale( - s: "const Span *", shift: int, width: int, hasshift: bool, haswidth: bool -) -> "Span *": + s: Annotated[_ffi.CData, "const Span *"], shift: int, width: int, hasshift: bool, haswidth: bool +) -> Annotated[_ffi.CData, "Span *"]: s_converted = _ffi.cast("const Span *", s) shift_converted = _ffi.cast("int64", shift) width_converted = _ffi.cast("int64", width) - result = _lib.bigintspan_shift_scale( - s_converted, shift_converted, width_converted, hasshift, haswidth - ) + result = _lib.bigintspan_shift_scale(s_converted, shift_converted, width_converted, hasshift, haswidth) _check_error() return result if result != _ffi.NULL else None def bigintspanset_shift_scale( - ss: "const SpanSet *", shift: int, width: int, hasshift: bool, haswidth: bool -) -> "SpanSet *": + ss: Annotated[_ffi.CData, "const SpanSet *"], shift: int, width: int, hasshift: bool, haswidth: bool +) -> Annotated[_ffi.CData, "SpanSet *"]: ss_converted = _ffi.cast("const SpanSet *", ss) shift_converted = _ffi.cast("int64", shift) width_converted = _ffi.cast("int64", width) - result = _lib.bigintspanset_shift_scale( - ss_converted, shift_converted, width_converted, hasshift, haswidth - ) + result = _lib.bigintspanset_shift_scale(ss_converted, shift_converted, width_converted, hasshift, haswidth) _check_error() return result if result != _ffi.NULL else None def dateset_shift_scale( - s: "const Set *", shift: int, width: int, hasshift: bool, haswidth: bool -) -> "Set *": + s: Annotated[_ffi.CData, "const Set *"], shift: int, width: int, hasshift: bool, haswidth: bool +) -> Annotated[_ffi.CData, "Set *"]: s_converted = _ffi.cast("const Set *", s) result = _lib.dateset_shift_scale(s_converted, shift, width, hasshift, haswidth) _check_error() @@ -1897,8 +1918,8 @@ def dateset_shift_scale( def datespan_shift_scale( - s: "const Span *", shift: int, width: int, hasshift: bool, haswidth: bool -) -> "Span *": + s: Annotated[_ffi.CData, "const Span *"], shift: int, width: int, hasshift: bool, haswidth: bool +) -> Annotated[_ffi.CData, "Span *"]: s_converted = _ffi.cast("const Span *", s) result = _lib.datespan_shift_scale(s_converted, shift, width, hasshift, haswidth) _check_error() @@ -1906,75 +1927,80 @@ def datespan_shift_scale( def datespanset_shift_scale( - ss: "const SpanSet *", shift: int, width: int, hasshift: bool, haswidth: bool -) -> "SpanSet *": + ss: Annotated[_ffi.CData, "const SpanSet *"], shift: int, width: int, hasshift: bool, haswidth: bool +) -> Annotated[_ffi.CData, "SpanSet *"]: ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.datespanset_shift_scale( - ss_converted, shift, width, hasshift, haswidth - ) + result = _lib.datespanset_shift_scale(ss_converted, shift, width, hasshift, haswidth) _check_error() return result if result != _ffi.NULL else None -def floatset_ceil(s: "const Set *") -> "Set *": +def floatset_ceil(s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[_ffi.CData, "Set *"]: s_converted = _ffi.cast("const Set *", s) result = _lib.floatset_ceil(s_converted) _check_error() return result if result != _ffi.NULL else None -def floatset_floor(s: "const Set *") -> "Set *": +def floatset_degrees(s: Annotated[_ffi.CData, "const Set *"], normalize: bool) -> Annotated[_ffi.CData, "Set *"]: s_converted = _ffi.cast("const Set *", s) - result = _lib.floatset_floor(s_converted) + result = _lib.floatset_degrees(s_converted, normalize) _check_error() return result if result != _ffi.NULL else None -def floatset_degrees(s: "const Set *", normalize: bool) -> "Set *": +def floatset_floor(s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[_ffi.CData, "Set *"]: s_converted = _ffi.cast("const Set *", s) - result = _lib.floatset_degrees(s_converted, normalize) + result = _lib.floatset_floor(s_converted) _check_error() return result if result != _ffi.NULL else None -def floatset_radians(s: "const Set *") -> "Set *": +def floatset_radians(s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[_ffi.CData, "Set *"]: s_converted = _ffi.cast("const Set *", s) result = _lib.floatset_radians(s_converted) _check_error() return result if result != _ffi.NULL else None -def floatset_round(s: "const Set *", maxdd: int) -> "Set *": +def floatset_shift_scale( + s: Annotated[_ffi.CData, "const Set *"], shift: float, width: float, hasshift: bool, haswidth: bool +) -> Annotated[_ffi.CData, "Set *"]: s_converted = _ffi.cast("const Set *", s) - result = _lib.floatset_round(s_converted, maxdd) + result = _lib.floatset_shift_scale(s_converted, shift, width, hasshift, haswidth) _check_error() return result if result != _ffi.NULL else None -def floatset_shift_scale( - s: "const Set *", shift: float, width: float, hasshift: bool, haswidth: bool -) -> "Set *": - s_converted = _ffi.cast("const Set *", s) - result = _lib.floatset_shift_scale(s_converted, shift, width, hasshift, haswidth) +def floatspan_ceil(s: Annotated[_ffi.CData, "const Span *"]) -> Annotated[_ffi.CData, "Span *"]: + s_converted = _ffi.cast("const Span *", s) + result = _lib.floatspan_ceil(s_converted) _check_error() return result if result != _ffi.NULL else None -def floatspan_ceil(s: "const Span *") -> "Span *": +def floatspan_degrees(s: Annotated[_ffi.CData, "const Span *"], normalize: bool) -> Annotated[_ffi.CData, "Span *"]: s_converted = _ffi.cast("const Span *", s) - result = _lib.floatspan_ceil(s_converted) + result = _lib.floatspan_degrees(s_converted, normalize) _check_error() return result if result != _ffi.NULL else None -def floatspan_floor(s: "const Span *") -> "Span *": +def floatspan_floor(s: Annotated[_ffi.CData, "const Span *"]) -> Annotated[_ffi.CData, "Span *"]: s_converted = _ffi.cast("const Span *", s) result = _lib.floatspan_floor(s_converted) _check_error() return result if result != _ffi.NULL else None -def floatspan_round(s: "const Span *", maxdd: int) -> "Span *": +def floatspan_radians(s: Annotated[_ffi.CData, "const Span *"]) -> Annotated[_ffi.CData, "Span *"]: + s_converted = _ffi.cast("const Span *", s) + result = _lib.floatspan_radians(s_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def floatspan_round(s: Annotated[_ffi.CData, "const Span *"], maxdd: int) -> Annotated[_ffi.CData, "Span *"]: s_converted = _ffi.cast("const Span *", s) result = _lib.floatspan_round(s_converted, maxdd) _check_error() @@ -1982,85 +2008,63 @@ def floatspan_round(s: "const Span *", maxdd: int) -> "Span *": def floatspan_shift_scale( - s: "const Span *", shift: float, width: float, hasshift: bool, haswidth: bool -) -> "Span *": + s: Annotated[_ffi.CData, "const Span *"], shift: float, width: float, hasshift: bool, haswidth: bool +) -> Annotated[_ffi.CData, "Span *"]: s_converted = _ffi.cast("const Span *", s) result = _lib.floatspan_shift_scale(s_converted, shift, width, hasshift, haswidth) _check_error() return result if result != _ffi.NULL else None -def floatspanset_ceil(ss: "const SpanSet *") -> "SpanSet *": +def floatspanset_ceil(ss: Annotated[_ffi.CData, "const SpanSet *"]) -> Annotated[_ffi.CData, "SpanSet *"]: ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.floatspanset_ceil(ss_converted) _check_error() return result if result != _ffi.NULL else None -def floatspanset_floor(ss: "const SpanSet *") -> "SpanSet *": +def floatspanset_floor(ss: Annotated[_ffi.CData, "const SpanSet *"]) -> Annotated[_ffi.CData, "SpanSet *"]: ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.floatspanset_floor(ss_converted) _check_error() return result if result != _ffi.NULL else None -def floatspanset_round(ss: "const SpanSet *", maxdd: int) -> "SpanSet *": +def floatspanset_degrees( + ss: Annotated[_ffi.CData, "const SpanSet *"], normalize: bool +) -> Annotated[_ffi.CData, "SpanSet *"]: ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.floatspanset_round(ss_converted, maxdd) + result = _lib.floatspanset_degrees(ss_converted, normalize) _check_error() return result if result != _ffi.NULL else None -def floatspanset_shift_scale( - ss: "const SpanSet *", shift: float, width: float, hasshift: bool, haswidth: bool -) -> "SpanSet *": +def floatspanset_radians(ss: Annotated[_ffi.CData, "const SpanSet *"]) -> Annotated[_ffi.CData, "SpanSet *"]: ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.floatspanset_shift_scale( - ss_converted, shift, width, hasshift, haswidth - ) + result = _lib.floatspanset_radians(ss_converted) _check_error() return result if result != _ffi.NULL else None -def geoset_round(s: "const Set *", maxdd: int) -> "Set *": - s_converted = _ffi.cast("const Set *", s) - result = _lib.geoset_round(s_converted, maxdd) +def floatspanset_round(ss: Annotated[_ffi.CData, "const SpanSet *"], maxdd: int) -> Annotated[_ffi.CData, "SpanSet *"]: + ss_converted = _ffi.cast("const SpanSet *", ss) + result = _lib.floatspanset_round(ss_converted, maxdd) _check_error() return result if result != _ffi.NULL else None -def geoset_set_srid(s: "const Set *", srid: "int32_t") -> "Set *": - s_converted = _ffi.cast("const Set *", s) - srid_converted = _ffi.cast("int32_t", srid) - result = _lib.geoset_set_srid(s_converted, srid_converted) +def floatspanset_shift_scale( + ss: Annotated[_ffi.CData, "const SpanSet *"], shift: float, width: float, hasshift: bool, haswidth: bool +) -> Annotated[_ffi.CData, "SpanSet *"]: + ss_converted = _ffi.cast("const SpanSet *", ss) + result = _lib.floatspanset_shift_scale(ss_converted, shift, width, hasshift, haswidth) _check_error() return result if result != _ffi.NULL else None -def geoset_transform(s: "const Set *", srid: "int32_t") -> "Set *": - s_converted = _ffi.cast("const Set *", s) - srid_converted = _ffi.cast("int32_t", srid) - result = _lib.geoset_transform(s_converted, srid_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def geoset_transform_pipeline( - s: "const Set *", pipelinestr: str, srid: "int32_t", is_forward: bool -) -> "Set *": - s_converted = _ffi.cast("const Set *", s) - pipelinestr_converted = pipelinestr.encode("utf-8") - srid_converted = _ffi.cast("int32_t", srid) - result = _lib.geoset_transform_pipeline( - s_converted, pipelinestr_converted, srid_converted, is_forward - ) - _check_error() - return result if result != _ffi.NULL else None - - -def intset_shift_scale( - s: "const Set *", shift: int, width: int, hasshift: bool, haswidth: bool -) -> "Set *": +def intset_shift_scale( + s: Annotated[_ffi.CData, "const Set *"], shift: int, width: int, hasshift: bool, haswidth: bool +) -> Annotated[_ffi.CData, "Set *"]: s_converted = _ffi.cast("const Set *", s) result = _lib.intset_shift_scale(s_converted, shift, width, hasshift, haswidth) _check_error() @@ -2068,8 +2072,8 @@ def intset_shift_scale( def intspan_shift_scale( - s: "const Span *", shift: int, width: int, hasshift: bool, haswidth: bool -) -> "Span *": + s: Annotated[_ffi.CData, "const Span *"], shift: int, width: int, hasshift: bool, haswidth: bool +) -> Annotated[_ffi.CData, "Span *"]: s_converted = _ffi.cast("const Span *", s) result = _lib.intspan_shift_scale(s_converted, shift, width, hasshift, haswidth) _check_error() @@ -2077,157 +2081,105 @@ def intspan_shift_scale( def intspanset_shift_scale( - ss: "const SpanSet *", shift: int, width: int, hasshift: bool, haswidth: bool -) -> "SpanSet *": + ss: Annotated[_ffi.CData, "const SpanSet *"], shift: int, width: int, hasshift: bool, haswidth: bool +) -> Annotated[_ffi.CData, "SpanSet *"]: ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.intspanset_shift_scale(ss_converted, shift, width, hasshift, haswidth) _check_error() return result if result != _ffi.NULL else None -def point_transform(gs: "const GSERIALIZED *", srid: "int32_t") -> "GSERIALIZED *": - gs_converted = _ffi.cast("const GSERIALIZED *", gs) - srid_converted = _ffi.cast("int32_t", srid) - result = _lib.point_transform(gs_converted, srid_converted) +def numspan_expand( + s: Annotated[_ffi.CData, "const Span *"], value: Annotated[_ffi.CData, "Datum"] +) -> Annotated[_ffi.CData, "Span *"]: + s_converted = _ffi.cast("const Span *", s) + value_converted = _ffi.cast("Datum", value) + result = _lib.numspan_expand(s_converted, value_converted) _check_error() return result if result != _ffi.NULL else None -def point_transform_pipeline( - gs: "const GSERIALIZED *", pipelinestr: str, srid: "int32_t", is_forward: bool -) -> "GSERIALIZED *": - gs_converted = _ffi.cast("const GSERIALIZED *", gs) - pipelinestr_converted = pipelinestr.encode("utf-8") - srid_converted = _ffi.cast("int32_t", srid) - result = _lib.point_transform_pipeline( - gs_converted, pipelinestr_converted, srid_converted, is_forward - ) +def tstzspan_expand( + s: Annotated[_ffi.CData, "const Span *"], interv: Annotated[_ffi.CData, "const Interval *"] +) -> Annotated[_ffi.CData, "Span *"]: + s_converted = _ffi.cast("const Span *", s) + interv_converted = _ffi.cast("const Interval *", interv) + result = _lib.tstzspan_expand(s_converted, interv_converted) _check_error() return result if result != _ffi.NULL else None -def set_spans(s: "const Set *") -> "Span *": +def set_round(s: Annotated[_ffi.CData, "const Set *"], maxdd: int) -> Annotated[_ffi.CData, "Set *"]: s_converted = _ffi.cast("const Set *", s) - result = _lib.set_spans(s_converted) + result = _lib.set_round(s_converted, maxdd) _check_error() return result if result != _ffi.NULL else None -def set_split_each_n_spans( - s: "const Set *", elem_count: int -) -> "Tuple['Span *', 'int']": +def textcat_text_textset(txt: str, s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[_ffi.CData, "Set *"]: + txt_converted = cstring2text(txt) s_converted = _ffi.cast("const Set *", s) - count = _ffi.new("int *") - result = _lib.set_split_each_n_spans(s_converted, elem_count, count) + result = _lib.textcat_text_textset(txt_converted, s_converted) _check_error() - return result if result != _ffi.NULL else None, count[0] + return result if result != _ffi.NULL else None -def set_split_n_spans(s: "const Set *", span_count: int) -> "Tuple['Span *', 'int']": +def textcat_textset_text(s: Annotated[_ffi.CData, "const Set *"], txt: str) -> Annotated[_ffi.CData, "Set *"]: s_converted = _ffi.cast("const Set *", s) - count = _ffi.new("int *") - result = _lib.set_split_n_spans(s_converted, span_count, count) - _check_error() - return result if result != _ffi.NULL else None, count[0] - - -def spanset_spans(ss: "const SpanSet *") -> "Span *": - ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.spanset_spans(ss_converted) + txt_converted = cstring2text(txt) + result = _lib.textcat_textset_text(s_converted, txt_converted) _check_error() return result if result != _ffi.NULL else None -def spanset_split_each_n_spans( - ss: "const SpanSet *", elem_count: int -) -> "Tuple['Span *', 'int']": - ss_converted = _ffi.cast("const SpanSet *", ss) - count = _ffi.new("int *") - result = _lib.spanset_split_each_n_spans(ss_converted, elem_count, count) - _check_error() - return result if result != _ffi.NULL else None, count[0] - - -def spanset_split_n_spans( - ss: "const SpanSet *", span_count: int -) -> "Tuple['Span *', 'int']": - ss_converted = _ffi.cast("const SpanSet *", ss) - count = _ffi.new("int *") - result = _lib.spanset_split_n_spans(ss_converted, span_count, count) - _check_error() - return result if result != _ffi.NULL else None, count[0] - - -def textset_initcap(s: "const Set *") -> "Set *": +def textset_initcap(s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[_ffi.CData, "Set *"]: s_converted = _ffi.cast("const Set *", s) result = _lib.textset_initcap(s_converted) _check_error() return result if result != _ffi.NULL else None -def textset_lower(s: "const Set *") -> "Set *": +def textset_lower(s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[_ffi.CData, "Set *"]: s_converted = _ffi.cast("const Set *", s) result = _lib.textset_lower(s_converted) _check_error() return result if result != _ffi.NULL else None -def textset_upper(s: "const Set *") -> "Set *": +def textset_upper(s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[_ffi.CData, "Set *"]: s_converted = _ffi.cast("const Set *", s) result = _lib.textset_upper(s_converted) _check_error() return result if result != _ffi.NULL else None -def textcat_textset_text(s: "const Set *", txt: str) -> "Set *": - s_converted = _ffi.cast("const Set *", s) - txt_converted = cstring2text(txt) - result = _lib.textcat_textset_text(s_converted, txt_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def textcat_text_textset(txt: str, s: "const Set *") -> "Set *": - txt_converted = cstring2text(txt) - s_converted = _ffi.cast("const Set *", s) - result = _lib.textcat_text_textset(txt_converted, s_converted) - _check_error() - return result if result != _ffi.NULL else None - - def timestamptz_tprecision( - t: int, duration: "const Interval *", torigin: int -) -> "TimestampTz": + t: int, duration: Annotated[_ffi.CData, "const Interval *"], torigin: int +) -> Annotated[int, "TimestampTz"]: t_converted = _ffi.cast("TimestampTz", t) duration_converted = _ffi.cast("const Interval *", duration) torigin_converted = _ffi.cast("TimestampTz", torigin) - result = _lib.timestamptz_tprecision( - t_converted, duration_converted, torigin_converted - ) + result = _lib.timestamptz_tprecision(t_converted, duration_converted, torigin_converted) _check_error() return result if result != _ffi.NULL else None def tstzset_shift_scale( - s: "const Set *", - shift: "Optional['const Interval *']", - duration: "Optional['const Interval *']", -) -> "Set *": + s: Annotated[_ffi.CData, "const Set *"], + shift: Annotated[_ffi.CData, "const Interval *"] | None, + duration: Annotated[_ffi.CData, "const Interval *"] | None, +) -> Annotated[_ffi.CData, "Set *"]: s_converted = _ffi.cast("const Set *", s) - shift_converted = ( - _ffi.cast("const Interval *", shift) if shift is not None else _ffi.NULL - ) - duration_converted = ( - _ffi.cast("const Interval *", duration) if duration is not None else _ffi.NULL - ) + shift_converted = _ffi.cast("const Interval *", shift) if shift is not None else _ffi.NULL + duration_converted = _ffi.cast("const Interval *", duration) if duration is not None else _ffi.NULL result = _lib.tstzset_shift_scale(s_converted, shift_converted, duration_converted) _check_error() return result if result != _ffi.NULL else None def tstzset_tprecision( - s: "const Set *", duration: "const Interval *", torigin: int -) -> "Set *": + s: Annotated[_ffi.CData, "const Set *"], duration: Annotated[_ffi.CData, "const Interval *"], torigin: int +) -> Annotated[_ffi.CData, "Set *"]: s_converted = _ffi.cast("const Set *", s) duration_converted = _ffi.cast("const Interval *", duration) torigin_converted = _ffi.cast("TimestampTz", torigin) @@ -2237,68 +2189,56 @@ def tstzset_tprecision( def tstzspan_shift_scale( - s: "const Span *", - shift: "Optional['const Interval *']", - duration: "Optional['const Interval *']", -) -> "Span *": + s: Annotated[_ffi.CData, "const Span *"], + shift: Annotated[_ffi.CData, "const Interval *"] | None, + duration: Annotated[_ffi.CData, "const Interval *"] | None, +) -> Annotated[_ffi.CData, "Span *"]: s_converted = _ffi.cast("const Span *", s) - shift_converted = ( - _ffi.cast("const Interval *", shift) if shift is not None else _ffi.NULL - ) - duration_converted = ( - _ffi.cast("const Interval *", duration) if duration is not None else _ffi.NULL - ) + shift_converted = _ffi.cast("const Interval *", shift) if shift is not None else _ffi.NULL + duration_converted = _ffi.cast("const Interval *", duration) if duration is not None else _ffi.NULL result = _lib.tstzspan_shift_scale(s_converted, shift_converted, duration_converted) _check_error() return result if result != _ffi.NULL else None def tstzspan_tprecision( - s: "const Span *", duration: "const Interval *", torigin: int -) -> "Span *": + s: Annotated[_ffi.CData, "const Span *"], duration: Annotated[_ffi.CData, "const Interval *"], torigin: int +) -> Annotated[_ffi.CData, "Span *"]: s_converted = _ffi.cast("const Span *", s) duration_converted = _ffi.cast("const Interval *", duration) torigin_converted = _ffi.cast("TimestampTz", torigin) - result = _lib.tstzspan_tprecision( - s_converted, duration_converted, torigin_converted - ) + result = _lib.tstzspan_tprecision(s_converted, duration_converted, torigin_converted) _check_error() return result if result != _ffi.NULL else None def tstzspanset_shift_scale( - ss: "const SpanSet *", - shift: "Optional['const Interval *']", - duration: "Optional['const Interval *']", -) -> "SpanSet *": + ss: Annotated[_ffi.CData, "const SpanSet *"], + shift: Annotated[_ffi.CData, "const Interval *"] | None, + duration: Annotated[_ffi.CData, "const Interval *"] | None, +) -> Annotated[_ffi.CData, "SpanSet *"]: ss_converted = _ffi.cast("const SpanSet *", ss) - shift_converted = ( - _ffi.cast("const Interval *", shift) if shift is not None else _ffi.NULL - ) - duration_converted = ( - _ffi.cast("const Interval *", duration) if duration is not None else _ffi.NULL - ) - result = _lib.tstzspanset_shift_scale( - ss_converted, shift_converted, duration_converted - ) + shift_converted = _ffi.cast("const Interval *", shift) if shift is not None else _ffi.NULL + duration_converted = _ffi.cast("const Interval *", duration) if duration is not None else _ffi.NULL + result = _lib.tstzspanset_shift_scale(ss_converted, shift_converted, duration_converted) _check_error() return result if result != _ffi.NULL else None def tstzspanset_tprecision( - ss: "const SpanSet *", duration: "const Interval *", torigin: int -) -> "SpanSet *": + ss: Annotated[_ffi.CData, "const SpanSet *"], duration: Annotated[_ffi.CData, "const Interval *"], torigin: int +) -> Annotated[_ffi.CData, "SpanSet *"]: ss_converted = _ffi.cast("const SpanSet *", ss) duration_converted = _ffi.cast("const Interval *", duration) torigin_converted = _ffi.cast("TimestampTz", torigin) - result = _lib.tstzspanset_tprecision( - ss_converted, duration_converted, torigin_converted - ) + result = _lib.tstzspanset_tprecision(ss_converted, duration_converted, torigin_converted) _check_error() return result if result != _ffi.NULL else None -def set_cmp(s1: "const Set *", s2: "const Set *") -> "int": +def set_cmp( + s1: Annotated[_ffi.CData, "const Set *"], s2: Annotated[_ffi.CData, "const Set *"] +) -> Annotated[int, "int"]: s1_converted = _ffi.cast("const Set *", s1) s2_converted = _ffi.cast("const Set *", s2) result = _lib.set_cmp(s1_converted, s2_converted) @@ -2306,7 +2246,9 @@ def set_cmp(s1: "const Set *", s2: "const Set *") -> "int": return result if result != _ffi.NULL else None -def set_eq(s1: "const Set *", s2: "const Set *") -> "bool": +def set_eq( + s1: Annotated[_ffi.CData, "const Set *"], s2: Annotated[_ffi.CData, "const Set *"] +) -> Annotated[bool, "bool"]: s1_converted = _ffi.cast("const Set *", s1) s2_converted = _ffi.cast("const Set *", s2) result = _lib.set_eq(s1_converted, s2_converted) @@ -2314,7 +2256,9 @@ def set_eq(s1: "const Set *", s2: "const Set *") -> "bool": return result if result != _ffi.NULL else None -def set_ge(s1: "const Set *", s2: "const Set *") -> "bool": +def set_ge( + s1: Annotated[_ffi.CData, "const Set *"], s2: Annotated[_ffi.CData, "const Set *"] +) -> Annotated[bool, "bool"]: s1_converted = _ffi.cast("const Set *", s1) s2_converted = _ffi.cast("const Set *", s2) result = _lib.set_ge(s1_converted, s2_converted) @@ -2322,7 +2266,9 @@ def set_ge(s1: "const Set *", s2: "const Set *") -> "bool": return result if result != _ffi.NULL else None -def set_gt(s1: "const Set *", s2: "const Set *") -> "bool": +def set_gt( + s1: Annotated[_ffi.CData, "const Set *"], s2: Annotated[_ffi.CData, "const Set *"] +) -> Annotated[bool, "bool"]: s1_converted = _ffi.cast("const Set *", s1) s2_converted = _ffi.cast("const Set *", s2) result = _lib.set_gt(s1_converted, s2_converted) @@ -2330,7 +2276,9 @@ def set_gt(s1: "const Set *", s2: "const Set *") -> "bool": return result if result != _ffi.NULL else None -def set_le(s1: "const Set *", s2: "const Set *") -> "bool": +def set_le( + s1: Annotated[_ffi.CData, "const Set *"], s2: Annotated[_ffi.CData, "const Set *"] +) -> Annotated[bool, "bool"]: s1_converted = _ffi.cast("const Set *", s1) s2_converted = _ffi.cast("const Set *", s2) result = _lib.set_le(s1_converted, s2_converted) @@ -2338,7 +2286,9 @@ def set_le(s1: "const Set *", s2: "const Set *") -> "bool": return result if result != _ffi.NULL else None -def set_lt(s1: "const Set *", s2: "const Set *") -> "bool": +def set_lt( + s1: Annotated[_ffi.CData, "const Set *"], s2: Annotated[_ffi.CData, "const Set *"] +) -> Annotated[bool, "bool"]: s1_converted = _ffi.cast("const Set *", s1) s2_converted = _ffi.cast("const Set *", s2) result = _lib.set_lt(s1_converted, s2_converted) @@ -2346,7 +2296,9 @@ def set_lt(s1: "const Set *", s2: "const Set *") -> "bool": return result if result != _ffi.NULL else None -def set_ne(s1: "const Set *", s2: "const Set *") -> "bool": +def set_ne( + s1: Annotated[_ffi.CData, "const Set *"], s2: Annotated[_ffi.CData, "const Set *"] +) -> Annotated[bool, "bool"]: s1_converted = _ffi.cast("const Set *", s1) s2_converted = _ffi.cast("const Set *", s2) result = _lib.set_ne(s1_converted, s2_converted) @@ -2354,7 +2306,9 @@ def set_ne(s1: "const Set *", s2: "const Set *") -> "bool": return result if result != _ffi.NULL else None -def span_cmp(s1: "const Span *", s2: "const Span *") -> "int": +def span_cmp( + s1: Annotated[_ffi.CData, "const Span *"], s2: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[int, "int"]: s1_converted = _ffi.cast("const Span *", s1) s2_converted = _ffi.cast("const Span *", s2) result = _lib.span_cmp(s1_converted, s2_converted) @@ -2362,7 +2316,9 @@ def span_cmp(s1: "const Span *", s2: "const Span *") -> "int": return result if result != _ffi.NULL else None -def span_eq(s1: "const Span *", s2: "const Span *") -> "bool": +def span_eq( + s1: Annotated[_ffi.CData, "const Span *"], s2: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[bool, "bool"]: s1_converted = _ffi.cast("const Span *", s1) s2_converted = _ffi.cast("const Span *", s2) result = _lib.span_eq(s1_converted, s2_converted) @@ -2370,7 +2326,9 @@ def span_eq(s1: "const Span *", s2: "const Span *") -> "bool": return result if result != _ffi.NULL else None -def span_ge(s1: "const Span *", s2: "const Span *") -> "bool": +def span_ge( + s1: Annotated[_ffi.CData, "const Span *"], s2: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[bool, "bool"]: s1_converted = _ffi.cast("const Span *", s1) s2_converted = _ffi.cast("const Span *", s2) result = _lib.span_ge(s1_converted, s2_converted) @@ -2378,7 +2336,9 @@ def span_ge(s1: "const Span *", s2: "const Span *") -> "bool": return result if result != _ffi.NULL else None -def span_gt(s1: "const Span *", s2: "const Span *") -> "bool": +def span_gt( + s1: Annotated[_ffi.CData, "const Span *"], s2: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[bool, "bool"]: s1_converted = _ffi.cast("const Span *", s1) s2_converted = _ffi.cast("const Span *", s2) result = _lib.span_gt(s1_converted, s2_converted) @@ -2386,7 +2346,9 @@ def span_gt(s1: "const Span *", s2: "const Span *") -> "bool": return result if result != _ffi.NULL else None -def span_le(s1: "const Span *", s2: "const Span *") -> "bool": +def span_le( + s1: Annotated[_ffi.CData, "const Span *"], s2: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[bool, "bool"]: s1_converted = _ffi.cast("const Span *", s1) s2_converted = _ffi.cast("const Span *", s2) result = _lib.span_le(s1_converted, s2_converted) @@ -2394,7 +2356,9 @@ def span_le(s1: "const Span *", s2: "const Span *") -> "bool": return result if result != _ffi.NULL else None -def span_lt(s1: "const Span *", s2: "const Span *") -> "bool": +def span_lt( + s1: Annotated[_ffi.CData, "const Span *"], s2: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[bool, "bool"]: s1_converted = _ffi.cast("const Span *", s1) s2_converted = _ffi.cast("const Span *", s2) result = _lib.span_lt(s1_converted, s2_converted) @@ -2402,7 +2366,9 @@ def span_lt(s1: "const Span *", s2: "const Span *") -> "bool": return result if result != _ffi.NULL else None -def span_ne(s1: "const Span *", s2: "const Span *") -> "bool": +def span_ne( + s1: Annotated[_ffi.CData, "const Span *"], s2: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[bool, "bool"]: s1_converted = _ffi.cast("const Span *", s1) s2_converted = _ffi.cast("const Span *", s2) result = _lib.span_ne(s1_converted, s2_converted) @@ -2410,7 +2376,9 @@ def span_ne(s1: "const Span *", s2: "const Span *") -> "bool": return result if result != _ffi.NULL else None -def spanset_cmp(ss1: "const SpanSet *", ss2: "const SpanSet *") -> "int": +def spanset_cmp( + ss1: Annotated[_ffi.CData, "const SpanSet *"], ss2: Annotated[_ffi.CData, "const SpanSet *"] +) -> Annotated[int, "int"]: ss1_converted = _ffi.cast("const SpanSet *", ss1) ss2_converted = _ffi.cast("const SpanSet *", ss2) result = _lib.spanset_cmp(ss1_converted, ss2_converted) @@ -2418,7 +2386,9 @@ def spanset_cmp(ss1: "const SpanSet *", ss2: "const SpanSet *") -> "int": return result if result != _ffi.NULL else None -def spanset_eq(ss1: "const SpanSet *", ss2: "const SpanSet *") -> "bool": +def spanset_eq( + ss1: Annotated[_ffi.CData, "const SpanSet *"], ss2: Annotated[_ffi.CData, "const SpanSet *"] +) -> Annotated[bool, "bool"]: ss1_converted = _ffi.cast("const SpanSet *", ss1) ss2_converted = _ffi.cast("const SpanSet *", ss2) result = _lib.spanset_eq(ss1_converted, ss2_converted) @@ -2426,7 +2396,9 @@ def spanset_eq(ss1: "const SpanSet *", ss2: "const SpanSet *") -> "bool": return result if result != _ffi.NULL else None -def spanset_ge(ss1: "const SpanSet *", ss2: "const SpanSet *") -> "bool": +def spanset_ge( + ss1: Annotated[_ffi.CData, "const SpanSet *"], ss2: Annotated[_ffi.CData, "const SpanSet *"] +) -> Annotated[bool, "bool"]: ss1_converted = _ffi.cast("const SpanSet *", ss1) ss2_converted = _ffi.cast("const SpanSet *", ss2) result = _lib.spanset_ge(ss1_converted, ss2_converted) @@ -2434,7 +2406,9 @@ def spanset_ge(ss1: "const SpanSet *", ss2: "const SpanSet *") -> "bool": return result if result != _ffi.NULL else None -def spanset_gt(ss1: "const SpanSet *", ss2: "const SpanSet *") -> "bool": +def spanset_gt( + ss1: Annotated[_ffi.CData, "const SpanSet *"], ss2: Annotated[_ffi.CData, "const SpanSet *"] +) -> Annotated[bool, "bool"]: ss1_converted = _ffi.cast("const SpanSet *", ss1) ss2_converted = _ffi.cast("const SpanSet *", ss2) result = _lib.spanset_gt(ss1_converted, ss2_converted) @@ -2442,7 +2416,9 @@ def spanset_gt(ss1: "const SpanSet *", ss2: "const SpanSet *") -> "bool": return result if result != _ffi.NULL else None -def spanset_le(ss1: "const SpanSet *", ss2: "const SpanSet *") -> "bool": +def spanset_le( + ss1: Annotated[_ffi.CData, "const SpanSet *"], ss2: Annotated[_ffi.CData, "const SpanSet *"] +) -> Annotated[bool, "bool"]: ss1_converted = _ffi.cast("const SpanSet *", ss1) ss2_converted = _ffi.cast("const SpanSet *", ss2) result = _lib.spanset_le(ss1_converted, ss2_converted) @@ -2450,7 +2426,9 @@ def spanset_le(ss1: "const SpanSet *", ss2: "const SpanSet *") -> "bool": return result if result != _ffi.NULL else None -def spanset_lt(ss1: "const SpanSet *", ss2: "const SpanSet *") -> "bool": +def spanset_lt( + ss1: Annotated[_ffi.CData, "const SpanSet *"], ss2: Annotated[_ffi.CData, "const SpanSet *"] +) -> Annotated[bool, "bool"]: ss1_converted = _ffi.cast("const SpanSet *", ss1) ss2_converted = _ffi.cast("const SpanSet *", ss2) result = _lib.spanset_lt(ss1_converted, ss2_converted) @@ -2458,7 +2436,9 @@ def spanset_lt(ss1: "const SpanSet *", ss2: "const SpanSet *") -> "bool": return result if result != _ffi.NULL else None -def spanset_ne(ss1: "const SpanSet *", ss2: "const SpanSet *") -> "bool": +def spanset_ne( + ss1: Annotated[_ffi.CData, "const SpanSet *"], ss2: Annotated[_ffi.CData, "const SpanSet *"] +) -> Annotated[bool, "bool"]: ss1_converted = _ffi.cast("const SpanSet *", ss1) ss2_converted = _ffi.cast("const SpanSet *", ss2) result = _lib.spanset_ne(ss1_converted, ss2_converted) @@ -2466,7 +2446,61 @@ def spanset_ne(ss1: "const SpanSet *", ss2: "const SpanSet *") -> "bool": return result if result != _ffi.NULL else None -def adjacent_span_bigint(s: "const Span *", i: int) -> "bool": +def set_spans(s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[_ffi.CData, "Span *"]: + s_converted = _ffi.cast("const Set *", s) + result = _lib.set_spans(s_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def set_split_each_n_spans( + s: Annotated[_ffi.CData, "const Set *"], elems_per_span: int, count: Annotated[_ffi.CData, "int *"] +) -> Annotated[_ffi.CData, "Span *"]: + s_converted = _ffi.cast("const Set *", s) + count_converted = _ffi.cast("int *", count) + result = _lib.set_split_each_n_spans(s_converted, elems_per_span, count_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def set_split_n_spans( + s: Annotated[_ffi.CData, "const Set *"], span_count: int, count: Annotated[_ffi.CData, "int *"] +) -> Annotated[_ffi.CData, "Span *"]: + s_converted = _ffi.cast("const Set *", s) + count_converted = _ffi.cast("int *", count) + result = _lib.set_split_n_spans(s_converted, span_count, count_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def spanset_spans(ss: Annotated[_ffi.CData, "const SpanSet *"]) -> Annotated[_ffi.CData, "Span *"]: + ss_converted = _ffi.cast("const SpanSet *", ss) + result = _lib.spanset_spans(ss_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def spanset_split_each_n_spans( + ss: Annotated[_ffi.CData, "const SpanSet *"], elems_per_span: int, count: Annotated[_ffi.CData, "int *"] +) -> Annotated[_ffi.CData, "Span *"]: + ss_converted = _ffi.cast("const SpanSet *", ss) + count_converted = _ffi.cast("int *", count) + result = _lib.spanset_split_each_n_spans(ss_converted, elems_per_span, count_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def spanset_split_n_spans( + ss: Annotated[_ffi.CData, "const SpanSet *"], span_count: int, count: Annotated[_ffi.CData, "int *"] +) -> Annotated[_ffi.CData, "Span *"]: + ss_converted = _ffi.cast("const SpanSet *", ss) + count_converted = _ffi.cast("int *", count) + result = _lib.spanset_split_n_spans(ss_converted, span_count, count_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def adjacent_span_bigint(s: Annotated[_ffi.CData, "const Span *"], i: int) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Span *", s) i_converted = _ffi.cast("int64", i) result = _lib.adjacent_span_bigint(s_converted, i_converted) @@ -2474,7 +2508,7 @@ def adjacent_span_bigint(s: "const Span *", i: int) -> "bool": return result if result != _ffi.NULL else None -def adjacent_span_date(s: "const Span *", d: "DateADT") -> "bool": +def adjacent_span_date(s: Annotated[_ffi.CData, "const Span *"], d: int) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Span *", s) d_converted = _ffi.cast("DateADT", d) result = _lib.adjacent_span_date(s_converted, d_converted) @@ -2482,21 +2516,23 @@ def adjacent_span_date(s: "const Span *", d: "DateADT") -> "bool": return result if result != _ffi.NULL else None -def adjacent_span_float(s: "const Span *", d: float) -> "bool": +def adjacent_span_float(s: Annotated[_ffi.CData, "const Span *"], d: float) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Span *", s) result = _lib.adjacent_span_float(s_converted, d) _check_error() return result if result != _ffi.NULL else None -def adjacent_span_int(s: "const Span *", i: int) -> "bool": +def adjacent_span_int(s: Annotated[_ffi.CData, "const Span *"], i: int) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Span *", s) result = _lib.adjacent_span_int(s_converted, i) _check_error() return result if result != _ffi.NULL else None -def adjacent_span_span(s1: "const Span *", s2: "const Span *") -> "bool": +def adjacent_span_span( + s1: Annotated[_ffi.CData, "const Span *"], s2: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[bool, "bool"]: s1_converted = _ffi.cast("const Span *", s1) s2_converted = _ffi.cast("const Span *", s2) result = _lib.adjacent_span_span(s1_converted, s2_converted) @@ -2504,7 +2540,9 @@ def adjacent_span_span(s1: "const Span *", s2: "const Span *") -> "bool": return result if result != _ffi.NULL else None -def adjacent_span_spanset(s: "const Span *", ss: "const SpanSet *") -> "bool": +def adjacent_span_spanset( + s: Annotated[_ffi.CData, "const Span *"], ss: Annotated[_ffi.CData, "const SpanSet *"] +) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Span *", s) ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.adjacent_span_spanset(s_converted, ss_converted) @@ -2512,7 +2550,7 @@ def adjacent_span_spanset(s: "const Span *", ss: "const SpanSet *") -> "bool": return result if result != _ffi.NULL else None -def adjacent_span_timestamptz(s: "const Span *", t: int) -> "bool": +def adjacent_span_timestamptz(s: Annotated[_ffi.CData, "const Span *"], t: int) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Span *", s) t_converted = _ffi.cast("TimestampTz", t) result = _lib.adjacent_span_timestamptz(s_converted, t_converted) @@ -2520,7 +2558,7 @@ def adjacent_span_timestamptz(s: "const Span *", t: int) -> "bool": return result if result != _ffi.NULL else None -def adjacent_spanset_bigint(ss: "const SpanSet *", i: int) -> "bool": +def adjacent_spanset_bigint(ss: Annotated[_ffi.CData, "const SpanSet *"], i: int) -> Annotated[bool, "bool"]: ss_converted = _ffi.cast("const SpanSet *", ss) i_converted = _ffi.cast("int64", i) result = _lib.adjacent_spanset_bigint(ss_converted, i_converted) @@ -2528,7 +2566,7 @@ def adjacent_spanset_bigint(ss: "const SpanSet *", i: int) -> "bool": return result if result != _ffi.NULL else None -def adjacent_spanset_date(ss: "const SpanSet *", d: "DateADT") -> "bool": +def adjacent_spanset_date(ss: Annotated[_ffi.CData, "const SpanSet *"], d: int) -> Annotated[bool, "bool"]: ss_converted = _ffi.cast("const SpanSet *", ss) d_converted = _ffi.cast("DateADT", d) result = _lib.adjacent_spanset_date(ss_converted, d_converted) @@ -2536,21 +2574,21 @@ def adjacent_spanset_date(ss: "const SpanSet *", d: "DateADT") -> "bool": return result if result != _ffi.NULL else None -def adjacent_spanset_float(ss: "const SpanSet *", d: float) -> "bool": +def adjacent_spanset_float(ss: Annotated[_ffi.CData, "const SpanSet *"], d: float) -> Annotated[bool, "bool"]: ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.adjacent_spanset_float(ss_converted, d) _check_error() return result if result != _ffi.NULL else None -def adjacent_spanset_int(ss: "const SpanSet *", i: int) -> "bool": +def adjacent_spanset_int(ss: Annotated[_ffi.CData, "const SpanSet *"], i: int) -> Annotated[bool, "bool"]: ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.adjacent_spanset_int(ss_converted, i) _check_error() return result if result != _ffi.NULL else None -def adjacent_spanset_timestamptz(ss: "const SpanSet *", t: int) -> "bool": +def adjacent_spanset_timestamptz(ss: Annotated[_ffi.CData, "const SpanSet *"], t: int) -> Annotated[bool, "bool"]: ss_converted = _ffi.cast("const SpanSet *", ss) t_converted = _ffi.cast("TimestampTz", t) result = _lib.adjacent_spanset_timestamptz(ss_converted, t_converted) @@ -2558,7 +2596,9 @@ def adjacent_spanset_timestamptz(ss: "const SpanSet *", t: int) -> "bool": return result if result != _ffi.NULL else None -def adjacent_spanset_span(ss: "const SpanSet *", s: "const Span *") -> "bool": +def adjacent_spanset_span( + ss: Annotated[_ffi.CData, "const SpanSet *"], s: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[bool, "bool"]: ss_converted = _ffi.cast("const SpanSet *", ss) s_converted = _ffi.cast("const Span *", s) result = _lib.adjacent_spanset_span(ss_converted, s_converted) @@ -2566,7 +2606,9 @@ def adjacent_spanset_span(ss: "const SpanSet *", s: "const Span *") -> "bool": return result if result != _ffi.NULL else None -def adjacent_spanset_spanset(ss1: "const SpanSet *", ss2: "const SpanSet *") -> "bool": +def adjacent_spanset_spanset( + ss1: Annotated[_ffi.CData, "const SpanSet *"], ss2: Annotated[_ffi.CData, "const SpanSet *"] +) -> Annotated[bool, "bool"]: ss1_converted = _ffi.cast("const SpanSet *", ss1) ss2_converted = _ffi.cast("const SpanSet *", ss2) result = _lib.adjacent_spanset_spanset(ss1_converted, ss2_converted) @@ -2574,7 +2616,7 @@ def adjacent_spanset_spanset(ss1: "const SpanSet *", ss2: "const SpanSet *") -> return result if result != _ffi.NULL else None -def contained_bigint_set(i: int, s: "const Set *") -> "bool": +def contained_bigint_set(i: int, s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[bool, "bool"]: i_converted = _ffi.cast("int64", i) s_converted = _ffi.cast("const Set *", s) result = _lib.contained_bigint_set(i_converted, s_converted) @@ -2582,7 +2624,7 @@ def contained_bigint_set(i: int, s: "const Set *") -> "bool": return result if result != _ffi.NULL else None -def contained_bigint_span(i: int, s: "const Span *") -> "bool": +def contained_bigint_span(i: int, s: Annotated[_ffi.CData, "const Span *"]) -> Annotated[bool, "bool"]: i_converted = _ffi.cast("int64", i) s_converted = _ffi.cast("const Span *", s) result = _lib.contained_bigint_span(i_converted, s_converted) @@ -2590,7 +2632,7 @@ def contained_bigint_span(i: int, s: "const Span *") -> "bool": return result if result != _ffi.NULL else None -def contained_bigint_spanset(i: int, ss: "const SpanSet *") -> "bool": +def contained_bigint_spanset(i: int, ss: Annotated[_ffi.CData, "const SpanSet *"]) -> Annotated[bool, "bool"]: i_converted = _ffi.cast("int64", i) ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.contained_bigint_spanset(i_converted, ss_converted) @@ -2598,7 +2640,7 @@ def contained_bigint_spanset(i: int, ss: "const SpanSet *") -> "bool": return result if result != _ffi.NULL else None -def contained_date_set(d: "DateADT", s: "const Set *") -> "bool": +def contained_date_set(d: int, s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[bool, "bool"]: d_converted = _ffi.cast("DateADT", d) s_converted = _ffi.cast("const Set *", s) result = _lib.contained_date_set(d_converted, s_converted) @@ -2606,7 +2648,7 @@ def contained_date_set(d: "DateADT", s: "const Set *") -> "bool": return result if result != _ffi.NULL else None -def contained_date_span(d: "DateADT", s: "const Span *") -> "bool": +def contained_date_span(d: int, s: Annotated[_ffi.CData, "const Span *"]) -> Annotated[bool, "bool"]: d_converted = _ffi.cast("DateADT", d) s_converted = _ffi.cast("const Span *", s) result = _lib.contained_date_span(d_converted, s_converted) @@ -2614,7 +2656,7 @@ def contained_date_span(d: "DateADT", s: "const Span *") -> "bool": return result if result != _ffi.NULL else None -def contained_date_spanset(d: "DateADT", ss: "const SpanSet *") -> "bool": +def contained_date_spanset(d: int, ss: Annotated[_ffi.CData, "const SpanSet *"]) -> Annotated[bool, "bool"]: d_converted = _ffi.cast("DateADT", d) ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.contained_date_spanset(d_converted, ss_converted) @@ -2622,57 +2664,51 @@ def contained_date_spanset(d: "DateADT", ss: "const SpanSet *") -> "bool": return result if result != _ffi.NULL else None -def contained_float_set(d: float, s: "const Set *") -> "bool": +def contained_float_set(d: float, s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Set *", s) result = _lib.contained_float_set(d, s_converted) _check_error() return result if result != _ffi.NULL else None -def contained_float_span(d: float, s: "const Span *") -> "bool": +def contained_float_span(d: float, s: Annotated[_ffi.CData, "const Span *"]) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Span *", s) result = _lib.contained_float_span(d, s_converted) _check_error() return result if result != _ffi.NULL else None -def contained_float_spanset(d: float, ss: "const SpanSet *") -> "bool": +def contained_float_spanset(d: float, ss: Annotated[_ffi.CData, "const SpanSet *"]) -> Annotated[bool, "bool"]: ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.contained_float_spanset(d, ss_converted) _check_error() return result if result != _ffi.NULL else None -def contained_geo_set(gs: "GSERIALIZED *", s: "const Set *") -> "bool": - gs_converted = _ffi.cast("GSERIALIZED *", gs) - s_converted = _ffi.cast("const Set *", s) - result = _lib.contained_geo_set(gs_converted, s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def contained_int_set(i: int, s: "const Set *") -> "bool": +def contained_int_set(i: int, s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Set *", s) result = _lib.contained_int_set(i, s_converted) _check_error() return result if result != _ffi.NULL else None -def contained_int_span(i: int, s: "const Span *") -> "bool": +def contained_int_span(i: int, s: Annotated[_ffi.CData, "const Span *"]) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Span *", s) result = _lib.contained_int_span(i, s_converted) _check_error() return result if result != _ffi.NULL else None -def contained_int_spanset(i: int, ss: "const SpanSet *") -> "bool": +def contained_int_spanset(i: int, ss: Annotated[_ffi.CData, "const SpanSet *"]) -> Annotated[bool, "bool"]: ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.contained_int_spanset(i, ss_converted) _check_error() return result if result != _ffi.NULL else None -def contained_set_set(s1: "const Set *", s2: "const Set *") -> "bool": +def contained_set_set( + s1: Annotated[_ffi.CData, "const Set *"], s2: Annotated[_ffi.CData, "const Set *"] +) -> Annotated[bool, "bool"]: s1_converted = _ffi.cast("const Set *", s1) s2_converted = _ffi.cast("const Set *", s2) result = _lib.contained_set_set(s1_converted, s2_converted) @@ -2680,7 +2716,9 @@ def contained_set_set(s1: "const Set *", s2: "const Set *") -> "bool": return result if result != _ffi.NULL else None -def contained_span_span(s1: "const Span *", s2: "const Span *") -> "bool": +def contained_span_span( + s1: Annotated[_ffi.CData, "const Span *"], s2: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[bool, "bool"]: s1_converted = _ffi.cast("const Span *", s1) s2_converted = _ffi.cast("const Span *", s2) result = _lib.contained_span_span(s1_converted, s2_converted) @@ -2688,7 +2726,9 @@ def contained_span_span(s1: "const Span *", s2: "const Span *") -> "bool": return result if result != _ffi.NULL else None -def contained_span_spanset(s: "const Span *", ss: "const SpanSet *") -> "bool": +def contained_span_spanset( + s: Annotated[_ffi.CData, "const Span *"], ss: Annotated[_ffi.CData, "const SpanSet *"] +) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Span *", s) ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.contained_span_spanset(s_converted, ss_converted) @@ -2696,7 +2736,9 @@ def contained_span_spanset(s: "const Span *", ss: "const SpanSet *") -> "bool": return result if result != _ffi.NULL else None -def contained_spanset_span(ss: "const SpanSet *", s: "const Span *") -> "bool": +def contained_spanset_span( + ss: Annotated[_ffi.CData, "const SpanSet *"], s: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[bool, "bool"]: ss_converted = _ffi.cast("const SpanSet *", ss) s_converted = _ffi.cast("const Span *", s) result = _lib.contained_spanset_span(ss_converted, s_converted) @@ -2704,7 +2746,9 @@ def contained_spanset_span(ss: "const SpanSet *", s: "const Span *") -> "bool": return result if result != _ffi.NULL else None -def contained_spanset_spanset(ss1: "const SpanSet *", ss2: "const SpanSet *") -> "bool": +def contained_spanset_spanset( + ss1: Annotated[_ffi.CData, "const SpanSet *"], ss2: Annotated[_ffi.CData, "const SpanSet *"] +) -> Annotated[bool, "bool"]: ss1_converted = _ffi.cast("const SpanSet *", ss1) ss2_converted = _ffi.cast("const SpanSet *", ss2) result = _lib.contained_spanset_spanset(ss1_converted, ss2_converted) @@ -2712,7 +2756,7 @@ def contained_spanset_spanset(ss1: "const SpanSet *", ss2: "const SpanSet *") -> return result if result != _ffi.NULL else None -def contained_text_set(txt: str, s: "const Set *") -> "bool": +def contained_text_set(txt: str, s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[bool, "bool"]: txt_converted = cstring2text(txt) s_converted = _ffi.cast("const Set *", s) result = _lib.contained_text_set(txt_converted, s_converted) @@ -2720,7 +2764,7 @@ def contained_text_set(txt: str, s: "const Set *") -> "bool": return result if result != _ffi.NULL else None -def contained_timestamptz_set(t: int, s: "const Set *") -> "bool": +def contained_timestamptz_set(t: int, s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[bool, "bool"]: t_converted = _ffi.cast("TimestampTz", t) s_converted = _ffi.cast("const Set *", s) result = _lib.contained_timestamptz_set(t_converted, s_converted) @@ -2728,7 +2772,7 @@ def contained_timestamptz_set(t: int, s: "const Set *") -> "bool": return result if result != _ffi.NULL else None -def contained_timestamptz_span(t: int, s: "const Span *") -> "bool": +def contained_timestamptz_span(t: int, s: Annotated[_ffi.CData, "const Span *"]) -> Annotated[bool, "bool"]: t_converted = _ffi.cast("TimestampTz", t) s_converted = _ffi.cast("const Span *", s) result = _lib.contained_timestamptz_span(t_converted, s_converted) @@ -2736,7 +2780,7 @@ def contained_timestamptz_span(t: int, s: "const Span *") -> "bool": return result if result != _ffi.NULL else None -def contained_timestamptz_spanset(t: int, ss: "const SpanSet *") -> "bool": +def contained_timestamptz_spanset(t: int, ss: Annotated[_ffi.CData, "const SpanSet *"]) -> Annotated[bool, "bool"]: t_converted = _ffi.cast("TimestampTz", t) ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.contained_timestamptz_spanset(t_converted, ss_converted) @@ -2744,7 +2788,7 @@ def contained_timestamptz_spanset(t: int, ss: "const SpanSet *") -> "bool": return result if result != _ffi.NULL else None -def contains_set_bigint(s: "const Set *", i: int) -> "bool": +def contains_set_bigint(s: Annotated[_ffi.CData, "const Set *"], i: int) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Set *", s) i_converted = _ffi.cast("int64", i) result = _lib.contains_set_bigint(s_converted, i_converted) @@ -2752,7 +2796,7 @@ def contains_set_bigint(s: "const Set *", i: int) -> "bool": return result if result != _ffi.NULL else None -def contains_set_date(s: "const Set *", d: "DateADT") -> "bool": +def contains_set_date(s: Annotated[_ffi.CData, "const Set *"], d: int) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Set *", s) d_converted = _ffi.cast("DateADT", d) result = _lib.contains_set_date(s_converted, d_converted) @@ -2760,29 +2804,23 @@ def contains_set_date(s: "const Set *", d: "DateADT") -> "bool": return result if result != _ffi.NULL else None -def contains_set_float(s: "const Set *", d: float) -> "bool": +def contains_set_float(s: Annotated[_ffi.CData, "const Set *"], d: float) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Set *", s) result = _lib.contains_set_float(s_converted, d) _check_error() return result if result != _ffi.NULL else None -def contains_set_geo(s: "const Set *", gs: "GSERIALIZED *") -> "bool": - s_converted = _ffi.cast("const Set *", s) - gs_converted = _ffi.cast("GSERIALIZED *", gs) - result = _lib.contains_set_geo(s_converted, gs_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def contains_set_int(s: "const Set *", i: int) -> "bool": +def contains_set_int(s: Annotated[_ffi.CData, "const Set *"], i: int) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Set *", s) result = _lib.contains_set_int(s_converted, i) _check_error() return result if result != _ffi.NULL else None -def contains_set_set(s1: "const Set *", s2: "const Set *") -> "bool": +def contains_set_set( + s1: Annotated[_ffi.CData, "const Set *"], s2: Annotated[_ffi.CData, "const Set *"] +) -> Annotated[bool, "bool"]: s1_converted = _ffi.cast("const Set *", s1) s2_converted = _ffi.cast("const Set *", s2) result = _lib.contains_set_set(s1_converted, s2_converted) @@ -2790,7 +2828,7 @@ def contains_set_set(s1: "const Set *", s2: "const Set *") -> "bool": return result if result != _ffi.NULL else None -def contains_set_text(s: "const Set *", t: str) -> "bool": +def contains_set_text(s: Annotated[_ffi.CData, "const Set *"], t: str) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Set *", s) t_converted = cstring2text(t) result = _lib.contains_set_text(s_converted, t_converted) @@ -2798,7 +2836,7 @@ def contains_set_text(s: "const Set *", t: str) -> "bool": return result if result != _ffi.NULL else None -def contains_set_timestamptz(s: "const Set *", t: int) -> "bool": +def contains_set_timestamptz(s: Annotated[_ffi.CData, "const Set *"], t: int) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Set *", s) t_converted = _ffi.cast("TimestampTz", t) result = _lib.contains_set_timestamptz(s_converted, t_converted) @@ -2806,7 +2844,7 @@ def contains_set_timestamptz(s: "const Set *", t: int) -> "bool": return result if result != _ffi.NULL else None -def contains_span_bigint(s: "const Span *", i: int) -> "bool": +def contains_span_bigint(s: Annotated[_ffi.CData, "const Span *"], i: int) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Span *", s) i_converted = _ffi.cast("int64", i) result = _lib.contains_span_bigint(s_converted, i_converted) @@ -2814,7 +2852,7 @@ def contains_span_bigint(s: "const Span *", i: int) -> "bool": return result if result != _ffi.NULL else None -def contains_span_date(s: "const Span *", d: "DateADT") -> "bool": +def contains_span_date(s: Annotated[_ffi.CData, "const Span *"], d: int) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Span *", s) d_converted = _ffi.cast("DateADT", d) result = _lib.contains_span_date(s_converted, d_converted) @@ -2822,21 +2860,23 @@ def contains_span_date(s: "const Span *", d: "DateADT") -> "bool": return result if result != _ffi.NULL else None -def contains_span_float(s: "const Span *", d: float) -> "bool": +def contains_span_float(s: Annotated[_ffi.CData, "const Span *"], d: float) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Span *", s) result = _lib.contains_span_float(s_converted, d) _check_error() return result if result != _ffi.NULL else None -def contains_span_int(s: "const Span *", i: int) -> "bool": +def contains_span_int(s: Annotated[_ffi.CData, "const Span *"], i: int) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Span *", s) result = _lib.contains_span_int(s_converted, i) _check_error() return result if result != _ffi.NULL else None -def contains_span_span(s1: "const Span *", s2: "const Span *") -> "bool": +def contains_span_span( + s1: Annotated[_ffi.CData, "const Span *"], s2: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[bool, "bool"]: s1_converted = _ffi.cast("const Span *", s1) s2_converted = _ffi.cast("const Span *", s2) result = _lib.contains_span_span(s1_converted, s2_converted) @@ -2844,7 +2884,9 @@ def contains_span_span(s1: "const Span *", s2: "const Span *") -> "bool": return result if result != _ffi.NULL else None -def contains_span_spanset(s: "const Span *", ss: "const SpanSet *") -> "bool": +def contains_span_spanset( + s: Annotated[_ffi.CData, "const Span *"], ss: Annotated[_ffi.CData, "const SpanSet *"] +) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Span *", s) ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.contains_span_spanset(s_converted, ss_converted) @@ -2852,7 +2894,7 @@ def contains_span_spanset(s: "const Span *", ss: "const SpanSet *") -> "bool": return result if result != _ffi.NULL else None -def contains_span_timestamptz(s: "const Span *", t: int) -> "bool": +def contains_span_timestamptz(s: Annotated[_ffi.CData, "const Span *"], t: int) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Span *", s) t_converted = _ffi.cast("TimestampTz", t) result = _lib.contains_span_timestamptz(s_converted, t_converted) @@ -2860,7 +2902,7 @@ def contains_span_timestamptz(s: "const Span *", t: int) -> "bool": return result if result != _ffi.NULL else None -def contains_spanset_bigint(ss: "const SpanSet *", i: int) -> "bool": +def contains_spanset_bigint(ss: Annotated[_ffi.CData, "const SpanSet *"], i: int) -> Annotated[bool, "bool"]: ss_converted = _ffi.cast("const SpanSet *", ss) i_converted = _ffi.cast("int64", i) result = _lib.contains_spanset_bigint(ss_converted, i_converted) @@ -2868,7 +2910,7 @@ def contains_spanset_bigint(ss: "const SpanSet *", i: int) -> "bool": return result if result != _ffi.NULL else None -def contains_spanset_date(ss: "const SpanSet *", d: "DateADT") -> "bool": +def contains_spanset_date(ss: Annotated[_ffi.CData, "const SpanSet *"], d: int) -> Annotated[bool, "bool"]: ss_converted = _ffi.cast("const SpanSet *", ss) d_converted = _ffi.cast("DateADT", d) result = _lib.contains_spanset_date(ss_converted, d_converted) @@ -2876,21 +2918,23 @@ def contains_spanset_date(ss: "const SpanSet *", d: "DateADT") -> "bool": return result if result != _ffi.NULL else None -def contains_spanset_float(ss: "const SpanSet *", d: float) -> "bool": +def contains_spanset_float(ss: Annotated[_ffi.CData, "const SpanSet *"], d: float) -> Annotated[bool, "bool"]: ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.contains_spanset_float(ss_converted, d) _check_error() return result if result != _ffi.NULL else None -def contains_spanset_int(ss: "const SpanSet *", i: int) -> "bool": +def contains_spanset_int(ss: Annotated[_ffi.CData, "const SpanSet *"], i: int) -> Annotated[bool, "bool"]: ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.contains_spanset_int(ss_converted, i) _check_error() return result if result != _ffi.NULL else None -def contains_spanset_span(ss: "const SpanSet *", s: "const Span *") -> "bool": +def contains_spanset_span( + ss: Annotated[_ffi.CData, "const SpanSet *"], s: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[bool, "bool"]: ss_converted = _ffi.cast("const SpanSet *", ss) s_converted = _ffi.cast("const Span *", s) result = _lib.contains_spanset_span(ss_converted, s_converted) @@ -2898,7 +2942,9 @@ def contains_spanset_span(ss: "const SpanSet *", s: "const Span *") -> "bool": return result if result != _ffi.NULL else None -def contains_spanset_spanset(ss1: "const SpanSet *", ss2: "const SpanSet *") -> "bool": +def contains_spanset_spanset( + ss1: Annotated[_ffi.CData, "const SpanSet *"], ss2: Annotated[_ffi.CData, "const SpanSet *"] +) -> Annotated[bool, "bool"]: ss1_converted = _ffi.cast("const SpanSet *", ss1) ss2_converted = _ffi.cast("const SpanSet *", ss2) result = _lib.contains_spanset_spanset(ss1_converted, ss2_converted) @@ -2906,7 +2952,7 @@ def contains_spanset_spanset(ss1: "const SpanSet *", ss2: "const SpanSet *") -> return result if result != _ffi.NULL else None -def contains_spanset_timestamptz(ss: "const SpanSet *", t: int) -> "bool": +def contains_spanset_timestamptz(ss: Annotated[_ffi.CData, "const SpanSet *"], t: int) -> Annotated[bool, "bool"]: ss_converted = _ffi.cast("const SpanSet *", ss) t_converted = _ffi.cast("TimestampTz", t) result = _lib.contains_spanset_timestamptz(ss_converted, t_converted) @@ -2914,7 +2960,9 @@ def contains_spanset_timestamptz(ss: "const SpanSet *", t: int) -> "bool": return result if result != _ffi.NULL else None -def overlaps_set_set(s1: "const Set *", s2: "const Set *") -> "bool": +def overlaps_set_set( + s1: Annotated[_ffi.CData, "const Set *"], s2: Annotated[_ffi.CData, "const Set *"] +) -> Annotated[bool, "bool"]: s1_converted = _ffi.cast("const Set *", s1) s2_converted = _ffi.cast("const Set *", s2) result = _lib.overlaps_set_set(s1_converted, s2_converted) @@ -2922,7 +2970,9 @@ def overlaps_set_set(s1: "const Set *", s2: "const Set *") -> "bool": return result if result != _ffi.NULL else None -def overlaps_span_span(s1: "const Span *", s2: "const Span *") -> "bool": +def overlaps_span_span( + s1: Annotated[_ffi.CData, "const Span *"], s2: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[bool, "bool"]: s1_converted = _ffi.cast("const Span *", s1) s2_converted = _ffi.cast("const Span *", s2) result = _lib.overlaps_span_span(s1_converted, s2_converted) @@ -2930,7 +2980,9 @@ def overlaps_span_span(s1: "const Span *", s2: "const Span *") -> "bool": return result if result != _ffi.NULL else None -def overlaps_span_spanset(s: "const Span *", ss: "const SpanSet *") -> "bool": +def overlaps_span_spanset( + s: Annotated[_ffi.CData, "const Span *"], ss: Annotated[_ffi.CData, "const SpanSet *"] +) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Span *", s) ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.overlaps_span_spanset(s_converted, ss_converted) @@ -2938,7 +2990,9 @@ def overlaps_span_spanset(s: "const Span *", ss: "const SpanSet *") -> "bool": return result if result != _ffi.NULL else None -def overlaps_spanset_span(ss: "const SpanSet *", s: "const Span *") -> "bool": +def overlaps_spanset_span( + ss: Annotated[_ffi.CData, "const SpanSet *"], s: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[bool, "bool"]: ss_converted = _ffi.cast("const SpanSet *", ss) s_converted = _ffi.cast("const Span *", s) result = _lib.overlaps_spanset_span(ss_converted, s_converted) @@ -2946,7 +3000,9 @@ def overlaps_spanset_span(ss: "const SpanSet *", s: "const Span *") -> "bool": return result if result != _ffi.NULL else None -def overlaps_spanset_spanset(ss1: "const SpanSet *", ss2: "const SpanSet *") -> "bool": +def overlaps_spanset_spanset( + ss1: Annotated[_ffi.CData, "const SpanSet *"], ss2: Annotated[_ffi.CData, "const SpanSet *"] +) -> Annotated[bool, "bool"]: ss1_converted = _ffi.cast("const SpanSet *", ss1) ss2_converted = _ffi.cast("const SpanSet *", ss2) result = _lib.overlaps_spanset_spanset(ss1_converted, ss2_converted) @@ -2954,7 +3010,7 @@ def overlaps_spanset_spanset(ss1: "const SpanSet *", ss2: "const SpanSet *") -> return result if result != _ffi.NULL else None -def after_date_set(d: "DateADT", s: "const Set *") -> "bool": +def after_date_set(d: int, s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[bool, "bool"]: d_converted = _ffi.cast("DateADT", d) s_converted = _ffi.cast("const Set *", s) result = _lib.after_date_set(d_converted, s_converted) @@ -2962,7 +3018,7 @@ def after_date_set(d: "DateADT", s: "const Set *") -> "bool": return result if result != _ffi.NULL else None -def after_date_span(d: "DateADT", s: "const Span *") -> "bool": +def after_date_span(d: int, s: Annotated[_ffi.CData, "const Span *"]) -> Annotated[bool, "bool"]: d_converted = _ffi.cast("DateADT", d) s_converted = _ffi.cast("const Span *", s) result = _lib.after_date_span(d_converted, s_converted) @@ -2970,7 +3026,7 @@ def after_date_span(d: "DateADT", s: "const Span *") -> "bool": return result if result != _ffi.NULL else None -def after_date_spanset(d: "DateADT", ss: "const SpanSet *") -> "bool": +def after_date_spanset(d: int, ss: Annotated[_ffi.CData, "const SpanSet *"]) -> Annotated[bool, "bool"]: d_converted = _ffi.cast("DateADT", d) ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.after_date_spanset(d_converted, ss_converted) @@ -2978,7 +3034,7 @@ def after_date_spanset(d: "DateADT", ss: "const SpanSet *") -> "bool": return result if result != _ffi.NULL else None -def after_set_date(s: "const Set *", d: "DateADT") -> "bool": +def after_set_date(s: Annotated[_ffi.CData, "const Set *"], d: int) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Set *", s) d_converted = _ffi.cast("DateADT", d) result = _lib.after_set_date(s_converted, d_converted) @@ -2986,7 +3042,7 @@ def after_set_date(s: "const Set *", d: "DateADT") -> "bool": return result if result != _ffi.NULL else None -def after_set_timestamptz(s: "const Set *", t: int) -> "bool": +def after_set_timestamptz(s: Annotated[_ffi.CData, "const Set *"], t: int) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Set *", s) t_converted = _ffi.cast("TimestampTz", t) result = _lib.after_set_timestamptz(s_converted, t_converted) @@ -2994,7 +3050,7 @@ def after_set_timestamptz(s: "const Set *", t: int) -> "bool": return result if result != _ffi.NULL else None -def after_span_date(s: "const Span *", d: "DateADT") -> "bool": +def after_span_date(s: Annotated[_ffi.CData, "const Span *"], d: int) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Span *", s) d_converted = _ffi.cast("DateADT", d) result = _lib.after_span_date(s_converted, d_converted) @@ -3002,7 +3058,7 @@ def after_span_date(s: "const Span *", d: "DateADT") -> "bool": return result if result != _ffi.NULL else None -def after_span_timestamptz(s: "const Span *", t: int) -> "bool": +def after_span_timestamptz(s: Annotated[_ffi.CData, "const Span *"], t: int) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Span *", s) t_converted = _ffi.cast("TimestampTz", t) result = _lib.after_span_timestamptz(s_converted, t_converted) @@ -3010,7 +3066,7 @@ def after_span_timestamptz(s: "const Span *", t: int) -> "bool": return result if result != _ffi.NULL else None -def after_spanset_date(ss: "const SpanSet *", d: "DateADT") -> "bool": +def after_spanset_date(ss: Annotated[_ffi.CData, "const SpanSet *"], d: int) -> Annotated[bool, "bool"]: ss_converted = _ffi.cast("const SpanSet *", ss) d_converted = _ffi.cast("DateADT", d) result = _lib.after_spanset_date(ss_converted, d_converted) @@ -3018,7 +3074,7 @@ def after_spanset_date(ss: "const SpanSet *", d: "DateADT") -> "bool": return result if result != _ffi.NULL else None -def after_spanset_timestamptz(ss: "const SpanSet *", t: int) -> "bool": +def after_spanset_timestamptz(ss: Annotated[_ffi.CData, "const SpanSet *"], t: int) -> Annotated[bool, "bool"]: ss_converted = _ffi.cast("const SpanSet *", ss) t_converted = _ffi.cast("TimestampTz", t) result = _lib.after_spanset_timestamptz(ss_converted, t_converted) @@ -3026,7 +3082,7 @@ def after_spanset_timestamptz(ss: "const SpanSet *", t: int) -> "bool": return result if result != _ffi.NULL else None -def after_timestamptz_set(t: int, s: "const Set *") -> "bool": +def after_timestamptz_set(t: int, s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[bool, "bool"]: t_converted = _ffi.cast("TimestampTz", t) s_converted = _ffi.cast("const Set *", s) result = _lib.after_timestamptz_set(t_converted, s_converted) @@ -3034,7 +3090,7 @@ def after_timestamptz_set(t: int, s: "const Set *") -> "bool": return result if result != _ffi.NULL else None -def after_timestamptz_span(t: int, s: "const Span *") -> "bool": +def after_timestamptz_span(t: int, s: Annotated[_ffi.CData, "const Span *"]) -> Annotated[bool, "bool"]: t_converted = _ffi.cast("TimestampTz", t) s_converted = _ffi.cast("const Span *", s) result = _lib.after_timestamptz_span(t_converted, s_converted) @@ -3042,7 +3098,7 @@ def after_timestamptz_span(t: int, s: "const Span *") -> "bool": return result if result != _ffi.NULL else None -def after_timestamptz_spanset(t: int, ss: "const SpanSet *") -> "bool": +def after_timestamptz_spanset(t: int, ss: Annotated[_ffi.CData, "const SpanSet *"]) -> Annotated[bool, "bool"]: t_converted = _ffi.cast("TimestampTz", t) ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.after_timestamptz_spanset(t_converted, ss_converted) @@ -3050,7 +3106,7 @@ def after_timestamptz_spanset(t: int, ss: "const SpanSet *") -> "bool": return result if result != _ffi.NULL else None -def before_date_set(d: "DateADT", s: "const Set *") -> "bool": +def before_date_set(d: int, s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[bool, "bool"]: d_converted = _ffi.cast("DateADT", d) s_converted = _ffi.cast("const Set *", s) result = _lib.before_date_set(d_converted, s_converted) @@ -3058,7 +3114,7 @@ def before_date_set(d: "DateADT", s: "const Set *") -> "bool": return result if result != _ffi.NULL else None -def before_date_span(d: "DateADT", s: "const Span *") -> "bool": +def before_date_span(d: int, s: Annotated[_ffi.CData, "const Span *"]) -> Annotated[bool, "bool"]: d_converted = _ffi.cast("DateADT", d) s_converted = _ffi.cast("const Span *", s) result = _lib.before_date_span(d_converted, s_converted) @@ -3066,7 +3122,7 @@ def before_date_span(d: "DateADT", s: "const Span *") -> "bool": return result if result != _ffi.NULL else None -def before_date_spanset(d: "DateADT", ss: "const SpanSet *") -> "bool": +def before_date_spanset(d: int, ss: Annotated[_ffi.CData, "const SpanSet *"]) -> Annotated[bool, "bool"]: d_converted = _ffi.cast("DateADT", d) ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.before_date_spanset(d_converted, ss_converted) @@ -3074,7 +3130,7 @@ def before_date_spanset(d: "DateADT", ss: "const SpanSet *") -> "bool": return result if result != _ffi.NULL else None -def before_set_date(s: "const Set *", d: "DateADT") -> "bool": +def before_set_date(s: Annotated[_ffi.CData, "const Set *"], d: int) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Set *", s) d_converted = _ffi.cast("DateADT", d) result = _lib.before_set_date(s_converted, d_converted) @@ -3082,7 +3138,7 @@ def before_set_date(s: "const Set *", d: "DateADT") -> "bool": return result if result != _ffi.NULL else None -def before_set_timestamptz(s: "const Set *", t: int) -> "bool": +def before_set_timestamptz(s: Annotated[_ffi.CData, "const Set *"], t: int) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Set *", s) t_converted = _ffi.cast("TimestampTz", t) result = _lib.before_set_timestamptz(s_converted, t_converted) @@ -3090,7 +3146,7 @@ def before_set_timestamptz(s: "const Set *", t: int) -> "bool": return result if result != _ffi.NULL else None -def before_span_date(s: "const Span *", d: "DateADT") -> "bool": +def before_span_date(s: Annotated[_ffi.CData, "const Span *"], d: int) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Span *", s) d_converted = _ffi.cast("DateADT", d) result = _lib.before_span_date(s_converted, d_converted) @@ -3098,7 +3154,7 @@ def before_span_date(s: "const Span *", d: "DateADT") -> "bool": return result if result != _ffi.NULL else None -def before_span_timestamptz(s: "const Span *", t: int) -> "bool": +def before_span_timestamptz(s: Annotated[_ffi.CData, "const Span *"], t: int) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Span *", s) t_converted = _ffi.cast("TimestampTz", t) result = _lib.before_span_timestamptz(s_converted, t_converted) @@ -3106,7 +3162,7 @@ def before_span_timestamptz(s: "const Span *", t: int) -> "bool": return result if result != _ffi.NULL else None -def before_spanset_date(ss: "const SpanSet *", d: "DateADT") -> "bool": +def before_spanset_date(ss: Annotated[_ffi.CData, "const SpanSet *"], d: int) -> Annotated[bool, "bool"]: ss_converted = _ffi.cast("const SpanSet *", ss) d_converted = _ffi.cast("DateADT", d) result = _lib.before_spanset_date(ss_converted, d_converted) @@ -3114,7 +3170,7 @@ def before_spanset_date(ss: "const SpanSet *", d: "DateADT") -> "bool": return result if result != _ffi.NULL else None -def before_spanset_timestamptz(ss: "const SpanSet *", t: int) -> "bool": +def before_spanset_timestamptz(ss: Annotated[_ffi.CData, "const SpanSet *"], t: int) -> Annotated[bool, "bool"]: ss_converted = _ffi.cast("const SpanSet *", ss) t_converted = _ffi.cast("TimestampTz", t) result = _lib.before_spanset_timestamptz(ss_converted, t_converted) @@ -3122,7 +3178,7 @@ def before_spanset_timestamptz(ss: "const SpanSet *", t: int) -> "bool": return result if result != _ffi.NULL else None -def before_timestamptz_set(t: int, s: "const Set *") -> "bool": +def before_timestamptz_set(t: int, s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[bool, "bool"]: t_converted = _ffi.cast("TimestampTz", t) s_converted = _ffi.cast("const Set *", s) result = _lib.before_timestamptz_set(t_converted, s_converted) @@ -3130,7 +3186,7 @@ def before_timestamptz_set(t: int, s: "const Set *") -> "bool": return result if result != _ffi.NULL else None -def before_timestamptz_span(t: int, s: "const Span *") -> "bool": +def before_timestamptz_span(t: int, s: Annotated[_ffi.CData, "const Span *"]) -> Annotated[bool, "bool"]: t_converted = _ffi.cast("TimestampTz", t) s_converted = _ffi.cast("const Span *", s) result = _lib.before_timestamptz_span(t_converted, s_converted) @@ -3138,7 +3194,7 @@ def before_timestamptz_span(t: int, s: "const Span *") -> "bool": return result if result != _ffi.NULL else None -def before_timestamptz_spanset(t: int, ss: "const SpanSet *") -> "bool": +def before_timestamptz_spanset(t: int, ss: Annotated[_ffi.CData, "const SpanSet *"]) -> Annotated[bool, "bool"]: t_converted = _ffi.cast("TimestampTz", t) ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.before_timestamptz_spanset(t_converted, ss_converted) @@ -3146,7 +3202,7 @@ def before_timestamptz_spanset(t: int, ss: "const SpanSet *") -> "bool": return result if result != _ffi.NULL else None -def left_bigint_set(i: int, s: "const Set *") -> "bool": +def left_bigint_set(i: int, s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[bool, "bool"]: i_converted = _ffi.cast("int64", i) s_converted = _ffi.cast("const Set *", s) result = _lib.left_bigint_set(i_converted, s_converted) @@ -3154,7 +3210,7 @@ def left_bigint_set(i: int, s: "const Set *") -> "bool": return result if result != _ffi.NULL else None -def left_bigint_span(i: int, s: "const Span *") -> "bool": +def left_bigint_span(i: int, s: Annotated[_ffi.CData, "const Span *"]) -> Annotated[bool, "bool"]: i_converted = _ffi.cast("int64", i) s_converted = _ffi.cast("const Span *", s) result = _lib.left_bigint_span(i_converted, s_converted) @@ -3162,7 +3218,7 @@ def left_bigint_span(i: int, s: "const Span *") -> "bool": return result if result != _ffi.NULL else None -def left_bigint_spanset(i: int, ss: "const SpanSet *") -> "bool": +def left_bigint_spanset(i: int, ss: Annotated[_ffi.CData, "const SpanSet *"]) -> Annotated[bool, "bool"]: i_converted = _ffi.cast("int64", i) ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.left_bigint_spanset(i_converted, ss_converted) @@ -3170,49 +3226,49 @@ def left_bigint_spanset(i: int, ss: "const SpanSet *") -> "bool": return result if result != _ffi.NULL else None -def left_float_set(d: float, s: "const Set *") -> "bool": +def left_float_set(d: float, s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Set *", s) result = _lib.left_float_set(d, s_converted) _check_error() return result if result != _ffi.NULL else None -def left_float_span(d: float, s: "const Span *") -> "bool": +def left_float_span(d: float, s: Annotated[_ffi.CData, "const Span *"]) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Span *", s) result = _lib.left_float_span(d, s_converted) _check_error() return result if result != _ffi.NULL else None -def left_float_spanset(d: float, ss: "const SpanSet *") -> "bool": +def left_float_spanset(d: float, ss: Annotated[_ffi.CData, "const SpanSet *"]) -> Annotated[bool, "bool"]: ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.left_float_spanset(d, ss_converted) _check_error() return result if result != _ffi.NULL else None -def left_int_set(i: int, s: "const Set *") -> "bool": +def left_int_set(i: int, s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Set *", s) result = _lib.left_int_set(i, s_converted) _check_error() return result if result != _ffi.NULL else None -def left_int_span(i: int, s: "const Span *") -> "bool": +def left_int_span(i: int, s: Annotated[_ffi.CData, "const Span *"]) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Span *", s) result = _lib.left_int_span(i, s_converted) _check_error() return result if result != _ffi.NULL else None -def left_int_spanset(i: int, ss: "const SpanSet *") -> "bool": +def left_int_spanset(i: int, ss: Annotated[_ffi.CData, "const SpanSet *"]) -> Annotated[bool, "bool"]: ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.left_int_spanset(i, ss_converted) _check_error() return result if result != _ffi.NULL else None -def left_set_bigint(s: "const Set *", i: int) -> "bool": +def left_set_bigint(s: Annotated[_ffi.CData, "const Set *"], i: int) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Set *", s) i_converted = _ffi.cast("int64", i) result = _lib.left_set_bigint(s_converted, i_converted) @@ -3220,21 +3276,23 @@ def left_set_bigint(s: "const Set *", i: int) -> "bool": return result if result != _ffi.NULL else None -def left_set_float(s: "const Set *", d: float) -> "bool": +def left_set_float(s: Annotated[_ffi.CData, "const Set *"], d: float) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Set *", s) result = _lib.left_set_float(s_converted, d) _check_error() return result if result != _ffi.NULL else None -def left_set_int(s: "const Set *", i: int) -> "bool": +def left_set_int(s: Annotated[_ffi.CData, "const Set *"], i: int) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Set *", s) result = _lib.left_set_int(s_converted, i) _check_error() return result if result != _ffi.NULL else None -def left_set_set(s1: "const Set *", s2: "const Set *") -> "bool": +def left_set_set( + s1: Annotated[_ffi.CData, "const Set *"], s2: Annotated[_ffi.CData, "const Set *"] +) -> Annotated[bool, "bool"]: s1_converted = _ffi.cast("const Set *", s1) s2_converted = _ffi.cast("const Set *", s2) result = _lib.left_set_set(s1_converted, s2_converted) @@ -3242,7 +3300,7 @@ def left_set_set(s1: "const Set *", s2: "const Set *") -> "bool": return result if result != _ffi.NULL else None -def left_set_text(s: "const Set *", txt: str) -> "bool": +def left_set_text(s: Annotated[_ffi.CData, "const Set *"], txt: str) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Set *", s) txt_converted = cstring2text(txt) result = _lib.left_set_text(s_converted, txt_converted) @@ -3250,7 +3308,7 @@ def left_set_text(s: "const Set *", txt: str) -> "bool": return result if result != _ffi.NULL else None -def left_span_bigint(s: "const Span *", i: int) -> "bool": +def left_span_bigint(s: Annotated[_ffi.CData, "const Span *"], i: int) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Span *", s) i_converted = _ffi.cast("int64", i) result = _lib.left_span_bigint(s_converted, i_converted) @@ -3258,21 +3316,23 @@ def left_span_bigint(s: "const Span *", i: int) -> "bool": return result if result != _ffi.NULL else None -def left_span_float(s: "const Span *", d: float) -> "bool": +def left_span_float(s: Annotated[_ffi.CData, "const Span *"], d: float) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Span *", s) result = _lib.left_span_float(s_converted, d) _check_error() return result if result != _ffi.NULL else None -def left_span_int(s: "const Span *", i: int) -> "bool": +def left_span_int(s: Annotated[_ffi.CData, "const Span *"], i: int) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Span *", s) result = _lib.left_span_int(s_converted, i) _check_error() return result if result != _ffi.NULL else None -def left_span_span(s1: "const Span *", s2: "const Span *") -> "bool": +def left_span_span( + s1: Annotated[_ffi.CData, "const Span *"], s2: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[bool, "bool"]: s1_converted = _ffi.cast("const Span *", s1) s2_converted = _ffi.cast("const Span *", s2) result = _lib.left_span_span(s1_converted, s2_converted) @@ -3280,7 +3340,9 @@ def left_span_span(s1: "const Span *", s2: "const Span *") -> "bool": return result if result != _ffi.NULL else None -def left_span_spanset(s: "const Span *", ss: "const SpanSet *") -> "bool": +def left_span_spanset( + s: Annotated[_ffi.CData, "const Span *"], ss: Annotated[_ffi.CData, "const SpanSet *"] +) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Span *", s) ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.left_span_spanset(s_converted, ss_converted) @@ -3288,7 +3350,7 @@ def left_span_spanset(s: "const Span *", ss: "const SpanSet *") -> "bool": return result if result != _ffi.NULL else None -def left_spanset_bigint(ss: "const SpanSet *", i: int) -> "bool": +def left_spanset_bigint(ss: Annotated[_ffi.CData, "const SpanSet *"], i: int) -> Annotated[bool, "bool"]: ss_converted = _ffi.cast("const SpanSet *", ss) i_converted = _ffi.cast("int64", i) result = _lib.left_spanset_bigint(ss_converted, i_converted) @@ -3296,21 +3358,23 @@ def left_spanset_bigint(ss: "const SpanSet *", i: int) -> "bool": return result if result != _ffi.NULL else None -def left_spanset_float(ss: "const SpanSet *", d: float) -> "bool": +def left_spanset_float(ss: Annotated[_ffi.CData, "const SpanSet *"], d: float) -> Annotated[bool, "bool"]: ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.left_spanset_float(ss_converted, d) _check_error() return result if result != _ffi.NULL else None -def left_spanset_int(ss: "const SpanSet *", i: int) -> "bool": +def left_spanset_int(ss: Annotated[_ffi.CData, "const SpanSet *"], i: int) -> Annotated[bool, "bool"]: ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.left_spanset_int(ss_converted, i) _check_error() return result if result != _ffi.NULL else None -def left_spanset_span(ss: "const SpanSet *", s: "const Span *") -> "bool": +def left_spanset_span( + ss: Annotated[_ffi.CData, "const SpanSet *"], s: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[bool, "bool"]: ss_converted = _ffi.cast("const SpanSet *", ss) s_converted = _ffi.cast("const Span *", s) result = _lib.left_spanset_span(ss_converted, s_converted) @@ -3318,7 +3382,9 @@ def left_spanset_span(ss: "const SpanSet *", s: "const Span *") -> "bool": return result if result != _ffi.NULL else None -def left_spanset_spanset(ss1: "const SpanSet *", ss2: "const SpanSet *") -> "bool": +def left_spanset_spanset( + ss1: Annotated[_ffi.CData, "const SpanSet *"], ss2: Annotated[_ffi.CData, "const SpanSet *"] +) -> Annotated[bool, "bool"]: ss1_converted = _ffi.cast("const SpanSet *", ss1) ss2_converted = _ffi.cast("const SpanSet *", ss2) result = _lib.left_spanset_spanset(ss1_converted, ss2_converted) @@ -3326,7 +3392,7 @@ def left_spanset_spanset(ss1: "const SpanSet *", ss2: "const SpanSet *") -> "boo return result if result != _ffi.NULL else None -def left_text_set(txt: str, s: "const Set *") -> "bool": +def left_text_set(txt: str, s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[bool, "bool"]: txt_converted = cstring2text(txt) s_converted = _ffi.cast("const Set *", s) result = _lib.left_text_set(txt_converted, s_converted) @@ -3334,7 +3400,7 @@ def left_text_set(txt: str, s: "const Set *") -> "bool": return result if result != _ffi.NULL else None -def overafter_date_set(d: "DateADT", s: "const Set *") -> "bool": +def overafter_date_set(d: int, s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[bool, "bool"]: d_converted = _ffi.cast("DateADT", d) s_converted = _ffi.cast("const Set *", s) result = _lib.overafter_date_set(d_converted, s_converted) @@ -3342,7 +3408,7 @@ def overafter_date_set(d: "DateADT", s: "const Set *") -> "bool": return result if result != _ffi.NULL else None -def overafter_date_span(d: "DateADT", s: "const Span *") -> "bool": +def overafter_date_span(d: int, s: Annotated[_ffi.CData, "const Span *"]) -> Annotated[bool, "bool"]: d_converted = _ffi.cast("DateADT", d) s_converted = _ffi.cast("const Span *", s) result = _lib.overafter_date_span(d_converted, s_converted) @@ -3350,7 +3416,7 @@ def overafter_date_span(d: "DateADT", s: "const Span *") -> "bool": return result if result != _ffi.NULL else None -def overafter_date_spanset(d: "DateADT", ss: "const SpanSet *") -> "bool": +def overafter_date_spanset(d: int, ss: Annotated[_ffi.CData, "const SpanSet *"]) -> Annotated[bool, "bool"]: d_converted = _ffi.cast("DateADT", d) ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.overafter_date_spanset(d_converted, ss_converted) @@ -3358,7 +3424,7 @@ def overafter_date_spanset(d: "DateADT", ss: "const SpanSet *") -> "bool": return result if result != _ffi.NULL else None -def overafter_set_date(s: "const Set *", d: "DateADT") -> "bool": +def overafter_set_date(s: Annotated[_ffi.CData, "const Set *"], d: int) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Set *", s) d_converted = _ffi.cast("DateADT", d) result = _lib.overafter_set_date(s_converted, d_converted) @@ -3366,7 +3432,7 @@ def overafter_set_date(s: "const Set *", d: "DateADT") -> "bool": return result if result != _ffi.NULL else None -def overafter_set_timestamptz(s: "const Set *", t: int) -> "bool": +def overafter_set_timestamptz(s: Annotated[_ffi.CData, "const Set *"], t: int) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Set *", s) t_converted = _ffi.cast("TimestampTz", t) result = _lib.overafter_set_timestamptz(s_converted, t_converted) @@ -3374,7 +3440,7 @@ def overafter_set_timestamptz(s: "const Set *", t: int) -> "bool": return result if result != _ffi.NULL else None -def overafter_span_date(s: "const Span *", d: "DateADT") -> "bool": +def overafter_span_date(s: Annotated[_ffi.CData, "const Span *"], d: int) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Span *", s) d_converted = _ffi.cast("DateADT", d) result = _lib.overafter_span_date(s_converted, d_converted) @@ -3382,7 +3448,7 @@ def overafter_span_date(s: "const Span *", d: "DateADT") -> "bool": return result if result != _ffi.NULL else None -def overafter_span_timestamptz(s: "const Span *", t: int) -> "bool": +def overafter_span_timestamptz(s: Annotated[_ffi.CData, "const Span *"], t: int) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Span *", s) t_converted = _ffi.cast("TimestampTz", t) result = _lib.overafter_span_timestamptz(s_converted, t_converted) @@ -3390,7 +3456,7 @@ def overafter_span_timestamptz(s: "const Span *", t: int) -> "bool": return result if result != _ffi.NULL else None -def overafter_spanset_date(ss: "const SpanSet *", d: "DateADT") -> "bool": +def overafter_spanset_date(ss: Annotated[_ffi.CData, "const SpanSet *"], d: int) -> Annotated[bool, "bool"]: ss_converted = _ffi.cast("const SpanSet *", ss) d_converted = _ffi.cast("DateADT", d) result = _lib.overafter_spanset_date(ss_converted, d_converted) @@ -3398,7 +3464,7 @@ def overafter_spanset_date(ss: "const SpanSet *", d: "DateADT") -> "bool": return result if result != _ffi.NULL else None -def overafter_spanset_timestamptz(ss: "const SpanSet *", t: int) -> "bool": +def overafter_spanset_timestamptz(ss: Annotated[_ffi.CData, "const SpanSet *"], t: int) -> Annotated[bool, "bool"]: ss_converted = _ffi.cast("const SpanSet *", ss) t_converted = _ffi.cast("TimestampTz", t) result = _lib.overafter_spanset_timestamptz(ss_converted, t_converted) @@ -3406,7 +3472,7 @@ def overafter_spanset_timestamptz(ss: "const SpanSet *", t: int) -> "bool": return result if result != _ffi.NULL else None -def overafter_timestamptz_set(t: int, s: "const Set *") -> "bool": +def overafter_timestamptz_set(t: int, s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[bool, "bool"]: t_converted = _ffi.cast("TimestampTz", t) s_converted = _ffi.cast("const Set *", s) result = _lib.overafter_timestamptz_set(t_converted, s_converted) @@ -3414,7 +3480,7 @@ def overafter_timestamptz_set(t: int, s: "const Set *") -> "bool": return result if result != _ffi.NULL else None -def overafter_timestamptz_span(t: int, s: "const Span *") -> "bool": +def overafter_timestamptz_span(t: int, s: Annotated[_ffi.CData, "const Span *"]) -> Annotated[bool, "bool"]: t_converted = _ffi.cast("TimestampTz", t) s_converted = _ffi.cast("const Span *", s) result = _lib.overafter_timestamptz_span(t_converted, s_converted) @@ -3422,7 +3488,7 @@ def overafter_timestamptz_span(t: int, s: "const Span *") -> "bool": return result if result != _ffi.NULL else None -def overafter_timestamptz_spanset(t: int, ss: "const SpanSet *") -> "bool": +def overafter_timestamptz_spanset(t: int, ss: Annotated[_ffi.CData, "const SpanSet *"]) -> Annotated[bool, "bool"]: t_converted = _ffi.cast("TimestampTz", t) ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.overafter_timestamptz_spanset(t_converted, ss_converted) @@ -3430,7 +3496,7 @@ def overafter_timestamptz_spanset(t: int, ss: "const SpanSet *") -> "bool": return result if result != _ffi.NULL else None -def overbefore_date_set(d: "DateADT", s: "const Set *") -> "bool": +def overbefore_date_set(d: int, s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[bool, "bool"]: d_converted = _ffi.cast("DateADT", d) s_converted = _ffi.cast("const Set *", s) result = _lib.overbefore_date_set(d_converted, s_converted) @@ -3438,7 +3504,7 @@ def overbefore_date_set(d: "DateADT", s: "const Set *") -> "bool": return result if result != _ffi.NULL else None -def overbefore_date_span(d: "DateADT", s: "const Span *") -> "bool": +def overbefore_date_span(d: int, s: Annotated[_ffi.CData, "const Span *"]) -> Annotated[bool, "bool"]: d_converted = _ffi.cast("DateADT", d) s_converted = _ffi.cast("const Span *", s) result = _lib.overbefore_date_span(d_converted, s_converted) @@ -3446,7 +3512,7 @@ def overbefore_date_span(d: "DateADT", s: "const Span *") -> "bool": return result if result != _ffi.NULL else None -def overbefore_date_spanset(d: "DateADT", ss: "const SpanSet *") -> "bool": +def overbefore_date_spanset(d: int, ss: Annotated[_ffi.CData, "const SpanSet *"]) -> Annotated[bool, "bool"]: d_converted = _ffi.cast("DateADT", d) ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.overbefore_date_spanset(d_converted, ss_converted) @@ -3454,7 +3520,7 @@ def overbefore_date_spanset(d: "DateADT", ss: "const SpanSet *") -> "bool": return result if result != _ffi.NULL else None -def overbefore_set_date(s: "const Set *", d: "DateADT") -> "bool": +def overbefore_set_date(s: Annotated[_ffi.CData, "const Set *"], d: int) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Set *", s) d_converted = _ffi.cast("DateADT", d) result = _lib.overbefore_set_date(s_converted, d_converted) @@ -3462,7 +3528,7 @@ def overbefore_set_date(s: "const Set *", d: "DateADT") -> "bool": return result if result != _ffi.NULL else None -def overbefore_set_timestamptz(s: "const Set *", t: int) -> "bool": +def overbefore_set_timestamptz(s: Annotated[_ffi.CData, "const Set *"], t: int) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Set *", s) t_converted = _ffi.cast("TimestampTz", t) result = _lib.overbefore_set_timestamptz(s_converted, t_converted) @@ -3470,7 +3536,7 @@ def overbefore_set_timestamptz(s: "const Set *", t: int) -> "bool": return result if result != _ffi.NULL else None -def overbefore_span_date(s: "const Span *", d: "DateADT") -> "bool": +def overbefore_span_date(s: Annotated[_ffi.CData, "const Span *"], d: int) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Span *", s) d_converted = _ffi.cast("DateADT", d) result = _lib.overbefore_span_date(s_converted, d_converted) @@ -3478,7 +3544,7 @@ def overbefore_span_date(s: "const Span *", d: "DateADT") -> "bool": return result if result != _ffi.NULL else None -def overbefore_span_timestamptz(s: "const Span *", t: int) -> "bool": +def overbefore_span_timestamptz(s: Annotated[_ffi.CData, "const Span *"], t: int) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Span *", s) t_converted = _ffi.cast("TimestampTz", t) result = _lib.overbefore_span_timestamptz(s_converted, t_converted) @@ -3486,7 +3552,7 @@ def overbefore_span_timestamptz(s: "const Span *", t: int) -> "bool": return result if result != _ffi.NULL else None -def overbefore_spanset_date(ss: "const SpanSet *", d: "DateADT") -> "bool": +def overbefore_spanset_date(ss: Annotated[_ffi.CData, "const SpanSet *"], d: int) -> Annotated[bool, "bool"]: ss_converted = _ffi.cast("const SpanSet *", ss) d_converted = _ffi.cast("DateADT", d) result = _lib.overbefore_spanset_date(ss_converted, d_converted) @@ -3494,7 +3560,7 @@ def overbefore_spanset_date(ss: "const SpanSet *", d: "DateADT") -> "bool": return result if result != _ffi.NULL else None -def overbefore_spanset_timestamptz(ss: "const SpanSet *", t: int) -> "bool": +def overbefore_spanset_timestamptz(ss: Annotated[_ffi.CData, "const SpanSet *"], t: int) -> Annotated[bool, "bool"]: ss_converted = _ffi.cast("const SpanSet *", ss) t_converted = _ffi.cast("TimestampTz", t) result = _lib.overbefore_spanset_timestamptz(ss_converted, t_converted) @@ -3502,7 +3568,7 @@ def overbefore_spanset_timestamptz(ss: "const SpanSet *", t: int) -> "bool": return result if result != _ffi.NULL else None -def overbefore_timestamptz_set(t: int, s: "const Set *") -> "bool": +def overbefore_timestamptz_set(t: int, s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[bool, "bool"]: t_converted = _ffi.cast("TimestampTz", t) s_converted = _ffi.cast("const Set *", s) result = _lib.overbefore_timestamptz_set(t_converted, s_converted) @@ -3510,7 +3576,7 @@ def overbefore_timestamptz_set(t: int, s: "const Set *") -> "bool": return result if result != _ffi.NULL else None -def overbefore_timestamptz_span(t: int, s: "const Span *") -> "bool": +def overbefore_timestamptz_span(t: int, s: Annotated[_ffi.CData, "const Span *"]) -> Annotated[bool, "bool"]: t_converted = _ffi.cast("TimestampTz", t) s_converted = _ffi.cast("const Span *", s) result = _lib.overbefore_timestamptz_span(t_converted, s_converted) @@ -3518,7 +3584,7 @@ def overbefore_timestamptz_span(t: int, s: "const Span *") -> "bool": return result if result != _ffi.NULL else None -def overbefore_timestamptz_spanset(t: int, ss: "const SpanSet *") -> "bool": +def overbefore_timestamptz_spanset(t: int, ss: Annotated[_ffi.CData, "const SpanSet *"]) -> Annotated[bool, "bool"]: t_converted = _ffi.cast("TimestampTz", t) ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.overbefore_timestamptz_spanset(t_converted, ss_converted) @@ -3526,7 +3592,7 @@ def overbefore_timestamptz_spanset(t: int, ss: "const SpanSet *") -> "bool": return result if result != _ffi.NULL else None -def overleft_bigint_set(i: int, s: "const Set *") -> "bool": +def overleft_bigint_set(i: int, s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[bool, "bool"]: i_converted = _ffi.cast("int64", i) s_converted = _ffi.cast("const Set *", s) result = _lib.overleft_bigint_set(i_converted, s_converted) @@ -3534,7 +3600,7 @@ def overleft_bigint_set(i: int, s: "const Set *") -> "bool": return result if result != _ffi.NULL else None -def overleft_bigint_span(i: int, s: "const Span *") -> "bool": +def overleft_bigint_span(i: int, s: Annotated[_ffi.CData, "const Span *"]) -> Annotated[bool, "bool"]: i_converted = _ffi.cast("int64", i) s_converted = _ffi.cast("const Span *", s) result = _lib.overleft_bigint_span(i_converted, s_converted) @@ -3542,7 +3608,7 @@ def overleft_bigint_span(i: int, s: "const Span *") -> "bool": return result if result != _ffi.NULL else None -def overleft_bigint_spanset(i: int, ss: "const SpanSet *") -> "bool": +def overleft_bigint_spanset(i: int, ss: Annotated[_ffi.CData, "const SpanSet *"]) -> Annotated[bool, "bool"]: i_converted = _ffi.cast("int64", i) ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.overleft_bigint_spanset(i_converted, ss_converted) @@ -3550,49 +3616,49 @@ def overleft_bigint_spanset(i: int, ss: "const SpanSet *") -> "bool": return result if result != _ffi.NULL else None -def overleft_float_set(d: float, s: "const Set *") -> "bool": +def overleft_float_set(d: float, s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Set *", s) result = _lib.overleft_float_set(d, s_converted) _check_error() return result if result != _ffi.NULL else None -def overleft_float_span(d: float, s: "const Span *") -> "bool": +def overleft_float_span(d: float, s: Annotated[_ffi.CData, "const Span *"]) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Span *", s) result = _lib.overleft_float_span(d, s_converted) _check_error() return result if result != _ffi.NULL else None -def overleft_float_spanset(d: float, ss: "const SpanSet *") -> "bool": +def overleft_float_spanset(d: float, ss: Annotated[_ffi.CData, "const SpanSet *"]) -> Annotated[bool, "bool"]: ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.overleft_float_spanset(d, ss_converted) _check_error() return result if result != _ffi.NULL else None -def overleft_int_set(i: int, s: "const Set *") -> "bool": +def overleft_int_set(i: int, s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Set *", s) result = _lib.overleft_int_set(i, s_converted) _check_error() return result if result != _ffi.NULL else None -def overleft_int_span(i: int, s: "const Span *") -> "bool": +def overleft_int_span(i: int, s: Annotated[_ffi.CData, "const Span *"]) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Span *", s) result = _lib.overleft_int_span(i, s_converted) _check_error() return result if result != _ffi.NULL else None -def overleft_int_spanset(i: int, ss: "const SpanSet *") -> "bool": +def overleft_int_spanset(i: int, ss: Annotated[_ffi.CData, "const SpanSet *"]) -> Annotated[bool, "bool"]: ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.overleft_int_spanset(i, ss_converted) _check_error() return result if result != _ffi.NULL else None -def overleft_set_bigint(s: "const Set *", i: int) -> "bool": +def overleft_set_bigint(s: Annotated[_ffi.CData, "const Set *"], i: int) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Set *", s) i_converted = _ffi.cast("int64", i) result = _lib.overleft_set_bigint(s_converted, i_converted) @@ -3600,21 +3666,23 @@ def overleft_set_bigint(s: "const Set *", i: int) -> "bool": return result if result != _ffi.NULL else None -def overleft_set_float(s: "const Set *", d: float) -> "bool": +def overleft_set_float(s: Annotated[_ffi.CData, "const Set *"], d: float) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Set *", s) result = _lib.overleft_set_float(s_converted, d) _check_error() return result if result != _ffi.NULL else None -def overleft_set_int(s: "const Set *", i: int) -> "bool": +def overleft_set_int(s: Annotated[_ffi.CData, "const Set *"], i: int) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Set *", s) result = _lib.overleft_set_int(s_converted, i) _check_error() return result if result != _ffi.NULL else None -def overleft_set_set(s1: "const Set *", s2: "const Set *") -> "bool": +def overleft_set_set( + s1: Annotated[_ffi.CData, "const Set *"], s2: Annotated[_ffi.CData, "const Set *"] +) -> Annotated[bool, "bool"]: s1_converted = _ffi.cast("const Set *", s1) s2_converted = _ffi.cast("const Set *", s2) result = _lib.overleft_set_set(s1_converted, s2_converted) @@ -3622,7 +3690,7 @@ def overleft_set_set(s1: "const Set *", s2: "const Set *") -> "bool": return result if result != _ffi.NULL else None -def overleft_set_text(s: "const Set *", txt: str) -> "bool": +def overleft_set_text(s: Annotated[_ffi.CData, "const Set *"], txt: str) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Set *", s) txt_converted = cstring2text(txt) result = _lib.overleft_set_text(s_converted, txt_converted) @@ -3630,7 +3698,7 @@ def overleft_set_text(s: "const Set *", txt: str) -> "bool": return result if result != _ffi.NULL else None -def overleft_span_bigint(s: "const Span *", i: int) -> "bool": +def overleft_span_bigint(s: Annotated[_ffi.CData, "const Span *"], i: int) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Span *", s) i_converted = _ffi.cast("int64", i) result = _lib.overleft_span_bigint(s_converted, i_converted) @@ -3638,21 +3706,23 @@ def overleft_span_bigint(s: "const Span *", i: int) -> "bool": return result if result != _ffi.NULL else None -def overleft_span_float(s: "const Span *", d: float) -> "bool": +def overleft_span_float(s: Annotated[_ffi.CData, "const Span *"], d: float) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Span *", s) result = _lib.overleft_span_float(s_converted, d) _check_error() return result if result != _ffi.NULL else None -def overleft_span_int(s: "const Span *", i: int) -> "bool": +def overleft_span_int(s: Annotated[_ffi.CData, "const Span *"], i: int) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Span *", s) result = _lib.overleft_span_int(s_converted, i) _check_error() return result if result != _ffi.NULL else None -def overleft_span_span(s1: "const Span *", s2: "const Span *") -> "bool": +def overleft_span_span( + s1: Annotated[_ffi.CData, "const Span *"], s2: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[bool, "bool"]: s1_converted = _ffi.cast("const Span *", s1) s2_converted = _ffi.cast("const Span *", s2) result = _lib.overleft_span_span(s1_converted, s2_converted) @@ -3660,7 +3730,9 @@ def overleft_span_span(s1: "const Span *", s2: "const Span *") -> "bool": return result if result != _ffi.NULL else None -def overleft_span_spanset(s: "const Span *", ss: "const SpanSet *") -> "bool": +def overleft_span_spanset( + s: Annotated[_ffi.CData, "const Span *"], ss: Annotated[_ffi.CData, "const SpanSet *"] +) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Span *", s) ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.overleft_span_spanset(s_converted, ss_converted) @@ -3668,7 +3740,7 @@ def overleft_span_spanset(s: "const Span *", ss: "const SpanSet *") -> "bool": return result if result != _ffi.NULL else None -def overleft_spanset_bigint(ss: "const SpanSet *", i: int) -> "bool": +def overleft_spanset_bigint(ss: Annotated[_ffi.CData, "const SpanSet *"], i: int) -> Annotated[bool, "bool"]: ss_converted = _ffi.cast("const SpanSet *", ss) i_converted = _ffi.cast("int64", i) result = _lib.overleft_spanset_bigint(ss_converted, i_converted) @@ -3676,21 +3748,23 @@ def overleft_spanset_bigint(ss: "const SpanSet *", i: int) -> "bool": return result if result != _ffi.NULL else None -def overleft_spanset_float(ss: "const SpanSet *", d: float) -> "bool": +def overleft_spanset_float(ss: Annotated[_ffi.CData, "const SpanSet *"], d: float) -> Annotated[bool, "bool"]: ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.overleft_spanset_float(ss_converted, d) _check_error() return result if result != _ffi.NULL else None -def overleft_spanset_int(ss: "const SpanSet *", i: int) -> "bool": +def overleft_spanset_int(ss: Annotated[_ffi.CData, "const SpanSet *"], i: int) -> Annotated[bool, "bool"]: ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.overleft_spanset_int(ss_converted, i) _check_error() return result if result != _ffi.NULL else None -def overleft_spanset_span(ss: "const SpanSet *", s: "const Span *") -> "bool": +def overleft_spanset_span( + ss: Annotated[_ffi.CData, "const SpanSet *"], s: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[bool, "bool"]: ss_converted = _ffi.cast("const SpanSet *", ss) s_converted = _ffi.cast("const Span *", s) result = _lib.overleft_spanset_span(ss_converted, s_converted) @@ -3698,7 +3772,9 @@ def overleft_spanset_span(ss: "const SpanSet *", s: "const Span *") -> "bool": return result if result != _ffi.NULL else None -def overleft_spanset_spanset(ss1: "const SpanSet *", ss2: "const SpanSet *") -> "bool": +def overleft_spanset_spanset( + ss1: Annotated[_ffi.CData, "const SpanSet *"], ss2: Annotated[_ffi.CData, "const SpanSet *"] +) -> Annotated[bool, "bool"]: ss1_converted = _ffi.cast("const SpanSet *", ss1) ss2_converted = _ffi.cast("const SpanSet *", ss2) result = _lib.overleft_spanset_spanset(ss1_converted, ss2_converted) @@ -3706,7 +3782,7 @@ def overleft_spanset_spanset(ss1: "const SpanSet *", ss2: "const SpanSet *") -> return result if result != _ffi.NULL else None -def overleft_text_set(txt: str, s: "const Set *") -> "bool": +def overleft_text_set(txt: str, s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[bool, "bool"]: txt_converted = cstring2text(txt) s_converted = _ffi.cast("const Set *", s) result = _lib.overleft_text_set(txt_converted, s_converted) @@ -3714,7 +3790,7 @@ def overleft_text_set(txt: str, s: "const Set *") -> "bool": return result if result != _ffi.NULL else None -def overright_bigint_set(i: int, s: "const Set *") -> "bool": +def overright_bigint_set(i: int, s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[bool, "bool"]: i_converted = _ffi.cast("int64", i) s_converted = _ffi.cast("const Set *", s) result = _lib.overright_bigint_set(i_converted, s_converted) @@ -3722,7 +3798,7 @@ def overright_bigint_set(i: int, s: "const Set *") -> "bool": return result if result != _ffi.NULL else None -def overright_bigint_span(i: int, s: "const Span *") -> "bool": +def overright_bigint_span(i: int, s: Annotated[_ffi.CData, "const Span *"]) -> Annotated[bool, "bool"]: i_converted = _ffi.cast("int64", i) s_converted = _ffi.cast("const Span *", s) result = _lib.overright_bigint_span(i_converted, s_converted) @@ -3730,7 +3806,7 @@ def overright_bigint_span(i: int, s: "const Span *") -> "bool": return result if result != _ffi.NULL else None -def overright_bigint_spanset(i: int, ss: "const SpanSet *") -> "bool": +def overright_bigint_spanset(i: int, ss: Annotated[_ffi.CData, "const SpanSet *"]) -> Annotated[bool, "bool"]: i_converted = _ffi.cast("int64", i) ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.overright_bigint_spanset(i_converted, ss_converted) @@ -3738,49 +3814,49 @@ def overright_bigint_spanset(i: int, ss: "const SpanSet *") -> "bool": return result if result != _ffi.NULL else None -def overright_float_set(d: float, s: "const Set *") -> "bool": +def overright_float_set(d: float, s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Set *", s) result = _lib.overright_float_set(d, s_converted) _check_error() return result if result != _ffi.NULL else None -def overright_float_span(d: float, s: "const Span *") -> "bool": +def overright_float_span(d: float, s: Annotated[_ffi.CData, "const Span *"]) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Span *", s) result = _lib.overright_float_span(d, s_converted) _check_error() return result if result != _ffi.NULL else None -def overright_float_spanset(d: float, ss: "const SpanSet *") -> "bool": +def overright_float_spanset(d: float, ss: Annotated[_ffi.CData, "const SpanSet *"]) -> Annotated[bool, "bool"]: ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.overright_float_spanset(d, ss_converted) _check_error() return result if result != _ffi.NULL else None -def overright_int_set(i: int, s: "const Set *") -> "bool": +def overright_int_set(i: int, s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Set *", s) result = _lib.overright_int_set(i, s_converted) _check_error() return result if result != _ffi.NULL else None -def overright_int_span(i: int, s: "const Span *") -> "bool": +def overright_int_span(i: int, s: Annotated[_ffi.CData, "const Span *"]) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Span *", s) result = _lib.overright_int_span(i, s_converted) _check_error() return result if result != _ffi.NULL else None -def overright_int_spanset(i: int, ss: "const SpanSet *") -> "bool": +def overright_int_spanset(i: int, ss: Annotated[_ffi.CData, "const SpanSet *"]) -> Annotated[bool, "bool"]: ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.overright_int_spanset(i, ss_converted) _check_error() return result if result != _ffi.NULL else None -def overright_set_bigint(s: "const Set *", i: int) -> "bool": +def overright_set_bigint(s: Annotated[_ffi.CData, "const Set *"], i: int) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Set *", s) i_converted = _ffi.cast("int64", i) result = _lib.overright_set_bigint(s_converted, i_converted) @@ -3788,21 +3864,23 @@ def overright_set_bigint(s: "const Set *", i: int) -> "bool": return result if result != _ffi.NULL else None -def overright_set_float(s: "const Set *", d: float) -> "bool": +def overright_set_float(s: Annotated[_ffi.CData, "const Set *"], d: float) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Set *", s) result = _lib.overright_set_float(s_converted, d) _check_error() return result if result != _ffi.NULL else None -def overright_set_int(s: "const Set *", i: int) -> "bool": +def overright_set_int(s: Annotated[_ffi.CData, "const Set *"], i: int) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Set *", s) result = _lib.overright_set_int(s_converted, i) _check_error() return result if result != _ffi.NULL else None -def overright_set_set(s1: "const Set *", s2: "const Set *") -> "bool": +def overright_set_set( + s1: Annotated[_ffi.CData, "const Set *"], s2: Annotated[_ffi.CData, "const Set *"] +) -> Annotated[bool, "bool"]: s1_converted = _ffi.cast("const Set *", s1) s2_converted = _ffi.cast("const Set *", s2) result = _lib.overright_set_set(s1_converted, s2_converted) @@ -3810,7 +3888,7 @@ def overright_set_set(s1: "const Set *", s2: "const Set *") -> "bool": return result if result != _ffi.NULL else None -def overright_set_text(s: "const Set *", txt: str) -> "bool": +def overright_set_text(s: Annotated[_ffi.CData, "const Set *"], txt: str) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Set *", s) txt_converted = cstring2text(txt) result = _lib.overright_set_text(s_converted, txt_converted) @@ -3818,7 +3896,7 @@ def overright_set_text(s: "const Set *", txt: str) -> "bool": return result if result != _ffi.NULL else None -def overright_span_bigint(s: "const Span *", i: int) -> "bool": +def overright_span_bigint(s: Annotated[_ffi.CData, "const Span *"], i: int) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Span *", s) i_converted = _ffi.cast("int64", i) result = _lib.overright_span_bigint(s_converted, i_converted) @@ -3826,21 +3904,23 @@ def overright_span_bigint(s: "const Span *", i: int) -> "bool": return result if result != _ffi.NULL else None -def overright_span_float(s: "const Span *", d: float) -> "bool": +def overright_span_float(s: Annotated[_ffi.CData, "const Span *"], d: float) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Span *", s) result = _lib.overright_span_float(s_converted, d) _check_error() return result if result != _ffi.NULL else None -def overright_span_int(s: "const Span *", i: int) -> "bool": +def overright_span_int(s: Annotated[_ffi.CData, "const Span *"], i: int) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Span *", s) result = _lib.overright_span_int(s_converted, i) _check_error() return result if result != _ffi.NULL else None -def overright_span_span(s1: "const Span *", s2: "const Span *") -> "bool": +def overright_span_span( + s1: Annotated[_ffi.CData, "const Span *"], s2: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[bool, "bool"]: s1_converted = _ffi.cast("const Span *", s1) s2_converted = _ffi.cast("const Span *", s2) result = _lib.overright_span_span(s1_converted, s2_converted) @@ -3848,7 +3928,9 @@ def overright_span_span(s1: "const Span *", s2: "const Span *") -> "bool": return result if result != _ffi.NULL else None -def overright_span_spanset(s: "const Span *", ss: "const SpanSet *") -> "bool": +def overright_span_spanset( + s: Annotated[_ffi.CData, "const Span *"], ss: Annotated[_ffi.CData, "const SpanSet *"] +) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Span *", s) ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.overright_span_spanset(s_converted, ss_converted) @@ -3856,7 +3938,7 @@ def overright_span_spanset(s: "const Span *", ss: "const SpanSet *") -> "bool": return result if result != _ffi.NULL else None -def overright_spanset_bigint(ss: "const SpanSet *", i: int) -> "bool": +def overright_spanset_bigint(ss: Annotated[_ffi.CData, "const SpanSet *"], i: int) -> Annotated[bool, "bool"]: ss_converted = _ffi.cast("const SpanSet *", ss) i_converted = _ffi.cast("int64", i) result = _lib.overright_spanset_bigint(ss_converted, i_converted) @@ -3864,21 +3946,23 @@ def overright_spanset_bigint(ss: "const SpanSet *", i: int) -> "bool": return result if result != _ffi.NULL else None -def overright_spanset_float(ss: "const SpanSet *", d: float) -> "bool": +def overright_spanset_float(ss: Annotated[_ffi.CData, "const SpanSet *"], d: float) -> Annotated[bool, "bool"]: ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.overright_spanset_float(ss_converted, d) _check_error() return result if result != _ffi.NULL else None -def overright_spanset_int(ss: "const SpanSet *", i: int) -> "bool": +def overright_spanset_int(ss: Annotated[_ffi.CData, "const SpanSet *"], i: int) -> Annotated[bool, "bool"]: ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.overright_spanset_int(ss_converted, i) _check_error() return result if result != _ffi.NULL else None -def overright_spanset_span(ss: "const SpanSet *", s: "const Span *") -> "bool": +def overright_spanset_span( + ss: Annotated[_ffi.CData, "const SpanSet *"], s: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[bool, "bool"]: ss_converted = _ffi.cast("const SpanSet *", ss) s_converted = _ffi.cast("const Span *", s) result = _lib.overright_spanset_span(ss_converted, s_converted) @@ -3886,7 +3970,9 @@ def overright_spanset_span(ss: "const SpanSet *", s: "const Span *") -> "bool": return result if result != _ffi.NULL else None -def overright_spanset_spanset(ss1: "const SpanSet *", ss2: "const SpanSet *") -> "bool": +def overright_spanset_spanset( + ss1: Annotated[_ffi.CData, "const SpanSet *"], ss2: Annotated[_ffi.CData, "const SpanSet *"] +) -> Annotated[bool, "bool"]: ss1_converted = _ffi.cast("const SpanSet *", ss1) ss2_converted = _ffi.cast("const SpanSet *", ss2) result = _lib.overright_spanset_spanset(ss1_converted, ss2_converted) @@ -3894,7 +3980,7 @@ def overright_spanset_spanset(ss1: "const SpanSet *", ss2: "const SpanSet *") -> return result if result != _ffi.NULL else None -def overright_text_set(txt: str, s: "const Set *") -> "bool": +def overright_text_set(txt: str, s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[bool, "bool"]: txt_converted = cstring2text(txt) s_converted = _ffi.cast("const Set *", s) result = _lib.overright_text_set(txt_converted, s_converted) @@ -3902,7 +3988,7 @@ def overright_text_set(txt: str, s: "const Set *") -> "bool": return result if result != _ffi.NULL else None -def right_bigint_set(i: int, s: "const Set *") -> "bool": +def right_bigint_set(i: int, s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[bool, "bool"]: i_converted = _ffi.cast("int64", i) s_converted = _ffi.cast("const Set *", s) result = _lib.right_bigint_set(i_converted, s_converted) @@ -3910,7 +3996,7 @@ def right_bigint_set(i: int, s: "const Set *") -> "bool": return result if result != _ffi.NULL else None -def right_bigint_span(i: int, s: "const Span *") -> "bool": +def right_bigint_span(i: int, s: Annotated[_ffi.CData, "const Span *"]) -> Annotated[bool, "bool"]: i_converted = _ffi.cast("int64", i) s_converted = _ffi.cast("const Span *", s) result = _lib.right_bigint_span(i_converted, s_converted) @@ -3918,7 +4004,7 @@ def right_bigint_span(i: int, s: "const Span *") -> "bool": return result if result != _ffi.NULL else None -def right_bigint_spanset(i: int, ss: "const SpanSet *") -> "bool": +def right_bigint_spanset(i: int, ss: Annotated[_ffi.CData, "const SpanSet *"]) -> Annotated[bool, "bool"]: i_converted = _ffi.cast("int64", i) ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.right_bigint_spanset(i_converted, ss_converted) @@ -3926,49 +4012,49 @@ def right_bigint_spanset(i: int, ss: "const SpanSet *") -> "bool": return result if result != _ffi.NULL else None -def right_float_set(d: float, s: "const Set *") -> "bool": +def right_float_set(d: float, s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Set *", s) result = _lib.right_float_set(d, s_converted) _check_error() return result if result != _ffi.NULL else None -def right_float_span(d: float, s: "const Span *") -> "bool": +def right_float_span(d: float, s: Annotated[_ffi.CData, "const Span *"]) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Span *", s) result = _lib.right_float_span(d, s_converted) _check_error() return result if result != _ffi.NULL else None -def right_float_spanset(d: float, ss: "const SpanSet *") -> "bool": +def right_float_spanset(d: float, ss: Annotated[_ffi.CData, "const SpanSet *"]) -> Annotated[bool, "bool"]: ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.right_float_spanset(d, ss_converted) _check_error() return result if result != _ffi.NULL else None -def right_int_set(i: int, s: "const Set *") -> "bool": +def right_int_set(i: int, s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Set *", s) result = _lib.right_int_set(i, s_converted) _check_error() return result if result != _ffi.NULL else None -def right_int_span(i: int, s: "const Span *") -> "bool": +def right_int_span(i: int, s: Annotated[_ffi.CData, "const Span *"]) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Span *", s) result = _lib.right_int_span(i, s_converted) _check_error() return result if result != _ffi.NULL else None -def right_int_spanset(i: int, ss: "const SpanSet *") -> "bool": +def right_int_spanset(i: int, ss: Annotated[_ffi.CData, "const SpanSet *"]) -> Annotated[bool, "bool"]: ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.right_int_spanset(i, ss_converted) _check_error() return result if result != _ffi.NULL else None -def right_set_bigint(s: "const Set *", i: int) -> "bool": +def right_set_bigint(s: Annotated[_ffi.CData, "const Set *"], i: int) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Set *", s) i_converted = _ffi.cast("int64", i) result = _lib.right_set_bigint(s_converted, i_converted) @@ -3976,21 +4062,23 @@ def right_set_bigint(s: "const Set *", i: int) -> "bool": return result if result != _ffi.NULL else None -def right_set_float(s: "const Set *", d: float) -> "bool": +def right_set_float(s: Annotated[_ffi.CData, "const Set *"], d: float) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Set *", s) result = _lib.right_set_float(s_converted, d) _check_error() return result if result != _ffi.NULL else None -def right_set_int(s: "const Set *", i: int) -> "bool": +def right_set_int(s: Annotated[_ffi.CData, "const Set *"], i: int) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Set *", s) result = _lib.right_set_int(s_converted, i) _check_error() return result if result != _ffi.NULL else None -def right_set_set(s1: "const Set *", s2: "const Set *") -> "bool": +def right_set_set( + s1: Annotated[_ffi.CData, "const Set *"], s2: Annotated[_ffi.CData, "const Set *"] +) -> Annotated[bool, "bool"]: s1_converted = _ffi.cast("const Set *", s1) s2_converted = _ffi.cast("const Set *", s2) result = _lib.right_set_set(s1_converted, s2_converted) @@ -3998,7 +4086,7 @@ def right_set_set(s1: "const Set *", s2: "const Set *") -> "bool": return result if result != _ffi.NULL else None -def right_set_text(s: "const Set *", txt: str) -> "bool": +def right_set_text(s: Annotated[_ffi.CData, "const Set *"], txt: str) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Set *", s) txt_converted = cstring2text(txt) result = _lib.right_set_text(s_converted, txt_converted) @@ -4006,7 +4094,7 @@ def right_set_text(s: "const Set *", txt: str) -> "bool": return result if result != _ffi.NULL else None -def right_span_bigint(s: "const Span *", i: int) -> "bool": +def right_span_bigint(s: Annotated[_ffi.CData, "const Span *"], i: int) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Span *", s) i_converted = _ffi.cast("int64", i) result = _lib.right_span_bigint(s_converted, i_converted) @@ -4014,21 +4102,23 @@ def right_span_bigint(s: "const Span *", i: int) -> "bool": return result if result != _ffi.NULL else None -def right_span_float(s: "const Span *", d: float) -> "bool": +def right_span_float(s: Annotated[_ffi.CData, "const Span *"], d: float) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Span *", s) result = _lib.right_span_float(s_converted, d) _check_error() return result if result != _ffi.NULL else None -def right_span_int(s: "const Span *", i: int) -> "bool": +def right_span_int(s: Annotated[_ffi.CData, "const Span *"], i: int) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Span *", s) result = _lib.right_span_int(s_converted, i) _check_error() return result if result != _ffi.NULL else None -def right_span_span(s1: "const Span *", s2: "const Span *") -> "bool": +def right_span_span( + s1: Annotated[_ffi.CData, "const Span *"], s2: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[bool, "bool"]: s1_converted = _ffi.cast("const Span *", s1) s2_converted = _ffi.cast("const Span *", s2) result = _lib.right_span_span(s1_converted, s2_converted) @@ -4036,7 +4126,9 @@ def right_span_span(s1: "const Span *", s2: "const Span *") -> "bool": return result if result != _ffi.NULL else None -def right_span_spanset(s: "const Span *", ss: "const SpanSet *") -> "bool": +def right_span_spanset( + s: Annotated[_ffi.CData, "const Span *"], ss: Annotated[_ffi.CData, "const SpanSet *"] +) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Span *", s) ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.right_span_spanset(s_converted, ss_converted) @@ -4044,7 +4136,7 @@ def right_span_spanset(s: "const Span *", ss: "const SpanSet *") -> "bool": return result if result != _ffi.NULL else None -def right_spanset_bigint(ss: "const SpanSet *", i: int) -> "bool": +def right_spanset_bigint(ss: Annotated[_ffi.CData, "const SpanSet *"], i: int) -> Annotated[bool, "bool"]: ss_converted = _ffi.cast("const SpanSet *", ss) i_converted = _ffi.cast("int64", i) result = _lib.right_spanset_bigint(ss_converted, i_converted) @@ -4052,21 +4144,23 @@ def right_spanset_bigint(ss: "const SpanSet *", i: int) -> "bool": return result if result != _ffi.NULL else None -def right_spanset_float(ss: "const SpanSet *", d: float) -> "bool": +def right_spanset_float(ss: Annotated[_ffi.CData, "const SpanSet *"], d: float) -> Annotated[bool, "bool"]: ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.right_spanset_float(ss_converted, d) _check_error() return result if result != _ffi.NULL else None -def right_spanset_int(ss: "const SpanSet *", i: int) -> "bool": +def right_spanset_int(ss: Annotated[_ffi.CData, "const SpanSet *"], i: int) -> Annotated[bool, "bool"]: ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.right_spanset_int(ss_converted, i) _check_error() return result if result != _ffi.NULL else None -def right_spanset_span(ss: "const SpanSet *", s: "const Span *") -> "bool": +def right_spanset_span( + ss: Annotated[_ffi.CData, "const SpanSet *"], s: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[bool, "bool"]: ss_converted = _ffi.cast("const SpanSet *", ss) s_converted = _ffi.cast("const Span *", s) result = _lib.right_spanset_span(ss_converted, s_converted) @@ -4074,7 +4168,9 @@ def right_spanset_span(ss: "const SpanSet *", s: "const Span *") -> "bool": return result if result != _ffi.NULL else None -def right_spanset_spanset(ss1: "const SpanSet *", ss2: "const SpanSet *") -> "bool": +def right_spanset_spanset( + ss1: Annotated[_ffi.CData, "const SpanSet *"], ss2: Annotated[_ffi.CData, "const SpanSet *"] +) -> Annotated[bool, "bool"]: ss1_converted = _ffi.cast("const SpanSet *", ss1) ss2_converted = _ffi.cast("const SpanSet *", ss2) result = _lib.right_spanset_spanset(ss1_converted, ss2_converted) @@ -4082,7 +4178,7 @@ def right_spanset_spanset(ss1: "const SpanSet *", ss2: "const SpanSet *") -> "bo return result if result != _ffi.NULL else None -def right_text_set(txt: str, s: "const Set *") -> "bool": +def right_text_set(txt: str, s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[bool, "bool"]: txt_converted = cstring2text(txt) s_converted = _ffi.cast("const Set *", s) result = _lib.right_text_set(txt_converted, s_converted) @@ -4090,7 +4186,7 @@ def right_text_set(txt: str, s: "const Set *") -> "bool": return result if result != _ffi.NULL else None -def intersection_bigint_set(i: int, s: "const Set *") -> "Set *": +def intersection_bigint_set(i: int, s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[_ffi.CData, "Set *"]: i_converted = _ffi.cast("int64", i) s_converted = _ffi.cast("const Set *", s) result = _lib.intersection_bigint_set(i_converted, s_converted) @@ -4098,37 +4194,29 @@ def intersection_bigint_set(i: int, s: "const Set *") -> "Set *": return result if result != _ffi.NULL else None -def intersection_date_set(d: "const DateADT", s: "const Set *") -> "Set *": - d_converted = _ffi.cast("const DateADT", d) +def intersection_date_set(d: int, s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[_ffi.CData, "Set *"]: + d_converted = _ffi.cast("DateADT", d) s_converted = _ffi.cast("const Set *", s) result = _lib.intersection_date_set(d_converted, s_converted) _check_error() return result if result != _ffi.NULL else None -def intersection_float_set(d: float, s: "const Set *") -> "Set *": +def intersection_float_set(d: float, s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[_ffi.CData, "Set *"]: s_converted = _ffi.cast("const Set *", s) result = _lib.intersection_float_set(d, s_converted) _check_error() return result if result != _ffi.NULL else None -def intersection_geo_set(gs: "const GSERIALIZED *", s: "const Set *") -> "Set *": - gs_converted = _ffi.cast("const GSERIALIZED *", gs) - s_converted = _ffi.cast("const Set *", s) - result = _lib.intersection_geo_set(gs_converted, s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def intersection_int_set(i: int, s: "const Set *") -> "Set *": +def intersection_int_set(i: int, s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[_ffi.CData, "Set *"]: s_converted = _ffi.cast("const Set *", s) result = _lib.intersection_int_set(i, s_converted) _check_error() return result if result != _ffi.NULL else None -def intersection_set_bigint(s: "const Set *", i: int) -> "Set *": +def intersection_set_bigint(s: Annotated[_ffi.CData, "const Set *"], i: int) -> Annotated[_ffi.CData, "Set *"]: s_converted = _ffi.cast("const Set *", s) i_converted = _ffi.cast("int64", i) result = _lib.intersection_set_bigint(s_converted, i_converted) @@ -4136,7 +4224,7 @@ def intersection_set_bigint(s: "const Set *", i: int) -> "Set *": return result if result != _ffi.NULL else None -def intersection_set_date(s: "const Set *", d: "DateADT") -> "Set *": +def intersection_set_date(s: Annotated[_ffi.CData, "const Set *"], d: int) -> Annotated[_ffi.CData, "Set *"]: s_converted = _ffi.cast("const Set *", s) d_converted = _ffi.cast("DateADT", d) result = _lib.intersection_set_date(s_converted, d_converted) @@ -4144,29 +4232,23 @@ def intersection_set_date(s: "const Set *", d: "DateADT") -> "Set *": return result if result != _ffi.NULL else None -def intersection_set_float(s: "const Set *", d: float) -> "Set *": +def intersection_set_float(s: Annotated[_ffi.CData, "const Set *"], d: float) -> Annotated[_ffi.CData, "Set *"]: s_converted = _ffi.cast("const Set *", s) result = _lib.intersection_set_float(s_converted, d) _check_error() return result if result != _ffi.NULL else None -def intersection_set_geo(s: "const Set *", gs: "const GSERIALIZED *") -> "Set *": - s_converted = _ffi.cast("const Set *", s) - gs_converted = _ffi.cast("const GSERIALIZED *", gs) - result = _lib.intersection_set_geo(s_converted, gs_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def intersection_set_int(s: "const Set *", i: int) -> "Set *": +def intersection_set_int(s: Annotated[_ffi.CData, "const Set *"], i: int) -> Annotated[_ffi.CData, "Set *"]: s_converted = _ffi.cast("const Set *", s) result = _lib.intersection_set_int(s_converted, i) _check_error() return result if result != _ffi.NULL else None -def intersection_set_set(s1: "const Set *", s2: "const Set *") -> "Set *": +def intersection_set_set( + s1: Annotated[_ffi.CData, "const Set *"], s2: Annotated[_ffi.CData, "const Set *"] +) -> Annotated[_ffi.CData, "Set *"]: s1_converted = _ffi.cast("const Set *", s1) s2_converted = _ffi.cast("const Set *", s2) result = _lib.intersection_set_set(s1_converted, s2_converted) @@ -4174,7 +4256,7 @@ def intersection_set_set(s1: "const Set *", s2: "const Set *") -> "Set *": return result if result != _ffi.NULL else None -def intersection_set_text(s: "const Set *", txt: str) -> "Set *": +def intersection_set_text(s: Annotated[_ffi.CData, "const Set *"], txt: str) -> Annotated[_ffi.CData, "Set *"]: s_converted = _ffi.cast("const Set *", s) txt_converted = cstring2text(txt) result = _lib.intersection_set_text(s_converted, txt_converted) @@ -4182,7 +4264,7 @@ def intersection_set_text(s: "const Set *", txt: str) -> "Set *": return result if result != _ffi.NULL else None -def intersection_set_timestamptz(s: "const Set *", t: int) -> "Set *": +def intersection_set_timestamptz(s: Annotated[_ffi.CData, "const Set *"], t: int) -> Annotated[_ffi.CData, "Set *"]: s_converted = _ffi.cast("const Set *", s) t_converted = _ffi.cast("TimestampTz", t) result = _lib.intersection_set_timestamptz(s_converted, t_converted) @@ -4190,7 +4272,7 @@ def intersection_set_timestamptz(s: "const Set *", t: int) -> "Set *": return result if result != _ffi.NULL else None -def intersection_span_bigint(s: "const Span *", i: int) -> "Span *": +def intersection_span_bigint(s: Annotated[_ffi.CData, "const Span *"], i: int) -> Annotated[_ffi.CData, "Span *"]: s_converted = _ffi.cast("const Span *", s) i_converted = _ffi.cast("int64", i) result = _lib.intersection_span_bigint(s_converted, i_converted) @@ -4198,7 +4280,7 @@ def intersection_span_bigint(s: "const Span *", i: int) -> "Span *": return result if result != _ffi.NULL else None -def intersection_span_date(s: "const Span *", d: "DateADT") -> "Span *": +def intersection_span_date(s: Annotated[_ffi.CData, "const Span *"], d: int) -> Annotated[_ffi.CData, "Span *"]: s_converted = _ffi.cast("const Span *", s) d_converted = _ffi.cast("DateADT", d) result = _lib.intersection_span_date(s_converted, d_converted) @@ -4206,21 +4288,23 @@ def intersection_span_date(s: "const Span *", d: "DateADT") -> "Span *": return result if result != _ffi.NULL else None -def intersection_span_float(s: "const Span *", d: float) -> "Span *": +def intersection_span_float(s: Annotated[_ffi.CData, "const Span *"], d: float) -> Annotated[_ffi.CData, "Span *"]: s_converted = _ffi.cast("const Span *", s) result = _lib.intersection_span_float(s_converted, d) _check_error() return result if result != _ffi.NULL else None -def intersection_span_int(s: "const Span *", i: int) -> "Span *": +def intersection_span_int(s: Annotated[_ffi.CData, "const Span *"], i: int) -> Annotated[_ffi.CData, "Span *"]: s_converted = _ffi.cast("const Span *", s) result = _lib.intersection_span_int(s_converted, i) _check_error() return result if result != _ffi.NULL else None -def intersection_span_span(s1: "const Span *", s2: "const Span *") -> "Span *": +def intersection_span_span( + s1: Annotated[_ffi.CData, "const Span *"], s2: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[_ffi.CData, "Span *"]: s1_converted = _ffi.cast("const Span *", s1) s2_converted = _ffi.cast("const Span *", s2) result = _lib.intersection_span_span(s1_converted, s2_converted) @@ -4228,7 +4312,9 @@ def intersection_span_span(s1: "const Span *", s2: "const Span *") -> "Span *": return result if result != _ffi.NULL else None -def intersection_span_spanset(s: "const Span *", ss: "const SpanSet *") -> "SpanSet *": +def intersection_span_spanset( + s: Annotated[_ffi.CData, "const Span *"], ss: Annotated[_ffi.CData, "const SpanSet *"] +) -> Annotated[_ffi.CData, "SpanSet *"]: s_converted = _ffi.cast("const Span *", s) ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.intersection_span_spanset(s_converted, ss_converted) @@ -4236,7 +4322,7 @@ def intersection_span_spanset(s: "const Span *", ss: "const SpanSet *") -> "Span return result if result != _ffi.NULL else None -def intersection_span_timestamptz(s: "const Span *", t: int) -> "Span *": +def intersection_span_timestamptz(s: Annotated[_ffi.CData, "const Span *"], t: int) -> Annotated[_ffi.CData, "Span *"]: s_converted = _ffi.cast("const Span *", s) t_converted = _ffi.cast("TimestampTz", t) result = _lib.intersection_span_timestamptz(s_converted, t_converted) @@ -4244,7 +4330,9 @@ def intersection_span_timestamptz(s: "const Span *", t: int) -> "Span *": return result if result != _ffi.NULL else None -def intersection_spanset_bigint(ss: "const SpanSet *", i: int) -> "SpanSet *": +def intersection_spanset_bigint( + ss: Annotated[_ffi.CData, "const SpanSet *"], i: int +) -> Annotated[_ffi.CData, "SpanSet *"]: ss_converted = _ffi.cast("const SpanSet *", ss) i_converted = _ffi.cast("int64", i) result = _lib.intersection_spanset_bigint(ss_converted, i_converted) @@ -4252,7 +4340,9 @@ def intersection_spanset_bigint(ss: "const SpanSet *", i: int) -> "SpanSet *": return result if result != _ffi.NULL else None -def intersection_spanset_date(ss: "const SpanSet *", d: "DateADT") -> "SpanSet *": +def intersection_spanset_date( + ss: Annotated[_ffi.CData, "const SpanSet *"], d: int +) -> Annotated[_ffi.CData, "SpanSet *"]: ss_converted = _ffi.cast("const SpanSet *", ss) d_converted = _ffi.cast("DateADT", d) result = _lib.intersection_spanset_date(ss_converted, d_converted) @@ -4260,21 +4350,27 @@ def intersection_spanset_date(ss: "const SpanSet *", d: "DateADT") -> "SpanSet * return result if result != _ffi.NULL else None -def intersection_spanset_float(ss: "const SpanSet *", d: float) -> "SpanSet *": +def intersection_spanset_float( + ss: Annotated[_ffi.CData, "const SpanSet *"], d: float +) -> Annotated[_ffi.CData, "SpanSet *"]: ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.intersection_spanset_float(ss_converted, d) _check_error() return result if result != _ffi.NULL else None -def intersection_spanset_int(ss: "const SpanSet *", i: int) -> "SpanSet *": +def intersection_spanset_int( + ss: Annotated[_ffi.CData, "const SpanSet *"], i: int +) -> Annotated[_ffi.CData, "SpanSet *"]: ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.intersection_spanset_int(ss_converted, i) _check_error() return result if result != _ffi.NULL else None -def intersection_spanset_span(ss: "const SpanSet *", s: "const Span *") -> "SpanSet *": +def intersection_spanset_span( + ss: Annotated[_ffi.CData, "const SpanSet *"], s: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[_ffi.CData, "SpanSet *"]: ss_converted = _ffi.cast("const SpanSet *", ss) s_converted = _ffi.cast("const Span *", s) result = _lib.intersection_spanset_span(ss_converted, s_converted) @@ -4283,8 +4379,8 @@ def intersection_spanset_span(ss: "const SpanSet *", s: "const Span *") -> "Span def intersection_spanset_spanset( - ss1: "const SpanSet *", ss2: "const SpanSet *" -) -> "SpanSet *": + ss1: Annotated[_ffi.CData, "const SpanSet *"], ss2: Annotated[_ffi.CData, "const SpanSet *"] +) -> Annotated[_ffi.CData, "SpanSet *"]: ss1_converted = _ffi.cast("const SpanSet *", ss1) ss2_converted = _ffi.cast("const SpanSet *", ss2) result = _lib.intersection_spanset_spanset(ss1_converted, ss2_converted) @@ -4292,7 +4388,9 @@ def intersection_spanset_spanset( return result if result != _ffi.NULL else None -def intersection_spanset_timestamptz(ss: "const SpanSet *", t: int) -> "SpanSet *": +def intersection_spanset_timestamptz( + ss: Annotated[_ffi.CData, "const SpanSet *"], t: int +) -> Annotated[_ffi.CData, "SpanSet *"]: ss_converted = _ffi.cast("const SpanSet *", ss) t_converted = _ffi.cast("TimestampTz", t) result = _lib.intersection_spanset_timestamptz(ss_converted, t_converted) @@ -4300,7 +4398,7 @@ def intersection_spanset_timestamptz(ss: "const SpanSet *", t: int) -> "SpanSet return result if result != _ffi.NULL else None -def intersection_text_set(txt: str, s: "const Set *") -> "Set *": +def intersection_text_set(txt: str, s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[_ffi.CData, "Set *"]: txt_converted = cstring2text(txt) s_converted = _ffi.cast("const Set *", s) result = _lib.intersection_text_set(txt_converted, s_converted) @@ -4308,15 +4406,15 @@ def intersection_text_set(txt: str, s: "const Set *") -> "Set *": return result if result != _ffi.NULL else None -def intersection_timestamptz_set(t: int, s: "const Set *") -> "Set *": - t_converted = _ffi.cast("const TimestampTz", t) +def intersection_timestamptz_set(t: int, s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[_ffi.CData, "Set *"]: + t_converted = _ffi.cast("TimestampTz", t) s_converted = _ffi.cast("const Set *", s) result = _lib.intersection_timestamptz_set(t_converted, s_converted) _check_error() return result if result != _ffi.NULL else None -def minus_bigint_set(i: int, s: "const Set *") -> "Set *": +def minus_bigint_set(i: int, s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[_ffi.CData, "Set *"]: i_converted = _ffi.cast("int64", i) s_converted = _ffi.cast("const Set *", s) result = _lib.minus_bigint_set(i_converted, s_converted) @@ -4324,7 +4422,7 @@ def minus_bigint_set(i: int, s: "const Set *") -> "Set *": return result if result != _ffi.NULL else None -def minus_bigint_span(i: int, s: "const Span *") -> "SpanSet *": +def minus_bigint_span(i: int, s: Annotated[_ffi.CData, "const Span *"]) -> Annotated[_ffi.CData, "SpanSet *"]: i_converted = _ffi.cast("int64", i) s_converted = _ffi.cast("const Span *", s) result = _lib.minus_bigint_span(i_converted, s_converted) @@ -4332,7 +4430,7 @@ def minus_bigint_span(i: int, s: "const Span *") -> "SpanSet *": return result if result != _ffi.NULL else None -def minus_bigint_spanset(i: int, ss: "const SpanSet *") -> "SpanSet *": +def minus_bigint_spanset(i: int, ss: Annotated[_ffi.CData, "const SpanSet *"]) -> Annotated[_ffi.CData, "SpanSet *"]: i_converted = _ffi.cast("int64", i) ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.minus_bigint_spanset(i_converted, ss_converted) @@ -4340,7 +4438,7 @@ def minus_bigint_spanset(i: int, ss: "const SpanSet *") -> "SpanSet *": return result if result != _ffi.NULL else None -def minus_date_set(d: "DateADT", s: "const Set *") -> "Set *": +def minus_date_set(d: int, s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[_ffi.CData, "Set *"]: d_converted = _ffi.cast("DateADT", d) s_converted = _ffi.cast("const Set *", s) result = _lib.minus_date_set(d_converted, s_converted) @@ -4348,7 +4446,7 @@ def minus_date_set(d: "DateADT", s: "const Set *") -> "Set *": return result if result != _ffi.NULL else None -def minus_date_span(d: "DateADT", s: "const Span *") -> "SpanSet *": +def minus_date_span(d: int, s: Annotated[_ffi.CData, "const Span *"]) -> Annotated[_ffi.CData, "SpanSet *"]: d_converted = _ffi.cast("DateADT", d) s_converted = _ffi.cast("const Span *", s) result = _lib.minus_date_span(d_converted, s_converted) @@ -4356,7 +4454,7 @@ def minus_date_span(d: "DateADT", s: "const Span *") -> "SpanSet *": return result if result != _ffi.NULL else None -def minus_date_spanset(d: "DateADT", ss: "const SpanSet *") -> "SpanSet *": +def minus_date_spanset(d: int, ss: Annotated[_ffi.CData, "const SpanSet *"]) -> Annotated[_ffi.CData, "SpanSet *"]: d_converted = _ffi.cast("DateADT", d) ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.minus_date_spanset(d_converted, ss_converted) @@ -4364,57 +4462,49 @@ def minus_date_spanset(d: "DateADT", ss: "const SpanSet *") -> "SpanSet *": return result if result != _ffi.NULL else None -def minus_float_set(d: float, s: "const Set *") -> "Set *": +def minus_float_set(d: float, s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[_ffi.CData, "Set *"]: s_converted = _ffi.cast("const Set *", s) result = _lib.minus_float_set(d, s_converted) _check_error() return result if result != _ffi.NULL else None -def minus_float_span(d: float, s: "const Span *") -> "SpanSet *": +def minus_float_span(d: float, s: Annotated[_ffi.CData, "const Span *"]) -> Annotated[_ffi.CData, "SpanSet *"]: s_converted = _ffi.cast("const Span *", s) result = _lib.minus_float_span(d, s_converted) _check_error() return result if result != _ffi.NULL else None -def minus_float_spanset(d: float, ss: "const SpanSet *") -> "SpanSet *": +def minus_float_spanset(d: float, ss: Annotated[_ffi.CData, "const SpanSet *"]) -> Annotated[_ffi.CData, "SpanSet *"]: ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.minus_float_spanset(d, ss_converted) _check_error() return result if result != _ffi.NULL else None -def minus_geo_set(gs: "const GSERIALIZED *", s: "const Set *") -> "Set *": - gs_converted = _ffi.cast("const GSERIALIZED *", gs) - s_converted = _ffi.cast("const Set *", s) - result = _lib.minus_geo_set(gs_converted, s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def minus_int_set(i: int, s: "const Set *") -> "Set *": +def minus_int_set(i: int, s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[_ffi.CData, "Set *"]: s_converted = _ffi.cast("const Set *", s) result = _lib.minus_int_set(i, s_converted) _check_error() return result if result != _ffi.NULL else None -def minus_int_span(i: int, s: "const Span *") -> "SpanSet *": +def minus_int_span(i: int, s: Annotated[_ffi.CData, "const Span *"]) -> Annotated[_ffi.CData, "SpanSet *"]: s_converted = _ffi.cast("const Span *", s) result = _lib.minus_int_span(i, s_converted) _check_error() return result if result != _ffi.NULL else None -def minus_int_spanset(i: int, ss: "const SpanSet *") -> "SpanSet *": +def minus_int_spanset(i: int, ss: Annotated[_ffi.CData, "const SpanSet *"]) -> Annotated[_ffi.CData, "SpanSet *"]: ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.minus_int_spanset(i, ss_converted) _check_error() return result if result != _ffi.NULL else None -def minus_set_bigint(s: "const Set *", i: int) -> "Set *": +def minus_set_bigint(s: Annotated[_ffi.CData, "const Set *"], i: int) -> Annotated[_ffi.CData, "Set *"]: s_converted = _ffi.cast("const Set *", s) i_converted = _ffi.cast("int64", i) result = _lib.minus_set_bigint(s_converted, i_converted) @@ -4422,7 +4512,7 @@ def minus_set_bigint(s: "const Set *", i: int) -> "Set *": return result if result != _ffi.NULL else None -def minus_set_date(s: "const Set *", d: "DateADT") -> "Set *": +def minus_set_date(s: Annotated[_ffi.CData, "const Set *"], d: int) -> Annotated[_ffi.CData, "Set *"]: s_converted = _ffi.cast("const Set *", s) d_converted = _ffi.cast("DateADT", d) result = _lib.minus_set_date(s_converted, d_converted) @@ -4430,29 +4520,23 @@ def minus_set_date(s: "const Set *", d: "DateADT") -> "Set *": return result if result != _ffi.NULL else None -def minus_set_float(s: "const Set *", d: float) -> "Set *": +def minus_set_float(s: Annotated[_ffi.CData, "const Set *"], d: float) -> Annotated[_ffi.CData, "Set *"]: s_converted = _ffi.cast("const Set *", s) result = _lib.minus_set_float(s_converted, d) _check_error() return result if result != _ffi.NULL else None -def minus_set_geo(s: "const Set *", gs: "const GSERIALIZED *") -> "Set *": - s_converted = _ffi.cast("const Set *", s) - gs_converted = _ffi.cast("const GSERIALIZED *", gs) - result = _lib.minus_set_geo(s_converted, gs_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def minus_set_int(s: "const Set *", i: int) -> "Set *": +def minus_set_int(s: Annotated[_ffi.CData, "const Set *"], i: int) -> Annotated[_ffi.CData, "Set *"]: s_converted = _ffi.cast("const Set *", s) result = _lib.minus_set_int(s_converted, i) _check_error() return result if result != _ffi.NULL else None -def minus_set_set(s1: "const Set *", s2: "const Set *") -> "Set *": +def minus_set_set( + s1: Annotated[_ffi.CData, "const Set *"], s2: Annotated[_ffi.CData, "const Set *"] +) -> Annotated[_ffi.CData, "Set *"]: s1_converted = _ffi.cast("const Set *", s1) s2_converted = _ffi.cast("const Set *", s2) result = _lib.minus_set_set(s1_converted, s2_converted) @@ -4460,7 +4544,7 @@ def minus_set_set(s1: "const Set *", s2: "const Set *") -> "Set *": return result if result != _ffi.NULL else None -def minus_set_text(s: "const Set *", txt: str) -> "Set *": +def minus_set_text(s: Annotated[_ffi.CData, "const Set *"], txt: str) -> Annotated[_ffi.CData, "Set *"]: s_converted = _ffi.cast("const Set *", s) txt_converted = cstring2text(txt) result = _lib.minus_set_text(s_converted, txt_converted) @@ -4468,7 +4552,7 @@ def minus_set_text(s: "const Set *", txt: str) -> "Set *": return result if result != _ffi.NULL else None -def minus_set_timestamptz(s: "const Set *", t: int) -> "Set *": +def minus_set_timestamptz(s: Annotated[_ffi.CData, "const Set *"], t: int) -> Annotated[_ffi.CData, "Set *"]: s_converted = _ffi.cast("const Set *", s) t_converted = _ffi.cast("TimestampTz", t) result = _lib.minus_set_timestamptz(s_converted, t_converted) @@ -4476,7 +4560,7 @@ def minus_set_timestamptz(s: "const Set *", t: int) -> "Set *": return result if result != _ffi.NULL else None -def minus_span_bigint(s: "const Span *", i: int) -> "SpanSet *": +def minus_span_bigint(s: Annotated[_ffi.CData, "const Span *"], i: int) -> Annotated[_ffi.CData, "SpanSet *"]: s_converted = _ffi.cast("const Span *", s) i_converted = _ffi.cast("int64", i) result = _lib.minus_span_bigint(s_converted, i_converted) @@ -4484,7 +4568,7 @@ def minus_span_bigint(s: "const Span *", i: int) -> "SpanSet *": return result if result != _ffi.NULL else None -def minus_span_date(s: "const Span *", d: "DateADT") -> "SpanSet *": +def minus_span_date(s: Annotated[_ffi.CData, "const Span *"], d: int) -> Annotated[_ffi.CData, "SpanSet *"]: s_converted = _ffi.cast("const Span *", s) d_converted = _ffi.cast("DateADT", d) result = _lib.minus_span_date(s_converted, d_converted) @@ -4492,21 +4576,23 @@ def minus_span_date(s: "const Span *", d: "DateADT") -> "SpanSet *": return result if result != _ffi.NULL else None -def minus_span_float(s: "const Span *", d: float) -> "SpanSet *": +def minus_span_float(s: Annotated[_ffi.CData, "const Span *"], d: float) -> Annotated[_ffi.CData, "SpanSet *"]: s_converted = _ffi.cast("const Span *", s) result = _lib.minus_span_float(s_converted, d) _check_error() return result if result != _ffi.NULL else None -def minus_span_int(s: "const Span *", i: int) -> "SpanSet *": +def minus_span_int(s: Annotated[_ffi.CData, "const Span *"], i: int) -> Annotated[_ffi.CData, "SpanSet *"]: s_converted = _ffi.cast("const Span *", s) result = _lib.minus_span_int(s_converted, i) _check_error() return result if result != _ffi.NULL else None -def minus_span_span(s1: "const Span *", s2: "const Span *") -> "SpanSet *": +def minus_span_span( + s1: Annotated[_ffi.CData, "const Span *"], s2: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[_ffi.CData, "SpanSet *"]: s1_converted = _ffi.cast("const Span *", s1) s2_converted = _ffi.cast("const Span *", s2) result = _lib.minus_span_span(s1_converted, s2_converted) @@ -4514,7 +4600,9 @@ def minus_span_span(s1: "const Span *", s2: "const Span *") -> "SpanSet *": return result if result != _ffi.NULL else None -def minus_span_spanset(s: "const Span *", ss: "const SpanSet *") -> "SpanSet *": +def minus_span_spanset( + s: Annotated[_ffi.CData, "const Span *"], ss: Annotated[_ffi.CData, "const SpanSet *"] +) -> Annotated[_ffi.CData, "SpanSet *"]: s_converted = _ffi.cast("const Span *", s) ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.minus_span_spanset(s_converted, ss_converted) @@ -4522,7 +4610,7 @@ def minus_span_spanset(s: "const Span *", ss: "const SpanSet *") -> "SpanSet *": return result if result != _ffi.NULL else None -def minus_span_timestamptz(s: "const Span *", t: int) -> "SpanSet *": +def minus_span_timestamptz(s: Annotated[_ffi.CData, "const Span *"], t: int) -> Annotated[_ffi.CData, "SpanSet *"]: s_converted = _ffi.cast("const Span *", s) t_converted = _ffi.cast("TimestampTz", t) result = _lib.minus_span_timestamptz(s_converted, t_converted) @@ -4530,7 +4618,7 @@ def minus_span_timestamptz(s: "const Span *", t: int) -> "SpanSet *": return result if result != _ffi.NULL else None -def minus_spanset_bigint(ss: "const SpanSet *", i: int) -> "SpanSet *": +def minus_spanset_bigint(ss: Annotated[_ffi.CData, "const SpanSet *"], i: int) -> Annotated[_ffi.CData, "SpanSet *"]: ss_converted = _ffi.cast("const SpanSet *", ss) i_converted = _ffi.cast("int64", i) result = _lib.minus_spanset_bigint(ss_converted, i_converted) @@ -4538,7 +4626,7 @@ def minus_spanset_bigint(ss: "const SpanSet *", i: int) -> "SpanSet *": return result if result != _ffi.NULL else None -def minus_spanset_date(ss: "const SpanSet *", d: "DateADT") -> "SpanSet *": +def minus_spanset_date(ss: Annotated[_ffi.CData, "const SpanSet *"], d: int) -> Annotated[_ffi.CData, "SpanSet *"]: ss_converted = _ffi.cast("const SpanSet *", ss) d_converted = _ffi.cast("DateADT", d) result = _lib.minus_spanset_date(ss_converted, d_converted) @@ -4546,21 +4634,23 @@ def minus_spanset_date(ss: "const SpanSet *", d: "DateADT") -> "SpanSet *": return result if result != _ffi.NULL else None -def minus_spanset_float(ss: "const SpanSet *", d: float) -> "SpanSet *": +def minus_spanset_float(ss: Annotated[_ffi.CData, "const SpanSet *"], d: float) -> Annotated[_ffi.CData, "SpanSet *"]: ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.minus_spanset_float(ss_converted, d) _check_error() return result if result != _ffi.NULL else None -def minus_spanset_int(ss: "const SpanSet *", i: int) -> "SpanSet *": +def minus_spanset_int(ss: Annotated[_ffi.CData, "const SpanSet *"], i: int) -> Annotated[_ffi.CData, "SpanSet *"]: ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.minus_spanset_int(ss_converted, i) _check_error() return result if result != _ffi.NULL else None -def minus_spanset_span(ss: "const SpanSet *", s: "const Span *") -> "SpanSet *": +def minus_spanset_span( + ss: Annotated[_ffi.CData, "const SpanSet *"], s: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[_ffi.CData, "SpanSet *"]: ss_converted = _ffi.cast("const SpanSet *", ss) s_converted = _ffi.cast("const Span *", s) result = _lib.minus_spanset_span(ss_converted, s_converted) @@ -4569,8 +4659,8 @@ def minus_spanset_span(ss: "const SpanSet *", s: "const Span *") -> "SpanSet *": def minus_spanset_spanset( - ss1: "const SpanSet *", ss2: "const SpanSet *" -) -> "SpanSet *": + ss1: Annotated[_ffi.CData, "const SpanSet *"], ss2: Annotated[_ffi.CData, "const SpanSet *"] +) -> Annotated[_ffi.CData, "SpanSet *"]: ss1_converted = _ffi.cast("const SpanSet *", ss1) ss2_converted = _ffi.cast("const SpanSet *", ss2) result = _lib.minus_spanset_spanset(ss1_converted, ss2_converted) @@ -4578,7 +4668,9 @@ def minus_spanset_spanset( return result if result != _ffi.NULL else None -def minus_spanset_timestamptz(ss: "const SpanSet *", t: int) -> "SpanSet *": +def minus_spanset_timestamptz( + ss: Annotated[_ffi.CData, "const SpanSet *"], t: int +) -> Annotated[_ffi.CData, "SpanSet *"]: ss_converted = _ffi.cast("const SpanSet *", ss) t_converted = _ffi.cast("TimestampTz", t) result = _lib.minus_spanset_timestamptz(ss_converted, t_converted) @@ -4586,7 +4678,7 @@ def minus_spanset_timestamptz(ss: "const SpanSet *", t: int) -> "SpanSet *": return result if result != _ffi.NULL else None -def minus_text_set(txt: str, s: "const Set *") -> "Set *": +def minus_text_set(txt: str, s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[_ffi.CData, "Set *"]: txt_converted = cstring2text(txt) s_converted = _ffi.cast("const Set *", s) result = _lib.minus_text_set(txt_converted, s_converted) @@ -4594,7 +4686,7 @@ def minus_text_set(txt: str, s: "const Set *") -> "Set *": return result if result != _ffi.NULL else None -def minus_timestamptz_set(t: int, s: "const Set *") -> "Set *": +def minus_timestamptz_set(t: int, s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[_ffi.CData, "Set *"]: t_converted = _ffi.cast("TimestampTz", t) s_converted = _ffi.cast("const Set *", s) result = _lib.minus_timestamptz_set(t_converted, s_converted) @@ -4602,7 +4694,7 @@ def minus_timestamptz_set(t: int, s: "const Set *") -> "Set *": return result if result != _ffi.NULL else None -def minus_timestamptz_span(t: int, s: "const Span *") -> "SpanSet *": +def minus_timestamptz_span(t: int, s: Annotated[_ffi.CData, "const Span *"]) -> Annotated[_ffi.CData, "SpanSet *"]: t_converted = _ffi.cast("TimestampTz", t) s_converted = _ffi.cast("const Span *", s) result = _lib.minus_timestamptz_span(t_converted, s_converted) @@ -4610,7 +4702,9 @@ def minus_timestamptz_span(t: int, s: "const Span *") -> "SpanSet *": return result if result != _ffi.NULL else None -def minus_timestamptz_spanset(t: int, ss: "const SpanSet *") -> "SpanSet *": +def minus_timestamptz_spanset( + t: int, ss: Annotated[_ffi.CData, "const SpanSet *"] +) -> Annotated[_ffi.CData, "SpanSet *"]: t_converted = _ffi.cast("TimestampTz", t) ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.minus_timestamptz_spanset(t_converted, ss_converted) @@ -4618,7 +4712,7 @@ def minus_timestamptz_spanset(t: int, ss: "const SpanSet *") -> "SpanSet *": return result if result != _ffi.NULL else None -def union_bigint_set(i: int, s: "const Set *") -> "Set *": +def union_bigint_set(i: int, s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[_ffi.CData, "Set *"]: i_converted = _ffi.cast("int64", i) s_converted = _ffi.cast("const Set *", s) result = _lib.union_bigint_set(i_converted, s_converted) @@ -4626,7 +4720,7 @@ def union_bigint_set(i: int, s: "const Set *") -> "Set *": return result if result != _ffi.NULL else None -def union_bigint_span(s: "const Span *", i: int) -> "SpanSet *": +def union_bigint_span(s: Annotated[_ffi.CData, "const Span *"], i: int) -> Annotated[_ffi.CData, "SpanSet *"]: s_converted = _ffi.cast("const Span *", s) i_converted = _ffi.cast("int64", i) result = _lib.union_bigint_span(s_converted, i_converted) @@ -4634,7 +4728,7 @@ def union_bigint_span(s: "const Span *", i: int) -> "SpanSet *": return result if result != _ffi.NULL else None -def union_bigint_spanset(i: int, ss: "SpanSet *") -> "SpanSet *": +def union_bigint_spanset(i: int, ss: Annotated[_ffi.CData, "SpanSet *"]) -> Annotated[_ffi.CData, "SpanSet *"]: i_converted = _ffi.cast("int64", i) ss_converted = _ffi.cast("SpanSet *", ss) result = _lib.union_bigint_spanset(i_converted, ss_converted) @@ -4642,15 +4736,15 @@ def union_bigint_spanset(i: int, ss: "SpanSet *") -> "SpanSet *": return result if result != _ffi.NULL else None -def union_date_set(d: "const DateADT", s: "const Set *") -> "Set *": - d_converted = _ffi.cast("const DateADT", d) +def union_date_set(d: int, s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[_ffi.CData, "Set *"]: + d_converted = _ffi.cast("DateADT", d) s_converted = _ffi.cast("const Set *", s) result = _lib.union_date_set(d_converted, s_converted) _check_error() return result if result != _ffi.NULL else None -def union_date_span(s: "const Span *", d: "DateADT") -> "SpanSet *": +def union_date_span(s: Annotated[_ffi.CData, "const Span *"], d: int) -> Annotated[_ffi.CData, "SpanSet *"]: s_converted = _ffi.cast("const Span *", s) d_converted = _ffi.cast("DateADT", d) result = _lib.union_date_span(s_converted, d_converted) @@ -4658,7 +4752,7 @@ def union_date_span(s: "const Span *", d: "DateADT") -> "SpanSet *": return result if result != _ffi.NULL else None -def union_date_spanset(d: "DateADT", ss: "SpanSet *") -> "SpanSet *": +def union_date_spanset(d: int, ss: Annotated[_ffi.CData, "SpanSet *"]) -> Annotated[_ffi.CData, "SpanSet *"]: d_converted = _ffi.cast("DateADT", d) ss_converted = _ffi.cast("SpanSet *", ss) result = _lib.union_date_spanset(d_converted, ss_converted) @@ -4666,57 +4760,49 @@ def union_date_spanset(d: "DateADT", ss: "SpanSet *") -> "SpanSet *": return result if result != _ffi.NULL else None -def union_float_set(d: float, s: "const Set *") -> "Set *": +def union_float_set(d: float, s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[_ffi.CData, "Set *"]: s_converted = _ffi.cast("const Set *", s) result = _lib.union_float_set(d, s_converted) _check_error() return result if result != _ffi.NULL else None -def union_float_span(s: "const Span *", d: float) -> "SpanSet *": +def union_float_span(s: Annotated[_ffi.CData, "const Span *"], d: float) -> Annotated[_ffi.CData, "SpanSet *"]: s_converted = _ffi.cast("const Span *", s) result = _lib.union_float_span(s_converted, d) _check_error() return result if result != _ffi.NULL else None -def union_float_spanset(d: float, ss: "SpanSet *") -> "SpanSet *": +def union_float_spanset(d: float, ss: Annotated[_ffi.CData, "SpanSet *"]) -> Annotated[_ffi.CData, "SpanSet *"]: ss_converted = _ffi.cast("SpanSet *", ss) result = _lib.union_float_spanset(d, ss_converted) _check_error() return result if result != _ffi.NULL else None -def union_geo_set(gs: "const GSERIALIZED *", s: "const Set *") -> "Set *": - gs_converted = _ffi.cast("const GSERIALIZED *", gs) - s_converted = _ffi.cast("const Set *", s) - result = _lib.union_geo_set(gs_converted, s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def union_int_set(i: int, s: "const Set *") -> "Set *": +def union_int_set(i: int, s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[_ffi.CData, "Set *"]: s_converted = _ffi.cast("const Set *", s) result = _lib.union_int_set(i, s_converted) _check_error() return result if result != _ffi.NULL else None -def union_int_span(i: int, s: "const Span *") -> "SpanSet *": +def union_int_span(i: int, s: Annotated[_ffi.CData, "const Span *"]) -> Annotated[_ffi.CData, "SpanSet *"]: s_converted = _ffi.cast("const Span *", s) result = _lib.union_int_span(i, s_converted) _check_error() return result if result != _ffi.NULL else None -def union_int_spanset(i: int, ss: "SpanSet *") -> "SpanSet *": +def union_int_spanset(i: int, ss: Annotated[_ffi.CData, "SpanSet *"]) -> Annotated[_ffi.CData, "SpanSet *"]: ss_converted = _ffi.cast("SpanSet *", ss) result = _lib.union_int_spanset(i, ss_converted) _check_error() return result if result != _ffi.NULL else None -def union_set_bigint(s: "const Set *", i: int) -> "Set *": +def union_set_bigint(s: Annotated[_ffi.CData, "const Set *"], i: int) -> Annotated[_ffi.CData, "Set *"]: s_converted = _ffi.cast("const Set *", s) i_converted = _ffi.cast("int64", i) result = _lib.union_set_bigint(s_converted, i_converted) @@ -4724,7 +4810,7 @@ def union_set_bigint(s: "const Set *", i: int) -> "Set *": return result if result != _ffi.NULL else None -def union_set_date(s: "const Set *", d: "DateADT") -> "Set *": +def union_set_date(s: Annotated[_ffi.CData, "const Set *"], d: int) -> Annotated[_ffi.CData, "Set *"]: s_converted = _ffi.cast("const Set *", s) d_converted = _ffi.cast("DateADT", d) result = _lib.union_set_date(s_converted, d_converted) @@ -4732,29 +4818,23 @@ def union_set_date(s: "const Set *", d: "DateADT") -> "Set *": return result if result != _ffi.NULL else None -def union_set_float(s: "const Set *", d: float) -> "Set *": +def union_set_float(s: Annotated[_ffi.CData, "const Set *"], d: float) -> Annotated[_ffi.CData, "Set *"]: s_converted = _ffi.cast("const Set *", s) result = _lib.union_set_float(s_converted, d) _check_error() return result if result != _ffi.NULL else None -def union_set_geo(s: "const Set *", gs: "const GSERIALIZED *") -> "Set *": - s_converted = _ffi.cast("const Set *", s) - gs_converted = _ffi.cast("const GSERIALIZED *", gs) - result = _lib.union_set_geo(s_converted, gs_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def union_set_int(s: "const Set *", i: int) -> "Set *": +def union_set_int(s: Annotated[_ffi.CData, "const Set *"], i: int) -> Annotated[_ffi.CData, "Set *"]: s_converted = _ffi.cast("const Set *", s) result = _lib.union_set_int(s_converted, i) _check_error() return result if result != _ffi.NULL else None -def union_set_set(s1: "const Set *", s2: "const Set *") -> "Set *": +def union_set_set( + s1: Annotated[_ffi.CData, "const Set *"], s2: Annotated[_ffi.CData, "const Set *"] +) -> Annotated[_ffi.CData, "Set *"]: s1_converted = _ffi.cast("const Set *", s1) s2_converted = _ffi.cast("const Set *", s2) result = _lib.union_set_set(s1_converted, s2_converted) @@ -4762,7 +4842,7 @@ def union_set_set(s1: "const Set *", s2: "const Set *") -> "Set *": return result if result != _ffi.NULL else None -def union_set_text(s: "const Set *", txt: str) -> "Set *": +def union_set_text(s: Annotated[_ffi.CData, "const Set *"], txt: str) -> Annotated[_ffi.CData, "Set *"]: s_converted = _ffi.cast("const Set *", s) txt_converted = cstring2text(txt) result = _lib.union_set_text(s_converted, txt_converted) @@ -4770,15 +4850,15 @@ def union_set_text(s: "const Set *", txt: str) -> "Set *": return result if result != _ffi.NULL else None -def union_set_timestamptz(s: "const Set *", t: int) -> "Set *": +def union_set_timestamptz(s: Annotated[_ffi.CData, "const Set *"], t: int) -> Annotated[_ffi.CData, "Set *"]: s_converted = _ffi.cast("const Set *", s) - t_converted = _ffi.cast("const TimestampTz", t) + t_converted = _ffi.cast("TimestampTz", t) result = _lib.union_set_timestamptz(s_converted, t_converted) _check_error() return result if result != _ffi.NULL else None -def union_span_bigint(s: "const Span *", i: int) -> "SpanSet *": +def union_span_bigint(s: Annotated[_ffi.CData, "const Span *"], i: int) -> Annotated[_ffi.CData, "SpanSet *"]: s_converted = _ffi.cast("const Span *", s) i_converted = _ffi.cast("int64", i) result = _lib.union_span_bigint(s_converted, i_converted) @@ -4786,7 +4866,7 @@ def union_span_bigint(s: "const Span *", i: int) -> "SpanSet *": return result if result != _ffi.NULL else None -def union_span_date(s: "const Span *", d: "DateADT") -> "SpanSet *": +def union_span_date(s: Annotated[_ffi.CData, "const Span *"], d: int) -> Annotated[_ffi.CData, "SpanSet *"]: s_converted = _ffi.cast("const Span *", s) d_converted = _ffi.cast("DateADT", d) result = _lib.union_span_date(s_converted, d_converted) @@ -4794,21 +4874,23 @@ def union_span_date(s: "const Span *", d: "DateADT") -> "SpanSet *": return result if result != _ffi.NULL else None -def union_span_float(s: "const Span *", d: float) -> "SpanSet *": +def union_span_float(s: Annotated[_ffi.CData, "const Span *"], d: float) -> Annotated[_ffi.CData, "SpanSet *"]: s_converted = _ffi.cast("const Span *", s) result = _lib.union_span_float(s_converted, d) _check_error() return result if result != _ffi.NULL else None -def union_span_int(s: "const Span *", i: int) -> "SpanSet *": +def union_span_int(s: Annotated[_ffi.CData, "const Span *"], i: int) -> Annotated[_ffi.CData, "SpanSet *"]: s_converted = _ffi.cast("const Span *", s) result = _lib.union_span_int(s_converted, i) _check_error() return result if result != _ffi.NULL else None -def union_span_span(s1: "const Span *", s2: "const Span *") -> "SpanSet *": +def union_span_span( + s1: Annotated[_ffi.CData, "const Span *"], s2: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[_ffi.CData, "SpanSet *"]: s1_converted = _ffi.cast("const Span *", s1) s2_converted = _ffi.cast("const Span *", s2) result = _lib.union_span_span(s1_converted, s2_converted) @@ -4816,7 +4898,9 @@ def union_span_span(s1: "const Span *", s2: "const Span *") -> "SpanSet *": return result if result != _ffi.NULL else None -def union_span_spanset(s: "const Span *", ss: "const SpanSet *") -> "SpanSet *": +def union_span_spanset( + s: Annotated[_ffi.CData, "const Span *"], ss: Annotated[_ffi.CData, "const SpanSet *"] +) -> Annotated[_ffi.CData, "SpanSet *"]: s_converted = _ffi.cast("const Span *", s) ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.union_span_spanset(s_converted, ss_converted) @@ -4824,7 +4908,7 @@ def union_span_spanset(s: "const Span *", ss: "const SpanSet *") -> "SpanSet *": return result if result != _ffi.NULL else None -def union_span_timestamptz(s: "const Span *", t: int) -> "SpanSet *": +def union_span_timestamptz(s: Annotated[_ffi.CData, "const Span *"], t: int) -> Annotated[_ffi.CData, "SpanSet *"]: s_converted = _ffi.cast("const Span *", s) t_converted = _ffi.cast("TimestampTz", t) result = _lib.union_span_timestamptz(s_converted, t_converted) @@ -4832,7 +4916,7 @@ def union_span_timestamptz(s: "const Span *", t: int) -> "SpanSet *": return result if result != _ffi.NULL else None -def union_spanset_bigint(ss: "const SpanSet *", i: int) -> "SpanSet *": +def union_spanset_bigint(ss: Annotated[_ffi.CData, "const SpanSet *"], i: int) -> Annotated[_ffi.CData, "SpanSet *"]: ss_converted = _ffi.cast("const SpanSet *", ss) i_converted = _ffi.cast("int64", i) result = _lib.union_spanset_bigint(ss_converted, i_converted) @@ -4840,7 +4924,7 @@ def union_spanset_bigint(ss: "const SpanSet *", i: int) -> "SpanSet *": return result if result != _ffi.NULL else None -def union_spanset_date(ss: "const SpanSet *", d: "DateADT") -> "SpanSet *": +def union_spanset_date(ss: Annotated[_ffi.CData, "const SpanSet *"], d: int) -> Annotated[_ffi.CData, "SpanSet *"]: ss_converted = _ffi.cast("const SpanSet *", ss) d_converted = _ffi.cast("DateADT", d) result = _lib.union_spanset_date(ss_converted, d_converted) @@ -4848,21 +4932,23 @@ def union_spanset_date(ss: "const SpanSet *", d: "DateADT") -> "SpanSet *": return result if result != _ffi.NULL else None -def union_spanset_float(ss: "const SpanSet *", d: float) -> "SpanSet *": +def union_spanset_float(ss: Annotated[_ffi.CData, "const SpanSet *"], d: float) -> Annotated[_ffi.CData, "SpanSet *"]: ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.union_spanset_float(ss_converted, d) _check_error() return result if result != _ffi.NULL else None -def union_spanset_int(ss: "const SpanSet *", i: int) -> "SpanSet *": +def union_spanset_int(ss: Annotated[_ffi.CData, "const SpanSet *"], i: int) -> Annotated[_ffi.CData, "SpanSet *"]: ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.union_spanset_int(ss_converted, i) _check_error() return result if result != _ffi.NULL else None -def union_spanset_span(ss: "const SpanSet *", s: "const Span *") -> "SpanSet *": +def union_spanset_span( + ss: Annotated[_ffi.CData, "const SpanSet *"], s: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[_ffi.CData, "SpanSet *"]: ss_converted = _ffi.cast("const SpanSet *", ss) s_converted = _ffi.cast("const Span *", s) result = _lib.union_spanset_span(ss_converted, s_converted) @@ -4871,8 +4957,8 @@ def union_spanset_span(ss: "const SpanSet *", s: "const Span *") -> "SpanSet *": def union_spanset_spanset( - ss1: "const SpanSet *", ss2: "const SpanSet *" -) -> "SpanSet *": + ss1: Annotated[_ffi.CData, "const SpanSet *"], ss2: Annotated[_ffi.CData, "const SpanSet *"] +) -> Annotated[_ffi.CData, "SpanSet *"]: ss1_converted = _ffi.cast("const SpanSet *", ss1) ss2_converted = _ffi.cast("const SpanSet *", ss2) result = _lib.union_spanset_spanset(ss1_converted, ss2_converted) @@ -4880,7 +4966,9 @@ def union_spanset_spanset( return result if result != _ffi.NULL else None -def union_spanset_timestamptz(ss: "const SpanSet *", t: int) -> "SpanSet *": +def union_spanset_timestamptz( + ss: Annotated[_ffi.CData, "const SpanSet *"], t: int +) -> Annotated[_ffi.CData, "SpanSet *"]: ss_converted = _ffi.cast("const SpanSet *", ss) t_converted = _ffi.cast("TimestampTz", t) result = _lib.union_spanset_timestamptz(ss_converted, t_converted) @@ -4888,7 +4976,7 @@ def union_spanset_timestamptz(ss: "const SpanSet *", t: int) -> "SpanSet *": return result if result != _ffi.NULL else None -def union_text_set(txt: str, s: "const Set *") -> "Set *": +def union_text_set(txt: str, s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[_ffi.CData, "Set *"]: txt_converted = cstring2text(txt) s_converted = _ffi.cast("const Set *", s) result = _lib.union_text_set(txt_converted, s_converted) @@ -4896,15 +4984,15 @@ def union_text_set(txt: str, s: "const Set *") -> "Set *": return result if result != _ffi.NULL else None -def union_timestamptz_set(t: int, s: "const Set *") -> "Set *": - t_converted = _ffi.cast("const TimestampTz", t) +def union_timestamptz_set(t: int, s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[_ffi.CData, "Set *"]: + t_converted = _ffi.cast("TimestampTz", t) s_converted = _ffi.cast("const Set *", s) result = _lib.union_timestamptz_set(t_converted, s_converted) _check_error() return result if result != _ffi.NULL else None -def union_timestamptz_span(t: int, s: "const Span *") -> "SpanSet *": +def union_timestamptz_span(t: int, s: Annotated[_ffi.CData, "const Span *"]) -> Annotated[_ffi.CData, "SpanSet *"]: t_converted = _ffi.cast("TimestampTz", t) s_converted = _ffi.cast("const Span *", s) result = _lib.union_timestamptz_span(t_converted, s_converted) @@ -4912,7 +5000,7 @@ def union_timestamptz_span(t: int, s: "const Span *") -> "SpanSet *": return result if result != _ffi.NULL else None -def union_timestamptz_spanset(t: int, ss: "SpanSet *") -> "SpanSet *": +def union_timestamptz_spanset(t: int, ss: Annotated[_ffi.CData, "SpanSet *"]) -> Annotated[_ffi.CData, "SpanSet *"]: t_converted = _ffi.cast("TimestampTz", t) ss_converted = _ffi.cast("SpanSet *", ss) result = _lib.union_timestamptz_spanset(t_converted, ss_converted) @@ -4920,7 +5008,9 @@ def union_timestamptz_spanset(t: int, ss: "SpanSet *") -> "SpanSet *": return result if result != _ffi.NULL else None -def distance_bigintset_bigintset(s1: "const Set *", s2: "const Set *") -> "int64": +def distance_bigintset_bigintset( + s1: Annotated[_ffi.CData, "const Set *"], s2: Annotated[_ffi.CData, "const Set *"] +) -> Annotated[int, "int64"]: s1_converted = _ffi.cast("const Set *", s1) s2_converted = _ffi.cast("const Set *", s2) result = _lib.distance_bigintset_bigintset(s1_converted, s2_converted) @@ -4928,7 +5018,9 @@ def distance_bigintset_bigintset(s1: "const Set *", s2: "const Set *") -> "int64 return result if result != _ffi.NULL else None -def distance_bigintspan_bigintspan(s1: "const Span *", s2: "const Span *") -> "int64": +def distance_bigintspan_bigintspan( + s1: Annotated[_ffi.CData, "const Span *"], s2: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[int, "int64"]: s1_converted = _ffi.cast("const Span *", s1) s2_converted = _ffi.cast("const Span *", s2) result = _lib.distance_bigintspan_bigintspan(s1_converted, s2_converted) @@ -4937,8 +5029,8 @@ def distance_bigintspan_bigintspan(s1: "const Span *", s2: "const Span *") -> "i def distance_bigintspanset_bigintspan( - ss: "const SpanSet *", s: "const Span *" -) -> "int64": + ss: Annotated[_ffi.CData, "const SpanSet *"], s: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[int, "int64"]: ss_converted = _ffi.cast("const SpanSet *", ss) s_converted = _ffi.cast("const Span *", s) result = _lib.distance_bigintspanset_bigintspan(ss_converted, s_converted) @@ -4947,8 +5039,8 @@ def distance_bigintspanset_bigintspan( def distance_bigintspanset_bigintspanset( - ss1: "const SpanSet *", ss2: "const SpanSet *" -) -> "int64": + ss1: Annotated[_ffi.CData, "const SpanSet *"], ss2: Annotated[_ffi.CData, "const SpanSet *"] +) -> Annotated[int, "int64"]: ss1_converted = _ffi.cast("const SpanSet *", ss1) ss2_converted = _ffi.cast("const SpanSet *", ss2) result = _lib.distance_bigintspanset_bigintspanset(ss1_converted, ss2_converted) @@ -4956,7 +5048,9 @@ def distance_bigintspanset_bigintspanset( return result if result != _ffi.NULL else None -def distance_dateset_dateset(s1: "const Set *", s2: "const Set *") -> "int": +def distance_dateset_dateset( + s1: Annotated[_ffi.CData, "const Set *"], s2: Annotated[_ffi.CData, "const Set *"] +) -> Annotated[int, "int"]: s1_converted = _ffi.cast("const Set *", s1) s2_converted = _ffi.cast("const Set *", s2) result = _lib.distance_dateset_dateset(s1_converted, s2_converted) @@ -4964,7 +5058,9 @@ def distance_dateset_dateset(s1: "const Set *", s2: "const Set *") -> "int": return result if result != _ffi.NULL else None -def distance_datespan_datespan(s1: "const Span *", s2: "const Span *") -> "int": +def distance_datespan_datespan( + s1: Annotated[_ffi.CData, "const Span *"], s2: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[int, "int"]: s1_converted = _ffi.cast("const Span *", s1) s2_converted = _ffi.cast("const Span *", s2) result = _lib.distance_datespan_datespan(s1_converted, s2_converted) @@ -4972,7 +5068,9 @@ def distance_datespan_datespan(s1: "const Span *", s2: "const Span *") -> "int": return result if result != _ffi.NULL else None -def distance_datespanset_datespan(ss: "const SpanSet *", s: "const Span *") -> "int": +def distance_datespanset_datespan( + ss: Annotated[_ffi.CData, "const SpanSet *"], s: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[int, "int"]: ss_converted = _ffi.cast("const SpanSet *", ss) s_converted = _ffi.cast("const Span *", s) result = _lib.distance_datespanset_datespan(ss_converted, s_converted) @@ -4981,8 +5079,8 @@ def distance_datespanset_datespan(ss: "const SpanSet *", s: "const Span *") -> " def distance_datespanset_datespanset( - ss1: "const SpanSet *", ss2: "const SpanSet *" -) -> "int": + ss1: Annotated[_ffi.CData, "const SpanSet *"], ss2: Annotated[_ffi.CData, "const SpanSet *"] +) -> Annotated[int, "int"]: ss1_converted = _ffi.cast("const SpanSet *", ss1) ss2_converted = _ffi.cast("const SpanSet *", ss2) result = _lib.distance_datespanset_datespanset(ss1_converted, ss2_converted) @@ -4990,7 +5088,9 @@ def distance_datespanset_datespanset( return result if result != _ffi.NULL else None -def distance_floatset_floatset(s1: "const Set *", s2: "const Set *") -> "double": +def distance_floatset_floatset( + s1: Annotated[_ffi.CData, "const Set *"], s2: Annotated[_ffi.CData, "const Set *"] +) -> Annotated[float, "double"]: s1_converted = _ffi.cast("const Set *", s1) s2_converted = _ffi.cast("const Set *", s2) result = _lib.distance_floatset_floatset(s1_converted, s2_converted) @@ -4998,7 +5098,9 @@ def distance_floatset_floatset(s1: "const Set *", s2: "const Set *") -> "double" return result if result != _ffi.NULL else None -def distance_floatspan_floatspan(s1: "const Span *", s2: "const Span *") -> "double": +def distance_floatspan_floatspan( + s1: Annotated[_ffi.CData, "const Span *"], s2: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[float, "double"]: s1_converted = _ffi.cast("const Span *", s1) s2_converted = _ffi.cast("const Span *", s2) result = _lib.distance_floatspan_floatspan(s1_converted, s2_converted) @@ -5007,8 +5109,8 @@ def distance_floatspan_floatspan(s1: "const Span *", s2: "const Span *") -> "dou def distance_floatspanset_floatspan( - ss: "const SpanSet *", s: "const Span *" -) -> "double": + ss: Annotated[_ffi.CData, "const SpanSet *"], s: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[float, "double"]: ss_converted = _ffi.cast("const SpanSet *", ss) s_converted = _ffi.cast("const Span *", s) result = _lib.distance_floatspanset_floatspan(ss_converted, s_converted) @@ -5017,8 +5119,8 @@ def distance_floatspanset_floatspan( def distance_floatspanset_floatspanset( - ss1: "const SpanSet *", ss2: "const SpanSet *" -) -> "double": + ss1: Annotated[_ffi.CData, "const SpanSet *"], ss2: Annotated[_ffi.CData, "const SpanSet *"] +) -> Annotated[float, "double"]: ss1_converted = _ffi.cast("const SpanSet *", ss1) ss2_converted = _ffi.cast("const SpanSet *", ss2) result = _lib.distance_floatspanset_floatspanset(ss1_converted, ss2_converted) @@ -5026,7 +5128,9 @@ def distance_floatspanset_floatspanset( return result if result != _ffi.NULL else None -def distance_intset_intset(s1: "const Set *", s2: "const Set *") -> "int": +def distance_intset_intset( + s1: Annotated[_ffi.CData, "const Set *"], s2: Annotated[_ffi.CData, "const Set *"] +) -> Annotated[int, "int"]: s1_converted = _ffi.cast("const Set *", s1) s2_converted = _ffi.cast("const Set *", s2) result = _lib.distance_intset_intset(s1_converted, s2_converted) @@ -5034,7 +5138,9 @@ def distance_intset_intset(s1: "const Set *", s2: "const Set *") -> "int": return result if result != _ffi.NULL else None -def distance_intspan_intspan(s1: "const Span *", s2: "const Span *") -> "int": +def distance_intspan_intspan( + s1: Annotated[_ffi.CData, "const Span *"], s2: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[int, "int"]: s1_converted = _ffi.cast("const Span *", s1) s2_converted = _ffi.cast("const Span *", s2) result = _lib.distance_intspan_intspan(s1_converted, s2_converted) @@ -5042,7 +5148,9 @@ def distance_intspan_intspan(s1: "const Span *", s2: "const Span *") -> "int": return result if result != _ffi.NULL else None -def distance_intspanset_intspan(ss: "const SpanSet *", s: "const Span *") -> "int": +def distance_intspanset_intspan( + ss: Annotated[_ffi.CData, "const SpanSet *"], s: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[int, "int"]: ss_converted = _ffi.cast("const SpanSet *", ss) s_converted = _ffi.cast("const Span *", s) result = _lib.distance_intspanset_intspan(ss_converted, s_converted) @@ -5051,8 +5159,8 @@ def distance_intspanset_intspan(ss: "const SpanSet *", s: "const Span *") -> "in def distance_intspanset_intspanset( - ss1: "const SpanSet *", ss2: "const SpanSet *" -) -> "int": + ss1: Annotated[_ffi.CData, "const SpanSet *"], ss2: Annotated[_ffi.CData, "const SpanSet *"] +) -> Annotated[int, "int"]: ss1_converted = _ffi.cast("const SpanSet *", ss1) ss2_converted = _ffi.cast("const SpanSet *", ss2) result = _lib.distance_intspanset_intspanset(ss1_converted, ss2_converted) @@ -5060,7 +5168,7 @@ def distance_intspanset_intspanset( return result if result != _ffi.NULL else None -def distance_set_bigint(s: "const Set *", i: int) -> "int64": +def distance_set_bigint(s: Annotated[_ffi.CData, "const Set *"], i: int) -> Annotated[int, "int64"]: s_converted = _ffi.cast("const Set *", s) i_converted = _ffi.cast("int64", i) result = _lib.distance_set_bigint(s_converted, i_converted) @@ -5068,7 +5176,7 @@ def distance_set_bigint(s: "const Set *", i: int) -> "int64": return result if result != _ffi.NULL else None -def distance_set_date(s: "const Set *", d: "DateADT") -> "int": +def distance_set_date(s: Annotated[_ffi.CData, "const Set *"], d: int) -> Annotated[int, "int"]: s_converted = _ffi.cast("const Set *", s) d_converted = _ffi.cast("DateADT", d) result = _lib.distance_set_date(s_converted, d_converted) @@ -5076,21 +5184,21 @@ def distance_set_date(s: "const Set *", d: "DateADT") -> "int": return result if result != _ffi.NULL else None -def distance_set_float(s: "const Set *", d: float) -> "double": +def distance_set_float(s: Annotated[_ffi.CData, "const Set *"], d: float) -> Annotated[float, "double"]: s_converted = _ffi.cast("const Set *", s) result = _lib.distance_set_float(s_converted, d) _check_error() return result if result != _ffi.NULL else None -def distance_set_int(s: "const Set *", i: int) -> "int": +def distance_set_int(s: Annotated[_ffi.CData, "const Set *"], i: int) -> Annotated[int, "int"]: s_converted = _ffi.cast("const Set *", s) result = _lib.distance_set_int(s_converted, i) _check_error() return result if result != _ffi.NULL else None -def distance_set_timestamptz(s: "const Set *", t: int) -> "double": +def distance_set_timestamptz(s: Annotated[_ffi.CData, "const Set *"], t: int) -> Annotated[float, "double"]: s_converted = _ffi.cast("const Set *", s) t_converted = _ffi.cast("TimestampTz", t) result = _lib.distance_set_timestamptz(s_converted, t_converted) @@ -5098,7 +5206,7 @@ def distance_set_timestamptz(s: "const Set *", t: int) -> "double": return result if result != _ffi.NULL else None -def distance_span_bigint(s: "const Span *", i: int) -> "int64": +def distance_span_bigint(s: Annotated[_ffi.CData, "const Span *"], i: int) -> Annotated[int, "int64"]: s_converted = _ffi.cast("const Span *", s) i_converted = _ffi.cast("int64", i) result = _lib.distance_span_bigint(s_converted, i_converted) @@ -5106,7 +5214,7 @@ def distance_span_bigint(s: "const Span *", i: int) -> "int64": return result if result != _ffi.NULL else None -def distance_span_date(s: "const Span *", d: "DateADT") -> "int": +def distance_span_date(s: Annotated[_ffi.CData, "const Span *"], d: int) -> Annotated[int, "int"]: s_converted = _ffi.cast("const Span *", s) d_converted = _ffi.cast("DateADT", d) result = _lib.distance_span_date(s_converted, d_converted) @@ -5114,21 +5222,21 @@ def distance_span_date(s: "const Span *", d: "DateADT") -> "int": return result if result != _ffi.NULL else None -def distance_span_float(s: "const Span *", d: float) -> "double": +def distance_span_float(s: Annotated[_ffi.CData, "const Span *"], d: float) -> Annotated[float, "double"]: s_converted = _ffi.cast("const Span *", s) result = _lib.distance_span_float(s_converted, d) _check_error() return result if result != _ffi.NULL else None -def distance_span_int(s: "const Span *", i: int) -> "int": +def distance_span_int(s: Annotated[_ffi.CData, "const Span *"], i: int) -> Annotated[int, "int"]: s_converted = _ffi.cast("const Span *", s) result = _lib.distance_span_int(s_converted, i) _check_error() return result if result != _ffi.NULL else None -def distance_span_timestamptz(s: "const Span *", t: int) -> "double": +def distance_span_timestamptz(s: Annotated[_ffi.CData, "const Span *"], t: int) -> Annotated[float, "double"]: s_converted = _ffi.cast("const Span *", s) t_converted = _ffi.cast("TimestampTz", t) result = _lib.distance_span_timestamptz(s_converted, t_converted) @@ -5136,7 +5244,7 @@ def distance_span_timestamptz(s: "const Span *", t: int) -> "double": return result if result != _ffi.NULL else None -def distance_spanset_bigint(ss: "const SpanSet *", i: int) -> "int64": +def distance_spanset_bigint(ss: Annotated[_ffi.CData, "const SpanSet *"], i: int) -> Annotated[int, "int64"]: ss_converted = _ffi.cast("const SpanSet *", ss) i_converted = _ffi.cast("int64", i) result = _lib.distance_spanset_bigint(ss_converted, i_converted) @@ -5144,7 +5252,7 @@ def distance_spanset_bigint(ss: "const SpanSet *", i: int) -> "int64": return result if result != _ffi.NULL else None -def distance_spanset_date(ss: "const SpanSet *", d: "DateADT") -> "int": +def distance_spanset_date(ss: Annotated[_ffi.CData, "const SpanSet *"], d: int) -> Annotated[int, "int"]: ss_converted = _ffi.cast("const SpanSet *", ss) d_converted = _ffi.cast("DateADT", d) result = _lib.distance_spanset_date(ss_converted, d_converted) @@ -5152,21 +5260,21 @@ def distance_spanset_date(ss: "const SpanSet *", d: "DateADT") -> "int": return result if result != _ffi.NULL else None -def distance_spanset_float(ss: "const SpanSet *", d: float) -> "double": +def distance_spanset_float(ss: Annotated[_ffi.CData, "const SpanSet *"], d: float) -> Annotated[float, "double"]: ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.distance_spanset_float(ss_converted, d) _check_error() return result if result != _ffi.NULL else None -def distance_spanset_int(ss: "const SpanSet *", i: int) -> "int": +def distance_spanset_int(ss: Annotated[_ffi.CData, "const SpanSet *"], i: int) -> Annotated[int, "int"]: ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.distance_spanset_int(ss_converted, i) _check_error() return result if result != _ffi.NULL else None -def distance_spanset_timestamptz(ss: "const SpanSet *", t: int) -> "double": +def distance_spanset_timestamptz(ss: Annotated[_ffi.CData, "const SpanSet *"], t: int) -> Annotated[float, "double"]: ss_converted = _ffi.cast("const SpanSet *", ss) t_converted = _ffi.cast("TimestampTz", t) result = _lib.distance_spanset_timestamptz(ss_converted, t_converted) @@ -5174,7 +5282,9 @@ def distance_spanset_timestamptz(ss: "const SpanSet *", t: int) -> "double": return result if result != _ffi.NULL else None -def distance_tstzset_tstzset(s1: "const Set *", s2: "const Set *") -> "double": +def distance_tstzset_tstzset( + s1: Annotated[_ffi.CData, "const Set *"], s2: Annotated[_ffi.CData, "const Set *"] +) -> Annotated[float, "double"]: s1_converted = _ffi.cast("const Set *", s1) s2_converted = _ffi.cast("const Set *", s2) result = _lib.distance_tstzset_tstzset(s1_converted, s2_converted) @@ -5182,7 +5292,9 @@ def distance_tstzset_tstzset(s1: "const Set *", s2: "const Set *") -> "double": return result if result != _ffi.NULL else None -def distance_tstzspan_tstzspan(s1: "const Span *", s2: "const Span *") -> "double": +def distance_tstzspan_tstzspan( + s1: Annotated[_ffi.CData, "const Span *"], s2: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[float, "double"]: s1_converted = _ffi.cast("const Span *", s1) s2_converted = _ffi.cast("const Span *", s2) result = _lib.distance_tstzspan_tstzspan(s1_converted, s2_converted) @@ -5190,7 +5302,9 @@ def distance_tstzspan_tstzspan(s1: "const Span *", s2: "const Span *") -> "doubl return result if result != _ffi.NULL else None -def distance_tstzspanset_tstzspan(ss: "const SpanSet *", s: "const Span *") -> "double": +def distance_tstzspanset_tstzspan( + ss: Annotated[_ffi.CData, "const SpanSet *"], s: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[float, "double"]: ss_converted = _ffi.cast("const SpanSet *", ss) s_converted = _ffi.cast("const Span *", s) result = _lib.distance_tstzspanset_tstzspan(ss_converted, s_converted) @@ -5199,8 +5313,8 @@ def distance_tstzspanset_tstzspan(ss: "const SpanSet *", s: "const Span *") -> " def distance_tstzspanset_tstzspanset( - ss1: "const SpanSet *", ss2: "const SpanSet *" -) -> "double": + ss1: Annotated[_ffi.CData, "const SpanSet *"], ss2: Annotated[_ffi.CData, "const SpanSet *"] +) -> Annotated[float, "double"]: ss1_converted = _ffi.cast("const SpanSet *", ss1) ss2_converted = _ffi.cast("const SpanSet *", ss2) result = _lib.distance_tstzspanset_tstzspanset(ss1_converted, ss2_converted) @@ -5208,7 +5322,7 @@ def distance_tstzspanset_tstzspanset( return result if result != _ffi.NULL else None -def bigint_extent_transfn(state: "Span *", i: int) -> "Span *": +def bigint_extent_transfn(state: Annotated[_ffi.CData, "Span *"], i: int) -> Annotated[_ffi.CData, "Span *"]: state_converted = _ffi.cast("Span *", state) i_converted = _ffi.cast("int64", i) result = _lib.bigint_extent_transfn(state_converted, i_converted) @@ -5216,7 +5330,7 @@ def bigint_extent_transfn(state: "Span *", i: int) -> "Span *": return result if result != _ffi.NULL else None -def bigint_union_transfn(state: "Set *", i: int) -> "Set *": +def bigint_union_transfn(state: Annotated[_ffi.CData, "Set *"], i: int) -> Annotated[_ffi.CData, "Set *"]: state_converted = _ffi.cast("Set *", state) i_converted = _ffi.cast("int64", i) result = _lib.bigint_union_transfn(state_converted, i_converted) @@ -5224,7 +5338,7 @@ def bigint_union_transfn(state: "Set *", i: int) -> "Set *": return result if result != _ffi.NULL else None -def date_extent_transfn(state: "Span *", d: "DateADT") -> "Span *": +def date_extent_transfn(state: Annotated[_ffi.CData, "Span *"], d: int) -> Annotated[_ffi.CData, "Span *"]: state_converted = _ffi.cast("Span *", state) d_converted = _ffi.cast("DateADT", d) result = _lib.date_extent_transfn(state_converted, d_converted) @@ -5232,7 +5346,7 @@ def date_extent_transfn(state: "Span *", d: "DateADT") -> "Span *": return result if result != _ffi.NULL else None -def date_union_transfn(state: "Set *", d: "DateADT") -> "Set *": +def date_union_transfn(state: Annotated[_ffi.CData, "Set *"], d: int) -> Annotated[_ffi.CData, "Set *"]: state_converted = _ffi.cast("Set *", state) d_converted = _ffi.cast("DateADT", d) result = _lib.date_union_transfn(state_converted, d_converted) @@ -5240,28 +5354,28 @@ def date_union_transfn(state: "Set *", d: "DateADT") -> "Set *": return result if result != _ffi.NULL else None -def float_extent_transfn(state: "Span *", d: float) -> "Span *": +def float_extent_transfn(state: Annotated[_ffi.CData, "Span *"], d: float) -> Annotated[_ffi.CData, "Span *"]: state_converted = _ffi.cast("Span *", state) result = _lib.float_extent_transfn(state_converted, d) _check_error() return result if result != _ffi.NULL else None -def float_union_transfn(state: "Set *", d: float) -> "Set *": +def float_union_transfn(state: Annotated[_ffi.CData, "Set *"], d: float) -> Annotated[_ffi.CData, "Set *"]: state_converted = _ffi.cast("Set *", state) result = _lib.float_union_transfn(state_converted, d) _check_error() return result if result != _ffi.NULL else None -def int_extent_transfn(state: "Span *", i: int) -> "Span *": +def int_extent_transfn(state: Annotated[_ffi.CData, "Span *"], i: int) -> Annotated[_ffi.CData, "Span *"]: state_converted = _ffi.cast("Span *", state) result = _lib.int_extent_transfn(state_converted, i) _check_error() return result if result != _ffi.NULL else None -def int_union_transfn(state: "Set *", i: int) -> "Set *": +def int_union_transfn(state: Annotated[_ffi.CData, "Set *"], i: int) -> Annotated[_ffi.CData, "Set *"]: state_converted = _ffi.cast("Set *", state) i_converted = _ffi.cast("int32", i) result = _lib.int_union_transfn(state_converted, i_converted) @@ -5269,7 +5383,9 @@ def int_union_transfn(state: "Set *", i: int) -> "Set *": return result if result != _ffi.NULL else None -def set_extent_transfn(state: "Span *", s: "const Set *") -> "Span *": +def set_extent_transfn( + state: Annotated[_ffi.CData, "Span *"], s: Annotated[_ffi.CData, "const Set *"] +) -> Annotated[_ffi.CData, "Span *"]: state_converted = _ffi.cast("Span *", state) s_converted = _ffi.cast("const Set *", s) result = _lib.set_extent_transfn(state_converted, s_converted) @@ -5277,14 +5393,16 @@ def set_extent_transfn(state: "Span *", s: "const Set *") -> "Span *": return result if result != _ffi.NULL else None -def set_union_finalfn(state: "Set *") -> "Set *": +def set_union_finalfn(state: Annotated[_ffi.CData, "Set *"]) -> Annotated[_ffi.CData, "Set *"]: state_converted = _ffi.cast("Set *", state) result = _lib.set_union_finalfn(state_converted) _check_error() return result if result != _ffi.NULL else None -def set_union_transfn(state: "Set *", s: "Set *") -> "Set *": +def set_union_transfn( + state: Annotated[_ffi.CData, "Set *"], s: Annotated[_ffi.CData, "Set *"] +) -> Annotated[_ffi.CData, "Set *"]: state_converted = _ffi.cast("Set *", state) s_converted = _ffi.cast("Set *", s) result = _lib.set_union_transfn(state_converted, s_converted) @@ -5292,7 +5410,9 @@ def set_union_transfn(state: "Set *", s: "Set *") -> "Set *": return result if result != _ffi.NULL else None -def span_extent_transfn(state: "Span *", s: "const Span *") -> "Span *": +def span_extent_transfn( + state: Annotated[_ffi.CData, "Span *"], s: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[_ffi.CData, "Span *"]: state_converted = _ffi.cast("Span *", state) s_converted = _ffi.cast("const Span *", s) result = _lib.span_extent_transfn(state_converted, s_converted) @@ -5300,7 +5420,9 @@ def span_extent_transfn(state: "Span *", s: "const Span *") -> "Span *": return result if result != _ffi.NULL else None -def span_union_transfn(state: "SpanSet *", s: "const Span *") -> "SpanSet *": +def span_union_transfn( + state: Annotated[_ffi.CData, "SpanSet *"], s: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[_ffi.CData, "SpanSet *"]: state_converted = _ffi.cast("SpanSet *", state) s_converted = _ffi.cast("const Span *", s) result = _lib.span_union_transfn(state_converted, s_converted) @@ -5308,7 +5430,9 @@ def span_union_transfn(state: "SpanSet *", s: "const Span *") -> "SpanSet *": return result if result != _ffi.NULL else None -def spanset_extent_transfn(state: "Span *", ss: "const SpanSet *") -> "Span *": +def spanset_extent_transfn( + state: Annotated[_ffi.CData, "Span *"], ss: Annotated[_ffi.CData, "const SpanSet *"] +) -> Annotated[_ffi.CData, "Span *"]: state_converted = _ffi.cast("Span *", state) ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.spanset_extent_transfn(state_converted, ss_converted) @@ -5316,14 +5440,16 @@ def spanset_extent_transfn(state: "Span *", ss: "const SpanSet *") -> "Span *": return result if result != _ffi.NULL else None -def spanset_union_finalfn(state: "SpanSet *") -> "SpanSet *": +def spanset_union_finalfn(state: Annotated[_ffi.CData, "SpanSet *"]) -> Annotated[_ffi.CData, "SpanSet *"]: state_converted = _ffi.cast("SpanSet *", state) result = _lib.spanset_union_finalfn(state_converted) _check_error() return result if result != _ffi.NULL else None -def spanset_union_transfn(state: "SpanSet *", ss: "const SpanSet *") -> "SpanSet *": +def spanset_union_transfn( + state: Annotated[_ffi.CData, "SpanSet *"], ss: Annotated[_ffi.CData, "const SpanSet *"] +) -> Annotated[_ffi.CData, "SpanSet *"]: state_converted = _ffi.cast("SpanSet *", state) ss_converted = _ffi.cast("const SpanSet *", ss) result = _lib.spanset_union_transfn(state_converted, ss_converted) @@ -5331,7 +5457,7 @@ def spanset_union_transfn(state: "SpanSet *", ss: "const SpanSet *") -> "SpanSet return result if result != _ffi.NULL else None -def text_union_transfn(state: "Set *", txt: str) -> "Set *": +def text_union_transfn(state: Annotated[_ffi.CData, "Set *"], txt: str) -> Annotated[_ffi.CData, "Set *"]: state_converted = _ffi.cast("Set *", state) txt_converted = cstring2text(txt) result = _lib.text_union_transfn(state_converted, txt_converted) @@ -5339,7 +5465,7 @@ def text_union_transfn(state: "Set *", txt: str) -> "Set *": return result if result != _ffi.NULL else None -def timestamptz_extent_transfn(state: "Span *", t: int) -> "Span *": +def timestamptz_extent_transfn(state: Annotated[_ffi.CData, "Span *"], t: int) -> Annotated[_ffi.CData, "Span *"]: state_converted = _ffi.cast("Span *", state) t_converted = _ffi.cast("TimestampTz", t) result = _lib.timestamptz_extent_transfn(state_converted, t_converted) @@ -5347,7 +5473,7 @@ def timestamptz_extent_transfn(state: "Span *", t: int) -> "Span *": return result if result != _ffi.NULL else None -def timestamptz_union_transfn(state: "Set *", t: int) -> "Set *": +def timestamptz_union_transfn(state: Annotated[_ffi.CData, "Set *"], t: int) -> Annotated[_ffi.CData, "Set *"]: state_converted = _ffi.cast("Set *", state) t_converted = _ffi.cast("TimestampTz", t) result = _lib.timestamptz_union_transfn(state_converted, t_converted) @@ -5355,636 +5481,464 @@ def timestamptz_union_transfn(state: "Set *", t: int) -> "Set *": return result if result != _ffi.NULL else None -def tbox_in(string: str) -> "TBox *": - string_converted = string.encode("utf-8") - result = _lib.tbox_in(string_converted) +def bigint_get_bin(value: int, vsize: int, vorigin: int) -> Annotated[int, "int64"]: + value_converted = _ffi.cast("int64", value) + vsize_converted = _ffi.cast("int64", vsize) + vorigin_converted = _ffi.cast("int64", vorigin) + result = _lib.bigint_get_bin(value_converted, vsize_converted, vorigin_converted) _check_error() return result if result != _ffi.NULL else None -def tbox_out(box: "const TBox *", maxdd: int) -> str: - box_converted = _ffi.cast("const TBox *", box) - result = _lib.tbox_out(box_converted, maxdd) +def bigintspan_bins( + s: Annotated[_ffi.CData, "const Span *"], vsize: int, vorigin: int, count: Annotated[_ffi.CData, "int *"] +) -> Annotated[_ffi.CData, "Span *"]: + s_converted = _ffi.cast("const Span *", s) + vsize_converted = _ffi.cast("int64", vsize) + vorigin_converted = _ffi.cast("int64", vorigin) + count_converted = _ffi.cast("int *", count) + result = _lib.bigintspan_bins(s_converted, vsize_converted, vorigin_converted, count_converted) _check_error() - result = _ffi.string(result).decode("utf-8") return result if result != _ffi.NULL else None -def tbox_from_wkb(wkb: bytes) -> "TBOX *": - wkb_converted = _ffi.new("uint8_t []", wkb) - result = _lib.tbox_from_wkb(wkb_converted, len(wkb)) +def bigintspanset_bins( + ss: Annotated[_ffi.CData, "const SpanSet *"], vsize: int, vorigin: int, count: Annotated[_ffi.CData, "int *"] +) -> Annotated[_ffi.CData, "Span *"]: + ss_converted = _ffi.cast("const SpanSet *", ss) + vsize_converted = _ffi.cast("int64", vsize) + vorigin_converted = _ffi.cast("int64", vorigin) + count_converted = _ffi.cast("int *", count) + result = _lib.bigintspanset_bins(ss_converted, vsize_converted, vorigin_converted, count_converted) + _check_error() return result if result != _ffi.NULL else None -def tbox_from_hexwkb(hexwkb: str) -> "TBox *": - hexwkb_converted = hexwkb.encode("utf-8") - result = _lib.tbox_from_hexwkb(hexwkb_converted) +def date_get_bin( + d: int, duration: Annotated[_ffi.CData, "const Interval *"], torigin: int +) -> Annotated[int, "DateADT"]: + d_converted = _ffi.cast("DateADT", d) + duration_converted = _ffi.cast("const Interval *", duration) + torigin_converted = _ffi.cast("DateADT", torigin) + result = _lib.date_get_bin(d_converted, duration_converted, torigin_converted) _check_error() return result if result != _ffi.NULL else None -def stbox_from_wkb(wkb: bytes) -> "STBOX *": - wkb_converted = _ffi.new("uint8_t []", wkb) - result = _lib.stbox_from_wkb(wkb_converted, len(wkb)) +def datespan_bins( + s: Annotated[_ffi.CData, "const Span *"], + duration: Annotated[_ffi.CData, "const Interval *"], + torigin: int, + count: Annotated[_ffi.CData, "int *"], +) -> Annotated[_ffi.CData, "Span *"]: + s_converted = _ffi.cast("const Span *", s) + duration_converted = _ffi.cast("const Interval *", duration) + torigin_converted = _ffi.cast("DateADT", torigin) + count_converted = _ffi.cast("int *", count) + result = _lib.datespan_bins(s_converted, duration_converted, torigin_converted, count_converted) + _check_error() return result if result != _ffi.NULL else None -def stbox_from_hexwkb(hexwkb: str) -> "STBox *": - hexwkb_converted = hexwkb.encode("utf-8") - result = _lib.stbox_from_hexwkb(hexwkb_converted) +def datespanset_bins( + ss: Annotated[_ffi.CData, "const SpanSet *"], + duration: Annotated[_ffi.CData, "const Interval *"], + torigin: int, + count: Annotated[_ffi.CData, "int *"], +) -> Annotated[_ffi.CData, "Span *"]: + ss_converted = _ffi.cast("const SpanSet *", ss) + duration_converted = _ffi.cast("const Interval *", duration) + torigin_converted = _ffi.cast("DateADT", torigin) + count_converted = _ffi.cast("int *", count) + result = _lib.datespanset_bins(ss_converted, duration_converted, torigin_converted, count_converted) _check_error() return result if result != _ffi.NULL else None -def tbox_as_wkb(box: "const TBox *", variant: int) -> bytes: - box_converted = _ffi.cast("const TBox *", box) - variant_converted = _ffi.cast("uint8_t", variant) - size_out = _ffi.new("size_t *") - result = _lib.tbox_as_wkb(box_converted, variant_converted, size_out) +def float_get_bin(value: float, vsize: float, vorigin: float) -> Annotated[float, "double"]: + result = _lib.float_get_bin(value, vsize, vorigin) _check_error() - result_converted = ( - bytes(result[i] for i in range(size_out[0])) if result != _ffi.NULL else None - ) - return result_converted + return result if result != _ffi.NULL else None -def tbox_as_hexwkb(box: "const TBox *", variant: int) -> "Tuple[str, 'size_t *']": - box_converted = _ffi.cast("const TBox *", box) - variant_converted = _ffi.cast("uint8_t", variant) - size = _ffi.new("size_t *") - result = _lib.tbox_as_hexwkb(box_converted, variant_converted, size) +def floatspan_bins( + s: Annotated[_ffi.CData, "const Span *"], vsize: float, vorigin: float, count: Annotated[_ffi.CData, "int *"] +) -> Annotated[_ffi.CData, "Span *"]: + s_converted = _ffi.cast("const Span *", s) + count_converted = _ffi.cast("int *", count) + result = _lib.floatspan_bins(s_converted, vsize, vorigin, count_converted) _check_error() - result = _ffi.string(result).decode("utf-8") - return result if result != _ffi.NULL else None, size[0] + return result if result != _ffi.NULL else None -def stbox_as_wkb(box: "const STBox *", variant: int) -> bytes: - box_converted = _ffi.cast("const STBox *", box) - variant_converted = _ffi.cast("uint8_t", variant) - size_out = _ffi.new("size_t *") - result = _lib.stbox_as_wkb(box_converted, variant_converted, size_out) +def floatspanset_bins( + ss: Annotated[_ffi.CData, "const SpanSet *"], vsize: float, vorigin: float, count: Annotated[_ffi.CData, "int *"] +) -> Annotated[_ffi.CData, "Span *"]: + ss_converted = _ffi.cast("const SpanSet *", ss) + count_converted = _ffi.cast("int *", count) + result = _lib.floatspanset_bins(ss_converted, vsize, vorigin, count_converted) _check_error() - result_converted = ( - bytes(result[i] for i in range(size_out[0])) if result != _ffi.NULL else None - ) - return result_converted + return result if result != _ffi.NULL else None -def stbox_as_hexwkb(box: "const STBox *", variant: int) -> "Tuple[str, 'size_t *']": - box_converted = _ffi.cast("const STBox *", box) - variant_converted = _ffi.cast("uint8_t", variant) - size = _ffi.new("size_t *") - result = _lib.stbox_as_hexwkb(box_converted, variant_converted, size) +def int_get_bin(value: int, vsize: int, vorigin: int) -> Annotated[int, "int"]: + result = _lib.int_get_bin(value, vsize, vorigin) _check_error() - result = _ffi.string(result).decode("utf-8") - return result if result != _ffi.NULL else None, size[0] + return result if result != _ffi.NULL else None -def stbox_in(string: str) -> "STBox *": - string_converted = string.encode("utf-8") - result = _lib.stbox_in(string_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def stbox_out(box: "const STBox *", maxdd: int) -> str: - box_converted = _ffi.cast("const STBox *", box) - result = _lib.stbox_out(box_converted, maxdd) +def intspan_bins( + s: Annotated[_ffi.CData, "const Span *"], vsize: int, vorigin: int, count: Annotated[_ffi.CData, "int *"] +) -> Annotated[_ffi.CData, "Span *"]: + s_converted = _ffi.cast("const Span *", s) + count_converted = _ffi.cast("int *", count) + result = _lib.intspan_bins(s_converted, vsize, vorigin, count_converted) _check_error() - result = _ffi.string(result).decode("utf-8") return result if result != _ffi.NULL else None -def float_tstzspan_to_tbox(d: float, s: "const Span *") -> "TBox *": - s_converted = _ffi.cast("const Span *", s) - result = _lib.float_tstzspan_to_tbox(d, s_converted) +def intspanset_bins( + ss: Annotated[_ffi.CData, "const SpanSet *"], vsize: int, vorigin: int, count: Annotated[_ffi.CData, "int *"] +) -> Annotated[_ffi.CData, "Span *"]: + ss_converted = _ffi.cast("const SpanSet *", ss) + count_converted = _ffi.cast("int *", count) + result = _lib.intspanset_bins(ss_converted, vsize, vorigin, count_converted) _check_error() return result if result != _ffi.NULL else None -def float_timestamptz_to_tbox(d: float, t: int) -> "TBox *": +def timestamptz_get_bin( + t: int, duration: Annotated[_ffi.CData, "const Interval *"], torigin: int +) -> Annotated[int, "TimestampTz"]: t_converted = _ffi.cast("TimestampTz", t) - result = _lib.float_timestamptz_to_tbox(d, t_converted) + duration_converted = _ffi.cast("const Interval *", duration) + torigin_converted = _ffi.cast("TimestampTz", torigin) + result = _lib.timestamptz_get_bin(t_converted, duration_converted, torigin_converted) _check_error() return result if result != _ffi.NULL else None -def geo_tstzspan_to_stbox(gs: "const GSERIALIZED *", s: "const Span *") -> "STBox *": - gs_converted = _ffi.cast("const GSERIALIZED *", gs) +def tstzspan_bins( + s: Annotated[_ffi.CData, "const Span *"], + duration: Annotated[_ffi.CData, "const Interval *"], + origin: int, + count: Annotated[_ffi.CData, "int *"], +) -> Annotated[_ffi.CData, "Span *"]: s_converted = _ffi.cast("const Span *", s) - result = _lib.geo_tstzspan_to_stbox(gs_converted, s_converted) + duration_converted = _ffi.cast("const Interval *", duration) + origin_converted = _ffi.cast("TimestampTz", origin) + count_converted = _ffi.cast("int *", count) + result = _lib.tstzspan_bins(s_converted, duration_converted, origin_converted, count_converted) _check_error() return result if result != _ffi.NULL else None -def geo_timestamptz_to_stbox(gs: "const GSERIALIZED *", t: int) -> "STBox *": - gs_converted = _ffi.cast("const GSERIALIZED *", gs) - t_converted = _ffi.cast("TimestampTz", t) - result = _lib.geo_timestamptz_to_stbox(gs_converted, t_converted) +def tstzspanset_bins( + ss: Annotated[_ffi.CData, "const SpanSet *"], + duration: Annotated[_ffi.CData, "const Interval *"], + torigin: int, + count: Annotated[_ffi.CData, "int *"], +) -> Annotated[_ffi.CData, "Span *"]: + ss_converted = _ffi.cast("const SpanSet *", ss) + duration_converted = _ffi.cast("const Interval *", duration) + torigin_converted = _ffi.cast("TimestampTz", torigin) + count_converted = _ffi.cast("int *", count) + result = _lib.tstzspanset_bins(ss_converted, duration_converted, torigin_converted, count_converted) _check_error() return result if result != _ffi.NULL else None -def int_tstzspan_to_tbox(i: int, s: "const Span *") -> "TBox *": - s_converted = _ffi.cast("const Span *", s) - result = _lib.int_tstzspan_to_tbox(i, s_converted) +def tbox_as_hexwkb( + box: Annotated[_ffi.CData, "const TBox *"], variant: int +) -> tuple[Annotated[str, "char *"], Annotated[_ffi.CData, "size_t *"]]: + box_converted = _ffi.cast("const TBox *", box) + variant_converted = _ffi.cast("uint8_t", variant) + size = _ffi.new("size_t *") + result = _lib.tbox_as_hexwkb(box_converted, variant_converted, size) _check_error() - return result if result != _ffi.NULL else None + result = _ffi.string(result).decode("utf-8") + return result if result != _ffi.NULL else None, size[0] -def int_timestamptz_to_tbox(i: int, t: int) -> "TBox *": - t_converted = _ffi.cast("TimestampTz", t) - result = _lib.int_timestamptz_to_tbox(i, t_converted) +def tbox_as_wkb( + box: Annotated[_ffi.CData, "const TBox *"], variant: int +) -> tuple[Annotated[_ffi.CData, "uint8_t *"], Annotated[_ffi.CData, "size_t *"]]: + box_converted = _ffi.cast("const TBox *", box) + variant_converted = _ffi.cast("uint8_t", variant) + size_out = _ffi.new("size_t *") + result = _lib.tbox_as_wkb(box_converted, variant_converted, size_out) _check_error() - return result if result != _ffi.NULL else None + result_converted = bytes(result[i] for i in range(size_out[0])) if result != _ffi.NULL else None + return result_converted -def numspan_tstzspan_to_tbox(span: "const Span *", s: "const Span *") -> "TBox *": - span_converted = _ffi.cast("const Span *", span) - s_converted = _ffi.cast("const Span *", s) - result = _lib.numspan_tstzspan_to_tbox(span_converted, s_converted) +def tbox_from_hexwkb(hexwkb: str) -> Annotated[_ffi.CData, "TBox *"]: + hexwkb_converted = hexwkb.encode("utf-8") + result = _lib.tbox_from_hexwkb(hexwkb_converted) _check_error() return result if result != _ffi.NULL else None -def numspan_timestamptz_to_tbox(span: "const Span *", t: int) -> "TBox *": - span_converted = _ffi.cast("const Span *", span) - t_converted = _ffi.cast("TimestampTz", t) - result = _lib.numspan_timestamptz_to_tbox(span_converted, t_converted) - _check_error() +def tbox_from_wkb(wkb: bytes) -> "TBOX *": + wkb_converted = _ffi.new("uint8_t []", wkb) + result = _lib.tbox_from_wkb(wkb_converted, len(wkb)) return result if result != _ffi.NULL else None -def stbox_copy(box: "const STBox *") -> "STBox *": - box_converted = _ffi.cast("const STBox *", box) - result = _lib.stbox_copy(box_converted) +def tbox_in(string: str) -> Annotated[_ffi.CData, "TBox *"]: + string_converted = string.encode("utf-8") + result = _lib.tbox_in(string_converted) _check_error() return result if result != _ffi.NULL else None -def stbox_make( - hasx: bool, - hasz: bool, - geodetic: bool, - srid: int, - xmin: float, - xmax: float, - ymin: float, - ymax: float, - zmin: float, - zmax: float, - s: "Optional['const Span *']", -) -> "STBox *": - srid_converted = _ffi.cast("int32", srid) - s_converted = _ffi.cast("const Span *", s) if s is not None else _ffi.NULL - result = _lib.stbox_make( - hasx, - hasz, - geodetic, - srid_converted, - xmin, - xmax, - ymin, - ymax, - zmin, - zmax, - s_converted, - ) +def tbox_out(box: Annotated[_ffi.CData, "const TBox *"], maxdd: int) -> Annotated[str, "char *"]: + box_converted = _ffi.cast("const TBox *", box) + result = _lib.tbox_out(box_converted, maxdd) _check_error() + result = _ffi.string(result).decode("utf-8") return result if result != _ffi.NULL else None -def tbox_copy(box: "const TBox *") -> "TBox *": - box_converted = _ffi.cast("const TBox *", box) - result = _lib.tbox_copy(box_converted) +def float_timestamptz_to_tbox(d: float, t: int) -> Annotated[_ffi.CData, "TBox *"]: + t_converted = _ffi.cast("TimestampTz", t) + result = _lib.float_timestamptz_to_tbox(d, t_converted) _check_error() return result if result != _ffi.NULL else None -def tbox_make(s: "Optional['const Span *']", p: "Optional['const Span *']") -> "TBox *": - s_converted = _ffi.cast("const Span *", s) if s is not None else _ffi.NULL - p_converted = _ffi.cast("const Span *", p) if p is not None else _ffi.NULL - result = _lib.tbox_make(s_converted, p_converted) +def float_tstzspan_to_tbox(d: float, s: Annotated[_ffi.CData, "const Span *"]) -> Annotated[_ffi.CData, "TBox *"]: + s_converted = _ffi.cast("const Span *", s) + result = _lib.float_tstzspan_to_tbox(d, s_converted) _check_error() return result if result != _ffi.NULL else None -def float_to_tbox(d: float) -> "TBox *": - result = _lib.float_to_tbox(d) +def int_timestamptz_to_tbox(i: int, t: int) -> Annotated[_ffi.CData, "TBox *"]: + t_converted = _ffi.cast("TimestampTz", t) + result = _lib.int_timestamptz_to_tbox(i, t_converted) _check_error() return result if result != _ffi.NULL else None -def geo_to_stbox(gs: "const GSERIALIZED *") -> "STBox *": - gs_converted = _ffi.cast("const GSERIALIZED *", gs) - result = _lib.geo_to_stbox(gs_converted) +def int_tstzspan_to_tbox(i: int, s: Annotated[_ffi.CData, "const Span *"]) -> Annotated[_ffi.CData, "TBox *"]: + s_converted = _ffi.cast("const Span *", s) + result = _lib.int_tstzspan_to_tbox(i, s_converted) _check_error() return result if result != _ffi.NULL else None -def int_to_tbox(i: int) -> "TBox *": - result = _lib.int_to_tbox(i) +def numspan_tstzspan_to_tbox( + span: Annotated[_ffi.CData, "const Span *"], s: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[_ffi.CData, "TBox *"]: + span_converted = _ffi.cast("const Span *", span) + s_converted = _ffi.cast("const Span *", s) + result = _lib.numspan_tstzspan_to_tbox(span_converted, s_converted) _check_error() return result if result != _ffi.NULL else None -def set_to_tbox(s: "const Set *") -> "TBox *": - s_converted = _ffi.cast("const Set *", s) - result = _lib.set_to_tbox(s_converted) +def numspan_timestamptz_to_tbox(span: Annotated[_ffi.CData, "const Span *"], t: int) -> Annotated[_ffi.CData, "TBox *"]: + span_converted = _ffi.cast("const Span *", span) + t_converted = _ffi.cast("TimestampTz", t) + result = _lib.numspan_timestamptz_to_tbox(span_converted, t_converted) _check_error() return result if result != _ffi.NULL else None -def span_to_tbox(s: "const Span *") -> "TBox *": - s_converted = _ffi.cast("const Span *", s) - result = _lib.span_to_tbox(s_converted) +def tbox_copy(box: Annotated[_ffi.CData, "const TBox *"]) -> Annotated[_ffi.CData, "TBox *"]: + box_converted = _ffi.cast("const TBox *", box) + result = _lib.tbox_copy(box_converted) _check_error() return result if result != _ffi.NULL else None -def spanset_to_tbox(ss: "const SpanSet *") -> "TBox *": - ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.spanset_to_tbox(ss_converted) +def tbox_make( + s: Annotated[_ffi.CData, "const Span *"] | None, p: Annotated[_ffi.CData, "const Span *"] | None +) -> Annotated[_ffi.CData, "TBox *"]: + s_converted = _ffi.cast("const Span *", s) if s is not None else _ffi.NULL + p_converted = _ffi.cast("const Span *", p) if p is not None else _ffi.NULL + result = _lib.tbox_make(s_converted, p_converted) _check_error() return result if result != _ffi.NULL else None -def spatialset_to_stbox(s: "const Set *") -> "STBox *": - s_converted = _ffi.cast("const Set *", s) - result = _lib.spatialset_to_stbox(s_converted) +def float_to_tbox(d: float) -> Annotated[_ffi.CData, "TBox *"]: + result = _lib.float_to_tbox(d) _check_error() return result if result != _ffi.NULL else None -def stbox_to_gbox(box: "const STBox *") -> "GBOX *": - box_converted = _ffi.cast("const STBox *", box) - result = _lib.stbox_to_gbox(box_converted) +def int_to_tbox(i: int) -> Annotated[_ffi.CData, "TBox *"]: + result = _lib.int_to_tbox(i) _check_error() return result if result != _ffi.NULL else None -def stbox_to_box3d(box: "const STBox *") -> "BOX3D *": - box_converted = _ffi.cast("const STBox *", box) - result = _lib.stbox_to_box3d(box_converted) +def set_to_tbox(s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[_ffi.CData, "TBox *"]: + s_converted = _ffi.cast("const Set *", s) + result = _lib.set_to_tbox(s_converted) _check_error() return result if result != _ffi.NULL else None -def stbox_to_geo(box: "const STBox *") -> "GSERIALIZED *": - box_converted = _ffi.cast("const STBox *", box) - result = _lib.stbox_to_geo(box_converted) +def span_to_tbox(s: Annotated[_ffi.CData, "const Span *"]) -> Annotated[_ffi.CData, "TBox *"]: + s_converted = _ffi.cast("const Span *", s) + result = _lib.span_to_tbox(s_converted) _check_error() return result if result != _ffi.NULL else None -def stbox_to_tstzspan(box: "const STBox *") -> "Span *": - box_converted = _ffi.cast("const STBox *", box) - result = _lib.stbox_to_tstzspan(box_converted) +def spanset_to_tbox(ss: Annotated[_ffi.CData, "const SpanSet *"]) -> Annotated[_ffi.CData, "TBox *"]: + ss_converted = _ffi.cast("const SpanSet *", ss) + result = _lib.spanset_to_tbox(ss_converted) _check_error() return result if result != _ffi.NULL else None -def tbox_to_intspan(box: "const TBox *") -> "Span *": +def tbox_to_intspan(box: Annotated[_ffi.CData, "const TBox *"]) -> Annotated[_ffi.CData, "Span *"]: box_converted = _ffi.cast("const TBox *", box) result = _lib.tbox_to_intspan(box_converted) _check_error() return result if result != _ffi.NULL else None -def tbox_to_floatspan(box: "const TBox *") -> "Span *": +def tbox_to_floatspan(box: Annotated[_ffi.CData, "const TBox *"]) -> Annotated[_ffi.CData, "Span *"]: box_converted = _ffi.cast("const TBox *", box) result = _lib.tbox_to_floatspan(box_converted) _check_error() return result if result != _ffi.NULL else None -def tbox_to_tstzspan(box: "const TBox *") -> "Span *": +def tbox_to_tstzspan(box: Annotated[_ffi.CData, "const TBox *"]) -> Annotated[_ffi.CData, "Span *"]: box_converted = _ffi.cast("const TBox *", box) result = _lib.tbox_to_tstzspan(box_converted) _check_error() return result if result != _ffi.NULL else None -def timestamptz_to_stbox(t: int) -> "STBox *": - t_converted = _ffi.cast("TimestampTz", t) - result = _lib.timestamptz_to_stbox(t_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def timestamptz_to_tbox(t: int) -> "TBox *": +def timestamptz_to_tbox(t: int) -> Annotated[_ffi.CData, "TBox *"]: t_converted = _ffi.cast("TimestampTz", t) result = _lib.timestamptz_to_tbox(t_converted) _check_error() return result if result != _ffi.NULL else None -def tstzset_to_stbox(s: "const Set *") -> "STBox *": - s_converted = _ffi.cast("const Set *", s) - result = _lib.tstzset_to_stbox(s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def tstzspan_to_stbox(s: "const Span *") -> "STBox *": - s_converted = _ffi.cast("const Span *", s) - result = _lib.tstzspan_to_stbox(s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def tstzspanset_to_stbox(ss: "const SpanSet *") -> "STBox *": - ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.tstzspanset_to_stbox(ss_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def tnumber_to_tbox(temp: "const Temporal *") -> "TBox *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tnumber_to_tbox(temp_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def tpoint_to_stbox(temp: "const Temporal *") -> "STBox *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tpoint_to_stbox(temp_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def stbox_area(box: "const STBox *", spheroid: bool) -> "double": - box_converted = _ffi.cast("const STBox *", box) - result = _lib.stbox_area(box_converted, spheroid) - _check_error() - return result if result != _ffi.NULL else None - - -def stbox_hast(box: "const STBox *") -> "bool": - box_converted = _ffi.cast("const STBox *", box) - result = _lib.stbox_hast(box_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def stbox_hasx(box: "const STBox *") -> "bool": - box_converted = _ffi.cast("const STBox *", box) - result = _lib.stbox_hasx(box_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def stbox_hasz(box: "const STBox *") -> "bool": - box_converted = _ffi.cast("const STBox *", box) - result = _lib.stbox_hasz(box_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def stbox_isgeodetic(box: "const STBox *") -> "bool": - box_converted = _ffi.cast("const STBox *", box) - result = _lib.stbox_isgeodetic(box_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def stbox_perimeter(box: "const STBox *", spheroid: bool) -> "double": - box_converted = _ffi.cast("const STBox *", box) - result = _lib.stbox_perimeter(box_converted, spheroid) +def tbox_hast(box: Annotated[_ffi.CData, "const TBox *"]) -> Annotated[bool, "bool"]: + box_converted = _ffi.cast("const TBox *", box) + result = _lib.tbox_hast(box_converted) _check_error() return result if result != _ffi.NULL else None -def stbox_srid(box: "const STBox *") -> "int32_t": - box_converted = _ffi.cast("const STBox *", box) - result = _lib.stbox_srid(box_converted) +def tbox_hasx(box: Annotated[_ffi.CData, "const TBox *"]) -> Annotated[bool, "bool"]: + box_converted = _ffi.cast("const TBox *", box) + result = _lib.tbox_hasx(box_converted) _check_error() return result if result != _ffi.NULL else None -def stbox_tmax(box: "const STBox *") -> int: - box_converted = _ffi.cast("const STBox *", box) +def tbox_tmax(box: Annotated[_ffi.CData, "const TBox *"]) -> int: + box_converted = _ffi.cast("const TBox *", box) out_result = _ffi.new("TimestampTz *") - result = _lib.stbox_tmax(box_converted, out_result) + result = _lib.tbox_tmax(box_converted, out_result) _check_error() if result: return out_result[0] if out_result[0] != _ffi.NULL else None return None -def stbox_tmax_inc(box: "const STBox *") -> "bool": - box_converted = _ffi.cast("const STBox *", box) +def tbox_tmax_inc(box: Annotated[_ffi.CData, "const TBox *"]) -> Annotated[_ffi.CData, "bool"]: + box_converted = _ffi.cast("const TBox *", box) out_result = _ffi.new("bool *") - result = _lib.stbox_tmax_inc(box_converted, out_result) + result = _lib.tbox_tmax_inc(box_converted, out_result) _check_error() if result: return out_result[0] if out_result[0] != _ffi.NULL else None return None -def stbox_tmin(box: "const STBox *") -> int: - box_converted = _ffi.cast("const STBox *", box) +def tbox_tmin(box: Annotated[_ffi.CData, "const TBox *"]) -> int: + box_converted = _ffi.cast("const TBox *", box) out_result = _ffi.new("TimestampTz *") - result = _lib.stbox_tmin(box_converted, out_result) + result = _lib.tbox_tmin(box_converted, out_result) _check_error() if result: return out_result[0] if out_result[0] != _ffi.NULL else None return None -def stbox_tmin_inc(box: "const STBox *") -> "bool": - box_converted = _ffi.cast("const STBox *", box) +def tbox_tmin_inc(box: Annotated[_ffi.CData, "const TBox *"]) -> Annotated[_ffi.CData, "bool"]: + box_converted = _ffi.cast("const TBox *", box) out_result = _ffi.new("bool *") - result = _lib.stbox_tmin_inc(box_converted, out_result) + result = _lib.tbox_tmin_inc(box_converted, out_result) _check_error() if result: return out_result[0] if out_result[0] != _ffi.NULL else None return None -def stbox_volume(box: "const STBox *") -> "double": - box_converted = _ffi.cast("const STBox *", box) - result = _lib.stbox_volume(box_converted) +def tbox_xmax(box: Annotated[_ffi.CData, "const TBox *"]) -> Annotated[_ffi.CData, "double"]: + box_converted = _ffi.cast("const TBox *", box) + out_result = _ffi.new("double *") + result = _lib.tbox_xmax(box_converted, out_result) _check_error() - return result if result != _ffi.NULL else None + if result: + return out_result[0] if out_result[0] != _ffi.NULL else None + return None -def stbox_xmax(box: "const STBox *") -> "double": - box_converted = _ffi.cast("const STBox *", box) - out_result = _ffi.new("double *") - result = _lib.stbox_xmax(box_converted, out_result) +def tbox_xmax_inc(box: Annotated[_ffi.CData, "const TBox *"]) -> Annotated[_ffi.CData, "bool"]: + box_converted = _ffi.cast("const TBox *", box) + out_result = _ffi.new("bool *") + result = _lib.tbox_xmax_inc(box_converted, out_result) _check_error() if result: return out_result[0] if out_result[0] != _ffi.NULL else None return None -def stbox_xmin(box: "const STBox *") -> "double": - box_converted = _ffi.cast("const STBox *", box) +def tbox_xmin(box: Annotated[_ffi.CData, "const TBox *"]) -> Annotated[_ffi.CData, "double"]: + box_converted = _ffi.cast("const TBox *", box) out_result = _ffi.new("double *") - result = _lib.stbox_xmin(box_converted, out_result) + result = _lib.tbox_xmin(box_converted, out_result) _check_error() if result: return out_result[0] if out_result[0] != _ffi.NULL else None return None -def stbox_ymax(box: "const STBox *") -> "double": - box_converted = _ffi.cast("const STBox *", box) - out_result = _ffi.new("double *") - result = _lib.stbox_ymax(box_converted, out_result) +def tbox_xmin_inc(box: Annotated[_ffi.CData, "const TBox *"]) -> Annotated[_ffi.CData, "bool"]: + box_converted = _ffi.cast("const TBox *", box) + out_result = _ffi.new("bool *") + result = _lib.tbox_xmin_inc(box_converted, out_result) _check_error() if result: return out_result[0] if out_result[0] != _ffi.NULL else None return None -def stbox_ymin(box: "const STBox *") -> "double": - box_converted = _ffi.cast("const STBox *", box) +def tboxfloat_xmax(box: Annotated[_ffi.CData, "const TBox *"]) -> Annotated[_ffi.CData, "double"]: + box_converted = _ffi.cast("const TBox *", box) out_result = _ffi.new("double *") - result = _lib.stbox_ymin(box_converted, out_result) + result = _lib.tboxfloat_xmax(box_converted, out_result) _check_error() if result: return out_result[0] if out_result[0] != _ffi.NULL else None return None -def stbox_zmax(box: "const STBox *") -> "double": - box_converted = _ffi.cast("const STBox *", box) +def tboxfloat_xmin(box: Annotated[_ffi.CData, "const TBox *"]) -> Annotated[_ffi.CData, "double"]: + box_converted = _ffi.cast("const TBox *", box) out_result = _ffi.new("double *") - result = _lib.stbox_zmax(box_converted, out_result) + result = _lib.tboxfloat_xmin(box_converted, out_result) _check_error() if result: return out_result[0] if out_result[0] != _ffi.NULL else None return None -def stbox_zmin(box: "const STBox *") -> "double": - box_converted = _ffi.cast("const STBox *", box) - out_result = _ffi.new("double *") - result = _lib.stbox_zmin(box_converted, out_result) - _check_error() - if result: - return out_result[0] if out_result[0] != _ffi.NULL else None - return None - - -def tbox_hast(box: "const TBox *") -> "bool": - box_converted = _ffi.cast("const TBox *", box) - result = _lib.tbox_hast(box_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def tbox_hasx(box: "const TBox *") -> "bool": - box_converted = _ffi.cast("const TBox *", box) - result = _lib.tbox_hasx(box_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def tbox_tmax(box: "const TBox *") -> int: - box_converted = _ffi.cast("const TBox *", box) - out_result = _ffi.new("TimestampTz *") - result = _lib.tbox_tmax(box_converted, out_result) - _check_error() - if result: - return out_result[0] if out_result[0] != _ffi.NULL else None - return None - - -def tbox_tmax_inc(box: "const TBox *") -> "bool": - box_converted = _ffi.cast("const TBox *", box) - out_result = _ffi.new("bool *") - result = _lib.tbox_tmax_inc(box_converted, out_result) - _check_error() - if result: - return out_result[0] if out_result[0] != _ffi.NULL else None - return None - - -def tbox_tmin(box: "const TBox *") -> int: - box_converted = _ffi.cast("const TBox *", box) - out_result = _ffi.new("TimestampTz *") - result = _lib.tbox_tmin(box_converted, out_result) - _check_error() - if result: - return out_result[0] if out_result[0] != _ffi.NULL else None - return None - - -def tbox_tmin_inc(box: "const TBox *") -> "bool": - box_converted = _ffi.cast("const TBox *", box) - out_result = _ffi.new("bool *") - result = _lib.tbox_tmin_inc(box_converted, out_result) - _check_error() - if result: - return out_result[0] if out_result[0] != _ffi.NULL else None - return None - - -def tbox_xmax(box: "const TBox *") -> "double": - box_converted = _ffi.cast("const TBox *", box) - out_result = _ffi.new("double *") - result = _lib.tbox_xmax(box_converted, out_result) - _check_error() - if result: - return out_result[0] if out_result[0] != _ffi.NULL else None - return None - - -def tbox_xmax_inc(box: "const TBox *") -> "bool": - box_converted = _ffi.cast("const TBox *", box) - out_result = _ffi.new("bool *") - result = _lib.tbox_xmax_inc(box_converted, out_result) - _check_error() - if result: - return out_result[0] if out_result[0] != _ffi.NULL else None - return None - - -def tbox_xmin(box: "const TBox *") -> "double": - box_converted = _ffi.cast("const TBox *", box) - out_result = _ffi.new("double *") - result = _lib.tbox_xmin(box_converted, out_result) - _check_error() - if result: - return out_result[0] if out_result[0] != _ffi.NULL else None - return None - - -def tbox_xmin_inc(box: "const TBox *") -> "bool": - box_converted = _ffi.cast("const TBox *", box) - out_result = _ffi.new("bool *") - result = _lib.tbox_xmin_inc(box_converted, out_result) - _check_error() - if result: - return out_result[0] if out_result[0] != _ffi.NULL else None - return None - - -def tboxfloat_xmax(box: "const TBox *") -> "double": - box_converted = _ffi.cast("const TBox *", box) - out_result = _ffi.new("double *") - result = _lib.tboxfloat_xmax(box_converted, out_result) - _check_error() - if result: - return out_result[0] if out_result[0] != _ffi.NULL else None - return None - - -def tboxfloat_xmin(box: "const TBox *") -> "double": - box_converted = _ffi.cast("const TBox *", box) - out_result = _ffi.new("double *") - result = _lib.tboxfloat_xmin(box_converted, out_result) - _check_error() - if result: - return out_result[0] if out_result[0] != _ffi.NULL else None - return None - - -def tboxint_xmax(box: "const TBox *") -> "int": +def tboxint_xmax(box: Annotated[_ffi.CData, "const TBox *"]) -> Annotated[_ffi.CData, "int"]: box_converted = _ffi.cast("const TBox *", box) out_result = _ffi.new("int *") result = _lib.tboxint_xmax(box_converted, out_result) @@ -5994,7 +5948,7 @@ def tboxint_xmax(box: "const TBox *") -> "int": return None -def tboxint_xmin(box: "const TBox *") -> "int": +def tboxint_xmin(box: Annotated[_ffi.CData, "const TBox *"]) -> Annotated[_ffi.CData, "int"]: box_converted = _ffi.cast("const TBox *", box) out_result = _ffi.new("int *") result = _lib.tboxint_xmin(box_converted, out_result) @@ -6004,123 +5958,31 @@ def tboxint_xmin(box: "const TBox *") -> "int": return None -def stbox_expand_space(box: "const STBox *", d: float) -> "STBox *": - box_converted = _ffi.cast("const STBox *", box) - result = _lib.stbox_expand_space(box_converted, d) - _check_error() - return result if result != _ffi.NULL else None - - -def stbox_expand_time(box: "const STBox *", interv: "const Interval *") -> "STBox *": - box_converted = _ffi.cast("const STBox *", box) - interv_converted = _ffi.cast("const Interval *", interv) - result = _lib.stbox_expand_time(box_converted, interv_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def stbox_get_space(box: "const STBox *") -> "STBox *": - box_converted = _ffi.cast("const STBox *", box) - result = _lib.stbox_get_space(box_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def stbox_quad_split(box: "const STBox *") -> "Tuple['STBox *', 'int']": - box_converted = _ffi.cast("const STBox *", box) - count = _ffi.new("int *") - result = _lib.stbox_quad_split(box_converted, count) - _check_error() - return result if result != _ffi.NULL else None, count[0] - - -def stbox_round(box: "const STBox *", maxdd: int) -> "STBox *": - box_converted = _ffi.cast("const STBox *", box) - result = _lib.stbox_round(box_converted, maxdd) - _check_error() - return result if result != _ffi.NULL else None - - -def stbox_set_srid(box: "const STBox *", srid: "int32_t") -> "STBox *": - box_converted = _ffi.cast("const STBox *", box) - srid_converted = _ffi.cast("int32_t", srid) - result = _lib.stbox_set_srid(box_converted, srid_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def stbox_shift_scale_time( - box: "const STBox *", - shift: "Optional['const Interval *']", - duration: "Optional['const Interval *']", -) -> "STBox *": - box_converted = _ffi.cast("const STBox *", box) - shift_converted = ( - _ffi.cast("const Interval *", shift) if shift is not None else _ffi.NULL - ) - duration_converted = ( - _ffi.cast("const Interval *", duration) if duration is not None else _ffi.NULL - ) - result = _lib.stbox_shift_scale_time( - box_converted, shift_converted, duration_converted - ) - _check_error() - return result if result != _ffi.NULL else None - - -def stbox_transform(box: "const STBox *", srid: "int32_t") -> "STBox *": - box_converted = _ffi.cast("const STBox *", box) - srid_converted = _ffi.cast("int32_t", srid) - result = _lib.stbox_transform(box_converted, srid_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def stbox_transform_pipeline( - box: "const STBox *", pipelinestr: str, srid: "int32_t", is_forward: bool -) -> "STBox *": - box_converted = _ffi.cast("const STBox *", box) - pipelinestr_converted = pipelinestr.encode("utf-8") - srid_converted = _ffi.cast("int32_t", srid) - result = _lib.stbox_transform_pipeline( - box_converted, pipelinestr_converted, srid_converted, is_forward - ) - _check_error() - return result if result != _ffi.NULL else None - - -def stboxarr_round(boxarr: "const STBox *", count: int, maxdd: int) -> "STBox *": - boxarr_converted = _ffi.cast("const STBox *", boxarr) - result = _lib.stboxarr_round(boxarr_converted, count, maxdd) - _check_error() - return result if result != _ffi.NULL else None - - -def tbox_expand_time(box: "const TBox *", interv: "const Interval *") -> "TBox *": +def tbox_expand_float(box: Annotated[_ffi.CData, "const TBox *"], d: float) -> Annotated[_ffi.CData, "TBox *"]: box_converted = _ffi.cast("const TBox *", box) - interv_converted = _ffi.cast("const Interval *", interv) - result = _lib.tbox_expand_time(box_converted, interv_converted) + result = _lib.tbox_expand_float(box_converted, d) _check_error() return result if result != _ffi.NULL else None -def tbox_expand_float(box: "const TBox *", d: "const double") -> "TBox *": +def tbox_expand_int(box: Annotated[_ffi.CData, "const TBox *"], i: int) -> Annotated[_ffi.CData, "TBox *"]: box_converted = _ffi.cast("const TBox *", box) - d_converted = _ffi.cast("const double", d) - result = _lib.tbox_expand_float(box_converted, d_converted) + result = _lib.tbox_expand_int(box_converted, i) _check_error() return result if result != _ffi.NULL else None -def tbox_expand_int(box: "const TBox *", i: "const int") -> "TBox *": +def tbox_expand_time( + box: Annotated[_ffi.CData, "const TBox *"], interv: Annotated[_ffi.CData, "const Interval *"] +) -> Annotated[_ffi.CData, "TBox *"]: box_converted = _ffi.cast("const TBox *", box) - i_converted = _ffi.cast("const int", i) - result = _lib.tbox_expand_int(box_converted, i_converted) + interv_converted = _ffi.cast("const Interval *", interv) + result = _lib.tbox_expand_time(box_converted, interv_converted) _check_error() return result if result != _ffi.NULL else None -def tbox_round(box: "const TBox *", maxdd: int) -> "TBox *": +def tbox_round(box: Annotated[_ffi.CData, "const TBox *"], maxdd: int) -> Annotated[_ffi.CData, "TBox *"]: box_converted = _ffi.cast("const TBox *", box) result = _lib.tbox_round(box_converted, maxdd) _check_error() @@ -6128,19 +5990,17 @@ def tbox_round(box: "const TBox *", maxdd: int) -> "TBox *": def tbox_shift_scale_float( - box: "const TBox *", shift: float, width: float, hasshift: bool, haswidth: bool -) -> "TBox *": + box: Annotated[_ffi.CData, "const TBox *"], shift: float, width: float, hasshift: bool, haswidth: bool +) -> Annotated[_ffi.CData, "TBox *"]: box_converted = _ffi.cast("const TBox *", box) - result = _lib.tbox_shift_scale_float( - box_converted, shift, width, hasshift, haswidth - ) + result = _lib.tbox_shift_scale_float(box_converted, shift, width, hasshift, haswidth) _check_error() return result if result != _ffi.NULL else None def tbox_shift_scale_int( - box: "const TBox *", shift: int, width: int, hasshift: bool, haswidth: bool -) -> "TBox *": + box: Annotated[_ffi.CData, "const TBox *"], shift: int, width: int, hasshift: bool, haswidth: bool +) -> Annotated[_ffi.CData, "TBox *"]: box_converted = _ffi.cast("const TBox *", box) result = _lib.tbox_shift_scale_int(box_converted, shift, width, hasshift, haswidth) _check_error() @@ -6148,27 +6008,21 @@ def tbox_shift_scale_int( def tbox_shift_scale_time( - box: "const TBox *", - shift: "Optional['const Interval *']", - duration: "Optional['const Interval *']", -) -> "TBox *": + box: Annotated[_ffi.CData, "const TBox *"], + shift: Annotated[_ffi.CData, "const Interval *"] | None, + duration: Annotated[_ffi.CData, "const Interval *"] | None, +) -> Annotated[_ffi.CData, "TBox *"]: box_converted = _ffi.cast("const TBox *", box) - shift_converted = ( - _ffi.cast("const Interval *", shift) if shift is not None else _ffi.NULL - ) - duration_converted = ( - _ffi.cast("const Interval *", duration) if duration is not None else _ffi.NULL - ) - result = _lib.tbox_shift_scale_time( - box_converted, shift_converted, duration_converted - ) + shift_converted = _ffi.cast("const Interval *", shift) if shift is not None else _ffi.NULL + duration_converted = _ffi.cast("const Interval *", duration) if duration is not None else _ffi.NULL + result = _lib.tbox_shift_scale_time(box_converted, shift_converted, duration_converted) _check_error() return result if result != _ffi.NULL else None def union_tbox_tbox( - box1: "const TBox *", box2: "const TBox *", strict: bool -) -> "TBox *": + box1: Annotated[_ffi.CData, "const TBox *"], box2: Annotated[_ffi.CData, "const TBox *"], strict: bool +) -> Annotated[_ffi.CData, "TBox *"]: box1_converted = _ffi.cast("const TBox *", box1) box2_converted = _ffi.cast("const TBox *", box2) result = _lib.union_tbox_tbox(box1_converted, box2_converted, strict) @@ -6176,7 +6030,9 @@ def union_tbox_tbox( return result if result != _ffi.NULL else None -def intersection_tbox_tbox(box1: "const TBox *", box2: "const TBox *") -> "TBox *": +def intersection_tbox_tbox( + box1: Annotated[_ffi.CData, "const TBox *"], box2: Annotated[_ffi.CData, "const TBox *"] +) -> Annotated[_ffi.CData, "TBox *"]: box1_converted = _ffi.cast("const TBox *", box1) box2_converted = _ffi.cast("const TBox *", box2) result = _lib.intersection_tbox_tbox(box1_converted, box2_converted) @@ -6184,11990 +6040,14710 @@ def intersection_tbox_tbox(box1: "const TBox *", box2: "const TBox *") -> "TBox return result if result != _ffi.NULL else None -def union_stbox_stbox( - box1: "const STBox *", box2: "const STBox *", strict: bool -) -> "STBox *": - box1_converted = _ffi.cast("const STBox *", box1) - box2_converted = _ffi.cast("const STBox *", box2) - result = _lib.union_stbox_stbox(box1_converted, box2_converted, strict) +def adjacent_tbox_tbox( + box1: Annotated[_ffi.CData, "const TBox *"], box2: Annotated[_ffi.CData, "const TBox *"] +) -> Annotated[bool, "bool"]: + box1_converted = _ffi.cast("const TBox *", box1) + box2_converted = _ffi.cast("const TBox *", box2) + result = _lib.adjacent_tbox_tbox(box1_converted, box2_converted) _check_error() return result if result != _ffi.NULL else None -def intersection_stbox_stbox(box1: "const STBox *", box2: "const STBox *") -> "STBox *": - box1_converted = _ffi.cast("const STBox *", box1) - box2_converted = _ffi.cast("const STBox *", box2) - result = _lib.intersection_stbox_stbox(box1_converted, box2_converted) +def contained_tbox_tbox( + box1: Annotated[_ffi.CData, "const TBox *"], box2: Annotated[_ffi.CData, "const TBox *"] +) -> Annotated[bool, "bool"]: + box1_converted = _ffi.cast("const TBox *", box1) + box2_converted = _ffi.cast("const TBox *", box2) + result = _lib.contained_tbox_tbox(box1_converted, box2_converted) _check_error() return result if result != _ffi.NULL else None -def rtree_create_stbox() -> "RTree *": - result = _lib.rtree_create_stbox() +def contains_tbox_tbox( + box1: Annotated[_ffi.CData, "const TBox *"], box2: Annotated[_ffi.CData, "const TBox *"] +) -> Annotated[bool, "bool"]: + box1_converted = _ffi.cast("const TBox *", box1) + box2_converted = _ffi.cast("const TBox *", box2) + result = _lib.contains_tbox_tbox(box1_converted, box2_converted) _check_error() return result if result != _ffi.NULL else None -def rtree_free(rtree: "RTree*") -> None: - rtree_converted = _ffi.cast("RTree*", rtree) - _lib.rtree_free(rtree_converted) +def overlaps_tbox_tbox( + box1: Annotated[_ffi.CData, "const TBox *"], box2: Annotated[_ffi.CData, "const TBox *"] +) -> Annotated[bool, "bool"]: + box1_converted = _ffi.cast("const TBox *", box1) + box2_converted = _ffi.cast("const TBox *", box2) + result = _lib.overlaps_tbox_tbox(box1_converted, box2_converted) _check_error() + return result if result != _ffi.NULL else None -def adjacent_stbox_stbox(box1: "const STBox *", box2: "const STBox *") -> "bool": - box1_converted = _ffi.cast("const STBox *", box1) - box2_converted = _ffi.cast("const STBox *", box2) - result = _lib.adjacent_stbox_stbox(box1_converted, box2_converted) +def same_tbox_tbox( + box1: Annotated[_ffi.CData, "const TBox *"], box2: Annotated[_ffi.CData, "const TBox *"] +) -> Annotated[bool, "bool"]: + box1_converted = _ffi.cast("const TBox *", box1) + box2_converted = _ffi.cast("const TBox *", box2) + result = _lib.same_tbox_tbox(box1_converted, box2_converted) _check_error() return result if result != _ffi.NULL else None -def adjacent_tbox_tbox(box1: "const TBox *", box2: "const TBox *") -> "bool": +def after_tbox_tbox( + box1: Annotated[_ffi.CData, "const TBox *"], box2: Annotated[_ffi.CData, "const TBox *"] +) -> Annotated[bool, "bool"]: box1_converted = _ffi.cast("const TBox *", box1) box2_converted = _ffi.cast("const TBox *", box2) - result = _lib.adjacent_tbox_tbox(box1_converted, box2_converted) + result = _lib.after_tbox_tbox(box1_converted, box2_converted) _check_error() return result if result != _ffi.NULL else None -def contained_tbox_tbox(box1: "const TBox *", box2: "const TBox *") -> "bool": +def before_tbox_tbox( + box1: Annotated[_ffi.CData, "const TBox *"], box2: Annotated[_ffi.CData, "const TBox *"] +) -> Annotated[bool, "bool"]: box1_converted = _ffi.cast("const TBox *", box1) box2_converted = _ffi.cast("const TBox *", box2) - result = _lib.contained_tbox_tbox(box1_converted, box2_converted) + result = _lib.before_tbox_tbox(box1_converted, box2_converted) _check_error() return result if result != _ffi.NULL else None -def contained_stbox_stbox(box1: "const STBox *", box2: "const STBox *") -> "bool": - box1_converted = _ffi.cast("const STBox *", box1) - box2_converted = _ffi.cast("const STBox *", box2) - result = _lib.contained_stbox_stbox(box1_converted, box2_converted) +def left_tbox_tbox( + box1: Annotated[_ffi.CData, "const TBox *"], box2: Annotated[_ffi.CData, "const TBox *"] +) -> Annotated[bool, "bool"]: + box1_converted = _ffi.cast("const TBox *", box1) + box2_converted = _ffi.cast("const TBox *", box2) + result = _lib.left_tbox_tbox(box1_converted, box2_converted) _check_error() return result if result != _ffi.NULL else None -def contains_stbox_stbox(box1: "const STBox *", box2: "const STBox *") -> "bool": - box1_converted = _ffi.cast("const STBox *", box1) - box2_converted = _ffi.cast("const STBox *", box2) - result = _lib.contains_stbox_stbox(box1_converted, box2_converted) +def overafter_tbox_tbox( + box1: Annotated[_ffi.CData, "const TBox *"], box2: Annotated[_ffi.CData, "const TBox *"] +) -> Annotated[bool, "bool"]: + box1_converted = _ffi.cast("const TBox *", box1) + box2_converted = _ffi.cast("const TBox *", box2) + result = _lib.overafter_tbox_tbox(box1_converted, box2_converted) _check_error() return result if result != _ffi.NULL else None -def contains_tbox_tbox(box1: "const TBox *", box2: "const TBox *") -> "bool": +def overbefore_tbox_tbox( + box1: Annotated[_ffi.CData, "const TBox *"], box2: Annotated[_ffi.CData, "const TBox *"] +) -> Annotated[bool, "bool"]: box1_converted = _ffi.cast("const TBox *", box1) box2_converted = _ffi.cast("const TBox *", box2) - result = _lib.contains_tbox_tbox(box1_converted, box2_converted) + result = _lib.overbefore_tbox_tbox(box1_converted, box2_converted) _check_error() return result if result != _ffi.NULL else None -def overlaps_tbox_tbox(box1: "const TBox *", box2: "const TBox *") -> "bool": +def overleft_tbox_tbox( + box1: Annotated[_ffi.CData, "const TBox *"], box2: Annotated[_ffi.CData, "const TBox *"] +) -> Annotated[bool, "bool"]: box1_converted = _ffi.cast("const TBox *", box1) box2_converted = _ffi.cast("const TBox *", box2) - result = _lib.overlaps_tbox_tbox(box1_converted, box2_converted) + result = _lib.overleft_tbox_tbox(box1_converted, box2_converted) _check_error() return result if result != _ffi.NULL else None -def overlaps_stbox_stbox(box1: "const STBox *", box2: "const STBox *") -> "bool": - box1_converted = _ffi.cast("const STBox *", box1) - box2_converted = _ffi.cast("const STBox *", box2) - result = _lib.overlaps_stbox_stbox(box1_converted, box2_converted) +def overright_tbox_tbox( + box1: Annotated[_ffi.CData, "const TBox *"], box2: Annotated[_ffi.CData, "const TBox *"] +) -> Annotated[bool, "bool"]: + box1_converted = _ffi.cast("const TBox *", box1) + box2_converted = _ffi.cast("const TBox *", box2) + result = _lib.overright_tbox_tbox(box1_converted, box2_converted) _check_error() return result if result != _ffi.NULL else None -def same_tbox_tbox(box1: "const TBox *", box2: "const TBox *") -> "bool": +def right_tbox_tbox( + box1: Annotated[_ffi.CData, "const TBox *"], box2: Annotated[_ffi.CData, "const TBox *"] +) -> Annotated[bool, "bool"]: box1_converted = _ffi.cast("const TBox *", box1) box2_converted = _ffi.cast("const TBox *", box2) - result = _lib.same_tbox_tbox(box1_converted, box2_converted) + result = _lib.right_tbox_tbox(box1_converted, box2_converted) _check_error() return result if result != _ffi.NULL else None -def same_stbox_stbox(box1: "const STBox *", box2: "const STBox *") -> "bool": - box1_converted = _ffi.cast("const STBox *", box1) - box2_converted = _ffi.cast("const STBox *", box2) - result = _lib.same_stbox_stbox(box1_converted, box2_converted) +def tbox_cmp( + box1: Annotated[_ffi.CData, "const TBox *"], box2: Annotated[_ffi.CData, "const TBox *"] +) -> Annotated[int, "int"]: + box1_converted = _ffi.cast("const TBox *", box1) + box2_converted = _ffi.cast("const TBox *", box2) + result = _lib.tbox_cmp(box1_converted, box2_converted) _check_error() return result if result != _ffi.NULL else None -def left_tbox_tbox(box1: "const TBox *", box2: "const TBox *") -> "bool": +def tbox_eq( + box1: Annotated[_ffi.CData, "const TBox *"], box2: Annotated[_ffi.CData, "const TBox *"] +) -> Annotated[bool, "bool"]: box1_converted = _ffi.cast("const TBox *", box1) box2_converted = _ffi.cast("const TBox *", box2) - result = _lib.left_tbox_tbox(box1_converted, box2_converted) + result = _lib.tbox_eq(box1_converted, box2_converted) _check_error() return result if result != _ffi.NULL else None -def overleft_tbox_tbox(box1: "const TBox *", box2: "const TBox *") -> "bool": +def tbox_ge( + box1: Annotated[_ffi.CData, "const TBox *"], box2: Annotated[_ffi.CData, "const TBox *"] +) -> Annotated[bool, "bool"]: box1_converted = _ffi.cast("const TBox *", box1) box2_converted = _ffi.cast("const TBox *", box2) - result = _lib.overleft_tbox_tbox(box1_converted, box2_converted) + result = _lib.tbox_ge(box1_converted, box2_converted) _check_error() return result if result != _ffi.NULL else None -def right_tbox_tbox(box1: "const TBox *", box2: "const TBox *") -> "bool": +def tbox_gt( + box1: Annotated[_ffi.CData, "const TBox *"], box2: Annotated[_ffi.CData, "const TBox *"] +) -> Annotated[bool, "bool"]: box1_converted = _ffi.cast("const TBox *", box1) box2_converted = _ffi.cast("const TBox *", box2) - result = _lib.right_tbox_tbox(box1_converted, box2_converted) + result = _lib.tbox_gt(box1_converted, box2_converted) _check_error() return result if result != _ffi.NULL else None -def overright_tbox_tbox(box1: "const TBox *", box2: "const TBox *") -> "bool": +def tbox_le( + box1: Annotated[_ffi.CData, "const TBox *"], box2: Annotated[_ffi.CData, "const TBox *"] +) -> Annotated[bool, "bool"]: box1_converted = _ffi.cast("const TBox *", box1) box2_converted = _ffi.cast("const TBox *", box2) - result = _lib.overright_tbox_tbox(box1_converted, box2_converted) + result = _lib.tbox_le(box1_converted, box2_converted) _check_error() return result if result != _ffi.NULL else None -def before_tbox_tbox(box1: "const TBox *", box2: "const TBox *") -> "bool": +def tbox_lt( + box1: Annotated[_ffi.CData, "const TBox *"], box2: Annotated[_ffi.CData, "const TBox *"] +) -> Annotated[bool, "bool"]: box1_converted = _ffi.cast("const TBox *", box1) box2_converted = _ffi.cast("const TBox *", box2) - result = _lib.before_tbox_tbox(box1_converted, box2_converted) + result = _lib.tbox_lt(box1_converted, box2_converted) _check_error() return result if result != _ffi.NULL else None -def overbefore_tbox_tbox(box1: "const TBox *", box2: "const TBox *") -> "bool": +def tbox_ne( + box1: Annotated[_ffi.CData, "const TBox *"], box2: Annotated[_ffi.CData, "const TBox *"] +) -> Annotated[bool, "bool"]: box1_converted = _ffi.cast("const TBox *", box1) box2_converted = _ffi.cast("const TBox *", box2) - result = _lib.overbefore_tbox_tbox(box1_converted, box2_converted) + result = _lib.tbox_ne(box1_converted, box2_converted) _check_error() return result if result != _ffi.NULL else None -def after_tbox_tbox(box1: "const TBox *", box2: "const TBox *") -> "bool": - box1_converted = _ffi.cast("const TBox *", box1) - box2_converted = _ffi.cast("const TBox *", box2) - result = _lib.after_tbox_tbox(box1_converted, box2_converted) +def tbool_from_mfjson(string: str) -> Annotated[_ffi.CData, "Temporal *"]: + string_converted = string.encode("utf-8") + result = _lib.tbool_from_mfjson(string_converted) _check_error() return result if result != _ffi.NULL else None -def overafter_tbox_tbox(box1: "const TBox *", box2: "const TBox *") -> "bool": - box1_converted = _ffi.cast("const TBox *", box1) - box2_converted = _ffi.cast("const TBox *", box2) - result = _lib.overafter_tbox_tbox(box1_converted, box2_converted) +def tbool_in(string: str) -> Annotated[_ffi.CData, "Temporal *"]: + string_converted = string.encode("utf-8") + result = _lib.tbool_in(string_converted) _check_error() return result if result != _ffi.NULL else None -def left_stbox_stbox(box1: "const STBox *", box2: "const STBox *") -> "bool": - box1_converted = _ffi.cast("const STBox *", box1) - box2_converted = _ffi.cast("const STBox *", box2) - result = _lib.left_stbox_stbox(box1_converted, box2_converted) +def tbool_out(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[str, "char *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.tbool_out(temp_converted) _check_error() + result = _ffi.string(result).decode("utf-8") return result if result != _ffi.NULL else None -def overleft_stbox_stbox(box1: "const STBox *", box2: "const STBox *") -> "bool": - box1_converted = _ffi.cast("const STBox *", box1) - box2_converted = _ffi.cast("const STBox *", box2) - result = _lib.overleft_stbox_stbox(box1_converted, box2_converted) +def temporal_as_hexwkb( + temp: Annotated[_ffi.CData, "const Temporal *"], variant: int +) -> tuple[Annotated[str, "char *"], Annotated[_ffi.CData, "size_t *"]]: + temp_converted = _ffi.cast("const Temporal *", temp) + variant_converted = _ffi.cast("uint8_t", variant) + size_out = _ffi.new("size_t *") + result = _lib.temporal_as_hexwkb(temp_converted, variant_converted, size_out) _check_error() - return result if result != _ffi.NULL else None + result = _ffi.string(result).decode("utf-8") + return result if result != _ffi.NULL else None, size_out[0] -def right_stbox_stbox(box1: "const STBox *", box2: "const STBox *") -> "bool": - box1_converted = _ffi.cast("const STBox *", box1) - box2_converted = _ffi.cast("const STBox *", box2) - result = _lib.right_stbox_stbox(box1_converted, box2_converted) +def temporal_as_mfjson( + temp: Annotated[_ffi.CData, "const Temporal *"], with_bbox: bool, flags: int, precision: int, srs: str | None +) -> Annotated[str, "char *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + srs_converted = srs.encode("utf-8") if srs is not None else _ffi.NULL + result = _lib.temporal_as_mfjson(temp_converted, with_bbox, flags, precision, srs_converted) _check_error() + result = _ffi.string(result).decode("utf-8") return result if result != _ffi.NULL else None -def overright_stbox_stbox(box1: "const STBox *", box2: "const STBox *") -> "bool": - box1_converted = _ffi.cast("const STBox *", box1) - box2_converted = _ffi.cast("const STBox *", box2) - result = _lib.overright_stbox_stbox(box1_converted, box2_converted) +def temporal_as_wkb( + temp: Annotated[_ffi.CData, "const Temporal *"], variant: int +) -> tuple[Annotated[_ffi.CData, "uint8_t *"], Annotated[_ffi.CData, "size_t *"]]: + temp_converted = _ffi.cast("const Temporal *", temp) + variant_converted = _ffi.cast("uint8_t", variant) + size_out = _ffi.new("size_t *") + result = _lib.temporal_as_wkb(temp_converted, variant_converted, size_out) _check_error() - return result if result != _ffi.NULL else None + result_converted = bytes(result[i] for i in range(size_out[0])) if result != _ffi.NULL else None + return result_converted -def below_stbox_stbox(box1: "const STBox *", box2: "const STBox *") -> "bool": - box1_converted = _ffi.cast("const STBox *", box1) - box2_converted = _ffi.cast("const STBox *", box2) - result = _lib.below_stbox_stbox(box1_converted, box2_converted) +def temporal_from_hexwkb(hexwkb: str) -> Annotated[_ffi.CData, "Temporal *"]: + hexwkb_converted = hexwkb.encode("utf-8") + result = _lib.temporal_from_hexwkb(hexwkb_converted) _check_error() return result if result != _ffi.NULL else None -def overbelow_stbox_stbox(box1: "const STBox *", box2: "const STBox *") -> "bool": - box1_converted = _ffi.cast("const STBox *", box1) - box2_converted = _ffi.cast("const STBox *", box2) - result = _lib.overbelow_stbox_stbox(box1_converted, box2_converted) - _check_error() +def temporal_from_wkb(wkb: bytes) -> "Temporal *": + wkb_converted = _ffi.new("uint8_t []", wkb) + result = _lib.temporal_from_wkb(wkb_converted, len(wkb)) return result if result != _ffi.NULL else None -def above_stbox_stbox(box1: "const STBox *", box2: "const STBox *") -> "bool": - box1_converted = _ffi.cast("const STBox *", box1) - box2_converted = _ffi.cast("const STBox *", box2) - result = _lib.above_stbox_stbox(box1_converted, box2_converted) +def tfloat_from_mfjson(string: str) -> Annotated[_ffi.CData, "Temporal *"]: + string_converted = string.encode("utf-8") + result = _lib.tfloat_from_mfjson(string_converted) _check_error() return result if result != _ffi.NULL else None -def overabove_stbox_stbox(box1: "const STBox *", box2: "const STBox *") -> "bool": - box1_converted = _ffi.cast("const STBox *", box1) - box2_converted = _ffi.cast("const STBox *", box2) - result = _lib.overabove_stbox_stbox(box1_converted, box2_converted) +def tfloat_in(string: str) -> Annotated[_ffi.CData, "Temporal *"]: + string_converted = string.encode("utf-8") + result = _lib.tfloat_in(string_converted) _check_error() return result if result != _ffi.NULL else None -def front_stbox_stbox(box1: "const STBox *", box2: "const STBox *") -> "bool": - box1_converted = _ffi.cast("const STBox *", box1) - box2_converted = _ffi.cast("const STBox *", box2) - result = _lib.front_stbox_stbox(box1_converted, box2_converted) +def tfloat_out(temp: Annotated[_ffi.CData, "const Temporal *"], maxdd: int) -> Annotated[str, "char *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.tfloat_out(temp_converted, maxdd) _check_error() + result = _ffi.string(result).decode("utf-8") return result if result != _ffi.NULL else None -def overfront_stbox_stbox(box1: "const STBox *", box2: "const STBox *") -> "bool": - box1_converted = _ffi.cast("const STBox *", box1) - box2_converted = _ffi.cast("const STBox *", box2) - result = _lib.overfront_stbox_stbox(box1_converted, box2_converted) +def tint_from_mfjson(string: str) -> Annotated[_ffi.CData, "Temporal *"]: + string_converted = string.encode("utf-8") + result = _lib.tint_from_mfjson(string_converted) _check_error() return result if result != _ffi.NULL else None -def back_stbox_stbox(box1: "const STBox *", box2: "const STBox *") -> "bool": - box1_converted = _ffi.cast("const STBox *", box1) - box2_converted = _ffi.cast("const STBox *", box2) - result = _lib.back_stbox_stbox(box1_converted, box2_converted) +def tint_in(string: str) -> Annotated[_ffi.CData, "Temporal *"]: + string_converted = string.encode("utf-8") + result = _lib.tint_in(string_converted) _check_error() return result if result != _ffi.NULL else None -def overback_stbox_stbox(box1: "const STBox *", box2: "const STBox *") -> "bool": - box1_converted = _ffi.cast("const STBox *", box1) - box2_converted = _ffi.cast("const STBox *", box2) - result = _lib.overback_stbox_stbox(box1_converted, box2_converted) +def tint_out(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[str, "char *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.tint_out(temp_converted) _check_error() + result = _ffi.string(result).decode("utf-8") return result if result != _ffi.NULL else None -def before_stbox_stbox(box1: "const STBox *", box2: "const STBox *") -> "bool": - box1_converted = _ffi.cast("const STBox *", box1) - box2_converted = _ffi.cast("const STBox *", box2) - result = _lib.before_stbox_stbox(box1_converted, box2_converted) +def ttext_from_mfjson(string: str) -> Annotated[_ffi.CData, "Temporal *"]: + string_converted = string.encode("utf-8") + result = _lib.ttext_from_mfjson(string_converted) _check_error() return result if result != _ffi.NULL else None -def overbefore_stbox_stbox(box1: "const STBox *", box2: "const STBox *") -> "bool": - box1_converted = _ffi.cast("const STBox *", box1) - box2_converted = _ffi.cast("const STBox *", box2) - result = _lib.overbefore_stbox_stbox(box1_converted, box2_converted) +def ttext_in(string: str) -> Annotated[_ffi.CData, "Temporal *"]: + string_converted = string.encode("utf-8") + result = _lib.ttext_in(string_converted) _check_error() return result if result != _ffi.NULL else None -def after_stbox_stbox(box1: "const STBox *", box2: "const STBox *") -> "bool": - box1_converted = _ffi.cast("const STBox *", box1) - box2_converted = _ffi.cast("const STBox *", box2) - result = _lib.after_stbox_stbox(box1_converted, box2_converted) +def ttext_out(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[str, "char *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.ttext_out(temp_converted) _check_error() + result = _ffi.string(result).decode("utf-8") return result if result != _ffi.NULL else None -def overafter_stbox_stbox(box1: "const STBox *", box2: "const STBox *") -> "bool": - box1_converted = _ffi.cast("const STBox *", box1) - box2_converted = _ffi.cast("const STBox *", box2) - result = _lib.overafter_stbox_stbox(box1_converted, box2_converted) +def tbool_from_base_temp( + b: bool, temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[_ffi.CData, "Temporal *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.tbool_from_base_temp(b, temp_converted) _check_error() return result if result != _ffi.NULL else None -def tbox_eq(box1: "const TBox *", box2: "const TBox *") -> "bool": - box1_converted = _ffi.cast("const TBox *", box1) - box2_converted = _ffi.cast("const TBox *", box2) - result = _lib.tbox_eq(box1_converted, box2_converted) +def tboolinst_make(b: bool, t: int) -> Annotated[_ffi.CData, "TInstant *"]: + t_converted = _ffi.cast("TimestampTz", t) + result = _lib.tboolinst_make(b, t_converted) _check_error() return result if result != _ffi.NULL else None -def tbox_ne(box1: "const TBox *", box2: "const TBox *") -> "bool": - box1_converted = _ffi.cast("const TBox *", box1) - box2_converted = _ffi.cast("const TBox *", box2) - result = _lib.tbox_ne(box1_converted, box2_converted) +def tboolseq_from_base_tstzset( + b: bool, s: Annotated[_ffi.CData, "const Set *"] +) -> Annotated[_ffi.CData, "TSequence *"]: + s_converted = _ffi.cast("const Set *", s) + result = _lib.tboolseq_from_base_tstzset(b, s_converted) _check_error() return result if result != _ffi.NULL else None -def tbox_cmp(box1: "const TBox *", box2: "const TBox *") -> "int": - box1_converted = _ffi.cast("const TBox *", box1) - box2_converted = _ffi.cast("const TBox *", box2) - result = _lib.tbox_cmp(box1_converted, box2_converted) +def tboolseq_from_base_tstzspan( + b: bool, s: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[_ffi.CData, "TSequence *"]: + s_converted = _ffi.cast("const Span *", s) + result = _lib.tboolseq_from_base_tstzspan(b, s_converted) _check_error() return result if result != _ffi.NULL else None -def tbox_lt(box1: "const TBox *", box2: "const TBox *") -> "bool": - box1_converted = _ffi.cast("const TBox *", box1) - box2_converted = _ffi.cast("const TBox *", box2) - result = _lib.tbox_lt(box1_converted, box2_converted) +def tboolseqset_from_base_tstzspanset( + b: bool, ss: Annotated[_ffi.CData, "const SpanSet *"] +) -> Annotated[_ffi.CData, "TSequenceSet *"]: + ss_converted = _ffi.cast("const SpanSet *", ss) + result = _lib.tboolseqset_from_base_tstzspanset(b, ss_converted) _check_error() return result if result != _ffi.NULL else None -def tbox_le(box1: "const TBox *", box2: "const TBox *") -> "bool": - box1_converted = _ffi.cast("const TBox *", box1) - box2_converted = _ffi.cast("const TBox *", box2) - result = _lib.tbox_le(box1_converted, box2_converted) +def temporal_copy(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "Temporal *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.temporal_copy(temp_converted) _check_error() return result if result != _ffi.NULL else None -def tbox_ge(box1: "const TBox *", box2: "const TBox *") -> "bool": - box1_converted = _ffi.cast("const TBox *", box1) - box2_converted = _ffi.cast("const TBox *", box2) - result = _lib.tbox_ge(box1_converted, box2_converted) +def tfloat_from_base_temp( + d: float, temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[_ffi.CData, "Temporal *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.tfloat_from_base_temp(d, temp_converted) _check_error() return result if result != _ffi.NULL else None -def tbox_gt(box1: "const TBox *", box2: "const TBox *") -> "bool": - box1_converted = _ffi.cast("const TBox *", box1) - box2_converted = _ffi.cast("const TBox *", box2) - result = _lib.tbox_gt(box1_converted, box2_converted) +def tfloatinst_make(d: float, t: int) -> Annotated[_ffi.CData, "TInstant *"]: + t_converted = _ffi.cast("TimestampTz", t) + result = _lib.tfloatinst_make(d, t_converted) _check_error() return result if result != _ffi.NULL else None -def stbox_eq(box1: "const STBox *", box2: "const STBox *") -> "bool": - box1_converted = _ffi.cast("const STBox *", box1) - box2_converted = _ffi.cast("const STBox *", box2) - result = _lib.stbox_eq(box1_converted, box2_converted) +def tfloatseq_from_base_tstzset( + d: float, s: Annotated[_ffi.CData, "const Set *"] +) -> Annotated[_ffi.CData, "TSequence *"]: + s_converted = _ffi.cast("const Set *", s) + result = _lib.tfloatseq_from_base_tstzset(d, s_converted) _check_error() return result if result != _ffi.NULL else None -def stbox_ne(box1: "const STBox *", box2: "const STBox *") -> "bool": - box1_converted = _ffi.cast("const STBox *", box1) - box2_converted = _ffi.cast("const STBox *", box2) - result = _lib.stbox_ne(box1_converted, box2_converted) +def tfloatseq_from_base_tstzspan( + d: float, s: Annotated[_ffi.CData, "const Span *"], interp: InterpolationType +) -> Annotated[_ffi.CData, "TSequence *"]: + s_converted = _ffi.cast("const Span *", s) + result = _lib.tfloatseq_from_base_tstzspan(d, s_converted, interp) _check_error() return result if result != _ffi.NULL else None -def stbox_cmp(box1: "const STBox *", box2: "const STBox *") -> "int": - box1_converted = _ffi.cast("const STBox *", box1) - box2_converted = _ffi.cast("const STBox *", box2) - result = _lib.stbox_cmp(box1_converted, box2_converted) +def tfloatseqset_from_base_tstzspanset( + d: float, ss: Annotated[_ffi.CData, "const SpanSet *"], interp: InterpolationType +) -> Annotated[_ffi.CData, "TSequenceSet *"]: + ss_converted = _ffi.cast("const SpanSet *", ss) + result = _lib.tfloatseqset_from_base_tstzspanset(d, ss_converted, interp) _check_error() return result if result != _ffi.NULL else None -def stbox_lt(box1: "const STBox *", box2: "const STBox *") -> "bool": - box1_converted = _ffi.cast("const STBox *", box1) - box2_converted = _ffi.cast("const STBox *", box2) - result = _lib.stbox_lt(box1_converted, box2_converted) +def tint_from_base_temp(i: int, temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "Temporal *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.tint_from_base_temp(i, temp_converted) _check_error() return result if result != _ffi.NULL else None -def stbox_le(box1: "const STBox *", box2: "const STBox *") -> "bool": - box1_converted = _ffi.cast("const STBox *", box1) - box2_converted = _ffi.cast("const STBox *", box2) - result = _lib.stbox_le(box1_converted, box2_converted) +def tintinst_make(i: int, t: int) -> Annotated[_ffi.CData, "TInstant *"]: + t_converted = _ffi.cast("TimestampTz", t) + result = _lib.tintinst_make(i, t_converted) _check_error() return result if result != _ffi.NULL else None -def stbox_ge(box1: "const STBox *", box2: "const STBox *") -> "bool": - box1_converted = _ffi.cast("const STBox *", box1) - box2_converted = _ffi.cast("const STBox *", box2) - result = _lib.stbox_ge(box1_converted, box2_converted) +def tintseq_from_base_tstzset(i: int, s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[_ffi.CData, "TSequence *"]: + s_converted = _ffi.cast("const Set *", s) + result = _lib.tintseq_from_base_tstzset(i, s_converted) _check_error() return result if result != _ffi.NULL else None -def stbox_gt(box1: "const STBox *", box2: "const STBox *") -> "bool": - box1_converted = _ffi.cast("const STBox *", box1) - box2_converted = _ffi.cast("const STBox *", box2) - result = _lib.stbox_gt(box1_converted, box2_converted) +def tintseq_from_base_tstzspan( + i: int, s: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[_ffi.CData, "TSequence *"]: + s_converted = _ffi.cast("const Span *", s) + result = _lib.tintseq_from_base_tstzspan(i, s_converted) _check_error() return result if result != _ffi.NULL else None -def tbool_in(string: str) -> "Temporal *": - string_converted = string.encode("utf-8") - result = _lib.tbool_in(string_converted) +def tintseqset_from_base_tstzspanset( + i: int, ss: Annotated[_ffi.CData, "const SpanSet *"] +) -> Annotated[_ffi.CData, "TSequenceSet *"]: + ss_converted = _ffi.cast("const SpanSet *", ss) + result = _lib.tintseqset_from_base_tstzspanset(i, ss_converted) _check_error() return result if result != _ffi.NULL else None -def tint_in(string: str) -> "Temporal *": - string_converted = string.encode("utf-8") - result = _lib.tint_in(string_converted) +def tsequence_make( + instants: Annotated[list, "const TInstant **"], + count: int, + lower_inc: bool, + upper_inc: bool, + interp: InterpolationType, + normalize: bool, +) -> Annotated[_ffi.CData, "TSequence *"]: + instants_converted = [_ffi.cast("const TInstant *", x) for x in instants] + result = _lib.tsequence_make(instants_converted, count, lower_inc, upper_inc, interp, normalize) _check_error() return result if result != _ffi.NULL else None -def tfloat_in(string: str) -> "Temporal *": - string_converted = string.encode("utf-8") - result = _lib.tfloat_in(string_converted) +def tsequenceset_make( + sequences: Annotated[list, "const TSequence **"], count: int, normalize: bool +) -> Annotated[_ffi.CData, "TSequenceSet *"]: + sequences_converted = [_ffi.cast("const TSequence *", x) for x in sequences] + result = _lib.tsequenceset_make(sequences_converted, count, normalize) _check_error() return result if result != _ffi.NULL else None -def ttext_in(string: str) -> "Temporal *": - string_converted = string.encode("utf-8") - result = _lib.ttext_in(string_converted) +def tsequenceset_make_gaps( + instants: Annotated[list, "const TInstant **"], + interp: InterpolationType, + maxt: Annotated[_ffi.CData, "const Interval *"] | None, + maxdist: float, +) -> Annotated[_ffi.CData, "TSequenceSet *"]: + instants_converted = [_ffi.cast("const TInstant *", x) for x in instants] + maxt_converted = _ffi.cast("const Interval *", maxt) if maxt is not None else _ffi.NULL + result = _lib.tsequenceset_make_gaps(instants_converted, len(instants), interp, maxt_converted, maxdist) _check_error() return result if result != _ffi.NULL else None -def tgeompoint_in(string: str) -> "Temporal *": - string_converted = string.encode("utf-8") - result = _lib.tgeompoint_in(string_converted) +def ttext_from_base_temp( + txt: str, temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[_ffi.CData, "Temporal *"]: + txt_converted = cstring2text(txt) + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.ttext_from_base_temp(txt_converted, temp_converted) _check_error() return result if result != _ffi.NULL else None -def tgeogpoint_in(string: str) -> "Temporal *": - string_converted = string.encode("utf-8") - result = _lib.tgeogpoint_in(string_converted) +def ttextinst_make(txt: str, t: int) -> Annotated[_ffi.CData, "TInstant *"]: + txt_converted = cstring2text(txt) + t_converted = _ffi.cast("TimestampTz", t) + result = _lib.ttextinst_make(txt_converted, t_converted) _check_error() return result if result != _ffi.NULL else None -def tbool_from_mfjson(string: str) -> "Temporal *": - string_converted = string.encode("utf-8") - result = _lib.tbool_from_mfjson(string_converted) +def ttextseq_from_base_tstzset( + txt: str, s: Annotated[_ffi.CData, "const Set *"] +) -> Annotated[_ffi.CData, "TSequence *"]: + txt_converted = cstring2text(txt) + s_converted = _ffi.cast("const Set *", s) + result = _lib.ttextseq_from_base_tstzset(txt_converted, s_converted) _check_error() return result if result != _ffi.NULL else None -def tint_from_mfjson(string: str) -> "Temporal *": - string_converted = string.encode("utf-8") - result = _lib.tint_from_mfjson(string_converted) +def ttextseq_from_base_tstzspan( + txt: str, s: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[_ffi.CData, "TSequence *"]: + txt_converted = cstring2text(txt) + s_converted = _ffi.cast("const Span *", s) + result = _lib.ttextseq_from_base_tstzspan(txt_converted, s_converted) _check_error() return result if result != _ffi.NULL else None -def tfloat_from_mfjson(string: str) -> "Temporal *": - string_converted = string.encode("utf-8") - result = _lib.tfloat_from_mfjson(string_converted) +def ttextseqset_from_base_tstzspanset( + txt: str, ss: Annotated[_ffi.CData, "const SpanSet *"] +) -> Annotated[_ffi.CData, "TSequenceSet *"]: + txt_converted = cstring2text(txt) + ss_converted = _ffi.cast("const SpanSet *", ss) + result = _lib.ttextseqset_from_base_tstzspanset(txt_converted, ss_converted) _check_error() return result if result != _ffi.NULL else None -def ttext_from_mfjson(string: str) -> "Temporal *": - string_converted = string.encode("utf-8") - result = _lib.ttext_from_mfjson(string_converted) +def tbool_to_tint(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "Temporal *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.tbool_to_tint(temp_converted) _check_error() return result if result != _ffi.NULL else None -def tgeompoint_from_mfjson(string: str) -> "Temporal *": - string_converted = string.encode("utf-8") - result = _lib.tgeompoint_from_mfjson(string_converted) +def temporal_to_tstzspan(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "Span *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.temporal_to_tstzspan(temp_converted) _check_error() return result if result != _ffi.NULL else None -def tgeogpoint_from_mfjson(string: str) -> "Temporal *": - string_converted = string.encode("utf-8") - result = _lib.tgeogpoint_from_mfjson(string_converted) +def tfloat_to_tint(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "Temporal *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.tfloat_to_tint(temp_converted) _check_error() return result if result != _ffi.NULL else None -def temporal_from_wkb(wkb: bytes) -> "Temporal *": - wkb_converted = _ffi.new("uint8_t []", wkb) - result = _lib.temporal_from_wkb(wkb_converted, len(wkb)) +def tint_to_tfloat(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "Temporal *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.tint_to_tfloat(temp_converted) + _check_error() return result if result != _ffi.NULL else None -def temporal_from_hexwkb(hexwkb: str) -> "Temporal *": - hexwkb_converted = hexwkb.encode("utf-8") - result = _lib.temporal_from_hexwkb(hexwkb_converted) +def tnumber_to_span(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "Span *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.tnumber_to_span(temp_converted) _check_error() return result if result != _ffi.NULL else None -def tbool_out(temp: "const Temporal *") -> str: +def tnumber_to_tbox(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "TBox *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tbool_out(temp_converted) + result = _lib.tnumber_to_tbox(temp_converted) _check_error() - result = _ffi.string(result).decode("utf-8") return result if result != _ffi.NULL else None -def tint_out(temp: "const Temporal *") -> str: +def tbool_end_value(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[bool, "bool"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tint_out(temp_converted) + result = _lib.tbool_end_value(temp_converted) _check_error() - result = _ffi.string(result).decode("utf-8") return result if result != _ffi.NULL else None -def tfloat_out(temp: "const Temporal *", maxdd: int) -> str: +def tbool_start_value(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[bool, "bool"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tfloat_out(temp_converted, maxdd) + result = _lib.tbool_start_value(temp_converted) _check_error() - result = _ffi.string(result).decode("utf-8") return result if result != _ffi.NULL else None -def ttext_out(temp: "const Temporal *") -> str: +def tbool_value_at_timestamptz( + temp: Annotated[_ffi.CData, "const Temporal *"], t: int, strict: bool +) -> Annotated[_ffi.CData, "bool"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.ttext_out(temp_converted) + t_converted = _ffi.cast("TimestampTz", t) + out_result = _ffi.new("bool *") + result = _lib.tbool_value_at_timestamptz(temp_converted, t_converted, strict, out_result) _check_error() - result = _ffi.string(result).decode("utf-8") - return result if result != _ffi.NULL else None + if result: + return out_result[0] if out_result[0] != _ffi.NULL else None + return None -def tpoint_out(temp: "const Temporal *", maxdd: int) -> str: +def tbool_value_n(temp: Annotated[_ffi.CData, "const Temporal *"], n: int) -> Annotated[_ffi.CData, "bool"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tpoint_out(temp_converted, maxdd) + out_result = _ffi.new("bool *") + result = _lib.tbool_value_n(temp_converted, n, out_result) _check_error() - result = _ffi.string(result).decode("utf-8") - return result if result != _ffi.NULL else None + if result: + return out_result[0] if out_result[0] != _ffi.NULL else None + return None -def tpoint_as_text(temp: "const Temporal *", maxdd: int) -> str: +def tbool_values( + temp: Annotated[_ffi.CData, "const Temporal *"], count: Annotated[_ffi.CData, "int *"] +) -> Annotated[_ffi.CData, "bool *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tpoint_as_text(temp_converted, maxdd) + count_converted = _ffi.cast("int *", count) + result = _lib.tbool_values(temp_converted, count_converted) _check_error() - result = _ffi.string(result).decode("utf-8") return result if result != _ffi.NULL else None -def tpoint_as_ewkt(temp: "const Temporal *", maxdd: int) -> str: +def temporal_duration( + temp: Annotated[_ffi.CData, "const Temporal *"], boundspan: bool +) -> Annotated[_ffi.CData, "Interval *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tpoint_as_ewkt(temp_converted, maxdd) + result = _lib.temporal_duration(temp_converted, boundspan) _check_error() - result = _ffi.string(result).decode("utf-8") return result if result != _ffi.NULL else None -def temporal_as_mfjson( - temp: "const Temporal *", - with_bbox: bool, - flags: int, - precision: int, - srs: "Optional[str]", -) -> str: +def temporal_end_instant(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "TInstant *"]: temp_converted = _ffi.cast("const Temporal *", temp) - srs_converted = srs.encode("utf-8") if srs is not None else _ffi.NULL - result = _lib.temporal_as_mfjson( - temp_converted, with_bbox, flags, precision, srs_converted - ) + result = _lib.temporal_end_instant(temp_converted) _check_error() - result = _ffi.string(result).decode("utf-8") return result if result != _ffi.NULL else None -def temporal_as_wkb(temp: "const Temporal *", variant: int) -> bytes: - temp_converted = _ffi.cast("const Temporal *", temp) - variant_converted = _ffi.cast("uint8_t", variant) - size_out = _ffi.new("size_t *") - result = _lib.temporal_as_wkb(temp_converted, variant_converted, size_out) - _check_error() - result_converted = ( - bytes(result[i] for i in range(size_out[0])) if result != _ffi.NULL else None - ) - return result_converted - - -def temporal_as_hexwkb( - temp: "const Temporal *", variant: int -) -> "Tuple[str, 'size_t *']": - temp_converted = _ffi.cast("const Temporal *", temp) - variant_converted = _ffi.cast("uint8_t", variant) - size_out = _ffi.new("size_t *") - result = _lib.temporal_as_hexwkb(temp_converted, variant_converted, size_out) - _check_error() - result = _ffi.string(result).decode("utf-8") - return result if result != _ffi.NULL else None, size_out[0] - - -def tbool_from_base_temp(b: bool, temp: "const Temporal *") -> "Temporal *": +def temporal_end_sequence(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "TSequence *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tbool_from_base_temp(b, temp_converted) + result = _lib.temporal_end_sequence(temp_converted) _check_error() return result if result != _ffi.NULL else None -def tboolinst_make(b: bool, t: int) -> "TInstant *": - t_converted = _ffi.cast("TimestampTz", t) - result = _lib.tboolinst_make(b, t_converted) +def temporal_end_timestamptz(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[int, "TimestampTz"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.temporal_end_timestamptz(temp_converted) _check_error() return result if result != _ffi.NULL else None -def tboolseq_from_base_tstzset(b: bool, s: "const Set *") -> "TSequence *": - s_converted = _ffi.cast("const Set *", s) - result = _lib.tboolseq_from_base_tstzset(b, s_converted) +def temporal_hash(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[int, "uint32"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.temporal_hash(temp_converted) _check_error() return result if result != _ffi.NULL else None -def tboolseq_from_base_tstzspan(b: bool, s: "const Span *") -> "TSequence *": - s_converted = _ffi.cast("const Span *", s) - result = _lib.tboolseq_from_base_tstzspan(b, s_converted) +def temporal_instant_n(temp: Annotated[_ffi.CData, "const Temporal *"], n: int) -> Annotated[_ffi.CData, "TInstant *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.temporal_instant_n(temp_converted, n) _check_error() return result if result != _ffi.NULL else None -def tboolseqset_from_base_tstzspanset( - b: bool, ss: "const SpanSet *" -) -> "TSequenceSet *": - ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.tboolseqset_from_base_tstzspanset(b, ss_converted) +def temporal_instants( + temp: Annotated[_ffi.CData, "const Temporal *"], count: Annotated[_ffi.CData, "int *"] +) -> Annotated[_ffi.CData, "TInstant **"]: + temp_converted = _ffi.cast("const Temporal *", temp) + count_converted = _ffi.cast("int *", count) + result = _lib.temporal_instants(temp_converted, count_converted) _check_error() return result if result != _ffi.NULL else None -def temporal_copy(temp: "const Temporal *") -> "Temporal *": +def temporal_interp(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[str, "const char *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.temporal_copy(temp_converted) + result = _lib.temporal_interp(temp_converted) _check_error() + result = _ffi.string(result).decode("utf-8") return result if result != _ffi.NULL else None -def tfloat_from_base_temp(d: float, temp: "const Temporal *") -> "Temporal *": +def temporal_lower_inc(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[bool, "bool"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tfloat_from_base_temp(d, temp_converted) + result = _lib.temporal_lower_inc(temp_converted) _check_error() return result if result != _ffi.NULL else None -def tfloatinst_make(d: float, t: int) -> "TInstant *": - t_converted = _ffi.cast("TimestampTz", t) - result = _lib.tfloatinst_make(d, t_converted) +def temporal_max_instant(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "TInstant *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.temporal_max_instant(temp_converted) _check_error() return result if result != _ffi.NULL else None -def tfloatseq_from_base_tstzspan( - d: float, s: "const Span *", interp: "interpType" -) -> "TSequence *": - s_converted = _ffi.cast("const Span *", s) - interp_converted = _ffi.cast("interpType", interp) - result = _lib.tfloatseq_from_base_tstzspan(d, s_converted, interp_converted) +def temporal_min_instant(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "TInstant *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.temporal_min_instant(temp_converted) _check_error() return result if result != _ffi.NULL else None -def tfloatseq_from_base_tstzset(d: float, s: "const Set *") -> "TSequence *": - s_converted = _ffi.cast("const Set *", s) - result = _lib.tfloatseq_from_base_tstzset(d, s_converted) +def temporal_num_instants(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[int, "int"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.temporal_num_instants(temp_converted) _check_error() return result if result != _ffi.NULL else None -def tfloatseqset_from_base_tstzspanset( - d: float, ss: "const SpanSet *", interp: "interpType" -) -> "TSequenceSet *": - ss_converted = _ffi.cast("const SpanSet *", ss) - interp_converted = _ffi.cast("interpType", interp) - result = _lib.tfloatseqset_from_base_tstzspanset(d, ss_converted, interp_converted) +def temporal_num_sequences(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[int, "int"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.temporal_num_sequences(temp_converted) _check_error() return result if result != _ffi.NULL else None -def tint_from_base_temp(i: int, temp: "const Temporal *") -> "Temporal *": +def temporal_num_timestamps(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[int, "int"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tint_from_base_temp(i, temp_converted) + result = _lib.temporal_num_timestamps(temp_converted) _check_error() return result if result != _ffi.NULL else None -def tintinst_make(i: int, t: int) -> "TInstant *": - t_converted = _ffi.cast("TimestampTz", t) - result = _lib.tintinst_make(i, t_converted) +def temporal_segments( + temp: Annotated[_ffi.CData, "const Temporal *"], count: Annotated[_ffi.CData, "int *"] +) -> Annotated[_ffi.CData, "TSequence **"]: + temp_converted = _ffi.cast("const Temporal *", temp) + count_converted = _ffi.cast("int *", count) + result = _lib.temporal_segments(temp_converted, count_converted) _check_error() return result if result != _ffi.NULL else None -def tintseq_from_base_tstzspan(i: int, s: "const Span *") -> "TSequence *": - s_converted = _ffi.cast("const Span *", s) - result = _lib.tintseq_from_base_tstzspan(i, s_converted) +def temporal_sequence_n( + temp: Annotated[_ffi.CData, "const Temporal *"], i: int +) -> Annotated[_ffi.CData, "TSequence *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.temporal_sequence_n(temp_converted, i) _check_error() return result if result != _ffi.NULL else None -def tintseq_from_base_tstzset(i: int, s: "const Set *") -> "TSequence *": - s_converted = _ffi.cast("const Set *", s) - result = _lib.tintseq_from_base_tstzset(i, s_converted) +def temporal_sequences( + temp: Annotated[_ffi.CData, "const Temporal *"], count: Annotated[_ffi.CData, "int *"] +) -> Annotated[_ffi.CData, "TSequence **"]: + temp_converted = _ffi.cast("const Temporal *", temp) + count_converted = _ffi.cast("int *", count) + result = _lib.temporal_sequences(temp_converted, count_converted) _check_error() return result if result != _ffi.NULL else None -def tintseqset_from_base_tstzspanset(i: int, ss: "const SpanSet *") -> "TSequenceSet *": - ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.tintseqset_from_base_tstzspanset(i, ss_converted) +def temporal_start_instant(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "TInstant *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.temporal_start_instant(temp_converted) _check_error() return result if result != _ffi.NULL else None -def tpoint_from_base_temp( - gs: "const GSERIALIZED *", temp: "const Temporal *" -) -> "Temporal *": - gs_converted = _ffi.cast("const GSERIALIZED *", gs) +def temporal_start_sequence(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "TSequence *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tpoint_from_base_temp(gs_converted, temp_converted) + result = _lib.temporal_start_sequence(temp_converted) _check_error() return result if result != _ffi.NULL else None -def tpointinst_make(gs: "const GSERIALIZED *", t: int) -> "TInstant *": - gs_converted = _ffi.cast("const GSERIALIZED *", gs) - t_converted = _ffi.cast("TimestampTz", t) - result = _lib.tpointinst_make(gs_converted, t_converted) +def temporal_start_timestamptz(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[int, "TimestampTz"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.temporal_start_timestamptz(temp_converted) _check_error() return result if result != _ffi.NULL else None -def tpointseq_from_base_tstzspan( - gs: "const GSERIALIZED *", s: "const Span *", interp: "interpType" -) -> "TSequence *": - gs_converted = _ffi.cast("const GSERIALIZED *", gs) - s_converted = _ffi.cast("const Span *", s) - interp_converted = _ffi.cast("interpType", interp) - result = _lib.tpointseq_from_base_tstzspan( - gs_converted, s_converted, interp_converted - ) +def temporal_stops( + temp: Annotated[_ffi.CData, "const Temporal *"], + maxdist: float, + minduration: Annotated[_ffi.CData, "const Interval *"], +) -> Annotated[_ffi.CData, "TSequenceSet *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + minduration_converted = _ffi.cast("const Interval *", minduration) + result = _lib.temporal_stops(temp_converted, maxdist, minduration_converted) _check_error() return result if result != _ffi.NULL else None -def tpointseq_from_base_tstzset( - gs: "const GSERIALIZED *", s: "const Set *" -) -> "TSequence *": - gs_converted = _ffi.cast("const GSERIALIZED *", gs) - s_converted = _ffi.cast("const Set *", s) - result = _lib.tpointseq_from_base_tstzset(gs_converted, s_converted) +def temporal_subtype(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[str, "const char *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.temporal_subtype(temp_converted) _check_error() + result = _ffi.string(result).decode("utf-8") return result if result != _ffi.NULL else None -def tpointseqset_from_base_tstzspanset( - gs: "const GSERIALIZED *", ss: "const SpanSet *", interp: "interpType" -) -> "TSequenceSet *": - gs_converted = _ffi.cast("const GSERIALIZED *", gs) - ss_converted = _ffi.cast("const SpanSet *", ss) - interp_converted = _ffi.cast("interpType", interp) - result = _lib.tpointseqset_from_base_tstzspanset( - gs_converted, ss_converted, interp_converted - ) +def temporal_time(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "SpanSet *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.temporal_time(temp_converted) _check_error() return result if result != _ffi.NULL else None -def tsequence_make( - instants: "const TInstant **", - count: int, - lower_inc: bool, - upper_inc: bool, - interp: "interpType", - normalize: bool, -) -> "TSequence *": - instants_converted = [_ffi.cast("const TInstant *", x) for x in instants] - interp_converted = _ffi.cast("interpType", interp) - result = _lib.tsequence_make( - instants_converted, count, lower_inc, upper_inc, interp_converted, normalize - ) +def temporal_timestamps( + temp: Annotated[_ffi.CData, "const Temporal *"], count: Annotated[_ffi.CData, "int *"] +) -> Annotated[int, "TimestampTz *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + count_converted = _ffi.cast("int *", count) + result = _lib.temporal_timestamps(temp_converted, count_converted) _check_error() return result if result != _ffi.NULL else None -def tsequenceset_make( - sequences: "const TSequence **", count: int, normalize: bool -) -> "TSequenceSet *": - sequences_converted = [_ffi.cast("const TSequence *", x) for x in sequences] - result = _lib.tsequenceset_make(sequences_converted, count, normalize) +def temporal_timestamptz_n(temp: Annotated[_ffi.CData, "const Temporal *"], n: int) -> int: + temp_converted = _ffi.cast("const Temporal *", temp) + out_result = _ffi.new("TimestampTz *") + result = _lib.temporal_timestamptz_n(temp_converted, n, out_result) _check_error() - return result if result != _ffi.NULL else None + if result: + return out_result[0] if out_result[0] != _ffi.NULL else None + return None -def tsequenceset_make_gaps( - instants: "const TInstant **", - interp: "interpType", - maxt: "Optional['const Interval *']", - maxdist: float, -) -> "TSequenceSet *": - instants_converted = [_ffi.cast("const TInstant *", x) for x in instants] - interp_converted = _ffi.cast("interpType", interp) - maxt_converted = ( - _ffi.cast("const Interval *", maxt) if maxt is not None else _ffi.NULL - ) - result = _lib.tsequenceset_make_gaps( - instants_converted, len(instants), interp_converted, maxt_converted, maxdist - ) +def temporal_upper_inc(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[bool, "bool"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.temporal_upper_inc(temp_converted) _check_error() return result if result != _ffi.NULL else None -def ttext_from_base_temp(txt: str, temp: "const Temporal *") -> "Temporal *": - txt_converted = cstring2text(txt) +def tfloat_end_value(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[float, "double"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.ttext_from_base_temp(txt_converted, temp_converted) + result = _lib.tfloat_end_value(temp_converted) _check_error() return result if result != _ffi.NULL else None -def ttextinst_make(txt: str, t: int) -> "TInstant *": - txt_converted = cstring2text(txt) - t_converted = _ffi.cast("TimestampTz", t) - result = _lib.ttextinst_make(txt_converted, t_converted) +def tfloat_max_value(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[float, "double"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.tfloat_max_value(temp_converted) _check_error() return result if result != _ffi.NULL else None -def ttextseq_from_base_tstzspan(txt: str, s: "const Span *") -> "TSequence *": - txt_converted = cstring2text(txt) - s_converted = _ffi.cast("const Span *", s) - result = _lib.ttextseq_from_base_tstzspan(txt_converted, s_converted) +def tfloat_min_value(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[float, "double"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.tfloat_min_value(temp_converted) _check_error() return result if result != _ffi.NULL else None -def ttextseq_from_base_tstzset(txt: str, s: "const Set *") -> "TSequence *": - txt_converted = cstring2text(txt) - s_converted = _ffi.cast("const Set *", s) - result = _lib.ttextseq_from_base_tstzset(txt_converted, s_converted) +def tfloat_start_value(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[float, "double"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.tfloat_start_value(temp_converted) _check_error() return result if result != _ffi.NULL else None -def ttextseqset_from_base_tstzspanset( - txt: str, ss: "const SpanSet *" -) -> "TSequenceSet *": - txt_converted = cstring2text(txt) - ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.ttextseqset_from_base_tstzspanset(txt_converted, ss_converted) +def tfloat_value_at_timestamptz( + temp: Annotated[_ffi.CData, "const Temporal *"], t: int, strict: bool +) -> Annotated[_ffi.CData, "double"]: + temp_converted = _ffi.cast("const Temporal *", temp) + t_converted = _ffi.cast("TimestampTz", t) + out_result = _ffi.new("double *") + result = _lib.tfloat_value_at_timestamptz(temp_converted, t_converted, strict, out_result) _check_error() - return result if result != _ffi.NULL else None + if result: + return out_result[0] if out_result[0] != _ffi.NULL else None + return None -def temporal_to_tstzspan(temp: "const Temporal *") -> "Span *": +def tfloat_value_n(temp: Annotated[_ffi.CData, "const Temporal *"], n: int) -> Annotated[_ffi.CData, "double"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.temporal_to_tstzspan(temp_converted) + out_result = _ffi.new("double *") + result = _lib.tfloat_value_n(temp_converted, n, out_result) _check_error() - return result if result != _ffi.NULL else None + if result: + return out_result[0] if out_result[0] != _ffi.NULL else None + return None -def tfloat_to_tint(temp: "const Temporal *") -> "Temporal *": +def tfloat_values( + temp: Annotated[_ffi.CData, "const Temporal *"], count: Annotated[_ffi.CData, "int *"] +) -> Annotated[_ffi.CData, "double *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tfloat_to_tint(temp_converted) + count_converted = _ffi.cast("int *", count) + result = _lib.tfloat_values(temp_converted, count_converted) _check_error() return result if result != _ffi.NULL else None -def tint_to_tfloat(temp: "const Temporal *") -> "Temporal *": +def tint_end_value(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[int, "int"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tint_to_tfloat(temp_converted) + result = _lib.tint_end_value(temp_converted) _check_error() return result if result != _ffi.NULL else None -def tnumber_to_span(temp: "const Temporal *") -> "Span *": +def tint_max_value(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[int, "int"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tnumber_to_span(temp_converted) + result = _lib.tint_max_value(temp_converted) _check_error() return result if result != _ffi.NULL else None -def tbool_end_value(temp: "const Temporal *") -> "bool": +def tint_min_value(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[int, "int"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tbool_end_value(temp_converted) + result = _lib.tint_min_value(temp_converted) _check_error() return result if result != _ffi.NULL else None -def tbool_start_value(temp: "const Temporal *") -> "bool": +def tint_start_value(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[int, "int"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tbool_start_value(temp_converted) + result = _lib.tint_start_value(temp_converted) _check_error() return result if result != _ffi.NULL else None -def tbool_value_at_timestamptz( - temp: "const Temporal *", t: int, strict: bool -) -> "bool": +def tint_value_at_timestamptz( + temp: Annotated[_ffi.CData, "const Temporal *"], t: int, strict: bool +) -> Annotated[_ffi.CData, "int"]: temp_converted = _ffi.cast("const Temporal *", temp) t_converted = _ffi.cast("TimestampTz", t) - out_result = _ffi.new("bool *") - result = _lib.tbool_value_at_timestamptz( - temp_converted, t_converted, strict, out_result - ) + out_result = _ffi.new("int *") + result = _lib.tint_value_at_timestamptz(temp_converted, t_converted, strict, out_result) _check_error() if result: return out_result[0] if out_result[0] != _ffi.NULL else None return None -def tbool_value_n(temp: "const Temporal *", n: int) -> "bool": +def tint_value_n(temp: Annotated[_ffi.CData, "const Temporal *"], n: int) -> Annotated[_ffi.CData, "int"]: temp_converted = _ffi.cast("const Temporal *", temp) - out_result = _ffi.new("bool *") - result = _lib.tbool_value_n(temp_converted, n, out_result) + out_result = _ffi.new("int *") + result = _lib.tint_value_n(temp_converted, n, out_result) _check_error() if result: return out_result[0] if out_result[0] != _ffi.NULL else None return None -def tbool_values(temp: "const Temporal *") -> "Tuple['bool *', 'int']": +def tint_values( + temp: Annotated[_ffi.CData, "const Temporal *"], count: Annotated[_ffi.CData, "int *"] +) -> Annotated[_ffi.CData, "int *"]: temp_converted = _ffi.cast("const Temporal *", temp) - count = _ffi.new("int *") - result = _lib.tbool_values(temp_converted, count) + count_converted = _ffi.cast("int *", count) + result = _lib.tint_values(temp_converted, count_converted) _check_error() - return result if result != _ffi.NULL else None, count[0] + return result if result != _ffi.NULL else None -def temporal_duration(temp: "const Temporal *", boundspan: bool) -> "Interval *": +def tnumber_integral(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[float, "double"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.temporal_duration(temp_converted, boundspan) + result = _lib.tnumber_integral(temp_converted) _check_error() return result if result != _ffi.NULL else None -def temporal_end_instant(temp: "const Temporal *") -> "TInstant *": +def tnumber_twavg(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[float, "double"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.temporal_end_instant(temp_converted) + result = _lib.tnumber_twavg(temp_converted) _check_error() return result if result != _ffi.NULL else None -def temporal_end_sequence(temp: "const Temporal *") -> "TSequence *": +def tnumber_valuespans(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "SpanSet *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.temporal_end_sequence(temp_converted) + result = _lib.tnumber_valuespans(temp_converted) _check_error() return result if result != _ffi.NULL else None -def temporal_end_timestamptz(temp: "const Temporal *") -> "TimestampTz": +def ttext_end_value(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[str, "text *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.temporal_end_timestamptz(temp_converted) + result = _lib.ttext_end_value(temp_converted) _check_error() + result = text2cstring(result) return result if result != _ffi.NULL else None -def temporal_hash(temp: "const Temporal *") -> "uint32": +def ttext_max_value(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[str, "text *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.temporal_hash(temp_converted) + result = _lib.ttext_max_value(temp_converted) _check_error() + result = text2cstring(result) return result if result != _ffi.NULL else None -def temporal_instant_n(temp: "const Temporal *", n: int) -> "TInstant *": +def ttext_min_value(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[str, "text *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.temporal_instant_n(temp_converted, n) + result = _lib.ttext_min_value(temp_converted) _check_error() + result = text2cstring(result) return result if result != _ffi.NULL else None -def temporal_instants(temp: "const Temporal *") -> "Tuple['TInstant **', 'int']": +def ttext_start_value(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[str, "text *"]: temp_converted = _ffi.cast("const Temporal *", temp) - count = _ffi.new("int *") - result = _lib.temporal_instants(temp_converted, count) + result = _lib.ttext_start_value(temp_converted) _check_error() - return result if result != _ffi.NULL else None, count[0] + result = text2cstring(result) + return result if result != _ffi.NULL else None -def temporal_interp(temp: "const Temporal *") -> str: +def ttext_value_at_timestamptz( + temp: Annotated[_ffi.CData, "const Temporal *"], t: int, strict: bool +) -> Annotated[list, "text **"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.temporal_interp(temp_converted) + t_converted = _ffi.cast("TimestampTz", t) + out_result = _ffi.new("text **") + result = _lib.ttext_value_at_timestamptz(temp_converted, t_converted, strict, out_result) _check_error() - result = _ffi.string(result).decode("utf-8") - return result if result != _ffi.NULL else None + if result: + return out_result if out_result != _ffi.NULL else None + return None -def temporal_max_instant(temp: "const Temporal *") -> "TInstant *": +def ttext_value_n(temp: Annotated[_ffi.CData, "const Temporal *"], n: int) -> Annotated[list, "text **"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.temporal_max_instant(temp_converted) + out_result = _ffi.new("text **") + result = _lib.ttext_value_n(temp_converted, n, out_result) _check_error() - return result if result != _ffi.NULL else None + if result: + return out_result if out_result != _ffi.NULL else None + return None -def temporal_min_instant(temp: "const Temporal *") -> "TInstant *": +def ttext_values( + temp: Annotated[_ffi.CData, "const Temporal *"], count: Annotated[_ffi.CData, "int *"] +) -> Annotated[_ffi.CData, "text **"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.temporal_min_instant(temp_converted) + count_converted = _ffi.cast("int *", count) + result = _lib.ttext_values(temp_converted, count_converted) _check_error() return result if result != _ffi.NULL else None -def temporal_num_instants(temp: "const Temporal *") -> "int": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.temporal_num_instants(temp_converted) +def float_degrees(value: float, normalize: bool) -> Annotated[float, "double"]: + result = _lib.float_degrees(value, normalize) _check_error() return result if result != _ffi.NULL else None -def temporal_num_sequences(temp: "const Temporal *") -> "int": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.temporal_num_sequences(temp_converted) +def temparr_round( + temp: Annotated[list, "const Temporal **"], count: int, maxdd: int +) -> Annotated[_ffi.CData, "Temporal **"]: + temp_converted = [_ffi.cast("const Temporal *", x) for x in temp] + result = _lib.temparr_round(temp_converted, count, maxdd) _check_error() return result if result != _ffi.NULL else None -def temporal_num_timestamps(temp: "const Temporal *") -> "int": +def temporal_round(temp: Annotated[_ffi.CData, "const Temporal *"], maxdd: int) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.temporal_num_timestamps(temp_converted) + result = _lib.temporal_round(temp_converted, maxdd) _check_error() return result if result != _ffi.NULL else None -def temporal_segments(temp: "const Temporal *") -> "Tuple['TSequence **', 'int']": - temp_converted = _ffi.cast("const Temporal *", temp) - count = _ffi.new("int *") - result = _lib.temporal_segments(temp_converted, count) - _check_error() - return result if result != _ffi.NULL else None, count[0] - - -def temporal_sequence_n(temp: "const Temporal *", i: int) -> "TSequence *": +def temporal_scale_time( + temp: Annotated[_ffi.CData, "const Temporal *"], duration: Annotated[_ffi.CData, "const Interval *"] +) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.temporal_sequence_n(temp_converted, i) + duration_converted = _ffi.cast("const Interval *", duration) + result = _lib.temporal_scale_time(temp_converted, duration_converted) _check_error() return result if result != _ffi.NULL else None -def temporal_sequences(temp: "const Temporal *") -> "Tuple['TSequence **', 'int']": +def temporal_set_interp( + temp: Annotated[_ffi.CData, "const Temporal *"], interp: InterpolationType +) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - count = _ffi.new("int *") - result = _lib.temporal_sequences(temp_converted, count) + result = _lib.temporal_set_interp(temp_converted, interp) _check_error() - return result if result != _ffi.NULL else None, count[0] + return result if result != _ffi.NULL else None -def temporal_lower_inc(temp: "const Temporal *") -> "bool": +def temporal_shift_scale_time( + temp: Annotated[_ffi.CData, "const Temporal *"], + shift: Annotated[_ffi.CData, "const Interval *"] | None, + duration: Annotated[_ffi.CData, "const Interval *"] | None, +) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.temporal_lower_inc(temp_converted) + shift_converted = _ffi.cast("const Interval *", shift) if shift is not None else _ffi.NULL + duration_converted = _ffi.cast("const Interval *", duration) if duration is not None else _ffi.NULL + result = _lib.temporal_shift_scale_time(temp_converted, shift_converted, duration_converted) _check_error() return result if result != _ffi.NULL else None -def temporal_upper_inc(temp: "const Temporal *") -> "bool": +def temporal_shift_time( + temp: Annotated[_ffi.CData, "const Temporal *"], shift: Annotated[_ffi.CData, "const Interval *"] +) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.temporal_upper_inc(temp_converted) + shift_converted = _ffi.cast("const Interval *", shift) + result = _lib.temporal_shift_time(temp_converted, shift_converted) _check_error() return result if result != _ffi.NULL else None -def temporal_start_instant(temp: "const Temporal *") -> "TInstant *": +def temporal_to_tinstant(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "TInstant *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.temporal_start_instant(temp_converted) + result = _lib.temporal_to_tinstant(temp_converted) _check_error() return result if result != _ffi.NULL else None -def temporal_start_sequence(temp: "const Temporal *") -> "TSequence *": +def temporal_to_tsequence( + temp: Annotated[_ffi.CData, "const Temporal *"], interp: InterpolationType +) -> Annotated[_ffi.CData, "TSequence *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.temporal_start_sequence(temp_converted) + result = _lib.temporal_to_tsequence(temp_converted, interp) _check_error() return result if result != _ffi.NULL else None -def temporal_start_timestamptz(temp: "const Temporal *") -> "TimestampTz": +def temporal_to_tsequenceset( + temp: Annotated[_ffi.CData, "const Temporal *"], interp: InterpolationType +) -> Annotated[_ffi.CData, "TSequenceSet *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.temporal_start_timestamptz(temp_converted) + result = _lib.temporal_to_tsequenceset(temp_converted, interp) _check_error() return result if result != _ffi.NULL else None -def temporal_stops( - temp: "const Temporal *", maxdist: float, minduration: "const Interval *" -) -> "TSequenceSet *": +def tfloat_ceil(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - minduration_converted = _ffi.cast("const Interval *", minduration) - result = _lib.temporal_stops(temp_converted, maxdist, minduration_converted) + result = _lib.tfloat_ceil(temp_converted) _check_error() return result if result != _ffi.NULL else None -def temporal_subtype(temp: "const Temporal *") -> str: +def tfloat_degrees( + temp: Annotated[_ffi.CData, "const Temporal *"], normalize: bool +) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.temporal_subtype(temp_converted) + result = _lib.tfloat_degrees(temp_converted, normalize) _check_error() - result = _ffi.string(result).decode("utf-8") return result if result != _ffi.NULL else None -def temporal_time(temp: "const Temporal *") -> "SpanSet *": +def tfloat_floor(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.temporal_time(temp_converted) + result = _lib.tfloat_floor(temp_converted) _check_error() return result if result != _ffi.NULL else None -def temporal_timestamptz_n(temp: "const Temporal *", n: int) -> int: +def tfloat_radians(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - out_result = _ffi.new("TimestampTz *") - result = _lib.temporal_timestamptz_n(temp_converted, n, out_result) + result = _lib.tfloat_radians(temp_converted) _check_error() - if result: - return out_result[0] if out_result[0] != _ffi.NULL else None - return None + return result if result != _ffi.NULL else None -def temporal_timestamps(temp: "const Temporal *") -> "Tuple['TimestampTz *', 'int']": +def tfloat_scale_value( + temp: Annotated[_ffi.CData, "const Temporal *"], width: float +) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - count = _ffi.new("int *") - result = _lib.temporal_timestamps(temp_converted, count) + result = _lib.tfloat_scale_value(temp_converted, width) _check_error() - return result if result != _ffi.NULL else None, count[0] + return result if result != _ffi.NULL else None -def tfloat_end_value(temp: "const Temporal *") -> "double": +def tfloat_shift_scale_value( + temp: Annotated[_ffi.CData, "const Temporal *"], shift: float, width: float +) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tfloat_end_value(temp_converted) + result = _lib.tfloat_shift_scale_value(temp_converted, shift, width) _check_error() return result if result != _ffi.NULL else None -def tfloat_max_value(temp: "const Temporal *") -> "double": +def tfloat_shift_value( + temp: Annotated[_ffi.CData, "const Temporal *"], shift: float +) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tfloat_max_value(temp_converted) + result = _lib.tfloat_shift_value(temp_converted, shift) _check_error() return result if result != _ffi.NULL else None -def tfloat_min_value(temp: "const Temporal *") -> "double": +def tint_scale_value( + temp: Annotated[_ffi.CData, "const Temporal *"], width: int +) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tfloat_min_value(temp_converted) + result = _lib.tint_scale_value(temp_converted, width) _check_error() return result if result != _ffi.NULL else None -def tfloat_start_value(temp: "const Temporal *") -> "double": +def tint_shift_scale_value( + temp: Annotated[_ffi.CData, "const Temporal *"], shift: int, width: int +) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tfloat_start_value(temp_converted) + result = _lib.tint_shift_scale_value(temp_converted, shift, width) _check_error() return result if result != _ffi.NULL else None -def tfloat_value_at_timestamptz( - temp: "const Temporal *", t: int, strict: bool -) -> "double": +def tint_shift_value( + temp: Annotated[_ffi.CData, "const Temporal *"], shift: int +) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - t_converted = _ffi.cast("TimestampTz", t) - out_result = _ffi.new("double *") - result = _lib.tfloat_value_at_timestamptz( - temp_converted, t_converted, strict, out_result - ) + result = _lib.tint_shift_value(temp_converted, shift) _check_error() - if result: - return out_result[0] if out_result[0] != _ffi.NULL else None - return None + return result if result != _ffi.NULL else None -def tfloat_value_n(temp: "const Temporal *", n: int) -> "double": - temp_converted = _ffi.cast("const Temporal *", temp) - out_result = _ffi.new("double *") - result = _lib.tfloat_value_n(temp_converted, n, out_result) +def temporal_append_tinstant( + temp: Annotated[_ffi.CData, "Temporal *"], + inst: Annotated[_ffi.CData, "const TInstant *"], + interp: InterpolationType, + maxdist: float, + maxt: Annotated[_ffi.CData, "const Interval *"] | None, + expand: bool, +) -> Annotated[_ffi.CData, "Temporal *"]: + temp_converted = _ffi.cast("Temporal *", temp) + inst_converted = _ffi.cast("const TInstant *", inst) + maxt_converted = _ffi.cast("const Interval *", maxt) if maxt is not None else _ffi.NULL + result = _lib.temporal_append_tinstant(temp_converted, inst_converted, interp, maxdist, maxt_converted, expand) _check_error() - if result: - return out_result[0] if out_result[0] != _ffi.NULL else None - return None + return result if result != _ffi.NULL else None -def tfloat_values(temp: "const Temporal *") -> "Tuple['double *', 'int']": - temp_converted = _ffi.cast("const Temporal *", temp) - count = _ffi.new("int *") - result = _lib.tfloat_values(temp_converted, count) +def temporal_append_tsequence( + temp: Annotated[_ffi.CData, "Temporal *"], seq: Annotated[_ffi.CData, "const TSequence *"], expand: bool +) -> Annotated[_ffi.CData, "Temporal *"]: + temp_converted = _ffi.cast("Temporal *", temp) + seq_converted = _ffi.cast("const TSequence *", seq) + result = _lib.temporal_append_tsequence(temp_converted, seq_converted, expand) _check_error() - return result if result != _ffi.NULL else None, count[0] + return result if result != _ffi.NULL else None -def tint_end_value(temp: "const Temporal *") -> "int": +def temporal_delete_timestamptz( + temp: Annotated[_ffi.CData, "const Temporal *"], t: int, connect: bool +) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tint_end_value(temp_converted) + t_converted = _ffi.cast("TimestampTz", t) + result = _lib.temporal_delete_timestamptz(temp_converted, t_converted, connect) _check_error() return result if result != _ffi.NULL else None -def tint_max_value(temp: "const Temporal *") -> "int": +def temporal_delete_tstzset( + temp: Annotated[_ffi.CData, "const Temporal *"], s: Annotated[_ffi.CData, "const Set *"], connect: bool +) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tint_max_value(temp_converted) + s_converted = _ffi.cast("const Set *", s) + result = _lib.temporal_delete_tstzset(temp_converted, s_converted, connect) _check_error() return result if result != _ffi.NULL else None -def tint_min_value(temp: "const Temporal *") -> "int": +def temporal_delete_tstzspan( + temp: Annotated[_ffi.CData, "const Temporal *"], s: Annotated[_ffi.CData, "const Span *"], connect: bool +) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tint_min_value(temp_converted) + s_converted = _ffi.cast("const Span *", s) + result = _lib.temporal_delete_tstzspan(temp_converted, s_converted, connect) _check_error() return result if result != _ffi.NULL else None -def tint_start_value(temp: "const Temporal *") -> "int": +def temporal_delete_tstzspanset( + temp: Annotated[_ffi.CData, "const Temporal *"], ss: Annotated[_ffi.CData, "const SpanSet *"], connect: bool +) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tint_start_value(temp_converted) + ss_converted = _ffi.cast("const SpanSet *", ss) + result = _lib.temporal_delete_tstzspanset(temp_converted, ss_converted, connect) _check_error() return result if result != _ffi.NULL else None -def tint_value_at_timestamptz(temp: "const Temporal *", t: int, strict: bool) -> "int": - temp_converted = _ffi.cast("const Temporal *", temp) - t_converted = _ffi.cast("TimestampTz", t) - out_result = _ffi.new("int *") - result = _lib.tint_value_at_timestamptz( - temp_converted, t_converted, strict, out_result - ) +def temporal_insert( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"], connect: bool +) -> Annotated[_ffi.CData, "Temporal *"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.temporal_insert(temp1_converted, temp2_converted, connect) _check_error() - if result: - return out_result[0] if out_result[0] != _ffi.NULL else None - return None + return result if result != _ffi.NULL else None -def tint_value_n(temp: "const Temporal *", n: int) -> "int": - temp_converted = _ffi.cast("const Temporal *", temp) - out_result = _ffi.new("int *") - result = _lib.tint_value_n(temp_converted, n, out_result) +def temporal_merge( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[_ffi.CData, "Temporal *"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.temporal_merge(temp1_converted, temp2_converted) _check_error() - if result: - return out_result[0] if out_result[0] != _ffi.NULL else None - return None + return result if result != _ffi.NULL else None -def tint_values(temp: "const Temporal *") -> "Tuple['int *', 'int']": - temp_converted = _ffi.cast("const Temporal *", temp) - count = _ffi.new("int *") - result = _lib.tint_values(temp_converted, count) +def temporal_merge_array( + temparr: Annotated[list, "const Temporal **"], count: int +) -> Annotated[_ffi.CData, "Temporal *"]: + temparr_converted = [_ffi.cast("const Temporal *", x) for x in temparr] + result = _lib.temporal_merge_array(temparr_converted, count) _check_error() - return result if result != _ffi.NULL else None, count[0] + return result if result != _ffi.NULL else None -def tnumber_integral(temp: "const Temporal *") -> "double": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tnumber_integral(temp_converted) +def temporal_update( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"], connect: bool +) -> Annotated[_ffi.CData, "Temporal *"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.temporal_update(temp1_converted, temp2_converted, connect) _check_error() return result if result != _ffi.NULL else None -def tnumber_twavg(temp: "const Temporal *") -> "double": +def tbool_at_value(temp: Annotated[_ffi.CData, "const Temporal *"], b: bool) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tnumber_twavg(temp_converted) + result = _lib.tbool_at_value(temp_converted, b) _check_error() return result if result != _ffi.NULL else None -def tnumber_valuespans(temp: "const Temporal *") -> "SpanSet *": +def tbool_minus_value(temp: Annotated[_ffi.CData, "const Temporal *"], b: bool) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tnumber_valuespans(temp_converted) + result = _lib.tbool_minus_value(temp_converted, b) _check_error() return result if result != _ffi.NULL else None -def tpoint_end_value(temp: "const Temporal *") -> "GSERIALIZED *": +def temporal_at_max(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tpoint_end_value(temp_converted) + result = _lib.temporal_at_max(temp_converted) _check_error() return result if result != _ffi.NULL else None -def tpoint_start_value(temp: "const Temporal *") -> "GSERIALIZED *": +def temporal_at_min(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tpoint_start_value(temp_converted) + result = _lib.temporal_at_min(temp_converted) _check_error() return result if result != _ffi.NULL else None -def tpoint_value_at_timestamptz( - temp: "const Temporal *", t: int, strict: bool -) -> "GSERIALIZED **": +def temporal_at_timestamptz( + temp: Annotated[_ffi.CData, "const Temporal *"], t: int +) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) t_converted = _ffi.cast("TimestampTz", t) - out_result = _ffi.new("GSERIALIZED **") - result = _lib.tpoint_value_at_timestamptz( - temp_converted, t_converted, strict, out_result - ) + result = _lib.temporal_at_timestamptz(temp_converted, t_converted) _check_error() - if result: - return out_result if out_result != _ffi.NULL else None - return None + return result if result != _ffi.NULL else None -def tpoint_value_n(temp: "const Temporal *", n: int) -> "GSERIALIZED **": +def temporal_at_tstzset( + temp: Annotated[_ffi.CData, "const Temporal *"], s: Annotated[_ffi.CData, "const Set *"] +) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - out_result = _ffi.new("GSERIALIZED **") - result = _lib.tpoint_value_n(temp_converted, n, out_result) + s_converted = _ffi.cast("const Set *", s) + result = _lib.temporal_at_tstzset(temp_converted, s_converted) _check_error() - if result: - return out_result if out_result != _ffi.NULL else None - return None + return result if result != _ffi.NULL else None -def tpoint_values(temp: "const Temporal *") -> "Tuple['GSERIALIZED **', 'int']": +def temporal_at_tstzspan( + temp: Annotated[_ffi.CData, "const Temporal *"], s: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - count = _ffi.new("int *") - result = _lib.tpoint_values(temp_converted, count) + s_converted = _ffi.cast("const Span *", s) + result = _lib.temporal_at_tstzspan(temp_converted, s_converted) _check_error() - return result if result != _ffi.NULL else None, count[0] + return result if result != _ffi.NULL else None -def ttext_end_value(temp: "const Temporal *") -> str: +def temporal_at_tstzspanset( + temp: Annotated[_ffi.CData, "const Temporal *"], ss: Annotated[_ffi.CData, "const SpanSet *"] +) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.ttext_end_value(temp_converted) + ss_converted = _ffi.cast("const SpanSet *", ss) + result = _lib.temporal_at_tstzspanset(temp_converted, ss_converted) _check_error() - result = text2cstring(result) return result if result != _ffi.NULL else None -def ttext_max_value(temp: "const Temporal *") -> str: +def temporal_at_values( + temp: Annotated[_ffi.CData, "const Temporal *"], set: Annotated[_ffi.CData, "const Set *"] +) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.ttext_max_value(temp_converted) + set_converted = _ffi.cast("const Set *", set) + result = _lib.temporal_at_values(temp_converted, set_converted) _check_error() - result = text2cstring(result) return result if result != _ffi.NULL else None -def ttext_min_value(temp: "const Temporal *") -> str: +def temporal_minus_max(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.ttext_min_value(temp_converted) + result = _lib.temporal_minus_max(temp_converted) _check_error() - result = text2cstring(result) return result if result != _ffi.NULL else None -def ttext_start_value(temp: "const Temporal *") -> str: +def temporal_minus_min(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.ttext_start_value(temp_converted) + result = _lib.temporal_minus_min(temp_converted) _check_error() - result = text2cstring(result) return result if result != _ffi.NULL else None -def ttext_value_at_timestamptz( - temp: "const Temporal *", t: int, strict: bool -) -> "text **": +def temporal_minus_timestamptz( + temp: Annotated[_ffi.CData, "const Temporal *"], t: int +) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) t_converted = _ffi.cast("TimestampTz", t) - out_result = _ffi.new("text **") - result = _lib.ttext_value_at_timestamptz( - temp_converted, t_converted, strict, out_result - ) + result = _lib.temporal_minus_timestamptz(temp_converted, t_converted) _check_error() - if result: - return out_result if out_result != _ffi.NULL else None - return None + return result if result != _ffi.NULL else None -def ttext_value_n(temp: "const Temporal *", n: int) -> "text **": +def temporal_minus_tstzset( + temp: Annotated[_ffi.CData, "const Temporal *"], s: Annotated[_ffi.CData, "const Set *"] +) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - out_result = _ffi.new("text **") - result = _lib.ttext_value_n(temp_converted, n, out_result) + s_converted = _ffi.cast("const Set *", s) + result = _lib.temporal_minus_tstzset(temp_converted, s_converted) _check_error() - if result: - return out_result if out_result != _ffi.NULL else None - return None + return result if result != _ffi.NULL else None -def ttext_values(temp: "const Temporal *") -> "Tuple['text **', 'int']": +def temporal_minus_tstzspan( + temp: Annotated[_ffi.CData, "const Temporal *"], s: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - count = _ffi.new("int *") - result = _lib.ttext_values(temp_converted, count) + s_converted = _ffi.cast("const Span *", s) + result = _lib.temporal_minus_tstzspan(temp_converted, s_converted) _check_error() - return result if result != _ffi.NULL else None, count[0] + return result if result != _ffi.NULL else None -def float_degrees(value: float, normalize: bool) -> "double": - result = _lib.float_degrees(value, normalize) +def temporal_minus_tstzspanset( + temp: Annotated[_ffi.CData, "const Temporal *"], ss: Annotated[_ffi.CData, "const SpanSet *"] +) -> Annotated[_ffi.CData, "Temporal *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + ss_converted = _ffi.cast("const SpanSet *", ss) + result = _lib.temporal_minus_tstzspanset(temp_converted, ss_converted) _check_error() return result if result != _ffi.NULL else None -def meos_srid_is_latlong(srid: "int32_t") -> "bool": - srid_converted = _ffi.cast("int32_t", srid) - result = _lib.meos_srid_is_latlong(srid_converted) +def temporal_minus_values( + temp: Annotated[_ffi.CData, "const Temporal *"], set: Annotated[_ffi.CData, "const Set *"] +) -> Annotated[_ffi.CData, "Temporal *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + set_converted = _ffi.cast("const Set *", set) + result = _lib.temporal_minus_values(temp_converted, set_converted) _check_error() return result if result != _ffi.NULL else None -def temporal_scale_time( - temp: "const Temporal *", duration: "const Interval *" -) -> "Temporal *": +def tfloat_at_value(temp: Annotated[_ffi.CData, "const Temporal *"], d: float) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - duration_converted = _ffi.cast("const Interval *", duration) - result = _lib.temporal_scale_time(temp_converted, duration_converted) + result = _lib.tfloat_at_value(temp_converted, d) _check_error() return result if result != _ffi.NULL else None -def temporal_set_interp(temp: "const Temporal *", interp: "interpType") -> "Temporal *": +def tfloat_minus_value( + temp: Annotated[_ffi.CData, "const Temporal *"], d: float +) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - interp_converted = _ffi.cast("interpType", interp) - result = _lib.temporal_set_interp(temp_converted, interp_converted) + result = _lib.tfloat_minus_value(temp_converted, d) _check_error() return result if result != _ffi.NULL else None -def temporal_shift_scale_time( - temp: "const Temporal *", - shift: "Optional['const Interval *']", - duration: "Optional['const Interval *']", -) -> "Temporal *": +def tint_at_value(temp: Annotated[_ffi.CData, "const Temporal *"], i: int) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - shift_converted = ( - _ffi.cast("const Interval *", shift) if shift is not None else _ffi.NULL - ) - duration_converted = ( - _ffi.cast("const Interval *", duration) if duration is not None else _ffi.NULL - ) - result = _lib.temporal_shift_scale_time( - temp_converted, shift_converted, duration_converted - ) + result = _lib.tint_at_value(temp_converted, i) _check_error() return result if result != _ffi.NULL else None -def temporal_shift_time( - temp: "const Temporal *", shift: "const Interval *" -) -> "Temporal *": +def tint_minus_value(temp: Annotated[_ffi.CData, "const Temporal *"], i: int) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - shift_converted = _ffi.cast("const Interval *", shift) - result = _lib.temporal_shift_time(temp_converted, shift_converted) + result = _lib.tint_minus_value(temp_converted, i) _check_error() return result if result != _ffi.NULL else None -def temporal_to_tinstant(temp: "const Temporal *") -> "TInstant *": +def tnumber_at_span( + temp: Annotated[_ffi.CData, "const Temporal *"], span: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.temporal_to_tinstant(temp_converted) + span_converted = _ffi.cast("const Span *", span) + result = _lib.tnumber_at_span(temp_converted, span_converted) _check_error() return result if result != _ffi.NULL else None -def temporal_to_tsequence(temp: "const Temporal *", interp_str: str) -> "TSequence *": +def tnumber_at_spanset( + temp: Annotated[_ffi.CData, "const Temporal *"], ss: Annotated[_ffi.CData, "const SpanSet *"] +) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - interp_str_converted = interp_str.encode("utf-8") - result = _lib.temporal_to_tsequence(temp_converted, interp_str_converted) + ss_converted = _ffi.cast("const SpanSet *", ss) + result = _lib.tnumber_at_spanset(temp_converted, ss_converted) _check_error() return result if result != _ffi.NULL else None -def temporal_to_tsequenceset( - temp: "const Temporal *", interp_str: str -) -> "TSequenceSet *": +def tnumber_at_tbox( + temp: Annotated[_ffi.CData, "const Temporal *"], box: Annotated[_ffi.CData, "const TBox *"] +) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - interp_str_converted = interp_str.encode("utf-8") - result = _lib.temporal_to_tsequenceset(temp_converted, interp_str_converted) + box_converted = _ffi.cast("const TBox *", box) + result = _lib.tnumber_at_tbox(temp_converted, box_converted) _check_error() return result if result != _ffi.NULL else None -def tfloat_floor(temp: "const Temporal *") -> "Temporal *": +def tnumber_minus_span( + temp: Annotated[_ffi.CData, "const Temporal *"], span: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tfloat_floor(temp_converted) + span_converted = _ffi.cast("const Span *", span) + result = _lib.tnumber_minus_span(temp_converted, span_converted) _check_error() return result if result != _ffi.NULL else None -def tfloat_ceil(temp: "const Temporal *") -> "Temporal *": +def tnumber_minus_spanset( + temp: Annotated[_ffi.CData, "const Temporal *"], ss: Annotated[_ffi.CData, "const SpanSet *"] +) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tfloat_ceil(temp_converted) + ss_converted = _ffi.cast("const SpanSet *", ss) + result = _lib.tnumber_minus_spanset(temp_converted, ss_converted) _check_error() return result if result != _ffi.NULL else None -def tfloat_degrees(temp: "const Temporal *", normalize: bool) -> "Temporal *": +def tnumber_minus_tbox( + temp: Annotated[_ffi.CData, "const Temporal *"], box: Annotated[_ffi.CData, "const TBox *"] +) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tfloat_degrees(temp_converted, normalize) + box_converted = _ffi.cast("const TBox *", box) + result = _lib.tnumber_minus_tbox(temp_converted, box_converted) _check_error() return result if result != _ffi.NULL else None -def tfloat_radians(temp: "const Temporal *") -> "Temporal *": +def ttext_at_value(temp: Annotated[_ffi.CData, "const Temporal *"], txt: str) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tfloat_radians(temp_converted) + txt_converted = cstring2text(txt) + result = _lib.ttext_at_value(temp_converted, txt_converted) _check_error() return result if result != _ffi.NULL else None -def tfloat_round(temp: "const Temporal *", maxdd: int) -> "Temporal *": +def ttext_minus_value(temp: Annotated[_ffi.CData, "const Temporal *"], txt: str) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tfloat_round(temp_converted, maxdd) + txt_converted = cstring2text(txt) + result = _lib.ttext_minus_value(temp_converted, txt_converted) _check_error() return result if result != _ffi.NULL else None -def tfloat_scale_value(temp: "const Temporal *", width: float) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tfloat_scale_value(temp_converted, width) +def temporal_cmp( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[int, "int"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.temporal_cmp(temp1_converted, temp2_converted) _check_error() return result if result != _ffi.NULL else None -def tfloat_shift_scale_value( - temp: "const Temporal *", shift: float, width: float -) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tfloat_shift_scale_value(temp_converted, shift, width) +def temporal_eq( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.temporal_eq(temp1_converted, temp2_converted) _check_error() return result if result != _ffi.NULL else None -def tfloat_shift_value(temp: "const Temporal *", shift: float) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tfloat_shift_value(temp_converted, shift) +def temporal_ge( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.temporal_ge(temp1_converted, temp2_converted) _check_error() return result if result != _ffi.NULL else None -def tfloatarr_round(temp: "const Temporal **", count: int, maxdd: int) -> "Temporal **": - temp_converted = [_ffi.cast("const Temporal *", x) for x in temp] - result = _lib.tfloatarr_round(temp_converted, count, maxdd) +def temporal_gt( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.temporal_gt(temp1_converted, temp2_converted) _check_error() return result if result != _ffi.NULL else None -def tint_scale_value(temp: "const Temporal *", width: int) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tint_scale_value(temp_converted, width) +def temporal_le( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.temporal_le(temp1_converted, temp2_converted) _check_error() return result if result != _ffi.NULL else None -def tint_shift_scale_value( - temp: "const Temporal *", shift: int, width: int -) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tint_shift_scale_value(temp_converted, shift, width) +def temporal_lt( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.temporal_lt(temp1_converted, temp2_converted) _check_error() return result if result != _ffi.NULL else None -def tint_shift_value(temp: "const Temporal *", shift: int) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tint_shift_value(temp_converted, shift) +def temporal_ne( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.temporal_ne(temp1_converted, temp2_converted) _check_error() return result if result != _ffi.NULL else None -def tpoint_round(temp: "const Temporal *", maxdd: int) -> "Temporal *": +def always_eq_bool_tbool(b: bool, temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[int, "int"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tpoint_round(temp_converted, maxdd) + result = _lib.always_eq_bool_tbool(b, temp_converted) _check_error() return result if result != _ffi.NULL else None -def tpoint_transform(temp: "const Temporal *", srid: int) -> "Temporal *": +def always_eq_float_tfloat(d: float, temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[int, "int"]: temp_converted = _ffi.cast("const Temporal *", temp) - srid_converted = _ffi.cast("int32", srid) - result = _lib.tpoint_transform(temp_converted, srid_converted) + result = _lib.always_eq_float_tfloat(d, temp_converted) _check_error() return result if result != _ffi.NULL else None -def tpoint_transform_pipeline( - temp: "const Temporal *", pipelinestr: str, srid: int, is_forward: bool -) -> "Temporal *": +def always_eq_int_tint(i: int, temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[int, "int"]: temp_converted = _ffi.cast("const Temporal *", temp) - pipelinestr_converted = pipelinestr.encode("utf-8") - srid_converted = _ffi.cast("int32", srid) - result = _lib.tpoint_transform_pipeline( - temp_converted, pipelinestr_converted, srid_converted, is_forward - ) + result = _lib.always_eq_int_tint(i, temp_converted) _check_error() return result if result != _ffi.NULL else None -def tpoint_transform_pj( - temp: "const Temporal *", srid: int, pj: "const LWPROJ *" -) -> "Temporal *": +def always_eq_tbool_bool(temp: Annotated[_ffi.CData, "const Temporal *"], b: bool) -> Annotated[int, "int"]: temp_converted = _ffi.cast("const Temporal *", temp) - srid_converted = _ffi.cast("int32", srid) - pj_converted = _ffi.cast("const LWPROJ *", pj) - result = _lib.tpoint_transform_pj(temp_converted, srid_converted, pj_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def lwproj_transform(srid_from: int, srid_to: int) -> "LWPROJ *": - srid_from_converted = _ffi.cast("int32", srid_from) - srid_to_converted = _ffi.cast("int32", srid_to) - result = _lib.lwproj_transform(srid_from_converted, srid_to_converted) + result = _lib.always_eq_tbool_bool(temp_converted, b) _check_error() return result if result != _ffi.NULL else None -def tpointarr_round(temp: "const Temporal **", count: int, maxdd: int) -> "Temporal **": - temp_converted = [_ffi.cast("const Temporal *", x) for x in temp] - result = _lib.tpointarr_round(temp_converted, count, maxdd) +def always_eq_temporal_temporal( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[int, "int"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.always_eq_temporal_temporal(temp1_converted, temp2_converted) _check_error() return result if result != _ffi.NULL else None -def temporal_append_tinstant( - temp: "Temporal *", - inst: "const TInstant *", - maxdist: float, - maxt: "Optional['const Interval *']", - expand: bool, -) -> "Temporal *": - temp_converted = _ffi.cast("Temporal *", temp) - inst_converted = _ffi.cast("const TInstant *", inst) - maxt_converted = ( - _ffi.cast("const Interval *", maxt) if maxt is not None else _ffi.NULL - ) - result = _lib.temporal_append_tinstant( - temp_converted, inst_converted, maxdist, maxt_converted, expand - ) +def always_eq_text_ttext(txt: str, temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[int, "int"]: + txt_converted = cstring2text(txt) + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.always_eq_text_ttext(txt_converted, temp_converted) _check_error() return result if result != _ffi.NULL else None -def temporal_append_tsequence( - temp: "Temporal *", seq: "const TSequence *", expand: bool -) -> "Temporal *": - temp_converted = _ffi.cast("Temporal *", temp) - seq_converted = _ffi.cast("const TSequence *", seq) - result = _lib.temporal_append_tsequence(temp_converted, seq_converted, expand) +def always_eq_tfloat_float(temp: Annotated[_ffi.CData, "const Temporal *"], d: float) -> Annotated[int, "int"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.always_eq_tfloat_float(temp_converted, d) _check_error() return result if result != _ffi.NULL else None -def temporal_delete_tstzspan( - temp: "const Temporal *", s: "const Span *", connect: bool -) -> "Temporal *": +def always_eq_tint_int(temp: Annotated[_ffi.CData, "const Temporal *"], i: int) -> Annotated[int, "int"]: temp_converted = _ffi.cast("const Temporal *", temp) - s_converted = _ffi.cast("const Span *", s) - result = _lib.temporal_delete_tstzspan(temp_converted, s_converted, connect) + result = _lib.always_eq_tint_int(temp_converted, i) _check_error() return result if result != _ffi.NULL else None -def temporal_delete_tstzspanset( - temp: "const Temporal *", ss: "const SpanSet *", connect: bool -) -> "Temporal *": +def always_eq_ttext_text(temp: Annotated[_ffi.CData, "const Temporal *"], txt: str) -> Annotated[int, "int"]: temp_converted = _ffi.cast("const Temporal *", temp) - ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.temporal_delete_tstzspanset(temp_converted, ss_converted, connect) + txt_converted = cstring2text(txt) + result = _lib.always_eq_ttext_text(temp_converted, txt_converted) _check_error() return result if result != _ffi.NULL else None -def temporal_delete_timestamptz( - temp: "const Temporal *", t: int, connect: bool -) -> "Temporal *": +def always_ge_float_tfloat(d: float, temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[int, "int"]: temp_converted = _ffi.cast("const Temporal *", temp) - t_converted = _ffi.cast("TimestampTz", t) - result = _lib.temporal_delete_timestamptz(temp_converted, t_converted, connect) + result = _lib.always_ge_float_tfloat(d, temp_converted) _check_error() return result if result != _ffi.NULL else None -def temporal_delete_tstzset( - temp: "const Temporal *", s: "const Set *", connect: bool -) -> "Temporal *": +def always_ge_int_tint(i: int, temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[int, "int"]: temp_converted = _ffi.cast("const Temporal *", temp) - s_converted = _ffi.cast("const Set *", s) - result = _lib.temporal_delete_tstzset(temp_converted, s_converted, connect) + result = _lib.always_ge_int_tint(i, temp_converted) _check_error() return result if result != _ffi.NULL else None -def temporal_insert( - temp1: "const Temporal *", temp2: "const Temporal *", connect: bool -) -> "Temporal *": +def always_ge_temporal_temporal( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[int, "int"]: temp1_converted = _ffi.cast("const Temporal *", temp1) temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.temporal_insert(temp1_converted, temp2_converted, connect) + result = _lib.always_ge_temporal_temporal(temp1_converted, temp2_converted) _check_error() return result if result != _ffi.NULL else None -def temporal_merge( - temp1: "const Temporal *", temp2: "const Temporal *" -) -> "Temporal *": - temp1_converted = _ffi.cast("const Temporal *", temp1) - temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.temporal_merge(temp1_converted, temp2_converted) +def always_ge_text_ttext(txt: str, temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[int, "int"]: + txt_converted = cstring2text(txt) + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.always_ge_text_ttext(txt_converted, temp_converted) _check_error() return result if result != _ffi.NULL else None -def temporal_merge_array(temparr: "const Temporal **", count: int) -> "Temporal *": - temparr_converted = [_ffi.cast("const Temporal *", x) for x in temparr] - result = _lib.temporal_merge_array(temparr_converted, count) +def always_ge_tfloat_float(temp: Annotated[_ffi.CData, "const Temporal *"], d: float) -> Annotated[int, "int"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.always_ge_tfloat_float(temp_converted, d) _check_error() return result if result != _ffi.NULL else None -def temporal_update( - temp1: "const Temporal *", temp2: "const Temporal *", connect: bool -) -> "Temporal *": - temp1_converted = _ffi.cast("const Temporal *", temp1) - temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.temporal_update(temp1_converted, temp2_converted, connect) +def always_ge_tint_int(temp: Annotated[_ffi.CData, "const Temporal *"], i: int) -> Annotated[int, "int"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.always_ge_tint_int(temp_converted, i) _check_error() return result if result != _ffi.NULL else None -def tbool_at_value(temp: "const Temporal *", b: bool) -> "Temporal *": +def always_ge_ttext_text(temp: Annotated[_ffi.CData, "const Temporal *"], txt: str) -> Annotated[int, "int"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tbool_at_value(temp_converted, b) + txt_converted = cstring2text(txt) + result = _lib.always_ge_ttext_text(temp_converted, txt_converted) _check_error() return result if result != _ffi.NULL else None -def tbool_minus_value(temp: "const Temporal *", b: bool) -> "Temporal *": +def always_gt_float_tfloat(d: float, temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[int, "int"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tbool_minus_value(temp_converted, b) + result = _lib.always_gt_float_tfloat(d, temp_converted) _check_error() return result if result != _ffi.NULL else None -def temporal_at_max(temp: "const Temporal *") -> "Temporal *": +def always_gt_int_tint(i: int, temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[int, "int"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.temporal_at_max(temp_converted) + result = _lib.always_gt_int_tint(i, temp_converted) _check_error() return result if result != _ffi.NULL else None -def temporal_at_min(temp: "const Temporal *") -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.temporal_at_min(temp_converted) +def always_gt_temporal_temporal( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[int, "int"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.always_gt_temporal_temporal(temp1_converted, temp2_converted) _check_error() return result if result != _ffi.NULL else None -def temporal_at_tstzspan(temp: "const Temporal *", s: "const Span *") -> "Temporal *": +def always_gt_text_ttext(txt: str, temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[int, "int"]: + txt_converted = cstring2text(txt) temp_converted = _ffi.cast("const Temporal *", temp) - s_converted = _ffi.cast("const Span *", s) - result = _lib.temporal_at_tstzspan(temp_converted, s_converted) + result = _lib.always_gt_text_ttext(txt_converted, temp_converted) _check_error() return result if result != _ffi.NULL else None -def temporal_at_tstzspanset( - temp: "const Temporal *", ss: "const SpanSet *" -) -> "Temporal *": +def always_gt_tfloat_float(temp: Annotated[_ffi.CData, "const Temporal *"], d: float) -> Annotated[int, "int"]: temp_converted = _ffi.cast("const Temporal *", temp) - ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.temporal_at_tstzspanset(temp_converted, ss_converted) + result = _lib.always_gt_tfloat_float(temp_converted, d) _check_error() return result if result != _ffi.NULL else None -def temporal_at_timestamptz(temp: "const Temporal *", t: int) -> "Temporal *": +def always_gt_tint_int(temp: Annotated[_ffi.CData, "const Temporal *"], i: int) -> Annotated[int, "int"]: temp_converted = _ffi.cast("const Temporal *", temp) - t_converted = _ffi.cast("TimestampTz", t) - result = _lib.temporal_at_timestamptz(temp_converted, t_converted) + result = _lib.always_gt_tint_int(temp_converted, i) _check_error() return result if result != _ffi.NULL else None -def temporal_at_tstzset(temp: "const Temporal *", s: "const Set *") -> "Temporal *": +def always_gt_ttext_text(temp: Annotated[_ffi.CData, "const Temporal *"], txt: str) -> Annotated[int, "int"]: temp_converted = _ffi.cast("const Temporal *", temp) - s_converted = _ffi.cast("const Set *", s) - result = _lib.temporal_at_tstzset(temp_converted, s_converted) + txt_converted = cstring2text(txt) + result = _lib.always_gt_ttext_text(temp_converted, txt_converted) _check_error() return result if result != _ffi.NULL else None -def temporal_at_values(temp: "const Temporal *", set: "const Set *") -> "Temporal *": +def always_le_float_tfloat(d: float, temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[int, "int"]: temp_converted = _ffi.cast("const Temporal *", temp) - set_converted = _ffi.cast("const Set *", set) - result = _lib.temporal_at_values(temp_converted, set_converted) + result = _lib.always_le_float_tfloat(d, temp_converted) _check_error() return result if result != _ffi.NULL else None -def temporal_minus_max(temp: "const Temporal *") -> "Temporal *": +def always_le_int_tint(i: int, temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[int, "int"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.temporal_minus_max(temp_converted) + result = _lib.always_le_int_tint(i, temp_converted) _check_error() return result if result != _ffi.NULL else None -def temporal_minus_min(temp: "const Temporal *") -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.temporal_minus_min(temp_converted) +def always_le_temporal_temporal( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[int, "int"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.always_le_temporal_temporal(temp1_converted, temp2_converted) _check_error() return result if result != _ffi.NULL else None -def temporal_minus_tstzspan( - temp: "const Temporal *", s: "const Span *" -) -> "Temporal *": +def always_le_text_ttext(txt: str, temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[int, "int"]: + txt_converted = cstring2text(txt) temp_converted = _ffi.cast("const Temporal *", temp) - s_converted = _ffi.cast("const Span *", s) - result = _lib.temporal_minus_tstzspan(temp_converted, s_converted) + result = _lib.always_le_text_ttext(txt_converted, temp_converted) _check_error() return result if result != _ffi.NULL else None -def temporal_minus_tstzspanset( - temp: "const Temporal *", ss: "const SpanSet *" -) -> "Temporal *": +def always_le_tfloat_float(temp: Annotated[_ffi.CData, "const Temporal *"], d: float) -> Annotated[int, "int"]: temp_converted = _ffi.cast("const Temporal *", temp) - ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.temporal_minus_tstzspanset(temp_converted, ss_converted) + result = _lib.always_le_tfloat_float(temp_converted, d) _check_error() return result if result != _ffi.NULL else None -def temporal_minus_timestamptz(temp: "const Temporal *", t: int) -> "Temporal *": +def always_le_tint_int(temp: Annotated[_ffi.CData, "const Temporal *"], i: int) -> Annotated[int, "int"]: temp_converted = _ffi.cast("const Temporal *", temp) - t_converted = _ffi.cast("TimestampTz", t) - result = _lib.temporal_minus_timestamptz(temp_converted, t_converted) + result = _lib.always_le_tint_int(temp_converted, i) _check_error() return result if result != _ffi.NULL else None -def temporal_minus_tstzset(temp: "const Temporal *", s: "const Set *") -> "Temporal *": +def always_le_ttext_text(temp: Annotated[_ffi.CData, "const Temporal *"], txt: str) -> Annotated[int, "int"]: temp_converted = _ffi.cast("const Temporal *", temp) - s_converted = _ffi.cast("const Set *", s) - result = _lib.temporal_minus_tstzset(temp_converted, s_converted) + txt_converted = cstring2text(txt) + result = _lib.always_le_ttext_text(temp_converted, txt_converted) _check_error() return result if result != _ffi.NULL else None -def temporal_minus_values(temp: "const Temporal *", set: "const Set *") -> "Temporal *": +def always_lt_float_tfloat(d: float, temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[int, "int"]: temp_converted = _ffi.cast("const Temporal *", temp) - set_converted = _ffi.cast("const Set *", set) - result = _lib.temporal_minus_values(temp_converted, set_converted) + result = _lib.always_lt_float_tfloat(d, temp_converted) _check_error() return result if result != _ffi.NULL else None -def tfloat_at_value(temp: "const Temporal *", d: float) -> "Temporal *": +def always_lt_int_tint(i: int, temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[int, "int"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tfloat_at_value(temp_converted, d) + result = _lib.always_lt_int_tint(i, temp_converted) _check_error() return result if result != _ffi.NULL else None -def tfloat_minus_value(temp: "const Temporal *", d: float) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tfloat_minus_value(temp_converted, d) +def always_lt_temporal_temporal( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[int, "int"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.always_lt_temporal_temporal(temp1_converted, temp2_converted) _check_error() return result if result != _ffi.NULL else None -def tint_at_value(temp: "const Temporal *", i: int) -> "Temporal *": +def always_lt_text_ttext(txt: str, temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[int, "int"]: + txt_converted = cstring2text(txt) temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tint_at_value(temp_converted, i) + result = _lib.always_lt_text_ttext(txt_converted, temp_converted) _check_error() return result if result != _ffi.NULL else None -def tint_minus_value(temp: "const Temporal *", i: int) -> "Temporal *": +def always_lt_tfloat_float(temp: Annotated[_ffi.CData, "const Temporal *"], d: float) -> Annotated[int, "int"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tint_minus_value(temp_converted, i) + result = _lib.always_lt_tfloat_float(temp_converted, d) _check_error() return result if result != _ffi.NULL else None -def tnumber_at_span(temp: "const Temporal *", span: "const Span *") -> "Temporal *": +def always_lt_tint_int(temp: Annotated[_ffi.CData, "const Temporal *"], i: int) -> Annotated[int, "int"]: temp_converted = _ffi.cast("const Temporal *", temp) - span_converted = _ffi.cast("const Span *", span) - result = _lib.tnumber_at_span(temp_converted, span_converted) + result = _lib.always_lt_tint_int(temp_converted, i) _check_error() return result if result != _ffi.NULL else None -def tnumber_at_spanset(temp: "const Temporal *", ss: "const SpanSet *") -> "Temporal *": +def always_lt_ttext_text(temp: Annotated[_ffi.CData, "const Temporal *"], txt: str) -> Annotated[int, "int"]: temp_converted = _ffi.cast("const Temporal *", temp) - ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.tnumber_at_spanset(temp_converted, ss_converted) + txt_converted = cstring2text(txt) + result = _lib.always_lt_ttext_text(temp_converted, txt_converted) _check_error() return result if result != _ffi.NULL else None -def tnumber_at_tbox(temp: "const Temporal *", box: "const TBox *") -> "Temporal *": +def always_ne_bool_tbool(b: bool, temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[int, "int"]: temp_converted = _ffi.cast("const Temporal *", temp) - box_converted = _ffi.cast("const TBox *", box) - result = _lib.tnumber_at_tbox(temp_converted, box_converted) + result = _lib.always_ne_bool_tbool(b, temp_converted) _check_error() return result if result != _ffi.NULL else None -def tnumber_minus_span(temp: "const Temporal *", span: "const Span *") -> "Temporal *": +def always_ne_float_tfloat(d: float, temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[int, "int"]: temp_converted = _ffi.cast("const Temporal *", temp) - span_converted = _ffi.cast("const Span *", span) - result = _lib.tnumber_minus_span(temp_converted, span_converted) + result = _lib.always_ne_float_tfloat(d, temp_converted) _check_error() return result if result != _ffi.NULL else None -def tnumber_minus_spanset( - temp: "const Temporal *", ss: "const SpanSet *" -) -> "Temporal *": +def always_ne_int_tint(i: int, temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[int, "int"]: temp_converted = _ffi.cast("const Temporal *", temp) - ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.tnumber_minus_spanset(temp_converted, ss_converted) + result = _lib.always_ne_int_tint(i, temp_converted) _check_error() return result if result != _ffi.NULL else None -def tnumber_minus_tbox(temp: "const Temporal *", box: "const TBox *") -> "Temporal *": +def always_ne_tbool_bool(temp: Annotated[_ffi.CData, "const Temporal *"], b: bool) -> Annotated[int, "int"]: temp_converted = _ffi.cast("const Temporal *", temp) - box_converted = _ffi.cast("const TBox *", box) - result = _lib.tnumber_minus_tbox(temp_converted, box_converted) + result = _lib.always_ne_tbool_bool(temp_converted, b) _check_error() return result if result != _ffi.NULL else None -def tpoint_at_geom( - temp: "const Temporal *", gs: "const GSERIALIZED *", zspan: "const Span *" -) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - gs_converted = _ffi.cast("const GSERIALIZED *", gs) - zspan_converted = _ffi.cast("const Span *", zspan) - result = _lib.tpoint_at_geom(temp_converted, gs_converted, zspan_converted) +def always_ne_temporal_temporal( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[int, "int"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.always_ne_temporal_temporal(temp1_converted, temp2_converted) _check_error() return result if result != _ffi.NULL else None -def tpoint_at_stbox( - temp: "const Temporal *", box: "const STBox *", border_inc: bool -) -> "Temporal *": +def always_ne_text_ttext(txt: str, temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[int, "int"]: + txt_converted = cstring2text(txt) temp_converted = _ffi.cast("const Temporal *", temp) - box_converted = _ffi.cast("const STBox *", box) - result = _lib.tpoint_at_stbox(temp_converted, box_converted, border_inc) + result = _lib.always_ne_text_ttext(txt_converted, temp_converted) _check_error() return result if result != _ffi.NULL else None -def tpoint_at_value(temp: "const Temporal *", gs: "GSERIALIZED *") -> "Temporal *": +def always_ne_tfloat_float(temp: Annotated[_ffi.CData, "const Temporal *"], d: float) -> Annotated[int, "int"]: temp_converted = _ffi.cast("const Temporal *", temp) - gs_converted = _ffi.cast("GSERIALIZED *", gs) - result = _lib.tpoint_at_value(temp_converted, gs_converted) + result = _lib.always_ne_tfloat_float(temp_converted, d) _check_error() return result if result != _ffi.NULL else None -def tpoint_minus_geom( - temp: "const Temporal *", gs: "const GSERIALIZED *", zspan: "const Span *" -) -> "Temporal *": +def always_ne_tint_int(temp: Annotated[_ffi.CData, "const Temporal *"], i: int) -> Annotated[int, "int"]: temp_converted = _ffi.cast("const Temporal *", temp) - gs_converted = _ffi.cast("const GSERIALIZED *", gs) - zspan_converted = _ffi.cast("const Span *", zspan) - result = _lib.tpoint_minus_geom(temp_converted, gs_converted, zspan_converted) + result = _lib.always_ne_tint_int(temp_converted, i) _check_error() return result if result != _ffi.NULL else None -def tpoint_minus_stbox( - temp: "const Temporal *", box: "const STBox *", border_inc: bool -) -> "Temporal *": +def always_ne_ttext_text(temp: Annotated[_ffi.CData, "const Temporal *"], txt: str) -> Annotated[int, "int"]: temp_converted = _ffi.cast("const Temporal *", temp) - box_converted = _ffi.cast("const STBox *", box) - result = _lib.tpoint_minus_stbox(temp_converted, box_converted, border_inc) + txt_converted = cstring2text(txt) + result = _lib.always_ne_ttext_text(temp_converted, txt_converted) _check_error() return result if result != _ffi.NULL else None -def tpoint_minus_value(temp: "const Temporal *", gs: "GSERIALIZED *") -> "Temporal *": +def ever_eq_bool_tbool(b: bool, temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[int, "int"]: temp_converted = _ffi.cast("const Temporal *", temp) - gs_converted = _ffi.cast("GSERIALIZED *", gs) - result = _lib.tpoint_minus_value(temp_converted, gs_converted) + result = _lib.ever_eq_bool_tbool(b, temp_converted) _check_error() return result if result != _ffi.NULL else None -def ttext_at_value(temp: "const Temporal *", txt: str) -> "Temporal *": +def ever_eq_float_tfloat(d: float, temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[int, "int"]: temp_converted = _ffi.cast("const Temporal *", temp) - txt_converted = cstring2text(txt) - result = _lib.ttext_at_value(temp_converted, txt_converted) + result = _lib.ever_eq_float_tfloat(d, temp_converted) _check_error() return result if result != _ffi.NULL else None -def ttext_minus_value(temp: "const Temporal *", txt: str) -> "Temporal *": +def ever_eq_int_tint(i: int, temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[int, "int"]: temp_converted = _ffi.cast("const Temporal *", temp) - txt_converted = cstring2text(txt) - result = _lib.ttext_minus_value(temp_converted, txt_converted) + result = _lib.ever_eq_int_tint(i, temp_converted) _check_error() return result if result != _ffi.NULL else None -def temporal_cmp(temp1: "const Temporal *", temp2: "const Temporal *") -> "int": - temp1_converted = _ffi.cast("const Temporal *", temp1) - temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.temporal_cmp(temp1_converted, temp2_converted) +def ever_eq_tbool_bool(temp: Annotated[_ffi.CData, "const Temporal *"], b: bool) -> Annotated[int, "int"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.ever_eq_tbool_bool(temp_converted, b) _check_error() return result if result != _ffi.NULL else None -def temporal_eq(temp1: "const Temporal *", temp2: "const Temporal *") -> "bool": +def ever_eq_temporal_temporal( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[int, "int"]: temp1_converted = _ffi.cast("const Temporal *", temp1) temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.temporal_eq(temp1_converted, temp2_converted) + result = _lib.ever_eq_temporal_temporal(temp1_converted, temp2_converted) _check_error() return result if result != _ffi.NULL else None -def temporal_ge(temp1: "const Temporal *", temp2: "const Temporal *") -> "bool": - temp1_converted = _ffi.cast("const Temporal *", temp1) - temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.temporal_ge(temp1_converted, temp2_converted) +def ever_eq_text_ttext(txt: str, temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[int, "int"]: + txt_converted = cstring2text(txt) + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.ever_eq_text_ttext(txt_converted, temp_converted) _check_error() return result if result != _ffi.NULL else None -def temporal_gt(temp1: "const Temporal *", temp2: "const Temporal *") -> "bool": - temp1_converted = _ffi.cast("const Temporal *", temp1) - temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.temporal_gt(temp1_converted, temp2_converted) +def ever_eq_tfloat_float(temp: Annotated[_ffi.CData, "const Temporal *"], d: float) -> Annotated[int, "int"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.ever_eq_tfloat_float(temp_converted, d) _check_error() return result if result != _ffi.NULL else None -def temporal_le(temp1: "const Temporal *", temp2: "const Temporal *") -> "bool": - temp1_converted = _ffi.cast("const Temporal *", temp1) - temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.temporal_le(temp1_converted, temp2_converted) +def ever_eq_tint_int(temp: Annotated[_ffi.CData, "const Temporal *"], i: int) -> Annotated[int, "int"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.ever_eq_tint_int(temp_converted, i) _check_error() return result if result != _ffi.NULL else None -def temporal_lt(temp1: "const Temporal *", temp2: "const Temporal *") -> "bool": - temp1_converted = _ffi.cast("const Temporal *", temp1) - temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.temporal_lt(temp1_converted, temp2_converted) +def ever_eq_ttext_text(temp: Annotated[_ffi.CData, "const Temporal *"], txt: str) -> Annotated[int, "int"]: + temp_converted = _ffi.cast("const Temporal *", temp) + txt_converted = cstring2text(txt) + result = _lib.ever_eq_ttext_text(temp_converted, txt_converted) _check_error() return result if result != _ffi.NULL else None -def temporal_ne(temp1: "const Temporal *", temp2: "const Temporal *") -> "bool": - temp1_converted = _ffi.cast("const Temporal *", temp1) +def ever_ge_float_tfloat(d: float, temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[int, "int"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.ever_ge_float_tfloat(d, temp_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def ever_ge_int_tint(i: int, temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[int, "int"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.ever_ge_int_tint(i, temp_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def ever_ge_temporal_temporal( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[int, "int"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.temporal_ne(temp1_converted, temp2_converted) + result = _lib.ever_ge_temporal_temporal(temp1_converted, temp2_converted) _check_error() return result if result != _ffi.NULL else None -def always_eq_bool_tbool(b: bool, temp: "const Temporal *") -> "int": +def ever_ge_text_ttext(txt: str, temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[int, "int"]: + txt_converted = cstring2text(txt) temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.always_eq_bool_tbool(b, temp_converted) + result = _lib.ever_ge_text_ttext(txt_converted, temp_converted) _check_error() return result if result != _ffi.NULL else None -def always_eq_float_tfloat(d: float, temp: "const Temporal *") -> "int": +def ever_ge_tfloat_float(temp: Annotated[_ffi.CData, "const Temporal *"], d: float) -> Annotated[int, "int"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.always_eq_float_tfloat(d, temp_converted) + result = _lib.ever_ge_tfloat_float(temp_converted, d) _check_error() return result if result != _ffi.NULL else None -def always_eq_int_tint(i: int, temp: "const Temporal *") -> "int": +def ever_ge_tint_int(temp: Annotated[_ffi.CData, "const Temporal *"], i: int) -> Annotated[int, "int"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.always_eq_int_tint(i, temp_converted) + result = _lib.ever_ge_tint_int(temp_converted, i) _check_error() return result if result != _ffi.NULL else None -def always_eq_point_tpoint( - gs: "const GSERIALIZED *", temp: "const Temporal *" -) -> "int": - gs_converted = _ffi.cast("const GSERIALIZED *", gs) +def ever_ge_ttext_text(temp: Annotated[_ffi.CData, "const Temporal *"], txt: str) -> Annotated[int, "int"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.always_eq_point_tpoint(gs_converted, temp_converted) + txt_converted = cstring2text(txt) + result = _lib.ever_ge_ttext_text(temp_converted, txt_converted) _check_error() return result if result != _ffi.NULL else None -def always_eq_tbool_bool(temp: "const Temporal *", b: bool) -> "int": +def ever_gt_float_tfloat(d: float, temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[int, "int"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.always_eq_tbool_bool(temp_converted, b) + result = _lib.ever_gt_float_tfloat(d, temp_converted) _check_error() return result if result != _ffi.NULL else None -def always_eq_temporal_temporal( - temp1: "const Temporal *", temp2: "const Temporal *" -) -> "int": +def ever_gt_int_tint(i: int, temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[int, "int"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.ever_gt_int_tint(i, temp_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def ever_gt_temporal_temporal( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[int, "int"]: temp1_converted = _ffi.cast("const Temporal *", temp1) temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.always_eq_temporal_temporal(temp1_converted, temp2_converted) + result = _lib.ever_gt_temporal_temporal(temp1_converted, temp2_converted) _check_error() return result if result != _ffi.NULL else None -def always_eq_text_ttext(txt: str, temp: "const Temporal *") -> "int": +def ever_gt_text_ttext(txt: str, temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[int, "int"]: txt_converted = cstring2text(txt) temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.always_eq_text_ttext(txt_converted, temp_converted) + result = _lib.ever_gt_text_ttext(txt_converted, temp_converted) _check_error() return result if result != _ffi.NULL else None -def always_eq_tfloat_float(temp: "const Temporal *", d: float) -> "int": +def ever_gt_tfloat_float(temp: Annotated[_ffi.CData, "const Temporal *"], d: float) -> Annotated[int, "int"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.always_eq_tfloat_float(temp_converted, d) + result = _lib.ever_gt_tfloat_float(temp_converted, d) _check_error() return result if result != _ffi.NULL else None -def always_eq_tint_int(temp: "const Temporal *", i: int) -> "int": +def ever_gt_tint_int(temp: Annotated[_ffi.CData, "const Temporal *"], i: int) -> Annotated[int, "int"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.always_eq_tint_int(temp_converted, i) + result = _lib.ever_gt_tint_int(temp_converted, i) _check_error() return result if result != _ffi.NULL else None -def always_eq_tpoint_point( - temp: "const Temporal *", gs: "const GSERIALIZED *" -) -> "int": +def ever_gt_ttext_text(temp: Annotated[_ffi.CData, "const Temporal *"], txt: str) -> Annotated[int, "int"]: temp_converted = _ffi.cast("const Temporal *", temp) - gs_converted = _ffi.cast("const GSERIALIZED *", gs) - result = _lib.always_eq_tpoint_point(temp_converted, gs_converted) + txt_converted = cstring2text(txt) + result = _lib.ever_gt_ttext_text(temp_converted, txt_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def ever_le_float_tfloat(d: float, temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[int, "int"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.ever_le_float_tfloat(d, temp_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def ever_le_int_tint(i: int, temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[int, "int"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.ever_le_int_tint(i, temp_converted) _check_error() return result if result != _ffi.NULL else None -def always_eq_tpoint_tpoint( - temp1: "const Temporal *", temp2: "const Temporal *" -) -> "int": +def ever_le_temporal_temporal( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[int, "int"]: temp1_converted = _ffi.cast("const Temporal *", temp1) temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.always_eq_tpoint_tpoint(temp1_converted, temp2_converted) + result = _lib.ever_le_temporal_temporal(temp1_converted, temp2_converted) _check_error() return result if result != _ffi.NULL else None -def always_eq_ttext_text(temp: "const Temporal *", txt: str) -> "int": - temp_converted = _ffi.cast("const Temporal *", temp) +def ever_le_text_ttext(txt: str, temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[int, "int"]: txt_converted = cstring2text(txt) - result = _lib.always_eq_ttext_text(temp_converted, txt_converted) + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.ever_le_text_ttext(txt_converted, temp_converted) _check_error() return result if result != _ffi.NULL else None -def always_ne_bool_tbool(b: bool, temp: "const Temporal *") -> "int": +def ever_le_tfloat_float(temp: Annotated[_ffi.CData, "const Temporal *"], d: float) -> Annotated[int, "int"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.always_ne_bool_tbool(b, temp_converted) + result = _lib.ever_le_tfloat_float(temp_converted, d) _check_error() return result if result != _ffi.NULL else None -def always_ne_float_tfloat(d: float, temp: "const Temporal *") -> "int": +def ever_le_tint_int(temp: Annotated[_ffi.CData, "const Temporal *"], i: int) -> Annotated[int, "int"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.always_ne_float_tfloat(d, temp_converted) + result = _lib.ever_le_tint_int(temp_converted, i) _check_error() return result if result != _ffi.NULL else None -def always_ne_int_tint(i: int, temp: "const Temporal *") -> "int": +def ever_le_ttext_text(temp: Annotated[_ffi.CData, "const Temporal *"], txt: str) -> Annotated[int, "int"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.always_ne_int_tint(i, temp_converted) + txt_converted = cstring2text(txt) + result = _lib.ever_le_ttext_text(temp_converted, txt_converted) _check_error() return result if result != _ffi.NULL else None -def always_ne_point_tpoint( - gs: "const GSERIALIZED *", temp: "const Temporal *" -) -> "int": - gs_converted = _ffi.cast("const GSERIALIZED *", gs) +def ever_lt_float_tfloat(d: float, temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[int, "int"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.always_ne_point_tpoint(gs_converted, temp_converted) + result = _lib.ever_lt_float_tfloat(d, temp_converted) _check_error() return result if result != _ffi.NULL else None -def always_ne_tbool_bool(temp: "const Temporal *", b: bool) -> "int": +def ever_lt_int_tint(i: int, temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[int, "int"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.always_ne_tbool_bool(temp_converted, b) + result = _lib.ever_lt_int_tint(i, temp_converted) _check_error() return result if result != _ffi.NULL else None -def always_ne_temporal_temporal( - temp1: "const Temporal *", temp2: "const Temporal *" -) -> "int": +def ever_lt_temporal_temporal( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[int, "int"]: temp1_converted = _ffi.cast("const Temporal *", temp1) temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.always_ne_temporal_temporal(temp1_converted, temp2_converted) + result = _lib.ever_lt_temporal_temporal(temp1_converted, temp2_converted) _check_error() return result if result != _ffi.NULL else None -def always_ne_text_ttext(txt: str, temp: "const Temporal *") -> "int": +def ever_lt_text_ttext(txt: str, temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[int, "int"]: txt_converted = cstring2text(txt) temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.always_ne_text_ttext(txt_converted, temp_converted) + result = _lib.ever_lt_text_ttext(txt_converted, temp_converted) _check_error() return result if result != _ffi.NULL else None -def always_ne_tfloat_float(temp: "const Temporal *", d: float) -> "int": +def ever_lt_tfloat_float(temp: Annotated[_ffi.CData, "const Temporal *"], d: float) -> Annotated[int, "int"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.always_ne_tfloat_float(temp_converted, d) + result = _lib.ever_lt_tfloat_float(temp_converted, d) _check_error() return result if result != _ffi.NULL else None -def always_ne_tint_int(temp: "const Temporal *", i: int) -> "int": +def ever_lt_tint_int(temp: Annotated[_ffi.CData, "const Temporal *"], i: int) -> Annotated[int, "int"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.always_ne_tint_int(temp_converted, i) + result = _lib.ever_lt_tint_int(temp_converted, i) _check_error() return result if result != _ffi.NULL else None -def always_ne_tpoint_point( - temp: "const Temporal *", gs: "const GSERIALIZED *" -) -> "int": +def ever_lt_ttext_text(temp: Annotated[_ffi.CData, "const Temporal *"], txt: str) -> Annotated[int, "int"]: temp_converted = _ffi.cast("const Temporal *", temp) - gs_converted = _ffi.cast("const GSERIALIZED *", gs) - result = _lib.always_ne_tpoint_point(temp_converted, gs_converted) + txt_converted = cstring2text(txt) + result = _lib.ever_lt_ttext_text(temp_converted, txt_converted) _check_error() return result if result != _ffi.NULL else None -def always_ne_tpoint_tpoint( - temp1: "const Temporal *", temp2: "const Temporal *" -) -> "int": - temp1_converted = _ffi.cast("const Temporal *", temp1) - temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.always_ne_tpoint_tpoint(temp1_converted, temp2_converted) +def ever_ne_bool_tbool(b: bool, temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[int, "int"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.ever_ne_bool_tbool(b, temp_converted) _check_error() return result if result != _ffi.NULL else None -def always_ne_ttext_text(temp: "const Temporal *", txt: str) -> "int": +def ever_ne_float_tfloat(d: float, temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[int, "int"]: temp_converted = _ffi.cast("const Temporal *", temp) - txt_converted = cstring2text(txt) - result = _lib.always_ne_ttext_text(temp_converted, txt_converted) + result = _lib.ever_ne_float_tfloat(d, temp_converted) _check_error() return result if result != _ffi.NULL else None -def always_ge_float_tfloat(d: float, temp: "const Temporal *") -> "int": +def ever_ne_int_tint(i: int, temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[int, "int"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.always_ge_float_tfloat(d, temp_converted) + result = _lib.ever_ne_int_tint(i, temp_converted) _check_error() return result if result != _ffi.NULL else None -def always_ge_int_tint(i: int, temp: "const Temporal *") -> "int": +def ever_ne_tbool_bool(temp: Annotated[_ffi.CData, "const Temporal *"], b: bool) -> Annotated[int, "int"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.always_ge_int_tint(i, temp_converted) + result = _lib.ever_ne_tbool_bool(temp_converted, b) _check_error() return result if result != _ffi.NULL else None -def always_ge_temporal_temporal( - temp1: "const Temporal *", temp2: "const Temporal *" -) -> "int": +def ever_ne_temporal_temporal( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[int, "int"]: temp1_converted = _ffi.cast("const Temporal *", temp1) temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.always_ge_temporal_temporal(temp1_converted, temp2_converted) + result = _lib.ever_ne_temporal_temporal(temp1_converted, temp2_converted) _check_error() return result if result != _ffi.NULL else None -def always_ge_text_ttext(txt: str, temp: "const Temporal *") -> "int": +def ever_ne_text_ttext(txt: str, temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[int, "int"]: txt_converted = cstring2text(txt) temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.always_ge_text_ttext(txt_converted, temp_converted) + result = _lib.ever_ne_text_ttext(txt_converted, temp_converted) _check_error() return result if result != _ffi.NULL else None -def always_ge_tfloat_float(temp: "const Temporal *", d: float) -> "int": +def ever_ne_tfloat_float(temp: Annotated[_ffi.CData, "const Temporal *"], d: float) -> Annotated[int, "int"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.always_ge_tfloat_float(temp_converted, d) + result = _lib.ever_ne_tfloat_float(temp_converted, d) _check_error() return result if result != _ffi.NULL else None -def always_ge_tint_int(temp: "const Temporal *", i: int) -> "int": +def ever_ne_tint_int(temp: Annotated[_ffi.CData, "const Temporal *"], i: int) -> Annotated[int, "int"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.always_ge_tint_int(temp_converted, i) + result = _lib.ever_ne_tint_int(temp_converted, i) _check_error() return result if result != _ffi.NULL else None -def always_ge_ttext_text(temp: "const Temporal *", txt: str) -> "int": +def ever_ne_ttext_text(temp: Annotated[_ffi.CData, "const Temporal *"], txt: str) -> Annotated[int, "int"]: temp_converted = _ffi.cast("const Temporal *", temp) txt_converted = cstring2text(txt) - result = _lib.always_ge_ttext_text(temp_converted, txt_converted) + result = _lib.ever_ne_ttext_text(temp_converted, txt_converted) _check_error() return result if result != _ffi.NULL else None -def always_gt_float_tfloat(d: float, temp: "const Temporal *") -> "int": +def teq_bool_tbool(b: bool, temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.always_gt_float_tfloat(d, temp_converted) + result = _lib.teq_bool_tbool(b, temp_converted) _check_error() return result if result != _ffi.NULL else None -def always_gt_int_tint(i: int, temp: "const Temporal *") -> "int": +def teq_float_tfloat(d: float, temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.always_gt_int_tint(i, temp_converted) + result = _lib.teq_float_tfloat(d, temp_converted) _check_error() return result if result != _ffi.NULL else None -def always_gt_temporal_temporal( - temp1: "const Temporal *", temp2: "const Temporal *" -) -> "int": +def teq_int_tint(i: int, temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "Temporal *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.teq_int_tint(i, temp_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def teq_tbool_bool(temp: Annotated[_ffi.CData, "const Temporal *"], b: bool) -> Annotated[_ffi.CData, "Temporal *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.teq_tbool_bool(temp_converted, b) + _check_error() + return result if result != _ffi.NULL else None + + +def teq_temporal_temporal( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[_ffi.CData, "Temporal *"]: temp1_converted = _ffi.cast("const Temporal *", temp1) temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.always_gt_temporal_temporal(temp1_converted, temp2_converted) + result = _lib.teq_temporal_temporal(temp1_converted, temp2_converted) _check_error() return result if result != _ffi.NULL else None -def always_gt_text_ttext(txt: str, temp: "const Temporal *") -> "int": +def teq_text_ttext(txt: str, temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "Temporal *"]: txt_converted = cstring2text(txt) temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.always_gt_text_ttext(txt_converted, temp_converted) + result = _lib.teq_text_ttext(txt_converted, temp_converted) _check_error() return result if result != _ffi.NULL else None -def always_gt_tfloat_float(temp: "const Temporal *", d: float) -> "int": +def teq_tfloat_float(temp: Annotated[_ffi.CData, "const Temporal *"], d: float) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.always_gt_tfloat_float(temp_converted, d) + result = _lib.teq_tfloat_float(temp_converted, d) _check_error() return result if result != _ffi.NULL else None -def always_gt_tint_int(temp: "const Temporal *", i: int) -> "int": +def teq_tint_int(temp: Annotated[_ffi.CData, "const Temporal *"], i: int) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.always_gt_tint_int(temp_converted, i) + result = _lib.teq_tint_int(temp_converted, i) _check_error() return result if result != _ffi.NULL else None -def always_gt_ttext_text(temp: "const Temporal *", txt: str) -> "int": +def teq_ttext_text(temp: Annotated[_ffi.CData, "const Temporal *"], txt: str) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) txt_converted = cstring2text(txt) - result = _lib.always_gt_ttext_text(temp_converted, txt_converted) + result = _lib.teq_ttext_text(temp_converted, txt_converted) _check_error() return result if result != _ffi.NULL else None -def always_le_float_tfloat(d: float, temp: "const Temporal *") -> "int": +def tge_float_tfloat(d: float, temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.always_le_float_tfloat(d, temp_converted) + result = _lib.tge_float_tfloat(d, temp_converted) _check_error() return result if result != _ffi.NULL else None -def always_le_int_tint(i: int, temp: "const Temporal *") -> "int": +def tge_int_tint(i: int, temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.always_le_int_tint(i, temp_converted) + result = _lib.tge_int_tint(i, temp_converted) _check_error() return result if result != _ffi.NULL else None -def always_le_temporal_temporal( - temp1: "const Temporal *", temp2: "const Temporal *" -) -> "int": +def tge_temporal_temporal( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[_ffi.CData, "Temporal *"]: temp1_converted = _ffi.cast("const Temporal *", temp1) temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.always_le_temporal_temporal(temp1_converted, temp2_converted) + result = _lib.tge_temporal_temporal(temp1_converted, temp2_converted) _check_error() return result if result != _ffi.NULL else None -def always_le_text_ttext(txt: str, temp: "const Temporal *") -> "int": +def tge_text_ttext(txt: str, temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "Temporal *"]: txt_converted = cstring2text(txt) temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.always_le_text_ttext(txt_converted, temp_converted) + result = _lib.tge_text_ttext(txt_converted, temp_converted) _check_error() return result if result != _ffi.NULL else None -def always_le_tfloat_float(temp: "const Temporal *", d: float) -> "int": +def tge_tfloat_float(temp: Annotated[_ffi.CData, "const Temporal *"], d: float) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.always_le_tfloat_float(temp_converted, d) + result = _lib.tge_tfloat_float(temp_converted, d) _check_error() return result if result != _ffi.NULL else None -def always_le_tint_int(temp: "const Temporal *", i: int) -> "int": +def tge_tint_int(temp: Annotated[_ffi.CData, "const Temporal *"], i: int) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.always_le_tint_int(temp_converted, i) + result = _lib.tge_tint_int(temp_converted, i) _check_error() return result if result != _ffi.NULL else None -def always_le_ttext_text(temp: "const Temporal *", txt: str) -> "int": +def tge_ttext_text(temp: Annotated[_ffi.CData, "const Temporal *"], txt: str) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) txt_converted = cstring2text(txt) - result = _lib.always_le_ttext_text(temp_converted, txt_converted) + result = _lib.tge_ttext_text(temp_converted, txt_converted) _check_error() return result if result != _ffi.NULL else None -def always_lt_float_tfloat(d: float, temp: "const Temporal *") -> "int": +def tgt_float_tfloat(d: float, temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.always_lt_float_tfloat(d, temp_converted) + result = _lib.tgt_float_tfloat(d, temp_converted) _check_error() return result if result != _ffi.NULL else None -def always_lt_int_tint(i: int, temp: "const Temporal *") -> "int": +def tgt_int_tint(i: int, temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.always_lt_int_tint(i, temp_converted) + result = _lib.tgt_int_tint(i, temp_converted) _check_error() return result if result != _ffi.NULL else None -def always_lt_temporal_temporal( - temp1: "const Temporal *", temp2: "const Temporal *" -) -> "int": +def tgt_temporal_temporal( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[_ffi.CData, "Temporal *"]: temp1_converted = _ffi.cast("const Temporal *", temp1) temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.always_lt_temporal_temporal(temp1_converted, temp2_converted) + result = _lib.tgt_temporal_temporal(temp1_converted, temp2_converted) _check_error() return result if result != _ffi.NULL else None -def always_lt_text_ttext(txt: str, temp: "const Temporal *") -> "int": +def tgt_text_ttext(txt: str, temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "Temporal *"]: txt_converted = cstring2text(txt) temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.always_lt_text_ttext(txt_converted, temp_converted) + result = _lib.tgt_text_ttext(txt_converted, temp_converted) _check_error() return result if result != _ffi.NULL else None -def always_lt_tfloat_float(temp: "const Temporal *", d: float) -> "int": +def tgt_tfloat_float(temp: Annotated[_ffi.CData, "const Temporal *"], d: float) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.always_lt_tfloat_float(temp_converted, d) + result = _lib.tgt_tfloat_float(temp_converted, d) _check_error() return result if result != _ffi.NULL else None -def always_lt_tint_int(temp: "const Temporal *", i: int) -> "int": +def tgt_tint_int(temp: Annotated[_ffi.CData, "const Temporal *"], i: int) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.always_lt_tint_int(temp_converted, i) + result = _lib.tgt_tint_int(temp_converted, i) _check_error() return result if result != _ffi.NULL else None -def always_lt_ttext_text(temp: "const Temporal *", txt: str) -> "int": +def tgt_ttext_text(temp: Annotated[_ffi.CData, "const Temporal *"], txt: str) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) txt_converted = cstring2text(txt) - result = _lib.always_lt_ttext_text(temp_converted, txt_converted) + result = _lib.tgt_ttext_text(temp_converted, txt_converted) _check_error() return result if result != _ffi.NULL else None -def ever_eq_bool_tbool(b: bool, temp: "const Temporal *") -> "int": +def tle_float_tfloat(d: float, temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.ever_eq_bool_tbool(b, temp_converted) + result = _lib.tle_float_tfloat(d, temp_converted) _check_error() return result if result != _ffi.NULL else None -def ever_eq_float_tfloat(d: float, temp: "const Temporal *") -> "int": +def tle_int_tint(i: int, temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.ever_eq_float_tfloat(d, temp_converted) + result = _lib.tle_int_tint(i, temp_converted) _check_error() return result if result != _ffi.NULL else None -def ever_eq_int_tint(i: int, temp: "const Temporal *") -> "int": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.ever_eq_int_tint(i, temp_converted) +def tle_temporal_temporal( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[_ffi.CData, "Temporal *"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.tle_temporal_temporal(temp1_converted, temp2_converted) _check_error() return result if result != _ffi.NULL else None -def ever_eq_point_tpoint(gs: "const GSERIALIZED *", temp: "const Temporal *") -> "int": - gs_converted = _ffi.cast("const GSERIALIZED *", gs) +def tle_text_ttext(txt: str, temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "Temporal *"]: + txt_converted = cstring2text(txt) temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.ever_eq_point_tpoint(gs_converted, temp_converted) + result = _lib.tle_text_ttext(txt_converted, temp_converted) _check_error() return result if result != _ffi.NULL else None -def ever_eq_tbool_bool(temp: "const Temporal *", b: bool) -> "int": +def tle_tfloat_float(temp: Annotated[_ffi.CData, "const Temporal *"], d: float) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.ever_eq_tbool_bool(temp_converted, b) - _check_error() - return result if result != _ffi.NULL else None - - -def ever_eq_temporal_temporal( - temp1: "const Temporal *", temp2: "const Temporal *" -) -> "int": - temp1_converted = _ffi.cast("const Temporal *", temp1) - temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.ever_eq_temporal_temporal(temp1_converted, temp2_converted) + result = _lib.tle_tfloat_float(temp_converted, d) _check_error() return result if result != _ffi.NULL else None -def ever_eq_text_ttext(txt: str, temp: "const Temporal *") -> "int": - txt_converted = cstring2text(txt) +def tle_tint_int(temp: Annotated[_ffi.CData, "const Temporal *"], i: int) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.ever_eq_text_ttext(txt_converted, temp_converted) + result = _lib.tle_tint_int(temp_converted, i) _check_error() return result if result != _ffi.NULL else None -def ever_eq_tfloat_float(temp: "const Temporal *", d: float) -> "int": +def tle_ttext_text(temp: Annotated[_ffi.CData, "const Temporal *"], txt: str) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.ever_eq_tfloat_float(temp_converted, d) + txt_converted = cstring2text(txt) + result = _lib.tle_ttext_text(temp_converted, txt_converted) _check_error() return result if result != _ffi.NULL else None -def ever_eq_tint_int(temp: "const Temporal *", i: int) -> "int": +def tlt_float_tfloat(d: float, temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.ever_eq_tint_int(temp_converted, i) + result = _lib.tlt_float_tfloat(d, temp_converted) _check_error() return result if result != _ffi.NULL else None -def ever_eq_tpoint_point(temp: "const Temporal *", gs: "const GSERIALIZED *") -> "int": +def tlt_int_tint(i: int, temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - gs_converted = _ffi.cast("const GSERIALIZED *", gs) - result = _lib.ever_eq_tpoint_point(temp_converted, gs_converted) + result = _lib.tlt_int_tint(i, temp_converted) _check_error() return result if result != _ffi.NULL else None -def ever_eq_tpoint_tpoint( - temp1: "const Temporal *", temp2: "const Temporal *" -) -> "int": +def tlt_temporal_temporal( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[_ffi.CData, "Temporal *"]: temp1_converted = _ffi.cast("const Temporal *", temp1) temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.ever_eq_tpoint_tpoint(temp1_converted, temp2_converted) + result = _lib.tlt_temporal_temporal(temp1_converted, temp2_converted) _check_error() return result if result != _ffi.NULL else None -def ever_eq_ttext_text(temp: "const Temporal *", txt: str) -> "int": - temp_converted = _ffi.cast("const Temporal *", temp) +def tlt_text_ttext(txt: str, temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "Temporal *"]: txt_converted = cstring2text(txt) - result = _lib.ever_eq_ttext_text(temp_converted, txt_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def ever_ge_float_tfloat(d: float, temp: "const Temporal *") -> "int": temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.ever_ge_float_tfloat(d, temp_converted) + result = _lib.tlt_text_ttext(txt_converted, temp_converted) _check_error() return result if result != _ffi.NULL else None -def ever_ge_int_tint(i: int, temp: "const Temporal *") -> "int": +def tlt_tfloat_float(temp: Annotated[_ffi.CData, "const Temporal *"], d: float) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.ever_ge_int_tint(i, temp_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def ever_ge_temporal_temporal( - temp1: "const Temporal *", temp2: "const Temporal *" -) -> "int": - temp1_converted = _ffi.cast("const Temporal *", temp1) - temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.ever_ge_temporal_temporal(temp1_converted, temp2_converted) + result = _lib.tlt_tfloat_float(temp_converted, d) _check_error() return result if result != _ffi.NULL else None -def ever_ge_text_ttext(txt: str, temp: "const Temporal *") -> "int": - txt_converted = cstring2text(txt) +def tlt_tint_int(temp: Annotated[_ffi.CData, "const Temporal *"], i: int) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.ever_ge_text_ttext(txt_converted, temp_converted) + result = _lib.tlt_tint_int(temp_converted, i) _check_error() return result if result != _ffi.NULL else None -def ever_ge_tfloat_float(temp: "const Temporal *", d: float) -> "int": +def tlt_ttext_text(temp: Annotated[_ffi.CData, "const Temporal *"], txt: str) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.ever_ge_tfloat_float(temp_converted, d) + txt_converted = cstring2text(txt) + result = _lib.tlt_ttext_text(temp_converted, txt_converted) _check_error() return result if result != _ffi.NULL else None -def ever_ge_tint_int(temp: "const Temporal *", i: int) -> "int": +def tne_bool_tbool(b: bool, temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.ever_ge_tint_int(temp_converted, i) + result = _lib.tne_bool_tbool(b, temp_converted) _check_error() return result if result != _ffi.NULL else None -def ever_ge_ttext_text(temp: "const Temporal *", txt: str) -> "int": +def tne_float_tfloat(d: float, temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - txt_converted = cstring2text(txt) - result = _lib.ever_ge_ttext_text(temp_converted, txt_converted) + result = _lib.tne_float_tfloat(d, temp_converted) _check_error() return result if result != _ffi.NULL else None -def ever_gt_float_tfloat(d: float, temp: "const Temporal *") -> "int": +def tne_int_tint(i: int, temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.ever_gt_float_tfloat(d, temp_converted) + result = _lib.tne_int_tint(i, temp_converted) _check_error() return result if result != _ffi.NULL else None -def ever_gt_int_tint(i: int, temp: "const Temporal *") -> "int": +def tne_tbool_bool(temp: Annotated[_ffi.CData, "const Temporal *"], b: bool) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.ever_gt_int_tint(i, temp_converted) + result = _lib.tne_tbool_bool(temp_converted, b) _check_error() return result if result != _ffi.NULL else None -def ever_gt_temporal_temporal( - temp1: "const Temporal *", temp2: "const Temporal *" -) -> "int": +def tne_temporal_temporal( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[_ffi.CData, "Temporal *"]: temp1_converted = _ffi.cast("const Temporal *", temp1) temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.ever_gt_temporal_temporal(temp1_converted, temp2_converted) + result = _lib.tne_temporal_temporal(temp1_converted, temp2_converted) _check_error() return result if result != _ffi.NULL else None -def ever_gt_text_ttext(txt: str, temp: "const Temporal *") -> "int": +def tne_text_ttext(txt: str, temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "Temporal *"]: txt_converted = cstring2text(txt) temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.ever_gt_text_ttext(txt_converted, temp_converted) + result = _lib.tne_text_ttext(txt_converted, temp_converted) _check_error() return result if result != _ffi.NULL else None -def ever_gt_tfloat_float(temp: "const Temporal *", d: float) -> "int": +def tne_tfloat_float(temp: Annotated[_ffi.CData, "const Temporal *"], d: float) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.ever_gt_tfloat_float(temp_converted, d) + result = _lib.tne_tfloat_float(temp_converted, d) _check_error() return result if result != _ffi.NULL else None -def ever_gt_tint_int(temp: "const Temporal *", i: int) -> "int": +def tne_tint_int(temp: Annotated[_ffi.CData, "const Temporal *"], i: int) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.ever_gt_tint_int(temp_converted, i) + result = _lib.tne_tint_int(temp_converted, i) _check_error() return result if result != _ffi.NULL else None -def ever_gt_ttext_text(temp: "const Temporal *", txt: str) -> "int": +def tne_ttext_text(temp: Annotated[_ffi.CData, "const Temporal *"], txt: str) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) txt_converted = cstring2text(txt) - result = _lib.ever_gt_ttext_text(temp_converted, txt_converted) + result = _lib.tne_ttext_text(temp_converted, txt_converted) _check_error() return result if result != _ffi.NULL else None -def ever_le_float_tfloat(d: float, temp: "const Temporal *") -> "int": +def temporal_spans( + temp: Annotated[_ffi.CData, "const Temporal *"], count: Annotated[_ffi.CData, "int *"] +) -> Annotated[_ffi.CData, "Span *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.ever_le_float_tfloat(d, temp_converted) + count_converted = _ffi.cast("int *", count) + result = _lib.temporal_spans(temp_converted, count_converted) _check_error() return result if result != _ffi.NULL else None -def ever_le_int_tint(i: int, temp: "const Temporal *") -> "int": +def temporal_split_each_n_spans( + temp: Annotated[_ffi.CData, "const Temporal *"], elem_count: int, count: Annotated[_ffi.CData, "int *"] +) -> Annotated[_ffi.CData, "Span *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.ever_le_int_tint(i, temp_converted) + count_converted = _ffi.cast("int *", count) + result = _lib.temporal_split_each_n_spans(temp_converted, elem_count, count_converted) _check_error() return result if result != _ffi.NULL else None -def ever_le_temporal_temporal( - temp1: "const Temporal *", temp2: "const Temporal *" -) -> "int": - temp1_converted = _ffi.cast("const Temporal *", temp1) - temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.ever_le_temporal_temporal(temp1_converted, temp2_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def ever_le_text_ttext(txt: str, temp: "const Temporal *") -> "int": - txt_converted = cstring2text(txt) +def temporal_split_n_spans( + temp: Annotated[_ffi.CData, "const Temporal *"], span_count: int, count: Annotated[_ffi.CData, "int *"] +) -> Annotated[_ffi.CData, "Span *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.ever_le_text_ttext(txt_converted, temp_converted) + count_converted = _ffi.cast("int *", count) + result = _lib.temporal_split_n_spans(temp_converted, span_count, count_converted) _check_error() return result if result != _ffi.NULL else None -def ever_le_tfloat_float(temp: "const Temporal *", d: float) -> "int": +def tnumber_split_each_n_tboxes( + temp: Annotated[_ffi.CData, "const Temporal *"], elem_count: int, count: Annotated[_ffi.CData, "int *"] +) -> Annotated[_ffi.CData, "TBox *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.ever_le_tfloat_float(temp_converted, d) + count_converted = _ffi.cast("int *", count) + result = _lib.tnumber_split_each_n_tboxes(temp_converted, elem_count, count_converted) _check_error() return result if result != _ffi.NULL else None -def ever_le_tint_int(temp: "const Temporal *", i: int) -> "int": +def tnumber_split_n_tboxes( + temp: Annotated[_ffi.CData, "const Temporal *"], box_count: int, count: Annotated[_ffi.CData, "int *"] +) -> Annotated[_ffi.CData, "TBox *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.ever_le_tint_int(temp_converted, i) + count_converted = _ffi.cast("int *", count) + result = _lib.tnumber_split_n_tboxes(temp_converted, box_count, count_converted) _check_error() return result if result != _ffi.NULL else None -def ever_le_ttext_text(temp: "const Temporal *", txt: str) -> "int": +def tnumber_tboxes( + temp: Annotated[_ffi.CData, "const Temporal *"], count: Annotated[_ffi.CData, "int *"] +) -> Annotated[_ffi.CData, "TBox *"]: temp_converted = _ffi.cast("const Temporal *", temp) - txt_converted = cstring2text(txt) - result = _lib.ever_le_ttext_text(temp_converted, txt_converted) + count_converted = _ffi.cast("int *", count) + result = _lib.tnumber_tboxes(temp_converted, count_converted) _check_error() return result if result != _ffi.NULL else None -def ever_lt_float_tfloat(d: float, temp: "const Temporal *") -> "int": +def adjacent_numspan_tnumber( + s: Annotated[_ffi.CData, "const Span *"], temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + s_converted = _ffi.cast("const Span *", s) temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.ever_lt_float_tfloat(d, temp_converted) + result = _lib.adjacent_numspan_tnumber(s_converted, temp_converted) _check_error() return result if result != _ffi.NULL else None -def ever_lt_int_tint(i: int, temp: "const Temporal *") -> "int": +def adjacent_tbox_tnumber( + box: Annotated[_ffi.CData, "const TBox *"], temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + box_converted = _ffi.cast("const TBox *", box) temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.ever_lt_int_tint(i, temp_converted) + result = _lib.adjacent_tbox_tnumber(box_converted, temp_converted) _check_error() return result if result != _ffi.NULL else None -def ever_lt_temporal_temporal( - temp1: "const Temporal *", temp2: "const Temporal *" -) -> "int": +def adjacent_temporal_temporal( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: temp1_converted = _ffi.cast("const Temporal *", temp1) temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.ever_lt_temporal_temporal(temp1_converted, temp2_converted) + result = _lib.adjacent_temporal_temporal(temp1_converted, temp2_converted) _check_error() return result if result != _ffi.NULL else None -def ever_lt_text_ttext(txt: str, temp: "const Temporal *") -> "int": - txt_converted = cstring2text(txt) +def adjacent_temporal_tstzspan( + temp: Annotated[_ffi.CData, "const Temporal *"], s: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[bool, "bool"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.ever_lt_text_ttext(txt_converted, temp_converted) + s_converted = _ffi.cast("const Span *", s) + result = _lib.adjacent_temporal_tstzspan(temp_converted, s_converted) _check_error() return result if result != _ffi.NULL else None -def ever_lt_tfloat_float(temp: "const Temporal *", d: float) -> "int": +def adjacent_tnumber_numspan( + temp: Annotated[_ffi.CData, "const Temporal *"], s: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[bool, "bool"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.ever_lt_tfloat_float(temp_converted, d) + s_converted = _ffi.cast("const Span *", s) + result = _lib.adjacent_tnumber_numspan(temp_converted, s_converted) _check_error() return result if result != _ffi.NULL else None -def ever_lt_tint_int(temp: "const Temporal *", i: int) -> "int": +def adjacent_tnumber_tbox( + temp: Annotated[_ffi.CData, "const Temporal *"], box: Annotated[_ffi.CData, "const TBox *"] +) -> Annotated[bool, "bool"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.ever_lt_tint_int(temp_converted, i) + box_converted = _ffi.cast("const TBox *", box) + result = _lib.adjacent_tnumber_tbox(temp_converted, box_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def adjacent_tnumber_tnumber( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.adjacent_tnumber_tnumber(temp1_converted, temp2_converted) _check_error() return result if result != _ffi.NULL else None -def ever_lt_ttext_text(temp: "const Temporal *", txt: str) -> "int": +def adjacent_tstzspan_temporal( + s: Annotated[_ffi.CData, "const Span *"], temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + s_converted = _ffi.cast("const Span *", s) temp_converted = _ffi.cast("const Temporal *", temp) - txt_converted = cstring2text(txt) - result = _lib.ever_lt_ttext_text(temp_converted, txt_converted) + result = _lib.adjacent_tstzspan_temporal(s_converted, temp_converted) _check_error() return result if result != _ffi.NULL else None -def ever_ne_bool_tbool(b: bool, temp: "const Temporal *") -> "int": +def contained_numspan_tnumber( + s: Annotated[_ffi.CData, "const Span *"], temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + s_converted = _ffi.cast("const Span *", s) temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.ever_ne_bool_tbool(b, temp_converted) + result = _lib.contained_numspan_tnumber(s_converted, temp_converted) _check_error() return result if result != _ffi.NULL else None -def ever_ne_float_tfloat(d: float, temp: "const Temporal *") -> "int": +def contained_tbox_tnumber( + box: Annotated[_ffi.CData, "const TBox *"], temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + box_converted = _ffi.cast("const TBox *", box) temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.ever_ne_float_tfloat(d, temp_converted) + result = _lib.contained_tbox_tnumber(box_converted, temp_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def contained_temporal_temporal( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.contained_temporal_temporal(temp1_converted, temp2_converted) _check_error() return result if result != _ffi.NULL else None -def ever_ne_int_tint(i: int, temp: "const Temporal *") -> "int": +def contained_temporal_tstzspan( + temp: Annotated[_ffi.CData, "const Temporal *"], s: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[bool, "bool"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.ever_ne_int_tint(i, temp_converted) + s_converted = _ffi.cast("const Span *", s) + result = _lib.contained_temporal_tstzspan(temp_converted, s_converted) _check_error() return result if result != _ffi.NULL else None -def ever_ne_point_tpoint(gs: "const GSERIALIZED *", temp: "const Temporal *") -> "int": - gs_converted = _ffi.cast("const GSERIALIZED *", gs) +def contained_tnumber_numspan( + temp: Annotated[_ffi.CData, "const Temporal *"], s: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[bool, "bool"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.ever_ne_point_tpoint(gs_converted, temp_converted) + s_converted = _ffi.cast("const Span *", s) + result = _lib.contained_tnumber_numspan(temp_converted, s_converted) _check_error() return result if result != _ffi.NULL else None -def ever_ne_tbool_bool(temp: "const Temporal *", b: bool) -> "int": +def contained_tnumber_tbox( + temp: Annotated[_ffi.CData, "const Temporal *"], box: Annotated[_ffi.CData, "const TBox *"] +) -> Annotated[bool, "bool"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.ever_ne_tbool_bool(temp_converted, b) + box_converted = _ffi.cast("const TBox *", box) + result = _lib.contained_tnumber_tbox(temp_converted, box_converted) _check_error() return result if result != _ffi.NULL else None -def ever_ne_temporal_temporal( - temp1: "const Temporal *", temp2: "const Temporal *" -) -> "int": +def contained_tnumber_tnumber( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: temp1_converted = _ffi.cast("const Temporal *", temp1) temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.ever_ne_temporal_temporal(temp1_converted, temp2_converted) + result = _lib.contained_tnumber_tnumber(temp1_converted, temp2_converted) _check_error() return result if result != _ffi.NULL else None -def ever_ne_text_ttext(txt: str, temp: "const Temporal *") -> "int": - txt_converted = cstring2text(txt) +def contained_tstzspan_temporal( + s: Annotated[_ffi.CData, "const Span *"], temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + s_converted = _ffi.cast("const Span *", s) temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.ever_ne_text_ttext(txt_converted, temp_converted) + result = _lib.contained_tstzspan_temporal(s_converted, temp_converted) _check_error() return result if result != _ffi.NULL else None -def ever_ne_tfloat_float(temp: "const Temporal *", d: float) -> "int": +def contains_numspan_tnumber( + s: Annotated[_ffi.CData, "const Span *"], temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + s_converted = _ffi.cast("const Span *", s) temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.ever_ne_tfloat_float(temp_converted, d) + result = _lib.contains_numspan_tnumber(s_converted, temp_converted) _check_error() return result if result != _ffi.NULL else None -def ever_ne_tint_int(temp: "const Temporal *", i: int) -> "int": +def contains_tbox_tnumber( + box: Annotated[_ffi.CData, "const TBox *"], temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + box_converted = _ffi.cast("const TBox *", box) temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.ever_ne_tint_int(temp_converted, i) + result = _lib.contains_tbox_tnumber(box_converted, temp_converted) _check_error() return result if result != _ffi.NULL else None -def ever_ne_tpoint_point(temp: "const Temporal *", gs: "const GSERIALIZED *") -> "int": +def contains_temporal_tstzspan( + temp: Annotated[_ffi.CData, "const Temporal *"], s: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[bool, "bool"]: temp_converted = _ffi.cast("const Temporal *", temp) - gs_converted = _ffi.cast("const GSERIALIZED *", gs) - result = _lib.ever_ne_tpoint_point(temp_converted, gs_converted) + s_converted = _ffi.cast("const Span *", s) + result = _lib.contains_temporal_tstzspan(temp_converted, s_converted) _check_error() return result if result != _ffi.NULL else None -def ever_ne_tpoint_tpoint( - temp1: "const Temporal *", temp2: "const Temporal *" -) -> "int": +def contains_temporal_temporal( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: temp1_converted = _ffi.cast("const Temporal *", temp1) temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.ever_ne_tpoint_tpoint(temp1_converted, temp2_converted) + result = _lib.contains_temporal_temporal(temp1_converted, temp2_converted) _check_error() return result if result != _ffi.NULL else None -def ever_ne_ttext_text(temp: "const Temporal *", txt: str) -> "int": +def contains_tnumber_numspan( + temp: Annotated[_ffi.CData, "const Temporal *"], s: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[bool, "bool"]: temp_converted = _ffi.cast("const Temporal *", temp) - txt_converted = cstring2text(txt) - result = _lib.ever_ne_ttext_text(temp_converted, txt_converted) + s_converted = _ffi.cast("const Span *", s) + result = _lib.contains_tnumber_numspan(temp_converted, s_converted) _check_error() return result if result != _ffi.NULL else None -def teq_bool_tbool(b: bool, temp: "const Temporal *") -> "Temporal *": +def contains_tnumber_tbox( + temp: Annotated[_ffi.CData, "const Temporal *"], box: Annotated[_ffi.CData, "const TBox *"] +) -> Annotated[bool, "bool"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.teq_bool_tbool(b, temp_converted) + box_converted = _ffi.cast("const TBox *", box) + result = _lib.contains_tnumber_tbox(temp_converted, box_converted) _check_error() return result if result != _ffi.NULL else None -def teq_float_tfloat(d: float, temp: "const Temporal *") -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.teq_float_tfloat(d, temp_converted) +def contains_tnumber_tnumber( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.contains_tnumber_tnumber(temp1_converted, temp2_converted) _check_error() return result if result != _ffi.NULL else None -def teq_int_tint(i: int, temp: "const Temporal *") -> "Temporal *": +def contains_tstzspan_temporal( + s: Annotated[_ffi.CData, "const Span *"], temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + s_converted = _ffi.cast("const Span *", s) temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.teq_int_tint(i, temp_converted) + result = _lib.contains_tstzspan_temporal(s_converted, temp_converted) _check_error() return result if result != _ffi.NULL else None -def teq_point_tpoint( - gs: "const GSERIALIZED *", temp: "const Temporal *" -) -> "Temporal *": - gs_converted = _ffi.cast("const GSERIALIZED *", gs) +def overlaps_numspan_tnumber( + s: Annotated[_ffi.CData, "const Span *"], temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + s_converted = _ffi.cast("const Span *", s) temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.teq_point_tpoint(gs_converted, temp_converted) + result = _lib.overlaps_numspan_tnumber(s_converted, temp_converted) _check_error() return result if result != _ffi.NULL else None -def teq_tbool_bool(temp: "const Temporal *", b: bool) -> "Temporal *": +def overlaps_tbox_tnumber( + box: Annotated[_ffi.CData, "const TBox *"], temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + box_converted = _ffi.cast("const TBox *", box) temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.teq_tbool_bool(temp_converted, b) + result = _lib.overlaps_tbox_tnumber(box_converted, temp_converted) _check_error() return result if result != _ffi.NULL else None -def teq_temporal_temporal( - temp1: "const Temporal *", temp2: "const Temporal *" -) -> "Temporal *": +def overlaps_temporal_temporal( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: temp1_converted = _ffi.cast("const Temporal *", temp1) temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.teq_temporal_temporal(temp1_converted, temp2_converted) + result = _lib.overlaps_temporal_temporal(temp1_converted, temp2_converted) _check_error() return result if result != _ffi.NULL else None -def teq_text_ttext(txt: str, temp: "const Temporal *") -> "Temporal *": - txt_converted = cstring2text(txt) +def overlaps_temporal_tstzspan( + temp: Annotated[_ffi.CData, "const Temporal *"], s: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[bool, "bool"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.teq_text_ttext(txt_converted, temp_converted) + s_converted = _ffi.cast("const Span *", s) + result = _lib.overlaps_temporal_tstzspan(temp_converted, s_converted) _check_error() return result if result != _ffi.NULL else None -def teq_tfloat_float(temp: "const Temporal *", d: float) -> "Temporal *": +def overlaps_tnumber_numspan( + temp: Annotated[_ffi.CData, "const Temporal *"], s: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[bool, "bool"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.teq_tfloat_float(temp_converted, d) + s_converted = _ffi.cast("const Span *", s) + result = _lib.overlaps_tnumber_numspan(temp_converted, s_converted) _check_error() return result if result != _ffi.NULL else None -def teq_tpoint_point( - temp: "const Temporal *", gs: "const GSERIALIZED *" -) -> "Temporal *": +def overlaps_tnumber_tbox( + temp: Annotated[_ffi.CData, "const Temporal *"], box: Annotated[_ffi.CData, "const TBox *"] +) -> Annotated[bool, "bool"]: temp_converted = _ffi.cast("const Temporal *", temp) - gs_converted = _ffi.cast("const GSERIALIZED *", gs) - result = _lib.teq_tpoint_point(temp_converted, gs_converted) + box_converted = _ffi.cast("const TBox *", box) + result = _lib.overlaps_tnumber_tbox(temp_converted, box_converted) _check_error() return result if result != _ffi.NULL else None -def teq_tint_int(temp: "const Temporal *", i: int) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.teq_tint_int(temp_converted, i) +def overlaps_tnumber_tnumber( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.overlaps_tnumber_tnumber(temp1_converted, temp2_converted) _check_error() return result if result != _ffi.NULL else None -def teq_ttext_text(temp: "const Temporal *", txt: str) -> "Temporal *": +def overlaps_tstzspan_temporal( + s: Annotated[_ffi.CData, "const Span *"], temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + s_converted = _ffi.cast("const Span *", s) temp_converted = _ffi.cast("const Temporal *", temp) - txt_converted = cstring2text(txt) - result = _lib.teq_ttext_text(temp_converted, txt_converted) + result = _lib.overlaps_tstzspan_temporal(s_converted, temp_converted) _check_error() return result if result != _ffi.NULL else None -def tge_float_tfloat(d: float, temp: "const Temporal *") -> "Temporal *": +def same_numspan_tnumber( + s: Annotated[_ffi.CData, "const Span *"], temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + s_converted = _ffi.cast("const Span *", s) temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tge_float_tfloat(d, temp_converted) + result = _lib.same_numspan_tnumber(s_converted, temp_converted) _check_error() return result if result != _ffi.NULL else None -def tge_int_tint(i: int, temp: "const Temporal *") -> "Temporal *": +def same_tbox_tnumber( + box: Annotated[_ffi.CData, "const TBox *"], temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + box_converted = _ffi.cast("const TBox *", box) temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tge_int_tint(i, temp_converted) + result = _lib.same_tbox_tnumber(box_converted, temp_converted) _check_error() return result if result != _ffi.NULL else None -def tge_temporal_temporal( - temp1: "const Temporal *", temp2: "const Temporal *" -) -> "Temporal *": +def same_temporal_temporal( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: temp1_converted = _ffi.cast("const Temporal *", temp1) temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.tge_temporal_temporal(temp1_converted, temp2_converted) + result = _lib.same_temporal_temporal(temp1_converted, temp2_converted) _check_error() return result if result != _ffi.NULL else None -def tge_text_ttext(txt: str, temp: "const Temporal *") -> "Temporal *": - txt_converted = cstring2text(txt) +def same_temporal_tstzspan( + temp: Annotated[_ffi.CData, "const Temporal *"], s: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[bool, "bool"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tge_text_ttext(txt_converted, temp_converted) + s_converted = _ffi.cast("const Span *", s) + result = _lib.same_temporal_tstzspan(temp_converted, s_converted) _check_error() return result if result != _ffi.NULL else None -def tge_tfloat_float(temp: "const Temporal *", d: float) -> "Temporal *": +def same_tnumber_numspan( + temp: Annotated[_ffi.CData, "const Temporal *"], s: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[bool, "bool"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tge_tfloat_float(temp_converted, d) + s_converted = _ffi.cast("const Span *", s) + result = _lib.same_tnumber_numspan(temp_converted, s_converted) _check_error() return result if result != _ffi.NULL else None -def tge_tint_int(temp: "const Temporal *", i: int) -> "Temporal *": +def same_tnumber_tbox( + temp: Annotated[_ffi.CData, "const Temporal *"], box: Annotated[_ffi.CData, "const TBox *"] +) -> Annotated[bool, "bool"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tge_tint_int(temp_converted, i) + box_converted = _ffi.cast("const TBox *", box) + result = _lib.same_tnumber_tbox(temp_converted, box_converted) _check_error() return result if result != _ffi.NULL else None -def tge_ttext_text(temp: "const Temporal *", txt: str) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - txt_converted = cstring2text(txt) - result = _lib.tge_ttext_text(temp_converted, txt_converted) +def same_tnumber_tnumber( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.same_tnumber_tnumber(temp1_converted, temp2_converted) _check_error() return result if result != _ffi.NULL else None -def tgt_float_tfloat(d: float, temp: "const Temporal *") -> "Temporal *": +def same_tstzspan_temporal( + s: Annotated[_ffi.CData, "const Span *"], temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + s_converted = _ffi.cast("const Span *", s) temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tgt_float_tfloat(d, temp_converted) + result = _lib.same_tstzspan_temporal(s_converted, temp_converted) _check_error() return result if result != _ffi.NULL else None -def tgt_int_tint(i: int, temp: "const Temporal *") -> "Temporal *": +def after_tbox_tnumber( + box: Annotated[_ffi.CData, "const TBox *"], temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + box_converted = _ffi.cast("const TBox *", box) temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tgt_int_tint(i, temp_converted) + result = _lib.after_tbox_tnumber(box_converted, temp_converted) _check_error() return result if result != _ffi.NULL else None -def tgt_temporal_temporal( - temp1: "const Temporal *", temp2: "const Temporal *" -) -> "Temporal *": - temp1_converted = _ffi.cast("const Temporal *", temp1) - temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.tgt_temporal_temporal(temp1_converted, temp2_converted) +def after_temporal_tstzspan( + temp: Annotated[_ffi.CData, "const Temporal *"], s: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[bool, "bool"]: + temp_converted = _ffi.cast("const Temporal *", temp) + s_converted = _ffi.cast("const Span *", s) + result = _lib.after_temporal_tstzspan(temp_converted, s_converted) _check_error() return result if result != _ffi.NULL else None -def tgt_text_ttext(txt: str, temp: "const Temporal *") -> "Temporal *": - txt_converted = cstring2text(txt) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tgt_text_ttext(txt_converted, temp_converted) +def after_temporal_temporal( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.after_temporal_temporal(temp1_converted, temp2_converted) _check_error() return result if result != _ffi.NULL else None -def tgt_tfloat_float(temp: "const Temporal *", d: float) -> "Temporal *": +def after_tnumber_tbox( + temp: Annotated[_ffi.CData, "const Temporal *"], box: Annotated[_ffi.CData, "const TBox *"] +) -> Annotated[bool, "bool"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tgt_tfloat_float(temp_converted, d) + box_converted = _ffi.cast("const TBox *", box) + result = _lib.after_tnumber_tbox(temp_converted, box_converted) _check_error() return result if result != _ffi.NULL else None -def tgt_tint_int(temp: "const Temporal *", i: int) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tgt_tint_int(temp_converted, i) +def after_tnumber_tnumber( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.after_tnumber_tnumber(temp1_converted, temp2_converted) _check_error() return result if result != _ffi.NULL else None -def tgt_ttext_text(temp: "const Temporal *", txt: str) -> "Temporal *": +def after_tstzspan_temporal( + s: Annotated[_ffi.CData, "const Span *"], temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + s_converted = _ffi.cast("const Span *", s) temp_converted = _ffi.cast("const Temporal *", temp) - txt_converted = cstring2text(txt) - result = _lib.tgt_ttext_text(temp_converted, txt_converted) + result = _lib.after_tstzspan_temporal(s_converted, temp_converted) _check_error() return result if result != _ffi.NULL else None -def tle_float_tfloat(d: float, temp: "const Temporal *") -> "Temporal *": +def before_tbox_tnumber( + box: Annotated[_ffi.CData, "const TBox *"], temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + box_converted = _ffi.cast("const TBox *", box) temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tle_float_tfloat(d, temp_converted) + result = _lib.before_tbox_tnumber(box_converted, temp_converted) _check_error() return result if result != _ffi.NULL else None -def tle_int_tint(i: int, temp: "const Temporal *") -> "Temporal *": +def before_temporal_tstzspan( + temp: Annotated[_ffi.CData, "const Temporal *"], s: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[bool, "bool"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tle_int_tint(i, temp_converted) + s_converted = _ffi.cast("const Span *", s) + result = _lib.before_temporal_tstzspan(temp_converted, s_converted) _check_error() return result if result != _ffi.NULL else None -def tle_temporal_temporal( - temp1: "const Temporal *", temp2: "const Temporal *" -) -> "Temporal *": +def before_temporal_temporal( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: temp1_converted = _ffi.cast("const Temporal *", temp1) temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.tle_temporal_temporal(temp1_converted, temp2_converted) + result = _lib.before_temporal_temporal(temp1_converted, temp2_converted) _check_error() return result if result != _ffi.NULL else None -def tle_text_ttext(txt: str, temp: "const Temporal *") -> "Temporal *": - txt_converted = cstring2text(txt) +def before_tnumber_tbox( + temp: Annotated[_ffi.CData, "const Temporal *"], box: Annotated[_ffi.CData, "const TBox *"] +) -> Annotated[bool, "bool"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tle_text_ttext(txt_converted, temp_converted) + box_converted = _ffi.cast("const TBox *", box) + result = _lib.before_tnumber_tbox(temp_converted, box_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def before_tnumber_tnumber( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.before_tnumber_tnumber(temp1_converted, temp2_converted) _check_error() return result if result != _ffi.NULL else None -def tle_tfloat_float(temp: "const Temporal *", d: float) -> "Temporal *": +def before_tstzspan_temporal( + s: Annotated[_ffi.CData, "const Span *"], temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + s_converted = _ffi.cast("const Span *", s) temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tle_tfloat_float(temp_converted, d) + result = _lib.before_tstzspan_temporal(s_converted, temp_converted) _check_error() return result if result != _ffi.NULL else None -def tle_tint_int(temp: "const Temporal *", i: int) -> "Temporal *": +def left_tbox_tnumber( + box: Annotated[_ffi.CData, "const TBox *"], temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + box_converted = _ffi.cast("const TBox *", box) temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tle_tint_int(temp_converted, i) + result = _lib.left_tbox_tnumber(box_converted, temp_converted) _check_error() return result if result != _ffi.NULL else None -def tle_ttext_text(temp: "const Temporal *", txt: str) -> "Temporal *": +def left_numspan_tnumber( + s: Annotated[_ffi.CData, "const Span *"], temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + s_converted = _ffi.cast("const Span *", s) temp_converted = _ffi.cast("const Temporal *", temp) - txt_converted = cstring2text(txt) - result = _lib.tle_ttext_text(temp_converted, txt_converted) + result = _lib.left_numspan_tnumber(s_converted, temp_converted) _check_error() return result if result != _ffi.NULL else None -def tlt_float_tfloat(d: float, temp: "const Temporal *") -> "Temporal *": +def left_tnumber_numspan( + temp: Annotated[_ffi.CData, "const Temporal *"], s: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[bool, "bool"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tlt_float_tfloat(d, temp_converted) + s_converted = _ffi.cast("const Span *", s) + result = _lib.left_tnumber_numspan(temp_converted, s_converted) _check_error() return result if result != _ffi.NULL else None -def tlt_int_tint(i: int, temp: "const Temporal *") -> "Temporal *": +def left_tnumber_tbox( + temp: Annotated[_ffi.CData, "const Temporal *"], box: Annotated[_ffi.CData, "const TBox *"] +) -> Annotated[bool, "bool"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tlt_int_tint(i, temp_converted) + box_converted = _ffi.cast("const TBox *", box) + result = _lib.left_tnumber_tbox(temp_converted, box_converted) _check_error() return result if result != _ffi.NULL else None -def tlt_temporal_temporal( - temp1: "const Temporal *", temp2: "const Temporal *" -) -> "Temporal *": +def left_tnumber_tnumber( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: temp1_converted = _ffi.cast("const Temporal *", temp1) temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.tlt_temporal_temporal(temp1_converted, temp2_converted) + result = _lib.left_tnumber_tnumber(temp1_converted, temp2_converted) _check_error() return result if result != _ffi.NULL else None -def tlt_text_ttext(txt: str, temp: "const Temporal *") -> "Temporal *": - txt_converted = cstring2text(txt) +def overafter_tbox_tnumber( + box: Annotated[_ffi.CData, "const TBox *"], temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + box_converted = _ffi.cast("const TBox *", box) temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tlt_text_ttext(txt_converted, temp_converted) + result = _lib.overafter_tbox_tnumber(box_converted, temp_converted) _check_error() return result if result != _ffi.NULL else None -def tlt_tfloat_float(temp: "const Temporal *", d: float) -> "Temporal *": +def overafter_temporal_tstzspan( + temp: Annotated[_ffi.CData, "const Temporal *"], s: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[bool, "bool"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tlt_tfloat_float(temp_converted, d) + s_converted = _ffi.cast("const Span *", s) + result = _lib.overafter_temporal_tstzspan(temp_converted, s_converted) _check_error() return result if result != _ffi.NULL else None -def tlt_tint_int(temp: "const Temporal *", i: int) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tlt_tint_int(temp_converted, i) +def overafter_temporal_temporal( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.overafter_temporal_temporal(temp1_converted, temp2_converted) _check_error() return result if result != _ffi.NULL else None -def tlt_ttext_text(temp: "const Temporal *", txt: str) -> "Temporal *": +def overafter_tnumber_tbox( + temp: Annotated[_ffi.CData, "const Temporal *"], box: Annotated[_ffi.CData, "const TBox *"] +) -> Annotated[bool, "bool"]: temp_converted = _ffi.cast("const Temporal *", temp) - txt_converted = cstring2text(txt) - result = _lib.tlt_ttext_text(temp_converted, txt_converted) + box_converted = _ffi.cast("const TBox *", box) + result = _lib.overafter_tnumber_tbox(temp_converted, box_converted) _check_error() return result if result != _ffi.NULL else None -def tne_bool_tbool(b: bool, temp: "const Temporal *") -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tne_bool_tbool(b, temp_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def tne_float_tfloat(d: float, temp: "const Temporal *") -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tne_float_tfloat(d, temp_converted) +def overafter_tnumber_tnumber( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.overafter_tnumber_tnumber(temp1_converted, temp2_converted) _check_error() return result if result != _ffi.NULL else None -def tne_int_tint(i: int, temp: "const Temporal *") -> "Temporal *": +def overafter_tstzspan_temporal( + s: Annotated[_ffi.CData, "const Span *"], temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + s_converted = _ffi.cast("const Span *", s) temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tne_int_tint(i, temp_converted) + result = _lib.overafter_tstzspan_temporal(s_converted, temp_converted) _check_error() return result if result != _ffi.NULL else None -def tne_point_tpoint( - gs: "const GSERIALIZED *", temp: "const Temporal *" -) -> "Temporal *": - gs_converted = _ffi.cast("const GSERIALIZED *", gs) +def overbefore_tbox_tnumber( + box: Annotated[_ffi.CData, "const TBox *"], temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + box_converted = _ffi.cast("const TBox *", box) temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tne_point_tpoint(gs_converted, temp_converted) + result = _lib.overbefore_tbox_tnumber(box_converted, temp_converted) _check_error() return result if result != _ffi.NULL else None -def tne_tbool_bool(temp: "const Temporal *", b: bool) -> "Temporal *": +def overbefore_temporal_tstzspan( + temp: Annotated[_ffi.CData, "const Temporal *"], s: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[bool, "bool"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tne_tbool_bool(temp_converted, b) + s_converted = _ffi.cast("const Span *", s) + result = _lib.overbefore_temporal_tstzspan(temp_converted, s_converted) _check_error() return result if result != _ffi.NULL else None -def tne_temporal_temporal( - temp1: "const Temporal *", temp2: "const Temporal *" -) -> "Temporal *": +def overbefore_temporal_temporal( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: temp1_converted = _ffi.cast("const Temporal *", temp1) temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.tne_temporal_temporal(temp1_converted, temp2_converted) + result = _lib.overbefore_temporal_temporal(temp1_converted, temp2_converted) _check_error() return result if result != _ffi.NULL else None -def tne_text_ttext(txt: str, temp: "const Temporal *") -> "Temporal *": - txt_converted = cstring2text(txt) +def overbefore_tnumber_tbox( + temp: Annotated[_ffi.CData, "const Temporal *"], box: Annotated[_ffi.CData, "const TBox *"] +) -> Annotated[bool, "bool"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tne_text_ttext(txt_converted, temp_converted) + box_converted = _ffi.cast("const TBox *", box) + result = _lib.overbefore_tnumber_tbox(temp_converted, box_converted) _check_error() return result if result != _ffi.NULL else None -def tne_tfloat_float(temp: "const Temporal *", d: float) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tne_tfloat_float(temp_converted, d) +def overbefore_tnumber_tnumber( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.overbefore_tnumber_tnumber(temp1_converted, temp2_converted) _check_error() return result if result != _ffi.NULL else None -def tne_tpoint_point( - temp: "const Temporal *", gs: "const GSERIALIZED *" -) -> "Temporal *": +def overbefore_tstzspan_temporal( + s: Annotated[_ffi.CData, "const Span *"], temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + s_converted = _ffi.cast("const Span *", s) temp_converted = _ffi.cast("const Temporal *", temp) - gs_converted = _ffi.cast("const GSERIALIZED *", gs) - result = _lib.tne_tpoint_point(temp_converted, gs_converted) + result = _lib.overbefore_tstzspan_temporal(s_converted, temp_converted) _check_error() return result if result != _ffi.NULL else None -def tne_tint_int(temp: "const Temporal *", i: int) -> "Temporal *": +def overleft_numspan_tnumber( + s: Annotated[_ffi.CData, "const Span *"], temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + s_converted = _ffi.cast("const Span *", s) temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tne_tint_int(temp_converted, i) + result = _lib.overleft_numspan_tnumber(s_converted, temp_converted) _check_error() return result if result != _ffi.NULL else None -def tne_ttext_text(temp: "const Temporal *", txt: str) -> "Temporal *": +def overleft_tbox_tnumber( + box: Annotated[_ffi.CData, "const TBox *"], temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + box_converted = _ffi.cast("const TBox *", box) temp_converted = _ffi.cast("const Temporal *", temp) - txt_converted = cstring2text(txt) - result = _lib.tne_ttext_text(temp_converted, txt_converted) + result = _lib.overleft_tbox_tnumber(box_converted, temp_converted) _check_error() return result if result != _ffi.NULL else None -def temporal_spans(temp: "const Temporal *") -> "Tuple['Span *', 'int']": +def overleft_tnumber_numspan( + temp: Annotated[_ffi.CData, "const Temporal *"], s: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[bool, "bool"]: temp_converted = _ffi.cast("const Temporal *", temp) - count = _ffi.new("int *") - result = _lib.temporal_spans(temp_converted, count) + s_converted = _ffi.cast("const Span *", s) + result = _lib.overleft_tnumber_numspan(temp_converted, s_converted) _check_error() - return result if result != _ffi.NULL else None, count[0] + return result if result != _ffi.NULL else None -def temporal_split_each_n_spans( - temp: "const Temporal *", elem_count: int -) -> "Tuple['Span *', 'int']": +def overleft_tnumber_tbox( + temp: Annotated[_ffi.CData, "const Temporal *"], box: Annotated[_ffi.CData, "const TBox *"] +) -> Annotated[bool, "bool"]: temp_converted = _ffi.cast("const Temporal *", temp) - count = _ffi.new("int *") - result = _lib.temporal_split_each_n_spans(temp_converted, elem_count, count) + box_converted = _ffi.cast("const TBox *", box) + result = _lib.overleft_tnumber_tbox(temp_converted, box_converted) _check_error() - return result if result != _ffi.NULL else None, count[0] + return result if result != _ffi.NULL else None -def temporal_split_n_spans( - temp: "const Temporal *", span_count: int -) -> "Tuple['Span *', 'int']": - temp_converted = _ffi.cast("const Temporal *", temp) - count = _ffi.new("int *") - result = _lib.temporal_split_n_spans(temp_converted, span_count, count) +def overleft_tnumber_tnumber( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.overleft_tnumber_tnumber(temp1_converted, temp2_converted) _check_error() - return result if result != _ffi.NULL else None, count[0] + return result if result != _ffi.NULL else None -def tnumber_tboxes(temp: "const Temporal *") -> "Tuple['TBox *', 'int']": +def overright_numspan_tnumber( + s: Annotated[_ffi.CData, "const Span *"], temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + s_converted = _ffi.cast("const Span *", s) temp_converted = _ffi.cast("const Temporal *", temp) - count = _ffi.new("int *") - result = _lib.tnumber_tboxes(temp_converted, count) + result = _lib.overright_numspan_tnumber(s_converted, temp_converted) _check_error() - return result if result != _ffi.NULL else None, count[0] + return result if result != _ffi.NULL else None -def tnumber_split_each_n_tboxes( - temp: "const Temporal *", elem_count: int -) -> "Tuple['TBox *', 'int']": +def overright_tbox_tnumber( + box: Annotated[_ffi.CData, "const TBox *"], temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + box_converted = _ffi.cast("const TBox *", box) temp_converted = _ffi.cast("const Temporal *", temp) - count = _ffi.new("int *") - result = _lib.tnumber_split_each_n_tboxes(temp_converted, elem_count, count) + result = _lib.overright_tbox_tnumber(box_converted, temp_converted) _check_error() - return result if result != _ffi.NULL else None, count[0] + return result if result != _ffi.NULL else None -def tnumber_split_n_tboxes( - temp: "const Temporal *", box_count: int -) -> "Tuple['TBox *', 'int']": +def overright_tnumber_numspan( + temp: Annotated[_ffi.CData, "const Temporal *"], s: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[bool, "bool"]: temp_converted = _ffi.cast("const Temporal *", temp) - count = _ffi.new("int *") - result = _lib.tnumber_split_n_tboxes(temp_converted, box_count, count) + s_converted = _ffi.cast("const Span *", s) + result = _lib.overright_tnumber_numspan(temp_converted, s_converted) _check_error() - return result if result != _ffi.NULL else None, count[0] + return result if result != _ffi.NULL else None -def tpoint_stboxes(temp: "const Temporal *") -> "Tuple['STBox *', 'int']": +def overright_tnumber_tbox( + temp: Annotated[_ffi.CData, "const Temporal *"], box: Annotated[_ffi.CData, "const TBox *"] +) -> Annotated[bool, "bool"]: temp_converted = _ffi.cast("const Temporal *", temp) - count = _ffi.new("int *") - result = _lib.tpoint_stboxes(temp_converted, count) + box_converted = _ffi.cast("const TBox *", box) + result = _lib.overright_tnumber_tbox(temp_converted, box_converted) _check_error() - return result if result != _ffi.NULL else None, count[0] + return result if result != _ffi.NULL else None -def tpoint_space_boxes( - temp: "const Temporal *", - xsize: float, - ysize: float, - zsize: float, - sorigin: "const GSERIALIZED *", - bitmatrix: bool, - border_inc: bool, -) -> "Tuple['STBox *', 'int']": - temp_converted = _ffi.cast("const Temporal *", temp) - sorigin_converted = _ffi.cast("const GSERIALIZED *", sorigin) - count = _ffi.new("int *") - result = _lib.tpoint_space_boxes( - temp_converted, - xsize, - ysize, - zsize, - sorigin_converted, - bitmatrix, - border_inc, - count, - ) +def overright_tnumber_tnumber( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.overright_tnumber_tnumber(temp1_converted, temp2_converted) _check_error() - return result if result != _ffi.NULL else None, count[0] + return result if result != _ffi.NULL else None -def tpoint_space_time_boxes( - temp: "const Temporal *", - xsize: float, - ysize: float, - zsize: float, - duration: "const Interval *", - sorigin: "const GSERIALIZED *", - torigin: int, - bitmatrix: bool, - border_inc: bool, -) -> "Tuple['STBox *', 'int']": +def right_numspan_tnumber( + s: Annotated[_ffi.CData, "const Span *"], temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + s_converted = _ffi.cast("const Span *", s) temp_converted = _ffi.cast("const Temporal *", temp) - duration_converted = _ffi.cast("const Interval *", duration) - sorigin_converted = _ffi.cast("const GSERIALIZED *", sorigin) - torigin_converted = _ffi.cast("TimestampTz", torigin) - count = _ffi.new("int *") - result = _lib.tpoint_space_time_boxes( - temp_converted, - xsize, - ysize, - zsize, - duration_converted, - sorigin_converted, - torigin_converted, - bitmatrix, - border_inc, - count, - ) + result = _lib.right_numspan_tnumber(s_converted, temp_converted) _check_error() - return result if result != _ffi.NULL else None, count[0] + return result if result != _ffi.NULL else None -def tpoint_split_each_n_stboxes( - temp: "const Temporal *", elem_count: int -) -> "Tuple['STBox *', 'int']": +def right_tbox_tnumber( + box: Annotated[_ffi.CData, "const TBox *"], temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + box_converted = _ffi.cast("const TBox *", box) temp_converted = _ffi.cast("const Temporal *", temp) - count = _ffi.new("int *") - result = _lib.tpoint_split_each_n_stboxes(temp_converted, elem_count, count) + result = _lib.right_tbox_tnumber(box_converted, temp_converted) _check_error() - return result if result != _ffi.NULL else None, count[0] + return result if result != _ffi.NULL else None -def tpoint_split_n_stboxes( - temp: "const Temporal *", box_count: int -) -> "Tuple['STBox *', 'int']": +def right_tnumber_numspan( + temp: Annotated[_ffi.CData, "const Temporal *"], s: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[bool, "bool"]: temp_converted = _ffi.cast("const Temporal *", temp) - count = _ffi.new("int *") - result = _lib.tpoint_split_n_stboxes(temp_converted, box_count, count) + s_converted = _ffi.cast("const Span *", s) + result = _lib.right_tnumber_numspan(temp_converted, s_converted) _check_error() - return result if result != _ffi.NULL else None, count[0] + return result if result != _ffi.NULL else None -def geo_split_each_n_gboxes( - gs: "const GSERIALIZED *", elem_count: int -) -> "Tuple['GBOX *', 'int']": - gs_converted = _ffi.cast("const GSERIALIZED *", gs) - count = _ffi.new("int *") - result = _lib.geo_split_each_n_gboxes(gs_converted, elem_count, count) +def right_tnumber_tbox( + temp: Annotated[_ffi.CData, "const Temporal *"], box: Annotated[_ffi.CData, "const TBox *"] +) -> Annotated[bool, "bool"]: + temp_converted = _ffi.cast("const Temporal *", temp) + box_converted = _ffi.cast("const TBox *", box) + result = _lib.right_tnumber_tbox(temp_converted, box_converted) _check_error() - return result if result != _ffi.NULL else None, count[0] + return result if result != _ffi.NULL else None -def geo_split_n_gboxes( - gs: "const GSERIALIZED *", box_count: int -) -> "Tuple['GBOX *', 'int']": - gs_converted = _ffi.cast("const GSERIALIZED *", gs) - count = _ffi.new("int *") - result = _lib.geo_split_n_gboxes(gs_converted, box_count, count) +def right_tnumber_tnumber( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.right_tnumber_tnumber(temp1_converted, temp2_converted) _check_error() - return result if result != _ffi.NULL else None, count[0] + return result if result != _ffi.NULL else None -def adjacent_numspan_tnumber(s: "const Span *", temp: "const Temporal *") -> "bool": - s_converted = _ffi.cast("const Span *", s) +def tand_bool_tbool(b: bool, temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.adjacent_numspan_tnumber(s_converted, temp_converted) + result = _lib.tand_bool_tbool(b, temp_converted) _check_error() return result if result != _ffi.NULL else None -def adjacent_stbox_tpoint(box: "const STBox *", temp: "const Temporal *") -> "bool": - box_converted = _ffi.cast("const STBox *", box) +def tand_tbool_bool(temp: Annotated[_ffi.CData, "const Temporal *"], b: bool) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.adjacent_stbox_tpoint(box_converted, temp_converted) + result = _lib.tand_tbool_bool(temp_converted, b) _check_error() return result if result != _ffi.NULL else None -def adjacent_tbox_tnumber(box: "const TBox *", temp: "const Temporal *") -> "bool": - box_converted = _ffi.cast("const TBox *", box) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.adjacent_tbox_tnumber(box_converted, temp_converted) +def tand_tbool_tbool( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[_ffi.CData, "Temporal *"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.tand_tbool_tbool(temp1_converted, temp2_converted) _check_error() return result if result != _ffi.NULL else None -def adjacent_temporal_temporal( - temp1: "const Temporal *", temp2: "const Temporal *" -) -> "bool": - temp1_converted = _ffi.cast("const Temporal *", temp1) - temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.adjacent_temporal_temporal(temp1_converted, temp2_converted) +def tbool_when_true(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "SpanSet *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.tbool_when_true(temp_converted) _check_error() return result if result != _ffi.NULL else None -def adjacent_temporal_tstzspan(temp: "const Temporal *", s: "const Span *") -> "bool": +def tnot_tbool(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - s_converted = _ffi.cast("const Span *", s) - result = _lib.adjacent_temporal_tstzspan(temp_converted, s_converted) + result = _lib.tnot_tbool(temp_converted) _check_error() return result if result != _ffi.NULL else None -def adjacent_tnumber_numspan(temp: "const Temporal *", s: "const Span *") -> "bool": +def tor_bool_tbool(b: bool, temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - s_converted = _ffi.cast("const Span *", s) - result = _lib.adjacent_tnumber_numspan(temp_converted, s_converted) + result = _lib.tor_bool_tbool(b, temp_converted) _check_error() return result if result != _ffi.NULL else None -def adjacent_tnumber_tbox(temp: "const Temporal *", box: "const TBox *") -> "bool": +def tor_tbool_bool(temp: Annotated[_ffi.CData, "const Temporal *"], b: bool) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - box_converted = _ffi.cast("const TBox *", box) - result = _lib.adjacent_tnumber_tbox(temp_converted, box_converted) + result = _lib.tor_tbool_bool(temp_converted, b) _check_error() return result if result != _ffi.NULL else None -def adjacent_tnumber_tnumber( - temp1: "const Temporal *", temp2: "const Temporal *" -) -> "bool": +def tor_tbool_tbool( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[_ffi.CData, "Temporal *"]: temp1_converted = _ffi.cast("const Temporal *", temp1) temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.adjacent_tnumber_tnumber(temp1_converted, temp2_converted) + result = _lib.tor_tbool_tbool(temp1_converted, temp2_converted) _check_error() return result if result != _ffi.NULL else None -def adjacent_tpoint_stbox(temp: "const Temporal *", box: "const STBox *") -> "bool": - temp_converted = _ffi.cast("const Temporal *", temp) - box_converted = _ffi.cast("const STBox *", box) - result = _lib.adjacent_tpoint_stbox(temp_converted, box_converted) +def add_float_tfloat( + d: float, tnumber: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[_ffi.CData, "Temporal *"]: + tnumber_converted = _ffi.cast("const Temporal *", tnumber) + result = _lib.add_float_tfloat(d, tnumber_converted) _check_error() return result if result != _ffi.NULL else None -def adjacent_tpoint_tpoint( - temp1: "const Temporal *", temp2: "const Temporal *" -) -> "bool": - temp1_converted = _ffi.cast("const Temporal *", temp1) - temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.adjacent_tpoint_tpoint(temp1_converted, temp2_converted) +def add_int_tint(i: int, tnumber: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "Temporal *"]: + tnumber_converted = _ffi.cast("const Temporal *", tnumber) + result = _lib.add_int_tint(i, tnumber_converted) _check_error() return result if result != _ffi.NULL else None -def adjacent_tstzspan_temporal(s: "const Span *", temp: "const Temporal *") -> "bool": - s_converted = _ffi.cast("const Span *", s) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.adjacent_tstzspan_temporal(s_converted, temp_converted) +def add_tfloat_float( + tnumber: Annotated[_ffi.CData, "const Temporal *"], d: float +) -> Annotated[_ffi.CData, "Temporal *"]: + tnumber_converted = _ffi.cast("const Temporal *", tnumber) + result = _lib.add_tfloat_float(tnumber_converted, d) _check_error() return result if result != _ffi.NULL else None -def contained_numspan_tnumber(s: "const Span *", temp: "const Temporal *") -> "bool": - s_converted = _ffi.cast("const Span *", s) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.contained_numspan_tnumber(s_converted, temp_converted) +def add_tint_int(tnumber: Annotated[_ffi.CData, "const Temporal *"], i: int) -> Annotated[_ffi.CData, "Temporal *"]: + tnumber_converted = _ffi.cast("const Temporal *", tnumber) + result = _lib.add_tint_int(tnumber_converted, i) _check_error() return result if result != _ffi.NULL else None -def contained_stbox_tpoint(box: "const STBox *", temp: "const Temporal *") -> "bool": - box_converted = _ffi.cast("const STBox *", box) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.contained_stbox_tpoint(box_converted, temp_converted) +def add_tnumber_tnumber( + tnumber1: Annotated[_ffi.CData, "const Temporal *"], tnumber2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[_ffi.CData, "Temporal *"]: + tnumber1_converted = _ffi.cast("const Temporal *", tnumber1) + tnumber2_converted = _ffi.cast("const Temporal *", tnumber2) + result = _lib.add_tnumber_tnumber(tnumber1_converted, tnumber2_converted) _check_error() return result if result != _ffi.NULL else None -def contained_tbox_tnumber(box: "const TBox *", temp: "const Temporal *") -> "bool": - box_converted = _ffi.cast("const TBox *", box) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.contained_tbox_tnumber(box_converted, temp_converted) +def div_float_tfloat( + d: float, tnumber: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[_ffi.CData, "Temporal *"]: + tnumber_converted = _ffi.cast("const Temporal *", tnumber) + result = _lib.div_float_tfloat(d, tnumber_converted) _check_error() return result if result != _ffi.NULL else None -def contained_temporal_temporal( - temp1: "const Temporal *", temp2: "const Temporal *" -) -> "bool": - temp1_converted = _ffi.cast("const Temporal *", temp1) - temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.contained_temporal_temporal(temp1_converted, temp2_converted) +def div_int_tint(i: int, tnumber: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "Temporal *"]: + tnumber_converted = _ffi.cast("const Temporal *", tnumber) + result = _lib.div_int_tint(i, tnumber_converted) _check_error() return result if result != _ffi.NULL else None -def contained_temporal_tstzspan(temp: "const Temporal *", s: "const Span *") -> "bool": - temp_converted = _ffi.cast("const Temporal *", temp) - s_converted = _ffi.cast("const Span *", s) - result = _lib.contained_temporal_tstzspan(temp_converted, s_converted) +def div_tfloat_float( + tnumber: Annotated[_ffi.CData, "const Temporal *"], d: float +) -> Annotated[_ffi.CData, "Temporal *"]: + tnumber_converted = _ffi.cast("const Temporal *", tnumber) + result = _lib.div_tfloat_float(tnumber_converted, d) _check_error() return result if result != _ffi.NULL else None -def contained_tnumber_numspan(temp: "const Temporal *", s: "const Span *") -> "bool": - temp_converted = _ffi.cast("const Temporal *", temp) - s_converted = _ffi.cast("const Span *", s) - result = _lib.contained_tnumber_numspan(temp_converted, s_converted) +def div_tint_int(tnumber: Annotated[_ffi.CData, "const Temporal *"], i: int) -> Annotated[_ffi.CData, "Temporal *"]: + tnumber_converted = _ffi.cast("const Temporal *", tnumber) + result = _lib.div_tint_int(tnumber_converted, i) _check_error() return result if result != _ffi.NULL else None -def contained_tnumber_tbox(temp: "const Temporal *", box: "const TBox *") -> "bool": - temp_converted = _ffi.cast("const Temporal *", temp) - box_converted = _ffi.cast("const TBox *", box) - result = _lib.contained_tnumber_tbox(temp_converted, box_converted) +def div_tnumber_tnumber( + tnumber1: Annotated[_ffi.CData, "const Temporal *"], tnumber2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[_ffi.CData, "Temporal *"]: + tnumber1_converted = _ffi.cast("const Temporal *", tnumber1) + tnumber2_converted = _ffi.cast("const Temporal *", tnumber2) + result = _lib.div_tnumber_tnumber(tnumber1_converted, tnumber2_converted) _check_error() return result if result != _ffi.NULL else None -def contained_tnumber_tnumber( - temp1: "const Temporal *", temp2: "const Temporal *" -) -> "bool": - temp1_converted = _ffi.cast("const Temporal *", temp1) - temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.contained_tnumber_tnumber(temp1_converted, temp2_converted) +def mult_float_tfloat( + d: float, tnumber: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[_ffi.CData, "Temporal *"]: + tnumber_converted = _ffi.cast("const Temporal *", tnumber) + result = _lib.mult_float_tfloat(d, tnumber_converted) _check_error() return result if result != _ffi.NULL else None -def contained_tpoint_stbox(temp: "const Temporal *", box: "const STBox *") -> "bool": - temp_converted = _ffi.cast("const Temporal *", temp) - box_converted = _ffi.cast("const STBox *", box) - result = _lib.contained_tpoint_stbox(temp_converted, box_converted) +def mult_int_tint(i: int, tnumber: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "Temporal *"]: + tnumber_converted = _ffi.cast("const Temporal *", tnumber) + result = _lib.mult_int_tint(i, tnumber_converted) _check_error() return result if result != _ffi.NULL else None -def contained_tpoint_tpoint( - temp1: "const Temporal *", temp2: "const Temporal *" -) -> "bool": - temp1_converted = _ffi.cast("const Temporal *", temp1) - temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.contained_tpoint_tpoint(temp1_converted, temp2_converted) +def mult_tfloat_float( + tnumber: Annotated[_ffi.CData, "const Temporal *"], d: float +) -> Annotated[_ffi.CData, "Temporal *"]: + tnumber_converted = _ffi.cast("const Temporal *", tnumber) + result = _lib.mult_tfloat_float(tnumber_converted, d) _check_error() return result if result != _ffi.NULL else None -def contained_tstzspan_temporal(s: "const Span *", temp: "const Temporal *") -> "bool": - s_converted = _ffi.cast("const Span *", s) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.contained_tstzspan_temporal(s_converted, temp_converted) +def mult_tint_int(tnumber: Annotated[_ffi.CData, "const Temporal *"], i: int) -> Annotated[_ffi.CData, "Temporal *"]: + tnumber_converted = _ffi.cast("const Temporal *", tnumber) + result = _lib.mult_tint_int(tnumber_converted, i) _check_error() return result if result != _ffi.NULL else None -def contains_numspan_tnumber(s: "const Span *", temp: "const Temporal *") -> "bool": - s_converted = _ffi.cast("const Span *", s) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.contains_numspan_tnumber(s_converted, temp_converted) +def mult_tnumber_tnumber( + tnumber1: Annotated[_ffi.CData, "const Temporal *"], tnumber2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[_ffi.CData, "Temporal *"]: + tnumber1_converted = _ffi.cast("const Temporal *", tnumber1) + tnumber2_converted = _ffi.cast("const Temporal *", tnumber2) + result = _lib.mult_tnumber_tnumber(tnumber1_converted, tnumber2_converted) _check_error() return result if result != _ffi.NULL else None -def contains_stbox_tpoint(box: "const STBox *", temp: "const Temporal *") -> "bool": - box_converted = _ffi.cast("const STBox *", box) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.contains_stbox_tpoint(box_converted, temp_converted) +def sub_float_tfloat( + d: float, tnumber: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[_ffi.CData, "Temporal *"]: + tnumber_converted = _ffi.cast("const Temporal *", tnumber) + result = _lib.sub_float_tfloat(d, tnumber_converted) _check_error() return result if result != _ffi.NULL else None -def contains_tbox_tnumber(box: "const TBox *", temp: "const Temporal *") -> "bool": - box_converted = _ffi.cast("const TBox *", box) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.contains_tbox_tnumber(box_converted, temp_converted) +def sub_int_tint(i: int, tnumber: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "Temporal *"]: + tnumber_converted = _ffi.cast("const Temporal *", tnumber) + result = _lib.sub_int_tint(i, tnumber_converted) _check_error() return result if result != _ffi.NULL else None -def contains_temporal_tstzspan(temp: "const Temporal *", s: "const Span *") -> "bool": - temp_converted = _ffi.cast("const Temporal *", temp) - s_converted = _ffi.cast("const Span *", s) - result = _lib.contains_temporal_tstzspan(temp_converted, s_converted) +def sub_tfloat_float( + tnumber: Annotated[_ffi.CData, "const Temporal *"], d: float +) -> Annotated[_ffi.CData, "Temporal *"]: + tnumber_converted = _ffi.cast("const Temporal *", tnumber) + result = _lib.sub_tfloat_float(tnumber_converted, d) _check_error() return result if result != _ffi.NULL else None -def contains_temporal_temporal( - temp1: "const Temporal *", temp2: "const Temporal *" -) -> "bool": - temp1_converted = _ffi.cast("const Temporal *", temp1) - temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.contains_temporal_temporal(temp1_converted, temp2_converted) +def sub_tint_int(tnumber: Annotated[_ffi.CData, "const Temporal *"], i: int) -> Annotated[_ffi.CData, "Temporal *"]: + tnumber_converted = _ffi.cast("const Temporal *", tnumber) + result = _lib.sub_tint_int(tnumber_converted, i) _check_error() return result if result != _ffi.NULL else None -def contains_tnumber_numspan(temp: "const Temporal *", s: "const Span *") -> "bool": +def sub_tnumber_tnumber( + tnumber1: Annotated[_ffi.CData, "const Temporal *"], tnumber2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[_ffi.CData, "Temporal *"]: + tnumber1_converted = _ffi.cast("const Temporal *", tnumber1) + tnumber2_converted = _ffi.cast("const Temporal *", tnumber2) + result = _lib.sub_tnumber_tnumber(tnumber1_converted, tnumber2_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def temporal_derivative(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - s_converted = _ffi.cast("const Span *", s) - result = _lib.contains_tnumber_numspan(temp_converted, s_converted) + result = _lib.temporal_derivative(temp_converted) _check_error() return result if result != _ffi.NULL else None -def contains_tnumber_tbox(temp: "const Temporal *", box: "const TBox *") -> "bool": +def tfloat_exp(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - box_converted = _ffi.cast("const TBox *", box) - result = _lib.contains_tnumber_tbox(temp_converted, box_converted) + result = _lib.tfloat_exp(temp_converted) _check_error() return result if result != _ffi.NULL else None -def contains_tnumber_tnumber( - temp1: "const Temporal *", temp2: "const Temporal *" -) -> "bool": - temp1_converted = _ffi.cast("const Temporal *", temp1) - temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.contains_tnumber_tnumber(temp1_converted, temp2_converted) +def tfloat_ln(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "Temporal *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.tfloat_ln(temp_converted) _check_error() return result if result != _ffi.NULL else None -def contains_tpoint_stbox(temp: "const Temporal *", box: "const STBox *") -> "bool": +def tfloat_log10(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - box_converted = _ffi.cast("const STBox *", box) - result = _lib.contains_tpoint_stbox(temp_converted, box_converted) + result = _lib.tfloat_log10(temp_converted) _check_error() return result if result != _ffi.NULL else None -def contains_tpoint_tpoint( - temp1: "const Temporal *", temp2: "const Temporal *" -) -> "bool": - temp1_converted = _ffi.cast("const Temporal *", temp1) - temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.contains_tpoint_tpoint(temp1_converted, temp2_converted) +def tnumber_abs(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "Temporal *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.tnumber_abs(temp_converted) _check_error() return result if result != _ffi.NULL else None -def contains_tstzspan_temporal(s: "const Span *", temp: "const Temporal *") -> "bool": - s_converted = _ffi.cast("const Span *", s) +def float_angular_difference(degrees1: float, degrees2: float) -> Annotated[float, "double"]: + result = _lib.float_angular_difference(degrees1, degrees2) + _check_error() + return result if result != _ffi.NULL else None + + +def tnumber_angular_difference(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.contains_tstzspan_temporal(s_converted, temp_converted) + result = _lib.tnumber_angular_difference(temp_converted) _check_error() return result if result != _ffi.NULL else None -def overlaps_numspan_tnumber(s: "const Span *", temp: "const Temporal *") -> "bool": - s_converted = _ffi.cast("const Span *", s) +def tnumber_delta_value(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.overlaps_numspan_tnumber(s_converted, temp_converted) + result = _lib.tnumber_delta_value(temp_converted) _check_error() return result if result != _ffi.NULL else None -def overlaps_stbox_tpoint(box: "const STBox *", temp: "const Temporal *") -> "bool": - box_converted = _ffi.cast("const STBox *", box) +def textcat_text_ttext( + txt: str, temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[_ffi.CData, "Temporal *"]: + txt_converted = cstring2text(txt) temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.overlaps_stbox_tpoint(box_converted, temp_converted) + result = _lib.textcat_text_ttext(txt_converted, temp_converted) _check_error() return result if result != _ffi.NULL else None -def overlaps_tbox_tnumber(box: "const TBox *", temp: "const Temporal *") -> "bool": - box_converted = _ffi.cast("const TBox *", box) +def textcat_ttext_text( + temp: Annotated[_ffi.CData, "const Temporal *"], txt: str +) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.overlaps_tbox_tnumber(box_converted, temp_converted) + txt_converted = cstring2text(txt) + result = _lib.textcat_ttext_text(temp_converted, txt_converted) _check_error() return result if result != _ffi.NULL else None -def overlaps_temporal_temporal( - temp1: "const Temporal *", temp2: "const Temporal *" -) -> "bool": +def textcat_ttext_ttext( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[_ffi.CData, "Temporal *"]: temp1_converted = _ffi.cast("const Temporal *", temp1) temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.overlaps_temporal_temporal(temp1_converted, temp2_converted) + result = _lib.textcat_ttext_ttext(temp1_converted, temp2_converted) _check_error() return result if result != _ffi.NULL else None -def overlaps_temporal_tstzspan(temp: "const Temporal *", s: "const Span *") -> "bool": +def ttext_initcap(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - s_converted = _ffi.cast("const Span *", s) - result = _lib.overlaps_temporal_tstzspan(temp_converted, s_converted) + result = _lib.ttext_initcap(temp_converted) _check_error() return result if result != _ffi.NULL else None -def overlaps_tnumber_numspan(temp: "const Temporal *", s: "const Span *") -> "bool": +def ttext_upper(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - s_converted = _ffi.cast("const Span *", s) - result = _lib.overlaps_tnumber_numspan(temp_converted, s_converted) + result = _lib.ttext_upper(temp_converted) _check_error() return result if result != _ffi.NULL else None -def overlaps_tnumber_tbox(temp: "const Temporal *", box: "const TBox *") -> "bool": +def ttext_lower(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - box_converted = _ffi.cast("const TBox *", box) - result = _lib.overlaps_tnumber_tbox(temp_converted, box_converted) + result = _lib.ttext_lower(temp_converted) _check_error() return result if result != _ffi.NULL else None -def overlaps_tnumber_tnumber( - temp1: "const Temporal *", temp2: "const Temporal *" -) -> "bool": - temp1_converted = _ffi.cast("const Temporal *", temp1) - temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.overlaps_tnumber_tnumber(temp1_converted, temp2_converted) +def tdistance_tfloat_float( + temp: Annotated[_ffi.CData, "const Temporal *"], d: float +) -> Annotated[_ffi.CData, "Temporal *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.tdistance_tfloat_float(temp_converted, d) _check_error() return result if result != _ffi.NULL else None -def overlaps_tpoint_stbox(temp: "const Temporal *", box: "const STBox *") -> "bool": +def tdistance_tint_int(temp: Annotated[_ffi.CData, "const Temporal *"], i: int) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - box_converted = _ffi.cast("const STBox *", box) - result = _lib.overlaps_tpoint_stbox(temp_converted, box_converted) + result = _lib.tdistance_tint_int(temp_converted, i) _check_error() return result if result != _ffi.NULL else None -def overlaps_tpoint_tpoint( - temp1: "const Temporal *", temp2: "const Temporal *" -) -> "bool": +def tdistance_tnumber_tnumber( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[_ffi.CData, "Temporal *"]: temp1_converted = _ffi.cast("const Temporal *", temp1) temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.overlaps_tpoint_tpoint(temp1_converted, temp2_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def overlaps_tstzspan_temporal(s: "const Span *", temp: "const Temporal *") -> "bool": - s_converted = _ffi.cast("const Span *", s) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.overlaps_tstzspan_temporal(s_converted, temp_converted) + result = _lib.tdistance_tnumber_tnumber(temp1_converted, temp2_converted) _check_error() return result if result != _ffi.NULL else None -def same_numspan_tnumber(s: "const Span *", temp: "const Temporal *") -> "bool": - s_converted = _ffi.cast("const Span *", s) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.same_numspan_tnumber(s_converted, temp_converted) +def nad_tboxfloat_tboxfloat( + box1: Annotated[_ffi.CData, "const TBox *"], box2: Annotated[_ffi.CData, "const TBox *"] +) -> Annotated[float, "double"]: + box1_converted = _ffi.cast("const TBox *", box1) + box2_converted = _ffi.cast("const TBox *", box2) + result = _lib.nad_tboxfloat_tboxfloat(box1_converted, box2_converted) _check_error() return result if result != _ffi.NULL else None -def same_stbox_tpoint(box: "const STBox *", temp: "const Temporal *") -> "bool": - box_converted = _ffi.cast("const STBox *", box) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.same_stbox_tpoint(box_converted, temp_converted) +def nad_tboxint_tboxint( + box1: Annotated[_ffi.CData, "const TBox *"], box2: Annotated[_ffi.CData, "const TBox *"] +) -> Annotated[int, "int"]: + box1_converted = _ffi.cast("const TBox *", box1) + box2_converted = _ffi.cast("const TBox *", box2) + result = _lib.nad_tboxint_tboxint(box1_converted, box2_converted) _check_error() return result if result != _ffi.NULL else None -def same_tbox_tnumber(box: "const TBox *", temp: "const Temporal *") -> "bool": - box_converted = _ffi.cast("const TBox *", box) +def nad_tfloat_float(temp: Annotated[_ffi.CData, "const Temporal *"], d: float) -> Annotated[float, "double"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.same_tbox_tnumber(box_converted, temp_converted) + result = _lib.nad_tfloat_float(temp_converted, d) _check_error() return result if result != _ffi.NULL else None -def same_temporal_temporal( - temp1: "const Temporal *", temp2: "const Temporal *" -) -> "bool": +def nad_tfloat_tfloat( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[float, "double"]: temp1_converted = _ffi.cast("const Temporal *", temp1) temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.same_temporal_temporal(temp1_converted, temp2_converted) + result = _lib.nad_tfloat_tfloat(temp1_converted, temp2_converted) _check_error() return result if result != _ffi.NULL else None -def same_temporal_tstzspan(temp: "const Temporal *", s: "const Span *") -> "bool": +def nad_tfloat_tbox( + temp: Annotated[_ffi.CData, "const Temporal *"], box: Annotated[_ffi.CData, "const TBox *"] +) -> Annotated[float, "double"]: temp_converted = _ffi.cast("const Temporal *", temp) - s_converted = _ffi.cast("const Span *", s) - result = _lib.same_temporal_tstzspan(temp_converted, s_converted) + box_converted = _ffi.cast("const TBox *", box) + result = _lib.nad_tfloat_tbox(temp_converted, box_converted) _check_error() return result if result != _ffi.NULL else None -def same_tnumber_numspan(temp: "const Temporal *", s: "const Span *") -> "bool": +def nad_tint_int(temp: Annotated[_ffi.CData, "const Temporal *"], i: int) -> Annotated[int, "int"]: temp_converted = _ffi.cast("const Temporal *", temp) - s_converted = _ffi.cast("const Span *", s) - result = _lib.same_tnumber_numspan(temp_converted, s_converted) + result = _lib.nad_tint_int(temp_converted, i) _check_error() return result if result != _ffi.NULL else None -def same_tnumber_tbox(temp: "const Temporal *", box: "const TBox *") -> "bool": +def nad_tint_tbox( + temp: Annotated[_ffi.CData, "const Temporal *"], box: Annotated[_ffi.CData, "const TBox *"] +) -> Annotated[int, "int"]: temp_converted = _ffi.cast("const Temporal *", temp) box_converted = _ffi.cast("const TBox *", box) - result = _lib.same_tnumber_tbox(temp_converted, box_converted) + result = _lib.nad_tint_tbox(temp_converted, box_converted) _check_error() return result if result != _ffi.NULL else None -def same_tnumber_tnumber( - temp1: "const Temporal *", temp2: "const Temporal *" -) -> "bool": +def nad_tint_tint( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[int, "int"]: temp1_converted = _ffi.cast("const Temporal *", temp1) temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.same_tnumber_tnumber(temp1_converted, temp2_converted) + result = _lib.nad_tint_tint(temp1_converted, temp2_converted) _check_error() return result if result != _ffi.NULL else None -def same_tpoint_stbox(temp: "const Temporal *", box: "const STBox *") -> "bool": +def tbool_tand_transfn( + state: Annotated[_ffi.CData, "SkipList *"] | None, temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[_ffi.CData, "SkipList *"]: + state_converted = _ffi.cast("SkipList *", state) if state is not None else _ffi.NULL temp_converted = _ffi.cast("const Temporal *", temp) - box_converted = _ffi.cast("const STBox *", box) - result = _lib.same_tpoint_stbox(temp_converted, box_converted) + result = _lib.tbool_tand_transfn(state_converted, temp_converted) _check_error() return result if result != _ffi.NULL else None -def same_tpoint_tpoint(temp1: "const Temporal *", temp2: "const Temporal *") -> "bool": - temp1_converted = _ffi.cast("const Temporal *", temp1) - temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.same_tpoint_tpoint(temp1_converted, temp2_converted) +def tbool_tor_transfn( + state: Annotated[_ffi.CData, "SkipList *"] | None, temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[_ffi.CData, "SkipList *"]: + state_converted = _ffi.cast("SkipList *", state) if state is not None else _ffi.NULL + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.tbool_tor_transfn(state_converted, temp_converted) _check_error() return result if result != _ffi.NULL else None -def same_tstzspan_temporal(s: "const Span *", temp: "const Temporal *") -> "bool": - s_converted = _ffi.cast("const Span *", s) +def temporal_extent_transfn( + s: Annotated[_ffi.CData, "Span *"], temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[_ffi.CData, "Span *"]: + s_converted = _ffi.cast("Span *", s) temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.same_tstzspan_temporal(s_converted, temp_converted) + result = _lib.temporal_extent_transfn(s_converted, temp_converted) _check_error() return result if result != _ffi.NULL else None -def above_stbox_tpoint(box: "const STBox *", temp: "const Temporal *") -> "bool": - box_converted = _ffi.cast("const STBox *", box) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.above_stbox_tpoint(box_converted, temp_converted) +def temporal_tagg_finalfn(state: Annotated[_ffi.CData, "SkipList *"]) -> Annotated[_ffi.CData, "Temporal *"]: + state_converted = _ffi.cast("SkipList *", state) + result = _lib.temporal_tagg_finalfn(state_converted) _check_error() return result if result != _ffi.NULL else None -def above_tpoint_stbox(temp: "const Temporal *", box: "const STBox *") -> "bool": +def temporal_tcount_transfn( + state: Annotated[_ffi.CData, "SkipList *"] | None, temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[_ffi.CData, "SkipList *"]: + state_converted = _ffi.cast("SkipList *", state) if state is not None else _ffi.NULL temp_converted = _ffi.cast("const Temporal *", temp) - box_converted = _ffi.cast("const STBox *", box) - result = _lib.above_tpoint_stbox(temp_converted, box_converted) + result = _lib.temporal_tcount_transfn(state_converted, temp_converted) _check_error() return result if result != _ffi.NULL else None -def above_tpoint_tpoint(temp1: "const Temporal *", temp2: "const Temporal *") -> "bool": - temp1_converted = _ffi.cast("const Temporal *", temp1) - temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.above_tpoint_tpoint(temp1_converted, temp2_converted) +def tfloat_tmax_transfn( + state: Annotated[_ffi.CData, "SkipList *"] | None, temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[_ffi.CData, "SkipList *"]: + state_converted = _ffi.cast("SkipList *", state) if state is not None else _ffi.NULL + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.tfloat_tmax_transfn(state_converted, temp_converted) _check_error() return result if result != _ffi.NULL else None -def after_stbox_tpoint(box: "const STBox *", temp: "const Temporal *") -> "bool": - box_converted = _ffi.cast("const STBox *", box) +def tfloat_tmin_transfn( + state: Annotated[_ffi.CData, "SkipList *"] | None, temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[_ffi.CData, "SkipList *"]: + state_converted = _ffi.cast("SkipList *", state) if state is not None else _ffi.NULL temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.after_stbox_tpoint(box_converted, temp_converted) + result = _lib.tfloat_tmin_transfn(state_converted, temp_converted) _check_error() return result if result != _ffi.NULL else None -def after_tbox_tnumber(box: "const TBox *", temp: "const Temporal *") -> "bool": - box_converted = _ffi.cast("const TBox *", box) +def tfloat_tsum_transfn( + state: Annotated[_ffi.CData, "SkipList *"] | None, temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[_ffi.CData, "SkipList *"]: + state_converted = _ffi.cast("SkipList *", state) if state is not None else _ffi.NULL temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.after_tbox_tnumber(box_converted, temp_converted) + result = _lib.tfloat_tsum_transfn(state_converted, temp_converted) _check_error() return result if result != _ffi.NULL else None -def after_temporal_tstzspan(temp: "const Temporal *", s: "const Span *") -> "bool": +def tfloat_wmax_transfn( + state: Annotated[_ffi.CData, "SkipList *"], + temp: Annotated[_ffi.CData, "const Temporal *"], + interv: Annotated[_ffi.CData, "const Interval *"], +) -> Annotated[_ffi.CData, "SkipList *"]: + state_converted = _ffi.cast("SkipList *", state) temp_converted = _ffi.cast("const Temporal *", temp) - s_converted = _ffi.cast("const Span *", s) - result = _lib.after_temporal_tstzspan(temp_converted, s_converted) + interv_converted = _ffi.cast("const Interval *", interv) + result = _lib.tfloat_wmax_transfn(state_converted, temp_converted, interv_converted) _check_error() return result if result != _ffi.NULL else None -def after_temporal_temporal( - temp1: "const Temporal *", temp2: "const Temporal *" -) -> "bool": - temp1_converted = _ffi.cast("const Temporal *", temp1) - temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.after_temporal_temporal(temp1_converted, temp2_converted) +def tfloat_wmin_transfn( + state: Annotated[_ffi.CData, "SkipList *"], + temp: Annotated[_ffi.CData, "const Temporal *"], + interv: Annotated[_ffi.CData, "const Interval *"], +) -> Annotated[_ffi.CData, "SkipList *"]: + state_converted = _ffi.cast("SkipList *", state) + temp_converted = _ffi.cast("const Temporal *", temp) + interv_converted = _ffi.cast("const Interval *", interv) + result = _lib.tfloat_wmin_transfn(state_converted, temp_converted, interv_converted) _check_error() return result if result != _ffi.NULL else None -def after_tnumber_tbox(temp: "const Temporal *", box: "const TBox *") -> "bool": +def tfloat_wsum_transfn( + state: Annotated[_ffi.CData, "SkipList *"], + temp: Annotated[_ffi.CData, "const Temporal *"], + interv: Annotated[_ffi.CData, "const Interval *"], +) -> Annotated[_ffi.CData, "SkipList *"]: + state_converted = _ffi.cast("SkipList *", state) temp_converted = _ffi.cast("const Temporal *", temp) - box_converted = _ffi.cast("const TBox *", box) - result = _lib.after_tnumber_tbox(temp_converted, box_converted) + interv_converted = _ffi.cast("const Interval *", interv) + result = _lib.tfloat_wsum_transfn(state_converted, temp_converted, interv_converted) _check_error() return result if result != _ffi.NULL else None -def after_tnumber_tnumber( - temp1: "const Temporal *", temp2: "const Temporal *" -) -> "bool": - temp1_converted = _ffi.cast("const Temporal *", temp1) - temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.after_tnumber_tnumber(temp1_converted, temp2_converted) +def timestamptz_tcount_transfn( + state: Annotated[_ffi.CData, "SkipList *"] | None, t: int +) -> Annotated[_ffi.CData, "SkipList *"]: + state_converted = _ffi.cast("SkipList *", state) if state is not None else _ffi.NULL + t_converted = _ffi.cast("TimestampTz", t) + result = _lib.timestamptz_tcount_transfn(state_converted, t_converted) _check_error() return result if result != _ffi.NULL else None -def after_tpoint_stbox(temp: "const Temporal *", box: "const STBox *") -> "bool": +def tint_tmax_transfn( + state: Annotated[_ffi.CData, "SkipList *"] | None, temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[_ffi.CData, "SkipList *"]: + state_converted = _ffi.cast("SkipList *", state) if state is not None else _ffi.NULL temp_converted = _ffi.cast("const Temporal *", temp) - box_converted = _ffi.cast("const STBox *", box) - result = _lib.after_tpoint_stbox(temp_converted, box_converted) + result = _lib.tint_tmax_transfn(state_converted, temp_converted) _check_error() return result if result != _ffi.NULL else None -def after_tpoint_tpoint(temp1: "const Temporal *", temp2: "const Temporal *") -> "bool": - temp1_converted = _ffi.cast("const Temporal *", temp1) - temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.after_tpoint_tpoint(temp1_converted, temp2_converted) +def tint_tmin_transfn( + state: Annotated[_ffi.CData, "SkipList *"] | None, temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[_ffi.CData, "SkipList *"]: + state_converted = _ffi.cast("SkipList *", state) if state is not None else _ffi.NULL + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.tint_tmin_transfn(state_converted, temp_converted) _check_error() return result if result != _ffi.NULL else None -def after_tstzspan_temporal(s: "const Span *", temp: "const Temporal *") -> "bool": - s_converted = _ffi.cast("const Span *", s) +def tint_tsum_transfn( + state: Annotated[_ffi.CData, "SkipList *"] | None, temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[_ffi.CData, "SkipList *"]: + state_converted = _ffi.cast("SkipList *", state) if state is not None else _ffi.NULL temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.after_tstzspan_temporal(s_converted, temp_converted) + result = _lib.tint_tsum_transfn(state_converted, temp_converted) _check_error() return result if result != _ffi.NULL else None -def back_stbox_tpoint(box: "const STBox *", temp: "const Temporal *") -> "bool": - box_converted = _ffi.cast("const STBox *", box) +def tint_wmax_transfn( + state: Annotated[_ffi.CData, "SkipList *"], + temp: Annotated[_ffi.CData, "const Temporal *"], + interv: Annotated[_ffi.CData, "const Interval *"], +) -> Annotated[_ffi.CData, "SkipList *"]: + state_converted = _ffi.cast("SkipList *", state) temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.back_stbox_tpoint(box_converted, temp_converted) + interv_converted = _ffi.cast("const Interval *", interv) + result = _lib.tint_wmax_transfn(state_converted, temp_converted, interv_converted) _check_error() return result if result != _ffi.NULL else None -def back_tpoint_stbox(temp: "const Temporal *", box: "const STBox *") -> "bool": +def tint_wmin_transfn( + state: Annotated[_ffi.CData, "SkipList *"], + temp: Annotated[_ffi.CData, "const Temporal *"], + interv: Annotated[_ffi.CData, "const Interval *"], +) -> Annotated[_ffi.CData, "SkipList *"]: + state_converted = _ffi.cast("SkipList *", state) temp_converted = _ffi.cast("const Temporal *", temp) - box_converted = _ffi.cast("const STBox *", box) - result = _lib.back_tpoint_stbox(temp_converted, box_converted) + interv_converted = _ffi.cast("const Interval *", interv) + result = _lib.tint_wmin_transfn(state_converted, temp_converted, interv_converted) _check_error() return result if result != _ffi.NULL else None -def back_tpoint_tpoint(temp1: "const Temporal *", temp2: "const Temporal *") -> "bool": - temp1_converted = _ffi.cast("const Temporal *", temp1) - temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.back_tpoint_tpoint(temp1_converted, temp2_converted) +def tint_wsum_transfn( + state: Annotated[_ffi.CData, "SkipList *"], + temp: Annotated[_ffi.CData, "const Temporal *"], + interv: Annotated[_ffi.CData, "const Interval *"], +) -> Annotated[_ffi.CData, "SkipList *"]: + state_converted = _ffi.cast("SkipList *", state) + temp_converted = _ffi.cast("const Temporal *", temp) + interv_converted = _ffi.cast("const Interval *", interv) + result = _lib.tint_wsum_transfn(state_converted, temp_converted, interv_converted) _check_error() return result if result != _ffi.NULL else None -def before_stbox_tpoint(box: "const STBox *", temp: "const Temporal *") -> "bool": - box_converted = _ffi.cast("const STBox *", box) +def tnumber_extent_transfn( + box: Annotated[_ffi.CData, "TBox *"] | None, temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[_ffi.CData, "TBox *"]: + box_converted = _ffi.cast("TBox *", box) if box is not None else _ffi.NULL temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.before_stbox_tpoint(box_converted, temp_converted) + result = _lib.tnumber_extent_transfn(box_converted, temp_converted) _check_error() return result if result != _ffi.NULL else None -def before_tbox_tnumber(box: "const TBox *", temp: "const Temporal *") -> "bool": - box_converted = _ffi.cast("const TBox *", box) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.before_tbox_tnumber(box_converted, temp_converted) +def tnumber_tavg_finalfn(state: Annotated[_ffi.CData, "SkipList *"]) -> Annotated[_ffi.CData, "Temporal *"]: + state_converted = _ffi.cast("SkipList *", state) + result = _lib.tnumber_tavg_finalfn(state_converted) _check_error() return result if result != _ffi.NULL else None -def before_temporal_tstzspan(temp: "const Temporal *", s: "const Span *") -> "bool": +def tnumber_tavg_transfn( + state: Annotated[_ffi.CData, "SkipList *"] | None, temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[_ffi.CData, "SkipList *"]: + state_converted = _ffi.cast("SkipList *", state) if state is not None else _ffi.NULL temp_converted = _ffi.cast("const Temporal *", temp) - s_converted = _ffi.cast("const Span *", s) - result = _lib.before_temporal_tstzspan(temp_converted, s_converted) + result = _lib.tnumber_tavg_transfn(state_converted, temp_converted) _check_error() return result if result != _ffi.NULL else None -def before_temporal_temporal( - temp1: "const Temporal *", temp2: "const Temporal *" -) -> "bool": - temp1_converted = _ffi.cast("const Temporal *", temp1) - temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.before_temporal_temporal(temp1_converted, temp2_converted) +def tnumber_wavg_transfn( + state: Annotated[_ffi.CData, "SkipList *"], + temp: Annotated[_ffi.CData, "const Temporal *"], + interv: Annotated[_ffi.CData, "const Interval *"], +) -> Annotated[_ffi.CData, "SkipList *"]: + state_converted = _ffi.cast("SkipList *", state) + temp_converted = _ffi.cast("const Temporal *", temp) + interv_converted = _ffi.cast("const Interval *", interv) + result = _lib.tnumber_wavg_transfn(state_converted, temp_converted, interv_converted) _check_error() return result if result != _ffi.NULL else None -def before_tnumber_tbox(temp: "const Temporal *", box: "const TBox *") -> "bool": - temp_converted = _ffi.cast("const Temporal *", temp) - box_converted = _ffi.cast("const TBox *", box) - result = _lib.before_tnumber_tbox(temp_converted, box_converted) +def tstzset_tcount_transfn( + state: Annotated[_ffi.CData, "SkipList *"] | None, s: Annotated[_ffi.CData, "const Set *"] +) -> Annotated[_ffi.CData, "SkipList *"]: + state_converted = _ffi.cast("SkipList *", state) if state is not None else _ffi.NULL + s_converted = _ffi.cast("const Set *", s) + result = _lib.tstzset_tcount_transfn(state_converted, s_converted) _check_error() return result if result != _ffi.NULL else None -def before_tnumber_tnumber( - temp1: "const Temporal *", temp2: "const Temporal *" -) -> "bool": - temp1_converted = _ffi.cast("const Temporal *", temp1) - temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.before_tnumber_tnumber(temp1_converted, temp2_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def before_tpoint_stbox(temp: "const Temporal *", box: "const STBox *") -> "bool": - temp_converted = _ffi.cast("const Temporal *", temp) - box_converted = _ffi.cast("const STBox *", box) - result = _lib.before_tpoint_stbox(temp_converted, box_converted) +def tstzspan_tcount_transfn( + state: Annotated[_ffi.CData, "SkipList *"] | None, s: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[_ffi.CData, "SkipList *"]: + state_converted = _ffi.cast("SkipList *", state) if state is not None else _ffi.NULL + s_converted = _ffi.cast("const Span *", s) + result = _lib.tstzspan_tcount_transfn(state_converted, s_converted) _check_error() return result if result != _ffi.NULL else None -def before_tpoint_tpoint( - temp1: "const Temporal *", temp2: "const Temporal *" -) -> "bool": - temp1_converted = _ffi.cast("const Temporal *", temp1) - temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.before_tpoint_tpoint(temp1_converted, temp2_converted) +def tstzspanset_tcount_transfn( + state: Annotated[_ffi.CData, "SkipList *"] | None, ss: Annotated[_ffi.CData, "const SpanSet *"] +) -> Annotated[_ffi.CData, "SkipList *"]: + state_converted = _ffi.cast("SkipList *", state) if state is not None else _ffi.NULL + ss_converted = _ffi.cast("const SpanSet *", ss) + result = _lib.tstzspanset_tcount_transfn(state_converted, ss_converted) _check_error() return result if result != _ffi.NULL else None -def before_tstzspan_temporal(s: "const Span *", temp: "const Temporal *") -> "bool": - s_converted = _ffi.cast("const Span *", s) +def ttext_tmax_transfn( + state: Annotated[_ffi.CData, "SkipList *"] | None, temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[_ffi.CData, "SkipList *"]: + state_converted = _ffi.cast("SkipList *", state) if state is not None else _ffi.NULL temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.before_tstzspan_temporal(s_converted, temp_converted) + result = _lib.ttext_tmax_transfn(state_converted, temp_converted) _check_error() return result if result != _ffi.NULL else None -def below_stbox_tpoint(box: "const STBox *", temp: "const Temporal *") -> "bool": - box_converted = _ffi.cast("const STBox *", box) +def ttext_tmin_transfn( + state: Annotated[_ffi.CData, "SkipList *"] | None, temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[_ffi.CData, "SkipList *"]: + state_converted = _ffi.cast("SkipList *", state) if state is not None else _ffi.NULL temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.below_stbox_tpoint(box_converted, temp_converted) + result = _lib.ttext_tmin_transfn(state_converted, temp_converted) _check_error() return result if result != _ffi.NULL else None -def below_tpoint_stbox(temp: "const Temporal *", box: "const STBox *") -> "bool": +def temporal_simplify_dp( + temp: Annotated[_ffi.CData, "const Temporal *"], eps_dist: float, synchronized: bool +) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - box_converted = _ffi.cast("const STBox *", box) - result = _lib.below_tpoint_stbox(temp_converted, box_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def below_tpoint_tpoint(temp1: "const Temporal *", temp2: "const Temporal *") -> "bool": - temp1_converted = _ffi.cast("const Temporal *", temp1) - temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.below_tpoint_tpoint(temp1_converted, temp2_converted) + result = _lib.temporal_simplify_dp(temp_converted, eps_dist, synchronized) _check_error() return result if result != _ffi.NULL else None -def front_stbox_tpoint(box: "const STBox *", temp: "const Temporal *") -> "bool": - box_converted = _ffi.cast("const STBox *", box) +def temporal_simplify_max_dist( + temp: Annotated[_ffi.CData, "const Temporal *"], eps_dist: float, synchronized: bool +) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.front_stbox_tpoint(box_converted, temp_converted) + result = _lib.temporal_simplify_max_dist(temp_converted, eps_dist, synchronized) _check_error() return result if result != _ffi.NULL else None -def front_tpoint_stbox(temp: "const Temporal *", box: "const STBox *") -> "bool": +def temporal_simplify_min_dist( + temp: Annotated[_ffi.CData, "const Temporal *"], dist: float +) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - box_converted = _ffi.cast("const STBox *", box) - result = _lib.front_tpoint_stbox(temp_converted, box_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def front_tpoint_tpoint(temp1: "const Temporal *", temp2: "const Temporal *") -> "bool": - temp1_converted = _ffi.cast("const Temporal *", temp1) - temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.front_tpoint_tpoint(temp1_converted, temp2_converted) + result = _lib.temporal_simplify_min_dist(temp_converted, dist) _check_error() return result if result != _ffi.NULL else None -def left_stbox_tpoint(box: "const STBox *", temp: "const Temporal *") -> "bool": - box_converted = _ffi.cast("const STBox *", box) +def temporal_simplify_min_tdelta( + temp: Annotated[_ffi.CData, "const Temporal *"], mint: Annotated[_ffi.CData, "const Interval *"] +) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.left_stbox_tpoint(box_converted, temp_converted) + mint_converted = _ffi.cast("const Interval *", mint) + result = _lib.temporal_simplify_min_tdelta(temp_converted, mint_converted) _check_error() return result if result != _ffi.NULL else None -def left_tbox_tnumber(box: "const TBox *", temp: "const Temporal *") -> "bool": - box_converted = _ffi.cast("const TBox *", box) +def temporal_tprecision( + temp: Annotated[_ffi.CData, "const Temporal *"], duration: Annotated[_ffi.CData, "const Interval *"], origin: int +) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.left_tbox_tnumber(box_converted, temp_converted) + duration_converted = _ffi.cast("const Interval *", duration) + origin_converted = _ffi.cast("TimestampTz", origin) + result = _lib.temporal_tprecision(temp_converted, duration_converted, origin_converted) _check_error() return result if result != _ffi.NULL else None -def left_numspan_tnumber(s: "const Span *", temp: "const Temporal *") -> "bool": - s_converted = _ffi.cast("const Span *", s) +def temporal_tsample( + temp: Annotated[_ffi.CData, "const Temporal *"], + duration: Annotated[_ffi.CData, "const Interval *"], + origin: int, + interp: InterpolationType, +) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.left_numspan_tnumber(s_converted, temp_converted) + duration_converted = _ffi.cast("const Interval *", duration) + origin_converted = _ffi.cast("TimestampTz", origin) + result = _lib.temporal_tsample(temp_converted, duration_converted, origin_converted, interp) _check_error() return result if result != _ffi.NULL else None -def left_tnumber_numspan(temp: "const Temporal *", s: "const Span *") -> "bool": - temp_converted = _ffi.cast("const Temporal *", temp) - s_converted = _ffi.cast("const Span *", s) - result = _lib.left_tnumber_numspan(temp_converted, s_converted) +def temporal_dyntimewarp_distance( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[float, "double"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.temporal_dyntimewarp_distance(temp1_converted, temp2_converted) _check_error() return result if result != _ffi.NULL else None -def left_tnumber_tbox(temp: "const Temporal *", box: "const TBox *") -> "bool": - temp_converted = _ffi.cast("const Temporal *", temp) - box_converted = _ffi.cast("const TBox *", box) - result = _lib.left_tnumber_tbox(temp_converted, box_converted) +def temporal_dyntimewarp_path( + temp1: Annotated[_ffi.CData, "const Temporal *"], + temp2: Annotated[_ffi.CData, "const Temporal *"], + count: Annotated[_ffi.CData, "int *"], +) -> Annotated[_ffi.CData, "Match *"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + count_converted = _ffi.cast("int *", count) + result = _lib.temporal_dyntimewarp_path(temp1_converted, temp2_converted, count_converted) _check_error() return result if result != _ffi.NULL else None -def left_tnumber_tnumber( - temp1: "const Temporal *", temp2: "const Temporal *" -) -> "bool": +def temporal_frechet_distance( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[float, "double"]: temp1_converted = _ffi.cast("const Temporal *", temp1) temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.left_tnumber_tnumber(temp1_converted, temp2_converted) + result = _lib.temporal_frechet_distance(temp1_converted, temp2_converted) _check_error() return result if result != _ffi.NULL else None -def left_tpoint_stbox(temp: "const Temporal *", box: "const STBox *") -> "bool": - temp_converted = _ffi.cast("const Temporal *", temp) - box_converted = _ffi.cast("const STBox *", box) - result = _lib.left_tpoint_stbox(temp_converted, box_converted) +def temporal_frechet_path( + temp1: Annotated[_ffi.CData, "const Temporal *"], + temp2: Annotated[_ffi.CData, "const Temporal *"], + count: Annotated[_ffi.CData, "int *"], +) -> Annotated[_ffi.CData, "Match *"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + count_converted = _ffi.cast("int *", count) + result = _lib.temporal_frechet_path(temp1_converted, temp2_converted, count_converted) _check_error() return result if result != _ffi.NULL else None -def left_tpoint_tpoint(temp1: "const Temporal *", temp2: "const Temporal *") -> "bool": +def temporal_hausdorff_distance( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[float, "double"]: temp1_converted = _ffi.cast("const Temporal *", temp1) temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.left_tpoint_tpoint(temp1_converted, temp2_converted) + result = _lib.temporal_hausdorff_distance(temp1_converted, temp2_converted) _check_error() return result if result != _ffi.NULL else None -def overabove_stbox_tpoint(box: "const STBox *", temp: "const Temporal *") -> "bool": - box_converted = _ffi.cast("const STBox *", box) +def temporal_time_bins( + temp: Annotated[_ffi.CData, "const Temporal *"], + duration: Annotated[_ffi.CData, "const Interval *"], + origin: int, + count: Annotated[_ffi.CData, "int *"], +) -> Annotated[_ffi.CData, "Span *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.overabove_stbox_tpoint(box_converted, temp_converted) + duration_converted = _ffi.cast("const Interval *", duration) + origin_converted = _ffi.cast("TimestampTz", origin) + count_converted = _ffi.cast("int *", count) + result = _lib.temporal_time_bins(temp_converted, duration_converted, origin_converted, count_converted) _check_error() return result if result != _ffi.NULL else None -def overabove_tpoint_stbox(temp: "const Temporal *", box: "const STBox *") -> "bool": +def temporal_time_split( + temp: Annotated[_ffi.CData, "const Temporal *"], duration: Annotated[_ffi.CData, "const Interval *"], torigin: int +) -> tuple[Annotated[_ffi.CData, "Temporal **"], Annotated[list, "TimestampTz *"], Annotated[_ffi.CData, "int"]]: temp_converted = _ffi.cast("const Temporal *", temp) - box_converted = _ffi.cast("const STBox *", box) - result = _lib.overabove_tpoint_stbox(temp_converted, box_converted) + duration_converted = _ffi.cast("const Interval *", duration) + torigin_converted = _ffi.cast("TimestampTz", torigin) + time_bins = _ffi.new("TimestampTz **") + count = _ffi.new("int *") + result = _lib.temporal_time_split(temp_converted, duration_converted, torigin_converted, time_bins, count) _check_error() - return result if result != _ffi.NULL else None + return result if result != _ffi.NULL else None, time_bins[0], count[0] -def overabove_tpoint_tpoint( - temp1: "const Temporal *", temp2: "const Temporal *" -) -> "bool": - temp1_converted = _ffi.cast("const Temporal *", temp1) - temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.overabove_tpoint_tpoint(temp1_converted, temp2_converted) +def tfloat_time_boxes( + temp: Annotated[_ffi.CData, "const Temporal *"], + duration: Annotated[_ffi.CData, "const Interval *"], + torigin: int, + count: Annotated[_ffi.CData, "int *"], +) -> Annotated[_ffi.CData, "TBox *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + duration_converted = _ffi.cast("const Interval *", duration) + torigin_converted = _ffi.cast("TimestampTz", torigin) + count_converted = _ffi.cast("int *", count) + result = _lib.tfloat_time_boxes(temp_converted, duration_converted, torigin_converted, count_converted) _check_error() return result if result != _ffi.NULL else None -def overafter_stbox_tpoint(box: "const STBox *", temp: "const Temporal *") -> "bool": - box_converted = _ffi.cast("const STBox *", box) +def tfloat_value_bins( + temp: Annotated[_ffi.CData, "const Temporal *"], vsize: float, vorigin: float, count: Annotated[_ffi.CData, "int *"] +) -> Annotated[_ffi.CData, "Span *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.overafter_stbox_tpoint(box_converted, temp_converted) + count_converted = _ffi.cast("int *", count) + result = _lib.tfloat_value_bins(temp_converted, vsize, vorigin, count_converted) _check_error() return result if result != _ffi.NULL else None -def overafter_tbox_tnumber(box: "const TBox *", temp: "const Temporal *") -> "bool": - box_converted = _ffi.cast("const TBox *", box) +def tfloat_value_boxes( + temp: Annotated[_ffi.CData, "const Temporal *"], vsize: float, vorigin: float, count: Annotated[_ffi.CData, "int *"] +) -> Annotated[_ffi.CData, "TBox *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.overafter_tbox_tnumber(box_converted, temp_converted) + count_converted = _ffi.cast("int *", count) + result = _lib.tfloat_value_boxes(temp_converted, vsize, vorigin, count_converted) _check_error() return result if result != _ffi.NULL else None -def overafter_temporal_tstzspan(temp: "const Temporal *", s: "const Span *") -> "bool": +def tfloat_value_split( + temp: Annotated[_ffi.CData, "const Temporal *"], size: float, origin: float +) -> tuple[Annotated[_ffi.CData, "Temporal **"], Annotated[list, "double *"], Annotated[_ffi.CData, "int"]]: temp_converted = _ffi.cast("const Temporal *", temp) - s_converted = _ffi.cast("const Span *", s) - result = _lib.overafter_temporal_tstzspan(temp_converted, s_converted) + bins = _ffi.new("double **") + count = _ffi.new("int *") + result = _lib.tfloat_value_split(temp_converted, size, origin, bins, count) _check_error() - return result if result != _ffi.NULL else None + return result if result != _ffi.NULL else None, bins[0], count[0] -def overafter_temporal_temporal( - temp1: "const Temporal *", temp2: "const Temporal *" -) -> "bool": - temp1_converted = _ffi.cast("const Temporal *", temp1) - temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.overafter_temporal_temporal(temp1_converted, temp2_converted) +def tfloat_value_time_boxes( + temp: Annotated[_ffi.CData, "const Temporal *"], + vsize: float, + duration: Annotated[_ffi.CData, "const Interval *"], + vorigin: float, + torigin: int, + count: Annotated[_ffi.CData, "int *"], +) -> Annotated[_ffi.CData, "TBox *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + duration_converted = _ffi.cast("const Interval *", duration) + torigin_converted = _ffi.cast("TimestampTz", torigin) + count_converted = _ffi.cast("int *", count) + result = _lib.tfloat_value_time_boxes( + temp_converted, vsize, duration_converted, vorigin, torigin_converted, count_converted + ) _check_error() return result if result != _ffi.NULL else None -def overafter_tnumber_tbox(temp: "const Temporal *", box: "const TBox *") -> "bool": +def tfloat_value_time_split( + temp: Annotated[_ffi.CData, "const Temporal *"], + vsize: float, + duration: Annotated[_ffi.CData, "const Interval *"], + vorigin: float, + torigin: int, +) -> tuple[ + Annotated[_ffi.CData, "Temporal **"], + Annotated[list, "double *"], + Annotated[list, "TimestampTz *"], + Annotated[_ffi.CData, "int"], +]: temp_converted = _ffi.cast("const Temporal *", temp) - box_converted = _ffi.cast("const TBox *", box) - result = _lib.overafter_tnumber_tbox(temp_converted, box_converted) + duration_converted = _ffi.cast("const Interval *", duration) + torigin_converted = _ffi.cast("TimestampTz", torigin) + value_bins = _ffi.new("double **") + time_bins = _ffi.new("TimestampTz **") + count = _ffi.new("int *") + result = _lib.tfloat_value_time_split( + temp_converted, vsize, duration_converted, vorigin, torigin_converted, value_bins, time_bins, count + ) _check_error() - return result if result != _ffi.NULL else None + return result if result != _ffi.NULL else None, value_bins[0], time_bins[0], count[0] -def overafter_tnumber_tnumber( - temp1: "const Temporal *", temp2: "const Temporal *" -) -> "bool": - temp1_converted = _ffi.cast("const Temporal *", temp1) - temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.overafter_tnumber_tnumber(temp1_converted, temp2_converted) +def tfloatbox_time_tiles( + box: Annotated[_ffi.CData, "const TBox *"], + duration: Annotated[_ffi.CData, "const Interval *"], + torigin: int, + count: Annotated[_ffi.CData, "int *"], +) -> Annotated[_ffi.CData, "TBox *"]: + box_converted = _ffi.cast("const TBox *", box) + duration_converted = _ffi.cast("const Interval *", duration) + torigin_converted = _ffi.cast("TimestampTz", torigin) + count_converted = _ffi.cast("int *", count) + result = _lib.tfloatbox_time_tiles(box_converted, duration_converted, torigin_converted, count_converted) _check_error() return result if result != _ffi.NULL else None -def overafter_tpoint_stbox(temp: "const Temporal *", box: "const STBox *") -> "bool": - temp_converted = _ffi.cast("const Temporal *", temp) - box_converted = _ffi.cast("const STBox *", box) - result = _lib.overafter_tpoint_stbox(temp_converted, box_converted) +def tfloatbox_value_tiles( + box: Annotated[_ffi.CData, "const TBox *"], vsize: float, vorigin: float, count: Annotated[_ffi.CData, "int *"] +) -> Annotated[_ffi.CData, "TBox *"]: + box_converted = _ffi.cast("const TBox *", box) + count_converted = _ffi.cast("int *", count) + result = _lib.tfloatbox_value_tiles(box_converted, vsize, vorigin, count_converted) _check_error() return result if result != _ffi.NULL else None -def overafter_tpoint_tpoint( - temp1: "const Temporal *", temp2: "const Temporal *" -) -> "bool": - temp1_converted = _ffi.cast("const Temporal *", temp1) - temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.overafter_tpoint_tpoint(temp1_converted, temp2_converted) +def tfloatbox_value_time_tiles( + box: Annotated[_ffi.CData, "const TBox *"], + vsize: float, + duration: Annotated[_ffi.CData, "const Interval *"], + vorigin: float, + torigin: int | None, +) -> tuple[Annotated[_ffi.CData, "TBox *"], Annotated[_ffi.CData, "int"]]: + box_converted = _ffi.cast("const TBox *", box) + duration_converted = _ffi.cast("const Interval *", duration) + torigin_converted = _ffi.cast("TimestampTz", torigin) if torigin is not None else _ffi.NULL + count = _ffi.new("int *") + result = _lib.tfloatbox_value_time_tiles( + box_converted, vsize, duration_converted, vorigin, torigin_converted, count + ) _check_error() - return result if result != _ffi.NULL else None + return result if result != _ffi.NULL else None, count[0] -def overafter_tstzspan_temporal(s: "const Span *", temp: "const Temporal *") -> "bool": - s_converted = _ffi.cast("const Span *", s) +def tint_time_boxes( + temp: Annotated[_ffi.CData, "const Temporal *"], + duration: Annotated[_ffi.CData, "const Interval *"], + torigin: int, + count: Annotated[_ffi.CData, "int *"], +) -> Annotated[_ffi.CData, "TBox *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.overafter_tstzspan_temporal(s_converted, temp_converted) + duration_converted = _ffi.cast("const Interval *", duration) + torigin_converted = _ffi.cast("TimestampTz", torigin) + count_converted = _ffi.cast("int *", count) + result = _lib.tint_time_boxes(temp_converted, duration_converted, torigin_converted, count_converted) _check_error() return result if result != _ffi.NULL else None -def overback_stbox_tpoint(box: "const STBox *", temp: "const Temporal *") -> "bool": - box_converted = _ffi.cast("const STBox *", box) +def tint_value_bins( + temp: Annotated[_ffi.CData, "const Temporal *"], vsize: int, vorigin: int, count: Annotated[_ffi.CData, "int *"] +) -> Annotated[_ffi.CData, "Span *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.overback_stbox_tpoint(box_converted, temp_converted) + count_converted = _ffi.cast("int *", count) + result = _lib.tint_value_bins(temp_converted, vsize, vorigin, count_converted) _check_error() return result if result != _ffi.NULL else None -def overback_tpoint_stbox(temp: "const Temporal *", box: "const STBox *") -> "bool": +def tint_value_boxes( + temp: Annotated[_ffi.CData, "const Temporal *"], vsize: int, vorigin: int, count: Annotated[_ffi.CData, "int *"] +) -> Annotated[_ffi.CData, "TBox *"]: temp_converted = _ffi.cast("const Temporal *", temp) - box_converted = _ffi.cast("const STBox *", box) - result = _lib.overback_tpoint_stbox(temp_converted, box_converted) + count_converted = _ffi.cast("int *", count) + result = _lib.tint_value_boxes(temp_converted, vsize, vorigin, count_converted) _check_error() return result if result != _ffi.NULL else None -def overback_tpoint_tpoint( - temp1: "const Temporal *", temp2: "const Temporal *" -) -> "bool": - temp1_converted = _ffi.cast("const Temporal *", temp1) - temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.overback_tpoint_tpoint(temp1_converted, temp2_converted) +def tint_value_split( + temp: Annotated[_ffi.CData, "const Temporal *"], vsize: int, vorigin: int +) -> tuple[Annotated[_ffi.CData, "Temporal **"], Annotated[list, "int *"], Annotated[_ffi.CData, "int"]]: + temp_converted = _ffi.cast("const Temporal *", temp) + bins = _ffi.new("int **") + count = _ffi.new("int *") + result = _lib.tint_value_split(temp_converted, vsize, vorigin, bins, count) _check_error() - return result if result != _ffi.NULL else None + return result if result != _ffi.NULL else None, bins[0], count[0] -def overbefore_stbox_tpoint(box: "const STBox *", temp: "const Temporal *") -> "bool": - box_converted = _ffi.cast("const STBox *", box) +def tint_value_time_boxes( + temp: Annotated[_ffi.CData, "const Temporal *"], + vsize: int, + duration: Annotated[_ffi.CData, "const Interval *"], + vorigin: int, + torigin: int, + count: Annotated[_ffi.CData, "int *"], +) -> Annotated[_ffi.CData, "TBox *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.overbefore_stbox_tpoint(box_converted, temp_converted) + duration_converted = _ffi.cast("const Interval *", duration) + torigin_converted = _ffi.cast("TimestampTz", torigin) + count_converted = _ffi.cast("int *", count) + result = _lib.tint_value_time_boxes( + temp_converted, vsize, duration_converted, vorigin, torigin_converted, count_converted + ) _check_error() return result if result != _ffi.NULL else None -def overbefore_tbox_tnumber(box: "const TBox *", temp: "const Temporal *") -> "bool": - box_converted = _ffi.cast("const TBox *", box) +def tint_value_time_split( + temp: Annotated[_ffi.CData, "const Temporal *"], + size: int, + duration: Annotated[_ffi.CData, "const Interval *"], + vorigin: int, + torigin: int, +) -> tuple[ + Annotated[_ffi.CData, "Temporal **"], + Annotated[list, "int *"], + Annotated[list, "TimestampTz *"], + Annotated[_ffi.CData, "int"], +]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.overbefore_tbox_tnumber(box_converted, temp_converted) + duration_converted = _ffi.cast("const Interval *", duration) + torigin_converted = _ffi.cast("TimestampTz", torigin) + value_bins = _ffi.new("int **") + time_bins = _ffi.new("TimestampTz **") + count = _ffi.new("int *") + result = _lib.tint_value_time_split( + temp_converted, size, duration_converted, vorigin, torigin_converted, value_bins, time_bins, count + ) _check_error() - return result if result != _ffi.NULL else None + return result if result != _ffi.NULL else None, value_bins[0], time_bins[0], count[0] -def overbefore_temporal_tstzspan(temp: "const Temporal *", s: "const Span *") -> "bool": - temp_converted = _ffi.cast("const Temporal *", temp) - s_converted = _ffi.cast("const Span *", s) - result = _lib.overbefore_temporal_tstzspan(temp_converted, s_converted) +def tintbox_time_tiles( + box: Annotated[_ffi.CData, "const TBox *"], + duration: Annotated[_ffi.CData, "const Interval *"], + torigin: int, + count: Annotated[_ffi.CData, "int *"], +) -> Annotated[_ffi.CData, "TBox *"]: + box_converted = _ffi.cast("const TBox *", box) + duration_converted = _ffi.cast("const Interval *", duration) + torigin_converted = _ffi.cast("TimestampTz", torigin) + count_converted = _ffi.cast("int *", count) + result = _lib.tintbox_time_tiles(box_converted, duration_converted, torigin_converted, count_converted) _check_error() return result if result != _ffi.NULL else None -def overbefore_temporal_temporal( - temp1: "const Temporal *", temp2: "const Temporal *" -) -> "bool": - temp1_converted = _ffi.cast("const Temporal *", temp1) - temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.overbefore_temporal_temporal(temp1_converted, temp2_converted) +def tintbox_value_tiles( + box: Annotated[_ffi.CData, "const TBox *"], xsize: int, xorigin: int, count: Annotated[_ffi.CData, "int *"] +) -> Annotated[_ffi.CData, "TBox *"]: + box_converted = _ffi.cast("const TBox *", box) + count_converted = _ffi.cast("int *", count) + result = _lib.tintbox_value_tiles(box_converted, xsize, xorigin, count_converted) _check_error() return result if result != _ffi.NULL else None -def overbefore_tnumber_tbox(temp: "const Temporal *", box: "const TBox *") -> "bool": - temp_converted = _ffi.cast("const Temporal *", temp) +def tintbox_value_time_tiles( + box: Annotated[_ffi.CData, "const TBox *"], + xsize: int, + duration: Annotated[_ffi.CData, "const Interval *"], + xorigin: int | None, + torigin: int | None, +) -> tuple[Annotated[_ffi.CData, "TBox *"], Annotated[_ffi.CData, "int"]]: box_converted = _ffi.cast("const TBox *", box) - result = _lib.overbefore_tnumber_tbox(temp_converted, box_converted) + duration_converted = _ffi.cast("const Interval *", duration) + xorigin_converted = xorigin if xorigin is not None else _ffi.NULL + torigin_converted = _ffi.cast("TimestampTz", torigin) if torigin is not None else _ffi.NULL + count = _ffi.new("int *") + result = _lib.tintbox_value_time_tiles( + box_converted, xsize, duration_converted, xorigin_converted, torigin_converted, count + ) _check_error() - return result if result != _ffi.NULL else None + return result if result != _ffi.NULL else None, count[0] -def overbefore_tnumber_tnumber( - temp1: "const Temporal *", temp2: "const Temporal *" -) -> "bool": - temp1_converted = _ffi.cast("const Temporal *", temp1) - temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.overbefore_tnumber_tnumber(temp1_converted, temp2_converted) +def tempsubtype_name(subtype: Annotated[_ffi.CData, "tempSubtype"]) -> Annotated[str, "const char *"]: + subtype_converted = _ffi.cast("tempSubtype", subtype) + result = _lib.tempsubtype_name(subtype_converted) _check_error() + result = _ffi.string(result).decode("utf-8") return result if result != _ffi.NULL else None -def overbefore_tpoint_stbox(temp: "const Temporal *", box: "const STBox *") -> "bool": - temp_converted = _ffi.cast("const Temporal *", temp) - box_converted = _ffi.cast("const STBox *", box) - result = _lib.overbefore_tpoint_stbox(temp_converted, box_converted) +def tempsubtype_from_string(string: str, subtype: Annotated[_ffi.CData, "int16 *"]) -> Annotated[bool, "bool"]: + string_converted = string.encode("utf-8") + subtype_converted = _ffi.cast("int16 *", subtype) + result = _lib.tempsubtype_from_string(string_converted, subtype_converted) _check_error() return result if result != _ffi.NULL else None -def overbefore_tpoint_tpoint( - temp1: "const Temporal *", temp2: "const Temporal *" -) -> "bool": - temp1_converted = _ffi.cast("const Temporal *", temp1) - temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.overbefore_tpoint_tpoint(temp1_converted, temp2_converted) +def meosoper_name(oper: Annotated[_ffi.CData, "meosOper"]) -> Annotated[str, "const char *"]: + oper_converted = _ffi.cast("meosOper", oper) + result = _lib.meosoper_name(oper_converted) _check_error() + result = _ffi.string(result).decode("utf-8") return result if result != _ffi.NULL else None -def overbefore_tstzspan_temporal(s: "const Span *", temp: "const Temporal *") -> "bool": - s_converted = _ffi.cast("const Span *", s) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.overbefore_tstzspan_temporal(s_converted, temp_converted) +def meosoper_from_string(name: str) -> Annotated[_ffi.CData, "meosOper"]: + name_converted = name.encode("utf-8") + result = _lib.meosoper_from_string(name_converted) _check_error() return result if result != _ffi.NULL else None -def overbelow_stbox_tpoint(box: "const STBox *", temp: "const Temporal *") -> "bool": - box_converted = _ffi.cast("const STBox *", box) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.overbelow_stbox_tpoint(box_converted, temp_converted) +def interptype_name(interp: InterpolationType) -> Annotated[str, "const char *"]: + result = _lib.interptype_name(interp) _check_error() + result = _ffi.string(result).decode("utf-8") return result if result != _ffi.NULL else None -def overbelow_tpoint_stbox(temp: "const Temporal *", box: "const STBox *") -> "bool": - temp_converted = _ffi.cast("const Temporal *", temp) - box_converted = _ffi.cast("const STBox *", box) - result = _lib.overbelow_tpoint_stbox(temp_converted, box_converted) +def interptype_from_string(interp_str: str) -> Annotated[InterpolationType, "interpType"]: + interp_str_converted = interp_str.encode("utf-8") + result = _lib.interptype_from_string(interp_str_converted) _check_error() return result if result != _ffi.NULL else None -def overbelow_tpoint_tpoint( - temp1: "const Temporal *", temp2: "const Temporal *" -) -> "bool": - temp1_converted = _ffi.cast("const Temporal *", temp1) - temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.overbelow_tpoint_tpoint(temp1_converted, temp2_converted) +def meostype_name(type: Annotated[_ffi.CData, "meosType"]) -> Annotated[str, "const char *"]: + type_converted = _ffi.cast("meosType", type) + result = _lib.meostype_name(type_converted) _check_error() + result = _ffi.string(result).decode("utf-8") return result if result != _ffi.NULL else None -def overfront_stbox_tpoint(box: "const STBox *", temp: "const Temporal *") -> "bool": - box_converted = _ffi.cast("const STBox *", box) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.overfront_stbox_tpoint(box_converted, temp_converted) +def temptype_basetype(type: Annotated[_ffi.CData, "meosType"]) -> Annotated[_ffi.CData, "meosType"]: + type_converted = _ffi.cast("meosType", type) + result = _lib.temptype_basetype(type_converted) _check_error() return result if result != _ffi.NULL else None -def overfront_tpoint_stbox(temp: "const Temporal *", box: "const STBox *") -> "bool": - temp_converted = _ffi.cast("const Temporal *", temp) - box_converted = _ffi.cast("const STBox *", box) - result = _lib.overfront_tpoint_stbox(temp_converted, box_converted) +def settype_basetype(type: Annotated[_ffi.CData, "meosType"]) -> Annotated[_ffi.CData, "meosType"]: + type_converted = _ffi.cast("meosType", type) + result = _lib.settype_basetype(type_converted) _check_error() return result if result != _ffi.NULL else None -def overfront_tpoint_tpoint( - temp1: "const Temporal *", temp2: "const Temporal *" -) -> "bool": - temp1_converted = _ffi.cast("const Temporal *", temp1) - temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.overfront_tpoint_tpoint(temp1_converted, temp2_converted) +def spantype_basetype(type: Annotated[_ffi.CData, "meosType"]) -> Annotated[_ffi.CData, "meosType"]: + type_converted = _ffi.cast("meosType", type) + result = _lib.spantype_basetype(type_converted) _check_error() return result if result != _ffi.NULL else None -def overleft_numspan_tnumber(s: "const Span *", temp: "const Temporal *") -> "bool": - s_converted = _ffi.cast("const Span *", s) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.overleft_numspan_tnumber(s_converted, temp_converted) +def spantype_spansettype(type: Annotated[_ffi.CData, "meosType"]) -> Annotated[_ffi.CData, "meosType"]: + type_converted = _ffi.cast("meosType", type) + result = _lib.spantype_spansettype(type_converted) _check_error() return result if result != _ffi.NULL else None -def overleft_stbox_tpoint(box: "const STBox *", temp: "const Temporal *") -> "bool": - box_converted = _ffi.cast("const STBox *", box) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.overleft_stbox_tpoint(box_converted, temp_converted) +def spansettype_spantype(type: Annotated[_ffi.CData, "meosType"]) -> Annotated[_ffi.CData, "meosType"]: + type_converted = _ffi.cast("meosType", type) + result = _lib.spansettype_spantype(type_converted) _check_error() return result if result != _ffi.NULL else None -def overleft_tbox_tnumber(box: "const TBox *", temp: "const Temporal *") -> "bool": - box_converted = _ffi.cast("const TBox *", box) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.overleft_tbox_tnumber(box_converted, temp_converted) +def basetype_spantype(type: Annotated[_ffi.CData, "meosType"]) -> Annotated[_ffi.CData, "meosType"]: + type_converted = _ffi.cast("meosType", type) + result = _lib.basetype_spantype(type_converted) _check_error() return result if result != _ffi.NULL else None -def overleft_tnumber_numspan(temp: "const Temporal *", s: "const Span *") -> "bool": - temp_converted = _ffi.cast("const Temporal *", temp) - s_converted = _ffi.cast("const Span *", s) - result = _lib.overleft_tnumber_numspan(temp_converted, s_converted) +def basetype_settype(type: Annotated[_ffi.CData, "meosType"]) -> Annotated[_ffi.CData, "meosType"]: + type_converted = _ffi.cast("meosType", type) + result = _lib.basetype_settype(type_converted) _check_error() return result if result != _ffi.NULL else None -def overleft_tnumber_tbox(temp: "const Temporal *", box: "const TBox *") -> "bool": - temp_converted = _ffi.cast("const Temporal *", temp) - box_converted = _ffi.cast("const TBox *", box) - result = _lib.overleft_tnumber_tbox(temp_converted, box_converted) +def tnumber_basetype(type: Annotated[_ffi.CData, "meosType"]) -> Annotated[bool, "bool"]: + type_converted = _ffi.cast("meosType", type) + result = _lib.tnumber_basetype(type_converted) _check_error() return result if result != _ffi.NULL else None -def overleft_tnumber_tnumber( - temp1: "const Temporal *", temp2: "const Temporal *" -) -> "bool": - temp1_converted = _ffi.cast("const Temporal *", temp1) - temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.overleft_tnumber_tnumber(temp1_converted, temp2_converted) +def geo_basetype(type: Annotated[_ffi.CData, "meosType"]) -> Annotated[bool, "bool"]: + type_converted = _ffi.cast("meosType", type) + result = _lib.geo_basetype(type_converted) _check_error() return result if result != _ffi.NULL else None -def overleft_tpoint_stbox(temp: "const Temporal *", box: "const STBox *") -> "bool": - temp_converted = _ffi.cast("const Temporal *", temp) - box_converted = _ffi.cast("const STBox *", box) - result = _lib.overleft_tpoint_stbox(temp_converted, box_converted) +def time_type(type: Annotated[_ffi.CData, "meosType"]) -> Annotated[bool, "bool"]: + type_converted = _ffi.cast("meosType", type) + result = _lib.time_type(type_converted) _check_error() return result if result != _ffi.NULL else None -def overleft_tpoint_tpoint( - temp1: "const Temporal *", temp2: "const Temporal *" -) -> "bool": - temp1_converted = _ffi.cast("const Temporal *", temp1) - temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.overleft_tpoint_tpoint(temp1_converted, temp2_converted) +def set_type(type: Annotated[_ffi.CData, "meosType"]) -> Annotated[bool, "bool"]: + type_converted = _ffi.cast("meosType", type) + result = _lib.set_type(type_converted) _check_error() return result if result != _ffi.NULL else None -def overright_numspan_tnumber(s: "const Span *", temp: "const Temporal *") -> "bool": - s_converted = _ffi.cast("const Span *", s) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.overright_numspan_tnumber(s_converted, temp_converted) +def numset_type(type: Annotated[_ffi.CData, "meosType"]) -> Annotated[bool, "bool"]: + type_converted = _ffi.cast("meosType", type) + result = _lib.numset_type(type_converted) _check_error() return result if result != _ffi.NULL else None -def overright_stbox_tpoint(box: "const STBox *", temp: "const Temporal *") -> "bool": - box_converted = _ffi.cast("const STBox *", box) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.overright_stbox_tpoint(box_converted, temp_converted) +def ensure_numset_type(type: Annotated[_ffi.CData, "meosType"]) -> Annotated[bool, "bool"]: + type_converted = _ffi.cast("meosType", type) + result = _lib.ensure_numset_type(type_converted) _check_error() return result if result != _ffi.NULL else None -def overright_tbox_tnumber(box: "const TBox *", temp: "const Temporal *") -> "bool": - box_converted = _ffi.cast("const TBox *", box) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.overright_tbox_tnumber(box_converted, temp_converted) +def timeset_type(type: Annotated[_ffi.CData, "meosType"]) -> Annotated[bool, "bool"]: + type_converted = _ffi.cast("meosType", type) + result = _lib.timeset_type(type_converted) _check_error() return result if result != _ffi.NULL else None -def overright_tnumber_numspan(temp: "const Temporal *", s: "const Span *") -> "bool": - temp_converted = _ffi.cast("const Temporal *", temp) - s_converted = _ffi.cast("const Span *", s) - result = _lib.overright_tnumber_numspan(temp_converted, s_converted) +def set_spantype(type: Annotated[_ffi.CData, "meosType"]) -> Annotated[bool, "bool"]: + type_converted = _ffi.cast("meosType", type) + result = _lib.set_spantype(type_converted) _check_error() return result if result != _ffi.NULL else None -def overright_tnumber_tbox(temp: "const Temporal *", box: "const TBox *") -> "bool": - temp_converted = _ffi.cast("const Temporal *", temp) - box_converted = _ffi.cast("const TBox *", box) - result = _lib.overright_tnumber_tbox(temp_converted, box_converted) +def ensure_set_spantype(type: Annotated[_ffi.CData, "meosType"]) -> Annotated[bool, "bool"]: + type_converted = _ffi.cast("meosType", type) + result = _lib.ensure_set_spantype(type_converted) _check_error() return result if result != _ffi.NULL else None -def overright_tnumber_tnumber( - temp1: "const Temporal *", temp2: "const Temporal *" -) -> "bool": - temp1_converted = _ffi.cast("const Temporal *", temp1) - temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.overright_tnumber_tnumber(temp1_converted, temp2_converted) +def alphanumset_type(settype: Annotated[_ffi.CData, "meosType"]) -> Annotated[bool, "bool"]: + settype_converted = _ffi.cast("meosType", settype) + result = _lib.alphanumset_type(settype_converted) _check_error() return result if result != _ffi.NULL else None -def overright_tpoint_stbox(temp: "const Temporal *", box: "const STBox *") -> "bool": - temp_converted = _ffi.cast("const Temporal *", temp) - box_converted = _ffi.cast("const STBox *", box) - result = _lib.overright_tpoint_stbox(temp_converted, box_converted) +def geoset_type(type: Annotated[_ffi.CData, "meosType"]) -> Annotated[bool, "bool"]: + type_converted = _ffi.cast("meosType", type) + result = _lib.geoset_type(type_converted) _check_error() return result if result != _ffi.NULL else None -def overright_tpoint_tpoint( - temp1: "const Temporal *", temp2: "const Temporal *" -) -> "bool": - temp1_converted = _ffi.cast("const Temporal *", temp1) - temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.overright_tpoint_tpoint(temp1_converted, temp2_converted) +def ensure_geoset_type(type: Annotated[_ffi.CData, "meosType"]) -> Annotated[bool, "bool"]: + type_converted = _ffi.cast("meosType", type) + result = _lib.ensure_geoset_type(type_converted) _check_error() return result if result != _ffi.NULL else None -def right_numspan_tnumber(s: "const Span *", temp: "const Temporal *") -> "bool": - s_converted = _ffi.cast("const Span *", s) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.right_numspan_tnumber(s_converted, temp_converted) +def spatialset_type(type: Annotated[_ffi.CData, "meosType"]) -> Annotated[bool, "bool"]: + type_converted = _ffi.cast("meosType", type) + result = _lib.spatialset_type(type_converted) _check_error() return result if result != _ffi.NULL else None -def right_stbox_tpoint(box: "const STBox *", temp: "const Temporal *") -> "bool": - box_converted = _ffi.cast("const STBox *", box) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.right_stbox_tpoint(box_converted, temp_converted) +def ensure_spatialset_type(type: Annotated[_ffi.CData, "meosType"]) -> Annotated[bool, "bool"]: + type_converted = _ffi.cast("meosType", type) + result = _lib.ensure_spatialset_type(type_converted) _check_error() return result if result != _ffi.NULL else None -def right_tbox_tnumber(box: "const TBox *", temp: "const Temporal *") -> "bool": - box_converted = _ffi.cast("const TBox *", box) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.right_tbox_tnumber(box_converted, temp_converted) +def span_basetype(type: Annotated[_ffi.CData, "meosType"]) -> Annotated[bool, "bool"]: + type_converted = _ffi.cast("meosType", type) + result = _lib.span_basetype(type_converted) _check_error() return result if result != _ffi.NULL else None -def right_tnumber_numspan(temp: "const Temporal *", s: "const Span *") -> "bool": - temp_converted = _ffi.cast("const Temporal *", temp) - s_converted = _ffi.cast("const Span *", s) - result = _lib.right_tnumber_numspan(temp_converted, s_converted) +def span_canon_basetype(type: Annotated[_ffi.CData, "meosType"]) -> Annotated[bool, "bool"]: + type_converted = _ffi.cast("meosType", type) + result = _lib.span_canon_basetype(type_converted) _check_error() return result if result != _ffi.NULL else None -def right_tnumber_tbox(temp: "const Temporal *", box: "const TBox *") -> "bool": - temp_converted = _ffi.cast("const Temporal *", temp) - box_converted = _ffi.cast("const TBox *", box) - result = _lib.right_tnumber_tbox(temp_converted, box_converted) +def span_type(type: Annotated[_ffi.CData, "meosType"]) -> Annotated[bool, "bool"]: + type_converted = _ffi.cast("meosType", type) + result = _lib.span_type(type_converted) _check_error() return result if result != _ffi.NULL else None -def right_tnumber_tnumber( - temp1: "const Temporal *", temp2: "const Temporal *" -) -> "bool": - temp1_converted = _ffi.cast("const Temporal *", temp1) - temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.right_tnumber_tnumber(temp1_converted, temp2_converted) +def type_span_bbox(type: Annotated[_ffi.CData, "meosType"]) -> Annotated[bool, "bool"]: + type_converted = _ffi.cast("meosType", type) + result = _lib.type_span_bbox(type_converted) _check_error() return result if result != _ffi.NULL else None -def right_tpoint_stbox(temp: "const Temporal *", box: "const STBox *") -> "bool": - temp_converted = _ffi.cast("const Temporal *", temp) - box_converted = _ffi.cast("const STBox *", box) - result = _lib.right_tpoint_stbox(temp_converted, box_converted) +def span_tbox_type(type: Annotated[_ffi.CData, "meosType"]) -> Annotated[bool, "bool"]: + type_converted = _ffi.cast("meosType", type) + result = _lib.span_tbox_type(type_converted) _check_error() return result if result != _ffi.NULL else None -def right_tpoint_tpoint(temp1: "const Temporal *", temp2: "const Temporal *") -> "bool": - temp1_converted = _ffi.cast("const Temporal *", temp1) - temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.right_tpoint_tpoint(temp1_converted, temp2_converted) +def ensure_span_tbox_type(type: Annotated[_ffi.CData, "meosType"]) -> Annotated[bool, "bool"]: + type_converted = _ffi.cast("meosType", type) + result = _lib.ensure_span_tbox_type(type_converted) _check_error() return result if result != _ffi.NULL else None -def tand_bool_tbool(b: bool, temp: "const Temporal *") -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tand_bool_tbool(b, temp_converted) +def numspan_basetype(type: Annotated[_ffi.CData, "meosType"]) -> Annotated[bool, "bool"]: + type_converted = _ffi.cast("meosType", type) + result = _lib.numspan_basetype(type_converted) _check_error() return result if result != _ffi.NULL else None -def tand_tbool_bool(temp: "const Temporal *", b: bool) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tand_tbool_bool(temp_converted, b) +def numspan_type(type: Annotated[_ffi.CData, "meosType"]) -> Annotated[bool, "bool"]: + type_converted = _ffi.cast("meosType", type) + result = _lib.numspan_type(type_converted) _check_error() return result if result != _ffi.NULL else None -def tand_tbool_tbool( - temp1: "const Temporal *", temp2: "const Temporal *" -) -> "Temporal *": - temp1_converted = _ffi.cast("const Temporal *", temp1) - temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.tand_tbool_tbool(temp1_converted, temp2_converted) +def ensure_numspan_type(type: Annotated[_ffi.CData, "meosType"]) -> Annotated[bool, "bool"]: + type_converted = _ffi.cast("meosType", type) + result = _lib.ensure_numspan_type(type_converted) _check_error() return result if result != _ffi.NULL else None -def tbool_when_true(temp: "const Temporal *") -> "SpanSet *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tbool_when_true(temp_converted) +def timespan_basetype(type: Annotated[_ffi.CData, "meosType"]) -> Annotated[bool, "bool"]: + type_converted = _ffi.cast("meosType", type) + result = _lib.timespan_basetype(type_converted) _check_error() return result if result != _ffi.NULL else None -def tnot_tbool(temp: "const Temporal *") -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tnot_tbool(temp_converted) +def timespan_type(type: Annotated[_ffi.CData, "meosType"]) -> Annotated[bool, "bool"]: + type_converted = _ffi.cast("meosType", type) + result = _lib.timespan_type(type_converted) _check_error() return result if result != _ffi.NULL else None -def tor_bool_tbool(b: bool, temp: "const Temporal *") -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tor_bool_tbool(b, temp_converted) +def spanset_type(type: Annotated[_ffi.CData, "meosType"]) -> Annotated[bool, "bool"]: + type_converted = _ffi.cast("meosType", type) + result = _lib.spanset_type(type_converted) _check_error() return result if result != _ffi.NULL else None -def tor_tbool_bool(temp: "const Temporal *", b: bool) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tor_tbool_bool(temp_converted, b) +def timespanset_type(type: Annotated[_ffi.CData, "meosType"]) -> Annotated[bool, "bool"]: + type_converted = _ffi.cast("meosType", type) + result = _lib.timespanset_type(type_converted) _check_error() return result if result != _ffi.NULL else None -def tor_tbool_tbool( - temp1: "const Temporal *", temp2: "const Temporal *" -) -> "Temporal *": - temp1_converted = _ffi.cast("const Temporal *", temp1) - temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.tor_tbool_tbool(temp1_converted, temp2_converted) +def ensure_timespanset_type(type: Annotated[_ffi.CData, "meosType"]) -> Annotated[bool, "bool"]: + type_converted = _ffi.cast("meosType", type) + result = _lib.ensure_timespanset_type(type_converted) _check_error() return result if result != _ffi.NULL else None -def add_float_tfloat(d: float, tnumber: "const Temporal *") -> "Temporal *": - tnumber_converted = _ffi.cast("const Temporal *", tnumber) - result = _lib.add_float_tfloat(d, tnumber_converted) +def temporal_type(type: Annotated[_ffi.CData, "meosType"]) -> Annotated[bool, "bool"]: + type_converted = _ffi.cast("meosType", type) + result = _lib.temporal_type(type_converted) _check_error() return result if result != _ffi.NULL else None -def add_int_tint(i: int, tnumber: "const Temporal *") -> "Temporal *": - tnumber_converted = _ffi.cast("const Temporal *", tnumber) - result = _lib.add_int_tint(i, tnumber_converted) +def temptype_continuous(type: Annotated[_ffi.CData, "meosType"]) -> Annotated[bool, "bool"]: + type_converted = _ffi.cast("meosType", type) + result = _lib.temptype_continuous(type_converted) _check_error() return result if result != _ffi.NULL else None -def add_tfloat_float(tnumber: "const Temporal *", d: float) -> "Temporal *": - tnumber_converted = _ffi.cast("const Temporal *", tnumber) - result = _lib.add_tfloat_float(tnumber_converted, d) +def basetype_byvalue(type: Annotated[_ffi.CData, "meosType"]) -> Annotated[bool, "bool"]: + type_converted = _ffi.cast("meosType", type) + result = _lib.basetype_byvalue(type_converted) _check_error() return result if result != _ffi.NULL else None -def add_tint_int(tnumber: "const Temporal *", i: int) -> "Temporal *": - tnumber_converted = _ffi.cast("const Temporal *", tnumber) - result = _lib.add_tint_int(tnumber_converted, i) +def basetype_varlength(type: Annotated[_ffi.CData, "meosType"]) -> Annotated[bool, "bool"]: + type_converted = _ffi.cast("meosType", type) + result = _lib.basetype_varlength(type_converted) _check_error() return result if result != _ffi.NULL else None -def add_tnumber_tnumber( - tnumber1: "const Temporal *", tnumber2: "const Temporal *" -) -> "Temporal *": - tnumber1_converted = _ffi.cast("const Temporal *", tnumber1) - tnumber2_converted = _ffi.cast("const Temporal *", tnumber2) - result = _lib.add_tnumber_tnumber(tnumber1_converted, tnumber2_converted) +def basetype_length(type: Annotated[_ffi.CData, "meosType"]) -> Annotated[int, "int16"]: + type_converted = _ffi.cast("meosType", type) + result = _lib.basetype_length(type_converted) _check_error() return result if result != _ffi.NULL else None -def div_float_tfloat(d: float, tnumber: "const Temporal *") -> "Temporal *": - tnumber_converted = _ffi.cast("const Temporal *", tnumber) - result = _lib.div_float_tfloat(d, tnumber_converted) +def talpha_type(type: Annotated[_ffi.CData, "meosType"]) -> Annotated[bool, "bool"]: + type_converted = _ffi.cast("meosType", type) + result = _lib.talpha_type(type_converted) _check_error() return result if result != _ffi.NULL else None -def div_int_tint(i: int, tnumber: "const Temporal *") -> "Temporal *": - tnumber_converted = _ffi.cast("const Temporal *", tnumber) - result = _lib.div_int_tint(i, tnumber_converted) +def tnumber_type(type: Annotated[_ffi.CData, "meosType"]) -> Annotated[bool, "bool"]: + type_converted = _ffi.cast("meosType", type) + result = _lib.tnumber_type(type_converted) _check_error() return result if result != _ffi.NULL else None -def div_tfloat_float(tnumber: "const Temporal *", d: float) -> "Temporal *": - tnumber_converted = _ffi.cast("const Temporal *", tnumber) - result = _lib.div_tfloat_float(tnumber_converted, d) +def ensure_tnumber_type(type: Annotated[_ffi.CData, "meosType"]) -> Annotated[bool, "bool"]: + type_converted = _ffi.cast("meosType", type) + result = _lib.ensure_tnumber_type(type_converted) _check_error() return result if result != _ffi.NULL else None -def div_tint_int(tnumber: "const Temporal *", i: int) -> "Temporal *": - tnumber_converted = _ffi.cast("const Temporal *", tnumber) - result = _lib.div_tint_int(tnumber_converted, i) +def ensure_tnumber_basetype(type: Annotated[_ffi.CData, "meosType"]) -> Annotated[bool, "bool"]: + type_converted = _ffi.cast("meosType", type) + result = _lib.ensure_tnumber_basetype(type_converted) _check_error() return result if result != _ffi.NULL else None -def div_tnumber_tnumber( - tnumber1: "const Temporal *", tnumber2: "const Temporal *" -) -> "Temporal *": - tnumber1_converted = _ffi.cast("const Temporal *", tnumber1) - tnumber2_converted = _ffi.cast("const Temporal *", tnumber2) - result = _lib.div_tnumber_tnumber(tnumber1_converted, tnumber2_converted) +def tnumber_spantype(type: Annotated[_ffi.CData, "meosType"]) -> Annotated[bool, "bool"]: + type_converted = _ffi.cast("meosType", type) + result = _lib.tnumber_spantype(type_converted) _check_error() return result if result != _ffi.NULL else None -def mult_float_tfloat(d: float, tnumber: "const Temporal *") -> "Temporal *": - tnumber_converted = _ffi.cast("const Temporal *", tnumber) - result = _lib.mult_float_tfloat(d, tnumber_converted) +def spatial_basetype(type: Annotated[_ffi.CData, "meosType"]) -> Annotated[bool, "bool"]: + type_converted = _ffi.cast("meosType", type) + result = _lib.spatial_basetype(type_converted) _check_error() return result if result != _ffi.NULL else None -def mult_int_tint(i: int, tnumber: "const Temporal *") -> "Temporal *": - tnumber_converted = _ffi.cast("const Temporal *", tnumber) - result = _lib.mult_int_tint(i, tnumber_converted) +def tspatial_type(type: Annotated[_ffi.CData, "meosType"]) -> Annotated[bool, "bool"]: + type_converted = _ffi.cast("meosType", type) + result = _lib.tspatial_type(type_converted) _check_error() return result if result != _ffi.NULL else None -def mult_tfloat_float(tnumber: "const Temporal *", d: float) -> "Temporal *": - tnumber_converted = _ffi.cast("const Temporal *", tnumber) - result = _lib.mult_tfloat_float(tnumber_converted, d) +def ensure_tspatial_type(type: Annotated[_ffi.CData, "meosType"]) -> Annotated[bool, "bool"]: + type_converted = _ffi.cast("meosType", type) + result = _lib.ensure_tspatial_type(type_converted) _check_error() return result if result != _ffi.NULL else None -def mult_tint_int(tnumber: "const Temporal *", i: int) -> "Temporal *": - tnumber_converted = _ffi.cast("const Temporal *", tnumber) - result = _lib.mult_tint_int(tnumber_converted, i) +def tpoint_type(type: Annotated[_ffi.CData, "meosType"]) -> Annotated[bool, "bool"]: + type_converted = _ffi.cast("meosType", type) + result = _lib.tpoint_type(type_converted) _check_error() return result if result != _ffi.NULL else None -def mult_tnumber_tnumber( - tnumber1: "const Temporal *", tnumber2: "const Temporal *" -) -> "Temporal *": - tnumber1_converted = _ffi.cast("const Temporal *", tnumber1) - tnumber2_converted = _ffi.cast("const Temporal *", tnumber2) - result = _lib.mult_tnumber_tnumber(tnumber1_converted, tnumber2_converted) +def ensure_tpoint_type(type: Annotated[_ffi.CData, "meosType"]) -> Annotated[bool, "bool"]: + type_converted = _ffi.cast("meosType", type) + result = _lib.ensure_tpoint_type(type_converted) _check_error() return result if result != _ffi.NULL else None -def sub_float_tfloat(d: float, tnumber: "const Temporal *") -> "Temporal *": - tnumber_converted = _ffi.cast("const Temporal *", tnumber) - result = _lib.sub_float_tfloat(d, tnumber_converted) +def tgeo_type(type: Annotated[_ffi.CData, "meosType"]) -> Annotated[bool, "bool"]: + type_converted = _ffi.cast("meosType", type) + result = _lib.tgeo_type(type_converted) _check_error() return result if result != _ffi.NULL else None -def sub_int_tint(i: int, tnumber: "const Temporal *") -> "Temporal *": - tnumber_converted = _ffi.cast("const Temporal *", tnumber) - result = _lib.sub_int_tint(i, tnumber_converted) +def ensure_tgeo_type(type: Annotated[_ffi.CData, "meosType"]) -> Annotated[bool, "bool"]: + type_converted = _ffi.cast("meosType", type) + result = _lib.ensure_tgeo_type(type_converted) _check_error() return result if result != _ffi.NULL else None -def sub_tfloat_float(tnumber: "const Temporal *", d: float) -> "Temporal *": - tnumber_converted = _ffi.cast("const Temporal *", tnumber) - result = _lib.sub_tfloat_float(tnumber_converted, d) +def tgeo_type_all(type: Annotated[_ffi.CData, "meosType"]) -> Annotated[bool, "bool"]: + type_converted = _ffi.cast("meosType", type) + result = _lib.tgeo_type_all(type_converted) _check_error() return result if result != _ffi.NULL else None -def sub_tint_int(tnumber: "const Temporal *", i: int) -> "Temporal *": - tnumber_converted = _ffi.cast("const Temporal *", tnumber) - result = _lib.sub_tint_int(tnumber_converted, i) +def ensure_tgeo_type_all(type: Annotated[_ffi.CData, "meosType"]) -> Annotated[bool, "bool"]: + type_converted = _ffi.cast("meosType", type) + result = _lib.ensure_tgeo_type_all(type_converted) _check_error() return result if result != _ffi.NULL else None -def sub_tnumber_tnumber( - tnumber1: "const Temporal *", tnumber2: "const Temporal *" -) -> "Temporal *": - tnumber1_converted = _ffi.cast("const Temporal *", tnumber1) - tnumber2_converted = _ffi.cast("const Temporal *", tnumber2) - result = _lib.sub_tnumber_tnumber(tnumber1_converted, tnumber2_converted) +def tgeometry_type(type: Annotated[_ffi.CData, "meosType"]) -> Annotated[bool, "bool"]: + type_converted = _ffi.cast("meosType", type) + result = _lib.tgeometry_type(type_converted) _check_error() return result if result != _ffi.NULL else None -def tfloat_derivative(temp: "const Temporal *") -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tfloat_derivative(temp_converted) +def ensure_tgeometry_type(type: Annotated[_ffi.CData, "meosType"]) -> Annotated[bool, "bool"]: + type_converted = _ffi.cast("meosType", type) + result = _lib.ensure_tgeometry_type(type_converted) _check_error() return result if result != _ffi.NULL else None -def tnumber_abs(temp: "const Temporal *") -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tnumber_abs(temp_converted) +def tgeodetic_type(type: Annotated[_ffi.CData, "meosType"]) -> Annotated[bool, "bool"]: + type_converted = _ffi.cast("meosType", type) + result = _lib.tgeodetic_type(type_converted) _check_error() return result if result != _ffi.NULL else None -def tnumber_angular_difference(temp: "const Temporal *") -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tnumber_angular_difference(temp_converted) +def ensure_tgeodetic_type(type: Annotated[_ffi.CData, "meosType"]) -> Annotated[bool, "bool"]: + type_converted = _ffi.cast("meosType", type) + result = _lib.ensure_tgeodetic_type(type_converted) _check_error() return result if result != _ffi.NULL else None -def tnumber_delta_value(temp: "const Temporal *") -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tnumber_delta_value(temp_converted) +def ensure_tnumber_tpoint_type(type: Annotated[_ffi.CData, "meosType"]) -> Annotated[bool, "bool"]: + type_converted = _ffi.cast("meosType", type) + result = _lib.ensure_tnumber_tpoint_type(type_converted) _check_error() return result if result != _ffi.NULL else None -def textcat_text_ttext(txt: str, temp: "const Temporal *") -> "Temporal *": - txt_converted = cstring2text(txt) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.textcat_text_ttext(txt_converted, temp_converted) +def geo_as_ewkb( + gs: Annotated[_ffi.CData, "const GSERIALIZED *"], endian: str, size: Annotated[_ffi.CData, "size_t *"] +) -> Annotated[_ffi.CData, "uint8_t *"]: + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + endian_converted = endian.encode("utf-8") + size_converted = _ffi.cast("size_t *", size) + result = _lib.geo_as_ewkb(gs_converted, endian_converted, size_converted) _check_error() return result if result != _ffi.NULL else None -def textcat_ttext_text(temp: "const Temporal *", txt: str) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - txt_converted = cstring2text(txt) - result = _lib.textcat_ttext_text(temp_converted, txt_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def textcat_ttext_ttext( - temp1: "const Temporal *", temp2: "const Temporal *" -) -> "Temporal *": - temp1_converted = _ffi.cast("const Temporal *", temp1) - temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.textcat_ttext_ttext(temp1_converted, temp2_converted) +def geo_as_ewkt(gs: Annotated[_ffi.CData, "const GSERIALIZED *"], precision: int) -> Annotated[str, "char *"]: + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + result = _lib.geo_as_ewkt(gs_converted, precision) _check_error() + result = _ffi.string(result).decode("utf-8") return result if result != _ffi.NULL else None -def ttext_upper(temp: "const Temporal *") -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.ttext_upper(temp_converted) +def geo_as_geojson( + gs: Annotated[_ffi.CData, "const GSERIALIZED *"], option: int, precision: int, srs: str | None +) -> Annotated[str, "char *"]: + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + srs_converted = srs.encode("utf-8") if srs is not None else _ffi.NULL + result = _lib.geo_as_geojson(gs_converted, option, precision, srs_converted) _check_error() + result = _ffi.string(result).decode("utf-8") return result if result != _ffi.NULL else None -def ttext_lower(temp: "const Temporal *") -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.ttext_lower(temp_converted) +def geo_as_hexewkb(gs: Annotated[_ffi.CData, "const GSERIALIZED *"], endian: str) -> Annotated[str, "char *"]: + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + endian_converted = endian.encode("utf-8") + result = _lib.geo_as_hexewkb(gs_converted, endian_converted) _check_error() + result = _ffi.string(result).decode("utf-8") return result if result != _ffi.NULL else None -def ttext_initcap(temp: "const Temporal *") -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.ttext_initcap(temp_converted) +def geo_as_text(gs: Annotated[_ffi.CData, "const GSERIALIZED *"], precision: int) -> Annotated[str, "char *"]: + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + result = _lib.geo_as_text(gs_converted, precision) _check_error() + result = _ffi.string(result).decode("utf-8") return result if result != _ffi.NULL else None -def distance_tfloat_float(temp: "const Temporal *", d: float) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.distance_tfloat_float(temp_converted, d) +def geo_from_ewkb( + wkb: Annotated[_ffi.CData, "const uint8_t *"], wkb_size: Annotated[_ffi.CData, "size_t"], srid: int +) -> Annotated[_ffi.CData, "GSERIALIZED *"]: + wkb_converted = _ffi.cast("const uint8_t *", wkb) + wkb_size_converted = _ffi.cast("size_t", wkb_size) + srid_converted = _ffi.cast("int32", srid) + result = _lib.geo_from_ewkb(wkb_converted, wkb_size_converted, srid_converted) _check_error() return result if result != _ffi.NULL else None -def distance_tint_int(temp: "const Temporal *", i: int) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.distance_tint_int(temp_converted, i) +def geo_from_geojson(geojson: str) -> Annotated[_ffi.CData, "GSERIALIZED *"]: + geojson_converted = geojson.encode("utf-8") + result = _lib.geo_from_geojson(geojson_converted) _check_error() return result if result != _ffi.NULL else None -def distance_tnumber_tnumber( - temp1: "const Temporal *", temp2: "const Temporal *" -) -> "Temporal *": - temp1_converted = _ffi.cast("const Temporal *", temp1) - temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.distance_tnumber_tnumber(temp1_converted, temp2_converted) +def geo_from_text(wkt: str, srid: Annotated[_ffi.CData, "int32_t"]) -> Annotated[_ffi.CData, "GSERIALIZED *"]: + wkt_converted = wkt.encode("utf-8") + srid_converted = _ffi.cast("int32_t", srid) + result = _lib.geo_from_text(wkt_converted, srid_converted) _check_error() return result if result != _ffi.NULL else None -def distance_tpoint_point( - temp: "const Temporal *", gs: "const GSERIALIZED *" -) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) +def geo_out(gs: Annotated[_ffi.CData, "const GSERIALIZED *"]) -> Annotated[str, "char *"]: gs_converted = _ffi.cast("const GSERIALIZED *", gs) - result = _lib.distance_tpoint_point(temp_converted, gs_converted) + result = _lib.geo_out(gs_converted) _check_error() + result = _ffi.string(result).decode("utf-8") return result if result != _ffi.NULL else None -def distance_tpoint_tpoint( - temp1: "const Temporal *", temp2: "const Temporal *" -) -> "Temporal *": - temp1_converted = _ffi.cast("const Temporal *", temp1) - temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.distance_tpoint_tpoint(temp1_converted, temp2_converted) +def geog_from_binary(wkb_bytea: str) -> Annotated[_ffi.CData, "GSERIALIZED *"]: + wkb_bytea_converted = wkb_bytea.encode("utf-8") + result = _lib.geog_from_binary(wkb_bytea_converted) _check_error() return result if result != _ffi.NULL else None -def nad_stbox_geo(box: "const STBox *", gs: "const GSERIALIZED *") -> "double": - box_converted = _ffi.cast("const STBox *", box) - gs_converted = _ffi.cast("const GSERIALIZED *", gs) - result = _lib.nad_stbox_geo(box_converted, gs_converted) +def geog_from_hexewkb(wkt: str) -> Annotated[_ffi.CData, "GSERIALIZED *"]: + wkt_converted = wkt.encode("utf-8") + result = _lib.geog_from_hexewkb(wkt_converted) _check_error() return result if result != _ffi.NULL else None -def nad_stbox_stbox(box1: "const STBox *", box2: "const STBox *") -> "double": - box1_converted = _ffi.cast("const STBox *", box1) - box2_converted = _ffi.cast("const STBox *", box2) - result = _lib.nad_stbox_stbox(box1_converted, box2_converted) +def geog_in(string: str, typmod: int) -> Annotated[_ffi.CData, "GSERIALIZED *"]: + string_converted = string.encode("utf-8") + typmod_converted = _ffi.cast("int32", typmod) + result = _lib.geog_in(string_converted, typmod_converted) _check_error() return result if result != _ffi.NULL else None -def nad_tint_int(temp: "const Temporal *", i: int) -> "int": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.nad_tint_int(temp_converted, i) +def geom_from_hexewkb(wkt: str) -> Annotated[_ffi.CData, "GSERIALIZED *"]: + wkt_converted = wkt.encode("utf-8") + result = _lib.geom_from_hexewkb(wkt_converted) _check_error() return result if result != _ffi.NULL else None -def nad_tint_tbox(temp: "const Temporal *", box: "const TBox *") -> "int": - temp_converted = _ffi.cast("const Temporal *", temp) - box_converted = _ffi.cast("const TBox *", box) - result = _lib.nad_tint_tbox(temp_converted, box_converted) +def geom_in(string: str, typmod: int) -> Annotated[_ffi.CData, "GSERIALIZED *"]: + string_converted = string.encode("utf-8") + typmod_converted = _ffi.cast("int32", typmod) + result = _lib.geom_in(string_converted, typmod_converted) _check_error() return result if result != _ffi.NULL else None -def nad_tint_tint(temp1: "const Temporal *", temp2: "const Temporal *") -> "int": - temp1_converted = _ffi.cast("const Temporal *", temp1) - temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.nad_tint_tint(temp1_converted, temp2_converted) +def geo_copy(g: Annotated[_ffi.CData, "const GSERIALIZED *"]) -> Annotated[_ffi.CData, "GSERIALIZED *"]: + g_converted = _ffi.cast("const GSERIALIZED *", g) + result = _lib.geo_copy(g_converted) _check_error() return result if result != _ffi.NULL else None -def nad_tboxint_tboxint(box1: "const TBox *", box2: "const TBox *") -> "int": - box1_converted = _ffi.cast("const TBox *", box1) - box2_converted = _ffi.cast("const TBox *", box2) - result = _lib.nad_tboxint_tboxint(box1_converted, box2_converted) +def geogpoint_make2d( + srid: Annotated[_ffi.CData, "int32_t"], x: float, y: float +) -> Annotated[_ffi.CData, "GSERIALIZED *"]: + srid_converted = _ffi.cast("int32_t", srid) + result = _lib.geogpoint_make2d(srid_converted, x, y) _check_error() return result if result != _ffi.NULL else None -def nad_tfloat_float(temp: "const Temporal *", d: float) -> "double": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.nad_tfloat_float(temp_converted, d) +def geogpoint_make3dz( + srid: Annotated[_ffi.CData, "int32_t"], x: float, y: float, z: float +) -> Annotated[_ffi.CData, "GSERIALIZED *"]: + srid_converted = _ffi.cast("int32_t", srid) + result = _lib.geogpoint_make3dz(srid_converted, x, y, z) _check_error() return result if result != _ffi.NULL else None -def nad_tfloat_tfloat(temp1: "const Temporal *", temp2: "const Temporal *") -> "double": - temp1_converted = _ffi.cast("const Temporal *", temp1) - temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.nad_tfloat_tfloat(temp1_converted, temp2_converted) +def geompoint_make2d( + srid: Annotated[_ffi.CData, "int32_t"], x: float, y: float +) -> Annotated[_ffi.CData, "GSERIALIZED *"]: + srid_converted = _ffi.cast("int32_t", srid) + result = _lib.geompoint_make2d(srid_converted, x, y) _check_error() return result if result != _ffi.NULL else None -def nad_tfloat_tbox(temp: "const Temporal *", box: "const TBox *") -> "double": - temp_converted = _ffi.cast("const Temporal *", temp) - box_converted = _ffi.cast("const TBox *", box) - result = _lib.nad_tfloat_tbox(temp_converted, box_converted) +def geompoint_make3dz( + srid: Annotated[_ffi.CData, "int32_t"], x: float, y: float, z: float +) -> Annotated[_ffi.CData, "GSERIALIZED *"]: + srid_converted = _ffi.cast("int32_t", srid) + result = _lib.geompoint_make3dz(srid_converted, x, y, z) _check_error() return result if result != _ffi.NULL else None -def nad_tboxfloat_tboxfloat(box1: "const TBox *", box2: "const TBox *") -> "double": - box1_converted = _ffi.cast("const TBox *", box1) - box2_converted = _ffi.cast("const TBox *", box2) - result = _lib.nad_tboxfloat_tboxfloat(box1_converted, box2_converted) +def geom_to_geog(geom: Annotated[_ffi.CData, "const GSERIALIZED *"]) -> Annotated[_ffi.CData, "GSERIALIZED *"]: + geom_converted = _ffi.cast("const GSERIALIZED *", geom) + result = _lib.geom_to_geog(geom_converted) _check_error() return result if result != _ffi.NULL else None -def nad_tpoint_geo(temp: "const Temporal *", gs: "const GSERIALIZED *") -> "double": - temp_converted = _ffi.cast("const Temporal *", temp) - gs_converted = _ffi.cast("const GSERIALIZED *", gs) - result = _lib.nad_tpoint_geo(temp_converted, gs_converted) +def geog_to_geom(geog: Annotated[_ffi.CData, "const GSERIALIZED *"]) -> Annotated[_ffi.CData, "GSERIALIZED *"]: + geog_converted = _ffi.cast("const GSERIALIZED *", geog) + result = _lib.geog_to_geom(geog_converted) _check_error() return result if result != _ffi.NULL else None -def nad_tpoint_stbox(temp: "const Temporal *", box: "const STBox *") -> "double": - temp_converted = _ffi.cast("const Temporal *", temp) - box_converted = _ffi.cast("const STBox *", box) - result = _lib.nad_tpoint_stbox(temp_converted, box_converted) +def geo_is_empty(g: Annotated[_ffi.CData, "const GSERIALIZED *"]) -> Annotated[bool, "bool"]: + g_converted = _ffi.cast("const GSERIALIZED *", g) + result = _lib.geo_is_empty(g_converted) _check_error() return result if result != _ffi.NULL else None -def nad_tpoint_tpoint(temp1: "const Temporal *", temp2: "const Temporal *") -> "double": - temp1_converted = _ffi.cast("const Temporal *", temp1) - temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.nad_tpoint_tpoint(temp1_converted, temp2_converted) +def geo_typename(type: int) -> Annotated[str, "const char *"]: + result = _lib.geo_typename(type) _check_error() + result = _ffi.string(result).decode("utf-8") return result if result != _ffi.NULL else None -def nai_tpoint_geo(temp: "const Temporal *", gs: "const GSERIALIZED *") -> "TInstant *": - temp_converted = _ffi.cast("const Temporal *", temp) - gs_converted = _ffi.cast("const GSERIALIZED *", gs) - result = _lib.nai_tpoint_geo(temp_converted, gs_converted) +def geog_area(g: Annotated[_ffi.CData, "const GSERIALIZED *"], use_spheroid: bool) -> Annotated[float, "double"]: + g_converted = _ffi.cast("const GSERIALIZED *", g) + result = _lib.geog_area(g_converted, use_spheroid) _check_error() return result if result != _ffi.NULL else None -def nai_tpoint_tpoint( - temp1: "const Temporal *", temp2: "const Temporal *" -) -> "TInstant *": - temp1_converted = _ffi.cast("const Temporal *", temp1) - temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.nai_tpoint_tpoint(temp1_converted, temp2_converted) +def geog_centroid( + g: Annotated[_ffi.CData, "const GSERIALIZED *"], use_spheroid: bool +) -> Annotated[_ffi.CData, "GSERIALIZED *"]: + g_converted = _ffi.cast("const GSERIALIZED *", g) + result = _lib.geog_centroid(g_converted, use_spheroid) _check_error() return result if result != _ffi.NULL else None -def shortestline_tpoint_geo( - temp: "const Temporal *", gs: "const GSERIALIZED *" -) -> "GSERIALIZED *": - temp_converted = _ffi.cast("const Temporal *", temp) - gs_converted = _ffi.cast("const GSERIALIZED *", gs) - result = _lib.shortestline_tpoint_geo(temp_converted, gs_converted) +def geog_length(g: Annotated[_ffi.CData, "const GSERIALIZED *"], use_spheroid: bool) -> Annotated[float, "double"]: + g_converted = _ffi.cast("const GSERIALIZED *", g) + result = _lib.geog_length(g_converted, use_spheroid) _check_error() return result if result != _ffi.NULL else None -def shortestline_tpoint_tpoint( - temp1: "const Temporal *", temp2: "const Temporal *" -) -> "GSERIALIZED *": - temp1_converted = _ffi.cast("const Temporal *", temp1) - temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.shortestline_tpoint_tpoint(temp1_converted, temp2_converted) +def geog_perimeter(g: Annotated[_ffi.CData, "const GSERIALIZED *"], use_spheroid: bool) -> Annotated[float, "double"]: + g_converted = _ffi.cast("const GSERIALIZED *", g) + result = _lib.geog_perimeter(g_converted, use_spheroid) _check_error() return result if result != _ffi.NULL else None -def bearing_point_point( - gs1: "const GSERIALIZED *", gs2: "const GSERIALIZED *" -) -> "double": +def geom_azimuth( + gs1: Annotated[_ffi.CData, "const GSERIALIZED *"], gs2: Annotated[_ffi.CData, "const GSERIALIZED *"] +) -> Annotated[_ffi.CData, "double"]: gs1_converted = _ffi.cast("const GSERIALIZED *", gs1) gs2_converted = _ffi.cast("const GSERIALIZED *", gs2) out_result = _ffi.new("double *") - result = _lib.bearing_point_point(gs1_converted, gs2_converted, out_result) + result = _lib.geom_azimuth(gs1_converted, gs2_converted, out_result) _check_error() if result: return out_result[0] if out_result[0] != _ffi.NULL else None return None -def bearing_tpoint_point( - temp: "const Temporal *", gs: "const GSERIALIZED *", invert: bool -) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) +def geom_length(gs: Annotated[_ffi.CData, "const GSERIALIZED *"]) -> Annotated[float, "double"]: gs_converted = _ffi.cast("const GSERIALIZED *", gs) - result = _lib.bearing_tpoint_point(temp_converted, gs_converted, invert) + result = _lib.geom_length(gs_converted) _check_error() return result if result != _ffi.NULL else None -def bearing_tpoint_tpoint( - temp1: "const Temporal *", temp2: "const Temporal *" -) -> "Temporal *": - temp1_converted = _ffi.cast("const Temporal *", temp1) - temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.bearing_tpoint_tpoint(temp1_converted, temp2_converted) +def geom_perimeter(gs: Annotated[_ffi.CData, "const GSERIALIZED *"]) -> Annotated[float, "double"]: + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + result = _lib.geom_perimeter(gs_converted) _check_error() return result if result != _ffi.NULL else None -def geo_gboxes(gs: "const GSERIALIZED *") -> "Tuple['GBOX *', 'int']": +def line_numpoints(gs: Annotated[_ffi.CData, "const GSERIALIZED *"]) -> Annotated[int, "int"]: gs_converted = _ffi.cast("const GSERIALIZED *", gs) - count = _ffi.new("int *") - result = _lib.geo_gboxes(gs_converted, count) + result = _lib.line_numpoints(gs_converted) _check_error() - return result if result != _ffi.NULL else None, count[0] + return result if result != _ffi.NULL else None -def tpoint_angular_difference(temp: "const Temporal *") -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tpoint_angular_difference(temp_converted) +def line_point_n(geom: Annotated[_ffi.CData, "const GSERIALIZED *"], n: int) -> Annotated[_ffi.CData, "GSERIALIZED *"]: + geom_converted = _ffi.cast("const GSERIALIZED *", geom) + result = _lib.line_point_n(geom_converted, n) _check_error() return result if result != _ffi.NULL else None -def tpoint_azimuth(temp: "const Temporal *") -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tpoint_azimuth(temp_converted) +def geo_reverse(gs: Annotated[_ffi.CData, "const GSERIALIZED *"]) -> Annotated[_ffi.CData, "GSERIALIZED *"]: + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + result = _lib.geo_reverse(gs_converted) _check_error() return result if result != _ffi.NULL else None -def tpoint_convex_hull(temp: "const Temporal *") -> "GSERIALIZED *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tpoint_convex_hull(temp_converted) +def geo_round(gs: Annotated[_ffi.CData, "const GSERIALIZED *"], maxdd: int) -> Annotated[_ffi.CData, "GSERIALIZED *"]: + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + result = _lib.geo_round(gs_converted, maxdd) _check_error() return result if result != _ffi.NULL else None -def tpoint_cumulative_length(temp: "const Temporal *") -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tpoint_cumulative_length(temp_converted) +def geo_set_srid( + gs: Annotated[_ffi.CData, "const GSERIALIZED *"], srid: Annotated[_ffi.CData, "int32_t"] +) -> Annotated[_ffi.CData, "GSERIALIZED *"]: + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + srid_converted = _ffi.cast("int32_t", srid) + result = _lib.geo_set_srid(gs_converted, srid_converted) _check_error() return result if result != _ffi.NULL else None -def tpoint_direction(temp: "const Temporal *") -> "double": - temp_converted = _ffi.cast("const Temporal *", temp) - out_result = _ffi.new("double *") - result = _lib.tpoint_direction(temp_converted, out_result) +def geo_srid(gs: Annotated[_ffi.CData, "const GSERIALIZED *"]) -> Annotated[_ffi.CData, "int32_t"]: + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + result = _lib.geo_srid(gs_converted) _check_error() - if result: - return out_result[0] if out_result[0] != _ffi.NULL else None - return None + return result if result != _ffi.NULL else None -def tpoint_get_x(temp: "const Temporal *") -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tpoint_get_x(temp_converted) +def geo_transform( + geom: Annotated[_ffi.CData, "GSERIALIZED *"], srid_to: Annotated[_ffi.CData, "int32_t"] +) -> Annotated[_ffi.CData, "GSERIALIZED *"]: + geom_converted = _ffi.cast("GSERIALIZED *", geom) + srid_to_converted = _ffi.cast("int32_t", srid_to) + result = _lib.geo_transform(geom_converted, srid_to_converted) _check_error() return result if result != _ffi.NULL else None -def tpoint_get_y(temp: "const Temporal *") -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tpoint_get_y(temp_converted) +def geo_transform_pipeline( + gs: Annotated[_ffi.CData, "const GSERIALIZED *"], + pipeline: str, + srid_to: Annotated[_ffi.CData, "int32_t"], + is_forward: bool, +) -> Annotated[_ffi.CData, "GSERIALIZED *"]: + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + pipeline_converted = pipeline.encode("utf-8") + srid_to_converted = _ffi.cast("int32_t", srid_to) + result = _lib.geo_transform_pipeline(gs_converted, pipeline_converted, srid_to_converted, is_forward) _check_error() return result if result != _ffi.NULL else None -def tpoint_get_z(temp: "const Temporal *") -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tpoint_get_z(temp_converted) +def geo_collect_garray(gsarr: Annotated[list, "GSERIALIZED **"], count: int) -> Annotated[_ffi.CData, "GSERIALIZED *"]: + gsarr_converted = [_ffi.cast("GSERIALIZED *", x) for x in gsarr] + result = _lib.geo_collect_garray(gsarr_converted, count) _check_error() return result if result != _ffi.NULL else None -def tpoint_is_simple(temp: "const Temporal *") -> "bool": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tpoint_is_simple(temp_converted) +def geo_makeline_garray(gsarr: Annotated[list, "GSERIALIZED **"], count: int) -> Annotated[_ffi.CData, "GSERIALIZED *"]: + gsarr_converted = [_ffi.cast("GSERIALIZED *", x) for x in gsarr] + result = _lib.geo_makeline_garray(gsarr_converted, count) _check_error() return result if result != _ffi.NULL else None -def tpoint_length(temp: "const Temporal *") -> "double": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tpoint_length(temp_converted) +def geo_npoints(gs: Annotated[_ffi.CData, "const GSERIALIZED *"]) -> Annotated[int, "int"]: + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + result = _lib.geo_npoints(gs_converted) _check_error() return result if result != _ffi.NULL else None -def tpoint_speed(temp: "const Temporal *") -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tpoint_speed(temp_converted) +def geo_ngeos(gs: Annotated[_ffi.CData, "const GSERIALIZED *"]) -> Annotated[int, "int"]: + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + result = _lib.geo_ngeos(gs_converted) _check_error() return result if result != _ffi.NULL else None -def tpoint_srid(temp: "const Temporal *") -> "int32_t": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tpoint_srid(temp_converted) +def geo_geoN(geom: Annotated[_ffi.CData, "const GSERIALIZED *"], n: int) -> Annotated[_ffi.CData, "GSERIALIZED *"]: + geom_converted = _ffi.cast("const GSERIALIZED *", geom) + result = _lib.geo_geoN(geom_converted, n) _check_error() return result if result != _ffi.NULL else None -def tpoint_trajectory(temp: "const Temporal *") -> "GSERIALIZED *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tpoint_trajectory(temp_converted) +def geom_array_union(gsarr: Annotated[list, "GSERIALIZED **"], count: int) -> Annotated[_ffi.CData, "GSERIALIZED *"]: + gsarr_converted = [_ffi.cast("GSERIALIZED *", x) for x in gsarr] + result = _lib.geom_array_union(gsarr_converted, count) _check_error() return result if result != _ffi.NULL else None -def tpoint_twcentroid(temp: "const Temporal *") -> "GSERIALIZED *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tpoint_twcentroid(temp_converted) +def geom_boundary(gs: Annotated[_ffi.CData, "const GSERIALIZED *"]) -> Annotated[_ffi.CData, "GSERIALIZED *"]: + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + result = _lib.geom_boundary(gs_converted) _check_error() return result if result != _ffi.NULL else None -def geo_expand_space(gs: "const GSERIALIZED *", d: float) -> "STBox *": +def geom_buffer( + gs: Annotated[_ffi.CData, "const GSERIALIZED *"], size: float, params: str +) -> Annotated[_ffi.CData, "GSERIALIZED *"]: gs_converted = _ffi.cast("const GSERIALIZED *", gs) - result = _lib.geo_expand_space(gs_converted, d) + params_converted = params.encode("utf-8") + result = _lib.geom_buffer(gs_converted, size, params_converted) _check_error() return result if result != _ffi.NULL else None -def geomeas_to_tpoint(gs: "const GSERIALIZED *") -> "Temporal *": +def geom_centroid(gs: Annotated[_ffi.CData, "const GSERIALIZED *"]) -> Annotated[_ffi.CData, "GSERIALIZED *"]: gs_converted = _ffi.cast("const GSERIALIZED *", gs) - result = _lib.geomeas_to_tpoint(gs_converted) + result = _lib.geom_centroid(gs_converted) _check_error() return result if result != _ffi.NULL else None -def tgeogpoint_to_tgeompoint(temp: "const Temporal *") -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tgeogpoint_to_tgeompoint(temp_converted) +def geom_convex_hull(gs: Annotated[_ffi.CData, "const GSERIALIZED *"]) -> Annotated[_ffi.CData, "GSERIALIZED *"]: + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + result = _lib.geom_convex_hull(gs_converted) _check_error() return result if result != _ffi.NULL else None -def tgeompoint_to_tgeogpoint(temp: "const Temporal *") -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tgeompoint_to_tgeogpoint(temp_converted) +def geom_difference2d( + gs1: Annotated[_ffi.CData, "const GSERIALIZED *"], gs2: Annotated[_ffi.CData, "const GSERIALIZED *"] +) -> Annotated[_ffi.CData, "GSERIALIZED *"]: + gs1_converted = _ffi.cast("const GSERIALIZED *", gs1) + gs2_converted = _ffi.cast("const GSERIALIZED *", gs2) + result = _lib.geom_difference2d(gs1_converted, gs2_converted) _check_error() return result if result != _ffi.NULL else None -def tpoint_AsMVTGeom( - temp: "const Temporal *", - bounds: "const STBox *", - extent: "int32_t", - buffer: "int32_t", - clip_geom: bool, - gsarr: "GSERIALIZED **", - timesarr: "int64 **", -) -> "Tuple['bool', 'int']": - temp_converted = _ffi.cast("const Temporal *", temp) - bounds_converted = _ffi.cast("const STBox *", bounds) - extent_converted = _ffi.cast("int32_t", extent) - buffer_converted = _ffi.cast("int32_t", buffer) - gsarr_converted = [_ffi.cast("GSERIALIZED *", x) for x in gsarr] - timesarr_converted = [_ffi.cast("int64 *", x) for x in timesarr] - count = _ffi.new("int *") - result = _lib.tpoint_AsMVTGeom( - temp_converted, - bounds_converted, - extent_converted, - buffer_converted, - clip_geom, - gsarr_converted, - timesarr_converted, - count, - ) +def geom_intersection2d( + gs1: Annotated[_ffi.CData, "const GSERIALIZED *"], gs2: Annotated[_ffi.CData, "const GSERIALIZED *"] +) -> Annotated[_ffi.CData, "GSERIALIZED *"]: + gs1_converted = _ffi.cast("const GSERIALIZED *", gs1) + gs2_converted = _ffi.cast("const GSERIALIZED *", gs2) + result = _lib.geom_intersection2d(gs1_converted, gs2_converted) _check_error() - return result if result != _ffi.NULL else None, count[0] + return result if result != _ffi.NULL else None -def tpoint_expand_space(temp: "const Temporal *", d: float) -> "STBox *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tpoint_expand_space(temp_converted, d) +def geom_shortestline2d( + gs1: Annotated[_ffi.CData, "const GSERIALIZED *"], s2: Annotated[_ffi.CData, "const GSERIALIZED *"] +) -> Annotated[_ffi.CData, "GSERIALIZED *"]: + gs1_converted = _ffi.cast("const GSERIALIZED *", gs1) + s2_converted = _ffi.cast("const GSERIALIZED *", s2) + result = _lib.geom_shortestline2d(gs1_converted, s2_converted) _check_error() return result if result != _ffi.NULL else None -def tpoint_make_simple(temp: "const Temporal *") -> "Tuple['Temporal **', 'int']": - temp_converted = _ffi.cast("const Temporal *", temp) - count = _ffi.new("int *") - result = _lib.tpoint_make_simple(temp_converted, count) +def geom_shortestline3d( + gs1: Annotated[_ffi.CData, "const GSERIALIZED *"], s2: Annotated[_ffi.CData, "const GSERIALIZED *"] +) -> Annotated[_ffi.CData, "GSERIALIZED *"]: + gs1_converted = _ffi.cast("const GSERIALIZED *", gs1) + s2_converted = _ffi.cast("const GSERIALIZED *", s2) + result = _lib.geom_shortestline3d(gs1_converted, s2_converted) _check_error() - return result if result != _ffi.NULL else None, count[0] + return result if result != _ffi.NULL else None -def tpoint_set_srid(temp: "const Temporal *", srid: "int32_t") -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - srid_converted = _ffi.cast("int32_t", srid) - result = _lib.tpoint_set_srid(temp_converted, srid_converted) +def geom_unary_union(gs: Annotated[_ffi.CData, "GSERIALIZED *"], prec: float) -> Annotated[_ffi.CData, "GSERIALIZED *"]: + gs_converted = _ffi.cast("GSERIALIZED *", gs) + result = _lib.geom_unary_union(gs_converted, prec) _check_error() return result if result != _ffi.NULL else None -def tpoint_tfloat_to_geomeas( - tpoint: "const Temporal *", measure: "const Temporal *", segmentize: bool -) -> "GSERIALIZED **": - tpoint_converted = _ffi.cast("const Temporal *", tpoint) - measure_converted = _ffi.cast("const Temporal *", measure) - out_result = _ffi.new("GSERIALIZED **") - result = _lib.tpoint_tfloat_to_geomeas( - tpoint_converted, measure_converted, segmentize, out_result - ) +def line_interpolate_point( + gs: Annotated[_ffi.CData, "GSERIALIZED *"], distance_fraction: float, repeat: bool +) -> Annotated[_ffi.CData, "GSERIALIZED *"]: + gs_converted = _ffi.cast("GSERIALIZED *", gs) + result = _lib.line_interpolate_point(gs_converted, distance_fraction, repeat) _check_error() - if result: - return out_result if out_result != _ffi.NULL else None - return None + return result if result != _ffi.NULL else None -def acontains_geo_tpoint(gs: "const GSERIALIZED *", temp: "const Temporal *") -> "int": - gs_converted = _ffi.cast("const GSERIALIZED *", gs) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.acontains_geo_tpoint(gs_converted, temp_converted) +def line_locate_point( + gs1: Annotated[_ffi.CData, "const GSERIALIZED *"], gs2: Annotated[_ffi.CData, "const GSERIALIZED *"] +) -> Annotated[float, "double"]: + gs1_converted = _ffi.cast("const GSERIALIZED *", gs1) + gs2_converted = _ffi.cast("const GSERIALIZED *", gs2) + result = _lib.line_locate_point(gs1_converted, gs2_converted) _check_error() return result if result != _ffi.NULL else None -def adisjoint_tpoint_geo(temp: "const Temporal *", gs: "const GSERIALIZED *") -> "int": - temp_converted = _ffi.cast("const Temporal *", temp) +def line_substring( + gs: Annotated[_ffi.CData, "const GSERIALIZED *"], from_: float, to: float +) -> Annotated[_ffi.CData, "GSERIALIZED *"]: gs_converted = _ffi.cast("const GSERIALIZED *", gs) - result = _lib.adisjoint_tpoint_geo(temp_converted, gs_converted) + result = _lib.line_substring(gs_converted, from_, to) _check_error() return result if result != _ffi.NULL else None -def adisjoint_tpoint_tpoint( - temp1: "const Temporal *", temp2: "const Temporal *" -) -> "int": - temp1_converted = _ffi.cast("const Temporal *", temp1) - temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.adisjoint_tpoint_tpoint(temp1_converted, temp2_converted) +def geog_dwithin( + g1: Annotated[_ffi.CData, "const GSERIALIZED *"], + g2: Annotated[_ffi.CData, "const GSERIALIZED *"], + tolerance: float, + use_spheroid: bool, +) -> Annotated[bool, "bool"]: + g1_converted = _ffi.cast("const GSERIALIZED *", g1) + g2_converted = _ffi.cast("const GSERIALIZED *", g2) + result = _lib.geog_dwithin(g1_converted, g2_converted, tolerance, use_spheroid) _check_error() return result if result != _ffi.NULL else None -def adwithin_tpoint_geo( - temp: "const Temporal *", gs: "const GSERIALIZED *", dist: float -) -> "int": - temp_converted = _ffi.cast("const Temporal *", temp) - gs_converted = _ffi.cast("const GSERIALIZED *", gs) - result = _lib.adwithin_tpoint_geo(temp_converted, gs_converted, dist) +def geog_intersects( + gs1: Annotated[_ffi.CData, "const GSERIALIZED *"], + gs2: Annotated[_ffi.CData, "const GSERIALIZED *"], + use_spheroid: bool, +) -> Annotated[bool, "bool"]: + gs1_converted = _ffi.cast("const GSERIALIZED *", gs1) + gs2_converted = _ffi.cast("const GSERIALIZED *", gs2) + result = _lib.geog_intersects(gs1_converted, gs2_converted, use_spheroid) _check_error() return result if result != _ffi.NULL else None -def adwithin_tpoint_tpoint( - temp1: "const Temporal *", temp2: "const Temporal *", dist: float -) -> "int": - temp1_converted = _ffi.cast("const Temporal *", temp1) - temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.adwithin_tpoint_tpoint(temp1_converted, temp2_converted, dist) +def geom_contains( + gs1: Annotated[_ffi.CData, "const GSERIALIZED *"], gs2: Annotated[_ffi.CData, "const GSERIALIZED *"] +) -> Annotated[bool, "bool"]: + gs1_converted = _ffi.cast("const GSERIALIZED *", gs1) + gs2_converted = _ffi.cast("const GSERIALIZED *", gs2) + result = _lib.geom_contains(gs1_converted, gs2_converted) _check_error() return result if result != _ffi.NULL else None -def aintersects_tpoint_geo( - temp: "const Temporal *", gs: "const GSERIALIZED *" -) -> "int": - temp_converted = _ffi.cast("const Temporal *", temp) - gs_converted = _ffi.cast("const GSERIALIZED *", gs) - result = _lib.aintersects_tpoint_geo(temp_converted, gs_converted) +def geom_covers( + gs1: Annotated[_ffi.CData, "const GSERIALIZED *"], gs2: Annotated[_ffi.CData, "const GSERIALIZED *"] +) -> Annotated[bool, "bool"]: + gs1_converted = _ffi.cast("const GSERIALIZED *", gs1) + gs2_converted = _ffi.cast("const GSERIALIZED *", gs2) + result = _lib.geom_covers(gs1_converted, gs2_converted) _check_error() return result if result != _ffi.NULL else None -def aintersects_tpoint_tpoint( - temp1: "const Temporal *", temp2: "const Temporal *" -) -> "int": - temp1_converted = _ffi.cast("const Temporal *", temp1) - temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.aintersects_tpoint_tpoint(temp1_converted, temp2_converted) +def geom_disjoint2d( + gs1: Annotated[_ffi.CData, "const GSERIALIZED *"], gs2: Annotated[_ffi.CData, "const GSERIALIZED *"] +) -> Annotated[bool, "bool"]: + gs1_converted = _ffi.cast("const GSERIALIZED *", gs1) + gs2_converted = _ffi.cast("const GSERIALIZED *", gs2) + result = _lib.geom_disjoint2d(gs1_converted, gs2_converted) _check_error() return result if result != _ffi.NULL else None -def atouches_tpoint_geo(temp: "const Temporal *", gs: "const GSERIALIZED *") -> "int": - temp_converted = _ffi.cast("const Temporal *", temp) - gs_converted = _ffi.cast("const GSERIALIZED *", gs) - result = _lib.atouches_tpoint_geo(temp_converted, gs_converted) +def geom_dwithin2d( + gs1: Annotated[_ffi.CData, "const GSERIALIZED *"], + gs2: Annotated[_ffi.CData, "const GSERIALIZED *"], + tolerance: float, +) -> Annotated[bool, "bool"]: + gs1_converted = _ffi.cast("const GSERIALIZED *", gs1) + gs2_converted = _ffi.cast("const GSERIALIZED *", gs2) + result = _lib.geom_dwithin2d(gs1_converted, gs2_converted, tolerance) _check_error() return result if result != _ffi.NULL else None -def econtains_geo_tpoint(gs: "const GSERIALIZED *", temp: "const Temporal *") -> "int": - gs_converted = _ffi.cast("const GSERIALIZED *", gs) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.econtains_geo_tpoint(gs_converted, temp_converted) +def geom_dwithin3d( + gs1: Annotated[_ffi.CData, "const GSERIALIZED *"], + gs2: Annotated[_ffi.CData, "const GSERIALIZED *"], + tolerance: float, +) -> Annotated[bool, "bool"]: + gs1_converted = _ffi.cast("const GSERIALIZED *", gs1) + gs2_converted = _ffi.cast("const GSERIALIZED *", gs2) + result = _lib.geom_dwithin3d(gs1_converted, gs2_converted, tolerance) _check_error() return result if result != _ffi.NULL else None -def edisjoint_tpoint_geo(temp: "const Temporal *", gs: "const GSERIALIZED *") -> "int": - temp_converted = _ffi.cast("const Temporal *", temp) - gs_converted = _ffi.cast("const GSERIALIZED *", gs) - result = _lib.edisjoint_tpoint_geo(temp_converted, gs_converted) +def geom_intersects2d( + gs1: Annotated[_ffi.CData, "const GSERIALIZED *"], gs2: Annotated[_ffi.CData, "const GSERIALIZED *"] +) -> Annotated[bool, "bool"]: + gs1_converted = _ffi.cast("const GSERIALIZED *", gs1) + gs2_converted = _ffi.cast("const GSERIALIZED *", gs2) + result = _lib.geom_intersects2d(gs1_converted, gs2_converted) _check_error() return result if result != _ffi.NULL else None -def edisjoint_tpoint_tpoint( - temp1: "const Temporal *", temp2: "const Temporal *" -) -> "int": - temp1_converted = _ffi.cast("const Temporal *", temp1) - temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.edisjoint_tpoint_tpoint(temp1_converted, temp2_converted) +def geom_intersects3d( + gs1: Annotated[_ffi.CData, "const GSERIALIZED *"], gs2: Annotated[_ffi.CData, "const GSERIALIZED *"] +) -> Annotated[bool, "bool"]: + gs1_converted = _ffi.cast("const GSERIALIZED *", gs1) + gs2_converted = _ffi.cast("const GSERIALIZED *", gs2) + result = _lib.geom_intersects3d(gs1_converted, gs2_converted) _check_error() return result if result != _ffi.NULL else None -def edwithin_tpoint_geo( - temp: "const Temporal *", gs: "const GSERIALIZED *", dist: float -) -> "int": - temp_converted = _ffi.cast("const Temporal *", temp) - gs_converted = _ffi.cast("const GSERIALIZED *", gs) - result = _lib.edwithin_tpoint_geo(temp_converted, gs_converted, dist) +def geom_relate_pattern( + gs1: Annotated[_ffi.CData, "const GSERIALIZED *"], gs2: Annotated[_ffi.CData, "const GSERIALIZED *"], patt: str +) -> Annotated[bool, "bool"]: + gs1_converted = _ffi.cast("const GSERIALIZED *", gs1) + gs2_converted = _ffi.cast("const GSERIALIZED *", gs2) + patt_converted = patt.encode("utf-8") + result = _lib.geom_relate_pattern(gs1_converted, gs2_converted, patt_converted) _check_error() return result if result != _ffi.NULL else None -def edwithin_tpoint_tpoint( - temp1: "const Temporal *", temp2: "const Temporal *", dist: float -) -> "int": - temp1_converted = _ffi.cast("const Temporal *", temp1) - temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.edwithin_tpoint_tpoint(temp1_converted, temp2_converted, dist) +def geom_touches( + gs1: Annotated[_ffi.CData, "const GSERIALIZED *"], gs2: Annotated[_ffi.CData, "const GSERIALIZED *"] +) -> Annotated[bool, "bool"]: + gs1_converted = _ffi.cast("const GSERIALIZED *", gs1) + gs2_converted = _ffi.cast("const GSERIALIZED *", gs2) + result = _lib.geom_touches(gs1_converted, gs2_converted) _check_error() return result if result != _ffi.NULL else None -def eintersects_tpoint_geo( - temp: "const Temporal *", gs: "const GSERIALIZED *" -) -> "int": - temp_converted = _ffi.cast("const Temporal *", temp) +def geo_stboxes( + gs: Annotated[_ffi.CData, "const GSERIALIZED *"], count: Annotated[_ffi.CData, "int *"] +) -> Annotated[_ffi.CData, "STBox *"]: gs_converted = _ffi.cast("const GSERIALIZED *", gs) - result = _lib.eintersects_tpoint_geo(temp_converted, gs_converted) + count_converted = _ffi.cast("int *", count) + result = _lib.geo_stboxes(gs_converted, count_converted) _check_error() return result if result != _ffi.NULL else None -def eintersects_tpoint_tpoint( - temp1: "const Temporal *", temp2: "const Temporal *" -) -> "int": - temp1_converted = _ffi.cast("const Temporal *", temp1) - temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.eintersects_tpoint_tpoint(temp1_converted, temp2_converted) +def geo_split_each_n_stboxes( + gs: Annotated[_ffi.CData, "const GSERIALIZED *"], elem_count: int, count: Annotated[_ffi.CData, "int *"] +) -> Annotated[_ffi.CData, "STBox *"]: + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + count_converted = _ffi.cast("int *", count) + result = _lib.geo_split_each_n_stboxes(gs_converted, elem_count, count_converted) _check_error() return result if result != _ffi.NULL else None -def etouches_tpoint_geo(temp: "const Temporal *", gs: "const GSERIALIZED *") -> "int": - temp_converted = _ffi.cast("const Temporal *", temp) +def geo_split_n_stboxes( + gs: Annotated[_ffi.CData, "const GSERIALIZED *"], box_count: int, count: Annotated[_ffi.CData, "int *"] +) -> Annotated[_ffi.CData, "STBox *"]: gs_converted = _ffi.cast("const GSERIALIZED *", gs) - result = _lib.etouches_tpoint_geo(temp_converted, gs_converted) + count_converted = _ffi.cast("int *", count) + result = _lib.geo_split_n_stboxes(gs_converted, box_count, count_converted) _check_error() return result if result != _ffi.NULL else None -def tcontains_geo_tpoint( - gs: "const GSERIALIZED *", temp: "const Temporal *", restr: bool, atvalue: bool -) -> "Temporal *": - gs_converted = _ffi.cast("const GSERIALIZED *", gs) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tcontains_geo_tpoint(gs_converted, temp_converted, restr, atvalue) +def geog_distance( + g1: Annotated[_ffi.CData, "const GSERIALIZED *"], g2: Annotated[_ffi.CData, "const GSERIALIZED *"] +) -> Annotated[float, "double"]: + g1_converted = _ffi.cast("const GSERIALIZED *", g1) + g2_converted = _ffi.cast("const GSERIALIZED *", g2) + result = _lib.geog_distance(g1_converted, g2_converted) _check_error() return result if result != _ffi.NULL else None -def tdisjoint_tpoint_geo( - temp: "const Temporal *", gs: "const GSERIALIZED *", restr: bool, atvalue: bool -) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - gs_converted = _ffi.cast("const GSERIALIZED *", gs) - result = _lib.tdisjoint_tpoint_geo(temp_converted, gs_converted, restr, atvalue) +def geom_distance2d( + gs1: Annotated[_ffi.CData, "const GSERIALIZED *"], gs2: Annotated[_ffi.CData, "const GSERIALIZED *"] +) -> Annotated[float, "double"]: + gs1_converted = _ffi.cast("const GSERIALIZED *", gs1) + gs2_converted = _ffi.cast("const GSERIALIZED *", gs2) + result = _lib.geom_distance2d(gs1_converted, gs2_converted) _check_error() return result if result != _ffi.NULL else None -def tdwithin_tpoint_geo( - temp: "const Temporal *", - gs: "const GSERIALIZED *", - dist: float, - restr: bool, - atvalue: bool, -) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - gs_converted = _ffi.cast("const GSERIALIZED *", gs) - result = _lib.tdwithin_tpoint_geo( - temp_converted, gs_converted, dist, restr, atvalue - ) +def geom_distance3d( + gs1: Annotated[_ffi.CData, "const GSERIALIZED *"], gs2: Annotated[_ffi.CData, "const GSERIALIZED *"] +) -> Annotated[float, "double"]: + gs1_converted = _ffi.cast("const GSERIALIZED *", gs1) + gs2_converted = _ffi.cast("const GSERIALIZED *", gs2) + result = _lib.geom_distance3d(gs1_converted, gs2_converted) _check_error() return result if result != _ffi.NULL else None -def tdwithin_tpoint_tpoint( - temp1: "const Temporal *", - temp2: "const Temporal *", - dist: float, - restr: bool, - atvalue: bool, -) -> "Temporal *": - temp1_converted = _ffi.cast("const Temporal *", temp1) - temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.tdwithin_tpoint_tpoint( - temp1_converted, temp2_converted, dist, restr, atvalue - ) +def geo_equals( + gs1: Annotated[_ffi.CData, "const GSERIALIZED *"], gs2: Annotated[_ffi.CData, "const GSERIALIZED *"] +) -> Annotated[int, "int"]: + gs1_converted = _ffi.cast("const GSERIALIZED *", gs1) + gs2_converted = _ffi.cast("const GSERIALIZED *", gs2) + result = _lib.geo_equals(gs1_converted, gs2_converted) _check_error() return result if result != _ffi.NULL else None -def tintersects_tpoint_geo( - temp: "const Temporal *", gs: "const GSERIALIZED *", restr: bool, atvalue: bool -) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - gs_converted = _ffi.cast("const GSERIALIZED *", gs) - result = _lib.tintersects_tpoint_geo(temp_converted, gs_converted, restr, atvalue) +def geo_same( + gs1: Annotated[_ffi.CData, "const GSERIALIZED *"], gs2: Annotated[_ffi.CData, "const GSERIALIZED *"] +) -> Annotated[bool, "bool"]: + gs1_converted = _ffi.cast("const GSERIALIZED *", gs1) + gs2_converted = _ffi.cast("const GSERIALIZED *", gs2) + result = _lib.geo_same(gs1_converted, gs2_converted) _check_error() return result if result != _ffi.NULL else None -def ttouches_tpoint_geo( - temp: "const Temporal *", gs: "const GSERIALIZED *", restr: bool, atvalue: bool -) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - gs_converted = _ffi.cast("const GSERIALIZED *", gs) - result = _lib.ttouches_tpoint_geo(temp_converted, gs_converted, restr, atvalue) +def geogset_in(string: str) -> Annotated[_ffi.CData, "Set *"]: + string_converted = string.encode("utf-8") + result = _lib.geogset_in(string_converted) _check_error() return result if result != _ffi.NULL else None -def tbool_tand_transfn( - state: "Optional['SkipList *']", temp: "const Temporal *" -) -> "SkipList *": - state_converted = _ffi.cast("SkipList *", state) if state is not None else _ffi.NULL - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tbool_tand_transfn(state_converted, temp_converted) +def geomset_in(string: str) -> Annotated[_ffi.CData, "Set *"]: + string_converted = string.encode("utf-8") + result = _lib.geomset_in(string_converted) _check_error() return result if result != _ffi.NULL else None -def tbool_tor_transfn( - state: "Optional['SkipList *']", temp: "const Temporal *" -) -> "SkipList *": - state_converted = _ffi.cast("SkipList *", state) if state is not None else _ffi.NULL - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tbool_tor_transfn(state_converted, temp_converted) +def spatialset_as_text(set: Annotated[_ffi.CData, "const Set *"], maxdd: int) -> Annotated[str, "char *"]: + set_converted = _ffi.cast("const Set *", set) + result = _lib.spatialset_as_text(set_converted, maxdd) _check_error() + result = _ffi.string(result).decode("utf-8") return result if result != _ffi.NULL else None -def temporal_extent_transfn(s: "Span *", temp: "const Temporal *") -> "Span *": - s_converted = _ffi.cast("Span *", s) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.temporal_extent_transfn(s_converted, temp_converted) +def spatialset_as_ewkt(set: Annotated[_ffi.CData, "const Set *"], maxdd: int) -> Annotated[str, "char *"]: + set_converted = _ffi.cast("const Set *", set) + result = _lib.spatialset_as_ewkt(set_converted, maxdd) _check_error() + result = _ffi.string(result).decode("utf-8") return result if result != _ffi.NULL else None -def temporal_tagg_finalfn(state: "SkipList *") -> "Temporal *": - state_converted = _ffi.cast("SkipList *", state) - result = _lib.temporal_tagg_finalfn(state_converted) +def geoset_make(values: Annotated[list, "const GSERIALIZED **"]) -> Annotated[_ffi.CData, "Set *"]: + values_converted = [_ffi.cast("const GSERIALIZED *", x) for x in values] + result = _lib.geoset_make(values_converted, len(values)) _check_error() return result if result != _ffi.NULL else None -def temporal_tcount_transfn( - state: "Optional['SkipList *']", temp: "const Temporal *" -) -> "SkipList *": - state_converted = _ffi.cast("SkipList *", state) if state is not None else _ffi.NULL - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.temporal_tcount_transfn(state_converted, temp_converted) +def geo_to_set(gs: Annotated[_ffi.CData, "const GSERIALIZED *"]) -> Annotated[_ffi.CData, "Set *"]: + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + result = _lib.geo_to_set(gs_converted) _check_error() return result if result != _ffi.NULL else None -def tfloat_tmax_transfn( - state: "Optional['SkipList *']", temp: "const Temporal *" -) -> "SkipList *": - state_converted = _ffi.cast("SkipList *", state) if state is not None else _ffi.NULL - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tfloat_tmax_transfn(state_converted, temp_converted) +def geoset_end_value(s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[_ffi.CData, "GSERIALIZED *"]: + s_converted = _ffi.cast("const Set *", s) + result = _lib.geoset_end_value(s_converted) _check_error() return result if result != _ffi.NULL else None -def tfloat_tmin_transfn( - state: "Optional['SkipList *']", temp: "const Temporal *" -) -> "SkipList *": - state_converted = _ffi.cast("SkipList *", state) if state is not None else _ffi.NULL - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tfloat_tmin_transfn(state_converted, temp_converted) +def geoset_start_value(s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[_ffi.CData, "GSERIALIZED *"]: + s_converted = _ffi.cast("const Set *", s) + result = _lib.geoset_start_value(s_converted) _check_error() return result if result != _ffi.NULL else None -def tfloat_tsum_transfn( - state: "Optional['SkipList *']", temp: "const Temporal *" -) -> "SkipList *": - state_converted = _ffi.cast("SkipList *", state) if state is not None else _ffi.NULL - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tfloat_tsum_transfn(state_converted, temp_converted) +def geoset_value_n(s: Annotated[_ffi.CData, "const Set *"], n: int) -> Annotated[list, "GSERIALIZED **"]: + s_converted = _ffi.cast("const Set *", s) + out_result = _ffi.new("GSERIALIZED **") + result = _lib.geoset_value_n(s_converted, n, out_result) _check_error() - return result if result != _ffi.NULL else None + if result: + return out_result if out_result != _ffi.NULL else None + return None -def tfloat_wmax_transfn( - state: "SkipList *", temp: "const Temporal *", interv: "const Interval *" -) -> "SkipList *": - state_converted = _ffi.cast("SkipList *", state) - temp_converted = _ffi.cast("const Temporal *", temp) - interv_converted = _ffi.cast("const Interval *", interv) - result = _lib.tfloat_wmax_transfn(state_converted, temp_converted, interv_converted) +def geoset_values(s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[_ffi.CData, "GSERIALIZED **"]: + s_converted = _ffi.cast("const Set *", s) + result = _lib.geoset_values(s_converted) _check_error() return result if result != _ffi.NULL else None -def tfloat_wmin_transfn( - state: "SkipList *", temp: "const Temporal *", interv: "const Interval *" -) -> "SkipList *": - state_converted = _ffi.cast("SkipList *", state) - temp_converted = _ffi.cast("const Temporal *", temp) - interv_converted = _ffi.cast("const Interval *", interv) - result = _lib.tfloat_wmin_transfn(state_converted, temp_converted, interv_converted) +def contained_geo_set( + gs: Annotated[_ffi.CData, "const GSERIALIZED *"], s: Annotated[_ffi.CData, "const Set *"] +) -> Annotated[bool, "bool"]: + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + s_converted = _ffi.cast("const Set *", s) + result = _lib.contained_geo_set(gs_converted, s_converted) _check_error() return result if result != _ffi.NULL else None -def tfloat_wsum_transfn( - state: "SkipList *", temp: "const Temporal *", interv: "const Interval *" -) -> "SkipList *": - state_converted = _ffi.cast("SkipList *", state) - temp_converted = _ffi.cast("const Temporal *", temp) - interv_converted = _ffi.cast("const Interval *", interv) - result = _lib.tfloat_wsum_transfn(state_converted, temp_converted, interv_converted) +def contains_set_geo( + s: Annotated[_ffi.CData, "const Set *"], gs: Annotated[_ffi.CData, "GSERIALIZED *"] +) -> Annotated[bool, "bool"]: + s_converted = _ffi.cast("const Set *", s) + gs_converted = _ffi.cast("GSERIALIZED *", gs) + result = _lib.contains_set_geo(s_converted, gs_converted) _check_error() return result if result != _ffi.NULL else None -def timestamptz_tcount_transfn(state: "Optional['SkipList *']", t: int) -> "SkipList *": - state_converted = _ffi.cast("SkipList *", state) if state is not None else _ffi.NULL - t_converted = _ffi.cast("TimestampTz", t) - result = _lib.timestamptz_tcount_transfn(state_converted, t_converted) +def geo_union_transfn( + state: Annotated[_ffi.CData, "Set *"], gs: Annotated[_ffi.CData, "const GSERIALIZED *"] +) -> Annotated[_ffi.CData, "Set *"]: + state_converted = _ffi.cast("Set *", state) + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + result = _lib.geo_union_transfn(state_converted, gs_converted) _check_error() return result if result != _ffi.NULL else None -def tint_tmax_transfn( - state: "Optional['SkipList *']", temp: "const Temporal *" -) -> "SkipList *": - state_converted = _ffi.cast("SkipList *", state) if state is not None else _ffi.NULL - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tint_tmax_transfn(state_converted, temp_converted) +def intersection_geo_set( + gs: Annotated[_ffi.CData, "const GSERIALIZED *"], s: Annotated[_ffi.CData, "const Set *"] +) -> Annotated[_ffi.CData, "Set *"]: + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + s_converted = _ffi.cast("const Set *", s) + result = _lib.intersection_geo_set(gs_converted, s_converted) _check_error() return result if result != _ffi.NULL else None -def tint_tmin_transfn( - state: "Optional['SkipList *']", temp: "const Temporal *" -) -> "SkipList *": - state_converted = _ffi.cast("SkipList *", state) if state is not None else _ffi.NULL - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tint_tmin_transfn(state_converted, temp_converted) +def intersection_set_geo( + s: Annotated[_ffi.CData, "const Set *"], gs: Annotated[_ffi.CData, "const GSERIALIZED *"] +) -> Annotated[_ffi.CData, "Set *"]: + s_converted = _ffi.cast("const Set *", s) + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + result = _lib.intersection_set_geo(s_converted, gs_converted) _check_error() return result if result != _ffi.NULL else None -def tint_tsum_transfn( - state: "Optional['SkipList *']", temp: "const Temporal *" -) -> "SkipList *": - state_converted = _ffi.cast("SkipList *", state) if state is not None else _ffi.NULL - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tint_tsum_transfn(state_converted, temp_converted) +def minus_geo_set( + gs: Annotated[_ffi.CData, "const GSERIALIZED *"], s: Annotated[_ffi.CData, "const Set *"] +) -> Annotated[_ffi.CData, "Set *"]: + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + s_converted = _ffi.cast("const Set *", s) + result = _lib.minus_geo_set(gs_converted, s_converted) _check_error() return result if result != _ffi.NULL else None -def tint_wmax_transfn( - state: "SkipList *", temp: "const Temporal *", interv: "const Interval *" -) -> "SkipList *": - state_converted = _ffi.cast("SkipList *", state) - temp_converted = _ffi.cast("const Temporal *", temp) - interv_converted = _ffi.cast("const Interval *", interv) - result = _lib.tint_wmax_transfn(state_converted, temp_converted, interv_converted) +def minus_set_geo( + s: Annotated[_ffi.CData, "const Set *"], gs: Annotated[_ffi.CData, "const GSERIALIZED *"] +) -> Annotated[_ffi.CData, "Set *"]: + s_converted = _ffi.cast("const Set *", s) + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + result = _lib.minus_set_geo(s_converted, gs_converted) _check_error() return result if result != _ffi.NULL else None -def tint_wmin_transfn( - state: "SkipList *", temp: "const Temporal *", interv: "const Interval *" -) -> "SkipList *": - state_converted = _ffi.cast("SkipList *", state) - temp_converted = _ffi.cast("const Temporal *", temp) - interv_converted = _ffi.cast("const Interval *", interv) - result = _lib.tint_wmin_transfn(state_converted, temp_converted, interv_converted) +def union_geo_set( + gs: Annotated[_ffi.CData, "const GSERIALIZED *"], s: Annotated[_ffi.CData, "const Set *"] +) -> Annotated[_ffi.CData, "Set *"]: + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + s_converted = _ffi.cast("const Set *", s) + result = _lib.union_geo_set(gs_converted, s_converted) _check_error() return result if result != _ffi.NULL else None -def tint_wsum_transfn( - state: "SkipList *", temp: "const Temporal *", interv: "const Interval *" -) -> "SkipList *": - state_converted = _ffi.cast("SkipList *", state) - temp_converted = _ffi.cast("const Temporal *", temp) - interv_converted = _ffi.cast("const Interval *", interv) - result = _lib.tint_wsum_transfn(state_converted, temp_converted, interv_converted) +def union_set_geo( + s: Annotated[_ffi.CData, "const Set *"], gs: Annotated[_ffi.CData, "const GSERIALIZED *"] +) -> Annotated[_ffi.CData, "Set *"]: + s_converted = _ffi.cast("const Set *", s) + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + result = _lib.union_set_geo(s_converted, gs_converted) _check_error() return result if result != _ffi.NULL else None -def tnumber_extent_transfn( - box: "Optional['TBox *']", temp: "const Temporal *" -) -> "TBox *": - box_converted = _ffi.cast("TBox *", box) if box is not None else _ffi.NULL - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tnumber_extent_transfn(box_converted, temp_converted) +def spatialset_set_srid( + s: Annotated[_ffi.CData, "const Set *"], srid: Annotated[_ffi.CData, "int32_t"] +) -> Annotated[_ffi.CData, "Set *"]: + s_converted = _ffi.cast("const Set *", s) + srid_converted = _ffi.cast("int32_t", srid) + result = _lib.spatialset_set_srid(s_converted, srid_converted) _check_error() return result if result != _ffi.NULL else None -def tnumber_tavg_finalfn(state: "SkipList *") -> "Temporal *": - state_converted = _ffi.cast("SkipList *", state) - result = _lib.tnumber_tavg_finalfn(state_converted) +def spatialset_srid(s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[_ffi.CData, "int32_t"]: + s_converted = _ffi.cast("const Set *", s) + result = _lib.spatialset_srid(s_converted) _check_error() return result if result != _ffi.NULL else None -def tnumber_tavg_transfn( - state: "Optional['SkipList *']", temp: "const Temporal *" -) -> "SkipList *": - state_converted = _ffi.cast("SkipList *", state) if state is not None else _ffi.NULL - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tnumber_tavg_transfn(state_converted, temp_converted) +def spatialset_transform( + s: Annotated[_ffi.CData, "const Set *"], srid: Annotated[_ffi.CData, "int32_t"] +) -> Annotated[_ffi.CData, "Set *"]: + s_converted = _ffi.cast("const Set *", s) + srid_converted = _ffi.cast("int32_t", srid) + result = _lib.spatialset_transform(s_converted, srid_converted) _check_error() return result if result != _ffi.NULL else None -def tnumber_wavg_transfn( - state: "SkipList *", temp: "const Temporal *", interv: "const Interval *" -) -> "SkipList *": - state_converted = _ffi.cast("SkipList *", state) - temp_converted = _ffi.cast("const Temporal *", temp) - interv_converted = _ffi.cast("const Interval *", interv) - result = _lib.tnumber_wavg_transfn( - state_converted, temp_converted, interv_converted - ) +def spatialset_transform_pipeline( + s: Annotated[_ffi.CData, "const Set *"], pipelinestr: str, srid: Annotated[_ffi.CData, "int32_t"], is_forward: bool +) -> Annotated[_ffi.CData, "Set *"]: + s_converted = _ffi.cast("const Set *", s) + pipelinestr_converted = pipelinestr.encode("utf-8") + srid_converted = _ffi.cast("int32_t", srid) + result = _lib.spatialset_transform_pipeline(s_converted, pipelinestr_converted, srid_converted, is_forward) _check_error() return result if result != _ffi.NULL else None -def tpoint_extent_transfn( - box: "Optional['STBox *']", temp: "const Temporal *" -) -> "STBox *": - box_converted = _ffi.cast("STBox *", box) if box is not None else _ffi.NULL - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tpoint_extent_transfn(box_converted, temp_converted) +def stbox_as_hexwkb( + box: Annotated[_ffi.CData, "const STBox *"], variant: int +) -> tuple[Annotated[str, "char *"], Annotated[_ffi.CData, "size_t *"]]: + box_converted = _ffi.cast("const STBox *", box) + variant_converted = _ffi.cast("uint8_t", variant) + size = _ffi.new("size_t *") + result = _lib.stbox_as_hexwkb(box_converted, variant_converted, size) _check_error() - return result if result != _ffi.NULL else None + result = _ffi.string(result).decode("utf-8") + return result if result != _ffi.NULL else None, size[0] -def tpoint_tcentroid_finalfn(state: "SkipList *") -> "Temporal *": - state_converted = _ffi.cast("SkipList *", state) - result = _lib.tpoint_tcentroid_finalfn(state_converted) +def stbox_as_wkb( + box: Annotated[_ffi.CData, "const STBox *"], variant: int +) -> tuple[Annotated[_ffi.CData, "uint8_t *"], Annotated[_ffi.CData, "size_t *"]]: + box_converted = _ffi.cast("const STBox *", box) + variant_converted = _ffi.cast("uint8_t", variant) + size_out = _ffi.new("size_t *") + result = _lib.stbox_as_wkb(box_converted, variant_converted, size_out) _check_error() - return result if result != _ffi.NULL else None + result_converted = bytes(result[i] for i in range(size_out[0])) if result != _ffi.NULL else None + return result_converted -def tpoint_tcentroid_transfn(state: "SkipList *", temp: "Temporal *") -> "SkipList *": - state_converted = _ffi.cast("SkipList *", state) - temp_converted = _ffi.cast("Temporal *", temp) - result = _lib.tpoint_tcentroid_transfn(state_converted, temp_converted) +def stbox_from_hexwkb(hexwkb: str) -> Annotated[_ffi.CData, "STBox *"]: + hexwkb_converted = hexwkb.encode("utf-8") + result = _lib.stbox_from_hexwkb(hexwkb_converted) _check_error() return result if result != _ffi.NULL else None -def tstzset_tcount_transfn( - state: "Optional['SkipList *']", s: "const Set *" -) -> "SkipList *": - state_converted = _ffi.cast("SkipList *", state) if state is not None else _ffi.NULL - s_converted = _ffi.cast("const Set *", s) - result = _lib.tstzset_tcount_transfn(state_converted, s_converted) - _check_error() +def stbox_from_wkb(wkb: bytes) -> "STBOX *": + wkb_converted = _ffi.new("uint8_t []", wkb) + result = _lib.stbox_from_wkb(wkb_converted, len(wkb)) return result if result != _ffi.NULL else None -def tstzspan_tcount_transfn( - state: "Optional['SkipList *']", s: "const Span *" -) -> "SkipList *": - state_converted = _ffi.cast("SkipList *", state) if state is not None else _ffi.NULL - s_converted = _ffi.cast("const Span *", s) - result = _lib.tstzspan_tcount_transfn(state_converted, s_converted) +def stbox_in(string: str) -> Annotated[_ffi.CData, "STBox *"]: + string_converted = string.encode("utf-8") + result = _lib.stbox_in(string_converted) _check_error() return result if result != _ffi.NULL else None -def tstzspanset_tcount_transfn( - state: "Optional['SkipList *']", ss: "const SpanSet *" -) -> "SkipList *": - state_converted = _ffi.cast("SkipList *", state) if state is not None else _ffi.NULL - ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.tstzspanset_tcount_transfn(state_converted, ss_converted) +def stbox_out(box: Annotated[_ffi.CData, "const STBox *"], maxdd: int) -> Annotated[str, "char *"]: + box_converted = _ffi.cast("const STBox *", box) + result = _lib.stbox_out(box_converted, maxdd) _check_error() + result = _ffi.string(result).decode("utf-8") return result if result != _ffi.NULL else None -def ttext_tmax_transfn( - state: "Optional['SkipList *']", temp: "const Temporal *" -) -> "SkipList *": - state_converted = _ffi.cast("SkipList *", state) if state is not None else _ffi.NULL - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.ttext_tmax_transfn(state_converted, temp_converted) +def geo_timestamptz_to_stbox( + gs: Annotated[_ffi.CData, "const GSERIALIZED *"], t: int +) -> Annotated[_ffi.CData, "STBox *"]: + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + t_converted = _ffi.cast("TimestampTz", t) + result = _lib.geo_timestamptz_to_stbox(gs_converted, t_converted) _check_error() return result if result != _ffi.NULL else None -def ttext_tmin_transfn( - state: "Optional['SkipList *']", temp: "const Temporal *" -) -> "SkipList *": - state_converted = _ffi.cast("SkipList *", state) if state is not None else _ffi.NULL - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.ttext_tmin_transfn(state_converted, temp_converted) +def geo_tstzspan_to_stbox( + gs: Annotated[_ffi.CData, "const GSERIALIZED *"], s: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[_ffi.CData, "STBox *"]: + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + s_converted = _ffi.cast("const Span *", s) + result = _lib.geo_tstzspan_to_stbox(gs_converted, s_converted) _check_error() return result if result != _ffi.NULL else None -def temporal_simplify_dp( - temp: "const Temporal *", eps_dist: float, synchronized: bool -) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.temporal_simplify_dp(temp_converted, eps_dist, synchronized) +def stbox_copy(box: Annotated[_ffi.CData, "const STBox *"]) -> Annotated[_ffi.CData, "STBox *"]: + box_converted = _ffi.cast("const STBox *", box) + result = _lib.stbox_copy(box_converted) _check_error() return result if result != _ffi.NULL else None -def temporal_simplify_max_dist( - temp: "const Temporal *", eps_dist: float, synchronized: bool -) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.temporal_simplify_max_dist(temp_converted, eps_dist, synchronized) +def stbox_make( + hasx: bool, + hasz: bool, + geodetic: bool, + srid: int, + xmin: float, + xmax: float, + ymin: float, + ymax: float, + zmin: float, + zmax: float, + s: Annotated[_ffi.CData, "const Span *"] | None, +) -> Annotated[_ffi.CData, "STBox *"]: + srid_converted = _ffi.cast("int32", srid) + s_converted = _ffi.cast("const Span *", s) if s is not None else _ffi.NULL + result = _lib.stbox_make(hasx, hasz, geodetic, srid_converted, xmin, xmax, ymin, ymax, zmin, zmax, s_converted) _check_error() return result if result != _ffi.NULL else None -def temporal_simplify_min_dist(temp: "const Temporal *", dist: float) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.temporal_simplify_min_dist(temp_converted, dist) +def geo_to_stbox(gs: Annotated[_ffi.CData, "const GSERIALIZED *"]) -> Annotated[_ffi.CData, "STBox *"]: + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + result = _lib.geo_to_stbox(gs_converted) _check_error() return result if result != _ffi.NULL else None -def temporal_simplify_min_tdelta( - temp: "const Temporal *", mint: "const Interval *" -) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - mint_converted = _ffi.cast("const Interval *", mint) - result = _lib.temporal_simplify_min_tdelta(temp_converted, mint_converted) +def spatialset_to_stbox(s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[_ffi.CData, "STBox *"]: + s_converted = _ffi.cast("const Set *", s) + result = _lib.spatialset_to_stbox(s_converted) _check_error() return result if result != _ffi.NULL else None -def temporal_tprecision( - temp: "const Temporal *", duration: "const Interval *", origin: int -) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - duration_converted = _ffi.cast("const Interval *", duration) - origin_converted = _ffi.cast("TimestampTz", origin) - result = _lib.temporal_tprecision( - temp_converted, duration_converted, origin_converted - ) +def stbox_to_box3d(box: Annotated[_ffi.CData, "const STBox *"]) -> Annotated[_ffi.CData, "BOX3D *"]: + box_converted = _ffi.cast("const STBox *", box) + result = _lib.stbox_to_box3d(box_converted) _check_error() return result if result != _ffi.NULL else None -def temporal_tsample( - temp: "const Temporal *", - duration: "const Interval *", - origin: int, - interp: "interpType", -) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - duration_converted = _ffi.cast("const Interval *", duration) - origin_converted = _ffi.cast("TimestampTz", origin) - interp_converted = _ffi.cast("interpType", interp) - result = _lib.temporal_tsample( - temp_converted, duration_converted, origin_converted, interp_converted - ) +def stbox_to_gbox(box: Annotated[_ffi.CData, "const STBox *"]) -> Annotated[_ffi.CData, "GBOX *"]: + box_converted = _ffi.cast("const STBox *", box) + result = _lib.stbox_to_gbox(box_converted) _check_error() return result if result != _ffi.NULL else None -def temporal_dyntimewarp_distance( - temp1: "const Temporal *", temp2: "const Temporal *" -) -> "double": - temp1_converted = _ffi.cast("const Temporal *", temp1) - temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.temporal_dyntimewarp_distance(temp1_converted, temp2_converted) +def stbox_to_geo(box: Annotated[_ffi.CData, "const STBox *"]) -> Annotated[_ffi.CData, "GSERIALIZED *"]: + box_converted = _ffi.cast("const STBox *", box) + result = _lib.stbox_to_geo(box_converted) _check_error() return result if result != _ffi.NULL else None -def temporal_dyntimewarp_path( - temp1: "const Temporal *", temp2: "const Temporal *" -) -> "Tuple['Match *', 'int']": - temp1_converted = _ffi.cast("const Temporal *", temp1) - temp2_converted = _ffi.cast("const Temporal *", temp2) - count = _ffi.new("int *") - result = _lib.temporal_dyntimewarp_path(temp1_converted, temp2_converted, count) +def stbox_to_tstzspan(box: Annotated[_ffi.CData, "const STBox *"]) -> Annotated[_ffi.CData, "Span *"]: + box_converted = _ffi.cast("const STBox *", box) + result = _lib.stbox_to_tstzspan(box_converted) _check_error() - return result if result != _ffi.NULL else None, count[0] + return result if result != _ffi.NULL else None -def temporal_frechet_distance( - temp1: "const Temporal *", temp2: "const Temporal *" -) -> "double": - temp1_converted = _ffi.cast("const Temporal *", temp1) - temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.temporal_frechet_distance(temp1_converted, temp2_converted) +def timestamptz_to_stbox(t: int) -> Annotated[_ffi.CData, "STBox *"]: + t_converted = _ffi.cast("TimestampTz", t) + result = _lib.timestamptz_to_stbox(t_converted) _check_error() return result if result != _ffi.NULL else None -def temporal_frechet_path( - temp1: "const Temporal *", temp2: "const Temporal *" -) -> "Tuple['Match *', 'int']": - temp1_converted = _ffi.cast("const Temporal *", temp1) - temp2_converted = _ffi.cast("const Temporal *", temp2) - count = _ffi.new("int *") - result = _lib.temporal_frechet_path(temp1_converted, temp2_converted, count) +def tstzset_to_stbox(s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[_ffi.CData, "STBox *"]: + s_converted = _ffi.cast("const Set *", s) + result = _lib.tstzset_to_stbox(s_converted) _check_error() - return result if result != _ffi.NULL else None, count[0] + return result if result != _ffi.NULL else None -def temporal_hausdorff_distance( - temp1: "const Temporal *", temp2: "const Temporal *" -) -> "double": - temp1_converted = _ffi.cast("const Temporal *", temp1) - temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.temporal_hausdorff_distance(temp1_converted, temp2_converted) +def tstzspan_to_stbox(s: Annotated[_ffi.CData, "const Span *"]) -> Annotated[_ffi.CData, "STBox *"]: + s_converted = _ffi.cast("const Span *", s) + result = _lib.tstzspan_to_stbox(s_converted) _check_error() return result if result != _ffi.NULL else None -def bigint_get_bin(value: int, vsize: int, vorigin: int) -> "int64": - value_converted = _ffi.cast("int64", value) - vsize_converted = _ffi.cast("int64", vsize) - vorigin_converted = _ffi.cast("int64", vorigin) - result = _lib.bigint_get_bin(value_converted, vsize_converted, vorigin_converted) +def tstzspanset_to_stbox(ss: Annotated[_ffi.CData, "const SpanSet *"]) -> Annotated[_ffi.CData, "STBox *"]: + ss_converted = _ffi.cast("const SpanSet *", ss) + result = _lib.tstzspanset_to_stbox(ss_converted) _check_error() return result if result != _ffi.NULL else None -def bigintspan_bins( - s: "const Span *", vsize: int, vorigin: int -) -> "Tuple['Span *', 'int']": - s_converted = _ffi.cast("const Span *", s) - vsize_converted = _ffi.cast("int64", vsize) - vorigin_converted = _ffi.cast("int64", vorigin) - count = _ffi.new("int *") - result = _lib.bigintspan_bins( - s_converted, vsize_converted, vorigin_converted, count - ) +def stbox_area(box: Annotated[_ffi.CData, "const STBox *"], spheroid: bool) -> Annotated[float, "double"]: + box_converted = _ffi.cast("const STBox *", box) + result = _lib.stbox_area(box_converted, spheroid) _check_error() - return result if result != _ffi.NULL else None, count[0] + return result if result != _ffi.NULL else None -def bigintspanset_bins( - ss: "const SpanSet *", vsize: int, vorigin: int -) -> "Tuple['Span *', 'int']": - ss_converted = _ffi.cast("const SpanSet *", ss) - vsize_converted = _ffi.cast("int64", vsize) - vorigin_converted = _ffi.cast("int64", vorigin) - count = _ffi.new("int *") - result = _lib.bigintspanset_bins( - ss_converted, vsize_converted, vorigin_converted, count - ) +def stbox_hast(box: Annotated[_ffi.CData, "const STBox *"]) -> Annotated[bool, "bool"]: + box_converted = _ffi.cast("const STBox *", box) + result = _lib.stbox_hast(box_converted) _check_error() - return result if result != _ffi.NULL else None, count[0] + return result if result != _ffi.NULL else None -def bigintspanset_value_spans( - ss: "const SpanSet *", vsize: int, vorigin: int -) -> "Tuple['Span *', 'int']": - ss_converted = _ffi.cast("const SpanSet *", ss) - vsize_converted = _ffi.cast("int64", vsize) - vorigin_converted = _ffi.cast("int64", vorigin) - count = _ffi.new("int *") - result = _lib.bigintspanset_value_spans( - ss_converted, vsize_converted, vorigin_converted, count - ) +def stbox_hasx(box: Annotated[_ffi.CData, "const STBox *"]) -> Annotated[bool, "bool"]: + box_converted = _ffi.cast("const STBox *", box) + result = _lib.stbox_hasx(box_converted) _check_error() - return result if result != _ffi.NULL else None, count[0] + return result if result != _ffi.NULL else None -def date_get_bin( - d: "DateADT", duration: "const Interval *", torigin: "DateADT" -) -> "DateADT": - d_converted = _ffi.cast("DateADT", d) - duration_converted = _ffi.cast("const Interval *", duration) - torigin_converted = _ffi.cast("DateADT", torigin) - result = _lib.date_get_bin(d_converted, duration_converted, torigin_converted) +def stbox_hasz(box: Annotated[_ffi.CData, "const STBox *"]) -> Annotated[bool, "bool"]: + box_converted = _ffi.cast("const STBox *", box) + result = _lib.stbox_hasz(box_converted) _check_error() return result if result != _ffi.NULL else None -def datespan_bins( - s: "const Span *", duration: "const Interval *", torigin: "DateADT" -) -> "Tuple['Span *', 'int']": - s_converted = _ffi.cast("const Span *", s) - duration_converted = _ffi.cast("const Interval *", duration) - torigin_converted = _ffi.cast("DateADT", torigin) - count = _ffi.new("int *") - result = _lib.datespan_bins( - s_converted, duration_converted, torigin_converted, count - ) +def stbox_isgeodetic(box: Annotated[_ffi.CData, "const STBox *"]) -> Annotated[bool, "bool"]: + box_converted = _ffi.cast("const STBox *", box) + result = _lib.stbox_isgeodetic(box_converted) _check_error() - return result if result != _ffi.NULL else None, count[0] + return result if result != _ffi.NULL else None -def datespanset_bins( - ss: "const SpanSet *", duration: "const Interval *", torigin: "DateADT" -) -> "Tuple['Span *', 'int']": - ss_converted = _ffi.cast("const SpanSet *", ss) - duration_converted = _ffi.cast("const Interval *", duration) - torigin_converted = _ffi.cast("DateADT", torigin) - count = _ffi.new("int *") - result = _lib.datespanset_bins( - ss_converted, duration_converted, torigin_converted, count - ) +def stbox_perimeter(box: Annotated[_ffi.CData, "const STBox *"], spheroid: bool) -> Annotated[float, "double"]: + box_converted = _ffi.cast("const STBox *", box) + result = _lib.stbox_perimeter(box_converted, spheroid) _check_error() - return result if result != _ffi.NULL else None, count[0] + return result if result != _ffi.NULL else None -def datespanset_time_spans( - ss: "const SpanSet *", duration: "const Interval *", torigin: "DateADT" -) -> "Tuple['Span *', 'int']": - ss_converted = _ffi.cast("const SpanSet *", ss) - duration_converted = _ffi.cast("const Interval *", duration) - torigin_converted = _ffi.cast("DateADT", torigin) - count = _ffi.new("int *") - result = _lib.datespanset_time_spans( - ss_converted, duration_converted, torigin_converted, count - ) +def stbox_tmax(box: Annotated[_ffi.CData, "const STBox *"]) -> int: + box_converted = _ffi.cast("const STBox *", box) + out_result = _ffi.new("TimestampTz *") + result = _lib.stbox_tmax(box_converted, out_result) _check_error() - return result if result != _ffi.NULL else None, count[0] + if result: + return out_result[0] if out_result[0] != _ffi.NULL else None + return None -def float_get_bin(value: float, vsize: float, vorigin: float) -> "double": - result = _lib.float_get_bin(value, vsize, vorigin) +def stbox_tmax_inc(box: Annotated[_ffi.CData, "const STBox *"]) -> Annotated[_ffi.CData, "bool"]: + box_converted = _ffi.cast("const STBox *", box) + out_result = _ffi.new("bool *") + result = _lib.stbox_tmax_inc(box_converted, out_result) _check_error() - return result if result != _ffi.NULL else None + if result: + return out_result[0] if out_result[0] != _ffi.NULL else None + return None -def floatspan_bins( - s: "const Span *", vsize: float, vorigin: float -) -> "Tuple['Span *', 'int']": - s_converted = _ffi.cast("const Span *", s) - count = _ffi.new("int *") - result = _lib.floatspan_bins(s_converted, vsize, vorigin, count) +def stbox_tmin(box: Annotated[_ffi.CData, "const STBox *"]) -> int: + box_converted = _ffi.cast("const STBox *", box) + out_result = _ffi.new("TimestampTz *") + result = _lib.stbox_tmin(box_converted, out_result) _check_error() - return result if result != _ffi.NULL else None, count[0] + if result: + return out_result[0] if out_result[0] != _ffi.NULL else None + return None -def floatspanset_bins( - ss: "const SpanSet *", vsize: float, vorigin: float -) -> "Tuple['Span *', 'int']": - ss_converted = _ffi.cast("const SpanSet *", ss) - count = _ffi.new("int *") - result = _lib.floatspanset_bins(ss_converted, vsize, vorigin, count) +def stbox_tmin_inc(box: Annotated[_ffi.CData, "const STBox *"]) -> Annotated[_ffi.CData, "bool"]: + box_converted = _ffi.cast("const STBox *", box) + out_result = _ffi.new("bool *") + result = _lib.stbox_tmin_inc(box_converted, out_result) _check_error() - return result if result != _ffi.NULL else None, count[0] + if result: + return out_result[0] if out_result[0] != _ffi.NULL else None + return None -def floatspanset_value_spans( - ss: "const SpanSet *", vsize: float, vorigin: float -) -> "Tuple['Span *', 'int']": - ss_converted = _ffi.cast("const SpanSet *", ss) - count = _ffi.new("int *") - result = _lib.floatspanset_value_spans(ss_converted, vsize, vorigin, count) +def stbox_volume(box: Annotated[_ffi.CData, "const STBox *"]) -> Annotated[float, "double"]: + box_converted = _ffi.cast("const STBox *", box) + result = _lib.stbox_volume(box_converted) _check_error() - return result if result != _ffi.NULL else None, count[0] + return result if result != _ffi.NULL else None -def int_get_bin(value: int, vsize: int, vorigin: int) -> "int": - result = _lib.int_get_bin(value, vsize, vorigin) +def stbox_xmax(box: Annotated[_ffi.CData, "const STBox *"]) -> Annotated[_ffi.CData, "double"]: + box_converted = _ffi.cast("const STBox *", box) + out_result = _ffi.new("double *") + result = _lib.stbox_xmax(box_converted, out_result) _check_error() - return result if result != _ffi.NULL else None + if result: + return out_result[0] if out_result[0] != _ffi.NULL else None + return None -def intspan_bins( - s: "const Span *", vsize: int, vorigin: int -) -> "Tuple['Span *', 'int']": - s_converted = _ffi.cast("const Span *", s) - count = _ffi.new("int *") - result = _lib.intspan_bins(s_converted, vsize, vorigin, count) +def stbox_xmin(box: Annotated[_ffi.CData, "const STBox *"]) -> Annotated[_ffi.CData, "double"]: + box_converted = _ffi.cast("const STBox *", box) + out_result = _ffi.new("double *") + result = _lib.stbox_xmin(box_converted, out_result) _check_error() - return result if result != _ffi.NULL else None, count[0] + if result: + return out_result[0] if out_result[0] != _ffi.NULL else None + return None -def intspanset_bins( - ss: "const SpanSet *", vsize: int, vorigin: int -) -> "Tuple['Span *', 'int']": - ss_converted = _ffi.cast("const SpanSet *", ss) - count = _ffi.new("int *") - result = _lib.intspanset_bins(ss_converted, vsize, vorigin, count) +def stbox_ymax(box: Annotated[_ffi.CData, "const STBox *"]) -> Annotated[_ffi.CData, "double"]: + box_converted = _ffi.cast("const STBox *", box) + out_result = _ffi.new("double *") + result = _lib.stbox_ymax(box_converted, out_result) _check_error() - return result if result != _ffi.NULL else None, count[0] + if result: + return out_result[0] if out_result[0] != _ffi.NULL else None + return None -def intspanset_value_spans( - ss: "const SpanSet *", vsize: int, vorigin: int -) -> "Tuple['Span *', 'int']": - ss_converted = _ffi.cast("const SpanSet *", ss) - count = _ffi.new("int *") - result = _lib.intspanset_value_spans(ss_converted, vsize, vorigin, count) +def stbox_ymin(box: Annotated[_ffi.CData, "const STBox *"]) -> Annotated[_ffi.CData, "double"]: + box_converted = _ffi.cast("const STBox *", box) + out_result = _ffi.new("double *") + result = _lib.stbox_ymin(box_converted, out_result) _check_error() - return result if result != _ffi.NULL else None, count[0] + if result: + return out_result[0] if out_result[0] != _ffi.NULL else None + return None -def timestamptz_get_bin( - t: int, duration: "const Interval *", torigin: int -) -> "TimestampTz": - t_converted = _ffi.cast("TimestampTz", t) - duration_converted = _ffi.cast("const Interval *", duration) - torigin_converted = _ffi.cast("TimestampTz", torigin) - result = _lib.timestamptz_get_bin( - t_converted, duration_converted, torigin_converted - ) +def stbox_zmax(box: Annotated[_ffi.CData, "const STBox *"]) -> Annotated[_ffi.CData, "double"]: + box_converted = _ffi.cast("const STBox *", box) + out_result = _ffi.new("double *") + result = _lib.stbox_zmax(box_converted, out_result) _check_error() - return result if result != _ffi.NULL else None + if result: + return out_result[0] if out_result[0] != _ffi.NULL else None + return None -def tstzspan_bins( - s: "const Span *", duration: "const Interval *", origin: int -) -> "Tuple['Span *', 'int']": - s_converted = _ffi.cast("const Span *", s) - duration_converted = _ffi.cast("const Interval *", duration) - origin_converted = _ffi.cast("TimestampTz", origin) - count = _ffi.new("int *") - result = _lib.tstzspan_bins( - s_converted, duration_converted, origin_converted, count - ) +def stbox_zmin(box: Annotated[_ffi.CData, "const STBox *"]) -> Annotated[_ffi.CData, "double"]: + box_converted = _ffi.cast("const STBox *", box) + out_result = _ffi.new("double *") + result = _lib.stbox_zmin(box_converted, out_result) _check_error() - return result if result != _ffi.NULL else None, count[0] + if result: + return out_result[0] if out_result[0] != _ffi.NULL else None + return None -def tstzspanset_bins( - ss: "const SpanSet *", duration: "const Interval *", torigin: int -) -> "Tuple['Span *', 'int']": - ss_converted = _ffi.cast("const SpanSet *", ss) - duration_converted = _ffi.cast("const Interval *", duration) - torigin_converted = _ffi.cast("TimestampTz", torigin) - count = _ffi.new("int *") - result = _lib.tstzspanset_bins( - ss_converted, duration_converted, torigin_converted, count - ) +def stbox_expand_space(box: Annotated[_ffi.CData, "const STBox *"], d: float) -> Annotated[_ffi.CData, "STBox *"]: + box_converted = _ffi.cast("const STBox *", box) + result = _lib.stbox_expand_space(box_converted, d) _check_error() - return result if result != _ffi.NULL else None, count[0] + return result if result != _ffi.NULL else None -def tstzspanset_time_spans( - ss: "const SpanSet *", duration: "const Interval *", torigin: int -) -> "Tuple['Span *', 'int']": - ss_converted = _ffi.cast("const SpanSet *", ss) - duration_converted = _ffi.cast("const Interval *", duration) - torigin_converted = _ffi.cast("TimestampTz", torigin) - count = _ffi.new("int *") - result = _lib.tstzspanset_time_spans( - ss_converted, duration_converted, torigin_converted, count - ) +def stbox_expand_time( + box: Annotated[_ffi.CData, "const STBox *"], interv: Annotated[_ffi.CData, "const Interval *"] +) -> Annotated[_ffi.CData, "STBox *"]: + box_converted = _ffi.cast("const STBox *", box) + interv_converted = _ffi.cast("const Interval *", interv) + result = _lib.stbox_expand_time(box_converted, interv_converted) _check_error() - return result if result != _ffi.NULL else None, count[0] + return result if result != _ffi.NULL else None -def stbox_get_space_tile( - point: "const GSERIALIZED *", - xsize: float, - ysize: float, - zsize: float, - sorigin: "const GSERIALIZED *", -) -> "STBox *": - point_converted = _ffi.cast("const GSERIALIZED *", point) - sorigin_converted = _ffi.cast("const GSERIALIZED *", sorigin) - result = _lib.stbox_get_space_tile( - point_converted, xsize, ysize, zsize, sorigin_converted - ) +def stbox_get_space(box: Annotated[_ffi.CData, "const STBox *"]) -> Annotated[_ffi.CData, "STBox *"]: + box_converted = _ffi.cast("const STBox *", box) + result = _lib.stbox_get_space(box_converted) _check_error() return result if result != _ffi.NULL else None -def stbox_get_space_time_tile( - point: "const GSERIALIZED *", - t: int, - xsize: float, - ysize: float, - zsize: float, - duration: "const Interval *", - sorigin: "const GSERIALIZED *", - torigin: int, -) -> "STBox *": - point_converted = _ffi.cast("const GSERIALIZED *", point) - t_converted = _ffi.cast("TimestampTz", t) +def stbox_quad_split( + box: Annotated[_ffi.CData, "const STBox *"], count: Annotated[_ffi.CData, "int *"] +) -> Annotated[_ffi.CData, "STBox *"]: + box_converted = _ffi.cast("const STBox *", box) + count_converted = _ffi.cast("int *", count) + result = _lib.stbox_quad_split(box_converted, count_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def stbox_round(box: Annotated[_ffi.CData, "const STBox *"], maxdd: int) -> Annotated[_ffi.CData, "STBox *"]: + box_converted = _ffi.cast("const STBox *", box) + result = _lib.stbox_round(box_converted, maxdd) + _check_error() + return result if result != _ffi.NULL else None + + +def stbox_shift_scale_time( + box: Annotated[_ffi.CData, "const STBox *"], + shift: Annotated[_ffi.CData, "const Interval *"] | None, + duration: Annotated[_ffi.CData, "const Interval *"] | None, +) -> Annotated[_ffi.CData, "STBox *"]: + box_converted = _ffi.cast("const STBox *", box) + shift_converted = _ffi.cast("const Interval *", shift) if shift is not None else _ffi.NULL + duration_converted = _ffi.cast("const Interval *", duration) if duration is not None else _ffi.NULL + result = _lib.stbox_shift_scale_time(box_converted, shift_converted, duration_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def stboxarr_round( + boxarr: Annotated[_ffi.CData, "const STBox *"], count: int, maxdd: int +) -> Annotated[_ffi.CData, "STBox *"]: + boxarr_converted = _ffi.cast("const STBox *", boxarr) + result = _lib.stboxarr_round(boxarr_converted, count, maxdd) + _check_error() + return result if result != _ffi.NULL else None + + +def stbox_set_srid( + box: Annotated[_ffi.CData, "const STBox *"], srid: Annotated[_ffi.CData, "int32_t"] +) -> Annotated[_ffi.CData, "STBox *"]: + box_converted = _ffi.cast("const STBox *", box) + srid_converted = _ffi.cast("int32_t", srid) + result = _lib.stbox_set_srid(box_converted, srid_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def stbox_srid(box: Annotated[_ffi.CData, "const STBox *"]) -> Annotated[_ffi.CData, "int32_t"]: + box_converted = _ffi.cast("const STBox *", box) + result = _lib.stbox_srid(box_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def stbox_transform( + box: Annotated[_ffi.CData, "const STBox *"], srid: Annotated[_ffi.CData, "int32_t"] +) -> Annotated[_ffi.CData, "STBox *"]: + box_converted = _ffi.cast("const STBox *", box) + srid_converted = _ffi.cast("int32_t", srid) + result = _lib.stbox_transform(box_converted, srid_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def stbox_transform_pipeline( + box: Annotated[_ffi.CData, "const STBox *"], + pipelinestr: str, + srid: Annotated[_ffi.CData, "int32_t"], + is_forward: bool, +) -> Annotated[_ffi.CData, "STBox *"]: + box_converted = _ffi.cast("const STBox *", box) + pipelinestr_converted = pipelinestr.encode("utf-8") + srid_converted = _ffi.cast("int32_t", srid) + result = _lib.stbox_transform_pipeline(box_converted, pipelinestr_converted, srid_converted, is_forward) + _check_error() + return result if result != _ffi.NULL else None + + +def adjacent_stbox_stbox( + box1: Annotated[_ffi.CData, "const STBox *"], box2: Annotated[_ffi.CData, "const STBox *"] +) -> Annotated[bool, "bool"]: + box1_converted = _ffi.cast("const STBox *", box1) + box2_converted = _ffi.cast("const STBox *", box2) + result = _lib.adjacent_stbox_stbox(box1_converted, box2_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def contained_stbox_stbox( + box1: Annotated[_ffi.CData, "const STBox *"], box2: Annotated[_ffi.CData, "const STBox *"] +) -> Annotated[bool, "bool"]: + box1_converted = _ffi.cast("const STBox *", box1) + box2_converted = _ffi.cast("const STBox *", box2) + result = _lib.contained_stbox_stbox(box1_converted, box2_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def contains_stbox_stbox( + box1: Annotated[_ffi.CData, "const STBox *"], box2: Annotated[_ffi.CData, "const STBox *"] +) -> Annotated[bool, "bool"]: + box1_converted = _ffi.cast("const STBox *", box1) + box2_converted = _ffi.cast("const STBox *", box2) + result = _lib.contains_stbox_stbox(box1_converted, box2_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def overlaps_stbox_stbox( + box1: Annotated[_ffi.CData, "const STBox *"], box2: Annotated[_ffi.CData, "const STBox *"] +) -> Annotated[bool, "bool"]: + box1_converted = _ffi.cast("const STBox *", box1) + box2_converted = _ffi.cast("const STBox *", box2) + result = _lib.overlaps_stbox_stbox(box1_converted, box2_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def same_stbox_stbox( + box1: Annotated[_ffi.CData, "const STBox *"], box2: Annotated[_ffi.CData, "const STBox *"] +) -> Annotated[bool, "bool"]: + box1_converted = _ffi.cast("const STBox *", box1) + box2_converted = _ffi.cast("const STBox *", box2) + result = _lib.same_stbox_stbox(box1_converted, box2_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def above_stbox_stbox( + box1: Annotated[_ffi.CData, "const STBox *"], box2: Annotated[_ffi.CData, "const STBox *"] +) -> Annotated[bool, "bool"]: + box1_converted = _ffi.cast("const STBox *", box1) + box2_converted = _ffi.cast("const STBox *", box2) + result = _lib.above_stbox_stbox(box1_converted, box2_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def after_stbox_stbox( + box1: Annotated[_ffi.CData, "const STBox *"], box2: Annotated[_ffi.CData, "const STBox *"] +) -> Annotated[bool, "bool"]: + box1_converted = _ffi.cast("const STBox *", box1) + box2_converted = _ffi.cast("const STBox *", box2) + result = _lib.after_stbox_stbox(box1_converted, box2_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def back_stbox_stbox( + box1: Annotated[_ffi.CData, "const STBox *"], box2: Annotated[_ffi.CData, "const STBox *"] +) -> Annotated[bool, "bool"]: + box1_converted = _ffi.cast("const STBox *", box1) + box2_converted = _ffi.cast("const STBox *", box2) + result = _lib.back_stbox_stbox(box1_converted, box2_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def before_stbox_stbox( + box1: Annotated[_ffi.CData, "const STBox *"], box2: Annotated[_ffi.CData, "const STBox *"] +) -> Annotated[bool, "bool"]: + box1_converted = _ffi.cast("const STBox *", box1) + box2_converted = _ffi.cast("const STBox *", box2) + result = _lib.before_stbox_stbox(box1_converted, box2_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def below_stbox_stbox( + box1: Annotated[_ffi.CData, "const STBox *"], box2: Annotated[_ffi.CData, "const STBox *"] +) -> Annotated[bool, "bool"]: + box1_converted = _ffi.cast("const STBox *", box1) + box2_converted = _ffi.cast("const STBox *", box2) + result = _lib.below_stbox_stbox(box1_converted, box2_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def front_stbox_stbox( + box1: Annotated[_ffi.CData, "const STBox *"], box2: Annotated[_ffi.CData, "const STBox *"] +) -> Annotated[bool, "bool"]: + box1_converted = _ffi.cast("const STBox *", box1) + box2_converted = _ffi.cast("const STBox *", box2) + result = _lib.front_stbox_stbox(box1_converted, box2_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def left_stbox_stbox( + box1: Annotated[_ffi.CData, "const STBox *"], box2: Annotated[_ffi.CData, "const STBox *"] +) -> Annotated[bool, "bool"]: + box1_converted = _ffi.cast("const STBox *", box1) + box2_converted = _ffi.cast("const STBox *", box2) + result = _lib.left_stbox_stbox(box1_converted, box2_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def overabove_stbox_stbox( + box1: Annotated[_ffi.CData, "const STBox *"], box2: Annotated[_ffi.CData, "const STBox *"] +) -> Annotated[bool, "bool"]: + box1_converted = _ffi.cast("const STBox *", box1) + box2_converted = _ffi.cast("const STBox *", box2) + result = _lib.overabove_stbox_stbox(box1_converted, box2_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def overafter_stbox_stbox( + box1: Annotated[_ffi.CData, "const STBox *"], box2: Annotated[_ffi.CData, "const STBox *"] +) -> Annotated[bool, "bool"]: + box1_converted = _ffi.cast("const STBox *", box1) + box2_converted = _ffi.cast("const STBox *", box2) + result = _lib.overafter_stbox_stbox(box1_converted, box2_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def overback_stbox_stbox( + box1: Annotated[_ffi.CData, "const STBox *"], box2: Annotated[_ffi.CData, "const STBox *"] +) -> Annotated[bool, "bool"]: + box1_converted = _ffi.cast("const STBox *", box1) + box2_converted = _ffi.cast("const STBox *", box2) + result = _lib.overback_stbox_stbox(box1_converted, box2_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def overbefore_stbox_stbox( + box1: Annotated[_ffi.CData, "const STBox *"], box2: Annotated[_ffi.CData, "const STBox *"] +) -> Annotated[bool, "bool"]: + box1_converted = _ffi.cast("const STBox *", box1) + box2_converted = _ffi.cast("const STBox *", box2) + result = _lib.overbefore_stbox_stbox(box1_converted, box2_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def overbelow_stbox_stbox( + box1: Annotated[_ffi.CData, "const STBox *"], box2: Annotated[_ffi.CData, "const STBox *"] +) -> Annotated[bool, "bool"]: + box1_converted = _ffi.cast("const STBox *", box1) + box2_converted = _ffi.cast("const STBox *", box2) + result = _lib.overbelow_stbox_stbox(box1_converted, box2_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def overfront_stbox_stbox( + box1: Annotated[_ffi.CData, "const STBox *"], box2: Annotated[_ffi.CData, "const STBox *"] +) -> Annotated[bool, "bool"]: + box1_converted = _ffi.cast("const STBox *", box1) + box2_converted = _ffi.cast("const STBox *", box2) + result = _lib.overfront_stbox_stbox(box1_converted, box2_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def overleft_stbox_stbox( + box1: Annotated[_ffi.CData, "const STBox *"], box2: Annotated[_ffi.CData, "const STBox *"] +) -> Annotated[bool, "bool"]: + box1_converted = _ffi.cast("const STBox *", box1) + box2_converted = _ffi.cast("const STBox *", box2) + result = _lib.overleft_stbox_stbox(box1_converted, box2_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def overright_stbox_stbox( + box1: Annotated[_ffi.CData, "const STBox *"], box2: Annotated[_ffi.CData, "const STBox *"] +) -> Annotated[bool, "bool"]: + box1_converted = _ffi.cast("const STBox *", box1) + box2_converted = _ffi.cast("const STBox *", box2) + result = _lib.overright_stbox_stbox(box1_converted, box2_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def right_stbox_stbox( + box1: Annotated[_ffi.CData, "const STBox *"], box2: Annotated[_ffi.CData, "const STBox *"] +) -> Annotated[bool, "bool"]: + box1_converted = _ffi.cast("const STBox *", box1) + box2_converted = _ffi.cast("const STBox *", box2) + result = _lib.right_stbox_stbox(box1_converted, box2_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def union_stbox_stbox( + box1: Annotated[_ffi.CData, "const STBox *"], box2: Annotated[_ffi.CData, "const STBox *"], strict: bool +) -> Annotated[_ffi.CData, "STBox *"]: + box1_converted = _ffi.cast("const STBox *", box1) + box2_converted = _ffi.cast("const STBox *", box2) + result = _lib.union_stbox_stbox(box1_converted, box2_converted, strict) + _check_error() + return result if result != _ffi.NULL else None + + +def intersection_stbox_stbox( + box1: Annotated[_ffi.CData, "const STBox *"], box2: Annotated[_ffi.CData, "const STBox *"] +) -> Annotated[_ffi.CData, "STBox *"]: + box1_converted = _ffi.cast("const STBox *", box1) + box2_converted = _ffi.cast("const STBox *", box2) + result = _lib.intersection_stbox_stbox(box1_converted, box2_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def stbox_cmp( + box1: Annotated[_ffi.CData, "const STBox *"], box2: Annotated[_ffi.CData, "const STBox *"] +) -> Annotated[int, "int"]: + box1_converted = _ffi.cast("const STBox *", box1) + box2_converted = _ffi.cast("const STBox *", box2) + result = _lib.stbox_cmp(box1_converted, box2_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def stbox_eq( + box1: Annotated[_ffi.CData, "const STBox *"], box2: Annotated[_ffi.CData, "const STBox *"] +) -> Annotated[bool, "bool"]: + box1_converted = _ffi.cast("const STBox *", box1) + box2_converted = _ffi.cast("const STBox *", box2) + result = _lib.stbox_eq(box1_converted, box2_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def stbox_ge( + box1: Annotated[_ffi.CData, "const STBox *"], box2: Annotated[_ffi.CData, "const STBox *"] +) -> Annotated[bool, "bool"]: + box1_converted = _ffi.cast("const STBox *", box1) + box2_converted = _ffi.cast("const STBox *", box2) + result = _lib.stbox_ge(box1_converted, box2_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def stbox_gt( + box1: Annotated[_ffi.CData, "const STBox *"], box2: Annotated[_ffi.CData, "const STBox *"] +) -> Annotated[bool, "bool"]: + box1_converted = _ffi.cast("const STBox *", box1) + box2_converted = _ffi.cast("const STBox *", box2) + result = _lib.stbox_gt(box1_converted, box2_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def stbox_le( + box1: Annotated[_ffi.CData, "const STBox *"], box2: Annotated[_ffi.CData, "const STBox *"] +) -> Annotated[bool, "bool"]: + box1_converted = _ffi.cast("const STBox *", box1) + box2_converted = _ffi.cast("const STBox *", box2) + result = _lib.stbox_le(box1_converted, box2_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def stbox_lt( + box1: Annotated[_ffi.CData, "const STBox *"], box2: Annotated[_ffi.CData, "const STBox *"] +) -> Annotated[bool, "bool"]: + box1_converted = _ffi.cast("const STBox *", box1) + box2_converted = _ffi.cast("const STBox *", box2) + result = _lib.stbox_lt(box1_converted, box2_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def stbox_ne( + box1: Annotated[_ffi.CData, "const STBox *"], box2: Annotated[_ffi.CData, "const STBox *"] +) -> Annotated[bool, "bool"]: + box1_converted = _ffi.cast("const STBox *", box1) + box2_converted = _ffi.cast("const STBox *", box2) + result = _lib.stbox_ne(box1_converted, box2_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def rtree_create_stbox() -> Annotated[_ffi.CData, "RTree *"]: + result = _lib.rtree_create_stbox() + _check_error() + return result if result != _ffi.NULL else None + + +def rtree_free(rtree: Annotated[_ffi.CData, "RTree *"]) -> Annotated[None, "void"]: + rtree_converted = _ffi.cast("RTree *", rtree) + _lib.rtree_free(rtree_converted) + _check_error() + + +def rtree_insert( + rtree: Annotated[_ffi.CData, "RTree *"], box: Annotated[_ffi.CData, "STBox *"], id: int +) -> Annotated[None, "void"]: + rtree_converted = _ffi.cast("RTree *", rtree) + box_converted = _ffi.cast("STBox *", box) + id_converted = _ffi.cast("int64", id) + _lib.rtree_insert(rtree_converted, box_converted, id_converted) + _check_error() + + +def rtree_search( + rtree: Annotated[_ffi.CData, "const RTree *"], + query: Annotated[_ffi.CData, "const STBox *"], + count: Annotated[_ffi.CData, "int *"], +) -> Annotated[_ffi.CData, "int *"]: + rtree_converted = _ffi.cast("const RTree *", rtree) + query_converted = _ffi.cast("const STBox *", query) + count_converted = _ffi.cast("int *", count) + result = _lib.rtree_search(rtree_converted, query_converted, count_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def tgeo_out(temp: Annotated[_ffi.CData, "const Temporal *"], maxdd: int) -> Annotated[str, "char *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.tgeo_out(temp_converted, maxdd) + _check_error() + result = _ffi.string(result).decode("utf-8") + return result if result != _ffi.NULL else None + + +def tgeogpoint_from_mfjson(string: str) -> Annotated[_ffi.CData, "Temporal *"]: + string_converted = string.encode("utf-8") + result = _lib.tgeogpoint_from_mfjson(string_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def tgeogpoint_in(string: str) -> Annotated[_ffi.CData, "Temporal *"]: + string_converted = string.encode("utf-8") + result = _lib.tgeogpoint_in(string_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def tgeography_from_mfjson(mfjson: str) -> Annotated[_ffi.CData, "Temporal *"]: + mfjson_converted = mfjson.encode("utf-8") + result = _lib.tgeography_from_mfjson(mfjson_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def tgeography_in(string: str) -> Annotated[_ffi.CData, "Temporal *"]: + string_converted = string.encode("utf-8") + result = _lib.tgeography_in(string_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def tgeometry_from_mfjson(string: str) -> Annotated[_ffi.CData, "Temporal *"]: + string_converted = string.encode("utf-8") + result = _lib.tgeometry_from_mfjson(string_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def tgeometry_in(string: str) -> Annotated[_ffi.CData, "Temporal *"]: + string_converted = string.encode("utf-8") + result = _lib.tgeometry_in(string_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def tgeompoint_from_mfjson(string: str) -> Annotated[_ffi.CData, "Temporal *"]: + string_converted = string.encode("utf-8") + result = _lib.tgeompoint_from_mfjson(string_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def tgeompoint_in(string: str) -> Annotated[_ffi.CData, "Temporal *"]: + string_converted = string.encode("utf-8") + result = _lib.tgeompoint_in(string_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def tspatial_as_ewkt(temp: Annotated[_ffi.CData, "const Temporal *"], maxdd: int) -> Annotated[str, "char *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.tspatial_as_ewkt(temp_converted, maxdd) + _check_error() + result = _ffi.string(result).decode("utf-8") + return result if result != _ffi.NULL else None + + +def tspatial_as_text(temp: Annotated[_ffi.CData, "const Temporal *"], maxdd: int) -> Annotated[str, "char *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.tspatial_as_text(temp_converted, maxdd) + _check_error() + result = _ffi.string(result).decode("utf-8") + return result if result != _ffi.NULL else None + + +def tgeo_from_base_temp( + gs: Annotated[_ffi.CData, "const GSERIALIZED *"], temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[_ffi.CData, "Temporal *"]: + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.tgeo_from_base_temp(gs_converted, temp_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def tgeoinst_make(gs: Annotated[_ffi.CData, "const GSERIALIZED *"], t: int) -> Annotated[_ffi.CData, "TInstant *"]: + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + t_converted = _ffi.cast("TimestampTz", t) + result = _lib.tgeoinst_make(gs_converted, t_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def tgeoseq_from_base_tstzset( + gs: Annotated[_ffi.CData, "const GSERIALIZED *"], s: Annotated[_ffi.CData, "const Set *"] +) -> Annotated[_ffi.CData, "TSequence *"]: + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + s_converted = _ffi.cast("const Set *", s) + result = _lib.tgeoseq_from_base_tstzset(gs_converted, s_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def tgeoseq_from_base_tstzspan( + gs: Annotated[_ffi.CData, "const GSERIALIZED *"], + s: Annotated[_ffi.CData, "const Span *"], + interp: InterpolationType, +) -> Annotated[_ffi.CData, "TSequence *"]: + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + s_converted = _ffi.cast("const Span *", s) + result = _lib.tgeoseq_from_base_tstzspan(gs_converted, s_converted, interp) + _check_error() + return result if result != _ffi.NULL else None + + +def tgeoseqset_from_base_tstzspanset( + gs: Annotated[_ffi.CData, "const GSERIALIZED *"], + ss: Annotated[_ffi.CData, "const SpanSet *"], + interp: InterpolationType, +) -> Annotated[_ffi.CData, "TSequenceSet *"]: + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + ss_converted = _ffi.cast("const SpanSet *", ss) + result = _lib.tgeoseqset_from_base_tstzspanset(gs_converted, ss_converted, interp) + _check_error() + return result if result != _ffi.NULL else None + + +def tpoint_from_base_temp( + gs: Annotated[_ffi.CData, "const GSERIALIZED *"], temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[_ffi.CData, "Temporal *"]: + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.tpoint_from_base_temp(gs_converted, temp_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def tpointinst_make(gs: Annotated[_ffi.CData, "const GSERIALIZED *"], t: int) -> Annotated[_ffi.CData, "TInstant *"]: + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + t_converted = _ffi.cast("TimestampTz", t) + result = _lib.tpointinst_make(gs_converted, t_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def tpointseq_from_base_tstzset( + gs: Annotated[_ffi.CData, "const GSERIALIZED *"], s: Annotated[_ffi.CData, "const Set *"] +) -> Annotated[_ffi.CData, "TSequence *"]: + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + s_converted = _ffi.cast("const Set *", s) + result = _lib.tpointseq_from_base_tstzset(gs_converted, s_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def tpointseq_from_base_tstzspan( + gs: Annotated[_ffi.CData, "const GSERIALIZED *"], + s: Annotated[_ffi.CData, "const Span *"], + interp: InterpolationType, +) -> Annotated[_ffi.CData, "TSequence *"]: + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + s_converted = _ffi.cast("const Span *", s) + result = _lib.tpointseq_from_base_tstzspan(gs_converted, s_converted, interp) + _check_error() + return result if result != _ffi.NULL else None + + +def tpointseq_make_coords( + xcoords: Annotated[_ffi.CData, "const double *"], + ycoords: Annotated[_ffi.CData, "const double *"], + zcoords: Annotated[_ffi.CData, "const double *"], + times: int, + count: int, + srid: int, + geodetic: bool, + lower_inc: bool, + upper_inc: bool, + interp: InterpolationType, + normalize: bool, +) -> Annotated[_ffi.CData, "TSequence *"]: + xcoords_converted = _ffi.cast("const double *", xcoords) + ycoords_converted = _ffi.cast("const double *", ycoords) + zcoords_converted = _ffi.cast("const double *", zcoords) + times_converted = _ffi.cast("const TimestampTz *", times) + srid_converted = _ffi.cast("int32", srid) + result = _lib.tpointseq_make_coords( + xcoords_converted, + ycoords_converted, + zcoords_converted, + times_converted, + count, + srid_converted, + geodetic, + lower_inc, + upper_inc, + interp, + normalize, + ) + _check_error() + return result if result != _ffi.NULL else None + + +def tpointseqset_from_base_tstzspanset( + gs: Annotated[_ffi.CData, "const GSERIALIZED *"], + ss: Annotated[_ffi.CData, "const SpanSet *"], + interp: InterpolationType, +) -> Annotated[_ffi.CData, "TSequenceSet *"]: + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + ss_converted = _ffi.cast("const SpanSet *", ss) + result = _lib.tpointseqset_from_base_tstzspanset(gs_converted, ss_converted, interp) + _check_error() + return result if result != _ffi.NULL else None + + +def box3d_to_stbox(box: Annotated[_ffi.CData, "const BOX3D *"]) -> Annotated[_ffi.CData, "STBox *"]: + box_converted = _ffi.cast("const BOX3D *", box) + result = _lib.box3d_to_stbox(box_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def gbox_to_stbox(box: Annotated[_ffi.CData, "const GBOX *"]) -> Annotated[_ffi.CData, "STBox *"]: + box_converted = _ffi.cast("const GBOX *", box) + result = _lib.gbox_to_stbox(box_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def geomeas_to_tpoint(gs: Annotated[_ffi.CData, "const GSERIALIZED *"]) -> Annotated[_ffi.CData, "Temporal *"]: + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + result = _lib.geomeas_to_tpoint(gs_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def tgeogpoint_to_tgeography(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "Temporal *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.tgeogpoint_to_tgeography(temp_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def tgeography_to_tgeogpoint(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "Temporal *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.tgeography_to_tgeogpoint(temp_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def tgeography_to_tgeometry(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "Temporal *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.tgeography_to_tgeometry(temp_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def tgeometry_to_tgeography(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "Temporal *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.tgeometry_to_tgeography(temp_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def tgeometry_to_tgeompoint(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "Temporal *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.tgeometry_to_tgeompoint(temp_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def tgeompoint_to_tgeometry(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "Temporal *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.tgeompoint_to_tgeometry(temp_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def tpoint_as_mvtgeom( + temp: Annotated[_ffi.CData, "const Temporal *"], + bounds: Annotated[_ffi.CData, "const STBox *"], + extent: Annotated[_ffi.CData, "int32_t"], + buffer: Annotated[_ffi.CData, "int32_t"], + clip_geom: bool, + gsarr: Annotated[list, "GSERIALIZED **"], + timesarr: Annotated[list, "int64 **"], + count: Annotated[_ffi.CData, "int *"], +) -> Annotated[bool, "bool"]: + temp_converted = _ffi.cast("const Temporal *", temp) + bounds_converted = _ffi.cast("const STBox *", bounds) + extent_converted = _ffi.cast("int32_t", extent) + buffer_converted = _ffi.cast("int32_t", buffer) + gsarr_converted = [_ffi.cast("GSERIALIZED *", x) for x in gsarr] + timesarr_converted = [_ffi.cast("int64 *", x) for x in timesarr] + count_converted = _ffi.cast("int *", count) + result = _lib.tpoint_as_mvtgeom( + temp_converted, + bounds_converted, + extent_converted, + buffer_converted, + clip_geom, + gsarr_converted, + timesarr_converted, + count_converted, + ) + _check_error() + return result if result != _ffi.NULL else None + + +def tpoint_tfloat_to_geomeas( + tpoint: Annotated[_ffi.CData, "const Temporal *"], + measure: Annotated[_ffi.CData, "const Temporal *"], + segmentize: bool, +) -> Annotated[list, "GSERIALIZED **"]: + tpoint_converted = _ffi.cast("const Temporal *", tpoint) + measure_converted = _ffi.cast("const Temporal *", measure) + out_result = _ffi.new("GSERIALIZED **") + result = _lib.tpoint_tfloat_to_geomeas(tpoint_converted, measure_converted, segmentize, out_result) + _check_error() + if result: + return out_result if out_result != _ffi.NULL else None + return None + + +def tspatial_to_stbox(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "STBox *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.tspatial_to_stbox(temp_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def bearing_point_point( + gs1: Annotated[_ffi.CData, "const GSERIALIZED *"], gs2: Annotated[_ffi.CData, "const GSERIALIZED *"] +) -> Annotated[_ffi.CData, "double"]: + gs1_converted = _ffi.cast("const GSERIALIZED *", gs1) + gs2_converted = _ffi.cast("const GSERIALIZED *", gs2) + out_result = _ffi.new("double *") + result = _lib.bearing_point_point(gs1_converted, gs2_converted, out_result) + _check_error() + if result: + return out_result[0] if out_result[0] != _ffi.NULL else None + return None + + +def bearing_tpoint_point( + temp: Annotated[_ffi.CData, "const Temporal *"], gs: Annotated[_ffi.CData, "const GSERIALIZED *"], invert: bool +) -> Annotated[_ffi.CData, "Temporal *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + result = _lib.bearing_tpoint_point(temp_converted, gs_converted, invert) + _check_error() + return result if result != _ffi.NULL else None + + +def bearing_tpoint_tpoint( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[_ffi.CData, "Temporal *"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.bearing_tpoint_tpoint(temp1_converted, temp2_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def tgeo_centroid(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "Temporal *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.tgeo_centroid(temp_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def tgeo_convex_hull(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "GSERIALIZED *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.tgeo_convex_hull(temp_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def tgeo_end_value(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "GSERIALIZED *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.tgeo_end_value(temp_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def tgeo_start_value(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "GSERIALIZED *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.tgeo_start_value(temp_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def tgeo_traversed_area( + temp: Annotated[_ffi.CData, "const Temporal *"], unary_union: bool +) -> Annotated[_ffi.CData, "GSERIALIZED *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.tgeo_traversed_area(temp_converted, unary_union) + _check_error() + return result if result != _ffi.NULL else None + + +def tgeo_value_at_timestamptz( + temp: Annotated[_ffi.CData, "const Temporal *"], t: int, strict: bool +) -> Annotated[list, "GSERIALIZED **"]: + temp_converted = _ffi.cast("const Temporal *", temp) + t_converted = _ffi.cast("TimestampTz", t) + out_result = _ffi.new("GSERIALIZED **") + result = _lib.tgeo_value_at_timestamptz(temp_converted, t_converted, strict, out_result) + _check_error() + if result: + return out_result if out_result != _ffi.NULL else None + return None + + +def tgeo_value_n(temp: Annotated[_ffi.CData, "const Temporal *"], n: int) -> Annotated[list, "GSERIALIZED **"]: + temp_converted = _ffi.cast("const Temporal *", temp) + out_result = _ffi.new("GSERIALIZED **") + result = _lib.tgeo_value_n(temp_converted, n, out_result) + _check_error() + if result: + return out_result if out_result != _ffi.NULL else None + return None + + +def tgeo_values( + temp: Annotated[_ffi.CData, "const Temporal *"], count: Annotated[_ffi.CData, "int *"] +) -> Annotated[_ffi.CData, "GSERIALIZED **"]: + temp_converted = _ffi.cast("const Temporal *", temp) + count_converted = _ffi.cast("int *", count) + result = _lib.tgeo_values(temp_converted, count_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def tpoint_angular_difference(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "Temporal *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.tpoint_angular_difference(temp_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def tpoint_azimuth(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "Temporal *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.tpoint_azimuth(temp_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def tpoint_cumulative_length(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "Temporal *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.tpoint_cumulative_length(temp_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def tpoint_direction(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "double"]: + temp_converted = _ffi.cast("const Temporal *", temp) + out_result = _ffi.new("double *") + result = _lib.tpoint_direction(temp_converted, out_result) + _check_error() + if result: + return out_result[0] if out_result[0] != _ffi.NULL else None + return None + + +def tpoint_get_x(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "Temporal *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.tpoint_get_x(temp_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def tpoint_get_y(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "Temporal *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.tpoint_get_y(temp_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def tpoint_get_z(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "Temporal *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.tpoint_get_z(temp_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def tpoint_is_simple(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[bool, "bool"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.tpoint_is_simple(temp_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def tpoint_length(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[float, "double"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.tpoint_length(temp_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def tpoint_speed(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "Temporal *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.tpoint_speed(temp_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def tpoint_trajectory( + temp: Annotated[_ffi.CData, "const Temporal *"], unary_union: bool +) -> Annotated[_ffi.CData, "GSERIALIZED *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.tpoint_trajectory(temp_converted, unary_union) + _check_error() + return result if result != _ffi.NULL else None + + +def tpoint_twcentroid(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "GSERIALIZED *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.tpoint_twcentroid(temp_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def tgeo_affine( + temp: Annotated[_ffi.CData, "const Temporal *"], a: Annotated[_ffi.CData, "const AFFINE *"] +) -> Annotated[_ffi.CData, "Temporal *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + a_converted = _ffi.cast("const AFFINE *", a) + result = _lib.tgeo_affine(temp_converted, a_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def tgeo_scale( + temp: Annotated[_ffi.CData, "const Temporal *"], + scale: Annotated[_ffi.CData, "const GSERIALIZED *"], + sorigin: Annotated[_ffi.CData, "const GSERIALIZED *"], +) -> Annotated[_ffi.CData, "Temporal *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + scale_converted = _ffi.cast("const GSERIALIZED *", scale) + sorigin_converted = _ffi.cast("const GSERIALIZED *", sorigin) + result = _lib.tgeo_scale(temp_converted, scale_converted, sorigin_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def tpoint_make_simple( + temp: Annotated[_ffi.CData, "const Temporal *"], count: Annotated[_ffi.CData, "int *"] +) -> Annotated[_ffi.CData, "Temporal **"]: + temp_converted = _ffi.cast("const Temporal *", temp) + count_converted = _ffi.cast("int *", count) + result = _lib.tpoint_make_simple(temp_converted, count_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def tspatial_srid(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "int32_t"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.tspatial_srid(temp_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def tspatial_set_srid( + temp: Annotated[_ffi.CData, "const Temporal *"], srid: Annotated[_ffi.CData, "int32_t"] +) -> Annotated[_ffi.CData, "Temporal *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + srid_converted = _ffi.cast("int32_t", srid) + result = _lib.tspatial_set_srid(temp_converted, srid_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def tspatial_transform( + temp: Annotated[_ffi.CData, "const Temporal *"], srid: Annotated[_ffi.CData, "int32_t"] +) -> Annotated[_ffi.CData, "Temporal *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + srid_converted = _ffi.cast("int32_t", srid) + result = _lib.tspatial_transform(temp_converted, srid_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def tspatial_transform_pipeline( + temp: Annotated[_ffi.CData, "const Temporal *"], + pipelinestr: str, + srid: Annotated[_ffi.CData, "int32_t"], + is_forward: bool, +) -> Annotated[_ffi.CData, "Temporal *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + pipelinestr_converted = pipelinestr.encode("utf-8") + srid_converted = _ffi.cast("int32_t", srid) + result = _lib.tspatial_transform_pipeline(temp_converted, pipelinestr_converted, srid_converted, is_forward) + _check_error() + return result if result != _ffi.NULL else None + + +def tgeo_at_geom( + temp: Annotated[_ffi.CData, "const Temporal *"], gs: Annotated[_ffi.CData, "const GSERIALIZED *"] +) -> Annotated[_ffi.CData, "Temporal *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + result = _lib.tgeo_at_geom(temp_converted, gs_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def tgeo_at_stbox( + temp: Annotated[_ffi.CData, "const Temporal *"], box: Annotated[_ffi.CData, "const STBox *"], border_inc: bool +) -> Annotated[_ffi.CData, "Temporal *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + box_converted = _ffi.cast("const STBox *", box) + result = _lib.tgeo_at_stbox(temp_converted, box_converted, border_inc) + _check_error() + return result if result != _ffi.NULL else None + + +def tgeo_at_value( + temp: Annotated[_ffi.CData, "const Temporal *"], gs: Annotated[_ffi.CData, "GSERIALIZED *"] +) -> Annotated[_ffi.CData, "Temporal *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + gs_converted = _ffi.cast("GSERIALIZED *", gs) + result = _lib.tgeo_at_value(temp_converted, gs_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def tgeo_minus_geom( + temp: Annotated[_ffi.CData, "const Temporal *"], gs: Annotated[_ffi.CData, "const GSERIALIZED *"] +) -> Annotated[_ffi.CData, "Temporal *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + result = _lib.tgeo_minus_geom(temp_converted, gs_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def tgeo_minus_stbox( + temp: Annotated[_ffi.CData, "const Temporal *"], box: Annotated[_ffi.CData, "const STBox *"], border_inc: bool +) -> Annotated[_ffi.CData, "Temporal *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + box_converted = _ffi.cast("const STBox *", box) + result = _lib.tgeo_minus_stbox(temp_converted, box_converted, border_inc) + _check_error() + return result if result != _ffi.NULL else None + + +def tgeo_minus_value( + temp: Annotated[_ffi.CData, "const Temporal *"], gs: Annotated[_ffi.CData, "GSERIALIZED *"] +) -> Annotated[_ffi.CData, "Temporal *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + gs_converted = _ffi.cast("GSERIALIZED *", gs) + result = _lib.tgeo_minus_value(temp_converted, gs_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def tpoint_at_geom( + temp: Annotated[_ffi.CData, "const Temporal *"], + gs: Annotated[_ffi.CData, "const GSERIALIZED *"], + zspan: Annotated[_ffi.CData, "const Span *"], +) -> Annotated[_ffi.CData, "Temporal *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + zspan_converted = _ffi.cast("const Span *", zspan) + result = _lib.tpoint_at_geom(temp_converted, gs_converted, zspan_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def tpoint_at_value( + temp: Annotated[_ffi.CData, "const Temporal *"], gs: Annotated[_ffi.CData, "GSERIALIZED *"] +) -> Annotated[_ffi.CData, "Temporal *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + gs_converted = _ffi.cast("GSERIALIZED *", gs) + result = _lib.tpoint_at_value(temp_converted, gs_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def tpoint_minus_geom( + temp: Annotated[_ffi.CData, "const Temporal *"], + gs: Annotated[_ffi.CData, "const GSERIALIZED *"], + zspan: Annotated[_ffi.CData, "const Span *"], +) -> Annotated[_ffi.CData, "Temporal *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + zspan_converted = _ffi.cast("const Span *", zspan) + result = _lib.tpoint_minus_geom(temp_converted, gs_converted, zspan_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def tpoint_minus_value( + temp: Annotated[_ffi.CData, "const Temporal *"], gs: Annotated[_ffi.CData, "GSERIALIZED *"] +) -> Annotated[_ffi.CData, "Temporal *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + gs_converted = _ffi.cast("GSERIALIZED *", gs) + result = _lib.tpoint_minus_value(temp_converted, gs_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def always_eq_geo_tgeo( + gs: Annotated[_ffi.CData, "const GSERIALIZED *"], temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[int, "int"]: + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.always_eq_geo_tgeo(gs_converted, temp_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def always_eq_tgeo_geo( + temp: Annotated[_ffi.CData, "const Temporal *"], gs: Annotated[_ffi.CData, "const GSERIALIZED *"] +) -> Annotated[int, "int"]: + temp_converted = _ffi.cast("const Temporal *", temp) + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + result = _lib.always_eq_tgeo_geo(temp_converted, gs_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def always_eq_tgeo_tgeo( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[int, "int"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.always_eq_tgeo_tgeo(temp1_converted, temp2_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def always_ne_geo_tgeo( + gs: Annotated[_ffi.CData, "const GSERIALIZED *"], temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[int, "int"]: + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.always_ne_geo_tgeo(gs_converted, temp_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def always_ne_tgeo_geo( + temp: Annotated[_ffi.CData, "const Temporal *"], gs: Annotated[_ffi.CData, "const GSERIALIZED *"] +) -> Annotated[int, "int"]: + temp_converted = _ffi.cast("const Temporal *", temp) + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + result = _lib.always_ne_tgeo_geo(temp_converted, gs_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def always_ne_tgeo_tgeo( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[int, "int"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.always_ne_tgeo_tgeo(temp1_converted, temp2_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def ever_eq_geo_tgeo( + gs: Annotated[_ffi.CData, "const GSERIALIZED *"], temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[int, "int"]: + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.ever_eq_geo_tgeo(gs_converted, temp_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def ever_eq_tgeo_geo( + temp: Annotated[_ffi.CData, "const Temporal *"], gs: Annotated[_ffi.CData, "const GSERIALIZED *"] +) -> Annotated[int, "int"]: + temp_converted = _ffi.cast("const Temporal *", temp) + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + result = _lib.ever_eq_tgeo_geo(temp_converted, gs_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def ever_eq_tgeo_tgeo( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[int, "int"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.ever_eq_tgeo_tgeo(temp1_converted, temp2_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def ever_ne_geo_tgeo( + gs: Annotated[_ffi.CData, "const GSERIALIZED *"], temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[int, "int"]: + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.ever_ne_geo_tgeo(gs_converted, temp_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def ever_ne_tgeo_geo( + temp: Annotated[_ffi.CData, "const Temporal *"], gs: Annotated[_ffi.CData, "const GSERIALIZED *"] +) -> Annotated[int, "int"]: + temp_converted = _ffi.cast("const Temporal *", temp) + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + result = _lib.ever_ne_tgeo_geo(temp_converted, gs_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def ever_ne_tgeo_tgeo( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[int, "int"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.ever_ne_tgeo_tgeo(temp1_converted, temp2_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def teq_geo_tgeo( + gs: Annotated[_ffi.CData, "const GSERIALIZED *"], temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[_ffi.CData, "Temporal *"]: + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.teq_geo_tgeo(gs_converted, temp_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def teq_tgeo_geo( + temp: Annotated[_ffi.CData, "const Temporal *"], gs: Annotated[_ffi.CData, "const GSERIALIZED *"] +) -> Annotated[_ffi.CData, "Temporal *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + result = _lib.teq_tgeo_geo(temp_converted, gs_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def tne_geo_tgeo( + gs: Annotated[_ffi.CData, "const GSERIALIZED *"], temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[_ffi.CData, "Temporal *"]: + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.tne_geo_tgeo(gs_converted, temp_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def tne_tgeo_geo( + temp: Annotated[_ffi.CData, "const Temporal *"], gs: Annotated[_ffi.CData, "const GSERIALIZED *"] +) -> Annotated[_ffi.CData, "Temporal *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + result = _lib.tne_tgeo_geo(temp_converted, gs_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def tgeo_stboxes( + temp: Annotated[_ffi.CData, "const Temporal *"], count: Annotated[_ffi.CData, "int *"] +) -> Annotated[_ffi.CData, "STBox *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + count_converted = _ffi.cast("int *", count) + result = _lib.tgeo_stboxes(temp_converted, count_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def tgeo_space_boxes( + temp: Annotated[_ffi.CData, "const Temporal *"], + xsize: float, + ysize: float, + zsize: float, + sorigin: Annotated[_ffi.CData, "const GSERIALIZED *"], + bitmatrix: bool, + border_inc: bool, + count: Annotated[_ffi.CData, "int *"], +) -> Annotated[_ffi.CData, "STBox *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + sorigin_converted = _ffi.cast("const GSERIALIZED *", sorigin) + count_converted = _ffi.cast("int *", count) + result = _lib.tgeo_space_boxes( + temp_converted, xsize, ysize, zsize, sorigin_converted, bitmatrix, border_inc, count_converted + ) + _check_error() + return result if result != _ffi.NULL else None + + +def tgeo_space_time_boxes( + temp: Annotated[_ffi.CData, "const Temporal *"], + xsize: float, + ysize: float, + zsize: float, + duration: Annotated[_ffi.CData, "const Interval *"], + sorigin: Annotated[_ffi.CData, "const GSERIALIZED *"], + torigin: int, + bitmatrix: bool, + border_inc: bool, + count: Annotated[_ffi.CData, "int *"], +) -> Annotated[_ffi.CData, "STBox *"]: + temp_converted = _ffi.cast("const Temporal *", temp) duration_converted = _ffi.cast("const Interval *", duration) sorigin_converted = _ffi.cast("const GSERIALIZED *", sorigin) torigin_converted = _ffi.cast("TimestampTz", torigin) - result = _lib.stbox_get_space_time_tile( - point_converted, - t_converted, + count_converted = _ffi.cast("int *", count) + result = _lib.tgeo_space_time_boxes( + temp_converted, xsize, ysize, zsize, duration_converted, sorigin_converted, torigin_converted, + bitmatrix, + border_inc, + count_converted, ) _check_error() return result if result != _ffi.NULL else None -def stbox_get_time_tile( - t: int, duration: "const Interval *", torigin: int -) -> "STBox *": - t_converted = _ffi.cast("TimestampTz", t) - duration_converted = _ffi.cast("const Interval *", duration) - torigin_converted = _ffi.cast("TimestampTz", torigin) - result = _lib.stbox_get_time_tile( - t_converted, duration_converted, torigin_converted - ) +def tgeo_split_each_n_stboxes( + temp: Annotated[_ffi.CData, "const Temporal *"], elem_count: int, count: Annotated[_ffi.CData, "int *"] +) -> Annotated[_ffi.CData, "STBox *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + count_converted = _ffi.cast("int *", count) + result = _lib.tgeo_split_each_n_stboxes(temp_converted, elem_count, count_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def tgeo_split_n_stboxes( + temp: Annotated[_ffi.CData, "const Temporal *"], box_count: int, count: Annotated[_ffi.CData, "int *"] +) -> Annotated[_ffi.CData, "STBox *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + count_converted = _ffi.cast("int *", count) + result = _lib.tgeo_split_n_stboxes(temp_converted, box_count, count_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def adjacent_stbox_tspatial( + box: Annotated[_ffi.CData, "const STBox *"], temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + box_converted = _ffi.cast("const STBox *", box) + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.adjacent_stbox_tspatial(box_converted, temp_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def adjacent_tspatial_stbox( + temp: Annotated[_ffi.CData, "const Temporal *"], box: Annotated[_ffi.CData, "const STBox *"] +) -> Annotated[bool, "bool"]: + temp_converted = _ffi.cast("const Temporal *", temp) + box_converted = _ffi.cast("const STBox *", box) + result = _lib.adjacent_tspatial_stbox(temp_converted, box_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def adjacent_tspatial_tspatial( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.adjacent_tspatial_tspatial(temp1_converted, temp2_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def contained_stbox_tspatial( + box: Annotated[_ffi.CData, "const STBox *"], temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + box_converted = _ffi.cast("const STBox *", box) + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.contained_stbox_tspatial(box_converted, temp_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def contained_tspatial_stbox( + temp: Annotated[_ffi.CData, "const Temporal *"], box: Annotated[_ffi.CData, "const STBox *"] +) -> Annotated[bool, "bool"]: + temp_converted = _ffi.cast("const Temporal *", temp) + box_converted = _ffi.cast("const STBox *", box) + result = _lib.contained_tspatial_stbox(temp_converted, box_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def contained_tspatial_tspatial( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.contained_tspatial_tspatial(temp1_converted, temp2_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def contains_stbox_tspatial( + box: Annotated[_ffi.CData, "const STBox *"], temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + box_converted = _ffi.cast("const STBox *", box) + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.contains_stbox_tspatial(box_converted, temp_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def contains_tspatial_stbox( + temp: Annotated[_ffi.CData, "const Temporal *"], box: Annotated[_ffi.CData, "const STBox *"] +) -> Annotated[bool, "bool"]: + temp_converted = _ffi.cast("const Temporal *", temp) + box_converted = _ffi.cast("const STBox *", box) + result = _lib.contains_tspatial_stbox(temp_converted, box_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def contains_tspatial_tspatial( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.contains_tspatial_tspatial(temp1_converted, temp2_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def overlaps_stbox_tspatial( + box: Annotated[_ffi.CData, "const STBox *"], temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + box_converted = _ffi.cast("const STBox *", box) + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.overlaps_stbox_tspatial(box_converted, temp_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def overlaps_tspatial_stbox( + temp: Annotated[_ffi.CData, "const Temporal *"], box: Annotated[_ffi.CData, "const STBox *"] +) -> Annotated[bool, "bool"]: + temp_converted = _ffi.cast("const Temporal *", temp) + box_converted = _ffi.cast("const STBox *", box) + result = _lib.overlaps_tspatial_stbox(temp_converted, box_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def overlaps_tspatial_tspatial( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.overlaps_tspatial_tspatial(temp1_converted, temp2_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def same_stbox_tspatial( + box: Annotated[_ffi.CData, "const STBox *"], temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + box_converted = _ffi.cast("const STBox *", box) + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.same_stbox_tspatial(box_converted, temp_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def same_tspatial_stbox( + temp: Annotated[_ffi.CData, "const Temporal *"], box: Annotated[_ffi.CData, "const STBox *"] +) -> Annotated[bool, "bool"]: + temp_converted = _ffi.cast("const Temporal *", temp) + box_converted = _ffi.cast("const STBox *", box) + result = _lib.same_tspatial_stbox(temp_converted, box_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def same_tspatial_tspatial( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.same_tspatial_tspatial(temp1_converted, temp2_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def above_stbox_tspatial( + box: Annotated[_ffi.CData, "const STBox *"], temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + box_converted = _ffi.cast("const STBox *", box) + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.above_stbox_tspatial(box_converted, temp_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def above_tspatial_stbox( + temp: Annotated[_ffi.CData, "const Temporal *"], box: Annotated[_ffi.CData, "const STBox *"] +) -> Annotated[bool, "bool"]: + temp_converted = _ffi.cast("const Temporal *", temp) + box_converted = _ffi.cast("const STBox *", box) + result = _lib.above_tspatial_stbox(temp_converted, box_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def above_tspatial_tspatial( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.above_tspatial_tspatial(temp1_converted, temp2_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def after_stbox_tspatial( + box: Annotated[_ffi.CData, "const STBox *"], temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + box_converted = _ffi.cast("const STBox *", box) + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.after_stbox_tspatial(box_converted, temp_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def after_tspatial_stbox( + temp: Annotated[_ffi.CData, "const Temporal *"], box: Annotated[_ffi.CData, "const STBox *"] +) -> Annotated[bool, "bool"]: + temp_converted = _ffi.cast("const Temporal *", temp) + box_converted = _ffi.cast("const STBox *", box) + result = _lib.after_tspatial_stbox(temp_converted, box_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def after_tspatial_tspatial( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.after_tspatial_tspatial(temp1_converted, temp2_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def back_stbox_tspatial( + box: Annotated[_ffi.CData, "const STBox *"], temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + box_converted = _ffi.cast("const STBox *", box) + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.back_stbox_tspatial(box_converted, temp_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def back_tspatial_stbox( + temp: Annotated[_ffi.CData, "const Temporal *"], box: Annotated[_ffi.CData, "const STBox *"] +) -> Annotated[bool, "bool"]: + temp_converted = _ffi.cast("const Temporal *", temp) + box_converted = _ffi.cast("const STBox *", box) + result = _lib.back_tspatial_stbox(temp_converted, box_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def back_tspatial_tspatial( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.back_tspatial_tspatial(temp1_converted, temp2_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def before_stbox_tspatial( + box: Annotated[_ffi.CData, "const STBox *"], temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + box_converted = _ffi.cast("const STBox *", box) + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.before_stbox_tspatial(box_converted, temp_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def before_tspatial_stbox( + temp: Annotated[_ffi.CData, "const Temporal *"], box: Annotated[_ffi.CData, "const STBox *"] +) -> Annotated[bool, "bool"]: + temp_converted = _ffi.cast("const Temporal *", temp) + box_converted = _ffi.cast("const STBox *", box) + result = _lib.before_tspatial_stbox(temp_converted, box_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def before_tspatial_tspatial( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.before_tspatial_tspatial(temp1_converted, temp2_converted) _check_error() return result if result != _ffi.NULL else None -def stbox_space_tiles( - bounds: "const STBox *", - xsize: float, - ysize: float, - zsize: float, - sorigin: "const GSERIALIZED *", - border_inc: bool, -) -> "Tuple['STBox *', 'int']": - bounds_converted = _ffi.cast("const STBox *", bounds) - sorigin_converted = _ffi.cast("const GSERIALIZED *", sorigin) - count = _ffi.new("int *") - result = _lib.stbox_space_tiles( - bounds_converted, xsize, ysize, zsize, sorigin_converted, border_inc, count - ) +def below_stbox_tspatial( + box: Annotated[_ffi.CData, "const STBox *"], temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + box_converted = _ffi.cast("const STBox *", box) + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.below_stbox_tspatial(box_converted, temp_converted) _check_error() - return result if result != _ffi.NULL else None, count[0] + return result if result != _ffi.NULL else None -def stbox_space_time_tiles( - bounds: "const STBox *", - xsize: float, - ysize: float, - zsize: float, - duration: "Optional['const Interval *']", - sorigin: "const GSERIALIZED *", - torigin: int, - border_inc: bool, -) -> "Tuple['STBox *', 'int']": - bounds_converted = _ffi.cast("const STBox *", bounds) - duration_converted = ( - _ffi.cast("const Interval *", duration) if duration is not None else _ffi.NULL - ) - sorigin_converted = _ffi.cast("const GSERIALIZED *", sorigin) - torigin_converted = _ffi.cast("TimestampTz", torigin) - count = _ffi.new("int *") - result = _lib.stbox_space_time_tiles( - bounds_converted, - xsize, - ysize, - zsize, - duration_converted, - sorigin_converted, - torigin_converted, - border_inc, - count, - ) +def below_tspatial_stbox( + temp: Annotated[_ffi.CData, "const Temporal *"], box: Annotated[_ffi.CData, "const STBox *"] +) -> Annotated[bool, "bool"]: + temp_converted = _ffi.cast("const Temporal *", temp) + box_converted = _ffi.cast("const STBox *", box) + result = _lib.below_tspatial_stbox(temp_converted, box_converted) _check_error() - return result if result != _ffi.NULL else None, count[0] + return result if result != _ffi.NULL else None -def stbox_time_tiles( - bounds: "const STBox *", - duration: "const Interval *", - torigin: int, - border_inc: bool, -) -> "Tuple['STBox *', 'int']": - bounds_converted = _ffi.cast("const STBox *", bounds) - duration_converted = _ffi.cast("const Interval *", duration) - torigin_converted = _ffi.cast("TimestampTz", torigin) - count = _ffi.new("int *") - result = _lib.stbox_time_tiles( - bounds_converted, duration_converted, torigin_converted, border_inc, count - ) +def below_tspatial_tspatial( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.below_tspatial_tspatial(temp1_converted, temp2_converted) _check_error() - return result if result != _ffi.NULL else None, count[0] + return result if result != _ffi.NULL else None -def temporal_time_spans( - temp: "const Temporal *", duration: "const Interval *", origin: int -) -> "Tuple['Span *', 'int']": +def front_stbox_tspatial( + box: Annotated[_ffi.CData, "const STBox *"], temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + box_converted = _ffi.cast("const STBox *", box) temp_converted = _ffi.cast("const Temporal *", temp) - duration_converted = _ffi.cast("const Interval *", duration) - origin_converted = _ffi.cast("TimestampTz", origin) - count = _ffi.new("int *") - result = _lib.temporal_time_spans( - temp_converted, duration_converted, origin_converted, count - ) + result = _lib.front_stbox_tspatial(box_converted, temp_converted) _check_error() - return result if result != _ffi.NULL else None, count[0] + return result if result != _ffi.NULL else None -def temporal_time_split( - temp: "const Temporal *", duration: "const Interval *", torigin: int -) -> "Tuple['Temporal **', 'TimestampTz *', 'int']": +def front_tspatial_stbox( + temp: Annotated[_ffi.CData, "const Temporal *"], box: Annotated[_ffi.CData, "const STBox *"] +) -> Annotated[bool, "bool"]: temp_converted = _ffi.cast("const Temporal *", temp) - duration_converted = _ffi.cast("const Interval *", duration) - torigin_converted = _ffi.cast("TimestampTz", torigin) - time_bins = _ffi.new("TimestampTz **") - count = _ffi.new("int *") - result = _lib.temporal_time_split( - temp_converted, duration_converted, torigin_converted, time_bins, count - ) + box_converted = _ffi.cast("const STBox *", box) + result = _lib.front_tspatial_stbox(temp_converted, box_converted) _check_error() - return result if result != _ffi.NULL else None, time_bins[0], count[0] + return result if result != _ffi.NULL else None + + +def front_tspatial_tspatial( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.front_tspatial_tspatial(temp1_converted, temp2_converted) + _check_error() + return result if result != _ffi.NULL else None -def tfloat_value_spans( - temp: "const Temporal *", vsize: float, vorigin: float -) -> "Tuple['Span *', 'int']": +def left_stbox_tspatial( + box: Annotated[_ffi.CData, "const STBox *"], temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + box_converted = _ffi.cast("const STBox *", box) temp_converted = _ffi.cast("const Temporal *", temp) - count = _ffi.new("int *") - result = _lib.tfloat_value_spans(temp_converted, vsize, vorigin, count) + result = _lib.left_stbox_tspatial(box_converted, temp_converted) _check_error() - return result if result != _ffi.NULL else None, count[0] + return result if result != _ffi.NULL else None -def tfloat_value_split( - temp: "const Temporal *", vsize: float, vorigin: float -) -> "Tuple['Temporal **', 'double *', 'int']": +def left_tspatial_stbox( + temp: Annotated[_ffi.CData, "const Temporal *"], box: Annotated[_ffi.CData, "const STBox *"] +) -> Annotated[bool, "bool"]: temp_converted = _ffi.cast("const Temporal *", temp) - value_bins = _ffi.new("double **") - count = _ffi.new("int *") - result = _lib.tfloat_value_split(temp_converted, vsize, vorigin, value_bins, count) + box_converted = _ffi.cast("const STBox *", box) + result = _lib.left_tspatial_stbox(temp_converted, box_converted) _check_error() - return result if result != _ffi.NULL else None, value_bins[0], count[0] + return result if result != _ffi.NULL else None -def tfloat_value_time_split( - temp: "const Temporal *", - vsize: float, - duration: "const Interval *", - vorigin: float, - torigin: int, -) -> "Tuple['Temporal **', 'double *', 'TimestampTz *', 'int']": +def left_tspatial_tspatial( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.left_tspatial_tspatial(temp1_converted, temp2_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def overabove_stbox_tspatial( + box: Annotated[_ffi.CData, "const STBox *"], temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + box_converted = _ffi.cast("const STBox *", box) temp_converted = _ffi.cast("const Temporal *", temp) - duration_converted = _ffi.cast("const Interval *", duration) - torigin_converted = _ffi.cast("TimestampTz", torigin) - value_bins = _ffi.new("double **") - time_bins = _ffi.new("TimestampTz **") - count = _ffi.new("int *") - result = _lib.tfloat_value_time_split( - temp_converted, - vsize, - duration_converted, - vorigin, - torigin_converted, - value_bins, - time_bins, - count, - ) + result = _lib.overabove_stbox_tspatial(box_converted, temp_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def overabove_tspatial_stbox( + temp: Annotated[_ffi.CData, "const Temporal *"], box: Annotated[_ffi.CData, "const STBox *"] +) -> Annotated[bool, "bool"]: + temp_converted = _ffi.cast("const Temporal *", temp) + box_converted = _ffi.cast("const STBox *", box) + result = _lib.overabove_tspatial_stbox(temp_converted, box_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def overabove_tspatial_tspatial( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.overabove_tspatial_tspatial(temp1_converted, temp2_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def overafter_stbox_tspatial( + box: Annotated[_ffi.CData, "const STBox *"], temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + box_converted = _ffi.cast("const STBox *", box) + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.overafter_stbox_tspatial(box_converted, temp_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def overafter_tspatial_stbox( + temp: Annotated[_ffi.CData, "const Temporal *"], box: Annotated[_ffi.CData, "const STBox *"] +) -> Annotated[bool, "bool"]: + temp_converted = _ffi.cast("const Temporal *", temp) + box_converted = _ffi.cast("const STBox *", box) + result = _lib.overafter_tspatial_stbox(temp_converted, box_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def overafter_tspatial_tspatial( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.overafter_tspatial_tspatial(temp1_converted, temp2_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def overback_stbox_tspatial( + box: Annotated[_ffi.CData, "const STBox *"], temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + box_converted = _ffi.cast("const STBox *", box) + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.overback_stbox_tspatial(box_converted, temp_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def overback_tspatial_stbox( + temp: Annotated[_ffi.CData, "const Temporal *"], box: Annotated[_ffi.CData, "const STBox *"] +) -> Annotated[bool, "bool"]: + temp_converted = _ffi.cast("const Temporal *", temp) + box_converted = _ffi.cast("const STBox *", box) + result = _lib.overback_tspatial_stbox(temp_converted, box_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def overback_tspatial_tspatial( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.overback_tspatial_tspatial(temp1_converted, temp2_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def overbefore_stbox_tspatial( + box: Annotated[_ffi.CData, "const STBox *"], temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + box_converted = _ffi.cast("const STBox *", box) + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.overbefore_stbox_tspatial(box_converted, temp_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def overbefore_tspatial_stbox( + temp: Annotated[_ffi.CData, "const Temporal *"], box: Annotated[_ffi.CData, "const STBox *"] +) -> Annotated[bool, "bool"]: + temp_converted = _ffi.cast("const Temporal *", temp) + box_converted = _ffi.cast("const STBox *", box) + result = _lib.overbefore_tspatial_stbox(temp_converted, box_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def overbefore_tspatial_tspatial( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.overbefore_tspatial_tspatial(temp1_converted, temp2_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def overbelow_stbox_tspatial( + box: Annotated[_ffi.CData, "const STBox *"], temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + box_converted = _ffi.cast("const STBox *", box) + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.overbelow_stbox_tspatial(box_converted, temp_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def overbelow_tspatial_stbox( + temp: Annotated[_ffi.CData, "const Temporal *"], box: Annotated[_ffi.CData, "const STBox *"] +) -> Annotated[bool, "bool"]: + temp_converted = _ffi.cast("const Temporal *", temp) + box_converted = _ffi.cast("const STBox *", box) + result = _lib.overbelow_tspatial_stbox(temp_converted, box_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def overbelow_tspatial_tspatial( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.overbelow_tspatial_tspatial(temp1_converted, temp2_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def overfront_stbox_tspatial( + box: Annotated[_ffi.CData, "const STBox *"], temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + box_converted = _ffi.cast("const STBox *", box) + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.overfront_stbox_tspatial(box_converted, temp_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def overfront_tspatial_stbox( + temp: Annotated[_ffi.CData, "const Temporal *"], box: Annotated[_ffi.CData, "const STBox *"] +) -> Annotated[bool, "bool"]: + temp_converted = _ffi.cast("const Temporal *", temp) + box_converted = _ffi.cast("const STBox *", box) + result = _lib.overfront_tspatial_stbox(temp_converted, box_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def overfront_tspatial_tspatial( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.overfront_tspatial_tspatial(temp1_converted, temp2_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def overleft_stbox_tspatial( + box: Annotated[_ffi.CData, "const STBox *"], temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + box_converted = _ffi.cast("const STBox *", box) + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.overleft_stbox_tspatial(box_converted, temp_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def overleft_tspatial_stbox( + temp: Annotated[_ffi.CData, "const Temporal *"], box: Annotated[_ffi.CData, "const STBox *"] +) -> Annotated[bool, "bool"]: + temp_converted = _ffi.cast("const Temporal *", temp) + box_converted = _ffi.cast("const STBox *", box) + result = _lib.overleft_tspatial_stbox(temp_converted, box_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def overleft_tspatial_tspatial( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.overleft_tspatial_tspatial(temp1_converted, temp2_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def overright_stbox_tspatial( + box: Annotated[_ffi.CData, "const STBox *"], temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + box_converted = _ffi.cast("const STBox *", box) + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.overright_stbox_tspatial(box_converted, temp_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def overright_tspatial_stbox( + temp: Annotated[_ffi.CData, "const Temporal *"], box: Annotated[_ffi.CData, "const STBox *"] +) -> Annotated[bool, "bool"]: + temp_converted = _ffi.cast("const Temporal *", temp) + box_converted = _ffi.cast("const STBox *", box) + result = _lib.overright_tspatial_stbox(temp_converted, box_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def overright_tspatial_tspatial( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.overright_tspatial_tspatial(temp1_converted, temp2_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def right_stbox_tspatial( + box: Annotated[_ffi.CData, "const STBox *"], temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + box_converted = _ffi.cast("const STBox *", box) + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.right_stbox_tspatial(box_converted, temp_converted) _check_error() - return ( - result if result != _ffi.NULL else None, - value_bins[0], - time_bins[0], - count[0], - ) + return result if result != _ffi.NULL else None -def tfloatbox_get_time_tile( - t: int, duration: "const Interval *", torigin: int -) -> "TBox *": - t_converted = _ffi.cast("TimestampTz", t) - duration_converted = _ffi.cast("const Interval *", duration) - torigin_converted = _ffi.cast("TimestampTz", torigin) - result = _lib.tfloatbox_get_time_tile( - t_converted, duration_converted, torigin_converted - ) +def right_tspatial_stbox( + temp: Annotated[_ffi.CData, "const Temporal *"], box: Annotated[_ffi.CData, "const STBox *"] +) -> Annotated[bool, "bool"]: + temp_converted = _ffi.cast("const Temporal *", temp) + box_converted = _ffi.cast("const STBox *", box) + result = _lib.right_tspatial_stbox(temp_converted, box_converted) _check_error() return result if result != _ffi.NULL else None -def tfloatbox_get_value_tile(value: float, vsize: float, vorigin: float) -> "TBox *": - result = _lib.tfloatbox_get_value_tile(value, vsize, vorigin) +def right_tspatial_tspatial( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[bool, "bool"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.right_tspatial_tspatial(temp1_converted, temp2_converted) _check_error() return result if result != _ffi.NULL else None -def tfloatbox_get_value_time_tile( - value: float, - t: int, - vsize: float, - duration: "const Interval *", - vorigin: float, - torigin: int, -) -> "TBox *": - t_converted = _ffi.cast("TimestampTz", t) - duration_converted = _ffi.cast("const Interval *", duration) - torigin_converted = _ffi.cast("TimestampTz", torigin) - result = _lib.tfloatbox_get_value_time_tile( - value, t_converted, vsize, duration_converted, vorigin, torigin_converted - ) +def acontains_geo_tgeo( + gs: Annotated[_ffi.CData, "const GSERIALIZED *"], temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[int, "int"]: + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.acontains_geo_tgeo(gs_converted, temp_converted) _check_error() return result if result != _ffi.NULL else None -def tfloatbox_time_tiles( - box: "const TBox *", duration: "const Interval *", torigin: int -) -> "Tuple['TBox *', 'int']": - box_converted = _ffi.cast("const TBox *", box) - duration_converted = _ffi.cast("const Interval *", duration) - torigin_converted = _ffi.cast("TimestampTz", torigin) - count = _ffi.new("int *") - result = _lib.tfloatbox_time_tiles( - box_converted, duration_converted, torigin_converted, count - ) +def acontains_tgeo_geo( + temp: Annotated[_ffi.CData, "const Temporal *"], gs: Annotated[_ffi.CData, "const GSERIALIZED *"] +) -> Annotated[int, "int"]: + temp_converted = _ffi.cast("const Temporal *", temp) + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + result = _lib.acontains_tgeo_geo(temp_converted, gs_converted) _check_error() - return result if result != _ffi.NULL else None, count[0] + return result if result != _ffi.NULL else None -def tfloatbox_value_tiles( - box: "const TBox *", vsize: float, vorigin: float -) -> "Tuple['TBox *', 'int']": - box_converted = _ffi.cast("const TBox *", box) - count = _ffi.new("int *") - result = _lib.tfloatbox_value_tiles(box_converted, vsize, vorigin, count) +def acontains_tgeo_tgeo( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[int, "int"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.acontains_tgeo_tgeo(temp1_converted, temp2_converted) _check_error() - return result if result != _ffi.NULL else None, count[0] + return result if result != _ffi.NULL else None -def tfloatbox_value_time_tiles( - box: "const TBox *", - vsize: float, - duration: "const Interval *", - vorigin: float, - torigin: "Optional[int]", -) -> "Tuple['TBox *', 'int']": - box_converted = _ffi.cast("const TBox *", box) - duration_converted = _ffi.cast("const Interval *", duration) - torigin_converted = ( - _ffi.cast("TimestampTz", torigin) if torigin is not None else _ffi.NULL - ) - count = _ffi.new("int *") - result = _lib.tfloatbox_value_time_tiles( - box_converted, vsize, duration_converted, vorigin, torigin_converted, count - ) +def adisjoint_tgeo_geo( + temp: Annotated[_ffi.CData, "const Temporal *"], gs: Annotated[_ffi.CData, "const GSERIALIZED *"] +) -> Annotated[int, "int"]: + temp_converted = _ffi.cast("const Temporal *", temp) + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + result = _lib.adisjoint_tgeo_geo(temp_converted, gs_converted) _check_error() - return result if result != _ffi.NULL else None, count[0] + return result if result != _ffi.NULL else None -def timestamptz_get_bin( - timestamp: int, duration: "const Interval *", torigin: int -) -> "TimestampTz": - timestamp_converted = _ffi.cast("TimestampTz", timestamp) - duration_converted = _ffi.cast("const Interval *", duration) - torigin_converted = _ffi.cast("TimestampTz", torigin) - result = _lib.timestamptz_get_bin( - timestamp_converted, duration_converted, torigin_converted - ) +def adisjoint_tgeo_tgeo( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[int, "int"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.adisjoint_tgeo_tgeo(temp1_converted, temp2_converted) _check_error() return result if result != _ffi.NULL else None -def tint_value_spans( - temp: "const Temporal *", vsize: int, vorigin: int -) -> "Tuple['Span *', 'int']": +def adwithin_tgeo_geo( + temp: Annotated[_ffi.CData, "const Temporal *"], gs: Annotated[_ffi.CData, "const GSERIALIZED *"], dist: float +) -> Annotated[int, "int"]: temp_converted = _ffi.cast("const Temporal *", temp) - count = _ffi.new("int *") - result = _lib.tint_value_spans(temp_converted, vsize, vorigin, count) + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + result = _lib.adwithin_tgeo_geo(temp_converted, gs_converted, dist) _check_error() - return result if result != _ffi.NULL else None, count[0] + return result if result != _ffi.NULL else None -def tint_value_split( - temp: "const Temporal *", vsize: int, vorigin: int -) -> "Tuple['Temporal **', 'int *', 'int']": - temp_converted = _ffi.cast("const Temporal *", temp) - value_bins = _ffi.new("int **") - count = _ffi.new("int *") - result = _lib.tint_value_split(temp_converted, vsize, vorigin, value_bins, count) +def adwithin_tgeo_tgeo( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"], dist: float +) -> Annotated[int, "int"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.adwithin_tgeo_tgeo(temp1_converted, temp2_converted, dist) _check_error() - return result if result != _ffi.NULL else None, value_bins[0], count[0] + return result if result != _ffi.NULL else None -def tint_value_time_split( - temp: "const Temporal *", - size: int, - duration: "const Interval *", - vorigin: int, - torigin: int, -) -> "Tuple['Temporal **', 'int *', 'TimestampTz *', 'int']": +def aintersects_tgeo_geo( + temp: Annotated[_ffi.CData, "const Temporal *"], gs: Annotated[_ffi.CData, "const GSERIALIZED *"] +) -> Annotated[int, "int"]: temp_converted = _ffi.cast("const Temporal *", temp) - duration_converted = _ffi.cast("const Interval *", duration) - torigin_converted = _ffi.cast("TimestampTz", torigin) - value_bins = _ffi.new("int **") - time_bins = _ffi.new("TimestampTz **") - count = _ffi.new("int *") - result = _lib.tint_value_time_split( - temp_converted, - size, - duration_converted, - vorigin, - torigin_converted, - value_bins, - time_bins, - count, - ) + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + result = _lib.aintersects_tgeo_geo(temp_converted, gs_converted) _check_error() - return ( - result if result != _ffi.NULL else None, - value_bins[0], - time_bins[0], - count[0], - ) + return result if result != _ffi.NULL else None -def tintbox_get_time_tile( - t: int, duration: "const Interval *", torigin: int -) -> "TBox *": - t_converted = _ffi.cast("TimestampTz", t) - duration_converted = _ffi.cast("const Interval *", duration) - torigin_converted = _ffi.cast("TimestampTz", torigin) - result = _lib.tintbox_get_time_tile( - t_converted, duration_converted, torigin_converted - ) +def aintersects_tgeo_tgeo( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[int, "int"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.aintersects_tgeo_tgeo(temp1_converted, temp2_converted) _check_error() return result if result != _ffi.NULL else None -def tintbox_get_value_tile(value: int, vsize: int, vorigin: int) -> "TBox *": - result = _lib.tintbox_get_value_tile(value, vsize, vorigin) +def atouches_tgeo_geo( + temp: Annotated[_ffi.CData, "const Temporal *"], gs: Annotated[_ffi.CData, "const GSERIALIZED *"] +) -> Annotated[int, "int"]: + temp_converted = _ffi.cast("const Temporal *", temp) + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + result = _lib.atouches_tgeo_geo(temp_converted, gs_converted) _check_error() return result if result != _ffi.NULL else None -def tintbox_get_value_time_tile( - value: int, - t: int, - vsize: int, - duration: "const Interval *", - vorigin: int, - torigin: int, -) -> "TBox *": - t_converted = _ffi.cast("TimestampTz", t) - duration_converted = _ffi.cast("const Interval *", duration) - torigin_converted = _ffi.cast("TimestampTz", torigin) - result = _lib.tintbox_get_value_time_tile( - value, t_converted, vsize, duration_converted, vorigin, torigin_converted - ) +def atouches_tgeo_tgeo( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[int, "int"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.atouches_tgeo_tgeo(temp1_converted, temp2_converted) _check_error() return result if result != _ffi.NULL else None -def tintbox_time_tiles( - box: "const TBox *", duration: "const Interval *", torigin: int -) -> "Tuple['TBox *', 'int']": - box_converted = _ffi.cast("const TBox *", box) - duration_converted = _ffi.cast("const Interval *", duration) - torigin_converted = _ffi.cast("TimestampTz", torigin) - count = _ffi.new("int *") - result = _lib.tintbox_time_tiles( - box_converted, duration_converted, torigin_converted, count - ) +def atouches_tpoint_geo( + temp: Annotated[_ffi.CData, "const Temporal *"], gs: Annotated[_ffi.CData, "const GSERIALIZED *"] +) -> Annotated[int, "int"]: + temp_converted = _ffi.cast("const Temporal *", temp) + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + result = _lib.atouches_tpoint_geo(temp_converted, gs_converted) _check_error() - return result if result != _ffi.NULL else None, count[0] + return result if result != _ffi.NULL else None -def tintbox_value_tiles( - box: "const TBox *", xsize: int, xorigin: int -) -> "Tuple['TBox *', 'int']": - box_converted = _ffi.cast("const TBox *", box) - count = _ffi.new("int *") - result = _lib.tintbox_value_tiles(box_converted, xsize, xorigin, count) +def econtains_geo_tgeo( + gs: Annotated[_ffi.CData, "const GSERIALIZED *"], temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[int, "int"]: + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.econtains_geo_tgeo(gs_converted, temp_converted) _check_error() - return result if result != _ffi.NULL else None, count[0] + return result if result != _ffi.NULL else None -def tintbox_value_time_tiles( - box: "const TBox *", - xsize: int, - duration: "const Interval *", - xorigin: "Optional[int]", - torigin: "Optional[int]", -) -> "Tuple['TBox *', 'int']": - box_converted = _ffi.cast("const TBox *", box) - duration_converted = _ffi.cast("const Interval *", duration) - xorigin_converted = xorigin if xorigin is not None else _ffi.NULL - torigin_converted = ( - _ffi.cast("TimestampTz", torigin) if torigin is not None else _ffi.NULL - ) - count = _ffi.new("int *") - result = _lib.tintbox_value_time_tiles( - box_converted, - xsize, - duration_converted, - xorigin_converted, - torigin_converted, - count, - ) +def econtains_tgeo_geo( + temp: Annotated[_ffi.CData, "const Temporal *"], gs: Annotated[_ffi.CData, "const GSERIALIZED *"] +) -> Annotated[int, "int"]: + temp_converted = _ffi.cast("const Temporal *", temp) + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + result = _lib.econtains_tgeo_geo(temp_converted, gs_converted) _check_error() - return result if result != _ffi.NULL else None, count[0] + return result if result != _ffi.NULL else None -def tpoint_space_split( - temp: "const Temporal *", - xsize: float, - ysize: float, - zsize: float, - sorigin: "const GSERIALIZED *", - bitmatrix: bool, - border_inc: bool, -) -> "Tuple['Temporal **', 'GSERIALIZED ***', 'int']": +def econtains_tgeo_tgeo( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[int, "int"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.econtains_tgeo_tgeo(temp1_converted, temp2_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def ecovers_geo_tgeo( + gs: Annotated[_ffi.CData, "const GSERIALIZED *"], temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[int, "int"]: + gs_converted = _ffi.cast("const GSERIALIZED *", gs) temp_converted = _ffi.cast("const Temporal *", temp) - sorigin_converted = _ffi.cast("const GSERIALIZED *", sorigin) - space_bins = _ffi.new("GSERIALIZED ***") - count = _ffi.new("int *") - result = _lib.tpoint_space_split( - temp_converted, - xsize, - ysize, - zsize, - sorigin_converted, - bitmatrix, - border_inc, - space_bins, - count, - ) + result = _lib.ecovers_geo_tgeo(gs_converted, temp_converted) _check_error() - return result if result != _ffi.NULL else None, space_bins[0], count[0] + return result if result != _ffi.NULL else None -def tpoint_space_time_split( - temp: "const Temporal *", - xsize: float, - ysize: float, - zsize: float, - duration: "const Interval *", - sorigin: "const GSERIALIZED *", - torigin: int, - bitmatrix: bool, - border_inc: bool, -) -> "Tuple['Temporal **', 'GSERIALIZED ***', 'TimestampTz *', 'int']": +def ecovers_tgeo_geo( + temp: Annotated[_ffi.CData, "const Temporal *"], gs: Annotated[_ffi.CData, "const GSERIALIZED *"] +) -> Annotated[int, "int"]: temp_converted = _ffi.cast("const Temporal *", temp) - duration_converted = _ffi.cast("const Interval *", duration) - sorigin_converted = _ffi.cast("const GSERIALIZED *", sorigin) - torigin_converted = _ffi.cast("TimestampTz", torigin) - space_bins = _ffi.new("GSERIALIZED ***") - time_bins = _ffi.new("TimestampTz **") - count = _ffi.new("int *") - result = _lib.tpoint_space_time_split( - temp_converted, - xsize, - ysize, - zsize, - duration_converted, - sorigin_converted, - torigin_converted, - bitmatrix, - border_inc, - space_bins, - time_bins, - count, - ) + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + result = _lib.ecovers_tgeo_geo(temp_converted, gs_converted) _check_error() - return ( - result if result != _ffi.NULL else None, - space_bins[0], - time_bins[0], - count[0], - ) + return result if result != _ffi.NULL else None -def tpoint_time_split( - temp: "const Temporal *", - duration: "const Interval *", - torigin: int, - border_inc: bool, - time_bins: "TimestampTz **", -) -> "Tuple['Temporal **', 'int']": +def ecovers_tgeo_tgeo( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[int, "int"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.ecovers_tgeo_tgeo(temp1_converted, temp2_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def edisjoint_tgeo_geo( + temp: Annotated[_ffi.CData, "const Temporal *"], gs: Annotated[_ffi.CData, "const GSERIALIZED *"] +) -> Annotated[int, "int"]: temp_converted = _ffi.cast("const Temporal *", temp) - duration_converted = _ffi.cast("const Interval *", duration) - torigin_converted = _ffi.cast("TimestampTz", torigin) - time_bins_converted = [_ffi.cast("TimestampTz *", x) for x in time_bins] - count = _ffi.new("int *") - result = _lib.tpoint_time_split( - temp_converted, - duration_converted, - torigin_converted, - border_inc, - time_bins_converted, - count, - ) + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + result = _lib.edisjoint_tgeo_geo(temp_converted, gs_converted) _check_error() - return result if result != _ffi.NULL else None, count[0] + return result if result != _ffi.NULL else None -def temptype_subtype(subtype: "tempSubtype") -> "bool": - subtype_converted = _ffi.cast("tempSubtype", subtype) - result = _lib.temptype_subtype(subtype_converted) +def edisjoint_tgeo_tgeo( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[int, "int"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.edisjoint_tgeo_tgeo(temp1_converted, temp2_converted) _check_error() return result if result != _ffi.NULL else None -def temptype_subtype_all(subtype: "tempSubtype") -> "bool": - subtype_converted = _ffi.cast("tempSubtype", subtype) - result = _lib.temptype_subtype_all(subtype_converted) +def edwithin_tgeo_geo( + temp: Annotated[_ffi.CData, "const Temporal *"], gs: Annotated[_ffi.CData, "const GSERIALIZED *"], dist: float +) -> Annotated[int, "int"]: + temp_converted = _ffi.cast("const Temporal *", temp) + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + result = _lib.edwithin_tgeo_geo(temp_converted, gs_converted, dist) _check_error() return result if result != _ffi.NULL else None -def tempsubtype_name(subtype: "tempSubtype") -> str: - subtype_converted = _ffi.cast("tempSubtype", subtype) - result = _lib.tempsubtype_name(subtype_converted) +def edwithin_tgeo_tgeo( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"], dist: float +) -> Annotated[int, "int"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.edwithin_tgeo_tgeo(temp1_converted, temp2_converted, dist) _check_error() - result = _ffi.string(result).decode("utf-8") return result if result != _ffi.NULL else None -def tempsubtype_from_string(string: str, subtype: "int16 *") -> "bool": - string_converted = string.encode("utf-8") - subtype_converted = _ffi.cast("int16 *", subtype) - result = _lib.tempsubtype_from_string(string_converted, subtype_converted) +def eintersects_tgeo_geo( + temp: Annotated[_ffi.CData, "const Temporal *"], gs: Annotated[_ffi.CData, "const GSERIALIZED *"] +) -> Annotated[int, "int"]: + temp_converted = _ffi.cast("const Temporal *", temp) + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + result = _lib.eintersects_tgeo_geo(temp_converted, gs_converted) _check_error() return result if result != _ffi.NULL else None -def meosoper_name(oper: "meosOper") -> str: - oper_converted = _ffi.cast("meosOper", oper) - result = _lib.meosoper_name(oper_converted) +def eintersects_tgeo_tgeo( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[int, "int"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.eintersects_tgeo_tgeo(temp1_converted, temp2_converted) _check_error() - result = _ffi.string(result).decode("utf-8") return result if result != _ffi.NULL else None -def meosoper_from_string(name: str) -> "meosOper": - name_converted = name.encode("utf-8") - result = _lib.meosoper_from_string(name_converted) +def etouches_tgeo_geo( + temp: Annotated[_ffi.CData, "const Temporal *"], gs: Annotated[_ffi.CData, "const GSERIALIZED *"] +) -> Annotated[int, "int"]: + temp_converted = _ffi.cast("const Temporal *", temp) + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + result = _lib.etouches_tgeo_geo(temp_converted, gs_converted) _check_error() return result if result != _ffi.NULL else None -def interptype_name(interp: "interpType") -> str: - interp_converted = _ffi.cast("interpType", interp) - result = _lib.interptype_name(interp_converted) +def etouches_tgeo_tgeo( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[int, "int"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.etouches_tgeo_tgeo(temp1_converted, temp2_converted) _check_error() - result = _ffi.string(result).decode("utf-8") return result if result != _ffi.NULL else None -def interptype_from_string(interp_str: str) -> "interpType": - interp_str_converted = interp_str.encode("utf-8") - result = _lib.interptype_from_string(interp_str_converted) +def etouches_tpoint_geo( + temp: Annotated[_ffi.CData, "const Temporal *"], gs: Annotated[_ffi.CData, "const GSERIALIZED *"] +) -> Annotated[int, "int"]: + temp_converted = _ffi.cast("const Temporal *", temp) + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + result = _lib.etouches_tpoint_geo(temp_converted, gs_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def tcontains_geo_tgeo( + gs: Annotated[_ffi.CData, "const GSERIALIZED *"], + temp: Annotated[_ffi.CData, "const Temporal *"], + restr: bool, + atvalue: bool, +) -> Annotated[_ffi.CData, "Temporal *"]: + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.tcontains_geo_tgeo(gs_converted, temp_converted, restr, atvalue) _check_error() return result if result != _ffi.NULL else None -def meostype_name(type: "meosType") -> str: - type_converted = _ffi.cast("meosType", type) - result = _lib.meostype_name(type_converted) +def tcontains_tgeo_geo( + temp: Annotated[_ffi.CData, "const Temporal *"], + gs: Annotated[_ffi.CData, "const GSERIALIZED *"], + restr: bool, + atvalue: bool, +) -> Annotated[_ffi.CData, "Temporal *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + result = _lib.tcontains_tgeo_geo(temp_converted, gs_converted, restr, atvalue) _check_error() - result = _ffi.string(result).decode("utf-8") return result if result != _ffi.NULL else None -def temptype_basetype(type: "meosType") -> "meosType": - type_converted = _ffi.cast("meosType", type) - result = _lib.temptype_basetype(type_converted) +def tcontains_tgeo_tgeo( + temp1: Annotated[_ffi.CData, "const Temporal *"], + temp2: Annotated[_ffi.CData, "const Temporal *"], + restr: bool, + atvalue: bool, +) -> Annotated[_ffi.CData, "Temporal *"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.tcontains_tgeo_tgeo(temp1_converted, temp2_converted, restr, atvalue) _check_error() return result if result != _ffi.NULL else None -def settype_basetype(type: "meosType") -> "meosType": - type_converted = _ffi.cast("meosType", type) - result = _lib.settype_basetype(type_converted) +def tcovers_geo_tgeo( + gs: Annotated[_ffi.CData, "const GSERIALIZED *"], + temp: Annotated[_ffi.CData, "const Temporal *"], + restr: bool, + atvalue: bool, +) -> Annotated[_ffi.CData, "Temporal *"]: + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.tcovers_geo_tgeo(gs_converted, temp_converted, restr, atvalue) _check_error() return result if result != _ffi.NULL else None -def spantype_basetype(type: "meosType") -> "meosType": - type_converted = _ffi.cast("meosType", type) - result = _lib.spantype_basetype(type_converted) +def tcovers_tgeo_geo( + temp: Annotated[_ffi.CData, "const Temporal *"], + gs: Annotated[_ffi.CData, "const GSERIALIZED *"], + restr: bool, + atvalue: bool, +) -> Annotated[_ffi.CData, "Temporal *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + result = _lib.tcovers_tgeo_geo(temp_converted, gs_converted, restr, atvalue) _check_error() return result if result != _ffi.NULL else None -def spantype_spansettype(type: "meosType") -> "meosType": - type_converted = _ffi.cast("meosType", type) - result = _lib.spantype_spansettype(type_converted) +def tcovers_tgeo_tgeo( + temp1: Annotated[_ffi.CData, "const Temporal *"], + temp2: Annotated[_ffi.CData, "const Temporal *"], + restr: bool, + atvalue: bool, +) -> Annotated[_ffi.CData, "Temporal *"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.tcovers_tgeo_tgeo(temp1_converted, temp2_converted, restr, atvalue) _check_error() return result if result != _ffi.NULL else None -def spansettype_spantype(type: "meosType") -> "meosType": - type_converted = _ffi.cast("meosType", type) - result = _lib.spansettype_spantype(type_converted) +def tdisjoint_geo_tgeo( + gs: Annotated[_ffi.CData, "const GSERIALIZED *"], + temp: Annotated[_ffi.CData, "const Temporal *"], + restr: bool, + atvalue: bool, +) -> Annotated[_ffi.CData, "Temporal *"]: + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.tdisjoint_geo_tgeo(gs_converted, temp_converted, restr, atvalue) _check_error() return result if result != _ffi.NULL else None -def basetype_spantype(type: "meosType") -> "meosType": - type_converted = _ffi.cast("meosType", type) - result = _lib.basetype_spantype(type_converted) +def tdisjoint_tgeo_geo( + temp: Annotated[_ffi.CData, "const Temporal *"], + gs: Annotated[_ffi.CData, "const GSERIALIZED *"], + restr: bool, + atvalue: bool, +) -> Annotated[_ffi.CData, "Temporal *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + result = _lib.tdisjoint_tgeo_geo(temp_converted, gs_converted, restr, atvalue) _check_error() return result if result != _ffi.NULL else None -def basetype_settype(type: "meosType") -> "meosType": - type_converted = _ffi.cast("meosType", type) - result = _lib.basetype_settype(type_converted) +def tdisjoint_tgeo_tgeo( + temp1: Annotated[_ffi.CData, "const Temporal *"], + temp2: Annotated[_ffi.CData, "const Temporal *"], + restr: bool, + atvalue: bool, +) -> Annotated[_ffi.CData, "Temporal *"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.tdisjoint_tgeo_tgeo(temp1_converted, temp2_converted, restr, atvalue) _check_error() return result if result != _ffi.NULL else None -def meos_basetype(type: "meosType") -> "bool": - type_converted = _ffi.cast("meosType", type) - result = _lib.meos_basetype(type_converted) +def tdwithin_geo_tgeo( + gs: Annotated[_ffi.CData, "const GSERIALIZED *"], + temp: Annotated[_ffi.CData, "const Temporal *"], + dist: float, + restr: bool, + atvalue: bool, +) -> Annotated[_ffi.CData, "Temporal *"]: + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.tdwithin_geo_tgeo(gs_converted, temp_converted, dist, restr, atvalue) _check_error() return result if result != _ffi.NULL else None -def alpha_basetype(type: "meosType") -> "bool": - type_converted = _ffi.cast("meosType", type) - result = _lib.alpha_basetype(type_converted) +def tdwithin_tgeo_geo( + temp: Annotated[_ffi.CData, "const Temporal *"], + gs: Annotated[_ffi.CData, "const GSERIALIZED *"], + dist: float, + restr: bool, + atvalue: bool, +) -> Annotated[_ffi.CData, "Temporal *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + result = _lib.tdwithin_tgeo_geo(temp_converted, gs_converted, dist, restr, atvalue) _check_error() return result if result != _ffi.NULL else None -def tnumber_basetype(type: "meosType") -> "bool": - type_converted = _ffi.cast("meosType", type) - result = _lib.tnumber_basetype(type_converted) +def tdwithin_tgeo_tgeo( + temp1: Annotated[_ffi.CData, "const Temporal *"], + temp2: Annotated[_ffi.CData, "const Temporal *"], + dist: float, + restr: bool, + atvalue: bool, +) -> Annotated[_ffi.CData, "Temporal *"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.tdwithin_tgeo_tgeo(temp1_converted, temp2_converted, dist, restr, atvalue) _check_error() return result if result != _ffi.NULL else None -def alphanum_basetype(type: "meosType") -> "bool": - type_converted = _ffi.cast("meosType", type) - result = _lib.alphanum_basetype(type_converted) +def tintersects_geo_tgeo( + gs: Annotated[_ffi.CData, "const GSERIALIZED *"], + temp: Annotated[_ffi.CData, "const Temporal *"], + restr: bool, + atvalue: bool, +) -> Annotated[_ffi.CData, "Temporal *"]: + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.tintersects_geo_tgeo(gs_converted, temp_converted, restr, atvalue) _check_error() return result if result != _ffi.NULL else None -def geo_basetype(type: "meosType") -> "bool": - type_converted = _ffi.cast("meosType", type) - result = _lib.geo_basetype(type_converted) +def tintersects_tgeo_geo( + temp: Annotated[_ffi.CData, "const Temporal *"], + gs: Annotated[_ffi.CData, "const GSERIALIZED *"], + restr: bool, + atvalue: bool, +) -> Annotated[_ffi.CData, "Temporal *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + result = _lib.tintersects_tgeo_geo(temp_converted, gs_converted, restr, atvalue) _check_error() return result if result != _ffi.NULL else None -def spatial_basetype(type: "meosType") -> "bool": - type_converted = _ffi.cast("meosType", type) - result = _lib.spatial_basetype(type_converted) +def tintersects_tgeo_tgeo( + temp1: Annotated[_ffi.CData, "const Temporal *"], + temp2: Annotated[_ffi.CData, "const Temporal *"], + restr: bool, + atvalue: bool, +) -> Annotated[_ffi.CData, "Temporal *"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.tintersects_tgeo_tgeo(temp1_converted, temp2_converted, restr, atvalue) _check_error() return result if result != _ffi.NULL else None -def time_type(type: "meosType") -> "bool": - type_converted = _ffi.cast("meosType", type) - result = _lib.time_type(type_converted) +def ttouches_geo_tgeo( + gs: Annotated[_ffi.CData, "const GSERIALIZED *"], + temp: Annotated[_ffi.CData, "const Temporal *"], + restr: bool, + atvalue: bool, +) -> Annotated[_ffi.CData, "Temporal *"]: + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.ttouches_geo_tgeo(gs_converted, temp_converted, restr, atvalue) _check_error() return result if result != _ffi.NULL else None -def set_basetype(type: "meosType") -> "bool": - type_converted = _ffi.cast("meosType", type) - result = _lib.set_basetype(type_converted) +def ttouches_tgeo_geo( + temp: Annotated[_ffi.CData, "const Temporal *"], + gs: Annotated[_ffi.CData, "const GSERIALIZED *"], + restr: bool, + atvalue: bool, +) -> Annotated[_ffi.CData, "Temporal *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + result = _lib.ttouches_tgeo_geo(temp_converted, gs_converted, restr, atvalue) _check_error() return result if result != _ffi.NULL else None -def set_type(type: "meosType") -> "bool": - type_converted = _ffi.cast("meosType", type) - result = _lib.set_type(type_converted) +def ttouches_tgeo_tgeo( + temp1: Annotated[_ffi.CData, "const Temporal *"], + temp2: Annotated[_ffi.CData, "const Temporal *"], + restr: bool, + atvalue: bool, +) -> Annotated[_ffi.CData, "Temporal *"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.ttouches_tgeo_tgeo(temp1_converted, temp2_converted, restr, atvalue) _check_error() return result if result != _ffi.NULL else None -def numset_type(type: "meosType") -> "bool": - type_converted = _ffi.cast("meosType", type) - result = _lib.numset_type(type_converted) +def tdistance_tgeo_geo( + temp: Annotated[_ffi.CData, "const Temporal *"], gs: Annotated[_ffi.CData, "const GSERIALIZED *"] +) -> Annotated[_ffi.CData, "Temporal *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + result = _lib.tdistance_tgeo_geo(temp_converted, gs_converted) _check_error() return result if result != _ffi.NULL else None -def ensure_numset_type(type: "meosType") -> "bool": - type_converted = _ffi.cast("meosType", type) - result = _lib.ensure_numset_type(type_converted) +def tdistance_tgeo_tgeo( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[_ffi.CData, "Temporal *"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.tdistance_tgeo_tgeo(temp1_converted, temp2_converted) _check_error() return result if result != _ffi.NULL else None -def timeset_type(type: "meosType") -> "bool": - type_converted = _ffi.cast("meosType", type) - result = _lib.timeset_type(type_converted) +def nad_stbox_geo( + box: Annotated[_ffi.CData, "const STBox *"], gs: Annotated[_ffi.CData, "const GSERIALIZED *"] +) -> Annotated[float, "double"]: + box_converted = _ffi.cast("const STBox *", box) + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + result = _lib.nad_stbox_geo(box_converted, gs_converted) _check_error() return result if result != _ffi.NULL else None -def ensure_timeset_type(type: "meosType") -> "bool": - type_converted = _ffi.cast("meosType", type) - result = _lib.ensure_timeset_type(type_converted) +def nad_stbox_stbox( + box1: Annotated[_ffi.CData, "const STBox *"], box2: Annotated[_ffi.CData, "const STBox *"] +) -> Annotated[float, "double"]: + box1_converted = _ffi.cast("const STBox *", box1) + box2_converted = _ffi.cast("const STBox *", box2) + result = _lib.nad_stbox_stbox(box1_converted, box2_converted) _check_error() return result if result != _ffi.NULL else None -def set_spantype(type: "meosType") -> "bool": - type_converted = _ffi.cast("meosType", type) - result = _lib.set_spantype(type_converted) +def nad_tgeo_geo( + temp: Annotated[_ffi.CData, "const Temporal *"], gs: Annotated[_ffi.CData, "const GSERIALIZED *"] +) -> Annotated[float, "double"]: + temp_converted = _ffi.cast("const Temporal *", temp) + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + result = _lib.nad_tgeo_geo(temp_converted, gs_converted) _check_error() return result if result != _ffi.NULL else None -def ensure_set_spantype(type: "meosType") -> "bool": - type_converted = _ffi.cast("meosType", type) - result = _lib.ensure_set_spantype(type_converted) +def nad_tgeo_stbox( + temp: Annotated[_ffi.CData, "const Temporal *"], box: Annotated[_ffi.CData, "const STBox *"] +) -> Annotated[float, "double"]: + temp_converted = _ffi.cast("const Temporal *", temp) + box_converted = _ffi.cast("const STBox *", box) + result = _lib.nad_tgeo_stbox(temp_converted, box_converted) _check_error() return result if result != _ffi.NULL else None -def alphanumset_type(settype: "meosType") -> "bool": - settype_converted = _ffi.cast("meosType", settype) - result = _lib.alphanumset_type(settype_converted) +def nad_tgeo_tgeo( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[float, "double"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.nad_tgeo_tgeo(temp1_converted, temp2_converted) _check_error() return result if result != _ffi.NULL else None -def geoset_type(type: "meosType") -> "bool": - type_converted = _ffi.cast("meosType", type) - result = _lib.geoset_type(type_converted) +def nai_tgeo_geo( + temp: Annotated[_ffi.CData, "const Temporal *"], gs: Annotated[_ffi.CData, "const GSERIALIZED *"] +) -> Annotated[_ffi.CData, "TInstant *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + result = _lib.nai_tgeo_geo(temp_converted, gs_converted) _check_error() return result if result != _ffi.NULL else None -def ensure_geoset_type(type: "meosType") -> "bool": - type_converted = _ffi.cast("meosType", type) - result = _lib.ensure_geoset_type(type_converted) +def nai_tgeo_tgeo( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[_ffi.CData, "TInstant *"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.nai_tgeo_tgeo(temp1_converted, temp2_converted) _check_error() return result if result != _ffi.NULL else None -def spatialset_type(type: "meosType") -> "bool": - type_converted = _ffi.cast("meosType", type) - result = _lib.spatialset_type(type_converted) +def shortestline_tgeo_geo( + temp: Annotated[_ffi.CData, "const Temporal *"], gs: Annotated[_ffi.CData, "const GSERIALIZED *"] +) -> Annotated[_ffi.CData, "GSERIALIZED *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + result = _lib.shortestline_tgeo_geo(temp_converted, gs_converted) _check_error() return result if result != _ffi.NULL else None -def ensure_spatialset_type(type: "meosType") -> "bool": - type_converted = _ffi.cast("meosType", type) - result = _lib.ensure_spatialset_type(type_converted) +def shortestline_tgeo_tgeo( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[_ffi.CData, "GSERIALIZED *"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.shortestline_tgeo_tgeo(temp1_converted, temp2_converted) _check_error() return result if result != _ffi.NULL else None -def span_basetype(type: "meosType") -> "bool": - type_converted = _ffi.cast("meosType", type) - result = _lib.span_basetype(type_converted) +def tpoint_tcentroid_finalfn(state: Annotated[_ffi.CData, "SkipList *"]) -> Annotated[_ffi.CData, "Temporal *"]: + state_converted = _ffi.cast("SkipList *", state) + result = _lib.tpoint_tcentroid_finalfn(state_converted) _check_error() return result if result != _ffi.NULL else None -def span_canon_basetype(type: "meosType") -> "bool": - type_converted = _ffi.cast("meosType", type) - result = _lib.span_canon_basetype(type_converted) +def tpoint_tcentroid_transfn( + state: Annotated[_ffi.CData, "SkipList *"], temp: Annotated[_ffi.CData, "Temporal *"] +) -> Annotated[_ffi.CData, "SkipList *"]: + state_converted = _ffi.cast("SkipList *", state) + temp_converted = _ffi.cast("Temporal *", temp) + result = _lib.tpoint_tcentroid_transfn(state_converted, temp_converted) _check_error() return result if result != _ffi.NULL else None -def span_type(type: "meosType") -> "bool": - type_converted = _ffi.cast("meosType", type) - result = _lib.span_type(type_converted) +def tspatial_extent_transfn( + box: Annotated[_ffi.CData, "STBox *"] | None, temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[_ffi.CData, "STBox *"]: + box_converted = _ffi.cast("STBox *", box) if box is not None else _ffi.NULL + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.tspatial_extent_transfn(box_converted, temp_converted) _check_error() return result if result != _ffi.NULL else None -def span_bbox_type(type: "meosType") -> "bool": - type_converted = _ffi.cast("meosType", type) - result = _lib.span_bbox_type(type_converted) +def stbox_get_space_tile( + point: Annotated[_ffi.CData, "const GSERIALIZED *"], + xsize: float, + ysize: float, + zsize: float, + sorigin: Annotated[_ffi.CData, "const GSERIALIZED *"], +) -> Annotated[_ffi.CData, "STBox *"]: + point_converted = _ffi.cast("const GSERIALIZED *", point) + sorigin_converted = _ffi.cast("const GSERIALIZED *", sorigin) + result = _lib.stbox_get_space_tile(point_converted, xsize, ysize, zsize, sorigin_converted) _check_error() return result if result != _ffi.NULL else None -def numspan_basetype(type: "meosType") -> "bool": - type_converted = _ffi.cast("meosType", type) - result = _lib.numspan_basetype(type_converted) +def stbox_get_space_time_tile( + point: Annotated[_ffi.CData, "const GSERIALIZED *"], + t: int, + xsize: float, + ysize: float, + zsize: float, + duration: Annotated[_ffi.CData, "const Interval *"], + sorigin: Annotated[_ffi.CData, "const GSERIALIZED *"], + torigin: int, +) -> Annotated[_ffi.CData, "STBox *"]: + point_converted = _ffi.cast("const GSERIALIZED *", point) + t_converted = _ffi.cast("TimestampTz", t) + duration_converted = _ffi.cast("const Interval *", duration) + sorigin_converted = _ffi.cast("const GSERIALIZED *", sorigin) + torigin_converted = _ffi.cast("TimestampTz", torigin) + result = _lib.stbox_get_space_time_tile( + point_converted, t_converted, xsize, ysize, zsize, duration_converted, sorigin_converted, torigin_converted + ) _check_error() return result if result != _ffi.NULL else None -def numspan_type(type: "meosType") -> "bool": - type_converted = _ffi.cast("meosType", type) - result = _lib.numspan_type(type_converted) +def stbox_get_time_tile( + t: int, duration: Annotated[_ffi.CData, "const Interval *"], torigin: int +) -> Annotated[_ffi.CData, "STBox *"]: + t_converted = _ffi.cast("TimestampTz", t) + duration_converted = _ffi.cast("const Interval *", duration) + torigin_converted = _ffi.cast("TimestampTz", torigin) + result = _lib.stbox_get_time_tile(t_converted, duration_converted, torigin_converted) _check_error() return result if result != _ffi.NULL else None -def ensure_numspan_type(type: "meosType") -> "bool": - type_converted = _ffi.cast("meosType", type) - result = _lib.ensure_numspan_type(type_converted) +def stbox_space_tiles( + bounds: Annotated[_ffi.CData, "const STBox *"], + xsize: float, + ysize: float, + zsize: float, + sorigin: Annotated[_ffi.CData, "const GSERIALIZED *"], + border_inc: bool, + count: Annotated[_ffi.CData, "int *"], +) -> Annotated[_ffi.CData, "STBox *"]: + bounds_converted = _ffi.cast("const STBox *", bounds) + sorigin_converted = _ffi.cast("const GSERIALIZED *", sorigin) + count_converted = _ffi.cast("int *", count) + result = _lib.stbox_space_tiles( + bounds_converted, xsize, ysize, zsize, sorigin_converted, border_inc, count_converted + ) _check_error() return result if result != _ffi.NULL else None -def timespan_basetype(type: "meosType") -> "bool": - type_converted = _ffi.cast("meosType", type) - result = _lib.timespan_basetype(type_converted) +def stbox_space_time_tiles( + bounds: Annotated[_ffi.CData, "const STBox *"], + xsize: float, + ysize: float, + zsize: float, + duration: Annotated[_ffi.CData, "const Interval *"] | None, + sorigin: Annotated[_ffi.CData, "const GSERIALIZED *"], + torigin: int, + border_inc: bool, +) -> tuple[Annotated[_ffi.CData, "STBox *"], Annotated[_ffi.CData, "int"]]: + bounds_converted = _ffi.cast("const STBox *", bounds) + duration_converted = _ffi.cast("const Interval *", duration) if duration is not None else _ffi.NULL + sorigin_converted = _ffi.cast("const GSERIALIZED *", sorigin) + torigin_converted = _ffi.cast("TimestampTz", torigin) + count = _ffi.new("int *") + result = _lib.stbox_space_time_tiles( + bounds_converted, + xsize, + ysize, + zsize, + duration_converted, + sorigin_converted, + torigin_converted, + border_inc, + count, + ) _check_error() - return result if result != _ffi.NULL else None + return result if result != _ffi.NULL else None, count[0] -def timespan_type(type: "meosType") -> "bool": - type_converted = _ffi.cast("meosType", type) - result = _lib.timespan_type(type_converted) +def stbox_time_tiles( + bounds: Annotated[_ffi.CData, "const STBox *"], + duration: Annotated[_ffi.CData, "const Interval *"], + torigin: int, + border_inc: bool, + count: Annotated[_ffi.CData, "int *"], +) -> Annotated[_ffi.CData, "STBox *"]: + bounds_converted = _ffi.cast("const STBox *", bounds) + duration_converted = _ffi.cast("const Interval *", duration) + torigin_converted = _ffi.cast("TimestampTz", torigin) + count_converted = _ffi.cast("int *", count) + result = _lib.stbox_time_tiles(bounds_converted, duration_converted, torigin_converted, border_inc, count_converted) _check_error() return result if result != _ffi.NULL else None -def ensure_timespan_type(type: "meosType") -> "bool": - type_converted = _ffi.cast("meosType", type) - result = _lib.ensure_timespan_type(type_converted) +def tgeo_space_split( + temp: Annotated[_ffi.CData, "const Temporal *"], + xsize: float, + ysize: float, + zsize: float, + sorigin: Annotated[_ffi.CData, "const GSERIALIZED *"], + bitmatrix: bool, + border_inc: bool, +) -> tuple[Annotated[_ffi.CData, "Temporal **"], Annotated[list, "GSERIALIZED ***"], Annotated[_ffi.CData, "int"]]: + temp_converted = _ffi.cast("const Temporal *", temp) + sorigin_converted = _ffi.cast("const GSERIALIZED *", sorigin) + space_bins = _ffi.new("GSERIALIZED ***") + count = _ffi.new("int *") + result = _lib.tgeo_space_split( + temp_converted, xsize, ysize, zsize, sorigin_converted, bitmatrix, border_inc, space_bins, count + ) _check_error() - return result if result != _ffi.NULL else None + return result if result != _ffi.NULL else None, space_bins[0], count[0] -def spanset_type(type: "meosType") -> "bool": - type_converted = _ffi.cast("meosType", type) - result = _lib.spanset_type(type_converted) +def tgeo_space_time_split( + temp: Annotated[_ffi.CData, "const Temporal *"], + xsize: float, + ysize: float, + zsize: float, + duration: Annotated[_ffi.CData, "const Interval *"], + sorigin: Annotated[_ffi.CData, "const GSERIALIZED *"], + torigin: int, + bitmatrix: bool, + border_inc: bool, +) -> tuple[ + Annotated[_ffi.CData, "Temporal **"], + Annotated[list, "GSERIALIZED ***"], + Annotated[list, "TimestampTz *"], + Annotated[_ffi.CData, "int"], +]: + temp_converted = _ffi.cast("const Temporal *", temp) + duration_converted = _ffi.cast("const Interval *", duration) + sorigin_converted = _ffi.cast("const GSERIALIZED *", sorigin) + torigin_converted = _ffi.cast("TimestampTz", torigin) + space_bins = _ffi.new("GSERIALIZED ***") + time_bins = _ffi.new("TimestampTz **") + count = _ffi.new("int *") + result = _lib.tgeo_space_time_split( + temp_converted, + xsize, + ysize, + zsize, + duration_converted, + sorigin_converted, + torigin_converted, + bitmatrix, + border_inc, + space_bins, + time_bins, + count, + ) _check_error() - return result if result != _ffi.NULL else None + return result if result != _ffi.NULL else None, space_bins[0], time_bins[0], count[0] -def numspanset_type(type: "meosType") -> "bool": - type_converted = _ffi.cast("meosType", type) - result = _lib.numspanset_type(type_converted) +def geo_cluster_kmeans( + geoms: Annotated[list, "const GSERIALIZED **"], + ngeoms: Annotated[_ffi.CData, "uint32_t"], + k: Annotated[_ffi.CData, "uint32_t"], +) -> Annotated[_ffi.CData, "int *"]: + geoms_converted = [_ffi.cast("const GSERIALIZED *", x) for x in geoms] + ngeoms_converted = _ffi.cast("uint32_t", ngeoms) + k_converted = _ffi.cast("uint32_t", k) + result = _lib.geo_cluster_kmeans(geoms_converted, ngeoms_converted, k_converted) _check_error() return result if result != _ffi.NULL else None -def timespanset_type(type: "meosType") -> "bool": - type_converted = _ffi.cast("meosType", type) - result = _lib.timespanset_type(type_converted) +def geo_cluster_dbscan( + geoms: Annotated[list, "const GSERIALIZED **"], + ngeoms: Annotated[_ffi.CData, "uint32_t"], + tolerance: float, + minpoints: int, +) -> Annotated[_ffi.CData, "uint32_t *"]: + geoms_converted = [_ffi.cast("const GSERIALIZED *", x) for x in geoms] + ngeoms_converted = _ffi.cast("uint32_t", ngeoms) + result = _lib.geo_cluster_dbscan(geoms_converted, ngeoms_converted, tolerance, minpoints) _check_error() return result if result != _ffi.NULL else None -def ensure_timespanset_type(type: "meosType") -> "bool": - type_converted = _ffi.cast("meosType", type) - result = _lib.ensure_timespanset_type(type_converted) +def geo_cluster_intersecting( + geoms: Annotated[list, "const GSERIALIZED **"], + ngeoms: Annotated[_ffi.CData, "uint32_t"], + count: Annotated[_ffi.CData, "int *"], +) -> Annotated[_ffi.CData, "GSERIALIZED **"]: + geoms_converted = [_ffi.cast("const GSERIALIZED *", x) for x in geoms] + ngeoms_converted = _ffi.cast("uint32_t", ngeoms) + count_converted = _ffi.cast("int *", count) + result = _lib.geo_cluster_intersecting(geoms_converted, ngeoms_converted, count_converted) _check_error() return result if result != _ffi.NULL else None -def temporal_type(type: "meosType") -> "bool": - type_converted = _ffi.cast("meosType", type) - result = _lib.temporal_type(type_converted) +def geo_cluster_within( + geoms: Annotated[list, "const GSERIALIZED **"], + ngeoms: Annotated[_ffi.CData, "uint32_t"], + tolerance: float, + count: Annotated[_ffi.CData, "int *"], +) -> Annotated[_ffi.CData, "GSERIALIZED **"]: + geoms_converted = [_ffi.cast("const GSERIALIZED *", x) for x in geoms] + ngeoms_converted = _ffi.cast("uint32_t", ngeoms) + count_converted = _ffi.cast("int *", count) + result = _lib.geo_cluster_within(geoms_converted, ngeoms_converted, tolerance, count_converted) _check_error() return result if result != _ffi.NULL else None -def temporal_basetype(type: "meosType") -> "bool": - type_converted = _ffi.cast("meosType", type) - result = _lib.temporal_basetype(type_converted) +def gsl_get_generation_rng() -> Annotated[_ffi.CData, "gsl_rng *"]: + result = _lib.gsl_get_generation_rng() _check_error() return result if result != _ffi.NULL else None -def temptype_continuous(type: "meosType") -> "bool": - type_converted = _ffi.cast("meosType", type) - result = _lib.temptype_continuous(type_converted) +def gsl_get_aggregation_rng() -> Annotated[_ffi.CData, "gsl_rng *"]: + result = _lib.gsl_get_aggregation_rng() _check_error() return result if result != _ffi.NULL else None -def basetype_byvalue(type: "meosType") -> "bool": - type_converted = _ffi.cast("meosType", type) - result = _lib.basetype_byvalue(type_converted) +def datum_ceil(d: Annotated[_ffi.CData, "Datum"]) -> Annotated[_ffi.CData, "Datum"]: + d_converted = _ffi.cast("Datum", d) + result = _lib.datum_ceil(d_converted) _check_error() return result if result != _ffi.NULL else None -def basetype_varlength(type: "meosType") -> "bool": - type_converted = _ffi.cast("meosType", type) - result = _lib.basetype_varlength(type_converted) +def datum_degrees( + d: Annotated[_ffi.CData, "Datum"], normalize: Annotated[_ffi.CData, "Datum"] +) -> Annotated[_ffi.CData, "Datum"]: + d_converted = _ffi.cast("Datum", d) + normalize_converted = _ffi.cast("Datum", normalize) + result = _lib.datum_degrees(d_converted, normalize_converted) _check_error() return result if result != _ffi.NULL else None -def basetype_length(type: "meosType") -> "int16": - type_converted = _ffi.cast("meosType", type) - result = _lib.basetype_length(type_converted) +def datum_float_round( + value: Annotated[_ffi.CData, "Datum"], size: Annotated[_ffi.CData, "Datum"] +) -> Annotated[_ffi.CData, "Datum"]: + value_converted = _ffi.cast("Datum", value) + size_converted = _ffi.cast("Datum", size) + result = _lib.datum_float_round(value_converted, size_converted) _check_error() return result if result != _ffi.NULL else None -def talphanum_type(type: "meosType") -> "bool": - type_converted = _ffi.cast("meosType", type) - result = _lib.talphanum_type(type_converted) +def datum_floor(d: Annotated[_ffi.CData, "Datum"]) -> Annotated[_ffi.CData, "Datum"]: + d_converted = _ffi.cast("Datum", d) + result = _lib.datum_floor(d_converted) _check_error() return result if result != _ffi.NULL else None -def talpha_type(type: "meosType") -> "bool": - type_converted = _ffi.cast("meosType", type) - result = _lib.talpha_type(type_converted) +def datum_hash( + d: Annotated[_ffi.CData, "Datum"], basetype: Annotated[_ffi.CData, "meosType"] +) -> Annotated[int, "uint32"]: + d_converted = _ffi.cast("Datum", d) + basetype_converted = _ffi.cast("meosType", basetype) + result = _lib.datum_hash(d_converted, basetype_converted) _check_error() return result if result != _ffi.NULL else None -def tnumber_type(type: "meosType") -> "bool": - type_converted = _ffi.cast("meosType", type) - result = _lib.tnumber_type(type_converted) +def datum_hash_extended( + d: Annotated[_ffi.CData, "Datum"], basetype: Annotated[_ffi.CData, "meosType"], seed: int +) -> Annotated[int, "uint64"]: + d_converted = _ffi.cast("Datum", d) + basetype_converted = _ffi.cast("meosType", basetype) + seed_converted = _ffi.cast("uint64", seed) + result = _lib.datum_hash_extended(d_converted, basetype_converted, seed_converted) _check_error() return result if result != _ffi.NULL else None -def ensure_tnumber_type(type: "meosType") -> "bool": - type_converted = _ffi.cast("meosType", type) - result = _lib.ensure_tnumber_type(type_converted) +def datum_radians(d: Annotated[_ffi.CData, "Datum"]) -> Annotated[_ffi.CData, "Datum"]: + d_converted = _ffi.cast("Datum", d) + result = _lib.datum_radians(d_converted) _check_error() return result if result != _ffi.NULL else None -def ensure_tnumber_basetype(type: "meosType") -> "bool": - type_converted = _ffi.cast("meosType", type) - result = _lib.ensure_tnumber_basetype(type_converted) +def floatspan_round_set(s: Annotated[_ffi.CData, "const Span *"], maxdd: int) -> Annotated[_ffi.CData, "Span *"]: + s_converted = _ffi.cast("const Span *", s) + out_result = _ffi.new("Span *") + _lib.floatspan_round_set(s_converted, maxdd, out_result) _check_error() - return result if result != _ffi.NULL else None + return out_result if out_result != _ffi.NULL else None -def tnumber_settype(type: "meosType") -> "bool": - type_converted = _ffi.cast("meosType", type) - result = _lib.tnumber_settype(type_converted) +def set_in(string: str, basetype: Annotated[_ffi.CData, "meosType"]) -> Annotated[_ffi.CData, "Set *"]: + string_converted = string.encode("utf-8") + basetype_converted = _ffi.cast("meosType", basetype) + result = _lib.set_in(string_converted, basetype_converted) _check_error() return result if result != _ffi.NULL else None -def tnumber_spantype(type: "meosType") -> "bool": - type_converted = _ffi.cast("meosType", type) - result = _lib.tnumber_spantype(type_converted) +def set_out(s: Annotated[_ffi.CData, "const Set *"], maxdd: int) -> Annotated[str, "char *"]: + s_converted = _ffi.cast("const Set *", s) + result = _lib.set_out(s_converted, maxdd) _check_error() + result = _ffi.string(result).decode("utf-8") return result if result != _ffi.NULL else None -def tnumber_spansettype(type: "meosType") -> "bool": - type_converted = _ffi.cast("meosType", type) - result = _lib.tnumber_spansettype(type_converted) +def span_in(string: str, spantype: Annotated[_ffi.CData, "meosType"]) -> Annotated[_ffi.CData, "Span *"]: + string_converted = string.encode("utf-8") + spantype_converted = _ffi.cast("meosType", spantype) + result = _lib.span_in(string_converted, spantype_converted) _check_error() return result if result != _ffi.NULL else None -def tspatial_type(type: "meosType") -> "bool": - type_converted = _ffi.cast("meosType", type) - result = _lib.tspatial_type(type_converted) +def span_out(s: Annotated[_ffi.CData, "const Span *"], maxdd: int) -> Annotated[str, "char *"]: + s_converted = _ffi.cast("const Span *", s) + result = _lib.span_out(s_converted, maxdd) _check_error() + result = _ffi.string(result).decode("utf-8") return result if result != _ffi.NULL else None -def ensure_tspatial_type(type: "meosType") -> "bool": - type_converted = _ffi.cast("meosType", type) - result = _lib.ensure_tspatial_type(type_converted) +def spanset_in(string: str, spantype: Annotated[_ffi.CData, "meosType"]) -> Annotated[_ffi.CData, "SpanSet *"]: + string_converted = string.encode("utf-8") + spantype_converted = _ffi.cast("meosType", spantype) + result = _lib.spanset_in(string_converted, spantype_converted) _check_error() return result if result != _ffi.NULL else None -def tspatial_basetype(type: "meosType") -> "bool": - type_converted = _ffi.cast("meosType", type) - result = _lib.tspatial_basetype(type_converted) +def spanset_out(ss: Annotated[_ffi.CData, "const SpanSet *"], maxdd: int) -> Annotated[str, "char *"]: + ss_converted = _ffi.cast("const SpanSet *", ss) + result = _lib.spanset_out(ss_converted, maxdd) _check_error() + result = _ffi.string(result).decode("utf-8") return result if result != _ffi.NULL else None -def tgeo_type(type: "meosType") -> "bool": - type_converted = _ffi.cast("meosType", type) - result = _lib.tgeo_type(type_converted) +def set_make( + values: Annotated[_ffi.CData, "const Datum *"], count: int, basetype: Annotated[_ffi.CData, "meosType"], order: bool +) -> Annotated[_ffi.CData, "Set *"]: + values_converted = _ffi.cast("const Datum *", values) + basetype_converted = _ffi.cast("meosType", basetype) + result = _lib.set_make(values_converted, count, basetype_converted, order) _check_error() return result if result != _ffi.NULL else None -def ensure_tgeo_type(type: "meosType") -> "bool": - type_converted = _ffi.cast("meosType", type) - result = _lib.ensure_tgeo_type(type_converted) +def set_make_exp( + values: Annotated[_ffi.CData, "const Datum *"], + count: int, + maxcount: int, + basetype: Annotated[_ffi.CData, "meosType"], + order: bool, +) -> Annotated[_ffi.CData, "Set *"]: + values_converted = _ffi.cast("const Datum *", values) + basetype_converted = _ffi.cast("meosType", basetype) + result = _lib.set_make_exp(values_converted, count, maxcount, basetype_converted, order) _check_error() return result if result != _ffi.NULL else None -def ensure_tnumber_tgeo_type(type: "meosType") -> "bool": - type_converted = _ffi.cast("meosType", type) - result = _lib.ensure_tnumber_tgeo_type(type_converted) +def set_make_free( + values: Annotated[_ffi.CData, "Datum *"], count: int, basetype: Annotated[_ffi.CData, "meosType"], order: bool +) -> Annotated[_ffi.CData, "Set *"]: + values_converted = _ffi.cast("Datum *", values) + basetype_converted = _ffi.cast("meosType", basetype) + result = _lib.set_make_free(values_converted, count, basetype_converted, order) _check_error() return result if result != _ffi.NULL else None -def gsl_get_generation_rng() -> "gsl_rng *": - result = _lib.gsl_get_generation_rng() +def span_make( + lower: Annotated[_ffi.CData, "Datum"], + upper: Annotated[_ffi.CData, "Datum"], + lower_inc: bool, + upper_inc: bool, + basetype: Annotated[_ffi.CData, "meosType"], +) -> Annotated[_ffi.CData, "Span *"]: + lower_converted = _ffi.cast("Datum", lower) + upper_converted = _ffi.cast("Datum", upper) + basetype_converted = _ffi.cast("meosType", basetype) + result = _lib.span_make(lower_converted, upper_converted, lower_inc, upper_inc, basetype_converted) _check_error() return result if result != _ffi.NULL else None -def gsl_get_aggregation_rng() -> "gsl_rng *": - result = _lib.gsl_get_aggregation_rng() +def span_set( + lower: Annotated[_ffi.CData, "Datum"], + upper: Annotated[_ffi.CData, "Datum"], + lower_inc: bool, + upper_inc: bool, + basetype: Annotated[_ffi.CData, "meosType"], + spantype: Annotated[_ffi.CData, "meosType"], + s: Annotated[_ffi.CData, "Span *"], +) -> Annotated[None, "void"]: + lower_converted = _ffi.cast("Datum", lower) + upper_converted = _ffi.cast("Datum", upper) + basetype_converted = _ffi.cast("meosType", basetype) + spantype_converted = _ffi.cast("meosType", spantype) + s_converted = _ffi.cast("Span *", s) + _lib.span_set( + lower_converted, upper_converted, lower_inc, upper_inc, basetype_converted, spantype_converted, s_converted + ) _check_error() - return result if result != _ffi.NULL else None -def proj_get_context() -> "PJ_CONTEXT *": - result = _lib.proj_get_context() +def spanset_make_exp( + spans: Annotated[_ffi.CData, "Span *"], count: int, maxcount: int, normalize: bool, order: bool +) -> Annotated[_ffi.CData, "SpanSet *"]: + spans_converted = _ffi.cast("Span *", spans) + result = _lib.spanset_make_exp(spans_converted, count, maxcount, normalize, order) _check_error() return result if result != _ffi.NULL else None -def datum_floor(d: "Datum") -> "Datum": - d_converted = _ffi.cast("Datum", d) - result = _lib.datum_floor(d_converted) +def spanset_make_free( + spans: Annotated[_ffi.CData, "Span *"], count: int, normalize: bool, order: bool +) -> Annotated[_ffi.CData, "SpanSet *"]: + spans_converted = _ffi.cast("Span *", spans) + result = _lib.spanset_make_free(spans_converted, count, normalize, order) _check_error() return result if result != _ffi.NULL else None -def datum_ceil(d: "Datum") -> "Datum": - d_converted = _ffi.cast("Datum", d) - result = _lib.datum_ceil(d_converted) +def set_span(s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[_ffi.CData, "Span *"]: + s_converted = _ffi.cast("const Set *", s) + result = _lib.set_span(s_converted) _check_error() return result if result != _ffi.NULL else None -def datum_degrees(d: "Datum", normalize: "Datum") -> "Datum": - d_converted = _ffi.cast("Datum", d) - normalize_converted = _ffi.cast("Datum", normalize) - result = _lib.datum_degrees(d_converted, normalize_converted) +def set_spanset(s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[_ffi.CData, "SpanSet *"]: + s_converted = _ffi.cast("const Set *", s) + result = _lib.set_spanset(s_converted) _check_error() return result if result != _ffi.NULL else None -def datum_radians(d: "Datum") -> "Datum": - d_converted = _ffi.cast("Datum", d) - result = _lib.datum_radians(d_converted) +def value_set_span( + value: Annotated[_ffi.CData, "Datum"], + basetype: Annotated[_ffi.CData, "meosType"], + s: Annotated[_ffi.CData, "Span *"], +) -> Annotated[None, "void"]: + value_converted = _ffi.cast("Datum", value) + basetype_converted = _ffi.cast("meosType", basetype) + s_converted = _ffi.cast("Span *", s) + _lib.value_set_span(value_converted, basetype_converted, s_converted) _check_error() - return result if result != _ffi.NULL else None -def datum_hash(d: "Datum", basetype: "meosType") -> "uint32": +def value_set( + d: Annotated[_ffi.CData, "Datum"], basetype: Annotated[_ffi.CData, "meosType"] +) -> Annotated[_ffi.CData, "Set *"]: d_converted = _ffi.cast("Datum", d) basetype_converted = _ffi.cast("meosType", basetype) - result = _lib.datum_hash(d_converted, basetype_converted) + result = _lib.value_set(d_converted, basetype_converted) _check_error() return result if result != _ffi.NULL else None -def datum_hash_extended(d: "Datum", basetype: "meosType", seed: int) -> "uint64": +def value_span( + d: Annotated[_ffi.CData, "Datum"], basetype: Annotated[_ffi.CData, "meosType"] +) -> Annotated[_ffi.CData, "Span *"]: d_converted = _ffi.cast("Datum", d) basetype_converted = _ffi.cast("meosType", basetype) - seed_converted = _ffi.cast("uint64", seed) - result = _lib.datum_hash_extended(d_converted, basetype_converted, seed_converted) + result = _lib.value_span(d_converted, basetype_converted) _check_error() return result if result != _ffi.NULL else None -def set_in(string: str, basetype: "meosType") -> "Set *": - string_converted = string.encode("utf-8") +def value_spanset( + d: Annotated[_ffi.CData, "Datum"], basetype: Annotated[_ffi.CData, "meosType"] +) -> Annotated[_ffi.CData, "SpanSet *"]: + d_converted = _ffi.cast("Datum", d) basetype_converted = _ffi.cast("meosType", basetype) - result = _lib.set_in(string_converted, basetype_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def set_out(s: "const Set *", maxdd: int) -> str: - s_converted = _ffi.cast("const Set *", s) - result = _lib.set_out(s_converted, maxdd) - _check_error() - result = _ffi.string(result).decode("utf-8") - return result if result != _ffi.NULL else None - - -def span_in(string: str, spantype: "meosType") -> "Span *": - string_converted = string.encode("utf-8") - spantype_converted = _ffi.cast("meosType", spantype) - result = _lib.span_in(string_converted, spantype_converted) + result = _lib.value_spanset(d_converted, basetype_converted) _check_error() return result if result != _ffi.NULL else None -def span_out(s: "const Span *", maxdd: int) -> str: +def numspan_width(s: Annotated[_ffi.CData, "const Span *"]) -> Annotated[_ffi.CData, "Datum"]: s_converted = _ffi.cast("const Span *", s) - result = _lib.span_out(s_converted, maxdd) + result = _lib.numspan_width(s_converted) _check_error() - result = _ffi.string(result).decode("utf-8") return result if result != _ffi.NULL else None -def spanset_in(string: str, spantype: "meosType") -> "SpanSet *": - string_converted = string.encode("utf-8") - spantype_converted = _ffi.cast("meosType", spantype) - result = _lib.spanset_in(string_converted, spantype_converted) +def numspanset_width(ss: Annotated[_ffi.CData, "const SpanSet *"], boundspan: bool) -> Annotated[_ffi.CData, "Datum"]: + ss_converted = _ffi.cast("const SpanSet *", ss) + result = _lib.numspanset_width(ss_converted, boundspan) _check_error() return result if result != _ffi.NULL else None -def spanset_out(ss: "const SpanSet *", maxdd: int) -> str: - ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.spanset_out(ss_converted, maxdd) +def set_end_value(s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[_ffi.CData, "Datum"]: + s_converted = _ffi.cast("const Set *", s) + result = _lib.set_end_value(s_converted) _check_error() - result = _ffi.string(result).decode("utf-8") return result if result != _ffi.NULL else None -def set_cp(s: "const Set *") -> "Set *": +def set_mem_size(s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[int, "int"]: s_converted = _ffi.cast("const Set *", s) - result = _lib.set_cp(s_converted) + result = _lib.set_mem_size(s_converted) _check_error() return result if result != _ffi.NULL else None -def set_make( - values: "const Datum *", count: int, basetype: "meosType", order: bool -) -> "Set *": - values_converted = _ffi.cast("const Datum *", values) - basetype_converted = _ffi.cast("meosType", basetype) - result = _lib.set_make(values_converted, count, basetype_converted, order) +def set_set_subspan( + s: Annotated[_ffi.CData, "const Set *"], minidx: int, maxidx: int +) -> Annotated[_ffi.CData, "Span *"]: + s_converted = _ffi.cast("const Set *", s) + out_result = _ffi.new("Span *") + _lib.set_set_subspan(s_converted, minidx, maxidx, out_result) _check_error() - return result if result != _ffi.NULL else None + return out_result if out_result != _ffi.NULL else None -def set_make_exp( - values: "const Datum *", - count: int, - maxcount: int, - basetype: "meosType", - order: bool, -) -> "Set *": - values_converted = _ffi.cast("const Datum *", values) - basetype_converted = _ffi.cast("meosType", basetype) - result = _lib.set_make_exp( - values_converted, count, maxcount, basetype_converted, order - ) +def set_set_span(s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[_ffi.CData, "Span *"]: + s_converted = _ffi.cast("const Set *", s) + out_result = _ffi.new("Span *") + _lib.set_set_span(s_converted, out_result) _check_error() - return result if result != _ffi.NULL else None + return out_result if out_result != _ffi.NULL else None -def set_make_free( - values: "Datum *", count: int, basetype: "meosType", order: bool -) -> "Set *": - values_converted = _ffi.cast("Datum *", values) - basetype_converted = _ffi.cast("meosType", basetype) - result = _lib.set_make_free(values_converted, count, basetype_converted, order) +def set_start_value(s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[_ffi.CData, "Datum"]: + s_converted = _ffi.cast("const Set *", s) + result = _lib.set_start_value(s_converted) _check_error() return result if result != _ffi.NULL else None -def span_cp(s: "const Span *") -> "Span *": - s_converted = _ffi.cast("const Span *", s) - result = _lib.span_cp(s_converted) +def set_value_n(s: Annotated[_ffi.CData, "const Set *"], n: int) -> Annotated[_ffi.CData, "Datum *"]: + s_converted = _ffi.cast("const Set *", s) + out_result = _ffi.new("Datum *") + result = _lib.set_value_n(s_converted, n, out_result) _check_error() - return result if result != _ffi.NULL else None + if result: + return out_result if out_result != _ffi.NULL else None + return None -def span_make( - lower: "Datum", - upper: "Datum", - lower_inc: bool, - upper_inc: bool, - basetype: "meosType", -) -> "Span *": - lower_converted = _ffi.cast("Datum", lower) - upper_converted = _ffi.cast("Datum", upper) - basetype_converted = _ffi.cast("meosType", basetype) - result = _lib.span_make( - lower_converted, upper_converted, lower_inc, upper_inc, basetype_converted - ) +def set_vals(s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[_ffi.CData, "Datum *"]: + s_converted = _ffi.cast("const Set *", s) + result = _lib.set_vals(s_converted) _check_error() return result if result != _ffi.NULL else None -def span_set( - lower: "Datum", - upper: "Datum", - lower_inc: bool, - upper_inc: bool, - basetype: "meosType", - spantype: "meosType", - s: "Span *", -) -> None: - lower_converted = _ffi.cast("Datum", lower) - upper_converted = _ffi.cast("Datum", upper) - basetype_converted = _ffi.cast("meosType", basetype) - spantype_converted = _ffi.cast("meosType", spantype) - s_converted = _ffi.cast("Span *", s) - _lib.span_set( - lower_converted, - upper_converted, - lower_inc, - upper_inc, - basetype_converted, - spantype_converted, - s_converted, - ) +def set_values(s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[_ffi.CData, "Datum *"]: + s_converted = _ffi.cast("const Set *", s) + result = _lib.set_values(s_converted) _check_error() + return result if result != _ffi.NULL else None -def spanset_cp(ss: "const SpanSet *") -> "SpanSet *": +def spanset_lower(ss: Annotated[_ffi.CData, "const SpanSet *"]) -> Annotated[_ffi.CData, "Datum"]: ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.spanset_cp(ss_converted) + result = _lib.spanset_lower(ss_converted) _check_error() return result if result != _ffi.NULL else None -def spanset_make_exp( - spans: "Span *", count: int, maxcount: int, normalize: bool, order: bool -) -> "SpanSet *": - spans_converted = _ffi.cast("Span *", spans) - result = _lib.spanset_make_exp(spans_converted, count, maxcount, normalize, order) +def spanset_mem_size(ss: Annotated[_ffi.CData, "const SpanSet *"]) -> Annotated[int, "int"]: + ss_converted = _ffi.cast("const SpanSet *", ss) + result = _lib.spanset_mem_size(ss_converted) _check_error() return result if result != _ffi.NULL else None -def spanset_make_free( - spans: "Span *", count: int, normalize: bool, order: bool -) -> "SpanSet *": - spans_converted = _ffi.cast("Span *", spans) - result = _lib.spanset_make_free(spans_converted, count, normalize, order) +def spanset_sps(ss: Annotated[_ffi.CData, "const SpanSet *"]) -> Annotated[_ffi.CData, "const Span **"]: + ss_converted = _ffi.cast("const SpanSet *", ss) + result = _lib.spanset_sps(ss_converted) _check_error() return result if result != _ffi.NULL else None -def dateset_tstzset(s: "const Set *") -> "Set *": - s_converted = _ffi.cast("const Set *", s) - result = _lib.dateset_tstzset(s_converted) +def spanset_upper(ss: Annotated[_ffi.CData, "const SpanSet *"]) -> Annotated[_ffi.CData, "Datum"]: + ss_converted = _ffi.cast("const SpanSet *", ss) + result = _lib.spanset_upper(ss_converted) _check_error() return result if result != _ffi.NULL else None -def datespan_tstzspan(s: "const Span *") -> "Span *": - s_converted = _ffi.cast("const Span *", s) - result = _lib.datespan_tstzspan(s_converted) +def datespan_set_tstzspan( + s1: Annotated[_ffi.CData, "const Span *"], s2: Annotated[_ffi.CData, "Span *"] +) -> Annotated[None, "void"]: + s1_converted = _ffi.cast("const Span *", s1) + s2_converted = _ffi.cast("Span *", s2) + _lib.datespan_set_tstzspan(s1_converted, s2_converted) _check_error() - return result if result != _ffi.NULL else None -def datespanset_tstzspanset(ss: "const SpanSet *") -> "SpanSet *": - ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.datespanset_tstzspanset(ss_converted) +def floatspan_set_intspan( + s1: Annotated[_ffi.CData, "const Span *"], s2: Annotated[_ffi.CData, "Span *"] +) -> Annotated[None, "void"]: + s1_converted = _ffi.cast("const Span *", s1) + s2_converted = _ffi.cast("Span *", s2) + _lib.floatspan_set_intspan(s1_converted, s2_converted) _check_error() - return result if result != _ffi.NULL else None -def floatset_intset(s: "const Set *") -> "Set *": +def intspan_set_floatspan( + s1: Annotated[_ffi.CData, "const Span *"], s2: Annotated[_ffi.CData, "Span *"] +) -> Annotated[None, "void"]: + s1_converted = _ffi.cast("const Span *", s1) + s2_converted = _ffi.cast("Span *", s2) + _lib.intspan_set_floatspan(s1_converted, s2_converted) + _check_error() + + +def numset_shift_scale( + s: Annotated[_ffi.CData, "const Set *"], + shift: Annotated[_ffi.CData, "Datum"], + width: Annotated[_ffi.CData, "Datum"], + hasshift: bool, + haswidth: bool, +) -> Annotated[_ffi.CData, "Set *"]: s_converted = _ffi.cast("const Set *", s) - result = _lib.floatset_intset(s_converted) + shift_converted = _ffi.cast("Datum", shift) + width_converted = _ffi.cast("Datum", width) + result = _lib.numset_shift_scale(s_converted, shift_converted, width_converted, hasshift, haswidth) _check_error() return result if result != _ffi.NULL else None -def floatspan_intspan(s: "const Span *") -> "Span *": +def numspan_shift_scale( + s: Annotated[_ffi.CData, "const Span *"], + shift: Annotated[_ffi.CData, "Datum"], + width: Annotated[_ffi.CData, "Datum"], + hasshift: bool, + haswidth: bool, +) -> Annotated[_ffi.CData, "Span *"]: s_converted = _ffi.cast("const Span *", s) - result = _lib.floatspan_intspan(s_converted) + shift_converted = _ffi.cast("Datum", shift) + width_converted = _ffi.cast("Datum", width) + result = _lib.numspan_shift_scale(s_converted, shift_converted, width_converted, hasshift, haswidth) _check_error() return result if result != _ffi.NULL else None -def floatspanset_intspanset(ss: "const SpanSet *") -> "SpanSet *": +def numspanset_shift_scale( + ss: Annotated[_ffi.CData, "const SpanSet *"], + shift: Annotated[_ffi.CData, "Datum"], + width: Annotated[_ffi.CData, "Datum"], + hasshift: bool, + haswidth: bool, +) -> Annotated[_ffi.CData, "SpanSet *"]: ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.floatspanset_intspanset(ss_converted) + shift_converted = _ffi.cast("Datum", shift) + width_converted = _ffi.cast("Datum", width) + result = _lib.numspanset_shift_scale(ss_converted, shift_converted, width_converted, hasshift, haswidth) _check_error() return result if result != _ffi.NULL else None -def intset_floatset(s: "const Set *") -> "Set *": +def set_compact(s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[_ffi.CData, "Set *"]: s_converted = _ffi.cast("const Set *", s) - result = _lib.intset_floatset(s_converted) + result = _lib.set_compact(s_converted) _check_error() return result if result != _ffi.NULL else None -def intspan_floatspan(s: "const Span *") -> "Span *": - s_converted = _ffi.cast("const Span *", s) - result = _lib.intspan_floatspan(s_converted) +def span_expand( + s1: Annotated[_ffi.CData, "const Span *"], s2: Annotated[_ffi.CData, "Span *"] +) -> Annotated[None, "void"]: + s1_converted = _ffi.cast("const Span *", s1) + s2_converted = _ffi.cast("Span *", s2) + _lib.span_expand(s1_converted, s2_converted) _check_error() - return result if result != _ffi.NULL else None -def intspanset_floatspanset(ss: "const SpanSet *") -> "SpanSet *": +def spanset_compact(ss: Annotated[_ffi.CData, "const SpanSet *"]) -> Annotated[_ffi.CData, "SpanSet *"]: ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.intspanset_floatspanset(ss_converted) + result = _lib.spanset_compact(ss_converted) _check_error() return result if result != _ffi.NULL else None -def set_span(s: "const Set *") -> "Span *": - s_converted = _ffi.cast("const Set *", s) - result = _lib.set_span(s_converted) +def tbox_expand_value( + box: Annotated[_ffi.CData, "const TBox *"], + value: Annotated[_ffi.CData, "Datum"], + basetyp: Annotated[_ffi.CData, "meosType"], +) -> Annotated[_ffi.CData, "TBox *"]: + box_converted = _ffi.cast("const TBox *", box) + value_converted = _ffi.cast("Datum", value) + basetyp_converted = _ffi.cast("meosType", basetyp) + result = _lib.tbox_expand_value(box_converted, value_converted, basetyp_converted) _check_error() return result if result != _ffi.NULL else None -def set_spanset(s: "const Set *") -> "SpanSet *": +def textcat_textset_text_int( + s: Annotated[_ffi.CData, "const Set *"], txt: str, invert: bool +) -> Annotated[_ffi.CData, "Set *"]: s_converted = _ffi.cast("const Set *", s) - result = _lib.set_spanset(s_converted) + txt_converted = cstring2text(txt) + result = _lib.textcat_textset_text_int(s_converted, txt_converted, invert) _check_error() return result if result != _ffi.NULL else None -def span_spanset(s: "const Span *") -> "SpanSet *": - s_converted = _ffi.cast("const Span *", s) - result = _lib.span_spanset(s_converted) +def tstzspan_set_datespan( + s1: Annotated[_ffi.CData, "const Span *"], s2: Annotated[_ffi.CData, "Span *"] +) -> Annotated[None, "void"]: + s1_converted = _ffi.cast("const Span *", s1) + s2_converted = _ffi.cast("Span *", s2) + _lib.tstzspan_set_datespan(s1_converted, s2_converted) _check_error() - return result if result != _ffi.NULL else None -def tstzset_dateset(s: "const Set *") -> "Set *": - s_converted = _ffi.cast("const Set *", s) - result = _lib.tstzset_dateset(s_converted) +def adjacent_span_value( + s: Annotated[_ffi.CData, "const Span *"], value: Annotated[_ffi.CData, "Datum"] +) -> Annotated[bool, "bool"]: + s_converted = _ffi.cast("const Span *", s) + value_converted = _ffi.cast("Datum", value) + result = _lib.adjacent_span_value(s_converted, value_converted) _check_error() return result if result != _ffi.NULL else None -def tstzspan_datespan(s: "const Span *") -> "Span *": - s_converted = _ffi.cast("const Span *", s) - result = _lib.tstzspan_datespan(s_converted) +def adjacent_spanset_value( + ss: Annotated[_ffi.CData, "const SpanSet *"], value: Annotated[_ffi.CData, "Datum"] +) -> Annotated[bool, "bool"]: + ss_converted = _ffi.cast("const SpanSet *", ss) + value_converted = _ffi.cast("Datum", value) + result = _lib.adjacent_spanset_value(ss_converted, value_converted) _check_error() return result if result != _ffi.NULL else None -def tstzspanset_datespanset(ss: "const SpanSet *") -> "SpanSet *": +def adjacent_value_spanset( + value: Annotated[_ffi.CData, "Datum"], ss: Annotated[_ffi.CData, "const SpanSet *"] +) -> Annotated[bool, "bool"]: + value_converted = _ffi.cast("Datum", value) ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.tstzspanset_datespanset(ss_converted) + result = _lib.adjacent_value_spanset(value_converted, ss_converted) _check_error() return result if result != _ffi.NULL else None -def value_set_span(value: "Datum", basetype: "meosType", s: "Span *") -> None: +def contained_value_set( + value: Annotated[_ffi.CData, "Datum"], s: Annotated[_ffi.CData, "const Set *"] +) -> Annotated[bool, "bool"]: value_converted = _ffi.cast("Datum", value) - basetype_converted = _ffi.cast("meosType", basetype) - s_converted = _ffi.cast("Span *", s) - _lib.value_set_span(value_converted, basetype_converted, s_converted) + s_converted = _ffi.cast("const Set *", s) + result = _lib.contained_value_set(value_converted, s_converted) _check_error() + return result if result != _ffi.NULL else None -def value_to_set(d: "Datum", basetype: "meosType") -> "Set *": - d_converted = _ffi.cast("Datum", d) - basetype_converted = _ffi.cast("meosType", basetype) - result = _lib.value_to_set(d_converted, basetype_converted) +def contained_value_span( + value: Annotated[_ffi.CData, "Datum"], s: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[bool, "bool"]: + value_converted = _ffi.cast("Datum", value) + s_converted = _ffi.cast("const Span *", s) + result = _lib.contained_value_span(value_converted, s_converted) _check_error() return result if result != _ffi.NULL else None -def value_to_span(d: "Datum", basetype: "meosType") -> "Span *": - d_converted = _ffi.cast("Datum", d) - basetype_converted = _ffi.cast("meosType", basetype) - result = _lib.value_to_span(d_converted, basetype_converted) +def contained_value_spanset( + value: Annotated[_ffi.CData, "Datum"], ss: Annotated[_ffi.CData, "const SpanSet *"] +) -> Annotated[bool, "bool"]: + value_converted = _ffi.cast("Datum", value) + ss_converted = _ffi.cast("const SpanSet *", ss) + result = _lib.contained_value_spanset(value_converted, ss_converted) _check_error() return result if result != _ffi.NULL else None -def value_to_spanset(d: "Datum", basetype: "meosType") -> "SpanSet *": - d_converted = _ffi.cast("Datum", d) - basetype_converted = _ffi.cast("meosType", basetype) - result = _lib.value_to_spanset(d_converted, basetype_converted) +def contains_set_value( + s: Annotated[_ffi.CData, "const Set *"], value: Annotated[_ffi.CData, "Datum"] +) -> Annotated[bool, "bool"]: + s_converted = _ffi.cast("const Set *", s) + value_converted = _ffi.cast("Datum", value) + result = _lib.contains_set_value(s_converted, value_converted) _check_error() return result if result != _ffi.NULL else None -def numspan_width(s: "const Span *") -> "Datum": +def contains_span_value( + s: Annotated[_ffi.CData, "const Span *"], value: Annotated[_ffi.CData, "Datum"] +) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Span *", s) - result = _lib.numspan_width(s_converted) + value_converted = _ffi.cast("Datum", value) + result = _lib.contains_span_value(s_converted, value_converted) _check_error() return result if result != _ffi.NULL else None -def numspanset_width(ss: "const SpanSet *", boundspan: bool) -> "Datum": +def contains_spanset_value( + ss: Annotated[_ffi.CData, "const SpanSet *"], value: Annotated[_ffi.CData, "Datum"] +) -> Annotated[bool, "bool"]: ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.numspanset_width(ss_converted, boundspan) + value_converted = _ffi.cast("Datum", value) + result = _lib.contains_spanset_value(ss_converted, value_converted) _check_error() return result if result != _ffi.NULL else None -def set_end_value(s: "const Set *") -> "Datum": - s_converted = _ffi.cast("const Set *", s) - result = _lib.set_end_value(s_converted) +def ovadj_span_span( + s1: Annotated[_ffi.CData, "const Span *"], s2: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[bool, "bool"]: + s1_converted = _ffi.cast("const Span *", s1) + s2_converted = _ffi.cast("const Span *", s2) + result = _lib.ovadj_span_span(s1_converted, s2_converted) _check_error() return result if result != _ffi.NULL else None -def set_mem_size(s: "const Set *") -> "int": +def left_set_value( + s: Annotated[_ffi.CData, "const Set *"], value: Annotated[_ffi.CData, "Datum"] +) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Set *", s) - result = _lib.set_mem_size(s_converted) + value_converted = _ffi.cast("Datum", value) + result = _lib.left_set_value(s_converted, value_converted) _check_error() return result if result != _ffi.NULL else None -def set_set_subspan(s: "const Set *", minidx: int, maxidx: int) -> "Span *": - s_converted = _ffi.cast("const Set *", s) - out_result = _ffi.new("Span *") - _lib.set_set_subspan(s_converted, minidx, maxidx, out_result) - _check_error() - return out_result if out_result != _ffi.NULL else None - - -def set_set_span(s: "const Set *") -> "Span *": - s_converted = _ffi.cast("const Set *", s) - out_result = _ffi.new("Span *") - _lib.set_set_span(s_converted, out_result) +def left_span_value( + s: Annotated[_ffi.CData, "const Span *"], value: Annotated[_ffi.CData, "Datum"] +) -> Annotated[bool, "bool"]: + s_converted = _ffi.cast("const Span *", s) + value_converted = _ffi.cast("Datum", value) + result = _lib.left_span_value(s_converted, value_converted) _check_error() - return out_result if out_result != _ffi.NULL else None + return result if result != _ffi.NULL else None -def set_start_value(s: "const Set *") -> "Datum": - s_converted = _ffi.cast("const Set *", s) - result = _lib.set_start_value(s_converted) +def left_spanset_value( + ss: Annotated[_ffi.CData, "const SpanSet *"], value: Annotated[_ffi.CData, "Datum"] +) -> Annotated[bool, "bool"]: + ss_converted = _ffi.cast("const SpanSet *", ss) + value_converted = _ffi.cast("Datum", value) + result = _lib.left_spanset_value(ss_converted, value_converted) _check_error() return result if result != _ffi.NULL else None -def set_value_n(s: "const Set *", n: int) -> "Datum *": +def left_value_set( + value: Annotated[_ffi.CData, "Datum"], s: Annotated[_ffi.CData, "const Set *"] +) -> Annotated[bool, "bool"]: + value_converted = _ffi.cast("Datum", value) s_converted = _ffi.cast("const Set *", s) - out_result = _ffi.new("Datum *") - result = _lib.set_value_n(s_converted, n, out_result) + result = _lib.left_value_set(value_converted, s_converted) _check_error() - if result: - return out_result if out_result != _ffi.NULL else None - return None + return result if result != _ffi.NULL else None -def set_vals(s: "const Set *") -> "Datum *": - s_converted = _ffi.cast("const Set *", s) - result = _lib.set_vals(s_converted) +def left_value_span( + value: Annotated[_ffi.CData, "Datum"], s: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[bool, "bool"]: + value_converted = _ffi.cast("Datum", value) + s_converted = _ffi.cast("const Span *", s) + result = _lib.left_value_span(value_converted, s_converted) _check_error() return result if result != _ffi.NULL else None -def set_values(s: "const Set *") -> "Datum *": - s_converted = _ffi.cast("const Set *", s) - result = _lib.set_values(s_converted) +def left_value_spanset( + value: Annotated[_ffi.CData, "Datum"], ss: Annotated[_ffi.CData, "const SpanSet *"] +) -> Annotated[bool, "bool"]: + value_converted = _ffi.cast("Datum", value) + ss_converted = _ffi.cast("const SpanSet *", ss) + result = _lib.left_value_spanset(value_converted, ss_converted) _check_error() return result if result != _ffi.NULL else None -def spanset_lower(ss: "const SpanSet *") -> "Datum": - ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.spanset_lower(ss_converted) +def lfnadj_span_span( + s1: Annotated[_ffi.CData, "const Span *"], s2: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[bool, "bool"]: + s1_converted = _ffi.cast("const Span *", s1) + s2_converted = _ffi.cast("const Span *", s2) + result = _lib.lfnadj_span_span(s1_converted, s2_converted) _check_error() return result if result != _ffi.NULL else None -def spanset_mem_size(ss: "const SpanSet *") -> "int": - ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.spanset_mem_size(ss_converted) +def overleft_set_value( + s: Annotated[_ffi.CData, "const Set *"], value: Annotated[_ffi.CData, "Datum"] +) -> Annotated[bool, "bool"]: + s_converted = _ffi.cast("const Set *", s) + value_converted = _ffi.cast("Datum", value) + result = _lib.overleft_set_value(s_converted, value_converted) _check_error() return result if result != _ffi.NULL else None -def spanset_sps(ss: "const SpanSet *") -> "const Span **": - ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.spanset_sps(ss_converted) +def overleft_span_value( + s: Annotated[_ffi.CData, "const Span *"], value: Annotated[_ffi.CData, "Datum"] +) -> Annotated[bool, "bool"]: + s_converted = _ffi.cast("const Span *", s) + value_converted = _ffi.cast("Datum", value) + result = _lib.overleft_span_value(s_converted, value_converted) _check_error() return result if result != _ffi.NULL else None -def spanset_upper(ss: "const SpanSet *") -> "Datum": +def overleft_spanset_value( + ss: Annotated[_ffi.CData, "const SpanSet *"], value: Annotated[_ffi.CData, "Datum"] +) -> Annotated[bool, "bool"]: ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.spanset_upper(ss_converted) + value_converted = _ffi.cast("Datum", value) + result = _lib.overleft_spanset_value(ss_converted, value_converted) _check_error() return result if result != _ffi.NULL else None -def datespan_set_tstzspan(s1: "const Span *", s2: "Span *") -> None: - s1_converted = _ffi.cast("const Span *", s1) - s2_converted = _ffi.cast("Span *", s2) - _lib.datespan_set_tstzspan(s1_converted, s2_converted) +def overleft_value_set( + value: Annotated[_ffi.CData, "Datum"], s: Annotated[_ffi.CData, "const Set *"] +) -> Annotated[bool, "bool"]: + value_converted = _ffi.cast("Datum", value) + s_converted = _ffi.cast("const Set *", s) + result = _lib.overleft_value_set(value_converted, s_converted) _check_error() + return result if result != _ffi.NULL else None -def floatset_deg(s: "const Set *", normalize: bool) -> "Set *": - s_converted = _ffi.cast("const Set *", s) - result = _lib.floatset_deg(s_converted, normalize) +def overleft_value_span( + value: Annotated[_ffi.CData, "Datum"], s: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[bool, "bool"]: + value_converted = _ffi.cast("Datum", value) + s_converted = _ffi.cast("const Span *", s) + result = _lib.overleft_value_span(value_converted, s_converted) _check_error() return result if result != _ffi.NULL else None -def floatset_rad(s: "const Set *") -> "Set *": - s_converted = _ffi.cast("const Set *", s) - result = _lib.floatset_rad(s_converted) +def overleft_value_spanset( + value: Annotated[_ffi.CData, "Datum"], ss: Annotated[_ffi.CData, "const SpanSet *"] +) -> Annotated[bool, "bool"]: + value_converted = _ffi.cast("Datum", value) + ss_converted = _ffi.cast("const SpanSet *", ss) + result = _lib.overleft_value_spanset(value_converted, ss_converted) _check_error() return result if result != _ffi.NULL else None -def floatset_rnd(s: "const Set *", size: int) -> "Set *": +def overright_set_value( + s: Annotated[_ffi.CData, "const Set *"], value: Annotated[_ffi.CData, "Datum"] +) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Set *", s) - result = _lib.floatset_rnd(s_converted, size) + value_converted = _ffi.cast("Datum", value) + result = _lib.overright_set_value(s_converted, value_converted) _check_error() return result if result != _ffi.NULL else None -def floatspan_rnd(s: "const Span *", size: int) -> "Span *": +def overright_span_value( + s: Annotated[_ffi.CData, "const Span *"], value: Annotated[_ffi.CData, "Datum"] +) -> Annotated[bool, "bool"]: s_converted = _ffi.cast("const Span *", s) - result = _lib.floatspan_rnd(s_converted, size) + value_converted = _ffi.cast("Datum", value) + result = _lib.overright_span_value(s_converted, value_converted) _check_error() return result if result != _ffi.NULL else None -def floatspanset_rnd(ss: "const SpanSet *", size: int) -> "SpanSet *": +def overright_spanset_value( + ss: Annotated[_ffi.CData, "const SpanSet *"], value: Annotated[_ffi.CData, "Datum"] +) -> Annotated[bool, "bool"]: ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.floatspanset_rnd(ss_converted, size) + value_converted = _ffi.cast("Datum", value) + result = _lib.overright_spanset_value(ss_converted, value_converted) _check_error() return result if result != _ffi.NULL else None -def floatspan_set_intspan(s1: "const Span *", s2: "Span *") -> None: - s1_converted = _ffi.cast("const Span *", s1) - s2_converted = _ffi.cast("Span *", s2) - _lib.floatspan_set_intspan(s1_converted, s2_converted) - _check_error() - - -def intspan_set_floatspan(s1: "const Span *", s2: "Span *") -> None: - s1_converted = _ffi.cast("const Span *", s1) - s2_converted = _ffi.cast("Span *", s2) - _lib.intspan_set_floatspan(s1_converted, s2_converted) - _check_error() - - -def numset_shift_scale( - s: "const Set *", shift: "Datum", width: "Datum", hasshift: bool, haswidth: bool -) -> "Set *": +def overright_value_set( + value: Annotated[_ffi.CData, "Datum"], s: Annotated[_ffi.CData, "const Set *"] +) -> Annotated[bool, "bool"]: + value_converted = _ffi.cast("Datum", value) s_converted = _ffi.cast("const Set *", s) - shift_converted = _ffi.cast("Datum", shift) - width_converted = _ffi.cast("Datum", width) - result = _lib.numset_shift_scale( - s_converted, shift_converted, width_converted, hasshift, haswidth - ) + result = _lib.overright_value_set(value_converted, s_converted) _check_error() return result if result != _ffi.NULL else None -def numspan_shift_scale( - s: "const Span *", shift: "Datum", width: "Datum", hasshift: bool, haswidth: bool -) -> "Span *": +def overright_value_span( + value: Annotated[_ffi.CData, "Datum"], s: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[bool, "bool"]: + value_converted = _ffi.cast("Datum", value) s_converted = _ffi.cast("const Span *", s) - shift_converted = _ffi.cast("Datum", shift) - width_converted = _ffi.cast("Datum", width) - result = _lib.numspan_shift_scale( - s_converted, shift_converted, width_converted, hasshift, haswidth - ) + result = _lib.overright_value_span(value_converted, s_converted) _check_error() return result if result != _ffi.NULL else None -def numspanset_shift_scale( - ss: "const SpanSet *", - shift: "Datum", - width: "Datum", - hasshift: bool, - haswidth: bool, -) -> "SpanSet *": +def overright_value_spanset( + value: Annotated[_ffi.CData, "Datum"], ss: Annotated[_ffi.CData, "const SpanSet *"] +) -> Annotated[bool, "bool"]: + value_converted = _ffi.cast("Datum", value) ss_converted = _ffi.cast("const SpanSet *", ss) - shift_converted = _ffi.cast("Datum", shift) - width_converted = _ffi.cast("Datum", width) - result = _lib.numspanset_shift_scale( - ss_converted, shift_converted, width_converted, hasshift, haswidth - ) + result = _lib.overright_value_spanset(value_converted, ss_converted) _check_error() return result if result != _ffi.NULL else None -def set_compact(s: "const Set *") -> "Set *": +def right_value_set( + value: Annotated[_ffi.CData, "Datum"], s: Annotated[_ffi.CData, "const Set *"] +) -> Annotated[bool, "bool"]: + value_converted = _ffi.cast("Datum", value) s_converted = _ffi.cast("const Set *", s) - result = _lib.set_compact(s_converted) + result = _lib.right_value_set(value_converted, s_converted) _check_error() return result if result != _ffi.NULL else None -def span_expand(s1: "const Span *", s2: "Span *") -> None: - s1_converted = _ffi.cast("const Span *", s1) - s2_converted = _ffi.cast("Span *", s2) - _lib.span_expand(s1_converted, s2_converted) +def right_set_value( + s: Annotated[_ffi.CData, "const Set *"], value: Annotated[_ffi.CData, "Datum"] +) -> Annotated[bool, "bool"]: + s_converted = _ffi.cast("const Set *", s) + value_converted = _ffi.cast("Datum", value) + result = _lib.right_set_value(s_converted, value_converted) _check_error() + return result if result != _ffi.NULL else None -def spanset_compact(ss: "const SpanSet *") -> "SpanSet *": - ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.spanset_compact(ss_converted) +def right_value_span( + value: Annotated[_ffi.CData, "Datum"], s: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[bool, "bool"]: + value_converted = _ffi.cast("Datum", value) + s_converted = _ffi.cast("const Span *", s) + result = _lib.right_value_span(value_converted, s_converted) _check_error() return result if result != _ffi.NULL else None -def textcat_textset_text_int(s: "const Set *", txt: str, invert: bool) -> "Set *": - s_converted = _ffi.cast("const Set *", s) - txt_converted = cstring2text(txt) - result = _lib.textcat_textset_text_int(s_converted, txt_converted, invert) +def right_value_spanset( + value: Annotated[_ffi.CData, "Datum"], ss: Annotated[_ffi.CData, "const SpanSet *"] +) -> Annotated[bool, "bool"]: + value_converted = _ffi.cast("Datum", value) + ss_converted = _ffi.cast("const SpanSet *", ss) + result = _lib.right_value_spanset(value_converted, ss_converted) _check_error() return result if result != _ffi.NULL else None -def tstzspan_set_datespan(s1: "const Span *", s2: "Span *") -> None: - s1_converted = _ffi.cast("const Span *", s1) - s2_converted = _ffi.cast("Span *", s2) - _lib.tstzspan_set_datespan(s1_converted, s2_converted) +def right_span_value( + s: Annotated[_ffi.CData, "const Span *"], value: Annotated[_ffi.CData, "Datum"] +) -> Annotated[bool, "bool"]: + s_converted = _ffi.cast("const Span *", s) + value_converted = _ffi.cast("Datum", value) + result = _lib.right_span_value(s_converted, value_converted) _check_error() + return result if result != _ffi.NULL else None -def set_cmp_int(s1: "const Set *", s2: "const Set *") -> "int": - s1_converted = _ffi.cast("const Set *", s1) - s2_converted = _ffi.cast("const Set *", s2) - result = _lib.set_cmp_int(s1_converted, s2_converted) +def right_spanset_value( + ss: Annotated[_ffi.CData, "const SpanSet *"], value: Annotated[_ffi.CData, "Datum"] +) -> Annotated[bool, "bool"]: + ss_converted = _ffi.cast("const SpanSet *", ss) + value_converted = _ffi.cast("Datum", value) + result = _lib.right_spanset_value(ss_converted, value_converted) _check_error() return result if result != _ffi.NULL else None -def span_cmp_int(s1: "const Span *", s2: "const Span *") -> "int": +def bbox_union_span_span( + s1: Annotated[_ffi.CData, "const Span *"], s2: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[_ffi.CData, "Span *"]: s1_converted = _ffi.cast("const Span *", s1) s2_converted = _ffi.cast("const Span *", s2) - result = _lib.span_cmp_int(s1_converted, s2_converted) + out_result = _ffi.new("Span *") + _lib.bbox_union_span_span(s1_converted, s2_converted, out_result) _check_error() - return result if result != _ffi.NULL else None + return out_result if out_result != _ffi.NULL else None -def span_eq_int(s1: "const Span *", s2: "const Span *") -> "bool": +def inter_span_span( + s1: Annotated[_ffi.CData, "const Span *"], s2: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[_ffi.CData, "Span *"]: s1_converted = _ffi.cast("const Span *", s1) s2_converted = _ffi.cast("const Span *", s2) - result = _lib.span_eq_int(s1_converted, s2_converted) + out_result = _ffi.new("Span *") + result = _lib.inter_span_span(s1_converted, s2_converted, out_result) _check_error() - return result if result != _ffi.NULL else None + if result: + return out_result if out_result != _ffi.NULL else None + return None -def spanset_cmp_int(ss1: "const SpanSet *", ss2: "const SpanSet *") -> "int": - ss1_converted = _ffi.cast("const SpanSet *", ss1) - ss2_converted = _ffi.cast("const SpanSet *", ss2) - result = _lib.spanset_cmp_int(ss1_converted, ss2_converted) +def intersection_set_value( + s: Annotated[_ffi.CData, "const Set *"], value: Annotated[_ffi.CData, "Datum"] +) -> Annotated[_ffi.CData, "Set *"]: + s_converted = _ffi.cast("const Set *", s) + value_converted = _ffi.cast("Datum", value) + result = _lib.intersection_set_value(s_converted, value_converted) _check_error() return result if result != _ffi.NULL else None -def spanset_eq_int(ss1: "const SpanSet *", ss2: "const SpanSet *") -> "bool": - ss1_converted = _ffi.cast("const SpanSet *", ss1) - ss2_converted = _ffi.cast("const SpanSet *", ss2) - result = _lib.spanset_eq_int(ss1_converted, ss2_converted) +def intersection_span_value( + s: Annotated[_ffi.CData, "const Span *"], value: Annotated[_ffi.CData, "Datum"] +) -> Annotated[_ffi.CData, "Span *"]: + s_converted = _ffi.cast("const Span *", s) + value_converted = _ffi.cast("Datum", value) + result = _lib.intersection_span_value(s_converted, value_converted) _check_error() return result if result != _ffi.NULL else None -def adj_span_span(s1: "const Span *", s2: "const Span *") -> "bool": - s1_converted = _ffi.cast("const Span *", s1) - s2_converted = _ffi.cast("const Span *", s2) - result = _lib.adj_span_span(s1_converted, s2_converted) +def intersection_spanset_value( + ss: Annotated[_ffi.CData, "const SpanSet *"], value: Annotated[_ffi.CData, "Datum"] +) -> Annotated[_ffi.CData, "SpanSet *"]: + ss_converted = _ffi.cast("const SpanSet *", ss) + value_converted = _ffi.cast("Datum", value) + result = _lib.intersection_spanset_value(ss_converted, value_converted) _check_error() return result if result != _ffi.NULL else None -def adjacent_span_value(s: "const Span *", value: "Datum") -> "bool": - s_converted = _ffi.cast("const Span *", s) +def intersection_value_set( + value: Annotated[_ffi.CData, "Datum"], s: Annotated[_ffi.CData, "const Set *"] +) -> Annotated[_ffi.CData, "Set *"]: value_converted = _ffi.cast("Datum", value) - result = _lib.adjacent_span_value(s_converted, value_converted) + s_converted = _ffi.cast("const Set *", s) + result = _lib.intersection_value_set(value_converted, s_converted) _check_error() return result if result != _ffi.NULL else None -def adjacent_spanset_value(ss: "const SpanSet *", value: "Datum") -> "bool": - ss_converted = _ffi.cast("const SpanSet *", ss) +def intersection_value_span( + value: Annotated[_ffi.CData, "Datum"], s: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[_ffi.CData, "Span *"]: value_converted = _ffi.cast("Datum", value) - result = _lib.adjacent_spanset_value(ss_converted, value_converted) + s_converted = _ffi.cast("const Span *", s) + result = _lib.intersection_value_span(value_converted, s_converted) _check_error() return result if result != _ffi.NULL else None -def adjacent_value_spanset(value: "Datum", ss: "const SpanSet *") -> "bool": +def intersection_value_spanset( + value: Annotated[_ffi.CData, "Datum"], ss: Annotated[_ffi.CData, "const SpanSet *"] +) -> Annotated[_ffi.CData, "SpanSet *"]: value_converted = _ffi.cast("Datum", value) ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.adjacent_value_spanset(value_converted, ss_converted) + result = _lib.intersection_value_spanset(value_converted, ss_converted) _check_error() return result if result != _ffi.NULL else None -def cont_span_span(s1: "const Span *", s2: "const Span *") -> "bool": +def mi_span_span( + s1: Annotated[_ffi.CData, "const Span *"], s2: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[_ffi.CData, "Span *"]: s1_converted = _ffi.cast("const Span *", s1) s2_converted = _ffi.cast("const Span *", s2) - result = _lib.cont_span_span(s1_converted, s2_converted) + out_result = _ffi.new("Span *") + result = _lib.mi_span_span(s1_converted, s2_converted, out_result) _check_error() - return result if result != _ffi.NULL else None + return out_result, result if out_result != _ffi.NULL else None -def contained_value_set(value: "Datum", s: "const Set *") -> "bool": - value_converted = _ffi.cast("Datum", value) +def minus_set_value( + s: Annotated[_ffi.CData, "const Set *"], value: Annotated[_ffi.CData, "Datum"] +) -> Annotated[_ffi.CData, "Set *"]: s_converted = _ffi.cast("const Set *", s) - result = _lib.contained_value_set(value_converted, s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def contained_value_span(value: "Datum", s: "const Span *") -> "bool": value_converted = _ffi.cast("Datum", value) - s_converted = _ffi.cast("const Span *", s) - result = _lib.contained_value_span(value_converted, s_converted) + result = _lib.minus_set_value(s_converted, value_converted) _check_error() return result if result != _ffi.NULL else None -def contained_value_spanset(value: "Datum", ss: "const SpanSet *") -> "bool": +def minus_span_value( + s: Annotated[_ffi.CData, "const Span *"], value: Annotated[_ffi.CData, "Datum"] +) -> Annotated[_ffi.CData, "SpanSet *"]: + s_converted = _ffi.cast("const Span *", s) value_converted = _ffi.cast("Datum", value) - ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.contained_value_spanset(value_converted, ss_converted) + result = _lib.minus_span_value(s_converted, value_converted) _check_error() return result if result != _ffi.NULL else None -def contains_set_value(s: "const Set *", value: "Datum") -> "bool": - s_converted = _ffi.cast("const Set *", s) +def minus_spanset_value( + ss: Annotated[_ffi.CData, "const SpanSet *"], value: Annotated[_ffi.CData, "Datum"] +) -> Annotated[_ffi.CData, "SpanSet *"]: + ss_converted = _ffi.cast("const SpanSet *", ss) value_converted = _ffi.cast("Datum", value) - result = _lib.contains_set_value(s_converted, value_converted) + result = _lib.minus_spanset_value(ss_converted, value_converted) _check_error() return result if result != _ffi.NULL else None -def contains_span_value(s: "const Span *", value: "Datum") -> "bool": - s_converted = _ffi.cast("const Span *", s) +def minus_value_set( + value: Annotated[_ffi.CData, "Datum"], s: Annotated[_ffi.CData, "const Set *"] +) -> Annotated[_ffi.CData, "Set *"]: value_converted = _ffi.cast("Datum", value) - result = _lib.contains_span_value(s_converted, value_converted) + s_converted = _ffi.cast("const Set *", s) + result = _lib.minus_value_set(value_converted, s_converted) _check_error() return result if result != _ffi.NULL else None -def contains_spanset_value(ss: "const SpanSet *", value: "Datum") -> "bool": - ss_converted = _ffi.cast("const SpanSet *", ss) +def minus_value_span( + value: Annotated[_ffi.CData, "Datum"], s: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[_ffi.CData, "SpanSet *"]: value_converted = _ffi.cast("Datum", value) - result = _lib.contains_spanset_value(ss_converted, value_converted) + s_converted = _ffi.cast("const Span *", s) + result = _lib.minus_value_span(value_converted, s_converted) _check_error() return result if result != _ffi.NULL else None -def ovadj_span_span(s1: "const Span *", s2: "const Span *") -> "bool": - s1_converted = _ffi.cast("const Span *", s1) - s2_converted = _ffi.cast("const Span *", s2) - result = _lib.ovadj_span_span(s1_converted, s2_converted) +def minus_value_spanset( + value: Annotated[_ffi.CData, "Datum"], ss: Annotated[_ffi.CData, "const SpanSet *"] +) -> Annotated[_ffi.CData, "SpanSet *"]: + value_converted = _ffi.cast("Datum", value) + ss_converted = _ffi.cast("const SpanSet *", ss) + result = _lib.minus_value_spanset(value_converted, ss_converted) _check_error() return result if result != _ffi.NULL else None -def over_span_span(s1: "const Span *", s2: "const Span *") -> "bool": +def super_union_span_span( + s1: Annotated[_ffi.CData, "const Span *"], s2: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[_ffi.CData, "Span *"]: s1_converted = _ffi.cast("const Span *", s1) s2_converted = _ffi.cast("const Span *", s2) - result = _lib.over_span_span(s1_converted, s2_converted) + result = _lib.super_union_span_span(s1_converted, s2_converted) _check_error() return result if result != _ffi.NULL else None -def left_set_value(s: "const Set *", value: "Datum") -> "bool": +def union_set_value( + s: Annotated[_ffi.CData, "const Set *"], value: Annotated[_ffi.CData, "Datum"] +) -> Annotated[_ffi.CData, "Set *"]: s_converted = _ffi.cast("const Set *", s) value_converted = _ffi.cast("Datum", value) - result = _lib.left_set_value(s_converted, value_converted) + result = _lib.union_set_value(s_converted, value_converted) _check_error() return result if result != _ffi.NULL else None -def left_span_value(s: "const Span *", value: "Datum") -> "bool": +def union_span_value( + s: Annotated[_ffi.CData, "const Span *"], value: Annotated[_ffi.CData, "Datum"] +) -> Annotated[_ffi.CData, "SpanSet *"]: s_converted = _ffi.cast("const Span *", s) value_converted = _ffi.cast("Datum", value) - result = _lib.left_span_value(s_converted, value_converted) + result = _lib.union_span_value(s_converted, value_converted) _check_error() return result if result != _ffi.NULL else None -def left_spanset_value(ss: "const SpanSet *", value: "Datum") -> "bool": +def union_spanset_value( + ss: Annotated[_ffi.CData, "const SpanSet *"], value: Annotated[_ffi.CData, "Datum"] +) -> Annotated[_ffi.CData, "SpanSet *"]: ss_converted = _ffi.cast("const SpanSet *", ss) value_converted = _ffi.cast("Datum", value) - result = _lib.left_spanset_value(ss_converted, value_converted) + result = _lib.union_spanset_value(ss_converted, value_converted) _check_error() return result if result != _ffi.NULL else None -def left_value_set(value: "Datum", s: "const Set *") -> "bool": +def union_value_set( + value: Annotated[_ffi.CData, "Datum"], s: Annotated[_ffi.CData, "const Set *"] +) -> Annotated[_ffi.CData, "Set *"]: value_converted = _ffi.cast("Datum", value) s_converted = _ffi.cast("const Set *", s) - result = _lib.left_value_set(value_converted, s_converted) + result = _lib.union_value_set(value_converted, s_converted) _check_error() return result if result != _ffi.NULL else None -def left_value_span(value: "Datum", s: "const Span *") -> "bool": +def union_value_span( + value: Annotated[_ffi.CData, "Datum"], s: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[_ffi.CData, "SpanSet *"]: value_converted = _ffi.cast("Datum", value) s_converted = _ffi.cast("const Span *", s) - result = _lib.left_value_span(value_converted, s_converted) + result = _lib.union_value_span(value_converted, s_converted) _check_error() return result if result != _ffi.NULL else None -def left_value_spanset(value: "Datum", ss: "const SpanSet *") -> "bool": +def union_value_spanset( + value: Annotated[_ffi.CData, "Datum"], ss: Annotated[_ffi.CData, "const SpanSet *"] +) -> Annotated[_ffi.CData, "SpanSet *"]: value_converted = _ffi.cast("Datum", value) ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.left_value_spanset(value_converted, ss_converted) + result = _lib.union_value_spanset(value_converted, ss_converted) _check_error() return result if result != _ffi.NULL else None -def lf_span_span(s1: "const Span *", s2: "const Span *") -> "bool": - s1_converted = _ffi.cast("const Span *", s1) - s2_converted = _ffi.cast("const Span *", s2) - result = _lib.lf_span_span(s1_converted, s2_converted) +def distance_set_set( + s1: Annotated[_ffi.CData, "const Set *"], s2: Annotated[_ffi.CData, "const Set *"] +) -> Annotated[_ffi.CData, "Datum"]: + s1_converted = _ffi.cast("const Set *", s1) + s2_converted = _ffi.cast("const Set *", s2) + result = _lib.distance_set_set(s1_converted, s2_converted) _check_error() return result if result != _ffi.NULL else None -def lfnadj_span_span(s1: "const Span *", s2: "const Span *") -> "bool": - s1_converted = _ffi.cast("const Span *", s1) - s2_converted = _ffi.cast("const Span *", s2) - result = _lib.lfnadj_span_span(s1_converted, s2_converted) +def distance_set_value( + s: Annotated[_ffi.CData, "const Set *"], value: Annotated[_ffi.CData, "Datum"] +) -> Annotated[_ffi.CData, "Datum"]: + s_converted = _ffi.cast("const Set *", s) + value_converted = _ffi.cast("Datum", value) + result = _lib.distance_set_value(s_converted, value_converted) _check_error() return result if result != _ffi.NULL else None -def overleft_set_value(s: "const Set *", value: "Datum") -> "bool": - s_converted = _ffi.cast("const Set *", s) - value_converted = _ffi.cast("Datum", value) - result = _lib.overleft_set_value(s_converted, value_converted) +def distance_span_span( + s1: Annotated[_ffi.CData, "const Span *"], s2: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[_ffi.CData, "Datum"]: + s1_converted = _ffi.cast("const Span *", s1) + s2_converted = _ffi.cast("const Span *", s2) + result = _lib.distance_span_span(s1_converted, s2_converted) _check_error() return result if result != _ffi.NULL else None -def overleft_span_value(s: "const Span *", value: "Datum") -> "bool": +def distance_span_value( + s: Annotated[_ffi.CData, "const Span *"], value: Annotated[_ffi.CData, "Datum"] +) -> Annotated[_ffi.CData, "Datum"]: s_converted = _ffi.cast("const Span *", s) value_converted = _ffi.cast("Datum", value) - result = _lib.overleft_span_value(s_converted, value_converted) + result = _lib.distance_span_value(s_converted, value_converted) _check_error() return result if result != _ffi.NULL else None -def overleft_spanset_value(ss: "const SpanSet *", value: "Datum") -> "bool": +def distance_spanset_span( + ss: Annotated[_ffi.CData, "const SpanSet *"], s: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[_ffi.CData, "Datum"]: ss_converted = _ffi.cast("const SpanSet *", ss) - value_converted = _ffi.cast("Datum", value) - result = _lib.overleft_spanset_value(ss_converted, value_converted) + s_converted = _ffi.cast("const Span *", s) + result = _lib.distance_spanset_span(ss_converted, s_converted) _check_error() return result if result != _ffi.NULL else None -def overleft_value_set(value: "Datum", s: "const Set *") -> "bool": - value_converted = _ffi.cast("Datum", value) - s_converted = _ffi.cast("const Set *", s) - result = _lib.overleft_value_set(value_converted, s_converted) +def distance_spanset_spanset( + ss1: Annotated[_ffi.CData, "const SpanSet *"], ss2: Annotated[_ffi.CData, "const SpanSet *"] +) -> Annotated[_ffi.CData, "Datum"]: + ss1_converted = _ffi.cast("const SpanSet *", ss1) + ss2_converted = _ffi.cast("const SpanSet *", ss2) + result = _lib.distance_spanset_spanset(ss1_converted, ss2_converted) _check_error() return result if result != _ffi.NULL else None -def overleft_value_span(value: "Datum", s: "const Span *") -> "bool": +def distance_spanset_value( + ss: Annotated[_ffi.CData, "const SpanSet *"], value: Annotated[_ffi.CData, "Datum"] +) -> Annotated[_ffi.CData, "Datum"]: + ss_converted = _ffi.cast("const SpanSet *", ss) value_converted = _ffi.cast("Datum", value) - s_converted = _ffi.cast("const Span *", s) - result = _lib.overleft_value_span(value_converted, s_converted) + result = _lib.distance_spanset_value(ss_converted, value_converted) _check_error() return result if result != _ffi.NULL else None -def overleft_value_spanset(value: "Datum", ss: "const SpanSet *") -> "bool": - value_converted = _ffi.cast("Datum", value) - ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.overleft_value_spanset(value_converted, ss_converted) +def distance_value_value( + l: Annotated[_ffi.CData, "Datum"], r: Annotated[_ffi.CData, "Datum"], basetype: Annotated[_ffi.CData, "meosType"] +) -> Annotated[_ffi.CData, "Datum"]: + l_converted = _ffi.cast("Datum", l) + r_converted = _ffi.cast("Datum", r) + basetype_converted = _ffi.cast("meosType", basetype) + result = _lib.distance_value_value(l_converted, r_converted, basetype_converted) _check_error() return result if result != _ffi.NULL else None -def overright_set_value(s: "const Set *", value: "Datum") -> "bool": - s_converted = _ffi.cast("const Set *", s) +def spanbase_extent_transfn( + state: Annotated[_ffi.CData, "Span *"], + value: Annotated[_ffi.CData, "Datum"], + basetype: Annotated[_ffi.CData, "meosType"], +) -> Annotated[_ffi.CData, "Span *"]: + state_converted = _ffi.cast("Span *", state) value_converted = _ffi.cast("Datum", value) - result = _lib.overright_set_value(s_converted, value_converted) + basetype_converted = _ffi.cast("meosType", basetype) + result = _lib.spanbase_extent_transfn(state_converted, value_converted, basetype_converted) _check_error() return result if result != _ffi.NULL else None -def overright_span_value(s: "const Span *", value: "Datum") -> "bool": - s_converted = _ffi.cast("const Span *", s) +def value_union_transfn( + state: Annotated[_ffi.CData, "Set *"], + value: Annotated[_ffi.CData, "Datum"], + basetype: Annotated[_ffi.CData, "meosType"], +) -> Annotated[_ffi.CData, "Set *"]: + state_converted = _ffi.cast("Set *", state) value_converted = _ffi.cast("Datum", value) - result = _lib.overright_span_value(s_converted, value_converted) + basetype_converted = _ffi.cast("meosType", basetype) + result = _lib.value_union_transfn(state_converted, value_converted, basetype_converted) _check_error() return result if result != _ffi.NULL else None -def overright_spanset_value(ss: "const SpanSet *", value: "Datum") -> "bool": - ss_converted = _ffi.cast("const SpanSet *", ss) - value_converted = _ffi.cast("Datum", value) - result = _lib.overright_spanset_value(ss_converted, value_converted) +def number_tstzspan_to_tbox( + d: Annotated[_ffi.CData, "Datum"], + basetype: Annotated[_ffi.CData, "meosType"], + s: Annotated[_ffi.CData, "const Span *"], +) -> Annotated[_ffi.CData, "TBox *"]: + d_converted = _ffi.cast("Datum", d) + basetype_converted = _ffi.cast("meosType", basetype) + s_converted = _ffi.cast("const Span *", s) + result = _lib.number_tstzspan_to_tbox(d_converted, basetype_converted, s_converted) _check_error() return result if result != _ffi.NULL else None -def overright_value_set(value: "Datum", s: "const Set *") -> "bool": - value_converted = _ffi.cast("Datum", value) - s_converted = _ffi.cast("const Set *", s) - result = _lib.overright_value_set(value_converted, s_converted) +def number_timestamptz_to_tbox( + d: Annotated[_ffi.CData, "Datum"], basetype: Annotated[_ffi.CData, "meosType"], t: int +) -> Annotated[_ffi.CData, "TBox *"]: + d_converted = _ffi.cast("Datum", d) + basetype_converted = _ffi.cast("meosType", basetype) + t_converted = _ffi.cast("TimestampTz", t) + result = _lib.number_timestamptz_to_tbox(d_converted, basetype_converted, t_converted) _check_error() return result if result != _ffi.NULL else None -def overright_value_span(value: "Datum", s: "const Span *") -> "bool": - value_converted = _ffi.cast("Datum", value) +def tbox_set( + s: Annotated[_ffi.CData, "const Span *"], + p: Annotated[_ffi.CData, "const Span *"], + box: Annotated[_ffi.CData, "TBox *"], +) -> Annotated[None, "void"]: s_converted = _ffi.cast("const Span *", s) - result = _lib.overright_value_span(value_converted, s_converted) + p_converted = _ffi.cast("const Span *", p) + box_converted = _ffi.cast("TBox *", box) + _lib.tbox_set(s_converted, p_converted, box_converted) _check_error() - return result if result != _ffi.NULL else None -def overright_value_spanset(value: "Datum", ss: "const SpanSet *") -> "bool": - value_converted = _ffi.cast("Datum", value) - ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.overright_value_spanset(value_converted, ss_converted) +def float_set_tbox(d: float, box: Annotated[_ffi.CData, "TBox *"]) -> Annotated[None, "void"]: + box_converted = _ffi.cast("TBox *", box) + _lib.float_set_tbox(d, box_converted) _check_error() - return result if result != _ffi.NULL else None -def ovlf_span_span(s1: "const Span *", s2: "const Span *") -> "bool": - s1_converted = _ffi.cast("const Span *", s1) - s2_converted = _ffi.cast("const Span *", s2) - result = _lib.ovlf_span_span(s1_converted, s2_converted) +def int_set_tbox(i: int, box: Annotated[_ffi.CData, "TBox *"]) -> Annotated[None, "void"]: + box_converted = _ffi.cast("TBox *", box) + _lib.int_set_tbox(i, box_converted) _check_error() - return result if result != _ffi.NULL else None -def ovri_span_span(s1: "const Span *", s2: "const Span *") -> "bool": - s1_converted = _ffi.cast("const Span *", s1) - s2_converted = _ffi.cast("const Span *", s2) - result = _lib.ovri_span_span(s1_converted, s2_converted) +def number_set_tbox( + d: Annotated[_ffi.CData, "Datum"], basetype: Annotated[_ffi.CData, "meosType"], box: Annotated[_ffi.CData, "TBox *"] +) -> Annotated[None, "void"]: + d_converted = _ffi.cast("Datum", d) + basetype_converted = _ffi.cast("meosType", basetype) + box_converted = _ffi.cast("TBox *", box) + _lib.number_set_tbox(d_converted, basetype_converted, box_converted) _check_error() - return result if result != _ffi.NULL else None -def ri_span_span(s1: "const Span *", s2: "const Span *") -> "bool": - s1_converted = _ffi.cast("const Span *", s1) - s2_converted = _ffi.cast("const Span *", s2) - result = _lib.ri_span_span(s1_converted, s2_converted) +def number_tbox( + value: Annotated[_ffi.CData, "Datum"], basetype: Annotated[_ffi.CData, "meosType"] +) -> Annotated[_ffi.CData, "TBox *"]: + value_converted = _ffi.cast("Datum", value) + basetype_converted = _ffi.cast("meosType", basetype) + result = _lib.number_tbox(value_converted, basetype_converted) _check_error() return result if result != _ffi.NULL else None -def right_value_set(value: "Datum", s: "const Set *") -> "bool": - value_converted = _ffi.cast("Datum", value) +def numset_set_tbox( + s: Annotated[_ffi.CData, "const Set *"], box: Annotated[_ffi.CData, "TBox *"] +) -> Annotated[None, "void"]: s_converted = _ffi.cast("const Set *", s) - result = _lib.right_value_set(value_converted, s_converted) + box_converted = _ffi.cast("TBox *", box) + _lib.numset_set_tbox(s_converted, box_converted) _check_error() - return result if result != _ffi.NULL else None -def right_set_value(s: "const Set *", value: "Datum") -> "bool": - s_converted = _ffi.cast("const Set *", s) - value_converted = _ffi.cast("Datum", value) - result = _lib.right_set_value(s_converted, value_converted) +def numspan_set_tbox( + span: Annotated[_ffi.CData, "const Span *"], box: Annotated[_ffi.CData, "TBox *"] +) -> Annotated[None, "void"]: + span_converted = _ffi.cast("const Span *", span) + box_converted = _ffi.cast("TBox *", box) + _lib.numspan_set_tbox(span_converted, box_converted) _check_error() - return result if result != _ffi.NULL else None -def right_value_span(value: "Datum", s: "const Span *") -> "bool": - value_converted = _ffi.cast("Datum", value) - s_converted = _ffi.cast("const Span *", s) - result = _lib.right_value_span(value_converted, s_converted) +def timestamptz_set_tbox(t: int, box: Annotated[_ffi.CData, "TBox *"]) -> Annotated[None, "void"]: + t_converted = _ffi.cast("TimestampTz", t) + box_converted = _ffi.cast("TBox *", box) + _lib.timestamptz_set_tbox(t_converted, box_converted) _check_error() - return result if result != _ffi.NULL else None -def right_value_spanset(value: "Datum", ss: "const SpanSet *") -> "bool": - value_converted = _ffi.cast("Datum", value) - ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.right_value_spanset(value_converted, ss_converted) +def tstzset_set_tbox( + s: Annotated[_ffi.CData, "const Set *"], box: Annotated[_ffi.CData, "TBox *"] +) -> Annotated[None, "void"]: + s_converted = _ffi.cast("const Set *", s) + box_converted = _ffi.cast("TBox *", box) + _lib.tstzset_set_tbox(s_converted, box_converted) _check_error() - return result if result != _ffi.NULL else None -def right_span_value(s: "const Span *", value: "Datum") -> "bool": +def tstzspan_set_tbox( + s: Annotated[_ffi.CData, "const Span *"], box: Annotated[_ffi.CData, "TBox *"] +) -> Annotated[None, "void"]: s_converted = _ffi.cast("const Span *", s) - value_converted = _ffi.cast("Datum", value) - result = _lib.right_span_value(s_converted, value_converted) + box_converted = _ffi.cast("TBox *", box) + _lib.tstzspan_set_tbox(s_converted, box_converted) _check_error() - return result if result != _ffi.NULL else None -def right_spanset_value(ss: "const SpanSet *", value: "Datum") -> "bool": - ss_converted = _ffi.cast("const SpanSet *", ss) - value_converted = _ffi.cast("Datum", value) - result = _lib.right_spanset_value(ss_converted, value_converted) +def tbox_shift_scale_value( + box: Annotated[_ffi.CData, "const TBox *"], + shift: Annotated[_ffi.CData, "Datum"], + width: Annotated[_ffi.CData, "Datum"], + hasshift: bool, + haswidth: bool, +) -> Annotated[_ffi.CData, "TBox *"]: + box_converted = _ffi.cast("const TBox *", box) + shift_converted = _ffi.cast("Datum", shift) + width_converted = _ffi.cast("Datum", width) + result = _lib.tbox_shift_scale_value(box_converted, shift_converted, width_converted, hasshift, haswidth) _check_error() return result if result != _ffi.NULL else None -def bbox_union_span_span(s1: "const Span *", s2: "const Span *") -> "Span *": - s1_converted = _ffi.cast("const Span *", s1) - s2_converted = _ffi.cast("const Span *", s2) - out_result = _ffi.new("Span *") - _lib.bbox_union_span_span(s1_converted, s2_converted, out_result) +def tbox_expand( + box1: Annotated[_ffi.CData, "const TBox *"], box2: Annotated[_ffi.CData, "TBox *"] +) -> Annotated[None, "void"]: + box1_converted = _ffi.cast("const TBox *", box1) + box2_converted = _ffi.cast("TBox *", box2) + _lib.tbox_expand(box1_converted, box2_converted) _check_error() - return out_result if out_result != _ffi.NULL else None -def inter_span_span(s1: "const Span *", s2: "const Span *") -> "Span *": - s1_converted = _ffi.cast("const Span *", s1) - s2_converted = _ffi.cast("const Span *", s2) - out_result = _ffi.new("Span *") - result = _lib.inter_span_span(s1_converted, s2_converted, out_result) +def inter_tbox_tbox( + box1: Annotated[_ffi.CData, "const TBox *"], box2: Annotated[_ffi.CData, "const TBox *"] +) -> Annotated[_ffi.CData, "TBox *"]: + box1_converted = _ffi.cast("const TBox *", box1) + box2_converted = _ffi.cast("const TBox *", box2) + out_result = _ffi.new("TBox *") + result = _lib.inter_tbox_tbox(box1_converted, box2_converted, out_result) _check_error() if result: return out_result if out_result != _ffi.NULL else None return None -def intersection_set_value(s: "const Set *", value: "Datum") -> "Set *": - s_converted = _ffi.cast("const Set *", s) - value_converted = _ffi.cast("Datum", value) - result = _lib.intersection_set_value(s_converted, value_converted) +def tboolinst_in(string: str) -> Annotated[_ffi.CData, "TInstant *"]: + string_converted = string.encode("utf-8") + result = _lib.tboolinst_in(string_converted) _check_error() return result if result != _ffi.NULL else None -def intersection_span_value(s: "const Span *", value: "Datum") -> "Span *": - s_converted = _ffi.cast("const Span *", s) - value_converted = _ffi.cast("Datum", value) - result = _lib.intersection_span_value(s_converted, value_converted) +def tboolseq_in(string: str, interp: InterpolationType) -> Annotated[_ffi.CData, "TSequence *"]: + string_converted = string.encode("utf-8") + result = _lib.tboolseq_in(string_converted, interp) _check_error() return result if result != _ffi.NULL else None -def intersection_spanset_value(ss: "const SpanSet *", value: "Datum") -> "SpanSet *": - ss_converted = _ffi.cast("const SpanSet *", ss) - value_converted = _ffi.cast("Datum", value) - result = _lib.intersection_spanset_value(ss_converted, value_converted) +def tboolseqset_in(string: str) -> Annotated[_ffi.CData, "TSequenceSet *"]: + string_converted = string.encode("utf-8") + result = _lib.tboolseqset_in(string_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def temporal_in(string: str, temptype: Annotated[_ffi.CData, "meosType"]) -> Annotated[_ffi.CData, "Temporal *"]: + string_converted = string.encode("utf-8") + temptype_converted = _ffi.cast("meosType", temptype) + result = _lib.temporal_in(string_converted, temptype_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def temporal_out(temp: Annotated[_ffi.CData, "const Temporal *"], maxdd: int) -> Annotated[str, "char *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.temporal_out(temp_converted, maxdd) + _check_error() + result = _ffi.string(result).decode("utf-8") + return result if result != _ffi.NULL else None + + +def temparr_out( + temparr: Annotated[list, "const Temporal **"], count: int, maxdd: int +) -> Annotated[_ffi.CData, "char **"]: + temparr_converted = [_ffi.cast("const Temporal *", x) for x in temparr] + result = _lib.temparr_out(temparr_converted, count, maxdd) _check_error() return result if result != _ffi.NULL else None -def intersection_value_set(value: "Datum", s: "const Set *") -> "Set *": - value_converted = _ffi.cast("Datum", value) - s_converted = _ffi.cast("const Set *", s) - result = _lib.intersection_value_set(value_converted, s_converted) +def tfloatinst_in(string: str) -> Annotated[_ffi.CData, "TInstant *"]: + string_converted = string.encode("utf-8") + result = _lib.tfloatinst_in(string_converted) _check_error() return result if result != _ffi.NULL else None -def intersection_value_span(value: "Datum", s: "const Span *") -> "Span *": - value_converted = _ffi.cast("Datum", value) - s_converted = _ffi.cast("const Span *", s) - result = _lib.intersection_value_span(value_converted, s_converted) +def tfloatseq_in(string: str, interp: InterpolationType) -> Annotated[_ffi.CData, "TSequence *"]: + string_converted = string.encode("utf-8") + result = _lib.tfloatseq_in(string_converted, interp) _check_error() return result if result != _ffi.NULL else None -def intersection_value_spanset(value: "Datum", ss: "const SpanSet *") -> "SpanSet *": - value_converted = _ffi.cast("Datum", value) - ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.intersection_value_spanset(value_converted, ss_converted) +def tfloatseqset_in(string: str) -> Annotated[_ffi.CData, "TSequenceSet *"]: + string_converted = string.encode("utf-8") + result = _lib.tfloatseqset_in(string_converted) _check_error() return result if result != _ffi.NULL else None -def mi_span_span(s1: "const Span *", s2: "const Span *") -> "Span *": - s1_converted = _ffi.cast("const Span *", s1) - s2_converted = _ffi.cast("const Span *", s2) - out_result = _ffi.new("Span *") - result = _lib.mi_span_span(s1_converted, s2_converted, out_result) +def tinstant_in(string: str, temptype: Annotated[_ffi.CData, "meosType"]) -> Annotated[_ffi.CData, "TInstant *"]: + string_converted = string.encode("utf-8") + temptype_converted = _ffi.cast("meosType", temptype) + result = _lib.tinstant_in(string_converted, temptype_converted) _check_error() - return out_result if out_result != _ffi.NULL else None + return result if result != _ffi.NULL else None -def minus_set_value(s: "const Set *", value: "Datum") -> "Set *": - s_converted = _ffi.cast("const Set *", s) - value_converted = _ffi.cast("Datum", value) - result = _lib.minus_set_value(s_converted, value_converted) +def tinstant_out(inst: Annotated[_ffi.CData, "const TInstant *"], maxdd: int) -> Annotated[str, "char *"]: + inst_converted = _ffi.cast("const TInstant *", inst) + result = _lib.tinstant_out(inst_converted, maxdd) _check_error() + result = _ffi.string(result).decode("utf-8") return result if result != _ffi.NULL else None -def minus_span_value(s: "const Span *", value: "Datum") -> "SpanSet *": - s_converted = _ffi.cast("const Span *", s) - value_converted = _ffi.cast("Datum", value) - result = _lib.minus_span_value(s_converted, value_converted) +def tintinst_in(string: str) -> Annotated[_ffi.CData, "TInstant *"]: + string_converted = string.encode("utf-8") + result = _lib.tintinst_in(string_converted) _check_error() return result if result != _ffi.NULL else None -def minus_spanset_value(ss: "const SpanSet *", value: "Datum") -> "SpanSet *": - ss_converted = _ffi.cast("const SpanSet *", ss) - value_converted = _ffi.cast("Datum", value) - result = _lib.minus_spanset_value(ss_converted, value_converted) +def tintseq_in(string: str, interp: InterpolationType) -> Annotated[_ffi.CData, "TSequence *"]: + string_converted = string.encode("utf-8") + result = _lib.tintseq_in(string_converted, interp) _check_error() return result if result != _ffi.NULL else None -def minus_value_set(value: "Datum", s: "const Set *") -> "Set *": - value_converted = _ffi.cast("Datum", value) - s_converted = _ffi.cast("const Set *", s) - result = _lib.minus_value_set(value_converted, s_converted) +def tintseqset_in(string: str) -> Annotated[_ffi.CData, "TSequenceSet *"]: + string_converted = string.encode("utf-8") + result = _lib.tintseqset_in(string_converted) _check_error() return result if result != _ffi.NULL else None -def minus_value_span(value: "Datum", s: "const Span *") -> "SpanSet *": - value_converted = _ffi.cast("Datum", value) - s_converted = _ffi.cast("const Span *", s) - result = _lib.minus_value_span(value_converted, s_converted) +def tsequence_in( + string: str, temptype: Annotated[_ffi.CData, "meosType"], interp: InterpolationType +) -> Annotated[_ffi.CData, "TSequence *"]: + string_converted = string.encode("utf-8") + temptype_converted = _ffi.cast("meosType", temptype) + result = _lib.tsequence_in(string_converted, temptype_converted, interp) _check_error() return result if result != _ffi.NULL else None -def minus_value_spanset(value: "Datum", ss: "const SpanSet *") -> "SpanSet *": - value_converted = _ffi.cast("Datum", value) - ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.minus_value_spanset(value_converted, ss_converted) +def tsequence_out(seq: Annotated[_ffi.CData, "const TSequence *"], maxdd: int) -> Annotated[str, "char *"]: + seq_converted = _ffi.cast("const TSequence *", seq) + result = _lib.tsequence_out(seq_converted, maxdd) _check_error() + result = _ffi.string(result).decode("utf-8") return result if result != _ffi.NULL else None -def super_union_span_span(s1: "const Span *", s2: "const Span *") -> "Span *": - s1_converted = _ffi.cast("const Span *", s1) - s2_converted = _ffi.cast("const Span *", s2) - result = _lib.super_union_span_span(s1_converted, s2_converted) +def tsequenceset_in( + string: str, temptype: Annotated[_ffi.CData, "meosType"], interp: InterpolationType +) -> Annotated[_ffi.CData, "TSequenceSet *"]: + string_converted = string.encode("utf-8") + temptype_converted = _ffi.cast("meosType", temptype) + result = _lib.tsequenceset_in(string_converted, temptype_converted, interp) _check_error() return result if result != _ffi.NULL else None -def union_set_value(s: "const Set *", value: "const Datum") -> "Set *": - s_converted = _ffi.cast("const Set *", s) - value_converted = _ffi.cast("const Datum", value) - result = _lib.union_set_value(s_converted, value_converted) +def tsequenceset_out(ss: Annotated[_ffi.CData, "const TSequenceSet *"], maxdd: int) -> Annotated[str, "char *"]: + ss_converted = _ffi.cast("const TSequenceSet *", ss) + result = _lib.tsequenceset_out(ss_converted, maxdd) _check_error() + result = _ffi.string(result).decode("utf-8") return result if result != _ffi.NULL else None -def union_span_value(s: "const Span *", value: "Datum") -> "SpanSet *": - s_converted = _ffi.cast("const Span *", s) - value_converted = _ffi.cast("Datum", value) - result = _lib.union_span_value(s_converted, value_converted) +def ttextinst_in(string: str) -> Annotated[_ffi.CData, "TInstant *"]: + string_converted = string.encode("utf-8") + result = _lib.ttextinst_in(string_converted) _check_error() return result if result != _ffi.NULL else None -def union_spanset_value(ss: "const SpanSet *", value: "Datum") -> "SpanSet *": - ss_converted = _ffi.cast("const SpanSet *", ss) - value_converted = _ffi.cast("Datum", value) - result = _lib.union_spanset_value(ss_converted, value_converted) +def ttextseq_in(string: str, interp: InterpolationType) -> Annotated[_ffi.CData, "TSequence *"]: + string_converted = string.encode("utf-8") + result = _lib.ttextseq_in(string_converted, interp) _check_error() return result if result != _ffi.NULL else None -def union_value_set(value: "const Datum", s: "const Set *") -> "Set *": - value_converted = _ffi.cast("const Datum", value) - s_converted = _ffi.cast("const Set *", s) - result = _lib.union_value_set(value_converted, s_converted) +def ttextseqset_in(string: str) -> Annotated[_ffi.CData, "TSequenceSet *"]: + string_converted = string.encode("utf-8") + result = _lib.ttextseqset_in(string_converted) _check_error() return result if result != _ffi.NULL else None -def union_value_span(value: "Datum", s: "const Span *") -> "SpanSet *": - value_converted = _ffi.cast("Datum", value) - s_converted = _ffi.cast("const Span *", s) - result = _lib.union_value_span(value_converted, s_converted) +def temporal_from_mfjson( + mfjson: str, temptype: Annotated[_ffi.CData, "meosType"] +) -> Annotated[_ffi.CData, "Temporal *"]: + mfjson_converted = mfjson.encode("utf-8") + temptype_converted = _ffi.cast("meosType", temptype) + result = _lib.temporal_from_mfjson(mfjson_converted, temptype_converted) _check_error() return result if result != _ffi.NULL else None -def union_value_spanset(value: "Datum", ss: "const SpanSet *") -> "SpanSet *": +def temporal_from_base_temp( + value: Annotated[_ffi.CData, "Datum"], + temptype: Annotated[_ffi.CData, "meosType"], + temp: Annotated[_ffi.CData, "const Temporal *"], +) -> Annotated[_ffi.CData, "Temporal *"]: value_converted = _ffi.cast("Datum", value) - ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.union_value_spanset(value_converted, ss_converted) + temptype_converted = _ffi.cast("meosType", temptype) + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.temporal_from_base_temp(value_converted, temptype_converted, temp_converted) _check_error() return result if result != _ffi.NULL else None -def dist_set_set(s1: "const Set *", s2: "const Set *") -> "Datum": - s1_converted = _ffi.cast("const Set *", s1) - s2_converted = _ffi.cast("const Set *", s2) - result = _lib.dist_set_set(s1_converted, s2_converted) +def tinstant_copy(inst: Annotated[_ffi.CData, "const TInstant *"]) -> Annotated[_ffi.CData, "TInstant *"]: + inst_converted = _ffi.cast("const TInstant *", inst) + result = _lib.tinstant_copy(inst_converted) _check_error() return result if result != _ffi.NULL else None -def dist_span_span(s1: "const Span *", s2: "const Span *") -> "Datum": - s1_converted = _ffi.cast("const Span *", s1) - s2_converted = _ffi.cast("const Span *", s2) - result = _lib.dist_span_span(s1_converted, s2_converted) +def tinstant_make( + value: Annotated[_ffi.CData, "Datum"], temptype: Annotated[_ffi.CData, "meosType"], t: int +) -> Annotated[_ffi.CData, "TInstant *"]: + value_converted = _ffi.cast("Datum", value) + temptype_converted = _ffi.cast("meosType", temptype) + t_converted = _ffi.cast("TimestampTz", t) + result = _lib.tinstant_make(value_converted, temptype_converted, t_converted) _check_error() return result if result != _ffi.NULL else None -def distance_set_set(s1: "const Set *", s2: "const Set *") -> "Datum": - s1_converted = _ffi.cast("const Set *", s1) - s2_converted = _ffi.cast("const Set *", s2) - result = _lib.distance_set_set(s1_converted, s2_converted) +def tinstant_make_free( + value: Annotated[_ffi.CData, "Datum"], temptype: Annotated[_ffi.CData, "meosType"], t: int +) -> Annotated[_ffi.CData, "TInstant *"]: + value_converted = _ffi.cast("Datum", value) + temptype_converted = _ffi.cast("meosType", temptype) + t_converted = _ffi.cast("TimestampTz", t) + result = _lib.tinstant_make_free(value_converted, temptype_converted, t_converted) _check_error() return result if result != _ffi.NULL else None -def distance_set_value(s: "const Set *", value: "Datum") -> "Datum": - s_converted = _ffi.cast("const Set *", s) - value_converted = _ffi.cast("Datum", value) - result = _lib.distance_set_value(s_converted, value_converted) +def tsequence_copy(seq: Annotated[_ffi.CData, "const TSequence *"]) -> Annotated[_ffi.CData, "TSequence *"]: + seq_converted = _ffi.cast("const TSequence *", seq) + result = _lib.tsequence_copy(seq_converted) _check_error() return result if result != _ffi.NULL else None -def distance_span_span(s1: "const Span *", s2: "const Span *") -> "Datum": - s1_converted = _ffi.cast("const Span *", s1) - s2_converted = _ffi.cast("const Span *", s2) - result = _lib.distance_span_span(s1_converted, s2_converted) +def tsequence_from_base_temp( + value: Annotated[_ffi.CData, "Datum"], + temptype: Annotated[_ffi.CData, "meosType"], + seq: Annotated[_ffi.CData, "const TSequence *"], +) -> Annotated[_ffi.CData, "TSequence *"]: + value_converted = _ffi.cast("Datum", value) + temptype_converted = _ffi.cast("meosType", temptype) + seq_converted = _ffi.cast("const TSequence *", seq) + result = _lib.tsequence_from_base_temp(value_converted, temptype_converted, seq_converted) _check_error() return result if result != _ffi.NULL else None -def distance_span_value(s: "const Span *", value: "Datum") -> "Datum": - s_converted = _ffi.cast("const Span *", s) +def tsequence_from_base_tstzset( + value: Annotated[_ffi.CData, "Datum"], + temptype: Annotated[_ffi.CData, "meosType"], + s: Annotated[_ffi.CData, "const Set *"], +) -> Annotated[_ffi.CData, "TSequence *"]: value_converted = _ffi.cast("Datum", value) - result = _lib.distance_span_value(s_converted, value_converted) + temptype_converted = _ffi.cast("meosType", temptype) + s_converted = _ffi.cast("const Set *", s) + result = _lib.tsequence_from_base_tstzset(value_converted, temptype_converted, s_converted) _check_error() return result if result != _ffi.NULL else None -def distance_spanset_span(ss: "const SpanSet *", s: "const Span *") -> "Datum": - ss_converted = _ffi.cast("const SpanSet *", ss) +def tsequence_from_base_tstzspan( + value: Annotated[_ffi.CData, "Datum"], + temptype: Annotated[_ffi.CData, "meosType"], + s: Annotated[_ffi.CData, "const Span *"], + interp: InterpolationType, +) -> Annotated[_ffi.CData, "TSequence *"]: + value_converted = _ffi.cast("Datum", value) + temptype_converted = _ffi.cast("meosType", temptype) s_converted = _ffi.cast("const Span *", s) - result = _lib.distance_spanset_span(ss_converted, s_converted) + result = _lib.tsequence_from_base_tstzspan(value_converted, temptype_converted, s_converted, interp) _check_error() return result if result != _ffi.NULL else None -def distance_spanset_spanset(ss1: "const SpanSet *", ss2: "const SpanSet *") -> "Datum": - ss1_converted = _ffi.cast("const SpanSet *", ss1) - ss2_converted = _ffi.cast("const SpanSet *", ss2) - result = _lib.distance_spanset_spanset(ss1_converted, ss2_converted) +def tsequence_make_exp( + instants: Annotated[list, "const TInstant **"], + count: int, + maxcount: int, + lower_inc: bool, + upper_inc: bool, + interp: InterpolationType, + normalize: bool, +) -> Annotated[_ffi.CData, "TSequence *"]: + instants_converted = [_ffi.cast("const TInstant *", x) for x in instants] + result = _lib.tsequence_make_exp(instants_converted, count, maxcount, lower_inc, upper_inc, interp, normalize) _check_error() return result if result != _ffi.NULL else None -def distance_spanset_value(ss: "const SpanSet *", value: "Datum") -> "Datum": - ss_converted = _ffi.cast("const SpanSet *", ss) - value_converted = _ffi.cast("Datum", value) - result = _lib.distance_spanset_value(ss_converted, value_converted) +def tsequence_make_free( + instants: Annotated[list, "TInstant **"], + count: int, + lower_inc: bool, + upper_inc: bool, + interp: InterpolationType, + normalize: bool, +) -> Annotated[_ffi.CData, "TSequence *"]: + instants_converted = [_ffi.cast("TInstant *", x) for x in instants] + result = _lib.tsequence_make_free(instants_converted, count, lower_inc, upper_inc, interp, normalize) _check_error() return result if result != _ffi.NULL else None -def distance_value_value(l: "Datum", r: "Datum", basetype: "meosType") -> "Datum": - l_converted = _ffi.cast("Datum", l) - r_converted = _ffi.cast("Datum", r) - basetype_converted = _ffi.cast("meosType", basetype) - result = _lib.distance_value_value(l_converted, r_converted, basetype_converted) +def tsequenceset_copy(ss: Annotated[_ffi.CData, "const TSequenceSet *"]) -> Annotated[_ffi.CData, "TSequenceSet *"]: + ss_converted = _ffi.cast("const TSequenceSet *", ss) + result = _lib.tsequenceset_copy(ss_converted) _check_error() return result if result != _ffi.NULL else None -def spanbase_extent_transfn( - state: "Span *", value: "Datum", basetype: "meosType" -) -> "Span *": - state_converted = _ffi.cast("Span *", state) - value_converted = _ffi.cast("Datum", value) - basetype_converted = _ffi.cast("meosType", basetype) - result = _lib.spanbase_extent_transfn( - state_converted, value_converted, basetype_converted - ) +def tseqsetarr_to_tseqset( + seqsets: Annotated[list, "TSequenceSet **"], count: int, totalseqs: int +) -> Annotated[_ffi.CData, "TSequenceSet *"]: + seqsets_converted = [_ffi.cast("TSequenceSet *", x) for x in seqsets] + result = _lib.tseqsetarr_to_tseqset(seqsets_converted, count, totalseqs) _check_error() return result if result != _ffi.NULL else None -def value_union_transfn( - state: "Set *", value: "Datum", basetype: "meosType" -) -> "Set *": - state_converted = _ffi.cast("Set *", state) +def tsequenceset_from_base_temp( + value: Annotated[_ffi.CData, "Datum"], + temptype: Annotated[_ffi.CData, "meosType"], + ss: Annotated[_ffi.CData, "const TSequenceSet *"], +) -> Annotated[_ffi.CData, "TSequenceSet *"]: value_converted = _ffi.cast("Datum", value) - basetype_converted = _ffi.cast("meosType", basetype) - result = _lib.value_union_transfn( - state_converted, value_converted, basetype_converted - ) + temptype_converted = _ffi.cast("meosType", temptype) + ss_converted = _ffi.cast("const TSequenceSet *", ss) + result = _lib.tsequenceset_from_base_temp(value_converted, temptype_converted, ss_converted) _check_error() return result if result != _ffi.NULL else None -def number_tstzspan_to_tbox( - d: "Datum", basetype: "meosType", s: "const Span *" -) -> "TBox *": - d_converted = _ffi.cast("Datum", d) - basetype_converted = _ffi.cast("meosType", basetype) - s_converted = _ffi.cast("const Span *", s) - result = _lib.number_tstzspan_to_tbox(d_converted, basetype_converted, s_converted) +def tsequenceset_from_base_tstzspanset( + value: Annotated[_ffi.CData, "Datum"], + temptype: Annotated[_ffi.CData, "meosType"], + ss: Annotated[_ffi.CData, "const SpanSet *"], + interp: InterpolationType, +) -> Annotated[_ffi.CData, "TSequenceSet *"]: + value_converted = _ffi.cast("Datum", value) + temptype_converted = _ffi.cast("meosType", temptype) + ss_converted = _ffi.cast("const SpanSet *", ss) + result = _lib.tsequenceset_from_base_tstzspanset(value_converted, temptype_converted, ss_converted, interp) _check_error() return result if result != _ffi.NULL else None -def number_timestamptz_to_tbox(d: "Datum", basetype: "meosType", t: int) -> "TBox *": - d_converted = _ffi.cast("Datum", d) - basetype_converted = _ffi.cast("meosType", basetype) - t_converted = _ffi.cast("TimestampTz", t) - result = _lib.number_timestamptz_to_tbox( - d_converted, basetype_converted, t_converted - ) +def tsequenceset_make_exp( + sequences: Annotated[list, "const TSequence **"], count: int, maxcount: int, normalize: bool +) -> Annotated[_ffi.CData, "TSequenceSet *"]: + sequences_converted = [_ffi.cast("const TSequence *", x) for x in sequences] + result = _lib.tsequenceset_make_exp(sequences_converted, count, maxcount, normalize) _check_error() return result if result != _ffi.NULL else None -def stbox_cp(box: "const STBox *") -> "STBox *": - box_converted = _ffi.cast("const STBox *", box) - result = _lib.stbox_cp(box_converted) +def tsequenceset_make_free( + sequences: Annotated[list, "TSequence **"], count: int, normalize: bool +) -> Annotated[_ffi.CData, "TSequenceSet *"]: + sequences_converted = [_ffi.cast("TSequence *", x) for x in sequences] + result = _lib.tsequenceset_make_free(sequences_converted, count, normalize) _check_error() return result if result != _ffi.NULL else None -def stbox_set( - hasx: bool, - hasz: bool, - geodetic: bool, - srid: int, - xmin: float, - xmax: float, - ymin: float, - ymax: float, - zmin: float, - zmax: float, - s: "const Span *", - box: "STBox *", -) -> None: - srid_converted = _ffi.cast("int32", srid) - s_converted = _ffi.cast("const Span *", s) - box_converted = _ffi.cast("STBox *", box) - _lib.stbox_set( - hasx, - hasz, - geodetic, - srid_converted, - xmin, - xmax, - ymin, - ymax, - zmin, - zmax, - s_converted, - box_converted, - ) +def temporal_set_tstzspan( + temp: Annotated[_ffi.CData, "const Temporal *"], s: Annotated[_ffi.CData, "Span *"] +) -> Annotated[None, "void"]: + temp_converted = _ffi.cast("const Temporal *", temp) + s_converted = _ffi.cast("Span *", s) + _lib.temporal_set_tstzspan(temp_converted, s_converted) _check_error() -def tbox_cp(box: "const TBox *") -> "TBox *": - box_converted = _ffi.cast("const TBox *", box) - result = _lib.tbox_cp(box_converted) +def tinstant_set_tstzspan( + inst: Annotated[_ffi.CData, "const TInstant *"], s: Annotated[_ffi.CData, "Span *"] +) -> Annotated[None, "void"]: + inst_converted = _ffi.cast("const TInstant *", inst) + s_converted = _ffi.cast("Span *", s) + _lib.tinstant_set_tstzspan(inst_converted, s_converted) _check_error() - return result if result != _ffi.NULL else None -def tbox_set(s: "const Span *", p: "const Span *", box: "TBox *") -> None: - s_converted = _ffi.cast("const Span *", s) - p_converted = _ffi.cast("const Span *", p) +def tnumber_set_tbox( + temp: Annotated[_ffi.CData, "const Temporal *"], box: Annotated[_ffi.CData, "TBox *"] +) -> Annotated[None, "void"]: + temp_converted = _ffi.cast("const Temporal *", temp) box_converted = _ffi.cast("TBox *", box) - _lib.tbox_set(s_converted, p_converted, box_converted) + _lib.tnumber_set_tbox(temp_converted, box_converted) _check_error() -def box3d_to_stbox(box: "const BOX3D *") -> "STBox *": - box_converted = _ffi.cast("const BOX3D *", box) - result = _lib.box3d_to_stbox(box_converted) +def tnumberinst_set_tbox( + inst: Annotated[_ffi.CData, "const TInstant *"], box: Annotated[_ffi.CData, "TBox *"] +) -> Annotated[None, "void"]: + inst_converted = _ffi.cast("const TInstant *", inst) + box_converted = _ffi.cast("TBox *", box) + _lib.tnumberinst_set_tbox(inst_converted, box_converted) _check_error() - return result if result != _ffi.NULL else None -def gbox_to_stbox(box: "const GBOX *") -> "STBox *": - box_converted = _ffi.cast("const GBOX *", box) - result = _lib.gbox_to_stbox(box_converted) +def tnumberseq_set_tbox( + seq: Annotated[_ffi.CData, "const TSequence *"], box: Annotated[_ffi.CData, "TBox *"] +) -> Annotated[None, "void"]: + seq_converted = _ffi.cast("const TSequence *", seq) + box_converted = _ffi.cast("TBox *", box) + _lib.tnumberseq_set_tbox(seq_converted, box_converted) _check_error() - return result if result != _ffi.NULL else None -def float_set_tbox(d: float, box: "TBox *") -> None: +def tnumberseqset_set_tbox( + ss: Annotated[_ffi.CData, "const TSequenceSet *"], box: Annotated[_ffi.CData, "TBox *"] +) -> Annotated[None, "void"]: + ss_converted = _ffi.cast("const TSequenceSet *", ss) box_converted = _ffi.cast("TBox *", box) - _lib.float_set_tbox(d, box_converted) + _lib.tnumberseqset_set_tbox(ss_converted, box_converted) _check_error() -def gbox_set_stbox(box: "const GBOX *", srid: int) -> "STBox *": - box_converted = _ffi.cast("const GBOX *", box) - out_result = _ffi.new("STBox *") - _lib.gbox_set_stbox(box_converted, srid, out_result) +def tsequence_set_tstzspan( + seq: Annotated[_ffi.CData, "const TSequence *"], s: Annotated[_ffi.CData, "Span *"] +) -> Annotated[None, "void"]: + seq_converted = _ffi.cast("const TSequence *", seq) + s_converted = _ffi.cast("Span *", s) + _lib.tsequence_set_tstzspan(seq_converted, s_converted) _check_error() - return out_result if out_result != _ffi.NULL else None -def geo_set_stbox(gs: "const GSERIALIZED *", box: "STBox *") -> "bool": - gs_converted = _ffi.cast("const GSERIALIZED *", gs) - box_converted = _ffi.cast("STBox *", box) - result = _lib.geo_set_stbox(gs_converted, box_converted) +def tsequenceset_set_tstzspan( + ss: Annotated[_ffi.CData, "const TSequenceSet *"], s: Annotated[_ffi.CData, "Span *"] +) -> Annotated[None, "void"]: + ss_converted = _ffi.cast("const TSequenceSet *", ss) + s_converted = _ffi.cast("Span *", s) + _lib.tsequenceset_set_tstzspan(ss_converted, s_converted) _check_error() - return result if result != _ffi.NULL else None -def geoarr_set_stbox(values: "const Datum *", count: int, box: "STBox *") -> None: - values_converted = _ffi.cast("const Datum *", values) - box_converted = _ffi.cast("STBox *", box) - _lib.geoarr_set_stbox(values_converted, count, box_converted) +def temporal_end_inst(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "const TInstant *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.temporal_end_inst(temp_converted) _check_error() + return result if result != _ffi.NULL else None -def int_set_tbox(i: int, box: "TBox *") -> None: - box_converted = _ffi.cast("TBox *", box) - _lib.int_set_tbox(i, box_converted) +def temporal_end_value(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "Datum"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.temporal_end_value(temp_converted) _check_error() + return result if result != _ffi.NULL else None -def number_set_tbox(d: "Datum", basetype: "meosType", box: "TBox *") -> None: - d_converted = _ffi.cast("Datum", d) - basetype_converted = _ffi.cast("meosType", basetype) - box_converted = _ffi.cast("TBox *", box) - _lib.number_set_tbox(d_converted, basetype_converted, box_converted) +def temporal_inst_n( + temp: Annotated[_ffi.CData, "const Temporal *"], n: int +) -> Annotated[_ffi.CData, "const TInstant *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.temporal_inst_n(temp_converted, n) _check_error() + return result if result != _ffi.NULL else None -def number_to_tbox(value: "Datum", basetype: "meosType") -> "TBox *": - value_converted = _ffi.cast("Datum", value) - basetype_converted = _ffi.cast("meosType", basetype) - result = _lib.number_to_tbox(value_converted, basetype_converted) +def temporal_instants_p( + temp: Annotated[_ffi.CData, "const Temporal *"], count: Annotated[_ffi.CData, "int *"] +) -> Annotated[_ffi.CData, "const TInstant **"]: + temp_converted = _ffi.cast("const Temporal *", temp) + count_converted = _ffi.cast("int *", count) + result = _lib.temporal_instants_p(temp_converted, count_converted) _check_error() return result if result != _ffi.NULL else None -def numset_set_tbox(s: "const Set *", box: "TBox *") -> None: - s_converted = _ffi.cast("const Set *", s) - box_converted = _ffi.cast("TBox *", box) - _lib.numset_set_tbox(s_converted, box_converted) +def temporal_max_value(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "Datum"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.temporal_max_value(temp_converted) _check_error() + return result if result != _ffi.NULL else None -def numspan_set_tbox(span: "const Span *", box: "TBox *") -> None: - span_converted = _ffi.cast("const Span *", span) - box_converted = _ffi.cast("TBox *", box) - _lib.numspan_set_tbox(span_converted, box_converted) +def temporal_mem_size(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "size_t"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.temporal_mem_size(temp_converted) _check_error() + return result if result != _ffi.NULL else None -def numspanset_set_tbox(ss: "const SpanSet *", box: "TBox *") -> None: - ss_converted = _ffi.cast("const SpanSet *", ss) - box_converted = _ffi.cast("TBox *", box) - _lib.numspanset_set_tbox(ss_converted, box_converted) +def temporal_min_value(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "Datum"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.temporal_min_value(temp_converted) _check_error() + return result if result != _ffi.NULL else None -def spatialset_set_stbox(set: "const Set *", box: "STBox *") -> None: - set_converted = _ffi.cast("const Set *", set) - box_converted = _ffi.cast("STBox *", box) - _lib.spatialset_set_stbox(set_converted, box_converted) +def temporal_sequences_p( + temp: Annotated[_ffi.CData, "const Temporal *"], count: Annotated[_ffi.CData, "int *"] +) -> Annotated[_ffi.CData, "const TSequence **"]: + temp_converted = _ffi.cast("const Temporal *", temp) + count_converted = _ffi.cast("int *", count) + result = _lib.temporal_sequences_p(temp_converted, count_converted) _check_error() + return result if result != _ffi.NULL else None -def stbox_set_box3d(box: "const STBox *", box3d: "BOX3D *") -> None: - box_converted = _ffi.cast("const STBox *", box) - box3d_converted = _ffi.cast("BOX3D *", box3d) - _lib.stbox_set_box3d(box_converted, box3d_converted) +def temporal_set_bbox( + temp: Annotated[_ffi.CData, "const Temporal *"], box: Annotated[_ffi.CData, "void *"] +) -> Annotated[None, "void"]: + temp_converted = _ffi.cast("const Temporal *", temp) + box_converted = _ffi.cast("void *", box) + _lib.temporal_set_bbox(temp_converted, box_converted) _check_error() -def stbox_set_gbox(box: "const STBox *", gbox: "GBOX *") -> None: - box_converted = _ffi.cast("const STBox *", box) - gbox_converted = _ffi.cast("GBOX *", gbox) - _lib.stbox_set_gbox(box_converted, gbox_converted) +def temporal_start_inst(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "const TInstant *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.temporal_start_inst(temp_converted) _check_error() + return result if result != _ffi.NULL else None -def timestamptz_set_stbox(t: int, box: "STBox *") -> None: - t_converted = _ffi.cast("TimestampTz", t) - box_converted = _ffi.cast("STBox *", box) - _lib.timestamptz_set_stbox(t_converted, box_converted) +def temporal_start_value(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "Datum"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.temporal_start_value(temp_converted) _check_error() + return result if result != _ffi.NULL else None -def timestamptz_set_tbox(t: int, box: "TBox *") -> None: - t_converted = _ffi.cast("TimestampTz", t) - box_converted = _ffi.cast("TBox *", box) - _lib.timestamptz_set_tbox(t_converted, box_converted) +def temporal_values_p( + temp: Annotated[_ffi.CData, "const Temporal *"], count: Annotated[_ffi.CData, "int *"] +) -> Annotated[_ffi.CData, "Datum *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + count_converted = _ffi.cast("int *", count) + result = _lib.temporal_values_p(temp_converted, count_converted) _check_error() + return result if result != _ffi.NULL else None -def tstzset_set_stbox(s: "const Set *", box: "STBox *") -> None: - s_converted = _ffi.cast("const Set *", s) - box_converted = _ffi.cast("STBox *", box) - _lib.tstzset_set_stbox(s_converted, box_converted) +def temporal_value_n(temp: Annotated[_ffi.CData, "const Temporal *"], n: int) -> Annotated[_ffi.CData, "Datum *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + out_result = _ffi.new("Datum *") + result = _lib.temporal_value_n(temp_converted, n, out_result) _check_error() + if result: + return out_result if out_result != _ffi.NULL else None + return None -def tstzset_set_tbox(s: "const Set *", box: "TBox *") -> None: - s_converted = _ffi.cast("const Set *", s) - box_converted = _ffi.cast("TBox *", box) - _lib.tstzset_set_tbox(s_converted, box_converted) +def temporal_values( + temp: Annotated[_ffi.CData, "const Temporal *"], count: Annotated[_ffi.CData, "int *"] +) -> Annotated[_ffi.CData, "Datum *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + count_converted = _ffi.cast("int *", count) + result = _lib.temporal_values(temp_converted, count_converted) _check_error() + return result if result != _ffi.NULL else None -def tstzspan_set_stbox(s: "const Span *", box: "STBox *") -> None: - s_converted = _ffi.cast("const Span *", s) - box_converted = _ffi.cast("STBox *", box) - _lib.tstzspan_set_stbox(s_converted, box_converted) +def tinstant_hash(inst: Annotated[_ffi.CData, "const TInstant *"]) -> Annotated[int, "uint32"]: + inst_converted = _ffi.cast("const TInstant *", inst) + result = _lib.tinstant_hash(inst_converted) _check_error() + return result if result != _ffi.NULL else None -def tstzspan_set_tbox(s: "const Span *", box: "TBox *") -> None: - s_converted = _ffi.cast("const Span *", s) - box_converted = _ffi.cast("TBox *", box) - _lib.tstzspan_set_tbox(s_converted, box_converted) +def tinstant_insts( + inst: Annotated[_ffi.CData, "const TInstant *"], count: Annotated[_ffi.CData, "int *"] +) -> Annotated[_ffi.CData, "const TInstant **"]: + inst_converted = _ffi.cast("const TInstant *", inst) + count_converted = _ffi.cast("int *", count) + result = _lib.tinstant_insts(inst_converted, count_converted) _check_error() + return result if result != _ffi.NULL else None -def tstzspanset_set_stbox(ss: "const SpanSet *", box: "STBox *") -> None: - ss_converted = _ffi.cast("const SpanSet *", ss) - box_converted = _ffi.cast("STBox *", box) - _lib.tstzspanset_set_stbox(ss_converted, box_converted) +def tinstant_set_bbox( + inst: Annotated[_ffi.CData, "const TInstant *"], box: Annotated[_ffi.CData, "void *"] +) -> Annotated[None, "void"]: + inst_converted = _ffi.cast("const TInstant *", inst) + box_converted = _ffi.cast("void *", box) + _lib.tinstant_set_bbox(inst_converted, box_converted) _check_error() -def tstzspanset_set_tbox(ss: "const SpanSet *", box: "TBox *") -> None: - ss_converted = _ffi.cast("const SpanSet *", ss) - box_converted = _ffi.cast("TBox *", box) - _lib.tstzspanset_set_tbox(ss_converted, box_converted) +def tinstant_time(inst: Annotated[_ffi.CData, "const TInstant *"]) -> Annotated[_ffi.CData, "SpanSet *"]: + inst_converted = _ffi.cast("const TInstant *", inst) + result = _lib.tinstant_time(inst_converted) _check_error() + return result if result != _ffi.NULL else None -def tbox_shift_scale_value( - box: "const TBox *", shift: "Datum", width: "Datum", hasshift: bool, haswidth: bool -) -> "TBox *": - box_converted = _ffi.cast("const TBox *", box) - shift_converted = _ffi.cast("Datum", shift) - width_converted = _ffi.cast("Datum", width) - result = _lib.tbox_shift_scale_value( - box_converted, shift_converted, width_converted, hasshift, haswidth - ) +def tinstant_timestamps( + inst: Annotated[_ffi.CData, "const TInstant *"], count: Annotated[_ffi.CData, "int *"] +) -> Annotated[int, "TimestampTz *"]: + inst_converted = _ffi.cast("const TInstant *", inst) + count_converted = _ffi.cast("int *", count) + result = _lib.tinstant_timestamps(inst_converted, count_converted) _check_error() return result if result != _ffi.NULL else None -def stbox_expand(box1: "const STBox *", box2: "STBox *") -> None: - box1_converted = _ffi.cast("const STBox *", box1) - box2_converted = _ffi.cast("STBox *", box2) - _lib.stbox_expand(box1_converted, box2_converted) +def tinstant_value_p(inst: Annotated[_ffi.CData, "const TInstant *"]) -> Annotated[_ffi.CData, "Datum"]: + inst_converted = _ffi.cast("const TInstant *", inst) + result = _lib.tinstant_value_p(inst_converted) _check_error() + return result if result != _ffi.NULL else None -def tbox_expand(box1: "const TBox *", box2: "TBox *") -> None: - box1_converted = _ffi.cast("const TBox *", box1) - box2_converted = _ffi.cast("TBox *", box2) - _lib.tbox_expand(box1_converted, box2_converted) +def tinstant_value(inst: Annotated[_ffi.CData, "const TInstant *"]) -> Annotated[_ffi.CData, "Datum"]: + inst_converted = _ffi.cast("const TInstant *", inst) + result = _lib.tinstant_value(inst_converted) _check_error() + return result if result != _ffi.NULL else None -def inter_stbox_stbox(box1: "const STBox *", box2: "const STBox *") -> "STBox *": - box1_converted = _ffi.cast("const STBox *", box1) - box2_converted = _ffi.cast("const STBox *", box2) - out_result = _ffi.new("STBox *") - result = _lib.inter_stbox_stbox(box1_converted, box2_converted, out_result) +def tinstant_value_at_timestamptz( + inst: Annotated[_ffi.CData, "const TInstant *"], t: int +) -> Annotated[_ffi.CData, "Datum *"]: + inst_converted = _ffi.cast("const TInstant *", inst) + t_converted = _ffi.cast("TimestampTz", t) + out_result = _ffi.new("Datum *") + result = _lib.tinstant_value_at_timestamptz(inst_converted, t_converted, out_result) _check_error() if result: return out_result if out_result != _ffi.NULL else None return None -def inter_tbox_tbox(box1: "const TBox *", box2: "const TBox *") -> "TBox *": - box1_converted = _ffi.cast("const TBox *", box1) - box2_converted = _ffi.cast("const TBox *", box2) - out_result = _ffi.new("TBox *") - result = _lib.inter_tbox_tbox(box1_converted, box2_converted, out_result) +def tinstant_values_p( + inst: Annotated[_ffi.CData, "const TInstant *"], count: Annotated[_ffi.CData, "int *"] +) -> Annotated[_ffi.CData, "Datum *"]: + inst_converted = _ffi.cast("const TInstant *", inst) + count_converted = _ffi.cast("int *", count) + result = _lib.tinstant_values_p(inst_converted, count_converted) _check_error() - if result: - return out_result if out_result != _ffi.NULL else None - return None + return result if result != _ffi.NULL else None -def geoarr_as_text( - geoarr: "const Datum *", count: int, maxdd: int, extended: bool -) -> "char **": - geoarr_converted = _ffi.cast("const Datum *", geoarr) - result = _lib.geoarr_as_text(geoarr_converted, count, maxdd, extended) +def tnumber_set_span( + temp: Annotated[_ffi.CData, "const Temporal *"], span: Annotated[_ffi.CData, "Span *"] +) -> Annotated[None, "void"]: + temp_converted = _ffi.cast("const Temporal *", temp) + span_converted = _ffi.cast("Span *", span) + _lib.tnumber_set_span(temp_converted, span_converted) _check_error() - return result if result != _ffi.NULL else None -def tboolinst_as_mfjson(inst: "const TInstant *", with_bbox: bool) -> str: +def tnumberinst_valuespans(inst: Annotated[_ffi.CData, "const TInstant *"]) -> Annotated[_ffi.CData, "SpanSet *"]: inst_converted = _ffi.cast("const TInstant *", inst) - result = _lib.tboolinst_as_mfjson(inst_converted, with_bbox) + result = _lib.tnumberinst_valuespans(inst_converted) _check_error() - result = _ffi.string(result).decode("utf-8") return result if result != _ffi.NULL else None -def tboolinst_from_mfjson(mfjson: "json_object *") -> "TInstant *": - mfjson_converted = _ffi.cast("json_object *", mfjson) - result = _lib.tboolinst_from_mfjson(mfjson_converted) +def tnumberseq_valuespans(seq: Annotated[_ffi.CData, "const TSequence *"]) -> Annotated[_ffi.CData, "SpanSet *"]: + seq_converted = _ffi.cast("const TSequence *", seq) + result = _lib.tnumberseq_valuespans(seq_converted) _check_error() return result if result != _ffi.NULL else None -def tboolinst_in(string: str) -> "TInstant *": - string_converted = string.encode("utf-8") - result = _lib.tboolinst_in(string_converted) +def tnumberseqset_valuespans(ss: Annotated[_ffi.CData, "const TSequenceSet *"]) -> Annotated[_ffi.CData, "SpanSet *"]: + ss_converted = _ffi.cast("const TSequenceSet *", ss) + result = _lib.tnumberseqset_valuespans(ss_converted) _check_error() return result if result != _ffi.NULL else None -def tboolseq_as_mfjson(seq: "const TSequence *", with_bbox: bool) -> str: +def tsequence_duration(seq: Annotated[_ffi.CData, "const TSequence *"]) -> Annotated[_ffi.CData, "Interval *"]: seq_converted = _ffi.cast("const TSequence *", seq) - result = _lib.tboolseq_as_mfjson(seq_converted, with_bbox) + result = _lib.tsequence_duration(seq_converted) _check_error() - result = _ffi.string(result).decode("utf-8") return result if result != _ffi.NULL else None -def tboolseq_from_mfjson(mfjson: "json_object *") -> "TSequence *": - mfjson_converted = _ffi.cast("json_object *", mfjson) - result = _lib.tboolseq_from_mfjson(mfjson_converted) +def tsequence_end_timestamptz(seq: Annotated[_ffi.CData, "const TSequence *"]) -> Annotated[int, "TimestampTz"]: + seq_converted = _ffi.cast("const TSequence *", seq) + result = _lib.tsequence_end_timestamptz(seq_converted) _check_error() return result if result != _ffi.NULL else None -def tboolseq_in(string: str, interp: "interpType") -> "TSequence *": - string_converted = string.encode("utf-8") - interp_converted = _ffi.cast("interpType", interp) - result = _lib.tboolseq_in(string_converted, interp_converted) +def tsequence_hash(seq: Annotated[_ffi.CData, "const TSequence *"]) -> Annotated[int, "uint32"]: + seq_converted = _ffi.cast("const TSequence *", seq) + result = _lib.tsequence_hash(seq_converted) _check_error() return result if result != _ffi.NULL else None -def tboolseqset_as_mfjson(ss: "const TSequenceSet *", with_bbox: bool) -> str: - ss_converted = _ffi.cast("const TSequenceSet *", ss) - result = _lib.tboolseqset_as_mfjson(ss_converted, with_bbox) +def tsequence_insts_p(seq: Annotated[_ffi.CData, "const TSequence *"]) -> Annotated[_ffi.CData, "const TInstant **"]: + seq_converted = _ffi.cast("const TSequence *", seq) + result = _lib.tsequence_insts_p(seq_converted) _check_error() - result = _ffi.string(result).decode("utf-8") return result if result != _ffi.NULL else None -def tboolseqset_from_mfjson(mfjson: "json_object *") -> "TSequenceSet *": - mfjson_converted = _ffi.cast("json_object *", mfjson) - result = _lib.tboolseqset_from_mfjson(mfjson_converted) +def tsequence_max_inst(seq: Annotated[_ffi.CData, "const TSequence *"]) -> Annotated[_ffi.CData, "const TInstant *"]: + seq_converted = _ffi.cast("const TSequence *", seq) + result = _lib.tsequence_max_inst(seq_converted) _check_error() return result if result != _ffi.NULL else None -def tboolseqset_in(string: str) -> "TSequenceSet *": - string_converted = string.encode("utf-8") - result = _lib.tboolseqset_in(string_converted) +def tsequence_max_val(seq: Annotated[_ffi.CData, "const TSequence *"]) -> Annotated[_ffi.CData, "Datum"]: + seq_converted = _ffi.cast("const TSequence *", seq) + result = _lib.tsequence_max_val(seq_converted) _check_error() return result if result != _ffi.NULL else None -def temporal_in(string: str, temptype: "meosType") -> "Temporal *": - string_converted = string.encode("utf-8") - temptype_converted = _ffi.cast("meosType", temptype) - result = _lib.temporal_in(string_converted, temptype_converted) +def tsequence_min_inst(seq: Annotated[_ffi.CData, "const TSequence *"]) -> Annotated[_ffi.CData, "const TInstant *"]: + seq_converted = _ffi.cast("const TSequence *", seq) + result = _lib.tsequence_min_inst(seq_converted) _check_error() return result if result != _ffi.NULL else None -def temporal_out(temp: "const Temporal *", maxdd: int) -> str: - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.temporal_out(temp_converted, maxdd) +def tsequence_min_val(seq: Annotated[_ffi.CData, "const TSequence *"]) -> Annotated[_ffi.CData, "Datum"]: + seq_converted = _ffi.cast("const TSequence *", seq) + result = _lib.tsequence_min_val(seq_converted) _check_error() - result = _ffi.string(result).decode("utf-8") return result if result != _ffi.NULL else None -def temparr_out(temparr: "const Temporal **", count: int, maxdd: int) -> "char **": - temparr_converted = [_ffi.cast("const Temporal *", x) for x in temparr] - result = _lib.temparr_out(temparr_converted, count, maxdd) +def tsequence_segments( + seq: Annotated[_ffi.CData, "const TSequence *"], count: Annotated[_ffi.CData, "int *"] +) -> Annotated[_ffi.CData, "TSequence **"]: + seq_converted = _ffi.cast("const TSequence *", seq) + count_converted = _ffi.cast("int *", count) + result = _lib.tsequence_segments(seq_converted, count_converted) _check_error() return result if result != _ffi.NULL else None -def tfloatinst_as_mfjson( - inst: "const TInstant *", with_bbox: bool, precision: int -) -> str: - inst_converted = _ffi.cast("const TInstant *", inst) - result = _lib.tfloatinst_as_mfjson(inst_converted, with_bbox, precision) +def tsequence_seqs( + seq: Annotated[_ffi.CData, "const TSequence *"], count: Annotated[_ffi.CData, "int *"] +) -> Annotated[_ffi.CData, "const TSequence **"]: + seq_converted = _ffi.cast("const TSequence *", seq) + count_converted = _ffi.cast("int *", count) + result = _lib.tsequence_seqs(seq_converted, count_converted) _check_error() - result = _ffi.string(result).decode("utf-8") return result if result != _ffi.NULL else None -def tfloatinst_from_mfjson(mfjson: "json_object *") -> "TInstant *": - mfjson_converted = _ffi.cast("json_object *", mfjson) - result = _lib.tfloatinst_from_mfjson(mfjson_converted) +def tsequence_start_timestamptz(seq: Annotated[_ffi.CData, "const TSequence *"]) -> Annotated[int, "TimestampTz"]: + seq_converted = _ffi.cast("const TSequence *", seq) + result = _lib.tsequence_start_timestamptz(seq_converted) _check_error() return result if result != _ffi.NULL else None -def tfloatinst_in(string: str) -> "TInstant *": - string_converted = string.encode("utf-8") - result = _lib.tfloatinst_in(string_converted) +def tsequence_time(seq: Annotated[_ffi.CData, "const TSequence *"]) -> Annotated[_ffi.CData, "SpanSet *"]: + seq_converted = _ffi.cast("const TSequence *", seq) + result = _lib.tsequence_time(seq_converted) _check_error() return result if result != _ffi.NULL else None -def tfloatseq_as_mfjson( - seq: "const TSequence *", with_bbox: bool, precision: int -) -> str: +def tsequence_timestamps( + seq: Annotated[_ffi.CData, "const TSequence *"], count: Annotated[_ffi.CData, "int *"] +) -> Annotated[int, "TimestampTz *"]: seq_converted = _ffi.cast("const TSequence *", seq) - result = _lib.tfloatseq_as_mfjson(seq_converted, with_bbox, precision) + count_converted = _ffi.cast("int *", count) + result = _lib.tsequence_timestamps(seq_converted, count_converted) _check_error() - result = _ffi.string(result).decode("utf-8") return result if result != _ffi.NULL else None -def tfloatseq_from_mfjson( - mfjson: "json_object *", interp: "interpType" -) -> "TSequence *": - mfjson_converted = _ffi.cast("json_object *", mfjson) - interp_converted = _ffi.cast("interpType", interp) - result = _lib.tfloatseq_from_mfjson(mfjson_converted, interp_converted) +def tsequence_value_at_timestamptz( + seq: Annotated[_ffi.CData, "const TSequence *"], t: int, strict: bool +) -> Annotated[_ffi.CData, "Datum *"]: + seq_converted = _ffi.cast("const TSequence *", seq) + t_converted = _ffi.cast("TimestampTz", t) + out_result = _ffi.new("Datum *") + result = _lib.tsequence_value_at_timestamptz(seq_converted, t_converted, strict, out_result) _check_error() - return result if result != _ffi.NULL else None + if result: + return out_result if out_result != _ffi.NULL else None + return None -def tfloatseq_in(string: str, interp: "interpType") -> "TSequence *": - string_converted = string.encode("utf-8") - interp_converted = _ffi.cast("interpType", interp) - result = _lib.tfloatseq_in(string_converted, interp_converted) +def tsequence_values_p( + seq: Annotated[_ffi.CData, "const TSequence *"], count: Annotated[_ffi.CData, "int *"] +) -> Annotated[_ffi.CData, "Datum *"]: + seq_converted = _ffi.cast("const TSequence *", seq) + count_converted = _ffi.cast("int *", count) + result = _lib.tsequence_values_p(seq_converted, count_converted) _check_error() return result if result != _ffi.NULL else None -def tfloatseqset_as_mfjson( - ss: "const TSequenceSet *", with_bbox: bool, precision: int -) -> str: +def tsequenceset_duration( + ss: Annotated[_ffi.CData, "const TSequenceSet *"], boundspan: bool +) -> Annotated[_ffi.CData, "Interval *"]: ss_converted = _ffi.cast("const TSequenceSet *", ss) - result = _lib.tfloatseqset_as_mfjson(ss_converted, with_bbox, precision) + result = _lib.tsequenceset_duration(ss_converted, boundspan) _check_error() - result = _ffi.string(result).decode("utf-8") return result if result != _ffi.NULL else None -def tfloatseqset_from_mfjson( - mfjson: "json_object *", interp: "interpType" -) -> "TSequenceSet *": - mfjson_converted = _ffi.cast("json_object *", mfjson) - interp_converted = _ffi.cast("interpType", interp) - result = _lib.tfloatseqset_from_mfjson(mfjson_converted, interp_converted) +def tsequenceset_end_timestamptz(ss: Annotated[_ffi.CData, "const TSequenceSet *"]) -> Annotated[int, "TimestampTz"]: + ss_converted = _ffi.cast("const TSequenceSet *", ss) + result = _lib.tsequenceset_end_timestamptz(ss_converted) _check_error() return result if result != _ffi.NULL else None -def tfloatseqset_in(string: str) -> "TSequenceSet *": - string_converted = string.encode("utf-8") - result = _lib.tfloatseqset_in(string_converted) +def tsequenceset_hash(ss: Annotated[_ffi.CData, "const TSequenceSet *"]) -> Annotated[int, "uint32"]: + ss_converted = _ffi.cast("const TSequenceSet *", ss) + result = _lib.tsequenceset_hash(ss_converted) _check_error() return result if result != _ffi.NULL else None -def tgeogpointinst_from_mfjson(mfjson: "json_object *", srid: int) -> "TInstant *": - mfjson_converted = _ffi.cast("json_object *", mfjson) - result = _lib.tgeogpointinst_from_mfjson(mfjson_converted, srid) +def tsequenceset_inst_n( + ss: Annotated[_ffi.CData, "const TSequenceSet *"], n: int +) -> Annotated[_ffi.CData, "const TInstant *"]: + ss_converted = _ffi.cast("const TSequenceSet *", ss) + result = _lib.tsequenceset_inst_n(ss_converted, n) _check_error() return result if result != _ffi.NULL else None -def tgeogpointinst_in(string: str) -> "TInstant *": - string_converted = string.encode("utf-8") - result = _lib.tgeogpointinst_in(string_converted) +def tsequenceset_insts_p( + ss: Annotated[_ffi.CData, "const TSequenceSet *"], +) -> Annotated[_ffi.CData, "const TInstant **"]: + ss_converted = _ffi.cast("const TSequenceSet *", ss) + result = _lib.tsequenceset_insts_p(ss_converted) _check_error() return result if result != _ffi.NULL else None -def tgeogpointseq_from_mfjson( - mfjson: "json_object *", srid: int, interp: "interpType" -) -> "TSequence *": - mfjson_converted = _ffi.cast("json_object *", mfjson) - interp_converted = _ffi.cast("interpType", interp) - result = _lib.tgeogpointseq_from_mfjson(mfjson_converted, srid, interp_converted) +def tsequenceset_max_inst( + ss: Annotated[_ffi.CData, "const TSequenceSet *"], +) -> Annotated[_ffi.CData, "const TInstant *"]: + ss_converted = _ffi.cast("const TSequenceSet *", ss) + result = _lib.tsequenceset_max_inst(ss_converted) _check_error() return result if result != _ffi.NULL else None -def tgeogpointseq_in(string: str, interp: "interpType") -> "TSequence *": - string_converted = string.encode("utf-8") - interp_converted = _ffi.cast("interpType", interp) - result = _lib.tgeogpointseq_in(string_converted, interp_converted) +def tsequenceset_max_val(ss: Annotated[_ffi.CData, "const TSequenceSet *"]) -> Annotated[_ffi.CData, "Datum"]: + ss_converted = _ffi.cast("const TSequenceSet *", ss) + result = _lib.tsequenceset_max_val(ss_converted) _check_error() return result if result != _ffi.NULL else None -def tgeogpointseqset_from_mfjson( - mfjson: "json_object *", srid: int, interp: "interpType" -) -> "TSequenceSet *": - mfjson_converted = _ffi.cast("json_object *", mfjson) - interp_converted = _ffi.cast("interpType", interp) - result = _lib.tgeogpointseqset_from_mfjson(mfjson_converted, srid, interp_converted) +def tsequenceset_min_inst( + ss: Annotated[_ffi.CData, "const TSequenceSet *"], +) -> Annotated[_ffi.CData, "const TInstant *"]: + ss_converted = _ffi.cast("const TSequenceSet *", ss) + result = _lib.tsequenceset_min_inst(ss_converted) _check_error() return result if result != _ffi.NULL else None -def tgeogpointseqset_in(string: str) -> "TSequenceSet *": - string_converted = string.encode("utf-8") - result = _lib.tgeogpointseqset_in(string_converted) +def tsequenceset_min_val(ss: Annotated[_ffi.CData, "const TSequenceSet *"]) -> Annotated[_ffi.CData, "Datum"]: + ss_converted = _ffi.cast("const TSequenceSet *", ss) + result = _lib.tsequenceset_min_val(ss_converted) _check_error() return result if result != _ffi.NULL else None -def tgeompointinst_from_mfjson(mfjson: "json_object *", srid: int) -> "TInstant *": - mfjson_converted = _ffi.cast("json_object *", mfjson) - result = _lib.tgeompointinst_from_mfjson(mfjson_converted, srid) +def tsequenceset_num_instants(ss: Annotated[_ffi.CData, "const TSequenceSet *"]) -> Annotated[int, "int"]: + ss_converted = _ffi.cast("const TSequenceSet *", ss) + result = _lib.tsequenceset_num_instants(ss_converted) _check_error() return result if result != _ffi.NULL else None -def tgeompointinst_in(string: str) -> "TInstant *": - string_converted = string.encode("utf-8") - result = _lib.tgeompointinst_in(string_converted) +def tsequenceset_num_timestamps(ss: Annotated[_ffi.CData, "const TSequenceSet *"]) -> Annotated[int, "int"]: + ss_converted = _ffi.cast("const TSequenceSet *", ss) + result = _lib.tsequenceset_num_timestamps(ss_converted) _check_error() return result if result != _ffi.NULL else None -def tgeompointseq_from_mfjson( - mfjson: "json_object *", srid: int, interp: "interpType" -) -> "TSequence *": - mfjson_converted = _ffi.cast("json_object *", mfjson) - interp_converted = _ffi.cast("interpType", interp) - result = _lib.tgeompointseq_from_mfjson(mfjson_converted, srid, interp_converted) +def tsequenceset_segments( + ss: Annotated[_ffi.CData, "const TSequenceSet *"], count: Annotated[_ffi.CData, "int *"] +) -> Annotated[_ffi.CData, "TSequence **"]: + ss_converted = _ffi.cast("const TSequenceSet *", ss) + count_converted = _ffi.cast("int *", count) + result = _lib.tsequenceset_segments(ss_converted, count_converted) _check_error() return result if result != _ffi.NULL else None -def tgeompointseq_in(string: str, interp: "interpType") -> "TSequence *": - string_converted = string.encode("utf-8") - interp_converted = _ffi.cast("interpType", interp) - result = _lib.tgeompointseq_in(string_converted, interp_converted) +def tsequenceset_sequences_p( + ss: Annotated[_ffi.CData, "const TSequenceSet *"], +) -> Annotated[_ffi.CData, "const TSequence **"]: + ss_converted = _ffi.cast("const TSequenceSet *", ss) + result = _lib.tsequenceset_sequences_p(ss_converted) _check_error() return result if result != _ffi.NULL else None -def tgeompointseqset_from_mfjson( - mfjson: "json_object *", srid: int, interp: "interpType" -) -> "TSequenceSet *": - mfjson_converted = _ffi.cast("json_object *", mfjson) - interp_converted = _ffi.cast("interpType", interp) - result = _lib.tgeompointseqset_from_mfjson(mfjson_converted, srid, interp_converted) +def tsequenceset_start_timestamptz(ss: Annotated[_ffi.CData, "const TSequenceSet *"]) -> Annotated[int, "TimestampTz"]: + ss_converted = _ffi.cast("const TSequenceSet *", ss) + result = _lib.tsequenceset_start_timestamptz(ss_converted) _check_error() return result if result != _ffi.NULL else None -def tgeompointseqset_in(string: str) -> "TSequenceSet *": - string_converted = string.encode("utf-8") - result = _lib.tgeompointseqset_in(string_converted) +def tsequenceset_time(ss: Annotated[_ffi.CData, "const TSequenceSet *"]) -> Annotated[_ffi.CData, "SpanSet *"]: + ss_converted = _ffi.cast("const TSequenceSet *", ss) + result = _lib.tsequenceset_time(ss_converted) _check_error() return result if result != _ffi.NULL else None -def tinstant_from_mfjson( - mfjson: "json_object *", isgeo: bool, srid: int, temptype: "meosType" -) -> "TInstant *": - mfjson_converted = _ffi.cast("json_object *", mfjson) - temptype_converted = _ffi.cast("meosType", temptype) - result = _lib.tinstant_from_mfjson( - mfjson_converted, isgeo, srid, temptype_converted - ) +def tsequenceset_timestamptz_n(ss: Annotated[_ffi.CData, "const TSequenceSet *"], n: int) -> int: + ss_converted = _ffi.cast("const TSequenceSet *", ss) + out_result = _ffi.new("TimestampTz *") + result = _lib.tsequenceset_timestamptz_n(ss_converted, n, out_result) + _check_error() + if result: + return out_result[0] if out_result[0] != _ffi.NULL else None + return None + + +def tsequenceset_timestamps( + ss: Annotated[_ffi.CData, "const TSequenceSet *"], count: Annotated[_ffi.CData, "int *"] +) -> Annotated[int, "TimestampTz *"]: + ss_converted = _ffi.cast("const TSequenceSet *", ss) + count_converted = _ffi.cast("int *", count) + result = _lib.tsequenceset_timestamps(ss_converted, count_converted) _check_error() return result if result != _ffi.NULL else None -def tinstant_in(string: str, temptype: "meosType") -> "TInstant *": - string_converted = string.encode("utf-8") - temptype_converted = _ffi.cast("meosType", temptype) - result = _lib.tinstant_in(string_converted, temptype_converted) +def tsequenceset_value_at_timestamptz( + ss: Annotated[_ffi.CData, "const TSequenceSet *"], t: int, strict: bool +) -> Annotated[_ffi.CData, "Datum *"]: + ss_converted = _ffi.cast("const TSequenceSet *", ss) + t_converted = _ffi.cast("TimestampTz", t) + out_result = _ffi.new("Datum *") + result = _lib.tsequenceset_value_at_timestamptz(ss_converted, t_converted, strict, out_result) + _check_error() + if result: + return out_result if out_result != _ffi.NULL else None + return None + + +def tsequenceset_value_n(ss: Annotated[_ffi.CData, "const TSequenceSet *"], n: int) -> Annotated[_ffi.CData, "Datum *"]: + ss_converted = _ffi.cast("const TSequenceSet *", ss) + out_result = _ffi.new("Datum *") + result = _lib.tsequenceset_value_n(ss_converted, n, out_result) + _check_error() + if result: + return out_result if out_result != _ffi.NULL else None + return None + + +def tsequenceset_values_p( + ss: Annotated[_ffi.CData, "const TSequenceSet *"], count: Annotated[_ffi.CData, "int *"] +) -> Annotated[_ffi.CData, "Datum *"]: + ss_converted = _ffi.cast("const TSequenceSet *", ss) + count_converted = _ffi.cast("int *", count) + result = _lib.tsequenceset_values_p(ss_converted, count_converted) _check_error() return result if result != _ffi.NULL else None -def tinstant_out(inst: "const TInstant *", maxdd: int) -> str: - inst_converted = _ffi.cast("const TInstant *", inst) - result = _lib.tinstant_out(inst_converted, maxdd) +def temporal_restart(temp: Annotated[_ffi.CData, "Temporal *"], count: int) -> Annotated[None, "void"]: + temp_converted = _ffi.cast("Temporal *", temp) + _lib.temporal_restart(temp_converted, count) _check_error() - result = _ffi.string(result).decode("utf-8") - return result if result != _ffi.NULL else None -def tintinst_as_mfjson(inst: "const TInstant *", with_bbox: bool) -> str: - inst_converted = _ffi.cast("const TInstant *", inst) - result = _lib.tintinst_as_mfjson(inst_converted, with_bbox) +def temporal_tsequence( + temp: Annotated[_ffi.CData, "const Temporal *"], interp: InterpolationType +) -> Annotated[_ffi.CData, "TSequence *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.temporal_tsequence(temp_converted, interp) _check_error() - result = _ffi.string(result).decode("utf-8") return result if result != _ffi.NULL else None -def tintinst_from_mfjson(mfjson: "json_object *") -> "TInstant *": - mfjson_converted = _ffi.cast("json_object *", mfjson) - result = _lib.tintinst_from_mfjson(mfjson_converted) +def temporal_tsequenceset( + temp: Annotated[_ffi.CData, "const Temporal *"], interp: InterpolationType +) -> Annotated[_ffi.CData, "TSequenceSet *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.temporal_tsequenceset(temp_converted, interp) _check_error() return result if result != _ffi.NULL else None -def tintinst_in(string: str) -> "TInstant *": - string_converted = string.encode("utf-8") - result = _lib.tintinst_in(string_converted) +def tinstant_shift_time( + inst: Annotated[_ffi.CData, "const TInstant *"], interv: Annotated[_ffi.CData, "const Interval *"] +) -> Annotated[_ffi.CData, "TInstant *"]: + inst_converted = _ffi.cast("const TInstant *", inst) + interv_converted = _ffi.cast("const Interval *", interv) + result = _lib.tinstant_shift_time(inst_converted, interv_converted) _check_error() return result if result != _ffi.NULL else None -def tintseq_as_mfjson(seq: "const TSequence *", with_bbox: bool) -> str: - seq_converted = _ffi.cast("const TSequence *", seq) - result = _lib.tintseq_as_mfjson(seq_converted, with_bbox) +def tinstant_to_tsequence( + inst: Annotated[_ffi.CData, "const TInstant *"], interp: InterpolationType +) -> Annotated[_ffi.CData, "TSequence *"]: + inst_converted = _ffi.cast("const TInstant *", inst) + result = _lib.tinstant_to_tsequence(inst_converted, interp) _check_error() - result = _ffi.string(result).decode("utf-8") return result if result != _ffi.NULL else None -def tintseq_from_mfjson(mfjson: "json_object *") -> "TSequence *": - mfjson_converted = _ffi.cast("json_object *", mfjson) - result = _lib.tintseq_from_mfjson(mfjson_converted) +def tinstant_to_tsequence_free( + inst: Annotated[_ffi.CData, "TInstant *"], interp: InterpolationType +) -> Annotated[_ffi.CData, "TSequence *"]: + inst_converted = _ffi.cast("TInstant *", inst) + result = _lib.tinstant_to_tsequence_free(inst_converted, interp) _check_error() return result if result != _ffi.NULL else None -def tintseq_in(string: str, interp: "interpType") -> "TSequence *": - string_converted = string.encode("utf-8") - interp_converted = _ffi.cast("interpType", interp) - result = _lib.tintseq_in(string_converted, interp_converted) +def tinstant_to_tsequenceset( + inst: Annotated[_ffi.CData, "const TInstant *"], interp: InterpolationType +) -> Annotated[_ffi.CData, "TSequenceSet *"]: + inst_converted = _ffi.cast("const TInstant *", inst) + result = _lib.tinstant_to_tsequenceset(inst_converted, interp) _check_error() return result if result != _ffi.NULL else None -def tintseqset_as_mfjson(ss: "const TSequenceSet *", with_bbox: bool) -> str: - ss_converted = _ffi.cast("const TSequenceSet *", ss) - result = _lib.tintseqset_as_mfjson(ss_converted, with_bbox) +def tnumber_shift_scale_value( + temp: Annotated[_ffi.CData, "const Temporal *"], + shift: Annotated[_ffi.CData, "Datum"], + width: Annotated[_ffi.CData, "Datum"], + hasshift: bool, + haswidth: bool, +) -> Annotated[_ffi.CData, "Temporal *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + shift_converted = _ffi.cast("Datum", shift) + width_converted = _ffi.cast("Datum", width) + result = _lib.tnumber_shift_scale_value(temp_converted, shift_converted, width_converted, hasshift, haswidth) _check_error() - result = _ffi.string(result).decode("utf-8") return result if result != _ffi.NULL else None -def tintseqset_from_mfjson(mfjson: "json_object *") -> "TSequenceSet *": - mfjson_converted = _ffi.cast("json_object *", mfjson) - result = _lib.tintseqset_from_mfjson(mfjson_converted) +def tnumberinst_shift_value( + inst: Annotated[_ffi.CData, "const TInstant *"], shift: Annotated[_ffi.CData, "Datum"] +) -> Annotated[_ffi.CData, "TInstant *"]: + inst_converted = _ffi.cast("const TInstant *", inst) + shift_converted = _ffi.cast("Datum", shift) + result = _lib.tnumberinst_shift_value(inst_converted, shift_converted) _check_error() return result if result != _ffi.NULL else None -def tintseqset_in(string: str) -> "TSequenceSet *": - string_converted = string.encode("utf-8") - result = _lib.tintseqset_in(string_converted) +def tnumberseq_shift_scale_value( + seq: Annotated[_ffi.CData, "const TSequence *"], + shift: Annotated[_ffi.CData, "Datum"], + width: Annotated[_ffi.CData, "Datum"], + hasshift: bool, + haswidth: bool, +) -> Annotated[_ffi.CData, "TSequence *"]: + seq_converted = _ffi.cast("const TSequence *", seq) + shift_converted = _ffi.cast("Datum", shift) + width_converted = _ffi.cast("Datum", width) + result = _lib.tnumberseq_shift_scale_value(seq_converted, shift_converted, width_converted, hasshift, haswidth) _check_error() return result if result != _ffi.NULL else None -def tpointarr_as_text( - temparr: "const Temporal **", count: int, maxdd: int, extended: bool -) -> "char **": - temparr_converted = [_ffi.cast("const Temporal *", x) for x in temparr] - result = _lib.tpointarr_as_text(temparr_converted, count, maxdd, extended) +def tnumberseqset_shift_scale_value( + ss: Annotated[_ffi.CData, "const TSequenceSet *"], + start: Annotated[_ffi.CData, "Datum"], + width: Annotated[_ffi.CData, "Datum"], + hasshift: bool, + haswidth: bool, +) -> Annotated[_ffi.CData, "TSequenceSet *"]: + ss_converted = _ffi.cast("const TSequenceSet *", ss) + start_converted = _ffi.cast("Datum", start) + width_converted = _ffi.cast("Datum", width) + result = _lib.tnumberseqset_shift_scale_value(ss_converted, start_converted, width_converted, hasshift, haswidth) _check_error() return result if result != _ffi.NULL else None -def tpointinst_as_mfjson( - inst: "const TInstant *", with_bbox: bool, precision: int, srs: str -) -> str: - inst_converted = _ffi.cast("const TInstant *", inst) - srs_converted = srs.encode("utf-8") - result = _lib.tpointinst_as_mfjson( - inst_converted, with_bbox, precision, srs_converted - ) +def tsequence_restart(seq: Annotated[_ffi.CData, "TSequence *"], count: int) -> Annotated[None, "void"]: + seq_converted = _ffi.cast("TSequence *", seq) + _lib.tsequence_restart(seq_converted, count) _check_error() - result = _ffi.string(result).decode("utf-8") - return result if result != _ffi.NULL else None -def tpointseq_as_mfjson( - seq: "const TSequence *", with_bbox: bool, precision: int, srs: str -) -> str: +def tsequence_set_interp( + seq: Annotated[_ffi.CData, "const TSequence *"], interp: InterpolationType +) -> Annotated[_ffi.CData, "Temporal *"]: seq_converted = _ffi.cast("const TSequence *", seq) - srs_converted = srs.encode("utf-8") - result = _lib.tpointseq_as_mfjson( - seq_converted, with_bbox, precision, srs_converted - ) + result = _lib.tsequence_set_interp(seq_converted, interp) _check_error() - result = _ffi.string(result).decode("utf-8") return result if result != _ffi.NULL else None -def tpointseqset_as_mfjson( - ss: "const TSequenceSet *", with_bbox: bool, precision: int, srs: str -) -> str: - ss_converted = _ffi.cast("const TSequenceSet *", ss) - srs_converted = srs.encode("utf-8") - result = _lib.tpointseqset_as_mfjson( - ss_converted, with_bbox, precision, srs_converted - ) +def tsequence_shift_scale_time( + seq: Annotated[_ffi.CData, "const TSequence *"], + shift: Annotated[_ffi.CData, "const Interval *"], + duration: Annotated[_ffi.CData, "const Interval *"], +) -> Annotated[_ffi.CData, "TSequence *"]: + seq_converted = _ffi.cast("const TSequence *", seq) + shift_converted = _ffi.cast("const Interval *", shift) + duration_converted = _ffi.cast("const Interval *", duration) + result = _lib.tsequence_shift_scale_time(seq_converted, shift_converted, duration_converted) _check_error() - result = _ffi.string(result).decode("utf-8") return result if result != _ffi.NULL else None -def tsequence_from_mfjson( - mfjson: "json_object *", - isgeo: bool, - srid: int, - temptype: "meosType", - interp: "interpType", -) -> "TSequence *": - mfjson_converted = _ffi.cast("json_object *", mfjson) - temptype_converted = _ffi.cast("meosType", temptype) - interp_converted = _ffi.cast("interpType", interp) - result = _lib.tsequence_from_mfjson( - mfjson_converted, isgeo, srid, temptype_converted, interp_converted - ) +def tsequence_subseq( + seq: Annotated[_ffi.CData, "const TSequence *"], from_: int, to: int, lower_inc: bool, upper_inc: bool +) -> Annotated[_ffi.CData, "TSequence *"]: + seq_converted = _ffi.cast("const TSequence *", seq) + result = _lib.tsequence_subseq(seq_converted, from_, to, lower_inc, upper_inc) _check_error() return result if result != _ffi.NULL else None -def tsequence_in( - string: str, temptype: "meosType", interp: "interpType" -) -> "TSequence *": - string_converted = string.encode("utf-8") - temptype_converted = _ffi.cast("meosType", temptype) - interp_converted = _ffi.cast("interpType", interp) - result = _lib.tsequence_in(string_converted, temptype_converted, interp_converted) +def tsequence_to_tinstant(seq: Annotated[_ffi.CData, "const TSequence *"]) -> Annotated[_ffi.CData, "TInstant *"]: + seq_converted = _ffi.cast("const TSequence *", seq) + result = _lib.tsequence_to_tinstant(seq_converted) _check_error() return result if result != _ffi.NULL else None -def tsequence_out(seq: "const TSequence *", maxdd: int) -> str: +def tsequence_to_tsequenceset( + seq: Annotated[_ffi.CData, "const TSequence *"], +) -> Annotated[_ffi.CData, "TSequenceSet *"]: seq_converted = _ffi.cast("const TSequence *", seq) - result = _lib.tsequence_out(seq_converted, maxdd) + result = _lib.tsequence_to_tsequenceset(seq_converted) _check_error() - result = _ffi.string(result).decode("utf-8") return result if result != _ffi.NULL else None -def tsequenceset_from_mfjson( - mfjson: "json_object *", - isgeo: bool, - srid: int, - temptype: "meosType", - interp: "interpType", -) -> "TSequenceSet *": - mfjson_converted = _ffi.cast("json_object *", mfjson) - temptype_converted = _ffi.cast("meosType", temptype) - interp_converted = _ffi.cast("interpType", interp) - result = _lib.tsequenceset_from_mfjson( - mfjson_converted, isgeo, srid, temptype_converted, interp_converted - ) +def tsequence_to_tsequenceset_free( + seq: Annotated[_ffi.CData, "TSequence *"], +) -> Annotated[_ffi.CData, "TSequenceSet *"]: + seq_converted = _ffi.cast("TSequence *", seq) + result = _lib.tsequence_to_tsequenceset_free(seq_converted) _check_error() return result if result != _ffi.NULL else None -def tsequenceset_in( - string: str, temptype: "meosType", interp: "interpType" -) -> "TSequenceSet *": - string_converted = string.encode("utf-8") - temptype_converted = _ffi.cast("meosType", temptype) - interp_converted = _ffi.cast("interpType", interp) - result = _lib.tsequenceset_in( - string_converted, temptype_converted, interp_converted - ) +def tsequence_to_tsequenceset_interp( + seq: Annotated[_ffi.CData, "const TSequence *"], interp: InterpolationType +) -> Annotated[_ffi.CData, "TSequenceSet *"]: + seq_converted = _ffi.cast("const TSequence *", seq) + result = _lib.tsequence_to_tsequenceset_interp(seq_converted, interp) _check_error() return result if result != _ffi.NULL else None -def tsequenceset_out(ss: "const TSequenceSet *", maxdd: int) -> str: - ss_converted = _ffi.cast("const TSequenceSet *", ss) - result = _lib.tsequenceset_out(ss_converted, maxdd) +def tsequenceset_restart(ss: Annotated[_ffi.CData, "TSequenceSet *"], count: int) -> Annotated[None, "void"]: + ss_converted = _ffi.cast("TSequenceSet *", ss) + _lib.tsequenceset_restart(ss_converted, count) _check_error() - result = _ffi.string(result).decode("utf-8") - return result if result != _ffi.NULL else None -def ttextinst_as_mfjson(inst: "const TInstant *", with_bbox: bool) -> str: - inst_converted = _ffi.cast("const TInstant *", inst) - result = _lib.ttextinst_as_mfjson(inst_converted, with_bbox) +def tsequenceset_set_interp( + ss: Annotated[_ffi.CData, "const TSequenceSet *"], interp: InterpolationType +) -> Annotated[_ffi.CData, "Temporal *"]: + ss_converted = _ffi.cast("const TSequenceSet *", ss) + result = _lib.tsequenceset_set_interp(ss_converted, interp) _check_error() - result = _ffi.string(result).decode("utf-8") return result if result != _ffi.NULL else None -def ttextinst_from_mfjson(mfjson: "json_object *") -> "TInstant *": - mfjson_converted = _ffi.cast("json_object *", mfjson) - result = _lib.ttextinst_from_mfjson(mfjson_converted) +def tsequenceset_shift_scale_time( + ss: Annotated[_ffi.CData, "const TSequenceSet *"], + start: Annotated[_ffi.CData, "const Interval *"], + duration: Annotated[_ffi.CData, "const Interval *"], +) -> Annotated[_ffi.CData, "TSequenceSet *"]: + ss_converted = _ffi.cast("const TSequenceSet *", ss) + start_converted = _ffi.cast("const Interval *", start) + duration_converted = _ffi.cast("const Interval *", duration) + result = _lib.tsequenceset_shift_scale_time(ss_converted, start_converted, duration_converted) _check_error() return result if result != _ffi.NULL else None -def ttextinst_in(string: str) -> "TInstant *": - string_converted = string.encode("utf-8") - result = _lib.ttextinst_in(string_converted) +def tsequenceset_to_discrete(ss: Annotated[_ffi.CData, "const TSequenceSet *"]) -> Annotated[_ffi.CData, "TSequence *"]: + ss_converted = _ffi.cast("const TSequenceSet *", ss) + result = _lib.tsequenceset_to_discrete(ss_converted) _check_error() return result if result != _ffi.NULL else None -def ttextseq_as_mfjson(seq: "const TSequence *", with_bbox: bool) -> str: - seq_converted = _ffi.cast("const TSequence *", seq) - result = _lib.ttextseq_as_mfjson(seq_converted, with_bbox) +def tsequenceset_to_linear( + ss: Annotated[_ffi.CData, "const TSequenceSet *"], +) -> Annotated[_ffi.CData, "TSequenceSet *"]: + ss_converted = _ffi.cast("const TSequenceSet *", ss) + result = _lib.tsequenceset_to_linear(ss_converted) _check_error() - result = _ffi.string(result).decode("utf-8") return result if result != _ffi.NULL else None -def ttextseq_from_mfjson(mfjson: "json_object *") -> "TSequence *": - mfjson_converted = _ffi.cast("json_object *", mfjson) - result = _lib.ttextseq_from_mfjson(mfjson_converted) +def tsequenceset_to_step(ss: Annotated[_ffi.CData, "const TSequenceSet *"]) -> Annotated[_ffi.CData, "TSequenceSet *"]: + ss_converted = _ffi.cast("const TSequenceSet *", ss) + result = _lib.tsequenceset_to_step(ss_converted) _check_error() return result if result != _ffi.NULL else None -def ttextseq_in(string: str, interp: "interpType") -> "TSequence *": - string_converted = string.encode("utf-8") - interp_converted = _ffi.cast("interpType", interp) - result = _lib.ttextseq_in(string_converted, interp_converted) +def tsequenceset_to_tinstant(ss: Annotated[_ffi.CData, "const TSequenceSet *"]) -> Annotated[_ffi.CData, "TInstant *"]: + ss_converted = _ffi.cast("const TSequenceSet *", ss) + result = _lib.tsequenceset_to_tinstant(ss_converted) _check_error() return result if result != _ffi.NULL else None -def ttextseqset_as_mfjson(ss: "const TSequenceSet *", with_bbox: bool) -> str: +def tsequenceset_to_tsequence( + ss: Annotated[_ffi.CData, "const TSequenceSet *"], +) -> Annotated[_ffi.CData, "TSequence *"]: ss_converted = _ffi.cast("const TSequenceSet *", ss) - result = _lib.ttextseqset_as_mfjson(ss_converted, with_bbox) + result = _lib.tsequenceset_to_tsequence(ss_converted) _check_error() - result = _ffi.string(result).decode("utf-8") return result if result != _ffi.NULL else None -def ttextseqset_from_mfjson(mfjson: "json_object *") -> "TSequenceSet *": - mfjson_converted = _ffi.cast("json_object *", mfjson) - result = _lib.ttextseqset_from_mfjson(mfjson_converted) +def tinstant_merge( + inst1: Annotated[_ffi.CData, "const TInstant *"], inst2: Annotated[_ffi.CData, "const TInstant *"] +) -> Annotated[_ffi.CData, "Temporal *"]: + inst1_converted = _ffi.cast("const TInstant *", inst1) + inst2_converted = _ffi.cast("const TInstant *", inst2) + result = _lib.tinstant_merge(inst1_converted, inst2_converted) _check_error() return result if result != _ffi.NULL else None -def ttextseqset_in(string: str) -> "TSequenceSet *": - string_converted = string.encode("utf-8") - result = _lib.ttextseqset_in(string_converted) +def tinstant_merge_array( + instants: Annotated[list, "const TInstant **"], count: int +) -> Annotated[_ffi.CData, "Temporal *"]: + instants_converted = [_ffi.cast("const TInstant *", x) for x in instants] + result = _lib.tinstant_merge_array(instants_converted, count) _check_error() return result if result != _ffi.NULL else None -def temporal_from_mfjson(mfjson: str, temptype: "meosType") -> "Temporal *": - mfjson_converted = mfjson.encode("utf-8") - temptype_converted = _ffi.cast("meosType", temptype) - result = _lib.temporal_from_mfjson(mfjson_converted, temptype_converted) +def tsequence_append_tinstant( + seq: Annotated[_ffi.CData, "TSequence *"], + inst: Annotated[_ffi.CData, "const TInstant *"], + maxdist: float, + maxt: Annotated[_ffi.CData, "const Interval *"], + expand: bool, +) -> Annotated[_ffi.CData, "Temporal *"]: + seq_converted = _ffi.cast("TSequence *", seq) + inst_converted = _ffi.cast("const TInstant *", inst) + maxt_converted = _ffi.cast("const Interval *", maxt) + result = _lib.tsequence_append_tinstant(seq_converted, inst_converted, maxdist, maxt_converted, expand) _check_error() return result if result != _ffi.NULL else None -def temporal_cp(temp: "const Temporal *") -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.temporal_cp(temp_converted) +def tsequence_append_tsequence( + seq1: Annotated[_ffi.CData, "const TSequence *"], seq2: Annotated[_ffi.CData, "const TSequence *"], expand: bool +) -> Annotated[_ffi.CData, "Temporal *"]: + seq1_converted = _ffi.cast("const TSequence *", seq1) + seq2_converted = _ffi.cast("const TSequence *", seq2) + result = _lib.tsequence_append_tsequence(seq1_converted, seq2_converted, expand) _check_error() return result if result != _ffi.NULL else None -def temporal_from_base_temp( - value: "Datum", temptype: "meosType", temp: "const Temporal *" -) -> "Temporal *": - value_converted = _ffi.cast("Datum", value) - temptype_converted = _ffi.cast("meosType", temptype) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.temporal_from_base_temp( - value_converted, temptype_converted, temp_converted - ) +def tsequence_delete_timestamptz( + seq: Annotated[_ffi.CData, "const TSequence *"], t: int, connect: bool +) -> Annotated[_ffi.CData, "Temporal *"]: + seq_converted = _ffi.cast("const TSequence *", seq) + t_converted = _ffi.cast("TimestampTz", t) + result = _lib.tsequence_delete_timestamptz(seq_converted, t_converted, connect) _check_error() return result if result != _ffi.NULL else None -def tinstant_copy(inst: "const TInstant *") -> "TInstant *": - inst_converted = _ffi.cast("const TInstant *", inst) - result = _lib.tinstant_copy(inst_converted) +def tsequence_delete_tstzset( + seq: Annotated[_ffi.CData, "const TSequence *"], s: Annotated[_ffi.CData, "const Set *"], connect: bool +) -> Annotated[_ffi.CData, "Temporal *"]: + seq_converted = _ffi.cast("const TSequence *", seq) + s_converted = _ffi.cast("const Set *", s) + result = _lib.tsequence_delete_tstzset(seq_converted, s_converted, connect) _check_error() return result if result != _ffi.NULL else None -def tinstant_make(value: "Datum", temptype: "meosType", t: int) -> "TInstant *": - value_converted = _ffi.cast("Datum", value) - temptype_converted = _ffi.cast("meosType", temptype) - t_converted = _ffi.cast("TimestampTz", t) - result = _lib.tinstant_make(value_converted, temptype_converted, t_converted) +def tsequence_delete_tstzspan( + seq: Annotated[_ffi.CData, "const TSequence *"], s: Annotated[_ffi.CData, "const Span *"], connect: bool +) -> Annotated[_ffi.CData, "Temporal *"]: + seq_converted = _ffi.cast("const TSequence *", seq) + s_converted = _ffi.cast("const Span *", s) + result = _lib.tsequence_delete_tstzspan(seq_converted, s_converted, connect) _check_error() return result if result != _ffi.NULL else None -def tinstant_make_free(value: "Datum", temptype: "meosType", t: int) -> "TInstant *": - value_converted = _ffi.cast("Datum", value) - temptype_converted = _ffi.cast("meosType", temptype) - t_converted = _ffi.cast("TimestampTz", t) - result = _lib.tinstant_make_free(value_converted, temptype_converted, t_converted) +def tsequence_delete_tstzspanset( + seq: Annotated[_ffi.CData, "const TSequence *"], ss: Annotated[_ffi.CData, "const SpanSet *"], connect: bool +) -> Annotated[_ffi.CData, "Temporal *"]: + seq_converted = _ffi.cast("const TSequence *", seq) + ss_converted = _ffi.cast("const SpanSet *", ss) + result = _lib.tsequence_delete_tstzspanset(seq_converted, ss_converted, connect) _check_error() return result if result != _ffi.NULL else None -def tpointseq_make_coords( - xcoords: "const double *", - ycoords: "const double *", - zcoords: "const double *", - times: int, - count: int, - srid: int, - geodetic: bool, - lower_inc: bool, - upper_inc: bool, - interp: "interpType", - normalize: bool, -) -> "TSequence *": - xcoords_converted = _ffi.cast("const double *", xcoords) - ycoords_converted = _ffi.cast("const double *", ycoords) - zcoords_converted = _ffi.cast("const double *", zcoords) - times_converted = _ffi.cast("const TimestampTz *", times) - srid_converted = _ffi.cast("int32", srid) - interp_converted = _ffi.cast("interpType", interp) - result = _lib.tpointseq_make_coords( - xcoords_converted, - ycoords_converted, - zcoords_converted, - times_converted, - count, - srid_converted, - geodetic, - lower_inc, - upper_inc, - interp_converted, - normalize, - ) +def tsequence_insert( + seq1: Annotated[_ffi.CData, "const TSequence *"], seq2: Annotated[_ffi.CData, "const TSequence *"], connect: bool +) -> Annotated[_ffi.CData, "Temporal *"]: + seq1_converted = _ffi.cast("const TSequence *", seq1) + seq2_converted = _ffi.cast("const TSequence *", seq2) + result = _lib.tsequence_insert(seq1_converted, seq2_converted, connect) _check_error() return result if result != _ffi.NULL else None -def tsequence_copy(seq: "const TSequence *") -> "TSequence *": - seq_converted = _ffi.cast("const TSequence *", seq) - result = _lib.tsequence_copy(seq_converted) +def tsequence_merge( + seq1: Annotated[_ffi.CData, "const TSequence *"], seq2: Annotated[_ffi.CData, "const TSequence *"] +) -> Annotated[_ffi.CData, "Temporal *"]: + seq1_converted = _ffi.cast("const TSequence *", seq1) + seq2_converted = _ffi.cast("const TSequence *", seq2) + result = _lib.tsequence_merge(seq1_converted, seq2_converted) _check_error() return result if result != _ffi.NULL else None -def tsequence_from_base_tstzset( - value: "Datum", temptype: "meosType", ss: "const Set *" -) -> "TSequence *": - value_converted = _ffi.cast("Datum", value) - temptype_converted = _ffi.cast("meosType", temptype) - ss_converted = _ffi.cast("const Set *", ss) - result = _lib.tsequence_from_base_tstzset( - value_converted, temptype_converted, ss_converted - ) +def tsequence_merge_array( + sequences: Annotated[list, "const TSequence **"], count: int +) -> Annotated[_ffi.CData, "Temporal *"]: + sequences_converted = [_ffi.cast("const TSequence *", x) for x in sequences] + result = _lib.tsequence_merge_array(sequences_converted, count) _check_error() return result if result != _ffi.NULL else None -def tsequence_from_base_tstzspan( - value: "Datum", temptype: "meosType", s: "const Span *", interp: "interpType" -) -> "TSequence *": - value_converted = _ffi.cast("Datum", value) - temptype_converted = _ffi.cast("meosType", temptype) - s_converted = _ffi.cast("const Span *", s) - interp_converted = _ffi.cast("interpType", interp) - result = _lib.tsequence_from_base_tstzspan( - value_converted, temptype_converted, s_converted, interp_converted - ) +def tsequenceset_append_tinstant( + ss: Annotated[_ffi.CData, "TSequenceSet *"], + inst: Annotated[_ffi.CData, "const TInstant *"], + maxdist: float, + maxt: Annotated[_ffi.CData, "const Interval *"], + expand: bool, +) -> Annotated[_ffi.CData, "TSequenceSet *"]: + ss_converted = _ffi.cast("TSequenceSet *", ss) + inst_converted = _ffi.cast("const TInstant *", inst) + maxt_converted = _ffi.cast("const Interval *", maxt) + result = _lib.tsequenceset_append_tinstant(ss_converted, inst_converted, maxdist, maxt_converted, expand) _check_error() return result if result != _ffi.NULL else None -def tsequence_make_exp( - instants: "const TInstant **", - count: int, - maxcount: int, - lower_inc: bool, - upper_inc: bool, - interp: "interpType", - normalize: bool, -) -> "TSequence *": - instants_converted = [_ffi.cast("const TInstant *", x) for x in instants] - interp_converted = _ffi.cast("interpType", interp) - result = _lib.tsequence_make_exp( - instants_converted, - count, - maxcount, - lower_inc, - upper_inc, - interp_converted, - normalize, - ) +def tsequenceset_append_tsequence( + ss: Annotated[_ffi.CData, "TSequenceSet *"], seq: Annotated[_ffi.CData, "const TSequence *"], expand: bool +) -> Annotated[_ffi.CData, "TSequenceSet *"]: + ss_converted = _ffi.cast("TSequenceSet *", ss) + seq_converted = _ffi.cast("const TSequence *", seq) + result = _lib.tsequenceset_append_tsequence(ss_converted, seq_converted, expand) _check_error() return result if result != _ffi.NULL else None -def tsequence_make_free( - instants: "TInstant **", - count: int, - lower_inc: bool, - upper_inc: bool, - interp: "interpType", - normalize: bool, -) -> "TSequence *": - instants_converted = [_ffi.cast("TInstant *", x) for x in instants] - interp_converted = _ffi.cast("interpType", interp) - result = _lib.tsequence_make_free( - instants_converted, count, lower_inc, upper_inc, interp_converted, normalize - ) +def tsequenceset_delete_timestamptz( + ss: Annotated[_ffi.CData, "const TSequenceSet *"], t: int +) -> Annotated[_ffi.CData, "TSequenceSet *"]: + ss_converted = _ffi.cast("const TSequenceSet *", ss) + t_converted = _ffi.cast("TimestampTz", t) + result = _lib.tsequenceset_delete_timestamptz(ss_converted, t_converted) _check_error() return result if result != _ffi.NULL else None -def tsequenceset_copy(ss: "const TSequenceSet *") -> "TSequenceSet *": +def tsequenceset_delete_tstzset( + ss: Annotated[_ffi.CData, "const TSequenceSet *"], s: Annotated[_ffi.CData, "const Set *"] +) -> Annotated[_ffi.CData, "TSequenceSet *"]: ss_converted = _ffi.cast("const TSequenceSet *", ss) - result = _lib.tsequenceset_copy(ss_converted) + s_converted = _ffi.cast("const Set *", s) + result = _lib.tsequenceset_delete_tstzset(ss_converted, s_converted) _check_error() return result if result != _ffi.NULL else None -def tseqsetarr_to_tseqset( - seqsets: "TSequenceSet **", count: int, totalseqs: int -) -> "TSequenceSet *": - seqsets_converted = [_ffi.cast("TSequenceSet *", x) for x in seqsets] - result = _lib.tseqsetarr_to_tseqset(seqsets_converted, count, totalseqs) +def tsequenceset_delete_tstzspan( + ss: Annotated[_ffi.CData, "const TSequenceSet *"], s: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[_ffi.CData, "TSequenceSet *"]: + ss_converted = _ffi.cast("const TSequenceSet *", ss) + s_converted = _ffi.cast("const Span *", s) + result = _lib.tsequenceset_delete_tstzspan(ss_converted, s_converted) _check_error() return result if result != _ffi.NULL else None -def tsequenceset_from_base_tstzspanset( - value: "Datum", temptype: "meosType", ss: "const SpanSet *", interp: "interpType" -) -> "TSequenceSet *": - value_converted = _ffi.cast("Datum", value) - temptype_converted = _ffi.cast("meosType", temptype) - ss_converted = _ffi.cast("const SpanSet *", ss) - interp_converted = _ffi.cast("interpType", interp) - result = _lib.tsequenceset_from_base_tstzspanset( - value_converted, temptype_converted, ss_converted, interp_converted - ) +def tsequenceset_delete_tstzspanset( + ss: Annotated[_ffi.CData, "const TSequenceSet *"], ps: Annotated[_ffi.CData, "const SpanSet *"] +) -> Annotated[_ffi.CData, "TSequenceSet *"]: + ss_converted = _ffi.cast("const TSequenceSet *", ss) + ps_converted = _ffi.cast("const SpanSet *", ps) + result = _lib.tsequenceset_delete_tstzspanset(ss_converted, ps_converted) _check_error() return result if result != _ffi.NULL else None -def tsequenceset_make_exp( - sequences: "const TSequence **", count: int, maxcount: int, normalize: bool -) -> "TSequenceSet *": - sequences_converted = [_ffi.cast("const TSequence *", x) for x in sequences] - result = _lib.tsequenceset_make_exp(sequences_converted, count, maxcount, normalize) +def tsequenceset_insert( + ss1: Annotated[_ffi.CData, "const TSequenceSet *"], ss2: Annotated[_ffi.CData, "const TSequenceSet *"] +) -> Annotated[_ffi.CData, "TSequenceSet *"]: + ss1_converted = _ffi.cast("const TSequenceSet *", ss1) + ss2_converted = _ffi.cast("const TSequenceSet *", ss2) + result = _lib.tsequenceset_insert(ss1_converted, ss2_converted) _check_error() return result if result != _ffi.NULL else None -def tsequenceset_make_free( - sequences: "TSequence **", count: int, normalize: bool -) -> "TSequenceSet *": - sequences_converted = [_ffi.cast("TSequence *", x) for x in sequences] - result = _lib.tsequenceset_make_free(sequences_converted, count, normalize) +def tsequenceset_merge( + ss1: Annotated[_ffi.CData, "const TSequenceSet *"], ss2: Annotated[_ffi.CData, "const TSequenceSet *"] +) -> Annotated[_ffi.CData, "TSequenceSet *"]: + ss1_converted = _ffi.cast("const TSequenceSet *", ss1) + ss2_converted = _ffi.cast("const TSequenceSet *", ss2) + result = _lib.tsequenceset_merge(ss1_converted, ss2_converted) _check_error() return result if result != _ffi.NULL else None -def temporal_set_tstzspan(temp: "const Temporal *", s: "Span *") -> None: - temp_converted = _ffi.cast("const Temporal *", temp) - s_converted = _ffi.cast("Span *", s) - _lib.temporal_set_tstzspan(temp_converted, s_converted) +def tsequenceset_merge_array( + seqsets: Annotated[list, "const TSequenceSet **"], count: int +) -> Annotated[_ffi.CData, "TSequenceSet *"]: + seqsets_converted = [_ffi.cast("const TSequenceSet *", x) for x in seqsets] + result = _lib.tsequenceset_merge_array(seqsets_converted, count) _check_error() + return result if result != _ffi.NULL else None -def tinstant_set_tstzspan(inst: "const TInstant *", s: "Span *") -> None: +def tsequence_expand_bbox( + seq: Annotated[_ffi.CData, "TSequence *"], inst: Annotated[_ffi.CData, "const TInstant *"] +) -> Annotated[None, "void"]: + seq_converted = _ffi.cast("TSequence *", seq) inst_converted = _ffi.cast("const TInstant *", inst) - s_converted = _ffi.cast("Span *", s) - _lib.tinstant_set_tstzspan(inst_converted, s_converted) - _check_error() - - -def tnumber_set_tbox(temp: "const Temporal *", box: "TBox *") -> None: - temp_converted = _ffi.cast("const Temporal *", temp) - box_converted = _ffi.cast("TBox *", box) - _lib.tnumber_set_tbox(temp_converted, box_converted) - _check_error() - - -def tnumber_span(temp: "const Temporal *") -> "Span *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tnumber_span(temp_converted) + _lib.tsequence_expand_bbox(seq_converted, inst_converted) _check_error() - return result if result != _ffi.NULL else None -def tnumberinst_set_tbox(inst: "const TInstant *", box: "TBox *") -> None: - inst_converted = _ffi.cast("const TInstant *", inst) - box_converted = _ffi.cast("TBox *", box) - _lib.tnumberinst_set_tbox(inst_converted, box_converted) +def tsequence_set_bbox( + seq: Annotated[_ffi.CData, "const TSequence *"], box: Annotated[_ffi.CData, "void *"] +) -> Annotated[None, "void"]: + seq_converted = _ffi.cast("const TSequence *", seq) + box_converted = _ffi.cast("void *", box) + _lib.tsequence_set_bbox(seq_converted, box_converted) _check_error() -def tnumberseq_set_tbox(seq: "const TSequence *", box: "TBox *") -> None: +def tsequenceset_expand_bbox( + ss: Annotated[_ffi.CData, "TSequenceSet *"], seq: Annotated[_ffi.CData, "const TSequence *"] +) -> Annotated[None, "void"]: + ss_converted = _ffi.cast("TSequenceSet *", ss) seq_converted = _ffi.cast("const TSequence *", seq) - box_converted = _ffi.cast("TBox *", box) - _lib.tnumberseq_set_tbox(seq_converted, box_converted) + _lib.tsequenceset_expand_bbox(ss_converted, seq_converted) _check_error() -def tnumberseqset_set_tbox(ss: "const TSequenceSet *", box: "TBox *") -> None: +def tsequenceset_set_bbox( + ss: Annotated[_ffi.CData, "const TSequenceSet *"], box: Annotated[_ffi.CData, "void *"] +) -> Annotated[None, "void"]: ss_converted = _ffi.cast("const TSequenceSet *", ss) - box_converted = _ffi.cast("TBox *", box) - _lib.tnumberseqset_set_tbox(ss_converted, box_converted) + box_converted = _ffi.cast("void *", box) + _lib.tsequenceset_set_bbox(ss_converted, box_converted) _check_error() -def tsequence_set_tstzspan(seq: "const TSequence *", s: "Span *") -> None: +def tdiscseq_restrict_minmax( + seq: Annotated[_ffi.CData, "const TSequence *"], min: bool, atfunc: bool +) -> Annotated[_ffi.CData, "TSequence *"]: seq_converted = _ffi.cast("const TSequence *", seq) - s_converted = _ffi.cast("Span *", s) - _lib.tsequence_set_tstzspan(seq_converted, s_converted) + result = _lib.tdiscseq_restrict_minmax(seq_converted, min, atfunc) _check_error() + return result if result != _ffi.NULL else None -def tsequenceset_set_tstzspan(ss: "const TSequenceSet *", s: "Span *") -> None: - ss_converted = _ffi.cast("const TSequenceSet *", ss) - s_converted = _ffi.cast("Span *", s) - _lib.tsequenceset_set_tstzspan(ss_converted, s_converted) +def tcontseq_restrict_minmax( + seq: Annotated[_ffi.CData, "const TSequence *"], min: bool, atfunc: bool +) -> Annotated[_ffi.CData, "TSequenceSet *"]: + seq_converted = _ffi.cast("const TSequence *", seq) + result = _lib.tcontseq_restrict_minmax(seq_converted, min, atfunc) _check_error() + return result if result != _ffi.NULL else None -def temporal_end_value(temp: "const Temporal *") -> "Datum": +def temporal_bbox_restrict_set( + temp: Annotated[_ffi.CData, "const Temporal *"], set: Annotated[_ffi.CData, "const Set *"] +) -> Annotated[bool, "bool"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.temporal_end_value(temp_converted) + set_converted = _ffi.cast("const Set *", set) + result = _lib.temporal_bbox_restrict_set(temp_converted, set_converted) _check_error() return result if result != _ffi.NULL else None -def temporal_insts(temp: "const Temporal *") -> "Tuple['const TInstant **', 'int']": +def temporal_restrict_minmax( + temp: Annotated[_ffi.CData, "const Temporal *"], min: bool, atfunc: bool +) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - count = _ffi.new("int *") - result = _lib.temporal_insts(temp_converted, count) + result = _lib.temporal_restrict_minmax(temp_converted, min, atfunc) _check_error() - return result if result != _ffi.NULL else None, count[0] + return result if result != _ffi.NULL else None -def temporal_max_value(temp: "const Temporal *") -> "Datum": +def temporal_restrict_timestamptz( + temp: Annotated[_ffi.CData, "const Temporal *"], t: int, atfunc: bool +) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.temporal_max_value(temp_converted) + t_converted = _ffi.cast("TimestampTz", t) + result = _lib.temporal_restrict_timestamptz(temp_converted, t_converted, atfunc) _check_error() return result if result != _ffi.NULL else None -def temporal_mem_size(temp: "const Temporal *") -> "size_t": +def temporal_restrict_tstzset( + temp: Annotated[_ffi.CData, "const Temporal *"], s: Annotated[_ffi.CData, "const Set *"], atfunc: bool +) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.temporal_mem_size(temp_converted) + s_converted = _ffi.cast("const Set *", s) + result = _lib.temporal_restrict_tstzset(temp_converted, s_converted, atfunc) _check_error() return result if result != _ffi.NULL else None -def temporal_min_value(temp: "const Temporal *") -> "Datum": +def temporal_restrict_tstzspan( + temp: Annotated[_ffi.CData, "const Temporal *"], s: Annotated[_ffi.CData, "const Span *"], atfunc: bool +) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.temporal_min_value(temp_converted) + s_converted = _ffi.cast("const Span *", s) + result = _lib.temporal_restrict_tstzspan(temp_converted, s_converted, atfunc) _check_error() return result if result != _ffi.NULL else None -def temporal_seqs(temp: "const Temporal *") -> "Tuple['const TSequence **', 'int']": +def temporal_restrict_tstzspanset( + temp: Annotated[_ffi.CData, "const Temporal *"], ss: Annotated[_ffi.CData, "const SpanSet *"], atfunc: bool +) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - count = _ffi.new("int *") - result = _lib.temporal_seqs(temp_converted, count) + ss_converted = _ffi.cast("const SpanSet *", ss) + result = _lib.temporal_restrict_tstzspanset(temp_converted, ss_converted, atfunc) _check_error() - return result if result != _ffi.NULL else None, count[0] + return result if result != _ffi.NULL else None -def temporal_set_bbox(temp: "const Temporal *", box: "void *") -> None: +def temporal_restrict_value( + temp: Annotated[_ffi.CData, "const Temporal *"], value: Annotated[_ffi.CData, "Datum"], atfunc: bool +) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - box_converted = _ffi.cast("void *", box) - _lib.temporal_set_bbox(temp_converted, box_converted) + value_converted = _ffi.cast("Datum", value) + result = _lib.temporal_restrict_value(temp_converted, value_converted, atfunc) _check_error() + return result if result != _ffi.NULL else None -def temporal_vals(temp: "const Temporal *") -> "Tuple['Datum *', 'int']": +def temporal_restrict_values( + temp: Annotated[_ffi.CData, "const Temporal *"], set: Annotated[_ffi.CData, "const Set *"], atfunc: bool +) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - count = _ffi.new("int *") - result = _lib.temporal_vals(temp_converted, count) + set_converted = _ffi.cast("const Set *", set) + result = _lib.temporal_restrict_values(temp_converted, set_converted, atfunc) _check_error() - return result if result != _ffi.NULL else None, count[0] + return result if result != _ffi.NULL else None -def temporal_value_n(temp: "const Temporal *", n: int) -> "Datum *": +def temporal_value_at_timestamptz( + temp: Annotated[_ffi.CData, "const Temporal *"], t: int, strict: bool +) -> Annotated[_ffi.CData, "Datum *"]: temp_converted = _ffi.cast("const Temporal *", temp) + t_converted = _ffi.cast("TimestampTz", t) out_result = _ffi.new("Datum *") - result = _lib.temporal_value_n(temp_converted, n, out_result) + result = _lib.temporal_value_at_timestamptz(temp_converted, t_converted, strict, out_result) _check_error() if result: return out_result if out_result != _ffi.NULL else None return None -def temporal_values(temp: "const Temporal *") -> "Tuple['Datum *', 'int']": - temp_converted = _ffi.cast("const Temporal *", temp) - count = _ffi.new("int *") - result = _lib.temporal_values(temp_converted, count) +def tinstant_restrict_tstzspan( + inst: Annotated[_ffi.CData, "const TInstant *"], period: Annotated[_ffi.CData, "const Span *"], atfunc: bool +) -> Annotated[_ffi.CData, "TInstant *"]: + inst_converted = _ffi.cast("const TInstant *", inst) + period_converted = _ffi.cast("const Span *", period) + result = _lib.tinstant_restrict_tstzspan(inst_converted, period_converted, atfunc) _check_error() - return result if result != _ffi.NULL else None, count[0] + return result if result != _ffi.NULL else None -def tinstant_hash(inst: "const TInstant *") -> "uint32": +def tinstant_restrict_tstzspanset( + inst: Annotated[_ffi.CData, "const TInstant *"], ss: Annotated[_ffi.CData, "const SpanSet *"], atfunc: bool +) -> Annotated[_ffi.CData, "TInstant *"]: inst_converted = _ffi.cast("const TInstant *", inst) - result = _lib.tinstant_hash(inst_converted) + ss_converted = _ffi.cast("const SpanSet *", ss) + result = _lib.tinstant_restrict_tstzspanset(inst_converted, ss_converted, atfunc) _check_error() return result if result != _ffi.NULL else None -def tinstant_insts(inst: "const TInstant *") -> "Tuple['const TInstant **', 'int']": +def tinstant_restrict_timestamptz( + inst: Annotated[_ffi.CData, "const TInstant *"], t: int, atfunc: bool +) -> Annotated[_ffi.CData, "TInstant *"]: inst_converted = _ffi.cast("const TInstant *", inst) - count = _ffi.new("int *") - result = _lib.tinstant_insts(inst_converted, count) + t_converted = _ffi.cast("TimestampTz", t) + result = _lib.tinstant_restrict_timestamptz(inst_converted, t_converted, atfunc) _check_error() - return result if result != _ffi.NULL else None, count[0] + return result if result != _ffi.NULL else None -def tinstant_set_bbox(inst: "const TInstant *", box: "void *") -> None: +def tinstant_restrict_tstzset( + inst: Annotated[_ffi.CData, "const TInstant *"], s: Annotated[_ffi.CData, "const Set *"], atfunc: bool +) -> Annotated[_ffi.CData, "TInstant *"]: inst_converted = _ffi.cast("const TInstant *", inst) - box_converted = _ffi.cast("void *", box) - _lib.tinstant_set_bbox(inst_converted, box_converted) + s_converted = _ffi.cast("const Set *", s) + result = _lib.tinstant_restrict_tstzset(inst_converted, s_converted, atfunc) _check_error() + return result if result != _ffi.NULL else None -def tinstant_time(inst: "const TInstant *") -> "SpanSet *": +def tinstant_restrict_value( + inst: Annotated[_ffi.CData, "const TInstant *"], value: Annotated[_ffi.CData, "Datum"], atfunc: bool +) -> Annotated[_ffi.CData, "TInstant *"]: inst_converted = _ffi.cast("const TInstant *", inst) - result = _lib.tinstant_time(inst_converted) + value_converted = _ffi.cast("Datum", value) + result = _lib.tinstant_restrict_value(inst_converted, value_converted, atfunc) _check_error() return result if result != _ffi.NULL else None -def tinstant_timestamps(inst: "const TInstant *") -> "Tuple['TimestampTz *', 'int']": +def tinstant_restrict_values( + inst: Annotated[_ffi.CData, "const TInstant *"], set: Annotated[_ffi.CData, "const Set *"], atfunc: bool +) -> Annotated[_ffi.CData, "TInstant *"]: inst_converted = _ffi.cast("const TInstant *", inst) - count = _ffi.new("int *") - result = _lib.tinstant_timestamps(inst_converted, count) + set_converted = _ffi.cast("const Set *", set) + result = _lib.tinstant_restrict_values(inst_converted, set_converted, atfunc) _check_error() - return result if result != _ffi.NULL else None, count[0] + return result if result != _ffi.NULL else None -def tinstant_val(inst: "const TInstant *") -> "Datum": - inst_converted = _ffi.cast("const TInstant *", inst) - result = _lib.tinstant_val(inst_converted) +def tnumber_restrict_span( + temp: Annotated[_ffi.CData, "const Temporal *"], span: Annotated[_ffi.CData, "const Span *"], atfunc: bool +) -> Annotated[_ffi.CData, "Temporal *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + span_converted = _ffi.cast("const Span *", span) + result = _lib.tnumber_restrict_span(temp_converted, span_converted, atfunc) + _check_error() + return result if result != _ffi.NULL else None + + +def tnumber_restrict_spanset( + temp: Annotated[_ffi.CData, "const Temporal *"], ss: Annotated[_ffi.CData, "const SpanSet *"], atfunc: bool +) -> Annotated[_ffi.CData, "Temporal *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + ss_converted = _ffi.cast("const SpanSet *", ss) + result = _lib.tnumber_restrict_spanset(temp_converted, ss_converted, atfunc) _check_error() return result if result != _ffi.NULL else None -def tinstant_value(inst: "const TInstant *") -> "Datum": +def tnumberinst_restrict_span( + inst: Annotated[_ffi.CData, "const TInstant *"], span: Annotated[_ffi.CData, "const Span *"], atfunc: bool +) -> Annotated[_ffi.CData, "TInstant *"]: inst_converted = _ffi.cast("const TInstant *", inst) - result = _lib.tinstant_value(inst_converted) + span_converted = _ffi.cast("const Span *", span) + result = _lib.tnumberinst_restrict_span(inst_converted, span_converted, atfunc) _check_error() return result if result != _ffi.NULL else None -def tinstant_value_at_timestamptz(inst: "const TInstant *", t: int) -> "Datum *": +def tnumberinst_restrict_spanset( + inst: Annotated[_ffi.CData, "const TInstant *"], ss: Annotated[_ffi.CData, "const SpanSet *"], atfunc: bool +) -> Annotated[_ffi.CData, "TInstant *"]: inst_converted = _ffi.cast("const TInstant *", inst) + ss_converted = _ffi.cast("const SpanSet *", ss) + result = _lib.tnumberinst_restrict_spanset(inst_converted, ss_converted, atfunc) + _check_error() + return result if result != _ffi.NULL else None + + +def tnumberseqset_restrict_span( + ss: Annotated[_ffi.CData, "const TSequenceSet *"], span: Annotated[_ffi.CData, "const Span *"], atfunc: bool +) -> Annotated[_ffi.CData, "TSequenceSet *"]: + ss_converted = _ffi.cast("const TSequenceSet *", ss) + span_converted = _ffi.cast("const Span *", span) + result = _lib.tnumberseqset_restrict_span(ss_converted, span_converted, atfunc) + _check_error() + return result if result != _ffi.NULL else None + + +def tnumberseqset_restrict_spanset( + ss: Annotated[_ffi.CData, "const TSequenceSet *"], spanset: Annotated[_ffi.CData, "const SpanSet *"], atfunc: bool +) -> Annotated[_ffi.CData, "TSequenceSet *"]: + ss_converted = _ffi.cast("const TSequenceSet *", ss) + spanset_converted = _ffi.cast("const SpanSet *", spanset) + result = _lib.tnumberseqset_restrict_spanset(ss_converted, spanset_converted, atfunc) + _check_error() + return result if result != _ffi.NULL else None + + +def tsequence_at_timestamptz( + seq: Annotated[_ffi.CData, "const TSequence *"], t: int +) -> Annotated[_ffi.CData, "TInstant *"]: + seq_converted = _ffi.cast("const TSequence *", seq) t_converted = _ffi.cast("TimestampTz", t) - out_result = _ffi.new("Datum *") - result = _lib.tinstant_value_at_timestamptz(inst_converted, t_converted, out_result) + result = _lib.tsequence_at_timestamptz(seq_converted, t_converted) _check_error() - if result: - return out_result if out_result != _ffi.NULL else None - return None + return result if result != _ffi.NULL else None + + +def tsequence_restrict_tstzspan( + seq: Annotated[_ffi.CData, "const TSequence *"], s: Annotated[_ffi.CData, "const Span *"], atfunc: bool +) -> Annotated[_ffi.CData, "Temporal *"]: + seq_converted = _ffi.cast("const TSequence *", seq) + s_converted = _ffi.cast("const Span *", s) + result = _lib.tsequence_restrict_tstzspan(seq_converted, s_converted, atfunc) + _check_error() + return result if result != _ffi.NULL else None + + +def tsequence_restrict_tstzspanset( + seq: Annotated[_ffi.CData, "const TSequence *"], ss: Annotated[_ffi.CData, "const SpanSet *"], atfunc: bool +) -> Annotated[_ffi.CData, "Temporal *"]: + seq_converted = _ffi.cast("const TSequence *", seq) + ss_converted = _ffi.cast("const SpanSet *", ss) + result = _lib.tsequence_restrict_tstzspanset(seq_converted, ss_converted, atfunc) + _check_error() + return result if result != _ffi.NULL else None + + +def tsequenceset_restrict_minmax( + ss: Annotated[_ffi.CData, "const TSequenceSet *"], min: bool, atfunc: bool +) -> Annotated[_ffi.CData, "TSequenceSet *"]: + ss_converted = _ffi.cast("const TSequenceSet *", ss) + result = _lib.tsequenceset_restrict_minmax(ss_converted, min, atfunc) + _check_error() + return result if result != _ffi.NULL else None + + +def tsequenceset_restrict_tstzspan( + ss: Annotated[_ffi.CData, "const TSequenceSet *"], s: Annotated[_ffi.CData, "const Span *"], atfunc: bool +) -> Annotated[_ffi.CData, "TSequenceSet *"]: + ss_converted = _ffi.cast("const TSequenceSet *", ss) + s_converted = _ffi.cast("const Span *", s) + result = _lib.tsequenceset_restrict_tstzspan(ss_converted, s_converted, atfunc) + _check_error() + return result if result != _ffi.NULL else None + + +def tsequenceset_restrict_tstzspanset( + ss: Annotated[_ffi.CData, "const TSequenceSet *"], ps: Annotated[_ffi.CData, "const SpanSet *"], atfunc: bool +) -> Annotated[_ffi.CData, "TSequenceSet *"]: + ss_converted = _ffi.cast("const TSequenceSet *", ss) + ps_converted = _ffi.cast("const SpanSet *", ps) + result = _lib.tsequenceset_restrict_tstzspanset(ss_converted, ps_converted, atfunc) + _check_error() + return result if result != _ffi.NULL else None + + +def tsequenceset_restrict_timestamptz( + ss: Annotated[_ffi.CData, "const TSequenceSet *"], t: int, atfunc: bool +) -> Annotated[_ffi.CData, "Temporal *"]: + ss_converted = _ffi.cast("const TSequenceSet *", ss) + t_converted = _ffi.cast("TimestampTz", t) + result = _lib.tsequenceset_restrict_timestamptz(ss_converted, t_converted, atfunc) + _check_error() + return result if result != _ffi.NULL else None + + +def tsequenceset_restrict_tstzset( + ss: Annotated[_ffi.CData, "const TSequenceSet *"], s: Annotated[_ffi.CData, "const Set *"], atfunc: bool +) -> Annotated[_ffi.CData, "Temporal *"]: + ss_converted = _ffi.cast("const TSequenceSet *", ss) + s_converted = _ffi.cast("const Set *", s) + result = _lib.tsequenceset_restrict_tstzset(ss_converted, s_converted, atfunc) + _check_error() + return result if result != _ffi.NULL else None -def tinstant_vals(inst: "const TInstant *") -> "Tuple['Datum *', 'int']": - inst_converted = _ffi.cast("const TInstant *", inst) - count = _ffi.new("int *") - result = _lib.tinstant_vals(inst_converted, count) +def tsequenceset_restrict_value( + ss: Annotated[_ffi.CData, "const TSequenceSet *"], value: Annotated[_ffi.CData, "Datum"], atfunc: bool +) -> Annotated[_ffi.CData, "TSequenceSet *"]: + ss_converted = _ffi.cast("const TSequenceSet *", ss) + value_converted = _ffi.cast("Datum", value) + result = _lib.tsequenceset_restrict_value(ss_converted, value_converted, atfunc) _check_error() - return result if result != _ffi.NULL else None, count[0] + return result if result != _ffi.NULL else None -def tnumber_set_span(temp: "const Temporal *", span: "Span *") -> None: - temp_converted = _ffi.cast("const Temporal *", temp) - span_converted = _ffi.cast("Span *", span) - _lib.tnumber_set_span(temp_converted, span_converted) +def tsequenceset_restrict_values( + ss: Annotated[_ffi.CData, "const TSequenceSet *"], s: Annotated[_ffi.CData, "const Set *"], atfunc: bool +) -> Annotated[_ffi.CData, "TSequenceSet *"]: + ss_converted = _ffi.cast("const TSequenceSet *", ss) + s_converted = _ffi.cast("const Set *", s) + result = _lib.tsequenceset_restrict_values(ss_converted, s_converted, atfunc) _check_error() + return result if result != _ffi.NULL else None -def tnumberinst_valuespans(inst: "const TInstant *") -> "SpanSet *": - inst_converted = _ffi.cast("const TInstant *", inst) - result = _lib.tnumberinst_valuespans(inst_converted) +def tinstant_cmp( + inst1: Annotated[_ffi.CData, "const TInstant *"], inst2: Annotated[_ffi.CData, "const TInstant *"] +) -> Annotated[int, "int"]: + inst1_converted = _ffi.cast("const TInstant *", inst1) + inst2_converted = _ffi.cast("const TInstant *", inst2) + result = _lib.tinstant_cmp(inst1_converted, inst2_converted) _check_error() return result if result != _ffi.NULL else None -def tnumberseq_valuespans(seq: "const TSequence *") -> "SpanSet *": - seq_converted = _ffi.cast("const TSequence *", seq) - result = _lib.tnumberseq_valuespans(seq_converted) +def tinstant_eq( + inst1: Annotated[_ffi.CData, "const TInstant *"], inst2: Annotated[_ffi.CData, "const TInstant *"] +) -> Annotated[bool, "bool"]: + inst1_converted = _ffi.cast("const TInstant *", inst1) + inst2_converted = _ffi.cast("const TInstant *", inst2) + result = _lib.tinstant_eq(inst1_converted, inst2_converted) _check_error() return result if result != _ffi.NULL else None -def tnumberseqset_valuespans(ss: "const TSequenceSet *") -> "SpanSet *": - ss_converted = _ffi.cast("const TSequenceSet *", ss) - result = _lib.tnumberseqset_valuespans(ss_converted) +def tsequence_cmp( + seq1: Annotated[_ffi.CData, "const TSequence *"], seq2: Annotated[_ffi.CData, "const TSequence *"] +) -> Annotated[int, "int"]: + seq1_converted = _ffi.cast("const TSequence *", seq1) + seq2_converted = _ffi.cast("const TSequence *", seq2) + result = _lib.tsequence_cmp(seq1_converted, seq2_converted) _check_error() return result if result != _ffi.NULL else None -def tsequence_duration(seq: "const TSequence *") -> "Interval *": - seq_converted = _ffi.cast("const TSequence *", seq) - result = _lib.tsequence_duration(seq_converted) +def tsequence_eq( + seq1: Annotated[_ffi.CData, "const TSequence *"], seq2: Annotated[_ffi.CData, "const TSequence *"] +) -> Annotated[bool, "bool"]: + seq1_converted = _ffi.cast("const TSequence *", seq1) + seq2_converted = _ffi.cast("const TSequence *", seq2) + result = _lib.tsequence_eq(seq1_converted, seq2_converted) _check_error() return result if result != _ffi.NULL else None -def tsequence_end_timestamptz(seq: "const TSequence *") -> "TimestampTz": - seq_converted = _ffi.cast("const TSequence *", seq) - result = _lib.tsequence_end_timestamptz(seq_converted) +def tsequenceset_cmp( + ss1: Annotated[_ffi.CData, "const TSequenceSet *"], ss2: Annotated[_ffi.CData, "const TSequenceSet *"] +) -> Annotated[int, "int"]: + ss1_converted = _ffi.cast("const TSequenceSet *", ss1) + ss2_converted = _ffi.cast("const TSequenceSet *", ss2) + result = _lib.tsequenceset_cmp(ss1_converted, ss2_converted) _check_error() return result if result != _ffi.NULL else None -def tsequence_hash(seq: "const TSequence *") -> "uint32": - seq_converted = _ffi.cast("const TSequence *", seq) - result = _lib.tsequence_hash(seq_converted) +def tsequenceset_eq( + ss1: Annotated[_ffi.CData, "const TSequenceSet *"], ss2: Annotated[_ffi.CData, "const TSequenceSet *"] +) -> Annotated[bool, "bool"]: + ss1_converted = _ffi.cast("const TSequenceSet *", ss1) + ss2_converted = _ffi.cast("const TSequenceSet *", ss2) + result = _lib.tsequenceset_eq(ss1_converted, ss2_converted) _check_error() return result if result != _ffi.NULL else None -def tsequence_insts(seq: "const TSequence *") -> "const TInstant **": - seq_converted = _ffi.cast("const TSequence *", seq) - result = _lib.tsequence_insts(seq_converted) +def always_eq_base_temporal( + value: Annotated[_ffi.CData, "Datum"], temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[int, "int"]: + value_converted = _ffi.cast("Datum", value) + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.always_eq_base_temporal(value_converted, temp_converted) _check_error() return result if result != _ffi.NULL else None -def tsequence_max_inst(seq: "const TSequence *") -> "const TInstant *": - seq_converted = _ffi.cast("const TSequence *", seq) - result = _lib.tsequence_max_inst(seq_converted) +def always_eq_temporal_base( + temp: Annotated[_ffi.CData, "const Temporal *"], value: Annotated[_ffi.CData, "Datum"] +) -> Annotated[int, "int"]: + temp_converted = _ffi.cast("const Temporal *", temp) + value_converted = _ffi.cast("Datum", value) + result = _lib.always_eq_temporal_base(temp_converted, value_converted) _check_error() return result if result != _ffi.NULL else None -def tsequence_max_val(seq: "const TSequence *") -> "Datum": - seq_converted = _ffi.cast("const TSequence *", seq) - result = _lib.tsequence_max_val(seq_converted) +def always_ne_base_temporal( + value: Annotated[_ffi.CData, "Datum"], temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[int, "int"]: + value_converted = _ffi.cast("Datum", value) + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.always_ne_base_temporal(value_converted, temp_converted) _check_error() return result if result != _ffi.NULL else None -def tsequence_min_inst(seq: "const TSequence *") -> "const TInstant *": - seq_converted = _ffi.cast("const TSequence *", seq) - result = _lib.tsequence_min_inst(seq_converted) +def always_ne_temporal_base( + temp: Annotated[_ffi.CData, "const Temporal *"], value: Annotated[_ffi.CData, "Datum"] +) -> Annotated[int, "int"]: + temp_converted = _ffi.cast("const Temporal *", temp) + value_converted = _ffi.cast("Datum", value) + result = _lib.always_ne_temporal_base(temp_converted, value_converted) _check_error() return result if result != _ffi.NULL else None -def tsequence_min_val(seq: "const TSequence *") -> "Datum": - seq_converted = _ffi.cast("const TSequence *", seq) - result = _lib.tsequence_min_val(seq_converted) +def always_ge_base_temporal( + value: Annotated[_ffi.CData, "Datum"], temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[int, "int"]: + value_converted = _ffi.cast("Datum", value) + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.always_ge_base_temporal(value_converted, temp_converted) _check_error() return result if result != _ffi.NULL else None -def tsequence_segments(seq: "const TSequence *") -> "Tuple['TSequence **', 'int']": - seq_converted = _ffi.cast("const TSequence *", seq) - count = _ffi.new("int *") - result = _lib.tsequence_segments(seq_converted, count) +def always_ge_temporal_base( + temp: Annotated[_ffi.CData, "const Temporal *"], value: Annotated[_ffi.CData, "Datum"] +) -> Annotated[int, "int"]: + temp_converted = _ffi.cast("const Temporal *", temp) + value_converted = _ffi.cast("Datum", value) + result = _lib.always_ge_temporal_base(temp_converted, value_converted) _check_error() - return result if result != _ffi.NULL else None, count[0] + return result if result != _ffi.NULL else None -def tsequence_seqs(seq: "const TSequence *") -> "Tuple['const TSequence **', 'int']": - seq_converted = _ffi.cast("const TSequence *", seq) - count = _ffi.new("int *") - result = _lib.tsequence_seqs(seq_converted, count) +def always_gt_base_temporal( + value: Annotated[_ffi.CData, "Datum"], temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[int, "int"]: + value_converted = _ffi.cast("Datum", value) + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.always_gt_base_temporal(value_converted, temp_converted) _check_error() - return result if result != _ffi.NULL else None, count[0] + return result if result != _ffi.NULL else None -def tsequence_start_timestamptz(seq: "const TSequence *") -> "TimestampTz": - seq_converted = _ffi.cast("const TSequence *", seq) - result = _lib.tsequence_start_timestamptz(seq_converted) +def always_gt_temporal_base( + temp: Annotated[_ffi.CData, "const Temporal *"], value: Annotated[_ffi.CData, "Datum"] +) -> Annotated[int, "int"]: + temp_converted = _ffi.cast("const Temporal *", temp) + value_converted = _ffi.cast("Datum", value) + result = _lib.always_gt_temporal_base(temp_converted, value_converted) _check_error() return result if result != _ffi.NULL else None -def tsequence_time(seq: "const TSequence *") -> "SpanSet *": - seq_converted = _ffi.cast("const TSequence *", seq) - result = _lib.tsequence_time(seq_converted) +def always_le_base_temporal( + value: Annotated[_ffi.CData, "Datum"], temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[int, "int"]: + value_converted = _ffi.cast("Datum", value) + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.always_le_base_temporal(value_converted, temp_converted) _check_error() return result if result != _ffi.NULL else None -def tsequence_timestamps(seq: "const TSequence *") -> "Tuple['TimestampTz *', 'int']": - seq_converted = _ffi.cast("const TSequence *", seq) - count = _ffi.new("int *") - result = _lib.tsequence_timestamps(seq_converted, count) +def always_le_temporal_base( + temp: Annotated[_ffi.CData, "const Temporal *"], value: Annotated[_ffi.CData, "Datum"] +) -> Annotated[int, "int"]: + temp_converted = _ffi.cast("const Temporal *", temp) + value_converted = _ffi.cast("Datum", value) + result = _lib.always_le_temporal_base(temp_converted, value_converted) _check_error() - return result if result != _ffi.NULL else None, count[0] + return result if result != _ffi.NULL else None -def tsequence_value_at_timestamptz( - seq: "const TSequence *", t: int, strict: bool -) -> "Datum *": - seq_converted = _ffi.cast("const TSequence *", seq) - t_converted = _ffi.cast("TimestampTz", t) - out_result = _ffi.new("Datum *") - result = _lib.tsequence_value_at_timestamptz( - seq_converted, t_converted, strict, out_result - ) +def always_lt_base_temporal( + value: Annotated[_ffi.CData, "Datum"], temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[int, "int"]: + value_converted = _ffi.cast("Datum", value) + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.always_lt_base_temporal(value_converted, temp_converted) _check_error() - if result: - return out_result if out_result != _ffi.NULL else None - return None + return result if result != _ffi.NULL else None -def tsequence_vals(seq: "const TSequence *") -> "Tuple['Datum *', 'int']": - seq_converted = _ffi.cast("const TSequence *", seq) - count = _ffi.new("int *") - result = _lib.tsequence_vals(seq_converted, count) +def always_lt_temporal_base( + temp: Annotated[_ffi.CData, "const Temporal *"], value: Annotated[_ffi.CData, "Datum"] +) -> Annotated[int, "int"]: + temp_converted = _ffi.cast("const Temporal *", temp) + value_converted = _ffi.cast("Datum", value) + result = _lib.always_lt_temporal_base(temp_converted, value_converted) _check_error() - return result if result != _ffi.NULL else None, count[0] + return result if result != _ffi.NULL else None -def tsequenceset_duration(ss: "const TSequenceSet *", boundspan: bool) -> "Interval *": - ss_converted = _ffi.cast("const TSequenceSet *", ss) - result = _lib.tsequenceset_duration(ss_converted, boundspan) +def ever_eq_base_temporal( + value: Annotated[_ffi.CData, "Datum"], temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[int, "int"]: + value_converted = _ffi.cast("Datum", value) + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.ever_eq_base_temporal(value_converted, temp_converted) _check_error() return result if result != _ffi.NULL else None -def tsequenceset_end_timestamptz(ss: "const TSequenceSet *") -> "TimestampTz": - ss_converted = _ffi.cast("const TSequenceSet *", ss) - result = _lib.tsequenceset_end_timestamptz(ss_converted) +def ever_eq_temporal_base( + temp: Annotated[_ffi.CData, "const Temporal *"], value: Annotated[_ffi.CData, "Datum"] +) -> Annotated[int, "int"]: + temp_converted = _ffi.cast("const Temporal *", temp) + value_converted = _ffi.cast("Datum", value) + result = _lib.ever_eq_temporal_base(temp_converted, value_converted) _check_error() return result if result != _ffi.NULL else None -def tsequenceset_hash(ss: "const TSequenceSet *") -> "uint32": - ss_converted = _ffi.cast("const TSequenceSet *", ss) - result = _lib.tsequenceset_hash(ss_converted) +def ever_ne_base_temporal( + value: Annotated[_ffi.CData, "Datum"], temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[int, "int"]: + value_converted = _ffi.cast("Datum", value) + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.ever_ne_base_temporal(value_converted, temp_converted) _check_error() return result if result != _ffi.NULL else None -def tsequenceset_inst_n(ss: "const TSequenceSet *", n: int) -> "const TInstant *": - ss_converted = _ffi.cast("const TSequenceSet *", ss) - result = _lib.tsequenceset_inst_n(ss_converted, n) +def ever_ne_temporal_base( + temp: Annotated[_ffi.CData, "const Temporal *"], value: Annotated[_ffi.CData, "Datum"] +) -> Annotated[int, "int"]: + temp_converted = _ffi.cast("const Temporal *", temp) + value_converted = _ffi.cast("Datum", value) + result = _lib.ever_ne_temporal_base(temp_converted, value_converted) _check_error() return result if result != _ffi.NULL else None -def tsequenceset_insts(ss: "const TSequenceSet *") -> "const TInstant **": - ss_converted = _ffi.cast("const TSequenceSet *", ss) - result = _lib.tsequenceset_insts(ss_converted) +def ever_ge_base_temporal( + value: Annotated[_ffi.CData, "Datum"], temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[int, "int"]: + value_converted = _ffi.cast("Datum", value) + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.ever_ge_base_temporal(value_converted, temp_converted) _check_error() return result if result != _ffi.NULL else None -def tsequenceset_max_inst(ss: "const TSequenceSet *") -> "const TInstant *": - ss_converted = _ffi.cast("const TSequenceSet *", ss) - result = _lib.tsequenceset_max_inst(ss_converted) +def ever_ge_temporal_base( + temp: Annotated[_ffi.CData, "const Temporal *"], value: Annotated[_ffi.CData, "Datum"] +) -> Annotated[int, "int"]: + temp_converted = _ffi.cast("const Temporal *", temp) + value_converted = _ffi.cast("Datum", value) + result = _lib.ever_ge_temporal_base(temp_converted, value_converted) _check_error() return result if result != _ffi.NULL else None -def tsequenceset_max_val(ss: "const TSequenceSet *") -> "Datum": - ss_converted = _ffi.cast("const TSequenceSet *", ss) - result = _lib.tsequenceset_max_val(ss_converted) +def ever_gt_base_temporal( + value: Annotated[_ffi.CData, "Datum"], temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[int, "int"]: + value_converted = _ffi.cast("Datum", value) + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.ever_gt_base_temporal(value_converted, temp_converted) _check_error() return result if result != _ffi.NULL else None -def tsequenceset_min_inst(ss: "const TSequenceSet *") -> "const TInstant *": - ss_converted = _ffi.cast("const TSequenceSet *", ss) - result = _lib.tsequenceset_min_inst(ss_converted) +def ever_gt_temporal_base( + temp: Annotated[_ffi.CData, "const Temporal *"], value: Annotated[_ffi.CData, "Datum"] +) -> Annotated[int, "int"]: + temp_converted = _ffi.cast("const Temporal *", temp) + value_converted = _ffi.cast("Datum", value) + result = _lib.ever_gt_temporal_base(temp_converted, value_converted) _check_error() return result if result != _ffi.NULL else None -def tsequenceset_min_val(ss: "const TSequenceSet *") -> "Datum": - ss_converted = _ffi.cast("const TSequenceSet *", ss) - result = _lib.tsequenceset_min_val(ss_converted) +def ever_le_base_temporal( + value: Annotated[_ffi.CData, "Datum"], temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[int, "int"]: + value_converted = _ffi.cast("Datum", value) + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.ever_le_base_temporal(value_converted, temp_converted) _check_error() return result if result != _ffi.NULL else None -def tsequenceset_num_instants(ss: "const TSequenceSet *") -> "int": - ss_converted = _ffi.cast("const TSequenceSet *", ss) - result = _lib.tsequenceset_num_instants(ss_converted) +def ever_le_temporal_base( + temp: Annotated[_ffi.CData, "const Temporal *"], value: Annotated[_ffi.CData, "Datum"] +) -> Annotated[int, "int"]: + temp_converted = _ffi.cast("const Temporal *", temp) + value_converted = _ffi.cast("Datum", value) + result = _lib.ever_le_temporal_base(temp_converted, value_converted) _check_error() return result if result != _ffi.NULL else None -def tsequenceset_num_timestamps(ss: "const TSequenceSet *") -> "int": - ss_converted = _ffi.cast("const TSequenceSet *", ss) - result = _lib.tsequenceset_num_timestamps(ss_converted) +def ever_lt_base_temporal( + value: Annotated[_ffi.CData, "Datum"], temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[int, "int"]: + value_converted = _ffi.cast("Datum", value) + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.ever_lt_base_temporal(value_converted, temp_converted) _check_error() return result if result != _ffi.NULL else None -def tsequenceset_segments(ss: "const TSequenceSet *") -> "Tuple['TSequence **', 'int']": - ss_converted = _ffi.cast("const TSequenceSet *", ss) - count = _ffi.new("int *") - result = _lib.tsequenceset_segments(ss_converted, count) +def ever_lt_temporal_base( + temp: Annotated[_ffi.CData, "const Temporal *"], value: Annotated[_ffi.CData, "Datum"] +) -> Annotated[int, "int"]: + temp_converted = _ffi.cast("const Temporal *", temp) + value_converted = _ffi.cast("Datum", value) + result = _lib.ever_lt_temporal_base(temp_converted, value_converted) _check_error() - return result if result != _ffi.NULL else None, count[0] + return result if result != _ffi.NULL else None -def tsequenceset_seqs(ss: "const TSequenceSet *") -> "const TSequence **": - ss_converted = _ffi.cast("const TSequenceSet *", ss) - result = _lib.tsequenceset_seqs(ss_converted) +def tnumberinst_abs(inst: Annotated[_ffi.CData, "const TInstant *"]) -> Annotated[_ffi.CData, "TInstant *"]: + inst_converted = _ffi.cast("const TInstant *", inst) + result = _lib.tnumberinst_abs(inst_converted) _check_error() return result if result != _ffi.NULL else None -def tsequenceset_start_timestamptz(ss: "const TSequenceSet *") -> "TimestampTz": - ss_converted = _ffi.cast("const TSequenceSet *", ss) - result = _lib.tsequenceset_start_timestamptz(ss_converted) +def tnumberseq_abs(seq: Annotated[_ffi.CData, "const TSequence *"]) -> Annotated[_ffi.CData, "TSequence *"]: + seq_converted = _ffi.cast("const TSequence *", seq) + result = _lib.tnumberseq_abs(seq_converted) _check_error() return result if result != _ffi.NULL else None -def tsequenceset_time(ss: "const TSequenceSet *") -> "SpanSet *": - ss_converted = _ffi.cast("const TSequenceSet *", ss) - result = _lib.tsequenceset_time(ss_converted) +def tnumberseq_angular_difference( + seq: Annotated[_ffi.CData, "const TSequence *"], +) -> Annotated[_ffi.CData, "TSequence *"]: + seq_converted = _ffi.cast("const TSequence *", seq) + result = _lib.tnumberseq_angular_difference(seq_converted) _check_error() return result if result != _ffi.NULL else None -def tsequenceset_timestamptz_n(ss: "const TSequenceSet *", n: int) -> int: - ss_converted = _ffi.cast("const TSequenceSet *", ss) - out_result = _ffi.new("TimestampTz *") - result = _lib.tsequenceset_timestamptz_n(ss_converted, n, out_result) +def tnumberseq_delta_value(seq: Annotated[_ffi.CData, "const TSequence *"]) -> Annotated[_ffi.CData, "TSequence *"]: + seq_converted = _ffi.cast("const TSequence *", seq) + result = _lib.tnumberseq_delta_value(seq_converted) _check_error() - if result: - return out_result[0] if out_result[0] != _ffi.NULL else None - return None + return result if result != _ffi.NULL else None -def tsequenceset_timestamps( - ss: "const TSequenceSet *", -) -> "Tuple['TimestampTz *', 'int']": +def tnumberseqset_abs(ss: Annotated[_ffi.CData, "const TSequenceSet *"]) -> Annotated[_ffi.CData, "TSequenceSet *"]: ss_converted = _ffi.cast("const TSequenceSet *", ss) - count = _ffi.new("int *") - result = _lib.tsequenceset_timestamps(ss_converted, count) + result = _lib.tnumberseqset_abs(ss_converted) _check_error() - return result if result != _ffi.NULL else None, count[0] + return result if result != _ffi.NULL else None -def tsequenceset_value_at_timestamptz( - ss: "const TSequenceSet *", t: int, strict: bool -) -> "Datum *": +def tnumberseqset_angular_difference( + ss: Annotated[_ffi.CData, "const TSequenceSet *"], +) -> Annotated[_ffi.CData, "TSequence *"]: ss_converted = _ffi.cast("const TSequenceSet *", ss) - t_converted = _ffi.cast("TimestampTz", t) - out_result = _ffi.new("Datum *") - result = _lib.tsequenceset_value_at_timestamptz( - ss_converted, t_converted, strict, out_result - ) + result = _lib.tnumberseqset_angular_difference(ss_converted) _check_error() - if result: - return out_result if out_result != _ffi.NULL else None - return None + return result if result != _ffi.NULL else None -def tsequenceset_value_n(ss: "const TSequenceSet *", n: int) -> "Datum *": +def tnumberseqset_delta_value( + ss: Annotated[_ffi.CData, "const TSequenceSet *"], +) -> Annotated[_ffi.CData, "TSequenceSet *"]: ss_converted = _ffi.cast("const TSequenceSet *", ss) - out_result = _ffi.new("Datum *") - result = _lib.tsequenceset_value_n(ss_converted, n, out_result) + result = _lib.tnumberseqset_delta_value(ss_converted) _check_error() - if result: - return out_result if out_result != _ffi.NULL else None - return None + return result if result != _ffi.NULL else None -def tsequenceset_vals(ss: "const TSequenceSet *") -> "Tuple['Datum *', 'int']": - ss_converted = _ffi.cast("const TSequenceSet *", ss) - count = _ffi.new("int *") - result = _lib.tsequenceset_vals(ss_converted, count) +def tdistance_tnumber_number( + temp: Annotated[_ffi.CData, "const Temporal *"], value: Annotated[_ffi.CData, "Datum"] +) -> Annotated[_ffi.CData, "Temporal *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + value_converted = _ffi.cast("Datum", value) + result = _lib.tdistance_tnumber_number(temp_converted, value_converted) _check_error() - return result if result != _ffi.NULL else None, count[0] + return result if result != _ffi.NULL else None -def temporal_restart(temp: "Temporal *", count: int) -> None: - temp_converted = _ffi.cast("Temporal *", temp) - _lib.temporal_restart(temp_converted, count) +def nad_tbox_tbox( + box1: Annotated[_ffi.CData, "const TBox *"], box2: Annotated[_ffi.CData, "const TBox *"] +) -> Annotated[float, "double"]: + box1_converted = _ffi.cast("const TBox *", box1) + box2_converted = _ffi.cast("const TBox *", box2) + result = _lib.nad_tbox_tbox(box1_converted, box2_converted) _check_error() + return result if result != _ffi.NULL else None -def temporal_tsequence(temp: "const Temporal *", interp: "interpType") -> "TSequence *": +def nad_tnumber_number( + temp: Annotated[_ffi.CData, "const Temporal *"], value: Annotated[_ffi.CData, "Datum"] +) -> Annotated[float, "double"]: temp_converted = _ffi.cast("const Temporal *", temp) - interp_converted = _ffi.cast("interpType", interp) - result = _lib.temporal_tsequence(temp_converted, interp_converted) + value_converted = _ffi.cast("Datum", value) + result = _lib.nad_tnumber_number(temp_converted, value_converted) _check_error() return result if result != _ffi.NULL else None -def temporal_tsequenceset( - temp: "const Temporal *", interp: "interpType" -) -> "TSequenceSet *": +def nad_tnumber_tbox( + temp: Annotated[_ffi.CData, "const Temporal *"], box: Annotated[_ffi.CData, "const TBox *"] +) -> Annotated[float, "double"]: temp_converted = _ffi.cast("const Temporal *", temp) - interp_converted = _ffi.cast("interpType", interp) - result = _lib.temporal_tsequenceset(temp_converted, interp_converted) + box_converted = _ffi.cast("const TBox *", box) + result = _lib.nad_tnumber_tbox(temp_converted, box_converted) _check_error() return result if result != _ffi.NULL else None -def tinstant_shift_time( - inst: "const TInstant *", interv: "const Interval *" -) -> "TInstant *": - inst_converted = _ffi.cast("const TInstant *", inst) - interv_converted = _ffi.cast("const Interval *", interv) - result = _lib.tinstant_shift_time(inst_converted, interv_converted) +def nad_tnumber_tnumber( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[float, "double"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.nad_tnumber_tnumber(temp1_converted, temp2_converted) _check_error() return result if result != _ffi.NULL else None -def tinstant_to_tsequence( - inst: "const TInstant *", interp: "interpType" -) -> "TSequence *": - inst_converted = _ffi.cast("const TInstant *", inst) - interp_converted = _ffi.cast("interpType", interp) - result = _lib.tinstant_to_tsequence(inst_converted, interp_converted) +def tnumberseq_integral(seq: Annotated[_ffi.CData, "const TSequence *"]) -> Annotated[float, "double"]: + seq_converted = _ffi.cast("const TSequence *", seq) + result = _lib.tnumberseq_integral(seq_converted) _check_error() return result if result != _ffi.NULL else None -def tinstant_to_tsequence_free( - inst: "TInstant *", interp: "interpType" -) -> "TSequence *": - inst_converted = _ffi.cast("TInstant *", inst) - interp_converted = _ffi.cast("interpType", interp) - result = _lib.tinstant_to_tsequence_free(inst_converted, interp_converted) +def tnumberseq_twavg(seq: Annotated[_ffi.CData, "const TSequence *"]) -> Annotated[float, "double"]: + seq_converted = _ffi.cast("const TSequence *", seq) + result = _lib.tnumberseq_twavg(seq_converted) _check_error() return result if result != _ffi.NULL else None -def tinstant_to_tsequenceset( - inst: "const TInstant *", interp: "interpType" -) -> "TSequenceSet *": - inst_converted = _ffi.cast("const TInstant *", inst) - interp_converted = _ffi.cast("interpType", interp) - result = _lib.tinstant_to_tsequenceset(inst_converted, interp_converted) +def tnumberseqset_integral(ss: Annotated[_ffi.CData, "const TSequenceSet *"]) -> Annotated[float, "double"]: + ss_converted = _ffi.cast("const TSequenceSet *", ss) + result = _lib.tnumberseqset_integral(ss_converted) _check_error() return result if result != _ffi.NULL else None -def tnumber_shift_scale_value( - temp: "const Temporal *", - shift: "Datum", - width: "Datum", - hasshift: bool, - haswidth: bool, -) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - shift_converted = _ffi.cast("Datum", shift) - width_converted = _ffi.cast("Datum", width) - result = _lib.tnumber_shift_scale_value( - temp_converted, shift_converted, width_converted, hasshift, haswidth - ) +def tnumberseqset_twavg(ss: Annotated[_ffi.CData, "const TSequenceSet *"]) -> Annotated[float, "double"]: + ss_converted = _ffi.cast("const TSequenceSet *", ss) + result = _lib.tnumberseqset_twavg(ss_converted) _check_error() return result if result != _ffi.NULL else None -def tnumberinst_shift_value(inst: "const TInstant *", shift: "Datum") -> "TInstant *": - inst_converted = _ffi.cast("const TInstant *", inst) - shift_converted = _ffi.cast("Datum", shift) - result = _lib.tnumberinst_shift_value(inst_converted, shift_converted) +def temporal_compact(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "Temporal *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.temporal_compact(temp_converted) _check_error() return result if result != _ffi.NULL else None -def tnumberseq_shift_scale_value( - seq: "const TSequence *", - shift: "Datum", - width: "Datum", - hasshift: bool, - haswidth: bool, -) -> "TSequence *": +def tsequence_compact(seq: Annotated[_ffi.CData, "const TSequence *"]) -> Annotated[_ffi.CData, "TSequence *"]: seq_converted = _ffi.cast("const TSequence *", seq) - shift_converted = _ffi.cast("Datum", shift) - width_converted = _ffi.cast("Datum", width) - result = _lib.tnumberseq_shift_scale_value( - seq_converted, shift_converted, width_converted, hasshift, haswidth - ) + result = _lib.tsequence_compact(seq_converted) _check_error() return result if result != _ffi.NULL else None -def tnumberseqset_shift_scale_value( - ss: "const TSequenceSet *", - start: "Datum", - width: "Datum", - hasshift: bool, - haswidth: bool, -) -> "TSequenceSet *": +def tsequenceset_compact(ss: Annotated[_ffi.CData, "const TSequenceSet *"]) -> Annotated[_ffi.CData, "TSequenceSet *"]: ss_converted = _ffi.cast("const TSequenceSet *", ss) - start_converted = _ffi.cast("Datum", start) - width_converted = _ffi.cast("Datum", width) - result = _lib.tnumberseqset_shift_scale_value( - ss_converted, start_converted, width_converted, hasshift, haswidth - ) + result = _lib.tsequenceset_compact(ss_converted) _check_error() return result if result != _ffi.NULL else None -def tsequence_restart(seq: "TSequence *", count: int) -> None: - seq_converted = _ffi.cast("TSequence *", seq) - _lib.tsequence_restart(seq_converted, count) +def skiplist_free(list: Annotated[_ffi.CData, "SkipList *"]) -> Annotated[None, "void"]: + list_converted = _ffi.cast("SkipList *", list) + _lib.skiplist_free(list_converted) _check_error() -def tsequence_set_interp( - seq: "const TSequence *", interp: "interpType" -) -> "Temporal *": - seq_converted = _ffi.cast("const TSequence *", seq) - interp_converted = _ffi.cast("interpType", interp) - result = _lib.tsequence_set_interp(seq_converted, interp_converted) +def temporal_app_tinst_transfn( + state: Annotated[_ffi.CData, "Temporal *"], + inst: Annotated[_ffi.CData, "const TInstant *"], + interp: InterpolationType, + maxdist: float, + maxt: Annotated[_ffi.CData, "const Interval *"], +) -> Annotated[_ffi.CData, "Temporal *"]: + state_converted = _ffi.cast("Temporal *", state) + inst_converted = _ffi.cast("const TInstant *", inst) + maxt_converted = _ffi.cast("const Interval *", maxt) + result = _lib.temporal_app_tinst_transfn(state_converted, inst_converted, interp, maxdist, maxt_converted) _check_error() return result if result != _ffi.NULL else None -def tsequence_shift_scale_time( - seq: "const TSequence *", shift: "const Interval *", duration: "const Interval *" -) -> "TSequence *": +def temporal_app_tseq_transfn( + state: Annotated[_ffi.CData, "Temporal *"], seq: Annotated[_ffi.CData, "const TSequence *"] +) -> Annotated[_ffi.CData, "Temporal *"]: + state_converted = _ffi.cast("Temporal *", state) seq_converted = _ffi.cast("const TSequence *", seq) - shift_converted = _ffi.cast("const Interval *", shift) - duration_converted = _ffi.cast("const Interval *", duration) - result = _lib.tsequence_shift_scale_time( - seq_converted, shift_converted, duration_converted - ) + result = _lib.temporal_app_tseq_transfn(state_converted, seq_converted) _check_error() return result if result != _ffi.NULL else None -def tsequence_subseq( - seq: "const TSequence *", from_: int, to: int, lower_inc: bool, upper_inc: bool -) -> "TSequence *": - seq_converted = _ffi.cast("const TSequence *", seq) - result = _lib.tsequence_subseq(seq_converted, from_, to, lower_inc, upper_inc) +def span_bins( + s: Annotated[_ffi.CData, "const Span *"], + size: Annotated[_ffi.CData, "Datum"], + origin: Annotated[_ffi.CData, "Datum"], + count: Annotated[_ffi.CData, "int *"], +) -> Annotated[_ffi.CData, "Span *"]: + s_converted = _ffi.cast("const Span *", s) + size_converted = _ffi.cast("Datum", size) + origin_converted = _ffi.cast("Datum", origin) + count_converted = _ffi.cast("int *", count) + result = _lib.span_bins(s_converted, size_converted, origin_converted, count_converted) _check_error() return result if result != _ffi.NULL else None -def tsequence_to_tinstant(seq: "const TSequence *") -> "TInstant *": - seq_converted = _ffi.cast("const TSequence *", seq) - result = _lib.tsequence_to_tinstant(seq_converted) +def spanset_bins( + ss: Annotated[_ffi.CData, "const SpanSet *"], + size: Annotated[_ffi.CData, "Datum"], + origin: Annotated[_ffi.CData, "Datum"], + count: Annotated[_ffi.CData, "int *"], +) -> Annotated[_ffi.CData, "Span *"]: + ss_converted = _ffi.cast("const SpanSet *", ss) + size_converted = _ffi.cast("Datum", size) + origin_converted = _ffi.cast("Datum", origin) + count_converted = _ffi.cast("int *", count) + result = _lib.spanset_bins(ss_converted, size_converted, origin_converted, count_converted) _check_error() return result if result != _ffi.NULL else None -def tsequence_to_tsequenceset(seq: "const TSequence *") -> "TSequenceSet *": - seq_converted = _ffi.cast("const TSequence *", seq) - result = _lib.tsequence_to_tsequenceset(seq_converted) +def tnumber_value_bins( + temp: Annotated[_ffi.CData, "const Temporal *"], + size: Annotated[_ffi.CData, "Datum"], + origin: Annotated[_ffi.CData, "Datum"], + count: Annotated[_ffi.CData, "int *"], +) -> Annotated[_ffi.CData, "Span *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + size_converted = _ffi.cast("Datum", size) + origin_converted = _ffi.cast("Datum", origin) + count_converted = _ffi.cast("int *", count) + result = _lib.tnumber_value_bins(temp_converted, size_converted, origin_converted, count_converted) _check_error() return result if result != _ffi.NULL else None -def tsequence_to_tsequenceset_free(seq: "TSequence *") -> "TSequenceSet *": - seq_converted = _ffi.cast("TSequence *", seq) - result = _lib.tsequence_to_tsequenceset_free(seq_converted) +def tnumber_value_time_boxes( + temp: Annotated[_ffi.CData, "const Temporal *"], + vsize: Annotated[_ffi.CData, "Datum"], + duration: Annotated[_ffi.CData, "const Interval *"], + vorigin: Annotated[_ffi.CData, "Datum"], + torigin: int, + count: Annotated[_ffi.CData, "int *"], +) -> Annotated[_ffi.CData, "TBox *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + vsize_converted = _ffi.cast("Datum", vsize) + duration_converted = _ffi.cast("const Interval *", duration) + vorigin_converted = _ffi.cast("Datum", vorigin) + torigin_converted = _ffi.cast("TimestampTz", torigin) + count_converted = _ffi.cast("int *", count) + result = _lib.tnumber_value_time_boxes( + temp_converted, vsize_converted, duration_converted, vorigin_converted, torigin_converted, count_converted + ) _check_error() return result if result != _ffi.NULL else None -def tsequence_to_tsequenceset_interp( - seq: "const TSequence *", interp: "interpType" -) -> "TSequenceSet *": - seq_converted = _ffi.cast("const TSequence *", seq) - interp_converted = _ffi.cast("interpType", interp) - result = _lib.tsequence_to_tsequenceset_interp(seq_converted, interp_converted) +def tnumber_value_split( + temp: Annotated[_ffi.CData, "const Temporal *"], + vsize: Annotated[_ffi.CData, "Datum"], + vorigin: Annotated[_ffi.CData, "Datum"], + bins: Annotated[list, "Datum **"], + count: Annotated[_ffi.CData, "int *"], +) -> Annotated[_ffi.CData, "Temporal **"]: + temp_converted = _ffi.cast("const Temporal *", temp) + vsize_converted = _ffi.cast("Datum", vsize) + vorigin_converted = _ffi.cast("Datum", vorigin) + bins_converted = [_ffi.cast("Datum *", x) for x in bins] + count_converted = _ffi.cast("int *", count) + result = _lib.tnumber_value_split( + temp_converted, vsize_converted, vorigin_converted, bins_converted, count_converted + ) _check_error() return result if result != _ffi.NULL else None -def tsequenceset_restart(ss: "TSequenceSet *", count: int) -> None: - ss_converted = _ffi.cast("TSequenceSet *", ss) - _lib.tsequenceset_restart(ss_converted, count) - _check_error() - - -def tsequenceset_set_interp( - ss: "const TSequenceSet *", interp: "interpType" -) -> "Temporal *": - ss_converted = _ffi.cast("const TSequenceSet *", ss) - interp_converted = _ffi.cast("interpType", interp) - result = _lib.tsequenceset_set_interp(ss_converted, interp_converted) +def tbox_get_value_time_tile( + value: Annotated[_ffi.CData, "Datum"], + t: int, + vsize: Annotated[_ffi.CData, "Datum"], + duration: Annotated[_ffi.CData, "const Interval *"], + vorigin: Annotated[_ffi.CData, "Datum"], + torigin: int, + basetype: Annotated[_ffi.CData, "meosType"], + spantype: Annotated[_ffi.CData, "meosType"], +) -> Annotated[_ffi.CData, "TBox *"]: + value_converted = _ffi.cast("Datum", value) + t_converted = _ffi.cast("TimestampTz", t) + vsize_converted = _ffi.cast("Datum", vsize) + duration_converted = _ffi.cast("const Interval *", duration) + vorigin_converted = _ffi.cast("Datum", vorigin) + torigin_converted = _ffi.cast("TimestampTz", torigin) + basetype_converted = _ffi.cast("meosType", basetype) + spantype_converted = _ffi.cast("meosType", spantype) + result = _lib.tbox_get_value_time_tile( + value_converted, + t_converted, + vsize_converted, + duration_converted, + vorigin_converted, + torigin_converted, + basetype_converted, + spantype_converted, + ) _check_error() return result if result != _ffi.NULL else None -def tsequenceset_shift_scale_time( - ss: "const TSequenceSet *", start: "const Interval *", duration: "const Interval *" -) -> "TSequenceSet *": - ss_converted = _ffi.cast("const TSequenceSet *", ss) - start_converted = _ffi.cast("const Interval *", start) +def tnumber_value_time_split( + temp: Annotated[_ffi.CData, "const Temporal *"], + size: Annotated[_ffi.CData, "Datum"], + duration: Annotated[_ffi.CData, "const Interval *"], + vorigin: Annotated[_ffi.CData, "Datum"], + torigin: int, + value_bins: Annotated[list, "Datum **"], + time_bins: Annotated[list, "TimestampTz **"], + count: Annotated[_ffi.CData, "int *"], +) -> Annotated[_ffi.CData, "Temporal **"]: + temp_converted = _ffi.cast("const Temporal *", temp) + size_converted = _ffi.cast("Datum", size) duration_converted = _ffi.cast("const Interval *", duration) - result = _lib.tsequenceset_shift_scale_time( - ss_converted, start_converted, duration_converted + vorigin_converted = _ffi.cast("Datum", vorigin) + torigin_converted = _ffi.cast("TimestampTz", torigin) + value_bins_converted = [_ffi.cast("Datum *", x) for x in value_bins] + time_bins_converted = [_ffi.cast("TimestampTz *", x) for x in time_bins] + count_converted = _ffi.cast("int *", count) + result = _lib.tnumber_value_time_split( + temp_converted, + size_converted, + duration_converted, + vorigin_converted, + torigin_converted, + value_bins_converted, + time_bins_converted, + count_converted, ) _check_error() return result if result != _ffi.NULL else None -def tsequenceset_to_discrete(ss: "const TSequenceSet *") -> "TSequence *": - ss_converted = _ffi.cast("const TSequenceSet *", ss) - result = _lib.tsequenceset_to_discrete(ss_converted) +def proj_get_context() -> Annotated[_ffi.CData, "PJ_CONTEXT *"]: + result = _lib.proj_get_context() _check_error() return result if result != _ffi.NULL else None -def tsequenceset_to_linear(ss: "const TSequenceSet *") -> "TSequenceSet *": - ss_converted = _ffi.cast("const TSequenceSet *", ss) - result = _lib.tsequenceset_to_linear(ss_converted) +def datum_geo_round( + value: Annotated[_ffi.CData, "Datum"], size: Annotated[_ffi.CData, "Datum"] +) -> Annotated[_ffi.CData, "Datum"]: + value_converted = _ffi.cast("Datum", value) + size_converted = _ffi.cast("Datum", size) + result = _lib.datum_geo_round(value_converted, size_converted) _check_error() return result if result != _ffi.NULL else None -def tsequenceset_to_step(ss: "const TSequenceSet *") -> "TSequenceSet *": - ss_converted = _ffi.cast("const TSequenceSet *", ss) - result = _lib.tsequenceset_to_step(ss_converted) +def point_round(gs: Annotated[_ffi.CData, "const GSERIALIZED *"], maxdd: int) -> Annotated[_ffi.CData, "GSERIALIZED *"]: + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + result = _lib.point_round(gs_converted, maxdd) _check_error() return result if result != _ffi.NULL else None -def tsequenceset_to_tinstant(ss: "const TSequenceSet *") -> "TInstant *": - ss_converted = _ffi.cast("const TSequenceSet *", ss) - result = _lib.tsequenceset_to_tinstant(ss_converted) +def stbox_set( + hasx: bool, + hasz: bool, + geodetic: bool, + srid: int, + xmin: float, + xmax: float, + ymin: float, + ymax: float, + zmin: float, + zmax: float, + s: Annotated[_ffi.CData, "const Span *"], + box: Annotated[_ffi.CData, "STBox *"], +) -> Annotated[None, "void"]: + srid_converted = _ffi.cast("int32", srid) + s_converted = _ffi.cast("const Span *", s) + box_converted = _ffi.cast("STBox *", box) + _lib.stbox_set(hasx, hasz, geodetic, srid_converted, xmin, xmax, ymin, ymax, zmin, zmax, s_converted, box_converted) _check_error() - return result if result != _ffi.NULL else None -def tsequenceset_to_tsequence(ss: "const TSequenceSet *") -> "TSequence *": - ss_converted = _ffi.cast("const TSequenceSet *", ss) - result = _lib.tsequenceset_to_tsequence(ss_converted) +def gbox_set_stbox( + box: Annotated[_ffi.CData, "const GBOX *"], srid: Annotated[_ffi.CData, "int32_t"] +) -> Annotated[_ffi.CData, "STBox *"]: + box_converted = _ffi.cast("const GBOX *", box) + srid_converted = _ffi.cast("int32_t", srid) + out_result = _ffi.new("STBox *") + _lib.gbox_set_stbox(box_converted, srid_converted, out_result) _check_error() - return result if result != _ffi.NULL else None + return out_result if out_result != _ffi.NULL else None -def tinstant_merge( - inst1: "const TInstant *", inst2: "const TInstant *" -) -> "Temporal *": - inst1_converted = _ffi.cast("const TInstant *", inst1) - inst2_converted = _ffi.cast("const TInstant *", inst2) - result = _lib.tinstant_merge(inst1_converted, inst2_converted) +def geo_set_stbox( + gs: Annotated[_ffi.CData, "const GSERIALIZED *"], box: Annotated[_ffi.CData, "STBox *"] +) -> Annotated[bool, "bool"]: + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + box_converted = _ffi.cast("STBox *", box) + result = _lib.geo_set_stbox(gs_converted, box_converted) _check_error() return result if result != _ffi.NULL else None -def tinstant_merge_array(instants: "const TInstant **", count: int) -> "Temporal *": - instants_converted = [_ffi.cast("const TInstant *", x) for x in instants] - result = _lib.tinstant_merge_array(instants_converted, count) +def geoarr_set_stbox( + values: Annotated[_ffi.CData, "const Datum *"], count: int, box: Annotated[_ffi.CData, "STBox *"] +) -> Annotated[None, "void"]: + values_converted = _ffi.cast("const Datum *", values) + box_converted = _ffi.cast("STBox *", box) + _lib.geoarr_set_stbox(values_converted, count, box_converted) _check_error() - return result if result != _ffi.NULL else None -def tsequence_append_tinstant( - seq: "TSequence *", - inst: "const TInstant *", - maxdist: float, - maxt: "const Interval *", - expand: bool, -) -> "Temporal *": - seq_converted = _ffi.cast("TSequence *", seq) - inst_converted = _ffi.cast("const TInstant *", inst) - maxt_converted = _ffi.cast("const Interval *", maxt) - result = _lib.tsequence_append_tinstant( - seq_converted, inst_converted, maxdist, maxt_converted, expand - ) +def spatial_set_stbox( + d: Annotated[_ffi.CData, "Datum"], + basetype: Annotated[_ffi.CData, "meosType"], + box: Annotated[_ffi.CData, "STBox *"], +) -> Annotated[bool, "bool"]: + d_converted = _ffi.cast("Datum", d) + basetype_converted = _ffi.cast("meosType", basetype) + box_converted = _ffi.cast("STBox *", box) + result = _lib.spatial_set_stbox(d_converted, basetype_converted, box_converted) _check_error() return result if result != _ffi.NULL else None -def tsequence_append_tsequence( - seq1: "const TSequence *", seq2: "const TSequence *", expand: bool -) -> "Temporal *": - seq1_converted = _ffi.cast("const TSequence *", seq1) - seq2_converted = _ffi.cast("const TSequence *", seq2) - result = _lib.tsequence_append_tsequence(seq1_converted, seq2_converted, expand) +def spatialset_set_stbox( + set: Annotated[_ffi.CData, "const Set *"], box: Annotated[_ffi.CData, "STBox *"] +) -> Annotated[None, "void"]: + set_converted = _ffi.cast("const Set *", set) + box_converted = _ffi.cast("STBox *", box) + _lib.spatialset_set_stbox(set_converted, box_converted) _check_error() - return result if result != _ffi.NULL else None -def tsequence_delete_timestamptz( - seq: "const TSequence *", t: int, connect: bool -) -> "Temporal *": - seq_converted = _ffi.cast("const TSequence *", seq) - t_converted = _ffi.cast("TimestampTz", t) - result = _lib.tsequence_delete_timestamptz(seq_converted, t_converted, connect) +def stbox_set_box3d( + box: Annotated[_ffi.CData, "const STBox *"], box3d: Annotated[_ffi.CData, "BOX3D *"] +) -> Annotated[None, "void"]: + box_converted = _ffi.cast("const STBox *", box) + box3d_converted = _ffi.cast("BOX3D *", box3d) + _lib.stbox_set_box3d(box_converted, box3d_converted) _check_error() - return result if result != _ffi.NULL else None -def tsequence_delete_tstzset( - seq: "const TSequence *", s: "const Set *", connect: bool -) -> "Temporal *": - seq_converted = _ffi.cast("const TSequence *", seq) +def stbox_set_gbox( + box: Annotated[_ffi.CData, "const STBox *"], gbox: Annotated[_ffi.CData, "GBOX *"] +) -> Annotated[None, "void"]: + box_converted = _ffi.cast("const STBox *", box) + gbox_converted = _ffi.cast("GBOX *", gbox) + _lib.stbox_set_gbox(box_converted, gbox_converted) + _check_error() + + +def tstzset_set_stbox( + s: Annotated[_ffi.CData, "const Set *"], box: Annotated[_ffi.CData, "STBox *"] +) -> Annotated[None, "void"]: s_converted = _ffi.cast("const Set *", s) - result = _lib.tsequence_delete_tstzset(seq_converted, s_converted, connect) + box_converted = _ffi.cast("STBox *", box) + _lib.tstzset_set_stbox(s_converted, box_converted) _check_error() - return result if result != _ffi.NULL else None -def tsequence_delete_tstzspan( - seq: "const TSequence *", s: "const Span *", connect: bool -) -> "Temporal *": - seq_converted = _ffi.cast("const TSequence *", seq) +def tstzspan_set_stbox( + s: Annotated[_ffi.CData, "const Span *"], box: Annotated[_ffi.CData, "STBox *"] +) -> Annotated[None, "void"]: s_converted = _ffi.cast("const Span *", s) - result = _lib.tsequence_delete_tstzspan(seq_converted, s_converted, connect) + box_converted = _ffi.cast("STBox *", box) + _lib.tstzspan_set_stbox(s_converted, box_converted) _check_error() - return result if result != _ffi.NULL else None -def tsequence_delete_tstzspanset( - seq: "const TSequence *", ss: "const SpanSet *", connect: bool -) -> "Temporal *": - seq_converted = _ffi.cast("const TSequence *", seq) - ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.tsequence_delete_tstzspanset(seq_converted, ss_converted, connect) +def tstzspanset_set_stbox( + s: Annotated[_ffi.CData, "const SpanSet *"], box: Annotated[_ffi.CData, "STBox *"] +) -> Annotated[None, "void"]: + s_converted = _ffi.cast("const SpanSet *", s) + box_converted = _ffi.cast("STBox *", box) + _lib.tstzspanset_set_stbox(s_converted, box_converted) + _check_error() + + +def stbox_expand( + box1: Annotated[_ffi.CData, "const STBox *"], box2: Annotated[_ffi.CData, "STBox *"] +) -> Annotated[None, "void"]: + box1_converted = _ffi.cast("const STBox *", box1) + box2_converted = _ffi.cast("STBox *", box2) + _lib.stbox_expand(box1_converted, box2_converted) + _check_error() + + +def inter_stbox_stbox( + box1: Annotated[_ffi.CData, "const STBox *"], box2: Annotated[_ffi.CData, "const STBox *"] +) -> Annotated[_ffi.CData, "STBox *"]: + box1_converted = _ffi.cast("const STBox *", box1) + box2_converted = _ffi.cast("const STBox *", box2) + out_result = _ffi.new("STBox *") + result = _lib.inter_stbox_stbox(box1_converted, box2_converted, out_result) + _check_error() + if result: + return out_result if out_result != _ffi.NULL else None + return None + + +def stbox_geo(box: Annotated[_ffi.CData, "const STBox *"]) -> Annotated[_ffi.CData, "GSERIALIZED *"]: + box_converted = _ffi.cast("const STBox *", box) + result = _lib.stbox_geo(box_converted) _check_error() return result if result != _ffi.NULL else None -def tsequence_insert( - seq1: "const TSequence *", seq2: "const TSequence *", connect: bool -) -> "Temporal *": - seq1_converted = _ffi.cast("const TSequence *", seq1) - seq2_converted = _ffi.cast("const TSequence *", seq2) - result = _lib.tsequence_insert(seq1_converted, seq2_converted, connect) +def tgeogpointinst_in(string: str) -> Annotated[_ffi.CData, "TInstant *"]: + string_converted = string.encode("utf-8") + result = _lib.tgeogpointinst_in(string_converted) _check_error() return result if result != _ffi.NULL else None -def tsequence_merge( - seq1: "const TSequence *", seq2: "const TSequence *" -) -> "Temporal *": - seq1_converted = _ffi.cast("const TSequence *", seq1) - seq2_converted = _ffi.cast("const TSequence *", seq2) - result = _lib.tsequence_merge(seq1_converted, seq2_converted) +def tgeogpointseq_in(string: str, interp: InterpolationType) -> Annotated[_ffi.CData, "TSequence *"]: + string_converted = string.encode("utf-8") + result = _lib.tgeogpointseq_in(string_converted, interp) _check_error() return result if result != _ffi.NULL else None -def tsequence_merge_array(sequences: "const TSequence **", count: int) -> "Temporal *": - sequences_converted = [_ffi.cast("const TSequence *", x) for x in sequences] - result = _lib.tsequence_merge_array(sequences_converted, count) +def tgeogpointseqset_in(string: str) -> Annotated[_ffi.CData, "TSequenceSet *"]: + string_converted = string.encode("utf-8") + result = _lib.tgeogpointseqset_in(string_converted) _check_error() return result if result != _ffi.NULL else None -def tsequenceset_append_tinstant( - ss: "TSequenceSet *", - inst: "const TInstant *", - maxdist: float, - maxt: "const Interval *", - expand: bool, -) -> "TSequenceSet *": - ss_converted = _ffi.cast("TSequenceSet *", ss) - inst_converted = _ffi.cast("const TInstant *", inst) - maxt_converted = _ffi.cast("const Interval *", maxt) - result = _lib.tsequenceset_append_tinstant( - ss_converted, inst_converted, maxdist, maxt_converted, expand - ) +def tgeompointinst_in(string: str) -> Annotated[_ffi.CData, "TInstant *"]: + string_converted = string.encode("utf-8") + result = _lib.tgeompointinst_in(string_converted) _check_error() return result if result != _ffi.NULL else None -def tsequenceset_append_tsequence( - ss: "TSequenceSet *", seq: "const TSequence *", expand: bool -) -> "TSequenceSet *": - ss_converted = _ffi.cast("TSequenceSet *", ss) - seq_converted = _ffi.cast("const TSequence *", seq) - result = _lib.tsequenceset_append_tsequence(ss_converted, seq_converted, expand) +def tgeompointseq_in(string: str, interp: InterpolationType) -> Annotated[_ffi.CData, "TSequence *"]: + string_converted = string.encode("utf-8") + result = _lib.tgeompointseq_in(string_converted, interp) _check_error() return result if result != _ffi.NULL else None -def tsequenceset_delete_timestamptz( - ss: "const TSequenceSet *", t: int -) -> "TSequenceSet *": - ss_converted = _ffi.cast("const TSequenceSet *", ss) - t_converted = _ffi.cast("TimestampTz", t) - result = _lib.tsequenceset_delete_timestamptz(ss_converted, t_converted) +def tgeompointseqset_in(string: str) -> Annotated[_ffi.CData, "TSequenceSet *"]: + string_converted = string.encode("utf-8") + result = _lib.tgeompointseqset_in(string_converted) _check_error() return result if result != _ffi.NULL else None -def tsequenceset_delete_tstzset( - ss: "const TSequenceSet *", s: "const Set *" -) -> "TSequenceSet *": - ss_converted = _ffi.cast("const TSequenceSet *", ss) - s_converted = _ffi.cast("const Set *", s) - result = _lib.tsequenceset_delete_tstzset(ss_converted, s_converted) +def tgeographyinst_in(string: str) -> Annotated[_ffi.CData, "TInstant *"]: + string_converted = string.encode("utf-8") + result = _lib.tgeographyinst_in(string_converted) _check_error() return result if result != _ffi.NULL else None -def tsequenceset_delete_tstzspan( - ss: "const TSequenceSet *", s: "const Span *" -) -> "TSequenceSet *": - ss_converted = _ffi.cast("const TSequenceSet *", ss) - s_converted = _ffi.cast("const Span *", s) - result = _lib.tsequenceset_delete_tstzspan(ss_converted, s_converted) +def tgeographyseq_in(string: str, interp: InterpolationType) -> Annotated[_ffi.CData, "TSequence *"]: + string_converted = string.encode("utf-8") + result = _lib.tgeographyseq_in(string_converted, interp) _check_error() return result if result != _ffi.NULL else None -def tsequenceset_delete_tstzspanset( - ss: "const TSequenceSet *", ps: "const SpanSet *" -) -> "TSequenceSet *": - ss_converted = _ffi.cast("const TSequenceSet *", ss) - ps_converted = _ffi.cast("const SpanSet *", ps) - result = _lib.tsequenceset_delete_tstzspanset(ss_converted, ps_converted) +def tgeographyseqset_in(string: str) -> Annotated[_ffi.CData, "TSequenceSet *"]: + string_converted = string.encode("utf-8") + result = _lib.tgeographyseqset_in(string_converted) _check_error() return result if result != _ffi.NULL else None -def tsequenceset_insert( - ss1: "const TSequenceSet *", ss2: "const TSequenceSet *" -) -> "TSequenceSet *": - ss1_converted = _ffi.cast("const TSequenceSet *", ss1) - ss2_converted = _ffi.cast("const TSequenceSet *", ss2) - result = _lib.tsequenceset_insert(ss1_converted, ss2_converted) +def tgeometryinst_in(string: str) -> Annotated[_ffi.CData, "TInstant *"]: + string_converted = string.encode("utf-8") + result = _lib.tgeometryinst_in(string_converted) _check_error() return result if result != _ffi.NULL else None -def tsequenceset_merge( - ss1: "const TSequenceSet *", ss2: "const TSequenceSet *" -) -> "TSequenceSet *": - ss1_converted = _ffi.cast("const TSequenceSet *", ss1) - ss2_converted = _ffi.cast("const TSequenceSet *", ss2) - result = _lib.tsequenceset_merge(ss1_converted, ss2_converted) +def tgeometryseq_in(string: str, interp: InterpolationType) -> Annotated[_ffi.CData, "TSequence *"]: + string_converted = string.encode("utf-8") + result = _lib.tgeometryseq_in(string_converted, interp) _check_error() return result if result != _ffi.NULL else None -def tsequenceset_merge_array( - seqsets: "const TSequenceSet **", count: int -) -> "TSequenceSet *": - seqsets_converted = [_ffi.cast("const TSequenceSet *", x) for x in seqsets] - result = _lib.tsequenceset_merge_array(seqsets_converted, count) +def tgeometryseqset_in(string: str) -> Annotated[_ffi.CData, "TSequenceSet *"]: + string_converted = string.encode("utf-8") + result = _lib.tgeometryseqset_in(string_converted) _check_error() return result if result != _ffi.NULL else None -def tspatial_set_stbox(temp: "const Temporal *", box: "STBox *") -> None: +def tspatial_set_stbox( + temp: Annotated[_ffi.CData, "const Temporal *"], box: Annotated[_ffi.CData, "STBox *"] +) -> Annotated[None, "void"]: temp_converted = _ffi.cast("const Temporal *", temp) box_converted = _ffi.cast("STBox *", box) _lib.tspatial_set_stbox(temp_converted, box_converted) _check_error() -def tpointinst_set_stbox(inst: "const TInstant *", box: "STBox *") -> None: +def tgeoinst_set_stbox( + inst: Annotated[_ffi.CData, "const TInstant *"], box: Annotated[_ffi.CData, "STBox *"] +) -> Annotated[None, "void"]: inst_converted = _ffi.cast("const TInstant *", inst) box_converted = _ffi.cast("STBox *", box) - _lib.tpointinst_set_stbox(inst_converted, box_converted) + _lib.tgeoinst_set_stbox(inst_converted, box_converted) _check_error() -def tspatialseq_set_stbox(seq: "const TSequence *", box: "STBox *") -> None: +def tspatialseq_set_stbox( + seq: Annotated[_ffi.CData, "const TSequence *"], box: Annotated[_ffi.CData, "STBox *"] +) -> Annotated[None, "void"]: seq_converted = _ffi.cast("const TSequence *", seq) box_converted = _ffi.cast("STBox *", box) _lib.tspatialseq_set_stbox(seq_converted, box_converted) _check_error() -def tspatialseqset_set_stbox(ss: "const TSequenceSet *", box: "STBox *") -> None: +def tspatialseqset_set_stbox( + ss: Annotated[_ffi.CData, "const TSequenceSet *"], box: Annotated[_ffi.CData, "STBox *"] +) -> Annotated[None, "void"]: ss_converted = _ffi.cast("const TSequenceSet *", ss) box_converted = _ffi.cast("STBox *", box) _lib.tspatialseqset_set_stbox(ss_converted, box_converted) _check_error() -def tsequence_expand_bbox(seq: "TSequence *", inst: "const TInstant *") -> None: - seq_converted = _ffi.cast("TSequence *", seq) +def tgeo_restrict_geom( + temp: Annotated[_ffi.CData, "const Temporal *"], + gs: Annotated[_ffi.CData, "const GSERIALIZED *"], + zspan: Annotated[_ffi.CData, "const Span *"], + atfunc: bool, +) -> Annotated[_ffi.CData, "Temporal *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + zspan_converted = _ffi.cast("const Span *", zspan) + result = _lib.tgeo_restrict_geom(temp_converted, gs_converted, zspan_converted, atfunc) + _check_error() + return result if result != _ffi.NULL else None + + +def tgeo_restrict_stbox( + temp: Annotated[_ffi.CData, "const Temporal *"], + box: Annotated[_ffi.CData, "const STBox *"], + border_inc: bool, + atfunc: bool, +) -> Annotated[_ffi.CData, "Temporal *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + box_converted = _ffi.cast("const STBox *", box) + result = _lib.tgeo_restrict_stbox(temp_converted, box_converted, border_inc, atfunc) + _check_error() + return result if result != _ffi.NULL else None + + +def tgeoinst_restrict_geom( + inst: Annotated[_ffi.CData, "const TInstant *"], + gs: Annotated[_ffi.CData, "const GSERIALIZED *"], + zspan: Annotated[_ffi.CData, "const Span *"], + atfunc: bool, +) -> Annotated[_ffi.CData, "TInstant *"]: inst_converted = _ffi.cast("const TInstant *", inst) - _lib.tsequence_expand_bbox(seq_converted, inst_converted) + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + zspan_converted = _ffi.cast("const Span *", zspan) + result = _lib.tgeoinst_restrict_geom(inst_converted, gs_converted, zspan_converted, atfunc) _check_error() + return result if result != _ffi.NULL else None + + +def tgeoinst_restrict_stbox( + inst: Annotated[_ffi.CData, "const TInstant *"], + box: Annotated[_ffi.CData, "const STBox *"], + border_inc: bool, + atfunc: bool, +) -> Annotated[_ffi.CData, "TInstant *"]: + inst_converted = _ffi.cast("const TInstant *", inst) + box_converted = _ffi.cast("const STBox *", box) + result = _lib.tgeoinst_restrict_stbox(inst_converted, box_converted, border_inc, atfunc) + _check_error() + return result if result != _ffi.NULL else None -def tsequence_set_bbox(seq: "const TSequence *", box: "void *") -> None: +def tgeoseq_restrict_geom( + seq: Annotated[_ffi.CData, "const TSequence *"], + gs: Annotated[_ffi.CData, "const GSERIALIZED *"], + zspan: Annotated[_ffi.CData, "const Span *"], + atfunc: bool, +) -> Annotated[_ffi.CData, "Temporal *"]: seq_converted = _ffi.cast("const TSequence *", seq) - box_converted = _ffi.cast("void *", box) - _lib.tsequence_set_bbox(seq_converted, box_converted) + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + zspan_converted = _ffi.cast("const Span *", zspan) + result = _lib.tgeoseq_restrict_geom(seq_converted, gs_converted, zspan_converted, atfunc) _check_error() + return result if result != _ffi.NULL else None -def tsequenceset_expand_bbox(ss: "TSequenceSet *", seq: "const TSequence *") -> None: - ss_converted = _ffi.cast("TSequenceSet *", ss) +def tgeoseq_restrict_stbox( + seq: Annotated[_ffi.CData, "const TSequence *"], + box: Annotated[_ffi.CData, "const STBox *"], + border_inc: bool, + atfunc: bool, +) -> Annotated[_ffi.CData, "Temporal *"]: seq_converted = _ffi.cast("const TSequence *", seq) - _lib.tsequenceset_expand_bbox(ss_converted, seq_converted) + box_converted = _ffi.cast("const STBox *", box) + result = _lib.tgeoseq_restrict_stbox(seq_converted, box_converted, border_inc, atfunc) _check_error() + return result if result != _ffi.NULL else None -def tsequenceset_set_bbox(ss: "const TSequenceSet *", box: "void *") -> None: +def tgeoseqset_restrict_geom( + ss: Annotated[_ffi.CData, "const TSequenceSet *"], + gs: Annotated[_ffi.CData, "const GSERIALIZED *"], + zspan: Annotated[_ffi.CData, "const Span *"], + atfunc: bool, +) -> Annotated[_ffi.CData, "TSequenceSet *"]: ss_converted = _ffi.cast("const TSequenceSet *", ss) - box_converted = _ffi.cast("void *", box) - _lib.tsequenceset_set_bbox(ss_converted, box_converted) + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + zspan_converted = _ffi.cast("const Span *", zspan) + result = _lib.tgeoseqset_restrict_geom(ss_converted, gs_converted, zspan_converted, atfunc) _check_error() + return result if result != _ffi.NULL else None -def tdiscseq_restrict_minmax( - seq: "const TSequence *", min: bool, atfunc: bool -) -> "TSequence *": +def tgeoseqset_restrict_stbox( + ss: Annotated[_ffi.CData, "const TSequenceSet *"], + box: Annotated[_ffi.CData, "const STBox *"], + border_inc: bool, + atfunc: bool, +) -> Annotated[_ffi.CData, "TSequenceSet *"]: + ss_converted = _ffi.cast("const TSequenceSet *", ss) + box_converted = _ffi.cast("const STBox *", box) + result = _lib.tgeoseqset_restrict_stbox(ss_converted, box_converted, border_inc, atfunc) + _check_error() + return result if result != _ffi.NULL else None + + +def spatial_srid( + d: Annotated[_ffi.CData, "Datum"], basetype: Annotated[_ffi.CData, "meosType"] +) -> Annotated[_ffi.CData, "int32_t"]: + d_converted = _ffi.cast("Datum", d) + basetype_converted = _ffi.cast("meosType", basetype) + result = _lib.spatial_srid(d_converted, basetype_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def spatial_set_srid( + d: Annotated[_ffi.CData, "Datum"], + basetype: Annotated[_ffi.CData, "meosType"], + srid: Annotated[_ffi.CData, "int32_t"], +) -> Annotated[bool, "bool"]: + d_converted = _ffi.cast("Datum", d) + basetype_converted = _ffi.cast("meosType", basetype) + srid_converted = _ffi.cast("int32_t", srid) + result = _lib.spatial_set_srid(d_converted, basetype_converted, srid_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def tspatialinst_srid(inst: Annotated[_ffi.CData, "const TInstant *"]) -> Annotated[int, "int"]: + inst_converted = _ffi.cast("const TInstant *", inst) + result = _lib.tspatialinst_srid(inst_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def tpointseq_azimuth(seq: Annotated[_ffi.CData, "const TSequence *"]) -> Annotated[_ffi.CData, "TSequenceSet *"]: seq_converted = _ffi.cast("const TSequence *", seq) - result = _lib.tdiscseq_restrict_minmax(seq_converted, min, atfunc) + result = _lib.tpointseq_azimuth(seq_converted) _check_error() return result if result != _ffi.NULL else None -def tcontseq_restrict_minmax( - seq: "const TSequence *", min: bool, atfunc: bool -) -> "TSequenceSet *": +def tpointseq_cumulative_length( + seq: Annotated[_ffi.CData, "const TSequence *"], prevlength: float +) -> Annotated[_ffi.CData, "TSequence *"]: seq_converted = _ffi.cast("const TSequence *", seq) - result = _lib.tcontseq_restrict_minmax(seq_converted, min, atfunc) + result = _lib.tpointseq_cumulative_length(seq_converted, prevlength) _check_error() return result if result != _ffi.NULL else None -def temporal_bbox_restrict_set(temp: "const Temporal *", set: "const Set *") -> "bool": - temp_converted = _ffi.cast("const Temporal *", temp) - set_converted = _ffi.cast("const Set *", set) - result = _lib.temporal_bbox_restrict_set(temp_converted, set_converted) +def tpointseq_is_simple(seq: Annotated[_ffi.CData, "const TSequence *"]) -> Annotated[bool, "bool"]: + seq_converted = _ffi.cast("const TSequence *", seq) + result = _lib.tpointseq_is_simple(seq_converted) _check_error() return result if result != _ffi.NULL else None -def temporal_restrict_minmax( - temp: "const Temporal *", min: bool, atfunc: bool -) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.temporal_restrict_minmax(temp_converted, min, atfunc) +def tpointseq_length(seq: Annotated[_ffi.CData, "const TSequence *"]) -> Annotated[float, "double"]: + seq_converted = _ffi.cast("const TSequence *", seq) + result = _lib.tpointseq_length(seq_converted) _check_error() return result if result != _ffi.NULL else None -def temporal_restrict_timestamptz( - temp: "const Temporal *", t: int, atfunc: bool -) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - t_converted = _ffi.cast("TimestampTz", t) - result = _lib.temporal_restrict_timestamptz(temp_converted, t_converted, atfunc) +def tpointseq_linear_trajectory( + seq: Annotated[_ffi.CData, "const TSequence *"], unary_union: bool +) -> Annotated[_ffi.CData, "GSERIALIZED *"]: + seq_converted = _ffi.cast("const TSequence *", seq) + result = _lib.tpointseq_linear_trajectory(seq_converted, unary_union) _check_error() return result if result != _ffi.NULL else None -def temporal_restrict_tstzset( - temp: "const Temporal *", s: "const Set *", atfunc: bool -) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - s_converted = _ffi.cast("const Set *", s) - result = _lib.temporal_restrict_tstzset(temp_converted, s_converted, atfunc) +def tgeoseq_stboxes( + seq: Annotated[_ffi.CData, "const TSequence *"], count: Annotated[_ffi.CData, "int *"] +) -> Annotated[_ffi.CData, "STBox *"]: + seq_converted = _ffi.cast("const TSequence *", seq) + count_converted = _ffi.cast("int *", count) + result = _lib.tgeoseq_stboxes(seq_converted, count_converted) _check_error() return result if result != _ffi.NULL else None -def temporal_restrict_tstzspan( - temp: "const Temporal *", s: "const Span *", atfunc: bool -) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - s_converted = _ffi.cast("const Span *", s) - result = _lib.temporal_restrict_tstzspan(temp_converted, s_converted, atfunc) +def tgeoseq_split_n_stboxes( + seq: Annotated[_ffi.CData, "const TSequence *"], max_count: int, count: Annotated[_ffi.CData, "int *"] +) -> Annotated[_ffi.CData, "STBox *"]: + seq_converted = _ffi.cast("const TSequence *", seq) + count_converted = _ffi.cast("int *", count) + result = _lib.tgeoseq_split_n_stboxes(seq_converted, max_count, count_converted) _check_error() return result if result != _ffi.NULL else None -def temporal_restrict_tstzspanset( - temp: "const Temporal *", ss: "const SpanSet *", atfunc: bool -) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.temporal_restrict_tstzspanset(temp_converted, ss_converted, atfunc) +def tpointseqset_azimuth(ss: Annotated[_ffi.CData, "const TSequenceSet *"]) -> Annotated[_ffi.CData, "TSequenceSet *"]: + ss_converted = _ffi.cast("const TSequenceSet *", ss) + result = _lib.tpointseqset_azimuth(ss_converted) _check_error() return result if result != _ffi.NULL else None -def temporal_restrict_value( - temp: "const Temporal *", value: "Datum", atfunc: bool -) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - value_converted = _ffi.cast("Datum", value) - result = _lib.temporal_restrict_value(temp_converted, value_converted, atfunc) +def tpointseqset_cumulative_length( + ss: Annotated[_ffi.CData, "const TSequenceSet *"], +) -> Annotated[_ffi.CData, "TSequenceSet *"]: + ss_converted = _ffi.cast("const TSequenceSet *", ss) + result = _lib.tpointseqset_cumulative_length(ss_converted) _check_error() return result if result != _ffi.NULL else None -def temporal_restrict_values( - temp: "const Temporal *", set: "const Set *", atfunc: bool -) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - set_converted = _ffi.cast("const Set *", set) - result = _lib.temporal_restrict_values(temp_converted, set_converted, atfunc) +def tpointseqset_is_simple(ss: Annotated[_ffi.CData, "const TSequenceSet *"]) -> Annotated[bool, "bool"]: + ss_converted = _ffi.cast("const TSequenceSet *", ss) + result = _lib.tpointseqset_is_simple(ss_converted) _check_error() return result if result != _ffi.NULL else None -def temporal_value_at_timestamptz( - temp: "const Temporal *", t: int, strict: bool -) -> "Datum *": - temp_converted = _ffi.cast("const Temporal *", temp) - t_converted = _ffi.cast("TimestampTz", t) - out_result = _ffi.new("Datum *") - result = _lib.temporal_value_at_timestamptz( - temp_converted, t_converted, strict, out_result - ) +def tpointseqset_length(ss: Annotated[_ffi.CData, "const TSequenceSet *"]) -> Annotated[float, "double"]: + ss_converted = _ffi.cast("const TSequenceSet *", ss) + result = _lib.tpointseqset_length(ss_converted) _check_error() - if result: - return out_result if out_result != _ffi.NULL else None - return None + return result if result != _ffi.NULL else None -def tinstant_restrict_tstzspan( - inst: "const TInstant *", period: "const Span *", atfunc: bool -) -> "TInstant *": - inst_converted = _ffi.cast("const TInstant *", inst) - period_converted = _ffi.cast("const Span *", period) - result = _lib.tinstant_restrict_tstzspan(inst_converted, period_converted, atfunc) +def tgeoseqset_stboxes( + ss: Annotated[_ffi.CData, "const TSequenceSet *"], count: Annotated[_ffi.CData, "int *"] +) -> Annotated[_ffi.CData, "STBox *"]: + ss_converted = _ffi.cast("const TSequenceSet *", ss) + count_converted = _ffi.cast("int *", count) + result = _lib.tgeoseqset_stboxes(ss_converted, count_converted) _check_error() return result if result != _ffi.NULL else None -def tinstant_restrict_tstzspanset( - inst: "const TInstant *", ss: "const SpanSet *", atfunc: bool -) -> "TInstant *": - inst_converted = _ffi.cast("const TInstant *", inst) - ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.tinstant_restrict_tstzspanset(inst_converted, ss_converted, atfunc) +def tgeoseqset_split_n_stboxes( + ss: Annotated[_ffi.CData, "const TSequenceSet *"], max_count: int, count: Annotated[_ffi.CData, "int *"] +) -> Annotated[_ffi.CData, "STBox *"]: + ss_converted = _ffi.cast("const TSequenceSet *", ss) + count_converted = _ffi.cast("int *", count) + result = _lib.tgeoseqset_split_n_stboxes(ss_converted, max_count, count_converted) _check_error() return result if result != _ffi.NULL else None -def tinstant_restrict_timestamptz( - inst: "const TInstant *", t: int, atfunc: bool -) -> "TInstant *": - inst_converted = _ffi.cast("const TInstant *", inst) - t_converted = _ffi.cast("TimestampTz", t) - result = _lib.tinstant_restrict_timestamptz(inst_converted, t_converted, atfunc) +def tpoint_get_coord( + temp: Annotated[_ffi.CData, "const Temporal *"], coord: int +) -> Annotated[_ffi.CData, "Temporal *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.tpoint_get_coord(temp_converted, coord) _check_error() return result if result != _ffi.NULL else None -def tinstant_restrict_tstzset( - inst: "const TInstant *", s: "const Set *", atfunc: bool -) -> "TInstant *": +def tgeominst_tgeoginst( + inst: Annotated[_ffi.CData, "const TInstant *"], oper: bool +) -> Annotated[_ffi.CData, "TInstant *"]: inst_converted = _ffi.cast("const TInstant *", inst) - s_converted = _ffi.cast("const Set *", s) - result = _lib.tinstant_restrict_tstzset(inst_converted, s_converted, atfunc) + result = _lib.tgeominst_tgeoginst(inst_converted, oper) _check_error() return result if result != _ffi.NULL else None -def tinstant_restrict_value( - inst: "const TInstant *", value: "Datum", atfunc: bool -) -> "TInstant *": - inst_converted = _ffi.cast("const TInstant *", inst) - value_converted = _ffi.cast("Datum", value) - result = _lib.tinstant_restrict_value(inst_converted, value_converted, atfunc) +def tgeomseq_tgeogseq( + seq: Annotated[_ffi.CData, "const TSequence *"], oper: bool +) -> Annotated[_ffi.CData, "TSequence *"]: + seq_converted = _ffi.cast("const TSequence *", seq) + result = _lib.tgeomseq_tgeogseq(seq_converted, oper) _check_error() return result if result != _ffi.NULL else None -def tinstant_restrict_values( - inst: "const TInstant *", set: "const Set *", atfunc: bool -) -> "TInstant *": - inst_converted = _ffi.cast("const TInstant *", inst) - set_converted = _ffi.cast("const Set *", set) - result = _lib.tinstant_restrict_values(inst_converted, set_converted, atfunc) +def tgeomseqset_tgeogseqset( + ss: Annotated[_ffi.CData, "const TSequenceSet *"], oper: bool +) -> Annotated[_ffi.CData, "TSequenceSet *"]: + ss_converted = _ffi.cast("const TSequenceSet *", ss) + result = _lib.tgeomseqset_tgeogseqset(ss_converted, oper) _check_error() return result if result != _ffi.NULL else None -def tnumber_restrict_span( - temp: "const Temporal *", span: "const Span *", atfunc: bool -) -> "Temporal *": +def tgeom_tgeog(temp: Annotated[_ffi.CData, "const Temporal *"], oper: bool) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - span_converted = _ffi.cast("const Span *", span) - result = _lib.tnumber_restrict_span(temp_converted, span_converted, atfunc) + result = _lib.tgeom_tgeog(temp_converted, oper) _check_error() return result if result != _ffi.NULL else None -def tnumber_restrict_spanset( - temp: "const Temporal *", ss: "const SpanSet *", atfunc: bool -) -> "Temporal *": +def tgeo_tpoint(temp: Annotated[_ffi.CData, "const Temporal *"], oper: bool) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.tnumber_restrict_spanset(temp_converted, ss_converted, atfunc) + result = _lib.tgeo_tpoint(temp_converted, oper) _check_error() return result if result != _ffi.NULL else None -def tnumberinst_restrict_span( - inst: "const TInstant *", span: "const Span *", atfunc: bool -) -> "TInstant *": - inst_converted = _ffi.cast("const TInstant *", inst) - span_converted = _ffi.cast("const Span *", span) - result = _lib.tnumberinst_restrict_span(inst_converted, span_converted, atfunc) +def tspatialinst_set_srid( + inst: Annotated[_ffi.CData, "TInstant *"], srid: Annotated[_ffi.CData, "int32_t"] +) -> Annotated[None, "void"]: + inst_converted = _ffi.cast("TInstant *", inst) + srid_converted = _ffi.cast("int32_t", srid) + _lib.tspatialinst_set_srid(inst_converted, srid_converted) _check_error() - return result if result != _ffi.NULL else None -def tnumberinst_restrict_spanset( - inst: "const TInstant *", ss: "const SpanSet *", atfunc: bool -) -> "TInstant *": - inst_converted = _ffi.cast("const TInstant *", inst) - ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.tnumberinst_restrict_spanset(inst_converted, ss_converted, atfunc) +def tpointseq_make_simple( + seq: Annotated[_ffi.CData, "const TSequence *"], count: Annotated[_ffi.CData, "int *"] +) -> Annotated[_ffi.CData, "TSequence **"]: + seq_converted = _ffi.cast("const TSequence *", seq) + count_converted = _ffi.cast("int *", count) + result = _lib.tpointseq_make_simple(seq_converted, count_converted) _check_error() return result if result != _ffi.NULL else None -def tnumberseqset_restrict_span( - ss: "const TSequenceSet *", span: "const Span *", atfunc: bool -) -> "TSequenceSet *": +def tspatialseq_set_srid( + seq: Annotated[_ffi.CData, "TSequence *"], srid: Annotated[_ffi.CData, "int32_t"] +) -> Annotated[None, "void"]: + seq_converted = _ffi.cast("TSequence *", seq) + srid_converted = _ffi.cast("int32_t", srid) + _lib.tspatialseq_set_srid(seq_converted, srid_converted) + _check_error() + + +def tpointseqset_make_simple( + ss: Annotated[_ffi.CData, "const TSequenceSet *"], count: Annotated[_ffi.CData, "int *"] +) -> Annotated[_ffi.CData, "TSequence **"]: ss_converted = _ffi.cast("const TSequenceSet *", ss) - span_converted = _ffi.cast("const Span *", span) - result = _lib.tnumberseqset_restrict_span(ss_converted, span_converted, atfunc) + count_converted = _ffi.cast("int *", count) + result = _lib.tpointseqset_make_simple(ss_converted, count_converted) + _check_error() + return result if result != _ffi.NULL else None + + +def tspatialseqset_set_srid( + ss: Annotated[_ffi.CData, "TSequenceSet *"], srid: Annotated[_ffi.CData, "int32_t"] +) -> Annotated[None, "void"]: + ss_converted = _ffi.cast("TSequenceSet *", ss) + srid_converted = _ffi.cast("int32_t", srid) + _lib.tspatialseqset_set_srid(ss_converted, srid_converted) + _check_error() + + +def tpointseq_twcentroid(seq: Annotated[_ffi.CData, "const TSequence *"]) -> Annotated[_ffi.CData, "GSERIALIZED *"]: + seq_converted = _ffi.cast("const TSequence *", seq) + result = _lib.tpointseq_twcentroid(seq_converted) _check_error() return result if result != _ffi.NULL else None -def tnumberseqset_restrict_spanset( - ss: "const TSequenceSet *", spanset: "const SpanSet *", atfunc: bool -) -> "TSequenceSet *": +def tpointseqset_twcentroid( + ss: Annotated[_ffi.CData, "const TSequenceSet *"], +) -> Annotated[_ffi.CData, "GSERIALIZED *"]: ss_converted = _ffi.cast("const TSequenceSet *", ss) - spanset_converted = _ffi.cast("const SpanSet *", spanset) - result = _lib.tnumberseqset_restrict_spanset( - ss_converted, spanset_converted, atfunc - ) + result = _lib.tpointseqset_twcentroid(ss_converted) _check_error() return result if result != _ffi.NULL else None -def tnpoint_restrict_geom( - temp: "const Temporal *", - gs: "const GSERIALIZED *", - zspan: "const Span *", - atfunc: "const bool", -) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - gs_converted = _ffi.cast("const GSERIALIZED *", gs) - zspan_converted = _ffi.cast("const Span *", zspan) - atfunc_converted = _ffi.cast("const bool", atfunc) - result = _lib.tnpoint_restrict_geom( - temp_converted, gs_converted, zspan_converted, atfunc_converted - ) +def npoint_as_ewkt(np: Annotated[_ffi.CData, "const Npoint *"], maxdd: int) -> Annotated[str, "char *"]: + np_converted = _ffi.cast("const Npoint *", np) + result = _lib.npoint_as_ewkt(np_converted, maxdd) _check_error() + result = _ffi.string(result).decode("utf-8") return result if result != _ffi.NULL else None -def tnpoint_restrict_stbox( - temp: "const Temporal *", box: "const STBox *", border_inc: bool, atfunc: bool -) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - box_converted = _ffi.cast("const STBox *", box) - result = _lib.tnpoint_restrict_stbox( - temp_converted, box_converted, border_inc, atfunc - ) +def npoint_as_hexwkb( + np: Annotated[_ffi.CData, "const Npoint *"], variant: int +) -> tuple[Annotated[str, "char *"], Annotated[_ffi.CData, "size_t *"]]: + np_converted = _ffi.cast("const Npoint *", np) + variant_converted = _ffi.cast("uint8_t", variant) + size_out = _ffi.new("size_t *") + result = _lib.npoint_as_hexwkb(np_converted, variant_converted, size_out) _check_error() - return result if result != _ffi.NULL else None + result = _ffi.string(result).decode("utf-8") + return result if result != _ffi.NULL else None, size_out[0] -def tpoint_restrict_geom( - temp: "const Temporal *", - gs: "const GSERIALIZED *", - zspan: "const Span *", - atfunc: "const bool", -) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - gs_converted = _ffi.cast("const GSERIALIZED *", gs) - zspan_converted = _ffi.cast("const Span *", zspan) - atfunc_converted = _ffi.cast("const bool", atfunc) - result = _lib.tpoint_restrict_geom( - temp_converted, gs_converted, zspan_converted, atfunc_converted - ) +def npoint_as_text(np: Annotated[_ffi.CData, "const Npoint *"], maxdd: int) -> Annotated[str, "char *"]: + np_converted = _ffi.cast("const Npoint *", np) + result = _lib.npoint_as_text(np_converted, maxdd) _check_error() + result = _ffi.string(result).decode("utf-8") return result if result != _ffi.NULL else None -def tpoint_restrict_stbox( - temp: "const Temporal *", box: "const STBox *", border_inc: bool, atfunc: bool -) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - box_converted = _ffi.cast("const STBox *", box) - result = _lib.tpoint_restrict_stbox( - temp_converted, box_converted, border_inc, atfunc - ) +def npoint_as_wkb( + np: Annotated[_ffi.CData, "const Npoint *"], variant: int +) -> tuple[Annotated[_ffi.CData, "uint8_t *"], Annotated[_ffi.CData, "size_t *"]]: + np_converted = _ffi.cast("const Npoint *", np) + variant_converted = _ffi.cast("uint8_t", variant) + size_out = _ffi.new("size_t *") + result = _lib.npoint_as_wkb(np_converted, variant_converted, size_out) _check_error() - return result if result != _ffi.NULL else None + return result if result != _ffi.NULL else None, size_out[0] -def tpointinst_restrict_geom( - inst: "const TInstant *", - gs: "const GSERIALIZED *", - zspan: "const Span *", - atfunc: bool, -) -> "TInstant *": - inst_converted = _ffi.cast("const TInstant *", inst) - gs_converted = _ffi.cast("const GSERIALIZED *", gs) - zspan_converted = _ffi.cast("const Span *", zspan) - result = _lib.tpointinst_restrict_geom( - inst_converted, gs_converted, zspan_converted, atfunc - ) +def npoint_from_hexwkb(hexwkb: str) -> Annotated[_ffi.CData, "Npoint *"]: + hexwkb_converted = hexwkb.encode("utf-8") + result = _lib.npoint_from_hexwkb(hexwkb_converted) _check_error() return result if result != _ffi.NULL else None -def tpointinst_restrict_stbox( - inst: "const TInstant *", box: "const STBox *", border_inc: bool, atfunc: bool -) -> "TInstant *": - inst_converted = _ffi.cast("const TInstant *", inst) - box_converted = _ffi.cast("const STBox *", box) - result = _lib.tpointinst_restrict_stbox( - inst_converted, box_converted, border_inc, atfunc - ) +def npoint_from_wkb( + wkb: Annotated[_ffi.CData, "const uint8_t *"], size: Annotated[_ffi.CData, "size_t"] +) -> Annotated[_ffi.CData, "Npoint *"]: + wkb_converted = _ffi.cast("const uint8_t *", wkb) + size_converted = _ffi.cast("size_t", size) + result = _lib.npoint_from_wkb(wkb_converted, size_converted) _check_error() return result if result != _ffi.NULL else None -def tpointseq_restrict_geom( - seq: "const TSequence *", - gs: "const GSERIALIZED *", - zspan: "const Span *", - atfunc: bool, -) -> "Temporal *": - seq_converted = _ffi.cast("const TSequence *", seq) - gs_converted = _ffi.cast("const GSERIALIZED *", gs) - zspan_converted = _ffi.cast("const Span *", zspan) - result = _lib.tpointseq_restrict_geom( - seq_converted, gs_converted, zspan_converted, atfunc - ) +def npoint_in(string: str) -> Annotated[_ffi.CData, "Npoint *"]: + string_converted = string.encode("utf-8") + result = _lib.npoint_in(string_converted) _check_error() return result if result != _ffi.NULL else None -def tpointseq_restrict_stbox( - seq: "const TSequence *", box: "const STBox *", border_inc: bool, atfunc: bool -) -> "Temporal *": - seq_converted = _ffi.cast("const TSequence *", seq) - box_converted = _ffi.cast("const STBox *", box) - result = _lib.tpointseq_restrict_stbox( - seq_converted, box_converted, border_inc, atfunc - ) +def npoint_out(np: Annotated[_ffi.CData, "const Npoint *"], maxdd: int) -> Annotated[str, "char *"]: + np_converted = _ffi.cast("const Npoint *", np) + result = _lib.npoint_out(np_converted, maxdd) _check_error() + result = _ffi.string(result).decode("utf-8") return result if result != _ffi.NULL else None -def tpointseqset_restrict_geom( - ss: "const TSequenceSet *", - gs: "const GSERIALIZED *", - zspan: "const Span *", - atfunc: bool, -) -> "TSequenceSet *": - ss_converted = _ffi.cast("const TSequenceSet *", ss) - gs_converted = _ffi.cast("const GSERIALIZED *", gs) - zspan_converted = _ffi.cast("const Span *", zspan) - result = _lib.tpointseqset_restrict_geom( - ss_converted, gs_converted, zspan_converted, atfunc - ) +def nsegment_in(string: str) -> Annotated[_ffi.CData, "Nsegment *"]: + string_converted = string.encode("utf-8") + result = _lib.nsegment_in(string_converted) _check_error() return result if result != _ffi.NULL else None -def tpointseqset_restrict_stbox( - ss: "const TSequenceSet *", box: "const STBox *", border_inc: bool, atfunc: bool -) -> "TSequenceSet *": - ss_converted = _ffi.cast("const TSequenceSet *", ss) - box_converted = _ffi.cast("const STBox *", box) - result = _lib.tpointseqset_restrict_stbox( - ss_converted, box_converted, border_inc, atfunc - ) +def nsegment_out(ns: Annotated[_ffi.CData, "const Nsegment *"], maxdd: int) -> Annotated[str, "char *"]: + ns_converted = _ffi.cast("const Nsegment *", ns) + result = _lib.nsegment_out(ns_converted, maxdd) _check_error() + result = _ffi.string(result).decode("utf-8") return result if result != _ffi.NULL else None -def tsequence_at_timestamptz(seq: "const TSequence *", t: int) -> "TInstant *": - seq_converted = _ffi.cast("const TSequence *", seq) - t_converted = _ffi.cast("TimestampTz", t) - result = _lib.tsequence_at_timestamptz(seq_converted, t_converted) +def npoint_make(rid: int, pos: float) -> Annotated[_ffi.CData, "Npoint *"]: + rid_converted = _ffi.cast("int64", rid) + result = _lib.npoint_make(rid_converted, pos) _check_error() return result if result != _ffi.NULL else None -def tsequence_restrict_tstzspan( - seq: "const TSequence *", s: "const Span *", atfunc: bool -) -> "Temporal *": - seq_converted = _ffi.cast("const TSequence *", seq) - s_converted = _ffi.cast("const Span *", s) - result = _lib.tsequence_restrict_tstzspan(seq_converted, s_converted, atfunc) +def nsegment_make(rid: int, pos1: float, pos2: float) -> Annotated[_ffi.CData, "Nsegment *"]: + rid_converted = _ffi.cast("int64", rid) + result = _lib.nsegment_make(rid_converted, pos1, pos2) _check_error() return result if result != _ffi.NULL else None -def tsequence_restrict_tstzspanset( - seq: "const TSequence *", ss: "const SpanSet *", atfunc: bool -) -> "Temporal *": - seq_converted = _ffi.cast("const TSequence *", seq) - ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.tsequence_restrict_tstzspanset(seq_converted, ss_converted, atfunc) +def geompoint_to_npoint(gs: Annotated[_ffi.CData, "const GSERIALIZED *"]) -> Annotated[_ffi.CData, "Npoint *"]: + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + result = _lib.geompoint_to_npoint(gs_converted) _check_error() return result if result != _ffi.NULL else None -def tsequenceset_restrict_minmax( - ss: "const TSequenceSet *", min: bool, atfunc: bool -) -> "TSequenceSet *": - ss_converted = _ffi.cast("const TSequenceSet *", ss) - result = _lib.tsequenceset_restrict_minmax(ss_converted, min, atfunc) +def geom_to_nsegment(gs: Annotated[_ffi.CData, "const GSERIALIZED *"]) -> Annotated[_ffi.CData, "Nsegment *"]: + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + result = _lib.geom_to_nsegment(gs_converted) _check_error() return result if result != _ffi.NULL else None -def tsequenceset_restrict_tstzspan( - ss: "const TSequenceSet *", s: "const Span *", atfunc: bool -) -> "TSequenceSet *": - ss_converted = _ffi.cast("const TSequenceSet *", ss) - s_converted = _ffi.cast("const Span *", s) - result = _lib.tsequenceset_restrict_tstzspan(ss_converted, s_converted, atfunc) +def npoint_to_geompoint(np: Annotated[_ffi.CData, "const Npoint *"]) -> Annotated[_ffi.CData, "GSERIALIZED *"]: + np_converted = _ffi.cast("const Npoint *", np) + result = _lib.npoint_to_geompoint(np_converted) _check_error() return result if result != _ffi.NULL else None -def tsequenceset_restrict_tstzspanset( - ss: "const TSequenceSet *", ps: "const SpanSet *", atfunc: bool -) -> "TSequenceSet *": - ss_converted = _ffi.cast("const TSequenceSet *", ss) - ps_converted = _ffi.cast("const SpanSet *", ps) - result = _lib.tsequenceset_restrict_tstzspanset(ss_converted, ps_converted, atfunc) +def npoint_to_nsegment(np: Annotated[_ffi.CData, "const Npoint *"]) -> Annotated[_ffi.CData, "Nsegment *"]: + np_converted = _ffi.cast("const Npoint *", np) + result = _lib.npoint_to_nsegment(np_converted) _check_error() return result if result != _ffi.NULL else None -def tsequenceset_restrict_timestamptz( - ss: "const TSequenceSet *", t: int, atfunc: bool -) -> "Temporal *": - ss_converted = _ffi.cast("const TSequenceSet *", ss) - t_converted = _ffi.cast("TimestampTz", t) - result = _lib.tsequenceset_restrict_timestamptz(ss_converted, t_converted, atfunc) +def npoint_to_stbox(np: Annotated[_ffi.CData, "const Npoint *"]) -> Annotated[_ffi.CData, "STBox *"]: + np_converted = _ffi.cast("const Npoint *", np) + result = _lib.npoint_to_stbox(np_converted) _check_error() return result if result != _ffi.NULL else None -def tsequenceset_restrict_tstzset( - ss: "const TSequenceSet *", s: "const Set *", atfunc: bool -) -> "Temporal *": - ss_converted = _ffi.cast("const TSequenceSet *", ss) - s_converted = _ffi.cast("const Set *", s) - result = _lib.tsequenceset_restrict_tstzset(ss_converted, s_converted, atfunc) +def nsegment_to_geom(ns: Annotated[_ffi.CData, "const Nsegment *"]) -> Annotated[_ffi.CData, "GSERIALIZED *"]: + ns_converted = _ffi.cast("const Nsegment *", ns) + result = _lib.nsegment_to_geom(ns_converted) _check_error() return result if result != _ffi.NULL else None -def tsequenceset_restrict_value( - ss: "const TSequenceSet *", value: "Datum", atfunc: bool -) -> "TSequenceSet *": - ss_converted = _ffi.cast("const TSequenceSet *", ss) - value_converted = _ffi.cast("Datum", value) - result = _lib.tsequenceset_restrict_value(ss_converted, value_converted, atfunc) +def nsegment_to_stbox(np: Annotated[_ffi.CData, "const Nsegment *"]) -> Annotated[_ffi.CData, "STBox *"]: + np_converted = _ffi.cast("const Nsegment *", np) + result = _lib.nsegment_to_stbox(np_converted) _check_error() return result if result != _ffi.NULL else None -def tsequenceset_restrict_values( - ss: "const TSequenceSet *", s: "const Set *", atfunc: bool -) -> "TSequenceSet *": - ss_converted = _ffi.cast("const TSequenceSet *", ss) - s_converted = _ffi.cast("const Set *", s) - result = _lib.tsequenceset_restrict_values(ss_converted, s_converted, atfunc) +def npoint_hash(np: Annotated[_ffi.CData, "const Npoint *"]) -> Annotated[int, "uint32"]: + np_converted = _ffi.cast("const Npoint *", np) + result = _lib.npoint_hash(np_converted) _check_error() return result if result != _ffi.NULL else None -def tinstant_cmp(inst1: "const TInstant *", inst2: "const TInstant *") -> "int": - inst1_converted = _ffi.cast("const TInstant *", inst1) - inst2_converted = _ffi.cast("const TInstant *", inst2) - result = _lib.tinstant_cmp(inst1_converted, inst2_converted) +def npoint_hash_extended(np: Annotated[_ffi.CData, "const Npoint *"], seed: int) -> Annotated[int, "uint64"]: + np_converted = _ffi.cast("const Npoint *", np) + seed_converted = _ffi.cast("uint64", seed) + result = _lib.npoint_hash_extended(np_converted, seed_converted) _check_error() return result if result != _ffi.NULL else None -def tinstant_eq(inst1: "const TInstant *", inst2: "const TInstant *") -> "bool": - inst1_converted = _ffi.cast("const TInstant *", inst1) - inst2_converted = _ffi.cast("const TInstant *", inst2) - result = _lib.tinstant_eq(inst1_converted, inst2_converted) +def npoint_position(np: Annotated[_ffi.CData, "const Npoint *"]) -> Annotated[float, "double"]: + np_converted = _ffi.cast("const Npoint *", np) + result = _lib.npoint_position(np_converted) _check_error() return result if result != _ffi.NULL else None -def tsequence_cmp(seq1: "const TSequence *", seq2: "const TSequence *") -> "int": - seq1_converted = _ffi.cast("const TSequence *", seq1) - seq2_converted = _ffi.cast("const TSequence *", seq2) - result = _lib.tsequence_cmp(seq1_converted, seq2_converted) +def npoint_route(np: Annotated[_ffi.CData, "const Npoint *"]) -> Annotated[int, "int64"]: + np_converted = _ffi.cast("const Npoint *", np) + result = _lib.npoint_route(np_converted) _check_error() return result if result != _ffi.NULL else None -def tsequence_eq(seq1: "const TSequence *", seq2: "const TSequence *") -> "bool": - seq1_converted = _ffi.cast("const TSequence *", seq1) - seq2_converted = _ffi.cast("const TSequence *", seq2) - result = _lib.tsequence_eq(seq1_converted, seq2_converted) +def nsegment_end_position(ns: Annotated[_ffi.CData, "const Nsegment *"]) -> Annotated[float, "double"]: + ns_converted = _ffi.cast("const Nsegment *", ns) + result = _lib.nsegment_end_position(ns_converted) _check_error() return result if result != _ffi.NULL else None -def tsequenceset_cmp(ss1: "const TSequenceSet *", ss2: "const TSequenceSet *") -> "int": - ss1_converted = _ffi.cast("const TSequenceSet *", ss1) - ss2_converted = _ffi.cast("const TSequenceSet *", ss2) - result = _lib.tsequenceset_cmp(ss1_converted, ss2_converted) +def nsegment_route(ns: Annotated[_ffi.CData, "const Nsegment *"]) -> Annotated[int, "int64"]: + ns_converted = _ffi.cast("const Nsegment *", ns) + result = _lib.nsegment_route(ns_converted) _check_error() return result if result != _ffi.NULL else None -def tsequenceset_eq(ss1: "const TSequenceSet *", ss2: "const TSequenceSet *") -> "bool": - ss1_converted = _ffi.cast("const TSequenceSet *", ss1) - ss2_converted = _ffi.cast("const TSequenceSet *", ss2) - result = _lib.tsequenceset_eq(ss1_converted, ss2_converted) +def nsegment_start_position(ns: Annotated[_ffi.CData, "const Nsegment *"]) -> Annotated[float, "double"]: + ns_converted = _ffi.cast("const Nsegment *", ns) + result = _lib.nsegment_start_position(ns_converted) _check_error() return result if result != _ffi.NULL else None -def always_eq_base_temporal(value: "Datum", temp: "const Temporal *") -> "int": - value_converted = _ffi.cast("Datum", value) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.always_eq_base_temporal(value_converted, temp_converted) +def route_exists(rid: int) -> Annotated[bool, "bool"]: + rid_converted = _ffi.cast("int64", rid) + result = _lib.route_exists(rid_converted) _check_error() return result if result != _ffi.NULL else None -def always_eq_temporal_base(temp: "const Temporal *", value: "Datum") -> "int": - temp_converted = _ffi.cast("const Temporal *", temp) - value_converted = _ffi.cast("Datum", value) - result = _lib.always_eq_temporal_base(temp_converted, value_converted) +def route_geom(rid: int) -> Annotated[_ffi.CData, "GSERIALIZED *"]: + rid_converted = _ffi.cast("int64", rid) + result = _lib.route_geom(rid_converted) _check_error() return result if result != _ffi.NULL else None -def always_ne_base_temporal(value: "Datum", temp: "const Temporal *") -> "int": - value_converted = _ffi.cast("Datum", value) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.always_ne_base_temporal(value_converted, temp_converted) +def route_length(rid: int) -> Annotated[float, "double"]: + rid_converted = _ffi.cast("int64", rid) + result = _lib.route_length(rid_converted) _check_error() return result if result != _ffi.NULL else None -def always_ne_temporal_base(temp: "const Temporal *", value: "Datum") -> "int": - temp_converted = _ffi.cast("const Temporal *", temp) - value_converted = _ffi.cast("Datum", value) - result = _lib.always_ne_temporal_base(temp_converted, value_converted) +def npoint_round(np: Annotated[_ffi.CData, "const Npoint *"], maxdd: int) -> Annotated[_ffi.CData, "Npoint *"]: + np_converted = _ffi.cast("const Npoint *", np) + result = _lib.npoint_round(np_converted, maxdd) _check_error() return result if result != _ffi.NULL else None -def always_ge_base_temporal(value: "Datum", temp: "const Temporal *") -> "int": - value_converted = _ffi.cast("Datum", value) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.always_ge_base_temporal(value_converted, temp_converted) +def nsegment_round(ns: Annotated[_ffi.CData, "const Nsegment *"], maxdd: int) -> Annotated[_ffi.CData, "Nsegment *"]: + ns_converted = _ffi.cast("const Nsegment *", ns) + result = _lib.nsegment_round(ns_converted, maxdd) _check_error() return result if result != _ffi.NULL else None -def always_ge_temporal_base(temp: "const Temporal *", value: "Datum") -> "int": - temp_converted = _ffi.cast("const Temporal *", temp) - value_converted = _ffi.cast("Datum", value) - result = _lib.always_ge_temporal_base(temp_converted, value_converted) +def get_srid_ways() -> Annotated[_ffi.CData, "int32_t"]: + result = _lib.get_srid_ways() _check_error() return result if result != _ffi.NULL else None -def always_gt_base_temporal(value: "Datum", temp: "const Temporal *") -> "int": - value_converted = _ffi.cast("Datum", value) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.always_gt_base_temporal(value_converted, temp_converted) +def npoint_srid(np: Annotated[_ffi.CData, "const Npoint *"]) -> Annotated[_ffi.CData, "int32_t"]: + np_converted = _ffi.cast("const Npoint *", np) + result = _lib.npoint_srid(np_converted) _check_error() return result if result != _ffi.NULL else None -def always_gt_temporal_base(temp: "const Temporal *", value: "Datum") -> "int": - temp_converted = _ffi.cast("const Temporal *", temp) - value_converted = _ffi.cast("Datum", value) - result = _lib.always_gt_temporal_base(temp_converted, value_converted) +def nsegment_srid(ns: Annotated[_ffi.CData, "const Nsegment *"]) -> Annotated[_ffi.CData, "int32_t"]: + ns_converted = _ffi.cast("const Nsegment *", ns) + result = _lib.nsegment_srid(ns_converted) _check_error() return result if result != _ffi.NULL else None -def always_le_base_temporal(value: "Datum", temp: "const Temporal *") -> "int": - value_converted = _ffi.cast("Datum", value) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.always_le_base_temporal(value_converted, temp_converted) +def npoint_timestamptz_to_stbox( + np: Annotated[_ffi.CData, "const Npoint *"], t: int +) -> Annotated[_ffi.CData, "STBox *"]: + np_converted = _ffi.cast("const Npoint *", np) + t_converted = _ffi.cast("TimestampTz", t) + result = _lib.npoint_timestamptz_to_stbox(np_converted, t_converted) _check_error() return result if result != _ffi.NULL else None -def always_le_temporal_base(temp: "const Temporal *", value: "Datum") -> "int": - temp_converted = _ffi.cast("const Temporal *", temp) - value_converted = _ffi.cast("Datum", value) - result = _lib.always_le_temporal_base(temp_converted, value_converted) +def npoint_tstzspan_to_stbox( + np: Annotated[_ffi.CData, "const Npoint *"], s: Annotated[_ffi.CData, "const Span *"] +) -> Annotated[_ffi.CData, "STBox *"]: + np_converted = _ffi.cast("const Npoint *", np) + s_converted = _ffi.cast("const Span *", s) + result = _lib.npoint_tstzspan_to_stbox(np_converted, s_converted) _check_error() return result if result != _ffi.NULL else None -def always_lt_base_temporal(value: "Datum", temp: "const Temporal *") -> "int": - value_converted = _ffi.cast("Datum", value) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.always_lt_base_temporal(value_converted, temp_converted) +def npoint_cmp( + np1: Annotated[_ffi.CData, "const Npoint *"], np2: Annotated[_ffi.CData, "const Npoint *"] +) -> Annotated[int, "int"]: + np1_converted = _ffi.cast("const Npoint *", np1) + np2_converted = _ffi.cast("const Npoint *", np2) + result = _lib.npoint_cmp(np1_converted, np2_converted) _check_error() return result if result != _ffi.NULL else None -def always_lt_temporal_base(temp: "const Temporal *", value: "Datum") -> "int": - temp_converted = _ffi.cast("const Temporal *", temp) - value_converted = _ffi.cast("Datum", value) - result = _lib.always_lt_temporal_base(temp_converted, value_converted) +def npoint_eq( + np1: Annotated[_ffi.CData, "const Npoint *"], np2: Annotated[_ffi.CData, "const Npoint *"] +) -> Annotated[bool, "bool"]: + np1_converted = _ffi.cast("const Npoint *", np1) + np2_converted = _ffi.cast("const Npoint *", np2) + result = _lib.npoint_eq(np1_converted, np2_converted) _check_error() return result if result != _ffi.NULL else None -def ever_eq_base_temporal(value: "Datum", temp: "const Temporal *") -> "int": - value_converted = _ffi.cast("Datum", value) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.ever_eq_base_temporal(value_converted, temp_converted) +def npoint_ge( + np1: Annotated[_ffi.CData, "const Npoint *"], np2: Annotated[_ffi.CData, "const Npoint *"] +) -> Annotated[bool, "bool"]: + np1_converted = _ffi.cast("const Npoint *", np1) + np2_converted = _ffi.cast("const Npoint *", np2) + result = _lib.npoint_ge(np1_converted, np2_converted) _check_error() return result if result != _ffi.NULL else None -def ever_eq_temporal_base(temp: "const Temporal *", value: "Datum") -> "int": - temp_converted = _ffi.cast("const Temporal *", temp) - value_converted = _ffi.cast("Datum", value) - result = _lib.ever_eq_temporal_base(temp_converted, value_converted) +def npoint_gt( + np1: Annotated[_ffi.CData, "const Npoint *"], np2: Annotated[_ffi.CData, "const Npoint *"] +) -> Annotated[bool, "bool"]: + np1_converted = _ffi.cast("const Npoint *", np1) + np2_converted = _ffi.cast("const Npoint *", np2) + result = _lib.npoint_gt(np1_converted, np2_converted) _check_error() return result if result != _ffi.NULL else None -def ever_ne_base_temporal(value: "Datum", temp: "const Temporal *") -> "int": - value_converted = _ffi.cast("Datum", value) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.ever_ne_base_temporal(value_converted, temp_converted) +def npoint_le( + np1: Annotated[_ffi.CData, "const Npoint *"], np2: Annotated[_ffi.CData, "const Npoint *"] +) -> Annotated[bool, "bool"]: + np1_converted = _ffi.cast("const Npoint *", np1) + np2_converted = _ffi.cast("const Npoint *", np2) + result = _lib.npoint_le(np1_converted, np2_converted) _check_error() return result if result != _ffi.NULL else None -def ever_ne_temporal_base(temp: "const Temporal *", value: "Datum") -> "int": - temp_converted = _ffi.cast("const Temporal *", temp) - value_converted = _ffi.cast("Datum", value) - result = _lib.ever_ne_temporal_base(temp_converted, value_converted) +def npoint_lt( + np1: Annotated[_ffi.CData, "const Npoint *"], np2: Annotated[_ffi.CData, "const Npoint *"] +) -> Annotated[bool, "bool"]: + np1_converted = _ffi.cast("const Npoint *", np1) + np2_converted = _ffi.cast("const Npoint *", np2) + result = _lib.npoint_lt(np1_converted, np2_converted) _check_error() return result if result != _ffi.NULL else None -def ever_ge_base_temporal(value: "Datum", temp: "const Temporal *") -> "int": - value_converted = _ffi.cast("Datum", value) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.ever_ge_base_temporal(value_converted, temp_converted) +def npoint_ne( + np1: Annotated[_ffi.CData, "const Npoint *"], np2: Annotated[_ffi.CData, "const Npoint *"] +) -> Annotated[bool, "bool"]: + np1_converted = _ffi.cast("const Npoint *", np1) + np2_converted = _ffi.cast("const Npoint *", np2) + result = _lib.npoint_ne(np1_converted, np2_converted) _check_error() return result if result != _ffi.NULL else None -def ever_ge_temporal_base(temp: "const Temporal *", value: "Datum") -> "int": - temp_converted = _ffi.cast("const Temporal *", temp) - value_converted = _ffi.cast("Datum", value) - result = _lib.ever_ge_temporal_base(temp_converted, value_converted) +def npoint_same( + np1: Annotated[_ffi.CData, "const Npoint *"], np2: Annotated[_ffi.CData, "const Npoint *"] +) -> Annotated[bool, "bool"]: + np1_converted = _ffi.cast("const Npoint *", np1) + np2_converted = _ffi.cast("const Npoint *", np2) + result = _lib.npoint_same(np1_converted, np2_converted) _check_error() return result if result != _ffi.NULL else None -def ever_gt_base_temporal(value: "Datum", temp: "const Temporal *") -> "int": - value_converted = _ffi.cast("Datum", value) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.ever_gt_base_temporal(value_converted, temp_converted) +def nsegment_cmp( + ns1: Annotated[_ffi.CData, "const Nsegment *"], ns2: Annotated[_ffi.CData, "const Nsegment *"] +) -> Annotated[int, "int"]: + ns1_converted = _ffi.cast("const Nsegment *", ns1) + ns2_converted = _ffi.cast("const Nsegment *", ns2) + result = _lib.nsegment_cmp(ns1_converted, ns2_converted) _check_error() return result if result != _ffi.NULL else None -def ever_gt_temporal_base(temp: "const Temporal *", value: "Datum") -> "int": - temp_converted = _ffi.cast("const Temporal *", temp) - value_converted = _ffi.cast("Datum", value) - result = _lib.ever_gt_temporal_base(temp_converted, value_converted) +def nsegment_eq( + ns1: Annotated[_ffi.CData, "const Nsegment *"], ns2: Annotated[_ffi.CData, "const Nsegment *"] +) -> Annotated[bool, "bool"]: + ns1_converted = _ffi.cast("const Nsegment *", ns1) + ns2_converted = _ffi.cast("const Nsegment *", ns2) + result = _lib.nsegment_eq(ns1_converted, ns2_converted) _check_error() return result if result != _ffi.NULL else None -def ever_le_base_temporal(value: "Datum", temp: "const Temporal *") -> "int": - value_converted = _ffi.cast("Datum", value) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.ever_le_base_temporal(value_converted, temp_converted) +def nsegment_ge( + ns1: Annotated[_ffi.CData, "const Nsegment *"], ns2: Annotated[_ffi.CData, "const Nsegment *"] +) -> Annotated[bool, "bool"]: + ns1_converted = _ffi.cast("const Nsegment *", ns1) + ns2_converted = _ffi.cast("const Nsegment *", ns2) + result = _lib.nsegment_ge(ns1_converted, ns2_converted) _check_error() return result if result != _ffi.NULL else None -def ever_le_temporal_base(temp: "const Temporal *", value: "Datum") -> "int": - temp_converted = _ffi.cast("const Temporal *", temp) - value_converted = _ffi.cast("Datum", value) - result = _lib.ever_le_temporal_base(temp_converted, value_converted) +def nsegment_gt( + ns1: Annotated[_ffi.CData, "const Nsegment *"], ns2: Annotated[_ffi.CData, "const Nsegment *"] +) -> Annotated[bool, "bool"]: + ns1_converted = _ffi.cast("const Nsegment *", ns1) + ns2_converted = _ffi.cast("const Nsegment *", ns2) + result = _lib.nsegment_gt(ns1_converted, ns2_converted) _check_error() return result if result != _ffi.NULL else None -def ever_lt_base_temporal(value: "Datum", temp: "const Temporal *") -> "int": - value_converted = _ffi.cast("Datum", value) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.ever_lt_base_temporal(value_converted, temp_converted) +def nsegment_le( + ns1: Annotated[_ffi.CData, "const Nsegment *"], ns2: Annotated[_ffi.CData, "const Nsegment *"] +) -> Annotated[bool, "bool"]: + ns1_converted = _ffi.cast("const Nsegment *", ns1) + ns2_converted = _ffi.cast("const Nsegment *", ns2) + result = _lib.nsegment_le(ns1_converted, ns2_converted) _check_error() return result if result != _ffi.NULL else None -def ever_lt_temporal_base(temp: "const Temporal *", value: "Datum") -> "int": - temp_converted = _ffi.cast("const Temporal *", temp) - value_converted = _ffi.cast("Datum", value) - result = _lib.ever_lt_temporal_base(temp_converted, value_converted) +def nsegment_lt( + ns1: Annotated[_ffi.CData, "const Nsegment *"], ns2: Annotated[_ffi.CData, "const Nsegment *"] +) -> Annotated[bool, "bool"]: + ns1_converted = _ffi.cast("const Nsegment *", ns1) + ns2_converted = _ffi.cast("const Nsegment *", ns2) + result = _lib.nsegment_lt(ns1_converted, ns2_converted) _check_error() return result if result != _ffi.NULL else None -def tfloatseq_derivative(seq: "const TSequence *") -> "TSequence *": - seq_converted = _ffi.cast("const TSequence *", seq) - result = _lib.tfloatseq_derivative(seq_converted) +def nsegment_ne( + ns1: Annotated[_ffi.CData, "const Nsegment *"], ns2: Annotated[_ffi.CData, "const Nsegment *"] +) -> Annotated[bool, "bool"]: + ns1_converted = _ffi.cast("const Nsegment *", ns1) + ns2_converted = _ffi.cast("const Nsegment *", ns2) + result = _lib.nsegment_ne(ns1_converted, ns2_converted) _check_error() return result if result != _ffi.NULL else None -def tfloatseqset_derivative(ss: "const TSequenceSet *") -> "TSequenceSet *": - ss_converted = _ffi.cast("const TSequenceSet *", ss) - result = _lib.tfloatseqset_derivative(ss_converted) +def npointset_in(string: str) -> Annotated[_ffi.CData, "Set *"]: + string_converted = string.encode("utf-8") + result = _lib.npointset_in(string_converted) _check_error() return result if result != _ffi.NULL else None -def tnumberinst_abs(inst: "const TInstant *") -> "TInstant *": - inst_converted = _ffi.cast("const TInstant *", inst) - result = _lib.tnumberinst_abs(inst_converted) +def npointset_out(s: Annotated[_ffi.CData, "const Set *"], maxdd: int) -> Annotated[str, "char *"]: + s_converted = _ffi.cast("const Set *", s) + result = _lib.npointset_out(s_converted, maxdd) _check_error() + result = _ffi.string(result).decode("utf-8") return result if result != _ffi.NULL else None -def tnumberseq_abs(seq: "const TSequence *") -> "TSequence *": - seq_converted = _ffi.cast("const TSequence *", seq) - result = _lib.tnumberseq_abs(seq_converted) +def npointset_make(values: Annotated[list, "const Npoint **"], count: int) -> Annotated[_ffi.CData, "Set *"]: + values_converted = [_ffi.cast("const Npoint *", x) for x in values] + result = _lib.npointset_make(values_converted, count) _check_error() return result if result != _ffi.NULL else None -def tnumberseq_angular_difference(seq: "const TSequence *") -> "TSequence *": - seq_converted = _ffi.cast("const TSequence *", seq) - result = _lib.tnumberseq_angular_difference(seq_converted) +def npoint_to_set(np: Annotated[_ffi.CData, "const Npoint *"]) -> Annotated[_ffi.CData, "Set *"]: + np_converted = _ffi.cast("const Npoint *", np) + result = _lib.npoint_to_set(np_converted) _check_error() return result if result != _ffi.NULL else None -def tnumberseq_delta_value(seq: "const TSequence *") -> "TSequence *": - seq_converted = _ffi.cast("const TSequence *", seq) - result = _lib.tnumberseq_delta_value(seq_converted) +def npointset_end_value(s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[_ffi.CData, "Npoint *"]: + s_converted = _ffi.cast("const Set *", s) + result = _lib.npointset_end_value(s_converted) _check_error() return result if result != _ffi.NULL else None -def tnumberseqset_abs(ss: "const TSequenceSet *") -> "TSequenceSet *": - ss_converted = _ffi.cast("const TSequenceSet *", ss) - result = _lib.tnumberseqset_abs(ss_converted) +def npointset_routes(s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[_ffi.CData, "Set *"]: + s_converted = _ffi.cast("const Set *", s) + result = _lib.npointset_routes(s_converted) _check_error() return result if result != _ffi.NULL else None -def tnumberseqset_angular_difference(ss: "const TSequenceSet *") -> "TSequence *": - ss_converted = _ffi.cast("const TSequenceSet *", ss) - result = _lib.tnumberseqset_angular_difference(ss_converted) +def npointset_start_value(s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[_ffi.CData, "Npoint *"]: + s_converted = _ffi.cast("const Set *", s) + result = _lib.npointset_start_value(s_converted) _check_error() return result if result != _ffi.NULL else None -def tnumberseqset_delta_value(ss: "const TSequenceSet *") -> "TSequenceSet *": - ss_converted = _ffi.cast("const TSequenceSet *", ss) - result = _lib.tnumberseqset_delta_value(ss_converted) +def npointset_value_n(s: Annotated[_ffi.CData, "const Set *"], n: int) -> Annotated[list, "Npoint **"]: + s_converted = _ffi.cast("const Set *", s) + out_result = _ffi.new("Npoint **") + result = _lib.npointset_value_n(s_converted, n, out_result) _check_error() - return result if result != _ffi.NULL else None + if result: + return out_result if out_result != _ffi.NULL else None + return None -def distance_tnumber_number(temp: "const Temporal *", value: "Datum") -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - value_converted = _ffi.cast("Datum", value) - result = _lib.distance_tnumber_number(temp_converted, value_converted) +def npointset_values(s: Annotated[_ffi.CData, "const Set *"]) -> Annotated[_ffi.CData, "Npoint **"]: + s_converted = _ffi.cast("const Set *", s) + result = _lib.npointset_values(s_converted) _check_error() return result if result != _ffi.NULL else None -def nad_tbox_tbox(box1: "const TBox *", box2: "const TBox *") -> "Datum": - box1_converted = _ffi.cast("const TBox *", box1) - box2_converted = _ffi.cast("const TBox *", box2) - result = _lib.nad_tbox_tbox(box1_converted, box2_converted) +def contained_npoint_set( + np: Annotated[_ffi.CData, "const Npoint *"], s: Annotated[_ffi.CData, "const Set *"] +) -> Annotated[bool, "bool"]: + np_converted = _ffi.cast("const Npoint *", np) + s_converted = _ffi.cast("const Set *", s) + result = _lib.contained_npoint_set(np_converted, s_converted) _check_error() return result if result != _ffi.NULL else None -def nad_tnumber_number(temp: "const Temporal *", value: "Datum") -> "Datum": - temp_converted = _ffi.cast("const Temporal *", temp) - value_converted = _ffi.cast("Datum", value) - result = _lib.nad_tnumber_number(temp_converted, value_converted) +def contains_set_npoint( + s: Annotated[_ffi.CData, "const Set *"], np: Annotated[_ffi.CData, "Npoint *"] +) -> Annotated[bool, "bool"]: + s_converted = _ffi.cast("const Set *", s) + np_converted = _ffi.cast("Npoint *", np) + result = _lib.contains_set_npoint(s_converted, np_converted) _check_error() return result if result != _ffi.NULL else None -def nad_tnumber_tbox(temp: "const Temporal *", box: "const TBox *") -> "Datum": - temp_converted = _ffi.cast("const Temporal *", temp) - box_converted = _ffi.cast("const TBox *", box) - result = _lib.nad_tnumber_tbox(temp_converted, box_converted) +def intersection_npoint_set( + np: Annotated[_ffi.CData, "const Npoint *"], s: Annotated[_ffi.CData, "const Set *"] +) -> Annotated[_ffi.CData, "Set *"]: + np_converted = _ffi.cast("const Npoint *", np) + s_converted = _ffi.cast("const Set *", s) + result = _lib.intersection_npoint_set(np_converted, s_converted) _check_error() return result if result != _ffi.NULL else None -def nad_tnumber_tnumber( - temp1: "const Temporal *", temp2: "const Temporal *" -) -> "Datum": - temp1_converted = _ffi.cast("const Temporal *", temp1) - temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.nad_tnumber_tnumber(temp1_converted, temp2_converted) +def intersection_set_npoint( + s: Annotated[_ffi.CData, "const Set *"], np: Annotated[_ffi.CData, "const Npoint *"] +) -> Annotated[_ffi.CData, "Set *"]: + s_converted = _ffi.cast("const Set *", s) + np_converted = _ffi.cast("const Npoint *", np) + result = _lib.intersection_set_npoint(s_converted, np_converted) _check_error() return result if result != _ffi.NULL else None -def tpointinst_srid(inst: "const TInstant *") -> "int": - inst_converted = _ffi.cast("const TInstant *", inst) - result = _lib.tpointinst_srid(inst_converted) +def minus_npoint_set( + np: Annotated[_ffi.CData, "const Npoint *"], s: Annotated[_ffi.CData, "const Set *"] +) -> Annotated[_ffi.CData, "Set *"]: + np_converted = _ffi.cast("const Npoint *", np) + s_converted = _ffi.cast("const Set *", s) + result = _lib.minus_npoint_set(np_converted, s_converted) _check_error() return result if result != _ffi.NULL else None -def tpointseq_trajectory(seq: "const TSequence *") -> "GSERIALIZED *": - seq_converted = _ffi.cast("const TSequence *", seq) - result = _lib.tpointseq_trajectory(seq_converted) +def minus_set_npoint( + s: Annotated[_ffi.CData, "const Set *"], np: Annotated[_ffi.CData, "const Npoint *"] +) -> Annotated[_ffi.CData, "Set *"]: + s_converted = _ffi.cast("const Set *", s) + np_converted = _ffi.cast("const Npoint *", np) + result = _lib.minus_set_npoint(s_converted, np_converted) _check_error() return result if result != _ffi.NULL else None -def tpointseq_azimuth(seq: "const TSequence *") -> "TSequenceSet *": - seq_converted = _ffi.cast("const TSequence *", seq) - result = _lib.tpointseq_azimuth(seq_converted) +def npoint_union_transfn( + state: Annotated[_ffi.CData, "Set *"], np: Annotated[_ffi.CData, "const Npoint *"] +) -> Annotated[_ffi.CData, "Set *"]: + state_converted = _ffi.cast("Set *", state) + np_converted = _ffi.cast("const Npoint *", np) + result = _lib.npoint_union_transfn(state_converted, np_converted) _check_error() return result if result != _ffi.NULL else None -def tpointseq_cumulative_length( - seq: "const TSequence *", prevlength: float -) -> "TSequence *": - seq_converted = _ffi.cast("const TSequence *", seq) - result = _lib.tpointseq_cumulative_length(seq_converted, prevlength) +def union_npoint_set( + np: Annotated[_ffi.CData, "const Npoint *"], s: Annotated[_ffi.CData, "const Set *"] +) -> Annotated[_ffi.CData, "Set *"]: + np_converted = _ffi.cast("const Npoint *", np) + s_converted = _ffi.cast("const Set *", s) + result = _lib.union_npoint_set(np_converted, s_converted) _check_error() return result if result != _ffi.NULL else None -def tpointseq_is_simple(seq: "const TSequence *") -> "bool": - seq_converted = _ffi.cast("const TSequence *", seq) - result = _lib.tpointseq_is_simple(seq_converted) +def union_set_npoint( + s: Annotated[_ffi.CData, "const Set *"], np: Annotated[_ffi.CData, "const Npoint *"] +) -> Annotated[_ffi.CData, "Set *"]: + s_converted = _ffi.cast("const Set *", s) + np_converted = _ffi.cast("const Npoint *", np) + result = _lib.union_set_npoint(s_converted, np_converted) _check_error() return result if result != _ffi.NULL else None -def tpointseq_length(seq: "const TSequence *") -> "double": - seq_converted = _ffi.cast("const TSequence *", seq) - result = _lib.tpointseq_length(seq_converted) +def tnpoint_in(string: str) -> Annotated[_ffi.CData, "Temporal *"]: + string_converted = string.encode("utf-8") + result = _lib.tnpoint_in(string_converted) _check_error() return result if result != _ffi.NULL else None -def tpointseq_speed(seq: "const TSequence *") -> "TSequence *": - seq_converted = _ffi.cast("const TSequence *", seq) - result = _lib.tpointseq_speed(seq_converted) +def tnpoint_out(temp: Annotated[_ffi.CData, "const Temporal *"], maxdd: int) -> Annotated[str, "char *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.tnpoint_out(temp_converted, maxdd) _check_error() + result = _ffi.string(result).decode("utf-8") return result if result != _ffi.NULL else None -def tpointseq_srid(seq: "const TSequence *") -> "int": - seq_converted = _ffi.cast("const TSequence *", seq) - result = _lib.tpointseq_srid(seq_converted) +def tnpointinst_make(np: Annotated[_ffi.CData, "const Npoint *"], t: int) -> Annotated[_ffi.CData, "TInstant *"]: + np_converted = _ffi.cast("const Npoint *", np) + t_converted = _ffi.cast("TimestampTz", t) + result = _lib.tnpointinst_make(np_converted, t_converted) _check_error() return result if result != _ffi.NULL else None -def tpointseq_stboxes(seq: "const TSequence *") -> "Tuple['STBox *', 'int']": - seq_converted = _ffi.cast("const TSequence *", seq) - count = _ffi.new("int *") - result = _lib.tpointseq_stboxes(seq_converted, count) +def tgeompoint_to_tnpoint(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "Temporal *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.tgeompoint_to_tnpoint(temp_converted) _check_error() - return result if result != _ffi.NULL else None, count[0] + return result if result != _ffi.NULL else None -def tpointseq_split_n_stboxes( - seq: "const TSequence *", max_count: int -) -> "Tuple['STBox *', 'int']": - seq_converted = _ffi.cast("const TSequence *", seq) - count = _ffi.new("int *") - result = _lib.tpointseq_split_n_stboxes(seq_converted, max_count, count) +def tnpoint_to_tgeompoint(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "Temporal *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.tnpoint_to_tgeompoint(temp_converted) _check_error() - return result if result != _ffi.NULL else None, count[0] + return result if result != _ffi.NULL else None -def tpointseqset_azimuth(ss: "const TSequenceSet *") -> "TSequenceSet *": - ss_converted = _ffi.cast("const TSequenceSet *", ss) - result = _lib.tpointseqset_azimuth(ss_converted) +def tnpoint_cumulative_length(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "Temporal *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.tnpoint_cumulative_length(temp_converted) _check_error() return result if result != _ffi.NULL else None -def tpointseqset_cumulative_length(ss: "const TSequenceSet *") -> "TSequenceSet *": - ss_converted = _ffi.cast("const TSequenceSet *", ss) - result = _lib.tpointseqset_cumulative_length(ss_converted) +def tnpoint_length(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[float, "double"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.tnpoint_length(temp_converted) _check_error() return result if result != _ffi.NULL else None -def tpointseqset_is_simple(ss: "const TSequenceSet *") -> "bool": - ss_converted = _ffi.cast("const TSequenceSet *", ss) - result = _lib.tpointseqset_is_simple(ss_converted) +def tnpoint_positions( + temp: Annotated[_ffi.CData, "const Temporal *"], count: Annotated[_ffi.CData, "int *"] +) -> Annotated[_ffi.CData, "Nsegment **"]: + temp_converted = _ffi.cast("const Temporal *", temp) + count_converted = _ffi.cast("int *", count) + result = _lib.tnpoint_positions(temp_converted, count_converted) _check_error() return result if result != _ffi.NULL else None -def tpointseqset_length(ss: "const TSequenceSet *") -> "double": - ss_converted = _ffi.cast("const TSequenceSet *", ss) - result = _lib.tpointseqset_length(ss_converted) +def tnpoint_route(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[int, "int64"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.tnpoint_route(temp_converted) _check_error() return result if result != _ffi.NULL else None -def tpointseqset_speed(ss: "const TSequenceSet *") -> "TSequenceSet *": - ss_converted = _ffi.cast("const TSequenceSet *", ss) - result = _lib.tpointseqset_speed(ss_converted) +def tnpoint_routes(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "Set *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.tnpoint_routes(temp_converted) _check_error() return result if result != _ffi.NULL else None -def tpointseqset_srid(ss: "const TSequenceSet *") -> "int": - ss_converted = _ffi.cast("const TSequenceSet *", ss) - result = _lib.tpointseqset_srid(ss_converted) +def tnpoint_speed(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "Temporal *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.tnpoint_speed(temp_converted) _check_error() return result if result != _ffi.NULL else None -def tpointseqset_stboxes(ss: "const TSequenceSet *") -> "Tuple['STBox *', 'int']": - ss_converted = _ffi.cast("const TSequenceSet *", ss) - count = _ffi.new("int *") - result = _lib.tpointseqset_stboxes(ss_converted, count) +def tnpoint_trajectory(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "GSERIALIZED *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.tnpoint_trajectory(temp_converted) _check_error() - return result if result != _ffi.NULL else None, count[0] + return result if result != _ffi.NULL else None -def tpointseqset_split_n_stboxes( - ss: "const TSequenceSet *", max_count: int -) -> "Tuple['STBox *', 'int']": - ss_converted = _ffi.cast("const TSequenceSet *", ss) - count = _ffi.new("int *") - result = _lib.tpointseqset_split_n_stboxes(ss_converted, max_count, count) +def tnpoint_twcentroid(temp: Annotated[_ffi.CData, "const Temporal *"]) -> Annotated[_ffi.CData, "GSERIALIZED *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.tnpoint_twcentroid(temp_converted) _check_error() - return result if result != _ffi.NULL else None, count[0] + return result if result != _ffi.NULL else None -def tpointseqset_trajectory(ss: "const TSequenceSet *") -> "GSERIALIZED *": - ss_converted = _ffi.cast("const TSequenceSet *", ss) - result = _lib.tpointseqset_trajectory(ss_converted) +def tnpoint_at_geom( + temp: Annotated[_ffi.CData, "const Temporal *"], gs: Annotated[_ffi.CData, "const GSERIALIZED *"] +) -> Annotated[_ffi.CData, "Temporal *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + result = _lib.tnpoint_at_geom(temp_converted, gs_converted) _check_error() return result if result != _ffi.NULL else None -def tpoint_get_coord(temp: "const Temporal *", coord: int) -> "Temporal *": +def tnpoint_at_npoint( + temp: Annotated[_ffi.CData, "const Temporal *"], np: Annotated[_ffi.CData, "const Npoint *"] +) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tpoint_get_coord(temp_converted, coord) + np_converted = _ffi.cast("const Npoint *", np) + result = _lib.tnpoint_at_npoint(temp_converted, np_converted) _check_error() return result if result != _ffi.NULL else None -def tgeompointinst_tgeogpointinst(inst: "const TInstant *", oper: bool) -> "TInstant *": - inst_converted = _ffi.cast("const TInstant *", inst) - result = _lib.tgeompointinst_tgeogpointinst(inst_converted, oper) +def tnpoint_at_npointset( + temp: Annotated[_ffi.CData, "const Temporal *"], s: Annotated[_ffi.CData, "const Set *"] +) -> Annotated[_ffi.CData, "Temporal *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + s_converted = _ffi.cast("const Set *", s) + result = _lib.tnpoint_at_npointset(temp_converted, s_converted) _check_error() return result if result != _ffi.NULL else None -def tgeompointseq_tgeogpointseq(seq: "const TSequence *", oper: bool) -> "TSequence *": - seq_converted = _ffi.cast("const TSequence *", seq) - result = _lib.tgeompointseq_tgeogpointseq(seq_converted, oper) +def tnpoint_at_stbox( + temp: Annotated[_ffi.CData, "const Temporal *"], box: Annotated[_ffi.CData, "const STBox *"], border_inc: bool +) -> Annotated[_ffi.CData, "Temporal *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + box_converted = _ffi.cast("const STBox *", box) + result = _lib.tnpoint_at_stbox(temp_converted, box_converted, border_inc) _check_error() return result if result != _ffi.NULL else None -def tgeompointseqset_tgeogpointseqset( - ss: "const TSequenceSet *", oper: bool -) -> "TSequenceSet *": - ss_converted = _ffi.cast("const TSequenceSet *", ss) - result = _lib.tgeompointseqset_tgeogpointseqset(ss_converted, oper) +def tnpoint_minus_geom( + temp: Annotated[_ffi.CData, "const Temporal *"], gs: Annotated[_ffi.CData, "const GSERIALIZED *"] +) -> Annotated[_ffi.CData, "Temporal *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + result = _lib.tnpoint_minus_geom(temp_converted, gs_converted) _check_error() return result if result != _ffi.NULL else None -def tgeompoint_tgeogpoint(temp: "const Temporal *", oper: bool) -> "Temporal *": +def tnpoint_minus_npoint( + temp: Annotated[_ffi.CData, "const Temporal *"], np: Annotated[_ffi.CData, "const Npoint *"] +) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tgeompoint_tgeogpoint(temp_converted, oper) + np_converted = _ffi.cast("const Npoint *", np) + result = _lib.tnpoint_minus_npoint(temp_converted, np_converted) _check_error() return result if result != _ffi.NULL else None -def tgeompoint_tnpoint(temp: "const Temporal *") -> "Temporal *": +def tnpoint_minus_npointset( + temp: Annotated[_ffi.CData, "const Temporal *"], s: Annotated[_ffi.CData, "const Set *"] +) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tgeompoint_tnpoint(temp_converted) + s_converted = _ffi.cast("const Set *", s) + result = _lib.tnpoint_minus_npointset(temp_converted, s_converted) _check_error() return result if result != _ffi.NULL else None -def tnpoint_tgeompoint(temp: "const Temporal *") -> "Temporal *": +def tnpoint_minus_stbox( + temp: Annotated[_ffi.CData, "const Temporal *"], box: Annotated[_ffi.CData, "const STBox *"], border_inc: bool +) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tnpoint_tgeompoint(temp_converted) + box_converted = _ffi.cast("const STBox *", box) + result = _lib.tnpoint_minus_stbox(temp_converted, box_converted, border_inc) _check_error() return result if result != _ffi.NULL else None -def tpointinst_set_srid(inst: "const TInstant *", srid: int) -> "TInstant *": - inst_converted = _ffi.cast("const TInstant *", inst) - srid_converted = _ffi.cast("int32", srid) - result = _lib.tpointinst_set_srid(inst_converted, srid_converted) +def tdistance_tnpoint_npoint( + temp: Annotated[_ffi.CData, "const Temporal *"], np: Annotated[_ffi.CData, "const Npoint *"] +) -> Annotated[_ffi.CData, "Temporal *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + np_converted = _ffi.cast("const Npoint *", np) + result = _lib.tdistance_tnpoint_npoint(temp_converted, np_converted) _check_error() return result if result != _ffi.NULL else None -def tpointseq_make_simple(seq: "const TSequence *") -> "Tuple['TSequence **', 'int']": - seq_converted = _ffi.cast("const TSequence *", seq) - count = _ffi.new("int *") - result = _lib.tpointseq_make_simple(seq_converted, count) +def tdistance_tnpoint_point( + temp: Annotated[_ffi.CData, "const Temporal *"], gs: Annotated[_ffi.CData, "const GSERIALIZED *"] +) -> Annotated[_ffi.CData, "Temporal *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + result = _lib.tdistance_tnpoint_point(temp_converted, gs_converted) _check_error() - return result if result != _ffi.NULL else None, count[0] + return result if result != _ffi.NULL else None -def tpointseq_set_srid(seq: "const TSequence *", srid: int) -> "TSequence *": - seq_converted = _ffi.cast("const TSequence *", seq) - srid_converted = _ffi.cast("int32", srid) - result = _lib.tpointseq_set_srid(seq_converted, srid_converted) +def tdistance_tnpoint_tnpoint( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[_ffi.CData, "Temporal *"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.tdistance_tnpoint_tnpoint(temp1_converted, temp2_converted) _check_error() return result if result != _ffi.NULL else None -def tpointseqset_make_simple( - ss: "const TSequenceSet *", -) -> "Tuple['TSequence **', 'int']": - ss_converted = _ffi.cast("const TSequenceSet *", ss) - count = _ffi.new("int *") - result = _lib.tpointseqset_make_simple(ss_converted, count) +def nad_tnpoint_geo( + temp: Annotated[_ffi.CData, "const Temporal *"], gs: Annotated[_ffi.CData, "const GSERIALIZED *"] +) -> Annotated[float, "double"]: + temp_converted = _ffi.cast("const Temporal *", temp) + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + result = _lib.nad_tnpoint_geo(temp_converted, gs_converted) _check_error() - return result if result != _ffi.NULL else None, count[0] + return result if result != _ffi.NULL else None -def tpointseqset_set_srid(ss: "const TSequenceSet *", srid: int) -> "TSequenceSet *": - ss_converted = _ffi.cast("const TSequenceSet *", ss) - srid_converted = _ffi.cast("int32", srid) - result = _lib.tpointseqset_set_srid(ss_converted, srid_converted) +def nad_tnpoint_npoint( + temp: Annotated[_ffi.CData, "const Temporal *"], np: Annotated[_ffi.CData, "const Npoint *"] +) -> Annotated[float, "double"]: + temp_converted = _ffi.cast("const Temporal *", temp) + np_converted = _ffi.cast("const Npoint *", np) + result = _lib.nad_tnpoint_npoint(temp_converted, np_converted) _check_error() return result if result != _ffi.NULL else None -def tnumberseq_integral(seq: "const TSequence *") -> "double": - seq_converted = _ffi.cast("const TSequence *", seq) - result = _lib.tnumberseq_integral(seq_converted) +def nad_tnpoint_stbox( + temp: Annotated[_ffi.CData, "const Temporal *"], box: Annotated[_ffi.CData, "const STBox *"] +) -> Annotated[float, "double"]: + temp_converted = _ffi.cast("const Temporal *", temp) + box_converted = _ffi.cast("const STBox *", box) + result = _lib.nad_tnpoint_stbox(temp_converted, box_converted) _check_error() return result if result != _ffi.NULL else None -def tnumberseq_twavg(seq: "const TSequence *") -> "double": - seq_converted = _ffi.cast("const TSequence *", seq) - result = _lib.tnumberseq_twavg(seq_converted) +def nad_tnpoint_tnpoint( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[float, "double"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.nad_tnpoint_tnpoint(temp1_converted, temp2_converted) _check_error() return result if result != _ffi.NULL else None -def tnumberseqset_integral(ss: "const TSequenceSet *") -> "double": - ss_converted = _ffi.cast("const TSequenceSet *", ss) - result = _lib.tnumberseqset_integral(ss_converted) +def nai_tnpoint_geo( + temp: Annotated[_ffi.CData, "const Temporal *"], gs: Annotated[_ffi.CData, "const GSERIALIZED *"] +) -> Annotated[_ffi.CData, "TInstant *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + result = _lib.nai_tnpoint_geo(temp_converted, gs_converted) _check_error() return result if result != _ffi.NULL else None -def tnumberseqset_twavg(ss: "const TSequenceSet *") -> "double": - ss_converted = _ffi.cast("const TSequenceSet *", ss) - result = _lib.tnumberseqset_twavg(ss_converted) +def nai_tnpoint_npoint( + temp: Annotated[_ffi.CData, "const Temporal *"], np: Annotated[_ffi.CData, "const Npoint *"] +) -> Annotated[_ffi.CData, "TInstant *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + np_converted = _ffi.cast("const Npoint *", np) + result = _lib.nai_tnpoint_npoint(temp_converted, np_converted) _check_error() return result if result != _ffi.NULL else None -def tpointseq_twcentroid(seq: "const TSequence *") -> "GSERIALIZED *": - seq_converted = _ffi.cast("const TSequence *", seq) - result = _lib.tpointseq_twcentroid(seq_converted) +def nai_tnpoint_tnpoint( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[_ffi.CData, "TInstant *"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.nai_tnpoint_tnpoint(temp1_converted, temp2_converted) _check_error() return result if result != _ffi.NULL else None -def tpointseqset_twcentroid(ss: "const TSequenceSet *") -> "GSERIALIZED *": - ss_converted = _ffi.cast("const TSequenceSet *", ss) - result = _lib.tpointseqset_twcentroid(ss_converted) +def shortestline_tnpoint_geo( + temp: Annotated[_ffi.CData, "const Temporal *"], gs: Annotated[_ffi.CData, "const GSERIALIZED *"] +) -> Annotated[_ffi.CData, "GSERIALIZED *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + gs_converted = _ffi.cast("const GSERIALIZED *", gs) + result = _lib.shortestline_tnpoint_geo(temp_converted, gs_converted) _check_error() return result if result != _ffi.NULL else None -def temporal_compact(temp: "const Temporal *") -> "Temporal *": +def shortestline_tnpoint_npoint( + temp: Annotated[_ffi.CData, "const Temporal *"], np: Annotated[_ffi.CData, "const Npoint *"] +) -> Annotated[_ffi.CData, "GSERIALIZED *"]: temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.temporal_compact(temp_converted) + np_converted = _ffi.cast("const Npoint *", np) + result = _lib.shortestline_tnpoint_npoint(temp_converted, np_converted) _check_error() return result if result != _ffi.NULL else None -def tsequence_compact(seq: "const TSequence *") -> "TSequence *": - seq_converted = _ffi.cast("const TSequence *", seq) - result = _lib.tsequence_compact(seq_converted) +def shortestline_tnpoint_tnpoint( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[_ffi.CData, "GSERIALIZED *"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.shortestline_tnpoint_tnpoint(temp1_converted, temp2_converted) _check_error() return result if result != _ffi.NULL else None -def tsequenceset_compact(ss: "const TSequenceSet *") -> "TSequenceSet *": - ss_converted = _ffi.cast("const TSequenceSet *", ss) - result = _lib.tsequenceset_compact(ss_converted) +def tnpoint_tcentroid_transfn( + state: Annotated[_ffi.CData, "SkipList *"], temp: Annotated[_ffi.CData, "Temporal *"] +) -> Annotated[_ffi.CData, "SkipList *"]: + state_converted = _ffi.cast("SkipList *", state) + temp_converted = _ffi.cast("Temporal *", temp) + result = _lib.tnpoint_tcentroid_transfn(state_converted, temp_converted) _check_error() return result if result != _ffi.NULL else None -def skiplist_free(list: "SkipList *") -> None: - list_converted = _ffi.cast("SkipList *", list) - _lib.skiplist_free(list_converted) +def always_eq_npoint_tnpoint( + np: Annotated[_ffi.CData, "const Npoint *"], temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[int, "int"]: + np_converted = _ffi.cast("const Npoint *", np) + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.always_eq_npoint_tnpoint(np_converted, temp_converted) _check_error() + return result if result != _ffi.NULL else None -def temporal_app_tinst_transfn( - state: "Temporal *", - inst: "const TInstant *", - maxdist: float, - maxt: "const Interval *", -) -> "Temporal *": - state_converted = _ffi.cast("Temporal *", state) - inst_converted = _ffi.cast("const TInstant *", inst) - maxt_converted = _ffi.cast("const Interval *", maxt) - result = _lib.temporal_app_tinst_transfn( - state_converted, inst_converted, maxdist, maxt_converted - ) +def always_eq_tnpoint_npoint( + temp: Annotated[_ffi.CData, "const Temporal *"], np: Annotated[_ffi.CData, "const Npoint *"] +) -> Annotated[int, "int"]: + temp_converted = _ffi.cast("const Temporal *", temp) + np_converted = _ffi.cast("const Npoint *", np) + result = _lib.always_eq_tnpoint_npoint(temp_converted, np_converted) _check_error() return result if result != _ffi.NULL else None -def temporal_app_tseq_transfn( - state: "Temporal *", seq: "const TSequence *" -) -> "Temporal *": - state_converted = _ffi.cast("Temporal *", state) - seq_converted = _ffi.cast("const TSequence *", seq) - result = _lib.temporal_app_tseq_transfn(state_converted, seq_converted) +def always_eq_tnpoint_tnpoint( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[int, "int"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.always_eq_tnpoint_tnpoint(temp1_converted, temp2_converted) _check_error() return result if result != _ffi.NULL else None -def numspanset_spans( - ss: "const SpanSet *", vsize: "Datum", vorigin: "Datum" -) -> "Tuple['Span *', 'int']": - ss_converted = _ffi.cast("const SpanSet *", ss) - vsize_converted = _ffi.cast("Datum", vsize) - vorigin_converted = _ffi.cast("Datum", vorigin) - count = _ffi.new("int *") - result = _lib.numspanset_spans( - ss_converted, vsize_converted, vorigin_converted, count - ) +def always_ne_npoint_tnpoint( + np: Annotated[_ffi.CData, "const Npoint *"], temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[int, "int"]: + np_converted = _ffi.cast("const Npoint *", np) + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.always_ne_npoint_tnpoint(np_converted, temp_converted) _check_error() - return result if result != _ffi.NULL else None, count[0] + return result if result != _ffi.NULL else None -def spanset_time_spans( - ss: "const SpanSet *", duration: "const Interval *", torigin: "Datum" -) -> "Tuple['Span *', 'int']": - ss_converted = _ffi.cast("const SpanSet *", ss) - duration_converted = _ffi.cast("const Interval *", duration) - torigin_converted = _ffi.cast("Datum", torigin) - count = _ffi.new("int *") - result = _lib.spanset_time_spans( - ss_converted, duration_converted, torigin_converted, count - ) +def always_ne_tnpoint_npoint( + temp: Annotated[_ffi.CData, "const Temporal *"], np: Annotated[_ffi.CData, "const Npoint *"] +) -> Annotated[int, "int"]: + temp_converted = _ffi.cast("const Temporal *", temp) + np_converted = _ffi.cast("const Npoint *", np) + result = _lib.always_ne_tnpoint_npoint(temp_converted, np_converted) _check_error() - return result if result != _ffi.NULL else None, count[0] + return result if result != _ffi.NULL else None -def spanset_value_spans( - ss: "const SpanSet *", vsize: "Datum", vorigin: "Datum" -) -> "Tuple['Span *', 'int']": - ss_converted = _ffi.cast("const SpanSet *", ss) - vsize_converted = _ffi.cast("Datum", vsize) - vorigin_converted = _ffi.cast("Datum", vorigin) - count = _ffi.new("int *") - result = _lib.spanset_value_spans( - ss_converted, vsize_converted, vorigin_converted, count - ) +def always_ne_tnpoint_tnpoint( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[int, "int"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.always_ne_tnpoint_tnpoint(temp1_converted, temp2_converted) _check_error() - return result if result != _ffi.NULL else None, count[0] + return result if result != _ffi.NULL else None -def timespanset_spans( - ss: "const SpanSet *", duration: "const Interval *", torigin: "Datum" -) -> "Tuple['Span *', 'int']": - ss_converted = _ffi.cast("const SpanSet *", ss) - duration_converted = _ffi.cast("const Interval *", duration) - torigin_converted = _ffi.cast("Datum", torigin) - count = _ffi.new("int *") - result = _lib.timespanset_spans( - ss_converted, duration_converted, torigin_converted, count - ) +def ever_eq_npoint_tnpoint( + np: Annotated[_ffi.CData, "const Npoint *"], temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[int, "int"]: + np_converted = _ffi.cast("const Npoint *", np) + temp_converted = _ffi.cast("const Temporal *", temp) + result = _lib.ever_eq_npoint_tnpoint(np_converted, temp_converted) _check_error() - return result if result != _ffi.NULL else None, count[0] + return result if result != _ffi.NULL else None -def tnumber_value_spans( - temp: "const Temporal *", size: "Datum", origin: "Datum" -) -> "Tuple['Span *', 'int']": +def ever_eq_tnpoint_npoint( + temp: Annotated[_ffi.CData, "const Temporal *"], np: Annotated[_ffi.CData, "const Npoint *"] +) -> Annotated[int, "int"]: temp_converted = _ffi.cast("const Temporal *", temp) - size_converted = _ffi.cast("Datum", size) - origin_converted = _ffi.cast("Datum", origin) - count = _ffi.new("int *") - result = _lib.tnumber_value_spans( - temp_converted, size_converted, origin_converted, count - ) + np_converted = _ffi.cast("const Npoint *", np) + result = _lib.ever_eq_tnpoint_npoint(temp_converted, np_converted) _check_error() - return result if result != _ffi.NULL else None, count[0] + return result if result != _ffi.NULL else None -def tnumber_value_boxes( - temp: "const Temporal *", vsize: "Datum", vorigin: "Datum" -) -> "Tuple['TBox *', 'int']": - temp_converted = _ffi.cast("const Temporal *", temp) - vsize_converted = _ffi.cast("Datum", vsize) - vorigin_converted = _ffi.cast("Datum", vorigin) - count = _ffi.new("int *") - result = _lib.tnumber_value_boxes( - temp_converted, vsize_converted, vorigin_converted, count - ) +def ever_eq_tnpoint_tnpoint( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[int, "int"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.ever_eq_tnpoint_tnpoint(temp1_converted, temp2_converted) _check_error() - return result if result != _ffi.NULL else None, count[0] + return result if result != _ffi.NULL else None -def tnumber_time_boxes( - temp: "const Temporal *", duration: "const Interval *", torigin: int -) -> "Tuple['TBox *', 'int']": +def ever_ne_npoint_tnpoint( + np: Annotated[_ffi.CData, "const Npoint *"], temp: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[int, "int"]: + np_converted = _ffi.cast("const Npoint *", np) temp_converted = _ffi.cast("const Temporal *", temp) - duration_converted = _ffi.cast("const Interval *", duration) - torigin_converted = _ffi.cast("TimestampTz", torigin) - count = _ffi.new("int *") - result = _lib.tnumber_time_boxes( - temp_converted, duration_converted, torigin_converted, count - ) + result = _lib.ever_ne_npoint_tnpoint(np_converted, temp_converted) _check_error() - return result if result != _ffi.NULL else None, count[0] + return result if result != _ffi.NULL else None -def tnumber_value_time_boxes( - temp: "const Temporal *", - vsize: "Datum", - duration: "const Interval *", - vorigin: "Datum", - torigin: int, -) -> "Tuple['TBox *', 'int']": +def ever_ne_tnpoint_npoint( + temp: Annotated[_ffi.CData, "const Temporal *"], np: Annotated[_ffi.CData, "const Npoint *"] +) -> Annotated[int, "int"]: temp_converted = _ffi.cast("const Temporal *", temp) - vsize_converted = _ffi.cast("Datum", vsize) - duration_converted = _ffi.cast("const Interval *", duration) - vorigin_converted = _ffi.cast("Datum", vorigin) - torigin_converted = _ffi.cast("TimestampTz", torigin) - count = _ffi.new("int *") - result = _lib.tnumber_value_time_boxes( - temp_converted, - vsize_converted, - duration_converted, - vorigin_converted, - torigin_converted, - count, - ) + np_converted = _ffi.cast("const Npoint *", np) + result = _lib.ever_ne_tnpoint_npoint(temp_converted, np_converted) _check_error() - return result if result != _ffi.NULL else None, count[0] + return result if result != _ffi.NULL else None -def tnumber_value_split( - temp: "const Temporal *", vsize: "Datum", vorigin: "Datum", bins: "Datum **" -) -> "Tuple['Temporal **', 'int']": - temp_converted = _ffi.cast("const Temporal *", temp) - vsize_converted = _ffi.cast("Datum", vsize) - vorigin_converted = _ffi.cast("Datum", vorigin) - bins_converted = [_ffi.cast("Datum *", x) for x in bins] - count = _ffi.new("int *") - result = _lib.tnumber_value_split( - temp_converted, vsize_converted, vorigin_converted, bins_converted, count - ) +def ever_ne_tnpoint_tnpoint( + temp1: Annotated[_ffi.CData, "const Temporal *"], temp2: Annotated[_ffi.CData, "const Temporal *"] +) -> Annotated[int, "int"]: + temp1_converted = _ffi.cast("const Temporal *", temp1) + temp2_converted = _ffi.cast("const Temporal *", temp2) + result = _lib.ever_ne_tnpoint_tnpoint(temp1_converted, temp2_converted) _check_error() - return result if result != _ffi.NULL else None, count[0] + return result if result != _ffi.NULL else None -def tbox_get_value_time_tile( - value: "Datum", - t: int, - vsize: "Datum", - duration: "const Interval *", - vorigin: "Datum", - torigin: int, - basetype: "meosType", - spantype: "meosType", -) -> "TBox *": - value_converted = _ffi.cast("Datum", value) - t_converted = _ffi.cast("TimestampTz", t) - vsize_converted = _ffi.cast("Datum", vsize) - duration_converted = _ffi.cast("const Interval *", duration) - vorigin_converted = _ffi.cast("Datum", vorigin) - torigin_converted = _ffi.cast("TimestampTz", torigin) - basetype_converted = _ffi.cast("meosType", basetype) - spantype_converted = _ffi.cast("meosType", spantype) - result = _lib.tbox_get_value_time_tile( - value_converted, - t_converted, - vsize_converted, - duration_converted, - vorigin_converted, - torigin_converted, - basetype_converted, - spantype_converted, - ) +def teq_tnpoint_npoint( + temp: Annotated[_ffi.CData, "const Temporal *"], np: Annotated[_ffi.CData, "const Npoint *"] +) -> Annotated[_ffi.CData, "Temporal *"]: + temp_converted = _ffi.cast("const Temporal *", temp) + np_converted = _ffi.cast("const Npoint *", np) + result = _lib.teq_tnpoint_npoint(temp_converted, np_converted) _check_error() return result if result != _ffi.NULL else None -def tnumber_value_time_split( - temp: "const Temporal *", - size: "Datum", - duration: "const Interval *", - vorigin: "Datum", - torigin: int, - value_bins: "Datum **", - time_bins: "TimestampTz **", -) -> "Tuple['Temporal **', 'int']": +def tne_tnpoint_npoint( + temp: Annotated[_ffi.CData, "const Temporal *"], np: Annotated[_ffi.CData, "const Npoint *"] +) -> Annotated[_ffi.CData, "Temporal *"]: temp_converted = _ffi.cast("const Temporal *", temp) - size_converted = _ffi.cast("Datum", size) - duration_converted = _ffi.cast("const Interval *", duration) - vorigin_converted = _ffi.cast("Datum", vorigin) - torigin_converted = _ffi.cast("TimestampTz", torigin) - value_bins_converted = [_ffi.cast("Datum *", x) for x in value_bins] - time_bins_converted = [_ffi.cast("TimestampTz *", x) for x in time_bins] - count = _ffi.new("int *") - result = _lib.tnumber_value_time_split( - temp_converted, - size_converted, - duration_converted, - vorigin_converted, - torigin_converted, - value_bins_converted, - time_bins_converted, - count, - ) + np_converted = _ffi.cast("const Npoint *", np) + result = _lib.tne_tnpoint_npoint(temp_converted, np_converted) _check_error() - return result if result != _ffi.NULL else None, count[0] + return result if result != _ffi.NULL else None diff --git a/pyproject.toml b/pyproject.toml index 0167864..a53ba2b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,17 +13,16 @@ authors = [ ] description = 'PyMEOS wrapper for the MEOS C Library.' classifiers = [ - 'License :: OSI Approved :: PostgreSQL License', 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'Intended Audience :: Science/Research', 'Programming Language :: C', 'Programming Language :: Python', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.8', - 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12', + 'Programming Language :: Python :: 3.13', 'Programming Language :: Python :: 3 :: Only', 'Programming Language :: Python :: Implementation :: CPython', 'Operating System :: POSIX', @@ -32,7 +31,7 @@ classifiers = [ readme = 'README.md' license = { file = 'LICENSE' } -requires-python = '>=3.8' +requires-python = '>=3.10' dependencies = [ 'cffi', 'python-dateutil', diff --git a/ruff.toml b/ruff.toml new file mode 100644 index 0000000..f7de3e9 --- /dev/null +++ b/ruff.toml @@ -0,0 +1,32 @@ +line-length = 120 +indent-width = 4 + +target-version = "py310" + +[format] +quote-style = "double" +indent-style = "space" +line-ending = "auto" + +[lint] +select = [ + # pycodestyle + "E", "W", + # Pyflakes + "F", + # pyupgrade + "UP", + # flake8-bugbear + "B", + # flake8-simplify + "SIM", + # isort + "I", +] +ignore = [ + "F405", "F403", # Allow star imports + "F722", # Ignore syntax errors in forward annotations to allow for MEOS types + "E741", # Ignore ambiguous variable names +] +[lint.per-file-ignores] +"builder/templates/functions.py" = ["F821", "F401"] # Allow undefined and unused names in the function file template \ No newline at end of file diff --git a/setup.py b/setup.py index 58e1c6a..5da93d7 100644 --- a/setup.py +++ b/setup.py @@ -3,15 +3,10 @@ from setuptools import setup -# Copy PROJ data to package data -package_data = [] -# Conditionally copy PROJ DATA to make self-contained wheels -if os.environ.get("PACKAGE_DATA"): +def package_proj_data() -> str: print("Copying PROJ data to package data") - projdatadir = os.environ.get( - "PROJ_DATA", os.environ.get("PROJ_LIB", "/usr/local/share/proj") - ) + projdatadir = os.environ.get("PROJ_DATA", os.environ.get("PROJ_LIB", "/usr/local/share/proj")) if os.path.exists(projdatadir): shutil.rmtree("pymeos_cffi/proj_data", ignore_errors=True) shutil.copytree( @@ -21,12 +16,31 @@ ) # Don't copy .tiff files and their related .txt files else: raise FileNotFoundError( - f"PROJ data directory not found at {projdatadir}. " - f"Unable to generate self-contained wheel." + f"PROJ data directory not found at {projdatadir}. Unable to generate self-contained wheel." ) - package_data.append("proj_data/*") + return "proj_data/*" + + +def package_meos_data() -> str: + print("Copying MEOS spatial reference table to package data") + spatial_ref_sys_path = os.environ.get("MEOS_SPATIAL_REF_SYS_PATH", "/usr/local/share/spatial_ref_sys.csv") + shutil.rmtree("pymeos_cffi/meos_data", ignore_errors=True) + os.makedirs("pymeos_cffi/meos_data", exist_ok=True) + shutil.copy( + spatial_ref_sys_path, + "pymeos_cffi/meos_data/spatial_ref_sys.csv", + ) + return "meos_data/*" + + +package_data = [] + +if os.environ.get("PACKAGE_DATA"): + print("Packaging data for self-contained wheel") + package_data.append(package_proj_data()) + package_data.append(package_meos_data()) else: - print("Not copying PROJ data to package data") + print("Not packaging data") setup(