From 8e887a67979ca45d59da8659aff5003c231da6a9 Mon Sep 17 00:00:00 2001 From: Diviloper Date: Sat, 27 Apr 2024 11:16:24 +0200 Subject: [PATCH] Remove pymeos-cffi code and convert this to repository for only pymeos. PyMEOS-CFFI code has been moved to an independent repository at https://github.com/MobilityDB/PyMEOS-CFFI. --- .github/workflows/build_pymeos_cffi.yml | 224 - .github/workflows/test.yml | 8 +- .gitignore | 15 +- pymeos/LICENSE => LICENSE | 0 README.md | 12 +- ...v-requirements.txt => dev-requirements.txt | 0 docs/requirements.txt | 2 +- pymeos/.gitignore | 17 - pymeos/CHANGELOG.md | 36 - pymeos/MANIFEST.in | 1 - pymeos/README.md | 44 - pymeos/{pymeos => }/__init__.py | 0 pymeos/{pymeos => }/aggregators/__init__.py | 0 pymeos/{pymeos => }/aggregators/aggregator.py | 0 .../aggregators/bool_aggregators.py | 0 .../aggregators/general_aggregators.py | 0 .../aggregators/number_aggregators.py | 0 .../aggregators/point_aggregators.py | 0 .../aggregators/text_aggregators.py | 0 .../aggregators/time_aggregators.py | 0 pymeos/{pymeos => }/boxes/__init__.py | 0 pymeos/{pymeos => }/boxes/box.py | 0 pymeos/{pymeos => }/boxes/stbox.py | 0 pymeos/{pymeos => }/boxes/tbox.py | 0 pymeos/{pymeos => }/collections/__init__.py | 0 .../{pymeos => }/collections/base/__init__.py | 0 .../collections/base/collection.py | 0 pymeos/{pymeos => }/collections/base/set.py | 0 pymeos/{pymeos => }/collections/base/span.py | 0 .../{pymeos => }/collections/base/spanset.py | 0 .../{pymeos => }/collections/geo/__init__.py | 0 pymeos/{pymeos => }/collections/geo/geoset.py | 0 .../collections/number/__init__.py | 0 .../collections/number/floatset.py | 0 .../collections/number/floatspan.py | 0 .../collections/number/floatspanset.py | 0 .../{pymeos => }/collections/number/intset.py | 0 .../collections/number/intspan.py | 0 .../collections/number/intspanset.py | 0 .../{pymeos => }/collections/text/__init__.py | 0 .../{pymeos => }/collections/text/textset.py | 0 .../{pymeos => }/collections/time/__init__.py | 0 .../{pymeos => }/collections/time/dateset.py | 0 .../{pymeos => }/collections/time/datespan.py | 0 .../collections/time/datespanset.py | 0 pymeos/{pymeos => }/collections/time/time.py | 0 .../collections/time/timecollection.py | 0 .../{pymeos => }/collections/time/tstzset.py | 0 .../{pymeos => }/collections/time/tstzspan.py | 0 .../collections/time/tstzspanset.py | 0 pymeos/{pymeos => }/db/__init__.py | 0 pymeos/{pymeos => }/db/asyncpg.py | 0 pymeos/{pymeos => }/db/db_objects.py | 0 pymeos/{pymeos => }/db/psycopg.py | 0 pymeos/{pymeos => }/db/psycopg2.py | 0 pymeos/{pymeos => }/factory.py | 0 pymeos/{pymeos => }/main/__init__.py | 0 pymeos/{pymeos => }/main/tbool.py | 0 pymeos/{pymeos => }/main/tfloat.py | 0 pymeos/{pymeos => }/main/tint.py | 0 pymeos/{pymeos => }/main/tnumber.py | 0 pymeos/{pymeos => }/main/tpoint.py | 0 pymeos/{pymeos => }/main/ttext.py | 0 pymeos/{pymeos => }/meos_init.py | 0 pymeos/{pymeos => }/mixins/__init__.py | 0 pymeos/{pymeos => }/mixins/comparison.py | 0 pymeos/{pymeos => }/mixins/simplify.py | 0 .../mixins/temporal_comparison.py | 0 pymeos/{pymeos => }/plotters/__init__.py | 0 pymeos/{pymeos => }/plotters/box_plotter.py | 0 .../plotters/point_sequence_plotter.py | 0 .../plotters/point_sequenceset_plotter.py | 0 pymeos/{pymeos => }/plotters/range_plotter.py | 0 .../{pymeos => }/plotters/sequence_plotter.py | 0 .../plotters/sequenceset_plotter.py | 0 pymeos/{pymeos => }/plotters/time_plotter.py | 0 pymeos/{pymeos => }/temporal/__init__.py | 0 pymeos/{pymeos => }/temporal/interpolation.py | 0 pymeos/{pymeos => }/temporal/temporal.py | 0 pymeos/{pymeos => }/temporal/tinstant.py | 0 pymeos/{pymeos => }/temporal/tsequence.py | 0 pymeos/{pymeos => }/temporal/tsequenceset.py | 0 pymeos_cffi/.gitignore | 18 - pymeos_cffi/LICENSE | 21 - pymeos_cffi/MANIFEST.in | 1 - pymeos_cffi/README.md | 31 - pymeos_cffi/dev-requirements.txt | 4 - pymeos_cffi/docker/Dockerfile | 25 - pymeos_cffi/docker/MEOS.Dockerfile | 6 - pymeos_cffi/docker/MobilityDB.Dockerfile | 10 - pymeos_cffi/docker/build_wheels.sh | 31 - pymeos_cffi/pymeos_cffi/__init__.py | 2162 -- pymeos_cffi/pymeos_cffi/builder/__init__.py | 0 .../pymeos_cffi/builder/build_header.py | 113 - .../pymeos_cffi/builder/build_pymeos.py | 32 - .../builder/build_pymeos_functions.py | 547 - .../build_pymeos_functions_modifiers.py | 111 - pymeos_cffi/pymeos_cffi/builder/meos.h | 2906 --- pymeos_cffi/pymeos_cffi/builder/objects.py | 114 - .../builder/templates/functions.py | 145 - .../pymeos_cffi/builder/templates/init.py | 38 - pymeos_cffi/pymeos_cffi/enums.py | 129 - pymeos_cffi/pymeos_cffi/errors.py | 181 - pymeos_cffi/pymeos_cffi/functions.py | 17743 ---------------- pymeos_cffi/pyproject.toml | 47 - pymeos_cffi/setup.py | 37 - pymeos/pyproject.toml => pyproject.toml | 0 {pymeos/tests => tests}/__init__.py | 0 {pymeos/tests => tests}/boxes/__init__.py | 0 {pymeos/tests => tests}/boxes/stbox_test.py | 0 {pymeos/tests => tests}/boxes/tbox_test.py | 0 .../tests => tests}/collections/__init__.py | 0 .../collections/number/__init__.py | 0 .../collections/number/floatset_test.py | 500 +- .../collections/number/intset_test.py | 500 +- .../collections/number/intspan_test.py | 0 .../collections/text/__init__.py | 0 .../collections/text/textset_test.py | 0 .../collections/time/__init__.py | 0 .../collections/time/dateset_test.py | 0 .../collections/time/tstzset_test.py | 0 .../collections/time/tstzspan_test.py | 0 .../collections/time/tstzspanset_test.py | 0 {pymeos/tests => tests}/conftest.py | 0 {pymeos/tests => tests}/main/__init__.py | 0 {pymeos/tests => tests}/main/tbool_test.py | 0 {pymeos/tests => tests}/main/tfloat_test.py | 0 .../tests => tests}/main/tgeogpoint_test.py | 0 .../tests => tests}/main/tgeompoint_test.py | 0 {pymeos/tests => tests}/main/tint_test.py | 0 {pymeos/tests => tests}/main/ttext_test.py | 0 {pymeos/tests => tests}/temporal/__init__.py | 0 .../temporal/interpolation_test.py | 0 133 files changed, 523 insertions(+), 25288 deletions(-) delete mode 100644 .github/workflows/build_pymeos_cffi.yml rename pymeos/LICENSE => LICENSE (100%) rename pymeos/dev-requirements.txt => dev-requirements.txt (100%) delete mode 100644 pymeos/.gitignore delete mode 100644 pymeos/CHANGELOG.md delete mode 100644 pymeos/MANIFEST.in delete mode 100644 pymeos/README.md rename pymeos/{pymeos => }/__init__.py (100%) rename pymeos/{pymeos => }/aggregators/__init__.py (100%) rename pymeos/{pymeos => }/aggregators/aggregator.py (100%) rename pymeos/{pymeos => }/aggregators/bool_aggregators.py (100%) rename pymeos/{pymeos => }/aggregators/general_aggregators.py (100%) rename pymeos/{pymeos => }/aggregators/number_aggregators.py (100%) rename pymeos/{pymeos => }/aggregators/point_aggregators.py (100%) rename pymeos/{pymeos => }/aggregators/text_aggregators.py (100%) rename pymeos/{pymeos => }/aggregators/time_aggregators.py (100%) rename pymeos/{pymeos => }/boxes/__init__.py (100%) rename pymeos/{pymeos => }/boxes/box.py (100%) rename pymeos/{pymeos => }/boxes/stbox.py (100%) rename pymeos/{pymeos => }/boxes/tbox.py (100%) rename pymeos/{pymeos => }/collections/__init__.py (100%) rename pymeos/{pymeos => }/collections/base/__init__.py (100%) rename pymeos/{pymeos => }/collections/base/collection.py (100%) rename pymeos/{pymeos => }/collections/base/set.py (100%) rename pymeos/{pymeos => }/collections/base/span.py (100%) rename pymeos/{pymeos => }/collections/base/spanset.py (100%) rename pymeos/{pymeos => }/collections/geo/__init__.py (100%) rename pymeos/{pymeos => }/collections/geo/geoset.py (100%) rename pymeos/{pymeos => }/collections/number/__init__.py (100%) rename pymeos/{pymeos => }/collections/number/floatset.py (100%) rename pymeos/{pymeos => }/collections/number/floatspan.py (100%) rename pymeos/{pymeos => }/collections/number/floatspanset.py (100%) rename pymeos/{pymeos => }/collections/number/intset.py (100%) rename pymeos/{pymeos => }/collections/number/intspan.py (100%) rename pymeos/{pymeos => }/collections/number/intspanset.py (100%) rename pymeos/{pymeos => }/collections/text/__init__.py (100%) rename pymeos/{pymeos => }/collections/text/textset.py (100%) rename pymeos/{pymeos => }/collections/time/__init__.py (100%) rename pymeos/{pymeos => }/collections/time/dateset.py (100%) rename pymeos/{pymeos => }/collections/time/datespan.py (100%) rename pymeos/{pymeos => }/collections/time/datespanset.py (100%) rename pymeos/{pymeos => }/collections/time/time.py (100%) rename pymeos/{pymeos => }/collections/time/timecollection.py (100%) rename pymeos/{pymeos => }/collections/time/tstzset.py (100%) rename pymeos/{pymeos => }/collections/time/tstzspan.py (100%) rename pymeos/{pymeos => }/collections/time/tstzspanset.py (100%) rename pymeos/{pymeos => }/db/__init__.py (100%) rename pymeos/{pymeos => }/db/asyncpg.py (100%) rename pymeos/{pymeos => }/db/db_objects.py (100%) rename pymeos/{pymeos => }/db/psycopg.py (100%) rename pymeos/{pymeos => }/db/psycopg2.py (100%) rename pymeos/{pymeos => }/factory.py (100%) rename pymeos/{pymeos => }/main/__init__.py (100%) rename pymeos/{pymeos => }/main/tbool.py (100%) rename pymeos/{pymeos => }/main/tfloat.py (100%) rename pymeos/{pymeos => }/main/tint.py (100%) rename pymeos/{pymeos => }/main/tnumber.py (100%) rename pymeos/{pymeos => }/main/tpoint.py (100%) rename pymeos/{pymeos => }/main/ttext.py (100%) rename pymeos/{pymeos => }/meos_init.py (100%) rename pymeos/{pymeos => }/mixins/__init__.py (100%) rename pymeos/{pymeos => }/mixins/comparison.py (100%) rename pymeos/{pymeos => }/mixins/simplify.py (100%) rename pymeos/{pymeos => }/mixins/temporal_comparison.py (100%) rename pymeos/{pymeos => }/plotters/__init__.py (100%) rename pymeos/{pymeos => }/plotters/box_plotter.py (100%) rename pymeos/{pymeos => }/plotters/point_sequence_plotter.py (100%) rename pymeos/{pymeos => }/plotters/point_sequenceset_plotter.py (100%) rename pymeos/{pymeos => }/plotters/range_plotter.py (100%) rename pymeos/{pymeos => }/plotters/sequence_plotter.py (100%) rename pymeos/{pymeos => }/plotters/sequenceset_plotter.py (100%) rename pymeos/{pymeos => }/plotters/time_plotter.py (100%) rename pymeos/{pymeos => }/temporal/__init__.py (100%) rename pymeos/{pymeos => }/temporal/interpolation.py (100%) rename pymeos/{pymeos => }/temporal/temporal.py (100%) rename pymeos/{pymeos => }/temporal/tinstant.py (100%) rename pymeos/{pymeos => }/temporal/tsequence.py (100%) rename pymeos/{pymeos => }/temporal/tsequenceset.py (100%) delete mode 100644 pymeos_cffi/.gitignore delete mode 100644 pymeos_cffi/LICENSE delete mode 100644 pymeos_cffi/MANIFEST.in delete mode 100644 pymeos_cffi/README.md delete mode 100644 pymeos_cffi/dev-requirements.txt delete mode 100644 pymeos_cffi/docker/Dockerfile delete mode 100644 pymeos_cffi/docker/MEOS.Dockerfile delete mode 100644 pymeos_cffi/docker/MobilityDB.Dockerfile delete mode 100644 pymeos_cffi/docker/build_wheels.sh delete mode 100644 pymeos_cffi/pymeos_cffi/__init__.py delete mode 100644 pymeos_cffi/pymeos_cffi/builder/__init__.py delete mode 100644 pymeos_cffi/pymeos_cffi/builder/build_header.py delete mode 100644 pymeos_cffi/pymeos_cffi/builder/build_pymeos.py delete mode 100644 pymeos_cffi/pymeos_cffi/builder/build_pymeos_functions.py delete mode 100644 pymeos_cffi/pymeos_cffi/builder/build_pymeos_functions_modifiers.py delete mode 100644 pymeos_cffi/pymeos_cffi/builder/meos.h delete mode 100644 pymeos_cffi/pymeos_cffi/builder/objects.py delete mode 100644 pymeos_cffi/pymeos_cffi/builder/templates/functions.py delete mode 100644 pymeos_cffi/pymeos_cffi/builder/templates/init.py delete mode 100644 pymeos_cffi/pymeos_cffi/enums.py delete mode 100644 pymeos_cffi/pymeos_cffi/errors.py delete mode 100644 pymeos_cffi/pymeos_cffi/functions.py delete mode 100644 pymeos_cffi/pyproject.toml delete mode 100644 pymeos_cffi/setup.py rename pymeos/pyproject.toml => pyproject.toml (100%) rename {pymeos/tests => tests}/__init__.py (100%) rename {pymeos/tests => tests}/boxes/__init__.py (100%) rename {pymeos/tests => tests}/boxes/stbox_test.py (100%) rename {pymeos/tests => tests}/boxes/tbox_test.py (100%) rename {pymeos/tests => tests}/collections/__init__.py (100%) rename {pymeos/tests => tests}/collections/number/__init__.py (100%) rename {pymeos/tests => tests}/collections/number/floatset_test.py (96%) rename {pymeos/tests => tests}/collections/number/intset_test.py (96%) rename {pymeos/tests => tests}/collections/number/intspan_test.py (100%) rename {pymeos/tests => tests}/collections/text/__init__.py (100%) rename {pymeos/tests => tests}/collections/text/textset_test.py (100%) rename {pymeos/tests => tests}/collections/time/__init__.py (100%) rename {pymeos/tests => tests}/collections/time/dateset_test.py (100%) rename {pymeos/tests => tests}/collections/time/tstzset_test.py (100%) rename {pymeos/tests => tests}/collections/time/tstzspan_test.py (100%) rename {pymeos/tests => tests}/collections/time/tstzspanset_test.py (100%) rename {pymeos/tests => tests}/conftest.py (100%) rename {pymeos/tests => tests}/main/__init__.py (100%) rename {pymeos/tests => tests}/main/tbool_test.py (100%) rename {pymeos/tests => tests}/main/tfloat_test.py (100%) rename {pymeos/tests => tests}/main/tgeogpoint_test.py (100%) rename {pymeos/tests => tests}/main/tgeompoint_test.py (100%) rename {pymeos/tests => tests}/main/tint_test.py (100%) rename {pymeos/tests => tests}/main/ttext_test.py (100%) rename {pymeos/tests => tests}/temporal/__init__.py (100%) rename {pymeos/tests => tests}/temporal/interpolation_test.py (100%) diff --git a/.github/workflows/build_pymeos_cffi.yml b/.github/workflows/build_pymeos_cffi.yml deleted file mode 100644 index 1f74323b..00000000 --- a/.github/workflows/build_pymeos_cffi.yml +++ /dev/null @@ -1,224 +0,0 @@ -name: Build PyMEOS CFFI - -on: - create: - tags: - - "pymeos-cffi-[0-9]+.[0-9]+.[0-9]+*" - -jobs: - build_sdist: - name: Build PyMEOS CFFI source distribution - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Install Python - uses: actions/setup-python@v5 - with: - python-version: 3.8 - cache: "pip" - - - name: Setup pip - run: | - python -m pip install --upgrade pip - python -m pip install build - - - name: Build sdist - working-directory: pymeos_cffi - run: | - python -m build -s - ls -l dist - - - uses: actions/upload-artifact@v4 - with: - name: pymeos_cffi-sdist - path: ./pymeos_cffi/dist/pymeos_cffi-*.tar.gz - - build_wheels: - name: Build PyMEOS CFFI for ${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ ubuntu-latest, macos-13, macos-14 ] - include: - - ld_prefix: "/usr/local" - - os: macos-14 - ld_prefix: "/opt/homebrew" - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - 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 dependencies from homebrew (cache) - uses: tecolicom/actions-use-homebrew-tools@v1 - if: runner.os == 'macOS' - with: - tools: cmake libpq proj json-c gsl geos - - - name: Get PROJ version - id: proj_version - if: runner.os == 'macOS' - run: | - proj_version=$(brew list --versions proj) - proj_version=${proj_version#* } - echo "proj_version=$proj_version" >> $GITHUB_OUTPUT - - - name: Install MEOS - if: runner.os == 'macOS' - run: | - git clone --depth 1 https://github.com/MobilityDB/MobilityDB - mkdir MobilityDB/build - cd MobilityDB/build - cmake .. -DMEOS=on - make -j - sudo make install - - - name: Setup Python - uses: actions/setup-python@v5 - with: - cache: "pip" - - - name: Install cibuildwheel - run: python -m pip install cibuildwheel==2.17.0 - - - name: Set PROJ_DATA (macOS) - if: runner.os == 'macOS' - run: | - PROJ_DATA=${{ matrix.ld_prefix }}/Cellar/proj/${{ steps.proj_version.outputs.proj_version }}/share/proj - echo "PROJ_DATA=$PROJ_DATA" >> $GITHUB_ENV - - - name: Set PROJ_DATA and JSON-C path (Linux) - if: runner.os == 'Linux' - run: | - PROJ_DATA=/usr/proj81/share/proj - echo "PROJ_DATA=$PROJ_DATA" >> $GITHUB_ENV - echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib64" >> $GITHUB_ENV - - - name: Build wheels - working-directory: pymeos_cffi - run: | - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${{ matrix.ld_prefix }}/lib - export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:${{ matrix.ld_prefix }}/lib - export PACKAGE_DATA=1 - python -m cibuildwheel --output-dir wheelhouse - env: - # Disable PyPy builds - # Disable builds on musllinux - # 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 - 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 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 && - make -j && - make install - - # Skip tests since they will be thoroughly tested in the next job - CIBW_TEST_SKIP: "*" - - - uses: actions/upload-artifact@v4 - with: - name: pymeos_cffi-wheels-${{ matrix.os }} - path: ./pymeos_cffi/wheelhouse/*.whl - - test_wheels: - name: Test PyMEOS CFFI wheel - Python ${{ matrix.python-version }} on ${{ matrix.os }} - needs: build_wheels - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ] - os: [ ubuntu-latest, macos-13, macos-14 ] - exclude: - # Necessary due to issue with macOS runners. See - # https://github.com/actions/setup-python/issues/808 - # Can be removed once this PR is merged: - # https://github.com/actions/python-versions/pull/259 - - os: macos-14 - python-version: "3.8" - - os: macos-14 - python-version: "3.9" - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Download wheels - uses: actions/download-artifact@v4 - with: - name: pymeos_cffi-wheels-${{ matrix.os }} - path: ./pymeos_cffi_wheels - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - cache: "pip" - - - name: Install PyMEOS dependencies - run: | - python -m pip install --upgrade pip - pip install -f ./pymeos_cffi_wheels pymeos_cffi - pip install -r pymeos/dev-requirements.txt - - - name: Test PyMEOS with pytest - working-directory: pymeos - run: pytest - - upload_pypi: - name: Upload to PyPI - needs: [ test_wheels, build_sdist ] - runs-on: ubuntu-22.04 - if: github.repository == 'MobilityDB/PyMEOS' - permissions: - id-token: write - steps: - - name: Get artifacts - uses: actions/download-artifact@v4 - with: - path: ./dist - merge-multiple: true - - - name: Publish to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 - with: - skip_existing: true - - create_release: - name: Create GitHub Release - needs: [ test_wheels, build_sdist ] - runs-on: ubuntu-22.04 - steps: - - name: Get artifacts - uses: actions/download-artifact@v4 - with: - path: ./dist - merge-multiple: true - - - name: Create Release - uses: softprops/action-gh-release@v2 - with: - files: ./dist/* diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3d4b9d0d..db5ea300 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,18 +2,18 @@ name: Test PyMEOS on: push: - branches: [ "develop", "master" ] + branches: [ "master", "stable-[0-9]+.[0-9]+" ] paths-ignore: - "docs/**" - ".readthedocs.yml" - - "**/README.md" + - "README.md" - ".github/ISSUE_TEMPLATE/**" pull_request: - branches: [ "develop", "master" ] + branches: [ "master", "stable-[0-9]+.[0-9]+" ] paths-ignore: - "docs/**" - ".readthedocs.yml" - - "**/README.md" + - "README.md" - ".github/ISSUE_TEMPLATE/**" jobs: diff --git a/.gitignore b/.gitignore index a0393ec2..bf26d1b6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,15 @@ .idea -docs/_build \ No newline at end of file +.vscode + +build +dist +docs/_build + +*.egg-info +.pytest_cache +*.pyc + +sandbox.py +sandbox.ipynb + +coverage.xml \ No newline at end of file diff --git a/pymeos/LICENSE b/LICENSE similarity index 100% rename from pymeos/LICENSE rename to LICENSE diff --git a/README.md b/README.md index f7d28b17..cf5809a4 100644 --- a/README.md +++ b/README.md @@ -9,11 +9,8 @@ temporal and spatio-temporal data based on [MobilityDB](https://mobilitydb.com/) PyMEOS is a library built on top of MEOS that provides all of its functionality wrapped in a set of Python classes. -This repository contains 2 subprojects: - -- [PyMEOS CFFI](./pymeos_cffi): wrapper of the MEOS C Library built using CFFI. -- [PyMEOS](./pymeos): library that exposes the set of classes that should be used by the developer. Built on top of - PyMEOS CFFI. +For the PyMEOS CFFI library, the middle layer between MEOS and PyMEOS, see +the [PyMEOS CFFI repository](https://github.com/MobilityDB/PyMEOS-CFFI). # Usage @@ -28,9 +25,7 @@ pip install pymeos ```` > PyMEOS wheel should be compatible with any system, but it is possible that the pre-built distribution is -> not available for PyMEOS CFFI for some OS/Architecture. -> If it is not available, see the [source installation notes on PyMEOS CFFI's readme](../pymeos_cffi#installation) -> on how to proceed +> not available for PyMEOS CFFI for some OS/Architecture. ### Using conda @@ -78,6 +73,7 @@ print(f'Speeds: {speed}') # Call finish at the end of your code pymeos_finalize() ```` + ```` Output: [POINT(10 10)@2019-09-01 01:00:00+02, POINT(20 20)@2019-09-02 01:00:00+02, POINT(10 10)@2019-09-03 01:00:00+02] Speeds: Interp=Step;[17.84556057812839@2019-09-01 01:00:00+02, 17.84556057812839@2019-09-03 01:00:00+02] diff --git a/pymeos/dev-requirements.txt b/dev-requirements.txt similarity index 100% rename from pymeos/dev-requirements.txt rename to dev-requirements.txt diff --git a/docs/requirements.txt b/docs/requirements.txt index dae2f1e5..5d95ab22 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,6 +1,6 @@ python-dateutil shapely -pymeos_cffi==1.1.0rc1 +pymeos_cffi asyncpg psycopg psycopg2 diff --git a/pymeos/.gitignore b/pymeos/.gitignore deleted file mode 100644 index 7b4555d8..00000000 --- a/pymeos/.gitignore +++ /dev/null @@ -1,17 +0,0 @@ -.idea -.vscode - -.micromamba -d - -build -dist -docs/_build - -*.egg-info -.pytest_cache -*.pyc - -sandbox.py - -coverage.xml \ No newline at end of file diff --git a/pymeos/CHANGELOG.md b/pymeos/CHANGELOG.md deleted file mode 100644 index bac06d7f..00000000 --- a/pymeos/CHANGELOG.md +++ /dev/null @@ -1,36 +0,0 @@ -## 1.2.0 - -### Breaking changes - -- All `@property` decorators have been removed to reflect that the elements return are computed. - They may be added again in the future, probably with some caching mechanism. -- `Period` method `distance` now returns a `datetime.timedelta` with the distance instead - of returning the number of seconds. -- `BaseGranularityAggregator` renamed to `BaseGranularAggregator` and no longer subclass of `BaseAggregator` -- Time aggregators renamed to `TimeInstantaneousUnionAggregator` and `TimeContinuousUnionAggregator` - -## 1.1.2 - -- Add support for `asyncpg`. -- Add support for `psycopg` (psycopg v3). - -### Breaking changes - -- `MobilityDB` using `psycopg2` has been moved from `pymeos.db` to `pymeos.db.psycopg2` due to the addition of `asyncpg` - and `psycopg` support. - -## 1.1.1 - -- All MEOS functions added to PyMEOS. - -## 1.1.0 - -### Breaking changes - -- Function `meos_initialize` is now called `pymeos_initialize` and can receive a `str` parameter stating the desired - timezone (e.b. `pymeos_initialize('UTC')`) -- Function `meos_finish` is now called `pymeos_finalize`. - -## 1.0.0 - -Use MEOS as backend. \ No newline at end of file diff --git a/pymeos/MANIFEST.in b/pymeos/MANIFEST.in deleted file mode 100644 index 2af24064..00000000 --- a/pymeos/MANIFEST.in +++ /dev/null @@ -1 +0,0 @@ -exclude pymeos/examples pymeos/utils.py \ No newline at end of file diff --git a/pymeos/README.md b/pymeos/README.md deleted file mode 100644 index d9337554..00000000 --- a/pymeos/README.md +++ /dev/null @@ -1,44 +0,0 @@ -# ![MEOS Logo](https://raw.githubusercontent.com/MobilityDB/PyMEOS/master/docs/images/PyMEOS%20Logo.png) - -[MEOS (Mobility Engine, Open Source)](https://www.libmeos.org/) is a C library which enables the manipulation of -temporal and spatio-temporal data based on [MobilityDB](https://mobilitydb.com/)'s data types and functions. -PyMEOS is a Python library built on top of MEOS using CFFI which presents a set of classes to manipulate spatio-temporal -information - -# Usage - -## Installation - -````shell -pip install pymeos -```` -> PyMEOS wheel should be compatible with any system, but it is possible that the pre-built distribution is -> not available for PyMEOS CFFI for some OS/Architecture. -> If it is not available, see the [source installation notes on PyMEOS CFFI's readme](../pymeos_cffi#installation) -> on how to proceed - -## Sample code - -> **IMPORTANT** Before using any PyMEOS function, always call `pymeos_initialize`. Otherwise, the library will -> crash with a `Segmentation Fault` error. You should also always call `pymeos_finalize` at the end of your code. - -````python -from pymeos import pymeos_initialize, pymeos_finalize, TGeogPointInst, TGeogPointSeq - -# Important: Always initialize MEOS library -pymeos_initialize() - -sequence_from_string = TGeogPointSeq(string='[Point(10.0 10.0)@2019-09-01 00:00:00+01, Point(20.0 20.0)@2019-09-02 00:00:00+01, Point(10.0 10.0)@2019-09-03 00:00:00+01]') -print(f'Output: {sequence_from_string}') - -sequence_from_points = TGeogPointSeq(instant_list=[TGeogPointInst(string='Point(10.0 10.0)@2019-09-01 00:00:00+01'), TGeogPointInst(string='Point(20.0 20.0)@2019-09-02 00:00:00+01'), TGeogPointInst(string='Point(10.0 10.0)@2019-09-03 00:00:00+01')], lower_inc=True, upper_inc=True) -speed = sequence_from_points.speed() -print(f'Speeds: {speed}') - -# Call finish at the end of your code -pymeos_finalize() -```` - -# Documentation - -Visit our [ReadTheDocs page](https://pymeos.readthedocs.io/en/latest/) for a more complete and detailed documentation, including an installation manual and several examples. \ No newline at end of file diff --git a/pymeos/pymeos/__init__.py b/pymeos/__init__.py similarity index 100% rename from pymeos/pymeos/__init__.py rename to pymeos/__init__.py diff --git a/pymeos/pymeos/aggregators/__init__.py b/pymeos/aggregators/__init__.py similarity index 100% rename from pymeos/pymeos/aggregators/__init__.py rename to pymeos/aggregators/__init__.py diff --git a/pymeos/pymeos/aggregators/aggregator.py b/pymeos/aggregators/aggregator.py similarity index 100% rename from pymeos/pymeos/aggregators/aggregator.py rename to pymeos/aggregators/aggregator.py diff --git a/pymeos/pymeos/aggregators/bool_aggregators.py b/pymeos/aggregators/bool_aggregators.py similarity index 100% rename from pymeos/pymeos/aggregators/bool_aggregators.py rename to pymeos/aggregators/bool_aggregators.py diff --git a/pymeos/pymeos/aggregators/general_aggregators.py b/pymeos/aggregators/general_aggregators.py similarity index 100% rename from pymeos/pymeos/aggregators/general_aggregators.py rename to pymeos/aggregators/general_aggregators.py diff --git a/pymeos/pymeos/aggregators/number_aggregators.py b/pymeos/aggregators/number_aggregators.py similarity index 100% rename from pymeos/pymeos/aggregators/number_aggregators.py rename to pymeos/aggregators/number_aggregators.py diff --git a/pymeos/pymeos/aggregators/point_aggregators.py b/pymeos/aggregators/point_aggregators.py similarity index 100% rename from pymeos/pymeos/aggregators/point_aggregators.py rename to pymeos/aggregators/point_aggregators.py diff --git a/pymeos/pymeos/aggregators/text_aggregators.py b/pymeos/aggregators/text_aggregators.py similarity index 100% rename from pymeos/pymeos/aggregators/text_aggregators.py rename to pymeos/aggregators/text_aggregators.py diff --git a/pymeos/pymeos/aggregators/time_aggregators.py b/pymeos/aggregators/time_aggregators.py similarity index 100% rename from pymeos/pymeos/aggregators/time_aggregators.py rename to pymeos/aggregators/time_aggregators.py diff --git a/pymeos/pymeos/boxes/__init__.py b/pymeos/boxes/__init__.py similarity index 100% rename from pymeos/pymeos/boxes/__init__.py rename to pymeos/boxes/__init__.py diff --git a/pymeos/pymeos/boxes/box.py b/pymeos/boxes/box.py similarity index 100% rename from pymeos/pymeos/boxes/box.py rename to pymeos/boxes/box.py diff --git a/pymeos/pymeos/boxes/stbox.py b/pymeos/boxes/stbox.py similarity index 100% rename from pymeos/pymeos/boxes/stbox.py rename to pymeos/boxes/stbox.py diff --git a/pymeos/pymeos/boxes/tbox.py b/pymeos/boxes/tbox.py similarity index 100% rename from pymeos/pymeos/boxes/tbox.py rename to pymeos/boxes/tbox.py diff --git a/pymeos/pymeos/collections/__init__.py b/pymeos/collections/__init__.py similarity index 100% rename from pymeos/pymeos/collections/__init__.py rename to pymeos/collections/__init__.py diff --git a/pymeos/pymeos/collections/base/__init__.py b/pymeos/collections/base/__init__.py similarity index 100% rename from pymeos/pymeos/collections/base/__init__.py rename to pymeos/collections/base/__init__.py diff --git a/pymeos/pymeos/collections/base/collection.py b/pymeos/collections/base/collection.py similarity index 100% rename from pymeos/pymeos/collections/base/collection.py rename to pymeos/collections/base/collection.py diff --git a/pymeos/pymeos/collections/base/set.py b/pymeos/collections/base/set.py similarity index 100% rename from pymeos/pymeos/collections/base/set.py rename to pymeos/collections/base/set.py diff --git a/pymeos/pymeos/collections/base/span.py b/pymeos/collections/base/span.py similarity index 100% rename from pymeos/pymeos/collections/base/span.py rename to pymeos/collections/base/span.py diff --git a/pymeos/pymeos/collections/base/spanset.py b/pymeos/collections/base/spanset.py similarity index 100% rename from pymeos/pymeos/collections/base/spanset.py rename to pymeos/collections/base/spanset.py diff --git a/pymeos/pymeos/collections/geo/__init__.py b/pymeos/collections/geo/__init__.py similarity index 100% rename from pymeos/pymeos/collections/geo/__init__.py rename to pymeos/collections/geo/__init__.py diff --git a/pymeos/pymeos/collections/geo/geoset.py b/pymeos/collections/geo/geoset.py similarity index 100% rename from pymeos/pymeos/collections/geo/geoset.py rename to pymeos/collections/geo/geoset.py diff --git a/pymeos/pymeos/collections/number/__init__.py b/pymeos/collections/number/__init__.py similarity index 100% rename from pymeos/pymeos/collections/number/__init__.py rename to pymeos/collections/number/__init__.py diff --git a/pymeos/pymeos/collections/number/floatset.py b/pymeos/collections/number/floatset.py similarity index 100% rename from pymeos/pymeos/collections/number/floatset.py rename to pymeos/collections/number/floatset.py diff --git a/pymeos/pymeos/collections/number/floatspan.py b/pymeos/collections/number/floatspan.py similarity index 100% rename from pymeos/pymeos/collections/number/floatspan.py rename to pymeos/collections/number/floatspan.py diff --git a/pymeos/pymeos/collections/number/floatspanset.py b/pymeos/collections/number/floatspanset.py similarity index 100% rename from pymeos/pymeos/collections/number/floatspanset.py rename to pymeos/collections/number/floatspanset.py diff --git a/pymeos/pymeos/collections/number/intset.py b/pymeos/collections/number/intset.py similarity index 100% rename from pymeos/pymeos/collections/number/intset.py rename to pymeos/collections/number/intset.py diff --git a/pymeos/pymeos/collections/number/intspan.py b/pymeos/collections/number/intspan.py similarity index 100% rename from pymeos/pymeos/collections/number/intspan.py rename to pymeos/collections/number/intspan.py diff --git a/pymeos/pymeos/collections/number/intspanset.py b/pymeos/collections/number/intspanset.py similarity index 100% rename from pymeos/pymeos/collections/number/intspanset.py rename to pymeos/collections/number/intspanset.py diff --git a/pymeos/pymeos/collections/text/__init__.py b/pymeos/collections/text/__init__.py similarity index 100% rename from pymeos/pymeos/collections/text/__init__.py rename to pymeos/collections/text/__init__.py diff --git a/pymeos/pymeos/collections/text/textset.py b/pymeos/collections/text/textset.py similarity index 100% rename from pymeos/pymeos/collections/text/textset.py rename to pymeos/collections/text/textset.py diff --git a/pymeos/pymeos/collections/time/__init__.py b/pymeos/collections/time/__init__.py similarity index 100% rename from pymeos/pymeos/collections/time/__init__.py rename to pymeos/collections/time/__init__.py diff --git a/pymeos/pymeos/collections/time/dateset.py b/pymeos/collections/time/dateset.py similarity index 100% rename from pymeos/pymeos/collections/time/dateset.py rename to pymeos/collections/time/dateset.py diff --git a/pymeos/pymeos/collections/time/datespan.py b/pymeos/collections/time/datespan.py similarity index 100% rename from pymeos/pymeos/collections/time/datespan.py rename to pymeos/collections/time/datespan.py diff --git a/pymeos/pymeos/collections/time/datespanset.py b/pymeos/collections/time/datespanset.py similarity index 100% rename from pymeos/pymeos/collections/time/datespanset.py rename to pymeos/collections/time/datespanset.py diff --git a/pymeos/pymeos/collections/time/time.py b/pymeos/collections/time/time.py similarity index 100% rename from pymeos/pymeos/collections/time/time.py rename to pymeos/collections/time/time.py diff --git a/pymeos/pymeos/collections/time/timecollection.py b/pymeos/collections/time/timecollection.py similarity index 100% rename from pymeos/pymeos/collections/time/timecollection.py rename to pymeos/collections/time/timecollection.py diff --git a/pymeos/pymeos/collections/time/tstzset.py b/pymeos/collections/time/tstzset.py similarity index 100% rename from pymeos/pymeos/collections/time/tstzset.py rename to pymeos/collections/time/tstzset.py diff --git a/pymeos/pymeos/collections/time/tstzspan.py b/pymeos/collections/time/tstzspan.py similarity index 100% rename from pymeos/pymeos/collections/time/tstzspan.py rename to pymeos/collections/time/tstzspan.py diff --git a/pymeos/pymeos/collections/time/tstzspanset.py b/pymeos/collections/time/tstzspanset.py similarity index 100% rename from pymeos/pymeos/collections/time/tstzspanset.py rename to pymeos/collections/time/tstzspanset.py diff --git a/pymeos/pymeos/db/__init__.py b/pymeos/db/__init__.py similarity index 100% rename from pymeos/pymeos/db/__init__.py rename to pymeos/db/__init__.py diff --git a/pymeos/pymeos/db/asyncpg.py b/pymeos/db/asyncpg.py similarity index 100% rename from pymeos/pymeos/db/asyncpg.py rename to pymeos/db/asyncpg.py diff --git a/pymeos/pymeos/db/db_objects.py b/pymeos/db/db_objects.py similarity index 100% rename from pymeos/pymeos/db/db_objects.py rename to pymeos/db/db_objects.py diff --git a/pymeos/pymeos/db/psycopg.py b/pymeos/db/psycopg.py similarity index 100% rename from pymeos/pymeos/db/psycopg.py rename to pymeos/db/psycopg.py diff --git a/pymeos/pymeos/db/psycopg2.py b/pymeos/db/psycopg2.py similarity index 100% rename from pymeos/pymeos/db/psycopg2.py rename to pymeos/db/psycopg2.py diff --git a/pymeos/pymeos/factory.py b/pymeos/factory.py similarity index 100% rename from pymeos/pymeos/factory.py rename to pymeos/factory.py diff --git a/pymeos/pymeos/main/__init__.py b/pymeos/main/__init__.py similarity index 100% rename from pymeos/pymeos/main/__init__.py rename to pymeos/main/__init__.py diff --git a/pymeos/pymeos/main/tbool.py b/pymeos/main/tbool.py similarity index 100% rename from pymeos/pymeos/main/tbool.py rename to pymeos/main/tbool.py diff --git a/pymeos/pymeos/main/tfloat.py b/pymeos/main/tfloat.py similarity index 100% rename from pymeos/pymeos/main/tfloat.py rename to pymeos/main/tfloat.py diff --git a/pymeos/pymeos/main/tint.py b/pymeos/main/tint.py similarity index 100% rename from pymeos/pymeos/main/tint.py rename to pymeos/main/tint.py diff --git a/pymeos/pymeos/main/tnumber.py b/pymeos/main/tnumber.py similarity index 100% rename from pymeos/pymeos/main/tnumber.py rename to pymeos/main/tnumber.py diff --git a/pymeos/pymeos/main/tpoint.py b/pymeos/main/tpoint.py similarity index 100% rename from pymeos/pymeos/main/tpoint.py rename to pymeos/main/tpoint.py diff --git a/pymeos/pymeos/main/ttext.py b/pymeos/main/ttext.py similarity index 100% rename from pymeos/pymeos/main/ttext.py rename to pymeos/main/ttext.py diff --git a/pymeos/pymeos/meos_init.py b/pymeos/meos_init.py similarity index 100% rename from pymeos/pymeos/meos_init.py rename to pymeos/meos_init.py diff --git a/pymeos/pymeos/mixins/__init__.py b/pymeos/mixins/__init__.py similarity index 100% rename from pymeos/pymeos/mixins/__init__.py rename to pymeos/mixins/__init__.py diff --git a/pymeos/pymeos/mixins/comparison.py b/pymeos/mixins/comparison.py similarity index 100% rename from pymeos/pymeos/mixins/comparison.py rename to pymeos/mixins/comparison.py diff --git a/pymeos/pymeos/mixins/simplify.py b/pymeos/mixins/simplify.py similarity index 100% rename from pymeos/pymeos/mixins/simplify.py rename to pymeos/mixins/simplify.py diff --git a/pymeos/pymeos/mixins/temporal_comparison.py b/pymeos/mixins/temporal_comparison.py similarity index 100% rename from pymeos/pymeos/mixins/temporal_comparison.py rename to pymeos/mixins/temporal_comparison.py diff --git a/pymeos/pymeos/plotters/__init__.py b/pymeos/plotters/__init__.py similarity index 100% rename from pymeos/pymeos/plotters/__init__.py rename to pymeos/plotters/__init__.py diff --git a/pymeos/pymeos/plotters/box_plotter.py b/pymeos/plotters/box_plotter.py similarity index 100% rename from pymeos/pymeos/plotters/box_plotter.py rename to pymeos/plotters/box_plotter.py diff --git a/pymeos/pymeos/plotters/point_sequence_plotter.py b/pymeos/plotters/point_sequence_plotter.py similarity index 100% rename from pymeos/pymeos/plotters/point_sequence_plotter.py rename to pymeos/plotters/point_sequence_plotter.py diff --git a/pymeos/pymeos/plotters/point_sequenceset_plotter.py b/pymeos/plotters/point_sequenceset_plotter.py similarity index 100% rename from pymeos/pymeos/plotters/point_sequenceset_plotter.py rename to pymeos/plotters/point_sequenceset_plotter.py diff --git a/pymeos/pymeos/plotters/range_plotter.py b/pymeos/plotters/range_plotter.py similarity index 100% rename from pymeos/pymeos/plotters/range_plotter.py rename to pymeos/plotters/range_plotter.py diff --git a/pymeos/pymeos/plotters/sequence_plotter.py b/pymeos/plotters/sequence_plotter.py similarity index 100% rename from pymeos/pymeos/plotters/sequence_plotter.py rename to pymeos/plotters/sequence_plotter.py diff --git a/pymeos/pymeos/plotters/sequenceset_plotter.py b/pymeos/plotters/sequenceset_plotter.py similarity index 100% rename from pymeos/pymeos/plotters/sequenceset_plotter.py rename to pymeos/plotters/sequenceset_plotter.py diff --git a/pymeos/pymeos/plotters/time_plotter.py b/pymeos/plotters/time_plotter.py similarity index 100% rename from pymeos/pymeos/plotters/time_plotter.py rename to pymeos/plotters/time_plotter.py diff --git a/pymeos/pymeos/temporal/__init__.py b/pymeos/temporal/__init__.py similarity index 100% rename from pymeos/pymeos/temporal/__init__.py rename to pymeos/temporal/__init__.py diff --git a/pymeos/pymeos/temporal/interpolation.py b/pymeos/temporal/interpolation.py similarity index 100% rename from pymeos/pymeos/temporal/interpolation.py rename to pymeos/temporal/interpolation.py diff --git a/pymeos/pymeos/temporal/temporal.py b/pymeos/temporal/temporal.py similarity index 100% rename from pymeos/pymeos/temporal/temporal.py rename to pymeos/temporal/temporal.py diff --git a/pymeos/pymeos/temporal/tinstant.py b/pymeos/temporal/tinstant.py similarity index 100% rename from pymeos/pymeos/temporal/tinstant.py rename to pymeos/temporal/tinstant.py diff --git a/pymeos/pymeos/temporal/tsequence.py b/pymeos/temporal/tsequence.py similarity index 100% rename from pymeos/pymeos/temporal/tsequence.py rename to pymeos/temporal/tsequence.py diff --git a/pymeos/pymeos/temporal/tsequenceset.py b/pymeos/temporal/tsequenceset.py similarity index 100% rename from pymeos/pymeos/temporal/tsequenceset.py rename to pymeos/temporal/tsequenceset.py diff --git a/pymeos_cffi/.gitignore b/pymeos_cffi/.gitignore deleted file mode 100644 index a8a6cd33..00000000 --- a/pymeos_cffi/.gitignore +++ /dev/null @@ -1,18 +0,0 @@ -.idea -.vscode - -.micromamba -d - -.eggs -build -dist - -*.egg-info - -*.c -*.pyc -*.o -*.so - -test.py \ No newline at end of file diff --git a/pymeos_cffi/LICENSE b/pymeos_cffi/LICENSE deleted file mode 100644 index 853efa53..00000000 --- a/pymeos_cffi/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -PostgreSQL License - -------------------------------------------------------------------------------- -This PyMEOS CFFI code is provided under The PostgreSQL License. - -Copyright (c) 2020, Université libre de Bruxelles and PyMEOS CFFI contributors - -PyMEOS CFFI includes MEOS, which includes portions of PostGIS version 3 source code released under the GNU General -Public License (GPLv2 or later). Copyright (c) 2001-2023, PostGIS contributors - -Permission to use, copy, modify, and distribute this software and its documentation for any purpose, without fee, and without a written agreement is hereby -granted, provided that the above copyright notice and this paragraph and the following two paragraphs appear in all copies. - -IN NO EVENT SHALL UNIVERSITÉ LIBRE DE BRUXELLES AND PYMEOS CFFI CONTRIBUTORS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST -PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF UNIVERSITÉ LIBRE DE BRUXELLES AND PYMEOS CFFI CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -UNIVERSITÉ LIBRE DE BRUXELLES AND PYMEOS CFFI CONTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND UNIVERSITÉ LIBRE DE BRUXELLES AND PYMEOS CFFI CONTRIBUTORS HAVE NO OBLIGATIONS TO PROVIDE -MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. -------------------------------------------------------------------------------- \ No newline at end of file diff --git a/pymeos_cffi/MANIFEST.in b/pymeos_cffi/MANIFEST.in deleted file mode 100644 index 07c7e8b5..00000000 --- a/pymeos_cffi/MANIFEST.in +++ /dev/null @@ -1 +0,0 @@ -include pymeos_cffi/builder/meos.h \ No newline at end of file diff --git a/pymeos_cffi/README.md b/pymeos_cffi/README.md deleted file mode 100644 index b33260d3..00000000 --- a/pymeos_cffi/README.md +++ /dev/null @@ -1,31 +0,0 @@ -# ![MEOS Logo](https://raw.githubusercontent.com/MobilityDB/PyMEOS/master/docs/images/PyMEOS%20Logo.png) - -[MEOS (Mobility Engine, Open Source)](https://www.libmeos.org/) is a C library which enables the manipulation of -temporal and spatio-temporal data based on [MobilityDB](https://mobilitydb.com/)'s data types and functions. - -PyMEOS CFFI is a Python library that wraps the MEOS C library using CFFI, providing a set of python functions -that allows to use all MEOS functionality while automatically taking care of conversions between basic Python and C types -(such as Python's `str` to C's `char *`). - -This library is not meant to be used directly by the user, since most of the functions receive or return C objects -(CFFI's `cdata` type). - -The [PyMEOS](../pymeos) library is built on top of this library and exposes all the functionality -of MEOS through a set of Python classes. - -# Usage - -## Installation - -````shell -pip install pymeos-cffi -```` - -## Source installation -If the pre-built distribution is not available for your system, `pip` will try to make source distribution. For that, you will -need to make sure you have the following requirements: - -- C compiler -- [MEOS Library](https://www.libmeos.org/) - -If the installation fails, you can submit an issue in the [PyMEOS issue tracker](https://github.com/MobilityDB/PyMEOS/issues) \ No newline at end of file diff --git a/pymeos_cffi/dev-requirements.txt b/pymeos_cffi/dev-requirements.txt deleted file mode 100644 index 1218dcd7..00000000 --- a/pymeos_cffi/dev-requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -cffi -python-dateutil -shapely -build \ No newline at end of file diff --git a/pymeos_cffi/docker/Dockerfile b/pymeos_cffi/docker/Dockerfile deleted file mode 100644 index 2a79fba6..00000000 --- a/pymeos_cffi/docker/Dockerfile +++ /dev/null @@ -1,25 +0,0 @@ -FROM pymeos/meos:latest -WORKDIR MobilityDB - -RUN git fetch \ - && git checkout master \ - && git pull - - -WORKDIR build - -RUN 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 \ - && make -j \ - && make install - -COPY build_wheels.sh /build_wheels.sh -RUN sed -i -e 's/\r$//' /build_wheels.sh \ - && chmod +x /build_wheels.sh \ - && rm -rf /opt/python/cp36-cp36m \ - && mkdir /wheelhouse_int - -ENV LD_LIBRARY_PATH=/usr/lib64;/lib64 - -WORKDIR / - -CMD ["/build_wheels.sh"] \ No newline at end of file diff --git a/pymeos_cffi/docker/MEOS.Dockerfile b/pymeos_cffi/docker/MEOS.Dockerfile deleted file mode 100644 index 8d4f0a61..00000000 --- a/pymeos_cffi/docker/MEOS.Dockerfile +++ /dev/null @@ -1,6 +0,0 @@ -FROM quay.io/pypa/manylinux2014_x86_64 - -RUN 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 json-c-devel geos39-devel gsl-devel \ - && git clone https://github.com/MobilityDB/MobilityDB diff --git a/pymeos_cffi/docker/MobilityDB.Dockerfile b/pymeos_cffi/docker/MobilityDB.Dockerfile deleted file mode 100644 index 4a1d064f..00000000 --- a/pymeos_cffi/docker/MobilityDB.Dockerfile +++ /dev/null @@ -1,10 +0,0 @@ -FROM debian:buster-slim - -RUN apt install build-essential cmake postgresql-server-dev-11 liblwgeom-dev libproj-dev libjson-c-dev libprotobuf-c-dev - -RUN git clone --branch develop https://github.com/MobilityDB/MobilityDB -WORKDIR MobilityDB/build - - - - diff --git a/pymeos_cffi/docker/build_wheels.sh b/pymeos_cffi/docker/build_wheels.sh deleted file mode 100644 index bd2aba6e..00000000 --- a/pymeos_cffi/docker/build_wheels.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash -set -e -u -# -# Command: docker run --rm -ti -v :/PyMEOS -v :/wheelhouse pymeos/builder -# Example: docker run --rm -ti -v /home/diviloper/MobilityDB/PyMEOS:/PyMEOS -v /home/diviloper/MobilityDB/PyMEOS/pymeos_cffi/dist:/wheelhouse pymeos/builder -# -function repair_wheel { - wheel="$1" - if ! auditwheel -v show "$wheel"; then - echo "Skipping non-platform wheel $wheel" - else - auditwheel -v repair "$wheel" -w /wheelhouse/ - fi -} - -for PYBIN in /opt/python/cp*/bin; do - echo "================START $PYBIN================" - echo "================COMPILE================" - "${PYBIN}/pip" install -r /PyMEOS/pymeos_cffi/dev-requirements.txt - "${PYBIN}/pip" wheel /PyMEOS/pymeos_cffi/ --no-deps -w /wheelhouse_int/ - - echo "==============REPAIR==============" - for whl in wheelhouse_int/*.whl; do - repair_wheel "$whl" - rm "$whl" - done - echo "==============TEST==============" - "${PYBIN}/pip" install pymeos_cffi --pre -f /wheelhouse - "${PYBIN}/python" -c "from pymeos_cffi import meos_initialize, meos_finalize; meos_initialize('UTC'); meos_finalize()" - echo "==============FINISH $PYBIN=========" -done \ No newline at end of file diff --git a/pymeos_cffi/pymeos_cffi/__init__.py b/pymeos_cffi/pymeos_cffi/__init__.py deleted file mode 100644 index 847cff76..00000000 --- a/pymeos_cffi/pymeos_cffi/__init__.py +++ /dev/null @@ -1,2162 +0,0 @@ -from .functions import * -from .enums import * -from .errors import * - -__version__ = "1.1.1" -__all__ = [ - # Exceptions - "MeosException", - "MeosInternalError", - "MeosArgumentError", - "MeosIoError", - "MeosInternalTypeError", - "MeosValueOutOfRangeError", - "MeosDivisionByZeroError", - "MeosMemoryAllocError", - "MeosAggregationError", - "MeosDirectoryError", - "MeosFileError", - "MeosInvalidArgError", - "MeosInvalidArgTypeError", - "MeosInvalidArgValueError", - "MeosMfJsonInputError", - "MeosMfJsonOutputError", - "MeosTextInputError", - "MeosTextOutputError", - "MeosWkbInputError", - "MeosWkbOutputError", - "MeosGeoJsonInputError", - "MeosGeoJsonOutputError", - # Enums - "MeosType", - "MeosTemporalSubtype", - "MeosOperation", - "InterpolationType", - "SpatialRelation", - # Functions - "py_error_handler", - "create_pointer", - "get_address", - "datetime_to_timestamptz", - "timestamptz_to_datetime", - "date_to_date_adt", - "date_adt_to_date", - "timedelta_to_interval", - "interval_to_timedelta", - "geo_to_gserialized", - "geometry_to_gserialized", - "geography_to_gserialized", - "gserialized_to_shapely_point", - "gserialized_to_shapely_geometry", - "as_tinstant", - "as_tsequence", - "as_tsequenceset", - "geo_get_srid", - "meos_errno", - "meos_errno_set", - "meos_errno_restore", - "meos_errno_reset", - "meos_set_datestyle", - "meos_set_intervalstyle", - "meos_get_datestyle", - "meos_get_intervalstyle", - "meos_initialize", - "meos_finalize", - "add_date_int", - "add_interval_interval", - "add_timestamptz_interval", - "bool_in", - "bool_out", - "cstring2text", - "date_to_timestamptz", - "minus_date_date", - "minus_date_int", - "minus_timestamptz_interval", - "minus_timestamptz_timestamptz", - "mult_interval_double", - "pg_date_in", - "pg_date_out", - "pg_interval_cmp", - "pg_interval_in", - "pg_interval_make", - "pg_interval_out", - "pg_time_in", - "pg_time_out", - "pg_timestamp_in", - "pg_timestamp_out", - "pg_timestamptz_in", - "pg_timestamptz_out", - "text2cstring", - "text_cmp", - "text_copy", - "text_initcap", - "text_lower", - "text_out", - "text_upper", - "textcat_text_text", - "timestamptz_to_date", - "geo_as_ewkb", - "geo_as_ewkt", - "geo_as_geojson", - "geo_as_hexewkb", - "geo_as_text", - "geo_from_ewkb", - "geo_from_geojson", - "geo_out", - "geo_same", - "geography_from_hexewkb", - "geography_from_text", - "geometry_from_hexewkb", - "geometry_from_text", - "pgis_geography_in", - "pgis_geometry_in", - "bigintset_in", - "bigintset_out", - "bigintspan_in", - "bigintspan_out", - "bigintspanset_in", - "bigintspanset_out", - "dateset_in", - "dateset_out", - "datespan_in", - "datespan_out", - "datespanset_in", - "datespanset_out", - "floatset_in", - "floatset_out", - "floatspan_in", - "floatspan_out", - "floatspanset_in", - "floatspanset_out", - "geogset_in", - "geomset_in", - "geoset_as_ewkt", - "geoset_as_text", - "geoset_out", - "intset_in", - "intset_out", - "intspan_in", - "intspan_out", - "intspanset_in", - "intspanset_out", - "set_as_hexwkb", - "set_as_wkb", - "set_from_hexwkb", - "set_from_wkb", - "span_as_hexwkb", - "span_as_wkb", - "span_from_hexwkb", - "span_from_wkb", - "spanset_as_hexwkb", - "spanset_as_wkb", - "spanset_from_hexwkb", - "spanset_from_wkb", - "textset_in", - "textset_out", - "tstzset_in", - "tstzset_out", - "tstzspan_in", - "tstzspan_out", - "tstzspanset_in", - "tstzspanset_out", - "bigintset_make", - "bigintspan_make", - "dateset_make", - "datespan_make", - "floatset_make", - "floatspan_make", - "geoset_make", - "intset_make", - "intspan_make", - "set_copy", - "span_copy", - "spanset_copy", - "spanset_make", - "textset_make", - "tstzset_make", - "tstzspan_make", - "bigint_to_set", - "bigint_to_span", - "bigint_to_spanset", - "date_to_set", - "date_to_span", - "date_to_spanset", - "dateset_to_tstzset", - "datespan_to_tstzspan", - "datespanset_to_tstzspanset", - "float_to_set", - "float_to_span", - "float_to_spanset", - "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_spanset", - "span_to_spanset", - "text_to_set", - "timestamptz_to_set", - "timestamptz_to_span", - "timestamptz_to_spanset", - "tstzset_to_dateset", - "tstzspan_to_datespan", - "tstzspanset_to_datespanset", - "bigintset_end_value", - "bigintset_start_value", - "bigintset_value_n", - "bigintset_values", - "bigintspan_lower", - "bigintspan_upper", - "bigintspan_width", - "bigintspanset_lower", - "bigintspanset_upper", - "bigintspanset_width", - "dateset_end_value", - "dateset_start_value", - "dateset_value_n", - "dateset_values", - "datespan_duration", - "datespan_lower", - "datespan_upper", - "datespanset_date_n", - "datespanset_dates", - "datespanset_duration", - "datespanset_end_date", - "datespanset_num_dates", - "datespanset_start_date", - "floatset_end_value", - "floatset_start_value", - "floatset_value_n", - "floatset_values", - "floatspan_lower", - "floatspan_upper", - "floatspan_width", - "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", - "intset_values", - "intspan_lower", - "intspan_upper", - "intspan_width", - "intspanset_lower", - "intspanset_upper", - "intspanset_width", - "set_hash", - "set_hash_extended", - "set_num_values", - "set_to_span", - "span_hash", - "span_hash_extended", - "span_lower_inc", - "span_upper_inc", - "spanset_end_span", - "spanset_hash", - "spanset_hash_extended", - "spanset_lower_inc", - "spanset_num_spans", - "spanset_span", - "spanset_span_n", - "spanset_spans", - "spanset_start_span", - "spanset_upper_inc", - "textset_end_value", - "textset_start_value", - "textset_value_n", - "textset_values", - "tstzset_end_value", - "tstzset_start_value", - "tstzset_value_n", - "tstzset_values", - "tstzspan_duration", - "tstzspan_lower", - "tstzspan_upper", - "tstzspanset_duration", - "tstzspanset_end_timestamptz", - "tstzspanset_lower", - "tstzspanset_num_timestamps", - "tstzspanset_start_timestamptz", - "tstzspanset_timestamptz_n", - "tstzspanset_timestamps", - "tstzspanset_upper", - "bigintset_shift_scale", - "bigintspan_shift_scale", - "bigintspanset_shift_scale", - "dateset_shift_scale", - "datespan_shift_scale", - "datespanset_shift_scale", - "floatset_degrees", - "floatset_radians", - "floatset_round", - "floatset_shift_scale", - "floatspan_round", - "floatspan_shift_scale", - "floatspanset_round", - "floatspanset_shift_scale", - "geoset_round", - "geoset_set_srid", - "geoset_transform", - "geoset_transform_pipeline", - "point_transform", - "point_transform_pipeline", - "intset_shift_scale", - "intspan_shift_scale", - "intspanset_shift_scale", - "textset_initcap", - "textset_lower", - "textset_upper", - "textcat_textset_text", - "textcat_text_textset", - "timestamptz_tprecision", - "tstzset_shift_scale", - "tstzset_tprecision", - "tstzspan_shift_scale", - "tstzspan_tprecision", - "tstzspanset_shift_scale", - "tstzspanset_tprecision", - "set_cmp", - "set_eq", - "set_ge", - "set_gt", - "set_le", - "set_lt", - "set_ne", - "span_cmp", - "span_eq", - "span_ge", - "span_gt", - "span_le", - "span_lt", - "span_ne", - "spanset_cmp", - "spanset_eq", - "spanset_ge", - "spanset_gt", - "spanset_le", - "spanset_lt", - "spanset_ne", - "adjacent_span_bigint", - "adjacent_span_date", - "adjacent_span_float", - "adjacent_span_int", - "adjacent_span_span", - "adjacent_span_spanset", - "adjacent_span_timestamptz", - "adjacent_spanset_bigint", - "adjacent_spanset_date", - "adjacent_spanset_float", - "adjacent_spanset_int", - "adjacent_spanset_timestamptz", - "adjacent_spanset_span", - "adjacent_spanset_spanset", - "contained_bigint_set", - "contained_bigint_span", - "contained_bigint_spanset", - "contained_date_set", - "contained_date_span", - "contained_date_spanset", - "contained_float_set", - "contained_float_span", - "contained_float_spanset", - "contained_geo_set", - "contained_int_set", - "contained_int_span", - "contained_int_spanset", - "contained_set_set", - "contained_span_span", - "contained_span_spanset", - "contained_spanset_span", - "contained_spanset_spanset", - "contained_text_set", - "contained_timestamptz_set", - "contained_timestamptz_span", - "contained_timestamptz_spanset", - "contains_set_bigint", - "contains_set_date", - "contains_set_float", - "contains_set_geo", - "contains_set_int", - "contains_set_set", - "contains_set_text", - "contains_set_timestamptz", - "contains_span_bigint", - "contains_span_date", - "contains_span_float", - "contains_span_int", - "contains_span_span", - "contains_span_spanset", - "contains_span_timestamptz", - "contains_spanset_bigint", - "contains_spanset_date", - "contains_spanset_float", - "contains_spanset_int", - "contains_spanset_span", - "contains_spanset_spanset", - "contains_spanset_timestamptz", - "overlaps_set_set", - "overlaps_span_span", - "overlaps_span_spanset", - "overlaps_spanset_span", - "overlaps_spanset_spanset", - "after_date_set", - "after_date_span", - "after_date_spanset", - "after_set_date", - "after_set_timestamptz", - "after_span_date", - "after_span_timestamptz", - "after_spanset_date", - "after_spanset_timestamptz", - "after_timestamptz_set", - "after_timestamptz_span", - "after_timestamptz_spanset", - "before_date_set", - "before_date_span", - "before_date_spanset", - "before_set_date", - "before_set_timestamptz", - "before_span_date", - "before_span_timestamptz", - "before_spanset_date", - "before_spanset_timestamptz", - "before_timestamptz_set", - "before_timestamptz_span", - "before_timestamptz_spanset", - "left_bigint_set", - "left_bigint_span", - "left_bigint_spanset", - "left_float_set", - "left_float_span", - "left_float_spanset", - "left_int_set", - "left_int_span", - "left_int_spanset", - "left_set_bigint", - "left_set_float", - "left_set_int", - "left_set_set", - "left_set_text", - "left_span_bigint", - "left_span_float", - "left_span_int", - "left_span_span", - "left_span_spanset", - "left_spanset_bigint", - "left_spanset_float", - "left_spanset_int", - "left_spanset_span", - "left_spanset_spanset", - "left_text_set", - "overafter_date_set", - "overafter_date_span", - "overafter_date_spanset", - "overafter_set_date", - "overafter_set_timestamptz", - "overafter_span_date", - "overafter_span_timestamptz", - "overafter_spanset_date", - "overafter_spanset_timestamptz", - "overafter_timestamptz_set", - "overafter_timestamptz_span", - "overafter_timestamptz_spanset", - "overbefore_date_set", - "overbefore_date_span", - "overbefore_date_spanset", - "overbefore_set_date", - "overbefore_set_timestamptz", - "overbefore_span_date", - "overbefore_span_timestamptz", - "overbefore_spanset_date", - "overbefore_spanset_timestamptz", - "overbefore_timestamptz_set", - "overbefore_timestamptz_span", - "overbefore_timestamptz_spanset", - "overleft_bigint_set", - "overleft_bigint_span", - "overleft_bigint_spanset", - "overleft_float_set", - "overleft_float_span", - "overleft_float_spanset", - "overleft_int_set", - "overleft_int_span", - "overleft_int_spanset", - "overleft_set_bigint", - "overleft_set_float", - "overleft_set_int", - "overleft_set_set", - "overleft_set_text", - "overleft_span_bigint", - "overleft_span_float", - "overleft_span_int", - "overleft_span_span", - "overleft_span_spanset", - "overleft_spanset_bigint", - "overleft_spanset_float", - "overleft_spanset_int", - "overleft_spanset_span", - "overleft_spanset_spanset", - "overleft_text_set", - "overright_bigint_set", - "overright_bigint_span", - "overright_bigint_spanset", - "overright_float_set", - "overright_float_span", - "overright_float_spanset", - "overright_int_set", - "overright_int_span", - "overright_int_spanset", - "overright_set_bigint", - "overright_set_float", - "overright_set_int", - "overright_set_set", - "overright_set_text", - "overright_span_bigint", - "overright_span_float", - "overright_span_int", - "overright_span_span", - "overright_span_spanset", - "overright_spanset_bigint", - "overright_spanset_float", - "overright_spanset_int", - "overright_spanset_span", - "overright_spanset_spanset", - "overright_text_set", - "right_bigint_set", - "right_bigint_span", - "right_bigint_spanset", - "right_float_set", - "right_float_span", - "right_float_spanset", - "right_int_set", - "right_int_span", - "right_int_spanset", - "right_set_bigint", - "right_set_float", - "right_set_int", - "right_set_set", - "right_set_text", - "right_span_bigint", - "right_span_float", - "right_span_int", - "right_span_span", - "right_span_spanset", - "right_spanset_bigint", - "right_spanset_float", - "right_spanset_int", - "right_spanset_span", - "right_spanset_spanset", - "right_text_set", - "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", - "intersection_set_timestamptz", - "intersection_span_bigint", - "intersection_span_date", - "intersection_span_float", - "intersection_span_int", - "intersection_span_span", - "intersection_span_spanset", - "intersection_span_timestamptz", - "intersection_spanset_bigint", - "intersection_spanset_date", - "intersection_spanset_float", - "intersection_spanset_int", - "intersection_spanset_span", - "intersection_spanset_spanset", - "intersection_spanset_timestamptz", - "intersection_text_set", - "intersection_timestamptz_set", - "minus_bigint_set", - "minus_bigint_span", - "minus_bigint_spanset", - "minus_date_set", - "minus_date_span", - "minus_date_spanset", - "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", - "minus_set_timestamptz", - "minus_span_bigint", - "minus_span_date", - "minus_span_float", - "minus_span_int", - "minus_span_span", - "minus_span_spanset", - "minus_span_timestamptz", - "minus_spanset_bigint", - "minus_spanset_date", - "minus_spanset_float", - "minus_spanset_int", - "minus_spanset_span", - "minus_spanset_spanset", - "minus_spanset_timestamptz", - "minus_text_set", - "minus_timestamptz_set", - "minus_timestamptz_span", - "minus_timestamptz_spanset", - "union_bigint_set", - "union_bigint_span", - "union_bigint_spanset", - "union_date_set", - "union_date_span", - "union_date_spanset", - "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", - "union_set_timestamptz", - "union_span_bigint", - "union_span_date", - "union_span_float", - "union_span_int", - "union_span_span", - "union_span_spanset", - "union_span_timestamptz", - "union_spanset_bigint", - "union_spanset_date", - "union_spanset_float", - "union_spanset_int", - "union_spanset_span", - "union_spanset_spanset", - "union_spanset_timestamptz", - "union_text_set", - "union_timestamptz_set", - "union_timestamptz_span", - "union_timestamptz_spanset", - "distance_bigintset_bigintset", - "distance_bigintspan_bigintspan", - "distance_bigintspanset_bigintspan", - "distance_bigintspanset_bigintspanset", - "distance_dateset_dateset", - "distance_datespan_datespan", - "distance_datespanset_datespan", - "distance_datespanset_datespanset", - "distance_floatset_floatset", - "distance_floatspan_floatspan", - "distance_floatspanset_floatspan", - "distance_floatspanset_floatspanset", - "distance_intset_intset", - "distance_intspan_intspan", - "distance_intspanset_intspan", - "distance_intspanset_intspanset", - "distance_set_bigint", - "distance_set_date", - "distance_set_float", - "distance_set_int", - "distance_set_timestamptz", - "distance_span_bigint", - "distance_span_date", - "distance_span_float", - "distance_span_int", - "distance_span_timestamptz", - "distance_spanset_bigint", - "distance_spanset_date", - "distance_spanset_float", - "distance_spanset_int", - "distance_spanset_timestamptz", - "distance_tstzset_tstzset", - "distance_tstzspan_tstzspan", - "distance_tstzspanset_tstzspan", - "distance_tstzspanset_tstzspanset", - "bigint_extent_transfn", - "bigint_union_transfn", - "date_extent_transfn", - "date_union_transfn", - "float_extent_transfn", - "float_union_transfn", - "int_extent_transfn", - "int_union_transfn", - "set_extent_transfn", - "set_union_finalfn", - "set_union_transfn", - "span_extent_transfn", - "span_union_transfn", - "spanset_extent_transfn", - "spanset_union_finalfn", - "spanset_union_transfn", - "text_union_transfn", - "timestamptz_extent_transfn", - "timestamptz_union_transfn", - "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", - "int_timestamptz_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_hast", - "stbox_hasx", - "stbox_hasz", - "stbox_isgeodetic", - "stbox_srid", - "stbox_tmax", - "stbox_tmax_inc", - "stbox_tmin", - "stbox_tmin_inc", - "stbox_xmax", - "stbox_xmin", - "stbox_ymax", - "stbox_ymin", - "stbox_zmax", - "stbox_zmin", - "tbox_hast", - "tbox_hasx", - "tbox_tmax", - "tbox_tmax_inc", - "tbox_tmin", - "tbox_tmin_inc", - "tbox_xmax", - "tbox_xmax_inc", - "tbox_xmin", - "tbox_xmin_inc", - "tboxfloat_xmax", - "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", - "tbox_expand_time", - "tbox_expand_float", - "tbox_expand_int", - "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", - "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", - "left_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", - "tbox_cmp", - "tbox_lt", - "tbox_le", - "tbox_ge", - "tbox_gt", - "stbox_eq", - "stbox_ne", - "stbox_cmp", - "stbox_lt", - "stbox_le", - "stbox_ge", - "stbox_gt", - "tbool_in", - "tint_in", - "tfloat_in", - "ttext_in", - "tgeompoint_in", - "tgeogpoint_in", - "tbool_from_mfjson", - "tint_from_mfjson", - "tfloat_from_mfjson", - "ttext_from_mfjson", - "tgeompoint_from_mfjson", - "tgeogpoint_from_mfjson", - "temporal_from_wkb", - "temporal_from_hexwkb", - "tbool_out", - "tint_out", - "tfloat_out", - "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", - "tboolseq_from_base_tstzspan", - "tboolseqset_from_base_tstzspanset", - "temporal_copy", - "tfloat_from_base_temp", - "tfloatinst_make", - "tfloatseq_from_base_tstzspan", - "tfloatseq_from_base_tstzset", - "tfloatseqset_from_base_tstzspanset", - "tint_from_base_temp", - "tintinst_make", - "tintseq_from_base_tstzspan", - "tintseq_from_base_tstzset", - "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", - "ttextseqset_from_base_tstzspanset", - "temporal_to_tstzspan", - "tfloat_to_tint", - "tint_to_tfloat", - "tnumber_to_span", - "tbool_end_value", - "tbool_start_value", - "tbool_value_at_timestamptz", - "tbool_values", - "temporal_duration", - "temporal_end_instant", - "temporal_end_sequence", - "temporal_end_timestamptz", - "temporal_hash", - "temporal_instant_n", - "temporal_instants", - "temporal_interp", - "temporal_max_instant", - "temporal_min_instant", - "temporal_num_instants", - "temporal_num_sequences", - "temporal_num_timestamps", - "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", - "tfloat_end_value", - "tfloat_max_value", - "tfloat_min_value", - "tfloat_start_value", - "tfloat_value_at_timestamptz", - "tfloat_values", - "tint_end_value", - "tint_max_value", - "tint_min_value", - "tint_start_value", - "tint_value_at_timestamptz", - "tint_values", - "tnumber_integral", - "tnumber_twavg", - "tnumber_valuespans", - "tpoint_end_value", - "tpoint_start_value", - "tpoint_value_at_timestamptz", - "tpoint_values", - "ttext_end_value", - "ttext_max_value", - "ttext_min_value", - "ttext_start_value", - "ttext_value_at_timestamptz", - "ttext_values", - "float_degrees", - "temporal_scale_time", - "temporal_set_interp", - "temporal_shift_scale_time", - "temporal_shift_time", - "temporal_to_tinstant", - "temporal_to_tsequence", - "temporal_to_tsequenceset", - "tfloat_degrees", - "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_insert", - "temporal_merge", - "temporal_merge_array", - "temporal_update", - "tbool_at_value", - "tbool_minus_value", - "temporal_at_max", - "temporal_at_min", - "temporal_at_tstzspan", - "temporal_at_tstzspanset", - "temporal_at_timestamptz", - "temporal_at_tstzset", - "temporal_at_values", - "temporal_minus_max", - "temporal_minus_min", - "temporal_minus_tstzspan", - "temporal_minus_tstzspanset", - "temporal_minus_timestamptz", - "temporal_minus_tstzset", - "temporal_minus_values", - "tfloat_at_value", - "tfloat_minus_value", - "tint_at_value", - "tint_minus_value", - "tnumber_at_span", - "tnumber_at_spanset", - "tnumber_at_tbox", - "tnumber_minus_span", - "tnumber_minus_spanset", - "tnumber_minus_tbox", - "tpoint_at_geom_time", - "tpoint_at_stbox", - "tpoint_at_value", - "tpoint_minus_geom_time", - "tpoint_minus_stbox", - "tpoint_minus_value", - "ttext_at_value", - "ttext_minus_value", - "temporal_cmp", - "temporal_eq", - "temporal_ge", - "temporal_gt", - "temporal_le", - "temporal_lt", - "temporal_ne", - "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", - "always_ge_text_ttext", - "always_ge_tfloat_float", - "always_ge_tint_int", - "always_ge_ttext_text", - "always_gt_float_tfloat", - "always_gt_int_tint", - "always_gt_temporal_temporal", - "always_gt_text_ttext", - "always_gt_tfloat_float", - "always_gt_tint_int", - "always_gt_ttext_text", - "always_le_float_tfloat", - "always_le_int_tint", - "always_le_temporal_temporal", - "always_le_text_ttext", - "always_le_tfloat_float", - "always_le_tint_int", - "always_le_ttext_text", - "always_lt_float_tfloat", - "always_lt_int_tint", - "always_lt_temporal_temporal", - "always_lt_text_ttext", - "always_lt_tfloat_float", - "always_lt_tint_int", - "always_lt_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", - "ever_ge_temporal_temporal", - "ever_ge_text_ttext", - "ever_ge_tfloat_float", - "ever_ge_tint_int", - "ever_ge_ttext_text", - "ever_gt_float_tfloat", - "ever_gt_int_tint", - "ever_gt_temporal_temporal", - "ever_gt_text_ttext", - "ever_gt_tfloat_float", - "ever_gt_tint_int", - "ever_gt_ttext_text", - "ever_le_float_tfloat", - "ever_le_int_tint", - "ever_le_temporal_temporal", - "ever_le_text_ttext", - "ever_le_tfloat_float", - "ever_le_tint_int", - "ever_le_ttext_text", - "ever_lt_float_tfloat", - "ever_lt_int_tint", - "ever_lt_temporal_temporal", - "ever_lt_text_ttext", - "ever_lt_tfloat_float", - "ever_lt_tint_int", - "ever_lt_ttext_text", - "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", - "tge_int_tint", - "tge_temporal_temporal", - "tge_text_ttext", - "tge_tfloat_float", - "tge_tint_int", - "tge_ttext_text", - "tgt_float_tfloat", - "tgt_int_tint", - "tgt_temporal_temporal", - "tgt_text_ttext", - "tgt_tfloat_float", - "tgt_tint_int", - "tgt_ttext_text", - "tle_float_tfloat", - "tle_int_tint", - "tle_temporal_temporal", - "tle_text_ttext", - "tle_tfloat_float", - "tle_tint_int", - "tle_ttext_text", - "tlt_float_tfloat", - "tlt_int_tint", - "tlt_temporal_temporal", - "tlt_text_ttext", - "tlt_tfloat_float", - "tlt_tint_int", - "tlt_ttext_text", - "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", - "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", - "tbool_when_true", - "tnot_tbool", - "tor_bool_tbool", - "tor_tbool_bool", - "tor_tbool_tbool", - "add_float_tfloat", - "add_int_tint", - "add_tfloat_float", - "add_tint_int", - "add_tnumber_tnumber", - "div_float_tfloat", - "div_int_tint", - "div_tfloat_float", - "div_tint_int", - "div_tnumber_tnumber", - "mult_float_tfloat", - "mult_int_tint", - "mult_tfloat_float", - "mult_tint_int", - "mult_tnumber_tnumber", - "sub_float_tfloat", - "sub_int_tint", - "sub_tfloat_float", - "sub_tint_int", - "sub_tnumber_tnumber", - "tfloat_derivative", - "tnumber_abs", - "tnumber_angular_difference", - "tnumber_delta_value", - "textcat_text_ttext", - "textcat_ttext_text", - "textcat_ttext_ttext", - "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", - "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", - "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_stboxes", - "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", - "tbool_tand_transfn", - "tbool_tor_transfn", - "temporal_extent_transfn", - "temporal_tagg_finalfn", - "temporal_tcount_transfn", - "tfloat_tmax_transfn", - "tfloat_tmin_transfn", - "tfloat_tsum_transfn", - "tfloat_wmax_transfn", - "tfloat_wmin_transfn", - "tfloat_wsum_transfn", - "timestamptz_tcount_transfn", - "tint_tmax_transfn", - "tint_tmin_transfn", - "tint_tsum_transfn", - "tint_wmax_transfn", - "tint_wmin_transfn", - "tint_wsum_transfn", - "tnumber_extent_transfn", - "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", - "ttext_tmax_transfn", - "ttext_tmin_transfn", - "temporal_simplify_dp", - "temporal_simplify_max_dist", - "temporal_simplify_min_dist", - "temporal_simplify_min_tdelta", - "temporal_tprecision", - "temporal_tsample", - "temporal_dyntimewarp_distance", - "temporal_dyntimewarp_path", - "temporal_frechet_distance", - "temporal_frechet_path", - "temporal_hausdorff_distance", - "float_bucket", - "floatspan_bucket_list", - "int_bucket", - "intspan_bucket_list", - "stbox_tile", - "stbox_tile_list", - "temporal_time_split", - "tfloat_value_split", - "tfloat_value_time_split", - "tfloatbox_tile", - "tfloatbox_tile_list", - "timestamptz_bucket", - "tint_value_split", - "tint_value_time_split", - "tintbox_tile", - "tintbox_tile_list", - "tpoint_space_split", - "tpoint_space_time_split", - "tstzspan_bucket_list", - "temptype_subtype", - "temptype_subtype_all", - "tempsubtype_name", - "tempsubtype_from_string", - "meosoper_name", - "meosoper_from_string", - "interptype_name", - "interptype_from_string", - "meostype_name", - "temptype_basetype", - "settype_basetype", - "spantype_basetype", - "spantype_spansettype", - "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", - "geoset_type", - "ensure_geoset_type", - "spatialset_type", - "ensure_spatialset_type", - "span_basetype", - "span_canon_basetype", - "span_type", - "span_bbox_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", - "tnumber_basetype", - "ensure_tnumber_basetype", - "tnumber_settype", - "tnumber_spantype", - "tnumber_spansettype", - "tspatial_type", - "ensure_tspatial_type", - "tspatial_basetype", - "tgeo_type", - "ensure_tgeo_type", - "ensure_tnumber_tgeo_type", - "datum_degrees", - "datum_radians", - "datum_hash", - "datum_hash_extended", - "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", - "numspan_width", - "numspanset_width", - "set_end_value", - "set_mem_size", - "set_set_span", - "set_span", - "set_start_value", - "set_value_n", - "set_vals", - "set_values", - "spanset_lower", - "spanset_mem_size", - "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", - "numspan_shift_scale", - "numspanset_shift_scale", - "set_compact", - "span_expand", - "spanset_compact", - "textcat_textset_text_int", - "tstzspan_set_datespan", - "set_cmp_int", - "set_eq_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", - "contains_set_value", - "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", - "overleft_spanset_value", - "overleft_value_set", - "overleft_value_span", - "overleft_value_spanset", - "overright_set_value", - "overright_span_value", - "overright_spanset_value", - "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", - "right_value_spanset", - "right_span_value", - "right_spanset_value", - "bbox_union_span_span", - "inter_span_span", - "intersection_set_value", - "intersection_span_value", - "intersection_spanset_value", - "intersection_value_set", - "intersection_value_span", - "intersection_value_spanset", - "mi_span_span", - "minus_set_value", - "minus_span_value", - "minus_spanset_value", - "minus_value_set", - "minus_value_span", - "minus_value_spanset", - "super_union_span_span", - "union_set_value", - "union_span_value", - "union_spanset_value", - "union_value_set", - "union_value_span", - "union_value_spanset", - "dist_set_set", - "dist_span_span", - "distance_set_set", - "distance_set_value", - "distance_span_span", - "distance_span_value", - "distance_spanset_span", - "distance_spanset_spanset", - "distance_spanset_value", - "distance_value_value", - "spanbase_extent_transfn", - "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_to_stbox", - "geo_set_stbox", - "geoarr_set_stbox", - "int_set_tbox", - "number_set_tbox", - "number_to_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_as_mfjson", - "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_as_mfjson", - "tsequence_from_mfjson", - "tsequence_in", - "tsequence_out", - "tsequenceset_as_mfjson", - "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_tstzset", - "tsequence_from_base_tstzspan", - "tsequence_make_exp", - "tsequence_make_free", - "tsequenceset_copy", - "tseqsetarr_to_tseqset", - "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_value", - "temporal_insts", - "temporal_max_value", - "temporal_mem_size", - "temporal_min_value", - "temporal_seqs", - "temporal_set_bbox", - "temporal_set_tstzspan", - "temporal_seqs", - "temporal_vals", - "temporal_values", - "tinstant_hash", - "tinstant_insts", - "tinstant_set_bbox", - "tinstant_time", - "tinstant_timestamps", - "tinstant_val", - "tinstant_value", - "tinstant_value_at_timestamptz", - "tinstant_vals", - "tnumber_set_span", - "tnumberinst_valuespans", - "tnumberseq_valuespans", - "tnumberseqset_valuespans", - "tsequence_duration", - "tsequence_end_timestamptz", - "tsequence_hash", - "tsequence_insts", - "tsequence_max_inst", - "tsequence_max_val", - "tsequence_min_inst", - "tsequence_min_val", - "tsequence_segments", - "tsequence_seqs", - "tsequence_set_bbox", - "tsequence_expand_bbox", - "tsequence_start_timestamptz", - "tsequence_time", - "tsequence_timestamps", - "tsequence_value_at_timestamptz", - "tsequence_vals", - "tsequenceset_duration", - "tsequenceset_end_timestamptz", - "tsequenceset_hash", - "tsequenceset_inst_n", - "tsequenceset_insts", - "tsequenceset_max_inst", - "tsequenceset_max_val", - "tsequenceset_min_inst", - "tsequenceset_min_val", - "tsequenceset_num_instants", - "tsequenceset_num_timestamps", - "tsequenceset_segments", - "tsequenceset_seqs", - "tsequenceset_set_bbox", - "tsequenceset_start_timestamptz", - "tsequenceset_time", - "tsequenceset_timespan", - "tsequenceset_timestamptz_n", - "tsequenceset_timestamps", - "tsequenceset_value_at_timestamptz", - "tsequenceset_vals", - "temporal_compact", - "temporal_restart", - "temporal_tsequence", - "temporal_tsequenceset", - "tinstant_shift_time", - "tinstant_to_tsequence", - "tinstant_to_tsequence_free", - "tinstant_to_tsequenceset", - "tnumber_shift_scale_value", - "tnumberinst_shift_value", - "tnumberseq_shift_scale_value", - "tnumberseqset_shift_scale_value", - "tsequence_compact", - "tsequence_restart", - "tsequence_set_interp", - "tsequence_shift_scale_time", - "tsequence_subseq", - "tsequence_to_tinstant", - "tsequence_to_tsequenceset", - "tsequence_to_tsequenceset_free", - "tsequence_to_tsequenceset_interp", - "tsequenceset_compact", - "tsequenceset_restart", - "tsequenceset_set_interp", - "tsequenceset_shift_scale_time", - "tsequenceset_to_discrete", - "tsequenceset_to_linear", - "tsequenceset_to_step", - "tsequenceset_to_tinstant", - "tsequenceset_to_tsequence", - "tinstant_merge", - "tinstant_merge_array", - "tsequence_append_tinstant", - "tsequence_append_tsequence", - "tsequence_delete_timestamptz", - "tsequence_delete_tstzset", - "tsequence_delete_tstzspan", - "tsequence_delete_tstzspanset", - "tsequence_insert", - "tsequence_merge", - "tsequence_merge_array", - "tsequenceset_append_tinstant", - "tsequenceset_append_tsequence", - "tsequenceset_delete_timestamptz", - "tsequenceset_delete_tstzset", - "tsequenceset_delete_tstzspan", - "tsequenceset_delete_tstzspanset", - "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", - "tsequenceset_set_bbox", - "tdiscseq_restrict_minmax", - "tcontseq_restrict_minmax", - "temporal_bbox_restrict_set", - "temporal_restrict_minmax", - "temporal_restrict_timestamptz", - "temporal_restrict_tstzset", - "temporal_restrict_tstzspan", - "temporal_restrict_tstzspanset", - "temporal_restrict_value", - "temporal_restrict_values", - "temporal_value_at_timestamptz", - "tinstant_restrict_tstzspan", - "tinstant_restrict_tstzspanset", - "tinstant_restrict_timestamptz", - "tinstant_restrict_tstzset", - "tinstant_restrict_value", - "tinstant_restrict_values", - "tnumber_restrict_span", - "tnumber_restrict_spanset", - "tnumberinst_restrict_span", - "tnumberinst_restrict_spanset", - "tnumberseqset_restrict_span", - "tnumberseqset_restrict_spanset", - "tpoint_restrict_geom_time", - "tpoint_restrict_stbox", - "tpointinst_restrict_geom_time", - "tpointinst_restrict_stbox", - "tpointseq_restrict_geom_time", - "tpointseq_restrict_stbox", - "tpointseqset_restrict_geom_time", - "tpointseqset_restrict_stbox", - "tsequence_at_timestamptz", - "tsequence_restrict_tstzspan", - "tsequence_restrict_tstzspanset", - "tsequenceset_restrict_minmax", - "tsequenceset_restrict_tstzspan", - "tsequenceset_restrict_tstzspanset", - "tsequenceset_restrict_timestamptz", - "tsequenceset_restrict_tstzset", - "tsequenceset_restrict_value", - "tsequenceset_restrict_values", - "tinstant_cmp", - "tinstant_eq", - "tsequence_cmp", - "tsequence_eq", - "tsequenceset_cmp", - "tsequenceset_eq", - "always_eq_base_temporal", - "always_eq_temporal_base", - "always_eq_tinstant_base", - "always_eq_tpointinst_base", - "always_eq_tpointseq_base", - "always_eq_tpointseqset_base", - "always_eq_tsequence_base", - "always_eq_tsequenceset_base", - "always_ne_base_temporal", - "always_ne_temporal_base", - "always_ne_tinstant_base", - "always_ne_tpointinst_base", - "always_ne_tpointseq_base", - "always_ne_tpointseqset_base", - "always_ne_tsequence_base", - "always_ne_tsequenceset_base", - "always_ge_base_temporal", - "always_ge_temporal_base", - "always_ge_tinstant_base", - "always_ge_tsequence_base", - "always_ge_tsequenceset_base", - "always_gt_base_temporal", - "always_gt_temporal_base", - "always_gt_tinstant_base", - "always_gt_tsequence_base", - "always_gt_tsequenceset_base", - "always_le_base_temporal", - "always_le_temporal_base", - "always_le_tinstant_base", - "always_le_tsequence_base", - "always_le_tsequenceset_base", - "always_lt_base_temporal", - "always_lt_temporal_base", - "always_lt_tinstant_base", - "always_lt_tsequence_base", - "always_lt_tsequenceset_base", - "ever_eq_base_temporal", - "ever_eq_temporal_base", - "ever_eq_tinstant_base", - "ever_eq_tpointinst_base", - "ever_eq_tpointseq_base", - "ever_eq_tpointseqset_base", - "ever_eq_tsequence_base", - "ever_eq_tsequenceset_base", - "ever_ne_base_temporal", - "ever_ne_temporal_base", - "ever_ne_tinstant_base", - "ever_ne_tpointinst_base", - "ever_ne_tpointseq_base", - "ever_ne_tpointseqset_base", - "ever_ne_tsequence_base", - "ever_ne_tsequenceset_base", - "ever_ge_base_temporal", - "ever_ge_temporal_base", - "ever_ge_tinstant_base", - "ever_ge_tsequence_base", - "ever_ge_tsequenceset_base", - "ever_gt_base_temporal", - "ever_gt_temporal_base", - "ever_gt_tinstant_base", - "ever_gt_tsequence_base", - "ever_gt_tsequenceset_base", - "ever_le_base_temporal", - "ever_le_temporal_base", - "ever_le_tinstant_base", - "ever_le_tsequence_base", - "ever_le_tsequenceset_base", - "ever_lt_base_temporal", - "ever_lt_temporal_base", - "tfloatseq_derivative", - "tfloatseqset_derivative", - "tnumberinst_abs", - "tnumberseq_abs", - "tnumberseq_angular_difference", - "tnumberseq_delta_value", - "tnumberseqset_abs", - "tnumberseqset_angular_difference", - "tnumberseqset_delta_value", - "distance_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", - "tpointseqset_azimuth", - "tpointseqset_cumulative_length", - "tpointseqset_is_simple", - "tpointseqset_length", - "tpointseqset_speed", - "tpointseqset_srid", - "tpointseqset_stboxes", - "tpointseqset_trajectory", - "tpoint_get_coord", - "tgeompointinst_tgeogpointinst", - "tgeompointseq_tgeogpointseq", - "tgeompointseqset_tgeogpointseqset", - "tgeompoint_tgeogpoint", - "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", - "tnumber_value_split", - "tbox_tile", -] diff --git a/pymeos_cffi/pymeos_cffi/builder/__init__.py b/pymeos_cffi/pymeos_cffi/builder/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/pymeos_cffi/pymeos_cffi/builder/build_header.py b/pymeos_cffi/pymeos_cffi/builder/build_header.py deleted file mode 100644 index de092f11..00000000 --- a/pymeos_cffi/pymeos_cffi/builder/build_header.py +++ /dev/null @@ -1,113 +0,0 @@ -import os.path -import platform -import re -import subprocess -import sys -from typing import Set, Tuple - - -def get_defined_functions(library_path): - result = subprocess.check_output(["nm", "-g", library_path]) - output = result.decode("utf-8") - lines = output.splitlines() - defined = {line.split(" ")[-1] for line in lines if " T " in line} - return defined - - -def remove_undefined_functions(content, so_path): - defined = get_defined_functions(so_path) - undefined_types = ["json_object"] - - 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 - ): - for t in undefined_types: - if t in m.group(0): - print(f"Removing function due to undefined type {t}: {function}") - return f"/* {m.group(0)} (undefined type {t}) */" - return m.group(0) - else: - print(f"Removing undefined function: {function}") - return f"/* {m.group(0)} (undefined) */" - - content = re.sub( - r"^extern .*?;", remove_if_not_defined, content, flags=re.RegexFlag.MULTILINE - ) - return content - - -def remove_repeated_functions( - content: str, seen_functions: set -) -> Tuple[str, Set[str]]: - def remove_if_repeated(m): - function = m.group(0).replace("\n", "").strip() - if function in seen_functions: - print(f"Removing repeated function: {function}") - return f"/* {m.group(0)} (repeated) */" - else: - seen_functions.add(function) - return m.group(0) - - content = re.sub( - r"^extern .*?;", remove_if_repeated, content, flags=re.RegexFlag.MULTILINE - ) - return content, seen_functions - - -def main(include_dir, so_path=None, destination_path="pymeos_cffi/builder/meos.h"): - files = ["meos.h", "meos_catalog.h", "meos_internal.h"] - global_content = "" - functions = set() - for file_name in files: - file_path = os.path.join(include_dir, file_name) - with open(file_path, "r") as f: - content = f.read() - # Remove comments - content = re.sub(r"//.*", "", content) - content = re.sub(r"/\*.*?\*/", "", content, flags=re.RegexFlag.DOTALL) - - # Remove macros that are not number constants - content = content.replace("#", "//#") - content = re.sub( - r"^//(#define +\w+ +\d+)\s*$", - r"\g<1>", - content, - flags=re.RegexFlag.MULTILINE, - ) - content = re.sub( - r"//#ifdef.*?//#endif", "", content, flags=re.RegexFlag.DOTALL - ) - content = content.replace("//#endif", "") - content = re.sub(r"//# *\w+ +([\w,()]+) *((?:\\\n|.)*?)\n", "", content) - - content = re.sub(r"\n\n\n+", "\n\n", content) - - # Remove functions that are not actually defined in the library - if so_path: - content = remove_undefined_functions(content, so_path) - - content, functions = remove_repeated_functions(content, functions) - - global_content += f"//-------------------- {file_name} --------------------\n" - global_content += content - - # Add error handler - global_content += '\n\nextern "Python" void py_error_handler(int, int, char*);' - - with open(destination_path, "w") as f: - f.write(global_content) - - -if __name__ == "__main__": - if len(sys.argv) > 1: - main(*sys.argv[1:]) - else: - if sys.platform == "linux": - main("/usr/local/include", "/usr/local/lib/libmeos.so") - elif sys.platform == "darwin": - if platform.processor() == "arm": - main("/opt/homebrew/include", "/opt/homebrew/lib/libmeos.dylib") - else: - main("/usr/local/include", "/usr/local/lib/libmeos.dylib") diff --git a/pymeos_cffi/pymeos_cffi/builder/build_pymeos.py b/pymeos_cffi/pymeos_cffi/builder/build_pymeos.py deleted file mode 100644 index 92a2bc35..00000000 --- a/pymeos_cffi/pymeos_cffi/builder/build_pymeos.py +++ /dev/null @@ -1,32 +0,0 @@ -import os - -from cffi import FFI - -ffibuilder = FFI() - -with open("./pymeos_cffi/builder/meos.h", "r") as f: - content = f.read() - -ffibuilder.cdef(content) - - -def get_library_dirs(): - paths = ["/usr/local/lib", "/opt/homebrew/lib"] - return [path for path in paths if os.path.exists(path)] - - -def get_include_dirs(): - paths = ["/usr/local/include", "/opt/homebrew/include"] - return [path for path in paths if os.path.exists(path)] - - -ffibuilder.set_source( - "_meos_cffi", - '#include "meos.h"\n' '#include "meos_catalog.h"\n' '#include "meos_internal.h"', - libraries=["meos"], - library_dirs=get_library_dirs(), - include_dirs=get_include_dirs(), -) - -if __name__ == "__main__": # not when running with setuptools - ffibuilder.compile(verbose=True) diff --git a/pymeos_cffi/pymeos_cffi/builder/build_pymeos_functions.py b/pymeos_cffi/pymeos_cffi/builder/build_pymeos_functions.py deleted file mode 100644 index 0915f0a9..00000000 --- a/pymeos_cffi/pymeos_cffi/builder/build_pymeos_functions.py +++ /dev/null @@ -1,547 +0,0 @@ -import os.path -import sys -from typing import List - -from build_pymeos_functions_modifiers import * -from objects import conversion_map, Conversion - - -class Parameter: - def __init__( - self, - name: str, - converted_name: str, - ctype: str, - ptype: str, - cp_conversion: Optional[str], - ) -> None: - super().__init__() - self.name = name - self.converted_name = converted_name - self.ctype = ctype - self.ptype = ptype - self.cp_conversion = cp_conversion - - def is_interoperable(self): - return any( - self.ctype.startswith(x) for x in ["int", "bool", "double", "TimestampTz"] - ) - - def get_ptype_without_pointers(self): - if self.is_interoperable(): - return self.ptype.replace(" *'", "'").replace("**", "*") - else: - return self.ptype - - def __str__(self) -> str: - return ( - f"{self.name=}, {self.converted_name=}, {self.ctype=}, {self.ptype=}, " - f"{self.cp_conversion=}" - ) - - -class ReturnType: - def __init__(self, ctype: str, ptype: str, conversion: Optional[str]) -> None: - super().__init__() - self.ctype = ctype - self.return_type = ptype - self.conversion = conversion - - -# List of functions defined in functions.py that shouldn't be exported - -hidden_functions = [ - "_check_error", -] - -# List of MEOS functions that should not be defined in functions.py -skipped_functions = [ - "py_error_handler", - "meos_initialize_timezone", - "meos_initialize_error_handler", - "meos_finalize_timezone", -] - -function_notes = {} - -function_modifiers = { - "meos_initialize": meos_initialize_modifier, - "meos_finalize": remove_error_check_modifier, - "cstring2text": cstring2text_modifier, - "text2cstring": text2cstring_modifier, - "spanset_make": spanset_make_modifier, - "temporal_from_wkb": from_wkb_modifier("temporal_from_wkb", "Temporal"), - "set_from_wkb": from_wkb_modifier("set_from_wkb", "Set"), - "span_from_wkb": from_wkb_modifier("span_from_wkb", "Span"), - "spanset_from_wkb": from_wkb_modifier("spanset_from_wkb", "SpanSet"), - "tbox_from_wkb": from_wkb_modifier("tbox_from_wkb", "TBOX"), - "stbox_from_wkb": from_wkb_modifier("stbox_from_wkb", "STBOX"), - "temporal_as_wkb": as_wkb_modifier, - "set_as_wkb": as_wkb_modifier, - "span_as_wkb": as_wkb_modifier, - "spanset_as_wkb": as_wkb_modifier, - "tbox_as_wkb": as_wkb_modifier, - "stbox_as_wkb": as_wkb_modifier, - "tstzset_make": tstzset_make_modifier, - "dateset_make": array_parameter_modifier("values", "count"), - "intset_make": array_parameter_modifier("values", "count"), - "bigintset_make": array_parameter_modifier("values", "count"), - "floatset_make": array_parameter_modifier("values", "count"), - "textset_make": textset_make_modifier, - "geoset_make": array_length_remover_modifier("values", "count"), -} - -# List of result function parameters in tuples of (function, parameter) -result_parameters = { - ("tbool_value_at_timestamptz", "value"), - ("ttext_value_at_timestamptz", "value"), - ("tint_value_at_timestamptz", "value"), - ("tfloat_value_at_timestamptz", "value"), - ("tpoint_value_at_timestamptz", "value"), -} - -# List of output function parameters in tuples of (function, parameter). -# All parameters named result are assumed to be output parameters, and it is -# not necessary to list them here. -output_parameters = { - ("temporal_time_split", "time_buckets"), - ("temporal_time_split", "count"), - ("tint_value_split", "value_buckets"), - ("tint_value_split", "count"), - ("tfloat_value_split", "value_buckets"), - ("tfloat_value_split", "count"), - ("tint_value_time_split", "value_buckets"), - ("tint_value_time_split", "time_buckets"), - ("tint_value_time_split", "count"), - ("tfloat_value_time_split", "value_buckets"), - ("tfloat_value_time_split", "time_buckets"), - ("tfloat_value_time_split", "count"), - ("tpoint_space_split", "space_buckets"), - ("tpoint_space_split", "count"), - ("tpoint_space_time_split", "space_buckets"), - ("tpoint_space_time_split", "time_buckets"), - ("tpoint_space_time_split", "count"), - ("tbox_as_hexwkb", "size"), - ("stbox_as_hexwkb", "size"), - ("tintbox_tile_list", "count"), - ("tfloatbox_tile_list", "count"), - ("stbox_tile_list", "cellcount"), -} - -# List of nullable function parameters in tuples of (function, parameter) -nullable_parameters = { - ("meos_initialize", "tz_str"), - ("meos_set_intervalstyle", "extra"), - ("temporal_append_tinstant", "maxt"), - ("temporal_as_mfjson", "srs"), - ("geo_as_geojson", "srs"), - ("tstzspan_shift_scale", "shift"), - ("tstzspan_shift_scale", "duration"), - ("tstzset_shift_scale", "shift"), - ("tstzset_shift_scale", "duration"), - ("tstzspanset_shift_scale", "shift"), - ("tstzspanset_shift_scale", "duration"), - ("temporal_shift_scale_time", "shift"), - ("temporal_shift_scale_time", "duration"), - ("tbox_make", "p"), - ("tbox_make", "s"), - ("stbox_make", "p"), - ("stbox_shift_scale_time", "shift"), - ("stbox_shift_scale_time", "duration"), - ("temporal_tcount_transfn", "state"), - ("temporal_extent_transfn", "p"), - ("tnumber_extent_transfn", "box"), - ("tpoint_extent_transfn", "box"), - ("tbool_tand_transfn", "state"), - ("tbool_tor_transfn", "state"), - ("tbox_shift_scale_time", "shift"), - ("tbox_shift_scale_time", "duration"), - ("tint_tmin_transfn", "state"), - ("tfloat_tmin_transfn", "state"), - ("tint_tmax_transfn", "state"), - ("tfloat_tmax_transfn", "state"), - ("tint_tsum_transfn", "state"), - ("tfloat_tsum_transfn", "state"), - ("tnumber_tavg_transfn", "state"), - ("ttext_tmin_transfn", "state"), - ("ttext_tmax_transfn", "state"), - ("temporal_tcount_transfn", "interval"), - ("timestamptz_tcount_transfn", "interval"), - ("tstzset_tcount_transfn", "interval"), - ("tstzspan_tcount_transfn", "interval"), - ("tstzspanset_tcount_transfn", "interval"), - ("timestamptz_extent_transfn", "p"), - ("timestamptz_tcount_transfn", "state"), - ("tstzset_tcount_transfn", "state"), - ("tstzspan_tcount_transfn", "state"), - ("tstzspanset_tcount_transfn", "state"), - ("stbox_tile_list", "duration"), - ("tintbox_tile_list", "xorigin"), - ("tintbox_tile_list", "torigin"), - ("tfloatbox_tile_list", "xorigin"), - ("tfloatbox_tile_list", "torigin"), - ("tpoint_at_geom_time", "zspan"), - ("tpoint_at_geom_time", "period"), - ("tpoint_minus_geom_time", "zspan"), - ("tpoint_minus_geom_time", "period"), - ("stbox_make", "s"), -} - - -# Checks if parameter in function is nullable -def is_nullable_parameter(function: str, parameter: str) -> bool: - return (function, parameter) in nullable_parameters - - -# Checks if parameter in function is actually a result parameter -def is_result_parameter(function: str, parameter: Parameter) -> bool: - if parameter.name == "result": - return True - return (function, parameter.name) in result_parameters - - -# Checks if parameter in function is actually an output parameter -def is_output_parameter(function: str, parameter: Parameter) -> bool: - if parameter.name.endswith("_out"): - return True - if parameter.name == "count" and parameter.ptype.endswith("*'"): - return True - return (function, parameter.name) in output_parameters - - -def check_modifiers(functions: List[str]) -> None: - for func in function_modifiers.keys(): - 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})" - ) - for func, param in output_parameters: - if func not in functions: - 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})" - ) - - -def main(header_path="pymeos_cffi/builder/meos.h"): - with open(header_path) as f: - content = f.read() - # Regex lines: - # 1st line: Match beginning of function with optional "extern", "static" and - # "inline" - # 2nd line: Match the return type as any alphanumeric string with optional "const" - # modifier (before the type) or pointer modifier (after the type) - # 3rd line: Match the name of the function as any alphanumeric string - # 4th line: Match the parameters as any sequence of alphanumeric characters, commas, - # spaces and asterisks between parenthesis and end with a semicolon. - # (Parameter decomposition will be performed later) - f_regex = ( - r"(?:extern )?(?:static )?(?:inline )?" - r"(?P(?:const )?\w+(?: \*+)?)" - r"\s*(?P\w+)" - r"\((?P[\w\s,\*]*)\);" - ) - matches = re.finditer( - f_regex, "".join(content.splitlines()), flags=re.RegexFlag.MULTILINE - ) - - template_path = os.path.join(os.path.dirname(__file__), "templates/functions.py") - init_template_path = os.path.join(os.path.dirname(__file__), "templates/init.py") - with open(template_path) as f, open(init_template_path) as i: - base = f.read() - init_text = i.read() - - functions_path = os.path.join(os.path.dirname(__file__), "../functions.py") - init_path = os.path.join(os.path.dirname(__file__), "../__init__.py") - - with open(functions_path, "w+") as file: - file.write(base) - for match in matches: - named = match.groupdict() - function = named["function"] - inner_return_type = named["returnType"] - if function in skipped_functions: - continue - return_type = get_return_type(inner_return_type) - inner_params = named["params"] - params = get_params(function, inner_params) - function_string = build_function_string(function, return_type, params) - file.write(function_string) - file.write("\n\n\n") - - functions = [] - with open(functions_path, "r") as funcs: - content = funcs.read() - matches = list(re.finditer(r"def (\w+)\(", content)) - function_text = "" - for fn in matches: - function_name = fn.group(1) - if function_name in hidden_functions: - continue - function_text += f" '{function_name}',\n" - functions.append(function_name) - init_text = init_text.replace(" FUNCTIONS_REPLACE,", function_text) - with open(init_path, "w+") as init: - init.write(init_text) - - check_modifiers(functions) - - -def get_params(function: str, inner_params: str) -> List[Parameter]: - 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]: - # Split param name and type - split = inner_param.split(" ") - - # Type is everything except last word - param_type = " ".join(split[:-1]) - - # Check if parameter is pointer and fix type and name accordingly - param_name = split[-1].lstrip("*") - pointer_level = len(split[-1]) - len(param_name) - if pointer_level > 0: - param_type += " " + "*" * pointer_level - - # Check if the parameter name is a reserved word and change it if necessary - reserved_words = {"str": "string", "is": "iset", "from": "from_"} - if param_name in reserved_words: - param_name = reserved_words[param_name] - - # Return None to remove the parameter if it's void - if param_name == "void": - return None - - # Get the type conversion - conversion = get_param_conversion(param_type) - - # 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 conversion.p_to_c is None: - # If nullable, add null check - if nullable: - return 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", - ) - 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 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", - ) - return Parameter( - param_name, - f"{param_name}_converted", - param_type, - conversion.p_type, - f"{param_name}_converted = {conversion.p_to_c(param_name)}", - ) - - -# Returns a conversion for a type -def get_param_conversion(param_type: str) -> Conversion: - # Check if 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 param_type.endswith("**"): - return Conversion( - param_type, - f"'{param_type}'", - lambda name: f"[_ffi.cast('{param_type[:-1]}', x) for x in {name}]", - lambda name: name, - ) - - # Otherwise, cast normally - else: - return Conversion( - param_type, - f"'{param_type}'", - lambda name: f"_ffi.cast('{param_type}', {name})", - lambda name: name, - ) - - -# Creates a ReturnType object from the function return type -def get_return_type(inner_return_type) -> ReturnType: - # Check if a conversion is known - if inner_return_type in conversion_map: - conversion = conversion_map[inner_return_type] - return ReturnType( - conversion.c_type, - conversion.p_type, - 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) - - -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]): - # Remove it from the list of parameters - result_param = parameters.pop(-1) - - # Check if there are output parameters. Unlike result parameters, these are just - # normal parameters that provide extra information or actual results that are meant - # to go along with whatever the function returns - out_params = [] - if len(parameters) > 1: - 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 - ) - - # 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 - ) - - # Create CFFI function parameter list - 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 - if return_type.conversion is not None: - result_manipulation = f" result = {return_type.conversion}\n" - - # 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}'" - ) - # If there is a result param - if result_param is not None: - # Create the CFFI object to hold it - param_conversions += f"\n out_result = _ffi.new('{result_param.ctype}')" - # Add it to the CFFI call param list - inner_params += ", out_result" - - # If result is interoperable, remove pointer, otherwise, keep pointer - returning_object = "out_result" - if result_param.is_interoperable(): - returning_object += "[0]" - - # If original C function returned bool, use it to return it when result is True, - # or return None otherwise. - if return_type.return_type == "bool": - boll_guard = ( - " if result:\n" - f" return {returning_object} if {returning_object} != " - "_ffi.NULL else None\n" - " return None" - ) - result_manipulation = (result_manipulation or "") + boll_guard - # Otherwise, just return it normally - else: - result_manipulation = ( - (result_manipulation or "") - + f" return {returning_object} if {returning_object}" - f"!= _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" - - # For each output param - for out_param in out_params: - # Create the CFFI object to hold it - param_conversions += f"\n {out_param.name} = _ffi.new('{out_param.ctype}')" - # Add its type to the return type of the function, removing the pointer modifier - # if necessary - function_return_type += ", " + out_param.get_ptype_without_pointers() - # 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 len(out_params) > 0: - function_return_type = f'"Tuple[{function_return_type}]"' - - # Add padding to param conversions - if len(param_conversions) > 0: - param_conversions = f" {param_conversions}\n" - - # Add TO DO note if the function is listed in the function_notes dictionary - note = "" - if function_name in function_notes: - note = f"#TODO {function_notes[function_name]}\n" - - # 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}" - ) - # 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})" - # Otherwise, store the result in a variable - else: - function_string = f"{base}" f" result = _lib.{function_name}({inner_params})" - - # Add error handling - function_string += f"\n _check_error()" - - # Add whatever manipulation the result needs (maybe empty) - if result_manipulation is not None: - function_string += f"\n{result_manipulation}" - - # Check if there is function modifiers to modify specific elements of the function - if function_name in function_modifiers: - function_string = function_modifiers[function_name](function_string) - - return function_string - - -if __name__ == "__main__": - main(*sys.argv[1:]) diff --git a/pymeos_cffi/pymeos_cffi/builder/build_pymeos_functions_modifiers.py b/pymeos_cffi/pymeos_cffi/builder/build_pymeos_functions_modifiers.py deleted file mode 100644 index 7dcd98b5..00000000 --- a/pymeos_cffi/pymeos_cffi/builder/build_pymeos_functions_modifiers.py +++ /dev/null @@ -1,111 +0,0 @@ -import re -from typing import Callable, Optional - - -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 custom_array_modifier(function: str) -> str: - type_regex = list_name + r": '([\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( - f"_ffi.cast('{whole_type}', {list_name})", - f"_ffi.new('{base_type} []', {list_name})", - ) - if length_param_name: - function = function.replace(f", {length_param_name}: int", "").replace( - f", {length_param_name}", f", len({list_name})" - ) - return function - - return custom_array_modifier - - -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]" - ) - - -def meos_initialize_modifier(_: str) -> str: - return """def meos_initialize(tz_str: "Optional[str]") -> 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 - - tz_str_converted = tz_str.encode('utf-8') if tz_str is not None else _ffi.NULL - _lib.meos_initialize(tz_str_converted, _lib.py_error_handler)""" - - -def remove_error_check_modifier(function: str) -> str: - return function.replace(" _check_error()\n", "") - - -def cstring2text_modifier(_: str) -> str: - return """def cstring2text(cstring: str) -> 'text *': - cstring_converted = cstring.encode('utf-8') - result = _lib.cstring2text(cstring_converted) - return result""" - - -def text2cstring_modifier(_: str) -> str: - return """def text2cstring(textptr: 'text *') -> str: - result = _lib.text2cstring(textptr) - result = _ffi.string(result).decode('utf-8') - return result""" - - -def from_wkb_modifier(function: str, return_type: str) -> Callable[[str], str]: - return ( - lambda _: f"""def {function}(wkb: bytes) -> '{return_type} *': - wkb_converted = _ffi.new('uint8_t []', wkb) - result = _lib.{function}(wkb_converted, len(wkb)) - return result if result != _ffi.NULL else None""" - ) - - -def as_wkb_modifier(function: str) -> str: - 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", - ) - - -def tstzset_make_modifier(function: str) -> str: - return ( - function.replace("values: int", "values: List[int]") - .replace(", count: int", "") - .replace( - "values_converted = _ffi.cast('const TimestampTz *', values)", - "values_converted = [_ffi.cast('const TimestampTz', x) for x in values]", - ) - .replace("count", "len(values)") - ) - - -def spanset_make_modifier(function: str) -> str: - return ( - function.replace("spans: 'Span *', count: int", "spans: 'List[Span *]'") - .replace("_ffi.cast('Span *', spans)", "_ffi.new('Span []', spans)") - .replace(", count", ", len(spans)") - ) diff --git a/pymeos_cffi/pymeos_cffi/builder/meos.h b/pymeos_cffi/pymeos_cffi/builder/meos.h deleted file mode 100644 index 8c44f8ad..00000000 --- a/pymeos_cffi/pymeos_cffi/builder/meos.h +++ /dev/null @@ -1,2906 +0,0 @@ -//-------------------- meos.h -------------------- - - -//#include -//#include -//#include - -typedef char *Pointer; -typedef uintptr_t Datum; - -typedef signed char int8; -typedef signed short int16; -typedef signed int int32; -typedef long int int64; - -typedef unsigned char uint8; -typedef unsigned short uint16; -typedef unsigned int uint32; -typedef unsigned long int uint64; - -typedef int32 DateADT; -typedef int64 TimeADT; -typedef int64 Timestamp; -typedef int64 TimestampTz; -typedef int64 TimeOffset; -typedef int32 fsec_t; - -typedef struct -{ - TimeOffset time; - int32 day; - int32 month; -} Interval; - -typedef struct varlena -{ - char vl_len_[4]; - char vl_dat[]; -} varlena; - -typedef varlena text; -typedef struct varlena bytea; - - - -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; - -typedef struct -{ - double x, y, m; -} -POINT3DM; - -typedef struct -{ - double x, y, z, m; -} -POINT4D; - -typedef struct -{ - uint32_t npoints; - uint32_t maxpoints; - - - lwflags_t flags; - - - uint8_t *serialized_pointlist; -} -POINTARRAY; - -typedef struct -{ - uint32_t size; - uint8_t srid[3]; - uint8_t gflags; - uint8_t data[1]; -} GSERIALIZED; - -typedef struct -{ - GBOX *bbox; - void *data; - int32_t srid; - lwflags_t flags; - uint8_t type; - char pad[1]; -} -LWGEOM; - -typedef struct -{ - GBOX *bbox; - POINTARRAY *point; - int32_t srid; - lwflags_t flags; - uint8_t type; - char pad[1]; -} -LWPOINT; - -typedef struct -{ - GBOX *bbox; - POINTARRAY *points; - int32_t srid; - lwflags_t flags; - uint8_t type; - char pad[1]; -} -LWLINE; - -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; - -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; - -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; - -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; - -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; - -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 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 int32 geo_get_srid(const GSERIALIZED *g); - -struct PJconsts; -typedef struct PJconsts PJ; - -typedef struct LWPROJ -{ - PJ* pj; - - - bool pipeline_is_forward; - - - uint8_t source_is_latlong; - - double source_semi_major_metre; - double source_semi_minor_metre; -} LWPROJ; - - - -typedef struct -{ - int32 vl_len_; - uint8 settype; - uint8 basetype; - int16 flags; - int32 count; - int32 maxcount; - int16 bboxsize; -} Set; - -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; - -typedef struct -{ - Span period; - double xmin; - double ymin; - double zmin; - double xmax; - double ymax; - double zmax; - int32 srid; - int16 flags; -} STBox; - -typedef enum -{ - ANYTEMPSUBTYPE = 0, - TINSTANT = 1, - TSEQUENCE = 2, - TSEQUENCESET = 3, -} tempSubtype; - -typedef enum -{ - INTERP_NONE = 0, - DISCRETE = 1, - STEP = 2, - LINEAR = 3, -} interpType; - -typedef enum -{ - INTERSECTS = 0, - CONTAINS = 1, - TOUCHES = 2, - COVERS = 3, -} spatialRel; - -typedef struct -{ - int32 vl_len_; - uint8 temptype; - uint8 subtype; - int16 flags; - -} Temporal; - -typedef struct -{ - int32 vl_len_; - uint8 temptype; - uint8 subtype; - int16 flags; - TimestampTz t; - Datum value; - -} TInstant; - -typedef struct -{ - int32 vl_len_; - uint8 temptype; - uint8 subtype; - int16 flags; - int32 count; - int32 maxcount; - int16 bboxsize; - char padding[6]; - Span period; - -} TSequence; - -typedef struct -{ - int32 vl_len_; - uint8 temptype; - uint8 subtype; - int16 flags; - int32 count; - int32 totalcount; - int32 maxcount; - int16 bboxsize; - int16 padding; - Span period; - -} TSequenceSet; - -typedef struct -{ - int i; - int j; -} Match; - -#define SKIPLIST_MAXLEVEL 32 -typedef struct -{ - void *value; - int height; - int next[SKIPLIST_MAXLEVEL]; -} SkipListElem; - -typedef struct -{ - int capacity; - int next; - int length; - int *freed; - int freecount; - int freecap; - int tail; - void *extra; - size_t extrasize; - SkipListElem *elems; -} SkipList; - -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, - -} errorCode; - -extern void meos_error(int errlevel, int errcode, char *format, ...); - -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 void (*error_handler_fn)(int, int, char *); - -/* extern void meos_initialize_timezone(const char *name); (undefined) */ -extern void meos_initialize_error_handler(error_handler_fn err_handler); -/* extern void meos_finalize_timezone(void); (undefined) */ - -extern bool meos_set_datestyle(char *newval, void *extra); -extern bool meos_set_intervalstyle(char *newval, int extra); -extern char *meos_get_datestyle(void); -extern char *meos_get_intervalstyle(void); - -extern void meos_initialize(const char *tz_str, error_handler_fn err_handler); -extern void meos_finalize(void); - -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 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 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 Interval *pg_interval_make(int32 years, int32 months, int32 weeks, int32 days, int32 hours, int32 mins, double secs); -extern char *pg_interval_out(const Interval *interv); -extern TimeADT pg_time_in(const char *str, int32 typmod); -extern char *pg_time_out(TimeADT t); -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 DateADT timestamptz_to_date(TimestampTz t); - -extern bytea *geo_as_ewkb(const GSERIALIZED *gs, char *endian); -extern char *geo_as_ewkt(const GSERIALIZED *gs, int precision); -extern char *geo_as_geojson(const GSERIALIZED *gs, int option, int precision, 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 bytea *bytea_wkb, int32 srid); -extern GSERIALIZED *geo_from_geojson(const char *geojson); -extern char *geo_out(const GSERIALIZED *gs); -extern bool geo_same(const GSERIALIZED *gs1, const GSERIALIZED *gs2); -extern GSERIALIZED *geography_from_hexewkb(const char *wkt); -extern GSERIALIZED *geography_from_text(char *wkt, int srid); -extern GSERIALIZED *geometry_from_hexewkb(const char *wkt); -extern GSERIALIZED *geometry_from_text(char *wkt, int srid); -extern GSERIALIZED *pgis_geography_in(char *str, int32 typmod); -extern GSERIALIZED *pgis_geometry_in(char *str, int32 typmod); - -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 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 ordered); -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 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 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 int 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_spans(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 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_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_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_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 srid); -extern Set *geoset_transform(const Set *s, int32 srid); -extern Set *geoset_transform_pipeline(const Set *s, char *pipelinestr, int32 srid, bool is_forward); -extern GSERIALIZED *point_transform(const GSERIALIZED *gs, int32 srid); -extern GSERIALIZED *point_transform_pipeline(const GSERIALIZED *gs, char *pipelinestr, int32 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 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 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 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 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 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 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 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 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 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 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 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 int32 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 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 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 srid); -extern STBox *stbox_shift_scale_time(const STBox *box, const Interval *shift, const Interval *duration); -extern STBox *stbox_transform(const STBox *box, int32 srid); -extern STBox *stbox_transform_pipeline(const STBox *box, char *pipelinestr, int32 srid, bool is_forward); -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 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 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); - -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); - -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); - -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); - -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, 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); - -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, 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); - -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 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_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 int temporal_lower_inc(const Temporal *temp); -extern int 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 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 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 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 text **ttext_values(const Temporal *temp, int *count); - -extern double float_degrees(double value, bool normalize); -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, char *interp_str); -extern TSequenceSet *temporal_to_tsequenceset(const Temporal *temp, char *interp_str); -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, 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, 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(Temporal **temparr, int count); -extern Temporal *temporal_update(const Temporal *temp1, const Temporal *temp2, bool connect); - -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_time(const Temporal *temp, const GSERIALIZED *gs, const Span *zspan, const Span *period); -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_time(const Temporal *temp, const GSERIALIZED *gs, const Span *zspan, const Span *period); -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); - -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 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); - -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); - -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); - -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); - -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 *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); - -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 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); - -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 *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 int tpoint_srid(const Temporal *temp); -extern STBox *tpoint_stboxes(const Temporal *temp, int *count); -extern GSERIALIZED *tpoint_trajectory(const Temporal *temp); -extern GSERIALIZED *tpoint_twcentroid(const Temporal *temp); - -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); -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 srid); -bool tpoint_tfloat_to_geomeas(const Temporal *tpoint, const Temporal *measure, bool segmentize, GSERIALIZED **result); - -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); - -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); -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); - -Temporal *temporal_simplify_dp(const Temporal *temp, double eps_dist, bool synchronized); -Temporal *temporal_simplify_max_dist(const Temporal *temp, double eps_dist, bool synchronized); -Temporal *temporal_simplify_min_dist(const Temporal *temp, double dist); -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); - -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 double float_bucket(double value, double size, double origin); -extern Span *floatspan_bucket_list(const Span *bounds, double size, double origin, int *count); -extern int int_bucket(int value, int size, int origin); -extern Span *intspan_bucket_list(const Span *bounds, int size, int origin, int *count); -extern STBox *stbox_tile(GSERIALIZED *point, TimestampTz t, double xsize, double ysize, double zsize, Interval *duration, GSERIALIZED *sorigin, TimestampTz torigin, bool hast); -extern STBox *stbox_tile_list(const STBox *bounds, double xsize, double ysize, double zsize, const Interval *duration, GSERIALIZED *sorigin, TimestampTz torigin, int *count); -extern Temporal **temporal_time_split(Temporal *temp, Interval *duration, TimestampTz torigin, TimestampTz **time_buckets, int *count); -extern Temporal **tfloat_value_split(Temporal *temp, double size, double origin, double **value_buckets, int *count); -extern Temporal **tfloat_value_time_split(Temporal *temp, double size, Interval *duration, double vorigin, TimestampTz torigin, double **value_buckets, TimestampTz **time_buckets, int *count); -extern TBox *tfloatbox_tile(double value, TimestampTz t, double vsize, Interval *duration, double vorigin, TimestampTz torigin); -extern TBox *tfloatbox_tile_list(const TBox *box, double xsize, const Interval *duration, double xorigin, TimestampTz torigin, int *count); -extern TimestampTz timestamptz_bucket(TimestampTz timestamp, const Interval *duration, TimestampTz origin); -extern Temporal **tint_value_split(Temporal *temp, int size, int origin, int **value_buckets, int *count); -extern Temporal **tint_value_time_split(Temporal *temp, int size, Interval *duration, int vorigin, TimestampTz torigin, int **value_buckets, TimestampTz **time_buckets, int *count); -extern TBox *tintbox_tile(int value, TimestampTz t, int vsize, Interval *duration, int vorigin, TimestampTz torigin); -extern TBox *tintbox_tile_list(const TBox *box, int xsize, const Interval *duration, int xorigin, TimestampTz torigin, int *count); -extern Temporal **tpoint_space_split(Temporal *temp, float xsize, float ysize, float zsize, GSERIALIZED *sorigin, bool bitmatrix, GSERIALIZED ***space_buckets, int *count); -extern Temporal **tpoint_space_time_split(Temporal *temp, float xsize, float ysize, float zsize, Interval *duration, GSERIALIZED *sorigin, TimestampTz torigin, bool bitmatrix, GSERIALIZED ***space_buckets, TimestampTz **time_buckets, int *count); -extern Span *tstzspan_bucket_list(const Span *bounds, const Interval *duration, TimestampTz origin, 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_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, -} meosType; - -#define NO_MEOS_TYPES 52 -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 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 time_type(meosType type); -/* extern bool set_basetype(meosType type); (undefined) */ - -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); - -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 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 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 tnumber_basetype(meosType type); (repeated) */ -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); - - - -//-------------------- meos_internal.h -------------------- - - -//#include - -//#include - -//#include -//#include "meos_catalog.h" - - - -extern Datum datum_degrees(Datum d, Datum normalize); -extern Datum datum_radians(Datum d); -extern uint32 datum_hash(Datum d, meosType basetype); -extern uint64 datum_hash_extended(Datum d, meosType basetype, uint64 seed); - - - -extern Set *set_in(const char *str, meosType basetype); -extern char *set_out(const Set *s, int maxdd); -extern Span *span_in(const char *str, meosType spantype); -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 ordered); -extern Set *set_make_exp(const Datum *values, int count, int maxcount, meosType basetype, bool ordered); -extern Set *set_make_free(Datum *values, int count, meosType basetype, bool ordered); -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 ordered); -extern SpanSet *spanset_make_free(Span *spans, int count, bool normalize, bool ordered); - -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 Datum numspan_width(const Span *s); -extern Datum numspanset_width(const SpanSet *ss, bool boundspan); -extern Datum set_end_value(const Set *s); -extern int set_mem_size(const Set *s); -extern void set_set_span(const Set *s, Span *sp); -/* extern Span *set_span(const Set *s); (repeated) */ -extern Datum set_start_value(const Set *s); -extern bool set_value_n(const Set *s, int n, Datum *result); -extern Datum *set_vals(const Set *s); -extern Datum *set_values(const Set *s); -extern Datum spanset_lower(const SpanSet *ss); -extern int spanset_mem_size(const SpanSet *ss); -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); -extern Span *numspan_shift_scale(const Span *s, Datum shift, Datum width, bool hasshift, bool haswidth); -extern SpanSet *numspanset_shift_scale(const SpanSet *ss, Datum shift, Datum width, bool hasshift, bool haswidth); -extern Set *set_compact(const Set *s); -extern void span_expand(const Span *s1, Span *s2); -extern SpanSet *spanset_compact(const SpanSet *ss); -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 bool set_eq_int(const Set *s1, const Set *s2); (undefined) */ -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); -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); -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); -extern bool overleft_spanset_value(const SpanSet *ss, Datum value); -extern bool overleft_value_set(Datum value, const Set *s); -extern bool overleft_value_span(Datum value, const Span *s); -extern bool overleft_value_spanset(Datum value, const SpanSet *ss); -extern bool overright_set_value(const Set *s, Datum value); -extern bool overright_span_value(const Span *s, Datum value); -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); -extern bool right_value_spanset(Datum value, const SpanSet *ss); -extern bool right_span_value(const Span *s, Datum value); -extern bool right_spanset_value(const SpanSet *ss, Datum value); - -extern void bbox_union_span_span(const Span *s1, const Span *s2, Span *result); -extern bool inter_span_span(const Span *s1, const Span *s2, Span *result); -extern Set *intersection_set_value(const Set *s, Datum value); -extern Span *intersection_span_value(const Span *s, Datum value); -extern SpanSet *intersection_spanset_value(const SpanSet *ss, Datum value); -extern Set *intersection_value_set(Datum value, const Set *s); -extern Span *intersection_value_span(Datum value, const Span *s); -extern SpanSet *intersection_value_spanset(Datum value, const SpanSet *ss); -extern int mi_span_span(const Span *s1, const Span *s2, Span *result); -extern Set *minus_set_value(const Set *s, Datum value); -extern SpanSet *minus_span_value(const Span *s, Datum value); -extern SpanSet *minus_spanset_value(const SpanSet *ss, Datum value); -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 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 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); -extern Datum distance_span_value(const Span *s, Datum value); -extern Datum distance_spanset_span(const SpanSet *ss, const Span *s); -extern Datum distance_spanset_spanset(const SpanSet *ss1, const SpanSet *ss2); -extern Datum distance_spanset_value(const SpanSet *ss, Datum value); -extern Datum distance_value_value(Datum l, Datum r, meosType basetype); - -extern Span *spanbase_extent_transfn(Span *state, Datum value, meosType basetype); -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 STBox *gbox_to_stbox(const GBOX *box); (repeated) */ -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 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, meosType basetype, 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 char *tinstant_as_mfjson(const TInstant *inst, bool with_bbox, int precision, char *srs); -/* extern TInstant *tinstant_from_mfjson(json_object *mfjson, bool isgeo, int 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 char *tsequence_as_mfjson(const TSequence *seq, 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_in(const char *str, meosType temptype, interpType interp); -extern char *tsequence_out(const TSequence *seq, int maxdd); -extern char *tsequenceset_as_mfjson(const TSequenceSet *ss, bool with_bbox, int precision, char *srs); -/* extern TSequenceSet *tsequenceset_from_mfjson(json_object *mfjson, bool isgeo, int 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_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_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); - -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 Datum temporal_end_value(const Temporal *temp); -extern const TInstant **temporal_insts(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 void temporal_set_bbox(const Temporal *temp, void *box); -/* extern void temporal_set_tstzspan(const Temporal *temp, Span *s); (repeated) */ -/* extern const TSequence **temporal_seqs(const Temporal *temp, int *count); (repeated) */ -extern Datum temporal_start_value (const Temporal *temp); -extern Datum *temporal_vals(const Temporal *temp, int *count); -extern Datum *temporal_values(const Temporal *temp, int *count); -extern uint32 tinstant_hash(const TInstant *inst); -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(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 void tnumber_set_span(const Temporal *temp, Span *span); -extern SpanSet *tnumberinst_valuespans(const TInstant *inst); -extern SpanSet *tnumberseq_valuespans(const TSequence *seq); -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_max_inst(const TSequence *seq); -extern Datum tsequence_max_val(const TSequence *seq); -extern const TInstant *tsequence_min_inst(const TSequence *seq); -extern Datum tsequence_min_val(const TSequence *seq); -extern TSequence **tsequence_segments(const TSequence *seq, int *count); -extern const TSequence **tsequence_seqs(const TSequence *seq, int *count); -extern void tsequence_set_bbox(const TSequence *seq, void *box); -extern void tsequence_expand_bbox(TSequence *seq, const TInstant *inst); -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 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_max_inst(const TSequenceSet *ss); -extern Datum tsequenceset_max_val(const TSequenceSet *ss); -extern const TInstant *tsequenceset_min_inst(const TSequenceSet *ss); -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 void tsequenceset_set_bbox(const TSequenceSet *ss, void *box); -extern TimestampTz tsequenceset_start_timestamptz(const TSequenceSet *ss); -extern SpanSet *tsequenceset_time(const TSequenceSet *ss); -/* extern Interval *tsequenceset_timespan(const TSequenceSet *ss); (undefined) */ -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 Datum *tsequenceset_vals(const TSequenceSet *ss, int *count); - -extern Temporal *temporal_compact(const Temporal *temp); -extern void temporal_restart(Temporal *temp, int count); -extern TSequence *temporal_tsequence(const Temporal *temp, interpType interp); -extern TSequenceSet *temporal_tsequenceset(const Temporal *temp, interpType interp); -extern TInstant *tinstant_shift_time(const TInstant *inst, const Interval *interv); -extern TSequence *tinstant_to_tsequence(const TInstant *inst, interpType interp); -extern TSequence *tinstant_to_tsequence_free(TInstant *inst, interpType interp); -extern TSequenceSet *tinstant_to_tsequenceset(const TInstant *inst, interpType interp); -extern Temporal *tnumber_shift_scale_value(const Temporal *temp, Datum shift, Datum width, bool hasshift, bool haswidth); -extern TInstant *tnumberinst_shift_value(const TInstant *inst, Datum shift); -extern TSequence *tnumberseq_shift_scale_value(const TSequence *seq, Datum shift, Datum width, bool hasshift, bool haswidth); -extern TSequenceSet *tnumberseqset_shift_scale_value(const TSequenceSet *ss, Datum start, Datum width, bool hasshift, bool haswidth); -extern TSequence *tsequence_compact(const TSequence *seq); -extern void tsequence_restart(TSequence *seq, int count); -extern Temporal *tsequence_set_interp(const TSequence *seq, interpType interp); -extern TSequence *tsequence_shift_scale_time(const TSequence *seq, const Interval *shift, const Interval *duration); -extern TSequence *tsequence_subseq(const TSequence *seq, int from, int to, bool lower_inc, bool upper_inc); -extern TInstant *tsequence_to_tinstant(const TSequence *seq); -extern TSequenceSet *tsequence_to_tsequenceset(const TSequence *seq); -extern TSequenceSet *tsequence_to_tsequenceset_free(TSequence *seq); -extern TSequenceSet *tsequence_to_tsequenceset_interp(const TSequence *seq, interpType interp); -extern TSequenceSet *tsequenceset_compact(const TSequenceSet *ss); -extern void tsequenceset_restart(TSequenceSet *ss, int count); -extern Temporal *tsequenceset_set_interp(const TSequenceSet *ss, interpType interp); -extern TSequenceSet *tsequenceset_shift_scale_time(const TSequenceSet *ss, const Interval *start, const Interval *duration); -extern TSequence *tsequenceset_to_discrete(const TSequenceSet *ss); -extern TSequenceSet *tsequenceset_to_linear(const TSequenceSet *ss); -extern TSequenceSet *tsequenceset_to_step(const TSequenceSet *ss); -extern TInstant *tsequenceset_to_tinstant(const TSequenceSet *ss); -extern TSequence *tsequenceset_to_tsequence(const TSequenceSet *ss); - -extern Temporal *tinstant_merge(const TInstant *inst1, const TInstant *inst2); -extern Temporal *tinstant_merge_array(const TInstant **instants, int count); -extern Temporal *tsequence_append_tinstant(TSequence *seq, const TInstant *inst, double maxdist, const Interval *maxt, bool expand); -extern Temporal *tsequence_append_tsequence(TSequence *seq1, const TSequence *seq2, bool expand); -extern Temporal *tsequence_delete_timestamptz(const TSequence *seq, TimestampTz t, bool connect); -extern Temporal *tsequence_delete_tstzset(const TSequence *seq, const Set *s, bool connect); -extern Temporal *tsequence_delete_tstzspan(const TSequence *seq, const Span *s, bool connect); -extern Temporal *tsequence_delete_tstzspanset(const TSequence *seq, const SpanSet *ss, bool connect); -extern Temporal *tsequence_insert(const TSequence *seq1, const TSequence *seq2, bool connect); -extern Temporal *tsequence_merge(const TSequence *seq1, const TSequence *seq2); -extern Temporal *tsequence_merge_array(const TSequence **sequences, int count); -extern TSequenceSet *tsequenceset_append_tinstant(TSequenceSet *ss, const TInstant *inst, double maxdist, const Interval *maxt, bool expand); -extern TSequenceSet *tsequenceset_append_tsequence(TSequenceSet *ss, const TSequence *seq, bool expand); -extern TSequenceSet *tsequenceset_delete_timestamptz(const TSequenceSet *ss, TimestampTz t); -extern TSequenceSet *tsequenceset_delete_tstzset(const TSequenceSet *ss, const Set *s); -extern TSequenceSet *tsequenceset_delete_tstzspan(const TSequenceSet *ss, const Span *s); -extern TSequenceSet *tsequenceset_delete_tstzspanset(const TSequenceSet *ss, const SpanSet *ps); -extern TSequenceSet *tsequenceset_insert(const TSequenceSet *ss1, const TSequenceSet *ss2); -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); (repeated) */ -/* extern void tsequence_set_bbox(const TSequence *seq, void *box); (repeated) */ -extern void tsequenceset_expand_bbox(TSequenceSet *ss, const TSequence *seq); -/* extern void tsequenceset_set_bbox(const TSequenceSet *ss, void *box); (repeated) */ - -extern TSequence *tdiscseq_restrict_minmax(const TSequence *seq, bool min, bool atfunc); -extern TSequenceSet *tcontseq_restrict_minmax(const TSequence *seq, bool min, bool atfunc); -extern bool temporal_bbox_restrict_set(const Temporal *temp, const Set *set); -extern Temporal *temporal_restrict_minmax(const Temporal *temp, bool min, bool atfunc); -extern Temporal *temporal_restrict_timestamptz(const Temporal *temp, TimestampTz t, bool atfunc); -extern Temporal *temporal_restrict_tstzset(const Temporal *temp, const Set *s, bool atfunc); -extern Temporal *temporal_restrict_tstzspan(const Temporal *temp, const Span *s, bool atfunc); -extern Temporal *temporal_restrict_tstzspanset(const Temporal *temp, const SpanSet *ss, bool atfunc); -extern Temporal *temporal_restrict_value(const Temporal *temp, Datum value, bool atfunc); -extern Temporal *temporal_restrict_values(const Temporal *temp, const Set *set, bool atfunc); -extern bool temporal_value_at_timestamptz(const Temporal *temp, TimestampTz t, bool strict, Datum *result); -extern TInstant *tinstant_restrict_tstzspan(const TInstant *inst, const Span *period, bool atfunc); -extern TInstant *tinstant_restrict_tstzspanset(const TInstant *inst, const SpanSet *ss, bool atfunc); -extern TInstant *tinstant_restrict_timestamptz(const TInstant *inst, TimestampTz t, bool atfunc); -extern TInstant *tinstant_restrict_tstzset(const TInstant *inst, const Set *s, bool atfunc); -extern TInstant *tinstant_restrict_value(const TInstant *inst, Datum value, bool atfunc); -extern TInstant *tinstant_restrict_values(const TInstant *inst, const Set *set, bool atfunc); -extern Temporal *tnumber_restrict_span(const Temporal *temp, const Span *span, bool atfunc); -extern Temporal *tnumber_restrict_spanset(const Temporal *temp, const SpanSet *ss, bool atfunc); -extern TInstant *tnumberinst_restrict_span(const TInstant *inst, const Span *span, bool atfunc); -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 *tpoint_restrict_geom_time(const Temporal *temp, const GSERIALIZED *gs, const Span *zspan, const Span *period, bool atfunc); -extern Temporal *tpoint_restrict_stbox(const Temporal *temp, const STBox *box, bool border_inc, bool atfunc); -extern TInstant *tpointinst_restrict_geom_time(const TInstant *inst, const GSERIALIZED *gs, const Span *zspan, const Span *period, bool atfunc); -extern TInstant *tpointinst_restrict_stbox(const TInstant *inst, const STBox *box, bool border_inc, bool atfunc); -extern Temporal *tpointseq_restrict_geom_time(const TSequence *seq, const GSERIALIZED *gs, const Span *zspan, const Span *period, bool atfunc); -extern Temporal *tpointseq_restrict_stbox(const TSequence *seq, const STBox *box, bool border_inc, bool atfunc); -extern TSequenceSet *tpointseqset_restrict_geom_time(const TSequenceSet *ss, const GSERIALIZED *gs, const Span *zspan, const Span *period, 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); -extern TSequenceSet *tsequenceset_restrict_minmax(const TSequenceSet *ss, bool min, bool atfunc); -extern TSequenceSet *tsequenceset_restrict_tstzspan(const TSequenceSet *ss, const Span *s, bool atfunc); -extern TSequenceSet *tsequenceset_restrict_tstzspanset(const TSequenceSet *ss, const SpanSet *ps, bool atfunc); -extern Temporal *tsequenceset_restrict_timestamptz(const TSequenceSet *ss, TimestampTz t, bool atfunc); -extern Temporal *tsequenceset_restrict_tstzset(const TSequenceSet *ss, const Set *s, bool atfunc); -extern TSequenceSet *tsequenceset_restrict_value(const TSequenceSet *ss, Datum value, bool atfunc); -extern TSequenceSet *tsequenceset_restrict_values(const TSequenceSet *ss, const Set *s, bool atfunc); - -extern int tinstant_cmp(const TInstant *inst1, const TInstant *inst2); -extern bool tinstant_eq(const TInstant *inst1, const TInstant *inst2); -extern int tsequence_cmp(const TSequence *seq1, const TSequence *seq2); -extern bool tsequence_eq(const TSequence *seq1, const TSequence *seq2); -extern int tsequenceset_cmp(const TSequenceSet *ss1, const TSequenceSet *ss2); -extern bool tsequenceset_eq(const TSequenceSet *ss1, const TSequenceSet *ss2); - -extern int always_eq_base_temporal(Datum value, const Temporal *temp); -extern int always_eq_temporal_base(const Temporal *temp, Datum value); -/* extern int always_eq_tinstant_base(const TInstant *inst, Datum value); (undefined) */ -/* extern int always_eq_tpointinst_base(const TInstant *inst, Datum value); (undefined) */ -/* extern int always_eq_tpointseq_base(const TSequence *seq, Datum value); (undefined) */ -/* extern int always_eq_tpointseqset_base(const TSequenceSet *ss, Datum value); (undefined) */ -/* extern int always_eq_tsequence_base(const TSequence *seq, Datum value); (undefined) */ -/* extern int always_eq_tsequenceset_base(const TSequenceSet *ss, Datum value); (undefined) */ -extern int always_ne_base_temporal(Datum value, const Temporal *temp); -extern int always_ne_temporal_base(const Temporal *temp, Datum value); -/* extern int always_ne_tinstant_base(const TInstant *inst, Datum value); (undefined) */ -/* extern int always_ne_tpointinst_base(const TInstant *inst, Datum value); (undefined) */ -/* extern int always_ne_tpointseq_base(const TSequence *seq, Datum value); (undefined) */ -/* extern int always_ne_tpointseqset_base(const TSequenceSet *ss, Datum value); (undefined) */ -/* extern int always_ne_tsequence_base(const TSequence *seq, Datum value); (undefined) */ -/* extern int always_ne_tsequenceset_base(const TSequenceSet *ss, Datum value); (undefined) */ -extern int always_ge_base_temporal(Datum value, const Temporal *temp); -extern int always_ge_temporal_base(const Temporal *temp, Datum value); -/* extern int always_ge_tinstant_base(const TInstant *inst, Datum value); (undefined) */ -/* extern int always_ge_tsequence_base(const TSequence *seq, Datum value); (undefined) */ -/* extern int always_ge_tsequenceset_base(const TSequenceSet *ss, Datum value); (undefined) */ -extern int always_gt_base_temporal(Datum value, const Temporal *temp); -extern int always_gt_temporal_base(const Temporal *temp, Datum value); -/* extern int always_gt_tinstant_base(const TInstant *inst, Datum value); (undefined) */ -/* extern int always_gt_tsequence_base(const TSequence *seq, Datum value); (undefined) */ -/* extern int always_gt_tsequenceset_base(const TSequenceSet *ss, Datum value); (undefined) */ -extern int always_le_base_temporal(Datum value, const Temporal *temp); -extern int always_le_temporal_base(const Temporal *temp, Datum value); -/* extern int always_le_tinstant_base(const TInstant *inst, Datum value); (undefined) */ -/* extern int always_le_tsequence_base(const TSequence *seq, Datum value); (undefined) */ -/* extern int always_le_tsequenceset_base(const TSequenceSet *ss, Datum value); (undefined) */ -extern int always_lt_base_temporal(Datum value, const Temporal *temp); -extern int always_lt_temporal_base(const Temporal *temp, Datum value); -/* extern int always_lt_tinstant_base(const TInstant *inst, Datum value); (undefined) */ -/* extern int always_lt_tsequence_base(const TSequence *seq, Datum value); (undefined) */ -/* extern int always_lt_tsequenceset_base(const TSequenceSet *ss, Datum value); (undefined) */ -extern int ever_eq_base_temporal(Datum value, const Temporal *temp); -extern int ever_eq_temporal_base(const Temporal *temp, Datum value); -/* extern int ever_eq_tinstant_base(const TInstant *inst, Datum value); (undefined) */ -/* extern int ever_eq_tpointinst_base(const TInstant *inst, Datum value); (undefined) */ -/* extern int ever_eq_tpointseq_base(const TSequence *seq, Datum value); (undefined) */ -/* extern int ever_eq_tpointseqset_base(const TSequenceSet *ss, Datum value); (undefined) */ -/* extern int ever_eq_tsequence_base(const TSequence *seq, Datum value); (undefined) */ -/* extern int ever_eq_tsequenceset_base(const TSequenceSet *ss, Datum value); (undefined) */ -extern int ever_ne_base_temporal(Datum value, const Temporal *temp); -extern int ever_ne_temporal_base(const Temporal *temp, Datum value); -/* extern int ever_ne_tinstant_base(const TInstant *inst, Datum value); (undefined) */ -/* extern int ever_ne_tpointinst_base(const TInstant *inst, Datum value); (undefined) */ -/* extern int ever_ne_tpointseq_base(const TSequence *seq, Datum value); (undefined) */ -/* extern int ever_ne_tpointseqset_base(const TSequenceSet *ss, Datum value); (undefined) */ -/* extern int ever_ne_tsequence_base(const TSequence *seq, Datum value); (undefined) */ -/* extern int ever_ne_tsequenceset_base(const TSequenceSet *ss, Datum value); (undefined) */ -extern int ever_ge_base_temporal(Datum value, const Temporal *temp); -extern int ever_ge_temporal_base(const Temporal *temp, Datum value); -/* extern int ever_ge_tinstant_base(const TInstant *inst, Datum value); (undefined) */ -/* extern int ever_ge_tsequence_base(const TSequence *seq, Datum value); (undefined) */ -/* extern int ever_ge_tsequenceset_base(const TSequenceSet *ss, Datum value); (undefined) */ -extern int ever_gt_base_temporal(Datum value, const Temporal *temp); -extern int ever_gt_temporal_base(const Temporal *temp, Datum value); -/* extern int ever_gt_tinstant_base(const TInstant *inst, Datum value); (undefined) */ -/* extern int ever_gt_tsequence_base(const TSequence *seq, Datum value); (undefined) */ -/* extern int ever_gt_tsequenceset_base(const TSequenceSet *ss, Datum value); (undefined) */ -extern int ever_le_base_temporal(Datum value, const Temporal *temp); -extern int ever_le_temporal_base(const Temporal *temp, Datum value); -/* extern int ever_le_tinstant_base(const TInstant *inst, Datum value); (undefined) */ -/* extern int ever_le_tsequence_base(const TSequence *seq, Datum value); (undefined) */ -/* extern int ever_le_tsequenceset_base(const TSequenceSet *ss, Datum value); (undefined) */ -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); -extern TSequence *tnumberseq_delta_value(const TSequence *seq); -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 int tpointinst_srid(const TInstant *inst); -extern GSERIALIZED *tpointseq_trajectory(const TSequence *seq); -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 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 GSERIALIZED *tpointseqset_trajectory(const TSequenceSet *ss); -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 TInstant *tpointinst_set_srid(const TInstant *inst, int32 srid); -extern TSequence **tpointseq_make_simple(const TSequence *seq, int *count); -extern TSequence *tpointseq_set_srid(const TSequence *seq, int32 srid); -extern TSequence **tpointseqset_make_simple(const TSequenceSet *ss, int *count); -extern TSequenceSet *tpointseqset_set_srid(const TSequenceSet *ss, int32 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); (repeated) */ -/* extern TSequence *tsequence_compact(const TSequence *seq); (repeated) */ -/* extern TSequenceSet *tsequenceset_compact(const TSequenceSet *ss); (repeated) */ - -extern void skiplist_free(SkipList *list); -extern Temporal *temporal_app_tinst_transfn(Temporal *state, const TInstant *inst, double maxdist, Interval *maxt); -extern Temporal *temporal_app_tseq_transfn(Temporal *state, const TSequence *seq); - -extern Temporal **tnumber_value_split(const Temporal *temp, Datum size, Datum origin, Datum **buckets, int *count); -extern TBox *tbox_tile(Datum value, TimestampTz t, Datum vsize, Interval *duration, Datum vorigin, TimestampTz torigin, meosType basetype); - - - - -extern "Python" void py_error_handler(int, int, char*); \ No newline at end of file diff --git a/pymeos_cffi/pymeos_cffi/builder/objects.py b/pymeos_cffi/pymeos_cffi/builder/objects.py deleted file mode 100644 index 487c0834..00000000 --- a/pymeos_cffi/pymeos_cffi/builder/objects.py +++ /dev/null @@ -1,114 +0,0 @@ -from typing import Callable, Dict, Optional - - -class Conversion: - def __init__( - self, - c_type: str, - p_type: str, - p_to_c: Optional[Callable[[str], str]], - c_to_p: Optional[Callable[[str], str]], - ) -> None: - super().__init__() - self.c_type = c_type - self.p_type = p_type - self.p_to_c = p_to_c - self.c_to_p = c_to_p - - -conversion_map: Dict[str, Conversion] = { - "void": Conversion("void", "None", None, None), - "bool": Conversion("bool", "bool", None, None), - "double": Conversion("double", "float", None, None), - "char *": Conversion( - "char *", - "str", - lambda p_obj: f"{p_obj}.encode('utf-8')", - lambda c_obj: f"_ffi.string({c_obj}).decode('utf-8')", - ), - "const char *": Conversion( - "const char *", - "str", - lambda p_obj: f"{p_obj}.encode('utf-8')", - lambda c_obj: f"_ffi.string({c_obj}).decode('utf-8')", - ), - "text": Conversion( - "text", - "str", - lambda p_obj: f"cstring2text({p_obj})", - lambda c_obj: f"text2cstring({c_obj})", - ), - "text *": Conversion( - "text *", - "str", - lambda p_obj: f"cstring2text({p_obj})", - lambda c_obj: f"text2cstring({c_obj})", - ), - "const text": Conversion( - "const text", - "str", - lambda p_obj: f"cstring2text({p_obj})", - lambda c_obj: f"text2cstring({c_obj})", - ), - "const text *": Conversion( - "const text *", - "str", - lambda p_obj: f"cstring2text({p_obj})", - 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 - ), - "TimestampTz *": Conversion( - "TimestampTz *", - "int", - lambda p_obj: f"_ffi.cast('TimestampTz *', {p_obj})", - None, - ), - "const TimestampTz": Conversion( - "const TimestampTz", - "int", - lambda p_obj: f"_ffi.cast('const TimestampTz', {p_obj})", - None, - ), - "const TimestampTz *": Conversion( - "const TimestampTz *", - "int", - 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 - ), -} diff --git a/pymeos_cffi/pymeos_cffi/builder/templates/functions.py b/pymeos_cffi/pymeos_cffi/builder/templates/functions.py deleted file mode 100644 index e79c4f88..00000000 --- a/pymeos_cffi/pymeos_cffi/builder/templates/functions.py +++ /dev/null @@ -1,145 +0,0 @@ -import logging -import os - -from datetime import datetime, timedelta, date -from typing import Any, Tuple, Optional, List - -import _meos_cffi -import shapely.geometry as spg -from dateutil.parser import parse -from shapely import wkt, get_srid, set_srid -from shapely.geometry.base import BaseGeometry - -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 - -logger = logging.getLogger("pymeos_cffi") - - -def _check_error() -> None: - global _error, _error_level, _error_message - if _error is not None: - error = _error - error_level = _error_level - error_message = _error_message - _error = None - _error_level = None - _error_message = None - report_meos_exception(error_level, error, error_message) - - -@_ffi.def_extern() -def py_error_handler(error_level, error_code, error_msg): - global _error, _error_level, _error_message - _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}" - ) - - -def create_pointer(object: "Any", type: str) -> "Any *": - return _ffi.new(f"{type} *", object) - - -def get_address(value: "Any") -> "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 timestamptz_to_datetime(ts: "TimestampTz") -> datetime: - return parse(pg_timestamptz_out(ts)) - - -def date_to_date_adt(dt: date) -> "DateADT": - return _lib.pg_date_in(dt.strftime("%Y-%m-%d").encode("utf-8")) - - -def date_adt_to_date(ts: "DateADT") -> date: - return parse(pg_date_out(ts)).date() - - -def timedelta_to_interval(td: timedelta) -> Any: - return _ffi.new( - "Interval *", - {"time": td.microseconds + td.seconds * 1000000, "day": td.days, "month": 0}, - ) - - -def interval_to_timedelta(interval: Any) -> timedelta: - # TODO fix for months/years - return timedelta(days=interval.day, microseconds=interval.time) - - -def geo_to_gserialized(geom: BaseGeometry, geodetic: bool) -> "GSERIALIZED *": - if geodetic: - return geography_to_gserialized(geom) - else: - return geometry_to_gserialized(geom) - - -def geometry_to_gserialized(geom: BaseGeometry) -> "GSERIALIZED *": - text = wkt.dumps(geom) - if get_srid(geom) > 0: - text = f"SRID={get_srid(geom)};{text}" - gs = pgis_geometry_in(text, -1) - return gs - - -def geography_to_gserialized(geom: BaseGeometry) -> "GSERIALIZED *": - text = wkt.dumps(geom) - if get_srid(geom) > 0: - text = f"SRID={get_srid(geom)};{text}" - gs = pgis_geography_in(text, -1) - return gs - - -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) - if srid > 0: - geometry = set_srid(geometry, srid) - return geometry - - -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) - if srid > 0: - geometry = set_srid(geometry, srid) - return geometry - - -def as_tinstant(temporal: "Temporal *") -> "TInstant *": - return _ffi.cast("TInstant *", temporal) - - -def as_tsequence(temporal: "Temporal *") -> "TSequence *": - return _ffi.cast("TSequence *", temporal) - - -def as_tsequenceset(temporal: "Temporal *") -> "TSequenceSet *": - return _ffi.cast("TSequenceSet *", temporal) - - -# ----------------------------------------------------------------------------- -# ----------------------End of manually-defined functions---------------------- -# ----------------------------------------------------------------------------- diff --git a/pymeos_cffi/pymeos_cffi/builder/templates/init.py b/pymeos_cffi/pymeos_cffi/builder/templates/init.py deleted file mode 100644 index 49f146eb..00000000 --- a/pymeos_cffi/pymeos_cffi/builder/templates/init.py +++ /dev/null @@ -1,38 +0,0 @@ -from .functions import * -from .enums import * -from .errors import * - -__version__ = "1.1.1" -__all__ = [ - # Exceptions - "MeosException", - "MeosInternalError", - "MeosArgumentError", - "MeosIoError", - "MeosInternalTypeError", - "MeosValueOutOfRangeError", - "MeosDivisionByZeroError", - "MeosMemoryAllocError", - "MeosAggregationError", - "MeosDirectoryError", - "MeosFileError", - "MeosInvalidArgError", - "MeosInvalidArgTypeError", - "MeosInvalidArgValueError", - "MeosMfJsonInputError", - "MeosMfJsonOutputError", - "MeosTextInputError", - "MeosTextOutputError", - "MeosWkbInputError", - "MeosWkbOutputError", - "MeosGeoJsonInputError", - "MeosGeoJsonOutputError", - # Enums - "MeosType", - "MeosTemporalSubtype", - "MeosOperation", - "InterpolationType", - "SpatialRelation", - # Functions - FUNCTIONS_REPLACE, -] diff --git a/pymeos_cffi/pymeos_cffi/enums.py b/pymeos_cffi/pymeos_cffi/enums.py deleted file mode 100644 index 18b29030..00000000 --- a/pymeos_cffi/pymeos_cffi/enums.py +++ /dev/null @@ -1,129 +0,0 @@ -from _meos_cffi import lib as _lib -from enum import IntEnum - - -class MeosType(IntEnum): - T_UNKNOWN = _lib.T_UNKNOWN - T_BOOL = _lib.T_BOOL - T_DATE = _lib.T_DATE - T_DATEMULTIRANGE = _lib.T_DATEMULTIRANGE - T_DATERANGE = _lib.T_DATERANGE - T_DATESET = _lib.T_DATESET - T_DATESPAN = _lib.T_DATESPAN - T_DATESPANSET = _lib.T_DATESPANSET - T_DOUBLE2 = _lib.T_DOUBLE2 - T_DOUBLE3 = _lib.T_DOUBLE3 - T_DOUBLE4 = _lib.T_DOUBLE4 - T_FLOAT8 = _lib.T_FLOAT8 - T_FLOATSET = _lib.T_FLOATSET - T_FLOATSPAN = _lib.T_FLOATSPAN - T_FLOATSPANSET = _lib.T_FLOATSPANSET - T_INT4 = _lib.T_INT4 - T_INT4MULTIRANGE = _lib.T_INT4MULTIRANGE - T_INT4RANGE = _lib.T_INT4RANGE - T_INTSET = _lib.T_INTSET - T_INTSPAN = _lib.T_INTSPAN - T_INTSPANSET = _lib.T_INTSPANSET - T_INT8 = _lib.T_INT8 - T_BIGINTSET = _lib.T_BIGINTSET - T_BIGINTSPAN = _lib.T_BIGINTSPAN - T_BIGINTSPANSET = _lib.T_BIGINTSPANSET - T_STBOX = _lib.T_STBOX - T_TBOOL = _lib.T_TBOOL - T_TBOX = _lib.T_TBOX - T_TDOUBLE2 = _lib.T_TDOUBLE2 - T_TDOUBLE3 = _lib.T_TDOUBLE3 - T_TDOUBLE4 = _lib.T_TDOUBLE4 - T_TEXT = _lib.T_TEXT - T_TEXTSET = _lib.T_TEXTSET - T_TFLOAT = _lib.T_TFLOAT - T_TIMESTAMPTZ = _lib.T_TIMESTAMPTZ - T_TINT = _lib.T_TINT - T_TSTZMULTIRANGE = _lib.T_TSTZMULTIRANGE - T_TSTZRANGE = _lib.T_TSTZRANGE - T_TSTZSET = _lib.T_TSTZSET - T_TSTZSPAN = _lib.T_TSTZSPAN - T_TSTZSPANSET = _lib.T_TSTZSPANSET - T_TTEXT = _lib.T_TTEXT - T_GEOMETRY = _lib.T_GEOMETRY - T_GEOMSET = _lib.T_GEOMSET - T_GEOGRAPHY = _lib.T_GEOGRAPHY - T_GEOGSET = _lib.T_GEOGSET - T_TGEOMPOINT = _lib.T_TGEOMPOINT - T_TGEOGPOINT = _lib.T_TGEOGPOINT - T_NPOINT = _lib.T_NPOINT - T_NPOINTSET = _lib.T_NPOINTSET - T_NSEGMENT = _lib.T_NSEGMENT - T_TNPOINT = _lib.T_TNPOINT - - -class MeosTemporalSubtype(IntEnum): - ANY = _lib.ANYTEMPSUBTYPE - INSTANT = _lib.TINSTANT - SEQUENCE = _lib.TSEQUENCE - SEQUENCE_SET = _lib.TSEQUENCESET - - -class MeosOperation(IntEnum): - UNKNOWN_OP = _lib.UNKNOWN_OP - EQ_OP = _lib.EQ_OP - NE_OP = _lib.NE_OP - LT_OP = _lib.LT_OP - LE_OP = _lib.LE_OP - GT_OP = _lib.GT_OP - GE_OP = _lib.GE_OP - ADJACENT_OP = _lib.ADJACENT_OP - UNION_OP = _lib.UNION_OP - MINUS_OP = _lib.MINUS_OP - INTERSECT_OP = _lib.INTERSECT_OP - OVERLAPS_OP = _lib.OVERLAPS_OP - CONTAINS_OP = _lib.CONTAINS_OP - CONTAINED_OP = _lib.CONTAINED_OP - SAME_OP = _lib.SAME_OP - LEFT_OP = _lib.LEFT_OP - OVERLEFT_OP = _lib.OVERLEFT_OP - RIGHT_OP = _lib.RIGHT_OP - OVERRIGHT_OP = _lib.OVERRIGHT_OP - BELOW_OP = _lib.BELOW_OP - OVERBELOW_OP = _lib.OVERBELOW_OP - ABOVE_OP = _lib.ABOVE_OP - OVERABOVE_OP = _lib.OVERABOVE_OP - FRONT_OP = _lib.FRONT_OP - OVERFRONT_OP = _lib.OVERFRONT_OP - BACK_OP = _lib.BACK_OP - OVERBACK_OP = _lib.OVERBACK_OP - BEFORE_OP = _lib.BEFORE_OP - OVERBEFORE_OP = _lib.OVERBEFORE_OP - AFTER_OP = _lib.AFTER_OP - OVERAFTER_OP = _lib.OVERAFTER_OP - EVEREQ_OP = _lib.EVEREQ_OP - EVERNE_OP = _lib.EVERNE_OP - EVERLT_OP = _lib.EVERLT_OP - EVERLE_OP = _lib.EVERLE_OP - EVERGT_OP = _lib.EVERGT_OP - EVERGE_OP = _lib.EVERGE_OP - ALWAYSEQ_OP = _lib.ALWAYSEQ_OP - ALWAYSNE_OP = _lib.ALWAYSNE_OP - ALWAYSLT_OP = _lib.ALWAYSLT_OP - ALWAYSLE_OP = _lib.ALWAYSLE_OP - ALWAYSGT_OP = _lib.ALWAYSGT_OP - ALWAYSGE_OP = _lib.ALWAYSGE_OP - - -class InterpolationType(IntEnum): - NONE = _lib.INTERP_NONE - DISCRETE = _lib.DISCRETE - STEP = _lib.STEP - LINEAR = _lib.LINEAR - - -class SpatialRelation(IntEnum): - INTERSECTS = _lib.INTERSECTS - CONTAINS = _lib.CONTAINS - TOUCHES = _lib.TOUCHES - - -class ErrorLevel(IntEnum): - NOTICE = 18 - WARNING = 19 - ERROR = 21 diff --git a/pymeos_cffi/pymeos_cffi/errors.py b/pymeos_cffi/pymeos_cffi/errors.py deleted file mode 100644 index b003c6d8..00000000 --- a/pymeos_cffi/pymeos_cffi/errors.py +++ /dev/null @@ -1,181 +0,0 @@ -import logging -from _meos_cffi import lib as _lib -from .enums import ErrorLevel - -logger = logging.getLogger("pymeos_cffi") - - -class MeosException(Exception): - """Base class for all MEOS errors.""" - - def __init__(self, code: int, message: str): - super().__init__(message) - self.message = message - self.code = code - - def __str__(self): - return f"{self.__class__.__name__} ({self.code}): {self.message}" - - -class MeosInternalError(MeosException): - """Superclass for internal errors.""" - - pass - - -class MeosArgumentError(MeosException): - """Superclass for invalid argument errors.""" - - pass - - -class MeosIoError(MeosException, IOError): - """Unspecified internal error.""" - - pass - - -class MeosInternalTypeError(MeosInternalError, TypeError): - """Internal type error.""" - - pass - - -class MeosValueOutOfRangeError(MeosInternalError, IndexError): - """Internal out of range error.""" - - pass - - -class MeosDivisionByZeroError(MeosInternalError, ZeroDivisionError): - """Internal division by zero error.""" - - pass - - -class MeosMemoryAllocError(MeosInternalError, MemoryError): - """Internal malloc error.""" - - pass - - -class MeosAggregationError(MeosInternalError): - """Internal aggregation error.""" - - pass - - -class MeosDirectoryError(MeosInternalError): - """Internal directory error.""" - - pass - - -class MeosFileError(MeosInternalError): - """Internal file error.""" - - pass - - -class MeosInvalidArgError(MeosArgumentError): - """Invalid argument.""" - - pass - - -class MeosInvalidArgTypeError(MeosArgumentError, TypeError): - """Invalid argument type.""" - - pass - - -class MeosInvalidArgValueError(MeosArgumentError, ValueError): - """Invalid argument value.""" - - pass - - -class MeosMfJsonInputError(MeosIoError): - """MFJSON input error.""" - - pass - - -class MeosMfJsonOutputError(MeosIoError): - """MFJSON output error.""" - - pass - - -class MeosTextInputError(MeosIoError): - """Text input error.""" - - pass - - -class MeosTextOutputError(MeosIoError): - """Text output error.""" - - pass - - -class MeosWkbInputError(MeosIoError): - """WKB input error.""" - - pass - - -class MeosWkbOutputError(MeosIoError): - """WKB output error.""" - - pass - - -class MeosGeoJsonInputError(MeosIoError): - """GEOJSON input error.""" - - pass - - -class MeosGeoJsonOutputError(MeosIoError): - """GEOJSON output error.""" - - pass - - -_exception_map = { - _lib.MEOS_ERR_INTERNAL_ERROR: MeosInternalError, - _lib.MEOS_ERR_INTERNAL_TYPE_ERROR: MeosInternalTypeError, - _lib.MEOS_ERR_VALUE_OUT_OF_RANGE: MeosValueOutOfRangeError, - _lib.MEOS_ERR_DIVISION_BY_ZERO: MeosDivisionByZeroError, - _lib.MEOS_ERR_MEMORY_ALLOC_ERROR: MeosMemoryAllocError, - _lib.MEOS_ERR_AGGREGATION_ERROR: MeosAggregationError, - _lib.MEOS_ERR_DIRECTORY_ERROR: MeosDirectoryError, - _lib.MEOS_ERR_FILE_ERROR: MeosFileError, - _lib.MEOS_ERR_INVALID_ARG: MeosInvalidArgError, - _lib.MEOS_ERR_INVALID_ARG_TYPE: MeosInvalidArgTypeError, - _lib.MEOS_ERR_INVALID_ARG_VALUE: MeosInvalidArgValueError, - _lib.MEOS_ERR_MFJSON_INPUT: MeosMfJsonInputError, - _lib.MEOS_ERR_MFJSON_OUTPUT: MeosMfJsonOutputError, - _lib.MEOS_ERR_TEXT_INPUT: MeosTextInputError, - _lib.MEOS_ERR_TEXT_OUTPUT: MeosTextOutputError, - _lib.MEOS_ERR_WKB_INPUT: MeosWkbInputError, - _lib.MEOS_ERR_WKB_OUTPUT: MeosWkbOutputError, - _lib.MEOS_ERR_GEOJSON_INPUT: MeosGeoJsonInputError, - _lib.MEOS_ERR_GEOJSON_OUTPUT: MeosGeoJsonOutputError, -} - - -def report_meos_exception(level: int, code: int, message: str): - exception_class = _exception_map.get(code, MeosException) - exception = exception_class(code, message) - if level == ErrorLevel.NOTICE: - logger.info("MEOS NOTICE: ", exc_info=exception) - elif level == ErrorLevel.WARNING: - logger.warning("MEOS WARNING: ", exc_info=exception) - elif level == ErrorLevel.ERROR: - logger.error("MEOS ERROR: ", exc_info=exception) - raise exception - else: - logger.error(f"Error raised with unknown level {level}: {exception}") - raise exception diff --git a/pymeos_cffi/pymeos_cffi/functions.py b/pymeos_cffi/pymeos_cffi/functions.py deleted file mode 100644 index 4151409a..00000000 --- a/pymeos_cffi/pymeos_cffi/functions.py +++ /dev/null @@ -1,17743 +0,0 @@ -import logging -import os - -from datetime import datetime, timedelta, date -from typing import Any, Tuple, Optional, List - -import _meos_cffi -import shapely.geometry as spg -from dateutil.parser import parse -from shapely import wkt, get_srid, set_srid -from shapely.geometry.base import BaseGeometry - -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 - -logger = logging.getLogger("pymeos_cffi") - - -def _check_error() -> None: - global _error, _error_level, _error_message - if _error is not None: - error = _error - error_level = _error_level - error_message = _error_message - _error = None - _error_level = None - _error_message = None - report_meos_exception(error_level, error, error_message) - - -@_ffi.def_extern() -def py_error_handler(error_level, error_code, error_msg): - global _error, _error_level, _error_message - _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}" - ) - - -def create_pointer(object: "Any", type: str) -> "Any *": - return _ffi.new(f"{type} *", object) - - -def get_address(value: "Any") -> "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 timestamptz_to_datetime(ts: "TimestampTz") -> datetime: - return parse(pg_timestamptz_out(ts)) - - -def date_to_date_adt(dt: date) -> "DateADT": - return _lib.pg_date_in(dt.strftime("%Y-%m-%d").encode("utf-8")) - - -def date_adt_to_date(ts: "DateADT") -> date: - return parse(pg_date_out(ts)).date() - - -def timedelta_to_interval(td: timedelta) -> Any: - return _ffi.new( - "Interval *", - {"time": td.microseconds + td.seconds * 1000000, "day": td.days, "month": 0}, - ) - - -def interval_to_timedelta(interval: Any) -> timedelta: - # TODO fix for months/years - return timedelta(days=interval.day, microseconds=interval.time) - - -def geo_to_gserialized(geom: BaseGeometry, geodetic: bool) -> "GSERIALIZED *": - if geodetic: - return geography_to_gserialized(geom) - else: - return geometry_to_gserialized(geom) - - -def geometry_to_gserialized(geom: BaseGeometry) -> "GSERIALIZED *": - text = wkt.dumps(geom) - if get_srid(geom) > 0: - text = f"SRID={get_srid(geom)};{text}" - gs = pgis_geometry_in(text, -1) - return gs - - -def geography_to_gserialized(geom: BaseGeometry) -> "GSERIALIZED *": - text = wkt.dumps(geom) - if get_srid(geom) > 0: - text = f"SRID={get_srid(geom)};{text}" - gs = pgis_geography_in(text, -1) - return gs - - -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) - if srid > 0: - geometry = set_srid(geometry, srid) - return geometry - - -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) - if srid > 0: - geometry = set_srid(geometry, srid) - return geometry - - -def as_tinstant(temporal: "Temporal *") -> "TInstant *": - return _ffi.cast("TInstant *", temporal) - - -def as_tsequence(temporal: "Temporal *") -> "TSequence *": - return _ffi.cast("TSequence *", temporal) - - -def as_tsequenceset(temporal: "Temporal *") -> "TSequenceSet *": - return _ffi.cast("TSequenceSet *", temporal) - - -# ----------------------------------------------------------------------------- -# ----------------------End of manually-defined functions---------------------- -# ----------------------------------------------------------------------------- -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": - result = _lib.meos_errno() - _check_error() - return result if result != _ffi.NULL else None - - -def meos_errno_set(err: 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": - result = _lib.meos_errno_restore(err) - _check_error() - return result if result != _ffi.NULL else None - - -def meos_errno_reset() -> "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": - newval_converted = newval.encode("utf-8") - extra_converted = _ffi.cast("void *", extra) - result = _lib.meos_set_datestyle(newval_converted, extra_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def meos_set_intervalstyle(newval: str, extra: "Optional[int]") -> "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) - _check_error() - return result if result != _ffi.NULL else None - - -def meos_get_datestyle() -> str: - 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: - 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: - if "PROJ_DATA" not in os.environ and "PROJ_LIB" not in os.environ: - # Assume we are in a wheel and the PROJ data is in the package - proj_dir = os.path.join(os.path.dirname(__file__), "proj_data") - os.environ["PROJ_DATA"] = proj_dir - os.environ["PROJ_LIB"] = proj_dir - - tz_str_converted = tz_str.encode("utf-8") if tz_str is not None else _ffi.NULL - _lib.meos_initialize(tz_str_converted, _lib.py_error_handler) - - -def meos_finalize() -> None: - _lib.meos_finalize() - _check_error() - - -def add_date_int(d: "DateADT", days: int) -> "DateADT": - d_converted = _ffi.cast("DateADT", d) - days_converted = _ffi.cast("int32", days) - result = _lib.add_date_int(d_converted, days_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def add_interval_interval( - interv1: "const Interval *", interv2: "const Interval *" -) -> "Interval *": - interv1_converted = _ffi.cast("const Interval *", interv1) - interv2_converted = _ffi.cast("const Interval *", interv2) - result = _lib.add_interval_interval(interv1_converted, interv2_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def add_timestamptz_interval(t: int, interv: "const Interval *") -> "TimestampTz": - t_converted = _ffi.cast("TimestampTz", t) - interv_converted = _ffi.cast("const Interval *", interv) - result = _lib.add_timestamptz_interval(t_converted, interv_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def bool_in(string: str) -> "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: - result = _lib.bool_out(b) - _check_error() - result = _ffi.string(result).decode("utf-8") - return result if result != _ffi.NULL else None - - -def cstring2text(cstring: str) -> "text *": - cstring_converted = cstring.encode("utf-8") - result = _lib.cstring2text(cstring_converted) - return result - - -def date_to_timestamptz(d: "DateADT") -> "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 *": - d1_converted = _ffi.cast("DateADT", d1) - d2_converted = _ffi.cast("DateADT", d2) - result = _lib.minus_date_date(d1_converted, d2_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def minus_date_int(d: "DateADT", days: int) -> "DateADT": - d_converted = _ffi.cast("DateADT", d) - days_converted = _ffi.cast("int32", days) - result = _lib.minus_date_int(d_converted, days_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def minus_timestamptz_interval(t: int, interv: "const Interval *") -> "TimestampTz": - t_converted = _ffi.cast("TimestampTz", t) - interv_converted = _ffi.cast("const Interval *", interv) - result = _lib.minus_timestamptz_interval(t_converted, interv_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def minus_timestamptz_timestamptz(t1: int, t2: int) -> "Interval *": - t1_converted = _ffi.cast("TimestampTz", t1) - t2_converted = _ffi.cast("TimestampTz", t2) - result = _lib.minus_timestamptz_timestamptz(t1_converted, t2_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def mult_interval_double(interv: "const Interval *", factor: float) -> "Interval *": - interv_converted = _ffi.cast("const Interval *", interv) - result = _lib.mult_interval_double(interv_converted, factor) - _check_error() - return result if result != _ffi.NULL else None - - -def pg_date_in(string: str) -> "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: "DateADT") -> str: - 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: "const Interval *", interv2: "const Interval *") -> "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) -> "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_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.pg_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 pg_interval_out(interv: "const Interval *") -> str: - interv_converted = _ffi.cast("const Interval *", interv) - 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_time_in(string: str, typmod: int) -> "TimeADT": - string_converted = string.encode("utf-8") - typmod_converted = _ffi.cast("int32", typmod) - result = _lib.pg_time_in(string_converted, typmod_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def pg_time_out(t: "TimeADT") -> str: - t_converted = _ffi.cast("TimeADT", t) - result = _lib.pg_time_out(t_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) -> "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) -> str: - 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) -> "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) -> str: - 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 - - -def text2cstring(textptr: "text *") -> str: - result = _lib.text2cstring(textptr) - result = _ffi.string(result).decode("utf-8") - return result - - -def text_cmp(txt1: str, txt2: str) -> "int": - txt1_converted = cstring2text(txt1) - txt2_converted = cstring2text(txt2) - result = _lib.text_cmp(txt1_converted, txt2_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def text_copy(txt: str) -> str: - txt_converted = cstring2text(txt) - result = _lib.text_copy(txt_converted) - _check_error() - result = text2cstring(result) - return result if result != _ffi.NULL else None - - -def text_initcap(txt: str) -> str: - txt_converted = cstring2text(txt) - result = _lib.text_initcap(txt_converted) - _check_error() - result = text2cstring(result) - return result if result != _ffi.NULL else None - - -def text_lower(txt: str) -> str: - txt_converted = cstring2text(txt) - result = _lib.text_lower(txt_converted) - _check_error() - result = text2cstring(result) - return result if result != _ffi.NULL else None - - -def text_out(txt: str) -> str: - txt_converted = cstring2text(txt) - result = _lib.text_out(txt_converted) - _check_error() - result = _ffi.string(result).decode("utf-8") - return result if result != _ffi.NULL else None - - -def text_upper(txt: str) -> str: - txt_converted = cstring2text(txt) - result = _lib.text_upper(txt_converted) - _check_error() - result = text2cstring(result) - return result if result != _ffi.NULL else None - - -def textcat_text_text(txt1: str, txt2: str) -> str: - txt1_converted = cstring2text(txt1) - txt2_converted = cstring2text(txt2) - result = _lib.textcat_text_text(txt1_converted, txt2_converted) - _check_error() - result = text2cstring(result) - return result if result != _ffi.NULL else None - - -def timestamptz_to_date(t: 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 geo_as_ewkb(gs: "const GSERIALIZED *", endian: str) -> "bytea *": - gs_converted = _ffi.cast("const GSERIALIZED *", gs) - endian_converted = endian.encode("utf-8") - result = _lib.geo_as_ewkb(gs_converted, endian_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def geo_as_ewkt(gs: "const GSERIALIZED *", precision: int) -> str: - 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 geo_as_geojson( - gs: "const GSERIALIZED *", option: int, precision: int, srs: "Optional[str]" -) -> str: - 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 geo_as_hexewkb(gs: "const GSERIALIZED *", endian: str) -> str: - 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 geo_as_text(gs: "const GSERIALIZED *", precision: int) -> str: - 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 geo_from_ewkb(bytea_wkb: "const bytea *", srid: int) -> "GSERIALIZED *": - bytea_wkb_converted = _ffi.cast("const bytea *", bytea_wkb) - srid_converted = _ffi.cast("int32", srid) - result = _lib.geo_from_ewkb(bytea_wkb_converted, srid_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def geo_from_geojson(geojson: str) -> "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 geo_out(gs: "const GSERIALIZED *") -> str: - gs_converted = _ffi.cast("const GSERIALIZED *", gs) - result = _lib.geo_out(gs_converted) - _check_error() - result = _ffi.string(result).decode("utf-8") - return result if result != _ffi.NULL else None - - -def geo_same(gs1: "const GSERIALIZED *", gs2: "const GSERIALIZED *") -> "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 geography_from_hexewkb(wkt: str) -> "GSERIALIZED *": - wkt_converted = wkt.encode("utf-8") - result = _lib.geography_from_hexewkb(wkt_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def geography_from_text(wkt: str, srid: int) -> "GSERIALIZED *": - wkt_converted = wkt.encode("utf-8") - result = _lib.geography_from_text(wkt_converted, srid) - _check_error() - return result if result != _ffi.NULL else None - - -def geometry_from_hexewkb(wkt: str) -> "GSERIALIZED *": - wkt_converted = wkt.encode("utf-8") - result = _lib.geometry_from_hexewkb(wkt_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def geometry_from_text(wkt: str, srid: int) -> "GSERIALIZED *": - wkt_converted = wkt.encode("utf-8") - result = _lib.geometry_from_text(wkt_converted, srid) - _check_error() - return result if result != _ffi.NULL else None - - -def pgis_geography_in(string: str, typmod: int) -> "GSERIALIZED *": - string_converted = string.encode("utf-8") - typmod_converted = _ffi.cast("int32", typmod) - result = _lib.pgis_geography_in(string_converted, typmod_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def pgis_geometry_in(string: str, typmod: int) -> "GSERIALIZED *": - string_converted = string.encode("utf-8") - typmod_converted = _ffi.cast("int32", typmod) - result = _lib.pgis_geometry_in(string_converted, typmod_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def bigintset_in(string: str) -> "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: - set_converted = _ffi.cast("const Set *", set) - result = _lib.bigintset_out(set_converted) - _check_error() - result = _ffi.string(result).decode("utf-8") - return result if result != _ffi.NULL else None - - -def bigintspan_in(string: str) -> "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: - s_converted = _ffi.cast("const Span *", s) - result = _lib.bigintspan_out(s_converted) - _check_error() - result = _ffi.string(result).decode("utf-8") - return result if result != _ffi.NULL else None - - -def bigintspanset_in(string: str) -> "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: - ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.bigintspanset_out(ss_converted) - _check_error() - result = _ffi.string(result).decode("utf-8") - return result if result != _ffi.NULL else None - - -def dateset_in(string: str) -> "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: - s_converted = _ffi.cast("const Set *", s) - result = _lib.dateset_out(s_converted) - _check_error() - result = _ffi.string(result).decode("utf-8") - return result if result != _ffi.NULL else None - - -def datespan_in(string: str) -> "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: - s_converted = _ffi.cast("const Span *", s) - result = _lib.datespan_out(s_converted) - _check_error() - result = _ffi.string(result).decode("utf-8") - return result if result != _ffi.NULL else None - - -def datespanset_in(string: str) -> "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: - ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.datespanset_out(ss_converted) - _check_error() - result = _ffi.string(result).decode("utf-8") - return result if result != _ffi.NULL else None - - -def floatset_in(string: str) -> "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: - set_converted = _ffi.cast("const Set *", set) - result = _lib.floatset_out(set_converted, maxdd) - _check_error() - result = _ffi.string(result).decode("utf-8") - return result if result != _ffi.NULL else None - - -def floatspan_in(string: str) -> "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: - s_converted = _ffi.cast("const Span *", s) - result = _lib.floatspan_out(s_converted, maxdd) - _check_error() - result = _ffi.string(result).decode("utf-8") - return result if result != _ffi.NULL else None - - -def floatspanset_in(string: str) -> "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: - ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.floatspanset_out(ss_converted, maxdd) - _check_error() - result = _ffi.string(result).decode("utf-8") - 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 *": - 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: - set_converted = _ffi.cast("const Set *", set) - result = _lib.intset_out(set_converted) - _check_error() - result = _ffi.string(result).decode("utf-8") - return result if result != _ffi.NULL else None - - -def intspan_in(string: str) -> "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: - s_converted = _ffi.cast("const Span *", s) - result = _lib.intspan_out(s_converted) - _check_error() - result = _ffi.string(result).decode("utf-8") - return result if result != _ffi.NULL else None - - -def intspanset_in(string: str) -> "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: - ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.intspanset_out(ss_converted) - _check_error() - result = _ffi.string(result).decode("utf-8") - return result if result != _ffi.NULL else None - - -def set_as_hexwkb(s: "const Set *", variant: int) -> "Tuple[str, '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_hexwkb(s_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 set_as_wkb(s: "const Set *", variant: int) -> bytes: - 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 - ) - return result_converted - - -def set_from_hexwkb(hexwkb: str) -> "Set *": - hexwkb_converted = hexwkb.encode("utf-8") - result = _lib.set_from_hexwkb(hexwkb_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def set_from_wkb(wkb: bytes) -> "Set *": - wkb_converted = _ffi.new("uint8_t []", wkb) - result = _lib.set_from_wkb(wkb_converted, len(wkb)) - return result if result != _ffi.NULL else None - - -def span_as_hexwkb(s: "const Span *", variant: int) -> "Tuple[str, '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_hexwkb(s_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 span_as_wkb(s: "const Span *", variant: int) -> bytes: - 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 - ) - return result_converted - - -def span_from_hexwkb(hexwkb: str) -> "Span *": - hexwkb_converted = hexwkb.encode("utf-8") - result = _lib.span_from_hexwkb(hexwkb_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def span_from_wkb(wkb: bytes) -> "Span *": - wkb_converted = _ffi.new("uint8_t []", wkb) - result = _lib.span_from_wkb(wkb_converted, len(wkb)) - return result if result != _ffi.NULL else None - - -def spanset_as_hexwkb(ss: "const SpanSet *", variant: int) -> "Tuple[str, '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_hexwkb(ss_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 spanset_as_wkb(ss: "const SpanSet *", variant: int) -> bytes: - 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 - ) - return result_converted - - -def spanset_from_hexwkb(hexwkb: str) -> "SpanSet *": - hexwkb_converted = hexwkb.encode("utf-8") - result = _lib.spanset_from_hexwkb(hexwkb_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def spanset_from_wkb(wkb: bytes) -> "SpanSet *": - wkb_converted = _ffi.new("uint8_t []", wkb) - result = _lib.spanset_from_wkb(wkb_converted, len(wkb)) - return result if result != _ffi.NULL else None - - -def textset_in(string: str) -> "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: - set_converted = _ffi.cast("const Set *", set) - result = _lib.textset_out(set_converted) - _check_error() - result = _ffi.string(result).decode("utf-8") - return result if result != _ffi.NULL else None - - -def tstzset_in(string: str) -> "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: - set_converted = _ffi.cast("const Set *", set) - result = _lib.tstzset_out(set_converted) - _check_error() - result = _ffi.string(result).decode("utf-8") - return result if result != _ffi.NULL else None - - -def tstzspan_in(string: str) -> "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: - s_converted = _ffi.cast("const Span *", s) - result = _lib.tstzspan_out(s_converted) - _check_error() - result = _ffi.string(result).decode("utf-8") - return result if result != _ffi.NULL else None - - -def tstzspanset_in(string: str) -> "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: - ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.tstzspanset_out(ss_converted) - _check_error() - result = _ffi.string(result).decode("utf-8") - return result if result != _ffi.NULL else None - - -def bigintset_make(values: "List[const int64]") -> "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 *": - lower_converted = _ffi.cast("int64", lower) - upper_converted = _ffi.cast("int64", upper) - 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 *": - 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 *": - lower_converted = _ffi.cast("DateADT", lower) - upper_converted = _ffi.cast("DateADT", upper) - result = _lib.datespan_make(lower_converted, upper_converted, lower_inc, upper_inc) - _check_error() - return result if result != _ffi.NULL else None - - -def floatset_make(values: "List[const double]") -> "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 *": - 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 *": - 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 *": - 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 *": - 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 *": - 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 *": - 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, ordered: bool) -> "SpanSet *": - spans_converted = _ffi.new("Span []", spans) - result = _lib.spanset_make(spans_converted, len(spans), normalize, ordered) - _check_error() - return result if result != _ffi.NULL else None - - -def textset_make(values: List[str]) -> "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 *": - 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 *": - lower_converted = _ffi.cast("TimestampTz", lower) - upper_converted = _ffi.cast("TimestampTz", upper) - result = _lib.tstzspan_make(lower_converted, upper_converted, lower_inc, upper_inc) - _check_error() - return result if result != _ffi.NULL else None - - -def bigint_to_set(i: int) -> "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 *": - result = _lib.bigint_to_span(i) - _check_error() - return result if result != _ffi.NULL else None - - -def bigint_to_spanset(i: int) -> "SpanSet *": - result = _lib.bigint_to_spanset(i) - _check_error() - return result if result != _ffi.NULL else None - - -def date_to_set(d: "DateADT") -> "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 *": - 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 *": - 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 *": - 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 *": - 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 *": - 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 *": - result = _lib.float_to_set(d) - _check_error() - return result if result != _ffi.NULL else None - - -def float_to_span(d: float) -> "Span *": - result = _lib.float_to_span(d) - _check_error() - return result if result != _ffi.NULL else None - - -def float_to_spanset(d: float) -> "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 *": - 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 *": - 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 *": - 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 *": - result = _lib.int_to_set(i) - _check_error() - return result if result != _ffi.NULL else None - - -def int_to_span(i: int) -> "Span *": - result = _lib.int_to_span(i) - _check_error() - return result if result != _ffi.NULL else None - - -def int_to_spanset(i: int) -> "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 *": - 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 *": - 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 *": - 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 *": - 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 *": - 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 *": - 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 *": - 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 *": - 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 *": - 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 *": - 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 *": - 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 *": - 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": - 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": - 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": - s_converted = _ffi.cast("const Set *", s) - out_result = _ffi.new("int64 *") - result = _lib.bigintset_value_n(s_converted, n, out_result) - _check_error() - if result: - return out_result[0] if out_result[0] != _ffi.NULL else None - return None - - -def bigintset_values(s: "const Set *") -> "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": - 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": - 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": - 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": - 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": - 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": - 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": - 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": - 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 *": - s_converted = _ffi.cast("const Set *", s) - out_result = _ffi.new("DateADT *") - result = _lib.dateset_value_n(s_converted, n, out_result) - _check_error() - if result: - return out_result if out_result != _ffi.NULL else None - return None - - -def dateset_values(s: "const Set *") -> "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 *": - 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": - 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": - 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 *": - ss_converted = _ffi.cast("const SpanSet *", ss) - out_result = _ffi.new("DateADT *") - result = _lib.datespanset_date_n(ss_converted, n, out_result) - _check_error() - if result: - return out_result if out_result != _ffi.NULL else None - return None - - -def datespanset_dates(ss: "const SpanSet *") -> "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 *": - 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": - 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": - 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": - 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": - 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": - 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": - s_converted = _ffi.cast("const Set *", s) - out_result = _ffi.new("double *") - result = _lib.floatset_value_n(s_converted, n, out_result) - _check_error() - if result: - return out_result[0] if out_result[0] != _ffi.NULL else None - return None - - -def floatset_values(s: "const Set *") -> "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": - 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": - 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": - 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": - 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": - 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": - 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 *") -> "int": - 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": - 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": - 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": - s_converted = _ffi.cast("const Set *", s) - out_result = _ffi.new("int *") - result = _lib.intset_value_n(s_converted, n, out_result) - _check_error() - if result: - return out_result[0] if out_result[0] != _ffi.NULL else None - return None - - -def intset_values(s: "const Set *") -> "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": - 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": - 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": - 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": - 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": - 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": - 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": - 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": - s_converted = _ffi.cast("const Set *", s) - seed_converted = _ffi.cast("uint64", seed) - result = _lib.set_hash_extended(s_converted, seed_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def set_num_values(s: "const Set *") -> "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": - 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": - s_converted = _ffi.cast("const Span *", s) - seed_converted = _ffi.cast("uint64", seed) - result = _lib.span_hash_extended(s_converted, seed_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def span_lower_inc(s: "const Span *") -> "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": - 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 *": - 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": - 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": - ss_converted = _ffi.cast("const SpanSet *", ss) - seed_converted = _ffi.cast("uint64", seed) - result = _lib.spanset_hash_extended(ss_converted, seed_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def spanset_lower_inc(ss: "const SpanSet *") -> "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": - 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 *": - 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 *": - 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_spans(ss: "const SpanSet *") -> "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_start_span(ss: "const SpanSet *") -> "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": - 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: - s_converted = _ffi.cast("const Set *", s) - result = _lib.textset_end_value(s_converted) - _check_error() - result = text2cstring(result) - return result if result != _ffi.NULL else None - - -def textset_start_value(s: "const Set *") -> str: - s_converted = _ffi.cast("const Set *", s) - result = _lib.textset_start_value(s_converted) - _check_error() - result = text2cstring(result) - return result if result != _ffi.NULL else None - - -def textset_value_n(s: "const Set *", n: int) -> "text **": - s_converted = _ffi.cast("const Set *", s) - out_result = _ffi.new("text **") - result = _lib.textset_value_n(s_converted, n, out_result) - _check_error() - if result: - return out_result if out_result != _ffi.NULL else None - return None - - -def textset_values(s: "const Set *") -> "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": - 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": - 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: - s_converted = _ffi.cast("const Set *", s) - out_result = _ffi.new("TimestampTz *") - result = _lib.tstzset_value_n(s_converted, n, out_result) - _check_error() - if result: - return out_result[0] if out_result[0] != _ffi.NULL else None - return None - - -def tstzset_values(s: "const Set *") -> "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 *": - 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": - 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": - 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 *": - 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": - 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": - 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": - 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": - 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: - ss_converted = _ffi.cast("const SpanSet *", ss) - out_result = _ffi.new("TimestampTz *") - result = _lib.tstzspanset_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 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": - ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.tstzspanset_upper(ss_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def bigintset_shift_scale( - s: "const Set *", shift: int, width: int, hasshift: bool, haswidth: bool -) -> "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 - ) - _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_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 - ) - _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_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 - ) - _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_converted = _ffi.cast("const Set *", s) - result = _lib.dateset_shift_scale(s_converted, shift, width, hasshift, haswidth) - _check_error() - return result if result != _ffi.NULL else None - - -def datespan_shift_scale( - s: "const Span *", shift: int, width: int, hasshift: bool, haswidth: bool -) -> "Span *": - s_converted = _ffi.cast("const Span *", s) - result = _lib.datespan_shift_scale(s_converted, shift, width, hasshift, haswidth) - _check_error() - return result if result != _ffi.NULL else None - - -def datespanset_shift_scale( - ss: "const SpanSet *", shift: int, width: int, hasshift: bool, haswidth: bool -) -> "SpanSet *": - ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.datespanset_shift_scale( - ss_converted, shift, width, hasshift, haswidth - ) - _check_error() - return result if result != _ffi.NULL else None - - -def floatset_degrees(s: "const Set *", normalize: bool) -> "Set *": - s_converted = _ffi.cast("const Set *", s) - result = _lib.floatset_degrees(s_converted, normalize) - _check_error() - return result if result != _ffi.NULL else None - - -def floatset_radians(s: "const Set *") -> "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 *": - s_converted = _ffi.cast("const Set *", s) - result = _lib.floatset_round(s_converted, maxdd) - _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) - _check_error() - return result if result != _ffi.NULL else None - - -def floatspan_round(s: "const Span *", maxdd: int) -> "Span *": - s_converted = _ffi.cast("const Span *", s) - result = _lib.floatspan_round(s_converted, maxdd) - _check_error() - return result if result != _ffi.NULL else None - - -def floatspan_shift_scale( - s: "const Span *", shift: float, width: float, hasshift: bool, haswidth: bool -) -> "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_round(ss: "const SpanSet *", maxdd: int) -> "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 floatspanset_shift_scale( - ss: "const SpanSet *", shift: float, width: float, hasshift: bool, haswidth: bool -) -> "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_round(s: "const Set *", maxdd: int) -> "Set *": - s_converted = _ffi.cast("const Set *", s) - result = _lib.geoset_round(s_converted, maxdd) - _check_error() - return result if result != _ffi.NULL else None - - -def geoset_set_srid(s: "const Set *", srid: int) -> "Set *": - s_converted = _ffi.cast("const Set *", s) - srid_converted = _ffi.cast("int32", srid) - result = _lib.geoset_set_srid(s_converted, srid_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def geoset_transform(s: "const Set *", srid: int) -> "Set *": - s_converted = _ffi.cast("const Set *", s) - srid_converted = _ffi.cast("int32", 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: int, is_forward: bool -) -> "Set *": - s_converted = _ffi.cast("const Set *", s) - pipelinestr_converted = pipelinestr.encode("utf-8") - srid_converted = _ffi.cast("int32", 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 point_transform(gs: "const GSERIALIZED *", srid: int) -> "GSERIALIZED *": - gs_converted = _ffi.cast("const GSERIALIZED *", gs) - srid_converted = _ffi.cast("int32", srid) - result = _lib.point_transform(gs_converted, srid_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def point_transform_pipeline( - gs: "const GSERIALIZED *", pipelinestr: str, srid: int, is_forward: bool -) -> "GSERIALIZED *": - gs_converted = _ffi.cast("const GSERIALIZED *", gs) - pipelinestr_converted = pipelinestr.encode("utf-8") - srid_converted = _ffi.cast("int32", srid) - result = _lib.point_transform_pipeline( - gs_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 *": - s_converted = _ffi.cast("const Set *", s) - result = _lib.intset_shift_scale(s_converted, shift, width, hasshift, haswidth) - _check_error() - return result if result != _ffi.NULL else None - - -def intspan_shift_scale( - s: "const Span *", shift: int, width: int, hasshift: bool, haswidth: bool -) -> "Span *": - s_converted = _ffi.cast("const Span *", s) - result = _lib.intspan_shift_scale(s_converted, shift, width, hasshift, haswidth) - _check_error() - return result if result != _ffi.NULL else None - - -def intspanset_shift_scale( - ss: "const SpanSet *", shift: int, width: int, hasshift: bool, haswidth: bool -) -> "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 textset_initcap(s: "const Set *") -> "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 *": - 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 *": - 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_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 - ) - _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_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 - ) - 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_converted = _ffi.cast("const Set *", s) - duration_converted = _ffi.cast("const Interval *", duration) - torigin_converted = _ffi.cast("TimestampTz", torigin) - result = _lib.tstzset_tprecision(s_converted, duration_converted, torigin_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def tstzspan_shift_scale( - s: "const Span *", - shift: "Optional['const Interval *']", - duration: "Optional['const Interval *']", -) -> "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 - ) - 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_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 - ) - _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_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 - ) - _check_error() - return result if result != _ffi.NULL else None - - -def tstzspanset_tprecision( - ss: "const SpanSet *", duration: "const Interval *", torigin: int -) -> "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 - ) - _check_error() - return result if result != _ffi.NULL else None - - -def set_cmp(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(s1_converted, s2_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def set_eq(s1: "const Set *", s2: "const Set *") -> "bool": - s1_converted = _ffi.cast("const Set *", s1) - s2_converted = _ffi.cast("const Set *", s2) - result = _lib.set_eq(s1_converted, s2_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def set_ge(s1: "const Set *", s2: "const Set *") -> "bool": - s1_converted = _ffi.cast("const Set *", s1) - s2_converted = _ffi.cast("const Set *", s2) - result = _lib.set_ge(s1_converted, s2_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def set_gt(s1: "const Set *", s2: "const Set *") -> "bool": - s1_converted = _ffi.cast("const Set *", s1) - s2_converted = _ffi.cast("const Set *", s2) - result = _lib.set_gt(s1_converted, s2_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def set_le(s1: "const Set *", s2: "const Set *") -> "bool": - s1_converted = _ffi.cast("const Set *", s1) - s2_converted = _ffi.cast("const Set *", s2) - result = _lib.set_le(s1_converted, s2_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def set_lt(s1: "const Set *", s2: "const Set *") -> "bool": - s1_converted = _ffi.cast("const Set *", s1) - s2_converted = _ffi.cast("const Set *", s2) - result = _lib.set_lt(s1_converted, s2_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def set_ne(s1: "const Set *", s2: "const Set *") -> "bool": - s1_converted = _ffi.cast("const Set *", s1) - s2_converted = _ffi.cast("const Set *", s2) - result = _lib.set_ne(s1_converted, s2_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def span_cmp(s1: "const Span *", s2: "const Span *") -> "int": - s1_converted = _ffi.cast("const Span *", s1) - s2_converted = _ffi.cast("const Span *", s2) - result = _lib.span_cmp(s1_converted, s2_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def span_eq(s1: "const Span *", s2: "const Span *") -> "bool": - s1_converted = _ffi.cast("const Span *", s1) - s2_converted = _ffi.cast("const Span *", s2) - result = _lib.span_eq(s1_converted, s2_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def span_ge(s1: "const Span *", s2: "const Span *") -> "bool": - s1_converted = _ffi.cast("const Span *", s1) - s2_converted = _ffi.cast("const Span *", s2) - result = _lib.span_ge(s1_converted, s2_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def span_gt(s1: "const Span *", s2: "const Span *") -> "bool": - s1_converted = _ffi.cast("const Span *", s1) - s2_converted = _ffi.cast("const Span *", s2) - result = _lib.span_gt(s1_converted, s2_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def span_le(s1: "const Span *", s2: "const Span *") -> "bool": - s1_converted = _ffi.cast("const Span *", s1) - s2_converted = _ffi.cast("const Span *", s2) - result = _lib.span_le(s1_converted, s2_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def span_lt(s1: "const Span *", s2: "const Span *") -> "bool": - s1_converted = _ffi.cast("const Span *", s1) - s2_converted = _ffi.cast("const Span *", s2) - result = _lib.span_lt(s1_converted, s2_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def span_ne(s1: "const Span *", s2: "const Span *") -> "bool": - s1_converted = _ffi.cast("const Span *", s1) - s2_converted = _ffi.cast("const Span *", s2) - result = _lib.span_ne(s1_converted, s2_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def spanset_cmp(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(ss1_converted, ss2_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def spanset_eq(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(ss1_converted, ss2_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def spanset_ge(ss1: "const SpanSet *", ss2: "const SpanSet *") -> "bool": - ss1_converted = _ffi.cast("const SpanSet *", ss1) - ss2_converted = _ffi.cast("const SpanSet *", ss2) - result = _lib.spanset_ge(ss1_converted, ss2_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def spanset_gt(ss1: "const SpanSet *", ss2: "const SpanSet *") -> "bool": - ss1_converted = _ffi.cast("const SpanSet *", ss1) - ss2_converted = _ffi.cast("const SpanSet *", ss2) - result = _lib.spanset_gt(ss1_converted, ss2_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def spanset_le(ss1: "const SpanSet *", ss2: "const SpanSet *") -> "bool": - ss1_converted = _ffi.cast("const SpanSet *", ss1) - ss2_converted = _ffi.cast("const SpanSet *", ss2) - result = _lib.spanset_le(ss1_converted, ss2_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def spanset_lt(ss1: "const SpanSet *", ss2: "const SpanSet *") -> "bool": - ss1_converted = _ffi.cast("const SpanSet *", ss1) - ss2_converted = _ffi.cast("const SpanSet *", ss2) - result = _lib.spanset_lt(ss1_converted, ss2_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def spanset_ne(ss1: "const SpanSet *", ss2: "const SpanSet *") -> "bool": - ss1_converted = _ffi.cast("const SpanSet *", ss1) - ss2_converted = _ffi.cast("const SpanSet *", ss2) - result = _lib.spanset_ne(ss1_converted, ss2_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def adjacent_span_bigint(s: "const Span *", i: int) -> "bool": - s_converted = _ffi.cast("const Span *", s) - i_converted = _ffi.cast("int64", i) - result = _lib.adjacent_span_bigint(s_converted, i_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def adjacent_span_date(s: "const Span *", d: "DateADT") -> "bool": - s_converted = _ffi.cast("const Span *", s) - d_converted = _ffi.cast("DateADT", d) - result = _lib.adjacent_span_date(s_converted, d_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def adjacent_span_float(s: "const Span *", d: float) -> "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": - 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": - s1_converted = _ffi.cast("const Span *", s1) - s2_converted = _ffi.cast("const Span *", s2) - result = _lib.adjacent_span_span(s1_converted, s2_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def adjacent_span_spanset(s: "const Span *", ss: "const SpanSet *") -> "bool": - s_converted = _ffi.cast("const Span *", s) - ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.adjacent_span_spanset(s_converted, ss_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def adjacent_span_timestamptz(s: "const Span *", t: int) -> "bool": - s_converted = _ffi.cast("const Span *", s) - t_converted = _ffi.cast("TimestampTz", t) - result = _lib.adjacent_span_timestamptz(s_converted, t_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def adjacent_spanset_bigint(ss: "const SpanSet *", i: int) -> "bool": - ss_converted = _ffi.cast("const SpanSet *", ss) - i_converted = _ffi.cast("int64", i) - result = _lib.adjacent_spanset_bigint(ss_converted, i_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def adjacent_spanset_date(ss: "const SpanSet *", d: "DateADT") -> "bool": - ss_converted = _ffi.cast("const SpanSet *", ss) - d_converted = _ffi.cast("DateADT", d) - result = _lib.adjacent_spanset_date(ss_converted, d_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def adjacent_spanset_float(ss: "const SpanSet *", d: float) -> "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": - 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": - ss_converted = _ffi.cast("const SpanSet *", ss) - t_converted = _ffi.cast("TimestampTz", t) - result = _lib.adjacent_spanset_timestamptz(ss_converted, t_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def adjacent_spanset_span(ss: "const SpanSet *", s: "const Span *") -> "bool": - ss_converted = _ffi.cast("const SpanSet *", ss) - s_converted = _ffi.cast("const Span *", s) - result = _lib.adjacent_spanset_span(ss_converted, s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def adjacent_spanset_spanset(ss1: "const SpanSet *", ss2: "const SpanSet *") -> "bool": - ss1_converted = _ffi.cast("const SpanSet *", ss1) - ss2_converted = _ffi.cast("const SpanSet *", ss2) - result = _lib.adjacent_spanset_spanset(ss1_converted, ss2_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def contained_bigint_set(i: int, s: "const Set *") -> "bool": - i_converted = _ffi.cast("int64", i) - s_converted = _ffi.cast("const Set *", s) - result = _lib.contained_bigint_set(i_converted, s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def contained_bigint_span(i: int, s: "const Span *") -> "bool": - i_converted = _ffi.cast("int64", i) - s_converted = _ffi.cast("const Span *", s) - result = _lib.contained_bigint_span(i_converted, s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def contained_bigint_spanset(i: int, ss: "const SpanSet *") -> "bool": - i_converted = _ffi.cast("int64", i) - ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.contained_bigint_spanset(i_converted, ss_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def contained_date_set(d: "DateADT", s: "const Set *") -> "bool": - d_converted = _ffi.cast("DateADT", d) - s_converted = _ffi.cast("const Set *", s) - result = _lib.contained_date_set(d_converted, s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def contained_date_span(d: "DateADT", s: "const Span *") -> "bool": - d_converted = _ffi.cast("DateADT", d) - s_converted = _ffi.cast("const Span *", s) - result = _lib.contained_date_span(d_converted, s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def contained_date_spanset(d: "DateADT", ss: "const SpanSet *") -> "bool": - d_converted = _ffi.cast("DateADT", d) - ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.contained_date_spanset(d_converted, ss_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def contained_float_set(d: float, s: "const Set *") -> "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": - 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": - 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": - 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": - 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": - 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": - s1_converted = _ffi.cast("const Set *", s1) - s2_converted = _ffi.cast("const Set *", s2) - result = _lib.contained_set_set(s1_converted, s2_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def contained_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.contained_span_span(s1_converted, s2_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def contained_span_spanset(s: "const Span *", ss: "const SpanSet *") -> "bool": - s_converted = _ffi.cast("const Span *", s) - ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.contained_span_spanset(s_converted, ss_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def contained_spanset_span(ss: "const SpanSet *", s: "const Span *") -> "bool": - ss_converted = _ffi.cast("const SpanSet *", ss) - s_converted = _ffi.cast("const Span *", s) - result = _lib.contained_spanset_span(ss_converted, s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def contained_spanset_spanset(ss1: "const SpanSet *", ss2: "const SpanSet *") -> "bool": - ss1_converted = _ffi.cast("const SpanSet *", ss1) - ss2_converted = _ffi.cast("const SpanSet *", ss2) - result = _lib.contained_spanset_spanset(ss1_converted, ss2_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def contained_text_set(txt: str, s: "const Set *") -> "bool": - txt_converted = cstring2text(txt) - s_converted = _ffi.cast("const Set *", s) - result = _lib.contained_text_set(txt_converted, s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def contained_timestamptz_set(t: int, s: "const Set *") -> "bool": - t_converted = _ffi.cast("TimestampTz", t) - s_converted = _ffi.cast("const Set *", s) - result = _lib.contained_timestamptz_set(t_converted, s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def contained_timestamptz_span(t: int, s: "const Span *") -> "bool": - t_converted = _ffi.cast("TimestampTz", t) - s_converted = _ffi.cast("const Span *", s) - result = _lib.contained_timestamptz_span(t_converted, s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def contained_timestamptz_spanset(t: int, ss: "const SpanSet *") -> "bool": - t_converted = _ffi.cast("TimestampTz", t) - ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.contained_timestamptz_spanset(t_converted, ss_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def contains_set_bigint(s: "const Set *", i: int) -> "bool": - s_converted = _ffi.cast("const Set *", s) - i_converted = _ffi.cast("int64", i) - result = _lib.contains_set_bigint(s_converted, i_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def contains_set_date(s: "const Set *", d: "DateADT") -> "bool": - s_converted = _ffi.cast("const Set *", s) - d_converted = _ffi.cast("DateADT", d) - result = _lib.contains_set_date(s_converted, d_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def contains_set_float(s: "const Set *", d: float) -> "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": - 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": - s1_converted = _ffi.cast("const Set *", s1) - s2_converted = _ffi.cast("const Set *", s2) - result = _lib.contains_set_set(s1_converted, s2_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def contains_set_text(s: "const Set *", t: str) -> "bool": - s_converted = _ffi.cast("const Set *", s) - t_converted = cstring2text(t) - result = _lib.contains_set_text(s_converted, t_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def contains_set_timestamptz(s: "const Set *", t: int) -> "bool": - s_converted = _ffi.cast("const Set *", s) - t_converted = _ffi.cast("TimestampTz", t) - result = _lib.contains_set_timestamptz(s_converted, t_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def contains_span_bigint(s: "const Span *", i: int) -> "bool": - s_converted = _ffi.cast("const Span *", s) - i_converted = _ffi.cast("int64", i) - result = _lib.contains_span_bigint(s_converted, i_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def contains_span_date(s: "const Span *", d: "DateADT") -> "bool": - s_converted = _ffi.cast("const Span *", s) - d_converted = _ffi.cast("DateADT", d) - result = _lib.contains_span_date(s_converted, d_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def contains_span_float(s: "const Span *", d: float) -> "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": - 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": - s1_converted = _ffi.cast("const Span *", s1) - s2_converted = _ffi.cast("const Span *", s2) - result = _lib.contains_span_span(s1_converted, s2_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def contains_span_spanset(s: "const Span *", ss: "const SpanSet *") -> "bool": - s_converted = _ffi.cast("const Span *", s) - ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.contains_span_spanset(s_converted, ss_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def contains_span_timestamptz(s: "const Span *", t: int) -> "bool": - s_converted = _ffi.cast("const Span *", s) - t_converted = _ffi.cast("TimestampTz", t) - result = _lib.contains_span_timestamptz(s_converted, t_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def contains_spanset_bigint(ss: "const SpanSet *", i: int) -> "bool": - ss_converted = _ffi.cast("const SpanSet *", ss) - i_converted = _ffi.cast("int64", i) - result = _lib.contains_spanset_bigint(ss_converted, i_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def contains_spanset_date(ss: "const SpanSet *", d: "DateADT") -> "bool": - ss_converted = _ffi.cast("const SpanSet *", ss) - d_converted = _ffi.cast("DateADT", d) - result = _lib.contains_spanset_date(ss_converted, d_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def contains_spanset_float(ss: "const SpanSet *", d: float) -> "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": - 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": - ss_converted = _ffi.cast("const SpanSet *", ss) - s_converted = _ffi.cast("const Span *", s) - result = _lib.contains_spanset_span(ss_converted, s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def contains_spanset_spanset(ss1: "const SpanSet *", ss2: "const SpanSet *") -> "bool": - ss1_converted = _ffi.cast("const SpanSet *", ss1) - ss2_converted = _ffi.cast("const SpanSet *", ss2) - result = _lib.contains_spanset_spanset(ss1_converted, ss2_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def contains_spanset_timestamptz(ss: "const SpanSet *", t: int) -> "bool": - ss_converted = _ffi.cast("const SpanSet *", ss) - t_converted = _ffi.cast("TimestampTz", t) - result = _lib.contains_spanset_timestamptz(ss_converted, t_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def overlaps_set_set(s1: "const Set *", s2: "const Set *") -> "bool": - s1_converted = _ffi.cast("const Set *", s1) - s2_converted = _ffi.cast("const Set *", s2) - result = _lib.overlaps_set_set(s1_converted, s2_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def overlaps_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.overlaps_span_span(s1_converted, s2_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def overlaps_span_spanset(s: "const Span *", ss: "const SpanSet *") -> "bool": - s_converted = _ffi.cast("const Span *", s) - ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.overlaps_span_spanset(s_converted, ss_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def overlaps_spanset_span(ss: "const SpanSet *", s: "const Span *") -> "bool": - ss_converted = _ffi.cast("const SpanSet *", ss) - s_converted = _ffi.cast("const Span *", s) - result = _lib.overlaps_spanset_span(ss_converted, s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def overlaps_spanset_spanset(ss1: "const SpanSet *", ss2: "const SpanSet *") -> "bool": - ss1_converted = _ffi.cast("const SpanSet *", ss1) - ss2_converted = _ffi.cast("const SpanSet *", ss2) - result = _lib.overlaps_spanset_spanset(ss1_converted, ss2_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def after_date_set(d: "DateADT", s: "const Set *") -> "bool": - d_converted = _ffi.cast("DateADT", d) - s_converted = _ffi.cast("const Set *", s) - result = _lib.after_date_set(d_converted, s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def after_date_span(d: "DateADT", s: "const Span *") -> "bool": - d_converted = _ffi.cast("DateADT", d) - s_converted = _ffi.cast("const Span *", s) - result = _lib.after_date_span(d_converted, s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def after_date_spanset(d: "DateADT", ss: "const SpanSet *") -> "bool": - d_converted = _ffi.cast("DateADT", d) - ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.after_date_spanset(d_converted, ss_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def after_set_date(s: "const Set *", d: "DateADT") -> "bool": - s_converted = _ffi.cast("const Set *", s) - d_converted = _ffi.cast("DateADT", d) - result = _lib.after_set_date(s_converted, d_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def after_set_timestamptz(s: "const Set *", t: int) -> "bool": - s_converted = _ffi.cast("const Set *", s) - t_converted = _ffi.cast("TimestampTz", t) - result = _lib.after_set_timestamptz(s_converted, t_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def after_span_date(s: "const Span *", d: "DateADT") -> "bool": - s_converted = _ffi.cast("const Span *", s) - d_converted = _ffi.cast("DateADT", d) - result = _lib.after_span_date(s_converted, d_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def after_span_timestamptz(s: "const Span *", t: int) -> "bool": - s_converted = _ffi.cast("const Span *", s) - t_converted = _ffi.cast("TimestampTz", t) - result = _lib.after_span_timestamptz(s_converted, t_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def after_spanset_date(ss: "const SpanSet *", d: "DateADT") -> "bool": - ss_converted = _ffi.cast("const SpanSet *", ss) - d_converted = _ffi.cast("DateADT", d) - result = _lib.after_spanset_date(ss_converted, d_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def after_spanset_timestamptz(ss: "const SpanSet *", t: int) -> "bool": - ss_converted = _ffi.cast("const SpanSet *", ss) - t_converted = _ffi.cast("TimestampTz", t) - result = _lib.after_spanset_timestamptz(ss_converted, t_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def after_timestamptz_set(t: int, s: "const Set *") -> "bool": - t_converted = _ffi.cast("TimestampTz", t) - s_converted = _ffi.cast("const Set *", s) - result = _lib.after_timestamptz_set(t_converted, s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def after_timestamptz_span(t: int, s: "const Span *") -> "bool": - t_converted = _ffi.cast("TimestampTz", t) - s_converted = _ffi.cast("const Span *", s) - result = _lib.after_timestamptz_span(t_converted, s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def after_timestamptz_spanset(t: int, ss: "const SpanSet *") -> "bool": - t_converted = _ffi.cast("TimestampTz", t) - ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.after_timestamptz_spanset(t_converted, ss_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def before_date_set(d: "DateADT", s: "const Set *") -> "bool": - d_converted = _ffi.cast("DateADT", d) - s_converted = _ffi.cast("const Set *", s) - result = _lib.before_date_set(d_converted, s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def before_date_span(d: "DateADT", s: "const Span *") -> "bool": - d_converted = _ffi.cast("DateADT", d) - s_converted = _ffi.cast("const Span *", s) - result = _lib.before_date_span(d_converted, s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def before_date_spanset(d: "DateADT", ss: "const SpanSet *") -> "bool": - d_converted = _ffi.cast("DateADT", d) - ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.before_date_spanset(d_converted, ss_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def before_set_date(s: "const Set *", d: "DateADT") -> "bool": - s_converted = _ffi.cast("const Set *", s) - d_converted = _ffi.cast("DateADT", d) - result = _lib.before_set_date(s_converted, d_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def before_set_timestamptz(s: "const Set *", t: int) -> "bool": - s_converted = _ffi.cast("const Set *", s) - t_converted = _ffi.cast("TimestampTz", t) - result = _lib.before_set_timestamptz(s_converted, t_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def before_span_date(s: "const Span *", d: "DateADT") -> "bool": - s_converted = _ffi.cast("const Span *", s) - d_converted = _ffi.cast("DateADT", d) - result = _lib.before_span_date(s_converted, d_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def before_span_timestamptz(s: "const Span *", t: int) -> "bool": - s_converted = _ffi.cast("const Span *", s) - t_converted = _ffi.cast("TimestampTz", t) - result = _lib.before_span_timestamptz(s_converted, t_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def before_spanset_date(ss: "const SpanSet *", d: "DateADT") -> "bool": - ss_converted = _ffi.cast("const SpanSet *", ss) - d_converted = _ffi.cast("DateADT", d) - result = _lib.before_spanset_date(ss_converted, d_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def before_spanset_timestamptz(ss: "const SpanSet *", t: int) -> "bool": - ss_converted = _ffi.cast("const SpanSet *", ss) - t_converted = _ffi.cast("TimestampTz", t) - result = _lib.before_spanset_timestamptz(ss_converted, t_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def before_timestamptz_set(t: int, s: "const Set *") -> "bool": - t_converted = _ffi.cast("TimestampTz", t) - s_converted = _ffi.cast("const Set *", s) - result = _lib.before_timestamptz_set(t_converted, s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def before_timestamptz_span(t: int, s: "const Span *") -> "bool": - t_converted = _ffi.cast("TimestampTz", t) - s_converted = _ffi.cast("const Span *", s) - result = _lib.before_timestamptz_span(t_converted, s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def before_timestamptz_spanset(t: int, ss: "const SpanSet *") -> "bool": - t_converted = _ffi.cast("TimestampTz", t) - ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.before_timestamptz_spanset(t_converted, ss_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def left_bigint_set(i: int, s: "const Set *") -> "bool": - i_converted = _ffi.cast("int64", i) - s_converted = _ffi.cast("const Set *", s) - result = _lib.left_bigint_set(i_converted, s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def left_bigint_span(i: int, s: "const Span *") -> "bool": - i_converted = _ffi.cast("int64", i) - s_converted = _ffi.cast("const Span *", s) - result = _lib.left_bigint_span(i_converted, s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def left_bigint_spanset(i: int, ss: "const SpanSet *") -> "bool": - i_converted = _ffi.cast("int64", i) - ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.left_bigint_spanset(i_converted, ss_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def left_float_set(d: float, s: "const Set *") -> "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": - 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": - 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": - 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": - 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": - 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": - s_converted = _ffi.cast("const Set *", s) - i_converted = _ffi.cast("int64", i) - result = _lib.left_set_bigint(s_converted, i_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def left_set_float(s: "const Set *", d: float) -> "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": - 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": - s1_converted = _ffi.cast("const Set *", s1) - s2_converted = _ffi.cast("const Set *", s2) - result = _lib.left_set_set(s1_converted, s2_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def left_set_text(s: "const Set *", txt: str) -> "bool": - s_converted = _ffi.cast("const Set *", s) - txt_converted = cstring2text(txt) - result = _lib.left_set_text(s_converted, txt_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def left_span_bigint(s: "const Span *", i: int) -> "bool": - s_converted = _ffi.cast("const Span *", s) - i_converted = _ffi.cast("int64", i) - result = _lib.left_span_bigint(s_converted, i_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def left_span_float(s: "const Span *", d: float) -> "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": - 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": - s1_converted = _ffi.cast("const Span *", s1) - s2_converted = _ffi.cast("const Span *", s2) - result = _lib.left_span_span(s1_converted, s2_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def left_span_spanset(s: "const Span *", ss: "const SpanSet *") -> "bool": - s_converted = _ffi.cast("const Span *", s) - ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.left_span_spanset(s_converted, ss_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def left_spanset_bigint(ss: "const SpanSet *", i: int) -> "bool": - ss_converted = _ffi.cast("const SpanSet *", ss) - i_converted = _ffi.cast("int64", i) - result = _lib.left_spanset_bigint(ss_converted, i_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def left_spanset_float(ss: "const SpanSet *", d: float) -> "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": - 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": - ss_converted = _ffi.cast("const SpanSet *", ss) - s_converted = _ffi.cast("const Span *", s) - result = _lib.left_spanset_span(ss_converted, s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def left_spanset_spanset(ss1: "const SpanSet *", ss2: "const SpanSet *") -> "bool": - ss1_converted = _ffi.cast("const SpanSet *", ss1) - ss2_converted = _ffi.cast("const SpanSet *", ss2) - result = _lib.left_spanset_spanset(ss1_converted, ss2_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def left_text_set(txt: str, s: "const Set *") -> "bool": - txt_converted = cstring2text(txt) - s_converted = _ffi.cast("const Set *", s) - result = _lib.left_text_set(txt_converted, s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def overafter_date_set(d: "DateADT", s: "const Set *") -> "bool": - d_converted = _ffi.cast("DateADT", d) - s_converted = _ffi.cast("const Set *", s) - result = _lib.overafter_date_set(d_converted, s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def overafter_date_span(d: "DateADT", s: "const Span *") -> "bool": - d_converted = _ffi.cast("DateADT", d) - s_converted = _ffi.cast("const Span *", s) - result = _lib.overafter_date_span(d_converted, s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def overafter_date_spanset(d: "DateADT", ss: "const SpanSet *") -> "bool": - d_converted = _ffi.cast("DateADT", d) - ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.overafter_date_spanset(d_converted, ss_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def overafter_set_date(s: "const Set *", d: "DateADT") -> "bool": - s_converted = _ffi.cast("const Set *", s) - d_converted = _ffi.cast("DateADT", d) - result = _lib.overafter_set_date(s_converted, d_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def overafter_set_timestamptz(s: "const Set *", t: int) -> "bool": - s_converted = _ffi.cast("const Set *", s) - t_converted = _ffi.cast("TimestampTz", t) - result = _lib.overafter_set_timestamptz(s_converted, t_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def overafter_span_date(s: "const Span *", d: "DateADT") -> "bool": - s_converted = _ffi.cast("const Span *", s) - d_converted = _ffi.cast("DateADT", d) - result = _lib.overafter_span_date(s_converted, d_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def overafter_span_timestamptz(s: "const Span *", t: int) -> "bool": - s_converted = _ffi.cast("const Span *", s) - t_converted = _ffi.cast("TimestampTz", t) - result = _lib.overafter_span_timestamptz(s_converted, t_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def overafter_spanset_date(ss: "const SpanSet *", d: "DateADT") -> "bool": - ss_converted = _ffi.cast("const SpanSet *", ss) - d_converted = _ffi.cast("DateADT", d) - result = _lib.overafter_spanset_date(ss_converted, d_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def overafter_spanset_timestamptz(ss: "const SpanSet *", t: int) -> "bool": - ss_converted = _ffi.cast("const SpanSet *", ss) - t_converted = _ffi.cast("TimestampTz", t) - result = _lib.overafter_spanset_timestamptz(ss_converted, t_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def overafter_timestamptz_set(t: int, s: "const Set *") -> "bool": - t_converted = _ffi.cast("TimestampTz", t) - s_converted = _ffi.cast("const Set *", s) - result = _lib.overafter_timestamptz_set(t_converted, s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def overafter_timestamptz_span(t: int, s: "const Span *") -> "bool": - t_converted = _ffi.cast("TimestampTz", t) - s_converted = _ffi.cast("const Span *", s) - result = _lib.overafter_timestamptz_span(t_converted, s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def overafter_timestamptz_spanset(t: int, ss: "const SpanSet *") -> "bool": - t_converted = _ffi.cast("TimestampTz", t) - ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.overafter_timestamptz_spanset(t_converted, ss_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def overbefore_date_set(d: "DateADT", s: "const Set *") -> "bool": - d_converted = _ffi.cast("DateADT", d) - s_converted = _ffi.cast("const Set *", s) - result = _lib.overbefore_date_set(d_converted, s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def overbefore_date_span(d: "DateADT", s: "const Span *") -> "bool": - d_converted = _ffi.cast("DateADT", d) - s_converted = _ffi.cast("const Span *", s) - result = _lib.overbefore_date_span(d_converted, s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def overbefore_date_spanset(d: "DateADT", ss: "const SpanSet *") -> "bool": - d_converted = _ffi.cast("DateADT", d) - ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.overbefore_date_spanset(d_converted, ss_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def overbefore_set_date(s: "const Set *", d: "DateADT") -> "bool": - s_converted = _ffi.cast("const Set *", s) - d_converted = _ffi.cast("DateADT", d) - result = _lib.overbefore_set_date(s_converted, d_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def overbefore_set_timestamptz(s: "const Set *", t: int) -> "bool": - s_converted = _ffi.cast("const Set *", s) - t_converted = _ffi.cast("TimestampTz", t) - result = _lib.overbefore_set_timestamptz(s_converted, t_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def overbefore_span_date(s: "const Span *", d: "DateADT") -> "bool": - s_converted = _ffi.cast("const Span *", s) - d_converted = _ffi.cast("DateADT", d) - result = _lib.overbefore_span_date(s_converted, d_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def overbefore_span_timestamptz(s: "const Span *", t: int) -> "bool": - s_converted = _ffi.cast("const Span *", s) - t_converted = _ffi.cast("TimestampTz", t) - result = _lib.overbefore_span_timestamptz(s_converted, t_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def overbefore_spanset_date(ss: "const SpanSet *", d: "DateADT") -> "bool": - ss_converted = _ffi.cast("const SpanSet *", ss) - d_converted = _ffi.cast("DateADT", d) - result = _lib.overbefore_spanset_date(ss_converted, d_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def overbefore_spanset_timestamptz(ss: "const SpanSet *", t: int) -> "bool": - ss_converted = _ffi.cast("const SpanSet *", ss) - t_converted = _ffi.cast("TimestampTz", t) - result = _lib.overbefore_spanset_timestamptz(ss_converted, t_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def overbefore_timestamptz_set(t: int, s: "const Set *") -> "bool": - t_converted = _ffi.cast("TimestampTz", t) - s_converted = _ffi.cast("const Set *", s) - result = _lib.overbefore_timestamptz_set(t_converted, s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def overbefore_timestamptz_span(t: int, s: "const Span *") -> "bool": - t_converted = _ffi.cast("TimestampTz", t) - s_converted = _ffi.cast("const Span *", s) - result = _lib.overbefore_timestamptz_span(t_converted, s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def overbefore_timestamptz_spanset(t: int, ss: "const SpanSet *") -> "bool": - t_converted = _ffi.cast("TimestampTz", t) - ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.overbefore_timestamptz_spanset(t_converted, ss_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def overleft_bigint_set(i: int, s: "const Set *") -> "bool": - i_converted = _ffi.cast("int64", i) - s_converted = _ffi.cast("const Set *", s) - result = _lib.overleft_bigint_set(i_converted, s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def overleft_bigint_span(i: int, s: "const Span *") -> "bool": - i_converted = _ffi.cast("int64", i) - s_converted = _ffi.cast("const Span *", s) - result = _lib.overleft_bigint_span(i_converted, s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def overleft_bigint_spanset(i: int, ss: "const SpanSet *") -> "bool": - i_converted = _ffi.cast("int64", i) - ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.overleft_bigint_spanset(i_converted, ss_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def overleft_float_set(d: float, s: "const Set *") -> "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": - 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": - 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": - 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": - 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": - 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": - s_converted = _ffi.cast("const Set *", s) - i_converted = _ffi.cast("int64", i) - result = _lib.overleft_set_bigint(s_converted, i_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def overleft_set_float(s: "const Set *", d: float) -> "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": - 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": - s1_converted = _ffi.cast("const Set *", s1) - s2_converted = _ffi.cast("const Set *", s2) - result = _lib.overleft_set_set(s1_converted, s2_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def overleft_set_text(s: "const Set *", txt: str) -> "bool": - s_converted = _ffi.cast("const Set *", s) - txt_converted = cstring2text(txt) - result = _lib.overleft_set_text(s_converted, txt_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def overleft_span_bigint(s: "const Span *", i: int) -> "bool": - s_converted = _ffi.cast("const Span *", s) - i_converted = _ffi.cast("int64", i) - result = _lib.overleft_span_bigint(s_converted, i_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def overleft_span_float(s: "const Span *", d: float) -> "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": - 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": - s1_converted = _ffi.cast("const Span *", s1) - s2_converted = _ffi.cast("const Span *", s2) - result = _lib.overleft_span_span(s1_converted, s2_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def overleft_span_spanset(s: "const Span *", ss: "const SpanSet *") -> "bool": - s_converted = _ffi.cast("const Span *", s) - ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.overleft_span_spanset(s_converted, ss_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def overleft_spanset_bigint(ss: "const SpanSet *", i: int) -> "bool": - ss_converted = _ffi.cast("const SpanSet *", ss) - i_converted = _ffi.cast("int64", i) - result = _lib.overleft_spanset_bigint(ss_converted, i_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def overleft_spanset_float(ss: "const SpanSet *", d: float) -> "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": - 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": - ss_converted = _ffi.cast("const SpanSet *", ss) - s_converted = _ffi.cast("const Span *", s) - result = _lib.overleft_spanset_span(ss_converted, s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def overleft_spanset_spanset(ss1: "const SpanSet *", ss2: "const SpanSet *") -> "bool": - ss1_converted = _ffi.cast("const SpanSet *", ss1) - ss2_converted = _ffi.cast("const SpanSet *", ss2) - result = _lib.overleft_spanset_spanset(ss1_converted, ss2_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def overleft_text_set(txt: str, s: "const Set *") -> "bool": - txt_converted = cstring2text(txt) - s_converted = _ffi.cast("const Set *", s) - result = _lib.overleft_text_set(txt_converted, s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def overright_bigint_set(i: int, s: "const Set *") -> "bool": - i_converted = _ffi.cast("int64", i) - s_converted = _ffi.cast("const Set *", s) - result = _lib.overright_bigint_set(i_converted, s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def overright_bigint_span(i: int, s: "const Span *") -> "bool": - i_converted = _ffi.cast("int64", i) - s_converted = _ffi.cast("const Span *", s) - result = _lib.overright_bigint_span(i_converted, s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def overright_bigint_spanset(i: int, ss: "const SpanSet *") -> "bool": - i_converted = _ffi.cast("int64", i) - ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.overright_bigint_spanset(i_converted, ss_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def overright_float_set(d: float, s: "const Set *") -> "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": - 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": - 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": - 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": - 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": - 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": - s_converted = _ffi.cast("const Set *", s) - i_converted = _ffi.cast("int64", i) - result = _lib.overright_set_bigint(s_converted, i_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def overright_set_float(s: "const Set *", d: float) -> "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": - 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": - s1_converted = _ffi.cast("const Set *", s1) - s2_converted = _ffi.cast("const Set *", s2) - result = _lib.overright_set_set(s1_converted, s2_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def overright_set_text(s: "const Set *", txt: str) -> "bool": - s_converted = _ffi.cast("const Set *", s) - txt_converted = cstring2text(txt) - result = _lib.overright_set_text(s_converted, txt_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def overright_span_bigint(s: "const Span *", i: int) -> "bool": - s_converted = _ffi.cast("const Span *", s) - i_converted = _ffi.cast("int64", i) - result = _lib.overright_span_bigint(s_converted, i_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def overright_span_float(s: "const Span *", d: float) -> "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": - 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": - s1_converted = _ffi.cast("const Span *", s1) - s2_converted = _ffi.cast("const Span *", s2) - result = _lib.overright_span_span(s1_converted, s2_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def overright_span_spanset(s: "const Span *", ss: "const SpanSet *") -> "bool": - s_converted = _ffi.cast("const Span *", s) - ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.overright_span_spanset(s_converted, ss_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def overright_spanset_bigint(ss: "const SpanSet *", i: int) -> "bool": - ss_converted = _ffi.cast("const SpanSet *", ss) - i_converted = _ffi.cast("int64", i) - result = _lib.overright_spanset_bigint(ss_converted, i_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def overright_spanset_float(ss: "const SpanSet *", d: float) -> "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": - 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": - ss_converted = _ffi.cast("const SpanSet *", ss) - s_converted = _ffi.cast("const Span *", s) - result = _lib.overright_spanset_span(ss_converted, s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def overright_spanset_spanset(ss1: "const SpanSet *", ss2: "const SpanSet *") -> "bool": - ss1_converted = _ffi.cast("const SpanSet *", ss1) - ss2_converted = _ffi.cast("const SpanSet *", ss2) - result = _lib.overright_spanset_spanset(ss1_converted, ss2_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def overright_text_set(txt: str, s: "const Set *") -> "bool": - txt_converted = cstring2text(txt) - s_converted = _ffi.cast("const Set *", s) - result = _lib.overright_text_set(txt_converted, s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def right_bigint_set(i: int, s: "const Set *") -> "bool": - i_converted = _ffi.cast("int64", i) - s_converted = _ffi.cast("const Set *", s) - result = _lib.right_bigint_set(i_converted, s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def right_bigint_span(i: int, s: "const Span *") -> "bool": - i_converted = _ffi.cast("int64", i) - s_converted = _ffi.cast("const Span *", s) - result = _lib.right_bigint_span(i_converted, s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def right_bigint_spanset(i: int, ss: "const SpanSet *") -> "bool": - i_converted = _ffi.cast("int64", i) - ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.right_bigint_spanset(i_converted, ss_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def right_float_set(d: float, s: "const Set *") -> "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": - 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": - 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": - 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": - 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": - 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": - s_converted = _ffi.cast("const Set *", s) - i_converted = _ffi.cast("int64", i) - result = _lib.right_set_bigint(s_converted, i_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def right_set_float(s: "const Set *", d: float) -> "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": - 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": - s1_converted = _ffi.cast("const Set *", s1) - s2_converted = _ffi.cast("const Set *", s2) - result = _lib.right_set_set(s1_converted, s2_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def right_set_text(s: "const Set *", txt: str) -> "bool": - s_converted = _ffi.cast("const Set *", s) - txt_converted = cstring2text(txt) - result = _lib.right_set_text(s_converted, txt_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def right_span_bigint(s: "const Span *", i: int) -> "bool": - s_converted = _ffi.cast("const Span *", s) - i_converted = _ffi.cast("int64", i) - result = _lib.right_span_bigint(s_converted, i_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def right_span_float(s: "const Span *", d: float) -> "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": - 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": - s1_converted = _ffi.cast("const Span *", s1) - s2_converted = _ffi.cast("const Span *", s2) - result = _lib.right_span_span(s1_converted, s2_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def right_span_spanset(s: "const Span *", ss: "const SpanSet *") -> "bool": - s_converted = _ffi.cast("const Span *", s) - ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.right_span_spanset(s_converted, ss_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def right_spanset_bigint(ss: "const SpanSet *", i: int) -> "bool": - ss_converted = _ffi.cast("const SpanSet *", ss) - i_converted = _ffi.cast("int64", i) - result = _lib.right_spanset_bigint(ss_converted, i_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def right_spanset_float(ss: "const SpanSet *", d: float) -> "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": - 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": - ss_converted = _ffi.cast("const SpanSet *", ss) - s_converted = _ffi.cast("const Span *", s) - result = _lib.right_spanset_span(ss_converted, s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def right_spanset_spanset(ss1: "const SpanSet *", ss2: "const SpanSet *") -> "bool": - ss1_converted = _ffi.cast("const SpanSet *", ss1) - ss2_converted = _ffi.cast("const SpanSet *", ss2) - result = _lib.right_spanset_spanset(ss1_converted, ss2_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def right_text_set(txt: str, s: "const Set *") -> "bool": - txt_converted = cstring2text(txt) - s_converted = _ffi.cast("const Set *", s) - result = _lib.right_text_set(txt_converted, s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def intersection_bigint_set(i: int, s: "const Set *") -> "Set *": - i_converted = _ffi.cast("int64", i) - s_converted = _ffi.cast("const Set *", s) - result = _lib.intersection_bigint_set(i_converted, s_converted) - _check_error() - 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) - 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 *": - 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 *": - 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 *": - s_converted = _ffi.cast("const Set *", s) - i_converted = _ffi.cast("int64", i) - result = _lib.intersection_set_bigint(s_converted, i_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def intersection_set_date(s: "const Set *", d: "DateADT") -> "Set *": - s_converted = _ffi.cast("const Set *", s) - d_converted = _ffi.cast("DateADT", d) - result = _lib.intersection_set_date(s_converted, d_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def intersection_set_float(s: "const Set *", d: float) -> "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 *": - 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 *": - s1_converted = _ffi.cast("const Set *", s1) - s2_converted = _ffi.cast("const Set *", s2) - result = _lib.intersection_set_set(s1_converted, s2_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def intersection_set_text(s: "const Set *", txt: str) -> "Set *": - s_converted = _ffi.cast("const Set *", s) - txt_converted = cstring2text(txt) - result = _lib.intersection_set_text(s_converted, txt_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def intersection_set_timestamptz(s: "const Set *", t: int) -> "Set *": - s_converted = _ffi.cast("const Set *", s) - t_converted = _ffi.cast("TimestampTz", t) - result = _lib.intersection_set_timestamptz(s_converted, t_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def intersection_span_bigint(s: "const Span *", i: int) -> "Span *": - s_converted = _ffi.cast("const Span *", s) - i_converted = _ffi.cast("int64", i) - result = _lib.intersection_span_bigint(s_converted, i_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def intersection_span_date(s: "const Span *", d: "DateADT") -> "Span *": - s_converted = _ffi.cast("const Span *", s) - d_converted = _ffi.cast("DateADT", d) - result = _lib.intersection_span_date(s_converted, d_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def intersection_span_float(s: "const Span *", d: float) -> "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 *": - 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 *": - s1_converted = _ffi.cast("const Span *", s1) - s2_converted = _ffi.cast("const Span *", s2) - result = _lib.intersection_span_span(s1_converted, s2_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def intersection_span_spanset(s: "const Span *", ss: "const SpanSet *") -> "SpanSet *": - s_converted = _ffi.cast("const Span *", s) - ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.intersection_span_spanset(s_converted, ss_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def intersection_span_timestamptz(s: "const Span *", t: int) -> "Span *": - s_converted = _ffi.cast("const Span *", s) - t_converted = _ffi.cast("TimestampTz", t) - result = _lib.intersection_span_timestamptz(s_converted, t_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def intersection_spanset_bigint(ss: "const SpanSet *", i: int) -> "SpanSet *": - ss_converted = _ffi.cast("const SpanSet *", ss) - i_converted = _ffi.cast("int64", i) - result = _lib.intersection_spanset_bigint(ss_converted, i_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def intersection_spanset_date(ss: "const SpanSet *", d: "DateADT") -> "SpanSet *": - ss_converted = _ffi.cast("const SpanSet *", ss) - d_converted = _ffi.cast("DateADT", d) - result = _lib.intersection_spanset_date(ss_converted, d_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def intersection_spanset_float(ss: "const SpanSet *", d: float) -> "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 *": - 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 *": - ss_converted = _ffi.cast("const SpanSet *", ss) - s_converted = _ffi.cast("const Span *", s) - result = _lib.intersection_spanset_span(ss_converted, s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def intersection_spanset_spanset( - ss1: "const SpanSet *", ss2: "const SpanSet *" -) -> "SpanSet *": - ss1_converted = _ffi.cast("const SpanSet *", ss1) - ss2_converted = _ffi.cast("const SpanSet *", ss2) - result = _lib.intersection_spanset_spanset(ss1_converted, ss2_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def intersection_spanset_timestamptz(ss: "const SpanSet *", t: int) -> "SpanSet *": - ss_converted = _ffi.cast("const SpanSet *", ss) - t_converted = _ffi.cast("TimestampTz", t) - result = _lib.intersection_spanset_timestamptz(ss_converted, t_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def intersection_text_set(txt: str, s: "const Set *") -> "Set *": - txt_converted = cstring2text(txt) - s_converted = _ffi.cast("const Set *", s) - result = _lib.intersection_text_set(txt_converted, s_converted) - _check_error() - 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) - 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 *": - i_converted = _ffi.cast("int64", i) - s_converted = _ffi.cast("const Set *", s) - result = _lib.minus_bigint_set(i_converted, s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def minus_bigint_span(i: int, s: "const Span *") -> "SpanSet *": - i_converted = _ffi.cast("int64", i) - s_converted = _ffi.cast("const Span *", s) - result = _lib.minus_bigint_span(i_converted, s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def minus_bigint_spanset(i: int, ss: "const SpanSet *") -> "SpanSet *": - i_converted = _ffi.cast("int64", i) - ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.minus_bigint_spanset(i_converted, ss_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def minus_date_set(d: "DateADT", s: "const Set *") -> "Set *": - d_converted = _ffi.cast("DateADT", d) - s_converted = _ffi.cast("const Set *", s) - result = _lib.minus_date_set(d_converted, s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def minus_date_span(d: "DateADT", s: "const Span *") -> "SpanSet *": - d_converted = _ffi.cast("DateADT", d) - s_converted = _ffi.cast("const Span *", s) - result = _lib.minus_date_span(d_converted, s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def minus_date_spanset(d: "DateADT", ss: "const SpanSet *") -> "SpanSet *": - d_converted = _ffi.cast("DateADT", d) - ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.minus_date_spanset(d_converted, ss_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def minus_float_set(d: float, s: "const Set *") -> "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 *": - 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 *": - 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 *": - 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 *": - 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 *": - 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 *": - s_converted = _ffi.cast("const Set *", s) - i_converted = _ffi.cast("int64", i) - result = _lib.minus_set_bigint(s_converted, i_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def minus_set_date(s: "const Set *", d: "DateADT") -> "Set *": - s_converted = _ffi.cast("const Set *", s) - d_converted = _ffi.cast("DateADT", d) - result = _lib.minus_set_date(s_converted, d_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def minus_set_float(s: "const Set *", d: float) -> "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 *": - 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 *": - s1_converted = _ffi.cast("const Set *", s1) - s2_converted = _ffi.cast("const Set *", s2) - result = _lib.minus_set_set(s1_converted, s2_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def minus_set_text(s: "const Set *", txt: str) -> "Set *": - s_converted = _ffi.cast("const Set *", s) - txt_converted = cstring2text(txt) - result = _lib.minus_set_text(s_converted, txt_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def minus_set_timestamptz(s: "const Set *", t: int) -> "Set *": - s_converted = _ffi.cast("const Set *", s) - t_converted = _ffi.cast("TimestampTz", t) - result = _lib.minus_set_timestamptz(s_converted, t_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def minus_span_bigint(s: "const Span *", i: int) -> "SpanSet *": - s_converted = _ffi.cast("const Span *", s) - i_converted = _ffi.cast("int64", i) - result = _lib.minus_span_bigint(s_converted, i_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def minus_span_date(s: "const Span *", d: "DateADT") -> "SpanSet *": - s_converted = _ffi.cast("const Span *", s) - d_converted = _ffi.cast("DateADT", d) - result = _lib.minus_span_date(s_converted, d_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def minus_span_float(s: "const Span *", d: float) -> "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 *": - 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 *": - s1_converted = _ffi.cast("const Span *", s1) - s2_converted = _ffi.cast("const Span *", s2) - result = _lib.minus_span_span(s1_converted, s2_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def minus_span_spanset(s: "const Span *", ss: "const SpanSet *") -> "SpanSet *": - s_converted = _ffi.cast("const Span *", s) - ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.minus_span_spanset(s_converted, ss_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def minus_span_timestamptz(s: "const Span *", t: int) -> "SpanSet *": - s_converted = _ffi.cast("const Span *", s) - t_converted = _ffi.cast("TimestampTz", t) - result = _lib.minus_span_timestamptz(s_converted, t_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def minus_spanset_bigint(ss: "const SpanSet *", i: int) -> "SpanSet *": - ss_converted = _ffi.cast("const SpanSet *", ss) - i_converted = _ffi.cast("int64", i) - result = _lib.minus_spanset_bigint(ss_converted, i_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def minus_spanset_date(ss: "const SpanSet *", d: "DateADT") -> "SpanSet *": - ss_converted = _ffi.cast("const SpanSet *", ss) - d_converted = _ffi.cast("DateADT", d) - result = _lib.minus_spanset_date(ss_converted, d_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def minus_spanset_float(ss: "const SpanSet *", d: float) -> "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 *": - 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 *": - ss_converted = _ffi.cast("const SpanSet *", ss) - s_converted = _ffi.cast("const Span *", s) - result = _lib.minus_spanset_span(ss_converted, s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def minus_spanset_spanset( - ss1: "const SpanSet *", ss2: "const SpanSet *" -) -> "SpanSet *": - ss1_converted = _ffi.cast("const SpanSet *", ss1) - ss2_converted = _ffi.cast("const SpanSet *", ss2) - result = _lib.minus_spanset_spanset(ss1_converted, ss2_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def minus_spanset_timestamptz(ss: "const SpanSet *", t: int) -> "SpanSet *": - ss_converted = _ffi.cast("const SpanSet *", ss) - t_converted = _ffi.cast("TimestampTz", t) - result = _lib.minus_spanset_timestamptz(ss_converted, t_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def minus_text_set(txt: str, s: "const Set *") -> "Set *": - txt_converted = cstring2text(txt) - s_converted = _ffi.cast("const Set *", s) - result = _lib.minus_text_set(txt_converted, s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def minus_timestamptz_set(t: int, s: "const Set *") -> "Set *": - t_converted = _ffi.cast("TimestampTz", t) - s_converted = _ffi.cast("const Set *", s) - result = _lib.minus_timestamptz_set(t_converted, s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def minus_timestamptz_span(t: int, s: "const Span *") -> "SpanSet *": - t_converted = _ffi.cast("TimestampTz", t) - s_converted = _ffi.cast("const Span *", s) - result = _lib.minus_timestamptz_span(t_converted, s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def minus_timestamptz_spanset(t: int, ss: "const SpanSet *") -> "SpanSet *": - t_converted = _ffi.cast("TimestampTz", t) - ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.minus_timestamptz_spanset(t_converted, ss_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def union_bigint_set(i: int, s: "const Set *") -> "Set *": - i_converted = _ffi.cast("int64", i) - s_converted = _ffi.cast("const Set *", s) - result = _lib.union_bigint_set(i_converted, s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def union_bigint_span(s: "const Span *", i: int) -> "SpanSet *": - s_converted = _ffi.cast("const Span *", s) - i_converted = _ffi.cast("int64", i) - result = _lib.union_bigint_span(s_converted, i_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def union_bigint_spanset(i: int, ss: "SpanSet *") -> "SpanSet *": - i_converted = _ffi.cast("int64", i) - ss_converted = _ffi.cast("SpanSet *", ss) - result = _lib.union_bigint_spanset(i_converted, ss_converted) - _check_error() - 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) - 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 *": - s_converted = _ffi.cast("const Span *", s) - d_converted = _ffi.cast("DateADT", d) - result = _lib.union_date_span(s_converted, d_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def union_date_spanset(d: "DateADT", ss: "SpanSet *") -> "SpanSet *": - d_converted = _ffi.cast("DateADT", d) - ss_converted = _ffi.cast("SpanSet *", ss) - result = _lib.union_date_spanset(d_converted, ss_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def union_float_set(d: float, s: "const Set *") -> "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 *": - 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 *": - 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 *": - 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 *": - 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 *": - 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 *": - s_converted = _ffi.cast("const Set *", s) - i_converted = _ffi.cast("int64", i) - result = _lib.union_set_bigint(s_converted, i_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def union_set_date(s: "const Set *", d: "DateADT") -> "Set *": - s_converted = _ffi.cast("const Set *", s) - d_converted = _ffi.cast("DateADT", d) - result = _lib.union_set_date(s_converted, d_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def union_set_float(s: "const Set *", d: float) -> "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 *": - 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 *": - s1_converted = _ffi.cast("const Set *", s1) - s2_converted = _ffi.cast("const Set *", s2) - result = _lib.union_set_set(s1_converted, s2_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def union_set_text(s: "const Set *", txt: str) -> "Set *": - s_converted = _ffi.cast("const Set *", s) - txt_converted = cstring2text(txt) - result = _lib.union_set_text(s_converted, txt_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def union_set_timestamptz(s: "const Set *", t: int) -> "Set *": - s_converted = _ffi.cast("const Set *", s) - t_converted = _ffi.cast("const 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 *": - s_converted = _ffi.cast("const Span *", s) - i_converted = _ffi.cast("int64", i) - result = _lib.union_span_bigint(s_converted, i_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def union_span_date(s: "const Span *", d: "DateADT") -> "SpanSet *": - s_converted = _ffi.cast("const Span *", s) - d_converted = _ffi.cast("DateADT", d) - result = _lib.union_span_date(s_converted, d_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def union_span_float(s: "const Span *", d: float) -> "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 *": - 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 *": - s1_converted = _ffi.cast("const Span *", s1) - s2_converted = _ffi.cast("const Span *", s2) - result = _lib.union_span_span(s1_converted, s2_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def union_span_spanset(s: "const Span *", ss: "const SpanSet *") -> "SpanSet *": - s_converted = _ffi.cast("const Span *", s) - ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.union_span_spanset(s_converted, ss_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def union_span_timestamptz(s: "const Span *", t: int) -> "SpanSet *": - s_converted = _ffi.cast("const Span *", s) - t_converted = _ffi.cast("TimestampTz", t) - result = _lib.union_span_timestamptz(s_converted, t_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def union_spanset_bigint(ss: "const SpanSet *", i: int) -> "SpanSet *": - ss_converted = _ffi.cast("const SpanSet *", ss) - i_converted = _ffi.cast("int64", i) - result = _lib.union_spanset_bigint(ss_converted, i_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def union_spanset_date(ss: "const SpanSet *", d: "DateADT") -> "SpanSet *": - ss_converted = _ffi.cast("const SpanSet *", ss) - d_converted = _ffi.cast("DateADT", d) - result = _lib.union_spanset_date(ss_converted, d_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def union_spanset_float(ss: "const SpanSet *", d: float) -> "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 *": - 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 *": - ss_converted = _ffi.cast("const SpanSet *", ss) - s_converted = _ffi.cast("const Span *", s) - result = _lib.union_spanset_span(ss_converted, s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def union_spanset_spanset( - ss1: "const SpanSet *", ss2: "const SpanSet *" -) -> "SpanSet *": - ss1_converted = _ffi.cast("const SpanSet *", ss1) - ss2_converted = _ffi.cast("const SpanSet *", ss2) - result = _lib.union_spanset_spanset(ss1_converted, ss2_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def union_spanset_timestamptz(ss: "const SpanSet *", t: int) -> "SpanSet *": - ss_converted = _ffi.cast("const SpanSet *", ss) - t_converted = _ffi.cast("TimestampTz", t) - result = _lib.union_spanset_timestamptz(ss_converted, t_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def union_text_set(txt: str, s: "const Set *") -> "Set *": - txt_converted = cstring2text(txt) - s_converted = _ffi.cast("const Set *", s) - result = _lib.union_text_set(txt_converted, s_converted) - _check_error() - 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) - 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 *": - t_converted = _ffi.cast("TimestampTz", t) - s_converted = _ffi.cast("const Span *", s) - result = _lib.union_timestamptz_span(t_converted, s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def union_timestamptz_spanset(t: int, ss: "SpanSet *") -> "SpanSet *": - t_converted = _ffi.cast("TimestampTz", t) - ss_converted = _ffi.cast("SpanSet *", ss) - result = _lib.union_timestamptz_spanset(t_converted, ss_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def distance_bigintset_bigintset(s1: "const Set *", s2: "const Set *") -> "int64": - s1_converted = _ffi.cast("const Set *", s1) - s2_converted = _ffi.cast("const Set *", s2) - result = _lib.distance_bigintset_bigintset(s1_converted, s2_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def distance_bigintspan_bigintspan(s1: "const Span *", s2: "const Span *") -> "int64": - s1_converted = _ffi.cast("const Span *", s1) - s2_converted = _ffi.cast("const Span *", s2) - result = _lib.distance_bigintspan_bigintspan(s1_converted, s2_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def distance_bigintspanset_bigintspan( - ss: "const SpanSet *", s: "const Span *" -) -> "int64": - ss_converted = _ffi.cast("const SpanSet *", ss) - s_converted = _ffi.cast("const Span *", s) - result = _lib.distance_bigintspanset_bigintspan(ss_converted, s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def distance_bigintspanset_bigintspanset( - ss1: "const SpanSet *", ss2: "const SpanSet *" -) -> "int64": - ss1_converted = _ffi.cast("const SpanSet *", ss1) - ss2_converted = _ffi.cast("const SpanSet *", ss2) - result = _lib.distance_bigintspanset_bigintspanset(ss1_converted, ss2_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def distance_dateset_dateset(s1: "const Set *", s2: "const Set *") -> "int": - s1_converted = _ffi.cast("const Set *", s1) - s2_converted = _ffi.cast("const Set *", s2) - result = _lib.distance_dateset_dateset(s1_converted, s2_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def distance_datespan_datespan(s1: "const Span *", s2: "const Span *") -> "int": - s1_converted = _ffi.cast("const Span *", s1) - s2_converted = _ffi.cast("const Span *", s2) - result = _lib.distance_datespan_datespan(s1_converted, s2_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def distance_datespanset_datespan(ss: "const SpanSet *", s: "const Span *") -> "int": - ss_converted = _ffi.cast("const SpanSet *", ss) - s_converted = _ffi.cast("const Span *", s) - result = _lib.distance_datespanset_datespan(ss_converted, s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def distance_datespanset_datespanset( - ss1: "const SpanSet *", ss2: "const SpanSet *" -) -> "int": - ss1_converted = _ffi.cast("const SpanSet *", ss1) - ss2_converted = _ffi.cast("const SpanSet *", ss2) - result = _lib.distance_datespanset_datespanset(ss1_converted, ss2_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def distance_floatset_floatset(s1: "const Set *", s2: "const Set *") -> "double": - s1_converted = _ffi.cast("const Set *", s1) - s2_converted = _ffi.cast("const Set *", s2) - result = _lib.distance_floatset_floatset(s1_converted, s2_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def distance_floatspan_floatspan(s1: "const Span *", s2: "const Span *") -> "double": - s1_converted = _ffi.cast("const Span *", s1) - s2_converted = _ffi.cast("const Span *", s2) - result = _lib.distance_floatspan_floatspan(s1_converted, s2_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def distance_floatspanset_floatspan( - ss: "const SpanSet *", s: "const Span *" -) -> "double": - ss_converted = _ffi.cast("const SpanSet *", ss) - s_converted = _ffi.cast("const Span *", s) - result = _lib.distance_floatspanset_floatspan(ss_converted, s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def distance_floatspanset_floatspanset( - ss1: "const SpanSet *", ss2: "const SpanSet *" -) -> "double": - ss1_converted = _ffi.cast("const SpanSet *", ss1) - ss2_converted = _ffi.cast("const SpanSet *", ss2) - result = _lib.distance_floatspanset_floatspanset(ss1_converted, ss2_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def distance_intset_intset(s1: "const Set *", s2: "const Set *") -> "int": - s1_converted = _ffi.cast("const Set *", s1) - s2_converted = _ffi.cast("const Set *", s2) - result = _lib.distance_intset_intset(s1_converted, s2_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def distance_intspan_intspan(s1: "const Span *", s2: "const Span *") -> "int": - s1_converted = _ffi.cast("const Span *", s1) - s2_converted = _ffi.cast("const Span *", s2) - result = _lib.distance_intspan_intspan(s1_converted, s2_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def distance_intspanset_intspan(ss: "const SpanSet *", s: "const Span *") -> "int": - ss_converted = _ffi.cast("const SpanSet *", ss) - s_converted = _ffi.cast("const Span *", s) - result = _lib.distance_intspanset_intspan(ss_converted, s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def distance_intspanset_intspanset( - ss1: "const SpanSet *", ss2: "const SpanSet *" -) -> "int": - ss1_converted = _ffi.cast("const SpanSet *", ss1) - ss2_converted = _ffi.cast("const SpanSet *", ss2) - result = _lib.distance_intspanset_intspanset(ss1_converted, ss2_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def distance_set_bigint(s: "const Set *", i: int) -> "int64": - s_converted = _ffi.cast("const Set *", s) - i_converted = _ffi.cast("int64", i) - result = _lib.distance_set_bigint(s_converted, i_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def distance_set_date(s: "const Set *", d: "DateADT") -> "int": - s_converted = _ffi.cast("const Set *", s) - d_converted = _ffi.cast("DateADT", d) - result = _lib.distance_set_date(s_converted, d_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def distance_set_float(s: "const Set *", d: 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": - 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": - s_converted = _ffi.cast("const Set *", s) - t_converted = _ffi.cast("TimestampTz", t) - result = _lib.distance_set_timestamptz(s_converted, t_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def distance_span_bigint(s: "const Span *", i: int) -> "int64": - s_converted = _ffi.cast("const Span *", s) - i_converted = _ffi.cast("int64", i) - result = _lib.distance_span_bigint(s_converted, i_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def distance_span_date(s: "const Span *", d: "DateADT") -> "int": - s_converted = _ffi.cast("const Span *", s) - d_converted = _ffi.cast("DateADT", d) - result = _lib.distance_span_date(s_converted, d_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def distance_span_float(s: "const Span *", d: 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": - 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": - s_converted = _ffi.cast("const Span *", s) - t_converted = _ffi.cast("TimestampTz", t) - result = _lib.distance_span_timestamptz(s_converted, t_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def distance_spanset_bigint(ss: "const SpanSet *", i: int) -> "int64": - ss_converted = _ffi.cast("const SpanSet *", ss) - i_converted = _ffi.cast("int64", i) - result = _lib.distance_spanset_bigint(ss_converted, i_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def distance_spanset_date(ss: "const SpanSet *", d: "DateADT") -> "int": - ss_converted = _ffi.cast("const SpanSet *", ss) - d_converted = _ffi.cast("DateADT", d) - result = _lib.distance_spanset_date(ss_converted, d_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def distance_spanset_float(ss: "const SpanSet *", d: 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": - 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": - ss_converted = _ffi.cast("const SpanSet *", ss) - t_converted = _ffi.cast("TimestampTz", t) - result = _lib.distance_spanset_timestamptz(ss_converted, t_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def distance_tstzset_tstzset(s1: "const Set *", s2: "const Set *") -> "double": - s1_converted = _ffi.cast("const Set *", s1) - s2_converted = _ffi.cast("const Set *", s2) - result = _lib.distance_tstzset_tstzset(s1_converted, s2_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def distance_tstzspan_tstzspan(s1: "const Span *", s2: "const Span *") -> "double": - s1_converted = _ffi.cast("const Span *", s1) - s2_converted = _ffi.cast("const Span *", s2) - result = _lib.distance_tstzspan_tstzspan(s1_converted, s2_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def distance_tstzspanset_tstzspan(ss: "const SpanSet *", s: "const Span *") -> "double": - ss_converted = _ffi.cast("const SpanSet *", ss) - s_converted = _ffi.cast("const Span *", s) - result = _lib.distance_tstzspanset_tstzspan(ss_converted, s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def distance_tstzspanset_tstzspanset( - ss1: "const SpanSet *", ss2: "const SpanSet *" -) -> "double": - ss1_converted = _ffi.cast("const SpanSet *", ss1) - ss2_converted = _ffi.cast("const SpanSet *", ss2) - result = _lib.distance_tstzspanset_tstzspanset(ss1_converted, ss2_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def bigint_extent_transfn(state: "Span *", i: int) -> "Span *": - state_converted = _ffi.cast("Span *", state) - i_converted = _ffi.cast("int64", i) - result = _lib.bigint_extent_transfn(state_converted, i_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def bigint_union_transfn(state: "Set *", i: int) -> "Set *": - state_converted = _ffi.cast("Set *", state) - i_converted = _ffi.cast("int64", i) - result = _lib.bigint_union_transfn(state_converted, i_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def date_extent_transfn(state: "Span *", d: "DateADT") -> "Span *": - state_converted = _ffi.cast("Span *", state) - d_converted = _ffi.cast("DateADT", d) - result = _lib.date_extent_transfn(state_converted, d_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def date_union_transfn(state: "Set *", d: "DateADT") -> "Set *": - state_converted = _ffi.cast("Set *", state) - d_converted = _ffi.cast("DateADT", d) - result = _lib.date_union_transfn(state_converted, d_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def float_extent_transfn(state: "Span *", d: float) -> "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 *": - 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 *": - 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 *": - state_converted = _ffi.cast("Set *", state) - i_converted = _ffi.cast("int32", i) - result = _lib.int_union_transfn(state_converted, i_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def set_extent_transfn(state: "Span *", s: "const Set *") -> "Span *": - state_converted = _ffi.cast("Span *", state) - s_converted = _ffi.cast("const Set *", s) - result = _lib.set_extent_transfn(state_converted, s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def set_union_finalfn(state: "Set *") -> "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 *": - state_converted = _ffi.cast("Set *", state) - s_converted = _ffi.cast("Set *", s) - result = _lib.set_union_transfn(state_converted, s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def span_extent_transfn(state: "Span *", s: "const Span *") -> "Span *": - state_converted = _ffi.cast("Span *", state) - s_converted = _ffi.cast("const Span *", s) - result = _lib.span_extent_transfn(state_converted, s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def span_union_transfn(state: "SpanSet *", s: "const Span *") -> "SpanSet *": - state_converted = _ffi.cast("SpanSet *", state) - s_converted = _ffi.cast("const Span *", s) - result = _lib.span_union_transfn(state_converted, s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def spanset_extent_transfn(state: "Span *", ss: "const SpanSet *") -> "Span *": - state_converted = _ffi.cast("Span *", state) - ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.spanset_extent_transfn(state_converted, ss_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def spanset_union_finalfn(state: "SpanSet *") -> "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 *": - state_converted = _ffi.cast("SpanSet *", state) - ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.spanset_union_transfn(state_converted, ss_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def text_union_transfn(state: "Set *", txt: str) -> "Set *": - state_converted = _ffi.cast("Set *", state) - txt_converted = cstring2text(txt) - result = _lib.text_union_transfn(state_converted, txt_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def timestamptz_extent_transfn(state: "Span *", t: int) -> "Span *": - state_converted = _ffi.cast("Span *", state) - t_converted = _ffi.cast("TimestampTz", t) - result = _lib.timestamptz_extent_transfn(state_converted, t_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def timestamptz_union_transfn(state: "Set *", t: int) -> "Set *": - state_converted = _ffi.cast("Set *", state) - t_converted = _ffi.cast("TimestampTz", t) - result = _lib.timestamptz_union_transfn(state_converted, t_converted) - _check_error() - 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) - _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) - _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)) - 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) - _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)) - 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) - _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) - _check_error() - result_converted = ( - bytes(result[i] for i in range(size_out[0])) if result != _ffi.NULL else None - ) - return result_converted - - -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) - _check_error() - result = _ffi.string(result).decode("utf-8") - return result if result != _ffi.NULL else None, size[0] - - -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) - _check_error() - result_converted = ( - bytes(result[i] for i in range(size_out[0])) if result != _ffi.NULL else None - ) - return result_converted - - -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) - _check_error() - result = _ffi.string(result).decode("utf-8") - return result if result != _ffi.NULL else None, size[0] - - -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) - _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) - _check_error() - return result if result != _ffi.NULL else None - - -def float_timestamptz_to_tbox(d: float, t: int) -> "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 geo_tstzspan_to_stbox(gs: "const GSERIALIZED *", s: "const Span *") -> "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 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) - _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) - _check_error() - return result if result != _ffi.NULL else None - - -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) - _check_error() - return result if result != _ffi.NULL else None - - -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) - _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() - 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) - _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, - ) - _check_error() - 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) - _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) - _check_error() - return result if result != _ffi.NULL else None - - -def float_to_tbox(d: float) -> "TBox *": - result = _lib.float_to_tbox(d) - _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) - _check_error() - return result if result != _ffi.NULL else None - - -def int_to_tbox(i: int) -> "TBox *": - result = _lib.int_to_tbox(i) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _check_error() - return result if result != _ffi.NULL else None - - -def tbox_to_intspan(box: "const TBox *") -> "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 *": - 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 *": - 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 *": - 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_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_srid(box: "const STBox *") -> "int32": - 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_tmax(box: "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() - 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) - out_result = _ffi.new("bool *") - result = _lib.stbox_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) - out_result = _ffi.new("TimestampTz *") - result = _lib.stbox_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) - out_result = _ffi.new("bool *") - result = _lib.stbox_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_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) - _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) - out_result = _ffi.new("double *") - result = _lib.stbox_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) - _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) - out_result = _ffi.new("double *") - result = _lib.stbox_ymin(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) - out_result = _ffi.new("double *") - result = _lib.stbox_zmax(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": - box_converted = _ffi.cast("const TBox *", box) - out_result = _ffi.new("int *") - result = _lib.tboxint_xmax(box_converted, out_result) - _check_error() - if result: - return out_result[0] if out_result[0] != _ffi.NULL else None - return None - - -def tboxint_xmin(box: "const TBox *") -> "int": - box_converted = _ffi.cast("const TBox *", box) - out_result = _ffi.new("int *") - result = _lib.tboxint_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_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: int) -> "STBox *": - box_converted = _ffi.cast("const STBox *", box) - srid_converted = _ffi.cast("int32", 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: int) -> "STBox *": - box_converted = _ffi.cast("const STBox *", box) - srid_converted = _ffi.cast("int32", 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: int, is_forward: bool -) -> "STBox *": - box_converted = _ffi.cast("const STBox *", box) - pipelinestr_converted = pipelinestr.encode("utf-8") - srid_converted = _ffi.cast("int32", 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 tbox_expand_time(box: "const TBox *", interv: "const Interval *") -> "TBox *": - box_converted = _ffi.cast("const TBox *", box) - 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_expand_float(box: "const TBox *", d: "const double") -> "TBox *": - box_converted = _ffi.cast("const TBox *", box) - d_converted = _ffi.cast("const double", d) - result = _lib.tbox_expand_float(box_converted, d_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def tbox_expand_int(box: "const TBox *", i: "const int") -> "TBox *": - box_converted = _ffi.cast("const TBox *", box) - i_converted = _ffi.cast("const int", i) - result = _lib.tbox_expand_int(box_converted, i_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def tbox_round(box: "const TBox *", maxdd: int) -> "TBox *": - box_converted = _ffi.cast("const TBox *", box) - result = _lib.tbox_round(box_converted, maxdd) - _check_error() - return result if result != _ffi.NULL else None - - -def tbox_shift_scale_float( - box: "const TBox *", shift: float, width: float, hasshift: bool, haswidth: bool -) -> "TBox *": - box_converted = _ffi.cast("const TBox *", box) - 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_converted = _ffi.cast("const TBox *", box) - result = _lib.tbox_shift_scale_int(box_converted, shift, width, hasshift, haswidth) - _check_error() - return result if result != _ffi.NULL else None - - -def tbox_shift_scale_time( - box: "const TBox *", - shift: "Optional['const Interval *']", - duration: "Optional['const Interval *']", -) -> "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 - ) - _check_error() - return result if result != _ffi.NULL else None - - -def union_tbox_tbox( - box1: "const TBox *", box2: "const TBox *", strict: bool -) -> "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) - _check_error() - return result if result != _ffi.NULL else None - - -def intersection_tbox_tbox(box1: "const TBox *", box2: "const TBox *") -> "TBox *": - box1_converted = _ffi.cast("const TBox *", box1) - box2_converted = _ffi.cast("const TBox *", box2) - result = _lib.intersection_tbox_tbox(box1_converted, box2_converted) - _check_error() - 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) - _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) - _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) - _check_error() - return result if result != _ffi.NULL else None - - -def adjacent_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.adjacent_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": - 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 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) - _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) - _check_error() - return result if result != _ffi.NULL else None - - -def contains_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.contains_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": - 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 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) - _check_error() - return result if result != _ffi.NULL else None - - -def same_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.same_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) - _check_error() - return result if result != _ffi.NULL else None - - -def left_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.left_tbox_tbox(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": - box1_converted = _ffi.cast("const TBox *", box1) - box2_converted = _ffi.cast("const TBox *", box2) - result = _lib.overleft_tbox_tbox(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": - box1_converted = _ffi.cast("const TBox *", box1) - box2_converted = _ffi.cast("const TBox *", box2) - result = _lib.right_tbox_tbox(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": - 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 before_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.before_tbox_tbox(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": - box1_converted = _ffi.cast("const TBox *", box1) - box2_converted = _ffi.cast("const TBox *", box2) - result = _lib.overbefore_tbox_tbox(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) - _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) - _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) - _check_error() - 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) - _check_error() - return result if result != _ffi.NULL else None - - -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) - _check_error() - 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) - _check_error() - return result if result != _ffi.NULL else None - - -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) - _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() - 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) - _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) - _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) - _check_error() - 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) - _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) - _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) - _check_error() - 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) - _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) - _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) - _check_error() - 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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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)) - 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) - _check_error() - return result if result != _ffi.NULL else None - - -def tbool_out(temp: "const Temporal *") -> str: - 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 tint_out(temp: "const Temporal *") -> str: - 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 tfloat_out(temp: "const Temporal *", maxdd: int) -> str: - 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 ttext_out(temp: "const Temporal *") -> str: - 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 tpoint_out(temp: "const Temporal *", maxdd: int) -> str: - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tpoint_out(temp_converted, maxdd) - _check_error() - result = _ffi.string(result).decode("utf-8") - return result if result != _ffi.NULL else None - - -def tpoint_as_text(temp: "const Temporal *", maxdd: int) -> str: - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tpoint_as_text(temp_converted, maxdd) - _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: - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tpoint_as_ewkt(temp_converted, maxdd) - _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: - 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 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 *": - 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 tboolinst_make(b: bool, t: int) -> "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 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) - _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) - _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) - _check_error() - return result if result != _ffi.NULL else None - - -def temporal_copy(temp: "const Temporal *") -> "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 tfloat_from_base_temp(d: float, temp: "const Temporal *") -> "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 tfloatinst_make(d: float, t: int) -> "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 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) - _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) - _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) - _check_error() - return result if result != _ffi.NULL else None - - -def tint_from_base_temp(i: int, temp: "const Temporal *") -> "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 tintinst_make(i: int, t: int) -> "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 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) - _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) - _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) - _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) - 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: "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) - _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 - ) - _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) - _check_error() - 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 - ) - _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 - ) - _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) - _check_error() - return result if result != _ffi.NULL else None - - -def tsequenceset_make_gaps( - instants: "const TInstant **", - count: int, - interp: "interpType", - maxt: "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("Interval *", maxt) - result = _lib.tsequenceset_make_gaps( - instants_converted, count, interp_converted, maxt_converted, maxdist - ) - _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) - 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 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) - _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) - _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) - _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) - _check_error() - return result if result != _ffi.NULL else None - - -def temporal_to_tstzspan(temp: "const Temporal *") -> "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 tfloat_to_tint(temp: "const Temporal *") -> "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 tint_to_tfloat(temp: "const Temporal *") -> "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 tnumber_to_span(temp: "const Temporal *") -> "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_end_value(temp: "const Temporal *") -> "bool": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tbool_end_value(temp_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def tbool_start_value(temp: "const Temporal *") -> "bool": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tbool_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": - 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 - ) - _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']": - temp_converted = _ffi.cast("const Temporal *", temp) - count = _ffi.new("int *") - result = _lib.tbool_values(temp_converted, count) - _check_error() - return result if result != _ffi.NULL else None, count[0] - - -def temporal_duration(temp: "const Temporal *", boundspan: bool) -> "Interval *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.temporal_duration(temp_converted, boundspan) - _check_error() - return result if result != _ffi.NULL else None - - -def temporal_end_instant(temp: "const Temporal *") -> "TInstant *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.temporal_end_instant(temp_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def temporal_end_sequence(temp: "const Temporal *") -> "TSequence *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.temporal_end_sequence(temp_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def temporal_end_timestamptz(temp: "const Temporal *") -> "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 temporal_hash(temp: "const Temporal *") -> "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 temporal_instant_n(temp: "const Temporal *", n: int) -> "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 temporal_instants(temp: "const Temporal *") -> "Tuple['TInstant **', 'int']": - temp_converted = _ffi.cast("const Temporal *", temp) - count = _ffi.new("int *") - result = _lib.temporal_instants(temp_converted, count) - _check_error() - return result if result != _ffi.NULL else None, count[0] - - -def temporal_interp(temp: "const Temporal *") -> str: - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.temporal_interp(temp_converted) - _check_error() - result = _ffi.string(result).decode("utf-8") - return result if result != _ffi.NULL else None - - -def temporal_max_instant(temp: "const Temporal *") -> "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 temporal_min_instant(temp: "const Temporal *") -> "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 temporal_num_instants(temp: "const Temporal *") -> "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 temporal_num_sequences(temp: "const Temporal *") -> "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 temporal_num_timestamps(temp: "const Temporal *") -> "int": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.temporal_num_timestamps(temp_converted) - _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 *": - 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 temporal_sequences(temp: "const Temporal *") -> "Tuple['TSequence **', 'int']": - temp_converted = _ffi.cast("const Temporal *", temp) - count = _ffi.new("int *") - result = _lib.temporal_sequences(temp_converted, count) - _check_error() - return result if result != _ffi.NULL else None, count[0] - - -def temporal_lower_inc(temp: "const Temporal *") -> "int": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.temporal_lower_inc(temp_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def temporal_upper_inc(temp: "const Temporal *") -> "int": - 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 temporal_start_instant(temp: "const Temporal *") -> "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 temporal_start_sequence(temp: "const Temporal *") -> "TSequence *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.temporal_start_sequence(temp_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def temporal_start_timestamptz(temp: "const Temporal *") -> "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 temporal_stops( - temp: "const Temporal *", maxdist: float, minduration: "const Interval *" -) -> "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 temporal_subtype(temp: "const Temporal *") -> str: - 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 temporal_time(temp: "const Temporal *") -> "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 temporal_timestamptz_n(temp: "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() - if result: - return out_result[0] if out_result[0] != _ffi.NULL else None - return None - - -def temporal_timestamps(temp: "const Temporal *") -> "Tuple['TimestampTz *', 'int']": - temp_converted = _ffi.cast("const Temporal *", temp) - count = _ffi.new("int *") - result = _lib.temporal_timestamps(temp_converted, count) - _check_error() - return result if result != _ffi.NULL else None, count[0] - - -def tfloat_end_value(temp: "const Temporal *") -> "double": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tfloat_end_value(temp_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def tfloat_max_value(temp: "const Temporal *") -> "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 tfloat_min_value(temp: "const Temporal *") -> "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 tfloat_start_value(temp: "const Temporal *") -> "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 tfloat_value_at_timestamptz( - temp: "const Temporal *", t: int, strict: bool -) -> "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() - if result: - return out_result[0] if out_result[0] != _ffi.NULL else None - return 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) - _check_error() - return result if result != _ffi.NULL else None, count[0] - - -def tint_end_value(temp: "const Temporal *") -> "int": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tint_end_value(temp_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def tint_max_value(temp: "const Temporal *") -> "int": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tint_max_value(temp_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def tint_min_value(temp: "const Temporal *") -> "int": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tint_min_value(temp_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def tint_start_value(temp: "const Temporal *") -> "int": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tint_start_value(temp_converted) - _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 - ) - _check_error() - if result: - return out_result[0] if out_result[0] != _ffi.NULL else None - return 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) - _check_error() - return result if result != _ffi.NULL else None, count[0] - - -def tnumber_integral(temp: "const Temporal *") -> "double": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tnumber_integral(temp_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def tnumber_twavg(temp: "const Temporal *") -> "double": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tnumber_twavg(temp_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def tnumber_valuespans(temp: "const Temporal *") -> "SpanSet *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tnumber_valuespans(temp_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def tpoint_end_value(temp: "const Temporal *") -> "GSERIALIZED *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tpoint_end_value(temp_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def tpoint_start_value(temp: "const Temporal *") -> "GSERIALIZED *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tpoint_start_value(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 **": - 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 - ) - _check_error() - if result: - return out_result if out_result != _ffi.NULL else None - return None - - -def tpoint_values(temp: "const Temporal *") -> "Tuple['GSERIALIZED **', 'int']": - temp_converted = _ffi.cast("const Temporal *", temp) - count = _ffi.new("int *") - result = _lib.tpoint_values(temp_converted, count) - _check_error() - return result if result != _ffi.NULL else None, count[0] - - -def ttext_end_value(temp: "const Temporal *") -> str: - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.ttext_end_value(temp_converted) - _check_error() - result = text2cstring(result) - return result if result != _ffi.NULL else None - - -def ttext_max_value(temp: "const Temporal *") -> str: - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.ttext_max_value(temp_converted) - _check_error() - result = text2cstring(result) - return result if result != _ffi.NULL else None - - -def ttext_min_value(temp: "const Temporal *") -> str: - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.ttext_min_value(temp_converted) - _check_error() - result = text2cstring(result) - return result if result != _ffi.NULL else None - - -def ttext_start_value(temp: "const Temporal *") -> str: - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.ttext_start_value(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 **": - 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 - ) - _check_error() - if result: - return out_result if out_result != _ffi.NULL else None - return None - - -def ttext_values(temp: "const Temporal *") -> "Tuple['text **', 'int']": - temp_converted = _ffi.cast("const Temporal *", temp) - count = _ffi.new("int *") - result = _lib.ttext_values(temp_converted, count) - _check_error() - return result if result != _ffi.NULL else None, count[0] - - -def float_degrees(value: float, normalize: bool) -> "double": - result = _lib.float_degrees(value, normalize) - _check_error() - return result if result != _ffi.NULL else None - - -def temporal_scale_time( - temp: "const Temporal *", duration: "const Interval *" -) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - 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_set_interp(temp: "const Temporal *", interp: "interpType") -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - interp_converted = _ffi.cast("interpType", interp) - result = _lib.temporal_set_interp(temp_converted, interp_converted) - _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 *": - 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 - ) - _check_error() - return result if result != _ffi.NULL else None - - -def temporal_shift_time( - temp: "const Temporal *", shift: "const Interval *" -) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - 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_to_tinstant(temp: "const Temporal *") -> "TInstant *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.temporal_to_tinstant(temp_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def temporal_to_tsequence(temp: "const Temporal *", interp_str: str) -> "TSequence *": - 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) - _check_error() - return result if result != _ffi.NULL else None - - -def temporal_to_tsequenceset( - temp: "const Temporal *", interp_str: str -) -> "TSequenceSet *": - 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) - _check_error() - return result if result != _ffi.NULL else None - - -def tfloat_degrees(temp: "const Temporal *", normalize: bool) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tfloat_degrees(temp_converted, normalize) - _check_error() - return result if result != _ffi.NULL else None - - -def tfloat_radians(temp: "const Temporal *") -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tfloat_radians(temp_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def tfloat_round(temp: "const Temporal *", maxdd: int) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tfloat_round(temp_converted, maxdd) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _check_error() - return result if result != _ffi.NULL else None - - -def tpoint_round(temp: "const Temporal *", maxdd: int) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tpoint_round(temp_converted, maxdd) - _check_error() - return result if result != _ffi.NULL else None - - -def tpoint_transform(temp: "const Temporal *", srid: int) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - srid_converted = _ffi.cast("int32", srid) - result = _lib.tpoint_transform(temp_converted, srid_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 *": - 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 - ) - _check_error() - return result if result != _ffi.NULL else None - - -def tpoint_transform_pj( - temp: "const Temporal *", srid: int, pj: "const LWPROJ*" -) -> "Temporal *": - 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) - _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) - _check_error() - return result if result != _ffi.NULL else None - - -def temporal_append_tinstant( - temp: "Temporal *", - inst: "const TInstant *", - maxdist: float, - maxt: "Optional['Interval *']", - expand: bool, -) -> "Temporal *": - temp_converted = _ffi.cast("Temporal *", temp) - inst_converted = _ffi.cast("const TInstant *", inst) - maxt_converted = _ffi.cast("Interval *", maxt) if maxt is not None else _ffi.NULL - result = _lib.temporal_append_tinstant( - temp_converted, inst_converted, maxdist, maxt_converted, expand - ) - _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) - _check_error() - return result if result != _ffi.NULL else None - - -def temporal_delete_tstzspan( - temp: "const Temporal *", s: "const Span *", connect: bool -) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - 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 temporal_delete_tstzspanset( - temp: "const Temporal *", ss: "const SpanSet *", connect: bool -) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - 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 temporal_delete_timestamptz( - temp: "const Temporal *", t: int, connect: bool -) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - 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 temporal_delete_tstzset( - temp: "const Temporal *", s: "const Set *", connect: bool -) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - 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 temporal_insert( - 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_insert(temp1_converted, temp2_converted, connect) - _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) - _check_error() - return result if result != _ffi.NULL else None - - -def temporal_merge_array(temparr: "Temporal **", count: int) -> "Temporal *": - temparr_converted = [_ffi.cast("Temporal *", x) for x in temparr] - result = _lib.temporal_merge_array(temparr_converted, count) - _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) - _check_error() - return result if result != _ffi.NULL else None - - -def tbool_at_value(temp: "const Temporal *", b: bool) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tbool_at_value(temp_converted, b) - _check_error() - return result if result != _ffi.NULL else None - - -def tbool_minus_value(temp: "const Temporal *", b: bool) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tbool_minus_value(temp_converted, b) - _check_error() - return result if result != _ffi.NULL else None - - -def temporal_at_max(temp: "const Temporal *") -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.temporal_at_max(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) - _check_error() - return result if result != _ffi.NULL else None - - -def temporal_at_tstzspan(temp: "const Temporal *", s: "const Span *") -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - 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 - - -def temporal_at_tstzspanset( - temp: "const Temporal *", ss: "const SpanSet *" -) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.temporal_at_tstzspanset(temp_converted, ss_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def temporal_at_timestamptz(temp: "const Temporal *", t: int) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - t_converted = _ffi.cast("TimestampTz", t) - result = _lib.temporal_at_timestamptz(temp_converted, t_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def temporal_at_tstzset(temp: "const Temporal *", s: "const Set *") -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - s_converted = _ffi.cast("const Set *", s) - result = _lib.temporal_at_tstzset(temp_converted, s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def temporal_at_values(temp: "const Temporal *", set: "const Set *") -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - set_converted = _ffi.cast("const Set *", set) - result = _lib.temporal_at_values(temp_converted, set_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def temporal_minus_max(temp: "const Temporal *") -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.temporal_minus_max(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) - _check_error() - return result if result != _ffi.NULL else None - - -def temporal_minus_tstzspan( - temp: "const Temporal *", s: "const Span *" -) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - 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 - - -def temporal_minus_tstzspanset( - temp: "const Temporal *", ss: "const SpanSet *" -) -> "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 temporal_minus_timestamptz(temp: "const Temporal *", t: int) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - t_converted = _ffi.cast("TimestampTz", t) - result = _lib.temporal_minus_timestamptz(temp_converted, t_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def temporal_minus_tstzset(temp: "const Temporal *", s: "const Set *") -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - s_converted = _ffi.cast("const Set *", s) - result = _lib.temporal_minus_tstzset(temp_converted, s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def temporal_minus_values(temp: "const Temporal *", set: "const Set *") -> "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 tfloat_at_value(temp: "const Temporal *", d: float) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tfloat_at_value(temp_converted, d) - _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) - _check_error() - return result if result != _ffi.NULL else None - - -def tint_at_value(temp: "const Temporal *", i: int) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tint_at_value(temp_converted, i) - _check_error() - return result if result != _ffi.NULL else None - - -def tint_minus_value(temp: "const Temporal *", i: int) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tint_minus_value(temp_converted, i) - _check_error() - return result if result != _ffi.NULL else None - - -def tnumber_at_span(temp: "const Temporal *", span: "const Span *") -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - 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 tnumber_at_spanset(temp: "const Temporal *", ss: "const SpanSet *") -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - 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 tnumber_at_tbox(temp: "const Temporal *", box: "const TBox *") -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - 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 tnumber_minus_span(temp: "const Temporal *", span: "const Span *") -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - 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 tnumber_minus_spanset( - temp: "const Temporal *", ss: "const SpanSet *" -) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - 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 tnumber_minus_tbox(temp: "const Temporal *", box: "const TBox *") -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - 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 tpoint_at_geom_time( - temp: "const Temporal *", - gs: "const GSERIALIZED *", - zspan: "Optional['const Span *']", - period: "Optional['const Span *']", -) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - gs_converted = _ffi.cast("const GSERIALIZED *", gs) - zspan_converted = ( - _ffi.cast("const Span *", zspan) if zspan is not None else _ffi.NULL - ) - period_converted = ( - _ffi.cast("const Span *", period) if period is not None else _ffi.NULL - ) - result = _lib.tpoint_at_geom_time( - temp_converted, gs_converted, zspan_converted, period_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 *": - 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) - _check_error() - return result if result != _ffi.NULL else None - - -def tpoint_at_value(temp: "const Temporal *", gs: "GSERIALIZED *") -> "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_time( - temp: "const Temporal *", - gs: "const GSERIALIZED *", - zspan: "Optional['const Span *']", - period: "Optional['const Span *']", -) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - gs_converted = _ffi.cast("const GSERIALIZED *", gs) - zspan_converted = ( - _ffi.cast("const Span *", zspan) if zspan is not None else _ffi.NULL - ) - period_converted = ( - _ffi.cast("const Span *", period) if period is not None else _ffi.NULL - ) - result = _lib.tpoint_minus_geom_time( - temp_converted, gs_converted, zspan_converted, period_converted - ) - _check_error() - return result if result != _ffi.NULL else None - - -def tpoint_minus_stbox( - temp: "const Temporal *", box: "const STBox *", border_inc: bool -) -> "Temporal *": - 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) - _check_error() - return result if result != _ffi.NULL else None - - -def tpoint_minus_value(temp: "const Temporal *", gs: "GSERIALIZED *") -> "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 ttext_at_value(temp: "const Temporal *", txt: str) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - txt_converted = cstring2text(txt) - result = _lib.ttext_at_value(temp_converted, txt_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def ttext_minus_value(temp: "const Temporal *", txt: str) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - txt_converted = cstring2text(txt) - result = _lib.ttext_minus_value(temp_converted, txt_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) - _check_error() - return result if result != _ffi.NULL else None - - -def temporal_eq(temp1: "const Temporal *", temp2: "const Temporal *") -> "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 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) - _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) - _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) - _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) - _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) - 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 always_eq_bool_tbool(b: bool, temp: "const Temporal *") -> "int": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.always_eq_bool_tbool(b, temp_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def always_eq_float_tfloat(d: float, temp: "const Temporal *") -> "int": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.always_eq_float_tfloat(d, temp_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def always_eq_int_tint(i: int, temp: "const Temporal *") -> "int": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.always_eq_int_tint(i, temp_converted) - _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) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.always_eq_point_tpoint(gs_converted, temp_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def always_eq_tbool_bool(temp: "const Temporal *", b: bool) -> "int": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.always_eq_tbool_bool(temp_converted, b) - _check_error() - return result if result != _ffi.NULL else None - - -def always_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.always_eq_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": - 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 always_eq_tfloat_float(temp: "const Temporal *", d: float) -> "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 always_eq_tint_int(temp: "const Temporal *", i: int) -> "int": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.always_eq_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": - temp_converted = _ffi.cast("const Temporal *", temp) - gs_converted = _ffi.cast("const GSERIALIZED *", gs) - result = _lib.always_eq_tpoint_point(temp_converted, gs_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def always_eq_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_eq_tpoint_tpoint(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) - 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 always_ne_bool_tbool(b: bool, temp: "const Temporal *") -> "int": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.always_ne_bool_tbool(b, temp_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def always_ne_float_tfloat(d: float, temp: "const Temporal *") -> "int": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.always_ne_float_tfloat(d, temp_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def always_ne_int_tint(i: int, temp: "const Temporal *") -> "int": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.always_ne_int_tint(i, temp_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) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.always_ne_point_tpoint(gs_converted, temp_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def always_ne_tbool_bool(temp: "const Temporal *", b: bool) -> "int": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.always_ne_tbool_bool(temp_converted, b) - _check_error() - return result if result != _ffi.NULL else None - - -def always_ne_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.always_ne_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": - txt_converted = cstring2text(txt) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.always_ne_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": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.always_ne_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": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.always_ne_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": - temp_converted = _ffi.cast("const Temporal *", temp) - gs_converted = _ffi.cast("const GSERIALIZED *", gs) - result = _lib.always_ne_tpoint_point(temp_converted, gs_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) - _check_error() - return result if result != _ffi.NULL else None - - -def always_ne_ttext_text(temp: "const Temporal *", txt: str) -> "int": - temp_converted = _ffi.cast("const Temporal *", temp) - 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 always_ge_float_tfloat(d: float, temp: "const Temporal *") -> "int": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.always_ge_float_tfloat(d, temp_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def always_ge_int_tint(i: int, temp: "const Temporal *") -> "int": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.always_ge_int_tint(i, temp_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def always_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.always_ge_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": - 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 always_ge_tfloat_float(temp: "const Temporal *", d: float) -> "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 always_ge_tint_int(temp: "const Temporal *", i: 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 always_ge_ttext_text(temp: "const Temporal *", txt: str) -> "int": - temp_converted = _ffi.cast("const Temporal *", temp) - 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 always_gt_float_tfloat(d: float, temp: "const Temporal *") -> "int": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.always_gt_float_tfloat(d, temp_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def always_gt_int_tint(i: int, temp: "const Temporal *") -> "int": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.always_gt_int_tint(i, temp_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def always_gt_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.always_gt_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": - txt_converted = cstring2text(txt) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.always_gt_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": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.always_gt_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": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.always_gt_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": - temp_converted = _ffi.cast("const Temporal *", temp) - 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 always_le_float_tfloat(d: float, temp: "const Temporal *") -> "int": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.always_le_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": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.always_le_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": - 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 always_le_text_ttext(txt: str, temp: "const Temporal *") -> "int": - txt_converted = cstring2text(txt) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.always_le_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": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.always_le_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": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.always_le_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": - temp_converted = _ffi.cast("const Temporal *", temp) - 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 always_lt_float_tfloat(d: float, temp: "const Temporal *") -> "int": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.always_lt_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": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.always_lt_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": - 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 always_lt_text_ttext(txt: str, temp: "const Temporal *") -> "int": - txt_converted = cstring2text(txt) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.always_lt_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": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.always_lt_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": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.always_lt_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": - temp_converted = _ffi.cast("const Temporal *", temp) - 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 ever_eq_bool_tbool(b: bool, temp: "const Temporal *") -> "int": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.ever_eq_bool_tbool(b, temp_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def ever_eq_float_tfloat(d: float, temp: "const Temporal *") -> "int": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.ever_eq_float_tfloat(d, 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) - _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) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.ever_eq_point_tpoint(gs_converted, temp_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def ever_eq_tbool_bool(temp: "const Temporal *", b: bool) -> "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 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) - _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) - 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 ever_eq_tfloat_float(temp: "const Temporal *", d: float) -> "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 ever_eq_tint_int(temp: "const Temporal *", i: 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 ever_eq_tpoint_point(temp: "const Temporal *", gs: "const GSERIALIZED *") -> "int": - temp_converted = _ffi.cast("const Temporal *", temp) - gs_converted = _ffi.cast("const GSERIALIZED *", gs) - result = _lib.ever_eq_tpoint_point(temp_converted, gs_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def ever_eq_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.ever_eq_tpoint_tpoint(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) - 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) - _check_error() - return result if result != _ffi.NULL else None - - -def ever_ge_int_tint(i: int, temp: "const Temporal *") -> "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: "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) - _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) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.ever_ge_text_ttext(txt_converted, temp_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def ever_ge_tfloat_float(temp: "const Temporal *", d: float) -> "int": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.ever_ge_tfloat_float(temp_converted, d) - _check_error() - return result if result != _ffi.NULL else None - - -def ever_ge_tint_int(temp: "const Temporal *", i: int) -> "int": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.ever_ge_tint_int(temp_converted, i) - _check_error() - return result if result != _ffi.NULL else None - - -def ever_ge_ttext_text(temp: "const Temporal *", txt: str) -> "int": - temp_converted = _ffi.cast("const Temporal *", temp) - 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 ever_gt_float_tfloat(d: float, temp: "const Temporal *") -> "int": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.ever_gt_float_tfloat(d, temp_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def ever_gt_int_tint(i: int, temp: "const Temporal *") -> "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: "const Temporal *", temp2: "const Temporal *" -) -> "int": - temp1_converted = _ffi.cast("const Temporal *", temp1) - temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.ever_gt_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": - txt_converted = cstring2text(txt) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.ever_gt_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": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.ever_gt_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": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.ever_gt_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": - temp_converted = _ffi.cast("const Temporal *", temp) - 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: "const Temporal *") -> "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: "const Temporal *") -> "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 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) - 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 ever_le_tfloat_float(temp: "const Temporal *", d: float) -> "int": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.ever_le_tfloat_float(temp_converted, d) - _check_error() - return result if result != _ffi.NULL else None - - -def ever_le_tint_int(temp: "const Temporal *", i: int) -> "int": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.ever_le_tint_int(temp_converted, i) - _check_error() - return result if result != _ffi.NULL else None - - -def ever_le_ttext_text(temp: "const Temporal *", txt: str) -> "int": - temp_converted = _ffi.cast("const Temporal *", temp) - 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 ever_lt_float_tfloat(d: float, temp: "const Temporal *") -> "int": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.ever_lt_float_tfloat(d, temp_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def ever_lt_int_tint(i: int, temp: "const Temporal *") -> "int": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.ever_lt_int_tint(i, temp_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def ever_lt_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_lt_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) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.ever_lt_text_ttext(txt_converted, temp_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def ever_lt_tfloat_float(temp: "const Temporal *", d: float) -> "int": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.ever_lt_tfloat_float(temp_converted, d) - _check_error() - return result if result != _ffi.NULL else None - - -def ever_lt_tint_int(temp: "const Temporal *", i: int) -> "int": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.ever_lt_tint_int(temp_converted, i) - _check_error() - return result if result != _ffi.NULL else None - - -def ever_lt_ttext_text(temp: "const Temporal *", txt: str) -> "int": - temp_converted = _ffi.cast("const Temporal *", temp) - 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 ever_ne_bool_tbool(b: bool, temp: "const Temporal *") -> "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 ever_ne_float_tfloat(d: float, temp: "const Temporal *") -> "int": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.ever_ne_float_tfloat(d, temp_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def ever_ne_int_tint(i: int, temp: "const Temporal *") -> "int": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.ever_ne_int_tint(i, temp_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) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.ever_ne_point_tpoint(gs_converted, temp_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def ever_ne_tbool_bool(temp: "const Temporal *", b: bool) -> "int": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.ever_ne_tbool_bool(temp_converted, b) - _check_error() - return result if result != _ffi.NULL else None - - -def ever_ne_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_ne_temporal_temporal(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) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.ever_ne_text_ttext(txt_converted, temp_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def ever_ne_tfloat_float(temp: "const Temporal *", d: float) -> "int": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.ever_ne_tfloat_float(temp_converted, d) - _check_error() - return result if result != _ffi.NULL else None - - -def ever_ne_tint_int(temp: "const Temporal *", i: int) -> "int": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.ever_ne_tint_int(temp_converted, i) - _check_error() - return result if result != _ffi.NULL else None - - -def ever_ne_tpoint_point(temp: "const Temporal *", gs: "const GSERIALIZED *") -> "int": - temp_converted = _ffi.cast("const Temporal *", temp) - gs_converted = _ffi.cast("const GSERIALIZED *", gs) - result = _lib.ever_ne_tpoint_point(temp_converted, gs_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def ever_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.ever_ne_tpoint_tpoint(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": - temp_converted = _ffi.cast("const Temporal *", temp) - txt_converted = cstring2text(txt) - result = _lib.ever_ne_ttext_text(temp_converted, txt_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def teq_bool_tbool(b: bool, temp: "const Temporal *") -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.teq_bool_tbool(b, temp_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) - _check_error() - return result if result != _ffi.NULL else None - - -def teq_int_tint(i: int, temp: "const Temporal *") -> "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_point_tpoint( - gs: "const GSERIALIZED *", temp: "const Temporal *" -) -> "Temporal *": - gs_converted = _ffi.cast("const GSERIALIZED *", gs) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.teq_point_tpoint(gs_converted, temp_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def teq_tbool_bool(temp: "const Temporal *", b: bool) -> "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: "const Temporal *", temp2: "const Temporal *" -) -> "Temporal *": - temp1_converted = _ffi.cast("const Temporal *", temp1) - temp2_converted = _ffi.cast("const Temporal *", temp2) - result = _lib.teq_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) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.teq_text_ttext(txt_converted, temp_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def teq_tfloat_float(temp: "const Temporal *", d: float) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.teq_tfloat_float(temp_converted, d) - _check_error() - return result if result != _ffi.NULL else None - - -def teq_tpoint_point( - temp: "const Temporal *", gs: "const GSERIALIZED *" -) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - gs_converted = _ffi.cast("const GSERIALIZED *", gs) - result = _lib.teq_tpoint_point(temp_converted, gs_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) - _check_error() - return result if result != _ffi.NULL else None - - -def teq_ttext_text(temp: "const Temporal *", txt: str) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - txt_converted = cstring2text(txt) - result = _lib.teq_ttext_text(temp_converted, txt_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def tge_float_tfloat(d: float, temp: "const Temporal *") -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tge_float_tfloat(d, temp_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def tge_int_tint(i: int, temp: "const Temporal *") -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tge_int_tint(i, temp_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def tge_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.tge_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) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tge_text_ttext(txt_converted, temp_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def tge_tfloat_float(temp: "const Temporal *", d: float) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tge_tfloat_float(temp_converted, d) - _check_error() - return result if result != _ffi.NULL else None - - -def tge_tint_int(temp: "const Temporal *", i: int) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tge_tint_int(temp_converted, i) - _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) - _check_error() - return result if result != _ffi.NULL else None - - -def tgt_float_tfloat(d: float, temp: "const Temporal *") -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tgt_float_tfloat(d, temp_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def tgt_int_tint(i: int, temp: "const Temporal *") -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tgt_int_tint(i, 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) - _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) - _check_error() - return result if result != _ffi.NULL else None - - -def tgt_tfloat_float(temp: "const Temporal *", d: float) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tgt_tfloat_float(temp_converted, d) - _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) - _check_error() - return result if result != _ffi.NULL else None - - -def tgt_ttext_text(temp: "const Temporal *", txt: str) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - txt_converted = cstring2text(txt) - result = _lib.tgt_ttext_text(temp_converted, txt_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def tle_float_tfloat(d: float, temp: "const Temporal *") -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tle_float_tfloat(d, temp_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def tle_int_tint(i: int, temp: "const Temporal *") -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tle_int_tint(i, temp_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def tle_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.tle_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) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tle_text_ttext(txt_converted, temp_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def tle_tfloat_float(temp: "const Temporal *", d: float) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tle_tfloat_float(temp_converted, d) - _check_error() - return result if result != _ffi.NULL else None - - -def tle_tint_int(temp: "const Temporal *", i: int) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tle_tint_int(temp_converted, i) - _check_error() - return result if result != _ffi.NULL else None - - -def tle_ttext_text(temp: "const Temporal *", txt: str) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - txt_converted = cstring2text(txt) - result = _lib.tle_ttext_text(temp_converted, txt_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def tlt_float_tfloat(d: float, temp: "const Temporal *") -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tlt_float_tfloat(d, temp_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def tlt_int_tint(i: int, temp: "const Temporal *") -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tlt_int_tint(i, temp_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def tlt_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.tlt_temporal_temporal(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) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tlt_text_ttext(txt_converted, temp_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def tlt_tfloat_float(temp: "const Temporal *", d: float) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tlt_tfloat_float(temp_converted, d) - _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) - _check_error() - return result if result != _ffi.NULL else None - - -def tlt_ttext_text(temp: "const Temporal *", txt: str) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - txt_converted = cstring2text(txt) - result = _lib.tlt_ttext_text(temp_converted, txt_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) - _check_error() - return result if result != _ffi.NULL else None - - -def tne_int_tint(i: int, temp: "const Temporal *") -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tne_int_tint(i, 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) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tne_point_tpoint(gs_converted, temp_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def tne_tbool_bool(temp: "const Temporal *", b: bool) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tne_tbool_bool(temp_converted, b) - _check_error() - return result if result != _ffi.NULL else None - - -def tne_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.tne_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) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tne_text_ttext(txt_converted, temp_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) - _check_error() - return result if result != _ffi.NULL else None - - -def tne_tpoint_point( - temp: "const Temporal *", gs: "const GSERIALIZED *" -) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - gs_converted = _ffi.cast("const GSERIALIZED *", gs) - result = _lib.tne_tpoint_point(temp_converted, gs_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def tne_tint_int(temp: "const Temporal *", i: int) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tne_tint_int(temp_converted, i) - _check_error() - return result if result != _ffi.NULL else None - - -def tne_ttext_text(temp: "const Temporal *", txt: str) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - txt_converted = cstring2text(txt) - result = _lib.tne_ttext_text(temp_converted, txt_converted) - _check_error() - 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) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.adjacent_numspan_tnumber(s_converted, 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) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.adjacent_stbox_tpoint(box_converted, temp_converted) - _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) - _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) - _check_error() - return result if result != _ffi.NULL else None - - -def adjacent_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.adjacent_temporal_tstzspan(temp_converted, s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def adjacent_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.adjacent_tnumber_numspan(temp_converted, s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def adjacent_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.adjacent_tnumber_tbox(temp_converted, box_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def adjacent_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.adjacent_tnumber_tnumber(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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _check_error() - return result if result != _ffi.NULL else None - - -def contains_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.contains_tnumber_numspan(temp_converted, s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def contains_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.contains_tnumber_tbox(temp_converted, box_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) - _check_error() - return result if result != _ffi.NULL else None - - -def contains_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.contains_tpoint_stbox(temp_converted, box_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) - _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) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.contains_tstzspan_temporal(s_converted, 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) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.overlaps_numspan_tnumber(s_converted, 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) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.overlaps_stbox_tpoint(box_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) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.overlaps_tbox_tnumber(box_converted, temp_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def overlaps_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.overlaps_temporal_temporal(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": - temp_converted = _ffi.cast("const Temporal *", temp) - 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 overlaps_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.overlaps_tnumber_numspan(temp_converted, s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def overlaps_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.overlaps_tnumber_tbox(temp_converted, box_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) - _check_error() - return result if result != _ffi.NULL else None - - -def overlaps_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.overlaps_tpoint_stbox(temp_converted, box_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def overlaps_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.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) - _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) - _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) - _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) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.same_tbox_tnumber(box_converted, temp_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def same_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.same_temporal_temporal(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": - temp_converted = _ffi.cast("const Temporal *", temp) - 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 same_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.same_tnumber_numspan(temp_converted, s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def same_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.same_tnumber_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": - 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 same_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.same_tpoint_stbox(temp_converted, box_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) - _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) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.same_tstzspan_temporal(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) - _check_error() - return result if result != _ffi.NULL else None - - -def above_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.above_tpoint_stbox(temp_converted, box_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) - _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) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.after_stbox_tpoint(box_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) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.after_tbox_tnumber(box_converted, temp_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def after_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.after_temporal_tstzspan(temp_converted, s_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) - _check_error() - return result if result != _ffi.NULL else None - - -def after_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.after_tnumber_tbox(temp_converted, box_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) - _check_error() - return result if result != _ffi.NULL else None - - -def after_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.after_tpoint_stbox(temp_converted, box_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) - _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) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.after_tstzspan_temporal(s_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) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.back_stbox_tpoint(box_converted, temp_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def back_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.back_tpoint_stbox(temp_converted, box_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) - _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) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.before_stbox_tpoint(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) - _check_error() - return result if result != _ffi.NULL else None - - -def before_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.before_temporal_tstzspan(temp_converted, s_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) - _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) - _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) - _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) - _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) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.before_tstzspan_temporal(s_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) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.below_stbox_tpoint(box_converted, temp_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def below_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.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) - _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) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.front_stbox_tpoint(box_converted, temp_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def front_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.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) - _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) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.left_stbox_tpoint(box_converted, temp_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) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.left_tbox_tnumber(box_converted, temp_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) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.left_numspan_tnumber(s_converted, temp_converted) - _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) - _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) - _check_error() - return result if result != _ffi.NULL else None - - -def left_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.left_tnumber_tnumber(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) - _check_error() - return result if result != _ffi.NULL else None - - -def left_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.left_tpoint_tpoint(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) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.overabove_stbox_tpoint(box_converted, temp_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def overabove_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.overabove_tpoint_stbox(temp_converted, box_converted) - _check_error() - return result if result != _ffi.NULL else None - - -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) - _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) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.overafter_stbox_tpoint(box_converted, temp_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) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.overafter_tbox_tnumber(box_converted, temp_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def overafter_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.overafter_temporal_tstzspan(temp_converted, s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -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) - _check_error() - return result if result != _ffi.NULL else None - - -def overafter_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.overafter_tnumber_tbox(temp_converted, box_converted) - _check_error() - return result if result != _ffi.NULL else None - - -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) - _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) - _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) - _check_error() - return result if result != _ffi.NULL else None - - -def overafter_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.overafter_tstzspan_temporal(s_converted, temp_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) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.overback_stbox_tpoint(box_converted, temp_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def overback_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.overback_tpoint_stbox(temp_converted, box_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) - _check_error() - return result if result != _ffi.NULL else None - - -def overbefore_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.overbefore_stbox_tpoint(box_converted, temp_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) - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.overbefore_tbox_tnumber(box_converted, temp_converted) - _check_error() - return result if result != _ffi.NULL else None - - -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) - _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) - _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) - 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 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) - _check_error() - 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) - _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) - _check_error() - 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) - _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) - _check_error() - 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) - _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) - _check_error() - 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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _check_error() - 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) - _check_error() - 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) - _check_error() - 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) - _check_error() - 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) - _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) - _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) - _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) - gs_converted = _ffi.cast("const GSERIALIZED *", gs) - result = _lib.distance_tpoint_point(temp_converted, gs_converted) - _check_error() - 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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _check_error() - 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) - _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) - _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) - _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) - _check_error() - return result if result != _ffi.NULL else None - - -def bearing_point_point( - gs1: "const GSERIALIZED *", gs2: "const GSERIALIZED *" -) -> "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: "const Temporal *", gs: "const GSERIALIZED *", invert: bool -) -> "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: "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) - _check_error() - 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) - _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) - _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) - _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) - _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) - _check_error() - if result: - return out_result[0] if out_result[0] != _ffi.NULL else None - return None - - -def tpoint_get_x(temp: "const Temporal *") -> "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: "const Temporal *") -> "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: "const Temporal *") -> "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: "const Temporal *") -> "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: "const Temporal *") -> "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: "const Temporal *") -> "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_srid(temp: "const Temporal *") -> "int": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tpoint_srid(temp_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def tpoint_stboxes(temp: "const Temporal *") -> "Tuple['STBox *', 'int']": - temp_converted = _ffi.cast("const Temporal *", temp) - count = _ffi.new("int *") - result = _lib.tpoint_stboxes(temp_converted, count) - _check_error() - return result if result != _ffi.NULL else None, count[0] - - -def tpoint_trajectory(temp: "const Temporal *") -> "GSERIALIZED *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tpoint_trajectory(temp_converted) - _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) - _check_error() - return result if result != _ffi.NULL else None - - -def geo_expand_space(gs: "const GSERIALIZED *", d: float) -> "STBox *": - gs_converted = _ffi.cast("const GSERIALIZED *", gs) - result = _lib.geo_expand_space(gs_converted, d) - _check_error() - return result if result != _ffi.NULL else None - - -def geomeas_to_tpoint(gs: "const GSERIALIZED *") -> "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_tgeompoint(temp: "const Temporal *") -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tgeogpoint_to_tgeompoint(temp_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) - _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, - ) - _check_error() - return result if result != _ffi.NULL else None, count[0] - - -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) - _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) - _check_error() - return result if result != _ffi.NULL else None, count[0] - - -def tpoint_set_srid(temp: "const Temporal *", srid: int) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - srid_converted = _ffi.cast("int32", srid) - result = _lib.tpoint_set_srid(temp_converted, srid_converted) - _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 - ) - _check_error() - if result: - return out_result if out_result != _ffi.NULL else None - return 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) - _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) - gs_converted = _ffi.cast("const GSERIALIZED *", gs) - result = _lib.adisjoint_tpoint_geo(temp_converted, gs_converted) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - gs_converted = _ffi.cast("const GSERIALIZED *", gs) - result = _lib.eintersects_tpoint_geo(temp_converted, gs_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) - _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) - 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_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) - _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) - _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 - ) - _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 - ) - _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) - _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) - _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) - _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) - _check_error() - 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) - _check_error() - 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) - _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) - _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) - _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) - _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) - _check_error() - return result if result != _ffi.NULL else 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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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 - ) - _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) - _check_error() - return result if result != _ffi.NULL else None - - -def tpoint_tcentroid_finalfn(state: "SkipList *") -> "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 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) - _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() - 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) - _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) - _check_error() - 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) - _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) - _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) - _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) - _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) - _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) - _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 - ) - _check_error() - return result if result != _ffi.NULL else None - - -def temporal_tsample( - 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_tsample(temp_converted, duration_converted, origin_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) - _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) - _check_error() - return result if result != _ffi.NULL else None, count[0] - - -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) - _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) - _check_error() - return result if result != _ffi.NULL else None, count[0] - - -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) - _check_error() - return result if result != _ffi.NULL else None - - -def float_bucket(value: float, size: float, origin: float) -> "double": - result = _lib.float_bucket(value, size, origin) - _check_error() - return result if result != _ffi.NULL else None - - -def floatspan_bucket_list( - bounds: "const Span *", size: float, origin: float -) -> "Tuple['Span *', 'int']": - bounds_converted = _ffi.cast("const Span *", bounds) - count = _ffi.new("int *") - result = _lib.floatspan_bucket_list(bounds_converted, size, origin, count) - _check_error() - return result if result != _ffi.NULL else None, count[0] - - -def int_bucket(value: int, size: int, origin: int) -> "int": - result = _lib.int_bucket(value, size, origin) - _check_error() - return result if result != _ffi.NULL else None - - -def intspan_bucket_list( - bounds: "const Span *", size: int, origin: int -) -> "Tuple['Span *', 'int']": - bounds_converted = _ffi.cast("const Span *", bounds) - count = _ffi.new("int *") - result = _lib.intspan_bucket_list(bounds_converted, size, origin, count) - _check_error() - return result if result != _ffi.NULL else None, count[0] - - -def stbox_tile( - point: "GSERIALIZED *", - t: int, - xsize: float, - ysize: float, - zsize: float, - duration: "Interval *", - sorigin: "GSERIALIZED *", - torigin: int, - hast: bool, -) -> "STBox *": - point_converted = _ffi.cast("GSERIALIZED *", point) - t_converted = _ffi.cast("TimestampTz", t) - duration_converted = _ffi.cast("Interval *", duration) - sorigin_converted = _ffi.cast("GSERIALIZED *", sorigin) - torigin_converted = _ffi.cast("TimestampTz", torigin) - result = _lib.stbox_tile( - point_converted, - t_converted, - xsize, - ysize, - zsize, - duration_converted, - sorigin_converted, - torigin_converted, - hast, - ) - _check_error() - return result if result != _ffi.NULL else None - - -def stbox_tile_list( - bounds: "const STBox *", - xsize: float, - ysize: float, - zsize: float, - duration: "Optional['const Interval *']", - sorigin: "GSERIALIZED *", - torigin: int, -) -> "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("GSERIALIZED *", sorigin) - torigin_converted = _ffi.cast("TimestampTz", torigin) - count = _ffi.new("int *") - result = _lib.stbox_tile_list( - bounds_converted, - xsize, - ysize, - zsize, - duration_converted, - sorigin_converted, - torigin_converted, - count, - ) - _check_error() - return result if result != _ffi.NULL else None, count[0] - - -def temporal_time_split( - temp: "Temporal *", duration: "Interval *", torigin: int -) -> "Tuple['Temporal **', 'TimestampTz *', 'int']": - temp_converted = _ffi.cast("Temporal *", temp) - duration_converted = _ffi.cast("Interval *", duration) - torigin_converted = _ffi.cast("TimestampTz", torigin) - time_buckets = _ffi.new("TimestampTz **") - count = _ffi.new("int *") - result = _lib.temporal_time_split( - temp_converted, duration_converted, torigin_converted, time_buckets, count - ) - _check_error() - return result if result != _ffi.NULL else None, time_buckets[0], count[0] - - -def tfloat_value_split( - temp: "Temporal *", size: float, origin: float -) -> "Tuple['Temporal **', 'double *', 'int']": - temp_converted = _ffi.cast("Temporal *", temp) - value_buckets = _ffi.new("double **") - count = _ffi.new("int *") - result = _lib.tfloat_value_split(temp_converted, size, origin, value_buckets, count) - _check_error() - return result if result != _ffi.NULL else None, value_buckets[0], count[0] - - -def tfloat_value_time_split( - temp: "Temporal *", - size: float, - duration: "Interval *", - vorigin: float, - torigin: int, -) -> "Tuple['Temporal **', 'double *', 'TimestampTz *', 'int']": - temp_converted = _ffi.cast("Temporal *", temp) - duration_converted = _ffi.cast("Interval *", duration) - torigin_converted = _ffi.cast("TimestampTz", torigin) - value_buckets = _ffi.new("double **") - time_buckets = _ffi.new("TimestampTz **") - count = _ffi.new("int *") - result = _lib.tfloat_value_time_split( - temp_converted, - size, - duration_converted, - vorigin, - torigin_converted, - value_buckets, - time_buckets, - count, - ) - _check_error() - return ( - result if result != _ffi.NULL else None, - value_buckets[0], - time_buckets[0], - count[0], - ) - - -def tfloatbox_tile( - value: float, - t: int, - vsize: float, - duration: "Interval *", - vorigin: float, - torigin: int, -) -> "TBox *": - t_converted = _ffi.cast("TimestampTz", t) - duration_converted = _ffi.cast("Interval *", duration) - torigin_converted = _ffi.cast("TimestampTz", torigin) - result = _lib.tfloatbox_tile( - value, t_converted, vsize, duration_converted, vorigin, torigin_converted - ) - _check_error() - return result if result != _ffi.NULL else None - - -def tfloatbox_tile_list( - box: "const TBox *", - xsize: float, - duration: "const Interval *", - xorigin: "Optional[float]", - 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.tfloatbox_tile_list( - box_converted, - xsize, - duration_converted, - xorigin_converted, - torigin_converted, - count, - ) - _check_error() - return result if result != _ffi.NULL else None, count[0] - - -def timestamptz_bucket( - timestamp: int, duration: "const Interval *", origin: int -) -> "TimestampTz": - timestamp_converted = _ffi.cast("TimestampTz", timestamp) - duration_converted = _ffi.cast("const Interval *", duration) - origin_converted = _ffi.cast("TimestampTz", origin) - result = _lib.timestamptz_bucket( - timestamp_converted, duration_converted, origin_converted - ) - _check_error() - return result if result != _ffi.NULL else None - - -def tint_value_split( - temp: "Temporal *", size: int, origin: int -) -> "Tuple['Temporal **', 'int *', 'int']": - temp_converted = _ffi.cast("Temporal *", temp) - value_buckets = _ffi.new("int **") - count = _ffi.new("int *") - result = _lib.tint_value_split(temp_converted, size, origin, value_buckets, count) - _check_error() - return result if result != _ffi.NULL else None, value_buckets[0], count[0] - - -def tint_value_time_split( - temp: "Temporal *", size: int, duration: "Interval *", vorigin: int, torigin: int -) -> "Tuple['Temporal **', 'int *', 'TimestampTz *', 'int']": - temp_converted = _ffi.cast("Temporal *", temp) - duration_converted = _ffi.cast("Interval *", duration) - torigin_converted = _ffi.cast("TimestampTz", torigin) - value_buckets = _ffi.new("int **") - time_buckets = _ffi.new("TimestampTz **") - count = _ffi.new("int *") - result = _lib.tint_value_time_split( - temp_converted, - size, - duration_converted, - vorigin, - torigin_converted, - value_buckets, - time_buckets, - count, - ) - _check_error() - return ( - result if result != _ffi.NULL else None, - value_buckets[0], - time_buckets[0], - count[0], - ) - - -def tintbox_tile( - value: int, t: int, vsize: int, duration: "Interval *", vorigin: int, torigin: int -) -> "TBox *": - t_converted = _ffi.cast("TimestampTz", t) - duration_converted = _ffi.cast("Interval *", duration) - torigin_converted = _ffi.cast("TimestampTz", torigin) - result = _lib.tintbox_tile( - value, t_converted, vsize, duration_converted, vorigin, torigin_converted - ) - _check_error() - return result if result != _ffi.NULL else None - - -def tintbox_tile_list( - 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_tile_list( - box_converted, - xsize, - duration_converted, - xorigin_converted, - torigin_converted, - count, - ) - _check_error() - return result if result != _ffi.NULL else None, count[0] - - -def tpoint_space_split( - temp: "Temporal *", - xsize: "float", - ysize: "float", - zsize: "float", - sorigin: "GSERIALIZED *", - bitmatrix: bool, -) -> "Tuple['Temporal **', 'GSERIALIZED ***', 'int']": - temp_converted = _ffi.cast("Temporal *", temp) - xsize_converted = _ffi.cast("float", xsize) - ysize_converted = _ffi.cast("float", ysize) - zsize_converted = _ffi.cast("float", zsize) - sorigin_converted = _ffi.cast("GSERIALIZED *", sorigin) - space_buckets = _ffi.new("GSERIALIZED ***") - count = _ffi.new("int *") - result = _lib.tpoint_space_split( - temp_converted, - xsize_converted, - ysize_converted, - zsize_converted, - sorigin_converted, - bitmatrix, - space_buckets, - count, - ) - _check_error() - return result if result != _ffi.NULL else None, space_buckets[0], count[0] - - -def tpoint_space_time_split( - temp: "Temporal *", - xsize: "float", - ysize: "float", - zsize: "float", - duration: "Interval *", - sorigin: "GSERIALIZED *", - torigin: int, - bitmatrix: bool, -) -> "Tuple['Temporal **', 'GSERIALIZED ***', 'TimestampTz *', 'int']": - temp_converted = _ffi.cast("Temporal *", temp) - xsize_converted = _ffi.cast("float", xsize) - ysize_converted = _ffi.cast("float", ysize) - zsize_converted = _ffi.cast("float", zsize) - duration_converted = _ffi.cast("Interval *", duration) - sorigin_converted = _ffi.cast("GSERIALIZED *", sorigin) - torigin_converted = _ffi.cast("TimestampTz", torigin) - space_buckets = _ffi.new("GSERIALIZED ***") - time_buckets = _ffi.new("TimestampTz **") - count = _ffi.new("int *") - result = _lib.tpoint_space_time_split( - temp_converted, - xsize_converted, - ysize_converted, - zsize_converted, - duration_converted, - sorigin_converted, - torigin_converted, - bitmatrix, - space_buckets, - time_buckets, - count, - ) - _check_error() - return ( - result if result != _ffi.NULL else None, - space_buckets[0], - time_buckets[0], - count[0], - ) - - -def tstzspan_bucket_list( - bounds: "const Span *", duration: "const Interval *", origin: int -) -> "Tuple['Span *', 'int']": - bounds_converted = _ffi.cast("const Span *", bounds) - duration_converted = _ffi.cast("const Interval *", duration) - origin_converted = _ffi.cast("TimestampTz", origin) - count = _ffi.new("int *") - result = _lib.tstzspan_bucket_list( - bounds_converted, duration_converted, origin_converted, count - ) - _check_error() - return result if result != _ffi.NULL else None, count[0] - - -def temptype_subtype(subtype: "tempSubtype") -> "bool": - subtype_converted = _ffi.cast("tempSubtype", subtype) - result = _lib.temptype_subtype(subtype_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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _check_error() - return result if result != _ffi.NULL else None - - -def timespan_type(type: "meosType") -> "bool": - type_converted = _ffi.cast("meosType", type) - result = _lib.timespan_type(type_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) - _check_error() - return result if result != _ffi.NULL else None - - -def spanset_type(type: "meosType") -> "bool": - type_converted = _ffi.cast("meosType", type) - result = _lib.spanset_type(type_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def numspanset_type(type: "meosType") -> "bool": - type_converted = _ffi.cast("meosType", type) - result = _lib.numspanset_type(type_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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _check_error() - return result if result != _ffi.NULL else None - - -def tnumber_settype(type: "meosType") -> "bool": - type_converted = _ffi.cast("meosType", type) - result = _lib.tnumber_settype(type_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) - _check_error() - 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) - _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) - _check_error() - 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) - _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) - _check_error() - 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) - _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) - _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) - _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) - _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) - _check_error() - return result if result != _ffi.NULL else None - - -def datum_hash(d: "Datum", basetype: "meosType") -> "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 datum_hash_extended(d: "Datum", basetype: "meosType", seed: 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 set_in(string: str, basetype: "meosType") -> "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 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) - _check_error() - return result if result != _ffi.NULL else None - - -def span_out(s: "const Span *", maxdd: int) -> str: - 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 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) - _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) - _check_error() - result = _ffi.string(result).decode("utf-8") - return result if result != _ffi.NULL else None - - -def set_cp(s: "const Set *") -> "Set *": - s_converted = _ffi.cast("const Set *", s) - result = _lib.set_cp(s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def set_make( - values: "const Datum *", count: int, basetype: "meosType", ordered: bool -) -> "Set *": - values_converted = _ffi.cast("const Datum *", values) - basetype_converted = _ffi.cast("meosType", basetype) - result = _lib.set_make(values_converted, count, basetype_converted, ordered) - _check_error() - return result if result != _ffi.NULL else None - - -def set_make_exp( - values: "const Datum *", - count: int, - maxcount: int, - basetype: "meosType", - ordered: 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, ordered - ) - _check_error() - return result if result != _ffi.NULL else None - - -def set_make_free( - values: "Datum *", count: int, basetype: "meosType", ordered: bool -) -> "Set *": - values_converted = _ffi.cast("Datum *", values) - basetype_converted = _ffi.cast("meosType", basetype) - result = _lib.set_make_free(values_converted, count, basetype_converted, ordered) - _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) - _check_error() - return result if result != _ffi.NULL else 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 - ) - _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, - ) - _check_error() - - -def spanset_cp(ss: "const SpanSet *") -> "SpanSet *": - ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.spanset_cp(ss_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def spanset_make_exp( - spans: "Span *", count: int, maxcount: int, normalize: bool, ordered: bool -) -> "SpanSet *": - spans_converted = _ffi.cast("Span *", spans) - result = _lib.spanset_make_exp(spans_converted, count, maxcount, normalize, ordered) - _check_error() - return result if result != _ffi.NULL else None - - -def spanset_make_free( - spans: "Span *", count: int, normalize: bool, ordered: bool -) -> "SpanSet *": - spans_converted = _ffi.cast("Span *", spans) - result = _lib.spanset_make_free(spans_converted, count, normalize, ordered) - _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) - _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) - _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) - _check_error() - return result if result != _ffi.NULL else None - - -def floatset_intset(s: "const Set *") -> "Set *": - s_converted = _ffi.cast("const Set *", s) - result = _lib.floatset_intset(s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def floatspan_intspan(s: "const Span *") -> "Span *": - s_converted = _ffi.cast("const Span *", s) - result = _lib.floatspan_intspan(s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def floatspanset_intspanset(ss: "const SpanSet *") -> "SpanSet *": - ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.floatspanset_intspanset(ss_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def intset_floatset(s: "const Set *") -> "Set *": - s_converted = _ffi.cast("const Set *", s) - result = _lib.intset_floatset(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) - _check_error() - return result if result != _ffi.NULL else None - - -def intspanset_floatspanset(ss: "const SpanSet *") -> "SpanSet *": - ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.intspanset_floatspanset(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) - _check_error() - return result if result != _ffi.NULL else None - - -def set_spanset(s: "const Set *") -> "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 span_spanset(s: "const Span *") -> "SpanSet *": - s_converted = _ffi.cast("const Span *", s) - result = _lib.span_spanset(s_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) - _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) - _check_error() - return result if result != _ffi.NULL else None - - -def tstzspanset_datespanset(ss: "const SpanSet *") -> "SpanSet *": - ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.tstzspanset_datespanset(ss_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def value_set_span(value: "Datum", basetype: "meosType", s: "Span *") -> None: - 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() - - -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) - _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) - _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) - _check_error() - return result if result != _ffi.NULL else None - - -def numspan_width(s: "const Span *") -> "Datum": - s_converted = _ffi.cast("const Span *", s) - result = _lib.numspan_width(s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def numspanset_width(ss: "const SpanSet *", boundspan: bool) -> "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 set_end_value(s: "const Set *") -> "Datum": - s_converted = _ffi.cast("const Set *", s) - result = _lib.set_end_value(s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def set_mem_size(s: "const Set *") -> "int": - s_converted = _ffi.cast("const Set *", s) - result = _lib.set_mem_size(s_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def set_set_span(s: "const Set *", sp: "Span *") -> None: - s_converted = _ffi.cast("const Set *", s) - sp_converted = _ffi.cast("Span *", sp) - _lib.set_set_span(s_converted, sp_converted) - _check_error() - - -def set_span(s: "const Set *") -> "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 set_start_value(s: "const Set *") -> "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 set_value_n(s: "const Set *", n: int) -> "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() - if result: - return out_result if out_result != _ffi.NULL else None - return None - - -def set_vals(s: "const Set *") -> "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 set_values(s: "const Set *") -> "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_lower(ss: "const SpanSet *") -> "Datum": - ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.spanset_lower(ss_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) - _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) - _check_error() - return result if result != _ffi.NULL else None - - -def spanset_upper(ss: "const SpanSet *") -> "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_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) - _check_error() - - -def floatset_deg(s: "const Set *", normalize: bool) -> "Set *": - s_converted = _ffi.cast("const Set *", s) - result = _lib.floatset_deg(s_converted, normalize) - _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) - _check_error() - return result if result != _ffi.NULL else None - - -def floatset_rnd(s: "const Set *", size: int) -> "Set *": - s_converted = _ffi.cast("const Set *", s) - result = _lib.floatset_rnd(s_converted, size) - _check_error() - return result if result != _ffi.NULL else None - - -def floatspan_rnd(s: "const Span *", size: int) -> "Span *": - s_converted = _ffi.cast("const Span *", s) - result = _lib.floatspan_rnd(s_converted, size) - _check_error() - return result if result != _ffi.NULL else None - - -def floatspanset_rnd(ss: "const SpanSet *", size: int) -> "SpanSet *": - ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.floatspanset_rnd(ss_converted, size) - _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 *": - 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 - ) - _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 *": - 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 - ) - _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 *": - 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 - ) - _check_error() - return result if result != _ffi.NULL else None - - -def set_compact(s: "const Set *") -> "Set *": - s_converted = _ffi.cast("const Set *", s) - result = _lib.set_compact(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) - _check_error() - - -def spanset_compact(ss: "const SpanSet *") -> "SpanSet *": - ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.spanset_compact(ss_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) - _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) - _check_error() - - -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) - _check_error() - return result if result != _ffi.NULL else None - - -def set_eq_int(s1: "const Set *", s2: "const Set *") -> "bool": - s1_converted = _ffi.cast("const Set *", s1) - s2_converted = _ffi.cast("const Set *", s2) - result = _lib.set_eq_int(s1_converted, s2_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def span_cmp_int(s1: "const Span *", s2: "const Span *") -> "int": - s1_converted = _ffi.cast("const Span *", s1) - s2_converted = _ffi.cast("const Span *", s2) - result = _lib.span_cmp_int(s1_converted, s2_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def span_eq_int(s1: "const Span *", s2: "const Span *") -> "bool": - s1_converted = _ffi.cast("const Span *", s1) - s2_converted = _ffi.cast("const Span *", s2) - result = _lib.span_eq_int(s1_converted, s2_converted) - _check_error() - return result if result != _ffi.NULL else 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) - _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) - _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) - _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) - 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 adjacent_spanset_value(ss: "const SpanSet *", value: "Datum") -> "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 adjacent_value_spanset(value: "Datum", ss: "const SpanSet *") -> "bool": - value_converted = _ffi.cast("Datum", value) - ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.adjacent_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": - s1_converted = _ffi.cast("const Span *", s1) - s2_converted = _ffi.cast("const Span *", s2) - result = _lib.cont_span_span(s1_converted, s2_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def contained_value_set(value: "Datum", s: "const Set *") -> "bool": - value_converted = _ffi.cast("Datum", value) - 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) - _check_error() - return result if result != _ffi.NULL else None - - -def contained_value_spanset(value: "Datum", ss: "const SpanSet *") -> "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 contains_set_value(s: "const Set *", value: "Datum") -> "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 contains_span_value(s: "const Span *", value: "Datum") -> "bool": - s_converted = _ffi.cast("const Span *", s) - 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 contains_spanset_value(ss: "const SpanSet *", value: "Datum") -> "bool": - ss_converted = _ffi.cast("const SpanSet *", ss) - 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 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) - _check_error() - return result if result != _ffi.NULL else None - - -def over_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.over_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": - s_converted = _ffi.cast("const Set *", s) - 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 left_span_value(s: "const Span *", value: "Datum") -> "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 result if result != _ffi.NULL else None - - -def left_spanset_value(ss: "const SpanSet *", value: "Datum") -> "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 left_value_set(value: "Datum", s: "const Set *") -> "bool": - value_converted = _ffi.cast("Datum", value) - s_converted = _ffi.cast("const Set *", s) - result = _lib.left_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": - 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 left_value_spanset(value: "Datum", ss: "const SpanSet *") -> "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 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) - _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) - _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) - _check_error() - return result if result != _ffi.NULL else None - - -def overleft_span_value(s: "const Span *", value: "Datum") -> "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 overleft_spanset_value(ss: "const SpanSet *", value: "Datum") -> "bool": - ss_converted = _ffi.cast("const SpanSet *", ss) - 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 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) - _check_error() - return result if result != _ffi.NULL else None - - -def overleft_value_span(value: "Datum", s: "const Span *") -> "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 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) - _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) - 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 overright_span_value(s: "const Span *", value: "Datum") -> "bool": - s_converted = _ffi.cast("const Span *", s) - 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 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) - _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) - _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) - s_converted = _ffi.cast("const Span *", s) - result = _lib.overright_value_span(value_converted, s_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) - _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) - _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) - _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) - _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) - s_converted = _ffi.cast("const Set *", s) - result = _lib.right_value_set(value_converted, s_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) - _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) - _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) - _check_error() - return result if result != _ffi.NULL else None - - -def right_span_value(s: "const Span *", value: "Datum") -> "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 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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _check_error() - return out_result if out_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) - _check_error() - 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) - _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) - _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) - _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) - _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) - _check_error() - 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) - _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) - _check_error() - 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) - _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) - _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) - _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) - _check_error() - return result if result != _ffi.NULL else None - - -def union_value_spanset(value: "Datum", ss: "const SpanSet *") -> "SpanSet *": - value_converted = _ffi.cast("Datum", value) - ss_converted = _ffi.cast("const SpanSet *", ss) - result = _lib.union_value_spanset(value_converted, ss_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) - _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) - _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) - _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) - _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) - _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) - value_converted = _ffi.cast("Datum", value) - result = _lib.distance_span_value(s_converted, value_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) - 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 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) - _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) - _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) - _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 - ) - _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) - value_converted = _ffi.cast("Datum", value) - 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 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) - _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 - ) - _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) - _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, - ) - _check_error() - - -def tbox_cp(box: "const TBox *") -> "TBox *": - box_converted = _ffi.cast("const TBox *", box) - result = _lib.tbox_cp(box_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) - box_converted = _ffi.cast("TBox *", box) - _lib.tbox_set(s_converted, p_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) - _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) - _check_error() - return result if result != _ffi.NULL else None - - -def float_set_tbox(d: float, box: "TBox *") -> None: - box_converted = _ffi.cast("TBox *", box) - _lib.float_set_tbox(d, box_converted) - _check_error() - - -def gbox_to_stbox(box: "const GBOX *") -> "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 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) - _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) - _check_error() - - -def int_set_tbox(i: int, box: "TBox *") -> None: - box_converted = _ffi.cast("TBox *", box) - _lib.int_set_tbox(i, box_converted) - _check_error() - - -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) - _check_error() - - -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) - _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) - _check_error() - - -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) - _check_error() - - -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) - _check_error() - - -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) - _check_error() - - -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) - _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) - _check_error() - - -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) - _check_error() - - -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) - _check_error() - - -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) - _check_error() - - -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) - _check_error() - - -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) - _check_error() - - -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) - _check_error() - - -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) - _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) - _check_error() - - -def tbox_shift_scale_value( - box: "const TBox *", - shift: "Datum", - width: "Datum", - basetype: "meosType", - hasshift: bool, - haswidth: bool, -) -> "TBox *": - box_converted = _ffi.cast("const TBox *", box) - shift_converted = _ffi.cast("Datum", shift) - width_converted = _ffi.cast("Datum", width) - basetype_converted = _ffi.cast("meosType", basetype) - result = _lib.tbox_shift_scale_value( - box_converted, - shift_converted, - width_converted, - basetype_converted, - hasshift, - haswidth, - ) - _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) - _check_error() - - -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) - _check_error() - - -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) - _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) - _check_error() - if result: - return out_result if out_result != _ffi.NULL else None - return 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) - _check_error() - return result if result != _ffi.NULL else None - - -def tboolinst_as_mfjson(inst: "const TInstant *", with_bbox: bool) -> str: - inst_converted = _ffi.cast("const TInstant *", inst) - result = _lib.tboolinst_as_mfjson(inst_converted, with_bbox) - _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) - _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) - _check_error() - return result if result != _ffi.NULL else None - - -def tboolseq_as_mfjson(seq: "const TSequence *", with_bbox: bool) -> str: - seq_converted = _ffi.cast("const TSequence *", seq) - result = _lib.tboolseq_as_mfjson(seq_converted, with_bbox) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _check_error() - return result if result != _ffi.NULL else None - - -def tfloatseq_as_mfjson( - seq: "const TSequence *", with_bbox: bool, precision: int -) -> str: - seq_converted = _ffi.cast("const TSequence *", seq) - result = _lib.tfloatseq_as_mfjson(seq_converted, with_bbox, precision) - _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) - _check_error() - return result if result != _ffi.NULL else 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) - _check_error() - return result if result != _ffi.NULL else None - - -def tfloatseqset_as_mfjson( - ss: "const TSequenceSet *", with_bbox: bool, precision: int -) -> str: - ss_converted = _ffi.cast("const TSequenceSet *", ss) - result = _lib.tfloatseqset_as_mfjson(ss_converted, with_bbox, precision) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _check_error() - return result if result != _ffi.NULL else None - - -def tinstant_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.tinstant_as_mfjson( - inst_converted, with_bbox, precision, srs_converted - ) - _check_error() - result = _ffi.string(result).decode("utf-8") - 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 - ) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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 - ) - _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: - 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 - ) - _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 - ) - _check_error() - result = _ffi.string(result).decode("utf-8") - return result if result != _ffi.NULL else None - - -def tsequence_as_mfjson( - seq: "const TSequence *", with_bbox: bool, precision: int, srs: str -) -> str: - seq_converted = _ffi.cast("const TSequence *", seq) - srs_converted = srs.encode("utf-8") - result = _lib.tsequence_as_mfjson( - seq_converted, with_bbox, precision, srs_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 - ) - _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) - _check_error() - return result if result != _ffi.NULL else None - - -def tsequence_out(seq: "const TSequence *", maxdd: int) -> str: - 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 tsequenceset_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.tsequenceset_as_mfjson( - ss_converted, with_bbox, precision, srs_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 - ) - _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 - ) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _check_error() - return result if result != _ffi.NULL else None - - -def ttextseqset_as_mfjson(ss: "const TSequenceSet *", with_bbox: bool) -> str: - ss_converted = _ffi.cast("const TSequenceSet *", ss) - result = _lib.ttextseqset_as_mfjson(ss_converted, with_bbox) - _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) - _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) - _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) - _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) - _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 - ) - _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) - _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) - _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) - _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, - ) - _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) - _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 - ) - _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 - ) - _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, - ) - _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 - ) - _check_error() - return result if result != _ffi.NULL else None - - -def tsequenceset_copy(ss: "const TSequenceSet *") -> "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 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) - _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 - ) - _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) - _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) - _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) - _check_error() - - -def tinstant_set_tstzspan(inst: "const TInstant *", s: "Span *") -> None: - 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) - _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) - _check_error() - - -def tnumberseq_set_tbox(seq: "const TSequence *", box: "TBox *") -> None: - seq_converted = _ffi.cast("const TSequence *", seq) - box_converted = _ffi.cast("TBox *", box) - _lib.tnumberseq_set_tbox(seq_converted, box_converted) - _check_error() - - -def tnumberseqset_set_tbox(ss: "const TSequenceSet *", box: "TBox *") -> None: - ss_converted = _ffi.cast("const TSequenceSet *", ss) - box_converted = _ffi.cast("TBox *", box) - _lib.tnumberseqset_set_tbox(ss_converted, box_converted) - _check_error() - - -def tsequence_set_tstzspan(seq: "const TSequence *", s: "Span *") -> None: - seq_converted = _ffi.cast("const TSequence *", seq) - s_converted = _ffi.cast("Span *", s) - _lib.tsequence_set_tstzspan(seq_converted, s_converted) - _check_error() - - -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) - _check_error() - - -def temporal_end_value(temp: "const Temporal *") -> "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 temporal_insts(temp: "const Temporal *") -> "Tuple['const TInstant **', 'int']": - temp_converted = _ffi.cast("const Temporal *", temp) - count = _ffi.new("int *") - result = _lib.temporal_insts(temp_converted, count) - _check_error() - return result if result != _ffi.NULL else None, count[0] - - -def temporal_max_value(temp: "const Temporal *") -> "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 temporal_mem_size(temp: "const Temporal *") -> "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 temporal_min_value(temp: "const Temporal *") -> "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 temporal_seqs(temp: "const Temporal *") -> "Tuple['const TSequence **', 'int']": - temp_converted = _ffi.cast("const Temporal *", temp) - count = _ffi.new("int *") - result = _lib.temporal_seqs(temp_converted, count) - _check_error() - return result if result != _ffi.NULL else None, count[0] - - -def temporal_set_bbox(temp: "const Temporal *", box: "void *") -> None: - temp_converted = _ffi.cast("const Temporal *", temp) - box_converted = _ffi.cast("void *", box) - _lib.temporal_set_bbox(temp_converted, box_converted) - _check_error() - - -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) - _check_error() - - -def temporal_seqs(temp: "const Temporal *") -> "Tuple['const TSequence **', 'int']": - temp_converted = _ffi.cast("const Temporal *", temp) - count = _ffi.new("int *") - result = _lib.temporal_seqs(temp_converted, count) - _check_error() - return result if result != _ffi.NULL else None, count[0] - - -def temporal_vals(temp: "const Temporal *") -> "Tuple['Datum *', 'int']": - temp_converted = _ffi.cast("const Temporal *", temp) - count = _ffi.new("int *") - result = _lib.temporal_vals(temp_converted, count) - _check_error() - return result if result != _ffi.NULL else None, count[0] - - -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) - _check_error() - return result if result != _ffi.NULL else None, count[0] - - -def tinstant_hash(inst: "const TInstant *") -> "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 tinstant_insts(inst: "const TInstant *") -> "Tuple['const TInstant **', 'int']": - inst_converted = _ffi.cast("const TInstant *", inst) - count = _ffi.new("int *") - result = _lib.tinstant_insts(inst_converted, count) - _check_error() - return result if result != _ffi.NULL else None, count[0] - - -def tinstant_set_bbox(inst: "const TInstant *", box: "void *") -> None: - inst_converted = _ffi.cast("const TInstant *", inst) - box_converted = _ffi.cast("void *", box) - _lib.tinstant_set_bbox(inst_converted, box_converted) - _check_error() - - -def tinstant_time(inst: "const TInstant *") -> "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 tinstant_timestamps(inst: "const TInstant *") -> "Tuple['TimestampTz *', 'int']": - inst_converted = _ffi.cast("const TInstant *", inst) - count = _ffi.new("int *") - result = _lib.tinstant_timestamps(inst_converted, count) - _check_error() - return result if result != _ffi.NULL else None, count[0] - - -def tinstant_val(inst: "const TInstant *") -> "Datum": - inst_converted = _ffi.cast("const TInstant *", inst) - result = _lib.tinstant_val(inst_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def tinstant_value(inst: "const TInstant *") -> "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 tinstant_value_at_timestamptz(inst: "const TInstant *", t: int) -> "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 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) - _check_error() - return result if result != _ffi.NULL else None, count[0] - - -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) - _check_error() - - -def tnumberinst_valuespans(inst: "const TInstant *") -> "SpanSet *": - inst_converted = _ffi.cast("const TInstant *", inst) - result = _lib.tnumberinst_valuespans(inst_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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _check_error() - return result if result != _ffi.NULL else None, count[0] - - -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) - _check_error() - return result if result != _ffi.NULL else None, count[0] - - -def tsequence_set_bbox(seq: "const TSequence *", box: "void *") -> None: - seq_converted = _ffi.cast("const TSequence *", seq) - box_converted = _ffi.cast("void *", box) - _lib.tsequence_set_bbox(seq_converted, box_converted) - _check_error() - - -def tsequence_expand_bbox(seq: "TSequence *", inst: "const TInstant *") -> None: - seq_converted = _ffi.cast("TSequence *", seq) - inst_converted = _ffi.cast("const TInstant *", inst) - _lib.tsequence_expand_bbox(seq_converted, inst_converted) - _check_error() - - -def tsequence_start_timestamptz(seq: "const TSequence *") -> "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 tsequence_time(seq: "const TSequence *") -> "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 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) - _check_error() - return result if result != _ffi.NULL else None, count[0] - - -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 - ) - _check_error() - if result: - return out_result if out_result != _ffi.NULL else None - return 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) - _check_error() - return result if result != _ffi.NULL else None, count[0] - - -def tsequenceset_duration(ss: "const TSequenceSet *", boundspan: bool) -> "Interval *": - ss_converted = _ffi.cast("const TSequenceSet *", ss) - result = _lib.tsequenceset_duration(ss_converted, boundspan) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _check_error() - return result if result != _ffi.NULL else None, count[0] - - -def tsequenceset_seqs(ss: "const TSequenceSet *") -> "const TSequence **": - ss_converted = _ffi.cast("const TSequenceSet *", ss) - result = _lib.tsequenceset_seqs(ss_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def tsequenceset_set_bbox(ss: "const TSequenceSet *", box: "void *") -> None: - ss_converted = _ffi.cast("const TSequenceSet *", ss) - box_converted = _ffi.cast("void *", box) - _lib.tsequenceset_set_bbox(ss_converted, box_converted) - _check_error() - - -def tsequenceset_start_timestamptz(ss: "const TSequenceSet *") -> "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 tsequenceset_time(ss: "const TSequenceSet *") -> "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 tsequenceset_timespan(ss: "const TSequenceSet *") -> "Interval *": - ss_converted = _ffi.cast("const TSequenceSet *", ss) - result = _lib.tsequenceset_timespan(ss_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) - _check_error() - if result: - return out_result[0] if out_result[0] != _ffi.NULL else None - return None - - -def tsequenceset_timestamps( - ss: "const TSequenceSet *", -) -> "Tuple['TimestampTz *', 'int']": - ss_converted = _ffi.cast("const TSequenceSet *", ss) - count = _ffi.new("int *") - result = _lib.tsequenceset_timestamps(ss_converted, count) - _check_error() - return result if result != _ffi.NULL else None, count[0] - - -def tsequenceset_value_at_timestamptz( - ss: "const TSequenceSet *", t: int, strict: bool -) -> "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_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) - _check_error() - return result if result != _ffi.NULL else None, count[0] - - -def temporal_compact(temp: "const Temporal *") -> "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 temporal_restart(temp: "Temporal *", count: int) -> None: - temp_converted = _ffi.cast("Temporal *", temp) - _lib.temporal_restart(temp_converted, count) - _check_error() - - -def temporal_tsequence(temp: "const Temporal *", interp: "interpType") -> "TSequence *": - temp_converted = _ffi.cast("const Temporal *", temp) - interp_converted = _ffi.cast("interpType", interp) - result = _lib.temporal_tsequence(temp_converted, interp_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def temporal_tsequenceset( - temp: "const Temporal *", interp: "interpType" -) -> "TSequenceSet *": - temp_converted = _ffi.cast("const Temporal *", temp) - interp_converted = _ffi.cast("interpType", interp) - result = _lib.temporal_tsequenceset(temp_converted, interp_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) - _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) - _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) - _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) - _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 - ) - _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) - _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 *": - 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 tnumberseqset_shift_scale_value( - ss: "const TSequenceSet *", - start: "Datum", - width: "Datum", - hasshift: bool, - haswidth: bool, -) -> "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 tsequence_compact(seq: "const TSequence *") -> "TSequence *": - seq_converted = _ffi.cast("const TSequence *", seq) - result = _lib.tsequence_compact(seq_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) - _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) - _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 *": - 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() - 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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - 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 tsequenceset_to_discrete(ss: "const TSequenceSet *") -> "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 tsequenceset_to_linear(ss: "const TSequenceSet *") -> "TSequenceSet *": - ss_converted = _ffi.cast("const TSequenceSet *", ss) - result = _lib.tsequenceset_to_linear(ss_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) - _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) - _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) - _check_error() - return result if 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) - _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) - _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 - ) - _check_error() - return result if result != _ffi.NULL else None - - -def tsequence_append_tsequence( - seq1: "TSequence *", seq2: "const TSequence *", expand: bool -) -> "Temporal *": - seq1_converted = _ffi.cast("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 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) - _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) - 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 tsequence_delete_tstzspan( - seq: "const TSequence *", s: "const Span *", connect: bool -) -> "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 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) - _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) - _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) - _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) - _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 - ) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _check_error() - return result if result != _ffi.NULL else None - - -def tspatial_set_stbox(temp: "const Temporal *", box: "STBox *") -> None: - 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: - inst_converted = _ffi.cast("const TInstant *", inst) - box_converted = _ffi.cast("STBox *", box) - _lib.tpointinst_set_stbox(inst_converted, box_converted) - _check_error() - - -def tspatialseq_set_stbox(seq: "const TSequence *", box: "STBox *") -> None: - 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: - 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) - inst_converted = _ffi.cast("const TInstant *", inst) - _lib.tsequence_expand_bbox(seq_converted, inst_converted) - _check_error() - - -def tsequence_set_bbox(seq: "const TSequence *", box: "void *") -> None: - seq_converted = _ffi.cast("const TSequence *", seq) - box_converted = _ffi.cast("void *", box) - _lib.tsequence_set_bbox(seq_converted, box_converted) - _check_error() - - -def tsequenceset_expand_bbox(ss: "TSequenceSet *", seq: "const TSequence *") -> None: - ss_converted = _ffi.cast("TSequenceSet *", ss) - seq_converted = _ffi.cast("const TSequence *", seq) - _lib.tsequenceset_expand_bbox(ss_converted, seq_converted) - _check_error() - - -def tsequenceset_set_bbox(ss: "const TSequenceSet *", box: "void *") -> None: - ss_converted = _ffi.cast("const TSequenceSet *", ss) - box_converted = _ffi.cast("void *", box) - _lib.tsequenceset_set_bbox(ss_converted, box_converted) - _check_error() - - -def tdiscseq_restrict_minmax( - seq: "const TSequence *", min: bool, atfunc: bool -) -> "TSequence *": - seq_converted = _ffi.cast("const TSequence *", seq) - result = _lib.tdiscseq_restrict_minmax(seq_converted, min, atfunc) - _check_error() - return result if result != _ffi.NULL else None - - -def tcontseq_restrict_minmax( - seq: "const TSequence *", min: bool, atfunc: bool -) -> "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_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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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 - ) - _check_error() - if result: - return out_result if out_result != _ffi.NULL else None - return 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) - _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) - _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) - _check_error() - return result if result != _ffi.NULL else None - - -def tinstant_restrict_tstzset( - inst: "const TInstant *", s: "const Set *", atfunc: bool -) -> "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) - _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) - _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) - _check_error() - return result if result != _ffi.NULL else None - - -def tnumber_restrict_span( - temp: "const Temporal *", span: "const Span *", atfunc: bool -) -> "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: "const Temporal *", ss: "const SpanSet *", atfunc: bool -) -> "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 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) - _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) - _check_error() - return result if result != _ffi.NULL else None - - -def tnumberseqset_restrict_span( - ss: "const TSequenceSet *", span: "const Span *", atfunc: bool -) -> "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: "const TSequenceSet *", spanset: "const SpanSet *", atfunc: bool -) -> "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 tpoint_restrict_geom_time( - temp: "const Temporal *", - gs: "const GSERIALIZED *", - zspan: "const Span *", - period: "const Span *", - atfunc: bool, -) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - gs_converted = _ffi.cast("const GSERIALIZED *", gs) - zspan_converted = _ffi.cast("const Span *", zspan) - period_converted = _ffi.cast("const Span *", period) - result = _lib.tpoint_restrict_geom_time( - temp_converted, gs_converted, zspan_converted, period_converted, atfunc - ) - _check_error() - 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 - ) - _check_error() - return result if result != _ffi.NULL else None - - -def tpointinst_restrict_geom_time( - inst: "const TInstant *", - gs: "const GSERIALIZED *", - zspan: "const Span *", - period: "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) - period_converted = _ffi.cast("const Span *", period) - result = _lib.tpointinst_restrict_geom_time( - inst_converted, gs_converted, zspan_converted, period_converted, atfunc - ) - _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 - ) - _check_error() - return result if result != _ffi.NULL else None - - -def tpointseq_restrict_geom_time( - seq: "const TSequence *", - gs: "const GSERIALIZED *", - zspan: "const Span *", - period: "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) - period_converted = _ffi.cast("const Span *", period) - result = _lib.tpointseq_restrict_geom_time( - seq_converted, gs_converted, zspan_converted, period_converted, atfunc - ) - _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 - ) - _check_error() - return result if result != _ffi.NULL else None - - -def tpointseqset_restrict_geom_time( - ss: "const TSequenceSet *", - gs: "const GSERIALIZED *", - zspan: "const Span *", - period: "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) - period_converted = _ffi.cast("const Span *", period) - result = _lib.tpointseqset_restrict_geom_time( - ss_converted, gs_converted, zspan_converted, period_converted, atfunc - ) - _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 - ) - _check_error() - 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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _check_error() - return result if result != _ffi.NULL else None - - -def always_eq_tinstant_base(inst: "const TInstant *", value: "Datum") -> "int": - inst_converted = _ffi.cast("const TInstant *", inst) - value_converted = _ffi.cast("Datum", value) - result = _lib.always_eq_tinstant_base(inst_converted, value_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def always_eq_tpointinst_base(inst: "const TInstant *", value: "Datum") -> "int": - inst_converted = _ffi.cast("const TInstant *", inst) - value_converted = _ffi.cast("Datum", value) - result = _lib.always_eq_tpointinst_base(inst_converted, value_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def always_eq_tpointseq_base(seq: "const TSequence *", value: "Datum") -> "int": - seq_converted = _ffi.cast("const TSequence *", seq) - value_converted = _ffi.cast("Datum", value) - result = _lib.always_eq_tpointseq_base(seq_converted, value_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def always_eq_tpointseqset_base(ss: "const TSequenceSet *", value: "Datum") -> "int": - ss_converted = _ffi.cast("const TSequenceSet *", ss) - value_converted = _ffi.cast("Datum", value) - result = _lib.always_eq_tpointseqset_base(ss_converted, value_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def always_eq_tsequence_base(seq: "const TSequence *", value: "Datum") -> "int": - seq_converted = _ffi.cast("const TSequence *", seq) - value_converted = _ffi.cast("Datum", value) - result = _lib.always_eq_tsequence_base(seq_converted, value_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def always_eq_tsequenceset_base(ss: "const TSequenceSet *", value: "Datum") -> "int": - ss_converted = _ffi.cast("const TSequenceSet *", ss) - value_converted = _ffi.cast("Datum", value) - result = _lib.always_eq_tsequenceset_base(ss_converted, value_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) - _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) - _check_error() - return result if result != _ffi.NULL else None - - -def always_ne_tinstant_base(inst: "const TInstant *", value: "Datum") -> "int": - inst_converted = _ffi.cast("const TInstant *", inst) - value_converted = _ffi.cast("Datum", value) - result = _lib.always_ne_tinstant_base(inst_converted, value_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def always_ne_tpointinst_base(inst: "const TInstant *", value: "Datum") -> "int": - inst_converted = _ffi.cast("const TInstant *", inst) - value_converted = _ffi.cast("Datum", value) - result = _lib.always_ne_tpointinst_base(inst_converted, value_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def always_ne_tpointseq_base(seq: "const TSequence *", value: "Datum") -> "int": - seq_converted = _ffi.cast("const TSequence *", seq) - value_converted = _ffi.cast("Datum", value) - result = _lib.always_ne_tpointseq_base(seq_converted, value_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def always_ne_tpointseqset_base(ss: "const TSequenceSet *", value: "Datum") -> "int": - ss_converted = _ffi.cast("const TSequenceSet *", ss) - value_converted = _ffi.cast("Datum", value) - result = _lib.always_ne_tpointseqset_base(ss_converted, value_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def always_ne_tsequence_base(seq: "const TSequence *", value: "Datum") -> "int": - seq_converted = _ffi.cast("const TSequence *", seq) - value_converted = _ffi.cast("Datum", value) - result = _lib.always_ne_tsequence_base(seq_converted, value_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def always_ne_tsequenceset_base(ss: "const TSequenceSet *", value: "Datum") -> "int": - ss_converted = _ffi.cast("const TSequenceSet *", ss) - value_converted = _ffi.cast("Datum", value) - result = _lib.always_ne_tsequenceset_base(ss_converted, value_converted) - _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) - _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) - _check_error() - return result if result != _ffi.NULL else None - - -def always_ge_tinstant_base(inst: "const TInstant *", value: "Datum") -> "int": - inst_converted = _ffi.cast("const TInstant *", inst) - value_converted = _ffi.cast("Datum", value) - result = _lib.always_ge_tinstant_base(inst_converted, value_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def always_ge_tsequence_base(seq: "const TSequence *", value: "Datum") -> "int": - seq_converted = _ffi.cast("const TSequence *", seq) - value_converted = _ffi.cast("Datum", value) - result = _lib.always_ge_tsequence_base(seq_converted, value_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def always_ge_tsequenceset_base(ss: "const TSequenceSet *", value: "Datum") -> "int": - ss_converted = _ffi.cast("const TSequenceSet *", ss) - value_converted = _ffi.cast("Datum", value) - result = _lib.always_ge_tsequenceset_base(ss_converted, value_converted) - _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) - _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) - _check_error() - return result if result != _ffi.NULL else None - - -def always_gt_tinstant_base(inst: "const TInstant *", value: "Datum") -> "int": - inst_converted = _ffi.cast("const TInstant *", inst) - value_converted = _ffi.cast("Datum", value) - result = _lib.always_gt_tinstant_base(inst_converted, value_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def always_gt_tsequence_base(seq: "const TSequence *", value: "Datum") -> "int": - seq_converted = _ffi.cast("const TSequence *", seq) - value_converted = _ffi.cast("Datum", value) - result = _lib.always_gt_tsequence_base(seq_converted, value_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def always_gt_tsequenceset_base(ss: "const TSequenceSet *", value: "Datum") -> "int": - ss_converted = _ffi.cast("const TSequenceSet *", ss) - value_converted = _ffi.cast("Datum", value) - result = _lib.always_gt_tsequenceset_base(ss_converted, value_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) - _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) - _check_error() - return result if result != _ffi.NULL else None - - -def always_le_tinstant_base(inst: "const TInstant *", value: "Datum") -> "int": - inst_converted = _ffi.cast("const TInstant *", inst) - value_converted = _ffi.cast("Datum", value) - result = _lib.always_le_tinstant_base(inst_converted, value_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def always_le_tsequence_base(seq: "const TSequence *", value: "Datum") -> "int": - seq_converted = _ffi.cast("const TSequence *", seq) - value_converted = _ffi.cast("Datum", value) - result = _lib.always_le_tsequence_base(seq_converted, value_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def always_le_tsequenceset_base(ss: "const TSequenceSet *", value: "Datum") -> "int": - ss_converted = _ffi.cast("const TSequenceSet *", ss) - value_converted = _ffi.cast("Datum", value) - result = _lib.always_le_tsequenceset_base(ss_converted, value_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) - _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) - _check_error() - return result if result != _ffi.NULL else None - - -def always_lt_tinstant_base(inst: "const TInstant *", value: "Datum") -> "int": - inst_converted = _ffi.cast("const TInstant *", inst) - value_converted = _ffi.cast("Datum", value) - result = _lib.always_lt_tinstant_base(inst_converted, value_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def always_lt_tsequence_base(seq: "const TSequence *", value: "Datum") -> "int": - seq_converted = _ffi.cast("const TSequence *", seq) - value_converted = _ffi.cast("Datum", value) - result = _lib.always_lt_tsequence_base(seq_converted, value_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def always_lt_tsequenceset_base(ss: "const TSequenceSet *", value: "Datum") -> "int": - ss_converted = _ffi.cast("const TSequenceSet *", ss) - value_converted = _ffi.cast("Datum", value) - result = _lib.always_lt_tsequenceset_base(ss_converted, value_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) - _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) - _check_error() - return result if result != _ffi.NULL else None - - -def ever_eq_tinstant_base(inst: "const TInstant *", value: "Datum") -> "int": - inst_converted = _ffi.cast("const TInstant *", inst) - value_converted = _ffi.cast("Datum", value) - result = _lib.ever_eq_tinstant_base(inst_converted, value_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def ever_eq_tpointinst_base(inst: "const TInstant *", value: "Datum") -> "int": - inst_converted = _ffi.cast("const TInstant *", inst) - value_converted = _ffi.cast("Datum", value) - result = _lib.ever_eq_tpointinst_base(inst_converted, value_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def ever_eq_tpointseq_base(seq: "const TSequence *", value: "Datum") -> "int": - seq_converted = _ffi.cast("const TSequence *", seq) - value_converted = _ffi.cast("Datum", value) - result = _lib.ever_eq_tpointseq_base(seq_converted, value_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def ever_eq_tpointseqset_base(ss: "const TSequenceSet *", value: "Datum") -> "int": - ss_converted = _ffi.cast("const TSequenceSet *", ss) - value_converted = _ffi.cast("Datum", value) - result = _lib.ever_eq_tpointseqset_base(ss_converted, value_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def ever_eq_tsequence_base(seq: "const TSequence *", value: "Datum") -> "int": - seq_converted = _ffi.cast("const TSequence *", seq) - value_converted = _ffi.cast("Datum", value) - result = _lib.ever_eq_tsequence_base(seq_converted, value_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def ever_eq_tsequenceset_base(ss: "const TSequenceSet *", value: "Datum") -> "int": - ss_converted = _ffi.cast("const TSequenceSet *", ss) - value_converted = _ffi.cast("Datum", value) - result = _lib.ever_eq_tsequenceset_base(ss_converted, value_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) - _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) - _check_error() - return result if result != _ffi.NULL else None - - -def ever_ne_tinstant_base(inst: "const TInstant *", value: "Datum") -> "int": - inst_converted = _ffi.cast("const TInstant *", inst) - value_converted = _ffi.cast("Datum", value) - result = _lib.ever_ne_tinstant_base(inst_converted, value_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def ever_ne_tpointinst_base(inst: "const TInstant *", value: "Datum") -> "int": - inst_converted = _ffi.cast("const TInstant *", inst) - value_converted = _ffi.cast("Datum", value) - result = _lib.ever_ne_tpointinst_base(inst_converted, value_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def ever_ne_tpointseq_base(seq: "const TSequence *", value: "Datum") -> "int": - seq_converted = _ffi.cast("const TSequence *", seq) - value_converted = _ffi.cast("Datum", value) - result = _lib.ever_ne_tpointseq_base(seq_converted, value_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def ever_ne_tpointseqset_base(ss: "const TSequenceSet *", value: "Datum") -> "int": - ss_converted = _ffi.cast("const TSequenceSet *", ss) - value_converted = _ffi.cast("Datum", value) - result = _lib.ever_ne_tpointseqset_base(ss_converted, value_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def ever_ne_tsequence_base(seq: "const TSequence *", value: "Datum") -> "int": - seq_converted = _ffi.cast("const TSequence *", seq) - value_converted = _ffi.cast("Datum", value) - result = _lib.ever_ne_tsequence_base(seq_converted, value_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def ever_ne_tsequenceset_base(ss: "const TSequenceSet *", value: "Datum") -> "int": - ss_converted = _ffi.cast("const TSequenceSet *", ss) - value_converted = _ffi.cast("Datum", value) - result = _lib.ever_ne_tsequenceset_base(ss_converted, value_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) - _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) - _check_error() - return result if result != _ffi.NULL else None - - -def ever_ge_tinstant_base(inst: "const TInstant *", value: "Datum") -> "int": - inst_converted = _ffi.cast("const TInstant *", inst) - value_converted = _ffi.cast("Datum", value) - result = _lib.ever_ge_tinstant_base(inst_converted, value_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def ever_ge_tsequence_base(seq: "const TSequence *", value: "Datum") -> "int": - seq_converted = _ffi.cast("const TSequence *", seq) - value_converted = _ffi.cast("Datum", value) - result = _lib.ever_ge_tsequence_base(seq_converted, value_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def ever_ge_tsequenceset_base(ss: "const TSequenceSet *", value: "Datum") -> "int": - ss_converted = _ffi.cast("const TSequenceSet *", ss) - value_converted = _ffi.cast("Datum", value) - result = _lib.ever_ge_tsequenceset_base(ss_converted, value_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) - _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) - _check_error() - return result if result != _ffi.NULL else None - - -def ever_gt_tinstant_base(inst: "const TInstant *", value: "Datum") -> "int": - inst_converted = _ffi.cast("const TInstant *", inst) - value_converted = _ffi.cast("Datum", value) - result = _lib.ever_gt_tinstant_base(inst_converted, value_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def ever_gt_tsequence_base(seq: "const TSequence *", value: "Datum") -> "int": - seq_converted = _ffi.cast("const TSequence *", seq) - value_converted = _ffi.cast("Datum", value) - result = _lib.ever_gt_tsequence_base(seq_converted, value_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def ever_gt_tsequenceset_base(ss: "const TSequenceSet *", value: "Datum") -> "int": - ss_converted = _ffi.cast("const TSequenceSet *", ss) - value_converted = _ffi.cast("Datum", value) - result = _lib.ever_gt_tsequenceset_base(ss_converted, value_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) - _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) - _check_error() - return result if result != _ffi.NULL else None - - -def ever_le_tinstant_base(inst: "const TInstant *", value: "Datum") -> "int": - inst_converted = _ffi.cast("const TInstant *", inst) - value_converted = _ffi.cast("Datum", value) - result = _lib.ever_le_tinstant_base(inst_converted, value_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def ever_le_tsequence_base(seq: "const TSequence *", value: "Datum") -> "int": - seq_converted = _ffi.cast("const TSequence *", seq) - value_converted = _ffi.cast("Datum", value) - result = _lib.ever_le_tsequence_base(seq_converted, value_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def ever_le_tsequenceset_base(ss: "const TSequenceSet *", value: "Datum") -> "int": - ss_converted = _ffi.cast("const TSequenceSet *", ss) - value_converted = _ffi.cast("Datum", value) - result = _lib.ever_le_tsequenceset_base(ss_converted, value_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) - _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) - _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) - _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) - _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) - _check_error() - 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) - _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) - _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) - _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) - _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) - _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) - _check_error() - return result if result != _ffi.NULL else 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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _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) - _check_error() - 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) - _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) - _check_error() - return result if result != _ffi.NULL else None, count[0] - - -def tpointseqset_azimuth(ss: "const TSequenceSet *") -> "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 tpointseqset_cumulative_length(ss: "const TSequenceSet *") -> "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 tpointseqset_is_simple(ss: "const TSequenceSet *") -> "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 tpointseqset_length(ss: "const TSequenceSet *") -> "double": - ss_converted = _ffi.cast("const TSequenceSet *", ss) - result = _lib.tpointseqset_length(ss_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) - _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) - _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) - _check_error() - return result if result != _ffi.NULL else None, count[0] - - -def tpointseqset_trajectory(ss: "const TSequenceSet *") -> "GSERIALIZED *": - ss_converted = _ffi.cast("const TSequenceSet *", ss) - result = _lib.tpointseqset_trajectory(ss_converted) - _check_error() - return result if result != _ffi.NULL else None - - -def tpoint_get_coord(temp: "const Temporal *", coord: int) -> "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 tgeompointinst_tgeogpointinst(inst: "const TInstant *", oper: bool) -> "TInstant *": - inst_converted = _ffi.cast("const TInstant *", inst) - result = _lib.tgeompointinst_tgeogpointinst(inst_converted, oper) - _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) - _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) - _check_error() - return result if result != _ffi.NULL else None - - -def tgeompoint_tgeogpoint(temp: "const Temporal *", oper: bool) -> "Temporal *": - temp_converted = _ffi.cast("const Temporal *", temp) - result = _lib.tgeompoint_tgeogpoint(temp_converted, oper) - _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) - _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) - _check_error() - return result if result != _ffi.NULL else None, count[0] - - -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) - _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) - _check_error() - return result if result != _ffi.NULL else None, count[0] - - -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) - _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) - _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) - _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) - _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) - _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) - _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) - _check_error() - return result if result != _ffi.NULL else None - - -def temporal_compact(temp: "const Temporal *") -> "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 tsequence_compact(seq: "const TSequence *") -> "TSequence *": - seq_converted = _ffi.cast("const TSequence *", seq) - result = _lib.tsequence_compact(seq_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) - _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) - _check_error() - - -def temporal_app_tinst_transfn( - state: "Temporal *", inst: "const TInstant *", maxdist: float, maxt: "Interval *" -) -> "Temporal *": - state_converted = _ffi.cast("Temporal *", state) - inst_converted = _ffi.cast("const TInstant *", inst) - maxt_converted = _ffi.cast("Interval *", maxt) - result = _lib.temporal_app_tinst_transfn( - state_converted, inst_converted, maxdist, maxt_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) - _check_error() - return result if result != _ffi.NULL else None - - -def tnumber_value_split( - temp: "const Temporal *", size: "Datum", origin: "Datum", buckets: "Datum **" -) -> "Tuple['Temporal **', 'int']": - temp_converted = _ffi.cast("const Temporal *", temp) - size_converted = _ffi.cast("Datum", size) - origin_converted = _ffi.cast("Datum", origin) - buckets_converted = [_ffi.cast("Datum *", x) for x in buckets] - count = _ffi.new("int *") - result = _lib.tnumber_value_split( - temp_converted, size_converted, origin_converted, buckets_converted, count - ) - _check_error() - return result if result != _ffi.NULL else None, count[0] - - -def tbox_tile( - value: "Datum", - t: int, - vsize: "Datum", - duration: "Interval *", - vorigin: "Datum", - torigin: int, - basetype: "meosType", -) -> "TBox *": - value_converted = _ffi.cast("Datum", value) - t_converted = _ffi.cast("TimestampTz", t) - vsize_converted = _ffi.cast("Datum", vsize) - duration_converted = _ffi.cast("Interval *", duration) - vorigin_converted = _ffi.cast("Datum", vorigin) - torigin_converted = _ffi.cast("TimestampTz", torigin) - basetype_converted = _ffi.cast("meosType", basetype) - result = _lib.tbox_tile( - value_converted, - t_converted, - vsize_converted, - duration_converted, - vorigin_converted, - torigin_converted, - basetype_converted, - ) - _check_error() - return result if result != _ffi.NULL else None diff --git a/pymeos_cffi/pyproject.toml b/pymeos_cffi/pyproject.toml deleted file mode 100644 index 01678641..00000000 --- a/pymeos_cffi/pyproject.toml +++ /dev/null @@ -1,47 +0,0 @@ -[build-system] -requires = ['setuptools>=61.0'] -build-backend = 'setuptools.build_meta' - -[tool.setuptools] -py-modules = [] - -[project] -name = 'pymeos_cffi' -dynamic = ['version'] -authors = [ - { name = 'Victor Divi', email = 'vdiviloper@gmail.com' } -] -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 :: Only', - 'Programming Language :: Python :: Implementation :: CPython', - 'Operating System :: POSIX', - 'Operating System :: Unix' -] -readme = 'README.md' -license = { file = 'LICENSE' } - -requires-python = '>=3.8' -dependencies = [ - 'cffi', - 'python-dateutil', - 'shapely' -] - -[project.urls] -'Homepage' = 'https://github.com/MobilityDB/PyMEOS' -'Bug Tracker' = 'https://github.com/MobilityDB/PyMEOS/issues' - -[tool.setuptools.dynamic] -version = { attr = "pymeos_cffi.__version__" } \ No newline at end of file diff --git a/pymeos_cffi/setup.py b/pymeos_cffi/setup.py deleted file mode 100644 index 7681da29..00000000 --- a/pymeos_cffi/setup.py +++ /dev/null @@ -1,37 +0,0 @@ -import os -import shutil - -from setuptools import setup - - -package_data = [] - -# Conditionally copy PROJ DATA to make self-contained wheels -if os.environ.get("PACKAGE_DATA"): - print("Copying PROJ data to package data") - 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( - projdatadir, - "pymeos_cffi/proj_data", - ignore=shutil.ignore_patterns("*.txt", "*.tif"), - ) # 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." - ) - package_data.append("proj_data/*") -else: - print("Not copying PROJ data to package data") - -setup( - packages=["pymeos_cffi", "pymeos_cffi.builder"], - setup_requires=["cffi"], - include_package_data=True, - package_data={"pymeos_cffi": package_data}, - cffi_modules=["pymeos_cffi/builder/build_pymeos.py:ffibuilder"], -) diff --git a/pymeos/pyproject.toml b/pyproject.toml similarity index 100% rename from pymeos/pyproject.toml rename to pyproject.toml diff --git a/pymeos/tests/__init__.py b/tests/__init__.py similarity index 100% rename from pymeos/tests/__init__.py rename to tests/__init__.py diff --git a/pymeos/tests/boxes/__init__.py b/tests/boxes/__init__.py similarity index 100% rename from pymeos/tests/boxes/__init__.py rename to tests/boxes/__init__.py diff --git a/pymeos/tests/boxes/stbox_test.py b/tests/boxes/stbox_test.py similarity index 100% rename from pymeos/tests/boxes/stbox_test.py rename to tests/boxes/stbox_test.py diff --git a/pymeos/tests/boxes/tbox_test.py b/tests/boxes/tbox_test.py similarity index 100% rename from pymeos/tests/boxes/tbox_test.py rename to tests/boxes/tbox_test.py diff --git a/pymeos/tests/collections/__init__.py b/tests/collections/__init__.py similarity index 100% rename from pymeos/tests/collections/__init__.py rename to tests/collections/__init__.py diff --git a/pymeos/tests/collections/number/__init__.py b/tests/collections/number/__init__.py similarity index 100% rename from pymeos/tests/collections/number/__init__.py rename to tests/collections/number/__init__.py diff --git a/pymeos/tests/collections/number/floatset_test.py b/tests/collections/number/floatset_test.py similarity index 96% rename from pymeos/tests/collections/number/floatset_test.py rename to tests/collections/number/floatset_test.py index cdf1ea2e..af376983 100644 --- a/pymeos/tests/collections/number/floatset_test.py +++ b/tests/collections/number/floatset_test.py @@ -1,250 +1,250 @@ -from copy import copy -from typing import List - -import pytest - -from pymeos import FloatSet, FloatSpan, FloatSpanSet -from tests.conftest import TestPyMEOS - - -class TestFloatSet(TestPyMEOS): - floatset = FloatSet("{1, 2, 3}") - - @staticmethod - def assert_intset_equality(floatset: FloatSet, values: List[int]): - assert floatset.num_elements() == len(values) - assert floatset.elements() == values - - -class TestFloatSetConstructors(TestFloatSet): - def test_string_constructor(self): - self.assert_intset_equality(self.floatset, [1, 2, 3]) - - def test_list_constructor(self): - floatset = FloatSet(elements=[1, 2, 3]) - self.assert_intset_equality(floatset, [1, 2, 3]) - - def test_hexwkb_constructor(self): - floatset = FloatSet.from_hexwkb(FloatSet(elements=[1, 2, 3]).as_hexwkb()) - self.assert_intset_equality(floatset, [1, 2, 3]) - - def test_from_as_constructor(self): - assert self.floatset == FloatSet(str(self.floatset)) - assert self.floatset == FloatSet.from_wkb(self.floatset.as_wkb()) - assert self.floatset == FloatSet.from_hexwkb(self.floatset.as_hexwkb()) - - def test_copy_constructor(self): - intset_copy = copy(self.floatset) - assert self.floatset == intset_copy - assert self.floatset is not intset_copy - - -class TestFloatSetOutputs(TestFloatSet): - def test_str(self): - assert str(self.floatset) == "{1, 2, 3}" - - def test_repr(self): - assert repr(self.floatset) == "FloatSet({1, 2, 3})" - - def test_as_hexwkb(self): - assert self.floatset == FloatSet.from_hexwkb(self.floatset.as_hexwkb()) - - -# class TestIntConversions(TestFloatSet): - -# def test_to_spanset(self): -# assert self.floatset.to_spanset() == FloatSpanSet( -# '{[1, 1], [2, 2], [3, 3]}') - - -class TestFloatSetAccessors(TestFloatSet): - def test_to_span(self): - assert self.floatset.to_span() == FloatSpan("[1, 3]") - - def test_num_elements(self): - assert self.floatset.num_elements() == 3 - - def test_start_element(self): - assert self.floatset.start_element() == 1 - - def test_end_element(self): - assert self.floatset.end_element() == 3 - - def test_element_n(self): - assert self.floatset.element_n(1) == 2 - - def test_element_n_out_of_range(self): - with pytest.raises(IndexError): - self.floatset.element_n(3) - - def test_elements(self): - assert self.floatset.elements() == [1, 2, 3] - - def test_hash(self): - assert hash(self.floatset) == 2419122126 - - -class TestFloatSetTopologicalFunctions(TestFloatSet): - value = 5.0 - other = FloatSet("{5, 10}") - - @pytest.mark.parametrize( - "arg, result", - [ - (other, False), - ], - ids=["other"], - ) - def test_is_contained_in(self, arg, result): - assert self.floatset.is_contained_in(arg) == result - - @pytest.mark.parametrize( - "arg, result", - [ - (value, False), - (other, False), - ], - ids=["value", "other"], - ) - def test_contains(self, arg, result): - assert self.floatset.contains(arg) == result - - @pytest.mark.parametrize( - "arg, result", - [ - (other, False), - ], - ids=["other"], - ) - def test_overlaps(self, arg, result): - assert self.floatset.overlaps(arg) == result - - -class TestFloatSetPositionFunctions(TestFloatSet): - value = 5.0 - other = FloatSet("{5, 10}") - - @pytest.mark.parametrize( - "arg, result", - [ - (value, True), - (other, True), - ], - ids=["value", "other"], - ) - def test_is_left(self, arg, result): - assert self.floatset.is_left(arg) == result - - @pytest.mark.parametrize( - "arg, result", - [ - (value, True), - (other, True), - ], - ids=["value", "other"], - ) - def test_is_over_or_left(self, arg, result): - assert self.floatset.is_over_or_left(arg) == result - - @pytest.mark.parametrize( - "arg, result", - [ - (value, False), - (other, False), - ], - ids=["value", "other"], - ) - def test_is_right(self, arg, result): - assert self.floatset.is_right(arg) == result - - @pytest.mark.parametrize( - "arg, result", - [ - (value, False), - (other, False), - ], - ids=["value", "other"], - ) - def test_is_over_or_right(self, arg, result): - assert self.floatset.is_over_or_right(arg) == result - - @pytest.mark.parametrize( - "arg, result", - [ - (value, 2.0), - (other, 2.0), - ], - ids=["value", "other"], - ) - def test_distance(self, arg, result): - assert self.floatset.distance(arg) == result - - -class TestFloatSetSetFunctions(TestFloatSet): - value = 5.0 - floatset = FloatSet("{1, 10}") - - @pytest.mark.parametrize("other", [value, floatset], ids=["value", "floatset"]) - def test_intersection(self, other): - self.floatset.intersection(other) - self.floatset * other - - @pytest.mark.parametrize("other", [value, floatset], ids=["value", "floatset"]) - def test_union(self, other): - self.floatset.union(other) - self.floatset + other - - @pytest.mark.parametrize("other", [value, floatset], ids=["value", "floatset"]) - def test_minus(self, other): - self.floatset.minus(other) - self.floatset - other - - -class TestFloatSetComparisons(TestFloatSet): - floatset = FloatSet("{1, 10}") - other = FloatSet("{2, 10}") - - def test_eq(self): - _ = self.floatset == self.other - - def test_ne(self): - _ = self.floatset != self.other - - def test_lt(self): - _ = self.floatset < self.other - - def test_le(self): - _ = self.floatset <= self.other - - def test_gt(self): - _ = self.floatset > self.other - - def test_ge(self): - _ = self.floatset >= self.other - - -# class TestFloatSetTransformationFunctions(TestFloatSet): - -# @pytest.mark.parametrize( -# 'delta,result', -# [(4, [5, 6, 8]), -# (-4, [-3, -1, 0]), -# ], -# ids=['positive delta', 'negative delta'] -# ) -# def test_shift(self, delta, result): -# shifted = self.floatset.shift(delta) -# self.assert_intset_equality(shifted, result) - -# @pytest.mark.parametrize( -# 'delta,result', -# [(6, [1, 4, 7])], -# ids=['positive'] -# ) -# def test_scale(self, delta, result): -# scaled = self.floatset.scale(delta) -# self.assert_intset_equality(scaled, result) - -# def test_shift_scale(self): -# shifted_scaled = self.floatset.shift_scale(4, 4) -# self.assert_intset_equality(shifted_scaled, [5, 7, 9]) +from copy import copy +from typing import List + +import pytest + +from pymeos import FloatSet, FloatSpan, FloatSpanSet +from tests.conftest import TestPyMEOS + + +class TestFloatSet(TestPyMEOS): + floatset = FloatSet("{1, 2, 3}") + + @staticmethod + def assert_intset_equality(floatset: FloatSet, values: List[int]): + assert floatset.num_elements() == len(values) + assert floatset.elements() == values + + +class TestFloatSetConstructors(TestFloatSet): + def test_string_constructor(self): + self.assert_intset_equality(self.floatset, [1, 2, 3]) + + def test_list_constructor(self): + floatset = FloatSet(elements=[1, 2, 3]) + self.assert_intset_equality(floatset, [1, 2, 3]) + + def test_hexwkb_constructor(self): + floatset = FloatSet.from_hexwkb(FloatSet(elements=[1, 2, 3]).as_hexwkb()) + self.assert_intset_equality(floatset, [1, 2, 3]) + + def test_from_as_constructor(self): + assert self.floatset == FloatSet(str(self.floatset)) + assert self.floatset == FloatSet.from_wkb(self.floatset.as_wkb()) + assert self.floatset == FloatSet.from_hexwkb(self.floatset.as_hexwkb()) + + def test_copy_constructor(self): + intset_copy = copy(self.floatset) + assert self.floatset == intset_copy + assert self.floatset is not intset_copy + + +class TestFloatSetOutputs(TestFloatSet): + def test_str(self): + assert str(self.floatset) == "{1, 2, 3}" + + def test_repr(self): + assert repr(self.floatset) == "FloatSet({1, 2, 3})" + + def test_as_hexwkb(self): + assert self.floatset == FloatSet.from_hexwkb(self.floatset.as_hexwkb()) + + +# class TestIntConversions(TestFloatSet): + +# def test_to_spanset(self): +# assert self.floatset.to_spanset() == FloatSpanSet( +# '{[1, 1], [2, 2], [3, 3]}') + + +class TestFloatSetAccessors(TestFloatSet): + def test_to_span(self): + assert self.floatset.to_span() == FloatSpan("[1, 3]") + + def test_num_elements(self): + assert self.floatset.num_elements() == 3 + + def test_start_element(self): + assert self.floatset.start_element() == 1 + + def test_end_element(self): + assert self.floatset.end_element() == 3 + + def test_element_n(self): + assert self.floatset.element_n(1) == 2 + + def test_element_n_out_of_range(self): + with pytest.raises(IndexError): + self.floatset.element_n(3) + + def test_elements(self): + assert self.floatset.elements() == [1, 2, 3] + + def test_hash(self): + assert hash(self.floatset) == 2419122126 + + +class TestFloatSetTopologicalFunctions(TestFloatSet): + value = 5.0 + other = FloatSet("{5, 10}") + + @pytest.mark.parametrize( + "arg, result", + [ + (other, False), + ], + ids=["other"], + ) + def test_is_contained_in(self, arg, result): + assert self.floatset.is_contained_in(arg) == result + + @pytest.mark.parametrize( + "arg, result", + [ + (value, False), + (other, False), + ], + ids=["value", "other"], + ) + def test_contains(self, arg, result): + assert self.floatset.contains(arg) == result + + @pytest.mark.parametrize( + "arg, result", + [ + (other, False), + ], + ids=["other"], + ) + def test_overlaps(self, arg, result): + assert self.floatset.overlaps(arg) == result + + +class TestFloatSetPositionFunctions(TestFloatSet): + value = 5.0 + other = FloatSet("{5, 10}") + + @pytest.mark.parametrize( + "arg, result", + [ + (value, True), + (other, True), + ], + ids=["value", "other"], + ) + def test_is_left(self, arg, result): + assert self.floatset.is_left(arg) == result + + @pytest.mark.parametrize( + "arg, result", + [ + (value, True), + (other, True), + ], + ids=["value", "other"], + ) + def test_is_over_or_left(self, arg, result): + assert self.floatset.is_over_or_left(arg) == result + + @pytest.mark.parametrize( + "arg, result", + [ + (value, False), + (other, False), + ], + ids=["value", "other"], + ) + def test_is_right(self, arg, result): + assert self.floatset.is_right(arg) == result + + @pytest.mark.parametrize( + "arg, result", + [ + (value, False), + (other, False), + ], + ids=["value", "other"], + ) + def test_is_over_or_right(self, arg, result): + assert self.floatset.is_over_or_right(arg) == result + + @pytest.mark.parametrize( + "arg, result", + [ + (value, 2.0), + (other, 2.0), + ], + ids=["value", "other"], + ) + def test_distance(self, arg, result): + assert self.floatset.distance(arg) == result + + +class TestFloatSetSetFunctions(TestFloatSet): + value = 5.0 + floatset = FloatSet("{1, 10}") + + @pytest.mark.parametrize("other", [value, floatset], ids=["value", "floatset"]) + def test_intersection(self, other): + self.floatset.intersection(other) + self.floatset * other + + @pytest.mark.parametrize("other", [value, floatset], ids=["value", "floatset"]) + def test_union(self, other): + self.floatset.union(other) + self.floatset + other + + @pytest.mark.parametrize("other", [value, floatset], ids=["value", "floatset"]) + def test_minus(self, other): + self.floatset.minus(other) + self.floatset - other + + +class TestFloatSetComparisons(TestFloatSet): + floatset = FloatSet("{1, 10}") + other = FloatSet("{2, 10}") + + def test_eq(self): + _ = self.floatset == self.other + + def test_ne(self): + _ = self.floatset != self.other + + def test_lt(self): + _ = self.floatset < self.other + + def test_le(self): + _ = self.floatset <= self.other + + def test_gt(self): + _ = self.floatset > self.other + + def test_ge(self): + _ = self.floatset >= self.other + + +# class TestFloatSetTransformationFunctions(TestFloatSet): + +# @pytest.mark.parametrize( +# 'delta,result', +# [(4, [5, 6, 8]), +# (-4, [-3, -1, 0]), +# ], +# ids=['positive delta', 'negative delta'] +# ) +# def test_shift(self, delta, result): +# shifted = self.floatset.shift(delta) +# self.assert_intset_equality(shifted, result) + +# @pytest.mark.parametrize( +# 'delta,result', +# [(6, [1, 4, 7])], +# ids=['positive'] +# ) +# def test_scale(self, delta, result): +# scaled = self.floatset.scale(delta) +# self.assert_intset_equality(scaled, result) + +# def test_shift_scale(self): +# shifted_scaled = self.floatset.shift_scale(4, 4) +# self.assert_intset_equality(shifted_scaled, [5, 7, 9]) diff --git a/pymeos/tests/collections/number/intset_test.py b/tests/collections/number/intset_test.py similarity index 96% rename from pymeos/tests/collections/number/intset_test.py rename to tests/collections/number/intset_test.py index 27cd0a12..01d13352 100644 --- a/pymeos/tests/collections/number/intset_test.py +++ b/tests/collections/number/intset_test.py @@ -1,250 +1,250 @@ -from copy import copy -from typing import List - -import pytest - -from pymeos import IntSet, IntSpan, IntSpanSet -from tests.conftest import TestPyMEOS - - -class TestIntSet(TestPyMEOS): - intset = IntSet("{1, 2, 3}") - - @staticmethod - def assert_intset_equality(intset: IntSet, values: List[int]): - assert intset.num_elements() == len(values) - assert intset.elements() == values - - -class TestIntSetConstructors(TestIntSet): - def test_string_constructor(self): - self.assert_intset_equality(self.intset, [1, 2, 3]) - - def test_list_constructor(self): - intset = IntSet(elements=[1, 2, 3]) - self.assert_intset_equality(intset, [1, 2, 3]) - - def test_hexwkb_constructor(self): - intset = IntSet.from_hexwkb(IntSet(elements=[1, 2, 3]).as_hexwkb()) - self.assert_intset_equality(intset, [1, 2, 3]) - - def test_from_as_constructor(self): - assert self.intset == IntSet(str(self.intset)) - assert self.intset == IntSet.from_wkb(self.intset.as_wkb()) - assert self.intset == IntSet.from_hexwkb(self.intset.as_hexwkb()) - - def test_copy_constructor(self): - intset_copy = copy(self.intset) - assert self.intset == intset_copy - assert self.intset is not intset_copy - - -class TestIntSetOutputs(TestIntSet): - def test_str(self): - assert str(self.intset) == "{1, 2, 3}" - - def test_repr(self): - assert repr(self.intset) == "IntSet({1, 2, 3})" - - def test_as_hexwkb(self): - assert self.intset == IntSet.from_hexwkb(self.intset.as_hexwkb()) - - -# class TestIntConversions(TestIntSet): - -# def test_to_spanset(self): -# assert self.intset.to_spanset() == IntSpanSet( -# '{[1, 1], [2, 2], [3, 3]}') - - -class TestIntSetAccessors(TestIntSet): - def test_to_span(self): - assert self.intset.to_span() == IntSpan("[1, 3]") - - def test_num_elements(self): - assert self.intset.num_elements() == 3 - - def test_start_element(self): - assert self.intset.start_element() == 1 - - def test_end_element(self): - assert self.intset.end_element() == 3 - - def test_element_n(self): - assert self.intset.element_n(1) == 2 - - def test_element_n_out_of_range(self): - with pytest.raises(IndexError): - self.intset.element_n(3) - - def test_elements(self): - assert self.intset.elements() == [1, 2, 3] - - def test_hash(self): - assert hash(self.intset) == 3969573766 - - -class TestIntSetTopologicalFunctions(TestIntSet): - value = 5 - other = IntSet("{5, 10}") - - @pytest.mark.parametrize( - "arg, result", - [ - (other, False), - ], - ids=["other"], - ) - def test_is_contained_in(self, arg, result): - assert self.intset.is_contained_in(arg) == result - - @pytest.mark.parametrize( - "arg, result", - [ - (value, False), - (other, False), - ], - ids=["value", "other"], - ) - def test_contains(self, arg, result): - assert self.intset.contains(arg) == result - - @pytest.mark.parametrize( - "arg, result", - [ - (other, False), - ], - ids=["other"], - ) - def test_overlaps(self, arg, result): - assert self.intset.overlaps(arg) == result - - -class TestIntSetPositionFunctions(TestIntSet): - value = 5 - other = IntSet("{5, 10}") - - @pytest.mark.parametrize( - "arg, result", - [ - (value, True), - (other, True), - ], - ids=["value", "other"], - ) - def test_is_left(self, arg, result): - assert self.intset.is_left(arg) == result - - @pytest.mark.parametrize( - "arg, result", - [ - (value, True), - (other, True), - ], - ids=["value", "other"], - ) - def test_is_over_or_left(self, arg, result): - assert self.intset.is_over_or_left(arg) == result - - @pytest.mark.parametrize( - "arg, result", - [ - (value, False), - (other, False), - ], - ids=["value", "other"], - ) - def test_is_right(self, arg, result): - assert self.intset.is_right(arg) == result - - @pytest.mark.parametrize( - "arg, result", - [ - (value, False), - (other, False), - ], - ids=["value", "other"], - ) - def test_is_over_or_right(self, arg, result): - assert self.intset.is_over_or_right(arg) == result - - @pytest.mark.parametrize( - "arg, result", - [ - (value, 2), - (other, 2), - ], - ids=["value", "other"], - ) - def test_distance(self, arg, result): - assert self.intset.distance(arg) == result - - -class TestIntSetSetFunctions(TestIntSet): - value = 1 - intset = IntSet("{1, 10}") - - @pytest.mark.parametrize("other", [value, intset], ids=["value", "intset"]) - def test_intersection(self, other): - self.intset.intersection(other) - self.intset * other - - @pytest.mark.parametrize("other", [value, intset], ids=["value", "intset"]) - def test_union(self, other): - self.intset.union(other) - self.intset + other - - @pytest.mark.parametrize("other", [value, intset], ids=["value", "intset"]) - def test_minus(self, other): - self.intset.minus(other) - self.intset - other - - -class TestIntSetComparisons(TestIntSet): - intset = IntSet("{1, 10}") - other = IntSet("{2, 10}") - - def test_eq(self): - _ = self.intset == self.other - - def test_ne(self): - _ = self.intset != self.other - - def test_lt(self): - _ = self.intset < self.other - - def test_le(self): - _ = self.intset <= self.other - - def test_gt(self): - _ = self.intset > self.other - - def test_ge(self): - _ = self.intset >= self.other - - -# class TestIntSetTransformationFunctions(TestIntSet): - -# @pytest.mark.parametrize( -# 'delta,result', -# [(4, [5, 6, 8]), -# (-4, [-3, -1, 0]), -# ], -# ids=['positive delta', 'negative delta'] -# ) -# def test_shift(self, delta, result): -# shifted = self.intset.shift(delta) -# self.assert_intset_equality(shifted, result) - -# @pytest.mark.parametrize( -# 'delta,result', -# [(6, [1, 4, 7])], -# ids=['positive'] -# ) -# def test_scale(self, delta, result): -# scaled = self.intset.scale(delta) -# self.assert_intset_equality(scaled, result) - -# def test_shift_scale(self): -# shifted_scaled = self.intset.shift_scale(4, 4) -# self.assert_intset_equality(shifted_scaled, [5, 7, 9]) +from copy import copy +from typing import List + +import pytest + +from pymeos import IntSet, IntSpan, IntSpanSet +from tests.conftest import TestPyMEOS + + +class TestIntSet(TestPyMEOS): + intset = IntSet("{1, 2, 3}") + + @staticmethod + def assert_intset_equality(intset: IntSet, values: List[int]): + assert intset.num_elements() == len(values) + assert intset.elements() == values + + +class TestIntSetConstructors(TestIntSet): + def test_string_constructor(self): + self.assert_intset_equality(self.intset, [1, 2, 3]) + + def test_list_constructor(self): + intset = IntSet(elements=[1, 2, 3]) + self.assert_intset_equality(intset, [1, 2, 3]) + + def test_hexwkb_constructor(self): + intset = IntSet.from_hexwkb(IntSet(elements=[1, 2, 3]).as_hexwkb()) + self.assert_intset_equality(intset, [1, 2, 3]) + + def test_from_as_constructor(self): + assert self.intset == IntSet(str(self.intset)) + assert self.intset == IntSet.from_wkb(self.intset.as_wkb()) + assert self.intset == IntSet.from_hexwkb(self.intset.as_hexwkb()) + + def test_copy_constructor(self): + intset_copy = copy(self.intset) + assert self.intset == intset_copy + assert self.intset is not intset_copy + + +class TestIntSetOutputs(TestIntSet): + def test_str(self): + assert str(self.intset) == "{1, 2, 3}" + + def test_repr(self): + assert repr(self.intset) == "IntSet({1, 2, 3})" + + def test_as_hexwkb(self): + assert self.intset == IntSet.from_hexwkb(self.intset.as_hexwkb()) + + +# class TestIntConversions(TestIntSet): + +# def test_to_spanset(self): +# assert self.intset.to_spanset() == IntSpanSet( +# '{[1, 1], [2, 2], [3, 3]}') + + +class TestIntSetAccessors(TestIntSet): + def test_to_span(self): + assert self.intset.to_span() == IntSpan("[1, 3]") + + def test_num_elements(self): + assert self.intset.num_elements() == 3 + + def test_start_element(self): + assert self.intset.start_element() == 1 + + def test_end_element(self): + assert self.intset.end_element() == 3 + + def test_element_n(self): + assert self.intset.element_n(1) == 2 + + def test_element_n_out_of_range(self): + with pytest.raises(IndexError): + self.intset.element_n(3) + + def test_elements(self): + assert self.intset.elements() == [1, 2, 3] + + def test_hash(self): + assert hash(self.intset) == 3969573766 + + +class TestIntSetTopologicalFunctions(TestIntSet): + value = 5 + other = IntSet("{5, 10}") + + @pytest.mark.parametrize( + "arg, result", + [ + (other, False), + ], + ids=["other"], + ) + def test_is_contained_in(self, arg, result): + assert self.intset.is_contained_in(arg) == result + + @pytest.mark.parametrize( + "arg, result", + [ + (value, False), + (other, False), + ], + ids=["value", "other"], + ) + def test_contains(self, arg, result): + assert self.intset.contains(arg) == result + + @pytest.mark.parametrize( + "arg, result", + [ + (other, False), + ], + ids=["other"], + ) + def test_overlaps(self, arg, result): + assert self.intset.overlaps(arg) == result + + +class TestIntSetPositionFunctions(TestIntSet): + value = 5 + other = IntSet("{5, 10}") + + @pytest.mark.parametrize( + "arg, result", + [ + (value, True), + (other, True), + ], + ids=["value", "other"], + ) + def test_is_left(self, arg, result): + assert self.intset.is_left(arg) == result + + @pytest.mark.parametrize( + "arg, result", + [ + (value, True), + (other, True), + ], + ids=["value", "other"], + ) + def test_is_over_or_left(self, arg, result): + assert self.intset.is_over_or_left(arg) == result + + @pytest.mark.parametrize( + "arg, result", + [ + (value, False), + (other, False), + ], + ids=["value", "other"], + ) + def test_is_right(self, arg, result): + assert self.intset.is_right(arg) == result + + @pytest.mark.parametrize( + "arg, result", + [ + (value, False), + (other, False), + ], + ids=["value", "other"], + ) + def test_is_over_or_right(self, arg, result): + assert self.intset.is_over_or_right(arg) == result + + @pytest.mark.parametrize( + "arg, result", + [ + (value, 2), + (other, 2), + ], + ids=["value", "other"], + ) + def test_distance(self, arg, result): + assert self.intset.distance(arg) == result + + +class TestIntSetSetFunctions(TestIntSet): + value = 1 + intset = IntSet("{1, 10}") + + @pytest.mark.parametrize("other", [value, intset], ids=["value", "intset"]) + def test_intersection(self, other): + self.intset.intersection(other) + self.intset * other + + @pytest.mark.parametrize("other", [value, intset], ids=["value", "intset"]) + def test_union(self, other): + self.intset.union(other) + self.intset + other + + @pytest.mark.parametrize("other", [value, intset], ids=["value", "intset"]) + def test_minus(self, other): + self.intset.minus(other) + self.intset - other + + +class TestIntSetComparisons(TestIntSet): + intset = IntSet("{1, 10}") + other = IntSet("{2, 10}") + + def test_eq(self): + _ = self.intset == self.other + + def test_ne(self): + _ = self.intset != self.other + + def test_lt(self): + _ = self.intset < self.other + + def test_le(self): + _ = self.intset <= self.other + + def test_gt(self): + _ = self.intset > self.other + + def test_ge(self): + _ = self.intset >= self.other + + +# class TestIntSetTransformationFunctions(TestIntSet): + +# @pytest.mark.parametrize( +# 'delta,result', +# [(4, [5, 6, 8]), +# (-4, [-3, -1, 0]), +# ], +# ids=['positive delta', 'negative delta'] +# ) +# def test_shift(self, delta, result): +# shifted = self.intset.shift(delta) +# self.assert_intset_equality(shifted, result) + +# @pytest.mark.parametrize( +# 'delta,result', +# [(6, [1, 4, 7])], +# ids=['positive'] +# ) +# def test_scale(self, delta, result): +# scaled = self.intset.scale(delta) +# self.assert_intset_equality(scaled, result) + +# def test_shift_scale(self): +# shifted_scaled = self.intset.shift_scale(4, 4) +# self.assert_intset_equality(shifted_scaled, [5, 7, 9]) diff --git a/pymeos/tests/collections/number/intspan_test.py b/tests/collections/number/intspan_test.py similarity index 100% rename from pymeos/tests/collections/number/intspan_test.py rename to tests/collections/number/intspan_test.py diff --git a/pymeos/tests/collections/text/__init__.py b/tests/collections/text/__init__.py similarity index 100% rename from pymeos/tests/collections/text/__init__.py rename to tests/collections/text/__init__.py diff --git a/pymeos/tests/collections/text/textset_test.py b/tests/collections/text/textset_test.py similarity index 100% rename from pymeos/tests/collections/text/textset_test.py rename to tests/collections/text/textset_test.py diff --git a/pymeos/tests/collections/time/__init__.py b/tests/collections/time/__init__.py similarity index 100% rename from pymeos/tests/collections/time/__init__.py rename to tests/collections/time/__init__.py diff --git a/pymeos/tests/collections/time/dateset_test.py b/tests/collections/time/dateset_test.py similarity index 100% rename from pymeos/tests/collections/time/dateset_test.py rename to tests/collections/time/dateset_test.py diff --git a/pymeos/tests/collections/time/tstzset_test.py b/tests/collections/time/tstzset_test.py similarity index 100% rename from pymeos/tests/collections/time/tstzset_test.py rename to tests/collections/time/tstzset_test.py diff --git a/pymeos/tests/collections/time/tstzspan_test.py b/tests/collections/time/tstzspan_test.py similarity index 100% rename from pymeos/tests/collections/time/tstzspan_test.py rename to tests/collections/time/tstzspan_test.py diff --git a/pymeos/tests/collections/time/tstzspanset_test.py b/tests/collections/time/tstzspanset_test.py similarity index 100% rename from pymeos/tests/collections/time/tstzspanset_test.py rename to tests/collections/time/tstzspanset_test.py diff --git a/pymeos/tests/conftest.py b/tests/conftest.py similarity index 100% rename from pymeos/tests/conftest.py rename to tests/conftest.py diff --git a/pymeos/tests/main/__init__.py b/tests/main/__init__.py similarity index 100% rename from pymeos/tests/main/__init__.py rename to tests/main/__init__.py diff --git a/pymeos/tests/main/tbool_test.py b/tests/main/tbool_test.py similarity index 100% rename from pymeos/tests/main/tbool_test.py rename to tests/main/tbool_test.py diff --git a/pymeos/tests/main/tfloat_test.py b/tests/main/tfloat_test.py similarity index 100% rename from pymeos/tests/main/tfloat_test.py rename to tests/main/tfloat_test.py diff --git a/pymeos/tests/main/tgeogpoint_test.py b/tests/main/tgeogpoint_test.py similarity index 100% rename from pymeos/tests/main/tgeogpoint_test.py rename to tests/main/tgeogpoint_test.py diff --git a/pymeos/tests/main/tgeompoint_test.py b/tests/main/tgeompoint_test.py similarity index 100% rename from pymeos/tests/main/tgeompoint_test.py rename to tests/main/tgeompoint_test.py diff --git a/pymeos/tests/main/tint_test.py b/tests/main/tint_test.py similarity index 100% rename from pymeos/tests/main/tint_test.py rename to tests/main/tint_test.py diff --git a/pymeos/tests/main/ttext_test.py b/tests/main/ttext_test.py similarity index 100% rename from pymeos/tests/main/ttext_test.py rename to tests/main/ttext_test.py diff --git a/pymeos/tests/temporal/__init__.py b/tests/temporal/__init__.py similarity index 100% rename from pymeos/tests/temporal/__init__.py rename to tests/temporal/__init__.py diff --git a/pymeos/tests/temporal/interpolation_test.py b/tests/temporal/interpolation_test.py similarity index 100% rename from pymeos/tests/temporal/interpolation_test.py rename to tests/temporal/interpolation_test.py