commit 9251b3a196a2bb9f24bb007c63eec699d8475347
Author: NeilClack
Date: Fri Aug 7 14:51:41 2026 -0500
initial commit
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..0ec03f0
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,31 @@
+# Build directories
+build/
+cmake-build-*/
+
+# Nix
+.direnv/
+result
+
+# IDE
+.vscode/
+.idea/
+*.swp
+*.swo
+*~
+
+# OS
+.DS_Store
+Thumbs.db
+
+# Build artifacts
+*.o
+*.obj
+*.dylib
+*.so
+*.dll
+*.a
+*.lib
+*.exe
+
+# Compiled binary
+bin/
diff --git a/AGENTS.md b/AGENTS.md
new file mode 100644
index 0000000..ea5dbea
--- /dev/null
+++ b/AGENTS.md
@@ -0,0 +1,206 @@
+# RadiantWave — Agent Instructions
+
+## What This Is
+
+A kiosk app for RadiantWave wellness technology. Displays scrolling proclamation
+text (Fibonacci line-length pattern, per-frequency color palettes), plays
+solfeggio-frequency audio, and runs a first-run provisioning walkthrough on a
+headless Linux kiosk. Talks to `https://portal.radiantwavetech.com/api/v2`.
+
+**Language:** C++17 (no extensions). **Build:** CMake + Ninja.
+**Graphics:** SDL3 + SDL3_ttf/SDL3_image. **Audio:** SDL3_mixer.
+**Also links:** SDL3_net, SQLite3, libcurl, OpenSSL, GTest.
+**Linux-only:** libsystemd (sd-bus) via pkg-config, compiled only when
+`UNIX AND NOT APPLE` — guarded by `#ifdef __linux__` in the network manager.
+
+---
+
+## Build & Run
+
+```sh
+cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug
+cmake --build build # builds the app AND every test binary
+./build/radiantwave
+```
+
+The Home footer's top "Version" row is baked in at build time. Default it to
+the project version, or pass your own at configure time:
+
+```sh
+cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug -DAPP_VERSION="1.2.3"
+```
+
+The Nix package passes its flake version automatically via `cmakeFlags`.
+
+The portal API key is also a build-time argument: `-DAPI_KEY="..."` (CMake) or
+`apiKey` on `callPackage` (Nix). It is compiled into the binary as the
+`Authorization: Bearer` token and defaults to empty (no auth header). Keep the
+real value in CI secrets, never in source — rotate by rebuilding with a new
+key.
+
+- Development happens on macOS; WiFi/D-Bus code is Linux-only, but
+ `NetworkManager::hasInternet()` (a raw TCP probe) works everywhere, so the
+ provisioning walkthrough does not trap a Mac on the WiFi page.
+- The app creates a **1920x1080 fullscreen** window with VSync and a hidden
+ cursor. `~/.local/radiantwave/config.yaml` (YAML) and
+ `~/.local/radiantwave/radiantwave.db` (SQLite, WAL) are created at first run.
+- No root `flake.nix` exists; the Nix flake in `archive/` is reference only.
+
+---
+
+## Tests
+
+There is **no ctest integration** and no single "run all" target. Each test
+file is its own `add_executable` in `CMakeLists.txt`; build them all with
+`cmake --build build`, then run each `./build/test_*` binary.
+
+Two frameworks coexist:
+- `tests`, `test_assets`, `test_provisioning` — the minimal built-in harness
+ (`tests/test_harness.h`, `TEST(name)` + `RUN_ALL_TESTS()`).
+- Everything else — GoogleTest (`GTest::gtest_main`). GTest is a hard
+ `find_package` requirement; the build fails without it.
+
+Test targets: `tests`, `test_assets`, `test_provisioning`, `test_network_unit`,
+`test_config`, `test_db`, `test_proclamation_sync`, `test_api_client`,
+`test_license_service`, `test_license_status`, `test_validation`,
+`test_date_format`, `test_timezone`, `test_logger`, `test_audio`,
+`test_audio_downloader`, `test_fibonacci_pattern`, `test_scroller_streams`,
+`test_fibonacci_scrambler`, `test_color_palettes`.
+
+New test files must be registered as a new `add_executable` target in
+`CMakeLists.txt` (there is no glob). `test_assets` must pass before committing —
+it checks the font and image files exist.
+
+---
+
+## Runtime data & keys
+
+- `AppState` (in `app_state.h`) holds renderer, `PageManager`, `KeybindManager`,
+ `config`, `db`, `network`, `audio`, `audioDownloader`, `licenseTracker`, and
+ provisioning flags. No globals — pass `AppState&` around.
+- Device identity/state lives in the SQLite `system_kv` table. Canonical keys
+ are in `src/db/db_keys.h`: `email_address`, `license_key`,
+ `subscription_level_id/name/description`, `license_last_verified` (7-day
+ offline grace window for a known-good license).
+- `ConfigManager` hot-reloads `config.yaml` from a watcher thread and fires
+ `onChanged` callbacks; `AudioManager` volume/device/`dynamic_audio` are read
+ from it.
+
+---
+
+## First-run provisioning walkthrough
+
+Fixed prerequisite order (`src/provisioning.h`), evaluated on every boot; the
+first missing step's page is pushed:
+
+1. Internet reachable? → `WiFiSetupPage`
+2. Email address set? → `EmailAddressPage`
+3. License key set? → `LicenseKeyPage`
+4. Everything satisfied → `Home`
+
+`advance()` pops the current step and re-evaluates; internet is only re-probed
+when it was still missing (cached in `state.walkthroughInternetUp`). A
+brand-new device (nothing configured) only sets the `firstRunWalkthrough`
+placeholder flag — the welcome walkthrough is not implemented yet.
+
+---
+
+## Architecture
+
+### Entry point (`src/main.cpp`)
+
+SDL3 callback API (`SDL_MAIN_USE_CALLBACKS`): `SDL_AppInit` inits subsystems
+and calls `provisioning::begin`, `SDL_AppEvent` routes through keybinds then
+pages, `SDL_AppIterate` updates/renders, `SDL_AppQuit` tears down.
+
+### Pages & navigation
+
+`Page` lifecycle (`src/page.h`): `onPush`/`onResume` create textures,
+`onPause` destroys them, `onPop` final-cleans. `PageManager` is a stack
+(`push`/`pop`/`popToRoot`/`replace`). Home and the provisioning steps use
+`replace()`-style flows; only settings sub-pages stack deeply. TAB pops the
+stack and pushes a fresh Home.
+
+Existing pages: Home, Settings, WiFiSetupPage, EmailAddressPage, LicenseKeyPage,
+LicenseBlockedPage, AudioSettingsPage, ProclamationOptionsPage, ScrollerPage,
+LogViewerPage, TimezonePage, DateFormatPage.
+
+### Keybinds (`src/keybind_manager.cpp`)
+
+Binds are checked **before** the active page sees events. Left/right modifier
+pairs are normalized to combined masks, so a bind's modifiers must be a subset
+of the held modifiers (plain binds fire regardless of modifiers).
+
+Global binds in `main.cpp`: **TAB** returns Home, **UP/DOWN** move the Home
+menu selection. There is no quit keybind — the app is a kiosk. App quit (SDL
+window/system close) fades audio out over ~5s before teardown. Note: Home's
+UP/DOWN handlers both increment `currentMenuItem` `(x+1)%2` (see
+`src/home.cpp`) — there is no separate "down" path.
+
+### ScrollerPage
+
+Full-screen vertical scroller. Proclamation streams come from the DB
+(`scroller_streams.cpp`), colors from per-frequency palettes with a 528 Hz
+fallback, lines built from a Fibonacci length pattern
+(`fibonacci_line_pattern.cpp`). Audio is crossfaded per stream via
+`AudioManager` fade APIs. Word textures are cached and page text rendering is
+cached.
+
+---
+
+## Portal API & color palettes
+
+- Request/response changes against the portal are tracked in `ApiUpdates.md`
+ (sections #4 and #5).
+- **Color palettes are meant to come from the portal, not code releases.** The
+ client-side pieces are implemented but deliberately **not wired into any sync
+ or startup flow** until the portal routes exist:
+ - `api::fetchColorPalettes()` / `api::parseColorPalettesJson()` — the
+ `GET /color-palettes` route.
+ - `sync::syncColorPalettesFromApi()` / `sync::syncProclamationPalettesFromApi()`
+ / `sync::parseProclamationPalettesJson()` — replace the local
+ `color_palettes` table via `db::replaceColorPalettes()`.
+ - `db::getPaletteForFrequencyId()` falls back to the 528 Hz palette for
+ frequency ids with no rows; the startup seed only backfills missing ids, so
+ portal values win after a sync.
+- Do **not** call the above sync functions from the app until the portal routes
+ ship. Tests live in `tests/test_color_palettes.cpp` (`test_color_palettes`
+ target).
+- **Intended wiring points** (marked with `TODO(portal #4/#5)` comments):
+ `syncProclamationsFromApi()` in `src/network/proclamation_sync.cpp`, plus the
+ call sites `Home::syncProclamationsIfEmpty()` (`src/home.cpp`) and
+ `ProclamationOptionsPage::onPush()` (`src/proclamation_options_page.cpp`).
+
+---
+
+## Style & UI Layout Rules
+
+- `PascalCase` for types, `camelCase` for functions/vars, `snake_case` for
+ files, `UPPER_SNAKE` for constants/macros.
+- Use `std::unique_ptr`; no raw `new`/`delete` outside the SDL callbacks.
+- Use `override` on all virtual implementations. `#pragma once` headers.
+- One class per header/source pair. SDL3 headers first, then stdlib, then
+ project headers.
+
+### UI Menu & List Layout Conventions
+- **Left Alignment & Centered Bounding Box**: In vertical menus/lists, all text
+ options are left-aligned with each other (`sharedX`). The bounding box
+ enclosing all options (width = widest item, height = sum of item heights +
+ margins) MUST BE centered on the screen.
+- **Vertical Spacing**: All margins between consecutive list items are
+ **12 pixels**.
+- **Selection Underline**: The 6-pixel underline occupies half the 12px margin
+ (2-3px gap below the item text, 3-4px gap above the next item).
+
+---
+
+## Common Pitfalls
+
+- Do not commit audio assets (`.wav` files) — downloaded at runtime.
+- Do not modify files in `archive/` — reference only.
+- Build needs SDL3 + SDL3_ttf/image/mixer/net + GTest installed; CI uses
+ self-hosted Forgejo runners.
+- `test_assets` must pass before committing — it catches missing fonts/images
+ that break the app at runtime.
+- `cmake --build build` builds everything; pass `--target ` to build one
+ test binary.
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..dd53c2b
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,279 @@
+cmake_minimum_required(VERSION 3.20)
+project(RadiantWave VERSION 0.1.0 LANGUAGES CXX)
+
+set(CMAKE_CXX_STANDARD 17)
+set(CMAKE_CXX_STANDARD_REQUIRED ON)
+set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
+
+# App version string shown at the top of the Home footer. Defaults to the
+# project version; override at configure time with:
+# cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug -DAPP_VERSION="1.2.3"
+set(APP_VERSION "${PROJECT_VERSION}" CACHE STRING
+ "Version string shown in the Home footer (override at configure time)")
+
+# API bearer key baked into the binary and sent as `Authorization: Bearer `
+# on every portal request. Leave empty to send no auth header. Never commit the
+# real value — inject it at CI build time from a secret, e.g.:
+# cmake ... -DAPI_KEY="${{ secrets.PORTAL_API_KEY }}"
+set(API_KEY "" CACHE STRING
+ "Portal API key baked into the binary (leave empty to skip auth)")
+
+find_package(SDL3 REQUIRED)
+find_package(SDL3_ttf REQUIRED)
+find_package(SDL3_image REQUIRED)
+find_package(SDL3_mixer REQUIRED)
+find_package(SDL3_net REQUIRED)
+find_package(SQLite3 REQUIRED)
+find_package(CURL REQUIRED)
+find_package(OpenSSL REQUIRED)
+find_package(GTest REQUIRED)
+include(GoogleTest)
+
+# Network manager dependencies (Linux only)
+if(UNIX AND NOT APPLE)
+ find_package(PkgConfig REQUIRED)
+ pkg_check_modules(SDBUS REQUIRED libsystemd)
+endif()
+
+add_executable(radiantwave
+ src/main.cpp
+ src/page_manager.cpp
+ src/home.cpp
+ src/settings.cpp
+ src/wifi_setup_page.cpp
+ src/audio_settings_page.cpp
+ src/audio/audio_manager.cpp
+ src/audio/audio_downloader.cpp
+ src/timezone_page.cpp
+ src/timezone_helper.cpp
+ src/log_viewer_page.cpp
+ src/logger/logger.cpp
+ src/keybind_manager.cpp
+ src/provisioning.cpp
+ src/network/nm_connection.cpp
+ src/network/nm_device.cpp
+ src/network/network_manager.cpp
+ src/network/json.cpp
+ src/network/api_client.cpp
+ src/network/license_service.cpp
+ src/network/license_status.cpp
+ src/config/yaml_parser.cpp
+ src/config/config_manager.cpp
+ src/db/database_manager.cpp
+ src/network/proclamation_sync.cpp
+ src/proclamation_options_page.cpp
+ src/email_address_page.cpp
+ src/license_key_page.cpp
+ src/license_blocked_page.cpp
+ src/validation.cpp
+ src/date_format.cpp
+ src/date_format_page.cpp
+ src/fibonacci_line_pattern.cpp
+ src/scroller_streams.cpp
+ src/scroller_page.cpp
+ src/scramble/fibonacci_scrambler.cpp
+)
+
+target_compile_definitions(radiantwave PRIVATE
+ APP_VERSION="${APP_VERSION}"
+ API_KEY="${API_KEY}"
+)
+
+target_include_directories(radiantwave PRIVATE src)
+target_link_libraries(radiantwave PRIVATE
+ SDL3::SDL3
+ SDL3_ttf::SDL3_ttf
+ SDL3_image::SDL3_image
+ SDL3_mixer::SDL3_mixer
+ SDL3_net::SDL3_net
+ SQLite3::SQLite3
+ CURL::libcurl
+ OpenSSL::Crypto
+)
+
+if(UNIX AND NOT APPLE)
+ target_link_libraries(radiantwave PRIVATE ${SDBUS_LIBRARIES} resolv)
+ target_include_directories(radiantwave PRIVATE ${SDBUS_INCLUDE_DIRS})
+ target_compile_definitions(radiantwave PRIVATE HAS_DBUS=1)
+endif()
+
+install(TARGETS radiantwave RUNTIME DESTINATION bin)
+
+add_executable(tests
+ tests/test_page_manager.cpp
+ tests/test_keybind_manager.cpp
+ src/page_manager.cpp
+ src/keybind_manager.cpp
+)
+target_include_directories(tests PRIVATE src)
+target_link_libraries(tests PRIVATE SDL3::SDL3)
+
+# Provisioning walkthrough logic tests (pure functions, no app linkage)
+add_executable(test_provisioning
+ tests/test_provisioning.cpp
+)
+target_include_directories(test_provisioning PRIVATE src)
+target_link_libraries(test_provisioning PRIVATE SDL3::SDL3)
+
+add_executable(test_assets
+ tests/test_assets.cpp
+)
+target_include_directories(test_assets PRIVATE src)
+
+# Network manager unit tests
+add_executable(test_network_unit
+ tests/network/test_nm_connection.cpp
+ src/network/nm_connection.cpp
+)
+target_include_directories(test_network_unit PRIVATE src)
+target_link_libraries(test_network_unit PRIVATE GTest::gtest_main)
+
+# Config unit tests
+add_executable(test_config
+ tests/test_config.cpp
+ src/config/yaml_parser.cpp
+ src/config/config_manager.cpp
+)
+target_include_directories(test_config PRIVATE src)
+target_link_libraries(test_config PRIVATE GTest::gtest_main)
+
+# Database unit tests
+add_executable(test_db
+ tests/test_db.cpp
+ src/db/database_manager.cpp
+)
+target_include_directories(test_db PRIVATE src)
+target_link_libraries(test_db PRIVATE GTest::gtest_main SQLite3::SQLite3)
+
+# Proclamation sync unit tests
+add_executable(test_proclamation_sync
+ tests/test_proclamation_sync.cpp
+ src/db/database_manager.cpp
+ src/network/proclamation_sync.cpp
+ src/network/json.cpp
+ src/network/api_client.cpp
+)
+target_include_directories(test_proclamation_sync PRIVATE src)
+target_link_libraries(test_proclamation_sync PRIVATE GTest::gtest_main SQLite3::SQLite3 CURL::libcurl)
+
+# Portal API client unit tests (offline parse tests + live-API tests)
+add_executable(test_api_client
+ tests/test_api_client.cpp
+ src/network/api_client.cpp
+ src/network/json.cpp
+ src/network/proclamation_sync.cpp
+ src/db/database_manager.cpp
+)
+target_include_directories(test_api_client PRIVATE src)
+target_link_libraries(test_api_client PRIVATE GTest::gtest_main CURL::libcurl SQLite3::SQLite3)
+
+# License validation service unit tests (offline + live-API tests)
+add_executable(test_license_service
+ tests/test_license_service.cpp
+ src/network/license_service.cpp
+ src/network/api_client.cpp
+ src/network/json.cpp
+ src/db/database_manager.cpp
+)
+target_include_directories(test_license_service PRIVATE src)
+target_link_libraries(test_license_service PRIVATE GTest::gtest_main CURL::libcurl SQLite3::SQLite3)
+
+# License status tracker unit tests (offline mapping + worker lifecycle)
+add_executable(test_license_status
+ tests/test_license_status.cpp
+ src/network/license_status.cpp
+ src/network/license_service.cpp
+ src/network/api_client.cpp
+ src/network/json.cpp
+ src/db/database_manager.cpp
+)
+target_include_directories(test_license_status PRIVATE src)
+target_link_libraries(test_license_status PRIVATE GTest::gtest_main CURL::libcurl SQLite3::SQLite3)
+
+# Validation/format unit tests
+add_executable(test_validation
+ tests/test_validation.cpp
+ src/validation.cpp
+)
+target_include_directories(test_validation PRIVATE src)
+target_link_libraries(test_validation PRIVATE GTest::gtest_main)
+
+# Date/time format unit tests
+add_executable(test_date_format
+ tests/test_date_format.cpp
+ src/date_format.cpp
+)
+target_include_directories(test_date_format PRIVATE src)
+target_link_libraries(test_date_format PRIVATE GTest::gtest_main)
+
+# TimeZone unit tests
+add_executable(test_timezone
+ tests/test_timezone.cpp
+ src/timezone_helper.cpp
+)
+target_include_directories(test_timezone PRIVATE src)
+target_link_libraries(test_timezone PRIVATE GTest::gtest_main)
+
+# Logger unit tests
+add_executable(test_logger
+ tests/test_logger.cpp
+ src/logger/logger.cpp
+)
+target_include_directories(test_logger PRIVATE src)
+target_link_libraries(test_logger PRIVATE GTest::gtest_main)
+
+# Audio unit tests
+add_executable(test_audio
+ tests/test_audio.cpp
+ src/audio/audio_manager.cpp
+ src/config/yaml_parser.cpp
+ src/config/config_manager.cpp
+ src/logger/logger.cpp
+)
+target_include_directories(test_audio PRIVATE src)
+target_link_libraries(test_audio PRIVATE GTest::gtest_main SDL3_mixer::SDL3_mixer SDL3::SDL3)
+
+# Audio downloader unit tests
+add_executable(test_audio_downloader
+ tests/test_audio_downloader.cpp
+ src/audio/audio_downloader.cpp
+ src/db/database_manager.cpp
+ src/logger/logger.cpp
+)
+target_include_directories(test_audio_downloader PRIVATE src)
+target_link_libraries(test_audio_downloader PRIVATE GTest::gtest_main CURL::libcurl OpenSSL::Crypto SQLite3::SQLite3)
+
+# Scroller Fibonacci pattern unit tests
+add_executable(test_fibonacci_pattern
+ tests/test_fibonacci_pattern.cpp
+ src/fibonacci_line_pattern.cpp
+)
+target_include_directories(test_fibonacci_pattern PRIVATE src)
+target_link_libraries(test_fibonacci_pattern PRIVATE GTest::gtest_main)
+
+# Scroller streams unit tests
+add_executable(test_scroller_streams
+ tests/test_scroller_streams.cpp
+ src/scroller_streams.cpp
+)
+target_include_directories(test_scroller_streams PRIVATE src)
+target_link_libraries(test_scroller_streams PRIVATE GTest::gtest_main SQLite3::SQLite3)
+
+# Fibonacci affine image scrambler unit tests
+add_executable(test_fibonacci_scrambler
+ tests/test_fibonacci_scrambler.cpp
+ src/scramble/fibonacci_scrambler.cpp
+)
+target_include_directories(test_fibonacci_scrambler PRIVATE src)
+target_link_libraries(test_fibonacci_scrambler PRIVATE GTest::gtest_main)
+
+# Color palette API + storage unit tests (readiness: not wired into the app yet)
+add_executable(test_color_palettes
+ tests/test_color_palettes.cpp
+ src/network/api_client.cpp
+ src/network/json.cpp
+ src/network/proclamation_sync.cpp
+ src/db/database_manager.cpp
+)
+target_include_directories(test_color_palettes PRIVATE src)
+target_link_libraries(test_color_palettes PRIVATE GTest::gtest_main CURL::libcurl SQLite3::SQLite3)
diff --git a/Manual.md b/Manual.md
new file mode 100644
index 0000000..e07bf49
--- /dev/null
+++ b/Manual.md
@@ -0,0 +1,575 @@
+# RadiantWave Kiosk — User Manual (Reference Draft)
+
+> **Reference edition.** Every keybind, navigation path, screen behavior, and
+> status message below is derived directly from the application source code.
+> Use this as the checklist when writing the polished end-user manual.
+
+**Input device:** physical keyboard only. No mouse or touchscreen. The cursor
+is hidden. Text input uses the on-screen text-entry model (SDL text input).
+
+---
+
+## 0. Screen Map (UX Flow)
+
+```
+Power on
+ └─ First-Run Walkthrough (if a prerequisite is missing)
+ 1. Internet reachable? no → WiFi Setup
+ 2. Email address set? no → Email Address
+ 3. License key set? no → License Key
+ 4. All satisfied → Home
+ └─ Home
+ ├─ [Play] ────────────────────────────→ Scroller ──(ESC)──→ Home
+ └─ [Settings] ────────────────────────→ Settings
+ ├─ WiFi Setup (ESC/TAB → Settings)
+ ├─ Audio Options (ESC/TAB → Settings)
+ ├─ Time Zone Setup (ESC/TAB → Settings)
+ ├─ Proclamations (ESC → Settings) [license-gated]
+ ├─ Email Address (ESC/TAB → Settings)
+ ├─ License Key (ESC/TAB → Settings)
+ ├─ Date Format (ESC/TAB → Settings)
+ ├─ View System Logs (ESC/TAB → Settings)
+ └─ Back to Home → Home
+```
+
+When **Play** or **Proclamations** is selected but the license cannot be
+verified, a **License Blocked** screen appears instead (ESC → Home).
+
+The **Home** screen is the root of the whole UI. **TAB** is intended to return
+to Home from anywhere (see the caveat in §12).
+
+---
+
+## 1. Global Controls
+
+These binds are registered at startup (`main.cpp`) and are the only binds not
+owned by a specific screen.
+
+| Key | Action | Where it actually works |
+| :--- | :--- | :--- |
+| **`TAB`** | Return to the Home screen (pops every page on the stack and pushes a fresh Home). | Home; most screens also handle TAB locally (see per-screen tables) |
+| **`UP` / `DOWN`** | Move the Home menu selection. **Both keys increment the same counter** — there is no separate "down" behavior; either key cycles Play ↔ Settings. | Home |
+
+> **No key quits the application.** There is intentionally no quit keybind;
+> the app is meant to run as a kiosk. (The underlying SDL window/system close
+> path still exists, but no keyboard key triggers it.)
+
+**Per-screen binds are checked before the screen sees key events.** A keybind
+registered on the current screen is consumed by the keybind system; keys not
+bound there fall through to the screen's own event handler.
+
+---
+
+## 2. Boot & First-Run Walkthrough
+
+On every boot the app checks three prerequisites in a fixed order and shows the
+**first** missing one (`provisioning.h`):
+
+| # | Prerequisite | Screen shown if missing |
+| :--- | :--- | :--- |
+| 1 | Internet reachable (real connectivity probe — Ethernet, WiFi, or any OS link) | WiFi Setup |
+| 2 | Email address saved | Email Address |
+| 3 | License key saved | License Key |
+| 4 | — | Home |
+
+Walkthrough screens call "advance" when they finish or are backed out of, which
+pops the current step and re-evaluates. Completing the WiFi page does **not**
+re-run the internet probe (cached); the other steps only read the DB.
+
+- A brand-new device (no internet, no email, no license) also raises an
+ internal `firstRunWalkthrough` flag (a future welcome walkthrough; today it
+ is only set and logged).
+- If the database failed to open, the walkthrough is skipped entirely and the
+ app goes straight to Home.
+- On the WiFi page during the walkthrough, once the internet becomes reachable
+ the page waits ~1.5 s ("Internet connected. Continuing setup...") and then
+ advances automatically.
+- On the Email and License pages, after a successful save the page waits ~1 s
+ and then advances automatically.
+
+---
+
+## 3. Home
+
+**Reached from:** app start, TAB, ESC on License Blocked, "Back to Home" in
+Settings, ESC on the Scroller.
+
+**Screen contents:**
+- Centered "Radiant Wave" logo title.
+- Two menu items: **Play** and **Settings** (white underline marks the
+ selection).
+- Bottom-right status footer (see §11).
+
+**Keybinds:**
+
+| Key | Action |
+| :--- | :--- |
+| **`UP`** | Cycle menu selection (Play → Settings → Play). |
+| **`DOWN`** | Same as UP — cycles the selection the same way. |
+| **`RETURN`** / **`ENTER`** | Activate the highlighted item. |
+| **`TAB`** | Re-push Home (no visible change) (until a page is pushed on top of Home). |
+
+> The **UP** and **DOWN** keys are wired identically (both increment the
+> selection), so either arrow moves the highlight the same way; there is no
+> dedicated "down" behavior. There is **no quit key** on Home.
+
+**Behavior:**
+- **Play** (item 0) with a confirmed-valid license → **Scroller**.
+- **Play** with an invalid/unverifiable license → **License Blocked**.
+- **Settings** (item 1) → replaces Home with **Settings**.
+- The internet status refreshes automatically every 5 seconds while Home is
+ shown. Play only unlocks when the license is valid (validated in the
+ background; result shown in the footer).
+
+---
+
+## 4. Scroller (Play)
+
+**Reached from:** Home → Play (license-gated).
+
+**Screen contents:** full-screen, vertically scrolling proclamation text.
+Proclamation text is never rendered as readable type — each glyph is permuted
+into a scrambled tile by the Fibonacci affine map, so letterforms are
+destroyed on screen. Lines follow the Fibonacci line-length pattern; colors
+come from per-frequency palettes; audio crossfades between streams.
+
+**Keybinds:**
+
+| Key | Action |
+| :--- | :--- |
+| **`ESC`** | Exit back to Home. |
+
+No other keys do anything on this screen. Scrolling speed ramps automatically
+(up and down) with pauses at each extreme; there is no user speed control.
+
+**Behavior:**
+- Plays audio with a 5 s fade-in; on exit fades out over ~5 s.
+- Dynamic Audio mode: the current stream's solfeggio-frequency track is
+ crossfaded as proclamations change. Fixed-track mode: the configured track
+ plays and never switches.
+- If a stream's audio file is not on disk yet, playback falls back to the
+ manual track rather than silence.
+
+---
+
+## 5. Settings
+
+**Reached from:** Home → Settings. (Home is replaced, not stacked.)
+
+**Screen contents:** title "Settings" and a 9-item menu:
+
+| # | Item | Opens | License-gated? |
+| :--- | :--- | :--- | :--- |
+| 0 | WiFi Setup | WiFi Setup screen | no |
+| 1 | Audio Options | Audio Options screen | no |
+| 2 | Time Zone Setup | Time Zone Setup screen | no |
+| 3 | Proclamations | Proclamation Options | **yes** (else License Blocked) |
+| 4 | Email Address | Email Address screen | no |
+| 5 | License Key | License Key screen | no |
+| 6 | Date Format | Date Format screen | no |
+| 7 | View System Logs | System Log Viewer | no |
+| 8 | Back to Home | Home | — |
+
+**Keybinds:**
+
+| Key | Action |
+| :--- | :--- |
+| **`UP`** | Move selection up (wraps around). |
+| **`DOWN`** | Move selection down (wraps around). |
+| **`RETURN`** / **`ENTER`** | Open the highlighted item. |
+| **`ESC`** | Return to Home (replaces Settings). |
+| **`TAB`** | Return to Home. |
+
+---
+
+## 6. WiFi Setup
+
+**Reached from:** Settings → WiFi Setup, or the First-Run walkthrough.
+
+**Screen contents:**
+- Title "WiFi Configuration".
+- Status row: **WiFi: Connected/Disconnected** (green/red), **Network:
+ \/None**, **Internet: Reachable/Unreachable** (green/red).
+- Status message banner (blue-bordered): "Scanning for available
+ networks...", "Connecting to \...", "Connected successfully!",
+ "Connection failed: \", "Password entry cancelled", etc.
+- Network list (50 px rows). Color coding:
+ - 🟢 **GREEN** — currently connected network.
+ - 🟡 **YELLOW** — previously saved/remembered network.
+ - ⚪ **WHITE** — new/unknown network.
+ - Each row also shows a security badge `[Open]/[WPA/...]` and a signal
+ strength percentage.
+- Empty state: "No WiFi networks found. Press F5 to scan."
+- Footer: `[UP/DOWN] Select [ENTER] Connect [F5] Rescan Networks [ESC/TAB] Back`.
+
+**Keybinds (normal mode):**
+
+| Key | Action |
+| :--- | :--- |
+| **`UP`** | Select previous network. |
+| **`DOWN`** | Select next network. |
+| **`RETURN`** / **`ENTER`** | Connect. Open network → connects immediately. Secured network → opens the password box. |
+| **`F5`** | Re-scan for networks. |
+| **`ESC`** | Back (Settings, or walkthrough advance). |
+| **`TAB`** | Back (same as ESC). |
+
+**Password box (modal):**
+
+| Key | Action |
+| :--- | :--- |
+| **type any keys** | Type the password (shown in plain text, unmasked, with a cursor). |
+| **`BACKSPACE`** | Delete the last character. |
+| **`RETURN`** / **`ENTER`** | Submit password and connect. |
+| **`ESC`** | Cancel password entry (returns to the network list). |
+
+Password modal footer: `[ENTER] Submit Password [ESC] Cancel`.
+
+**Behavior:**
+- Connect is asynchronous. On completion: "Connected successfully!" or
+ "Connection failed: \" (falls back to "Authentication or signal
+ error").
+- While a connection is in progress the list is locked.
+- **Walkthrough only:** once internet is reachable, auto-advances after ~1.5 s.
+
+---
+
+## 7. Audio Options
+
+**Reached from:** Settings → Audio Options.
+
+**Screen contents:** title "Audio Configuration"; status row **Audio:
+Enabled/Disabled** (green/red) and **Device: \**; status banner; 5-item
+menu:
+
+| # | Item | Interaction |
+| :--- | :--- | :--- |
+| 0 | Volume: `[▓▓▓▓▓▓▓▓░░] 80%` | LEFT/RIGHT step −/+ 5% (0–100, clamps). |
+| 1 | Output Device: `[\]` | ENTER opens the Device selector modal. |
+| 2 | Audio Track: `[\]` | ENTER opens the Track selector modal. |
+| 3 | Audio Status: `[ON]`/`[OFF]` | ENTER toggles audio system-wide on/off. |
+| 4 | Back to Settings | ENTER pops back to Settings. |
+
+Footer: `[UP/DOWN] Select [LEFT/RIGHT] Volume [ENTER] Confirm [ESC/TAB] Back`.
+
+**Keybinds (main menu):**
+
+| Key | Action |
+| :--- | :--- |
+| **`UP`** | Select previous item. |
+| **`DOWN`** | Select next item. |
+| **`LEFT`** | Volume −5% (only when Volume is highlighted). |
+| **`RIGHT`** | Volume +5% (only when Volume is highlighted). |
+| **`RETURN`** / **`ENTER`** | Open device/track modal, toggle audio, or Back. |
+| **`ESC`** | Back to Settings (closes a modal first if one is open). |
+| **`TAB`** | Back to Settings (only when no modal is open). |
+
+**Device selector modal** — "Select Output Device":
+
+| Key | Action |
+| :--- | :--- |
+| **`UP`** / **`DOWN`** | Move selection. |
+| **`PAGE UP`** / **`PAGE DOWN`** | Jump selection by 8. |
+| **`RETURN`** / **`ENTER`** | Switch to the highlighted device. |
+| **`ESC`** | Cancel (no change). |
+
+**Track selector modal** — "Select Audio Track":
+
+| Key | Action |
+| :--- | :--- |
+| **`UP`** / **`DOWN`** | Move selection. |
+| **`PAGE UP`** / **`PAGE DOWN`** | Jump selection by 8. |
+| **`RETURN`** / **`ENTER`** | Select the highlighted option. |
+| **`ESC`** | Cancel (no change). |
+
+Modal footer: `[UP/DOWN] Select [ENTER] Confirm [ESC] Cancel`.
+
+**Behavior:**
+- The track list always leads with **Dynamic Audio** (cyan; "audio follows the
+ displayed proclamation"), then **Original Audio** pinned first, then every
+ other track sorted alphabetically. Up to 8 rows visible; the list scrolls
+ and stays centered on the selection.
+- Choosing a fixed track turns Dynamic Audio **off**. Choosing Dynamic Audio
+ turns it on (status: "Dynamic Audio mode enabled - audio follows the
+ displayed proclamation"). Choosing a track shows "Fixed track selected".
+ Playback itself starts when the Scroller plays, not here.
+- Device and track lists refresh automatically every 1 second.
+
+---
+
+## 8. Time Zone Setup
+
+**Reached from:** Settings → Time Zone Setup.
+
+**Screen contents:** title "Time Zone Configuration"; **Configured Timezone:
+\** (yellow) and a live **Local Time:** sample (green); status banner;
+then either a **country list** or a **timezone list** for the chosen country.
+Green rows mark the currently configured country/zone; the white underline
+marks the selection.
+
+**Country step:**
+
+| Key | Action |
+| :--- | :--- |
+| **`UP`** / **`DOWN`** | Select country/region. |
+| **`RETURN`** / **`ENTER`** | Show that country's timezone list ("Select timezone for \"). |
+| **`ESC`** / **`TAB`** / **`BACKSPACE`** | Back to Settings. |
+
+**Timezone step:**
+
+| Key | Action |
+| :--- | :--- |
+| **`UP`** / **`DOWN`** | Select a timezone. |
+| **`RETURN`** / **`ENTER`** | Save the timezone (status "Timezone set to \") and return to the country list. |
+| **`ESC`** / **`BACKSPACE`** / **`TAB`** | Back to the country list. |
+
+Footers:
+- Country: `[UP/DOWN] Select Country [ENTER] Choose [ESC/TAB] Back to Settings`
+- Timezone: `[UP/DOWN] Select Timezone [ENTER] Apply Timezone [ESC/BACKSPACE] Back to Countries`
+
+**Behavior:** the saved timezone is written to the live config immediately;
+logs and the Home clock use it right away.
+
+---
+
+## 9. Proclamations
+
+**Reached from:** Settings → Proclamations (license-gated; else License
+Blocked).
+
+**Screen contents:** title "Proclamation Options"; status line (sync result +
+"Selected: N"); an optional **search bar** while searching; a collapsible
+category tree (or a flat search-result list); footer hints.
+
+**Colors:** categories blue; selected proclamations orange; the always-on
+top-level proclamation orange; locked (above your subscription) rows flash
+**red**; search text yellow.
+
+**Keybinds (browse mode):**
+
+| Key | Action |
+| :--- | :--- |
+| **`UP`** / **`DOWN`** | Move highlight. |
+| **`RETURN`** / **`ENTER`** | Toggle the highlighted row: expand/collapse a category, or select/deselect a proclamation. |
+| **`LEFT`** | Collapse the highlighted category; if the row is a sub-item, jump to its parent. |
+| **`RIGHT`** | Expand the highlighted category. |
+| **`PAGE UP`** / **`PAGE DOWN`** | Scroll by a page. |
+| **`CTRL` + `D`** | Clear all selections (the top-level proclamation stays on). |
+| **type any printable character** | Enter search mode. |
+| **`ESC`** | Back to Settings. |
+
+**Search mode:**
+
+| Key | Action |
+| :--- | :--- |
+| **type any printable character** | Add to the search query (word-prefix match on title + content). |
+| **`BACKSPACE`** | Delete the last query character; when the query empties, search mode closes. |
+| **`UP`** / **`DOWN`** | Move highlight. |
+| **`RETURN`** / **`ENTER`** | Toggle the highlighted result. |
+| **`ESC`** | Cancel search and return to the browse tree. |
+
+Footers:
+- Browse: `[UP/DOWN] Move [ENTER] Toggle [Type to Search] [LEFT/RIGHT] Expand/Collapse [CTRL+D] Clear All [ESC] Back`
+- Search: `[UP/DOWN] Move [ENTER] Select [BACKSPACE] Edit [ESC] Cancel Search`
+
+**Behavior:**
+- On open the app syncs the list with the server: "Synced with server" or
+ "Offline - showing saved proclamations". The "Selected: N" count on the
+ status line excludes the always-on top-level proclamation.
+- The top-level proclamation ("Synchronize, Harmonize & Energize") is **always
+ on** and cannot be deselected ("The top-level proclamation is always on").
+- Selecting a proclamation whose required subscription level is above the one
+ attached to your license key is rejected: the row flashes red and a status
+ line explains it's "available on \ systems".
+- A bare **SPACE** does not open search and never selects anything; in search
+ mode SPACE types a space into the query.
+- **TAB is NOT handled on this screen** — use ESC to go back.
+
+---
+
+## 10. Email Address, License Key, Date Format
+
+### 10.1 Email Address
+
+**Reached from:** Settings → Email Address, or the walkthrough.
+
+**Screen contents:** title "Email Address"; "Saved: \" (gray = not
+set, yellow = set); input box with cursor; status line; footer.
+
+**Keybinds:**
+
+| Key | Action |
+| :--- | :--- |
+| **type any keys** | Type/edit the email (up to 254 chars). |
+| **`BACKSPACE`** | Delete the last character. |
+| **`RETURN`** / **`ENTER`** | Save. Empty input clears the saved address ("Cleared"). Invalid address shows "Invalid email address". Valid save shows "Saved". |
+| **`ESC`** | Back without saving (Settings, or walkthrough advance). |
+| **`TAB`** | Back (same as ESC). |
+
+- After a successful save/clear, the page auto-exits after ~1 s.
+- Footer: `[Type] Enter email [ENTER] Save [BACKSPACE] Delete [ESC/TAB] Back`.
+
+### 10.2 License Key
+
+**Reached from:** Settings → License Key, or the walkthrough.
+
+**Screen contents:** title "License Key"; "Saved: \" (gray/yellow); input
+box showing the key formatted `XXXX-XXXX-XXXX-XXXX`; status line; footer.
+
+**Keybinds:**
+
+| Key | Action |
+| :--- | :--- |
+| **type any keys** | Type the key. Only alphanumerics are accepted (uppercased); max 16 characters. Dashes are added automatically for display. |
+| **`BACKSPACE`** | Delete the last character. |
+| **`RETURN`** / **`ENTER`** | Save and validate. |
+| **`ESC`** | Back without saving (Settings, or walkthrough advance). |
+| **`TAB`** | Back (same as ESC). |
+
+**Validation statuses on ENTER:**
+- Fewer than 16 characters → "License key must be 16 characters
+ (XXXX-XXXX-XXXX-XXXX)".
+- Save failed → "Failed to save license key".
+- Server validated → "License validated (\)".
+- Missing email → "Saved - add your email address to validate the license".
+- Invalid → "License check failed: \".
+- No network → "License saved, but the server could not be reached to
+ validate".
+
+- Auto-exits after ~1 s once saved.
+- Footer: `[Type] Enter key (dashes added automatically) [ENTER] Save [BACKSPACE] Delete [ESC/TAB] Back`.
+
+### 10.3 Date Format
+
+**Reached from:** Settings → Date Format.
+
+**Screen contents:** title "Date Format"; "Today looks like: \"
+(yellow); 7 format options each with a live sample date; status line; footer.
+
+**Format options:** Month/Day/Year, Day/Month/Year, Year-Month-Day,
+Month.Day.Year, Day.Month.Year, "Month Day, Year", "Day Month Year".
+
+> The option currently in use is shown in yellow, the others in white; every
+> option's live sample date is gray.
+
+**Keybinds:**
+
+| Key | Action |
+| :--- | :--- |
+| **`UP`** / **`DOWN`** | Choose a format. |
+| **`RETURN`** / **`ENTER`** | Apply the format and return to Settings ("Date format saved"). |
+| **`ESC`** | Back without saving. |
+| **`TAB`** | Back (same as ESC). |
+
+- Footer: `[UP/DOWN] Choose [ENTER] Apply & Back [ESC/TAB] Back`.
+
+---
+
+## 11. System Log Viewer
+
+**Reached from:** Settings → View System Logs.
+
+**Screen contents:** title "System Event Log Viewer"; header bar showing
+**Filter: \ | Sort: Newest/Oldest First | Entries: N | TZ: \**;
+word-wrapped log lines (color-coded by severity) with local-time timestamps;
+footer.
+
+**Log line colors:** DEBUG gray, INFO white, WARNING yellow, ERROR red,
+FATAL magenta/pink.
+
+**Keybinds:**
+
+| Key | Action |
+| :--- | :--- |
+| **`UP`** / **`DOWN`** | Scroll one line. |
+| **`PAGE UP`** / **`PAGE DOWN`** | Scroll 10 lines. |
+| **`L`** or **`F2`** or **`RIGHT`** | Cycle the filter level forward: ALL → DEBUG → INFO → WARNING → ERROR → FATAL. |
+| **`LEFT`** | Cycle the filter level backward. |
+| **`S`** or **`F3`** | Toggle sort order: Newest First ↔ Oldest First. |
+| **`C`** | Clear all log history. |
+| **`ESC`** | Back to Settings. |
+| **`TAB`** | Back (same as ESC). |
+
+- Footer: `[UP/DOWN] Scroll [L/F2] Filter Level [S/F3] Sort Order [C] Clear Logs [ESC/TAB] Back`.
+- The log list auto-refreshes every 0.25 s while the screen is open.
+
+---
+
+## 12. License Blocked Screen
+
+**Reached from:** Play or Settings → Proclamations when the license cannot be
+verified.
+
+**Screen contents:** centered message "License could not be verified",
+instruction text ("Please check that you are connected to the internet, and
+double check your license key and email address."), and "Press ESC to return."
+
+**Keybinds:**
+
+| Key | Action |
+| :--- | :--- |
+| **`ESC`** | Return to Home (pops every page and pushes a fresh Home). |
+
+---
+
+## 13. Home Status Footer (legend)
+
+The bottom-right corner of Home shows a two-column readout:
+
+| Field | Meaning / values |
+| :--- | :--- |
+| **License:** | `OK` (green) · `Invalid` (red, bold) · `Checking...` · `Unknown` |
+| **Key:** | saved license key, or `Not set` |
+| **Email:** | saved email, or `Not set` |
+| **Subscription:** | subscription level name from the license, or `Not set` |
+| **WiFi:** | current SSID, or `Not connected` |
+| **Internet:** | `Connected` / `Offline` |
+| **Audio:** | audio-downloader status string, or `Idle` |
+| **Date:** | formatted per the selected date format |
+| **Time:** | `HH:MM:SS` (24-hour) |
+
+Internet status refreshes every 5 s while Home is shown; the license check
+re-runs in the background each time Home appears.
+
+---
+
+## 14. Data & Configuration (background)
+
+- **`~/.local/radiantwave/config.yaml`** — settings (audio volume, output
+ device, current track, dynamic audio, timezone, proclamation font size).
+ Saved automatically. **Hot-reloaded live**: editing it while the app runs
+ applies immediately without a restart.
+- **`~/.local/radiantwave/radiantwave.db`** (SQLite, WAL) — email, license key,
+ subscription level, license last-verified timestamp, proclamation/category
+ data, audio file records, system log history.
+- **Audio assets** (`.wav` files) are downloaded in the background on first
+ connect and stored under `~/.local/radiantwave/audio/`; they are not part of
+ the app install.
+- License checks run online; a known-good license stays valid for a **7-day
+ offline grace window**.
+
+---
+
+## 15. Implementation Notes / Caveats (for the manual author)
+
+These are behaviors visible in the source that differ from the "intended"
+controls, so you can decide how to document or fix them:
+
+1. **TAB (Home) is registered once at startup and is removed whenever any page
+ pauses** (every page calls `keybinds.unbindAll()` in `onPause`, and Home
+ only re-binds UP/DOWN in `onResume`). In practice **TAB returns Home
+ reliably only on the Home screen, and only until you first push a page on
+ top of it — popping back to Home does not restore it**. Screens that handle
+ TAB locally (Settings, WiFi, Audio, Email, License, Date Format, Log
+ Viewer) keep working; the Scroller, Proclamations, and License Blocked do
+ not respond to TAB.
+2. **Home's UP and DOWN both move the selection the same direction** — both
+ call `(x+1)%2`. There is no down-only arrow behavior.
+3. **Proclamation page and Scroller have no TAB handler** — only ESC returns
+ from the Proclamation page / Scroller.
+4. **TAB on the Time Zone page behaves differently per step**: in the
+ country list it exits to Settings; in the timezone list it returns to the
+ country list.
+5. The walkthrough's WiFi page auto-advances as soon as internet is reachable
+ (≈1.5 s), and the Email/License pages auto-advance ≈1 s after a successful
+ save — the walkthrough can never be completed by pressing Enter alone on a
+ connected device.
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..ccc5d0f
--- /dev/null
+++ b/README.md
@@ -0,0 +1,599 @@
+# RadiantWave
+
+Kiosk application for RadiantWave wellness technology. Displays scrolling
+proclamation text with custom shaders, plays audio at solfeggio frequencies,
+and manages WiFi/provisioning on a headless Linux kiosk.
+
+**Language:** C++17
+**Build:** CMake + Ninja (local) or Nix (flake)
+**Graphics:** SDL3
+**Audio:** SDL3_mixer
+**Target:** Linux kiosk (Wayland/X11); developed on macOS
+
+---
+
+## Project Layout
+
+```
+radiantwave/
+├── CMakeLists.txt Build config
+├── .vscode/ VS Code launch + task configs
+├── assets/
+│ ├── fonts/ Font files (Roboto-Regular.ttf)
+│ └── images/ Logo and background images
+├── src/
+│ ├── main.cpp Entry point (SDL3 callbacks, global keybinds)
+│ ├── app_state.h AppState struct (window, renderer, pages, keybinds)
+│ ├── page.h Page base class (lifecycle interface)
+│ ├── page_manager.h PageManager declaration
+│ ├── page_manager.cpp PageManager implementation
+│ ├── keybind_manager.h KeybindManager declaration
+│ ├── keybind_manager.cpp KeybindManager implementation
+│ ├── home.h Home page declaration
+│ ├── home.cpp Home page implementation
+│ ├── settings.h Settings page declaration
+│ └── settings.cpp Settings page implementation
+├── tests/
+│ ├── test_harness.h Minimal test framework
+│ ├── test_page.h TestPage mock
+│ ├── test_page_manager.cpp PageManager unit tests
+│ └── test_assets.cpp Asset existence checks
+└── archive/ Previous Go implementation (reference only)
+```
+
+---
+
+## Building
+
+Two supported ways to build: **CMake + Ninja** (any machine with the
+dependencies installed, or inside `nix develop`) and **Nix** (the flake builds
+the package and runs the offline test suite in its `checkPhase`).
+
+### Prerequisites (CMake + Ninja)
+
+- **CMake** >= 3.20
+- **Ninja** build tool
+- **C++17** compiler (Clang or GCC)
+- **SDL3**, **SDL3_ttf**, **SDL3_image**, **SDL3_mixer**, **SDL3_net**
+- **SQLite3**, **libcurl**, **OpenSSL**
+- **GoogleTest** (hard requirement: the build fails without it)
+- Linux only: `pkg-config` + systemd (`libsystemd`) for the NetworkManager
+ sd-bus code, plus glibc's `resolv`
+
+Install the dependencies for your platform:
+
+#### macOS (Homebrew)
+
+```sh
+brew install cmake ninja pkg-config \
+ sdl3 sdl3_ttf sdl3_image sdl3_mixer sdl3_net \
+ sqlite googletest
+```
+
+libcurl and OpenSSL headers ship with the macOS SDK. If your Xcode SDK's
+OpenSSL is too old, `brew install openssl@3` and point CMake at it.
+
+#### Debian / Ubuntu (trixie and newer ship SDL3)
+
+```sh
+sudo apt install cmake ninja-build g++ pkg-config \
+ libsdl3-dev libsdl3-ttf-dev libsdl3-image-dev libsdl3-mixer-dev libsdl3-net-dev \
+ libsqlite3-dev libcurl4-openssl-dev libssl-dev libgtest-dev libsystemd-dev
+```
+
+Older releases do not package SDL3 yet — use the Nix path below instead.
+
+#### NixOS / any Nix system
+
+The dev shell provides the compiler and every dependency:
+
+```sh
+nix develop
+```
+
+### Configure, build, run (CMake + Ninja)
+
+```sh
+# Configure (first time, or after CMakeLists.txt changes)
+cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug
+
+# Build
+cmake --build build
+
+# Run
+./build/radiantwave
+```
+
+Release build:
+
+```sh
+cmake -S . -B build-release -G Ninja -DCMAKE_BUILD_TYPE=Release
+cmake --build build-release
+./build-release/radiantwave
+```
+
+Clean:
+
+```sh
+rm -rf build/
+```
+
+#### App version
+
+The Home screen footer shows a **Version** row at the top of its status list.
+The value is baked in at build time via the `APP_VERSION` CMake cache variable
+and defaults to the project version (`0.1.0`). Pass your own value when
+configuring:
+
+```sh
+cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug -DAPP_VERSION="1.2.3"
+cmake --build build
+```
+
+If `APP_VERSION` is left unset the footer falls back to the project version
+from `CMakeLists.txt` (`project(... VERSION ...)`); a build that defines no
+version at all shows `unknown`. The Nix build sets `APP_VERSION` automatically
+to the flake package version, so `nix build` needs no extra flags.
+
+#### Portal API key
+
+Every portal request sends `Authorization: Bearer `. The key is baked
+into the binary at build time via the `API_KEY` CMake cache variable. It is
+**optional** — when unset, requests go out without an auth header. Keep the
+real value out of the source tree and inject it at build time from your CI
+secret store so it never lands in `git`:
+
+```sh
+cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release \
+ -DAPI_KEY="${{ secrets.PORTAL_API_KEY }}"
+cmake --build build
+```
+
+Rotate the key by building with a new value and shipping the new binary. The
+Nix package accepts the same value via `callPackage ./nix/package.nix {
+apiKey = "…"; }`; the flake itself never embeds one.
+
+### Building with Nix
+
+The flake supports `x86_64-linux` and `aarch64-linux` (the deployment
+targets) plus `aarch64-darwin` (development):
+
+```sh
+nix build .#default # current system
+nix build .#packages.x86_64-linux.default # needs a Linux machine/builders
+nix build .#packages.aarch64-linux.default
+```
+
+`nix build` runs the full offline test suite in its `checkPhase`; the
+live-portal test binaries (`test_api_client`, `test_license_service`) are
+excluded. `nix flake check` builds the package and therefore also runs the
+tests. The app is marked `unfree`; the flake sets `allowUnfreePredicate` for
+`radiantwave`, so no global `allowUnfree` setting is needed.
+
+Note: building the Linux packages from a macOS machine requires remote
+builders or emulation — the flake does not cross-compile.
+
+### NixOS deployment
+
+Import `radiantwave.nixosModules.default` into your `nixosSystem` `modules`
+and enable the service:
+
+```nix
+# configuration.nix
+{ ... }: {
+ services.radiantwave.enable = true;
+ # services.radiantwave.package = ...; # default: the flake's package
+ # services.radiantwave.user = "kiosk"; # default
+}
+```
+
+The module only adds the package to the system path — the machine
+configuration owns the display/audio session (`nixos/vm.nix` is a complete
+working example).
+
+Try the kiosk in a VM first (cage + PipeWire + NetworkManager + auto-login):
+
+```sh
+nix build .#packages.x86_64-linux.test-vm
+./result/bin/run-radiantwave-test-vm
+# or
+nixos-rebuild build-vm --flake .#test-vm
+./result/bin/run-radiantwave-test-vm
+```
+
+---
+
+## VS Code
+
+### Required extensions
+
+- **C/C++** (`ms-vscode.cpptools`) — IntelliSense + launch configs
+- **CodeLLDB** (`vadimcn.vscode-lldb`) — LLDB debugger frontend
+
+Install from the Extensions sidebar, or:
+
+```sh
+code --install-extension ms-vscode.cpptools
+code --install-extension vadimcn.vscode-lldb
+```
+
+### Launch configurations
+
+`F5` with `Debug RadiantWave` selected builds and launches the app under LLDB.
+`Debug Tests` builds and launches the test runner.
+
+Tasks are preconfigured in `.vscode/tasks.json`:
+
+| Task | Shortcut | What it does |
+|------|----------|-------------|
+| `build-debug` | `Cmd+Shift+B` | Configure + build debug |
+| `build-release` | — | Configure + build release |
+| `build-tests` | — | Build test target only |
+| `run-tests` | — | Build + run tests |
+
+---
+
+## Testing
+
+Two frameworks coexist. `tests`, `test_assets`, and `test_provisioning` use
+the minimal built-in harness (`tests/test_harness.h`); every other `test_*`
+binary is GoogleTest. Each test file is its own CMake target — build them all
+with `cmake --build build`, then run each binary from the repo root (the tests
+resolve `assets/...` relative to the working directory):
+
+```sh
+cmake --build build
+./build/test_assets
+./build/tests
+./build/test_network_unit
+./build/test_config
+# ... one ./build/test_ per target
+```
+
+Live-portal tests only run when their `RW_LIVE_*` env vars are set, except
+`test_api_client` and `test_license_service`, which hit the portal
+unconditionally — keep those off a hermetic/offline build.
+
+Expected output:
+
+```
+# tests (PageManager)
+push_single_page... ok
+push_two_pages... ok
+pop_single_page... ok
+pop_resumes_previous... ok
+replace_on_empty... ok
+replace_on_existing... ok
+pop_empty_stack... ok
+depth_tracks_correctly... ok
+push_pop_push_sequence... ok
+9 passed, 0 failed
+
+# test_assets (asset existence)
+fonts_exist... ok
+rd_title_image_exists... ok
+rwt_circular_image_exists... ok
+3 passed, 0 failed
+```
+
+### Writing new tests
+
+Tests live in `tests/`. To add a test file:
+
+1. Create `tests/test_yourthing.cpp`
+2. Include the harness and the header under test:
+
+```cpp
+#include "test_harness.h"
+#include "../src/your_header.h"
+
+TEST(my_new_test)
+{
+ // use ASSERT_TRUE, ASSERT_FALSE, ASSERT_EQ
+}
+
+RUN_ALL_TESTS()
+```
+
+3. Add the file to the `tests` target in `CMakeLists.txt`:
+
+```cmake
+add_executable(tests
+ tests/test_page_manager.cpp
+ tests/test_yourthing.cpp # <-- add here
+ src/page_manager.cpp
+ src/your_source.cpp
+)
+```
+
+4. Rebuild and run:
+
+```sh
+cmake --build build --target tests
+./build/tests
+```
+
+### Test conventions
+
+- One `TEST()` per behavior.
+- Name tests as `what_you_are_testing` (snake_case).
+- Use `TestPage` mock from `test_page.h` to verify lifecycle calls.
+- Call `clear_log()` before each test that checks lifecycle events.
+- `AppState` is defined minimally in test files — pages must not depend on
+ fields beyond what `AppState` actually has.
+
+---
+
+## Architecture
+
+### SDL3 Callback Entry Point
+
+The app uses SDL3's callback system (`SDL_MAIN_USE_CALLBACKS`) instead of a
+manual event loop. SDL calls these functions for you:
+
+| Callback | Runs | Purpose |
+|----------|------|---------|
+| `SDL_AppInit` | Once at startup | Init SDL, create window + renderer, push first page |
+| `SDL_AppEvent` | Per event | Forward events to the active page |
+| `SDL_AppIterate` | Per frame | Update + render the active page |
+| `SDL_AppQuit` | Once at exit | Destroy window, renderer, clean up |
+
+Application state (`AppState`) is passed between callbacks via `void*`.
+
+### AppState
+
+```cpp
+struct AppState {
+ SDL_Window* window;
+ SDL_Renderer* renderer;
+ PageManager pages;
+ KeybindManager keybinds;
+ bool quitRequested;
+ int currentMenuItem;
+};
+```
+
+All shared state lives here. Pages receive `AppState&` during lifecycle calls
+so they can access the renderer, window, keybinds, or any future shared state.
+
+### Page Lifecycle
+
+Every page implements the `Page` interface:
+
+```cpp
+class Page {
+ virtual void onPush(AppState& state) = 0; // create textures, load state
+ virtual void onResume(AppState& state) = 0; // re-create textures after being paused
+ virtual void onPause(AppState& state) = 0; // destroy textures, save state
+ virtual void onPop(AppState& state) = 0; // final cleanup
+ virtual void handleEvent(const SDL_Event& event) = 0;
+ virtual void update(float dt) = 0;
+ virtual void render(SDL_Renderer* renderer) = 0;
+};
+```
+
+Lifecycle rules:
+
+- **Push:** current page gets `onPause()`, new page gets `onPush()`.
+- **Pop:** top page gets `onPop()`, previous page gets `onResume()`.
+- **Replace:** top page gets `onPop()`, new page gets `onPush()`.
+
+At most one page has textures alive at a time. Inactive pages destroy their
+textures in `onPause()` and re-create them in `onResume()`.
+
+### PageManager
+
+Stack-based navigation. Owned by `AppState`.
+
+```cpp
+PageManager pages;
+
+// Navigate
+pages.push(state, std::make_unique());
+pages.pop(state);
+pages.popToRoot(state); // pop all pages, resume root
+pages.replace(state, std::make_unique());
+
+// Query
+Page* current = pages.current();
+std::size_t depth = pages.depth();
+
+// Delegates to current page
+pages.handleEvent(event);
+pages.update(dt);
+pages.render(renderer);
+```
+
+### Navigation Model
+
+Pages replace each other rather than stacking deeply. Home uses `replace()`
+to swap itself for Settings (so Settings is the only page on the stack).
+TAB pops all pages and pushes a fresh Home. The page stack is primarily for
+settings sub-pages (e.g., Settings → AudioOptions → DevicePicker).
+
+---
+
+## Pages
+
+| Page | Purpose | Status |
+|------|---------|--------|
+| Home | Logo, menu selection (Play, Settings) | Done |
+| Settings | Title-only settings stub | Done |
+| ScrollerPage | Main screen: scrolling text with shaders + audio | — |
+| AudioOptions | Audio device selection, volume | — |
+| ProclamationOptions | Browse/search proclamations | — |
+| WiFiSetupPage | WiFi scan, WPA connect, password entry | — |
+| LicenseKeyPage | License key input | — |
+| EmailAddressPage | Email input with validation | — |
+| LogViewerPage | Scrollable log viewer | — |
+| DownloadingAssets | Stub during download phase | — |
+| Message | Generic message page | — |
+
+---
+
+## Keybinds
+
+Global keybinds, active from any screen:
+
+| Key | Action |
+|-----|--------|
+| TAB | Return to Home screen |
+| UP Arrow | Move selection up (wraps) |
+| DOWN Arrow | Move selection down (wraps) |
+| ENTER | Select current menu item |
+
+Keybinds are managed by `KeybindManager` and checked before events reach
+the active page. Pages can also register their own keybinds via
+`state.keybinds.bind()`.
+
+---
+
+## Rendering
+
+### Virtual Framebuffer
+
+Renders to a 1920x1080 FBO, then blits to native window resolution.
+Decouples layout from display size.
+
+### Shaders
+
+| Shader | Purpose |
+|--------|---------|
+| scroller.vert/frag | Text with font texture; uniform `u_textColor` |
+| text.vert/frag | Non-scrolling text elements |
+| solid_color.vert/frag | Flat color (backgrounds, UI) |
+
+---
+
+## Audio
+
+- SDL3_mixer for playback.
+- PipeWire sink enumeration via `pactl list sinks short`.
+- `.wav` files downloaded at runtime from `files.radiantwavetech.com`.
+- 9 solfeggio frequency presets (174Hz - 963Hz).
+
+---
+
+## Database
+
+SQLite at `~/.local/share/radiantwave/database.sqlite` (WAL mode).
+
+| Table | Purpose |
+|-------|---------|
+| app_config | Key-value store: license, email, audio device, volume |
+| logs | Application logs |
+| proclamations | Synced proclamation text |
+| proclamation_categories | Category metadata |
+| solfeggio_frequencies | 9 frequency presets |
+| audio_files | Downloaded audio files |
+
+---
+
+## Network
+
+D-Bus integration via sdbus-c++:
+- Async WiFi scan
+- WPA/WPA2 connection
+- Captive portal detection
+
+### Remote APIs
+
+| Endpoint | Purpose |
+|----------|---------|
+| `portal.radiantwavetech.com/api/v2/proclamations` | Sync proclamations |
+| `files.radiantwavetech.com/files/` | Audio file downloads |
+| HTTP API | License validation |
+
+Request/response changes against the portal are tracked in `ApiUpdates.md`.
+Changes #4 and #5 cover color palettes: the portal will expose them per
+proclamation and via a standalone `/api/v2/color-palettes` route. The kiosk
+side (`api::fetchColorPalettes`, `sync::syncColorPalettesFromApi`,
+`db::replaceColorPalettes`) is implemented but **not wired into the app** until
+those routes exist — palettes are meant to be updated by the portal, not code
+releases.
+
+---
+
+## Style Guide
+
+### C++
+
+- **Standard:** C++17. No extensions, no GNU-isms.
+- **Formatting:** 4 spaces, no tabs. Column limit: 100.
+- **Naming:**
+ - `PascalCase` for types, classes, structs, enums.
+ - `camelCase` for functions, methods, variables.
+ - `snake_case` for files (`page_manager.cpp`).
+ - `UPPER_SNAKE_CASE` for constants and macros.
+- **Includes:** SDL3 first, then stdlib, then project headers.
+- **Ownership:** Use `std::unique_ptr` for heap allocation. No raw `new`/`delete`
+ outside of the SDL callback entry/exit points.
+- **Callbacks:** Use `override` on all virtual method implementations.
+- **Error handling:** Return `SDL_APP_FAILURE` on unrecoverable errors. Log with
+ `SDL_Log()`. No exceptions for control flow.
+- **No globals.** Pass state through `AppState&` or function parameters.
+
+### Files
+
+- One class per header/source pair.
+- Headers use `#pragma once`.
+- Keep `src/` for production code, `tests/` for test code.
+- `archive/` is read-only reference. Never modify files in it.
+
+### Testing
+
+- One `TEST()` per behavior.
+- Use `TestPage` mock to verify lifecycle calls.
+- Call `clear_log()` before tests that inspect lifecycle events.
+- Prefer `ASSERT_EQ` over `ASSERT_TRUE(a == b)` for better error output.
+
+---
+
+## Provisioning State Machine
+
+```
+FIRST_RUN -> NEEDS_INTERNET -> NEEDS_LICENSE_KEY -> NEEDS_EMAIL_ADDRESS -> DOWNLOADING_ASSETS -> READY
+```
+
+Each state maps to a page. The state machine evaluates DB values and network
+status to decide which page to show.
+
+---
+
+## Rebuild Progress
+
+| Component | Status |
+|-----------|--------|
+| Entry / Event Loop | Done |
+| Window + Renderer | Done |
+| Page System | Done |
+| PageManager (stack) | Done |
+| KeybindManager | Done |
+| Home Page | Done |
+| Settings Page | Done |
+| Provisioning FSM | — |
+| Pages (11 types) | — |
+| OpenGL Context | — |
+| Virtual Framebuffer | — |
+| Shader Manager | — |
+| Font Manager | — |
+| Line Patterns | — |
+| Color Patterns | — |
+| Mixer | — |
+| Network / WiFi | — |
+| Database (SQLite) | — |
+| HTTP Client | — |
+| Logging | — |
+| Config / App State | — |
+
+---
+
+## Common Pitfalls
+
+- Do not commit audio assets (`.wav` files) -- downloaded at runtime.
+- Do not modify files in `archive/` -- it is reference only.
+- `build/` is gitignored. Do not commit build artifacts.
+- Use the Nix dev shell or ensure SDL3 is installed for building.
+- CI uses self-hosted Forgejo runners.
+- Asset tests (`test_assets`) must pass before committing -- they catch missing
+ fonts and images that would break the app at runtime.
diff --git a/algorithm.md b/algorithm.md
new file mode 100644
index 0000000..4a94449
--- /dev/null
+++ b/algorithm.md
@@ -0,0 +1,502 @@
+**Ben Williams** February 9, 2007 MATH491 Summer Research Project 2006–2007 Department of Mathematics and Statistics, University of Canterbury
+
+## Abstract
+
+An analysis of some recently proposed methods of digital image scrambling that use Fibonacci numbers. This report describes the mathematics required to understand why these methods work.
+
+## Contents
+
+1. Introduction
+2. Properties of the Fibonacci numbers
+3. Affine transformations
+4. Applications to digital image scrambling
+5. Conclusion Appendix: Methods to calculate $f_n$ in $\mathbb{Z}_m$
+
+---
+
+## 1. Introduction
+
+Digital image scrambling is a method to hide the content of an image. One application is in satellite television broadcasting systems to prevent unauthorized viewing. The scrambling algorithm needs to be fast so that each frame can be de-scrambled in real-time. A method used in the past has been to permute the rows of the image. A key is then required to describe the inverse permutation.
+
+Other methods of scrambling include scrambling pixel positions or scrambling the color values of each pixel. Without knowledge of the key it should be difficult to recover the scrambled image given time constraints.
+
+Digital image scrambling methods have specific requirements that general data encryption algorithms may not provide. The algorithms need to be simple and fast so that they can be used by low cost equipment. The scrambled image should not adversely affect data compression algorithms, and information about the image such as dimension needs to be available without decrypting the image.
+
+In order to understand the new scrambling methods proposed in [2], [3], [4], some properties of the Fibonacci numbers are described. Affine transformations are then presented because these will be used to scramble pixels to new positions within an image. Some affine transformations that use Fibonacci numbers for scrambling digital images are described and analysed.
+
+---
+
+## 2. Properties of the Fibonacci numbers
+
+**Definition 2.1.** The _Fibonacci numbers_ are the numbers in the sequence $0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, \dots$, where the $n$th Fibonacci number $f_n$ is defined by the linear recurrence relation
+
+$$f_n = f_{n-1} + f_{n-2} \quad \text{for } n \ge 2 \text{ and } f_0 = 0,\ f_1 = 1.$$
+
+**Theorem 2.1.** $f_n$ is even $\iff$ 3 divides $n$.
+
+_Proof._ Consider the Fibonacci sequence where each number is reduced modulo 2.
+
+$$s_n = f_n \bmod 2$$ $$s_n = (f_{n-1} + f_{n-2}) \bmod 2$$ $$s_n = (s_{n-1} + s_{n-2}) \bmod 2$$
+
+The sequence generated is
+
+$$0, 1, 1, 0, 1, 1, 0, 1, 1, 0, \dots$$
+
+The period of the sequence is 3 because $s_i = s_{i+3}$ for all $i \in \mathbb{N}$. It follows that
+
+$$s_{3k} = 0, \qquad s_{3k+1} = 1, \qquad s_{3k+2} = 1 \quad \text{for all } k \in \mathbb{N}.$$
+
+Therefore $f_n \equiv 0 \pmod 2 \iff n = 3k$. $\blacksquare$
+
+**Definition 2.2.** The _Fibonacci matrix_ is the $2 \times 2$ matrix
+
+$$F = \begin{bmatrix} 0 & 1 \ 1 & 1 \end{bmatrix}$$
+
+It is used to represent the Fibonacci sequence as a matrix equation. Let $\mathbf{u}_n = \begin{bmatrix} f_{n-1} \ f_n \end{bmatrix}$. Then for $n \ge 1$, $\mathbf{u}_{n+1} = F\mathbf{u}_n$.
+
+**Theorem 2.2.**
+
+$$f_n = \frac{(1+\sqrt5)^n - (1-\sqrt5)^n}{2^n \sqrt5}$$
+
+**Table 1: The Fibonacci numbers**
+
+|$n$|$f_n$|$f_{n+1}$|$f_n^2 \bmod f_{n+1}$|
+|---|---|---|---|
+|0|0|1|0|
+|1|1|1|0|
+|2|1|2|-1|
+|3|2|3|1|
+|4|3|5|-1|
+|5|5|8|1|
+|6|8|13|-1|
+|7|13|21|1|
+|8|21|34|-1|
+|9|34|55|1|
+|10|55|89|-1|
+|11|89|144|1|
+|12|144|233|-1|
+|13|233|377|1|
+|14|377|610|-1|
+|15|610|987|1|
+|16|987|1597|-1|
+
+_Proof of Theorem 2.2._ [5] p. 355.
+
+$$\mathbf{u}_{n+1} = F\mathbf{u}_n = F(F\mathbf{u}_{n-1}) = F^2 \mathbf{u}_{n-1} = \cdots = F^n \mathbf{u}_{n-(n-1)} = F^n \mathbf{u}_1$$
+
+$\lambda$ is an eigenvalue of $F$ if $\det(F - \lambda I) = 0$. Solving the characteristic equation for $F$ gives eigenvalues
+
+$$\lambda_1 = \frac{1+\sqrt5}{2}, \qquad \lambda_2 = \frac{1-\sqrt5}{2}$$
+
+Let $\mathbf{v}_1$ and $\mathbf{v}_2$ be corresponding eigenvectors. These eigenvectors are linearly independent because $\lambda_1 \ne \lambda_2$, therefore they span $\mathbb{R}^2$.
+
+Let $\mathbf{u}_1 = c_1 \mathbf{v}_1 + c_2 \mathbf{v}_2$.
+
+$$\mathbf{u}_{n+1} = F^n \mathbf{u}_1 = F^n(c_1 \mathbf{v}_1 + c_2 \mathbf{v}_2) = c_1 F^n \mathbf{v}_1 + c_2 F^n \mathbf{v}_2$$
+
+$$\begin{bmatrix} f_n \ f_{n+1} \end{bmatrix} = c_1 \lambda_1^n \mathbf{v}_1 + c_2 \lambda_2^n \mathbf{v}_2$$
+
+Therefore $f_n = d_1 \lambda_1^n + d_2 \lambda_2^n$ for coefficients yet to be determined. Solving the system of equations
+
+$$f_0 = d_1 \lambda_1^0 + d_2 \lambda_2^0 = d_1 + d_2 = 0$$
+
+$$f_1 = d_1 \lambda_1^1 + d_2 \lambda_2^1 = d_1\left(\frac{1+\sqrt5}{2}\right) + d_2\left(\frac{1-\sqrt5}{2}\right) = 1$$
+
+gives $d_1 = \dfrac{1}{\sqrt5}$, $d_2 = \dfrac{-1}{\sqrt5}$.
+
+$$f_n = \frac{1}{\sqrt5}\left(\left(\frac{1+\sqrt5}{2}\right)^n - \left(\frac{1-\sqrt5}{2}\right)^n\right) = \frac{(1+\sqrt5)^n - (1-\sqrt5)^n}{2^n\sqrt5} \qquad \blacksquare$$
+
+**Lemma 2.3.** For $n \ge 1$
+
+$$F^n = \begin{bmatrix} f_{n-1} & f_n \ f_n & f_{n+1} \end{bmatrix}$$
+
+_Proof._ By induction. Let $P(n)$ be the proposition that $F^n = \begin{bmatrix} f_{n-1} & f_n \ f_n & f_{n+1} \end{bmatrix}$.
+
+$P(1)$ is the proposition that $F = \begin{bmatrix} 0 & 1 \ 1 & 1 \end{bmatrix}$, which is true.
+
+If $P(k)$ is true for some positive integer $k$ then
+
+$$F^k F = \begin{bmatrix} f_{k-1} & f_k \ f_k & f_{k+1} \end{bmatrix}\begin{bmatrix} 0 & 1 \ 1 & 1 \end{bmatrix} = \begin{bmatrix} f_k & f_{k-1}+f_k \ f_{k+1} & f_k+f_{k+1} \end{bmatrix} = \begin{bmatrix} f_k & f_{k+1} \ f_{k+1} & f_{k+2} \end{bmatrix} = \begin{bmatrix} f_{(k+1)-1} & f_{k+1} \ f_{k+1} & f_{(k+1)+1} \end{bmatrix} = F^{k+1}$$
+
+Therefore $P(k) \Rightarrow P(k+1)$ and by induction, $P(n)$ is true for all $n \ge 1$. $\blacksquare$
+
+**Theorem 2.4.** Let $f_n$ denote the $n$th Fibonacci number. Then for $n \ge 1$
+
+$$f_{n-1} \cdot f_{n+1} - f_n^2 = (-1)^n$$
+
+_Proof._ [7] Taking determinants on both sides of the equation in Lemma 2.3 gives
+
+$$\begin{vmatrix} f_{n-1} & f_n \ f_n & f_{n+1} \end{vmatrix} = \det(F^n) = \det(F)^n = (-1)^n \qquad \blacksquare$$
+
+**Theorem 2.5.** Any two consecutive Fibonacci numbers $f_n$ and $f_{n+1}$ are relatively prime.
+
+_Proof._ By induction. Let $P(n)$ be the proposition that $\gcd(f_n, f_{n+1}) = 1$.
+
+$P(0)$ is the proposition that $\gcd(0,1)=1$, which is true.
+
+If $P(k)$ is true for some positive integer $k$ then
+
+$$\gcd(f_k, f_{k+1}) = 1 = \gcd(f_k+f_{k+1}, f_{k+1}) = \gcd(f_{k+1}, f_{k+2})$$
+
+because $f_k + f_{k+1} = f_{k+2}$ by Definition 2.1.
+
+Therefore $P(k) \Rightarrow P(k+1)$ and by induction, $P(n)$ is true for all $n \ge 0$. $\blacksquare$
+
+---
+
+## 3. Affine transformations
+
+Let $\mathbb{Z}_m = {0,1,2,\dots,m-1}$. Denote $\mathbb{Z}_m^n$ as the set of vectors of dimension $n$ with each component an element in $\mathbb{Z}_m$. Denote $M_n(\mathbb{Z}_m)$ as the set of all $n \times n$ matrices with each entry an element in $\mathbb{Z}_m$. Matrix operations addition and multiplication over $\mathbb{Z}_m$ are defined the same as addition and multiplication over $\mathbb{Z}$ with each matrix entry reduced modulo $m$.
+
+For example: Let $A = (a_{i,j})$, $B = (b_{i,j}) \in M_n(\mathbb{Z}_m)$ and $m \in \mathbb{N}$. We write
+
+$$A \equiv B \pmod m$$
+
+if $a_{i,j} \equiv b_{i,j} \pmod m$ for all $i,j \in {0,1,\dots,n}$.
+
+**Definition 3.1.** If there exists $A' \in M_n(\mathbb{Z}_m)$ such that $AA' \equiv I_n \pmod m$ then $A$ is _invertible_mod $m$.
+
+**Theorem 3.1.** Let $A \in M_n(\mathbb{Z}_m)$ and $m \in \mathbb{N}$. $A$ is invertible $\iff \det(A)$ and $m$ are relatively prime.
+
+_Proof._ [4] p. 94. Suppose $A$ is invertible. Then $AB \equiv I \pmod m$ for some $B \in M_n(\mathbb{Z}_m)$.
+
+$$\det(AB) \equiv 1 \pmod m$$ $$\det(A) \cdot \det(B) \equiv 1 \pmod m$$
+
+Let $a = \det(A)$ and $b = \det(B)$.
+
+$$ab + km = 1 \text{ for some } k \in \mathbb{Z}$$
+
+Suppose $c \mid a$ and $c \mid m$. Then $c \mid (ab+km)$, i.e. $c \mid 1$. Therefore $\gcd(a,m) = 1$.
+
+Conversely suppose $\gcd(a,m) = 1$. Then
+
+$$ab + km = 1 \text{ for some } b,k \in \mathbb{Z}$$ $$ab \equiv 1 \pmod m$$
+
+A well known equation for square matrices is
+
+$$A , \mathrm{adj}(A) = \det(A), I$$
+
+where $\mathrm{adj}(A)$ is the adjoint matrix of $A$. This equation gives a formula to calculate $A^{-1}$.
+
+$$A,\mathrm{adj}(A) \equiv \det(A), I \pmod m$$ $$bA,\mathrm{adj}(A) \equiv ba, I \pmod m$$ $$A, b,\mathrm{adj}(A) \equiv I \pmod m$$ $$A^{-1} \equiv b,\mathrm{adj}(A) \pmod m \qquad \blacksquare$$
+
+**Remark 1.** If $\det(A) = 0$ then $A$ is not invertible, since $\gcd(0,m) = m$. An example of a non-invertible matrix with a non-zero determinant is $\begin{bmatrix} 2 & 0 \ 0 & 1 \end{bmatrix}$ over $M_2(\mathbb{Z}_4)$.
+
+**Definition 3.2.** A transformation $T: \mathbb{Z}_m^n \to \mathbb{Z}_m^n$ defined by $T(\mathbf{x}) = A\mathbf{x} + \mathbf{b} \pmod m$ for some $\mathbf{b} \in \mathbb{Z}_m^n$, $A \in M_n(\mathbb{Z}_m)$ is called _affine_. If $\mathbf{b} = 0$, then $T$ is a _linear_ transformation.
+
+**Corollary 3.2.** The affine linear map from Definition 3.2 is bijective if and only if $\det(A)$ and $m$ are relatively prime.
+
+**Definition 3.3.** Let $A \in M_n(\mathbb{Z}_m)$ and $m \in \mathbb{N}$. $A$ is _periodic_ if there exists $t \in \mathbb{N}$ such that $t > 0$ and $A^t = I_n$. The _period_ of $A$ is the smallest positive integer $t$ such that $A^t = I_n$.
+
+An affine transformation $T: \mathbb{Z}_m^n \to \mathbb{Z}_m^n$ is _periodic_ if $T^t(\mathbf{x}) = \mathbf{x}$ for some positive integer $t$ and all $\mathbf{x} \in \mathbb{Z}_m^n$.
+
+**Theorem 3.3.** Let $A \in M_n(\mathbb{Z}_m)$ and $m \in \mathbb{N}$. $A$ is periodic $\iff$ $A$ is invertible.
+
+_Proof._ Suppose $A$ is periodic. Then for some positive integer $t$
+
+$$A^t \equiv I \pmod m$$ $$A, A^{t-1} \equiv I \pmod m$$
+
+Therefore $A$ is invertible.
+
+Conversely, suppose $A$ is invertible. There are exactly $m^{n^2}$ distinct matrices in $M_n(\mathbb{Z}_m)$. Define the multiset $S = {A^i \bmod m : 0 \le i \le m^{n^2}}$. There exists $A^k, A^l \in S$ where $k \le l$ and $A^k = A^l$.
+
+$$A^k \equiv A^l \pmod m$$ $$A^k(A^{-1})^k \equiv A^l(A^{-1})^k \pmod m$$ $$I \equiv A^{l-k} \pmod m$$
+
+Therefore $A$ is periodic. $\blacksquare$
+
+**Theorem 3.4.** The affine transformation $T: \mathbf{x} \to A\mathbf{x} + c\mathbf{b}$ defined in 3.2 is periodic if and only if $A$ is invertible.
+
+_Proof._ Define affine transformation $S: \mathbb{Z}_m^{n+1} \to \mathbb{Z}_m^{n+1}$ by
+
+$$S(\mathbf{v}) = \begin{bmatrix} A & \mathbf{b} \ \mathbf{0}^T & 1 \end{bmatrix} = A'\mathbf{v}$$
+
+Let $\mathbf{y} = \begin{bmatrix} \mathbf{x} \ c \end{bmatrix}$ for some $c \in \mathbb{Z}_m$, $\mathbf{x} \in \mathbb{Z}_m^n$. Then
+
+$$S(\mathbf{y}) = \begin{bmatrix} A & \mathbf{b} \ \mathbf{0}^T & 1 \end{bmatrix}\begin{bmatrix} \mathbf{x} \ c \end{bmatrix} = \begin{bmatrix} A\mathbf{x} + c\mathbf{b} \ c \end{bmatrix} = \begin{bmatrix} T(\mathbf{x}) \ c \end{bmatrix}$$
+
+Let $P(n)$ be the proposition that
+
+$$S^n\left(\begin{bmatrix} \mathbf{x} \ c \end{bmatrix}\right) = \begin{bmatrix} T^n(\mathbf{x}) \ c \end{bmatrix}$$
+
+$P(1)$ has been proved. If $P(k)$ is true, then
+
+$$S^{k+1}(\mathbf{y}) = S(S^k(\mathbf{y})) = \begin{bmatrix} A & \mathbf{b} \ \mathbf{0}^T & 1 \end{bmatrix}\begin{bmatrix} T^k(\mathbf{x}) \ c \end{bmatrix} = \begin{bmatrix} A,T^k(\mathbf{x}) + c\mathbf{b} \ c \end{bmatrix} = \begin{bmatrix} T^{k+1}(\mathbf{x}) \ c \end{bmatrix}$$
+
+Therefore $P(k) \Rightarrow P(k+1)$ and by induction, $P(n)$ is true for all $n \ge 1$.
+
+If there exists positive integer $t$ such that
+
+$$S^t\left(\begin{bmatrix} \mathbf{x} \ c \end{bmatrix}\right) = \begin{bmatrix} T^t(\mathbf{x}) \ c \end{bmatrix} = \begin{bmatrix} \mathbf{x} \ c \end{bmatrix}$$
+
+then $S$ and $T$ are both periodic, otherwise $S$ and $T$ are both non-periodic.
+
+$$T \text{ is periodic} \iff S \text{ is periodic}$$ $$T \text{ is periodic} \iff A' \text{ is invertible (Theorem 3.3)}$$ $$T \text{ is periodic} \iff \text{there exists } A'^{-1} = \begin{bmatrix} A^{-1} & A^{-1}(-\mathbf{b}) \ \mathbf{0}^T & 1 \end{bmatrix}$$ $$T \text{ is periodic} \iff A \text{ is invertible} \qquad \blacksquare$$
+
+**Remark 2.** Any scalar multiple of $\mathbf{b}$ can be used in $T$ and the period will remain the same.
+
+---
+
+## 4. Applications to digital image scrambling
+
+**Definition 4.1.** The _Fibonacci affine transformation_ $T: \mathbb{Z}_m^2 \to \mathbb{Z}_m^2$ is defined by
+
+$$T(\mathbf{x}) = F\mathbf{x} + \mathbf{b} \pmod m$$
+
+for some $\mathbf{b} \in \mathbb{Z}_m^2$, $m \in \mathbb{N}$ and $F$ from Definition 2.2.
+
+**Proposition 4.1.** The Fibonacci affine transformation is periodic.
+
+_Proof._ $\gcd(\det(F), m) = 1$ for all $m$, so by Theorems 3.1 and 3.4, the transformation is periodic. $\blacksquare$
+
+The Fibonacci matrix transformation is described in [3] where the authors use it to scramble images of dimension $m \times m$ pixels. Each pixel has a coordinate in $\mathbb{Z}_m^2$ that can be scrambled to a new coordinate by $T$. The period of the transformation varies for different $m$. The suggested scrambling method is to apply $T$ on every pixel of the image. Then to decrypt, repeatedly apply $T$ to the scrambled image until the original image is recovered. It is unclear why the inverse transformation of $T$ is not used to make the decryption quicker. The vector $\mathbf{b}$ can be used as a key. Different values of $\mathbf{b}$ will affect the period of $T$.
+
+**Definition 4.2.** The _Arnold transformation_ $T: \mathbb{Z}_m^2 \to \mathbb{Z}_m^2$ is defined by $T(\mathbf{x}) = A\mathbf{x} \pmod m$ for $m \in \mathbb{N}$ and
+
+$$A = \begin{bmatrix} 1 & 1 \ 1 & 2 \end{bmatrix}$$
+
+The Arnold transformation works the same way as the Fibonacci matrix transformation. The Arnold transformation is also periodic for all $m$.
+
+**Remark 3.** $F^2 = A$.
+
+Another transformation described in [4] works as follows.
+
+**Definition 4.3.** $T: \mathbb{Z}_m^2 \to \mathbb{Z}_m^2$ defined by $T(\mathbf{x}) = B\mathbf{x} + \mathbf{b} \pmod{f_{n+1}}$ for some $\mathbf{b} \in \mathbb{Z}_m^2$, $m \in \mathbb{N}$ with
+
+$$B = \begin{bmatrix} f_n & 0 \ 0 & f_n \end{bmatrix}$$
+
+**Proposition 4.2.** $B$ is invertible, hence the transformation is periodic.
+
+_Proof._ $\det(B) = f_n^2 = f_{n-1}f_{n+1} + (-1)^{n+1}$ by Theorem 2.4.
+
+If $c \mid \det(B)$ and $c \mid f_{n+1}$ then $c \mid 1$, therefore $\det(B)$ and $f_{n+1}$ are coprime. $\blacksquare$
+
+**Proposition 4.3.** When $n$ is odd the period of $B$ is 2. When $n$ is even the period of $B$ is 4.
+
+_Proof._ From Theorem 2.4 we have
+
+$$f_n^2 \equiv (-1)^{n+1} \pmod{f_{n+1}}$$
+
+so $f_n^4 \equiv 1 \pmod{f_{n+1}}$ and $B^4 \equiv I \pmod{f_{n+1}}$.
+
+If $B$ has period $t$ then $t \mid 4$.
+
+When $n$ is even, $B \ne I$ and $B^2 \equiv -I \pmod{f_{n+1}}$. Therefore when $n$ is even the period of $B$ is 4.
+
+When $n$ is odd, $f_n^2 \equiv 1 \pmod{f_{n+1}}$, so $B^2 \equiv I \pmod{f_{n+1}}$. Since $B \ne I \pmod{f_{n+1}}$, when $n$ is odd the period of $B$ is 2. $\blacksquare$
+
+**Remark 4.** Although $B$ has period 2 or 4, the period of the transformation may not be 2 or 4 when $\mathbf{b}$ is non-zero.
+
+The transformation permutes the columns and rows of the image by the permutation $R: k \to kf_n + b \pmod{f_{n+1}}$ where $k$ is a column or row number in ${1,2,\dots,f_{n+1}-1}$. The authors in [4] also include zero in this set but zero is a fixed point when $b = 0$. The authors state that having a period of 2 or 4 is efficient because encryption and decryption are the same functions and decryption can be achieved by reapplying the transformation.
+
+The case where $b = 0$ will be examined. Let $S: k \to kf_n \pmod{f_{n+1}}$ for $k$ in ${1,2,\dots,f_{n+1}-1}$. It follows from Proposition 4.3 that $S$ has period 4 if $n$ is even and period 2 if $n$ is odd.
+
+**Definition 4.4.** A _uniform permutation_ is a permutation in which all disjoint cycles are of the same length. This means there are no fixed points unless the permutation is the identity.
+
+**Remark 5.** If a permutation has period $t$, then the length of each cycle divides $t$, since $t$ is the lowest common multiple of all cycle lengths.
+
+Suppose the columns or rows of an image are scrambled using a uniform permutation. Then every row or column is moved, so the image content may be hidden more effectively than a permutation that leaves some rows or columns unchanged.
+
+In general the permutation $S$ is not uniform. Fixed points can be found by solving $x$ in the equation
+
+$$xf_n \equiv x \pmod{f_{n+1}} \tag{1}$$
+
+**Proposition 4.4.** For $n > 3$, if $n$ is odd then $S$ is not uniform.
+
+_Proof._ $x = k(f_n+1)$, $k \in \mathbb{N}$, gives solutions to equation (1).
+
+$$k(f_n+1) \cdot f_n = k(f_n^2+f_n) \equiv k(1+f_n) \pmod{f_{n+1}}$$
+
+**Remark 6.** When $n=3$, $S$ is uniform. $\blacksquare$
+
+**Proposition 4.5.** If $n$ is even, then $S$ has no transpositions.
+
+_Proof._ A transposition exists if
+
+$$x \equiv f_n^2 x \pmod{f_{n+1}} \tag{2}$$
+
+and
+
+$$x \not\equiv f_n x \pmod{f_{n+1}} \tag{3}$$
+
+for some $x \in {1,2,\dots,f_{n+1}-1}$. This proof will show that if equation (2) has a solution, then $x \equiv f_n x \pmod{f_{n+1}}$ has the same solution.
+
+Solutions are found by solving for $x$:
+
+$$x \equiv f_n^2 x \pmod{f_{n+1}} \tag{4}$$ $$x \equiv -x \pmod{f_{n+1}} \tag{5}$$ $$2x \equiv 0 \pmod{f_{n+1}} \tag{6}$$
+
+A solution exists $\iff$ 2 divides $f_{n+1}$, then $x = \dfrac{f_{n+1}}{2}$.
+
+$f_{n+1}$ is even, so by Theorem 2.1, $f_n$ is odd.
+
+$$f_n x = (2m+1)x \equiv (2m)\frac{f_{n+1}}{2} + \frac{f_{n+1}}{2} \equiv m f_{n+1} + x \pmod{f_{n+1}}$$ $$f_n x \equiv x \pmod{f_{n+1}}$$
+
+This is a contradiction to equation (3). Therefore, no transpositions exist. $\blacksquare$
+
+**Proposition 4.6.** For even $n$, $S$ is uniform $\iff f_{n+1}$ is odd.
+
+_Proof._ Suppose $S$ is uniform, then no fixed points exist. If $x \equiv f_n x \pmod{f_{n+1}}$ has no solutions then by Proposition 4.5
+
+$$x \equiv f_n^2 x \pmod{f_{n+1}} \tag{7}$$ $$2x \equiv 0 \pmod{f_{n+1}} \tag{8}$$
+
+has no solutions so $f_{n+1}$ is odd.
+
+Conversely, suppose $f_{n+1}$ is odd and a fixed point $x$ exists. Then equation (8) has no solution, thus
+
+$$x \equiv f_n^2 x \pmod{f_{n+1}}$$
+
+has no solution. But a fixed point exists so
+
+$$x \equiv f_n x \equiv f_n^2 x \pmod{f_{n+1}}$$
+
+This is a contradiction. $\blacksquare$
+
+**Proposition 4.7.** For even $n$, $f_{n+1}$ is odd $\iff n \equiv 0$ or $4 \pmod 6$.
+
+_Proof._ Let $f_{n+1}$ be odd, then by Theorem 2.1 either
+
+$$n+1 = 3k+1 \implies n = 3k$$
+
+or
+
+$$n+1 = 3l+2 \implies n = 3l+1$$
+
+Equivalently, $f_{n+1}$ is odd $\iff n = 3k$ or $n = 3l+1$. Now restrict $n$ to even values, so let $k = 2m$ and $l = 2m+1$. Then
+
+$$n = 6m$$
+
+or
+
+$$n = 3(2m+1)+1 = 6m+4$$
+
+Therefore, for even $n$, $f_{n+1}$ is odd $\iff n = 6m$ or $n = 6m+4$. $\blacksquare$
+
+---
+
+## 5. Conclusion
+
+The Fibonacci transformation and the Arnold transformation can be used on square images of any size. The period of the transformation will vary for different size images. The period of $F \bmod m$ can be as large as $6m$ so the decryption process described could be very inefficient.
+
+The transformation in Definition 4.3 transforms pixels of an $f_{n+1} \times f_{n+1}$ image. In most practical cases, images are unlikely to be square and of this dimension. In this case the image can be cropped to $f_{n+1} \times f_{n+1}$ so that the transformation can be applied. Alternatively, a large Fibonacci number can be chosen that exceeds the dimensions of the image. But this would generate an encrypted image larger than the unencrypted image. Due to these limitations, the transformations do not appear to be very practical.
+
+---
+
+## Appendix: Methods to calculate $f_n$ in $\mathbb{Z}_m$
+
+To calculate the $n$th Fibonacci number mod $m$, the equation in Theorem 2.2 can be used and then $f_n$ can be reduced modulo $m$. For very large $n$, this is infeasible. If $F$ can be diagonalized over $\mathbb{Z}_m$ then calculating $F^n$ is fast.
+
+Eigenvalues of $F$ exist if for non-zero vector $\mathbf{x}$,
+
+$$F\mathbf{x} \equiv \lambda \mathbf{x} \pmod m$$ $$F\mathbf{x} - \lambda \mathbf{x} \equiv \mathbf{0} \pmod m$$ $$(F - \lambda I)\mathbf{x} \equiv \mathbf{0} \pmod m$$
+
+Therefore $\lambda$ is an eigenvalue of $F$ if
+
+$$\gcd(\det(F-\lambda I), m) > 1$$
+
+The characteristic polynomial of $F$ is $p(\lambda) = \det(F - \lambda I) = \lambda^2 - \lambda - 1$.
+
+For example: $\lambda_1 = 3$ and $\lambda_2 = 8$ are eigenvalues of $F$ in $\mathbb{Z}_{10}$ because $p(3) = 5$ and $p(8) = 5$ and $\gcd(5,10) \ne 1$.
+
+$$E_3 = \mathrm{null}\begin{bmatrix} -3 & 1 \ 1 & -2 \end{bmatrix} = \mathrm{null}\begin{bmatrix} 7 & 1 \ 1 & 8 \end{bmatrix} = \mathrm{null}\begin{bmatrix} 1 & 8 \ 7 & 1 \end{bmatrix} = \mathrm{null}\begin{bmatrix} 1 & 8 \ 0 & 5 \end{bmatrix} = \mathrm{span}\begin{bmatrix} 6 \ -2 \end{bmatrix}$$
+
+$$E_8 = \mathrm{null}\begin{bmatrix} -8 & 1 \ 1 & -7 \end{bmatrix} = \mathrm{null}\begin{bmatrix} 2 & 1 \ 1 & 3 \end{bmatrix} = \mathrm{null}\begin{bmatrix} 1 & 3 \ 2 & 1 \end{bmatrix} = \mathrm{null}\begin{bmatrix} 1 & 3 \ 0 & 5 \end{bmatrix} = \mathrm{span}\begin{bmatrix} 6 \ -2 \end{bmatrix}$$
+
+Although $\lambda_1$ and $\lambda_2$ are distinct, they have the same eigenspace so we do not have two linearly independent eigenvectors to diagonalize $F$.
+
+**Proposition .1.** If $m \mid p(\lambda_1)$ and $m \mid p(\lambda_2)$ for distinct eigenvalues $\lambda_1$ and $\lambda_2$, and $\gcd(\lambda_1 - \lambda_2, m) = 1$, then
+
+$$f_n \equiv (\lambda_1 - \lambda_2)^{-1}(\lambda_1^n - \lambda_2^n) \pmod m$$
+
+_Proof._ If $m \mid p(\lambda)$ then $\lambda(\lambda - 1) \equiv 1 \pmod m$ and $\lambda(1-\lambda) \equiv -1 \pmod m$.
+
+$$E_\lambda = \mathrm{null}\begin{bmatrix} -\lambda & 1 \ 1 & 1-\lambda \end{bmatrix} = \mathrm{null}\begin{bmatrix} 1 & 1-\lambda \ -\lambda & 1 \end{bmatrix} = \mathrm{null}\begin{bmatrix} 1 & 1-\lambda \ 0 & \lambda(1-\lambda)+1 \end{bmatrix} = \mathrm{null}\begin{bmatrix} 1 & 1-\lambda \ 0 & 0 \end{bmatrix} = \mathrm{span}\begin{bmatrix} \lambda-1 \ 1 \end{bmatrix}$$
+
+Let $\mathbf{v}_1$ and $\mathbf{v}_2$ be eigenvectors corresponding to $\lambda_1$ and $\lambda_2$ and let $P = [\mathbf{v}_1\ \mathbf{v}_2]$.
+
+$$F = PDP^{-1}$$ $$F^n = PD^nP^{-1} = \begin{bmatrix} \lambda_1-1 & \lambda_2-1 \ 1 & 1 \end{bmatrix}\begin{bmatrix} \lambda_1^n & 0 \ 0 & \lambda_2^n \end{bmatrix}\frac{1}{\det(P)}\begin{bmatrix} 1 & 1-\lambda_2 \ -1 & \lambda_1-1 \end{bmatrix}$$
+
+$$= \frac{1}{\det(P)}\begin{bmatrix} \lambda_1-1 & \lambda_2-1 \ 1 & 1 \end{bmatrix}\begin{bmatrix} \lambda_1^n & (1-\lambda_2)\lambda_1^n \ -\lambda_2^n & (\lambda_1-1)\lambda_2^n \end{bmatrix}$$
+
+$$= \frac{1}{\det(P)}\begin{bmatrix} (\lambda_1-1)\lambda_1^n+(1-\lambda_2)\lambda_2^n & (\lambda_1-1)(1-\lambda_2)\lambda_1^n+(\lambda_1-1)(\lambda_2-1)\lambda_2^n \ \lambda_1^n-\lambda_2^n & (1-\lambda_2)\lambda_1^n+(\lambda_1-1)\lambda_2^n \end{bmatrix}$$
+
+$$F^n = \begin{bmatrix} f_{n-1} & f_n \ f_n & f_{n+1} \end{bmatrix}$$
+
+$$f_n = \frac{1}{\det(P)}\lambda_1^n - \lambda_2^n \pmod m$$
+
+$$f_n = (\lambda_1-\lambda_2)^{-1}(\lambda_1^n - \lambda_2^n) \pmod m \qquad \blacksquare$$
+
+**Remark 7.** If $m \mid p(\lambda_1)$ and $m \mid p(\lambda_2)$, this does not imply $\gcd(\lambda_1-\lambda_2, m) = 1$. E.g. in $\mathbb{Z}_{55}$, $p(48) \equiv 0 \pmod{55}$ and $p(8) \equiv 0 \pmod{55}$ but $\gcd(48-8, 55) = 5$.
+
+The eigenvalues in these examples have been found by trying each element in $\mathbb{Z}_m$. Eigenvalues can be found directly if the equation from Theorem 2.2 is used. There are some advantages to using prime $m$. When $m$ is prime, 2 is invertible and a method to calculate $\sqrt5$ is possible for some primes. Also $\gcd(\lambda_1-\lambda_2, m) = 1$ is always true, so the equation from Proposition .1 can be used once the eigenvalues have been found.
+
+**Definition .1.** Given integers $a$ and $p$, if $x^2 \equiv a \pmod p$ for some $x \in {1,2,\dots,p-1}$ then $a$ is a _quadratic residue_ mod $p$.
+
+**Definition .2.** Given odd prime $p$ and integer $a$, the _Legendre symbol_ is
+
+$$(a/p) = a^{\frac{p-1}{2}} \pmod p$$
+
+**Theorem .2.** For $p$ an odd prime and $a \in \mathbb{Z}_p^*$
+
+$$a \text{ is a quadratic residue} \pmod p \iff (a/p) \equiv 1 \pmod p$$
+
+_Proof._ [9] Suppose $x^2 \equiv a \pmod p$ for some $x \in \mathbb{Z}_p^*$. Then by using Fermat's Theorem
+
+$$a^{\frac{p-1}{2}} = (x^2)^{\frac{p-1}{2}} = x^{p-1} \equiv 1 \pmod p$$
+
+Suppose $(a/p) = 1$ and let $a = g^k$ for primitive $g \in \mathbb{Z}_p^*$ and $k \in {1,2,\dots,p-1}$. Note: this is always possible for prime $p$.
+
+$$a^{\frac{p-1}{2}} = (g^k)^{\frac{p-1}{2}} = g^{k(\frac{p-1}{2})} \equiv 1 \pmod p \quad \text{(by assumption)}$$ $$g^{k(\frac{p-1}{2})} = g^{p-1} \pmod p \quad \text{(because primitive)}$$
+
+Therefore $(p-1) \mid k(\tfrac{p-1}{2})$, so $k$ is even. Then $a = g^k = g^{2m} = (g^m)^2$ for some $m \in \mathbb{N}$. Thus $a$ is a quadratic residue. $\blacksquare$
+
+**Theorem .3 (Law of Quadratic Reciprocity).** For distinct odd primes $p$ and $q$,
+
+1. If both $p$ and $q \equiv 3 \pmod 4$, then either $(q/p) = 1$ or $(p/q) = 1$ but not both.
+2. If $p$ or $q \equiv 1 \pmod 4$, then $(q/p) = 1 \iff (p/q) = 1$.
+
+**Proposition .4.** For odd prime $p$, 5 is a quadratic residue $\iff p \equiv 1$ or $-1 \pmod{10}$.
+
+_Proof._ By Quadratic reciprocity,
+
+$$(5/p) = 1 \iff (p/5) = 1$$ $$(5/p) = 1 \iff p^{\frac{5-1}{2}} \equiv 1 \pmod 5$$ $$(5/p) = 1 \iff p^2 \equiv 1 \pmod 5$$ $$(5/p) = 1 \iff p \equiv 1 \text{ or } p \equiv -1 \pmod 5$$ $$(5/p) = 1 \iff p = 5k \pm 1$$ $$(5/p) = 1 \iff p = 5(2m) \pm 1 \quad \text{(odd } k \text{ gives even } p\text{)}$$ $$(5/p) = 1 \iff p \equiv 1 \text{ or } p \equiv -1 \pmod{10} \qquad \blacksquare$$
+
+Now that we can identify which primes have 5 as a quadratic residue, there still remains the problem of calculating $\sqrt5$. In general, calculating square roots of quadratic residues has the same level of complexity as integer factorization [12].
+
+**Proposition .5.** For given integer $a$, if $p \equiv 3 \pmod 4$ then $\sqrt{a} \equiv a^{\frac{p+1}{4}} \pmod p$.
+
+_Proof._ Assume $a$ is a quadratic residue. Then
+
+$$a^{\frac{p-1}{2}} \equiv 1 \pmod p$$ $$a \cdot a^{\frac{p-1}{2}} \equiv a \pmod p$$ $$a^{\frac{p-1}{2}+1} \equiv a \pmod p$$ $$a^{\frac{p+1}{2}} \equiv a \pmod p$$ $$\sqrt{a^{\frac{p+1}{2}}} \equiv \sqrt{a} \pmod p$$ $$a^{\frac{p+1}{4}} \equiv \sqrt{a} \pmod p$$
+
+There is always a solution because $4 \mid (p+1)$. $\blacksquare$
+
+**Remark 8.** In the first 1000 primes the proportion that are of the form $10k \pm 1$ is 0.491. The proportion that are of the form $4k+3$ is 0.504. The proportion that satisfy both forms is 0.251.
+
+---
+
+## References
+
+1. Buchmann, J.A. _Introduction to Cryptography_, Springer-Verlag New York Inc, 2001.
+2. J. Zou, R. K. Ward, D. Qi. _A new image scrambling method based on Fibonacci numbers_, Proceedings of the 2004 International Symposium on Circuits and Systems ISCAS 2004, May 23–26, 2004, Vancouver, Canada, Vol 3. pg 965.
+3. J. Zou, X. Tie, R. K. Ward, D. Qi. _Some Novel Image Scrambling Methods Based on Affine Modular Matrix Transformation_, Journal of Information & Computational Science 2:1 (2005) 223–227.
+4. J. Zou, R. K. Ward, D. Qi. _The Generalized Fibonacci Transformations and Application to Image Scrambling_, Acoustics, Speech, and Signal Processing, 2004. Proceedings. (ICASSP '04). IEEE International Conference on, Vol 3. pg 385.
+5. Poole, D. _Linear Algebra: A Modern Introduction_, 2nd Ed, Australia: Belmont, CA: Thomson Brooks/Cole, 2006.
+6. W. Zeng, H. Yu, and C. Lin. _Multimedia Security Technologies for Digital Rights Management_, Amsterdam; Boston: Academic Press, 2006.
+7. http://en.wikipedia.org/wiki/Fibonacci_number
+8. http://mcraeclan.com/MathHelp/BasicNumberSquareQuadraticResidues.htm (Read 30/11/2006)
+9. http://rooster.stanford.edu/~ben/maths/numbertheory/qr.html (Read 30/11/2006)
+10. http://mathworld.wolfram.com/QuadraticResidue.html (Read 30/11/2006)
+11. http://en.wikipedia.org/wiki/Quadratic_reciprocity (Read 5/12/2006)
+12. http://en.wikipedia.org/wiki/Quadratic_residue (Read 5/12/2006)
+---
+I asked if this algorithm could be modified to handle images of any size instead of pinned Fibonacci numbered sizes. This was the response I received, but I did not receive any examples, code or math:
+
+Good news: the paper's own math already gives us what we need — the restriction to specific sizes (like fn+1×fn+1fn+1×fn+1) only applied to Zou's _scaled_ transformation (Definition 4.3). The plain **Fibonacci affine transform**(Definition 4.1, T(x)=Fx+b mT(x)=Fx+bmodm) is periodic for _every_ modulus mm, because det(F)=−1det(F)=−1 is coprime to every integer (Proposition 4.1). The only real constraint is that FF acts on a **square** Zm2Zm2grid.
+
+So to handle _any_ image size, we just need two small extensions beyond the paper:
+
+1. **Pad to a square.** Any W×HW×H image can be embedded in a square canvas of side N=max(W,H)N=max(W,H) (no need for NN to be a Fibonacci number, or a power of two, or anything special — any NNworks because of the fact above).
+2. **Use the exact inverse instead of relying on the period.** The paper decrypts by re-applying TT until the period comes back around, which the authors themselves call inefficient (up to 6N6N applications). Since F−1≡[−1110](modN)F−1≡[−1110](modN) always exists, we can decrypt in exactly as many steps as we encrypted — no searching for the period.
+
+That turns the "encryption key" into: a **round count** tt (how many times FF is applied — more rounds = more scrambled) and a **sequence of offset vectors** b1,…,btb1,…,bt (derived from a passphrase), applied in order to encrypt and in reverse with F−1F−1 to decrypt.
+
+I built this as a working tool below: type text, it's rendered to an image, padded to a square, and scrambled with this generalized Fibonacci map — fully reversible with the same key.
\ No newline at end of file
diff --git a/archive/.envrc b/archive/.envrc
new file mode 100644
index 0000000..3550a30
--- /dev/null
+++ b/archive/.envrc
@@ -0,0 +1 @@
+use flake
diff --git a/archive/.forgejo/workflows/build-dev.yml b/archive/.forgejo/workflows/build-dev.yml
new file mode 100644
index 0000000..40bd7cf
--- /dev/null
+++ b/archive/.forgejo/workflows/build-dev.yml
@@ -0,0 +1,66 @@
+# This action builds the `dev` branch any time a Pull Request is submitted to dev.
+# The purpose of this is two fold:
+# - Prevent breaking changes from being merged to dev
+# - Automates the building of RadiantWave-Dev which can then be uploaded
+# to the Attic server, and the development machines can pull prebuilt
+# binaries instead of building everything from source, resulting in faster
+# updates, once updates work again that is...
+on:
+ push:
+ branches:
+ - dev
+ pull_request:
+ branches:
+ - dev
+
+jobs:
+ build:
+ runs-on: neils-server-runner
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v6
+
+ - name: Test
+ run: |
+ . /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
+ nix develop --command go test ./internal/mixer/ -v -timeout 30s
+
+ - name: Build
+ run: |
+ . /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
+ nix build -L
+ echo "Working dir: $(pwd)"
+ echo "Result symlink: $(readlink -f result)"
+ find result/ -type f
+
+ - name: Notify
+ if: always()
+ uses: https://github.com/dawidd6/action-send-mail@v3
+ with:
+ server_address: smtp.gmail.com
+ server_port: 465
+ username: ${{ secrets.MAIL_USERNAME }}
+ password: ${{ secrets.MAIL_PASSWORD }}
+ subject: "RadiantWave build ${{ job.status }}"
+ to: cnclack@pm.me
+ from: ci@radiantwavetech.com
+ body: "Build ${{ job.status }} for commit ${{ github.sha }} on branch dev"
+
+ # - name: Trigger KioskConfig dev build
+ # if: success()
+ # run: |
+ # curl -X POST \
+ # -H "Authorization: token ${{ secrets.TOKEN }}" \
+ # -H "Content-Type: application/json" \
+ # -d '{"ref": "main"}' \
+ # https://codeberg.org/api/v1/repos/RhemaWave-Technologies/KioskConfig/actions/workflows/update-dev.yaml/dispatches
+
+ # - name: Trigger KioskConfig dev build
+ # if: success()
+ # run: |
+ # curl -X POST \
+ # -H "Authorization: token ${{ secrets.FORGEJO_TOKEN }}" \
+ # -H "Accept: application/json" \
+ # -H "Content-Type: application/json" \
+ # https://codeberg.org/api/v1/repos/RhemaWave-Technologies/KioskConfig/dispatches \
+ # -d '{"type": "radiantwave-dev-built"}'
diff --git a/archive/.forgejo/workflows/build-prod.yml b/archive/.forgejo/workflows/build-prod.yml
new file mode 100644
index 0000000..a0746e0
--- /dev/null
+++ b/archive/.forgejo/workflows/build-prod.yml
@@ -0,0 +1,63 @@
+# This action builds the `dev` branch any time a Pull Request is submitted to dev.
+# The purpose of this is two fold:
+# - Prevent breaking changes from being merged to dev
+# - Automates the building of RadiantWave-Dev which can then be uploaded
+# to the Attic server, and the development machines can pull prebuilt
+# binaries instead of building everything from source, resulting in faster
+# updates, once updates work again that is...
+on:
+ pull_request:
+ branches:
+ - main
+
+jobs:
+ build:
+ runs-on: neils-server-runner
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v6
+
+ - name: Test
+ run: |
+ . /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
+ nix develop --command go test ./internal/mixer/ -v -timeout 30s
+
+ - name: Build
+ run: |
+ . /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
+ nix build -L
+ echo "Working dir: $(pwd)"
+ echo "Result symlink: $(readlink -f result)"
+ find result/ -type f
+
+ - name: Notify
+ if: always()
+ uses: https://github.com/dawidd6/action-send-mail@v3
+ with:
+ server_address: smtp.gmail.com
+ server_port: 465
+ username: ${{ secrets.MAIL_USERNAME }}
+ password: ${{ secrets.MAIL_PASSWORD }}
+ subject: "RadiantWave build ${{ job.status }}"
+ to: cnclack@pm.me
+ from: ci@radiantwavetech.com
+ body: "Build ${{ job.status }} for commit ${{ github.sha }} on branch main"
+
+ # - name: Trigger KioskConfig dev build
+ # if: success()
+ # run: |
+ # curl -X POST \
+ # -H "Authorization: token ${{ secrets.TOKEN }}" \
+ # -H "Content-Type: application/json" \
+ # -d '{"ref": "main"}' \
+ # https://codeberg.org/api/v1/repos/RhemaWave-Technologies/KioskConfig/actions/workflows/update-dev.yaml/dispatches
+
+ # - name: Trigger KioskConfig main build
+ # if: success()
+ # run: |
+ # curl -X POST \
+ # -H "Authorization: token ${{ secrets.FORGEJO_TOKEN }}" \
+ # -H "Accept: application/json" \
+ # -H "Content-Type: application/json" \
+ # https://codeberg.org/api/v1/repos/RhemaWave-Technologies/KioskConfig/dispatches \
+ # -d '{"type": "radiantwave-dev-built"}'
diff --git a/archive/AGENTS.md b/archive/AGENTS.md
new file mode 100644
index 0000000..7482a01
--- /dev/null
+++ b/archive/AGENTS.md
@@ -0,0 +1,261 @@
+# RadiantWave — Codebase Architecture
+
+## What This Is
+
+A kiosk application for "RadiantWave" wellness technology. It displays scrolling
+proclamation text rendered with custom shaders, plays audio at solfeggio
+frequencies, and manages WiFi/provisioning on a headless Linux kiosk.
+
+**Core libraries:** SDL2, OpenGL 3.3, SQLite (GORM), D-Bus (NetworkManager).
+**Build system:** Nix flake. **CI:** Forgejo on a self-hosted runner.
+
+---
+
+## Application Lifecycle
+
+```
+rhemawave.go → internal/application.Run()
+```
+
+`Run()` performs:
+1. SDL2 init (video, audio, events)
+2. Create window with `SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN`
+3. OpenGL 3.3 context
+4. ShaderManager singleton init
+5. FontManager singleton init
+6. Mixer singleton init
+7. SQLite connect + GORM auto-migrate
+8. Sync proclamations from remote API
+9. Start audio download goroutine
+10. Enter SDL event loop
+
+The event loop polls SDL events, calls `Router.Update()` + `Router.Render()`,
+and runs `checkState()` to drive the provisioning state machine.
+
+---
+
+## Provisioning State Machine
+
+Defined in `internal/application/application.go`:
+
+```
+FIRST_RUN → NEEDS_INTERNET → NEEDS_LICENSE_KEY → NEEDS_EMAIL_ADDRESS → DOWNLOADING_ASSETS → READY
+```
+
+Each state maps to a page. `checkState()` evaluates DB values and network
+status to decide which page to show.
+
+---
+
+## Page System (`internal/page/`)
+
+All pages implement the `Page` interface:
+
+```go
+type Page interface {
+ Init(ctx *PageCtx)
+ HandleEvent(event sdl.Event) error
+ Update(dt float64)
+ Render()
+ Destroy()
+}
+```
+
+`PageCtx` provides: `*gorm.DB`, screen dimensions, `DownloadDone` channel,
+`NavigateTo(pageType)` callback.
+
+`Router` (`router.go`) maps `pageType` enum → concrete page struct, manages
+lifecycle (Destroy old → Init new).
+
+| Page | Purpose |
+|------|---------|
+| `Home` | Version info, download progress, license status, F2/F3 keybinds |
+| `ScrollerPage` | **Main screen:** scrolling proclamation text with shaders, line patterns, color patterns, audio playback, velocity control |
+| `SettingsPage` | Menu: audio, WiFi, proclamations, license, email, logs, volume |
+| `AudioOptions` | Audio device selection (via PipeWire pactl), on/off, volume |
+| `ProclamationOptions` | Browse/search/select proclamations from DB |
+| `WiFiSetupPage` | WiFi scan, WPA connect, password entry |
+| `LicenseKeyPage` | License key text input, saves to DB |
+| `EmailAddressPage` | Email text input with regex validation |
+| `LogViewerPage` | Scrollable log viewer from DB |
+| `DownloadingAssets` | Stub during download phase |
+| `Message` | Generic message page (stub) |
+
+---
+
+## OpenGL Rendering
+
+### Virtual Framebuffer (`internal/graphics/virtual_framebuffer.go`)
+Renders to a 1920x1080 FBO, then `glBlitFramebuffer()` to the native window
+resolution. This decouples layout from display size.
+
+### Shaders (`share/rhemawave/shaders/`)
+| Shader | Purpose |
+|--------|---------|
+| `scroller.vert/frag` | Text with font texture; uniform `u_textColor` for per-word coloring |
+| `text.vert/frag` | Non-scrolling text elements |
+| `solid_color.vert/frag` | Flat color (backgrounds, UI) |
+
+---
+
+## Font System (`internal/fontManager/`)
+
+**FontManager** (singleton) wraps SDL_ttf + OpenGL textures:
+- Loads TTF/OTF fonts, creates GL texture atlas per font.
+- `GetGlyph(fontName, rune)` → glyph metrics (advance, bearing, texture coords).
+- `RenderString(fontName, text, x, y, color, scale)` → renders to GL.
+- **Scrambled font mode:** Characters are spatially rearranged in the atlas, creating visual "frequency signatures" when rendered.
+
+### Fonts (`share/rhemawave/fonts/`)
+| File | Use |
+|------|-----|
+| `Phibonacci_regular.otf` | Decorative display font |
+| `Roboto-Regular.ttf` | Clean sans-serif (UI) |
+| `SpaceMonoNerdFont-Regular.ttf` | Monospace with icons |
+
+---
+
+## Pattern System (`internal/pattern/`)
+
+### Line Patterns (`internal/pattern/line/`)
+`LinePattern` interface: `GetNextLine(words, wordIndex, ctx) []string`.
+Registered via `init()` (plugin-style Registry map).
+
+| Pattern | Behavior |
+|---------|----------|
+| Fibonacci | Oscillating sequence (1,2,3,5,8,13,21) for words-per-line; creates wave in 2D |
+| Sine Wave | Sine function → line width as % of screen; 5 cycles over 67 lines |
+
+### Color Patterns (`internal/pattern/color/`)
+Distributes colors across words using Fibonacci-oscillating durations
+(1,1,2,3,5,8,13,21,34,55 words per color, then reverses).
+
+---
+
+## Audio System
+
+### Mixer (`internal/mixer/`)
+Singleton wrapping SDL_mixer:
+- PipeWire sink enumeration via `pactl list sinks short`
+- Volume persistence to DB
+- Device switching with volume restore
+- `Play(wavPath)`, `Stop()`, `SwitchDevice(deviceName)`
+
+### Audio Files
+`.wav` files are gitignored. Downloaded at runtime from
+`files.radiantwavetech.com`, verified against `checksums.md5`, stored in
+`~/.radiantwave/audio/`. A goroutine handles async download; a channel
+signals completion.
+
+### Solfeggio Frequencies
+9 presets (174Hz–963Hz), each mapped to a "healing intention". Stored in DB,
+selectable in AudioOptions page.
+
+---
+
+## Database (`internal/db/`)
+
+SQLite at `~/.local/share/rhemawave/database.sqlite` (WAL mode).
+
+| Model | Purpose |
+|-------|---------|
+| `AppConfig` | Key-value store: license key, email, audio device, volume, download state |
+| `Log` | Application logs (level, message, timestamp) |
+| `Proclamation` | Synced proclamation text (title, content, category, intent colors) |
+| `ProclamationCategory` | Category metadata |
+| `SolfeggioFrequency` | 9 frequency presets |
+| `AudioFile` | Downloaded audio files (path, checksum, status) |
+
+---
+
+## Network (`internal/network/`)
+
+D-Bus integration via `gonetworkmanager`:
+- Async WiFi scan (channel-based results)
+- WPA/WPA2 connection support
+- Captive portal detection
+
+### Remote APIs
+| Endpoint | Purpose |
+|----------|---------|
+| `portal.radiantwavetech.com/api/v1/proclamations` | Sync proclamations |
+| `files.radiantwavetech.com/files/` | Audio file downloads |
+| HTTP API | License validation |
+
+Generic HTTP client in `internal/netreq/netReq.go`: typed `GetJSON[T]()` and
+`Download()` with progress callback.
+
+---
+
+## Assets (`share/rhemawave/`)
+
+Copied into nix store at build time:
+- `fonts/` — 3 font files (see above)
+- `shaders/` — 3 GLSL shader pairs
+- `proclamations/home/` — 16 text files (healing, wellness, productivity)
+- `proclamations/commercial/` — 1 text file
+- `tos/` — 3 HTML files (Welcome, Notice, Getting Started)
+
+---
+
+## C++ Rebuild Map
+
+These are the components that need to be reimplemented in C++ with CMake/Ninja:
+
+| Component | Go Package | C++ Equivalent | External Deps |
+|-----------|-----------|----------------|---------------|
+| Entry / Event Loop | `rhemawave.go`, `application.go` | `main.cpp` | SDL2 |
+| Provisioning FSM | `application.go` | State machine class | — |
+| Page Router | `page/router.go` | Router class | — |
+| Page (11 types) | `page/*.go` | 11 page classes implementing Page interface | — |
+| OpenGL Context | `application.go` | GL context init | SDL2, OpenGL 3.3 |
+| Virtual Framebuffer | `graphics/virtual_framebuffer.go` | FBO + blit | OpenGL |
+| Shader Manager | `graphics/shaderManager.go` | Shader class | OpenGL |
+| Font Manager | `fontManager/fontManager.go` | Font atlas class | SDL_ttf, OpenGL |
+| Line Patterns | `pattern/line/*.go` | Pattern classes + registry | — |
+| Color Patterns | `pattern/color/*.go` | Color pattern class | — |
+| Mixer | `mixer/mixer.go` | Mixer class | SDL_mixer |
+| Network / WiFi | `network/network.go` | NetworkManager wrapper | D-Bus (sdbus-c++) |
+| Database | `db/*.go` | SQLite wrapper | SQLite3 (direct) or ORM |
+| HTTP Client | `netreq/netReq.go` | HTTP client | libcurl or cpp-httplib |
+| Logging | `logger/logger.go` | Logger class | — |
+| Config / App State | `db/models.go` | Config struct + DB | SQLite3 |
+
+---
+
+## Build & Run
+
+Dev shell via direnv (`use flake` in `.envrc`). Inside nix dev shell:
+
+```sh
+go build -o bin/rhemawave rhemawave.go # Build
+./bin/rhemawave # Run
+nix build -L # Nix build (CI)
+```
+
+CGO required (`CGO_ENABLED=1`). The nix shell sets `CGO_CFLAGS`/`CGO_LDFLAGS`
+for SDL2. Do not `go build` outside the nix shell.
+
+## Tests
+
+```sh
+go test ./internal/mixer/
+```
+
+CI runs `go test` then `nix build -L`.
+
+## Branch Model
+
+`dev` → `main` via PRs. CI in `.forgejo/workflows/`:
+- `build-dev.yml`: PRs to `dev`
+- `build-prod.yml`: PRs to `main`
+
+Both run `nix build -L` on self-hosted `neils-server-runner`.
+
+## Common Pitfalls
+
+- `dev_scripts/reset.sh` referenced in nix devShell hook does not exist.
+- `share/rhemawave/audio/*.wav` is gitignored — never commit audio assets.
+- `vendor/` is committed — run `go mod vendor` after `go mod tidy`.
+- CI uses a self-hosted Forgejo runner, not GitHub-hosted runners.
+- `packaging/` contains a kiosk-specific updater, not part of the main build.
diff --git a/archive/Dockerfile b/archive/Dockerfile
new file mode 100644
index 0000000..cd62b81
--- /dev/null
+++ b/archive/Dockerfile
@@ -0,0 +1,24 @@
+FROM ubuntu:24.04
+
+ENV DEBIAN_FRONTEND=noninteractive
+ENV USER=root
+ENV NIX_CONFIG="experimental-features = nix-command flakes"
+ENV PATH="/nix/var/nix/profiles/default/bin:${PATH}"
+
+RUN apt-get update && apt-get install -y \
+ curl \
+ xz-utils \
+ ca-certificates \
+ git \
+ build-essential \
+ pkg-config \
+ rsync \
+ && rm -rf /var/lib/apt/lists/*
+
+# Install Nix
+RUN curl -L https://nixos.org/nix/install | sh -s -- --daemon
+
+# Install Go
+RUN nix profile install nixpkgs#go
+
+WORKDIR /workspace
\ No newline at end of file
diff --git a/archive/README.org b/archive/README.org
new file mode 100644
index 0000000..c2a383d
--- /dev/null
+++ b/archive/README.org
@@ -0,0 +1,90 @@
+#+TITLE: Radiantwave & KioskConfig Development & Release Pipeline
+#+AUTHOR: Neil C.
+#+DATE: 2026-06-23
+#+OPTIONS: toc:nil num:nil
+#+TAGS: development nixos radiantwave kiosk automation
+
+* Radiant Wave
+
+* Full Pipeline Workflow (Detailed)
+
+** Development Phase
+1. Create a new branch for the issue
+2. Implement the changes for the issue
+
+** Integration to =dev=
+3. Open a pull request to =dev=
+4. CI: Run =nix build= to verify no errors
+5. CI: Run linting and unit tests
+6. CI: Auto-update =rhemawave-dev= flake input
+7. CI: Build all =dev= VMs in parallel (Kiosk, Commercial, RPi)
+8. Merge the pull request to =dev= after CI passes
+
+** Testing Phase
+9. Run all VMs (Kiosk, Commercial, RPi) and test all functionality of the application on each VM
+10. Install =dev-iso= to a test machine and verify installation and application functionality
+
+** Release to =main=
+11. Open a pull request from =dev= to =main=
+12. CI: Build all =main= VMs in parallel (Kiosk, Commercial, RPi)
+13. CI: Build all ISO images in parallel
+14. CI: Auto-rename ISO images to format =radiantwave-{system}-{YYYY-MM-DD}-{git-hash}.iso=
+15. CI: Upload ISO images to file server
+16. CI: Move old ISO images to =archives/= on file server
+17. Merge the pull request to =main= after CI passes
+18. Tag the release (optional, for traceability)
+
+* Automation Opportunities
+
+This section describes which parts of the workflow can be automated via CI/CD, and how.
+
+** Group 1: Development Validation (Steps 3-8)
+- =What to automate=: PR triggering, =nix build=, linting, unit tests, flake updates, dev VM builds
+- =How=: GitHub Actions workflow triggered on PR to =dev=
+- =Why=: Catch integration errors before manual testing; ensure =dev= is always buildable
+
+** Group 2: Testing (Steps 9-10)
+- =What to automate=: VM functionality testing, ISO installation verification
+- =How=: Scripted test suites, automated ISO installation in VMs
+- =Why=: Reduce manual toil; increase test coverage and consistency
+
+** Group 3: Release Pipeline (Steps 11-16)
+- =What to automate=: Main VM/ISO builds, ISO renaming, file server uploads, archiving
+- =How=: GitHub Actions workflow triggered on PR to =main=
+- =Why=: Ensure consistent releases; eliminate human error in naming/uploading
+
+* Preflight Checklist
+
+- [ ] Create a new branch for the issue
+- [ ] Implement the changes for the issue
+- [ ] Open a pull request to =dev=
+- [ ] Merge the pull request to =dev= after CI passes
+- [ ] Run all VMs (Kiosk, Commercial, RPi) and test all functionality of the application on each VM
+- [ ] Install =dev-iso= to a test machine and verify installation and application functionality
+- [ ] Open a pull request from =dev= to =main=
+- [ ] Merge the pull request to =main= after CI passes
+- [ ] Tag the release (optional, for traceability)
+
+* Automation Task List
+
+** Group 1: Development Validation
+- [ ] Set up GitHub Actions workflow for PRs to =dev=
+ - [ ] Configure =nix build= step
+ - [ ] Add linting and unit test steps
+ - [ ] Add flake auto-update step
+ - [ ] Configure parallel VM builds (Kiosk, Commercial, RPi)
+- [ ] Verify workflow blocks PR merge on failure
+
+** Group 2: Testing
+- [ ] Create automated test scripts for VM functionality
+- [ ] Set up automated ISO installation testing
+- [ ] Integrate with CI for optional automated testing
+
+** Group 3: Release Pipeline
+- [ ] Set up GitHub Actions workflow for PRs to =main=
+ - [ ] Configure parallel VM builds
+ - [ ] Configure parallel ISO builds
+ - [ ] Add ISO auto-renaming step (using =git rev-parse HEAD= and =date +%Y-%m-%d=)
+ - [ ] Add file server upload step (=rsync= or similar)
+ - [ ] Add archive old ISOs step
+- [ ] Verify workflow blocks PR merge on failure
\ No newline at end of file
diff --git a/archive/TestList.org b/archive/TestList.org
new file mode 100644
index 0000000..028c389
--- /dev/null
+++ b/archive/TestList.org
@@ -0,0 +1,19 @@
+* Virtual Machine Testing
+To be completed after updating rhemawave-dev, deleting nixos.qcow2, and building rhemawavekiosk-dev
+
+- [ ] Closure builds
+- [ ] VM Starts
+- [ ] RadiantWave starts
+- [ ] WiFi screen does NOT appear (no wifi nic in vm)
+- [ ] Email Address scren appears
+- [ ] I can type an email address
+- [ ] I cannot submit an incomplete email
+- [ ] I can submit a complete email
+- [ ] License Key screen appears
+- [ ] I can type a license key
+- [ ] I cannot submit an incomplete license
+- [ ] I can submit a complete license
+- [ ] Home screen appears
+- [ ] Version string is correct
+- [ ] Status: Downloading files
+-
diff --git a/archive/VMTestList.org b/archive/VMTestList.org
new file mode 100644
index 0000000..224817a
--- /dev/null
+++ b/archive/VMTestList.org
@@ -0,0 +1,44 @@
+- [X] Version string is correct
+- [X] Status shows READY or Downloading Assets
+- [X] Email address is present and correct
+- [X] License key is present and correct
+- [X] Settings menu opens
+- [X] Logs open
+- [X] No proprietary data is exposed in logs
+- [X] Logs are colored correctly
+- [X] WiFi Setup opens
+- [X] WiFi page shows "Something went wrong" because there are no WiFi nics available
+- [X] License key opens
+- [X] License key displays current license key
+- [X] Backspace deletes characters
+- [X] I can type in a new license key
+- [X] I can submit a license key
+- [X] License Key shows new license key
+- [X] I cannot submit an incomplete license key
+- [X] Email address opens
+- [X] Email addrss displays current email address
+- [X] Backspace deletes characters
+- [X] I can type a new email address
+- [X] I can submit an email address
+- [X] Email address shows new email address
+- [X] I cannot submit an invalid email address
+- [X] Audio opens
+- [X] I can toggle audio
+- [X] At least one audio device is listed
+- [X] Volume is at 100%
+- [X] I can change the volume
+- [X] Returning to the Audio page shows toggle and volume updated values
+- [X] Proclamation Browser opens
+- [X] Proclamation Browser is populated
+- [X] Space bar opens and closes categories
+- [X] Enter opens and closes categories
+- [X] Space toggles a proclamation
+- [X] Enter toggles a proclamation
+- [X] Typing characters starts a search
+- [X] I can search for Confidence and ADHD
+- [X] Enter during search toggles selection
+- [X] Space during search toggles selection
+- [X] Returning to the Proclamation browser shows my saved proclamations
+- [X] Scroller opens and starts playing
+- [X] Audio is playing
+- [X] Colors appear correct
diff --git a/archive/changelog.txt b/archive/changelog.txt
new file mode 100644
index 0000000..be91e9f
--- /dev/null
+++ b/archive/changelog.txt
@@ -0,0 +1,42 @@
+# Changelog
+
+All notable changes to this project will be documented in this file.
+
+The format is based on [Keep a Changelog](https://keepachangelog.com/).
+
+## [Unreleased]
+
+### Fixed
+
+### Changed (Major Refactors)
+- Mixer package: extract wpctl calls behind an interface
+
+## [07112026-1710]
+
+### Fixed
+- Play() deadlocks when called before device is open (recursive SwitchDevice -> Play)
+- Audio volume silently zeroed after switching output devices (Init used hardcoded 0.20; SwitchDevice did not restore saved volume)
+- SwitchDevice not persisted to database across restarts (caller now saves to AppConfig)
+- Device restore path passes invalid device name "system default" to SDL (now passes "" for default)
+- Stop() no-op when audio toggled off mid-playback (removed AudioEnabled guard from Stop)
+- App shows "READY" before audio files finish downloading (state machine now gates READY on download completion via DOWNLOADING_ASSETS state)
+- Download failure no longer silently allows READY (downloadFailed flag prevents premature READY)
+- App restarts repeatedly after downloads complete (checkState re-navigated to HOME, closing DownloadDone channel twice -> panic)
+- F2/F3 keybinds now work during DOWNLOADING_ASSETS (blocked only during early prerequisites: no wifi, no email, no license key)
+- Active device highlight incorrect when using default device (default device now maps to first SDL device)
+
+### Added
+- Human-readable audio device names (Built-in Speakers, HDMI/TV/Monitor)
+- Unit tests for mixer package (parseSinks, parseSinkLine, ConvertVolume)
+- Regression tests for state machine (download gating, failure handling, prerequisite priority, non-blocking channel read)
+- Regression tests for mixer (Stop with AudioEnabled=false, SwitchDevice edge cases)
+- Regression tests for Home page (double-close guard, download failure path)
+
+### Changed (Major Refactors)
+- Mixer package: inject audio backend dependencies for testability
+- SwitchDevice now takes *db.AppConfig to access saved volume
+- Audio files moved from ~/.local/share/rhemawave/audio to ~/.radiantwave/audio
+- State machine uses DOWNLOADING_ASSETS state before READY
+- checkState() skips re-navigation when transitioning between HOME-mapped states
+- network.init() logs warning instead of crashing when D-Bus is unavailable
+- CI now runs go test before nix build
diff --git a/archive/docker-compose.yaml b/archive/docker-compose.yaml
new file mode 100644
index 0000000..91b6d69
--- /dev/null
+++ b/archive/docker-compose.yaml
@@ -0,0 +1,22 @@
+services:
+ builder:
+ build: .
+ working_dir: /workspace
+ init: true
+
+ volumes:
+ - .:/workspace
+ - nix-store:/nix
+
+ command: >
+ bash -lc '
+ set -euo pipefail
+ rm -rf build
+ mkdir -p build
+ OUT=$$(nix build . --print-out-paths)
+ echo "Build output: $$OUT"
+ rsync -a --chmod=ugo=rwX --no-owner --no-group "$$OUT"/ build/
+ '
+
+volumes:
+ nix-store:
\ No newline at end of file
diff --git a/archive/flake.lock b/archive/flake.lock
new file mode 100644
index 0000000..20db77f
--- /dev/null
+++ b/archive/flake.lock
@@ -0,0 +1,61 @@
+{
+ "nodes": {
+ "flake-utils": {
+ "inputs": {
+ "systems": "systems"
+ },
+ "locked": {
+ "lastModified": 1731533236,
+ "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
+ "owner": "numtide",
+ "repo": "flake-utils",
+ "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
+ "type": "github"
+ },
+ "original": {
+ "owner": "numtide",
+ "repo": "flake-utils",
+ "type": "github"
+ }
+ },
+ "nixpkgs": {
+ "locked": {
+ "lastModified": 1776877367,
+ "narHash": "sha256-EHq1/OX139R1RvBzOJ0aMRT3xnWyqtHBRUBuO1gFzjI=",
+ "owner": "NixOS",
+ "repo": "nixpkgs",
+ "rev": "0726a0ecb6d4e08f6adced58726b95db924cef57",
+ "type": "github"
+ },
+ "original": {
+ "owner": "NixOS",
+ "ref": "nixos-unstable",
+ "repo": "nixpkgs",
+ "type": "github"
+ }
+ },
+ "root": {
+ "inputs": {
+ "flake-utils": "flake-utils",
+ "nixpkgs": "nixpkgs"
+ }
+ },
+ "systems": {
+ "locked": {
+ "lastModified": 1681028828,
+ "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
+ "owner": "nix-systems",
+ "repo": "default",
+ "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
+ "type": "github"
+ },
+ "original": {
+ "owner": "nix-systems",
+ "repo": "default",
+ "type": "github"
+ }
+ }
+ },
+ "root": "root",
+ "version": 7
+}
diff --git a/archive/flake.nix b/archive/flake.nix
new file mode 100644
index 0000000..3259b18
--- /dev/null
+++ b/archive/flake.nix
@@ -0,0 +1,116 @@
+{
+ description = "RhemaWave";
+
+ inputs = {
+ nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
+ flake-utils.url = "github:numtide/flake-utils";
+ };
+
+ outputs =
+ {
+ self,
+ nixpkgs,
+ flake-utils,
+ }:
+ nixpkgs.lib.recursiveUpdate
+ (flake-utils.lib.eachDefaultSystem (
+ system:
+ let
+ pkgs = import nixpkgs {
+ inherit system;
+ config.allowUnfreePredicate = pkg: (nixpkgs.lib.getName pkg) == "rhemawave";
+ };
+
+ buildInputs = with pkgs; [
+ SDL2
+ SDL2_ttf
+ SDL2_image
+ SDL2_mixer
+ libGL
+ sqlite
+ dbus
+ ] ++ pkgs.lib.optionals pkgs.stdenv.isLinux [
+ wayland
+ wayland-protocols
+ libxkbcommon
+ libdecor
+ libx11
+ libxext
+ ];
+
+ nativeBuildInputs = with pkgs; [
+ go
+ pkg-config
+ ];
+
+ in
+ {
+ packages.default = pkgs.buildGoModule {
+ pname = "rhemawave";
+ version = "v1.1.1";
+ src = ./.;
+
+ vendorHash = null;
+
+ inherit buildInputs nativeBuildInputs;
+
+ env.CGO_ENABLED = "1";
+
+ preBuild = ''
+ export CGO_CFLAGS="$(pkg-config --cflags SDL2_mixer SDL2_ttf SDL2_image) $CGO_CFLAGS"
+ export CGO_LDFLAGS="$(pkg-config --libs SDL2_mixer SDL2_ttf SDL2_image) $CGO_LDFLAGS"
+ '';
+
+ ldflags = [
+ "-s"
+ "-w"
+ ];
+
+ postInstall = ''
+ mkdir -p $out/share/rhemawave
+ cp -r share/rhemawave/* $out/share/rhemawave/
+ '';
+
+ meta = with pkgs.lib; {
+ description = "RhemaWave kiosk application";
+ license = licenses.unfree;
+ platforms = platforms.linux;
+ };
+ };
+
+ devShells.default = pkgs.mkShell {
+ inherit buildInputs nativeBuildInputs;
+
+ shellHook = ''
+ export OLD_PS1="$PS1"
+ export PS1="[nix-env] $OLD_PS1"
+
+ export CGO_CFLAGS="$(pkg-config --cflags SDL2_mixer SDL2_ttf SDL2_image) $CGO_CFLAGS"
+ export CGO_LDFLAGS="$(pkg-config --libs SDL2_mixer SDL2_ttf SDL2_image) $CGO_LDFLAGS"
+
+ echo "RhemaWave dev shell"
+ echo " go version: $(go version)"
+ echo " CGO_ENABLED=1"
+ echo ""
+ echo "Build: go build -o bin/rhemawave rhemawave.go"
+ echo "Run: ./bin/rhemawave"
+ '';
+ };
+ }
+ ))
+ {
+ nixosModules.default = import ./nixos/module.nix self;
+
+ nixosConfigurations.test-vm = nixpkgs.lib.nixosSystem {
+ system = "x86_64-linux";
+ modules = [
+ "${nixpkgs}/nixos/modules/virtualisation/qemu-vm.nix"
+ self.nixosModules.default
+ ./nixos/vm.nix
+ ];
+ };
+
+ packages.x86_64-linux.test-vm =
+ self.nixosConfigurations.test-vm.config.system.build.vm;
+ };
+}
diff --git a/archive/go.mod b/archive/go.mod
new file mode 100644
index 0000000..b6f03a6
--- /dev/null
+++ b/archive/go.mod
@@ -0,0 +1,27 @@
+module rhemawavetech.com/rhemawave
+
+go 1.24.0
+
+toolchain go1.24.2
+
+require github.com/veandco/go-sdl2 v0.4.40
+
+require github.com/go-gl/mathgl v1.2.0
+
+require github.com/go-gl/gl v0.0.0-20231021071112-07e5d0ea2e71
+
+require (
+ github.com/Wifx/gonetworkmanager/v2 v2.2.0
+ github.com/google/uuid v1.3.0
+)
+
+require github.com/godbus/dbus/v5 v5.1.0 // indirect
+
+require (
+ github.com/jinzhu/inflection v1.0.0 // indirect
+ github.com/jinzhu/now v1.1.5 // indirect
+ github.com/mattn/go-sqlite3 v1.14.32 // indirect
+ golang.org/x/text v0.31.0 // indirect
+ gorm.io/driver/sqlite v1.6.0
+ gorm.io/gorm v1.31.1
+)
diff --git a/archive/go.sum b/archive/go.sum
new file mode 100644
index 0000000..ca95aae
--- /dev/null
+++ b/archive/go.sum
@@ -0,0 +1,24 @@
+github.com/Wifx/gonetworkmanager/v2 v2.2.0 h1:kPstgsQtY8CmDOOFZd81ytM9Gi3f6ImzPCKF7nNhQ2U=
+github.com/Wifx/gonetworkmanager/v2 v2.2.0/go.mod h1:fMDb//SHsKWxyDUAwXvCqurV3npbIyyaQWenGpZ/uXg=
+github.com/go-gl/gl v0.0.0-20231021071112-07e5d0ea2e71 h1:5BVwOaUSBTlVZowGO6VZGw2H/zl9nrd3eCZfYV+NfQA=
+github.com/go-gl/gl v0.0.0-20231021071112-07e5d0ea2e71/go.mod h1:9YTyiznxEY1fVinfM7RvRcjRHbw2xLBJ3AAGIT0I4Nw=
+github.com/go-gl/mathgl v1.2.0 h1:v2eOj/y1B2afDxF6URV1qCYmo1KW08lAMtTbOn3KXCY=
+github.com/go-gl/mathgl v1.2.0/go.mod h1:pf9+b5J3LFP7iZ4XXaVzZrCle0Q/vNpB/vDe5+3ulRE=
+github.com/godbus/dbus/v5 v5.1.0 h1:4KLkAxT3aOY8Li4FRJe/KvhoNFFxo0m6fNuFUO8QJUk=
+github.com/godbus/dbus/v5 v5.1.0/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
+github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
+github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
+github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E=
+github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc=
+github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ=
+github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
+github.com/mattn/go-sqlite3 v1.14.32 h1:JD12Ag3oLy1zQA+BNn74xRgaBbdhbNIDYvQUEuuErjs=
+github.com/mattn/go-sqlite3 v1.14.32/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y=
+github.com/veandco/go-sdl2 v0.4.40 h1:fZv6wC3zz1Xt167P09gazawnpa0KY5LM7JAvKpX9d/U=
+github.com/veandco/go-sdl2 v0.4.40/go.mod h1:OROqMhHD43nT4/i9crJukyVecjPNYYuCofep6SNiAjY=
+golang.org/x/text v0.31.0 h1:aC8ghyu4JhP8VojJ2lEHBnochRno1sgL6nEi9WGFGMM=
+golang.org/x/text v0.31.0/go.mod h1:tKRAlv61yKIjGGHX/4tP1LTbc13YSec1pxVEWXzfoeM=
+gorm.io/driver/sqlite v1.6.0 h1:WHRRrIiulaPiPFmDcod6prc4l2VGVWHz80KspNsxSfQ=
+gorm.io/driver/sqlite v1.6.0/go.mod h1:AO9V1qIQddBESngQUKWL9yoH93HIeA1X6V633rBwyT8=
+gorm.io/gorm v1.31.1 h1:7CA8FTFz/gRfgqgpeKIBcervUn3xSyPUmr6B2WXJ7kg=
+gorm.io/gorm v1.31.1/go.mod h1:XyQVbO2k6YkOis7C2437jSit3SsDK72s7n7rsSHd+Gs=
diff --git a/archive/internal/application/application.go b/archive/internal/application/application.go
new file mode 100644
index 0000000..3610781
--- /dev/null
+++ b/archive/internal/application/application.go
@@ -0,0 +1,548 @@
+package application
+
+import (
+ "errors"
+ "os"
+ "path/filepath"
+ "time"
+
+ "github.com/go-gl/gl/v3.3-core/gl"
+ "github.com/veandco/go-sdl2/sdl"
+ "github.com/veandco/go-sdl2/ttf"
+ "gorm.io/gorm"
+ "rhemawavetech.com/rhemawave/internal/db"
+ "rhemawavetech.com/rhemawave/internal/download"
+ "rhemawavetech.com/rhemawave/internal/fontManager"
+ "rhemawavetech.com/rhemawave/internal/graphics"
+ "rhemawavetech.com/rhemawave/internal/keybinds"
+ "rhemawavetech.com/rhemawave/internal/license"
+ "rhemawavetech.com/rhemawave/internal/logger"
+ "rhemawavetech.com/rhemawave/internal/mixer"
+ "rhemawavetech.com/rhemawave/internal/network"
+ "rhemawavetech.com/rhemawave/internal/page"
+ "rhemawavetech.com/rhemawave/internal/shaderManager"
+ "rhemawavetech.com/rhemawave/internal/sync"
+)
+
+const (
+ targetFPS = 60.0
+ openGLMajorVersion = 3
+ openGLMinorVersion = 3
+ // volumeStepSize = 16
+ // apiURL = "https://portal.rhemawavetech.com/api/v1"
+)
+
+type State int
+
+const (
+ FIRST_RUN State = iota
+ NEEDS_INTERNET
+ NEEDS_LICENSE_KEY
+ NEEDS_EMAIL_ADDRESS
+ DOWNLOADING_ASSETS
+ READY
+)
+
+type Application struct {
+ Window *sdl.Window
+ License *license.Response
+ pageStack []page.Page
+ pendingAction func()
+ running bool
+ DB *gorm.DB
+ PageRouter *page.Router
+ state State
+ downloadsComplete bool
+ downloadFailed bool
+}
+
+var lastNetworkCheckTime time.Time
+var networkIsUp bool
+
+// ----------------------------------------------------------------------------
+// Main Entry Point
+// ----------------------------------------------------------------------------
+
+func Run() {
+ var err error
+ var homeDir string
+ var dataDir string
+ var DB *gorm.DB
+
+ networkIsUp = false
+
+ logger.Info("Starting Application")
+
+ homeDir, err = os.UserHomeDir()
+ if err != nil {
+ logger.Error("unable to fetch user $HOME directory: %v", err)
+ return
+ }
+
+ dataDir = filepath.Join(homeDir, ".local", "share", "rhemawave")
+ if err := os.MkdirAll(dataDir, 0755); err != nil {
+ logger.Error("unable to create data directory %s %v", dataDir, err)
+ return
+ }
+
+ testFile := filepath.Join(dataDir, ".access_test")
+ f, err := os.Create(testFile)
+ if err != nil {
+ logger.Error("data %s is not writeable: %v", dataDir, err)
+ return
+ }
+ f.Close()
+ os.Remove(testFile)
+
+ logger.AddFile(filepath.Join(dataDir, "log.txt"))
+ logger.SetLevel = logger.LevelInfo
+
+ DB, err = db.Connect(filepath.Join(dataDir, "database.sqlite"))
+ if err != nil {
+ logger.Error("application failed to connect to the database: %v", err)
+ return
+ }
+
+ if err = db.Migrate(DB); err != nil {
+ logger.Error("application failed to perform database migrations: %v", err)
+ return
+ }
+
+ firstRun := false
+
+ // Populate the initial Config cache OR create defaults
+ cfg, err := db.GetConfig(DB)
+ if err != nil {
+ if errors.Is(err, gorm.ErrRecordNotFound) {
+ firstRun = true
+ cfg = &db.AppConfig{
+ Model: gorm.Model{ID: 1},
+ DataDir: dataDir,
+ AssetsDir: dataDir,
+ SystemLevel: "BASIC",
+ SelectedAudioDevice: "default",
+ InitialFontSize: 128,
+ StandardFontSize: 32,
+ LinePattern: "fibonacci",
+ AudioEnabled: true,
+ SavedVolume: 1.0,
+ }
+
+ if err := DB.Create(cfg).Error; err != nil {
+ logger.Error("failed to create config: %v", err)
+ return
+ }
+ }
+ }
+
+ logger.AddDatabase(DB)
+
+ app := &Application{
+ DB: DB,
+ }
+
+ logger.Debug("==== Debug Statement ====")
+
+ if firstRun {
+ app.state = FIRST_RUN
+ }
+
+ w, h := app.initializeSDLAndOpenGL()
+ defer app.cleanup()
+
+ app.initializeManagers()
+ app.initializeAudio()
+ // Create a buffered channel so log writes don't slow down downloads.
+ downloadProgressChan := make(chan download.DownloadStatus, 1000)
+ downloadDone := make(chan struct{})
+
+ app.PageRouter = page.NewRouter(page.PageCtx{
+ DbPtr: app.DB,
+ W: w,
+ H: h,
+ MessageChannel: downloadProgressChan,
+ DownloadDone: downloadDone,
+ })
+
+ // Sync the proclamations from the API to the Database
+ sync.SyncProclamations(DB)
+ sync.SyncCategories(DB)
+ sync.SyncFrequencies(DB)
+
+ // audioFileNames := []string{
+ // "OriginalAudio.wav",
+ // "174Hz.wav",
+ // "396Hz.wav",
+ // "417Hz.wav",
+ // "432Hz.wav",
+ // "639Hz.wav",
+ // "741Hz.wav",
+ // "852Hz.wav",
+ // "963Hz.wav",
+ // "1111Hz.wav",
+ // "14Hz_Binaural.wav",
+ // "40Hz_Binaural.wav",
+ // "AlphaWaves.wav",
+ // "PinealGland.wav",
+ // }
+
+ audioDir := filepath.Join(homeDir, ".radiantwave", "audio")
+
+ _, err = os.Stat(audioDir)
+ if os.IsNotExist(err) {
+ if err = os.MkdirAll(audioDir, 0755); err != nil {
+ logger.Error("unable to create audio directory: %v", err)
+ }
+ }
+
+ go download.DownloadAudioFiles(app.PageRouter.Context.MessageChannel, audioDir, "https://files.radiantwavetech.com/audio/")
+
+ app.runEventLoop()
+}
+
+// computeState determines what state the application should be in based on
+// current conditions, without performing any navigation. It returns the first
+// unmet prerequisite in priority order: network > email > license > downloads > ready.
+func (app *Application) computeState() State {
+ if app.state == READY {
+ return READY
+ }
+
+ // Check if downloads have finished (non-blocking)
+ if !app.downloadsComplete {
+ select {
+ case <-app.PageRouter.Context.DownloadDone:
+ app.downloadsComplete = true
+ default:
+ }
+ }
+
+ // Check if there is an internet connection
+ if !networkIsUp {
+ if lastNetworkCheckTime.IsZero() || time.Since(lastNetworkCheckTime) >= time.Second {
+ lastNetworkCheckTime = time.Now()
+ if !network.HasInternet() {
+ return NEEDS_INTERNET
+ }
+ networkIsUp = true // internet confirmed, don't check again
+ } else {
+ return app.state // throttled, can't determine yet
+ }
+ }
+
+ // Check for email address
+ config, err := db.GetConfig(app.DB)
+ if err != nil {
+ panic(err)
+ }
+
+ // A rather annoying, insecure, but sometimes necessary "print the config" statement
+ // data, err := json.MarshalIndent(config, "", " ")
+ // if err != nil {
+ // logger.Error("failed to marshal config: %v", err)
+ // } else {
+ // logger.Debug("AppConfig: %s", data)
+ // }
+
+ if config.EmailAddress == "" {
+ return NEEDS_EMAIL_ADDRESS
+ }
+
+ // Check for license key
+ config, err = db.GetConfig(app.DB)
+ if err != nil {
+ panic(err)
+ }
+ if config.LicenseKey == "" {
+ return NEEDS_LICENSE_KEY
+ }
+
+ // All config prerequisites met -- now wait for downloads to finish
+ if !app.downloadsComplete {
+ return DOWNLOADING_ASSETS
+ }
+
+ return READY
+}
+
+// checkState keeps watch of the application state and sets pages
+// accordingly. This function runs once per frame.
+func (app *Application) checkState() {
+ newState := app.computeState()
+
+ if newState == app.state {
+ return
+ }
+
+ oldState := app.state
+ app.state = newState
+
+ // Both DOWNLOADING_ASSETS and READY map to the HOME page.
+ // Skip re-navigation when transitioning between them to avoid
+ // destroying and recreating the Home page (which would close
+ // the already-closed DownloadDone channel).
+ oldIsHome := oldState == DOWNLOADING_ASSETS || oldState == READY
+ newIsHome := newState == DOWNLOADING_ASSETS || newState == READY
+ if oldIsHome && newIsHome {
+ return
+ }
+
+ switch newState {
+ case NEEDS_INTERNET:
+ app.PageRouter.NavigateTo(page.WIFI)
+ case NEEDS_EMAIL_ADDRESS:
+ logger.Warning("No email address detected")
+ app.PageRouter.NavigateTo(page.EMAIL_ADDRESS)
+ case NEEDS_LICENSE_KEY:
+ app.PageRouter.NavigateTo(page.LICENSE_KEY)
+ case DOWNLOADING_ASSETS, READY:
+ app.PageRouter.NavigateTo(page.HOME)
+ }
+}
+
+func (app *Application) initializeSDLAndOpenGL() (W, H int32) {
+ logger.Info("Initializing SDL")
+ if err := sdl.Init(sdl.INIT_VIDEO | sdl.INIT_AUDIO); err != nil {
+ logger.Fatal("SDL init failed: %v", err)
+ }
+
+ logger.Info("Initializing TTF")
+ if err := ttf.Init(); err != nil {
+ logger.Fatal("TTF init failed: %v", err)
+ }
+
+ sdl.GLSetAttribute(sdl.GL_CONTEXT_MAJOR_VERSION, openGLMajorVersion)
+ sdl.GLSetAttribute(sdl.GL_CONTEXT_MINOR_VERSION, openGLMinorVersion)
+ sdl.GLSetAttribute(sdl.GL_CONTEXT_PROFILE_MASK, sdl.GL_CONTEXT_PROFILE_CORE)
+ sdl.ShowCursor(sdl.DISABLE)
+ sdl.SetRelativeMouseMode(true)
+
+ logger.Info("Querying display mode")
+ displayMode, err := sdl.GetDisplayMode(0, 0)
+ if err != nil {
+ logger.Fatal("Display mode query failed: %v", err)
+ }
+ if displayMode.W == 0 || displayMode.H == 0 {
+ logger.Fatal("Invalid display dimensions: %dx%d", displayMode.W, displayMode.H)
+ }
+ logger.Info("Display: %dx%d @ %dHz", displayMode.W, displayMode.H, displayMode.RefreshRate)
+
+ logger.Info("Creating window")
+ window, err := sdl.CreateWindow(
+ "Rhema Wave",
+ sdl.WINDOWPOS_UNDEFINED,
+ sdl.WINDOWPOS_UNDEFINED,
+ displayMode.W,
+ displayMode.H,
+ sdl.WINDOW_OPENGL|sdl.WINDOW_FULLSCREEN_DESKTOP|sdl.WINDOW_SHOWN,
+ )
+ if err != nil {
+ logger.Fatal("Window creation failed: %v", err)
+ }
+ app.Window = window
+
+ logger.Info("Creating OpenGL context")
+ if _, err := app.Window.GLCreateContext(); err != nil {
+ logger.Fatal("OpenGL context creation failed: %v", err)
+ }
+
+ logger.Info("Initializing go-gl")
+ if err := gl.InitWithProcAddrFunc(sdl.GLGetProcAddress); err != nil {
+ logger.Fatal("go-gl initialization failed: %v", err)
+ }
+
+ logger.Info("OpenGL version: %s", gl.GoStr(gl.GetString(gl.VERSION)))
+ logger.Info("OpenGL renderer: %s", gl.GoStr(gl.GetString(gl.RENDERER)))
+
+ if err := sdl.GLSetSwapInterval(1); err != nil {
+ logger.Warning("Failed to enable vsync: %v", err)
+ }
+
+ w, h := app.Window.GLGetDrawableSize()
+ logger.Info("Drawable size: %dx%d", w, h)
+
+ logger.Info("Initializing virtual framebuffer (%dx%d -> %dx%d)",
+ graphics.VirtualWidth, graphics.VirtualHeight, w, h)
+ if err := graphics.InitVirtualFramebuffer(w, h); err != nil {
+ logger.Fatal("Virtual framebuffer init failed: %v", err)
+ }
+
+ app.initKeybinds()
+ logger.Info("SDL and OpenGL initialization complete")
+ return graphics.VirtualWidth, graphics.VirtualHeight
+}
+
+func (app *Application) initializeManagers() {
+ logger.Info("Initializing ShaderManager")
+ config, err := db.GetConfig(app.DB)
+ if err != nil {
+ panic(err)
+ }
+ shaderDir := filepath.Join(config.AssetsDir, "shaders")
+ logger.Info("Loading shaders from %s", shaderDir)
+ if err := shaderManager.InitShaderManager(shaderDir); err != nil {
+ logger.Fatal("ShaderManager initialization failed: %v", err)
+ }
+
+ logger.Info("Initializing FontManager")
+ if err := fontManager.InitFontManager(config); err != nil {
+ logger.Fatal("FontManager initialization failed: %v", err)
+ }
+}
+
+func (app *Application) initializeAudio() {
+ logger.Info("Initializing audio")
+ config, err := db.GetConfig(app.DB)
+ if err != nil {
+ panic(err)
+ }
+ if err := mixer.Init(config, app.refreshCache); err != nil {
+ logger.Error("Unable to initialize audio device '%s': %v", config.SelectedAudioDevice, err)
+ logger.Error("Audio will be unavailable until a device is configured")
+ } else {
+ logger.Info("Audio initialized with device: '%s'", config.SelectedAudioDevice)
+ }
+}
+
+func (app *Application) refreshCache() {}
+
+func (app *Application) cleanup() {
+ logger.Info("Cleaning up")
+
+ if app.PageRouter != nil && app.PageRouter.ActivePage != nil {
+ app.PageRouter.ActivePage.Destroy()
+ }
+
+ graphics.DestroyVirtualFramebuffer()
+
+ if app.Window != nil {
+ app.Window.Destroy()
+ }
+
+ ttf.Quit()
+ sdl.Quit()
+ logger.Info("Cleanup complete")
+ logger.Close()
+}
+
+// ----------------------------------------------------------------------------
+// Event Loop
+// ----------------------------------------------------------------------------
+
+func (app *Application) runEventLoop() {
+ if app.PageRouter == nil || app.PageRouter.ActivePage == nil {
+ logger.Fatal("No initial page loaded, Router is empty")
+ }
+ const frameDelay = time.Second / targetFPS
+ app.running = true
+ lastTime := time.Now()
+ logger.Info("Entering event loop")
+
+ for app.running {
+ frameStart := time.Now()
+
+ app.checkState()
+ app.handleEvents()
+ if !app.running {
+ break
+ }
+
+ deltaTime := float32(time.Since(lastTime).Seconds())
+ lastTime = time.Now()
+
+ app.updateCurrentPage(deltaTime)
+ app.renderFrame()
+
+ frameTime := time.Since(frameStart)
+ if frameTime < frameDelay {
+ time.Sleep(frameDelay - frameTime)
+ }
+ }
+
+ logger.Info("Event loop exited")
+}
+
+func (app *Application) handleEvents() {
+ for event := sdl.PollEvent(); event != nil; event = sdl.PollEvent() {
+ switch e := event.(type) {
+ case *sdl.QuitEvent:
+ app.running = false
+ return
+
+ case *sdl.KeyboardEvent:
+ if e.Type == sdl.KEYDOWN && e.Repeat == 0 {
+ isCtrlPressed := (e.Keysym.Mod&sdl.KMOD_CTRL) != 0 || (e.Keysym.Mod&sdl.KMOD_GUI) != 0
+ if e.Keysym.Sym == sdl.K_c && isCtrlPressed {
+ continue
+ }
+ keybinds.PerformAction(e)
+ }
+ }
+
+ if currentPage := app.PageRouter.ActivePage; currentPage != nil {
+ if err := currentPage.HandleEvent(&event); err != nil {
+ logger.Error("Page event handler error: %v", err)
+ }
+ }
+ }
+}
+
+func (app *Application) updateCurrentPage(deltaTime float32) {
+ if currentPage := app.PageRouter.ActivePage; currentPage != nil {
+ currentPage.Update(deltaTime)
+ }
+}
+
+func (app *Application) renderFrame() {
+ graphics.BeginVirtualRender()
+ gl.ClearColor(0.0, 0.0, 0.0, 1.0)
+ gl.Clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT)
+
+ if currentPage := app.PageRouter.ActivePage; currentPage != nil {
+ currentPage.Render()
+ }
+
+ graphics.BlitToScreen()
+ app.Window.GLSwap()
+}
+
+// ----------------------------------------------------------------------------
+// Keybind Registration
+// ----------------------------------------------------------------------------
+
+func (app *Application) initKeybinds() {
+ keybinds.Register(sdl.K_F3, sdl.KMOD_NONE, func() {
+ if app.state != READY && app.state != DOWNLOADING_ASSETS {
+ return
+ }
+ app.PageRouter.NavigateTo(page.SETTINGS)
+ })
+
+ keybinds.Register(sdl.K_F2, sdl.KMOD_NONE, func() {
+ if app.state != READY && app.state != DOWNLOADING_ASSETS {
+ return
+ }
+ app.PageRouter.NavigateTo(page.SCROLLER)
+ })
+
+ keybinds.Register(sdl.K_F1, sdl.KMOD_NONE, func() {
+ if app.state != READY && app.state != DOWNLOADING_ASSETS {
+ return
+ }
+ app.PageRouter.NavigateTo(page.HOME)
+
+ })
+
+ keybinds.Register(sdl.K_q, sdl.KMOD_RCTRL, func() {
+ app.Stop()
+ })
+}
+
+func (app *Application) Stop() {
+ app.running = false
+}
+
+func (app *Application) Quit() {
+ logger.Info("User has quit the application")
+ app.running = false
+}
diff --git a/archive/internal/application/application_test.go b/archive/internal/application/application_test.go
new file mode 100644
index 0000000..a467f61
--- /dev/null
+++ b/archive/internal/application/application_test.go
@@ -0,0 +1,475 @@
+package application
+
+import (
+ "testing"
+ "time"
+
+ "gorm.io/gorm"
+ "rhemawavetech.com/rhemawave/internal/db"
+ "rhemawavetech.com/rhemawave/internal/page"
+)
+
+// Regression: The app used to reach READY before audio downloads completed,
+// showing "Status: READY" while "0 / 14 Files Downloaded" was still in progress.
+// The fix gates READY on downloadsComplete being true.
+
+// TestStateTransitionsToDownloadingAssets verifies that when all config
+// prerequisites are met but downloads are not complete, the state transitions
+// to DOWNLOADING_ASSETS instead of READY.
+func TestStateTransitionsToDownloadingAssets(t *testing.T) {
+ app := &Application{
+ state: FIRST_RUN,
+ DB: setupTestDB(t),
+ }
+
+ networkIsUp = true
+ config, err := db.GetConfig(app.DB)
+ if err != nil {
+ t.Fatal(err)
+ }
+ config.EmailAddress = "test@example.com"
+ config.LicenseKey = "test-key-123"
+ app.DB.Save(config)
+
+ app.downloadsComplete = false
+
+ downloadDone := make(chan struct{})
+ app.PageRouter = &page.Router{
+ Context: page.PageCtx{
+ DbPtr: app.DB,
+ DownloadDone: downloadDone,
+ },
+ }
+
+ result := app.computeState()
+
+ if result != DOWNLOADING_ASSETS {
+ t.Errorf("state = %v, want DOWNLOADING_ASSETS (downloads not complete)", result)
+ }
+}
+
+// TestStateTransitionsToReadyWhenDownloadsComplete verifies that the state
+// transitions to READY only after downloads are complete.
+func TestStateTransitionsToReadyWhenDownloadsComplete(t *testing.T) {
+ app := &Application{
+ state: FIRST_RUN,
+ DB: setupTestDB(t),
+ }
+
+ networkIsUp = true
+ config, err := db.GetConfig(app.DB)
+ if err != nil {
+ t.Fatal(err)
+ }
+ config.EmailAddress = "test@example.com"
+ config.LicenseKey = "test-key-123"
+ app.DB.Save(config)
+
+ app.downloadsComplete = true
+
+ downloadDone := make(chan struct{})
+ app.PageRouter = &page.Router{
+ Context: page.PageCtx{
+ DbPtr: app.DB,
+ DownloadDone: downloadDone,
+ },
+ }
+
+ result := app.computeState()
+
+ if result != READY {
+ t.Errorf("state = %v, want READY", result)
+ }
+}
+
+// Regression: Download failure should prevent the app from reaching READY.
+// If downloads fail, the user sees an error and must restart to retry.
+func TestDownloadFailurePreventsReady(t *testing.T) {
+ app := &Application{
+ state: FIRST_RUN,
+ DB: setupTestDB(t),
+ }
+
+ networkIsUp = true
+ config, err := db.GetConfig(app.DB)
+ if err != nil {
+ t.Fatal(err)
+ }
+ config.EmailAddress = "test@example.com"
+ config.LicenseKey = "test-key-123"
+ app.DB.Save(config)
+
+ app.downloadsComplete = false
+ app.downloadFailed = true
+
+ downloadDone := make(chan struct{})
+ app.PageRouter = &page.Router{
+ Context: page.PageCtx{
+ DbPtr: app.DB,
+ DownloadDone: downloadDone,
+ },
+ }
+
+ result := app.computeState()
+
+ if result == READY {
+ t.Error("state should not be READY when download has failed")
+ }
+}
+
+// TestStateStaysReadyOnceSet verifies that once the state reaches READY,
+// computeState() returns READY without checking other prerequisites.
+func TestStateStaysReadyOnceSet(t *testing.T) {
+ app := &Application{
+ state: READY,
+ DB: setupTestDB(t),
+ }
+
+ downloadDone := make(chan struct{})
+ app.PageRouter = &page.Router{
+ Context: page.PageCtx{
+ DbPtr: app.DB,
+ DownloadDone: downloadDone,
+ },
+ }
+
+ result := app.computeState()
+
+ if result != READY {
+ t.Errorf("state = %v, want READY (should not change once set)", result)
+ }
+}
+
+// TestEmailMissingPreventsReady verifies that missing email blocks progress
+// even when network is up and downloads are complete.
+func TestEmailMissingPreventsReady(t *testing.T) {
+ app := &Application{
+ state: FIRST_RUN,
+ DB: setupTestDB(t),
+ }
+
+ networkIsUp = true
+ config, err := db.GetConfig(app.DB)
+ if err != nil {
+ t.Fatal(err)
+ }
+ config.EmailAddress = ""
+ config.LicenseKey = "test-key-123"
+ app.DB.Save(config)
+
+ app.downloadsComplete = true
+
+ downloadDone := make(chan struct{})
+ app.PageRouter = &page.Router{
+ Context: page.PageCtx{
+ DbPtr: app.DB,
+ DownloadDone: downloadDone,
+ },
+ }
+
+ result := app.computeState()
+
+ if result != NEEDS_EMAIL_ADDRESS {
+ t.Errorf("state = %v, want NEEDS_EMAIL_ADDRESS", result)
+ }
+}
+
+// TestLicenseMissingPreventsReady verifies that missing license key blocks
+// progress even when email and network are present.
+func TestLicenseMissingPreventsReady(t *testing.T) {
+ app := &Application{
+ state: FIRST_RUN,
+ DB: setupTestDB(t),
+ }
+
+ networkIsUp = true
+ config, err := db.GetConfig(app.DB)
+ if err != nil {
+ t.Fatal(err)
+ }
+ config.EmailAddress = "test@example.com"
+ config.LicenseKey = ""
+ app.DB.Save(config)
+
+ app.downloadsComplete = true
+
+ downloadDone := make(chan struct{})
+ app.PageRouter = &page.Router{
+ Context: page.PageCtx{
+ DbPtr: app.DB,
+ DownloadDone: downloadDone,
+ },
+ }
+
+ result := app.computeState()
+
+ if result != NEEDS_LICENSE_KEY {
+ t.Errorf("state = %v, want NEEDS_LICENSE_KEY", result)
+ }
+}
+
+// TestDownloadDoneChannelSetsDownloadsComplete verifies that receiving on
+// the DownloadDone channel sets downloadsComplete to true.
+func TestDownloadDoneChannelSetsDownloadsComplete(t *testing.T) {
+ app := &Application{
+ state: FIRST_RUN,
+ DB: setupTestDB(t),
+ }
+
+ networkIsUp = true
+ config, err := db.GetConfig(app.DB)
+ if err != nil {
+ t.Fatal(err)
+ }
+ config.EmailAddress = "test@example.com"
+ config.LicenseKey = "test-key-123"
+ app.DB.Save(config)
+
+ app.downloadsComplete = false
+
+ downloadDone := make(chan struct{})
+ close(downloadDone)
+ app.PageRouter = &page.Router{
+ Context: page.PageCtx{
+ DbPtr: app.DB,
+ DownloadDone: downloadDone,
+ },
+ }
+
+ result := app.computeState()
+
+ if !app.downloadsComplete {
+ t.Error("downloadsComplete should be true after DownloadDone channel is closed")
+ }
+ if result != READY {
+ t.Errorf("state = %v, want READY after downloads complete", result)
+ }
+}
+
+// TestPrerequisitePriorityEmailBeforeLicense verifies that missing email
+// is reported before missing license key, even when both are absent.
+func TestPrerequisitePriorityEmailBeforeLicense(t *testing.T) {
+ app := &Application{
+ state: FIRST_RUN,
+ DB: setupTestDB(t),
+ }
+
+ networkIsUp = true
+ config, err := db.GetConfig(app.DB)
+ if err != nil {
+ t.Fatal(err)
+ }
+ config.EmailAddress = ""
+ config.LicenseKey = ""
+ app.DB.Save(config)
+
+ app.downloadsComplete = true
+
+ downloadDone := make(chan struct{})
+ app.PageRouter = &page.Router{
+ Context: page.PageCtx{
+ DbPtr: app.DB,
+ DownloadDone: downloadDone,
+ },
+ }
+
+ result := app.computeState()
+
+ if result != NEEDS_EMAIL_ADDRESS {
+ t.Errorf("state = %v, want NEEDS_EMAIL_ADDRESS (email should be checked before license)", result)
+ }
+}
+
+// TestPrerequisitePriorityLicenseAfterEmail verifies that when email is
+// present but license is missing, the state is NEEDS_LICENSE_KEY.
+func TestPrerequisitePriorityLicenseAfterEmail(t *testing.T) {
+ app := &Application{
+ state: FIRST_RUN,
+ DB: setupTestDB(t),
+ }
+
+ networkIsUp = true
+ config, err := db.GetConfig(app.DB)
+ if err != nil {
+ t.Fatal(err)
+ }
+ config.EmailAddress = "test@example.com"
+ config.LicenseKey = ""
+ app.DB.Save(config)
+
+ app.downloadsComplete = true
+
+ downloadDone := make(chan struct{})
+ app.PageRouter = &page.Router{
+ Context: page.PageCtx{
+ DbPtr: app.DB,
+ DownloadDone: downloadDone,
+ },
+ }
+
+ result := app.computeState()
+
+ if result != NEEDS_LICENSE_KEY {
+ t.Errorf("state = %v, want NEEDS_LICENSE_KEY", result)
+ }
+}
+
+// TestStateBlocksOnDownloadUntilChannelClosed verifies that computeState
+// returns DOWNLOADING_ASSETS repeatedly until DownloadDone is closed.
+func TestStateBlocksOnDownloadUntilChannelClosed(t *testing.T) {
+ app := &Application{
+ state: FIRST_RUN,
+ DB: setupTestDB(t),
+ }
+
+ networkIsUp = true
+ config, err := db.GetConfig(app.DB)
+ if err != nil {
+ t.Fatal(err)
+ }
+ config.EmailAddress = "test@example.com"
+ config.LicenseKey = "test-key-123"
+ app.DB.Save(config)
+
+ app.downloadsComplete = false
+
+ downloadDone := make(chan struct{})
+ app.PageRouter = &page.Router{
+ Context: page.PageCtx{
+ DbPtr: app.DB,
+ DownloadDone: downloadDone,
+ },
+ }
+
+ // Should return DOWNLOADING_ASSETS multiple times before channel closes.
+ for i := 0; i < 5; i++ {
+ result := app.computeState()
+ if result != DOWNLOADING_ASSETS {
+ t.Fatalf("iteration %d: state = %v, want DOWNLOADING_ASSETS", i, result)
+ }
+ }
+
+ // Now close the channel.
+ close(downloadDone)
+
+ result := app.computeState()
+ if result != READY {
+ t.Errorf("after close: state = %v, want READY", result)
+ }
+}
+
+// TestDownloadDoneNonBlocking verifies that computeState does not block
+// when DownloadDone channel is open (non-blocking select).
+func TestDownloadDoneNonBlocking(t *testing.T) {
+ app := &Application{
+ state: FIRST_RUN,
+ DB: setupTestDB(t),
+ }
+
+ networkIsUp = true
+ config, err := db.GetConfig(app.DB)
+ if err != nil {
+ t.Fatal(err)
+ }
+ config.EmailAddress = "test@example.com"
+ config.LicenseKey = "test-key-123"
+ app.DB.Save(config)
+
+ app.downloadsComplete = false
+
+ downloadDone := make(chan struct{})
+ app.PageRouter = &page.Router{
+ Context: page.PageCtx{
+ DbPtr: app.DB,
+ DownloadDone: downloadDone,
+ },
+ }
+
+ // computeState must return promptly even though DownloadDone is not closed.
+ done := make(chan struct{})
+ go func() {
+ result := app.computeState()
+ if result != DOWNLOADING_ASSETS {
+ t.Errorf("state = %v, want DOWNLOADING_ASSETS", result)
+ }
+ close(done)
+ }()
+
+ select {
+ case <-done:
+ // Good: returned promptly.
+ case <-time.After(2 * time.Second):
+ t.Fatal("computeState blocked on DownloadDone channel (should be non-blocking)")
+ }
+}
+
+// TestMultipleComputeStateCallsAfterDownloadComplete verifies that calling
+// computeState repeatedly after downloads finish does not panic or change state.
+func TestMultipleComputeStateCallsAfterDownloadComplete(t *testing.T) {
+ app := &Application{
+ state: FIRST_RUN,
+ DB: setupTestDB(t),
+ }
+
+ networkIsUp = true
+ config, err := db.GetConfig(app.DB)
+ if err != nil {
+ t.Fatal(err)
+ }
+ config.EmailAddress = "test@example.com"
+ config.LicenseKey = "test-key-123"
+ app.DB.Save(config)
+
+ downloadDone := make(chan struct{})
+ close(downloadDone)
+ app.PageRouter = &page.Router{
+ Context: page.PageCtx{
+ DbPtr: app.DB,
+ DownloadDone: downloadDone,
+ },
+ }
+
+ // First call transitions to READY.
+ result := app.computeState()
+ if result != READY {
+ t.Fatalf("first call: state = %v, want READY", result)
+ }
+ app.state = result
+
+ // Subsequent calls should return READY without panic.
+ for i := 0; i < 10; i++ {
+ result = app.computeState()
+ if result != READY {
+ t.Fatalf("iteration %d: state = %v, want READY", i, result)
+ }
+ }
+}
+
+func setupTestDB(t *testing.T) *gorm.DB {
+ t.Helper()
+ d, err := db.Connect(":memory:")
+ if err != nil {
+ t.Fatal(err)
+ }
+ if err := db.Migrate(d); err != nil {
+ t.Fatal(err)
+ }
+ cfg := &db.AppConfig{
+ Model: gorm.Model{ID: 1},
+ DataDir: t.TempDir(),
+ AssetsDir: t.TempDir(),
+ SystemLevel: "BASIC",
+ SelectedAudioDevice: "default",
+ InitialFontSize: 128,
+ StandardFontSize: 32,
+ LinePattern: "fibonacci",
+ AudioEnabled: true,
+ SavedVolume: 1.0,
+ EmailAddress: "",
+ LicenseKey: "",
+ }
+ if err := d.Create(cfg).Error; err != nil {
+ t.Fatal(err)
+ }
+ return d
+}
diff --git a/archive/internal/colors/colors.go b/archive/internal/colors/colors.go
new file mode 100644
index 0000000..64ba63c
--- /dev/null
+++ b/archive/internal/colors/colors.go
@@ -0,0 +1,214 @@
+// Package sdlcolors provides a comprehensive palette of 256 standard colors
+// for use with the Go SDL2 bindings. Each color is a public variable of
+// type sdl.Color, making them easily accessible for rendering tasks.
+package colors
+
+import "github.com/veandco/go-sdl2/sdl"
+
+// Basic Colors
+var (
+ White = sdl.Color{R: 255, G: 255, B: 255, A: 255}
+ Silver = sdl.Color{R: 192, G: 192, B: 192, A: 255}
+ Gray = sdl.Color{R: 128, G: 128, B: 128, A: 255}
+ Black = sdl.Color{R: 0, G: 0, B: 0, A: 255}
+ Red = sdl.Color{R: 255, G: 0, B: 0, A: 255}
+ Maroon = sdl.Color{R: 128, G: 0, B: 0, A: 255}
+ Yellow = sdl.Color{R: 255, G: 255, B: 0, A: 255}
+ Olive = sdl.Color{R: 128, G: 128, B: 0, A: 255}
+ Lime = sdl.Color{R: 0, G: 255, B: 0, A: 255}
+ Green = sdl.Color{R: 0, G: 128, B: 0, A: 255}
+ Aqua = sdl.Color{R: 0, G: 255, B: 255, A: 255}
+ Teal = sdl.Color{R: 0, G: 128, B: 128, A: 255}
+ Blue = sdl.Color{R: 0, G: 0, B: 255, A: 255}
+ Navy = sdl.Color{R: 0, G: 0, B: 128, A: 255}
+ Fuchsia = sdl.Color{R: 255, G: 0, B: 255, A: 255}
+ Purple = sdl.Color{R: 128, G: 0, B: 128, A: 255}
+)
+
+// Grayscale
+var (
+ Gainsboro = sdl.Color{R: 220, G: 220, B: 220, A: 255}
+ LightGray = sdl.Color{R: 211, G: 211, B: 211, A: 255}
+ DarkGray = sdl.Color{R: 169, G: 169, B: 169, A: 255}
+ DimGray = sdl.Color{R: 105, G: 105, B: 105, A: 255}
+ LightSlateGray = sdl.Color{R: 119, G: 136, B: 153, A: 255}
+ SlateGray = sdl.Color{R: 112, G: 128, B: 144, A: 255}
+ DarkSlateGray = sdl.Color{R: 47, G: 79, B: 79, A: 255}
+)
+
+// Error Colors
+var (
+ ErrorRed = sdl.Color{R: 255, G: 80, B: 80, A: 255}
+)
+
+// Pinks & Reds
+var (
+ Pink = sdl.Color{R: 255, G: 192, B: 203, A: 255}
+ LightPink = sdl.Color{R: 255, G: 182, B: 193, A: 255}
+ HotPink = sdl.Color{R: 255, G: 105, B: 180, A: 255}
+ DeepPink = sdl.Color{R: 255, G: 20, B: 147, A: 255}
+ PaleVioletRed = sdl.Color{R: 219, G: 112, B: 147, A: 255}
+ MediumVioletRed = sdl.Color{R: 199, G: 21, B: 133, A: 255}
+ LightSalmon = sdl.Color{R: 255, G: 160, B: 122, A: 255}
+ Salmon = sdl.Color{R: 250, G: 128, B: 114, A: 255}
+ DarkSalmon = sdl.Color{R: 233, G: 150, B: 122, A: 255}
+ LightCoral = sdl.Color{R: 240, G: 128, B: 128, A: 255}
+ IndianRed = sdl.Color{R: 205, G: 92, B: 92, A: 255}
+ Crimson = sdl.Color{R: 220, G: 20, B: 60, A: 255}
+ Firebrick = sdl.Color{R: 178, G: 34, B: 34, A: 255}
+ DarkRed = sdl.Color{R: 139, G: 0, B: 0, A: 255}
+ DeepBloodRed = sdl.Color{R: 139, G: 0, B: 0, A: 255}
+)
+
+// Oranges
+var (
+ LightOrange = sdl.Color{R: 255, G: 200, B: 127, A: 255}
+ Orange = sdl.Color{R: 255, G: 165, B: 0, A: 255}
+ OrangeRed = sdl.Color{R: 255, G: 69, B: 0, A: 255}
+ DarkOrange = sdl.Color{R: 255, G: 140, B: 0, A: 255}
+ DarkOrangeRed = sdl.Color{R: 255, G: 140, B: 105, A: 255}
+ Tomato = sdl.Color{R: 255, G: 99, B: 71, A: 255}
+ Coral = sdl.Color{R: 255, G: 127, B: 80, A: 255}
+ PaleOrange = sdl.Color{R: 255, G: 223, B: 186, A: 255}
+ RedOrange = sdl.Color{R: 255, G: 69, B: 0, A: 255}
+)
+
+// Yellows
+var (
+ Gold = sdl.Color{R: 255, G: 215, B: 0, A: 255}
+ LightYellow = sdl.Color{R: 255, G: 255, B: 224, A: 255}
+ LemonChiffon = sdl.Color{R: 255, G: 250, B: 205, A: 255}
+ LightGoldenrodYellow = sdl.Color{R: 250, G: 250, B: 210, A: 255}
+ PapayaWhip = sdl.Color{R: 255, G: 239, B: 213, A: 255}
+ Moccasin = sdl.Color{R: 255, G: 228, B: 181, A: 255}
+ PeachPuff = sdl.Color{R: 255, G: 218, B: 185, A: 255}
+ PaleGoldenrod = sdl.Color{R: 238, G: 232, B: 170, A: 255}
+ Khaki = sdl.Color{R: 240, G: 230, B: 140, A: 255}
+ DarkKhaki = sdl.Color{R: 189, G: 183, B: 107, A: 255}
+)
+
+// Purples & Violets
+var (
+ Lavender = sdl.Color{R: 230, G: 230, B: 250, A: 255}
+ Thistle = sdl.Color{R: 216, G: 191, B: 216, A: 255}
+ Plum = sdl.Color{R: 221, G: 160, B: 221, A: 255}
+ Violet = sdl.Color{R: 238, G: 130, B: 238, A: 255}
+ Orchid = sdl.Color{R: 218, G: 112, B: 214, A: 255}
+ Magenta = sdl.Color{R: 255, G: 0, B: 255, A: 255}
+ MediumOrchid = sdl.Color{R: 186, G: 85, B: 211, A: 255}
+ MediumPurple = sdl.Color{R: 147, G: 112, B: 219, A: 255}
+ RebeccaPurple = sdl.Color{R: 102, G: 51, B: 153, A: 255}
+ BlueViolet = sdl.Color{R: 138, G: 43, B: 226, A: 255}
+ DarkViolet = sdl.Color{R: 148, G: 0, B: 211, A: 255}
+ DarkOrchid = sdl.Color{R: 153, G: 50, B: 204, A: 255}
+ DarkMagenta = sdl.Color{R: 139, G: 0, B: 139, A: 255}
+ Indigo = sdl.Color{R: 75, G: 0, B: 130, A: 255}
+ SlateBlue = sdl.Color{R: 106, G: 90, B: 205, A: 255}
+ DarkSlateBlue = sdl.Color{R: 72, G: 61, B: 139, A: 255}
+ MediumSlateBlue = sdl.Color{R: 123, G: 104, B: 238, A: 255}
+ LavenderBlush = sdl.Color{R: 255, G: 240, B: 245, A: 255}
+ LavenderGray = sdl.Color{R: 250, G: 240, B: 250, A: 255}
+)
+
+// Greens
+var (
+ GreenYellow = sdl.Color{R: 173, G: 255, B: 47, A: 255}
+ Chartreuse = sdl.Color{R: 127, G: 255, B: 0, A: 255}
+ LawnGreen = sdl.Color{R: 124, G: 252, B: 0, A: 255}
+ LimeGreen = sdl.Color{R: 50, G: 205, B: 50, A: 255}
+ PaleGreen = sdl.Color{R: 152, G: 251, B: 152, A: 255}
+ LightGreen = sdl.Color{R: 144, G: 238, B: 144, A: 255}
+ MediumSpringGreen = sdl.Color{R: 0, G: 250, B: 154, A: 255}
+ SpringGreen = sdl.Color{R: 0, G: 255, B: 127, A: 255}
+ MediumSeaGreen = sdl.Color{R: 60, G: 179, B: 113, A: 255}
+ SeaGreen = sdl.Color{R: 46, G: 139, B: 87, A: 255}
+ ForestGreen = sdl.Color{R: 34, G: 139, B: 34, A: 255}
+ DarkGreen = sdl.Color{R: 0, G: 100, B: 0, A: 255}
+ YellowGreen = sdl.Color{R: 154, G: 205, B: 50, A: 255}
+ OliveDrab = sdl.Color{R: 107, G: 142, B: 35, A: 255}
+ DarkOliveGreen = sdl.Color{R: 85, G: 107, B: 47, A: 255}
+ MediumAquamarine = sdl.Color{R: 102, G: 205, B: 170, A: 255}
+ DarkSeaGreen = sdl.Color{R: 143, G: 188, B: 143, A: 255}
+ LightSeaGreen = sdl.Color{R: 32, G: 178, B: 170, A: 255}
+ DarkCyan = sdl.Color{R: 0, G: 139, B: 139, A: 255}
+ MintGreen = sdl.Color{R: 173, G: 255, B: 169, A: 255}
+ VeryPaleGreen = sdl.Color{R: 200, G: 255, B: 210, A: 255}
+ Honeydew = sdl.Color{R: 240, G: 255, B: 240, A: 255}
+)
+
+// Blues & Cyans
+var (
+ LightCyan = sdl.Color{R: 224, G: 255, B: 255, A: 255}
+ Cyan = sdl.Color{R: 0, G: 255, B: 255, A: 255}
+ AquaMarine = sdl.Color{R: 127, G: 255, B: 212, A: 255}
+ PaleTurquoise = sdl.Color{R: 175, G: 238, B: 238, A: 255}
+ Turquoise = sdl.Color{R: 64, G: 224, B: 208, A: 255}
+ MediumTurquoise = sdl.Color{R: 72, G: 209, B: 204, A: 255}
+ DarkTurquoise = sdl.Color{R: 0, G: 206, B: 209, A: 255}
+ CadetBlue = sdl.Color{R: 95, G: 158, B: 160, A: 255}
+ SteelBlue = sdl.Color{R: 70, G: 130, B: 180, A: 255}
+ LightSteelBlue = sdl.Color{R: 176, G: 196, B: 222, A: 255}
+ PowderBlue = sdl.Color{R: 176, G: 224, B: 230, A: 255}
+ LightBlue = sdl.Color{R: 173, G: 216, B: 230, A: 255}
+ SkyBlue = sdl.Color{R: 135, G: 206, B: 235, A: 255}
+ LightSkyBlue = sdl.Color{R: 135, G: 206, B: 250, A: 255}
+ DeepSkyBlue = sdl.Color{R: 0, G: 191, B: 255, A: 255}
+ DodgerBlue = sdl.Color{R: 30, G: 144, B: 255, A: 255}
+ CornflowerBlue = sdl.Color{R: 100, G: 149, B: 237, A: 255}
+ MediumBlue = sdl.Color{R: 0, G: 0, B: 205, A: 255}
+ DarkBlue = sdl.Color{R: 0, G: 0, B: 139, A: 255}
+ MidnightBlue = sdl.Color{R: 25, G: 25, B: 112, A: 255}
+ RoyalBlue = sdl.Color{R: 65, G: 105, B: 225, A: 255}
+)
+
+// Browns
+var (
+ Cornsilk = sdl.Color{R: 255, G: 248, B: 220, A: 255}
+ BlanchedAlmond = sdl.Color{R: 255, G: 235, B: 205, A: 255}
+ Bisque = sdl.Color{R: 255, G: 228, B: 196, A: 255}
+ NavajoWhite = sdl.Color{R: 255, G: 222, B: 173, A: 255}
+ Wheat = sdl.Color{R: 245, G: 222, B: 179, A: 255}
+ BurlyWood = sdl.Color{R: 222, G: 184, B: 135, A: 255}
+ Tan = sdl.Color{R: 210, G: 180, B: 140, A: 255}
+ RosyBrown = sdl.Color{R: 188, G: 143, B: 143, A: 255}
+ SandyBrown = sdl.Color{R: 244, G: 164, B: 96, A: 255}
+ Goldenrod = sdl.Color{R: 218, G: 165, B: 32, A: 255}
+ DarkGoldenrod = sdl.Color{R: 184, G: 134, B: 11, A: 255}
+ Peru = sdl.Color{R: 205, G: 133, B: 63, A: 255}
+ Chocolate = sdl.Color{R: 210, G: 105, B: 30, A: 255}
+ SaddleBrown = sdl.Color{R: 139, G: 69, B: 19, A: 255}
+ Sienna = sdl.Color{R: 160, G: 82, B: 45, A: 255}
+ Brown = sdl.Color{R: 165, G: 42, B: 42, A: 255}
+)
+
+// Whites
+var (
+ Snow = sdl.Color{R: 255, G: 250, B: 250, A: 255}
+ MintCream = sdl.Color{R: 245, G: 255, B: 250, A: 255}
+ Azure = sdl.Color{R: 240, G: 255, B: 255, A: 255}
+ AliceBlue = sdl.Color{R: 240, G: 248, B: 255, A: 255}
+ GhostWhite = sdl.Color{R: 248, G: 248, B: 255, A: 255}
+ WhiteSmoke = sdl.Color{R: 245, G: 245, B: 245, A: 255}
+ Seashell = sdl.Color{R: 255, G: 245, B: 238, A: 255}
+ Beige = sdl.Color{R: 245, G: 245, B: 220, A: 255}
+ OldLace = sdl.Color{R: 253, G: 245, B: 230, A: 255}
+ FloralWhite = sdl.Color{R: 255, G: 250, B: 240, A: 255}
+ Ivory = sdl.Color{R: 255, G: 255, B: 240, A: 255}
+ AntiqueWhite = sdl.Color{R: 250, G: 235, B: 215, A: 255}
+ Linen = sdl.Color{R: 250, G: 240, B: 230, A: 255}
+ MistyRose = sdl.Color{R: 255, G: 228, B: 225, A: 255}
+)
+
+// Groups
+
+// Based on Solfeggio Frequencies
+var (
+ Freq_396_Colors = [7]sdl.Color{DeepBloodRed, Firebrick, Crimson, Tomato, DarkOrangeRed, Orange, PeachPuff}
+ Freq_417_Colors = [7]sdl.Color{RedOrange, Coral, DarkOrange, Orange, LightOrange, PaleOrange, BlanchedAlmond}
+ // Default proclamation needs to be using this
+ Freq_528_Colors = [7]sdl.Color{LimeGreen, MediumSeaGreen, LightGreen, PaleGreen, MintGreen, VeryPaleGreen, Honeydew}
+ Freq_639_Colors = [7]sdl.Color{SpringGreen, DarkTurquoise, Turquoise, CadetBlue, AquaMarine, PaleTurquoise, LightCyan}
+ Freq_741_Colors = [7]sdl.Color{DeepSkyBlue, DodgerBlue, RoyalBlue, CornflowerBlue, SkyBlue, LightBlue, AliceBlue}
+ Freq_852_Colors = [7]sdl.Color{Indigo, MediumPurple, BlueViolet, MediumSlateBlue, Orchid, Thistle, Lavender}
+ Freq_963_Colors = [7]sdl.Color{DarkViolet, MediumOrchid, MediumVioletRed, Plum, Violet, LavenderBlush, LavenderGray}
+)
diff --git a/archive/internal/db/DB.go b/archive/internal/db/DB.go
new file mode 100644
index 0000000..0e852a5
--- /dev/null
+++ b/archive/internal/db/DB.go
@@ -0,0 +1,112 @@
+// Package db provides a database connection and functions for interacting with the database.
+// The DB object should be held and maintained by the application, not by this package.
+// The application should be responsible for connecting to, migrating, and initial population
+// of the database. This package should only provide the schema definitions and helper functions.
+// Schema definitions should clone API response structures as closely as possible.
+
+package db
+
+import (
+ "fmt"
+ "time"
+
+ "gorm.io/driver/sqlite"
+ "gorm.io/gorm"
+)
+
+const (
+ connectMaxAttempts = 5
+ connectRetryDelay = 500 * time.Millisecond
+)
+
+// Connect opens the SQLite database at dbpath with WAL mode and a hardened
+// lock-recovery strategy suitable for kiosk use where the process may have
+// crashed and left stale lock artefacts behind.
+func Connect(dbpath string) (*gorm.DB, error) {
+
+ // ── Stale lock recovery ───────────────────────────────────────────────
+ // SQLite WAL mode leaves a .db-wal and .db-shm alongside the main file.
+ // If the previous process crashed, the OS releases file locks but the
+ // artefacts remain. SQLite recovers them automatically on the next open,
+ // UNLESS an OS-level advisory lock is still held (rare but possible on
+ // Linux with certain crash patterns). Removing them before opening is
+ // safe: SQLite treats absent WAL/SHM files as a clean slate and will
+ // recreate them. We only do this if the main DB file already exists
+ // (i.e. this is not a first-run) to avoid masking legitimate errors.
+ // if _, err := os.Stat(dbpath); err == nil {
+ // for _, ext := range []string{"-wal", "-shm"} {
+ // artefact := dbpath + ext
+ // if _, err := os.Stat(artefact); err == nil {
+ // if removeErr := os.Remove(artefact); removeErr != nil {
+ // // Non-fatal: log and continue — SQLite may still recover.
+ // fmt.Printf("[DB] warning: could not remove stale %s: %v\n", ext, removeErr)
+ // } else {
+ // fmt.Printf("[DB] removed stale lock artefact: %s\n", artefact)
+ // }
+ // }
+ // }
+ // }
+
+ // ── Connection with retry ─────────────────────────────────────────────
+ // Even after removing WAL/SHM, the main DB file itself may still be
+ // briefly locked if another process is shutting down. Retry with
+ // backoff before giving up.
+ var (
+ db *gorm.DB
+ err error
+ )
+ for attempt := 1; attempt <= connectMaxAttempts; attempt++ {
+ db, err = gorm.Open(sqlite.Open(dbpath), &gorm.Config{})
+ if err == nil {
+ break
+ }
+ if attempt == connectMaxAttempts {
+ return nil, fmt.Errorf("database still locked after %d attempts: %w", connectMaxAttempts, err)
+ }
+ fmt.Printf("[DB] open attempt %d/%d failed (%v), retrying in %s\n",
+ attempt, connectMaxAttempts, err, connectRetryDelay)
+ time.Sleep(connectRetryDelay)
+ }
+
+ // ── Connection pool ───────────────────────────────────────────────────
+ // SQLite does not support concurrent writers. Setting MaxOpenConns(1)
+ // forces gorm to serialise all queries through a single connection,
+ // preventing "database is locked" errors from competing goroutines
+ // within this process. This is the single most important setting for
+ // SQLite in a multi-goroutine application.
+ sqlDB, err := db.DB()
+ if err != nil {
+ return nil, fmt.Errorf("could not get underlying sql.DB: %w", err)
+ }
+ sqlDB.SetMaxOpenConns(1)
+ sqlDB.SetMaxIdleConns(1)
+
+ // ── Pragmas ───────────────────────────────────────────────────────────
+ pragmas := []string{
+ "PRAGMA journal_mode=WAL",
+ "PRAGMA synchronous=FULL",
+ "PRAGMA foreign_keys=ON",
+ // 5 s gives the serialised connection time to finish a long write
+ // before returning SQLITE_BUSY to the application layer.
+ "PRAGMA busy_timeout=5000",
+ }
+ for _, pragma := range pragmas {
+ if _, err := sqlDB.Exec(pragma); err != nil {
+ return nil, fmt.Errorf("failed to set %q: %w", pragma, err)
+ }
+ }
+
+ return db, nil
+}
+
+// Migrate the database schema.
+func Migrate(db *gorm.DB) error {
+ return db.AutoMigrate(
+ &AppConfig{},
+ &Log{},
+ &Proclamation{},
+ &ProclamationCategory{},
+ &SolfeggioFrequency{},
+ &AudioFile{},
+ )
+}
diff --git a/archive/internal/db/Schema.go b/archive/internal/db/Schema.go
new file mode 100644
index 0000000..0d7f6bb
--- /dev/null
+++ b/archive/internal/db/Schema.go
@@ -0,0 +1,58 @@
+// schema.go defines the database schema for the GORM models.
+package db
+
+import "gorm.io/gorm"
+
+type AppConfig struct {
+ gorm.Model
+ DataDir string
+ AssetsDir string
+ EmailAddress string
+ LicenseKey string
+ SystemLevel string // BASIC, ADVANCED, ELITE, COMMERCIAL
+ SelectedAudioDevice string // The pipewire device name
+ InitialFontSize int // How large to create the font atlas
+ StandardFontSize int // The font size used for most text rendering
+ LinePattern string // "fibonacci"
+ AudioEnabled bool
+ SavedVolume float64 // Last saved volume as a percentage
+ FirstRun bool // Is this the first time the application has been run?
+}
+
+type Log struct {
+ gorm.Model
+ Timestamp int64
+ Level string
+ Message string
+}
+
+type Proclamation struct {
+ ID string `gorm:"primaryKey"`
+ Name string
+ Content string
+ SolfeggioFrequencyID int
+ CategoryID int
+ Selected bool
+ Available bool
+ Price float64
+}
+
+type ProclamationCategory struct {
+ ID int `gorm:"primaryKey"`
+ Name string
+ ParentId int
+}
+
+type SolfeggioFrequency struct {
+ ID int `gorm:"primaryKey"`
+ Name string
+ Value int
+}
+
+type AudioFile struct {
+ ID int `gorm:"primaryKey"`
+ Name string
+ Path string
+ Selected bool
+ Order int
+}
diff --git a/archive/internal/db/queries.go b/archive/internal/db/queries.go
new file mode 100644
index 0000000..de2ed52
--- /dev/null
+++ b/archive/internal/db/queries.go
@@ -0,0 +1,14 @@
+package db
+
+import "gorm.io/gorm"
+
+// GetConfig fetches the application config from the database
+func GetConfig(db *gorm.DB) (*AppConfig, error) {
+ var cfg AppConfig
+ err := db.First(&cfg, 1).Error
+ if err != nil {
+ return nil, err
+ }
+
+ return &cfg, nil
+}
diff --git a/archive/internal/download/Download.go b/archive/internal/download/Download.go
new file mode 100644
index 0000000..60c2bd0
--- /dev/null
+++ b/archive/internal/download/Download.go
@@ -0,0 +1,239 @@
+package download
+
+import (
+ "bufio"
+ "crypto/md5"
+ "fmt"
+ "io"
+ "net/http"
+ "os"
+ "path/filepath"
+ "strings"
+
+ "rhemawavetech.com/rhemawave/internal/logger"
+)
+
+// DownloadStatus holds information related to downloads and is
+// the container for information returned via channels within this package.
+type DownloadStatus struct {
+ Max int64
+ Cur int64
+ Msg string
+ Err error
+}
+
+// manifest maps filename → expected MD5 hex string
+type manifest map[string]string
+
+// ─── Server script to generate checksums.md5 ─────────────────────────────────
+//
+// Run this on your file server whenever you add or replace audio files:
+//
+// cd /path/to/audio && md5sum *.mp3 > checksums.md5
+//
+// That's it. The app will pick up changes automatically on next run.
+// ─────────────────────────────────────────────────────────────────────────────
+
+const manifestFilename = "checksums.md5"
+
+// DownloadAudioFiles downloads audio files, skipping any that already exist
+// locally with a matching MD5. Files with a wrong checksum are deleted and
+// re-downloaded. Progress is sent to progressChan, which is closed on return.
+func DownloadAudioFiles(progressChan chan<- DownloadStatus, destDir string, urlBase string) {
+ defer close(progressChan)
+
+ send := func(cur, max int64, msg string, err error) {
+ progressChan <- DownloadStatus{Cur: cur, Max: max, Msg: msg, Err: err}
+ }
+
+ send(0, 0, "Fetching file manifest...", nil)
+ m, err := fetchManifest(urlBase + manifestFilename)
+ if err != nil {
+ send(0, 0, "Failed to fetch manifest", err)
+ return
+ }
+ logger.Info("download: manifest loaded, %d files listed", len(m))
+
+ send(0, 0, "Comparing checksums...", nil)
+
+ type work struct {
+ filename string
+ expectedMD5 string
+ }
+ var queue []work
+
+ for filename, expectedMD5 := range m {
+ localPath := filepath.Join(destDir, filename)
+ localMD5, err := fileMD5(localPath)
+ if err != nil {
+ logger.Debug("download: %s not found locally, queuing", filename)
+ queue = append(queue, work{filename, expectedMD5})
+ continue
+ }
+ if localMD5 != expectedMD5 {
+ logger.Debug("download: %s checksum mismatch (got %s, want %s), re-downloading",
+ filename, localMD5, expectedMD5)
+ if err := os.Remove(localPath); err != nil {
+ logger.Warning("download: failed to remove corrupt file %s: %v", localPath, err)
+ }
+ queue = append(queue, work{filename, expectedMD5})
+ } else {
+ logger.Debug("download: %s OK", filename)
+ }
+ }
+
+ if len(queue) == 0 {
+ send(0, 0, "All files are up to date.", nil)
+ logger.Info("download: nothing to do")
+ return
+ }
+
+ total := len(queue)
+ send(0, 0, fmt.Sprintf("0 / %d Files Downloaded", total), nil)
+ logger.Info("download: %d file(s) to download", total)
+
+ totalDownloaded := int64(0)
+ filesDownloaded := 0
+
+ for _, w := range queue {
+ url := urlBase + w.filename
+ destPath := filepath.Join(destDir, w.filename)
+
+ logger.Debug("download: starting %s", w.filename)
+
+ downloaded, err := downloadFile(url, destPath, func(n int64) {
+ totalDownloaded += n
+ send(totalDownloaded, 0, fmt.Sprintf("%d / %d Files Downloaded", filesDownloaded, total), nil)
+ })
+
+ if err != nil {
+ logger.Error("download: failed to download %s: %v", w.filename, err)
+ send(totalDownloaded, 0, fmt.Sprintf("%d / %d Files Downloaded", filesDownloaded, total), err)
+ return
+ }
+
+ gotMD5, err := fileMD5(destPath)
+ if err != nil {
+ logger.Error("download: could not hash %s after download: %v", w.filename, err)
+ os.Remove(destPath)
+ send(totalDownloaded, 0, "Checksum verification failed", err)
+ return
+ }
+ if gotMD5 != w.expectedMD5 {
+ err := fmt.Errorf("checksum mismatch after download: got %s, want %s", gotMD5, w.expectedMD5)
+ logger.Error("download: %s %v", w.filename, err)
+ os.Remove(destPath)
+ send(totalDownloaded, 0, "Checksum verification failed — file removed", err)
+ return
+ }
+
+ filesDownloaded++
+ statusMsg := fmt.Sprintf("%d / %d Files Downloaded", filesDownloaded, total)
+ logger.Info("download: %s (%d bytes)", statusMsg, downloaded)
+ send(totalDownloaded, 0, statusMsg, nil)
+ }
+
+ send(totalDownloaded, totalDownloaded, "All downloads complete!", nil)
+ logger.Info("download: all files downloaded and verified")
+}
+
+// ─── Helpers ──────────────────────────────────────────────────────────────────
+
+// fetchManifest downloads and parses a checksums.md5 file.
+// Format per line: " " (two spaces, same as md5sum output)
+func fetchManifest(url string) (manifest, error) {
+ resp, err := http.Get(url)
+ if err != nil {
+ return nil, fmt.Errorf("fetch manifest: %w", err)
+ }
+ defer resp.Body.Close()
+
+ if resp.StatusCode != http.StatusOK {
+ return nil, fmt.Errorf("fetch manifest: server returned %s", resp.Status)
+ }
+
+ m := make(manifest)
+ scanner := bufio.NewScanner(resp.Body)
+ for scanner.Scan() {
+ line := strings.TrimSpace(scanner.Text())
+ if line == "" || strings.HasPrefix(line, "#") {
+ continue
+ }
+ // md5sum format: "hash filename" (two spaces)
+ parts := strings.SplitN(line, " ", 2)
+ if len(parts) != 2 {
+ logger.Warning("download: skipping malformed manifest line: %q", line)
+ continue
+ }
+ hash := strings.TrimSpace(parts[0])
+ name := strings.TrimSpace(parts[1])
+ m[name] = hash
+ }
+
+ if err := scanner.Err(); err != nil {
+ return nil, fmt.Errorf("parse manifest: %w", err)
+ }
+
+ return m, nil
+}
+
+// fileMD5 computes the MD5 checksum of a local file.
+// Returns an error if the file doesn't exist or can't be read.
+func fileMD5(path string) (string, error) {
+ f, err := os.Open(path)
+ if err != nil {
+ return "", err
+ }
+ defer f.Close()
+
+ h := md5.New()
+ if _, err := io.Copy(h, f); err != nil {
+ return "", fmt.Errorf("hash %s: %w", path, err)
+ }
+
+ return fmt.Sprintf("%x", h.Sum(nil)), nil
+}
+
+// downloadFile streams url to destPath, calling onChunk(n) after each write
+// with the number of bytes just written. Returns total bytes downloaded.
+func downloadFile(url, destPath string, onChunk func(int64)) (int64, error) {
+ resp, err := http.Get(url)
+ if err != nil {
+ return 0, err
+ }
+ defer resp.Body.Close()
+
+ if resp.StatusCode != http.StatusOK {
+ return 0, fmt.Errorf("GET %s: %s", url, resp.Status)
+ }
+
+ out, err := os.Create(destPath)
+ if err != nil {
+ return 0, fmt.Errorf("create %s: %w", destPath, err)
+ }
+ defer out.Close()
+
+ var total int64
+ buf := make([]byte, 32*1024) // 32KB chunks
+
+ for {
+ n, err := resp.Body.Read(buf)
+ if n > 0 {
+ if _, werr := out.Write(buf[:n]); werr != nil {
+ os.Remove(destPath)
+ return total, fmt.Errorf("write %s: %w", destPath, werr)
+ }
+ total += int64(n)
+ onChunk(int64(n))
+ }
+ if err == io.EOF {
+ break
+ }
+ if err != nil {
+ os.Remove(destPath)
+ return total, fmt.Errorf("read %s: %w", url, err)
+ }
+ }
+
+ return total, nil
+}
diff --git a/archive/internal/fontManager/fontManager.go b/archive/internal/fontManager/fontManager.go
new file mode 100644
index 0000000..20e0096
--- /dev/null
+++ b/archive/internal/fontManager/fontManager.go
@@ -0,0 +1,890 @@
+package fontManager
+
+import (
+ "fmt"
+ "os"
+ "path/filepath"
+ "strings"
+ "sync"
+
+ "github.com/go-gl/gl/v3.3-core/gl"
+ "github.com/go-gl/mathgl/mgl32"
+ "github.com/veandco/go-sdl2/sdl"
+ "github.com/veandco/go-sdl2/ttf"
+ "rhemawavetech.com/rhemawave/internal/db"
+ "rhemawavetech.com/rhemawave/internal/graphics"
+ "rhemawavetech.com/rhemawave/internal/shaderManager"
+)
+
+// FontManager handles the loading and management of fonts.
+type FontManager struct {
+ Fonts map[string]*FontEntry
+
+ // Reusable GPU objects for string texture rendering
+ stringFBO uint32
+ stringVAO uint32
+ stringVBO uint32
+}
+
+var (
+ fontManagerInstance *FontManager
+ fontManagerOnce sync.Once
+ initErr error // Package-level variable to capture error from within sync.Once
+)
+
+// InitFontManager initializes the FontManager singleton.
+// It must be called once at startup after ShaderManager has been initialized.
+func InitFontManager(cfg *db.AppConfig) error {
+ fontManagerOnce.Do(func() {
+
+ // Dependency check: Ensure ShaderManager is ready
+ sm := shaderManager.Get()
+ if sm == nil {
+ initErr = fmt.Errorf("cannot initialize FontManager because ShaderManager is not initialized")
+ return // Exit the anonymous function
+ }
+
+ fm := &FontManager{
+ Fonts: make(map[string]*FontEntry),
+ }
+
+ fontPath := filepath.Join(cfg.AssetsDir, "fonts")
+ if err := fm.loadFonts(fontPath, cfg); err != nil {
+ initErr = fmt.Errorf("could not load fonts from '%s': %w", fontPath, err)
+ return
+ }
+
+ // --- NEW: Create the scrambled font after loading normal fonts ---
+ // We will use "DejaVuSans" as the base. If you use a different default font,
+ // change this string.
+ baseFontForScramble := "SpaceMonoNerdFont-Regular"
+ if _, ok := fm.Fonts[baseFontForScramble]; ok {
+ if err := fm.CreateScrambledFont(baseFontForScramble, "Scrambled"); err != nil {
+ // This is not a fatal error for the whole application, so we just log it.
+ }
+ } else {
+ }
+ // --- END NEW ---
+
+ // Create reusable GPU objects for string texture rendering
+ gl.GenFramebuffers(1, &fm.stringFBO)
+ gl.GenVertexArrays(1, &fm.stringVAO)
+ gl.GenBuffers(1, &fm.stringVBO)
+
+ // Set up VAO attribute layout once
+ gl.BindVertexArray(fm.stringVAO)
+ gl.BindBuffer(gl.ARRAY_BUFFER, fm.stringVBO)
+ gl.BufferData(gl.ARRAY_BUFFER, 6*4*4, nil, gl.DYNAMIC_DRAW) // 6 vertices * 4 floats * 4 bytes
+ gl.EnableVertexAttribArray(0)
+ gl.VertexAttribPointerWithOffset(0, 2, gl.FLOAT, false, 4*4, 0)
+ gl.EnableVertexAttribArray(1)
+ gl.VertexAttribPointerWithOffset(1, 2, gl.FLOAT, false, 4*4, 2*4)
+ gl.BindVertexArray(0)
+ gl.BindBuffer(gl.ARRAY_BUFFER, 0)
+
+ fontManagerInstance = fm
+ })
+
+ // Return the error that might have been captured inside the sync.Once block.
+ return initErr
+}
+
+// Get returns the singleton instance of the FontManager.
+// It will panic if InitFontManager has not been called successfully first.
+func Get() *FontManager {
+ if fontManagerInstance == nil {
+ panic("FontManager has not been initialized or initialization failed. Call InitFontManager at application startup.")
+ }
+ return fontManagerInstance
+}
+
+// FontEntry combines related Font information together
+type FontEntry struct {
+ Name string
+ Font *ttf.Font
+ Map *FontMap
+}
+
+// FontMap contains the character map for a specific font
+type FontMap struct {
+ FontMapTextureID uint32 // Memory address of the FontMapTexture within the GPU
+ Width int32 // The width of the font map texture
+ Height int32 // The height of the font map FontMap Texture
+ Glyphs map[rune]Glyph // A map of runes and their locations within the Fontmap
+ padding int32
+}
+
+// TempGlyph is a temporary struct used only during font map creation.
+type TempGlyph struct {
+ Rune rune
+ Advance int
+ surface *sdl.Surface
+}
+
+// Glyph contains the rendering information for a single character
+type Glyph struct {
+ Rune rune // The character this glyph represents.
+ SrcRect sdl.Rect // The source rectangle in the texture atlas.
+ Advance int // How far to advance the cursor after drawing this glyph.
+ TextureID uint32 // The ID of the texture atlas this glyph belongs to.
+}
+
+// loadFonts scans the fonts directory, loads all .ttf/.otf files, and creates a font map for each.
+func (fm *FontManager) loadFonts(fontDir string, cfg *db.AppConfig) error {
+ files, err := os.ReadDir(fontDir)
+ if err != nil {
+ return fmt.Errorf("could not read font directory '%s': %w", fontDir, err)
+ }
+
+ for _, file := range files {
+ if file.IsDir() {
+ continue
+ }
+ fileName := file.Name()
+ if strings.HasSuffix(strings.ToLower(fileName), ".ttf") || strings.HasSuffix(strings.ToLower(fileName), ".otf") {
+ fontPath := filepath.Join(fontDir, fileName)
+ baseFontSize := cfg.StandardFontSize
+ if err != nil {
+ return fmt.Errorf("could not convert init_font_size to int: %w", err)
+ }
+ font, err := ttf.OpenFont(fontPath, baseFontSize) // Using a higher resolution for better quality
+ if err != nil {
+ continue
+ }
+
+ fontName := strings.TrimSuffix(fileName, filepath.Ext(fileName))
+ fm.Fonts[fontName] = &FontEntry{
+ Name: fontName,
+ Font: font,
+ Map: nil,
+ }
+ }
+ }
+
+ for _, fontEntry := range fm.Fonts {
+ if err := fm.createFontMap(fontEntry, false, nil); err != nil {
+ return fmt.Errorf("unable to create Font Map for font: %s : %v", fontEntry.Name, err)
+ }
+ }
+
+ return nil
+}
+
+// CreateScrambledFont generates a new font entry by scrambling the glyphs of a base font.
+func (fm *FontManager) CreateScrambledFont(baseFontName string, newFontName string) error {
+ baseFont, ok := fm.Fonts[baseFontName]
+ if !ok {
+ return fmt.Errorf("base font '%s' not found", baseFontName)
+ }
+
+ scrambledFontEntry := &FontEntry{
+ Name: newFontName,
+ Font: baseFont.Font, // It uses the same underlying TTF font object for rendering
+ Map: nil,
+ }
+
+ if err := fm.createFontMap(scrambledFontEntry, true, baseFont); err != nil {
+ return fmt.Errorf("unable to create scrambled font map: %w", err)
+ }
+
+ fm.Fonts[newFontName] = scrambledFontEntry
+ return nil
+}
+
+// ATTENTION: TED
+//
+// # Deterministic Fibonacci-Based Visual Pattern Generation for Character Data
+//
+// This method transforms rendered text characters into structured visual patterns that produce
+// character-specific spatial frequency signatures while maintaining perfect reversibility.
+//
+// The technology addresses a fundamental limitation in subliminal text display: conventional
+// approaches either use unmodified text (consciously readable, defeating the subliminal purpose)
+// or simple blurring/masking (destroys information content and character-specific structure).
+// Our method preserves complete character information in a transformed visual state that remains
+// illegible to conscious observation while generating structured spatial patterns.
+//
+// The approach treats each rendered character as a two-dimensional grid and applies deterministic
+// geometric transformations parameterized by Fibonacci sequence values. The character's Unicode
+// value seeds all transformation parameters, ensuring identical characters produce identical
+// patterns while different characters generate distinct spatial signatures. Multiple transformation
+// stages compound to create high-entropy visual output with underlying mathematical structure.
+//
+// Key differentiators from existing solutions:
+// - Operates on rendered visual data rather than underlying text data or encrypted values
+// - Generates character-specific spatial frequency patterns rather than uniform noise
+// - Uses Fibonacci-sequence-derived parameters to create mathematically structured transformations
+// - Maintains pixel-perfect reversibility despite high visual entropy
+// - Produces deterministic, reproducible patterns for each character
+//
+// Within our Rhema Wave generation system, these transformed characters create spatial interference
+// patterns designed for subconscious processing. Each character contributes a unique frequency
+// signature to the overall visual field, with Fibonacci-based geometry intended to create harmonic
+// relationships between character patterns. The result is a consciously illegible display that
+// maintains structured information content in the spatial domain, forming a component of the
+// broader Rhema Wave output.
+func (fm *FontManager) scrambleSurface(surface *sdl.Surface, r rune) error {
+ if surface.W < 8 || surface.H < 8 {
+ return nil
+ }
+ if err := surface.Lock(); err != nil {
+ return fmt.Errorf("could not lock surface for scrambling: %w", err)
+ }
+ defer surface.Unlock()
+
+ W := int(surface.W)
+ H := int(surface.H)
+
+ // Use much finer grid for complete illegibility
+ // Fibonacci number determines grid size: 5, 8, or 13
+ fib := []int{5, 8, 13}
+ fibIndex := int(r) % len(fib)
+ gridSize := fib[fibIndex]
+
+ // Ensure we have at least 8x8 grid for strong scrambling
+ if gridSize < 8 {
+ gridSize = 8
+ }
+
+ blockW := W / gridSize
+ blockH := H / gridSize
+
+ if blockW == 0 || blockH == 0 {
+ // Surface too small, fall back to 4x4
+ gridSize = 4
+ blockW = W / gridSize
+ blockH = H / gridSize
+ if blockW == 0 || blockH == 0 {
+ return nil
+ }
+ }
+
+ numBlocks := gridSize * gridSize
+
+ // Create complete permutation using Fibonacci linear congruential generator
+ blockIndices := make([]int, numBlocks)
+
+ // Use Fibonacci numbers for the LCG parameters
+ // F(7)=13, F(8)=21, F(9)=34, F(10)=55, F(11)=89
+ fibSeq := []int{13, 21, 34, 55, 89, 144}
+ multiplier := fibSeq[int(r)%len(fibSeq)]
+ increment := fibSeq[(int(r)+1)%len(fibSeq)]
+
+ // Generate pseudo-random permutation
+ for i := 0; i < numBlocks; i++ {
+ blockIndices[i] = (multiplier*i + increment*int(r)) % numBlocks
+ }
+
+ // Additional scrambling: apply multiple Fibonacci-based transformations
+ numTransforms := 3 + (int(r) % 5) // 3-7 transformations
+
+ for t := 0; t < numTransforms; t++ {
+ transformType := (int(r) + t*fibSeq[t%len(fibSeq)]) % 5
+
+ switch transformType {
+ case 0: // Reverse sections
+ sectionSize := gridSize / 2
+ for i := 0; i < numBlocks; i += sectionSize {
+ end := i + sectionSize
+ if end > numBlocks {
+ end = numBlocks
+ }
+ reverseSlice(blockIndices[i:end])
+ }
+
+ case 1: // Spiral rotation
+ // Rotate blocks in a spiral pattern
+ for layer := 0; layer < gridSize/2; layer++ {
+ rotateLayer(blockIndices, gridSize, layer)
+ }
+
+ case 2: // Fibonacci walk swap
+ step := fib[t%len(fib)]
+ for i := 0; i < numBlocks-step; i += step {
+ blockIndices[i], blockIndices[i+step] = blockIndices[i+step], blockIndices[i]
+ }
+
+ case 3: // Checkerboard transpose
+ for i := 0; i < gridSize; i++ {
+ for j := 0; j < gridSize; j++ {
+ if (i+j)%2 == 0 {
+ idx1 := i*gridSize + j
+ idx2 := j*gridSize + i
+ if idx2 < numBlocks {
+ blockIndices[idx1], blockIndices[idx2] = blockIndices[idx2], blockIndices[idx1]
+ }
+ }
+ }
+ }
+
+ case 4: // Random-walk permutation
+ walkLen := fib[(t+1)%len(fib)]
+ pos := int(r+rune(t)) % numBlocks
+ for w := 0; w < walkLen && pos < numBlocks-1; w++ {
+ nextPos := (pos + fib[w%len(fib)]) % numBlocks
+ blockIndices[pos], blockIndices[nextPos] = blockIndices[nextPos], blockIndices[pos]
+ pos = nextPos
+ }
+ }
+ }
+
+ // Copy pixels to perform the scrambling
+ pixels := surface.Pixels()
+ bytesPerPixel := int(surface.Format.BytesPerPixel)
+ pitch := int(surface.Pitch)
+ originalPixels := make([]byte, len(pixels))
+ copy(originalPixels, pixels)
+
+ // Rearrange all blocks
+ for dstIdx := 0; dstIdx < numBlocks; dstIdx++ {
+ srcIdx := blockIndices[dstIdx]
+
+ srcCol := srcIdx % gridSize
+ srcRow := srcIdx / gridSize
+ dstCol := dstIdx % gridSize
+ dstRow := dstIdx / gridSize
+
+ srcX := srcCol * blockW
+ srcY := srcRow * blockH
+ dstX := dstCol * blockW
+ dstY := dstRow * blockH
+
+ // Copy block pixel by pixel
+ for y := 0; y < blockH; y++ {
+ if srcY+y >= H || dstY+y >= H {
+ continue
+ }
+
+ srcOffset := (srcY+y)*pitch + srcX*bytesPerPixel
+ dstOffset := (dstY+y)*pitch + dstX*bytesPerPixel
+
+ rowLen := blockW * bytesPerPixel
+ if srcX+blockW > W {
+ rowLen = (W - srcX) * bytesPerPixel
+ }
+ if dstX+blockW > W {
+ maxLen := (W - dstX) * bytesPerPixel
+ if maxLen < rowLen {
+ rowLen = maxLen
+ }
+ }
+
+ if srcOffset+rowLen <= len(originalPixels) && dstOffset+rowLen <= len(pixels) {
+ copy(pixels[dstOffset:dstOffset+rowLen], originalPixels[srcOffset:srcOffset+rowLen])
+ }
+ }
+ }
+
+ return nil
+}
+
+// Helper function to reverse a slice
+func reverseSlice(arr []int) {
+ for i, j := 0, len(arr)-1; i < j; i, j = i+1, j-1 {
+ arr[i], arr[j] = arr[j], arr[i]
+ }
+}
+
+// Helper function to rotate a layer in spiral pattern
+func rotateLayer(arr []int, gridSize, layer int) {
+ if layer >= gridSize/2 {
+ return
+ }
+
+ // Extract the layer elements
+ var temp []int
+
+ // Top edge
+ for i := layer; i < gridSize-layer; i++ {
+ temp = append(temp, arr[layer*gridSize+i])
+ }
+ // Right edge
+ for i := layer + 1; i < gridSize-layer; i++ {
+ temp = append(temp, arr[i*gridSize+(gridSize-layer-1)])
+ }
+ // Bottom edge
+ if gridSize-layer-1 > layer {
+ for i := gridSize - layer - 2; i >= layer; i-- {
+ temp = append(temp, arr[(gridSize-layer-1)*gridSize+i])
+ }
+ }
+ // Left edge
+ if gridSize-layer-1 > layer {
+ for i := gridSize - layer - 2; i > layer; i-- {
+ temp = append(temp, arr[i*gridSize+layer])
+ }
+ }
+
+ // Rotate the temp array by 1 position
+ if len(temp) > 0 {
+ last := temp[len(temp)-1]
+ copy(temp[1:], temp[0:len(temp)-1])
+ temp[0] = last
+ }
+
+ // Put back the rotated elements
+ idx := 0
+ // Top edge
+ for i := layer; i < gridSize-layer && idx < len(temp); i++ {
+ arr[layer*gridSize+i] = temp[idx]
+ idx++
+ }
+ // Right edge
+ for i := layer + 1; i < gridSize-layer && idx < len(temp); i++ {
+ arr[i*gridSize+(gridSize-layer-1)] = temp[idx]
+ idx++
+ }
+ // Bottom edge
+ if gridSize-layer-1 > layer {
+ for i := gridSize - layer - 2; i >= layer && idx < len(temp); i-- {
+ arr[(gridSize-layer-1)*gridSize+i] = temp[idx]
+ idx++
+ }
+ }
+ // Left edge
+ if gridSize-layer-1 > layer {
+ for i := gridSize - layer - 2; i > layer && idx < len(temp); i-- {
+ arr[i*gridSize+layer] = temp[idx]
+ idx++
+ }
+ }
+}
+
+// createFontMap generates a texture atlas for a given font entry.
+func (fm *FontManager) createFontMap(font *FontEntry, scramble bool, baseFont *FontEntry) error {
+ // var chars []rune
+ // for i := rune(32); i <= 126; i++ { // Common ASCII characters
+ // chars = append(chars, i)
+ // }
+
+ // Standard ASCII (A-Z, a-z, 0-9) + punctuation
+ chars := []rune{
+ // Numbers 0-9
+ 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, // 0-9
+
+ // Uppercase A-Z
+ 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, // A-O
+ 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, // P-Z
+
+ // Lowercase a-z
+ 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, // a-m
+ 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, // n-z
+
+ // Basic punctuation (ASCII 32-47, 58-64, 91-96, 123-126)
+ 32, // Space
+ 33, // !
+ 34, // "
+ 35, // #
+ 36, // $
+ 37, // %
+ 38, // &
+ 39, // '
+ 40, // (
+ 41, // )
+ 42, // *
+ 43, // +
+ 44, // ,
+ 45, // -
+ 46, // .
+ 47, // /
+ 58, // :
+ 59, // ;
+ 60, // <
+ 61, // =
+ 62, // >
+ 63, // ?
+ 64, // @
+ 91, // [
+ 92, // \
+ 93, // ]
+ 94, // ^
+ 95, // _
+ 96, // `
+ 123, // {
+ 124, // |
+ 125, // }
+ 126, // ~
+
+ // Common Unicode punctuation
+ 161, // ¡
+ 191, // ¿
+ 8211, // –
+ 8212, // —
+ 8216, // ‘
+ 8217, // ’
+ 8220, // “
+ 8221, // ”
+ 8226, // •
+ 8230, // …
+ 8240, // ‰
+ 8364, // €
+ 162, // ¢
+ 163, // £
+ 165, // ¥
+ 169, // ©
+ 174, // ®
+ 8482, // ™
+ 232, // è
+ 233, // é
+ 10003, // checkmark
+ }
+ tempGlyphs := make([]TempGlyph, 0, len(chars))
+ var totalWidth, maxHeight int32
+ padding := int32(2) // 2 pixels of padding between glyphs
+
+ // If scrambling, use the base font's metrics but our new entry's name
+ fontToRenderFrom := font
+ if scramble && baseFont != nil {
+ fontToRenderFrom = baseFont
+ }
+
+ for _, char := range chars {
+ tempGlyph, err := fm.createTempGlyph(fontToRenderFrom, char)
+ if err != nil {
+ continue
+ }
+
+ // --- NEW: Scramble the surface if requested ---
+ if scramble {
+ if err := fm.scrambleSurface(tempGlyph.surface, char); err != nil {
+ // We can continue, it will just use the unscrambled glyph
+ }
+ }
+ // --- END NEW ---
+
+ tempGlyphs = append(tempGlyphs, tempGlyph)
+ totalWidth += tempGlyph.surface.W + padding
+ if tempGlyph.surface.H > maxHeight {
+ maxHeight = tempGlyph.surface.H
+ }
+ }
+
+ atlasSurface, err := sdl.CreateRGBSurface(0, totalWidth, maxHeight, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000)
+ if err != nil {
+ return fmt.Errorf("could not create atlas surface: %w", err)
+ }
+ defer atlasSurface.Free()
+
+ fontMap := &FontMap{
+ Glyphs: make(map[rune]Glyph),
+ padding: padding,
+ }
+
+ var currentX int32 = 0
+ for _, tempGlyph := range tempGlyphs {
+ dstRect := sdl.Rect{X: currentX, Y: 0, W: tempGlyph.surface.W, H: tempGlyph.surface.H}
+ if err := tempGlyph.surface.Blit(nil, atlasSurface, &dstRect); err != nil {
+ tempGlyph.surface.Free()
+ continue
+ }
+
+ fontMap.Glyphs[tempGlyph.Rune] = Glyph{
+ Rune: tempGlyph.Rune,
+ Advance: tempGlyph.Advance,
+ SrcRect: dstRect,
+ }
+
+ currentX += tempGlyph.surface.W + padding
+ tempGlyph.surface.Free()
+ }
+
+ textureID, err := graphics.CreateTextureFromSurface(atlasSurface)
+ if err != nil {
+ return fmt.Errorf("could not create texture from atlas surface: %w", err)
+ }
+
+ fontMap.FontMapTextureID = textureID
+ fontMap.Width = atlasSurface.W
+ fontMap.Height = atlasSurface.H
+
+ for r, g := range fontMap.Glyphs {
+ g.TextureID = textureID
+ fontMap.Glyphs[r] = g
+ }
+
+ font.Map = fontMap
+ return nil
+}
+
+// createTempGlyph renders a single character to a temporary SDL surface.
+func (fm *FontManager) createTempGlyph(font *FontEntry, char rune) (TempGlyph, error) {
+ runeSurface, err := font.Font.RenderGlyphBlended(char, sdl.Color{R: 255, G: 255, B: 255, A: 255})
+ if err != nil {
+ return TempGlyph{}, fmt.Errorf("unable to create glyph for char '%c': %w", char, err)
+ }
+
+ metrics, err := font.Font.GlyphMetrics(char)
+ if err != nil {
+ runeSurface.Free()
+ return TempGlyph{}, fmt.Errorf("unable to fetch glyph metrics for char '%c': %w", char, err)
+ }
+
+ return TempGlyph{
+ Rune: char,
+ Advance: metrics.Advance,
+ surface: runeSurface,
+ }, nil
+}
+
+// GetFont retrieves a loaded font by its name.
+func (fm *FontManager) GetFont(name string) (*FontEntry, bool) {
+ fontEntry, ok := fm.Fonts[name]
+ return fontEntry, ok
+}
+
+// GetGlyph retrieves the rendering data for a specific character from a font's map.
+func (fm *FontManager) GetGlyph(fontName string, r rune) (Glyph, bool) {
+ fontEntry, ok := fm.Fonts[fontName]
+ if !ok || fontEntry.Map == nil {
+ return Glyph{}, false
+ }
+ glyph, ok := fontEntry.Map.Glyphs[r]
+ return glyph, ok
+}
+
+// GetFontNames returns a slice of all loaded font names.
+func (fm *FontManager) GetFontNames() []string {
+ names := make([]string, 0, len(fm.Fonts))
+ for name := range fm.Fonts {
+ names = append(names, name)
+ }
+ return names
+}
+
+// Close frees all loaded font resources, including the generated textures.
+func (fm *FontManager) Close() {
+ for _, fontEntry := range fm.Fonts {
+ if fontEntry.Map != nil && fontEntry.Map.FontMapTextureID != 0 {
+ gl.DeleteTextures(1, &fontEntry.Map.FontMapTextureID)
+ }
+ if fontEntry.Font != nil {
+ fontEntry.Font.Close()
+ }
+ }
+
+ if fm.stringFBO != 0 {
+ gl.DeleteFramebuffers(1, &fm.stringFBO)
+ }
+ if fm.stringVAO != 0 {
+ gl.DeleteVertexArrays(1, &fm.stringVAO)
+ }
+ if fm.stringVBO != 0 {
+ gl.DeleteBuffers(1, &fm.stringVBO)
+ }
+}
+
+func (fm *FontManager) CreateStringTexture(fontName string, text string, shader *shaderManager.Shader) (textureID uint32, width int32, height int32, err error) {
+ shaderID := shader.ProgramID
+ if fontName == "" || text == "" {
+ return 0, 0, 0, fmt.Errorf("font name and text cannot be blank")
+ }
+
+ selectedFont, ok := fm.Fonts[fontName]
+ if !ok || selectedFont.Map == nil {
+ return 0, 0, 0, fmt.Errorf("font '%s' not found or its font map is not created", fontName)
+ }
+
+ var totalWidth, maxHeight int32
+ glyphsToRender := make([]Glyph, 0, len(text))
+
+ for _, r := range text {
+ g, ok := selectedFont.Map.Glyphs[r]
+ if !ok {
+ g = selectedFont.Map.Glyphs['?'] // Fallback
+ }
+ totalWidth += g.SrcRect.W + selectedFont.Map.padding
+ if g.SrcRect.H > maxHeight {
+ maxHeight = g.SrcRect.H
+ }
+ glyphsToRender = append(glyphsToRender, g)
+ }
+
+ if totalWidth <= 0 || maxHeight <= 0 {
+ return 0, 0, 0, fmt.Errorf("calculated texture dimensions are invalid: %dx%d", totalWidth, maxHeight)
+ }
+
+ var lastFBO int32
+ gl.GetIntegerv(gl.FRAMEBUFFER_BINDING, &lastFBO)
+ var lastViewport [4]int32
+ gl.GetIntegerv(gl.VIEWPORT, &lastViewport[0])
+
+ gl.BindFramebuffer(gl.FRAMEBUFFER, fm.stringFBO)
+
+ var newTextureID uint32
+ gl.GenTextures(1, &newTextureID)
+ gl.BindTexture(gl.TEXTURE_2D, newTextureID)
+ gl.TexParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR)
+ gl.TexParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR)
+ gl.PixelStorei(gl.UNPACK_ALIGNMENT, 1)
+
+ gl.TexImage2D(gl.TEXTURE_2D, 0, gl.RGBA, totalWidth, maxHeight, 0, gl.RGBA, gl.UNSIGNED_BYTE, nil)
+ gl.FramebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, newTextureID, 0)
+
+ if gl.CheckFramebufferStatus(gl.FRAMEBUFFER) != gl.FRAMEBUFFER_COMPLETE {
+ gl.BindFramebuffer(gl.FRAMEBUFFER, uint32(lastFBO))
+ gl.DeleteTextures(1, &newTextureID)
+ return 0, 0, 0, fmt.Errorf("framebuffer is not complete")
+ }
+
+ gl.Viewport(0, 0, totalWidth, maxHeight)
+ gl.ClearColor(0.0, 0.0, 0.0, 0.0)
+ gl.Clear(gl.COLOR_BUFFER_BIT)
+ gl.UseProgram(shaderID)
+
+ projection := mgl32.Ortho(0, float32(totalWidth), 0, float32(maxHeight), -1, 1)
+ gl.UniformMatrix4fv(shader.LocMVPMatrix, 1, false, &projection[0])
+
+ if shader.LocTextColor != -1 {
+ gl.Uniform4f(shader.LocTextColor, 1.0, 1.0, 1.0, 1.0)
+ }
+
+ gl.ActiveTexture(gl.TEXTURE0)
+ gl.Uniform1i(shader.LocTexture, 0)
+ gl.Enable(gl.BLEND)
+ gl.BlendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA)
+ gl.BindTexture(gl.TEXTURE_2D, selectedFont.Map.FontMapTextureID)
+
+ gl.BindVertexArray(fm.stringVAO)
+ gl.BindBuffer(gl.ARRAY_BUFFER, fm.stringVBO)
+
+ var currentX float32
+ atlasW, atlasH := float32(selectedFont.Map.Width), float32(selectedFont.Map.Height)
+
+ for _, glyph := range glyphsToRender {
+ xPos := currentX
+ yPos := float32(0)
+ w, h := float32(glyph.SrcRect.W), float32(glyph.SrcRect.H)
+ u0 := float32(glyph.SrcRect.X) / atlasW
+ v0 := float32(glyph.SrcRect.Y) / atlasH
+ u1 := u0 + w/atlasW
+ v1 := v0 + h/atlasH
+ vertices := []float32{
+ xPos, yPos + h, u0, v0,
+ xPos, yPos, u0, v1,
+ xPos + w, yPos, u1, v1,
+ xPos, yPos + h, u0, v0,
+ xPos + w, yPos, u1, v1,
+ xPos + w, yPos + h, u1, v0,
+ }
+ gl.BufferSubData(gl.ARRAY_BUFFER, 0, len(vertices)*4, gl.Ptr(vertices))
+ gl.DrawArrays(gl.TRIANGLES, 0, 6)
+ currentX += float32(glyph.Advance)
+ }
+
+ gl.BindVertexArray(0)
+ gl.BindFramebuffer(gl.FRAMEBUFFER, uint32(lastFBO))
+ gl.Viewport(lastViewport[0], lastViewport[1], lastViewport[2], lastViewport[3])
+ gl.Disable(gl.BLEND)
+
+ return newTextureID, totalWidth, maxHeight, nil
+}
+
+// NewCreateStringTexture does the same thing as CreateStringTexture, except that it returns the width in pixels used by the glyphs
+// in the texture, rather than the width of the texture itself. This can be used for trimming.
+func (fm *FontManager) NewCreateStringTexture(fontName string, text string, shader *shaderManager.Shader) (textureID uint32, width float32, height int32, err error) {
+ shaderID := shader.ProgramID
+ if fontName == "" || text == "" {
+ return 0, 0, 0, fmt.Errorf("font name and text cannot be blank")
+ }
+
+ selectedFont, ok := fm.Fonts[fontName]
+ if !ok || selectedFont.Map == nil {
+ return 0, 0, 0, fmt.Errorf("font '%s' not found or its font map is not created", fontName)
+ }
+
+ var totalWidth, maxHeight int32
+ glyphsToRender := make([]Glyph, 0, len(text))
+
+ for _, r := range text {
+ g, ok := selectedFont.Map.Glyphs[r]
+ if !ok {
+ g = selectedFont.Map.Glyphs['?'] // Fallback
+ }
+ totalWidth += g.SrcRect.W + selectedFont.Map.padding
+ if g.SrcRect.H > maxHeight {
+ maxHeight = g.SrcRect.H
+ }
+ glyphsToRender = append(glyphsToRender, g)
+ }
+
+ if totalWidth <= 0 || maxHeight <= 0 {
+ return 0, 0, 0, fmt.Errorf("calculated texture dimensions are invalid: %dx%d", totalWidth, maxHeight)
+ }
+
+ var lastFBO int32
+ gl.GetIntegerv(gl.FRAMEBUFFER_BINDING, &lastFBO)
+ var lastViewport [4]int32
+ gl.GetIntegerv(gl.VIEWPORT, &lastViewport[0])
+
+ gl.BindFramebuffer(gl.FRAMEBUFFER, fm.stringFBO)
+
+ var newTextureID uint32
+ gl.GenTextures(1, &newTextureID)
+ gl.BindTexture(gl.TEXTURE_2D, newTextureID)
+ gl.TexParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR)
+ gl.TexParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR)
+ gl.PixelStorei(gl.UNPACK_ALIGNMENT, 1)
+
+ gl.TexImage2D(gl.TEXTURE_2D, 0, gl.RGBA, totalWidth, maxHeight, 0, gl.RGBA, gl.UNSIGNED_BYTE, nil)
+ gl.FramebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, newTextureID, 0)
+
+ if gl.CheckFramebufferStatus(gl.FRAMEBUFFER) != gl.FRAMEBUFFER_COMPLETE {
+ gl.BindFramebuffer(gl.FRAMEBUFFER, uint32(lastFBO))
+ gl.DeleteTextures(1, &newTextureID)
+ return 0, 0, 0, fmt.Errorf("framebuffer is not complete")
+ }
+
+ gl.Viewport(0, 0, totalWidth, maxHeight)
+ gl.ClearColor(0.0, 0.0, 0.0, 0.0)
+ gl.Clear(gl.COLOR_BUFFER_BIT)
+ gl.UseProgram(shaderID)
+
+ projection := mgl32.Ortho(0, float32(totalWidth), 0, float32(maxHeight), -1, 1)
+ gl.UniformMatrix4fv(shader.LocMVPMatrix, 1, false, &projection[0])
+
+ if shader.LocTextColor != -1 {
+ gl.Uniform4f(shader.LocTextColor, 1.0, 1.0, 1.0, 1.0)
+ }
+
+ gl.ActiveTexture(gl.TEXTURE0)
+ gl.Uniform1i(shader.LocTexture, 0)
+ gl.Enable(gl.BLEND)
+ gl.BlendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA)
+ gl.BindTexture(gl.TEXTURE_2D, selectedFont.Map.FontMapTextureID)
+
+ gl.BindVertexArray(fm.stringVAO)
+ gl.BindBuffer(gl.ARRAY_BUFFER, fm.stringVBO)
+
+ var currentX float32
+ atlasW, atlasH := float32(selectedFont.Map.Width), float32(selectedFont.Map.Height)
+
+ for _, glyph := range glyphsToRender {
+ xPos := currentX
+ yPos := float32(0)
+ w, h := float32(glyph.SrcRect.W), float32(glyph.SrcRect.H)
+ u0 := float32(glyph.SrcRect.X) / atlasW
+ v0 := float32(glyph.SrcRect.Y) / atlasH
+ u1 := u0 + w/atlasW
+ v1 := v0 + h/atlasH
+ vertices := []float32{
+ xPos, yPos + h, u0, v0,
+ xPos, yPos, u0, v1,
+ xPos + w, yPos, u1, v1,
+ xPos, yPos + h, u0, v0,
+ xPos + w, yPos, u1, v1,
+ xPos + w, yPos + h, u1, v0,
+ }
+ gl.BufferSubData(gl.ARRAY_BUFFER, 0, len(vertices)*4, gl.Ptr(vertices))
+ gl.DrawArrays(gl.TRIANGLES, 0, 6)
+ currentX += float32(glyph.Advance)
+ }
+
+ usedWidth := float32(currentX)
+
+ gl.BindVertexArray(0)
+ gl.BindFramebuffer(gl.FRAMEBUFFER, uint32(lastFBO))
+ gl.Viewport(lastViewport[0], lastViewport[1], lastViewport[2], lastViewport[3])
+ gl.Disable(gl.BLEND)
+
+ return newTextureID, usedWidth, maxHeight, nil
+}
diff --git a/archive/internal/graphics/graphics.go b/archive/internal/graphics/graphics.go
new file mode 100644
index 0000000..89d158c
--- /dev/null
+++ b/archive/internal/graphics/graphics.go
@@ -0,0 +1,128 @@
+package graphics
+
+import (
+ "fmt"
+ "log"
+
+ "github.com/go-gl/gl/v3.3-core/gl"
+ "github.com/veandco/go-sdl2/sdl"
+)
+
+// CreateTextureFromSurface uploads an SDL surface to an OpenGL texture and returns the texture ID.
+func CreateTextureFromSurface(surface *sdl.Surface) (uint32, error) {
+ if surface == nil {
+ return 0, fmt.Errorf("CreateTextureFromSurface: input surface is nil")
+ }
+
+ var textureID uint32
+ var err error
+
+ surfaceToUpload := surface
+ var convertedSurface *sdl.Surface = nil
+
+ sdlFormatEnum := surface.Format.Format
+ var dataFormat uint32
+ var internalFormat int32 = gl.RGBA8
+
+ if sdlFormatEnum == sdl.PIXELFORMAT_INDEX8 {
+ convertedSurface, err = surface.ConvertFormat(sdl.PIXELFORMAT_ARGB8888, 0)
+ if err != nil {
+ return 0, fmt.Errorf("failed to convert INDEX8 surface to ARGB8888: %w", err)
+ }
+ defer convertedSurface.Free()
+
+ surfaceToUpload = convertedSurface
+ sdlFormatEnum = surfaceToUpload.Format.Format
+ }
+
+ switch sdlFormatEnum {
+ case sdl.PIXELFORMAT_ARGB8888:
+ dataFormat = gl.BGRA
+ case sdl.PIXELFORMAT_ABGR8888:
+ dataFormat = gl.RGBA
+ case sdl.PIXELFORMAT_RGBA8888:
+ dataFormat = gl.RGBA
+ case sdl.PIXELFORMAT_BGRA8888:
+ dataFormat = gl.BGRA
+ default:
+ return 0, fmt.Errorf("unhandled SDL pixel format for OpenGL upload: %s", sdl.GetPixelFormatName(uint(sdlFormatEnum)))
+ }
+
+ for errCode := gl.GetError(); errCode != gl.NO_ERROR; errCode = gl.GetError() {
+ log.Printf("OpenGL error pending before GenTextures: 0x%X", errCode)
+ }
+
+ gl.GenTextures(1, &textureID)
+ if errCode := gl.GetError(); errCode != gl.NO_ERROR {
+ return 0, fmt.Errorf("OpenGL error 0x%X after GenTextures", errCode)
+ }
+ if textureID == 0 {
+ return 0, fmt.Errorf("gl.GenTextures returned textureID 0")
+ }
+
+ gl.BindTexture(gl.TEXTURE_2D, textureID)
+
+ gl.TexParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST)
+ gl.TexParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST)
+ gl.TexParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE)
+ gl.TexParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE)
+
+ gl.PixelStorei(gl.UNPACK_ALIGNMENT, 1)
+
+ expectedPitch := surfaceToUpload.W * int32(surfaceToUpload.Format.BytesPerPixel)
+ if int32(surfaceToUpload.Pitch) != expectedPitch {
+ gl.PixelStorei(gl.UNPACK_ROW_LENGTH, surfaceToUpload.Pitch/int32(surfaceToUpload.Format.BytesPerPixel))
+ } else {
+ gl.PixelStorei(gl.UNPACK_ROW_LENGTH, 0)
+ }
+
+ gl.TexImage2D(
+ gl.TEXTURE_2D,
+ 0,
+ internalFormat,
+ surfaceToUpload.W,
+ surfaceToUpload.H,
+ 0,
+ dataFormat,
+ gl.UNSIGNED_BYTE,
+ gl.Ptr(surfaceToUpload.Pixels()),
+ )
+
+ gl.PixelStorei(gl.UNPACK_ALIGNMENT, 4)
+ gl.PixelStorei(gl.UNPACK_ROW_LENGTH, 0)
+
+ if glErr := gl.GetError(); glErr != gl.NO_ERROR {
+ gl.DeleteTextures(1, &textureID)
+ return 0, fmt.Errorf("OpenGL error 0x%X after TexImage2D", glErr)
+ }
+
+ gl.BindTexture(gl.TEXTURE_2D, 0)
+ return textureID, nil
+}
+
+// CheckGLError queries OpenGL for errors and returns the first one found.
+func CheckGLError() error {
+ errCode := gl.GetError()
+ if errCode == gl.NO_ERROR {
+ return nil
+ }
+
+ switch errCode {
+ case gl.INVALID_ENUM:
+ return fmt.Errorf("INVALID_ENUM")
+ case gl.INVALID_VALUE:
+ return fmt.Errorf("INVALID_VALUE")
+ case gl.INVALID_OPERATION:
+ return fmt.Errorf("INVALID_OPERATION")
+ case gl.STACK_OVERFLOW:
+ return fmt.Errorf("STACK_OVERFLOW")
+ case gl.STACK_UNDERFLOW:
+ return fmt.Errorf("STACK_UNDERFLOW")
+ case gl.OUT_OF_MEMORY:
+ return fmt.Errorf("OUT_OF_MEMORY")
+ case gl.INVALID_FRAMEBUFFER_OPERATION:
+ return fmt.Errorf("INVALID_FRAMEBUFFER_OPERATION")
+ default:
+ return fmt.Errorf("Unknown GL error: 0x%X", errCode)
+ }
+}
diff --git a/archive/internal/graphics/virtual_framebuffer.go b/archive/internal/graphics/virtual_framebuffer.go
new file mode 100644
index 0000000..27d3663
--- /dev/null
+++ b/archive/internal/graphics/virtual_framebuffer.go
@@ -0,0 +1,193 @@
+package graphics
+
+import (
+ "fmt"
+
+ "github.com/go-gl/gl/v3.3-core/gl"
+)
+
+const (
+ VirtualWidth int32 = 1920
+ VirtualHeight int32 = 1080
+)
+
+var (
+ vfbo uint32
+ vfboTexture uint32
+ vfboDepthStencil uint32
+ blitVAO uint32
+ blitVBO uint32
+ blitShaderProg uint32
+ nativeW, nativeH int32
+)
+
+// InitVirtualFramebuffer creates the FBO at virtual resolution and the blit shader.
+// Call after OpenGL context is created.
+func InitVirtualFramebuffer(displayW, displayH int32) error {
+ nativeW = displayW
+ nativeH = displayH
+
+ // --- FBO setup ---
+ gl.GenFramebuffers(1, &vfbo)
+ gl.BindFramebuffer(gl.FRAMEBUFFER, vfbo)
+
+ gl.GenTextures(1, &vfboTexture)
+ gl.BindTexture(gl.TEXTURE_2D, vfboTexture)
+ gl.TexImage2D(gl.TEXTURE_2D, 0, gl.RGBA8, VirtualWidth, VirtualHeight, 0, gl.RGBA, gl.UNSIGNED_BYTE, nil)
+ gl.TexParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR)
+ gl.TexParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR)
+ gl.FramebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, vfboTexture, 0)
+
+ // Depth/stencil renderbuffer
+ gl.GenRenderbuffers(1, &vfboDepthStencil)
+ gl.BindRenderbuffer(gl.RENDERBUFFER, vfboDepthStencil)
+ gl.RenderbufferStorage(gl.RENDERBUFFER, gl.DEPTH24_STENCIL8, VirtualWidth, VirtualHeight)
+ gl.FramebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.RENDERBUFFER, vfboDepthStencil)
+
+ if status := gl.CheckFramebufferStatus(gl.FRAMEBUFFER); status != gl.FRAMEBUFFER_COMPLETE {
+ return fmt.Errorf("virtual framebuffer incomplete: 0x%X", status)
+ }
+
+ gl.BindFramebuffer(gl.FRAMEBUFFER, 0)
+
+ // --- Fullscreen quad ---
+ vertices := []float32{
+ // pos (x,y) texcoord (u,v)
+ -1, -1, 0, 0,
+ 1, -1, 1, 0,
+ -1, 1, 0, 1,
+ 1, 1, 1, 1,
+ }
+
+ gl.GenVertexArrays(1, &blitVAO)
+ gl.GenBuffers(1, &blitVBO)
+ gl.BindVertexArray(blitVAO)
+ gl.BindBuffer(gl.ARRAY_BUFFER, blitVBO)
+ gl.BufferData(gl.ARRAY_BUFFER, len(vertices)*4, gl.Ptr(vertices), gl.STATIC_DRAW)
+
+ gl.EnableVertexAttribArray(0)
+ gl.VertexAttribPointerWithOffset(0, 2, gl.FLOAT, false, 4*4, 0)
+ gl.EnableVertexAttribArray(1)
+ gl.VertexAttribPointerWithOffset(1, 2, gl.FLOAT, false, 4*4, 2*4)
+
+ gl.BindVertexArray(0)
+
+ // --- Blit shader ---
+ var err error
+ blitShaderProg, err = compileBlitShader()
+ if err != nil {
+ return fmt.Errorf("blit shader compilation failed: %w", err)
+ }
+
+ return nil
+}
+
+// BeginVirtualRender binds the FBO so all subsequent draws go to the virtual 1080p buffer.
+func BeginVirtualRender() {
+ gl.BindFramebuffer(gl.FRAMEBUFFER, vfbo)
+ gl.Viewport(0, 0, VirtualWidth, VirtualHeight)
+}
+
+// BlitToScreen draws the virtual buffer to the actual screen at native resolution.
+func BlitToScreen() {
+ gl.BindFramebuffer(gl.FRAMEBUFFER, 0)
+ gl.Viewport(0, 0, nativeW, nativeH)
+ gl.ClearColor(0, 0, 0, 1)
+ gl.Clear(gl.COLOR_BUFFER_BIT)
+
+ gl.UseProgram(blitShaderProg)
+ gl.ActiveTexture(gl.TEXTURE0)
+ gl.BindTexture(gl.TEXTURE_2D, vfboTexture)
+
+ gl.BindVertexArray(blitVAO)
+ gl.DrawArrays(gl.TRIANGLE_STRIP, 0, 4)
+ gl.BindVertexArray(0)
+}
+
+// DestroyVirtualFramebuffer cleans up all FBO resources.
+func DestroyVirtualFramebuffer() {
+ if blitShaderProg != 0 {
+ gl.DeleteProgram(blitShaderProg)
+ }
+ if blitVBO != 0 {
+ gl.DeleteBuffers(1, &blitVBO)
+ }
+ if blitVAO != 0 {
+ gl.DeleteVertexArrays(1, &blitVAO)
+ }
+ if vfboDepthStencil != 0 {
+ gl.DeleteRenderbuffers(1, &vfboDepthStencil)
+ }
+ if vfboTexture != 0 {
+ gl.DeleteTextures(1, &vfboTexture)
+ }
+ if vfbo != 0 {
+ gl.DeleteFramebuffers(1, &vfbo)
+ }
+}
+
+func compileBlitShader() (uint32, error) {
+ vertSrc := `#version 330 core
+layout(location = 0) in vec2 aPos;
+layout(location = 1) in vec2 aTexCoord;
+out vec2 vTexCoord;
+void main() {
+ vTexCoord = aTexCoord;
+ gl_Position = vec4(aPos, 0.0, 1.0);
+}` + "\x00"
+
+ fragSrc := `#version 330 core
+in vec2 vTexCoord;
+out vec4 FragColor;
+uniform sampler2D screenTexture;
+void main() {
+ FragColor = texture(screenTexture, vTexCoord);
+}` + "\x00"
+
+ vertShader, err := compileShader(vertSrc, gl.VERTEX_SHADER)
+ if err != nil {
+ return 0, err
+ }
+ fragShader, err := compileShader(fragSrc, gl.FRAGMENT_SHADER)
+ if err != nil {
+ return 0, err
+ }
+
+ prog := gl.CreateProgram()
+ gl.AttachShader(prog, vertShader)
+ gl.AttachShader(prog, fragShader)
+ gl.LinkProgram(prog)
+
+ var status int32
+ gl.GetProgramiv(prog, gl.LINK_STATUS, &status)
+ if status == gl.FALSE {
+ var logLen int32
+ gl.GetProgramiv(prog, gl.INFO_LOG_LENGTH, &logLen)
+ logStr := make([]byte, logLen)
+ gl.GetProgramInfoLog(prog, logLen, nil, &logStr[0])
+ return 0, fmt.Errorf("shader link error: %s", string(logStr))
+ }
+
+ gl.DeleteShader(vertShader)
+ gl.DeleteShader(fragShader)
+ return prog, nil
+}
+
+func compileShader(src string, shaderType uint32) (uint32, error) {
+ shader := gl.CreateShader(shaderType)
+ csrc, free := gl.Strs(src)
+ gl.ShaderSource(shader, 1, csrc, nil)
+ free()
+ gl.CompileShader(shader)
+
+ var status int32
+ gl.GetShaderiv(shader, gl.COMPILE_STATUS, &status)
+ if status == gl.FALSE {
+ var logLen int32
+ gl.GetShaderiv(shader, gl.INFO_LOG_LENGTH, &logLen)
+ logStr := make([]byte, logLen)
+ gl.GetShaderInfoLog(shader, logLen, nil, &logStr[0])
+ return 0, fmt.Errorf("shader compile error: %s", string(logStr))
+ }
+ return shader, nil
+}
diff --git a/archive/internal/keybinds/keybinds.go b/archive/internal/keybinds/keybinds.go
new file mode 100644
index 0000000..96b3636
--- /dev/null
+++ b/archive/internal/keybinds/keybinds.go
@@ -0,0 +1,79 @@
+// package keybinds provides keybind functionality for the entire application
+package keybinds
+
+import (
+ "github.com/veandco/go-sdl2/sdl"
+)
+
+// KeyCombo represents a combination of a key and it's active modifier.
+type KeyCombo struct {
+ Key sdl.Keycode
+ Mod sdl.Keymod
+}
+
+// Binds contains all currently registered Keybinds.
+var Binds = make(map[KeyCombo]func())
+
+// Enabled controls whether PerformAction dispatches keybinds. Set to false
+// to temporarily suppress all global keybinds (e.g. during a modal page).
+var Enabled = true
+
+// Regiser registers a new keybind in Binds
+func Register(k sdl.Keycode, m sdl.Keymod, action func()) {
+ mod := NormalizeModifiers(m)
+ newCombo := KeyCombo{k, mod}
+ _, ok := Binds[newCombo]
+ if ok {
+ }
+ Binds[newCombo] = action
+}
+
+// BindKey adds a new KeyCombo and Function (the action to take) to the keybinds.Binds
+func BindKey(k KeyCombo, f func()) {
+ k.Mod = NormalizeModifiers(k.Mod)
+ Binds[k] = f
+}
+
+// UnbindKey removes a KeyCombo from the available binds
+func UnbindKey(k KeyCombo) {
+ k.Mod = NormalizeModifiers(k.Mod)
+ delete(Binds, k)
+}
+
+func PerformAction(event sdl.Event) {
+ if !Enabled {
+ return
+ }
+ switch e := event.(type) {
+ case *sdl.KeyboardEvent:
+ if e.Type == sdl.KEYDOWN {
+ key := e.Keysym.Sym
+ rawMod := e.Keysym.Mod
+ mod := NormalizeModifiers(sdl.Keymod(rawMod))
+ combo := KeyCombo{key, mod}
+ action, ok := Binds[combo]
+ if ok {
+ action()
+ }
+ }
+ }
+}
+
+// NormalizeModifiers converts a raw SDL modifier bitmask into a canonical form
+// focusing on common modifiers (SHIFT, CTRL, ALT, GUI) and ignoring others like CapsLock.
+func NormalizeModifiers(mod sdl.Keymod) sdl.Keymod {
+ var normalized sdl.Keymod = sdl.KMOD_NONE
+ if mod&sdl.KMOD_SHIFT != 0 {
+ normalized |= sdl.KMOD_SHIFT
+ }
+ if mod&sdl.KMOD_CTRL != 0 {
+ normalized |= sdl.KMOD_CTRL
+ }
+ if mod&sdl.KMOD_ALT != 0 {
+ normalized |= sdl.KMOD_ALT
+ }
+ if mod&sdl.KMOD_GUI != 0 {
+ normalized |= sdl.KMOD_GUI
+ }
+ return normalized
+}
diff --git a/archive/internal/license/license.go b/archive/internal/license/license.go
new file mode 100644
index 0000000..dbee2cf
--- /dev/null
+++ b/archive/internal/license/license.go
@@ -0,0 +1,73 @@
+package license
+
+import (
+ "encoding/json"
+ "fmt"
+ "net/http"
+ "net/url"
+ "path"
+ "time"
+)
+
+var Level int
+
+type Validator struct {
+ client *http.Client
+ apiURL string
+ apiPath string
+}
+
+type Response struct {
+ Key string `json:"key"`
+ Email string `json:"email"`
+ Active bool `json:"active"`
+ Type string `json:"type"`
+ Level string `json:"level"`
+ LastCheck time.Time `json:"lastCheck"`
+ NewCheck time.Time `json:"newCheck"`
+}
+
+func NewValidator(apiURL, apiPath string) *Validator {
+ return &Validator{
+ client: &http.Client{
+ Timeout: 10 * time.Second,
+ Transport: &http.Transport{
+ MaxIdleConns: 10,
+ IdleConnTimeout: 30 * time.Second,
+ DisableCompression: true,
+ },
+ },
+ apiURL: apiURL,
+ apiPath: apiPath,
+ }
+}
+
+func (v *Validator) Validate(key, email string) (*Response, error) {
+ u, err := url.Parse(v.apiURL)
+ if err != nil {
+ return nil, err
+ }
+ u.Path = path.Join(u.Path, v.apiPath)
+
+ q := u.Query()
+ q.Set("licenseKey", key)
+ q.Set("emailAddress", email)
+ u.RawQuery = q.Encode()
+
+ resp, err := v.client.Get(u.String())
+ if err != nil {
+ return nil, fmt.Errorf("request failed: %w", err)
+ }
+ defer resp.Body.Close()
+
+ if resp.StatusCode != http.StatusOK {
+ return nil, fmt.Errorf("unexpected status: %w", err)
+ }
+
+ var result Response
+ if err := json.NewDecoder(resp.Body).Decode(&result); err != nil {
+ return nil, fmt.Errorf("failed ot decode response: %w", err)
+ }
+
+ return &result, nil
+}
diff --git a/archive/internal/logger/logger.go b/archive/internal/logger/logger.go
new file mode 100644
index 0000000..8214b06
--- /dev/null
+++ b/archive/internal/logger/logger.go
@@ -0,0 +1,231 @@
+package logger
+
+import (
+ "fmt"
+ "log"
+ "os"
+ "time"
+
+ "gorm.io/gorm"
+ "rhemawavetech.com/rhemawave/internal/db"
+)
+
+// ─── Level ───────────────────────────────────────────────────────────────────
+
+type Level int
+
+const (
+ LevelDebug Level = iota
+ LevelInfo
+ LevelWarning
+ LevelError
+ LevelFatal
+)
+
+func (l Level) String() string {
+ return [...]string{"DEBUG", "INFO", "WARNING", "ERROR", "FATAL"}[l]
+}
+
+// ─── Internal entry type ──────────────────────────────────────────────────────
+
+type entry struct {
+ level Level
+ message string
+ timestamp time.Time
+ fatal bool
+}
+
+// ─── Package state ────────────────────────────────────────────────────────────
+
+var (
+ SetLevel Level = LevelInfo
+ console = log.New(os.Stderr, "", 0)
+
+ ch chan entry // unbuffered send is a bug; always buffered
+ done chan struct{}
+ db_ *gorm.DB
+ file *os.File
+)
+
+func init() {
+ ch = make(chan entry, 4096)
+ done = make(chan struct{})
+ go drain()
+}
+
+// ─── Configuration ────────────────────────────────────────────────────────────
+
+// AddFile attaches or replaces the file backend. Safe to call at any time.
+func AddFile(path string) error {
+ f, err := os.OpenFile(path, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0o644)
+ if err != nil {
+ return fmt.Errorf("logger: open file: %w", err)
+ }
+ // Send a sentinel that carries the new file handle.
+ // We do this through the channel so the drain goroutine owns
+ // all file state — no mutex needed.
+ fileSwapCh <- f
+ return nil
+}
+
+// AddDatabase attaches or replaces the database backend. Safe to call at any time.
+func AddDatabase(d *gorm.DB) {
+ dbSwapCh <- d
+}
+
+// Close drains remaining entries and shuts down the logger.
+// Call this with defer in main().
+func Close() {
+ close(done)
+ <-drainDone // wait for drain goroutine to finish flushing
+ if file != nil {
+ file.Close()
+ file = nil
+ }
+}
+
+// ─── Swap channels (owned exclusively by drain goroutine) ────────────────────
+
+var (
+ fileSwapCh = make(chan *os.File, 1)
+ dbSwapCh = make(chan *gorm.DB, 1)
+ drainDone = make(chan struct{})
+)
+
+// ─── Drain goroutine ──────────────────────────────────────────────────────────
+//
+// This is the ONLY goroutine that touches file, db_, or does DB writes.
+// Everything else just sends to ch.
+
+func drain() {
+ defer close(drainDone)
+
+ batch := make([]entry, 0, 64)
+ ticker := time.NewTicker(250 * time.Millisecond)
+ defer ticker.Stop()
+
+ flush := func() {
+ if len(batch) == 0 {
+ return
+ }
+ writeBatchToDB(batch)
+ batch = batch[:0]
+ }
+
+ for {
+ select {
+
+ // New log entry
+ case e := <-ch:
+ writeToFile(e)
+ if db_ != nil {
+ batch = append(batch, e)
+ if len(batch) >= 64 {
+ flush()
+ }
+ }
+
+ // Periodic DB flush so low-volume logs don't sit in the batch forever
+ case <-ticker.C:
+ flush()
+
+ // Hot-swap the file backend
+ case f := <-fileSwapCh:
+ if file != nil {
+ file.Close()
+ }
+ file = f
+
+ // Hot-swap the DB backend
+ case d := <-dbSwapCh:
+ flush() // flush any pending entries to the old db first
+ db_ = d
+ console.Println("logger: database backend attached")
+
+ // Shutdown: drain what's left, then exit
+ case <-done:
+ // Pull any entries still sitting in the channel
+ for len(ch) > 0 {
+ e := <-ch
+ writeToFile(e)
+ batch = append(batch, e)
+ }
+ flush()
+ return
+ }
+ }
+}
+
+// ─── Writers (called only from drain goroutine) ───────────────────────────────
+
+func writeToFile(e entry) {
+ line := formatLine(e)
+ if file != nil {
+ fmt.Fprintln(file, line)
+ }
+}
+
+func writeBatchToDB(batch []entry) {
+ if db_ == nil || len(batch) == 0 {
+ return
+ }
+ records := make([]db.Log, len(batch))
+ for i, e := range batch {
+ records[i] = db.Log{
+ Timestamp: e.timestamp.UnixMilli(),
+ Level: e.level.String(),
+ Message: e.message,
+ }
+ }
+ // Single INSERT ... VALUES (...), (...), (...) instead of N individual saves.
+ if result := db_.CreateInBatches(records, 64); result.Error != nil {
+ console.Printf("logger: db batch write failed: %v\n", result.Error)
+ }
+}
+
+func formatLine(e entry) string {
+ return fmt.Sprintf("%s [%s] %s",
+ e.timestamp.Format("2006-01-02 15:04:05.000"),
+ e.level,
+ e.message,
+ )
+}
+
+// ─── Public API ───────────────────────────────────────────────────────────────
+
+func logMsg(level Level, fatal bool, format string, args ...any) {
+ if level == LevelDebug && SetLevel != LevelDebug {
+ return
+ }
+ e := entry{
+ level: level,
+ message: fmt.Sprintf(format, args...),
+ timestamp: time.Now(), // captured here, in the caller's goroutine
+ fatal: fatal,
+ }
+
+ // Console is synchronous — log.Logger is internally mutex-protected,
+ // so this is safe from any goroutine and gives you immediate output.
+ console.Println(formatLine(e))
+
+ // Non-blocking send: if the buffer is full, we drop rather than deadlock.
+ // 4096 entries of headroom means this should never happen in practice.
+ select {
+ case ch <- e:
+ default:
+ console.Println("logger: channel full, entry dropped")
+ }
+
+ if fatal {
+ // Give the drain goroutine a moment to flush before we exit.
+ // Close() is cleaner but Fatal has to exit immediately.
+ time.Sleep(150 * time.Millisecond)
+ os.Exit(1)
+ }
+}
+
+func Debug(format string, args ...any) { logMsg(LevelDebug, false, format, args...) }
+func Info(format string, args ...any) { logMsg(LevelInfo, false, format, args...) }
+func Warning(format string, args ...any) { logMsg(LevelWarning, false, format, args...) }
+func Error(format string, args ...any) { logMsg(LevelError, false, format, args...) }
+func Fatal(format string, args ...any) { logMsg(LevelFatal, true, format, args...) }
diff --git a/archive/internal/mixer/mixer.go b/archive/internal/mixer/mixer.go
new file mode 100644
index 0000000..5d4f086
--- /dev/null
+++ b/archive/internal/mixer/mixer.go
@@ -0,0 +1,496 @@
+// internal/audio/mixer/mixer.go
+package mixer
+
+import (
+ "bufio"
+ "bytes"
+ "errors"
+ "fmt"
+ "os/exec"
+ "strconv"
+ "strings"
+ "sync"
+
+ "github.com/veandco/go-sdl2/mix"
+ "github.com/veandco/go-sdl2/sdl"
+ "rhemawavetech.com/rhemawave/internal/db"
+ "rhemawavetech.com/rhemawave/internal/logger"
+)
+
+var (
+ mu sync.Mutex
+ inited bool
+ deviceOpen bool
+ deviceName string
+
+ currentMusic *mix.Music
+ currentPath string
+ currentLoops int // 0 = once, -1 = forever
+
+ // Config knobs (could be made public or read from your config)
+ defaultFreq = 48000
+ defaultFormat = uint16(sdl.AUDIO_F32)
+ defaultChannels = 2
+ defaultChunkSize = 1024
+ defaultAllow = sdl.AUDIO_ALLOW_ANY_CHANGE
+
+ refreshCacheCallback func()
+)
+
+type Sink struct {
+ ID int
+ Name string
+ Volume float64
+ IsDefault bool
+}
+
+// Init initializes SDL audio + SDL_mixer. Safe to call multiple times.
+func Init(cfg *db.AppConfig, onUpdate func()) error {
+ mu.Lock()
+ defer mu.Unlock()
+ if inited {
+ return nil
+ }
+
+ refreshCacheCallback = onUpdate
+
+ if err := sdl.InitSubSystem(sdl.INIT_AUDIO); err != nil {
+ return fmt.Errorf("SDL audio init failed: %w", err)
+ }
+
+ // FIX 1: Initialize MP3 and OGG decoders
+ err := mix.Init(mix.INIT_MP3 | mix.INIT_OGG)
+ if err != nil {
+ logger.Error("Failed to initialize MP3/OGG support: %v", err)
+ }
+
+ deviceName := cfg.SelectedAudioDevice
+ if deviceName == "default" {
+ deviceName = ""
+ }
+ if err := openDeviceLocked(deviceName); err != nil {
+ sdl.QuitSubSystem(sdl.INIT_AUDIO)
+ return err
+ }
+
+ SetAllSinkVolumes(cfg.SavedVolume)
+
+ inited = true
+ return nil
+}
+
+// openDeviceLocked tries to open the named device; if it fails and the name wasn't empty, falls back to default.
+func openDeviceLocked(name string) error {
+ if err := mix.OpenAudioDevice(defaultFreq, defaultFormat, defaultChannels, defaultChunkSize, name, defaultAllow); err != nil {
+ if name != "" {
+ // Log the failure of the requested device
+
+ // Fallback to default device
+ if err2 := mix.OpenAudioDevice(defaultFreq, defaultFormat, defaultChannels, defaultChunkSize, "", defaultAllow); err2 != nil {
+ return fmt.Errorf("failed to open device %q and default device: %w", name, err2)
+ }
+ deviceName = "" // actually opened default
+ } else {
+ return fmt.Errorf("failed to open default audio device: %w", err)
+ }
+ } else {
+ if name != "" {
+ } else {
+ }
+ deviceName = name
+ }
+ deviceOpen = true
+ return nil
+}
+
+// Play loads a WAV (as music) and plays it. If loopForever is true, loops forever.
+// If something is already playing, it stops and replaces it.
+func Play(path string, loopForever bool, cfg *db.AppConfig) error {
+ // Check if audio is enabled or disabled
+ if !cfg.AudioEnabled {
+ return nil
+ }
+
+ // Lock the mutex
+ mu.Lock()
+ defer mu.Unlock()
+
+ // Check if mixer has been initialized and that a device is open
+ if !inited {
+ logger.Error("audio mixer not initialized")
+ return errors.New("audio mixer not initialized")
+ }
+ if !deviceOpen {
+ if err := openDeviceLocked(""); err != nil {
+ return fmt.Errorf("failed to open audio device: %w", err)
+ }
+ }
+ if path == "" {
+ logger.Error("empty audio path")
+ return errors.New("empty audio path")
+ }
+
+ // Stop and free any prior music
+ mix.HaltMusic()
+ if currentMusic != nil {
+ currentMusic.Free()
+ currentMusic = nil
+ }
+
+ // Load the music file
+ m, err := mix.LoadMUS(path)
+ if err != nil {
+ return fmt.Errorf("LoadMUS(%q): %w", path, err)
+ }
+ // Set current music to the loaded music file
+ currentMusic = m
+ currentPath = path
+ if loopForever {
+ currentLoops = -1
+ } else {
+ currentLoops = 0
+ }
+
+ mix.VolumeMusic(mix.MAX_VOLUME)
+ volume := mix.VolumeMusic(-1)
+ logger.Info("Current volume is %d", volume)
+
+ if err := currentMusic.Play(currentLoops); err != nil {
+ currentMusic.Free()
+ currentMusic = nil
+ logger.Error("music.Play failed: %v", err)
+ return fmt.Errorf("music.Play: %w", err)
+ }
+ return nil
+}
+
+// Stop stops playback. If fadeMs > 0, fades out asynchronously; otherwise halts immediately.
+// It also frees the currently loaded music (so a new Play will reload).
+func Stop(fadeMs int, cfg *db.AppConfig) {
+ mu.Lock()
+ defer mu.Unlock()
+ if !inited {
+ return
+ }
+
+ if fadeMs > 0 && mix.PlayingMusic() {
+ _ = mix.FadeOutMusic(fadeMs) // async fade; we’ll still free below
+ }
+
+ mix.HaltMusic()
+ if currentMusic != nil {
+ currentMusic.Free()
+ currentMusic = nil
+ }
+ currentPath = ""
+ currentLoops = 0
+}
+
+// IsPlaying reports whether music is currently playing (or fading).
+func IsPlaying() bool {
+ mu.Lock()
+ defer mu.Unlock()
+ if !inited {
+ return false
+ }
+ return mix.PlayingMusic()
+}
+
+// SetDefaultSinkVolume sets volume 0.0–1.0 on the default sink
+func SetDefaultSinkVolume(level float64) error {
+ if level < 0 || level > 1 {
+ return fmt.Errorf("volume must be between 0.0 and 1.0, got %f", level)
+ }
+ pct := fmt.Sprintf("%.2f", level)
+ cmd := exec.Command("wpctl", "set-volume", "@DEFAULT_AUDIO_SINK@", pct)
+ if out, err := cmd.CombinedOutput(); err != nil {
+ return fmt.Errorf("wpctl failed: %w\noutput: %s", err, out)
+ }
+ return nil
+}
+
+// listSinkIDs returns just the numeric IDs of all audio sinks.
+func listSinkIDs() ([]int, error) {
+ sinks, err := listSinks()
+ if err != nil {
+ return nil, err
+ }
+ ids := make([]int, len(sinks))
+ for i, s := range sinks {
+ ids[i] = s.ID
+ }
+ return ids, nil
+}
+
+// listSinks returns full Sink info for all audio sinks.
+func listSinks() ([]Sink, error) {
+ out, err := exec.Command("wpctl", "status").Output()
+ if err != nil {
+ return nil, fmt.Errorf("wpctl status: %w", err)
+ }
+ return parseSinks(out)
+}
+
+// SetAllSinkVolumes sets volume on every audio sink found via wpctl status
+func SetAllSinkVolumes(level float64) error {
+ ids, err := listSinkIDs()
+ if err != nil {
+ return err
+ }
+ pct := fmt.Sprintf("%.2f", level)
+ for _, id := range ids {
+ cmd := exec.Command("wpctl", "set-volume", strconv.Itoa(id), pct)
+ if out, err := cmd.CombinedOutput(); err != nil {
+ return fmt.Errorf("wpctl set-volume %d failed: %w\noutput: %s", id, err, out)
+ }
+ }
+ return nil
+}
+
+// ConvertVolume converts a desired volume percentage (0%, 25%, 33%, 90%, etc) to
+// the float64 value needed to pass to SetAllSinkVolumes 0..1.0
+// Percentages should be passed as integers. 25% -> 25
+func ConvertVolume(volPerc int) float64 {
+ if volPerc == 0 {
+ return 0.0
+ }
+ return float64(volPerc) / 100.0
+}
+
+// parseSinks parses the output of `wpctl status` and extracts audio sinks.
+func parseSinks(data []byte) ([]Sink, error) {
+ var sinks []Sink
+
+ scanner := bufio.NewScanner(bytes.NewReader(data))
+
+ inAudioSection := false
+ inSinksSection := false
+
+ for scanner.Scan() {
+ line := scanner.Text()
+ stripped := strings.TrimLeft(line, " │├└─")
+
+ // Detect top-level sections: "Audio", "Video", "Settings", etc.
+ // These are lines with no leading tree characters.
+ if !strings.HasPrefix(line, " ") && !strings.HasPrefix(line, "│") {
+ inAudioSection = strings.TrimSpace(line) == "Audio"
+ inSinksSection = false
+ continue
+ }
+
+ if !inAudioSection {
+ continue
+ }
+
+ // Detect subsection headers within Audio
+ if strings.Contains(stripped, "Sinks:") {
+ inSinksSection = true
+ continue
+ }
+ // Any other subsection header resets sink parsing
+ if strings.HasSuffix(strings.TrimSpace(stripped), ":") {
+ inSinksSection = false
+ continue
+ }
+
+ if !inSinksSection {
+ continue
+ }
+
+ sink, ok := parseSinkLine(stripped)
+ if ok {
+ sinks = append(sinks, sink)
+ }
+ }
+
+ if err := scanner.Err(); err != nil {
+ return nil, fmt.Errorf("scanning wpctl output: %w", err)
+ }
+
+ return sinks, nil
+}
+
+// parseSinkLine parses a single sink entry line like:
+//
+// "*51. USB Audio [vol: 1.00]"
+// "33. Built-in Audio Analog Stereo [vol: 0.65]"
+func parseSinkLine(s string) (Sink, bool) {
+ s = strings.TrimSpace(s)
+ if s == "" {
+ return Sink{}, false
+ }
+
+ var sink Sink
+
+ // Leading '*' marks the default sink
+ if strings.HasPrefix(s, "*") {
+ sink.IsDefault = true
+ s = strings.TrimPrefix(s, "*")
+ s = strings.TrimSpace(s)
+ }
+
+ // Expect ". ..."
+ dotIdx := strings.Index(s, ".")
+ if dotIdx < 0 {
+ return Sink{}, false
+ }
+
+ idStr := strings.TrimSpace(s[:dotIdx])
+ id, err := strconv.Atoi(idStr)
+ if err != nil {
+ return Sink{}, false
+ }
+ sink.ID = id
+
+ rest := strings.TrimSpace(s[dotIdx+1:])
+
+ // Extract [vol: X.XX] if present
+ volStart := strings.Index(rest, "[vol:")
+ if volStart >= 0 {
+ sink.Name = strings.TrimSpace(rest[:volStart])
+ volPart := rest[volStart:]
+ // "[vol: 0.65]" or "[vol: 0.65 MUTED]"
+ volPart = strings.TrimPrefix(volPart, "[vol:")
+ volPart = strings.TrimRight(volPart, "]")
+ volPart = strings.TrimSpace(volPart)
+ fields := strings.Fields(volPart)
+ if len(fields) > 0 {
+ v, err := strconv.ParseFloat(fields[0], 64)
+ if err == nil {
+ sink.Volume = v
+ }
+ }
+ } else {
+ sink.Name = strings.TrimSpace(rest)
+ }
+
+ return sink, true
+}
+
+// ListDevices returns the list of available output device names (from core SDL).
+func ListDevices() []string {
+ mu.Lock()
+ defer mu.Unlock()
+ n := sdl.GetNumAudioDevices(false)
+ if n <= 0 {
+ return nil
+ }
+ out := make([]string, 0, n)
+ for i := 0; i < n; i++ {
+ if name := sdl.GetAudioDeviceName(i, false); name != "" {
+ out = append(out, name)
+ }
+ }
+ return out
+}
+
+// CurrentDevice returns the last requested/opened device name ("" means default).
+func CurrentDevice() string {
+ return deviceName
+}
+
+// SwitchDevice switches output devices, preserving volume and resuming playback of the current track/loop state if any.
+func SwitchDevice(newName string, cfg *db.AppConfig) error {
+ mu.Lock()
+ defer mu.Unlock()
+
+ if !inited {
+ return errors.New("audio mixer not initialized")
+ }
+
+ // Log device switch attempt
+ // Automatically defaults to "system default"
+ oldDevice := CurrentDevice() // Which device is to be closed
+ // SDL expects "" for default device, not "system default"
+ if newName == "" { // Which device is being switched to?
+ newName = ""
+ }
+
+ // Capture current state
+ wasPlaying := mix.PlayingMusic()
+ savedPath := currentPath
+ savedLoops := currentLoops
+
+ // Stop and release current music before reopening device
+ mix.HaltMusic()
+ if currentMusic != nil {
+ currentMusic.Free()
+ currentMusic = nil
+ }
+ currentPath = ""
+ currentLoops = 0
+
+ // Close and reopen device
+ if deviceOpen {
+ mix.CloseAudio()
+ deviceOpen = false
+ }
+
+ // Attempt to open the newName device
+ if err := openDeviceLocked(newName); err != nil {
+ // If error switching to new device, switch back to the old device
+ // oldDevice is already "" for default (which openDeviceLocked expects)
+ if restoreErr := openDeviceLocked(oldDevice); restoreErr != nil {
+ // We should not hit an error when switching back, but if we do...
+ logger.Error("Failed to switch to device: %s", oldDevice)
+ }
+ // Could not switch to the new device, return the error
+ return err
+ }
+
+ // Restore saved volume after reopening device
+ if cfg != nil {
+ SetAllSinkVolumes(cfg.SavedVolume)
+ }
+
+ // Optionally resume previous track if there was one
+ if wasPlaying && savedPath != "" {
+ m, err := mix.LoadMUS(savedPath)
+ if err != nil {
+ // Don't fail the device switch just because reload failed
+ return fmt.Errorf("device switched, but reloading %q failed: %w", savedPath, err)
+ }
+ currentMusic = m
+ currentPath = savedPath
+ currentLoops = savedLoops
+ if err := currentMusic.Play(currentLoops); err != nil {
+ currentMusic.Free()
+ currentMusic = nil
+ currentPath = ""
+ currentLoops = 0
+ return fmt.Errorf("device switched, but restarting playback failed: %w", err)
+ }
+ }
+
+ logger.Info("Audio device switched to %s", newName)
+
+ return nil
+}
+
+func GetVolume128() int {
+ mu.Lock()
+ defer mu.Unlock()
+ return mix.VolumeMusic(-1)
+}
+
+// Shutdown fully tears everything down. Call at app exit.
+func Shutdown() {
+ mu.Lock()
+ defer mu.Unlock()
+
+ mix.HaltMusic()
+ if currentMusic != nil {
+ currentMusic.Free()
+ currentMusic = nil
+ }
+ if deviceOpen {
+ mix.CloseAudio()
+ deviceOpen = false
+ }
+
+ if inited {
+ mix.Quit() // Add this to clean up the decoders
+ sdl.QuitSubSystem(sdl.INIT_AUDIO)
+ inited = false
+ }
+}
diff --git a/archive/internal/mixer/mixer_internal_test.go b/archive/internal/mixer/mixer_internal_test.go
new file mode 100644
index 0000000..0e97ef7
--- /dev/null
+++ b/archive/internal/mixer/mixer_internal_test.go
@@ -0,0 +1,312 @@
+package mixer
+
+import (
+ "testing"
+ "time"
+
+ "rhemawavetech.com/rhemawave/internal/db"
+)
+
+// Regression tests for critical audio bugs (v0.5)
+
+// Regression: Stop() used to return early when AudioEnabled was false,
+// leaving music playing after the user toggled audio off mid-playback.
+func TestStopCleansUpWhenAudioDisabled(t *testing.T) {
+ mu.Lock()
+ wasInited := inited
+ inited = true
+ deviceOpen = false
+ currentPath = "/some/track.wav"
+ currentLoops = -1
+ mu.Unlock()
+
+ defer func() {
+ mu.Lock()
+ inited = wasInited
+ currentPath = ""
+ currentLoops = 0
+ mu.Unlock()
+ }()
+
+ cfg := &db.AppConfig{AudioEnabled: false}
+ Stop(0, cfg)
+
+ mu.Lock()
+ defer mu.Unlock()
+ if currentPath != "" {
+ t.Errorf("currentPath = %q, want empty after Stop with AudioEnabled=false", currentPath)
+ }
+ if currentLoops != 0 {
+ t.Errorf("currentLoops = %d, want 0 after Stop with AudioEnabled=false", currentLoops)
+ }
+}
+
+// Regression: SwitchDevice used to convert oldDevice="" to "system default"
+// and pass that string to openDeviceLocked, which SDL does not recognize.
+func TestSwitchDeviceReturnsErrorWhenUninitialized(t *testing.T) {
+ mu.Lock()
+ wasInited := inited
+ inited = false
+ deviceOpen = false
+ mu.Unlock()
+
+ defer func() {
+ mu.Lock()
+ inited = wasInited
+ mu.Unlock()
+ }()
+
+ cfg := &db.AppConfig{AudioEnabled: true, SavedVolume: 0.5}
+ err := SwitchDevice("Some Device", cfg)
+ if err == nil {
+ t.Fatal("SwitchDevice on uninitialized mixer should return error")
+ }
+}
+
+// Regression: SwitchDevice with nil config must not panic when attempting
+// to restore volume after reopening the device.
+func TestSwitchDeviceNilConfigDoesNotPanic(t *testing.T) {
+ mu.Lock()
+ wasInited := inited
+ inited = false
+ deviceOpen = false
+ mu.Unlock()
+
+ defer func() {
+ mu.Lock()
+ inited = wasInited
+ mu.Unlock()
+ }()
+
+ err := SwitchDevice("Some Device", nil)
+ if err == nil {
+ t.Fatal("SwitchDevice on uninitialized mixer should return error")
+ }
+}
+
+// Regression: SwitchDevice with empty device name (system default) should
+// not be converted to "system default" before passing to openDeviceLocked.
+func TestSwitchDeviceAcceptsEmptyDeviceName(t *testing.T) {
+ mu.Lock()
+ wasInited := inited
+ inited = false
+ deviceOpen = false
+ mu.Unlock()
+
+ defer func() {
+ mu.Lock()
+ inited = wasInited
+ mu.Unlock()
+ }()
+
+ cfg := &db.AppConfig{SavedVolume: 0.75}
+ err := SwitchDevice("", cfg)
+ // Returns error because mixer is not initialized, but should not panic
+ // and should handle the empty name gracefully.
+ if err == nil {
+ t.Fatal("SwitchDevice on uninitialized mixer should return error")
+ }
+}
+
+// TestPlayDoesNotDeadlockWhenUninitialized verifies that Play() returns an error
+// (not a deadlock) when the mixer has not been initialized.
+// The old code would deadlock because Play() held mu then called SwitchDevice()
+// which also tried to acquire mu.
+func TestPlayDoesNotDeadlockWhenUninitialized(t *testing.T) {
+ // Ensure mixer is in uninitialized state
+ mu.Lock()
+ wasInited := inited
+ inited = false
+ deviceOpen = false
+ mu.Unlock()
+
+ defer func() {
+ mu.Lock()
+ inited = wasInited
+ mu.Unlock()
+ }()
+
+ cfg := &db.AppConfig{AudioEnabled: true}
+ done := make(chan error, 1)
+ go func() {
+ done <- Play("nonexistent.wav", false, cfg)
+ }()
+
+ select {
+ case err := <-done:
+ if err == nil {
+ t.Fatal("Play() returned nil error on uninitialized mixer, want error")
+ }
+ case <-time.After(5 * time.Second):
+ t.Fatal("Play() deadlocked on uninitialized mixer (did not return within 5s)")
+ }
+}
+
+func TestParseSinkLine(t *testing.T) {
+ tests := []struct {
+ name string
+ input string
+ wantOK bool
+ wantID int
+ wantName string
+ wantVol float64
+ wantDef bool
+ }{
+ {
+ name: "default sink with volume",
+ input: "*51. USB Audio [vol: 1.00]",
+ wantOK: true,
+ wantID: 51,
+ wantName: "USB Audio",
+ wantVol: 1.00,
+ wantDef: true,
+ },
+ {
+ name: "non-default sink with volume",
+ input: "33. Built-in Audio Analog Stereo [vol: 0.65]",
+ wantOK: true,
+ wantID: 33,
+ wantName: "Built-in Audio Analog Stereo",
+ wantVol: 0.65,
+ wantDef: false,
+ },
+ {
+ name: "default sink with muted tag",
+ input: "*51. USB Audio [vol: 0.50 MUTED]",
+ wantOK: true,
+ wantID: 51,
+ wantName: "USB Audio",
+ wantVol: 0.50,
+ wantDef: true,
+ },
+ {
+ name: "sink without volume field",
+ input: "33. Built-in Audio Analog Stereo",
+ wantOK: true,
+ wantID: 33,
+ wantName: "Built-in Audio Analog Stereo",
+ wantVol: 0.0,
+ wantDef: false,
+ },
+ {
+ name: "empty string",
+ input: "",
+ wantOK: false,
+ },
+ {
+ name: "no dot separator",
+ input: "no dot here",
+ wantOK: false,
+ },
+ {
+ name: "non-numeric ID",
+ input: "abc. Some Device [vol: 0.80]",
+ wantOK: false,
+ },
+ {
+ name: "zero volume",
+ input: "1. Muted Device [vol: 0.00]",
+ wantOK: true,
+ wantID: 1,
+ wantName: "Muted Device",
+ wantVol: 0.0,
+ wantDef: false,
+ },
+ }
+
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ sink, ok := parseSinkLine(tt.input)
+ if ok != tt.wantOK {
+ t.Fatalf("parseSinkLine(%q) ok = %v, want %v", tt.input, ok, tt.wantOK)
+ }
+ if !ok {
+ return
+ }
+ if sink.ID != tt.wantID {
+ t.Errorf("ID = %d, want %d", sink.ID, tt.wantID)
+ }
+ if sink.Name != tt.wantName {
+ t.Errorf("Name = %q, want %q", sink.Name, tt.wantName)
+ }
+ if sink.Volume != tt.wantVol {
+ t.Errorf("Volume = %f, want %f", sink.Volume, tt.wantVol)
+ }
+ if sink.IsDefault != tt.wantDef {
+ t.Errorf("IsDefault = %v, want %v", sink.IsDefault, tt.wantDef)
+ }
+ })
+ }
+}
+
+func TestParseSinks(t *testing.T) {
+ tests := []struct {
+ name string
+ input string
+ wantCount int
+ wantNames []string
+ }{
+ {
+ name: "two sinks",
+ input: `Audio
+ Sinks:
+ *51. USB Audio [vol: 1.00]
+ 33. Built-in Audio Analog Stereo [vol: 0.65]
+ Sources:
+ 52. Microphone [vol: 0.80]`,
+ wantCount: 2,
+ wantNames: []string{"USB Audio", "Built-in Audio Analog Stereo"},
+ },
+ {
+ name: "no sinks section",
+ input: `Audio
+ Sources:
+ 52. Microphone [vol: 0.80]`,
+ wantCount: 0,
+ },
+ {
+ name: "sinks with tree characters",
+ input: `Audio
+ ├─Sinks:
+ │ ├─*51. USB Audio [vol: 1.00]
+ │ └─33. Built-in Audio Analog Stereo [vol: 0.65]
+ └─Sources:
+ └─52. Microphone [vol: 0.80]`,
+ wantCount: 2,
+ wantNames: []string{"USB Audio", "Built-in Audio Analog Stereo"},
+ },
+ {
+ name: "empty input",
+ input: ``,
+ wantCount: 0,
+ },
+ {
+ name: "video section ignored",
+ input: `Video
+ Sinks:
+ 100. HDMI Output [vol: 1.00]
+Audio
+ Sinks:
+ 51. USB Audio [vol: 1.00]`,
+ wantCount: 1,
+ wantNames: []string{"USB Audio"},
+ },
+ }
+
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ sinks, err := parseSinks([]byte(tt.input))
+ if err != nil {
+ t.Fatalf("parseSinks returned error: %v", err)
+ }
+ if len(sinks) != tt.wantCount {
+ t.Fatalf("got %d sinks, want %d", len(sinks), tt.wantCount)
+ }
+ for i, name := range tt.wantNames {
+ if sinks[i].Name != name {
+ t.Errorf("sink[%d].Name = %q, want %q", i, sinks[i].Name, name)
+ }
+ }
+ })
+ }
+}
diff --git a/archive/internal/mixer/mixer_test.go b/archive/internal/mixer/mixer_test.go
new file mode 100644
index 0000000..796f032
--- /dev/null
+++ b/archive/internal/mixer/mixer_test.go
@@ -0,0 +1,38 @@
+package mixer_test
+
+import (
+ "math"
+ "testing"
+
+ "rhemawavetech.com/rhemawave/internal/mixer"
+)
+
+func TestConvertVolume(t *testing.T) {
+ tests := []struct {
+ name string
+ input int
+ expected float64
+ }{
+ {"0 percent", 0, 0.0},
+ {"25 percent", 25, 0.25},
+ {"33 percent", 33, 0.33},
+ {"50 percent", 50, 0.50},
+ {"90 percent", 90, 0.90},
+ {"100 percent", 100, 1.0},
+ {"1 percent", 1, 0.01},
+ {"99 percent", 99, 0.99},
+ {"negative 10", -10, -0.10},
+ {"over 100", 150, 1.50},
+ }
+
+ const epsilon = 1e-9
+
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ got := mixer.ConvertVolume(tt.input)
+ if math.Abs(got-tt.expected) > epsilon {
+ t.Errorf("ConvertVolume(%d) = %v, want %v", tt.input, got, tt.expected)
+ }
+ })
+ }
+}
diff --git a/archive/internal/netreq/netReq.go b/archive/internal/netreq/netReq.go
new file mode 100644
index 0000000..f9c4b4c
--- /dev/null
+++ b/archive/internal/netreq/netReq.go
@@ -0,0 +1,83 @@
+package netreq
+
+import (
+ "bytes"
+ "encoding/json"
+ "fmt"
+ "io"
+ "net/http"
+ "os"
+ "path/filepath"
+)
+
+// Makes a GET request to the specified URL and returns the JSON response
+// as a byte slice. If the request fails, it returns an error.
+func GetJSON[T any](url string) ([]T, error) {
+ fmt.Println("Fetching:", url)
+ res, err := http.Get(url)
+ if err != nil {
+ return nil, err
+ }
+ defer res.Body.Close()
+
+ body, err := io.ReadAll(res.Body)
+ if err != nil {
+ return nil, err
+ }
+
+ if res.StatusCode > 299 {
+ return nil, fmt.Errorf("status %d: %s", res.StatusCode, string(body))
+ }
+
+ // 1. Trim whitespace to find the first actual JSON character
+ trimmed := bytes.TrimSpace(body)
+ if len(trimmed) == 0 {
+ return nil, nil
+ }
+
+ var result []T
+
+ // 2. Determine if we are looking at an Array [ ] or an Object { }
+ if trimmed[0] == '[' {
+ // It's already an array, unmarshal directly
+ err = json.Unmarshal(body, &result)
+ } else {
+ // It's a single object, unmarshal into a single instance and wrap it
+ var single T
+ err = json.Unmarshal(body, &single)
+ result = []T{single}
+ }
+
+ if err != nil {
+ return nil, fmt.Errorf("failed to parse JSON: %w", err)
+ }
+
+ return result, nil
+}
+
+// Download downloads a specified object at a given url and places it in
+// the provided dest directory.
+func Download(name string, path string, url string) error {
+ fullFilePath := filepath.Join(path, name)
+ if err := os.MkdirAll(path, os.ModeDir); err != nil {
+ return err
+ }
+ file, err := os.Create(fullFilePath)
+ if err != nil {
+ return err
+ }
+ defer file.Close()
+
+ resp, err := http.Get(url)
+ if err != nil {
+ return err
+ }
+ defer resp.Body.Close()
+
+ _, err = io.Copy(file, resp.Body)
+ if err != nil {
+ return err
+ }
+
+ return nil
+}
diff --git a/archive/internal/network/network.go b/archive/internal/network/network.go
new file mode 100644
index 0000000..1510fc3
--- /dev/null
+++ b/archive/internal/network/network.go
@@ -0,0 +1,577 @@
+package network
+
+import (
+ "context"
+ "fmt"
+ "net"
+ "net/http"
+ "time"
+
+ gonm "github.com/Wifx/gonetworkmanager/v2"
+ "github.com/google/uuid"
+ "rhemawavetech.com/rhemawave/internal/logger"
+)
+
+// ─── Public types ─────────────────────────────────────────────────────────────
+
+type SecurityType string
+
+const (
+ SecurityOpen SecurityType = "Open"
+ SecurityWEP SecurityType = "WEP"
+ SecurityWPA SecurityType = "WPA"
+ SecurityWPA2 SecurityType = "WPA2"
+ SecurityWPA3 SecurityType = "WPA3"
+)
+
+type Network struct {
+ SSID string
+ SignalStrength uint8
+ Security SecurityType
+ Saved bool
+ Connected bool
+}
+
+// ─── Package init ─────────────────────────────────────────────────────────────
+
+var nm gonm.NetworkManager
+
+func init() {
+ var err error
+ nm, err = gonm.NewNetworkManager()
+ if err != nil {
+ logger.Warning("network: NetworkManager unavailable, network features disabled: %v", err)
+ }
+}
+
+// ─── ScanForNetworks ──────────────────────────────────────────────────────────
+
+func ScanForNetworks(ctx context.Context) (<-chan []Network, error) {
+ dev, err := wifiDevice()
+ if err != nil {
+ return nil, err
+ }
+
+ ch := make(chan []Network, 1)
+
+ go func() {
+ defer close(ch)
+
+ ticker := time.NewTicker(15 * time.Second)
+ defer ticker.Stop()
+
+ scan := func() {
+ if err := dev.RequestScan(); err != nil {
+ logger.Warning("network: scan request failed: %v", err)
+ return
+ }
+ time.Sleep(2 * time.Second)
+
+ nets, err := buildNetworkList(dev)
+ if err != nil {
+ logger.Warning("network: building network list failed: %v", err)
+ return
+ }
+
+ select {
+ case ch <- nets:
+ case <-ctx.Done():
+ }
+ }
+
+ scan()
+
+ for {
+ select {
+ case <-ticker.C:
+ scan()
+ case <-ctx.Done():
+ return
+ }
+ }
+ }()
+
+ return ch, nil
+}
+
+// ─── ConnectToNetwork ─────────────────────────────────────────────────────────
+
+func ConnectToNetwork(ssid, password string) error {
+ dev, err := wifiDevice()
+ if err != nil {
+ return err
+ }
+
+ ifaceName, err := dev.GetPropertyInterface()
+ if err != nil {
+ return fmt.Errorf("network: cannot get interface name: %w", err)
+ }
+
+ ap, err := findAccessPoint(dev, ssid)
+ if err != nil {
+ return fmt.Errorf("network: access point %q not found: %w", ssid, err)
+ }
+
+ // Delete any existing profiles for this SSID before creating a new one.
+ // Stale/duplicate profiles cause NM to fail silently.
+ if err := deleteExistingConnections(ssid); err != nil {
+ logger.Warning("network: could not clean up old profiles for %q: %v", ssid, err)
+ }
+
+ security := detectSecurity(ap)
+ settings, err := buildConnectionSettings(ssid, password, security, ifaceName)
+ if err != nil {
+ return err
+ }
+
+ logger.Info("network: connecting to %q (%s)", ssid, security)
+
+ _, err = nm.AddAndActivateConnection(settings, dev)
+ if err != nil {
+ return fmt.Errorf("network: failed to connect to %q: %w", ssid, err)
+ }
+
+ return waitForConnection(dev, ssid, 20*time.Second)
+}
+
+// deleteExistingConnections removes all stored NM profiles for the given SSID.
+func deleteExistingConnections(ssid string) error {
+ s, err := gonm.NewSettings()
+ if err != nil {
+ return err
+ }
+ connections, err := s.ListConnections()
+ if err != nil {
+ return err
+ }
+ for _, conn := range connections {
+ cfg, err := conn.GetSettings()
+ if err != nil {
+ continue
+ }
+ wireless, ok := cfg["802-11-wireless"]
+ if !ok {
+ continue
+ }
+ rawSSID, ok := wireless["ssid"]
+ if !ok {
+ continue
+ }
+ if string(rawSSID.([]byte)) != ssid {
+ continue
+ }
+ logger.Debug("network: removing existing profile for %q", ssid)
+ if err := conn.Delete(); err != nil {
+ logger.Warning("network: failed to delete profile for %q: %v", ssid, err)
+ }
+ }
+ return nil
+}
+
+// ─── ForgetNetwork ────────────────────────────────────────────────────────────
+
+func ForgetNetwork(ssid string) error {
+ s, err := gonm.NewSettings()
+ if err != nil {
+ return fmt.Errorf("network: cannot access NM settings: %w", err)
+ }
+
+ connections, err := s.ListConnections()
+ if err != nil {
+ return fmt.Errorf("network: cannot list connections: %w", err)
+ }
+
+ found := false
+ for _, conn := range connections {
+ settings, err := conn.GetSettings()
+ if err != nil {
+ continue
+ }
+ wireless, ok := settings["802-11-wireless"]
+ if !ok {
+ continue
+ }
+ rawSSID, ok := wireless["ssid"]
+ if !ok {
+ continue
+ }
+ if string(rawSSID.([]byte)) != ssid {
+ continue
+ }
+
+ found = true
+ logger.Info("network: forgetting %q", ssid)
+ if err := conn.Delete(); err != nil {
+ return fmt.Errorf("network: failed to delete connection %q: %w", ssid, err)
+ }
+ }
+
+ if !found {
+ return fmt.Errorf("network: no saved connection found for %q", ssid)
+ }
+
+ return nil
+}
+
+// ─── CurrentNetwork ───────────────────────────────────────────────────────────
+
+func CurrentNetwork() (string, error) {
+ dev, err := wifiDevice()
+ if err != nil {
+ return "", err
+ }
+
+ ap, err := dev.GetPropertyActiveAccessPoint()
+ if err != nil || ap == nil {
+ return "", nil
+ }
+
+ ssid, err := ap.GetPropertySSID()
+ if err != nil {
+ return "", err
+ }
+
+ return ssid, nil
+}
+
+// ─── ListSavedNetworks ────────────────────────────────────────────────────────
+
+func ListSavedNetworks() ([]string, error) {
+ s, err := gonm.NewSettings()
+ if err != nil {
+ return nil, fmt.Errorf("network: cannot access NM settings: %w", err)
+ }
+
+ connections, err := s.ListConnections()
+ if err != nil {
+ return nil, fmt.Errorf("network: cannot list connections: %w", err)
+ }
+
+ var ssids []string
+ for _, conn := range connections {
+ settings, err := conn.GetSettings()
+ if err != nil {
+ continue
+ }
+ wireless, ok := settings["802-11-wireless"]
+ if !ok {
+ continue
+ }
+ rawSSID, ok := wireless["ssid"]
+ if !ok {
+ continue
+ }
+ ssids = append(ssids, string(rawSSID.([]byte)))
+ }
+
+ return ssids, nil
+}
+
+// ─── IsConnected ──────────────────────────────────────────────────────────────
+
+func IsConnected() (bool, error) {
+ if nm == nil {
+ return false, fmt.Errorf("network: NetworkManager not available")
+ }
+
+ state, err := nm.GetPropertyState()
+ if err != nil {
+ return false, fmt.Errorf("network: cannot get NM state: %w", err)
+ }
+
+ return state >= gonm.NmStateConnectedLocal, nil
+}
+
+// ─── HasInternet ──────────────────────────────────────────────────────────────
+
+func HasInternet() bool {
+ targets := []string{
+ "1.1.1.1:53",
+ "1.0.0.1:53",
+ "8.8.8.8:53",
+ "9.9.9.9:53",
+ "8.8.4.4:53",
+ "google.com:443",
+ "cloudflare.com:443",
+ }
+
+ results := make(chan bool, len(targets))
+
+ for _, target := range targets {
+ go func(addr string) {
+ conn, err := net.DialTimeout("tcp", addr, 2*time.Second)
+ if err == nil {
+ conn.Close()
+ results <- true
+ } else {
+ results <- false
+ }
+ }(target)
+ }
+
+ for range targets {
+ if <-results {
+ return true
+ }
+ }
+ return false
+}
+
+// ─── WatchState ───────────────────────────────────────────────────────────────
+
+func WatchState(ctx context.Context) (<-chan bool, error) {
+ if nm == nil {
+ return nil, fmt.Errorf("network: NetworkManager not available")
+ }
+
+ ch := make(chan bool, 1)
+
+ go func() {
+ defer close(ch)
+
+ ticker := time.NewTicker(3 * time.Second)
+ defer ticker.Stop()
+
+ var last *bool
+
+ for {
+ select {
+ case <-ticker.C:
+ connected, err := IsConnected()
+ if err != nil {
+ logger.Warning("network: WatchState poll failed: %v", err)
+ continue
+ }
+ if last == nil || *last != connected {
+ last = &connected
+ select {
+ case ch <- connected:
+ case <-ctx.Done():
+ return
+ }
+ }
+ case <-ctx.Done():
+ return
+ }
+ }
+ }()
+
+ return ch, nil
+}
+
+// ─── Internal helpers ─────────────────────────────────────────────────────────
+
+func wifiDevice() (gonm.DeviceWireless, error) {
+ if nm == nil {
+ return nil, fmt.Errorf("network: NetworkManager not available")
+ }
+
+ devices, err := nm.GetPropertyAllDevices()
+ if err != nil {
+ return nil, fmt.Errorf("network: cannot list devices: %w", err)
+ }
+
+ for _, dev := range devices {
+ devType, err := dev.GetPropertyDeviceType()
+ if err != nil {
+ continue
+ }
+ if devType == gonm.NmDeviceTypeWifi {
+ return gonm.NewDeviceWireless(dev.GetPath())
+ }
+ }
+
+ return nil, fmt.Errorf("network: no WiFi device found")
+}
+
+func findAccessPoint(dev gonm.DeviceWireless, ssid string) (gonm.AccessPoint, error) {
+ aps, err := dev.GetPropertyAccessPoints()
+ if err != nil {
+ return nil, err
+ }
+
+ for _, ap := range aps {
+ apSSID, err := ap.GetPropertySSID()
+ if err != nil {
+ continue
+ }
+ if apSSID == ssid {
+ return ap, nil
+ }
+ }
+
+ return nil, fmt.Errorf("not found")
+}
+
+func detectSecurity(ap gonm.AccessPoint) SecurityType {
+ flags, _ := ap.GetPropertyFlags()
+ wpaFlags, _ := ap.GetPropertyWPAFlags()
+ rsnFlags, _ := ap.GetPropertyRSNFlags()
+
+ // WPA3 uses SAE (0x400)
+ if rsnFlags&0x400 != 0 {
+ return SecurityWPA3
+ }
+ // WPA2 uses PSK (0x100)
+ if rsnFlags&0x100 != 0 {
+ return SecurityWPA2
+ }
+ // WPA uses WPA flags (not RSN)
+ if wpaFlags != 0 {
+ return SecurityWPA
+ }
+ // WEP uses privacy flag
+ if flags&0x1 != 0 {
+ return SecurityWEP
+ }
+
+ return SecurityOpen
+}
+
+func buildConnectionSettings(ssid, password string, security SecurityType, interfaceName string) (map[string]map[string]interface{}, error) {
+ settings := map[string]map[string]interface{}{
+ "connection": {
+ "id": ssid,
+ "type": "802-11-wireless",
+ "uuid": uuid.NewString(),
+ "interface-name": interfaceName,
+ "autoconnect": true,
+ "permissions": []string{},
+ },
+ "802-11-wireless": {
+ "ssid": []byte(ssid),
+ "mode": "infrastructure",
+ },
+ "ipv4": {"method": "auto"},
+ "ipv6": {"method": "auto"},
+ }
+
+ switch security {
+ case SecurityOpen:
+ // nothing
+
+ case SecurityWEP:
+ if password == "" {
+ return nil, fmt.Errorf("network: WEP network requires a password")
+ }
+ settings["802-11-wireless-security"] = map[string]interface{}{
+ "key-mgmt": "none",
+ "wep-key0": password,
+ "wep-key-type": uint32(1),
+ }
+
+ case SecurityWPA, SecurityWPA2:
+ if password == "" {
+ return nil, fmt.Errorf("network: WPA/WPA2 network requires a password")
+ }
+ settings["802-11-wireless-security"] = map[string]interface{}{
+ "key-mgmt": "wpa-psk",
+ "auth-alg": "open",
+ "psk": password,
+ "psk-flags": uint32(0),
+ }
+
+ case SecurityWPA3:
+ if password == "" {
+ return nil, fmt.Errorf("network: WPA3 network requires a password")
+ }
+ settings["802-11-wireless-security"] = map[string]interface{}{
+ "key-mgmt": "sae",
+ "psk": password,
+ }
+ }
+
+ return settings, nil
+}
+
+func buildNetworkList(dev gonm.DeviceWireless) ([]Network, error) {
+ aps, err := dev.GetPropertyAccessPoints()
+ if err != nil {
+ return nil, err
+ }
+
+ activeAP, _ := dev.GetPropertyActiveAccessPoint()
+ var activeSSID string
+ if activeAP != nil {
+ activeSSID, _ = activeAP.GetPropertySSID()
+ }
+
+ saved, _ := ListSavedNetworks()
+ savedSet := make(map[string]bool, len(saved))
+ for _, s := range saved {
+ savedSet[s] = true
+ }
+
+ var networks []Network
+ seen := make(map[string]bool)
+
+ for _, ap := range aps {
+ ssid, err := ap.GetPropertySSID()
+ if err != nil || ssid == "" {
+ continue
+ }
+ if seen[ssid] {
+ continue
+ }
+ seen[ssid] = true
+
+ strength, _ := ap.GetPropertyStrength()
+
+ networks = append(networks, Network{
+ SSID: ssid,
+ SignalStrength: strength,
+ Security: detectSecurity(ap),
+ Saved: savedSet[ssid],
+ Connected: ssid == activeSSID,
+ })
+ }
+
+ return networks, nil
+}
+
+// waitForConnection waits until the wifi device reaches the Activated state,
+// meaning DHCP has completed and the connection is fully up.
+func waitForConnection(dev gonm.DeviceWireless, ssid string, timeout time.Duration) error {
+ deadline := time.Now().Add(timeout)
+ for time.Now().Before(deadline) {
+ state, err := dev.GetPropertyState()
+ if err != nil {
+ time.Sleep(500 * time.Millisecond)
+ continue
+ }
+
+ logger.Debug("network: device state %d, waiting...", state)
+
+ switch state {
+ case gonm.NmDeviceStateActivated:
+ current, err := CurrentNetwork()
+ if err == nil && current == ssid {
+ logger.Info("network: fully connected to %q (DHCP complete)", ssid)
+ return nil
+ }
+
+ case gonm.NmDeviceStateFailed:
+ return fmt.Errorf("network: connection to %q failed (wrong password?)", ssid)
+
+ case gonm.NmDeviceStateDisconnected:
+ return fmt.Errorf("network: connection to %q was rejected by the network", ssid)
+ }
+
+ time.Sleep(500 * time.Millisecond)
+ }
+ return fmt.Errorf("network: timed out waiting for connection to %q", ssid)
+}
+
+var internetCheckURL = "https://clients3.google.com/generate_204"
+
+func httpCheck() bool {
+ client := http.Client{Timeout: 3 * time.Second}
+ resp, err := client.Get(internetCheckURL)
+ if err != nil {
+ return false
+ }
+ resp.Body.Close()
+ return resp.StatusCode == 204
+}
+
+var _ = httpCheck
diff --git a/archive/internal/page/AudioOptions.go b/archive/internal/page/AudioOptions.go
new file mode 100644
index 0000000..c38a093
--- /dev/null
+++ b/archive/internal/page/AudioOptions.go
@@ -0,0 +1,626 @@
+package page
+
+import (
+ "fmt"
+ "math"
+
+ "github.com/go-gl/gl/v3.3-core/gl"
+ "github.com/go-gl/mathgl/mgl32"
+ "github.com/veandco/go-sdl2/sdl"
+ "rhemawavetech.com/rhemawave/internal/colors"
+ "rhemawavetech.com/rhemawave/internal/db"
+ "rhemawavetech.com/rhemawave/internal/fontManager"
+ "rhemawavetech.com/rhemawave/internal/logger"
+ "rhemawavetech.com/rhemawave/internal/mixer"
+ "rhemawavetech.com/rhemawave/internal/shaderManager"
+)
+
+// focusToggle is the sentinel focusState value meaning the audio on/off toggle
+// row has keyboard focus. Device indices (0..n-1) are used for everything below.
+const focusToggle = -1
+
+// AudioFileList is kept as the canonical seed data for the audio_files table.
+// Track selection UI no longer lives on this page, but other parts of the
+// app still read these rows from the database.
+var AudioFileList = []db.AudioFile{
+ {ID: 14, Name: "Original Audio", Path: "OriginalAudio.wav", Selected: false, Order: 1},
+ {ID: 1, Name: "174 Hz", Path: "174Hz.wav", Selected: false, Order: 2},
+ {ID: 2, Name: "396 Hz", Path: "396Hz.wav", Selected: false, Order: 3},
+ {ID: 3, Name: "417 Hz", Path: "417Hz.wav", Selected: false, Order: 4},
+ {ID: 4, Name: "432 Hz", Path: "432Hz.wav", Selected: false, Order: 5},
+ {ID: 5, Name: "639 Hz", Path: "639Hz.wav", Selected: false, Order: 6},
+ {ID: 6, Name: "741 Hz", Path: "741Hz.wav", Selected: false, Order: 7},
+ {ID: 7, Name: "852 Hz", Path: "852Hz.wav", Selected: false, Order: 8},
+ {ID: 8, Name: "963 Hz", Path: "963Hz.wav", Selected: false, Order: 9},
+ {ID: 9, Name: "1111 Hz", Path: "1111Hz.wav", Selected: false, Order: 10},
+ {ID: 10, Name: "14 Hz Binaural Beat", Path: "14Hz_Binaural.wav", Selected: false, Order: 11},
+ {ID: 11, Name: "40 Hz Binaural Beat", Path: "40Hz_Binaural.wav", Selected: false, Order: 12},
+ {ID: 12, Name: "Alpha Waves", Path: "AlphaWaves.wav", Selected: false, Order: 13},
+ {ID: 13, Name: "Pineal Gland", Path: "PinealGland.wav", Selected: false, Order: 14},
+}
+
+const triangleSize = float32(16)
+
+type AudioDevice struct {
+ Label string
+ ID uint32
+ index int
+}
+
+type AudioOptions struct {
+ // Page Attributes
+ Base
+ font *fontManager.FontEntry
+ textShader *shaderManager.Shader
+ solidShader *shaderManager.Shader
+ CfgPtr *db.AppConfig
+
+ // Page Textures
+ title StringItem
+ prompt StringItem
+
+ // Layout
+ verticalMargin int32
+ ItemScale float32
+
+ // Audio toggle
+ AudioStatusToggle StringItem
+
+ // Audio Devices
+ activeDeviceIndex int
+ NumAudioDevices int
+ AudioDevices []AudioDevice
+ AudioDeviceTextures []StringItem
+
+ // Volume row
+ VolumeLabel StringItem
+ volumePercent StringItem
+ volumeBarX int32
+ volumeBarY int32
+ volumeBarW int32
+ volumeBarH int32
+
+ // Triangle cursor
+ triVAO uint32
+ triVBO uint32
+ triX float32
+ triCenterY float32
+ spinElapsed float32
+
+ // Focus: focusToggle (-1) = toggle row, 0..n-1 = device at that index
+ focusState int
+}
+
+// ── Init ──────────────────────────────────────────────────────────────────────
+
+func (p *AudioOptions) Init(ctx *PageCtx) error {
+ var err error
+ p.verticalMargin = int32(20)
+ p.focusState = focusToggle
+
+ // Font
+ fm := fontManager.Get()
+ font, ok := fm.GetFont("SpaceMonoNerdFont-Regular")
+ if !ok {
+ return fmt.Errorf("failed to get font: %w", sdl.GetError())
+ }
+ p.font = font
+
+ // Shaders
+ sm := shaderManager.Get()
+ p.textShader, ok = sm.Get("text")
+ if !ok {
+ return fmt.Errorf("failed to get text shader: %w", sdl.GetError())
+ }
+ p.solidShader, ok = sm.Get("solid_color")
+ if !ok {
+ return fmt.Errorf("failed to get solid_color shader: %w", sdl.GetError())
+ }
+
+ if err = p.Base.Init(ctx); err != nil {
+ return fmt.Errorf("base init failed: %w", err)
+ }
+
+ config, err := db.GetConfig(p.Context.DbPtr)
+ if err != nil {
+ panic(err)
+ }
+
+ baseFontSize := config.StandardFontSize
+ titleScale := float32(64) / float32(baseFontSize)
+ p.ItemScale = float32(32) / float32(baseFontSize)
+
+ // Title
+ p.title, err = NewStringItem("Audio Options", p.font, colors.White)
+ if err != nil {
+ return fmt.Errorf("creating title: %w", err)
+ }
+ p.title.Scale(titleScale)
+
+ // Prompt
+ p.prompt, err = NewStringItem(
+ "Enter to select -- Up/Down to navigate -- Left/Right to change volume -- Backspace to go back",
+ p.font, colors.White,
+ )
+ if err != nil {
+ return fmt.Errorf("creating prompt: %w", err)
+ }
+ p.prompt.Scale(p.ItemScale)
+
+ // Volume row
+ p.VolumeLabel, err = NewStringItem("Volume", p.font, colors.White)
+ if err != nil {
+ return fmt.Errorf("creating volume label: %w", err)
+ }
+ p.VolumeLabel.Scale(p.ItemScale)
+ if err = p.CreateVolumePercentItem(); err != nil {
+ logger.Error("failed to create VolumePercentItem in AudioOptions.Init()")
+ }
+
+ // Audio toggle
+ if err = p.CreateAudioStatusItem(); err != nil {
+ logger.Error("failed to create AudioStatusItem in AudioOptions.Init()")
+ }
+
+ // Audio output devices
+ if err = p.GetAudioDevices(); err != nil {
+ logger.Error("failed to enumerate audio devices: %v", err)
+ }
+
+ // Set active device index based on mixer's current device
+ currentName := mixer.CurrentDevice()
+ config, err = db.GetConfig(p.Context.DbPtr)
+ if err != nil {
+ panic(err)
+ }
+ p.activeDeviceIndex = -1 // default to not found
+ for i, dev := range p.AudioDevices {
+ if dev.Label == currentName {
+ p.activeDeviceIndex = i
+ break
+ }
+ }
+ // If not found and current device is default (""), check saved config
+ if p.activeDeviceIndex == -1 && currentName == "" && config.SelectedAudioDevice == "default" {
+ // Default device is selected - first device in SDL list is typically the default
+ if len(p.AudioDevices) > 0 {
+ p.activeDeviceIndex = 0
+ }
+ }
+
+ // Make sure the audio_files table is populated.
+ if err = p.seedAudioFiles(); err != nil {
+ logger.Error("failed to seed audio files: %v", err)
+ }
+
+ // Triangle cursor VAO/VBO — stride is vec2 only, no tex coords
+ triVerts := []float32{
+ 0.5, 0.0,
+ -0.5, 0.5,
+ -0.5, -0.5,
+ }
+ gl.GenVertexArrays(1, &p.triVAO)
+ gl.GenBuffers(1, &p.triVBO)
+ gl.BindVertexArray(p.triVAO)
+ gl.BindBuffer(gl.ARRAY_BUFFER, p.triVBO)
+ gl.BufferData(gl.ARRAY_BUFFER, len(triVerts)*4, gl.Ptr(triVerts), gl.STATIC_DRAW)
+ gl.EnableVertexAttribArray(0)
+ gl.VertexAttribPointerWithOffset(0, 2, gl.FLOAT, false, 2*4, 0)
+ gl.BindBuffer(gl.ARRAY_BUFFER, 0)
+ gl.BindVertexArray(0)
+
+ p.layout()
+ return nil
+}
+
+// seedAudioFiles ensures the audio_files table has its default rows.
+func (p *AudioOptions) seedAudioFiles() error {
+ var existing []db.AudioFile
+ if err := p.Context.DbPtr.Find(&existing).Error; err != nil {
+ return err
+ }
+ if len(existing) == 0 {
+ return p.Context.DbPtr.Save(&AudioFileList).Error
+ }
+ return nil
+}
+
+// ── Audio status toggle ───────────────────────────────────────────────────────
+
+func (p *AudioOptions) CreateAudioStatusItem() error {
+ config, err := db.GetConfig(p.Context.DbPtr)
+ if err != nil {
+ panic(err)
+ }
+ on := config.AudioEnabled
+ statusString := "Turn Audio On"
+ color := colors.Green
+ if on {
+ statusString = "Turn Audio Off"
+ color = colors.Red
+ }
+ item, err := NewStringItem(statusString, p.font, color)
+ if err != nil {
+ return fmt.Errorf("failed to create '%s' string item: %v", statusString, err)
+ }
+ item.Scale(p.ItemScale)
+ p.AudioStatusToggle = item
+ return nil
+}
+
+// ── Audio Output Devices ──────────────────────────────────────────────────────
+
+func (p *AudioOptions) GetAudioDevices() error {
+ numAudioDevices := sdl.GetNumAudioDevices(false)
+ if numAudioDevices == 0 {
+ return nil
+ }
+
+ // Pre-allocate with zero length so append doesn't produce leading zero-value
+ // elements (the old code used make([]AudioDevice, n) then appended, which
+ // doubled the slice length with n zero-value entries at the front).
+ audioDevices := make([]AudioDevice, 0, numAudioDevices)
+ for i := range numAudioDevices {
+ label := sdl.GetAudioDeviceName(i, false)
+ audioDevices = append(audioDevices, AudioDevice{Label: label, ID: uint32(i)})
+ }
+ p.AudioDevices = audioDevices
+
+ for i := range audioDevices {
+ item, err := NewStringItem(p.AudioDevices[i].Label, p.font, colors.White)
+ if err != nil {
+ return err
+ }
+ item.Scale(p.ItemScale)
+ p.AudioDeviceTextures = append(p.AudioDeviceTextures, item)
+ }
+ p.NumAudioDevices = numAudioDevices
+ return nil
+}
+
+// SelectAudioDevice is called when the user confirms a device from the list.
+// The device-switching implementation goes here; for now we just log the choice.
+func (p *AudioOptions) SelectAudioDevice(deviceIndex int) error {
+ if deviceIndex < 0 || deviceIndex >= len(p.AudioDevices) {
+ return fmt.Errorf("invalid device index: %d", deviceIndex)
+ }
+ device := p.AudioDevices[deviceIndex]
+
+ config, err := db.GetConfig(p.Context.DbPtr)
+ if err != nil {
+ return fmt.Errorf("failed to get config for device switch: %w", err)
+ }
+
+ if err := mixer.SwitchDevice(device.Label, config); err != nil {
+ return fmt.Errorf("failed to switch to device %s: %w", device.Label, err)
+ }
+
+ // Persist the selected device to the database
+ config.SelectedAudioDevice = device.Label
+ if err := p.Context.DbPtr.Save(config).Error; err != nil {
+ logger.Error("failed to persist device selection: %v", err)
+ }
+
+ p.activeDeviceIndex = deviceIndex
+ return nil
+}
+
+// ── Volume ────────────────────────────────────────────────────────────────────
+
+func (p *AudioOptions) CreateVolumePercentItem() error {
+ if p.volumePercent.ID != 0 {
+ gl.DeleteTextures(1, &p.volumePercent.ID)
+ }
+ config, err := db.GetConfig(p.Context.DbPtr)
+ if err != nil {
+ panic(err)
+ }
+ pct := int(config.SavedVolume * 100)
+ item, err := NewStringItem(fmt.Sprintf("%d%%", pct), p.font, colors.White)
+ if err != nil {
+ return fmt.Errorf("failed to create volume percent item: %v", err)
+ }
+ item.Scale(p.ItemScale)
+ p.volumePercent = item
+ return nil
+}
+
+func (p *AudioOptions) UpdateVolume(level int) {
+ config, err := db.GetConfig(p.Context.DbPtr)
+ if err != nil {
+ panic(err)
+ }
+ newVol := mixer.ConvertVolume(level) + config.SavedVolume
+ if newVol < 0.0 || newVol > 1.0 {
+ return
+ }
+ if newVol > .99 {
+ newVol = 1.0
+ }
+ config.SavedVolume = newVol
+ p.Context.DbPtr.Save(&config)
+ if err := mixer.SetAllSinkVolumes(newVol); err != nil {
+ logger.Error("Error setting allSinkVolumes: %v", err)
+ }
+ if err := p.CreateVolumePercentItem(); err != nil {
+ logger.Error("failed to refresh volume percent item: %v", err)
+ }
+ gap := int32(12)
+ p.volumePercent.X = p.volumeBarX + p.volumeBarW + gap
+ p.volumePercent.Y = p.volumeBarY + (p.volumeBarH-p.volumePercent.H)/2
+}
+
+// ── Layout ────────────────────────────────────────────────────────────────────
+
+func (p *AudioOptions) layout() {
+ config, err := db.GetConfig(p.Context.DbPtr)
+ if err != nil {
+ panic(err)
+ }
+
+ // Title
+ p.title.X = p.ScreenCenterX - p.title.W/2
+ p.title.Y = p.ScreenHeight - p.title.H - p.verticalMargin*2
+
+ // Prompt
+ p.prompt.X = p.ScreenCenterX - p.prompt.W/2
+ p.prompt.Y = p.title.Y - p.verticalMargin - p.prompt.H
+
+ // Volume row
+ barH := int32(float32(config.StandardFontSize) * p.ItemScale)
+ barW := int32(float32(p.ScreenWidth) * 0.30)
+ barX := p.ScreenCenterX - barW/2
+ barY := p.prompt.Y - p.verticalMargin*2 - barH
+
+ p.volumeBarX = barX
+ p.volumeBarY = barY
+ p.volumeBarW = barW
+ p.volumeBarH = barH
+
+ p.VolumeLabel.X = barX - p.VolumeLabel.W - 20
+ p.VolumeLabel.Y = barY + (barH-p.VolumeLabel.H)/2
+
+ gap := int32(12)
+ p.volumePercent.X = barX + barW + gap
+ p.volumePercent.Y = barY + (barH-p.volumePercent.H)/2
+
+ // Audio toggle — centred below the volume row
+ p.AudioStatusToggle.X = p.ScreenCenterX - p.AudioStatusToggle.W/2
+ p.AudioStatusToggle.Y = barY - p.verticalMargin*3 - p.AudioStatusToggle.H
+
+ // Device list — each item centred and stacked below the toggle
+ nextY := p.AudioStatusToggle.Y - p.verticalMargin
+ for i := range p.AudioDeviceTextures {
+ item := &p.AudioDeviceTextures[i]
+ item.X = p.ScreenCenterX - item.W/2
+ item.Y = nextY - item.H
+ nextY = item.Y - p.verticalMargin
+ }
+
+ // Reposition the triangle cursor for whatever row currently has focus
+ p.updateCursorPosition()
+}
+
+// updateCursorPosition moves triX / triCenterY to sit just left of the
+// focused row. Call this any time focusState changes or layout() reruns.
+func (p *AudioOptions) updateCursorPosition() {
+ cursorGap := int32(12)
+
+ var item *StringItem
+ switch {
+ case p.focusState == focusToggle:
+ item = &p.AudioStatusToggle
+ case p.focusState >= 0 && p.focusState < len(p.AudioDeviceTextures):
+ item = &p.AudioDeviceTextures[p.focusState]
+ default:
+ return
+ }
+
+ p.triX = float32(item.X) - triangleSize - float32(cursorGap)
+ p.triCenterY = float32(item.Y) + float32(item.H)/2
+}
+
+// ── Toggle ────────────────────────────────────────────────────────────────────
+
+func (p *AudioOptions) ToggleAudio() {
+ config, err := db.GetConfig(p.Context.DbPtr)
+ if err != nil {
+ logger.Error("panic! Cannot query database for configuration")
+ panic(err)
+ }
+ config.AudioEnabled = !config.AudioEnabled
+ p.Context.DbPtr.Save(config)
+ p.CreateAudioStatusItem()
+ p.layout()
+}
+
+// ── Events ────────────────────────────────────────────────────────────────────
+
+func (p *AudioOptions) HandleEvent(event *sdl.Event) error {
+ e, ok := (*event).(*sdl.KeyboardEvent)
+ if !ok || e.Type != sdl.KEYDOWN {
+ return nil
+ }
+
+ switch e.Keysym.Sym {
+ case sdl.K_RETURN:
+ if p.focusState == focusToggle {
+ p.ToggleAudio()
+ } else if p.focusState >= 0 && p.focusState < len(p.AudioDevices) {
+ if err := p.SelectAudioDevice(p.focusState); err != nil {
+ logger.Error("SelectAudioDevice: %v", err)
+ }
+ }
+
+ case sdl.K_DOWN:
+ if p.focusState == focusToggle {
+ if len(p.AudioDeviceTextures) > 0 {
+ p.focusState = 0
+ p.updateCursorPosition()
+ }
+ } else if p.focusState < len(p.AudioDeviceTextures)-1 {
+ p.focusState++
+ p.updateCursorPosition()
+ }
+
+ case sdl.K_UP:
+ if p.focusState == 0 {
+ p.focusState = focusToggle
+ p.updateCursorPosition()
+ } else if p.focusState > 0 {
+ p.focusState--
+ p.updateCursorPosition()
+ }
+
+ case sdl.K_RIGHT:
+ p.UpdateVolume(10)
+
+ case sdl.K_LEFT:
+ p.UpdateVolume(-10)
+
+ case sdl.K_BACKSPACE:
+ p.Context.NavigateTo(SETTINGS)
+ }
+
+ return nil
+}
+
+// ── Update ────────────────────────────────────────────────────────────────────
+
+func (p *AudioOptions) Update(dt float32) error {
+ p.spinElapsed += dt
+ if p.spinElapsed >= 1.0 {
+ p.spinElapsed -= 1.0
+ }
+ return nil
+}
+
+// ── Render helpers ────────────────────────────────────────────────────────────
+
+func (p *AudioOptions) renderVolumeBar() error {
+ config, err := db.GetConfig(p.Context.DbPtr)
+ if err != nil {
+ panic(err)
+ }
+ vol := config.SavedVolume
+
+ fillW := float32(p.volumeBarW) * float32(vol)
+ if fillW > 0 {
+ if err := p.RenderSolidColorQuad(
+ p.solidShader,
+ mgl32.Vec2{float32(p.volumeBarX), float32(p.volumeBarY)},
+ mgl32.Vec2{fillW, float32(p.volumeBarH)},
+ colors.White,
+ ); err != nil {
+ return fmt.Errorf("rendering volume fill: %w", err)
+ }
+ }
+
+ thickness := float32(2)
+ bx := float32(p.volumeBarX)
+ by := float32(p.volumeBarY)
+ bw := float32(p.volumeBarW)
+ bh := float32(p.volumeBarH)
+
+ outlineRects := [4][2]mgl32.Vec2{
+ {{bx, by}, {bw, thickness}},
+ {{bx, by + bh - thickness}, {bw, thickness}},
+ {{bx, by}, {thickness, bh}},
+ {{bx + bw - thickness, by}, {thickness, bh}}, // fix: was missing `by` as Y component
+ }
+ for _, r := range outlineRects {
+ if err := p.RenderSolidColorQuad(p.solidShader, r[0], r[1], colors.Green); err != nil {
+ return fmt.Errorf("rendering volume outline: %w", err)
+ }
+ }
+ return nil
+}
+
+// renderCursor draws the spinning triangle cursor next to the focused row.
+func (p *AudioOptions) renderCursor() error {
+ scaleY := float32(math.Cos(2 * math.Pi * float64(p.spinElapsed)))
+
+ model := mgl32.Ident4()
+ model = model.Mul4(mgl32.Translate3D(p.triX+triangleSize/2, p.triCenterY, 0))
+ model = model.Mul4(mgl32.Scale3D(triangleSize, triangleSize*scaleY, 1))
+ mvp := p.Projection.Mul4(model)
+
+ gl.UseProgram(p.solidShader.ProgramID)
+ gl.UniformMatrix4fv(p.solidShader.LocMVPMatrix, 1, false, &mvp[0])
+ gl.Uniform4f(
+ p.solidShader.LocColor,
+ float32(colors.White.R)/255.0,
+ float32(colors.White.G)/255.0,
+ float32(colors.White.B)/255.0,
+ float32(colors.White.A)/255.0,
+ )
+
+ gl.BindVertexArray(p.triVAO)
+ gl.DrawArrays(gl.TRIANGLES, 0, 3)
+ gl.BindVertexArray(0)
+ gl.UseProgram(0)
+
+ return nil
+}
+
+// ── Render ────────────────────────────────────────────────────────────────────
+
+func (p *AudioOptions) Render() error {
+ if err := p.RenderTexture(p.textShader, p.title.ID, p.title.Position(), p.title.RawDimensions(), p.title.Color); err != nil {
+ return fmt.Errorf("render title: %w", err)
+ }
+ if err := p.RenderTexture(p.textShader, p.prompt.ID, p.prompt.Position(), p.prompt.RawDimensions(), p.prompt.Color); err != nil {
+ return fmt.Errorf("render prompt: %w", err)
+ }
+
+ // Volume row
+ if err := p.RenderTexture(p.textShader, p.VolumeLabel.ID, p.VolumeLabel.Position(), p.VolumeLabel.RawDimensions(), p.VolumeLabel.Color); err != nil {
+ return fmt.Errorf("render volume label: %w", err)
+ }
+ if err := p.renderVolumeBar(); err != nil {
+ return fmt.Errorf("render volume bar: %w", err)
+ }
+ if err := p.RenderTexture(p.textShader, p.volumePercent.ID, p.volumePercent.Position(), p.volumePercent.RawDimensions(), p.volumePercent.Color); err != nil {
+ return fmt.Errorf("render volume percent: %w", err)
+ }
+
+ // Toggle
+ if err := p.RenderTexture(p.textShader, p.AudioStatusToggle.ID, p.AudioStatusToggle.Position(), p.AudioStatusToggle.RawDimensions(), p.AudioStatusToggle.Color); err != nil {
+ return fmt.Errorf("render audio toggle: %w", err)
+ }
+
+ // Device list
+ for i := range p.AudioDeviceTextures {
+ item := &p.AudioDeviceTextures[i]
+ color := colors.White
+ if i == p.activeDeviceIndex {
+ color = colors.Green
+ }
+ if err := p.RenderTexture(p.textShader, item.ID, item.Position(), item.RawDimensions(), color); err != nil {
+ return fmt.Errorf("render audio device %d: %w", i, err)
+ }
+ }
+
+ // Spinning triangle cursor — always on top
+ if err := p.renderCursor(); err != nil {
+ return fmt.Errorf("render cursor: %w", err)
+ }
+
+ return nil
+}
+
+// ── Destroy ───────────────────────────────────────────────────────────────────
+
+func (p *AudioOptions) Destroy() error {
+ gl.DeleteTextures(1, &p.title.ID)
+ gl.DeleteTextures(1, &p.prompt.ID)
+ gl.DeleteTextures(1, &p.VolumeLabel.ID)
+ gl.DeleteTextures(1, &p.volumePercent.ID)
+ gl.DeleteTextures(1, &p.AudioStatusToggle.ID)
+ for i := range p.AudioDeviceTextures {
+ gl.DeleteTextures(1, &p.AudioDeviceTextures[i].ID)
+ }
+ gl.DeleteBuffers(1, &p.triVBO)
+ gl.DeleteVertexArrays(1, &p.triVAO)
+ return nil
+}
diff --git a/archive/internal/page/DownloadingAssets.go b/archive/internal/page/DownloadingAssets.go
new file mode 100644
index 0000000..912a6a8
--- /dev/null
+++ b/archive/internal/page/DownloadingAssets.go
@@ -0,0 +1,28 @@
+package page
+
+import (
+ "github.com/veandco/go-sdl2/sdl"
+)
+
+type DownloadingAssets struct {
+}
+
+func (p *DownloadingAssets) Init(ctx *PageCtx) error {
+ return nil
+}
+
+func (p *DownloadingAssets) HandleEvent(event *sdl.Event) error {
+ return nil
+}
+
+func (p *DownloadingAssets) Update(dt float32) error {
+ return nil
+}
+
+func (p *DownloadingAssets) Render() error {
+ return nil
+}
+
+func (p *DownloadingAssets) Destroy() error {
+ return nil
+}
diff --git a/archive/internal/page/Message.go b/archive/internal/page/Message.go
new file mode 100644
index 0000000..c010f22
--- /dev/null
+++ b/archive/internal/page/Message.go
@@ -0,0 +1,29 @@
+package page
+
+import (
+ "github.com/veandco/go-sdl2/sdl"
+)
+
+type MessagePage struct {
+ Msg string
+}
+
+func (p *MessagePage) Init(ctx *PageCtx) error {
+ return nil
+}
+
+func (p *MessagePage) HandleEvent(event *sdl.Event) error {
+ return nil
+}
+
+func (p *MessagePage) Update(dt float32) error {
+ return nil
+}
+
+func (p *MessagePage) Render() error {
+ return nil
+}
+
+func (p *MessagePage) Destroy() error {
+ return nil
+}
diff --git a/archive/internal/page/emailAddressPage.go b/archive/internal/page/emailAddressPage.go
new file mode 100644
index 0000000..14b274c
--- /dev/null
+++ b/archive/internal/page/emailAddressPage.go
@@ -0,0 +1,407 @@
+package page
+
+import (
+ "fmt"
+ "regexp"
+
+ "github.com/go-gl/gl/v3.3-core/gl"
+ "github.com/go-gl/mathgl/mgl32"
+ "github.com/veandco/go-sdl2/sdl"
+ "rhemawavetech.com/rhemawave/internal/colors"
+ "rhemawavetech.com/rhemawave/internal/db"
+ "rhemawavetech.com/rhemawave/internal/fontManager"
+ "rhemawavetech.com/rhemawave/internal/shaderManager"
+)
+
+// emailRegex validates email format
+var emailRegex = regexp.MustCompile(`^[a-zA-Z0-9._%+\-]+@[a-zA-Z0-9.\-]+\.[a-zA-Z]{2,}$`)
+
+type EmailAddressPage struct {
+ Base
+
+ title string
+ titleTextureID uint32
+ titleTextureWidth int32
+ titleTextureHeight int32
+
+ currentEmailDisplayTextureID uint32
+ currentEmailDisplayTextureWidth int32
+ currentEmailDisplayTextureHeight int32
+
+ inputText string
+ inputTextTextureID uint32
+ inputTextTextureWidth int32
+ inputTextTextureHeight int32
+
+ // Error message handling
+ errorMessage string
+ errorTextureID uint32
+ errorTextureWidth int32
+ errorTextureHeight int32
+
+ // isFirstTimeSetup tracks whether page was loaded empty (first-time setup)
+ isFirstTimeSetup bool
+
+ // Text input deduplication
+ textInputSupported bool
+}
+
+// isValidEmail checks if the given string is a valid email format
+func isValidEmail(email string) bool {
+ return emailRegex.MatchString(email)
+}
+
+// Init performs basic page initialization and creation of static assets.
+func (p *EmailAddressPage) Init(ctx *PageCtx) error {
+
+ if err := p.Base.Init(ctx); err != nil {
+ return fmt.Errorf("failed base page initialization: %w", err)
+ }
+
+ p.title = "Your Email Address"
+
+ applicationFont := "SpaceMonoNerdFont-Regular"
+
+ fm := fontManager.Get()
+ textShader, ok := shaderManager.Get().Get("text")
+ if !ok {
+ return fmt.Errorf("unable to fetch text shader")
+ }
+
+ // Create title texture
+ titleTextureID, titleWidth, titleHeight, err := fm.CreateStringTexture(applicationFont, p.title, textShader)
+ if err != nil {
+ return fmt.Errorf("failed to create title texture: %w", err)
+ }
+ if titleTextureID == 0 {
+ return fmt.Errorf("CreateStringTexture returned a nil texture ID")
+ }
+
+ p.titleTextureID = titleTextureID
+ p.titleTextureWidth = titleWidth
+ p.titleTextureHeight = titleHeight
+
+ // Load existing email address from database
+ config, err := db.GetConfig(p.Context.DbPtr)
+ if err != nil {
+ panic(err)
+ }
+ emailAddress := config.EmailAddress
+
+ if emailAddress != "" {
+ p.inputText = emailAddress
+ p.isFirstTimeSetup = false
+
+ // Create current email display texture
+ currentEmailText := fmt.Sprintf("Current Email: %s", emailAddress)
+ currentEmailTextureID, currentEmailWidth, currentEmailHeight, err := fm.CreateStringTexture(applicationFont, currentEmailText, textShader)
+ if err != nil {
+ return fmt.Errorf("failed to create current email display texture: %w", err)
+ }
+ if currentEmailTextureID == 0 {
+ return fmt.Errorf("CreateStringTexture returned a nil texture ID for current email display")
+ }
+
+ p.currentEmailDisplayTextureID = currentEmailTextureID
+ p.currentEmailDisplayTextureWidth = currentEmailWidth
+ p.currentEmailDisplayTextureHeight = currentEmailHeight
+ } else {
+ p.inputText = ""
+ p.isFirstTimeSetup = true
+ }
+
+ sdl.StartTextInput()
+
+ return nil
+}
+
+// HandleEvent processes SDL events and handles them appropriately for the EmailAddressPage.
+func (p *EmailAddressPage) HandleEvent(event *sdl.Event) error {
+ actualEvent := *event
+ if !sdl.IsTextInputActive() {
+ sdl.StartTextInput()
+ }
+
+ switch e := actualEvent.(type) {
+ case *sdl.TextInputEvent:
+ if !p.textInputSupported {
+ // First TextInputEvent: the keyboard fallback already
+ // handled this character, so just record that text input
+ // is supported and skip the duplicate append.
+ p.textInputSupported = true
+ } else {
+ p.inputText += e.GetText()
+ // Clear error when user starts typing
+ p.errorMessage = ""
+ }
+ case *sdl.KeyboardEvent:
+ if e.Type == sdl.KEYDOWN {
+ switch e.Keysym.Sym {
+ case sdl.K_ESCAPE:
+ // Block escape during first-time setup
+ if p.isFirstTimeSetup {
+ return nil
+ }
+ // Allow escape back to settings if coming from settings
+ sdl.StopTextInput()
+ p.Context.NavigateTo(SETTINGS)
+ case sdl.K_RETURN:
+ // Validate email - check empty first, then format
+ if p.inputText == "" {
+ p.errorMessage = "Email address cannot be empty"
+ return nil
+ }
+ if !isValidEmail(p.inputText) {
+ p.errorMessage = "Please enter a valid email address"
+ return nil
+ }
+
+ sdl.StopTextInput()
+
+ // Save email address to database
+ config, err := db.GetConfig(p.Context.DbPtr)
+ if err != nil {
+ panic(err)
+ }
+ config.EmailAddress = p.inputText
+ p.Context.DbPtr.Save(config)
+
+ if p.isFirstTimeSetup {
+ // First-time setup: navigate to License Key page
+ p.Context.NavigateTo(LICENSE_KEY)
+ } else {
+ p.Context.NavigateTo(SETTINGS)
+ }
+ case sdl.K_BACKSPACE:
+ if len(p.inputText) > 0 {
+ p.inputText = p.inputText[:len(p.inputText)-1]
+ // Clear error when user edits input
+ p.errorMessage = ""
+ }
+ default:
+ // Keyboard fallback: if TextInputEvent is not supported,
+ // convert printable keycodes to characters directly.
+ // This handles kiosk systems without an input method framework.
+ if !p.textInputSupported {
+ if ch := keycodeToChar(e.Keysym.Sym, e.Keysym.Mod); ch != 0 {
+ p.inputText += string(ch)
+ p.errorMessage = ""
+ }
+ }
+ }
+ }
+ }
+ return nil
+}
+
+// Update updates animations and changing textures and other changes using `dt` which represents a time delta in float32.
+func (p *EmailAddressPage) Update(dt float32) error {
+ // Get application font from database
+ applicationFont := "SpaceMonoNerdFont-Regular"
+
+ fm := fontManager.Get()
+ sm := shaderManager.Get()
+ shader, ok := sm.Get("text")
+ if !ok {
+ return fmt.Errorf("unable to fetch text shader")
+ }
+
+ // Update input text texture
+ if len(p.inputText) > 0 {
+ // Create the new inputText texture
+ inputTextTextureID, inputTextTextureWidth, inputTextTextureHeight, err := fm.CreateStringTexture(
+ applicationFont,
+ p.inputText,
+ shader,
+ )
+ if err != nil {
+ return fmt.Errorf("unable to create new input text texture: %w", err)
+ }
+
+ // Delete old texture if it exists
+ if p.inputTextTextureID != 0 {
+ gl.DeleteTextures(1, &p.inputTextTextureID)
+ }
+
+ p.inputTextTextureID = inputTextTextureID
+ p.inputTextTextureWidth = inputTextTextureWidth
+ p.inputTextTextureHeight = inputTextTextureHeight
+ }
+
+ // Update error message texture
+ if p.errorMessage != "" {
+ errorTextureID, errorWidth, errorHeight, err := fm.CreateStringTexture(
+ applicationFont,
+ p.errorMessage,
+ shader,
+ )
+ if err != nil {
+ return fmt.Errorf("unable to create error text texture: %w", err)
+ }
+
+ // Delete old error texture if it exists
+ if p.errorTextureID != 0 {
+ gl.DeleteTextures(1, &p.errorTextureID)
+ }
+
+ p.errorTextureID = errorTextureID
+ p.errorTextureWidth = errorWidth
+ p.errorTextureHeight = errorHeight
+ } else {
+ // Clear error texture if no error message
+ if p.errorTextureID != 0 {
+ gl.DeleteTextures(1, &p.errorTextureID)
+ p.errorTextureID = 0
+ }
+ }
+
+ return nil
+}
+
+// Render performs page drawing logic.
+func (p *EmailAddressPage) Render() error {
+ config, err := db.GetConfig(p.Context.DbPtr)
+ if err != nil {
+ panic(err)
+ }
+ // Get base font size from database
+ baseFontSize := config.StandardFontSize
+
+ sm := shaderManager.Get()
+
+ // 1. Calculate Scale
+ titleFontSize := int32(64)
+ titleScale := float32(titleFontSize) / float32(baseFontSize)
+ currentEmailFontSize := int32(28)
+ currentEmailScale := float32(currentEmailFontSize) / float32(baseFontSize)
+ padding := int32(4)
+ verticalMargin := int32(20)
+
+ // 2. Define dimensions
+ targetFontSize := int32(36)
+ scale := float32(targetFontSize) / float32(baseFontSize)
+ border := int32(3)
+ boxH := targetFontSize + (padding * 2)
+ boxW := int32(600) + (padding * 2)
+ boxDimensions := mgl32.Vec2{float32(boxW), float32(boxH)}
+ borderBoxH := boxH + (border * 2)
+ borderBoxW := boxW + (border * 2)
+ borderBoxDimensions := mgl32.Vec2{float32(borderBoxW), float32(borderBoxH)}
+ titleH := float32(p.titleTextureHeight) * titleScale
+ titleW := float32(p.titleTextureWidth) * titleScale
+ titleDimensions := mgl32.Vec2{titleW, titleH}
+ inputTextH := float32(p.inputTextTextureHeight) * scale
+ inputTextW := float32(p.inputTextTextureWidth) * scale
+ inputTextDimensions := mgl32.Vec2{inputTextW, inputTextH}
+
+ var currentEmailDisplayH, currentEmailDisplayW float32
+ var currentEmailDisplayDimensions mgl32.Vec2
+ if p.currentEmailDisplayTextureID != 0 {
+ currentEmailDisplayH = float32(p.currentEmailDisplayTextureHeight) * currentEmailScale
+ currentEmailDisplayW = float32(p.currentEmailDisplayTextureWidth) * currentEmailScale
+ currentEmailDisplayDimensions = mgl32.Vec2{currentEmailDisplayW, currentEmailDisplayH}
+ }
+
+ // Error text dimensions
+ errorFontSize := int32(20)
+ errorScale := float32(errorFontSize) / float32(baseFontSize)
+ var errorTextH, errorTextW float32
+ var errorTextDimensions mgl32.Vec2
+ if p.errorTextureID != 0 {
+ errorTextH = float32(p.errorTextureHeight) * errorScale
+ errorTextW = float32(p.errorTextureWidth) * errorScale
+ errorTextDimensions = mgl32.Vec2{errorTextW, errorTextH}
+ }
+
+ // 3. Define positions
+ borderBoxY := p.Base.ScreenCenterY - (borderBoxH / 2)
+ borderBoxX := p.Base.ScreenCenterX - (borderBoxW / 2)
+ borderBoxPosition := mgl32.Vec2{float32(borderBoxX), float32(borderBoxY)}
+ boxY := p.Base.ScreenCenterY - (boxH / 2)
+ boxX := p.Base.ScreenCenterX - (boxW / 2)
+ boxPosition := mgl32.Vec2{float32(boxX), float32(boxY)}
+ titleY := borderBoxY + borderBoxH + verticalMargin
+ titleX := p.Base.ScreenCenterX - int32(titleW/2)
+ titlePosition := mgl32.Vec2{float32(titleX), float32(titleY)}
+ inputTextY := boxY + padding
+ inputTextX := boxX + padding
+ inputTextPosition := mgl32.Vec2{float32(inputTextX), float32(inputTextY)}
+
+ var currentEmailDisplayPosition mgl32.Vec2
+ if p.currentEmailDisplayTextureID != 0 {
+ currentEmailDisplayY := borderBoxY - int32(currentEmailDisplayH) - verticalMargin
+ currentEmailDisplayX := p.Base.ScreenCenterX - int32(currentEmailDisplayW/2)
+ currentEmailDisplayPosition = mgl32.Vec2{float32(currentEmailDisplayX), float32(currentEmailDisplayY)}
+ }
+
+ // Error text position (below current email display to avoid overlap)
+ var errorTextPosition mgl32.Vec2
+ if p.errorTextureID != 0 {
+ var errorTextY int32
+ if p.currentEmailDisplayTextureID != 0 {
+ // Position below the current email display
+ errorTextY = borderBoxY - int32(currentEmailDisplayH) - verticalMargin - int32(errorTextH) - (verticalMargin / 2)
+ } else {
+ // No current email display, position below the input box
+ errorTextY = borderBoxY - int32(errorTextH) - (verticalMargin / 2)
+ }
+ errorTextX := p.Base.ScreenCenterX - int32(errorTextW/2)
+ errorTextPosition = mgl32.Vec2{float32(errorTextX), float32(errorTextY)}
+ }
+
+ // 4. Define Colors
+ white := sdl.Color{R: 255, G: 255, B: 255, A: 255}
+ grey := sdl.Color{R: 120, G: 120, B: 120, A: 255}
+ darkGrey := sdl.Color{R: 30, G: 30, B: 30, A: 255}
+
+ // 5. Get Shaders
+ textShader, _ := sm.Get("text")
+ solidShader, _ := sm.Get("solid_color")
+
+ // 6. Draw everything
+ p.Base.RenderSolidColorQuad(solidShader, borderBoxPosition, borderBoxDimensions, grey)
+ p.Base.RenderSolidColorQuad(solidShader, boxPosition, boxDimensions, darkGrey)
+ p.Base.RenderTexture(textShader, p.titleTextureID, titlePosition, titleDimensions, white)
+
+ // Draw current email display if it exists
+ if p.currentEmailDisplayTextureID != 0 {
+ p.Base.RenderTexture(textShader, p.currentEmailDisplayTextureID, currentEmailDisplayPosition, currentEmailDisplayDimensions, white)
+ }
+
+ if len(p.inputText) > 0 {
+ p.Base.RenderTexture(textShader, p.inputTextTextureID, inputTextPosition, inputTextDimensions, white)
+ }
+
+ // Draw error message if it exists
+ if p.errorTextureID != 0 {
+ p.Base.RenderTexture(textShader, p.errorTextureID, errorTextPosition, errorTextDimensions, colors.ErrorRed)
+ }
+ return nil
+}
+
+// Destroy cleans up page-specific resources.
+func (p *EmailAddressPage) Destroy() error {
+
+ gl.DeleteTextures(1, &p.titleTextureID)
+
+ // Delete current email display texture if it exists
+ if p.currentEmailDisplayTextureID != 0 {
+ gl.DeleteTextures(1, &p.currentEmailDisplayTextureID)
+ p.currentEmailDisplayTextureID = 0
+ }
+
+ // Delete input text texture if it exists
+ if p.inputTextTextureID != 0 {
+ gl.DeleteTextures(1, &p.inputTextTextureID)
+ p.inputTextTextureID = 0
+ }
+
+ // Delete error texture if it exists
+ if p.errorTextureID != 0 {
+ gl.DeleteTextures(1, &p.errorTextureID)
+ p.errorTextureID = 0
+ }
+
+ sdl.StopTextInput()
+ return p.Base.Destroy()
+}
diff --git a/archive/internal/page/home.go b/archive/internal/page/home.go
new file mode 100644
index 0000000..087828b
--- /dev/null
+++ b/archive/internal/page/home.go
@@ -0,0 +1,419 @@
+package page
+
+import (
+ "fmt"
+
+ "github.com/go-gl/gl/v3.3-core/gl"
+ "github.com/go-gl/mathgl/mgl32"
+ "github.com/veandco/go-sdl2/sdl"
+ "rhemawavetech.com/rhemawave/internal/colors"
+ "rhemawavetech.com/rhemawave/internal/db"
+ "rhemawavetech.com/rhemawave/internal/download"
+ "rhemawavetech.com/rhemawave/internal/fontManager"
+ "rhemawavetech.com/rhemawave/internal/shaderManager"
+)
+
+var GitVersion = "07112026-1710"
+
+type Home struct {
+ Base
+ fm *fontManager.FontManager
+ font *fontManager.FontEntry
+ title StringItem
+ version StringItem
+ prompt StringItem
+ note StringItem
+ message StringItem
+ downloadProgressChan chan download.DownloadStatus
+ licenseInfoHeading StringItem
+ emailDisplay StringItem
+ licenseKeyDisplay StringItem
+ hasLicenseInfo bool
+ baseFontSize int
+ isDownloadComplete bool
+ downloadFailed bool
+ downloadDone bool
+}
+
+// Init performs basic page initialization and creation of static assets.
+func (p *Home) Init(ctx *PageCtx) error {
+ title := "Radiant Wave"
+ version := GitVersion
+ prompt := "Press F2 to Start, or F3 for Settings"
+ note := "You can always press F1 to return here"
+
+ if err := p.Base.Init(ctx); err != nil {
+ return fmt.Errorf("failed base page initialization: %w", err)
+ }
+
+ // Get font
+ p.fm = fontManager.Get()
+ font, ok := p.fm.GetFont("SpaceMonoNerdFont-Regular")
+ if !ok {
+ return fmt.Errorf("unable to fetch font")
+ }
+ p.font = font
+
+ // Create title texture
+ var err error
+ p.title, err = NewStringItem(title, font, colors.White)
+ if err != nil {
+ return fmt.Errorf("unable to create title string texture: %w", err)
+ }
+
+ // Create version texture
+ versionString := "Version: " + version
+ p.version, err = NewStringItem(versionString, font, colors.White)
+ if err != nil {
+ return fmt.Errorf("unable to create version string texture: %w", err)
+ }
+
+ // Create prompt texture
+ p.prompt, err = NewStringItem(prompt, font, colors.White)
+ if err != nil {
+ return fmt.Errorf("unable to create prompt string texture: %w", err)
+ }
+
+ // Create note texture
+ p.note, err = NewStringItem(note, font, colors.White)
+ if err != nil {
+ return fmt.Errorf("unable to create note string texture: %w", err)
+ }
+
+ // Create download channel and message
+ p.downloadProgressChan = make(chan download.DownloadStatus)
+
+ // Initialize message
+ p.message, err = NewStringItem("Status: Initializing...", font, colors.White)
+ if err != nil {
+ return fmt.Errorf("unable to create initial message texture: %w", err)
+ }
+
+ config, err := db.GetConfig(p.Context.DbPtr)
+ if err != nil {
+ panic(err)
+ }
+
+ // Create license info textures if data exists
+ if config.EmailAddress != "" || config.LicenseKey != "" {
+ p.hasLicenseInfo = true
+
+ // Create heading
+ p.licenseInfoHeading, err = NewStringItem("License Info", font, colors.White)
+ if err != nil {
+ return fmt.Errorf("unable to create license info heading texture: %w", err)
+ }
+
+ // Create email display if exists
+ if config.EmailAddress != "" {
+ emailText := fmt.Sprintf("Email: %s", config.EmailAddress)
+ p.emailDisplay, err = NewStringItem(emailText, font, colors.White)
+ if err != nil {
+ return fmt.Errorf("unable to create email display texture: %w", err)
+ }
+ }
+
+ // Create license key display if exists
+ if config.LicenseKey != "" {
+ licenseKeyText := fmt.Sprintf("License Key: %s", config.LicenseKey)
+ p.licenseKeyDisplay, err = NewStringItem(licenseKeyText, font, colors.White)
+ if err != nil {
+ return fmt.Errorf("unable to create license key display texture: %w", err)
+ }
+ }
+ }
+
+ // Get base font size from database
+ baseFontSize := config.StandardFontSize
+ p.baseFontSize = baseFontSize
+
+ // Scale the note text
+ fontSize := int32(32)
+ scale := float32(fontSize) / float32(baseFontSize)
+ p.note.W = int32(float32(p.note.W) * scale * 0.75)
+ p.note.H = int32(float32(p.note.H) * scale * 0.75)
+
+ // Scale license info texts
+ if p.hasLicenseInfo {
+ licenseInfoScale := float32(28) / float32(baseFontSize)
+ p.licenseInfoHeading.W = int32(float32(p.licenseInfoHeading.W) * licenseInfoScale)
+ p.licenseInfoHeading.H = int32(float32(p.licenseInfoHeading.H) * licenseInfoScale)
+ if p.emailDisplay.ID != 0 {
+ p.emailDisplay.W = int32(float32(p.emailDisplay.W) * licenseInfoScale * 0.85)
+ p.emailDisplay.H = int32(float32(p.emailDisplay.H) * licenseInfoScale * 0.85)
+ }
+ if p.licenseKeyDisplay.ID != 0 {
+ p.licenseKeyDisplay.W = int32(float32(p.licenseKeyDisplay.W) * licenseInfoScale * 0.85)
+ p.licenseKeyDisplay.H = int32(float32(p.licenseKeyDisplay.H) * licenseInfoScale * 0.85)
+ }
+ }
+
+ // Scale message text
+ messageScale := float32(28) / float32(baseFontSize)
+ p.message.W = int32(float32(p.message.W) * messageScale)
+ p.message.H = int32(float32(p.message.H) * messageScale)
+
+ return nil
+}
+
+// HandleEvent processes SDL events and handles them appropriately for the Home page.
+func (p *Home) HandleEvent(event *sdl.Event) error {
+ return nil
+}
+
+func (p *Home) Update(dt float32) error {
+ var (
+ progressUpdate download.DownloadStatus
+ ok bool
+ gotUpdate bool
+ )
+
+ // Drain the channel, keeping only the newest update.
+ for {
+ select {
+ case progressUpdate, ok = <-p.Context.MessageChannel:
+ gotUpdate = true
+ if !ok {
+ if p.downloadFailed {
+ p.setMessage("Download failed — restart to retry", colors.Red)
+ } else {
+ p.setMessage("Status: READY", colors.Green)
+ p.isDownloadComplete = true
+ if !p.downloadDone {
+ p.downloadDone = true
+ close(p.Context.DownloadDone)
+ }
+ }
+ return nil
+ }
+ default:
+ goto drained
+ }
+ }
+
+drained:
+ if !gotUpdate {
+ return nil
+ }
+
+ if progressUpdate.Err != nil {
+ p.downloadFailed = true
+ p.setMessage(fmt.Sprintf("Error: %s", progressUpdate.Err.Error()), colors.Red)
+ return nil
+ }
+
+ // Build the display string based on what the download package tells us.
+ var msg string
+ if progressUpdate.Max <= 0 {
+ // No total known yet — show the descriptive message from the package.
+ // This covers: "Fetching file manifest", "Checking local files",
+ // "Comparing checksums", "Building download list", etc.
+ msg = fmt.Sprintf("Status: %s", progressUpdate.Msg)
+ } else {
+ // We have a known total — show percentage.
+ pct := float64(progressUpdate.Cur) / float64(progressUpdate.Max) * 100
+ msg = fmt.Sprintf("Status: Downloading Assets — %.1f%%", pct)
+ }
+
+ p.setMessage(msg, colors.White)
+ return nil
+}
+
+// setMessage deletes the old message texture and builds a new one.
+func (p *Home) setMessage(text string, color sdl.Color) {
+ if p.message.ID != 0 {
+ gl.DeleteTextures(1, &p.message.ID)
+ p.message.ID = 0
+ }
+
+ newMsg, err := NewStringItem(text, p.font, color)
+ if err != nil {
+ return
+ }
+
+ messageScale := float32(28) / float32(p.baseFontSize)
+ newMsg.W = int32(float32(newMsg.W) * messageScale)
+ newMsg.H = int32(float32(newMsg.H) * messageScale)
+ p.message = newMsg
+}
+
+func (p *Home) Render() error {
+ baseFontSize := p.baseFontSize
+ sm := shaderManager.Get()
+ verticalMargin := int32(20)
+ licenseInfoMargin := int32(10)
+
+ // 1) Calculate scales
+ titleFontSize := int32(64)
+ bodyFontSize := int32(32)
+
+ titleScale := float32(titleFontSize) / float32(baseFontSize)
+ bodyScale := float32(bodyFontSize) / float32(baseFontSize)
+
+ // 2) Calculate dimensions (scaled)
+ titleW := float32(p.title.W) * titleScale
+ titleH := float32(p.title.H) * titleScale
+ titleDim := mgl32.Vec2{titleW, titleH}
+
+ versionW := float32(p.version.W) * bodyScale
+ versionH := float32(p.version.H) * bodyScale
+ versionDim := mgl32.Vec2{versionW, versionH}
+
+ promptW := float32(p.prompt.W) * bodyScale
+ promptH := float32(p.prompt.H) * bodyScale
+ promptDim := mgl32.Vec2{promptW, promptH}
+
+ // Note dimensions (already scaled in Init)
+ noteW := float32(p.note.W)
+ noteH := float32(p.note.H)
+
+ // Message dimensions (already scaled in Init/Update)
+ messageW := float32(p.message.W)
+ messageH := float32(p.message.H)
+
+ // License info dimensions (already scaled in Init)
+ licenseHeadingW := float32(p.licenseInfoHeading.W)
+ licenseHeadingH := float32(p.licenseInfoHeading.H)
+ var emailDisplayW, emailDisplayH, licenseKeyDisplayW, licenseKeyDisplayH float32
+ if p.emailDisplay.ID != 0 {
+ emailDisplayW = float32(p.emailDisplay.W)
+ emailDisplayH = float32(p.emailDisplay.H)
+ }
+ if p.licenseKeyDisplay.ID != 0 {
+ licenseKeyDisplayW = float32(p.licenseKeyDisplay.W)
+ licenseKeyDisplayH = float32(p.licenseKeyDisplay.H)
+ }
+
+ // 3) Calculate total height of the vertical stack
+ totalH := int32(titleH) + verticalMargin +
+ int32(versionH) + verticalMargin +
+ int32(promptH) + verticalMargin +
+ int32(noteH)
+
+ // 4) Y-up layout: start from the TOP of the centered stack and step DOWN
+ top := p.Base.ScreenCenterY + totalH/2
+
+ titleY := top - int32(titleH)
+ versionY := titleY - verticalMargin - int32(versionH)
+ p.prompt.Y = versionY - verticalMargin - int32(promptH)
+ p.note.Y = p.prompt.Y - verticalMargin - int32(noteH)
+
+ // 5) Center X for each item
+ titleX := p.Base.ScreenCenterX - int32(titleW/2)
+ versionX := p.Base.ScreenCenterX - int32(versionW/2)
+ p.prompt.X = p.Base.ScreenCenterX - int32(promptW/2)
+ p.note.X = p.Base.ScreenCenterX - int32(noteW/2)
+
+ titlePos := mgl32.Vec2{float32(titleX), float32(titleY)}
+ versionPos := mgl32.Vec2{float32(versionX), float32(versionY)}
+
+ // 6) Position license info at bottom center
+ if p.hasLicenseInfo {
+ bottomMargin := int32(20)
+
+ // Calculate total height of license info block
+ licenseInfoTotalH := int32(licenseHeadingH)
+ if p.emailDisplay.ID != 0 {
+ licenseInfoTotalH += int32(emailDisplayH) + licenseInfoMargin
+ }
+ if p.licenseKeyDisplay.ID != 0 {
+ licenseInfoTotalH += int32(licenseKeyDisplayH) + licenseInfoMargin
+ }
+
+ // Start from bottom and work up
+ currentY := bottomMargin
+
+ // License key (bottom-most if it exists)
+ if p.licenseKeyDisplay.ID != 0 {
+ p.licenseKeyDisplay.X = p.Base.ScreenCenterX - int32(licenseKeyDisplayW/2)
+ p.licenseKeyDisplay.Y = currentY
+ currentY += int32(licenseKeyDisplayH) + licenseInfoMargin
+ }
+
+ // Email
+ if p.emailDisplay.ID != 0 {
+ p.emailDisplay.X = p.Base.ScreenCenterX - int32(emailDisplayW/2)
+ p.emailDisplay.Y = currentY
+ currentY += int32(emailDisplayH) + licenseInfoMargin
+ }
+
+ // Heading (top-most)
+ p.licenseInfoHeading.X = p.Base.ScreenCenterX - int32(licenseHeadingW/2)
+ p.licenseInfoHeading.Y = currentY
+ }
+
+ // 7) Position message between license info and note/prompt
+ if p.hasLicenseInfo {
+ // Calculate the top of the license info block
+ licenseInfoTopY := p.licenseInfoHeading.Y + int32(licenseHeadingH)
+ if p.emailDisplay.ID != 0 {
+ licenseInfoTopY += int32(emailDisplayH) + licenseInfoMargin
+ }
+ if p.licenseKeyDisplay.ID != 0 {
+ licenseInfoTopY += int32(licenseKeyDisplayH) + licenseInfoMargin
+ }
+
+ // Center the message vertically between license info and note
+ availableSpace := p.note.Y - licenseInfoTopY - verticalMargin
+ p.message.Y = licenseInfoTopY + availableSpace/2 - int32(messageH/2)
+ } else {
+ // If no license info, place message below note
+ p.message.Y = p.note.Y - verticalMargin - int32(messageH)
+ }
+ p.message.X = p.Base.ScreenCenterX - int32(messageW/2)
+
+ // 8) Get shader and render
+ textShader, ok := sm.Get("text")
+ if !ok {
+ return fmt.Errorf("failed to fetch text shader")
+ }
+ color := colors.White
+
+ p.Base.RenderTexture(textShader, p.title.ID, titlePos, titleDim, color)
+ p.Base.RenderTexture(textShader, p.version.ID, versionPos, versionDim, color)
+ p.Base.RenderTexture(textShader, p.prompt.ID, mgl32.Vec2{float32(p.prompt.X), float32(p.prompt.Y)}, promptDim, color)
+ p.Base.RenderTexture(textShader, p.note.ID, mgl32.Vec2{float32(p.note.X), float32(p.note.Y)}, mgl32.Vec2{noteW, noteH}, color)
+
+ // Render message
+ if p.message.ID != 0 {
+ msgColor := colors.White
+ if p.isDownloadComplete {
+ msgColor = colors.Green
+ }
+ p.Base.RenderTexture(textShader, p.message.ID, mgl32.Vec2{float32(p.message.X), float32(p.message.Y)}, mgl32.Vec2{messageW, messageH}, msgColor)
+ }
+
+ // Render license info if it exists
+ if p.hasLicenseInfo {
+ p.Base.RenderTexture(textShader, p.licenseInfoHeading.ID, mgl32.Vec2{float32(p.licenseInfoHeading.X), float32(p.licenseInfoHeading.Y)}, mgl32.Vec2{licenseHeadingW, licenseHeadingH}, color)
+ if p.emailDisplay.ID != 0 {
+ p.Base.RenderTexture(textShader, p.emailDisplay.ID, mgl32.Vec2{float32(p.emailDisplay.X), float32(p.emailDisplay.Y)}, mgl32.Vec2{emailDisplayW, emailDisplayH}, color)
+ }
+ if p.licenseKeyDisplay.ID != 0 {
+ p.Base.RenderTexture(textShader, p.licenseKeyDisplay.ID, mgl32.Vec2{float32(p.licenseKeyDisplay.X), float32(p.licenseKeyDisplay.Y)}, mgl32.Vec2{licenseKeyDisplayW, licenseKeyDisplayH}, color)
+ }
+ }
+
+ return nil
+}
+
+// Destroy cleans up page-specific resources.
+func (p *Home) Destroy() error {
+ gl.DeleteTextures(1, &p.title.ID)
+ gl.DeleteTextures(1, &p.version.ID)
+ gl.DeleteTextures(1, &p.prompt.ID)
+ gl.DeleteTextures(1, &p.note.ID)
+ gl.DeleteTextures(1, &p.message.ID)
+
+ if p.hasLicenseInfo {
+ gl.DeleteTextures(1, &p.licenseInfoHeading.ID)
+ if p.emailDisplay.ID != 0 {
+ gl.DeleteTextures(1, &p.emailDisplay.ID)
+ }
+ if p.licenseKeyDisplay.ID != 0 {
+ gl.DeleteTextures(1, &p.licenseKeyDisplay.ID)
+ }
+ }
+
+ return p.Base.Destroy()
+}
diff --git a/archive/internal/page/home_test.go b/archive/internal/page/home_test.go
new file mode 100644
index 0000000..02d59e4
--- /dev/null
+++ b/archive/internal/page/home_test.go
@@ -0,0 +1,107 @@
+package page
+
+import (
+ "testing"
+
+ "rhemawavetech.com/rhemawave/internal/download"
+)
+
+// Regression: DownloadDone was closed twice when checkState() re-navigated
+// to HOME on the DOWNLOADING_ASSETS -> READY transition. The new Home page
+// saw the already-closed MessageChannel and tried to close DownloadDone
+// again, causing panic: close of closed channel.
+//
+// Primary fix: checkState() now skips navigation when transitioning between
+// states that both map to the HOME page. The downloadDone flag on Home is
+// defense-in-depth.
+
+// TestHomeDownloadDoneGuardPreventsDoubleClose verifies that the per-instance
+// downloadDone flag prevents closing DownloadDone more than once, even if a
+// new Home page somehow reaches the close path.
+func TestHomeDownloadDoneGuardPreventsDoubleClose(t *testing.T) {
+ downloadDone := make(chan struct{})
+
+ // First Home closes DownloadDone.
+ h1 := &Home{downloadDone: false}
+ h1.Context = &PageCtx{DownloadDone: downloadDone}
+ if !h1.downloadDone {
+ h1.downloadDone = true
+ close(h1.Context.DownloadDone)
+ }
+
+ // Second Home with guard already set (simulates defense-in-depth).
+ h2 := &Home{downloadDone: true}
+ h2.Context = &PageCtx{DownloadDone: downloadDone}
+ if !h2.downloadDone {
+ h2.downloadDone = true
+ close(h2.Context.DownloadDone) // would panic without guard
+ }
+}
+
+// TestHomeDownloadDoneGuardUnsetWouldPanic proves that without the
+// downloadDone guard, closing DownloadDone a second time panics.
+func TestHomeDownloadDoneGuardUnsetWouldPanic(t *testing.T) {
+ downloadDone := make(chan struct{})
+ close(downloadDone) // pre-close
+
+ defer func() {
+ if r := recover(); r == nil {
+ t.Error("expected panic when closing already-closed channel")
+ }
+ }()
+
+ // New Home with downloadDone=false tries to close an already-closed channel.
+ h := &Home{downloadDone: false}
+ h.Context = &PageCtx{DownloadDone: downloadDone}
+ if !h.downloadDone {
+ h.downloadDone = true
+ close(h.Context.DownloadDone) // panics
+ }
+}
+
+// TestHomeDownloadFailedDoesNotClose verifies that when a download fails,
+// DownloadDone is NOT closed (the error path should not signal success).
+func TestHomeDownloadFailedDoesNotClose(t *testing.T) {
+ downloadDone := make(chan struct{})
+
+ h := &Home{
+ downloadFailed: true,
+ downloadDone: false,
+ }
+ h.Context = &PageCtx{
+ MessageChannel: make(chan download.DownloadStatus),
+ DownloadDone: downloadDone,
+ }
+
+ // Simulate the Update logic: on failure, downloadDone should not be set
+ // and DownloadDone should not be closed.
+ if h.downloadFailed {
+ // Error path: do not close DownloadDone.
+ } else if !h.downloadDone {
+ h.downloadDone = true
+ close(h.Context.DownloadDone)
+ }
+
+ select {
+ case <-downloadDone:
+ t.Error("DownloadDone should not be closed on download failure")
+ default:
+ // Correct: channel is still open.
+ }
+}
+
+// TestHomeDownloadDoneAlreadyClosed verifies that a Home page with
+// downloadDone=true never attempts to close the channel.
+func TestHomeDownloadDoneAlreadyClosed(t *testing.T) {
+ downloadDone := make(chan struct{})
+ close(downloadDone)
+
+ h := &Home{downloadDone: true}
+ h.Context = &PageCtx{DownloadDone: downloadDone}
+
+ // Guard should prevent any close attempt.
+ if !h.downloadDone {
+ h.downloadDone = true
+ close(h.Context.DownloadDone)
+ }
+}
diff --git a/archive/internal/page/licenseKeyPage.go b/archive/internal/page/licenseKeyPage.go
new file mode 100644
index 0000000..675354e
--- /dev/null
+++ b/archive/internal/page/licenseKeyPage.go
@@ -0,0 +1,459 @@
+package page
+
+import (
+ "fmt"
+ "os"
+ "path/filepath"
+ "strings"
+
+ "github.com/go-gl/gl/v3.3-core/gl"
+ "github.com/go-gl/mathgl/mgl32"
+ "github.com/veandco/go-sdl2/sdl"
+ "rhemawavetech.com/rhemawave/internal/colors"
+ "rhemawavetech.com/rhemawave/internal/db"
+ "rhemawavetech.com/rhemawave/internal/fontManager"
+ "rhemawavetech.com/rhemawave/internal/logger"
+ "rhemawavetech.com/rhemawave/internal/shaderManager"
+)
+
+type LicenseKeyPage struct {
+ Base
+
+ title string
+ titleTextureID uint32
+ titleTextureWidth int32
+ titleTextureHeight int32
+
+ currentLicenseDisplayTextureID uint32
+ currentLicenseDisplayTextureWidth int32
+ currentLicenseDisplayTextureHeight int32
+
+ inputText string
+ inputTextTextureID uint32
+ inputTextTextureWidth int32
+ inputTextTextureHeight int32
+
+ // Error message handling
+ errorMessage string
+ errorTextureID uint32
+ errorTextureWidth int32
+ errorTextureHeight int32
+
+ // isFirstTimeSetup tracks whether page was loaded empty (first-time setup)
+ isFirstTimeSetup bool
+
+ // Text input deduplication
+ textInputSupported bool
+}
+
+// Init performs basic page initialization and creation of static assets.
+func (p *LicenseKeyPage) Init(ctx *PageCtx) error {
+
+ if err := p.Base.Init(ctx); err != nil {
+ return fmt.Errorf("failed base page initialization: %w", err)
+ }
+
+ p.title = "License Key"
+
+ // Get application font from database
+ applicationFont := "SpaceMonoNerdFont-Regular"
+
+ fm := fontManager.Get()
+ textShader, ok := shaderManager.Get().Get("text")
+ if !ok {
+ return fmt.Errorf("unable to fetch text shader")
+ }
+
+ // Create title texture
+ titleTextureID, titleWidth, titleHeight, err := fm.CreateStringTexture(applicationFont, p.title, textShader)
+ if err != nil {
+ return fmt.Errorf("failed to create title texture: %w", err)
+ }
+ if titleTextureID == 0 {
+ return fmt.Errorf("CreateStringTexture returned a nil texture ID")
+ }
+
+ p.titleTextureID = titleTextureID
+ p.titleTextureWidth = titleWidth
+ p.titleTextureHeight = titleHeight
+
+ // Load existing license key from database
+ config, err := db.GetConfig(p.Context.DbPtr)
+ if err != nil {
+ panic(err)
+ }
+ licenseKey := config.LicenseKey
+
+ if licenseKey != "" {
+ p.inputText = licenseKey
+ p.isFirstTimeSetup = false
+
+ // Create current license key display texture
+ currentLicenseText := fmt.Sprintf("Current License Key: %s", licenseKey)
+ currentLicenseTextureID, currentLicenseWidth, currentLicenseHeight, err := fm.CreateStringTexture(applicationFont, currentLicenseText, textShader)
+ if err != nil {
+ return fmt.Errorf("failed to create current license display texture: %w", err)
+ }
+ if currentLicenseTextureID == 0 {
+ return fmt.Errorf("CreateStringTexture returned a nil texture ID for current license display")
+ }
+
+ p.currentLicenseDisplayTextureID = currentLicenseTextureID
+ p.currentLicenseDisplayTextureWidth = currentLicenseWidth
+ p.currentLicenseDisplayTextureHeight = currentLicenseHeight
+ } else {
+ p.inputText = ""
+ p.isFirstTimeSetup = true
+ }
+
+ sdl.StartTextInput()
+
+ return nil
+}
+
+// formatLicenseKey formats the input string with dashes every 4 characters
+// and limits to 16 alphanumeric characters (not counting dashes)
+func formatLicenseKey(input string) string {
+ // Remove all dashes and non-alphanumeric characters
+ cleaned := strings.Map(func(r rune) rune {
+ if (r >= 'a' && r <= 'z') || (r >= 'A' && r <= 'Z') || (r >= '0' && r <= '9') {
+ return r
+ }
+ return -1
+ }, input)
+
+ // Limit to 16 characters
+ if len(cleaned) > 16 {
+ cleaned = cleaned[:16]
+ }
+
+ // Insert dashes every 4 characters
+ var result strings.Builder
+ for i, char := range cleaned {
+ if i > 0 && i%4 == 0 {
+ result.WriteRune('-')
+ }
+ result.WriteRune(char)
+ }
+
+ return result.String()
+}
+
+// HandleEvent processes SDL events and handles them appropriately for the LicenseKeyPage.
+func (p *LicenseKeyPage) HandleEvent(event *sdl.Event) error {
+ actualEvent := *event
+ if !sdl.IsTextInputActive() {
+ sdl.StartTextInput()
+ }
+
+ switch e := actualEvent.(type) {
+ case *sdl.TextInputEvent:
+ if !p.textInputSupported {
+ // First TextInputEvent: the keyboard fallback already
+ // handled this character, so just record that text input
+ // is supported and skip the duplicate append.
+ p.textInputSupported = true
+ } else {
+ // Add the new character and reformat
+ p.inputText += e.GetText()
+ p.inputText = formatLicenseKey(p.inputText)
+ // Clear error when user starts typing
+ p.errorMessage = ""
+ }
+ case *sdl.KeyboardEvent:
+ if e.Type == sdl.KEYDOWN {
+ switch e.Keysym.Sym {
+ case sdl.K_ESCAPE:
+ // Block escape during first-time setup
+ if p.isFirstTimeSetup {
+ return nil
+ }
+ // Allow escape back to settings if coming from settings
+ sdl.StopTextInput()
+ p.Context.NavigateTo(SETTINGS)
+ case sdl.K_RETURN:
+ // Validate license key - check empty first, then length, then characters
+ cleaned := strings.ReplaceAll(p.inputText, "-", "")
+ if cleaned == "" {
+ p.errorMessage = "License key cannot be empty"
+ return nil
+ }
+ if len(cleaned) != 16 {
+ p.errorMessage = fmt.Sprintf("License key must be 16 characters (currently %d)", len(cleaned))
+ return nil
+ }
+ // Check for invalid characters
+ for _, r := range cleaned {
+ if !((r >= 'a' && r <= 'z') || (r >= 'A' && r <= 'Z') || (r >= '0' && r <= '9')) {
+ p.errorMessage = "License key must contain only letters and numbers"
+ return nil
+ }
+ }
+
+ sdl.StopTextInput()
+
+ // Save license key to database
+ config, err := db.GetConfig(p.Context.DbPtr)
+ if err != nil {
+ panic(err)
+ }
+ config.LicenseKey = p.inputText
+ p.Context.DbPtr.Save(config)
+
+ // Write license key to plain text file for the updater
+ if homeDir, err := os.UserHomeDir(); err == nil {
+ keyPath := filepath.Join(homeDir, ".local", "share", "rhemawave", "license_key")
+ if err := os.WriteFile(keyPath, []byte(p.inputText), 0644); err != nil {
+ logger.Error("Failed to write license key file: %v", err)
+ }
+ }
+
+ if p.isFirstTimeSetup {
+ // First-time setup: rewind to Welcome page
+ p.Context.NavigateTo(HOME)
+ } else {
+ // Coming from settings: rewind back to settings
+ p.Context.NavigateTo(SETTINGS)
+ }
+ case sdl.K_BACKSPACE:
+ if len(p.inputText) > 0 {
+ // Remove last character and reformat
+ // Strip all dashes first to get raw characters
+ cleaned := strings.ReplaceAll(p.inputText, "-", "")
+ if len(cleaned) > 0 {
+ cleaned = cleaned[:len(cleaned)-1]
+ }
+ p.inputText = formatLicenseKey(cleaned)
+ // Clear error when user edits input
+ p.errorMessage = ""
+ }
+ default:
+ // Keyboard fallback: if TextInputEvent is not supported,
+ // convert printable keycodes to characters directly.
+ // This handles kiosk systems without an input method framework.
+ if !p.textInputSupported {
+ if ch := keycodeToChar(e.Keysym.Sym, e.Keysym.Mod); ch != 0 {
+ p.inputText += string(ch)
+ p.inputText = formatLicenseKey(p.inputText)
+ p.errorMessage = ""
+ }
+ }
+ }
+ }
+ }
+ return nil
+}
+
+// Update updates animations and changing textures and other changes using `dt` which represents a time delta in float32.
+func (p *LicenseKeyPage) Update(dt float32) error {
+ // Get application font from database
+ applicationFont := "SpaceMonoNerdFont-Regular"
+
+ fm := fontManager.Get()
+ sm := shaderManager.Get()
+ shader, ok := sm.Get("text")
+ if !ok {
+ return fmt.Errorf("unable to fetch text shader")
+ }
+
+ // Update input text texture
+ if len(p.inputText) > 0 {
+ // Create the new inputText texture
+ inputTextTextureID, inputTextTextureWidth, inputTextTextureHeight, err := fm.CreateStringTexture(
+ applicationFont,
+ p.inputText,
+ shader,
+ )
+ if err != nil {
+ return fmt.Errorf("unable to create new input text texture: %w", err)
+ }
+
+ // Delete old texture if it exists
+ if p.inputTextTextureID != 0 {
+ gl.DeleteTextures(1, &p.inputTextTextureID)
+ }
+
+ p.inputTextTextureID = inputTextTextureID
+ p.inputTextTextureWidth = inputTextTextureWidth
+ p.inputTextTextureHeight = inputTextTextureHeight
+ }
+
+ // Update error message texture
+ if p.errorMessage != "" {
+ errorTextureID, errorWidth, errorHeight, err := fm.CreateStringTexture(
+ applicationFont,
+ p.errorMessage,
+ shader,
+ )
+ if err != nil {
+ return fmt.Errorf("unable to create error text texture: %w", err)
+ }
+
+ // Delete old error texture if it exists
+ if p.errorTextureID != 0 {
+ gl.DeleteTextures(1, &p.errorTextureID)
+ }
+
+ p.errorTextureID = errorTextureID
+ p.errorTextureWidth = errorWidth
+ p.errorTextureHeight = errorHeight
+ } else {
+ // Clear error texture if no error message
+ if p.errorTextureID != 0 {
+ gl.DeleteTextures(1, &p.errorTextureID)
+ p.errorTextureID = 0
+ }
+ }
+
+ return nil
+}
+
+// Render performs page drawing logic.
+func (p *LicenseKeyPage) Render() error {
+ config, err := db.GetConfig(p.Context.DbPtr)
+ if err != nil {
+ panic(err)
+ }
+ // Get base font size from database
+ baseFontSize := config.StandardFontSize
+
+ sm := shaderManager.Get()
+
+ // 1. Calculate Scale
+ titleFontSize := int32(64)
+ titleScale := float32(titleFontSize) / float32(baseFontSize)
+ currentLicenseFontSize := int32(28)
+ currentLicenseScale := float32(currentLicenseFontSize) / float32(baseFontSize)
+ padding := int32(4)
+ verticalMargin := int32(20)
+
+ // 2. Define dimensions
+ targetFontSize := int32(36)
+ scale := float32(targetFontSize) / float32(baseFontSize)
+ border := int32(3)
+
+ boxH := targetFontSize + (padding * 2)
+ boxW := int32(600) + (padding * 2)
+ boxDimensions := mgl32.Vec2{float32(boxW), float32(boxH)}
+
+ borderBoxH := boxH + (border * 2)
+ borderBoxW := boxW + (border * 2)
+ borderBoxDimensions := mgl32.Vec2{float32(borderBoxW), float32(borderBoxH)}
+
+ titleH := float32(p.titleTextureHeight) * titleScale
+ titleW := float32(p.titleTextureWidth) * titleScale
+ titleDimensions := mgl32.Vec2{titleW, titleH}
+
+ inputTextH := float32(p.inputTextTextureHeight) * scale
+ inputTextW := float32(p.inputTextTextureWidth) * scale
+ inputTextDimensions := mgl32.Vec2{inputTextW, inputTextH}
+
+ var currentLicenseDisplayH, currentLicenseDisplayW float32
+ var currentLicenseDisplayDimensions mgl32.Vec2
+ if p.currentLicenseDisplayTextureID != 0 {
+ currentLicenseDisplayH = float32(p.currentLicenseDisplayTextureHeight) * currentLicenseScale
+ currentLicenseDisplayW = float32(p.currentLicenseDisplayTextureWidth) * currentLicenseScale
+ currentLicenseDisplayDimensions = mgl32.Vec2{currentLicenseDisplayW, currentLicenseDisplayH}
+ }
+
+ // Error text dimensions
+ errorFontSize := int32(20)
+ errorScale := float32(errorFontSize) / float32(baseFontSize)
+ var errorTextH, errorTextW float32
+ var errorTextDimensions mgl32.Vec2
+ if p.errorTextureID != 0 {
+ errorTextH = float32(p.errorTextureHeight) * errorScale
+ errorTextW = float32(p.errorTextureWidth) * errorScale
+ errorTextDimensions = mgl32.Vec2{errorTextW, errorTextH}
+ }
+
+ // 3. Define positions
+ borderBoxY := p.Base.ScreenCenterY - (borderBoxH / 2)
+ borderBoxX := p.Base.ScreenCenterX - (borderBoxW / 2)
+ borderBoxPosition := mgl32.Vec2{float32(borderBoxX), float32(borderBoxY)}
+
+ boxY := p.Base.ScreenCenterY - (boxH / 2)
+ boxX := p.Base.ScreenCenterX - (boxW / 2)
+ boxPosition := mgl32.Vec2{float32(boxX), float32(boxY)}
+
+ titleY := borderBoxY + borderBoxH + verticalMargin
+ titleX := p.Base.ScreenCenterX - int32(titleW/2)
+ titlePosition := mgl32.Vec2{float32(titleX), float32(titleY)}
+
+ inputTextY := boxY + padding
+ inputTextX := boxX + padding
+ inputTextPosition := mgl32.Vec2{float32(inputTextX), float32(inputTextY)}
+
+ var currentLicenseDisplayPosition mgl32.Vec2
+ if p.currentLicenseDisplayTextureID != 0 {
+ currentLicenseDisplayY := borderBoxY - int32(currentLicenseDisplayH) - verticalMargin
+ currentLicenseDisplayX := p.Base.ScreenCenterX - int32(currentLicenseDisplayW/2)
+ currentLicenseDisplayPosition = mgl32.Vec2{float32(currentLicenseDisplayX), float32(currentLicenseDisplayY)}
+ }
+
+ // Error text position (below current license display to avoid overlap)
+ var errorTextPosition mgl32.Vec2
+ if p.errorTextureID != 0 {
+ var errorTextY int32
+ if p.currentLicenseDisplayTextureID != 0 {
+ // Position below the current license display
+ errorTextY = borderBoxY - int32(currentLicenseDisplayH) - verticalMargin - int32(errorTextH) - (verticalMargin / 2)
+ } else {
+ // No current license display, position below the input box
+ errorTextY = borderBoxY - int32(errorTextH) - (verticalMargin / 2)
+ }
+ errorTextX := p.Base.ScreenCenterX - int32(errorTextW/2)
+ errorTextPosition = mgl32.Vec2{float32(errorTextX), float32(errorTextY)}
+ }
+
+ // 4. Get Shaders
+ textShader, _ := sm.Get("text")
+ solidShader, _ := sm.Get("solid_color")
+
+ // 5. Draw everything
+ p.Base.RenderSolidColorQuad(solidShader, borderBoxPosition, borderBoxDimensions, colors.Gray)
+ p.Base.RenderSolidColorQuad(solidShader, boxPosition, boxDimensions, colors.DarkGray)
+ p.Base.RenderTexture(textShader, p.titleTextureID, titlePosition, titleDimensions, colors.White)
+
+ // Draw current license display if it exists
+ if p.currentLicenseDisplayTextureID != 0 {
+ p.Base.RenderTexture(textShader, p.currentLicenseDisplayTextureID, currentLicenseDisplayPosition, currentLicenseDisplayDimensions, colors.White)
+ }
+
+ if len(p.inputText) > 0 {
+ p.Base.RenderTexture(textShader, p.inputTextTextureID, inputTextPosition, inputTextDimensions, colors.White)
+ }
+
+ // Draw error message if it exists
+ if p.errorTextureID != 0 {
+ p.Base.RenderTexture(textShader, p.errorTextureID, errorTextPosition, errorTextDimensions, colors.ErrorRed)
+ }
+ return nil
+}
+
+// Destroy cleans up page-specific resources.
+func (p *LicenseKeyPage) Destroy() error {
+
+ gl.DeleteTextures(1, &p.titleTextureID)
+
+ // Delete current license display texture if it exists
+ if p.currentLicenseDisplayTextureID != 0 {
+ gl.DeleteTextures(1, &p.currentLicenseDisplayTextureID)
+ p.currentLicenseDisplayTextureID = 0
+ }
+
+ // Delete input text texture if it exists
+ if p.inputTextTextureID != 0 {
+ gl.DeleteTextures(1, &p.inputTextTextureID)
+ p.inputTextTextureID = 0
+ }
+
+ // Delete error texture if it exists
+ if p.errorTextureID != 0 {
+ gl.DeleteTextures(1, &p.errorTextureID)
+ p.errorTextureID = 0
+ }
+
+ sdl.StopTextInput()
+ return p.Base.Destroy()
+}
diff --git a/archive/internal/page/logViewerPage.go b/archive/internal/page/logViewerPage.go
new file mode 100644
index 0000000..6f82313
--- /dev/null
+++ b/archive/internal/page/logViewerPage.go
@@ -0,0 +1,273 @@
+package page
+
+import (
+ "fmt"
+ "strings"
+ "time"
+
+ "github.com/go-gl/gl/v3.3-core/gl"
+ "github.com/go-gl/mathgl/mgl32"
+ "github.com/veandco/go-sdl2/sdl"
+ "rhemawavetech.com/rhemawave/internal/colors"
+ "rhemawavetech.com/rhemawave/internal/db"
+ "rhemawavetech.com/rhemawave/internal/fontManager"
+ "rhemawavetech.com/rhemawave/internal/logger"
+ "rhemawavetech.com/rhemawave/internal/shaderManager"
+)
+
+type LogViewerPage struct {
+ Base
+
+ titleTextureID uint32
+ titleTextureWidth int32
+ titleTextureHeight int32
+
+ lines []string
+ lineTextureIDs []uint32
+ lineTextureWidths []int32
+ lineTextureHeights []int32
+ lineColors []sdl.Color
+
+ hintTextureID uint32
+ hintTextureWidth int32
+ hintTextureHeight int32
+
+ scrollOffset int32
+ maxScrollOffset int32
+ lineHeight int32
+ visibleHeight int32
+}
+
+func (p *LogViewerPage) Init(ctx *PageCtx) error {
+ var logs []db.Log
+ if err := p.Base.Init(ctx); err != nil {
+ return fmt.Errorf("failed base page initialization: %w", err)
+ }
+
+ if result := p.Context.DbPtr.Order("timestamp desc").Limit(250).Find(&logs); result.Error != nil {
+ logger.Error("error querying database for logs: %s", result.Error)
+ return fmt.Errorf("%s", result.Error)
+ }
+
+ // // Format and word-wrap each log entry
+ // for _, entry := range logs {
+ // formatted := fmt.Sprintf("[%s] [%s] %s", entry.Timestamp, entry.Level, entry.Message)
+ // wrapped := wrapText(formatted, 100)
+ // p.lines = append(p.lines, strings.Split(wrapped, "\n")...)
+ // }
+
+ levelColors := map[string]sdl.Color{
+ "DEBUG": colors.SkyBlue,
+ "INFO": colors.White,
+ "WARNING": colors.Yellow,
+ "ERROR": colors.RedOrange,
+ }
+
+ fallbackColor := colors.White
+
+ p.lineColors = make([]sdl.Color, len(p.lines))
+
+ for _, entry := range logs {
+ color, ok := levelColors[entry.Level]
+ if !ok {
+ color = fallbackColor
+ }
+ logTime := time.UnixMilli(entry.Timestamp)
+ timeStr := logTime.Format("2006-01-02 15:04")
+ line := fmt.Sprintf("[%s] [%s] %s", timeStr, entry.Level, entry.Message)
+ p.lines = append(p.lines, line)
+ p.lineColors = append(p.lineColors, color)
+ }
+
+ applicationFont := "SpaceMonoNerdFont-Regular"
+
+ fm := fontManager.Get()
+ textShader, ok := shaderManager.Get().Get("text")
+ if !ok {
+ return fmt.Errorf("unable to fetch text shader")
+ }
+
+ // Title texture
+ titleID, titleW, titleH, err := fm.CreateStringTexture(applicationFont, "Application Logs", textShader)
+ if err != nil {
+ return fmt.Errorf("failed to create title texture: %w", err)
+ }
+ p.titleTextureID = titleID
+ p.titleTextureWidth = titleW
+ p.titleTextureHeight = titleH
+
+ // Line textures
+ p.lineTextureIDs = make([]uint32, len(p.lines))
+ p.lineTextureWidths = make([]int32, len(p.lines))
+ p.lineTextureHeights = make([]int32, len(p.lines))
+
+ for i, line := range p.lines {
+ if strings.TrimSpace(line) == "" {
+ continue
+ }
+ texID, w, h, err := fm.CreateStringTexture(applicationFont, line, textShader)
+ if err != nil {
+ return fmt.Errorf("failed to create line texture: %w", err)
+ }
+ p.lineTextureIDs[i] = texID
+ p.lineTextureWidths[i] = w
+ p.lineTextureHeights[i] = h
+ }
+
+ // Hint texture
+ hintText := "Arrow Keys / PgUp/PgDn to scroll | F1|2|3 to Exit"
+ hintID, hintW, hintH, err := fm.CreateStringTexture(applicationFont, hintText, textShader)
+ if err != nil {
+ return fmt.Errorf("failed to create hint texture: %w", err)
+ }
+ p.hintTextureID = hintID
+ p.hintTextureWidth = hintW
+ p.hintTextureHeight = hintH
+
+ return nil
+}
+
+func (p *LogViewerPage) HandleEvent(event *sdl.Event) error {
+ switch e := (*event).(type) {
+ case *sdl.KeyboardEvent:
+ if e.Type == sdl.KEYDOWN {
+ switch e.Keysym.Sym {
+ case sdl.K_BACKSPACE:
+ p.Context.NavigateTo(SETTINGS)
+ case sdl.K_UP:
+ p.scrollOffset -= p.lineHeight
+ if p.scrollOffset < 0 {
+ p.scrollOffset = 0
+ }
+ case sdl.K_DOWN:
+ p.scrollOffset += p.lineHeight
+ if p.scrollOffset > p.maxScrollOffset {
+ p.scrollOffset = p.maxScrollOffset
+ }
+ case sdl.K_PAGEUP:
+ p.scrollOffset -= p.visibleHeight
+ if p.scrollOffset < 0 {
+ p.scrollOffset = 0
+ }
+ case sdl.K_PAGEDOWN:
+ p.scrollOffset += p.visibleHeight
+ if p.scrollOffset > p.maxScrollOffset {
+ p.scrollOffset = p.maxScrollOffset
+ }
+ case sdl.K_HOME:
+ p.scrollOffset = 0
+ case sdl.K_END:
+ p.scrollOffset = p.maxScrollOffset
+ }
+ }
+ case *sdl.MouseWheelEvent:
+ p.scrollOffset -= e.Y * p.lineHeight * 3
+ if p.scrollOffset < 0 {
+ p.scrollOffset = 0
+ }
+ if p.scrollOffset > p.maxScrollOffset {
+ p.scrollOffset = p.maxScrollOffset
+ }
+ }
+ return nil
+}
+
+func (p *LogViewerPage) Update(dt float32) error {
+ return nil
+}
+
+func (p *LogViewerPage) Render() error {
+ config, err := db.GetConfig(p.Context.DbPtr)
+ if err != nil {
+ panic(err)
+ }
+ baseFontSize := config.StandardFontSize
+
+ sm := shaderManager.Get()
+ textShader, _ := sm.Get("text")
+
+ titleFontSize := int32(48)
+ titleScale := float32(titleFontSize) / float32(baseFontSize)
+ contentFontSize := int32(24)
+ contentScale := float32(contentFontSize) / float32(baseFontSize)
+ hintFontSize := int32(20)
+ hintScale := float32(hintFontSize) / float32(baseFontSize)
+
+ margin := int32(40)
+ lineSpacing := int32(4)
+ p.lineHeight = contentFontSize + lineSpacing
+
+ contentLeftX := 25
+
+ // Title
+ titleH := float32(p.titleTextureHeight) * titleScale
+ titleW := float32(p.titleTextureWidth) * titleScale
+ titleX := p.Base.ScreenCenterX - int32(titleW/2)
+ titleY := p.Base.ScreenHeight - margin - int32(titleH)
+ p.Base.RenderTexture(textShader, p.titleTextureID, mgl32.Vec2{float32(titleX), float32(titleY)}, mgl32.Vec2{titleW, titleH}, colors.White)
+
+ // Hint at bottom
+ hintH := float32(p.hintTextureHeight) * hintScale
+ hintW := float32(p.hintTextureWidth) * hintScale
+ hintX := p.Base.ScreenCenterX - int32(hintW/2)
+ hintY := margin
+ p.Base.RenderTexture(textShader, p.hintTextureID, mgl32.Vec2{float32(hintX), float32(hintY)}, mgl32.Vec2{hintW, hintH}, colors.Gray)
+
+ // Content area bounds
+ contentTop := titleY - margin
+ contentBottom := hintY + int32(hintH) + margin
+ p.visibleHeight = contentTop - contentBottom
+
+ // Total content height
+ totalContentHeight := int32(len(p.lines)) * p.lineHeight
+ p.maxScrollOffset = totalContentHeight - p.visibleHeight
+ if p.maxScrollOffset < 0 {
+ p.maxScrollOffset = 0
+ }
+
+ // Render visible lines
+ currentY := contentTop - p.lineHeight + p.scrollOffset
+
+ for i, line := range p.lines {
+ if strings.TrimSpace(line) == "" {
+ currentY -= p.lineHeight
+ continue
+ }
+
+ if p.lineTextureIDs[i] == 0 {
+ currentY -= p.lineHeight
+ continue
+ }
+
+ if currentY > contentTop || currentY+p.lineHeight < contentBottom {
+ currentY -= p.lineHeight
+ continue
+ }
+
+ lineW := float32(p.lineTextureWidths[i]) * contentScale
+ lineH := float32(p.lineTextureHeights[i]) * contentScale
+
+ color := colors.White
+ if i < len(p.lineColors) {
+ color = p.lineColors[i]
+ }
+
+ p.Base.RenderTexture(textShader, p.lineTextureIDs[i], mgl32.Vec2{float32(contentLeftX), float32(currentY)}, mgl32.Vec2{lineW, lineH}, color)
+ currentY -= p.lineHeight
+ }
+
+ return nil
+}
+
+func (p *LogViewerPage) Destroy() error {
+ gl.DeleteTextures(1, &p.titleTextureID)
+ gl.DeleteTextures(1, &p.hintTextureID)
+
+ for _, texID := range p.lineTextureIDs {
+ if texID != 0 {
+ gl.DeleteTextures(1, &texID)
+ }
+ }
+
+ return p.Base.Destroy()
+}
diff --git a/archive/internal/page/page.go b/archive/internal/page/page.go
new file mode 100644
index 0000000..8528d53
--- /dev/null
+++ b/archive/internal/page/page.go
@@ -0,0 +1,236 @@
+// Package page provides the interface for pages
+package page
+
+import (
+ "fmt"
+
+ "github.com/go-gl/gl/v3.3-core/gl"
+ "github.com/go-gl/mathgl/mgl32"
+ "github.com/veandco/go-sdl2/sdl"
+ "rhemawavetech.com/rhemawave/internal/shaderManager"
+)
+
+// Page defines the contract for all application screens.
+type Page interface {
+ Init(ctx *PageCtx) error
+ HandleEvent(event *sdl.Event) error
+ Update(dt float32) error
+ Render() error
+ Destroy() error
+}
+
+// Base is a helper struct that pages can embed to get common functionality.
+type Base struct {
+ Context *PageCtx
+ QuadVAO uint32
+ QuadVBO uint32
+ Projection mgl32.Mat4
+ ScreenWidth int32
+ ScreenHeight int32
+ ScreenCenterX int32
+ ScreenCenterY int32
+}
+
+// Init stores the application context and sets up common resources.
+func (p *Base) Init(ctx *PageCtx) error {
+ p.Context = ctx
+ vertices := []float32{
+ // pos(x,y) tex(u,v)
+ 0.0, 1.0, 0.0, 1.0,
+ 1.0, 0.0, 1.0, 0.0,
+ 0.0, 0.0, 0.0, 0.0,
+
+ 0.0, 1.0, 0.0, 1.0,
+ 1.0, 1.0, 1.0, 1.0,
+ 1.0, 0.0, 1.0, 0.0,
+ }
+
+ W := p.Context.W
+ H := p.Context.H
+
+ p.Projection = mgl32.Ortho(0, float32(W), 0, float32(H), -1, 1)
+ p.ScreenHeight = H
+ p.ScreenWidth = W
+ p.ScreenCenterY = H / 2
+ p.ScreenCenterX = W / 2
+
+ gl.GenVertexArrays(1, &p.QuadVAO)
+ gl.GenBuffers(1, &p.QuadVBO)
+ gl.BindVertexArray(p.QuadVAO)
+ gl.BindBuffer(gl.ARRAY_BUFFER, p.QuadVBO)
+ gl.BufferData(gl.ARRAY_BUFFER, len(vertices)*4, gl.Ptr(vertices), gl.STATIC_DRAW)
+
+ stride := int32(4 * 4) // Each vertex has 4 floats (pos.x, pos.y, tex.u, tex.v)
+
+ // Attribute 0: Vertex Position (vec2)
+ gl.EnableVertexAttribArray(0)
+ gl.VertexAttribPointerWithOffset(0, 2, gl.FLOAT, false, stride, 0)
+
+ // Attribute 1: Texture Coordinate (vec2)
+ gl.EnableVertexAttribArray(1)
+ gl.VertexAttribPointerWithOffset(1, 2, gl.FLOAT, false, stride, 2*4) // Offset by 2 floats
+
+ gl.BindBuffer(gl.ARRAY_BUFFER, 0)
+ gl.BindVertexArray(0)
+ gl.Disable(gl.BLEND)
+ gl.UseProgram(0)
+ return nil
+}
+
+// Destroy cleans up the common OpenGL resources.
+func (p *Base) Destroy() error {
+ gl.DeleteBuffers(1, &p.QuadVBO)
+ gl.DeleteVertexArrays(1, &p.QuadVAO)
+ return nil
+}
+
+// BeginTextureRendering sets up shared GL state for a batch of RenderTexture calls.
+// Call this once before a series of RenderTexture calls, then EndTextureRendering after.
+func (p *Base) BeginTextureRendering(shader *shaderManager.Shader) {
+ gl.UseProgram(shader.ProgramID)
+ gl.Uniform1i(shader.LocTexture, 0)
+ gl.ActiveTexture(gl.TEXTURE0)
+ gl.Enable(gl.BLEND)
+ gl.BlendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA)
+ gl.BindVertexArray(p.QuadVAO)
+}
+
+// EndTextureRendering restores GL state after a batch of RenderTexture calls.
+func (p *Base) EndTextureRendering() {
+ gl.BindVertexArray(0)
+ gl.Disable(gl.BLEND)
+ gl.UseProgram(0)
+}
+
+// RenderTexture draws a given texture to the screen at a specified position and size.
+// For best performance, wrap multiple calls with BeginTextureRendering/EndTextureRendering.
+// This method also works standalone for one-off renders.
+func (p *Base) RenderTexture(shader *shaderManager.Shader, textureID uint32, position, size mgl32.Vec2, color sdl.Color) error {
+ gl.UseProgram(shader.ProgramID)
+ gl.Uniform1i(shader.LocTexture, 0)
+
+ if shader.LocTextColor == -1 {
+ return fmt.Errorf("could not find 'u_textColor' uniform in shader program %d", shader.ProgramID)
+ }
+ gl.Uniform4f(shader.LocTextColor, float32(color.R)/255.0, float32(color.G)/255.0, float32(color.B)/255.0, float32(color.A)/255.0)
+
+ model := mgl32.Ident4()
+ model = model.Mul4(mgl32.Translate3D(position.X(), position.Y(), 0))
+ model = model.Mul4(mgl32.Scale3D(size.X(), size.Y(), 1))
+ mvp := p.Projection.Mul4(model)
+ gl.UniformMatrix4fv(shader.LocMVPMatrix, 1, false, &mvp[0])
+
+ gl.ActiveTexture(gl.TEXTURE0)
+ gl.BindTexture(gl.TEXTURE_2D, textureID)
+ gl.Enable(gl.BLEND)
+ gl.BlendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA)
+
+ gl.BindVertexArray(p.QuadVAO)
+ gl.DrawArrays(gl.TRIANGLES, 0, 6)
+
+ gl.BindVertexArray(0)
+ gl.Disable(gl.BLEND)
+ gl.UseProgram(0)
+ return nil
+}
+
+// RenderTextureBatched is a lightweight version of RenderTexture for use inside
+// a BeginTextureRendering/EndTextureRendering block. It skips redundant state setup.
+func (p *Base) RenderTextureBatched(shader *shaderManager.Shader, textureID uint32, position, size mgl32.Vec2, color sdl.Color) {
+ gl.Uniform4f(shader.LocTextColor, float32(color.R)/255.0, float32(color.G)/255.0, float32(color.B)/255.0, float32(color.A)/255.0)
+
+ model := mgl32.Ident4()
+ model = model.Mul4(mgl32.Translate3D(position.X(), position.Y(), 0))
+ model = model.Mul4(mgl32.Scale3D(size.X(), size.Y(), 1))
+ mvp := p.Projection.Mul4(model)
+ gl.UniformMatrix4fv(shader.LocMVPMatrix, 1, false, &mvp[0])
+
+ gl.BindTexture(gl.TEXTURE_2D, textureID)
+ gl.DrawArrays(gl.TRIANGLES, 0, 6)
+}
+
+// RenderSolidColorQuad draws a rectangle of a solid color to the screen.
+func (p *Base) RenderSolidColorQuad(shader *shaderManager.Shader, position, size mgl32.Vec2, color sdl.Color) error {
+ gl.UseProgram(shader.ProgramID)
+
+ model := mgl32.Ident4()
+ model = model.Mul4(mgl32.Translate3D(position.X(), position.Y(), 0))
+ model = model.Mul4(mgl32.Scale3D(size.X(), size.Y(), 1))
+ mvp := p.Projection.Mul4(model)
+
+ if shader.LocMVPMatrix == -1 {
+ return fmt.Errorf("RenderSolidColorQuad: could not find 'u_mvpMatrix' uniform")
+ }
+ gl.UniformMatrix4fv(shader.LocMVPMatrix, 1, false, &mvp[0])
+
+ if shader.LocColor == -1 {
+ return fmt.Errorf("RenderSolidColorQuad: could not find 'u_color' uniform")
+ }
+ gl.Uniform4f(shader.LocColor, float32(color.R)/255.0, float32(color.G)/255.0, float32(color.B)/255.0, float32(color.A)/255.0)
+
+ gl.Enable(gl.BLEND)
+ gl.BlendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA)
+
+ gl.BindVertexArray(p.QuadVAO)
+ gl.DrawArrays(gl.TRIANGLES, 0, 6)
+
+ gl.BindVertexArray(0)
+ gl.Disable(gl.BLEND)
+ gl.UseProgram(0)
+ return nil
+}
+
+// Provide default implementations for the Page interface.
+func (p *Base) HandleEvent(event sdl.Event) error { return nil }
+func (p *Base) Update(dt float32) error { return nil }
+func (p *Base) Render() error { return nil }
+
+// --- Helper Functions ---
+// keycodeToChar converts an SDL keycode to a rune, respecting SHIFT state.
+// Returns 0 for non-printable keys.
+func keycodeToChar(sym sdl.Keycode, mod uint16) rune {
+ shifted := mod&sdl.KMOD_SHIFT != 0
+
+ // Letters
+ if sym >= sdl.K_a && sym <= sdl.K_z {
+ ch := rune(sym)
+ if shifted {
+ ch -= 'a' - 'A'
+ }
+ return ch
+ }
+
+ // Digits and their shifted symbols
+ if sym >= sdl.K_0 && sym <= sdl.K_9 {
+ if shifted {
+ shiftDigits := []rune{')', '!', '@', '#', '$', '%', '^', '&', '*', '('}
+ return shiftDigits[sym-sdl.K_0]
+ }
+ return rune(sym)
+ }
+
+ // Common punctuation / symbols
+ type charPair struct{ normal, shifted rune }
+ punctuation := map[sdl.Keycode]charPair{
+ sdl.K_SPACE: {' ', ' '},
+ sdl.K_MINUS: {'-', '_'},
+ sdl.K_EQUALS: {'=', '+'},
+ sdl.K_LEFTBRACKET: {'[', '{'},
+ sdl.K_RIGHTBRACKET: {']', '}'},
+ sdl.K_BACKSLASH: {'\\', '|'},
+ sdl.K_SEMICOLON: {';', ':'},
+ sdl.K_QUOTE: {'\'', '"'},
+ sdl.K_BACKQUOTE: {'`', '~'},
+ sdl.K_COMMA: {',', '<'},
+ sdl.K_PERIOD: {'.', '>'},
+ sdl.K_SLASH: {'/', '?'},
+ }
+ if pair, ok := punctuation[sym]; ok {
+ if shifted {
+ return pair.shifted
+ }
+ return pair.normal
+ }
+
+ return 0
+}
diff --git a/archive/internal/page/pageItem.go b/archive/internal/page/pageItem.go
new file mode 100644
index 0000000..e34cf2e
--- /dev/null
+++ b/archive/internal/page/pageItem.go
@@ -0,0 +1,83 @@
+package page
+
+import (
+ "fmt"
+
+ "github.com/go-gl/mathgl/mgl32"
+ "github.com/veandco/go-sdl2/sdl"
+ "rhemawavetech.com/rhemawave/internal/fontManager"
+ "rhemawavetech.com/rhemawave/internal/shaderManager"
+)
+
+// PageItem defines the basic features of any item on any page
+// This coupling makes creating, updating and managing pages easier
+type PageItem struct {
+ ID uint32
+ W int32
+ H int32
+ X int32 // Horizontal position
+ Y int32 // Vertical position
+ Color sdl.Color
+ // index int
+}
+
+// Scale updates the W and H of an item based on a scale factor (usually determined by base font size / desired font size)
+func (i *PageItem) Scale(scale float32) {
+ i.W = int32(float32(i.W) * scale)
+ i.H = int32(float32(i.H) * scale)
+}
+
+// Dimensions returns an mgl32.Vec2 containing the W and H of an item, respectively
+func (i *PageItem) Dimensions(scale float32) mgl32.Vec2 {
+ return mgl32.Vec2{float32(float32(i.W) * scale), float32(float32(i.H) * scale)}
+}
+
+// RawDimensions returns a mgl32.Vec2 containing the W and H of an item, without scaling
+// This method will replace Dimensions in the future. Future PageItems should first call Scale(), then RawDimensions()
+func (i *PageItem) RawDimensions() mgl32.Vec2 {
+ return mgl32.Vec2{float32(i.W), float32(i.H)}
+}
+
+// Position returns an mgl32.Vec2 contianing the X and Y positions of an item, respectively
+func (i *PageItem) Position() mgl32.Vec2 {
+ return mgl32.Vec2{float32(i.X), float32(i.Y)}
+}
+
+// StringItem is an extended PageItem that contains a string content and string specific methods
+type StringItem struct {
+ PageItem
+ content string
+}
+
+// NewStringItem creates a new StringItem with the given content, font, and color.
+// It initializes the texture ID, width, and height by creating a string texture using the font
+// and shader manager.
+func NewStringItem(content string, font *fontManager.FontEntry, color sdl.Color) (StringItem, error) {
+ var err error
+
+ fm := fontManager.Get()
+ sm := shaderManager.Get()
+
+ shader, ok := sm.Get("text")
+ if !ok {
+ return StringItem{}, fmt.Errorf("failed to fetch shader")
+ }
+
+ id, width, height, err := fm.CreateStringTexture(font.Name, content, shader)
+ if err != nil {
+ return StringItem{}, err
+ }
+
+ newStringItem := StringItem{
+ PageItem: PageItem{
+ ID: id,
+ W: width,
+ H: height,
+ Color: color,
+ },
+ content: content,
+ }
+
+ return newStringItem, err
+
+}
diff --git a/archive/internal/page/proclamationOptions.go b/archive/internal/page/proclamationOptions.go
new file mode 100644
index 0000000..c0ac305
--- /dev/null
+++ b/archive/internal/page/proclamationOptions.go
@@ -0,0 +1,793 @@
+package page
+
+import (
+ "fmt"
+ "math"
+ "sort"
+ "strconv"
+ "strings"
+ "unicode"
+
+ "github.com/go-gl/gl/v3.3-core/gl"
+ "github.com/go-gl/mathgl/mgl32"
+ "github.com/veandco/go-sdl2/sdl"
+ "gorm.io/gorm"
+ "rhemawavetech.com/rhemawave/internal/colors"
+ "rhemawavetech.com/rhemawave/internal/db"
+ "rhemawavetech.com/rhemawave/internal/fontManager"
+ "rhemawavetech.com/rhemawave/internal/logger"
+ "rhemawavetech.com/rhemawave/internal/shaderManager"
+ "rhemawavetech.com/rhemawave/internal/sync"
+)
+
+// Scrollbar Visuals
+var (
+ colorScrollTrack = sdl.Color{R: 255, G: 255, B: 255, A: 30}
+ colorScrollThumb = sdl.Color{R: 255, G: 255, B: 255, A: 100}
+)
+
+type FlatItem struct {
+ Label StringItem
+ ID string
+ IsCategory bool
+ IsSubCategory bool
+ Depth int
+ Expanded bool
+ SearchText string // lowercase name + content, pre-built at load time
+}
+
+type ProclamationOptions struct {
+ Base
+ font *fontManager.FontEntry
+ textShader *shaderManager.Shader
+ solidShader *shaderManager.Shader
+ title StringItem
+ prompt StringItem
+
+ // Browse Tree State
+ allItems []*FlatItem
+ activeMap map[string]bool
+ highlightIndex int
+
+ // Browse Scrolling State
+ scrollOffset int
+ maxVisible int
+
+ // Scrollbar Dimens
+ scrollTrackWidth int32
+ scrollTrackX int32
+ scrollTrackHeight int32
+ scrollTrackY int32
+
+ indentSize float32
+ verticalMargin int32
+
+ // Search State
+ isSearchActive bool
+ searchQuery string
+ searchInput StringItem
+ searchItems []*FlatItem // filtered view — pointers into allProclamations
+ searchHighlight int
+ searchScrollOff int
+
+ // Full flat proclamation pool (pointers shared with allItems leaves)
+ allProclamations []*FlatItem
+
+ // Spinning triangle cursor — same shape/animation as AudioOptions —
+ // that points at whichever row is currently highlighted.
+ triVAO uint32
+ triVBO uint32
+ triX float32
+ triCenterY float32
+ triVisible bool
+ spinElapsed float32
+}
+
+func (p *ProclamationOptions) Init(ctx *PageCtx) error {
+ p.verticalMargin = 25
+ p.indentSize = 40.0
+ p.activeMap = make(map[string]bool)
+ p.allItems = []*FlatItem{}
+ p.scrollOffset = 0
+ p.isSearchActive = false
+ p.scrollTrackWidth = 30
+ p.scrollTrackX = p.ScreenWidth - p.scrollTrackWidth
+ var err error
+
+ // Syncronize proclamations first
+ var allProcs []db.Proclamation
+ allProcs, err = sync.SyncProclamations(ctx.DbPtr)
+ if err != nil {
+ // sync failed, fallback to database
+ ctx.DbPtr.Find(&allProcs)
+ }
+
+ sync.SyncFrequencies(ctx.DbPtr)
+
+ fm := fontManager.Get()
+ font, _ := fm.GetFont("SpaceMonoNerdFont-Regular")
+ p.font = font
+
+ sm := shaderManager.Get()
+ p.textShader, _ = sm.Get("text")
+ p.solidShader, _ = sm.Get("solid_color")
+
+ p.Base.Init(ctx)
+
+ config, err := db.GetConfig(p.Context.DbPtr)
+ if err != nil {
+ panic(err)
+ }
+
+ itemScale := float32(32) / float32(config.StandardFontSize)
+ p.title, _ = NewStringItem("Proclamation Browser", p.font, colors.White)
+ p.title.Scale(float32(64) / float32(config.StandardFontSize))
+
+ p.prompt, _ = NewStringItem("Type to Search Space to Select Enter to Save Escape to Exit", p.font, colors.White)
+ p.prompt.Scale(itemScale * 0.8)
+
+ // Calculation for visible area
+ areaHeight := float32(p.ScreenHeight) - 250
+ p.maxVisible = int(areaHeight / 47)
+
+ // Load current selections
+ var selected []db.Proclamation
+ ctx.DbPtr.Where("selected = ?", true).Where("id != ?", defaultProclamationID).Find(&selected)
+ for _, s := range selected {
+ if s.ID == defaultProclamationID {
+ logger.Debug("Found default proclamation in selected list: %s", s.ID)
+ }
+ p.activeMap[s.ID] = true
+ }
+
+ procContentMap := make(map[string]string, len(allProcs))
+ for _, pr := range allProcs {
+ if pr.ID == defaultProclamationID {
+ logger.Debug("Found default proclamation in allProcs list: %s", pr.ID)
+ }
+ procContentMap[pr.ID] = pr.Content
+ }
+ p.allProclamations = []*FlatItem{}
+
+ for _, pr := range allProcs {
+ fi := p.createFlatItem(pr.Name, pr.ID, false, 0)
+ fi.SearchText = strings.ToLower(pr.Name)
+ p.allProclamations = append(p.allProclamations, fi)
+ }
+
+ // Load Root Categories
+ var parentCategories []db.ProclamationCategory
+ p.Context.DbPtr.Where("parent_id IS NULL OR parent_id = 0").Find(&parentCategories)
+ for _, c := range parentCategories {
+ p.allItems = append(p.allItems, p.createFlatItem(c.Name, fmt.Sprint(c.ID), true, 0))
+ }
+
+ // Triangle cursor VAO/VBO — stride is vec2 only, no tex coords.
+ // Mirrors the spinning cursor used in AudioOptions.
+ triVerts := []float32{
+ 0.5, 0.0,
+ -0.5, 0.5,
+ -0.5, -0.5,
+ }
+ gl.GenVertexArrays(1, &p.triVAO)
+ gl.GenBuffers(1, &p.triVBO)
+ gl.BindVertexArray(p.triVAO)
+ gl.BindBuffer(gl.ARRAY_BUFFER, p.triVBO)
+ gl.BufferData(gl.ARRAY_BUFFER, len(triVerts)*4, gl.Ptr(triVerts), gl.STATIC_DRAW)
+ gl.EnableVertexAttribArray(0)
+ gl.VertexAttribPointerWithOffset(0, 2, gl.FLOAT, false, 2*4, 0)
+ gl.BindBuffer(gl.ARRAY_BUFFER, 0)
+ gl.BindVertexArray(0)
+
+ p.layout()
+ return nil
+}
+
+func (p *ProclamationOptions) createFlatItem(name, id string, isCat bool, depth int) *FlatItem {
+ text := name
+ if isCat && depth == 0 {
+ text = "[+] " + name
+ }
+ config, err := db.GetConfig(p.Context.DbPtr)
+ if err != nil {
+ panic(err)
+ }
+ itemScale := float32(32) / float32(config.StandardFontSize)
+ lbl, _ := NewStringItem(text, p.font, colors.White)
+ lbl.Scale(itemScale)
+ return &FlatItem{
+ Label: lbl,
+ ID: id,
+ IsCategory: isCat,
+ IsSubCategory: isCat && depth > 0,
+ Depth: depth,
+ }
+}
+
+func (p *ProclamationOptions) layout() {
+ p.title.X = p.ScreenCenterX - p.title.W/2
+ p.title.Y = 40
+ p.prompt.X = p.ScreenCenterX - p.prompt.W/2
+ p.prompt.Y = p.ScreenHeight - 60
+
+ startY := float32(p.ScreenHeight - 150)
+ p.scrollTrackY = 130
+ p.scrollTrackHeight = int32(startY) - 130 + 50
+
+ // Reserve room on the left of the list for the spinning cursor
+ // (triangleSize wide, cursorGap away from the text it points at),
+ // ahead of the original left margin used for list rows.
+ cursorGap := int32(12)
+ listBaseX := int32(60) + int32(triangleSize) + cursorGap
+
+ if p.isSearchActive {
+ // Position search bar label
+ p.searchInput.X = 60
+ p.searchInput.Y = 100
+
+ // Hide all browse items
+ for _, item := range p.allItems {
+ item.Label.X = -5000
+ }
+
+ // Position filtered search results
+ for i, item := range p.searchItems {
+ item.Label.X = -5000
+ if i >= p.searchScrollOff && i < p.searchScrollOff+p.maxVisible {
+ visibleIdx := i - p.searchScrollOff
+ item.Label.X = listBaseX
+ item.Label.Y = int32(startY - float32(visibleIdx)*47.0)
+ }
+ }
+
+ // Point the cursor at the highlighted search result, if it's
+ // currently scrolled into view.
+ p.triVisible = false
+ if len(p.searchItems) > 0 && p.searchHighlight >= 0 && p.searchHighlight < len(p.searchItems) &&
+ p.searchHighlight >= p.searchScrollOff && p.searchHighlight < p.searchScrollOff+p.maxVisible {
+ target := p.searchItems[p.searchHighlight].Label
+ p.triX = float32(target.X) - triangleSize - float32(cursorGap)
+ p.triCenterY = float32(target.Y) + float32(target.H)/2
+ p.triVisible = true
+ }
+ return
+ }
+
+ // Browse mode
+ for i, item := range p.allItems {
+ item.Label.X = -5000
+ if i >= p.scrollOffset && i < p.scrollOffset+p.maxVisible {
+ visibleIdx := i - p.scrollOffset
+ item.Label.X = listBaseX + int32(float32(item.Depth)*p.indentSize)
+ item.Label.Y = int32(startY - float32(visibleIdx)*47.0)
+ }
+ }
+
+ // Point the cursor at the highlighted browse row, if it's currently
+ // scrolled into view. Since target.X already includes the row's depth
+ // indentation, the cursor shifts in and out with it automatically —
+ // the gap between cursor and text stays constant regardless of depth.
+ p.triVisible = false
+ if len(p.allItems) > 0 && p.highlightIndex >= 0 && p.highlightIndex < len(p.allItems) &&
+ p.highlightIndex >= p.scrollOffset && p.highlightIndex < p.scrollOffset+p.maxVisible {
+ target := p.allItems[p.highlightIndex].Label
+ p.triX = float32(target.X) - triangleSize - float32(cursorGap)
+ p.triCenterY = float32(target.Y) + float32(target.H)/2
+ p.triVisible = true
+ }
+}
+
+func (p *ProclamationOptions) toggleExpansion(index int) {
+ item := p.allItems[index]
+ if !item.IsCategory || item.IsSubCategory {
+ return
+ }
+
+ pureName := item.Label.content[4:]
+ gl.DeleteTextures(1, &item.Label.ID)
+
+ config, err := db.GetConfig(p.Context.DbPtr)
+ if err != nil {
+ panic(err)
+ }
+
+ itemScale := float32(32) / float32(config.StandardFontSize)
+ if item.Expanded {
+ p.collapse(index)
+ item.Label, _ = NewStringItem("[+] "+pureName, p.font, colors.White)
+ } else {
+ p.expand(index)
+ item.Label, _ = NewStringItem("[-] "+pureName, p.font, colors.White)
+ }
+ item.Label.Scale(itemScale)
+ item.Expanded = !item.Expanded
+ p.layout()
+}
+
+func (p *ProclamationOptions) expand(index int) {
+ parent := p.allItems[index]
+ parentID, _ := strconv.Atoi(parent.ID)
+ var newItems []*FlatItem
+
+ // Load subcategories
+ var cats []db.ProclamationCategory
+ p.Context.DbPtr.Where("parent_id = ?", parentID).Find(&cats)
+ for _, c := range cats {
+ fi := p.createFlatItem(c.Name, fmt.Sprint(c.ID), true, parent.Depth+1)
+ fi.Expanded = true
+ newItems = append(newItems, fi)
+ }
+
+ // Load proclamations for this category
+ var procs []db.Proclamation
+ p.Context.DbPtr.Where("category_id = ?", parentID).Where("ID != ?", defaultProclamationID).Find(&procs)
+
+ // Sort proclamations alphabetically by name
+ sort.Slice(procs, func(i, j int) bool {
+ return strings.ToLower(procs[i].Name) < strings.ToLower(procs[j].Name)
+ })
+
+ for _, pr := range procs {
+ var fi *FlatItem
+ // Reuse existing proclamation from allProclamations if available
+ for _, existing := range p.allProclamations {
+ if existing.ID == pr.ID {
+ fi = existing
+ break
+ }
+ }
+ if fi == nil {
+ // Safety fallback
+ fi = p.createFlatItem(pr.Name, pr.ID, false, parent.Depth+1)
+ fi.SearchText = strings.ToLower(pr.Name + " " + pr.Content)
+ p.allProclamations = append(p.allProclamations, fi)
+ }
+ fi.Depth = parent.Depth + 1
+ newItems = append(newItems, fi)
+ }
+
+ // Insert new items after parent
+ tail := append([]*FlatItem{}, p.allItems[index+1:]...)
+ p.allItems = append(p.allItems[:index+1], append(newItems, tail...)...)
+
+ // Recurse into subcategories
+ i := index + 1
+ for i < len(p.allItems) && p.allItems[i].Depth > parent.Depth {
+ if p.allItems[i].IsCategory && p.allItems[i].Depth > 0 {
+ p.expand(i)
+ }
+ i++
+ }
+}
+
+func (p *ProclamationOptions) collapse(index int) {
+ depth := p.allItems[index].Depth
+ i := index + 1
+ for i < len(p.allItems) && p.allItems[i].Depth > depth {
+ // Do NOT delete textures here — leaves are shared with allProclamations.
+ // Only delete textures for category items that aren't in the proclamation pool.
+ if p.allItems[i].IsCategory {
+ gl.DeleteTextures(1, &p.allItems[i].Label.ID)
+ }
+ i++
+ }
+ p.allItems = append(p.allItems[:index+1], p.allItems[i:]...)
+}
+
+// matchesWordPrefix returns true if any word in text starts with query (case-insensitive).
+func matchesWordPrefix(text, query string) bool {
+ query = strings.ToLower(query)
+ text = strings.ToLower(text)
+
+ // Split text into words (non-alphanumeric boundaries)
+ words := strings.FieldsFunc(text, func(r rune) bool {
+ return !unicode.IsLetter(r) && !unicode.IsNumber(r)
+ })
+
+ for _, word := range words {
+ if strings.HasPrefix(word, query) {
+ return true
+ }
+ }
+ return false
+}
+
+func (p *ProclamationOptions) buildSearchList() {
+ p.searchItems = nil
+ if p.searchQuery == "" {
+ return
+ }
+ for _, item := range p.allProclamations {
+ if matchesWordPrefix(item.SearchText, p.searchQuery) {
+ p.searchItems = append(p.searchItems, item)
+ }
+ }
+ if p.searchHighlight >= len(p.searchItems) {
+ p.searchHighlight = 0
+ }
+}
+
+func (p *ProclamationOptions) rebuildSearchLabel() {
+ if p.searchInput.ID != 0 {
+ gl.DeleteTextures(1, &p.searchInput.ID)
+ p.searchInput.ID = 0
+ }
+ if p.searchQuery == "" {
+ return
+ }
+ config, err := db.GetConfig(p.Context.DbPtr)
+ if err != nil {
+ panic(err)
+ }
+ itemScale := float32(32) / float32(config.StandardFontSize)
+ p.searchInput, _ = NewStringItem("Search: "+p.searchQuery, p.font, colors.Yellow)
+ p.searchInput.Scale(itemScale * 1.1)
+}
+
+func (p *ProclamationOptions) enterSearchMode(firstRune rune) {
+ p.searchQuery = string(firstRune)
+ p.isSearchActive = true
+ p.searchScrollOff = 0
+ p.searchHighlight = 0
+ p.buildSearchList()
+ p.rebuildSearchLabel()
+}
+
+func (p *ProclamationOptions) exitSearchMode() {
+ p.searchQuery = ""
+ p.isSearchActive = false
+ p.searchItems = nil
+ p.searchHighlight = 0
+ p.searchScrollOff = 0
+ if p.searchInput.ID != 0 {
+ gl.DeleteTextures(1, &p.searchInput.ID)
+ p.searchInput.ID = 0
+ }
+}
+
+func (p *ProclamationOptions) HandleEvent(event *sdl.Event) error {
+ switch e := (*event).(type) {
+ case *sdl.KeyboardEvent:
+ if e.Type != sdl.KEYDOWN {
+ return nil
+ }
+
+ sym := e.Keysym.Sym
+
+ // --- Backspace: always handled specially ---
+ if sym == sdl.K_BACKSPACE {
+ if p.isSearchActive {
+ if len(p.searchQuery) > 0 {
+ p.searchQuery = p.searchQuery[:len(p.searchQuery)-1]
+ }
+ if p.searchQuery == "" {
+ p.exitSearchMode()
+ } else {
+ p.buildSearchList()
+ p.rebuildSearchLabel()
+ }
+ p.layout()
+ return nil
+ }
+ // Browse mode backspace — navigate back
+ return nil
+ }
+
+ // --- Escape ---
+ if sym == sdl.K_ESCAPE {
+ if p.isSearchActive {
+ p.exitSearchMode()
+ p.layout()
+ return nil
+ }
+ p.Context.NavigateTo(SETTINGS)
+ return nil
+ }
+
+ // --- Search mode input handling ---
+ if p.isSearchActive {
+ switch sym {
+ case sdl.K_UP:
+ if p.searchHighlight > 0 {
+ p.searchHighlight--
+ if p.searchHighlight < p.searchScrollOff {
+ p.searchScrollOff--
+ }
+ }
+ case sdl.K_DOWN:
+ if p.searchHighlight < len(p.searchItems)-1 {
+ p.searchHighlight++
+ if p.searchHighlight >= p.searchScrollOff+p.maxVisible {
+ p.searchScrollOff++
+ }
+ }
+ case sdl.K_PAGEUP:
+ p.searchHighlight = p.searchScrollOff
+ p.searchScrollOff -= p.maxVisible - 1
+ if p.searchScrollOff < 0 {
+ p.searchScrollOff = 0
+ p.searchHighlight = 0
+ }
+ case sdl.K_PAGEDOWN:
+ bottom := p.searchScrollOff + p.maxVisible - 1
+ if bottom >= len(p.searchItems) {
+ bottom = len(p.searchItems) - 1
+ }
+ p.searchScrollOff = bottom
+ p.searchHighlight = bottom
+ case sdl.K_SPACE:
+ if len(p.searchItems) > 0 {
+ item := p.searchItems[p.searchHighlight]
+ p.activeMap[item.ID] = !p.activeMap[item.ID]
+ }
+ p.acceptChanges()
+ case sdl.K_RETURN:
+ if len(p.searchItems) > 0 {
+ item := p.searchItems[p.searchHighlight]
+ p.activeMap[item.ID] = !p.activeMap[item.ID]
+ }
+ p.acceptChanges()
+ default:
+ // Append printable characters to search query
+ r := rune(sym)
+ if r >= 33 && r <= 126 {
+ if e.Keysym.Mod&sdl.KMOD_SHIFT != 0 {
+ r = unicode.ToUpper(r)
+ }
+ p.searchQuery += string(r)
+ p.buildSearchList()
+ p.rebuildSearchLabel()
+ }
+ }
+ p.layout()
+ return nil
+ }
+
+ // --- Browse mode ---
+ switch sym {
+ case sdl.K_UP:
+ if p.highlightIndex > 0 {
+ p.highlightIndex--
+ if p.highlightIndex < p.scrollOffset {
+ p.scrollOffset--
+ }
+ }
+ case sdl.K_DOWN:
+ if p.highlightIndex < len(p.allItems)-1 {
+ p.highlightIndex++
+ if p.highlightIndex >= p.scrollOffset+p.maxVisible {
+ p.scrollOffset++
+ }
+ }
+ case sdl.K_PAGEUP:
+ p.highlightIndex = p.scrollOffset
+ p.scrollOffset -= p.maxVisible - 1
+ if p.scrollOffset < 0 {
+ p.scrollOffset = 0
+ p.highlightIndex = 0
+ }
+ case sdl.K_PAGEDOWN:
+ bottomIdx := p.scrollOffset + p.maxVisible - 1
+ if bottomIdx >= len(p.allItems) {
+ bottomIdx = len(p.allItems) - 1
+ }
+ p.scrollOffset = bottomIdx
+ p.highlightIndex = bottomIdx
+ case sdl.K_RETURN:
+ item := p.allItems[p.highlightIndex]
+ if !item.IsCategory { // If the item is NOT a Category
+ p.activeMap[item.ID] = !p.activeMap[item.ID] // Toggle it from the 'selected' list
+ p.acceptChanges()
+ } else if !item.IsSubCategory {
+ p.toggleExpansion(p.highlightIndex)
+ }
+ case sdl.K_SPACE:
+ item := p.allItems[p.highlightIndex]
+ if !item.IsCategory { // If the item is NOT a Category
+ p.activeMap[item.ID] = !p.activeMap[item.ID] // Toggle it from the 'selected' list
+ p.acceptChanges()
+ } else if !item.IsSubCategory {
+ p.toggleExpansion(p.highlightIndex)
+ }
+ default:
+ // Any printable character enters search mode
+ r := rune(sym)
+ if r >= 33 && r <= 126 {
+ if e.Keysym.Mod&sdl.KMOD_SHIFT != 0 {
+ r = unicode.ToUpper(r)
+ }
+ p.enterSearchMode(r)
+ }
+ }
+
+ p.layout()
+ }
+ return nil
+}
+
+func (p *ProclamationOptions) acceptChanges() {
+ p.Context.DbPtr.Transaction(func(tx *gorm.DB) error {
+ tx.Model(&db.Proclamation{}).Where("1 = 1").Update("selected", false)
+ var ids []string
+ for id, active := range p.activeMap {
+ if active {
+ ids = append(ids, id)
+ }
+ }
+ if len(ids) > 0 {
+ tx.Model(&db.Proclamation{}).Where("id IN ?", ids).Update("selected", true)
+ logger.Debug("Saving selected state for %s\n", ids)
+ }
+ return nil
+ })
+}
+
+// Update advances the spinning-cursor animation. The cursor's *position* is
+// recomputed in layout() whenever the highlighted row changes; this only
+// drives the spin itself, frame to frame.
+func (p *ProclamationOptions) Update(dt float32) error {
+ p.spinElapsed += dt
+ if p.spinElapsed >= 1.0 {
+ p.spinElapsed -= 1.0
+ }
+ return nil
+}
+
+func (p *ProclamationOptions) Render() error {
+ p.RenderTexture(p.textShader, p.title.ID, p.title.Position(), p.title.RawDimensions(), p.title.Color)
+ p.RenderTexture(p.textShader, p.prompt.ID, p.prompt.Position(), p.prompt.RawDimensions(), p.prompt.Color)
+
+ if p.isSearchActive {
+ // Search bar label
+ if p.searchInput.ID != 0 {
+ p.RenderTexture(p.textShader, p.searchInput.ID, p.searchInput.Position(), p.searchInput.RawDimensions(), p.searchInput.Color)
+ }
+
+ if len(p.searchItems) == 0 {
+ return nil
+ }
+
+ for i := p.searchScrollOff; i < p.searchScrollOff+p.maxVisible && i < len(p.searchItems); i++ {
+ item := p.searchItems[i]
+ if p.activeMap[item.ID] {
+ item.Label.Color = colors.Orange
+ } else {
+ item.Label.Color = colors.White
+ }
+ p.RenderTexture(p.textShader, item.Label.ID, item.Label.Position(), item.Label.RawDimensions(), item.Label.Color)
+ }
+
+ // Spinning triangle cursor — always on top, points at the highlighted result
+ p.renderCursor()
+
+ p.renderSearchScrollbar()
+ return nil
+ }
+
+ // Browse mode
+ if len(p.allItems) == 0 {
+ return nil
+ }
+
+ for i := p.scrollOffset; i < p.scrollOffset+p.maxVisible && i < len(p.allItems); i++ {
+ item := p.allItems[i]
+ if item.IsCategory {
+ item.Label.Color = colors.DodgerBlue
+ } else if p.activeMap[item.ID] {
+ item.Label.Color = colors.Orange
+ } else {
+ item.Label.Color = colors.White
+ }
+ p.RenderTexture(p.textShader, item.Label.ID, item.Label.Position(), item.Label.RawDimensions(), item.Label.Color)
+ }
+
+ // Spinning triangle cursor — always on top, points at the highlighted row
+ p.renderCursor()
+
+ p.renderScrollbar()
+ return nil
+}
+
+// renderCursor draws the spinning triangle cursor pointing at whichever row
+// is currently highlighted, in either browse or search mode. Identical
+// shape/animation to the cursor in AudioOptions.
+func (p *ProclamationOptions) renderCursor() error {
+ if !p.triVisible {
+ return nil
+ }
+
+ scaleY := float32(math.Cos(2 * math.Pi * float64(p.spinElapsed)))
+
+ model := mgl32.Ident4()
+ model = model.Mul4(mgl32.Translate3D(p.triX+triangleSize/2, p.triCenterY, 0))
+ model = model.Mul4(mgl32.Scale3D(triangleSize, triangleSize*scaleY, 1))
+ mvp := p.Projection.Mul4(model)
+
+ gl.UseProgram(p.solidShader.ProgramID)
+ gl.UniformMatrix4fv(p.solidShader.LocMVPMatrix, 1, false, &mvp[0])
+ gl.Uniform4f(
+ p.solidShader.LocColor,
+ float32(colors.White.R)/255.0,
+ float32(colors.White.G)/255.0,
+ float32(colors.White.B)/255.0,
+ float32(colors.White.A)/255.0,
+ )
+
+ gl.BindVertexArray(p.triVAO)
+ gl.DrawArrays(gl.TRIANGLES, 0, 3)
+ gl.BindVertexArray(0)
+ gl.UseProgram(0)
+
+ return nil
+}
+
+func (p *ProclamationOptions) renderScrollbar() {
+ total := len(p.allItems)
+ if total <= p.maxVisible {
+ return
+ }
+
+ p.RenderSolidColorQuad(p.solidShader,
+ mgl32.Vec2{float32(p.scrollTrackX), float32(p.scrollTrackY)},
+ mgl32.Vec2{float32(p.scrollTrackWidth), float32(p.scrollTrackHeight)},
+ colorScrollTrack)
+
+ visibleRatio := float32(p.maxVisible) / float32(total)
+ scrollRatio := float32(p.scrollOffset) / float32(total)
+ thumbHeight := float32(p.scrollTrackHeight) * visibleRatio
+ if thumbHeight < 20 {
+ thumbHeight = 20
+ }
+ thumbY := float32(p.scrollTrackY) + float32(p.scrollTrackHeight)*scrollRatio
+
+ p.RenderSolidColorQuad(p.solidShader,
+ mgl32.Vec2{float32(p.scrollTrackX + 2), thumbY},
+ mgl32.Vec2{float32(p.scrollTrackWidth - 4), thumbHeight},
+ colorScrollThumb)
+}
+
+func (p *ProclamationOptions) renderSearchScrollbar() {
+ total := len(p.searchItems)
+ if total <= p.maxVisible {
+ return
+ }
+
+ p.RenderSolidColorQuad(p.solidShader,
+ mgl32.Vec2{float32(p.scrollTrackX), float32(p.scrollTrackY)},
+ mgl32.Vec2{float32(p.scrollTrackWidth), float32(p.scrollTrackHeight)},
+ colorScrollTrack)
+
+ visibleRatio := float32(p.maxVisible) / float32(total)
+ scrollRatio := float32(p.searchScrollOff) / float32(total)
+ thumbHeight := float32(p.scrollTrackHeight) * visibleRatio
+ if thumbHeight < 20 {
+ thumbHeight = 20
+ }
+ thumbY := float32(p.scrollTrackY) + float32(p.scrollTrackHeight)*scrollRatio
+
+ p.RenderSolidColorQuad(p.solidShader,
+ mgl32.Vec2{float32(p.scrollTrackX + 2), thumbY},
+ mgl32.Vec2{float32(p.scrollTrackWidth - 4), thumbHeight},
+ colorScrollThumb)
+}
+
+func (p *ProclamationOptions) Destroy() error {
+ gl.DeleteTextures(1, &p.title.ID)
+ gl.DeleteTextures(1, &p.prompt.ID)
+ if p.searchInput.ID != 0 {
+ gl.DeleteTextures(1, &p.searchInput.ID)
+ }
+ // Delete browse category textures
+ for _, item := range p.allItems {
+ if item.IsCategory {
+ gl.DeleteTextures(1, &item.Label.ID)
+ }
+ }
+ // Delete proclamation textures via the pool (single source of truth)
+ for _, item := range p.allProclamations {
+ gl.DeleteTextures(1, &item.Label.ID)
+ }
+ gl.DeleteBuffers(1, &p.triVBO)
+ gl.DeleteVertexArrays(1, &p.triVAO)
+ return nil
+}
diff --git a/archive/internal/page/router.go b/archive/internal/page/router.go
new file mode 100644
index 0000000..340b667
--- /dev/null
+++ b/archive/internal/page/router.go
@@ -0,0 +1,79 @@
+package page
+
+import (
+ "gorm.io/gorm"
+ "rhemawavetech.com/rhemawave/internal/download"
+)
+
+type pageType int
+
+const (
+ HOME pageType = iota
+ SCROLLER
+ SETTINGS
+ WIFI
+ AUDIO
+ PROCLAMATIONS
+ LICENSE_KEY
+ EMAIL_ADDRESS
+ LOGS
+ MESSAGE
+ DOWNLOADING_ASSETS
+)
+
+type PageCtx struct {
+ DbPtr *gorm.DB
+ W, H int32
+ MessageChannel chan download.DownloadStatus
+ DownloadDone chan struct{} // closed when downloads finish (success or failure)
+ NavigateTo func(pageType)
+ Msg string // Message to be displayed by MessagePage
+ Inst string // Instructions to be displayed on MessagePage
+}
+
+type Router struct {
+ ActivePage Page
+ Context PageCtx
+}
+
+func NewRouter(pgCtx PageCtx) *Router {
+ r := &Router{
+ Context: pgCtx,
+ }
+ r.Context.NavigateTo = r.NavigateTo
+ r.NavigateTo(HOME)
+ return r
+}
+
+func (r *Router) NavigateTo(p pageType) {
+ if r.ActivePage != nil {
+ r.ActivePage.Destroy()
+ }
+
+ switch p {
+ case HOME:
+ r.ActivePage = &Home{}
+ case SCROLLER:
+ r.ActivePage = &ScrollerPage{}
+ case SETTINGS:
+ r.ActivePage = &Settings{}
+ case WIFI:
+ r.ActivePage = &WiFiSetupPage{}
+ case AUDIO:
+ r.ActivePage = &AudioOptions{}
+ case PROCLAMATIONS:
+ r.ActivePage = &ProclamationOptions{}
+ case LICENSE_KEY:
+ r.ActivePage = &LicenseKeyPage{}
+ case EMAIL_ADDRESS:
+ r.ActivePage = &EmailAddressPage{}
+ case LOGS:
+ r.ActivePage = &LogViewerPage{}
+ case MESSAGE:
+ r.ActivePage = &MessagePage{}
+ case DOWNLOADING_ASSETS:
+ r.ActivePage = &DownloadingAssets{}
+ }
+
+ r.ActivePage.Init(&r.Context)
+}
diff --git a/archive/internal/page/scrollerPage.go b/archive/internal/page/scrollerPage.go
new file mode 100644
index 0000000..406f79b
--- /dev/null
+++ b/archive/internal/page/scrollerPage.go
@@ -0,0 +1,829 @@
+package page
+
+import (
+ "fmt"
+ "math"
+ "os"
+ "path/filepath"
+ "strings"
+
+ "github.com/go-gl/gl/v3.3-core/gl"
+ "github.com/veandco/go-sdl2/sdl"
+ "rhemawavetech.com/rhemawave/internal/colors"
+ "rhemawavetech.com/rhemawave/internal/db"
+ "rhemawavetech.com/rhemawave/internal/fontManager"
+ "rhemawavetech.com/rhemawave/internal/logger"
+ "rhemawavetech.com/rhemawave/internal/mixer"
+ colorPattern "rhemawavetech.com/rhemawave/internal/pattern/color"
+ linePattern "rhemawavetech.com/rhemawave/internal/pattern/line"
+ "rhemawavetech.com/rhemawave/internal/shaderManager"
+)
+
+const (
+ defaultProclamationID string = "f3d42354-3197-45e4-9b08-be447f14386d"
+ proclamationPlayCount int = 20
+ // defaultProclamationPlayCount int = 1
+)
+
+type ScrollerPage struct {
+ Base
+
+ streams []proclamationStream
+ streamIndex int
+
+ // currentAudioFreq is the solfeggio Hz value of whatever track is
+ // currently playing. 0 means "no specific frequency" (either the
+ // legacy Selected-AudioFile track, or nothing yet).
+ currentAudioFreq int
+
+ IsDownloadingAudio bool
+
+ lines *LineDeque
+ lineHeight int32
+ shader *shaderManager.Shader
+ activePattern linePattern.LinePattern
+ font *fontManager.FontEntry
+ spaceWidth int32
+ lineCtx *linePattern.LineRenderContext
+ colorPattern *colorPattern.ColorPattern
+ scrollOffset float32
+ scrollY float32
+ fontScale float32
+
+ // Reuse one GL texture per unique word.
+ wordTextureCache map[string]StringItem
+
+ increment float32
+ velocity float32
+
+ // Time-based velocity control
+ velocityFloor float32
+ velocityCeiling float32
+ velocityStep float32
+ velocityDelay float32
+ velocityDirection int
+ velocityTimer float32
+ velocityState int
+ autoVelocity bool
+ hold float32
+
+ // Color palette settings
+ useColorPalettes bool
+}
+
+type ScrollerProclamation struct {
+ db.Proclamation
+ colorPattern.ColorPattern
+ ColorPalette []sdl.Color
+}
+
+type Line struct {
+ words []StringItem
+ width int32
+ color sdl.Color // Color for the entire line
+}
+
+// proclamationStream tracks one proclamation and how many full loops it should play.
+type proclamationStream struct {
+ name string
+ words []string
+ repeat int
+ completed int
+ wordIndex int
+ palette []sdl.Color // Color palette for this proclamation
+ colorIndex int // Track which color to use next
+
+ // frequencyValue is the solfeggio Hz value that should be audible while
+ // this stream plays. 0 means "no specific frequency" (the default
+ // proclamation) — entering this stream never changes the audio.
+ frequencyValue int
+}
+
+// LineDeque is a double-ended queue for Line values backed by a circular buffer.
+// It avoids O(n) prepend and prevents capacity leaks from head-of-slice removal.
+type LineDeque struct {
+ buf []Line
+ head, tail int
+ count int
+}
+
+func NewLineDeque(cap int) *LineDeque {
+ if cap < 4 {
+ cap = 4
+ }
+ return &LineDeque{buf: make([]Line, cap)}
+}
+
+func (d *LineDeque) Len() int { return d.count }
+
+func (d *LineDeque) grow() {
+ newCap := len(d.buf) * 2
+ newBuf := make([]Line, newCap)
+ for i := 0; i < d.count; i++ {
+ newBuf[i] = d.buf[(d.head+i)%len(d.buf)]
+ }
+ d.buf = newBuf
+ d.head = 0
+ d.tail = d.count
+}
+
+func (d *LineDeque) PushBack(l Line) {
+ if d.count == len(d.buf) {
+ d.grow()
+ }
+ d.buf[d.tail] = l
+ d.tail = (d.tail + 1) % len(d.buf)
+ d.count++
+}
+
+func (d *LineDeque) PushFront(l Line) {
+ if d.count == len(d.buf) {
+ d.grow()
+ }
+ d.head = (d.head - 1 + len(d.buf)) % len(d.buf)
+ d.buf[d.head] = l
+ d.count++
+}
+
+func (d *LineDeque) PopFront() Line {
+ l := d.buf[d.head]
+ d.buf[d.head] = Line{} // clear for GC
+ d.head = (d.head + 1) % len(d.buf)
+ d.count--
+ return l
+}
+
+func (d *LineDeque) PopBack() Line {
+ d.tail = (d.tail - 1 + len(d.buf)) % len(d.buf)
+ l := d.buf[d.tail]
+ d.buf[d.tail] = Line{} // clear for GC
+ d.count--
+ return l
+}
+
+func (d *LineDeque) Front() Line { return d.buf[d.head] }
+
+func (d *LineDeque) Back() Line {
+ return d.buf[(d.tail-1+len(d.buf))%len(d.buf)]
+}
+
+func (d *LineDeque) Get(i int) *Line {
+ return &d.buf[(d.head+i)%len(d.buf)]
+}
+
+func (d *LineDeque) Set(i int, l Line) {
+ d.buf[(d.head+i)%len(d.buf)] = l
+}
+
+func (d *LineDeque) Clear() {
+ for i := 0; i < d.count; i++ {
+ d.buf[(d.head+i)%len(d.buf)] = Line{}
+ }
+ d.head, d.tail, d.count = 0, 0, 0
+}
+
+func (p *ScrollerPage) Init(ctx *PageCtx) error {
+ p.increment = 100.0
+ p.velocity = 800.0
+ p.SetAutoVelocity(true, -4000.0, 4000.0, 100.0, 2.5, 6.0)
+ p.useColorPalettes = true // Default to enabled
+
+ sm := shaderManager.Get()
+ fm := fontManager.Get()
+
+ // Get font
+ font, ok := fm.GetFont("Scrambled")
+ if !ok {
+ return fmt.Errorf("unable to fetch font 'Scrambled'")
+ }
+ p.font = font
+ logger.Debug("Font name: %s", font.Name)
+
+ p.Base.Init(ctx)
+
+ // Get text shader
+ textShader, ok := sm.Get("text")
+ if !ok {
+ return fmt.Errorf("text shader not found")
+ }
+ p.shader = textShader
+ logger.Debug("Shader Program ID: %d", textShader.ProgramID)
+ logger.Debug("p.shader Program ID: %d", p.shader.ProgramID)
+
+ p.wordTextureCache = make(map[string]StringItem, 256)
+
+ // Load proclamation streams from database
+ if err := p.loadProclamations(); err != nil {
+ logger.Error("Error loading proclamations: %v", err)
+ p.Context.NavigateTo(PROCLAMATIONS)
+ return nil
+ }
+
+ // Get line pattern from database
+ config, err := db.GetConfig(p.Context.DbPtr)
+ if err != nil {
+ panic(err)
+ }
+ linePatternName := config.LinePattern
+
+ p.activePattern, err = linePattern.Get(linePatternName)
+ if err != nil {
+ return fmt.Errorf("failed to load line pattern '%s': %w", linePatternName, err)
+ }
+
+ // Initialize color pattern
+ baseColors := []sdl.Color{
+ colors.Tan,
+ colors.PeachPuff,
+ colors.LightCyan,
+ colors.LightSeaGreen,
+ colors.MediumTurquoise,
+ colors.DarkCyan,
+ colors.MediumPurple,
+ }
+ p.colorPattern = colorPattern.NewColorPattern(baseColors)
+
+ // Font setup
+ p.fontScale = float32(32) / float32(config.StandardFontSize)
+ nLines := int(float32(p.ScreenHeight) / 32.0)
+ p.lines = NewLineDeque(nLines * 2)
+
+ // Calculate space width using the scale ratio.
+ spaceGlyph, ok := fm.GetGlyph(font.Name, ' ')
+ if !ok {
+ return fmt.Errorf("failed to get space glyph")
+ }
+ p.spaceWidth = int32(float32(spaceGlyph.Advance) * p.fontScale)
+
+ // Get line height using the same scale ratio.
+ tmpStrID, _, H, err := fm.NewCreateStringTexture(font.Name, "Mg", p.shader)
+ if err != nil {
+ return fmt.Errorf("failed to create sample texture: %w", err)
+ }
+ p.lineHeight = int32(float32(H) * p.fontScale)
+ gl.DeleteTextures(1, &tmpStrID)
+
+ p.lineCtx = &linePattern.LineRenderContext{
+ ScreenWidth: p.ScreenWidth,
+ Font: font,
+ FontScale: p.fontScale,
+ SpaceWidth: p.spaceWidth,
+ }
+
+ // Create initial lines
+ for i := range nLines {
+ if err := p.createLine(i, true); err != nil {
+ return fmt.Errorf("failed to create initial line %d: %w", i, err)
+ }
+ }
+
+ // Start audio for the first proclamation in the stream. Falls back to
+ // whatever track is marked Selected in the audio_files table if the
+ // first stream has no frequency (e.g. only the default proclamation is
+ // queued) or its matching file doesn't exist on disk yet.
+ started := false
+ if len(p.streams) > 0 {
+ started = p.switchAudioForFrequency(p.streams[0].frequencyValue)
+ }
+
+ if !started {
+ var selectedAudio db.AudioFile
+ if err := p.Context.DbPtr.Where("Selected = ?", true).First(&selectedAudio).Error; err != nil {
+ selectedAudio = db.AudioFile{
+ Name: "OriginalAudio",
+ Path: filepath.Join(audioDir(), "OriginalAudio.wav"),
+ Selected: true,
+ Order: 0,
+ }
+ }
+
+ logger.Info("Playing %s", selectedAudio.Path)
+ if err := mixer.Play(selectedAudio.Path, true, config); err != nil {
+ logger.Error("Mixer returned an error: %v", err)
+ }
+ }
+
+ currentDevice := mixer.CurrentDevice()
+ if currentDevice == "" {
+ currentDevice = "default"
+ }
+ _ = currentDevice
+
+ return nil
+}
+
+// loadProclamations loads selected proclamations as stream units (not one giant word list).
+func (p *ScrollerPage) loadProclamations() error {
+ p.streams = p.streams[:0]
+
+ // Load all solfeggio frequencies
+ var frequencies []db.SolfeggioFrequency
+ if err := p.Context.DbPtr.Find(&frequencies).Error; err != nil {
+ return fmt.Errorf("failed to load solfeggio frequencies: %v", err)
+ }
+
+ // Create a map of frequency ID to its value
+ frequencyMap := make(map[int]int)
+ for _, freq := range frequencies {
+ frequencyMap[freq.ID] = freq.Value
+ }
+
+ // Map frequency values to their color palettes
+ frequencyPalettes := map[int][]sdl.Color{
+ 396: colors.Freq_396_Colors[:],
+ 417: colors.Freq_417_Colors[:],
+ 528: colors.Freq_528_Colors[:], // Default proclamation
+ 639: colors.Freq_639_Colors[:],
+ 741: colors.Freq_741_Colors[:],
+ 852: colors.Freq_852_Colors[:],
+ 963: colors.Freq_963_Colors[:],
+ }
+
+ // Load selected proclamations
+ var selected []db.Proclamation
+ if err := p.Context.DbPtr.Where("selected = ?", true).Find(&selected).Error; err != nil {
+ return err
+ }
+
+ // Load default proclamation
+ var defaultProclamation db.Proclamation
+ if err := p.Context.DbPtr.Where("ID = ?", defaultProclamationID).First(&defaultProclamation).Error; err != nil {
+ return err
+ }
+ defaultWords := strings.Fields(defaultProclamation.Content)
+
+ // Build interleaved stream:
+ // each selected proclamation repeats N times, then default repeats once.
+ for _, proclamation := range selected {
+ // Skip default proclamation if it's in the selected list
+ if proclamation.ID == defaultProclamationID {
+ continue
+ }
+
+ words := strings.Fields(proclamation.Content)
+ if len(words) == 0 {
+ continue
+ }
+
+ // Get the frequency value for this proclamation
+ freqValue, ok := frequencyMap[proclamation.SolfeggioFrequencyID]
+ if !ok {
+ logger.Warning("No frequency found for proclamation %s, using default palette", proclamation.Name)
+ freqValue = 528 // Default to 528 if frequency not found
+ }
+
+ // Get the palette for this frequency
+ palette, ok := frequencyPalettes[freqValue]
+ if !ok {
+ logger.Warning("No palette found for frequency %d, using default palette", freqValue)
+ palette = colors.Freq_528_Colors[:] // Fallback to default palette
+ }
+
+ p.streams = append(p.streams, proclamationStream{
+ name: proclamation.Name,
+ words: words,
+ repeat: proclamationPlayCount,
+ palette: palette,
+ colorIndex: 0,
+ frequencyValue: freqValue,
+ })
+
+ if len(defaultWords) > 0 {
+ p.streams = append(p.streams, proclamationStream{
+ name: defaultProclamation.Name,
+ words: defaultWords,
+ repeat: 1,
+ palette: colors.Freq_528_Colors[:], // Default palette for default proclamation
+ colorIndex: 0,
+ frequencyValue: 0, // default proclamation never changes audio
+ })
+ }
+ }
+
+ // Fallback: if no non-default selected proclamations, at least play default.
+ if len(p.streams) == 0 && len(defaultWords) > 0 {
+ p.streams = append(p.streams, proclamationStream{
+ name: defaultProclamation.Name,
+ words: defaultWords,
+ repeat: 1,
+ palette: colors.Freq_528_Colors[:],
+ colorIndex: 0,
+ frequencyValue: 0,
+ })
+ }
+
+ if len(p.streams) == 0 {
+ return fmt.Errorf("failed to load proclamations: no proclamation words available")
+ }
+
+ p.streamIndex = 0
+ return nil
+}
+
+// audioDir returns the path to the audio files directory (~/.radiantwave/audio).
+func audioDir() string {
+ home, err := os.UserHomeDir()
+ if err != nil {
+ panic(err)
+ }
+ return filepath.Join(home, ".radiantwave", "audio")
+}
+
+// audioPathForFrequency builds the on-disk path for a solfeggio frequency's
+// audio file, e.g. 396 -> "~/.radiantwave/audio/396Hz.wav".
+func (p *ScrollerPage) audioPathForFrequency(freq int) string {
+ return filepath.Join(audioDir(), fmt.Sprintf("%dHz.wav", freq))
+}
+
+// switchAudioForFrequency swaps the currently playing track to match freq.
+//
+// - freq == 0 ("no specific frequency", i.e. the default proclamation) is
+// always a no-op — whatever is playing keeps playing.
+// - If freq already matches what's playing, nothing happens.
+// - If the matching file doesn't exist on disk yet, the current track
+// keeps playing untouched (so missing solfeggio audio never causes
+// silence — and starts working automatically once the file is added).
+// - Otherwise the current track is stopped immediately and freq's track
+// starts right away (hard cut, no fade).
+//
+// Returns true if freq's track is now playing (either just switched, or
+// already was).
+func (p *ScrollerPage) switchAudioForFrequency(freq int) bool {
+ if freq == 0 {
+ return false
+ }
+ if freq == p.currentAudioFreq {
+ return true
+ }
+
+ path := p.audioPathForFrequency(freq)
+ if _, err := os.Stat(path); err != nil {
+ logger.Warning("No audio file for %dHz (%s), keeping current track", freq, path)
+ return false
+ }
+ config, err := db.GetConfig(p.Context.DbPtr)
+ if err != nil {
+ panic(err)
+ }
+ mixer.Stop(3000, config)
+ if err := mixer.Play(path, true, config); err != nil {
+ logger.Error("Mixer returned an error: %v", err)
+ return false
+ }
+ p.currentAudioFreq = freq
+ return true
+}
+
+// nextLineWords gets words for the current line and advances proclamation stream when needed.
+func (p *ScrollerPage) nextLineWords() []string {
+ if len(p.streams) == 0 {
+ return nil
+ }
+
+ s := &p.streams[p.streamIndex]
+ if len(s.words) == 0 {
+ p.streamIndex = (p.streamIndex + 1) % len(p.streams)
+ return p.nextLineWords()
+ }
+
+ prevIdx := s.wordIndex
+ words := p.activePattern.GetNextLine(s.words, &s.wordIndex, p.lineCtx)
+
+ // If word index wraps, one full proclamation pass completed.
+ if s.wordIndex < prevIdx {
+ s.completed++
+ targetRepeats := s.repeat
+ if targetRepeats <= 0 {
+ targetRepeats = 1
+ }
+ if s.completed >= targetRepeats {
+ s.completed = 0
+ s.wordIndex = 0
+ s.colorIndex = 0 // Reset color index when proclamation restarts
+ p.streamIndex = (p.streamIndex + 1) % len(p.streams)
+ next := &p.streams[p.streamIndex]
+ p.switchAudioForFrequency(next.frequencyValue)
+ }
+ }
+
+ return words
+}
+
+// getCachedWord returns a reusable textured StringItem for a word.
+func (p *ScrollerPage) getCachedWord(word string) (StringItem, error) {
+ if cached, ok := p.wordTextureCache[word]; ok {
+ return cached, nil
+ }
+
+ base, err := NewStringItem(word, p.font, sdl.Color{R: 255, G: 255, B: 255, A: 255})
+ if err != nil {
+ return StringItem{}, fmt.Errorf("unable to create cached string item for word '%s': %w", word, err)
+ }
+ base.Scale(p.fontScale)
+
+ p.wordTextureCache[word] = base
+ return base, nil
+}
+
+// buildLineFromWords builds a line using cached texture IDs and per-instance color/position.
+func (p *ScrollerPage) buildLineFromWords(words []string) (Line, error) {
+ line := Line{words: []StringItem{}}
+
+ // Get the current proclamation's color palette
+ var lineColor sdl.Color
+ if p.useColorPalettes && len(p.streams) > 0 {
+ currentStream := &p.streams[p.streamIndex]
+ if len(currentStream.palette) > 0 {
+ // Use the current color from the palette
+ lineColor = currentStream.palette[currentStream.colorIndex]
+ // Increment color index for the next line
+ currentStream.colorIndex = (currentStream.colorIndex + 1) % len(currentStream.palette)
+ } else {
+ // Fallback to default color if no palette is found
+ lineColor = p.colorPattern.Color()
+ }
+ } else {
+ // Use the default color pattern if useColorPalettes is false
+ lineColor = p.colorPattern.Color()
+ }
+
+ for _, word := range words {
+ if word == "" {
+ continue
+ }
+
+ cached, err := p.getCachedWord(word)
+ if err != nil {
+ return Line{}, err
+ }
+
+ item := cached
+ item.Color = lineColor // Assign the line color to all words in the line
+
+ if len(line.words) > 0 {
+ line.width += p.spaceWidth
+ }
+ line.words = append(line.words, item)
+ line.width += item.W
+ }
+
+ line.color = lineColor // Store the line color
+ return line, nil
+}
+
+// positionLine sets X/Y for all words in a line.
+func (p *ScrollerPage) positionLine(line *Line, baseY int32) {
+ startX := p.ScreenCenterX - (line.width / 2)
+ for j := range line.words {
+ if j == 0 {
+ line.words[j].X = startX
+ } else {
+ line.words[j].X = line.words[j-1].X + line.words[j-1].W + p.spaceWidth
+ }
+ line.words[j].Y = baseY
+ }
+}
+
+// createLine is a helper to generate a new line at a specific index.
+// isInitial determines if this is during initialization (positions from top)
+// or dynamic creation (positions relative to existing lines).
+func (p *ScrollerPage) createLine(index int, isInitial bool) error {
+ words := p.nextLineWords()
+ line, err := p.buildLineFromWords(words)
+ if err != nil {
+ return err
+ }
+
+ var baseY int32
+ if isInitial {
+ baseY = int32(p.scrollY) - int32(p.lineHeight)*int32(index)
+ } else {
+ baseY = 0
+ }
+ p.positionLine(&line, baseY)
+
+ if isInitial {
+ p.lines.PushBack(line)
+ }
+
+ return nil
+}
+
+func (p *ScrollerPage) HandleEvent(event *sdl.Event) error {
+ // switch e := (*event).(type) {
+ // case *sdl.KeyboardEvent:
+ // if e.Type != sdl.KEYDOWN {
+ // return nil
+ // }
+ // switch e.Keysym.Sym {
+ // case sdl.K_UP:
+ // if !p.autoVelocity {
+ // p.velocity += p.increment
+ // }
+ // case sdl.K_DOWN:
+ // if !p.autoVelocity {
+ // p.velocity -= p.increment
+ // }
+ // }
+ // return nil
+ // }
+ return nil
+}
+
+func (p *ScrollerPage) Update(dt float32) error {
+ p.updateAutoVelocity(dt)
+
+ p.scrollOffset += dt * p.velocity
+ move := int32(p.scrollOffset)
+ if move == 0 {
+ return nil
+ }
+ p.scrollOffset -= float32(move)
+
+ // Move all lines vertically
+ for i := 0; i < p.lines.Len(); i++ {
+ line := p.lines.Get(i)
+ for j := range line.words {
+ line.words[j].Y += move
+ }
+ }
+
+ // Handle line replacement based on scroll direction
+ if p.velocity > 0 {
+ // Moving up: replace lines that go off top
+ for p.lines.Len() > 0 && len(p.lines.Front().words) > 0 && p.lines.Front().words[0].Y > p.ScreenHeight {
+ _ = p.lines.PopFront() // no texture delete; textures are shared via cache
+
+ if err := p.addLineAtBottom(); err != nil {
+ return err
+ }
+ }
+ } else if p.velocity < 0 {
+ // Moving down: replace lines that go off bottom
+ for p.lines.Len() > 0 {
+ back := p.lines.Back()
+ if len(back.words) == 0 || back.words[0].Y+back.words[0].H >= 0 {
+ break
+ }
+
+ _ = p.lines.PopBack() // no texture delete; textures are shared via cache
+
+ if err := p.addLineAtTop(); err != nil {
+ return err
+ }
+ }
+ }
+
+ return nil
+}
+
+// addLineAtBottom creates and adds a new line at the bottom of the display.
+func (p *ScrollerPage) addLineAtBottom() error {
+ newWords := p.nextLineWords()
+ line, err := p.buildLineFromWords(newWords)
+ if err != nil {
+ return err
+ }
+
+ var baseY int32
+ if p.lines.Len() > 0 && len(p.lines.Back().words) > 0 {
+ baseY = p.lines.Back().words[0].Y - int32(p.lineHeight)
+ } else {
+ baseY = -int32(p.lineHeight)
+ }
+
+ p.positionLine(&line, baseY)
+ p.lines.PushBack(line)
+ return nil
+}
+
+// addLineAtTop creates and adds a new line at the top of the display.
+func (p *ScrollerPage) addLineAtTop() error {
+ newWords := p.nextLineWords()
+ line, err := p.buildLineFromWords(newWords)
+ if err != nil {
+ return err
+ }
+
+ var baseY int32
+ if p.lines.Len() > 0 && len(p.lines.Front().words) > 0 {
+ baseY = p.lines.Front().words[0].Y + int32(p.lineHeight)
+ } else {
+ baseY = p.ScreenHeight
+ }
+
+ p.positionLine(&line, baseY)
+ p.lines.PushFront(line)
+ return nil
+}
+
+func (p *ScrollerPage) Render() error {
+ p.BeginTextureRendering(p.shader)
+ for i := 0; i < p.lines.Len(); i++ {
+ line := p.lines.Get(i)
+ for _, word := range line.words {
+ if word.ID == 0 {
+ continue
+ }
+ p.RenderTextureBatched(p.shader, word.ID, word.Position(), word.RawDimensions(), word.Color)
+ }
+ }
+ p.EndTextureRendering()
+ return nil
+}
+
+func (p *ScrollerPage) Destroy() error {
+ if p == nil {
+ return nil
+ }
+
+ config, err := db.GetConfig(p.Context.DbPtr)
+ if err != nil {
+ panic(err)
+ }
+
+ mixer.Stop(3000, config)
+
+ // Delete each cached word texture exactly once.
+ for k, item := range p.wordTextureCache {
+ if item.ID != 0 {
+ id := item.ID
+ gl.DeleteTextures(1, &id)
+ }
+ delete(p.wordTextureCache, k)
+ }
+
+ gl.Flush()
+
+ // Drop references for GC safely
+ p.lines = nil
+ p.streams = nil
+ p.lineCtx = nil
+ p.font = nil
+ p.shader = nil
+ p.colorPattern = nil
+ p.wordTextureCache = nil
+
+ return nil
+}
+
+// SetAutoVelocity configures the automatic velocity system for the ScrollerPage.
+func (p *ScrollerPage) SetAutoVelocity(enabled bool, floor, ceiling, step, delay, hold float32) {
+ p.autoVelocity = enabled
+ p.velocityFloor = -float32(math.Abs(float64(floor)))
+ p.velocityCeiling = float32(math.Abs(float64(ceiling)))
+ p.velocityStep = float32(math.Abs(float64(step)))
+ p.velocityDelay = delay
+ p.hold = hold
+
+ // Initialize state
+ p.velocityDirection = 1
+ p.velocityState = 0
+ p.velocityTimer = 0.0
+ p.velocity = p.velocityFloor
+}
+
+// SetUseColorPalettes enables or disables the use of color palettes for lines.
+func (p *ScrollerPage) SetUseColorPalettes(enabled bool) {
+ p.useColorPalettes = enabled
+}
+
+// updateAutoVelocity handles automatic velocity changes.
+func (p *ScrollerPage) updateAutoVelocity(dt float32) {
+ if !p.autoVelocity {
+ return
+ }
+
+ switch p.velocityState {
+ case 0: // Changing velocity
+ if p.velocityDirection == 1 {
+ p.velocity += p.velocityStep * dt
+ if p.velocity >= p.velocityCeiling {
+ p.velocity = p.velocityCeiling
+ p.velocityState = 1
+ p.velocityTimer = 0.0
+ }
+ } else {
+ p.velocity -= p.velocityStep * dt
+ if p.velocity <= p.velocityFloor {
+ p.velocity = p.velocityFloor
+ p.velocityState = 2
+ p.velocityTimer = 0.0
+ }
+ }
+
+ case 1: // Waiting at ceiling
+ p.velocityTimer += dt
+ if p.velocityTimer >= p.velocityDelay {
+ p.velocityDirection = -1
+ p.velocityState = 0
+ }
+
+ case 2: // Waiting at floor
+ p.velocityTimer += dt
+ if p.velocityTimer >= p.velocityDelay {
+ p.velocityDirection = 1
+ p.velocityState = 0
+ }
+ }
+}
diff --git a/archive/internal/page/settingsPage.go b/archive/internal/page/settingsPage.go
new file mode 100644
index 0000000..93eb689
--- /dev/null
+++ b/archive/internal/page/settingsPage.go
@@ -0,0 +1,255 @@
+package page
+
+import (
+ "fmt"
+
+ "github.com/go-gl/gl/v3.3-core/gl"
+ "github.com/veandco/go-sdl2/sdl"
+ "rhemawavetech.com/rhemawave/internal/colors"
+ "rhemawavetech.com/rhemawave/internal/db"
+ "rhemawavetech.com/rhemawave/internal/fontManager"
+ "rhemawavetech.com/rhemawave/internal/shaderManager"
+)
+
+type Settings struct {
+ Base
+ font *fontManager.FontEntry
+ textShader *shaderManager.Shader
+ solidShader *shaderManager.Shader
+ title StringItem
+ prompt StringItem
+ options []Option
+ verticalMargin int32
+ bgHighlight PageItem
+ highlightIndex int
+}
+
+type Option struct {
+ target pageType
+ label StringItem
+}
+
+func (p *Settings) Init(ctx *PageCtx) error {
+ var err error
+ p.verticalMargin = int32(20)
+
+ // Get font
+ fm := fontManager.Get()
+ font, ok := fm.GetFont("SpaceMonoNerdFont-Regular")
+ if !ok {
+ return fmt.Errorf("failed to get font: %w", sdl.GetError())
+ }
+ p.font = font
+
+ // Get shaders
+ sm := shaderManager.Get()
+ p.textShader, ok = sm.Get("text")
+ if !ok {
+ return fmt.Errorf("failed to get text shader: %w", sdl.GetError())
+ }
+ p.solidShader, ok = sm.Get("solid_color")
+ if !ok {
+ return fmt.Errorf("failed to get solid_color shader: %w", sdl.GetError())
+ }
+
+ // Initialize base
+ if err := p.Base.Init(ctx); err != nil {
+ return fmt.Errorf("failed base page initialization: %w", err)
+ }
+
+ // Create title
+ p.title, err = NewStringItem("Settings", font, colors.White)
+ if err != nil {
+ return fmt.Errorf("creating title: %w", err)
+ }
+
+ // Create prompt
+ p.prompt, err = NewStringItem("Use Arrow Keys to Navigate, Enter to Select, or F1 to return to the Main Menu", font, colors.White)
+ if err != nil {
+ return fmt.Errorf("creating prompt: %w", err)
+ }
+
+ // Create options
+ proclamationsLabel, err := NewStringItem("Proclamations", font, colors.White)
+ if err != nil {
+ return fmt.Errorf("creating proclamations label: %w", err)
+ }
+ p.options = append(p.options, Option{
+ target: PROCLAMATIONS,
+ label: proclamationsLabel,
+ })
+
+ audioLabel, err := NewStringItem("Audio", font, colors.White)
+ if err != nil {
+ return fmt.Errorf("creating audio label: %w", err)
+ }
+ p.options = append(p.options, Option{
+ target: AUDIO,
+ label: audioLabel,
+ })
+
+ emailLabel, err := NewStringItem("Email Address", font, colors.White)
+ if err != nil {
+ return fmt.Errorf("creating email label: %w", err)
+ }
+ p.options = append(p.options, Option{
+ target: EMAIL_ADDRESS,
+ label: emailLabel,
+ })
+
+ licenseKeyLabel, err := NewStringItem("License Key", font, colors.White)
+ if err != nil {
+ return fmt.Errorf("creating license key label: %w", err)
+ }
+ p.options = append(p.options, Option{
+ target: LICENSE_KEY,
+ label: licenseKeyLabel,
+ })
+
+ wifiLabel, err := NewStringItem("WiFi Setup", font, colors.White)
+ if err != nil {
+ return fmt.Errorf("creating wifi label: %w", err)
+ }
+ p.options = append(p.options, Option{
+ target: WIFI,
+ label: wifiLabel,
+ })
+
+ logsLabel, err := NewStringItem("Logs", font, colors.White)
+ if err != nil {
+ return fmt.Errorf("creating logs label: %w", err)
+ }
+ p.options = append(p.options, Option{
+ target: LOGS,
+ label: logsLabel,
+ })
+
+ // TODO: Add entry for "Tutorial"
+ // TODO: Add entry for "About"
+
+ // Get base font size from database
+ config, err := db.GetConfig(p.Context.DbPtr)
+ if err != nil {
+ panic(err)
+ }
+ baseFontSize := config.StandardFontSize
+
+ // Calculate scales
+ titleScale := float32(64) / float32(baseFontSize)
+ scale := float32(32) / float32(baseFontSize)
+
+ // Apply scales
+ p.title.Scale(titleScale)
+ p.prompt.Scale(scale)
+
+ for i := range p.options {
+ p.options[i].label.Scale(scale)
+ }
+
+ // Create background highlight using first option's dimensions
+ p.bgHighlight = PageItem{
+ ID: 0,
+ W: p.options[0].label.W,
+ H: p.options[0].label.H,
+ Color: colors.White,
+ }
+ p.highlightIndex = 0
+
+ // Position title at bottom
+ p.title.X = p.Base.ScreenCenterX - p.title.W/2
+ p.title.Y = p.ScreenHeight - p.title.H - p.verticalMargin*2
+
+ // Position prompt above title
+ p.prompt.X = p.ScreenCenterX - int32(float32(p.prompt.W)/2)
+ p.prompt.Y = p.title.Y - p.verticalMargin*2 - p.prompt.H
+
+ // If this value starts at 0, nothing is further left than that...
+ var furthestLeft int32 = p.ScreenWidth // < more to the left, > more to the right, = same
+
+ // Position options stacked upward from prompt
+ for i, option := range p.options {
+ p.options[i].label.X = p.ScreenCenterX - option.label.W/2 // Calculate horizontal center posision
+ if p.options[i].label.X < furthestLeft { // If the left most pixel is further left than furthestLeft, indicating a longer line:
+ // Then update furthestLeft
+ furthestLeft = p.options[i].label.X
+ }
+ if i == 0 {
+ p.options[i].label.Y = int32(float32(p.prompt.Y)-(float32(p.verticalMargin)*4)) - option.label.H
+ } else {
+ p.options[i].label.Y = p.options[i-1].label.Y - option.label.H - 10
+ }
+ }
+
+ // Now, re-iterate over the options and justify everything to furthestLeft
+ for i := range p.options {
+ p.options[i].label.X = furthestLeft
+ }
+
+ return nil
+}
+
+func (p *Settings) Update(dt float32) error {
+ return nil
+}
+
+func (p *Settings) HandleEvent(event *sdl.Event) error {
+ switch e := (*event).(type) {
+ case *sdl.KeyboardEvent:
+ if e.Type != sdl.KEYDOWN {
+ return nil
+ }
+ switch e.Keysym.Sym {
+ case sdl.K_UP:
+ if p.highlightIndex > 0 {
+ p.highlightIndex--
+ }
+ case sdl.K_DOWN:
+ if p.highlightIndex < len(p.options)-1 {
+ p.highlightIndex++
+ }
+ case sdl.K_RETURN:
+ if p.highlightIndex >= 0 && p.highlightIndex < len(p.options) {
+ selectedOption := p.options[p.highlightIndex]
+ p.Context.NavigateTo(selectedOption.target)
+ }
+ case sdl.K_BACKSPACE:
+ p.Context.NavigateTo(HOME)
+ }
+ }
+ return nil
+}
+
+func (p *Settings) Render() error {
+ // Render title and prompt
+ p.RenderTexture(p.textShader, p.title.ID, p.title.Position(), p.title.RawDimensions(), p.title.Color)
+ p.RenderTexture(p.textShader, p.prompt.ID, p.prompt.Position(), p.prompt.RawDimensions(), p.prompt.Color)
+
+ // Render highlight behind selected option
+ p.RenderSolidColorQuad(
+ p.solidShader,
+ p.options[p.highlightIndex].label.Position(),
+ p.options[p.highlightIndex].label.RawDimensions(),
+ p.bgHighlight.Color,
+ )
+
+ // Render all options with appropriate colors
+ for i, option := range p.options {
+ if p.highlightIndex == i {
+ option.label.Color = colors.Black
+ } else {
+ option.label.Color = colors.White
+ }
+ p.RenderTexture(p.textShader, option.label.ID, option.label.Position(), option.label.RawDimensions(), option.label.Color)
+ }
+
+ return nil
+}
+
+func (p *Settings) Destroy() error {
+ gl.DeleteTextures(1, &p.title.ID)
+ gl.DeleteTextures(1, &p.prompt.ID)
+ for i := range p.options {
+ gl.DeleteTextures(1, &p.options[i].label.ID)
+ }
+ return nil
+}
diff --git a/archive/internal/page/wifiSetupPage.go b/archive/internal/page/wifiSetupPage.go
new file mode 100644
index 0000000..e6755d4
--- /dev/null
+++ b/archive/internal/page/wifiSetupPage.go
@@ -0,0 +1,656 @@
+package page
+
+import (
+ "context"
+ "fmt"
+
+ "github.com/go-gl/gl/v3.3-core/gl"
+ "github.com/go-gl/mathgl/mgl32"
+ "github.com/veandco/go-sdl2/sdl"
+ "rhemawavetech.com/rhemawave/internal/colors"
+ "rhemawavetech.com/rhemawave/internal/db"
+ "rhemawavetech.com/rhemawave/internal/fontManager"
+ "rhemawavetech.com/rhemawave/internal/keybinds"
+ "rhemawavetech.com/rhemawave/internal/logger"
+ "rhemawavetech.com/rhemawave/internal/network"
+ "rhemawavetech.com/rhemawave/internal/shaderManager"
+)
+
+// ─── Types ────────────────────────────────────────────────────────────────────
+
+type networkUIItem struct {
+ Net network.Network
+ Item StringItem
+}
+
+type wifiStatus int
+
+const (
+ wifiStatusIdle wifiStatus = iota
+ wifiStatusScanning
+ wifiStatusConnecting
+ wifiStatusConnected
+ wifiStatusError
+)
+
+// ─── Page ─────────────────────────────────────────────────────────────────────
+
+type WiFiSetupPage struct {
+ Base
+ applicationFont *fontManager.FontEntry
+ textInputSupported bool
+
+ // UI elements
+ BaseFontSize int
+ titleItem StringItem
+ scanningStatusItem StringItem
+ connectionStatusItem StringItem
+ passwordPromptItem StringItem
+ passwordInputItem StringItem
+ passwordErrorItem StringItem
+
+ // Network list
+ networks []networkUIItem
+ selectedIndex int
+
+ // State
+ status wifiStatus
+ statusMessage string
+ connectError string
+
+ // Password entry
+ isEnteringPassword bool
+ passwordInput string
+ selectedNet *network.Network
+
+ // Async
+ ctx context.Context
+ cancel context.CancelFunc
+ networksCh <-chan []network.Network
+ connectResultCh chan error
+}
+
+// ─── Init ─────────────────────────────────────────────────────────────────────
+
+func (p *WiFiSetupPage) Init(ctx *PageCtx) error {
+ if err := p.Base.Init(ctx); err != nil {
+ return fmt.Errorf("failed base page initialization: %w", err)
+ }
+
+ fm := fontManager.Get()
+ font, ok := fm.GetFont("SpaceMonoNerdFont-Regular")
+ if !ok {
+ return fmt.Errorf("could not find application font: SpaceMonoNerdFont-Regular")
+ }
+ p.applicationFont = font
+
+ var err error
+
+ p.titleItem, err = NewStringItem("Wi-Fi Setup", p.applicationFont, colors.White)
+ if err != nil {
+ return fmt.Errorf("failed to create title item: %w", err)
+ }
+ p.scanningStatusItem, err = NewStringItem("Scanning for networks...", p.applicationFont, colors.White)
+ if err != nil {
+ return fmt.Errorf("failed to create scanning status item: %w", err)
+ }
+
+ config, err := db.GetConfig(p.Context.DbPtr)
+ if err != nil {
+ panic(err)
+ }
+ p.BaseFontSize = config.StandardFontSize
+
+ p.connectResultCh = make(chan error, 1)
+ p.ctx, p.cancel = context.WithCancel(context.Background())
+
+ p.startScan()
+
+ return nil
+}
+
+// ─── Scan ─────────────────────────────────────────────────────────────────────
+
+func (p *WiFiSetupPage) startScan() {
+ p.status = wifiStatusScanning
+ p.statusMessage = "Scanning for networks..."
+ p.selectedIndex = 0
+ p.networks = nil
+
+ var err error
+ p.networksCh, err = network.ScanForNetworks(p.ctx)
+ if err != nil {
+ logger.Error("wifi: failed to start scan: %v", err)
+ p.status = wifiStatusError
+ p.statusMessage = "Failed to start network scan. No Wi-Fi adapter found."
+ p.rebuildStatusTexture()
+ }
+}
+
+// ─── Input ────────────────────────────────────────────────────────────────────
+
+func (p *WiFiSetupPage) HandleEvent(event *sdl.Event) error {
+ switch e := (*event).(type) {
+ case *sdl.KeyboardEvent:
+ if e.Type != sdl.KEYDOWN {
+ return nil
+ }
+ if p.isEnteringPassword {
+ p.handlePasswordKey(e.Keysym.Sym, e.Keysym.Mod)
+ } else {
+ p.handleNavKey(e.Keysym.Sym)
+ }
+ }
+ return nil
+}
+
+func (p *WiFiSetupPage) handlePasswordKey(sym sdl.Keycode, mod uint16) {
+ switch sym {
+ case sdl.K_RETURN:
+ p.submitPassword()
+ case sdl.K_BACKSPACE:
+ if len(p.passwordInput) > 0 {
+ runes := []rune(p.passwordInput)
+ p.passwordInput = string(runes[:len(runes)-1])
+ p.rebuildPasswordTexture()
+ }
+ case sdl.K_ESCAPE:
+ logger.Info("wifi: password entry cancelled")
+ p.exitPasswordMode()
+ p.connectError = ""
+ p.selectedNet = nil
+ default:
+ if ch := keycodeToChar(sym, mod); ch != 0 {
+ p.passwordInput += string(ch)
+ p.rebuildPasswordTexture()
+ }
+ }
+}
+
+func (p *WiFiSetupPage) handleNavKey(sym sdl.Keycode) {
+ switch sym {
+ case sdl.K_UP:
+ if p.selectedIndex > 0 {
+ p.selectedIndex--
+ }
+
+ case sdl.K_DOWN:
+ if p.selectedIndex < len(p.networks)-1 {
+ p.selectedIndex++
+ }
+
+ case sdl.K_RETURN:
+ if len(p.networks) == 0 || p.selectedIndex >= len(p.networks) {
+ return
+ }
+ selected := p.networks[p.selectedIndex].Net
+ p.selectedNet = &p.networks[p.selectedIndex].Net
+ p.connectError = ""
+
+ if selected.Security != network.SecurityOpen {
+ p.passwordInput = ""
+ p.enterPasswordMode()
+ } else {
+ p.connect("")
+ }
+
+ case sdl.K_r:
+ if p.status != wifiStatusScanning && p.status != wifiStatusConnecting {
+ p.startScan()
+ }
+
+ case sdl.K_ESCAPE:
+ p.selectedNet = nil
+ p.connectError = ""
+ }
+}
+
+func (p *WiFiSetupPage) enterPasswordMode() {
+ keybinds.Enabled = false
+ p.isEnteringPassword = true
+ p.textInputSupported = false
+ p.rebuildPasswordPromptTexture()
+ p.rebuildPasswordTexture()
+ sdl.StartTextInput()
+ logger.Info("wifi: password entry started for %q", p.selectedNet.SSID)
+}
+
+func (p *WiFiSetupPage) exitPasswordMode() {
+ keybinds.Enabled = true
+ p.isEnteringPassword = false
+ sdl.StopTextInput()
+ logger.Info("wifi: password entry finished")
+}
+
+func (p *WiFiSetupPage) submitPassword() {
+ p.exitPasswordMode()
+ p.connect(p.passwordInput)
+}
+
+// ─── Connect ──────────────────────────────────────────────────────────────────
+
+func (p *WiFiSetupPage) connect(password string) {
+ if p.selectedNet == nil {
+ return
+ }
+
+ ssid := p.selectedNet.SSID
+ p.status = wifiStatusConnecting
+ p.statusMessage = fmt.Sprintf("Connecting to \"%s\"...", ssid)
+ logger.Info("wifi: connecting to %q", ssid)
+
+ // ConnectToNetwork blocks (up to 15s), so run it off the main goroutine.
+ go func() {
+ err := network.ConnectToNetwork(ssid, password)
+ p.connectResultCh <- err
+ }()
+}
+
+// ─── Update ───────────────────────────────────────────────────────────────────
+
+func (p *WiFiSetupPage) Update(dt float32) error {
+ select {
+
+ case nets, ok := <-p.networksCh:
+ if ok {
+ p.rebuildNetworkList(nets)
+ if p.status == wifiStatusScanning {
+ p.status = wifiStatusIdle
+ p.statusMessage = ""
+ }
+ }
+
+ case err := <-p.connectResultCh:
+ if err != nil {
+ logger.Error("wifi: connection failed: %v", err)
+ p.status = wifiStatusError
+ p.connectError = fmt.Sprintf("Could not connect: %s", err.Error())
+ p.statusMessage = ""
+
+ // Drop back into password entry so the user can try again.
+ if p.selectedNet != nil && p.selectedNet.Security != network.SecurityOpen {
+ p.passwordInput = ""
+ p.rebuildPasswordErrorTexture()
+ p.enterPasswordMode()
+ }
+ } else {
+ ssid := ""
+ if p.selectedNet != nil {
+ ssid = p.selectedNet.SSID
+ }
+ logger.Info("wifi: connected to %q", ssid)
+ p.status = wifiStatusConnected
+ p.connectError = ""
+ p.statusMessage = fmt.Sprintf("Connected to \"%s\" — press F1 to continue", ssid)
+ // Trigger a fresh scan so the list shows the connected state.
+ p.startScan()
+ }
+
+ default:
+ }
+
+ p.rebuildStatusTexture()
+
+ return nil
+}
+
+// ─── Texture builders ─────────────────────────────────────────────────────────
+
+func (p *WiFiSetupPage) rebuildNetworkList(nets []network.Network) {
+ for _, item := range p.networks {
+ if item.Item.ID != 0 {
+ gl.DeleteTextures(1, &item.Item.ID)
+ }
+ }
+
+ p.networks = make([]networkUIItem, 0, len(nets))
+
+ for _, n := range nets {
+ label := n.SSID
+ switch {
+ case n.Connected:
+ label += " ✓"
+ case n.Saved:
+ label += " ★"
+ }
+ if n.Security != network.SecurityOpen {
+ var secStr string
+ switch n.Security {
+ case network.SecurityWEP:
+ secStr = "WEP"
+ case network.SecurityWPA:
+ secStr = "WPA"
+ case network.SecurityWPA2:
+ secStr = "WPA2"
+ case network.SecurityWPA3:
+ secStr = "WPA3"
+ default:
+ secStr = "Secured"
+ }
+ label += " [" + secStr + "]"
+ }
+
+ c := colors.White
+ if n.Connected {
+ c = colors.LawnGreen
+ }
+
+ item, err := NewStringItem(label, p.applicationFont, c)
+ if err != nil {
+ logger.Warning("wifi: failed to create item for %q: %v", n.SSID, err)
+ continue
+ }
+ p.networks = append(p.networks, networkUIItem{Net: n, Item: item})
+ }
+}
+
+func (p *WiFiSetupPage) rebuildStatusTexture() {
+ if p.connectionStatusItem.ID != 0 {
+ gl.DeleteTextures(1, &p.connectionStatusItem.ID)
+ p.connectionStatusItem.ID = 0
+ }
+
+ var msg string
+ var c sdl.Color
+
+ switch p.status {
+ case wifiStatusScanning:
+ msg = "Scanning for nearby networks, please wait..."
+ c = colors.White
+ case wifiStatusConnecting:
+ msg = p.statusMessage
+ c = colors.Yellow
+ case wifiStatusConnected:
+ msg = p.statusMessage
+ c = colors.LawnGreen
+ case wifiStatusError:
+ msg = p.connectError
+ if msg == "" {
+ msg = "Something went wrong. Press R to scan again."
+ }
+ c = colors.Red
+ default:
+ if len(p.networks) == 0 {
+ msg = "No networks found. Press R to scan again."
+ c = colors.Yellow
+ } else {
+ msg = "Select a network to connect — press R to rescan"
+ c = colors.White
+ }
+ }
+
+ if msg == "" {
+ return
+ }
+
+ item, err := NewStringItem(msg, p.applicationFont, c)
+ if err == nil {
+ p.connectionStatusItem = item
+ }
+}
+
+func (p *WiFiSetupPage) rebuildPasswordTexture() {
+ if p.passwordInputItem.ID != 0 {
+ gl.DeleteTextures(1, &p.passwordInputItem.ID)
+ }
+ text := p.passwordInput
+ if text == "" {
+ text = " " // prevent empty texture
+ }
+ item, err := NewStringItem(text, p.applicationFont, colors.White)
+ if err == nil {
+ p.passwordInputItem = item
+ }
+}
+
+func (p *WiFiSetupPage) rebuildPasswordPromptTexture() {
+ if p.passwordPromptItem.ID != 0 {
+ gl.DeleteTextures(1, &p.passwordPromptItem.ID)
+ }
+ if p.selectedNet == nil {
+ return
+ }
+ prompt := fmt.Sprintf("Enter password for \"%s\":", p.selectedNet.SSID)
+ item, err := NewStringItem(prompt, p.applicationFont, colors.White)
+ if err == nil {
+ p.passwordPromptItem = item
+ }
+}
+
+func (p *WiFiSetupPage) rebuildPasswordErrorTexture() {
+ if p.passwordErrorItem.ID != 0 {
+ gl.DeleteTextures(1, &p.passwordErrorItem.ID)
+ p.passwordErrorItem.ID = 0
+ }
+ if p.connectError == "" {
+ return
+ }
+ item, err := NewStringItem(p.connectError, p.applicationFont, colors.Red)
+ if err == nil {
+ p.passwordErrorItem = item
+ }
+}
+
+// ─── Render ───────────────────────────────────────────────────────────────────
+
+func (p *WiFiSetupPage) Render() error {
+ solidShader, _ := shaderManager.Get().Get("solid_color")
+ textShader, _ := shaderManager.Get().Get("text")
+
+ bgColor := sdl.Color{R: 0, G: 0, B: 0, A: 255}
+ selColor := sdl.Color{R: 68, G: 71, B: 90, A: 255}
+ white := colors.White
+ vertMargin := float32(20)
+
+ // Background
+ p.Base.RenderSolidColorQuad(solidShader,
+ mgl32.Vec2{0, 0},
+ mgl32.Vec2{float32(p.ScreenWidth), float32(p.ScreenHeight)},
+ bgColor,
+ )
+
+ // Title — 48pt
+ titleScale := float32(48) / float32(p.BaseFontSize)
+ titleW := float32(p.titleItem.W) * titleScale
+ titleH := float32(p.titleItem.H) * titleScale
+ titleX := float32(p.ScreenCenterX) - titleW/2
+ titleY := float32(p.ScreenHeight) - titleH - 40
+ p.Base.RenderTexture(textShader, p.titleItem.ID,
+ mgl32.Vec2{titleX, titleY},
+ mgl32.Vec2{titleW, titleH},
+ white,
+ )
+
+ // Status message — 30pt (was 24pt, now 1.25x)
+ statusY := titleY - titleH - vertMargin
+ if p.status == wifiStatusScanning {
+ scale := float32(30) / float32(p.BaseFontSize)
+ w := float32(p.scanningStatusItem.W) * scale
+ h := float32(p.scanningStatusItem.H) * scale
+ x := float32(p.ScreenCenterX) - w/2
+ p.Base.RenderTexture(textShader, p.scanningStatusItem.ID,
+ mgl32.Vec2{x, statusY},
+ mgl32.Vec2{w, h},
+ white,
+ )
+ } else if p.connectionStatusItem.ID != 0 {
+ scale := float32(30) / float32(p.BaseFontSize)
+ w := float32(p.connectionStatusItem.W) * scale
+ h := float32(p.connectionStatusItem.H) * scale
+ x := float32(p.ScreenCenterX) - w/2
+ p.Base.RenderTexture(textShader, p.connectionStatusItem.ID,
+ mgl32.Vec2{x, statusY},
+ mgl32.Vec2{w, h},
+ p.connectionStatusItem.Color,
+ )
+ }
+
+ // Network list
+ listY := statusY - vertMargin
+ itemH := int32(40)
+ listPad := int32(10)
+ listW := float32(700)
+ listX := float32(p.ScreenCenterX) - listW/2
+
+ for i, item := range p.networks {
+ rowY := listY - float32(int32(i+1)*itemH)
+
+ if i == p.selectedIndex {
+ p.Base.RenderSolidColorQuad(solidShader,
+ mgl32.Vec2{listX, rowY},
+ mgl32.Vec2{listW, float32(itemH)},
+ selColor,
+ )
+ }
+
+ scale := float32(24) / float32(p.BaseFontSize)
+ tw := float32(item.Item.W) * scale
+ th := float32(item.Item.H) * scale
+ tx := listX + float32(listPad)
+ ty := rowY + (float32(itemH)/2 - th/2)
+ p.Base.RenderTexture(textShader, item.Item.ID,
+ mgl32.Vec2{tx, ty},
+ mgl32.Vec2{tw, th},
+ item.Item.Color,
+ )
+ }
+
+ // Password dialog
+ if p.isEnteringPassword {
+ if err := p.renderPasswordDialog(solidShader, textShader, float32(p.BaseFontSize)); err != nil {
+ return err
+ }
+ }
+
+ return nil
+}
+
+func (p *WiFiSetupPage) renderPasswordDialog(solidShader, textShader *shaderManager.Shader, baseFontSize float32) error {
+ overlayColor := sdl.Color{R: 0, G: 0, B: 0, A: 180}
+ dialogBgColor := sdl.Color{R: 40, G: 42, B: 54, A: 255}
+ boxBorderColor := sdl.Color{R: 120, G: 120, B: 120, A: 255}
+ boxBgColor := sdl.Color{R: 30, G: 30, B: 30, A: 255}
+ white := colors.White
+
+ dialogW := int32(600)
+ dialogH := int32(250)
+ if p.connectError != "" {
+ dialogH = 310
+ }
+ dialogX := p.ScreenCenterX - dialogW/2
+ dialogY := p.ScreenCenterY - dialogH/2
+
+ // Overlay + dialog box
+ p.Base.RenderSolidColorQuad(solidShader,
+ mgl32.Vec2{0, 0},
+ mgl32.Vec2{float32(p.ScreenWidth), float32(p.ScreenHeight)},
+ overlayColor,
+ )
+ p.Base.RenderSolidColorQuad(solidShader,
+ mgl32.Vec2{float32(dialogX), float32(dialogY)},
+ mgl32.Vec2{float32(dialogW), float32(dialogH)},
+ dialogBgColor,
+ )
+
+ currentY := float32(dialogY+dialogH) - 30
+
+ // Error message
+ if p.passwordErrorItem.ID != 0 {
+ scale := float32(20) / baseFontSize
+ w := float32(p.passwordErrorItem.W) * scale
+ h := float32(p.passwordErrorItem.H) * scale
+ x := float32(p.ScreenCenterX) - w/2
+ currentY -= h
+ p.Base.RenderTexture(textShader, p.passwordErrorItem.ID,
+ mgl32.Vec2{x, currentY},
+ mgl32.Vec2{w, h},
+ colors.Red,
+ )
+ currentY -= 20
+ }
+
+ // Prompt
+ if p.passwordPromptItem.ID != 0 {
+ scale := float32(24) / baseFontSize
+ w := float32(p.passwordPromptItem.W) * scale
+ h := float32(p.passwordPromptItem.H) * scale
+ x := float32(p.ScreenCenterX) - w/2
+ currentY -= h
+ p.Base.RenderTexture(textShader, p.passwordPromptItem.ID,
+ mgl32.Vec2{x, currentY},
+ mgl32.Vec2{w, h},
+ white,
+ )
+ currentY -= 30
+ }
+
+ // Input box
+ padding := int32(4)
+ border := int32(3)
+ boxW := int32(500)
+ fontSize := int32(36)
+ boxH := fontSize + padding*2
+ bboxW := boxW + border*2
+ bboxH := boxH + border*2
+ bboxX := p.ScreenCenterX - bboxW/2
+ bboxY := int32(currentY) - boxH - padding*2
+ boxX := p.ScreenCenterX - boxW/2
+ boxY := int32(currentY) - boxH - padding
+
+ p.Base.RenderSolidColorQuad(solidShader,
+ mgl32.Vec2{float32(bboxX), float32(bboxY)},
+ mgl32.Vec2{float32(bboxW), float32(bboxH)},
+ boxBorderColor,
+ )
+ p.Base.RenderSolidColorQuad(solidShader,
+ mgl32.Vec2{float32(boxX), float32(boxY)},
+ mgl32.Vec2{float32(boxW), float32(boxH)},
+ boxBgColor,
+ )
+
+ // Password text (plain, unmasked)
+ if p.passwordInputItem.ID != 0 {
+ scale := float32(fontSize) / baseFontSize
+ w := float32(p.passwordInputItem.W) * scale
+ h := float32(p.passwordInputItem.H) * scale
+ p.Base.RenderTexture(textShader, p.passwordInputItem.ID,
+ mgl32.Vec2{float32(boxX + padding), float32(boxY + padding)},
+ mgl32.Vec2{w, h},
+ white,
+ )
+ }
+
+ return nil
+}
+
+// ─── Destroy ──────────────────────────────────────────────────────────────────
+
+func (p *WiFiSetupPage) Destroy() error {
+ keybinds.Enabled = true
+ sdl.StopTextInput()
+
+ // Cancel the scan context — stops ScanForNetworks goroutine.
+ if p.cancel != nil {
+ p.cancel()
+ }
+
+ deleteTexture := func(id *uint32) {
+ if *id != 0 {
+ gl.DeleteTextures(1, id)
+ *id = 0
+ }
+ }
+
+ deleteTexture(&p.titleItem.ID)
+ deleteTexture(&p.scanningStatusItem.ID)
+ deleteTexture(&p.connectionStatusItem.ID)
+ deleteTexture(&p.passwordPromptItem.ID)
+ deleteTexture(&p.passwordInputItem.ID)
+ deleteTexture(&p.passwordErrorItem.ID)
+
+ for _, item := range p.networks {
+ deleteTexture(&item.Item.ID)
+ }
+
+ return p.Base.Destroy()
+}
diff --git a/archive/internal/pattern/color/colorPatterns.go b/archive/internal/pattern/color/colorPatterns.go
new file mode 100644
index 0000000..196c750
--- /dev/null
+++ b/archive/internal/pattern/color/colorPatterns.go
@@ -0,0 +1,100 @@
+package pattern
+
+import (
+ "github.com/veandco/go-sdl2/sdl"
+ "rhemawavetech.com/rhemawave/internal/colors"
+)
+
+type ColorPattern struct {
+ Colors []sdl.Color
+ colorIndex int
+ repeatsLeft int
+ a, b int
+ increasing bool
+}
+
+func NewColorPattern(colors []sdl.Color) *ColorPattern {
+ if len(colors) < 2 {
+ panic("ColorPattern requires at least 2 colors")
+ }
+ return &ColorPattern{
+ Colors: colors,
+ a: 0,
+ b: 1,
+ increasing: true,
+ repeatsLeft: 1, // Start with b (1)
+ }
+}
+
+// ATTENTION: TED
+//
+// # Fibonacci-Oscillating Temporal Color Distribution for Sequential Text Elements
+//
+// This method distributes intent-based colors across sequential text elements (words) using an
+// oscillating Fibonacci sequence to control temporal color duration, creating rhythmic color
+// patterns that maintain visual balance while varying exposure times.
+//
+// The technology addresses the challenge of applying multiple psychologically-selected colors
+// to scrolling text in a way that maintains even distribution over time while creating natural
+// rhythm. Conventional approaches either apply colors randomly (creating unbalanced temporal
+// distribution) or use fixed intervals (producing mechanical, unnatural patterns that lack
+// harmonic variation). Our method ensures each color in the palette appears throughout the
+// entire display duration while varying its temporal presence according to natural mathematical
+// progression.
+//
+// The approach uses a bidirectional Fibonacci sequence to determine how many consecutive words
+// receive each color. The sequence increases (1, 1, 2, 3, 5, 8, 13, 21, 34, 55 words) then
+// decreases back down (55, 34, 21, 13, 8, 5, 3, 2, 1, 1 words), creating an oscillating pattern.
+// Colors from the intent-based palette are applied in sequence, with each color's duration
+// determined by the current Fibonacci value. This creates a "breathing" rhythm where colors
+// appear briefly, expand to longer durations, then contract back to brief appearances before
+// cycling to the next color.
+//
+// Key differentiators from existing solutions:
+// - Uses bidirectional Fibonacci sequence (ascending then descending) rather than fixed intervals
+// - Creates natural rhythmic variation in color exposure duration
+// - Ensures all palette colors appear throughout entire display timeline, not in isolated sections
+// - Combines intent-based color selection with mathematical temporal distribution
+// - Produces harmonic color rhythm synchronized with natural numerical progression
+//
+// Within our Rhema Wave generation system, this color distribution works in conjunction with
+// the spatially-scrambled character patterns. While the scrambling creates spatial frequency
+// signatures, the Fibonacci-oscillating color pattern creates temporal frequency modulation.
+// The colors themselves are selected according to color theory principles based on the proclamation's
+// psychological intent, and the oscillating Fibonacci distribution ensures these therapeutic colors
+// maintain presence throughout the viewing session while creating harmonic temporal rhythm that
+// reinforces the overall Rhema Wave effect.
+func (c *ColorPattern) Color() sdl.Color {
+ // 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765, 10946, 17711, 28657, 46368, 75025, 121393, 196418
+ // This is a failsafe in case this pattern is used but colors are not supplied. Without this check, no text will display due to not having a color
+ // and becoming translucent.
+ if len(c.Colors) == 0 {
+ return colors.White // fallback to white
+ }
+
+ color := c.Colors[c.colorIndex%len(c.Colors)]
+ c.repeatsLeft--
+
+ if c.repeatsLeft <= 0 {
+ // Move to next color in the palette
+ c.colorIndex = (c.colorIndex + 1) % len(c.Colors)
+
+ // Update Fibonacci sequence for repeat count
+ if c.increasing {
+ c.a, c.b = c.b, c.a+c.b
+ if c.b > 55 { // Update this threahold to adjust the number of repeats
+ c.increasing = false
+ }
+ } else {
+ c.a, c.b = c.b-c.a, c.a
+ if c.a <= 0 {
+ c.a, c.b = 0, 1
+ c.increasing = true
+ }
+ }
+
+ c.repeatsLeft = c.b
+ }
+
+ return color
+}
diff --git a/archive/internal/pattern/line/fibonacci.go b/archive/internal/pattern/line/fibonacci.go
new file mode 100644
index 0000000..f63af7a
--- /dev/null
+++ b/archive/internal/pattern/line/fibonacci.go
@@ -0,0 +1,127 @@
+package pattern
+
+type FibonacciPattern struct {
+ masterSequence []int
+ sequence []int
+ increasing bool
+}
+
+func init() {
+ Register("fibonacci", func() LinePattern {
+ return &FibonacciPattern{
+ masterSequence: []int{1, 2, 3, 5, 8, 13, 21},
+ sequence: []int{1},
+ increasing: true,
+ }
+ })
+}
+
+func (f *FibonacciPattern) Name() string { return "Fibonacci" }
+
+// ATTENTION: TED
+//
+// # Fibonacci-Oscillating Spatial Distribution for Sequential Text Display
+//
+// This method arranges sequential text elements (words from proclamations) into display lines
+// where the word count per line follows an oscillating Fibonacci sequence, creating both a
+// visual wave pattern in two-dimensional space and ensuring even temporal distribution of
+// content segments.
+//
+// The technology addresses the challenge of displaying repeated proclamation content in a way
+// that maintains balanced exposure of all content portions while creating visually dynamic
+// spatial patterns. Conventional scrolling text approaches either use fixed line lengths
+// (creating uniform, non-dynamic displays) or random word counts (producing unbalanced content
+// distribution where some portions appear more frequently than others). Our method ensures
+// proclamation content is consumed in progressively sized segments that balance over time while
+// creating a natural wave-like visual rhythm.
+//
+// The approach uses a bidirectional Fibonacci sequence to determine words per line. Starting
+// with minimal word count (1, 1 words), the sequence expands (2, 3, 5, 8, 13, 21... words per
+// line) until reaching a threshold, then contracts back down (21, 13, 8, 5, 3, 2, 1, 1 words),
+// creating an oscillating wave. As lines scroll vertically, this varying horizontal word count
+// creates a lateral wave pattern in the two-dimensional display space. Words are drawn sequentially
+// from the proclamation text, and the varying segment sizes (1 word, then 2, then 3, then 5, etc.)
+// ensure that over multiple oscillation cycles, the entire proclamation content receives balanced
+// temporal exposure.
+//
+// Key differentiators from existing solutions:
+// - Uses oscillating Fibonacci sequence for line word counts rather than fixed or random lengths
+// - Creates two-dimensional wave pattern from one-dimensional text sequence
+// - Ensures mathematical content distribution balance over time through progressive segmentation
+// - Produces natural expansion-contraction rhythm synchronized with Fibonacci progression
+// - Combines spatial wave formation with temporal content distribution in single mechanism
+//
+// Within our Rhema Wave generation system, this spatial distribution pattern works in concert
+// with the character-level scrambling and color distribution methods. While character scrambling
+// creates local spatial frequency patterns and color oscillation creates temporal color rhythm,
+// the Fibonacci line length pattern generates a macro-level spatial wave that modulates the
+// overall display geometry. The mathematical relationship between line lengths creates harmonic
+// spatial progression, and the oscillating nature ensures proclamation content cycles through
+// varying exposure durations, contributing to the layered frequency composition of the complete
+// Rhema Wave output.
+func (f *FibonacciPattern) GetNextLine(words []string, wordIndex *int, ctx *LineRenderContext) []string {
+ if ctx == nil || len(words) == 0 {
+ return nil
+ }
+
+ numWords := f.sequence[len(f.sequence)-1]
+ targetWidth := int32(ctx.ScreenWidth)
+
+ var line []string
+ var currentWidth int32
+ wordsAdded := 0
+
+ for wordsAdded < numWords && len(words) > 0 {
+ if int(*wordIndex) > len(words) {
+ *wordIndex = 0
+ }
+ word := words[*wordIndex%len(words)]
+ *wordIndex++
+
+ if word == "" {
+ continue
+ }
+
+ wordWidth := estimateWordWidth(word, ctx.Font, ctx.FontScale)
+ if len(line) > 0 {
+ wordWidth += ctx.SpaceWidth
+ }
+
+ if len(line) == 0 || currentWidth+wordWidth <= int32(float32(targetWidth)*float32(.9)) {
+ line = append(line, word)
+ currentWidth += wordWidth
+ wordsAdded++
+ } else {
+ break
+ }
+ }
+
+ // TODO: What should we do here instead?
+ // A line being longer than the display still needs to be handled, though, it should never happen
+ // if currentWidth >= ctx.ScreenWidth {
+ // syscall.Kill(syscall.Getpid(), syscall.SIGTRAP)
+ // }
+
+ // Update the sequence based on direction
+ if f.increasing {
+ if len(f.sequence) < len(f.masterSequence) {
+ // Grow sequence by appending next Fibonacci number
+ f.sequence = append(f.sequence, f.masterSequence[len(f.sequence)])
+ } else {
+ // Reached the top, now start shrinking
+ f.increasing = false
+ f.sequence = f.sequence[:len(f.sequence)-1]
+ }
+ } else {
+ if len(f.sequence) > 1 {
+ // Shrink the sequence
+ f.sequence = f.sequence[:len(f.sequence)-1]
+ } else {
+ // Hit bottom, start growing again
+ f.increasing = true
+ f.sequence = append(f.sequence, f.masterSequence[1]) // index 1 = second element = 2
+ }
+ }
+
+ return line
+}
diff --git a/archive/internal/pattern/line/linePatterns.go b/archive/internal/pattern/line/linePatterns.go
new file mode 100644
index 0000000..4a04bc8
--- /dev/null
+++ b/archive/internal/pattern/line/linePatterns.go
@@ -0,0 +1,71 @@
+package pattern
+
+import (
+ "fmt"
+
+ "rhemawavetech.com/rhemawave/internal/fontManager"
+)
+
+type LinePattern interface {
+ GetNextLine(words []string, wordIndex *int, ctx *LineRenderContext) []string // Generates the next line in the pattern
+ Name() string // Used to display the name of a LinePattern
+}
+
+// PatternInfo holds the public information about a registered pattern.
+type PatternInfo struct {
+ Key string // The machine-readable key (e.g., "sine")
+ DisplayName string // The human-readable name for the UI (e.g., "Sine Wave")
+}
+
+type LineRenderContext struct {
+ ScreenWidth int32
+ Font *fontManager.FontEntry
+ FontScale float32
+ SpaceWidth int32
+}
+
+var Registry = make(map[string]func() LinePattern)
+
+func Register(name string, constructor func() LinePattern) {
+ Registry[name] = constructor
+}
+
+func Get(name string) (LinePattern, error) {
+ constructor, ok := Registry[name]
+ if !ok {
+ return nil, fmt.Errorf("failed to find line pattern %s in Registry", name)
+ }
+ return constructor(), nil
+}
+
+// ListAvailable returns a slice of info for all registered patterns.
+// This is used to build a settings menu.
+func ListAvailable() []PatternInfo {
+ var list []PatternInfo
+ for key, constructor := range Registry {
+ pattern := constructor() // Create a temporary instance to get its name
+ list = append(list, PatternInfo{
+ Key: key,
+ DisplayName: pattern.Name(),
+ })
+ }
+ return list
+}
+
+// estimateWordWidth provides a basic estimate of the width of a word based on the font and scale.
+func estimateWordWidth(word string, font *fontManager.FontEntry, scale float32) int32 {
+ if font == nil {
+ // Basic fallback estimate
+ return int32(float32(len(word)) * 10 * scale)
+ }
+
+ total := int32(0)
+ for _, ch := range word {
+ glyph, ok := fontManager.Get().GetGlyph(font.Name, ch)
+ if !ok {
+ continue
+ }
+ total += int32(float32(glyph.Advance) * scale)
+ }
+ return total
+}
diff --git a/archive/internal/pattern/line/sineWavePattern.go b/archive/internal/pattern/line/sineWavePattern.go
new file mode 100644
index 0000000..fd73e3d
--- /dev/null
+++ b/archive/internal/pattern/line/sineWavePattern.go
@@ -0,0 +1,80 @@
+package pattern
+
+import (
+ "math"
+
+ "rhemawavetech.com/rhemawave/internal/fontManager"
+)
+
+type SineWavePattern struct {
+ waveStepCounter int
+}
+
+func init() {
+ Register("sine", func() LinePattern { return &SineWavePattern{} })
+}
+
+func (s *SineWavePattern) Name() string { return "Sine Wave" }
+func (s *SineWavePattern) GetNextLine(words []string, wordIndex *int, ctx *LineRenderContext) []string {
+ const (
+ totalLines = 67
+ frequency = 5.0 // cycles across all lines
+ amplitude = 0.85 // how much wave can scale
+ baseRatio = 0.03 // minimum line width as % of screen
+ sharpness = 3.0 // sharpness of the curve
+ )
+
+ screenWidth := int32(800)
+ spaceWidth := int32(10)
+ font := (*fontManager.FontEntry)(nil)
+ fontScale := float32(1.0)
+
+ if ctx != nil {
+ screenWidth = ctx.ScreenWidth
+ spaceWidth = ctx.SpaceWidth
+ font = ctx.Font
+ fontScale = ctx.FontScale
+ }
+
+ // Sharpen the wave (skinnier troughs)
+ // raw := (math.Sin(2*math.Pi*frequency*float64(s.waveStepCounter)/totalLines) + 1.0) / 2.0
+ // waveVal := math.Pow(raw, sharpness)
+ angle := 2 * math.Pi * frequency * float64(s.waveStepCounter) / totalLines
+ waveVal := (math.Sin(angle) + 1.0) / 2.0
+
+ // Target width in pixels
+ targetWidth := int32(float64(screenWidth) * (baseRatio + amplitude*waveVal))
+
+ var line []string
+ var currentWidth int32
+
+ for len(words) > 0 {
+ word := words[*wordIndex%len(words)]
+ *wordIndex++
+
+ if word == "" {
+ continue
+ }
+
+ wordWidth := estimateWordWidth(word, font, fontScale)
+ if len(line) > 0 {
+ wordWidth += spaceWidth
+ }
+
+ if len(line) == 0 {
+ // Always include the first word
+ line = append(line, word)
+ currentWidth += wordWidth
+ } else {
+ // Only add next word if it fits
+ if currentWidth+wordWidth > targetWidth {
+ break
+ }
+ line = append(line, word)
+ currentWidth += wordWidth
+ }
+ }
+
+ s.waveStepCounter++
+ return line
+}
diff --git a/archive/internal/shaderManager/shaderManager.go b/archive/internal/shaderManager/shaderManager.go
new file mode 100644
index 0000000..f4b6396
--- /dev/null
+++ b/archive/internal/shaderManager/shaderManager.go
@@ -0,0 +1,199 @@
+package shaderManager
+
+import (
+ "fmt"
+ "os"
+ "path/filepath"
+ "strings"
+ "sync"
+
+ "github.com/go-gl/gl/v3.3-core/gl"
+)
+
+// Shader represents a compiled GLSL program and its associated data.
+type Shader struct {
+ Name string
+ ProgramID uint32
+ Render func() // This will be used in the future.
+
+ // Cached uniform locations (looked up once after linking)
+ LocMVPMatrix int32
+ LocTexture int32
+ LocTextColor int32
+ LocColor int32
+}
+
+// ShaderManager handles the loading, compiling, and management of GLSL shader programs.
+type ShaderManager struct {
+ shaders map[string]*Shader
+}
+
+var (
+ instance *ShaderManager
+ once sync.Once
+)
+
+// InitShaderManager initializes the ShaderManager singleton.
+func InitShaderManager(shaderDir string) error {
+ var err error
+ once.Do(func() {
+ sm := &ShaderManager{
+ shaders: make(map[string]*Shader),
+ }
+ if e := sm.LoadShaders(shaderDir); e != nil {
+ err = fmt.Errorf("could not load shaders from %s: %w", shaderDir, e)
+ return
+ }
+ instance = sm
+ })
+ return err
+}
+
+// Get returns the singleton ShaderManager instance.
+func Get() *ShaderManager {
+ if instance == nil {
+ panic("ShaderManager has not been initialized. Call InitShaderManager at application startup.")
+ }
+ return instance
+}
+
+// Get retrieves a compiled Shader object by its name.
+func (sm *ShaderManager) Get(name string) (*Shader, bool) {
+ shader, ok := sm.shaders[name]
+ return shader, ok
+}
+
+// ListShaders returns all shaders.
+func (sm *ShaderManager) ListShaders() map[string]*Shader {
+ return sm.shaders
+}
+
+// Close deletes all loaded shader programs from the GPU to free up resources.
+func (sm *ShaderManager) Close() {
+ for name, shader := range sm.shaders {
+ gl.DeleteProgram(shader.ProgramID)
+ delete(sm.shaders, name)
+ }
+}
+
+// LoadShaders scans a directory for .vert and .frag files and creates a shader program for each pair.
+func (sm *ShaderManager) LoadShaders(shaderDir string) error {
+ // Get assets directory from database
+ shaderFiles := make(map[string]string)
+
+ err := filepath.Walk(shaderDir, func(path string, info os.FileInfo, err error) error {
+ if err != nil {
+ return err
+ }
+ if !info.IsDir() && strings.HasSuffix(info.Name(), ".vert") {
+ name := strings.TrimSuffix(info.Name(), ".vert")
+ shaderFiles[name] = path
+ }
+ return nil
+ })
+ if err != nil {
+ return fmt.Errorf("error walking shader directory: %w", err)
+ }
+
+ for name, vertPath := range shaderFiles {
+ fragPath := strings.Replace(vertPath, ".vert", ".frag", 1)
+ if _, err := os.Stat(fragPath); os.IsNotExist(err) {
+ continue
+ }
+
+ programID, err := createShaderProgram(vertPath, fragPath)
+ if err != nil {
+ continue
+ }
+
+ newShader := &Shader{
+ Name: name,
+ ProgramID: programID,
+ Render: nil, // Render function is not yet assigned.
+ }
+ newShader.cacheUniformLocations()
+ sm.shaders[name] = newShader
+ }
+
+ return nil
+}
+
+// cacheUniformLocations looks up common uniform locations once and stores them on the Shader.
+func (s *Shader) cacheUniformLocations() {
+ s.LocMVPMatrix = gl.GetUniformLocation(s.ProgramID, gl.Str("u_mvpMatrix\x00"))
+ s.LocTexture = gl.GetUniformLocation(s.ProgramID, gl.Str("u_texture\x00"))
+ s.LocTextColor = gl.GetUniformLocation(s.ProgramID, gl.Str("u_textColor\x00"))
+ s.LocColor = gl.GetUniformLocation(s.ProgramID, gl.Str("u_color\x00"))
+}
+
+// createShaderProgram reads, compiles, and links a vertex and fragment shader from file paths.
+func createShaderProgram(vertexPath, fragmentPath string) (uint32, error) {
+ vertexSource, err := os.ReadFile(vertexPath)
+ if err != nil {
+ return 0, fmt.Errorf("reading vertex shader %s: %w", vertexPath, err)
+ }
+ fragmentSource, err := os.ReadFile(fragmentPath)
+ if err != nil {
+ return 0, fmt.Errorf("reading fragment shader %s: %w", fragmentPath, err)
+ }
+
+ vertexShader, err := compileShader(string(vertexSource)+"\x00", gl.VERTEX_SHADER)
+ if err != nil {
+ return 0, err
+ }
+ defer gl.DeleteShader(vertexShader)
+
+ fragmentShader, err := compileShader(string(fragmentSource)+"\x00", gl.FRAGMENT_SHADER)
+ if err != nil {
+ return 0, err
+ }
+ defer gl.DeleteShader(fragmentShader)
+
+ program := gl.CreateProgram()
+ gl.AttachShader(program, vertexShader)
+ gl.AttachShader(program, fragmentShader)
+ gl.LinkProgram(program)
+
+ var status int32
+ gl.GetProgramiv(program, gl.LINK_STATUS, &status)
+ if status == gl.FALSE {
+ var logLength int32
+ gl.GetProgramiv(program, gl.INFO_LOG_LENGTH, &logLength)
+ log := strings.Repeat("\x00", int(logLength+1))
+ gl.GetProgramInfoLog(program, logLength, nil, gl.Str(log))
+ return 0, fmt.Errorf("failed to link program: %v", log)
+ }
+
+ return program, nil
+}
+
+// compileShader is a helper function that compiles a single shader source string.
+func compileShader(source string, shaderType uint32) (uint32, error) {
+ shader := gl.CreateShader(shaderType)
+ csources, free := gl.Strs(source)
+ gl.ShaderSource(shader, 1, csources, nil)
+ free()
+ gl.CompileShader(shader)
+
+ var status int32
+ gl.GetShaderiv(shader, gl.COMPILE_STATUS, &status)
+ if status == gl.FALSE {
+ var logLength int32
+ gl.GetShaderiv(shader, gl.INFO_LOG_LENGTH, &logLength)
+ log := strings.Repeat("\x00", int(logLength+1))
+ gl.GetShaderInfoLog(shader, logLength, nil, gl.Str(log))
+
+ var shaderTypeName string
+ switch shaderType {
+ case gl.VERTEX_SHADER:
+ shaderTypeName = "Vertex"
+ case gl.FRAGMENT_SHADER:
+ shaderTypeName = "Fragment"
+ default:
+ shaderTypeName = "Unknown"
+ }
+ return 0, fmt.Errorf("failed to compile %s shader: %v", shaderTypeName, log)
+ }
+
+ return shader, nil
+}
diff --git a/archive/internal/sync/sync.go b/archive/internal/sync/sync.go
new file mode 100644
index 0000000..3aa2d4c
--- /dev/null
+++ b/archive/internal/sync/sync.go
@@ -0,0 +1,144 @@
+package sync
+
+import (
+ "regexp"
+
+ "gorm.io/gorm"
+ "gorm.io/gorm/clause"
+ "rhemawavetech.com/rhemawave/internal/db"
+ "rhemawavetech.com/rhemawave/internal/logger"
+ "rhemawavetech.com/rhemawave/internal/netreq"
+)
+
+var htmlRegex = regexp.MustCompile(`<[^>]*>`)
+
+// SyncProclamations fetches data from the API, cleans it, and updates the local DB.
+// It returns the slice of proclamations so the UI can update immediately.
+func SyncProclamations(database *gorm.DB) ([]db.Proclamation, error) {
+ fullURL := "https://portal.radiantwavetech.com/api/v1/proclamations"
+ logger.Debug("Syncronizing proclamations. URL: %s", fullURL)
+
+ proclamations, err := netreq.GetJSON[db.Proclamation](fullURL)
+ if err != nil {
+ // If we're offline or API is down, we log it but don't crash.
+ // The UI can still use whatever is currently in the DB.
+ logger.Error("Proclamation sync failed, skipping update: %v", err)
+ return nil, err
+ }
+ logger.Debug("Request Granted")
+
+ for i := range proclamations {
+ proclamations[i].Content = htmlRegex.ReplaceAllString(proclamations[i].Content, "")
+ }
+
+ var storedProclamationSettings []db.Proclamation
+ database.Select("ID", "Selected").Find(&storedProclamationSettings)
+
+ // [ID]Selected
+ stash := make(map[string]bool)
+ for _, row := range storedProclamationSettings {
+ stash[row.ID] = row.Selected
+ }
+
+ for i := range proclamations {
+ proclamations[i].Selected = stash[proclamations[i].ID]
+ }
+
+ err = database.Transaction(func(tx *gorm.DB) error {
+ ids := make([]string, len(proclamations))
+ for i, p := range proclamations {
+ ids[i] = p.ID
+ }
+
+ if len(ids) == 0 {
+ // API returned nothing → DB should be empty
+ if err := tx.Where("1 = 1").Delete(&db.Proclamation{}).Error; err != nil {
+ return err
+ }
+ } else {
+ // Remove anything not in API
+ if err := tx.Where("id NOT IN ?", ids).Delete(&db.Proclamation{}).Error; err != nil {
+ return err
+ }
+ }
+
+ // Upsert (preserve Selected automatically)
+ if err := tx.Clauses(clause.OnConflict{
+ Columns: []clause.Column{{Name: "id"}},
+ DoUpdates: clause.AssignmentColumns([]string{
+ "name",
+ "content",
+ "solfeggio_frequency_id",
+ "category_id",
+ "available",
+ "price",
+ }),
+ }).Create(&proclamations).Error; err != nil {
+ return err
+ }
+
+ // Return nil as err for this statement, does not exit the function
+ return nil
+ })
+
+ logger.Debug("Proclamations stored to database")
+
+ if err != nil {
+ logger.Error("Failed to save synced proclamations: %v", err)
+ return nil, err
+ }
+
+ logger.Info("Successfully synced proclamations: %d", len(proclamations))
+ return proclamations, nil
+}
+
+func SyncCategories(database *gorm.DB) ([]db.ProclamationCategory, error) {
+ fullURL := "https://portal.radiantwavetech.com/api/v1/categories"
+ categories, err := netreq.GetJSON[db.ProclamationCategory](fullURL)
+ if err != nil {
+ logger.Error("Category sync failed, skipping update: %v", err)
+ return nil, err
+ }
+
+ err = database.Transaction(func(tx *gorm.DB) error {
+ if err := tx.Where("1 = 1").Delete(&db.ProclamationCategory{}).Error; err != nil {
+ return err
+ }
+ if err := tx.Save(&categories).Error; err != nil {
+ return err
+ }
+ return nil
+ })
+
+ if err != nil {
+ logger.Error("failed to sync proclamation categories: %v", err)
+ return nil, err
+ }
+
+ logger.Info("Successfully synced proclamation categories: %d", len(categories))
+ return categories, nil
+}
+
+func SyncFrequencies(database *gorm.DB) ([]db.SolfeggioFrequency, error) {
+ fullURL := "https://portal.radiantwavetech.com/api/v1/frequencies"
+ frequencies, err := netreq.GetJSON[db.SolfeggioFrequency](fullURL)
+ if err != nil {
+ logger.Error("Frequency sync failed, skipping update: %v", err)
+ return nil, err
+ }
+ err = database.Transaction(func(tx *gorm.DB) error {
+ if err := tx.Where("1 = 1").Delete(&db.SolfeggioFrequency{}).Error; err != nil {
+ return err
+ }
+ if err := tx.Save(&frequencies).Error; err != nil {
+ return err
+ }
+ return nil
+ })
+ if err != nil {
+ logger.Error("failed to sync solfeggio frequencies: %v", err)
+ return nil, err
+ }
+ logger.Info("Succesfully synced solfeggio frequencies: %d", len(frequencies))
+ return frequencies, nil
+}
diff --git a/archive/nixos/module.nix b/archive/nixos/module.nix
new file mode 100644
index 0000000..1ace79a
--- /dev/null
+++ b/archive/nixos/module.nix
@@ -0,0 +1,31 @@
+self:
+
+{ config, lib, pkgs, ... }:
+
+let
+ cfg = config.services.rhemawave;
+in
+{
+ options.services.rhemawave = {
+ enable = lib.mkEnableOption "RhemaWave kiosk application";
+
+ package = lib.mkOption {
+ type = lib.types.package;
+ # Points to the default package in your flake
+ default = self.packages.${pkgs.system}.default;
+ description = "The RhemaWave package to use.";
+ };
+
+ user = lib.mkOption {
+ type = lib.types.str;
+ default = "kiosk";
+ description = "The user account name.";
+ };
+ };
+
+ config = lib.mkIf cfg.enable {
+ # Just put the package in the system path.
+ # The machine (configuration.nix) handles the service and the files.
+ environment.systemPackages = [ cfg.package ];
+ };
+}
\ No newline at end of file
diff --git a/archive/nixos/vm.nix b/archive/nixos/vm.nix
new file mode 100644
index 0000000..968760e
--- /dev/null
+++ b/archive/nixos/vm.nix
@@ -0,0 +1,144 @@
+# NixOS test VM for RadiantWave — mirrors production kiosk setup.
+#
+# Build & run:
+# nixos-rebuild build-vm --flake .#test-vm
+# ./result/bin/run-test-vm-vm
+#
+# This replicates the production kiosk config from KioskConfig:
+# - cage as Wayland compositor (fullscreen kiosk)
+# - PipeWire audio (with a virtual sink for device-switch testing)
+# - NetworkManager
+# - Auto-login as kiosk user
+# - RadiantWave started via loginShellInit (same as production)
+
+{ config, lib, pkgs, ... }:
+
+let
+ rhemaApp = config.services.rhemawave.package;
+in
+{
+ # ── Hostname ──────────────────────────────────────────────────────────────
+ networking.hostName = "radiantwave-test";
+
+ # ── RadiantWave module ────────────────────────────────────────────────────
+ services.rhemawave.enable = true;
+
+ # ── Boot ──────────────────────────────────────────────────────────────────
+ boot.loader.systemd-boot.enable = lib.mkForce false;
+ boot.loader.efi.canTouchEfiVariables = lib.mkForce false;
+
+ # ── Packages (matches production) ─────────────────────────────────────────
+ environment.systemPackages = [
+ pkgs.cage pkgs.rsync pkgs.dbus pkgs.mesa pkgs.git pkgs.tailscale pkgs.sqlite
+ ];
+
+ # ── Audio (PipeWire + virtual sink for device-switch testing) ─────────────
+ services.pipewire = {
+ enable = true;
+ alsa.enable = true;
+ pulse.enable = true;
+ extraConfig.pipewire."30-virtual-sink" = {
+ "context.modules" = [
+ {
+ name = "libpipewire-module-loopback";
+ args = {
+ "node.name" = "virtual-speaker";
+ "node.description" = "Virtual Speaker";
+ "audio.position" = [ "FL" "FR" ];
+ };
+ }
+ ];
+ };
+ };
+
+ # ── Seat (matches production) ─────────────────────────────────────────────
+ services.seatd.enable = true;
+ hardware.graphics.enable = true;
+
+ # ── Networking ────────────────────────────────────────────────────────────
+ services.resolved.enable = false;
+ networking.networkmanager.enable = true;
+ systemd.services.NetworkManager-wait-online.enable = false;
+ systemd.network.wait-online.enable = false;
+
+ # ── SSH ───────────────────────────────────────────────────────────────────
+ services.openssh = {
+ enable = true;
+ settings = {
+ PermitRootLogin = "prohibit-password";
+ PasswordAuthentication = true;
+ };
+ };
+
+ # ── User (matches production) ─────────────────────────────────────────────
+ users.users.kiosk = {
+ isNormalUser = true;
+ uid = 1000;
+ extraGroups = [ "audio" "video" "input" "networkmanager" "wheel" ];
+ password = "kiosk";
+ };
+ services.getty.autologinUser = "kiosk";
+
+ # ── Data directory ────────────────────────────────────────────────────────
+ systemd.tmpfiles.rules = [
+ "d /home/kiosk/.local/share/rhemawave 0770 kiosk kiosk -"
+ "d /home/kiosk/.radiantwave/audio 0755 kiosk kiosk -"
+ ];
+
+ # ── RadiantWave service (via loginShellInit, same as production) ──────────
+ environment.loginShellInit = ''
+ if [ "$(tty)" = "/dev/tty1" ]; then
+ export GODEBUG=netdns=cgo
+ export SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt
+
+ # Smart Network Wait
+ for i in {1..10}; do
+ if ${pkgs.iputils}/bin/ping -c 1 8.8.8.8 &> /dev/null; then
+ break
+ fi
+ sleep 1
+ done
+
+ # Graphics fixes (matches production)
+ export SDL_VIDEODRIVER=wayland
+ export QT_QPA_PLATFORM=wayland
+ export XDG_SESSION_TYPE=wayland
+ export WLR_RENDERER=pixman
+ export WLR_NO_HARDWARE_CURSORS=1
+
+ # Asset sync + start app (same as production)
+ mkdir -p /home/kiosk/.local/share/rhemawave
+ ${pkgs.rsync}/bin/rsync -ru ${rhemaApp}/share/rhemawave/ /home/kiosk/.local/share/rhemawave/
+ mkdir -p /home/kiosk/.radiantwave/audio
+ ${pkgs.rsync}/bin/rsync -ru ${rhemaApp}/share/rhemawave/audio/ /home/kiosk/.radiantwave/audio/
+
+ cage -- ${rhemaApp}/bin/rhemawave -d -s > /tmp/kiosk.log 2>&1
+ fi
+ '';
+
+ # ── VM settings ───────────────────────────────────────────────────────────
+ virtualisation = {
+ memorySize = 4096;
+ cores = 4;
+ graphics = true;
+ forwardPorts = [
+ { from = "host"; host.port = 2222; guest.port = 22; }
+ ];
+ qemu.options = [
+ "-device intel-hda"
+ "-device hda-duplex"
+ "-vga virtio"
+ ];
+ };
+
+ services.logrotate.enable = false;
+
+ # ── Nix settings ──────────────────────────────────────────────────────────
+ nix.settings.experimental-features = [ "nix-command" "flakes" ];
+ nix.settings.accept-flake-config = true;
+
+ # ── Firewall (open for local dev) ─────────────────────────────────────────
+ networking.firewall.enable = false;
+
+ system.stateVersion = "24.11";
+}
diff --git a/archive/notes.org b/archive/notes.org
new file mode 100644
index 0000000..7df70a0
--- /dev/null
+++ b/archive/notes.org
@@ -0,0 +1,3 @@
+* Networking Issues
+- The networking package needs a LOT more logging... Nothing gets output when things crash.
+-
\ No newline at end of file
diff --git a/archive/packaging/kiosk/99-rhemawave-updater.rules b/archive/packaging/kiosk/99-rhemawave-updater.rules
new file mode 100644
index 0000000..9cdbc4f
--- /dev/null
+++ b/archive/packaging/kiosk/99-rhemawave-updater.rules
@@ -0,0 +1,55 @@
+// Allow kiosk user to run apt update, apt install for rhemawave packages,
+// and restart getty for application reloading
+polkit.addRule(function(action, subject) {
+ if (action.id == "org.freedesktop.policykit.exec" &&
+ subject.user == "kiosk") {
+
+ var program = action.lookup("program");
+ var cmdline = action.lookup("command_line");
+
+ // Allow dpkg --configure -a
+ if (program == "/usr/bin/dpkg") {
+ if (cmdline && cmdline.indexOf("--configure") >= 0) {
+ return polkit.Result.YES;
+ }
+ }
+
+ // Allow apt update
+ if (program == "/usr/bin/apt") {
+ if (cmdline && cmdline.indexOf("update") >= 0) {
+ return polkit.Result.YES;
+ }
+
+ // Allow: apt install --only-upgrade rhemawave[-dev]
+ if (cmdline &&
+ cmdline.indexOf("install") >= 0 &&
+ cmdline.indexOf("--only-upgrade") >= 0 &&
+ cmdline.indexOf("rhemawave") >= 0) {
+ return polkit.Result.YES;
+ }
+ }
+
+ // Allow systemctl restart getty@tty1.service
+ if (program == "/usr/bin/systemctl") {
+ if (cmdline &&
+ cmdline.indexOf("restart") >= 0 &&
+ cmdline.indexOf("getty@tty1.service") >= 0) {
+ return polkit.Result.YES;
+ }
+ }
+
+ // Allow sh for Tailscale install script
+ if (program == "/usr/bin/sh" || program == "/bin/sh") {
+ if (cmdline && cmdline.indexOf("tailscale.com/install.sh") >= 0) {
+ return polkit.Result.YES;
+ }
+ }
+
+ // Allow tailscale set --operator
+ if (program == "/usr/bin/tailscale") {
+ if (cmdline && cmdline.indexOf("set") >= 0 && cmdline.indexOf("--operator") >= 0) {
+ return polkit.Result.YES;
+ }
+ }
+ }
+});
\ No newline at end of file
diff --git a/archive/packaging/kiosk/override.conf b/archive/packaging/kiosk/override.conf
new file mode 100644
index 0000000..5470b4e
--- /dev/null
+++ b/archive/packaging/kiosk/override.conf
@@ -0,0 +1,3 @@
+[Service]
+ExecStart=
+ExecStart=-/sbin/agetty --autologin kiosk --noclear %I $TERM
\ No newline at end of file
diff --git a/archive/packaging/kiosk/post-install.sh b/archive/packaging/kiosk/post-install.sh
new file mode 100755
index 0000000..b1cb9aa
--- /dev/null
+++ b/archive/packaging/kiosk/post-install.sh
@@ -0,0 +1,24 @@
+#!/bin/bash
+# Post-installation script for RhemaWave
+set -e
+
+# Create kiosk group if it doesn't exist
+if ! getent group kiosk > /dev/null 2>&1; then
+ echo "Creating kiosk group..."
+ groupadd --system kiosk
+fi
+
+# Create kiosk user if it doesn't exist
+if ! getent passwd kiosk > /dev/null 2>&1; then
+ echo "Creating kiosk user..."
+ useradd --system --gid kiosk --create-home --home-dir /home/kiosk \
+ --shell /bin/bash --comment "RhemaWave Kiosk User" kiosk
+fi
+
+# Set proper group ownership for writable directories
+chgrp -R kiosk /usr/local/share/rhemawave
+
+# Ensure kiosk user can write to the data directory
+chmod g+w /usr/local/share/rhemawave
+
+echo "✓ RhemaWave post-install complete"
\ No newline at end of file
diff --git a/archive/packaging/kiosk/rhemawave-kiosk.sh b/archive/packaging/kiosk/rhemawave-kiosk.sh
new file mode 100755
index 0000000..911f67d
--- /dev/null
+++ b/archive/packaging/kiosk/rhemawave-kiosk.sh
@@ -0,0 +1,16 @@
+# RhemaWave kiosk auto-launch on tty1
+if [ -z "$WAYLAND_DISPLAY" ] && [ "$(tty)" = "/dev/tty1" ]; then
+ export XDG_RUNTIME_DIR=/run/user/$(id -u)
+ export SDL_VIDEODRIVER=wayland
+
+ # Check for updates before launching
+ /usr/bin/python3 /usr/local/bin/rhemawave-updater.py || true
+
+ # Set all sinks to full volume
+ for sink in $(wpctl status | grep -oP '^\s+\K\d+(?=\.)' | head -10); do
+ wpctl set-volume "$sink" 1.0 2>/dev/null
+ done
+
+ exec cage -- /usr/local/bin/rhemawave
+fi
+
diff --git a/archive/packaging/rhemawave-updater.py b/archive/packaging/rhemawave-updater.py
new file mode 100755
index 0000000..42ed895
--- /dev/null
+++ b/archive/packaging/rhemawave-updater.py
@@ -0,0 +1,564 @@
+#!/usr/bin/env python3
+"""
+rhemawave-updater.py
+
+Auto-updater for RhemaWave kiosk application.
+Uses apt to check for and install updates from the configured repository.
+
+USAGE:
+ Run as kiosk user:
+ python3 /usr/local/bin/rhemawave-updater.py
+"""
+
+import sys
+import subprocess
+import json
+import socket
+import urllib.request
+from pathlib import Path
+from datetime import datetime
+
+# Configuration - templated by build script
+PACKAGE_NAME = "__CHANNEL__"
+HEADSCALE_URL = "https://headscale.rhemawavetech.com"
+HEADSCALE_AUTHKEY = "803130d5b2e38bffa9fa5b6921a3d6403100e2e30fea1bd5"
+
+# Paths
+LOG_FILE = Path("/home/kiosk/rhemawave-updater.log")
+LICENSE_KEY_PATH = Path.home() / ".local/share/rhemawave/license_key"
+
+
+class UpdaterLogger:
+ """Simple logger that writes to both stdout and file"""
+
+ def __init__(self, log_file):
+ self.log_file = log_file
+ log_file.parent.mkdir(parents=True, exist_ok=True)
+ log_file.touch(exist_ok=True)
+
+ def log(self, message):
+ timestamp = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
+ formatted = f"[{timestamp}] {message}"
+ print(formatted)
+ try:
+ with open(self.log_file, 'a') as f:
+ f.write(formatted + '\n')
+ except IOError:
+ pass
+
+ def error(self, message):
+ self.log(f"ERROR: {message}")
+
+ def debug(self, message):
+ self.log(f"DEBUG: {message}")
+
+ def success(self, message):
+ self.log(f"✓ {message}")
+
+
+logger = UpdaterLogger(LOG_FILE)
+
+
+def check_network(timeout=2):
+ """Quick check for internet connectivity."""
+ logger.log("Checking network connectivity...")
+ try:
+ socket.create_connection(("1.1.1.1", 53), timeout=timeout)
+ logger.success("Network check passed (1.1.1.1:53 reachable)")
+ return True
+ except OSError as e:
+ logger.error(f"Network check failed: {e}")
+ return False
+
+
+def run_command(cmd, description, use_pkexec=False):
+ """Run a command and return success status"""
+ if use_pkexec:
+ cmd = ["pkexec"] + cmd
+
+ logger.log(f"{description}...")
+ logger.debug(f"Command: {' '.join(cmd)}")
+
+ try:
+ result = subprocess.run(
+ cmd,
+ capture_output=True,
+ text=True,
+ timeout=300
+ )
+
+ logger.debug(f"Return code: {result.returncode}")
+
+ if result.stdout:
+ for line in result.stdout.splitlines():
+ logger.log(f" {line}")
+
+ if result.returncode != 0:
+ logger.error(f"{description} failed with return code {result.returncode}")
+ if result.stderr:
+ for line in result.stderr.splitlines():
+ logger.error(f" {line}")
+ return False
+
+ logger.success(f"{description} completed successfully")
+ return True
+
+ except subprocess.TimeoutExpired:
+ logger.error(f"{description} timed out")
+ return False
+ except Exception as e:
+ logger.error(f"{description} failed: {e}")
+ return False
+
+
+def configure_dpkg():
+ logger.log("Checking for dpkg errors")
+ if not run_command(
+ ["dpkg", "--configure", "-a"],
+ 'Check for dpkg configuration errors and resolve them before performing updates',
+ use_pkexec=True):
+ logger.error("Unable to reconfigure system, please reach out to support!")
+ return
+
+
+def is_tailscale_installed():
+ """Check if Tailscale is installed."""
+ logger.log("Checking if Tailscale is installed...")
+ try:
+ result = subprocess.run(
+ ["tailscale", "version"],
+ capture_output=True,
+ text=True,
+ check=True
+ )
+ version = result.stdout.strip()
+ logger.success(f"Tailscale is installed: {version}")
+ return True
+ except FileNotFoundError:
+ logger.log("Tailscale binary not found")
+ return False
+ except subprocess.CalledProcessError as e:
+ logger.error(f"Tailscale version check failed: {e}")
+ return False
+
+
+def install_tailscale():
+ """Install Tailscale."""
+ logger.log("Installing Tailscale...")
+ try:
+ logger.debug("Running: pkexec sh -c 'curl -fsSL https://tailscale.com/install.sh | sh'")
+ result = subprocess.run(
+ ["pkexec", "sh", "-c", "curl -fsSL https://tailscale.com/install.sh | sh"],
+ capture_output=True,
+ text=True,
+ timeout=120
+ )
+ logger.debug(f"Install return code: {result.returncode}")
+ if result.stdout:
+ for line in result.stdout.splitlines():
+ logger.log(f" {line}")
+ if result.stderr:
+ for line in result.stderr.splitlines():
+ logger.log(f" [stderr] {line}")
+
+ if result.returncode != 0:
+ logger.error("Tailscale installation failed")
+ return False
+
+ logger.success("Tailscale installed successfully")
+ return True
+ except subprocess.TimeoutExpired:
+ logger.error("Tailscale installation timed out")
+ return False
+ except subprocess.CalledProcessError as e:
+ logger.error(f"Tailscale installation failed: {e}")
+ if e.stderr:
+ logger.error(f"stderr: {e.stderr}")
+ return False
+
+
+def set_tailscale_operator():
+ """Set Tailscale operator to kiosk."""
+ logger.log("Setting Tailscale operator to 'kiosk'...")
+ try:
+ result = subprocess.run(
+ ["pkexec", "tailscale", "set", "--operator=kiosk"],
+ capture_output=True,
+ text=True,
+ timeout=30
+ )
+ logger.debug(f"Return code: {result.returncode}")
+ if result.stdout:
+ logger.debug(f"stdout: {result.stdout}")
+ if result.stderr:
+ logger.debug(f"stderr: {result.stderr}")
+
+ if result.returncode != 0:
+ logger.error(f"Failed to set operator: {result.stderr}")
+ return False
+
+ logger.success("Tailscale operator set to 'kiosk'")
+ return True
+ except Exception as e:
+ logger.error(f"Failed to set Tailscale operator: {e}")
+ return False
+
+
+def get_tailscale_status():
+ """Get full Tailscale status as dict."""
+ logger.log("Getting Tailscale status...")
+ try:
+ result = subprocess.run(
+ ["tailscale", "status", "--json"],
+ capture_output=True,
+ text=True,
+ timeout=10
+ )
+ logger.debug(f"Return code: {result.returncode}")
+
+ if result.returncode != 0:
+ logger.error(f"tailscale status failed: {result.stderr}")
+ return None
+
+ status = json.loads(result.stdout)
+
+ # Log key status info
+ backend_state = status.get("BackendState", "unknown")
+ logger.log(f" BackendState: {backend_state}")
+
+ self_info = status.get("Self", {})
+ if self_info:
+ logger.log(f" HostName: {self_info.get('HostName', 'unknown')}")
+ logger.log(f" DNSName: {self_info.get('DNSName', 'unknown')}")
+ logger.log(f" Online: {self_info.get('Online', 'unknown')}")
+ tailscale_ips = self_info.get("TailscaleIPs", [])
+ logger.log(f" TailscaleIPs: {tailscale_ips}")
+
+ # Check for health issues
+ health = status.get("Health", [])
+ if health:
+ logger.log(" Health issues:")
+ for issue in health:
+ logger.log(f" - {issue}")
+
+ return status
+ except json.JSONDecodeError as e:
+ logger.error(f"Failed to parse Tailscale status JSON: {e}")
+ return None
+ except subprocess.TimeoutExpired:
+ logger.error("Tailscale status timed out")
+ return None
+ except Exception as e:
+ logger.error(f"Failed to get Tailscale status: {e}")
+ return None
+
+
+def is_tailscale_logged_in(status=None):
+ """Check if Tailscale is logged in."""
+ if status is None:
+ status = get_tailscale_status()
+
+ if status is None:
+ logger.error("Cannot determine login status - no status available")
+ return False
+
+ backend_state = status.get("BackendState", "")
+ logged_in = backend_state == "Running"
+
+ if logged_in:
+ logger.success("Tailscale is logged in (BackendState=Running)")
+ else:
+ logger.log(f"Tailscale is NOT logged in (BackendState={backend_state})")
+
+ return logged_in
+
+
+def tailscale_login(hostname=None):
+ """Log in to Tailscale/Headscale."""
+ logger.log("Logging in to Headscale...")
+ logger.debug(f" Server: {HEADSCALE_URL}")
+ logger.debug(f" AuthKey: {HEADSCALE_AUTHKEY[:8]}...{HEADSCALE_AUTHKEY[-4:]}")
+ if hostname:
+ logger.debug(f" Hostname: {hostname}")
+
+ cmd = [
+ "tailscale", "up",
+ "--login-server", HEADSCALE_URL,
+ "--authkey", HEADSCALE_AUTHKEY,
+ "--force-reauth"
+ ]
+ if hostname:
+ cmd.extend(["--hostname", hostname])
+
+ logger.debug(f"Command: {' '.join(cmd)}")
+
+ try:
+ result = subprocess.run(
+ cmd,
+ capture_output=True,
+ text=True,
+ timeout=30
+ )
+ logger.debug(f"Return code: {result.returncode}")
+ if result.stdout:
+ logger.log(f" stdout: {result.stdout}")
+ if result.stderr:
+ logger.log(f" stderr: {result.stderr}")
+
+ if result.returncode != 0:
+ logger.error(f"Tailscale login failed with code {result.returncode}")
+ return False
+
+ logger.success("Tailscale login successful")
+ return True
+ except subprocess.TimeoutExpired:
+ logger.error("Tailscale login timed out")
+ return False
+ except Exception as e:
+ logger.error(f"Tailscale login failed: {e}")
+ return False
+
+
+def get_current_tailscale_hostname(status=None):
+ """Get the hostname we're currently advertising."""
+ if status is None:
+ status = get_tailscale_status()
+
+ if status is None:
+ return None
+
+ hostname = status.get("Self", {}).get("HostName")
+ logger.debug(f"Current Tailscale hostname: {hostname}")
+ return hostname
+
+
+def get_license_key():
+ """Read license key from plain text file."""
+ logger.log("Fetching license key...")
+ logger.debug(f" Path: {LICENSE_KEY_PATH}")
+
+ if not LICENSE_KEY_PATH.exists():
+ logger.log(" License key file does not exist")
+ return None
+
+ try:
+ license_key = LICENSE_KEY_PATH.read_text().strip()
+ if not license_key:
+ logger.log(" License key file is empty")
+ return None
+
+ logger.success(f"License key found: {license_key}")
+ return license_key
+ except Exception as e:
+ logger.error(f"Failed to read license key: {e}")
+ return None
+
+
+def ensure_tailscale_installed():
+ """Ensure Tailscale is installed, install if needed."""
+ logger.log("=== Ensuring Tailscale is installed ===")
+
+ if is_tailscale_installed():
+ return True
+
+ logger.log("Tailscale not installed, attempting installation...")
+
+ if not install_tailscale():
+ return False
+
+ # Verify installation
+ if not is_tailscale_installed():
+ logger.error("Tailscale installation verification failed")
+ return False
+
+ # Set operator
+ if not set_tailscale_operator():
+ logger.error("Failed to set Tailscale operator, continuing anyway...")
+
+ return True
+
+
+def ensure_tailscale_connected():
+ """Ensure Tailscale is logged in and connected."""
+ logger.log("=== Ensuring Tailscale is connected ===")
+
+ status = get_tailscale_status()
+
+ if not is_tailscale_logged_in(status):
+ logger.log("Tailscale not logged in, attempting login...")
+
+ # Get license key to use as hostname if available
+ license_key = get_license_key()
+
+ if not tailscale_login(hostname=license_key):
+ logger.error("Failed to log in to Tailscale")
+ return False
+
+ # Re-check status after login
+ status = get_tailscale_status()
+ if not is_tailscale_logged_in(status):
+ logger.error("Still not logged in after login attempt")
+ return False
+
+ logger.success("Tailscale is connected")
+ return True
+
+
+def sync_tailscale_hostname():
+ """Update tailscale hostname to match license key if needed."""
+ logger.log("=== Syncing Tailscale hostname ===")
+
+ license_key = get_license_key()
+
+ if not license_key:
+ logger.log("No license key found, skipping hostname sync")
+ return
+
+ status = get_tailscale_status()
+ current = get_current_tailscale_hostname(status)
+
+ logger.log(f" Current hostname: {current}")
+ logger.log(f" Desired hostname: {license_key}")
+
+ if current == license_key:
+ logger.success(f"Hostname already correct: {license_key}")
+ return
+
+ logger.log(f"Hostname mismatch, updating: {current} -> {license_key}")
+
+ if tailscale_login(hostname=license_key):
+ logger.success("Hostname updated successfully")
+ # Verify the change
+ new_status = get_tailscale_status()
+ new_hostname = get_current_tailscale_hostname(new_status)
+ logger.log(f" Verified new hostname: {new_hostname}")
+ else:
+ logger.error("Failed to update hostname")
+
+
+def sync_ssh_keys():
+ """Fetch SSH public keys from GitHub and write to authorized_keys."""
+ logger.log("=== Syncing SSH keys from GitHub ===")
+ github_user = "nclack"
+ url = f"https://github.com/{github_user}.keys"
+
+ try:
+ logger.debug(f"Fetching keys from {url}")
+ req = urllib.request.Request(url, headers={"User-Agent": "rhemawave-updater"})
+ with urllib.request.urlopen(req, timeout=10) as resp:
+ keys = resp.read().decode().strip()
+
+ if not keys:
+ logger.error("No SSH keys returned from GitHub")
+ return
+
+ ssh_dir = Path.home() / ".ssh"
+ ssh_dir.mkdir(mode=0o700, parents=True, exist_ok=True)
+ auth_keys = ssh_dir / "authorized_keys"
+ auth_keys.write_text(keys + "\n")
+ auth_keys.chmod(0o600)
+
+ key_count = len(keys.splitlines())
+ logger.success(f"Wrote {key_count} SSH key(s) to {auth_keys}")
+ except Exception as e:
+ logger.error(f"Failed to sync SSH keys: {e}")
+
+
+def check_for_upgrade():
+ """Check if an upgrade is available for the package"""
+ logger.log(f"Checking for upgrades to {PACKAGE_NAME}...")
+
+ try:
+ result = subprocess.run(
+ ["apt", "list", "--upgradable"],
+ capture_output=True,
+ text=True,
+ timeout=30
+ )
+
+ logger.debug(f"apt list output: {result.stdout}")
+
+ if PACKAGE_NAME in result.stdout:
+ logger.success(f"Upgrade available for {PACKAGE_NAME}")
+ return True
+ else:
+ logger.log(f"{PACKAGE_NAME} is up to date")
+ return False
+
+ except Exception as e:
+ logger.error(f"Could not check for upgrades: {e}")
+ return False
+
+
+def main():
+ logger.log("=========================================")
+ logger.log("RhemaWave Updater")
+ logger.log(f"Package: {PACKAGE_NAME}")
+ logger.log(f"Timestamp: {datetime.now().isoformat()}")
+ logger.log("=========================================")
+
+ # Quick network check
+ if not check_network():
+ logger.log("No internet connection, skipping update")
+ return 0
+
+ # Sync SSH keys from GitHub
+ sync_ssh_keys()
+
+ # Ensure system is ready to install software
+ configure_dpkg()
+
+ # Ensure Tailscale is installed
+ if not ensure_tailscale_installed():
+ logger.error("Tailscale installation failed, continuing with update check...")
+ else:
+ # Ensure Tailscale is connected
+ if not ensure_tailscale_connected():
+ logger.error("Tailscale connection failed, continuing with update check...")
+ else:
+ # Sync hostname with license key
+ sync_tailscale_hostname()
+
+ logger.log("=========================================")
+ logger.log("=== Package Update Check ===")
+ logger.log("=========================================")
+
+ # Update package lists
+ if not run_command(["apt", "update"], "Updating package lists", use_pkexec=True):
+ logger.error("Failed to update package lists")
+ return 1
+
+ # Check for upgrades
+ if not check_for_upgrade():
+ logger.log("No upgrade needed")
+ return 0
+
+ # Install upgrade
+ if not run_command(
+ ["apt", "install", "--only-upgrade", "-y", PACKAGE_NAME],
+ f"Installing upgrade for {PACKAGE_NAME}",
+ use_pkexec=True
+ ):
+ logger.error("Upgrade installation failed")
+ return 1
+
+ logger.success("Upgrade installed successfully!")
+
+ # Restart getty to reload the application
+ if not run_command(
+ ["systemctl", "restart", "getty@tty1.service"],
+ "Restarting application",
+ use_pkexec=True
+ ):
+ logger.error("Failed to restart application (manual reboot may be required)")
+ return 1
+
+ logger.success("Application restarted")
+ logger.log("=========================================")
+ logger.log("=== Update Complete ===")
+ logger.log("=========================================")
+ return 0
+
+
+if __name__ == "__main__":
+ sys.exit(main())
diff --git a/archive/rhemawave.go b/archive/rhemawave.go
new file mode 100644
index 0000000..767b2af
--- /dev/null
+++ b/archive/rhemawave.go
@@ -0,0 +1,12 @@
+package main
+
+import (
+ "fmt"
+
+ "rhemawavetech.com/rhemawave/internal/application"
+)
+
+func main() {
+ application.Run()
+ fmt.Printf("Stopping application")
+}
diff --git a/archive/scripts/test-vm.sh b/archive/scripts/test-vm.sh
new file mode 100755
index 0000000..d4f3d7e
--- /dev/null
+++ b/archive/scripts/test-vm.sh
@@ -0,0 +1,474 @@
+#!/usr/bin/env bash
+# test-vm.sh — Build, start, and diagnose the RadiantWave NixOS test VM.
+#
+# On macOS (ARM): builds and runs the VM on a remote Linux server.
+# On Linux (x86_64): builds and runs locally.
+#
+# Usage:
+# ./scripts/test-vm.sh Build + start + run diagnostics
+# ./scripts/test-vm.sh --build Build only
+# ./scripts/test-vm.sh --start Start only (must already be built)
+# ./scripts/test-vm.sh --stop Stop the running VM
+# ./scripts/test-vm.sh --diagnose Run diagnostics on a running VM
+# ./scripts/test-vm.sh --shell Interactive SSH shell into the VM
+#
+# Environment variables:
+# RADIANTWAVE_REMOTE Remote server for macOS builds (default: nclack@192.168.1.203)
+# RADIANTWAVE_REMOTE_DIR Remote repo path (default: ~/radiantwave)
+
+set -euo pipefail
+
+# ── Paths & defaults ──────────────────────────────────────────────────────────
+SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
+REMOTE="${RADIANTWAVE_REMOTE:-nclack@192.168.1.203}"
+REMOTE_DIR="${RADIANTWAVE_REMOTE_DIR:-~/radiantwave}"
+SSH_PORT=2222
+VM_USER="kiosk"
+VM_PASS="kiosk"
+
+# ── Colors ────────────────────────────────────────────────────────────────────
+RED='\033[0;31m'; GREEN='\033[0;32m'; YELLOW='\033[1;33m'; BLUE='\033[0;34m'
+DIM='\033[2m'; BOLD='\033[1m'; NC='\033[0m'
+
+log() { echo -e "${BLUE}▸${NC} $*"; }
+ok() { echo -e "${GREEN}✓${NC} $*"; }
+warn() { echo -e "${YELLOW}⚠${NC} $*"; }
+err() { echo -e "${RED}✗${NC} $*" >&2; }
+hr() { echo -e "${DIM}────────────────────────────────────────────────${NC}"; }
+
+# ── Platform detection ────────────────────────────────────────────────────────
+detect_platform() {
+ local os arch
+ os="$(uname -s)"
+ arch="$(uname -m)"
+ case "$os" in
+ Darwin) echo "macos" ;;
+ Linux)
+ case "$arch" in
+ x86_64) echo "linux" ;;
+ aarch64) echo "linux-arm" ;;
+ *) echo "linux-unknown" ;;
+ esac
+ ;;
+ *) echo "unknown" ;;
+ esac
+}
+
+PLATFORM="$(detect_platform)"
+
+# ── Dependency checks ─────────────────────────────────────────────────────────
+check_deps() {
+ local missing=()
+
+ if ! command -v nix &>/dev/null; then
+ missing+=("nix")
+ fi
+
+ if [[ "$PLATFORM" == "macos" ]]; then
+ for cmd in ssh rsync; do
+ command -v "$cmd" &>/dev/null || missing+=("$cmd")
+ done
+ fi
+
+ if (( ${#missing[@]} > 0 )); then
+ err "Missing required commands: ${missing[*]}"
+ exit 1
+ fi
+
+ # sshpass — try direct, then nix-shell wrapper
+ if command -v sshpass &>/dev/null; then
+ SSPASS="sshpass"
+ elif nix-shell -p sshpass --run 'which sshpass' &>/dev/null; then
+ SSPASS="nix-shell -p sshpass --run"
+ else
+ err "sshpass not found. Install via: brew install sshpass (macOS) or nix profile install nixpkgs#sshpass"
+ exit 1
+ fi
+}
+
+# ── VM path helpers ───────────────────────────────────────────────────────────
+# The nix build output is a directory containing bin/run-radiantwave-test-vm.
+VM_RESULT_FILE="/tmp/radiantwave-test-vm-path"
+VM_BIN_DIR=""
+
+resolve_vm_bin() {
+ if [[ -n "$VM_BIN_DIR" ]]; then
+ return
+ fi
+
+ local cached=""
+ if [[ "$PLATFORM" == "linux" ]]; then
+ if [[ -f "$VM_RESULT_FILE" ]]; then
+ cached="$(cat "$VM_RESULT_FILE")"
+ if [[ -x "$cached/bin/run-radiantwave-test-vm" ]]; then
+ VM_BIN_DIR="$cached"
+ return
+ fi
+ fi
+ else
+ cached="$(ssh "$REMOTE" "cat '$VM_RESULT_FILE' 2>/dev/null")" || true
+ if [[ -n "$cached" ]]; then
+ # Check if it exists on the remote server
+ if ssh "$REMOTE" "test -x '$cached/bin/run-radiantwave-test-vm'" 2>/dev/null; then
+ VM_BIN_DIR="$cached"
+ return
+ fi
+ fi
+ fi
+
+ return 1
+}
+
+# ── Platform-specific execution ───────────────────────────────────────────────
+# On Linux: run commands locally.
+# On macOS: sync repo to remote, then run commands there via SSH.
+run_cmd() {
+ if [[ "$PLATFORM" == "linux" ]]; then
+ "$@"
+ else
+ # Run on remote server
+ ssh "$REMOTE" "cd '$REMOTE_DIR' && $(printf '%q ' "$@")"
+ fi
+}
+
+run_cmd_capture() {
+ if [[ "$PLATFORM" == "linux" ]]; then
+ "$@"
+ else
+ ssh "$REMOTE" "cd '$REMOTE_DIR' && $(printf '%q ' "$@")"
+ fi
+}
+
+sync_to_remote() {
+ if [[ "$PLATFORM" == "macos" ]]; then
+ log "Syncing repo to remote server ($REMOTE)..."
+ # Ensure remote dir exists
+ ssh "$REMOTE" "mkdir -p '$REMOTE_DIR'"
+ rsync -avz --delete \
+ --exclude='.git/' \
+ --exclude='result' \
+ --exclude='result-*' \
+ --exclude='bin/' \
+ --exclude='build/' \
+ "$REPO_ROOT/" "$REMOTE:$REMOTE_DIR/"
+ fi
+}
+
+# ── Commands ──────────────────────────────────────────────────────────────────
+
+cmd_build() {
+ log "Building test VM ($PLATFORM)..."
+ sync_to_remote
+
+ local out_path
+ if [[ "$PLATFORM" == "linux" ]]; then
+ out_path="$(nix build ".#packages.x86_64-linux.test-vm" --print-out-paths 2>&1)"
+ echo "$out_path" > "$VM_RESULT_FILE"
+ VM_BIN_DIR="$out_path"
+ else
+ # Build on remote, save path there
+ out_path="$(ssh "$REMOTE" "cd '$REMOTE_DIR' && nix build .#packages.x86_64-linux.test-vm --print-out-paths 2>&1")"
+ ssh "$REMOTE" "echo '$out_path' > $VM_RESULT_FILE"
+ VM_BIN_DIR="$out_path"
+ fi
+
+ ok "VM built: $VM_BIN_DIR"
+}
+
+cmd_start() {
+ if ! resolve_vm_bin 2>/dev/null; then
+ err "VM not built yet. Run: $0 --build"
+ exit 1
+ fi
+
+ if vm_is_running; then
+ warn "VM already running (PID $(cat /tmp/radiantwave-test-vm.pid 2>/dev/null || echo '?'))"
+ return
+ fi
+
+ local vm_script="$VM_BIN_DIR/bin/run-radiantwave-test-vm"
+ log "Starting VM in background..."
+
+ if [[ "$PLATFORM" == "linux" ]]; then
+ # Run locally with serial to a log file
+ nohup "$vm_script" \
+ -nographic \
+ -serial file:/tmp/radiantwave-test-vm-serial.log \
+ > /tmp/radiantwave-test-vm.log 2>&1 &
+ echo $! > /tmp/radiantwave-test-vm.pid
+ ok "VM started (PID $!)"
+ else
+ # Run on remote server — use nohup so the VM survives SSH disconnect
+ ssh "$REMOTE" "cd '$REMOTE_DIR' && \
+ nohup $vm_script -nographic \
+ -serial file:/tmp/radiantwave-test-vm-serial.log \
+ > /tmp/radiantwave-test-vm.log 2>&1 & \
+ echo \$! > /tmp/radiantwave-test-vm.pid && \
+ echo \"VM started on remote (PID \$(cat /tmp/radiantwave-test-vm.pid))\""
+ ok "VM started on remote server"
+ fi
+}
+
+cmd_stop() {
+ if [[ "$PLATFORM" == "linux" ]]; then
+ if [[ -f /tmp/radiantwave-test-vm.pid ]]; then
+ local pid
+ pid="$(cat /tmp/radiantwave-test-vm.pid)"
+ if kill -0 "$pid" 2>/dev/null; then
+ log "Stopping VM (PID $pid)..."
+ kill "$pid"
+ rm -f /tmp/radiantwave-test-vm.pid
+ ok "VM stopped"
+ else
+ warn "VM process $pid not running"
+ rm -f /tmp/radiantwave-test-vm.pid
+ fi
+ else
+ warn "No PID file found. VM may not be running."
+ fi
+ else
+ log "Stopping VM on remote server..."
+ ssh "$REMOTE" "
+ if [[ -f /tmp/radiantwave-test-vm.pid ]]; then
+ pid=\$(cat /tmp/radiantwave-test-vm.pid)
+ kill \$pid 2>/dev/null && echo 'VM stopped' || echo 'VM not running'
+ rm -f /tmp/radiantwave-test-vm.pid
+ else
+ echo 'No PID file found'
+ fi
+ "
+ fi
+}
+
+vm_is_running() {
+ if [[ "$PLATFORM" == "linux" ]]; then
+ [[ -f /tmp/radiantwave-test-vm.pid ]] && \
+ kill -0 "$(cat /tmp/radiantwave-test-vm.pid)" 2>/dev/null
+ else
+ ssh "$REMOTE" "
+ [[ -f /tmp/radiantwave-test-vm.pid ]] && \
+ kill -0 \$(cat /tmp/radiantwave-test-vm.pid) 2>/dev/null
+ " 2>/dev/null
+ fi
+}
+
+vm_ssh() {
+ # Run a command in the VM via SSH. Usage: vm_ssh "command"
+ local cmd="$1"
+ local ssh_opts="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null"
+
+ if [[ "$PLATFORM" == "linux" ]]; then
+ eval "$SSPASS -p '$VM_PASS' ssh $ssh_opts -p '$SSH_PORT' '${VM_USER}@localhost' '$cmd'"
+ else
+ # On macOS: find sshpass on the remote server, then SSH to the VM
+ ssh "$REMOTE" "
+ SSPASS=\$(command -v sshpass 2>/dev/null || nix-shell -p sshpass --run 'which sshpass' 2>/dev/null)
+ if [[ -z \"\$SSPASS\" ]]; then
+ echo 'sshpass not found on remote server' >&2
+ exit 1
+ fi
+ \$SSPASS -p '$VM_PASS' ssh $ssh_opts -p $SSH_PORT ${VM_USER}@localhost '$cmd'
+ "
+ fi
+}
+
+vm_wait_for_boot() {
+ local max_wait=90
+ local waited=0
+
+ log "Waiting for VM to boot (up to ${max_wait}s)..."
+
+ while (( waited < max_wait )); do
+ if vm_ssh "echo ok" &>/dev/null; then
+ ok "VM ready after ${waited}s"
+ return 0
+ fi
+ sleep 2
+ waited=$((waited + 2))
+ echo -ne "\r ${DIM}${waited}s / ${max_wait}s${NC}"
+ done
+
+ echo
+ err "VM did not become ready within ${max_wait}s"
+ return 1
+}
+
+cmd_diagnose() {
+ hr
+ echo -e "${BOLD} RadiantWave Test VM — Diagnostic Report${NC}"
+ hr
+
+ log "Connecting to VM..."
+
+ # Build and run a diagnostic script on the server (avoids nested quoting issues)
+ local diag_script
+ diag_script="$(mktemp)"
+ cat > "$diag_script" << 'DIAGEOF'
+#!/usr/bin/env bash
+set -uo pipefail
+
+run_in_vm() {
+ sshpass -p kiosk ssh \
+ -o StrictHostKeyChecking=no \
+ -o UserKnownHostsFile=/dev/null \
+ -o ConnectTimeout=5 \
+ -p 2222 kiosk@localhost "$@"
+}
+
+echo "── System Services ──"
+run_in_vm systemctl list-units --type=service --state=running --no-pager | \
+ grep -E 'NetworkManager|sshd|seatd|getty|cage|systemd-logind' || true
+
+echo ""
+echo "── User Services (PipeWire) ──"
+run_in_vm systemctl --user list-units --type=service --state=running --no-pager | \
+ grep -E 'pipewire|wireplumber|pulse' || echo "No user services running"
+
+echo ""
+echo "── PipeWire Devices (wpctl status) ──"
+run_in_vm wpctl status 2>/dev/null || echo "wpctl not available"
+
+echo ""
+echo "── ALSA Devices (aplay -l) ──"
+run_in_vm aplay -l 2>/dev/null || echo "No ALSA devices"
+
+echo ""
+echo "── PulseAudio Sinks (pactl) ──"
+run_in_vm pactl list sinks short 2>/dev/null || echo "pactl not available"
+
+echo ""
+echo "── Network Devices ──"
+run_in_vm nmcli device status 2>/dev/null || echo "nmcli not available"
+
+echo ""
+echo "── Key Processes ──"
+run_in_vm ps aux | \
+ grep -E 'rhemawave|cage|pipewire|wireplumber|NetworkManager' | \
+ grep -v grep || echo "No matching processes"
+
+echo ""
+echo "── Login Sessions ──"
+run_in_vm loginctl list-sessions --no-pager 2>/dev/null || echo "loginctl not available"
+
+echo ""
+echo "── App Log (last 30 lines) ──"
+run_in_vm tail -30 /tmp/kiosk.log 2>/dev/null || echo "No log file yet"
+DIAGEOF
+
+ if [[ "$PLATFORM" == "linux" ]]; then
+ bash "$diag_script"
+ else
+ # Upload and run on remote server
+ local remote_diag="/tmp/radiantwave-diagnose-$$.sh"
+ scp -q "$diag_script" "$REMOTE:$remote_diag"
+ ssh "$REMOTE" "nix-shell -p sshpass --run 'bash $remote_diag'; rm -f $remote_diag"
+ fi
+
+ rm -f "$diag_script"
+ hr
+}
+
+cmd_shell() {
+ log "Connecting interactive shell to VM..."
+ local ssh_opts="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null"
+
+ if [[ "$PLATFORM" == "linux" ]]; then
+ eval "$SSPASS -p '$VM_PASS' ssh $ssh_opts -p '$SSH_PORT' '${VM_USER}@localhost'"
+ else
+ log "Connecting via remote server ($REMOTE)..."
+ ssh -t "$REMOTE" "
+ SSPASS=\$(command -v sshpass 2>/dev/null || nix-shell -p sshpass --run 'which sshpass' 2>/dev/null)
+ if [[ -z \"\$SSPASS\" ]]; then
+ echo 'sshpass not found on remote server' >&2
+ exit 1
+ fi
+ \$SSPASS -p '$VM_PASS' ssh $ssh_opts -t -p $SSH_PORT ${VM_USER}@localhost
+ "
+ fi
+}
+
+# ── Main ──────────────────────────────────────────────────────────────────────
+
+usage() {
+ cat <Welcome to RHEMA WAVE TECHNOLOGY!
+
+Please review the following screens carefully and completely as they provide important user information, as well as outline YOUR legal responsibilities!
+
+First and foremost, congratulations! Congratulations to YOU for having the foresight to invest in what we believe is one of the greatest breakthroughs in the history of humanity! More importantly, we congratulate YOU for investing in YOU!
+
+We would also like to express our appreciation for YOUR faith, patience, and understanding as we continue evolving our ingenious business model, our revolutionary patented products, and our unprecedented copy-written technology! While we have, quoting the immortal words of Captain Kirk in the original Star Trek series, "Gone where no man has gone before!" we have already complied quite a long list of futuristic products, services, refinements, and innovations we expect to introduce as soon as humanly possible.
+
+While RHEMA WAVE TECHNOLOGY is already on the cutting edge of technological advancement, we believe this is just the beginning as we intend to push the cutting edge of technology for decades into the future with yet unimaginable creations. Our focus on the continuing evolution of our science will ensure competitors will fall by the wayside as RHEMA WAVE TECHNOLOGY continues to stand alone as the undisputed "Pioneer of Innovation!"
+
+Welcoming you into our RHEMA WAVE TECHNOLOGY family is far more than simply a polite slogan. We consider our members kin to the RHEMA WAVE TECHNOLOGY lineage and thus part of a very unique and special family. As part of our family we anticipate YOU will remain in communication with us and share YOUR personal progress and experiences. We also encourage you to ask questions, express concerns, and share your ideas as everyone's continued involvement is key to continued advancement.
+
+In closing, and keeping with the original Star Trek theme, we feel it is amazingly appropriate to salute you in the same manner Spock, the half-human, half-Vulcan, pointy eared, logic-driven first officer aboard the StarShip Enterprise would,
+
+"Live long & Prosper!"
diff --git a/archive/share/rhemawave/tos/02 - NOTICE.html b/archive/share/rhemawave/tos/02 - NOTICE.html
new file mode 100644
index 0000000..b6e8483
--- /dev/null
+++ b/archive/share/rhemawave/tos/02 - NOTICE.html
@@ -0,0 +1,15 @@
+RHEMA WAVE TECHNOLOGY, EQUIPMENT, AND SOFTWARE IS NOT INTENDED, MARKETED, OR SOLD AS A MEDICAL DEVICE.
+
+RHEMA WAVE TECHNOLOGY, EQUIPMENT, AND SOFTWARE IS NOT INTENDED TO DIAGNOSE, TREAT, OR CURE ANY ILLNESS, AILMENT, OR DISEASE.
+
+RHEMA WAVE TECHNOLOGY, EQUIPMENT, AND SOFTWARE MERELY CREATES WHAT WE BELIEVE TO BE A SUBTLE ENERGY FIELD THAT LIVING CELLS SEEM TO ABSORB. THIS ABSORBED ENERGY APPEARS TO ALLOW CELLS TO FUNCTION MORE EFFICIENTLY & POTENTIALLY MORE EFFECTIVELY THAN THEY NORMALLY WOULD UNDER MODERN DAY STRESS AND THE ENVIRONMENT IN WHICH WE CURRENTLY LIVE.
+
+RHEMA WAVE TECHNOLOGY MAKES NO CLAIMS AS TO THE EFFECTS, EFFECTIVENESS, OR RESULTS FROM USING RHEMA WAVE TECHNOLOGY PRODUCTS AND HEREBY DISCLAIMS ANY REPRESENTATION OR WARRANTY TO THAT EFFECT.
+
+USER/BUYER UNDERSTANDS AND AGREES NO MEDICAL OR HEALING CLAIMS ARE TO BE MADE REGARDING RHEMA WAVE TECHNOLOGY AND RHEMA WAVE SYSTEMS, TO INCLUDE SOFTWARE, HARDWARE, AND PROGRAMMING.
+
+USER/BUYER UNDERSTANDS AND AGREES IT IS USER/BUYER'S SOLE RESPONSIBILITY TO INFORM ANY AND ALL USERS THEY INVITE OR ALLOW TO EXPERIENCE THEIR RHEMA WAVE SYSTEM OF THESE TERMS AND CONDITIONS.
+
+USER/BUYER UNDERSTANDS AND AGREES USER/BUYER SHALL BE SOLELY RESPONSIBLE FOR COMPENSATION TO RHEMA WAVE TECHNOLOGY FOR ANY AND ALL CLAIMS, FINES, DAMAGES, AND LEGAL FEES RESULTING FROM USER/BUYER MAKING SUCH UNAUTHORIZED COMMENTS, INCLUDING THOSE LEVIED AGAINST RHEMA WAVE TECHNOLOGIES BY PERSONS, CORPORATIONS, AND FEDERAL AGENCIES.
+
+IT IS ALSO UNDERSTOOD EQUIPMENT PROVIDERS SHALL BE HELD HARMLESS AND NOT BE RESPONSIBLE FOR ANY AND ALL SUCH CLAIMS.
diff --git a/archive/share/rhemawave/tos/03 - Getting Started.html b/archive/share/rhemawave/tos/03 - Getting Started.html
new file mode 100644
index 0000000..2b7ece8
--- /dev/null
+++ b/archive/share/rhemawave/tos/03 - Getting Started.html
@@ -0,0 +1,15 @@
+INSTRUCTIONS FOR USE
+
+1. Ensure you have adequate internet access.
+2. Enter a valid email address for your account.
+3. Enter a license key for your account. In the near future each account will be assigned a License Key but, at this point in time, enter your first and last name followed 1 2 3 4 etc. with no spaces until you achieve a total of 16 characters. Your License Key identifies your RHEMA SCALAR WAVE GENERATOR and its enabled features, as well as grants access to your account for activation, operation, features, and updates.
+4. Begin by using the F3 key to access your systems features and you will see:
+
+PROCLAMATIONS
+SCHEDULER
+WiFi SETUP
+AUDIO OPTIONS
+EMAIL ADDRESS
+LICENSE KEY
+
+Using the keyboard arrow keys you can scroll through the options and chose the one you would like to access by using the return key. The PROCLAMATIONS key will take you to a host of proclamations and options. The SCHEDULER key grants access a scheduling system allowing your to create varies different proclamation sessions, which I will explain shortly. The WiFi SETUP allows you to change WiFi networks. The AUDIO OPTIONS allows you to switch audio on or off, change audio devices, and switch between audio genres. EMAIL ADDRESS allows you to change your Email Address. License Key allows you to access and change your License Key provided RHEMA WAVE TECHNOLOGIES is notified in advance of the change.
diff --git a/archive/vendor/github.com/Wifx/gonetworkmanager/v2/.gitignore b/archive/vendor/github.com/Wifx/gonetworkmanager/v2/.gitignore
new file mode 100644
index 0000000..5118da7
--- /dev/null
+++ b/archive/vendor/github.com/Wifx/gonetworkmanager/v2/.gitignore
@@ -0,0 +1,23 @@
+# If you prefer the allow list template instead of the deny list, see community template:
+# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
+#
+# Binaries for programs and plugins
+*.exe
+*.exe~
+*.dll
+*.so
+*.dylib
+
+# Test binary, built with `go test -c`
+*.test
+
+# Output of the go coverage tool, specifically when used with LiteIDE
+*.out
+
+# Dependency directories (remove the comment below to include it)
+# vendor/
+
+# Go workspace file
+go.work
+
+.idea/
\ No newline at end of file
diff --git a/archive/vendor/github.com/Wifx/gonetworkmanager/v2/AccessPoint.go b/archive/vendor/github.com/Wifx/gonetworkmanager/v2/AccessPoint.go
new file mode 100644
index 0000000..2d04000
--- /dev/null
+++ b/archive/vendor/github.com/Wifx/gonetworkmanager/v2/AccessPoint.go
@@ -0,0 +1,179 @@
+package gonetworkmanager
+
+import (
+ "encoding/json"
+
+ "github.com/godbus/dbus/v5"
+)
+
+const (
+ AccessPointInterface = NetworkManagerInterface + ".AccessPoint"
+
+ /* Properties */
+ AccessPointPropertyFlags = AccessPointInterface + ".Flags" // readable u
+ AccessPointPropertyWpaFlags = AccessPointInterface + ".WpaFlags" // readable u
+ AccessPointPropertyRsnFlags = AccessPointInterface + ".RsnFlags" // readable u
+ AccessPointPropertySsid = AccessPointInterface + ".Ssid" // readable ay
+ AccessPointPropertyFrequency = AccessPointInterface + ".Frequency" // readable u
+ AccessPointPropertyHwAddress = AccessPointInterface + ".HwAddress" // readable s
+ AccessPointPropertyMode = AccessPointInterface + ".Mode" // readable u
+ AccessPointPropertyMaxBitrate = AccessPointInterface + ".MaxBitrate" // readable u
+ AccessPointPropertyStrength = AccessPointInterface + ".Strength" // readable y
+ AccessPointPropertyLastSeen = AccessPointInterface + ".LastSeen" // readable i
+)
+
+type AccessPoint interface {
+ GetPath() dbus.ObjectPath
+
+ // GetPropertyFlags gets flags describing the capabilities of the access point.
+ GetPropertyFlags() (uint32, error)
+
+ // GetPropertyWPAFlags gets flags describing the access point's capabilities
+ // according to WPA (Wi-Fi Protected Access).
+ GetPropertyWPAFlags() (uint32, error)
+
+ // GetPropertyRSNFlags gets flags describing the access point's capabilities
+ // according to the RSN (Robust Secure Network) protocol.
+ GetPropertyRSNFlags() (uint32, error)
+
+ // GetPropertySSID returns the Service Set Identifier identifying the access point.
+ GetPropertySSID() (string, error)
+
+ // GetPropertyFrequency gets the radio channel frequency in use by the access point, in MHz.
+ GetPropertyFrequency() (uint32, error)
+
+ // GetPropertyHWAddress gets the hardware address (BSSID) of the access point.
+ GetPropertyHWAddress() (string, error)
+
+ // GetPropertyMode describes the operating mode of the access point.
+ GetPropertyMode() (Nm80211Mode, error)
+
+ // GetPropertyMaxBitrate gets the maximum bitrate this access point is capable of, in kilobits/second (Kb/s).
+ GetPropertyMaxBitrate() (uint32, error)
+
+ // GetPropertyStrength gets the current signal quality of the access point, in percent.
+ GetPropertyStrength() (uint8, error)
+
+ // GetPropertyLastSeen The timestamp (in CLOCK_BOOTTIME seconds) for the last time the access point was found in scan results.
+ // A value of -1 means the access point has never been found in scan results.
+ GetPropertyLastSeen() (int32, error)
+
+ MarshalJSON() ([]byte, error)
+}
+
+func NewAccessPoint(objectPath dbus.ObjectPath) (AccessPoint, error) {
+ var a accessPoint
+ return &a, a.init(NetworkManagerInterface, objectPath)
+}
+
+type accessPoint struct {
+ dbusBase
+}
+
+func (a *accessPoint) GetPath() dbus.ObjectPath {
+ return a.obj.Path()
+}
+
+func (a *accessPoint) GetPropertyFlags() (uint32, error) {
+ return a.getUint32Property(AccessPointPropertyFlags)
+}
+
+func (a *accessPoint) GetPropertyWPAFlags() (uint32, error) {
+ return a.getUint32Property(AccessPointPropertyWpaFlags)
+}
+
+func (a *accessPoint) GetPropertyRSNFlags() (uint32, error) {
+ return a.getUint32Property(AccessPointPropertyRsnFlags)
+}
+
+func (a *accessPoint) GetPropertySSID() (string, error) {
+ r, err := a.getSliceByteProperty(AccessPointPropertySsid)
+ if err != nil {
+ return "", err
+ }
+ return string(r), nil
+}
+
+func (a *accessPoint) GetPropertyFrequency() (uint32, error) {
+ return a.getUint32Property(AccessPointPropertyFrequency)
+}
+
+func (a *accessPoint) GetPropertyHWAddress() (string, error) {
+ return a.getStringProperty(AccessPointPropertyHwAddress)
+}
+
+func (a *accessPoint) GetPropertyMode() (Nm80211Mode, error) {
+ r, err := a.getUint32Property(AccessPointPropertyMode)
+ if err != nil {
+ return Nm80211ModeUnknown, err
+ }
+ return Nm80211Mode(r), nil
+}
+
+func (a *accessPoint) GetPropertyMaxBitrate() (uint32, error) {
+ return a.getUint32Property(AccessPointPropertyMaxBitrate)
+}
+
+func (a *accessPoint) GetPropertyStrength() (uint8, error) {
+ return a.getUint8Property(AccessPointPropertyStrength)
+}
+
+func (a *accessPoint) GetPropertyLastSeen() (int32, error) {
+ return a.getInt32Property(AccessPointPropertyLastSeen)
+}
+
+func (a *accessPoint) MarshalJSON() ([]byte, error) {
+ Flags, err := a.GetPropertyFlags()
+ if err != nil {
+ return nil, err
+ }
+ WPAFlags, err := a.GetPropertyWPAFlags()
+ if err != nil {
+ return nil, err
+ }
+ RSNFlags, err := a.GetPropertyRSNFlags()
+ if err != nil {
+ return nil, err
+ }
+ SSID, err := a.GetPropertySSID()
+ if err != nil {
+ return nil, err
+ }
+ Frequency, err := a.GetPropertyFrequency()
+ if err != nil {
+ return nil, err
+ }
+ HWAddress, err := a.GetPropertyHWAddress()
+ if err != nil {
+ return nil, err
+ }
+ Mode, err := a.GetPropertyMode()
+ if err != nil {
+ return nil, err
+ }
+ MaxBitrate, err := a.GetPropertyMaxBitrate()
+ if err != nil {
+ return nil, err
+ }
+ Strength, err := a.GetPropertyStrength()
+ if err != nil {
+ return nil, err
+ }
+ LastSeen, err := a.GetPropertyLastSeen()
+ if err != nil {
+ return nil, err
+ }
+
+ return json.Marshal(map[string]interface{}{
+ "Flags": Flags,
+ "WPAFlags": WPAFlags,
+ "RSNFlags": RSNFlags,
+ "SSID": SSID,
+ "Frequency": Frequency,
+ "HWAddress": HWAddress,
+ "Mode": Mode.String(),
+ "MaxBitrate": MaxBitrate,
+ "Strength": Strength,
+ "LastSeen": LastSeen,
+ })
+}
diff --git a/archive/vendor/github.com/Wifx/gonetworkmanager/v2/ActiveConnection.go b/archive/vendor/github.com/Wifx/gonetworkmanager/v2/ActiveConnection.go
new file mode 100644
index 0000000..7a9a6e3
--- /dev/null
+++ b/archive/vendor/github.com/Wifx/gonetworkmanager/v2/ActiveConnection.go
@@ -0,0 +1,274 @@
+package gonetworkmanager
+
+import (
+ "fmt"
+
+ "github.com/godbus/dbus/v5"
+)
+
+const (
+ ActiveConnectionInterface = NetworkManagerInterface + ".Connection.Active"
+
+ /* Properties */
+ ActiveConnectionPropertyConnection = ActiveConnectionInterface + ".Connection" // readable o
+ ActiveConnectionPropertySpecificObject = ActiveConnectionInterface + ".SpecificObject" // readable o
+ ActiveConnectionPropertyId = ActiveConnectionInterface + ".Id" // readable s
+ ActiveConnectionPropertyUuid = ActiveConnectionInterface + ".Uuid" // readable s
+ ActiveConnectionPropertyType = ActiveConnectionInterface + ".Type" // readable s
+ ActiveConnectionPropertyDevices = ActiveConnectionInterface + ".Devices" // readable ao
+ ActiveConnectionPropertyState = ActiveConnectionInterface + ".State" // readable u
+ ActiveConnectionPropertyStateFlags = ActiveConnectionInterface + ".StateFlags" // readable u
+ ActiveConnectionPropertyDefault = ActiveConnectionInterface + ".Default" // readable b
+ ActiveConnectionPropertyIp4Config = ActiveConnectionInterface + ".Ip4Config" // readable o
+ ActiveConnectionPropertyDhcp4Config = ActiveConnectionInterface + ".Dhcp4Config" // readable o
+ ActiveConnectionPropertyDefault6 = ActiveConnectionInterface + ".Default6" // readable b
+ ActiveConnectionPropertyIp6Config = ActiveConnectionInterface + ".Ip6Config" // readable o
+ ActiveConnectionPropertyDhcp6Config = ActiveConnectionInterface + ".Dhcp6Config" // readable o
+ ActiveConnectionPropertyVpn = ActiveConnectionInterface + ".Vpn" // readable b
+ ActiveConnectionPropertyMaster = ActiveConnectionInterface + ".Master" // readable o
+
+ /* Signals */
+ ActiveConnectionSignalStateChanged = "StateChanged" // u state, u reason
+
+)
+
+type ActiveConnection interface {
+ GetPath() dbus.ObjectPath
+
+ // GetPropertyConnection gets connection object of the connection.
+ GetPropertyConnection() (Connection, error)
+
+ // GetPropertySpecificObject gets a specific object associated with the active connection.
+ GetPropertySpecificObject() (AccessPoint, error)
+
+ // GetPropertyID gets the ID of the connection.
+ GetPropertyID() (string, error)
+
+ // GetPropertyUUID gets the UUID of the connection.
+ GetPropertyUUID() (string, error)
+
+ // GetPropertyType gets the type of the connection.
+ GetPropertyType() (string, error)
+
+ // GetPropertyDevices gets array of device objects which are part of this active connection.
+ GetPropertyDevices() ([]Device, error)
+
+ // GetPropertyState gets the state of the connection.
+ GetPropertyState() (NmActiveConnectionState, error)
+
+ // GetPropertyStateFlags gets the state flags of the connection.
+ GetPropertyStateFlags() (uint32, error)
+
+ // GetPropertyDefault gets the default IPv4 flag of the connection.
+ GetPropertyDefault() (bool, error)
+
+ // GetPropertyIP4Config gets the IP4Config of the connection.
+ GetPropertyIP4Config() (IP4Config, error)
+
+ // GetPropertyDHCP4Config gets the DHCP6Config of the connection.
+ GetPropertyDHCP4Config() (DHCP4Config, error)
+
+ // GetPropertyDefault6 gets the default IPv6 flag of the connection.
+ GetPropertyDefault6() (bool, error)
+
+ // GetPropertyIP6Config gets the IP6Config of the connection.
+ GetPropertyIP6Config() (IP6Config, error)
+
+ // GetPropertyDHCP6Config gets the DHCP4Config of the connection.
+ GetPropertyDHCP6Config() (DHCP6Config, error)
+
+ // GetPropertyVPN gets the VPN flag of the connection.
+ GetPropertyVPN() (bool, error)
+
+ // GetPropertyMaster gets the master device of the connection.
+ GetPropertyMaster() (Device, error)
+
+ SubscribeState(receiver chan StateChange, exit chan struct{}) (err error)
+}
+
+func NewActiveConnection(objectPath dbus.ObjectPath) (ActiveConnection, error) {
+ var a activeConnection
+ return &a, a.init(NetworkManagerInterface, objectPath)
+}
+
+type activeConnection struct {
+ dbusBase
+}
+
+func (a *activeConnection) GetPath() dbus.ObjectPath {
+ return a.obj.Path()
+}
+
+func (a *activeConnection) GetPropertyConnection() (Connection, error) {
+ path, err := a.getObjectProperty(ActiveConnectionPropertyConnection)
+ if err != nil {
+ return nil, err
+ }
+ con, err := NewConnection(path)
+ if err != nil {
+ return nil, err
+ }
+ return con, nil
+}
+
+func (a *activeConnection) GetPropertySpecificObject() (AccessPoint, error) {
+ path, err := a.getObjectProperty(ActiveConnectionPropertySpecificObject)
+ if err != nil {
+ return nil, err
+ }
+ ap, err := NewAccessPoint(path)
+ if err != nil {
+ return nil, err
+ }
+ return ap, nil
+}
+
+func (a *activeConnection) GetPropertyID() (string, error) {
+ return a.getStringProperty(ActiveConnectionPropertyId)
+}
+
+func (a *activeConnection) GetPropertyUUID() (string, error) {
+ return a.getStringProperty(ActiveConnectionPropertyUuid)
+}
+
+func (a *activeConnection) GetPropertyType() (string, error) {
+ return a.getStringProperty(ActiveConnectionPropertyType)
+}
+
+func (a *activeConnection) GetPropertyDevices() ([]Device, error) {
+ paths, err := a.getSliceObjectProperty(ActiveConnectionPropertyDevices)
+ if err != nil {
+ return nil, err
+ }
+ devices := make([]Device, len(paths))
+ for i, path := range paths {
+ devices[i], err = DeviceFactory(path)
+ if err != nil {
+ return nil, err
+ }
+ }
+ return devices, nil
+}
+func (a *activeConnection) GetPropertyState() (NmActiveConnectionState, error) {
+ v, err := a.getUint32Property(ActiveConnectionPropertyState)
+ return NmActiveConnectionState(v), err
+}
+
+func (a *activeConnection) GetPropertyStateFlags() (uint32, error) {
+ return a.getUint32Property(ActiveConnectionPropertyStateFlags)
+}
+
+func (a *activeConnection) GetPropertyDefault() (bool, error) {
+ b, err := a.getProperty(ActiveConnectionPropertyDefault)
+ if err != nil {
+ return false, err
+ }
+ return b.(bool), nil
+}
+
+func (a *activeConnection) GetPropertyIP4Config() (IP4Config, error) {
+ path, err := a.getObjectProperty(ActiveConnectionPropertyIp4Config)
+ if err != nil || path == "/" {
+ return nil, err
+ }
+ return NewIP4Config(path)
+}
+
+func (a *activeConnection) GetPropertyDHCP4Config() (DHCP4Config, error) {
+ path, err := a.getObjectProperty(ActiveConnectionPropertyDhcp4Config)
+ if err != nil || path == "/" {
+ return nil, err
+ }
+ return NewDHCP4Config(path)
+}
+
+func (a *activeConnection) GetPropertyDefault6() (bool, error) {
+ return a.getBoolProperty(ActiveConnectionPropertyDefault6)
+}
+
+func (a *activeConnection) GetPropertyIP6Config() (IP6Config, error) {
+ path, err := a.getObjectProperty(ActiveConnectionPropertyIp6Config)
+ if err != nil || path == "/" {
+ return nil, err
+ }
+
+ return NewIP6Config(path)
+}
+
+func (a *activeConnection) GetPropertyDHCP6Config() (DHCP6Config, error) {
+ path, err := a.getObjectProperty(ActiveConnectionPropertyDhcp6Config)
+ if err != nil || path == "/" {
+ return nil, err
+ }
+
+ return NewDHCP6Config(path)
+}
+
+func (a *activeConnection) GetPropertyVPN() (bool, error) {
+ ret, err := a.getProperty(ActiveConnectionPropertyVpn)
+ if err != nil {
+ return false, err
+ }
+ return ret.(bool), nil
+}
+
+func (a *activeConnection) GetPropertyMaster() (Device, error) {
+ path, err := a.getObjectProperty(ActiveConnectionPropertyMaster)
+ if err != nil || path == "/" {
+ return nil, err
+ }
+ return DeviceFactory(path)
+}
+
+type StateChange struct {
+ Path dbus.ObjectPath
+ State NmActiveConnectionState
+ Reason NmActiveConnectionStateReason
+}
+
+func (a *activeConnection) SubscribeState(receiver chan StateChange, exit chan struct{}) (err error) {
+
+ channel := make(chan *dbus.Signal, 1)
+
+ a.conn.Signal(channel)
+
+ err = a.conn.AddMatchSignal(
+ dbus.WithMatchInterface(ActiveConnectionInterface),
+ dbus.WithMatchMember(ActiveConnectionSignalStateChanged),
+ dbus.WithMatchObjectPath(a.GetPath()),
+ )
+ if err != nil {
+ return err
+ }
+
+ go func() {
+ for {
+ select {
+ case signal, ok := <-channel:
+ if !ok {
+ err = fmt.Errorf("connection closed for %s", ActiveConnectionSignalStateChanged)
+ return
+ }
+
+ if signal.Name != ActiveConnectionInterface+"."+ActiveConnectionSignalStateChanged {
+ continue
+ }
+
+ stateChange := StateChange{
+ Path: signal.Path,
+ State: NmActiveConnectionState(signal.Body[0].(uint32)),
+ Reason: NmActiveConnectionStateReason(signal.Body[1].(uint32)),
+ }
+
+ receiver <- stateChange
+
+ case <-exit:
+ a.conn.RemoveSignal(channel)
+ close(channel)
+ return
+ }
+ }
+ }()
+
+ return
+}
diff --git a/archive/vendor/github.com/Wifx/gonetworkmanager/v2/CHANGELOG.md b/archive/vendor/github.com/Wifx/gonetworkmanager/v2/CHANGELOG.md
new file mode 100644
index 0000000..fa24062
--- /dev/null
+++ b/archive/vendor/github.com/Wifx/gonetworkmanager/v2/CHANGELOG.md
@@ -0,0 +1,85 @@
+# Changelog
+
+All notable changes to this project since will be documented in this file.
+
+The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
+and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+
+## [2.1.0] - 2023-01-19
+
+### Added
+
+- Add device auto-connect setter
+
+### Fixed
+
+- Connection settings route and address data types
+
+## [2.0.0] - 2022-11-22
+
+### Changes
+
+- Update go-dbus to v5.1.0
+- **BREAKING CHANGE** : Generic recursive settings map dbus variants decoding
+
+## [0.5.0] - 2022-11-22
+
+### Added
+
+- Godoc standard comment prefix
+- DnsManager
+- Device: GetIp4Connectivity
+- Constants for Nm80211APSec
+- Add gitignore
+
+### Fixed
+
+- CheckpointCreate: fix devicePaths variable scope
+
+## [0.4.0] - 2022-01-17
+
+### Added
+
+- AccessPoint: add LastSeen property
+
+### Changed
+
+- Examples: move examples to their own subfolders
+
+### Fixed
+
+- DeviceWireless: remove duplicated fields
+- PrimaryConnection: use ActiveConnection type
+- SubscribeState: add the path to the recieved chan type, catch connect event for ActiveConnection
+
+## [0.3.0] - 2020-03-26
+
+### Added
+
+- SetPropertyManaged (@joseffilzmaier)
+- GetConnectionByUUID (@paulburlumi)
+- VpnConnection
+- ActiveConnectionSignalStateChanged
+- CheckpointRollback
+- SetPropertyWirelessEnabled (@Raqbit)
+- Settings.ReloadConnections (@appnostic-io)
+
+Static connection example (@everactivemilligan)
+
+### Fixed
+
+- GetPropertyRouteData panic (@zhengdelun)
+
+## [0.2.0] - 2020-03-06
+
+### Fixed
+
+- added missing flag for Reload
+- added parameter specific_object for AddAndActivateConnection
+- Fix CheckpointCreateand GetPropertyCheckpoints
+
+### Added
+
+- Add property setter helper
+- Add Device.SetPropertyRefreshRateMs
+- Add Device.Reapply
\ No newline at end of file
diff --git a/archive/vendor/github.com/Wifx/gonetworkmanager/v2/Checkpoint.go b/archive/vendor/github.com/Wifx/gonetworkmanager/v2/Checkpoint.go
new file mode 100644
index 0000000..be60d27
--- /dev/null
+++ b/archive/vendor/github.com/Wifx/gonetworkmanager/v2/Checkpoint.go
@@ -0,0 +1,79 @@
+package gonetworkmanager
+
+import (
+ "encoding/json"
+
+ "github.com/godbus/dbus/v5"
+)
+
+const (
+ CheckpointInterface = NetworkManagerInterface + ".Checkpoint"
+
+ /* Properties */
+ CheckpointPropertyDevices = CheckpointInterface + ".Devices" // readable ao
+ CheckpointPropertyCreated = CheckpointInterface + ".Created" // readable x
+ CheckpointPropertyRollbackTimeout = CheckpointInterface + ".RollbackTimeout" // readable u
+)
+
+type Checkpoint interface {
+ GetPath() dbus.ObjectPath
+
+ // GetPropertyDevices Array of object paths for devices which are part of this checkpoint.
+ GetPropertyDevices() ([]Device, error)
+
+ // GetPropertyCreated The timestamp (in CLOCK_BOOTTIME milliseconds) of checkpoint creation.
+ GetPropertyCreated() (int64, error)
+
+ // GetPropertyRollbackTimeout Timeout in seconds for automatic rollback, or zero.
+ GetPropertyRollbackTimeout() (uint32, error)
+
+ MarshalJSON() ([]byte, error)
+}
+
+func NewCheckpoint(objectPath dbus.ObjectPath) (Checkpoint, error) {
+ var c checkpoint
+ return &c, c.init(NetworkManagerInterface, objectPath)
+}
+
+type checkpoint struct {
+ dbusBase
+}
+
+func (c *checkpoint) GetPropertyDevices() ([]Device, error) {
+ devicesPaths, err := c.getSliceObjectProperty(CheckpointPropertyDevices)
+ if err != nil {
+ return nil, err
+ }
+
+ devices := make([]Device, len(devicesPaths))
+ for i, path := range devicesPaths {
+ devices[i], err = NewDevice(path)
+ if err != nil {
+ return devices, err
+ }
+ }
+
+ return devices, nil
+}
+
+func (c *checkpoint) GetPropertyCreated() (int64, error) {
+ return c.getInt64Property(CheckpointPropertyCreated)
+}
+
+func (c *checkpoint) GetPropertyRollbackTimeout() (uint32, error) {
+ return c.getUint32Property(CheckpointPropertyRollbackTimeout)
+}
+
+func (c *checkpoint) GetPath() dbus.ObjectPath {
+ return c.obj.Path()
+}
+
+func (c *checkpoint) MarshalJSON() ([]byte, error) {
+ m := make(map[string]interface{})
+
+ m["Devices"], _ = c.GetPropertyDevices()
+ m["Created"], _ = c.GetPropertyCreated()
+ m["RollbackTimeout"], _ = c.GetPropertyRollbackTimeout()
+
+ return json.Marshal(m)
+}
diff --git a/archive/vendor/github.com/Wifx/gonetworkmanager/v2/Connection.go b/archive/vendor/github.com/Wifx/gonetworkmanager/v2/Connection.go
new file mode 100644
index 0000000..8687703
--- /dev/null
+++ b/archive/vendor/github.com/Wifx/gonetworkmanager/v2/Connection.go
@@ -0,0 +1,184 @@
+package gonetworkmanager
+
+import (
+ "encoding/json"
+ "github.com/godbus/dbus/v5"
+)
+
+const (
+ ConnectionInterface = SettingsInterface + ".Connection"
+
+ /* Methods */
+ ConnectionUpdate = ConnectionInterface + ".Update"
+ ConnectionUpdateUnsaved = ConnectionInterface + ".UpdateUnsaved"
+ ConnectionDelete = ConnectionInterface + ".Delete"
+ ConnectionGetSettings = ConnectionInterface + ".GetSettings"
+ ConnectionGetSecrets = ConnectionInterface + ".GetSecrets"
+ ConnectionClearSecrets = ConnectionInterface + ".ClearSecrets"
+ ConnectionSave = ConnectionInterface + ".Save"
+ ConnectionUpdate2 = ConnectionInterface + ".Update2"
+
+ /* Properties */
+ ConnectionPropertyUnsaved = ConnectionInterface + ".Unsaved" // readable b
+ ConnectionPropertyFlags = ConnectionInterface + ".Flags" // readable u
+ ConnectionPropertyFilename = ConnectionInterface + ".Filename" // readable s
+)
+
+//type ConnectionSettings map[string]map[string]interface{}
+type ConnectionSettings map[string]map[string]interface{}
+
+type Connection interface {
+ GetPath() dbus.ObjectPath
+
+ // Update the connection with new settings and properties (replacing all previous settings and properties) and save the connection to disk. Secrets may be part of the update request, and will be either stored in persistent storage or sent to a Secret Agent for storage, depending on the flags associated with each secret.
+ Update(settings ConnectionSettings) error
+
+ // UpdateUnsaved Update the connection with new settings and properties (replacing all previous settings and properties) but do not immediately save the connection to disk. Secrets may be part of the update request and may sent to a Secret Agent for storage, depending on the flags associated with each secret. Use the 'Save' method to save these changes to disk. Note that unsaved changes will be lost if the connection is reloaded from disk (either automatically on file change or due to an explicit ReloadConnections call).
+ UpdateUnsaved(settings ConnectionSettings) error
+
+ // Delete the connection.
+ Delete() error
+
+ // GetSettings gets the settings maps describing this network configuration.
+ // This will never include any secrets required for connection to the
+ // network, as those are often protected. Secrets must be requested
+ // separately using the GetSecrets() method.
+ GetSettings() (ConnectionSettings, error)
+
+ // GetSecrets Get the secrets belonging to this network configuration. Only secrets from
+ // persistent storage or a Secret Agent running in the requestor's session
+ // will be returned. The user will never be prompted for secrets as a result
+ // of this request.
+ GetSecrets(settingName string) (ConnectionSettings, error)
+
+ // ClearSecrets Clear the secrets belonging to this network connection profile.
+ ClearSecrets() error
+
+ // Save a "dirty" connection (that had previously been updated with UpdateUnsaved) to persistent storage.
+ Save() error
+
+ // GetPropertyUnsaved If set, indicates that the in-memory state of the connection does not match the on-disk state. This flag will be set when UpdateUnsaved() is called or when any connection details change, and cleared when the connection is saved to disk via Save() or from internal operations.
+ GetPropertyUnsaved() (bool, error)
+
+ // GetPropertyFlags Additional flags of the connection profile.
+ GetPropertyFlags() (uint32, error)
+
+ // GetPropertyFilename File that stores the connection in case the connection is file-backed.
+ GetPropertyFilename() (string, error)
+
+ MarshalJSON() ([]byte, error)
+}
+
+func NewConnection(objectPath dbus.ObjectPath) (Connection, error) {
+ var c connection
+ return &c, c.init(NetworkManagerInterface, objectPath)
+}
+
+type connection struct {
+ dbusBase
+}
+
+func (c *connection) GetPath() dbus.ObjectPath {
+ return c.obj.Path()
+}
+
+func (c *connection) Update(settings ConnectionSettings) error {
+ return c.call(ConnectionUpdate, settings)
+}
+
+func (c *connection) UpdateUnsaved(settings ConnectionSettings) error {
+ return c.call(ConnectionUpdateUnsaved, settings)
+}
+
+func (c *connection) Delete() error {
+ return c.call(ConnectionDelete)
+}
+
+func (c *connection) GetSettings() (ConnectionSettings, error) {
+ var settings map[string]map[string]dbus.Variant
+
+ if err := c.callWithReturn(&settings, ConnectionGetSettings); err != nil {
+ return nil, err
+ }
+
+ return decodeSettings(settings), nil
+}
+
+func (c *connection) GetSecrets(settingName string) (ConnectionSettings, error) {
+ var settings map[string]map[string]dbus.Variant
+
+ if err := c.callWithReturn(&settings, ConnectionGetSecrets, settingName); err != nil {
+ return nil, err
+ }
+
+ return decodeSettings(settings), nil
+}
+
+func decodeSettings(input map[string]map[string]dbus.Variant) (settings ConnectionSettings) {
+ valueMap := ConnectionSettings{}
+ for key, data := range input {
+ valueMap[key] = decode(data).(map[string]interface{})
+ }
+ return valueMap
+}
+
+func decode(input interface{}) (value interface{}) {
+ if variant, isVariant := input.(dbus.Variant); isVariant {
+ return decode(variant.Value())
+ } else if inputMap, isMap := input.(map[string]dbus.Variant); isMap {
+ return decodeMap(inputMap)
+ } else if inputArray, isArray := input.([]dbus.Variant); isArray {
+ return decodeArray(inputArray)
+ } else if inputArray, isArray := input.([]map[string]dbus.Variant); isArray {
+ return decodeMapArray(inputArray)
+ } else {
+ return input
+ }
+}
+
+func decodeArray(input []dbus.Variant) (value []interface{}) {
+ for _, data := range input {
+ value = append(value, decode(data))
+ }
+ return
+}
+
+func decodeMapArray(input []map[string]dbus.Variant) (value []map[string]interface{}) {
+ for _, data := range input {
+ value = append(value, decodeMap(data))
+ }
+ return
+}
+
+func decodeMap(input map[string]dbus.Variant) (value map[string]interface{}) {
+ value = map[string]interface{}{}
+ for key, data := range input {
+ value[key] = decode(data)
+ }
+ return
+}
+
+func (c *connection) ClearSecrets() error {
+ return c.call(ConnectionClearSecrets)
+}
+
+func (c *connection) Save() error {
+ return c.call(ConnectionSave)
+}
+
+func (c *connection) GetPropertyUnsaved() (bool, error) {
+ return c.getBoolProperty(ConnectionPropertyUnsaved)
+}
+
+func (c *connection) GetPropertyFlags() (uint32, error) {
+ return c.getUint32Property(ConnectionPropertyFlags)
+}
+
+func (c *connection) GetPropertyFilename() (string, error) {
+ return c.getStringProperty(ConnectionPropertyFilename)
+}
+
+func (c *connection) MarshalJSON() ([]byte, error) {
+ s, _ := c.GetSettings()
+ return json.Marshal(s)
+}
diff --git a/archive/vendor/github.com/Wifx/gonetworkmanager/v2/DHCP4Config.go b/archive/vendor/github.com/Wifx/gonetworkmanager/v2/DHCP4Config.go
new file mode 100644
index 0000000..e849c01
--- /dev/null
+++ b/archive/vendor/github.com/Wifx/gonetworkmanager/v2/DHCP4Config.go
@@ -0,0 +1,56 @@
+package gonetworkmanager
+
+import (
+ "encoding/json"
+
+ "github.com/godbus/dbus/v5"
+)
+
+const (
+ DHCP4ConfigInterface = NetworkManagerInterface + ".DHCP4Config"
+
+ // Properties
+ DHCP4ConfigPropertyOptions = DHCP4ConfigInterface + ".Options"
+)
+
+type DHCP4Options map[string]interface{}
+
+type DHCP4Config interface {
+ // GetPropertyOptions GetOptions gets options map of configuration returned by the IPv4 DHCP server.
+ GetPropertyOptions() (DHCP4Options, error)
+
+ MarshalJSON() ([]byte, error)
+}
+
+func NewDHCP4Config(objectPath dbus.ObjectPath) (DHCP4Config, error) {
+ var c dhcp4Config
+ return &c, c.init(NetworkManagerInterface, objectPath)
+}
+
+type dhcp4Config struct {
+ dbusBase
+}
+
+func (c *dhcp4Config) GetPropertyOptions() (DHCP4Options, error) {
+ options, err := c.getMapStringVariantProperty(DHCP4ConfigPropertyOptions)
+ rv := make(DHCP4Options)
+ if err != nil {
+ return rv, err
+ }
+
+ for k, v := range options {
+ rv[k] = v.Value()
+ }
+
+ return rv, nil
+}
+
+func (c *dhcp4Config) MarshalJSON() ([]byte, error) {
+ Options, err := c.GetPropertyOptions()
+ if err != nil {
+ return nil, err
+ }
+ return json.Marshal(map[string]interface{}{
+ "Options": Options,
+ })
+}
diff --git a/archive/vendor/github.com/Wifx/gonetworkmanager/v2/DHCP6Config.go b/archive/vendor/github.com/Wifx/gonetworkmanager/v2/DHCP6Config.go
new file mode 100644
index 0000000..6e40137
--- /dev/null
+++ b/archive/vendor/github.com/Wifx/gonetworkmanager/v2/DHCP6Config.go
@@ -0,0 +1,54 @@
+package gonetworkmanager
+
+import (
+ "encoding/json"
+
+ "github.com/godbus/dbus/v5"
+)
+
+const (
+ DHCP6ConfigInterface = NetworkManagerInterface + ".DHCP6Config"
+
+ // Properties
+ DHCP6ConfigPropertyOptions = DHCP6ConfigInterface + ".Options"
+)
+
+type DHCP6Options map[string]interface{}
+
+type DHCP6Config interface {
+ // GetPropertyOptions GetOptions gets options map of configuration returned by the IPv4 DHCP server.
+ GetPropertyOptions() (DHCP6Options, error)
+
+ MarshalJSON() ([]byte, error)
+}
+
+func NewDHCP6Config(objectPath dbus.ObjectPath) (DHCP6Config, error) {
+ var c dhcp6Config
+ return &c, c.init(NetworkManagerInterface, objectPath)
+}
+
+type dhcp6Config struct {
+ dbusBase
+}
+
+func (c *dhcp6Config) GetPropertyOptions() (DHCP6Options, error) {
+ options, err := c.getMapStringVariantProperty(DHCP6ConfigPropertyOptions)
+ rv := make(DHCP6Options)
+
+ if err != nil {
+ return rv, err
+ }
+
+ for k, v := range options {
+ rv[k] = v.Value()
+ }
+
+ return rv, nil
+}
+
+func (c *dhcp6Config) MarshalJSON() ([]byte, error) {
+ m := make(map[string]interface{})
+ m["Options"], _ = c.GetPropertyOptions()
+
+ return json.Marshal(m)
+}
diff --git a/archive/vendor/github.com/Wifx/gonetworkmanager/v2/Device.go b/archive/vendor/github.com/Wifx/gonetworkmanager/v2/Device.go
new file mode 100644
index 0000000..1531cce
--- /dev/null
+++ b/archive/vendor/github.com/Wifx/gonetworkmanager/v2/Device.go
@@ -0,0 +1,434 @@
+package gonetworkmanager
+
+import (
+ "encoding/json"
+ "fmt"
+
+ "github.com/godbus/dbus/v5"
+)
+
+const (
+ DeviceInterface = NetworkManagerInterface + ".Device"
+
+ /* Methods */
+ DeviceReapply = DeviceInterface + ".Reapply"
+ DeviceGetAppliedConnection = DeviceInterface + ".GetAppliedConnection"
+ DeviceDisconnect = DeviceInterface + ".Disconnect"
+ DeviceDelete = DeviceInterface + ".Delete"
+
+ /* Properties */
+ DevicePropertyUdi = DeviceInterface + ".Udi" // readable s
+ DevicePropertyInterface = DeviceInterface + ".Interface" // readable s
+ DevicePropertyIpInterface = DeviceInterface + ".IpInterface" // readable s
+ DevicePropertyDriver = DeviceInterface + ".Driver" // readable s
+ DevicePropertyDriverVersion = DeviceInterface + ".DriverVersion" // readable s
+ DevicePropertyFirmwareVersion = DeviceInterface + ".FirmwareVersion" // readable s
+ DevicePropertyCapabilities = DeviceInterface + ".Capabilities" // readable u
+ DevicePropertyState = DeviceInterface + ".State" // readable u
+ DevicePropertyStateReason = DeviceInterface + ".StateReason" // readable (uu)
+ DevicePropertyActiveConnection = DeviceInterface + ".ActiveConnection" // readable o
+ DevicePropertyIp4Config = DeviceInterface + ".Ip4Config" // readable o
+ DevicePropertyDhcp4Config = DeviceInterface + ".Dhcp4Config" // readable o
+ DevicePropertyIp6Config = DeviceInterface + ".Ip6Config" // readable o
+ DevicePropertyDhcp6Config = DeviceInterface + ".Dhcp6Config" // readable o
+ DevicePropertyManaged = DeviceInterface + ".Managed" // readwrite b
+ DevicePropertyAutoconnect = DeviceInterface + ".Autoconnect" // readwrite b
+ DevicePropertyFirmwareMissing = DeviceInterface + ".FirmwareMissing" // readable b
+ DevicePropertyNmPluginMissing = DeviceInterface + ".NmPluginMissing" // readable b
+ DevicePropertyDeviceType = DeviceInterface + ".DeviceType" // readable u
+ DevicePropertyAvailableConnections = DeviceInterface + ".AvailableConnections" // readable ao
+ DevicePropertyPhysicalPortId = DeviceInterface + ".PhysicalPortId" // readable s
+ DevicePropertyMtu = DeviceInterface + ".Mtu" // readable u
+ DevicePropertyMetered = DeviceInterface + ".Metered" // readable u
+ DevicePropertyLldpNeighbors = DeviceInterface + ".LldpNeighbors" // readable aa{sv}
+ DevicePropertyReal = DeviceInterface + ".Real" // readable b
+ DevicePropertyIp4Connectivity = DeviceInterface + ".Ip4Connectivity" // readable u
+
+ /* Signals */
+ DeviceSignalStateChanged = "StateChanged" // u state, u reason
+
+)
+
+func DeviceFactory(objectPath dbus.ObjectPath) (Device, error) {
+ d, err := NewDevice(objectPath)
+ if err != nil {
+ return nil, err
+ }
+
+ deviceType, err := d.GetPropertyDeviceType()
+ if err != nil {
+ return nil, err
+ }
+
+ switch deviceType {
+ case NmDeviceTypeDummy:
+ return NewDeviceDummy(objectPath)
+ case NmDeviceTypeGeneric:
+ return NewDeviceGeneric(objectPath)
+ case NmDeviceTypeIpTunnel:
+ return NewDeviceIpTunnel(objectPath)
+ case NmDeviceTypeBridge:
+ return NewDeviceBridge(objectPath)
+ case NmDeviceTypeEthernet:
+ return NewDeviceWired(objectPath)
+ case NmDeviceTypeWifi:
+ return NewDeviceWireless(objectPath)
+ }
+
+ return d, nil
+}
+
+type Device interface {
+ GetPath() dbus.ObjectPath
+
+ // Reapply Attempts to update the configuration of a device without deactivating it. NetworkManager has the concept of connections, which are profiles that contain the configuration for a networking device. Those connections are exposed via D-Bus as individual objects that can be created, modified and deleted. When activating such a settings-connection on a device, the settings-connection is cloned to become an applied-connection and used to configure the device (see GetAppliedConnection). Subsequent modification of the settings-connection don't propagate automatically to the device's applied-connection (with exception of the firewall-zone and the metered property). For the changes to take effect, you can either re-activate the settings-connection, or call Reapply. The Reapply call allows you to directly update the applied-connection and reconfigure the device. Reapply can also be useful if the currently applied-connection is equal to the connection that is about to be reapplied. This allows to reconfigure the device and revert external changes like removing or adding an IP address (which NetworkManager doesn't revert automatically because it is assumed that the user made these changes intentionally outside of NetworkManager). Reapply can make the applied-connection different from the settings-connection, just like updating the settings-connection can make them different.
+ // connection: The optional connection settings that will be reapplied on the device. If empty, the currently active settings-connection will be used. The connection cannot arbitrarly differ from the current applied-connection otherwise the call will fail. Only certain changes are supported, like adding or removing IP addresses.
+ // versionId: If non-zero, the current version id of the applied-connection must match. The current version id can be retrieved via GetAppliedConnection. This optional argument allows to catch concurrent modifications between the GetAppliedConnection call and Reapply.
+ // flags: Flags which would modify the behavior of the Reapply call. There are no flags defined currently and the users should use the value of 0.
+ Reapply(connection Connection, versionId uint64, flags uint32) error
+
+ // Disconnect a device and prevents the device from automatically activating further connections without user intervention.
+ Disconnect() error
+
+ // Delete a software device from NetworkManager and removes the interface from the system. The method returns an error when called for a hardware device.
+ Delete() error
+
+ // GetPropertyUdi Operating-system specific transient device hardware identifier. This is an opaque string representing the underlying hardware for the device, and shouldn't be used to keep track of individual devices. For some device types (Bluetooth, Modems) it is an identifier used by the hardware service (ie bluez or ModemManager) to refer to that device, and client programs use it get additional information from those services which NM does not provide. The Udi is not guaranteed to be consistent across reboots or hotplugs of the hardware. If you're looking for a way to uniquely track each device in your application, use the object path. If you're looking for a way to track a specific piece of hardware across reboot or hotplug, use a MAC address or USB serial number.
+ GetPropertyUdi() (string, error)
+
+ // GetPropertyInterface The name of the device's control (and often data) interface. Note that non UTF-8 characters are backslash escaped, so the resulting name may be longer then 15 characters. Use g_strcompress() to revert the escaping.
+ GetPropertyInterface() (string, error)
+
+ // GetPropertyIpInterface The name of the device's data interface when available. This property may not refer to the actual data interface until the device has successfully established a data connection, indicated by the device's State becoming ACTIVATED. Note that non UTF-8 characters are backslash escaped, so the resulting name may be longer then 15 characters. Use g_strcompress() to revert the escaping.
+ GetPropertyIpInterface() (string, error)
+
+ // GetPropertyDriver The driver handling the device. Non-UTF-8 sequences are backslash escaped. Use g_strcompress() to revert.
+ GetPropertyDriver() (string, error)
+
+ // GetPropertyDriverVersion The version of the driver handling the device. Non-UTF-8 sequences are backslash escaped. Use g_strcompress() to revert.
+ GetPropertyDriverVersion() (string, error)
+
+ // GetPropertyFirmwareVersion The firmware version for the device. Non-UTF-8 sequences are backslash escaped. Use g_strcompress() to revert.
+ GetPropertyFirmwareVersion() (string, error)
+
+ // GetPropertyState The current state of the device.
+ GetPropertyState() (NmDeviceState, error)
+
+ // GetPropertyActiveConnection Object path of an ActiveConnection object that "owns" this device during activation. The ActiveConnection object tracks the life-cycle of a connection to a specific network and implements the org.freedesktop.NetworkManager.Connection.Active D-Bus interface.
+ GetPropertyActiveConnection() (ActiveConnection, error)
+
+ // GetPropertyIP4Config Object path of the Ip4Config object describing the configuration of the device. Only valid when the device is in the NM_DEVICE_STATE_ACTIVATED state.
+ GetPropertyIP4Config() (IP4Config, error)
+
+ // GetPropertyDHCP4Config Object path of the Dhcp4Config object describing the DHCP options returned by the DHCP server. Only valid when the device is in the NM_DEVICE_STATE_ACTIVATED state.
+ GetPropertyDHCP4Config() (DHCP4Config, error)
+
+ // GetPropertyIP6Config Object path of the Ip6Config object describing the configuration of the device. Only valid when the device is in the NM_DEVICE_STATE_ACTIVATED state.
+ GetPropertyIP6Config() (IP6Config, error)
+
+ // GetPropertyDHCP6Config Object path of the Dhcp6Config object describing the DHCP options returned by the DHCP server. Only valid when the device is in the NM_DEVICE_STATE_ACTIVATED state.
+ GetPropertyDHCP6Config() (DHCP6Config, error)
+
+ // GetPropertyManaged Whether this device is managed by NetworkManager. Setting this property has a similar effect to configuring the device as unmanaged via the keyfile.unmanaged-devices setting in NetworkManager.conf. Changes to this value are not persistent and lost after NetworkManager restart.
+ GetPropertyManaged() (bool, error)
+ SetPropertyManaged(bool) error
+
+ // GetPropertyAutoConnect If TRUE, indicates the device is allowed to autoconnect. If FALSE, manual intervention is required before the device will automatically connect to a known network, such as activating a connection using the device, or setting this property to TRUE. This property cannot be set to TRUE for default-unmanaged devices, since they never autoconnect.
+ GetPropertyAutoConnect() (bool, error)
+ SetPropertyAutoConnect(bool) error
+
+ // GetPropertyFirmwareMissing If TRUE, indicates the device is likely missing firmware necessary for its operation.
+ GetPropertyFirmwareMissing() (bool, error)
+
+ // GetPropertyNmPluginMissing If TRUE, indicates the NetworkManager plugin for the device is likely missing or misconfigured.
+ GetPropertyNmPluginMissing() (bool, error)
+
+ // GetPropertyDeviceType The general type of the network device; ie Ethernet, Wi-Fi, etc.
+ GetPropertyDeviceType() (NmDeviceType, error)
+
+ // GetPropertyAvailableConnections An array of object paths of every configured connection that is currently 'available' through this device.
+ GetPropertyAvailableConnections() ([]Connection, error)
+
+ // GetPropertyPhysicalPortId If non-empty, an (opaque) indicator of the physical network port associated with the device. This can be used to recognize when two seemingly-separate hardware devices are actually just different virtual interfaces to the same physical port.
+ GetPropertyPhysicalPortId() (string, error)
+
+ // GetPropertyMtu The device MTU (maximum transmission unit).
+ GetPropertyMtu() (uint32, error)
+
+ // GetPropertyReal True if the device exists, or False for placeholder devices that do not yet exist but could be automatically created by NetworkManager if one of their AvailableConnections was activated.
+ GetPropertyReal() (bool, error)
+
+ // The result of the last IPv4 connectivity check.
+ GetPropertyIp4Connectivity() (NmConnectivity, error)
+
+ SubscribeState(receiver chan DeviceStateChange, exit chan struct{}) (err error)
+
+ MarshalJSON() ([]byte, error)
+}
+
+func NewDevice(objectPath dbus.ObjectPath) (Device, error) {
+ var d device
+ return &d, d.init(NetworkManagerInterface, objectPath)
+}
+
+type device struct {
+ dbusBase
+}
+
+func (d *device) GetPath() dbus.ObjectPath {
+ return d.obj.Path()
+}
+
+func (d *device) Reapply(connection Connection, versionId uint64, flags uint32) error {
+ return d.call(DeviceReapply, connection, versionId, flags)
+}
+
+func (d *device) Disconnect() error {
+ return d.call(DeviceDisconnect)
+}
+
+func (d *device) Delete() error {
+ return d.call(DeviceDelete)
+}
+
+func (d *device) GetPropertyUdi() (string, error) {
+ return d.getStringProperty(DevicePropertyUdi)
+}
+
+func (d *device) GetPropertyInterface() (string, error) {
+ return d.getStringProperty(DevicePropertyInterface)
+}
+
+func (d *device) GetPropertyIpInterface() (string, error) {
+ return d.getStringProperty(DevicePropertyIpInterface)
+}
+
+func (d *device) GetPropertyDriver() (string, error) {
+ return d.getStringProperty(DevicePropertyDriver)
+}
+
+func (d *device) GetPropertyDriverVersion() (string, error) {
+ return d.getStringProperty(DevicePropertyDriverVersion)
+}
+
+func (d *device) GetPropertyFirmwareVersion() (string, error) {
+ return d.getStringProperty(DevicePropertyFirmwareVersion)
+}
+
+func (d *device) GetPropertyState() (NmDeviceState, error) {
+ r, err := d.getUint32Property(DevicePropertyState)
+ if err != nil {
+ return NmDeviceStateFailed, err
+ }
+ return NmDeviceState(r), nil
+}
+
+func (d *device) GetPropertyActiveConnection() (ActiveConnection, error) {
+ path, err := d.getObjectProperty(DevicePropertyActiveConnection)
+ if err != nil || path == "/" {
+ return nil, err
+ }
+
+ return NewActiveConnection(path)
+}
+
+func (d *device) GetPropertyIP4Config() (IP4Config, error) {
+ path, err := d.getObjectProperty(DevicePropertyIp4Config)
+ if err != nil || path == "/" {
+ return nil, err
+ }
+
+ return NewIP4Config(path)
+}
+
+func (d *device) GetPropertyDHCP4Config() (DHCP4Config, error) {
+ path, err := d.getObjectProperty(DevicePropertyDhcp4Config)
+ if err != nil || path == "/" {
+ return nil, err
+ }
+
+ return NewDHCP4Config(path)
+}
+
+func (d *device) GetPropertyIP6Config() (IP6Config, error) {
+ path, err := d.getObjectProperty(DevicePropertyIp6Config)
+ if err != nil || path == "/" {
+ return nil, err
+ }
+
+ return NewIP6Config(path)
+}
+
+func (d *device) GetPropertyDHCP6Config() (DHCP6Config, error) {
+ path, err := d.getObjectProperty(DevicePropertyDhcp6Config)
+ if err != nil || path == "/" {
+ return nil, err
+ }
+
+ return NewDHCP6Config(path)
+}
+
+func (d *device) GetPropertyManaged() (bool, error) {
+ return d.getBoolProperty(DevicePropertyManaged)
+}
+
+func (d *device) SetPropertyManaged(managed bool) error {
+ return d.setProperty(DevicePropertyManaged, managed)
+}
+
+func (d *device) GetPropertyAutoConnect() (bool, error) {
+ return d.getBoolProperty(DevicePropertyAutoconnect)
+}
+
+func (d *device) SetPropertyAutoConnect(managed bool) error {
+ return d.setProperty(DevicePropertyAutoconnect, managed)
+}
+
+func (d *device) GetPropertyFirmwareMissing() (bool, error) {
+ return d.getBoolProperty(DevicePropertyFirmwareMissing)
+}
+
+func (d *device) GetPropertyNmPluginMissing() (bool, error) {
+ return d.getBoolProperty(DevicePropertyNmPluginMissing)
+}
+
+func (d *device) GetPropertyDeviceType() (NmDeviceType, error) {
+ v, err := d.getUint32Property(DevicePropertyDeviceType)
+ return NmDeviceType(v), err
+}
+
+func (d *device) GetPropertyAvailableConnections() ([]Connection, error) {
+ connPaths, err := d.getSliceObjectProperty(DevicePropertyAvailableConnections)
+ if err != nil {
+ return nil, err
+ }
+
+ conns := make([]Connection, len(connPaths))
+ for i, path := range connPaths {
+ conns[i], err = NewConnection(path)
+ if err != nil {
+ return conns, err
+ }
+ }
+
+ return conns, nil
+}
+
+func (d *device) GetPropertyPhysicalPortId() (string, error) {
+ return d.getStringProperty(DevicePropertyPhysicalPortId)
+}
+
+func (d *device) GetPropertyMtu() (uint32, error) {
+ return d.getUint32Property(DevicePropertyMtu)
+}
+
+func (d *device) GetPropertyReal() (bool, error) {
+ return d.getBoolProperty(DevicePropertyReal)
+}
+
+func (d *device) GetPropertyIp4Connectivity() (NmConnectivity, error) {
+ u, err := d.getUint32Property(DevicePropertyIp4Connectivity)
+ return NmConnectivity(u), err
+}
+
+func (d *device) marshalMap() (map[string]interface{}, error) {
+ Interface, err := d.GetPropertyInterface()
+ if err != nil {
+ return nil, err
+ }
+ IpInterface, err := d.GetPropertyIpInterface()
+ if err != nil {
+ return nil, err
+ }
+ State, err := d.GetPropertyState()
+ if err != nil {
+ return nil, err
+ }
+ IP4Config, err := d.GetPropertyIP4Config()
+ if err != nil {
+ return nil, err
+ }
+ DHCP4Config, err := d.GetPropertyDHCP4Config()
+ if err != nil {
+ return nil, err
+ }
+ DeviceType, err := d.GetPropertyDeviceType()
+ if err != nil {
+ return nil, err
+ }
+ AvailableConnections, err := d.GetPropertyAvailableConnections()
+ if err != nil {
+ return nil, err
+ }
+
+ return map[string]interface{}{
+ "Interface": Interface,
+ "IP interface": IpInterface,
+ "State": State.String(),
+ "IP4Config": IP4Config,
+ "DHCP4Config": DHCP4Config,
+ "DeviceType": DeviceType.String(),
+ "AvailableConnections": AvailableConnections,
+ }, nil
+}
+
+type DeviceStateChange struct {
+ Path dbus.ObjectPath
+ State NmDeviceState
+ Reason NmDeviceStateReason
+}
+
+func (d *device) SubscribeState(receiver chan DeviceStateChange, exit chan struct{}) (err error) {
+
+ channel := make(chan *dbus.Signal, 1)
+
+ d.conn.Signal(channel)
+
+ err = d.conn.AddMatchSignal(
+ dbus.WithMatchInterface(DeviceInterface),
+ dbus.WithMatchMember(DeviceSignalStateChanged),
+ dbus.WithMatchObjectPath(d.GetPath()),
+ )
+ if err != nil {
+ return err
+ }
+
+ go func() {
+ for {
+ select {
+ case signal, ok := <-channel:
+ if !ok {
+ err = fmt.Errorf("connection closed for %s", DeviceSignalStateChanged)
+ return
+ }
+
+ if signal.Name != DeviceInterface+"."+DeviceSignalStateChanged {
+ continue
+ }
+
+ stateChange := DeviceStateChange{
+ Path: signal.Path,
+ State: NmDeviceState(signal.Body[0].(uint32)),
+ Reason: NmDeviceStateReason(signal.Body[1].(uint32)),
+ }
+
+ receiver <- stateChange
+
+ case <-exit:
+ d.conn.RemoveSignal(channel)
+ close(channel)
+ return
+ }
+ }
+ }()
+
+ return
+}
+
+func (d *device) MarshalJSON() ([]byte, error) {
+ m, err := d.marshalMap()
+ if err != nil {
+ return nil, err
+ }
+ return json.Marshal(m)
+}
diff --git a/archive/vendor/github.com/Wifx/gonetworkmanager/v2/DeviceBridge.go b/archive/vendor/github.com/Wifx/gonetworkmanager/v2/DeviceBridge.go
new file mode 100644
index 0000000..2a7d17b
--- /dev/null
+++ b/archive/vendor/github.com/Wifx/gonetworkmanager/v2/DeviceBridge.go
@@ -0,0 +1,75 @@
+package gonetworkmanager
+
+import (
+ "encoding/json"
+
+ "github.com/godbus/dbus/v5"
+)
+
+const (
+ DeviceBridgeInterface = DeviceInterface + ".Bridge"
+
+ // Properties
+ DeviceBridgePropertyHwAddress = DeviceBridgeInterface + ".HwAddress" // readable s
+ DeviceBridgePropertySlaves = DeviceBridgeInterface + ".Slaves" // readable as
+ DeviceBridgePropertyCarrier = DeviceBridgeInterface + ".Carrier" // readable b
+)
+
+type DeviceBridge interface {
+ Device
+
+ // GetPropertyHwAddress Active hardware address of the device.
+ GetPropertyHwAddress() (string, error)
+
+ // GetPropertySlaves Array of paths of enslaved and active devices.
+ // DEPRECATED. Use the "Ports" property in "org.freedesktop.NetworkManager.Device" instead which exists since version NetworkManager 1.34.0.
+ GetPropertySlaves() ([]Device, error)
+
+ // GetPropertyCarrier Indicates whether the physical carrier is found (e.g. whether a cable is plugged in or not).
+ // DEPRECATED: check for the "carrier" flag in the "InterfaceFlags" property on the "org.freedesktop.NetworkManager.Device" interface.
+ GetPropertyCarrier() (bool, error)
+}
+
+func NewDeviceBridge(objectPath dbus.ObjectPath) (DeviceBridge, error) {
+ var d deviceBridge
+ return &d, d.init(NetworkManagerInterface, objectPath)
+}
+
+type deviceBridge struct {
+ device
+}
+
+func (d *deviceBridge) GetPropertyHwAddress() (string, error) {
+ return d.getStringProperty(DeviceBridgePropertyHwAddress)
+}
+
+func (d *deviceBridge) GetPropertySlaves() ([]Device, error) {
+ paths, err := d.getSliceObjectProperty(DeviceBridgePropertySlaves)
+ if err != nil {
+ return nil, err
+ }
+ devices := make([]Device, len(paths))
+ for i, path := range paths {
+ devices[i], err = DeviceFactory(path)
+ if err != nil {
+ return nil, err
+ }
+ }
+ return devices, nil
+}
+
+func (d *deviceBridge) GetPropertyCarrier() (bool, error) {
+ return d.getBoolProperty(DeviceBridgePropertyCarrier)
+}
+
+func (d *deviceBridge) MarshalJSON() ([]byte, error) {
+ m, err := d.device.marshalMap()
+ if err != nil {
+ return nil, err
+ }
+
+ m["HwAddress"], _ = d.GetPropertyHwAddress()
+ m["Slaves"], _ = d.GetPropertySlaves()
+ m["Carrier"], _ = d.GetPropertyCarrier()
+ return json.Marshal(m)
+}
diff --git a/archive/vendor/github.com/Wifx/gonetworkmanager/v2/DeviceDummy.go b/archive/vendor/github.com/Wifx/gonetworkmanager/v2/DeviceDummy.go
new file mode 100644
index 0000000..c92a396
--- /dev/null
+++ b/archive/vendor/github.com/Wifx/gonetworkmanager/v2/DeviceDummy.go
@@ -0,0 +1,44 @@
+package gonetworkmanager
+
+import (
+ "encoding/json"
+
+ "github.com/godbus/dbus/v5"
+)
+
+const (
+ DeviceDummyInterface = DeviceInterface + ".Dummy"
+
+ /* Properties */
+ DeviceDummyPropertyHwAddress = DeviceDummyInterface + ".HwAddress" // readable s
+)
+
+type DeviceDummy interface {
+ Device
+
+ // Hardware address of the device.
+ GetPropertyHwAddress() (string, error)
+}
+
+func NewDeviceDummy(objectPath dbus.ObjectPath) (DeviceDummy, error) {
+ var d deviceDummy
+ return &d, d.init(NetworkManagerInterface, objectPath)
+}
+
+type deviceDummy struct {
+ device
+}
+
+func (d *deviceDummy) GetPropertyHwAddress() (string, error) {
+ return d.getStringProperty(DeviceDummyPropertyHwAddress)
+}
+
+func (d *deviceDummy) MarshalJSON() ([]byte, error) {
+ m, err := d.device.marshalMap()
+ if err != nil {
+ return nil, err
+ }
+
+ m["HwAddress"], _ = d.GetPropertyHwAddress()
+ return json.Marshal(m)
+}
diff --git a/archive/vendor/github.com/Wifx/gonetworkmanager/v2/DeviceGeneric.go b/archive/vendor/github.com/Wifx/gonetworkmanager/v2/DeviceGeneric.go
new file mode 100644
index 0000000..7e736bd
--- /dev/null
+++ b/archive/vendor/github.com/Wifx/gonetworkmanager/v2/DeviceGeneric.go
@@ -0,0 +1,53 @@
+package gonetworkmanager
+
+import (
+ "encoding/json"
+
+ "github.com/godbus/dbus/v5"
+)
+
+const (
+ DeviceGenericInterface = DeviceInterface + ".Generic"
+
+ // Properties
+ DeviceGenericPropertyHwAddress = DeviceGenericInterface + ".HwAddress" // readable s
+ DeviceGenericPropertyTypeDescription = DeviceGenericInterface + ".TypeDescription" // readable s
+)
+
+type DeviceGeneric interface {
+ Device
+
+ // GetPropertyHwAddress Active hardware address of the device.
+ GetPropertyHwAddress() (string, error)
+
+ // GetPropertyTypeDescription A (non-localized) description of the interface type, if known.
+ GetPropertyTypeDescription() (string, error)
+}
+
+func NewDeviceGeneric(objectPath dbus.ObjectPath) (DeviceGeneric, error) {
+ var d deviceGeneric
+ return &d, d.init(NetworkManagerInterface, objectPath)
+}
+
+type deviceGeneric struct {
+ device
+}
+
+func (d *deviceGeneric) GetPropertyHwAddress() (string, error) {
+ return d.getStringProperty(DeviceGenericPropertyHwAddress)
+}
+
+func (d *deviceGeneric) GetPropertyTypeDescription() (string, error) {
+ return d.getStringProperty(DeviceGenericPropertyTypeDescription)
+}
+
+func (d *deviceGeneric) MarshalJSON() ([]byte, error) {
+ m, err := d.device.marshalMap()
+ if err != nil {
+ return nil, err
+ }
+
+ m["HwAddress"], _ = d.GetPropertyHwAddress()
+ m["TypeDescription"], _ = d.GetPropertyTypeDescription()
+ return json.Marshal(m)
+}
diff --git a/archive/vendor/github.com/Wifx/gonetworkmanager/v2/DeviceIpTunnel.go b/archive/vendor/github.com/Wifx/gonetworkmanager/v2/DeviceIpTunnel.go
new file mode 100644
index 0000000..65f732b
--- /dev/null
+++ b/archive/vendor/github.com/Wifx/gonetworkmanager/v2/DeviceIpTunnel.go
@@ -0,0 +1,150 @@
+package gonetworkmanager
+
+import (
+ "encoding/json"
+
+ "github.com/godbus/dbus/v5"
+)
+
+const (
+ DeviceIpTunnelInterface = DeviceInterface + ".IPTunnel"
+
+ // Properties
+ DeviceIpTunnelPropertyHwAddress = DeviceIpTunnelInterface + "HwAddress" // readable s
+ DeviceIpTunnelPropertyMode = DeviceIpTunnelInterface + ".Mode" // readable u
+ DeviceIpTunnelPropertyParent = DeviceIpTunnelInterface + ".Parent" // readable o
+ DeviceIpTunnelPropertyLocal = DeviceIpTunnelInterface + ".Local" // readable s
+ DeviceIpTunnelPropertyRemote = DeviceIpTunnelInterface + ".Remote" // readable s
+ DeviceIpTunnelPropertyTtl = DeviceIpTunnelInterface + ".Ttl" // readable y
+ DeviceIpTunnelPropertyTos = DeviceIpTunnelInterface + ".Tos" // readable y
+ DeviceIpTunnelPropertyPathMtuDiscovery = DeviceIpTunnelInterface + ".PathMtuDiscovery" // readable b
+ DeviceIpTunnelPropertyInputKey = DeviceIpTunnelInterface + ".InputKey" // readable s
+ DeviceIpTunnelPropertyOutputKey = DeviceIpTunnelInterface + ".OutputKey" // readable s
+ DeviceIpTunnelPropertyEncapsulationLimit = DeviceIpTunnelInterface + ".EncapsulationLimit" // readable y
+ DeviceIpTunnelPropertyFlowLabel = DeviceIpTunnelInterface + ".FlowLabel" // readable u
+ DeviceIpTunnelPropertyFlags = DeviceIpTunnelInterface + ".Flags" // readable u
+
+)
+
+type DeviceIpTunnel interface {
+ Device
+
+ // GetPropertyMode The tunneling mode
+ GetPropertyMode() (uint32, error)
+
+ // GetPropertyParent The object path of the parent device.
+ GetPropertyParent() (Device, error)
+
+ // GetPropertyLocal The local endpoint of the tunnel.
+ GetPropertyLocal() (string, error)
+
+ // GetPropertyRemote The remote endpoint of the tunnel.
+ GetPropertyRemote() (string, error)
+
+ // GetPropertyTtl The TTL assigned to tunneled packets. 0 is a special value meaning that packets inherit the TTL value
+ GetPropertyTtl() (uint8, error)
+
+ // GetPropertyTos The type of service (IPv4) or traffic class (IPv6) assigned to tunneled packets.
+ GetPropertyTos() (uint8, error)
+
+ // GetPropertyPathMtuDiscovery Whether path MTU discovery is enabled on this tunnel.
+ GetPropertyPathMtuDiscovery() (bool, error)
+
+ // GetPropertyInputKey The key used for incoming packets.
+ GetPropertyInputKey() (string, error)
+
+ // GetPropertyOutputKey The key used for outgoing packets.
+ GetPropertyOutputKey() (string, error)
+
+ // GetPropertyEncapsulationLimit How many additional levels of encapsulation are permitted to be prepended to packets. This property applies only to IPv6 tunnels.
+ GetPropertyEncapsulationLimit() (uint8, error)
+
+ // GetPropertyFlowLabel The flow label to assign to tunnel packets. This property applies only to IPv6 tunnels.
+ GetPropertyFlowLabel() (uint32, error)
+
+ // GetPropertyFlags Tunnel flags.
+ GetPropertyFlags() (uint32, error)
+}
+
+func NewDeviceIpTunnel(objectPath dbus.ObjectPath) (DeviceIpTunnel, error) {
+ var d deviceIpTunnel
+ return &d, d.init(NetworkManagerInterface, objectPath)
+}
+
+type deviceIpTunnel struct {
+ device
+}
+
+func (d *deviceIpTunnel) GetPropertyMode() (uint32, error) {
+ return d.getUint32Property(DeviceIpTunnelPropertyMode)
+}
+
+func (d *deviceIpTunnel) GetPropertyParent() (Device, error) {
+ path, err := d.getObjectProperty(DeviceIpTunnelPropertyParent)
+ if err != nil || path == "/" {
+ return nil, err
+ }
+
+ return DeviceFactory(path)
+}
+
+func (d *deviceIpTunnel) GetPropertyLocal() (string, error) {
+ return d.getStringProperty(DeviceIpTunnelPropertyLocal)
+}
+
+func (d *deviceIpTunnel) GetPropertyRemote() (string, error) {
+ return d.getStringProperty(DeviceIpTunnelPropertyRemote)
+}
+
+func (d *deviceIpTunnel) GetPropertyTtl() (uint8, error) {
+ return d.getUint8Property(DeviceIpTunnelPropertyTtl)
+}
+
+func (d *deviceIpTunnel) GetPropertyTos() (uint8, error) {
+ return d.getUint8Property(DeviceIpTunnelPropertyTos)
+}
+
+func (d *deviceIpTunnel) GetPropertyPathMtuDiscovery() (bool, error) {
+ return d.getBoolProperty(DeviceIpTunnelPropertyPathMtuDiscovery)
+}
+
+func (d *deviceIpTunnel) GetPropertyInputKey() (string, error) {
+ return d.getStringProperty(DeviceIpTunnelPropertyInputKey)
+}
+
+func (d *deviceIpTunnel) GetPropertyOutputKey() (string, error) {
+ return d.getStringProperty(DeviceIpTunnelPropertyOutputKey)
+}
+
+func (d *deviceIpTunnel) GetPropertyEncapsulationLimit() (uint8, error) {
+ return d.getUint8Property(DeviceIpTunnelPropertyEncapsulationLimit)
+}
+
+func (d *deviceIpTunnel) GetPropertyFlowLabel() (uint32, error) {
+ return d.getUint32Property(DeviceIpTunnelPropertyFlowLabel)
+}
+
+func (d *deviceIpTunnel) GetPropertyFlags() (uint32, error) {
+ return d.getUint32Property(DeviceIpTunnelPropertyFlags)
+}
+
+func (d *deviceIpTunnel) MarshalJSON() ([]uint8, error) {
+ m, err := d.device.marshalMap()
+ if err != nil {
+ return nil, err
+ }
+
+ m["Mode"], _ = d.GetPropertyMode()
+ m["Parent"], _ = d.GetPropertyParent()
+ m["Local"], _ = d.GetPropertyLocal()
+ m["Remote"], _ = d.GetPropertyRemote()
+ m["Ttl"], _ = d.GetPropertyTtl()
+ m["Tos"], _ = d.GetPropertyTos()
+ m["PathMtuDiscovery"], _ = d.GetPropertyPathMtuDiscovery()
+ m["InputKey"], _ = d.GetPropertyInputKey()
+ m["OutputKey"], _ = d.GetPropertyOutputKey()
+ m["EncapsulationLimit"], _ = d.GetPropertyEncapsulationLimit()
+ m["FlowLabel"], _ = d.GetPropertyFlowLabel()
+ m["Flags"], _ = d.GetPropertyFlags()
+ return json.Marshal(m)
+}
diff --git a/archive/vendor/github.com/Wifx/gonetworkmanager/v2/DeviceStatistics.go b/archive/vendor/github.com/Wifx/gonetworkmanager/v2/DeviceStatistics.go
new file mode 100644
index 0000000..c72ab0a
--- /dev/null
+++ b/archive/vendor/github.com/Wifx/gonetworkmanager/v2/DeviceStatistics.go
@@ -0,0 +1,74 @@
+package gonetworkmanager
+
+import (
+ "encoding/json"
+
+ "github.com/godbus/dbus/v5"
+)
+
+const (
+ DeviceStatisticsInterface = DeviceInterface + ".Statistics"
+
+ // Properties
+ DeviceStatisticsPropertyRefreshRateMs = DeviceStatisticsInterface + ".RefreshRateMs" // readwrite u
+ DeviceStatisticsPropertyTxBytes = DeviceStatisticsInterface + ".TxBytes" // readable t
+ DeviceStatisticsPropertyRxBytes = DeviceStatisticsInterface + ".RxBytes" // readable t
+)
+
+type DeviceStatistics interface {
+ GetPath() dbus.ObjectPath
+
+ // GetPropertyRefreshRateMs Refresh rate of the rest of properties of this interface. The properties are guaranteed to be refreshed each RefreshRateMs milliseconds in case the underlying counter has changed too. If zero, there is no guaranteed refresh rate of the properties.
+ GetPropertyRefreshRateMs() (uint32, error)
+
+ SetPropertyRefreshRateMs(uint32) error
+
+ // GetPropertyTxBytes Number of transmitted bytes
+ GetPropertyTxBytes() (uint64, error)
+
+ // GetPropertyRxBytes Number of received bytes
+ GetPropertyRxBytes() (uint64, error)
+}
+
+func NewDeviceStatistics(objectPath dbus.ObjectPath) (DeviceStatistics, error) {
+ var d deviceStatistics
+ return &d, d.init(NetworkManagerInterface, objectPath)
+}
+
+type deviceStatistics struct {
+ dbusBase
+}
+
+func (d *deviceStatistics) GetPath() dbus.ObjectPath {
+ return d.obj.Path()
+}
+
+func (d *deviceStatistics) GetPropertyRefreshRateMs() (uint32, error) {
+ return d.getUint32Property(DeviceStatisticsPropertyRefreshRateMs)
+}
+
+func (d *deviceStatistics) SetPropertyRefreshRateMs(rate uint32) error {
+ return d.setProperty(DeviceStatisticsPropertyRefreshRateMs, rate)
+}
+
+func (d *deviceStatistics) GetPropertyTxBytes() (uint64, error) {
+ return d.getUint64Property(DeviceStatisticsPropertyTxBytes)
+}
+
+func (d *deviceStatistics) GetPropertyRxBytes() (uint64, error) {
+ return d.getUint64Property(DeviceStatisticsPropertyRxBytes)
+}
+
+func (d *deviceStatistics) marshalMap() map[string]interface{} {
+ return map[string]interface{}{}
+}
+
+func (d *deviceStatistics) MarshalJSON() ([]byte, error) {
+ m := make(map[string]interface{})
+
+ m["RefreshRateMs"], _ = d.GetPropertyRefreshRateMs()
+ m["TxBytes"], _ = d.GetPropertyTxBytes()
+ m["RxBytes"], _ = d.GetPropertyRxBytes()
+
+ return json.Marshal(m)
+}
diff --git a/archive/vendor/github.com/Wifx/gonetworkmanager/v2/DeviceWired.go b/archive/vendor/github.com/Wifx/gonetworkmanager/v2/DeviceWired.go
new file mode 100644
index 0000000..65e3d63
--- /dev/null
+++ b/archive/vendor/github.com/Wifx/gonetworkmanager/v2/DeviceWired.go
@@ -0,0 +1,80 @@
+package gonetworkmanager
+
+import (
+ "encoding/json"
+
+ "github.com/godbus/dbus/v5"
+)
+
+const (
+ DeviceWiredInterface = DeviceInterface + ".Wired"
+
+ // Properties
+ DeviceWiredPropertyHwAddress = DeviceWiredInterface + ".HwAddress" // readable s
+ DeviceWiredPropertyPermHwAddress = DeviceWiredInterface + ".PermHwAddress" // readable s
+ DeviceWiredPropertySpeed = DeviceWiredInterface + ".Speed" // readable u
+ DeviceWiredPropertyS390Subchannels = DeviceWiredInterface + ".S390Subchannels" // readable as
+ DeviceWiredPropertyCarrier = DeviceWiredInterface + ".Carrier" // readable b
+)
+
+type DeviceWired interface {
+ Device
+
+ // GetPropertyHwAddress Active hardware address of the device.
+ GetPropertyHwAddress() (string, error)
+
+ // GetPropertyPermHwAddress Permanent hardware address of the device.
+ GetPropertyPermHwAddress() (string, error)
+
+ // GetPropertySpeed Design speed of the device, in megabits/second (Mb/s).
+ GetPropertySpeed() (uint32, error)
+
+ // GetPropertyS390Subchannels Array of S/390 subchannels for S/390 or z/Architecture devices.
+ GetPropertyS390Subchannels() ([]string, error)
+
+ // GetPropertyCarrier Indicates whether the physical carrier is found (e.g. whether a cable is plugged in or not).
+ GetPropertyCarrier() (bool, error)
+}
+
+func NewDeviceWired(objectPath dbus.ObjectPath) (DeviceWired, error) {
+ var d deviceWired
+ return &d, d.init(NetworkManagerInterface, objectPath)
+}
+
+type deviceWired struct {
+ device
+}
+
+func (d *deviceWired) GetPropertyHwAddress() (string, error) {
+ return d.getStringProperty(DeviceWiredPropertyHwAddress)
+}
+
+func (d *deviceWired) GetPropertyPermHwAddress() (string, error) {
+ return d.getStringProperty(DeviceWiredPropertyPermHwAddress)
+}
+
+func (d *deviceWired) GetPropertySpeed() (uint32, error) {
+ return d.getUint32Property(DeviceWiredPropertySpeed)
+}
+
+func (d *deviceWired) GetPropertyS390Subchannels() ([]string, error) {
+ return d.getSliceStringProperty(DeviceWiredPropertyS390Subchannels)
+}
+
+func (d *deviceWired) GetPropertyCarrier() (bool, error) {
+ return d.getBoolProperty(DeviceWiredPropertyCarrier)
+}
+
+func (d *deviceWired) MarshalJSON() ([]byte, error) {
+ m, err := d.device.marshalMap()
+ if err != nil {
+ return nil, err
+ }
+
+ m["HwAddress"], _ = d.GetPropertyHwAddress()
+ m["PermHwAddress"], _ = d.GetPropertyPermHwAddress()
+ m["Speed"], _ = d.GetPropertySpeed()
+ m["S390Subchannels"], _ = d.GetPropertyS390Subchannels()
+ m["Carrier"], _ = d.GetPropertyCarrier()
+ return json.Marshal(m)
+}
diff --git a/archive/vendor/github.com/Wifx/gonetworkmanager/v2/DeviceWireless.go b/archive/vendor/github.com/Wifx/gonetworkmanager/v2/DeviceWireless.go
new file mode 100644
index 0000000..22977e5
--- /dev/null
+++ b/archive/vendor/github.com/Wifx/gonetworkmanager/v2/DeviceWireless.go
@@ -0,0 +1,193 @@
+package gonetworkmanager
+
+import (
+ "encoding/json"
+
+ "github.com/godbus/dbus/v5"
+)
+
+const (
+ DeviceWirelessInterface = DeviceInterface + ".Wireless"
+
+ // Methods
+ DeviceWirelessGetAccessPoints = DeviceWirelessInterface + ".GetAccessPoints"
+ DeviceWirelessGetAllAccessPoints = DeviceWirelessInterface + ".GetAllAccessPoints"
+ DeviceWirelessRequestScan = DeviceWirelessInterface + ".RequestScan"
+
+ // Properties
+ DeviceWirelessPropertyHwAddress = DeviceWirelessInterface + ".HwAddress" // readable s
+ DeviceWirelessPropertyPermHwAddress = DeviceWirelessInterface + ".PermHwAddress" // readable s
+ DeviceWirelessPropertyMode = DeviceWirelessInterface + ".Mode" // readable u
+ DeviceWirelessPropertyBitrate = DeviceWirelessInterface + ".Bitrate" // readable u
+ DeviceWirelessPropertyAccessPoints = DeviceWirelessInterface + ".AccessPoints" // readable ao
+ DeviceWirelessPropertyActiveAccessPoint = DeviceWirelessInterface + ".ActiveAccessPoint" // readable o
+ DeviceWirelessPropertyWirelessCapabilities = DeviceWirelessInterface + ".WirelessCapabilities" // readable u
+ DeviceWirelessPropertyLastScan = DeviceWirelessInterface + ".LastScan" // readable x
+)
+
+type DeviceWireless interface {
+ Device
+
+ // GetAccessPoints gets the list of access points visible to this device.
+ // Note that this list does not include access points which hide their SSID.
+ // To retrieve a list of all access points (including hidden ones) use the
+ // GetAllAccessPoints() method.
+ GetAccessPoints() ([]AccessPoint, error)
+
+ // GetAllAccessPoints gets the list of all access points visible to this
+ // device, including hidden ones for which the SSID is not yet known.
+ GetAllAccessPoints() ([]AccessPoint, error)
+
+ // RequestScan Request the device to scan. To know when the scan is finished, use the
+ // "PropertiesChanged" signal from "org.freedesktop.DBus.Properties" to listen
+ // to changes to the "LastScan" property.
+ RequestScan() error
+
+ // GetPropertyHwAddress The active hardware address of the device.
+ GetPropertyHwAddress() (string, error)
+
+ // GetPropertyPermHwAddress The permanent hardware address of the device.
+ GetPropertyPermHwAddress() (string, error)
+
+ // GetPropertyMode The operating mode of the wireless device.
+ GetPropertyMode() (Nm80211Mode, error)
+
+ // GetPropertyBitrate The bit rate currently used by the wireless device, in kilobits/second (Kb/s).
+ GetPropertyBitrate() (uint32, error)
+
+ // GetPropertyAccessPoints List of object paths of access point visible to this wireless device.
+ GetPropertyAccessPoints() ([]AccessPoint, error)
+
+ // GetPropertyActiveAccessPoint Object path of the access point currently used by the wireless device.
+ GetPropertyActiveAccessPoint() (AccessPoint, error)
+
+ // GetPropertyWirelessCapabilities The capabilities of the wireless device.
+ GetPropertyWirelessCapabilities() (uint32, error)
+
+ // GetPropertyLastScan The timestamp (in CLOCK_BOOTTIME milliseconds) for the last finished
+ // network scan. A value of -1 means the device never scanned for access
+ // points.
+ GetPropertyLastScan() (int64, error)
+}
+
+func NewDeviceWireless(objectPath dbus.ObjectPath) (DeviceWireless, error) {
+ var d deviceWireless
+ return &d, d.init(NetworkManagerInterface, objectPath)
+}
+
+type deviceWireless struct {
+ device
+}
+
+func (d *deviceWireless) GetAccessPoints() ([]AccessPoint, error) {
+ var apPaths []dbus.ObjectPath
+ err := d.callWithReturn(&apPaths, DeviceWirelessGetAccessPoints)
+
+ if err != nil {
+ return nil, err
+ }
+
+ aps := make([]AccessPoint, len(apPaths))
+
+ for i, path := range apPaths {
+ aps[i], err = NewAccessPoint(path)
+ if err != nil {
+ return aps, err
+ }
+ }
+
+ return aps, nil
+}
+
+func (d *deviceWireless) GetAllAccessPoints() ([]AccessPoint, error) {
+ var apPaths []dbus.ObjectPath
+ err := d.callWithReturn(&apPaths, DeviceWirelessGetAllAccessPoints)
+
+ if err != nil {
+ return nil, err
+ }
+
+ aps := make([]AccessPoint, len(apPaths))
+
+ for i, path := range apPaths {
+ aps[i], err = NewAccessPoint(path)
+ if err != nil {
+ return aps, err
+ }
+ }
+
+ return aps, nil
+}
+
+func (d *deviceWireless) RequestScan() error {
+ var options map[string]interface{}
+ return d.obj.Call(DeviceWirelessRequestScan, 0, options).Store()
+}
+
+func (d *deviceWireless) GetPropertyHwAddress() (string, error) {
+ return d.getStringProperty(DeviceWirelessPropertyHwAddress)
+}
+
+func (d *deviceWireless) GetPropertyPermHwAddress() (string, error) {
+ return d.getStringProperty(DeviceWirelessPropertyPermHwAddress)
+}
+
+func (d *deviceWireless) GetPropertyMode() (Nm80211Mode, error) {
+ v, err := d.getUint32Property(DeviceWirelessPropertyMode)
+ return Nm80211Mode(v), err
+}
+
+func (d *deviceWireless) GetPropertyBitrate() (uint32, error) {
+ return d.getUint32Property(DeviceWirelessPropertyBitrate)
+}
+
+func (d *deviceWireless) GetPropertyAccessPoints() ([]AccessPoint, error) {
+ apPaths, err := d.getSliceObjectProperty(DeviceWirelessPropertyAccessPoints)
+ if err != nil {
+ return nil, err
+ }
+
+ ap := make([]AccessPoint, len(apPaths))
+ for i, path := range apPaths {
+ ap[i], err = NewAccessPoint(path)
+ if err != nil {
+ return ap, err
+ }
+ }
+
+ return ap, nil
+}
+
+func (d *deviceWireless) GetPropertyActiveAccessPoint() (AccessPoint, error) {
+ path, err := d.getObjectProperty(DeviceWirelessPropertyActiveAccessPoint)
+ if err != nil || path == "/" {
+ return nil, err
+ }
+
+ return NewAccessPoint(path)
+}
+
+func (d *deviceWireless) GetPropertyWirelessCapabilities() (uint32, error) {
+ return d.getUint32Property(DeviceWirelessPropertyWirelessCapabilities)
+}
+
+func (d *deviceWireless) GetPropertyLastScan() (int64, error) {
+ return d.getInt64Property(DeviceWirelessPropertyLastScan)
+}
+
+func (d *deviceWireless) MarshalJSON() ([]byte, error) {
+ m, err := d.device.marshalMap()
+ if err != nil {
+ return nil, err
+ }
+
+ m["AccessPoints"], _ = d.GetPropertyAccessPoints()
+ m["HwAddress"], _ = d.GetPropertyHwAddress()
+ m["PermHwAddress"], _ = d.GetPropertyPermHwAddress()
+ m["Mode"], _ = d.GetPropertyMode()
+ m["Bitrate"], _ = d.GetPropertyBitrate()
+ m["ActiveAccessPoint"], _ = d.GetPropertyActiveAccessPoint()
+ m["WirelessCapabilities"], _ = d.GetPropertyWirelessCapabilities()
+ m["LastScan"], _ = d.GetPropertyLastScan()
+ return json.Marshal(m)
+}
diff --git a/archive/vendor/github.com/Wifx/gonetworkmanager/v2/DnsManager.go b/archive/vendor/github.com/Wifx/gonetworkmanager/v2/DnsManager.go
new file mode 100644
index 0000000..cbedfa5
--- /dev/null
+++ b/archive/vendor/github.com/Wifx/gonetworkmanager/v2/DnsManager.go
@@ -0,0 +1,96 @@
+package gonetworkmanager
+
+import (
+ "errors"
+
+ "github.com/godbus/dbus/v5"
+)
+
+const (
+ DnsManagerInterface = NetworkManagerInterface + ".DnsManager"
+ DnsManagerObjectPath = "/org/freedesktop/NetworkManager/DnsManager"
+
+ /* Property */
+ DnsManagerPropertyMode = DnsManagerInterface + ".Mode" // readable s
+ DnsManagerPropertyRcManager = DnsManagerInterface + ".RcManager" // readable s
+ DnsManagerPropertyConfiguration = DnsManagerInterface + ".Configuration" // readable aa{sv}
+)
+
+type DnsConfigurationData struct {
+ Nameservers []string
+ Priority int32
+ Interface string
+ Vpn bool
+}
+
+type DnsManager interface {
+ GetPath() dbus.ObjectPath
+ GetPropertyMode() (string, error)
+ GetPropertyRcManager() (string, error)
+ GetPropertyConfiguration() ([]DnsConfigurationData, error)
+}
+
+type dnsManager struct {
+ dbusBase
+}
+
+func NewDnsManager() (DnsManager, error) {
+ var d dnsManager
+ return &d, d.init(NetworkManagerInterface, DnsManagerObjectPath)
+}
+
+func (d *dnsManager) GetPath() dbus.ObjectPath {
+ return d.obj.Path()
+}
+
+func (d *dnsManager) GetPropertyMode() (string, error) {
+ return d.getStringProperty(DnsManagerPropertyMode)
+}
+
+func (d *dnsManager) GetPropertyRcManager() (string, error) {
+ return d.getStringProperty(DnsManagerPropertyRcManager)
+}
+
+func (d *dnsManager) GetPropertyConfiguration() ([]DnsConfigurationData, error) {
+ configurations, err := d.getSliceMapStringVariantProperty(DnsManagerPropertyConfiguration)
+ if err != nil {
+ return nil, err
+ }
+
+ ret := make([]DnsConfigurationData, len(configurations))
+ for i, conf := range configurations {
+ if serversVar, exist := conf["nameservers"]; exist {
+ servers, ok := serversVar.Value().([]string)
+ if !ok {
+ return nil, errors.New("unexpected variant type for nameservers")
+ }
+ ret[i].Nameservers = servers
+ }
+
+ if priorityVar, exist := conf["priority"]; exist {
+ priority, ok := priorityVar.Value().(int32)
+ if !ok {
+ return nil, errors.New("unexpected variant type for priority")
+ }
+ ret[i].Priority = priority
+ }
+
+ if interfaceVar, exist := conf["interface"]; exist {
+ iface, ok := interfaceVar.Value().(string)
+ if !ok {
+ return nil, errors.New("unexpected variant type for interface")
+ }
+ ret[i].Interface = iface
+ }
+
+ if vpnVar, exist := conf["vpn"]; exist {
+ vpn, ok := vpnVar.Value().(bool)
+ if !ok {
+ return nil, errors.New("unexpected variant type for vpn")
+ }
+ ret[i].Vpn = vpn
+ }
+ }
+
+ return ret, nil
+}
diff --git a/archive/vendor/github.com/Wifx/gonetworkmanager/v2/IP4Config.go b/archive/vendor/github.com/Wifx/gonetworkmanager/v2/IP4Config.go
new file mode 100644
index 0000000..2746f1a
--- /dev/null
+++ b/archive/vendor/github.com/Wifx/gonetworkmanager/v2/IP4Config.go
@@ -0,0 +1,321 @@
+package gonetworkmanager
+
+import (
+ "encoding/json"
+ "errors"
+
+ "github.com/godbus/dbus/v5"
+)
+
+const (
+ IP4ConfigInterface = NetworkManagerInterface + ".IP4Config"
+
+ /* Properties */
+ IP4ConfigPropertyAddresses = IP4ConfigInterface + ".Addresses" // readable aau
+ IP4ConfigPropertyAddressData = IP4ConfigInterface + ".AddressData" // readable aa{sv}
+ IP4ConfigPropertyGateway = IP4ConfigInterface + ".Gateway" // readable s
+ IP4ConfigPropertyRoutes = IP4ConfigInterface + ".Routes" // readable aau
+ IP4ConfigPropertyRouteData = IP4ConfigInterface + ".RouteData" // readable aa{sv}
+ IP4ConfigPropertyNameservers = IP4ConfigInterface + ".Nameservers" // readable au
+ IP4ConfigPropertyNameserverData = IP4ConfigInterface + ".NameserverData" // readable aa{sv}
+ IP4ConfigPropertyDomains = IP4ConfigInterface + ".Domains" // readable as
+ IP4ConfigPropertySearches = IP4ConfigInterface + ".Searches" // readable as
+ IP4ConfigPropertyDnsOptions = IP4ConfigInterface + ".DnsOptions" // readable as
+ IP4ConfigPropertyDnsPriority = IP4ConfigInterface + ".DnsPriority" // readable i
+ IP4ConfigPropertyWinsServers = IP4ConfigInterface + ".WinsServers" // readable au
+ IP4ConfigPropertyWinsServerData = IP4ConfigInterface + ".WinsServerData" // readable as
+)
+
+// Deprecated: use IP4AddressData instead
+type IP4Address struct {
+ Address string
+ Prefix uint8
+ Gateway string
+}
+
+type IP4AddressData struct {
+ Address string
+ Prefix uint8
+}
+
+// Deprecated: use IP4RouteData instead
+type IP4Route struct {
+ Route string
+ Prefix uint8
+ NextHop string
+ Metric uint8
+}
+
+type IP4RouteData struct {
+ Destination string
+ Prefix uint8
+ NextHop string
+ Metric uint8
+ AdditionalAttributes map[string]string
+}
+
+type IP4NameserverData struct {
+ Address string
+}
+
+type IP4Config interface {
+ // GetPropertyAddresses Array of arrays of IPv4 address/prefix/gateway. All 3 elements of each array are in network byte order. Essentially: [(addr, prefix, gateway), (addr, prefix, gateway), ...]
+ // Deprecated: use AddressData and Gateway
+ GetPropertyAddresses() ([]IP4Address, error)
+
+ // GetPropertyAddressData Array of IP address data objects. All addresses will include "address" (an IP address string), and "prefix" (a uint). Some addresses may include additional attributes.
+ GetPropertyAddressData() ([]IP4AddressData, error)
+
+ // GetPropertyGateway The gateway in use.
+ GetPropertyGateway() (string, error)
+
+ // GetPropertyRoutes Arrays of IPv4 route/prefix/next-hop/metric. All 4 elements of each tuple are in network byte order. 'route' and 'next hop' are IPv4 addresses, while prefix and metric are simple unsigned integers. Essentially: [(route, prefix, next-hop, metric), (route, prefix, next-hop, metric), ...]
+ // Deprecated: use RouteData
+ GetPropertyRoutes() ([]IP4Route, error)
+
+ // GetPropertyRouteData Array of IP route data objects. All routes will include "dest" (an IP address string) and "prefix" (a uint). Some routes may include "next-hop" (an IP address string), "metric" (a uint), and additional attributes.
+ GetPropertyRouteData() ([]IP4RouteData, error)
+
+ // GetPropertyNameservers The nameservers in use.
+ // Deprecated: use NameserverData
+ GetPropertyNameservers() ([]string, error)
+
+ // GetPropertyNameserverData The nameservers in use. Currently only the value "address" is recognized (with an IP address string).
+ GetPropertyNameserverData() ([]IP4NameserverData, error)
+
+ // GetPropertyDomains A list of domains this address belongs to.
+ GetPropertyDomains() ([]string, error)
+
+ // GetPropertySearches A list of dns searches.
+ GetPropertySearches() ([]string, error)
+
+ // GetPropertyDnsOptions A list of DNS options that modify the behavior of the DNS resolver. See resolv.conf(5) manual page for the list of supported options.
+ GetPropertyDnsOptions() ([]string, error)
+
+ // GetPropertyDnsPriority The relative priority of DNS servers.
+ GetPropertyDnsPriority() (uint32, error)
+
+ // GetPropertyWinsServerData The Windows Internet Name Service servers associated with the connection.
+ GetPropertyWinsServerData() ([]string, error)
+
+ MarshalJSON() ([]byte, error)
+}
+
+func NewIP4Config(objectPath dbus.ObjectPath) (IP4Config, error) {
+ var c ip4Config
+ return &c, c.init(NetworkManagerInterface, objectPath)
+}
+
+type ip4Config struct {
+ dbusBase
+}
+
+// Deprecated: use GetPropertyAddressData
+func (c *ip4Config) GetPropertyAddresses() ([]IP4Address, error) {
+ addresses, err := c.getSliceSliceUint32Property(IP4ConfigPropertyAddresses)
+ ret := make([]IP4Address, len(addresses))
+
+ if err != nil {
+ return ret, err
+ }
+
+ for i, parts := range addresses {
+ ret[i] = IP4Address{
+ Address: ip4ToString(parts[0]),
+ Prefix: uint8(parts[1]),
+ Gateway: ip4ToString(parts[2]),
+ }
+ }
+
+ return ret, nil
+}
+
+func (c *ip4Config) GetPropertyAddressData() ([]IP4AddressData, error) {
+ addresses, err := c.getSliceMapStringVariantProperty(IP4ConfigPropertyAddressData)
+ ret := make([]IP4AddressData, len(addresses))
+
+ if err != nil {
+ return ret, err
+ }
+
+ for i, address := range addresses {
+ prefix, ok := address["prefix"].Value().(uint32)
+ if !ok {
+ return ret, errors.New("unexpected variant type for address prefix")
+ }
+
+ address, ok := address["address"].Value().(string)
+ if !ok {
+ return ret, errors.New("unexpected variant type for address")
+ }
+
+ ret[i] = IP4AddressData{
+ Address: address,
+ Prefix: uint8(prefix),
+ }
+ }
+
+ return ret, nil
+}
+
+func (c *ip4Config) GetPropertyGateway() (string, error) {
+ return c.getStringProperty(IP4ConfigPropertyGateway)
+}
+
+// Deprecated: use GetPropertyRouteData
+func (c *ip4Config) GetPropertyRoutes() ([]IP4Route, error) {
+ routes, err := c.getSliceSliceUint32Property(IP4ConfigPropertyRoutes)
+ ret := make([]IP4Route, len(routes))
+
+ if err != nil {
+ return ret, err
+ }
+
+ for i, parts := range routes {
+ ret[i] = IP4Route{
+ Route: ip4ToString(parts[0]),
+ Prefix: uint8(parts[1]),
+ NextHop: ip4ToString(parts[2]),
+ Metric: uint8(parts[3]),
+ }
+ }
+
+ return ret, nil
+}
+
+func (c *ip4Config) GetPropertyRouteData() ([]IP4RouteData, error) {
+ routesData, err := c.getSliceMapStringVariantProperty(IP4ConfigPropertyRouteData)
+ routes := make([]IP4RouteData, len(routesData))
+
+ if err != nil {
+ return routes, err
+ }
+
+ for index, routeData := range routesData {
+
+ route := IP4RouteData{}
+
+ for routeDataAttributeName, routeDataAttribute := range routeData {
+ switch routeDataAttributeName {
+ case "dest":
+ destination, ok := routeDataAttribute.Value().(string)
+ if !ok {
+ return routes, errors.New("unexpected variant type for dest")
+ }
+ route.Destination = destination
+ case "prefix":
+ prefix, ok := routeDataAttribute.Value().(uint32)
+ if !ok {
+ return routes, errors.New("unexpected variant type for prefix")
+ }
+ route.Prefix = uint8(prefix)
+ case "next-hop":
+ nextHop, ok := routeDataAttribute.Value().(string)
+ if !ok {
+ return routes, errors.New("unexpected variant type for next-hop")
+ }
+ route.NextHop = nextHop
+ case "metric":
+ metric, ok := routeDataAttribute.Value().(uint32)
+ if !ok {
+ return routes, errors.New("unexpected variant type for metric")
+ }
+ route.Metric = uint8(metric)
+ default:
+ if route.AdditionalAttributes == nil {
+ route.AdditionalAttributes = make(map[string]string)
+ }
+ route.AdditionalAttributes[routeDataAttributeName] = routeDataAttribute.String()
+ }
+ }
+
+ routes[index] = route
+ }
+ return routes, nil
+}
+
+// Deprecated: use GetPropertyNameserverData
+func (c *ip4Config) GetPropertyNameservers() ([]string, error) {
+ nameservers, err := c.getSliceUint32Property(IP4ConfigPropertyNameservers)
+ ret := make([]string, len(nameservers))
+
+ if err != nil {
+ return ret, err
+ }
+
+ for i, ns := range nameservers {
+ ret[i] = ip4ToString(ns)
+ }
+
+ return ret, nil
+}
+
+func (c *ip4Config) GetPropertyNameserverData() ([]IP4NameserverData, error) {
+ nameserversData, err := c.getSliceMapStringVariantProperty(IP4ConfigPropertyNameserverData)
+ nameservers := make([]IP4NameserverData, 0, len(nameserversData))
+
+ if err != nil {
+ return nameservers, err
+ }
+
+ for _, nameserverData := range nameserversData {
+ address, ok := nameserverData["address"].Value().(string)
+
+ if !ok {
+ return nameservers, errors.New("unexpected variant type for address")
+ }
+
+ nameserver := IP4NameserverData{
+ Address: address,
+ }
+
+ nameservers = append(nameservers, nameserver)
+ }
+ return nameservers, nil
+}
+
+func (c *ip4Config) GetPropertyDomains() ([]string, error) {
+ return c.getSliceStringProperty(IP4ConfigPropertyDomains)
+}
+
+func (c *ip4Config) GetPropertySearches() ([]string, error) {
+ return c.getSliceStringProperty(IP4ConfigPropertySearches)
+}
+
+func (c *ip4Config) GetPropertyDnsOptions() ([]string, error) {
+ return c.getSliceStringProperty(IP4ConfigPropertyDnsOptions)
+}
+
+func (c *ip4Config) GetPropertyDnsPriority() (uint32, error) {
+ return c.getUint32Property(IP4ConfigPropertyDnsPriority)
+}
+
+func (c *ip4Config) GetPropertyWinsServerData() ([]string, error) {
+ return c.getSliceStringProperty(IP4ConfigPropertyWinsServerData)
+}
+
+func (c *ip4Config) MarshalJSON() ([]byte, error) {
+ Addresses, err := c.GetPropertyAddressData()
+ if err != nil {
+ return nil, err
+ }
+ Routes, err := c.GetPropertyRouteData()
+ if err != nil {
+ return nil, err
+ }
+ Nameservers, err := c.GetPropertyNameserverData()
+ if err != nil {
+ return nil, err
+ }
+ Domains, err := c.GetPropertyDomains()
+ if err != nil {
+ return nil, err
+ }
+
+ return json.Marshal(map[string]interface{}{
+ "Addresses": Addresses,
+ "Routes": Routes,
+ "Nameservers": Nameservers,
+ "Domains": Domains,
+ })
+}
diff --git a/archive/vendor/github.com/Wifx/gonetworkmanager/v2/IP6Config.go b/archive/vendor/github.com/Wifx/gonetworkmanager/v2/IP6Config.go
new file mode 100644
index 0000000..4d4cb63
--- /dev/null
+++ b/archive/vendor/github.com/Wifx/gonetworkmanager/v2/IP6Config.go
@@ -0,0 +1,215 @@
+package gonetworkmanager
+
+import (
+ "encoding/json"
+ "errors"
+
+ "github.com/godbus/dbus/v5"
+)
+
+const (
+ IP6ConfigInterface = NetworkManagerInterface + ".IP6Config"
+
+ /* Properties */
+ IP6ConfigPropertyAddresses = IP6ConfigInterface + ".Addresses" // readable a(ayuay)
+ IP6ConfigPropertyAddressData = IP6ConfigInterface + ".AddressData" // readable aa{sv}
+ IP6ConfigPropertyGateway = IP6ConfigInterface + ".Gateway" // readable s
+ IP6ConfigPropertyRoutes = IP6ConfigInterface + ".Routes" // readable a(ayuayu)
+ IP6ConfigPropertyRouteData = IP6ConfigInterface + ".RouteData" // readable aa{sv}
+ IP6ConfigPropertyNameservers = IP6ConfigInterface + ".Nameservers" // readable aay
+ IP6ConfigPropertyDomains = IP6ConfigInterface + ".Domains" // readable as
+ IP6ConfigPropertySearches = IP6ConfigInterface + ".Searches" // readable as
+ IP6ConfigPropertyDnsOptions = IP6ConfigInterface + ".DnsOptions" // readable as
+ IP6ConfigPropertyDnsPriority = IP6ConfigInterface + ".DnsPriority" // readable i
+)
+
+// Deprecated: use IP6AddressData instead
+type IP6Address struct {
+ Address string
+ Prefix uint8
+ Gateway string
+}
+
+type IP6AddressData struct {
+ Address string
+ Prefix uint8
+}
+
+// Deprecated: use IP6RouteData instead
+type IP6Route struct {
+ Route string
+ Prefix uint8
+ NextHop string
+ Metric uint8
+}
+
+type IP6RouteData struct {
+ Destination string
+ Prefix uint8
+ NextHop string
+ Metric uint8
+ AdditionalAttributes map[string]string
+}
+
+type IP6Config interface {
+
+ // GetPropertyAddressData Array of IP address data objects. All addresses will include "address" (an IP address string), and "prefix" (a uint). Some addresses may include additional attributes.
+ GetPropertyAddressData() ([]IP6AddressData, error)
+
+ // GetPropertyGateway The gateway in use.
+ GetPropertyGateway() (string, error)
+
+ // GetPropertyRouteData Array of IP route data objects. All routes will include "dest" (an IP address string) and "prefix" (a uint). Some routes may include "next-hop" (an IP address string), "metric" (a uint), and additional attributes.
+ GetPropertyRouteData() ([]IP6RouteData, error)
+
+ // GetPropertyNameservers GetNameservers gets the nameservers in use.
+ GetPropertyNameservers() ([][]byte, error)
+
+ // GetPropertyDomains A list of domains this address belongs to.
+ GetPropertyDomains() ([]string, error)
+
+ // GetPropertySearches A list of dns searches.
+ GetPropertySearches() ([]string, error)
+
+ // GetPropertyDnsOptions A list of DNS options that modify the behavior of the DNS resolver. See resolv.conf(5) manual page for the list of supported options.
+ GetPropertyDnsOptions() ([]string, error)
+
+ // GetPropertyDnsPriority The relative priority of DNS servers.
+ GetPropertyDnsPriority() (uint32, error)
+
+ MarshalJSON() ([]byte, error)
+}
+
+func NewIP6Config(objectPath dbus.ObjectPath) (IP6Config, error) {
+ var c ip6Config
+ return &c, c.init(NetworkManagerInterface, objectPath)
+}
+
+type ip6Config struct {
+ dbusBase
+}
+
+func (c *ip6Config) GetPropertyAddressData() ([]IP6AddressData, error) {
+ addresses, err := c.getSliceMapStringVariantProperty(IP6ConfigPropertyAddressData)
+ ret := make([]IP6AddressData, len(addresses))
+
+ if err != nil {
+ return ret, err
+ }
+
+ for i, address := range addresses {
+ prefix, ok := address["prefix"].Value().(uint32)
+ if !ok {
+ return ret, errors.New("unexpected variant type for prefix")
+ }
+
+ address, ok := address["address"].Value().(string)
+ if !ok {
+ return ret, errors.New("unexpected variant type for address")
+ }
+
+ ret[i] = IP6AddressData{
+ Address: address,
+ Prefix: uint8(prefix),
+ }
+ }
+
+ return ret, nil
+}
+
+func (c *ip6Config) GetPropertyGateway() (string, error) {
+ return c.getStringProperty(IP6ConfigPropertyGateway)
+}
+
+func (c *ip6Config) GetPropertyRouteData() ([]IP6RouteData, error) {
+ routesData, err := c.getSliceMapStringVariantProperty(IP6ConfigPropertyRouteData)
+ routes := make([]IP6RouteData, len(routesData))
+
+ if err != nil {
+ return routes, err
+ }
+
+ for index, routeData := range routesData {
+
+ route := IP6RouteData{}
+
+ for routeDataAttributeName, routeDataAttribute := range routeData {
+ switch routeDataAttributeName {
+ case "dest":
+ destination, ok := routeDataAttribute.Value().(string)
+ if !ok {
+ return routes, errors.New("unexpected variant type for dest")
+ }
+ route.Destination = destination
+ case "prefix":
+ prefix, ok := routeDataAttribute.Value().(uint32)
+ if !ok {
+ return routes, errors.New("unexpected variant type for prefix")
+ }
+ route.Prefix = uint8(prefix)
+ case "next-hop":
+ nextHop, ok := routeDataAttribute.Value().(string)
+ if !ok {
+ return routes, errors.New("unexpected variant type for next-hop")
+ }
+ route.NextHop = nextHop
+ case "metric":
+ metric, ok := routeDataAttribute.Value().(uint32)
+ if !ok {
+ return routes, errors.New("unexpected variant type for metric")
+ }
+ route.Metric = uint8(metric)
+ default:
+ if route.AdditionalAttributes == nil {
+ route.AdditionalAttributes = make(map[string]string)
+ }
+ route.AdditionalAttributes[routeDataAttributeName] = routeDataAttribute.String()
+ }
+ }
+
+ routes[index] = route
+ }
+ return routes, nil
+}
+
+func (c *ip6Config) GetPropertyNameservers() ([][]byte, error) {
+ nameservers, err := c.getSliceSliceByteProperty(IP6ConfigPropertyNameservers)
+ ret := make([][]byte, len(nameservers))
+
+ if err != nil {
+ return ret, err
+ }
+
+ for i, nameserver := range nameservers {
+ ret[i] = nameserver
+ }
+
+ return ret, nil
+}
+
+func (c *ip6Config) GetPropertyDomains() ([]string, error) {
+ return c.getSliceStringProperty(IP6ConfigPropertyDomains)
+}
+
+func (c *ip6Config) GetPropertySearches() ([]string, error) {
+ return c.getSliceStringProperty(IP6ConfigPropertySearches)
+}
+
+func (c *ip6Config) GetPropertyDnsOptions() ([]string, error) {
+ return c.getSliceStringProperty(IP6ConfigPropertyDnsOptions)
+}
+
+func (c *ip6Config) GetPropertyDnsPriority() (uint32, error) {
+ return c.getUint32Property(IP6ConfigPropertyDnsPriority)
+}
+
+func (c *ip6Config) MarshalJSON() ([]byte, error) {
+ m := make(map[string]interface{})
+
+ m["Addresses"], _ = c.GetPropertyAddressData()
+ m["Routes"], _ = c.GetPropertyRouteData()
+ m["Nameservers"], _ = c.GetPropertyNameservers()
+ m["Domains"], _ = c.GetPropertyDomains()
+
+ return json.Marshal(m)
+}
diff --git a/archive/vendor/github.com/Wifx/gonetworkmanager/v2/LICENSE b/archive/vendor/github.com/Wifx/gonetworkmanager/v2/LICENSE
new file mode 100644
index 0000000..8896b2c
--- /dev/null
+++ b/archive/vendor/github.com/Wifx/gonetworkmanager/v2/LICENSE
@@ -0,0 +1,45 @@
+The MIT License (MIT)
+
+Copyright (c) 2019 Wifx Sàrl
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
+------------------------------------------------------------------------------
+
+The MIT License (MIT)
+
+Copyright (c) 2016 Bellerophon Mobile
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/archive/vendor/github.com/Wifx/gonetworkmanager/v2/NetworkManager.go b/archive/vendor/github.com/Wifx/gonetworkmanager/v2/NetworkManager.go
new file mode 100644
index 0000000..3dc19c3
--- /dev/null
+++ b/archive/vendor/github.com/Wifx/gonetworkmanager/v2/NetworkManager.go
@@ -0,0 +1,751 @@
+package gonetworkmanager
+
+import (
+ "encoding/json"
+
+ "github.com/godbus/dbus/v5"
+)
+
+const (
+ NetworkManagerInterface = "org.freedesktop.NetworkManager"
+ NetworkManagerObjectPath = "/org/freedesktop/NetworkManager"
+
+ /* Methods */
+ NetworkManagerReload = NetworkManagerInterface + ".Reload"
+ NetworkManagerGetDevices = NetworkManagerInterface + ".GetDevices"
+ NetworkManagerGetAllDevices = NetworkManagerInterface + ".GetAllDevices"
+ NetworkManagerGetDeviceByIpIface = NetworkManagerInterface + ".GetDeviceByIpIface"
+ NetworkManagerActivateConnection = NetworkManagerInterface + ".ActivateConnection"
+ NetworkManagerAddAndActivateConnection = NetworkManagerInterface + ".AddAndActivateConnection"
+ NetworkManagerAddAndActivateConnection2 = NetworkManagerInterface + ".AddAndActivateConnection2"
+ NetworkManagerDeactivateConnection = NetworkManagerInterface + ".DeactivateConnection"
+ NetworkManagerSleep = NetworkManagerInterface + ".Sleep"
+ NetworkManagerEnable = NetworkManagerInterface + ".Enable"
+ NetworkManagerGetPermissions = NetworkManagerInterface + ".GetPermissions"
+ NetworkManagerSetLogging = NetworkManagerInterface + ".SetLogging"
+ NetworkManagerGetLogging = NetworkManagerInterface + ".GetLogging"
+ NetworkManagerCheckConnectivity = NetworkManagerInterface + ".CheckConnectivity"
+ NetworkManagerState = NetworkManagerInterface + ".state"
+ NetworkManagerCheckpointCreate = NetworkManagerInterface + ".CheckpointCreate"
+ NetworkManagerCheckpointDestroy = NetworkManagerInterface + ".CheckpointDestroy"
+ NetworkManagerCheckpointRollback = NetworkManagerInterface + ".CheckpointRollback"
+ NetworkManagerCheckpointAdjustRollbackTimeout = NetworkManagerInterface + ".CheckpointAdjustRollbackTimeout"
+
+ /* Property */
+ NetworkManagerPropertyDevices = NetworkManagerInterface + ".Devices" // readable ao
+ NetworkManagerPropertyAllDevices = NetworkManagerInterface + ".AllDevices" // readable ao
+ NetworkManagerPropertyCheckpoints = NetworkManagerInterface + ".Checkpoints" // readable ao
+ NetworkManagerPropertyNetworkingEnabled = NetworkManagerInterface + ".NetworkingEnabled" // readable b
+ NetworkManagerPropertyWirelessEnabled = NetworkManagerInterface + ".WirelessEnabled" // readwrite b
+ NetworkManagerPropertyWirelessHardwareEnabled = NetworkManagerInterface + ".WirelessHardwareEnabled" // readable b
+ NetworkManagerPropertyWwanEnabled = NetworkManagerInterface + ".WwanEnabled" // readwrite b
+ NetworkManagerPropertyWwanHardwareEnabled = NetworkManagerInterface + ".WwanHardwareEnabled" // readable b
+ NetworkManagerPropertyWimaxEnabled = NetworkManagerInterface + ".WimaxEnabled" // readwrite b
+ NetworkManagerPropertyWimaxHardwareEnabled = NetworkManagerInterface + ".WimaxHardwareEnabled" // readable b
+ NetworkManagerPropertyActiveConnections = NetworkManagerInterface + ".ActiveConnections" // readable ao
+ NetworkManagerPropertyPrimaryConnection = NetworkManagerInterface + ".PrimaryConnection" // readable o
+ NetworkManagerPropertyPrimaryConnectionType = NetworkManagerInterface + ".PrimaryConnectionType" // readable s
+ NetworkManagerPropertyMetered = NetworkManagerInterface + ".Metered" // readable u
+ NetworkManagerPropertyActivatingConnection = NetworkManagerInterface + ".ActivatingConnection" // readable o
+ NetworkManagerPropertyStartup = NetworkManagerInterface + ".Startup" // readable b
+ NetworkManagerPropertyVersion = NetworkManagerInterface + ".Version" // readable s
+ NetworkManagerPropertyCapabilities = NetworkManagerInterface + ".Capabilities" // readable au
+ NetworkManagerPropertyState = NetworkManagerInterface + ".State" // readable u
+ NetworkManagerPropertyConnectivity = NetworkManagerInterface + ".Connectivity" // readable u
+ NetworkManagerPropertyConnectivityCheckAvailable = NetworkManagerInterface + ".ConnectivityCheckAvailable" // readable b
+ NetworkManagerPropertyConnectivityCheckEnabled = NetworkManagerInterface + ".ConnectivityCheckEnabled" // readwrite b
+ NetworkManagerPropertyGlobalDnsConfiguration = NetworkManagerInterface + ".GlobalDnsConfiguration" // readwrite a{sv}
+)
+
+type NetworkManager interface {
+ /* METHODS */
+
+ // Reload NetworkManager's configuration and perform certain updates, like flushing a cache or rewriting external state to disk. This is similar to sending SIGHUP to NetworkManager but it allows for more fine-grained control over what to reload (see flags). It also allows non-root access via PolicyKit and contrary to signals it is synchronous.
+ // No flags (0x00) means to reload everything that is supported which is identical to sending a SIGHUP.
+ // (0x01) means to reload the NetworkManager.conf configuration from disk. Note that this does not include connections, which can be reloaded via Setting's ReloadConnections.
+ // (0x02) means to update DNS configuration, which usually involves writing /etc/resolv.conf anew.
+ // (0x04) means to restart the DNS plugin. This is for example useful when using dnsmasq plugin, which uses additional configuration in /etc/NetworkManager/dnsmasq.d. If you edit those files, you can restart the DNS plugin. This action shortly interrupts name resolution. Note that flags may affect each other. For example, restarting the DNS plugin (0x04) implicitly updates DNS too (0x02). Or when reloading the configuration (0x01), changes to DNS setting also cause a DNS update (0x02). However, (0x01) does not involve restarting the DNS plugin (0x04) or update resolv.conf (0x02), unless the DNS related configuration changes in NetworkManager.conf.
+ Reload(flags uint32) error
+
+ // GetDevices Get the list of realized network devices.
+ GetDevices() ([]Device, error)
+
+ // GetAllDevices Get the list of all network devices.
+ GetAllDevices() ([]Device, error)
+
+ // GetDeviceByIpIface Return the object path of the network device referenced by its IP interface name. Note that some devices (usually modems) only have an IP interface name when they are connected.
+ GetDeviceByIpIface(interfaceId string) (Device, error)
+
+ // ActivateConnection Activate a connection using the supplied device.
+ ActivateConnection(connection Connection, device Device, specificObject *dbus.Object) (ActiveConnection, error)
+
+ // AddAndActivateConnection Adds a new connection using the given details (if any) as a template (automatically filling in missing settings with the capabilities of the given device), then activate the new connection. Cannot be used for VPN connections at this time.
+ AddAndActivateConnection(connection map[string]map[string]interface{}, device Device) (ActiveConnection, error)
+
+ // ActivateWirelessConnection requests activating access point to network device
+ ActivateWirelessConnection(connection Connection, device Device, accessPoint AccessPoint) (ActiveConnection, error)
+
+ // AddAndActivateWirelessConnection adds a new connection profile to the network device it has been
+ // passed. It then activates the connection to the passed access point. The first parameter contains
+ // additional information for the connection (most probably the credentials).
+ // Example contents for connection are:
+ // connection := make(map[string]map[string]interface{})
+ // connection["802-11-wireless"] = make(map[string]interface{})
+ // connection["802-11-wireless"]["security"] = "802-11-wireless-security"
+ // connection["802-11-wireless-security"] = make(map[string]interface{})
+ // connection["802-11-wireless-security"]["key-mgmt"] = "wpa-psk"
+ // connection["802-11-wireless-security"]["psk"] = password
+ AddAndActivateWirelessConnection(connection map[string]map[string]interface{}, device Device, accessPoint AccessPoint) (ActiveConnection, error)
+
+ // DeactivateConnection Deactivate an active connection.
+ DeactivateConnection(connection ActiveConnection) error
+
+ // Sleep Control the NetworkManager daemon's sleep state. When asleep, all interfaces that it manages are deactivated. When awake, devices are available to be activated. This command should not be called directly by users or clients; it is intended for system suspend/resume tracking.
+ // sleepnWake: Indicates whether the NetworkManager daemon should sleep or wake.
+ Sleep(sleepNWake bool) error
+
+ // Enable Control whether overall networking is enabled or disabled. When disabled, all interfaces that NM manages are deactivated. When enabled, all managed interfaces are re-enabled and available to be activated. This command should be used by clients that provide to users the ability to enable/disable all networking.
+ // enableNDisable: If FALSE, indicates that all networking should be disabled. If TRUE, indicates that NetworkManager should begin managing network devices.
+ Enable(enableNDisable bool) error
+
+ // CheckConnectivity Re-check the network connectivity state.
+ CheckConnectivity() error
+
+ // State The overall networking state as determined by the NetworkManager daemon, based on the state of network devices under its management.
+ State() (NmState, error)
+
+ // CheckpointCreate Create a checkpoint of the current networking configuration for given interfaces. If rollback_timeout is not zero, a rollback is automatically performed after the given timeout.
+ // devices: A list of device paths for which a checkpoint should be created. An empty list means all devices.
+ // rollbackTimeout: The time in seconds until NetworkManager will automatically rollback to the checkpoint. Set to zero for infinite.
+ // flags: Flags for the creation.
+ // returns: On success, the new checkpoint.
+ CheckpointCreate(devices []Device, rollbackTimeout uint32, flags uint32) (Checkpoint, error)
+
+ // CheckpointDestroy Destroy a previously created checkpoint.
+ // checkpoint: The checkpoint to be destroyed. Set to empty to cancel all pending checkpoints.
+ CheckpointDestroy(checkpoint Checkpoint) error
+
+ // CheckpointRollback Rollback a checkpoint before the timeout is reached.
+ // checkpoint: The checkpoint to be rolled back.
+ // result: On return, a dictionary of devices and results. Devices are represented by their original D-Bus path; each result is a RollbackResult.
+ CheckpointRollback(checkpoint Checkpoint) (result map[dbus.ObjectPath]NmRollbackResult, err error)
+
+ // CheckpointAdjustRollbackTimeout Reset the timeout for rollback for the checkpoint.
+ // Since: 1.12
+ // addTimeout: number of seconds from ~now~ in which the timeout will expire. Set to 0 to disable the timeout. Note that the added seconds start counting from now, not "Created" timestamp or the previous expiration time. Note that the "Created" property of the checkpoint will stay unchanged by this call. However, the "RollbackTimeout" will be recalculated to give the approximate new expiration time. The new "RollbackTimeout" property will be approximate up to one second precision, which is the accuracy of the property.
+ CheckpointAdjustRollbackTimeout(checkpoint Checkpoint, addTimeout uint32) error
+
+ /* PROPERTIES */
+
+ // GetPropertyDevices The list of realized network devices. Realized devices are those which have backing resources (eg from the kernel or a management daemon like ModemManager, teamd, etc).
+ GetPropertyDevices() ([]Device, error)
+
+ // GetPropertyAllDevices The list of both realized and un-realized network devices. Un-realized devices are software devices which do not yet have backing resources, but for which backing resources can be created if the device is activated.
+ GetPropertyAllDevices() ([]Device, error)
+
+ // GetPropertyCheckpoints The list of active checkpoints.
+ GetPropertyCheckpoints() ([]Checkpoint, error)
+
+ // GetPropertyNetworkingEnabled Indicates if overall networking is currently enabled or not. See the Enable() method.
+ GetPropertyNetworkingEnabled() (bool, error)
+
+ // GetPropertyWirelessEnabled Indicates if wireless is currently enabled or not.
+ GetPropertyWirelessEnabled() (bool, error)
+ SetPropertyWirelessEnabled(bool) error
+
+ // GetPropertyWirelessHardwareEnabled Indicates if the wireless hardware is currently enabled, i.e. the state of the RF kill switch.
+ GetPropertyWirelessHardwareEnabled() (bool, error)
+
+ // GetPropertyWwanEnabled Indicates if mobile broadband devices are currently enabled or not.
+ GetPropertyWwanEnabled() (bool, error)
+
+ // GetPropertyWwanHardwareEnabled Indicates if the mobile broadband hardware is currently enabled, i.e. the state of the RF kill switch.
+ GetPropertyWwanHardwareEnabled() (bool, error)
+
+ // GetPropertyWimaxEnabled Indicates if WiMAX devices are currently enabled or not.
+ GetPropertyWimaxEnabled() (bool, error)
+
+ // GetPropertyWimaxHardwareEnabled Indicates if the WiMAX hardware is currently enabled, i.e. the state of the RF kill switch.
+ GetPropertyWimaxHardwareEnabled() (bool, error)
+
+ // GetPropertyActiveConnections List of active connection object paths.
+ GetPropertyActiveConnections() ([]ActiveConnection, error)
+
+ // GetPropertyPrimaryConnection The object path of the "primary" active connection being used to access the network. In particular, if there is no VPN active, or the VPN does not have the default route, then this indicates the connection that has the default route. If there is a VPN active with the default route, then this indicates the connection that contains the route to the VPN endpoint.
+ GetPropertyPrimaryConnection() (ActiveConnection, error)
+
+ // GetPropertyPrimaryConnectionType The connection type of the "primary" active connection being used to access the network. This is the same as the Type property on the object indicated by PrimaryConnection.
+ GetPropertyPrimaryConnectionType() (string, error)
+
+ // GetPropertyMetered Indicates whether the connectivity is metered. This is equivalent to the metered property of the device associated with the primary connection.
+ GetPropertyMetered() (NmMetered, error)
+
+ // GetPropertyActivatingConnection The object path of an active connection that is currently being activated and which is expected to become the new PrimaryConnection when it finishes activating.
+ GetPropertyActivatingConnection() (ActiveConnection, error)
+
+ // GetPropertyStartup Indicates whether NM is still starting up; this becomes FALSE when NM has finished attempting to activate every connection that it might be able to activate at startup.
+ GetPropertyStartup() (bool, error)
+
+ // GetPropertyVersion NetworkManager version.
+ GetPropertyVersion() (string, error)
+
+ // GetPropertyCapabilities The current set of capabilities. See NMCapability for currently defined capability numbers. The array is guaranteed to be sorted in ascending order without duplicates.
+ GetPropertyCapabilities() ([]NmCapability, error)
+
+ // GetPropertyState The overall state of the NetworkManager daemon.
+ // This takes state of all active connections and the connectivity state into account to produce a single indicator of the network accessibility status.
+ // The graphical shells may use this property to provide network connection status indication and applications may use this to check if Internet connection is accessible. Shell that is able to cope with captive portals should use the "Connectivity" property to decide whether to present a captive portal authentication dialog.
+ GetPropertyState() (NmState, error)
+
+ // GetPropertyConnectivity The result of the last connectivity check. The connectivity check is triggered automatically when a default connection becomes available, periodically and by calling a CheckConnectivity() method.
+ // This property is in general useful for the graphical shell to determine whether the Internet access is being hijacked by an authentication gateway (a "captive portal"). In such case it would typically present a web browser window to give the user a chance to authenticate and call CheckConnectivity() when the user submits a form or dismisses the window.
+ // To determine the whether the user is able to access the Internet without dealing with captive portals (e.g. to provide a network connection indicator or disable controls that require Internet access), the "State" property is more suitable.
+ GetPropertyConnectivity() (NmConnectivity, error)
+
+ // GetPropertyConnectivityCheckAvailable Indicates whether connectivity checking service has been configured. This may return true even if the service is not currently enabled.
+ // This is primarily intended for use in a privacy control panel, as a way to determine whether to show an option to enable/disable the feature.
+ GetPropertyConnectivityCheckAvailable() (bool, error)
+
+ // GetPropertyConnectivityCheckEnabled Indicates whether connectivity checking is enabled. This property can also be written to to disable connectivity checking (as a privacy control panel might want to do).
+ GetPropertyConnectivityCheckEnabled() (bool, error)
+
+ // Dictionary of global DNS settings where the key is one of "searches", "options" and "domains". The values for the "searches" and "options" keys are string arrays describing the list of search domains and resolver options, respectively. The value of the "domains" key is a second-level dictionary, where each key is a domain name, and each key's value is a third-level dictionary with the keys "servers" and "options". "servers" is a string array of DNS servers, "options" is a string array of domain-specific options.
+ //GetPropertyGlobalDnsConfiguration() []interface{}
+
+ Subscribe() <-chan *dbus.Signal
+ Unsubscribe()
+
+ MarshalJSON() ([]byte, error)
+}
+
+func NewNetworkManager() (NetworkManager, error) {
+ var nm networkManager
+ return &nm, nm.init(NetworkManagerInterface, NetworkManagerObjectPath)
+}
+
+type networkManager struct {
+ dbusBase
+
+ sigChan chan *dbus.Signal
+}
+
+func (nm *networkManager) Reload(flags uint32) error {
+ return nm.call(NetworkManagerReload, flags)
+}
+
+func (nm *networkManager) GetDevices() (devices []Device, err error) {
+ var devicePaths []dbus.ObjectPath
+ err = nm.callWithReturn(&devicePaths, NetworkManagerGetDevices)
+ if err != nil {
+ return
+ }
+
+ devices = make([]Device, len(devicePaths))
+
+ for i, path := range devicePaths {
+ devices[i], err = DeviceFactory(path)
+ if err != nil {
+ return
+ }
+ }
+
+ return
+}
+
+func (nm *networkManager) GetAllDevices() (devices []Device, err error) {
+ var devicePaths []dbus.ObjectPath
+
+ err = nm.callWithReturn(&devicePaths, NetworkManagerGetAllDevices)
+ if err != nil {
+ return
+ }
+
+ devices = make([]Device, len(devicePaths))
+
+ for i, path := range devicePaths {
+ devices[i], err = DeviceFactory(path)
+ if err != nil {
+ return
+ }
+ }
+
+ return
+}
+
+func (nm *networkManager) GetDeviceByIpIface(interfaceId string) (device Device, err error) {
+ var devicePath dbus.ObjectPath
+
+ err = nm.callWithReturn(&devicePath, NetworkManagerGetDeviceByIpIface, interfaceId)
+ if err != nil {
+ return
+ }
+
+ device, err = DeviceFactory(devicePath)
+ if err != nil {
+ return
+ }
+
+ return
+}
+
+func (nm *networkManager) ActivateConnection(connection Connection, device Device, specificObject *dbus.Object) (ac ActiveConnection, err error) {
+ var connectionPath dbus.ObjectPath
+
+ var devicePath dbus.ObjectPath
+ if device != nil {
+ devicePath = device.GetPath()
+ } else {
+ devicePath = "/"
+ }
+
+ var specificObjectPath dbus.ObjectPath
+ if specificObject != nil {
+ specificObjectPath = specificObject.Path()
+ } else {
+ specificObjectPath = "/"
+ }
+
+ err = nm.callWithReturn(&connectionPath, NetworkManagerActivateConnection, connection.GetPath(), devicePath, specificObjectPath)
+ if err != nil {
+ return
+ }
+
+ ac, err = NewActiveConnection(connectionPath)
+ if err != nil {
+ return
+ }
+
+ return
+}
+
+func (nm *networkManager) AddAndActivateConnection(connection map[string]map[string]interface{}, d Device) (ac ActiveConnection, err error) {
+ var opath1 dbus.ObjectPath
+ var opath2 dbus.ObjectPath
+
+ var devicePath dbus.ObjectPath
+ if d != nil {
+ devicePath = d.GetPath()
+ }
+
+ err = nm.callWithReturn2(&opath1, &opath2, NetworkManagerAddAndActivateConnection, connection, devicePath, dbus.ObjectPath("/"))
+ if err != nil {
+ return
+ }
+
+ ac, err = NewActiveConnection(opath2)
+ if err != nil {
+ return
+ }
+
+ return
+}
+
+func (nm *networkManager) ActivateWirelessConnection(c Connection, d Device, ap AccessPoint) (ac ActiveConnection, err error) {
+ var opath dbus.ObjectPath
+ err = nm.callWithReturn(&opath, NetworkManagerActivateConnection, c.GetPath(), d.GetPath(), ap.GetPath())
+ if err != nil {
+ return nil, err
+ }
+
+ ac, err = NewActiveConnection(opath)
+ if err != nil {
+ return nil, err
+ }
+
+ return
+}
+
+func (nm *networkManager) AddAndActivateWirelessConnection(connection map[string]map[string]interface{}, d Device, ap AccessPoint) (ac ActiveConnection, err error) {
+ var opath1 dbus.ObjectPath
+ var opath2 dbus.ObjectPath
+
+ err = nm.callWithReturn2(&opath1, &opath2, NetworkManagerAddAndActivateConnection, connection, d.GetPath(), ap.GetPath())
+ if err != nil {
+ return
+ }
+
+ ac, err = NewActiveConnection(opath2)
+ if err != nil {
+ return
+ }
+ return
+}
+
+func (nm *networkManager) DeactivateConnection(c ActiveConnection) error {
+ return nm.call(NetworkManagerDeactivateConnection, c.GetPath())
+}
+
+func (nm *networkManager) Sleep(sleepNWake bool) error {
+ return nm.call(NetworkManagerSleep, sleepNWake)
+}
+
+func (nm *networkManager) Enable(enableNDisable bool) error {
+ return nm.call(NetworkManagerEnable, enableNDisable)
+}
+
+func (nm *networkManager) CheckConnectivity() error {
+ return nm.call(NetworkManagerCheckConnectivity)
+}
+
+func (nm *networkManager) State() (state NmState, err error) {
+ err = nm.callWithReturn(&state, NetworkManagerState)
+ return
+}
+
+func (nm *networkManager) CheckpointCreate(devices []Device, rollbackTimeout uint32, flags uint32) (cp Checkpoint, err error) {
+
+ var devicePaths []dbus.ObjectPath
+ if len(devices) > 0 {
+ for _, device := range devices {
+ devicePaths = append(devicePaths, device.GetPath())
+ }
+ }
+
+ var checkpointPath dbus.ObjectPath
+ err = nm.callWithReturn(&checkpointPath, NetworkManagerCheckpointCreate, devicePaths, rollbackTimeout, flags)
+ if err != nil {
+ return
+ }
+
+ cp, err = NewCheckpoint(checkpointPath)
+ return
+}
+
+func (nm *networkManager) CheckpointDestroy(checkpoint Checkpoint) error {
+ if checkpoint == nil {
+ return nm.call(NetworkManagerCheckpointDestroy)
+ } else {
+ return nm.call(NetworkManagerCheckpointDestroy, checkpoint.GetPath())
+ }
+}
+
+func (nm *networkManager) CheckpointRollback(checkpoint Checkpoint) (results map[dbus.ObjectPath]NmRollbackResult, err error) {
+
+ var ret map[dbus.ObjectPath]NmRollbackResult
+
+ err = nm.callWithReturn(&ret, NetworkManagerCheckpointRollback, checkpoint.GetPath())
+ if err != nil {
+ return
+ }
+
+ results = map[dbus.ObjectPath]NmRollbackResult{}
+ for devicePath, result := range ret {
+ results[devicePath] = result
+ }
+
+ return
+}
+
+func (nm *networkManager) CheckpointAdjustRollbackTimeout(checkpoint Checkpoint, addTimeout uint32) error {
+ return nm.call(NetworkManagerCheckpointAdjustRollbackTimeout, checkpoint, addTimeout)
+}
+
+/* PROPERTIES */
+
+func (nm *networkManager) GetPropertyDevices() ([]Device, error) {
+ devicesPaths, err := nm.getSliceObjectProperty(NetworkManagerPropertyDevices)
+ if err != nil {
+ return nil, err
+ }
+
+ devices := make([]Device, len(devicesPaths))
+ for i, path := range devicesPaths {
+ devices[i], err = NewDevice(path)
+ if err != nil {
+ return devices, err
+ }
+ }
+
+ return devices, nil
+}
+
+func (nm *networkManager) GetPropertyAllDevices() ([]Device, error) {
+ devicesPaths, err := nm.getSliceObjectProperty(NetworkManagerPropertyAllDevices)
+ if err != nil {
+ return nil, err
+ }
+
+ devices := make([]Device, len(devicesPaths))
+ for i, path := range devicesPaths {
+ devices[i], err = NewDevice(path)
+ if err != nil {
+ return devices, err
+ }
+ }
+
+ return devices, nil
+}
+
+func (nm *networkManager) GetPropertyCheckpoints() ([]Checkpoint, error) {
+ checkpointsPaths, err := nm.getSliceObjectProperty(NetworkManagerPropertyCheckpoints)
+ if err != nil {
+ return nil, err
+ }
+
+ checkpoints := make([]Checkpoint, len(checkpointsPaths))
+ for i, path := range checkpointsPaths {
+ checkpoints[i], err = NewCheckpoint(path)
+ if err != nil {
+ return checkpoints, err
+ }
+ }
+
+ return checkpoints, nil
+}
+
+func (nm *networkManager) GetPropertyNetworkingEnabled() (bool, error) {
+ return nm.getBoolProperty(NetworkManagerPropertyNetworkingEnabled)
+}
+
+func (nm *networkManager) GetPropertyWirelessEnabled() (bool, error) {
+ return nm.getBoolProperty(NetworkManagerPropertyWirelessEnabled)
+}
+
+func (nm *networkManager) SetPropertyWirelessEnabled(enabled bool) error {
+ return nm.setProperty(NetworkManagerPropertyWirelessEnabled, enabled)
+}
+
+func (nm *networkManager) GetPropertyWirelessHardwareEnabled() (bool, error) {
+ return nm.getBoolProperty(NetworkManagerPropertyWirelessHardwareEnabled)
+}
+
+func (nm *networkManager) GetPropertyWwanEnabled() (bool, error) {
+ return nm.getBoolProperty(NetworkManagerPropertyWwanEnabled)
+}
+
+func (nm *networkManager) GetPropertyWwanHardwareEnabled() (bool, error) {
+ return nm.getBoolProperty(NetworkManagerPropertyWwanHardwareEnabled)
+}
+
+func (nm *networkManager) GetPropertyWimaxEnabled() (bool, error) {
+ return nm.getBoolProperty(NetworkManagerPropertyWimaxEnabled)
+}
+
+func (nm *networkManager) GetPropertyWimaxHardwareEnabled() (bool, error) {
+ return nm.getBoolProperty(NetworkManagerPropertyWimaxHardwareEnabled)
+}
+
+func (nm *networkManager) GetPropertyActiveConnections() ([]ActiveConnection, error) {
+ acPaths, err := nm.getSliceObjectProperty(NetworkManagerPropertyActiveConnections)
+ if err != nil {
+ return nil, err
+ }
+
+ ac := make([]ActiveConnection, len(acPaths))
+ for i, path := range acPaths {
+ ac[i], err = NewActiveConnection(path)
+ if err != nil {
+ return ac, err
+ }
+ }
+
+ return ac, nil
+}
+
+func (nm *networkManager) GetPropertyPrimaryConnection() (ActiveConnection, error) {
+ activeConnectionPath, err := nm.getObjectProperty(NetworkManagerPropertyPrimaryConnection)
+
+ if err != nil {
+ return nil, err
+ }
+
+ return NewActiveConnection(activeConnectionPath)
+}
+
+func (nm *networkManager) GetPropertyPrimaryConnectionType() (string, error) {
+ return nm.getStringProperty(NetworkManagerPropertyPrimaryConnectionType)
+}
+
+func (nm *networkManager) GetPropertyMetered() (NmMetered, error) {
+ v, err := nm.getUint32Property(NetworkManagerPropertyMetered)
+ return NmMetered(v), err
+}
+
+func (nm *networkManager) GetPropertyActivatingConnection() (ActiveConnection, error) {
+ panic("implement me")
+}
+
+func (nm *networkManager) GetPropertyStartup() (bool, error) {
+ return nm.getBoolProperty(NetworkManagerPropertyStartup)
+}
+
+func (nm *networkManager) GetPropertyVersion() (string, error) {
+ return nm.getStringProperty(NetworkManagerPropertyVersion)
+}
+
+func (nm *networkManager) GetPropertyCapabilities() ([]NmCapability, error) {
+ panic("implement me")
+}
+
+func (nm *networkManager) GetPropertyState() (NmState, error) {
+ v, err := nm.getUint32Property(NetworkManagerPropertyState)
+ return NmState(v), err
+}
+
+func (nm *networkManager) GetPropertyConnectivity() (NmConnectivity, error) {
+ v, err := nm.getUint32Property(NetworkManagerPropertyConnectivity)
+ return NmConnectivity(v), err
+}
+
+func (nm *networkManager) GetPropertyConnectivityCheckAvailable() (bool, error) {
+ return nm.getBoolProperty(NetworkManagerPropertyConnectivityCheckAvailable)
+}
+
+func (nm *networkManager) GetPropertyConnectivityCheckEnabled() (bool, error) {
+ return nm.getBoolProperty(NetworkManagerPropertyConnectivityCheckEnabled)
+}
+
+func (nm *networkManager) Subscribe() <-chan *dbus.Signal {
+ if nm.sigChan != nil {
+ return nm.sigChan
+ }
+
+ nm.subscribeNamespace(NetworkManagerObjectPath)
+ nm.sigChan = make(chan *dbus.Signal, 10)
+ nm.conn.Signal(nm.sigChan)
+
+ return nm.sigChan
+}
+
+func (nm *networkManager) Unsubscribe() {
+ nm.conn.RemoveSignal(nm.sigChan)
+ nm.sigChan = nil
+}
+
+func (nm *networkManager) MarshalJSON() ([]byte, error) {
+
+ Devices, err := nm.GetPropertyDevices()
+ if err != nil {
+ return nil, err
+ }
+
+ AllDevices, err := nm.GetPropertyAllDevices()
+ if err != nil {
+ return nil, err
+ }
+
+ Checkpoints, err := nm.GetPropertyCheckpoints()
+ if err != nil {
+ return nil, err
+ }
+
+ NetworkingEnabled, err := nm.GetPropertyNetworkingEnabled()
+ if err != nil {
+ return nil, err
+ }
+
+ WirelessEnabled, err := nm.GetPropertyWirelessEnabled()
+ if err != nil {
+ return nil, err
+ }
+
+ WirelessHardwareEnabled, err := nm.GetPropertyWirelessHardwareEnabled()
+ if err != nil {
+ return nil, err
+ }
+
+ WwanEnabled, err := nm.GetPropertyWwanEnabled()
+ if err != nil {
+ return nil, err
+ }
+
+ WwanHardwareEnabled, err := nm.GetPropertyWwanHardwareEnabled()
+ if err != nil {
+ return nil, err
+ }
+
+ WimaxEnabled, err := nm.GetPropertyWimaxEnabled()
+ if err != nil {
+ return nil, err
+ }
+
+ WimaxHardwareEnabled, err := nm.GetPropertyWimaxHardwareEnabled()
+ if err != nil {
+ return nil, err
+ }
+
+ ActiveConnections, err := nm.GetPropertyActiveConnections()
+ if err != nil {
+ return nil, err
+ }
+
+ PrimaryConnection, err := nm.GetPropertyPrimaryConnection()
+ if err != nil {
+ return nil, err
+ }
+
+ PrimaryConnectionType, err := nm.GetPropertyPrimaryConnectionType()
+ if err != nil {
+ return nil, err
+ }
+
+ Metered, err := nm.GetPropertyMetered()
+ if err != nil {
+ return nil, err
+ }
+
+ ActivatingConnection, err := nm.GetPropertyActivatingConnection()
+ if err != nil {
+ return nil, err
+ }
+
+ Startup, err := nm.GetPropertyStartup()
+ if err != nil {
+ return nil, err
+ }
+
+ Version, err := nm.GetPropertyVersion()
+ if err != nil {
+ return nil, err
+ }
+
+ Capabilities, err := nm.GetPropertyCapabilities()
+ if err != nil {
+ return nil, err
+ }
+
+ State, err := nm.GetPropertyState()
+ if err != nil {
+ return nil, err
+ }
+
+ Connectivity, err := nm.GetPropertyConnectivity()
+ if err != nil {
+ return nil, err
+ }
+
+ ConnectivityCheckAvailable, err := nm.GetPropertyConnectivityCheckAvailable()
+ if err != nil {
+ return nil, err
+ }
+
+ ConnectivityCheckEnabled, err := nm.GetPropertyConnectivityCheckEnabled()
+ if err != nil {
+ return nil, err
+ }
+
+ return json.Marshal(map[string]interface{}{
+ "Devices": Devices,
+ "AllDevices": AllDevices,
+ "Checkpoints": Checkpoints,
+ "NetworkingEnabled": NetworkingEnabled,
+ "WirelessEnabled": WirelessEnabled,
+ "WirelessHardwareEnabled": WirelessHardwareEnabled,
+ "WwanEnabled": WwanEnabled,
+ "WwanHardwareEnabled": WwanHardwareEnabled,
+ "WimaxEnabled": WimaxEnabled,
+ "WimaxHardwareEnabled": WimaxHardwareEnabled,
+ "ActiveConnections": ActiveConnections,
+ "PrimaryConnection": PrimaryConnection,
+ "PrimaryConnectionType": PrimaryConnectionType,
+ "Metered": Metered,
+ "ActivatingConnection": ActivatingConnection,
+ "Startup": Startup,
+ "Version": Version,
+ "Capabilities": Capabilities,
+ "State": State,
+ "Connectivity": Connectivity,
+ "ConnectivityCheckAvailable": ConnectivityCheckAvailable,
+ "ConnectivityCheckEnabled": ConnectivityCheckEnabled,
+ })
+}
diff --git a/archive/vendor/github.com/Wifx/gonetworkmanager/v2/README.md b/archive/vendor/github.com/Wifx/gonetworkmanager/v2/README.md
new file mode 100644
index 0000000..7437990
--- /dev/null
+++ b/archive/vendor/github.com/Wifx/gonetworkmanager/v2/README.md
@@ -0,0 +1,35 @@
+[](https://pkg.go.dev/github.com/Wifx/gonetworkmanager)
+[](https://github.com/Wifx/gonetworkmanager/actions?query=workflow%3AGo)
+
+gonetworkmanager
+================
+
+Go D-Bus bindings for [NetworkManager](https://networkmanager.dev/).
+
+## Usage
+
+You can find some examples in the [examples](examples) directory.
+
+## External documentations
+
+- [NetworkManager D-Bus Spec](https://networkmanager.dev/docs/api/latest/spec.html)
+- [nm-settings-dbus](https://networkmanager.dev/docs/api/latest/nm-settings-dbus.html)
+
+
+## Backward compatibility
+
+The library is most likely compatible with NetworkManager 0.9 to 1.40.
+
+## Tests
+
+Tested with NetworkManager 1.40.0.
+
+There are no automated tests for this library. Tests are made manually on a best-effort basis. Unit tests PRs are welcome.
+
+## Development and contributions
+
+There is no active development workforce from the maintainer. PRs are welcome.
+
+## Issues
+
+Before reporting an issue, please test the scenario with nmcli (if possible) to ensure the problem comes from the library.
diff --git a/archive/vendor/github.com/Wifx/gonetworkmanager/v2/Settings.go b/archive/vendor/github.com/Wifx/gonetworkmanager/v2/Settings.go
new file mode 100644
index 0000000..7b4f009
--- /dev/null
+++ b/archive/vendor/github.com/Wifx/gonetworkmanager/v2/Settings.go
@@ -0,0 +1,129 @@
+package gonetworkmanager
+
+import (
+ "github.com/godbus/dbus/v5"
+)
+
+const (
+ SettingsInterface = NetworkManagerInterface + ".Settings"
+ SettingsObjectPath = NetworkManagerObjectPath + "/Settings"
+
+ /* Methods */
+ SettingsListConnections = SettingsInterface + ".ListConnections"
+ SettingsGetConnectionByUUID = SettingsInterface + ".GetConnectionByUuid"
+ SettingsAddConnection = SettingsInterface + ".AddConnection"
+ SettingsAddConnectionUnsaved = SettingsInterface + ".AddConnectionUnsaved"
+ SettingsLoadConnections = SettingsInterface + ".LoadConnections"
+ SettingsReloadConnections = SettingsInterface + ".ReloadConnections"
+ SettingsSaveHostname = SettingsInterface + ".SaveHostname"
+
+ /* Properties */
+ SettingsPropertyConnections = SettingsInterface + ".Connections" // readable ao
+ SettingsPropertyHostname = SettingsInterface + ".Hostname" // readable s
+ SettingsPropertyCanModify = SettingsInterface + ".CanModify" // readable b
+)
+
+type Settings interface {
+ // ListConnections gets list the saved network connections known to NetworkManager
+ ListConnections() ([]Connection, error)
+
+ // ReloadConnections tells NetworkManager to reload all connection files from disk, including noticing any added or deleted connection files.
+ ReloadConnections() error
+
+ // GetConnectionByUUID gets the connection, given that connection's UUID.
+ GetConnectionByUUID(uuid string) (Connection, error)
+
+ // AddConnection adds new connection and save it to disk.
+ AddConnection(settings ConnectionSettings) (Connection, error)
+
+ // AddConnectionUnsaved Add new connection but do not save it to disk immediately. This operation does not start the network connection unless (1) device is idle and able to connect to the network described by the new connection, and (2) the connection is allowed to be started automatically. Use the 'Save' method on the connection to save these changes to disk. Note that unsaved changes will be lost if the connection is reloaded from disk (either automatically on file change or due to an explicit ReloadConnections call).
+ AddConnectionUnsaved(settings ConnectionSettings) (Connection, error)
+
+ // SaveHostname Save the hostname to persistent configuration.
+ SaveHostname(hostname string) error
+
+ // GetPropertyCanModify If true, adding and modifying connections is supported.
+ GetPropertyCanModify() (bool, error)
+
+ // GetPropertyHostname The machine hostname stored in persistent configuration.
+ GetPropertyHostname() (string, error)
+}
+
+func NewSettings() (Settings, error) {
+ var s settings
+ return &s, s.init(NetworkManagerInterface, SettingsObjectPath)
+}
+
+type settings struct {
+ dbusBase
+}
+
+func (s *settings) ListConnections() ([]Connection, error) {
+ var connectionPaths []dbus.ObjectPath
+
+ err := s.callWithReturn(&connectionPaths, SettingsListConnections)
+ if err != nil {
+ return nil, err
+ }
+
+ connections := make([]Connection, len(connectionPaths))
+
+ for i, path := range connectionPaths {
+ connections[i], err = NewConnection(path)
+ if err != nil {
+ return connections, err
+ }
+ }
+
+ return connections, nil
+}
+
+// ReloadConnections tells NetworkManager to reload (and apply) configuration files
+// from disk taking notice of any added or removed connections.
+func (s *settings) ReloadConnections() error {
+ return s.call(SettingsReloadConnections)
+}
+
+// GetConnectionByUUID gets the connection, given that connection's UUID.
+func (s *settings) GetConnectionByUUID(uuid string) (Connection, error) {
+ var path dbus.ObjectPath
+ err := s.callWithReturn(&path, SettingsGetConnectionByUUID, uuid)
+ if err != nil {
+ return nil, err
+ }
+
+ return NewConnection(path)
+}
+
+func (s *settings) AddConnection(settings ConnectionSettings) (Connection, error) {
+ var path dbus.ObjectPath
+ err := s.callWithReturn(&path, SettingsAddConnection, settings)
+ if err != nil {
+ return nil, err
+ }
+
+ return NewConnection(path)
+}
+
+func (s *settings) AddConnectionUnsaved(settings ConnectionSettings) (Connection, error) {
+ var path dbus.ObjectPath
+ err := s.callWithReturn(&path, SettingsAddConnectionUnsaved, settings)
+
+ if err != nil {
+ return nil, err
+ }
+
+ return NewConnection(path)
+}
+
+func (s *settings) SaveHostname(hostname string) error {
+ return s.call(SettingsSaveHostname, hostname)
+}
+
+func (s *settings) GetPropertyHostname() (string, error) {
+ return s.getStringProperty(SettingsPropertyHostname)
+}
+
+func (s *settings) GetPropertyCanModify() (bool, error) {
+ return s.getBoolProperty(SettingsPropertyCanModify)
+}
diff --git a/archive/vendor/github.com/Wifx/gonetworkmanager/v2/VpnConnection.go b/archive/vendor/github.com/Wifx/gonetworkmanager/v2/VpnConnection.go
new file mode 100644
index 0000000..40cb155
--- /dev/null
+++ b/archive/vendor/github.com/Wifx/gonetworkmanager/v2/VpnConnection.go
@@ -0,0 +1,45 @@
+package gonetworkmanager
+
+import (
+ "github.com/godbus/dbus/v5"
+)
+
+const (
+ VpnConnectionInterface = NetworkManagerInterface + ".VPN.Connection"
+
+ /* Properties */
+ VpnConnectionPropertyVpnState = VpnConnectionInterface + ".VpnState" // readable u
+ VpnConnectionPropertyBanner = VpnConnectionInterface + ".Banner" // readable s
+)
+
+type VpnConnection interface {
+ GetPath() dbus.ObjectPath
+
+ // GetPropertyVpnState The VPN-specific state of the connection.
+ GetPropertyVpnState() (NmVpnConnectionState, error)
+
+ // GetPropertyBanner The banner string of the VPN connection.
+ GetPropertyBanner() (string, error)
+}
+
+func NewVpnConnection(objectPath dbus.ObjectPath) (VpnConnection, error) {
+ var a vpnConnection
+ return &a, a.init(NetworkManagerInterface, objectPath)
+}
+
+type vpnConnection struct {
+ dbusBase
+}
+
+func (a *vpnConnection) GetPath() dbus.ObjectPath {
+ return a.obj.Path()
+}
+
+func (a *vpnConnection) GetPropertyVpnState() (NmVpnConnectionState, error) {
+ v, err := a.getUint32Property(VpnConnectionPropertyVpnState)
+ return NmVpnConnectionState(v), err
+}
+
+func (a *vpnConnection) GetPropertyBanner() (string, error) {
+ return a.getStringProperty(VpnConnectionPropertyBanner)
+}
diff --git a/archive/vendor/github.com/Wifx/gonetworkmanager/v2/enums.go b/archive/vendor/github.com/Wifx/gonetworkmanager/v2/enums.go
new file mode 100644
index 0000000..ee67e79
--- /dev/null
+++ b/archive/vendor/github.com/Wifx/gonetworkmanager/v2/enums.go
@@ -0,0 +1,293 @@
+package gonetworkmanager
+
+//go:generate stringer -type=NmConnectivity
+type NmConnectivity uint32
+
+const (
+ NmConnectivityUnknown NmConnectivity = 0 // Network connectivity is unknown. This means the connectivity checks are disabled (e.g. on server installations) or has not run yet. The graphical shell should assume the Internet connection might be available and not present a captive portal window.
+ NmConnectivityNone NmConnectivity = 1 // The host is not connected to any network. There's no active connection that contains a default route to the internet and thus it makes no sense to even attempt a connectivity check. The graphical shell should use this state to indicate the network connection is unavailable.
+ NmConnectivityPortal NmConnectivity = 2 // The Internet connection is hijacked by a captive portal gateway. The graphical shell may open a sandboxed web browser window (because the captive portals typically attempt a man-in-the-middle attacks against the https connections) for the purpose of authenticating to a gateway and retrigger the connectivity check with CheckConnectivity() when the browser window is dismissed.
+ NmConnectivityLimited NmConnectivity = 3 // The host is connected to a network, does not appear to be able to reach the full Internet, but a captive portal has not been detected.
+ NmConnectivityFull NmConnectivity = 4 // The host is connected to a network, and appears to be able to reach the full Internet.
+)
+
+//go:generate stringer -type=NmState
+type NmState uint32
+
+const (
+ NmStateUnknown NmState = 0 // Networking state is unknown. This indicates a daemon error that makes it unable to reasonably assess the state. In such event the applications are expected to assume Internet connectivity might be present and not disable controls that require network access. The graphical shells may hide the network accessibility indicator altogether since no meaningful status indication can be provided.
+ NmStateAsleep NmState = 10 // Networking is not enabled, the system is being suspended or resumed from suspend.
+ NmStateDisconnected NmState = 20 // There is no active network connection. The graphical shell should indicate no network connectivity and the applications should not attempt to access the network.
+ NmStateDisconnecting NmState = 30 // Network connections are being cleaned up. The applications should tear down their network sessions.
+ NmStateConnecting NmState = 40 // A network connection is being started The graphical shell should indicate the network is being connected while the applications should still make no attempts to connect the network.
+ NmStateConnectedLocal NmState = 50 // There is only local IPv4 and/or IPv6 connectivity, but no default route to access the Internet. The graphical shell should indicate no network connectivity.
+ NmStateConnectedSite NmState = 60 // There is only site-wide IPv4 and/or IPv6 connectivity. This means a default route is available, but the Internet connectivity check (see "Connectivity" property) did not succeed. The graphical shell should indicate limited network connectivity.
+ NmStateConnectedGlobal NmState = 70 // There is global IPv4 and/or IPv6 Internet connectivity This means the Internet connectivity check succeeded, the graphical shell should indicate full network connectivity.
+)
+
+//go:generate stringer -type=NmCheckpointCreateFlags
+type NmCheckpointCreateFlags uint32
+
+const (
+ NmCheckpointCreateFlagsNone NmCheckpointCreateFlags = 0 // no flags
+ NmCheckpointCreateFlagsDestroyAll NmCheckpointCreateFlags = 0x01 // when creating a new checkpoint, destroy all existing ones.
+ NmCheckpointCreateFlagsDeleteNewConnections NmCheckpointCreateFlags = 0x02 // upon rollback, delete any new connection added after the checkpoint (Since: 1.6)
+ NmCheckpointCreateFlagsDisconnectNewDevices NmCheckpointCreateFlags = 0x04 // upon rollback, disconnect any new device appeared after the checkpoint (Since: 1.6)
+ NmCheckpointCreateFlagsAllowOverlapping NmCheckpointCreateFlags = 0x08 // by default, creating a checkpoint fails if there are already existing checkoints that reference the same devices. With this flag, creation of such checkpoints is allowed, however, if an older checkpoint that references overlapping devices gets rolled back, it will automatically destroy this checkpoint during rollback. This allows to create several overlapping checkpoints in parallel, and rollback to them at will. With the special case that rolling back to an older checkpoint will invalidate all overlapping younger checkpoints. This opts-in that the checkpoint can be automatically destroyed by the rollback of an older checkpoint. (Since: 1.12)
+)
+
+//go:generate stringer -type=NmCapability
+type NmCapability uint32
+
+const (
+ NmCapabilityTeam NmCapability = 1 // Teams can be managed
+)
+
+//go:generate stringer -type=NmMetered
+type NmMetered uint32
+
+const (
+ NmMeteredUnknown NmMetered = 0 // The metered status is unknown
+ NmMeteredYes NmMetered = 1 // Metered, the value was statically set
+ NmMeteredNo NmMetered = 2 // Not metered, the value was statically set
+ NmMeteredGuessYes NmMetered = 3 // Metered, the value was guessed
+ NmMeteredGuessNo NmMetered = 4 // Not metered, the value was guessed
+)
+
+//go:generate stringer -type=NmDeviceState
+type NmDeviceState uint32
+
+const (
+ NmDeviceStateUnknown NmDeviceState = 0 // the device's state is unknown
+ NmDeviceStateUnmanaged NmDeviceState = 10 // the device is recognized, but not managed by NetworkManager
+ NmDeviceStateUnavailable NmDeviceState = 20 // the device is managed by NetworkManager, but is not available for use. Reasons may include the wireless switched off, missing firmware, no ethernet carrier, missing supplicant or modem manager, etc.
+ NmDeviceStateDisconnected NmDeviceState = 30 // the device can be activated, but is currently idle and not connected to a network.
+ NmDeviceStatePrepare NmDeviceState = 40 // the device is preparing the connection to the network. This may include operations like changing the MAC address, setting physical link properties, and anything else required to connect to the requested network.
+ NmDeviceStateConfig NmDeviceState = 50 // the device is connecting to the requested network. This may include operations like associating with the Wi-Fi AP, dialing the modem, connecting to the remote Bluetooth device, etc.
+ NmDeviceStateNeedAuth NmDeviceState = 60 // the device requires more information to continue connecting to the requested network. This includes secrets like WiFi passphrases, login passwords, PIN codes, etc.
+ NmDeviceStateIpConfig NmDeviceState = 70 // the device is requesting IPv4 and/or IPv6 addresses and routing information from the network.
+ NmDeviceStateIpCheck NmDeviceState = 80 // the device is checking whether further action is required for the requested network connection. This may include checking whether only local network access is available, whether a captive portal is blocking access to the Internet, etc.
+ NmDeviceStateSecondaries NmDeviceState = 90 // the device is waiting for a secondary connection (like a VPN) which must activated before the device can be activated
+ NmDeviceStateActivated NmDeviceState = 100 // the device has a network connection, either local or global.
+ NmDeviceStateDeactivating NmDeviceState = 110 // a disconnection from the current network connection was requested, and the device is cleaning up resources used for that connection. The network connection may still be valid.
+ NmDeviceStateFailed NmDeviceState = 120 // the device failed to connect to the requested network and is cleaning up the connection request
+)
+
+//go:generate stringer -type=NmActiveConnectionState
+type NmActiveConnectionState uint32
+
+const (
+ NmActiveConnectionStateUnknown NmActiveConnectionState = 0 // The state of the connection is unknown
+ NmActiveConnectionStateActivating NmActiveConnectionState = 1 // A network connection is being prepared
+ NmActiveConnectionStateActivated NmActiveConnectionState = 2 // There is a connection to the network
+ NmActiveConnectionStateDeactivating NmActiveConnectionState = 3 // The network connection is being torn down and cleaned up
+ NmActiveConnectionStateDeactivated NmActiveConnectionState = 4 // The network connection is disconnected and will be removed
+)
+
+//go:generate stringer -type=NmActivationStateFlag
+type NmActivationStateFlag uint32
+
+const (
+ NmActivationStateFlagNone NmActivationStateFlag = 0x00 // an alias for numeric zero, no flags set.
+ NmActivationStateFlagIsMaster NmActivationStateFlag = 0x01 // the device is a master.
+ NmActivationStateFlagIsSlave NmActivationStateFlag = 0x02 // the device is a slave.
+ NmActivationStateFlagLayer2Ready NmActivationStateFlag = 0x04 // layer2 is activated and ready.
+ NmActivationStateFlagIp4Ready NmActivationStateFlag = 0x08 // IPv4 setting is completed.
+ NmActivationStateFlagIp6Ready NmActivationStateFlag = 0x10 // IPv6 setting is completed.
+ NmActivationStateFlagMasterHasSlaves NmActivationStateFlag = 0x20 // The master has any slave devices attached. This only makes sense if the device is a master.
+ NmActivationStateFlagLifetimeBoundToProfileVisibility NmActivationStateFlag = 0x40 // the lifetime of the activation is bound to the visilibity of the connection profile, which in turn depends on "connection.permissions" and whether a session for the user exists. Since: 1.16
+)
+
+//go:generate stringer -type=NmDeviceType
+type NmDeviceType uint32
+
+const (
+ NmDeviceTypeUnknown NmDeviceType = 0 // unknown device
+ NmDeviceTypeGeneric NmDeviceType = 14 // generic support for unrecognized device types
+ NmDeviceTypeEthernet NmDeviceType = 1 // a wired ethernet device
+ NmDeviceTypeWifi NmDeviceType = 2 // an 802.11 Wi-Fi device
+ NmDeviceTypeUnused1 NmDeviceType = 3 // not used
+ NmDeviceTypeUnused2 NmDeviceType = 4 // not used
+ NmDeviceTypeBt NmDeviceType = 5 // a Bluetooth device supporting PAN or DUN access protocols
+ NmDeviceTypeOlpcMesh NmDeviceType = 6 // an OLPC XO mesh networking device
+ NmDeviceTypeWimax NmDeviceType = 7 // an 802.16e Mobile WiMAX broadband device
+ NmDeviceTypeModem NmDeviceType = 8 // a modem supporting analog telephone, CDMA/EVDO, GSM/UMTS, or LTE network access protocols
+ NmDeviceTypeInfiniband NmDeviceType = 9 // an IP-over-InfiniBand device
+ NmDeviceTypeBond NmDeviceType = 10 // a bond master interface
+ NmDeviceTypeVlan NmDeviceType = 11 // an 802.1Q VLAN interface
+ NmDeviceTypeAdsl NmDeviceType = 12 // ADSL modem
+ NmDeviceTypeBridge NmDeviceType = 13 // a bridge master interface
+ NmDeviceTypeTeam NmDeviceType = 15 // a team master interface
+ NmDeviceTypeTun NmDeviceType = 16 // a TUN or TAP interface
+ NmDeviceTypeIpTunnel NmDeviceType = 17 // a IP tunnel interface
+ NmDeviceTypeMacvlan NmDeviceType = 18 // a MACVLAN interface
+ NmDeviceTypeVxlan NmDeviceType = 19 // a VXLAN interface
+ NmDeviceTypeVeth NmDeviceType = 20 // a VETH interface
+ NmDeviceTypeMacsec NmDeviceType = 21 // a MACsec interface
+ NmDeviceTypeDummy NmDeviceType = 22 // a dummy interface
+ NmDeviceTypePpp NmDeviceType = 23 // a PPP interface
+ NmDeviceTypeOvsInterface NmDeviceType = 24 // a Open vSwitch interface
+ NmDeviceTypeOvsPort NmDeviceType = 25 // a Open vSwitch port
+ NmDeviceTypeOvsBridge NmDeviceType = 26 // a Open vSwitch bridge
+ NmDeviceTypeWpan NmDeviceType = 27 // a IEEE 802.15.4 (WPAN) MAC Layer Device
+ NmDeviceType6lowpan NmDeviceType = 28 // 6LoWPAN interface
+ NmDeviceTypeWireguard NmDeviceType = 29 // a WireGuard interface
+ NmDeviceTypeWifiP2p NmDeviceType = 30 // an 802.11 Wi-Fi P2P device (Since: 1.16)
+)
+
+//go:generate stringer -type=Nm80211APFlags
+type Nm80211APFlags uint32
+
+const (
+ Nm80211APFlagsNone Nm80211APFlags = 0x0
+ Nm80211APFlagsPrivacy Nm80211APFlags = 0x1
+)
+
+//go:generate stringer -type=Nm80211APSec
+type Nm80211APSec uint32
+
+const (
+ Nm80211APSecNone Nm80211APSec = 0x0
+ Nm80211APSecPairWEP40 Nm80211APSec = 0x1
+ Nm80211APSecPairWEP104 Nm80211APSec = 0x2
+ Nm80211APSecPairTKIP Nm80211APSec = 0x4
+ Nm80211APSecPairCCMP Nm80211APSec = 0x8
+ Nm80211APSecGroupWEP40 Nm80211APSec = 0x10
+ Nm80211APSecGroupWEP104 Nm80211APSec = 0x20
+ Nm80211APSecGroupTKIP Nm80211APSec = 0x40
+ Nm80211APSecGroupCCMP Nm80211APSec = 0x80
+ Nm80211APSecKeyMgmtPSK Nm80211APSec = 0x100
+ Nm80211APSecKeyMgmt8021X Nm80211APSec = 0x200
+ Nm80211APSecKeyMgmtSAE Nm80211APSec = 0x400
+ Nm80211APSecKeyMgmtOWE Nm80211APSec = 0x800
+ Nm80211APSecKeyMgmtOWETM Nm80211APSec = 0x1000
+)
+
+//go:generate stringer -type=Nm80211Mode
+type Nm80211Mode uint32
+
+const (
+ Nm80211ModeUnknown Nm80211Mode = 0
+ Nm80211ModeAdhoc Nm80211Mode = 1
+ Nm80211ModeInfra Nm80211Mode = 2
+ Nm80211ModeAp Nm80211Mode = 3
+)
+
+//go:generate stringer -type=NmActiveConnectionState
+type NmVpnConnectionState uint32
+
+const (
+ NmVpnConnectionUnknown = 0 //The state of the VPN connection is unknown.
+ NmVpnConnectionPrepare = 1 //The VPN connection is preparing to connect.
+ NmVpnConnectionNeedAuth = 2 //The VPN connection needs authorization credentials.
+ NmVpnConnectionConnect = 3 //The VPN connection is being established.
+ NmVpnConnectionIpConfigGet = 4 //The VPN connection is getting an IP address.
+ NmVpnConnectionActivated = 5 //The VPN connection is active.
+ NmVpnConnectionFailed = 6 //The VPN connection failed.
+ NmVpnConnectionDisconnected = 7 //The VPN connection is disconnected.
+)
+
+//go:generate stringer -type=NmDeviceStateReason
+type NmDeviceStateReason uint32
+
+const (
+ NmDeviceStateReasonNone = 0 // No reason given
+ NmDeviceStateReasonUnknown = 1 // Unknown error
+ NmDeviceStateReasonNowManaged = 2 // Device is now managed
+ NmDeviceStateReasonNowUnmanaged = 3 // Device is now unmanaged
+ NmDeviceStateReasonConfigFailed = 4 // The device could not be readied for configuration
+ NmDeviceStateReasonIpConfigUnavailable = 5 // IP configuration could not be reserved (no available address, timeout, etc)
+ NmDeviceStateReasonIpConfigExpired = 6 // The IP config is no longer valid
+ NmDeviceStateReasonNoSecrets = 7 // Secrets were required, but not provided
+ NmDeviceStateReasonSupplicantDisconnect = 8 // 802.1x supplicant disconnected
+ NmDeviceStateReasonSupplicantConfigFailed = 9 // 802.1x supplicant configuration failed
+ NmDeviceStateReasonSupplicantFailed = 10 // 802.1x supplicant failed
+ NmDeviceStateReasonSupplicantTimeout = 11 // 802.1x supplicant took too long to authenticate
+ NmDeviceStateReasonPppStartFailed = 12 // PPP service failed to start
+ NmDeviceStateReasonPppDisconnect = 13 // PPP service disconnected
+ NmDeviceStateReasonPppFailed = 14 // PPP failed
+ NmDeviceStateReasonDhcpStartFailed = 15 // DHCP client failed to start
+ NmDeviceStateReasonDhcpError = 16 // DHCP client error
+ NmDeviceStateReasonDhcpFailed = 17 // DHCP client failed
+ NmDeviceStateReasonSharedStartFailed = 18 // Shared connection service failed to start
+ NmDeviceStateReasonSharedFailed = 19 // Shared connection service failed
+ NmDeviceStateReasonAutoipStartFailed = 20 // AutoIP service failed to start
+ NmDeviceStateReasonAutoipError = 21 // AutoIP service error
+ NmDeviceStateReasonAutoipFailed = 22 // AutoIP service failed
+ NmDeviceStateReasonModemBusy = 23 // The line is busy
+ NmDeviceStateReasonModemNoDialTone = 24 // No dial tone
+ NmDeviceStateReasonModemNoCarrier = 25 // No carrier could be established
+ NmDeviceStateReasonModemDialTimeout = 26 // The dialing request timed out
+ NmDeviceStateReasonModemDialFailed = 27 // The dialing attempt failed
+ NmDeviceStateReasonModemInitFailed = 28 // Modem initialization failed
+ NmDeviceStateReasonGsmApnFailed = 29 // Failed to select the specified APN
+ NmDeviceStateReasonGsmRegistrationNotSearching = 30 // Not searching for networks
+ NmDeviceStateReasonGsmRegistrationDenied = 31 // Network registration denied
+ NmDeviceStateReasonGsmRegistrationTimeout = 32 // Network registration timed out
+ NmDeviceStateReasonGsmRegistrationFailed = 33 // Failed to register with the requested network
+ NmDeviceStateReasonGsmPinCheckFailed = 34 // PIN check failed
+ NmDeviceStateReasonFirmwareMissing = 35 // Necessary firmware for the device may be missing
+ NmDeviceStateReasonRemoved = 36 // The device was removed
+ NmDeviceStateReasonSleeping = 37 // NetworkManager went to sleep
+ NmDeviceStateReasonConnectionRemoved = 38 // The device's active connection disappeared
+ NmDeviceStateReasonUserRequested = 39 // Device disconnected by user or client
+ NmDeviceStateReasonCarrier = 40 // Carrier/link changed
+ NmDeviceStateReasonConnectionAssumed = 41 // The device's existing connection was assumed
+ NmDeviceStateReasonSupplicantAvailable = 42 // The supplicant is now available
+ NmDeviceStateReasonModemNotFound = 43 // The modem could not be found
+ NmDeviceStateReasonBtFailed = 44 // The Bluetooth connection failed or timed out
+ NmDeviceStateReasonGsmSimNotInserted = 45 // GSM Modem's SIM Card not inserted
+ NmDeviceStateReasonGsmSimPinRequired = 46 // GSM Modem's SIM Pin required
+ NmDeviceStateReasonGsmSimPukRequired = 47 // GSM Modem's SIM Puk required
+ NmDeviceStateReasonGsmSimWrong = 48 // GSM Modem's SIM wrong
+ NmDeviceStateReasonInfinibandMode = 49 // InfiniBand device does not support connected mode
+ NmDeviceStateReasonDependencyFailed = 50 // A dependency of the connection failed
+ NmDeviceStateReasonBr2684Failed = 51 // Problem with the RFC 2684 Ethernet over ADSL bridge
+ NmDeviceStateReasonModemManagerUnavailable = 52 // ModemManager not running
+ NmDeviceStateReasonSsidNotFound = 53 // The Wi-Fi network could not be found
+ NmDeviceStateReasonSecondaryConnectionFailed = 54 // A secondary connection of the base connection failed
+ NmDeviceStateReasonDcbFcoeFailed = 55 // DCB or FCoE setup failed
+ NmDeviceStateReasonTeamdControlFailed = 56 // teamd control failed
+ NmDeviceStateReasonModemFailed = 57 // Modem failed or no longer available
+ NmDeviceStateReasonModemAvailable = 58 // Modem now ready and available
+ NmDeviceStateReasonSimPinIncorrect = 59 // SIM PIN was incorrect
+ NmDeviceStateReasonNewActivation = 60 // New connection activation was enqueued
+ NmDeviceStateReasonParentChanged = 61 // the device's parent changed
+ NmDeviceStateReasonParentManagedChanged = 62 // the device parent's management changed
+ NmDeviceStateReasonOvsdbFailed = 63 // problem communicating with Open vSwitch database
+ NmDeviceStateReasonIpAddressDuplicate = 64 // a duplicate IP address was detected
+ NmDeviceStateReasonIpMethodUnsupported = 65 // The selected IP method is not supported
+ NmDeviceStateReasonSriovConfigurationFailed = 66 // configuration of SR-IOV parameters failed
+ NmDeviceStateReasonPeerNotFound = 67 // The Wi-Fi P2P peer could not be found
+)
+
+//go:generate stringer -type=NmActiveConnectionStateReason
+type NmActiveConnectionStateReason uint32
+
+const (
+ NmActiveConnectionStateReasonUnknown = 0 // The reason for the active connection state change is unknown.
+ NmActiveConnectionStateReasonNone = 1 // No reason was given for the active connection state change.
+ NmActiveConnectionStateReasonUserDisconnected = 2 // The active connection changed state because the user disconnected it.
+ NmActiveConnectionStateReasonDeviceDisconnected = 3 // The active connection changed state because the device it was using was disconnected.
+ NmActiveConnectionStateReasonServiceStopped = 4 // The service providing the VPN connection was stopped.
+ NmActiveConnectionStateReasonIpConfigInvalid = 5 // The IP config of the active connection was invalid.
+ NmActiveConnectionStateReasonConnectTimeout = 6 // The connection attempt to the VPN service timed out.
+ NmActiveConnectionStateReasonServiceStartTimeout = 7 // A timeout occurred while starting the service providing the VPN connection.
+ NmActiveConnectionStateReasonServiceStartFailed = 8 // Starting the service providing the VPN connection failed.
+ NmActiveConnectionStateReasonNoSecrets = 9 // Necessary secrets for the connection were not provided.
+ NmActiveConnectionStateReasonLoginFailed = 10 // Authentication to the server failed.
+ NmActiveConnectionStateReasonConnectionRemoved = 11 // The connection was deleted from settings.
+ NmActiveConnectionStateReasonDependencyFailed = 12 // Master connection of this connection failed to activate.
+ NmActiveConnectionStateReasonDeviceRealizeFailed = 13 // Could not create the software device link.
+ NmActiveConnectionStateReasonDeviceRemoved = 14 // The device this connection depended on disappeared.
+)
+
+//go:generate stringer -type=NmRollbackResult
+type NmRollbackResult uint32
+
+const (
+ NmRollbackResultOk = 0 // the rollback succeeded.
+ NmRollbackResultErrNoDevice = 1 // the device no longer exists.
+ NmRollbackResultErrDeviceUnmanaged = 2 // the device is now unmanaged.
+ NmRollbackResultErrFailed = 3 // other errors during rollback.
+)
diff --git a/archive/vendor/github.com/Wifx/gonetworkmanager/v2/nm80211apflags_string.go b/archive/vendor/github.com/Wifx/gonetworkmanager/v2/nm80211apflags_string.go
new file mode 100644
index 0000000..8213550
--- /dev/null
+++ b/archive/vendor/github.com/Wifx/gonetworkmanager/v2/nm80211apflags_string.go
@@ -0,0 +1,24 @@
+// Code generated by "stringer -type=Nm80211APFlags"; DO NOT EDIT.
+
+package gonetworkmanager
+
+import "strconv"
+
+func _() {
+ // An "invalid array index" compiler error signifies that the constant values have changed.
+ // Re-run the stringer command to generate them again.
+ var x [1]struct{}
+ _ = x[Nm80211APFlagsNone-0]
+ _ = x[Nm80211APFlagsPrivacy-1]
+}
+
+const _Nm80211APFlags_name = "Nm80211APFlagsNoneNm80211APFlagsPrivacy"
+
+var _Nm80211APFlags_index = [...]uint8{0, 18, 39}
+
+func (i Nm80211APFlags) String() string {
+ if i >= Nm80211APFlags(len(_Nm80211APFlags_index)-1) {
+ return "Nm80211APFlags(" + strconv.FormatInt(int64(i), 10) + ")"
+ }
+ return _Nm80211APFlags_name[_Nm80211APFlags_index[i]:_Nm80211APFlags_index[i+1]]
+}
diff --git a/archive/vendor/github.com/Wifx/gonetworkmanager/v2/nm80211apsec_string.go b/archive/vendor/github.com/Wifx/gonetworkmanager/v2/nm80211apsec_string.go
new file mode 100644
index 0000000..030ddf3
--- /dev/null
+++ b/archive/vendor/github.com/Wifx/gonetworkmanager/v2/nm80211apsec_string.go
@@ -0,0 +1,51 @@
+// Code generated by "stringer -type=Nm80211APSec"; DO NOT EDIT.
+
+package gonetworkmanager
+
+import "strconv"
+
+func _() {
+ // An "invalid array index" compiler error signifies that the constant values have changed.
+ // Re-run the stringer command to generate them again.
+ var x [1]struct{}
+ _ = x[Nm80211APSecNone-0]
+ _ = x[Nm80211APSecPairWEP40-1]
+ _ = x[Nm80211APSecPairWEP104-2]
+ _ = x[Nm80211APSecPairTKIP-4]
+ _ = x[Nm80211APSecPairCCMP-8]
+ _ = x[Nm80211APSecGroupWEP40-16]
+ _ = x[Nm80211APSecGroupWEP104-32]
+ _ = x[Nm80211APSecGroupTKIP-64]
+ _ = x[Nm80211APSecGroupCCMP-128]
+ _ = x[Nm80211APSecKeyMgmtPSK-256]
+ _ = x[Nm80211APSecKeyMgmt8021X-512]
+ _ = x[Nm80211APSecKeyMgmtSAE-1024]
+ _ = x[Nm80211APSecKeyMgmtOWE-2048]
+ _ = x[Nm80211APSecKeyMgmtOWETM-4096]
+}
+
+const _Nm80211APSec_name = "Nm80211APSecNoneNm80211APSecPairWEP40Nm80211APSecPairWEP104Nm80211APSecPairTKIPNm80211APSecPairCCMPNm80211APSecGroupWEP40Nm80211APSecGroupWEP104Nm80211APSecGroupTKIPNm80211APSecGroupCCMPNm80211APSecKeyMgmtPSKNm80211APSecKeyMgmt8021XNm80211APSecKeyMgmtSAENm80211APSecKeyMgmtOWENm80211APSecKeyMgmtOWETM"
+
+var _Nm80211APSec_map = map[Nm80211APSec]string{
+ 0: _Nm80211APSec_name[0:16],
+ 1: _Nm80211APSec_name[16:37],
+ 2: _Nm80211APSec_name[37:59],
+ 4: _Nm80211APSec_name[59:79],
+ 8: _Nm80211APSec_name[79:99],
+ 16: _Nm80211APSec_name[99:121],
+ 32: _Nm80211APSec_name[121:144],
+ 64: _Nm80211APSec_name[144:165],
+ 128: _Nm80211APSec_name[165:186],
+ 256: _Nm80211APSec_name[186:208],
+ 512: _Nm80211APSec_name[208:232],
+ 1024: _Nm80211APSec_name[232:254],
+ 2048: _Nm80211APSec_name[254:276],
+ 4096: _Nm80211APSec_name[276:300],
+}
+
+func (i Nm80211APSec) String() string {
+ if str, ok := _Nm80211APSec_map[i]; ok {
+ return str
+ }
+ return "Nm80211APSec(" + strconv.FormatInt(int64(i), 10) + ")"
+}
diff --git a/archive/vendor/github.com/Wifx/gonetworkmanager/v2/nm80211mode_string.go b/archive/vendor/github.com/Wifx/gonetworkmanager/v2/nm80211mode_string.go
new file mode 100644
index 0000000..477062f
--- /dev/null
+++ b/archive/vendor/github.com/Wifx/gonetworkmanager/v2/nm80211mode_string.go
@@ -0,0 +1,26 @@
+// Code generated by "stringer -type=Nm80211Mode"; DO NOT EDIT.
+
+package gonetworkmanager
+
+import "strconv"
+
+func _() {
+ // An "invalid array index" compiler error signifies that the constant values have changed.
+ // Re-run the stringer command to generate them again.
+ var x [1]struct{}
+ _ = x[Nm80211ModeUnknown-0]
+ _ = x[Nm80211ModeAdhoc-1]
+ _ = x[Nm80211ModeInfra-2]
+ _ = x[Nm80211ModeAp-3]
+}
+
+const _Nm80211Mode_name = "Nm80211ModeUnknownNm80211ModeAdhocNm80211ModeInfraNm80211ModeAp"
+
+var _Nm80211Mode_index = [...]uint8{0, 18, 34, 50, 63}
+
+func (i Nm80211Mode) String() string {
+ if i >= Nm80211Mode(len(_Nm80211Mode_index)-1) {
+ return "Nm80211Mode(" + strconv.FormatInt(int64(i), 10) + ")"
+ }
+ return _Nm80211Mode_name[_Nm80211Mode_index[i]:_Nm80211Mode_index[i+1]]
+}
diff --git a/archive/vendor/github.com/Wifx/gonetworkmanager/v2/nmactivationstateflag_string.go b/archive/vendor/github.com/Wifx/gonetworkmanager/v2/nmactivationstateflag_string.go
new file mode 100644
index 0000000..6444a2c
--- /dev/null
+++ b/archive/vendor/github.com/Wifx/gonetworkmanager/v2/nmactivationstateflag_string.go
@@ -0,0 +1,51 @@
+// Code generated by "stringer -type=NmActivationStateFlag"; DO NOT EDIT.
+
+package gonetworkmanager
+
+import "strconv"
+
+func _() {
+ // An "invalid array index" compiler error signifies that the constant values have changed.
+ // Re-run the stringer command to generate them again.
+ var x [1]struct{}
+ _ = x[NmActivationStateFlagNone-0]
+ _ = x[NmActivationStateFlagIsMaster-1]
+ _ = x[NmActivationStateFlagIsSlave-2]
+ _ = x[NmActivationStateFlagLayer2Ready-4]
+ _ = x[NmActivationStateFlagIp4Ready-8]
+ _ = x[NmActivationStateFlagIp6Ready-16]
+ _ = x[NmActivationStateFlagMasterHasSlaves-32]
+ _ = x[NmActivationStateFlagLifetimeBoundToProfileVisibility-64]
+}
+
+const (
+ _NmActivationStateFlag_name_0 = "NmActivationStateFlagNoneNmActivationStateFlagIsMasterNmActivationStateFlagIsSlave"
+ _NmActivationStateFlag_name_1 = "NmActivationStateFlagLayer2Ready"
+ _NmActivationStateFlag_name_2 = "NmActivationStateFlagIp4Ready"
+ _NmActivationStateFlag_name_3 = "NmActivationStateFlagIp6Ready"
+ _NmActivationStateFlag_name_4 = "NmActivationStateFlagMasterHasSlaves"
+ _NmActivationStateFlag_name_5 = "NmActivationStateFlagLifetimeBoundToProfileVisibility"
+)
+
+var (
+ _NmActivationStateFlag_index_0 = [...]uint8{0, 25, 54, 82}
+)
+
+func (i NmActivationStateFlag) String() string {
+ switch {
+ case 0 <= i && i <= 2:
+ return _NmActivationStateFlag_name_0[_NmActivationStateFlag_index_0[i]:_NmActivationStateFlag_index_0[i+1]]
+ case i == 4:
+ return _NmActivationStateFlag_name_1
+ case i == 8:
+ return _NmActivationStateFlag_name_2
+ case i == 16:
+ return _NmActivationStateFlag_name_3
+ case i == 32:
+ return _NmActivationStateFlag_name_4
+ case i == 64:
+ return _NmActivationStateFlag_name_5
+ default:
+ return "NmActivationStateFlag(" + strconv.FormatInt(int64(i), 10) + ")"
+ }
+}
diff --git a/archive/vendor/github.com/Wifx/gonetworkmanager/v2/nmactiveconnectionstate_string.go b/archive/vendor/github.com/Wifx/gonetworkmanager/v2/nmactiveconnectionstate_string.go
new file mode 100644
index 0000000..ad2e4ce
--- /dev/null
+++ b/archive/vendor/github.com/Wifx/gonetworkmanager/v2/nmactiveconnectionstate_string.go
@@ -0,0 +1,27 @@
+// Code generated by "stringer -type=NmActiveConnectionState"; DO NOT EDIT.
+
+package gonetworkmanager
+
+import "strconv"
+
+func _() {
+ // An "invalid array index" compiler error signifies that the constant values have changed.
+ // Re-run the stringer command to generate them again.
+ var x [1]struct{}
+ _ = x[NmActiveConnectionStateUnknown-0]
+ _ = x[NmActiveConnectionStateActivating-1]
+ _ = x[NmActiveConnectionStateActivated-2]
+ _ = x[NmActiveConnectionStateDeactivating-3]
+ _ = x[NmActiveConnectionStateDeactivated-4]
+}
+
+const _NmActiveConnectionState_name = "NmActiveConnectionStateUnknownNmActiveConnectionStateActivatingNmActiveConnectionStateActivatedNmActiveConnectionStateDeactivatingNmActiveConnectionStateDeactivated"
+
+var _NmActiveConnectionState_index = [...]uint8{0, 30, 63, 95, 130, 164}
+
+func (i NmActiveConnectionState) String() string {
+ if i >= NmActiveConnectionState(len(_NmActiveConnectionState_index)-1) {
+ return "NmActiveConnectionState(" + strconv.FormatInt(int64(i), 10) + ")"
+ }
+ return _NmActiveConnectionState_name[_NmActiveConnectionState_index[i]:_NmActiveConnectionState_index[i+1]]
+}
diff --git a/archive/vendor/github.com/Wifx/gonetworkmanager/v2/nmcapability_string.go b/archive/vendor/github.com/Wifx/gonetworkmanager/v2/nmcapability_string.go
new file mode 100644
index 0000000..2fcbf34
--- /dev/null
+++ b/archive/vendor/github.com/Wifx/gonetworkmanager/v2/nmcapability_string.go
@@ -0,0 +1,24 @@
+// Code generated by "stringer -type=NmCapability"; DO NOT EDIT.
+
+package gonetworkmanager
+
+import "strconv"
+
+func _() {
+ // An "invalid array index" compiler error signifies that the constant values have changed.
+ // Re-run the stringer command to generate them again.
+ var x [1]struct{}
+ _ = x[NmCapabilityTeam-1]
+}
+
+const _NmCapability_name = "NmCapabilityTeam"
+
+var _NmCapability_index = [...]uint8{0, 16}
+
+func (i NmCapability) String() string {
+ i -= 1
+ if i >= NmCapability(len(_NmCapability_index)-1) {
+ return "NmCapability(" + strconv.FormatInt(int64(i+1), 10) + ")"
+ }
+ return _NmCapability_name[_NmCapability_index[i]:_NmCapability_index[i+1]]
+}
diff --git a/archive/vendor/github.com/Wifx/gonetworkmanager/v2/nmcheckpointcreateflags_string.go b/archive/vendor/github.com/Wifx/gonetworkmanager/v2/nmcheckpointcreateflags_string.go
new file mode 100644
index 0000000..8e7cc99
--- /dev/null
+++ b/archive/vendor/github.com/Wifx/gonetworkmanager/v2/nmcheckpointcreateflags_string.go
@@ -0,0 +1,39 @@
+// Code generated by "stringer -type=NmCheckpointCreateFlags"; DO NOT EDIT.
+
+package gonetworkmanager
+
+import "strconv"
+
+func _() {
+ // An "invalid array index" compiler error signifies that the constant values have changed.
+ // Re-run the stringer command to generate them again.
+ var x [1]struct{}
+ _ = x[NmCheckpointCreateFlagsNone-0]
+ _ = x[NmCheckpointCreateFlagsDestroyAll-1]
+ _ = x[NmCheckpointCreateFlagsDeleteNewConnections-2]
+ _ = x[NmCheckpointCreateFlagsDisconnectNewDevices-4]
+ _ = x[NmCheckpointCreateFlagsAllowOverlapping-8]
+}
+
+const (
+ _NmCheckpointCreateFlags_name_0 = "NmCheckpointCreateFlagsNoneNmCheckpointCreateFlagsDestroyAllNmCheckpointCreateFlagsDeleteNewConnections"
+ _NmCheckpointCreateFlags_name_1 = "NmCheckpointCreateFlagsDisconnectNewDevices"
+ _NmCheckpointCreateFlags_name_2 = "NmCheckpointCreateFlagsAllowOverlapping"
+)
+
+var (
+ _NmCheckpointCreateFlags_index_0 = [...]uint8{0, 27, 60, 103}
+)
+
+func (i NmCheckpointCreateFlags) String() string {
+ switch {
+ case 0 <= i && i <= 2:
+ return _NmCheckpointCreateFlags_name_0[_NmCheckpointCreateFlags_index_0[i]:_NmCheckpointCreateFlags_index_0[i+1]]
+ case i == 4:
+ return _NmCheckpointCreateFlags_name_1
+ case i == 8:
+ return _NmCheckpointCreateFlags_name_2
+ default:
+ return "NmCheckpointCreateFlags(" + strconv.FormatInt(int64(i), 10) + ")"
+ }
+}
diff --git a/archive/vendor/github.com/Wifx/gonetworkmanager/v2/nmconnectivity_string.go b/archive/vendor/github.com/Wifx/gonetworkmanager/v2/nmconnectivity_string.go
new file mode 100644
index 0000000..cb8605b
--- /dev/null
+++ b/archive/vendor/github.com/Wifx/gonetworkmanager/v2/nmconnectivity_string.go
@@ -0,0 +1,27 @@
+// Code generated by "stringer -type=NmConnectivity"; DO NOT EDIT.
+
+package gonetworkmanager
+
+import "strconv"
+
+func _() {
+ // An "invalid array index" compiler error signifies that the constant values have changed.
+ // Re-run the stringer command to generate them again.
+ var x [1]struct{}
+ _ = x[NmConnectivityUnknown-0]
+ _ = x[NmConnectivityNone-1]
+ _ = x[NmConnectivityPortal-2]
+ _ = x[NmConnectivityLimited-3]
+ _ = x[NmConnectivityFull-4]
+}
+
+const _NmConnectivity_name = "NmConnectivityUnknownNmConnectivityNoneNmConnectivityPortalNmConnectivityLimitedNmConnectivityFull"
+
+var _NmConnectivity_index = [...]uint8{0, 21, 39, 59, 80, 98}
+
+func (i NmConnectivity) String() string {
+ if i >= NmConnectivity(len(_NmConnectivity_index)-1) {
+ return "NmConnectivity(" + strconv.FormatInt(int64(i), 10) + ")"
+ }
+ return _NmConnectivity_name[_NmConnectivity_index[i]:_NmConnectivity_index[i+1]]
+}
diff --git a/archive/vendor/github.com/Wifx/gonetworkmanager/v2/nmdevicestate_string.go b/archive/vendor/github.com/Wifx/gonetworkmanager/v2/nmdevicestate_string.go
new file mode 100644
index 0000000..1243ea7
--- /dev/null
+++ b/archive/vendor/github.com/Wifx/gonetworkmanager/v2/nmdevicestate_string.go
@@ -0,0 +1,49 @@
+// Code generated by "stringer -type=NmDeviceState"; DO NOT EDIT.
+
+package gonetworkmanager
+
+import "strconv"
+
+func _() {
+ // An "invalid array index" compiler error signifies that the constant values have changed.
+ // Re-run the stringer command to generate them again.
+ var x [1]struct{}
+ _ = x[NmDeviceStateUnknown-0]
+ _ = x[NmDeviceStateUnmanaged-10]
+ _ = x[NmDeviceStateUnavailable-20]
+ _ = x[NmDeviceStateDisconnected-30]
+ _ = x[NmDeviceStatePrepare-40]
+ _ = x[NmDeviceStateConfig-50]
+ _ = x[NmDeviceStateNeedAuth-60]
+ _ = x[NmDeviceStateIpConfig-70]
+ _ = x[NmDeviceStateIpCheck-80]
+ _ = x[NmDeviceStateSecondaries-90]
+ _ = x[NmDeviceStateActivated-100]
+ _ = x[NmDeviceStateDeactivating-110]
+ _ = x[NmDeviceStateFailed-120]
+}
+
+const _NmDeviceState_name = "NmDeviceStateUnknownNmDeviceStateUnmanagedNmDeviceStateUnavailableNmDeviceStateDisconnectedNmDeviceStatePrepareNmDeviceStateConfigNmDeviceStateNeedAuthNmDeviceStateIpConfigNmDeviceStateIpCheckNmDeviceStateSecondariesNmDeviceStateActivatedNmDeviceStateDeactivatingNmDeviceStateFailed"
+
+var _NmDeviceState_map = map[NmDeviceState]string{
+ 0: _NmDeviceState_name[0:20],
+ 10: _NmDeviceState_name[20:42],
+ 20: _NmDeviceState_name[42:66],
+ 30: _NmDeviceState_name[66:91],
+ 40: _NmDeviceState_name[91:111],
+ 50: _NmDeviceState_name[111:130],
+ 60: _NmDeviceState_name[130:151],
+ 70: _NmDeviceState_name[151:172],
+ 80: _NmDeviceState_name[172:192],
+ 90: _NmDeviceState_name[192:216],
+ 100: _NmDeviceState_name[216:238],
+ 110: _NmDeviceState_name[238:263],
+ 120: _NmDeviceState_name[263:282],
+}
+
+func (i NmDeviceState) String() string {
+ if str, ok := _NmDeviceState_map[i]; ok {
+ return str
+ }
+ return "NmDeviceState(" + strconv.FormatInt(int64(i), 10) + ")"
+}
diff --git a/archive/vendor/github.com/Wifx/gonetworkmanager/v2/nmdevicetype_string.go b/archive/vendor/github.com/Wifx/gonetworkmanager/v2/nmdevicetype_string.go
new file mode 100644
index 0000000..d5003b5
--- /dev/null
+++ b/archive/vendor/github.com/Wifx/gonetworkmanager/v2/nmdevicetype_string.go
@@ -0,0 +1,53 @@
+// Code generated by "stringer -type=NmDeviceType"; DO NOT EDIT.
+
+package gonetworkmanager
+
+import "strconv"
+
+func _() {
+ // An "invalid array index" compiler error signifies that the constant values have changed.
+ // Re-run the stringer command to generate them again.
+ var x [1]struct{}
+ _ = x[NmDeviceTypeUnknown-0]
+ _ = x[NmDeviceTypeGeneric-14]
+ _ = x[NmDeviceTypeEthernet-1]
+ _ = x[NmDeviceTypeWifi-2]
+ _ = x[NmDeviceTypeUnused1-3]
+ _ = x[NmDeviceTypeUnused2-4]
+ _ = x[NmDeviceTypeBt-5]
+ _ = x[NmDeviceTypeOlpcMesh-6]
+ _ = x[NmDeviceTypeWimax-7]
+ _ = x[NmDeviceTypeModem-8]
+ _ = x[NmDeviceTypeInfiniband-9]
+ _ = x[NmDeviceTypeBond-10]
+ _ = x[NmDeviceTypeVlan-11]
+ _ = x[NmDeviceTypeAdsl-12]
+ _ = x[NmDeviceTypeBridge-13]
+ _ = x[NmDeviceTypeTeam-15]
+ _ = x[NmDeviceTypeTun-16]
+ _ = x[NmDeviceTypeIpTunnel-17]
+ _ = x[NmDeviceTypeMacvlan-18]
+ _ = x[NmDeviceTypeVxlan-19]
+ _ = x[NmDeviceTypeVeth-20]
+ _ = x[NmDeviceTypeMacsec-21]
+ _ = x[NmDeviceTypeDummy-22]
+ _ = x[NmDeviceTypePpp-23]
+ _ = x[NmDeviceTypeOvsInterface-24]
+ _ = x[NmDeviceTypeOvsPort-25]
+ _ = x[NmDeviceTypeOvsBridge-26]
+ _ = x[NmDeviceTypeWpan-27]
+ _ = x[NmDeviceType6lowpan-28]
+ _ = x[NmDeviceTypeWireguard-29]
+ _ = x[NmDeviceTypeWifiP2p-30]
+}
+
+const _NmDeviceType_name = "NmDeviceTypeUnknownNmDeviceTypeEthernetNmDeviceTypeWifiNmDeviceTypeUnused1NmDeviceTypeUnused2NmDeviceTypeBtNmDeviceTypeOlpcMeshNmDeviceTypeWimaxNmDeviceTypeModemNmDeviceTypeInfinibandNmDeviceTypeBondNmDeviceTypeVlanNmDeviceTypeAdslNmDeviceTypeBridgeNmDeviceTypeGenericNmDeviceTypeTeamNmDeviceTypeTunNmDeviceTypeIpTunnelNmDeviceTypeMacvlanNmDeviceTypeVxlanNmDeviceTypeVethNmDeviceTypeMacsecNmDeviceTypeDummyNmDeviceTypePppNmDeviceTypeOvsInterfaceNmDeviceTypeOvsPortNmDeviceTypeOvsBridgeNmDeviceTypeWpanNmDeviceType6lowpanNmDeviceTypeWireguardNmDeviceTypeWifiP2p"
+
+var _NmDeviceType_index = [...]uint16{0, 19, 39, 55, 74, 93, 107, 127, 144, 161, 183, 199, 215, 231, 249, 268, 284, 299, 319, 338, 355, 371, 389, 406, 421, 445, 464, 485, 501, 520, 541, 560}
+
+func (i NmDeviceType) String() string {
+ if i >= NmDeviceType(len(_NmDeviceType_index)-1) {
+ return "NmDeviceType(" + strconv.FormatInt(int64(i), 10) + ")"
+ }
+ return _NmDeviceType_name[_NmDeviceType_index[i]:_NmDeviceType_index[i+1]]
+}
diff --git a/archive/vendor/github.com/Wifx/gonetworkmanager/v2/nmmetered_string.go b/archive/vendor/github.com/Wifx/gonetworkmanager/v2/nmmetered_string.go
new file mode 100644
index 0000000..0723c13
--- /dev/null
+++ b/archive/vendor/github.com/Wifx/gonetworkmanager/v2/nmmetered_string.go
@@ -0,0 +1,27 @@
+// Code generated by "stringer -type=NmMetered"; DO NOT EDIT.
+
+package gonetworkmanager
+
+import "strconv"
+
+func _() {
+ // An "invalid array index" compiler error signifies that the constant values have changed.
+ // Re-run the stringer command to generate them again.
+ var x [1]struct{}
+ _ = x[NmMeteredUnknown-0]
+ _ = x[NmMeteredYes-1]
+ _ = x[NmMeteredNo-2]
+ _ = x[NmMeteredGuessYes-3]
+ _ = x[NmMeteredGuessNo-4]
+}
+
+const _NmMetered_name = "NmMeteredUnknownNmMeteredYesNmMeteredNoNmMeteredGuessYesNmMeteredGuessNo"
+
+var _NmMetered_index = [...]uint8{0, 16, 28, 39, 56, 72}
+
+func (i NmMetered) String() string {
+ if i >= NmMetered(len(_NmMetered_index)-1) {
+ return "NmMetered(" + strconv.FormatInt(int64(i), 10) + ")"
+ }
+ return _NmMetered_name[_NmMetered_index[i]:_NmMetered_index[i+1]]
+}
diff --git a/archive/vendor/github.com/Wifx/gonetworkmanager/v2/nmstate_string.go b/archive/vendor/github.com/Wifx/gonetworkmanager/v2/nmstate_string.go
new file mode 100644
index 0000000..30dcaf4
--- /dev/null
+++ b/archive/vendor/github.com/Wifx/gonetworkmanager/v2/nmstate_string.go
@@ -0,0 +1,53 @@
+// Code generated by "stringer -type=NmState"; DO NOT EDIT.
+
+package gonetworkmanager
+
+import "strconv"
+
+func _() {
+ // An "invalid array index" compiler error signifies that the constant values have changed.
+ // Re-run the stringer command to generate them again.
+ var x [1]struct{}
+ _ = x[NmStateUnknown-0]
+ _ = x[NmStateAsleep-10]
+ _ = x[NmStateDisconnected-20]
+ _ = x[NmStateDisconnecting-30]
+ _ = x[NmStateConnecting-40]
+ _ = x[NmStateConnectedLocal-50]
+ _ = x[NmStateConnectedSite-60]
+ _ = x[NmStateConnectedGlobal-70]
+}
+
+const (
+ _NmState_name_0 = "NmStateUnknown"
+ _NmState_name_1 = "NmStateAsleep"
+ _NmState_name_2 = "NmStateDisconnected"
+ _NmState_name_3 = "NmStateDisconnecting"
+ _NmState_name_4 = "NmStateConnecting"
+ _NmState_name_5 = "NmStateConnectedLocal"
+ _NmState_name_6 = "NmStateConnectedSite"
+ _NmState_name_7 = "NmStateConnectedGlobal"
+)
+
+func (i NmState) String() string {
+ switch {
+ case i == 0:
+ return _NmState_name_0
+ case i == 10:
+ return _NmState_name_1
+ case i == 20:
+ return _NmState_name_2
+ case i == 30:
+ return _NmState_name_3
+ case i == 40:
+ return _NmState_name_4
+ case i == 50:
+ return _NmState_name_5
+ case i == 60:
+ return _NmState_name_6
+ case i == 70:
+ return _NmState_name_7
+ default:
+ return "NmState(" + strconv.FormatInt(int64(i), 10) + ")"
+ }
+}
diff --git a/archive/vendor/github.com/Wifx/gonetworkmanager/v2/utils.go b/archive/vendor/github.com/Wifx/gonetworkmanager/v2/utils.go
new file mode 100644
index 0000000..4e1f01b
--- /dev/null
+++ b/archive/vendor/github.com/Wifx/gonetworkmanager/v2/utils.go
@@ -0,0 +1,282 @@
+package gonetworkmanager
+
+import (
+ "encoding/binary"
+ "fmt"
+ "net"
+
+ "github.com/godbus/dbus/v5"
+)
+
+const (
+ dbusMethodAddMatch = "org.freedesktop.DBus.AddMatch"
+)
+
+type dbusBase struct {
+ conn *dbus.Conn
+ obj dbus.BusObject
+}
+
+func (d *dbusBase) init(iface string, objectPath dbus.ObjectPath) error {
+ var err error
+
+ d.conn, err = dbus.SystemBus()
+ if err != nil {
+ return err
+ }
+
+ d.obj = d.conn.Object(iface, objectPath)
+
+ return nil
+}
+
+func (d *dbusBase) call(method string, args ...interface{}) error {
+ return d.obj.Call(method, 0, args...).Err
+}
+
+func (d *dbusBase) callWithReturn(ret interface{}, method string, args ...interface{}) error {
+ return d.obj.Call(method, 0, args...).Store(ret)
+}
+
+func (d *dbusBase) callWithReturn2(ret1 interface{}, ret2 interface{}, method string, args ...interface{}) error {
+ return d.obj.Call(method, 0, args...).Store(ret1, ret2)
+}
+
+func (d *dbusBase) subscribe(iface, member string) {
+ rule := fmt.Sprintf("type='signal',interface='%s',path='%s',member='%s'",
+ iface, d.obj.Path(), NetworkManagerInterface)
+ d.conn.BusObject().Call(dbusMethodAddMatch, 0, rule)
+}
+
+func (d *dbusBase) subscribeNamespace(namespace string) {
+ rule := fmt.Sprintf("type='signal',path_namespace='%s'", namespace)
+ d.conn.BusObject().Call(dbusMethodAddMatch, 0, rule)
+}
+
+func (d *dbusBase) getProperty(iface string) (interface{}, error) {
+ variant, err := d.obj.GetProperty(iface)
+ return variant.Value(), err
+}
+
+func (d *dbusBase) setProperty(iface string, value interface{}) error {
+ err := d.obj.SetProperty(iface, dbus.MakeVariant(value))
+ return err
+}
+
+func (d *dbusBase) getObjectProperty(iface string) (value dbus.ObjectPath, err error) {
+ prop, err := d.getProperty(iface)
+ if err != nil {
+ return
+ }
+ value, ok := prop.(dbus.ObjectPath)
+ if !ok {
+ err = makeErrVariantType(iface)
+ return
+ }
+ return
+}
+
+func (d *dbusBase) getSliceObjectProperty(iface string) (value []dbus.ObjectPath, err error) {
+ prop, err := d.getProperty(iface)
+ if err != nil {
+ return
+ }
+ value, ok := prop.([]dbus.ObjectPath)
+ if !ok {
+ err = makeErrVariantType(iface)
+ return
+ }
+ return
+}
+
+func (d *dbusBase) getBoolProperty(iface string) (value bool, err error) {
+ prop, err := d.getProperty(iface)
+ if err != nil {
+ return
+ }
+ value, ok := prop.(bool)
+ if !ok {
+ err = makeErrVariantType(iface)
+ return
+ }
+ return
+}
+
+func (d *dbusBase) getStringProperty(iface string) (value string, err error) {
+ prop, err := d.getProperty(iface)
+ if err != nil {
+ return
+ }
+ value, ok := prop.(string)
+ if !ok {
+ err = makeErrVariantType(iface)
+ return
+ }
+ return
+}
+
+func (d *dbusBase) getSliceStringProperty(iface string) (value []string, err error) {
+ prop, err := d.getProperty(iface)
+ if err != nil {
+ return
+ }
+ value, ok := prop.([]string)
+ if !ok {
+ err = makeErrVariantType(iface)
+ return
+ }
+ return
+}
+
+func (d *dbusBase) getSliceSliceByteProperty(iface string) (value [][]byte, err error) {
+ prop, err := d.getProperty(iface)
+ if err != nil {
+ return
+ }
+ value, ok := prop.([][]byte)
+ if !ok {
+ err = makeErrVariantType(iface)
+ return
+ }
+ return
+}
+
+func (d *dbusBase) getMapStringVariantProperty(iface string) (value map[string]dbus.Variant, err error) {
+ prop, err := d.getProperty(iface)
+ if err != nil {
+ return
+ }
+ value, ok := prop.(map[string]dbus.Variant)
+ if !ok {
+ err = makeErrVariantType(iface)
+ return
+ }
+ return
+}
+
+func (d *dbusBase) getUint8Property(iface string) (value uint8, err error) {
+ prop, err := d.getProperty(iface)
+ if err != nil {
+ return
+ }
+ value, ok := prop.(uint8)
+ if !ok {
+ err = makeErrVariantType(iface)
+ return
+ }
+ return
+}
+
+func (d *dbusBase) getUint32Property(iface string) (value uint32, err error) {
+ prop, err := d.getProperty(iface)
+ if err != nil {
+ return
+ }
+ value, ok := prop.(uint32)
+ if !ok {
+ err = makeErrVariantType(iface)
+ return
+ }
+ return
+}
+
+func (d *dbusBase) getInt32Property(iface string) (value int32, err error) {
+ prop, err := d.getProperty(iface)
+ if err != nil {
+ return
+ }
+ value, ok := prop.(int32)
+ if !ok {
+ err = makeErrVariantType(iface)
+ return
+ }
+ return
+}
+
+func (d *dbusBase) getInt64Property(iface string) (value int64, err error) {
+ prop, err := d.getProperty(iface)
+ if err != nil {
+ return
+ }
+ value, ok := prop.(int64)
+ if !ok {
+ err = makeErrVariantType(iface)
+ return
+ }
+ return
+}
+
+func (d *dbusBase) getUint64Property(iface string) (value uint64, err error) {
+ prop, err := d.getProperty(iface)
+ if err != nil {
+ return
+ }
+ value, ok := prop.(uint64)
+ if !ok {
+ err = makeErrVariantType(iface)
+ return
+ }
+ return
+}
+
+func (d *dbusBase) getSliceUint32Property(iface string) (value []uint32, err error) {
+ prop, err := d.getProperty(iface)
+ if err != nil {
+ return
+ }
+ value, ok := prop.([]uint32)
+ if !ok {
+ err = makeErrVariantType(iface)
+ return
+ }
+ return
+}
+
+func (d *dbusBase) getSliceSliceUint32Property(iface string) (value [][]uint32, err error) {
+ prop, err := d.getProperty(iface)
+ if err != nil {
+ return
+ }
+ value, ok := prop.([][]uint32)
+ if !ok {
+ err = makeErrVariantType(iface)
+ return
+ }
+ return
+}
+
+func (d *dbusBase) getSliceMapStringVariantProperty(iface string) (value []map[string]dbus.Variant, err error) {
+ prop, err := d.getProperty(iface)
+ if err != nil {
+ return
+ }
+ value, ok := prop.([]map[string]dbus.Variant)
+ if !ok {
+ err = makeErrVariantType(iface)
+ return
+ }
+ return
+}
+
+func (d *dbusBase) getSliceByteProperty(iface string) (value []byte, err error) {
+ prop, err := d.getProperty(iface)
+ if err != nil {
+ return
+ }
+ value, ok := prop.([]byte)
+ if !ok {
+ err = makeErrVariantType(iface)
+ return
+ }
+ return
+}
+
+func makeErrVariantType(iface string) error {
+ return fmt.Errorf("unexpected variant type for '%s'", iface)
+}
+
+func ip4ToString(ip uint32) string {
+ bs := []byte{0, 0, 0, 0}
+ binary.LittleEndian.PutUint32(bs, ip)
+ return net.IP(bs).String()
+}
diff --git a/archive/vendor/github.com/go-gl/gl/LICENSE b/archive/vendor/github.com/go-gl/gl/LICENSE
new file mode 100644
index 0000000..bac95ec
--- /dev/null
+++ b/archive/vendor/github.com/go-gl/gl/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2014 Eric Woroshow
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
\ No newline at end of file
diff --git a/archive/vendor/github.com/go-gl/gl/v3.3-core/gl/KHR/dummy.go b/archive/vendor/github.com/go-gl/gl/v3.3-core/gl/KHR/dummy.go
new file mode 100644
index 0000000..9bdbdef
--- /dev/null
+++ b/archive/vendor/github.com/go-gl/gl/v3.3-core/gl/KHR/dummy.go
@@ -0,0 +1,5 @@
+//go:build required
+// +build required
+
+// Package dummy prevents go tooling from stripping the c dependencies.
+package dummy
diff --git a/archive/vendor/github.com/go-gl/gl/v3.3-core/gl/KHR/khrplatform.h b/archive/vendor/github.com/go-gl/gl/v3.3-core/gl/KHR/khrplatform.h
new file mode 100644
index 0000000..dd22d92
--- /dev/null
+++ b/archive/vendor/github.com/go-gl/gl/v3.3-core/gl/KHR/khrplatform.h
@@ -0,0 +1,290 @@
+#ifndef __khrplatform_h_
+#define __khrplatform_h_
+
+/*
+** Copyright (c) 2008-2018 The Khronos Group Inc.
+**
+** Permission is hereby granted, free of charge, to any person obtaining a
+** copy of this software and/or associated documentation files (the
+** "Materials"), to deal in the Materials without restriction, including
+** without limitation the rights to use, copy, modify, merge, publish,
+** distribute, sublicense, and/or sell copies of the Materials, and to
+** permit persons to whom the Materials are furnished to do so, subject to
+** the following conditions:
+**
+** The above copyright notice and this permission notice shall be included
+** in all copies or substantial portions of the Materials.
+**
+** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
+*/
+
+/* Khronos platform-specific types and definitions.
+ *
+ * The master copy of khrplatform.h is maintained in the Khronos EGL
+ * Registry repository at https://github.com/KhronosGroup/EGL-Registry
+ * The last semantic modification to khrplatform.h was at commit ID:
+ * 67a3e0864c2d75ea5287b9f3d2eb74a745936692
+ *
+ * Adopters may modify this file to suit their platform. Adopters are
+ * encouraged to submit platform specific modifications to the Khronos
+ * group so that they can be included in future versions of this file.
+ * Please submit changes by filing pull requests or issues on
+ * the EGL Registry repository linked above.
+ *
+ *
+ * See the Implementer's Guidelines for information about where this file
+ * should be located on your system and for more details of its use:
+ * http://www.khronos.org/registry/implementers_guide.pdf
+ *
+ * This file should be included as
+ * #include
+ * by Khronos client API header files that use its types and defines.
+ *
+ * The types in khrplatform.h should only be used to define API-specific types.
+ *
+ * Types defined in khrplatform.h:
+ * khronos_int8_t signed 8 bit
+ * khronos_uint8_t unsigned 8 bit
+ * khronos_int16_t signed 16 bit
+ * khronos_uint16_t unsigned 16 bit
+ * khronos_int32_t signed 32 bit
+ * khronos_uint32_t unsigned 32 bit
+ * khronos_int64_t signed 64 bit
+ * khronos_uint64_t unsigned 64 bit
+ * khronos_intptr_t signed same number of bits as a pointer
+ * khronos_uintptr_t unsigned same number of bits as a pointer
+ * khronos_ssize_t signed size
+ * khronos_usize_t unsigned size
+ * khronos_float_t signed 32 bit floating point
+ * khronos_time_ns_t unsigned 64 bit time in nanoseconds
+ * khronos_utime_nanoseconds_t unsigned time interval or absolute time in
+ * nanoseconds
+ * khronos_stime_nanoseconds_t signed time interval in nanoseconds
+ * khronos_boolean_enum_t enumerated boolean type. This should
+ * only be used as a base type when a client API's boolean type is
+ * an enum. Client APIs which use an integer or other type for
+ * booleans cannot use this as the base type for their boolean.
+ *
+ * Tokens defined in khrplatform.h:
+ *
+ * KHRONOS_FALSE, KHRONOS_TRUE Enumerated boolean false/true values.
+ *
+ * KHRONOS_SUPPORT_INT64 is 1 if 64 bit integers are supported; otherwise 0.
+ * KHRONOS_SUPPORT_FLOAT is 1 if floats are supported; otherwise 0.
+ *
+ * Calling convention macros defined in this file:
+ * KHRONOS_APICALL
+ * KHRONOS_APIENTRY
+ * KHRONOS_APIATTRIBUTES
+ *
+ * These may be used in function prototypes as:
+ *
+ * KHRONOS_APICALL void KHRONOS_APIENTRY funcname(
+ * int arg1,
+ * int arg2) KHRONOS_APIATTRIBUTES;
+ */
+
+#if defined(__SCITECH_SNAP__) && !defined(KHRONOS_STATIC)
+# define KHRONOS_STATIC 1
+#endif
+
+/*-------------------------------------------------------------------------
+ * Definition of KHRONOS_APICALL
+ *-------------------------------------------------------------------------
+ * This precedes the return type of the function in the function prototype.
+ */
+#if defined(KHRONOS_STATIC)
+ /* If the preprocessor constant KHRONOS_STATIC is defined, make the
+ * header compatible with static linking. */
+# define KHRONOS_APICALL
+#elif defined(_WIN32)
+# define KHRONOS_APICALL __declspec(dllimport)
+#elif defined (__SYMBIAN32__)
+# define KHRONOS_APICALL IMPORT_C
+#elif defined(__ANDROID__)
+# define KHRONOS_APICALL __attribute__((visibility("default")))
+#else
+# define KHRONOS_APICALL
+#endif
+
+/*-------------------------------------------------------------------------
+ * Definition of KHRONOS_APIENTRY
+ *-------------------------------------------------------------------------
+ * This follows the return type of the function and precedes the function
+ * name in the function prototype.
+ */
+#if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(__SCITECH_SNAP__)
+ /* Win32 but not WinCE */
+# define KHRONOS_APIENTRY __stdcall
+#else
+# define KHRONOS_APIENTRY
+#endif
+
+/*-------------------------------------------------------------------------
+ * Definition of KHRONOS_APIATTRIBUTES
+ *-------------------------------------------------------------------------
+ * This follows the closing parenthesis of the function prototype arguments.
+ */
+#if defined (__ARMCC_2__)
+#define KHRONOS_APIATTRIBUTES __softfp
+#else
+#define KHRONOS_APIATTRIBUTES
+#endif
+
+/*-------------------------------------------------------------------------
+ * basic type definitions
+ *-----------------------------------------------------------------------*/
+#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__GNUC__) || defined(__SCO__) || defined(__USLC__)
+
+
+/*
+ * Using
+ */
+#include
+typedef int32_t khronos_int32_t;
+typedef uint32_t khronos_uint32_t;
+typedef int64_t khronos_int64_t;
+typedef uint64_t khronos_uint64_t;
+#define KHRONOS_SUPPORT_INT64 1
+#define KHRONOS_SUPPORT_FLOAT 1
+
+#elif defined(__VMS ) || defined(__sgi)
+
+/*
+ * Using
+ */
+#include
+typedef int32_t khronos_int32_t;
+typedef uint32_t khronos_uint32_t;
+typedef int64_t khronos_int64_t;
+typedef uint64_t khronos_uint64_t;
+#define KHRONOS_SUPPORT_INT64 1
+#define KHRONOS_SUPPORT_FLOAT 1
+
+#elif defined(_WIN32) && !defined(__SCITECH_SNAP__)
+
+/*
+ * Win32
+ */
+typedef __int32 khronos_int32_t;
+typedef unsigned __int32 khronos_uint32_t;
+typedef __int64 khronos_int64_t;
+typedef unsigned __int64 khronos_uint64_t;
+#define KHRONOS_SUPPORT_INT64 1
+#define KHRONOS_SUPPORT_FLOAT 1
+
+#elif defined(__sun__) || defined(__digital__)
+
+/*
+ * Sun or Digital
+ */
+typedef int khronos_int32_t;
+typedef unsigned int khronos_uint32_t;
+#if defined(__arch64__) || defined(_LP64)
+typedef long int khronos_int64_t;
+typedef unsigned long int khronos_uint64_t;
+#else
+typedef long long int khronos_int64_t;
+typedef unsigned long long int khronos_uint64_t;
+#endif /* __arch64__ */
+#define KHRONOS_SUPPORT_INT64 1
+#define KHRONOS_SUPPORT_FLOAT 1
+
+#elif 0
+
+/*
+ * Hypothetical platform with no float or int64 support
+ */
+typedef int khronos_int32_t;
+typedef unsigned int khronos_uint32_t;
+#define KHRONOS_SUPPORT_INT64 0
+#define KHRONOS_SUPPORT_FLOAT 0
+
+#else
+
+/*
+ * Generic fallback
+ */
+#include
+typedef int32_t khronos_int32_t;
+typedef uint32_t khronos_uint32_t;
+typedef int64_t khronos_int64_t;
+typedef uint64_t khronos_uint64_t;
+#define KHRONOS_SUPPORT_INT64 1
+#define KHRONOS_SUPPORT_FLOAT 1
+
+#endif
+
+
+/*
+ * Types that are (so far) the same on all platforms
+ */
+typedef signed char khronos_int8_t;
+typedef unsigned char khronos_uint8_t;
+typedef signed short int khronos_int16_t;
+typedef unsigned short int khronos_uint16_t;
+
+/*
+ * Types that differ between LLP64 and LP64 architectures - in LLP64,
+ * pointers are 64 bits, but 'long' is still 32 bits. Win64 appears
+ * to be the only LLP64 architecture in current use.
+ */
+#ifdef _WIN64
+typedef signed long long int khronos_intptr_t;
+typedef unsigned long long int khronos_uintptr_t;
+typedef signed long long int khronos_ssize_t;
+typedef unsigned long long int khronos_usize_t;
+#else
+typedef signed long int khronos_intptr_t;
+typedef unsigned long int khronos_uintptr_t;
+typedef signed long int khronos_ssize_t;
+typedef unsigned long int khronos_usize_t;
+#endif
+
+#if KHRONOS_SUPPORT_FLOAT
+/*
+ * Float type
+ */
+typedef float khronos_float_t;
+#endif
+
+#if KHRONOS_SUPPORT_INT64
+/* Time types
+ *
+ * These types can be used to represent a time interval in nanoseconds or
+ * an absolute Unadjusted System Time. Unadjusted System Time is the number
+ * of nanoseconds since some arbitrary system event (e.g. since the last
+ * time the system booted). The Unadjusted System Time is an unsigned
+ * 64 bit value that wraps back to 0 every 584 years. Time intervals
+ * may be either signed or unsigned.
+ */
+typedef khronos_uint64_t khronos_utime_nanoseconds_t;
+typedef khronos_int64_t khronos_stime_nanoseconds_t;
+#endif
+
+/*
+ * Dummy value used to pad enum types to 32 bits.
+ */
+#ifndef KHRONOS_MAX_ENUM
+#define KHRONOS_MAX_ENUM 0x7FFFFFFF
+#endif
+
+/*
+ * Enumerated boolean type
+ *
+ * Values other than zero should be considered to be true. Therefore
+ * comparisons should not be made against KHRONOS_TRUE.
+ */
+typedef enum {
+ KHRONOS_FALSE = 0,
+ KHRONOS_TRUE = 1,
+ KHRONOS_BOOLEAN_ENUM_FORCE_SIZE = KHRONOS_MAX_ENUM
+} khronos_boolean_enum_t;
+
+#endif /* __khrplatform_h_ */
diff --git a/archive/vendor/github.com/go-gl/gl/v3.3-core/gl/build_cgo_hack.go b/archive/vendor/github.com/go-gl/gl/v3.3-core/gl/build_cgo_hack.go
new file mode 100644
index 0000000..6c59262
--- /dev/null
+++ b/archive/vendor/github.com/go-gl/gl/v3.3-core/gl/build_cgo_hack.go
@@ -0,0 +1,17 @@
+//go:build required
+// +build required
+
+package gl
+
+// This file exists purely to prevent the golang toolchain from stripping
+// away the c source directories and files when `go mod vendor` is used
+// to populate a `vendor/` directory of a project depending on `go-gl/go`.
+//
+// How it works:
+// - every directory which only includes c source files receives a dummy.go file.
+// - every directory we want to preserve is included here as a _ import.
+// - this file is given a build tag to exclude it from the regular build.
+import (
+ // Prevent go tooling from stripping out the c source files.
+ _ "github.com/go-gl/gl/v3.3-core/gl/KHR"
+)
diff --git a/archive/vendor/github.com/go-gl/gl/v3.3-core/gl/conversions.go b/archive/vendor/github.com/go-gl/gl/v3.3-core/gl/conversions.go
new file mode 100644
index 0000000..bd70f24
--- /dev/null
+++ b/archive/vendor/github.com/go-gl/gl/v3.3-core/gl/conversions.go
@@ -0,0 +1,116 @@
+// Code generated by glow (https://github.com/go-gl/glow). DO NOT EDIT.
+
+package gl
+
+import (
+ "fmt"
+ "reflect"
+ "strings"
+ "unsafe"
+)
+
+// #include
+import "C"
+
+// Ptr takes a slice or pointer (to a singular scalar value or the first
+// element of an array or slice) and returns its GL-compatible address.
+//
+// For example:
+//
+// var data []uint8
+// ...
+// gl.TexImage2D(gl.TEXTURE_2D, ..., gl.UNSIGNED_BYTE, gl.Ptr(&data[0]))
+func Ptr(data interface{}) unsafe.Pointer {
+ if data == nil {
+ return unsafe.Pointer(nil)
+ }
+ var addr unsafe.Pointer
+ v := reflect.ValueOf(data)
+ switch v.Type().Kind() {
+ case reflect.Ptr:
+ e := v.Elem()
+ switch e.Kind() {
+ case
+ reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64,
+ reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64,
+ reflect.Float32, reflect.Float64:
+ addr = unsafe.Pointer(e.UnsafeAddr())
+ default:
+ panic(fmt.Errorf("unsupported pointer to type %s; must be a slice or pointer to a singular scalar value or the first element of an array or slice", e.Kind()))
+ }
+ case reflect.Uintptr:
+ addr = unsafe.Pointer(data.(uintptr))
+ case reflect.Slice:
+ addr = unsafe.Pointer(v.Index(0).UnsafeAddr())
+ default:
+ panic(fmt.Errorf("unsupported type %s; must be a slice or pointer to a singular scalar value or the first element of an array or slice", v.Type()))
+ }
+ return addr
+}
+
+// PtrOffset takes a pointer offset and returns a GL-compatible pointer.
+// Originally intended for functions such as glVertexAttribPointer that take pointer
+// parameters also for offsets, since Go 1.14 this is no longer recommended.
+//
+// Use a corresponding offset-compatible variant of the function instead.
+// For example, for gl.VertexAttribPointer() there is gl.VertexAttribPointerWithOffset().
+//
+// See https://github.com/go-gl/gl#go-114-and-checkptr for more details on the checkptr detector.
+// See https://github.com/go-gl/glow#overloads, about adding new overloads.
+//
+// Deprecated: Use more appropriate overload function instead
+func PtrOffset(offset int) unsafe.Pointer {
+ return unsafe.Pointer(uintptr(offset))
+}
+
+// Str takes a null-terminated Go string and returns its GL-compatible address.
+// This function reaches into Go string storage in an unsafe way so the caller
+// must ensure the string is not garbage collected.
+func Str(str string) *uint8 {
+ if !strings.HasSuffix(str, "\x00") {
+ panic("str argument missing null terminator: " + str)
+ }
+ header := (*reflect.StringHeader)(unsafe.Pointer(&str))
+ return (*uint8)(unsafe.Pointer(header.Data))
+}
+
+// GoStr takes a null-terminated string returned by OpenGL and constructs a
+// corresponding Go string.
+func GoStr(cstr *uint8) string {
+ return C.GoString((*C.char)(unsafe.Pointer(cstr)))
+}
+
+// Strs takes a list of Go strings (with or without null-termination) and
+// returns their C counterpart.
+//
+// The returned free function must be called once you are done using the strings
+// in order to free the memory.
+//
+// If no strings are provided as a parameter this function will panic.
+func Strs(strs ...string) (cstrs **uint8, free func()) {
+ if len(strs) == 0 {
+ panic("Strs: expected at least 1 string")
+ }
+
+ // Allocate a contiguous array large enough to hold all the strings' contents.
+ n := 0
+ for i := range strs {
+ n += len(strs[i])
+ }
+ if n == 0 {
+ n = 1 // avoid allocating zero bytes in case all strings are empty.
+ }
+ data := C.malloc(C.size_t(n))
+
+ // Copy all the strings into data.
+ dataSlice := (*[1 << 30]byte)(data)[:n]
+ css := make([]*uint8, len(strs)) // Populated with pointers to each string.
+ offset := 0
+ for i := range strs {
+ copy(dataSlice[offset:offset+len(strs[i])], strs[i][:]) // Copy strs[i] into proper data location.
+ css[i] = (*uint8)(unsafe.Pointer(&dataSlice[offset])) // Set a pointer to it.
+ offset += len(strs[i])
+ }
+
+ return (**uint8)(&css[0]), func() { C.free(data) }
+}
diff --git a/archive/vendor/github.com/go-gl/gl/v3.3-core/gl/debug.go b/archive/vendor/github.com/go-gl/gl/v3.3-core/gl/debug.go
new file mode 100644
index 0000000..ee22784
--- /dev/null
+++ b/archive/vendor/github.com/go-gl/gl/v3.3-core/gl/debug.go
@@ -0,0 +1,31 @@
+// Code generated by glow (https://github.com/go-gl/glow). DO NOT EDIT.
+
+package gl
+
+import "C"
+import "unsafe"
+
+type DebugProc func(
+ source uint32,
+ gltype uint32,
+ id uint32,
+ severity uint32,
+ length int32,
+ message string,
+ userParam unsafe.Pointer)
+
+var userDebugCallback DebugProc
+
+//export glowDebugCallback_glcore33
+func glowDebugCallback_glcore33(
+ source uint32,
+ gltype uint32,
+ id uint32,
+ severity uint32,
+ length int32,
+ message *uint8,
+ userParam unsafe.Pointer) {
+ if userDebugCallback != nil {
+ userDebugCallback(source, gltype, id, severity, length, GoStr(message), userParam)
+ }
+}
diff --git a/archive/vendor/github.com/go-gl/gl/v3.3-core/gl/package.go b/archive/vendor/github.com/go-gl/gl/v3.3-core/gl/package.go
new file mode 100644
index 0000000..1c38c37
--- /dev/null
+++ b/archive/vendor/github.com/go-gl/gl/v3.3-core/gl/package.go
@@ -0,0 +1,15867 @@
+// Code generated by glow (https://github.com/go-gl/glow). DO NOT EDIT.
+
+// Copyright (c) 2010 Khronos Group.
+// This material may be distributed subject to the terms and conditions
+// set forth in the Open Publication License, v 1.0, 8 June 1999.
+// http://opencontent.org/openpub/.
+//
+// Copyright (c) 1991-2006 Silicon Graphics, Inc.
+// This document is licensed under the SGI Free Software B License.
+// For details, see http://oss.sgi.com/projects/FreeB.
+
+// Package gl implements Go bindings to OpenGL.
+//
+// This package was automatically generated using Glow:
+//
+// https://github.com/go-gl/glow
+package gl
+
+// #cgo !gles2,darwin LDFLAGS: -framework OpenGL
+// #cgo gles2,darwin LDFLAGS: -framework OpenGLES
+// #cgo !gles2,windows LDFLAGS: -lopengl32
+// #cgo gles2,windows LDFLAGS: -lGLESv2
+// #cgo !egl,linux !egl,freebsd !egl,netbsd !egl,openbsd pkg-config: gl
+// #cgo egl,linux egl,freebsd egl,netbsd egl,openbsd pkg-config: egl
+// #if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)
+// #ifndef WIN32_LEAN_AND_MEAN
+// #define WIN32_LEAN_AND_MEAN 1
+// #endif
+// #include
+// #endif
+// #ifndef APIENTRY
+// #define APIENTRY
+// #endif
+// #ifndef APIENTRYP
+// #define APIENTRYP APIENTRY *
+// #endif
+// #ifndef GLAPI
+// #define GLAPI extern
+// #endif
+// #include
+// typedef unsigned int GLenum;
+// typedef unsigned char GLboolean;
+// typedef unsigned int GLbitfield;
+// typedef khronos_int8_t GLbyte;
+// typedef khronos_uint8_t GLubyte;
+// typedef khronos_int16_t GLshort;
+// typedef khronos_uint16_t GLushort;
+// typedef int GLint;
+// typedef unsigned int GLuint;
+// typedef int GLsizei;
+// typedef khronos_float_t GLfloat;
+// typedef double GLdouble;
+// typedef void *GLeglImageOES;
+// typedef char GLchar;
+// typedef khronos_intptr_t GLintptr;
+// typedef khronos_ssize_t GLsizeiptr;
+// typedef khronos_int64_t GLint64;
+// typedef khronos_int64_t GLint64EXT;
+// typedef khronos_uint64_t GLuint64;
+// typedef khronos_uint64_t GLuint64EXT;
+// typedef uintptr_t GLsync;
+// struct _cl_context;
+// struct _cl_event;
+// typedef void (APIENTRY *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam);
+// typedef void (APIENTRY *GLDEBUGPROCARB)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam);
+// typedef void (APIENTRY *GLDEBUGPROCKHR)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam);
+// typedef void (APIENTRY *GLVULKANPROCNV)(void);
+// extern void glowDebugCallback_glcore33(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, const void* userParam);
+// static void APIENTRY glowCDebugCallback(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, const void* userParam) {
+// glowDebugCallback_glcore33(source, type, id, severity, length, message, userParam);
+// }
+// typedef void (APIENTRYP GPACTIVEPROGRAMEXT)(GLuint program);
+// typedef void (APIENTRYP GPACTIVESHADERPROGRAM)(GLuint pipeline, GLuint program);
+// typedef void (APIENTRYP GPACTIVESHADERPROGRAMEXT)(GLuint pipeline, GLuint program);
+// typedef void (APIENTRYP GPACTIVETEXTURE)(GLenum texture);
+// typedef void (APIENTRYP GPAPPLYFRAMEBUFFERATTACHMENTCMAAINTEL)();
+// typedef void (APIENTRYP GPATTACHSHADER)(GLuint program, GLuint shader);
+// typedef void (APIENTRYP GPBEGINCONDITIONALRENDER)(GLuint id, GLenum mode);
+// typedef void (APIENTRYP GPBEGINCONDITIONALRENDERNV)(GLuint id, GLenum mode);
+// typedef void (APIENTRYP GPBEGINPERFMONITORAMD)(GLuint monitor);
+// typedef void (APIENTRYP GPBEGINPERFQUERYINTEL)(GLuint queryHandle);
+// typedef void (APIENTRYP GPBEGINQUERY)(GLenum target, GLuint id);
+// typedef void (APIENTRYP GPBEGINQUERYINDEXED)(GLenum target, GLuint index, GLuint id);
+// typedef void (APIENTRYP GPBEGINTRANSFORMFEEDBACK)(GLenum primitiveMode);
+// typedef void (APIENTRYP GPBINDATTRIBLOCATION)(GLuint program, GLuint index, const GLchar * name);
+// typedef void (APIENTRYP GPBINDBUFFER)(GLenum target, GLuint buffer);
+// typedef void (APIENTRYP GPBINDBUFFERBASE)(GLenum target, GLuint index, GLuint buffer);
+// typedef void (APIENTRYP GPBINDBUFFERRANGE)(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
+// typedef void (APIENTRYP GPBINDBUFFERSBASE)(GLenum target, GLuint first, GLsizei count, const GLuint * buffers);
+// typedef void (APIENTRYP GPBINDBUFFERSRANGE)(GLenum target, GLuint first, GLsizei count, const GLuint * buffers, const GLintptr * offsets, const GLsizeiptr * sizes);
+// typedef void (APIENTRYP GPBINDFRAGDATALOCATION)(GLuint program, GLuint color, const GLchar * name);
+// typedef void (APIENTRYP GPBINDFRAGDATALOCATIONINDEXED)(GLuint program, GLuint colorNumber, GLuint index, const GLchar * name);
+// typedef void (APIENTRYP GPBINDFRAMEBUFFER)(GLenum target, GLuint framebuffer);
+// typedef void (APIENTRYP GPBINDIMAGETEXTURE)(GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format);
+// typedef void (APIENTRYP GPBINDIMAGETEXTURES)(GLuint first, GLsizei count, const GLuint * textures);
+// typedef void (APIENTRYP GPBINDMULTITEXTUREEXT)(GLenum texunit, GLenum target, GLuint texture);
+// typedef void (APIENTRYP GPBINDPROGRAMPIPELINE)(GLuint pipeline);
+// typedef void (APIENTRYP GPBINDPROGRAMPIPELINEEXT)(GLuint pipeline);
+// typedef void (APIENTRYP GPBINDRENDERBUFFER)(GLenum target, GLuint renderbuffer);
+// typedef void (APIENTRYP GPBINDSAMPLER)(GLuint unit, GLuint sampler);
+// typedef void (APIENTRYP GPBINDSAMPLERS)(GLuint first, GLsizei count, const GLuint * samplers);
+// typedef void (APIENTRYP GPBINDSHADINGRATEIMAGENV)(GLuint texture);
+// typedef void (APIENTRYP GPBINDTEXTURE)(GLenum target, GLuint texture);
+// typedef void (APIENTRYP GPBINDTEXTUREUNIT)(GLuint unit, GLuint texture);
+// typedef void (APIENTRYP GPBINDTEXTURES)(GLuint first, GLsizei count, const GLuint * textures);
+// typedef void (APIENTRYP GPBINDTRANSFORMFEEDBACK)(GLenum target, GLuint id);
+// typedef void (APIENTRYP GPBINDVERTEXARRAY)(GLuint array);
+// typedef void (APIENTRYP GPBINDVERTEXBUFFER)(GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride);
+// typedef void (APIENTRYP GPBINDVERTEXBUFFERS)(GLuint first, GLsizei count, const GLuint * buffers, const GLintptr * offsets, const GLsizei * strides);
+// typedef void (APIENTRYP GPBLENDBARRIERKHR)();
+// typedef void (APIENTRYP GPBLENDBARRIERNV)();
+// typedef void (APIENTRYP GPBLENDCOLOR)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
+// typedef void (APIENTRYP GPBLENDEQUATION)(GLenum mode);
+// typedef void (APIENTRYP GPBLENDEQUATIONSEPARATE)(GLenum modeRGB, GLenum modeAlpha);
+// typedef void (APIENTRYP GPBLENDEQUATIONSEPARATEIARB)(GLuint buf, GLenum modeRGB, GLenum modeAlpha);
+// typedef void (APIENTRYP GPBLENDEQUATIONIARB)(GLuint buf, GLenum mode);
+// typedef void (APIENTRYP GPBLENDFUNC)(GLenum sfactor, GLenum dfactor);
+// typedef void (APIENTRYP GPBLENDFUNCSEPARATE)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
+// typedef void (APIENTRYP GPBLENDFUNCSEPARATEIARB)(GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
+// typedef void (APIENTRYP GPBLENDFUNCIARB)(GLuint buf, GLenum src, GLenum dst);
+// typedef void (APIENTRYP GPBLENDPARAMETERINV)(GLenum pname, GLint value);
+// typedef void (APIENTRYP GPBLITFRAMEBUFFER)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
+// typedef void (APIENTRYP GPBLITNAMEDFRAMEBUFFER)(GLuint readFramebuffer, GLuint drawFramebuffer, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
+// typedef void (APIENTRYP GPBUFFERADDRESSRANGENV)(GLenum pname, GLuint index, GLuint64EXT address, GLsizeiptr length);
+// typedef void (APIENTRYP GPBUFFERATTACHMEMORYNV)(GLenum target, GLuint memory, GLuint64 offset);
+// typedef void (APIENTRYP GPBUFFERDATA)(GLenum target, GLsizeiptr size, const void * data, GLenum usage);
+// typedef void (APIENTRYP GPBUFFERPAGECOMMITMENTARB)(GLenum target, GLintptr offset, GLsizeiptr size, GLboolean commit);
+// typedef void (APIENTRYP GPBUFFERPAGECOMMITMENTMEMNV)(GLenum target, GLintptr offset, GLsizeiptr size, GLuint memory, GLuint64 memOffset, GLboolean commit);
+// typedef void (APIENTRYP GPBUFFERSTORAGE)(GLenum target, GLsizeiptr size, const void * data, GLbitfield flags);
+// typedef void (APIENTRYP GPBUFFERSUBDATA)(GLenum target, GLintptr offset, GLsizeiptr size, const void * data);
+// typedef void (APIENTRYP GPCALLCOMMANDLISTNV)(GLuint list);
+// typedef GLenum (APIENTRYP GPCHECKFRAMEBUFFERSTATUS)(GLenum target);
+// typedef GLenum (APIENTRYP GPCHECKNAMEDFRAMEBUFFERSTATUS)(GLuint framebuffer, GLenum target);
+// typedef GLenum (APIENTRYP GPCHECKNAMEDFRAMEBUFFERSTATUSEXT)(GLuint framebuffer, GLenum target);
+// typedef void (APIENTRYP GPCLAMPCOLOR)(GLenum target, GLenum clamp);
+// typedef void (APIENTRYP GPCLEAR)(GLbitfield mask);
+// typedef void (APIENTRYP GPCLEARBUFFERDATA)(GLenum target, GLenum internalformat, GLenum format, GLenum type, const void * data);
+// typedef void (APIENTRYP GPCLEARBUFFERSUBDATA)(GLenum target, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const void * data);
+// typedef void (APIENTRYP GPCLEARBUFFERFI)(GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil);
+// typedef void (APIENTRYP GPCLEARBUFFERFV)(GLenum buffer, GLint drawbuffer, const GLfloat * value);
+// typedef void (APIENTRYP GPCLEARBUFFERIV)(GLenum buffer, GLint drawbuffer, const GLint * value);
+// typedef void (APIENTRYP GPCLEARBUFFERUIV)(GLenum buffer, GLint drawbuffer, const GLuint * value);
+// typedef void (APIENTRYP GPCLEARCOLOR)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
+// typedef void (APIENTRYP GPCLEARDEPTH)(GLdouble depth);
+// typedef void (APIENTRYP GPCLEARDEPTHDNV)(GLdouble depth);
+// typedef void (APIENTRYP GPCLEARDEPTHF)(GLfloat d);
+// typedef void (APIENTRYP GPCLEARNAMEDBUFFERDATA)(GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const void * data);
+// typedef void (APIENTRYP GPCLEARNAMEDBUFFERDATAEXT)(GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const void * data);
+// typedef void (APIENTRYP GPCLEARNAMEDBUFFERSUBDATA)(GLuint buffer, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const void * data);
+// typedef void (APIENTRYP GPCLEARNAMEDBUFFERSUBDATAEXT)(GLuint buffer, GLenum internalformat, GLsizeiptr offset, GLsizeiptr size, GLenum format, GLenum type, const void * data);
+// typedef void (APIENTRYP GPCLEARNAMEDFRAMEBUFFERFI)(GLuint framebuffer, GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil);
+// typedef void (APIENTRYP GPCLEARNAMEDFRAMEBUFFERFV)(GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLfloat * value);
+// typedef void (APIENTRYP GPCLEARNAMEDFRAMEBUFFERIV)(GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLint * value);
+// typedef void (APIENTRYP GPCLEARNAMEDFRAMEBUFFERUIV)(GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLuint * value);
+// typedef void (APIENTRYP GPCLEARSTENCIL)(GLint s);
+// typedef void (APIENTRYP GPCLEARTEXIMAGE)(GLuint texture, GLint level, GLenum format, GLenum type, const void * data);
+// typedef void (APIENTRYP GPCLEARTEXSUBIMAGE)(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void * data);
+// typedef void (APIENTRYP GPCLIENTATTRIBDEFAULTEXT)(GLbitfield mask);
+// typedef GLenum (APIENTRYP GPCLIENTWAITSYNC)(GLsync sync, GLbitfield flags, GLuint64 timeout);
+// typedef void (APIENTRYP GPCLIPCONTROL)(GLenum origin, GLenum depth);
+// typedef void (APIENTRYP GPCOLORFORMATNV)(GLint size, GLenum type, GLsizei stride);
+// typedef void (APIENTRYP GPCOLORMASK)(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
+// typedef void (APIENTRYP GPCOLORMASKI)(GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a);
+// typedef void (APIENTRYP GPCOMMANDLISTSEGMENTSNV)(GLuint list, GLuint segments);
+// typedef void (APIENTRYP GPCOMPILECOMMANDLISTNV)(GLuint list);
+// typedef void (APIENTRYP GPCOMPILESHADER)(GLuint shader);
+// typedef void (APIENTRYP GPCOMPILESHADERINCLUDEARB)(GLuint shader, GLsizei count, const GLchar *const* path, const GLint * length);
+// typedef void (APIENTRYP GPCOMPRESSEDMULTITEXIMAGE1DEXT)(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void * bits);
+// typedef void (APIENTRYP GPCOMPRESSEDMULTITEXIMAGE2DEXT)(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void * bits);
+// typedef void (APIENTRYP GPCOMPRESSEDMULTITEXIMAGE3DEXT)(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void * bits);
+// typedef void (APIENTRYP GPCOMPRESSEDMULTITEXSUBIMAGE1DEXT)(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void * bits);
+// typedef void (APIENTRYP GPCOMPRESSEDMULTITEXSUBIMAGE2DEXT)(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void * bits);
+// typedef void (APIENTRYP GPCOMPRESSEDMULTITEXSUBIMAGE3DEXT)(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void * bits);
+// typedef void (APIENTRYP GPCOMPRESSEDTEXIMAGE1D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void * data);
+// typedef void (APIENTRYP GPCOMPRESSEDTEXIMAGE2D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void * data);
+// typedef void (APIENTRYP GPCOMPRESSEDTEXIMAGE3D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void * data);
+// typedef void (APIENTRYP GPCOMPRESSEDTEXSUBIMAGE1D)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void * data);
+// typedef void (APIENTRYP GPCOMPRESSEDTEXSUBIMAGE2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void * data);
+// typedef void (APIENTRYP GPCOMPRESSEDTEXSUBIMAGE3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void * data);
+// typedef void (APIENTRYP GPCOMPRESSEDTEXTUREIMAGE1DEXT)(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void * bits);
+// typedef void (APIENTRYP GPCOMPRESSEDTEXTUREIMAGE2DEXT)(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void * bits);
+// typedef void (APIENTRYP GPCOMPRESSEDTEXTUREIMAGE3DEXT)(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void * bits);
+// typedef void (APIENTRYP GPCOMPRESSEDTEXTURESUBIMAGE1D)(GLuint texture, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void * data);
+// typedef void (APIENTRYP GPCOMPRESSEDTEXTURESUBIMAGE1DEXT)(GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void * bits);
+// typedef void (APIENTRYP GPCOMPRESSEDTEXTURESUBIMAGE2D)(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void * data);
+// typedef void (APIENTRYP GPCOMPRESSEDTEXTURESUBIMAGE2DEXT)(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void * bits);
+// typedef void (APIENTRYP GPCOMPRESSEDTEXTURESUBIMAGE3D)(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void * data);
+// typedef void (APIENTRYP GPCOMPRESSEDTEXTURESUBIMAGE3DEXT)(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void * bits);
+// typedef void (APIENTRYP GPCONSERVATIVERASTERPARAMETERFNV)(GLenum pname, GLfloat value);
+// typedef void (APIENTRYP GPCONSERVATIVERASTERPARAMETERINV)(GLenum pname, GLint param);
+// typedef void (APIENTRYP GPCOPYBUFFERSUBDATA)(GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
+// typedef void (APIENTRYP GPCOPYIMAGESUBDATA)(GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth);
+// typedef void (APIENTRYP GPCOPYMULTITEXIMAGE1DEXT)(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
+// typedef void (APIENTRYP GPCOPYMULTITEXIMAGE2DEXT)(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
+// typedef void (APIENTRYP GPCOPYMULTITEXSUBIMAGE1DEXT)(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
+// typedef void (APIENTRYP GPCOPYMULTITEXSUBIMAGE2DEXT)(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+// typedef void (APIENTRYP GPCOPYMULTITEXSUBIMAGE3DEXT)(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+// typedef void (APIENTRYP GPCOPYNAMEDBUFFERSUBDATA)(GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
+// typedef void (APIENTRYP GPCOPYPATHNV)(GLuint resultPath, GLuint srcPath);
+// typedef void (APIENTRYP GPCOPYTEXIMAGE1D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
+// typedef void (APIENTRYP GPCOPYTEXIMAGE2D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
+// typedef void (APIENTRYP GPCOPYTEXSUBIMAGE1D)(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
+// typedef void (APIENTRYP GPCOPYTEXSUBIMAGE2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+// typedef void (APIENTRYP GPCOPYTEXSUBIMAGE3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+// typedef void (APIENTRYP GPCOPYTEXTUREIMAGE1DEXT)(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
+// typedef void (APIENTRYP GPCOPYTEXTUREIMAGE2DEXT)(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
+// typedef void (APIENTRYP GPCOPYTEXTURESUBIMAGE1D)(GLuint texture, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
+// typedef void (APIENTRYP GPCOPYTEXTURESUBIMAGE1DEXT)(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
+// typedef void (APIENTRYP GPCOPYTEXTURESUBIMAGE2D)(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+// typedef void (APIENTRYP GPCOPYTEXTURESUBIMAGE2DEXT)(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+// typedef void (APIENTRYP GPCOPYTEXTURESUBIMAGE3D)(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+// typedef void (APIENTRYP GPCOPYTEXTURESUBIMAGE3DEXT)(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+// typedef void (APIENTRYP GPCOVERFILLPATHINSTANCEDNV)(GLsizei numPaths, GLenum pathNameType, const void * paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat * transformValues);
+// typedef void (APIENTRYP GPCOVERFILLPATHNV)(GLuint path, GLenum coverMode);
+// typedef void (APIENTRYP GPCOVERSTROKEPATHINSTANCEDNV)(GLsizei numPaths, GLenum pathNameType, const void * paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat * transformValues);
+// typedef void (APIENTRYP GPCOVERSTROKEPATHNV)(GLuint path, GLenum coverMode);
+// typedef void (APIENTRYP GPCOVERAGEMODULATIONNV)(GLenum components);
+// typedef void (APIENTRYP GPCOVERAGEMODULATIONTABLENV)(GLsizei n, const GLfloat * v);
+// typedef void (APIENTRYP GPCREATEBUFFERS)(GLsizei n, GLuint * buffers);
+// typedef void (APIENTRYP GPCREATECOMMANDLISTSNV)(GLsizei n, GLuint * lists);
+// typedef void (APIENTRYP GPCREATEFRAMEBUFFERS)(GLsizei n, GLuint * framebuffers);
+// typedef void (APIENTRYP GPCREATEPERFQUERYINTEL)(GLuint queryId, GLuint * queryHandle);
+// typedef GLuint (APIENTRYP GPCREATEPROGRAM)();
+// typedef void (APIENTRYP GPCREATEPROGRAMPIPELINES)(GLsizei n, GLuint * pipelines);
+// typedef void (APIENTRYP GPCREATEQUERIES)(GLenum target, GLsizei n, GLuint * ids);
+// typedef void (APIENTRYP GPCREATERENDERBUFFERS)(GLsizei n, GLuint * renderbuffers);
+// typedef void (APIENTRYP GPCREATESAMPLERS)(GLsizei n, GLuint * samplers);
+// typedef GLuint (APIENTRYP GPCREATESHADER)(GLenum type);
+// typedef GLuint (APIENTRYP GPCREATESHADERPROGRAMEXT)(GLenum type, const GLchar * string);
+// typedef GLuint (APIENTRYP GPCREATESHADERPROGRAMV)(GLenum type, GLsizei count, const GLchar *const* strings);
+// typedef GLuint (APIENTRYP GPCREATESHADERPROGRAMVEXT)(GLenum type, GLsizei count, const GLchar ** strings);
+// typedef void (APIENTRYP GPCREATESTATESNV)(GLsizei n, GLuint * states);
+// typedef GLsync (APIENTRYP GPCREATESYNCFROMCLEVENTARB)(struct _cl_context * context, struct _cl_event * event, GLbitfield flags);
+// typedef void (APIENTRYP GPCREATETEXTURES)(GLenum target, GLsizei n, GLuint * textures);
+// typedef void (APIENTRYP GPCREATETRANSFORMFEEDBACKS)(GLsizei n, GLuint * ids);
+// typedef void (APIENTRYP GPCREATEVERTEXARRAYS)(GLsizei n, GLuint * arrays);
+// typedef void (APIENTRYP GPCULLFACE)(GLenum mode);
+// typedef void (APIENTRYP GPDEBUGMESSAGECALLBACK)(GLDEBUGPROC callback, const void * userParam);
+// typedef void (APIENTRYP GPDEBUGMESSAGECALLBACKARB)(GLDEBUGPROCARB callback, const void * userParam);
+// typedef void (APIENTRYP GPDEBUGMESSAGECALLBACKKHR)(GLDEBUGPROCKHR callback, const void * userParam);
+// typedef void (APIENTRYP GPDEBUGMESSAGECONTROL)(GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint * ids, GLboolean enabled);
+// typedef void (APIENTRYP GPDEBUGMESSAGECONTROLARB)(GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint * ids, GLboolean enabled);
+// typedef void (APIENTRYP GPDEBUGMESSAGECONTROLKHR)(GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint * ids, GLboolean enabled);
+// typedef void (APIENTRYP GPDEBUGMESSAGEINSERT)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar * buf);
+// typedef void (APIENTRYP GPDEBUGMESSAGEINSERTARB)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar * buf);
+// typedef void (APIENTRYP GPDEBUGMESSAGEINSERTKHR)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar * buf);
+// typedef void (APIENTRYP GPDELETEBUFFERS)(GLsizei n, const GLuint * buffers);
+// typedef void (APIENTRYP GPDELETECOMMANDLISTSNV)(GLsizei n, const GLuint * lists);
+// typedef void (APIENTRYP GPDELETEFRAMEBUFFERS)(GLsizei n, const GLuint * framebuffers);
+// typedef void (APIENTRYP GPDELETENAMEDSTRINGARB)(GLint namelen, const GLchar * name);
+// typedef void (APIENTRYP GPDELETEPATHSNV)(GLuint path, GLsizei range);
+// typedef void (APIENTRYP GPDELETEPERFMONITORSAMD)(GLsizei n, GLuint * monitors);
+// typedef void (APIENTRYP GPDELETEPERFQUERYINTEL)(GLuint queryHandle);
+// typedef void (APIENTRYP GPDELETEPROGRAM)(GLuint program);
+// typedef void (APIENTRYP GPDELETEPROGRAMPIPELINES)(GLsizei n, const GLuint * pipelines);
+// typedef void (APIENTRYP GPDELETEPROGRAMPIPELINESEXT)(GLsizei n, const GLuint * pipelines);
+// typedef void (APIENTRYP GPDELETEQUERIES)(GLsizei n, const GLuint * ids);
+// typedef void (APIENTRYP GPDELETERENDERBUFFERS)(GLsizei n, const GLuint * renderbuffers);
+// typedef void (APIENTRYP GPDELETESAMPLERS)(GLsizei count, const GLuint * samplers);
+// typedef void (APIENTRYP GPDELETESHADER)(GLuint shader);
+// typedef void (APIENTRYP GPDELETESTATESNV)(GLsizei n, const GLuint * states);
+// typedef void (APIENTRYP GPDELETESYNC)(GLsync sync);
+// typedef void (APIENTRYP GPDELETETEXTURES)(GLsizei n, const GLuint * textures);
+// typedef void (APIENTRYP GPDELETETRANSFORMFEEDBACKS)(GLsizei n, const GLuint * ids);
+// typedef void (APIENTRYP GPDELETEVERTEXARRAYS)(GLsizei n, const GLuint * arrays);
+// typedef void (APIENTRYP GPDEPTHBOUNDSDNV)(GLdouble zmin, GLdouble zmax);
+// typedef void (APIENTRYP GPDEPTHFUNC)(GLenum func);
+// typedef void (APIENTRYP GPDEPTHMASK)(GLboolean flag);
+// typedef void (APIENTRYP GPDEPTHRANGE)(GLdouble n, GLdouble f);
+// typedef void (APIENTRYP GPDEPTHRANGEARRAYDVNV)(GLuint first, GLsizei count, const GLdouble * v);
+// typedef void (APIENTRYP GPDEPTHRANGEARRAYV)(GLuint first, GLsizei count, const GLdouble * v);
+// typedef void (APIENTRYP GPDEPTHRANGEINDEXED)(GLuint index, GLdouble n, GLdouble f);
+// typedef void (APIENTRYP GPDEPTHRANGEINDEXEDDNV)(GLuint index, GLdouble n, GLdouble f);
+// typedef void (APIENTRYP GPDEPTHRANGEDNV)(GLdouble zNear, GLdouble zFar);
+// typedef void (APIENTRYP GPDEPTHRANGEF)(GLfloat n, GLfloat f);
+// typedef void (APIENTRYP GPDETACHSHADER)(GLuint program, GLuint shader);
+// typedef void (APIENTRYP GPDISABLE)(GLenum cap);
+// typedef void (APIENTRYP GPDISABLECLIENTSTATEINDEXEDEXT)(GLenum array, GLuint index);
+// typedef void (APIENTRYP GPDISABLECLIENTSTATEIEXT)(GLenum array, GLuint index);
+// typedef void (APIENTRYP GPDISABLEINDEXEDEXT)(GLenum target, GLuint index);
+// typedef void (APIENTRYP GPDISABLEVERTEXARRAYATTRIB)(GLuint vaobj, GLuint index);
+// typedef void (APIENTRYP GPDISABLEVERTEXARRAYATTRIBEXT)(GLuint vaobj, GLuint index);
+// typedef void (APIENTRYP GPDISABLEVERTEXARRAYEXT)(GLuint vaobj, GLenum array);
+// typedef void (APIENTRYP GPDISABLEVERTEXATTRIBARRAY)(GLuint index);
+// typedef void (APIENTRYP GPDISABLEI)(GLenum target, GLuint index);
+// typedef void (APIENTRYP GPDISPATCHCOMPUTE)(GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z);
+// typedef void (APIENTRYP GPDISPATCHCOMPUTEGROUPSIZEARB)(GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z, GLuint group_size_x, GLuint group_size_y, GLuint group_size_z);
+// typedef void (APIENTRYP GPDISPATCHCOMPUTEINDIRECT)(GLintptr indirect);
+// typedef void (APIENTRYP GPDRAWARRAYS)(GLenum mode, GLint first, GLsizei count);
+// typedef void (APIENTRYP GPDRAWARRAYSINDIRECT)(GLenum mode, const void * indirect);
+// typedef void (APIENTRYP GPDRAWARRAYSINSTANCED)(GLenum mode, GLint first, GLsizei count, GLsizei instancecount);
+// typedef void (APIENTRYP GPDRAWARRAYSINSTANCEDARB)(GLenum mode, GLint first, GLsizei count, GLsizei primcount);
+// typedef void (APIENTRYP GPDRAWARRAYSINSTANCEDBASEINSTANCE)(GLenum mode, GLint first, GLsizei count, GLsizei instancecount, GLuint baseinstance);
+// typedef void (APIENTRYP GPDRAWARRAYSINSTANCEDEXT)(GLenum mode, GLint start, GLsizei count, GLsizei primcount);
+// typedef void (APIENTRYP GPDRAWBUFFER)(GLenum buf);
+// typedef void (APIENTRYP GPDRAWBUFFERS)(GLsizei n, const GLenum * bufs);
+// typedef void (APIENTRYP GPDRAWCOMMANDSADDRESSNV)(GLenum primitiveMode, const GLuint64 * indirects, const GLsizei * sizes, GLuint count);
+// typedef void (APIENTRYP GPDRAWCOMMANDSNV)(GLenum primitiveMode, GLuint buffer, const GLintptr * indirects, const GLsizei * sizes, GLuint count);
+// typedef void (APIENTRYP GPDRAWCOMMANDSSTATESADDRESSNV)(const GLuint64 * indirects, const GLsizei * sizes, const GLuint * states, const GLuint * fbos, GLuint count);
+// typedef void (APIENTRYP GPDRAWCOMMANDSSTATESNV)(GLuint buffer, const GLintptr * indirects, const GLsizei * sizes, const GLuint * states, const GLuint * fbos, GLuint count);
+// typedef void (APIENTRYP GPDRAWELEMENTS)(GLenum mode, GLsizei count, GLenum type, const void * indices);
+// typedef void (APIENTRYP GPDRAWELEMENTSBASEVERTEX)(GLenum mode, GLsizei count, GLenum type, const void * indices, GLint basevertex);
+// typedef void (APIENTRYP GPDRAWELEMENTSINDIRECT)(GLenum mode, GLenum type, const void * indirect);
+// typedef void (APIENTRYP GPDRAWELEMENTSINSTANCED)(GLenum mode, GLsizei count, GLenum type, const void * indices, GLsizei instancecount);
+// typedef void (APIENTRYP GPDRAWELEMENTSINSTANCEDARB)(GLenum mode, GLsizei count, GLenum type, const void * indices, GLsizei primcount);
+// typedef void (APIENTRYP GPDRAWELEMENTSINSTANCEDBASEINSTANCE)(GLenum mode, GLsizei count, GLenum type, const void * indices, GLsizei instancecount, GLuint baseinstance);
+// typedef void (APIENTRYP GPDRAWELEMENTSINSTANCEDBASEVERTEX)(GLenum mode, GLsizei count, GLenum type, const void * indices, GLsizei instancecount, GLint basevertex);
+// typedef void (APIENTRYP GPDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCE)(GLenum mode, GLsizei count, GLenum type, const void * indices, GLsizei instancecount, GLint basevertex, GLuint baseinstance);
+// typedef void (APIENTRYP GPDRAWELEMENTSINSTANCEDEXT)(GLenum mode, GLsizei count, GLenum type, const void * indices, GLsizei primcount);
+// typedef void (APIENTRYP GPDRAWMESHTASKSINDIRECTNV)(GLintptr indirect);
+// typedef void (APIENTRYP GPDRAWMESHTASKSNV)(GLuint first, GLuint count);
+// typedef void (APIENTRYP GPDRAWRANGEELEMENTS)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void * indices);
+// typedef void (APIENTRYP GPDRAWRANGEELEMENTSBASEVERTEX)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void * indices, GLint basevertex);
+// typedef void (APIENTRYP GPDRAWTRANSFORMFEEDBACK)(GLenum mode, GLuint id);
+// typedef void (APIENTRYP GPDRAWTRANSFORMFEEDBACKINSTANCED)(GLenum mode, GLuint id, GLsizei instancecount);
+// typedef void (APIENTRYP GPDRAWTRANSFORMFEEDBACKSTREAM)(GLenum mode, GLuint id, GLuint stream);
+// typedef void (APIENTRYP GPDRAWTRANSFORMFEEDBACKSTREAMINSTANCED)(GLenum mode, GLuint id, GLuint stream, GLsizei instancecount);
+// typedef void (APIENTRYP GPDRAWVKIMAGENV)(GLuint64 vkImage, GLuint sampler, GLfloat x0, GLfloat y0, GLfloat x1, GLfloat y1, GLfloat z, GLfloat s0, GLfloat t0, GLfloat s1, GLfloat t1);
+// typedef void (APIENTRYP GPEGLIMAGETARGETTEXSTORAGEEXT)(GLenum target, GLeglImageOES image, const GLint* attrib_list);
+// typedef void (APIENTRYP GPEGLIMAGETARGETTEXTURESTORAGEEXT)(GLuint texture, GLeglImageOES image, const GLint* attrib_list);
+// typedef void (APIENTRYP GPEDGEFLAGFORMATNV)(GLsizei stride);
+// typedef void (APIENTRYP GPENABLE)(GLenum cap);
+// typedef void (APIENTRYP GPENABLECLIENTSTATEINDEXEDEXT)(GLenum array, GLuint index);
+// typedef void (APIENTRYP GPENABLECLIENTSTATEIEXT)(GLenum array, GLuint index);
+// typedef void (APIENTRYP GPENABLEINDEXEDEXT)(GLenum target, GLuint index);
+// typedef void (APIENTRYP GPENABLEVERTEXARRAYATTRIB)(GLuint vaobj, GLuint index);
+// typedef void (APIENTRYP GPENABLEVERTEXARRAYATTRIBEXT)(GLuint vaobj, GLuint index);
+// typedef void (APIENTRYP GPENABLEVERTEXARRAYEXT)(GLuint vaobj, GLenum array);
+// typedef void (APIENTRYP GPENABLEVERTEXATTRIBARRAY)(GLuint index);
+// typedef void (APIENTRYP GPENABLEI)(GLenum target, GLuint index);
+// typedef void (APIENTRYP GPENDCONDITIONALRENDER)();
+// typedef void (APIENTRYP GPENDCONDITIONALRENDERNV)();
+// typedef void (APIENTRYP GPENDPERFMONITORAMD)(GLuint monitor);
+// typedef void (APIENTRYP GPENDPERFQUERYINTEL)(GLuint queryHandle);
+// typedef void (APIENTRYP GPENDQUERY)(GLenum target);
+// typedef void (APIENTRYP GPENDQUERYINDEXED)(GLenum target, GLuint index);
+// typedef void (APIENTRYP GPENDTRANSFORMFEEDBACK)();
+// typedef void (APIENTRYP GPEVALUATEDEPTHVALUESARB)();
+// typedef GLsync (APIENTRYP GPFENCESYNC)(GLenum condition, GLbitfield flags);
+// typedef void (APIENTRYP GPFINISH)();
+// typedef void (APIENTRYP GPFLUSH)();
+// typedef void (APIENTRYP GPFLUSHMAPPEDBUFFERRANGE)(GLenum target, GLintptr offset, GLsizeiptr length);
+// typedef void (APIENTRYP GPFLUSHMAPPEDNAMEDBUFFERRANGE)(GLuint buffer, GLintptr offset, GLsizeiptr length);
+// typedef void (APIENTRYP GPFLUSHMAPPEDNAMEDBUFFERRANGEEXT)(GLuint buffer, GLintptr offset, GLsizeiptr length);
+// typedef void (APIENTRYP GPFOGCOORDFORMATNV)(GLenum type, GLsizei stride);
+// typedef void (APIENTRYP GPFRAGMENTCOVERAGECOLORNV)(GLuint color);
+// typedef void (APIENTRYP GPFRAMEBUFFERDRAWBUFFEREXT)(GLuint framebuffer, GLenum mode);
+// typedef void (APIENTRYP GPFRAMEBUFFERDRAWBUFFERSEXT)(GLuint framebuffer, GLsizei n, const GLenum * bufs);
+// typedef void (APIENTRYP GPFRAMEBUFFERFETCHBARRIEREXT)();
+// typedef void (APIENTRYP GPFRAMEBUFFERPARAMETERI)(GLenum target, GLenum pname, GLint param);
+// typedef void (APIENTRYP GPFRAMEBUFFERPARAMETERIMESA)(GLenum target, GLenum pname, GLint param);
+// typedef void (APIENTRYP GPFRAMEBUFFERREADBUFFEREXT)(GLuint framebuffer, GLenum mode);
+// typedef void (APIENTRYP GPFRAMEBUFFERRENDERBUFFER)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+// typedef void (APIENTRYP GPFRAMEBUFFERSAMPLELOCATIONSFVARB)(GLenum target, GLuint start, GLsizei count, const GLfloat * v);
+// typedef void (APIENTRYP GPFRAMEBUFFERSAMPLELOCATIONSFVNV)(GLenum target, GLuint start, GLsizei count, const GLfloat * v);
+// typedef void (APIENTRYP GPFRAMEBUFFERTEXTURE)(GLenum target, GLenum attachment, GLuint texture, GLint level);
+// typedef void (APIENTRYP GPFRAMEBUFFERTEXTURE1D)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+// typedef void (APIENTRYP GPFRAMEBUFFERTEXTURE2D)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+// typedef void (APIENTRYP GPFRAMEBUFFERTEXTURE3D)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
+// typedef void (APIENTRYP GPFRAMEBUFFERTEXTUREARB)(GLenum target, GLenum attachment, GLuint texture, GLint level);
+// typedef void (APIENTRYP GPFRAMEBUFFERTEXTUREFACEARB)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face);
+// typedef void (APIENTRYP GPFRAMEBUFFERTEXTURELAYER)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
+// typedef void (APIENTRYP GPFRAMEBUFFERTEXTURELAYERARB)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
+// typedef void (APIENTRYP GPFRAMEBUFFERTEXTUREMULTIVIEWOVR)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint baseViewIndex, GLsizei numViews);
+// typedef void (APIENTRYP GPFRONTFACE)(GLenum mode);
+// typedef void (APIENTRYP GPGENBUFFERS)(GLsizei n, GLuint * buffers);
+// typedef void (APIENTRYP GPGENFRAMEBUFFERS)(GLsizei n, GLuint * framebuffers);
+// typedef GLuint (APIENTRYP GPGENPATHSNV)(GLsizei range);
+// typedef void (APIENTRYP GPGENPERFMONITORSAMD)(GLsizei n, GLuint * monitors);
+// typedef void (APIENTRYP GPGENPROGRAMPIPELINES)(GLsizei n, GLuint * pipelines);
+// typedef void (APIENTRYP GPGENPROGRAMPIPELINESEXT)(GLsizei n, GLuint * pipelines);
+// typedef void (APIENTRYP GPGENQUERIES)(GLsizei n, GLuint * ids);
+// typedef void (APIENTRYP GPGENRENDERBUFFERS)(GLsizei n, GLuint * renderbuffers);
+// typedef void (APIENTRYP GPGENSAMPLERS)(GLsizei count, GLuint * samplers);
+// typedef void (APIENTRYP GPGENTEXTURES)(GLsizei n, GLuint * textures);
+// typedef void (APIENTRYP GPGENTRANSFORMFEEDBACKS)(GLsizei n, GLuint * ids);
+// typedef void (APIENTRYP GPGENVERTEXARRAYS)(GLsizei n, GLuint * arrays);
+// typedef void (APIENTRYP GPGENERATEMIPMAP)(GLenum target);
+// typedef void (APIENTRYP GPGENERATEMULTITEXMIPMAPEXT)(GLenum texunit, GLenum target);
+// typedef void (APIENTRYP GPGENERATETEXTUREMIPMAP)(GLuint texture);
+// typedef void (APIENTRYP GPGENERATETEXTUREMIPMAPEXT)(GLuint texture, GLenum target);
+// typedef void (APIENTRYP GPGETACTIVEATOMICCOUNTERBUFFERIV)(GLuint program, GLuint bufferIndex, GLenum pname, GLint * params);
+// typedef void (APIENTRYP GPGETACTIVEATTRIB)(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLchar * name);
+// typedef void (APIENTRYP GPGETACTIVESUBROUTINENAME)(GLuint program, GLenum shadertype, GLuint index, GLsizei bufSize, GLsizei * length, GLchar * name);
+// typedef void (APIENTRYP GPGETACTIVESUBROUTINEUNIFORMNAME)(GLuint program, GLenum shadertype, GLuint index, GLsizei bufSize, GLsizei * length, GLchar * name);
+// typedef void (APIENTRYP GPGETACTIVESUBROUTINEUNIFORMIV)(GLuint program, GLenum shadertype, GLuint index, GLenum pname, GLint * values);
+// typedef void (APIENTRYP GPGETACTIVEUNIFORM)(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLchar * name);
+// typedef void (APIENTRYP GPGETACTIVEUNIFORMBLOCKNAME)(GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei * length, GLchar * uniformBlockName);
+// typedef void (APIENTRYP GPGETACTIVEUNIFORMBLOCKIV)(GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint * params);
+// typedef void (APIENTRYP GPGETACTIVEUNIFORMNAME)(GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei * length, GLchar * uniformName);
+// typedef void (APIENTRYP GPGETACTIVEUNIFORMSIV)(GLuint program, GLsizei uniformCount, const GLuint * uniformIndices, GLenum pname, GLint * params);
+// typedef void (APIENTRYP GPGETATTACHEDSHADERS)(GLuint program, GLsizei maxCount, GLsizei * count, GLuint * shaders);
+// typedef GLint (APIENTRYP GPGETATTRIBLOCATION)(GLuint program, const GLchar * name);
+// typedef void (APIENTRYP GPGETBOOLEANINDEXEDVEXT)(GLenum target, GLuint index, GLboolean * data);
+// typedef void (APIENTRYP GPGETBOOLEANI_V)(GLenum target, GLuint index, GLboolean * data);
+// typedef void (APIENTRYP GPGETBOOLEANV)(GLenum pname, GLboolean * data);
+// typedef void (APIENTRYP GPGETBUFFERPARAMETERI64V)(GLenum target, GLenum pname, GLint64 * params);
+// typedef void (APIENTRYP GPGETBUFFERPARAMETERIV)(GLenum target, GLenum pname, GLint * params);
+// typedef void (APIENTRYP GPGETBUFFERPARAMETERUI64VNV)(GLenum target, GLenum pname, GLuint64EXT * params);
+// typedef void (APIENTRYP GPGETBUFFERPOINTERV)(GLenum target, GLenum pname, void ** params);
+// typedef void (APIENTRYP GPGETBUFFERSUBDATA)(GLenum target, GLintptr offset, GLsizeiptr size, void * data);
+// typedef GLuint (APIENTRYP GPGETCOMMANDHEADERNV)(GLenum tokenID, GLuint size);
+// typedef void (APIENTRYP GPGETCOMPRESSEDMULTITEXIMAGEEXT)(GLenum texunit, GLenum target, GLint lod, void * img);
+// typedef void (APIENTRYP GPGETCOMPRESSEDTEXIMAGE)(GLenum target, GLint level, void * img);
+// typedef void (APIENTRYP GPGETCOMPRESSEDTEXTUREIMAGE)(GLuint texture, GLint level, GLsizei bufSize, void * pixels);
+// typedef void (APIENTRYP GPGETCOMPRESSEDTEXTUREIMAGEEXT)(GLuint texture, GLenum target, GLint lod, void * img);
+// typedef void (APIENTRYP GPGETCOMPRESSEDTEXTURESUBIMAGE)(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei bufSize, void * pixels);
+// typedef void (APIENTRYP GPGETCOVERAGEMODULATIONTABLENV)(GLsizei bufSize, GLfloat * v);
+// typedef GLuint (APIENTRYP GPGETDEBUGMESSAGELOG)(GLuint count, GLsizei bufSize, GLenum * sources, GLenum * types, GLuint * ids, GLenum * severities, GLsizei * lengths, GLchar * messageLog);
+// typedef GLuint (APIENTRYP GPGETDEBUGMESSAGELOGARB)(GLuint count, GLsizei bufSize, GLenum * sources, GLenum * types, GLuint * ids, GLenum * severities, GLsizei * lengths, GLchar * messageLog);
+// typedef GLuint (APIENTRYP GPGETDEBUGMESSAGELOGKHR)(GLuint count, GLsizei bufSize, GLenum * sources, GLenum * types, GLuint * ids, GLenum * severities, GLsizei * lengths, GLchar * messageLog);
+// typedef void (APIENTRYP GPGETDOUBLEINDEXEDVEXT)(GLenum target, GLuint index, GLdouble * data);
+// typedef void (APIENTRYP GPGETDOUBLEI_V)(GLenum target, GLuint index, GLdouble * data);
+// typedef void (APIENTRYP GPGETDOUBLEI_VEXT)(GLenum pname, GLuint index, GLdouble * params);
+// typedef void (APIENTRYP GPGETDOUBLEV)(GLenum pname, GLdouble * data);
+// typedef GLenum (APIENTRYP GPGETERROR)();
+// typedef void (APIENTRYP GPGETFIRSTPERFQUERYIDINTEL)(GLuint * queryId);
+// typedef void (APIENTRYP GPGETFLOATINDEXEDVEXT)(GLenum target, GLuint index, GLfloat * data);
+// typedef void (APIENTRYP GPGETFLOATI_V)(GLenum target, GLuint index, GLfloat * data);
+// typedef void (APIENTRYP GPGETFLOATI_VEXT)(GLenum pname, GLuint index, GLfloat * params);
+// typedef void (APIENTRYP GPGETFLOATV)(GLenum pname, GLfloat * data);
+// typedef GLint (APIENTRYP GPGETFRAGDATAINDEX)(GLuint program, const GLchar * name);
+// typedef GLint (APIENTRYP GPGETFRAGDATALOCATION)(GLuint program, const GLchar * name);
+// typedef void (APIENTRYP GPGETFRAMEBUFFERATTACHMENTPARAMETERIV)(GLenum target, GLenum attachment, GLenum pname, GLint * params);
+// typedef void (APIENTRYP GPGETFRAMEBUFFERPARAMETERIV)(GLenum target, GLenum pname, GLint * params);
+// typedef void (APIENTRYP GPGETFRAMEBUFFERPARAMETERIVEXT)(GLuint framebuffer, GLenum pname, GLint * params);
+// typedef void (APIENTRYP GPGETFRAMEBUFFERPARAMETERIVMESA)(GLenum target, GLenum pname, GLint * params);
+// typedef GLenum (APIENTRYP GPGETGRAPHICSRESETSTATUS)();
+// typedef GLenum (APIENTRYP GPGETGRAPHICSRESETSTATUSARB)();
+// typedef GLenum (APIENTRYP GPGETGRAPHICSRESETSTATUSKHR)();
+// typedef GLuint64 (APIENTRYP GPGETIMAGEHANDLEARB)(GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format);
+// typedef GLuint64 (APIENTRYP GPGETIMAGEHANDLENV)(GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format);
+// typedef void (APIENTRYP GPGETINTEGER64I_V)(GLenum target, GLuint index, GLint64 * data);
+// typedef void (APIENTRYP GPGETINTEGER64V)(GLenum pname, GLint64 * data);
+// typedef void (APIENTRYP GPGETINTEGERINDEXEDVEXT)(GLenum target, GLuint index, GLint * data);
+// typedef void (APIENTRYP GPGETINTEGERI_V)(GLenum target, GLuint index, GLint * data);
+// typedef void (APIENTRYP GPGETINTEGERUI64I_VNV)(GLenum value, GLuint index, GLuint64EXT * result);
+// typedef void (APIENTRYP GPGETINTEGERUI64VNV)(GLenum value, GLuint64EXT * result);
+// typedef void (APIENTRYP GPGETINTEGERV)(GLenum pname, GLint * data);
+// typedef void (APIENTRYP GPGETINTERNALFORMATSAMPLEIVNV)(GLenum target, GLenum internalformat, GLsizei samples, GLenum pname, GLsizei count, GLint * params);
+// typedef void (APIENTRYP GPGETINTERNALFORMATI64V)(GLenum target, GLenum internalformat, GLenum pname, GLsizei count, GLint64 * params);
+// typedef void (APIENTRYP GPGETINTERNALFORMATIV)(GLenum target, GLenum internalformat, GLenum pname, GLsizei count, GLint * params);
+// typedef void (APIENTRYP GPGETMEMORYOBJECTDETACHEDRESOURCESUIVNV)(GLuint memory, GLenum pname, GLint first, GLsizei count, GLuint * params);
+// typedef void (APIENTRYP GPGETMULTITEXENVFVEXT)(GLenum texunit, GLenum target, GLenum pname, GLfloat * params);
+// typedef void (APIENTRYP GPGETMULTITEXENVIVEXT)(GLenum texunit, GLenum target, GLenum pname, GLint * params);
+// typedef void (APIENTRYP GPGETMULTITEXGENDVEXT)(GLenum texunit, GLenum coord, GLenum pname, GLdouble * params);
+// typedef void (APIENTRYP GPGETMULTITEXGENFVEXT)(GLenum texunit, GLenum coord, GLenum pname, GLfloat * params);
+// typedef void (APIENTRYP GPGETMULTITEXGENIVEXT)(GLenum texunit, GLenum coord, GLenum pname, GLint * params);
+// typedef void (APIENTRYP GPGETMULTITEXIMAGEEXT)(GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, void * pixels);
+// typedef void (APIENTRYP GPGETMULTITEXLEVELPARAMETERFVEXT)(GLenum texunit, GLenum target, GLint level, GLenum pname, GLfloat * params);
+// typedef void (APIENTRYP GPGETMULTITEXLEVELPARAMETERIVEXT)(GLenum texunit, GLenum target, GLint level, GLenum pname, GLint * params);
+// typedef void (APIENTRYP GPGETMULTITEXPARAMETERIIVEXT)(GLenum texunit, GLenum target, GLenum pname, GLint * params);
+// typedef void (APIENTRYP GPGETMULTITEXPARAMETERIUIVEXT)(GLenum texunit, GLenum target, GLenum pname, GLuint * params);
+// typedef void (APIENTRYP GPGETMULTITEXPARAMETERFVEXT)(GLenum texunit, GLenum target, GLenum pname, GLfloat * params);
+// typedef void (APIENTRYP GPGETMULTITEXPARAMETERIVEXT)(GLenum texunit, GLenum target, GLenum pname, GLint * params);
+// typedef void (APIENTRYP GPGETMULTISAMPLEFV)(GLenum pname, GLuint index, GLfloat * val);
+// typedef void (APIENTRYP GPGETNAMEDBUFFERPARAMETERI64V)(GLuint buffer, GLenum pname, GLint64 * params);
+// typedef void (APIENTRYP GPGETNAMEDBUFFERPARAMETERIV)(GLuint buffer, GLenum pname, GLint * params);
+// typedef void (APIENTRYP GPGETNAMEDBUFFERPARAMETERIVEXT)(GLuint buffer, GLenum pname, GLint * params);
+// typedef void (APIENTRYP GPGETNAMEDBUFFERPARAMETERUI64VNV)(GLuint buffer, GLenum pname, GLuint64EXT * params);
+// typedef void (APIENTRYP GPGETNAMEDBUFFERPOINTERV)(GLuint buffer, GLenum pname, void ** params);
+// typedef void (APIENTRYP GPGETNAMEDBUFFERPOINTERVEXT)(GLuint buffer, GLenum pname, void ** params);
+// typedef void (APIENTRYP GPGETNAMEDBUFFERSUBDATA)(GLuint buffer, GLintptr offset, GLsizeiptr size, void * data);
+// typedef void (APIENTRYP GPGETNAMEDBUFFERSUBDATAEXT)(GLuint buffer, GLintptr offset, GLsizeiptr size, void * data);
+// typedef void (APIENTRYP GPGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIV)(GLuint framebuffer, GLenum attachment, GLenum pname, GLint * params);
+// typedef void (APIENTRYP GPGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXT)(GLuint framebuffer, GLenum attachment, GLenum pname, GLint * params);
+// typedef void (APIENTRYP GPGETNAMEDFRAMEBUFFERPARAMETERIV)(GLuint framebuffer, GLenum pname, GLint * param);
+// typedef void (APIENTRYP GPGETNAMEDFRAMEBUFFERPARAMETERIVEXT)(GLuint framebuffer, GLenum pname, GLint * params);
+// typedef void (APIENTRYP GPGETNAMEDPROGRAMLOCALPARAMETERIIVEXT)(GLuint program, GLenum target, GLuint index, GLint * params);
+// typedef void (APIENTRYP GPGETNAMEDPROGRAMLOCALPARAMETERIUIVEXT)(GLuint program, GLenum target, GLuint index, GLuint * params);
+// typedef void (APIENTRYP GPGETNAMEDPROGRAMLOCALPARAMETERDVEXT)(GLuint program, GLenum target, GLuint index, GLdouble * params);
+// typedef void (APIENTRYP GPGETNAMEDPROGRAMLOCALPARAMETERFVEXT)(GLuint program, GLenum target, GLuint index, GLfloat * params);
+// typedef void (APIENTRYP GPGETNAMEDPROGRAMSTRINGEXT)(GLuint program, GLenum target, GLenum pname, void * string);
+// typedef void (APIENTRYP GPGETNAMEDPROGRAMIVEXT)(GLuint program, GLenum target, GLenum pname, GLint * params);
+// typedef void (APIENTRYP GPGETNAMEDRENDERBUFFERPARAMETERIV)(GLuint renderbuffer, GLenum pname, GLint * params);
+// typedef void (APIENTRYP GPGETNAMEDRENDERBUFFERPARAMETERIVEXT)(GLuint renderbuffer, GLenum pname, GLint * params);
+// typedef void (APIENTRYP GPGETNAMEDSTRINGARB)(GLint namelen, const GLchar * name, GLsizei bufSize, GLint * stringlen, GLchar * string);
+// typedef void (APIENTRYP GPGETNAMEDSTRINGIVARB)(GLint namelen, const GLchar * name, GLenum pname, GLint * params);
+// typedef void (APIENTRYP GPGETNEXTPERFQUERYIDINTEL)(GLuint queryId, GLuint * nextQueryId);
+// typedef void (APIENTRYP GPGETOBJECTLABEL)(GLenum identifier, GLuint name, GLsizei bufSize, GLsizei * length, GLchar * label);
+// typedef void (APIENTRYP GPGETOBJECTLABELEXT)(GLenum type, GLuint object, GLsizei bufSize, GLsizei * length, GLchar * label);
+// typedef void (APIENTRYP GPGETOBJECTLABELKHR)(GLenum identifier, GLuint name, GLsizei bufSize, GLsizei * length, GLchar * label);
+// typedef void (APIENTRYP GPGETOBJECTPTRLABEL)(const void * ptr, GLsizei bufSize, GLsizei * length, GLchar * label);
+// typedef void (APIENTRYP GPGETOBJECTPTRLABELKHR)(const void * ptr, GLsizei bufSize, GLsizei * length, GLchar * label);
+// typedef void (APIENTRYP GPGETPATHCOMMANDSNV)(GLuint path, GLubyte * commands);
+// typedef void (APIENTRYP GPGETPATHCOORDSNV)(GLuint path, GLfloat * coords);
+// typedef void (APIENTRYP GPGETPATHDASHARRAYNV)(GLuint path, GLfloat * dashArray);
+// typedef GLfloat (APIENTRYP GPGETPATHLENGTHNV)(GLuint path, GLsizei startSegment, GLsizei numSegments);
+// typedef void (APIENTRYP GPGETPATHMETRICRANGENV)(GLbitfield metricQueryMask, GLuint firstPathName, GLsizei numPaths, GLsizei stride, GLfloat * metrics);
+// typedef void (APIENTRYP GPGETPATHMETRICSNV)(GLbitfield metricQueryMask, GLsizei numPaths, GLenum pathNameType, const void * paths, GLuint pathBase, GLsizei stride, GLfloat * metrics);
+// typedef void (APIENTRYP GPGETPATHPARAMETERFVNV)(GLuint path, GLenum pname, GLfloat * value);
+// typedef void (APIENTRYP GPGETPATHPARAMETERIVNV)(GLuint path, GLenum pname, GLint * value);
+// typedef void (APIENTRYP GPGETPATHSPACINGNV)(GLenum pathListMode, GLsizei numPaths, GLenum pathNameType, const void * paths, GLuint pathBase, GLfloat advanceScale, GLfloat kerningScale, GLenum transformType, GLfloat * returnedSpacing);
+// typedef void (APIENTRYP GPGETPERFCOUNTERINFOINTEL)(GLuint queryId, GLuint counterId, GLuint counterNameLength, GLchar * counterName, GLuint counterDescLength, GLchar * counterDesc, GLuint * counterOffset, GLuint * counterDataSize, GLuint * counterTypeEnum, GLuint * counterDataTypeEnum, GLuint64 * rawCounterMaxValue);
+// typedef void (APIENTRYP GPGETPERFMONITORCOUNTERDATAAMD)(GLuint monitor, GLenum pname, GLsizei dataSize, GLuint * data, GLint * bytesWritten);
+// typedef void (APIENTRYP GPGETPERFMONITORCOUNTERINFOAMD)(GLuint group, GLuint counter, GLenum pname, void * data);
+// typedef void (APIENTRYP GPGETPERFMONITORCOUNTERSTRINGAMD)(GLuint group, GLuint counter, GLsizei bufSize, GLsizei * length, GLchar * counterString);
+// typedef void (APIENTRYP GPGETPERFMONITORCOUNTERSAMD)(GLuint group, GLint * numCounters, GLint * maxActiveCounters, GLsizei counterSize, GLuint * counters);
+// typedef void (APIENTRYP GPGETPERFMONITORGROUPSTRINGAMD)(GLuint group, GLsizei bufSize, GLsizei * length, GLchar * groupString);
+// typedef void (APIENTRYP GPGETPERFMONITORGROUPSAMD)(GLint * numGroups, GLsizei groupsSize, GLuint * groups);
+// typedef void (APIENTRYP GPGETPERFQUERYDATAINTEL)(GLuint queryHandle, GLuint flags, GLsizei dataSize, void * data, GLuint * bytesWritten);
+// typedef void (APIENTRYP GPGETPERFQUERYIDBYNAMEINTEL)(GLchar * queryName, GLuint * queryId);
+// typedef void (APIENTRYP GPGETPERFQUERYINFOINTEL)(GLuint queryId, GLuint queryNameLength, GLchar * queryName, GLuint * dataSize, GLuint * noCounters, GLuint * noInstances, GLuint * capsMask);
+// typedef void (APIENTRYP GPGETPOINTERINDEXEDVEXT)(GLenum target, GLuint index, void ** data);
+// typedef void (APIENTRYP GPGETPOINTERI_VEXT)(GLenum pname, GLuint index, void ** params);
+// typedef void (APIENTRYP GPGETPOINTERV)(GLenum pname, void ** params);
+// typedef void (APIENTRYP GPGETPOINTERVKHR)(GLenum pname, void ** params);
+// typedef void (APIENTRYP GPGETPROGRAMBINARY)(GLuint program, GLsizei bufSize, GLsizei * length, GLenum * binaryFormat, void * binary);
+// typedef void (APIENTRYP GPGETPROGRAMINFOLOG)(GLuint program, GLsizei bufSize, GLsizei * length, GLchar * infoLog);
+// typedef void (APIENTRYP GPGETPROGRAMINTERFACEIV)(GLuint program, GLenum programInterface, GLenum pname, GLint * params);
+// typedef void (APIENTRYP GPGETPROGRAMPIPELINEINFOLOG)(GLuint pipeline, GLsizei bufSize, GLsizei * length, GLchar * infoLog);
+// typedef void (APIENTRYP GPGETPROGRAMPIPELINEINFOLOGEXT)(GLuint pipeline, GLsizei bufSize, GLsizei * length, GLchar * infoLog);
+// typedef void (APIENTRYP GPGETPROGRAMPIPELINEIV)(GLuint pipeline, GLenum pname, GLint * params);
+// typedef void (APIENTRYP GPGETPROGRAMPIPELINEIVEXT)(GLuint pipeline, GLenum pname, GLint * params);
+// typedef GLuint (APIENTRYP GPGETPROGRAMRESOURCEINDEX)(GLuint program, GLenum programInterface, const GLchar * name);
+// typedef GLint (APIENTRYP GPGETPROGRAMRESOURCELOCATION)(GLuint program, GLenum programInterface, const GLchar * name);
+// typedef GLint (APIENTRYP GPGETPROGRAMRESOURCELOCATIONINDEX)(GLuint program, GLenum programInterface, const GLchar * name);
+// typedef void (APIENTRYP GPGETPROGRAMRESOURCENAME)(GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei * length, GLchar * name);
+// typedef void (APIENTRYP GPGETPROGRAMRESOURCEFVNV)(GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum * props, GLsizei count, GLsizei * length, GLfloat * params);
+// typedef void (APIENTRYP GPGETPROGRAMRESOURCEIV)(GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum * props, GLsizei count, GLsizei * length, GLint * params);
+// typedef void (APIENTRYP GPGETPROGRAMSTAGEIV)(GLuint program, GLenum shadertype, GLenum pname, GLint * values);
+// typedef void (APIENTRYP GPGETPROGRAMIV)(GLuint program, GLenum pname, GLint * params);
+// typedef void (APIENTRYP GPGETQUERYBUFFEROBJECTI64V)(GLuint id, GLuint buffer, GLenum pname, GLintptr offset);
+// typedef void (APIENTRYP GPGETQUERYBUFFEROBJECTIV)(GLuint id, GLuint buffer, GLenum pname, GLintptr offset);
+// typedef void (APIENTRYP GPGETQUERYBUFFEROBJECTUI64V)(GLuint id, GLuint buffer, GLenum pname, GLintptr offset);
+// typedef void (APIENTRYP GPGETQUERYBUFFEROBJECTUIV)(GLuint id, GLuint buffer, GLenum pname, GLintptr offset);
+// typedef void (APIENTRYP GPGETQUERYINDEXEDIV)(GLenum target, GLuint index, GLenum pname, GLint * params);
+// typedef void (APIENTRYP GPGETQUERYOBJECTI64V)(GLuint id, GLenum pname, GLint64 * params);
+// typedef void (APIENTRYP GPGETQUERYOBJECTIV)(GLuint id, GLenum pname, GLint * params);
+// typedef void (APIENTRYP GPGETQUERYOBJECTUI64V)(GLuint id, GLenum pname, GLuint64 * params);
+// typedef void (APIENTRYP GPGETQUERYOBJECTUIV)(GLuint id, GLenum pname, GLuint * params);
+// typedef void (APIENTRYP GPGETQUERYIV)(GLenum target, GLenum pname, GLint * params);
+// typedef void (APIENTRYP GPGETRENDERBUFFERPARAMETERIV)(GLenum target, GLenum pname, GLint * params);
+// typedef void (APIENTRYP GPGETSAMPLERPARAMETERIIV)(GLuint sampler, GLenum pname, GLint * params);
+// typedef void (APIENTRYP GPGETSAMPLERPARAMETERIUIV)(GLuint sampler, GLenum pname, GLuint * params);
+// typedef void (APIENTRYP GPGETSAMPLERPARAMETERFV)(GLuint sampler, GLenum pname, GLfloat * params);
+// typedef void (APIENTRYP GPGETSAMPLERPARAMETERIV)(GLuint sampler, GLenum pname, GLint * params);
+// typedef void (APIENTRYP GPGETSHADERINFOLOG)(GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * infoLog);
+// typedef void (APIENTRYP GPGETSHADERPRECISIONFORMAT)(GLenum shadertype, GLenum precisiontype, GLint * range, GLint * precision);
+// typedef void (APIENTRYP GPGETSHADERSOURCE)(GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * source);
+// typedef void (APIENTRYP GPGETSHADERIV)(GLuint shader, GLenum pname, GLint * params);
+// typedef void (APIENTRYP GPGETSHADINGRATEIMAGEPALETTENV)(GLuint viewport, GLuint entry, GLenum * rate);
+// typedef void (APIENTRYP GPGETSHADINGRATESAMPLELOCATIONIVNV)(GLenum rate, GLuint samples, GLuint index, GLint * location);
+// typedef GLushort (APIENTRYP GPGETSTAGEINDEXNV)(GLenum shadertype);
+// typedef const GLubyte * (APIENTRYP GPGETSTRING)(GLenum name);
+// typedef const GLubyte * (APIENTRYP GPGETSTRINGI)(GLenum name, GLuint index);
+// typedef GLuint (APIENTRYP GPGETSUBROUTINEINDEX)(GLuint program, GLenum shadertype, const GLchar * name);
+// typedef GLint (APIENTRYP GPGETSUBROUTINEUNIFORMLOCATION)(GLuint program, GLenum shadertype, const GLchar * name);
+// typedef void (APIENTRYP GPGETSYNCIV)(GLsync sync, GLenum pname, GLsizei count, GLsizei * length, GLint * values);
+// typedef void (APIENTRYP GPGETTEXIMAGE)(GLenum target, GLint level, GLenum format, GLenum type, void * pixels);
+// typedef void (APIENTRYP GPGETTEXLEVELPARAMETERFV)(GLenum target, GLint level, GLenum pname, GLfloat * params);
+// typedef void (APIENTRYP GPGETTEXLEVELPARAMETERIV)(GLenum target, GLint level, GLenum pname, GLint * params);
+// typedef void (APIENTRYP GPGETTEXPARAMETERIIV)(GLenum target, GLenum pname, GLint * params);
+// typedef void (APIENTRYP GPGETTEXPARAMETERIUIV)(GLenum target, GLenum pname, GLuint * params);
+// typedef void (APIENTRYP GPGETTEXPARAMETERFV)(GLenum target, GLenum pname, GLfloat * params);
+// typedef void (APIENTRYP GPGETTEXPARAMETERIV)(GLenum target, GLenum pname, GLint * params);
+// typedef GLuint64 (APIENTRYP GPGETTEXTUREHANDLEARB)(GLuint texture);
+// typedef GLuint64 (APIENTRYP GPGETTEXTUREHANDLENV)(GLuint texture);
+// typedef void (APIENTRYP GPGETTEXTUREIMAGE)(GLuint texture, GLint level, GLenum format, GLenum type, GLsizei bufSize, void * pixels);
+// typedef void (APIENTRYP GPGETTEXTUREIMAGEEXT)(GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, void * pixels);
+// typedef void (APIENTRYP GPGETTEXTURELEVELPARAMETERFV)(GLuint texture, GLint level, GLenum pname, GLfloat * params);
+// typedef void (APIENTRYP GPGETTEXTURELEVELPARAMETERFVEXT)(GLuint texture, GLenum target, GLint level, GLenum pname, GLfloat * params);
+// typedef void (APIENTRYP GPGETTEXTURELEVELPARAMETERIV)(GLuint texture, GLint level, GLenum pname, GLint * params);
+// typedef void (APIENTRYP GPGETTEXTURELEVELPARAMETERIVEXT)(GLuint texture, GLenum target, GLint level, GLenum pname, GLint * params);
+// typedef void (APIENTRYP GPGETTEXTUREPARAMETERIIV)(GLuint texture, GLenum pname, GLint * params);
+// typedef void (APIENTRYP GPGETTEXTUREPARAMETERIIVEXT)(GLuint texture, GLenum target, GLenum pname, GLint * params);
+// typedef void (APIENTRYP GPGETTEXTUREPARAMETERIUIV)(GLuint texture, GLenum pname, GLuint * params);
+// typedef void (APIENTRYP GPGETTEXTUREPARAMETERIUIVEXT)(GLuint texture, GLenum target, GLenum pname, GLuint * params);
+// typedef void (APIENTRYP GPGETTEXTUREPARAMETERFV)(GLuint texture, GLenum pname, GLfloat * params);
+// typedef void (APIENTRYP GPGETTEXTUREPARAMETERFVEXT)(GLuint texture, GLenum target, GLenum pname, GLfloat * params);
+// typedef void (APIENTRYP GPGETTEXTUREPARAMETERIV)(GLuint texture, GLenum pname, GLint * params);
+// typedef void (APIENTRYP GPGETTEXTUREPARAMETERIVEXT)(GLuint texture, GLenum target, GLenum pname, GLint * params);
+// typedef GLuint64 (APIENTRYP GPGETTEXTURESAMPLERHANDLEARB)(GLuint texture, GLuint sampler);
+// typedef GLuint64 (APIENTRYP GPGETTEXTURESAMPLERHANDLENV)(GLuint texture, GLuint sampler);
+// typedef void (APIENTRYP GPGETTEXTURESUBIMAGE)(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLsizei bufSize, void * pixels);
+// typedef void (APIENTRYP GPGETTRANSFORMFEEDBACKVARYING)(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLsizei * size, GLenum * type, GLchar * name);
+// typedef void (APIENTRYP GPGETTRANSFORMFEEDBACKI64_V)(GLuint xfb, GLenum pname, GLuint index, GLint64 * param);
+// typedef void (APIENTRYP GPGETTRANSFORMFEEDBACKI_V)(GLuint xfb, GLenum pname, GLuint index, GLint * param);
+// typedef void (APIENTRYP GPGETTRANSFORMFEEDBACKIV)(GLuint xfb, GLenum pname, GLint * param);
+// typedef GLuint (APIENTRYP GPGETUNIFORMBLOCKINDEX)(GLuint program, const GLchar * uniformBlockName);
+// typedef void (APIENTRYP GPGETUNIFORMINDICES)(GLuint program, GLsizei uniformCount, const GLchar *const* uniformNames, GLuint * uniformIndices);
+// typedef GLint (APIENTRYP GPGETUNIFORMLOCATION)(GLuint program, const GLchar * name);
+// typedef void (APIENTRYP GPGETUNIFORMSUBROUTINEUIV)(GLenum shadertype, GLint location, GLuint * params);
+// typedef void (APIENTRYP GPGETUNIFORMDV)(GLuint program, GLint location, GLdouble * params);
+// typedef void (APIENTRYP GPGETUNIFORMFV)(GLuint program, GLint location, GLfloat * params);
+// typedef void (APIENTRYP GPGETUNIFORMI64VARB)(GLuint program, GLint location, GLint64 * params);
+// typedef void (APIENTRYP GPGETUNIFORMI64VNV)(GLuint program, GLint location, GLint64EXT * params);
+// typedef void (APIENTRYP GPGETUNIFORMIV)(GLuint program, GLint location, GLint * params);
+// typedef void (APIENTRYP GPGETUNIFORMUI64VARB)(GLuint program, GLint location, GLuint64 * params);
+// typedef void (APIENTRYP GPGETUNIFORMUI64VNV)(GLuint program, GLint location, GLuint64EXT * params);
+// typedef void (APIENTRYP GPGETUNIFORMUIV)(GLuint program, GLint location, GLuint * params);
+// typedef void (APIENTRYP GPGETVERTEXARRAYINDEXED64IV)(GLuint vaobj, GLuint index, GLenum pname, GLint64 * param);
+// typedef void (APIENTRYP GPGETVERTEXARRAYINDEXEDIV)(GLuint vaobj, GLuint index, GLenum pname, GLint * param);
+// typedef void (APIENTRYP GPGETVERTEXARRAYINTEGERI_VEXT)(GLuint vaobj, GLuint index, GLenum pname, GLint * param);
+// typedef void (APIENTRYP GPGETVERTEXARRAYINTEGERVEXT)(GLuint vaobj, GLenum pname, GLint * param);
+// typedef void (APIENTRYP GPGETVERTEXARRAYPOINTERI_VEXT)(GLuint vaobj, GLuint index, GLenum pname, void ** param);
+// typedef void (APIENTRYP GPGETVERTEXARRAYPOINTERVEXT)(GLuint vaobj, GLenum pname, void ** param);
+// typedef void (APIENTRYP GPGETVERTEXARRAYIV)(GLuint vaobj, GLenum pname, GLint * param);
+// typedef void (APIENTRYP GPGETVERTEXATTRIBIIV)(GLuint index, GLenum pname, GLint * params);
+// typedef void (APIENTRYP GPGETVERTEXATTRIBIUIV)(GLuint index, GLenum pname, GLuint * params);
+// typedef void (APIENTRYP GPGETVERTEXATTRIBLDV)(GLuint index, GLenum pname, GLdouble * params);
+// typedef void (APIENTRYP GPGETVERTEXATTRIBLI64VNV)(GLuint index, GLenum pname, GLint64EXT * params);
+// typedef void (APIENTRYP GPGETVERTEXATTRIBLUI64VARB)(GLuint index, GLenum pname, GLuint64EXT * params);
+// typedef void (APIENTRYP GPGETVERTEXATTRIBLUI64VNV)(GLuint index, GLenum pname, GLuint64EXT * params);
+// typedef void (APIENTRYP GPGETVERTEXATTRIBPOINTERV)(GLuint index, GLenum pname, void ** pointer);
+// typedef void (APIENTRYP GPGETVERTEXATTRIBDV)(GLuint index, GLenum pname, GLdouble * params);
+// typedef void (APIENTRYP GPGETVERTEXATTRIBFV)(GLuint index, GLenum pname, GLfloat * params);
+// typedef void (APIENTRYP GPGETVERTEXATTRIBIV)(GLuint index, GLenum pname, GLint * params);
+// typedef GLVULKANPROCNV (APIENTRYP GPGETVKPROCADDRNV)(const GLchar * name);
+// typedef void (APIENTRYP GPGETNCOMPRESSEDTEXIMAGEARB)(GLenum target, GLint lod, GLsizei bufSize, void * img);
+// typedef void (APIENTRYP GPGETNTEXIMAGEARB)(GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, void * img);
+// typedef void (APIENTRYP GPGETNUNIFORMDVARB)(GLuint program, GLint location, GLsizei bufSize, GLdouble * params);
+// typedef void (APIENTRYP GPGETNUNIFORMFV)(GLuint program, GLint location, GLsizei bufSize, GLfloat * params);
+// typedef void (APIENTRYP GPGETNUNIFORMFVARB)(GLuint program, GLint location, GLsizei bufSize, GLfloat * params);
+// typedef void (APIENTRYP GPGETNUNIFORMFVKHR)(GLuint program, GLint location, GLsizei bufSize, GLfloat * params);
+// typedef void (APIENTRYP GPGETNUNIFORMI64VARB)(GLuint program, GLint location, GLsizei bufSize, GLint64 * params);
+// typedef void (APIENTRYP GPGETNUNIFORMIV)(GLuint program, GLint location, GLsizei bufSize, GLint * params);
+// typedef void (APIENTRYP GPGETNUNIFORMIVARB)(GLuint program, GLint location, GLsizei bufSize, GLint * params);
+// typedef void (APIENTRYP GPGETNUNIFORMIVKHR)(GLuint program, GLint location, GLsizei bufSize, GLint * params);
+// typedef void (APIENTRYP GPGETNUNIFORMUI64VARB)(GLuint program, GLint location, GLsizei bufSize, GLuint64 * params);
+// typedef void (APIENTRYP GPGETNUNIFORMUIV)(GLuint program, GLint location, GLsizei bufSize, GLuint * params);
+// typedef void (APIENTRYP GPGETNUNIFORMUIVARB)(GLuint program, GLint location, GLsizei bufSize, GLuint * params);
+// typedef void (APIENTRYP GPGETNUNIFORMUIVKHR)(GLuint program, GLint location, GLsizei bufSize, GLuint * params);
+// typedef void (APIENTRYP GPHINT)(GLenum target, GLenum mode);
+// typedef void (APIENTRYP GPINDEXFORMATNV)(GLenum type, GLsizei stride);
+// typedef void (APIENTRYP GPINSERTEVENTMARKEREXT)(GLsizei length, const GLchar * marker);
+// typedef void (APIENTRYP GPINTERPOLATEPATHSNV)(GLuint resultPath, GLuint pathA, GLuint pathB, GLfloat weight);
+// typedef void (APIENTRYP GPINVALIDATEBUFFERDATA)(GLuint buffer);
+// typedef void (APIENTRYP GPINVALIDATEBUFFERSUBDATA)(GLuint buffer, GLintptr offset, GLsizeiptr length);
+// typedef void (APIENTRYP GPINVALIDATEFRAMEBUFFER)(GLenum target, GLsizei numAttachments, const GLenum * attachments);
+// typedef void (APIENTRYP GPINVALIDATENAMEDFRAMEBUFFERDATA)(GLuint framebuffer, GLsizei numAttachments, const GLenum * attachments);
+// typedef void (APIENTRYP GPINVALIDATENAMEDFRAMEBUFFERSUBDATA)(GLuint framebuffer, GLsizei numAttachments, const GLenum * attachments, GLint x, GLint y, GLsizei width, GLsizei height);
+// typedef void (APIENTRYP GPINVALIDATESUBFRAMEBUFFER)(GLenum target, GLsizei numAttachments, const GLenum * attachments, GLint x, GLint y, GLsizei width, GLsizei height);
+// typedef void (APIENTRYP GPINVALIDATETEXIMAGE)(GLuint texture, GLint level);
+// typedef void (APIENTRYP GPINVALIDATETEXSUBIMAGE)(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth);
+// typedef GLboolean (APIENTRYP GPISBUFFER)(GLuint buffer);
+// typedef GLboolean (APIENTRYP GPISBUFFERRESIDENTNV)(GLenum target);
+// typedef GLboolean (APIENTRYP GPISCOMMANDLISTNV)(GLuint list);
+// typedef GLboolean (APIENTRYP GPISENABLED)(GLenum cap);
+// typedef GLboolean (APIENTRYP GPISENABLEDINDEXEDEXT)(GLenum target, GLuint index);
+// typedef GLboolean (APIENTRYP GPISENABLEDI)(GLenum target, GLuint index);
+// typedef GLboolean (APIENTRYP GPISFRAMEBUFFER)(GLuint framebuffer);
+// typedef GLboolean (APIENTRYP GPISIMAGEHANDLERESIDENTARB)(GLuint64 handle);
+// typedef GLboolean (APIENTRYP GPISIMAGEHANDLERESIDENTNV)(GLuint64 handle);
+// typedef GLboolean (APIENTRYP GPISNAMEDBUFFERRESIDENTNV)(GLuint buffer);
+// typedef GLboolean (APIENTRYP GPISNAMEDSTRINGARB)(GLint namelen, const GLchar * name);
+// typedef GLboolean (APIENTRYP GPISPATHNV)(GLuint path);
+// typedef GLboolean (APIENTRYP GPISPOINTINFILLPATHNV)(GLuint path, GLuint mask, GLfloat x, GLfloat y);
+// typedef GLboolean (APIENTRYP GPISPOINTINSTROKEPATHNV)(GLuint path, GLfloat x, GLfloat y);
+// typedef GLboolean (APIENTRYP GPISPROGRAM)(GLuint program);
+// typedef GLboolean (APIENTRYP GPISPROGRAMPIPELINE)(GLuint pipeline);
+// typedef GLboolean (APIENTRYP GPISPROGRAMPIPELINEEXT)(GLuint pipeline);
+// typedef GLboolean (APIENTRYP GPISQUERY)(GLuint id);
+// typedef GLboolean (APIENTRYP GPISRENDERBUFFER)(GLuint renderbuffer);
+// typedef GLboolean (APIENTRYP GPISSAMPLER)(GLuint sampler);
+// typedef GLboolean (APIENTRYP GPISSHADER)(GLuint shader);
+// typedef GLboolean (APIENTRYP GPISSTATENV)(GLuint state);
+// typedef GLboolean (APIENTRYP GPISSYNC)(GLsync sync);
+// typedef GLboolean (APIENTRYP GPISTEXTURE)(GLuint texture);
+// typedef GLboolean (APIENTRYP GPISTEXTUREHANDLERESIDENTARB)(GLuint64 handle);
+// typedef GLboolean (APIENTRYP GPISTEXTUREHANDLERESIDENTNV)(GLuint64 handle);
+// typedef GLboolean (APIENTRYP GPISTRANSFORMFEEDBACK)(GLuint id);
+// typedef GLboolean (APIENTRYP GPISVERTEXARRAY)(GLuint array);
+// typedef void (APIENTRYP GPLABELOBJECTEXT)(GLenum type, GLuint object, GLsizei length, const GLchar * label);
+// typedef void (APIENTRYP GPLINEWIDTH)(GLfloat width);
+// typedef void (APIENTRYP GPLINKPROGRAM)(GLuint program);
+// typedef void (APIENTRYP GPLISTDRAWCOMMANDSSTATESCLIENTNV)(GLuint list, GLuint segment, const void ** indirects, const GLsizei * sizes, const GLuint * states, const GLuint * fbos, GLuint count);
+// typedef void (APIENTRYP GPLOGICOP)(GLenum opcode);
+// typedef void (APIENTRYP GPMAKEBUFFERNONRESIDENTNV)(GLenum target);
+// typedef void (APIENTRYP GPMAKEBUFFERRESIDENTNV)(GLenum target, GLenum access);
+// typedef void (APIENTRYP GPMAKEIMAGEHANDLENONRESIDENTARB)(GLuint64 handle);
+// typedef void (APIENTRYP GPMAKEIMAGEHANDLENONRESIDENTNV)(GLuint64 handle);
+// typedef void (APIENTRYP GPMAKEIMAGEHANDLERESIDENTARB)(GLuint64 handle, GLenum access);
+// typedef void (APIENTRYP GPMAKEIMAGEHANDLERESIDENTNV)(GLuint64 handle, GLenum access);
+// typedef void (APIENTRYP GPMAKENAMEDBUFFERNONRESIDENTNV)(GLuint buffer);
+// typedef void (APIENTRYP GPMAKENAMEDBUFFERRESIDENTNV)(GLuint buffer, GLenum access);
+// typedef void (APIENTRYP GPMAKETEXTUREHANDLENONRESIDENTARB)(GLuint64 handle);
+// typedef void (APIENTRYP GPMAKETEXTUREHANDLENONRESIDENTNV)(GLuint64 handle);
+// typedef void (APIENTRYP GPMAKETEXTUREHANDLERESIDENTARB)(GLuint64 handle);
+// typedef void (APIENTRYP GPMAKETEXTUREHANDLERESIDENTNV)(GLuint64 handle);
+// typedef void * (APIENTRYP GPMAPBUFFER)(GLenum target, GLenum access);
+// typedef void * (APIENTRYP GPMAPBUFFERRANGE)(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
+// typedef void * (APIENTRYP GPMAPNAMEDBUFFER)(GLuint buffer, GLenum access);
+// typedef void * (APIENTRYP GPMAPNAMEDBUFFEREXT)(GLuint buffer, GLenum access);
+// typedef void * (APIENTRYP GPMAPNAMEDBUFFERRANGE)(GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access);
+// typedef void * (APIENTRYP GPMAPNAMEDBUFFERRANGEEXT)(GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access);
+// typedef void (APIENTRYP GPMATRIXFRUSTUMEXT)(GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
+// typedef void (APIENTRYP GPMATRIXLOAD3X2FNV)(GLenum matrixMode, const GLfloat * m);
+// typedef void (APIENTRYP GPMATRIXLOAD3X3FNV)(GLenum matrixMode, const GLfloat * m);
+// typedef void (APIENTRYP GPMATRIXLOADIDENTITYEXT)(GLenum mode);
+// typedef void (APIENTRYP GPMATRIXLOADTRANSPOSE3X3FNV)(GLenum matrixMode, const GLfloat * m);
+// typedef void (APIENTRYP GPMATRIXLOADTRANSPOSEDEXT)(GLenum mode, const GLdouble * m);
+// typedef void (APIENTRYP GPMATRIXLOADTRANSPOSEFEXT)(GLenum mode, const GLfloat * m);
+// typedef void (APIENTRYP GPMATRIXLOADDEXT)(GLenum mode, const GLdouble * m);
+// typedef void (APIENTRYP GPMATRIXLOADFEXT)(GLenum mode, const GLfloat * m);
+// typedef void (APIENTRYP GPMATRIXMULT3X2FNV)(GLenum matrixMode, const GLfloat * m);
+// typedef void (APIENTRYP GPMATRIXMULT3X3FNV)(GLenum matrixMode, const GLfloat * m);
+// typedef void (APIENTRYP GPMATRIXMULTTRANSPOSE3X3FNV)(GLenum matrixMode, const GLfloat * m);
+// typedef void (APIENTRYP GPMATRIXMULTTRANSPOSEDEXT)(GLenum mode, const GLdouble * m);
+// typedef void (APIENTRYP GPMATRIXMULTTRANSPOSEFEXT)(GLenum mode, const GLfloat * m);
+// typedef void (APIENTRYP GPMATRIXMULTDEXT)(GLenum mode, const GLdouble * m);
+// typedef void (APIENTRYP GPMATRIXMULTFEXT)(GLenum mode, const GLfloat * m);
+// typedef void (APIENTRYP GPMATRIXORTHOEXT)(GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
+// typedef void (APIENTRYP GPMATRIXPOPEXT)(GLenum mode);
+// typedef void (APIENTRYP GPMATRIXPUSHEXT)(GLenum mode);
+// typedef void (APIENTRYP GPMATRIXROTATEDEXT)(GLenum mode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z);
+// typedef void (APIENTRYP GPMATRIXROTATEFEXT)(GLenum mode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
+// typedef void (APIENTRYP GPMATRIXSCALEDEXT)(GLenum mode, GLdouble x, GLdouble y, GLdouble z);
+// typedef void (APIENTRYP GPMATRIXSCALEFEXT)(GLenum mode, GLfloat x, GLfloat y, GLfloat z);
+// typedef void (APIENTRYP GPMATRIXTRANSLATEDEXT)(GLenum mode, GLdouble x, GLdouble y, GLdouble z);
+// typedef void (APIENTRYP GPMATRIXTRANSLATEFEXT)(GLenum mode, GLfloat x, GLfloat y, GLfloat z);
+// typedef void (APIENTRYP GPMAXSHADERCOMPILERTHREADSARB)(GLuint count);
+// typedef void (APIENTRYP GPMAXSHADERCOMPILERTHREADSKHR)(GLuint count);
+// typedef void (APIENTRYP GPMEMORYBARRIER)(GLbitfield barriers);
+// typedef void (APIENTRYP GPMEMORYBARRIERBYREGION)(GLbitfield barriers);
+// typedef void (APIENTRYP GPMINSAMPLESHADINGARB)(GLfloat value);
+// typedef void (APIENTRYP GPMULTIDRAWARRAYS)(GLenum mode, const GLint * first, const GLsizei * count, GLsizei drawcount);
+// typedef void (APIENTRYP GPMULTIDRAWARRAYSINDIRECT)(GLenum mode, const void * indirect, GLsizei drawcount, GLsizei stride);
+// typedef void (APIENTRYP GPMULTIDRAWARRAYSINDIRECTBINDLESSCOUNTNV)(GLenum mode, const void * indirect, GLsizei drawCount, GLsizei maxDrawCount, GLsizei stride, GLint vertexBufferCount);
+// typedef void (APIENTRYP GPMULTIDRAWARRAYSINDIRECTBINDLESSNV)(GLenum mode, const void * indirect, GLsizei drawCount, GLsizei stride, GLint vertexBufferCount);
+// typedef void (APIENTRYP GPMULTIDRAWARRAYSINDIRECTCOUNTARB)(GLenum mode, const void * indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride);
+// typedef void (APIENTRYP GPMULTIDRAWELEMENTS)(GLenum mode, const GLsizei * count, GLenum type, const void *const* indices, GLsizei drawcount);
+// typedef void (APIENTRYP GPMULTIDRAWELEMENTSBASEVERTEX)(GLenum mode, const GLsizei * count, GLenum type, const void *const* indices, GLsizei drawcount, const GLint * basevertex);
+// typedef void (APIENTRYP GPMULTIDRAWELEMENTSINDIRECT)(GLenum mode, GLenum type, const void * indirect, GLsizei drawcount, GLsizei stride);
+// typedef void (APIENTRYP GPMULTIDRAWELEMENTSINDIRECTBINDLESSCOUNTNV)(GLenum mode, GLenum type, const void * indirect, GLsizei drawCount, GLsizei maxDrawCount, GLsizei stride, GLint vertexBufferCount);
+// typedef void (APIENTRYP GPMULTIDRAWELEMENTSINDIRECTBINDLESSNV)(GLenum mode, GLenum type, const void * indirect, GLsizei drawCount, GLsizei stride, GLint vertexBufferCount);
+// typedef void (APIENTRYP GPMULTIDRAWELEMENTSINDIRECTCOUNTARB)(GLenum mode, GLenum type, const void * indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride);
+// typedef void (APIENTRYP GPMULTIDRAWMESHTASKSINDIRECTCOUNTNV)(GLintptr indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride);
+// typedef void (APIENTRYP GPMULTIDRAWMESHTASKSINDIRECTNV)(GLintptr indirect, GLsizei drawcount, GLsizei stride);
+// typedef void (APIENTRYP GPMULTITEXBUFFEREXT)(GLenum texunit, GLenum target, GLenum internalformat, GLuint buffer);
+// typedef void (APIENTRYP GPMULTITEXCOORDPOINTEREXT)(GLenum texunit, GLint size, GLenum type, GLsizei stride, const void * pointer);
+// typedef void (APIENTRYP GPMULTITEXENVFEXT)(GLenum texunit, GLenum target, GLenum pname, GLfloat param);
+// typedef void (APIENTRYP GPMULTITEXENVFVEXT)(GLenum texunit, GLenum target, GLenum pname, const GLfloat * params);
+// typedef void (APIENTRYP GPMULTITEXENVIEXT)(GLenum texunit, GLenum target, GLenum pname, GLint param);
+// typedef void (APIENTRYP GPMULTITEXENVIVEXT)(GLenum texunit, GLenum target, GLenum pname, const GLint * params);
+// typedef void (APIENTRYP GPMULTITEXGENDEXT)(GLenum texunit, GLenum coord, GLenum pname, GLdouble param);
+// typedef void (APIENTRYP GPMULTITEXGENDVEXT)(GLenum texunit, GLenum coord, GLenum pname, const GLdouble * params);
+// typedef void (APIENTRYP GPMULTITEXGENFEXT)(GLenum texunit, GLenum coord, GLenum pname, GLfloat param);
+// typedef void (APIENTRYP GPMULTITEXGENFVEXT)(GLenum texunit, GLenum coord, GLenum pname, const GLfloat * params);
+// typedef void (APIENTRYP GPMULTITEXGENIEXT)(GLenum texunit, GLenum coord, GLenum pname, GLint param);
+// typedef void (APIENTRYP GPMULTITEXGENIVEXT)(GLenum texunit, GLenum coord, GLenum pname, const GLint * params);
+// typedef void (APIENTRYP GPMULTITEXIMAGE1DEXT)(GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void * pixels);
+// typedef void (APIENTRYP GPMULTITEXIMAGE2DEXT)(GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void * pixels);
+// typedef void (APIENTRYP GPMULTITEXIMAGE3DEXT)(GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void * pixels);
+// typedef void (APIENTRYP GPMULTITEXPARAMETERIIVEXT)(GLenum texunit, GLenum target, GLenum pname, const GLint * params);
+// typedef void (APIENTRYP GPMULTITEXPARAMETERIUIVEXT)(GLenum texunit, GLenum target, GLenum pname, const GLuint * params);
+// typedef void (APIENTRYP GPMULTITEXPARAMETERFEXT)(GLenum texunit, GLenum target, GLenum pname, GLfloat param);
+// typedef void (APIENTRYP GPMULTITEXPARAMETERFVEXT)(GLenum texunit, GLenum target, GLenum pname, const GLfloat * params);
+// typedef void (APIENTRYP GPMULTITEXPARAMETERIEXT)(GLenum texunit, GLenum target, GLenum pname, GLint param);
+// typedef void (APIENTRYP GPMULTITEXPARAMETERIVEXT)(GLenum texunit, GLenum target, GLenum pname, const GLint * params);
+// typedef void (APIENTRYP GPMULTITEXRENDERBUFFEREXT)(GLenum texunit, GLenum target, GLuint renderbuffer);
+// typedef void (APIENTRYP GPMULTITEXSUBIMAGE1DEXT)(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void * pixels);
+// typedef void (APIENTRYP GPMULTITEXSUBIMAGE2DEXT)(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void * pixels);
+// typedef void (APIENTRYP GPMULTITEXSUBIMAGE3DEXT)(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void * pixels);
+// typedef void (APIENTRYP GPNAMEDBUFFERATTACHMEMORYNV)(GLuint buffer, GLuint memory, GLuint64 offset);
+// typedef void (APIENTRYP GPNAMEDBUFFERDATA)(GLuint buffer, GLsizeiptr size, const void * data, GLenum usage);
+// typedef void (APIENTRYP GPNAMEDBUFFERDATAEXT)(GLuint buffer, GLsizeiptr size, const void * data, GLenum usage);
+// typedef void (APIENTRYP GPNAMEDBUFFERPAGECOMMITMENTARB)(GLuint buffer, GLintptr offset, GLsizeiptr size, GLboolean commit);
+// typedef void (APIENTRYP GPNAMEDBUFFERPAGECOMMITMENTEXT)(GLuint buffer, GLintptr offset, GLsizeiptr size, GLboolean commit);
+// typedef void (APIENTRYP GPNAMEDBUFFERPAGECOMMITMENTMEMNV)(GLuint buffer, GLintptr offset, GLsizeiptr size, GLuint memory, GLuint64 memOffset, GLboolean commit);
+// typedef void (APIENTRYP GPNAMEDBUFFERSTORAGE)(GLuint buffer, GLsizeiptr size, const void * data, GLbitfield flags);
+// typedef void (APIENTRYP GPNAMEDBUFFERSTORAGEEXT)(GLuint buffer, GLsizeiptr size, const void * data, GLbitfield flags);
+// typedef void (APIENTRYP GPNAMEDBUFFERSUBDATA)(GLuint buffer, GLintptr offset, GLsizeiptr size, const void * data);
+// typedef void (APIENTRYP GPNAMEDBUFFERSUBDATAEXT)(GLuint buffer, GLintptr offset, GLsizeiptr size, const void * data);
+// typedef void (APIENTRYP GPNAMEDCOPYBUFFERSUBDATAEXT)(GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
+// typedef void (APIENTRYP GPNAMEDFRAMEBUFFERDRAWBUFFER)(GLuint framebuffer, GLenum buf);
+// typedef void (APIENTRYP GPNAMEDFRAMEBUFFERDRAWBUFFERS)(GLuint framebuffer, GLsizei n, const GLenum * bufs);
+// typedef void (APIENTRYP GPNAMEDFRAMEBUFFERPARAMETERI)(GLuint framebuffer, GLenum pname, GLint param);
+// typedef void (APIENTRYP GPNAMEDFRAMEBUFFERPARAMETERIEXT)(GLuint framebuffer, GLenum pname, GLint param);
+// typedef void (APIENTRYP GPNAMEDFRAMEBUFFERREADBUFFER)(GLuint framebuffer, GLenum src);
+// typedef void (APIENTRYP GPNAMEDFRAMEBUFFERRENDERBUFFER)(GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+// typedef void (APIENTRYP GPNAMEDFRAMEBUFFERRENDERBUFFEREXT)(GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+// typedef void (APIENTRYP GPNAMEDFRAMEBUFFERSAMPLELOCATIONSFVARB)(GLuint framebuffer, GLuint start, GLsizei count, const GLfloat * v);
+// typedef void (APIENTRYP GPNAMEDFRAMEBUFFERSAMPLELOCATIONSFVNV)(GLuint framebuffer, GLuint start, GLsizei count, const GLfloat * v);
+// typedef void (APIENTRYP GPNAMEDFRAMEBUFFERTEXTURE)(GLuint framebuffer, GLenum attachment, GLuint texture, GLint level);
+// typedef void (APIENTRYP GPNAMEDFRAMEBUFFERTEXTURE1DEXT)(GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+// typedef void (APIENTRYP GPNAMEDFRAMEBUFFERTEXTURE2DEXT)(GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+// typedef void (APIENTRYP GPNAMEDFRAMEBUFFERTEXTURE3DEXT)(GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
+// typedef void (APIENTRYP GPNAMEDFRAMEBUFFERTEXTUREEXT)(GLuint framebuffer, GLenum attachment, GLuint texture, GLint level);
+// typedef void (APIENTRYP GPNAMEDFRAMEBUFFERTEXTUREFACEEXT)(GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLenum face);
+// typedef void (APIENTRYP GPNAMEDFRAMEBUFFERTEXTURELAYER)(GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer);
+// typedef void (APIENTRYP GPNAMEDFRAMEBUFFERTEXTURELAYEREXT)(GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer);
+// typedef void (APIENTRYP GPNAMEDPROGRAMLOCALPARAMETER4DEXT)(GLuint program, GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+// typedef void (APIENTRYP GPNAMEDPROGRAMLOCALPARAMETER4DVEXT)(GLuint program, GLenum target, GLuint index, const GLdouble * params);
+// typedef void (APIENTRYP GPNAMEDPROGRAMLOCALPARAMETER4FEXT)(GLuint program, GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+// typedef void (APIENTRYP GPNAMEDPROGRAMLOCALPARAMETER4FVEXT)(GLuint program, GLenum target, GLuint index, const GLfloat * params);
+// typedef void (APIENTRYP GPNAMEDPROGRAMLOCALPARAMETERI4IEXT)(GLuint program, GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w);
+// typedef void (APIENTRYP GPNAMEDPROGRAMLOCALPARAMETERI4IVEXT)(GLuint program, GLenum target, GLuint index, const GLint * params);
+// typedef void (APIENTRYP GPNAMEDPROGRAMLOCALPARAMETERI4UIEXT)(GLuint program, GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
+// typedef void (APIENTRYP GPNAMEDPROGRAMLOCALPARAMETERI4UIVEXT)(GLuint program, GLenum target, GLuint index, const GLuint * params);
+// typedef void (APIENTRYP GPNAMEDPROGRAMLOCALPARAMETERS4FVEXT)(GLuint program, GLenum target, GLuint index, GLsizei count, const GLfloat * params);
+// typedef void (APIENTRYP GPNAMEDPROGRAMLOCALPARAMETERSI4IVEXT)(GLuint program, GLenum target, GLuint index, GLsizei count, const GLint * params);
+// typedef void (APIENTRYP GPNAMEDPROGRAMLOCALPARAMETERSI4UIVEXT)(GLuint program, GLenum target, GLuint index, GLsizei count, const GLuint * params);
+// typedef void (APIENTRYP GPNAMEDPROGRAMSTRINGEXT)(GLuint program, GLenum target, GLenum format, GLsizei len, const void * string);
+// typedef void (APIENTRYP GPNAMEDRENDERBUFFERSTORAGE)(GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height);
+// typedef void (APIENTRYP GPNAMEDRENDERBUFFERSTORAGEEXT)(GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height);
+// typedef void (APIENTRYP GPNAMEDRENDERBUFFERSTORAGEMULTISAMPLE)(GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+// typedef void (APIENTRYP GPNAMEDRENDERBUFFERSTORAGEMULTISAMPLEADVANCEDAMD)(GLuint renderbuffer, GLsizei samples, GLsizei storageSamples, GLenum internalformat, GLsizei width, GLsizei height);
+// typedef void (APIENTRYP GPNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXT)(GLuint renderbuffer, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height);
+// typedef void (APIENTRYP GPNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXT)(GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+// typedef void (APIENTRYP GPNAMEDSTRINGARB)(GLenum type, GLint namelen, const GLchar * name, GLint stringlen, const GLchar * string);
+// typedef void (APIENTRYP GPNORMALFORMATNV)(GLenum type, GLsizei stride);
+// typedef void (APIENTRYP GPOBJECTLABEL)(GLenum identifier, GLuint name, GLsizei length, const GLchar * label);
+// typedef void (APIENTRYP GPOBJECTLABELKHR)(GLenum identifier, GLuint name, GLsizei length, const GLchar * label);
+// typedef void (APIENTRYP GPOBJECTPTRLABEL)(const void * ptr, GLsizei length, const GLchar * label);
+// typedef void (APIENTRYP GPOBJECTPTRLABELKHR)(const void * ptr, GLsizei length, const GLchar * label);
+// typedef void (APIENTRYP GPPATCHPARAMETERFV)(GLenum pname, const GLfloat * values);
+// typedef void (APIENTRYP GPPATCHPARAMETERI)(GLenum pname, GLint value);
+// typedef void (APIENTRYP GPPATHCOMMANDSNV)(GLuint path, GLsizei numCommands, const GLubyte * commands, GLsizei numCoords, GLenum coordType, const void * coords);
+// typedef void (APIENTRYP GPPATHCOORDSNV)(GLuint path, GLsizei numCoords, GLenum coordType, const void * coords);
+// typedef void (APIENTRYP GPPATHCOVERDEPTHFUNCNV)(GLenum func);
+// typedef void (APIENTRYP GPPATHDASHARRAYNV)(GLuint path, GLsizei dashCount, const GLfloat * dashArray);
+// typedef GLenum (APIENTRYP GPPATHGLYPHINDEXARRAYNV)(GLuint firstPathName, GLenum fontTarget, const void * fontName, GLbitfield fontStyle, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale);
+// typedef GLenum (APIENTRYP GPPATHGLYPHINDEXRANGENV)(GLenum fontTarget, const void * fontName, GLbitfield fontStyle, GLuint pathParameterTemplate, GLfloat emScale, GLuint * baseAndCount);
+// typedef void (APIENTRYP GPPATHGLYPHRANGENV)(GLuint firstPathName, GLenum fontTarget, const void * fontName, GLbitfield fontStyle, GLuint firstGlyph, GLsizei numGlyphs, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale);
+// typedef void (APIENTRYP GPPATHGLYPHSNV)(GLuint firstPathName, GLenum fontTarget, const void * fontName, GLbitfield fontStyle, GLsizei numGlyphs, GLenum type, const void * charcodes, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale);
+// typedef GLenum (APIENTRYP GPPATHMEMORYGLYPHINDEXARRAYNV)(GLuint firstPathName, GLenum fontTarget, GLsizeiptr fontSize, const void * fontData, GLsizei faceIndex, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale);
+// typedef void (APIENTRYP GPPATHPARAMETERFNV)(GLuint path, GLenum pname, GLfloat value);
+// typedef void (APIENTRYP GPPATHPARAMETERFVNV)(GLuint path, GLenum pname, const GLfloat * value);
+// typedef void (APIENTRYP GPPATHPARAMETERINV)(GLuint path, GLenum pname, GLint value);
+// typedef void (APIENTRYP GPPATHPARAMETERIVNV)(GLuint path, GLenum pname, const GLint * value);
+// typedef void (APIENTRYP GPPATHSTENCILDEPTHOFFSETNV)(GLfloat factor, GLfloat units);
+// typedef void (APIENTRYP GPPATHSTENCILFUNCNV)(GLenum func, GLint ref, GLuint mask);
+// typedef void (APIENTRYP GPPATHSTRINGNV)(GLuint path, GLenum format, GLsizei length, const void * pathString);
+// typedef void (APIENTRYP GPPATHSUBCOMMANDSNV)(GLuint path, GLsizei commandStart, GLsizei commandsToDelete, GLsizei numCommands, const GLubyte * commands, GLsizei numCoords, GLenum coordType, const void * coords);
+// typedef void (APIENTRYP GPPATHSUBCOORDSNV)(GLuint path, GLsizei coordStart, GLsizei numCoords, GLenum coordType, const void * coords);
+// typedef void (APIENTRYP GPPAUSETRANSFORMFEEDBACK)();
+// typedef void (APIENTRYP GPPIXELSTOREF)(GLenum pname, GLfloat param);
+// typedef void (APIENTRYP GPPIXELSTOREI)(GLenum pname, GLint param);
+// typedef GLboolean (APIENTRYP GPPOINTALONGPATHNV)(GLuint path, GLsizei startSegment, GLsizei numSegments, GLfloat distance, GLfloat * x, GLfloat * y, GLfloat * tangentX, GLfloat * tangentY);
+// typedef void (APIENTRYP GPPOINTPARAMETERF)(GLenum pname, GLfloat param);
+// typedef void (APIENTRYP GPPOINTPARAMETERFV)(GLenum pname, const GLfloat * params);
+// typedef void (APIENTRYP GPPOINTPARAMETERI)(GLenum pname, GLint param);
+// typedef void (APIENTRYP GPPOINTPARAMETERIV)(GLenum pname, const GLint * params);
+// typedef void (APIENTRYP GPPOINTSIZE)(GLfloat size);
+// typedef void (APIENTRYP GPPOLYGONMODE)(GLenum face, GLenum mode);
+// typedef void (APIENTRYP GPPOLYGONOFFSET)(GLfloat factor, GLfloat units);
+// typedef void (APIENTRYP GPPOLYGONOFFSETCLAMP)(GLfloat factor, GLfloat units, GLfloat clamp);
+// typedef void (APIENTRYP GPPOLYGONOFFSETCLAMPEXT)(GLfloat factor, GLfloat units, GLfloat clamp);
+// typedef void (APIENTRYP GPPOPDEBUGGROUP)();
+// typedef void (APIENTRYP GPPOPDEBUGGROUPKHR)();
+// typedef void (APIENTRYP GPPOPGROUPMARKEREXT)();
+// typedef void (APIENTRYP GPPRIMITIVEBOUNDINGBOXARB)(GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW);
+// typedef void (APIENTRYP GPPRIMITIVERESTARTINDEX)(GLuint index);
+// typedef void (APIENTRYP GPPROGRAMBINARY)(GLuint program, GLenum binaryFormat, const void * binary, GLsizei length);
+// typedef void (APIENTRYP GPPROGRAMPARAMETERI)(GLuint program, GLenum pname, GLint value);
+// typedef void (APIENTRYP GPPROGRAMPARAMETERIARB)(GLuint program, GLenum pname, GLint value);
+// typedef void (APIENTRYP GPPROGRAMPARAMETERIEXT)(GLuint program, GLenum pname, GLint value);
+// typedef void (APIENTRYP GPPROGRAMPATHFRAGMENTINPUTGENNV)(GLuint program, GLint location, GLenum genMode, GLint components, const GLfloat * coeffs);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM1D)(GLuint program, GLint location, GLdouble v0);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM1DEXT)(GLuint program, GLint location, GLdouble x);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM1DV)(GLuint program, GLint location, GLsizei count, const GLdouble * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM1DVEXT)(GLuint program, GLint location, GLsizei count, const GLdouble * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM1F)(GLuint program, GLint location, GLfloat v0);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM1FEXT)(GLuint program, GLint location, GLfloat v0);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM1FV)(GLuint program, GLint location, GLsizei count, const GLfloat * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM1FVEXT)(GLuint program, GLint location, GLsizei count, const GLfloat * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM1I)(GLuint program, GLint location, GLint v0);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM1I64ARB)(GLuint program, GLint location, GLint64 x);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM1I64NV)(GLuint program, GLint location, GLint64EXT x);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM1I64VARB)(GLuint program, GLint location, GLsizei count, const GLint64 * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM1I64VNV)(GLuint program, GLint location, GLsizei count, const GLint64EXT * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM1IEXT)(GLuint program, GLint location, GLint v0);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM1IV)(GLuint program, GLint location, GLsizei count, const GLint * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM1IVEXT)(GLuint program, GLint location, GLsizei count, const GLint * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM1UI)(GLuint program, GLint location, GLuint v0);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM1UI64ARB)(GLuint program, GLint location, GLuint64 x);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM1UI64NV)(GLuint program, GLint location, GLuint64EXT x);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM1UI64VARB)(GLuint program, GLint location, GLsizei count, const GLuint64 * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM1UI64VNV)(GLuint program, GLint location, GLsizei count, const GLuint64EXT * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM1UIEXT)(GLuint program, GLint location, GLuint v0);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM1UIV)(GLuint program, GLint location, GLsizei count, const GLuint * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM1UIVEXT)(GLuint program, GLint location, GLsizei count, const GLuint * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM2D)(GLuint program, GLint location, GLdouble v0, GLdouble v1);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM2DEXT)(GLuint program, GLint location, GLdouble x, GLdouble y);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM2DV)(GLuint program, GLint location, GLsizei count, const GLdouble * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM2DVEXT)(GLuint program, GLint location, GLsizei count, const GLdouble * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM2F)(GLuint program, GLint location, GLfloat v0, GLfloat v1);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM2FEXT)(GLuint program, GLint location, GLfloat v0, GLfloat v1);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM2FV)(GLuint program, GLint location, GLsizei count, const GLfloat * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM2FVEXT)(GLuint program, GLint location, GLsizei count, const GLfloat * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM2I)(GLuint program, GLint location, GLint v0, GLint v1);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM2I64ARB)(GLuint program, GLint location, GLint64 x, GLint64 y);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM2I64NV)(GLuint program, GLint location, GLint64EXT x, GLint64EXT y);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM2I64VARB)(GLuint program, GLint location, GLsizei count, const GLint64 * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM2I64VNV)(GLuint program, GLint location, GLsizei count, const GLint64EXT * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM2IEXT)(GLuint program, GLint location, GLint v0, GLint v1);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM2IV)(GLuint program, GLint location, GLsizei count, const GLint * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM2IVEXT)(GLuint program, GLint location, GLsizei count, const GLint * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM2UI)(GLuint program, GLint location, GLuint v0, GLuint v1);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM2UI64ARB)(GLuint program, GLint location, GLuint64 x, GLuint64 y);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM2UI64NV)(GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM2UI64VARB)(GLuint program, GLint location, GLsizei count, const GLuint64 * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM2UI64VNV)(GLuint program, GLint location, GLsizei count, const GLuint64EXT * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM2UIEXT)(GLuint program, GLint location, GLuint v0, GLuint v1);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM2UIV)(GLuint program, GLint location, GLsizei count, const GLuint * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM2UIVEXT)(GLuint program, GLint location, GLsizei count, const GLuint * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM3D)(GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM3DEXT)(GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM3DV)(GLuint program, GLint location, GLsizei count, const GLdouble * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM3DVEXT)(GLuint program, GLint location, GLsizei count, const GLdouble * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM3F)(GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM3FEXT)(GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM3FV)(GLuint program, GLint location, GLsizei count, const GLfloat * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM3FVEXT)(GLuint program, GLint location, GLsizei count, const GLfloat * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM3I)(GLuint program, GLint location, GLint v0, GLint v1, GLint v2);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM3I64ARB)(GLuint program, GLint location, GLint64 x, GLint64 y, GLint64 z);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM3I64NV)(GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM3I64VARB)(GLuint program, GLint location, GLsizei count, const GLint64 * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM3I64VNV)(GLuint program, GLint location, GLsizei count, const GLint64EXT * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM3IEXT)(GLuint program, GLint location, GLint v0, GLint v1, GLint v2);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM3IV)(GLuint program, GLint location, GLsizei count, const GLint * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM3IVEXT)(GLuint program, GLint location, GLsizei count, const GLint * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM3UI)(GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM3UI64ARB)(GLuint program, GLint location, GLuint64 x, GLuint64 y, GLuint64 z);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM3UI64NV)(GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM3UI64VARB)(GLuint program, GLint location, GLsizei count, const GLuint64 * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM3UI64VNV)(GLuint program, GLint location, GLsizei count, const GLuint64EXT * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM3UIEXT)(GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM3UIV)(GLuint program, GLint location, GLsizei count, const GLuint * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM3UIVEXT)(GLuint program, GLint location, GLsizei count, const GLuint * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM4D)(GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2, GLdouble v3);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM4DEXT)(GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM4DV)(GLuint program, GLint location, GLsizei count, const GLdouble * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM4DVEXT)(GLuint program, GLint location, GLsizei count, const GLdouble * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM4F)(GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM4FEXT)(GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM4FV)(GLuint program, GLint location, GLsizei count, const GLfloat * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM4FVEXT)(GLuint program, GLint location, GLsizei count, const GLfloat * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM4I)(GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM4I64ARB)(GLuint program, GLint location, GLint64 x, GLint64 y, GLint64 z, GLint64 w);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM4I64NV)(GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM4I64VARB)(GLuint program, GLint location, GLsizei count, const GLint64 * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM4I64VNV)(GLuint program, GLint location, GLsizei count, const GLint64EXT * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM4IEXT)(GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM4IV)(GLuint program, GLint location, GLsizei count, const GLint * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM4IVEXT)(GLuint program, GLint location, GLsizei count, const GLint * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM4UI)(GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM4UI64ARB)(GLuint program, GLint location, GLuint64 x, GLuint64 y, GLuint64 z, GLuint64 w);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM4UI64NV)(GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM4UI64VARB)(GLuint program, GLint location, GLsizei count, const GLuint64 * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM4UI64VNV)(GLuint program, GLint location, GLsizei count, const GLuint64EXT * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM4UIEXT)(GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM4UIV)(GLuint program, GLint location, GLsizei count, const GLuint * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORM4UIVEXT)(GLuint program, GLint location, GLsizei count, const GLuint * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORMHANDLEUI64ARB)(GLuint program, GLint location, GLuint64 value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORMHANDLEUI64NV)(GLuint program, GLint location, GLuint64 value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORMHANDLEUI64VARB)(GLuint program, GLint location, GLsizei count, const GLuint64 * values);
+// typedef void (APIENTRYP GPPROGRAMUNIFORMHANDLEUI64VNV)(GLuint program, GLint location, GLsizei count, const GLuint64 * values);
+// typedef void (APIENTRYP GPPROGRAMUNIFORMMATRIX2DV)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORMMATRIX2DVEXT)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORMMATRIX2FV)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORMMATRIX2FVEXT)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORMMATRIX2X3DV)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORMMATRIX2X3DVEXT)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORMMATRIX2X3FV)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORMMATRIX2X3FVEXT)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORMMATRIX2X4DV)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORMMATRIX2X4DVEXT)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORMMATRIX2X4FV)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORMMATRIX2X4FVEXT)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORMMATRIX3DV)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORMMATRIX3DVEXT)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORMMATRIX3FV)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORMMATRIX3FVEXT)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORMMATRIX3X2DV)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORMMATRIX3X2DVEXT)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORMMATRIX3X2FV)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORMMATRIX3X2FVEXT)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORMMATRIX3X4DV)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORMMATRIX3X4DVEXT)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORMMATRIX3X4FV)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORMMATRIX3X4FVEXT)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORMMATRIX4DV)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORMMATRIX4DVEXT)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORMMATRIX4FV)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORMMATRIX4FVEXT)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORMMATRIX4X2DV)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORMMATRIX4X2DVEXT)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORMMATRIX4X2FV)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORMMATRIX4X2FVEXT)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORMMATRIX4X3DV)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORMMATRIX4X3DVEXT)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORMMATRIX4X3FV)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORMMATRIX4X3FVEXT)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORMUI64NV)(GLuint program, GLint location, GLuint64EXT value);
+// typedef void (APIENTRYP GPPROGRAMUNIFORMUI64VNV)(GLuint program, GLint location, GLsizei count, const GLuint64EXT * value);
+// typedef void (APIENTRYP GPPROVOKINGVERTEX)(GLenum mode);
+// typedef void (APIENTRYP GPPUSHCLIENTATTRIBDEFAULTEXT)(GLbitfield mask);
+// typedef void (APIENTRYP GPPUSHDEBUGGROUP)(GLenum source, GLuint id, GLsizei length, const GLchar * message);
+// typedef void (APIENTRYP GPPUSHDEBUGGROUPKHR)(GLenum source, GLuint id, GLsizei length, const GLchar * message);
+// typedef void (APIENTRYP GPPUSHGROUPMARKEREXT)(GLsizei length, const GLchar * marker);
+// typedef void (APIENTRYP GPQUERYCOUNTER)(GLuint id, GLenum target);
+// typedef void (APIENTRYP GPRASTERSAMPLESEXT)(GLuint samples, GLboolean fixedsamplelocations);
+// typedef void (APIENTRYP GPREADBUFFER)(GLenum src);
+// typedef void (APIENTRYP GPREADPIXELS)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void * pixels);
+// typedef void (APIENTRYP GPREADNPIXELS)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void * data);
+// typedef void (APIENTRYP GPREADNPIXELSARB)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void * data);
+// typedef void (APIENTRYP GPREADNPIXELSKHR)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void * data);
+// typedef void (APIENTRYP GPRELEASESHADERCOMPILER)();
+// typedef void (APIENTRYP GPRENDERBUFFERSTORAGE)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
+// typedef void (APIENTRYP GPRENDERBUFFERSTORAGEMULTISAMPLE)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+// typedef void (APIENTRYP GPRENDERBUFFERSTORAGEMULTISAMPLEADVANCEDAMD)(GLenum target, GLsizei samples, GLsizei storageSamples, GLenum internalformat, GLsizei width, GLsizei height);
+// typedef void (APIENTRYP GPRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENV)(GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height);
+// typedef void (APIENTRYP GPRESETMEMORYOBJECTPARAMETERNV)(GLuint memory, GLenum pname);
+// typedef void (APIENTRYP GPRESOLVEDEPTHVALUESNV)();
+// typedef void (APIENTRYP GPRESUMETRANSFORMFEEDBACK)();
+// typedef void (APIENTRYP GPSAMPLECOVERAGE)(GLfloat value, GLboolean invert);
+// typedef void (APIENTRYP GPSAMPLEMASKI)(GLuint maskNumber, GLbitfield mask);
+// typedef void (APIENTRYP GPSAMPLERPARAMETERIIV)(GLuint sampler, GLenum pname, const GLint * param);
+// typedef void (APIENTRYP GPSAMPLERPARAMETERIUIV)(GLuint sampler, GLenum pname, const GLuint * param);
+// typedef void (APIENTRYP GPSAMPLERPARAMETERF)(GLuint sampler, GLenum pname, GLfloat param);
+// typedef void (APIENTRYP GPSAMPLERPARAMETERFV)(GLuint sampler, GLenum pname, const GLfloat * param);
+// typedef void (APIENTRYP GPSAMPLERPARAMETERI)(GLuint sampler, GLenum pname, GLint param);
+// typedef void (APIENTRYP GPSAMPLERPARAMETERIV)(GLuint sampler, GLenum pname, const GLint * param);
+// typedef void (APIENTRYP GPSCISSOR)(GLint x, GLint y, GLsizei width, GLsizei height);
+// typedef void (APIENTRYP GPSCISSORARRAYV)(GLuint first, GLsizei count, const GLint * v);
+// typedef void (APIENTRYP GPSCISSOREXCLUSIVEARRAYVNV)(GLuint first, GLsizei count, const GLint * v);
+// typedef void (APIENTRYP GPSCISSOREXCLUSIVENV)(GLint x, GLint y, GLsizei width, GLsizei height);
+// typedef void (APIENTRYP GPSCISSORINDEXED)(GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height);
+// typedef void (APIENTRYP GPSCISSORINDEXEDV)(GLuint index, const GLint * v);
+// typedef void (APIENTRYP GPSECONDARYCOLORFORMATNV)(GLint size, GLenum type, GLsizei stride);
+// typedef void (APIENTRYP GPSELECTPERFMONITORCOUNTERSAMD)(GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint * counterList);
+// typedef void (APIENTRYP GPSHADERBINARY)(GLsizei count, const GLuint * shaders, GLenum binaryFormat, const void * binary, GLsizei length);
+// typedef void (APIENTRYP GPSHADERSOURCE)(GLuint shader, GLsizei count, const GLchar *const* string, const GLint * length);
+// typedef void (APIENTRYP GPSHADERSTORAGEBLOCKBINDING)(GLuint program, GLuint storageBlockIndex, GLuint storageBlockBinding);
+// typedef void (APIENTRYP GPSHADINGRATEIMAGEBARRIERNV)(GLboolean synchronize);
+// typedef void (APIENTRYP GPSHADINGRATEIMAGEPALETTENV)(GLuint viewport, GLuint first, GLsizei count, const GLenum * rates);
+// typedef void (APIENTRYP GPSHADINGRATESAMPLEORDERCUSTOMNV)(GLenum rate, GLuint samples, const GLint * locations);
+// typedef void (APIENTRYP GPSHADINGRATESAMPLEORDERNV)(GLenum order);
+// typedef void (APIENTRYP GPSIGNALVKFENCENV)(GLuint64 vkFence);
+// typedef void (APIENTRYP GPSIGNALVKSEMAPHORENV)(GLuint64 vkSemaphore);
+// typedef void (APIENTRYP GPSPECIALIZESHADERARB)(GLuint shader, const GLchar * pEntryPoint, GLuint numSpecializationConstants, const GLuint * pConstantIndex, const GLuint * pConstantValue);
+// typedef void (APIENTRYP GPSTATECAPTURENV)(GLuint state, GLenum mode);
+// typedef void (APIENTRYP GPSTENCILFILLPATHINSTANCEDNV)(GLsizei numPaths, GLenum pathNameType, const void * paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum transformType, const GLfloat * transformValues);
+// typedef void (APIENTRYP GPSTENCILFILLPATHNV)(GLuint path, GLenum fillMode, GLuint mask);
+// typedef void (APIENTRYP GPSTENCILFUNC)(GLenum func, GLint ref, GLuint mask);
+// typedef void (APIENTRYP GPSTENCILFUNCSEPARATE)(GLenum face, GLenum func, GLint ref, GLuint mask);
+// typedef void (APIENTRYP GPSTENCILMASK)(GLuint mask);
+// typedef void (APIENTRYP GPSTENCILMASKSEPARATE)(GLenum face, GLuint mask);
+// typedef void (APIENTRYP GPSTENCILOP)(GLenum fail, GLenum zfail, GLenum zpass);
+// typedef void (APIENTRYP GPSTENCILOPSEPARATE)(GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
+// typedef void (APIENTRYP GPSTENCILSTROKEPATHINSTANCEDNV)(GLsizei numPaths, GLenum pathNameType, const void * paths, GLuint pathBase, GLint reference, GLuint mask, GLenum transformType, const GLfloat * transformValues);
+// typedef void (APIENTRYP GPSTENCILSTROKEPATHNV)(GLuint path, GLint reference, GLuint mask);
+// typedef void (APIENTRYP GPSTENCILTHENCOVERFILLPATHINSTANCEDNV)(GLsizei numPaths, GLenum pathNameType, const void * paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat * transformValues);
+// typedef void (APIENTRYP GPSTENCILTHENCOVERFILLPATHNV)(GLuint path, GLenum fillMode, GLuint mask, GLenum coverMode);
+// typedef void (APIENTRYP GPSTENCILTHENCOVERSTROKEPATHINSTANCEDNV)(GLsizei numPaths, GLenum pathNameType, const void * paths, GLuint pathBase, GLint reference, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat * transformValues);
+// typedef void (APIENTRYP GPSTENCILTHENCOVERSTROKEPATHNV)(GLuint path, GLint reference, GLuint mask, GLenum coverMode);
+// typedef void (APIENTRYP GPSUBPIXELPRECISIONBIASNV)(GLuint xbits, GLuint ybits);
+// typedef void (APIENTRYP GPTEXATTACHMEMORYNV)(GLenum target, GLuint memory, GLuint64 offset);
+// typedef void (APIENTRYP GPTEXBUFFER)(GLenum target, GLenum internalformat, GLuint buffer);
+// typedef void (APIENTRYP GPTEXBUFFERARB)(GLenum target, GLenum internalformat, GLuint buffer);
+// typedef void (APIENTRYP GPTEXBUFFERRANGE)(GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size);
+// typedef void (APIENTRYP GPTEXCOORDFORMATNV)(GLint size, GLenum type, GLsizei stride);
+// typedef void (APIENTRYP GPTEXIMAGE1D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void * pixels);
+// typedef void (APIENTRYP GPTEXIMAGE2D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void * pixels);
+// typedef void (APIENTRYP GPTEXIMAGE2DMULTISAMPLE)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
+// typedef void (APIENTRYP GPTEXIMAGE3D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void * pixels);
+// typedef void (APIENTRYP GPTEXIMAGE3DMULTISAMPLE)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);
+// typedef void (APIENTRYP GPTEXPAGECOMMITMENTARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean commit);
+// typedef void (APIENTRYP GPTEXPAGECOMMITMENTMEMNV)(GLenum target, GLint layer, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset, GLboolean commit);
+// typedef void (APIENTRYP GPTEXPARAMETERIIV)(GLenum target, GLenum pname, const GLint * params);
+// typedef void (APIENTRYP GPTEXPARAMETERIUIV)(GLenum target, GLenum pname, const GLuint * params);
+// typedef void (APIENTRYP GPTEXPARAMETERF)(GLenum target, GLenum pname, GLfloat param);
+// typedef void (APIENTRYP GPTEXPARAMETERFV)(GLenum target, GLenum pname, const GLfloat * params);
+// typedef void (APIENTRYP GPTEXPARAMETERI)(GLenum target, GLenum pname, GLint param);
+// typedef void (APIENTRYP GPTEXPARAMETERIV)(GLenum target, GLenum pname, const GLint * params);
+// typedef void (APIENTRYP GPTEXSTORAGE1D)(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
+// typedef void (APIENTRYP GPTEXSTORAGE2D)(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
+// typedef void (APIENTRYP GPTEXSTORAGE2DMULTISAMPLE)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
+// typedef void (APIENTRYP GPTEXSTORAGE3D)(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
+// typedef void (APIENTRYP GPTEXSTORAGE3DMULTISAMPLE)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);
+// typedef void (APIENTRYP GPTEXSUBIMAGE1D)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void * pixels);
+// typedef void (APIENTRYP GPTEXSUBIMAGE2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void * pixels);
+// typedef void (APIENTRYP GPTEXSUBIMAGE3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void * pixels);
+// typedef void (APIENTRYP GPTEXTUREATTACHMEMORYNV)(GLuint texture, GLuint memory, GLuint64 offset);
+// typedef void (APIENTRYP GPTEXTUREBARRIER)();
+// typedef void (APIENTRYP GPTEXTUREBARRIERNV)();
+// typedef void (APIENTRYP GPTEXTUREBUFFER)(GLuint texture, GLenum internalformat, GLuint buffer);
+// typedef void (APIENTRYP GPTEXTUREBUFFEREXT)(GLuint texture, GLenum target, GLenum internalformat, GLuint buffer);
+// typedef void (APIENTRYP GPTEXTUREBUFFERRANGE)(GLuint texture, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size);
+// typedef void (APIENTRYP GPTEXTUREBUFFERRANGEEXT)(GLuint texture, GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size);
+// typedef void (APIENTRYP GPTEXTUREIMAGE1DEXT)(GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void * pixels);
+// typedef void (APIENTRYP GPTEXTUREIMAGE2DEXT)(GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void * pixels);
+// typedef void (APIENTRYP GPTEXTUREIMAGE3DEXT)(GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void * pixels);
+// typedef void (APIENTRYP GPTEXTUREPAGECOMMITMENTEXT)(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean commit);
+// typedef void (APIENTRYP GPTEXTUREPAGECOMMITMENTMEMNV)(GLuint texture, GLint layer, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset, GLboolean commit);
+// typedef void (APIENTRYP GPTEXTUREPARAMETERIIV)(GLuint texture, GLenum pname, const GLint * params);
+// typedef void (APIENTRYP GPTEXTUREPARAMETERIIVEXT)(GLuint texture, GLenum target, GLenum pname, const GLint * params);
+// typedef void (APIENTRYP GPTEXTUREPARAMETERIUIV)(GLuint texture, GLenum pname, const GLuint * params);
+// typedef void (APIENTRYP GPTEXTUREPARAMETERIUIVEXT)(GLuint texture, GLenum target, GLenum pname, const GLuint * params);
+// typedef void (APIENTRYP GPTEXTUREPARAMETERF)(GLuint texture, GLenum pname, GLfloat param);
+// typedef void (APIENTRYP GPTEXTUREPARAMETERFEXT)(GLuint texture, GLenum target, GLenum pname, GLfloat param);
+// typedef void (APIENTRYP GPTEXTUREPARAMETERFV)(GLuint texture, GLenum pname, const GLfloat * param);
+// typedef void (APIENTRYP GPTEXTUREPARAMETERFVEXT)(GLuint texture, GLenum target, GLenum pname, const GLfloat * params);
+// typedef void (APIENTRYP GPTEXTUREPARAMETERI)(GLuint texture, GLenum pname, GLint param);
+// typedef void (APIENTRYP GPTEXTUREPARAMETERIEXT)(GLuint texture, GLenum target, GLenum pname, GLint param);
+// typedef void (APIENTRYP GPTEXTUREPARAMETERIV)(GLuint texture, GLenum pname, const GLint * param);
+// typedef void (APIENTRYP GPTEXTUREPARAMETERIVEXT)(GLuint texture, GLenum target, GLenum pname, const GLint * params);
+// typedef void (APIENTRYP GPTEXTURERENDERBUFFEREXT)(GLuint texture, GLenum target, GLuint renderbuffer);
+// typedef void (APIENTRYP GPTEXTURESTORAGE1D)(GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width);
+// typedef void (APIENTRYP GPTEXTURESTORAGE1DEXT)(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
+// typedef void (APIENTRYP GPTEXTURESTORAGE2D)(GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
+// typedef void (APIENTRYP GPTEXTURESTORAGE2DEXT)(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
+// typedef void (APIENTRYP GPTEXTURESTORAGE2DMULTISAMPLE)(GLuint texture, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
+// typedef void (APIENTRYP GPTEXTURESTORAGE2DMULTISAMPLEEXT)(GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
+// typedef void (APIENTRYP GPTEXTURESTORAGE3D)(GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
+// typedef void (APIENTRYP GPTEXTURESTORAGE3DEXT)(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
+// typedef void (APIENTRYP GPTEXTURESTORAGE3DMULTISAMPLE)(GLuint texture, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);
+// typedef void (APIENTRYP GPTEXTURESTORAGE3DMULTISAMPLEEXT)(GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);
+// typedef void (APIENTRYP GPTEXTURESUBIMAGE1D)(GLuint texture, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void * pixels);
+// typedef void (APIENTRYP GPTEXTURESUBIMAGE1DEXT)(GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void * pixels);
+// typedef void (APIENTRYP GPTEXTURESUBIMAGE2D)(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void * pixels);
+// typedef void (APIENTRYP GPTEXTURESUBIMAGE2DEXT)(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void * pixels);
+// typedef void (APIENTRYP GPTEXTURESUBIMAGE3D)(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void * pixels);
+// typedef void (APIENTRYP GPTEXTURESUBIMAGE3DEXT)(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void * pixels);
+// typedef void (APIENTRYP GPTEXTUREVIEW)(GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers);
+// typedef void (APIENTRYP GPTRANSFORMFEEDBACKBUFFERBASE)(GLuint xfb, GLuint index, GLuint buffer);
+// typedef void (APIENTRYP GPTRANSFORMFEEDBACKBUFFERRANGE)(GLuint xfb, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
+// typedef void (APIENTRYP GPTRANSFORMFEEDBACKVARYINGS)(GLuint program, GLsizei count, const GLchar *const* varyings, GLenum bufferMode);
+// typedef void (APIENTRYP GPTRANSFORMPATHNV)(GLuint resultPath, GLuint srcPath, GLenum transformType, const GLfloat * transformValues);
+// typedef void (APIENTRYP GPUNIFORM1D)(GLint location, GLdouble x);
+// typedef void (APIENTRYP GPUNIFORM1DV)(GLint location, GLsizei count, const GLdouble * value);
+// typedef void (APIENTRYP GPUNIFORM1F)(GLint location, GLfloat v0);
+// typedef void (APIENTRYP GPUNIFORM1FV)(GLint location, GLsizei count, const GLfloat * value);
+// typedef void (APIENTRYP GPUNIFORM1I)(GLint location, GLint v0);
+// typedef void (APIENTRYP GPUNIFORM1I64ARB)(GLint location, GLint64 x);
+// typedef void (APIENTRYP GPUNIFORM1I64NV)(GLint location, GLint64EXT x);
+// typedef void (APIENTRYP GPUNIFORM1I64VARB)(GLint location, GLsizei count, const GLint64 * value);
+// typedef void (APIENTRYP GPUNIFORM1I64VNV)(GLint location, GLsizei count, const GLint64EXT * value);
+// typedef void (APIENTRYP GPUNIFORM1IV)(GLint location, GLsizei count, const GLint * value);
+// typedef void (APIENTRYP GPUNIFORM1UI)(GLint location, GLuint v0);
+// typedef void (APIENTRYP GPUNIFORM1UI64ARB)(GLint location, GLuint64 x);
+// typedef void (APIENTRYP GPUNIFORM1UI64NV)(GLint location, GLuint64EXT x);
+// typedef void (APIENTRYP GPUNIFORM1UI64VARB)(GLint location, GLsizei count, const GLuint64 * value);
+// typedef void (APIENTRYP GPUNIFORM1UI64VNV)(GLint location, GLsizei count, const GLuint64EXT * value);
+// typedef void (APIENTRYP GPUNIFORM1UIV)(GLint location, GLsizei count, const GLuint * value);
+// typedef void (APIENTRYP GPUNIFORM2D)(GLint location, GLdouble x, GLdouble y);
+// typedef void (APIENTRYP GPUNIFORM2DV)(GLint location, GLsizei count, const GLdouble * value);
+// typedef void (APIENTRYP GPUNIFORM2F)(GLint location, GLfloat v0, GLfloat v1);
+// typedef void (APIENTRYP GPUNIFORM2FV)(GLint location, GLsizei count, const GLfloat * value);
+// typedef void (APIENTRYP GPUNIFORM2I)(GLint location, GLint v0, GLint v1);
+// typedef void (APIENTRYP GPUNIFORM2I64ARB)(GLint location, GLint64 x, GLint64 y);
+// typedef void (APIENTRYP GPUNIFORM2I64NV)(GLint location, GLint64EXT x, GLint64EXT y);
+// typedef void (APIENTRYP GPUNIFORM2I64VARB)(GLint location, GLsizei count, const GLint64 * value);
+// typedef void (APIENTRYP GPUNIFORM2I64VNV)(GLint location, GLsizei count, const GLint64EXT * value);
+// typedef void (APIENTRYP GPUNIFORM2IV)(GLint location, GLsizei count, const GLint * value);
+// typedef void (APIENTRYP GPUNIFORM2UI)(GLint location, GLuint v0, GLuint v1);
+// typedef void (APIENTRYP GPUNIFORM2UI64ARB)(GLint location, GLuint64 x, GLuint64 y);
+// typedef void (APIENTRYP GPUNIFORM2UI64NV)(GLint location, GLuint64EXT x, GLuint64EXT y);
+// typedef void (APIENTRYP GPUNIFORM2UI64VARB)(GLint location, GLsizei count, const GLuint64 * value);
+// typedef void (APIENTRYP GPUNIFORM2UI64VNV)(GLint location, GLsizei count, const GLuint64EXT * value);
+// typedef void (APIENTRYP GPUNIFORM2UIV)(GLint location, GLsizei count, const GLuint * value);
+// typedef void (APIENTRYP GPUNIFORM3D)(GLint location, GLdouble x, GLdouble y, GLdouble z);
+// typedef void (APIENTRYP GPUNIFORM3DV)(GLint location, GLsizei count, const GLdouble * value);
+// typedef void (APIENTRYP GPUNIFORM3F)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+// typedef void (APIENTRYP GPUNIFORM3FV)(GLint location, GLsizei count, const GLfloat * value);
+// typedef void (APIENTRYP GPUNIFORM3I)(GLint location, GLint v0, GLint v1, GLint v2);
+// typedef void (APIENTRYP GPUNIFORM3I64ARB)(GLint location, GLint64 x, GLint64 y, GLint64 z);
+// typedef void (APIENTRYP GPUNIFORM3I64NV)(GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z);
+// typedef void (APIENTRYP GPUNIFORM3I64VARB)(GLint location, GLsizei count, const GLint64 * value);
+// typedef void (APIENTRYP GPUNIFORM3I64VNV)(GLint location, GLsizei count, const GLint64EXT * value);
+// typedef void (APIENTRYP GPUNIFORM3IV)(GLint location, GLsizei count, const GLint * value);
+// typedef void (APIENTRYP GPUNIFORM3UI)(GLint location, GLuint v0, GLuint v1, GLuint v2);
+// typedef void (APIENTRYP GPUNIFORM3UI64ARB)(GLint location, GLuint64 x, GLuint64 y, GLuint64 z);
+// typedef void (APIENTRYP GPUNIFORM3UI64NV)(GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z);
+// typedef void (APIENTRYP GPUNIFORM3UI64VARB)(GLint location, GLsizei count, const GLuint64 * value);
+// typedef void (APIENTRYP GPUNIFORM3UI64VNV)(GLint location, GLsizei count, const GLuint64EXT * value);
+// typedef void (APIENTRYP GPUNIFORM3UIV)(GLint location, GLsizei count, const GLuint * value);
+// typedef void (APIENTRYP GPUNIFORM4D)(GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+// typedef void (APIENTRYP GPUNIFORM4DV)(GLint location, GLsizei count, const GLdouble * value);
+// typedef void (APIENTRYP GPUNIFORM4F)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+// typedef void (APIENTRYP GPUNIFORM4FV)(GLint location, GLsizei count, const GLfloat * value);
+// typedef void (APIENTRYP GPUNIFORM4I)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+// typedef void (APIENTRYP GPUNIFORM4I64ARB)(GLint location, GLint64 x, GLint64 y, GLint64 z, GLint64 w);
+// typedef void (APIENTRYP GPUNIFORM4I64NV)(GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w);
+// typedef void (APIENTRYP GPUNIFORM4I64VARB)(GLint location, GLsizei count, const GLint64 * value);
+// typedef void (APIENTRYP GPUNIFORM4I64VNV)(GLint location, GLsizei count, const GLint64EXT * value);
+// typedef void (APIENTRYP GPUNIFORM4IV)(GLint location, GLsizei count, const GLint * value);
+// typedef void (APIENTRYP GPUNIFORM4UI)(GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
+// typedef void (APIENTRYP GPUNIFORM4UI64ARB)(GLint location, GLuint64 x, GLuint64 y, GLuint64 z, GLuint64 w);
+// typedef void (APIENTRYP GPUNIFORM4UI64NV)(GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w);
+// typedef void (APIENTRYP GPUNIFORM4UI64VARB)(GLint location, GLsizei count, const GLuint64 * value);
+// typedef void (APIENTRYP GPUNIFORM4UI64VNV)(GLint location, GLsizei count, const GLuint64EXT * value);
+// typedef void (APIENTRYP GPUNIFORM4UIV)(GLint location, GLsizei count, const GLuint * value);
+// typedef void (APIENTRYP GPUNIFORMBLOCKBINDING)(GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding);
+// typedef void (APIENTRYP GPUNIFORMHANDLEUI64ARB)(GLint location, GLuint64 value);
+// typedef void (APIENTRYP GPUNIFORMHANDLEUI64NV)(GLint location, GLuint64 value);
+// typedef void (APIENTRYP GPUNIFORMHANDLEUI64VARB)(GLint location, GLsizei count, const GLuint64 * value);
+// typedef void (APIENTRYP GPUNIFORMHANDLEUI64VNV)(GLint location, GLsizei count, const GLuint64 * value);
+// typedef void (APIENTRYP GPUNIFORMMATRIX2DV)(GLint location, GLsizei count, GLboolean transpose, const GLdouble * value);
+// typedef void (APIENTRYP GPUNIFORMMATRIX2FV)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
+// typedef void (APIENTRYP GPUNIFORMMATRIX2X3DV)(GLint location, GLsizei count, GLboolean transpose, const GLdouble * value);
+// typedef void (APIENTRYP GPUNIFORMMATRIX2X3FV)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
+// typedef void (APIENTRYP GPUNIFORMMATRIX2X4DV)(GLint location, GLsizei count, GLboolean transpose, const GLdouble * value);
+// typedef void (APIENTRYP GPUNIFORMMATRIX2X4FV)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
+// typedef void (APIENTRYP GPUNIFORMMATRIX3DV)(GLint location, GLsizei count, GLboolean transpose, const GLdouble * value);
+// typedef void (APIENTRYP GPUNIFORMMATRIX3FV)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
+// typedef void (APIENTRYP GPUNIFORMMATRIX3X2DV)(GLint location, GLsizei count, GLboolean transpose, const GLdouble * value);
+// typedef void (APIENTRYP GPUNIFORMMATRIX3X2FV)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
+// typedef void (APIENTRYP GPUNIFORMMATRIX3X4DV)(GLint location, GLsizei count, GLboolean transpose, const GLdouble * value);
+// typedef void (APIENTRYP GPUNIFORMMATRIX3X4FV)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
+// typedef void (APIENTRYP GPUNIFORMMATRIX4DV)(GLint location, GLsizei count, GLboolean transpose, const GLdouble * value);
+// typedef void (APIENTRYP GPUNIFORMMATRIX4FV)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
+// typedef void (APIENTRYP GPUNIFORMMATRIX4X2DV)(GLint location, GLsizei count, GLboolean transpose, const GLdouble * value);
+// typedef void (APIENTRYP GPUNIFORMMATRIX4X2FV)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
+// typedef void (APIENTRYP GPUNIFORMMATRIX4X3DV)(GLint location, GLsizei count, GLboolean transpose, const GLdouble * value);
+// typedef void (APIENTRYP GPUNIFORMMATRIX4X3FV)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
+// typedef void (APIENTRYP GPUNIFORMSUBROUTINESUIV)(GLenum shadertype, GLsizei count, const GLuint * indices);
+// typedef void (APIENTRYP GPUNIFORMUI64NV)(GLint location, GLuint64EXT value);
+// typedef void (APIENTRYP GPUNIFORMUI64VNV)(GLint location, GLsizei count, const GLuint64EXT * value);
+// typedef GLboolean (APIENTRYP GPUNMAPBUFFER)(GLenum target);
+// typedef GLboolean (APIENTRYP GPUNMAPNAMEDBUFFER)(GLuint buffer);
+// typedef GLboolean (APIENTRYP GPUNMAPNAMEDBUFFEREXT)(GLuint buffer);
+// typedef void (APIENTRYP GPUSEPROGRAM)(GLuint program);
+// typedef void (APIENTRYP GPUSEPROGRAMSTAGES)(GLuint pipeline, GLbitfield stages, GLuint program);
+// typedef void (APIENTRYP GPUSEPROGRAMSTAGESEXT)(GLuint pipeline, GLbitfield stages, GLuint program);
+// typedef void (APIENTRYP GPUSESHADERPROGRAMEXT)(GLenum type, GLuint program);
+// typedef void (APIENTRYP GPVALIDATEPROGRAM)(GLuint program);
+// typedef void (APIENTRYP GPVALIDATEPROGRAMPIPELINE)(GLuint pipeline);
+// typedef void (APIENTRYP GPVALIDATEPROGRAMPIPELINEEXT)(GLuint pipeline);
+// typedef void (APIENTRYP GPVERTEXARRAYATTRIBBINDING)(GLuint vaobj, GLuint attribindex, GLuint bindingindex);
+// typedef void (APIENTRYP GPVERTEXARRAYATTRIBFORMAT)(GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset);
+// typedef void (APIENTRYP GPVERTEXARRAYATTRIBIFORMAT)(GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset);
+// typedef void (APIENTRYP GPVERTEXARRAYATTRIBLFORMAT)(GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset);
+// typedef void (APIENTRYP GPVERTEXARRAYBINDVERTEXBUFFEREXT)(GLuint vaobj, GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride);
+// typedef void (APIENTRYP GPVERTEXARRAYBINDINGDIVISOR)(GLuint vaobj, GLuint bindingindex, GLuint divisor);
+// typedef void (APIENTRYP GPVERTEXARRAYCOLOROFFSETEXT)(GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset);
+// typedef void (APIENTRYP GPVERTEXARRAYEDGEFLAGOFFSETEXT)(GLuint vaobj, GLuint buffer, GLsizei stride, GLintptr offset);
+// typedef void (APIENTRYP GPVERTEXARRAYELEMENTBUFFER)(GLuint vaobj, GLuint buffer);
+// typedef void (APIENTRYP GPVERTEXARRAYFOGCOORDOFFSETEXT)(GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset);
+// typedef void (APIENTRYP GPVERTEXARRAYINDEXOFFSETEXT)(GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset);
+// typedef void (APIENTRYP GPVERTEXARRAYMULTITEXCOORDOFFSETEXT)(GLuint vaobj, GLuint buffer, GLenum texunit, GLint size, GLenum type, GLsizei stride, GLintptr offset);
+// typedef void (APIENTRYP GPVERTEXARRAYNORMALOFFSETEXT)(GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset);
+// typedef void (APIENTRYP GPVERTEXARRAYSECONDARYCOLOROFFSETEXT)(GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset);
+// typedef void (APIENTRYP GPVERTEXARRAYTEXCOORDOFFSETEXT)(GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset);
+// typedef void (APIENTRYP GPVERTEXARRAYVERTEXATTRIBBINDINGEXT)(GLuint vaobj, GLuint attribindex, GLuint bindingindex);
+// typedef void (APIENTRYP GPVERTEXARRAYVERTEXATTRIBDIVISOREXT)(GLuint vaobj, GLuint index, GLuint divisor);
+// typedef void (APIENTRYP GPVERTEXARRAYVERTEXATTRIBFORMATEXT)(GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset);
+// typedef void (APIENTRYP GPVERTEXARRAYVERTEXATTRIBIFORMATEXT)(GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset);
+// typedef void (APIENTRYP GPVERTEXARRAYVERTEXATTRIBIOFFSETEXT)(GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset);
+// typedef void (APIENTRYP GPVERTEXARRAYVERTEXATTRIBLFORMATEXT)(GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset);
+// typedef void (APIENTRYP GPVERTEXARRAYVERTEXATTRIBLOFFSETEXT)(GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset);
+// typedef void (APIENTRYP GPVERTEXARRAYVERTEXATTRIBOFFSETEXT)(GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLintptr offset);
+// typedef void (APIENTRYP GPVERTEXARRAYVERTEXBINDINGDIVISOREXT)(GLuint vaobj, GLuint bindingindex, GLuint divisor);
+// typedef void (APIENTRYP GPVERTEXARRAYVERTEXBUFFER)(GLuint vaobj, GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride);
+// typedef void (APIENTRYP GPVERTEXARRAYVERTEXBUFFERS)(GLuint vaobj, GLuint first, GLsizei count, const GLuint * buffers, const GLintptr * offsets, const GLsizei * strides);
+// typedef void (APIENTRYP GPVERTEXARRAYVERTEXOFFSETEXT)(GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset);
+// typedef void (APIENTRYP GPVERTEXATTRIB1D)(GLuint index, GLdouble x);
+// typedef void (APIENTRYP GPVERTEXATTRIB1DV)(GLuint index, const GLdouble * v);
+// typedef void (APIENTRYP GPVERTEXATTRIB1F)(GLuint index, GLfloat x);
+// typedef void (APIENTRYP GPVERTEXATTRIB1FV)(GLuint index, const GLfloat * v);
+// typedef void (APIENTRYP GPVERTEXATTRIB1S)(GLuint index, GLshort x);
+// typedef void (APIENTRYP GPVERTEXATTRIB1SV)(GLuint index, const GLshort * v);
+// typedef void (APIENTRYP GPVERTEXATTRIB2D)(GLuint index, GLdouble x, GLdouble y);
+// typedef void (APIENTRYP GPVERTEXATTRIB2DV)(GLuint index, const GLdouble * v);
+// typedef void (APIENTRYP GPVERTEXATTRIB2F)(GLuint index, GLfloat x, GLfloat y);
+// typedef void (APIENTRYP GPVERTEXATTRIB2FV)(GLuint index, const GLfloat * v);
+// typedef void (APIENTRYP GPVERTEXATTRIB2S)(GLuint index, GLshort x, GLshort y);
+// typedef void (APIENTRYP GPVERTEXATTRIB2SV)(GLuint index, const GLshort * v);
+// typedef void (APIENTRYP GPVERTEXATTRIB3D)(GLuint index, GLdouble x, GLdouble y, GLdouble z);
+// typedef void (APIENTRYP GPVERTEXATTRIB3DV)(GLuint index, const GLdouble * v);
+// typedef void (APIENTRYP GPVERTEXATTRIB3F)(GLuint index, GLfloat x, GLfloat y, GLfloat z);
+// typedef void (APIENTRYP GPVERTEXATTRIB3FV)(GLuint index, const GLfloat * v);
+// typedef void (APIENTRYP GPVERTEXATTRIB3S)(GLuint index, GLshort x, GLshort y, GLshort z);
+// typedef void (APIENTRYP GPVERTEXATTRIB3SV)(GLuint index, const GLshort * v);
+// typedef void (APIENTRYP GPVERTEXATTRIB4NBV)(GLuint index, const GLbyte * v);
+// typedef void (APIENTRYP GPVERTEXATTRIB4NIV)(GLuint index, const GLint * v);
+// typedef void (APIENTRYP GPVERTEXATTRIB4NSV)(GLuint index, const GLshort * v);
+// typedef void (APIENTRYP GPVERTEXATTRIB4NUB)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
+// typedef void (APIENTRYP GPVERTEXATTRIB4NUBV)(GLuint index, const GLubyte * v);
+// typedef void (APIENTRYP GPVERTEXATTRIB4NUIV)(GLuint index, const GLuint * v);
+// typedef void (APIENTRYP GPVERTEXATTRIB4NUSV)(GLuint index, const GLushort * v);
+// typedef void (APIENTRYP GPVERTEXATTRIB4BV)(GLuint index, const GLbyte * v);
+// typedef void (APIENTRYP GPVERTEXATTRIB4D)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+// typedef void (APIENTRYP GPVERTEXATTRIB4DV)(GLuint index, const GLdouble * v);
+// typedef void (APIENTRYP GPVERTEXATTRIB4F)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+// typedef void (APIENTRYP GPVERTEXATTRIB4FV)(GLuint index, const GLfloat * v);
+// typedef void (APIENTRYP GPVERTEXATTRIB4IV)(GLuint index, const GLint * v);
+// typedef void (APIENTRYP GPVERTEXATTRIB4S)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
+// typedef void (APIENTRYP GPVERTEXATTRIB4SV)(GLuint index, const GLshort * v);
+// typedef void (APIENTRYP GPVERTEXATTRIB4UBV)(GLuint index, const GLubyte * v);
+// typedef void (APIENTRYP GPVERTEXATTRIB4UIV)(GLuint index, const GLuint * v);
+// typedef void (APIENTRYP GPVERTEXATTRIB4USV)(GLuint index, const GLushort * v);
+// typedef void (APIENTRYP GPVERTEXATTRIBBINDING)(GLuint attribindex, GLuint bindingindex);
+// typedef void (APIENTRYP GPVERTEXATTRIBDIVISOR)(GLuint index, GLuint divisor);
+// typedef void (APIENTRYP GPVERTEXATTRIBDIVISORARB)(GLuint index, GLuint divisor);
+// typedef void (APIENTRYP GPVERTEXATTRIBFORMAT)(GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset);
+// typedef void (APIENTRYP GPVERTEXATTRIBFORMATNV)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride);
+// typedef void (APIENTRYP GPVERTEXATTRIBI1I)(GLuint index, GLint x);
+// typedef void (APIENTRYP GPVERTEXATTRIBI1IV)(GLuint index, const GLint * v);
+// typedef void (APIENTRYP GPVERTEXATTRIBI1UI)(GLuint index, GLuint x);
+// typedef void (APIENTRYP GPVERTEXATTRIBI1UIV)(GLuint index, const GLuint * v);
+// typedef void (APIENTRYP GPVERTEXATTRIBI2I)(GLuint index, GLint x, GLint y);
+// typedef void (APIENTRYP GPVERTEXATTRIBI2IV)(GLuint index, const GLint * v);
+// typedef void (APIENTRYP GPVERTEXATTRIBI2UI)(GLuint index, GLuint x, GLuint y);
+// typedef void (APIENTRYP GPVERTEXATTRIBI2UIV)(GLuint index, const GLuint * v);
+// typedef void (APIENTRYP GPVERTEXATTRIBI3I)(GLuint index, GLint x, GLint y, GLint z);
+// typedef void (APIENTRYP GPVERTEXATTRIBI3IV)(GLuint index, const GLint * v);
+// typedef void (APIENTRYP GPVERTEXATTRIBI3UI)(GLuint index, GLuint x, GLuint y, GLuint z);
+// typedef void (APIENTRYP GPVERTEXATTRIBI3UIV)(GLuint index, const GLuint * v);
+// typedef void (APIENTRYP GPVERTEXATTRIBI4BV)(GLuint index, const GLbyte * v);
+// typedef void (APIENTRYP GPVERTEXATTRIBI4I)(GLuint index, GLint x, GLint y, GLint z, GLint w);
+// typedef void (APIENTRYP GPVERTEXATTRIBI4IV)(GLuint index, const GLint * v);
+// typedef void (APIENTRYP GPVERTEXATTRIBI4SV)(GLuint index, const GLshort * v);
+// typedef void (APIENTRYP GPVERTEXATTRIBI4UBV)(GLuint index, const GLubyte * v);
+// typedef void (APIENTRYP GPVERTEXATTRIBI4UI)(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
+// typedef void (APIENTRYP GPVERTEXATTRIBI4UIV)(GLuint index, const GLuint * v);
+// typedef void (APIENTRYP GPVERTEXATTRIBI4USV)(GLuint index, const GLushort * v);
+// typedef void (APIENTRYP GPVERTEXATTRIBIFORMAT)(GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset);
+// typedef void (APIENTRYP GPVERTEXATTRIBIFORMATNV)(GLuint index, GLint size, GLenum type, GLsizei stride);
+// typedef void (APIENTRYP GPVERTEXATTRIBIPOINTER)(GLuint index, GLint size, GLenum type, GLsizei stride, const void * pointer);
+// typedef void (APIENTRYP GPVERTEXATTRIBL1D)(GLuint index, GLdouble x);
+// typedef void (APIENTRYP GPVERTEXATTRIBL1DV)(GLuint index, const GLdouble * v);
+// typedef void (APIENTRYP GPVERTEXATTRIBL1I64NV)(GLuint index, GLint64EXT x);
+// typedef void (APIENTRYP GPVERTEXATTRIBL1I64VNV)(GLuint index, const GLint64EXT * v);
+// typedef void (APIENTRYP GPVERTEXATTRIBL1UI64ARB)(GLuint index, GLuint64EXT x);
+// typedef void (APIENTRYP GPVERTEXATTRIBL1UI64NV)(GLuint index, GLuint64EXT x);
+// typedef void (APIENTRYP GPVERTEXATTRIBL1UI64VARB)(GLuint index, const GLuint64EXT * v);
+// typedef void (APIENTRYP GPVERTEXATTRIBL1UI64VNV)(GLuint index, const GLuint64EXT * v);
+// typedef void (APIENTRYP GPVERTEXATTRIBL2D)(GLuint index, GLdouble x, GLdouble y);
+// typedef void (APIENTRYP GPVERTEXATTRIBL2DV)(GLuint index, const GLdouble * v);
+// typedef void (APIENTRYP GPVERTEXATTRIBL2I64NV)(GLuint index, GLint64EXT x, GLint64EXT y);
+// typedef void (APIENTRYP GPVERTEXATTRIBL2I64VNV)(GLuint index, const GLint64EXT * v);
+// typedef void (APIENTRYP GPVERTEXATTRIBL2UI64NV)(GLuint index, GLuint64EXT x, GLuint64EXT y);
+// typedef void (APIENTRYP GPVERTEXATTRIBL2UI64VNV)(GLuint index, const GLuint64EXT * v);
+// typedef void (APIENTRYP GPVERTEXATTRIBL3D)(GLuint index, GLdouble x, GLdouble y, GLdouble z);
+// typedef void (APIENTRYP GPVERTEXATTRIBL3DV)(GLuint index, const GLdouble * v);
+// typedef void (APIENTRYP GPVERTEXATTRIBL3I64NV)(GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z);
+// typedef void (APIENTRYP GPVERTEXATTRIBL3I64VNV)(GLuint index, const GLint64EXT * v);
+// typedef void (APIENTRYP GPVERTEXATTRIBL3UI64NV)(GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z);
+// typedef void (APIENTRYP GPVERTEXATTRIBL3UI64VNV)(GLuint index, const GLuint64EXT * v);
+// typedef void (APIENTRYP GPVERTEXATTRIBL4D)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+// typedef void (APIENTRYP GPVERTEXATTRIBL4DV)(GLuint index, const GLdouble * v);
+// typedef void (APIENTRYP GPVERTEXATTRIBL4I64NV)(GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w);
+// typedef void (APIENTRYP GPVERTEXATTRIBL4I64VNV)(GLuint index, const GLint64EXT * v);
+// typedef void (APIENTRYP GPVERTEXATTRIBL4UI64NV)(GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w);
+// typedef void (APIENTRYP GPVERTEXATTRIBL4UI64VNV)(GLuint index, const GLuint64EXT * v);
+// typedef void (APIENTRYP GPVERTEXATTRIBLFORMAT)(GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset);
+// typedef void (APIENTRYP GPVERTEXATTRIBLFORMATNV)(GLuint index, GLint size, GLenum type, GLsizei stride);
+// typedef void (APIENTRYP GPVERTEXATTRIBLPOINTER)(GLuint index, GLint size, GLenum type, GLsizei stride, const void * pointer);
+// typedef void (APIENTRYP GPVERTEXATTRIBP1UI)(GLuint index, GLenum type, GLboolean normalized, GLuint value);
+// typedef void (APIENTRYP GPVERTEXATTRIBP1UIV)(GLuint index, GLenum type, GLboolean normalized, const GLuint * value);
+// typedef void (APIENTRYP GPVERTEXATTRIBP2UI)(GLuint index, GLenum type, GLboolean normalized, GLuint value);
+// typedef void (APIENTRYP GPVERTEXATTRIBP2UIV)(GLuint index, GLenum type, GLboolean normalized, const GLuint * value);
+// typedef void (APIENTRYP GPVERTEXATTRIBP3UI)(GLuint index, GLenum type, GLboolean normalized, GLuint value);
+// typedef void (APIENTRYP GPVERTEXATTRIBP3UIV)(GLuint index, GLenum type, GLboolean normalized, const GLuint * value);
+// typedef void (APIENTRYP GPVERTEXATTRIBP4UI)(GLuint index, GLenum type, GLboolean normalized, GLuint value);
+// typedef void (APIENTRYP GPVERTEXATTRIBP4UIV)(GLuint index, GLenum type, GLboolean normalized, const GLuint * value);
+// typedef void (APIENTRYP GPVERTEXATTRIBPOINTER)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void * pointer);
+// typedef void (APIENTRYP GPVERTEXBINDINGDIVISOR)(GLuint bindingindex, GLuint divisor);
+// typedef void (APIENTRYP GPVERTEXFORMATNV)(GLint size, GLenum type, GLsizei stride);
+// typedef void (APIENTRYP GPVIEWPORT)(GLint x, GLint y, GLsizei width, GLsizei height);
+// typedef void (APIENTRYP GPVIEWPORTARRAYV)(GLuint first, GLsizei count, const GLfloat * v);
+// typedef void (APIENTRYP GPVIEWPORTINDEXEDF)(GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h);
+// typedef void (APIENTRYP GPVIEWPORTINDEXEDFV)(GLuint index, const GLfloat * v);
+// typedef void (APIENTRYP GPVIEWPORTPOSITIONWSCALENV)(GLuint index, GLfloat xcoeff, GLfloat ycoeff);
+// typedef void (APIENTRYP GPVIEWPORTSWIZZLENV)(GLuint index, GLenum swizzlex, GLenum swizzley, GLenum swizzlez, GLenum swizzlew);
+// typedef void (APIENTRYP GPWAITSYNC)(GLsync sync, GLbitfield flags, GLuint64 timeout);
+// typedef void (APIENTRYP GPWAITVKSEMAPHORENV)(GLuint64 vkSemaphore);
+// typedef void (APIENTRYP GPWEIGHTPATHSNV)(GLuint resultPath, GLsizei numPaths, const GLuint * paths, const GLfloat * weights);
+// typedef void (APIENTRYP GPWINDOWRECTANGLESEXT)(GLenum mode, GLsizei count, const GLint * box);
+// static void glowActiveProgramEXT(GPACTIVEPROGRAMEXT fnptr, GLuint program) {
+// (*fnptr)(program);
+// }
+// static void glowActiveShaderProgram(GPACTIVESHADERPROGRAM fnptr, GLuint pipeline, GLuint program) {
+// (*fnptr)(pipeline, program);
+// }
+// static void glowActiveShaderProgramEXT(GPACTIVESHADERPROGRAMEXT fnptr, GLuint pipeline, GLuint program) {
+// (*fnptr)(pipeline, program);
+// }
+// static void glowActiveTexture(GPACTIVETEXTURE fnptr, GLenum texture) {
+// (*fnptr)(texture);
+// }
+// static void glowApplyFramebufferAttachmentCMAAINTEL(GPAPPLYFRAMEBUFFERATTACHMENTCMAAINTEL fnptr) {
+// (*fnptr)();
+// }
+// static void glowAttachShader(GPATTACHSHADER fnptr, GLuint program, GLuint shader) {
+// (*fnptr)(program, shader);
+// }
+// static void glowBeginConditionalRender(GPBEGINCONDITIONALRENDER fnptr, GLuint id, GLenum mode) {
+// (*fnptr)(id, mode);
+// }
+// static void glowBeginConditionalRenderNV(GPBEGINCONDITIONALRENDERNV fnptr, GLuint id, GLenum mode) {
+// (*fnptr)(id, mode);
+// }
+// static void glowBeginPerfMonitorAMD(GPBEGINPERFMONITORAMD fnptr, GLuint monitor) {
+// (*fnptr)(monitor);
+// }
+// static void glowBeginPerfQueryINTEL(GPBEGINPERFQUERYINTEL fnptr, GLuint queryHandle) {
+// (*fnptr)(queryHandle);
+// }
+// static void glowBeginQuery(GPBEGINQUERY fnptr, GLenum target, GLuint id) {
+// (*fnptr)(target, id);
+// }
+// static void glowBeginQueryIndexed(GPBEGINQUERYINDEXED fnptr, GLenum target, GLuint index, GLuint id) {
+// (*fnptr)(target, index, id);
+// }
+// static void glowBeginTransformFeedback(GPBEGINTRANSFORMFEEDBACK fnptr, GLenum primitiveMode) {
+// (*fnptr)(primitiveMode);
+// }
+// static void glowBindAttribLocation(GPBINDATTRIBLOCATION fnptr, GLuint program, GLuint index, const GLchar * name) {
+// (*fnptr)(program, index, name);
+// }
+// static void glowBindBuffer(GPBINDBUFFER fnptr, GLenum target, GLuint buffer) {
+// (*fnptr)(target, buffer);
+// }
+// static void glowBindBufferBase(GPBINDBUFFERBASE fnptr, GLenum target, GLuint index, GLuint buffer) {
+// (*fnptr)(target, index, buffer);
+// }
+// static void glowBindBufferRange(GPBINDBUFFERRANGE fnptr, GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size) {
+// (*fnptr)(target, index, buffer, offset, size);
+// }
+// static void glowBindBuffersBase(GPBINDBUFFERSBASE fnptr, GLenum target, GLuint first, GLsizei count, const GLuint * buffers) {
+// (*fnptr)(target, first, count, buffers);
+// }
+// static void glowBindBuffersRange(GPBINDBUFFERSRANGE fnptr, GLenum target, GLuint first, GLsizei count, const GLuint * buffers, const GLintptr * offsets, const GLsizeiptr * sizes) {
+// (*fnptr)(target, first, count, buffers, offsets, sizes);
+// }
+// static void glowBindFragDataLocation(GPBINDFRAGDATALOCATION fnptr, GLuint program, GLuint color, const GLchar * name) {
+// (*fnptr)(program, color, name);
+// }
+// static void glowBindFragDataLocationIndexed(GPBINDFRAGDATALOCATIONINDEXED fnptr, GLuint program, GLuint colorNumber, GLuint index, const GLchar * name) {
+// (*fnptr)(program, colorNumber, index, name);
+// }
+// static void glowBindFramebuffer(GPBINDFRAMEBUFFER fnptr, GLenum target, GLuint framebuffer) {
+// (*fnptr)(target, framebuffer);
+// }
+// static void glowBindImageTexture(GPBINDIMAGETEXTURE fnptr, GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format) {
+// (*fnptr)(unit, texture, level, layered, layer, access, format);
+// }
+// static void glowBindImageTextures(GPBINDIMAGETEXTURES fnptr, GLuint first, GLsizei count, const GLuint * textures) {
+// (*fnptr)(first, count, textures);
+// }
+// static void glowBindMultiTextureEXT(GPBINDMULTITEXTUREEXT fnptr, GLenum texunit, GLenum target, GLuint texture) {
+// (*fnptr)(texunit, target, texture);
+// }
+// static void glowBindProgramPipeline(GPBINDPROGRAMPIPELINE fnptr, GLuint pipeline) {
+// (*fnptr)(pipeline);
+// }
+// static void glowBindProgramPipelineEXT(GPBINDPROGRAMPIPELINEEXT fnptr, GLuint pipeline) {
+// (*fnptr)(pipeline);
+// }
+// static void glowBindRenderbuffer(GPBINDRENDERBUFFER fnptr, GLenum target, GLuint renderbuffer) {
+// (*fnptr)(target, renderbuffer);
+// }
+// static void glowBindSampler(GPBINDSAMPLER fnptr, GLuint unit, GLuint sampler) {
+// (*fnptr)(unit, sampler);
+// }
+// static void glowBindSamplers(GPBINDSAMPLERS fnptr, GLuint first, GLsizei count, const GLuint * samplers) {
+// (*fnptr)(first, count, samplers);
+// }
+// static void glowBindShadingRateImageNV(GPBINDSHADINGRATEIMAGENV fnptr, GLuint texture) {
+// (*fnptr)(texture);
+// }
+// static void glowBindTexture(GPBINDTEXTURE fnptr, GLenum target, GLuint texture) {
+// (*fnptr)(target, texture);
+// }
+// static void glowBindTextureUnit(GPBINDTEXTUREUNIT fnptr, GLuint unit, GLuint texture) {
+// (*fnptr)(unit, texture);
+// }
+// static void glowBindTextures(GPBINDTEXTURES fnptr, GLuint first, GLsizei count, const GLuint * textures) {
+// (*fnptr)(first, count, textures);
+// }
+// static void glowBindTransformFeedback(GPBINDTRANSFORMFEEDBACK fnptr, GLenum target, GLuint id) {
+// (*fnptr)(target, id);
+// }
+// static void glowBindVertexArray(GPBINDVERTEXARRAY fnptr, GLuint array) {
+// (*fnptr)(array);
+// }
+// static void glowBindVertexBuffer(GPBINDVERTEXBUFFER fnptr, GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride) {
+// (*fnptr)(bindingindex, buffer, offset, stride);
+// }
+// static void glowBindVertexBuffers(GPBINDVERTEXBUFFERS fnptr, GLuint first, GLsizei count, const GLuint * buffers, const GLintptr * offsets, const GLsizei * strides) {
+// (*fnptr)(first, count, buffers, offsets, strides);
+// }
+// static void glowBlendBarrierKHR(GPBLENDBARRIERKHR fnptr) {
+// (*fnptr)();
+// }
+// static void glowBlendBarrierNV(GPBLENDBARRIERNV fnptr) {
+// (*fnptr)();
+// }
+// static void glowBlendColor(GPBLENDCOLOR fnptr, GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) {
+// (*fnptr)(red, green, blue, alpha);
+// }
+// static void glowBlendEquation(GPBLENDEQUATION fnptr, GLenum mode) {
+// (*fnptr)(mode);
+// }
+// static void glowBlendEquationSeparate(GPBLENDEQUATIONSEPARATE fnptr, GLenum modeRGB, GLenum modeAlpha) {
+// (*fnptr)(modeRGB, modeAlpha);
+// }
+// static void glowBlendEquationSeparateiARB(GPBLENDEQUATIONSEPARATEIARB fnptr, GLuint buf, GLenum modeRGB, GLenum modeAlpha) {
+// (*fnptr)(buf, modeRGB, modeAlpha);
+// }
+// static void glowBlendEquationiARB(GPBLENDEQUATIONIARB fnptr, GLuint buf, GLenum mode) {
+// (*fnptr)(buf, mode);
+// }
+// static void glowBlendFunc(GPBLENDFUNC fnptr, GLenum sfactor, GLenum dfactor) {
+// (*fnptr)(sfactor, dfactor);
+// }
+// static void glowBlendFuncSeparate(GPBLENDFUNCSEPARATE fnptr, GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha) {
+// (*fnptr)(sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha);
+// }
+// static void glowBlendFuncSeparateiARB(GPBLENDFUNCSEPARATEIARB fnptr, GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha) {
+// (*fnptr)(buf, srcRGB, dstRGB, srcAlpha, dstAlpha);
+// }
+// static void glowBlendFunciARB(GPBLENDFUNCIARB fnptr, GLuint buf, GLenum src, GLenum dst) {
+// (*fnptr)(buf, src, dst);
+// }
+// static void glowBlendParameteriNV(GPBLENDPARAMETERINV fnptr, GLenum pname, GLint value) {
+// (*fnptr)(pname, value);
+// }
+// static void glowBlitFramebuffer(GPBLITFRAMEBUFFER fnptr, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter) {
+// (*fnptr)(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
+// }
+// static void glowBlitNamedFramebuffer(GPBLITNAMEDFRAMEBUFFER fnptr, GLuint readFramebuffer, GLuint drawFramebuffer, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter) {
+// (*fnptr)(readFramebuffer, drawFramebuffer, srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
+// }
+// static void glowBufferAddressRangeNV(GPBUFFERADDRESSRANGENV fnptr, GLenum pname, GLuint index, GLuint64EXT address, GLsizeiptr length) {
+// (*fnptr)(pname, index, address, length);
+// }
+// static void glowBufferAttachMemoryNV(GPBUFFERATTACHMEMORYNV fnptr, GLenum target, GLuint memory, GLuint64 offset) {
+// (*fnptr)(target, memory, offset);
+// }
+// static void glowBufferData(GPBUFFERDATA fnptr, GLenum target, GLsizeiptr size, const void * data, GLenum usage) {
+// (*fnptr)(target, size, data, usage);
+// }
+// static void glowBufferPageCommitmentARB(GPBUFFERPAGECOMMITMENTARB fnptr, GLenum target, GLintptr offset, GLsizeiptr size, GLboolean commit) {
+// (*fnptr)(target, offset, size, commit);
+// }
+// static void glowBufferPageCommitmentMemNV(GPBUFFERPAGECOMMITMENTMEMNV fnptr, GLenum target, GLintptr offset, GLsizeiptr size, GLuint memory, GLuint64 memOffset, GLboolean commit) {
+// (*fnptr)(target, offset, size, memory, memOffset, commit);
+// }
+// static void glowBufferStorage(GPBUFFERSTORAGE fnptr, GLenum target, GLsizeiptr size, const void * data, GLbitfield flags) {
+// (*fnptr)(target, size, data, flags);
+// }
+// static void glowBufferSubData(GPBUFFERSUBDATA fnptr, GLenum target, GLintptr offset, GLsizeiptr size, const void * data) {
+// (*fnptr)(target, offset, size, data);
+// }
+// static void glowCallCommandListNV(GPCALLCOMMANDLISTNV fnptr, GLuint list) {
+// (*fnptr)(list);
+// }
+// static GLenum glowCheckFramebufferStatus(GPCHECKFRAMEBUFFERSTATUS fnptr, GLenum target) {
+// return (*fnptr)(target);
+// }
+// static GLenum glowCheckNamedFramebufferStatus(GPCHECKNAMEDFRAMEBUFFERSTATUS fnptr, GLuint framebuffer, GLenum target) {
+// return (*fnptr)(framebuffer, target);
+// }
+// static GLenum glowCheckNamedFramebufferStatusEXT(GPCHECKNAMEDFRAMEBUFFERSTATUSEXT fnptr, GLuint framebuffer, GLenum target) {
+// return (*fnptr)(framebuffer, target);
+// }
+// static void glowClampColor(GPCLAMPCOLOR fnptr, GLenum target, GLenum clamp) {
+// (*fnptr)(target, clamp);
+// }
+// static void glowClear(GPCLEAR fnptr, GLbitfield mask) {
+// (*fnptr)(mask);
+// }
+// static void glowClearBufferData(GPCLEARBUFFERDATA fnptr, GLenum target, GLenum internalformat, GLenum format, GLenum type, const void * data) {
+// (*fnptr)(target, internalformat, format, type, data);
+// }
+// static void glowClearBufferSubData(GPCLEARBUFFERSUBDATA fnptr, GLenum target, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const void * data) {
+// (*fnptr)(target, internalformat, offset, size, format, type, data);
+// }
+// static void glowClearBufferfi(GPCLEARBUFFERFI fnptr, GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil) {
+// (*fnptr)(buffer, drawbuffer, depth, stencil);
+// }
+// static void glowClearBufferfv(GPCLEARBUFFERFV fnptr, GLenum buffer, GLint drawbuffer, const GLfloat * value) {
+// (*fnptr)(buffer, drawbuffer, value);
+// }
+// static void glowClearBufferiv(GPCLEARBUFFERIV fnptr, GLenum buffer, GLint drawbuffer, const GLint * value) {
+// (*fnptr)(buffer, drawbuffer, value);
+// }
+// static void glowClearBufferuiv(GPCLEARBUFFERUIV fnptr, GLenum buffer, GLint drawbuffer, const GLuint * value) {
+// (*fnptr)(buffer, drawbuffer, value);
+// }
+// static void glowClearColor(GPCLEARCOLOR fnptr, GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) {
+// (*fnptr)(red, green, blue, alpha);
+// }
+// static void glowClearDepth(GPCLEARDEPTH fnptr, GLdouble depth) {
+// (*fnptr)(depth);
+// }
+// static void glowClearDepthdNV(GPCLEARDEPTHDNV fnptr, GLdouble depth) {
+// (*fnptr)(depth);
+// }
+// static void glowClearDepthf(GPCLEARDEPTHF fnptr, GLfloat d) {
+// (*fnptr)(d);
+// }
+// static void glowClearNamedBufferData(GPCLEARNAMEDBUFFERDATA fnptr, GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const void * data) {
+// (*fnptr)(buffer, internalformat, format, type, data);
+// }
+// static void glowClearNamedBufferDataEXT(GPCLEARNAMEDBUFFERDATAEXT fnptr, GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const void * data) {
+// (*fnptr)(buffer, internalformat, format, type, data);
+// }
+// static void glowClearNamedBufferSubData(GPCLEARNAMEDBUFFERSUBDATA fnptr, GLuint buffer, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const void * data) {
+// (*fnptr)(buffer, internalformat, offset, size, format, type, data);
+// }
+// static void glowClearNamedBufferSubDataEXT(GPCLEARNAMEDBUFFERSUBDATAEXT fnptr, GLuint buffer, GLenum internalformat, GLsizeiptr offset, GLsizeiptr size, GLenum format, GLenum type, const void * data) {
+// (*fnptr)(buffer, internalformat, offset, size, format, type, data);
+// }
+// static void glowClearNamedFramebufferfi(GPCLEARNAMEDFRAMEBUFFERFI fnptr, GLuint framebuffer, GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil) {
+// (*fnptr)(framebuffer, buffer, drawbuffer, depth, stencil);
+// }
+// static void glowClearNamedFramebufferfv(GPCLEARNAMEDFRAMEBUFFERFV fnptr, GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLfloat * value) {
+// (*fnptr)(framebuffer, buffer, drawbuffer, value);
+// }
+// static void glowClearNamedFramebufferiv(GPCLEARNAMEDFRAMEBUFFERIV fnptr, GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLint * value) {
+// (*fnptr)(framebuffer, buffer, drawbuffer, value);
+// }
+// static void glowClearNamedFramebufferuiv(GPCLEARNAMEDFRAMEBUFFERUIV fnptr, GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLuint * value) {
+// (*fnptr)(framebuffer, buffer, drawbuffer, value);
+// }
+// static void glowClearStencil(GPCLEARSTENCIL fnptr, GLint s) {
+// (*fnptr)(s);
+// }
+// static void glowClearTexImage(GPCLEARTEXIMAGE fnptr, GLuint texture, GLint level, GLenum format, GLenum type, const void * data) {
+// (*fnptr)(texture, level, format, type, data);
+// }
+// static void glowClearTexSubImage(GPCLEARTEXSUBIMAGE fnptr, GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void * data) {
+// (*fnptr)(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, data);
+// }
+// static void glowClientAttribDefaultEXT(GPCLIENTATTRIBDEFAULTEXT fnptr, GLbitfield mask) {
+// (*fnptr)(mask);
+// }
+// static GLenum glowClientWaitSync(GPCLIENTWAITSYNC fnptr, GLsync sync, GLbitfield flags, GLuint64 timeout) {
+// return (*fnptr)(sync, flags, timeout);
+// }
+// static void glowClipControl(GPCLIPCONTROL fnptr, GLenum origin, GLenum depth) {
+// (*fnptr)(origin, depth);
+// }
+// static void glowColorFormatNV(GPCOLORFORMATNV fnptr, GLint size, GLenum type, GLsizei stride) {
+// (*fnptr)(size, type, stride);
+// }
+// static void glowColorMask(GPCOLORMASK fnptr, GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha) {
+// (*fnptr)(red, green, blue, alpha);
+// }
+// static void glowColorMaski(GPCOLORMASKI fnptr, GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a) {
+// (*fnptr)(index, r, g, b, a);
+// }
+// static void glowCommandListSegmentsNV(GPCOMMANDLISTSEGMENTSNV fnptr, GLuint list, GLuint segments) {
+// (*fnptr)(list, segments);
+// }
+// static void glowCompileCommandListNV(GPCOMPILECOMMANDLISTNV fnptr, GLuint list) {
+// (*fnptr)(list);
+// }
+// static void glowCompileShader(GPCOMPILESHADER fnptr, GLuint shader) {
+// (*fnptr)(shader);
+// }
+// static void glowCompileShaderIncludeARB(GPCOMPILESHADERINCLUDEARB fnptr, GLuint shader, GLsizei count, const GLchar *const* path, const GLint * length) {
+// (*fnptr)(shader, count, path, length);
+// }
+// static void glowCompressedMultiTexImage1DEXT(GPCOMPRESSEDMULTITEXIMAGE1DEXT fnptr, GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void * bits) {
+// (*fnptr)(texunit, target, level, internalformat, width, border, imageSize, bits);
+// }
+// static void glowCompressedMultiTexImage2DEXT(GPCOMPRESSEDMULTITEXIMAGE2DEXT fnptr, GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void * bits) {
+// (*fnptr)(texunit, target, level, internalformat, width, height, border, imageSize, bits);
+// }
+// static void glowCompressedMultiTexImage3DEXT(GPCOMPRESSEDMULTITEXIMAGE3DEXT fnptr, GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void * bits) {
+// (*fnptr)(texunit, target, level, internalformat, width, height, depth, border, imageSize, bits);
+// }
+// static void glowCompressedMultiTexSubImage1DEXT(GPCOMPRESSEDMULTITEXSUBIMAGE1DEXT fnptr, GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void * bits) {
+// (*fnptr)(texunit, target, level, xoffset, width, format, imageSize, bits);
+// }
+// static void glowCompressedMultiTexSubImage2DEXT(GPCOMPRESSEDMULTITEXSUBIMAGE2DEXT fnptr, GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void * bits) {
+// (*fnptr)(texunit, target, level, xoffset, yoffset, width, height, format, imageSize, bits);
+// }
+// static void glowCompressedMultiTexSubImage3DEXT(GPCOMPRESSEDMULTITEXSUBIMAGE3DEXT fnptr, GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void * bits) {
+// (*fnptr)(texunit, target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, bits);
+// }
+// static void glowCompressedTexImage1D(GPCOMPRESSEDTEXIMAGE1D fnptr, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void * data) {
+// (*fnptr)(target, level, internalformat, width, border, imageSize, data);
+// }
+// static void glowCompressedTexImage2D(GPCOMPRESSEDTEXIMAGE2D fnptr, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void * data) {
+// (*fnptr)(target, level, internalformat, width, height, border, imageSize, data);
+// }
+// static void glowCompressedTexImage3D(GPCOMPRESSEDTEXIMAGE3D fnptr, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void * data) {
+// (*fnptr)(target, level, internalformat, width, height, depth, border, imageSize, data);
+// }
+// static void glowCompressedTexSubImage1D(GPCOMPRESSEDTEXSUBIMAGE1D fnptr, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void * data) {
+// (*fnptr)(target, level, xoffset, width, format, imageSize, data);
+// }
+// static void glowCompressedTexSubImage2D(GPCOMPRESSEDTEXSUBIMAGE2D fnptr, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void * data) {
+// (*fnptr)(target, level, xoffset, yoffset, width, height, format, imageSize, data);
+// }
+// static void glowCompressedTexSubImage3D(GPCOMPRESSEDTEXSUBIMAGE3D fnptr, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void * data) {
+// (*fnptr)(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data);
+// }
+// static void glowCompressedTextureImage1DEXT(GPCOMPRESSEDTEXTUREIMAGE1DEXT fnptr, GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void * bits) {
+// (*fnptr)(texture, target, level, internalformat, width, border, imageSize, bits);
+// }
+// static void glowCompressedTextureImage2DEXT(GPCOMPRESSEDTEXTUREIMAGE2DEXT fnptr, GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void * bits) {
+// (*fnptr)(texture, target, level, internalformat, width, height, border, imageSize, bits);
+// }
+// static void glowCompressedTextureImage3DEXT(GPCOMPRESSEDTEXTUREIMAGE3DEXT fnptr, GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void * bits) {
+// (*fnptr)(texture, target, level, internalformat, width, height, depth, border, imageSize, bits);
+// }
+// static void glowCompressedTextureSubImage1D(GPCOMPRESSEDTEXTURESUBIMAGE1D fnptr, GLuint texture, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void * data) {
+// (*fnptr)(texture, level, xoffset, width, format, imageSize, data);
+// }
+// static void glowCompressedTextureSubImage1DEXT(GPCOMPRESSEDTEXTURESUBIMAGE1DEXT fnptr, GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void * bits) {
+// (*fnptr)(texture, target, level, xoffset, width, format, imageSize, bits);
+// }
+// static void glowCompressedTextureSubImage2D(GPCOMPRESSEDTEXTURESUBIMAGE2D fnptr, GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void * data) {
+// (*fnptr)(texture, level, xoffset, yoffset, width, height, format, imageSize, data);
+// }
+// static void glowCompressedTextureSubImage2DEXT(GPCOMPRESSEDTEXTURESUBIMAGE2DEXT fnptr, GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void * bits) {
+// (*fnptr)(texture, target, level, xoffset, yoffset, width, height, format, imageSize, bits);
+// }
+// static void glowCompressedTextureSubImage3D(GPCOMPRESSEDTEXTURESUBIMAGE3D fnptr, GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void * data) {
+// (*fnptr)(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data);
+// }
+// static void glowCompressedTextureSubImage3DEXT(GPCOMPRESSEDTEXTURESUBIMAGE3DEXT fnptr, GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void * bits) {
+// (*fnptr)(texture, target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, bits);
+// }
+// static void glowConservativeRasterParameterfNV(GPCONSERVATIVERASTERPARAMETERFNV fnptr, GLenum pname, GLfloat value) {
+// (*fnptr)(pname, value);
+// }
+// static void glowConservativeRasterParameteriNV(GPCONSERVATIVERASTERPARAMETERINV fnptr, GLenum pname, GLint param) {
+// (*fnptr)(pname, param);
+// }
+// static void glowCopyBufferSubData(GPCOPYBUFFERSUBDATA fnptr, GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size) {
+// (*fnptr)(readTarget, writeTarget, readOffset, writeOffset, size);
+// }
+// static void glowCopyImageSubData(GPCOPYIMAGESUBDATA fnptr, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth) {
+// (*fnptr)(srcName, srcTarget, srcLevel, srcX, srcY, srcZ, dstName, dstTarget, dstLevel, dstX, dstY, dstZ, srcWidth, srcHeight, srcDepth);
+// }
+// static void glowCopyMultiTexImage1DEXT(GPCOPYMULTITEXIMAGE1DEXT fnptr, GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border) {
+// (*fnptr)(texunit, target, level, internalformat, x, y, width, border);
+// }
+// static void glowCopyMultiTexImage2DEXT(GPCOPYMULTITEXIMAGE2DEXT fnptr, GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) {
+// (*fnptr)(texunit, target, level, internalformat, x, y, width, height, border);
+// }
+// static void glowCopyMultiTexSubImage1DEXT(GPCOPYMULTITEXSUBIMAGE1DEXT fnptr, GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width) {
+// (*fnptr)(texunit, target, level, xoffset, x, y, width);
+// }
+// static void glowCopyMultiTexSubImage2DEXT(GPCOPYMULTITEXSUBIMAGE2DEXT fnptr, GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) {
+// (*fnptr)(texunit, target, level, xoffset, yoffset, x, y, width, height);
+// }
+// static void glowCopyMultiTexSubImage3DEXT(GPCOPYMULTITEXSUBIMAGE3DEXT fnptr, GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height) {
+// (*fnptr)(texunit, target, level, xoffset, yoffset, zoffset, x, y, width, height);
+// }
+// static void glowCopyNamedBufferSubData(GPCOPYNAMEDBUFFERSUBDATA fnptr, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size) {
+// (*fnptr)(readBuffer, writeBuffer, readOffset, writeOffset, size);
+// }
+// static void glowCopyPathNV(GPCOPYPATHNV fnptr, GLuint resultPath, GLuint srcPath) {
+// (*fnptr)(resultPath, srcPath);
+// }
+// static void glowCopyTexImage1D(GPCOPYTEXIMAGE1D fnptr, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border) {
+// (*fnptr)(target, level, internalformat, x, y, width, border);
+// }
+// static void glowCopyTexImage2D(GPCOPYTEXIMAGE2D fnptr, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) {
+// (*fnptr)(target, level, internalformat, x, y, width, height, border);
+// }
+// static void glowCopyTexSubImage1D(GPCOPYTEXSUBIMAGE1D fnptr, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width) {
+// (*fnptr)(target, level, xoffset, x, y, width);
+// }
+// static void glowCopyTexSubImage2D(GPCOPYTEXSUBIMAGE2D fnptr, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) {
+// (*fnptr)(target, level, xoffset, yoffset, x, y, width, height);
+// }
+// static void glowCopyTexSubImage3D(GPCOPYTEXSUBIMAGE3D fnptr, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height) {
+// (*fnptr)(target, level, xoffset, yoffset, zoffset, x, y, width, height);
+// }
+// static void glowCopyTextureImage1DEXT(GPCOPYTEXTUREIMAGE1DEXT fnptr, GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border) {
+// (*fnptr)(texture, target, level, internalformat, x, y, width, border);
+// }
+// static void glowCopyTextureImage2DEXT(GPCOPYTEXTUREIMAGE2DEXT fnptr, GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) {
+// (*fnptr)(texture, target, level, internalformat, x, y, width, height, border);
+// }
+// static void glowCopyTextureSubImage1D(GPCOPYTEXTURESUBIMAGE1D fnptr, GLuint texture, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width) {
+// (*fnptr)(texture, level, xoffset, x, y, width);
+// }
+// static void glowCopyTextureSubImage1DEXT(GPCOPYTEXTURESUBIMAGE1DEXT fnptr, GLuint texture, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width) {
+// (*fnptr)(texture, target, level, xoffset, x, y, width);
+// }
+// static void glowCopyTextureSubImage2D(GPCOPYTEXTURESUBIMAGE2D fnptr, GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) {
+// (*fnptr)(texture, level, xoffset, yoffset, x, y, width, height);
+// }
+// static void glowCopyTextureSubImage2DEXT(GPCOPYTEXTURESUBIMAGE2DEXT fnptr, GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) {
+// (*fnptr)(texture, target, level, xoffset, yoffset, x, y, width, height);
+// }
+// static void glowCopyTextureSubImage3D(GPCOPYTEXTURESUBIMAGE3D fnptr, GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height) {
+// (*fnptr)(texture, level, xoffset, yoffset, zoffset, x, y, width, height);
+// }
+// static void glowCopyTextureSubImage3DEXT(GPCOPYTEXTURESUBIMAGE3DEXT fnptr, GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height) {
+// (*fnptr)(texture, target, level, xoffset, yoffset, zoffset, x, y, width, height);
+// }
+// static void glowCoverFillPathInstancedNV(GPCOVERFILLPATHINSTANCEDNV fnptr, GLsizei numPaths, GLenum pathNameType, const void * paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat * transformValues) {
+// (*fnptr)(numPaths, pathNameType, paths, pathBase, coverMode, transformType, transformValues);
+// }
+// static void glowCoverFillPathNV(GPCOVERFILLPATHNV fnptr, GLuint path, GLenum coverMode) {
+// (*fnptr)(path, coverMode);
+// }
+// static void glowCoverStrokePathInstancedNV(GPCOVERSTROKEPATHINSTANCEDNV fnptr, GLsizei numPaths, GLenum pathNameType, const void * paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat * transformValues) {
+// (*fnptr)(numPaths, pathNameType, paths, pathBase, coverMode, transformType, transformValues);
+// }
+// static void glowCoverStrokePathNV(GPCOVERSTROKEPATHNV fnptr, GLuint path, GLenum coverMode) {
+// (*fnptr)(path, coverMode);
+// }
+// static void glowCoverageModulationNV(GPCOVERAGEMODULATIONNV fnptr, GLenum components) {
+// (*fnptr)(components);
+// }
+// static void glowCoverageModulationTableNV(GPCOVERAGEMODULATIONTABLENV fnptr, GLsizei n, const GLfloat * v) {
+// (*fnptr)(n, v);
+// }
+// static void glowCreateBuffers(GPCREATEBUFFERS fnptr, GLsizei n, GLuint * buffers) {
+// (*fnptr)(n, buffers);
+// }
+// static void glowCreateCommandListsNV(GPCREATECOMMANDLISTSNV fnptr, GLsizei n, GLuint * lists) {
+// (*fnptr)(n, lists);
+// }
+// static void glowCreateFramebuffers(GPCREATEFRAMEBUFFERS fnptr, GLsizei n, GLuint * framebuffers) {
+// (*fnptr)(n, framebuffers);
+// }
+// static void glowCreatePerfQueryINTEL(GPCREATEPERFQUERYINTEL fnptr, GLuint queryId, GLuint * queryHandle) {
+// (*fnptr)(queryId, queryHandle);
+// }
+// static GLuint glowCreateProgram(GPCREATEPROGRAM fnptr) {
+// return (*fnptr)();
+// }
+// static void glowCreateProgramPipelines(GPCREATEPROGRAMPIPELINES fnptr, GLsizei n, GLuint * pipelines) {
+// (*fnptr)(n, pipelines);
+// }
+// static void glowCreateQueries(GPCREATEQUERIES fnptr, GLenum target, GLsizei n, GLuint * ids) {
+// (*fnptr)(target, n, ids);
+// }
+// static void glowCreateRenderbuffers(GPCREATERENDERBUFFERS fnptr, GLsizei n, GLuint * renderbuffers) {
+// (*fnptr)(n, renderbuffers);
+// }
+// static void glowCreateSamplers(GPCREATESAMPLERS fnptr, GLsizei n, GLuint * samplers) {
+// (*fnptr)(n, samplers);
+// }
+// static GLuint glowCreateShader(GPCREATESHADER fnptr, GLenum type) {
+// return (*fnptr)(type);
+// }
+// static GLuint glowCreateShaderProgramEXT(GPCREATESHADERPROGRAMEXT fnptr, GLenum type, const GLchar * string) {
+// return (*fnptr)(type, string);
+// }
+// static GLuint glowCreateShaderProgramv(GPCREATESHADERPROGRAMV fnptr, GLenum type, GLsizei count, const GLchar *const* strings) {
+// return (*fnptr)(type, count, strings);
+// }
+// static GLuint glowCreateShaderProgramvEXT(GPCREATESHADERPROGRAMVEXT fnptr, GLenum type, GLsizei count, const GLchar ** strings) {
+// return (*fnptr)(type, count, strings);
+// }
+// static void glowCreateStatesNV(GPCREATESTATESNV fnptr, GLsizei n, GLuint * states) {
+// (*fnptr)(n, states);
+// }
+// static GLsync glowCreateSyncFromCLeventARB(GPCREATESYNCFROMCLEVENTARB fnptr, struct _cl_context * context, struct _cl_event * event, GLbitfield flags) {
+// return (*fnptr)(context, event, flags);
+// }
+// static void glowCreateTextures(GPCREATETEXTURES fnptr, GLenum target, GLsizei n, GLuint * textures) {
+// (*fnptr)(target, n, textures);
+// }
+// static void glowCreateTransformFeedbacks(GPCREATETRANSFORMFEEDBACKS fnptr, GLsizei n, GLuint * ids) {
+// (*fnptr)(n, ids);
+// }
+// static void glowCreateVertexArrays(GPCREATEVERTEXARRAYS fnptr, GLsizei n, GLuint * arrays) {
+// (*fnptr)(n, arrays);
+// }
+// static void glowCullFace(GPCULLFACE fnptr, GLenum mode) {
+// (*fnptr)(mode);
+// }
+// static void glowDebugMessageCallback(GPDEBUGMESSAGECALLBACK fnptr, GLDEBUGPROC callback, const void * userParam) {
+// (*fnptr)(glowCDebugCallback, userParam);
+// }
+// static void glowDebugMessageCallbackARB(GPDEBUGMESSAGECALLBACKARB fnptr, GLDEBUGPROCARB callback, const void * userParam) {
+// (*fnptr)(glowCDebugCallback, userParam);
+// }
+// static void glowDebugMessageCallbackKHR(GPDEBUGMESSAGECALLBACKKHR fnptr, GLDEBUGPROCKHR callback, const void * userParam) {
+// (*fnptr)(glowCDebugCallback, userParam);
+// }
+// static void glowDebugMessageControl(GPDEBUGMESSAGECONTROL fnptr, GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint * ids, GLboolean enabled) {
+// (*fnptr)(source, type, severity, count, ids, enabled);
+// }
+// static void glowDebugMessageControlARB(GPDEBUGMESSAGECONTROLARB fnptr, GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint * ids, GLboolean enabled) {
+// (*fnptr)(source, type, severity, count, ids, enabled);
+// }
+// static void glowDebugMessageControlKHR(GPDEBUGMESSAGECONTROLKHR fnptr, GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint * ids, GLboolean enabled) {
+// (*fnptr)(source, type, severity, count, ids, enabled);
+// }
+// static void glowDebugMessageInsert(GPDEBUGMESSAGEINSERT fnptr, GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar * buf) {
+// (*fnptr)(source, type, id, severity, length, buf);
+// }
+// static void glowDebugMessageInsertARB(GPDEBUGMESSAGEINSERTARB fnptr, GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar * buf) {
+// (*fnptr)(source, type, id, severity, length, buf);
+// }
+// static void glowDebugMessageInsertKHR(GPDEBUGMESSAGEINSERTKHR fnptr, GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar * buf) {
+// (*fnptr)(source, type, id, severity, length, buf);
+// }
+// static void glowDeleteBuffers(GPDELETEBUFFERS fnptr, GLsizei n, const GLuint * buffers) {
+// (*fnptr)(n, buffers);
+// }
+// static void glowDeleteCommandListsNV(GPDELETECOMMANDLISTSNV fnptr, GLsizei n, const GLuint * lists) {
+// (*fnptr)(n, lists);
+// }
+// static void glowDeleteFramebuffers(GPDELETEFRAMEBUFFERS fnptr, GLsizei n, const GLuint * framebuffers) {
+// (*fnptr)(n, framebuffers);
+// }
+// static void glowDeleteNamedStringARB(GPDELETENAMEDSTRINGARB fnptr, GLint namelen, const GLchar * name) {
+// (*fnptr)(namelen, name);
+// }
+// static void glowDeletePathsNV(GPDELETEPATHSNV fnptr, GLuint path, GLsizei range) {
+// (*fnptr)(path, range);
+// }
+// static void glowDeletePerfMonitorsAMD(GPDELETEPERFMONITORSAMD fnptr, GLsizei n, GLuint * monitors) {
+// (*fnptr)(n, monitors);
+// }
+// static void glowDeletePerfQueryINTEL(GPDELETEPERFQUERYINTEL fnptr, GLuint queryHandle) {
+// (*fnptr)(queryHandle);
+// }
+// static void glowDeleteProgram(GPDELETEPROGRAM fnptr, GLuint program) {
+// (*fnptr)(program);
+// }
+// static void glowDeleteProgramPipelines(GPDELETEPROGRAMPIPELINES fnptr, GLsizei n, const GLuint * pipelines) {
+// (*fnptr)(n, pipelines);
+// }
+// static void glowDeleteProgramPipelinesEXT(GPDELETEPROGRAMPIPELINESEXT fnptr, GLsizei n, const GLuint * pipelines) {
+// (*fnptr)(n, pipelines);
+// }
+// static void glowDeleteQueries(GPDELETEQUERIES fnptr, GLsizei n, const GLuint * ids) {
+// (*fnptr)(n, ids);
+// }
+// static void glowDeleteRenderbuffers(GPDELETERENDERBUFFERS fnptr, GLsizei n, const GLuint * renderbuffers) {
+// (*fnptr)(n, renderbuffers);
+// }
+// static void glowDeleteSamplers(GPDELETESAMPLERS fnptr, GLsizei count, const GLuint * samplers) {
+// (*fnptr)(count, samplers);
+// }
+// static void glowDeleteShader(GPDELETESHADER fnptr, GLuint shader) {
+// (*fnptr)(shader);
+// }
+// static void glowDeleteStatesNV(GPDELETESTATESNV fnptr, GLsizei n, const GLuint * states) {
+// (*fnptr)(n, states);
+// }
+// static void glowDeleteSync(GPDELETESYNC fnptr, GLsync sync) {
+// (*fnptr)(sync);
+// }
+// static void glowDeleteTextures(GPDELETETEXTURES fnptr, GLsizei n, const GLuint * textures) {
+// (*fnptr)(n, textures);
+// }
+// static void glowDeleteTransformFeedbacks(GPDELETETRANSFORMFEEDBACKS fnptr, GLsizei n, const GLuint * ids) {
+// (*fnptr)(n, ids);
+// }
+// static void glowDeleteVertexArrays(GPDELETEVERTEXARRAYS fnptr, GLsizei n, const GLuint * arrays) {
+// (*fnptr)(n, arrays);
+// }
+// static void glowDepthBoundsdNV(GPDEPTHBOUNDSDNV fnptr, GLdouble zmin, GLdouble zmax) {
+// (*fnptr)(zmin, zmax);
+// }
+// static void glowDepthFunc(GPDEPTHFUNC fnptr, GLenum func) {
+// (*fnptr)(func);
+// }
+// static void glowDepthMask(GPDEPTHMASK fnptr, GLboolean flag) {
+// (*fnptr)(flag);
+// }
+// static void glowDepthRange(GPDEPTHRANGE fnptr, GLdouble n, GLdouble f) {
+// (*fnptr)(n, f);
+// }
+// static void glowDepthRangeArraydvNV(GPDEPTHRANGEARRAYDVNV fnptr, GLuint first, GLsizei count, const GLdouble * v) {
+// (*fnptr)(first, count, v);
+// }
+// static void glowDepthRangeArrayv(GPDEPTHRANGEARRAYV fnptr, GLuint first, GLsizei count, const GLdouble * v) {
+// (*fnptr)(first, count, v);
+// }
+// static void glowDepthRangeIndexed(GPDEPTHRANGEINDEXED fnptr, GLuint index, GLdouble n, GLdouble f) {
+// (*fnptr)(index, n, f);
+// }
+// static void glowDepthRangeIndexeddNV(GPDEPTHRANGEINDEXEDDNV fnptr, GLuint index, GLdouble n, GLdouble f) {
+// (*fnptr)(index, n, f);
+// }
+// static void glowDepthRangedNV(GPDEPTHRANGEDNV fnptr, GLdouble zNear, GLdouble zFar) {
+// (*fnptr)(zNear, zFar);
+// }
+// static void glowDepthRangef(GPDEPTHRANGEF fnptr, GLfloat n, GLfloat f) {
+// (*fnptr)(n, f);
+// }
+// static void glowDetachShader(GPDETACHSHADER fnptr, GLuint program, GLuint shader) {
+// (*fnptr)(program, shader);
+// }
+// static void glowDisable(GPDISABLE fnptr, GLenum cap) {
+// (*fnptr)(cap);
+// }
+// static void glowDisableClientStateIndexedEXT(GPDISABLECLIENTSTATEINDEXEDEXT fnptr, GLenum array, GLuint index) {
+// (*fnptr)(array, index);
+// }
+// static void glowDisableClientStateiEXT(GPDISABLECLIENTSTATEIEXT fnptr, GLenum array, GLuint index) {
+// (*fnptr)(array, index);
+// }
+// static void glowDisableIndexedEXT(GPDISABLEINDEXEDEXT fnptr, GLenum target, GLuint index) {
+// (*fnptr)(target, index);
+// }
+// static void glowDisableVertexArrayAttrib(GPDISABLEVERTEXARRAYATTRIB fnptr, GLuint vaobj, GLuint index) {
+// (*fnptr)(vaobj, index);
+// }
+// static void glowDisableVertexArrayAttribEXT(GPDISABLEVERTEXARRAYATTRIBEXT fnptr, GLuint vaobj, GLuint index) {
+// (*fnptr)(vaobj, index);
+// }
+// static void glowDisableVertexArrayEXT(GPDISABLEVERTEXARRAYEXT fnptr, GLuint vaobj, GLenum array) {
+// (*fnptr)(vaobj, array);
+// }
+// static void glowDisableVertexAttribArray(GPDISABLEVERTEXATTRIBARRAY fnptr, GLuint index) {
+// (*fnptr)(index);
+// }
+// static void glowDisablei(GPDISABLEI fnptr, GLenum target, GLuint index) {
+// (*fnptr)(target, index);
+// }
+// static void glowDispatchCompute(GPDISPATCHCOMPUTE fnptr, GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z) {
+// (*fnptr)(num_groups_x, num_groups_y, num_groups_z);
+// }
+// static void glowDispatchComputeGroupSizeARB(GPDISPATCHCOMPUTEGROUPSIZEARB fnptr, GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z, GLuint group_size_x, GLuint group_size_y, GLuint group_size_z) {
+// (*fnptr)(num_groups_x, num_groups_y, num_groups_z, group_size_x, group_size_y, group_size_z);
+// }
+// static void glowDispatchComputeIndirect(GPDISPATCHCOMPUTEINDIRECT fnptr, GLintptr indirect) {
+// (*fnptr)(indirect);
+// }
+// static void glowDrawArrays(GPDRAWARRAYS fnptr, GLenum mode, GLint first, GLsizei count) {
+// (*fnptr)(mode, first, count);
+// }
+// static void glowDrawArraysIndirect(GPDRAWARRAYSINDIRECT fnptr, GLenum mode, const void * indirect) {
+// (*fnptr)(mode, indirect);
+// }
+// static void glowDrawArraysInstanced(GPDRAWARRAYSINSTANCED fnptr, GLenum mode, GLint first, GLsizei count, GLsizei instancecount) {
+// (*fnptr)(mode, first, count, instancecount);
+// }
+// static void glowDrawArraysInstancedARB(GPDRAWARRAYSINSTANCEDARB fnptr, GLenum mode, GLint first, GLsizei count, GLsizei primcount) {
+// (*fnptr)(mode, first, count, primcount);
+// }
+// static void glowDrawArraysInstancedBaseInstance(GPDRAWARRAYSINSTANCEDBASEINSTANCE fnptr, GLenum mode, GLint first, GLsizei count, GLsizei instancecount, GLuint baseinstance) {
+// (*fnptr)(mode, first, count, instancecount, baseinstance);
+// }
+// static void glowDrawArraysInstancedEXT(GPDRAWARRAYSINSTANCEDEXT fnptr, GLenum mode, GLint start, GLsizei count, GLsizei primcount) {
+// (*fnptr)(mode, start, count, primcount);
+// }
+// static void glowDrawBuffer(GPDRAWBUFFER fnptr, GLenum buf) {
+// (*fnptr)(buf);
+// }
+// static void glowDrawBuffers(GPDRAWBUFFERS fnptr, GLsizei n, const GLenum * bufs) {
+// (*fnptr)(n, bufs);
+// }
+// static void glowDrawCommandsAddressNV(GPDRAWCOMMANDSADDRESSNV fnptr, GLenum primitiveMode, const GLuint64 * indirects, const GLsizei * sizes, GLuint count) {
+// (*fnptr)(primitiveMode, indirects, sizes, count);
+// }
+// static void glowDrawCommandsNV(GPDRAWCOMMANDSNV fnptr, GLenum primitiveMode, GLuint buffer, const GLintptr * indirects, const GLsizei * sizes, GLuint count) {
+// (*fnptr)(primitiveMode, buffer, indirects, sizes, count);
+// }
+// static void glowDrawCommandsStatesAddressNV(GPDRAWCOMMANDSSTATESADDRESSNV fnptr, const GLuint64 * indirects, const GLsizei * sizes, const GLuint * states, const GLuint * fbos, GLuint count) {
+// (*fnptr)(indirects, sizes, states, fbos, count);
+// }
+// static void glowDrawCommandsStatesNV(GPDRAWCOMMANDSSTATESNV fnptr, GLuint buffer, const GLintptr * indirects, const GLsizei * sizes, const GLuint * states, const GLuint * fbos, GLuint count) {
+// (*fnptr)(buffer, indirects, sizes, states, fbos, count);
+// }
+// static void glowDrawElements(GPDRAWELEMENTS fnptr, GLenum mode, GLsizei count, GLenum type, const void * indices) {
+// (*fnptr)(mode, count, type, indices);
+// }
+// static void glowDrawElementsWithOffset(GPDRAWELEMENTS fnptr, GLenum mode, GLsizei count, GLenum type, uintptr_t indices) {
+// (*fnptr)(mode, count, type, (const void *)(indices));
+// }
+// static void glowDrawElementsBaseVertex(GPDRAWELEMENTSBASEVERTEX fnptr, GLenum mode, GLsizei count, GLenum type, const void * indices, GLint basevertex) {
+// (*fnptr)(mode, count, type, indices, basevertex);
+// }
+// static void glowDrawElementsBaseVertexWithOffset(GPDRAWELEMENTSBASEVERTEX fnptr, GLenum mode, GLsizei count, GLenum type, uintptr_t indices, GLint basevertex) {
+// (*fnptr)(mode, count, type, (const void *)(indices), basevertex);
+// }
+// static void glowDrawElementsIndirect(GPDRAWELEMENTSINDIRECT fnptr, GLenum mode, GLenum type, const void * indirect) {
+// (*fnptr)(mode, type, indirect);
+// }
+// static void glowDrawElementsInstanced(GPDRAWELEMENTSINSTANCED fnptr, GLenum mode, GLsizei count, GLenum type, const void * indices, GLsizei instancecount) {
+// (*fnptr)(mode, count, type, indices, instancecount);
+// }
+// static void glowDrawElementsInstancedARB(GPDRAWELEMENTSINSTANCEDARB fnptr, GLenum mode, GLsizei count, GLenum type, const void * indices, GLsizei primcount) {
+// (*fnptr)(mode, count, type, indices, primcount);
+// }
+// static void glowDrawElementsInstancedBaseInstance(GPDRAWELEMENTSINSTANCEDBASEINSTANCE fnptr, GLenum mode, GLsizei count, GLenum type, const void * indices, GLsizei instancecount, GLuint baseinstance) {
+// (*fnptr)(mode, count, type, indices, instancecount, baseinstance);
+// }
+// static void glowDrawElementsInstancedBaseVertex(GPDRAWELEMENTSINSTANCEDBASEVERTEX fnptr, GLenum mode, GLsizei count, GLenum type, const void * indices, GLsizei instancecount, GLint basevertex) {
+// (*fnptr)(mode, count, type, indices, instancecount, basevertex);
+// }
+// static void glowDrawElementsInstancedBaseVertexBaseInstance(GPDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCE fnptr, GLenum mode, GLsizei count, GLenum type, const void * indices, GLsizei instancecount, GLint basevertex, GLuint baseinstance) {
+// (*fnptr)(mode, count, type, indices, instancecount, basevertex, baseinstance);
+// }
+// static void glowDrawElementsInstancedEXT(GPDRAWELEMENTSINSTANCEDEXT fnptr, GLenum mode, GLsizei count, GLenum type, const void * indices, GLsizei primcount) {
+// (*fnptr)(mode, count, type, indices, primcount);
+// }
+// static void glowDrawMeshTasksIndirectNV(GPDRAWMESHTASKSINDIRECTNV fnptr, GLintptr indirect) {
+// (*fnptr)(indirect);
+// }
+// static void glowDrawMeshTasksNV(GPDRAWMESHTASKSNV fnptr, GLuint first, GLuint count) {
+// (*fnptr)(first, count);
+// }
+// static void glowDrawRangeElements(GPDRAWRANGEELEMENTS fnptr, GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void * indices) {
+// (*fnptr)(mode, start, end, count, type, indices);
+// }
+// static void glowDrawRangeElementsBaseVertex(GPDRAWRANGEELEMENTSBASEVERTEX fnptr, GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void * indices, GLint basevertex) {
+// (*fnptr)(mode, start, end, count, type, indices, basevertex);
+// }
+// static void glowDrawTransformFeedback(GPDRAWTRANSFORMFEEDBACK fnptr, GLenum mode, GLuint id) {
+// (*fnptr)(mode, id);
+// }
+// static void glowDrawTransformFeedbackInstanced(GPDRAWTRANSFORMFEEDBACKINSTANCED fnptr, GLenum mode, GLuint id, GLsizei instancecount) {
+// (*fnptr)(mode, id, instancecount);
+// }
+// static void glowDrawTransformFeedbackStream(GPDRAWTRANSFORMFEEDBACKSTREAM fnptr, GLenum mode, GLuint id, GLuint stream) {
+// (*fnptr)(mode, id, stream);
+// }
+// static void glowDrawTransformFeedbackStreamInstanced(GPDRAWTRANSFORMFEEDBACKSTREAMINSTANCED fnptr, GLenum mode, GLuint id, GLuint stream, GLsizei instancecount) {
+// (*fnptr)(mode, id, stream, instancecount);
+// }
+// static void glowDrawVkImageNV(GPDRAWVKIMAGENV fnptr, GLuint64 vkImage, GLuint sampler, GLfloat x0, GLfloat y0, GLfloat x1, GLfloat y1, GLfloat z, GLfloat s0, GLfloat t0, GLfloat s1, GLfloat t1) {
+// (*fnptr)(vkImage, sampler, x0, y0, x1, y1, z, s0, t0, s1, t1);
+// }
+// static void glowEGLImageTargetTexStorageEXT(GPEGLIMAGETARGETTEXSTORAGEEXT fnptr, GLenum target, GLeglImageOES image, const GLint* attrib_list) {
+// (*fnptr)(target, image, attrib_list);
+// }
+// static void glowEGLImageTargetTextureStorageEXT(GPEGLIMAGETARGETTEXTURESTORAGEEXT fnptr, GLuint texture, GLeglImageOES image, const GLint* attrib_list) {
+// (*fnptr)(texture, image, attrib_list);
+// }
+// static void glowEdgeFlagFormatNV(GPEDGEFLAGFORMATNV fnptr, GLsizei stride) {
+// (*fnptr)(stride);
+// }
+// static void glowEnable(GPENABLE fnptr, GLenum cap) {
+// (*fnptr)(cap);
+// }
+// static void glowEnableClientStateIndexedEXT(GPENABLECLIENTSTATEINDEXEDEXT fnptr, GLenum array, GLuint index) {
+// (*fnptr)(array, index);
+// }
+// static void glowEnableClientStateiEXT(GPENABLECLIENTSTATEIEXT fnptr, GLenum array, GLuint index) {
+// (*fnptr)(array, index);
+// }
+// static void glowEnableIndexedEXT(GPENABLEINDEXEDEXT fnptr, GLenum target, GLuint index) {
+// (*fnptr)(target, index);
+// }
+// static void glowEnableVertexArrayAttrib(GPENABLEVERTEXARRAYATTRIB fnptr, GLuint vaobj, GLuint index) {
+// (*fnptr)(vaobj, index);
+// }
+// static void glowEnableVertexArrayAttribEXT(GPENABLEVERTEXARRAYATTRIBEXT fnptr, GLuint vaobj, GLuint index) {
+// (*fnptr)(vaobj, index);
+// }
+// static void glowEnableVertexArrayEXT(GPENABLEVERTEXARRAYEXT fnptr, GLuint vaobj, GLenum array) {
+// (*fnptr)(vaobj, array);
+// }
+// static void glowEnableVertexAttribArray(GPENABLEVERTEXATTRIBARRAY fnptr, GLuint index) {
+// (*fnptr)(index);
+// }
+// static void glowEnablei(GPENABLEI fnptr, GLenum target, GLuint index) {
+// (*fnptr)(target, index);
+// }
+// static void glowEndConditionalRender(GPENDCONDITIONALRENDER fnptr) {
+// (*fnptr)();
+// }
+// static void glowEndConditionalRenderNV(GPENDCONDITIONALRENDERNV fnptr) {
+// (*fnptr)();
+// }
+// static void glowEndPerfMonitorAMD(GPENDPERFMONITORAMD fnptr, GLuint monitor) {
+// (*fnptr)(monitor);
+// }
+// static void glowEndPerfQueryINTEL(GPENDPERFQUERYINTEL fnptr, GLuint queryHandle) {
+// (*fnptr)(queryHandle);
+// }
+// static void glowEndQuery(GPENDQUERY fnptr, GLenum target) {
+// (*fnptr)(target);
+// }
+// static void glowEndQueryIndexed(GPENDQUERYINDEXED fnptr, GLenum target, GLuint index) {
+// (*fnptr)(target, index);
+// }
+// static void glowEndTransformFeedback(GPENDTRANSFORMFEEDBACK fnptr) {
+// (*fnptr)();
+// }
+// static void glowEvaluateDepthValuesARB(GPEVALUATEDEPTHVALUESARB fnptr) {
+// (*fnptr)();
+// }
+// static GLsync glowFenceSync(GPFENCESYNC fnptr, GLenum condition, GLbitfield flags) {
+// return (*fnptr)(condition, flags);
+// }
+// static void glowFinish(GPFINISH fnptr) {
+// (*fnptr)();
+// }
+// static void glowFlush(GPFLUSH fnptr) {
+// (*fnptr)();
+// }
+// static void glowFlushMappedBufferRange(GPFLUSHMAPPEDBUFFERRANGE fnptr, GLenum target, GLintptr offset, GLsizeiptr length) {
+// (*fnptr)(target, offset, length);
+// }
+// static void glowFlushMappedNamedBufferRange(GPFLUSHMAPPEDNAMEDBUFFERRANGE fnptr, GLuint buffer, GLintptr offset, GLsizeiptr length) {
+// (*fnptr)(buffer, offset, length);
+// }
+// static void glowFlushMappedNamedBufferRangeEXT(GPFLUSHMAPPEDNAMEDBUFFERRANGEEXT fnptr, GLuint buffer, GLintptr offset, GLsizeiptr length) {
+// (*fnptr)(buffer, offset, length);
+// }
+// static void glowFogCoordFormatNV(GPFOGCOORDFORMATNV fnptr, GLenum type, GLsizei stride) {
+// (*fnptr)(type, stride);
+// }
+// static void glowFragmentCoverageColorNV(GPFRAGMENTCOVERAGECOLORNV fnptr, GLuint color) {
+// (*fnptr)(color);
+// }
+// static void glowFramebufferDrawBufferEXT(GPFRAMEBUFFERDRAWBUFFEREXT fnptr, GLuint framebuffer, GLenum mode) {
+// (*fnptr)(framebuffer, mode);
+// }
+// static void glowFramebufferDrawBuffersEXT(GPFRAMEBUFFERDRAWBUFFERSEXT fnptr, GLuint framebuffer, GLsizei n, const GLenum * bufs) {
+// (*fnptr)(framebuffer, n, bufs);
+// }
+// static void glowFramebufferFetchBarrierEXT(GPFRAMEBUFFERFETCHBARRIEREXT fnptr) {
+// (*fnptr)();
+// }
+// static void glowFramebufferParameteri(GPFRAMEBUFFERPARAMETERI fnptr, GLenum target, GLenum pname, GLint param) {
+// (*fnptr)(target, pname, param);
+// }
+// static void glowFramebufferParameteriMESA(GPFRAMEBUFFERPARAMETERIMESA fnptr, GLenum target, GLenum pname, GLint param) {
+// (*fnptr)(target, pname, param);
+// }
+// static void glowFramebufferReadBufferEXT(GPFRAMEBUFFERREADBUFFEREXT fnptr, GLuint framebuffer, GLenum mode) {
+// (*fnptr)(framebuffer, mode);
+// }
+// static void glowFramebufferRenderbuffer(GPFRAMEBUFFERRENDERBUFFER fnptr, GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) {
+// (*fnptr)(target, attachment, renderbuffertarget, renderbuffer);
+// }
+// static void glowFramebufferSampleLocationsfvARB(GPFRAMEBUFFERSAMPLELOCATIONSFVARB fnptr, GLenum target, GLuint start, GLsizei count, const GLfloat * v) {
+// (*fnptr)(target, start, count, v);
+// }
+// static void glowFramebufferSampleLocationsfvNV(GPFRAMEBUFFERSAMPLELOCATIONSFVNV fnptr, GLenum target, GLuint start, GLsizei count, const GLfloat * v) {
+// (*fnptr)(target, start, count, v);
+// }
+// static void glowFramebufferTexture(GPFRAMEBUFFERTEXTURE fnptr, GLenum target, GLenum attachment, GLuint texture, GLint level) {
+// (*fnptr)(target, attachment, texture, level);
+// }
+// static void glowFramebufferTexture1D(GPFRAMEBUFFERTEXTURE1D fnptr, GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) {
+// (*fnptr)(target, attachment, textarget, texture, level);
+// }
+// static void glowFramebufferTexture2D(GPFRAMEBUFFERTEXTURE2D fnptr, GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) {
+// (*fnptr)(target, attachment, textarget, texture, level);
+// }
+// static void glowFramebufferTexture3D(GPFRAMEBUFFERTEXTURE3D fnptr, GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset) {
+// (*fnptr)(target, attachment, textarget, texture, level, zoffset);
+// }
+// static void glowFramebufferTextureARB(GPFRAMEBUFFERTEXTUREARB fnptr, GLenum target, GLenum attachment, GLuint texture, GLint level) {
+// (*fnptr)(target, attachment, texture, level);
+// }
+// static void glowFramebufferTextureFaceARB(GPFRAMEBUFFERTEXTUREFACEARB fnptr, GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face) {
+// (*fnptr)(target, attachment, texture, level, face);
+// }
+// static void glowFramebufferTextureLayer(GPFRAMEBUFFERTEXTURELAYER fnptr, GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer) {
+// (*fnptr)(target, attachment, texture, level, layer);
+// }
+// static void glowFramebufferTextureLayerARB(GPFRAMEBUFFERTEXTURELAYERARB fnptr, GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer) {
+// (*fnptr)(target, attachment, texture, level, layer);
+// }
+// static void glowFramebufferTextureMultiviewOVR(GPFRAMEBUFFERTEXTUREMULTIVIEWOVR fnptr, GLenum target, GLenum attachment, GLuint texture, GLint level, GLint baseViewIndex, GLsizei numViews) {
+// (*fnptr)(target, attachment, texture, level, baseViewIndex, numViews);
+// }
+// static void glowFrontFace(GPFRONTFACE fnptr, GLenum mode) {
+// (*fnptr)(mode);
+// }
+// static void glowGenBuffers(GPGENBUFFERS fnptr, GLsizei n, GLuint * buffers) {
+// (*fnptr)(n, buffers);
+// }
+// static void glowGenFramebuffers(GPGENFRAMEBUFFERS fnptr, GLsizei n, GLuint * framebuffers) {
+// (*fnptr)(n, framebuffers);
+// }
+// static GLuint glowGenPathsNV(GPGENPATHSNV fnptr, GLsizei range) {
+// return (*fnptr)(range);
+// }
+// static void glowGenPerfMonitorsAMD(GPGENPERFMONITORSAMD fnptr, GLsizei n, GLuint * monitors) {
+// (*fnptr)(n, monitors);
+// }
+// static void glowGenProgramPipelines(GPGENPROGRAMPIPELINES fnptr, GLsizei n, GLuint * pipelines) {
+// (*fnptr)(n, pipelines);
+// }
+// static void glowGenProgramPipelinesEXT(GPGENPROGRAMPIPELINESEXT fnptr, GLsizei n, GLuint * pipelines) {
+// (*fnptr)(n, pipelines);
+// }
+// static void glowGenQueries(GPGENQUERIES fnptr, GLsizei n, GLuint * ids) {
+// (*fnptr)(n, ids);
+// }
+// static void glowGenRenderbuffers(GPGENRENDERBUFFERS fnptr, GLsizei n, GLuint * renderbuffers) {
+// (*fnptr)(n, renderbuffers);
+// }
+// static void glowGenSamplers(GPGENSAMPLERS fnptr, GLsizei count, GLuint * samplers) {
+// (*fnptr)(count, samplers);
+// }
+// static void glowGenTextures(GPGENTEXTURES fnptr, GLsizei n, GLuint * textures) {
+// (*fnptr)(n, textures);
+// }
+// static void glowGenTransformFeedbacks(GPGENTRANSFORMFEEDBACKS fnptr, GLsizei n, GLuint * ids) {
+// (*fnptr)(n, ids);
+// }
+// static void glowGenVertexArrays(GPGENVERTEXARRAYS fnptr, GLsizei n, GLuint * arrays) {
+// (*fnptr)(n, arrays);
+// }
+// static void glowGenerateMipmap(GPGENERATEMIPMAP fnptr, GLenum target) {
+// (*fnptr)(target);
+// }
+// static void glowGenerateMultiTexMipmapEXT(GPGENERATEMULTITEXMIPMAPEXT fnptr, GLenum texunit, GLenum target) {
+// (*fnptr)(texunit, target);
+// }
+// static void glowGenerateTextureMipmap(GPGENERATETEXTUREMIPMAP fnptr, GLuint texture) {
+// (*fnptr)(texture);
+// }
+// static void glowGenerateTextureMipmapEXT(GPGENERATETEXTUREMIPMAPEXT fnptr, GLuint texture, GLenum target) {
+// (*fnptr)(texture, target);
+// }
+// static void glowGetActiveAtomicCounterBufferiv(GPGETACTIVEATOMICCOUNTERBUFFERIV fnptr, GLuint program, GLuint bufferIndex, GLenum pname, GLint * params) {
+// (*fnptr)(program, bufferIndex, pname, params);
+// }
+// static void glowGetActiveAttrib(GPGETACTIVEATTRIB fnptr, GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLchar * name) {
+// (*fnptr)(program, index, bufSize, length, size, type, name);
+// }
+// static void glowGetActiveSubroutineName(GPGETACTIVESUBROUTINENAME fnptr, GLuint program, GLenum shadertype, GLuint index, GLsizei bufSize, GLsizei * length, GLchar * name) {
+// (*fnptr)(program, shadertype, index, bufSize, length, name);
+// }
+// static void glowGetActiveSubroutineUniformName(GPGETACTIVESUBROUTINEUNIFORMNAME fnptr, GLuint program, GLenum shadertype, GLuint index, GLsizei bufSize, GLsizei * length, GLchar * name) {
+// (*fnptr)(program, shadertype, index, bufSize, length, name);
+// }
+// static void glowGetActiveSubroutineUniformiv(GPGETACTIVESUBROUTINEUNIFORMIV fnptr, GLuint program, GLenum shadertype, GLuint index, GLenum pname, GLint * values) {
+// (*fnptr)(program, shadertype, index, pname, values);
+// }
+// static void glowGetActiveUniform(GPGETACTIVEUNIFORM fnptr, GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLchar * name) {
+// (*fnptr)(program, index, bufSize, length, size, type, name);
+// }
+// static void glowGetActiveUniformBlockName(GPGETACTIVEUNIFORMBLOCKNAME fnptr, GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei * length, GLchar * uniformBlockName) {
+// (*fnptr)(program, uniformBlockIndex, bufSize, length, uniformBlockName);
+// }
+// static void glowGetActiveUniformBlockiv(GPGETACTIVEUNIFORMBLOCKIV fnptr, GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint * params) {
+// (*fnptr)(program, uniformBlockIndex, pname, params);
+// }
+// static void glowGetActiveUniformName(GPGETACTIVEUNIFORMNAME fnptr, GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei * length, GLchar * uniformName) {
+// (*fnptr)(program, uniformIndex, bufSize, length, uniformName);
+// }
+// static void glowGetActiveUniformsiv(GPGETACTIVEUNIFORMSIV fnptr, GLuint program, GLsizei uniformCount, const GLuint * uniformIndices, GLenum pname, GLint * params) {
+// (*fnptr)(program, uniformCount, uniformIndices, pname, params);
+// }
+// static void glowGetAttachedShaders(GPGETATTACHEDSHADERS fnptr, GLuint program, GLsizei maxCount, GLsizei * count, GLuint * shaders) {
+// (*fnptr)(program, maxCount, count, shaders);
+// }
+// static GLint glowGetAttribLocation(GPGETATTRIBLOCATION fnptr, GLuint program, const GLchar * name) {
+// return (*fnptr)(program, name);
+// }
+// static void glowGetBooleanIndexedvEXT(GPGETBOOLEANINDEXEDVEXT fnptr, GLenum target, GLuint index, GLboolean * data) {
+// (*fnptr)(target, index, data);
+// }
+// static void glowGetBooleani_v(GPGETBOOLEANI_V fnptr, GLenum target, GLuint index, GLboolean * data) {
+// (*fnptr)(target, index, data);
+// }
+// static void glowGetBooleanv(GPGETBOOLEANV fnptr, GLenum pname, GLboolean * data) {
+// (*fnptr)(pname, data);
+// }
+// static void glowGetBufferParameteri64v(GPGETBUFFERPARAMETERI64V fnptr, GLenum target, GLenum pname, GLint64 * params) {
+// (*fnptr)(target, pname, params);
+// }
+// static void glowGetBufferParameteriv(GPGETBUFFERPARAMETERIV fnptr, GLenum target, GLenum pname, GLint * params) {
+// (*fnptr)(target, pname, params);
+// }
+// static void glowGetBufferParameterui64vNV(GPGETBUFFERPARAMETERUI64VNV fnptr, GLenum target, GLenum pname, GLuint64EXT * params) {
+// (*fnptr)(target, pname, params);
+// }
+// static void glowGetBufferPointerv(GPGETBUFFERPOINTERV fnptr, GLenum target, GLenum pname, void ** params) {
+// (*fnptr)(target, pname, params);
+// }
+// static void glowGetBufferSubData(GPGETBUFFERSUBDATA fnptr, GLenum target, GLintptr offset, GLsizeiptr size, void * data) {
+// (*fnptr)(target, offset, size, data);
+// }
+// static GLuint glowGetCommandHeaderNV(GPGETCOMMANDHEADERNV fnptr, GLenum tokenID, GLuint size) {
+// return (*fnptr)(tokenID, size);
+// }
+// static void glowGetCompressedMultiTexImageEXT(GPGETCOMPRESSEDMULTITEXIMAGEEXT fnptr, GLenum texunit, GLenum target, GLint lod, void * img) {
+// (*fnptr)(texunit, target, lod, img);
+// }
+// static void glowGetCompressedTexImage(GPGETCOMPRESSEDTEXIMAGE fnptr, GLenum target, GLint level, void * img) {
+// (*fnptr)(target, level, img);
+// }
+// static void glowGetCompressedTextureImage(GPGETCOMPRESSEDTEXTUREIMAGE fnptr, GLuint texture, GLint level, GLsizei bufSize, void * pixels) {
+// (*fnptr)(texture, level, bufSize, pixels);
+// }
+// static void glowGetCompressedTextureImageEXT(GPGETCOMPRESSEDTEXTUREIMAGEEXT fnptr, GLuint texture, GLenum target, GLint lod, void * img) {
+// (*fnptr)(texture, target, lod, img);
+// }
+// static void glowGetCompressedTextureSubImage(GPGETCOMPRESSEDTEXTURESUBIMAGE fnptr, GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei bufSize, void * pixels) {
+// (*fnptr)(texture, level, xoffset, yoffset, zoffset, width, height, depth, bufSize, pixels);
+// }
+// static void glowGetCoverageModulationTableNV(GPGETCOVERAGEMODULATIONTABLENV fnptr, GLsizei bufSize, GLfloat * v) {
+// (*fnptr)(bufSize, v);
+// }
+// static GLuint glowGetDebugMessageLog(GPGETDEBUGMESSAGELOG fnptr, GLuint count, GLsizei bufSize, GLenum * sources, GLenum * types, GLuint * ids, GLenum * severities, GLsizei * lengths, GLchar * messageLog) {
+// return (*fnptr)(count, bufSize, sources, types, ids, severities, lengths, messageLog);
+// }
+// static GLuint glowGetDebugMessageLogARB(GPGETDEBUGMESSAGELOGARB fnptr, GLuint count, GLsizei bufSize, GLenum * sources, GLenum * types, GLuint * ids, GLenum * severities, GLsizei * lengths, GLchar * messageLog) {
+// return (*fnptr)(count, bufSize, sources, types, ids, severities, lengths, messageLog);
+// }
+// static GLuint glowGetDebugMessageLogKHR(GPGETDEBUGMESSAGELOGKHR fnptr, GLuint count, GLsizei bufSize, GLenum * sources, GLenum * types, GLuint * ids, GLenum * severities, GLsizei * lengths, GLchar * messageLog) {
+// return (*fnptr)(count, bufSize, sources, types, ids, severities, lengths, messageLog);
+// }
+// static void glowGetDoubleIndexedvEXT(GPGETDOUBLEINDEXEDVEXT fnptr, GLenum target, GLuint index, GLdouble * data) {
+// (*fnptr)(target, index, data);
+// }
+// static void glowGetDoublei_v(GPGETDOUBLEI_V fnptr, GLenum target, GLuint index, GLdouble * data) {
+// (*fnptr)(target, index, data);
+// }
+// static void glowGetDoublei_vEXT(GPGETDOUBLEI_VEXT fnptr, GLenum pname, GLuint index, GLdouble * params) {
+// (*fnptr)(pname, index, params);
+// }
+// static void glowGetDoublev(GPGETDOUBLEV fnptr, GLenum pname, GLdouble * data) {
+// (*fnptr)(pname, data);
+// }
+// static GLenum glowGetError(GPGETERROR fnptr) {
+// return (*fnptr)();
+// }
+// static void glowGetFirstPerfQueryIdINTEL(GPGETFIRSTPERFQUERYIDINTEL fnptr, GLuint * queryId) {
+// (*fnptr)(queryId);
+// }
+// static void glowGetFloatIndexedvEXT(GPGETFLOATINDEXEDVEXT fnptr, GLenum target, GLuint index, GLfloat * data) {
+// (*fnptr)(target, index, data);
+// }
+// static void glowGetFloati_v(GPGETFLOATI_V fnptr, GLenum target, GLuint index, GLfloat * data) {
+// (*fnptr)(target, index, data);
+// }
+// static void glowGetFloati_vEXT(GPGETFLOATI_VEXT fnptr, GLenum pname, GLuint index, GLfloat * params) {
+// (*fnptr)(pname, index, params);
+// }
+// static void glowGetFloatv(GPGETFLOATV fnptr, GLenum pname, GLfloat * data) {
+// (*fnptr)(pname, data);
+// }
+// static GLint glowGetFragDataIndex(GPGETFRAGDATAINDEX fnptr, GLuint program, const GLchar * name) {
+// return (*fnptr)(program, name);
+// }
+// static GLint glowGetFragDataLocation(GPGETFRAGDATALOCATION fnptr, GLuint program, const GLchar * name) {
+// return (*fnptr)(program, name);
+// }
+// static void glowGetFramebufferAttachmentParameteriv(GPGETFRAMEBUFFERATTACHMENTPARAMETERIV fnptr, GLenum target, GLenum attachment, GLenum pname, GLint * params) {
+// (*fnptr)(target, attachment, pname, params);
+// }
+// static void glowGetFramebufferParameteriv(GPGETFRAMEBUFFERPARAMETERIV fnptr, GLenum target, GLenum pname, GLint * params) {
+// (*fnptr)(target, pname, params);
+// }
+// static void glowGetFramebufferParameterivEXT(GPGETFRAMEBUFFERPARAMETERIVEXT fnptr, GLuint framebuffer, GLenum pname, GLint * params) {
+// (*fnptr)(framebuffer, pname, params);
+// }
+// static void glowGetFramebufferParameterivMESA(GPGETFRAMEBUFFERPARAMETERIVMESA fnptr, GLenum target, GLenum pname, GLint * params) {
+// (*fnptr)(target, pname, params);
+// }
+// static GLenum glowGetGraphicsResetStatus(GPGETGRAPHICSRESETSTATUS fnptr) {
+// return (*fnptr)();
+// }
+// static GLenum glowGetGraphicsResetStatusARB(GPGETGRAPHICSRESETSTATUSARB fnptr) {
+// return (*fnptr)();
+// }
+// static GLenum glowGetGraphicsResetStatusKHR(GPGETGRAPHICSRESETSTATUSKHR fnptr) {
+// return (*fnptr)();
+// }
+// static GLuint64 glowGetImageHandleARB(GPGETIMAGEHANDLEARB fnptr, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format) {
+// return (*fnptr)(texture, level, layered, layer, format);
+// }
+// static GLuint64 glowGetImageHandleNV(GPGETIMAGEHANDLENV fnptr, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format) {
+// return (*fnptr)(texture, level, layered, layer, format);
+// }
+// static void glowGetInteger64i_v(GPGETINTEGER64I_V fnptr, GLenum target, GLuint index, GLint64 * data) {
+// (*fnptr)(target, index, data);
+// }
+// static void glowGetInteger64v(GPGETINTEGER64V fnptr, GLenum pname, GLint64 * data) {
+// (*fnptr)(pname, data);
+// }
+// static void glowGetIntegerIndexedvEXT(GPGETINTEGERINDEXEDVEXT fnptr, GLenum target, GLuint index, GLint * data) {
+// (*fnptr)(target, index, data);
+// }
+// static void glowGetIntegeri_v(GPGETINTEGERI_V fnptr, GLenum target, GLuint index, GLint * data) {
+// (*fnptr)(target, index, data);
+// }
+// static void glowGetIntegerui64i_vNV(GPGETINTEGERUI64I_VNV fnptr, GLenum value, GLuint index, GLuint64EXT * result) {
+// (*fnptr)(value, index, result);
+// }
+// static void glowGetIntegerui64vNV(GPGETINTEGERUI64VNV fnptr, GLenum value, GLuint64EXT * result) {
+// (*fnptr)(value, result);
+// }
+// static void glowGetIntegerv(GPGETINTEGERV fnptr, GLenum pname, GLint * data) {
+// (*fnptr)(pname, data);
+// }
+// static void glowGetInternalformatSampleivNV(GPGETINTERNALFORMATSAMPLEIVNV fnptr, GLenum target, GLenum internalformat, GLsizei samples, GLenum pname, GLsizei count, GLint * params) {
+// (*fnptr)(target, internalformat, samples, pname, count, params);
+// }
+// static void glowGetInternalformati64v(GPGETINTERNALFORMATI64V fnptr, GLenum target, GLenum internalformat, GLenum pname, GLsizei count, GLint64 * params) {
+// (*fnptr)(target, internalformat, pname, count, params);
+// }
+// static void glowGetInternalformativ(GPGETINTERNALFORMATIV fnptr, GLenum target, GLenum internalformat, GLenum pname, GLsizei count, GLint * params) {
+// (*fnptr)(target, internalformat, pname, count, params);
+// }
+// static void glowGetMemoryObjectDetachedResourcesuivNV(GPGETMEMORYOBJECTDETACHEDRESOURCESUIVNV fnptr, GLuint memory, GLenum pname, GLint first, GLsizei count, GLuint * params) {
+// (*fnptr)(memory, pname, first, count, params);
+// }
+// static void glowGetMultiTexEnvfvEXT(GPGETMULTITEXENVFVEXT fnptr, GLenum texunit, GLenum target, GLenum pname, GLfloat * params) {
+// (*fnptr)(texunit, target, pname, params);
+// }
+// static void glowGetMultiTexEnvivEXT(GPGETMULTITEXENVIVEXT fnptr, GLenum texunit, GLenum target, GLenum pname, GLint * params) {
+// (*fnptr)(texunit, target, pname, params);
+// }
+// static void glowGetMultiTexGendvEXT(GPGETMULTITEXGENDVEXT fnptr, GLenum texunit, GLenum coord, GLenum pname, GLdouble * params) {
+// (*fnptr)(texunit, coord, pname, params);
+// }
+// static void glowGetMultiTexGenfvEXT(GPGETMULTITEXGENFVEXT fnptr, GLenum texunit, GLenum coord, GLenum pname, GLfloat * params) {
+// (*fnptr)(texunit, coord, pname, params);
+// }
+// static void glowGetMultiTexGenivEXT(GPGETMULTITEXGENIVEXT fnptr, GLenum texunit, GLenum coord, GLenum pname, GLint * params) {
+// (*fnptr)(texunit, coord, pname, params);
+// }
+// static void glowGetMultiTexImageEXT(GPGETMULTITEXIMAGEEXT fnptr, GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, void * pixels) {
+// (*fnptr)(texunit, target, level, format, type, pixels);
+// }
+// static void glowGetMultiTexLevelParameterfvEXT(GPGETMULTITEXLEVELPARAMETERFVEXT fnptr, GLenum texunit, GLenum target, GLint level, GLenum pname, GLfloat * params) {
+// (*fnptr)(texunit, target, level, pname, params);
+// }
+// static void glowGetMultiTexLevelParameterivEXT(GPGETMULTITEXLEVELPARAMETERIVEXT fnptr, GLenum texunit, GLenum target, GLint level, GLenum pname, GLint * params) {
+// (*fnptr)(texunit, target, level, pname, params);
+// }
+// static void glowGetMultiTexParameterIivEXT(GPGETMULTITEXPARAMETERIIVEXT fnptr, GLenum texunit, GLenum target, GLenum pname, GLint * params) {
+// (*fnptr)(texunit, target, pname, params);
+// }
+// static void glowGetMultiTexParameterIuivEXT(GPGETMULTITEXPARAMETERIUIVEXT fnptr, GLenum texunit, GLenum target, GLenum pname, GLuint * params) {
+// (*fnptr)(texunit, target, pname, params);
+// }
+// static void glowGetMultiTexParameterfvEXT(GPGETMULTITEXPARAMETERFVEXT fnptr, GLenum texunit, GLenum target, GLenum pname, GLfloat * params) {
+// (*fnptr)(texunit, target, pname, params);
+// }
+// static void glowGetMultiTexParameterivEXT(GPGETMULTITEXPARAMETERIVEXT fnptr, GLenum texunit, GLenum target, GLenum pname, GLint * params) {
+// (*fnptr)(texunit, target, pname, params);
+// }
+// static void glowGetMultisamplefv(GPGETMULTISAMPLEFV fnptr, GLenum pname, GLuint index, GLfloat * val) {
+// (*fnptr)(pname, index, val);
+// }
+// static void glowGetNamedBufferParameteri64v(GPGETNAMEDBUFFERPARAMETERI64V fnptr, GLuint buffer, GLenum pname, GLint64 * params) {
+// (*fnptr)(buffer, pname, params);
+// }
+// static void glowGetNamedBufferParameteriv(GPGETNAMEDBUFFERPARAMETERIV fnptr, GLuint buffer, GLenum pname, GLint * params) {
+// (*fnptr)(buffer, pname, params);
+// }
+// static void glowGetNamedBufferParameterivEXT(GPGETNAMEDBUFFERPARAMETERIVEXT fnptr, GLuint buffer, GLenum pname, GLint * params) {
+// (*fnptr)(buffer, pname, params);
+// }
+// static void glowGetNamedBufferParameterui64vNV(GPGETNAMEDBUFFERPARAMETERUI64VNV fnptr, GLuint buffer, GLenum pname, GLuint64EXT * params) {
+// (*fnptr)(buffer, pname, params);
+// }
+// static void glowGetNamedBufferPointerv(GPGETNAMEDBUFFERPOINTERV fnptr, GLuint buffer, GLenum pname, void ** params) {
+// (*fnptr)(buffer, pname, params);
+// }
+// static void glowGetNamedBufferPointervEXT(GPGETNAMEDBUFFERPOINTERVEXT fnptr, GLuint buffer, GLenum pname, void ** params) {
+// (*fnptr)(buffer, pname, params);
+// }
+// static void glowGetNamedBufferSubData(GPGETNAMEDBUFFERSUBDATA fnptr, GLuint buffer, GLintptr offset, GLsizeiptr size, void * data) {
+// (*fnptr)(buffer, offset, size, data);
+// }
+// static void glowGetNamedBufferSubDataEXT(GPGETNAMEDBUFFERSUBDATAEXT fnptr, GLuint buffer, GLintptr offset, GLsizeiptr size, void * data) {
+// (*fnptr)(buffer, offset, size, data);
+// }
+// static void glowGetNamedFramebufferAttachmentParameteriv(GPGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIV fnptr, GLuint framebuffer, GLenum attachment, GLenum pname, GLint * params) {
+// (*fnptr)(framebuffer, attachment, pname, params);
+// }
+// static void glowGetNamedFramebufferAttachmentParameterivEXT(GPGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXT fnptr, GLuint framebuffer, GLenum attachment, GLenum pname, GLint * params) {
+// (*fnptr)(framebuffer, attachment, pname, params);
+// }
+// static void glowGetNamedFramebufferParameteriv(GPGETNAMEDFRAMEBUFFERPARAMETERIV fnptr, GLuint framebuffer, GLenum pname, GLint * param) {
+// (*fnptr)(framebuffer, pname, param);
+// }
+// static void glowGetNamedFramebufferParameterivEXT(GPGETNAMEDFRAMEBUFFERPARAMETERIVEXT fnptr, GLuint framebuffer, GLenum pname, GLint * params) {
+// (*fnptr)(framebuffer, pname, params);
+// }
+// static void glowGetNamedProgramLocalParameterIivEXT(GPGETNAMEDPROGRAMLOCALPARAMETERIIVEXT fnptr, GLuint program, GLenum target, GLuint index, GLint * params) {
+// (*fnptr)(program, target, index, params);
+// }
+// static void glowGetNamedProgramLocalParameterIuivEXT(GPGETNAMEDPROGRAMLOCALPARAMETERIUIVEXT fnptr, GLuint program, GLenum target, GLuint index, GLuint * params) {
+// (*fnptr)(program, target, index, params);
+// }
+// static void glowGetNamedProgramLocalParameterdvEXT(GPGETNAMEDPROGRAMLOCALPARAMETERDVEXT fnptr, GLuint program, GLenum target, GLuint index, GLdouble * params) {
+// (*fnptr)(program, target, index, params);
+// }
+// static void glowGetNamedProgramLocalParameterfvEXT(GPGETNAMEDPROGRAMLOCALPARAMETERFVEXT fnptr, GLuint program, GLenum target, GLuint index, GLfloat * params) {
+// (*fnptr)(program, target, index, params);
+// }
+// static void glowGetNamedProgramStringEXT(GPGETNAMEDPROGRAMSTRINGEXT fnptr, GLuint program, GLenum target, GLenum pname, void * string) {
+// (*fnptr)(program, target, pname, string);
+// }
+// static void glowGetNamedProgramivEXT(GPGETNAMEDPROGRAMIVEXT fnptr, GLuint program, GLenum target, GLenum pname, GLint * params) {
+// (*fnptr)(program, target, pname, params);
+// }
+// static void glowGetNamedRenderbufferParameteriv(GPGETNAMEDRENDERBUFFERPARAMETERIV fnptr, GLuint renderbuffer, GLenum pname, GLint * params) {
+// (*fnptr)(renderbuffer, pname, params);
+// }
+// static void glowGetNamedRenderbufferParameterivEXT(GPGETNAMEDRENDERBUFFERPARAMETERIVEXT fnptr, GLuint renderbuffer, GLenum pname, GLint * params) {
+// (*fnptr)(renderbuffer, pname, params);
+// }
+// static void glowGetNamedStringARB(GPGETNAMEDSTRINGARB fnptr, GLint namelen, const GLchar * name, GLsizei bufSize, GLint * stringlen, GLchar * string) {
+// (*fnptr)(namelen, name, bufSize, stringlen, string);
+// }
+// static void glowGetNamedStringivARB(GPGETNAMEDSTRINGIVARB fnptr, GLint namelen, const GLchar * name, GLenum pname, GLint * params) {
+// (*fnptr)(namelen, name, pname, params);
+// }
+// static void glowGetNextPerfQueryIdINTEL(GPGETNEXTPERFQUERYIDINTEL fnptr, GLuint queryId, GLuint * nextQueryId) {
+// (*fnptr)(queryId, nextQueryId);
+// }
+// static void glowGetObjectLabel(GPGETOBJECTLABEL fnptr, GLenum identifier, GLuint name, GLsizei bufSize, GLsizei * length, GLchar * label) {
+// (*fnptr)(identifier, name, bufSize, length, label);
+// }
+// static void glowGetObjectLabelEXT(GPGETOBJECTLABELEXT fnptr, GLenum type, GLuint object, GLsizei bufSize, GLsizei * length, GLchar * label) {
+// (*fnptr)(type, object, bufSize, length, label);
+// }
+// static void glowGetObjectLabelKHR(GPGETOBJECTLABELKHR fnptr, GLenum identifier, GLuint name, GLsizei bufSize, GLsizei * length, GLchar * label) {
+// (*fnptr)(identifier, name, bufSize, length, label);
+// }
+// static void glowGetObjectPtrLabel(GPGETOBJECTPTRLABEL fnptr, const void * ptr, GLsizei bufSize, GLsizei * length, GLchar * label) {
+// (*fnptr)(ptr, bufSize, length, label);
+// }
+// static void glowGetObjectPtrLabelKHR(GPGETOBJECTPTRLABELKHR fnptr, const void * ptr, GLsizei bufSize, GLsizei * length, GLchar * label) {
+// (*fnptr)(ptr, bufSize, length, label);
+// }
+// static void glowGetPathCommandsNV(GPGETPATHCOMMANDSNV fnptr, GLuint path, GLubyte * commands) {
+// (*fnptr)(path, commands);
+// }
+// static void glowGetPathCoordsNV(GPGETPATHCOORDSNV fnptr, GLuint path, GLfloat * coords) {
+// (*fnptr)(path, coords);
+// }
+// static void glowGetPathDashArrayNV(GPGETPATHDASHARRAYNV fnptr, GLuint path, GLfloat * dashArray) {
+// (*fnptr)(path, dashArray);
+// }
+// static GLfloat glowGetPathLengthNV(GPGETPATHLENGTHNV fnptr, GLuint path, GLsizei startSegment, GLsizei numSegments) {
+// return (*fnptr)(path, startSegment, numSegments);
+// }
+// static void glowGetPathMetricRangeNV(GPGETPATHMETRICRANGENV fnptr, GLbitfield metricQueryMask, GLuint firstPathName, GLsizei numPaths, GLsizei stride, GLfloat * metrics) {
+// (*fnptr)(metricQueryMask, firstPathName, numPaths, stride, metrics);
+// }
+// static void glowGetPathMetricsNV(GPGETPATHMETRICSNV fnptr, GLbitfield metricQueryMask, GLsizei numPaths, GLenum pathNameType, const void * paths, GLuint pathBase, GLsizei stride, GLfloat * metrics) {
+// (*fnptr)(metricQueryMask, numPaths, pathNameType, paths, pathBase, stride, metrics);
+// }
+// static void glowGetPathParameterfvNV(GPGETPATHPARAMETERFVNV fnptr, GLuint path, GLenum pname, GLfloat * value) {
+// (*fnptr)(path, pname, value);
+// }
+// static void glowGetPathParameterivNV(GPGETPATHPARAMETERIVNV fnptr, GLuint path, GLenum pname, GLint * value) {
+// (*fnptr)(path, pname, value);
+// }
+// static void glowGetPathSpacingNV(GPGETPATHSPACINGNV fnptr, GLenum pathListMode, GLsizei numPaths, GLenum pathNameType, const void * paths, GLuint pathBase, GLfloat advanceScale, GLfloat kerningScale, GLenum transformType, GLfloat * returnedSpacing) {
+// (*fnptr)(pathListMode, numPaths, pathNameType, paths, pathBase, advanceScale, kerningScale, transformType, returnedSpacing);
+// }
+// static void glowGetPerfCounterInfoINTEL(GPGETPERFCOUNTERINFOINTEL fnptr, GLuint queryId, GLuint counterId, GLuint counterNameLength, GLchar * counterName, GLuint counterDescLength, GLchar * counterDesc, GLuint * counterOffset, GLuint * counterDataSize, GLuint * counterTypeEnum, GLuint * counterDataTypeEnum, GLuint64 * rawCounterMaxValue) {
+// (*fnptr)(queryId, counterId, counterNameLength, counterName, counterDescLength, counterDesc, counterOffset, counterDataSize, counterTypeEnum, counterDataTypeEnum, rawCounterMaxValue);
+// }
+// static void glowGetPerfMonitorCounterDataAMD(GPGETPERFMONITORCOUNTERDATAAMD fnptr, GLuint monitor, GLenum pname, GLsizei dataSize, GLuint * data, GLint * bytesWritten) {
+// (*fnptr)(monitor, pname, dataSize, data, bytesWritten);
+// }
+// static void glowGetPerfMonitorCounterInfoAMD(GPGETPERFMONITORCOUNTERINFOAMD fnptr, GLuint group, GLuint counter, GLenum pname, void * data) {
+// (*fnptr)(group, counter, pname, data);
+// }
+// static void glowGetPerfMonitorCounterStringAMD(GPGETPERFMONITORCOUNTERSTRINGAMD fnptr, GLuint group, GLuint counter, GLsizei bufSize, GLsizei * length, GLchar * counterString) {
+// (*fnptr)(group, counter, bufSize, length, counterString);
+// }
+// static void glowGetPerfMonitorCountersAMD(GPGETPERFMONITORCOUNTERSAMD fnptr, GLuint group, GLint * numCounters, GLint * maxActiveCounters, GLsizei counterSize, GLuint * counters) {
+// (*fnptr)(group, numCounters, maxActiveCounters, counterSize, counters);
+// }
+// static void glowGetPerfMonitorGroupStringAMD(GPGETPERFMONITORGROUPSTRINGAMD fnptr, GLuint group, GLsizei bufSize, GLsizei * length, GLchar * groupString) {
+// (*fnptr)(group, bufSize, length, groupString);
+// }
+// static void glowGetPerfMonitorGroupsAMD(GPGETPERFMONITORGROUPSAMD fnptr, GLint * numGroups, GLsizei groupsSize, GLuint * groups) {
+// (*fnptr)(numGroups, groupsSize, groups);
+// }
+// static void glowGetPerfQueryDataINTEL(GPGETPERFQUERYDATAINTEL fnptr, GLuint queryHandle, GLuint flags, GLsizei dataSize, void * data, GLuint * bytesWritten) {
+// (*fnptr)(queryHandle, flags, dataSize, data, bytesWritten);
+// }
+// static void glowGetPerfQueryIdByNameINTEL(GPGETPERFQUERYIDBYNAMEINTEL fnptr, GLchar * queryName, GLuint * queryId) {
+// (*fnptr)(queryName, queryId);
+// }
+// static void glowGetPerfQueryInfoINTEL(GPGETPERFQUERYINFOINTEL fnptr, GLuint queryId, GLuint queryNameLength, GLchar * queryName, GLuint * dataSize, GLuint * noCounters, GLuint * noInstances, GLuint * capsMask) {
+// (*fnptr)(queryId, queryNameLength, queryName, dataSize, noCounters, noInstances, capsMask);
+// }
+// static void glowGetPointerIndexedvEXT(GPGETPOINTERINDEXEDVEXT fnptr, GLenum target, GLuint index, void ** data) {
+// (*fnptr)(target, index, data);
+// }
+// static void glowGetPointeri_vEXT(GPGETPOINTERI_VEXT fnptr, GLenum pname, GLuint index, void ** params) {
+// (*fnptr)(pname, index, params);
+// }
+// static void glowGetPointerv(GPGETPOINTERV fnptr, GLenum pname, void ** params) {
+// (*fnptr)(pname, params);
+// }
+// static void glowGetPointervKHR(GPGETPOINTERVKHR fnptr, GLenum pname, void ** params) {
+// (*fnptr)(pname, params);
+// }
+// static void glowGetProgramBinary(GPGETPROGRAMBINARY fnptr, GLuint program, GLsizei bufSize, GLsizei * length, GLenum * binaryFormat, void * binary) {
+// (*fnptr)(program, bufSize, length, binaryFormat, binary);
+// }
+// static void glowGetProgramInfoLog(GPGETPROGRAMINFOLOG fnptr, GLuint program, GLsizei bufSize, GLsizei * length, GLchar * infoLog) {
+// (*fnptr)(program, bufSize, length, infoLog);
+// }
+// static void glowGetProgramInterfaceiv(GPGETPROGRAMINTERFACEIV fnptr, GLuint program, GLenum programInterface, GLenum pname, GLint * params) {
+// (*fnptr)(program, programInterface, pname, params);
+// }
+// static void glowGetProgramPipelineInfoLog(GPGETPROGRAMPIPELINEINFOLOG fnptr, GLuint pipeline, GLsizei bufSize, GLsizei * length, GLchar * infoLog) {
+// (*fnptr)(pipeline, bufSize, length, infoLog);
+// }
+// static void glowGetProgramPipelineInfoLogEXT(GPGETPROGRAMPIPELINEINFOLOGEXT fnptr, GLuint pipeline, GLsizei bufSize, GLsizei * length, GLchar * infoLog) {
+// (*fnptr)(pipeline, bufSize, length, infoLog);
+// }
+// static void glowGetProgramPipelineiv(GPGETPROGRAMPIPELINEIV fnptr, GLuint pipeline, GLenum pname, GLint * params) {
+// (*fnptr)(pipeline, pname, params);
+// }
+// static void glowGetProgramPipelineivEXT(GPGETPROGRAMPIPELINEIVEXT fnptr, GLuint pipeline, GLenum pname, GLint * params) {
+// (*fnptr)(pipeline, pname, params);
+// }
+// static GLuint glowGetProgramResourceIndex(GPGETPROGRAMRESOURCEINDEX fnptr, GLuint program, GLenum programInterface, const GLchar * name) {
+// return (*fnptr)(program, programInterface, name);
+// }
+// static GLint glowGetProgramResourceLocation(GPGETPROGRAMRESOURCELOCATION fnptr, GLuint program, GLenum programInterface, const GLchar * name) {
+// return (*fnptr)(program, programInterface, name);
+// }
+// static GLint glowGetProgramResourceLocationIndex(GPGETPROGRAMRESOURCELOCATIONINDEX fnptr, GLuint program, GLenum programInterface, const GLchar * name) {
+// return (*fnptr)(program, programInterface, name);
+// }
+// static void glowGetProgramResourceName(GPGETPROGRAMRESOURCENAME fnptr, GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei * length, GLchar * name) {
+// (*fnptr)(program, programInterface, index, bufSize, length, name);
+// }
+// static void glowGetProgramResourcefvNV(GPGETPROGRAMRESOURCEFVNV fnptr, GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum * props, GLsizei count, GLsizei * length, GLfloat * params) {
+// (*fnptr)(program, programInterface, index, propCount, props, count, length, params);
+// }
+// static void glowGetProgramResourceiv(GPGETPROGRAMRESOURCEIV fnptr, GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum * props, GLsizei count, GLsizei * length, GLint * params) {
+// (*fnptr)(program, programInterface, index, propCount, props, count, length, params);
+// }
+// static void glowGetProgramStageiv(GPGETPROGRAMSTAGEIV fnptr, GLuint program, GLenum shadertype, GLenum pname, GLint * values) {
+// (*fnptr)(program, shadertype, pname, values);
+// }
+// static void glowGetProgramiv(GPGETPROGRAMIV fnptr, GLuint program, GLenum pname, GLint * params) {
+// (*fnptr)(program, pname, params);
+// }
+// static void glowGetQueryBufferObjecti64v(GPGETQUERYBUFFEROBJECTI64V fnptr, GLuint id, GLuint buffer, GLenum pname, GLintptr offset) {
+// (*fnptr)(id, buffer, pname, offset);
+// }
+// static void glowGetQueryBufferObjectiv(GPGETQUERYBUFFEROBJECTIV fnptr, GLuint id, GLuint buffer, GLenum pname, GLintptr offset) {
+// (*fnptr)(id, buffer, pname, offset);
+// }
+// static void glowGetQueryBufferObjectui64v(GPGETQUERYBUFFEROBJECTUI64V fnptr, GLuint id, GLuint buffer, GLenum pname, GLintptr offset) {
+// (*fnptr)(id, buffer, pname, offset);
+// }
+// static void glowGetQueryBufferObjectuiv(GPGETQUERYBUFFEROBJECTUIV fnptr, GLuint id, GLuint buffer, GLenum pname, GLintptr offset) {
+// (*fnptr)(id, buffer, pname, offset);
+// }
+// static void glowGetQueryIndexediv(GPGETQUERYINDEXEDIV fnptr, GLenum target, GLuint index, GLenum pname, GLint * params) {
+// (*fnptr)(target, index, pname, params);
+// }
+// static void glowGetQueryObjecti64v(GPGETQUERYOBJECTI64V fnptr, GLuint id, GLenum pname, GLint64 * params) {
+// (*fnptr)(id, pname, params);
+// }
+// static void glowGetQueryObjectiv(GPGETQUERYOBJECTIV fnptr, GLuint id, GLenum pname, GLint * params) {
+// (*fnptr)(id, pname, params);
+// }
+// static void glowGetQueryObjectui64v(GPGETQUERYOBJECTUI64V fnptr, GLuint id, GLenum pname, GLuint64 * params) {
+// (*fnptr)(id, pname, params);
+// }
+// static void glowGetQueryObjectuiv(GPGETQUERYOBJECTUIV fnptr, GLuint id, GLenum pname, GLuint * params) {
+// (*fnptr)(id, pname, params);
+// }
+// static void glowGetQueryiv(GPGETQUERYIV fnptr, GLenum target, GLenum pname, GLint * params) {
+// (*fnptr)(target, pname, params);
+// }
+// static void glowGetRenderbufferParameteriv(GPGETRENDERBUFFERPARAMETERIV fnptr, GLenum target, GLenum pname, GLint * params) {
+// (*fnptr)(target, pname, params);
+// }
+// static void glowGetSamplerParameterIiv(GPGETSAMPLERPARAMETERIIV fnptr, GLuint sampler, GLenum pname, GLint * params) {
+// (*fnptr)(sampler, pname, params);
+// }
+// static void glowGetSamplerParameterIuiv(GPGETSAMPLERPARAMETERIUIV fnptr, GLuint sampler, GLenum pname, GLuint * params) {
+// (*fnptr)(sampler, pname, params);
+// }
+// static void glowGetSamplerParameterfv(GPGETSAMPLERPARAMETERFV fnptr, GLuint sampler, GLenum pname, GLfloat * params) {
+// (*fnptr)(sampler, pname, params);
+// }
+// static void glowGetSamplerParameteriv(GPGETSAMPLERPARAMETERIV fnptr, GLuint sampler, GLenum pname, GLint * params) {
+// (*fnptr)(sampler, pname, params);
+// }
+// static void glowGetShaderInfoLog(GPGETSHADERINFOLOG fnptr, GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * infoLog) {
+// (*fnptr)(shader, bufSize, length, infoLog);
+// }
+// static void glowGetShaderPrecisionFormat(GPGETSHADERPRECISIONFORMAT fnptr, GLenum shadertype, GLenum precisiontype, GLint * range, GLint * precision) {
+// (*fnptr)(shadertype, precisiontype, range, precision);
+// }
+// static void glowGetShaderSource(GPGETSHADERSOURCE fnptr, GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * source) {
+// (*fnptr)(shader, bufSize, length, source);
+// }
+// static void glowGetShaderiv(GPGETSHADERIV fnptr, GLuint shader, GLenum pname, GLint * params) {
+// (*fnptr)(shader, pname, params);
+// }
+// static void glowGetShadingRateImagePaletteNV(GPGETSHADINGRATEIMAGEPALETTENV fnptr, GLuint viewport, GLuint entry, GLenum * rate) {
+// (*fnptr)(viewport, entry, rate);
+// }
+// static void glowGetShadingRateSampleLocationivNV(GPGETSHADINGRATESAMPLELOCATIONIVNV fnptr, GLenum rate, GLuint samples, GLuint index, GLint * location) {
+// (*fnptr)(rate, samples, index, location);
+// }
+// static GLushort glowGetStageIndexNV(GPGETSTAGEINDEXNV fnptr, GLenum shadertype) {
+// return (*fnptr)(shadertype);
+// }
+// static const GLubyte * glowGetString(GPGETSTRING fnptr, GLenum name) {
+// return (*fnptr)(name);
+// }
+// static const GLubyte * glowGetStringi(GPGETSTRINGI fnptr, GLenum name, GLuint index) {
+// return (*fnptr)(name, index);
+// }
+// static GLuint glowGetSubroutineIndex(GPGETSUBROUTINEINDEX fnptr, GLuint program, GLenum shadertype, const GLchar * name) {
+// return (*fnptr)(program, shadertype, name);
+// }
+// static GLint glowGetSubroutineUniformLocation(GPGETSUBROUTINEUNIFORMLOCATION fnptr, GLuint program, GLenum shadertype, const GLchar * name) {
+// return (*fnptr)(program, shadertype, name);
+// }
+// static void glowGetSynciv(GPGETSYNCIV fnptr, GLsync sync, GLenum pname, GLsizei count, GLsizei * length, GLint * values) {
+// (*fnptr)(sync, pname, count, length, values);
+// }
+// static void glowGetTexImage(GPGETTEXIMAGE fnptr, GLenum target, GLint level, GLenum format, GLenum type, void * pixels) {
+// (*fnptr)(target, level, format, type, pixels);
+// }
+// static void glowGetTexLevelParameterfv(GPGETTEXLEVELPARAMETERFV fnptr, GLenum target, GLint level, GLenum pname, GLfloat * params) {
+// (*fnptr)(target, level, pname, params);
+// }
+// static void glowGetTexLevelParameteriv(GPGETTEXLEVELPARAMETERIV fnptr, GLenum target, GLint level, GLenum pname, GLint * params) {
+// (*fnptr)(target, level, pname, params);
+// }
+// static void glowGetTexParameterIiv(GPGETTEXPARAMETERIIV fnptr, GLenum target, GLenum pname, GLint * params) {
+// (*fnptr)(target, pname, params);
+// }
+// static void glowGetTexParameterIuiv(GPGETTEXPARAMETERIUIV fnptr, GLenum target, GLenum pname, GLuint * params) {
+// (*fnptr)(target, pname, params);
+// }
+// static void glowGetTexParameterfv(GPGETTEXPARAMETERFV fnptr, GLenum target, GLenum pname, GLfloat * params) {
+// (*fnptr)(target, pname, params);
+// }
+// static void glowGetTexParameteriv(GPGETTEXPARAMETERIV fnptr, GLenum target, GLenum pname, GLint * params) {
+// (*fnptr)(target, pname, params);
+// }
+// static GLuint64 glowGetTextureHandleARB(GPGETTEXTUREHANDLEARB fnptr, GLuint texture) {
+// return (*fnptr)(texture);
+// }
+// static GLuint64 glowGetTextureHandleNV(GPGETTEXTUREHANDLENV fnptr, GLuint texture) {
+// return (*fnptr)(texture);
+// }
+// static void glowGetTextureImage(GPGETTEXTUREIMAGE fnptr, GLuint texture, GLint level, GLenum format, GLenum type, GLsizei bufSize, void * pixels) {
+// (*fnptr)(texture, level, format, type, bufSize, pixels);
+// }
+// static void glowGetTextureImageEXT(GPGETTEXTUREIMAGEEXT fnptr, GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, void * pixels) {
+// (*fnptr)(texture, target, level, format, type, pixels);
+// }
+// static void glowGetTextureLevelParameterfv(GPGETTEXTURELEVELPARAMETERFV fnptr, GLuint texture, GLint level, GLenum pname, GLfloat * params) {
+// (*fnptr)(texture, level, pname, params);
+// }
+// static void glowGetTextureLevelParameterfvEXT(GPGETTEXTURELEVELPARAMETERFVEXT fnptr, GLuint texture, GLenum target, GLint level, GLenum pname, GLfloat * params) {
+// (*fnptr)(texture, target, level, pname, params);
+// }
+// static void glowGetTextureLevelParameteriv(GPGETTEXTURELEVELPARAMETERIV fnptr, GLuint texture, GLint level, GLenum pname, GLint * params) {
+// (*fnptr)(texture, level, pname, params);
+// }
+// static void glowGetTextureLevelParameterivEXT(GPGETTEXTURELEVELPARAMETERIVEXT fnptr, GLuint texture, GLenum target, GLint level, GLenum pname, GLint * params) {
+// (*fnptr)(texture, target, level, pname, params);
+// }
+// static void glowGetTextureParameterIiv(GPGETTEXTUREPARAMETERIIV fnptr, GLuint texture, GLenum pname, GLint * params) {
+// (*fnptr)(texture, pname, params);
+// }
+// static void glowGetTextureParameterIivEXT(GPGETTEXTUREPARAMETERIIVEXT fnptr, GLuint texture, GLenum target, GLenum pname, GLint * params) {
+// (*fnptr)(texture, target, pname, params);
+// }
+// static void glowGetTextureParameterIuiv(GPGETTEXTUREPARAMETERIUIV fnptr, GLuint texture, GLenum pname, GLuint * params) {
+// (*fnptr)(texture, pname, params);
+// }
+// static void glowGetTextureParameterIuivEXT(GPGETTEXTUREPARAMETERIUIVEXT fnptr, GLuint texture, GLenum target, GLenum pname, GLuint * params) {
+// (*fnptr)(texture, target, pname, params);
+// }
+// static void glowGetTextureParameterfv(GPGETTEXTUREPARAMETERFV fnptr, GLuint texture, GLenum pname, GLfloat * params) {
+// (*fnptr)(texture, pname, params);
+// }
+// static void glowGetTextureParameterfvEXT(GPGETTEXTUREPARAMETERFVEXT fnptr, GLuint texture, GLenum target, GLenum pname, GLfloat * params) {
+// (*fnptr)(texture, target, pname, params);
+// }
+// static void glowGetTextureParameteriv(GPGETTEXTUREPARAMETERIV fnptr, GLuint texture, GLenum pname, GLint * params) {
+// (*fnptr)(texture, pname, params);
+// }
+// static void glowGetTextureParameterivEXT(GPGETTEXTUREPARAMETERIVEXT fnptr, GLuint texture, GLenum target, GLenum pname, GLint * params) {
+// (*fnptr)(texture, target, pname, params);
+// }
+// static GLuint64 glowGetTextureSamplerHandleARB(GPGETTEXTURESAMPLERHANDLEARB fnptr, GLuint texture, GLuint sampler) {
+// return (*fnptr)(texture, sampler);
+// }
+// static GLuint64 glowGetTextureSamplerHandleNV(GPGETTEXTURESAMPLERHANDLENV fnptr, GLuint texture, GLuint sampler) {
+// return (*fnptr)(texture, sampler);
+// }
+// static void glowGetTextureSubImage(GPGETTEXTURESUBIMAGE fnptr, GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLsizei bufSize, void * pixels) {
+// (*fnptr)(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, bufSize, pixels);
+// }
+// static void glowGetTransformFeedbackVarying(GPGETTRANSFORMFEEDBACKVARYING fnptr, GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLsizei * size, GLenum * type, GLchar * name) {
+// (*fnptr)(program, index, bufSize, length, size, type, name);
+// }
+// static void glowGetTransformFeedbacki64_v(GPGETTRANSFORMFEEDBACKI64_V fnptr, GLuint xfb, GLenum pname, GLuint index, GLint64 * param) {
+// (*fnptr)(xfb, pname, index, param);
+// }
+// static void glowGetTransformFeedbacki_v(GPGETTRANSFORMFEEDBACKI_V fnptr, GLuint xfb, GLenum pname, GLuint index, GLint * param) {
+// (*fnptr)(xfb, pname, index, param);
+// }
+// static void glowGetTransformFeedbackiv(GPGETTRANSFORMFEEDBACKIV fnptr, GLuint xfb, GLenum pname, GLint * param) {
+// (*fnptr)(xfb, pname, param);
+// }
+// static GLuint glowGetUniformBlockIndex(GPGETUNIFORMBLOCKINDEX fnptr, GLuint program, const GLchar * uniformBlockName) {
+// return (*fnptr)(program, uniformBlockName);
+// }
+// static void glowGetUniformIndices(GPGETUNIFORMINDICES fnptr, GLuint program, GLsizei uniformCount, const GLchar *const* uniformNames, GLuint * uniformIndices) {
+// (*fnptr)(program, uniformCount, uniformNames, uniformIndices);
+// }
+// static GLint glowGetUniformLocation(GPGETUNIFORMLOCATION fnptr, GLuint program, const GLchar * name) {
+// return (*fnptr)(program, name);
+// }
+// static void glowGetUniformSubroutineuiv(GPGETUNIFORMSUBROUTINEUIV fnptr, GLenum shadertype, GLint location, GLuint * params) {
+// (*fnptr)(shadertype, location, params);
+// }
+// static void glowGetUniformdv(GPGETUNIFORMDV fnptr, GLuint program, GLint location, GLdouble * params) {
+// (*fnptr)(program, location, params);
+// }
+// static void glowGetUniformfv(GPGETUNIFORMFV fnptr, GLuint program, GLint location, GLfloat * params) {
+// (*fnptr)(program, location, params);
+// }
+// static void glowGetUniformi64vARB(GPGETUNIFORMI64VARB fnptr, GLuint program, GLint location, GLint64 * params) {
+// (*fnptr)(program, location, params);
+// }
+// static void glowGetUniformi64vNV(GPGETUNIFORMI64VNV fnptr, GLuint program, GLint location, GLint64EXT * params) {
+// (*fnptr)(program, location, params);
+// }
+// static void glowGetUniformiv(GPGETUNIFORMIV fnptr, GLuint program, GLint location, GLint * params) {
+// (*fnptr)(program, location, params);
+// }
+// static void glowGetUniformui64vARB(GPGETUNIFORMUI64VARB fnptr, GLuint program, GLint location, GLuint64 * params) {
+// (*fnptr)(program, location, params);
+// }
+// static void glowGetUniformui64vNV(GPGETUNIFORMUI64VNV fnptr, GLuint program, GLint location, GLuint64EXT * params) {
+// (*fnptr)(program, location, params);
+// }
+// static void glowGetUniformuiv(GPGETUNIFORMUIV fnptr, GLuint program, GLint location, GLuint * params) {
+// (*fnptr)(program, location, params);
+// }
+// static void glowGetVertexArrayIndexed64iv(GPGETVERTEXARRAYINDEXED64IV fnptr, GLuint vaobj, GLuint index, GLenum pname, GLint64 * param) {
+// (*fnptr)(vaobj, index, pname, param);
+// }
+// static void glowGetVertexArrayIndexediv(GPGETVERTEXARRAYINDEXEDIV fnptr, GLuint vaobj, GLuint index, GLenum pname, GLint * param) {
+// (*fnptr)(vaobj, index, pname, param);
+// }
+// static void glowGetVertexArrayIntegeri_vEXT(GPGETVERTEXARRAYINTEGERI_VEXT fnptr, GLuint vaobj, GLuint index, GLenum pname, GLint * param) {
+// (*fnptr)(vaobj, index, pname, param);
+// }
+// static void glowGetVertexArrayIntegervEXT(GPGETVERTEXARRAYINTEGERVEXT fnptr, GLuint vaobj, GLenum pname, GLint * param) {
+// (*fnptr)(vaobj, pname, param);
+// }
+// static void glowGetVertexArrayPointeri_vEXT(GPGETVERTEXARRAYPOINTERI_VEXT fnptr, GLuint vaobj, GLuint index, GLenum pname, void ** param) {
+// (*fnptr)(vaobj, index, pname, param);
+// }
+// static void glowGetVertexArrayPointervEXT(GPGETVERTEXARRAYPOINTERVEXT fnptr, GLuint vaobj, GLenum pname, void ** param) {
+// (*fnptr)(vaobj, pname, param);
+// }
+// static void glowGetVertexArrayiv(GPGETVERTEXARRAYIV fnptr, GLuint vaobj, GLenum pname, GLint * param) {
+// (*fnptr)(vaobj, pname, param);
+// }
+// static void glowGetVertexAttribIiv(GPGETVERTEXATTRIBIIV fnptr, GLuint index, GLenum pname, GLint * params) {
+// (*fnptr)(index, pname, params);
+// }
+// static void glowGetVertexAttribIuiv(GPGETVERTEXATTRIBIUIV fnptr, GLuint index, GLenum pname, GLuint * params) {
+// (*fnptr)(index, pname, params);
+// }
+// static void glowGetVertexAttribLdv(GPGETVERTEXATTRIBLDV fnptr, GLuint index, GLenum pname, GLdouble * params) {
+// (*fnptr)(index, pname, params);
+// }
+// static void glowGetVertexAttribLi64vNV(GPGETVERTEXATTRIBLI64VNV fnptr, GLuint index, GLenum pname, GLint64EXT * params) {
+// (*fnptr)(index, pname, params);
+// }
+// static void glowGetVertexAttribLui64vARB(GPGETVERTEXATTRIBLUI64VARB fnptr, GLuint index, GLenum pname, GLuint64EXT * params) {
+// (*fnptr)(index, pname, params);
+// }
+// static void glowGetVertexAttribLui64vNV(GPGETVERTEXATTRIBLUI64VNV fnptr, GLuint index, GLenum pname, GLuint64EXT * params) {
+// (*fnptr)(index, pname, params);
+// }
+// static void glowGetVertexAttribPointerv(GPGETVERTEXATTRIBPOINTERV fnptr, GLuint index, GLenum pname, void ** pointer) {
+// (*fnptr)(index, pname, pointer);
+// }
+// static void glowGetVertexAttribPointerWithOffsetv(GPGETVERTEXATTRIBPOINTERV fnptr, GLuint index, GLenum pname, uintptr_t ** offset) {
+// (*fnptr)(index, pname, (void **)(offset));
+// }
+// static void glowGetVertexAttribdv(GPGETVERTEXATTRIBDV fnptr, GLuint index, GLenum pname, GLdouble * params) {
+// (*fnptr)(index, pname, params);
+// }
+// static void glowGetVertexAttribfv(GPGETVERTEXATTRIBFV fnptr, GLuint index, GLenum pname, GLfloat * params) {
+// (*fnptr)(index, pname, params);
+// }
+// static void glowGetVertexAttribiv(GPGETVERTEXATTRIBIV fnptr, GLuint index, GLenum pname, GLint * params) {
+// (*fnptr)(index, pname, params);
+// }
+// static GLVULKANPROCNV glowGetVkProcAddrNV(GPGETVKPROCADDRNV fnptr, const GLchar * name) {
+// return (*fnptr)(name);
+// }
+// static void glowGetnCompressedTexImageARB(GPGETNCOMPRESSEDTEXIMAGEARB fnptr, GLenum target, GLint lod, GLsizei bufSize, void * img) {
+// (*fnptr)(target, lod, bufSize, img);
+// }
+// static void glowGetnTexImageARB(GPGETNTEXIMAGEARB fnptr, GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, void * img) {
+// (*fnptr)(target, level, format, type, bufSize, img);
+// }
+// static void glowGetnUniformdvARB(GPGETNUNIFORMDVARB fnptr, GLuint program, GLint location, GLsizei bufSize, GLdouble * params) {
+// (*fnptr)(program, location, bufSize, params);
+// }
+// static void glowGetnUniformfv(GPGETNUNIFORMFV fnptr, GLuint program, GLint location, GLsizei bufSize, GLfloat * params) {
+// (*fnptr)(program, location, bufSize, params);
+// }
+// static void glowGetnUniformfvARB(GPGETNUNIFORMFVARB fnptr, GLuint program, GLint location, GLsizei bufSize, GLfloat * params) {
+// (*fnptr)(program, location, bufSize, params);
+// }
+// static void glowGetnUniformfvKHR(GPGETNUNIFORMFVKHR fnptr, GLuint program, GLint location, GLsizei bufSize, GLfloat * params) {
+// (*fnptr)(program, location, bufSize, params);
+// }
+// static void glowGetnUniformi64vARB(GPGETNUNIFORMI64VARB fnptr, GLuint program, GLint location, GLsizei bufSize, GLint64 * params) {
+// (*fnptr)(program, location, bufSize, params);
+// }
+// static void glowGetnUniformiv(GPGETNUNIFORMIV fnptr, GLuint program, GLint location, GLsizei bufSize, GLint * params) {
+// (*fnptr)(program, location, bufSize, params);
+// }
+// static void glowGetnUniformivARB(GPGETNUNIFORMIVARB fnptr, GLuint program, GLint location, GLsizei bufSize, GLint * params) {
+// (*fnptr)(program, location, bufSize, params);
+// }
+// static void glowGetnUniformivKHR(GPGETNUNIFORMIVKHR fnptr, GLuint program, GLint location, GLsizei bufSize, GLint * params) {
+// (*fnptr)(program, location, bufSize, params);
+// }
+// static void glowGetnUniformui64vARB(GPGETNUNIFORMUI64VARB fnptr, GLuint program, GLint location, GLsizei bufSize, GLuint64 * params) {
+// (*fnptr)(program, location, bufSize, params);
+// }
+// static void glowGetnUniformuiv(GPGETNUNIFORMUIV fnptr, GLuint program, GLint location, GLsizei bufSize, GLuint * params) {
+// (*fnptr)(program, location, bufSize, params);
+// }
+// static void glowGetnUniformuivARB(GPGETNUNIFORMUIVARB fnptr, GLuint program, GLint location, GLsizei bufSize, GLuint * params) {
+// (*fnptr)(program, location, bufSize, params);
+// }
+// static void glowGetnUniformuivKHR(GPGETNUNIFORMUIVKHR fnptr, GLuint program, GLint location, GLsizei bufSize, GLuint * params) {
+// (*fnptr)(program, location, bufSize, params);
+// }
+// static void glowHint(GPHINT fnptr, GLenum target, GLenum mode) {
+// (*fnptr)(target, mode);
+// }
+// static void glowIndexFormatNV(GPINDEXFORMATNV fnptr, GLenum type, GLsizei stride) {
+// (*fnptr)(type, stride);
+// }
+// static void glowInsertEventMarkerEXT(GPINSERTEVENTMARKEREXT fnptr, GLsizei length, const GLchar * marker) {
+// (*fnptr)(length, marker);
+// }
+// static void glowInterpolatePathsNV(GPINTERPOLATEPATHSNV fnptr, GLuint resultPath, GLuint pathA, GLuint pathB, GLfloat weight) {
+// (*fnptr)(resultPath, pathA, pathB, weight);
+// }
+// static void glowInvalidateBufferData(GPINVALIDATEBUFFERDATA fnptr, GLuint buffer) {
+// (*fnptr)(buffer);
+// }
+// static void glowInvalidateBufferSubData(GPINVALIDATEBUFFERSUBDATA fnptr, GLuint buffer, GLintptr offset, GLsizeiptr length) {
+// (*fnptr)(buffer, offset, length);
+// }
+// static void glowInvalidateFramebuffer(GPINVALIDATEFRAMEBUFFER fnptr, GLenum target, GLsizei numAttachments, const GLenum * attachments) {
+// (*fnptr)(target, numAttachments, attachments);
+// }
+// static void glowInvalidateNamedFramebufferData(GPINVALIDATENAMEDFRAMEBUFFERDATA fnptr, GLuint framebuffer, GLsizei numAttachments, const GLenum * attachments) {
+// (*fnptr)(framebuffer, numAttachments, attachments);
+// }
+// static void glowInvalidateNamedFramebufferSubData(GPINVALIDATENAMEDFRAMEBUFFERSUBDATA fnptr, GLuint framebuffer, GLsizei numAttachments, const GLenum * attachments, GLint x, GLint y, GLsizei width, GLsizei height) {
+// (*fnptr)(framebuffer, numAttachments, attachments, x, y, width, height);
+// }
+// static void glowInvalidateSubFramebuffer(GPINVALIDATESUBFRAMEBUFFER fnptr, GLenum target, GLsizei numAttachments, const GLenum * attachments, GLint x, GLint y, GLsizei width, GLsizei height) {
+// (*fnptr)(target, numAttachments, attachments, x, y, width, height);
+// }
+// static void glowInvalidateTexImage(GPINVALIDATETEXIMAGE fnptr, GLuint texture, GLint level) {
+// (*fnptr)(texture, level);
+// }
+// static void glowInvalidateTexSubImage(GPINVALIDATETEXSUBIMAGE fnptr, GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth) {
+// (*fnptr)(texture, level, xoffset, yoffset, zoffset, width, height, depth);
+// }
+// static GLboolean glowIsBuffer(GPISBUFFER fnptr, GLuint buffer) {
+// return (*fnptr)(buffer);
+// }
+// static GLboolean glowIsBufferResidentNV(GPISBUFFERRESIDENTNV fnptr, GLenum target) {
+// return (*fnptr)(target);
+// }
+// static GLboolean glowIsCommandListNV(GPISCOMMANDLISTNV fnptr, GLuint list) {
+// return (*fnptr)(list);
+// }
+// static GLboolean glowIsEnabled(GPISENABLED fnptr, GLenum cap) {
+// return (*fnptr)(cap);
+// }
+// static GLboolean glowIsEnabledIndexedEXT(GPISENABLEDINDEXEDEXT fnptr, GLenum target, GLuint index) {
+// return (*fnptr)(target, index);
+// }
+// static GLboolean glowIsEnabledi(GPISENABLEDI fnptr, GLenum target, GLuint index) {
+// return (*fnptr)(target, index);
+// }
+// static GLboolean glowIsFramebuffer(GPISFRAMEBUFFER fnptr, GLuint framebuffer) {
+// return (*fnptr)(framebuffer);
+// }
+// static GLboolean glowIsImageHandleResidentARB(GPISIMAGEHANDLERESIDENTARB fnptr, GLuint64 handle) {
+// return (*fnptr)(handle);
+// }
+// static GLboolean glowIsImageHandleResidentNV(GPISIMAGEHANDLERESIDENTNV fnptr, GLuint64 handle) {
+// return (*fnptr)(handle);
+// }
+// static GLboolean glowIsNamedBufferResidentNV(GPISNAMEDBUFFERRESIDENTNV fnptr, GLuint buffer) {
+// return (*fnptr)(buffer);
+// }
+// static GLboolean glowIsNamedStringARB(GPISNAMEDSTRINGARB fnptr, GLint namelen, const GLchar * name) {
+// return (*fnptr)(namelen, name);
+// }
+// static GLboolean glowIsPathNV(GPISPATHNV fnptr, GLuint path) {
+// return (*fnptr)(path);
+// }
+// static GLboolean glowIsPointInFillPathNV(GPISPOINTINFILLPATHNV fnptr, GLuint path, GLuint mask, GLfloat x, GLfloat y) {
+// return (*fnptr)(path, mask, x, y);
+// }
+// static GLboolean glowIsPointInStrokePathNV(GPISPOINTINSTROKEPATHNV fnptr, GLuint path, GLfloat x, GLfloat y) {
+// return (*fnptr)(path, x, y);
+// }
+// static GLboolean glowIsProgram(GPISPROGRAM fnptr, GLuint program) {
+// return (*fnptr)(program);
+// }
+// static GLboolean glowIsProgramPipeline(GPISPROGRAMPIPELINE fnptr, GLuint pipeline) {
+// return (*fnptr)(pipeline);
+// }
+// static GLboolean glowIsProgramPipelineEXT(GPISPROGRAMPIPELINEEXT fnptr, GLuint pipeline) {
+// return (*fnptr)(pipeline);
+// }
+// static GLboolean glowIsQuery(GPISQUERY fnptr, GLuint id) {
+// return (*fnptr)(id);
+// }
+// static GLboolean glowIsRenderbuffer(GPISRENDERBUFFER fnptr, GLuint renderbuffer) {
+// return (*fnptr)(renderbuffer);
+// }
+// static GLboolean glowIsSampler(GPISSAMPLER fnptr, GLuint sampler) {
+// return (*fnptr)(sampler);
+// }
+// static GLboolean glowIsShader(GPISSHADER fnptr, GLuint shader) {
+// return (*fnptr)(shader);
+// }
+// static GLboolean glowIsStateNV(GPISSTATENV fnptr, GLuint state) {
+// return (*fnptr)(state);
+// }
+// static GLboolean glowIsSync(GPISSYNC fnptr, GLsync sync) {
+// return (*fnptr)(sync);
+// }
+// static GLboolean glowIsTexture(GPISTEXTURE fnptr, GLuint texture) {
+// return (*fnptr)(texture);
+// }
+// static GLboolean glowIsTextureHandleResidentARB(GPISTEXTUREHANDLERESIDENTARB fnptr, GLuint64 handle) {
+// return (*fnptr)(handle);
+// }
+// static GLboolean glowIsTextureHandleResidentNV(GPISTEXTUREHANDLERESIDENTNV fnptr, GLuint64 handle) {
+// return (*fnptr)(handle);
+// }
+// static GLboolean glowIsTransformFeedback(GPISTRANSFORMFEEDBACK fnptr, GLuint id) {
+// return (*fnptr)(id);
+// }
+// static GLboolean glowIsVertexArray(GPISVERTEXARRAY fnptr, GLuint array) {
+// return (*fnptr)(array);
+// }
+// static void glowLabelObjectEXT(GPLABELOBJECTEXT fnptr, GLenum type, GLuint object, GLsizei length, const GLchar * label) {
+// (*fnptr)(type, object, length, label);
+// }
+// static void glowLineWidth(GPLINEWIDTH fnptr, GLfloat width) {
+// (*fnptr)(width);
+// }
+// static void glowLinkProgram(GPLINKPROGRAM fnptr, GLuint program) {
+// (*fnptr)(program);
+// }
+// static void glowListDrawCommandsStatesClientNV(GPLISTDRAWCOMMANDSSTATESCLIENTNV fnptr, GLuint list, GLuint segment, const void ** indirects, const GLsizei * sizes, const GLuint * states, const GLuint * fbos, GLuint count) {
+// (*fnptr)(list, segment, indirects, sizes, states, fbos, count);
+// }
+// static void glowLogicOp(GPLOGICOP fnptr, GLenum opcode) {
+// (*fnptr)(opcode);
+// }
+// static void glowMakeBufferNonResidentNV(GPMAKEBUFFERNONRESIDENTNV fnptr, GLenum target) {
+// (*fnptr)(target);
+// }
+// static void glowMakeBufferResidentNV(GPMAKEBUFFERRESIDENTNV fnptr, GLenum target, GLenum access) {
+// (*fnptr)(target, access);
+// }
+// static void glowMakeImageHandleNonResidentARB(GPMAKEIMAGEHANDLENONRESIDENTARB fnptr, GLuint64 handle) {
+// (*fnptr)(handle);
+// }
+// static void glowMakeImageHandleNonResidentNV(GPMAKEIMAGEHANDLENONRESIDENTNV fnptr, GLuint64 handle) {
+// (*fnptr)(handle);
+// }
+// static void glowMakeImageHandleResidentARB(GPMAKEIMAGEHANDLERESIDENTARB fnptr, GLuint64 handle, GLenum access) {
+// (*fnptr)(handle, access);
+// }
+// static void glowMakeImageHandleResidentNV(GPMAKEIMAGEHANDLERESIDENTNV fnptr, GLuint64 handle, GLenum access) {
+// (*fnptr)(handle, access);
+// }
+// static void glowMakeNamedBufferNonResidentNV(GPMAKENAMEDBUFFERNONRESIDENTNV fnptr, GLuint buffer) {
+// (*fnptr)(buffer);
+// }
+// static void glowMakeNamedBufferResidentNV(GPMAKENAMEDBUFFERRESIDENTNV fnptr, GLuint buffer, GLenum access) {
+// (*fnptr)(buffer, access);
+// }
+// static void glowMakeTextureHandleNonResidentARB(GPMAKETEXTUREHANDLENONRESIDENTARB fnptr, GLuint64 handle) {
+// (*fnptr)(handle);
+// }
+// static void glowMakeTextureHandleNonResidentNV(GPMAKETEXTUREHANDLENONRESIDENTNV fnptr, GLuint64 handle) {
+// (*fnptr)(handle);
+// }
+// static void glowMakeTextureHandleResidentARB(GPMAKETEXTUREHANDLERESIDENTARB fnptr, GLuint64 handle) {
+// (*fnptr)(handle);
+// }
+// static void glowMakeTextureHandleResidentNV(GPMAKETEXTUREHANDLERESIDENTNV fnptr, GLuint64 handle) {
+// (*fnptr)(handle);
+// }
+// static void * glowMapBuffer(GPMAPBUFFER fnptr, GLenum target, GLenum access) {
+// return (*fnptr)(target, access);
+// }
+// static void * glowMapBufferRange(GPMAPBUFFERRANGE fnptr, GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access) {
+// return (*fnptr)(target, offset, length, access);
+// }
+// static void * glowMapNamedBuffer(GPMAPNAMEDBUFFER fnptr, GLuint buffer, GLenum access) {
+// return (*fnptr)(buffer, access);
+// }
+// static void * glowMapNamedBufferEXT(GPMAPNAMEDBUFFEREXT fnptr, GLuint buffer, GLenum access) {
+// return (*fnptr)(buffer, access);
+// }
+// static void * glowMapNamedBufferRange(GPMAPNAMEDBUFFERRANGE fnptr, GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access) {
+// return (*fnptr)(buffer, offset, length, access);
+// }
+// static void * glowMapNamedBufferRangeEXT(GPMAPNAMEDBUFFERRANGEEXT fnptr, GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access) {
+// return (*fnptr)(buffer, offset, length, access);
+// }
+// static void glowMatrixFrustumEXT(GPMATRIXFRUSTUMEXT fnptr, GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar) {
+// (*fnptr)(mode, left, right, bottom, top, zNear, zFar);
+// }
+// static void glowMatrixLoad3x2fNV(GPMATRIXLOAD3X2FNV fnptr, GLenum matrixMode, const GLfloat * m) {
+// (*fnptr)(matrixMode, m);
+// }
+// static void glowMatrixLoad3x3fNV(GPMATRIXLOAD3X3FNV fnptr, GLenum matrixMode, const GLfloat * m) {
+// (*fnptr)(matrixMode, m);
+// }
+// static void glowMatrixLoadIdentityEXT(GPMATRIXLOADIDENTITYEXT fnptr, GLenum mode) {
+// (*fnptr)(mode);
+// }
+// static void glowMatrixLoadTranspose3x3fNV(GPMATRIXLOADTRANSPOSE3X3FNV fnptr, GLenum matrixMode, const GLfloat * m) {
+// (*fnptr)(matrixMode, m);
+// }
+// static void glowMatrixLoadTransposedEXT(GPMATRIXLOADTRANSPOSEDEXT fnptr, GLenum mode, const GLdouble * m) {
+// (*fnptr)(mode, m);
+// }
+// static void glowMatrixLoadTransposefEXT(GPMATRIXLOADTRANSPOSEFEXT fnptr, GLenum mode, const GLfloat * m) {
+// (*fnptr)(mode, m);
+// }
+// static void glowMatrixLoaddEXT(GPMATRIXLOADDEXT fnptr, GLenum mode, const GLdouble * m) {
+// (*fnptr)(mode, m);
+// }
+// static void glowMatrixLoadfEXT(GPMATRIXLOADFEXT fnptr, GLenum mode, const GLfloat * m) {
+// (*fnptr)(mode, m);
+// }
+// static void glowMatrixMult3x2fNV(GPMATRIXMULT3X2FNV fnptr, GLenum matrixMode, const GLfloat * m) {
+// (*fnptr)(matrixMode, m);
+// }
+// static void glowMatrixMult3x3fNV(GPMATRIXMULT3X3FNV fnptr, GLenum matrixMode, const GLfloat * m) {
+// (*fnptr)(matrixMode, m);
+// }
+// static void glowMatrixMultTranspose3x3fNV(GPMATRIXMULTTRANSPOSE3X3FNV fnptr, GLenum matrixMode, const GLfloat * m) {
+// (*fnptr)(matrixMode, m);
+// }
+// static void glowMatrixMultTransposedEXT(GPMATRIXMULTTRANSPOSEDEXT fnptr, GLenum mode, const GLdouble * m) {
+// (*fnptr)(mode, m);
+// }
+// static void glowMatrixMultTransposefEXT(GPMATRIXMULTTRANSPOSEFEXT fnptr, GLenum mode, const GLfloat * m) {
+// (*fnptr)(mode, m);
+// }
+// static void glowMatrixMultdEXT(GPMATRIXMULTDEXT fnptr, GLenum mode, const GLdouble * m) {
+// (*fnptr)(mode, m);
+// }
+// static void glowMatrixMultfEXT(GPMATRIXMULTFEXT fnptr, GLenum mode, const GLfloat * m) {
+// (*fnptr)(mode, m);
+// }
+// static void glowMatrixOrthoEXT(GPMATRIXORTHOEXT fnptr, GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar) {
+// (*fnptr)(mode, left, right, bottom, top, zNear, zFar);
+// }
+// static void glowMatrixPopEXT(GPMATRIXPOPEXT fnptr, GLenum mode) {
+// (*fnptr)(mode);
+// }
+// static void glowMatrixPushEXT(GPMATRIXPUSHEXT fnptr, GLenum mode) {
+// (*fnptr)(mode);
+// }
+// static void glowMatrixRotatedEXT(GPMATRIXROTATEDEXT fnptr, GLenum mode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z) {
+// (*fnptr)(mode, angle, x, y, z);
+// }
+// static void glowMatrixRotatefEXT(GPMATRIXROTATEFEXT fnptr, GLenum mode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z) {
+// (*fnptr)(mode, angle, x, y, z);
+// }
+// static void glowMatrixScaledEXT(GPMATRIXSCALEDEXT fnptr, GLenum mode, GLdouble x, GLdouble y, GLdouble z) {
+// (*fnptr)(mode, x, y, z);
+// }
+// static void glowMatrixScalefEXT(GPMATRIXSCALEFEXT fnptr, GLenum mode, GLfloat x, GLfloat y, GLfloat z) {
+// (*fnptr)(mode, x, y, z);
+// }
+// static void glowMatrixTranslatedEXT(GPMATRIXTRANSLATEDEXT fnptr, GLenum mode, GLdouble x, GLdouble y, GLdouble z) {
+// (*fnptr)(mode, x, y, z);
+// }
+// static void glowMatrixTranslatefEXT(GPMATRIXTRANSLATEFEXT fnptr, GLenum mode, GLfloat x, GLfloat y, GLfloat z) {
+// (*fnptr)(mode, x, y, z);
+// }
+// static void glowMaxShaderCompilerThreadsARB(GPMAXSHADERCOMPILERTHREADSARB fnptr, GLuint count) {
+// (*fnptr)(count);
+// }
+// static void glowMaxShaderCompilerThreadsKHR(GPMAXSHADERCOMPILERTHREADSKHR fnptr, GLuint count) {
+// (*fnptr)(count);
+// }
+// static void glowMemoryBarrier(GPMEMORYBARRIER fnptr, GLbitfield barriers) {
+// (*fnptr)(barriers);
+// }
+// static void glowMemoryBarrierByRegion(GPMEMORYBARRIERBYREGION fnptr, GLbitfield barriers) {
+// (*fnptr)(barriers);
+// }
+// static void glowMinSampleShadingARB(GPMINSAMPLESHADINGARB fnptr, GLfloat value) {
+// (*fnptr)(value);
+// }
+// static void glowMultiDrawArrays(GPMULTIDRAWARRAYS fnptr, GLenum mode, const GLint * first, const GLsizei * count, GLsizei drawcount) {
+// (*fnptr)(mode, first, count, drawcount);
+// }
+// static void glowMultiDrawArraysIndirect(GPMULTIDRAWARRAYSINDIRECT fnptr, GLenum mode, const void * indirect, GLsizei drawcount, GLsizei stride) {
+// (*fnptr)(mode, indirect, drawcount, stride);
+// }
+// static void glowMultiDrawArraysIndirectBindlessCountNV(GPMULTIDRAWARRAYSINDIRECTBINDLESSCOUNTNV fnptr, GLenum mode, const void * indirect, GLsizei drawCount, GLsizei maxDrawCount, GLsizei stride, GLint vertexBufferCount) {
+// (*fnptr)(mode, indirect, drawCount, maxDrawCount, stride, vertexBufferCount);
+// }
+// static void glowMultiDrawArraysIndirectBindlessNV(GPMULTIDRAWARRAYSINDIRECTBINDLESSNV fnptr, GLenum mode, const void * indirect, GLsizei drawCount, GLsizei stride, GLint vertexBufferCount) {
+// (*fnptr)(mode, indirect, drawCount, stride, vertexBufferCount);
+// }
+// static void glowMultiDrawArraysIndirectCountARB(GPMULTIDRAWARRAYSINDIRECTCOUNTARB fnptr, GLenum mode, const void * indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride) {
+// (*fnptr)(mode, indirect, drawcount, maxdrawcount, stride);
+// }
+// static void glowMultiDrawElements(GPMULTIDRAWELEMENTS fnptr, GLenum mode, const GLsizei * count, GLenum type, const void *const* indices, GLsizei drawcount) {
+// (*fnptr)(mode, count, type, indices, drawcount);
+// }
+// static void glowMultiDrawElementsBaseVertex(GPMULTIDRAWELEMENTSBASEVERTEX fnptr, GLenum mode, const GLsizei * count, GLenum type, const void *const* indices, GLsizei drawcount, const GLint * basevertex) {
+// (*fnptr)(mode, count, type, indices, drawcount, basevertex);
+// }
+// static void glowMultiDrawElementsIndirect(GPMULTIDRAWELEMENTSINDIRECT fnptr, GLenum mode, GLenum type, const void * indirect, GLsizei drawcount, GLsizei stride) {
+// (*fnptr)(mode, type, indirect, drawcount, stride);
+// }
+// static void glowMultiDrawElementsIndirectBindlessCountNV(GPMULTIDRAWELEMENTSINDIRECTBINDLESSCOUNTNV fnptr, GLenum mode, GLenum type, const void * indirect, GLsizei drawCount, GLsizei maxDrawCount, GLsizei stride, GLint vertexBufferCount) {
+// (*fnptr)(mode, type, indirect, drawCount, maxDrawCount, stride, vertexBufferCount);
+// }
+// static void glowMultiDrawElementsIndirectBindlessNV(GPMULTIDRAWELEMENTSINDIRECTBINDLESSNV fnptr, GLenum mode, GLenum type, const void * indirect, GLsizei drawCount, GLsizei stride, GLint vertexBufferCount) {
+// (*fnptr)(mode, type, indirect, drawCount, stride, vertexBufferCount);
+// }
+// static void glowMultiDrawElementsIndirectCountARB(GPMULTIDRAWELEMENTSINDIRECTCOUNTARB fnptr, GLenum mode, GLenum type, const void * indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride) {
+// (*fnptr)(mode, type, indirect, drawcount, maxdrawcount, stride);
+// }
+// static void glowMultiDrawMeshTasksIndirectCountNV(GPMULTIDRAWMESHTASKSINDIRECTCOUNTNV fnptr, GLintptr indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride) {
+// (*fnptr)(indirect, drawcount, maxdrawcount, stride);
+// }
+// static void glowMultiDrawMeshTasksIndirectNV(GPMULTIDRAWMESHTASKSINDIRECTNV fnptr, GLintptr indirect, GLsizei drawcount, GLsizei stride) {
+// (*fnptr)(indirect, drawcount, stride);
+// }
+// static void glowMultiTexBufferEXT(GPMULTITEXBUFFEREXT fnptr, GLenum texunit, GLenum target, GLenum internalformat, GLuint buffer) {
+// (*fnptr)(texunit, target, internalformat, buffer);
+// }
+// static void glowMultiTexCoordPointerEXT(GPMULTITEXCOORDPOINTEREXT fnptr, GLenum texunit, GLint size, GLenum type, GLsizei stride, const void * pointer) {
+// (*fnptr)(texunit, size, type, stride, pointer);
+// }
+// static void glowMultiTexEnvfEXT(GPMULTITEXENVFEXT fnptr, GLenum texunit, GLenum target, GLenum pname, GLfloat param) {
+// (*fnptr)(texunit, target, pname, param);
+// }
+// static void glowMultiTexEnvfvEXT(GPMULTITEXENVFVEXT fnptr, GLenum texunit, GLenum target, GLenum pname, const GLfloat * params) {
+// (*fnptr)(texunit, target, pname, params);
+// }
+// static void glowMultiTexEnviEXT(GPMULTITEXENVIEXT fnptr, GLenum texunit, GLenum target, GLenum pname, GLint param) {
+// (*fnptr)(texunit, target, pname, param);
+// }
+// static void glowMultiTexEnvivEXT(GPMULTITEXENVIVEXT fnptr, GLenum texunit, GLenum target, GLenum pname, const GLint * params) {
+// (*fnptr)(texunit, target, pname, params);
+// }
+// static void glowMultiTexGendEXT(GPMULTITEXGENDEXT fnptr, GLenum texunit, GLenum coord, GLenum pname, GLdouble param) {
+// (*fnptr)(texunit, coord, pname, param);
+// }
+// static void glowMultiTexGendvEXT(GPMULTITEXGENDVEXT fnptr, GLenum texunit, GLenum coord, GLenum pname, const GLdouble * params) {
+// (*fnptr)(texunit, coord, pname, params);
+// }
+// static void glowMultiTexGenfEXT(GPMULTITEXGENFEXT fnptr, GLenum texunit, GLenum coord, GLenum pname, GLfloat param) {
+// (*fnptr)(texunit, coord, pname, param);
+// }
+// static void glowMultiTexGenfvEXT(GPMULTITEXGENFVEXT fnptr, GLenum texunit, GLenum coord, GLenum pname, const GLfloat * params) {
+// (*fnptr)(texunit, coord, pname, params);
+// }
+// static void glowMultiTexGeniEXT(GPMULTITEXGENIEXT fnptr, GLenum texunit, GLenum coord, GLenum pname, GLint param) {
+// (*fnptr)(texunit, coord, pname, param);
+// }
+// static void glowMultiTexGenivEXT(GPMULTITEXGENIVEXT fnptr, GLenum texunit, GLenum coord, GLenum pname, const GLint * params) {
+// (*fnptr)(texunit, coord, pname, params);
+// }
+// static void glowMultiTexImage1DEXT(GPMULTITEXIMAGE1DEXT fnptr, GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void * pixels) {
+// (*fnptr)(texunit, target, level, internalformat, width, border, format, type, pixels);
+// }
+// static void glowMultiTexImage2DEXT(GPMULTITEXIMAGE2DEXT fnptr, GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void * pixels) {
+// (*fnptr)(texunit, target, level, internalformat, width, height, border, format, type, pixels);
+// }
+// static void glowMultiTexImage3DEXT(GPMULTITEXIMAGE3DEXT fnptr, GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void * pixels) {
+// (*fnptr)(texunit, target, level, internalformat, width, height, depth, border, format, type, pixels);
+// }
+// static void glowMultiTexParameterIivEXT(GPMULTITEXPARAMETERIIVEXT fnptr, GLenum texunit, GLenum target, GLenum pname, const GLint * params) {
+// (*fnptr)(texunit, target, pname, params);
+// }
+// static void glowMultiTexParameterIuivEXT(GPMULTITEXPARAMETERIUIVEXT fnptr, GLenum texunit, GLenum target, GLenum pname, const GLuint * params) {
+// (*fnptr)(texunit, target, pname, params);
+// }
+// static void glowMultiTexParameterfEXT(GPMULTITEXPARAMETERFEXT fnptr, GLenum texunit, GLenum target, GLenum pname, GLfloat param) {
+// (*fnptr)(texunit, target, pname, param);
+// }
+// static void glowMultiTexParameterfvEXT(GPMULTITEXPARAMETERFVEXT fnptr, GLenum texunit, GLenum target, GLenum pname, const GLfloat * params) {
+// (*fnptr)(texunit, target, pname, params);
+// }
+// static void glowMultiTexParameteriEXT(GPMULTITEXPARAMETERIEXT fnptr, GLenum texunit, GLenum target, GLenum pname, GLint param) {
+// (*fnptr)(texunit, target, pname, param);
+// }
+// static void glowMultiTexParameterivEXT(GPMULTITEXPARAMETERIVEXT fnptr, GLenum texunit, GLenum target, GLenum pname, const GLint * params) {
+// (*fnptr)(texunit, target, pname, params);
+// }
+// static void glowMultiTexRenderbufferEXT(GPMULTITEXRENDERBUFFEREXT fnptr, GLenum texunit, GLenum target, GLuint renderbuffer) {
+// (*fnptr)(texunit, target, renderbuffer);
+// }
+// static void glowMultiTexSubImage1DEXT(GPMULTITEXSUBIMAGE1DEXT fnptr, GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void * pixels) {
+// (*fnptr)(texunit, target, level, xoffset, width, format, type, pixels);
+// }
+// static void glowMultiTexSubImage2DEXT(GPMULTITEXSUBIMAGE2DEXT fnptr, GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void * pixels) {
+// (*fnptr)(texunit, target, level, xoffset, yoffset, width, height, format, type, pixels);
+// }
+// static void glowMultiTexSubImage3DEXT(GPMULTITEXSUBIMAGE3DEXT fnptr, GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void * pixels) {
+// (*fnptr)(texunit, target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels);
+// }
+// static void glowNamedBufferAttachMemoryNV(GPNAMEDBUFFERATTACHMEMORYNV fnptr, GLuint buffer, GLuint memory, GLuint64 offset) {
+// (*fnptr)(buffer, memory, offset);
+// }
+// static void glowNamedBufferData(GPNAMEDBUFFERDATA fnptr, GLuint buffer, GLsizeiptr size, const void * data, GLenum usage) {
+// (*fnptr)(buffer, size, data, usage);
+// }
+// static void glowNamedBufferDataEXT(GPNAMEDBUFFERDATAEXT fnptr, GLuint buffer, GLsizeiptr size, const void * data, GLenum usage) {
+// (*fnptr)(buffer, size, data, usage);
+// }
+// static void glowNamedBufferPageCommitmentARB(GPNAMEDBUFFERPAGECOMMITMENTARB fnptr, GLuint buffer, GLintptr offset, GLsizeiptr size, GLboolean commit) {
+// (*fnptr)(buffer, offset, size, commit);
+// }
+// static void glowNamedBufferPageCommitmentEXT(GPNAMEDBUFFERPAGECOMMITMENTEXT fnptr, GLuint buffer, GLintptr offset, GLsizeiptr size, GLboolean commit) {
+// (*fnptr)(buffer, offset, size, commit);
+// }
+// static void glowNamedBufferPageCommitmentMemNV(GPNAMEDBUFFERPAGECOMMITMENTMEMNV fnptr, GLuint buffer, GLintptr offset, GLsizeiptr size, GLuint memory, GLuint64 memOffset, GLboolean commit) {
+// (*fnptr)(buffer, offset, size, memory, memOffset, commit);
+// }
+// static void glowNamedBufferStorage(GPNAMEDBUFFERSTORAGE fnptr, GLuint buffer, GLsizeiptr size, const void * data, GLbitfield flags) {
+// (*fnptr)(buffer, size, data, flags);
+// }
+// static void glowNamedBufferStorageEXT(GPNAMEDBUFFERSTORAGEEXT fnptr, GLuint buffer, GLsizeiptr size, const void * data, GLbitfield flags) {
+// (*fnptr)(buffer, size, data, flags);
+// }
+// static void glowNamedBufferSubData(GPNAMEDBUFFERSUBDATA fnptr, GLuint buffer, GLintptr offset, GLsizeiptr size, const void * data) {
+// (*fnptr)(buffer, offset, size, data);
+// }
+// static void glowNamedBufferSubDataEXT(GPNAMEDBUFFERSUBDATAEXT fnptr, GLuint buffer, GLintptr offset, GLsizeiptr size, const void * data) {
+// (*fnptr)(buffer, offset, size, data);
+// }
+// static void glowNamedCopyBufferSubDataEXT(GPNAMEDCOPYBUFFERSUBDATAEXT fnptr, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size) {
+// (*fnptr)(readBuffer, writeBuffer, readOffset, writeOffset, size);
+// }
+// static void glowNamedFramebufferDrawBuffer(GPNAMEDFRAMEBUFFERDRAWBUFFER fnptr, GLuint framebuffer, GLenum buf) {
+// (*fnptr)(framebuffer, buf);
+// }
+// static void glowNamedFramebufferDrawBuffers(GPNAMEDFRAMEBUFFERDRAWBUFFERS fnptr, GLuint framebuffer, GLsizei n, const GLenum * bufs) {
+// (*fnptr)(framebuffer, n, bufs);
+// }
+// static void glowNamedFramebufferParameteri(GPNAMEDFRAMEBUFFERPARAMETERI fnptr, GLuint framebuffer, GLenum pname, GLint param) {
+// (*fnptr)(framebuffer, pname, param);
+// }
+// static void glowNamedFramebufferParameteriEXT(GPNAMEDFRAMEBUFFERPARAMETERIEXT fnptr, GLuint framebuffer, GLenum pname, GLint param) {
+// (*fnptr)(framebuffer, pname, param);
+// }
+// static void glowNamedFramebufferReadBuffer(GPNAMEDFRAMEBUFFERREADBUFFER fnptr, GLuint framebuffer, GLenum src) {
+// (*fnptr)(framebuffer, src);
+// }
+// static void glowNamedFramebufferRenderbuffer(GPNAMEDFRAMEBUFFERRENDERBUFFER fnptr, GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) {
+// (*fnptr)(framebuffer, attachment, renderbuffertarget, renderbuffer);
+// }
+// static void glowNamedFramebufferRenderbufferEXT(GPNAMEDFRAMEBUFFERRENDERBUFFEREXT fnptr, GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) {
+// (*fnptr)(framebuffer, attachment, renderbuffertarget, renderbuffer);
+// }
+// static void glowNamedFramebufferSampleLocationsfvARB(GPNAMEDFRAMEBUFFERSAMPLELOCATIONSFVARB fnptr, GLuint framebuffer, GLuint start, GLsizei count, const GLfloat * v) {
+// (*fnptr)(framebuffer, start, count, v);
+// }
+// static void glowNamedFramebufferSampleLocationsfvNV(GPNAMEDFRAMEBUFFERSAMPLELOCATIONSFVNV fnptr, GLuint framebuffer, GLuint start, GLsizei count, const GLfloat * v) {
+// (*fnptr)(framebuffer, start, count, v);
+// }
+// static void glowNamedFramebufferTexture(GPNAMEDFRAMEBUFFERTEXTURE fnptr, GLuint framebuffer, GLenum attachment, GLuint texture, GLint level) {
+// (*fnptr)(framebuffer, attachment, texture, level);
+// }
+// static void glowNamedFramebufferTexture1DEXT(GPNAMEDFRAMEBUFFERTEXTURE1DEXT fnptr, GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level) {
+// (*fnptr)(framebuffer, attachment, textarget, texture, level);
+// }
+// static void glowNamedFramebufferTexture2DEXT(GPNAMEDFRAMEBUFFERTEXTURE2DEXT fnptr, GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level) {
+// (*fnptr)(framebuffer, attachment, textarget, texture, level);
+// }
+// static void glowNamedFramebufferTexture3DEXT(GPNAMEDFRAMEBUFFERTEXTURE3DEXT fnptr, GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset) {
+// (*fnptr)(framebuffer, attachment, textarget, texture, level, zoffset);
+// }
+// static void glowNamedFramebufferTextureEXT(GPNAMEDFRAMEBUFFERTEXTUREEXT fnptr, GLuint framebuffer, GLenum attachment, GLuint texture, GLint level) {
+// (*fnptr)(framebuffer, attachment, texture, level);
+// }
+// static void glowNamedFramebufferTextureFaceEXT(GPNAMEDFRAMEBUFFERTEXTUREFACEEXT fnptr, GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLenum face) {
+// (*fnptr)(framebuffer, attachment, texture, level, face);
+// }
+// static void glowNamedFramebufferTextureLayer(GPNAMEDFRAMEBUFFERTEXTURELAYER fnptr, GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer) {
+// (*fnptr)(framebuffer, attachment, texture, level, layer);
+// }
+// static void glowNamedFramebufferTextureLayerEXT(GPNAMEDFRAMEBUFFERTEXTURELAYEREXT fnptr, GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer) {
+// (*fnptr)(framebuffer, attachment, texture, level, layer);
+// }
+// static void glowNamedProgramLocalParameter4dEXT(GPNAMEDPROGRAMLOCALPARAMETER4DEXT fnptr, GLuint program, GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) {
+// (*fnptr)(program, target, index, x, y, z, w);
+// }
+// static void glowNamedProgramLocalParameter4dvEXT(GPNAMEDPROGRAMLOCALPARAMETER4DVEXT fnptr, GLuint program, GLenum target, GLuint index, const GLdouble * params) {
+// (*fnptr)(program, target, index, params);
+// }
+// static void glowNamedProgramLocalParameter4fEXT(GPNAMEDPROGRAMLOCALPARAMETER4FEXT fnptr, GLuint program, GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) {
+// (*fnptr)(program, target, index, x, y, z, w);
+// }
+// static void glowNamedProgramLocalParameter4fvEXT(GPNAMEDPROGRAMLOCALPARAMETER4FVEXT fnptr, GLuint program, GLenum target, GLuint index, const GLfloat * params) {
+// (*fnptr)(program, target, index, params);
+// }
+// static void glowNamedProgramLocalParameterI4iEXT(GPNAMEDPROGRAMLOCALPARAMETERI4IEXT fnptr, GLuint program, GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w) {
+// (*fnptr)(program, target, index, x, y, z, w);
+// }
+// static void glowNamedProgramLocalParameterI4ivEXT(GPNAMEDPROGRAMLOCALPARAMETERI4IVEXT fnptr, GLuint program, GLenum target, GLuint index, const GLint * params) {
+// (*fnptr)(program, target, index, params);
+// }
+// static void glowNamedProgramLocalParameterI4uiEXT(GPNAMEDPROGRAMLOCALPARAMETERI4UIEXT fnptr, GLuint program, GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w) {
+// (*fnptr)(program, target, index, x, y, z, w);
+// }
+// static void glowNamedProgramLocalParameterI4uivEXT(GPNAMEDPROGRAMLOCALPARAMETERI4UIVEXT fnptr, GLuint program, GLenum target, GLuint index, const GLuint * params) {
+// (*fnptr)(program, target, index, params);
+// }
+// static void glowNamedProgramLocalParameters4fvEXT(GPNAMEDPROGRAMLOCALPARAMETERS4FVEXT fnptr, GLuint program, GLenum target, GLuint index, GLsizei count, const GLfloat * params) {
+// (*fnptr)(program, target, index, count, params);
+// }
+// static void glowNamedProgramLocalParametersI4ivEXT(GPNAMEDPROGRAMLOCALPARAMETERSI4IVEXT fnptr, GLuint program, GLenum target, GLuint index, GLsizei count, const GLint * params) {
+// (*fnptr)(program, target, index, count, params);
+// }
+// static void glowNamedProgramLocalParametersI4uivEXT(GPNAMEDPROGRAMLOCALPARAMETERSI4UIVEXT fnptr, GLuint program, GLenum target, GLuint index, GLsizei count, const GLuint * params) {
+// (*fnptr)(program, target, index, count, params);
+// }
+// static void glowNamedProgramStringEXT(GPNAMEDPROGRAMSTRINGEXT fnptr, GLuint program, GLenum target, GLenum format, GLsizei len, const void * string) {
+// (*fnptr)(program, target, format, len, string);
+// }
+// static void glowNamedRenderbufferStorage(GPNAMEDRENDERBUFFERSTORAGE fnptr, GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height) {
+// (*fnptr)(renderbuffer, internalformat, width, height);
+// }
+// static void glowNamedRenderbufferStorageEXT(GPNAMEDRENDERBUFFERSTORAGEEXT fnptr, GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height) {
+// (*fnptr)(renderbuffer, internalformat, width, height);
+// }
+// static void glowNamedRenderbufferStorageMultisample(GPNAMEDRENDERBUFFERSTORAGEMULTISAMPLE fnptr, GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) {
+// (*fnptr)(renderbuffer, samples, internalformat, width, height);
+// }
+// static void glowNamedRenderbufferStorageMultisampleAdvancedAMD(GPNAMEDRENDERBUFFERSTORAGEMULTISAMPLEADVANCEDAMD fnptr, GLuint renderbuffer, GLsizei samples, GLsizei storageSamples, GLenum internalformat, GLsizei width, GLsizei height) {
+// (*fnptr)(renderbuffer, samples, storageSamples, internalformat, width, height);
+// }
+// static void glowNamedRenderbufferStorageMultisampleCoverageEXT(GPNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXT fnptr, GLuint renderbuffer, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height) {
+// (*fnptr)(renderbuffer, coverageSamples, colorSamples, internalformat, width, height);
+// }
+// static void glowNamedRenderbufferStorageMultisampleEXT(GPNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXT fnptr, GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) {
+// (*fnptr)(renderbuffer, samples, internalformat, width, height);
+// }
+// static void glowNamedStringARB(GPNAMEDSTRINGARB fnptr, GLenum type, GLint namelen, const GLchar * name, GLint stringlen, const GLchar * string) {
+// (*fnptr)(type, namelen, name, stringlen, string);
+// }
+// static void glowNormalFormatNV(GPNORMALFORMATNV fnptr, GLenum type, GLsizei stride) {
+// (*fnptr)(type, stride);
+// }
+// static void glowObjectLabel(GPOBJECTLABEL fnptr, GLenum identifier, GLuint name, GLsizei length, const GLchar * label) {
+// (*fnptr)(identifier, name, length, label);
+// }
+// static void glowObjectLabelKHR(GPOBJECTLABELKHR fnptr, GLenum identifier, GLuint name, GLsizei length, const GLchar * label) {
+// (*fnptr)(identifier, name, length, label);
+// }
+// static void glowObjectPtrLabel(GPOBJECTPTRLABEL fnptr, const void * ptr, GLsizei length, const GLchar * label) {
+// (*fnptr)(ptr, length, label);
+// }
+// static void glowObjectPtrLabelKHR(GPOBJECTPTRLABELKHR fnptr, const void * ptr, GLsizei length, const GLchar * label) {
+// (*fnptr)(ptr, length, label);
+// }
+// static void glowPatchParameterfv(GPPATCHPARAMETERFV fnptr, GLenum pname, const GLfloat * values) {
+// (*fnptr)(pname, values);
+// }
+// static void glowPatchParameteri(GPPATCHPARAMETERI fnptr, GLenum pname, GLint value) {
+// (*fnptr)(pname, value);
+// }
+// static void glowPathCommandsNV(GPPATHCOMMANDSNV fnptr, GLuint path, GLsizei numCommands, const GLubyte * commands, GLsizei numCoords, GLenum coordType, const void * coords) {
+// (*fnptr)(path, numCommands, commands, numCoords, coordType, coords);
+// }
+// static void glowPathCoordsNV(GPPATHCOORDSNV fnptr, GLuint path, GLsizei numCoords, GLenum coordType, const void * coords) {
+// (*fnptr)(path, numCoords, coordType, coords);
+// }
+// static void glowPathCoverDepthFuncNV(GPPATHCOVERDEPTHFUNCNV fnptr, GLenum func) {
+// (*fnptr)(func);
+// }
+// static void glowPathDashArrayNV(GPPATHDASHARRAYNV fnptr, GLuint path, GLsizei dashCount, const GLfloat * dashArray) {
+// (*fnptr)(path, dashCount, dashArray);
+// }
+// static GLenum glowPathGlyphIndexArrayNV(GPPATHGLYPHINDEXARRAYNV fnptr, GLuint firstPathName, GLenum fontTarget, const void * fontName, GLbitfield fontStyle, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale) {
+// return (*fnptr)(firstPathName, fontTarget, fontName, fontStyle, firstGlyphIndex, numGlyphs, pathParameterTemplate, emScale);
+// }
+// static GLenum glowPathGlyphIndexRangeNV(GPPATHGLYPHINDEXRANGENV fnptr, GLenum fontTarget, const void * fontName, GLbitfield fontStyle, GLuint pathParameterTemplate, GLfloat emScale, GLuint * baseAndCount) {
+// return (*fnptr)(fontTarget, fontName, fontStyle, pathParameterTemplate, emScale, baseAndCount);
+// }
+// static void glowPathGlyphRangeNV(GPPATHGLYPHRANGENV fnptr, GLuint firstPathName, GLenum fontTarget, const void * fontName, GLbitfield fontStyle, GLuint firstGlyph, GLsizei numGlyphs, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale) {
+// (*fnptr)(firstPathName, fontTarget, fontName, fontStyle, firstGlyph, numGlyphs, handleMissingGlyphs, pathParameterTemplate, emScale);
+// }
+// static void glowPathGlyphsNV(GPPATHGLYPHSNV fnptr, GLuint firstPathName, GLenum fontTarget, const void * fontName, GLbitfield fontStyle, GLsizei numGlyphs, GLenum type, const void * charcodes, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale) {
+// (*fnptr)(firstPathName, fontTarget, fontName, fontStyle, numGlyphs, type, charcodes, handleMissingGlyphs, pathParameterTemplate, emScale);
+// }
+// static GLenum glowPathMemoryGlyphIndexArrayNV(GPPATHMEMORYGLYPHINDEXARRAYNV fnptr, GLuint firstPathName, GLenum fontTarget, GLsizeiptr fontSize, const void * fontData, GLsizei faceIndex, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale) {
+// return (*fnptr)(firstPathName, fontTarget, fontSize, fontData, faceIndex, firstGlyphIndex, numGlyphs, pathParameterTemplate, emScale);
+// }
+// static void glowPathParameterfNV(GPPATHPARAMETERFNV fnptr, GLuint path, GLenum pname, GLfloat value) {
+// (*fnptr)(path, pname, value);
+// }
+// static void glowPathParameterfvNV(GPPATHPARAMETERFVNV fnptr, GLuint path, GLenum pname, const GLfloat * value) {
+// (*fnptr)(path, pname, value);
+// }
+// static void glowPathParameteriNV(GPPATHPARAMETERINV fnptr, GLuint path, GLenum pname, GLint value) {
+// (*fnptr)(path, pname, value);
+// }
+// static void glowPathParameterivNV(GPPATHPARAMETERIVNV fnptr, GLuint path, GLenum pname, const GLint * value) {
+// (*fnptr)(path, pname, value);
+// }
+// static void glowPathStencilDepthOffsetNV(GPPATHSTENCILDEPTHOFFSETNV fnptr, GLfloat factor, GLfloat units) {
+// (*fnptr)(factor, units);
+// }
+// static void glowPathStencilFuncNV(GPPATHSTENCILFUNCNV fnptr, GLenum func, GLint ref, GLuint mask) {
+// (*fnptr)(func, ref, mask);
+// }
+// static void glowPathStringNV(GPPATHSTRINGNV fnptr, GLuint path, GLenum format, GLsizei length, const void * pathString) {
+// (*fnptr)(path, format, length, pathString);
+// }
+// static void glowPathSubCommandsNV(GPPATHSUBCOMMANDSNV fnptr, GLuint path, GLsizei commandStart, GLsizei commandsToDelete, GLsizei numCommands, const GLubyte * commands, GLsizei numCoords, GLenum coordType, const void * coords) {
+// (*fnptr)(path, commandStart, commandsToDelete, numCommands, commands, numCoords, coordType, coords);
+// }
+// static void glowPathSubCoordsNV(GPPATHSUBCOORDSNV fnptr, GLuint path, GLsizei coordStart, GLsizei numCoords, GLenum coordType, const void * coords) {
+// (*fnptr)(path, coordStart, numCoords, coordType, coords);
+// }
+// static void glowPauseTransformFeedback(GPPAUSETRANSFORMFEEDBACK fnptr) {
+// (*fnptr)();
+// }
+// static void glowPixelStoref(GPPIXELSTOREF fnptr, GLenum pname, GLfloat param) {
+// (*fnptr)(pname, param);
+// }
+// static void glowPixelStorei(GPPIXELSTOREI fnptr, GLenum pname, GLint param) {
+// (*fnptr)(pname, param);
+// }
+// static GLboolean glowPointAlongPathNV(GPPOINTALONGPATHNV fnptr, GLuint path, GLsizei startSegment, GLsizei numSegments, GLfloat distance, GLfloat * x, GLfloat * y, GLfloat * tangentX, GLfloat * tangentY) {
+// return (*fnptr)(path, startSegment, numSegments, distance, x, y, tangentX, tangentY);
+// }
+// static void glowPointParameterf(GPPOINTPARAMETERF fnptr, GLenum pname, GLfloat param) {
+// (*fnptr)(pname, param);
+// }
+// static void glowPointParameterfv(GPPOINTPARAMETERFV fnptr, GLenum pname, const GLfloat * params) {
+// (*fnptr)(pname, params);
+// }
+// static void glowPointParameteri(GPPOINTPARAMETERI fnptr, GLenum pname, GLint param) {
+// (*fnptr)(pname, param);
+// }
+// static void glowPointParameteriv(GPPOINTPARAMETERIV fnptr, GLenum pname, const GLint * params) {
+// (*fnptr)(pname, params);
+// }
+// static void glowPointSize(GPPOINTSIZE fnptr, GLfloat size) {
+// (*fnptr)(size);
+// }
+// static void glowPolygonMode(GPPOLYGONMODE fnptr, GLenum face, GLenum mode) {
+// (*fnptr)(face, mode);
+// }
+// static void glowPolygonOffset(GPPOLYGONOFFSET fnptr, GLfloat factor, GLfloat units) {
+// (*fnptr)(factor, units);
+// }
+// static void glowPolygonOffsetClamp(GPPOLYGONOFFSETCLAMP fnptr, GLfloat factor, GLfloat units, GLfloat clamp) {
+// (*fnptr)(factor, units, clamp);
+// }
+// static void glowPolygonOffsetClampEXT(GPPOLYGONOFFSETCLAMPEXT fnptr, GLfloat factor, GLfloat units, GLfloat clamp) {
+// (*fnptr)(factor, units, clamp);
+// }
+// static void glowPopDebugGroup(GPPOPDEBUGGROUP fnptr) {
+// (*fnptr)();
+// }
+// static void glowPopDebugGroupKHR(GPPOPDEBUGGROUPKHR fnptr) {
+// (*fnptr)();
+// }
+// static void glowPopGroupMarkerEXT(GPPOPGROUPMARKEREXT fnptr) {
+// (*fnptr)();
+// }
+// static void glowPrimitiveBoundingBoxARB(GPPRIMITIVEBOUNDINGBOXARB fnptr, GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW) {
+// (*fnptr)(minX, minY, minZ, minW, maxX, maxY, maxZ, maxW);
+// }
+// static void glowPrimitiveRestartIndex(GPPRIMITIVERESTARTINDEX fnptr, GLuint index) {
+// (*fnptr)(index);
+// }
+// static void glowProgramBinary(GPPROGRAMBINARY fnptr, GLuint program, GLenum binaryFormat, const void * binary, GLsizei length) {
+// (*fnptr)(program, binaryFormat, binary, length);
+// }
+// static void glowProgramParameteri(GPPROGRAMPARAMETERI fnptr, GLuint program, GLenum pname, GLint value) {
+// (*fnptr)(program, pname, value);
+// }
+// static void glowProgramParameteriARB(GPPROGRAMPARAMETERIARB fnptr, GLuint program, GLenum pname, GLint value) {
+// (*fnptr)(program, pname, value);
+// }
+// static void glowProgramParameteriEXT(GPPROGRAMPARAMETERIEXT fnptr, GLuint program, GLenum pname, GLint value) {
+// (*fnptr)(program, pname, value);
+// }
+// static void glowProgramPathFragmentInputGenNV(GPPROGRAMPATHFRAGMENTINPUTGENNV fnptr, GLuint program, GLint location, GLenum genMode, GLint components, const GLfloat * coeffs) {
+// (*fnptr)(program, location, genMode, components, coeffs);
+// }
+// static void glowProgramUniform1d(GPPROGRAMUNIFORM1D fnptr, GLuint program, GLint location, GLdouble v0) {
+// (*fnptr)(program, location, v0);
+// }
+// static void glowProgramUniform1dEXT(GPPROGRAMUNIFORM1DEXT fnptr, GLuint program, GLint location, GLdouble x) {
+// (*fnptr)(program, location, x);
+// }
+// static void glowProgramUniform1dv(GPPROGRAMUNIFORM1DV fnptr, GLuint program, GLint location, GLsizei count, const GLdouble * value) {
+// (*fnptr)(program, location, count, value);
+// }
+// static void glowProgramUniform1dvEXT(GPPROGRAMUNIFORM1DVEXT fnptr, GLuint program, GLint location, GLsizei count, const GLdouble * value) {
+// (*fnptr)(program, location, count, value);
+// }
+// static void glowProgramUniform1f(GPPROGRAMUNIFORM1F fnptr, GLuint program, GLint location, GLfloat v0) {
+// (*fnptr)(program, location, v0);
+// }
+// static void glowProgramUniform1fEXT(GPPROGRAMUNIFORM1FEXT fnptr, GLuint program, GLint location, GLfloat v0) {
+// (*fnptr)(program, location, v0);
+// }
+// static void glowProgramUniform1fv(GPPROGRAMUNIFORM1FV fnptr, GLuint program, GLint location, GLsizei count, const GLfloat * value) {
+// (*fnptr)(program, location, count, value);
+// }
+// static void glowProgramUniform1fvEXT(GPPROGRAMUNIFORM1FVEXT fnptr, GLuint program, GLint location, GLsizei count, const GLfloat * value) {
+// (*fnptr)(program, location, count, value);
+// }
+// static void glowProgramUniform1i(GPPROGRAMUNIFORM1I fnptr, GLuint program, GLint location, GLint v0) {
+// (*fnptr)(program, location, v0);
+// }
+// static void glowProgramUniform1i64ARB(GPPROGRAMUNIFORM1I64ARB fnptr, GLuint program, GLint location, GLint64 x) {
+// (*fnptr)(program, location, x);
+// }
+// static void glowProgramUniform1i64NV(GPPROGRAMUNIFORM1I64NV fnptr, GLuint program, GLint location, GLint64EXT x) {
+// (*fnptr)(program, location, x);
+// }
+// static void glowProgramUniform1i64vARB(GPPROGRAMUNIFORM1I64VARB fnptr, GLuint program, GLint location, GLsizei count, const GLint64 * value) {
+// (*fnptr)(program, location, count, value);
+// }
+// static void glowProgramUniform1i64vNV(GPPROGRAMUNIFORM1I64VNV fnptr, GLuint program, GLint location, GLsizei count, const GLint64EXT * value) {
+// (*fnptr)(program, location, count, value);
+// }
+// static void glowProgramUniform1iEXT(GPPROGRAMUNIFORM1IEXT fnptr, GLuint program, GLint location, GLint v0) {
+// (*fnptr)(program, location, v0);
+// }
+// static void glowProgramUniform1iv(GPPROGRAMUNIFORM1IV fnptr, GLuint program, GLint location, GLsizei count, const GLint * value) {
+// (*fnptr)(program, location, count, value);
+// }
+// static void glowProgramUniform1ivEXT(GPPROGRAMUNIFORM1IVEXT fnptr, GLuint program, GLint location, GLsizei count, const GLint * value) {
+// (*fnptr)(program, location, count, value);
+// }
+// static void glowProgramUniform1ui(GPPROGRAMUNIFORM1UI fnptr, GLuint program, GLint location, GLuint v0) {
+// (*fnptr)(program, location, v0);
+// }
+// static void glowProgramUniform1ui64ARB(GPPROGRAMUNIFORM1UI64ARB fnptr, GLuint program, GLint location, GLuint64 x) {
+// (*fnptr)(program, location, x);
+// }
+// static void glowProgramUniform1ui64NV(GPPROGRAMUNIFORM1UI64NV fnptr, GLuint program, GLint location, GLuint64EXT x) {
+// (*fnptr)(program, location, x);
+// }
+// static void glowProgramUniform1ui64vARB(GPPROGRAMUNIFORM1UI64VARB fnptr, GLuint program, GLint location, GLsizei count, const GLuint64 * value) {
+// (*fnptr)(program, location, count, value);
+// }
+// static void glowProgramUniform1ui64vNV(GPPROGRAMUNIFORM1UI64VNV fnptr, GLuint program, GLint location, GLsizei count, const GLuint64EXT * value) {
+// (*fnptr)(program, location, count, value);
+// }
+// static void glowProgramUniform1uiEXT(GPPROGRAMUNIFORM1UIEXT fnptr, GLuint program, GLint location, GLuint v0) {
+// (*fnptr)(program, location, v0);
+// }
+// static void glowProgramUniform1uiv(GPPROGRAMUNIFORM1UIV fnptr, GLuint program, GLint location, GLsizei count, const GLuint * value) {
+// (*fnptr)(program, location, count, value);
+// }
+// static void glowProgramUniform1uivEXT(GPPROGRAMUNIFORM1UIVEXT fnptr, GLuint program, GLint location, GLsizei count, const GLuint * value) {
+// (*fnptr)(program, location, count, value);
+// }
+// static void glowProgramUniform2d(GPPROGRAMUNIFORM2D fnptr, GLuint program, GLint location, GLdouble v0, GLdouble v1) {
+// (*fnptr)(program, location, v0, v1);
+// }
+// static void glowProgramUniform2dEXT(GPPROGRAMUNIFORM2DEXT fnptr, GLuint program, GLint location, GLdouble x, GLdouble y) {
+// (*fnptr)(program, location, x, y);
+// }
+// static void glowProgramUniform2dv(GPPROGRAMUNIFORM2DV fnptr, GLuint program, GLint location, GLsizei count, const GLdouble * value) {
+// (*fnptr)(program, location, count, value);
+// }
+// static void glowProgramUniform2dvEXT(GPPROGRAMUNIFORM2DVEXT fnptr, GLuint program, GLint location, GLsizei count, const GLdouble * value) {
+// (*fnptr)(program, location, count, value);
+// }
+// static void glowProgramUniform2f(GPPROGRAMUNIFORM2F fnptr, GLuint program, GLint location, GLfloat v0, GLfloat v1) {
+// (*fnptr)(program, location, v0, v1);
+// }
+// static void glowProgramUniform2fEXT(GPPROGRAMUNIFORM2FEXT fnptr, GLuint program, GLint location, GLfloat v0, GLfloat v1) {
+// (*fnptr)(program, location, v0, v1);
+// }
+// static void glowProgramUniform2fv(GPPROGRAMUNIFORM2FV fnptr, GLuint program, GLint location, GLsizei count, const GLfloat * value) {
+// (*fnptr)(program, location, count, value);
+// }
+// static void glowProgramUniform2fvEXT(GPPROGRAMUNIFORM2FVEXT fnptr, GLuint program, GLint location, GLsizei count, const GLfloat * value) {
+// (*fnptr)(program, location, count, value);
+// }
+// static void glowProgramUniform2i(GPPROGRAMUNIFORM2I fnptr, GLuint program, GLint location, GLint v0, GLint v1) {
+// (*fnptr)(program, location, v0, v1);
+// }
+// static void glowProgramUniform2i64ARB(GPPROGRAMUNIFORM2I64ARB fnptr, GLuint program, GLint location, GLint64 x, GLint64 y) {
+// (*fnptr)(program, location, x, y);
+// }
+// static void glowProgramUniform2i64NV(GPPROGRAMUNIFORM2I64NV fnptr, GLuint program, GLint location, GLint64EXT x, GLint64EXT y) {
+// (*fnptr)(program, location, x, y);
+// }
+// static void glowProgramUniform2i64vARB(GPPROGRAMUNIFORM2I64VARB fnptr, GLuint program, GLint location, GLsizei count, const GLint64 * value) {
+// (*fnptr)(program, location, count, value);
+// }
+// static void glowProgramUniform2i64vNV(GPPROGRAMUNIFORM2I64VNV fnptr, GLuint program, GLint location, GLsizei count, const GLint64EXT * value) {
+// (*fnptr)(program, location, count, value);
+// }
+// static void glowProgramUniform2iEXT(GPPROGRAMUNIFORM2IEXT fnptr, GLuint program, GLint location, GLint v0, GLint v1) {
+// (*fnptr)(program, location, v0, v1);
+// }
+// static void glowProgramUniform2iv(GPPROGRAMUNIFORM2IV fnptr, GLuint program, GLint location, GLsizei count, const GLint * value) {
+// (*fnptr)(program, location, count, value);
+// }
+// static void glowProgramUniform2ivEXT(GPPROGRAMUNIFORM2IVEXT fnptr, GLuint program, GLint location, GLsizei count, const GLint * value) {
+// (*fnptr)(program, location, count, value);
+// }
+// static void glowProgramUniform2ui(GPPROGRAMUNIFORM2UI fnptr, GLuint program, GLint location, GLuint v0, GLuint v1) {
+// (*fnptr)(program, location, v0, v1);
+// }
+// static void glowProgramUniform2ui64ARB(GPPROGRAMUNIFORM2UI64ARB fnptr, GLuint program, GLint location, GLuint64 x, GLuint64 y) {
+// (*fnptr)(program, location, x, y);
+// }
+// static void glowProgramUniform2ui64NV(GPPROGRAMUNIFORM2UI64NV fnptr, GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y) {
+// (*fnptr)(program, location, x, y);
+// }
+// static void glowProgramUniform2ui64vARB(GPPROGRAMUNIFORM2UI64VARB fnptr, GLuint program, GLint location, GLsizei count, const GLuint64 * value) {
+// (*fnptr)(program, location, count, value);
+// }
+// static void glowProgramUniform2ui64vNV(GPPROGRAMUNIFORM2UI64VNV fnptr, GLuint program, GLint location, GLsizei count, const GLuint64EXT * value) {
+// (*fnptr)(program, location, count, value);
+// }
+// static void glowProgramUniform2uiEXT(GPPROGRAMUNIFORM2UIEXT fnptr, GLuint program, GLint location, GLuint v0, GLuint v1) {
+// (*fnptr)(program, location, v0, v1);
+// }
+// static void glowProgramUniform2uiv(GPPROGRAMUNIFORM2UIV fnptr, GLuint program, GLint location, GLsizei count, const GLuint * value) {
+// (*fnptr)(program, location, count, value);
+// }
+// static void glowProgramUniform2uivEXT(GPPROGRAMUNIFORM2UIVEXT fnptr, GLuint program, GLint location, GLsizei count, const GLuint * value) {
+// (*fnptr)(program, location, count, value);
+// }
+// static void glowProgramUniform3d(GPPROGRAMUNIFORM3D fnptr, GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2) {
+// (*fnptr)(program, location, v0, v1, v2);
+// }
+// static void glowProgramUniform3dEXT(GPPROGRAMUNIFORM3DEXT fnptr, GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z) {
+// (*fnptr)(program, location, x, y, z);
+// }
+// static void glowProgramUniform3dv(GPPROGRAMUNIFORM3DV fnptr, GLuint program, GLint location, GLsizei count, const GLdouble * value) {
+// (*fnptr)(program, location, count, value);
+// }
+// static void glowProgramUniform3dvEXT(GPPROGRAMUNIFORM3DVEXT fnptr, GLuint program, GLint location, GLsizei count, const GLdouble * value) {
+// (*fnptr)(program, location, count, value);
+// }
+// static void glowProgramUniform3f(GPPROGRAMUNIFORM3F fnptr, GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2) {
+// (*fnptr)(program, location, v0, v1, v2);
+// }
+// static void glowProgramUniform3fEXT(GPPROGRAMUNIFORM3FEXT fnptr, GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2) {
+// (*fnptr)(program, location, v0, v1, v2);
+// }
+// static void glowProgramUniform3fv(GPPROGRAMUNIFORM3FV fnptr, GLuint program, GLint location, GLsizei count, const GLfloat * value) {
+// (*fnptr)(program, location, count, value);
+// }
+// static void glowProgramUniform3fvEXT(GPPROGRAMUNIFORM3FVEXT fnptr, GLuint program, GLint location, GLsizei count, const GLfloat * value) {
+// (*fnptr)(program, location, count, value);
+// }
+// static void glowProgramUniform3i(GPPROGRAMUNIFORM3I fnptr, GLuint program, GLint location, GLint v0, GLint v1, GLint v2) {
+// (*fnptr)(program, location, v0, v1, v2);
+// }
+// static void glowProgramUniform3i64ARB(GPPROGRAMUNIFORM3I64ARB fnptr, GLuint program, GLint location, GLint64 x, GLint64 y, GLint64 z) {
+// (*fnptr)(program, location, x, y, z);
+// }
+// static void glowProgramUniform3i64NV(GPPROGRAMUNIFORM3I64NV fnptr, GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z) {
+// (*fnptr)(program, location, x, y, z);
+// }
+// static void glowProgramUniform3i64vARB(GPPROGRAMUNIFORM3I64VARB fnptr, GLuint program, GLint location, GLsizei count, const GLint64 * value) {
+// (*fnptr)(program, location, count, value);
+// }
+// static void glowProgramUniform3i64vNV(GPPROGRAMUNIFORM3I64VNV fnptr, GLuint program, GLint location, GLsizei count, const GLint64EXT * value) {
+// (*fnptr)(program, location, count, value);
+// }
+// static void glowProgramUniform3iEXT(GPPROGRAMUNIFORM3IEXT fnptr, GLuint program, GLint location, GLint v0, GLint v1, GLint v2) {
+// (*fnptr)(program, location, v0, v1, v2);
+// }
+// static void glowProgramUniform3iv(GPPROGRAMUNIFORM3IV fnptr, GLuint program, GLint location, GLsizei count, const GLint * value) {
+// (*fnptr)(program, location, count, value);
+// }
+// static void glowProgramUniform3ivEXT(GPPROGRAMUNIFORM3IVEXT fnptr, GLuint program, GLint location, GLsizei count, const GLint * value) {
+// (*fnptr)(program, location, count, value);
+// }
+// static void glowProgramUniform3ui(GPPROGRAMUNIFORM3UI fnptr, GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2) {
+// (*fnptr)(program, location, v0, v1, v2);
+// }
+// static void glowProgramUniform3ui64ARB(GPPROGRAMUNIFORM3UI64ARB fnptr, GLuint program, GLint location, GLuint64 x, GLuint64 y, GLuint64 z) {
+// (*fnptr)(program, location, x, y, z);
+// }
+// static void glowProgramUniform3ui64NV(GPPROGRAMUNIFORM3UI64NV fnptr, GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z) {
+// (*fnptr)(program, location, x, y, z);
+// }
+// static void glowProgramUniform3ui64vARB(GPPROGRAMUNIFORM3UI64VARB fnptr, GLuint program, GLint location, GLsizei count, const GLuint64 * value) {
+// (*fnptr)(program, location, count, value);
+// }
+// static void glowProgramUniform3ui64vNV(GPPROGRAMUNIFORM3UI64VNV fnptr, GLuint program, GLint location, GLsizei count, const GLuint64EXT * value) {
+// (*fnptr)(program, location, count, value);
+// }
+// static void glowProgramUniform3uiEXT(GPPROGRAMUNIFORM3UIEXT fnptr, GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2) {
+// (*fnptr)(program, location, v0, v1, v2);
+// }
+// static void glowProgramUniform3uiv(GPPROGRAMUNIFORM3UIV fnptr, GLuint program, GLint location, GLsizei count, const GLuint * value) {
+// (*fnptr)(program, location, count, value);
+// }
+// static void glowProgramUniform3uivEXT(GPPROGRAMUNIFORM3UIVEXT fnptr, GLuint program, GLint location, GLsizei count, const GLuint * value) {
+// (*fnptr)(program, location, count, value);
+// }
+// static void glowProgramUniform4d(GPPROGRAMUNIFORM4D fnptr, GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2, GLdouble v3) {
+// (*fnptr)(program, location, v0, v1, v2, v3);
+// }
+// static void glowProgramUniform4dEXT(GPPROGRAMUNIFORM4DEXT fnptr, GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w) {
+// (*fnptr)(program, location, x, y, z, w);
+// }
+// static void glowProgramUniform4dv(GPPROGRAMUNIFORM4DV fnptr, GLuint program, GLint location, GLsizei count, const GLdouble * value) {
+// (*fnptr)(program, location, count, value);
+// }
+// static void glowProgramUniform4dvEXT(GPPROGRAMUNIFORM4DVEXT fnptr, GLuint program, GLint location, GLsizei count, const GLdouble * value) {
+// (*fnptr)(program, location, count, value);
+// }
+// static void glowProgramUniform4f(GPPROGRAMUNIFORM4F fnptr, GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3) {
+// (*fnptr)(program, location, v0, v1, v2, v3);
+// }
+// static void glowProgramUniform4fEXT(GPPROGRAMUNIFORM4FEXT fnptr, GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3) {
+// (*fnptr)(program, location, v0, v1, v2, v3);
+// }
+// static void glowProgramUniform4fv(GPPROGRAMUNIFORM4FV fnptr, GLuint program, GLint location, GLsizei count, const GLfloat * value) {
+// (*fnptr)(program, location, count, value);
+// }
+// static void glowProgramUniform4fvEXT(GPPROGRAMUNIFORM4FVEXT fnptr, GLuint program, GLint location, GLsizei count, const GLfloat * value) {
+// (*fnptr)(program, location, count, value);
+// }
+// static void glowProgramUniform4i(GPPROGRAMUNIFORM4I fnptr, GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3) {
+// (*fnptr)(program, location, v0, v1, v2, v3);
+// }
+// static void glowProgramUniform4i64ARB(GPPROGRAMUNIFORM4I64ARB fnptr, GLuint program, GLint location, GLint64 x, GLint64 y, GLint64 z, GLint64 w) {
+// (*fnptr)(program, location, x, y, z, w);
+// }
+// static void glowProgramUniform4i64NV(GPPROGRAMUNIFORM4I64NV fnptr, GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w) {
+// (*fnptr)(program, location, x, y, z, w);
+// }
+// static void glowProgramUniform4i64vARB(GPPROGRAMUNIFORM4I64VARB fnptr, GLuint program, GLint location, GLsizei count, const GLint64 * value) {
+// (*fnptr)(program, location, count, value);
+// }
+// static void glowProgramUniform4i64vNV(GPPROGRAMUNIFORM4I64VNV fnptr, GLuint program, GLint location, GLsizei count, const GLint64EXT * value) {
+// (*fnptr)(program, location, count, value);
+// }
+// static void glowProgramUniform4iEXT(GPPROGRAMUNIFORM4IEXT fnptr, GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3) {
+// (*fnptr)(program, location, v0, v1, v2, v3);
+// }
+// static void glowProgramUniform4iv(GPPROGRAMUNIFORM4IV fnptr, GLuint program, GLint location, GLsizei count, const GLint * value) {
+// (*fnptr)(program, location, count, value);
+// }
+// static void glowProgramUniform4ivEXT(GPPROGRAMUNIFORM4IVEXT fnptr, GLuint program, GLint location, GLsizei count, const GLint * value) {
+// (*fnptr)(program, location, count, value);
+// }
+// static void glowProgramUniform4ui(GPPROGRAMUNIFORM4UI fnptr, GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3) {
+// (*fnptr)(program, location, v0, v1, v2, v3);
+// }
+// static void glowProgramUniform4ui64ARB(GPPROGRAMUNIFORM4UI64ARB fnptr, GLuint program, GLint location, GLuint64 x, GLuint64 y, GLuint64 z, GLuint64 w) {
+// (*fnptr)(program, location, x, y, z, w);
+// }
+// static void glowProgramUniform4ui64NV(GPPROGRAMUNIFORM4UI64NV fnptr, GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w) {
+// (*fnptr)(program, location, x, y, z, w);
+// }
+// static void glowProgramUniform4ui64vARB(GPPROGRAMUNIFORM4UI64VARB fnptr, GLuint program, GLint location, GLsizei count, const GLuint64 * value) {
+// (*fnptr)(program, location, count, value);
+// }
+// static void glowProgramUniform4ui64vNV(GPPROGRAMUNIFORM4UI64VNV fnptr, GLuint program, GLint location, GLsizei count, const GLuint64EXT * value) {
+// (*fnptr)(program, location, count, value);
+// }
+// static void glowProgramUniform4uiEXT(GPPROGRAMUNIFORM4UIEXT fnptr, GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3) {
+// (*fnptr)(program, location, v0, v1, v2, v3);
+// }
+// static void glowProgramUniform4uiv(GPPROGRAMUNIFORM4UIV fnptr, GLuint program, GLint location, GLsizei count, const GLuint * value) {
+// (*fnptr)(program, location, count, value);
+// }
+// static void glowProgramUniform4uivEXT(GPPROGRAMUNIFORM4UIVEXT fnptr, GLuint program, GLint location, GLsizei count, const GLuint * value) {
+// (*fnptr)(program, location, count, value);
+// }
+// static void glowProgramUniformHandleui64ARB(GPPROGRAMUNIFORMHANDLEUI64ARB fnptr, GLuint program, GLint location, GLuint64 value) {
+// (*fnptr)(program, location, value);
+// }
+// static void glowProgramUniformHandleui64NV(GPPROGRAMUNIFORMHANDLEUI64NV fnptr, GLuint program, GLint location, GLuint64 value) {
+// (*fnptr)(program, location, value);
+// }
+// static void glowProgramUniformHandleui64vARB(GPPROGRAMUNIFORMHANDLEUI64VARB fnptr, GLuint program, GLint location, GLsizei count, const GLuint64 * values) {
+// (*fnptr)(program, location, count, values);
+// }
+// static void glowProgramUniformHandleui64vNV(GPPROGRAMUNIFORMHANDLEUI64VNV fnptr, GLuint program, GLint location, GLsizei count, const GLuint64 * values) {
+// (*fnptr)(program, location, count, values);
+// }
+// static void glowProgramUniformMatrix2dv(GPPROGRAMUNIFORMMATRIX2DV fnptr, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value) {
+// (*fnptr)(program, location, count, transpose, value);
+// }
+// static void glowProgramUniformMatrix2dvEXT(GPPROGRAMUNIFORMMATRIX2DVEXT fnptr, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value) {
+// (*fnptr)(program, location, count, transpose, value);
+// }
+// static void glowProgramUniformMatrix2fv(GPPROGRAMUNIFORMMATRIX2FV fnptr, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {
+// (*fnptr)(program, location, count, transpose, value);
+// }
+// static void glowProgramUniformMatrix2fvEXT(GPPROGRAMUNIFORMMATRIX2FVEXT fnptr, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {
+// (*fnptr)(program, location, count, transpose, value);
+// }
+// static void glowProgramUniformMatrix2x3dv(GPPROGRAMUNIFORMMATRIX2X3DV fnptr, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value) {
+// (*fnptr)(program, location, count, transpose, value);
+// }
+// static void glowProgramUniformMatrix2x3dvEXT(GPPROGRAMUNIFORMMATRIX2X3DVEXT fnptr, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value) {
+// (*fnptr)(program, location, count, transpose, value);
+// }
+// static void glowProgramUniformMatrix2x3fv(GPPROGRAMUNIFORMMATRIX2X3FV fnptr, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {
+// (*fnptr)(program, location, count, transpose, value);
+// }
+// static void glowProgramUniformMatrix2x3fvEXT(GPPROGRAMUNIFORMMATRIX2X3FVEXT fnptr, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {
+// (*fnptr)(program, location, count, transpose, value);
+// }
+// static void glowProgramUniformMatrix2x4dv(GPPROGRAMUNIFORMMATRIX2X4DV fnptr, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value) {
+// (*fnptr)(program, location, count, transpose, value);
+// }
+// static void glowProgramUniformMatrix2x4dvEXT(GPPROGRAMUNIFORMMATRIX2X4DVEXT fnptr, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value) {
+// (*fnptr)(program, location, count, transpose, value);
+// }
+// static void glowProgramUniformMatrix2x4fv(GPPROGRAMUNIFORMMATRIX2X4FV fnptr, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {
+// (*fnptr)(program, location, count, transpose, value);
+// }
+// static void glowProgramUniformMatrix2x4fvEXT(GPPROGRAMUNIFORMMATRIX2X4FVEXT fnptr, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {
+// (*fnptr)(program, location, count, transpose, value);
+// }
+// static void glowProgramUniformMatrix3dv(GPPROGRAMUNIFORMMATRIX3DV fnptr, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value) {
+// (*fnptr)(program, location, count, transpose, value);
+// }
+// static void glowProgramUniformMatrix3dvEXT(GPPROGRAMUNIFORMMATRIX3DVEXT fnptr, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value) {
+// (*fnptr)(program, location, count, transpose, value);
+// }
+// static void glowProgramUniformMatrix3fv(GPPROGRAMUNIFORMMATRIX3FV fnptr, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {
+// (*fnptr)(program, location, count, transpose, value);
+// }
+// static void glowProgramUniformMatrix3fvEXT(GPPROGRAMUNIFORMMATRIX3FVEXT fnptr, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {
+// (*fnptr)(program, location, count, transpose, value);
+// }
+// static void glowProgramUniformMatrix3x2dv(GPPROGRAMUNIFORMMATRIX3X2DV fnptr, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value) {
+// (*fnptr)(program, location, count, transpose, value);
+// }
+// static void glowProgramUniformMatrix3x2dvEXT(GPPROGRAMUNIFORMMATRIX3X2DVEXT fnptr, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value) {
+// (*fnptr)(program, location, count, transpose, value);
+// }
+// static void glowProgramUniformMatrix3x2fv(GPPROGRAMUNIFORMMATRIX3X2FV fnptr, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {
+// (*fnptr)(program, location, count, transpose, value);
+// }
+// static void glowProgramUniformMatrix3x2fvEXT(GPPROGRAMUNIFORMMATRIX3X2FVEXT fnptr, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {
+// (*fnptr)(program, location, count, transpose, value);
+// }
+// static void glowProgramUniformMatrix3x4dv(GPPROGRAMUNIFORMMATRIX3X4DV fnptr, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value) {
+// (*fnptr)(program, location, count, transpose, value);
+// }
+// static void glowProgramUniformMatrix3x4dvEXT(GPPROGRAMUNIFORMMATRIX3X4DVEXT fnptr, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value) {
+// (*fnptr)(program, location, count, transpose, value);
+// }
+// static void glowProgramUniformMatrix3x4fv(GPPROGRAMUNIFORMMATRIX3X4FV fnptr, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {
+// (*fnptr)(program, location, count, transpose, value);
+// }
+// static void glowProgramUniformMatrix3x4fvEXT(GPPROGRAMUNIFORMMATRIX3X4FVEXT fnptr, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {
+// (*fnptr)(program, location, count, transpose, value);
+// }
+// static void glowProgramUniformMatrix4dv(GPPROGRAMUNIFORMMATRIX4DV fnptr, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value) {
+// (*fnptr)(program, location, count, transpose, value);
+// }
+// static void glowProgramUniformMatrix4dvEXT(GPPROGRAMUNIFORMMATRIX4DVEXT fnptr, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value) {
+// (*fnptr)(program, location, count, transpose, value);
+// }
+// static void glowProgramUniformMatrix4fv(GPPROGRAMUNIFORMMATRIX4FV fnptr, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {
+// (*fnptr)(program, location, count, transpose, value);
+// }
+// static void glowProgramUniformMatrix4fvEXT(GPPROGRAMUNIFORMMATRIX4FVEXT fnptr, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {
+// (*fnptr)(program, location, count, transpose, value);
+// }
+// static void glowProgramUniformMatrix4x2dv(GPPROGRAMUNIFORMMATRIX4X2DV fnptr, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value) {
+// (*fnptr)(program, location, count, transpose, value);
+// }
+// static void glowProgramUniformMatrix4x2dvEXT(GPPROGRAMUNIFORMMATRIX4X2DVEXT fnptr, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value) {
+// (*fnptr)(program, location, count, transpose, value);
+// }
+// static void glowProgramUniformMatrix4x2fv(GPPROGRAMUNIFORMMATRIX4X2FV fnptr, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {
+// (*fnptr)(program, location, count, transpose, value);
+// }
+// static void glowProgramUniformMatrix4x2fvEXT(GPPROGRAMUNIFORMMATRIX4X2FVEXT fnptr, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {
+// (*fnptr)(program, location, count, transpose, value);
+// }
+// static void glowProgramUniformMatrix4x3dv(GPPROGRAMUNIFORMMATRIX4X3DV fnptr, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value) {
+// (*fnptr)(program, location, count, transpose, value);
+// }
+// static void glowProgramUniformMatrix4x3dvEXT(GPPROGRAMUNIFORMMATRIX4X3DVEXT fnptr, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value) {
+// (*fnptr)(program, location, count, transpose, value);
+// }
+// static void glowProgramUniformMatrix4x3fv(GPPROGRAMUNIFORMMATRIX4X3FV fnptr, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {
+// (*fnptr)(program, location, count, transpose, value);
+// }
+// static void glowProgramUniformMatrix4x3fvEXT(GPPROGRAMUNIFORMMATRIX4X3FVEXT fnptr, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {
+// (*fnptr)(program, location, count, transpose, value);
+// }
+// static void glowProgramUniformui64NV(GPPROGRAMUNIFORMUI64NV fnptr, GLuint program, GLint location, GLuint64EXT value) {
+// (*fnptr)(program, location, value);
+// }
+// static void glowProgramUniformui64vNV(GPPROGRAMUNIFORMUI64VNV fnptr, GLuint program, GLint location, GLsizei count, const GLuint64EXT * value) {
+// (*fnptr)(program, location, count, value);
+// }
+// static void glowProvokingVertex(GPPROVOKINGVERTEX fnptr, GLenum mode) {
+// (*fnptr)(mode);
+// }
+// static void glowPushClientAttribDefaultEXT(GPPUSHCLIENTATTRIBDEFAULTEXT fnptr, GLbitfield mask) {
+// (*fnptr)(mask);
+// }
+// static void glowPushDebugGroup(GPPUSHDEBUGGROUP fnptr, GLenum source, GLuint id, GLsizei length, const GLchar * message) {
+// (*fnptr)(source, id, length, message);
+// }
+// static void glowPushDebugGroupKHR(GPPUSHDEBUGGROUPKHR fnptr, GLenum source, GLuint id, GLsizei length, const GLchar * message) {
+// (*fnptr)(source, id, length, message);
+// }
+// static void glowPushGroupMarkerEXT(GPPUSHGROUPMARKEREXT fnptr, GLsizei length, const GLchar * marker) {
+// (*fnptr)(length, marker);
+// }
+// static void glowQueryCounter(GPQUERYCOUNTER fnptr, GLuint id, GLenum target) {
+// (*fnptr)(id, target);
+// }
+// static void glowRasterSamplesEXT(GPRASTERSAMPLESEXT fnptr, GLuint samples, GLboolean fixedsamplelocations) {
+// (*fnptr)(samples, fixedsamplelocations);
+// }
+// static void glowReadBuffer(GPREADBUFFER fnptr, GLenum src) {
+// (*fnptr)(src);
+// }
+// static void glowReadPixels(GPREADPIXELS fnptr, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void * pixels) {
+// (*fnptr)(x, y, width, height, format, type, pixels);
+// }
+// static void glowReadnPixels(GPREADNPIXELS fnptr, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void * data) {
+// (*fnptr)(x, y, width, height, format, type, bufSize, data);
+// }
+// static void glowReadnPixelsARB(GPREADNPIXELSARB fnptr, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void * data) {
+// (*fnptr)(x, y, width, height, format, type, bufSize, data);
+// }
+// static void glowReadnPixelsKHR(GPREADNPIXELSKHR fnptr, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void * data) {
+// (*fnptr)(x, y, width, height, format, type, bufSize, data);
+// }
+// static void glowReleaseShaderCompiler(GPRELEASESHADERCOMPILER fnptr) {
+// (*fnptr)();
+// }
+// static void glowRenderbufferStorage(GPRENDERBUFFERSTORAGE fnptr, GLenum target, GLenum internalformat, GLsizei width, GLsizei height) {
+// (*fnptr)(target, internalformat, width, height);
+// }
+// static void glowRenderbufferStorageMultisample(GPRENDERBUFFERSTORAGEMULTISAMPLE fnptr, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) {
+// (*fnptr)(target, samples, internalformat, width, height);
+// }
+// static void glowRenderbufferStorageMultisampleAdvancedAMD(GPRENDERBUFFERSTORAGEMULTISAMPLEADVANCEDAMD fnptr, GLenum target, GLsizei samples, GLsizei storageSamples, GLenum internalformat, GLsizei width, GLsizei height) {
+// (*fnptr)(target, samples, storageSamples, internalformat, width, height);
+// }
+// static void glowRenderbufferStorageMultisampleCoverageNV(GPRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENV fnptr, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height) {
+// (*fnptr)(target, coverageSamples, colorSamples, internalformat, width, height);
+// }
+// static void glowResetMemoryObjectParameterNV(GPRESETMEMORYOBJECTPARAMETERNV fnptr, GLuint memory, GLenum pname) {
+// (*fnptr)(memory, pname);
+// }
+// static void glowResolveDepthValuesNV(GPRESOLVEDEPTHVALUESNV fnptr) {
+// (*fnptr)();
+// }
+// static void glowResumeTransformFeedback(GPRESUMETRANSFORMFEEDBACK fnptr) {
+// (*fnptr)();
+// }
+// static void glowSampleCoverage(GPSAMPLECOVERAGE fnptr, GLfloat value, GLboolean invert) {
+// (*fnptr)(value, invert);
+// }
+// static void glowSampleMaski(GPSAMPLEMASKI fnptr, GLuint maskNumber, GLbitfield mask) {
+// (*fnptr)(maskNumber, mask);
+// }
+// static void glowSamplerParameterIiv(GPSAMPLERPARAMETERIIV fnptr, GLuint sampler, GLenum pname, const GLint * param) {
+// (*fnptr)(sampler, pname, param);
+// }
+// static void glowSamplerParameterIuiv(GPSAMPLERPARAMETERIUIV fnptr, GLuint sampler, GLenum pname, const GLuint * param) {
+// (*fnptr)(sampler, pname, param);
+// }
+// static void glowSamplerParameterf(GPSAMPLERPARAMETERF fnptr, GLuint sampler, GLenum pname, GLfloat param) {
+// (*fnptr)(sampler, pname, param);
+// }
+// static void glowSamplerParameterfv(GPSAMPLERPARAMETERFV fnptr, GLuint sampler, GLenum pname, const GLfloat * param) {
+// (*fnptr)(sampler, pname, param);
+// }
+// static void glowSamplerParameteri(GPSAMPLERPARAMETERI fnptr, GLuint sampler, GLenum pname, GLint param) {
+// (*fnptr)(sampler, pname, param);
+// }
+// static void glowSamplerParameteriv(GPSAMPLERPARAMETERIV fnptr, GLuint sampler, GLenum pname, const GLint * param) {
+// (*fnptr)(sampler, pname, param);
+// }
+// static void glowScissor(GPSCISSOR fnptr, GLint x, GLint y, GLsizei width, GLsizei height) {
+// (*fnptr)(x, y, width, height);
+// }
+// static void glowScissorArrayv(GPSCISSORARRAYV fnptr, GLuint first, GLsizei count, const GLint * v) {
+// (*fnptr)(first, count, v);
+// }
+// static void glowScissorExclusiveArrayvNV(GPSCISSOREXCLUSIVEARRAYVNV fnptr, GLuint first, GLsizei count, const GLint * v) {
+// (*fnptr)(first, count, v);
+// }
+// static void glowScissorExclusiveNV(GPSCISSOREXCLUSIVENV fnptr, GLint x, GLint y, GLsizei width, GLsizei height) {
+// (*fnptr)(x, y, width, height);
+// }
+// static void glowScissorIndexed(GPSCISSORINDEXED fnptr, GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height) {
+// (*fnptr)(index, left, bottom, width, height);
+// }
+// static void glowScissorIndexedv(GPSCISSORINDEXEDV fnptr, GLuint index, const GLint * v) {
+// (*fnptr)(index, v);
+// }
+// static void glowSecondaryColorFormatNV(GPSECONDARYCOLORFORMATNV fnptr, GLint size, GLenum type, GLsizei stride) {
+// (*fnptr)(size, type, stride);
+// }
+// static void glowSelectPerfMonitorCountersAMD(GPSELECTPERFMONITORCOUNTERSAMD fnptr, GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint * counterList) {
+// (*fnptr)(monitor, enable, group, numCounters, counterList);
+// }
+// static void glowShaderBinary(GPSHADERBINARY fnptr, GLsizei count, const GLuint * shaders, GLenum binaryFormat, const void * binary, GLsizei length) {
+// (*fnptr)(count, shaders, binaryFormat, binary, length);
+// }
+// static void glowShaderSource(GPSHADERSOURCE fnptr, GLuint shader, GLsizei count, const GLchar *const* string, const GLint * length) {
+// (*fnptr)(shader, count, string, length);
+// }
+// static void glowShaderStorageBlockBinding(GPSHADERSTORAGEBLOCKBINDING fnptr, GLuint program, GLuint storageBlockIndex, GLuint storageBlockBinding) {
+// (*fnptr)(program, storageBlockIndex, storageBlockBinding);
+// }
+// static void glowShadingRateImageBarrierNV(GPSHADINGRATEIMAGEBARRIERNV fnptr, GLboolean synchronize) {
+// (*fnptr)(synchronize);
+// }
+// static void glowShadingRateImagePaletteNV(GPSHADINGRATEIMAGEPALETTENV fnptr, GLuint viewport, GLuint first, GLsizei count, const GLenum * rates) {
+// (*fnptr)(viewport, first, count, rates);
+// }
+// static void glowShadingRateSampleOrderCustomNV(GPSHADINGRATESAMPLEORDERCUSTOMNV fnptr, GLenum rate, GLuint samples, const GLint * locations) {
+// (*fnptr)(rate, samples, locations);
+// }
+// static void glowShadingRateSampleOrderNV(GPSHADINGRATESAMPLEORDERNV fnptr, GLenum order) {
+// (*fnptr)(order);
+// }
+// static void glowSignalVkFenceNV(GPSIGNALVKFENCENV fnptr, GLuint64 vkFence) {
+// (*fnptr)(vkFence);
+// }
+// static void glowSignalVkSemaphoreNV(GPSIGNALVKSEMAPHORENV fnptr, GLuint64 vkSemaphore) {
+// (*fnptr)(vkSemaphore);
+// }
+// static void glowSpecializeShaderARB(GPSPECIALIZESHADERARB fnptr, GLuint shader, const GLchar * pEntryPoint, GLuint numSpecializationConstants, const GLuint * pConstantIndex, const GLuint * pConstantValue) {
+// (*fnptr)(shader, pEntryPoint, numSpecializationConstants, pConstantIndex, pConstantValue);
+// }
+// static void glowStateCaptureNV(GPSTATECAPTURENV fnptr, GLuint state, GLenum mode) {
+// (*fnptr)(state, mode);
+// }
+// static void glowStencilFillPathInstancedNV(GPSTENCILFILLPATHINSTANCEDNV fnptr, GLsizei numPaths, GLenum pathNameType, const void * paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum transformType, const GLfloat * transformValues) {
+// (*fnptr)(numPaths, pathNameType, paths, pathBase, fillMode, mask, transformType, transformValues);
+// }
+// static void glowStencilFillPathNV(GPSTENCILFILLPATHNV fnptr, GLuint path, GLenum fillMode, GLuint mask) {
+// (*fnptr)(path, fillMode, mask);
+// }
+// static void glowStencilFunc(GPSTENCILFUNC fnptr, GLenum func, GLint ref, GLuint mask) {
+// (*fnptr)(func, ref, mask);
+// }
+// static void glowStencilFuncSeparate(GPSTENCILFUNCSEPARATE fnptr, GLenum face, GLenum func, GLint ref, GLuint mask) {
+// (*fnptr)(face, func, ref, mask);
+// }
+// static void glowStencilMask(GPSTENCILMASK fnptr, GLuint mask) {
+// (*fnptr)(mask);
+// }
+// static void glowStencilMaskSeparate(GPSTENCILMASKSEPARATE fnptr, GLenum face, GLuint mask) {
+// (*fnptr)(face, mask);
+// }
+// static void glowStencilOp(GPSTENCILOP fnptr, GLenum fail, GLenum zfail, GLenum zpass) {
+// (*fnptr)(fail, zfail, zpass);
+// }
+// static void glowStencilOpSeparate(GPSTENCILOPSEPARATE fnptr, GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass) {
+// (*fnptr)(face, sfail, dpfail, dppass);
+// }
+// static void glowStencilStrokePathInstancedNV(GPSTENCILSTROKEPATHINSTANCEDNV fnptr, GLsizei numPaths, GLenum pathNameType, const void * paths, GLuint pathBase, GLint reference, GLuint mask, GLenum transformType, const GLfloat * transformValues) {
+// (*fnptr)(numPaths, pathNameType, paths, pathBase, reference, mask, transformType, transformValues);
+// }
+// static void glowStencilStrokePathNV(GPSTENCILSTROKEPATHNV fnptr, GLuint path, GLint reference, GLuint mask) {
+// (*fnptr)(path, reference, mask);
+// }
+// static void glowStencilThenCoverFillPathInstancedNV(GPSTENCILTHENCOVERFILLPATHINSTANCEDNV fnptr, GLsizei numPaths, GLenum pathNameType, const void * paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat * transformValues) {
+// (*fnptr)(numPaths, pathNameType, paths, pathBase, fillMode, mask, coverMode, transformType, transformValues);
+// }
+// static void glowStencilThenCoverFillPathNV(GPSTENCILTHENCOVERFILLPATHNV fnptr, GLuint path, GLenum fillMode, GLuint mask, GLenum coverMode) {
+// (*fnptr)(path, fillMode, mask, coverMode);
+// }
+// static void glowStencilThenCoverStrokePathInstancedNV(GPSTENCILTHENCOVERSTROKEPATHINSTANCEDNV fnptr, GLsizei numPaths, GLenum pathNameType, const void * paths, GLuint pathBase, GLint reference, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat * transformValues) {
+// (*fnptr)(numPaths, pathNameType, paths, pathBase, reference, mask, coverMode, transformType, transformValues);
+// }
+// static void glowStencilThenCoverStrokePathNV(GPSTENCILTHENCOVERSTROKEPATHNV fnptr, GLuint path, GLint reference, GLuint mask, GLenum coverMode) {
+// (*fnptr)(path, reference, mask, coverMode);
+// }
+// static void glowSubpixelPrecisionBiasNV(GPSUBPIXELPRECISIONBIASNV fnptr, GLuint xbits, GLuint ybits) {
+// (*fnptr)(xbits, ybits);
+// }
+// static void glowTexAttachMemoryNV(GPTEXATTACHMEMORYNV fnptr, GLenum target, GLuint memory, GLuint64 offset) {
+// (*fnptr)(target, memory, offset);
+// }
+// static void glowTexBuffer(GPTEXBUFFER fnptr, GLenum target, GLenum internalformat, GLuint buffer) {
+// (*fnptr)(target, internalformat, buffer);
+// }
+// static void glowTexBufferARB(GPTEXBUFFERARB fnptr, GLenum target, GLenum internalformat, GLuint buffer) {
+// (*fnptr)(target, internalformat, buffer);
+// }
+// static void glowTexBufferRange(GPTEXBUFFERRANGE fnptr, GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size) {
+// (*fnptr)(target, internalformat, buffer, offset, size);
+// }
+// static void glowTexCoordFormatNV(GPTEXCOORDFORMATNV fnptr, GLint size, GLenum type, GLsizei stride) {
+// (*fnptr)(size, type, stride);
+// }
+// static void glowTexImage1D(GPTEXIMAGE1D fnptr, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void * pixels) {
+// (*fnptr)(target, level, internalformat, width, border, format, type, pixels);
+// }
+// static void glowTexImage2D(GPTEXIMAGE2D fnptr, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void * pixels) {
+// (*fnptr)(target, level, internalformat, width, height, border, format, type, pixels);
+// }
+// static void glowTexImage2DMultisample(GPTEXIMAGE2DMULTISAMPLE fnptr, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations) {
+// (*fnptr)(target, samples, internalformat, width, height, fixedsamplelocations);
+// }
+// static void glowTexImage3D(GPTEXIMAGE3D fnptr, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void * pixels) {
+// (*fnptr)(target, level, internalformat, width, height, depth, border, format, type, pixels);
+// }
+// static void glowTexImage3DMultisample(GPTEXIMAGE3DMULTISAMPLE fnptr, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations) {
+// (*fnptr)(target, samples, internalformat, width, height, depth, fixedsamplelocations);
+// }
+// static void glowTexPageCommitmentARB(GPTEXPAGECOMMITMENTARB fnptr, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean commit) {
+// (*fnptr)(target, level, xoffset, yoffset, zoffset, width, height, depth, commit);
+// }
+// static void glowTexPageCommitmentMemNV(GPTEXPAGECOMMITMENTMEMNV fnptr, GLenum target, GLint layer, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset, GLboolean commit) {
+// (*fnptr)(target, layer, level, xoffset, yoffset, zoffset, width, height, depth, memory, offset, commit);
+// }
+// static void glowTexParameterIiv(GPTEXPARAMETERIIV fnptr, GLenum target, GLenum pname, const GLint * params) {
+// (*fnptr)(target, pname, params);
+// }
+// static void glowTexParameterIuiv(GPTEXPARAMETERIUIV fnptr, GLenum target, GLenum pname, const GLuint * params) {
+// (*fnptr)(target, pname, params);
+// }
+// static void glowTexParameterf(GPTEXPARAMETERF fnptr, GLenum target, GLenum pname, GLfloat param) {
+// (*fnptr)(target, pname, param);
+// }
+// static void glowTexParameterfv(GPTEXPARAMETERFV fnptr, GLenum target, GLenum pname, const GLfloat * params) {
+// (*fnptr)(target, pname, params);
+// }
+// static void glowTexParameteri(GPTEXPARAMETERI fnptr, GLenum target, GLenum pname, GLint param) {
+// (*fnptr)(target, pname, param);
+// }
+// static void glowTexParameteriv(GPTEXPARAMETERIV fnptr, GLenum target, GLenum pname, const GLint * params) {
+// (*fnptr)(target, pname, params);
+// }
+// static void glowTexStorage1D(GPTEXSTORAGE1D fnptr, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width) {
+// (*fnptr)(target, levels, internalformat, width);
+// }
+// static void glowTexStorage2D(GPTEXSTORAGE2D fnptr, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height) {
+// (*fnptr)(target, levels, internalformat, width, height);
+// }
+// static void glowTexStorage2DMultisample(GPTEXSTORAGE2DMULTISAMPLE fnptr, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations) {
+// (*fnptr)(target, samples, internalformat, width, height, fixedsamplelocations);
+// }
+// static void glowTexStorage3D(GPTEXSTORAGE3D fnptr, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth) {
+// (*fnptr)(target, levels, internalformat, width, height, depth);
+// }
+// static void glowTexStorage3DMultisample(GPTEXSTORAGE3DMULTISAMPLE fnptr, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations) {
+// (*fnptr)(target, samples, internalformat, width, height, depth, fixedsamplelocations);
+// }
+// static void glowTexSubImage1D(GPTEXSUBIMAGE1D fnptr, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void * pixels) {
+// (*fnptr)(target, level, xoffset, width, format, type, pixels);
+// }
+// static void glowTexSubImage2D(GPTEXSUBIMAGE2D fnptr, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void * pixels) {
+// (*fnptr)(target, level, xoffset, yoffset, width, height, format, type, pixels);
+// }
+// static void glowTexSubImage3D(GPTEXSUBIMAGE3D fnptr, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void * pixels) {
+// (*fnptr)(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels);
+// }
+// static void glowTextureAttachMemoryNV(GPTEXTUREATTACHMEMORYNV fnptr, GLuint texture, GLuint memory, GLuint64 offset) {
+// (*fnptr)(texture, memory, offset);
+// }
+// static void glowTextureBarrier(GPTEXTUREBARRIER fnptr) {
+// (*fnptr)();
+// }
+// static void glowTextureBarrierNV(GPTEXTUREBARRIERNV fnptr) {
+// (*fnptr)();
+// }
+// static void glowTextureBuffer(GPTEXTUREBUFFER fnptr, GLuint texture, GLenum internalformat, GLuint buffer) {
+// (*fnptr)(texture, internalformat, buffer);
+// }
+// static void glowTextureBufferEXT(GPTEXTUREBUFFEREXT fnptr, GLuint texture, GLenum target, GLenum internalformat, GLuint buffer) {
+// (*fnptr)(texture, target, internalformat, buffer);
+// }
+// static void glowTextureBufferRange(GPTEXTUREBUFFERRANGE fnptr, GLuint texture, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size) {
+// (*fnptr)(texture, internalformat, buffer, offset, size);
+// }
+// static void glowTextureBufferRangeEXT(GPTEXTUREBUFFERRANGEEXT fnptr, GLuint texture, GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size) {
+// (*fnptr)(texture, target, internalformat, buffer, offset, size);
+// }
+// static void glowTextureImage1DEXT(GPTEXTUREIMAGE1DEXT fnptr, GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void * pixels) {
+// (*fnptr)(texture, target, level, internalformat, width, border, format, type, pixels);
+// }
+// static void glowTextureImage2DEXT(GPTEXTUREIMAGE2DEXT fnptr, GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void * pixels) {
+// (*fnptr)(texture, target, level, internalformat, width, height, border, format, type, pixels);
+// }
+// static void glowTextureImage3DEXT(GPTEXTUREIMAGE3DEXT fnptr, GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void * pixels) {
+// (*fnptr)(texture, target, level, internalformat, width, height, depth, border, format, type, pixels);
+// }
+// static void glowTexturePageCommitmentEXT(GPTEXTUREPAGECOMMITMENTEXT fnptr, GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean commit) {
+// (*fnptr)(texture, level, xoffset, yoffset, zoffset, width, height, depth, commit);
+// }
+// static void glowTexturePageCommitmentMemNV(GPTEXTUREPAGECOMMITMENTMEMNV fnptr, GLuint texture, GLint layer, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset, GLboolean commit) {
+// (*fnptr)(texture, layer, level, xoffset, yoffset, zoffset, width, height, depth, memory, offset, commit);
+// }
+// static void glowTextureParameterIiv(GPTEXTUREPARAMETERIIV fnptr, GLuint texture, GLenum pname, const GLint * params) {
+// (*fnptr)(texture, pname, params);
+// }
+// static void glowTextureParameterIivEXT(GPTEXTUREPARAMETERIIVEXT fnptr, GLuint texture, GLenum target, GLenum pname, const GLint * params) {
+// (*fnptr)(texture, target, pname, params);
+// }
+// static void glowTextureParameterIuiv(GPTEXTUREPARAMETERIUIV fnptr, GLuint texture, GLenum pname, const GLuint * params) {
+// (*fnptr)(texture, pname, params);
+// }
+// static void glowTextureParameterIuivEXT(GPTEXTUREPARAMETERIUIVEXT fnptr, GLuint texture, GLenum target, GLenum pname, const GLuint * params) {
+// (*fnptr)(texture, target, pname, params);
+// }
+// static void glowTextureParameterf(GPTEXTUREPARAMETERF fnptr, GLuint texture, GLenum pname, GLfloat param) {
+// (*fnptr)(texture, pname, param);
+// }
+// static void glowTextureParameterfEXT(GPTEXTUREPARAMETERFEXT fnptr, GLuint texture, GLenum target, GLenum pname, GLfloat param) {
+// (*fnptr)(texture, target, pname, param);
+// }
+// static void glowTextureParameterfv(GPTEXTUREPARAMETERFV fnptr, GLuint texture, GLenum pname, const GLfloat * param) {
+// (*fnptr)(texture, pname, param);
+// }
+// static void glowTextureParameterfvEXT(GPTEXTUREPARAMETERFVEXT fnptr, GLuint texture, GLenum target, GLenum pname, const GLfloat * params) {
+// (*fnptr)(texture, target, pname, params);
+// }
+// static void glowTextureParameteri(GPTEXTUREPARAMETERI fnptr, GLuint texture, GLenum pname, GLint param) {
+// (*fnptr)(texture, pname, param);
+// }
+// static void glowTextureParameteriEXT(GPTEXTUREPARAMETERIEXT fnptr, GLuint texture, GLenum target, GLenum pname, GLint param) {
+// (*fnptr)(texture, target, pname, param);
+// }
+// static void glowTextureParameteriv(GPTEXTUREPARAMETERIV fnptr, GLuint texture, GLenum pname, const GLint * param) {
+// (*fnptr)(texture, pname, param);
+// }
+// static void glowTextureParameterivEXT(GPTEXTUREPARAMETERIVEXT fnptr, GLuint texture, GLenum target, GLenum pname, const GLint * params) {
+// (*fnptr)(texture, target, pname, params);
+// }
+// static void glowTextureRenderbufferEXT(GPTEXTURERENDERBUFFEREXT fnptr, GLuint texture, GLenum target, GLuint renderbuffer) {
+// (*fnptr)(texture, target, renderbuffer);
+// }
+// static void glowTextureStorage1D(GPTEXTURESTORAGE1D fnptr, GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width) {
+// (*fnptr)(texture, levels, internalformat, width);
+// }
+// static void glowTextureStorage1DEXT(GPTEXTURESTORAGE1DEXT fnptr, GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width) {
+// (*fnptr)(texture, target, levels, internalformat, width);
+// }
+// static void glowTextureStorage2D(GPTEXTURESTORAGE2D fnptr, GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height) {
+// (*fnptr)(texture, levels, internalformat, width, height);
+// }
+// static void glowTextureStorage2DEXT(GPTEXTURESTORAGE2DEXT fnptr, GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height) {
+// (*fnptr)(texture, target, levels, internalformat, width, height);
+// }
+// static void glowTextureStorage2DMultisample(GPTEXTURESTORAGE2DMULTISAMPLE fnptr, GLuint texture, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations) {
+// (*fnptr)(texture, samples, internalformat, width, height, fixedsamplelocations);
+// }
+// static void glowTextureStorage2DMultisampleEXT(GPTEXTURESTORAGE2DMULTISAMPLEEXT fnptr, GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations) {
+// (*fnptr)(texture, target, samples, internalformat, width, height, fixedsamplelocations);
+// }
+// static void glowTextureStorage3D(GPTEXTURESTORAGE3D fnptr, GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth) {
+// (*fnptr)(texture, levels, internalformat, width, height, depth);
+// }
+// static void glowTextureStorage3DEXT(GPTEXTURESTORAGE3DEXT fnptr, GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth) {
+// (*fnptr)(texture, target, levels, internalformat, width, height, depth);
+// }
+// static void glowTextureStorage3DMultisample(GPTEXTURESTORAGE3DMULTISAMPLE fnptr, GLuint texture, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations) {
+// (*fnptr)(texture, samples, internalformat, width, height, depth, fixedsamplelocations);
+// }
+// static void glowTextureStorage3DMultisampleEXT(GPTEXTURESTORAGE3DMULTISAMPLEEXT fnptr, GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations) {
+// (*fnptr)(texture, target, samples, internalformat, width, height, depth, fixedsamplelocations);
+// }
+// static void glowTextureSubImage1D(GPTEXTURESUBIMAGE1D fnptr, GLuint texture, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void * pixels) {
+// (*fnptr)(texture, level, xoffset, width, format, type, pixels);
+// }
+// static void glowTextureSubImage1DEXT(GPTEXTURESUBIMAGE1DEXT fnptr, GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void * pixels) {
+// (*fnptr)(texture, target, level, xoffset, width, format, type, pixels);
+// }
+// static void glowTextureSubImage2D(GPTEXTURESUBIMAGE2D fnptr, GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void * pixels) {
+// (*fnptr)(texture, level, xoffset, yoffset, width, height, format, type, pixels);
+// }
+// static void glowTextureSubImage2DEXT(GPTEXTURESUBIMAGE2DEXT fnptr, GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void * pixels) {
+// (*fnptr)(texture, target, level, xoffset, yoffset, width, height, format, type, pixels);
+// }
+// static void glowTextureSubImage3D(GPTEXTURESUBIMAGE3D fnptr, GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void * pixels) {
+// (*fnptr)(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels);
+// }
+// static void glowTextureSubImage3DEXT(GPTEXTURESUBIMAGE3DEXT fnptr, GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void * pixels) {
+// (*fnptr)(texture, target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels);
+// }
+// static void glowTextureView(GPTEXTUREVIEW fnptr, GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers) {
+// (*fnptr)(texture, target, origtexture, internalformat, minlevel, numlevels, minlayer, numlayers);
+// }
+// static void glowTransformFeedbackBufferBase(GPTRANSFORMFEEDBACKBUFFERBASE fnptr, GLuint xfb, GLuint index, GLuint buffer) {
+// (*fnptr)(xfb, index, buffer);
+// }
+// static void glowTransformFeedbackBufferRange(GPTRANSFORMFEEDBACKBUFFERRANGE fnptr, GLuint xfb, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size) {
+// (*fnptr)(xfb, index, buffer, offset, size);
+// }
+// static void glowTransformFeedbackVaryings(GPTRANSFORMFEEDBACKVARYINGS fnptr, GLuint program, GLsizei count, const GLchar *const* varyings, GLenum bufferMode) {
+// (*fnptr)(program, count, varyings, bufferMode);
+// }
+// static void glowTransformPathNV(GPTRANSFORMPATHNV fnptr, GLuint resultPath, GLuint srcPath, GLenum transformType, const GLfloat * transformValues) {
+// (*fnptr)(resultPath, srcPath, transformType, transformValues);
+// }
+// static void glowUniform1d(GPUNIFORM1D fnptr, GLint location, GLdouble x) {
+// (*fnptr)(location, x);
+// }
+// static void glowUniform1dv(GPUNIFORM1DV fnptr, GLint location, GLsizei count, const GLdouble * value) {
+// (*fnptr)(location, count, value);
+// }
+// static void glowUniform1f(GPUNIFORM1F fnptr, GLint location, GLfloat v0) {
+// (*fnptr)(location, v0);
+// }
+// static void glowUniform1fv(GPUNIFORM1FV fnptr, GLint location, GLsizei count, const GLfloat * value) {
+// (*fnptr)(location, count, value);
+// }
+// static void glowUniform1i(GPUNIFORM1I fnptr, GLint location, GLint v0) {
+// (*fnptr)(location, v0);
+// }
+// static void glowUniform1i64ARB(GPUNIFORM1I64ARB fnptr, GLint location, GLint64 x) {
+// (*fnptr)(location, x);
+// }
+// static void glowUniform1i64NV(GPUNIFORM1I64NV fnptr, GLint location, GLint64EXT x) {
+// (*fnptr)(location, x);
+// }
+// static void glowUniform1i64vARB(GPUNIFORM1I64VARB fnptr, GLint location, GLsizei count, const GLint64 * value) {
+// (*fnptr)(location, count, value);
+// }
+// static void glowUniform1i64vNV(GPUNIFORM1I64VNV fnptr, GLint location, GLsizei count, const GLint64EXT * value) {
+// (*fnptr)(location, count, value);
+// }
+// static void glowUniform1iv(GPUNIFORM1IV fnptr, GLint location, GLsizei count, const GLint * value) {
+// (*fnptr)(location, count, value);
+// }
+// static void glowUniform1ui(GPUNIFORM1UI fnptr, GLint location, GLuint v0) {
+// (*fnptr)(location, v0);
+// }
+// static void glowUniform1ui64ARB(GPUNIFORM1UI64ARB fnptr, GLint location, GLuint64 x) {
+// (*fnptr)(location, x);
+// }
+// static void glowUniform1ui64NV(GPUNIFORM1UI64NV fnptr, GLint location, GLuint64EXT x) {
+// (*fnptr)(location, x);
+// }
+// static void glowUniform1ui64vARB(GPUNIFORM1UI64VARB fnptr, GLint location, GLsizei count, const GLuint64 * value) {
+// (*fnptr)(location, count, value);
+// }
+// static void glowUniform1ui64vNV(GPUNIFORM1UI64VNV fnptr, GLint location, GLsizei count, const GLuint64EXT * value) {
+// (*fnptr)(location, count, value);
+// }
+// static void glowUniform1uiv(GPUNIFORM1UIV fnptr, GLint location, GLsizei count, const GLuint * value) {
+// (*fnptr)(location, count, value);
+// }
+// static void glowUniform2d(GPUNIFORM2D fnptr, GLint location, GLdouble x, GLdouble y) {
+// (*fnptr)(location, x, y);
+// }
+// static void glowUniform2dv(GPUNIFORM2DV fnptr, GLint location, GLsizei count, const GLdouble * value) {
+// (*fnptr)(location, count, value);
+// }
+// static void glowUniform2f(GPUNIFORM2F fnptr, GLint location, GLfloat v0, GLfloat v1) {
+// (*fnptr)(location, v0, v1);
+// }
+// static void glowUniform2fv(GPUNIFORM2FV fnptr, GLint location, GLsizei count, const GLfloat * value) {
+// (*fnptr)(location, count, value);
+// }
+// static void glowUniform2i(GPUNIFORM2I fnptr, GLint location, GLint v0, GLint v1) {
+// (*fnptr)(location, v0, v1);
+// }
+// static void glowUniform2i64ARB(GPUNIFORM2I64ARB fnptr, GLint location, GLint64 x, GLint64 y) {
+// (*fnptr)(location, x, y);
+// }
+// static void glowUniform2i64NV(GPUNIFORM2I64NV fnptr, GLint location, GLint64EXT x, GLint64EXT y) {
+// (*fnptr)(location, x, y);
+// }
+// static void glowUniform2i64vARB(GPUNIFORM2I64VARB fnptr, GLint location, GLsizei count, const GLint64 * value) {
+// (*fnptr)(location, count, value);
+// }
+// static void glowUniform2i64vNV(GPUNIFORM2I64VNV fnptr, GLint location, GLsizei count, const GLint64EXT * value) {
+// (*fnptr)(location, count, value);
+// }
+// static void glowUniform2iv(GPUNIFORM2IV fnptr, GLint location, GLsizei count, const GLint * value) {
+// (*fnptr)(location, count, value);
+// }
+// static void glowUniform2ui(GPUNIFORM2UI fnptr, GLint location, GLuint v0, GLuint v1) {
+// (*fnptr)(location, v0, v1);
+// }
+// static void glowUniform2ui64ARB(GPUNIFORM2UI64ARB fnptr, GLint location, GLuint64 x, GLuint64 y) {
+// (*fnptr)(location, x, y);
+// }
+// static void glowUniform2ui64NV(GPUNIFORM2UI64NV fnptr, GLint location, GLuint64EXT x, GLuint64EXT y) {
+// (*fnptr)(location, x, y);
+// }
+// static void glowUniform2ui64vARB(GPUNIFORM2UI64VARB fnptr, GLint location, GLsizei count, const GLuint64 * value) {
+// (*fnptr)(location, count, value);
+// }
+// static void glowUniform2ui64vNV(GPUNIFORM2UI64VNV fnptr, GLint location, GLsizei count, const GLuint64EXT * value) {
+// (*fnptr)(location, count, value);
+// }
+// static void glowUniform2uiv(GPUNIFORM2UIV fnptr, GLint location, GLsizei count, const GLuint * value) {
+// (*fnptr)(location, count, value);
+// }
+// static void glowUniform3d(GPUNIFORM3D fnptr, GLint location, GLdouble x, GLdouble y, GLdouble z) {
+// (*fnptr)(location, x, y, z);
+// }
+// static void glowUniform3dv(GPUNIFORM3DV fnptr, GLint location, GLsizei count, const GLdouble * value) {
+// (*fnptr)(location, count, value);
+// }
+// static void glowUniform3f(GPUNIFORM3F fnptr, GLint location, GLfloat v0, GLfloat v1, GLfloat v2) {
+// (*fnptr)(location, v0, v1, v2);
+// }
+// static void glowUniform3fv(GPUNIFORM3FV fnptr, GLint location, GLsizei count, const GLfloat * value) {
+// (*fnptr)(location, count, value);
+// }
+// static void glowUniform3i(GPUNIFORM3I fnptr, GLint location, GLint v0, GLint v1, GLint v2) {
+// (*fnptr)(location, v0, v1, v2);
+// }
+// static void glowUniform3i64ARB(GPUNIFORM3I64ARB fnptr, GLint location, GLint64 x, GLint64 y, GLint64 z) {
+// (*fnptr)(location, x, y, z);
+// }
+// static void glowUniform3i64NV(GPUNIFORM3I64NV fnptr, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z) {
+// (*fnptr)(location, x, y, z);
+// }
+// static void glowUniform3i64vARB(GPUNIFORM3I64VARB fnptr, GLint location, GLsizei count, const GLint64 * value) {
+// (*fnptr)(location, count, value);
+// }
+// static void glowUniform3i64vNV(GPUNIFORM3I64VNV fnptr, GLint location, GLsizei count, const GLint64EXT * value) {
+// (*fnptr)(location, count, value);
+// }
+// static void glowUniform3iv(GPUNIFORM3IV fnptr, GLint location, GLsizei count, const GLint * value) {
+// (*fnptr)(location, count, value);
+// }
+// static void glowUniform3ui(GPUNIFORM3UI fnptr, GLint location, GLuint v0, GLuint v1, GLuint v2) {
+// (*fnptr)(location, v0, v1, v2);
+// }
+// static void glowUniform3ui64ARB(GPUNIFORM3UI64ARB fnptr, GLint location, GLuint64 x, GLuint64 y, GLuint64 z) {
+// (*fnptr)(location, x, y, z);
+// }
+// static void glowUniform3ui64NV(GPUNIFORM3UI64NV fnptr, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z) {
+// (*fnptr)(location, x, y, z);
+// }
+// static void glowUniform3ui64vARB(GPUNIFORM3UI64VARB fnptr, GLint location, GLsizei count, const GLuint64 * value) {
+// (*fnptr)(location, count, value);
+// }
+// static void glowUniform3ui64vNV(GPUNIFORM3UI64VNV fnptr, GLint location, GLsizei count, const GLuint64EXT * value) {
+// (*fnptr)(location, count, value);
+// }
+// static void glowUniform3uiv(GPUNIFORM3UIV fnptr, GLint location, GLsizei count, const GLuint * value) {
+// (*fnptr)(location, count, value);
+// }
+// static void glowUniform4d(GPUNIFORM4D fnptr, GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w) {
+// (*fnptr)(location, x, y, z, w);
+// }
+// static void glowUniform4dv(GPUNIFORM4DV fnptr, GLint location, GLsizei count, const GLdouble * value) {
+// (*fnptr)(location, count, value);
+// }
+// static void glowUniform4f(GPUNIFORM4F fnptr, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3) {
+// (*fnptr)(location, v0, v1, v2, v3);
+// }
+// static void glowUniform4fv(GPUNIFORM4FV fnptr, GLint location, GLsizei count, const GLfloat * value) {
+// (*fnptr)(location, count, value);
+// }
+// static void glowUniform4i(GPUNIFORM4I fnptr, GLint location, GLint v0, GLint v1, GLint v2, GLint v3) {
+// (*fnptr)(location, v0, v1, v2, v3);
+// }
+// static void glowUniform4i64ARB(GPUNIFORM4I64ARB fnptr, GLint location, GLint64 x, GLint64 y, GLint64 z, GLint64 w) {
+// (*fnptr)(location, x, y, z, w);
+// }
+// static void glowUniform4i64NV(GPUNIFORM4I64NV fnptr, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w) {
+// (*fnptr)(location, x, y, z, w);
+// }
+// static void glowUniform4i64vARB(GPUNIFORM4I64VARB fnptr, GLint location, GLsizei count, const GLint64 * value) {
+// (*fnptr)(location, count, value);
+// }
+// static void glowUniform4i64vNV(GPUNIFORM4I64VNV fnptr, GLint location, GLsizei count, const GLint64EXT * value) {
+// (*fnptr)(location, count, value);
+// }
+// static void glowUniform4iv(GPUNIFORM4IV fnptr, GLint location, GLsizei count, const GLint * value) {
+// (*fnptr)(location, count, value);
+// }
+// static void glowUniform4ui(GPUNIFORM4UI fnptr, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3) {
+// (*fnptr)(location, v0, v1, v2, v3);
+// }
+// static void glowUniform4ui64ARB(GPUNIFORM4UI64ARB fnptr, GLint location, GLuint64 x, GLuint64 y, GLuint64 z, GLuint64 w) {
+// (*fnptr)(location, x, y, z, w);
+// }
+// static void glowUniform4ui64NV(GPUNIFORM4UI64NV fnptr, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w) {
+// (*fnptr)(location, x, y, z, w);
+// }
+// static void glowUniform4ui64vARB(GPUNIFORM4UI64VARB fnptr, GLint location, GLsizei count, const GLuint64 * value) {
+// (*fnptr)(location, count, value);
+// }
+// static void glowUniform4ui64vNV(GPUNIFORM4UI64VNV fnptr, GLint location, GLsizei count, const GLuint64EXT * value) {
+// (*fnptr)(location, count, value);
+// }
+// static void glowUniform4uiv(GPUNIFORM4UIV fnptr, GLint location, GLsizei count, const GLuint * value) {
+// (*fnptr)(location, count, value);
+// }
+// static void glowUniformBlockBinding(GPUNIFORMBLOCKBINDING fnptr, GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding) {
+// (*fnptr)(program, uniformBlockIndex, uniformBlockBinding);
+// }
+// static void glowUniformHandleui64ARB(GPUNIFORMHANDLEUI64ARB fnptr, GLint location, GLuint64 value) {
+// (*fnptr)(location, value);
+// }
+// static void glowUniformHandleui64NV(GPUNIFORMHANDLEUI64NV fnptr, GLint location, GLuint64 value) {
+// (*fnptr)(location, value);
+// }
+// static void glowUniformHandleui64vARB(GPUNIFORMHANDLEUI64VARB fnptr, GLint location, GLsizei count, const GLuint64 * value) {
+// (*fnptr)(location, count, value);
+// }
+// static void glowUniformHandleui64vNV(GPUNIFORMHANDLEUI64VNV fnptr, GLint location, GLsizei count, const GLuint64 * value) {
+// (*fnptr)(location, count, value);
+// }
+// static void glowUniformMatrix2dv(GPUNIFORMMATRIX2DV fnptr, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value) {
+// (*fnptr)(location, count, transpose, value);
+// }
+// static void glowUniformMatrix2fv(GPUNIFORMMATRIX2FV fnptr, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {
+// (*fnptr)(location, count, transpose, value);
+// }
+// static void glowUniformMatrix2x3dv(GPUNIFORMMATRIX2X3DV fnptr, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value) {
+// (*fnptr)(location, count, transpose, value);
+// }
+// static void glowUniformMatrix2x3fv(GPUNIFORMMATRIX2X3FV fnptr, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {
+// (*fnptr)(location, count, transpose, value);
+// }
+// static void glowUniformMatrix2x4dv(GPUNIFORMMATRIX2X4DV fnptr, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value) {
+// (*fnptr)(location, count, transpose, value);
+// }
+// static void glowUniformMatrix2x4fv(GPUNIFORMMATRIX2X4FV fnptr, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {
+// (*fnptr)(location, count, transpose, value);
+// }
+// static void glowUniformMatrix3dv(GPUNIFORMMATRIX3DV fnptr, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value) {
+// (*fnptr)(location, count, transpose, value);
+// }
+// static void glowUniformMatrix3fv(GPUNIFORMMATRIX3FV fnptr, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {
+// (*fnptr)(location, count, transpose, value);
+// }
+// static void glowUniformMatrix3x2dv(GPUNIFORMMATRIX3X2DV fnptr, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value) {
+// (*fnptr)(location, count, transpose, value);
+// }
+// static void glowUniformMatrix3x2fv(GPUNIFORMMATRIX3X2FV fnptr, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {
+// (*fnptr)(location, count, transpose, value);
+// }
+// static void glowUniformMatrix3x4dv(GPUNIFORMMATRIX3X4DV fnptr, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value) {
+// (*fnptr)(location, count, transpose, value);
+// }
+// static void glowUniformMatrix3x4fv(GPUNIFORMMATRIX3X4FV fnptr, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {
+// (*fnptr)(location, count, transpose, value);
+// }
+// static void glowUniformMatrix4dv(GPUNIFORMMATRIX4DV fnptr, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value) {
+// (*fnptr)(location, count, transpose, value);
+// }
+// static void glowUniformMatrix4fv(GPUNIFORMMATRIX4FV fnptr, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {
+// (*fnptr)(location, count, transpose, value);
+// }
+// static void glowUniformMatrix4x2dv(GPUNIFORMMATRIX4X2DV fnptr, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value) {
+// (*fnptr)(location, count, transpose, value);
+// }
+// static void glowUniformMatrix4x2fv(GPUNIFORMMATRIX4X2FV fnptr, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {
+// (*fnptr)(location, count, transpose, value);
+// }
+// static void glowUniformMatrix4x3dv(GPUNIFORMMATRIX4X3DV fnptr, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value) {
+// (*fnptr)(location, count, transpose, value);
+// }
+// static void glowUniformMatrix4x3fv(GPUNIFORMMATRIX4X3FV fnptr, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) {
+// (*fnptr)(location, count, transpose, value);
+// }
+// static void glowUniformSubroutinesuiv(GPUNIFORMSUBROUTINESUIV fnptr, GLenum shadertype, GLsizei count, const GLuint * indices) {
+// (*fnptr)(shadertype, count, indices);
+// }
+// static void glowUniformui64NV(GPUNIFORMUI64NV fnptr, GLint location, GLuint64EXT value) {
+// (*fnptr)(location, value);
+// }
+// static void glowUniformui64vNV(GPUNIFORMUI64VNV fnptr, GLint location, GLsizei count, const GLuint64EXT * value) {
+// (*fnptr)(location, count, value);
+// }
+// static GLboolean glowUnmapBuffer(GPUNMAPBUFFER fnptr, GLenum target) {
+// return (*fnptr)(target);
+// }
+// static GLboolean glowUnmapNamedBuffer(GPUNMAPNAMEDBUFFER fnptr, GLuint buffer) {
+// return (*fnptr)(buffer);
+// }
+// static GLboolean glowUnmapNamedBufferEXT(GPUNMAPNAMEDBUFFEREXT fnptr, GLuint buffer) {
+// return (*fnptr)(buffer);
+// }
+// static void glowUseProgram(GPUSEPROGRAM fnptr, GLuint program) {
+// (*fnptr)(program);
+// }
+// static void glowUseProgramStages(GPUSEPROGRAMSTAGES fnptr, GLuint pipeline, GLbitfield stages, GLuint program) {
+// (*fnptr)(pipeline, stages, program);
+// }
+// static void glowUseProgramStagesEXT(GPUSEPROGRAMSTAGESEXT fnptr, GLuint pipeline, GLbitfield stages, GLuint program) {
+// (*fnptr)(pipeline, stages, program);
+// }
+// static void glowUseShaderProgramEXT(GPUSESHADERPROGRAMEXT fnptr, GLenum type, GLuint program) {
+// (*fnptr)(type, program);
+// }
+// static void glowValidateProgram(GPVALIDATEPROGRAM fnptr, GLuint program) {
+// (*fnptr)(program);
+// }
+// static void glowValidateProgramPipeline(GPVALIDATEPROGRAMPIPELINE fnptr, GLuint pipeline) {
+// (*fnptr)(pipeline);
+// }
+// static void glowValidateProgramPipelineEXT(GPVALIDATEPROGRAMPIPELINEEXT fnptr, GLuint pipeline) {
+// (*fnptr)(pipeline);
+// }
+// static void glowVertexArrayAttribBinding(GPVERTEXARRAYATTRIBBINDING fnptr, GLuint vaobj, GLuint attribindex, GLuint bindingindex) {
+// (*fnptr)(vaobj, attribindex, bindingindex);
+// }
+// static void glowVertexArrayAttribFormat(GPVERTEXARRAYATTRIBFORMAT fnptr, GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset) {
+// (*fnptr)(vaobj, attribindex, size, type, normalized, relativeoffset);
+// }
+// static void glowVertexArrayAttribIFormat(GPVERTEXARRAYATTRIBIFORMAT fnptr, GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset) {
+// (*fnptr)(vaobj, attribindex, size, type, relativeoffset);
+// }
+// static void glowVertexArrayAttribLFormat(GPVERTEXARRAYATTRIBLFORMAT fnptr, GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset) {
+// (*fnptr)(vaobj, attribindex, size, type, relativeoffset);
+// }
+// static void glowVertexArrayBindVertexBufferEXT(GPVERTEXARRAYBINDVERTEXBUFFEREXT fnptr, GLuint vaobj, GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride) {
+// (*fnptr)(vaobj, bindingindex, buffer, offset, stride);
+// }
+// static void glowVertexArrayBindingDivisor(GPVERTEXARRAYBINDINGDIVISOR fnptr, GLuint vaobj, GLuint bindingindex, GLuint divisor) {
+// (*fnptr)(vaobj, bindingindex, divisor);
+// }
+// static void glowVertexArrayColorOffsetEXT(GPVERTEXARRAYCOLOROFFSETEXT fnptr, GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset) {
+// (*fnptr)(vaobj, buffer, size, type, stride, offset);
+// }
+// static void glowVertexArrayEdgeFlagOffsetEXT(GPVERTEXARRAYEDGEFLAGOFFSETEXT fnptr, GLuint vaobj, GLuint buffer, GLsizei stride, GLintptr offset) {
+// (*fnptr)(vaobj, buffer, stride, offset);
+// }
+// static void glowVertexArrayElementBuffer(GPVERTEXARRAYELEMENTBUFFER fnptr, GLuint vaobj, GLuint buffer) {
+// (*fnptr)(vaobj, buffer);
+// }
+// static void glowVertexArrayFogCoordOffsetEXT(GPVERTEXARRAYFOGCOORDOFFSETEXT fnptr, GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset) {
+// (*fnptr)(vaobj, buffer, type, stride, offset);
+// }
+// static void glowVertexArrayIndexOffsetEXT(GPVERTEXARRAYINDEXOFFSETEXT fnptr, GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset) {
+// (*fnptr)(vaobj, buffer, type, stride, offset);
+// }
+// static void glowVertexArrayMultiTexCoordOffsetEXT(GPVERTEXARRAYMULTITEXCOORDOFFSETEXT fnptr, GLuint vaobj, GLuint buffer, GLenum texunit, GLint size, GLenum type, GLsizei stride, GLintptr offset) {
+// (*fnptr)(vaobj, buffer, texunit, size, type, stride, offset);
+// }
+// static void glowVertexArrayNormalOffsetEXT(GPVERTEXARRAYNORMALOFFSETEXT fnptr, GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset) {
+// (*fnptr)(vaobj, buffer, type, stride, offset);
+// }
+// static void glowVertexArraySecondaryColorOffsetEXT(GPVERTEXARRAYSECONDARYCOLOROFFSETEXT fnptr, GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset) {
+// (*fnptr)(vaobj, buffer, size, type, stride, offset);
+// }
+// static void glowVertexArrayTexCoordOffsetEXT(GPVERTEXARRAYTEXCOORDOFFSETEXT fnptr, GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset) {
+// (*fnptr)(vaobj, buffer, size, type, stride, offset);
+// }
+// static void glowVertexArrayVertexAttribBindingEXT(GPVERTEXARRAYVERTEXATTRIBBINDINGEXT fnptr, GLuint vaobj, GLuint attribindex, GLuint bindingindex) {
+// (*fnptr)(vaobj, attribindex, bindingindex);
+// }
+// static void glowVertexArrayVertexAttribDivisorEXT(GPVERTEXARRAYVERTEXATTRIBDIVISOREXT fnptr, GLuint vaobj, GLuint index, GLuint divisor) {
+// (*fnptr)(vaobj, index, divisor);
+// }
+// static void glowVertexArrayVertexAttribFormatEXT(GPVERTEXARRAYVERTEXATTRIBFORMATEXT fnptr, GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset) {
+// (*fnptr)(vaobj, attribindex, size, type, normalized, relativeoffset);
+// }
+// static void glowVertexArrayVertexAttribIFormatEXT(GPVERTEXARRAYVERTEXATTRIBIFORMATEXT fnptr, GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset) {
+// (*fnptr)(vaobj, attribindex, size, type, relativeoffset);
+// }
+// static void glowVertexArrayVertexAttribIOffsetEXT(GPVERTEXARRAYVERTEXATTRIBIOFFSETEXT fnptr, GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset) {
+// (*fnptr)(vaobj, buffer, index, size, type, stride, offset);
+// }
+// static void glowVertexArrayVertexAttribLFormatEXT(GPVERTEXARRAYVERTEXATTRIBLFORMATEXT fnptr, GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset) {
+// (*fnptr)(vaobj, attribindex, size, type, relativeoffset);
+// }
+// static void glowVertexArrayVertexAttribLOffsetEXT(GPVERTEXARRAYVERTEXATTRIBLOFFSETEXT fnptr, GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset) {
+// (*fnptr)(vaobj, buffer, index, size, type, stride, offset);
+// }
+// static void glowVertexArrayVertexAttribOffsetEXT(GPVERTEXARRAYVERTEXATTRIBOFFSETEXT fnptr, GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLintptr offset) {
+// (*fnptr)(vaobj, buffer, index, size, type, normalized, stride, offset);
+// }
+// static void glowVertexArrayVertexBindingDivisorEXT(GPVERTEXARRAYVERTEXBINDINGDIVISOREXT fnptr, GLuint vaobj, GLuint bindingindex, GLuint divisor) {
+// (*fnptr)(vaobj, bindingindex, divisor);
+// }
+// static void glowVertexArrayVertexBuffer(GPVERTEXARRAYVERTEXBUFFER fnptr, GLuint vaobj, GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride) {
+// (*fnptr)(vaobj, bindingindex, buffer, offset, stride);
+// }
+// static void glowVertexArrayVertexBuffers(GPVERTEXARRAYVERTEXBUFFERS fnptr, GLuint vaobj, GLuint first, GLsizei count, const GLuint * buffers, const GLintptr * offsets, const GLsizei * strides) {
+// (*fnptr)(vaobj, first, count, buffers, offsets, strides);
+// }
+// static void glowVertexArrayVertexOffsetEXT(GPVERTEXARRAYVERTEXOFFSETEXT fnptr, GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset) {
+// (*fnptr)(vaobj, buffer, size, type, stride, offset);
+// }
+// static void glowVertexAttrib1d(GPVERTEXATTRIB1D fnptr, GLuint index, GLdouble x) {
+// (*fnptr)(index, x);
+// }
+// static void glowVertexAttrib1dv(GPVERTEXATTRIB1DV fnptr, GLuint index, const GLdouble * v) {
+// (*fnptr)(index, v);
+// }
+// static void glowVertexAttrib1f(GPVERTEXATTRIB1F fnptr, GLuint index, GLfloat x) {
+// (*fnptr)(index, x);
+// }
+// static void glowVertexAttrib1fv(GPVERTEXATTRIB1FV fnptr, GLuint index, const GLfloat * v) {
+// (*fnptr)(index, v);
+// }
+// static void glowVertexAttrib1s(GPVERTEXATTRIB1S fnptr, GLuint index, GLshort x) {
+// (*fnptr)(index, x);
+// }
+// static void glowVertexAttrib1sv(GPVERTEXATTRIB1SV fnptr, GLuint index, const GLshort * v) {
+// (*fnptr)(index, v);
+// }
+// static void glowVertexAttrib2d(GPVERTEXATTRIB2D fnptr, GLuint index, GLdouble x, GLdouble y) {
+// (*fnptr)(index, x, y);
+// }
+// static void glowVertexAttrib2dv(GPVERTEXATTRIB2DV fnptr, GLuint index, const GLdouble * v) {
+// (*fnptr)(index, v);
+// }
+// static void glowVertexAttrib2f(GPVERTEXATTRIB2F fnptr, GLuint index, GLfloat x, GLfloat y) {
+// (*fnptr)(index, x, y);
+// }
+// static void glowVertexAttrib2fv(GPVERTEXATTRIB2FV fnptr, GLuint index, const GLfloat * v) {
+// (*fnptr)(index, v);
+// }
+// static void glowVertexAttrib2s(GPVERTEXATTRIB2S fnptr, GLuint index, GLshort x, GLshort y) {
+// (*fnptr)(index, x, y);
+// }
+// static void glowVertexAttrib2sv(GPVERTEXATTRIB2SV fnptr, GLuint index, const GLshort * v) {
+// (*fnptr)(index, v);
+// }
+// static void glowVertexAttrib3d(GPVERTEXATTRIB3D fnptr, GLuint index, GLdouble x, GLdouble y, GLdouble z) {
+// (*fnptr)(index, x, y, z);
+// }
+// static void glowVertexAttrib3dv(GPVERTEXATTRIB3DV fnptr, GLuint index, const GLdouble * v) {
+// (*fnptr)(index, v);
+// }
+// static void glowVertexAttrib3f(GPVERTEXATTRIB3F fnptr, GLuint index, GLfloat x, GLfloat y, GLfloat z) {
+// (*fnptr)(index, x, y, z);
+// }
+// static void glowVertexAttrib3fv(GPVERTEXATTRIB3FV fnptr, GLuint index, const GLfloat * v) {
+// (*fnptr)(index, v);
+// }
+// static void glowVertexAttrib3s(GPVERTEXATTRIB3S fnptr, GLuint index, GLshort x, GLshort y, GLshort z) {
+// (*fnptr)(index, x, y, z);
+// }
+// static void glowVertexAttrib3sv(GPVERTEXATTRIB3SV fnptr, GLuint index, const GLshort * v) {
+// (*fnptr)(index, v);
+// }
+// static void glowVertexAttrib4Nbv(GPVERTEXATTRIB4NBV fnptr, GLuint index, const GLbyte * v) {
+// (*fnptr)(index, v);
+// }
+// static void glowVertexAttrib4Niv(GPVERTEXATTRIB4NIV fnptr, GLuint index, const GLint * v) {
+// (*fnptr)(index, v);
+// }
+// static void glowVertexAttrib4Nsv(GPVERTEXATTRIB4NSV fnptr, GLuint index, const GLshort * v) {
+// (*fnptr)(index, v);
+// }
+// static void glowVertexAttrib4Nub(GPVERTEXATTRIB4NUB fnptr, GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w) {
+// (*fnptr)(index, x, y, z, w);
+// }
+// static void glowVertexAttrib4Nubv(GPVERTEXATTRIB4NUBV fnptr, GLuint index, const GLubyte * v) {
+// (*fnptr)(index, v);
+// }
+// static void glowVertexAttrib4Nuiv(GPVERTEXATTRIB4NUIV fnptr, GLuint index, const GLuint * v) {
+// (*fnptr)(index, v);
+// }
+// static void glowVertexAttrib4Nusv(GPVERTEXATTRIB4NUSV fnptr, GLuint index, const GLushort * v) {
+// (*fnptr)(index, v);
+// }
+// static void glowVertexAttrib4bv(GPVERTEXATTRIB4BV fnptr, GLuint index, const GLbyte * v) {
+// (*fnptr)(index, v);
+// }
+// static void glowVertexAttrib4d(GPVERTEXATTRIB4D fnptr, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) {
+// (*fnptr)(index, x, y, z, w);
+// }
+// static void glowVertexAttrib4dv(GPVERTEXATTRIB4DV fnptr, GLuint index, const GLdouble * v) {
+// (*fnptr)(index, v);
+// }
+// static void glowVertexAttrib4f(GPVERTEXATTRIB4F fnptr, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) {
+// (*fnptr)(index, x, y, z, w);
+// }
+// static void glowVertexAttrib4fv(GPVERTEXATTRIB4FV fnptr, GLuint index, const GLfloat * v) {
+// (*fnptr)(index, v);
+// }
+// static void glowVertexAttrib4iv(GPVERTEXATTRIB4IV fnptr, GLuint index, const GLint * v) {
+// (*fnptr)(index, v);
+// }
+// static void glowVertexAttrib4s(GPVERTEXATTRIB4S fnptr, GLuint index, GLshort x, GLshort y, GLshort z, GLshort w) {
+// (*fnptr)(index, x, y, z, w);
+// }
+// static void glowVertexAttrib4sv(GPVERTEXATTRIB4SV fnptr, GLuint index, const GLshort * v) {
+// (*fnptr)(index, v);
+// }
+// static void glowVertexAttrib4ubv(GPVERTEXATTRIB4UBV fnptr, GLuint index, const GLubyte * v) {
+// (*fnptr)(index, v);
+// }
+// static void glowVertexAttrib4uiv(GPVERTEXATTRIB4UIV fnptr, GLuint index, const GLuint * v) {
+// (*fnptr)(index, v);
+// }
+// static void glowVertexAttrib4usv(GPVERTEXATTRIB4USV fnptr, GLuint index, const GLushort * v) {
+// (*fnptr)(index, v);
+// }
+// static void glowVertexAttribBinding(GPVERTEXATTRIBBINDING fnptr, GLuint attribindex, GLuint bindingindex) {
+// (*fnptr)(attribindex, bindingindex);
+// }
+// static void glowVertexAttribDivisor(GPVERTEXATTRIBDIVISOR fnptr, GLuint index, GLuint divisor) {
+// (*fnptr)(index, divisor);
+// }
+// static void glowVertexAttribDivisorARB(GPVERTEXATTRIBDIVISORARB fnptr, GLuint index, GLuint divisor) {
+// (*fnptr)(index, divisor);
+// }
+// static void glowVertexAttribFormat(GPVERTEXATTRIBFORMAT fnptr, GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset) {
+// (*fnptr)(attribindex, size, type, normalized, relativeoffset);
+// }
+// static void glowVertexAttribFormatNV(GPVERTEXATTRIBFORMATNV fnptr, GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride) {
+// (*fnptr)(index, size, type, normalized, stride);
+// }
+// static void glowVertexAttribI1i(GPVERTEXATTRIBI1I fnptr, GLuint index, GLint x) {
+// (*fnptr)(index, x);
+// }
+// static void glowVertexAttribI1iv(GPVERTEXATTRIBI1IV fnptr, GLuint index, const GLint * v) {
+// (*fnptr)(index, v);
+// }
+// static void glowVertexAttribI1ui(GPVERTEXATTRIBI1UI fnptr, GLuint index, GLuint x) {
+// (*fnptr)(index, x);
+// }
+// static void glowVertexAttribI1uiv(GPVERTEXATTRIBI1UIV fnptr, GLuint index, const GLuint * v) {
+// (*fnptr)(index, v);
+// }
+// static void glowVertexAttribI2i(GPVERTEXATTRIBI2I fnptr, GLuint index, GLint x, GLint y) {
+// (*fnptr)(index, x, y);
+// }
+// static void glowVertexAttribI2iv(GPVERTEXATTRIBI2IV fnptr, GLuint index, const GLint * v) {
+// (*fnptr)(index, v);
+// }
+// static void glowVertexAttribI2ui(GPVERTEXATTRIBI2UI fnptr, GLuint index, GLuint x, GLuint y) {
+// (*fnptr)(index, x, y);
+// }
+// static void glowVertexAttribI2uiv(GPVERTEXATTRIBI2UIV fnptr, GLuint index, const GLuint * v) {
+// (*fnptr)(index, v);
+// }
+// static void glowVertexAttribI3i(GPVERTEXATTRIBI3I fnptr, GLuint index, GLint x, GLint y, GLint z) {
+// (*fnptr)(index, x, y, z);
+// }
+// static void glowVertexAttribI3iv(GPVERTEXATTRIBI3IV fnptr, GLuint index, const GLint * v) {
+// (*fnptr)(index, v);
+// }
+// static void glowVertexAttribI3ui(GPVERTEXATTRIBI3UI fnptr, GLuint index, GLuint x, GLuint y, GLuint z) {
+// (*fnptr)(index, x, y, z);
+// }
+// static void glowVertexAttribI3uiv(GPVERTEXATTRIBI3UIV fnptr, GLuint index, const GLuint * v) {
+// (*fnptr)(index, v);
+// }
+// static void glowVertexAttribI4bv(GPVERTEXATTRIBI4BV fnptr, GLuint index, const GLbyte * v) {
+// (*fnptr)(index, v);
+// }
+// static void glowVertexAttribI4i(GPVERTEXATTRIBI4I fnptr, GLuint index, GLint x, GLint y, GLint z, GLint w) {
+// (*fnptr)(index, x, y, z, w);
+// }
+// static void glowVertexAttribI4iv(GPVERTEXATTRIBI4IV fnptr, GLuint index, const GLint * v) {
+// (*fnptr)(index, v);
+// }
+// static void glowVertexAttribI4sv(GPVERTEXATTRIBI4SV fnptr, GLuint index, const GLshort * v) {
+// (*fnptr)(index, v);
+// }
+// static void glowVertexAttribI4ubv(GPVERTEXATTRIBI4UBV fnptr, GLuint index, const GLubyte * v) {
+// (*fnptr)(index, v);
+// }
+// static void glowVertexAttribI4ui(GPVERTEXATTRIBI4UI fnptr, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w) {
+// (*fnptr)(index, x, y, z, w);
+// }
+// static void glowVertexAttribI4uiv(GPVERTEXATTRIBI4UIV fnptr, GLuint index, const GLuint * v) {
+// (*fnptr)(index, v);
+// }
+// static void glowVertexAttribI4usv(GPVERTEXATTRIBI4USV fnptr, GLuint index, const GLushort * v) {
+// (*fnptr)(index, v);
+// }
+// static void glowVertexAttribIFormat(GPVERTEXATTRIBIFORMAT fnptr, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset) {
+// (*fnptr)(attribindex, size, type, relativeoffset);
+// }
+// static void glowVertexAttribIFormatNV(GPVERTEXATTRIBIFORMATNV fnptr, GLuint index, GLint size, GLenum type, GLsizei stride) {
+// (*fnptr)(index, size, type, stride);
+// }
+// static void glowVertexAttribIPointer(GPVERTEXATTRIBIPOINTER fnptr, GLuint index, GLint size, GLenum type, GLsizei stride, const void * pointer) {
+// (*fnptr)(index, size, type, stride, pointer);
+// }
+// static void glowVertexAttribIPointerWithOffset(GPVERTEXATTRIBIPOINTER fnptr, GLuint index, GLint size, GLenum type, GLsizei stride, uintptr_t offset) {
+// (*fnptr)(index, size, type, stride, (const void *)(offset));
+// }
+// static void glowVertexAttribL1d(GPVERTEXATTRIBL1D fnptr, GLuint index, GLdouble x) {
+// (*fnptr)(index, x);
+// }
+// static void glowVertexAttribL1dv(GPVERTEXATTRIBL1DV fnptr, GLuint index, const GLdouble * v) {
+// (*fnptr)(index, v);
+// }
+// static void glowVertexAttribL1i64NV(GPVERTEXATTRIBL1I64NV fnptr, GLuint index, GLint64EXT x) {
+// (*fnptr)(index, x);
+// }
+// static void glowVertexAttribL1i64vNV(GPVERTEXATTRIBL1I64VNV fnptr, GLuint index, const GLint64EXT * v) {
+// (*fnptr)(index, v);
+// }
+// static void glowVertexAttribL1ui64ARB(GPVERTEXATTRIBL1UI64ARB fnptr, GLuint index, GLuint64EXT x) {
+// (*fnptr)(index, x);
+// }
+// static void glowVertexAttribL1ui64NV(GPVERTEXATTRIBL1UI64NV fnptr, GLuint index, GLuint64EXT x) {
+// (*fnptr)(index, x);
+// }
+// static void glowVertexAttribL1ui64vARB(GPVERTEXATTRIBL1UI64VARB fnptr, GLuint index, const GLuint64EXT * v) {
+// (*fnptr)(index, v);
+// }
+// static void glowVertexAttribL1ui64vNV(GPVERTEXATTRIBL1UI64VNV fnptr, GLuint index, const GLuint64EXT * v) {
+// (*fnptr)(index, v);
+// }
+// static void glowVertexAttribL2d(GPVERTEXATTRIBL2D fnptr, GLuint index, GLdouble x, GLdouble y) {
+// (*fnptr)(index, x, y);
+// }
+// static void glowVertexAttribL2dv(GPVERTEXATTRIBL2DV fnptr, GLuint index, const GLdouble * v) {
+// (*fnptr)(index, v);
+// }
+// static void glowVertexAttribL2i64NV(GPVERTEXATTRIBL2I64NV fnptr, GLuint index, GLint64EXT x, GLint64EXT y) {
+// (*fnptr)(index, x, y);
+// }
+// static void glowVertexAttribL2i64vNV(GPVERTEXATTRIBL2I64VNV fnptr, GLuint index, const GLint64EXT * v) {
+// (*fnptr)(index, v);
+// }
+// static void glowVertexAttribL2ui64NV(GPVERTEXATTRIBL2UI64NV fnptr, GLuint index, GLuint64EXT x, GLuint64EXT y) {
+// (*fnptr)(index, x, y);
+// }
+// static void glowVertexAttribL2ui64vNV(GPVERTEXATTRIBL2UI64VNV fnptr, GLuint index, const GLuint64EXT * v) {
+// (*fnptr)(index, v);
+// }
+// static void glowVertexAttribL3d(GPVERTEXATTRIBL3D fnptr, GLuint index, GLdouble x, GLdouble y, GLdouble z) {
+// (*fnptr)(index, x, y, z);
+// }
+// static void glowVertexAttribL3dv(GPVERTEXATTRIBL3DV fnptr, GLuint index, const GLdouble * v) {
+// (*fnptr)(index, v);
+// }
+// static void glowVertexAttribL3i64NV(GPVERTEXATTRIBL3I64NV fnptr, GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z) {
+// (*fnptr)(index, x, y, z);
+// }
+// static void glowVertexAttribL3i64vNV(GPVERTEXATTRIBL3I64VNV fnptr, GLuint index, const GLint64EXT * v) {
+// (*fnptr)(index, v);
+// }
+// static void glowVertexAttribL3ui64NV(GPVERTEXATTRIBL3UI64NV fnptr, GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z) {
+// (*fnptr)(index, x, y, z);
+// }
+// static void glowVertexAttribL3ui64vNV(GPVERTEXATTRIBL3UI64VNV fnptr, GLuint index, const GLuint64EXT * v) {
+// (*fnptr)(index, v);
+// }
+// static void glowVertexAttribL4d(GPVERTEXATTRIBL4D fnptr, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) {
+// (*fnptr)(index, x, y, z, w);
+// }
+// static void glowVertexAttribL4dv(GPVERTEXATTRIBL4DV fnptr, GLuint index, const GLdouble * v) {
+// (*fnptr)(index, v);
+// }
+// static void glowVertexAttribL4i64NV(GPVERTEXATTRIBL4I64NV fnptr, GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w) {
+// (*fnptr)(index, x, y, z, w);
+// }
+// static void glowVertexAttribL4i64vNV(GPVERTEXATTRIBL4I64VNV fnptr, GLuint index, const GLint64EXT * v) {
+// (*fnptr)(index, v);
+// }
+// static void glowVertexAttribL4ui64NV(GPVERTEXATTRIBL4UI64NV fnptr, GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w) {
+// (*fnptr)(index, x, y, z, w);
+// }
+// static void glowVertexAttribL4ui64vNV(GPVERTEXATTRIBL4UI64VNV fnptr, GLuint index, const GLuint64EXT * v) {
+// (*fnptr)(index, v);
+// }
+// static void glowVertexAttribLFormat(GPVERTEXATTRIBLFORMAT fnptr, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset) {
+// (*fnptr)(attribindex, size, type, relativeoffset);
+// }
+// static void glowVertexAttribLFormatNV(GPVERTEXATTRIBLFORMATNV fnptr, GLuint index, GLint size, GLenum type, GLsizei stride) {
+// (*fnptr)(index, size, type, stride);
+// }
+// static void glowVertexAttribLPointer(GPVERTEXATTRIBLPOINTER fnptr, GLuint index, GLint size, GLenum type, GLsizei stride, const void * pointer) {
+// (*fnptr)(index, size, type, stride, pointer);
+// }
+// static void glowVertexAttribLPointerWithOffset(GPVERTEXATTRIBLPOINTER fnptr, GLuint index, GLint size, GLenum type, GLsizei stride, uintptr_t offset) {
+// (*fnptr)(index, size, type, stride, (const void *)(offset));
+// }
+// static void glowVertexAttribP1ui(GPVERTEXATTRIBP1UI fnptr, GLuint index, GLenum type, GLboolean normalized, GLuint value) {
+// (*fnptr)(index, type, normalized, value);
+// }
+// static void glowVertexAttribP1uiv(GPVERTEXATTRIBP1UIV fnptr, GLuint index, GLenum type, GLboolean normalized, const GLuint * value) {
+// (*fnptr)(index, type, normalized, value);
+// }
+// static void glowVertexAttribP2ui(GPVERTEXATTRIBP2UI fnptr, GLuint index, GLenum type, GLboolean normalized, GLuint value) {
+// (*fnptr)(index, type, normalized, value);
+// }
+// static void glowVertexAttribP2uiv(GPVERTEXATTRIBP2UIV fnptr, GLuint index, GLenum type, GLboolean normalized, const GLuint * value) {
+// (*fnptr)(index, type, normalized, value);
+// }
+// static void glowVertexAttribP3ui(GPVERTEXATTRIBP3UI fnptr, GLuint index, GLenum type, GLboolean normalized, GLuint value) {
+// (*fnptr)(index, type, normalized, value);
+// }
+// static void glowVertexAttribP3uiv(GPVERTEXATTRIBP3UIV fnptr, GLuint index, GLenum type, GLboolean normalized, const GLuint * value) {
+// (*fnptr)(index, type, normalized, value);
+// }
+// static void glowVertexAttribP4ui(GPVERTEXATTRIBP4UI fnptr, GLuint index, GLenum type, GLboolean normalized, GLuint value) {
+// (*fnptr)(index, type, normalized, value);
+// }
+// static void glowVertexAttribP4uiv(GPVERTEXATTRIBP4UIV fnptr, GLuint index, GLenum type, GLboolean normalized, const GLuint * value) {
+// (*fnptr)(index, type, normalized, value);
+// }
+// static void glowVertexAttribPointer(GPVERTEXATTRIBPOINTER fnptr, GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void * pointer) {
+// (*fnptr)(index, size, type, normalized, stride, pointer);
+// }
+// static void glowVertexAttribPointerWithOffset(GPVERTEXATTRIBPOINTER fnptr, GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, uintptr_t offset) {
+// (*fnptr)(index, size, type, normalized, stride, (const void *)(offset));
+// }
+// static void glowVertexBindingDivisor(GPVERTEXBINDINGDIVISOR fnptr, GLuint bindingindex, GLuint divisor) {
+// (*fnptr)(bindingindex, divisor);
+// }
+// static void glowVertexFormatNV(GPVERTEXFORMATNV fnptr, GLint size, GLenum type, GLsizei stride) {
+// (*fnptr)(size, type, stride);
+// }
+// static void glowViewport(GPVIEWPORT fnptr, GLint x, GLint y, GLsizei width, GLsizei height) {
+// (*fnptr)(x, y, width, height);
+// }
+// static void glowViewportArrayv(GPVIEWPORTARRAYV fnptr, GLuint first, GLsizei count, const GLfloat * v) {
+// (*fnptr)(first, count, v);
+// }
+// static void glowViewportIndexedf(GPVIEWPORTINDEXEDF fnptr, GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h) {
+// (*fnptr)(index, x, y, w, h);
+// }
+// static void glowViewportIndexedfv(GPVIEWPORTINDEXEDFV fnptr, GLuint index, const GLfloat * v) {
+// (*fnptr)(index, v);
+// }
+// static void glowViewportPositionWScaleNV(GPVIEWPORTPOSITIONWSCALENV fnptr, GLuint index, GLfloat xcoeff, GLfloat ycoeff) {
+// (*fnptr)(index, xcoeff, ycoeff);
+// }
+// static void glowViewportSwizzleNV(GPVIEWPORTSWIZZLENV fnptr, GLuint index, GLenum swizzlex, GLenum swizzley, GLenum swizzlez, GLenum swizzlew) {
+// (*fnptr)(index, swizzlex, swizzley, swizzlez, swizzlew);
+// }
+// static void glowWaitSync(GPWAITSYNC fnptr, GLsync sync, GLbitfield flags, GLuint64 timeout) {
+// (*fnptr)(sync, flags, timeout);
+// }
+// static void glowWaitVkSemaphoreNV(GPWAITVKSEMAPHORENV fnptr, GLuint64 vkSemaphore) {
+// (*fnptr)(vkSemaphore);
+// }
+// static void glowWeightPathsNV(GPWEIGHTPATHSNV fnptr, GLuint resultPath, GLsizei numPaths, const GLuint * paths, const GLfloat * weights) {
+// (*fnptr)(resultPath, numPaths, paths, weights);
+// }
+// static void glowWindowRectanglesEXT(GPWINDOWRECTANGLESEXT fnptr, GLenum mode, GLsizei count, const GLint * box) {
+// (*fnptr)(mode, count, box);
+// }
+import "C"
+import (
+ "errors"
+ "unsafe"
+)
+
+const (
+ ACCUM_ADJACENT_PAIRS_NV = 0x90AD
+ ACTIVE_ATOMIC_COUNTER_BUFFERS = 0x92D9
+ ACTIVE_ATTRIBUTES = 0x8B89
+ ACTIVE_ATTRIBUTE_MAX_LENGTH = 0x8B8A
+ ACTIVE_PROGRAM = 0x8259
+ ACTIVE_PROGRAM_EXT = 0x8B8D
+ ACTIVE_RESOURCES = 0x92F5
+ ACTIVE_SUBROUTINES = 0x8DE5
+ ACTIVE_SUBROUTINE_MAX_LENGTH = 0x8E48
+ ACTIVE_SUBROUTINE_UNIFORMS = 0x8DE6
+ ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS = 0x8E47
+ ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH = 0x8E49
+ ACTIVE_TEXTURE = 0x84E0
+ ACTIVE_UNIFORMS = 0x8B86
+ ACTIVE_UNIFORM_BLOCKS = 0x8A36
+ ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH = 0x8A35
+ ACTIVE_UNIFORM_MAX_LENGTH = 0x8B87
+ ACTIVE_VARIABLES = 0x9305
+ ADJACENT_PAIRS_NV = 0x90AE
+ AFFINE_2D_NV = 0x9092
+ AFFINE_3D_NV = 0x9094
+ ALIASED_LINE_WIDTH_RANGE = 0x846E
+ ALL_BARRIER_BITS = 0xFFFFFFFF
+ ALL_SHADER_BITS = 0xFFFFFFFF
+ ALL_SHADER_BITS_EXT = 0xFFFFFFFF
+ ALPHA = 0x1906
+ ALPHA_REF_COMMAND_NV = 0x000F
+ ALREADY_SIGNALED = 0x911A
+ ALWAYS = 0x0207
+ AND = 0x1501
+ AND_INVERTED = 0x1504
+ AND_REVERSE = 0x1502
+ ANY_SAMPLES_PASSED = 0x8C2F
+ ANY_SAMPLES_PASSED_CONSERVATIVE = 0x8D6A
+ ARC_TO_NV = 0xFE
+ ARRAY_BUFFER = 0x8892
+ ARRAY_BUFFER_BINDING = 0x8894
+ ARRAY_SIZE = 0x92FB
+ ARRAY_STRIDE = 0x92FE
+ ATOMIC_COUNTER_BARRIER_BIT = 0x00001000
+ ATOMIC_COUNTER_BUFFER = 0x92C0
+ ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS = 0x92C5
+ ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES = 0x92C6
+ ATOMIC_COUNTER_BUFFER_BINDING = 0x92C1
+ ATOMIC_COUNTER_BUFFER_DATA_SIZE = 0x92C4
+ ATOMIC_COUNTER_BUFFER_INDEX = 0x9301
+ ATOMIC_COUNTER_BUFFER_REFERENCED_BY_COMPUTE_SHADER = 0x90ED
+ ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER = 0x92CB
+ ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER = 0x92CA
+ ATOMIC_COUNTER_BUFFER_REFERENCED_BY_MESH_SHADER_NV = 0x959E
+ ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TASK_SHADER_NV = 0x959F
+ ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER = 0x92C8
+ ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER = 0x92C9
+ ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER = 0x92C7
+ ATOMIC_COUNTER_BUFFER_SIZE = 0x92C3
+ ATOMIC_COUNTER_BUFFER_START = 0x92C2
+ ATTACHED_MEMORY_OBJECT_NV = 0x95A4
+ ATTACHED_MEMORY_OFFSET_NV = 0x95A5
+ ATTACHED_SHADERS = 0x8B85
+ ATTRIBUTE_ADDRESS_COMMAND_NV = 0x0009
+ AUTO_GENERATE_MIPMAP = 0x8295
+ BACK = 0x0405
+ BACK_LEFT = 0x0402
+ BACK_RIGHT = 0x0403
+ BEVEL_NV = 0x90A6
+ BGR = 0x80E0
+ BGRA = 0x80E1
+ BGRA_INTEGER = 0x8D9B
+ BGR_INTEGER = 0x8D9A
+ BLACKHOLE_RENDER_INTEL = 0x83FC
+ BLEND = 0x0BE2
+ BLEND_ADVANCED_COHERENT_KHR = 0x9285
+ BLEND_ADVANCED_COHERENT_NV = 0x9285
+ BLEND_COLOR = 0x8005
+ BLEND_COLOR_COMMAND_NV = 0x000B
+ BLEND_DST = 0x0BE0
+ BLEND_DST_ALPHA = 0x80CA
+ BLEND_DST_RGB = 0x80C8
+ BLEND_EQUATION = 0x8009
+ BLEND_EQUATION_ALPHA = 0x883D
+ BLEND_EQUATION_RGB = 0x8009
+ BLEND_OVERLAP_NV = 0x9281
+ BLEND_PREMULTIPLIED_SRC_NV = 0x9280
+ BLEND_SRC = 0x0BE1
+ BLEND_SRC_ALPHA = 0x80CB
+ BLEND_SRC_RGB = 0x80C9
+ BLOCK_INDEX = 0x92FD
+ BLUE = 0x1905
+ BLUE_INTEGER = 0x8D96
+ BLUE_NV = 0x1905
+ BOLD_BIT_NV = 0x01
+ BOOL = 0x8B56
+ BOOL_VEC2 = 0x8B57
+ BOOL_VEC3 = 0x8B58
+ BOOL_VEC4 = 0x8B59
+ BOUNDING_BOX_NV = 0x908D
+ BOUNDING_BOX_OF_BOUNDING_BOXES_NV = 0x909C
+ BUFFER = 0x82E0
+ BUFFER_ACCESS = 0x88BB
+ BUFFER_ACCESS_FLAGS = 0x911F
+ BUFFER_BINDING = 0x9302
+ BUFFER_DATA_SIZE = 0x9303
+ BUFFER_GPU_ADDRESS_NV = 0x8F1D
+ BUFFER_IMMUTABLE_STORAGE = 0x821F
+ BUFFER_KHR = 0x82E0
+ BUFFER_MAPPED = 0x88BC
+ BUFFER_MAP_LENGTH = 0x9120
+ BUFFER_MAP_OFFSET = 0x9121
+ BUFFER_MAP_POINTER = 0x88BD
+ BUFFER_OBJECT_EXT = 0x9151
+ BUFFER_SIZE = 0x8764
+ BUFFER_STORAGE_FLAGS = 0x8220
+ BUFFER_UPDATE_BARRIER_BIT = 0x00000200
+ BUFFER_USAGE = 0x8765
+ BUFFER_VARIABLE = 0x92E5
+ BYTE = 0x1400
+ CAVEAT_SUPPORT = 0x82B8
+ CCW = 0x0901
+ CIRCULAR_CCW_ARC_TO_NV = 0xF8
+ CIRCULAR_CW_ARC_TO_NV = 0xFA
+ CIRCULAR_TANGENT_ARC_TO_NV = 0xFC
+ CLAMP_READ_COLOR = 0x891C
+ CLAMP_TO_BORDER = 0x812D
+ CLAMP_TO_BORDER_ARB = 0x812D
+ CLAMP_TO_EDGE = 0x812F
+ CLEAR = 0x1500
+ CLEAR_BUFFER = 0x82B4
+ CLEAR_TEXTURE = 0x9365
+ CLIENT_MAPPED_BUFFER_BARRIER_BIT = 0x00004000
+ CLIENT_STORAGE_BIT = 0x0200
+ CLIPPING_INPUT_PRIMITIVES_ARB = 0x82F6
+ CLIPPING_OUTPUT_PRIMITIVES_ARB = 0x82F7
+ CLIP_DEPTH_MODE = 0x935D
+ CLIP_DISTANCE0 = 0x3000
+ CLIP_DISTANCE1 = 0x3001
+ CLIP_DISTANCE2 = 0x3002
+ CLIP_DISTANCE3 = 0x3003
+ CLIP_DISTANCE4 = 0x3004
+ CLIP_DISTANCE5 = 0x3005
+ CLIP_DISTANCE6 = 0x3006
+ CLIP_DISTANCE7 = 0x3007
+ CLIP_ORIGIN = 0x935C
+ CLOSE_PATH_NV = 0x00
+ COLOR = 0x1800
+ COLORBURN_KHR = 0x929A
+ COLORBURN_NV = 0x929A
+ COLORDODGE_KHR = 0x9299
+ COLORDODGE_NV = 0x9299
+ COLOR_ARRAY_ADDRESS_NV = 0x8F23
+ COLOR_ARRAY_LENGTH_NV = 0x8F2D
+ COLOR_ATTACHMENT0 = 0x8CE0
+ COLOR_ATTACHMENT1 = 0x8CE1
+ COLOR_ATTACHMENT10 = 0x8CEA
+ COLOR_ATTACHMENT11 = 0x8CEB
+ COLOR_ATTACHMENT12 = 0x8CEC
+ COLOR_ATTACHMENT13 = 0x8CED
+ COLOR_ATTACHMENT14 = 0x8CEE
+ COLOR_ATTACHMENT15 = 0x8CEF
+ COLOR_ATTACHMENT16 = 0x8CF0
+ COLOR_ATTACHMENT17 = 0x8CF1
+ COLOR_ATTACHMENT18 = 0x8CF2
+ COLOR_ATTACHMENT19 = 0x8CF3
+ COLOR_ATTACHMENT2 = 0x8CE2
+ COLOR_ATTACHMENT20 = 0x8CF4
+ COLOR_ATTACHMENT21 = 0x8CF5
+ COLOR_ATTACHMENT22 = 0x8CF6
+ COLOR_ATTACHMENT23 = 0x8CF7
+ COLOR_ATTACHMENT24 = 0x8CF8
+ COLOR_ATTACHMENT25 = 0x8CF9
+ COLOR_ATTACHMENT26 = 0x8CFA
+ COLOR_ATTACHMENT27 = 0x8CFB
+ COLOR_ATTACHMENT28 = 0x8CFC
+ COLOR_ATTACHMENT29 = 0x8CFD
+ COLOR_ATTACHMENT3 = 0x8CE3
+ COLOR_ATTACHMENT30 = 0x8CFE
+ COLOR_ATTACHMENT31 = 0x8CFF
+ COLOR_ATTACHMENT4 = 0x8CE4
+ COLOR_ATTACHMENT5 = 0x8CE5
+ COLOR_ATTACHMENT6 = 0x8CE6
+ COLOR_ATTACHMENT7 = 0x8CE7
+ COLOR_ATTACHMENT8 = 0x8CE8
+ COLOR_ATTACHMENT9 = 0x8CE9
+ COLOR_BUFFER_BIT = 0x00004000
+ COLOR_CLEAR_VALUE = 0x0C22
+ COLOR_COMPONENTS = 0x8283
+ COLOR_ENCODING = 0x8296
+ COLOR_LOGIC_OP = 0x0BF2
+ COLOR_RENDERABLE = 0x8286
+ COLOR_SAMPLES_NV = 0x8E20
+ COLOR_WRITEMASK = 0x0C23
+ COMMAND_BARRIER_BIT = 0x00000040
+ COMPARE_REF_TO_TEXTURE = 0x884E
+ COMPATIBLE_SUBROUTINES = 0x8E4B
+ COMPILE_STATUS = 0x8B81
+ COMPLETION_STATUS_ARB = 0x91B1
+ COMPLETION_STATUS_KHR = 0x91B1
+ COMPRESSED_R11_EAC = 0x9270
+ COMPRESSED_RED = 0x8225
+ COMPRESSED_RED_RGTC1 = 0x8DBB
+ COMPRESSED_RG = 0x8226
+ COMPRESSED_RG11_EAC = 0x9272
+ COMPRESSED_RGB = 0x84ED
+ COMPRESSED_RGB8_ETC2 = 0x9274
+ COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 0x9276
+ COMPRESSED_RGBA = 0x84EE
+ COMPRESSED_RGBA8_ETC2_EAC = 0x9278
+ COMPRESSED_RGBA_ASTC_10x10_KHR = 0x93BB
+ COMPRESSED_RGBA_ASTC_10x5_KHR = 0x93B8
+ COMPRESSED_RGBA_ASTC_10x6_KHR = 0x93B9
+ COMPRESSED_RGBA_ASTC_10x8_KHR = 0x93BA
+ COMPRESSED_RGBA_ASTC_12x10_KHR = 0x93BC
+ COMPRESSED_RGBA_ASTC_12x12_KHR = 0x93BD
+ COMPRESSED_RGBA_ASTC_4x4_KHR = 0x93B0
+ COMPRESSED_RGBA_ASTC_5x4_KHR = 0x93B1
+ COMPRESSED_RGBA_ASTC_5x5_KHR = 0x93B2
+ COMPRESSED_RGBA_ASTC_6x5_KHR = 0x93B3
+ COMPRESSED_RGBA_ASTC_6x6_KHR = 0x93B4
+ COMPRESSED_RGBA_ASTC_8x5_KHR = 0x93B5
+ COMPRESSED_RGBA_ASTC_8x6_KHR = 0x93B6
+ COMPRESSED_RGBA_ASTC_8x8_KHR = 0x93B7
+ COMPRESSED_RGBA_BPTC_UNORM_ARB = 0x8E8C
+ COMPRESSED_RGBA_S3TC_DXT1_EXT = 0x83F1
+ COMPRESSED_RGBA_S3TC_DXT3_EXT = 0x83F2
+ COMPRESSED_RGBA_S3TC_DXT5_EXT = 0x83F3
+ COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB = 0x8E8E
+ COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB = 0x8E8F
+ COMPRESSED_RGB_S3TC_DXT1_EXT = 0x83F0
+ COMPRESSED_RG_RGTC2 = 0x8DBD
+ COMPRESSED_SIGNED_R11_EAC = 0x9271
+ COMPRESSED_SIGNED_RED_RGTC1 = 0x8DBC
+ COMPRESSED_SIGNED_RG11_EAC = 0x9273
+ COMPRESSED_SIGNED_RG_RGTC2 = 0x8DBE
+ COMPRESSED_SRGB = 0x8C48
+ COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR = 0x93DB
+ COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR = 0x93D8
+ COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR = 0x93D9
+ COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR = 0x93DA
+ COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR = 0x93DC
+ COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR = 0x93DD
+ COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR = 0x93D0
+ COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR = 0x93D1
+ COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR = 0x93D2
+ COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR = 0x93D3
+ COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR = 0x93D4
+ COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR = 0x93D5
+ COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR = 0x93D6
+ COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR = 0x93D7
+ COMPRESSED_SRGB8_ALPHA8_ETC2_EAC = 0x9279
+ COMPRESSED_SRGB8_ETC2 = 0x9275
+ COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 0x9277
+ COMPRESSED_SRGB_ALPHA = 0x8C49
+ COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB = 0x8E8D
+ COMPRESSED_TEXTURE_FORMATS = 0x86A3
+ COMPUTE_SHADER = 0x91B9
+ COMPUTE_SHADER_BIT = 0x00000020
+ COMPUTE_SHADER_INVOCATIONS_ARB = 0x82F5
+ COMPUTE_SUBROUTINE = 0x92ED
+ COMPUTE_SUBROUTINE_UNIFORM = 0x92F3
+ COMPUTE_TEXTURE = 0x82A0
+ COMPUTE_WORK_GROUP_SIZE = 0x8267
+ CONDITION_SATISFIED = 0x911C
+ CONFORMANT_NV = 0x9374
+ CONIC_CURVE_TO_NV = 0x1A
+ CONJOINT_NV = 0x9284
+ CONSERVATIVE_RASTERIZATION_INTEL = 0x83FE
+ CONSERVATIVE_RASTERIZATION_NV = 0x9346
+ CONSERVATIVE_RASTER_DILATE_GRANULARITY_NV = 0x937B
+ CONSERVATIVE_RASTER_DILATE_NV = 0x9379
+ CONSERVATIVE_RASTER_DILATE_RANGE_NV = 0x937A
+ CONSERVATIVE_RASTER_MODE_NV = 0x954D
+ CONSERVATIVE_RASTER_MODE_POST_SNAP_NV = 0x954E
+ CONSERVATIVE_RASTER_MODE_PRE_SNAP_NV = 0x9550
+ CONSERVATIVE_RASTER_MODE_PRE_SNAP_TRIANGLES_NV = 0x954F
+ CONSTANT_ALPHA = 0x8003
+ CONSTANT_COLOR = 0x8001
+ CONTEXT_COMPATIBILITY_PROFILE_BIT = 0x00000002
+ CONTEXT_CORE_PROFILE_BIT = 0x00000001
+ CONTEXT_FLAGS = 0x821E
+ CONTEXT_FLAG_DEBUG_BIT = 0x00000002
+ CONTEXT_FLAG_DEBUG_BIT_KHR = 0x00000002
+ CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT = 0x00000001
+ CONTEXT_FLAG_NO_ERROR_BIT_KHR = 0x00000008
+ CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB = 0x00000004
+ CONTEXT_LOST = 0x0507
+ CONTEXT_LOST_KHR = 0x0507
+ CONTEXT_PROFILE_MASK = 0x9126
+ CONTEXT_RELEASE_BEHAVIOR = 0x82FB
+ CONTEXT_RELEASE_BEHAVIOR_FLUSH = 0x82FC
+ CONTEXT_RELEASE_BEHAVIOR_FLUSH_KHR = 0x82FC
+ CONTEXT_RELEASE_BEHAVIOR_KHR = 0x82FB
+ CONTEXT_ROBUST_ACCESS = 0x90F3
+ CONTEXT_ROBUST_ACCESS_KHR = 0x90F3
+ CONTRAST_NV = 0x92A1
+ CONVEX_HULL_NV = 0x908B
+ COPY = 0x1503
+ COPY_INVERTED = 0x150C
+ COPY_READ_BUFFER = 0x8F36
+ COPY_WRITE_BUFFER = 0x8F37
+ COUNTER_RANGE_AMD = 0x8BC1
+ COUNTER_TYPE_AMD = 0x8BC0
+ COUNT_DOWN_NV = 0x9089
+ COUNT_UP_NV = 0x9088
+ COVERAGE_MODULATION_NV = 0x9332
+ COVERAGE_MODULATION_TABLE_NV = 0x9331
+ COVERAGE_MODULATION_TABLE_SIZE_NV = 0x9333
+ CUBIC_CURVE_TO_NV = 0x0C
+ CULL_FACE = 0x0B44
+ CULL_FACE_MODE = 0x0B45
+ CURRENT_PROGRAM = 0x8B8D
+ CURRENT_QUERY = 0x8865
+ CURRENT_VERTEX_ATTRIB = 0x8626
+ CW = 0x0900
+ DARKEN_KHR = 0x9297
+ DARKEN_NV = 0x9297
+ DEBUG_CALLBACK_FUNCTION = 0x8244
+ DEBUG_CALLBACK_FUNCTION_ARB = 0x8244
+ DEBUG_CALLBACK_FUNCTION_KHR = 0x8244
+ DEBUG_CALLBACK_USER_PARAM = 0x8245
+ DEBUG_CALLBACK_USER_PARAM_ARB = 0x8245
+ DEBUG_CALLBACK_USER_PARAM_KHR = 0x8245
+ DEBUG_GROUP_STACK_DEPTH = 0x826D
+ DEBUG_GROUP_STACK_DEPTH_KHR = 0x826D
+ DEBUG_LOGGED_MESSAGES = 0x9145
+ DEBUG_LOGGED_MESSAGES_ARB = 0x9145
+ DEBUG_LOGGED_MESSAGES_KHR = 0x9145
+ DEBUG_NEXT_LOGGED_MESSAGE_LENGTH = 0x8243
+ DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_ARB = 0x8243
+ DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_KHR = 0x8243
+ DEBUG_OUTPUT = 0x92E0
+ DEBUG_OUTPUT_KHR = 0x92E0
+ DEBUG_OUTPUT_SYNCHRONOUS = 0x8242
+ DEBUG_OUTPUT_SYNCHRONOUS_ARB = 0x8242
+ DEBUG_OUTPUT_SYNCHRONOUS_KHR = 0x8242
+ DEBUG_SEVERITY_HIGH = 0x9146
+ DEBUG_SEVERITY_HIGH_ARB = 0x9146
+ DEBUG_SEVERITY_HIGH_KHR = 0x9146
+ DEBUG_SEVERITY_LOW = 0x9148
+ DEBUG_SEVERITY_LOW_ARB = 0x9148
+ DEBUG_SEVERITY_LOW_KHR = 0x9148
+ DEBUG_SEVERITY_MEDIUM = 0x9147
+ DEBUG_SEVERITY_MEDIUM_ARB = 0x9147
+ DEBUG_SEVERITY_MEDIUM_KHR = 0x9147
+ DEBUG_SEVERITY_NOTIFICATION = 0x826B
+ DEBUG_SEVERITY_NOTIFICATION_KHR = 0x826B
+ DEBUG_SOURCE_API = 0x8246
+ DEBUG_SOURCE_API_ARB = 0x8246
+ DEBUG_SOURCE_API_KHR = 0x8246
+ DEBUG_SOURCE_APPLICATION = 0x824A
+ DEBUG_SOURCE_APPLICATION_ARB = 0x824A
+ DEBUG_SOURCE_APPLICATION_KHR = 0x824A
+ DEBUG_SOURCE_OTHER = 0x824B
+ DEBUG_SOURCE_OTHER_ARB = 0x824B
+ DEBUG_SOURCE_OTHER_KHR = 0x824B
+ DEBUG_SOURCE_SHADER_COMPILER = 0x8248
+ DEBUG_SOURCE_SHADER_COMPILER_ARB = 0x8248
+ DEBUG_SOURCE_SHADER_COMPILER_KHR = 0x8248
+ DEBUG_SOURCE_THIRD_PARTY = 0x8249
+ DEBUG_SOURCE_THIRD_PARTY_ARB = 0x8249
+ DEBUG_SOURCE_THIRD_PARTY_KHR = 0x8249
+ DEBUG_SOURCE_WINDOW_SYSTEM = 0x8247
+ DEBUG_SOURCE_WINDOW_SYSTEM_ARB = 0x8247
+ DEBUG_SOURCE_WINDOW_SYSTEM_KHR = 0x8247
+ DEBUG_TYPE_DEPRECATED_BEHAVIOR = 0x824D
+ DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB = 0x824D
+ DEBUG_TYPE_DEPRECATED_BEHAVIOR_KHR = 0x824D
+ DEBUG_TYPE_ERROR = 0x824C
+ DEBUG_TYPE_ERROR_ARB = 0x824C
+ DEBUG_TYPE_ERROR_KHR = 0x824C
+ DEBUG_TYPE_MARKER = 0x8268
+ DEBUG_TYPE_MARKER_KHR = 0x8268
+ DEBUG_TYPE_OTHER = 0x8251
+ DEBUG_TYPE_OTHER_ARB = 0x8251
+ DEBUG_TYPE_OTHER_KHR = 0x8251
+ DEBUG_TYPE_PERFORMANCE = 0x8250
+ DEBUG_TYPE_PERFORMANCE_ARB = 0x8250
+ DEBUG_TYPE_PERFORMANCE_KHR = 0x8250
+ DEBUG_TYPE_POP_GROUP = 0x826A
+ DEBUG_TYPE_POP_GROUP_KHR = 0x826A
+ DEBUG_TYPE_PORTABILITY = 0x824F
+ DEBUG_TYPE_PORTABILITY_ARB = 0x824F
+ DEBUG_TYPE_PORTABILITY_KHR = 0x824F
+ DEBUG_TYPE_PUSH_GROUP = 0x8269
+ DEBUG_TYPE_PUSH_GROUP_KHR = 0x8269
+ DEBUG_TYPE_UNDEFINED_BEHAVIOR = 0x824E
+ DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB = 0x824E
+ DEBUG_TYPE_UNDEFINED_BEHAVIOR_KHR = 0x824E
+ DECODE_EXT = 0x8A49
+ DECR = 0x1E03
+ DECR_WRAP = 0x8508
+ DELETE_STATUS = 0x8B80
+ DEPTH = 0x1801
+ DEPTH24_STENCIL8 = 0x88F0
+ DEPTH32F_STENCIL8 = 0x8CAD
+ DEPTH32F_STENCIL8_NV = 0x8DAC
+ DEPTH_ATTACHMENT = 0x8D00
+ DEPTH_BUFFER_BIT = 0x00000100
+ DEPTH_BUFFER_FLOAT_MODE_NV = 0x8DAF
+ DEPTH_CLAMP = 0x864F
+ DEPTH_CLEAR_VALUE = 0x0B73
+ DEPTH_COMPONENT = 0x1902
+ DEPTH_COMPONENT16 = 0x81A5
+ DEPTH_COMPONENT24 = 0x81A6
+ DEPTH_COMPONENT32 = 0x81A7
+ DEPTH_COMPONENT32F = 0x8CAC
+ DEPTH_COMPONENT32F_NV = 0x8DAB
+ DEPTH_COMPONENTS = 0x8284
+ DEPTH_FUNC = 0x0B74
+ DEPTH_RANGE = 0x0B70
+ DEPTH_RENDERABLE = 0x8287
+ DEPTH_SAMPLES_NV = 0x932D
+ DEPTH_STENCIL = 0x84F9
+ DEPTH_STENCIL_ATTACHMENT = 0x821A
+ DEPTH_STENCIL_TEXTURE_MODE = 0x90EA
+ DEPTH_TEST = 0x0B71
+ DEPTH_WRITEMASK = 0x0B72
+ DETACHED_BUFFERS_NV = 0x95AB
+ DETACHED_MEMORY_INCARNATION_NV = 0x95A9
+ DETACHED_TEXTURES_NV = 0x95AA
+ DIFFERENCE_KHR = 0x929E
+ DIFFERENCE_NV = 0x929E
+ DISJOINT_NV = 0x9283
+ DISPATCH_INDIRECT_BUFFER = 0x90EE
+ DISPATCH_INDIRECT_BUFFER_BINDING = 0x90EF
+ DITHER = 0x0BD0
+ DONT_CARE = 0x1100
+ DOUBLE = 0x140A
+ DOUBLEBUFFER = 0x0C32
+ DOUBLE_MAT2 = 0x8F46
+ DOUBLE_MAT2x3 = 0x8F49
+ DOUBLE_MAT2x4 = 0x8F4A
+ DOUBLE_MAT3 = 0x8F47
+ DOUBLE_MAT3x2 = 0x8F4B
+ DOUBLE_MAT3x4 = 0x8F4C
+ DOUBLE_MAT4 = 0x8F48
+ DOUBLE_MAT4x2 = 0x8F4D
+ DOUBLE_MAT4x3 = 0x8F4E
+ DOUBLE_VEC2 = 0x8FFC
+ DOUBLE_VEC3 = 0x8FFD
+ DOUBLE_VEC4 = 0x8FFE
+ DRAW_ARRAYS_COMMAND_NV = 0x0003
+ DRAW_ARRAYS_INSTANCED_COMMAND_NV = 0x0007
+ DRAW_ARRAYS_STRIP_COMMAND_NV = 0x0005
+ DRAW_BUFFER = 0x0C01
+ DRAW_BUFFER0 = 0x8825
+ DRAW_BUFFER1 = 0x8826
+ DRAW_BUFFER10 = 0x882F
+ DRAW_BUFFER11 = 0x8830
+ DRAW_BUFFER12 = 0x8831
+ DRAW_BUFFER13 = 0x8832
+ DRAW_BUFFER14 = 0x8833
+ DRAW_BUFFER15 = 0x8834
+ DRAW_BUFFER2 = 0x8827
+ DRAW_BUFFER3 = 0x8828
+ DRAW_BUFFER4 = 0x8829
+ DRAW_BUFFER5 = 0x882A
+ DRAW_BUFFER6 = 0x882B
+ DRAW_BUFFER7 = 0x882C
+ DRAW_BUFFER8 = 0x882D
+ DRAW_BUFFER9 = 0x882E
+ DRAW_ELEMENTS_COMMAND_NV = 0x0002
+ DRAW_ELEMENTS_INSTANCED_COMMAND_NV = 0x0006
+ DRAW_ELEMENTS_STRIP_COMMAND_NV = 0x0004
+ DRAW_FRAMEBUFFER = 0x8CA9
+ DRAW_FRAMEBUFFER_BINDING = 0x8CA6
+ DRAW_INDIRECT_ADDRESS_NV = 0x8F41
+ DRAW_INDIRECT_BUFFER = 0x8F3F
+ DRAW_INDIRECT_BUFFER_BINDING = 0x8F43
+ DRAW_INDIRECT_LENGTH_NV = 0x8F42
+ DRAW_INDIRECT_UNIFIED_NV = 0x8F40
+ DST_ALPHA = 0x0304
+ DST_ATOP_NV = 0x928F
+ DST_COLOR = 0x0306
+ DST_IN_NV = 0x928B
+ DST_NV = 0x9287
+ DST_OUT_NV = 0x928D
+ DST_OVER_NV = 0x9289
+ DUP_FIRST_CUBIC_CURVE_TO_NV = 0xF2
+ DUP_LAST_CUBIC_CURVE_TO_NV = 0xF4
+ DYNAMIC_COPY = 0x88EA
+ DYNAMIC_DRAW = 0x88E8
+ DYNAMIC_READ = 0x88E9
+ DYNAMIC_STORAGE_BIT = 0x0100
+ EDGE_FLAG_ARRAY_ADDRESS_NV = 0x8F26
+ EDGE_FLAG_ARRAY_LENGTH_NV = 0x8F30
+ EFFECTIVE_RASTER_SAMPLES_EXT = 0x932C
+ ELEMENT_ADDRESS_COMMAND_NV = 0x0008
+ ELEMENT_ARRAY_ADDRESS_NV = 0x8F29
+ ELEMENT_ARRAY_BARRIER_BIT = 0x00000002
+ ELEMENT_ARRAY_BUFFER = 0x8893
+ ELEMENT_ARRAY_BUFFER_BINDING = 0x8895
+ ELEMENT_ARRAY_LENGTH_NV = 0x8F33
+ ELEMENT_ARRAY_UNIFIED_NV = 0x8F1F
+ EQUAL = 0x0202
+ EQUIV = 0x1509
+ EXCLUSION_KHR = 0x92A0
+ EXCLUSION_NV = 0x92A0
+ EXCLUSIVE_EXT = 0x8F11
+ EXTENSIONS = 0x1F03
+ FACTOR_MAX_AMD = 0x901D
+ FACTOR_MIN_AMD = 0x901C
+ FALSE = 0
+ FASTEST = 0x1101
+ FILE_NAME_NV = 0x9074
+ FILL = 0x1B02
+ FILL_RECTANGLE_NV = 0x933C
+ FILTER = 0x829A
+ FIRST_TO_REST_NV = 0x90AF
+ FIRST_VERTEX_CONVENTION = 0x8E4D
+ FIXED = 0x140C
+ FIXED_ONLY = 0x891D
+ FLOAT = 0x1406
+ FLOAT16_NV = 0x8FF8
+ FLOAT16_VEC2_NV = 0x8FF9
+ FLOAT16_VEC3_NV = 0x8FFA
+ FLOAT16_VEC4_NV = 0x8FFB
+ FLOAT_32_UNSIGNED_INT_24_8_REV = 0x8DAD
+ FLOAT_32_UNSIGNED_INT_24_8_REV_NV = 0x8DAD
+ FLOAT_MAT2 = 0x8B5A
+ FLOAT_MAT2x3 = 0x8B65
+ FLOAT_MAT2x4 = 0x8B66
+ FLOAT_MAT3 = 0x8B5B
+ FLOAT_MAT3x2 = 0x8B67
+ FLOAT_MAT3x4 = 0x8B68
+ FLOAT_MAT4 = 0x8B5C
+ FLOAT_MAT4x2 = 0x8B69
+ FLOAT_MAT4x3 = 0x8B6A
+ FLOAT_VEC2 = 0x8B50
+ FLOAT_VEC3 = 0x8B51
+ FLOAT_VEC4 = 0x8B52
+ FOG_COORD_ARRAY_ADDRESS_NV = 0x8F28
+ FOG_COORD_ARRAY_LENGTH_NV = 0x8F32
+ FONT_ASCENDER_BIT_NV = 0x00200000
+ FONT_DESCENDER_BIT_NV = 0x00400000
+ FONT_GLYPHS_AVAILABLE_NV = 0x9368
+ FONT_HAS_KERNING_BIT_NV = 0x10000000
+ FONT_HEIGHT_BIT_NV = 0x00800000
+ FONT_MAX_ADVANCE_HEIGHT_BIT_NV = 0x02000000
+ FONT_MAX_ADVANCE_WIDTH_BIT_NV = 0x01000000
+ FONT_NUM_GLYPH_INDICES_BIT_NV = 0x20000000
+ FONT_TARGET_UNAVAILABLE_NV = 0x9369
+ FONT_UNAVAILABLE_NV = 0x936A
+ FONT_UNDERLINE_POSITION_BIT_NV = 0x04000000
+ FONT_UNDERLINE_THICKNESS_BIT_NV = 0x08000000
+ FONT_UNINTELLIGIBLE_NV = 0x936B
+ FONT_UNITS_PER_EM_BIT_NV = 0x00100000
+ FONT_X_MAX_BOUNDS_BIT_NV = 0x00040000
+ FONT_X_MIN_BOUNDS_BIT_NV = 0x00010000
+ FONT_Y_MAX_BOUNDS_BIT_NV = 0x00080000
+ FONT_Y_MIN_BOUNDS_BIT_NV = 0x00020000
+ FRACTIONAL_EVEN = 0x8E7C
+ FRACTIONAL_ODD = 0x8E7B
+ FRAGMENT_COVERAGE_COLOR_NV = 0x92DE
+ FRAGMENT_COVERAGE_TO_COLOR_NV = 0x92DD
+ FRAGMENT_INPUT_NV = 0x936D
+ FRAGMENT_INTERPOLATION_OFFSET_BITS = 0x8E5D
+ FRAGMENT_SHADER = 0x8B30
+ FRAGMENT_SHADER_BIT = 0x00000002
+ FRAGMENT_SHADER_BIT_EXT = 0x00000002
+ FRAGMENT_SHADER_DERIVATIVE_HINT = 0x8B8B
+ FRAGMENT_SHADER_DISCARDS_SAMPLES_EXT = 0x8A52
+ FRAGMENT_SHADER_INVOCATIONS_ARB = 0x82F4
+ FRAGMENT_SUBROUTINE = 0x92EC
+ FRAGMENT_SUBROUTINE_UNIFORM = 0x92F2
+ FRAGMENT_TEXTURE = 0x829F
+ FRAMEBUFFER = 0x8D40
+ FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE = 0x8215
+ FRAMEBUFFER_ATTACHMENT_BLUE_SIZE = 0x8214
+ FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING = 0x8210
+ FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE = 0x8211
+ FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE = 0x8216
+ FRAMEBUFFER_ATTACHMENT_GREEN_SIZE = 0x8213
+ FRAMEBUFFER_ATTACHMENT_LAYERED = 0x8DA7
+ FRAMEBUFFER_ATTACHMENT_LAYERED_ARB = 0x8DA7
+ FRAMEBUFFER_ATTACHMENT_OBJECT_NAME = 0x8CD1
+ FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE = 0x8CD0
+ FRAMEBUFFER_ATTACHMENT_RED_SIZE = 0x8212
+ FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE = 0x8217
+ FRAMEBUFFER_ATTACHMENT_TEXTURE_BASE_VIEW_INDEX_OVR = 0x9632
+ FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = 0x8CD3
+ FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER = 0x8CD4
+ FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL = 0x8CD2
+ FRAMEBUFFER_ATTACHMENT_TEXTURE_NUM_VIEWS_OVR = 0x9630
+ FRAMEBUFFER_BARRIER_BIT = 0x00000400
+ FRAMEBUFFER_BINDING = 0x8CA6
+ FRAMEBUFFER_BLEND = 0x828B
+ FRAMEBUFFER_COMPLETE = 0x8CD5
+ FRAMEBUFFER_DEFAULT = 0x8218
+ FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS = 0x9314
+ FRAMEBUFFER_DEFAULT_HEIGHT = 0x9311
+ FRAMEBUFFER_DEFAULT_LAYERS = 0x9312
+ FRAMEBUFFER_DEFAULT_SAMPLES = 0x9313
+ FRAMEBUFFER_DEFAULT_WIDTH = 0x9310
+ FRAMEBUFFER_FLIP_X_MESA = 0x8BBC
+ FRAMEBUFFER_FLIP_Y_MESA = 0x8BBB
+ FRAMEBUFFER_INCOMPLETE_ATTACHMENT = 0x8CD6
+ FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER = 0x8CDB
+ FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_ARB = 0x8DA9
+ FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS = 0x8DA8
+ FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_ARB = 0x8DA8
+ FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = 0x8CD7
+ FRAMEBUFFER_INCOMPLETE_MULTISAMPLE = 0x8D56
+ FRAMEBUFFER_INCOMPLETE_READ_BUFFER = 0x8CDC
+ FRAMEBUFFER_INCOMPLETE_VIEW_TARGETS_OVR = 0x9633
+ FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS_ARB = 0x9342
+ FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS_NV = 0x9342
+ FRAMEBUFFER_RENDERABLE = 0x8289
+ FRAMEBUFFER_RENDERABLE_LAYERED = 0x828A
+ FRAMEBUFFER_SAMPLE_LOCATION_PIXEL_GRID_ARB = 0x9343
+ FRAMEBUFFER_SAMPLE_LOCATION_PIXEL_GRID_NV = 0x9343
+ FRAMEBUFFER_SRGB = 0x8DB9
+ FRAMEBUFFER_SWAP_XY_MESA = 0x8BBD
+ FRAMEBUFFER_UNDEFINED = 0x8219
+ FRAMEBUFFER_UNSUPPORTED = 0x8CDD
+ FRONT = 0x0404
+ FRONT_AND_BACK = 0x0408
+ FRONT_FACE = 0x0B46
+ FRONT_FACE_COMMAND_NV = 0x0012
+ FRONT_LEFT = 0x0400
+ FRONT_RIGHT = 0x0401
+ FULL_SUPPORT = 0x82B7
+ FUNC_ADD = 0x8006
+ FUNC_REVERSE_SUBTRACT = 0x800B
+ FUNC_SUBTRACT = 0x800A
+ GEOMETRY_INPUT_TYPE = 0x8917
+ GEOMETRY_INPUT_TYPE_ARB = 0x8DDB
+ GEOMETRY_OUTPUT_TYPE = 0x8918
+ GEOMETRY_OUTPUT_TYPE_ARB = 0x8DDC
+ GEOMETRY_SHADER = 0x8DD9
+ GEOMETRY_SHADER_ARB = 0x8DD9
+ GEOMETRY_SHADER_BIT = 0x00000004
+ GEOMETRY_SHADER_INVOCATIONS = 0x887F
+ GEOMETRY_SHADER_PRIMITIVES_EMITTED_ARB = 0x82F3
+ GEOMETRY_SUBROUTINE = 0x92EB
+ GEOMETRY_SUBROUTINE_UNIFORM = 0x92F1
+ GEOMETRY_TEXTURE = 0x829E
+ GEOMETRY_VERTICES_OUT = 0x8916
+ GEOMETRY_VERTICES_OUT_ARB = 0x8DDA
+ GEQUAL = 0x0206
+ GET_TEXTURE_IMAGE_FORMAT = 0x8291
+ GET_TEXTURE_IMAGE_TYPE = 0x8292
+ GLYPH_HAS_KERNING_BIT_NV = 0x100
+ GLYPH_HEIGHT_BIT_NV = 0x02
+ GLYPH_HORIZONTAL_BEARING_ADVANCE_BIT_NV = 0x10
+ GLYPH_HORIZONTAL_BEARING_X_BIT_NV = 0x04
+ GLYPH_HORIZONTAL_BEARING_Y_BIT_NV = 0x08
+ GLYPH_VERTICAL_BEARING_ADVANCE_BIT_NV = 0x80
+ GLYPH_VERTICAL_BEARING_X_BIT_NV = 0x20
+ GLYPH_VERTICAL_BEARING_Y_BIT_NV = 0x40
+ GLYPH_WIDTH_BIT_NV = 0x01
+ GPU_ADDRESS_NV = 0x8F34
+ GREATER = 0x0204
+ GREEN = 0x1904
+ GREEN_INTEGER = 0x8D95
+ GREEN_NV = 0x1904
+ GUILTY_CONTEXT_RESET = 0x8253
+ GUILTY_CONTEXT_RESET_ARB = 0x8253
+ GUILTY_CONTEXT_RESET_KHR = 0x8253
+ HALF_FLOAT = 0x140B
+ HARDLIGHT_KHR = 0x929B
+ HARDLIGHT_NV = 0x929B
+ HARDMIX_NV = 0x92A9
+ HIGH_FLOAT = 0x8DF2
+ HIGH_INT = 0x8DF5
+ HORIZONTAL_LINE_TO_NV = 0x06
+ HSL_COLOR_KHR = 0x92AF
+ HSL_COLOR_NV = 0x92AF
+ HSL_HUE_KHR = 0x92AD
+ HSL_HUE_NV = 0x92AD
+ HSL_LUMINOSITY_KHR = 0x92B0
+ HSL_LUMINOSITY_NV = 0x92B0
+ HSL_SATURATION_KHR = 0x92AE
+ HSL_SATURATION_NV = 0x92AE
+ IMAGE_1D = 0x904C
+ IMAGE_1D_ARRAY = 0x9052
+ IMAGE_2D = 0x904D
+ IMAGE_2D_ARRAY = 0x9053
+ IMAGE_2D_MULTISAMPLE = 0x9055
+ IMAGE_2D_MULTISAMPLE_ARRAY = 0x9056
+ IMAGE_2D_RECT = 0x904F
+ IMAGE_3D = 0x904E
+ IMAGE_BINDING_ACCESS = 0x8F3E
+ IMAGE_BINDING_FORMAT = 0x906E
+ IMAGE_BINDING_LAYER = 0x8F3D
+ IMAGE_BINDING_LAYERED = 0x8F3C
+ IMAGE_BINDING_LEVEL = 0x8F3B
+ IMAGE_BINDING_NAME = 0x8F3A
+ IMAGE_BUFFER = 0x9051
+ IMAGE_CLASS_10_10_10_2 = 0x82C3
+ IMAGE_CLASS_11_11_10 = 0x82C2
+ IMAGE_CLASS_1_X_16 = 0x82BE
+ IMAGE_CLASS_1_X_32 = 0x82BB
+ IMAGE_CLASS_1_X_8 = 0x82C1
+ IMAGE_CLASS_2_X_16 = 0x82BD
+ IMAGE_CLASS_2_X_32 = 0x82BA
+ IMAGE_CLASS_2_X_8 = 0x82C0
+ IMAGE_CLASS_4_X_16 = 0x82BC
+ IMAGE_CLASS_4_X_32 = 0x82B9
+ IMAGE_CLASS_4_X_8 = 0x82BF
+ IMAGE_COMPATIBILITY_CLASS = 0x82A8
+ IMAGE_CUBE = 0x9050
+ IMAGE_CUBE_MAP_ARRAY = 0x9054
+ IMAGE_FORMAT_COMPATIBILITY_BY_CLASS = 0x90C9
+ IMAGE_FORMAT_COMPATIBILITY_BY_SIZE = 0x90C8
+ IMAGE_FORMAT_COMPATIBILITY_TYPE = 0x90C7
+ IMAGE_PIXEL_FORMAT = 0x82A9
+ IMAGE_PIXEL_TYPE = 0x82AA
+ IMAGE_TEXEL_SIZE = 0x82A7
+ IMPLEMENTATION_COLOR_READ_FORMAT = 0x8B9B
+ IMPLEMENTATION_COLOR_READ_TYPE = 0x8B9A
+ INCLUSIVE_EXT = 0x8F10
+ INCR = 0x1E02
+ INCR_WRAP = 0x8507
+ INDEX_ARRAY_ADDRESS_NV = 0x8F24
+ INDEX_ARRAY_LENGTH_NV = 0x8F2E
+ INFO_LOG_LENGTH = 0x8B84
+ INNOCENT_CONTEXT_RESET = 0x8254
+ INNOCENT_CONTEXT_RESET_ARB = 0x8254
+ INNOCENT_CONTEXT_RESET_KHR = 0x8254
+ INT = 0x1404
+ INT16_NV = 0x8FE4
+ INT16_VEC2_NV = 0x8FE5
+ INT16_VEC3_NV = 0x8FE6
+ INT16_VEC4_NV = 0x8FE7
+ INT64_ARB = 0x140E
+ INT64_NV = 0x140E
+ INT64_VEC2_ARB = 0x8FE9
+ INT64_VEC2_NV = 0x8FE9
+ INT64_VEC3_ARB = 0x8FEA
+ INT64_VEC3_NV = 0x8FEA
+ INT64_VEC4_ARB = 0x8FEB
+ INT64_VEC4_NV = 0x8FEB
+ INT8_NV = 0x8FE0
+ INT8_VEC2_NV = 0x8FE1
+ INT8_VEC3_NV = 0x8FE2
+ INT8_VEC4_NV = 0x8FE3
+ INTERLEAVED_ATTRIBS = 0x8C8C
+ INTERNALFORMAT_ALPHA_SIZE = 0x8274
+ INTERNALFORMAT_ALPHA_TYPE = 0x827B
+ INTERNALFORMAT_BLUE_SIZE = 0x8273
+ INTERNALFORMAT_BLUE_TYPE = 0x827A
+ INTERNALFORMAT_DEPTH_SIZE = 0x8275
+ INTERNALFORMAT_DEPTH_TYPE = 0x827C
+ INTERNALFORMAT_GREEN_SIZE = 0x8272
+ INTERNALFORMAT_GREEN_TYPE = 0x8279
+ INTERNALFORMAT_PREFERRED = 0x8270
+ INTERNALFORMAT_RED_SIZE = 0x8271
+ INTERNALFORMAT_RED_TYPE = 0x8278
+ INTERNALFORMAT_SHARED_SIZE = 0x8277
+ INTERNALFORMAT_STENCIL_SIZE = 0x8276
+ INTERNALFORMAT_STENCIL_TYPE = 0x827D
+ INTERNALFORMAT_SUPPORTED = 0x826F
+ INT_2_10_10_10_REV = 0x8D9F
+ INT_IMAGE_1D = 0x9057
+ INT_IMAGE_1D_ARRAY = 0x905D
+ INT_IMAGE_2D = 0x9058
+ INT_IMAGE_2D_ARRAY = 0x905E
+ INT_IMAGE_2D_MULTISAMPLE = 0x9060
+ INT_IMAGE_2D_MULTISAMPLE_ARRAY = 0x9061
+ INT_IMAGE_2D_RECT = 0x905A
+ INT_IMAGE_3D = 0x9059
+ INT_IMAGE_BUFFER = 0x905C
+ INT_IMAGE_CUBE = 0x905B
+ INT_IMAGE_CUBE_MAP_ARRAY = 0x905F
+ INT_SAMPLER_1D = 0x8DC9
+ INT_SAMPLER_1D_ARRAY = 0x8DCE
+ INT_SAMPLER_2D = 0x8DCA
+ INT_SAMPLER_2D_ARRAY = 0x8DCF
+ INT_SAMPLER_2D_MULTISAMPLE = 0x9109
+ INT_SAMPLER_2D_MULTISAMPLE_ARRAY = 0x910C
+ INT_SAMPLER_2D_RECT = 0x8DCD
+ INT_SAMPLER_3D = 0x8DCB
+ INT_SAMPLER_BUFFER = 0x8DD0
+ INT_SAMPLER_CUBE = 0x8DCC
+ INT_SAMPLER_CUBE_MAP_ARRAY_ARB = 0x900E
+ INT_VEC2 = 0x8B53
+ INT_VEC3 = 0x8B54
+ INT_VEC4 = 0x8B55
+ INVALID_ENUM = 0x0500
+ INVALID_FRAMEBUFFER_OPERATION = 0x0506
+ INVALID_INDEX = 0xFFFFFFFF
+ INVALID_OPERATION = 0x0502
+ INVALID_VALUE = 0x0501
+ INVERT = 0x150A
+ INVERT_OVG_NV = 0x92B4
+ INVERT_RGB_NV = 0x92A3
+ ISOLINES = 0x8E7A
+ IS_PER_PATCH = 0x92E7
+ IS_ROW_MAJOR = 0x9300
+ ITALIC_BIT_NV = 0x02
+ KEEP = 0x1E00
+ LARGE_CCW_ARC_TO_NV = 0x16
+ LARGE_CW_ARC_TO_NV = 0x18
+ LAST_VERTEX_CONVENTION = 0x8E4E
+ LAYER_PROVOKING_VERTEX = 0x825E
+ LEFT = 0x0406
+ LEQUAL = 0x0203
+ LESS = 0x0201
+ LIGHTEN_KHR = 0x9298
+ LIGHTEN_NV = 0x9298
+ LINE = 0x1B01
+ LINEAR = 0x2601
+ LINEARBURN_NV = 0x92A5
+ LINEARDODGE_NV = 0x92A4
+ LINEARLIGHT_NV = 0x92A7
+ LINEAR_MIPMAP_LINEAR = 0x2703
+ LINEAR_MIPMAP_NEAREST = 0x2701
+ LINES = 0x0001
+ LINES_ADJACENCY = 0x000A
+ LINES_ADJACENCY_ARB = 0x000A
+ LINE_LOOP = 0x0002
+ LINE_SMOOTH = 0x0B20
+ LINE_SMOOTH_HINT = 0x0C52
+ LINE_STRIP = 0x0003
+ LINE_STRIP_ADJACENCY = 0x000B
+ LINE_STRIP_ADJACENCY_ARB = 0x000B
+ LINE_TO_NV = 0x04
+ LINE_WIDTH = 0x0B21
+ LINE_WIDTH_COMMAND_NV = 0x000D
+ LINE_WIDTH_GRANULARITY = 0x0B23
+ LINE_WIDTH_RANGE = 0x0B22
+ LINK_STATUS = 0x8B82
+ LOCATION = 0x930E
+ LOCATION_COMPONENT = 0x934A
+ LOCATION_INDEX = 0x930F
+ LOGIC_OP_MODE = 0x0BF0
+ LOSE_CONTEXT_ON_RESET = 0x8252
+ LOSE_CONTEXT_ON_RESET_ARB = 0x8252
+ LOSE_CONTEXT_ON_RESET_KHR = 0x8252
+ LOWER_LEFT = 0x8CA1
+ LOW_FLOAT = 0x8DF0
+ LOW_INT = 0x8DF3
+ MAJOR_VERSION = 0x821B
+ MANUAL_GENERATE_MIPMAP = 0x8294
+ MAP_COHERENT_BIT = 0x0080
+ MAP_FLUSH_EXPLICIT_BIT = 0x0010
+ MAP_INVALIDATE_BUFFER_BIT = 0x0008
+ MAP_INVALIDATE_RANGE_BIT = 0x0004
+ MAP_PERSISTENT_BIT = 0x0040
+ MAP_READ_BIT = 0x0001
+ MAP_UNSYNCHRONIZED_BIT = 0x0020
+ MAP_WRITE_BIT = 0x0002
+ MATRIX_STRIDE = 0x92FF
+ MAX = 0x8008
+ MAX_3D_TEXTURE_SIZE = 0x8073
+ MAX_ARRAY_TEXTURE_LAYERS = 0x88FF
+ MAX_ATOMIC_COUNTER_BUFFER_BINDINGS = 0x92DC
+ MAX_ATOMIC_COUNTER_BUFFER_SIZE = 0x92D8
+ MAX_CLIP_DISTANCES = 0x0D32
+ MAX_COARSE_FRAGMENT_SAMPLES_NV = 0x955F
+ MAX_COLOR_ATTACHMENTS = 0x8CDF
+ MAX_COLOR_FRAMEBUFFER_SAMPLES_AMD = 0x91B3
+ MAX_COLOR_FRAMEBUFFER_STORAGE_SAMPLES_AMD = 0x91B4
+ MAX_COLOR_TEXTURE_SAMPLES = 0x910E
+ MAX_COMBINED_ATOMIC_COUNTERS = 0x92D7
+ MAX_COMBINED_ATOMIC_COUNTER_BUFFERS = 0x92D1
+ MAX_COMBINED_CLIP_AND_CULL_DISTANCES = 0x82FA
+ MAX_COMBINED_COMPUTE_UNIFORM_COMPONENTS = 0x8266
+ MAX_COMBINED_DIMENSIONS = 0x8282
+ MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS = 0x8A33
+ MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS = 0x8A32
+ MAX_COMBINED_IMAGE_UNIFORMS = 0x90CF
+ MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS = 0x8F39
+ MAX_COMBINED_MESH_UNIFORM_COMPONENTS_NV = 0x8E67
+ MAX_COMBINED_SHADER_OUTPUT_RESOURCES = 0x8F39
+ MAX_COMBINED_SHADER_STORAGE_BLOCKS = 0x90DC
+ MAX_COMBINED_TASK_UNIFORM_COMPONENTS_NV = 0x8E6F
+ MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS = 0x8E1E
+ MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS = 0x8E1F
+ MAX_COMBINED_TEXTURE_IMAGE_UNITS = 0x8B4D
+ MAX_COMBINED_UNIFORM_BLOCKS = 0x8A2E
+ MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS = 0x8A31
+ MAX_COMPUTE_ATOMIC_COUNTERS = 0x8265
+ MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS = 0x8264
+ MAX_COMPUTE_FIXED_GROUP_INVOCATIONS_ARB = 0x90EB
+ MAX_COMPUTE_FIXED_GROUP_SIZE_ARB = 0x91BF
+ MAX_COMPUTE_IMAGE_UNIFORMS = 0x91BD
+ MAX_COMPUTE_SHADER_STORAGE_BLOCKS = 0x90DB
+ MAX_COMPUTE_SHARED_MEMORY_SIZE = 0x8262
+ MAX_COMPUTE_TEXTURE_IMAGE_UNITS = 0x91BC
+ MAX_COMPUTE_UNIFORM_BLOCKS = 0x91BB
+ MAX_COMPUTE_UNIFORM_COMPONENTS = 0x8263
+ MAX_COMPUTE_VARIABLE_GROUP_INVOCATIONS_ARB = 0x9344
+ MAX_COMPUTE_VARIABLE_GROUP_SIZE_ARB = 0x9345
+ MAX_COMPUTE_WORK_GROUP_COUNT = 0x91BE
+ MAX_COMPUTE_WORK_GROUP_INVOCATIONS = 0x90EB
+ MAX_COMPUTE_WORK_GROUP_SIZE = 0x91BF
+ MAX_CUBE_MAP_TEXTURE_SIZE = 0x851C
+ MAX_CULL_DISTANCES = 0x82F9
+ MAX_DEBUG_GROUP_STACK_DEPTH = 0x826C
+ MAX_DEBUG_GROUP_STACK_DEPTH_KHR = 0x826C
+ MAX_DEBUG_LOGGED_MESSAGES = 0x9144
+ MAX_DEBUG_LOGGED_MESSAGES_ARB = 0x9144
+ MAX_DEBUG_LOGGED_MESSAGES_KHR = 0x9144
+ MAX_DEBUG_MESSAGE_LENGTH = 0x9143
+ MAX_DEBUG_MESSAGE_LENGTH_ARB = 0x9143
+ MAX_DEBUG_MESSAGE_LENGTH_KHR = 0x9143
+ MAX_DEPTH = 0x8280
+ MAX_DEPTH_STENCIL_FRAMEBUFFER_SAMPLES_AMD = 0x91B5
+ MAX_DEPTH_TEXTURE_SAMPLES = 0x910F
+ MAX_DETACHED_BUFFERS_NV = 0x95AD
+ MAX_DETACHED_TEXTURES_NV = 0x95AC
+ MAX_DRAW_BUFFERS = 0x8824
+ MAX_DRAW_MESH_TASKS_COUNT_NV = 0x953D
+ MAX_DUAL_SOURCE_DRAW_BUFFERS = 0x88FC
+ MAX_ELEMENTS_INDICES = 0x80E9
+ MAX_ELEMENTS_VERTICES = 0x80E8
+ MAX_ELEMENT_INDEX = 0x8D6B
+ MAX_FRAGMENT_ATOMIC_COUNTERS = 0x92D6
+ MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS = 0x92D0
+ MAX_FRAGMENT_IMAGE_UNIFORMS = 0x90CE
+ MAX_FRAGMENT_INPUT_COMPONENTS = 0x9125
+ MAX_FRAGMENT_INTERPOLATION_OFFSET = 0x8E5C
+ MAX_FRAGMENT_SHADER_STORAGE_BLOCKS = 0x90DA
+ MAX_FRAGMENT_UNIFORM_BLOCKS = 0x8A2D
+ MAX_FRAGMENT_UNIFORM_COMPONENTS = 0x8B49
+ MAX_FRAGMENT_UNIFORM_VECTORS = 0x8DFD
+ MAX_FRAMEBUFFER_HEIGHT = 0x9316
+ MAX_FRAMEBUFFER_LAYERS = 0x9317
+ MAX_FRAMEBUFFER_SAMPLES = 0x9318
+ MAX_FRAMEBUFFER_WIDTH = 0x9315
+ MAX_GEOMETRY_ATOMIC_COUNTERS = 0x92D5
+ MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS = 0x92CF
+ MAX_GEOMETRY_IMAGE_UNIFORMS = 0x90CD
+ MAX_GEOMETRY_INPUT_COMPONENTS = 0x9123
+ MAX_GEOMETRY_OUTPUT_COMPONENTS = 0x9124
+ MAX_GEOMETRY_OUTPUT_VERTICES = 0x8DE0
+ MAX_GEOMETRY_OUTPUT_VERTICES_ARB = 0x8DE0
+ MAX_GEOMETRY_SHADER_INVOCATIONS = 0x8E5A
+ MAX_GEOMETRY_SHADER_STORAGE_BLOCKS = 0x90D7
+ MAX_GEOMETRY_TEXTURE_IMAGE_UNITS = 0x8C29
+ MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB = 0x8C29
+ MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS = 0x8DE1
+ MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB = 0x8DE1
+ MAX_GEOMETRY_UNIFORM_BLOCKS = 0x8A2C
+ MAX_GEOMETRY_UNIFORM_COMPONENTS = 0x8DDF
+ MAX_GEOMETRY_UNIFORM_COMPONENTS_ARB = 0x8DDF
+ MAX_GEOMETRY_VARYING_COMPONENTS_ARB = 0x8DDD
+ MAX_HEIGHT = 0x827F
+ MAX_IMAGE_SAMPLES = 0x906D
+ MAX_IMAGE_UNITS = 0x8F38
+ MAX_INTEGER_SAMPLES = 0x9110
+ MAX_LABEL_LENGTH = 0x82E8
+ MAX_LABEL_LENGTH_KHR = 0x82E8
+ MAX_LAYERS = 0x8281
+ MAX_MESH_ATOMIC_COUNTERS_NV = 0x8E65
+ MAX_MESH_ATOMIC_COUNTER_BUFFERS_NV = 0x8E64
+ MAX_MESH_IMAGE_UNIFORMS_NV = 0x8E62
+ MAX_MESH_OUTPUT_PRIMITIVES_NV = 0x9539
+ MAX_MESH_OUTPUT_VERTICES_NV = 0x9538
+ MAX_MESH_SHADER_STORAGE_BLOCKS_NV = 0x8E66
+ MAX_MESH_TEXTURE_IMAGE_UNITS_NV = 0x8E61
+ MAX_MESH_TOTAL_MEMORY_SIZE_NV = 0x9536
+ MAX_MESH_UNIFORM_BLOCKS_NV = 0x8E60
+ MAX_MESH_UNIFORM_COMPONENTS_NV = 0x8E63
+ MAX_MESH_VIEWS_NV = 0x9557
+ MAX_MESH_WORK_GROUP_INVOCATIONS_NV = 0x95A2
+ MAX_MESH_WORK_GROUP_SIZE_NV = 0x953B
+ MAX_MULTISAMPLE_COVERAGE_MODES_NV = 0x8E11
+ MAX_NAME_LENGTH = 0x92F6
+ MAX_NUM_ACTIVE_VARIABLES = 0x92F7
+ MAX_NUM_COMPATIBLE_SUBROUTINES = 0x92F8
+ MAX_PATCH_VERTICES = 0x8E7D
+ MAX_PROGRAM_TEXEL_OFFSET = 0x8905
+ MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS_ARB = 0x8F9F
+ MAX_PROGRAM_TEXTURE_GATHER_OFFSET_ARB = 0x8E5F
+ MAX_RASTER_SAMPLES_EXT = 0x9329
+ MAX_RECTANGLE_TEXTURE_SIZE = 0x84F8
+ MAX_RENDERBUFFER_SIZE = 0x84E8
+ MAX_SAMPLES = 0x8D57
+ MAX_SAMPLE_MASK_WORDS = 0x8E59
+ MAX_SERVER_WAIT_TIMEOUT = 0x9111
+ MAX_SHADER_BUFFER_ADDRESS_NV = 0x8F35
+ MAX_SHADER_COMPILER_THREADS_ARB = 0x91B0
+ MAX_SHADER_COMPILER_THREADS_KHR = 0x91B0
+ MAX_SHADER_STORAGE_BLOCK_SIZE = 0x90DE
+ MAX_SHADER_STORAGE_BUFFER_BINDINGS = 0x90DD
+ MAX_SPARSE_3D_TEXTURE_SIZE_ARB = 0x9199
+ MAX_SPARSE_ARRAY_TEXTURE_LAYERS_ARB = 0x919A
+ MAX_SPARSE_TEXTURE_SIZE_ARB = 0x9198
+ MAX_SUBPIXEL_PRECISION_BIAS_BITS_NV = 0x9349
+ MAX_SUBROUTINES = 0x8DE7
+ MAX_SUBROUTINE_UNIFORM_LOCATIONS = 0x8DE8
+ MAX_TASK_ATOMIC_COUNTERS_NV = 0x8E6D
+ MAX_TASK_ATOMIC_COUNTER_BUFFERS_NV = 0x8E6C
+ MAX_TASK_IMAGE_UNIFORMS_NV = 0x8E6A
+ MAX_TASK_OUTPUT_COUNT_NV = 0x953A
+ MAX_TASK_SHADER_STORAGE_BLOCKS_NV = 0x8E6E
+ MAX_TASK_TEXTURE_IMAGE_UNITS_NV = 0x8E69
+ MAX_TASK_TOTAL_MEMORY_SIZE_NV = 0x9537
+ MAX_TASK_UNIFORM_BLOCKS_NV = 0x8E68
+ MAX_TASK_UNIFORM_COMPONENTS_NV = 0x8E6B
+ MAX_TASK_WORK_GROUP_INVOCATIONS_NV = 0x95A3
+ MAX_TASK_WORK_GROUP_SIZE_NV = 0x953C
+ MAX_TESS_CONTROL_ATOMIC_COUNTERS = 0x92D3
+ MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS = 0x92CD
+ MAX_TESS_CONTROL_IMAGE_UNIFORMS = 0x90CB
+ MAX_TESS_CONTROL_INPUT_COMPONENTS = 0x886C
+ MAX_TESS_CONTROL_OUTPUT_COMPONENTS = 0x8E83
+ MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS = 0x90D8
+ MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS = 0x8E81
+ MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS = 0x8E85
+ MAX_TESS_CONTROL_UNIFORM_BLOCKS = 0x8E89
+ MAX_TESS_CONTROL_UNIFORM_COMPONENTS = 0x8E7F
+ MAX_TESS_EVALUATION_ATOMIC_COUNTERS = 0x92D4
+ MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS = 0x92CE
+ MAX_TESS_EVALUATION_IMAGE_UNIFORMS = 0x90CC
+ MAX_TESS_EVALUATION_INPUT_COMPONENTS = 0x886D
+ MAX_TESS_EVALUATION_OUTPUT_COMPONENTS = 0x8E86
+ MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS = 0x90D9
+ MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS = 0x8E82
+ MAX_TESS_EVALUATION_UNIFORM_BLOCKS = 0x8E8A
+ MAX_TESS_EVALUATION_UNIFORM_COMPONENTS = 0x8E80
+ MAX_TESS_GEN_LEVEL = 0x8E7E
+ MAX_TESS_PATCH_COMPONENTS = 0x8E84
+ MAX_TEXTURE_BUFFER_SIZE = 0x8C2B
+ MAX_TEXTURE_BUFFER_SIZE_ARB = 0x8C2B
+ MAX_TEXTURE_IMAGE_UNITS = 0x8872
+ MAX_TEXTURE_LOD_BIAS = 0x84FD
+ MAX_TEXTURE_MAX_ANISOTROPY = 0x84FF
+ MAX_TEXTURE_SIZE = 0x0D33
+ MAX_TRANSFORM_FEEDBACK_BUFFERS = 0x8E70
+ MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS = 0x8C8A
+ MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS = 0x8C8B
+ MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS = 0x8C80
+ MAX_UNIFORM_BLOCK_SIZE = 0x8A30
+ MAX_UNIFORM_BUFFER_BINDINGS = 0x8A2F
+ MAX_UNIFORM_LOCATIONS = 0x826E
+ MAX_VARYING_COMPONENTS = 0x8B4B
+ MAX_VARYING_FLOATS = 0x8B4B
+ MAX_VARYING_VECTORS = 0x8DFC
+ MAX_VERTEX_ATOMIC_COUNTERS = 0x92D2
+ MAX_VERTEX_ATOMIC_COUNTER_BUFFERS = 0x92CC
+ MAX_VERTEX_ATTRIBS = 0x8869
+ MAX_VERTEX_ATTRIB_BINDINGS = 0x82DA
+ MAX_VERTEX_ATTRIB_RELATIVE_OFFSET = 0x82D9
+ MAX_VERTEX_IMAGE_UNIFORMS = 0x90CA
+ MAX_VERTEX_OUTPUT_COMPONENTS = 0x9122
+ MAX_VERTEX_SHADER_STORAGE_BLOCKS = 0x90D6
+ MAX_VERTEX_STREAMS = 0x8E71
+ MAX_VERTEX_TEXTURE_IMAGE_UNITS = 0x8B4C
+ MAX_VERTEX_UNIFORM_BLOCKS = 0x8A2B
+ MAX_VERTEX_UNIFORM_COMPONENTS = 0x8B4A
+ MAX_VERTEX_UNIFORM_VECTORS = 0x8DFB
+ MAX_VERTEX_VARYING_COMPONENTS_ARB = 0x8DDE
+ MAX_VIEWPORTS = 0x825B
+ MAX_VIEWPORT_DIMS = 0x0D3A
+ MAX_VIEWS_OVR = 0x9631
+ MAX_WIDTH = 0x827E
+ MAX_WINDOW_RECTANGLES_EXT = 0x8F14
+ MEDIUM_FLOAT = 0x8DF1
+ MEDIUM_INT = 0x8DF4
+ MEMORY_ATTACHABLE_ALIGNMENT_NV = 0x95A6
+ MEMORY_ATTACHABLE_NV = 0x95A8
+ MEMORY_ATTACHABLE_SIZE_NV = 0x95A7
+ MESH_OUTPUT_PER_PRIMITIVE_GRANULARITY_NV = 0x9543
+ MESH_OUTPUT_PER_VERTEX_GRANULARITY_NV = 0x92DF
+ MESH_OUTPUT_TYPE_NV = 0x957B
+ MESH_PRIMITIVES_OUT_NV = 0x957A
+ MESH_SHADER_BIT_NV = 0x00000040
+ MESH_SHADER_NV = 0x9559
+ MESH_SUBROUTINE_NV = 0x957C
+ MESH_SUBROUTINE_UNIFORM_NV = 0x957E
+ MESH_VERTICES_OUT_NV = 0x9579
+ MESH_WORK_GROUP_SIZE_NV = 0x953E
+ MIN = 0x8007
+ MINOR_VERSION = 0x821C
+ MINUS_CLAMPED_NV = 0x92B3
+ MINUS_NV = 0x929F
+ MIN_FRAGMENT_INTERPOLATION_OFFSET = 0x8E5B
+ MIN_MAP_BUFFER_ALIGNMENT = 0x90BC
+ MIN_PROGRAM_TEXEL_OFFSET = 0x8904
+ MIN_PROGRAM_TEXTURE_GATHER_OFFSET_ARB = 0x8E5E
+ MIN_SAMPLE_SHADING_VALUE_ARB = 0x8C37
+ MIPMAP = 0x8293
+ MIRRORED_REPEAT = 0x8370
+ MIRRORED_REPEAT_ARB = 0x8370
+ MIRROR_CLAMP_TO_EDGE = 0x8743
+ MITER_REVERT_NV = 0x90A7
+ MITER_TRUNCATE_NV = 0x90A8
+ MIXED_DEPTH_SAMPLES_SUPPORTED_NV = 0x932F
+ MIXED_STENCIL_SAMPLES_SUPPORTED_NV = 0x9330
+ MOVE_TO_CONTINUES_NV = 0x90B6
+ MOVE_TO_NV = 0x02
+ MOVE_TO_RESETS_NV = 0x90B5
+ MULTIPLY_KHR = 0x9294
+ MULTIPLY_NV = 0x9294
+ MULTISAMPLE = 0x809D
+ MULTISAMPLES_NV = 0x9371
+ MULTISAMPLE_COVERAGE_MODES_NV = 0x8E12
+ MULTISAMPLE_LINE_WIDTH_GRANULARITY_ARB = 0x9382
+ MULTISAMPLE_LINE_WIDTH_RANGE_ARB = 0x9381
+ MULTISAMPLE_RASTERIZATION_ALLOWED_EXT = 0x932B
+ NAMED_STRING_LENGTH_ARB = 0x8DE9
+ NAMED_STRING_TYPE_ARB = 0x8DEA
+ NAME_LENGTH = 0x92F9
+ NAND = 0x150E
+ NEAREST = 0x2600
+ NEAREST_MIPMAP_LINEAR = 0x2702
+ NEAREST_MIPMAP_NEAREST = 0x2700
+ NEGATIVE_ONE_TO_ONE = 0x935E
+ NEVER = 0x0200
+ NICEST = 0x1102
+ NONE = 0
+ NOOP = 0x1505
+ NOP_COMMAND_NV = 0x0001
+ NOR = 0x1508
+ NORMAL_ARRAY_ADDRESS_NV = 0x8F22
+ NORMAL_ARRAY_LENGTH_NV = 0x8F2C
+ NOTEQUAL = 0x0205
+ NO_ERROR = 0
+ NO_RESET_NOTIFICATION = 0x8261
+ NO_RESET_NOTIFICATION_ARB = 0x8261
+ NO_RESET_NOTIFICATION_KHR = 0x8261
+ NUM_ACTIVE_VARIABLES = 0x9304
+ NUM_COMPATIBLE_SUBROUTINES = 0x8E4A
+ NUM_COMPRESSED_TEXTURE_FORMATS = 0x86A2
+ NUM_EXTENSIONS = 0x821D
+ NUM_PROGRAM_BINARY_FORMATS = 0x87FE
+ NUM_SAMPLE_COUNTS = 0x9380
+ NUM_SHADER_BINARY_FORMATS = 0x8DF9
+ NUM_SPARSE_LEVELS_ARB = 0x91AA
+ NUM_SPIR_V_EXTENSIONS = 0x9554
+ NUM_SUPPORTED_MULTISAMPLE_MODES_AMD = 0x91B6
+ NUM_VIRTUAL_PAGE_SIZES_ARB = 0x91A8
+ NUM_WINDOW_RECTANGLES_EXT = 0x8F15
+ OBJECT_TYPE = 0x9112
+ OFFSET = 0x92FC
+ ONE = 1
+ ONE_MINUS_CONSTANT_ALPHA = 0x8004
+ ONE_MINUS_CONSTANT_COLOR = 0x8002
+ ONE_MINUS_DST_ALPHA = 0x0305
+ ONE_MINUS_DST_COLOR = 0x0307
+ ONE_MINUS_SRC1_ALPHA = 0x88FB
+ ONE_MINUS_SRC1_COLOR = 0x88FA
+ ONE_MINUS_SRC_ALPHA = 0x0303
+ ONE_MINUS_SRC_COLOR = 0x0301
+ OR = 0x1507
+ OR_INVERTED = 0x150D
+ OR_REVERSE = 0x150B
+ OUT_OF_MEMORY = 0x0505
+ OVERLAY_KHR = 0x9296
+ OVERLAY_NV = 0x9296
+ PACK_ALIGNMENT = 0x0D05
+ PACK_COMPRESSED_BLOCK_DEPTH = 0x912D
+ PACK_COMPRESSED_BLOCK_HEIGHT = 0x912C
+ PACK_COMPRESSED_BLOCK_SIZE = 0x912E
+ PACK_COMPRESSED_BLOCK_WIDTH = 0x912B
+ PACK_IMAGE_HEIGHT = 0x806C
+ PACK_LSB_FIRST = 0x0D01
+ PACK_ROW_LENGTH = 0x0D02
+ PACK_SKIP_IMAGES = 0x806B
+ PACK_SKIP_PIXELS = 0x0D04
+ PACK_SKIP_ROWS = 0x0D03
+ PACK_SWAP_BYTES = 0x0D00
+ PARAMETER_BUFFER_ARB = 0x80EE
+ PARAMETER_BUFFER_BINDING_ARB = 0x80EF
+ PATCHES = 0x000E
+ PATCH_DEFAULT_INNER_LEVEL = 0x8E73
+ PATCH_DEFAULT_OUTER_LEVEL = 0x8E74
+ PATCH_VERTICES = 0x8E72
+ PATH_CLIENT_LENGTH_NV = 0x907F
+ PATH_COMMAND_COUNT_NV = 0x909D
+ PATH_COMPUTED_LENGTH_NV = 0x90A0
+ PATH_COORD_COUNT_NV = 0x909E
+ PATH_COVER_DEPTH_FUNC_NV = 0x90BF
+ PATH_DASH_ARRAY_COUNT_NV = 0x909F
+ PATH_DASH_CAPS_NV = 0x907B
+ PATH_DASH_OFFSET_NV = 0x907E
+ PATH_DASH_OFFSET_RESET_NV = 0x90B4
+ PATH_END_CAPS_NV = 0x9076
+ PATH_ERROR_POSITION_NV = 0x90AB
+ PATH_FILL_BOUNDING_BOX_NV = 0x90A1
+ PATH_FILL_COVER_MODE_NV = 0x9082
+ PATH_FILL_MASK_NV = 0x9081
+ PATH_FILL_MODE_NV = 0x9080
+ PATH_FORMAT_PS_NV = 0x9071
+ PATH_FORMAT_SVG_NV = 0x9070
+ PATH_GEN_COEFF_NV = 0x90B1
+ PATH_GEN_COMPONENTS_NV = 0x90B3
+ PATH_GEN_MODE_NV = 0x90B0
+ PATH_INITIAL_DASH_CAP_NV = 0x907C
+ PATH_INITIAL_END_CAP_NV = 0x9077
+ PATH_JOIN_STYLE_NV = 0x9079
+ PATH_MAX_MODELVIEW_STACK_DEPTH_NV = 0x0D36
+ PATH_MAX_PROJECTION_STACK_DEPTH_NV = 0x0D38
+ PATH_MITER_LIMIT_NV = 0x907A
+ PATH_MODELVIEW_MATRIX_NV = 0x0BA6
+ PATH_MODELVIEW_NV = 0x1700
+ PATH_MODELVIEW_STACK_DEPTH_NV = 0x0BA3
+ PATH_OBJECT_BOUNDING_BOX_NV = 0x908A
+ PATH_PROJECTION_MATRIX_NV = 0x0BA7
+ PATH_PROJECTION_NV = 0x1701
+ PATH_PROJECTION_STACK_DEPTH_NV = 0x0BA4
+ PATH_STENCIL_DEPTH_OFFSET_FACTOR_NV = 0x90BD
+ PATH_STENCIL_DEPTH_OFFSET_UNITS_NV = 0x90BE
+ PATH_STENCIL_FUNC_NV = 0x90B7
+ PATH_STENCIL_REF_NV = 0x90B8
+ PATH_STENCIL_VALUE_MASK_NV = 0x90B9
+ PATH_STROKE_BOUNDING_BOX_NV = 0x90A2
+ PATH_STROKE_COVER_MODE_NV = 0x9083
+ PATH_STROKE_MASK_NV = 0x9084
+ PATH_STROKE_WIDTH_NV = 0x9075
+ PATH_TERMINAL_DASH_CAP_NV = 0x907D
+ PATH_TERMINAL_END_CAP_NV = 0x9078
+ PATH_TRANSPOSE_MODELVIEW_MATRIX_NV = 0x84E3
+ PATH_TRANSPOSE_PROJECTION_MATRIX_NV = 0x84E4
+ PERCENTAGE_AMD = 0x8BC3
+ PERFMON_RESULT_AMD = 0x8BC6
+ PERFMON_RESULT_AVAILABLE_AMD = 0x8BC4
+ PERFMON_RESULT_SIZE_AMD = 0x8BC5
+ PERFQUERY_COUNTER_DATA_BOOL32_INTEL = 0x94FC
+ PERFQUERY_COUNTER_DATA_DOUBLE_INTEL = 0x94FB
+ PERFQUERY_COUNTER_DATA_FLOAT_INTEL = 0x94FA
+ PERFQUERY_COUNTER_DATA_UINT32_INTEL = 0x94F8
+ PERFQUERY_COUNTER_DATA_UINT64_INTEL = 0x94F9
+ PERFQUERY_COUNTER_DESC_LENGTH_MAX_INTEL = 0x94FF
+ PERFQUERY_COUNTER_DURATION_NORM_INTEL = 0x94F1
+ PERFQUERY_COUNTER_DURATION_RAW_INTEL = 0x94F2
+ PERFQUERY_COUNTER_EVENT_INTEL = 0x94F0
+ PERFQUERY_COUNTER_NAME_LENGTH_MAX_INTEL = 0x94FE
+ PERFQUERY_COUNTER_RAW_INTEL = 0x94F4
+ PERFQUERY_COUNTER_THROUGHPUT_INTEL = 0x94F3
+ PERFQUERY_COUNTER_TIMESTAMP_INTEL = 0x94F5
+ PERFQUERY_DONOT_FLUSH_INTEL = 0x83F9
+ PERFQUERY_FLUSH_INTEL = 0x83FA
+ PERFQUERY_GLOBAL_CONTEXT_INTEL = 0x00000001
+ PERFQUERY_GPA_EXTENDED_COUNTERS_INTEL = 0x9500
+ PERFQUERY_QUERY_NAME_LENGTH_MAX_INTEL = 0x94FD
+ PERFQUERY_SINGLE_CONTEXT_INTEL = 0x00000000
+ PERFQUERY_WAIT_INTEL = 0x83FB
+ PINLIGHT_NV = 0x92A8
+ PIXEL_BUFFER_BARRIER_BIT = 0x00000080
+ PIXEL_PACK_BUFFER = 0x88EB
+ PIXEL_PACK_BUFFER_ARB = 0x88EB
+ PIXEL_PACK_BUFFER_BINDING = 0x88ED
+ PIXEL_PACK_BUFFER_BINDING_ARB = 0x88ED
+ PIXEL_UNPACK_BUFFER = 0x88EC
+ PIXEL_UNPACK_BUFFER_ARB = 0x88EC
+ PIXEL_UNPACK_BUFFER_BINDING = 0x88EF
+ PIXEL_UNPACK_BUFFER_BINDING_ARB = 0x88EF
+ PLUS_CLAMPED_ALPHA_NV = 0x92B2
+ PLUS_CLAMPED_NV = 0x92B1
+ PLUS_DARKER_NV = 0x9292
+ PLUS_NV = 0x9291
+ POINT = 0x1B00
+ POINTS = 0x0000
+ POINT_FADE_THRESHOLD_SIZE = 0x8128
+ POINT_SIZE = 0x0B11
+ POINT_SIZE_GRANULARITY = 0x0B13
+ POINT_SIZE_RANGE = 0x0B12
+ POINT_SPRITE_COORD_ORIGIN = 0x8CA0
+ POLYGON_MODE = 0x0B40
+ POLYGON_OFFSET_CLAMP = 0x8E1B
+ POLYGON_OFFSET_CLAMP_EXT = 0x8E1B
+ POLYGON_OFFSET_COMMAND_NV = 0x000E
+ POLYGON_OFFSET_FACTOR = 0x8038
+ POLYGON_OFFSET_FILL = 0x8037
+ POLYGON_OFFSET_LINE = 0x2A02
+ POLYGON_OFFSET_POINT = 0x2A01
+ POLYGON_OFFSET_UNITS = 0x2A00
+ POLYGON_SMOOTH = 0x0B41
+ POLYGON_SMOOTH_HINT = 0x0C53
+ PRIMITIVES_GENERATED = 0x8C87
+ PRIMITIVES_SUBMITTED_ARB = 0x82EF
+ PRIMITIVE_BOUNDING_BOX_ARB = 0x92BE
+ PRIMITIVE_RESTART = 0x8F9D
+ PRIMITIVE_RESTART_FIXED_INDEX = 0x8D69
+ PRIMITIVE_RESTART_INDEX = 0x8F9E
+ PROGRAM = 0x82E2
+ PROGRAMMABLE_SAMPLE_LOCATION_ARB = 0x9341
+ PROGRAMMABLE_SAMPLE_LOCATION_NV = 0x9341
+ PROGRAMMABLE_SAMPLE_LOCATION_TABLE_SIZE_ARB = 0x9340
+ PROGRAMMABLE_SAMPLE_LOCATION_TABLE_SIZE_NV = 0x9340
+ PROGRAM_BINARY_FORMATS = 0x87FF
+ PROGRAM_BINARY_LENGTH = 0x8741
+ PROGRAM_BINARY_RETRIEVABLE_HINT = 0x8257
+ PROGRAM_INPUT = 0x92E3
+ PROGRAM_KHR = 0x82E2
+ PROGRAM_MATRIX_EXT = 0x8E2D
+ PROGRAM_MATRIX_STACK_DEPTH_EXT = 0x8E2F
+ PROGRAM_OBJECT_EXT = 0x8B40
+ PROGRAM_OUTPUT = 0x92E4
+ PROGRAM_PIPELINE = 0x82E4
+ PROGRAM_PIPELINE_BINDING = 0x825A
+ PROGRAM_PIPELINE_BINDING_EXT = 0x825A
+ PROGRAM_PIPELINE_KHR = 0x82E4
+ PROGRAM_PIPELINE_OBJECT_EXT = 0x8A4F
+ PROGRAM_POINT_SIZE = 0x8642
+ PROGRAM_POINT_SIZE_ARB = 0x8642
+ PROGRAM_SEPARABLE = 0x8258
+ PROGRAM_SEPARABLE_EXT = 0x8258
+ PROVOKING_VERTEX = 0x8E4F
+ PROXY_TEXTURE_1D = 0x8063
+ PROXY_TEXTURE_1D_ARRAY = 0x8C19
+ PROXY_TEXTURE_2D = 0x8064
+ PROXY_TEXTURE_2D_ARRAY = 0x8C1B
+ PROXY_TEXTURE_2D_MULTISAMPLE = 0x9101
+ PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY = 0x9103
+ PROXY_TEXTURE_3D = 0x8070
+ PROXY_TEXTURE_CUBE_MAP = 0x851B
+ PROXY_TEXTURE_CUBE_MAP_ARRAY_ARB = 0x900B
+ PROXY_TEXTURE_RECTANGLE = 0x84F7
+ QUADRATIC_CURVE_TO_NV = 0x0A
+ QUADS = 0x0007
+ QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION = 0x8E4C
+ QUERY = 0x82E3
+ QUERY_BUFFER = 0x9192
+ QUERY_BUFFER_BARRIER_BIT = 0x00008000
+ QUERY_BUFFER_BINDING = 0x9193
+ QUERY_BY_REGION_NO_WAIT = 0x8E16
+ QUERY_BY_REGION_NO_WAIT_INVERTED = 0x8E1A
+ QUERY_BY_REGION_NO_WAIT_NV = 0x8E16
+ QUERY_BY_REGION_WAIT = 0x8E15
+ QUERY_BY_REGION_WAIT_INVERTED = 0x8E19
+ QUERY_BY_REGION_WAIT_NV = 0x8E15
+ QUERY_COUNTER_BITS = 0x8864
+ QUERY_KHR = 0x82E3
+ QUERY_NO_WAIT = 0x8E14
+ QUERY_NO_WAIT_INVERTED = 0x8E18
+ QUERY_NO_WAIT_NV = 0x8E14
+ QUERY_OBJECT_EXT = 0x9153
+ QUERY_RESULT = 0x8866
+ QUERY_RESULT_AVAILABLE = 0x8867
+ QUERY_RESULT_NO_WAIT = 0x9194
+ QUERY_TARGET = 0x82EA
+ QUERY_WAIT = 0x8E13
+ QUERY_WAIT_INVERTED = 0x8E17
+ QUERY_WAIT_NV = 0x8E13
+ R11F_G11F_B10F = 0x8C3A
+ R16 = 0x822A
+ R16F = 0x822D
+ R16I = 0x8233
+ R16UI = 0x8234
+ R16_SNORM = 0x8F98
+ R32F = 0x822E
+ R32I = 0x8235
+ R32UI = 0x8236
+ R3_G3_B2 = 0x2A10
+ R8 = 0x8229
+ R8I = 0x8231
+ R8UI = 0x8232
+ R8_SNORM = 0x8F94
+ RASTERIZER_DISCARD = 0x8C89
+ RASTER_FIXED_SAMPLE_LOCATIONS_EXT = 0x932A
+ RASTER_MULTISAMPLE_EXT = 0x9327
+ RASTER_SAMPLES_EXT = 0x9328
+ READ_BUFFER = 0x0C02
+ READ_FRAMEBUFFER = 0x8CA8
+ READ_FRAMEBUFFER_BINDING = 0x8CAA
+ READ_ONLY = 0x88B8
+ READ_PIXELS = 0x828C
+ READ_PIXELS_FORMAT = 0x828D
+ READ_PIXELS_TYPE = 0x828E
+ READ_WRITE = 0x88BA
+ RECT_NV = 0xF6
+ RED = 0x1903
+ RED_INTEGER = 0x8D94
+ RED_NV = 0x1903
+ REFERENCED_BY_COMPUTE_SHADER = 0x930B
+ REFERENCED_BY_FRAGMENT_SHADER = 0x930A
+ REFERENCED_BY_GEOMETRY_SHADER = 0x9309
+ REFERENCED_BY_MESH_SHADER_NV = 0x95A0
+ REFERENCED_BY_TASK_SHADER_NV = 0x95A1
+ REFERENCED_BY_TESS_CONTROL_SHADER = 0x9307
+ REFERENCED_BY_TESS_EVALUATION_SHADER = 0x9308
+ REFERENCED_BY_VERTEX_SHADER = 0x9306
+ RELATIVE_ARC_TO_NV = 0xFF
+ RELATIVE_CONIC_CURVE_TO_NV = 0x1B
+ RELATIVE_CUBIC_CURVE_TO_NV = 0x0D
+ RELATIVE_HORIZONTAL_LINE_TO_NV = 0x07
+ RELATIVE_LARGE_CCW_ARC_TO_NV = 0x17
+ RELATIVE_LARGE_CW_ARC_TO_NV = 0x19
+ RELATIVE_LINE_TO_NV = 0x05
+ RELATIVE_MOVE_TO_NV = 0x03
+ RELATIVE_QUADRATIC_CURVE_TO_NV = 0x0B
+ RELATIVE_RECT_NV = 0xF7
+ RELATIVE_ROUNDED_RECT2_NV = 0xEB
+ RELATIVE_ROUNDED_RECT4_NV = 0xED
+ RELATIVE_ROUNDED_RECT8_NV = 0xEF
+ RELATIVE_ROUNDED_RECT_NV = 0xE9
+ RELATIVE_SMALL_CCW_ARC_TO_NV = 0x13
+ RELATIVE_SMALL_CW_ARC_TO_NV = 0x15
+ RELATIVE_SMOOTH_CUBIC_CURVE_TO_NV = 0x11
+ RELATIVE_SMOOTH_QUADRATIC_CURVE_TO_NV = 0x0F
+ RELATIVE_VERTICAL_LINE_TO_NV = 0x09
+ RENDERBUFFER = 0x8D41
+ RENDERBUFFER_ALPHA_SIZE = 0x8D53
+ RENDERBUFFER_BINDING = 0x8CA7
+ RENDERBUFFER_BLUE_SIZE = 0x8D52
+ RENDERBUFFER_COLOR_SAMPLES_NV = 0x8E10
+ RENDERBUFFER_COVERAGE_SAMPLES_NV = 0x8CAB
+ RENDERBUFFER_DEPTH_SIZE = 0x8D54
+ RENDERBUFFER_GREEN_SIZE = 0x8D51
+ RENDERBUFFER_HEIGHT = 0x8D43
+ RENDERBUFFER_INTERNAL_FORMAT = 0x8D44
+ RENDERBUFFER_RED_SIZE = 0x8D50
+ RENDERBUFFER_SAMPLES = 0x8CAB
+ RENDERBUFFER_STENCIL_SIZE = 0x8D55
+ RENDERBUFFER_STORAGE_SAMPLES_AMD = 0x91B2
+ RENDERBUFFER_WIDTH = 0x8D42
+ RENDERER = 0x1F01
+ REPEAT = 0x2901
+ REPLACE = 0x1E01
+ REPRESENTATIVE_FRAGMENT_TEST_NV = 0x937F
+ RESET_NOTIFICATION_STRATEGY = 0x8256
+ RESET_NOTIFICATION_STRATEGY_ARB = 0x8256
+ RESET_NOTIFICATION_STRATEGY_KHR = 0x8256
+ RESTART_PATH_NV = 0xF0
+ RG = 0x8227
+ RG16 = 0x822C
+ RG16F = 0x822F
+ RG16I = 0x8239
+ RG16UI = 0x823A
+ RG16_SNORM = 0x8F99
+ RG32F = 0x8230
+ RG32I = 0x823B
+ RG32UI = 0x823C
+ RG8 = 0x822B
+ RG8I = 0x8237
+ RG8UI = 0x8238
+ RG8_SNORM = 0x8F95
+ RGB = 0x1907
+ RGB10 = 0x8052
+ RGB10_A2 = 0x8059
+ RGB10_A2UI = 0x906F
+ RGB12 = 0x8053
+ RGB16 = 0x8054
+ RGB16F = 0x881B
+ RGB16I = 0x8D89
+ RGB16UI = 0x8D77
+ RGB16_SNORM = 0x8F9A
+ RGB32F = 0x8815
+ RGB32I = 0x8D83
+ RGB32UI = 0x8D71
+ RGB4 = 0x804F
+ RGB5 = 0x8050
+ RGB565 = 0x8D62
+ RGB5_A1 = 0x8057
+ RGB8 = 0x8051
+ RGB8I = 0x8D8F
+ RGB8UI = 0x8D7D
+ RGB8_SNORM = 0x8F96
+ RGB9_E5 = 0x8C3D
+ RGBA = 0x1908
+ RGBA12 = 0x805A
+ RGBA16 = 0x805B
+ RGBA16F = 0x881A
+ RGBA16I = 0x8D88
+ RGBA16UI = 0x8D76
+ RGBA16_SNORM = 0x8F9B
+ RGBA2 = 0x8055
+ RGBA32F = 0x8814
+ RGBA32I = 0x8D82
+ RGBA32UI = 0x8D70
+ RGBA4 = 0x8056
+ RGBA8 = 0x8058
+ RGBA8I = 0x8D8E
+ RGBA8UI = 0x8D7C
+ RGBA8_SNORM = 0x8F97
+ RGBA_INTEGER = 0x8D99
+ RGB_422_APPLE = 0x8A1F
+ RGB_INTEGER = 0x8D98
+ RGB_RAW_422_APPLE = 0x8A51
+ RG_INTEGER = 0x8228
+ RIGHT = 0x0407
+ ROUNDED_RECT2_NV = 0xEA
+ ROUNDED_RECT4_NV = 0xEC
+ ROUNDED_RECT8_NV = 0xEE
+ ROUNDED_RECT_NV = 0xE8
+ ROUND_NV = 0x90A4
+ SAMPLER = 0x82E6
+ SAMPLER_1D = 0x8B5D
+ SAMPLER_1D_ARRAY = 0x8DC0
+ SAMPLER_1D_ARRAY_SHADOW = 0x8DC3
+ SAMPLER_1D_SHADOW = 0x8B61
+ SAMPLER_2D = 0x8B5E
+ SAMPLER_2D_ARRAY = 0x8DC1
+ SAMPLER_2D_ARRAY_SHADOW = 0x8DC4
+ SAMPLER_2D_MULTISAMPLE = 0x9108
+ SAMPLER_2D_MULTISAMPLE_ARRAY = 0x910B
+ SAMPLER_2D_RECT = 0x8B63
+ SAMPLER_2D_RECT_SHADOW = 0x8B64
+ SAMPLER_2D_SHADOW = 0x8B62
+ SAMPLER_3D = 0x8B5F
+ SAMPLER_BINDING = 0x8919
+ SAMPLER_BUFFER = 0x8DC2
+ SAMPLER_CUBE = 0x8B60
+ SAMPLER_CUBE_MAP_ARRAY_ARB = 0x900C
+ SAMPLER_CUBE_MAP_ARRAY_SHADOW_ARB = 0x900D
+ SAMPLER_CUBE_SHADOW = 0x8DC5
+ SAMPLER_KHR = 0x82E6
+ SAMPLES = 0x80A9
+ SAMPLES_PASSED = 0x8914
+ SAMPLE_ALPHA_TO_COVERAGE = 0x809E
+ SAMPLE_ALPHA_TO_ONE = 0x809F
+ SAMPLE_BUFFERS = 0x80A8
+ SAMPLE_COVERAGE = 0x80A0
+ SAMPLE_COVERAGE_INVERT = 0x80AB
+ SAMPLE_COVERAGE_VALUE = 0x80AA
+ SAMPLE_LOCATION_ARB = 0x8E50
+ SAMPLE_LOCATION_NV = 0x8E50
+ SAMPLE_LOCATION_PIXEL_GRID_HEIGHT_ARB = 0x933F
+ SAMPLE_LOCATION_PIXEL_GRID_HEIGHT_NV = 0x933F
+ SAMPLE_LOCATION_PIXEL_GRID_WIDTH_ARB = 0x933E
+ SAMPLE_LOCATION_PIXEL_GRID_WIDTH_NV = 0x933E
+ SAMPLE_LOCATION_SUBPIXEL_BITS_ARB = 0x933D
+ SAMPLE_LOCATION_SUBPIXEL_BITS_NV = 0x933D
+ SAMPLE_MASK = 0x8E51
+ SAMPLE_MASK_VALUE = 0x8E52
+ SAMPLE_POSITION = 0x8E50
+ SAMPLE_SHADING_ARB = 0x8C36
+ SCISSOR_BOX = 0x0C10
+ SCISSOR_BOX_EXCLUSIVE_NV = 0x9556
+ SCISSOR_COMMAND_NV = 0x0011
+ SCISSOR_TEST = 0x0C11
+ SCISSOR_TEST_EXCLUSIVE_NV = 0x9555
+ SCREEN_KHR = 0x9295
+ SCREEN_NV = 0x9295
+ SECONDARY_COLOR_ARRAY_ADDRESS_NV = 0x8F27
+ SECONDARY_COLOR_ARRAY_LENGTH_NV = 0x8F31
+ SEPARATE_ATTRIBS = 0x8C8D
+ SET = 0x150F
+ SHADER = 0x82E1
+ SHADER_BINARY_FORMATS = 0x8DF8
+ SHADER_BINARY_FORMAT_SPIR_V_ARB = 0x9551
+ SHADER_COMPILER = 0x8DFA
+ SHADER_GLOBAL_ACCESS_BARRIER_BIT_NV = 0x00000010
+ SHADER_IMAGE_ACCESS_BARRIER_BIT = 0x00000020
+ SHADER_IMAGE_ATOMIC = 0x82A6
+ SHADER_IMAGE_LOAD = 0x82A4
+ SHADER_IMAGE_STORE = 0x82A5
+ SHADER_INCLUDE_ARB = 0x8DAE
+ SHADER_KHR = 0x82E1
+ SHADER_OBJECT_EXT = 0x8B48
+ SHADER_SOURCE_LENGTH = 0x8B88
+ SHADER_STORAGE_BARRIER_BIT = 0x00002000
+ SHADER_STORAGE_BLOCK = 0x92E6
+ SHADER_STORAGE_BUFFER = 0x90D2
+ SHADER_STORAGE_BUFFER_BINDING = 0x90D3
+ SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT = 0x90DF
+ SHADER_STORAGE_BUFFER_SIZE = 0x90D5
+ SHADER_STORAGE_BUFFER_START = 0x90D4
+ SHADER_TYPE = 0x8B4F
+ SHADING_LANGUAGE_VERSION = 0x8B8C
+ SHADING_RATE_16_INVOCATIONS_PER_PIXEL_NV = 0x956F
+ SHADING_RATE_1_INVOCATION_PER_1X2_PIXELS_NV = 0x9566
+ SHADING_RATE_1_INVOCATION_PER_2X1_PIXELS_NV = 0x9567
+ SHADING_RATE_1_INVOCATION_PER_2X2_PIXELS_NV = 0x9568
+ SHADING_RATE_1_INVOCATION_PER_2X4_PIXELS_NV = 0x9569
+ SHADING_RATE_1_INVOCATION_PER_4X2_PIXELS_NV = 0x956A
+ SHADING_RATE_1_INVOCATION_PER_4X4_PIXELS_NV = 0x956B
+ SHADING_RATE_1_INVOCATION_PER_PIXEL_NV = 0x9565
+ SHADING_RATE_2_INVOCATIONS_PER_PIXEL_NV = 0x956C
+ SHADING_RATE_4_INVOCATIONS_PER_PIXEL_NV = 0x956D
+ SHADING_RATE_8_INVOCATIONS_PER_PIXEL_NV = 0x956E
+ SHADING_RATE_IMAGE_BINDING_NV = 0x955B
+ SHADING_RATE_IMAGE_NV = 0x9563
+ SHADING_RATE_IMAGE_PALETTE_COUNT_NV = 0x95B2
+ SHADING_RATE_IMAGE_PALETTE_SIZE_NV = 0x955E
+ SHADING_RATE_IMAGE_PER_PRIMITIVE_NV = 0x95B1
+ SHADING_RATE_IMAGE_TEXEL_HEIGHT_NV = 0x955D
+ SHADING_RATE_IMAGE_TEXEL_WIDTH_NV = 0x955C
+ SHADING_RATE_NO_INVOCATIONS_NV = 0x9564
+ SHADING_RATE_SAMPLE_ORDER_DEFAULT_NV = 0x95AE
+ SHADING_RATE_SAMPLE_ORDER_PIXEL_MAJOR_NV = 0x95AF
+ SHADING_RATE_SAMPLE_ORDER_SAMPLE_MAJOR_NV = 0x95B0
+ SHARED_EDGE_NV = 0xC0
+ SHORT = 0x1402
+ SIGNALED = 0x9119
+ SIGNED_NORMALIZED = 0x8F9C
+ SIMULTANEOUS_TEXTURE_AND_DEPTH_TEST = 0x82AC
+ SIMULTANEOUS_TEXTURE_AND_DEPTH_WRITE = 0x82AE
+ SIMULTANEOUS_TEXTURE_AND_STENCIL_TEST = 0x82AD
+ SIMULTANEOUS_TEXTURE_AND_STENCIL_WRITE = 0x82AF
+ SKIP_DECODE_EXT = 0x8A4A
+ SKIP_MISSING_GLYPH_NV = 0x90A9
+ SMALL_CCW_ARC_TO_NV = 0x12
+ SMALL_CW_ARC_TO_NV = 0x14
+ SMOOTH_CUBIC_CURVE_TO_NV = 0x10
+ SMOOTH_LINE_WIDTH_GRANULARITY = 0x0B23
+ SMOOTH_LINE_WIDTH_RANGE = 0x0B22
+ SMOOTH_POINT_SIZE_GRANULARITY = 0x0B13
+ SMOOTH_POINT_SIZE_RANGE = 0x0B12
+ SMOOTH_QUADRATIC_CURVE_TO_NV = 0x0E
+ SM_COUNT_NV = 0x933B
+ SOFTLIGHT_KHR = 0x929C
+ SOFTLIGHT_NV = 0x929C
+ SPARSE_BUFFER_PAGE_SIZE_ARB = 0x82F8
+ SPARSE_STORAGE_BIT_ARB = 0x0400
+ SPARSE_TEXTURE_FULL_ARRAY_CUBE_MIPMAPS_ARB = 0x91A9
+ SPIR_V_BINARY_ARB = 0x9552
+ SPIR_V_EXTENSIONS = 0x9553
+ SQUARE_NV = 0x90A3
+ SR8_EXT = 0x8FBD
+ SRC1_ALPHA = 0x8589
+ SRC1_COLOR = 0x88F9
+ SRC_ALPHA = 0x0302
+ SRC_ALPHA_SATURATE = 0x0308
+ SRC_ATOP_NV = 0x928E
+ SRC_COLOR = 0x0300
+ SRC_IN_NV = 0x928A
+ SRC_NV = 0x9286
+ SRC_OUT_NV = 0x928C
+ SRC_OVER_NV = 0x9288
+ SRG8_EXT = 0x8FBE
+ SRGB = 0x8C40
+ SRGB8 = 0x8C41
+ SRGB8_ALPHA8 = 0x8C43
+ SRGB_ALPHA = 0x8C42
+ SRGB_DECODE_ARB = 0x8299
+ SRGB_READ = 0x8297
+ SRGB_WRITE = 0x8298
+ STACK_OVERFLOW = 0x0503
+ STACK_OVERFLOW_KHR = 0x0503
+ STACK_UNDERFLOW = 0x0504
+ STACK_UNDERFLOW_KHR = 0x0504
+ STANDARD_FONT_FORMAT_NV = 0x936C
+ STANDARD_FONT_NAME_NV = 0x9072
+ STATIC_COPY = 0x88E6
+ STATIC_DRAW = 0x88E4
+ STATIC_READ = 0x88E5
+ STENCIL = 0x1802
+ STENCIL_ATTACHMENT = 0x8D20
+ STENCIL_BACK_FAIL = 0x8801
+ STENCIL_BACK_FUNC = 0x8800
+ STENCIL_BACK_PASS_DEPTH_FAIL = 0x8802
+ STENCIL_BACK_PASS_DEPTH_PASS = 0x8803
+ STENCIL_BACK_REF = 0x8CA3
+ STENCIL_BACK_VALUE_MASK = 0x8CA4
+ STENCIL_BACK_WRITEMASK = 0x8CA5
+ STENCIL_BUFFER_BIT = 0x00000400
+ STENCIL_CLEAR_VALUE = 0x0B91
+ STENCIL_COMPONENTS = 0x8285
+ STENCIL_FAIL = 0x0B94
+ STENCIL_FUNC = 0x0B92
+ STENCIL_INDEX = 0x1901
+ STENCIL_INDEX1 = 0x8D46
+ STENCIL_INDEX16 = 0x8D49
+ STENCIL_INDEX4 = 0x8D47
+ STENCIL_INDEX8 = 0x8D48
+ STENCIL_PASS_DEPTH_FAIL = 0x0B95
+ STENCIL_PASS_DEPTH_PASS = 0x0B96
+ STENCIL_REF = 0x0B97
+ STENCIL_REF_COMMAND_NV = 0x000C
+ STENCIL_RENDERABLE = 0x8288
+ STENCIL_SAMPLES_NV = 0x932E
+ STENCIL_TEST = 0x0B90
+ STENCIL_VALUE_MASK = 0x0B93
+ STENCIL_WRITEMASK = 0x0B98
+ STEREO = 0x0C33
+ STREAM_COPY = 0x88E2
+ STREAM_DRAW = 0x88E0
+ STREAM_READ = 0x88E1
+ SUBGROUP_FEATURE_ARITHMETIC_BIT_KHR = 0x00000004
+ SUBGROUP_FEATURE_BALLOT_BIT_KHR = 0x00000008
+ SUBGROUP_FEATURE_BASIC_BIT_KHR = 0x00000001
+ SUBGROUP_FEATURE_CLUSTERED_BIT_KHR = 0x00000040
+ SUBGROUP_FEATURE_PARTITIONED_BIT_NV = 0x00000100
+ SUBGROUP_FEATURE_QUAD_BIT_KHR = 0x00000080
+ SUBGROUP_FEATURE_SHUFFLE_BIT_KHR = 0x00000010
+ SUBGROUP_FEATURE_SHUFFLE_RELATIVE_BIT_KHR = 0x00000020
+ SUBGROUP_FEATURE_VOTE_BIT_KHR = 0x00000002
+ SUBGROUP_QUAD_ALL_STAGES_KHR = 0x9535
+ SUBGROUP_SIZE_KHR = 0x9532
+ SUBGROUP_SUPPORTED_FEATURES_KHR = 0x9534
+ SUBGROUP_SUPPORTED_STAGES_KHR = 0x9533
+ SUBPIXEL_BITS = 0x0D50
+ SUBPIXEL_PRECISION_BIAS_X_BITS_NV = 0x9347
+ SUBPIXEL_PRECISION_BIAS_Y_BITS_NV = 0x9348
+ SUPERSAMPLE_SCALE_X_NV = 0x9372
+ SUPERSAMPLE_SCALE_Y_NV = 0x9373
+ SUPPORTED_MULTISAMPLE_MODES_AMD = 0x91B7
+ SYNC_CL_EVENT_ARB = 0x8240
+ SYNC_CL_EVENT_COMPLETE_ARB = 0x8241
+ SYNC_CONDITION = 0x9113
+ SYNC_FENCE = 0x9116
+ SYNC_FLAGS = 0x9115
+ SYNC_FLUSH_COMMANDS_BIT = 0x00000001
+ SYNC_GPU_COMMANDS_COMPLETE = 0x9117
+ SYNC_STATUS = 0x9114
+ SYSTEM_FONT_NAME_NV = 0x9073
+ TASK_SHADER_BIT_NV = 0x00000080
+ TASK_SHADER_NV = 0x955A
+ TASK_SUBROUTINE_NV = 0x957D
+ TASK_SUBROUTINE_UNIFORM_NV = 0x957F
+ TASK_WORK_GROUP_SIZE_NV = 0x953F
+ TERMINATE_SEQUENCE_COMMAND_NV = 0x0000
+ TESS_CONTROL_OUTPUT_VERTICES = 0x8E75
+ TESS_CONTROL_SHADER = 0x8E88
+ TESS_CONTROL_SHADER_BIT = 0x00000008
+ TESS_CONTROL_SHADER_PATCHES_ARB = 0x82F1
+ TESS_CONTROL_SUBROUTINE = 0x92E9
+ TESS_CONTROL_SUBROUTINE_UNIFORM = 0x92EF
+ TESS_CONTROL_TEXTURE = 0x829C
+ TESS_EVALUATION_SHADER = 0x8E87
+ TESS_EVALUATION_SHADER_BIT = 0x00000010
+ TESS_EVALUATION_SHADER_INVOCATIONS_ARB = 0x82F2
+ TESS_EVALUATION_SUBROUTINE = 0x92EA
+ TESS_EVALUATION_SUBROUTINE_UNIFORM = 0x92F0
+ TESS_EVALUATION_TEXTURE = 0x829D
+ TESS_GEN_MODE = 0x8E76
+ TESS_GEN_POINT_MODE = 0x8E79
+ TESS_GEN_SPACING = 0x8E77
+ TESS_GEN_VERTEX_ORDER = 0x8E78
+ TEXTURE = 0x1702
+ TEXTURE0 = 0x84C0
+ TEXTURE1 = 0x84C1
+ TEXTURE10 = 0x84CA
+ TEXTURE11 = 0x84CB
+ TEXTURE12 = 0x84CC
+ TEXTURE13 = 0x84CD
+ TEXTURE14 = 0x84CE
+ TEXTURE15 = 0x84CF
+ TEXTURE16 = 0x84D0
+ TEXTURE17 = 0x84D1
+ TEXTURE18 = 0x84D2
+ TEXTURE19 = 0x84D3
+ TEXTURE2 = 0x84C2
+ TEXTURE20 = 0x84D4
+ TEXTURE21 = 0x84D5
+ TEXTURE22 = 0x84D6
+ TEXTURE23 = 0x84D7
+ TEXTURE24 = 0x84D8
+ TEXTURE25 = 0x84D9
+ TEXTURE26 = 0x84DA
+ TEXTURE27 = 0x84DB
+ TEXTURE28 = 0x84DC
+ TEXTURE29 = 0x84DD
+ TEXTURE3 = 0x84C3
+ TEXTURE30 = 0x84DE
+ TEXTURE31 = 0x84DF
+ TEXTURE4 = 0x84C4
+ TEXTURE5 = 0x84C5
+ TEXTURE6 = 0x84C6
+ TEXTURE7 = 0x84C7
+ TEXTURE8 = 0x84C8
+ TEXTURE9 = 0x84C9
+ TEXTURE_1D = 0x0DE0
+ TEXTURE_1D_ARRAY = 0x8C18
+ TEXTURE_2D = 0x0DE1
+ TEXTURE_2D_ARRAY = 0x8C1A
+ TEXTURE_2D_MULTISAMPLE = 0x9100
+ TEXTURE_2D_MULTISAMPLE_ARRAY = 0x9102
+ TEXTURE_3D = 0x806F
+ TEXTURE_ALPHA_SIZE = 0x805F
+ TEXTURE_ALPHA_TYPE = 0x8C13
+ TEXTURE_BASE_LEVEL = 0x813C
+ TEXTURE_BINDING_1D = 0x8068
+ TEXTURE_BINDING_1D_ARRAY = 0x8C1C
+ TEXTURE_BINDING_2D = 0x8069
+ TEXTURE_BINDING_2D_ARRAY = 0x8C1D
+ TEXTURE_BINDING_2D_MULTISAMPLE = 0x9104
+ TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY = 0x9105
+ TEXTURE_BINDING_3D = 0x806A
+ TEXTURE_BINDING_BUFFER = 0x8C2C
+ TEXTURE_BINDING_BUFFER_ARB = 0x8C2C
+ TEXTURE_BINDING_CUBE_MAP = 0x8514
+ TEXTURE_BINDING_CUBE_MAP_ARRAY = 0x900A
+ TEXTURE_BINDING_CUBE_MAP_ARRAY_ARB = 0x900A
+ TEXTURE_BINDING_RECTANGLE = 0x84F6
+ TEXTURE_BLUE_SIZE = 0x805E
+ TEXTURE_BLUE_TYPE = 0x8C12
+ TEXTURE_BORDER_COLOR = 0x1004
+ TEXTURE_BUFFER = 0x8C2A
+ TEXTURE_BUFFER_ARB = 0x8C2A
+ TEXTURE_BUFFER_DATA_STORE_BINDING = 0x8C2D
+ TEXTURE_BUFFER_DATA_STORE_BINDING_ARB = 0x8C2D
+ TEXTURE_BUFFER_FORMAT_ARB = 0x8C2E
+ TEXTURE_BUFFER_OFFSET = 0x919D
+ TEXTURE_BUFFER_OFFSET_ALIGNMENT = 0x919F
+ TEXTURE_BUFFER_SIZE = 0x919E
+ TEXTURE_COMPARE_FUNC = 0x884D
+ TEXTURE_COMPARE_MODE = 0x884C
+ TEXTURE_COMPRESSED = 0x86A1
+ TEXTURE_COMPRESSED_BLOCK_HEIGHT = 0x82B2
+ TEXTURE_COMPRESSED_BLOCK_SIZE = 0x82B3
+ TEXTURE_COMPRESSED_BLOCK_WIDTH = 0x82B1
+ TEXTURE_COMPRESSED_IMAGE_SIZE = 0x86A0
+ TEXTURE_COMPRESSION_HINT = 0x84EF
+ TEXTURE_COORD_ARRAY_ADDRESS_NV = 0x8F25
+ TEXTURE_COORD_ARRAY_LENGTH_NV = 0x8F2F
+ TEXTURE_CUBE_MAP = 0x8513
+ TEXTURE_CUBE_MAP_ARRAY = 0x9009
+ TEXTURE_CUBE_MAP_ARRAY_ARB = 0x9009
+ TEXTURE_CUBE_MAP_NEGATIVE_X = 0x8516
+ TEXTURE_CUBE_MAP_NEGATIVE_Y = 0x8518
+ TEXTURE_CUBE_MAP_NEGATIVE_Z = 0x851A
+ TEXTURE_CUBE_MAP_POSITIVE_X = 0x8515
+ TEXTURE_CUBE_MAP_POSITIVE_Y = 0x8517
+ TEXTURE_CUBE_MAP_POSITIVE_Z = 0x8519
+ TEXTURE_CUBE_MAP_SEAMLESS = 0x884F
+ TEXTURE_DEPTH = 0x8071
+ TEXTURE_DEPTH_SIZE = 0x884A
+ TEXTURE_DEPTH_TYPE = 0x8C16
+ TEXTURE_FETCH_BARRIER_BIT = 0x00000008
+ TEXTURE_FIXED_SAMPLE_LOCATIONS = 0x9107
+ TEXTURE_GATHER = 0x82A2
+ TEXTURE_GATHER_SHADOW = 0x82A3
+ TEXTURE_GREEN_SIZE = 0x805D
+ TEXTURE_GREEN_TYPE = 0x8C11
+ TEXTURE_HEIGHT = 0x1001
+ TEXTURE_IMAGE_FORMAT = 0x828F
+ TEXTURE_IMAGE_TYPE = 0x8290
+ TEXTURE_IMMUTABLE_FORMAT = 0x912F
+ TEXTURE_IMMUTABLE_LEVELS = 0x82DF
+ TEXTURE_INTERNAL_FORMAT = 0x1003
+ TEXTURE_LOD_BIAS = 0x8501
+ TEXTURE_MAG_FILTER = 0x2800
+ TEXTURE_MAX_ANISOTROPY = 0x84FE
+ TEXTURE_MAX_LEVEL = 0x813D
+ TEXTURE_MAX_LOD = 0x813B
+ TEXTURE_MIN_FILTER = 0x2801
+ TEXTURE_MIN_LOD = 0x813A
+ TEXTURE_RECTANGLE = 0x84F5
+ TEXTURE_REDUCTION_MODE_ARB = 0x9366
+ TEXTURE_REDUCTION_MODE_EXT = 0x9366
+ TEXTURE_RED_SIZE = 0x805C
+ TEXTURE_RED_TYPE = 0x8C10
+ TEXTURE_SAMPLES = 0x9106
+ TEXTURE_SHADOW = 0x82A1
+ TEXTURE_SHARED_SIZE = 0x8C3F
+ TEXTURE_SPARSE_ARB = 0x91A6
+ TEXTURE_SRGB_DECODE_EXT = 0x8A48
+ TEXTURE_STENCIL_SIZE = 0x88F1
+ TEXTURE_SWIZZLE_A = 0x8E45
+ TEXTURE_SWIZZLE_B = 0x8E44
+ TEXTURE_SWIZZLE_G = 0x8E43
+ TEXTURE_SWIZZLE_R = 0x8E42
+ TEXTURE_SWIZZLE_RGBA = 0x8E46
+ TEXTURE_TARGET = 0x1006
+ TEXTURE_UPDATE_BARRIER_BIT = 0x00000100
+ TEXTURE_VIEW = 0x82B5
+ TEXTURE_VIEW_MIN_LAYER = 0x82DD
+ TEXTURE_VIEW_MIN_LEVEL = 0x82DB
+ TEXTURE_VIEW_NUM_LAYERS = 0x82DE
+ TEXTURE_VIEW_NUM_LEVELS = 0x82DC
+ TEXTURE_WIDTH = 0x1000
+ TEXTURE_WRAP_R = 0x8072
+ TEXTURE_WRAP_S = 0x2802
+ TEXTURE_WRAP_T = 0x2803
+ TIMEOUT_EXPIRED = 0x911B
+ TIMEOUT_IGNORED = 0xFFFFFFFFFFFFFFFF
+ TIMESTAMP = 0x8E28
+ TIME_ELAPSED = 0x88BF
+ TOP_LEVEL_ARRAY_SIZE = 0x930C
+ TOP_LEVEL_ARRAY_STRIDE = 0x930D
+ TRANSFORM_FEEDBACK = 0x8E22
+ TRANSFORM_FEEDBACK_BARRIER_BIT = 0x00000800
+ TRANSFORM_FEEDBACK_BINDING = 0x8E25
+ TRANSFORM_FEEDBACK_BUFFER = 0x8C8E
+ TRANSFORM_FEEDBACK_BUFFER_ACTIVE = 0x8E24
+ TRANSFORM_FEEDBACK_BUFFER_BINDING = 0x8C8F
+ TRANSFORM_FEEDBACK_BUFFER_INDEX = 0x934B
+ TRANSFORM_FEEDBACK_BUFFER_MODE = 0x8C7F
+ TRANSFORM_FEEDBACK_BUFFER_PAUSED = 0x8E23
+ TRANSFORM_FEEDBACK_BUFFER_SIZE = 0x8C85
+ TRANSFORM_FEEDBACK_BUFFER_START = 0x8C84
+ TRANSFORM_FEEDBACK_BUFFER_STRIDE = 0x934C
+ TRANSFORM_FEEDBACK_OVERFLOW_ARB = 0x82EC
+ TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN = 0x8C88
+ TRANSFORM_FEEDBACK_STREAM_OVERFLOW_ARB = 0x82ED
+ TRANSFORM_FEEDBACK_VARYING = 0x92F4
+ TRANSFORM_FEEDBACK_VARYINGS = 0x8C83
+ TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH = 0x8C76
+ TRANSLATE_2D_NV = 0x9090
+ TRANSLATE_3D_NV = 0x9091
+ TRANSLATE_X_NV = 0x908E
+ TRANSLATE_Y_NV = 0x908F
+ TRANSPOSE_AFFINE_2D_NV = 0x9096
+ TRANSPOSE_AFFINE_3D_NV = 0x9098
+ TRANSPOSE_PROGRAM_MATRIX_EXT = 0x8E2E
+ TRIANGLES = 0x0004
+ TRIANGLES_ADJACENCY = 0x000C
+ TRIANGLES_ADJACENCY_ARB = 0x000C
+ TRIANGLE_FAN = 0x0006
+ TRIANGLE_STRIP = 0x0005
+ TRIANGLE_STRIP_ADJACENCY = 0x000D
+ TRIANGLE_STRIP_ADJACENCY_ARB = 0x000D
+ TRIANGULAR_NV = 0x90A5
+ TRUE = 1
+ TYPE = 0x92FA
+ UNCORRELATED_NV = 0x9282
+ UNDEFINED_VERTEX = 0x8260
+ UNIFORM = 0x92E1
+ UNIFORM_ADDRESS_COMMAND_NV = 0x000A
+ UNIFORM_ARRAY_STRIDE = 0x8A3C
+ UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX = 0x92DA
+ UNIFORM_BARRIER_BIT = 0x00000004
+ UNIFORM_BLOCK = 0x92E2
+ UNIFORM_BLOCK_ACTIVE_UNIFORMS = 0x8A42
+ UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES = 0x8A43
+ UNIFORM_BLOCK_BINDING = 0x8A3F
+ UNIFORM_BLOCK_DATA_SIZE = 0x8A40
+ UNIFORM_BLOCK_INDEX = 0x8A3A
+ UNIFORM_BLOCK_NAME_LENGTH = 0x8A41
+ UNIFORM_BLOCK_REFERENCED_BY_COMPUTE_SHADER = 0x90EC
+ UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER = 0x8A46
+ UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER = 0x8A45
+ UNIFORM_BLOCK_REFERENCED_BY_MESH_SHADER_NV = 0x959C
+ UNIFORM_BLOCK_REFERENCED_BY_TASK_SHADER_NV = 0x959D
+ UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER = 0x84F0
+ UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER = 0x84F1
+ UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER = 0x8A44
+ UNIFORM_BUFFER = 0x8A11
+ UNIFORM_BUFFER_ADDRESS_NV = 0x936F
+ UNIFORM_BUFFER_BINDING = 0x8A28
+ UNIFORM_BUFFER_LENGTH_NV = 0x9370
+ UNIFORM_BUFFER_OFFSET_ALIGNMENT = 0x8A34
+ UNIFORM_BUFFER_SIZE = 0x8A2A
+ UNIFORM_BUFFER_START = 0x8A29
+ UNIFORM_BUFFER_UNIFIED_NV = 0x936E
+ UNIFORM_IS_ROW_MAJOR = 0x8A3E
+ UNIFORM_MATRIX_STRIDE = 0x8A3D
+ UNIFORM_NAME_LENGTH = 0x8A39
+ UNIFORM_OFFSET = 0x8A3B
+ UNIFORM_SIZE = 0x8A38
+ UNIFORM_TYPE = 0x8A37
+ UNKNOWN_CONTEXT_RESET = 0x8255
+ UNKNOWN_CONTEXT_RESET_ARB = 0x8255
+ UNKNOWN_CONTEXT_RESET_KHR = 0x8255
+ UNPACK_ALIGNMENT = 0x0CF5
+ UNPACK_COMPRESSED_BLOCK_DEPTH = 0x9129
+ UNPACK_COMPRESSED_BLOCK_HEIGHT = 0x9128
+ UNPACK_COMPRESSED_BLOCK_SIZE = 0x912A
+ UNPACK_COMPRESSED_BLOCK_WIDTH = 0x9127
+ UNPACK_IMAGE_HEIGHT = 0x806E
+ UNPACK_LSB_FIRST = 0x0CF1
+ UNPACK_ROW_LENGTH = 0x0CF2
+ UNPACK_SKIP_IMAGES = 0x806D
+ UNPACK_SKIP_PIXELS = 0x0CF4
+ UNPACK_SKIP_ROWS = 0x0CF3
+ UNPACK_SWAP_BYTES = 0x0CF0
+ UNSIGNALED = 0x9118
+ UNSIGNED_BYTE = 0x1401
+ UNSIGNED_BYTE_2_3_3_REV = 0x8362
+ UNSIGNED_BYTE_3_3_2 = 0x8032
+ UNSIGNED_INT = 0x1405
+ UNSIGNED_INT16_NV = 0x8FF0
+ UNSIGNED_INT16_VEC2_NV = 0x8FF1
+ UNSIGNED_INT16_VEC3_NV = 0x8FF2
+ UNSIGNED_INT16_VEC4_NV = 0x8FF3
+ UNSIGNED_INT64_AMD = 0x8BC2
+ UNSIGNED_INT64_ARB = 0x140F
+ UNSIGNED_INT64_NV = 0x140F
+ UNSIGNED_INT64_VEC2_ARB = 0x8FF5
+ UNSIGNED_INT64_VEC2_NV = 0x8FF5
+ UNSIGNED_INT64_VEC3_ARB = 0x8FF6
+ UNSIGNED_INT64_VEC3_NV = 0x8FF6
+ UNSIGNED_INT64_VEC4_ARB = 0x8FF7
+ UNSIGNED_INT64_VEC4_NV = 0x8FF7
+ UNSIGNED_INT8_NV = 0x8FEC
+ UNSIGNED_INT8_VEC2_NV = 0x8FED
+ UNSIGNED_INT8_VEC3_NV = 0x8FEE
+ UNSIGNED_INT8_VEC4_NV = 0x8FEF
+ UNSIGNED_INT_10F_11F_11F_REV = 0x8C3B
+ UNSIGNED_INT_10_10_10_2 = 0x8036
+ UNSIGNED_INT_24_8 = 0x84FA
+ UNSIGNED_INT_2_10_10_10_REV = 0x8368
+ UNSIGNED_INT_5_9_9_9_REV = 0x8C3E
+ UNSIGNED_INT_8_8_8_8 = 0x8035
+ UNSIGNED_INT_8_8_8_8_REV = 0x8367
+ UNSIGNED_INT_ATOMIC_COUNTER = 0x92DB
+ UNSIGNED_INT_IMAGE_1D = 0x9062
+ UNSIGNED_INT_IMAGE_1D_ARRAY = 0x9068
+ UNSIGNED_INT_IMAGE_2D = 0x9063
+ UNSIGNED_INT_IMAGE_2D_ARRAY = 0x9069
+ UNSIGNED_INT_IMAGE_2D_MULTISAMPLE = 0x906B
+ UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY = 0x906C
+ UNSIGNED_INT_IMAGE_2D_RECT = 0x9065
+ UNSIGNED_INT_IMAGE_3D = 0x9064
+ UNSIGNED_INT_IMAGE_BUFFER = 0x9067
+ UNSIGNED_INT_IMAGE_CUBE = 0x9066
+ UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY = 0x906A
+ UNSIGNED_INT_SAMPLER_1D = 0x8DD1
+ UNSIGNED_INT_SAMPLER_1D_ARRAY = 0x8DD6
+ UNSIGNED_INT_SAMPLER_2D = 0x8DD2
+ UNSIGNED_INT_SAMPLER_2D_ARRAY = 0x8DD7
+ UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE = 0x910A
+ UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY = 0x910D
+ UNSIGNED_INT_SAMPLER_2D_RECT = 0x8DD5
+ UNSIGNED_INT_SAMPLER_3D = 0x8DD3
+ UNSIGNED_INT_SAMPLER_BUFFER = 0x8DD8
+ UNSIGNED_INT_SAMPLER_CUBE = 0x8DD4
+ UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_ARB = 0x900F
+ UNSIGNED_INT_VEC2 = 0x8DC6
+ UNSIGNED_INT_VEC3 = 0x8DC7
+ UNSIGNED_INT_VEC4 = 0x8DC8
+ UNSIGNED_NORMALIZED = 0x8C17
+ UNSIGNED_SHORT = 0x1403
+ UNSIGNED_SHORT_1_5_5_5_REV = 0x8366
+ UNSIGNED_SHORT_4_4_4_4 = 0x8033
+ UNSIGNED_SHORT_4_4_4_4_REV = 0x8365
+ UNSIGNED_SHORT_5_5_5_1 = 0x8034
+ UNSIGNED_SHORT_5_6_5 = 0x8363
+ UNSIGNED_SHORT_5_6_5_REV = 0x8364
+ UNSIGNED_SHORT_8_8_APPLE = 0x85BA
+ UNSIGNED_SHORT_8_8_REV_APPLE = 0x85BB
+ UPPER_LEFT = 0x8CA2
+ USE_MISSING_GLYPH_NV = 0x90AA
+ UTF16_NV = 0x909B
+ UTF8_NV = 0x909A
+ VALIDATE_STATUS = 0x8B83
+ VENDOR = 0x1F00
+ VERSION = 0x1F02
+ VERTEX_ARRAY = 0x8074
+ VERTEX_ARRAY_ADDRESS_NV = 0x8F21
+ VERTEX_ARRAY_BINDING = 0x85B5
+ VERTEX_ARRAY_KHR = 0x8074
+ VERTEX_ARRAY_LENGTH_NV = 0x8F2B
+ VERTEX_ARRAY_OBJECT_EXT = 0x9154
+ VERTEX_ATTRIB_ARRAY_ADDRESS_NV = 0x8F20
+ VERTEX_ATTRIB_ARRAY_BARRIER_BIT = 0x00000001
+ VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = 0x889F
+ VERTEX_ATTRIB_ARRAY_DIVISOR = 0x88FE
+ VERTEX_ATTRIB_ARRAY_DIVISOR_ARB = 0x88FE
+ VERTEX_ATTRIB_ARRAY_ENABLED = 0x8622
+ VERTEX_ATTRIB_ARRAY_INTEGER = 0x88FD
+ VERTEX_ATTRIB_ARRAY_LENGTH_NV = 0x8F2A
+ VERTEX_ATTRIB_ARRAY_NORMALIZED = 0x886A
+ VERTEX_ATTRIB_ARRAY_POINTER = 0x8645
+ VERTEX_ATTRIB_ARRAY_SIZE = 0x8623
+ VERTEX_ATTRIB_ARRAY_STRIDE = 0x8624
+ VERTEX_ATTRIB_ARRAY_TYPE = 0x8625
+ VERTEX_ATTRIB_ARRAY_UNIFIED_NV = 0x8F1E
+ VERTEX_ATTRIB_BINDING = 0x82D4
+ VERTEX_ATTRIB_RELATIVE_OFFSET = 0x82D5
+ VERTEX_BINDING_DIVISOR = 0x82D6
+ VERTEX_BINDING_OFFSET = 0x82D7
+ VERTEX_BINDING_STRIDE = 0x82D8
+ VERTEX_PROGRAM_POINT_SIZE = 0x8642
+ VERTEX_SHADER = 0x8B31
+ VERTEX_SHADER_BIT = 0x00000001
+ VERTEX_SHADER_BIT_EXT = 0x00000001
+ VERTEX_SHADER_INVOCATIONS_ARB = 0x82F0
+ VERTEX_SUBROUTINE = 0x92E8
+ VERTEX_SUBROUTINE_UNIFORM = 0x92EE
+ VERTEX_TEXTURE = 0x829B
+ VERTICAL_LINE_TO_NV = 0x08
+ VERTICES_SUBMITTED_ARB = 0x82EE
+ VIEWPORT = 0x0BA2
+ VIEWPORT_BOUNDS_RANGE = 0x825D
+ VIEWPORT_COMMAND_NV = 0x0010
+ VIEWPORT_INDEX_PROVOKING_VERTEX = 0x825F
+ VIEWPORT_POSITION_W_SCALE_NV = 0x937C
+ VIEWPORT_POSITION_W_SCALE_X_COEFF_NV = 0x937D
+ VIEWPORT_POSITION_W_SCALE_Y_COEFF_NV = 0x937E
+ VIEWPORT_SUBPIXEL_BITS = 0x825C
+ VIEWPORT_SWIZZLE_NEGATIVE_W_NV = 0x9357
+ VIEWPORT_SWIZZLE_NEGATIVE_X_NV = 0x9351
+ VIEWPORT_SWIZZLE_NEGATIVE_Y_NV = 0x9353
+ VIEWPORT_SWIZZLE_NEGATIVE_Z_NV = 0x9355
+ VIEWPORT_SWIZZLE_POSITIVE_W_NV = 0x9356
+ VIEWPORT_SWIZZLE_POSITIVE_X_NV = 0x9350
+ VIEWPORT_SWIZZLE_POSITIVE_Y_NV = 0x9352
+ VIEWPORT_SWIZZLE_POSITIVE_Z_NV = 0x9354
+ VIEWPORT_SWIZZLE_W_NV = 0x935B
+ VIEWPORT_SWIZZLE_X_NV = 0x9358
+ VIEWPORT_SWIZZLE_Y_NV = 0x9359
+ VIEWPORT_SWIZZLE_Z_NV = 0x935A
+ VIEW_CLASS_128_BITS = 0x82C4
+ VIEW_CLASS_16_BITS = 0x82CA
+ VIEW_CLASS_24_BITS = 0x82C9
+ VIEW_CLASS_32_BITS = 0x82C8
+ VIEW_CLASS_48_BITS = 0x82C7
+ VIEW_CLASS_64_BITS = 0x82C6
+ VIEW_CLASS_8_BITS = 0x82CB
+ VIEW_CLASS_96_BITS = 0x82C5
+ VIEW_CLASS_ASTC_10x10_RGBA = 0x9393
+ VIEW_CLASS_ASTC_10x5_RGBA = 0x9390
+ VIEW_CLASS_ASTC_10x6_RGBA = 0x9391
+ VIEW_CLASS_ASTC_10x8_RGBA = 0x9392
+ VIEW_CLASS_ASTC_12x10_RGBA = 0x9394
+ VIEW_CLASS_ASTC_12x12_RGBA = 0x9395
+ VIEW_CLASS_ASTC_4x4_RGBA = 0x9388
+ VIEW_CLASS_ASTC_5x4_RGBA = 0x9389
+ VIEW_CLASS_ASTC_5x5_RGBA = 0x938A
+ VIEW_CLASS_ASTC_6x5_RGBA = 0x938B
+ VIEW_CLASS_ASTC_6x6_RGBA = 0x938C
+ VIEW_CLASS_ASTC_8x5_RGBA = 0x938D
+ VIEW_CLASS_ASTC_8x6_RGBA = 0x938E
+ VIEW_CLASS_ASTC_8x8_RGBA = 0x938F
+ VIEW_CLASS_BPTC_FLOAT = 0x82D3
+ VIEW_CLASS_BPTC_UNORM = 0x82D2
+ VIEW_CLASS_EAC_R11 = 0x9383
+ VIEW_CLASS_EAC_RG11 = 0x9384
+ VIEW_CLASS_ETC2_EAC_RGBA = 0x9387
+ VIEW_CLASS_ETC2_RGB = 0x9385
+ VIEW_CLASS_ETC2_RGBA = 0x9386
+ VIEW_CLASS_RGTC1_RED = 0x82D0
+ VIEW_CLASS_RGTC2_RG = 0x82D1
+ VIEW_CLASS_S3TC_DXT1_RGB = 0x82CC
+ VIEW_CLASS_S3TC_DXT1_RGBA = 0x82CD
+ VIEW_CLASS_S3TC_DXT3_RGBA = 0x82CE
+ VIEW_CLASS_S3TC_DXT5_RGBA = 0x82CF
+ VIEW_COMPATIBILITY_CLASS = 0x82B6
+ VIRTUAL_PAGE_SIZE_INDEX_ARB = 0x91A7
+ VIRTUAL_PAGE_SIZE_X_ARB = 0x9195
+ VIRTUAL_PAGE_SIZE_Y_ARB = 0x9196
+ VIRTUAL_PAGE_SIZE_Z_ARB = 0x9197
+ VIVIDLIGHT_NV = 0x92A6
+ WAIT_FAILED = 0x911D
+ WARPS_PER_SM_NV = 0x933A
+ WARP_SIZE_NV = 0x9339
+ WEIGHTED_AVERAGE_ARB = 0x9367
+ WEIGHTED_AVERAGE_EXT = 0x9367
+ WINDOW_RECTANGLE_EXT = 0x8F12
+ WINDOW_RECTANGLE_MODE_EXT = 0x8F13
+ WRITE_ONLY = 0x88B9
+ XOR = 0x1506
+ XOR_NV = 0x1506
+ ZERO = 0
+ ZERO_TO_ONE = 0x935F
+)
+
+var (
+ gpActiveProgramEXT C.GPACTIVEPROGRAMEXT
+ gpActiveShaderProgram C.GPACTIVESHADERPROGRAM
+ gpActiveShaderProgramEXT C.GPACTIVESHADERPROGRAMEXT
+ gpActiveTexture C.GPACTIVETEXTURE
+ gpApplyFramebufferAttachmentCMAAINTEL C.GPAPPLYFRAMEBUFFERATTACHMENTCMAAINTEL
+ gpAttachShader C.GPATTACHSHADER
+ gpBeginConditionalRender C.GPBEGINCONDITIONALRENDER
+ gpBeginConditionalRenderNV C.GPBEGINCONDITIONALRENDERNV
+ gpBeginPerfMonitorAMD C.GPBEGINPERFMONITORAMD
+ gpBeginPerfQueryINTEL C.GPBEGINPERFQUERYINTEL
+ gpBeginQuery C.GPBEGINQUERY
+ gpBeginQueryIndexed C.GPBEGINQUERYINDEXED
+ gpBeginTransformFeedback C.GPBEGINTRANSFORMFEEDBACK
+ gpBindAttribLocation C.GPBINDATTRIBLOCATION
+ gpBindBuffer C.GPBINDBUFFER
+ gpBindBufferBase C.GPBINDBUFFERBASE
+ gpBindBufferRange C.GPBINDBUFFERRANGE
+ gpBindBuffersBase C.GPBINDBUFFERSBASE
+ gpBindBuffersRange C.GPBINDBUFFERSRANGE
+ gpBindFragDataLocation C.GPBINDFRAGDATALOCATION
+ gpBindFragDataLocationIndexed C.GPBINDFRAGDATALOCATIONINDEXED
+ gpBindFramebuffer C.GPBINDFRAMEBUFFER
+ gpBindImageTexture C.GPBINDIMAGETEXTURE
+ gpBindImageTextures C.GPBINDIMAGETEXTURES
+ gpBindMultiTextureEXT C.GPBINDMULTITEXTUREEXT
+ gpBindProgramPipeline C.GPBINDPROGRAMPIPELINE
+ gpBindProgramPipelineEXT C.GPBINDPROGRAMPIPELINEEXT
+ gpBindRenderbuffer C.GPBINDRENDERBUFFER
+ gpBindSampler C.GPBINDSAMPLER
+ gpBindSamplers C.GPBINDSAMPLERS
+ gpBindShadingRateImageNV C.GPBINDSHADINGRATEIMAGENV
+ gpBindTexture C.GPBINDTEXTURE
+ gpBindTextureUnit C.GPBINDTEXTUREUNIT
+ gpBindTextures C.GPBINDTEXTURES
+ gpBindTransformFeedback C.GPBINDTRANSFORMFEEDBACK
+ gpBindVertexArray C.GPBINDVERTEXARRAY
+ gpBindVertexBuffer C.GPBINDVERTEXBUFFER
+ gpBindVertexBuffers C.GPBINDVERTEXBUFFERS
+ gpBlendBarrierKHR C.GPBLENDBARRIERKHR
+ gpBlendBarrierNV C.GPBLENDBARRIERNV
+ gpBlendColor C.GPBLENDCOLOR
+ gpBlendEquation C.GPBLENDEQUATION
+ gpBlendEquationSeparate C.GPBLENDEQUATIONSEPARATE
+ gpBlendEquationSeparateiARB C.GPBLENDEQUATIONSEPARATEIARB
+ gpBlendEquationiARB C.GPBLENDEQUATIONIARB
+ gpBlendFunc C.GPBLENDFUNC
+ gpBlendFuncSeparate C.GPBLENDFUNCSEPARATE
+ gpBlendFuncSeparateiARB C.GPBLENDFUNCSEPARATEIARB
+ gpBlendFunciARB C.GPBLENDFUNCIARB
+ gpBlendParameteriNV C.GPBLENDPARAMETERINV
+ gpBlitFramebuffer C.GPBLITFRAMEBUFFER
+ gpBlitNamedFramebuffer C.GPBLITNAMEDFRAMEBUFFER
+ gpBufferAddressRangeNV C.GPBUFFERADDRESSRANGENV
+ gpBufferAttachMemoryNV C.GPBUFFERATTACHMEMORYNV
+ gpBufferData C.GPBUFFERDATA
+ gpBufferPageCommitmentARB C.GPBUFFERPAGECOMMITMENTARB
+ gpBufferPageCommitmentMemNV C.GPBUFFERPAGECOMMITMENTMEMNV
+ gpBufferStorage C.GPBUFFERSTORAGE
+ gpBufferSubData C.GPBUFFERSUBDATA
+ gpCallCommandListNV C.GPCALLCOMMANDLISTNV
+ gpCheckFramebufferStatus C.GPCHECKFRAMEBUFFERSTATUS
+ gpCheckNamedFramebufferStatus C.GPCHECKNAMEDFRAMEBUFFERSTATUS
+ gpCheckNamedFramebufferStatusEXT C.GPCHECKNAMEDFRAMEBUFFERSTATUSEXT
+ gpClampColor C.GPCLAMPCOLOR
+ gpClear C.GPCLEAR
+ gpClearBufferData C.GPCLEARBUFFERDATA
+ gpClearBufferSubData C.GPCLEARBUFFERSUBDATA
+ gpClearBufferfi C.GPCLEARBUFFERFI
+ gpClearBufferfv C.GPCLEARBUFFERFV
+ gpClearBufferiv C.GPCLEARBUFFERIV
+ gpClearBufferuiv C.GPCLEARBUFFERUIV
+ gpClearColor C.GPCLEARCOLOR
+ gpClearDepth C.GPCLEARDEPTH
+ gpClearDepthdNV C.GPCLEARDEPTHDNV
+ gpClearDepthf C.GPCLEARDEPTHF
+ gpClearNamedBufferData C.GPCLEARNAMEDBUFFERDATA
+ gpClearNamedBufferDataEXT C.GPCLEARNAMEDBUFFERDATAEXT
+ gpClearNamedBufferSubData C.GPCLEARNAMEDBUFFERSUBDATA
+ gpClearNamedBufferSubDataEXT C.GPCLEARNAMEDBUFFERSUBDATAEXT
+ gpClearNamedFramebufferfi C.GPCLEARNAMEDFRAMEBUFFERFI
+ gpClearNamedFramebufferfv C.GPCLEARNAMEDFRAMEBUFFERFV
+ gpClearNamedFramebufferiv C.GPCLEARNAMEDFRAMEBUFFERIV
+ gpClearNamedFramebufferuiv C.GPCLEARNAMEDFRAMEBUFFERUIV
+ gpClearStencil C.GPCLEARSTENCIL
+ gpClearTexImage C.GPCLEARTEXIMAGE
+ gpClearTexSubImage C.GPCLEARTEXSUBIMAGE
+ gpClientAttribDefaultEXT C.GPCLIENTATTRIBDEFAULTEXT
+ gpClientWaitSync C.GPCLIENTWAITSYNC
+ gpClipControl C.GPCLIPCONTROL
+ gpColorFormatNV C.GPCOLORFORMATNV
+ gpColorMask C.GPCOLORMASK
+ gpColorMaski C.GPCOLORMASKI
+ gpCommandListSegmentsNV C.GPCOMMANDLISTSEGMENTSNV
+ gpCompileCommandListNV C.GPCOMPILECOMMANDLISTNV
+ gpCompileShader C.GPCOMPILESHADER
+ gpCompileShaderIncludeARB C.GPCOMPILESHADERINCLUDEARB
+ gpCompressedMultiTexImage1DEXT C.GPCOMPRESSEDMULTITEXIMAGE1DEXT
+ gpCompressedMultiTexImage2DEXT C.GPCOMPRESSEDMULTITEXIMAGE2DEXT
+ gpCompressedMultiTexImage3DEXT C.GPCOMPRESSEDMULTITEXIMAGE3DEXT
+ gpCompressedMultiTexSubImage1DEXT C.GPCOMPRESSEDMULTITEXSUBIMAGE1DEXT
+ gpCompressedMultiTexSubImage2DEXT C.GPCOMPRESSEDMULTITEXSUBIMAGE2DEXT
+ gpCompressedMultiTexSubImage3DEXT C.GPCOMPRESSEDMULTITEXSUBIMAGE3DEXT
+ gpCompressedTexImage1D C.GPCOMPRESSEDTEXIMAGE1D
+ gpCompressedTexImage2D C.GPCOMPRESSEDTEXIMAGE2D
+ gpCompressedTexImage3D C.GPCOMPRESSEDTEXIMAGE3D
+ gpCompressedTexSubImage1D C.GPCOMPRESSEDTEXSUBIMAGE1D
+ gpCompressedTexSubImage2D C.GPCOMPRESSEDTEXSUBIMAGE2D
+ gpCompressedTexSubImage3D C.GPCOMPRESSEDTEXSUBIMAGE3D
+ gpCompressedTextureImage1DEXT C.GPCOMPRESSEDTEXTUREIMAGE1DEXT
+ gpCompressedTextureImage2DEXT C.GPCOMPRESSEDTEXTUREIMAGE2DEXT
+ gpCompressedTextureImage3DEXT C.GPCOMPRESSEDTEXTUREIMAGE3DEXT
+ gpCompressedTextureSubImage1D C.GPCOMPRESSEDTEXTURESUBIMAGE1D
+ gpCompressedTextureSubImage1DEXT C.GPCOMPRESSEDTEXTURESUBIMAGE1DEXT
+ gpCompressedTextureSubImage2D C.GPCOMPRESSEDTEXTURESUBIMAGE2D
+ gpCompressedTextureSubImage2DEXT C.GPCOMPRESSEDTEXTURESUBIMAGE2DEXT
+ gpCompressedTextureSubImage3D C.GPCOMPRESSEDTEXTURESUBIMAGE3D
+ gpCompressedTextureSubImage3DEXT C.GPCOMPRESSEDTEXTURESUBIMAGE3DEXT
+ gpConservativeRasterParameterfNV C.GPCONSERVATIVERASTERPARAMETERFNV
+ gpConservativeRasterParameteriNV C.GPCONSERVATIVERASTERPARAMETERINV
+ gpCopyBufferSubData C.GPCOPYBUFFERSUBDATA
+ gpCopyImageSubData C.GPCOPYIMAGESUBDATA
+ gpCopyMultiTexImage1DEXT C.GPCOPYMULTITEXIMAGE1DEXT
+ gpCopyMultiTexImage2DEXT C.GPCOPYMULTITEXIMAGE2DEXT
+ gpCopyMultiTexSubImage1DEXT C.GPCOPYMULTITEXSUBIMAGE1DEXT
+ gpCopyMultiTexSubImage2DEXT C.GPCOPYMULTITEXSUBIMAGE2DEXT
+ gpCopyMultiTexSubImage3DEXT C.GPCOPYMULTITEXSUBIMAGE3DEXT
+ gpCopyNamedBufferSubData C.GPCOPYNAMEDBUFFERSUBDATA
+ gpCopyPathNV C.GPCOPYPATHNV
+ gpCopyTexImage1D C.GPCOPYTEXIMAGE1D
+ gpCopyTexImage2D C.GPCOPYTEXIMAGE2D
+ gpCopyTexSubImage1D C.GPCOPYTEXSUBIMAGE1D
+ gpCopyTexSubImage2D C.GPCOPYTEXSUBIMAGE2D
+ gpCopyTexSubImage3D C.GPCOPYTEXSUBIMAGE3D
+ gpCopyTextureImage1DEXT C.GPCOPYTEXTUREIMAGE1DEXT
+ gpCopyTextureImage2DEXT C.GPCOPYTEXTUREIMAGE2DEXT
+ gpCopyTextureSubImage1D C.GPCOPYTEXTURESUBIMAGE1D
+ gpCopyTextureSubImage1DEXT C.GPCOPYTEXTURESUBIMAGE1DEXT
+ gpCopyTextureSubImage2D C.GPCOPYTEXTURESUBIMAGE2D
+ gpCopyTextureSubImage2DEXT C.GPCOPYTEXTURESUBIMAGE2DEXT
+ gpCopyTextureSubImage3D C.GPCOPYTEXTURESUBIMAGE3D
+ gpCopyTextureSubImage3DEXT C.GPCOPYTEXTURESUBIMAGE3DEXT
+ gpCoverFillPathInstancedNV C.GPCOVERFILLPATHINSTANCEDNV
+ gpCoverFillPathNV C.GPCOVERFILLPATHNV
+ gpCoverStrokePathInstancedNV C.GPCOVERSTROKEPATHINSTANCEDNV
+ gpCoverStrokePathNV C.GPCOVERSTROKEPATHNV
+ gpCoverageModulationNV C.GPCOVERAGEMODULATIONNV
+ gpCoverageModulationTableNV C.GPCOVERAGEMODULATIONTABLENV
+ gpCreateBuffers C.GPCREATEBUFFERS
+ gpCreateCommandListsNV C.GPCREATECOMMANDLISTSNV
+ gpCreateFramebuffers C.GPCREATEFRAMEBUFFERS
+ gpCreatePerfQueryINTEL C.GPCREATEPERFQUERYINTEL
+ gpCreateProgram C.GPCREATEPROGRAM
+ gpCreateProgramPipelines C.GPCREATEPROGRAMPIPELINES
+ gpCreateQueries C.GPCREATEQUERIES
+ gpCreateRenderbuffers C.GPCREATERENDERBUFFERS
+ gpCreateSamplers C.GPCREATESAMPLERS
+ gpCreateShader C.GPCREATESHADER
+ gpCreateShaderProgramEXT C.GPCREATESHADERPROGRAMEXT
+ gpCreateShaderProgramv C.GPCREATESHADERPROGRAMV
+ gpCreateShaderProgramvEXT C.GPCREATESHADERPROGRAMVEXT
+ gpCreateStatesNV C.GPCREATESTATESNV
+ gpCreateSyncFromCLeventARB C.GPCREATESYNCFROMCLEVENTARB
+ gpCreateTextures C.GPCREATETEXTURES
+ gpCreateTransformFeedbacks C.GPCREATETRANSFORMFEEDBACKS
+ gpCreateVertexArrays C.GPCREATEVERTEXARRAYS
+ gpCullFace C.GPCULLFACE
+ gpDebugMessageCallback C.GPDEBUGMESSAGECALLBACK
+ gpDebugMessageCallbackARB C.GPDEBUGMESSAGECALLBACKARB
+ gpDebugMessageCallbackKHR C.GPDEBUGMESSAGECALLBACKKHR
+ gpDebugMessageControl C.GPDEBUGMESSAGECONTROL
+ gpDebugMessageControlARB C.GPDEBUGMESSAGECONTROLARB
+ gpDebugMessageControlKHR C.GPDEBUGMESSAGECONTROLKHR
+ gpDebugMessageInsert C.GPDEBUGMESSAGEINSERT
+ gpDebugMessageInsertARB C.GPDEBUGMESSAGEINSERTARB
+ gpDebugMessageInsertKHR C.GPDEBUGMESSAGEINSERTKHR
+ gpDeleteBuffers C.GPDELETEBUFFERS
+ gpDeleteCommandListsNV C.GPDELETECOMMANDLISTSNV
+ gpDeleteFramebuffers C.GPDELETEFRAMEBUFFERS
+ gpDeleteNamedStringARB C.GPDELETENAMEDSTRINGARB
+ gpDeletePathsNV C.GPDELETEPATHSNV
+ gpDeletePerfMonitorsAMD C.GPDELETEPERFMONITORSAMD
+ gpDeletePerfQueryINTEL C.GPDELETEPERFQUERYINTEL
+ gpDeleteProgram C.GPDELETEPROGRAM
+ gpDeleteProgramPipelines C.GPDELETEPROGRAMPIPELINES
+ gpDeleteProgramPipelinesEXT C.GPDELETEPROGRAMPIPELINESEXT
+ gpDeleteQueries C.GPDELETEQUERIES
+ gpDeleteRenderbuffers C.GPDELETERENDERBUFFERS
+ gpDeleteSamplers C.GPDELETESAMPLERS
+ gpDeleteShader C.GPDELETESHADER
+ gpDeleteStatesNV C.GPDELETESTATESNV
+ gpDeleteSync C.GPDELETESYNC
+ gpDeleteTextures C.GPDELETETEXTURES
+ gpDeleteTransformFeedbacks C.GPDELETETRANSFORMFEEDBACKS
+ gpDeleteVertexArrays C.GPDELETEVERTEXARRAYS
+ gpDepthBoundsdNV C.GPDEPTHBOUNDSDNV
+ gpDepthFunc C.GPDEPTHFUNC
+ gpDepthMask C.GPDEPTHMASK
+ gpDepthRange C.GPDEPTHRANGE
+ gpDepthRangeArraydvNV C.GPDEPTHRANGEARRAYDVNV
+ gpDepthRangeArrayv C.GPDEPTHRANGEARRAYV
+ gpDepthRangeIndexed C.GPDEPTHRANGEINDEXED
+ gpDepthRangeIndexeddNV C.GPDEPTHRANGEINDEXEDDNV
+ gpDepthRangedNV C.GPDEPTHRANGEDNV
+ gpDepthRangef C.GPDEPTHRANGEF
+ gpDetachShader C.GPDETACHSHADER
+ gpDisable C.GPDISABLE
+ gpDisableClientStateIndexedEXT C.GPDISABLECLIENTSTATEINDEXEDEXT
+ gpDisableClientStateiEXT C.GPDISABLECLIENTSTATEIEXT
+ gpDisableIndexedEXT C.GPDISABLEINDEXEDEXT
+ gpDisableVertexArrayAttrib C.GPDISABLEVERTEXARRAYATTRIB
+ gpDisableVertexArrayAttribEXT C.GPDISABLEVERTEXARRAYATTRIBEXT
+ gpDisableVertexArrayEXT C.GPDISABLEVERTEXARRAYEXT
+ gpDisableVertexAttribArray C.GPDISABLEVERTEXATTRIBARRAY
+ gpDisablei C.GPDISABLEI
+ gpDispatchCompute C.GPDISPATCHCOMPUTE
+ gpDispatchComputeGroupSizeARB C.GPDISPATCHCOMPUTEGROUPSIZEARB
+ gpDispatchComputeIndirect C.GPDISPATCHCOMPUTEINDIRECT
+ gpDrawArrays C.GPDRAWARRAYS
+ gpDrawArraysIndirect C.GPDRAWARRAYSINDIRECT
+ gpDrawArraysInstanced C.GPDRAWARRAYSINSTANCED
+ gpDrawArraysInstancedARB C.GPDRAWARRAYSINSTANCEDARB
+ gpDrawArraysInstancedBaseInstance C.GPDRAWARRAYSINSTANCEDBASEINSTANCE
+ gpDrawArraysInstancedEXT C.GPDRAWARRAYSINSTANCEDEXT
+ gpDrawBuffer C.GPDRAWBUFFER
+ gpDrawBuffers C.GPDRAWBUFFERS
+ gpDrawCommandsAddressNV C.GPDRAWCOMMANDSADDRESSNV
+ gpDrawCommandsNV C.GPDRAWCOMMANDSNV
+ gpDrawCommandsStatesAddressNV C.GPDRAWCOMMANDSSTATESADDRESSNV
+ gpDrawCommandsStatesNV C.GPDRAWCOMMANDSSTATESNV
+ gpDrawElements C.GPDRAWELEMENTS
+ gpDrawElementsBaseVertex C.GPDRAWELEMENTSBASEVERTEX
+ gpDrawElementsIndirect C.GPDRAWELEMENTSINDIRECT
+ gpDrawElementsInstanced C.GPDRAWELEMENTSINSTANCED
+ gpDrawElementsInstancedARB C.GPDRAWELEMENTSINSTANCEDARB
+ gpDrawElementsInstancedBaseInstance C.GPDRAWELEMENTSINSTANCEDBASEINSTANCE
+ gpDrawElementsInstancedBaseVertex C.GPDRAWELEMENTSINSTANCEDBASEVERTEX
+ gpDrawElementsInstancedBaseVertexBaseInstance C.GPDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCE
+ gpDrawElementsInstancedEXT C.GPDRAWELEMENTSINSTANCEDEXT
+ gpDrawMeshTasksIndirectNV C.GPDRAWMESHTASKSINDIRECTNV
+ gpDrawMeshTasksNV C.GPDRAWMESHTASKSNV
+ gpDrawRangeElements C.GPDRAWRANGEELEMENTS
+ gpDrawRangeElementsBaseVertex C.GPDRAWRANGEELEMENTSBASEVERTEX
+ gpDrawTransformFeedback C.GPDRAWTRANSFORMFEEDBACK
+ gpDrawTransformFeedbackInstanced C.GPDRAWTRANSFORMFEEDBACKINSTANCED
+ gpDrawTransformFeedbackStream C.GPDRAWTRANSFORMFEEDBACKSTREAM
+ gpDrawTransformFeedbackStreamInstanced C.GPDRAWTRANSFORMFEEDBACKSTREAMINSTANCED
+ gpDrawVkImageNV C.GPDRAWVKIMAGENV
+ gpEGLImageTargetTexStorageEXT C.GPEGLIMAGETARGETTEXSTORAGEEXT
+ gpEGLImageTargetTextureStorageEXT C.GPEGLIMAGETARGETTEXTURESTORAGEEXT
+ gpEdgeFlagFormatNV C.GPEDGEFLAGFORMATNV
+ gpEnable C.GPENABLE
+ gpEnableClientStateIndexedEXT C.GPENABLECLIENTSTATEINDEXEDEXT
+ gpEnableClientStateiEXT C.GPENABLECLIENTSTATEIEXT
+ gpEnableIndexedEXT C.GPENABLEINDEXEDEXT
+ gpEnableVertexArrayAttrib C.GPENABLEVERTEXARRAYATTRIB
+ gpEnableVertexArrayAttribEXT C.GPENABLEVERTEXARRAYATTRIBEXT
+ gpEnableVertexArrayEXT C.GPENABLEVERTEXARRAYEXT
+ gpEnableVertexAttribArray C.GPENABLEVERTEXATTRIBARRAY
+ gpEnablei C.GPENABLEI
+ gpEndConditionalRender C.GPENDCONDITIONALRENDER
+ gpEndConditionalRenderNV C.GPENDCONDITIONALRENDERNV
+ gpEndPerfMonitorAMD C.GPENDPERFMONITORAMD
+ gpEndPerfQueryINTEL C.GPENDPERFQUERYINTEL
+ gpEndQuery C.GPENDQUERY
+ gpEndQueryIndexed C.GPENDQUERYINDEXED
+ gpEndTransformFeedback C.GPENDTRANSFORMFEEDBACK
+ gpEvaluateDepthValuesARB C.GPEVALUATEDEPTHVALUESARB
+ gpFenceSync C.GPFENCESYNC
+ gpFinish C.GPFINISH
+ gpFlush C.GPFLUSH
+ gpFlushMappedBufferRange C.GPFLUSHMAPPEDBUFFERRANGE
+ gpFlushMappedNamedBufferRange C.GPFLUSHMAPPEDNAMEDBUFFERRANGE
+ gpFlushMappedNamedBufferRangeEXT C.GPFLUSHMAPPEDNAMEDBUFFERRANGEEXT
+ gpFogCoordFormatNV C.GPFOGCOORDFORMATNV
+ gpFragmentCoverageColorNV C.GPFRAGMENTCOVERAGECOLORNV
+ gpFramebufferDrawBufferEXT C.GPFRAMEBUFFERDRAWBUFFEREXT
+ gpFramebufferDrawBuffersEXT C.GPFRAMEBUFFERDRAWBUFFERSEXT
+ gpFramebufferFetchBarrierEXT C.GPFRAMEBUFFERFETCHBARRIEREXT
+ gpFramebufferParameteri C.GPFRAMEBUFFERPARAMETERI
+ gpFramebufferParameteriMESA C.GPFRAMEBUFFERPARAMETERIMESA
+ gpFramebufferReadBufferEXT C.GPFRAMEBUFFERREADBUFFEREXT
+ gpFramebufferRenderbuffer C.GPFRAMEBUFFERRENDERBUFFER
+ gpFramebufferSampleLocationsfvARB C.GPFRAMEBUFFERSAMPLELOCATIONSFVARB
+ gpFramebufferSampleLocationsfvNV C.GPFRAMEBUFFERSAMPLELOCATIONSFVNV
+ gpFramebufferTexture C.GPFRAMEBUFFERTEXTURE
+ gpFramebufferTexture1D C.GPFRAMEBUFFERTEXTURE1D
+ gpFramebufferTexture2D C.GPFRAMEBUFFERTEXTURE2D
+ gpFramebufferTexture3D C.GPFRAMEBUFFERTEXTURE3D
+ gpFramebufferTextureARB C.GPFRAMEBUFFERTEXTUREARB
+ gpFramebufferTextureFaceARB C.GPFRAMEBUFFERTEXTUREFACEARB
+ gpFramebufferTextureLayer C.GPFRAMEBUFFERTEXTURELAYER
+ gpFramebufferTextureLayerARB C.GPFRAMEBUFFERTEXTURELAYERARB
+ gpFramebufferTextureMultiviewOVR C.GPFRAMEBUFFERTEXTUREMULTIVIEWOVR
+ gpFrontFace C.GPFRONTFACE
+ gpGenBuffers C.GPGENBUFFERS
+ gpGenFramebuffers C.GPGENFRAMEBUFFERS
+ gpGenPathsNV C.GPGENPATHSNV
+ gpGenPerfMonitorsAMD C.GPGENPERFMONITORSAMD
+ gpGenProgramPipelines C.GPGENPROGRAMPIPELINES
+ gpGenProgramPipelinesEXT C.GPGENPROGRAMPIPELINESEXT
+ gpGenQueries C.GPGENQUERIES
+ gpGenRenderbuffers C.GPGENRENDERBUFFERS
+ gpGenSamplers C.GPGENSAMPLERS
+ gpGenTextures C.GPGENTEXTURES
+ gpGenTransformFeedbacks C.GPGENTRANSFORMFEEDBACKS
+ gpGenVertexArrays C.GPGENVERTEXARRAYS
+ gpGenerateMipmap C.GPGENERATEMIPMAP
+ gpGenerateMultiTexMipmapEXT C.GPGENERATEMULTITEXMIPMAPEXT
+ gpGenerateTextureMipmap C.GPGENERATETEXTUREMIPMAP
+ gpGenerateTextureMipmapEXT C.GPGENERATETEXTUREMIPMAPEXT
+ gpGetActiveAtomicCounterBufferiv C.GPGETACTIVEATOMICCOUNTERBUFFERIV
+ gpGetActiveAttrib C.GPGETACTIVEATTRIB
+ gpGetActiveSubroutineName C.GPGETACTIVESUBROUTINENAME
+ gpGetActiveSubroutineUniformName C.GPGETACTIVESUBROUTINEUNIFORMNAME
+ gpGetActiveSubroutineUniformiv C.GPGETACTIVESUBROUTINEUNIFORMIV
+ gpGetActiveUniform C.GPGETACTIVEUNIFORM
+ gpGetActiveUniformBlockName C.GPGETACTIVEUNIFORMBLOCKNAME
+ gpGetActiveUniformBlockiv C.GPGETACTIVEUNIFORMBLOCKIV
+ gpGetActiveUniformName C.GPGETACTIVEUNIFORMNAME
+ gpGetActiveUniformsiv C.GPGETACTIVEUNIFORMSIV
+ gpGetAttachedShaders C.GPGETATTACHEDSHADERS
+ gpGetAttribLocation C.GPGETATTRIBLOCATION
+ gpGetBooleanIndexedvEXT C.GPGETBOOLEANINDEXEDVEXT
+ gpGetBooleani_v C.GPGETBOOLEANI_V
+ gpGetBooleanv C.GPGETBOOLEANV
+ gpGetBufferParameteri64v C.GPGETBUFFERPARAMETERI64V
+ gpGetBufferParameteriv C.GPGETBUFFERPARAMETERIV
+ gpGetBufferParameterui64vNV C.GPGETBUFFERPARAMETERUI64VNV
+ gpGetBufferPointerv C.GPGETBUFFERPOINTERV
+ gpGetBufferSubData C.GPGETBUFFERSUBDATA
+ gpGetCommandHeaderNV C.GPGETCOMMANDHEADERNV
+ gpGetCompressedMultiTexImageEXT C.GPGETCOMPRESSEDMULTITEXIMAGEEXT
+ gpGetCompressedTexImage C.GPGETCOMPRESSEDTEXIMAGE
+ gpGetCompressedTextureImage C.GPGETCOMPRESSEDTEXTUREIMAGE
+ gpGetCompressedTextureImageEXT C.GPGETCOMPRESSEDTEXTUREIMAGEEXT
+ gpGetCompressedTextureSubImage C.GPGETCOMPRESSEDTEXTURESUBIMAGE
+ gpGetCoverageModulationTableNV C.GPGETCOVERAGEMODULATIONTABLENV
+ gpGetDebugMessageLog C.GPGETDEBUGMESSAGELOG
+ gpGetDebugMessageLogARB C.GPGETDEBUGMESSAGELOGARB
+ gpGetDebugMessageLogKHR C.GPGETDEBUGMESSAGELOGKHR
+ gpGetDoubleIndexedvEXT C.GPGETDOUBLEINDEXEDVEXT
+ gpGetDoublei_v C.GPGETDOUBLEI_V
+ gpGetDoublei_vEXT C.GPGETDOUBLEI_VEXT
+ gpGetDoublev C.GPGETDOUBLEV
+ gpGetError C.GPGETERROR
+ gpGetFirstPerfQueryIdINTEL C.GPGETFIRSTPERFQUERYIDINTEL
+ gpGetFloatIndexedvEXT C.GPGETFLOATINDEXEDVEXT
+ gpGetFloati_v C.GPGETFLOATI_V
+ gpGetFloati_vEXT C.GPGETFLOATI_VEXT
+ gpGetFloatv C.GPGETFLOATV
+ gpGetFragDataIndex C.GPGETFRAGDATAINDEX
+ gpGetFragDataLocation C.GPGETFRAGDATALOCATION
+ gpGetFramebufferAttachmentParameteriv C.GPGETFRAMEBUFFERATTACHMENTPARAMETERIV
+ gpGetFramebufferParameteriv C.GPGETFRAMEBUFFERPARAMETERIV
+ gpGetFramebufferParameterivEXT C.GPGETFRAMEBUFFERPARAMETERIVEXT
+ gpGetFramebufferParameterivMESA C.GPGETFRAMEBUFFERPARAMETERIVMESA
+ gpGetGraphicsResetStatus C.GPGETGRAPHICSRESETSTATUS
+ gpGetGraphicsResetStatusARB C.GPGETGRAPHICSRESETSTATUSARB
+ gpGetGraphicsResetStatusKHR C.GPGETGRAPHICSRESETSTATUSKHR
+ gpGetImageHandleARB C.GPGETIMAGEHANDLEARB
+ gpGetImageHandleNV C.GPGETIMAGEHANDLENV
+ gpGetInteger64i_v C.GPGETINTEGER64I_V
+ gpGetInteger64v C.GPGETINTEGER64V
+ gpGetIntegerIndexedvEXT C.GPGETINTEGERINDEXEDVEXT
+ gpGetIntegeri_v C.GPGETINTEGERI_V
+ gpGetIntegerui64i_vNV C.GPGETINTEGERUI64I_VNV
+ gpGetIntegerui64vNV C.GPGETINTEGERUI64VNV
+ gpGetIntegerv C.GPGETINTEGERV
+ gpGetInternalformatSampleivNV C.GPGETINTERNALFORMATSAMPLEIVNV
+ gpGetInternalformati64v C.GPGETINTERNALFORMATI64V
+ gpGetInternalformativ C.GPGETINTERNALFORMATIV
+ gpGetMemoryObjectDetachedResourcesuivNV C.GPGETMEMORYOBJECTDETACHEDRESOURCESUIVNV
+ gpGetMultiTexEnvfvEXT C.GPGETMULTITEXENVFVEXT
+ gpGetMultiTexEnvivEXT C.GPGETMULTITEXENVIVEXT
+ gpGetMultiTexGendvEXT C.GPGETMULTITEXGENDVEXT
+ gpGetMultiTexGenfvEXT C.GPGETMULTITEXGENFVEXT
+ gpGetMultiTexGenivEXT C.GPGETMULTITEXGENIVEXT
+ gpGetMultiTexImageEXT C.GPGETMULTITEXIMAGEEXT
+ gpGetMultiTexLevelParameterfvEXT C.GPGETMULTITEXLEVELPARAMETERFVEXT
+ gpGetMultiTexLevelParameterivEXT C.GPGETMULTITEXLEVELPARAMETERIVEXT
+ gpGetMultiTexParameterIivEXT C.GPGETMULTITEXPARAMETERIIVEXT
+ gpGetMultiTexParameterIuivEXT C.GPGETMULTITEXPARAMETERIUIVEXT
+ gpGetMultiTexParameterfvEXT C.GPGETMULTITEXPARAMETERFVEXT
+ gpGetMultiTexParameterivEXT C.GPGETMULTITEXPARAMETERIVEXT
+ gpGetMultisamplefv C.GPGETMULTISAMPLEFV
+ gpGetNamedBufferParameteri64v C.GPGETNAMEDBUFFERPARAMETERI64V
+ gpGetNamedBufferParameteriv C.GPGETNAMEDBUFFERPARAMETERIV
+ gpGetNamedBufferParameterivEXT C.GPGETNAMEDBUFFERPARAMETERIVEXT
+ gpGetNamedBufferParameterui64vNV C.GPGETNAMEDBUFFERPARAMETERUI64VNV
+ gpGetNamedBufferPointerv C.GPGETNAMEDBUFFERPOINTERV
+ gpGetNamedBufferPointervEXT C.GPGETNAMEDBUFFERPOINTERVEXT
+ gpGetNamedBufferSubData C.GPGETNAMEDBUFFERSUBDATA
+ gpGetNamedBufferSubDataEXT C.GPGETNAMEDBUFFERSUBDATAEXT
+ gpGetNamedFramebufferAttachmentParameteriv C.GPGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIV
+ gpGetNamedFramebufferAttachmentParameterivEXT C.GPGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXT
+ gpGetNamedFramebufferParameteriv C.GPGETNAMEDFRAMEBUFFERPARAMETERIV
+ gpGetNamedFramebufferParameterivEXT C.GPGETNAMEDFRAMEBUFFERPARAMETERIVEXT
+ gpGetNamedProgramLocalParameterIivEXT C.GPGETNAMEDPROGRAMLOCALPARAMETERIIVEXT
+ gpGetNamedProgramLocalParameterIuivEXT C.GPGETNAMEDPROGRAMLOCALPARAMETERIUIVEXT
+ gpGetNamedProgramLocalParameterdvEXT C.GPGETNAMEDPROGRAMLOCALPARAMETERDVEXT
+ gpGetNamedProgramLocalParameterfvEXT C.GPGETNAMEDPROGRAMLOCALPARAMETERFVEXT
+ gpGetNamedProgramStringEXT C.GPGETNAMEDPROGRAMSTRINGEXT
+ gpGetNamedProgramivEXT C.GPGETNAMEDPROGRAMIVEXT
+ gpGetNamedRenderbufferParameteriv C.GPGETNAMEDRENDERBUFFERPARAMETERIV
+ gpGetNamedRenderbufferParameterivEXT C.GPGETNAMEDRENDERBUFFERPARAMETERIVEXT
+ gpGetNamedStringARB C.GPGETNAMEDSTRINGARB
+ gpGetNamedStringivARB C.GPGETNAMEDSTRINGIVARB
+ gpGetNextPerfQueryIdINTEL C.GPGETNEXTPERFQUERYIDINTEL
+ gpGetObjectLabel C.GPGETOBJECTLABEL
+ gpGetObjectLabelEXT C.GPGETOBJECTLABELEXT
+ gpGetObjectLabelKHR C.GPGETOBJECTLABELKHR
+ gpGetObjectPtrLabel C.GPGETOBJECTPTRLABEL
+ gpGetObjectPtrLabelKHR C.GPGETOBJECTPTRLABELKHR
+ gpGetPathCommandsNV C.GPGETPATHCOMMANDSNV
+ gpGetPathCoordsNV C.GPGETPATHCOORDSNV
+ gpGetPathDashArrayNV C.GPGETPATHDASHARRAYNV
+ gpGetPathLengthNV C.GPGETPATHLENGTHNV
+ gpGetPathMetricRangeNV C.GPGETPATHMETRICRANGENV
+ gpGetPathMetricsNV C.GPGETPATHMETRICSNV
+ gpGetPathParameterfvNV C.GPGETPATHPARAMETERFVNV
+ gpGetPathParameterivNV C.GPGETPATHPARAMETERIVNV
+ gpGetPathSpacingNV C.GPGETPATHSPACINGNV
+ gpGetPerfCounterInfoINTEL C.GPGETPERFCOUNTERINFOINTEL
+ gpGetPerfMonitorCounterDataAMD C.GPGETPERFMONITORCOUNTERDATAAMD
+ gpGetPerfMonitorCounterInfoAMD C.GPGETPERFMONITORCOUNTERINFOAMD
+ gpGetPerfMonitorCounterStringAMD C.GPGETPERFMONITORCOUNTERSTRINGAMD
+ gpGetPerfMonitorCountersAMD C.GPGETPERFMONITORCOUNTERSAMD
+ gpGetPerfMonitorGroupStringAMD C.GPGETPERFMONITORGROUPSTRINGAMD
+ gpGetPerfMonitorGroupsAMD C.GPGETPERFMONITORGROUPSAMD
+ gpGetPerfQueryDataINTEL C.GPGETPERFQUERYDATAINTEL
+ gpGetPerfQueryIdByNameINTEL C.GPGETPERFQUERYIDBYNAMEINTEL
+ gpGetPerfQueryInfoINTEL C.GPGETPERFQUERYINFOINTEL
+ gpGetPointerIndexedvEXT C.GPGETPOINTERINDEXEDVEXT
+ gpGetPointeri_vEXT C.GPGETPOINTERI_VEXT
+ gpGetPointerv C.GPGETPOINTERV
+ gpGetPointervKHR C.GPGETPOINTERVKHR
+ gpGetProgramBinary C.GPGETPROGRAMBINARY
+ gpGetProgramInfoLog C.GPGETPROGRAMINFOLOG
+ gpGetProgramInterfaceiv C.GPGETPROGRAMINTERFACEIV
+ gpGetProgramPipelineInfoLog C.GPGETPROGRAMPIPELINEINFOLOG
+ gpGetProgramPipelineInfoLogEXT C.GPGETPROGRAMPIPELINEINFOLOGEXT
+ gpGetProgramPipelineiv C.GPGETPROGRAMPIPELINEIV
+ gpGetProgramPipelineivEXT C.GPGETPROGRAMPIPELINEIVEXT
+ gpGetProgramResourceIndex C.GPGETPROGRAMRESOURCEINDEX
+ gpGetProgramResourceLocation C.GPGETPROGRAMRESOURCELOCATION
+ gpGetProgramResourceLocationIndex C.GPGETPROGRAMRESOURCELOCATIONINDEX
+ gpGetProgramResourceName C.GPGETPROGRAMRESOURCENAME
+ gpGetProgramResourcefvNV C.GPGETPROGRAMRESOURCEFVNV
+ gpGetProgramResourceiv C.GPGETPROGRAMRESOURCEIV
+ gpGetProgramStageiv C.GPGETPROGRAMSTAGEIV
+ gpGetProgramiv C.GPGETPROGRAMIV
+ gpGetQueryBufferObjecti64v C.GPGETQUERYBUFFEROBJECTI64V
+ gpGetQueryBufferObjectiv C.GPGETQUERYBUFFEROBJECTIV
+ gpGetQueryBufferObjectui64v C.GPGETQUERYBUFFEROBJECTUI64V
+ gpGetQueryBufferObjectuiv C.GPGETQUERYBUFFEROBJECTUIV
+ gpGetQueryIndexediv C.GPGETQUERYINDEXEDIV
+ gpGetQueryObjecti64v C.GPGETQUERYOBJECTI64V
+ gpGetQueryObjectiv C.GPGETQUERYOBJECTIV
+ gpGetQueryObjectui64v C.GPGETQUERYOBJECTUI64V
+ gpGetQueryObjectuiv C.GPGETQUERYOBJECTUIV
+ gpGetQueryiv C.GPGETQUERYIV
+ gpGetRenderbufferParameteriv C.GPGETRENDERBUFFERPARAMETERIV
+ gpGetSamplerParameterIiv C.GPGETSAMPLERPARAMETERIIV
+ gpGetSamplerParameterIuiv C.GPGETSAMPLERPARAMETERIUIV
+ gpGetSamplerParameterfv C.GPGETSAMPLERPARAMETERFV
+ gpGetSamplerParameteriv C.GPGETSAMPLERPARAMETERIV
+ gpGetShaderInfoLog C.GPGETSHADERINFOLOG
+ gpGetShaderPrecisionFormat C.GPGETSHADERPRECISIONFORMAT
+ gpGetShaderSource C.GPGETSHADERSOURCE
+ gpGetShaderiv C.GPGETSHADERIV
+ gpGetShadingRateImagePaletteNV C.GPGETSHADINGRATEIMAGEPALETTENV
+ gpGetShadingRateSampleLocationivNV C.GPGETSHADINGRATESAMPLELOCATIONIVNV
+ gpGetStageIndexNV C.GPGETSTAGEINDEXNV
+ gpGetString C.GPGETSTRING
+ gpGetStringi C.GPGETSTRINGI
+ gpGetSubroutineIndex C.GPGETSUBROUTINEINDEX
+ gpGetSubroutineUniformLocation C.GPGETSUBROUTINEUNIFORMLOCATION
+ gpGetSynciv C.GPGETSYNCIV
+ gpGetTexImage C.GPGETTEXIMAGE
+ gpGetTexLevelParameterfv C.GPGETTEXLEVELPARAMETERFV
+ gpGetTexLevelParameteriv C.GPGETTEXLEVELPARAMETERIV
+ gpGetTexParameterIiv C.GPGETTEXPARAMETERIIV
+ gpGetTexParameterIuiv C.GPGETTEXPARAMETERIUIV
+ gpGetTexParameterfv C.GPGETTEXPARAMETERFV
+ gpGetTexParameteriv C.GPGETTEXPARAMETERIV
+ gpGetTextureHandleARB C.GPGETTEXTUREHANDLEARB
+ gpGetTextureHandleNV C.GPGETTEXTUREHANDLENV
+ gpGetTextureImage C.GPGETTEXTUREIMAGE
+ gpGetTextureImageEXT C.GPGETTEXTUREIMAGEEXT
+ gpGetTextureLevelParameterfv C.GPGETTEXTURELEVELPARAMETERFV
+ gpGetTextureLevelParameterfvEXT C.GPGETTEXTURELEVELPARAMETERFVEXT
+ gpGetTextureLevelParameteriv C.GPGETTEXTURELEVELPARAMETERIV
+ gpGetTextureLevelParameterivEXT C.GPGETTEXTURELEVELPARAMETERIVEXT
+ gpGetTextureParameterIiv C.GPGETTEXTUREPARAMETERIIV
+ gpGetTextureParameterIivEXT C.GPGETTEXTUREPARAMETERIIVEXT
+ gpGetTextureParameterIuiv C.GPGETTEXTUREPARAMETERIUIV
+ gpGetTextureParameterIuivEXT C.GPGETTEXTUREPARAMETERIUIVEXT
+ gpGetTextureParameterfv C.GPGETTEXTUREPARAMETERFV
+ gpGetTextureParameterfvEXT C.GPGETTEXTUREPARAMETERFVEXT
+ gpGetTextureParameteriv C.GPGETTEXTUREPARAMETERIV
+ gpGetTextureParameterivEXT C.GPGETTEXTUREPARAMETERIVEXT
+ gpGetTextureSamplerHandleARB C.GPGETTEXTURESAMPLERHANDLEARB
+ gpGetTextureSamplerHandleNV C.GPGETTEXTURESAMPLERHANDLENV
+ gpGetTextureSubImage C.GPGETTEXTURESUBIMAGE
+ gpGetTransformFeedbackVarying C.GPGETTRANSFORMFEEDBACKVARYING
+ gpGetTransformFeedbacki64_v C.GPGETTRANSFORMFEEDBACKI64_V
+ gpGetTransformFeedbacki_v C.GPGETTRANSFORMFEEDBACKI_V
+ gpGetTransformFeedbackiv C.GPGETTRANSFORMFEEDBACKIV
+ gpGetUniformBlockIndex C.GPGETUNIFORMBLOCKINDEX
+ gpGetUniformIndices C.GPGETUNIFORMINDICES
+ gpGetUniformLocation C.GPGETUNIFORMLOCATION
+ gpGetUniformSubroutineuiv C.GPGETUNIFORMSUBROUTINEUIV
+ gpGetUniformdv C.GPGETUNIFORMDV
+ gpGetUniformfv C.GPGETUNIFORMFV
+ gpGetUniformi64vARB C.GPGETUNIFORMI64VARB
+ gpGetUniformi64vNV C.GPGETUNIFORMI64VNV
+ gpGetUniformiv C.GPGETUNIFORMIV
+ gpGetUniformui64vARB C.GPGETUNIFORMUI64VARB
+ gpGetUniformui64vNV C.GPGETUNIFORMUI64VNV
+ gpGetUniformuiv C.GPGETUNIFORMUIV
+ gpGetVertexArrayIndexed64iv C.GPGETVERTEXARRAYINDEXED64IV
+ gpGetVertexArrayIndexediv C.GPGETVERTEXARRAYINDEXEDIV
+ gpGetVertexArrayIntegeri_vEXT C.GPGETVERTEXARRAYINTEGERI_VEXT
+ gpGetVertexArrayIntegervEXT C.GPGETVERTEXARRAYINTEGERVEXT
+ gpGetVertexArrayPointeri_vEXT C.GPGETVERTEXARRAYPOINTERI_VEXT
+ gpGetVertexArrayPointervEXT C.GPGETVERTEXARRAYPOINTERVEXT
+ gpGetVertexArrayiv C.GPGETVERTEXARRAYIV
+ gpGetVertexAttribIiv C.GPGETVERTEXATTRIBIIV
+ gpGetVertexAttribIuiv C.GPGETVERTEXATTRIBIUIV
+ gpGetVertexAttribLdv C.GPGETVERTEXATTRIBLDV
+ gpGetVertexAttribLi64vNV C.GPGETVERTEXATTRIBLI64VNV
+ gpGetVertexAttribLui64vARB C.GPGETVERTEXATTRIBLUI64VARB
+ gpGetVertexAttribLui64vNV C.GPGETVERTEXATTRIBLUI64VNV
+ gpGetVertexAttribPointerv C.GPGETVERTEXATTRIBPOINTERV
+ gpGetVertexAttribdv C.GPGETVERTEXATTRIBDV
+ gpGetVertexAttribfv C.GPGETVERTEXATTRIBFV
+ gpGetVertexAttribiv C.GPGETVERTEXATTRIBIV
+ gpGetVkProcAddrNV C.GPGETVKPROCADDRNV
+ gpGetnCompressedTexImageARB C.GPGETNCOMPRESSEDTEXIMAGEARB
+ gpGetnTexImageARB C.GPGETNTEXIMAGEARB
+ gpGetnUniformdvARB C.GPGETNUNIFORMDVARB
+ gpGetnUniformfv C.GPGETNUNIFORMFV
+ gpGetnUniformfvARB C.GPGETNUNIFORMFVARB
+ gpGetnUniformfvKHR C.GPGETNUNIFORMFVKHR
+ gpGetnUniformi64vARB C.GPGETNUNIFORMI64VARB
+ gpGetnUniformiv C.GPGETNUNIFORMIV
+ gpGetnUniformivARB C.GPGETNUNIFORMIVARB
+ gpGetnUniformivKHR C.GPGETNUNIFORMIVKHR
+ gpGetnUniformui64vARB C.GPGETNUNIFORMUI64VARB
+ gpGetnUniformuiv C.GPGETNUNIFORMUIV
+ gpGetnUniformuivARB C.GPGETNUNIFORMUIVARB
+ gpGetnUniformuivKHR C.GPGETNUNIFORMUIVKHR
+ gpHint C.GPHINT
+ gpIndexFormatNV C.GPINDEXFORMATNV
+ gpInsertEventMarkerEXT C.GPINSERTEVENTMARKEREXT
+ gpInterpolatePathsNV C.GPINTERPOLATEPATHSNV
+ gpInvalidateBufferData C.GPINVALIDATEBUFFERDATA
+ gpInvalidateBufferSubData C.GPINVALIDATEBUFFERSUBDATA
+ gpInvalidateFramebuffer C.GPINVALIDATEFRAMEBUFFER
+ gpInvalidateNamedFramebufferData C.GPINVALIDATENAMEDFRAMEBUFFERDATA
+ gpInvalidateNamedFramebufferSubData C.GPINVALIDATENAMEDFRAMEBUFFERSUBDATA
+ gpInvalidateSubFramebuffer C.GPINVALIDATESUBFRAMEBUFFER
+ gpInvalidateTexImage C.GPINVALIDATETEXIMAGE
+ gpInvalidateTexSubImage C.GPINVALIDATETEXSUBIMAGE
+ gpIsBuffer C.GPISBUFFER
+ gpIsBufferResidentNV C.GPISBUFFERRESIDENTNV
+ gpIsCommandListNV C.GPISCOMMANDLISTNV
+ gpIsEnabled C.GPISENABLED
+ gpIsEnabledIndexedEXT C.GPISENABLEDINDEXEDEXT
+ gpIsEnabledi C.GPISENABLEDI
+ gpIsFramebuffer C.GPISFRAMEBUFFER
+ gpIsImageHandleResidentARB C.GPISIMAGEHANDLERESIDENTARB
+ gpIsImageHandleResidentNV C.GPISIMAGEHANDLERESIDENTNV
+ gpIsNamedBufferResidentNV C.GPISNAMEDBUFFERRESIDENTNV
+ gpIsNamedStringARB C.GPISNAMEDSTRINGARB
+ gpIsPathNV C.GPISPATHNV
+ gpIsPointInFillPathNV C.GPISPOINTINFILLPATHNV
+ gpIsPointInStrokePathNV C.GPISPOINTINSTROKEPATHNV
+ gpIsProgram C.GPISPROGRAM
+ gpIsProgramPipeline C.GPISPROGRAMPIPELINE
+ gpIsProgramPipelineEXT C.GPISPROGRAMPIPELINEEXT
+ gpIsQuery C.GPISQUERY
+ gpIsRenderbuffer C.GPISRENDERBUFFER
+ gpIsSampler C.GPISSAMPLER
+ gpIsShader C.GPISSHADER
+ gpIsStateNV C.GPISSTATENV
+ gpIsSync C.GPISSYNC
+ gpIsTexture C.GPISTEXTURE
+ gpIsTextureHandleResidentARB C.GPISTEXTUREHANDLERESIDENTARB
+ gpIsTextureHandleResidentNV C.GPISTEXTUREHANDLERESIDENTNV
+ gpIsTransformFeedback C.GPISTRANSFORMFEEDBACK
+ gpIsVertexArray C.GPISVERTEXARRAY
+ gpLabelObjectEXT C.GPLABELOBJECTEXT
+ gpLineWidth C.GPLINEWIDTH
+ gpLinkProgram C.GPLINKPROGRAM
+ gpListDrawCommandsStatesClientNV C.GPLISTDRAWCOMMANDSSTATESCLIENTNV
+ gpLogicOp C.GPLOGICOP
+ gpMakeBufferNonResidentNV C.GPMAKEBUFFERNONRESIDENTNV
+ gpMakeBufferResidentNV C.GPMAKEBUFFERRESIDENTNV
+ gpMakeImageHandleNonResidentARB C.GPMAKEIMAGEHANDLENONRESIDENTARB
+ gpMakeImageHandleNonResidentNV C.GPMAKEIMAGEHANDLENONRESIDENTNV
+ gpMakeImageHandleResidentARB C.GPMAKEIMAGEHANDLERESIDENTARB
+ gpMakeImageHandleResidentNV C.GPMAKEIMAGEHANDLERESIDENTNV
+ gpMakeNamedBufferNonResidentNV C.GPMAKENAMEDBUFFERNONRESIDENTNV
+ gpMakeNamedBufferResidentNV C.GPMAKENAMEDBUFFERRESIDENTNV
+ gpMakeTextureHandleNonResidentARB C.GPMAKETEXTUREHANDLENONRESIDENTARB
+ gpMakeTextureHandleNonResidentNV C.GPMAKETEXTUREHANDLENONRESIDENTNV
+ gpMakeTextureHandleResidentARB C.GPMAKETEXTUREHANDLERESIDENTARB
+ gpMakeTextureHandleResidentNV C.GPMAKETEXTUREHANDLERESIDENTNV
+ gpMapBuffer C.GPMAPBUFFER
+ gpMapBufferRange C.GPMAPBUFFERRANGE
+ gpMapNamedBuffer C.GPMAPNAMEDBUFFER
+ gpMapNamedBufferEXT C.GPMAPNAMEDBUFFEREXT
+ gpMapNamedBufferRange C.GPMAPNAMEDBUFFERRANGE
+ gpMapNamedBufferRangeEXT C.GPMAPNAMEDBUFFERRANGEEXT
+ gpMatrixFrustumEXT C.GPMATRIXFRUSTUMEXT
+ gpMatrixLoad3x2fNV C.GPMATRIXLOAD3X2FNV
+ gpMatrixLoad3x3fNV C.GPMATRIXLOAD3X3FNV
+ gpMatrixLoadIdentityEXT C.GPMATRIXLOADIDENTITYEXT
+ gpMatrixLoadTranspose3x3fNV C.GPMATRIXLOADTRANSPOSE3X3FNV
+ gpMatrixLoadTransposedEXT C.GPMATRIXLOADTRANSPOSEDEXT
+ gpMatrixLoadTransposefEXT C.GPMATRIXLOADTRANSPOSEFEXT
+ gpMatrixLoaddEXT C.GPMATRIXLOADDEXT
+ gpMatrixLoadfEXT C.GPMATRIXLOADFEXT
+ gpMatrixMult3x2fNV C.GPMATRIXMULT3X2FNV
+ gpMatrixMult3x3fNV C.GPMATRIXMULT3X3FNV
+ gpMatrixMultTranspose3x3fNV C.GPMATRIXMULTTRANSPOSE3X3FNV
+ gpMatrixMultTransposedEXT C.GPMATRIXMULTTRANSPOSEDEXT
+ gpMatrixMultTransposefEXT C.GPMATRIXMULTTRANSPOSEFEXT
+ gpMatrixMultdEXT C.GPMATRIXMULTDEXT
+ gpMatrixMultfEXT C.GPMATRIXMULTFEXT
+ gpMatrixOrthoEXT C.GPMATRIXORTHOEXT
+ gpMatrixPopEXT C.GPMATRIXPOPEXT
+ gpMatrixPushEXT C.GPMATRIXPUSHEXT
+ gpMatrixRotatedEXT C.GPMATRIXROTATEDEXT
+ gpMatrixRotatefEXT C.GPMATRIXROTATEFEXT
+ gpMatrixScaledEXT C.GPMATRIXSCALEDEXT
+ gpMatrixScalefEXT C.GPMATRIXSCALEFEXT
+ gpMatrixTranslatedEXT C.GPMATRIXTRANSLATEDEXT
+ gpMatrixTranslatefEXT C.GPMATRIXTRANSLATEFEXT
+ gpMaxShaderCompilerThreadsARB C.GPMAXSHADERCOMPILERTHREADSARB
+ gpMaxShaderCompilerThreadsKHR C.GPMAXSHADERCOMPILERTHREADSKHR
+ gpMemoryBarrier C.GPMEMORYBARRIER
+ gpMemoryBarrierByRegion C.GPMEMORYBARRIERBYREGION
+ gpMinSampleShadingARB C.GPMINSAMPLESHADINGARB
+ gpMultiDrawArrays C.GPMULTIDRAWARRAYS
+ gpMultiDrawArraysIndirect C.GPMULTIDRAWARRAYSINDIRECT
+ gpMultiDrawArraysIndirectBindlessCountNV C.GPMULTIDRAWARRAYSINDIRECTBINDLESSCOUNTNV
+ gpMultiDrawArraysIndirectBindlessNV C.GPMULTIDRAWARRAYSINDIRECTBINDLESSNV
+ gpMultiDrawArraysIndirectCountARB C.GPMULTIDRAWARRAYSINDIRECTCOUNTARB
+ gpMultiDrawElements C.GPMULTIDRAWELEMENTS
+ gpMultiDrawElementsBaseVertex C.GPMULTIDRAWELEMENTSBASEVERTEX
+ gpMultiDrawElementsIndirect C.GPMULTIDRAWELEMENTSINDIRECT
+ gpMultiDrawElementsIndirectBindlessCountNV C.GPMULTIDRAWELEMENTSINDIRECTBINDLESSCOUNTNV
+ gpMultiDrawElementsIndirectBindlessNV C.GPMULTIDRAWELEMENTSINDIRECTBINDLESSNV
+ gpMultiDrawElementsIndirectCountARB C.GPMULTIDRAWELEMENTSINDIRECTCOUNTARB
+ gpMultiDrawMeshTasksIndirectCountNV C.GPMULTIDRAWMESHTASKSINDIRECTCOUNTNV
+ gpMultiDrawMeshTasksIndirectNV C.GPMULTIDRAWMESHTASKSINDIRECTNV
+ gpMultiTexBufferEXT C.GPMULTITEXBUFFEREXT
+ gpMultiTexCoordPointerEXT C.GPMULTITEXCOORDPOINTEREXT
+ gpMultiTexEnvfEXT C.GPMULTITEXENVFEXT
+ gpMultiTexEnvfvEXT C.GPMULTITEXENVFVEXT
+ gpMultiTexEnviEXT C.GPMULTITEXENVIEXT
+ gpMultiTexEnvivEXT C.GPMULTITEXENVIVEXT
+ gpMultiTexGendEXT C.GPMULTITEXGENDEXT
+ gpMultiTexGendvEXT C.GPMULTITEXGENDVEXT
+ gpMultiTexGenfEXT C.GPMULTITEXGENFEXT
+ gpMultiTexGenfvEXT C.GPMULTITEXGENFVEXT
+ gpMultiTexGeniEXT C.GPMULTITEXGENIEXT
+ gpMultiTexGenivEXT C.GPMULTITEXGENIVEXT
+ gpMultiTexImage1DEXT C.GPMULTITEXIMAGE1DEXT
+ gpMultiTexImage2DEXT C.GPMULTITEXIMAGE2DEXT
+ gpMultiTexImage3DEXT C.GPMULTITEXIMAGE3DEXT
+ gpMultiTexParameterIivEXT C.GPMULTITEXPARAMETERIIVEXT
+ gpMultiTexParameterIuivEXT C.GPMULTITEXPARAMETERIUIVEXT
+ gpMultiTexParameterfEXT C.GPMULTITEXPARAMETERFEXT
+ gpMultiTexParameterfvEXT C.GPMULTITEXPARAMETERFVEXT
+ gpMultiTexParameteriEXT C.GPMULTITEXPARAMETERIEXT
+ gpMultiTexParameterivEXT C.GPMULTITEXPARAMETERIVEXT
+ gpMultiTexRenderbufferEXT C.GPMULTITEXRENDERBUFFEREXT
+ gpMultiTexSubImage1DEXT C.GPMULTITEXSUBIMAGE1DEXT
+ gpMultiTexSubImage2DEXT C.GPMULTITEXSUBIMAGE2DEXT
+ gpMultiTexSubImage3DEXT C.GPMULTITEXSUBIMAGE3DEXT
+ gpNamedBufferAttachMemoryNV C.GPNAMEDBUFFERATTACHMEMORYNV
+ gpNamedBufferData C.GPNAMEDBUFFERDATA
+ gpNamedBufferDataEXT C.GPNAMEDBUFFERDATAEXT
+ gpNamedBufferPageCommitmentARB C.GPNAMEDBUFFERPAGECOMMITMENTARB
+ gpNamedBufferPageCommitmentEXT C.GPNAMEDBUFFERPAGECOMMITMENTEXT
+ gpNamedBufferPageCommitmentMemNV C.GPNAMEDBUFFERPAGECOMMITMENTMEMNV
+ gpNamedBufferStorage C.GPNAMEDBUFFERSTORAGE
+ gpNamedBufferStorageEXT C.GPNAMEDBUFFERSTORAGEEXT
+ gpNamedBufferSubData C.GPNAMEDBUFFERSUBDATA
+ gpNamedBufferSubDataEXT C.GPNAMEDBUFFERSUBDATAEXT
+ gpNamedCopyBufferSubDataEXT C.GPNAMEDCOPYBUFFERSUBDATAEXT
+ gpNamedFramebufferDrawBuffer C.GPNAMEDFRAMEBUFFERDRAWBUFFER
+ gpNamedFramebufferDrawBuffers C.GPNAMEDFRAMEBUFFERDRAWBUFFERS
+ gpNamedFramebufferParameteri C.GPNAMEDFRAMEBUFFERPARAMETERI
+ gpNamedFramebufferParameteriEXT C.GPNAMEDFRAMEBUFFERPARAMETERIEXT
+ gpNamedFramebufferReadBuffer C.GPNAMEDFRAMEBUFFERREADBUFFER
+ gpNamedFramebufferRenderbuffer C.GPNAMEDFRAMEBUFFERRENDERBUFFER
+ gpNamedFramebufferRenderbufferEXT C.GPNAMEDFRAMEBUFFERRENDERBUFFEREXT
+ gpNamedFramebufferSampleLocationsfvARB C.GPNAMEDFRAMEBUFFERSAMPLELOCATIONSFVARB
+ gpNamedFramebufferSampleLocationsfvNV C.GPNAMEDFRAMEBUFFERSAMPLELOCATIONSFVNV
+ gpNamedFramebufferTexture C.GPNAMEDFRAMEBUFFERTEXTURE
+ gpNamedFramebufferTexture1DEXT C.GPNAMEDFRAMEBUFFERTEXTURE1DEXT
+ gpNamedFramebufferTexture2DEXT C.GPNAMEDFRAMEBUFFERTEXTURE2DEXT
+ gpNamedFramebufferTexture3DEXT C.GPNAMEDFRAMEBUFFERTEXTURE3DEXT
+ gpNamedFramebufferTextureEXT C.GPNAMEDFRAMEBUFFERTEXTUREEXT
+ gpNamedFramebufferTextureFaceEXT C.GPNAMEDFRAMEBUFFERTEXTUREFACEEXT
+ gpNamedFramebufferTextureLayer C.GPNAMEDFRAMEBUFFERTEXTURELAYER
+ gpNamedFramebufferTextureLayerEXT C.GPNAMEDFRAMEBUFFERTEXTURELAYEREXT
+ gpNamedProgramLocalParameter4dEXT C.GPNAMEDPROGRAMLOCALPARAMETER4DEXT
+ gpNamedProgramLocalParameter4dvEXT C.GPNAMEDPROGRAMLOCALPARAMETER4DVEXT
+ gpNamedProgramLocalParameter4fEXT C.GPNAMEDPROGRAMLOCALPARAMETER4FEXT
+ gpNamedProgramLocalParameter4fvEXT C.GPNAMEDPROGRAMLOCALPARAMETER4FVEXT
+ gpNamedProgramLocalParameterI4iEXT C.GPNAMEDPROGRAMLOCALPARAMETERI4IEXT
+ gpNamedProgramLocalParameterI4ivEXT C.GPNAMEDPROGRAMLOCALPARAMETERI4IVEXT
+ gpNamedProgramLocalParameterI4uiEXT C.GPNAMEDPROGRAMLOCALPARAMETERI4UIEXT
+ gpNamedProgramLocalParameterI4uivEXT C.GPNAMEDPROGRAMLOCALPARAMETERI4UIVEXT
+ gpNamedProgramLocalParameters4fvEXT C.GPNAMEDPROGRAMLOCALPARAMETERS4FVEXT
+ gpNamedProgramLocalParametersI4ivEXT C.GPNAMEDPROGRAMLOCALPARAMETERSI4IVEXT
+ gpNamedProgramLocalParametersI4uivEXT C.GPNAMEDPROGRAMLOCALPARAMETERSI4UIVEXT
+ gpNamedProgramStringEXT C.GPNAMEDPROGRAMSTRINGEXT
+ gpNamedRenderbufferStorage C.GPNAMEDRENDERBUFFERSTORAGE
+ gpNamedRenderbufferStorageEXT C.GPNAMEDRENDERBUFFERSTORAGEEXT
+ gpNamedRenderbufferStorageMultisample C.GPNAMEDRENDERBUFFERSTORAGEMULTISAMPLE
+ gpNamedRenderbufferStorageMultisampleAdvancedAMD C.GPNAMEDRENDERBUFFERSTORAGEMULTISAMPLEADVANCEDAMD
+ gpNamedRenderbufferStorageMultisampleCoverageEXT C.GPNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXT
+ gpNamedRenderbufferStorageMultisampleEXT C.GPNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXT
+ gpNamedStringARB C.GPNAMEDSTRINGARB
+ gpNormalFormatNV C.GPNORMALFORMATNV
+ gpObjectLabel C.GPOBJECTLABEL
+ gpObjectLabelKHR C.GPOBJECTLABELKHR
+ gpObjectPtrLabel C.GPOBJECTPTRLABEL
+ gpObjectPtrLabelKHR C.GPOBJECTPTRLABELKHR
+ gpPatchParameterfv C.GPPATCHPARAMETERFV
+ gpPatchParameteri C.GPPATCHPARAMETERI
+ gpPathCommandsNV C.GPPATHCOMMANDSNV
+ gpPathCoordsNV C.GPPATHCOORDSNV
+ gpPathCoverDepthFuncNV C.GPPATHCOVERDEPTHFUNCNV
+ gpPathDashArrayNV C.GPPATHDASHARRAYNV
+ gpPathGlyphIndexArrayNV C.GPPATHGLYPHINDEXARRAYNV
+ gpPathGlyphIndexRangeNV C.GPPATHGLYPHINDEXRANGENV
+ gpPathGlyphRangeNV C.GPPATHGLYPHRANGENV
+ gpPathGlyphsNV C.GPPATHGLYPHSNV
+ gpPathMemoryGlyphIndexArrayNV C.GPPATHMEMORYGLYPHINDEXARRAYNV
+ gpPathParameterfNV C.GPPATHPARAMETERFNV
+ gpPathParameterfvNV C.GPPATHPARAMETERFVNV
+ gpPathParameteriNV C.GPPATHPARAMETERINV
+ gpPathParameterivNV C.GPPATHPARAMETERIVNV
+ gpPathStencilDepthOffsetNV C.GPPATHSTENCILDEPTHOFFSETNV
+ gpPathStencilFuncNV C.GPPATHSTENCILFUNCNV
+ gpPathStringNV C.GPPATHSTRINGNV
+ gpPathSubCommandsNV C.GPPATHSUBCOMMANDSNV
+ gpPathSubCoordsNV C.GPPATHSUBCOORDSNV
+ gpPauseTransformFeedback C.GPPAUSETRANSFORMFEEDBACK
+ gpPixelStoref C.GPPIXELSTOREF
+ gpPixelStorei C.GPPIXELSTOREI
+ gpPointAlongPathNV C.GPPOINTALONGPATHNV
+ gpPointParameterf C.GPPOINTPARAMETERF
+ gpPointParameterfv C.GPPOINTPARAMETERFV
+ gpPointParameteri C.GPPOINTPARAMETERI
+ gpPointParameteriv C.GPPOINTPARAMETERIV
+ gpPointSize C.GPPOINTSIZE
+ gpPolygonMode C.GPPOLYGONMODE
+ gpPolygonOffset C.GPPOLYGONOFFSET
+ gpPolygonOffsetClamp C.GPPOLYGONOFFSETCLAMP
+ gpPolygonOffsetClampEXT C.GPPOLYGONOFFSETCLAMPEXT
+ gpPopDebugGroup C.GPPOPDEBUGGROUP
+ gpPopDebugGroupKHR C.GPPOPDEBUGGROUPKHR
+ gpPopGroupMarkerEXT C.GPPOPGROUPMARKEREXT
+ gpPrimitiveBoundingBoxARB C.GPPRIMITIVEBOUNDINGBOXARB
+ gpPrimitiveRestartIndex C.GPPRIMITIVERESTARTINDEX
+ gpProgramBinary C.GPPROGRAMBINARY
+ gpProgramParameteri C.GPPROGRAMPARAMETERI
+ gpProgramParameteriARB C.GPPROGRAMPARAMETERIARB
+ gpProgramParameteriEXT C.GPPROGRAMPARAMETERIEXT
+ gpProgramPathFragmentInputGenNV C.GPPROGRAMPATHFRAGMENTINPUTGENNV
+ gpProgramUniform1d C.GPPROGRAMUNIFORM1D
+ gpProgramUniform1dEXT C.GPPROGRAMUNIFORM1DEXT
+ gpProgramUniform1dv C.GPPROGRAMUNIFORM1DV
+ gpProgramUniform1dvEXT C.GPPROGRAMUNIFORM1DVEXT
+ gpProgramUniform1f C.GPPROGRAMUNIFORM1F
+ gpProgramUniform1fEXT C.GPPROGRAMUNIFORM1FEXT
+ gpProgramUniform1fv C.GPPROGRAMUNIFORM1FV
+ gpProgramUniform1fvEXT C.GPPROGRAMUNIFORM1FVEXT
+ gpProgramUniform1i C.GPPROGRAMUNIFORM1I
+ gpProgramUniform1i64ARB C.GPPROGRAMUNIFORM1I64ARB
+ gpProgramUniform1i64NV C.GPPROGRAMUNIFORM1I64NV
+ gpProgramUniform1i64vARB C.GPPROGRAMUNIFORM1I64VARB
+ gpProgramUniform1i64vNV C.GPPROGRAMUNIFORM1I64VNV
+ gpProgramUniform1iEXT C.GPPROGRAMUNIFORM1IEXT
+ gpProgramUniform1iv C.GPPROGRAMUNIFORM1IV
+ gpProgramUniform1ivEXT C.GPPROGRAMUNIFORM1IVEXT
+ gpProgramUniform1ui C.GPPROGRAMUNIFORM1UI
+ gpProgramUniform1ui64ARB C.GPPROGRAMUNIFORM1UI64ARB
+ gpProgramUniform1ui64NV C.GPPROGRAMUNIFORM1UI64NV
+ gpProgramUniform1ui64vARB C.GPPROGRAMUNIFORM1UI64VARB
+ gpProgramUniform1ui64vNV C.GPPROGRAMUNIFORM1UI64VNV
+ gpProgramUniform1uiEXT C.GPPROGRAMUNIFORM1UIEXT
+ gpProgramUniform1uiv C.GPPROGRAMUNIFORM1UIV
+ gpProgramUniform1uivEXT C.GPPROGRAMUNIFORM1UIVEXT
+ gpProgramUniform2d C.GPPROGRAMUNIFORM2D
+ gpProgramUniform2dEXT C.GPPROGRAMUNIFORM2DEXT
+ gpProgramUniform2dv C.GPPROGRAMUNIFORM2DV
+ gpProgramUniform2dvEXT C.GPPROGRAMUNIFORM2DVEXT
+ gpProgramUniform2f C.GPPROGRAMUNIFORM2F
+ gpProgramUniform2fEXT C.GPPROGRAMUNIFORM2FEXT
+ gpProgramUniform2fv C.GPPROGRAMUNIFORM2FV
+ gpProgramUniform2fvEXT C.GPPROGRAMUNIFORM2FVEXT
+ gpProgramUniform2i C.GPPROGRAMUNIFORM2I
+ gpProgramUniform2i64ARB C.GPPROGRAMUNIFORM2I64ARB
+ gpProgramUniform2i64NV C.GPPROGRAMUNIFORM2I64NV
+ gpProgramUniform2i64vARB C.GPPROGRAMUNIFORM2I64VARB
+ gpProgramUniform2i64vNV C.GPPROGRAMUNIFORM2I64VNV
+ gpProgramUniform2iEXT C.GPPROGRAMUNIFORM2IEXT
+ gpProgramUniform2iv C.GPPROGRAMUNIFORM2IV
+ gpProgramUniform2ivEXT C.GPPROGRAMUNIFORM2IVEXT
+ gpProgramUniform2ui C.GPPROGRAMUNIFORM2UI
+ gpProgramUniform2ui64ARB C.GPPROGRAMUNIFORM2UI64ARB
+ gpProgramUniform2ui64NV C.GPPROGRAMUNIFORM2UI64NV
+ gpProgramUniform2ui64vARB C.GPPROGRAMUNIFORM2UI64VARB
+ gpProgramUniform2ui64vNV C.GPPROGRAMUNIFORM2UI64VNV
+ gpProgramUniform2uiEXT C.GPPROGRAMUNIFORM2UIEXT
+ gpProgramUniform2uiv C.GPPROGRAMUNIFORM2UIV
+ gpProgramUniform2uivEXT C.GPPROGRAMUNIFORM2UIVEXT
+ gpProgramUniform3d C.GPPROGRAMUNIFORM3D
+ gpProgramUniform3dEXT C.GPPROGRAMUNIFORM3DEXT
+ gpProgramUniform3dv C.GPPROGRAMUNIFORM3DV
+ gpProgramUniform3dvEXT C.GPPROGRAMUNIFORM3DVEXT
+ gpProgramUniform3f C.GPPROGRAMUNIFORM3F
+ gpProgramUniform3fEXT C.GPPROGRAMUNIFORM3FEXT
+ gpProgramUniform3fv C.GPPROGRAMUNIFORM3FV
+ gpProgramUniform3fvEXT C.GPPROGRAMUNIFORM3FVEXT
+ gpProgramUniform3i C.GPPROGRAMUNIFORM3I
+ gpProgramUniform3i64ARB C.GPPROGRAMUNIFORM3I64ARB
+ gpProgramUniform3i64NV C.GPPROGRAMUNIFORM3I64NV
+ gpProgramUniform3i64vARB C.GPPROGRAMUNIFORM3I64VARB
+ gpProgramUniform3i64vNV C.GPPROGRAMUNIFORM3I64VNV
+ gpProgramUniform3iEXT C.GPPROGRAMUNIFORM3IEXT
+ gpProgramUniform3iv C.GPPROGRAMUNIFORM3IV
+ gpProgramUniform3ivEXT C.GPPROGRAMUNIFORM3IVEXT
+ gpProgramUniform3ui C.GPPROGRAMUNIFORM3UI
+ gpProgramUniform3ui64ARB C.GPPROGRAMUNIFORM3UI64ARB
+ gpProgramUniform3ui64NV C.GPPROGRAMUNIFORM3UI64NV
+ gpProgramUniform3ui64vARB C.GPPROGRAMUNIFORM3UI64VARB
+ gpProgramUniform3ui64vNV C.GPPROGRAMUNIFORM3UI64VNV
+ gpProgramUniform3uiEXT C.GPPROGRAMUNIFORM3UIEXT
+ gpProgramUniform3uiv C.GPPROGRAMUNIFORM3UIV
+ gpProgramUniform3uivEXT C.GPPROGRAMUNIFORM3UIVEXT
+ gpProgramUniform4d C.GPPROGRAMUNIFORM4D
+ gpProgramUniform4dEXT C.GPPROGRAMUNIFORM4DEXT
+ gpProgramUniform4dv C.GPPROGRAMUNIFORM4DV
+ gpProgramUniform4dvEXT C.GPPROGRAMUNIFORM4DVEXT
+ gpProgramUniform4f C.GPPROGRAMUNIFORM4F
+ gpProgramUniform4fEXT C.GPPROGRAMUNIFORM4FEXT
+ gpProgramUniform4fv C.GPPROGRAMUNIFORM4FV
+ gpProgramUniform4fvEXT C.GPPROGRAMUNIFORM4FVEXT
+ gpProgramUniform4i C.GPPROGRAMUNIFORM4I
+ gpProgramUniform4i64ARB C.GPPROGRAMUNIFORM4I64ARB
+ gpProgramUniform4i64NV C.GPPROGRAMUNIFORM4I64NV
+ gpProgramUniform4i64vARB C.GPPROGRAMUNIFORM4I64VARB
+ gpProgramUniform4i64vNV C.GPPROGRAMUNIFORM4I64VNV
+ gpProgramUniform4iEXT C.GPPROGRAMUNIFORM4IEXT
+ gpProgramUniform4iv C.GPPROGRAMUNIFORM4IV
+ gpProgramUniform4ivEXT C.GPPROGRAMUNIFORM4IVEXT
+ gpProgramUniform4ui C.GPPROGRAMUNIFORM4UI
+ gpProgramUniform4ui64ARB C.GPPROGRAMUNIFORM4UI64ARB
+ gpProgramUniform4ui64NV C.GPPROGRAMUNIFORM4UI64NV
+ gpProgramUniform4ui64vARB C.GPPROGRAMUNIFORM4UI64VARB
+ gpProgramUniform4ui64vNV C.GPPROGRAMUNIFORM4UI64VNV
+ gpProgramUniform4uiEXT C.GPPROGRAMUNIFORM4UIEXT
+ gpProgramUniform4uiv C.GPPROGRAMUNIFORM4UIV
+ gpProgramUniform4uivEXT C.GPPROGRAMUNIFORM4UIVEXT
+ gpProgramUniformHandleui64ARB C.GPPROGRAMUNIFORMHANDLEUI64ARB
+ gpProgramUniformHandleui64NV C.GPPROGRAMUNIFORMHANDLEUI64NV
+ gpProgramUniformHandleui64vARB C.GPPROGRAMUNIFORMHANDLEUI64VARB
+ gpProgramUniformHandleui64vNV C.GPPROGRAMUNIFORMHANDLEUI64VNV
+ gpProgramUniformMatrix2dv C.GPPROGRAMUNIFORMMATRIX2DV
+ gpProgramUniformMatrix2dvEXT C.GPPROGRAMUNIFORMMATRIX2DVEXT
+ gpProgramUniformMatrix2fv C.GPPROGRAMUNIFORMMATRIX2FV
+ gpProgramUniformMatrix2fvEXT C.GPPROGRAMUNIFORMMATRIX2FVEXT
+ gpProgramUniformMatrix2x3dv C.GPPROGRAMUNIFORMMATRIX2X3DV
+ gpProgramUniformMatrix2x3dvEXT C.GPPROGRAMUNIFORMMATRIX2X3DVEXT
+ gpProgramUniformMatrix2x3fv C.GPPROGRAMUNIFORMMATRIX2X3FV
+ gpProgramUniformMatrix2x3fvEXT C.GPPROGRAMUNIFORMMATRIX2X3FVEXT
+ gpProgramUniformMatrix2x4dv C.GPPROGRAMUNIFORMMATRIX2X4DV
+ gpProgramUniformMatrix2x4dvEXT C.GPPROGRAMUNIFORMMATRIX2X4DVEXT
+ gpProgramUniformMatrix2x4fv C.GPPROGRAMUNIFORMMATRIX2X4FV
+ gpProgramUniformMatrix2x4fvEXT C.GPPROGRAMUNIFORMMATRIX2X4FVEXT
+ gpProgramUniformMatrix3dv C.GPPROGRAMUNIFORMMATRIX3DV
+ gpProgramUniformMatrix3dvEXT C.GPPROGRAMUNIFORMMATRIX3DVEXT
+ gpProgramUniformMatrix3fv C.GPPROGRAMUNIFORMMATRIX3FV
+ gpProgramUniformMatrix3fvEXT C.GPPROGRAMUNIFORMMATRIX3FVEXT
+ gpProgramUniformMatrix3x2dv C.GPPROGRAMUNIFORMMATRIX3X2DV
+ gpProgramUniformMatrix3x2dvEXT C.GPPROGRAMUNIFORMMATRIX3X2DVEXT
+ gpProgramUniformMatrix3x2fv C.GPPROGRAMUNIFORMMATRIX3X2FV
+ gpProgramUniformMatrix3x2fvEXT C.GPPROGRAMUNIFORMMATRIX3X2FVEXT
+ gpProgramUniformMatrix3x4dv C.GPPROGRAMUNIFORMMATRIX3X4DV
+ gpProgramUniformMatrix3x4dvEXT C.GPPROGRAMUNIFORMMATRIX3X4DVEXT
+ gpProgramUniformMatrix3x4fv C.GPPROGRAMUNIFORMMATRIX3X4FV
+ gpProgramUniformMatrix3x4fvEXT C.GPPROGRAMUNIFORMMATRIX3X4FVEXT
+ gpProgramUniformMatrix4dv C.GPPROGRAMUNIFORMMATRIX4DV
+ gpProgramUniformMatrix4dvEXT C.GPPROGRAMUNIFORMMATRIX4DVEXT
+ gpProgramUniformMatrix4fv C.GPPROGRAMUNIFORMMATRIX4FV
+ gpProgramUniformMatrix4fvEXT C.GPPROGRAMUNIFORMMATRIX4FVEXT
+ gpProgramUniformMatrix4x2dv C.GPPROGRAMUNIFORMMATRIX4X2DV
+ gpProgramUniformMatrix4x2dvEXT C.GPPROGRAMUNIFORMMATRIX4X2DVEXT
+ gpProgramUniformMatrix4x2fv C.GPPROGRAMUNIFORMMATRIX4X2FV
+ gpProgramUniformMatrix4x2fvEXT C.GPPROGRAMUNIFORMMATRIX4X2FVEXT
+ gpProgramUniformMatrix4x3dv C.GPPROGRAMUNIFORMMATRIX4X3DV
+ gpProgramUniformMatrix4x3dvEXT C.GPPROGRAMUNIFORMMATRIX4X3DVEXT
+ gpProgramUniformMatrix4x3fv C.GPPROGRAMUNIFORMMATRIX4X3FV
+ gpProgramUniformMatrix4x3fvEXT C.GPPROGRAMUNIFORMMATRIX4X3FVEXT
+ gpProgramUniformui64NV C.GPPROGRAMUNIFORMUI64NV
+ gpProgramUniformui64vNV C.GPPROGRAMUNIFORMUI64VNV
+ gpProvokingVertex C.GPPROVOKINGVERTEX
+ gpPushClientAttribDefaultEXT C.GPPUSHCLIENTATTRIBDEFAULTEXT
+ gpPushDebugGroup C.GPPUSHDEBUGGROUP
+ gpPushDebugGroupKHR C.GPPUSHDEBUGGROUPKHR
+ gpPushGroupMarkerEXT C.GPPUSHGROUPMARKEREXT
+ gpQueryCounter C.GPQUERYCOUNTER
+ gpRasterSamplesEXT C.GPRASTERSAMPLESEXT
+ gpReadBuffer C.GPREADBUFFER
+ gpReadPixels C.GPREADPIXELS
+ gpReadnPixels C.GPREADNPIXELS
+ gpReadnPixelsARB C.GPREADNPIXELSARB
+ gpReadnPixelsKHR C.GPREADNPIXELSKHR
+ gpReleaseShaderCompiler C.GPRELEASESHADERCOMPILER
+ gpRenderbufferStorage C.GPRENDERBUFFERSTORAGE
+ gpRenderbufferStorageMultisample C.GPRENDERBUFFERSTORAGEMULTISAMPLE
+ gpRenderbufferStorageMultisampleAdvancedAMD C.GPRENDERBUFFERSTORAGEMULTISAMPLEADVANCEDAMD
+ gpRenderbufferStorageMultisampleCoverageNV C.GPRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENV
+ gpResetMemoryObjectParameterNV C.GPRESETMEMORYOBJECTPARAMETERNV
+ gpResolveDepthValuesNV C.GPRESOLVEDEPTHVALUESNV
+ gpResumeTransformFeedback C.GPRESUMETRANSFORMFEEDBACK
+ gpSampleCoverage C.GPSAMPLECOVERAGE
+ gpSampleMaski C.GPSAMPLEMASKI
+ gpSamplerParameterIiv C.GPSAMPLERPARAMETERIIV
+ gpSamplerParameterIuiv C.GPSAMPLERPARAMETERIUIV
+ gpSamplerParameterf C.GPSAMPLERPARAMETERF
+ gpSamplerParameterfv C.GPSAMPLERPARAMETERFV
+ gpSamplerParameteri C.GPSAMPLERPARAMETERI
+ gpSamplerParameteriv C.GPSAMPLERPARAMETERIV
+ gpScissor C.GPSCISSOR
+ gpScissorArrayv C.GPSCISSORARRAYV
+ gpScissorExclusiveArrayvNV C.GPSCISSOREXCLUSIVEARRAYVNV
+ gpScissorExclusiveNV C.GPSCISSOREXCLUSIVENV
+ gpScissorIndexed C.GPSCISSORINDEXED
+ gpScissorIndexedv C.GPSCISSORINDEXEDV
+ gpSecondaryColorFormatNV C.GPSECONDARYCOLORFORMATNV
+ gpSelectPerfMonitorCountersAMD C.GPSELECTPERFMONITORCOUNTERSAMD
+ gpShaderBinary C.GPSHADERBINARY
+ gpShaderSource C.GPSHADERSOURCE
+ gpShaderStorageBlockBinding C.GPSHADERSTORAGEBLOCKBINDING
+ gpShadingRateImageBarrierNV C.GPSHADINGRATEIMAGEBARRIERNV
+ gpShadingRateImagePaletteNV C.GPSHADINGRATEIMAGEPALETTENV
+ gpShadingRateSampleOrderCustomNV C.GPSHADINGRATESAMPLEORDERCUSTOMNV
+ gpShadingRateSampleOrderNV C.GPSHADINGRATESAMPLEORDERNV
+ gpSignalVkFenceNV C.GPSIGNALVKFENCENV
+ gpSignalVkSemaphoreNV C.GPSIGNALVKSEMAPHORENV
+ gpSpecializeShaderARB C.GPSPECIALIZESHADERARB
+ gpStateCaptureNV C.GPSTATECAPTURENV
+ gpStencilFillPathInstancedNV C.GPSTENCILFILLPATHINSTANCEDNV
+ gpStencilFillPathNV C.GPSTENCILFILLPATHNV
+ gpStencilFunc C.GPSTENCILFUNC
+ gpStencilFuncSeparate C.GPSTENCILFUNCSEPARATE
+ gpStencilMask C.GPSTENCILMASK
+ gpStencilMaskSeparate C.GPSTENCILMASKSEPARATE
+ gpStencilOp C.GPSTENCILOP
+ gpStencilOpSeparate C.GPSTENCILOPSEPARATE
+ gpStencilStrokePathInstancedNV C.GPSTENCILSTROKEPATHINSTANCEDNV
+ gpStencilStrokePathNV C.GPSTENCILSTROKEPATHNV
+ gpStencilThenCoverFillPathInstancedNV C.GPSTENCILTHENCOVERFILLPATHINSTANCEDNV
+ gpStencilThenCoverFillPathNV C.GPSTENCILTHENCOVERFILLPATHNV
+ gpStencilThenCoverStrokePathInstancedNV C.GPSTENCILTHENCOVERSTROKEPATHINSTANCEDNV
+ gpStencilThenCoverStrokePathNV C.GPSTENCILTHENCOVERSTROKEPATHNV
+ gpSubpixelPrecisionBiasNV C.GPSUBPIXELPRECISIONBIASNV
+ gpTexAttachMemoryNV C.GPTEXATTACHMEMORYNV
+ gpTexBuffer C.GPTEXBUFFER
+ gpTexBufferARB C.GPTEXBUFFERARB
+ gpTexBufferRange C.GPTEXBUFFERRANGE
+ gpTexCoordFormatNV C.GPTEXCOORDFORMATNV
+ gpTexImage1D C.GPTEXIMAGE1D
+ gpTexImage2D C.GPTEXIMAGE2D
+ gpTexImage2DMultisample C.GPTEXIMAGE2DMULTISAMPLE
+ gpTexImage3D C.GPTEXIMAGE3D
+ gpTexImage3DMultisample C.GPTEXIMAGE3DMULTISAMPLE
+ gpTexPageCommitmentARB C.GPTEXPAGECOMMITMENTARB
+ gpTexPageCommitmentMemNV C.GPTEXPAGECOMMITMENTMEMNV
+ gpTexParameterIiv C.GPTEXPARAMETERIIV
+ gpTexParameterIuiv C.GPTEXPARAMETERIUIV
+ gpTexParameterf C.GPTEXPARAMETERF
+ gpTexParameterfv C.GPTEXPARAMETERFV
+ gpTexParameteri C.GPTEXPARAMETERI
+ gpTexParameteriv C.GPTEXPARAMETERIV
+ gpTexStorage1D C.GPTEXSTORAGE1D
+ gpTexStorage2D C.GPTEXSTORAGE2D
+ gpTexStorage2DMultisample C.GPTEXSTORAGE2DMULTISAMPLE
+ gpTexStorage3D C.GPTEXSTORAGE3D
+ gpTexStorage3DMultisample C.GPTEXSTORAGE3DMULTISAMPLE
+ gpTexSubImage1D C.GPTEXSUBIMAGE1D
+ gpTexSubImage2D C.GPTEXSUBIMAGE2D
+ gpTexSubImage3D C.GPTEXSUBIMAGE3D
+ gpTextureAttachMemoryNV C.GPTEXTUREATTACHMEMORYNV
+ gpTextureBarrier C.GPTEXTUREBARRIER
+ gpTextureBarrierNV C.GPTEXTUREBARRIERNV
+ gpTextureBuffer C.GPTEXTUREBUFFER
+ gpTextureBufferEXT C.GPTEXTUREBUFFEREXT
+ gpTextureBufferRange C.GPTEXTUREBUFFERRANGE
+ gpTextureBufferRangeEXT C.GPTEXTUREBUFFERRANGEEXT
+ gpTextureImage1DEXT C.GPTEXTUREIMAGE1DEXT
+ gpTextureImage2DEXT C.GPTEXTUREIMAGE2DEXT
+ gpTextureImage3DEXT C.GPTEXTUREIMAGE3DEXT
+ gpTexturePageCommitmentEXT C.GPTEXTUREPAGECOMMITMENTEXT
+ gpTexturePageCommitmentMemNV C.GPTEXTUREPAGECOMMITMENTMEMNV
+ gpTextureParameterIiv C.GPTEXTUREPARAMETERIIV
+ gpTextureParameterIivEXT C.GPTEXTUREPARAMETERIIVEXT
+ gpTextureParameterIuiv C.GPTEXTUREPARAMETERIUIV
+ gpTextureParameterIuivEXT C.GPTEXTUREPARAMETERIUIVEXT
+ gpTextureParameterf C.GPTEXTUREPARAMETERF
+ gpTextureParameterfEXT C.GPTEXTUREPARAMETERFEXT
+ gpTextureParameterfv C.GPTEXTUREPARAMETERFV
+ gpTextureParameterfvEXT C.GPTEXTUREPARAMETERFVEXT
+ gpTextureParameteri C.GPTEXTUREPARAMETERI
+ gpTextureParameteriEXT C.GPTEXTUREPARAMETERIEXT
+ gpTextureParameteriv C.GPTEXTUREPARAMETERIV
+ gpTextureParameterivEXT C.GPTEXTUREPARAMETERIVEXT
+ gpTextureRenderbufferEXT C.GPTEXTURERENDERBUFFEREXT
+ gpTextureStorage1D C.GPTEXTURESTORAGE1D
+ gpTextureStorage1DEXT C.GPTEXTURESTORAGE1DEXT
+ gpTextureStorage2D C.GPTEXTURESTORAGE2D
+ gpTextureStorage2DEXT C.GPTEXTURESTORAGE2DEXT
+ gpTextureStorage2DMultisample C.GPTEXTURESTORAGE2DMULTISAMPLE
+ gpTextureStorage2DMultisampleEXT C.GPTEXTURESTORAGE2DMULTISAMPLEEXT
+ gpTextureStorage3D C.GPTEXTURESTORAGE3D
+ gpTextureStorage3DEXT C.GPTEXTURESTORAGE3DEXT
+ gpTextureStorage3DMultisample C.GPTEXTURESTORAGE3DMULTISAMPLE
+ gpTextureStorage3DMultisampleEXT C.GPTEXTURESTORAGE3DMULTISAMPLEEXT
+ gpTextureSubImage1D C.GPTEXTURESUBIMAGE1D
+ gpTextureSubImage1DEXT C.GPTEXTURESUBIMAGE1DEXT
+ gpTextureSubImage2D C.GPTEXTURESUBIMAGE2D
+ gpTextureSubImage2DEXT C.GPTEXTURESUBIMAGE2DEXT
+ gpTextureSubImage3D C.GPTEXTURESUBIMAGE3D
+ gpTextureSubImage3DEXT C.GPTEXTURESUBIMAGE3DEXT
+ gpTextureView C.GPTEXTUREVIEW
+ gpTransformFeedbackBufferBase C.GPTRANSFORMFEEDBACKBUFFERBASE
+ gpTransformFeedbackBufferRange C.GPTRANSFORMFEEDBACKBUFFERRANGE
+ gpTransformFeedbackVaryings C.GPTRANSFORMFEEDBACKVARYINGS
+ gpTransformPathNV C.GPTRANSFORMPATHNV
+ gpUniform1d C.GPUNIFORM1D
+ gpUniform1dv C.GPUNIFORM1DV
+ gpUniform1f C.GPUNIFORM1F
+ gpUniform1fv C.GPUNIFORM1FV
+ gpUniform1i C.GPUNIFORM1I
+ gpUniform1i64ARB C.GPUNIFORM1I64ARB
+ gpUniform1i64NV C.GPUNIFORM1I64NV
+ gpUniform1i64vARB C.GPUNIFORM1I64VARB
+ gpUniform1i64vNV C.GPUNIFORM1I64VNV
+ gpUniform1iv C.GPUNIFORM1IV
+ gpUniform1ui C.GPUNIFORM1UI
+ gpUniform1ui64ARB C.GPUNIFORM1UI64ARB
+ gpUniform1ui64NV C.GPUNIFORM1UI64NV
+ gpUniform1ui64vARB C.GPUNIFORM1UI64VARB
+ gpUniform1ui64vNV C.GPUNIFORM1UI64VNV
+ gpUniform1uiv C.GPUNIFORM1UIV
+ gpUniform2d C.GPUNIFORM2D
+ gpUniform2dv C.GPUNIFORM2DV
+ gpUniform2f C.GPUNIFORM2F
+ gpUniform2fv C.GPUNIFORM2FV
+ gpUniform2i C.GPUNIFORM2I
+ gpUniform2i64ARB C.GPUNIFORM2I64ARB
+ gpUniform2i64NV C.GPUNIFORM2I64NV
+ gpUniform2i64vARB C.GPUNIFORM2I64VARB
+ gpUniform2i64vNV C.GPUNIFORM2I64VNV
+ gpUniform2iv C.GPUNIFORM2IV
+ gpUniform2ui C.GPUNIFORM2UI
+ gpUniform2ui64ARB C.GPUNIFORM2UI64ARB
+ gpUniform2ui64NV C.GPUNIFORM2UI64NV
+ gpUniform2ui64vARB C.GPUNIFORM2UI64VARB
+ gpUniform2ui64vNV C.GPUNIFORM2UI64VNV
+ gpUniform2uiv C.GPUNIFORM2UIV
+ gpUniform3d C.GPUNIFORM3D
+ gpUniform3dv C.GPUNIFORM3DV
+ gpUniform3f C.GPUNIFORM3F
+ gpUniform3fv C.GPUNIFORM3FV
+ gpUniform3i C.GPUNIFORM3I
+ gpUniform3i64ARB C.GPUNIFORM3I64ARB
+ gpUniform3i64NV C.GPUNIFORM3I64NV
+ gpUniform3i64vARB C.GPUNIFORM3I64VARB
+ gpUniform3i64vNV C.GPUNIFORM3I64VNV
+ gpUniform3iv C.GPUNIFORM3IV
+ gpUniform3ui C.GPUNIFORM3UI
+ gpUniform3ui64ARB C.GPUNIFORM3UI64ARB
+ gpUniform3ui64NV C.GPUNIFORM3UI64NV
+ gpUniform3ui64vARB C.GPUNIFORM3UI64VARB
+ gpUniform3ui64vNV C.GPUNIFORM3UI64VNV
+ gpUniform3uiv C.GPUNIFORM3UIV
+ gpUniform4d C.GPUNIFORM4D
+ gpUniform4dv C.GPUNIFORM4DV
+ gpUniform4f C.GPUNIFORM4F
+ gpUniform4fv C.GPUNIFORM4FV
+ gpUniform4i C.GPUNIFORM4I
+ gpUniform4i64ARB C.GPUNIFORM4I64ARB
+ gpUniform4i64NV C.GPUNIFORM4I64NV
+ gpUniform4i64vARB C.GPUNIFORM4I64VARB
+ gpUniform4i64vNV C.GPUNIFORM4I64VNV
+ gpUniform4iv C.GPUNIFORM4IV
+ gpUniform4ui C.GPUNIFORM4UI
+ gpUniform4ui64ARB C.GPUNIFORM4UI64ARB
+ gpUniform4ui64NV C.GPUNIFORM4UI64NV
+ gpUniform4ui64vARB C.GPUNIFORM4UI64VARB
+ gpUniform4ui64vNV C.GPUNIFORM4UI64VNV
+ gpUniform4uiv C.GPUNIFORM4UIV
+ gpUniformBlockBinding C.GPUNIFORMBLOCKBINDING
+ gpUniformHandleui64ARB C.GPUNIFORMHANDLEUI64ARB
+ gpUniformHandleui64NV C.GPUNIFORMHANDLEUI64NV
+ gpUniformHandleui64vARB C.GPUNIFORMHANDLEUI64VARB
+ gpUniformHandleui64vNV C.GPUNIFORMHANDLEUI64VNV
+ gpUniformMatrix2dv C.GPUNIFORMMATRIX2DV
+ gpUniformMatrix2fv C.GPUNIFORMMATRIX2FV
+ gpUniformMatrix2x3dv C.GPUNIFORMMATRIX2X3DV
+ gpUniformMatrix2x3fv C.GPUNIFORMMATRIX2X3FV
+ gpUniformMatrix2x4dv C.GPUNIFORMMATRIX2X4DV
+ gpUniformMatrix2x4fv C.GPUNIFORMMATRIX2X4FV
+ gpUniformMatrix3dv C.GPUNIFORMMATRIX3DV
+ gpUniformMatrix3fv C.GPUNIFORMMATRIX3FV
+ gpUniformMatrix3x2dv C.GPUNIFORMMATRIX3X2DV
+ gpUniformMatrix3x2fv C.GPUNIFORMMATRIX3X2FV
+ gpUniformMatrix3x4dv C.GPUNIFORMMATRIX3X4DV
+ gpUniformMatrix3x4fv C.GPUNIFORMMATRIX3X4FV
+ gpUniformMatrix4dv C.GPUNIFORMMATRIX4DV
+ gpUniformMatrix4fv C.GPUNIFORMMATRIX4FV
+ gpUniformMatrix4x2dv C.GPUNIFORMMATRIX4X2DV
+ gpUniformMatrix4x2fv C.GPUNIFORMMATRIX4X2FV
+ gpUniformMatrix4x3dv C.GPUNIFORMMATRIX4X3DV
+ gpUniformMatrix4x3fv C.GPUNIFORMMATRIX4X3FV
+ gpUniformSubroutinesuiv C.GPUNIFORMSUBROUTINESUIV
+ gpUniformui64NV C.GPUNIFORMUI64NV
+ gpUniformui64vNV C.GPUNIFORMUI64VNV
+ gpUnmapBuffer C.GPUNMAPBUFFER
+ gpUnmapNamedBuffer C.GPUNMAPNAMEDBUFFER
+ gpUnmapNamedBufferEXT C.GPUNMAPNAMEDBUFFEREXT
+ gpUseProgram C.GPUSEPROGRAM
+ gpUseProgramStages C.GPUSEPROGRAMSTAGES
+ gpUseProgramStagesEXT C.GPUSEPROGRAMSTAGESEXT
+ gpUseShaderProgramEXT C.GPUSESHADERPROGRAMEXT
+ gpValidateProgram C.GPVALIDATEPROGRAM
+ gpValidateProgramPipeline C.GPVALIDATEPROGRAMPIPELINE
+ gpValidateProgramPipelineEXT C.GPVALIDATEPROGRAMPIPELINEEXT
+ gpVertexArrayAttribBinding C.GPVERTEXARRAYATTRIBBINDING
+ gpVertexArrayAttribFormat C.GPVERTEXARRAYATTRIBFORMAT
+ gpVertexArrayAttribIFormat C.GPVERTEXARRAYATTRIBIFORMAT
+ gpVertexArrayAttribLFormat C.GPVERTEXARRAYATTRIBLFORMAT
+ gpVertexArrayBindVertexBufferEXT C.GPVERTEXARRAYBINDVERTEXBUFFEREXT
+ gpVertexArrayBindingDivisor C.GPVERTEXARRAYBINDINGDIVISOR
+ gpVertexArrayColorOffsetEXT C.GPVERTEXARRAYCOLOROFFSETEXT
+ gpVertexArrayEdgeFlagOffsetEXT C.GPVERTEXARRAYEDGEFLAGOFFSETEXT
+ gpVertexArrayElementBuffer C.GPVERTEXARRAYELEMENTBUFFER
+ gpVertexArrayFogCoordOffsetEXT C.GPVERTEXARRAYFOGCOORDOFFSETEXT
+ gpVertexArrayIndexOffsetEXT C.GPVERTEXARRAYINDEXOFFSETEXT
+ gpVertexArrayMultiTexCoordOffsetEXT C.GPVERTEXARRAYMULTITEXCOORDOFFSETEXT
+ gpVertexArrayNormalOffsetEXT C.GPVERTEXARRAYNORMALOFFSETEXT
+ gpVertexArraySecondaryColorOffsetEXT C.GPVERTEXARRAYSECONDARYCOLOROFFSETEXT
+ gpVertexArrayTexCoordOffsetEXT C.GPVERTEXARRAYTEXCOORDOFFSETEXT
+ gpVertexArrayVertexAttribBindingEXT C.GPVERTEXARRAYVERTEXATTRIBBINDINGEXT
+ gpVertexArrayVertexAttribDivisorEXT C.GPVERTEXARRAYVERTEXATTRIBDIVISOREXT
+ gpVertexArrayVertexAttribFormatEXT C.GPVERTEXARRAYVERTEXATTRIBFORMATEXT
+ gpVertexArrayVertexAttribIFormatEXT C.GPVERTEXARRAYVERTEXATTRIBIFORMATEXT
+ gpVertexArrayVertexAttribIOffsetEXT C.GPVERTEXARRAYVERTEXATTRIBIOFFSETEXT
+ gpVertexArrayVertexAttribLFormatEXT C.GPVERTEXARRAYVERTEXATTRIBLFORMATEXT
+ gpVertexArrayVertexAttribLOffsetEXT C.GPVERTEXARRAYVERTEXATTRIBLOFFSETEXT
+ gpVertexArrayVertexAttribOffsetEXT C.GPVERTEXARRAYVERTEXATTRIBOFFSETEXT
+ gpVertexArrayVertexBindingDivisorEXT C.GPVERTEXARRAYVERTEXBINDINGDIVISOREXT
+ gpVertexArrayVertexBuffer C.GPVERTEXARRAYVERTEXBUFFER
+ gpVertexArrayVertexBuffers C.GPVERTEXARRAYVERTEXBUFFERS
+ gpVertexArrayVertexOffsetEXT C.GPVERTEXARRAYVERTEXOFFSETEXT
+ gpVertexAttrib1d C.GPVERTEXATTRIB1D
+ gpVertexAttrib1dv C.GPVERTEXATTRIB1DV
+ gpVertexAttrib1f C.GPVERTEXATTRIB1F
+ gpVertexAttrib1fv C.GPVERTEXATTRIB1FV
+ gpVertexAttrib1s C.GPVERTEXATTRIB1S
+ gpVertexAttrib1sv C.GPVERTEXATTRIB1SV
+ gpVertexAttrib2d C.GPVERTEXATTRIB2D
+ gpVertexAttrib2dv C.GPVERTEXATTRIB2DV
+ gpVertexAttrib2f C.GPVERTEXATTRIB2F
+ gpVertexAttrib2fv C.GPVERTEXATTRIB2FV
+ gpVertexAttrib2s C.GPVERTEXATTRIB2S
+ gpVertexAttrib2sv C.GPVERTEXATTRIB2SV
+ gpVertexAttrib3d C.GPVERTEXATTRIB3D
+ gpVertexAttrib3dv C.GPVERTEXATTRIB3DV
+ gpVertexAttrib3f C.GPVERTEXATTRIB3F
+ gpVertexAttrib3fv C.GPVERTEXATTRIB3FV
+ gpVertexAttrib3s C.GPVERTEXATTRIB3S
+ gpVertexAttrib3sv C.GPVERTEXATTRIB3SV
+ gpVertexAttrib4Nbv C.GPVERTEXATTRIB4NBV
+ gpVertexAttrib4Niv C.GPVERTEXATTRIB4NIV
+ gpVertexAttrib4Nsv C.GPVERTEXATTRIB4NSV
+ gpVertexAttrib4Nub C.GPVERTEXATTRIB4NUB
+ gpVertexAttrib4Nubv C.GPVERTEXATTRIB4NUBV
+ gpVertexAttrib4Nuiv C.GPVERTEXATTRIB4NUIV
+ gpVertexAttrib4Nusv C.GPVERTEXATTRIB4NUSV
+ gpVertexAttrib4bv C.GPVERTEXATTRIB4BV
+ gpVertexAttrib4d C.GPVERTEXATTRIB4D
+ gpVertexAttrib4dv C.GPVERTEXATTRIB4DV
+ gpVertexAttrib4f C.GPVERTEXATTRIB4F
+ gpVertexAttrib4fv C.GPVERTEXATTRIB4FV
+ gpVertexAttrib4iv C.GPVERTEXATTRIB4IV
+ gpVertexAttrib4s C.GPVERTEXATTRIB4S
+ gpVertexAttrib4sv C.GPVERTEXATTRIB4SV
+ gpVertexAttrib4ubv C.GPVERTEXATTRIB4UBV
+ gpVertexAttrib4uiv C.GPVERTEXATTRIB4UIV
+ gpVertexAttrib4usv C.GPVERTEXATTRIB4USV
+ gpVertexAttribBinding C.GPVERTEXATTRIBBINDING
+ gpVertexAttribDivisor C.GPVERTEXATTRIBDIVISOR
+ gpVertexAttribDivisorARB C.GPVERTEXATTRIBDIVISORARB
+ gpVertexAttribFormat C.GPVERTEXATTRIBFORMAT
+ gpVertexAttribFormatNV C.GPVERTEXATTRIBFORMATNV
+ gpVertexAttribI1i C.GPVERTEXATTRIBI1I
+ gpVertexAttribI1iv C.GPVERTEXATTRIBI1IV
+ gpVertexAttribI1ui C.GPVERTEXATTRIBI1UI
+ gpVertexAttribI1uiv C.GPVERTEXATTRIBI1UIV
+ gpVertexAttribI2i C.GPVERTEXATTRIBI2I
+ gpVertexAttribI2iv C.GPVERTEXATTRIBI2IV
+ gpVertexAttribI2ui C.GPVERTEXATTRIBI2UI
+ gpVertexAttribI2uiv C.GPVERTEXATTRIBI2UIV
+ gpVertexAttribI3i C.GPVERTEXATTRIBI3I
+ gpVertexAttribI3iv C.GPVERTEXATTRIBI3IV
+ gpVertexAttribI3ui C.GPVERTEXATTRIBI3UI
+ gpVertexAttribI3uiv C.GPVERTEXATTRIBI3UIV
+ gpVertexAttribI4bv C.GPVERTEXATTRIBI4BV
+ gpVertexAttribI4i C.GPVERTEXATTRIBI4I
+ gpVertexAttribI4iv C.GPVERTEXATTRIBI4IV
+ gpVertexAttribI4sv C.GPVERTEXATTRIBI4SV
+ gpVertexAttribI4ubv C.GPVERTEXATTRIBI4UBV
+ gpVertexAttribI4ui C.GPVERTEXATTRIBI4UI
+ gpVertexAttribI4uiv C.GPVERTEXATTRIBI4UIV
+ gpVertexAttribI4usv C.GPVERTEXATTRIBI4USV
+ gpVertexAttribIFormat C.GPVERTEXATTRIBIFORMAT
+ gpVertexAttribIFormatNV C.GPVERTEXATTRIBIFORMATNV
+ gpVertexAttribIPointer C.GPVERTEXATTRIBIPOINTER
+ gpVertexAttribL1d C.GPVERTEXATTRIBL1D
+ gpVertexAttribL1dv C.GPVERTEXATTRIBL1DV
+ gpVertexAttribL1i64NV C.GPVERTEXATTRIBL1I64NV
+ gpVertexAttribL1i64vNV C.GPVERTEXATTRIBL1I64VNV
+ gpVertexAttribL1ui64ARB C.GPVERTEXATTRIBL1UI64ARB
+ gpVertexAttribL1ui64NV C.GPVERTEXATTRIBL1UI64NV
+ gpVertexAttribL1ui64vARB C.GPVERTEXATTRIBL1UI64VARB
+ gpVertexAttribL1ui64vNV C.GPVERTEXATTRIBL1UI64VNV
+ gpVertexAttribL2d C.GPVERTEXATTRIBL2D
+ gpVertexAttribL2dv C.GPVERTEXATTRIBL2DV
+ gpVertexAttribL2i64NV C.GPVERTEXATTRIBL2I64NV
+ gpVertexAttribL2i64vNV C.GPVERTEXATTRIBL2I64VNV
+ gpVertexAttribL2ui64NV C.GPVERTEXATTRIBL2UI64NV
+ gpVertexAttribL2ui64vNV C.GPVERTEXATTRIBL2UI64VNV
+ gpVertexAttribL3d C.GPVERTEXATTRIBL3D
+ gpVertexAttribL3dv C.GPVERTEXATTRIBL3DV
+ gpVertexAttribL3i64NV C.GPVERTEXATTRIBL3I64NV
+ gpVertexAttribL3i64vNV C.GPVERTEXATTRIBL3I64VNV
+ gpVertexAttribL3ui64NV C.GPVERTEXATTRIBL3UI64NV
+ gpVertexAttribL3ui64vNV C.GPVERTEXATTRIBL3UI64VNV
+ gpVertexAttribL4d C.GPVERTEXATTRIBL4D
+ gpVertexAttribL4dv C.GPVERTEXATTRIBL4DV
+ gpVertexAttribL4i64NV C.GPVERTEXATTRIBL4I64NV
+ gpVertexAttribL4i64vNV C.GPVERTEXATTRIBL4I64VNV
+ gpVertexAttribL4ui64NV C.GPVERTEXATTRIBL4UI64NV
+ gpVertexAttribL4ui64vNV C.GPVERTEXATTRIBL4UI64VNV
+ gpVertexAttribLFormat C.GPVERTEXATTRIBLFORMAT
+ gpVertexAttribLFormatNV C.GPVERTEXATTRIBLFORMATNV
+ gpVertexAttribLPointer C.GPVERTEXATTRIBLPOINTER
+ gpVertexAttribP1ui C.GPVERTEXATTRIBP1UI
+ gpVertexAttribP1uiv C.GPVERTEXATTRIBP1UIV
+ gpVertexAttribP2ui C.GPVERTEXATTRIBP2UI
+ gpVertexAttribP2uiv C.GPVERTEXATTRIBP2UIV
+ gpVertexAttribP3ui C.GPVERTEXATTRIBP3UI
+ gpVertexAttribP3uiv C.GPVERTEXATTRIBP3UIV
+ gpVertexAttribP4ui C.GPVERTEXATTRIBP4UI
+ gpVertexAttribP4uiv C.GPVERTEXATTRIBP4UIV
+ gpVertexAttribPointer C.GPVERTEXATTRIBPOINTER
+ gpVertexBindingDivisor C.GPVERTEXBINDINGDIVISOR
+ gpVertexFormatNV C.GPVERTEXFORMATNV
+ gpViewport C.GPVIEWPORT
+ gpViewportArrayv C.GPVIEWPORTARRAYV
+ gpViewportIndexedf C.GPVIEWPORTINDEXEDF
+ gpViewportIndexedfv C.GPVIEWPORTINDEXEDFV
+ gpViewportPositionWScaleNV C.GPVIEWPORTPOSITIONWSCALENV
+ gpViewportSwizzleNV C.GPVIEWPORTSWIZZLENV
+ gpWaitSync C.GPWAITSYNC
+ gpWaitVkSemaphoreNV C.GPWAITVKSEMAPHORENV
+ gpWeightPathsNV C.GPWEIGHTPATHSNV
+ gpWindowRectanglesEXT C.GPWINDOWRECTANGLESEXT
+)
+
+// Helper functions
+func boolToInt(b bool) int {
+ if b {
+ return 1
+ }
+ return 0
+}
+func ActiveProgramEXT(program uint32) {
+ C.glowActiveProgramEXT(gpActiveProgramEXT, (C.GLuint)(program))
+}
+
+// set the active program object for a program pipeline object
+func ActiveShaderProgram(pipeline uint32, program uint32) {
+ C.glowActiveShaderProgram(gpActiveShaderProgram, (C.GLuint)(pipeline), (C.GLuint)(program))
+}
+func ActiveShaderProgramEXT(pipeline uint32, program uint32) {
+ C.glowActiveShaderProgramEXT(gpActiveShaderProgramEXT, (C.GLuint)(pipeline), (C.GLuint)(program))
+}
+
+// select active texture unit
+func ActiveTexture(texture uint32) {
+ C.glowActiveTexture(gpActiveTexture, (C.GLenum)(texture))
+}
+func ApplyFramebufferAttachmentCMAAINTEL() {
+ C.glowApplyFramebufferAttachmentCMAAINTEL(gpApplyFramebufferAttachmentCMAAINTEL)
+}
+
+// Attaches a shader object to a program object
+func AttachShader(program uint32, shader uint32) {
+ C.glowAttachShader(gpAttachShader, (C.GLuint)(program), (C.GLuint)(shader))
+}
+
+// start conditional rendering
+func BeginConditionalRender(id uint32, mode uint32) {
+ C.glowBeginConditionalRender(gpBeginConditionalRender, (C.GLuint)(id), (C.GLenum)(mode))
+}
+func BeginConditionalRenderNV(id uint32, mode uint32) {
+ C.glowBeginConditionalRenderNV(gpBeginConditionalRenderNV, (C.GLuint)(id), (C.GLenum)(mode))
+}
+func BeginPerfMonitorAMD(monitor uint32) {
+ C.glowBeginPerfMonitorAMD(gpBeginPerfMonitorAMD, (C.GLuint)(monitor))
+}
+func BeginPerfQueryINTEL(queryHandle uint32) {
+ C.glowBeginPerfQueryINTEL(gpBeginPerfQueryINTEL, (C.GLuint)(queryHandle))
+}
+
+// delimit the boundaries of a query object
+func BeginQuery(target uint32, id uint32) {
+ C.glowBeginQuery(gpBeginQuery, (C.GLenum)(target), (C.GLuint)(id))
+}
+func BeginQueryIndexed(target uint32, index uint32, id uint32) {
+ C.glowBeginQueryIndexed(gpBeginQueryIndexed, (C.GLenum)(target), (C.GLuint)(index), (C.GLuint)(id))
+}
+
+// start transform feedback operation
+func BeginTransformFeedback(primitiveMode uint32) {
+ C.glowBeginTransformFeedback(gpBeginTransformFeedback, (C.GLenum)(primitiveMode))
+}
+
+// Associates a generic vertex attribute index with a named attribute variable
+func BindAttribLocation(program uint32, index uint32, name *uint8) {
+ C.glowBindAttribLocation(gpBindAttribLocation, (C.GLuint)(program), (C.GLuint)(index), (*C.GLchar)(unsafe.Pointer(name)))
+}
+
+// bind a named buffer object
+func BindBuffer(target uint32, buffer uint32) {
+ C.glowBindBuffer(gpBindBuffer, (C.GLenum)(target), (C.GLuint)(buffer))
+}
+
+// bind a buffer object to an indexed buffer target
+func BindBufferBase(target uint32, index uint32, buffer uint32) {
+ C.glowBindBufferBase(gpBindBufferBase, (C.GLenum)(target), (C.GLuint)(index), (C.GLuint)(buffer))
+}
+
+// bind a range within a buffer object to an indexed buffer target
+func BindBufferRange(target uint32, index uint32, buffer uint32, offset int, size int) {
+ C.glowBindBufferRange(gpBindBufferRange, (C.GLenum)(target), (C.GLuint)(index), (C.GLuint)(buffer), (C.GLintptr)(offset), (C.GLsizeiptr)(size))
+}
+
+// bind one or more buffer objects to a sequence of indexed buffer targets
+func BindBuffersBase(target uint32, first uint32, count int32, buffers *uint32) {
+ C.glowBindBuffersBase(gpBindBuffersBase, (C.GLenum)(target), (C.GLuint)(first), (C.GLsizei)(count), (*C.GLuint)(unsafe.Pointer(buffers)))
+}
+
+// bind ranges of one or more buffer objects to a sequence of indexed buffer targets
+func BindBuffersRange(target uint32, first uint32, count int32, buffers *uint32, offsets *int, sizes *int) {
+ C.glowBindBuffersRange(gpBindBuffersRange, (C.GLenum)(target), (C.GLuint)(first), (C.GLsizei)(count), (*C.GLuint)(unsafe.Pointer(buffers)), (*C.GLintptr)(unsafe.Pointer(offsets)), (*C.GLsizeiptr)(unsafe.Pointer(sizes)))
+}
+
+// bind a user-defined varying out variable to a fragment shader color number
+func BindFragDataLocation(program uint32, color uint32, name *uint8) {
+ C.glowBindFragDataLocation(gpBindFragDataLocation, (C.GLuint)(program), (C.GLuint)(color), (*C.GLchar)(unsafe.Pointer(name)))
+}
+
+// bind a user-defined varying out variable to a fragment shader color number and index
+func BindFragDataLocationIndexed(program uint32, colorNumber uint32, index uint32, name *uint8) {
+ C.glowBindFragDataLocationIndexed(gpBindFragDataLocationIndexed, (C.GLuint)(program), (C.GLuint)(colorNumber), (C.GLuint)(index), (*C.GLchar)(unsafe.Pointer(name)))
+}
+
+// bind a framebuffer to a framebuffer target
+func BindFramebuffer(target uint32, framebuffer uint32) {
+ C.glowBindFramebuffer(gpBindFramebuffer, (C.GLenum)(target), (C.GLuint)(framebuffer))
+}
+
+// bind a level of a texture to an image unit
+func BindImageTexture(unit uint32, texture uint32, level int32, layered bool, layer int32, access uint32, format uint32) {
+ C.glowBindImageTexture(gpBindImageTexture, (C.GLuint)(unit), (C.GLuint)(texture), (C.GLint)(level), (C.GLboolean)(boolToInt(layered)), (C.GLint)(layer), (C.GLenum)(access), (C.GLenum)(format))
+}
+
+// bind one or more named texture images to a sequence of consecutive image units
+func BindImageTextures(first uint32, count int32, textures *uint32) {
+ C.glowBindImageTextures(gpBindImageTextures, (C.GLuint)(first), (C.GLsizei)(count), (*C.GLuint)(unsafe.Pointer(textures)))
+}
+func BindMultiTextureEXT(texunit uint32, target uint32, texture uint32) {
+ C.glowBindMultiTextureEXT(gpBindMultiTextureEXT, (C.GLenum)(texunit), (C.GLenum)(target), (C.GLuint)(texture))
+}
+
+// bind a program pipeline to the current context
+func BindProgramPipeline(pipeline uint32) {
+ C.glowBindProgramPipeline(gpBindProgramPipeline, (C.GLuint)(pipeline))
+}
+func BindProgramPipelineEXT(pipeline uint32) {
+ C.glowBindProgramPipelineEXT(gpBindProgramPipelineEXT, (C.GLuint)(pipeline))
+}
+
+// bind a renderbuffer to a renderbuffer target
+func BindRenderbuffer(target uint32, renderbuffer uint32) {
+ C.glowBindRenderbuffer(gpBindRenderbuffer, (C.GLenum)(target), (C.GLuint)(renderbuffer))
+}
+
+// bind a named sampler to a texturing target
+func BindSampler(unit uint32, sampler uint32) {
+ C.glowBindSampler(gpBindSampler, (C.GLuint)(unit), (C.GLuint)(sampler))
+}
+
+// bind one or more named sampler objects to a sequence of consecutive sampler units
+func BindSamplers(first uint32, count int32, samplers *uint32) {
+ C.glowBindSamplers(gpBindSamplers, (C.GLuint)(first), (C.GLsizei)(count), (*C.GLuint)(unsafe.Pointer(samplers)))
+}
+func BindShadingRateImageNV(texture uint32) {
+ C.glowBindShadingRateImageNV(gpBindShadingRateImageNV, (C.GLuint)(texture))
+}
+
+// bind a named texture to a texturing target
+func BindTexture(target uint32, texture uint32) {
+ C.glowBindTexture(gpBindTexture, (C.GLenum)(target), (C.GLuint)(texture))
+}
+
+// bind an existing texture object to the specified texture unit
+func BindTextureUnit(unit uint32, texture uint32) {
+ C.glowBindTextureUnit(gpBindTextureUnit, (C.GLuint)(unit), (C.GLuint)(texture))
+}
+
+// bind one or more named textures to a sequence of consecutive texture units
+func BindTextures(first uint32, count int32, textures *uint32) {
+ C.glowBindTextures(gpBindTextures, (C.GLuint)(first), (C.GLsizei)(count), (*C.GLuint)(unsafe.Pointer(textures)))
+}
+
+// bind a transform feedback object
+func BindTransformFeedback(target uint32, id uint32) {
+ C.glowBindTransformFeedback(gpBindTransformFeedback, (C.GLenum)(target), (C.GLuint)(id))
+}
+
+// bind a vertex array object
+func BindVertexArray(array uint32) {
+ C.glowBindVertexArray(gpBindVertexArray, (C.GLuint)(array))
+}
+
+// bind a buffer to a vertex buffer bind point
+func BindVertexBuffer(bindingindex uint32, buffer uint32, offset int, stride int32) {
+ C.glowBindVertexBuffer(gpBindVertexBuffer, (C.GLuint)(bindingindex), (C.GLuint)(buffer), (C.GLintptr)(offset), (C.GLsizei)(stride))
+}
+
+// attach multiple buffer objects to a vertex array object
+func BindVertexBuffers(first uint32, count int32, buffers *uint32, offsets *int, strides *int32) {
+ C.glowBindVertexBuffers(gpBindVertexBuffers, (C.GLuint)(first), (C.GLsizei)(count), (*C.GLuint)(unsafe.Pointer(buffers)), (*C.GLintptr)(unsafe.Pointer(offsets)), (*C.GLsizei)(unsafe.Pointer(strides)))
+}
+func BlendBarrierKHR() {
+ C.glowBlendBarrierKHR(gpBlendBarrierKHR)
+}
+func BlendBarrierNV() {
+ C.glowBlendBarrierNV(gpBlendBarrierNV)
+}
+
+// set the blend color
+func BlendColor(red float32, green float32, blue float32, alpha float32) {
+ C.glowBlendColor(gpBlendColor, (C.GLfloat)(red), (C.GLfloat)(green), (C.GLfloat)(blue), (C.GLfloat)(alpha))
+}
+
+// specify the equation used for both the RGB blend equation and the Alpha blend equation
+func BlendEquation(mode uint32) {
+ C.glowBlendEquation(gpBlendEquation, (C.GLenum)(mode))
+}
+
+// set the RGB blend equation and the alpha blend equation separately
+func BlendEquationSeparate(modeRGB uint32, modeAlpha uint32) {
+ C.glowBlendEquationSeparate(gpBlendEquationSeparate, (C.GLenum)(modeRGB), (C.GLenum)(modeAlpha))
+}
+func BlendEquationSeparateiARB(buf uint32, modeRGB uint32, modeAlpha uint32) {
+ C.glowBlendEquationSeparateiARB(gpBlendEquationSeparateiARB, (C.GLuint)(buf), (C.GLenum)(modeRGB), (C.GLenum)(modeAlpha))
+}
+func BlendEquationiARB(buf uint32, mode uint32) {
+ C.glowBlendEquationiARB(gpBlendEquationiARB, (C.GLuint)(buf), (C.GLenum)(mode))
+}
+
+// specify pixel arithmetic
+func BlendFunc(sfactor uint32, dfactor uint32) {
+ C.glowBlendFunc(gpBlendFunc, (C.GLenum)(sfactor), (C.GLenum)(dfactor))
+}
+
+// specify pixel arithmetic for RGB and alpha components separately
+func BlendFuncSeparate(sfactorRGB uint32, dfactorRGB uint32, sfactorAlpha uint32, dfactorAlpha uint32) {
+ C.glowBlendFuncSeparate(gpBlendFuncSeparate, (C.GLenum)(sfactorRGB), (C.GLenum)(dfactorRGB), (C.GLenum)(sfactorAlpha), (C.GLenum)(dfactorAlpha))
+}
+func BlendFuncSeparateiARB(buf uint32, srcRGB uint32, dstRGB uint32, srcAlpha uint32, dstAlpha uint32) {
+ C.glowBlendFuncSeparateiARB(gpBlendFuncSeparateiARB, (C.GLuint)(buf), (C.GLenum)(srcRGB), (C.GLenum)(dstRGB), (C.GLenum)(srcAlpha), (C.GLenum)(dstAlpha))
+}
+func BlendFunciARB(buf uint32, src uint32, dst uint32) {
+ C.glowBlendFunciARB(gpBlendFunciARB, (C.GLuint)(buf), (C.GLenum)(src), (C.GLenum)(dst))
+}
+func BlendParameteriNV(pname uint32, value int32) {
+ C.glowBlendParameteriNV(gpBlendParameteriNV, (C.GLenum)(pname), (C.GLint)(value))
+}
+
+// copy a block of pixels from one framebuffer object to another
+func BlitFramebuffer(srcX0 int32, srcY0 int32, srcX1 int32, srcY1 int32, dstX0 int32, dstY0 int32, dstX1 int32, dstY1 int32, mask uint32, filter uint32) {
+ C.glowBlitFramebuffer(gpBlitFramebuffer, (C.GLint)(srcX0), (C.GLint)(srcY0), (C.GLint)(srcX1), (C.GLint)(srcY1), (C.GLint)(dstX0), (C.GLint)(dstY0), (C.GLint)(dstX1), (C.GLint)(dstY1), (C.GLbitfield)(mask), (C.GLenum)(filter))
+}
+
+// copy a block of pixels from one framebuffer object to another
+func BlitNamedFramebuffer(readFramebuffer uint32, drawFramebuffer uint32, srcX0 int32, srcY0 int32, srcX1 int32, srcY1 int32, dstX0 int32, dstY0 int32, dstX1 int32, dstY1 int32, mask uint32, filter uint32) {
+ C.glowBlitNamedFramebuffer(gpBlitNamedFramebuffer, (C.GLuint)(readFramebuffer), (C.GLuint)(drawFramebuffer), (C.GLint)(srcX0), (C.GLint)(srcY0), (C.GLint)(srcX1), (C.GLint)(srcY1), (C.GLint)(dstX0), (C.GLint)(dstY0), (C.GLint)(dstX1), (C.GLint)(dstY1), (C.GLbitfield)(mask), (C.GLenum)(filter))
+}
+func BufferAddressRangeNV(pname uint32, index uint32, address uint64, length int) {
+ C.glowBufferAddressRangeNV(gpBufferAddressRangeNV, (C.GLenum)(pname), (C.GLuint)(index), (C.GLuint64EXT)(address), (C.GLsizeiptr)(length))
+}
+func BufferAttachMemoryNV(target uint32, memory uint32, offset uint64) {
+ C.glowBufferAttachMemoryNV(gpBufferAttachMemoryNV, (C.GLenum)(target), (C.GLuint)(memory), (C.GLuint64)(offset))
+}
+
+// creates and initializes a buffer object's data store
+func BufferData(target uint32, size int, data unsafe.Pointer, usage uint32) {
+ C.glowBufferData(gpBufferData, (C.GLenum)(target), (C.GLsizeiptr)(size), data, (C.GLenum)(usage))
+}
+func BufferPageCommitmentARB(target uint32, offset int, size int, commit bool) {
+ C.glowBufferPageCommitmentARB(gpBufferPageCommitmentARB, (C.GLenum)(target), (C.GLintptr)(offset), (C.GLsizeiptr)(size), (C.GLboolean)(boolToInt(commit)))
+}
+func BufferPageCommitmentMemNV(target uint32, offset int, size int, memory uint32, memOffset uint64, commit bool) {
+ C.glowBufferPageCommitmentMemNV(gpBufferPageCommitmentMemNV, (C.GLenum)(target), (C.GLintptr)(offset), (C.GLsizeiptr)(size), (C.GLuint)(memory), (C.GLuint64)(memOffset), (C.GLboolean)(boolToInt(commit)))
+}
+
+// creates and initializes a buffer object's immutable data store
+func BufferStorage(target uint32, size int, data unsafe.Pointer, flags uint32) {
+ C.glowBufferStorage(gpBufferStorage, (C.GLenum)(target), (C.GLsizeiptr)(size), data, (C.GLbitfield)(flags))
+}
+
+// updates a subset of a buffer object's data store
+func BufferSubData(target uint32, offset int, size int, data unsafe.Pointer) {
+ C.glowBufferSubData(gpBufferSubData, (C.GLenum)(target), (C.GLintptr)(offset), (C.GLsizeiptr)(size), data)
+}
+func CallCommandListNV(list uint32) {
+ C.glowCallCommandListNV(gpCallCommandListNV, (C.GLuint)(list))
+}
+
+// check the completeness status of a framebuffer
+func CheckFramebufferStatus(target uint32) uint32 {
+ ret := C.glowCheckFramebufferStatus(gpCheckFramebufferStatus, (C.GLenum)(target))
+ return (uint32)(ret)
+}
+
+// check the completeness status of a framebuffer
+func CheckNamedFramebufferStatus(framebuffer uint32, target uint32) uint32 {
+ ret := C.glowCheckNamedFramebufferStatus(gpCheckNamedFramebufferStatus, (C.GLuint)(framebuffer), (C.GLenum)(target))
+ return (uint32)(ret)
+}
+func CheckNamedFramebufferStatusEXT(framebuffer uint32, target uint32) uint32 {
+ ret := C.glowCheckNamedFramebufferStatusEXT(gpCheckNamedFramebufferStatusEXT, (C.GLuint)(framebuffer), (C.GLenum)(target))
+ return (uint32)(ret)
+}
+
+// specify whether data read via should be clamped
+func ClampColor(target uint32, clamp uint32) {
+ C.glowClampColor(gpClampColor, (C.GLenum)(target), (C.GLenum)(clamp))
+}
+
+// clear buffers to preset values
+func Clear(mask uint32) {
+ C.glowClear(gpClear, (C.GLbitfield)(mask))
+}
+
+// fill a buffer object's data store with a fixed value
+func ClearBufferData(target uint32, internalformat uint32, format uint32, xtype uint32, data unsafe.Pointer) {
+ C.glowClearBufferData(gpClearBufferData, (C.GLenum)(target), (C.GLenum)(internalformat), (C.GLenum)(format), (C.GLenum)(xtype), data)
+}
+
+// fill all or part of buffer object's data store with a fixed value
+func ClearBufferSubData(target uint32, internalformat uint32, offset int, size int, format uint32, xtype uint32, data unsafe.Pointer) {
+ C.glowClearBufferSubData(gpClearBufferSubData, (C.GLenum)(target), (C.GLenum)(internalformat), (C.GLintptr)(offset), (C.GLsizeiptr)(size), (C.GLenum)(format), (C.GLenum)(xtype), data)
+}
+func ClearBufferfi(buffer uint32, drawbuffer int32, depth float32, stencil int32) {
+ C.glowClearBufferfi(gpClearBufferfi, (C.GLenum)(buffer), (C.GLint)(drawbuffer), (C.GLfloat)(depth), (C.GLint)(stencil))
+}
+func ClearBufferfv(buffer uint32, drawbuffer int32, value *float32) {
+ C.glowClearBufferfv(gpClearBufferfv, (C.GLenum)(buffer), (C.GLint)(drawbuffer), (*C.GLfloat)(unsafe.Pointer(value)))
+}
+func ClearBufferiv(buffer uint32, drawbuffer int32, value *int32) {
+ C.glowClearBufferiv(gpClearBufferiv, (C.GLenum)(buffer), (C.GLint)(drawbuffer), (*C.GLint)(unsafe.Pointer(value)))
+}
+func ClearBufferuiv(buffer uint32, drawbuffer int32, value *uint32) {
+ C.glowClearBufferuiv(gpClearBufferuiv, (C.GLenum)(buffer), (C.GLint)(drawbuffer), (*C.GLuint)(unsafe.Pointer(value)))
+}
+
+// specify clear values for the color buffers
+func ClearColor(red float32, green float32, blue float32, alpha float32) {
+ C.glowClearColor(gpClearColor, (C.GLfloat)(red), (C.GLfloat)(green), (C.GLfloat)(blue), (C.GLfloat)(alpha))
+}
+
+// specify the clear value for the depth buffer
+func ClearDepth(depth float64) {
+ C.glowClearDepth(gpClearDepth, (C.GLdouble)(depth))
+}
+func ClearDepthdNV(depth float64) {
+ C.glowClearDepthdNV(gpClearDepthdNV, (C.GLdouble)(depth))
+}
+
+// specify the clear value for the depth buffer
+func ClearDepthf(d float32) {
+ C.glowClearDepthf(gpClearDepthf, (C.GLfloat)(d))
+}
+
+// fill a buffer object's data store with a fixed value
+func ClearNamedBufferData(buffer uint32, internalformat uint32, format uint32, xtype uint32, data unsafe.Pointer) {
+ C.glowClearNamedBufferData(gpClearNamedBufferData, (C.GLuint)(buffer), (C.GLenum)(internalformat), (C.GLenum)(format), (C.GLenum)(xtype), data)
+}
+func ClearNamedBufferDataEXT(buffer uint32, internalformat uint32, format uint32, xtype uint32, data unsafe.Pointer) {
+ C.glowClearNamedBufferDataEXT(gpClearNamedBufferDataEXT, (C.GLuint)(buffer), (C.GLenum)(internalformat), (C.GLenum)(format), (C.GLenum)(xtype), data)
+}
+
+// fill all or part of buffer object's data store with a fixed value
+func ClearNamedBufferSubData(buffer uint32, internalformat uint32, offset int, size int, format uint32, xtype uint32, data unsafe.Pointer) {
+ C.glowClearNamedBufferSubData(gpClearNamedBufferSubData, (C.GLuint)(buffer), (C.GLenum)(internalformat), (C.GLintptr)(offset), (C.GLsizeiptr)(size), (C.GLenum)(format), (C.GLenum)(xtype), data)
+}
+func ClearNamedBufferSubDataEXT(buffer uint32, internalformat uint32, offset int, size int, format uint32, xtype uint32, data unsafe.Pointer) {
+ C.glowClearNamedBufferSubDataEXT(gpClearNamedBufferSubDataEXT, (C.GLuint)(buffer), (C.GLenum)(internalformat), (C.GLsizeiptr)(offset), (C.GLsizeiptr)(size), (C.GLenum)(format), (C.GLenum)(xtype), data)
+}
+func ClearNamedFramebufferfi(framebuffer uint32, buffer uint32, drawbuffer int32, depth float32, stencil int32) {
+ C.glowClearNamedFramebufferfi(gpClearNamedFramebufferfi, (C.GLuint)(framebuffer), (C.GLenum)(buffer), (C.GLint)(drawbuffer), (C.GLfloat)(depth), (C.GLint)(stencil))
+}
+func ClearNamedFramebufferfv(framebuffer uint32, buffer uint32, drawbuffer int32, value *float32) {
+ C.glowClearNamedFramebufferfv(gpClearNamedFramebufferfv, (C.GLuint)(framebuffer), (C.GLenum)(buffer), (C.GLint)(drawbuffer), (*C.GLfloat)(unsafe.Pointer(value)))
+}
+func ClearNamedFramebufferiv(framebuffer uint32, buffer uint32, drawbuffer int32, value *int32) {
+ C.glowClearNamedFramebufferiv(gpClearNamedFramebufferiv, (C.GLuint)(framebuffer), (C.GLenum)(buffer), (C.GLint)(drawbuffer), (*C.GLint)(unsafe.Pointer(value)))
+}
+func ClearNamedFramebufferuiv(framebuffer uint32, buffer uint32, drawbuffer int32, value *uint32) {
+ C.glowClearNamedFramebufferuiv(gpClearNamedFramebufferuiv, (C.GLuint)(framebuffer), (C.GLenum)(buffer), (C.GLint)(drawbuffer), (*C.GLuint)(unsafe.Pointer(value)))
+}
+
+// specify the clear value for the stencil buffer
+func ClearStencil(s int32) {
+ C.glowClearStencil(gpClearStencil, (C.GLint)(s))
+}
+
+// fills all a texture image with a constant value
+func ClearTexImage(texture uint32, level int32, format uint32, xtype uint32, data unsafe.Pointer) {
+ C.glowClearTexImage(gpClearTexImage, (C.GLuint)(texture), (C.GLint)(level), (C.GLenum)(format), (C.GLenum)(xtype), data)
+}
+
+// fills all or part of a texture image with a constant value
+func ClearTexSubImage(texture uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, format uint32, xtype uint32, data unsafe.Pointer) {
+ C.glowClearTexSubImage(gpClearTexSubImage, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLenum)(format), (C.GLenum)(xtype), data)
+}
+func ClientAttribDefaultEXT(mask uint32) {
+ C.glowClientAttribDefaultEXT(gpClientAttribDefaultEXT, (C.GLbitfield)(mask))
+}
+
+// block and wait for a sync object to become signaled
+func ClientWaitSync(sync uintptr, flags uint32, timeout uint64) uint32 {
+ ret := C.glowClientWaitSync(gpClientWaitSync, (C.GLsync)(sync), (C.GLbitfield)(flags), (C.GLuint64)(timeout))
+ return (uint32)(ret)
+}
+
+// control clip coordinate to window coordinate behavior
+func ClipControl(origin uint32, depth uint32) {
+ C.glowClipControl(gpClipControl, (C.GLenum)(origin), (C.GLenum)(depth))
+}
+func ColorFormatNV(size int32, xtype uint32, stride int32) {
+ C.glowColorFormatNV(gpColorFormatNV, (C.GLint)(size), (C.GLenum)(xtype), (C.GLsizei)(stride))
+}
+func ColorMask(red bool, green bool, blue bool, alpha bool) {
+ C.glowColorMask(gpColorMask, (C.GLboolean)(boolToInt(red)), (C.GLboolean)(boolToInt(green)), (C.GLboolean)(boolToInt(blue)), (C.GLboolean)(boolToInt(alpha)))
+}
+func ColorMaski(index uint32, r bool, g bool, b bool, a bool) {
+ C.glowColorMaski(gpColorMaski, (C.GLuint)(index), (C.GLboolean)(boolToInt(r)), (C.GLboolean)(boolToInt(g)), (C.GLboolean)(boolToInt(b)), (C.GLboolean)(boolToInt(a)))
+}
+func CommandListSegmentsNV(list uint32, segments uint32) {
+ C.glowCommandListSegmentsNV(gpCommandListSegmentsNV, (C.GLuint)(list), (C.GLuint)(segments))
+}
+func CompileCommandListNV(list uint32) {
+ C.glowCompileCommandListNV(gpCompileCommandListNV, (C.GLuint)(list))
+}
+
+// Compiles a shader object
+func CompileShader(shader uint32) {
+ C.glowCompileShader(gpCompileShader, (C.GLuint)(shader))
+}
+func CompileShaderIncludeARB(shader uint32, count int32, path **uint8, length *int32) {
+ C.glowCompileShaderIncludeARB(gpCompileShaderIncludeARB, (C.GLuint)(shader), (C.GLsizei)(count), (**C.GLchar)(unsafe.Pointer(path)), (*C.GLint)(unsafe.Pointer(length)))
+}
+func CompressedMultiTexImage1DEXT(texunit uint32, target uint32, level int32, internalformat uint32, width int32, border int32, imageSize int32, bits unsafe.Pointer) {
+ C.glowCompressedMultiTexImage1DEXT(gpCompressedMultiTexImage1DEXT, (C.GLenum)(texunit), (C.GLenum)(target), (C.GLint)(level), (C.GLenum)(internalformat), (C.GLsizei)(width), (C.GLint)(border), (C.GLsizei)(imageSize), bits)
+}
+func CompressedMultiTexImage2DEXT(texunit uint32, target uint32, level int32, internalformat uint32, width int32, height int32, border int32, imageSize int32, bits unsafe.Pointer) {
+ C.glowCompressedMultiTexImage2DEXT(gpCompressedMultiTexImage2DEXT, (C.GLenum)(texunit), (C.GLenum)(target), (C.GLint)(level), (C.GLenum)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLint)(border), (C.GLsizei)(imageSize), bits)
+}
+func CompressedMultiTexImage3DEXT(texunit uint32, target uint32, level int32, internalformat uint32, width int32, height int32, depth int32, border int32, imageSize int32, bits unsafe.Pointer) {
+ C.glowCompressedMultiTexImage3DEXT(gpCompressedMultiTexImage3DEXT, (C.GLenum)(texunit), (C.GLenum)(target), (C.GLint)(level), (C.GLenum)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLint)(border), (C.GLsizei)(imageSize), bits)
+}
+func CompressedMultiTexSubImage1DEXT(texunit uint32, target uint32, level int32, xoffset int32, width int32, format uint32, imageSize int32, bits unsafe.Pointer) {
+ C.glowCompressedMultiTexSubImage1DEXT(gpCompressedMultiTexSubImage1DEXT, (C.GLenum)(texunit), (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLsizei)(width), (C.GLenum)(format), (C.GLsizei)(imageSize), bits)
+}
+func CompressedMultiTexSubImage2DEXT(texunit uint32, target uint32, level int32, xoffset int32, yoffset int32, width int32, height int32, format uint32, imageSize int32, bits unsafe.Pointer) {
+ C.glowCompressedMultiTexSubImage2DEXT(gpCompressedMultiTexSubImage2DEXT, (C.GLenum)(texunit), (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLenum)(format), (C.GLsizei)(imageSize), bits)
+}
+func CompressedMultiTexSubImage3DEXT(texunit uint32, target uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, format uint32, imageSize int32, bits unsafe.Pointer) {
+ C.glowCompressedMultiTexSubImage3DEXT(gpCompressedMultiTexSubImage3DEXT, (C.GLenum)(texunit), (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLenum)(format), (C.GLsizei)(imageSize), bits)
+}
+
+// specify a one-dimensional texture image in a compressed format
+func CompressedTexImage1D(target uint32, level int32, internalformat uint32, width int32, border int32, imageSize int32, data unsafe.Pointer) {
+ C.glowCompressedTexImage1D(gpCompressedTexImage1D, (C.GLenum)(target), (C.GLint)(level), (C.GLenum)(internalformat), (C.GLsizei)(width), (C.GLint)(border), (C.GLsizei)(imageSize), data)
+}
+
+// specify a two-dimensional texture image in a compressed format
+func CompressedTexImage2D(target uint32, level int32, internalformat uint32, width int32, height int32, border int32, imageSize int32, data unsafe.Pointer) {
+ C.glowCompressedTexImage2D(gpCompressedTexImage2D, (C.GLenum)(target), (C.GLint)(level), (C.GLenum)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLint)(border), (C.GLsizei)(imageSize), data)
+}
+
+// specify a three-dimensional texture image in a compressed format
+func CompressedTexImage3D(target uint32, level int32, internalformat uint32, width int32, height int32, depth int32, border int32, imageSize int32, data unsafe.Pointer) {
+ C.glowCompressedTexImage3D(gpCompressedTexImage3D, (C.GLenum)(target), (C.GLint)(level), (C.GLenum)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLint)(border), (C.GLsizei)(imageSize), data)
+}
+
+// specify a one-dimensional texture subimage in a compressed format
+func CompressedTexSubImage1D(target uint32, level int32, xoffset int32, width int32, format uint32, imageSize int32, data unsafe.Pointer) {
+ C.glowCompressedTexSubImage1D(gpCompressedTexSubImage1D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLsizei)(width), (C.GLenum)(format), (C.GLsizei)(imageSize), data)
+}
+
+// specify a two-dimensional texture subimage in a compressed format
+func CompressedTexSubImage2D(target uint32, level int32, xoffset int32, yoffset int32, width int32, height int32, format uint32, imageSize int32, data unsafe.Pointer) {
+ C.glowCompressedTexSubImage2D(gpCompressedTexSubImage2D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLenum)(format), (C.GLsizei)(imageSize), data)
+}
+
+// specify a three-dimensional texture subimage in a compressed format
+func CompressedTexSubImage3D(target uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, format uint32, imageSize int32, data unsafe.Pointer) {
+ C.glowCompressedTexSubImage3D(gpCompressedTexSubImage3D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLenum)(format), (C.GLsizei)(imageSize), data)
+}
+func CompressedTextureImage1DEXT(texture uint32, target uint32, level int32, internalformat uint32, width int32, border int32, imageSize int32, bits unsafe.Pointer) {
+ C.glowCompressedTextureImage1DEXT(gpCompressedTextureImage1DEXT, (C.GLuint)(texture), (C.GLenum)(target), (C.GLint)(level), (C.GLenum)(internalformat), (C.GLsizei)(width), (C.GLint)(border), (C.GLsizei)(imageSize), bits)
+}
+func CompressedTextureImage2DEXT(texture uint32, target uint32, level int32, internalformat uint32, width int32, height int32, border int32, imageSize int32, bits unsafe.Pointer) {
+ C.glowCompressedTextureImage2DEXT(gpCompressedTextureImage2DEXT, (C.GLuint)(texture), (C.GLenum)(target), (C.GLint)(level), (C.GLenum)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLint)(border), (C.GLsizei)(imageSize), bits)
+}
+func CompressedTextureImage3DEXT(texture uint32, target uint32, level int32, internalformat uint32, width int32, height int32, depth int32, border int32, imageSize int32, bits unsafe.Pointer) {
+ C.glowCompressedTextureImage3DEXT(gpCompressedTextureImage3DEXT, (C.GLuint)(texture), (C.GLenum)(target), (C.GLint)(level), (C.GLenum)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLint)(border), (C.GLsizei)(imageSize), bits)
+}
+
+// specify a one-dimensional texture subimage in a compressed format
+func CompressedTextureSubImage1D(texture uint32, level int32, xoffset int32, width int32, format uint32, imageSize int32, data unsafe.Pointer) {
+ C.glowCompressedTextureSubImage1D(gpCompressedTextureSubImage1D, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLsizei)(width), (C.GLenum)(format), (C.GLsizei)(imageSize), data)
+}
+func CompressedTextureSubImage1DEXT(texture uint32, target uint32, level int32, xoffset int32, width int32, format uint32, imageSize int32, bits unsafe.Pointer) {
+ C.glowCompressedTextureSubImage1DEXT(gpCompressedTextureSubImage1DEXT, (C.GLuint)(texture), (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLsizei)(width), (C.GLenum)(format), (C.GLsizei)(imageSize), bits)
+}
+
+// specify a two-dimensional texture subimage in a compressed format
+func CompressedTextureSubImage2D(texture uint32, level int32, xoffset int32, yoffset int32, width int32, height int32, format uint32, imageSize int32, data unsafe.Pointer) {
+ C.glowCompressedTextureSubImage2D(gpCompressedTextureSubImage2D, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLenum)(format), (C.GLsizei)(imageSize), data)
+}
+func CompressedTextureSubImage2DEXT(texture uint32, target uint32, level int32, xoffset int32, yoffset int32, width int32, height int32, format uint32, imageSize int32, bits unsafe.Pointer) {
+ C.glowCompressedTextureSubImage2DEXT(gpCompressedTextureSubImage2DEXT, (C.GLuint)(texture), (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLenum)(format), (C.GLsizei)(imageSize), bits)
+}
+
+// specify a three-dimensional texture subimage in a compressed format
+func CompressedTextureSubImage3D(texture uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, format uint32, imageSize int32, data unsafe.Pointer) {
+ C.glowCompressedTextureSubImage3D(gpCompressedTextureSubImage3D, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLenum)(format), (C.GLsizei)(imageSize), data)
+}
+func CompressedTextureSubImage3DEXT(texture uint32, target uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, format uint32, imageSize int32, bits unsafe.Pointer) {
+ C.glowCompressedTextureSubImage3DEXT(gpCompressedTextureSubImage3DEXT, (C.GLuint)(texture), (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLenum)(format), (C.GLsizei)(imageSize), bits)
+}
+func ConservativeRasterParameterfNV(pname uint32, value float32) {
+ C.glowConservativeRasterParameterfNV(gpConservativeRasterParameterfNV, (C.GLenum)(pname), (C.GLfloat)(value))
+}
+func ConservativeRasterParameteriNV(pname uint32, param int32) {
+ C.glowConservativeRasterParameteriNV(gpConservativeRasterParameteriNV, (C.GLenum)(pname), (C.GLint)(param))
+}
+
+// copy all or part of the data store of a buffer object to the data store of another buffer object
+func CopyBufferSubData(readTarget uint32, writeTarget uint32, readOffset int, writeOffset int, size int) {
+ C.glowCopyBufferSubData(gpCopyBufferSubData, (C.GLenum)(readTarget), (C.GLenum)(writeTarget), (C.GLintptr)(readOffset), (C.GLintptr)(writeOffset), (C.GLsizeiptr)(size))
+}
+
+// perform a raw data copy between two images
+func CopyImageSubData(srcName uint32, srcTarget uint32, srcLevel int32, srcX int32, srcY int32, srcZ int32, dstName uint32, dstTarget uint32, dstLevel int32, dstX int32, dstY int32, dstZ int32, srcWidth int32, srcHeight int32, srcDepth int32) {
+ C.glowCopyImageSubData(gpCopyImageSubData, (C.GLuint)(srcName), (C.GLenum)(srcTarget), (C.GLint)(srcLevel), (C.GLint)(srcX), (C.GLint)(srcY), (C.GLint)(srcZ), (C.GLuint)(dstName), (C.GLenum)(dstTarget), (C.GLint)(dstLevel), (C.GLint)(dstX), (C.GLint)(dstY), (C.GLint)(dstZ), (C.GLsizei)(srcWidth), (C.GLsizei)(srcHeight), (C.GLsizei)(srcDepth))
+}
+func CopyMultiTexImage1DEXT(texunit uint32, target uint32, level int32, internalformat uint32, x int32, y int32, width int32, border int32) {
+ C.glowCopyMultiTexImage1DEXT(gpCopyMultiTexImage1DEXT, (C.GLenum)(texunit), (C.GLenum)(target), (C.GLint)(level), (C.GLenum)(internalformat), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width), (C.GLint)(border))
+}
+func CopyMultiTexImage2DEXT(texunit uint32, target uint32, level int32, internalformat uint32, x int32, y int32, width int32, height int32, border int32) {
+ C.glowCopyMultiTexImage2DEXT(gpCopyMultiTexImage2DEXT, (C.GLenum)(texunit), (C.GLenum)(target), (C.GLint)(level), (C.GLenum)(internalformat), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLint)(border))
+}
+func CopyMultiTexSubImage1DEXT(texunit uint32, target uint32, level int32, xoffset int32, x int32, y int32, width int32) {
+ C.glowCopyMultiTexSubImage1DEXT(gpCopyMultiTexSubImage1DEXT, (C.GLenum)(texunit), (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width))
+}
+func CopyMultiTexSubImage2DEXT(texunit uint32, target uint32, level int32, xoffset int32, yoffset int32, x int32, y int32, width int32, height int32) {
+ C.glowCopyMultiTexSubImage2DEXT(gpCopyMultiTexSubImage2DEXT, (C.GLenum)(texunit), (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width), (C.GLsizei)(height))
+}
+func CopyMultiTexSubImage3DEXT(texunit uint32, target uint32, level int32, xoffset int32, yoffset int32, zoffset int32, x int32, y int32, width int32, height int32) {
+ C.glowCopyMultiTexSubImage3DEXT(gpCopyMultiTexSubImage3DEXT, (C.GLenum)(texunit), (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width), (C.GLsizei)(height))
+}
+
+// copy all or part of the data store of a buffer object to the data store of another buffer object
+func CopyNamedBufferSubData(readBuffer uint32, writeBuffer uint32, readOffset int, writeOffset int, size int) {
+ C.glowCopyNamedBufferSubData(gpCopyNamedBufferSubData, (C.GLuint)(readBuffer), (C.GLuint)(writeBuffer), (C.GLintptr)(readOffset), (C.GLintptr)(writeOffset), (C.GLsizeiptr)(size))
+}
+func CopyPathNV(resultPath uint32, srcPath uint32) {
+ C.glowCopyPathNV(gpCopyPathNV, (C.GLuint)(resultPath), (C.GLuint)(srcPath))
+}
+
+// copy pixels into a 1D texture image
+func CopyTexImage1D(target uint32, level int32, internalformat uint32, x int32, y int32, width int32, border int32) {
+ C.glowCopyTexImage1D(gpCopyTexImage1D, (C.GLenum)(target), (C.GLint)(level), (C.GLenum)(internalformat), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width), (C.GLint)(border))
+}
+
+// copy pixels into a 2D texture image
+func CopyTexImage2D(target uint32, level int32, internalformat uint32, x int32, y int32, width int32, height int32, border int32) {
+ C.glowCopyTexImage2D(gpCopyTexImage2D, (C.GLenum)(target), (C.GLint)(level), (C.GLenum)(internalformat), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLint)(border))
+}
+
+// copy a one-dimensional texture subimage
+func CopyTexSubImage1D(target uint32, level int32, xoffset int32, x int32, y int32, width int32) {
+ C.glowCopyTexSubImage1D(gpCopyTexSubImage1D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width))
+}
+
+// copy a two-dimensional texture subimage
+func CopyTexSubImage2D(target uint32, level int32, xoffset int32, yoffset int32, x int32, y int32, width int32, height int32) {
+ C.glowCopyTexSubImage2D(gpCopyTexSubImage2D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width), (C.GLsizei)(height))
+}
+
+// copy a three-dimensional texture subimage
+func CopyTexSubImage3D(target uint32, level int32, xoffset int32, yoffset int32, zoffset int32, x int32, y int32, width int32, height int32) {
+ C.glowCopyTexSubImage3D(gpCopyTexSubImage3D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width), (C.GLsizei)(height))
+}
+func CopyTextureImage1DEXT(texture uint32, target uint32, level int32, internalformat uint32, x int32, y int32, width int32, border int32) {
+ C.glowCopyTextureImage1DEXT(gpCopyTextureImage1DEXT, (C.GLuint)(texture), (C.GLenum)(target), (C.GLint)(level), (C.GLenum)(internalformat), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width), (C.GLint)(border))
+}
+func CopyTextureImage2DEXT(texture uint32, target uint32, level int32, internalformat uint32, x int32, y int32, width int32, height int32, border int32) {
+ C.glowCopyTextureImage2DEXT(gpCopyTextureImage2DEXT, (C.GLuint)(texture), (C.GLenum)(target), (C.GLint)(level), (C.GLenum)(internalformat), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLint)(border))
+}
+
+// copy a one-dimensional texture subimage
+func CopyTextureSubImage1D(texture uint32, level int32, xoffset int32, x int32, y int32, width int32) {
+ C.glowCopyTextureSubImage1D(gpCopyTextureSubImage1D, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width))
+}
+func CopyTextureSubImage1DEXT(texture uint32, target uint32, level int32, xoffset int32, x int32, y int32, width int32) {
+ C.glowCopyTextureSubImage1DEXT(gpCopyTextureSubImage1DEXT, (C.GLuint)(texture), (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width))
+}
+
+// copy a two-dimensional texture subimage
+func CopyTextureSubImage2D(texture uint32, level int32, xoffset int32, yoffset int32, x int32, y int32, width int32, height int32) {
+ C.glowCopyTextureSubImage2D(gpCopyTextureSubImage2D, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width), (C.GLsizei)(height))
+}
+func CopyTextureSubImage2DEXT(texture uint32, target uint32, level int32, xoffset int32, yoffset int32, x int32, y int32, width int32, height int32) {
+ C.glowCopyTextureSubImage2DEXT(gpCopyTextureSubImage2DEXT, (C.GLuint)(texture), (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width), (C.GLsizei)(height))
+}
+
+// copy a three-dimensional texture subimage
+func CopyTextureSubImage3D(texture uint32, level int32, xoffset int32, yoffset int32, zoffset int32, x int32, y int32, width int32, height int32) {
+ C.glowCopyTextureSubImage3D(gpCopyTextureSubImage3D, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width), (C.GLsizei)(height))
+}
+func CopyTextureSubImage3DEXT(texture uint32, target uint32, level int32, xoffset int32, yoffset int32, zoffset int32, x int32, y int32, width int32, height int32) {
+ C.glowCopyTextureSubImage3DEXT(gpCopyTextureSubImage3DEXT, (C.GLuint)(texture), (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width), (C.GLsizei)(height))
+}
+func CoverFillPathInstancedNV(numPaths int32, pathNameType uint32, paths unsafe.Pointer, pathBase uint32, coverMode uint32, transformType uint32, transformValues *float32) {
+ C.glowCoverFillPathInstancedNV(gpCoverFillPathInstancedNV, (C.GLsizei)(numPaths), (C.GLenum)(pathNameType), paths, (C.GLuint)(pathBase), (C.GLenum)(coverMode), (C.GLenum)(transformType), (*C.GLfloat)(unsafe.Pointer(transformValues)))
+}
+func CoverFillPathNV(path uint32, coverMode uint32) {
+ C.glowCoverFillPathNV(gpCoverFillPathNV, (C.GLuint)(path), (C.GLenum)(coverMode))
+}
+func CoverStrokePathInstancedNV(numPaths int32, pathNameType uint32, paths unsafe.Pointer, pathBase uint32, coverMode uint32, transformType uint32, transformValues *float32) {
+ C.glowCoverStrokePathInstancedNV(gpCoverStrokePathInstancedNV, (C.GLsizei)(numPaths), (C.GLenum)(pathNameType), paths, (C.GLuint)(pathBase), (C.GLenum)(coverMode), (C.GLenum)(transformType), (*C.GLfloat)(unsafe.Pointer(transformValues)))
+}
+func CoverStrokePathNV(path uint32, coverMode uint32) {
+ C.glowCoverStrokePathNV(gpCoverStrokePathNV, (C.GLuint)(path), (C.GLenum)(coverMode))
+}
+func CoverageModulationNV(components uint32) {
+ C.glowCoverageModulationNV(gpCoverageModulationNV, (C.GLenum)(components))
+}
+func CoverageModulationTableNV(n int32, v *float32) {
+ C.glowCoverageModulationTableNV(gpCoverageModulationTableNV, (C.GLsizei)(n), (*C.GLfloat)(unsafe.Pointer(v)))
+}
+
+// create buffer objects
+func CreateBuffers(n int32, buffers *uint32) {
+ C.glowCreateBuffers(gpCreateBuffers, (C.GLsizei)(n), (*C.GLuint)(unsafe.Pointer(buffers)))
+}
+func CreateCommandListsNV(n int32, lists *uint32) {
+ C.glowCreateCommandListsNV(gpCreateCommandListsNV, (C.GLsizei)(n), (*C.GLuint)(unsafe.Pointer(lists)))
+}
+
+// create framebuffer objects
+func CreateFramebuffers(n int32, framebuffers *uint32) {
+ C.glowCreateFramebuffers(gpCreateFramebuffers, (C.GLsizei)(n), (*C.GLuint)(unsafe.Pointer(framebuffers)))
+}
+func CreatePerfQueryINTEL(queryId uint32, queryHandle *uint32) {
+ C.glowCreatePerfQueryINTEL(gpCreatePerfQueryINTEL, (C.GLuint)(queryId), (*C.GLuint)(unsafe.Pointer(queryHandle)))
+}
+
+// Creates a program object
+func CreateProgram() uint32 {
+ ret := C.glowCreateProgram(gpCreateProgram)
+ return (uint32)(ret)
+}
+
+// create program pipeline objects
+func CreateProgramPipelines(n int32, pipelines *uint32) {
+ C.glowCreateProgramPipelines(gpCreateProgramPipelines, (C.GLsizei)(n), (*C.GLuint)(unsafe.Pointer(pipelines)))
+}
+
+// create query objects
+func CreateQueries(target uint32, n int32, ids *uint32) {
+ C.glowCreateQueries(gpCreateQueries, (C.GLenum)(target), (C.GLsizei)(n), (*C.GLuint)(unsafe.Pointer(ids)))
+}
+
+// create renderbuffer objects
+func CreateRenderbuffers(n int32, renderbuffers *uint32) {
+ C.glowCreateRenderbuffers(gpCreateRenderbuffers, (C.GLsizei)(n), (*C.GLuint)(unsafe.Pointer(renderbuffers)))
+}
+
+// create sampler objects
+func CreateSamplers(n int32, samplers *uint32) {
+ C.glowCreateSamplers(gpCreateSamplers, (C.GLsizei)(n), (*C.GLuint)(unsafe.Pointer(samplers)))
+}
+
+// Creates a shader object
+func CreateShader(xtype uint32) uint32 {
+ ret := C.glowCreateShader(gpCreateShader, (C.GLenum)(xtype))
+ return (uint32)(ret)
+}
+func CreateShaderProgramEXT(xtype uint32, xstring *uint8) uint32 {
+ ret := C.glowCreateShaderProgramEXT(gpCreateShaderProgramEXT, (C.GLenum)(xtype), (*C.GLchar)(unsafe.Pointer(xstring)))
+ return (uint32)(ret)
+}
+
+// create a stand-alone program from an array of null-terminated source code strings
+func CreateShaderProgramv(xtype uint32, count int32, strings **uint8) uint32 {
+ ret := C.glowCreateShaderProgramv(gpCreateShaderProgramv, (C.GLenum)(xtype), (C.GLsizei)(count), (**C.GLchar)(unsafe.Pointer(strings)))
+ return (uint32)(ret)
+}
+func CreateShaderProgramvEXT(xtype uint32, count int32, strings **uint8) uint32 {
+ ret := C.glowCreateShaderProgramvEXT(gpCreateShaderProgramvEXT, (C.GLenum)(xtype), (C.GLsizei)(count), (**C.GLchar)(unsafe.Pointer(strings)))
+ return (uint32)(ret)
+}
+func CreateStatesNV(n int32, states *uint32) {
+ C.glowCreateStatesNV(gpCreateStatesNV, (C.GLsizei)(n), (*C.GLuint)(unsafe.Pointer(states)))
+}
+
+// Parameter context has type *C.struct__cl_context.
+// Parameter event has type *C.struct__cl_event.
+func CreateSyncFromCLeventARB(context unsafe.Pointer, event unsafe.Pointer, flags uint32) uintptr {
+ ret := C.glowCreateSyncFromCLeventARB(gpCreateSyncFromCLeventARB, (*C.struct__cl_context)(context), (*C.struct__cl_event)(event), (C.GLbitfield)(flags))
+ return (uintptr)(ret)
+}
+
+// create texture objects
+func CreateTextures(target uint32, n int32, textures *uint32) {
+ C.glowCreateTextures(gpCreateTextures, (C.GLenum)(target), (C.GLsizei)(n), (*C.GLuint)(unsafe.Pointer(textures)))
+}
+
+// create transform feedback objects
+func CreateTransformFeedbacks(n int32, ids *uint32) {
+ C.glowCreateTransformFeedbacks(gpCreateTransformFeedbacks, (C.GLsizei)(n), (*C.GLuint)(unsafe.Pointer(ids)))
+}
+
+// create vertex array objects
+func CreateVertexArrays(n int32, arrays *uint32) {
+ C.glowCreateVertexArrays(gpCreateVertexArrays, (C.GLsizei)(n), (*C.GLuint)(unsafe.Pointer(arrays)))
+}
+
+// specify whether front- or back-facing facets can be culled
+func CullFace(mode uint32) {
+ C.glowCullFace(gpCullFace, (C.GLenum)(mode))
+}
+
+// specify a callback to receive debugging messages from the GL
+func DebugMessageCallback(callback DebugProc, userParam unsafe.Pointer) {
+ userDebugCallback = callback
+ C.glowDebugMessageCallback(gpDebugMessageCallback, (C.GLDEBUGPROC)(unsafe.Pointer(&callback)), userParam)
+}
+func DebugMessageCallbackARB(callback DebugProc, userParam unsafe.Pointer) {
+ userDebugCallback = callback
+ C.glowDebugMessageCallbackARB(gpDebugMessageCallbackARB, (C.GLDEBUGPROCARB)(unsafe.Pointer(&callback)), userParam)
+}
+func DebugMessageCallbackKHR(callback DebugProc, userParam unsafe.Pointer) {
+ userDebugCallback = callback
+ C.glowDebugMessageCallbackKHR(gpDebugMessageCallbackKHR, (C.GLDEBUGPROCKHR)(unsafe.Pointer(&callback)), userParam)
+}
+
+// control the reporting of debug messages in a debug context
+func DebugMessageControl(source uint32, xtype uint32, severity uint32, count int32, ids *uint32, enabled bool) {
+ C.glowDebugMessageControl(gpDebugMessageControl, (C.GLenum)(source), (C.GLenum)(xtype), (C.GLenum)(severity), (C.GLsizei)(count), (*C.GLuint)(unsafe.Pointer(ids)), (C.GLboolean)(boolToInt(enabled)))
+}
+func DebugMessageControlARB(source uint32, xtype uint32, severity uint32, count int32, ids *uint32, enabled bool) {
+ C.glowDebugMessageControlARB(gpDebugMessageControlARB, (C.GLenum)(source), (C.GLenum)(xtype), (C.GLenum)(severity), (C.GLsizei)(count), (*C.GLuint)(unsafe.Pointer(ids)), (C.GLboolean)(boolToInt(enabled)))
+}
+func DebugMessageControlKHR(source uint32, xtype uint32, severity uint32, count int32, ids *uint32, enabled bool) {
+ C.glowDebugMessageControlKHR(gpDebugMessageControlKHR, (C.GLenum)(source), (C.GLenum)(xtype), (C.GLenum)(severity), (C.GLsizei)(count), (*C.GLuint)(unsafe.Pointer(ids)), (C.GLboolean)(boolToInt(enabled)))
+}
+
+// inject an application-supplied message into the debug message queue
+func DebugMessageInsert(source uint32, xtype uint32, id uint32, severity uint32, length int32, buf *uint8) {
+ C.glowDebugMessageInsert(gpDebugMessageInsert, (C.GLenum)(source), (C.GLenum)(xtype), (C.GLuint)(id), (C.GLenum)(severity), (C.GLsizei)(length), (*C.GLchar)(unsafe.Pointer(buf)))
+}
+func DebugMessageInsertARB(source uint32, xtype uint32, id uint32, severity uint32, length int32, buf *uint8) {
+ C.glowDebugMessageInsertARB(gpDebugMessageInsertARB, (C.GLenum)(source), (C.GLenum)(xtype), (C.GLuint)(id), (C.GLenum)(severity), (C.GLsizei)(length), (*C.GLchar)(unsafe.Pointer(buf)))
+}
+func DebugMessageInsertKHR(source uint32, xtype uint32, id uint32, severity uint32, length int32, buf *uint8) {
+ C.glowDebugMessageInsertKHR(gpDebugMessageInsertKHR, (C.GLenum)(source), (C.GLenum)(xtype), (C.GLuint)(id), (C.GLenum)(severity), (C.GLsizei)(length), (*C.GLchar)(unsafe.Pointer(buf)))
+}
+
+// delete named buffer objects
+func DeleteBuffers(n int32, buffers *uint32) {
+ C.glowDeleteBuffers(gpDeleteBuffers, (C.GLsizei)(n), (*C.GLuint)(unsafe.Pointer(buffers)))
+}
+func DeleteCommandListsNV(n int32, lists *uint32) {
+ C.glowDeleteCommandListsNV(gpDeleteCommandListsNV, (C.GLsizei)(n), (*C.GLuint)(unsafe.Pointer(lists)))
+}
+
+// delete framebuffer objects
+func DeleteFramebuffers(n int32, framebuffers *uint32) {
+ C.glowDeleteFramebuffers(gpDeleteFramebuffers, (C.GLsizei)(n), (*C.GLuint)(unsafe.Pointer(framebuffers)))
+}
+func DeleteNamedStringARB(namelen int32, name *uint8) {
+ C.glowDeleteNamedStringARB(gpDeleteNamedStringARB, (C.GLint)(namelen), (*C.GLchar)(unsafe.Pointer(name)))
+}
+func DeletePathsNV(path uint32, xrange int32) {
+ C.glowDeletePathsNV(gpDeletePathsNV, (C.GLuint)(path), (C.GLsizei)(xrange))
+}
+func DeletePerfMonitorsAMD(n int32, monitors *uint32) {
+ C.glowDeletePerfMonitorsAMD(gpDeletePerfMonitorsAMD, (C.GLsizei)(n), (*C.GLuint)(unsafe.Pointer(monitors)))
+}
+func DeletePerfQueryINTEL(queryHandle uint32) {
+ C.glowDeletePerfQueryINTEL(gpDeletePerfQueryINTEL, (C.GLuint)(queryHandle))
+}
+
+// Deletes a program object
+func DeleteProgram(program uint32) {
+ C.glowDeleteProgram(gpDeleteProgram, (C.GLuint)(program))
+}
+
+// delete program pipeline objects
+func DeleteProgramPipelines(n int32, pipelines *uint32) {
+ C.glowDeleteProgramPipelines(gpDeleteProgramPipelines, (C.GLsizei)(n), (*C.GLuint)(unsafe.Pointer(pipelines)))
+}
+func DeleteProgramPipelinesEXT(n int32, pipelines *uint32) {
+ C.glowDeleteProgramPipelinesEXT(gpDeleteProgramPipelinesEXT, (C.GLsizei)(n), (*C.GLuint)(unsafe.Pointer(pipelines)))
+}
+
+// delete named query objects
+func DeleteQueries(n int32, ids *uint32) {
+ C.glowDeleteQueries(gpDeleteQueries, (C.GLsizei)(n), (*C.GLuint)(unsafe.Pointer(ids)))
+}
+
+// delete renderbuffer objects
+func DeleteRenderbuffers(n int32, renderbuffers *uint32) {
+ C.glowDeleteRenderbuffers(gpDeleteRenderbuffers, (C.GLsizei)(n), (*C.GLuint)(unsafe.Pointer(renderbuffers)))
+}
+
+// delete named sampler objects
+func DeleteSamplers(count int32, samplers *uint32) {
+ C.glowDeleteSamplers(gpDeleteSamplers, (C.GLsizei)(count), (*C.GLuint)(unsafe.Pointer(samplers)))
+}
+
+// Deletes a shader object
+func DeleteShader(shader uint32) {
+ C.glowDeleteShader(gpDeleteShader, (C.GLuint)(shader))
+}
+func DeleteStatesNV(n int32, states *uint32) {
+ C.glowDeleteStatesNV(gpDeleteStatesNV, (C.GLsizei)(n), (*C.GLuint)(unsafe.Pointer(states)))
+}
+
+// delete a sync object
+func DeleteSync(sync uintptr) {
+ C.glowDeleteSync(gpDeleteSync, (C.GLsync)(sync))
+}
+
+// delete named textures
+func DeleteTextures(n int32, textures *uint32) {
+ C.glowDeleteTextures(gpDeleteTextures, (C.GLsizei)(n), (*C.GLuint)(unsafe.Pointer(textures)))
+}
+
+// delete transform feedback objects
+func DeleteTransformFeedbacks(n int32, ids *uint32) {
+ C.glowDeleteTransformFeedbacks(gpDeleteTransformFeedbacks, (C.GLsizei)(n), (*C.GLuint)(unsafe.Pointer(ids)))
+}
+
+// delete vertex array objects
+func DeleteVertexArrays(n int32, arrays *uint32) {
+ C.glowDeleteVertexArrays(gpDeleteVertexArrays, (C.GLsizei)(n), (*C.GLuint)(unsafe.Pointer(arrays)))
+}
+func DepthBoundsdNV(zmin float64, zmax float64) {
+ C.glowDepthBoundsdNV(gpDepthBoundsdNV, (C.GLdouble)(zmin), (C.GLdouble)(zmax))
+}
+
+// specify the value used for depth buffer comparisons
+func DepthFunc(xfunc uint32) {
+ C.glowDepthFunc(gpDepthFunc, (C.GLenum)(xfunc))
+}
+
+// enable or disable writing into the depth buffer
+func DepthMask(flag bool) {
+ C.glowDepthMask(gpDepthMask, (C.GLboolean)(boolToInt(flag)))
+}
+
+// specify mapping of depth values from normalized device coordinates to window coordinates
+func DepthRange(n float64, f float64) {
+ C.glowDepthRange(gpDepthRange, (C.GLdouble)(n), (C.GLdouble)(f))
+}
+func DepthRangeArraydvNV(first uint32, count int32, v *float64) {
+ C.glowDepthRangeArraydvNV(gpDepthRangeArraydvNV, (C.GLuint)(first), (C.GLsizei)(count), (*C.GLdouble)(unsafe.Pointer(v)))
+}
+func DepthRangeArrayv(first uint32, count int32, v *float64) {
+ C.glowDepthRangeArrayv(gpDepthRangeArrayv, (C.GLuint)(first), (C.GLsizei)(count), (*C.GLdouble)(unsafe.Pointer(v)))
+}
+
+// specify mapping of depth values from normalized device coordinates to window coordinates for a specified viewport
+func DepthRangeIndexed(index uint32, n float64, f float64) {
+ C.glowDepthRangeIndexed(gpDepthRangeIndexed, (C.GLuint)(index), (C.GLdouble)(n), (C.GLdouble)(f))
+}
+func DepthRangeIndexeddNV(index uint32, n float64, f float64) {
+ C.glowDepthRangeIndexeddNV(gpDepthRangeIndexeddNV, (C.GLuint)(index), (C.GLdouble)(n), (C.GLdouble)(f))
+}
+func DepthRangedNV(zNear float64, zFar float64) {
+ C.glowDepthRangedNV(gpDepthRangedNV, (C.GLdouble)(zNear), (C.GLdouble)(zFar))
+}
+
+// specify mapping of depth values from normalized device coordinates to window coordinates
+func DepthRangef(n float32, f float32) {
+ C.glowDepthRangef(gpDepthRangef, (C.GLfloat)(n), (C.GLfloat)(f))
+}
+
+// Detaches a shader object from a program object to which it is attached
+func DetachShader(program uint32, shader uint32) {
+ C.glowDetachShader(gpDetachShader, (C.GLuint)(program), (C.GLuint)(shader))
+}
+func Disable(cap uint32) {
+ C.glowDisable(gpDisable, (C.GLenum)(cap))
+}
+func DisableClientStateIndexedEXT(array uint32, index uint32) {
+ C.glowDisableClientStateIndexedEXT(gpDisableClientStateIndexedEXT, (C.GLenum)(array), (C.GLuint)(index))
+}
+func DisableClientStateiEXT(array uint32, index uint32) {
+ C.glowDisableClientStateiEXT(gpDisableClientStateiEXT, (C.GLenum)(array), (C.GLuint)(index))
+}
+func DisableIndexedEXT(target uint32, index uint32) {
+ C.glowDisableIndexedEXT(gpDisableIndexedEXT, (C.GLenum)(target), (C.GLuint)(index))
+}
+
+// Enable or disable a generic vertex attribute array
+func DisableVertexArrayAttrib(vaobj uint32, index uint32) {
+ C.glowDisableVertexArrayAttrib(gpDisableVertexArrayAttrib, (C.GLuint)(vaobj), (C.GLuint)(index))
+}
+func DisableVertexArrayAttribEXT(vaobj uint32, index uint32) {
+ C.glowDisableVertexArrayAttribEXT(gpDisableVertexArrayAttribEXT, (C.GLuint)(vaobj), (C.GLuint)(index))
+}
+func DisableVertexArrayEXT(vaobj uint32, array uint32) {
+ C.glowDisableVertexArrayEXT(gpDisableVertexArrayEXT, (C.GLuint)(vaobj), (C.GLenum)(array))
+}
+
+// Enable or disable a generic vertex attribute array
+func DisableVertexAttribArray(index uint32) {
+ C.glowDisableVertexAttribArray(gpDisableVertexAttribArray, (C.GLuint)(index))
+}
+func Disablei(target uint32, index uint32) {
+ C.glowDisablei(gpDisablei, (C.GLenum)(target), (C.GLuint)(index))
+}
+
+// launch one or more compute work groups
+func DispatchCompute(num_groups_x uint32, num_groups_y uint32, num_groups_z uint32) {
+ C.glowDispatchCompute(gpDispatchCompute, (C.GLuint)(num_groups_x), (C.GLuint)(num_groups_y), (C.GLuint)(num_groups_z))
+}
+func DispatchComputeGroupSizeARB(num_groups_x uint32, num_groups_y uint32, num_groups_z uint32, group_size_x uint32, group_size_y uint32, group_size_z uint32) {
+ C.glowDispatchComputeGroupSizeARB(gpDispatchComputeGroupSizeARB, (C.GLuint)(num_groups_x), (C.GLuint)(num_groups_y), (C.GLuint)(num_groups_z), (C.GLuint)(group_size_x), (C.GLuint)(group_size_y), (C.GLuint)(group_size_z))
+}
+
+// launch one or more compute work groups using parameters stored in a buffer
+func DispatchComputeIndirect(indirect int) {
+ C.glowDispatchComputeIndirect(gpDispatchComputeIndirect, (C.GLintptr)(indirect))
+}
+
+// render primitives from array data
+func DrawArrays(mode uint32, first int32, count int32) {
+ C.glowDrawArrays(gpDrawArrays, (C.GLenum)(mode), (C.GLint)(first), (C.GLsizei)(count))
+}
+
+// render primitives from array data, taking parameters from memory
+func DrawArraysIndirect(mode uint32, indirect unsafe.Pointer) {
+ C.glowDrawArraysIndirect(gpDrawArraysIndirect, (C.GLenum)(mode), indirect)
+}
+
+// draw multiple instances of a range of elements
+func DrawArraysInstanced(mode uint32, first int32, count int32, instancecount int32) {
+ C.glowDrawArraysInstanced(gpDrawArraysInstanced, (C.GLenum)(mode), (C.GLint)(first), (C.GLsizei)(count), (C.GLsizei)(instancecount))
+}
+func DrawArraysInstancedARB(mode uint32, first int32, count int32, primcount int32) {
+ C.glowDrawArraysInstancedARB(gpDrawArraysInstancedARB, (C.GLenum)(mode), (C.GLint)(first), (C.GLsizei)(count), (C.GLsizei)(primcount))
+}
+
+// draw multiple instances of a range of elements with offset applied to instanced attributes
+func DrawArraysInstancedBaseInstance(mode uint32, first int32, count int32, instancecount int32, baseinstance uint32) {
+ C.glowDrawArraysInstancedBaseInstance(gpDrawArraysInstancedBaseInstance, (C.GLenum)(mode), (C.GLint)(first), (C.GLsizei)(count), (C.GLsizei)(instancecount), (C.GLuint)(baseinstance))
+}
+func DrawArraysInstancedEXT(mode uint32, start int32, count int32, primcount int32) {
+ C.glowDrawArraysInstancedEXT(gpDrawArraysInstancedEXT, (C.GLenum)(mode), (C.GLint)(start), (C.GLsizei)(count), (C.GLsizei)(primcount))
+}
+
+// specify which color buffers are to be drawn into
+func DrawBuffer(buf uint32) {
+ C.glowDrawBuffer(gpDrawBuffer, (C.GLenum)(buf))
+}
+
+// Specifies a list of color buffers to be drawn into
+func DrawBuffers(n int32, bufs *uint32) {
+ C.glowDrawBuffers(gpDrawBuffers, (C.GLsizei)(n), (*C.GLenum)(unsafe.Pointer(bufs)))
+}
+func DrawCommandsAddressNV(primitiveMode uint32, indirects *uint64, sizes *int32, count uint32) {
+ C.glowDrawCommandsAddressNV(gpDrawCommandsAddressNV, (C.GLenum)(primitiveMode), (*C.GLuint64)(unsafe.Pointer(indirects)), (*C.GLsizei)(unsafe.Pointer(sizes)), (C.GLuint)(count))
+}
+func DrawCommandsNV(primitiveMode uint32, buffer uint32, indirects *int, sizes *int32, count uint32) {
+ C.glowDrawCommandsNV(gpDrawCommandsNV, (C.GLenum)(primitiveMode), (C.GLuint)(buffer), (*C.GLintptr)(unsafe.Pointer(indirects)), (*C.GLsizei)(unsafe.Pointer(sizes)), (C.GLuint)(count))
+}
+func DrawCommandsStatesAddressNV(indirects *uint64, sizes *int32, states *uint32, fbos *uint32, count uint32) {
+ C.glowDrawCommandsStatesAddressNV(gpDrawCommandsStatesAddressNV, (*C.GLuint64)(unsafe.Pointer(indirects)), (*C.GLsizei)(unsafe.Pointer(sizes)), (*C.GLuint)(unsafe.Pointer(states)), (*C.GLuint)(unsafe.Pointer(fbos)), (C.GLuint)(count))
+}
+func DrawCommandsStatesNV(buffer uint32, indirects *int, sizes *int32, states *uint32, fbos *uint32, count uint32) {
+ C.glowDrawCommandsStatesNV(gpDrawCommandsStatesNV, (C.GLuint)(buffer), (*C.GLintptr)(unsafe.Pointer(indirects)), (*C.GLsizei)(unsafe.Pointer(sizes)), (*C.GLuint)(unsafe.Pointer(states)), (*C.GLuint)(unsafe.Pointer(fbos)), (C.GLuint)(count))
+}
+
+// render primitives from array data
+func DrawElements(mode uint32, count int32, xtype uint32, indices unsafe.Pointer) {
+ C.glowDrawElements(gpDrawElements, (C.GLenum)(mode), (C.GLsizei)(count), (C.GLenum)(xtype), indices)
+}
+func DrawElementsWithOffset(mode uint32, count int32, xtype uint32, indices uintptr) {
+ C.glowDrawElementsWithOffset(gpDrawElements, (C.GLenum)(mode), (C.GLsizei)(count), (C.GLenum)(xtype), (C.uintptr_t)(indices))
+}
+
+// render primitives from array data with a per-element offset
+func DrawElementsBaseVertex(mode uint32, count int32, xtype uint32, indices unsafe.Pointer, basevertex int32) {
+ C.glowDrawElementsBaseVertex(gpDrawElementsBaseVertex, (C.GLenum)(mode), (C.GLsizei)(count), (C.GLenum)(xtype), indices, (C.GLint)(basevertex))
+}
+func DrawElementsBaseVertexWithOffset(mode uint32, count int32, xtype uint32, indices uintptr, basevertex int32) {
+ C.glowDrawElementsBaseVertexWithOffset(gpDrawElementsBaseVertex, (C.GLenum)(mode), (C.GLsizei)(count), (C.GLenum)(xtype), (C.uintptr_t)(indices), (C.GLint)(basevertex))
+}
+
+// render indexed primitives from array data, taking parameters from memory
+func DrawElementsIndirect(mode uint32, xtype uint32, indirect unsafe.Pointer) {
+ C.glowDrawElementsIndirect(gpDrawElementsIndirect, (C.GLenum)(mode), (C.GLenum)(xtype), indirect)
+}
+
+// draw multiple instances of a set of elements
+func DrawElementsInstanced(mode uint32, count int32, xtype uint32, indices unsafe.Pointer, instancecount int32) {
+ C.glowDrawElementsInstanced(gpDrawElementsInstanced, (C.GLenum)(mode), (C.GLsizei)(count), (C.GLenum)(xtype), indices, (C.GLsizei)(instancecount))
+}
+func DrawElementsInstancedARB(mode uint32, count int32, xtype uint32, indices unsafe.Pointer, primcount int32) {
+ C.glowDrawElementsInstancedARB(gpDrawElementsInstancedARB, (C.GLenum)(mode), (C.GLsizei)(count), (C.GLenum)(xtype), indices, (C.GLsizei)(primcount))
+}
+
+// draw multiple instances of a set of elements with offset applied to instanced attributes
+func DrawElementsInstancedBaseInstance(mode uint32, count int32, xtype uint32, indices unsafe.Pointer, instancecount int32, baseinstance uint32) {
+ C.glowDrawElementsInstancedBaseInstance(gpDrawElementsInstancedBaseInstance, (C.GLenum)(mode), (C.GLsizei)(count), (C.GLenum)(xtype), indices, (C.GLsizei)(instancecount), (C.GLuint)(baseinstance))
+}
+
+// render multiple instances of a set of primitives from array data with a per-element offset
+func DrawElementsInstancedBaseVertex(mode uint32, count int32, xtype uint32, indices unsafe.Pointer, instancecount int32, basevertex int32) {
+ C.glowDrawElementsInstancedBaseVertex(gpDrawElementsInstancedBaseVertex, (C.GLenum)(mode), (C.GLsizei)(count), (C.GLenum)(xtype), indices, (C.GLsizei)(instancecount), (C.GLint)(basevertex))
+}
+
+// render multiple instances of a set of primitives from array data with a per-element offset
+func DrawElementsInstancedBaseVertexBaseInstance(mode uint32, count int32, xtype uint32, indices unsafe.Pointer, instancecount int32, basevertex int32, baseinstance uint32) {
+ C.glowDrawElementsInstancedBaseVertexBaseInstance(gpDrawElementsInstancedBaseVertexBaseInstance, (C.GLenum)(mode), (C.GLsizei)(count), (C.GLenum)(xtype), indices, (C.GLsizei)(instancecount), (C.GLint)(basevertex), (C.GLuint)(baseinstance))
+}
+func DrawElementsInstancedEXT(mode uint32, count int32, xtype uint32, indices unsafe.Pointer, primcount int32) {
+ C.glowDrawElementsInstancedEXT(gpDrawElementsInstancedEXT, (C.GLenum)(mode), (C.GLsizei)(count), (C.GLenum)(xtype), indices, (C.GLsizei)(primcount))
+}
+func DrawMeshTasksIndirectNV(indirect int) {
+ C.glowDrawMeshTasksIndirectNV(gpDrawMeshTasksIndirectNV, (C.GLintptr)(indirect))
+}
+func DrawMeshTasksNV(first uint32, count uint32) {
+ C.glowDrawMeshTasksNV(gpDrawMeshTasksNV, (C.GLuint)(first), (C.GLuint)(count))
+}
+
+// render primitives from array data
+func DrawRangeElements(mode uint32, start uint32, end uint32, count int32, xtype uint32, indices unsafe.Pointer) {
+ C.glowDrawRangeElements(gpDrawRangeElements, (C.GLenum)(mode), (C.GLuint)(start), (C.GLuint)(end), (C.GLsizei)(count), (C.GLenum)(xtype), indices)
+}
+
+// render primitives from array data with a per-element offset
+func DrawRangeElementsBaseVertex(mode uint32, start uint32, end uint32, count int32, xtype uint32, indices unsafe.Pointer, basevertex int32) {
+ C.glowDrawRangeElementsBaseVertex(gpDrawRangeElementsBaseVertex, (C.GLenum)(mode), (C.GLuint)(start), (C.GLuint)(end), (C.GLsizei)(count), (C.GLenum)(xtype), indices, (C.GLint)(basevertex))
+}
+
+// render primitives using a count derived from a transform feedback object
+func DrawTransformFeedback(mode uint32, id uint32) {
+ C.glowDrawTransformFeedback(gpDrawTransformFeedback, (C.GLenum)(mode), (C.GLuint)(id))
+}
+
+// render multiple instances of primitives using a count derived from a transform feedback object
+func DrawTransformFeedbackInstanced(mode uint32, id uint32, instancecount int32) {
+ C.glowDrawTransformFeedbackInstanced(gpDrawTransformFeedbackInstanced, (C.GLenum)(mode), (C.GLuint)(id), (C.GLsizei)(instancecount))
+}
+
+// render primitives using a count derived from a specifed stream of a transform feedback object
+func DrawTransformFeedbackStream(mode uint32, id uint32, stream uint32) {
+ C.glowDrawTransformFeedbackStream(gpDrawTransformFeedbackStream, (C.GLenum)(mode), (C.GLuint)(id), (C.GLuint)(stream))
+}
+
+// render multiple instances of primitives using a count derived from a specifed stream of a transform feedback object
+func DrawTransformFeedbackStreamInstanced(mode uint32, id uint32, stream uint32, instancecount int32) {
+ C.glowDrawTransformFeedbackStreamInstanced(gpDrawTransformFeedbackStreamInstanced, (C.GLenum)(mode), (C.GLuint)(id), (C.GLuint)(stream), (C.GLsizei)(instancecount))
+}
+func DrawVkImageNV(vkImage uint64, sampler uint32, x0 float32, y0 float32, x1 float32, y1 float32, z float32, s0 float32, t0 float32, s1 float32, t1 float32) {
+ C.glowDrawVkImageNV(gpDrawVkImageNV, (C.GLuint64)(vkImage), (C.GLuint)(sampler), (C.GLfloat)(x0), (C.GLfloat)(y0), (C.GLfloat)(x1), (C.GLfloat)(y1), (C.GLfloat)(z), (C.GLfloat)(s0), (C.GLfloat)(t0), (C.GLfloat)(s1), (C.GLfloat)(t1))
+}
+
+// Parameter image has type C.GLeglImageOES.
+func EGLImageTargetTexStorageEXT(target uint32, image unsafe.Pointer, attrib_list *int32) {
+ C.glowEGLImageTargetTexStorageEXT(gpEGLImageTargetTexStorageEXT, (C.GLenum)(target), (C.GLeglImageOES)(image), (*C.GLint)(unsafe.Pointer(attrib_list)))
+}
+
+// Parameter image has type C.GLeglImageOES.
+func EGLImageTargetTextureStorageEXT(texture uint32, image unsafe.Pointer, attrib_list *int32) {
+ C.glowEGLImageTargetTextureStorageEXT(gpEGLImageTargetTextureStorageEXT, (C.GLuint)(texture), (C.GLeglImageOES)(image), (*C.GLint)(unsafe.Pointer(attrib_list)))
+}
+func EdgeFlagFormatNV(stride int32) {
+ C.glowEdgeFlagFormatNV(gpEdgeFlagFormatNV, (C.GLsizei)(stride))
+}
+
+// enable or disable server-side GL capabilities
+func Enable(cap uint32) {
+ C.glowEnable(gpEnable, (C.GLenum)(cap))
+}
+func EnableClientStateIndexedEXT(array uint32, index uint32) {
+ C.glowEnableClientStateIndexedEXT(gpEnableClientStateIndexedEXT, (C.GLenum)(array), (C.GLuint)(index))
+}
+func EnableClientStateiEXT(array uint32, index uint32) {
+ C.glowEnableClientStateiEXT(gpEnableClientStateiEXT, (C.GLenum)(array), (C.GLuint)(index))
+}
+func EnableIndexedEXT(target uint32, index uint32) {
+ C.glowEnableIndexedEXT(gpEnableIndexedEXT, (C.GLenum)(target), (C.GLuint)(index))
+}
+
+// Enable or disable a generic vertex attribute array
+func EnableVertexArrayAttrib(vaobj uint32, index uint32) {
+ C.glowEnableVertexArrayAttrib(gpEnableVertexArrayAttrib, (C.GLuint)(vaobj), (C.GLuint)(index))
+}
+func EnableVertexArrayAttribEXT(vaobj uint32, index uint32) {
+ C.glowEnableVertexArrayAttribEXT(gpEnableVertexArrayAttribEXT, (C.GLuint)(vaobj), (C.GLuint)(index))
+}
+func EnableVertexArrayEXT(vaobj uint32, array uint32) {
+ C.glowEnableVertexArrayEXT(gpEnableVertexArrayEXT, (C.GLuint)(vaobj), (C.GLenum)(array))
+}
+
+// Enable or disable a generic vertex attribute array
+func EnableVertexAttribArray(index uint32) {
+ C.glowEnableVertexAttribArray(gpEnableVertexAttribArray, (C.GLuint)(index))
+}
+func Enablei(target uint32, index uint32) {
+ C.glowEnablei(gpEnablei, (C.GLenum)(target), (C.GLuint)(index))
+}
+func EndConditionalRender() {
+ C.glowEndConditionalRender(gpEndConditionalRender)
+}
+func EndConditionalRenderNV() {
+ C.glowEndConditionalRenderNV(gpEndConditionalRenderNV)
+}
+func EndPerfMonitorAMD(monitor uint32) {
+ C.glowEndPerfMonitorAMD(gpEndPerfMonitorAMD, (C.GLuint)(monitor))
+}
+func EndPerfQueryINTEL(queryHandle uint32) {
+ C.glowEndPerfQueryINTEL(gpEndPerfQueryINTEL, (C.GLuint)(queryHandle))
+}
+func EndQuery(target uint32) {
+ C.glowEndQuery(gpEndQuery, (C.GLenum)(target))
+}
+func EndQueryIndexed(target uint32, index uint32) {
+ C.glowEndQueryIndexed(gpEndQueryIndexed, (C.GLenum)(target), (C.GLuint)(index))
+}
+func EndTransformFeedback() {
+ C.glowEndTransformFeedback(gpEndTransformFeedback)
+}
+func EvaluateDepthValuesARB() {
+ C.glowEvaluateDepthValuesARB(gpEvaluateDepthValuesARB)
+}
+
+// create a new sync object and insert it into the GL command stream
+func FenceSync(condition uint32, flags uint32) uintptr {
+ ret := C.glowFenceSync(gpFenceSync, (C.GLenum)(condition), (C.GLbitfield)(flags))
+ return (uintptr)(ret)
+}
+
+// block until all GL execution is complete
+func Finish() {
+ C.glowFinish(gpFinish)
+}
+
+// force execution of GL commands in finite time
+func Flush() {
+ C.glowFlush(gpFlush)
+}
+
+// indicate modifications to a range of a mapped buffer
+func FlushMappedBufferRange(target uint32, offset int, length int) {
+ C.glowFlushMappedBufferRange(gpFlushMappedBufferRange, (C.GLenum)(target), (C.GLintptr)(offset), (C.GLsizeiptr)(length))
+}
+
+// indicate modifications to a range of a mapped buffer
+func FlushMappedNamedBufferRange(buffer uint32, offset int, length int) {
+ C.glowFlushMappedNamedBufferRange(gpFlushMappedNamedBufferRange, (C.GLuint)(buffer), (C.GLintptr)(offset), (C.GLsizeiptr)(length))
+}
+func FlushMappedNamedBufferRangeEXT(buffer uint32, offset int, length int) {
+ C.glowFlushMappedNamedBufferRangeEXT(gpFlushMappedNamedBufferRangeEXT, (C.GLuint)(buffer), (C.GLintptr)(offset), (C.GLsizeiptr)(length))
+}
+func FogCoordFormatNV(xtype uint32, stride int32) {
+ C.glowFogCoordFormatNV(gpFogCoordFormatNV, (C.GLenum)(xtype), (C.GLsizei)(stride))
+}
+func FragmentCoverageColorNV(color uint32) {
+ C.glowFragmentCoverageColorNV(gpFragmentCoverageColorNV, (C.GLuint)(color))
+}
+func FramebufferDrawBufferEXT(framebuffer uint32, mode uint32) {
+ C.glowFramebufferDrawBufferEXT(gpFramebufferDrawBufferEXT, (C.GLuint)(framebuffer), (C.GLenum)(mode))
+}
+func FramebufferDrawBuffersEXT(framebuffer uint32, n int32, bufs *uint32) {
+ C.glowFramebufferDrawBuffersEXT(gpFramebufferDrawBuffersEXT, (C.GLuint)(framebuffer), (C.GLsizei)(n), (*C.GLenum)(unsafe.Pointer(bufs)))
+}
+func FramebufferFetchBarrierEXT() {
+ C.glowFramebufferFetchBarrierEXT(gpFramebufferFetchBarrierEXT)
+}
+
+// set a named parameter of a framebuffer object
+func FramebufferParameteri(target uint32, pname uint32, param int32) {
+ C.glowFramebufferParameteri(gpFramebufferParameteri, (C.GLenum)(target), (C.GLenum)(pname), (C.GLint)(param))
+}
+func FramebufferParameteriMESA(target uint32, pname uint32, param int32) {
+ C.glowFramebufferParameteriMESA(gpFramebufferParameteriMESA, (C.GLenum)(target), (C.GLenum)(pname), (C.GLint)(param))
+}
+func FramebufferReadBufferEXT(framebuffer uint32, mode uint32) {
+ C.glowFramebufferReadBufferEXT(gpFramebufferReadBufferEXT, (C.GLuint)(framebuffer), (C.GLenum)(mode))
+}
+
+// attach a renderbuffer as a logical buffer of a framebuffer object
+func FramebufferRenderbuffer(target uint32, attachment uint32, renderbuffertarget uint32, renderbuffer uint32) {
+ C.glowFramebufferRenderbuffer(gpFramebufferRenderbuffer, (C.GLenum)(target), (C.GLenum)(attachment), (C.GLenum)(renderbuffertarget), (C.GLuint)(renderbuffer))
+}
+func FramebufferSampleLocationsfvARB(target uint32, start uint32, count int32, v *float32) {
+ C.glowFramebufferSampleLocationsfvARB(gpFramebufferSampleLocationsfvARB, (C.GLenum)(target), (C.GLuint)(start), (C.GLsizei)(count), (*C.GLfloat)(unsafe.Pointer(v)))
+}
+func FramebufferSampleLocationsfvNV(target uint32, start uint32, count int32, v *float32) {
+ C.glowFramebufferSampleLocationsfvNV(gpFramebufferSampleLocationsfvNV, (C.GLenum)(target), (C.GLuint)(start), (C.GLsizei)(count), (*C.GLfloat)(unsafe.Pointer(v)))
+}
+
+// attach a level of a texture object as a logical buffer of a framebuffer object
+func FramebufferTexture(target uint32, attachment uint32, texture uint32, level int32) {
+ C.glowFramebufferTexture(gpFramebufferTexture, (C.GLenum)(target), (C.GLenum)(attachment), (C.GLuint)(texture), (C.GLint)(level))
+}
+func FramebufferTexture1D(target uint32, attachment uint32, textarget uint32, texture uint32, level int32) {
+ C.glowFramebufferTexture1D(gpFramebufferTexture1D, (C.GLenum)(target), (C.GLenum)(attachment), (C.GLenum)(textarget), (C.GLuint)(texture), (C.GLint)(level))
+}
+
+// attach a level of a texture object as a logical buffer to the currently bound framebuffer object
+func FramebufferTexture2D(target uint32, attachment uint32, textarget uint32, texture uint32, level int32) {
+ C.glowFramebufferTexture2D(gpFramebufferTexture2D, (C.GLenum)(target), (C.GLenum)(attachment), (C.GLenum)(textarget), (C.GLuint)(texture), (C.GLint)(level))
+}
+func FramebufferTexture3D(target uint32, attachment uint32, textarget uint32, texture uint32, level int32, zoffset int32) {
+ C.glowFramebufferTexture3D(gpFramebufferTexture3D, (C.GLenum)(target), (C.GLenum)(attachment), (C.GLenum)(textarget), (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(zoffset))
+}
+func FramebufferTextureARB(target uint32, attachment uint32, texture uint32, level int32) {
+ C.glowFramebufferTextureARB(gpFramebufferTextureARB, (C.GLenum)(target), (C.GLenum)(attachment), (C.GLuint)(texture), (C.GLint)(level))
+}
+func FramebufferTextureFaceARB(target uint32, attachment uint32, texture uint32, level int32, face uint32) {
+ C.glowFramebufferTextureFaceARB(gpFramebufferTextureFaceARB, (C.GLenum)(target), (C.GLenum)(attachment), (C.GLuint)(texture), (C.GLint)(level), (C.GLenum)(face))
+}
+
+// attach a single layer of a texture object as a logical buffer of a framebuffer object
+func FramebufferTextureLayer(target uint32, attachment uint32, texture uint32, level int32, layer int32) {
+ C.glowFramebufferTextureLayer(gpFramebufferTextureLayer, (C.GLenum)(target), (C.GLenum)(attachment), (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(layer))
+}
+func FramebufferTextureLayerARB(target uint32, attachment uint32, texture uint32, level int32, layer int32) {
+ C.glowFramebufferTextureLayerARB(gpFramebufferTextureLayerARB, (C.GLenum)(target), (C.GLenum)(attachment), (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(layer))
+}
+func FramebufferTextureMultiviewOVR(target uint32, attachment uint32, texture uint32, level int32, baseViewIndex int32, numViews int32) {
+ C.glowFramebufferTextureMultiviewOVR(gpFramebufferTextureMultiviewOVR, (C.GLenum)(target), (C.GLenum)(attachment), (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(baseViewIndex), (C.GLsizei)(numViews))
+}
+
+// define front- and back-facing polygons
+func FrontFace(mode uint32) {
+ C.glowFrontFace(gpFrontFace, (C.GLenum)(mode))
+}
+
+// generate buffer object names
+func GenBuffers(n int32, buffers *uint32) {
+ C.glowGenBuffers(gpGenBuffers, (C.GLsizei)(n), (*C.GLuint)(unsafe.Pointer(buffers)))
+}
+
+// generate framebuffer object names
+func GenFramebuffers(n int32, framebuffers *uint32) {
+ C.glowGenFramebuffers(gpGenFramebuffers, (C.GLsizei)(n), (*C.GLuint)(unsafe.Pointer(framebuffers)))
+}
+func GenPathsNV(xrange int32) uint32 {
+ ret := C.glowGenPathsNV(gpGenPathsNV, (C.GLsizei)(xrange))
+ return (uint32)(ret)
+}
+func GenPerfMonitorsAMD(n int32, monitors *uint32) {
+ C.glowGenPerfMonitorsAMD(gpGenPerfMonitorsAMD, (C.GLsizei)(n), (*C.GLuint)(unsafe.Pointer(monitors)))
+}
+
+// reserve program pipeline object names
+func GenProgramPipelines(n int32, pipelines *uint32) {
+ C.glowGenProgramPipelines(gpGenProgramPipelines, (C.GLsizei)(n), (*C.GLuint)(unsafe.Pointer(pipelines)))
+}
+func GenProgramPipelinesEXT(n int32, pipelines *uint32) {
+ C.glowGenProgramPipelinesEXT(gpGenProgramPipelinesEXT, (C.GLsizei)(n), (*C.GLuint)(unsafe.Pointer(pipelines)))
+}
+
+// generate query object names
+func GenQueries(n int32, ids *uint32) {
+ C.glowGenQueries(gpGenQueries, (C.GLsizei)(n), (*C.GLuint)(unsafe.Pointer(ids)))
+}
+
+// generate renderbuffer object names
+func GenRenderbuffers(n int32, renderbuffers *uint32) {
+ C.glowGenRenderbuffers(gpGenRenderbuffers, (C.GLsizei)(n), (*C.GLuint)(unsafe.Pointer(renderbuffers)))
+}
+
+// generate sampler object names
+func GenSamplers(count int32, samplers *uint32) {
+ C.glowGenSamplers(gpGenSamplers, (C.GLsizei)(count), (*C.GLuint)(unsafe.Pointer(samplers)))
+}
+
+// generate texture names
+func GenTextures(n int32, textures *uint32) {
+ C.glowGenTextures(gpGenTextures, (C.GLsizei)(n), (*C.GLuint)(unsafe.Pointer(textures)))
+}
+
+// reserve transform feedback object names
+func GenTransformFeedbacks(n int32, ids *uint32) {
+ C.glowGenTransformFeedbacks(gpGenTransformFeedbacks, (C.GLsizei)(n), (*C.GLuint)(unsafe.Pointer(ids)))
+}
+
+// generate vertex array object names
+func GenVertexArrays(n int32, arrays *uint32) {
+ C.glowGenVertexArrays(gpGenVertexArrays, (C.GLsizei)(n), (*C.GLuint)(unsafe.Pointer(arrays)))
+}
+
+// generate mipmaps for a specified texture object
+func GenerateMipmap(target uint32) {
+ C.glowGenerateMipmap(gpGenerateMipmap, (C.GLenum)(target))
+}
+func GenerateMultiTexMipmapEXT(texunit uint32, target uint32) {
+ C.glowGenerateMultiTexMipmapEXT(gpGenerateMultiTexMipmapEXT, (C.GLenum)(texunit), (C.GLenum)(target))
+}
+
+// generate mipmaps for a specified texture object
+func GenerateTextureMipmap(texture uint32) {
+ C.glowGenerateTextureMipmap(gpGenerateTextureMipmap, (C.GLuint)(texture))
+}
+func GenerateTextureMipmapEXT(texture uint32, target uint32) {
+ C.glowGenerateTextureMipmapEXT(gpGenerateTextureMipmapEXT, (C.GLuint)(texture), (C.GLenum)(target))
+}
+
+// retrieve information about the set of active atomic counter buffers for a program
+func GetActiveAtomicCounterBufferiv(program uint32, bufferIndex uint32, pname uint32, params *int32) {
+ C.glowGetActiveAtomicCounterBufferiv(gpGetActiveAtomicCounterBufferiv, (C.GLuint)(program), (C.GLuint)(bufferIndex), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params)))
+}
+
+// Returns information about an active attribute variable for the specified program object
+func GetActiveAttrib(program uint32, index uint32, bufSize int32, length *int32, size *int32, xtype *uint32, name *uint8) {
+ C.glowGetActiveAttrib(gpGetActiveAttrib, (C.GLuint)(program), (C.GLuint)(index), (C.GLsizei)(bufSize), (*C.GLsizei)(unsafe.Pointer(length)), (*C.GLint)(unsafe.Pointer(size)), (*C.GLenum)(unsafe.Pointer(xtype)), (*C.GLchar)(unsafe.Pointer(name)))
+}
+
+// query the name of an active shader subroutine
+func GetActiveSubroutineName(program uint32, shadertype uint32, index uint32, bufSize int32, length *int32, name *uint8) {
+ C.glowGetActiveSubroutineName(gpGetActiveSubroutineName, (C.GLuint)(program), (C.GLenum)(shadertype), (C.GLuint)(index), (C.GLsizei)(bufSize), (*C.GLsizei)(unsafe.Pointer(length)), (*C.GLchar)(unsafe.Pointer(name)))
+}
+
+// query the name of an active shader subroutine uniform
+func GetActiveSubroutineUniformName(program uint32, shadertype uint32, index uint32, bufSize int32, length *int32, name *uint8) {
+ C.glowGetActiveSubroutineUniformName(gpGetActiveSubroutineUniformName, (C.GLuint)(program), (C.GLenum)(shadertype), (C.GLuint)(index), (C.GLsizei)(bufSize), (*C.GLsizei)(unsafe.Pointer(length)), (*C.GLchar)(unsafe.Pointer(name)))
+}
+func GetActiveSubroutineUniformiv(program uint32, shadertype uint32, index uint32, pname uint32, values *int32) {
+ C.glowGetActiveSubroutineUniformiv(gpGetActiveSubroutineUniformiv, (C.GLuint)(program), (C.GLenum)(shadertype), (C.GLuint)(index), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(values)))
+}
+
+// Returns information about an active uniform variable for the specified program object
+func GetActiveUniform(program uint32, index uint32, bufSize int32, length *int32, size *int32, xtype *uint32, name *uint8) {
+ C.glowGetActiveUniform(gpGetActiveUniform, (C.GLuint)(program), (C.GLuint)(index), (C.GLsizei)(bufSize), (*C.GLsizei)(unsafe.Pointer(length)), (*C.GLint)(unsafe.Pointer(size)), (*C.GLenum)(unsafe.Pointer(xtype)), (*C.GLchar)(unsafe.Pointer(name)))
+}
+
+// retrieve the name of an active uniform block
+func GetActiveUniformBlockName(program uint32, uniformBlockIndex uint32, bufSize int32, length *int32, uniformBlockName *uint8) {
+ C.glowGetActiveUniformBlockName(gpGetActiveUniformBlockName, (C.GLuint)(program), (C.GLuint)(uniformBlockIndex), (C.GLsizei)(bufSize), (*C.GLsizei)(unsafe.Pointer(length)), (*C.GLchar)(unsafe.Pointer(uniformBlockName)))
+}
+
+// query information about an active uniform block
+func GetActiveUniformBlockiv(program uint32, uniformBlockIndex uint32, pname uint32, params *int32) {
+ C.glowGetActiveUniformBlockiv(gpGetActiveUniformBlockiv, (C.GLuint)(program), (C.GLuint)(uniformBlockIndex), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params)))
+}
+
+// query the name of an active uniform
+func GetActiveUniformName(program uint32, uniformIndex uint32, bufSize int32, length *int32, uniformName *uint8) {
+ C.glowGetActiveUniformName(gpGetActiveUniformName, (C.GLuint)(program), (C.GLuint)(uniformIndex), (C.GLsizei)(bufSize), (*C.GLsizei)(unsafe.Pointer(length)), (*C.GLchar)(unsafe.Pointer(uniformName)))
+}
+
+// Returns information about several active uniform variables for the specified program object
+func GetActiveUniformsiv(program uint32, uniformCount int32, uniformIndices *uint32, pname uint32, params *int32) {
+ C.glowGetActiveUniformsiv(gpGetActiveUniformsiv, (C.GLuint)(program), (C.GLsizei)(uniformCount), (*C.GLuint)(unsafe.Pointer(uniformIndices)), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params)))
+}
+
+// Returns the handles of the shader objects attached to a program object
+func GetAttachedShaders(program uint32, maxCount int32, count *int32, shaders *uint32) {
+ C.glowGetAttachedShaders(gpGetAttachedShaders, (C.GLuint)(program), (C.GLsizei)(maxCount), (*C.GLsizei)(unsafe.Pointer(count)), (*C.GLuint)(unsafe.Pointer(shaders)))
+}
+
+// Returns the location of an attribute variable
+func GetAttribLocation(program uint32, name *uint8) int32 {
+ ret := C.glowGetAttribLocation(gpGetAttribLocation, (C.GLuint)(program), (*C.GLchar)(unsafe.Pointer(name)))
+ return (int32)(ret)
+}
+func GetBooleanIndexedvEXT(target uint32, index uint32, data *bool) {
+ C.glowGetBooleanIndexedvEXT(gpGetBooleanIndexedvEXT, (C.GLenum)(target), (C.GLuint)(index), (*C.GLboolean)(unsafe.Pointer(data)))
+}
+func GetBooleani_v(target uint32, index uint32, data *bool) {
+ C.glowGetBooleani_v(gpGetBooleani_v, (C.GLenum)(target), (C.GLuint)(index), (*C.GLboolean)(unsafe.Pointer(data)))
+}
+func GetBooleanv(pname uint32, data *bool) {
+ C.glowGetBooleanv(gpGetBooleanv, (C.GLenum)(pname), (*C.GLboolean)(unsafe.Pointer(data)))
+}
+
+// return parameters of a buffer object
+func GetBufferParameteri64v(target uint32, pname uint32, params *int64) {
+ C.glowGetBufferParameteri64v(gpGetBufferParameteri64v, (C.GLenum)(target), (C.GLenum)(pname), (*C.GLint64)(unsafe.Pointer(params)))
+}
+
+// return parameters of a buffer object
+func GetBufferParameteriv(target uint32, pname uint32, params *int32) {
+ C.glowGetBufferParameteriv(gpGetBufferParameteriv, (C.GLenum)(target), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params)))
+}
+func GetBufferParameterui64vNV(target uint32, pname uint32, params *uint64) {
+ C.glowGetBufferParameterui64vNV(gpGetBufferParameterui64vNV, (C.GLenum)(target), (C.GLenum)(pname), (*C.GLuint64EXT)(unsafe.Pointer(params)))
+}
+
+// return the pointer to a mapped buffer object's data store
+func GetBufferPointerv(target uint32, pname uint32, params *unsafe.Pointer) {
+ C.glowGetBufferPointerv(gpGetBufferPointerv, (C.GLenum)(target), (C.GLenum)(pname), params)
+}
+
+// returns a subset of a buffer object's data store
+func GetBufferSubData(target uint32, offset int, size int, data unsafe.Pointer) {
+ C.glowGetBufferSubData(gpGetBufferSubData, (C.GLenum)(target), (C.GLintptr)(offset), (C.GLsizeiptr)(size), data)
+}
+func GetCommandHeaderNV(tokenID uint32, size uint32) uint32 {
+ ret := C.glowGetCommandHeaderNV(gpGetCommandHeaderNV, (C.GLenum)(tokenID), (C.GLuint)(size))
+ return (uint32)(ret)
+}
+func GetCompressedMultiTexImageEXT(texunit uint32, target uint32, lod int32, img unsafe.Pointer) {
+ C.glowGetCompressedMultiTexImageEXT(gpGetCompressedMultiTexImageEXT, (C.GLenum)(texunit), (C.GLenum)(target), (C.GLint)(lod), img)
+}
+
+// return a compressed texture image
+func GetCompressedTexImage(target uint32, level int32, img unsafe.Pointer) {
+ C.glowGetCompressedTexImage(gpGetCompressedTexImage, (C.GLenum)(target), (C.GLint)(level), img)
+}
+
+// return a compressed texture image
+func GetCompressedTextureImage(texture uint32, level int32, bufSize int32, pixels unsafe.Pointer) {
+ C.glowGetCompressedTextureImage(gpGetCompressedTextureImage, (C.GLuint)(texture), (C.GLint)(level), (C.GLsizei)(bufSize), pixels)
+}
+func GetCompressedTextureImageEXT(texture uint32, target uint32, lod int32, img unsafe.Pointer) {
+ C.glowGetCompressedTextureImageEXT(gpGetCompressedTextureImageEXT, (C.GLuint)(texture), (C.GLenum)(target), (C.GLint)(lod), img)
+}
+
+// retrieve a sub-region of a compressed texture image from a compressed texture object
+func GetCompressedTextureSubImage(texture uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, bufSize int32, pixels unsafe.Pointer) {
+ C.glowGetCompressedTextureSubImage(gpGetCompressedTextureSubImage, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLsizei)(bufSize), pixels)
+}
+func GetCoverageModulationTableNV(bufSize int32, v *float32) {
+ C.glowGetCoverageModulationTableNV(gpGetCoverageModulationTableNV, (C.GLsizei)(bufSize), (*C.GLfloat)(unsafe.Pointer(v)))
+}
+
+// retrieve messages from the debug message log
+func GetDebugMessageLog(count uint32, bufSize int32, sources *uint32, types *uint32, ids *uint32, severities *uint32, lengths *int32, messageLog *uint8) uint32 {
+ ret := C.glowGetDebugMessageLog(gpGetDebugMessageLog, (C.GLuint)(count), (C.GLsizei)(bufSize), (*C.GLenum)(unsafe.Pointer(sources)), (*C.GLenum)(unsafe.Pointer(types)), (*C.GLuint)(unsafe.Pointer(ids)), (*C.GLenum)(unsafe.Pointer(severities)), (*C.GLsizei)(unsafe.Pointer(lengths)), (*C.GLchar)(unsafe.Pointer(messageLog)))
+ return (uint32)(ret)
+}
+func GetDebugMessageLogARB(count uint32, bufSize int32, sources *uint32, types *uint32, ids *uint32, severities *uint32, lengths *int32, messageLog *uint8) uint32 {
+ ret := C.glowGetDebugMessageLogARB(gpGetDebugMessageLogARB, (C.GLuint)(count), (C.GLsizei)(bufSize), (*C.GLenum)(unsafe.Pointer(sources)), (*C.GLenum)(unsafe.Pointer(types)), (*C.GLuint)(unsafe.Pointer(ids)), (*C.GLenum)(unsafe.Pointer(severities)), (*C.GLsizei)(unsafe.Pointer(lengths)), (*C.GLchar)(unsafe.Pointer(messageLog)))
+ return (uint32)(ret)
+}
+func GetDebugMessageLogKHR(count uint32, bufSize int32, sources *uint32, types *uint32, ids *uint32, severities *uint32, lengths *int32, messageLog *uint8) uint32 {
+ ret := C.glowGetDebugMessageLogKHR(gpGetDebugMessageLogKHR, (C.GLuint)(count), (C.GLsizei)(bufSize), (*C.GLenum)(unsafe.Pointer(sources)), (*C.GLenum)(unsafe.Pointer(types)), (*C.GLuint)(unsafe.Pointer(ids)), (*C.GLenum)(unsafe.Pointer(severities)), (*C.GLsizei)(unsafe.Pointer(lengths)), (*C.GLchar)(unsafe.Pointer(messageLog)))
+ return (uint32)(ret)
+}
+func GetDoubleIndexedvEXT(target uint32, index uint32, data *float64) {
+ C.glowGetDoubleIndexedvEXT(gpGetDoubleIndexedvEXT, (C.GLenum)(target), (C.GLuint)(index), (*C.GLdouble)(unsafe.Pointer(data)))
+}
+func GetDoublei_v(target uint32, index uint32, data *float64) {
+ C.glowGetDoublei_v(gpGetDoublei_v, (C.GLenum)(target), (C.GLuint)(index), (*C.GLdouble)(unsafe.Pointer(data)))
+}
+func GetDoublei_vEXT(pname uint32, index uint32, params *float64) {
+ C.glowGetDoublei_vEXT(gpGetDoublei_vEXT, (C.GLenum)(pname), (C.GLuint)(index), (*C.GLdouble)(unsafe.Pointer(params)))
+}
+func GetDoublev(pname uint32, data *float64) {
+ C.glowGetDoublev(gpGetDoublev, (C.GLenum)(pname), (*C.GLdouble)(unsafe.Pointer(data)))
+}
+
+// return error information
+func GetError() uint32 {
+ ret := C.glowGetError(gpGetError)
+ return (uint32)(ret)
+}
+func GetFirstPerfQueryIdINTEL(queryId *uint32) {
+ C.glowGetFirstPerfQueryIdINTEL(gpGetFirstPerfQueryIdINTEL, (*C.GLuint)(unsafe.Pointer(queryId)))
+}
+func GetFloatIndexedvEXT(target uint32, index uint32, data *float32) {
+ C.glowGetFloatIndexedvEXT(gpGetFloatIndexedvEXT, (C.GLenum)(target), (C.GLuint)(index), (*C.GLfloat)(unsafe.Pointer(data)))
+}
+func GetFloati_v(target uint32, index uint32, data *float32) {
+ C.glowGetFloati_v(gpGetFloati_v, (C.GLenum)(target), (C.GLuint)(index), (*C.GLfloat)(unsafe.Pointer(data)))
+}
+func GetFloati_vEXT(pname uint32, index uint32, params *float32) {
+ C.glowGetFloati_vEXT(gpGetFloati_vEXT, (C.GLenum)(pname), (C.GLuint)(index), (*C.GLfloat)(unsafe.Pointer(params)))
+}
+func GetFloatv(pname uint32, data *float32) {
+ C.glowGetFloatv(gpGetFloatv, (C.GLenum)(pname), (*C.GLfloat)(unsafe.Pointer(data)))
+}
+
+// query the bindings of color indices to user-defined varying out variables
+func GetFragDataIndex(program uint32, name *uint8) int32 {
+ ret := C.glowGetFragDataIndex(gpGetFragDataIndex, (C.GLuint)(program), (*C.GLchar)(unsafe.Pointer(name)))
+ return (int32)(ret)
+}
+
+// query the bindings of color numbers to user-defined varying out variables
+func GetFragDataLocation(program uint32, name *uint8) int32 {
+ ret := C.glowGetFragDataLocation(gpGetFragDataLocation, (C.GLuint)(program), (*C.GLchar)(unsafe.Pointer(name)))
+ return (int32)(ret)
+}
+
+// retrieve information about attachments of a bound framebuffer object
+func GetFramebufferAttachmentParameteriv(target uint32, attachment uint32, pname uint32, params *int32) {
+ C.glowGetFramebufferAttachmentParameteriv(gpGetFramebufferAttachmentParameteriv, (C.GLenum)(target), (C.GLenum)(attachment), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params)))
+}
+
+// retrieve a named parameter from a framebuffer
+func GetFramebufferParameteriv(target uint32, pname uint32, params *int32) {
+ C.glowGetFramebufferParameteriv(gpGetFramebufferParameteriv, (C.GLenum)(target), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params)))
+}
+func GetFramebufferParameterivEXT(framebuffer uint32, pname uint32, params *int32) {
+ C.glowGetFramebufferParameterivEXT(gpGetFramebufferParameterivEXT, (C.GLuint)(framebuffer), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params)))
+}
+func GetFramebufferParameterivMESA(target uint32, pname uint32, params *int32) {
+ C.glowGetFramebufferParameterivMESA(gpGetFramebufferParameterivMESA, (C.GLenum)(target), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params)))
+}
+
+// check if the rendering context has not been lost due to software or hardware issues
+func GetGraphicsResetStatus() uint32 {
+ ret := C.glowGetGraphicsResetStatus(gpGetGraphicsResetStatus)
+ return (uint32)(ret)
+}
+func GetGraphicsResetStatusARB() uint32 {
+ ret := C.glowGetGraphicsResetStatusARB(gpGetGraphicsResetStatusARB)
+ return (uint32)(ret)
+}
+func GetGraphicsResetStatusKHR() uint32 {
+ ret := C.glowGetGraphicsResetStatusKHR(gpGetGraphicsResetStatusKHR)
+ return (uint32)(ret)
+}
+func GetImageHandleARB(texture uint32, level int32, layered bool, layer int32, format uint32) uint64 {
+ ret := C.glowGetImageHandleARB(gpGetImageHandleARB, (C.GLuint)(texture), (C.GLint)(level), (C.GLboolean)(boolToInt(layered)), (C.GLint)(layer), (C.GLenum)(format))
+ return (uint64)(ret)
+}
+func GetImageHandleNV(texture uint32, level int32, layered bool, layer int32, format uint32) uint64 {
+ ret := C.glowGetImageHandleNV(gpGetImageHandleNV, (C.GLuint)(texture), (C.GLint)(level), (C.GLboolean)(boolToInt(layered)), (C.GLint)(layer), (C.GLenum)(format))
+ return (uint64)(ret)
+}
+func GetInteger64i_v(target uint32, index uint32, data *int64) {
+ C.glowGetInteger64i_v(gpGetInteger64i_v, (C.GLenum)(target), (C.GLuint)(index), (*C.GLint64)(unsafe.Pointer(data)))
+}
+func GetInteger64v(pname uint32, data *int64) {
+ C.glowGetInteger64v(gpGetInteger64v, (C.GLenum)(pname), (*C.GLint64)(unsafe.Pointer(data)))
+}
+func GetIntegerIndexedvEXT(target uint32, index uint32, data *int32) {
+ C.glowGetIntegerIndexedvEXT(gpGetIntegerIndexedvEXT, (C.GLenum)(target), (C.GLuint)(index), (*C.GLint)(unsafe.Pointer(data)))
+}
+func GetIntegeri_v(target uint32, index uint32, data *int32) {
+ C.glowGetIntegeri_v(gpGetIntegeri_v, (C.GLenum)(target), (C.GLuint)(index), (*C.GLint)(unsafe.Pointer(data)))
+}
+func GetIntegerui64i_vNV(value uint32, index uint32, result *uint64) {
+ C.glowGetIntegerui64i_vNV(gpGetIntegerui64i_vNV, (C.GLenum)(value), (C.GLuint)(index), (*C.GLuint64EXT)(unsafe.Pointer(result)))
+}
+func GetIntegerui64vNV(value uint32, result *uint64) {
+ C.glowGetIntegerui64vNV(gpGetIntegerui64vNV, (C.GLenum)(value), (*C.GLuint64EXT)(unsafe.Pointer(result)))
+}
+func GetIntegerv(pname uint32, data *int32) {
+ C.glowGetIntegerv(gpGetIntegerv, (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(data)))
+}
+func GetInternalformatSampleivNV(target uint32, internalformat uint32, samples int32, pname uint32, count int32, params *int32) {
+ C.glowGetInternalformatSampleivNV(gpGetInternalformatSampleivNV, (C.GLenum)(target), (C.GLenum)(internalformat), (C.GLsizei)(samples), (C.GLenum)(pname), (C.GLsizei)(count), (*C.GLint)(unsafe.Pointer(params)))
+}
+func GetInternalformati64v(target uint32, internalformat uint32, pname uint32, count int32, params *int64) {
+ C.glowGetInternalformati64v(gpGetInternalformati64v, (C.GLenum)(target), (C.GLenum)(internalformat), (C.GLenum)(pname), (C.GLsizei)(count), (*C.GLint64)(unsafe.Pointer(params)))
+}
+
+// retrieve information about implementation-dependent support for internal formats
+func GetInternalformativ(target uint32, internalformat uint32, pname uint32, count int32, params *int32) {
+ C.glowGetInternalformativ(gpGetInternalformativ, (C.GLenum)(target), (C.GLenum)(internalformat), (C.GLenum)(pname), (C.GLsizei)(count), (*C.GLint)(unsafe.Pointer(params)))
+}
+func GetMemoryObjectDetachedResourcesuivNV(memory uint32, pname uint32, first int32, count int32, params *uint32) {
+ C.glowGetMemoryObjectDetachedResourcesuivNV(gpGetMemoryObjectDetachedResourcesuivNV, (C.GLuint)(memory), (C.GLenum)(pname), (C.GLint)(first), (C.GLsizei)(count), (*C.GLuint)(unsafe.Pointer(params)))
+}
+func GetMultiTexEnvfvEXT(texunit uint32, target uint32, pname uint32, params *float32) {
+ C.glowGetMultiTexEnvfvEXT(gpGetMultiTexEnvfvEXT, (C.GLenum)(texunit), (C.GLenum)(target), (C.GLenum)(pname), (*C.GLfloat)(unsafe.Pointer(params)))
+}
+func GetMultiTexEnvivEXT(texunit uint32, target uint32, pname uint32, params *int32) {
+ C.glowGetMultiTexEnvivEXT(gpGetMultiTexEnvivEXT, (C.GLenum)(texunit), (C.GLenum)(target), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params)))
+}
+func GetMultiTexGendvEXT(texunit uint32, coord uint32, pname uint32, params *float64) {
+ C.glowGetMultiTexGendvEXT(gpGetMultiTexGendvEXT, (C.GLenum)(texunit), (C.GLenum)(coord), (C.GLenum)(pname), (*C.GLdouble)(unsafe.Pointer(params)))
+}
+func GetMultiTexGenfvEXT(texunit uint32, coord uint32, pname uint32, params *float32) {
+ C.glowGetMultiTexGenfvEXT(gpGetMultiTexGenfvEXT, (C.GLenum)(texunit), (C.GLenum)(coord), (C.GLenum)(pname), (*C.GLfloat)(unsafe.Pointer(params)))
+}
+func GetMultiTexGenivEXT(texunit uint32, coord uint32, pname uint32, params *int32) {
+ C.glowGetMultiTexGenivEXT(gpGetMultiTexGenivEXT, (C.GLenum)(texunit), (C.GLenum)(coord), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params)))
+}
+func GetMultiTexImageEXT(texunit uint32, target uint32, level int32, format uint32, xtype uint32, pixels unsafe.Pointer) {
+ C.glowGetMultiTexImageEXT(gpGetMultiTexImageEXT, (C.GLenum)(texunit), (C.GLenum)(target), (C.GLint)(level), (C.GLenum)(format), (C.GLenum)(xtype), pixels)
+}
+func GetMultiTexLevelParameterfvEXT(texunit uint32, target uint32, level int32, pname uint32, params *float32) {
+ C.glowGetMultiTexLevelParameterfvEXT(gpGetMultiTexLevelParameterfvEXT, (C.GLenum)(texunit), (C.GLenum)(target), (C.GLint)(level), (C.GLenum)(pname), (*C.GLfloat)(unsafe.Pointer(params)))
+}
+func GetMultiTexLevelParameterivEXT(texunit uint32, target uint32, level int32, pname uint32, params *int32) {
+ C.glowGetMultiTexLevelParameterivEXT(gpGetMultiTexLevelParameterivEXT, (C.GLenum)(texunit), (C.GLenum)(target), (C.GLint)(level), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params)))
+}
+func GetMultiTexParameterIivEXT(texunit uint32, target uint32, pname uint32, params *int32) {
+ C.glowGetMultiTexParameterIivEXT(gpGetMultiTexParameterIivEXT, (C.GLenum)(texunit), (C.GLenum)(target), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params)))
+}
+func GetMultiTexParameterIuivEXT(texunit uint32, target uint32, pname uint32, params *uint32) {
+ C.glowGetMultiTexParameterIuivEXT(gpGetMultiTexParameterIuivEXT, (C.GLenum)(texunit), (C.GLenum)(target), (C.GLenum)(pname), (*C.GLuint)(unsafe.Pointer(params)))
+}
+func GetMultiTexParameterfvEXT(texunit uint32, target uint32, pname uint32, params *float32) {
+ C.glowGetMultiTexParameterfvEXT(gpGetMultiTexParameterfvEXT, (C.GLenum)(texunit), (C.GLenum)(target), (C.GLenum)(pname), (*C.GLfloat)(unsafe.Pointer(params)))
+}
+func GetMultiTexParameterivEXT(texunit uint32, target uint32, pname uint32, params *int32) {
+ C.glowGetMultiTexParameterivEXT(gpGetMultiTexParameterivEXT, (C.GLenum)(texunit), (C.GLenum)(target), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params)))
+}
+
+// retrieve the location of a sample
+func GetMultisamplefv(pname uint32, index uint32, val *float32) {
+ C.glowGetMultisamplefv(gpGetMultisamplefv, (C.GLenum)(pname), (C.GLuint)(index), (*C.GLfloat)(unsafe.Pointer(val)))
+}
+
+// return parameters of a buffer object
+func GetNamedBufferParameteri64v(buffer uint32, pname uint32, params *int64) {
+ C.glowGetNamedBufferParameteri64v(gpGetNamedBufferParameteri64v, (C.GLuint)(buffer), (C.GLenum)(pname), (*C.GLint64)(unsafe.Pointer(params)))
+}
+
+// return parameters of a buffer object
+func GetNamedBufferParameteriv(buffer uint32, pname uint32, params *int32) {
+ C.glowGetNamedBufferParameteriv(gpGetNamedBufferParameteriv, (C.GLuint)(buffer), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params)))
+}
+func GetNamedBufferParameterivEXT(buffer uint32, pname uint32, params *int32) {
+ C.glowGetNamedBufferParameterivEXT(gpGetNamedBufferParameterivEXT, (C.GLuint)(buffer), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params)))
+}
+func GetNamedBufferParameterui64vNV(buffer uint32, pname uint32, params *uint64) {
+ C.glowGetNamedBufferParameterui64vNV(gpGetNamedBufferParameterui64vNV, (C.GLuint)(buffer), (C.GLenum)(pname), (*C.GLuint64EXT)(unsafe.Pointer(params)))
+}
+
+// return the pointer to a mapped buffer object's data store
+func GetNamedBufferPointerv(buffer uint32, pname uint32, params *unsafe.Pointer) {
+ C.glowGetNamedBufferPointerv(gpGetNamedBufferPointerv, (C.GLuint)(buffer), (C.GLenum)(pname), params)
+}
+func GetNamedBufferPointervEXT(buffer uint32, pname uint32, params *unsafe.Pointer) {
+ C.glowGetNamedBufferPointervEXT(gpGetNamedBufferPointervEXT, (C.GLuint)(buffer), (C.GLenum)(pname), params)
+}
+
+// returns a subset of a buffer object's data store
+func GetNamedBufferSubData(buffer uint32, offset int, size int, data unsafe.Pointer) {
+ C.glowGetNamedBufferSubData(gpGetNamedBufferSubData, (C.GLuint)(buffer), (C.GLintptr)(offset), (C.GLsizeiptr)(size), data)
+}
+func GetNamedBufferSubDataEXT(buffer uint32, offset int, size int, data unsafe.Pointer) {
+ C.glowGetNamedBufferSubDataEXT(gpGetNamedBufferSubDataEXT, (C.GLuint)(buffer), (C.GLintptr)(offset), (C.GLsizeiptr)(size), data)
+}
+
+// retrieve information about attachments of a framebuffer object
+func GetNamedFramebufferAttachmentParameteriv(framebuffer uint32, attachment uint32, pname uint32, params *int32) {
+ C.glowGetNamedFramebufferAttachmentParameteriv(gpGetNamedFramebufferAttachmentParameteriv, (C.GLuint)(framebuffer), (C.GLenum)(attachment), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params)))
+}
+func GetNamedFramebufferAttachmentParameterivEXT(framebuffer uint32, attachment uint32, pname uint32, params *int32) {
+ C.glowGetNamedFramebufferAttachmentParameterivEXT(gpGetNamedFramebufferAttachmentParameterivEXT, (C.GLuint)(framebuffer), (C.GLenum)(attachment), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params)))
+}
+
+// query a named parameter of a framebuffer object
+func GetNamedFramebufferParameteriv(framebuffer uint32, pname uint32, param *int32) {
+ C.glowGetNamedFramebufferParameteriv(gpGetNamedFramebufferParameteriv, (C.GLuint)(framebuffer), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(param)))
+}
+func GetNamedFramebufferParameterivEXT(framebuffer uint32, pname uint32, params *int32) {
+ C.glowGetNamedFramebufferParameterivEXT(gpGetNamedFramebufferParameterivEXT, (C.GLuint)(framebuffer), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params)))
+}
+func GetNamedProgramLocalParameterIivEXT(program uint32, target uint32, index uint32, params *int32) {
+ C.glowGetNamedProgramLocalParameterIivEXT(gpGetNamedProgramLocalParameterIivEXT, (C.GLuint)(program), (C.GLenum)(target), (C.GLuint)(index), (*C.GLint)(unsafe.Pointer(params)))
+}
+func GetNamedProgramLocalParameterIuivEXT(program uint32, target uint32, index uint32, params *uint32) {
+ C.glowGetNamedProgramLocalParameterIuivEXT(gpGetNamedProgramLocalParameterIuivEXT, (C.GLuint)(program), (C.GLenum)(target), (C.GLuint)(index), (*C.GLuint)(unsafe.Pointer(params)))
+}
+func GetNamedProgramLocalParameterdvEXT(program uint32, target uint32, index uint32, params *float64) {
+ C.glowGetNamedProgramLocalParameterdvEXT(gpGetNamedProgramLocalParameterdvEXT, (C.GLuint)(program), (C.GLenum)(target), (C.GLuint)(index), (*C.GLdouble)(unsafe.Pointer(params)))
+}
+func GetNamedProgramLocalParameterfvEXT(program uint32, target uint32, index uint32, params *float32) {
+ C.glowGetNamedProgramLocalParameterfvEXT(gpGetNamedProgramLocalParameterfvEXT, (C.GLuint)(program), (C.GLenum)(target), (C.GLuint)(index), (*C.GLfloat)(unsafe.Pointer(params)))
+}
+func GetNamedProgramStringEXT(program uint32, target uint32, pname uint32, xstring unsafe.Pointer) {
+ C.glowGetNamedProgramStringEXT(gpGetNamedProgramStringEXT, (C.GLuint)(program), (C.GLenum)(target), (C.GLenum)(pname), xstring)
+}
+func GetNamedProgramivEXT(program uint32, target uint32, pname uint32, params *int32) {
+ C.glowGetNamedProgramivEXT(gpGetNamedProgramivEXT, (C.GLuint)(program), (C.GLenum)(target), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params)))
+}
+
+// query a named parameter of a renderbuffer object
+func GetNamedRenderbufferParameteriv(renderbuffer uint32, pname uint32, params *int32) {
+ C.glowGetNamedRenderbufferParameteriv(gpGetNamedRenderbufferParameteriv, (C.GLuint)(renderbuffer), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params)))
+}
+func GetNamedRenderbufferParameterivEXT(renderbuffer uint32, pname uint32, params *int32) {
+ C.glowGetNamedRenderbufferParameterivEXT(gpGetNamedRenderbufferParameterivEXT, (C.GLuint)(renderbuffer), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params)))
+}
+func GetNamedStringARB(namelen int32, name *uint8, bufSize int32, stringlen *int32, xstring *uint8) {
+ C.glowGetNamedStringARB(gpGetNamedStringARB, (C.GLint)(namelen), (*C.GLchar)(unsafe.Pointer(name)), (C.GLsizei)(bufSize), (*C.GLint)(unsafe.Pointer(stringlen)), (*C.GLchar)(unsafe.Pointer(xstring)))
+}
+func GetNamedStringivARB(namelen int32, name *uint8, pname uint32, params *int32) {
+ C.glowGetNamedStringivARB(gpGetNamedStringivARB, (C.GLint)(namelen), (*C.GLchar)(unsafe.Pointer(name)), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params)))
+}
+func GetNextPerfQueryIdINTEL(queryId uint32, nextQueryId *uint32) {
+ C.glowGetNextPerfQueryIdINTEL(gpGetNextPerfQueryIdINTEL, (C.GLuint)(queryId), (*C.GLuint)(unsafe.Pointer(nextQueryId)))
+}
+
+// retrieve the label of a named object identified within a namespace
+func GetObjectLabel(identifier uint32, name uint32, bufSize int32, length *int32, label *uint8) {
+ C.glowGetObjectLabel(gpGetObjectLabel, (C.GLenum)(identifier), (C.GLuint)(name), (C.GLsizei)(bufSize), (*C.GLsizei)(unsafe.Pointer(length)), (*C.GLchar)(unsafe.Pointer(label)))
+}
+func GetObjectLabelEXT(xtype uint32, object uint32, bufSize int32, length *int32, label *uint8) {
+ C.glowGetObjectLabelEXT(gpGetObjectLabelEXT, (C.GLenum)(xtype), (C.GLuint)(object), (C.GLsizei)(bufSize), (*C.GLsizei)(unsafe.Pointer(length)), (*C.GLchar)(unsafe.Pointer(label)))
+}
+func GetObjectLabelKHR(identifier uint32, name uint32, bufSize int32, length *int32, label *uint8) {
+ C.glowGetObjectLabelKHR(gpGetObjectLabelKHR, (C.GLenum)(identifier), (C.GLuint)(name), (C.GLsizei)(bufSize), (*C.GLsizei)(unsafe.Pointer(length)), (*C.GLchar)(unsafe.Pointer(label)))
+}
+
+// retrieve the label of a sync object identified by a pointer
+func GetObjectPtrLabel(ptr unsafe.Pointer, bufSize int32, length *int32, label *uint8) {
+ C.glowGetObjectPtrLabel(gpGetObjectPtrLabel, ptr, (C.GLsizei)(bufSize), (*C.GLsizei)(unsafe.Pointer(length)), (*C.GLchar)(unsafe.Pointer(label)))
+}
+func GetObjectPtrLabelKHR(ptr unsafe.Pointer, bufSize int32, length *int32, label *uint8) {
+ C.glowGetObjectPtrLabelKHR(gpGetObjectPtrLabelKHR, ptr, (C.GLsizei)(bufSize), (*C.GLsizei)(unsafe.Pointer(length)), (*C.GLchar)(unsafe.Pointer(label)))
+}
+func GetPathCommandsNV(path uint32, commands *uint8) {
+ C.glowGetPathCommandsNV(gpGetPathCommandsNV, (C.GLuint)(path), (*C.GLubyte)(unsafe.Pointer(commands)))
+}
+func GetPathCoordsNV(path uint32, coords *float32) {
+ C.glowGetPathCoordsNV(gpGetPathCoordsNV, (C.GLuint)(path), (*C.GLfloat)(unsafe.Pointer(coords)))
+}
+func GetPathDashArrayNV(path uint32, dashArray *float32) {
+ C.glowGetPathDashArrayNV(gpGetPathDashArrayNV, (C.GLuint)(path), (*C.GLfloat)(unsafe.Pointer(dashArray)))
+}
+func GetPathLengthNV(path uint32, startSegment int32, numSegments int32) float32 {
+ ret := C.glowGetPathLengthNV(gpGetPathLengthNV, (C.GLuint)(path), (C.GLsizei)(startSegment), (C.GLsizei)(numSegments))
+ return (float32)(ret)
+}
+func GetPathMetricRangeNV(metricQueryMask uint32, firstPathName uint32, numPaths int32, stride int32, metrics *float32) {
+ C.glowGetPathMetricRangeNV(gpGetPathMetricRangeNV, (C.GLbitfield)(metricQueryMask), (C.GLuint)(firstPathName), (C.GLsizei)(numPaths), (C.GLsizei)(stride), (*C.GLfloat)(unsafe.Pointer(metrics)))
+}
+func GetPathMetricsNV(metricQueryMask uint32, numPaths int32, pathNameType uint32, paths unsafe.Pointer, pathBase uint32, stride int32, metrics *float32) {
+ C.glowGetPathMetricsNV(gpGetPathMetricsNV, (C.GLbitfield)(metricQueryMask), (C.GLsizei)(numPaths), (C.GLenum)(pathNameType), paths, (C.GLuint)(pathBase), (C.GLsizei)(stride), (*C.GLfloat)(unsafe.Pointer(metrics)))
+}
+func GetPathParameterfvNV(path uint32, pname uint32, value *float32) {
+ C.glowGetPathParameterfvNV(gpGetPathParameterfvNV, (C.GLuint)(path), (C.GLenum)(pname), (*C.GLfloat)(unsafe.Pointer(value)))
+}
+func GetPathParameterivNV(path uint32, pname uint32, value *int32) {
+ C.glowGetPathParameterivNV(gpGetPathParameterivNV, (C.GLuint)(path), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(value)))
+}
+func GetPathSpacingNV(pathListMode uint32, numPaths int32, pathNameType uint32, paths unsafe.Pointer, pathBase uint32, advanceScale float32, kerningScale float32, transformType uint32, returnedSpacing *float32) {
+ C.glowGetPathSpacingNV(gpGetPathSpacingNV, (C.GLenum)(pathListMode), (C.GLsizei)(numPaths), (C.GLenum)(pathNameType), paths, (C.GLuint)(pathBase), (C.GLfloat)(advanceScale), (C.GLfloat)(kerningScale), (C.GLenum)(transformType), (*C.GLfloat)(unsafe.Pointer(returnedSpacing)))
+}
+func GetPerfCounterInfoINTEL(queryId uint32, counterId uint32, counterNameLength uint32, counterName *uint8, counterDescLength uint32, counterDesc *uint8, counterOffset *uint32, counterDataSize *uint32, counterTypeEnum *uint32, counterDataTypeEnum *uint32, rawCounterMaxValue *uint64) {
+ C.glowGetPerfCounterInfoINTEL(gpGetPerfCounterInfoINTEL, (C.GLuint)(queryId), (C.GLuint)(counterId), (C.GLuint)(counterNameLength), (*C.GLchar)(unsafe.Pointer(counterName)), (C.GLuint)(counterDescLength), (*C.GLchar)(unsafe.Pointer(counterDesc)), (*C.GLuint)(unsafe.Pointer(counterOffset)), (*C.GLuint)(unsafe.Pointer(counterDataSize)), (*C.GLuint)(unsafe.Pointer(counterTypeEnum)), (*C.GLuint)(unsafe.Pointer(counterDataTypeEnum)), (*C.GLuint64)(unsafe.Pointer(rawCounterMaxValue)))
+}
+func GetPerfMonitorCounterDataAMD(monitor uint32, pname uint32, dataSize int32, data *uint32, bytesWritten *int32) {
+ C.glowGetPerfMonitorCounterDataAMD(gpGetPerfMonitorCounterDataAMD, (C.GLuint)(monitor), (C.GLenum)(pname), (C.GLsizei)(dataSize), (*C.GLuint)(unsafe.Pointer(data)), (*C.GLint)(unsafe.Pointer(bytesWritten)))
+}
+func GetPerfMonitorCounterInfoAMD(group uint32, counter uint32, pname uint32, data unsafe.Pointer) {
+ C.glowGetPerfMonitorCounterInfoAMD(gpGetPerfMonitorCounterInfoAMD, (C.GLuint)(group), (C.GLuint)(counter), (C.GLenum)(pname), data)
+}
+func GetPerfMonitorCounterStringAMD(group uint32, counter uint32, bufSize int32, length *int32, counterString *uint8) {
+ C.glowGetPerfMonitorCounterStringAMD(gpGetPerfMonitorCounterStringAMD, (C.GLuint)(group), (C.GLuint)(counter), (C.GLsizei)(bufSize), (*C.GLsizei)(unsafe.Pointer(length)), (*C.GLchar)(unsafe.Pointer(counterString)))
+}
+func GetPerfMonitorCountersAMD(group uint32, numCounters *int32, maxActiveCounters *int32, counterSize int32, counters *uint32) {
+ C.glowGetPerfMonitorCountersAMD(gpGetPerfMonitorCountersAMD, (C.GLuint)(group), (*C.GLint)(unsafe.Pointer(numCounters)), (*C.GLint)(unsafe.Pointer(maxActiveCounters)), (C.GLsizei)(counterSize), (*C.GLuint)(unsafe.Pointer(counters)))
+}
+func GetPerfMonitorGroupStringAMD(group uint32, bufSize int32, length *int32, groupString *uint8) {
+ C.glowGetPerfMonitorGroupStringAMD(gpGetPerfMonitorGroupStringAMD, (C.GLuint)(group), (C.GLsizei)(bufSize), (*C.GLsizei)(unsafe.Pointer(length)), (*C.GLchar)(unsafe.Pointer(groupString)))
+}
+func GetPerfMonitorGroupsAMD(numGroups *int32, groupsSize int32, groups *uint32) {
+ C.glowGetPerfMonitorGroupsAMD(gpGetPerfMonitorGroupsAMD, (*C.GLint)(unsafe.Pointer(numGroups)), (C.GLsizei)(groupsSize), (*C.GLuint)(unsafe.Pointer(groups)))
+}
+func GetPerfQueryDataINTEL(queryHandle uint32, flags uint32, dataSize int32, data unsafe.Pointer, bytesWritten *uint32) {
+ C.glowGetPerfQueryDataINTEL(gpGetPerfQueryDataINTEL, (C.GLuint)(queryHandle), (C.GLuint)(flags), (C.GLsizei)(dataSize), data, (*C.GLuint)(unsafe.Pointer(bytesWritten)))
+}
+func GetPerfQueryIdByNameINTEL(queryName *uint8, queryId *uint32) {
+ C.glowGetPerfQueryIdByNameINTEL(gpGetPerfQueryIdByNameINTEL, (*C.GLchar)(unsafe.Pointer(queryName)), (*C.GLuint)(unsafe.Pointer(queryId)))
+}
+func GetPerfQueryInfoINTEL(queryId uint32, queryNameLength uint32, queryName *uint8, dataSize *uint32, noCounters *uint32, noInstances *uint32, capsMask *uint32) {
+ C.glowGetPerfQueryInfoINTEL(gpGetPerfQueryInfoINTEL, (C.GLuint)(queryId), (C.GLuint)(queryNameLength), (*C.GLchar)(unsafe.Pointer(queryName)), (*C.GLuint)(unsafe.Pointer(dataSize)), (*C.GLuint)(unsafe.Pointer(noCounters)), (*C.GLuint)(unsafe.Pointer(noInstances)), (*C.GLuint)(unsafe.Pointer(capsMask)))
+}
+func GetPointerIndexedvEXT(target uint32, index uint32, data *unsafe.Pointer) {
+ C.glowGetPointerIndexedvEXT(gpGetPointerIndexedvEXT, (C.GLenum)(target), (C.GLuint)(index), data)
+}
+func GetPointeri_vEXT(pname uint32, index uint32, params *unsafe.Pointer) {
+ C.glowGetPointeri_vEXT(gpGetPointeri_vEXT, (C.GLenum)(pname), (C.GLuint)(index), params)
+}
+
+// return the address of the specified pointer
+func GetPointerv(pname uint32, params *unsafe.Pointer) {
+ C.glowGetPointerv(gpGetPointerv, (C.GLenum)(pname), params)
+}
+func GetPointervKHR(pname uint32, params *unsafe.Pointer) {
+ C.glowGetPointervKHR(gpGetPointervKHR, (C.GLenum)(pname), params)
+}
+
+// return a binary representation of a program object's compiled and linked executable source
+func GetProgramBinary(program uint32, bufSize int32, length *int32, binaryFormat *uint32, binary unsafe.Pointer) {
+ C.glowGetProgramBinary(gpGetProgramBinary, (C.GLuint)(program), (C.GLsizei)(bufSize), (*C.GLsizei)(unsafe.Pointer(length)), (*C.GLenum)(unsafe.Pointer(binaryFormat)), binary)
+}
+
+// Returns the information log for a program object
+func GetProgramInfoLog(program uint32, bufSize int32, length *int32, infoLog *uint8) {
+ C.glowGetProgramInfoLog(gpGetProgramInfoLog, (C.GLuint)(program), (C.GLsizei)(bufSize), (*C.GLsizei)(unsafe.Pointer(length)), (*C.GLchar)(unsafe.Pointer(infoLog)))
+}
+func GetProgramInterfaceiv(program uint32, programInterface uint32, pname uint32, params *int32) {
+ C.glowGetProgramInterfaceiv(gpGetProgramInterfaceiv, (C.GLuint)(program), (C.GLenum)(programInterface), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params)))
+}
+
+// retrieve the info log string from a program pipeline object
+func GetProgramPipelineInfoLog(pipeline uint32, bufSize int32, length *int32, infoLog *uint8) {
+ C.glowGetProgramPipelineInfoLog(gpGetProgramPipelineInfoLog, (C.GLuint)(pipeline), (C.GLsizei)(bufSize), (*C.GLsizei)(unsafe.Pointer(length)), (*C.GLchar)(unsafe.Pointer(infoLog)))
+}
+func GetProgramPipelineInfoLogEXT(pipeline uint32, bufSize int32, length *int32, infoLog *uint8) {
+ C.glowGetProgramPipelineInfoLogEXT(gpGetProgramPipelineInfoLogEXT, (C.GLuint)(pipeline), (C.GLsizei)(bufSize), (*C.GLsizei)(unsafe.Pointer(length)), (*C.GLchar)(unsafe.Pointer(infoLog)))
+}
+func GetProgramPipelineiv(pipeline uint32, pname uint32, params *int32) {
+ C.glowGetProgramPipelineiv(gpGetProgramPipelineiv, (C.GLuint)(pipeline), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params)))
+}
+func GetProgramPipelineivEXT(pipeline uint32, pname uint32, params *int32) {
+ C.glowGetProgramPipelineivEXT(gpGetProgramPipelineivEXT, (C.GLuint)(pipeline), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params)))
+}
+
+// query the index of a named resource within a program
+func GetProgramResourceIndex(program uint32, programInterface uint32, name *uint8) uint32 {
+ ret := C.glowGetProgramResourceIndex(gpGetProgramResourceIndex, (C.GLuint)(program), (C.GLenum)(programInterface), (*C.GLchar)(unsafe.Pointer(name)))
+ return (uint32)(ret)
+}
+
+// query the location of a named resource within a program
+func GetProgramResourceLocation(program uint32, programInterface uint32, name *uint8) int32 {
+ ret := C.glowGetProgramResourceLocation(gpGetProgramResourceLocation, (C.GLuint)(program), (C.GLenum)(programInterface), (*C.GLchar)(unsafe.Pointer(name)))
+ return (int32)(ret)
+}
+
+// query the fragment color index of a named variable within a program
+func GetProgramResourceLocationIndex(program uint32, programInterface uint32, name *uint8) int32 {
+ ret := C.glowGetProgramResourceLocationIndex(gpGetProgramResourceLocationIndex, (C.GLuint)(program), (C.GLenum)(programInterface), (*C.GLchar)(unsafe.Pointer(name)))
+ return (int32)(ret)
+}
+
+// query the name of an indexed resource within a program
+func GetProgramResourceName(program uint32, programInterface uint32, index uint32, bufSize int32, length *int32, name *uint8) {
+ C.glowGetProgramResourceName(gpGetProgramResourceName, (C.GLuint)(program), (C.GLenum)(programInterface), (C.GLuint)(index), (C.GLsizei)(bufSize), (*C.GLsizei)(unsafe.Pointer(length)), (*C.GLchar)(unsafe.Pointer(name)))
+}
+func GetProgramResourcefvNV(program uint32, programInterface uint32, index uint32, propCount int32, props *uint32, count int32, length *int32, params *float32) {
+ C.glowGetProgramResourcefvNV(gpGetProgramResourcefvNV, (C.GLuint)(program), (C.GLenum)(programInterface), (C.GLuint)(index), (C.GLsizei)(propCount), (*C.GLenum)(unsafe.Pointer(props)), (C.GLsizei)(count), (*C.GLsizei)(unsafe.Pointer(length)), (*C.GLfloat)(unsafe.Pointer(params)))
+}
+func GetProgramResourceiv(program uint32, programInterface uint32, index uint32, propCount int32, props *uint32, count int32, length *int32, params *int32) {
+ C.glowGetProgramResourceiv(gpGetProgramResourceiv, (C.GLuint)(program), (C.GLenum)(programInterface), (C.GLuint)(index), (C.GLsizei)(propCount), (*C.GLenum)(unsafe.Pointer(props)), (C.GLsizei)(count), (*C.GLsizei)(unsafe.Pointer(length)), (*C.GLint)(unsafe.Pointer(params)))
+}
+func GetProgramStageiv(program uint32, shadertype uint32, pname uint32, values *int32) {
+ C.glowGetProgramStageiv(gpGetProgramStageiv, (C.GLuint)(program), (C.GLenum)(shadertype), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(values)))
+}
+
+// Returns a parameter from a program object
+func GetProgramiv(program uint32, pname uint32, params *int32) {
+ C.glowGetProgramiv(gpGetProgramiv, (C.GLuint)(program), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params)))
+}
+func GetQueryBufferObjecti64v(id uint32, buffer uint32, pname uint32, offset int) {
+ C.glowGetQueryBufferObjecti64v(gpGetQueryBufferObjecti64v, (C.GLuint)(id), (C.GLuint)(buffer), (C.GLenum)(pname), (C.GLintptr)(offset))
+}
+func GetQueryBufferObjectiv(id uint32, buffer uint32, pname uint32, offset int) {
+ C.glowGetQueryBufferObjectiv(gpGetQueryBufferObjectiv, (C.GLuint)(id), (C.GLuint)(buffer), (C.GLenum)(pname), (C.GLintptr)(offset))
+}
+func GetQueryBufferObjectui64v(id uint32, buffer uint32, pname uint32, offset int) {
+ C.glowGetQueryBufferObjectui64v(gpGetQueryBufferObjectui64v, (C.GLuint)(id), (C.GLuint)(buffer), (C.GLenum)(pname), (C.GLintptr)(offset))
+}
+func GetQueryBufferObjectuiv(id uint32, buffer uint32, pname uint32, offset int) {
+ C.glowGetQueryBufferObjectuiv(gpGetQueryBufferObjectuiv, (C.GLuint)(id), (C.GLuint)(buffer), (C.GLenum)(pname), (C.GLintptr)(offset))
+}
+
+// return parameters of an indexed query object target
+func GetQueryIndexediv(target uint32, index uint32, pname uint32, params *int32) {
+ C.glowGetQueryIndexediv(gpGetQueryIndexediv, (C.GLenum)(target), (C.GLuint)(index), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params)))
+}
+func GetQueryObjecti64v(id uint32, pname uint32, params *int64) {
+ C.glowGetQueryObjecti64v(gpGetQueryObjecti64v, (C.GLuint)(id), (C.GLenum)(pname), (*C.GLint64)(unsafe.Pointer(params)))
+}
+func GetQueryObjectiv(id uint32, pname uint32, params *int32) {
+ C.glowGetQueryObjectiv(gpGetQueryObjectiv, (C.GLuint)(id), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params)))
+}
+func GetQueryObjectui64v(id uint32, pname uint32, params *uint64) {
+ C.glowGetQueryObjectui64v(gpGetQueryObjectui64v, (C.GLuint)(id), (C.GLenum)(pname), (*C.GLuint64)(unsafe.Pointer(params)))
+}
+
+// return parameters of a query object
+func GetQueryObjectuiv(id uint32, pname uint32, params *uint32) {
+ C.glowGetQueryObjectuiv(gpGetQueryObjectuiv, (C.GLuint)(id), (C.GLenum)(pname), (*C.GLuint)(unsafe.Pointer(params)))
+}
+
+// return parameters of a query object target
+func GetQueryiv(target uint32, pname uint32, params *int32) {
+ C.glowGetQueryiv(gpGetQueryiv, (C.GLenum)(target), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params)))
+}
+
+// retrieve information about a bound renderbuffer object
+func GetRenderbufferParameteriv(target uint32, pname uint32, params *int32) {
+ C.glowGetRenderbufferParameteriv(gpGetRenderbufferParameteriv, (C.GLenum)(target), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params)))
+}
+func GetSamplerParameterIiv(sampler uint32, pname uint32, params *int32) {
+ C.glowGetSamplerParameterIiv(gpGetSamplerParameterIiv, (C.GLuint)(sampler), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params)))
+}
+func GetSamplerParameterIuiv(sampler uint32, pname uint32, params *uint32) {
+ C.glowGetSamplerParameterIuiv(gpGetSamplerParameterIuiv, (C.GLuint)(sampler), (C.GLenum)(pname), (*C.GLuint)(unsafe.Pointer(params)))
+}
+func GetSamplerParameterfv(sampler uint32, pname uint32, params *float32) {
+ C.glowGetSamplerParameterfv(gpGetSamplerParameterfv, (C.GLuint)(sampler), (C.GLenum)(pname), (*C.GLfloat)(unsafe.Pointer(params)))
+}
+func GetSamplerParameteriv(sampler uint32, pname uint32, params *int32) {
+ C.glowGetSamplerParameteriv(gpGetSamplerParameteriv, (C.GLuint)(sampler), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params)))
+}
+
+// Returns the information log for a shader object
+func GetShaderInfoLog(shader uint32, bufSize int32, length *int32, infoLog *uint8) {
+ C.glowGetShaderInfoLog(gpGetShaderInfoLog, (C.GLuint)(shader), (C.GLsizei)(bufSize), (*C.GLsizei)(unsafe.Pointer(length)), (*C.GLchar)(unsafe.Pointer(infoLog)))
+}
+
+// retrieve the range and precision for numeric formats supported by the shader compiler
+func GetShaderPrecisionFormat(shadertype uint32, precisiontype uint32, xrange *int32, precision *int32) {
+ C.glowGetShaderPrecisionFormat(gpGetShaderPrecisionFormat, (C.GLenum)(shadertype), (C.GLenum)(precisiontype), (*C.GLint)(unsafe.Pointer(xrange)), (*C.GLint)(unsafe.Pointer(precision)))
+}
+
+// Returns the source code string from a shader object
+func GetShaderSource(shader uint32, bufSize int32, length *int32, source *uint8) {
+ C.glowGetShaderSource(gpGetShaderSource, (C.GLuint)(shader), (C.GLsizei)(bufSize), (*C.GLsizei)(unsafe.Pointer(length)), (*C.GLchar)(unsafe.Pointer(source)))
+}
+
+// Returns a parameter from a shader object
+func GetShaderiv(shader uint32, pname uint32, params *int32) {
+ C.glowGetShaderiv(gpGetShaderiv, (C.GLuint)(shader), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params)))
+}
+func GetShadingRateImagePaletteNV(viewport uint32, entry uint32, rate *uint32) {
+ C.glowGetShadingRateImagePaletteNV(gpGetShadingRateImagePaletteNV, (C.GLuint)(viewport), (C.GLuint)(entry), (*C.GLenum)(unsafe.Pointer(rate)))
+}
+func GetShadingRateSampleLocationivNV(rate uint32, samples uint32, index uint32, location *int32) {
+ C.glowGetShadingRateSampleLocationivNV(gpGetShadingRateSampleLocationivNV, (C.GLenum)(rate), (C.GLuint)(samples), (C.GLuint)(index), (*C.GLint)(unsafe.Pointer(location)))
+}
+func GetStageIndexNV(shadertype uint32) uint16 {
+ ret := C.glowGetStageIndexNV(gpGetStageIndexNV, (C.GLenum)(shadertype))
+ return (uint16)(ret)
+}
+
+// return a string describing the current GL connection
+func GetString(name uint32) *uint8 {
+ ret := C.glowGetString(gpGetString, (C.GLenum)(name))
+ return (*uint8)(ret)
+}
+func GetStringi(name uint32, index uint32) *uint8 {
+ ret := C.glowGetStringi(gpGetStringi, (C.GLenum)(name), (C.GLuint)(index))
+ return (*uint8)(ret)
+}
+
+// retrieve the index of a subroutine uniform of a given shader stage within a program
+func GetSubroutineIndex(program uint32, shadertype uint32, name *uint8) uint32 {
+ ret := C.glowGetSubroutineIndex(gpGetSubroutineIndex, (C.GLuint)(program), (C.GLenum)(shadertype), (*C.GLchar)(unsafe.Pointer(name)))
+ return (uint32)(ret)
+}
+
+// retrieve the location of a subroutine uniform of a given shader stage within a program
+func GetSubroutineUniformLocation(program uint32, shadertype uint32, name *uint8) int32 {
+ ret := C.glowGetSubroutineUniformLocation(gpGetSubroutineUniformLocation, (C.GLuint)(program), (C.GLenum)(shadertype), (*C.GLchar)(unsafe.Pointer(name)))
+ return (int32)(ret)
+}
+
+// query the properties of a sync object
+func GetSynciv(sync uintptr, pname uint32, count int32, length *int32, values *int32) {
+ C.glowGetSynciv(gpGetSynciv, (C.GLsync)(sync), (C.GLenum)(pname), (C.GLsizei)(count), (*C.GLsizei)(unsafe.Pointer(length)), (*C.GLint)(unsafe.Pointer(values)))
+}
+
+// return a texture image
+func GetTexImage(target uint32, level int32, format uint32, xtype uint32, pixels unsafe.Pointer) {
+ C.glowGetTexImage(gpGetTexImage, (C.GLenum)(target), (C.GLint)(level), (C.GLenum)(format), (C.GLenum)(xtype), pixels)
+}
+func GetTexLevelParameterfv(target uint32, level int32, pname uint32, params *float32) {
+ C.glowGetTexLevelParameterfv(gpGetTexLevelParameterfv, (C.GLenum)(target), (C.GLint)(level), (C.GLenum)(pname), (*C.GLfloat)(unsafe.Pointer(params)))
+}
+func GetTexLevelParameteriv(target uint32, level int32, pname uint32, params *int32) {
+ C.glowGetTexLevelParameteriv(gpGetTexLevelParameteriv, (C.GLenum)(target), (C.GLint)(level), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params)))
+}
+func GetTexParameterIiv(target uint32, pname uint32, params *int32) {
+ C.glowGetTexParameterIiv(gpGetTexParameterIiv, (C.GLenum)(target), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params)))
+}
+func GetTexParameterIuiv(target uint32, pname uint32, params *uint32) {
+ C.glowGetTexParameterIuiv(gpGetTexParameterIuiv, (C.GLenum)(target), (C.GLenum)(pname), (*C.GLuint)(unsafe.Pointer(params)))
+}
+func GetTexParameterfv(target uint32, pname uint32, params *float32) {
+ C.glowGetTexParameterfv(gpGetTexParameterfv, (C.GLenum)(target), (C.GLenum)(pname), (*C.GLfloat)(unsafe.Pointer(params)))
+}
+func GetTexParameteriv(target uint32, pname uint32, params *int32) {
+ C.glowGetTexParameteriv(gpGetTexParameteriv, (C.GLenum)(target), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params)))
+}
+func GetTextureHandleARB(texture uint32) uint64 {
+ ret := C.glowGetTextureHandleARB(gpGetTextureHandleARB, (C.GLuint)(texture))
+ return (uint64)(ret)
+}
+func GetTextureHandleNV(texture uint32) uint64 {
+ ret := C.glowGetTextureHandleNV(gpGetTextureHandleNV, (C.GLuint)(texture))
+ return (uint64)(ret)
+}
+
+// return a texture image
+func GetTextureImage(texture uint32, level int32, format uint32, xtype uint32, bufSize int32, pixels unsafe.Pointer) {
+ C.glowGetTextureImage(gpGetTextureImage, (C.GLuint)(texture), (C.GLint)(level), (C.GLenum)(format), (C.GLenum)(xtype), (C.GLsizei)(bufSize), pixels)
+}
+func GetTextureImageEXT(texture uint32, target uint32, level int32, format uint32, xtype uint32, pixels unsafe.Pointer) {
+ C.glowGetTextureImageEXT(gpGetTextureImageEXT, (C.GLuint)(texture), (C.GLenum)(target), (C.GLint)(level), (C.GLenum)(format), (C.GLenum)(xtype), pixels)
+}
+func GetTextureLevelParameterfv(texture uint32, level int32, pname uint32, params *float32) {
+ C.glowGetTextureLevelParameterfv(gpGetTextureLevelParameterfv, (C.GLuint)(texture), (C.GLint)(level), (C.GLenum)(pname), (*C.GLfloat)(unsafe.Pointer(params)))
+}
+func GetTextureLevelParameterfvEXT(texture uint32, target uint32, level int32, pname uint32, params *float32) {
+ C.glowGetTextureLevelParameterfvEXT(gpGetTextureLevelParameterfvEXT, (C.GLuint)(texture), (C.GLenum)(target), (C.GLint)(level), (C.GLenum)(pname), (*C.GLfloat)(unsafe.Pointer(params)))
+}
+func GetTextureLevelParameteriv(texture uint32, level int32, pname uint32, params *int32) {
+ C.glowGetTextureLevelParameteriv(gpGetTextureLevelParameteriv, (C.GLuint)(texture), (C.GLint)(level), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params)))
+}
+func GetTextureLevelParameterivEXT(texture uint32, target uint32, level int32, pname uint32, params *int32) {
+ C.glowGetTextureLevelParameterivEXT(gpGetTextureLevelParameterivEXT, (C.GLuint)(texture), (C.GLenum)(target), (C.GLint)(level), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params)))
+}
+func GetTextureParameterIiv(texture uint32, pname uint32, params *int32) {
+ C.glowGetTextureParameterIiv(gpGetTextureParameterIiv, (C.GLuint)(texture), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params)))
+}
+func GetTextureParameterIivEXT(texture uint32, target uint32, pname uint32, params *int32) {
+ C.glowGetTextureParameterIivEXT(gpGetTextureParameterIivEXT, (C.GLuint)(texture), (C.GLenum)(target), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params)))
+}
+func GetTextureParameterIuiv(texture uint32, pname uint32, params *uint32) {
+ C.glowGetTextureParameterIuiv(gpGetTextureParameterIuiv, (C.GLuint)(texture), (C.GLenum)(pname), (*C.GLuint)(unsafe.Pointer(params)))
+}
+func GetTextureParameterIuivEXT(texture uint32, target uint32, pname uint32, params *uint32) {
+ C.glowGetTextureParameterIuivEXT(gpGetTextureParameterIuivEXT, (C.GLuint)(texture), (C.GLenum)(target), (C.GLenum)(pname), (*C.GLuint)(unsafe.Pointer(params)))
+}
+func GetTextureParameterfv(texture uint32, pname uint32, params *float32) {
+ C.glowGetTextureParameterfv(gpGetTextureParameterfv, (C.GLuint)(texture), (C.GLenum)(pname), (*C.GLfloat)(unsafe.Pointer(params)))
+}
+func GetTextureParameterfvEXT(texture uint32, target uint32, pname uint32, params *float32) {
+ C.glowGetTextureParameterfvEXT(gpGetTextureParameterfvEXT, (C.GLuint)(texture), (C.GLenum)(target), (C.GLenum)(pname), (*C.GLfloat)(unsafe.Pointer(params)))
+}
+func GetTextureParameteriv(texture uint32, pname uint32, params *int32) {
+ C.glowGetTextureParameteriv(gpGetTextureParameteriv, (C.GLuint)(texture), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params)))
+}
+func GetTextureParameterivEXT(texture uint32, target uint32, pname uint32, params *int32) {
+ C.glowGetTextureParameterivEXT(gpGetTextureParameterivEXT, (C.GLuint)(texture), (C.GLenum)(target), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params)))
+}
+func GetTextureSamplerHandleARB(texture uint32, sampler uint32) uint64 {
+ ret := C.glowGetTextureSamplerHandleARB(gpGetTextureSamplerHandleARB, (C.GLuint)(texture), (C.GLuint)(sampler))
+ return (uint64)(ret)
+}
+func GetTextureSamplerHandleNV(texture uint32, sampler uint32) uint64 {
+ ret := C.glowGetTextureSamplerHandleNV(gpGetTextureSamplerHandleNV, (C.GLuint)(texture), (C.GLuint)(sampler))
+ return (uint64)(ret)
+}
+
+// retrieve a sub-region of a texture image from a texture object
+func GetTextureSubImage(texture uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, format uint32, xtype uint32, bufSize int32, pixels unsafe.Pointer) {
+ C.glowGetTextureSubImage(gpGetTextureSubImage, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLenum)(format), (C.GLenum)(xtype), (C.GLsizei)(bufSize), pixels)
+}
+
+// retrieve information about varying variables selected for transform feedback
+func GetTransformFeedbackVarying(program uint32, index uint32, bufSize int32, length *int32, size *int32, xtype *uint32, name *uint8) {
+ C.glowGetTransformFeedbackVarying(gpGetTransformFeedbackVarying, (C.GLuint)(program), (C.GLuint)(index), (C.GLsizei)(bufSize), (*C.GLsizei)(unsafe.Pointer(length)), (*C.GLsizei)(unsafe.Pointer(size)), (*C.GLenum)(unsafe.Pointer(xtype)), (*C.GLchar)(unsafe.Pointer(name)))
+}
+func GetTransformFeedbacki64_v(xfb uint32, pname uint32, index uint32, param *int64) {
+ C.glowGetTransformFeedbacki64_v(gpGetTransformFeedbacki64_v, (C.GLuint)(xfb), (C.GLenum)(pname), (C.GLuint)(index), (*C.GLint64)(unsafe.Pointer(param)))
+}
+func GetTransformFeedbacki_v(xfb uint32, pname uint32, index uint32, param *int32) {
+ C.glowGetTransformFeedbacki_v(gpGetTransformFeedbacki_v, (C.GLuint)(xfb), (C.GLenum)(pname), (C.GLuint)(index), (*C.GLint)(unsafe.Pointer(param)))
+}
+
+// query the state of a transform feedback object.
+func GetTransformFeedbackiv(xfb uint32, pname uint32, param *int32) {
+ C.glowGetTransformFeedbackiv(gpGetTransformFeedbackiv, (C.GLuint)(xfb), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(param)))
+}
+
+// retrieve the index of a named uniform block
+func GetUniformBlockIndex(program uint32, uniformBlockName *uint8) uint32 {
+ ret := C.glowGetUniformBlockIndex(gpGetUniformBlockIndex, (C.GLuint)(program), (*C.GLchar)(unsafe.Pointer(uniformBlockName)))
+ return (uint32)(ret)
+}
+
+// retrieve the index of a named uniform block
+func GetUniformIndices(program uint32, uniformCount int32, uniformNames **uint8, uniformIndices *uint32) {
+ C.glowGetUniformIndices(gpGetUniformIndices, (C.GLuint)(program), (C.GLsizei)(uniformCount), (**C.GLchar)(unsafe.Pointer(uniformNames)), (*C.GLuint)(unsafe.Pointer(uniformIndices)))
+}
+
+// Returns the location of a uniform variable
+func GetUniformLocation(program uint32, name *uint8) int32 {
+ ret := C.glowGetUniformLocation(gpGetUniformLocation, (C.GLuint)(program), (*C.GLchar)(unsafe.Pointer(name)))
+ return (int32)(ret)
+}
+func GetUniformSubroutineuiv(shadertype uint32, location int32, params *uint32) {
+ C.glowGetUniformSubroutineuiv(gpGetUniformSubroutineuiv, (C.GLenum)(shadertype), (C.GLint)(location), (*C.GLuint)(unsafe.Pointer(params)))
+}
+func GetUniformdv(program uint32, location int32, params *float64) {
+ C.glowGetUniformdv(gpGetUniformdv, (C.GLuint)(program), (C.GLint)(location), (*C.GLdouble)(unsafe.Pointer(params)))
+}
+
+// Returns the value of a uniform variable
+func GetUniformfv(program uint32, location int32, params *float32) {
+ C.glowGetUniformfv(gpGetUniformfv, (C.GLuint)(program), (C.GLint)(location), (*C.GLfloat)(unsafe.Pointer(params)))
+}
+func GetUniformi64vARB(program uint32, location int32, params *int64) {
+ C.glowGetUniformi64vARB(gpGetUniformi64vARB, (C.GLuint)(program), (C.GLint)(location), (*C.GLint64)(unsafe.Pointer(params)))
+}
+func GetUniformi64vNV(program uint32, location int32, params *int64) {
+ C.glowGetUniformi64vNV(gpGetUniformi64vNV, (C.GLuint)(program), (C.GLint)(location), (*C.GLint64EXT)(unsafe.Pointer(params)))
+}
+
+// Returns the value of a uniform variable
+func GetUniformiv(program uint32, location int32, params *int32) {
+ C.glowGetUniformiv(gpGetUniformiv, (C.GLuint)(program), (C.GLint)(location), (*C.GLint)(unsafe.Pointer(params)))
+}
+func GetUniformui64vARB(program uint32, location int32, params *uint64) {
+ C.glowGetUniformui64vARB(gpGetUniformui64vARB, (C.GLuint)(program), (C.GLint)(location), (*C.GLuint64)(unsafe.Pointer(params)))
+}
+func GetUniformui64vNV(program uint32, location int32, params *uint64) {
+ C.glowGetUniformui64vNV(gpGetUniformui64vNV, (C.GLuint)(program), (C.GLint)(location), (*C.GLuint64EXT)(unsafe.Pointer(params)))
+}
+func GetUniformuiv(program uint32, location int32, params *uint32) {
+ C.glowGetUniformuiv(gpGetUniformuiv, (C.GLuint)(program), (C.GLint)(location), (*C.GLuint)(unsafe.Pointer(params)))
+}
+func GetVertexArrayIndexed64iv(vaobj uint32, index uint32, pname uint32, param *int64) {
+ C.glowGetVertexArrayIndexed64iv(gpGetVertexArrayIndexed64iv, (C.GLuint)(vaobj), (C.GLuint)(index), (C.GLenum)(pname), (*C.GLint64)(unsafe.Pointer(param)))
+}
+func GetVertexArrayIndexediv(vaobj uint32, index uint32, pname uint32, param *int32) {
+ C.glowGetVertexArrayIndexediv(gpGetVertexArrayIndexediv, (C.GLuint)(vaobj), (C.GLuint)(index), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(param)))
+}
+func GetVertexArrayIntegeri_vEXT(vaobj uint32, index uint32, pname uint32, param *int32) {
+ C.glowGetVertexArrayIntegeri_vEXT(gpGetVertexArrayIntegeri_vEXT, (C.GLuint)(vaobj), (C.GLuint)(index), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(param)))
+}
+func GetVertexArrayIntegervEXT(vaobj uint32, pname uint32, param *int32) {
+ C.glowGetVertexArrayIntegervEXT(gpGetVertexArrayIntegervEXT, (C.GLuint)(vaobj), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(param)))
+}
+func GetVertexArrayPointeri_vEXT(vaobj uint32, index uint32, pname uint32, param *unsafe.Pointer) {
+ C.glowGetVertexArrayPointeri_vEXT(gpGetVertexArrayPointeri_vEXT, (C.GLuint)(vaobj), (C.GLuint)(index), (C.GLenum)(pname), param)
+}
+func GetVertexArrayPointervEXT(vaobj uint32, pname uint32, param *unsafe.Pointer) {
+ C.glowGetVertexArrayPointervEXT(gpGetVertexArrayPointervEXT, (C.GLuint)(vaobj), (C.GLenum)(pname), param)
+}
+
+// retrieve parameters of a vertex array object
+func GetVertexArrayiv(vaobj uint32, pname uint32, param *int32) {
+ C.glowGetVertexArrayiv(gpGetVertexArrayiv, (C.GLuint)(vaobj), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(param)))
+}
+
+// Return a generic vertex attribute parameter
+func GetVertexAttribIiv(index uint32, pname uint32, params *int32) {
+ C.glowGetVertexAttribIiv(gpGetVertexAttribIiv, (C.GLuint)(index), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params)))
+}
+
+// Return a generic vertex attribute parameter
+func GetVertexAttribIuiv(index uint32, pname uint32, params *uint32) {
+ C.glowGetVertexAttribIuiv(gpGetVertexAttribIuiv, (C.GLuint)(index), (C.GLenum)(pname), (*C.GLuint)(unsafe.Pointer(params)))
+}
+
+// Return a generic vertex attribute parameter
+func GetVertexAttribLdv(index uint32, pname uint32, params *float64) {
+ C.glowGetVertexAttribLdv(gpGetVertexAttribLdv, (C.GLuint)(index), (C.GLenum)(pname), (*C.GLdouble)(unsafe.Pointer(params)))
+}
+func GetVertexAttribLi64vNV(index uint32, pname uint32, params *int64) {
+ C.glowGetVertexAttribLi64vNV(gpGetVertexAttribLi64vNV, (C.GLuint)(index), (C.GLenum)(pname), (*C.GLint64EXT)(unsafe.Pointer(params)))
+}
+func GetVertexAttribLui64vARB(index uint32, pname uint32, params *uint64) {
+ C.glowGetVertexAttribLui64vARB(gpGetVertexAttribLui64vARB, (C.GLuint)(index), (C.GLenum)(pname), (*C.GLuint64EXT)(unsafe.Pointer(params)))
+}
+func GetVertexAttribLui64vNV(index uint32, pname uint32, params *uint64) {
+ C.glowGetVertexAttribLui64vNV(gpGetVertexAttribLui64vNV, (C.GLuint)(index), (C.GLenum)(pname), (*C.GLuint64EXT)(unsafe.Pointer(params)))
+}
+
+// return the address of the specified generic vertex attribute pointer
+func GetVertexAttribPointerv(index uint32, pname uint32, pointer *unsafe.Pointer) {
+ C.glowGetVertexAttribPointerv(gpGetVertexAttribPointerv, (C.GLuint)(index), (C.GLenum)(pname), pointer)
+}
+func GetVertexAttribPointerWithOffsetv(index uint32, pname uint32, offset **uintptr) {
+ C.glowGetVertexAttribPointerWithOffsetv(gpGetVertexAttribPointerv, (C.GLuint)(index), (C.GLenum)(pname), (**C.uintptr_t)(unsafe.Pointer(offset)))
+}
+
+// Return a generic vertex attribute parameter
+func GetVertexAttribdv(index uint32, pname uint32, params *float64) {
+ C.glowGetVertexAttribdv(gpGetVertexAttribdv, (C.GLuint)(index), (C.GLenum)(pname), (*C.GLdouble)(unsafe.Pointer(params)))
+}
+
+// Return a generic vertex attribute parameter
+func GetVertexAttribfv(index uint32, pname uint32, params *float32) {
+ C.glowGetVertexAttribfv(gpGetVertexAttribfv, (C.GLuint)(index), (C.GLenum)(pname), (*C.GLfloat)(unsafe.Pointer(params)))
+}
+
+// Return a generic vertex attribute parameter
+func GetVertexAttribiv(index uint32, pname uint32, params *int32) {
+ C.glowGetVertexAttribiv(gpGetVertexAttribiv, (C.GLuint)(index), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params)))
+}
+
+// Return value has type C.GLVULKANPROCNV.
+func GetVkProcAddrNV(name *uint8) unsafe.Pointer {
+ ret := C.glowGetVkProcAddrNV(gpGetVkProcAddrNV, (*C.GLchar)(unsafe.Pointer(name)))
+ return (unsafe.Pointer)(ret)
+}
+func GetnCompressedTexImageARB(target uint32, lod int32, bufSize int32, img unsafe.Pointer) {
+ C.glowGetnCompressedTexImageARB(gpGetnCompressedTexImageARB, (C.GLenum)(target), (C.GLint)(lod), (C.GLsizei)(bufSize), img)
+}
+func GetnTexImageARB(target uint32, level int32, format uint32, xtype uint32, bufSize int32, img unsafe.Pointer) {
+ C.glowGetnTexImageARB(gpGetnTexImageARB, (C.GLenum)(target), (C.GLint)(level), (C.GLenum)(format), (C.GLenum)(xtype), (C.GLsizei)(bufSize), img)
+}
+func GetnUniformdvARB(program uint32, location int32, bufSize int32, params *float64) {
+ C.glowGetnUniformdvARB(gpGetnUniformdvARB, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(bufSize), (*C.GLdouble)(unsafe.Pointer(params)))
+}
+func GetnUniformfv(program uint32, location int32, bufSize int32, params *float32) {
+ C.glowGetnUniformfv(gpGetnUniformfv, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(bufSize), (*C.GLfloat)(unsafe.Pointer(params)))
+}
+func GetnUniformfvARB(program uint32, location int32, bufSize int32, params *float32) {
+ C.glowGetnUniformfvARB(gpGetnUniformfvARB, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(bufSize), (*C.GLfloat)(unsafe.Pointer(params)))
+}
+func GetnUniformfvKHR(program uint32, location int32, bufSize int32, params *float32) {
+ C.glowGetnUniformfvKHR(gpGetnUniformfvKHR, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(bufSize), (*C.GLfloat)(unsafe.Pointer(params)))
+}
+func GetnUniformi64vARB(program uint32, location int32, bufSize int32, params *int64) {
+ C.glowGetnUniformi64vARB(gpGetnUniformi64vARB, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(bufSize), (*C.GLint64)(unsafe.Pointer(params)))
+}
+func GetnUniformiv(program uint32, location int32, bufSize int32, params *int32) {
+ C.glowGetnUniformiv(gpGetnUniformiv, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(bufSize), (*C.GLint)(unsafe.Pointer(params)))
+}
+func GetnUniformivARB(program uint32, location int32, bufSize int32, params *int32) {
+ C.glowGetnUniformivARB(gpGetnUniformivARB, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(bufSize), (*C.GLint)(unsafe.Pointer(params)))
+}
+func GetnUniformivKHR(program uint32, location int32, bufSize int32, params *int32) {
+ C.glowGetnUniformivKHR(gpGetnUniformivKHR, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(bufSize), (*C.GLint)(unsafe.Pointer(params)))
+}
+func GetnUniformui64vARB(program uint32, location int32, bufSize int32, params *uint64) {
+ C.glowGetnUniformui64vARB(gpGetnUniformui64vARB, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(bufSize), (*C.GLuint64)(unsafe.Pointer(params)))
+}
+func GetnUniformuiv(program uint32, location int32, bufSize int32, params *uint32) {
+ C.glowGetnUniformuiv(gpGetnUniformuiv, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(bufSize), (*C.GLuint)(unsafe.Pointer(params)))
+}
+func GetnUniformuivARB(program uint32, location int32, bufSize int32, params *uint32) {
+ C.glowGetnUniformuivARB(gpGetnUniformuivARB, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(bufSize), (*C.GLuint)(unsafe.Pointer(params)))
+}
+func GetnUniformuivKHR(program uint32, location int32, bufSize int32, params *uint32) {
+ C.glowGetnUniformuivKHR(gpGetnUniformuivKHR, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(bufSize), (*C.GLuint)(unsafe.Pointer(params)))
+}
+
+// specify implementation-specific hints
+func Hint(target uint32, mode uint32) {
+ C.glowHint(gpHint, (C.GLenum)(target), (C.GLenum)(mode))
+}
+func IndexFormatNV(xtype uint32, stride int32) {
+ C.glowIndexFormatNV(gpIndexFormatNV, (C.GLenum)(xtype), (C.GLsizei)(stride))
+}
+func InsertEventMarkerEXT(length int32, marker *uint8) {
+ C.glowInsertEventMarkerEXT(gpInsertEventMarkerEXT, (C.GLsizei)(length), (*C.GLchar)(unsafe.Pointer(marker)))
+}
+func InterpolatePathsNV(resultPath uint32, pathA uint32, pathB uint32, weight float32) {
+ C.glowInterpolatePathsNV(gpInterpolatePathsNV, (C.GLuint)(resultPath), (C.GLuint)(pathA), (C.GLuint)(pathB), (C.GLfloat)(weight))
+}
+
+// invalidate the content of a buffer object's data store
+func InvalidateBufferData(buffer uint32) {
+ C.glowInvalidateBufferData(gpInvalidateBufferData, (C.GLuint)(buffer))
+}
+
+// invalidate a region of a buffer object's data store
+func InvalidateBufferSubData(buffer uint32, offset int, length int) {
+ C.glowInvalidateBufferSubData(gpInvalidateBufferSubData, (C.GLuint)(buffer), (C.GLintptr)(offset), (C.GLsizeiptr)(length))
+}
+
+// invalidate the content of some or all of a framebuffer's attachments
+func InvalidateFramebuffer(target uint32, numAttachments int32, attachments *uint32) {
+ C.glowInvalidateFramebuffer(gpInvalidateFramebuffer, (C.GLenum)(target), (C.GLsizei)(numAttachments), (*C.GLenum)(unsafe.Pointer(attachments)))
+}
+
+// invalidate the content of some or all of a framebuffer's attachments
+func InvalidateNamedFramebufferData(framebuffer uint32, numAttachments int32, attachments *uint32) {
+ C.glowInvalidateNamedFramebufferData(gpInvalidateNamedFramebufferData, (C.GLuint)(framebuffer), (C.GLsizei)(numAttachments), (*C.GLenum)(unsafe.Pointer(attachments)))
+}
+
+// invalidate the content of a region of some or all of a framebuffer's attachments
+func InvalidateNamedFramebufferSubData(framebuffer uint32, numAttachments int32, attachments *uint32, x int32, y int32, width int32, height int32) {
+ C.glowInvalidateNamedFramebufferSubData(gpInvalidateNamedFramebufferSubData, (C.GLuint)(framebuffer), (C.GLsizei)(numAttachments), (*C.GLenum)(unsafe.Pointer(attachments)), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width), (C.GLsizei)(height))
+}
+
+// invalidate the content of a region of some or all of a framebuffer's attachments
+func InvalidateSubFramebuffer(target uint32, numAttachments int32, attachments *uint32, x int32, y int32, width int32, height int32) {
+ C.glowInvalidateSubFramebuffer(gpInvalidateSubFramebuffer, (C.GLenum)(target), (C.GLsizei)(numAttachments), (*C.GLenum)(unsafe.Pointer(attachments)), (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width), (C.GLsizei)(height))
+}
+
+// invalidate the entirety a texture image
+func InvalidateTexImage(texture uint32, level int32) {
+ C.glowInvalidateTexImage(gpInvalidateTexImage, (C.GLuint)(texture), (C.GLint)(level))
+}
+
+// invalidate a region of a texture image
+func InvalidateTexSubImage(texture uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32) {
+ C.glowInvalidateTexSubImage(gpInvalidateTexSubImage, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth))
+}
+
+// determine if a name corresponds to a buffer object
+func IsBuffer(buffer uint32) bool {
+ ret := C.glowIsBuffer(gpIsBuffer, (C.GLuint)(buffer))
+ return ret == TRUE
+}
+func IsBufferResidentNV(target uint32) bool {
+ ret := C.glowIsBufferResidentNV(gpIsBufferResidentNV, (C.GLenum)(target))
+ return ret == TRUE
+}
+func IsCommandListNV(list uint32) bool {
+ ret := C.glowIsCommandListNV(gpIsCommandListNV, (C.GLuint)(list))
+ return ret == TRUE
+}
+func IsEnabled(cap uint32) bool {
+ ret := C.glowIsEnabled(gpIsEnabled, (C.GLenum)(cap))
+ return ret == TRUE
+}
+func IsEnabledIndexedEXT(target uint32, index uint32) bool {
+ ret := C.glowIsEnabledIndexedEXT(gpIsEnabledIndexedEXT, (C.GLenum)(target), (C.GLuint)(index))
+ return ret == TRUE
+}
+func IsEnabledi(target uint32, index uint32) bool {
+ ret := C.glowIsEnabledi(gpIsEnabledi, (C.GLenum)(target), (C.GLuint)(index))
+ return ret == TRUE
+}
+
+// determine if a name corresponds to a framebuffer object
+func IsFramebuffer(framebuffer uint32) bool {
+ ret := C.glowIsFramebuffer(gpIsFramebuffer, (C.GLuint)(framebuffer))
+ return ret == TRUE
+}
+func IsImageHandleResidentARB(handle uint64) bool {
+ ret := C.glowIsImageHandleResidentARB(gpIsImageHandleResidentARB, (C.GLuint64)(handle))
+ return ret == TRUE
+}
+func IsImageHandleResidentNV(handle uint64) bool {
+ ret := C.glowIsImageHandleResidentNV(gpIsImageHandleResidentNV, (C.GLuint64)(handle))
+ return ret == TRUE
+}
+func IsNamedBufferResidentNV(buffer uint32) bool {
+ ret := C.glowIsNamedBufferResidentNV(gpIsNamedBufferResidentNV, (C.GLuint)(buffer))
+ return ret == TRUE
+}
+func IsNamedStringARB(namelen int32, name *uint8) bool {
+ ret := C.glowIsNamedStringARB(gpIsNamedStringARB, (C.GLint)(namelen), (*C.GLchar)(unsafe.Pointer(name)))
+ return ret == TRUE
+}
+func IsPathNV(path uint32) bool {
+ ret := C.glowIsPathNV(gpIsPathNV, (C.GLuint)(path))
+ return ret == TRUE
+}
+func IsPointInFillPathNV(path uint32, mask uint32, x float32, y float32) bool {
+ ret := C.glowIsPointInFillPathNV(gpIsPointInFillPathNV, (C.GLuint)(path), (C.GLuint)(mask), (C.GLfloat)(x), (C.GLfloat)(y))
+ return ret == TRUE
+}
+func IsPointInStrokePathNV(path uint32, x float32, y float32) bool {
+ ret := C.glowIsPointInStrokePathNV(gpIsPointInStrokePathNV, (C.GLuint)(path), (C.GLfloat)(x), (C.GLfloat)(y))
+ return ret == TRUE
+}
+
+// Determines if a name corresponds to a program object
+func IsProgram(program uint32) bool {
+ ret := C.glowIsProgram(gpIsProgram, (C.GLuint)(program))
+ return ret == TRUE
+}
+
+// determine if a name corresponds to a program pipeline object
+func IsProgramPipeline(pipeline uint32) bool {
+ ret := C.glowIsProgramPipeline(gpIsProgramPipeline, (C.GLuint)(pipeline))
+ return ret == TRUE
+}
+func IsProgramPipelineEXT(pipeline uint32) bool {
+ ret := C.glowIsProgramPipelineEXT(gpIsProgramPipelineEXT, (C.GLuint)(pipeline))
+ return ret == TRUE
+}
+
+// determine if a name corresponds to a query object
+func IsQuery(id uint32) bool {
+ ret := C.glowIsQuery(gpIsQuery, (C.GLuint)(id))
+ return ret == TRUE
+}
+
+// determine if a name corresponds to a renderbuffer object
+func IsRenderbuffer(renderbuffer uint32) bool {
+ ret := C.glowIsRenderbuffer(gpIsRenderbuffer, (C.GLuint)(renderbuffer))
+ return ret == TRUE
+}
+
+// determine if a name corresponds to a sampler object
+func IsSampler(sampler uint32) bool {
+ ret := C.glowIsSampler(gpIsSampler, (C.GLuint)(sampler))
+ return ret == TRUE
+}
+
+// Determines if a name corresponds to a shader object
+func IsShader(shader uint32) bool {
+ ret := C.glowIsShader(gpIsShader, (C.GLuint)(shader))
+ return ret == TRUE
+}
+func IsStateNV(state uint32) bool {
+ ret := C.glowIsStateNV(gpIsStateNV, (C.GLuint)(state))
+ return ret == TRUE
+}
+
+// determine if a name corresponds to a sync object
+func IsSync(sync uintptr) bool {
+ ret := C.glowIsSync(gpIsSync, (C.GLsync)(sync))
+ return ret == TRUE
+}
+
+// determine if a name corresponds to a texture
+func IsTexture(texture uint32) bool {
+ ret := C.glowIsTexture(gpIsTexture, (C.GLuint)(texture))
+ return ret == TRUE
+}
+func IsTextureHandleResidentARB(handle uint64) bool {
+ ret := C.glowIsTextureHandleResidentARB(gpIsTextureHandleResidentARB, (C.GLuint64)(handle))
+ return ret == TRUE
+}
+func IsTextureHandleResidentNV(handle uint64) bool {
+ ret := C.glowIsTextureHandleResidentNV(gpIsTextureHandleResidentNV, (C.GLuint64)(handle))
+ return ret == TRUE
+}
+
+// determine if a name corresponds to a transform feedback object
+func IsTransformFeedback(id uint32) bool {
+ ret := C.glowIsTransformFeedback(gpIsTransformFeedback, (C.GLuint)(id))
+ return ret == TRUE
+}
+
+// determine if a name corresponds to a vertex array object
+func IsVertexArray(array uint32) bool {
+ ret := C.glowIsVertexArray(gpIsVertexArray, (C.GLuint)(array))
+ return ret == TRUE
+}
+func LabelObjectEXT(xtype uint32, object uint32, length int32, label *uint8) {
+ C.glowLabelObjectEXT(gpLabelObjectEXT, (C.GLenum)(xtype), (C.GLuint)(object), (C.GLsizei)(length), (*C.GLchar)(unsafe.Pointer(label)))
+}
+
+// specify the width of rasterized lines
+func LineWidth(width float32) {
+ C.glowLineWidth(gpLineWidth, (C.GLfloat)(width))
+}
+
+// Links a program object
+func LinkProgram(program uint32) {
+ C.glowLinkProgram(gpLinkProgram, (C.GLuint)(program))
+}
+func ListDrawCommandsStatesClientNV(list uint32, segment uint32, indirects *unsafe.Pointer, sizes *int32, states *uint32, fbos *uint32, count uint32) {
+ C.glowListDrawCommandsStatesClientNV(gpListDrawCommandsStatesClientNV, (C.GLuint)(list), (C.GLuint)(segment), indirects, (*C.GLsizei)(unsafe.Pointer(sizes)), (*C.GLuint)(unsafe.Pointer(states)), (*C.GLuint)(unsafe.Pointer(fbos)), (C.GLuint)(count))
+}
+
+// specify a logical pixel operation for rendering
+func LogicOp(opcode uint32) {
+ C.glowLogicOp(gpLogicOp, (C.GLenum)(opcode))
+}
+func MakeBufferNonResidentNV(target uint32) {
+ C.glowMakeBufferNonResidentNV(gpMakeBufferNonResidentNV, (C.GLenum)(target))
+}
+func MakeBufferResidentNV(target uint32, access uint32) {
+ C.glowMakeBufferResidentNV(gpMakeBufferResidentNV, (C.GLenum)(target), (C.GLenum)(access))
+}
+func MakeImageHandleNonResidentARB(handle uint64) {
+ C.glowMakeImageHandleNonResidentARB(gpMakeImageHandleNonResidentARB, (C.GLuint64)(handle))
+}
+func MakeImageHandleNonResidentNV(handle uint64) {
+ C.glowMakeImageHandleNonResidentNV(gpMakeImageHandleNonResidentNV, (C.GLuint64)(handle))
+}
+func MakeImageHandleResidentARB(handle uint64, access uint32) {
+ C.glowMakeImageHandleResidentARB(gpMakeImageHandleResidentARB, (C.GLuint64)(handle), (C.GLenum)(access))
+}
+func MakeImageHandleResidentNV(handle uint64, access uint32) {
+ C.glowMakeImageHandleResidentNV(gpMakeImageHandleResidentNV, (C.GLuint64)(handle), (C.GLenum)(access))
+}
+func MakeNamedBufferNonResidentNV(buffer uint32) {
+ C.glowMakeNamedBufferNonResidentNV(gpMakeNamedBufferNonResidentNV, (C.GLuint)(buffer))
+}
+func MakeNamedBufferResidentNV(buffer uint32, access uint32) {
+ C.glowMakeNamedBufferResidentNV(gpMakeNamedBufferResidentNV, (C.GLuint)(buffer), (C.GLenum)(access))
+}
+func MakeTextureHandleNonResidentARB(handle uint64) {
+ C.glowMakeTextureHandleNonResidentARB(gpMakeTextureHandleNonResidentARB, (C.GLuint64)(handle))
+}
+func MakeTextureHandleNonResidentNV(handle uint64) {
+ C.glowMakeTextureHandleNonResidentNV(gpMakeTextureHandleNonResidentNV, (C.GLuint64)(handle))
+}
+func MakeTextureHandleResidentARB(handle uint64) {
+ C.glowMakeTextureHandleResidentARB(gpMakeTextureHandleResidentARB, (C.GLuint64)(handle))
+}
+func MakeTextureHandleResidentNV(handle uint64) {
+ C.glowMakeTextureHandleResidentNV(gpMakeTextureHandleResidentNV, (C.GLuint64)(handle))
+}
+
+// map all of a buffer object's data store into the client's address space
+func MapBuffer(target uint32, access uint32) unsafe.Pointer {
+ ret := C.glowMapBuffer(gpMapBuffer, (C.GLenum)(target), (C.GLenum)(access))
+ return (unsafe.Pointer)(ret)
+}
+
+// map all or part of a buffer object's data store into the client's address space
+func MapBufferRange(target uint32, offset int, length int, access uint32) unsafe.Pointer {
+ ret := C.glowMapBufferRange(gpMapBufferRange, (C.GLenum)(target), (C.GLintptr)(offset), (C.GLsizeiptr)(length), (C.GLbitfield)(access))
+ return (unsafe.Pointer)(ret)
+}
+
+// map all of a buffer object's data store into the client's address space
+func MapNamedBuffer(buffer uint32, access uint32) unsafe.Pointer {
+ ret := C.glowMapNamedBuffer(gpMapNamedBuffer, (C.GLuint)(buffer), (C.GLenum)(access))
+ return (unsafe.Pointer)(ret)
+}
+func MapNamedBufferEXT(buffer uint32, access uint32) unsafe.Pointer {
+ ret := C.glowMapNamedBufferEXT(gpMapNamedBufferEXT, (C.GLuint)(buffer), (C.GLenum)(access))
+ return (unsafe.Pointer)(ret)
+}
+
+// map all or part of a buffer object's data store into the client's address space
+func MapNamedBufferRange(buffer uint32, offset int, length int, access uint32) unsafe.Pointer {
+ ret := C.glowMapNamedBufferRange(gpMapNamedBufferRange, (C.GLuint)(buffer), (C.GLintptr)(offset), (C.GLsizeiptr)(length), (C.GLbitfield)(access))
+ return (unsafe.Pointer)(ret)
+}
+func MapNamedBufferRangeEXT(buffer uint32, offset int, length int, access uint32) unsafe.Pointer {
+ ret := C.glowMapNamedBufferRangeEXT(gpMapNamedBufferRangeEXT, (C.GLuint)(buffer), (C.GLintptr)(offset), (C.GLsizeiptr)(length), (C.GLbitfield)(access))
+ return (unsafe.Pointer)(ret)
+}
+func MatrixFrustumEXT(mode uint32, left float64, right float64, bottom float64, top float64, zNear float64, zFar float64) {
+ C.glowMatrixFrustumEXT(gpMatrixFrustumEXT, (C.GLenum)(mode), (C.GLdouble)(left), (C.GLdouble)(right), (C.GLdouble)(bottom), (C.GLdouble)(top), (C.GLdouble)(zNear), (C.GLdouble)(zFar))
+}
+func MatrixLoad3x2fNV(matrixMode uint32, m *float32) {
+ C.glowMatrixLoad3x2fNV(gpMatrixLoad3x2fNV, (C.GLenum)(matrixMode), (*C.GLfloat)(unsafe.Pointer(m)))
+}
+func MatrixLoad3x3fNV(matrixMode uint32, m *float32) {
+ C.glowMatrixLoad3x3fNV(gpMatrixLoad3x3fNV, (C.GLenum)(matrixMode), (*C.GLfloat)(unsafe.Pointer(m)))
+}
+func MatrixLoadIdentityEXT(mode uint32) {
+ C.glowMatrixLoadIdentityEXT(gpMatrixLoadIdentityEXT, (C.GLenum)(mode))
+}
+func MatrixLoadTranspose3x3fNV(matrixMode uint32, m *float32) {
+ C.glowMatrixLoadTranspose3x3fNV(gpMatrixLoadTranspose3x3fNV, (C.GLenum)(matrixMode), (*C.GLfloat)(unsafe.Pointer(m)))
+}
+func MatrixLoadTransposedEXT(mode uint32, m *float64) {
+ C.glowMatrixLoadTransposedEXT(gpMatrixLoadTransposedEXT, (C.GLenum)(mode), (*C.GLdouble)(unsafe.Pointer(m)))
+}
+func MatrixLoadTransposefEXT(mode uint32, m *float32) {
+ C.glowMatrixLoadTransposefEXT(gpMatrixLoadTransposefEXT, (C.GLenum)(mode), (*C.GLfloat)(unsafe.Pointer(m)))
+}
+func MatrixLoaddEXT(mode uint32, m *float64) {
+ C.glowMatrixLoaddEXT(gpMatrixLoaddEXT, (C.GLenum)(mode), (*C.GLdouble)(unsafe.Pointer(m)))
+}
+func MatrixLoadfEXT(mode uint32, m *float32) {
+ C.glowMatrixLoadfEXT(gpMatrixLoadfEXT, (C.GLenum)(mode), (*C.GLfloat)(unsafe.Pointer(m)))
+}
+func MatrixMult3x2fNV(matrixMode uint32, m *float32) {
+ C.glowMatrixMult3x2fNV(gpMatrixMult3x2fNV, (C.GLenum)(matrixMode), (*C.GLfloat)(unsafe.Pointer(m)))
+}
+func MatrixMult3x3fNV(matrixMode uint32, m *float32) {
+ C.glowMatrixMult3x3fNV(gpMatrixMult3x3fNV, (C.GLenum)(matrixMode), (*C.GLfloat)(unsafe.Pointer(m)))
+}
+func MatrixMultTranspose3x3fNV(matrixMode uint32, m *float32) {
+ C.glowMatrixMultTranspose3x3fNV(gpMatrixMultTranspose3x3fNV, (C.GLenum)(matrixMode), (*C.GLfloat)(unsafe.Pointer(m)))
+}
+func MatrixMultTransposedEXT(mode uint32, m *float64) {
+ C.glowMatrixMultTransposedEXT(gpMatrixMultTransposedEXT, (C.GLenum)(mode), (*C.GLdouble)(unsafe.Pointer(m)))
+}
+func MatrixMultTransposefEXT(mode uint32, m *float32) {
+ C.glowMatrixMultTransposefEXT(gpMatrixMultTransposefEXT, (C.GLenum)(mode), (*C.GLfloat)(unsafe.Pointer(m)))
+}
+func MatrixMultdEXT(mode uint32, m *float64) {
+ C.glowMatrixMultdEXT(gpMatrixMultdEXT, (C.GLenum)(mode), (*C.GLdouble)(unsafe.Pointer(m)))
+}
+func MatrixMultfEXT(mode uint32, m *float32) {
+ C.glowMatrixMultfEXT(gpMatrixMultfEXT, (C.GLenum)(mode), (*C.GLfloat)(unsafe.Pointer(m)))
+}
+func MatrixOrthoEXT(mode uint32, left float64, right float64, bottom float64, top float64, zNear float64, zFar float64) {
+ C.glowMatrixOrthoEXT(gpMatrixOrthoEXT, (C.GLenum)(mode), (C.GLdouble)(left), (C.GLdouble)(right), (C.GLdouble)(bottom), (C.GLdouble)(top), (C.GLdouble)(zNear), (C.GLdouble)(zFar))
+}
+func MatrixPopEXT(mode uint32) {
+ C.glowMatrixPopEXT(gpMatrixPopEXT, (C.GLenum)(mode))
+}
+func MatrixPushEXT(mode uint32) {
+ C.glowMatrixPushEXT(gpMatrixPushEXT, (C.GLenum)(mode))
+}
+func MatrixRotatedEXT(mode uint32, angle float64, x float64, y float64, z float64) {
+ C.glowMatrixRotatedEXT(gpMatrixRotatedEXT, (C.GLenum)(mode), (C.GLdouble)(angle), (C.GLdouble)(x), (C.GLdouble)(y), (C.GLdouble)(z))
+}
+func MatrixRotatefEXT(mode uint32, angle float32, x float32, y float32, z float32) {
+ C.glowMatrixRotatefEXT(gpMatrixRotatefEXT, (C.GLenum)(mode), (C.GLfloat)(angle), (C.GLfloat)(x), (C.GLfloat)(y), (C.GLfloat)(z))
+}
+func MatrixScaledEXT(mode uint32, x float64, y float64, z float64) {
+ C.glowMatrixScaledEXT(gpMatrixScaledEXT, (C.GLenum)(mode), (C.GLdouble)(x), (C.GLdouble)(y), (C.GLdouble)(z))
+}
+func MatrixScalefEXT(mode uint32, x float32, y float32, z float32) {
+ C.glowMatrixScalefEXT(gpMatrixScalefEXT, (C.GLenum)(mode), (C.GLfloat)(x), (C.GLfloat)(y), (C.GLfloat)(z))
+}
+func MatrixTranslatedEXT(mode uint32, x float64, y float64, z float64) {
+ C.glowMatrixTranslatedEXT(gpMatrixTranslatedEXT, (C.GLenum)(mode), (C.GLdouble)(x), (C.GLdouble)(y), (C.GLdouble)(z))
+}
+func MatrixTranslatefEXT(mode uint32, x float32, y float32, z float32) {
+ C.glowMatrixTranslatefEXT(gpMatrixTranslatefEXT, (C.GLenum)(mode), (C.GLfloat)(x), (C.GLfloat)(y), (C.GLfloat)(z))
+}
+func MaxShaderCompilerThreadsARB(count uint32) {
+ C.glowMaxShaderCompilerThreadsARB(gpMaxShaderCompilerThreadsARB, (C.GLuint)(count))
+}
+func MaxShaderCompilerThreadsKHR(count uint32) {
+ C.glowMaxShaderCompilerThreadsKHR(gpMaxShaderCompilerThreadsKHR, (C.GLuint)(count))
+}
+
+// defines a barrier ordering memory transactions
+func MemoryBarrier(barriers uint32) {
+ C.glowMemoryBarrier(gpMemoryBarrier, (C.GLbitfield)(barriers))
+}
+func MemoryBarrierByRegion(barriers uint32) {
+ C.glowMemoryBarrierByRegion(gpMemoryBarrierByRegion, (C.GLbitfield)(barriers))
+}
+func MinSampleShadingARB(value float32) {
+ C.glowMinSampleShadingARB(gpMinSampleShadingARB, (C.GLfloat)(value))
+}
+
+// render multiple sets of primitives from array data
+func MultiDrawArrays(mode uint32, first *int32, count *int32, drawcount int32) {
+ C.glowMultiDrawArrays(gpMultiDrawArrays, (C.GLenum)(mode), (*C.GLint)(unsafe.Pointer(first)), (*C.GLsizei)(unsafe.Pointer(count)), (C.GLsizei)(drawcount))
+}
+
+// render multiple sets of primitives from array data, taking parameters from memory
+func MultiDrawArraysIndirect(mode uint32, indirect unsafe.Pointer, drawcount int32, stride int32) {
+ C.glowMultiDrawArraysIndirect(gpMultiDrawArraysIndirect, (C.GLenum)(mode), indirect, (C.GLsizei)(drawcount), (C.GLsizei)(stride))
+}
+func MultiDrawArraysIndirectBindlessCountNV(mode uint32, indirect unsafe.Pointer, drawCount int32, maxDrawCount int32, stride int32, vertexBufferCount int32) {
+ C.glowMultiDrawArraysIndirectBindlessCountNV(gpMultiDrawArraysIndirectBindlessCountNV, (C.GLenum)(mode), indirect, (C.GLsizei)(drawCount), (C.GLsizei)(maxDrawCount), (C.GLsizei)(stride), (C.GLint)(vertexBufferCount))
+}
+func MultiDrawArraysIndirectBindlessNV(mode uint32, indirect unsafe.Pointer, drawCount int32, stride int32, vertexBufferCount int32) {
+ C.glowMultiDrawArraysIndirectBindlessNV(gpMultiDrawArraysIndirectBindlessNV, (C.GLenum)(mode), indirect, (C.GLsizei)(drawCount), (C.GLsizei)(stride), (C.GLint)(vertexBufferCount))
+}
+func MultiDrawArraysIndirectCountARB(mode uint32, indirect unsafe.Pointer, drawcount int, maxdrawcount int32, stride int32) {
+ C.glowMultiDrawArraysIndirectCountARB(gpMultiDrawArraysIndirectCountARB, (C.GLenum)(mode), indirect, (C.GLintptr)(drawcount), (C.GLsizei)(maxdrawcount), (C.GLsizei)(stride))
+}
+
+// render multiple sets of primitives by specifying indices of array data elements
+func MultiDrawElements(mode uint32, count *int32, xtype uint32, indices *unsafe.Pointer, drawcount int32) {
+ C.glowMultiDrawElements(gpMultiDrawElements, (C.GLenum)(mode), (*C.GLsizei)(unsafe.Pointer(count)), (C.GLenum)(xtype), indices, (C.GLsizei)(drawcount))
+}
+
+// render multiple sets of primitives by specifying indices of array data elements and an index to apply to each index
+func MultiDrawElementsBaseVertex(mode uint32, count *int32, xtype uint32, indices *unsafe.Pointer, drawcount int32, basevertex *int32) {
+ C.glowMultiDrawElementsBaseVertex(gpMultiDrawElementsBaseVertex, (C.GLenum)(mode), (*C.GLsizei)(unsafe.Pointer(count)), (C.GLenum)(xtype), indices, (C.GLsizei)(drawcount), (*C.GLint)(unsafe.Pointer(basevertex)))
+}
+
+// render indexed primitives from array data, taking parameters from memory
+func MultiDrawElementsIndirect(mode uint32, xtype uint32, indirect unsafe.Pointer, drawcount int32, stride int32) {
+ C.glowMultiDrawElementsIndirect(gpMultiDrawElementsIndirect, (C.GLenum)(mode), (C.GLenum)(xtype), indirect, (C.GLsizei)(drawcount), (C.GLsizei)(stride))
+}
+func MultiDrawElementsIndirectBindlessCountNV(mode uint32, xtype uint32, indirect unsafe.Pointer, drawCount int32, maxDrawCount int32, stride int32, vertexBufferCount int32) {
+ C.glowMultiDrawElementsIndirectBindlessCountNV(gpMultiDrawElementsIndirectBindlessCountNV, (C.GLenum)(mode), (C.GLenum)(xtype), indirect, (C.GLsizei)(drawCount), (C.GLsizei)(maxDrawCount), (C.GLsizei)(stride), (C.GLint)(vertexBufferCount))
+}
+func MultiDrawElementsIndirectBindlessNV(mode uint32, xtype uint32, indirect unsafe.Pointer, drawCount int32, stride int32, vertexBufferCount int32) {
+ C.glowMultiDrawElementsIndirectBindlessNV(gpMultiDrawElementsIndirectBindlessNV, (C.GLenum)(mode), (C.GLenum)(xtype), indirect, (C.GLsizei)(drawCount), (C.GLsizei)(stride), (C.GLint)(vertexBufferCount))
+}
+func MultiDrawElementsIndirectCountARB(mode uint32, xtype uint32, indirect unsafe.Pointer, drawcount int, maxdrawcount int32, stride int32) {
+ C.glowMultiDrawElementsIndirectCountARB(gpMultiDrawElementsIndirectCountARB, (C.GLenum)(mode), (C.GLenum)(xtype), indirect, (C.GLintptr)(drawcount), (C.GLsizei)(maxdrawcount), (C.GLsizei)(stride))
+}
+func MultiDrawMeshTasksIndirectCountNV(indirect int, drawcount int, maxdrawcount int32, stride int32) {
+ C.glowMultiDrawMeshTasksIndirectCountNV(gpMultiDrawMeshTasksIndirectCountNV, (C.GLintptr)(indirect), (C.GLintptr)(drawcount), (C.GLsizei)(maxdrawcount), (C.GLsizei)(stride))
+}
+func MultiDrawMeshTasksIndirectNV(indirect int, drawcount int32, stride int32) {
+ C.glowMultiDrawMeshTasksIndirectNV(gpMultiDrawMeshTasksIndirectNV, (C.GLintptr)(indirect), (C.GLsizei)(drawcount), (C.GLsizei)(stride))
+}
+func MultiTexBufferEXT(texunit uint32, target uint32, internalformat uint32, buffer uint32) {
+ C.glowMultiTexBufferEXT(gpMultiTexBufferEXT, (C.GLenum)(texunit), (C.GLenum)(target), (C.GLenum)(internalformat), (C.GLuint)(buffer))
+}
+func MultiTexCoordPointerEXT(texunit uint32, size int32, xtype uint32, stride int32, pointer unsafe.Pointer) {
+ C.glowMultiTexCoordPointerEXT(gpMultiTexCoordPointerEXT, (C.GLenum)(texunit), (C.GLint)(size), (C.GLenum)(xtype), (C.GLsizei)(stride), pointer)
+}
+func MultiTexEnvfEXT(texunit uint32, target uint32, pname uint32, param float32) {
+ C.glowMultiTexEnvfEXT(gpMultiTexEnvfEXT, (C.GLenum)(texunit), (C.GLenum)(target), (C.GLenum)(pname), (C.GLfloat)(param))
+}
+func MultiTexEnvfvEXT(texunit uint32, target uint32, pname uint32, params *float32) {
+ C.glowMultiTexEnvfvEXT(gpMultiTexEnvfvEXT, (C.GLenum)(texunit), (C.GLenum)(target), (C.GLenum)(pname), (*C.GLfloat)(unsafe.Pointer(params)))
+}
+func MultiTexEnviEXT(texunit uint32, target uint32, pname uint32, param int32) {
+ C.glowMultiTexEnviEXT(gpMultiTexEnviEXT, (C.GLenum)(texunit), (C.GLenum)(target), (C.GLenum)(pname), (C.GLint)(param))
+}
+func MultiTexEnvivEXT(texunit uint32, target uint32, pname uint32, params *int32) {
+ C.glowMultiTexEnvivEXT(gpMultiTexEnvivEXT, (C.GLenum)(texunit), (C.GLenum)(target), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params)))
+}
+func MultiTexGendEXT(texunit uint32, coord uint32, pname uint32, param float64) {
+ C.glowMultiTexGendEXT(gpMultiTexGendEXT, (C.GLenum)(texunit), (C.GLenum)(coord), (C.GLenum)(pname), (C.GLdouble)(param))
+}
+func MultiTexGendvEXT(texunit uint32, coord uint32, pname uint32, params *float64) {
+ C.glowMultiTexGendvEXT(gpMultiTexGendvEXT, (C.GLenum)(texunit), (C.GLenum)(coord), (C.GLenum)(pname), (*C.GLdouble)(unsafe.Pointer(params)))
+}
+func MultiTexGenfEXT(texunit uint32, coord uint32, pname uint32, param float32) {
+ C.glowMultiTexGenfEXT(gpMultiTexGenfEXT, (C.GLenum)(texunit), (C.GLenum)(coord), (C.GLenum)(pname), (C.GLfloat)(param))
+}
+func MultiTexGenfvEXT(texunit uint32, coord uint32, pname uint32, params *float32) {
+ C.glowMultiTexGenfvEXT(gpMultiTexGenfvEXT, (C.GLenum)(texunit), (C.GLenum)(coord), (C.GLenum)(pname), (*C.GLfloat)(unsafe.Pointer(params)))
+}
+func MultiTexGeniEXT(texunit uint32, coord uint32, pname uint32, param int32) {
+ C.glowMultiTexGeniEXT(gpMultiTexGeniEXT, (C.GLenum)(texunit), (C.GLenum)(coord), (C.GLenum)(pname), (C.GLint)(param))
+}
+func MultiTexGenivEXT(texunit uint32, coord uint32, pname uint32, params *int32) {
+ C.glowMultiTexGenivEXT(gpMultiTexGenivEXT, (C.GLenum)(texunit), (C.GLenum)(coord), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params)))
+}
+func MultiTexImage1DEXT(texunit uint32, target uint32, level int32, internalformat int32, width int32, border int32, format uint32, xtype uint32, pixels unsafe.Pointer) {
+ C.glowMultiTexImage1DEXT(gpMultiTexImage1DEXT, (C.GLenum)(texunit), (C.GLenum)(target), (C.GLint)(level), (C.GLint)(internalformat), (C.GLsizei)(width), (C.GLint)(border), (C.GLenum)(format), (C.GLenum)(xtype), pixels)
+}
+func MultiTexImage2DEXT(texunit uint32, target uint32, level int32, internalformat int32, width int32, height int32, border int32, format uint32, xtype uint32, pixels unsafe.Pointer) {
+ C.glowMultiTexImage2DEXT(gpMultiTexImage2DEXT, (C.GLenum)(texunit), (C.GLenum)(target), (C.GLint)(level), (C.GLint)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLint)(border), (C.GLenum)(format), (C.GLenum)(xtype), pixels)
+}
+func MultiTexImage3DEXT(texunit uint32, target uint32, level int32, internalformat int32, width int32, height int32, depth int32, border int32, format uint32, xtype uint32, pixels unsafe.Pointer) {
+ C.glowMultiTexImage3DEXT(gpMultiTexImage3DEXT, (C.GLenum)(texunit), (C.GLenum)(target), (C.GLint)(level), (C.GLint)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLint)(border), (C.GLenum)(format), (C.GLenum)(xtype), pixels)
+}
+func MultiTexParameterIivEXT(texunit uint32, target uint32, pname uint32, params *int32) {
+ C.glowMultiTexParameterIivEXT(gpMultiTexParameterIivEXT, (C.GLenum)(texunit), (C.GLenum)(target), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params)))
+}
+func MultiTexParameterIuivEXT(texunit uint32, target uint32, pname uint32, params *uint32) {
+ C.glowMultiTexParameterIuivEXT(gpMultiTexParameterIuivEXT, (C.GLenum)(texunit), (C.GLenum)(target), (C.GLenum)(pname), (*C.GLuint)(unsafe.Pointer(params)))
+}
+func MultiTexParameterfEXT(texunit uint32, target uint32, pname uint32, param float32) {
+ C.glowMultiTexParameterfEXT(gpMultiTexParameterfEXT, (C.GLenum)(texunit), (C.GLenum)(target), (C.GLenum)(pname), (C.GLfloat)(param))
+}
+func MultiTexParameterfvEXT(texunit uint32, target uint32, pname uint32, params *float32) {
+ C.glowMultiTexParameterfvEXT(gpMultiTexParameterfvEXT, (C.GLenum)(texunit), (C.GLenum)(target), (C.GLenum)(pname), (*C.GLfloat)(unsafe.Pointer(params)))
+}
+func MultiTexParameteriEXT(texunit uint32, target uint32, pname uint32, param int32) {
+ C.glowMultiTexParameteriEXT(gpMultiTexParameteriEXT, (C.GLenum)(texunit), (C.GLenum)(target), (C.GLenum)(pname), (C.GLint)(param))
+}
+func MultiTexParameterivEXT(texunit uint32, target uint32, pname uint32, params *int32) {
+ C.glowMultiTexParameterivEXT(gpMultiTexParameterivEXT, (C.GLenum)(texunit), (C.GLenum)(target), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params)))
+}
+func MultiTexRenderbufferEXT(texunit uint32, target uint32, renderbuffer uint32) {
+ C.glowMultiTexRenderbufferEXT(gpMultiTexRenderbufferEXT, (C.GLenum)(texunit), (C.GLenum)(target), (C.GLuint)(renderbuffer))
+}
+func MultiTexSubImage1DEXT(texunit uint32, target uint32, level int32, xoffset int32, width int32, format uint32, xtype uint32, pixels unsafe.Pointer) {
+ C.glowMultiTexSubImage1DEXT(gpMultiTexSubImage1DEXT, (C.GLenum)(texunit), (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLsizei)(width), (C.GLenum)(format), (C.GLenum)(xtype), pixels)
+}
+func MultiTexSubImage2DEXT(texunit uint32, target uint32, level int32, xoffset int32, yoffset int32, width int32, height int32, format uint32, xtype uint32, pixels unsafe.Pointer) {
+ C.glowMultiTexSubImage2DEXT(gpMultiTexSubImage2DEXT, (C.GLenum)(texunit), (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLenum)(format), (C.GLenum)(xtype), pixels)
+}
+func MultiTexSubImage3DEXT(texunit uint32, target uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, format uint32, xtype uint32, pixels unsafe.Pointer) {
+ C.glowMultiTexSubImage3DEXT(gpMultiTexSubImage3DEXT, (C.GLenum)(texunit), (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLenum)(format), (C.GLenum)(xtype), pixels)
+}
+func NamedBufferAttachMemoryNV(buffer uint32, memory uint32, offset uint64) {
+ C.glowNamedBufferAttachMemoryNV(gpNamedBufferAttachMemoryNV, (C.GLuint)(buffer), (C.GLuint)(memory), (C.GLuint64)(offset))
+}
+
+// creates and initializes a buffer object's data store
+func NamedBufferData(buffer uint32, size int, data unsafe.Pointer, usage uint32) {
+ C.glowNamedBufferData(gpNamedBufferData, (C.GLuint)(buffer), (C.GLsizeiptr)(size), data, (C.GLenum)(usage))
+}
+func NamedBufferDataEXT(buffer uint32, size int, data unsafe.Pointer, usage uint32) {
+ C.glowNamedBufferDataEXT(gpNamedBufferDataEXT, (C.GLuint)(buffer), (C.GLsizeiptr)(size), data, (C.GLenum)(usage))
+}
+func NamedBufferPageCommitmentARB(buffer uint32, offset int, size int, commit bool) {
+ C.glowNamedBufferPageCommitmentARB(gpNamedBufferPageCommitmentARB, (C.GLuint)(buffer), (C.GLintptr)(offset), (C.GLsizeiptr)(size), (C.GLboolean)(boolToInt(commit)))
+}
+func NamedBufferPageCommitmentEXT(buffer uint32, offset int, size int, commit bool) {
+ C.glowNamedBufferPageCommitmentEXT(gpNamedBufferPageCommitmentEXT, (C.GLuint)(buffer), (C.GLintptr)(offset), (C.GLsizeiptr)(size), (C.GLboolean)(boolToInt(commit)))
+}
+func NamedBufferPageCommitmentMemNV(buffer uint32, offset int, size int, memory uint32, memOffset uint64, commit bool) {
+ C.glowNamedBufferPageCommitmentMemNV(gpNamedBufferPageCommitmentMemNV, (C.GLuint)(buffer), (C.GLintptr)(offset), (C.GLsizeiptr)(size), (C.GLuint)(memory), (C.GLuint64)(memOffset), (C.GLboolean)(boolToInt(commit)))
+}
+
+// creates and initializes a buffer object's immutable data store
+func NamedBufferStorage(buffer uint32, size int, data unsafe.Pointer, flags uint32) {
+ C.glowNamedBufferStorage(gpNamedBufferStorage, (C.GLuint)(buffer), (C.GLsizeiptr)(size), data, (C.GLbitfield)(flags))
+}
+func NamedBufferStorageEXT(buffer uint32, size int, data unsafe.Pointer, flags uint32) {
+ C.glowNamedBufferStorageEXT(gpNamedBufferStorageEXT, (C.GLuint)(buffer), (C.GLsizeiptr)(size), data, (C.GLbitfield)(flags))
+}
+
+// updates a subset of a buffer object's data store
+func NamedBufferSubData(buffer uint32, offset int, size int, data unsafe.Pointer) {
+ C.glowNamedBufferSubData(gpNamedBufferSubData, (C.GLuint)(buffer), (C.GLintptr)(offset), (C.GLsizeiptr)(size), data)
+}
+func NamedBufferSubDataEXT(buffer uint32, offset int, size int, data unsafe.Pointer) {
+ C.glowNamedBufferSubDataEXT(gpNamedBufferSubDataEXT, (C.GLuint)(buffer), (C.GLintptr)(offset), (C.GLsizeiptr)(size), data)
+}
+func NamedCopyBufferSubDataEXT(readBuffer uint32, writeBuffer uint32, readOffset int, writeOffset int, size int) {
+ C.glowNamedCopyBufferSubDataEXT(gpNamedCopyBufferSubDataEXT, (C.GLuint)(readBuffer), (C.GLuint)(writeBuffer), (C.GLintptr)(readOffset), (C.GLintptr)(writeOffset), (C.GLsizeiptr)(size))
+}
+
+// specify which color buffers are to be drawn into
+func NamedFramebufferDrawBuffer(framebuffer uint32, buf uint32) {
+ C.glowNamedFramebufferDrawBuffer(gpNamedFramebufferDrawBuffer, (C.GLuint)(framebuffer), (C.GLenum)(buf))
+}
+
+// Specifies a list of color buffers to be drawn into
+func NamedFramebufferDrawBuffers(framebuffer uint32, n int32, bufs *uint32) {
+ C.glowNamedFramebufferDrawBuffers(gpNamedFramebufferDrawBuffers, (C.GLuint)(framebuffer), (C.GLsizei)(n), (*C.GLenum)(unsafe.Pointer(bufs)))
+}
+
+// set a named parameter of a framebuffer object
+func NamedFramebufferParameteri(framebuffer uint32, pname uint32, param int32) {
+ C.glowNamedFramebufferParameteri(gpNamedFramebufferParameteri, (C.GLuint)(framebuffer), (C.GLenum)(pname), (C.GLint)(param))
+}
+func NamedFramebufferParameteriEXT(framebuffer uint32, pname uint32, param int32) {
+ C.glowNamedFramebufferParameteriEXT(gpNamedFramebufferParameteriEXT, (C.GLuint)(framebuffer), (C.GLenum)(pname), (C.GLint)(param))
+}
+
+// select a color buffer source for pixels
+func NamedFramebufferReadBuffer(framebuffer uint32, src uint32) {
+ C.glowNamedFramebufferReadBuffer(gpNamedFramebufferReadBuffer, (C.GLuint)(framebuffer), (C.GLenum)(src))
+}
+
+// attach a renderbuffer as a logical buffer of a framebuffer object
+func NamedFramebufferRenderbuffer(framebuffer uint32, attachment uint32, renderbuffertarget uint32, renderbuffer uint32) {
+ C.glowNamedFramebufferRenderbuffer(gpNamedFramebufferRenderbuffer, (C.GLuint)(framebuffer), (C.GLenum)(attachment), (C.GLenum)(renderbuffertarget), (C.GLuint)(renderbuffer))
+}
+func NamedFramebufferRenderbufferEXT(framebuffer uint32, attachment uint32, renderbuffertarget uint32, renderbuffer uint32) {
+ C.glowNamedFramebufferRenderbufferEXT(gpNamedFramebufferRenderbufferEXT, (C.GLuint)(framebuffer), (C.GLenum)(attachment), (C.GLenum)(renderbuffertarget), (C.GLuint)(renderbuffer))
+}
+func NamedFramebufferSampleLocationsfvARB(framebuffer uint32, start uint32, count int32, v *float32) {
+ C.glowNamedFramebufferSampleLocationsfvARB(gpNamedFramebufferSampleLocationsfvARB, (C.GLuint)(framebuffer), (C.GLuint)(start), (C.GLsizei)(count), (*C.GLfloat)(unsafe.Pointer(v)))
+}
+func NamedFramebufferSampleLocationsfvNV(framebuffer uint32, start uint32, count int32, v *float32) {
+ C.glowNamedFramebufferSampleLocationsfvNV(gpNamedFramebufferSampleLocationsfvNV, (C.GLuint)(framebuffer), (C.GLuint)(start), (C.GLsizei)(count), (*C.GLfloat)(unsafe.Pointer(v)))
+}
+func NamedFramebufferTexture(framebuffer uint32, attachment uint32, texture uint32, level int32) {
+ C.glowNamedFramebufferTexture(gpNamedFramebufferTexture, (C.GLuint)(framebuffer), (C.GLenum)(attachment), (C.GLuint)(texture), (C.GLint)(level))
+}
+func NamedFramebufferTexture1DEXT(framebuffer uint32, attachment uint32, textarget uint32, texture uint32, level int32) {
+ C.glowNamedFramebufferTexture1DEXT(gpNamedFramebufferTexture1DEXT, (C.GLuint)(framebuffer), (C.GLenum)(attachment), (C.GLenum)(textarget), (C.GLuint)(texture), (C.GLint)(level))
+}
+func NamedFramebufferTexture2DEXT(framebuffer uint32, attachment uint32, textarget uint32, texture uint32, level int32) {
+ C.glowNamedFramebufferTexture2DEXT(gpNamedFramebufferTexture2DEXT, (C.GLuint)(framebuffer), (C.GLenum)(attachment), (C.GLenum)(textarget), (C.GLuint)(texture), (C.GLint)(level))
+}
+func NamedFramebufferTexture3DEXT(framebuffer uint32, attachment uint32, textarget uint32, texture uint32, level int32, zoffset int32) {
+ C.glowNamedFramebufferTexture3DEXT(gpNamedFramebufferTexture3DEXT, (C.GLuint)(framebuffer), (C.GLenum)(attachment), (C.GLenum)(textarget), (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(zoffset))
+}
+func NamedFramebufferTextureEXT(framebuffer uint32, attachment uint32, texture uint32, level int32) {
+ C.glowNamedFramebufferTextureEXT(gpNamedFramebufferTextureEXT, (C.GLuint)(framebuffer), (C.GLenum)(attachment), (C.GLuint)(texture), (C.GLint)(level))
+}
+func NamedFramebufferTextureFaceEXT(framebuffer uint32, attachment uint32, texture uint32, level int32, face uint32) {
+ C.glowNamedFramebufferTextureFaceEXT(gpNamedFramebufferTextureFaceEXT, (C.GLuint)(framebuffer), (C.GLenum)(attachment), (C.GLuint)(texture), (C.GLint)(level), (C.GLenum)(face))
+}
+
+// attach a single layer of a texture object as a logical buffer of a framebuffer object
+func NamedFramebufferTextureLayer(framebuffer uint32, attachment uint32, texture uint32, level int32, layer int32) {
+ C.glowNamedFramebufferTextureLayer(gpNamedFramebufferTextureLayer, (C.GLuint)(framebuffer), (C.GLenum)(attachment), (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(layer))
+}
+func NamedFramebufferTextureLayerEXT(framebuffer uint32, attachment uint32, texture uint32, level int32, layer int32) {
+ C.glowNamedFramebufferTextureLayerEXT(gpNamedFramebufferTextureLayerEXT, (C.GLuint)(framebuffer), (C.GLenum)(attachment), (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(layer))
+}
+func NamedProgramLocalParameter4dEXT(program uint32, target uint32, index uint32, x float64, y float64, z float64, w float64) {
+ C.glowNamedProgramLocalParameter4dEXT(gpNamedProgramLocalParameter4dEXT, (C.GLuint)(program), (C.GLenum)(target), (C.GLuint)(index), (C.GLdouble)(x), (C.GLdouble)(y), (C.GLdouble)(z), (C.GLdouble)(w))
+}
+func NamedProgramLocalParameter4dvEXT(program uint32, target uint32, index uint32, params *float64) {
+ C.glowNamedProgramLocalParameter4dvEXT(gpNamedProgramLocalParameter4dvEXT, (C.GLuint)(program), (C.GLenum)(target), (C.GLuint)(index), (*C.GLdouble)(unsafe.Pointer(params)))
+}
+func NamedProgramLocalParameter4fEXT(program uint32, target uint32, index uint32, x float32, y float32, z float32, w float32) {
+ C.glowNamedProgramLocalParameter4fEXT(gpNamedProgramLocalParameter4fEXT, (C.GLuint)(program), (C.GLenum)(target), (C.GLuint)(index), (C.GLfloat)(x), (C.GLfloat)(y), (C.GLfloat)(z), (C.GLfloat)(w))
+}
+func NamedProgramLocalParameter4fvEXT(program uint32, target uint32, index uint32, params *float32) {
+ C.glowNamedProgramLocalParameter4fvEXT(gpNamedProgramLocalParameter4fvEXT, (C.GLuint)(program), (C.GLenum)(target), (C.GLuint)(index), (*C.GLfloat)(unsafe.Pointer(params)))
+}
+func NamedProgramLocalParameterI4iEXT(program uint32, target uint32, index uint32, x int32, y int32, z int32, w int32) {
+ C.glowNamedProgramLocalParameterI4iEXT(gpNamedProgramLocalParameterI4iEXT, (C.GLuint)(program), (C.GLenum)(target), (C.GLuint)(index), (C.GLint)(x), (C.GLint)(y), (C.GLint)(z), (C.GLint)(w))
+}
+func NamedProgramLocalParameterI4ivEXT(program uint32, target uint32, index uint32, params *int32) {
+ C.glowNamedProgramLocalParameterI4ivEXT(gpNamedProgramLocalParameterI4ivEXT, (C.GLuint)(program), (C.GLenum)(target), (C.GLuint)(index), (*C.GLint)(unsafe.Pointer(params)))
+}
+func NamedProgramLocalParameterI4uiEXT(program uint32, target uint32, index uint32, x uint32, y uint32, z uint32, w uint32) {
+ C.glowNamedProgramLocalParameterI4uiEXT(gpNamedProgramLocalParameterI4uiEXT, (C.GLuint)(program), (C.GLenum)(target), (C.GLuint)(index), (C.GLuint)(x), (C.GLuint)(y), (C.GLuint)(z), (C.GLuint)(w))
+}
+func NamedProgramLocalParameterI4uivEXT(program uint32, target uint32, index uint32, params *uint32) {
+ C.glowNamedProgramLocalParameterI4uivEXT(gpNamedProgramLocalParameterI4uivEXT, (C.GLuint)(program), (C.GLenum)(target), (C.GLuint)(index), (*C.GLuint)(unsafe.Pointer(params)))
+}
+func NamedProgramLocalParameters4fvEXT(program uint32, target uint32, index uint32, count int32, params *float32) {
+ C.glowNamedProgramLocalParameters4fvEXT(gpNamedProgramLocalParameters4fvEXT, (C.GLuint)(program), (C.GLenum)(target), (C.GLuint)(index), (C.GLsizei)(count), (*C.GLfloat)(unsafe.Pointer(params)))
+}
+func NamedProgramLocalParametersI4ivEXT(program uint32, target uint32, index uint32, count int32, params *int32) {
+ C.glowNamedProgramLocalParametersI4ivEXT(gpNamedProgramLocalParametersI4ivEXT, (C.GLuint)(program), (C.GLenum)(target), (C.GLuint)(index), (C.GLsizei)(count), (*C.GLint)(unsafe.Pointer(params)))
+}
+func NamedProgramLocalParametersI4uivEXT(program uint32, target uint32, index uint32, count int32, params *uint32) {
+ C.glowNamedProgramLocalParametersI4uivEXT(gpNamedProgramLocalParametersI4uivEXT, (C.GLuint)(program), (C.GLenum)(target), (C.GLuint)(index), (C.GLsizei)(count), (*C.GLuint)(unsafe.Pointer(params)))
+}
+func NamedProgramStringEXT(program uint32, target uint32, format uint32, len int32, xstring unsafe.Pointer) {
+ C.glowNamedProgramStringEXT(gpNamedProgramStringEXT, (C.GLuint)(program), (C.GLenum)(target), (C.GLenum)(format), (C.GLsizei)(len), xstring)
+}
+
+// establish data storage, format and dimensions of a renderbuffer object's image
+func NamedRenderbufferStorage(renderbuffer uint32, internalformat uint32, width int32, height int32) {
+ C.glowNamedRenderbufferStorage(gpNamedRenderbufferStorage, (C.GLuint)(renderbuffer), (C.GLenum)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height))
+}
+func NamedRenderbufferStorageEXT(renderbuffer uint32, internalformat uint32, width int32, height int32) {
+ C.glowNamedRenderbufferStorageEXT(gpNamedRenderbufferStorageEXT, (C.GLuint)(renderbuffer), (C.GLenum)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height))
+}
+
+// establish data storage, format, dimensions and sample count of a renderbuffer object's image
+func NamedRenderbufferStorageMultisample(renderbuffer uint32, samples int32, internalformat uint32, width int32, height int32) {
+ C.glowNamedRenderbufferStorageMultisample(gpNamedRenderbufferStorageMultisample, (C.GLuint)(renderbuffer), (C.GLsizei)(samples), (C.GLenum)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height))
+}
+func NamedRenderbufferStorageMultisampleAdvancedAMD(renderbuffer uint32, samples int32, storageSamples int32, internalformat uint32, width int32, height int32) {
+ C.glowNamedRenderbufferStorageMultisampleAdvancedAMD(gpNamedRenderbufferStorageMultisampleAdvancedAMD, (C.GLuint)(renderbuffer), (C.GLsizei)(samples), (C.GLsizei)(storageSamples), (C.GLenum)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height))
+}
+func NamedRenderbufferStorageMultisampleCoverageEXT(renderbuffer uint32, coverageSamples int32, colorSamples int32, internalformat uint32, width int32, height int32) {
+ C.glowNamedRenderbufferStorageMultisampleCoverageEXT(gpNamedRenderbufferStorageMultisampleCoverageEXT, (C.GLuint)(renderbuffer), (C.GLsizei)(coverageSamples), (C.GLsizei)(colorSamples), (C.GLenum)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height))
+}
+func NamedRenderbufferStorageMultisampleEXT(renderbuffer uint32, samples int32, internalformat uint32, width int32, height int32) {
+ C.glowNamedRenderbufferStorageMultisampleEXT(gpNamedRenderbufferStorageMultisampleEXT, (C.GLuint)(renderbuffer), (C.GLsizei)(samples), (C.GLenum)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height))
+}
+func NamedStringARB(xtype uint32, namelen int32, name *uint8, stringlen int32, xstring *uint8) {
+ C.glowNamedStringARB(gpNamedStringARB, (C.GLenum)(xtype), (C.GLint)(namelen), (*C.GLchar)(unsafe.Pointer(name)), (C.GLint)(stringlen), (*C.GLchar)(unsafe.Pointer(xstring)))
+}
+func NormalFormatNV(xtype uint32, stride int32) {
+ C.glowNormalFormatNV(gpNormalFormatNV, (C.GLenum)(xtype), (C.GLsizei)(stride))
+}
+
+// label a named object identified within a namespace
+func ObjectLabel(identifier uint32, name uint32, length int32, label *uint8) {
+ C.glowObjectLabel(gpObjectLabel, (C.GLenum)(identifier), (C.GLuint)(name), (C.GLsizei)(length), (*C.GLchar)(unsafe.Pointer(label)))
+}
+func ObjectLabelKHR(identifier uint32, name uint32, length int32, label *uint8) {
+ C.glowObjectLabelKHR(gpObjectLabelKHR, (C.GLenum)(identifier), (C.GLuint)(name), (C.GLsizei)(length), (*C.GLchar)(unsafe.Pointer(label)))
+}
+
+// label a sync object identified by a pointer
+func ObjectPtrLabel(ptr unsafe.Pointer, length int32, label *uint8) {
+ C.glowObjectPtrLabel(gpObjectPtrLabel, ptr, (C.GLsizei)(length), (*C.GLchar)(unsafe.Pointer(label)))
+}
+func ObjectPtrLabelKHR(ptr unsafe.Pointer, length int32, label *uint8) {
+ C.glowObjectPtrLabelKHR(gpObjectPtrLabelKHR, ptr, (C.GLsizei)(length), (*C.GLchar)(unsafe.Pointer(label)))
+}
+func PatchParameterfv(pname uint32, values *float32) {
+ C.glowPatchParameterfv(gpPatchParameterfv, (C.GLenum)(pname), (*C.GLfloat)(unsafe.Pointer(values)))
+}
+
+// specifies the parameters for patch primitives
+func PatchParameteri(pname uint32, value int32) {
+ C.glowPatchParameteri(gpPatchParameteri, (C.GLenum)(pname), (C.GLint)(value))
+}
+func PathCommandsNV(path uint32, numCommands int32, commands *uint8, numCoords int32, coordType uint32, coords unsafe.Pointer) {
+ C.glowPathCommandsNV(gpPathCommandsNV, (C.GLuint)(path), (C.GLsizei)(numCommands), (*C.GLubyte)(unsafe.Pointer(commands)), (C.GLsizei)(numCoords), (C.GLenum)(coordType), coords)
+}
+func PathCoordsNV(path uint32, numCoords int32, coordType uint32, coords unsafe.Pointer) {
+ C.glowPathCoordsNV(gpPathCoordsNV, (C.GLuint)(path), (C.GLsizei)(numCoords), (C.GLenum)(coordType), coords)
+}
+func PathCoverDepthFuncNV(xfunc uint32) {
+ C.glowPathCoverDepthFuncNV(gpPathCoverDepthFuncNV, (C.GLenum)(xfunc))
+}
+func PathDashArrayNV(path uint32, dashCount int32, dashArray *float32) {
+ C.glowPathDashArrayNV(gpPathDashArrayNV, (C.GLuint)(path), (C.GLsizei)(dashCount), (*C.GLfloat)(unsafe.Pointer(dashArray)))
+}
+func PathGlyphIndexArrayNV(firstPathName uint32, fontTarget uint32, fontName unsafe.Pointer, fontStyle uint32, firstGlyphIndex uint32, numGlyphs int32, pathParameterTemplate uint32, emScale float32) uint32 {
+ ret := C.glowPathGlyphIndexArrayNV(gpPathGlyphIndexArrayNV, (C.GLuint)(firstPathName), (C.GLenum)(fontTarget), fontName, (C.GLbitfield)(fontStyle), (C.GLuint)(firstGlyphIndex), (C.GLsizei)(numGlyphs), (C.GLuint)(pathParameterTemplate), (C.GLfloat)(emScale))
+ return (uint32)(ret)
+}
+func PathGlyphIndexRangeNV(fontTarget uint32, fontName unsafe.Pointer, fontStyle uint32, pathParameterTemplate uint32, emScale float32, baseAndCount *uint32) uint32 {
+ ret := C.glowPathGlyphIndexRangeNV(gpPathGlyphIndexRangeNV, (C.GLenum)(fontTarget), fontName, (C.GLbitfield)(fontStyle), (C.GLuint)(pathParameterTemplate), (C.GLfloat)(emScale), (*C.GLuint)(unsafe.Pointer(baseAndCount)))
+ return (uint32)(ret)
+}
+func PathGlyphRangeNV(firstPathName uint32, fontTarget uint32, fontName unsafe.Pointer, fontStyle uint32, firstGlyph uint32, numGlyphs int32, handleMissingGlyphs uint32, pathParameterTemplate uint32, emScale float32) {
+ C.glowPathGlyphRangeNV(gpPathGlyphRangeNV, (C.GLuint)(firstPathName), (C.GLenum)(fontTarget), fontName, (C.GLbitfield)(fontStyle), (C.GLuint)(firstGlyph), (C.GLsizei)(numGlyphs), (C.GLenum)(handleMissingGlyphs), (C.GLuint)(pathParameterTemplate), (C.GLfloat)(emScale))
+}
+func PathGlyphsNV(firstPathName uint32, fontTarget uint32, fontName unsafe.Pointer, fontStyle uint32, numGlyphs int32, xtype uint32, charcodes unsafe.Pointer, handleMissingGlyphs uint32, pathParameterTemplate uint32, emScale float32) {
+ C.glowPathGlyphsNV(gpPathGlyphsNV, (C.GLuint)(firstPathName), (C.GLenum)(fontTarget), fontName, (C.GLbitfield)(fontStyle), (C.GLsizei)(numGlyphs), (C.GLenum)(xtype), charcodes, (C.GLenum)(handleMissingGlyphs), (C.GLuint)(pathParameterTemplate), (C.GLfloat)(emScale))
+}
+func PathMemoryGlyphIndexArrayNV(firstPathName uint32, fontTarget uint32, fontSize int, fontData unsafe.Pointer, faceIndex int32, firstGlyphIndex uint32, numGlyphs int32, pathParameterTemplate uint32, emScale float32) uint32 {
+ ret := C.glowPathMemoryGlyphIndexArrayNV(gpPathMemoryGlyphIndexArrayNV, (C.GLuint)(firstPathName), (C.GLenum)(fontTarget), (C.GLsizeiptr)(fontSize), fontData, (C.GLsizei)(faceIndex), (C.GLuint)(firstGlyphIndex), (C.GLsizei)(numGlyphs), (C.GLuint)(pathParameterTemplate), (C.GLfloat)(emScale))
+ return (uint32)(ret)
+}
+func PathParameterfNV(path uint32, pname uint32, value float32) {
+ C.glowPathParameterfNV(gpPathParameterfNV, (C.GLuint)(path), (C.GLenum)(pname), (C.GLfloat)(value))
+}
+func PathParameterfvNV(path uint32, pname uint32, value *float32) {
+ C.glowPathParameterfvNV(gpPathParameterfvNV, (C.GLuint)(path), (C.GLenum)(pname), (*C.GLfloat)(unsafe.Pointer(value)))
+}
+func PathParameteriNV(path uint32, pname uint32, value int32) {
+ C.glowPathParameteriNV(gpPathParameteriNV, (C.GLuint)(path), (C.GLenum)(pname), (C.GLint)(value))
+}
+func PathParameterivNV(path uint32, pname uint32, value *int32) {
+ C.glowPathParameterivNV(gpPathParameterivNV, (C.GLuint)(path), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(value)))
+}
+func PathStencilDepthOffsetNV(factor float32, units float32) {
+ C.glowPathStencilDepthOffsetNV(gpPathStencilDepthOffsetNV, (C.GLfloat)(factor), (C.GLfloat)(units))
+}
+func PathStencilFuncNV(xfunc uint32, ref int32, mask uint32) {
+ C.glowPathStencilFuncNV(gpPathStencilFuncNV, (C.GLenum)(xfunc), (C.GLint)(ref), (C.GLuint)(mask))
+}
+func PathStringNV(path uint32, format uint32, length int32, pathString unsafe.Pointer) {
+ C.glowPathStringNV(gpPathStringNV, (C.GLuint)(path), (C.GLenum)(format), (C.GLsizei)(length), pathString)
+}
+func PathSubCommandsNV(path uint32, commandStart int32, commandsToDelete int32, numCommands int32, commands *uint8, numCoords int32, coordType uint32, coords unsafe.Pointer) {
+ C.glowPathSubCommandsNV(gpPathSubCommandsNV, (C.GLuint)(path), (C.GLsizei)(commandStart), (C.GLsizei)(commandsToDelete), (C.GLsizei)(numCommands), (*C.GLubyte)(unsafe.Pointer(commands)), (C.GLsizei)(numCoords), (C.GLenum)(coordType), coords)
+}
+func PathSubCoordsNV(path uint32, coordStart int32, numCoords int32, coordType uint32, coords unsafe.Pointer) {
+ C.glowPathSubCoordsNV(gpPathSubCoordsNV, (C.GLuint)(path), (C.GLsizei)(coordStart), (C.GLsizei)(numCoords), (C.GLenum)(coordType), coords)
+}
+
+// pause transform feedback operations
+func PauseTransformFeedback() {
+ C.glowPauseTransformFeedback(gpPauseTransformFeedback)
+}
+func PixelStoref(pname uint32, param float32) {
+ C.glowPixelStoref(gpPixelStoref, (C.GLenum)(pname), (C.GLfloat)(param))
+}
+
+// set pixel storage modes
+func PixelStorei(pname uint32, param int32) {
+ C.glowPixelStorei(gpPixelStorei, (C.GLenum)(pname), (C.GLint)(param))
+}
+func PointAlongPathNV(path uint32, startSegment int32, numSegments int32, distance float32, x *float32, y *float32, tangentX *float32, tangentY *float32) bool {
+ ret := C.glowPointAlongPathNV(gpPointAlongPathNV, (C.GLuint)(path), (C.GLsizei)(startSegment), (C.GLsizei)(numSegments), (C.GLfloat)(distance), (*C.GLfloat)(unsafe.Pointer(x)), (*C.GLfloat)(unsafe.Pointer(y)), (*C.GLfloat)(unsafe.Pointer(tangentX)), (*C.GLfloat)(unsafe.Pointer(tangentY)))
+ return ret == TRUE
+}
+func PointParameterf(pname uint32, param float32) {
+ C.glowPointParameterf(gpPointParameterf, (C.GLenum)(pname), (C.GLfloat)(param))
+}
+func PointParameterfv(pname uint32, params *float32) {
+ C.glowPointParameterfv(gpPointParameterfv, (C.GLenum)(pname), (*C.GLfloat)(unsafe.Pointer(params)))
+}
+func PointParameteri(pname uint32, param int32) {
+ C.glowPointParameteri(gpPointParameteri, (C.GLenum)(pname), (C.GLint)(param))
+}
+func PointParameteriv(pname uint32, params *int32) {
+ C.glowPointParameteriv(gpPointParameteriv, (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params)))
+}
+
+// specify the diameter of rasterized points
+func PointSize(size float32) {
+ C.glowPointSize(gpPointSize, (C.GLfloat)(size))
+}
+
+// select a polygon rasterization mode
+func PolygonMode(face uint32, mode uint32) {
+ C.glowPolygonMode(gpPolygonMode, (C.GLenum)(face), (C.GLenum)(mode))
+}
+
+// set the scale and units used to calculate depth values
+func PolygonOffset(factor float32, units float32) {
+ C.glowPolygonOffset(gpPolygonOffset, (C.GLfloat)(factor), (C.GLfloat)(units))
+}
+func PolygonOffsetClamp(factor float32, units float32, clamp float32) {
+ C.glowPolygonOffsetClamp(gpPolygonOffsetClamp, (C.GLfloat)(factor), (C.GLfloat)(units), (C.GLfloat)(clamp))
+}
+func PolygonOffsetClampEXT(factor float32, units float32, clamp float32) {
+ C.glowPolygonOffsetClampEXT(gpPolygonOffsetClampEXT, (C.GLfloat)(factor), (C.GLfloat)(units), (C.GLfloat)(clamp))
+}
+
+// pop the active debug group
+func PopDebugGroup() {
+ C.glowPopDebugGroup(gpPopDebugGroup)
+}
+func PopDebugGroupKHR() {
+ C.glowPopDebugGroupKHR(gpPopDebugGroupKHR)
+}
+func PopGroupMarkerEXT() {
+ C.glowPopGroupMarkerEXT(gpPopGroupMarkerEXT)
+}
+func PrimitiveBoundingBoxARB(minX float32, minY float32, minZ float32, minW float32, maxX float32, maxY float32, maxZ float32, maxW float32) {
+ C.glowPrimitiveBoundingBoxARB(gpPrimitiveBoundingBoxARB, (C.GLfloat)(minX), (C.GLfloat)(minY), (C.GLfloat)(minZ), (C.GLfloat)(minW), (C.GLfloat)(maxX), (C.GLfloat)(maxY), (C.GLfloat)(maxZ), (C.GLfloat)(maxW))
+}
+
+// specify the primitive restart index
+func PrimitiveRestartIndex(index uint32) {
+ C.glowPrimitiveRestartIndex(gpPrimitiveRestartIndex, (C.GLuint)(index))
+}
+
+// load a program object with a program binary
+func ProgramBinary(program uint32, binaryFormat uint32, binary unsafe.Pointer, length int32) {
+ C.glowProgramBinary(gpProgramBinary, (C.GLuint)(program), (C.GLenum)(binaryFormat), binary, (C.GLsizei)(length))
+}
+
+// specify a parameter for a program object
+func ProgramParameteri(program uint32, pname uint32, value int32) {
+ C.glowProgramParameteri(gpProgramParameteri, (C.GLuint)(program), (C.GLenum)(pname), (C.GLint)(value))
+}
+func ProgramParameteriARB(program uint32, pname uint32, value int32) {
+ C.glowProgramParameteriARB(gpProgramParameteriARB, (C.GLuint)(program), (C.GLenum)(pname), (C.GLint)(value))
+}
+func ProgramParameteriEXT(program uint32, pname uint32, value int32) {
+ C.glowProgramParameteriEXT(gpProgramParameteriEXT, (C.GLuint)(program), (C.GLenum)(pname), (C.GLint)(value))
+}
+func ProgramPathFragmentInputGenNV(program uint32, location int32, genMode uint32, components int32, coeffs *float32) {
+ C.glowProgramPathFragmentInputGenNV(gpProgramPathFragmentInputGenNV, (C.GLuint)(program), (C.GLint)(location), (C.GLenum)(genMode), (C.GLint)(components), (*C.GLfloat)(unsafe.Pointer(coeffs)))
+}
+func ProgramUniform1d(program uint32, location int32, v0 float64) {
+ C.glowProgramUniform1d(gpProgramUniform1d, (C.GLuint)(program), (C.GLint)(location), (C.GLdouble)(v0))
+}
+func ProgramUniform1dEXT(program uint32, location int32, x float64) {
+ C.glowProgramUniform1dEXT(gpProgramUniform1dEXT, (C.GLuint)(program), (C.GLint)(location), (C.GLdouble)(x))
+}
+func ProgramUniform1dv(program uint32, location int32, count int32, value *float64) {
+ C.glowProgramUniform1dv(gpProgramUniform1dv, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (*C.GLdouble)(unsafe.Pointer(value)))
+}
+func ProgramUniform1dvEXT(program uint32, location int32, count int32, value *float64) {
+ C.glowProgramUniform1dvEXT(gpProgramUniform1dvEXT, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (*C.GLdouble)(unsafe.Pointer(value)))
+}
+
+// Specify the value of a uniform variable for a specified program object
+func ProgramUniform1f(program uint32, location int32, v0 float32) {
+ C.glowProgramUniform1f(gpProgramUniform1f, (C.GLuint)(program), (C.GLint)(location), (C.GLfloat)(v0))
+}
+func ProgramUniform1fEXT(program uint32, location int32, v0 float32) {
+ C.glowProgramUniform1fEXT(gpProgramUniform1fEXT, (C.GLuint)(program), (C.GLint)(location), (C.GLfloat)(v0))
+}
+
+// Specify the value of a uniform variable for a specified program object
+func ProgramUniform1fv(program uint32, location int32, count int32, value *float32) {
+ C.glowProgramUniform1fv(gpProgramUniform1fv, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (*C.GLfloat)(unsafe.Pointer(value)))
+}
+func ProgramUniform1fvEXT(program uint32, location int32, count int32, value *float32) {
+ C.glowProgramUniform1fvEXT(gpProgramUniform1fvEXT, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (*C.GLfloat)(unsafe.Pointer(value)))
+}
+
+// Specify the value of a uniform variable for a specified program object
+func ProgramUniform1i(program uint32, location int32, v0 int32) {
+ C.glowProgramUniform1i(gpProgramUniform1i, (C.GLuint)(program), (C.GLint)(location), (C.GLint)(v0))
+}
+func ProgramUniform1i64ARB(program uint32, location int32, x int64) {
+ C.glowProgramUniform1i64ARB(gpProgramUniform1i64ARB, (C.GLuint)(program), (C.GLint)(location), (C.GLint64)(x))
+}
+func ProgramUniform1i64NV(program uint32, location int32, x int64) {
+ C.glowProgramUniform1i64NV(gpProgramUniform1i64NV, (C.GLuint)(program), (C.GLint)(location), (C.GLint64EXT)(x))
+}
+func ProgramUniform1i64vARB(program uint32, location int32, count int32, value *int64) {
+ C.glowProgramUniform1i64vARB(gpProgramUniform1i64vARB, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (*C.GLint64)(unsafe.Pointer(value)))
+}
+func ProgramUniform1i64vNV(program uint32, location int32, count int32, value *int64) {
+ C.glowProgramUniform1i64vNV(gpProgramUniform1i64vNV, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (*C.GLint64EXT)(unsafe.Pointer(value)))
+}
+func ProgramUniform1iEXT(program uint32, location int32, v0 int32) {
+ C.glowProgramUniform1iEXT(gpProgramUniform1iEXT, (C.GLuint)(program), (C.GLint)(location), (C.GLint)(v0))
+}
+
+// Specify the value of a uniform variable for a specified program object
+func ProgramUniform1iv(program uint32, location int32, count int32, value *int32) {
+ C.glowProgramUniform1iv(gpProgramUniform1iv, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (*C.GLint)(unsafe.Pointer(value)))
+}
+func ProgramUniform1ivEXT(program uint32, location int32, count int32, value *int32) {
+ C.glowProgramUniform1ivEXT(gpProgramUniform1ivEXT, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (*C.GLint)(unsafe.Pointer(value)))
+}
+
+// Specify the value of a uniform variable for a specified program object
+func ProgramUniform1ui(program uint32, location int32, v0 uint32) {
+ C.glowProgramUniform1ui(gpProgramUniform1ui, (C.GLuint)(program), (C.GLint)(location), (C.GLuint)(v0))
+}
+func ProgramUniform1ui64ARB(program uint32, location int32, x uint64) {
+ C.glowProgramUniform1ui64ARB(gpProgramUniform1ui64ARB, (C.GLuint)(program), (C.GLint)(location), (C.GLuint64)(x))
+}
+func ProgramUniform1ui64NV(program uint32, location int32, x uint64) {
+ C.glowProgramUniform1ui64NV(gpProgramUniform1ui64NV, (C.GLuint)(program), (C.GLint)(location), (C.GLuint64EXT)(x))
+}
+func ProgramUniform1ui64vARB(program uint32, location int32, count int32, value *uint64) {
+ C.glowProgramUniform1ui64vARB(gpProgramUniform1ui64vARB, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (*C.GLuint64)(unsafe.Pointer(value)))
+}
+func ProgramUniform1ui64vNV(program uint32, location int32, count int32, value *uint64) {
+ C.glowProgramUniform1ui64vNV(gpProgramUniform1ui64vNV, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (*C.GLuint64EXT)(unsafe.Pointer(value)))
+}
+func ProgramUniform1uiEXT(program uint32, location int32, v0 uint32) {
+ C.glowProgramUniform1uiEXT(gpProgramUniform1uiEXT, (C.GLuint)(program), (C.GLint)(location), (C.GLuint)(v0))
+}
+
+// Specify the value of a uniform variable for a specified program object
+func ProgramUniform1uiv(program uint32, location int32, count int32, value *uint32) {
+ C.glowProgramUniform1uiv(gpProgramUniform1uiv, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (*C.GLuint)(unsafe.Pointer(value)))
+}
+func ProgramUniform1uivEXT(program uint32, location int32, count int32, value *uint32) {
+ C.glowProgramUniform1uivEXT(gpProgramUniform1uivEXT, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (*C.GLuint)(unsafe.Pointer(value)))
+}
+func ProgramUniform2d(program uint32, location int32, v0 float64, v1 float64) {
+ C.glowProgramUniform2d(gpProgramUniform2d, (C.GLuint)(program), (C.GLint)(location), (C.GLdouble)(v0), (C.GLdouble)(v1))
+}
+func ProgramUniform2dEXT(program uint32, location int32, x float64, y float64) {
+ C.glowProgramUniform2dEXT(gpProgramUniform2dEXT, (C.GLuint)(program), (C.GLint)(location), (C.GLdouble)(x), (C.GLdouble)(y))
+}
+func ProgramUniform2dv(program uint32, location int32, count int32, value *float64) {
+ C.glowProgramUniform2dv(gpProgramUniform2dv, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (*C.GLdouble)(unsafe.Pointer(value)))
+}
+func ProgramUniform2dvEXT(program uint32, location int32, count int32, value *float64) {
+ C.glowProgramUniform2dvEXT(gpProgramUniform2dvEXT, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (*C.GLdouble)(unsafe.Pointer(value)))
+}
+
+// Specify the value of a uniform variable for a specified program object
+func ProgramUniform2f(program uint32, location int32, v0 float32, v1 float32) {
+ C.glowProgramUniform2f(gpProgramUniform2f, (C.GLuint)(program), (C.GLint)(location), (C.GLfloat)(v0), (C.GLfloat)(v1))
+}
+func ProgramUniform2fEXT(program uint32, location int32, v0 float32, v1 float32) {
+ C.glowProgramUniform2fEXT(gpProgramUniform2fEXT, (C.GLuint)(program), (C.GLint)(location), (C.GLfloat)(v0), (C.GLfloat)(v1))
+}
+
+// Specify the value of a uniform variable for a specified program object
+func ProgramUniform2fv(program uint32, location int32, count int32, value *float32) {
+ C.glowProgramUniform2fv(gpProgramUniform2fv, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (*C.GLfloat)(unsafe.Pointer(value)))
+}
+func ProgramUniform2fvEXT(program uint32, location int32, count int32, value *float32) {
+ C.glowProgramUniform2fvEXT(gpProgramUniform2fvEXT, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (*C.GLfloat)(unsafe.Pointer(value)))
+}
+
+// Specify the value of a uniform variable for a specified program object
+func ProgramUniform2i(program uint32, location int32, v0 int32, v1 int32) {
+ C.glowProgramUniform2i(gpProgramUniform2i, (C.GLuint)(program), (C.GLint)(location), (C.GLint)(v0), (C.GLint)(v1))
+}
+func ProgramUniform2i64ARB(program uint32, location int32, x int64, y int64) {
+ C.glowProgramUniform2i64ARB(gpProgramUniform2i64ARB, (C.GLuint)(program), (C.GLint)(location), (C.GLint64)(x), (C.GLint64)(y))
+}
+func ProgramUniform2i64NV(program uint32, location int32, x int64, y int64) {
+ C.glowProgramUniform2i64NV(gpProgramUniform2i64NV, (C.GLuint)(program), (C.GLint)(location), (C.GLint64EXT)(x), (C.GLint64EXT)(y))
+}
+func ProgramUniform2i64vARB(program uint32, location int32, count int32, value *int64) {
+ C.glowProgramUniform2i64vARB(gpProgramUniform2i64vARB, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (*C.GLint64)(unsafe.Pointer(value)))
+}
+func ProgramUniform2i64vNV(program uint32, location int32, count int32, value *int64) {
+ C.glowProgramUniform2i64vNV(gpProgramUniform2i64vNV, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (*C.GLint64EXT)(unsafe.Pointer(value)))
+}
+func ProgramUniform2iEXT(program uint32, location int32, v0 int32, v1 int32) {
+ C.glowProgramUniform2iEXT(gpProgramUniform2iEXT, (C.GLuint)(program), (C.GLint)(location), (C.GLint)(v0), (C.GLint)(v1))
+}
+
+// Specify the value of a uniform variable for a specified program object
+func ProgramUniform2iv(program uint32, location int32, count int32, value *int32) {
+ C.glowProgramUniform2iv(gpProgramUniform2iv, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (*C.GLint)(unsafe.Pointer(value)))
+}
+func ProgramUniform2ivEXT(program uint32, location int32, count int32, value *int32) {
+ C.glowProgramUniform2ivEXT(gpProgramUniform2ivEXT, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (*C.GLint)(unsafe.Pointer(value)))
+}
+
+// Specify the value of a uniform variable for a specified program object
+func ProgramUniform2ui(program uint32, location int32, v0 uint32, v1 uint32) {
+ C.glowProgramUniform2ui(gpProgramUniform2ui, (C.GLuint)(program), (C.GLint)(location), (C.GLuint)(v0), (C.GLuint)(v1))
+}
+func ProgramUniform2ui64ARB(program uint32, location int32, x uint64, y uint64) {
+ C.glowProgramUniform2ui64ARB(gpProgramUniform2ui64ARB, (C.GLuint)(program), (C.GLint)(location), (C.GLuint64)(x), (C.GLuint64)(y))
+}
+func ProgramUniform2ui64NV(program uint32, location int32, x uint64, y uint64) {
+ C.glowProgramUniform2ui64NV(gpProgramUniform2ui64NV, (C.GLuint)(program), (C.GLint)(location), (C.GLuint64EXT)(x), (C.GLuint64EXT)(y))
+}
+func ProgramUniform2ui64vARB(program uint32, location int32, count int32, value *uint64) {
+ C.glowProgramUniform2ui64vARB(gpProgramUniform2ui64vARB, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (*C.GLuint64)(unsafe.Pointer(value)))
+}
+func ProgramUniform2ui64vNV(program uint32, location int32, count int32, value *uint64) {
+ C.glowProgramUniform2ui64vNV(gpProgramUniform2ui64vNV, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (*C.GLuint64EXT)(unsafe.Pointer(value)))
+}
+func ProgramUniform2uiEXT(program uint32, location int32, v0 uint32, v1 uint32) {
+ C.glowProgramUniform2uiEXT(gpProgramUniform2uiEXT, (C.GLuint)(program), (C.GLint)(location), (C.GLuint)(v0), (C.GLuint)(v1))
+}
+
+// Specify the value of a uniform variable for a specified program object
+func ProgramUniform2uiv(program uint32, location int32, count int32, value *uint32) {
+ C.glowProgramUniform2uiv(gpProgramUniform2uiv, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (*C.GLuint)(unsafe.Pointer(value)))
+}
+func ProgramUniform2uivEXT(program uint32, location int32, count int32, value *uint32) {
+ C.glowProgramUniform2uivEXT(gpProgramUniform2uivEXT, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (*C.GLuint)(unsafe.Pointer(value)))
+}
+func ProgramUniform3d(program uint32, location int32, v0 float64, v1 float64, v2 float64) {
+ C.glowProgramUniform3d(gpProgramUniform3d, (C.GLuint)(program), (C.GLint)(location), (C.GLdouble)(v0), (C.GLdouble)(v1), (C.GLdouble)(v2))
+}
+func ProgramUniform3dEXT(program uint32, location int32, x float64, y float64, z float64) {
+ C.glowProgramUniform3dEXT(gpProgramUniform3dEXT, (C.GLuint)(program), (C.GLint)(location), (C.GLdouble)(x), (C.GLdouble)(y), (C.GLdouble)(z))
+}
+func ProgramUniform3dv(program uint32, location int32, count int32, value *float64) {
+ C.glowProgramUniform3dv(gpProgramUniform3dv, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (*C.GLdouble)(unsafe.Pointer(value)))
+}
+func ProgramUniform3dvEXT(program uint32, location int32, count int32, value *float64) {
+ C.glowProgramUniform3dvEXT(gpProgramUniform3dvEXT, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (*C.GLdouble)(unsafe.Pointer(value)))
+}
+
+// Specify the value of a uniform variable for a specified program object
+func ProgramUniform3f(program uint32, location int32, v0 float32, v1 float32, v2 float32) {
+ C.glowProgramUniform3f(gpProgramUniform3f, (C.GLuint)(program), (C.GLint)(location), (C.GLfloat)(v0), (C.GLfloat)(v1), (C.GLfloat)(v2))
+}
+func ProgramUniform3fEXT(program uint32, location int32, v0 float32, v1 float32, v2 float32) {
+ C.glowProgramUniform3fEXT(gpProgramUniform3fEXT, (C.GLuint)(program), (C.GLint)(location), (C.GLfloat)(v0), (C.GLfloat)(v1), (C.GLfloat)(v2))
+}
+
+// Specify the value of a uniform variable for a specified program object
+func ProgramUniform3fv(program uint32, location int32, count int32, value *float32) {
+ C.glowProgramUniform3fv(gpProgramUniform3fv, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (*C.GLfloat)(unsafe.Pointer(value)))
+}
+func ProgramUniform3fvEXT(program uint32, location int32, count int32, value *float32) {
+ C.glowProgramUniform3fvEXT(gpProgramUniform3fvEXT, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (*C.GLfloat)(unsafe.Pointer(value)))
+}
+
+// Specify the value of a uniform variable for a specified program object
+func ProgramUniform3i(program uint32, location int32, v0 int32, v1 int32, v2 int32) {
+ C.glowProgramUniform3i(gpProgramUniform3i, (C.GLuint)(program), (C.GLint)(location), (C.GLint)(v0), (C.GLint)(v1), (C.GLint)(v2))
+}
+func ProgramUniform3i64ARB(program uint32, location int32, x int64, y int64, z int64) {
+ C.glowProgramUniform3i64ARB(gpProgramUniform3i64ARB, (C.GLuint)(program), (C.GLint)(location), (C.GLint64)(x), (C.GLint64)(y), (C.GLint64)(z))
+}
+func ProgramUniform3i64NV(program uint32, location int32, x int64, y int64, z int64) {
+ C.glowProgramUniform3i64NV(gpProgramUniform3i64NV, (C.GLuint)(program), (C.GLint)(location), (C.GLint64EXT)(x), (C.GLint64EXT)(y), (C.GLint64EXT)(z))
+}
+func ProgramUniform3i64vARB(program uint32, location int32, count int32, value *int64) {
+ C.glowProgramUniform3i64vARB(gpProgramUniform3i64vARB, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (*C.GLint64)(unsafe.Pointer(value)))
+}
+func ProgramUniform3i64vNV(program uint32, location int32, count int32, value *int64) {
+ C.glowProgramUniform3i64vNV(gpProgramUniform3i64vNV, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (*C.GLint64EXT)(unsafe.Pointer(value)))
+}
+func ProgramUniform3iEXT(program uint32, location int32, v0 int32, v1 int32, v2 int32) {
+ C.glowProgramUniform3iEXT(gpProgramUniform3iEXT, (C.GLuint)(program), (C.GLint)(location), (C.GLint)(v0), (C.GLint)(v1), (C.GLint)(v2))
+}
+
+// Specify the value of a uniform variable for a specified program object
+func ProgramUniform3iv(program uint32, location int32, count int32, value *int32) {
+ C.glowProgramUniform3iv(gpProgramUniform3iv, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (*C.GLint)(unsafe.Pointer(value)))
+}
+func ProgramUniform3ivEXT(program uint32, location int32, count int32, value *int32) {
+ C.glowProgramUniform3ivEXT(gpProgramUniform3ivEXT, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (*C.GLint)(unsafe.Pointer(value)))
+}
+
+// Specify the value of a uniform variable for a specified program object
+func ProgramUniform3ui(program uint32, location int32, v0 uint32, v1 uint32, v2 uint32) {
+ C.glowProgramUniform3ui(gpProgramUniform3ui, (C.GLuint)(program), (C.GLint)(location), (C.GLuint)(v0), (C.GLuint)(v1), (C.GLuint)(v2))
+}
+func ProgramUniform3ui64ARB(program uint32, location int32, x uint64, y uint64, z uint64) {
+ C.glowProgramUniform3ui64ARB(gpProgramUniform3ui64ARB, (C.GLuint)(program), (C.GLint)(location), (C.GLuint64)(x), (C.GLuint64)(y), (C.GLuint64)(z))
+}
+func ProgramUniform3ui64NV(program uint32, location int32, x uint64, y uint64, z uint64) {
+ C.glowProgramUniform3ui64NV(gpProgramUniform3ui64NV, (C.GLuint)(program), (C.GLint)(location), (C.GLuint64EXT)(x), (C.GLuint64EXT)(y), (C.GLuint64EXT)(z))
+}
+func ProgramUniform3ui64vARB(program uint32, location int32, count int32, value *uint64) {
+ C.glowProgramUniform3ui64vARB(gpProgramUniform3ui64vARB, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (*C.GLuint64)(unsafe.Pointer(value)))
+}
+func ProgramUniform3ui64vNV(program uint32, location int32, count int32, value *uint64) {
+ C.glowProgramUniform3ui64vNV(gpProgramUniform3ui64vNV, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (*C.GLuint64EXT)(unsafe.Pointer(value)))
+}
+func ProgramUniform3uiEXT(program uint32, location int32, v0 uint32, v1 uint32, v2 uint32) {
+ C.glowProgramUniform3uiEXT(gpProgramUniform3uiEXT, (C.GLuint)(program), (C.GLint)(location), (C.GLuint)(v0), (C.GLuint)(v1), (C.GLuint)(v2))
+}
+
+// Specify the value of a uniform variable for a specified program object
+func ProgramUniform3uiv(program uint32, location int32, count int32, value *uint32) {
+ C.glowProgramUniform3uiv(gpProgramUniform3uiv, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (*C.GLuint)(unsafe.Pointer(value)))
+}
+func ProgramUniform3uivEXT(program uint32, location int32, count int32, value *uint32) {
+ C.glowProgramUniform3uivEXT(gpProgramUniform3uivEXT, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (*C.GLuint)(unsafe.Pointer(value)))
+}
+func ProgramUniform4d(program uint32, location int32, v0 float64, v1 float64, v2 float64, v3 float64) {
+ C.glowProgramUniform4d(gpProgramUniform4d, (C.GLuint)(program), (C.GLint)(location), (C.GLdouble)(v0), (C.GLdouble)(v1), (C.GLdouble)(v2), (C.GLdouble)(v3))
+}
+func ProgramUniform4dEXT(program uint32, location int32, x float64, y float64, z float64, w float64) {
+ C.glowProgramUniform4dEXT(gpProgramUniform4dEXT, (C.GLuint)(program), (C.GLint)(location), (C.GLdouble)(x), (C.GLdouble)(y), (C.GLdouble)(z), (C.GLdouble)(w))
+}
+func ProgramUniform4dv(program uint32, location int32, count int32, value *float64) {
+ C.glowProgramUniform4dv(gpProgramUniform4dv, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (*C.GLdouble)(unsafe.Pointer(value)))
+}
+func ProgramUniform4dvEXT(program uint32, location int32, count int32, value *float64) {
+ C.glowProgramUniform4dvEXT(gpProgramUniform4dvEXT, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (*C.GLdouble)(unsafe.Pointer(value)))
+}
+
+// Specify the value of a uniform variable for a specified program object
+func ProgramUniform4f(program uint32, location int32, v0 float32, v1 float32, v2 float32, v3 float32) {
+ C.glowProgramUniform4f(gpProgramUniform4f, (C.GLuint)(program), (C.GLint)(location), (C.GLfloat)(v0), (C.GLfloat)(v1), (C.GLfloat)(v2), (C.GLfloat)(v3))
+}
+func ProgramUniform4fEXT(program uint32, location int32, v0 float32, v1 float32, v2 float32, v3 float32) {
+ C.glowProgramUniform4fEXT(gpProgramUniform4fEXT, (C.GLuint)(program), (C.GLint)(location), (C.GLfloat)(v0), (C.GLfloat)(v1), (C.GLfloat)(v2), (C.GLfloat)(v3))
+}
+
+// Specify the value of a uniform variable for a specified program object
+func ProgramUniform4fv(program uint32, location int32, count int32, value *float32) {
+ C.glowProgramUniform4fv(gpProgramUniform4fv, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (*C.GLfloat)(unsafe.Pointer(value)))
+}
+func ProgramUniform4fvEXT(program uint32, location int32, count int32, value *float32) {
+ C.glowProgramUniform4fvEXT(gpProgramUniform4fvEXT, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (*C.GLfloat)(unsafe.Pointer(value)))
+}
+
+// Specify the value of a uniform variable for a specified program object
+func ProgramUniform4i(program uint32, location int32, v0 int32, v1 int32, v2 int32, v3 int32) {
+ C.glowProgramUniform4i(gpProgramUniform4i, (C.GLuint)(program), (C.GLint)(location), (C.GLint)(v0), (C.GLint)(v1), (C.GLint)(v2), (C.GLint)(v3))
+}
+func ProgramUniform4i64ARB(program uint32, location int32, x int64, y int64, z int64, w int64) {
+ C.glowProgramUniform4i64ARB(gpProgramUniform4i64ARB, (C.GLuint)(program), (C.GLint)(location), (C.GLint64)(x), (C.GLint64)(y), (C.GLint64)(z), (C.GLint64)(w))
+}
+func ProgramUniform4i64NV(program uint32, location int32, x int64, y int64, z int64, w int64) {
+ C.glowProgramUniform4i64NV(gpProgramUniform4i64NV, (C.GLuint)(program), (C.GLint)(location), (C.GLint64EXT)(x), (C.GLint64EXT)(y), (C.GLint64EXT)(z), (C.GLint64EXT)(w))
+}
+func ProgramUniform4i64vARB(program uint32, location int32, count int32, value *int64) {
+ C.glowProgramUniform4i64vARB(gpProgramUniform4i64vARB, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (*C.GLint64)(unsafe.Pointer(value)))
+}
+func ProgramUniform4i64vNV(program uint32, location int32, count int32, value *int64) {
+ C.glowProgramUniform4i64vNV(gpProgramUniform4i64vNV, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (*C.GLint64EXT)(unsafe.Pointer(value)))
+}
+func ProgramUniform4iEXT(program uint32, location int32, v0 int32, v1 int32, v2 int32, v3 int32) {
+ C.glowProgramUniform4iEXT(gpProgramUniform4iEXT, (C.GLuint)(program), (C.GLint)(location), (C.GLint)(v0), (C.GLint)(v1), (C.GLint)(v2), (C.GLint)(v3))
+}
+
+// Specify the value of a uniform variable for a specified program object
+func ProgramUniform4iv(program uint32, location int32, count int32, value *int32) {
+ C.glowProgramUniform4iv(gpProgramUniform4iv, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (*C.GLint)(unsafe.Pointer(value)))
+}
+func ProgramUniform4ivEXT(program uint32, location int32, count int32, value *int32) {
+ C.glowProgramUniform4ivEXT(gpProgramUniform4ivEXT, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (*C.GLint)(unsafe.Pointer(value)))
+}
+
+// Specify the value of a uniform variable for a specified program object
+func ProgramUniform4ui(program uint32, location int32, v0 uint32, v1 uint32, v2 uint32, v3 uint32) {
+ C.glowProgramUniform4ui(gpProgramUniform4ui, (C.GLuint)(program), (C.GLint)(location), (C.GLuint)(v0), (C.GLuint)(v1), (C.GLuint)(v2), (C.GLuint)(v3))
+}
+func ProgramUniform4ui64ARB(program uint32, location int32, x uint64, y uint64, z uint64, w uint64) {
+ C.glowProgramUniform4ui64ARB(gpProgramUniform4ui64ARB, (C.GLuint)(program), (C.GLint)(location), (C.GLuint64)(x), (C.GLuint64)(y), (C.GLuint64)(z), (C.GLuint64)(w))
+}
+func ProgramUniform4ui64NV(program uint32, location int32, x uint64, y uint64, z uint64, w uint64) {
+ C.glowProgramUniform4ui64NV(gpProgramUniform4ui64NV, (C.GLuint)(program), (C.GLint)(location), (C.GLuint64EXT)(x), (C.GLuint64EXT)(y), (C.GLuint64EXT)(z), (C.GLuint64EXT)(w))
+}
+func ProgramUniform4ui64vARB(program uint32, location int32, count int32, value *uint64) {
+ C.glowProgramUniform4ui64vARB(gpProgramUniform4ui64vARB, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (*C.GLuint64)(unsafe.Pointer(value)))
+}
+func ProgramUniform4ui64vNV(program uint32, location int32, count int32, value *uint64) {
+ C.glowProgramUniform4ui64vNV(gpProgramUniform4ui64vNV, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (*C.GLuint64EXT)(unsafe.Pointer(value)))
+}
+func ProgramUniform4uiEXT(program uint32, location int32, v0 uint32, v1 uint32, v2 uint32, v3 uint32) {
+ C.glowProgramUniform4uiEXT(gpProgramUniform4uiEXT, (C.GLuint)(program), (C.GLint)(location), (C.GLuint)(v0), (C.GLuint)(v1), (C.GLuint)(v2), (C.GLuint)(v3))
+}
+
+// Specify the value of a uniform variable for a specified program object
+func ProgramUniform4uiv(program uint32, location int32, count int32, value *uint32) {
+ C.glowProgramUniform4uiv(gpProgramUniform4uiv, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (*C.GLuint)(unsafe.Pointer(value)))
+}
+func ProgramUniform4uivEXT(program uint32, location int32, count int32, value *uint32) {
+ C.glowProgramUniform4uivEXT(gpProgramUniform4uivEXT, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (*C.GLuint)(unsafe.Pointer(value)))
+}
+func ProgramUniformHandleui64ARB(program uint32, location int32, value uint64) {
+ C.glowProgramUniformHandleui64ARB(gpProgramUniformHandleui64ARB, (C.GLuint)(program), (C.GLint)(location), (C.GLuint64)(value))
+}
+func ProgramUniformHandleui64NV(program uint32, location int32, value uint64) {
+ C.glowProgramUniformHandleui64NV(gpProgramUniformHandleui64NV, (C.GLuint)(program), (C.GLint)(location), (C.GLuint64)(value))
+}
+func ProgramUniformHandleui64vARB(program uint32, location int32, count int32, values *uint64) {
+ C.glowProgramUniformHandleui64vARB(gpProgramUniformHandleui64vARB, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (*C.GLuint64)(unsafe.Pointer(values)))
+}
+func ProgramUniformHandleui64vNV(program uint32, location int32, count int32, values *uint64) {
+ C.glowProgramUniformHandleui64vNV(gpProgramUniformHandleui64vNV, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (*C.GLuint64)(unsafe.Pointer(values)))
+}
+func ProgramUniformMatrix2dv(program uint32, location int32, count int32, transpose bool, value *float64) {
+ C.glowProgramUniformMatrix2dv(gpProgramUniformMatrix2dv, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLdouble)(unsafe.Pointer(value)))
+}
+func ProgramUniformMatrix2dvEXT(program uint32, location int32, count int32, transpose bool, value *float64) {
+ C.glowProgramUniformMatrix2dvEXT(gpProgramUniformMatrix2dvEXT, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLdouble)(unsafe.Pointer(value)))
+}
+
+// Specify the value of a uniform variable for a specified program object
+func ProgramUniformMatrix2fv(program uint32, location int32, count int32, transpose bool, value *float32) {
+ C.glowProgramUniformMatrix2fv(gpProgramUniformMatrix2fv, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLfloat)(unsafe.Pointer(value)))
+}
+func ProgramUniformMatrix2fvEXT(program uint32, location int32, count int32, transpose bool, value *float32) {
+ C.glowProgramUniformMatrix2fvEXT(gpProgramUniformMatrix2fvEXT, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLfloat)(unsafe.Pointer(value)))
+}
+func ProgramUniformMatrix2x3dv(program uint32, location int32, count int32, transpose bool, value *float64) {
+ C.glowProgramUniformMatrix2x3dv(gpProgramUniformMatrix2x3dv, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLdouble)(unsafe.Pointer(value)))
+}
+func ProgramUniformMatrix2x3dvEXT(program uint32, location int32, count int32, transpose bool, value *float64) {
+ C.glowProgramUniformMatrix2x3dvEXT(gpProgramUniformMatrix2x3dvEXT, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLdouble)(unsafe.Pointer(value)))
+}
+
+// Specify the value of a uniform variable for a specified program object
+func ProgramUniformMatrix2x3fv(program uint32, location int32, count int32, transpose bool, value *float32) {
+ C.glowProgramUniformMatrix2x3fv(gpProgramUniformMatrix2x3fv, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLfloat)(unsafe.Pointer(value)))
+}
+func ProgramUniformMatrix2x3fvEXT(program uint32, location int32, count int32, transpose bool, value *float32) {
+ C.glowProgramUniformMatrix2x3fvEXT(gpProgramUniformMatrix2x3fvEXT, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLfloat)(unsafe.Pointer(value)))
+}
+func ProgramUniformMatrix2x4dv(program uint32, location int32, count int32, transpose bool, value *float64) {
+ C.glowProgramUniformMatrix2x4dv(gpProgramUniformMatrix2x4dv, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLdouble)(unsafe.Pointer(value)))
+}
+func ProgramUniformMatrix2x4dvEXT(program uint32, location int32, count int32, transpose bool, value *float64) {
+ C.glowProgramUniformMatrix2x4dvEXT(gpProgramUniformMatrix2x4dvEXT, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLdouble)(unsafe.Pointer(value)))
+}
+
+// Specify the value of a uniform variable for a specified program object
+func ProgramUniformMatrix2x4fv(program uint32, location int32, count int32, transpose bool, value *float32) {
+ C.glowProgramUniformMatrix2x4fv(gpProgramUniformMatrix2x4fv, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLfloat)(unsafe.Pointer(value)))
+}
+func ProgramUniformMatrix2x4fvEXT(program uint32, location int32, count int32, transpose bool, value *float32) {
+ C.glowProgramUniformMatrix2x4fvEXT(gpProgramUniformMatrix2x4fvEXT, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLfloat)(unsafe.Pointer(value)))
+}
+func ProgramUniformMatrix3dv(program uint32, location int32, count int32, transpose bool, value *float64) {
+ C.glowProgramUniformMatrix3dv(gpProgramUniformMatrix3dv, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLdouble)(unsafe.Pointer(value)))
+}
+func ProgramUniformMatrix3dvEXT(program uint32, location int32, count int32, transpose bool, value *float64) {
+ C.glowProgramUniformMatrix3dvEXT(gpProgramUniformMatrix3dvEXT, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLdouble)(unsafe.Pointer(value)))
+}
+
+// Specify the value of a uniform variable for a specified program object
+func ProgramUniformMatrix3fv(program uint32, location int32, count int32, transpose bool, value *float32) {
+ C.glowProgramUniformMatrix3fv(gpProgramUniformMatrix3fv, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLfloat)(unsafe.Pointer(value)))
+}
+func ProgramUniformMatrix3fvEXT(program uint32, location int32, count int32, transpose bool, value *float32) {
+ C.glowProgramUniformMatrix3fvEXT(gpProgramUniformMatrix3fvEXT, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLfloat)(unsafe.Pointer(value)))
+}
+func ProgramUniformMatrix3x2dv(program uint32, location int32, count int32, transpose bool, value *float64) {
+ C.glowProgramUniformMatrix3x2dv(gpProgramUniformMatrix3x2dv, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLdouble)(unsafe.Pointer(value)))
+}
+func ProgramUniformMatrix3x2dvEXT(program uint32, location int32, count int32, transpose bool, value *float64) {
+ C.glowProgramUniformMatrix3x2dvEXT(gpProgramUniformMatrix3x2dvEXT, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLdouble)(unsafe.Pointer(value)))
+}
+
+// Specify the value of a uniform variable for a specified program object
+func ProgramUniformMatrix3x2fv(program uint32, location int32, count int32, transpose bool, value *float32) {
+ C.glowProgramUniformMatrix3x2fv(gpProgramUniformMatrix3x2fv, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLfloat)(unsafe.Pointer(value)))
+}
+func ProgramUniformMatrix3x2fvEXT(program uint32, location int32, count int32, transpose bool, value *float32) {
+ C.glowProgramUniformMatrix3x2fvEXT(gpProgramUniformMatrix3x2fvEXT, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLfloat)(unsafe.Pointer(value)))
+}
+func ProgramUniformMatrix3x4dv(program uint32, location int32, count int32, transpose bool, value *float64) {
+ C.glowProgramUniformMatrix3x4dv(gpProgramUniformMatrix3x4dv, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLdouble)(unsafe.Pointer(value)))
+}
+func ProgramUniformMatrix3x4dvEXT(program uint32, location int32, count int32, transpose bool, value *float64) {
+ C.glowProgramUniformMatrix3x4dvEXT(gpProgramUniformMatrix3x4dvEXT, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLdouble)(unsafe.Pointer(value)))
+}
+
+// Specify the value of a uniform variable for a specified program object
+func ProgramUniformMatrix3x4fv(program uint32, location int32, count int32, transpose bool, value *float32) {
+ C.glowProgramUniformMatrix3x4fv(gpProgramUniformMatrix3x4fv, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLfloat)(unsafe.Pointer(value)))
+}
+func ProgramUniformMatrix3x4fvEXT(program uint32, location int32, count int32, transpose bool, value *float32) {
+ C.glowProgramUniformMatrix3x4fvEXT(gpProgramUniformMatrix3x4fvEXT, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLfloat)(unsafe.Pointer(value)))
+}
+func ProgramUniformMatrix4dv(program uint32, location int32, count int32, transpose bool, value *float64) {
+ C.glowProgramUniformMatrix4dv(gpProgramUniformMatrix4dv, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLdouble)(unsafe.Pointer(value)))
+}
+func ProgramUniformMatrix4dvEXT(program uint32, location int32, count int32, transpose bool, value *float64) {
+ C.glowProgramUniformMatrix4dvEXT(gpProgramUniformMatrix4dvEXT, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLdouble)(unsafe.Pointer(value)))
+}
+
+// Specify the value of a uniform variable for a specified program object
+func ProgramUniformMatrix4fv(program uint32, location int32, count int32, transpose bool, value *float32) {
+ C.glowProgramUniformMatrix4fv(gpProgramUniformMatrix4fv, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLfloat)(unsafe.Pointer(value)))
+}
+func ProgramUniformMatrix4fvEXT(program uint32, location int32, count int32, transpose bool, value *float32) {
+ C.glowProgramUniformMatrix4fvEXT(gpProgramUniformMatrix4fvEXT, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLfloat)(unsafe.Pointer(value)))
+}
+func ProgramUniformMatrix4x2dv(program uint32, location int32, count int32, transpose bool, value *float64) {
+ C.glowProgramUniformMatrix4x2dv(gpProgramUniformMatrix4x2dv, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLdouble)(unsafe.Pointer(value)))
+}
+func ProgramUniformMatrix4x2dvEXT(program uint32, location int32, count int32, transpose bool, value *float64) {
+ C.glowProgramUniformMatrix4x2dvEXT(gpProgramUniformMatrix4x2dvEXT, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLdouble)(unsafe.Pointer(value)))
+}
+
+// Specify the value of a uniform variable for a specified program object
+func ProgramUniformMatrix4x2fv(program uint32, location int32, count int32, transpose bool, value *float32) {
+ C.glowProgramUniformMatrix4x2fv(gpProgramUniformMatrix4x2fv, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLfloat)(unsafe.Pointer(value)))
+}
+func ProgramUniformMatrix4x2fvEXT(program uint32, location int32, count int32, transpose bool, value *float32) {
+ C.glowProgramUniformMatrix4x2fvEXT(gpProgramUniformMatrix4x2fvEXT, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLfloat)(unsafe.Pointer(value)))
+}
+func ProgramUniformMatrix4x3dv(program uint32, location int32, count int32, transpose bool, value *float64) {
+ C.glowProgramUniformMatrix4x3dv(gpProgramUniformMatrix4x3dv, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLdouble)(unsafe.Pointer(value)))
+}
+func ProgramUniformMatrix4x3dvEXT(program uint32, location int32, count int32, transpose bool, value *float64) {
+ C.glowProgramUniformMatrix4x3dvEXT(gpProgramUniformMatrix4x3dvEXT, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLdouble)(unsafe.Pointer(value)))
+}
+
+// Specify the value of a uniform variable for a specified program object
+func ProgramUniformMatrix4x3fv(program uint32, location int32, count int32, transpose bool, value *float32) {
+ C.glowProgramUniformMatrix4x3fv(gpProgramUniformMatrix4x3fv, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLfloat)(unsafe.Pointer(value)))
+}
+func ProgramUniformMatrix4x3fvEXT(program uint32, location int32, count int32, transpose bool, value *float32) {
+ C.glowProgramUniformMatrix4x3fvEXT(gpProgramUniformMatrix4x3fvEXT, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLfloat)(unsafe.Pointer(value)))
+}
+func ProgramUniformui64NV(program uint32, location int32, value uint64) {
+ C.glowProgramUniformui64NV(gpProgramUniformui64NV, (C.GLuint)(program), (C.GLint)(location), (C.GLuint64EXT)(value))
+}
+func ProgramUniformui64vNV(program uint32, location int32, count int32, value *uint64) {
+ C.glowProgramUniformui64vNV(gpProgramUniformui64vNV, (C.GLuint)(program), (C.GLint)(location), (C.GLsizei)(count), (*C.GLuint64EXT)(unsafe.Pointer(value)))
+}
+
+// specifiy the vertex to be used as the source of data for flat shaded varyings
+func ProvokingVertex(mode uint32) {
+ C.glowProvokingVertex(gpProvokingVertex, (C.GLenum)(mode))
+}
+func PushClientAttribDefaultEXT(mask uint32) {
+ C.glowPushClientAttribDefaultEXT(gpPushClientAttribDefaultEXT, (C.GLbitfield)(mask))
+}
+
+// push a named debug group into the command stream
+func PushDebugGroup(source uint32, id uint32, length int32, message *uint8) {
+ C.glowPushDebugGroup(gpPushDebugGroup, (C.GLenum)(source), (C.GLuint)(id), (C.GLsizei)(length), (*C.GLchar)(unsafe.Pointer(message)))
+}
+func PushDebugGroupKHR(source uint32, id uint32, length int32, message *uint8) {
+ C.glowPushDebugGroupKHR(gpPushDebugGroupKHR, (C.GLenum)(source), (C.GLuint)(id), (C.GLsizei)(length), (*C.GLchar)(unsafe.Pointer(message)))
+}
+func PushGroupMarkerEXT(length int32, marker *uint8) {
+ C.glowPushGroupMarkerEXT(gpPushGroupMarkerEXT, (C.GLsizei)(length), (*C.GLchar)(unsafe.Pointer(marker)))
+}
+
+// record the GL time into a query object after all previous commands have reached the GL server but have not yet necessarily executed.
+func QueryCounter(id uint32, target uint32) {
+ C.glowQueryCounter(gpQueryCounter, (C.GLuint)(id), (C.GLenum)(target))
+}
+func RasterSamplesEXT(samples uint32, fixedsamplelocations bool) {
+ C.glowRasterSamplesEXT(gpRasterSamplesEXT, (C.GLuint)(samples), (C.GLboolean)(boolToInt(fixedsamplelocations)))
+}
+
+// select a color buffer source for pixels
+func ReadBuffer(src uint32) {
+ C.glowReadBuffer(gpReadBuffer, (C.GLenum)(src))
+}
+
+// read a block of pixels from the frame buffer
+func ReadPixels(x int32, y int32, width int32, height int32, format uint32, xtype uint32, pixels unsafe.Pointer) {
+ C.glowReadPixels(gpReadPixels, (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLenum)(format), (C.GLenum)(xtype), pixels)
+}
+
+// read a block of pixels from the frame buffer
+func ReadnPixels(x int32, y int32, width int32, height int32, format uint32, xtype uint32, bufSize int32, data unsafe.Pointer) {
+ C.glowReadnPixels(gpReadnPixels, (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLenum)(format), (C.GLenum)(xtype), (C.GLsizei)(bufSize), data)
+}
+func ReadnPixelsARB(x int32, y int32, width int32, height int32, format uint32, xtype uint32, bufSize int32, data unsafe.Pointer) {
+ C.glowReadnPixelsARB(gpReadnPixelsARB, (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLenum)(format), (C.GLenum)(xtype), (C.GLsizei)(bufSize), data)
+}
+func ReadnPixelsKHR(x int32, y int32, width int32, height int32, format uint32, xtype uint32, bufSize int32, data unsafe.Pointer) {
+ C.glowReadnPixelsKHR(gpReadnPixelsKHR, (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLenum)(format), (C.GLenum)(xtype), (C.GLsizei)(bufSize), data)
+}
+
+// release resources consumed by the implementation's shader compiler
+func ReleaseShaderCompiler() {
+ C.glowReleaseShaderCompiler(gpReleaseShaderCompiler)
+}
+
+// establish data storage, format and dimensions of a renderbuffer object's image
+func RenderbufferStorage(target uint32, internalformat uint32, width int32, height int32) {
+ C.glowRenderbufferStorage(gpRenderbufferStorage, (C.GLenum)(target), (C.GLenum)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height))
+}
+
+// establish data storage, format, dimensions and sample count of a renderbuffer object's image
+func RenderbufferStorageMultisample(target uint32, samples int32, internalformat uint32, width int32, height int32) {
+ C.glowRenderbufferStorageMultisample(gpRenderbufferStorageMultisample, (C.GLenum)(target), (C.GLsizei)(samples), (C.GLenum)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height))
+}
+func RenderbufferStorageMultisampleAdvancedAMD(target uint32, samples int32, storageSamples int32, internalformat uint32, width int32, height int32) {
+ C.glowRenderbufferStorageMultisampleAdvancedAMD(gpRenderbufferStorageMultisampleAdvancedAMD, (C.GLenum)(target), (C.GLsizei)(samples), (C.GLsizei)(storageSamples), (C.GLenum)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height))
+}
+func RenderbufferStorageMultisampleCoverageNV(target uint32, coverageSamples int32, colorSamples int32, internalformat uint32, width int32, height int32) {
+ C.glowRenderbufferStorageMultisampleCoverageNV(gpRenderbufferStorageMultisampleCoverageNV, (C.GLenum)(target), (C.GLsizei)(coverageSamples), (C.GLsizei)(colorSamples), (C.GLenum)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height))
+}
+func ResetMemoryObjectParameterNV(memory uint32, pname uint32) {
+ C.glowResetMemoryObjectParameterNV(gpResetMemoryObjectParameterNV, (C.GLuint)(memory), (C.GLenum)(pname))
+}
+func ResolveDepthValuesNV() {
+ C.glowResolveDepthValuesNV(gpResolveDepthValuesNV)
+}
+
+// resume transform feedback operations
+func ResumeTransformFeedback() {
+ C.glowResumeTransformFeedback(gpResumeTransformFeedback)
+}
+
+// specify multisample coverage parameters
+func SampleCoverage(value float32, invert bool) {
+ C.glowSampleCoverage(gpSampleCoverage, (C.GLfloat)(value), (C.GLboolean)(boolToInt(invert)))
+}
+
+// set the value of a sub-word of the sample mask
+func SampleMaski(maskNumber uint32, mask uint32) {
+ C.glowSampleMaski(gpSampleMaski, (C.GLuint)(maskNumber), (C.GLbitfield)(mask))
+}
+func SamplerParameterIiv(sampler uint32, pname uint32, param *int32) {
+ C.glowSamplerParameterIiv(gpSamplerParameterIiv, (C.GLuint)(sampler), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(param)))
+}
+func SamplerParameterIuiv(sampler uint32, pname uint32, param *uint32) {
+ C.glowSamplerParameterIuiv(gpSamplerParameterIuiv, (C.GLuint)(sampler), (C.GLenum)(pname), (*C.GLuint)(unsafe.Pointer(param)))
+}
+func SamplerParameterf(sampler uint32, pname uint32, param float32) {
+ C.glowSamplerParameterf(gpSamplerParameterf, (C.GLuint)(sampler), (C.GLenum)(pname), (C.GLfloat)(param))
+}
+func SamplerParameterfv(sampler uint32, pname uint32, param *float32) {
+ C.glowSamplerParameterfv(gpSamplerParameterfv, (C.GLuint)(sampler), (C.GLenum)(pname), (*C.GLfloat)(unsafe.Pointer(param)))
+}
+func SamplerParameteri(sampler uint32, pname uint32, param int32) {
+ C.glowSamplerParameteri(gpSamplerParameteri, (C.GLuint)(sampler), (C.GLenum)(pname), (C.GLint)(param))
+}
+func SamplerParameteriv(sampler uint32, pname uint32, param *int32) {
+ C.glowSamplerParameteriv(gpSamplerParameteriv, (C.GLuint)(sampler), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(param)))
+}
+
+// define the scissor box
+func Scissor(x int32, y int32, width int32, height int32) {
+ C.glowScissor(gpScissor, (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width), (C.GLsizei)(height))
+}
+func ScissorArrayv(first uint32, count int32, v *int32) {
+ C.glowScissorArrayv(gpScissorArrayv, (C.GLuint)(first), (C.GLsizei)(count), (*C.GLint)(unsafe.Pointer(v)))
+}
+func ScissorExclusiveArrayvNV(first uint32, count int32, v *int32) {
+ C.glowScissorExclusiveArrayvNV(gpScissorExclusiveArrayvNV, (C.GLuint)(first), (C.GLsizei)(count), (*C.GLint)(unsafe.Pointer(v)))
+}
+func ScissorExclusiveNV(x int32, y int32, width int32, height int32) {
+ C.glowScissorExclusiveNV(gpScissorExclusiveNV, (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width), (C.GLsizei)(height))
+}
+
+// define the scissor box for a specific viewport
+func ScissorIndexed(index uint32, left int32, bottom int32, width int32, height int32) {
+ C.glowScissorIndexed(gpScissorIndexed, (C.GLuint)(index), (C.GLint)(left), (C.GLint)(bottom), (C.GLsizei)(width), (C.GLsizei)(height))
+}
+func ScissorIndexedv(index uint32, v *int32) {
+ C.glowScissorIndexedv(gpScissorIndexedv, (C.GLuint)(index), (*C.GLint)(unsafe.Pointer(v)))
+}
+func SecondaryColorFormatNV(size int32, xtype uint32, stride int32) {
+ C.glowSecondaryColorFormatNV(gpSecondaryColorFormatNV, (C.GLint)(size), (C.GLenum)(xtype), (C.GLsizei)(stride))
+}
+func SelectPerfMonitorCountersAMD(monitor uint32, enable bool, group uint32, numCounters int32, counterList *uint32) {
+ C.glowSelectPerfMonitorCountersAMD(gpSelectPerfMonitorCountersAMD, (C.GLuint)(monitor), (C.GLboolean)(boolToInt(enable)), (C.GLuint)(group), (C.GLint)(numCounters), (*C.GLuint)(unsafe.Pointer(counterList)))
+}
+
+// load pre-compiled shader binaries
+func ShaderBinary(count int32, shaders *uint32, binaryFormat uint32, binary unsafe.Pointer, length int32) {
+ C.glowShaderBinary(gpShaderBinary, (C.GLsizei)(count), (*C.GLuint)(unsafe.Pointer(shaders)), (C.GLenum)(binaryFormat), binary, (C.GLsizei)(length))
+}
+
+// Replaces the source code in a shader object
+func ShaderSource(shader uint32, count int32, xstring **uint8, length *int32) {
+ C.glowShaderSource(gpShaderSource, (C.GLuint)(shader), (C.GLsizei)(count), (**C.GLchar)(unsafe.Pointer(xstring)), (*C.GLint)(unsafe.Pointer(length)))
+}
+
+// change an active shader storage block binding
+func ShaderStorageBlockBinding(program uint32, storageBlockIndex uint32, storageBlockBinding uint32) {
+ C.glowShaderStorageBlockBinding(gpShaderStorageBlockBinding, (C.GLuint)(program), (C.GLuint)(storageBlockIndex), (C.GLuint)(storageBlockBinding))
+}
+func ShadingRateImageBarrierNV(synchronize bool) {
+ C.glowShadingRateImageBarrierNV(gpShadingRateImageBarrierNV, (C.GLboolean)(boolToInt(synchronize)))
+}
+func ShadingRateImagePaletteNV(viewport uint32, first uint32, count int32, rates *uint32) {
+ C.glowShadingRateImagePaletteNV(gpShadingRateImagePaletteNV, (C.GLuint)(viewport), (C.GLuint)(first), (C.GLsizei)(count), (*C.GLenum)(unsafe.Pointer(rates)))
+}
+func ShadingRateSampleOrderCustomNV(rate uint32, samples uint32, locations *int32) {
+ C.glowShadingRateSampleOrderCustomNV(gpShadingRateSampleOrderCustomNV, (C.GLenum)(rate), (C.GLuint)(samples), (*C.GLint)(unsafe.Pointer(locations)))
+}
+func ShadingRateSampleOrderNV(order uint32) {
+ C.glowShadingRateSampleOrderNV(gpShadingRateSampleOrderNV, (C.GLenum)(order))
+}
+func SignalVkFenceNV(vkFence uint64) {
+ C.glowSignalVkFenceNV(gpSignalVkFenceNV, (C.GLuint64)(vkFence))
+}
+func SignalVkSemaphoreNV(vkSemaphore uint64) {
+ C.glowSignalVkSemaphoreNV(gpSignalVkSemaphoreNV, (C.GLuint64)(vkSemaphore))
+}
+func SpecializeShaderARB(shader uint32, pEntryPoint *uint8, numSpecializationConstants uint32, pConstantIndex *uint32, pConstantValue *uint32) {
+ C.glowSpecializeShaderARB(gpSpecializeShaderARB, (C.GLuint)(shader), (*C.GLchar)(unsafe.Pointer(pEntryPoint)), (C.GLuint)(numSpecializationConstants), (*C.GLuint)(unsafe.Pointer(pConstantIndex)), (*C.GLuint)(unsafe.Pointer(pConstantValue)))
+}
+func StateCaptureNV(state uint32, mode uint32) {
+ C.glowStateCaptureNV(gpStateCaptureNV, (C.GLuint)(state), (C.GLenum)(mode))
+}
+func StencilFillPathInstancedNV(numPaths int32, pathNameType uint32, paths unsafe.Pointer, pathBase uint32, fillMode uint32, mask uint32, transformType uint32, transformValues *float32) {
+ C.glowStencilFillPathInstancedNV(gpStencilFillPathInstancedNV, (C.GLsizei)(numPaths), (C.GLenum)(pathNameType), paths, (C.GLuint)(pathBase), (C.GLenum)(fillMode), (C.GLuint)(mask), (C.GLenum)(transformType), (*C.GLfloat)(unsafe.Pointer(transformValues)))
+}
+func StencilFillPathNV(path uint32, fillMode uint32, mask uint32) {
+ C.glowStencilFillPathNV(gpStencilFillPathNV, (C.GLuint)(path), (C.GLenum)(fillMode), (C.GLuint)(mask))
+}
+
+// set front and back function and reference value for stencil testing
+func StencilFunc(xfunc uint32, ref int32, mask uint32) {
+ C.glowStencilFunc(gpStencilFunc, (C.GLenum)(xfunc), (C.GLint)(ref), (C.GLuint)(mask))
+}
+
+// set front and/or back function and reference value for stencil testing
+func StencilFuncSeparate(face uint32, xfunc uint32, ref int32, mask uint32) {
+ C.glowStencilFuncSeparate(gpStencilFuncSeparate, (C.GLenum)(face), (C.GLenum)(xfunc), (C.GLint)(ref), (C.GLuint)(mask))
+}
+
+// control the front and back writing of individual bits in the stencil planes
+func StencilMask(mask uint32) {
+ C.glowStencilMask(gpStencilMask, (C.GLuint)(mask))
+}
+
+// control the front and/or back writing of individual bits in the stencil planes
+func StencilMaskSeparate(face uint32, mask uint32) {
+ C.glowStencilMaskSeparate(gpStencilMaskSeparate, (C.GLenum)(face), (C.GLuint)(mask))
+}
+
+// set front and back stencil test actions
+func StencilOp(fail uint32, zfail uint32, zpass uint32) {
+ C.glowStencilOp(gpStencilOp, (C.GLenum)(fail), (C.GLenum)(zfail), (C.GLenum)(zpass))
+}
+
+// set front and/or back stencil test actions
+func StencilOpSeparate(face uint32, sfail uint32, dpfail uint32, dppass uint32) {
+ C.glowStencilOpSeparate(gpStencilOpSeparate, (C.GLenum)(face), (C.GLenum)(sfail), (C.GLenum)(dpfail), (C.GLenum)(dppass))
+}
+func StencilStrokePathInstancedNV(numPaths int32, pathNameType uint32, paths unsafe.Pointer, pathBase uint32, reference int32, mask uint32, transformType uint32, transformValues *float32) {
+ C.glowStencilStrokePathInstancedNV(gpStencilStrokePathInstancedNV, (C.GLsizei)(numPaths), (C.GLenum)(pathNameType), paths, (C.GLuint)(pathBase), (C.GLint)(reference), (C.GLuint)(mask), (C.GLenum)(transformType), (*C.GLfloat)(unsafe.Pointer(transformValues)))
+}
+func StencilStrokePathNV(path uint32, reference int32, mask uint32) {
+ C.glowStencilStrokePathNV(gpStencilStrokePathNV, (C.GLuint)(path), (C.GLint)(reference), (C.GLuint)(mask))
+}
+func StencilThenCoverFillPathInstancedNV(numPaths int32, pathNameType uint32, paths unsafe.Pointer, pathBase uint32, fillMode uint32, mask uint32, coverMode uint32, transformType uint32, transformValues *float32) {
+ C.glowStencilThenCoverFillPathInstancedNV(gpStencilThenCoverFillPathInstancedNV, (C.GLsizei)(numPaths), (C.GLenum)(pathNameType), paths, (C.GLuint)(pathBase), (C.GLenum)(fillMode), (C.GLuint)(mask), (C.GLenum)(coverMode), (C.GLenum)(transformType), (*C.GLfloat)(unsafe.Pointer(transformValues)))
+}
+func StencilThenCoverFillPathNV(path uint32, fillMode uint32, mask uint32, coverMode uint32) {
+ C.glowStencilThenCoverFillPathNV(gpStencilThenCoverFillPathNV, (C.GLuint)(path), (C.GLenum)(fillMode), (C.GLuint)(mask), (C.GLenum)(coverMode))
+}
+func StencilThenCoverStrokePathInstancedNV(numPaths int32, pathNameType uint32, paths unsafe.Pointer, pathBase uint32, reference int32, mask uint32, coverMode uint32, transformType uint32, transformValues *float32) {
+ C.glowStencilThenCoverStrokePathInstancedNV(gpStencilThenCoverStrokePathInstancedNV, (C.GLsizei)(numPaths), (C.GLenum)(pathNameType), paths, (C.GLuint)(pathBase), (C.GLint)(reference), (C.GLuint)(mask), (C.GLenum)(coverMode), (C.GLenum)(transformType), (*C.GLfloat)(unsafe.Pointer(transformValues)))
+}
+func StencilThenCoverStrokePathNV(path uint32, reference int32, mask uint32, coverMode uint32) {
+ C.glowStencilThenCoverStrokePathNV(gpStencilThenCoverStrokePathNV, (C.GLuint)(path), (C.GLint)(reference), (C.GLuint)(mask), (C.GLenum)(coverMode))
+}
+func SubpixelPrecisionBiasNV(xbits uint32, ybits uint32) {
+ C.glowSubpixelPrecisionBiasNV(gpSubpixelPrecisionBiasNV, (C.GLuint)(xbits), (C.GLuint)(ybits))
+}
+func TexAttachMemoryNV(target uint32, memory uint32, offset uint64) {
+ C.glowTexAttachMemoryNV(gpTexAttachMemoryNV, (C.GLenum)(target), (C.GLuint)(memory), (C.GLuint64)(offset))
+}
+
+// attach a buffer object's data store to a buffer texture object
+func TexBuffer(target uint32, internalformat uint32, buffer uint32) {
+ C.glowTexBuffer(gpTexBuffer, (C.GLenum)(target), (C.GLenum)(internalformat), (C.GLuint)(buffer))
+}
+func TexBufferARB(target uint32, internalformat uint32, buffer uint32) {
+ C.glowTexBufferARB(gpTexBufferARB, (C.GLenum)(target), (C.GLenum)(internalformat), (C.GLuint)(buffer))
+}
+
+// attach a range of a buffer object's data store to a buffer texture object
+func TexBufferRange(target uint32, internalformat uint32, buffer uint32, offset int, size int) {
+ C.glowTexBufferRange(gpTexBufferRange, (C.GLenum)(target), (C.GLenum)(internalformat), (C.GLuint)(buffer), (C.GLintptr)(offset), (C.GLsizeiptr)(size))
+}
+func TexCoordFormatNV(size int32, xtype uint32, stride int32) {
+ C.glowTexCoordFormatNV(gpTexCoordFormatNV, (C.GLint)(size), (C.GLenum)(xtype), (C.GLsizei)(stride))
+}
+
+// specify a one-dimensional texture image
+func TexImage1D(target uint32, level int32, internalformat int32, width int32, border int32, format uint32, xtype uint32, pixels unsafe.Pointer) {
+ C.glowTexImage1D(gpTexImage1D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(internalformat), (C.GLsizei)(width), (C.GLint)(border), (C.GLenum)(format), (C.GLenum)(xtype), pixels)
+}
+
+// specify a two-dimensional texture image
+func TexImage2D(target uint32, level int32, internalformat int32, width int32, height int32, border int32, format uint32, xtype uint32, pixels unsafe.Pointer) {
+ C.glowTexImage2D(gpTexImage2D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLint)(border), (C.GLenum)(format), (C.GLenum)(xtype), pixels)
+}
+
+// establish the data storage, format, dimensions, and number of samples of a multisample texture's image
+func TexImage2DMultisample(target uint32, samples int32, internalformat uint32, width int32, height int32, fixedsamplelocations bool) {
+ C.glowTexImage2DMultisample(gpTexImage2DMultisample, (C.GLenum)(target), (C.GLsizei)(samples), (C.GLenum)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLboolean)(boolToInt(fixedsamplelocations)))
+}
+
+// specify a three-dimensional texture image
+func TexImage3D(target uint32, level int32, internalformat int32, width int32, height int32, depth int32, border int32, format uint32, xtype uint32, pixels unsafe.Pointer) {
+ C.glowTexImage3D(gpTexImage3D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLint)(border), (C.GLenum)(format), (C.GLenum)(xtype), pixels)
+}
+
+// establish the data storage, format, dimensions, and number of samples of a multisample texture's image
+func TexImage3DMultisample(target uint32, samples int32, internalformat uint32, width int32, height int32, depth int32, fixedsamplelocations bool) {
+ C.glowTexImage3DMultisample(gpTexImage3DMultisample, (C.GLenum)(target), (C.GLsizei)(samples), (C.GLenum)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLboolean)(boolToInt(fixedsamplelocations)))
+}
+func TexPageCommitmentARB(target uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, commit bool) {
+ C.glowTexPageCommitmentARB(gpTexPageCommitmentARB, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLboolean)(boolToInt(commit)))
+}
+func TexPageCommitmentMemNV(target uint32, layer int32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, memory uint32, offset uint64, commit bool) {
+ C.glowTexPageCommitmentMemNV(gpTexPageCommitmentMemNV, (C.GLenum)(target), (C.GLint)(layer), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLuint)(memory), (C.GLuint64)(offset), (C.GLboolean)(boolToInt(commit)))
+}
+func TexParameterIiv(target uint32, pname uint32, params *int32) {
+ C.glowTexParameterIiv(gpTexParameterIiv, (C.GLenum)(target), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params)))
+}
+func TexParameterIuiv(target uint32, pname uint32, params *uint32) {
+ C.glowTexParameterIuiv(gpTexParameterIuiv, (C.GLenum)(target), (C.GLenum)(pname), (*C.GLuint)(unsafe.Pointer(params)))
+}
+func TexParameterf(target uint32, pname uint32, param float32) {
+ C.glowTexParameterf(gpTexParameterf, (C.GLenum)(target), (C.GLenum)(pname), (C.GLfloat)(param))
+}
+func TexParameterfv(target uint32, pname uint32, params *float32) {
+ C.glowTexParameterfv(gpTexParameterfv, (C.GLenum)(target), (C.GLenum)(pname), (*C.GLfloat)(unsafe.Pointer(params)))
+}
+func TexParameteri(target uint32, pname uint32, param int32) {
+ C.glowTexParameteri(gpTexParameteri, (C.GLenum)(target), (C.GLenum)(pname), (C.GLint)(param))
+}
+func TexParameteriv(target uint32, pname uint32, params *int32) {
+ C.glowTexParameteriv(gpTexParameteriv, (C.GLenum)(target), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params)))
+}
+
+// simultaneously specify storage for all levels of a one-dimensional texture
+func TexStorage1D(target uint32, levels int32, internalformat uint32, width int32) {
+ C.glowTexStorage1D(gpTexStorage1D, (C.GLenum)(target), (C.GLsizei)(levels), (C.GLenum)(internalformat), (C.GLsizei)(width))
+}
+
+// simultaneously specify storage for all levels of a two-dimensional or one-dimensional array texture
+func TexStorage2D(target uint32, levels int32, internalformat uint32, width int32, height int32) {
+ C.glowTexStorage2D(gpTexStorage2D, (C.GLenum)(target), (C.GLsizei)(levels), (C.GLenum)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height))
+}
+
+// specify storage for a two-dimensional multisample texture
+func TexStorage2DMultisample(target uint32, samples int32, internalformat uint32, width int32, height int32, fixedsamplelocations bool) {
+ C.glowTexStorage2DMultisample(gpTexStorage2DMultisample, (C.GLenum)(target), (C.GLsizei)(samples), (C.GLenum)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLboolean)(boolToInt(fixedsamplelocations)))
+}
+
+// simultaneously specify storage for all levels of a three-dimensional, two-dimensional array or cube-map array texture
+func TexStorage3D(target uint32, levels int32, internalformat uint32, width int32, height int32, depth int32) {
+ C.glowTexStorage3D(gpTexStorage3D, (C.GLenum)(target), (C.GLsizei)(levels), (C.GLenum)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth))
+}
+
+// specify storage for a two-dimensional multisample array texture
+func TexStorage3DMultisample(target uint32, samples int32, internalformat uint32, width int32, height int32, depth int32, fixedsamplelocations bool) {
+ C.glowTexStorage3DMultisample(gpTexStorage3DMultisample, (C.GLenum)(target), (C.GLsizei)(samples), (C.GLenum)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLboolean)(boolToInt(fixedsamplelocations)))
+}
+
+// specify a one-dimensional texture subimage
+func TexSubImage1D(target uint32, level int32, xoffset int32, width int32, format uint32, xtype uint32, pixels unsafe.Pointer) {
+ C.glowTexSubImage1D(gpTexSubImage1D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLsizei)(width), (C.GLenum)(format), (C.GLenum)(xtype), pixels)
+}
+
+// specify a two-dimensional texture subimage
+func TexSubImage2D(target uint32, level int32, xoffset int32, yoffset int32, width int32, height int32, format uint32, xtype uint32, pixels unsafe.Pointer) {
+ C.glowTexSubImage2D(gpTexSubImage2D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLenum)(format), (C.GLenum)(xtype), pixels)
+}
+
+// specify a three-dimensional texture subimage
+func TexSubImage3D(target uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, format uint32, xtype uint32, pixels unsafe.Pointer) {
+ C.glowTexSubImage3D(gpTexSubImage3D, (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLenum)(format), (C.GLenum)(xtype), pixels)
+}
+func TextureAttachMemoryNV(texture uint32, memory uint32, offset uint64) {
+ C.glowTextureAttachMemoryNV(gpTextureAttachMemoryNV, (C.GLuint)(texture), (C.GLuint)(memory), (C.GLuint64)(offset))
+}
+
+// controls the ordering of reads and writes to rendered fragments across drawing commands
+func TextureBarrier() {
+ C.glowTextureBarrier(gpTextureBarrier)
+}
+func TextureBarrierNV() {
+ C.glowTextureBarrierNV(gpTextureBarrierNV)
+}
+
+// attach a buffer object's data store to a buffer texture object
+func TextureBuffer(texture uint32, internalformat uint32, buffer uint32) {
+ C.glowTextureBuffer(gpTextureBuffer, (C.GLuint)(texture), (C.GLenum)(internalformat), (C.GLuint)(buffer))
+}
+func TextureBufferEXT(texture uint32, target uint32, internalformat uint32, buffer uint32) {
+ C.glowTextureBufferEXT(gpTextureBufferEXT, (C.GLuint)(texture), (C.GLenum)(target), (C.GLenum)(internalformat), (C.GLuint)(buffer))
+}
+
+// attach a range of a buffer object's data store to a buffer texture object
+func TextureBufferRange(texture uint32, internalformat uint32, buffer uint32, offset int, size int) {
+ C.glowTextureBufferRange(gpTextureBufferRange, (C.GLuint)(texture), (C.GLenum)(internalformat), (C.GLuint)(buffer), (C.GLintptr)(offset), (C.GLsizeiptr)(size))
+}
+func TextureBufferRangeEXT(texture uint32, target uint32, internalformat uint32, buffer uint32, offset int, size int) {
+ C.glowTextureBufferRangeEXT(gpTextureBufferRangeEXT, (C.GLuint)(texture), (C.GLenum)(target), (C.GLenum)(internalformat), (C.GLuint)(buffer), (C.GLintptr)(offset), (C.GLsizeiptr)(size))
+}
+func TextureImage1DEXT(texture uint32, target uint32, level int32, internalformat int32, width int32, border int32, format uint32, xtype uint32, pixels unsafe.Pointer) {
+ C.glowTextureImage1DEXT(gpTextureImage1DEXT, (C.GLuint)(texture), (C.GLenum)(target), (C.GLint)(level), (C.GLint)(internalformat), (C.GLsizei)(width), (C.GLint)(border), (C.GLenum)(format), (C.GLenum)(xtype), pixels)
+}
+func TextureImage2DEXT(texture uint32, target uint32, level int32, internalformat int32, width int32, height int32, border int32, format uint32, xtype uint32, pixels unsafe.Pointer) {
+ C.glowTextureImage2DEXT(gpTextureImage2DEXT, (C.GLuint)(texture), (C.GLenum)(target), (C.GLint)(level), (C.GLint)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLint)(border), (C.GLenum)(format), (C.GLenum)(xtype), pixels)
+}
+func TextureImage3DEXT(texture uint32, target uint32, level int32, internalformat int32, width int32, height int32, depth int32, border int32, format uint32, xtype uint32, pixels unsafe.Pointer) {
+ C.glowTextureImage3DEXT(gpTextureImage3DEXT, (C.GLuint)(texture), (C.GLenum)(target), (C.GLint)(level), (C.GLint)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLint)(border), (C.GLenum)(format), (C.GLenum)(xtype), pixels)
+}
+func TexturePageCommitmentEXT(texture uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, commit bool) {
+ C.glowTexturePageCommitmentEXT(gpTexturePageCommitmentEXT, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLboolean)(boolToInt(commit)))
+}
+func TexturePageCommitmentMemNV(texture uint32, layer int32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, memory uint32, offset uint64, commit bool) {
+ C.glowTexturePageCommitmentMemNV(gpTexturePageCommitmentMemNV, (C.GLuint)(texture), (C.GLint)(layer), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLuint)(memory), (C.GLuint64)(offset), (C.GLboolean)(boolToInt(commit)))
+}
+func TextureParameterIiv(texture uint32, pname uint32, params *int32) {
+ C.glowTextureParameterIiv(gpTextureParameterIiv, (C.GLuint)(texture), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params)))
+}
+func TextureParameterIivEXT(texture uint32, target uint32, pname uint32, params *int32) {
+ C.glowTextureParameterIivEXT(gpTextureParameterIivEXT, (C.GLuint)(texture), (C.GLenum)(target), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params)))
+}
+func TextureParameterIuiv(texture uint32, pname uint32, params *uint32) {
+ C.glowTextureParameterIuiv(gpTextureParameterIuiv, (C.GLuint)(texture), (C.GLenum)(pname), (*C.GLuint)(unsafe.Pointer(params)))
+}
+func TextureParameterIuivEXT(texture uint32, target uint32, pname uint32, params *uint32) {
+ C.glowTextureParameterIuivEXT(gpTextureParameterIuivEXT, (C.GLuint)(texture), (C.GLenum)(target), (C.GLenum)(pname), (*C.GLuint)(unsafe.Pointer(params)))
+}
+func TextureParameterf(texture uint32, pname uint32, param float32) {
+ C.glowTextureParameterf(gpTextureParameterf, (C.GLuint)(texture), (C.GLenum)(pname), (C.GLfloat)(param))
+}
+func TextureParameterfEXT(texture uint32, target uint32, pname uint32, param float32) {
+ C.glowTextureParameterfEXT(gpTextureParameterfEXT, (C.GLuint)(texture), (C.GLenum)(target), (C.GLenum)(pname), (C.GLfloat)(param))
+}
+func TextureParameterfv(texture uint32, pname uint32, param *float32) {
+ C.glowTextureParameterfv(gpTextureParameterfv, (C.GLuint)(texture), (C.GLenum)(pname), (*C.GLfloat)(unsafe.Pointer(param)))
+}
+func TextureParameterfvEXT(texture uint32, target uint32, pname uint32, params *float32) {
+ C.glowTextureParameterfvEXT(gpTextureParameterfvEXT, (C.GLuint)(texture), (C.GLenum)(target), (C.GLenum)(pname), (*C.GLfloat)(unsafe.Pointer(params)))
+}
+func TextureParameteri(texture uint32, pname uint32, param int32) {
+ C.glowTextureParameteri(gpTextureParameteri, (C.GLuint)(texture), (C.GLenum)(pname), (C.GLint)(param))
+}
+func TextureParameteriEXT(texture uint32, target uint32, pname uint32, param int32) {
+ C.glowTextureParameteriEXT(gpTextureParameteriEXT, (C.GLuint)(texture), (C.GLenum)(target), (C.GLenum)(pname), (C.GLint)(param))
+}
+func TextureParameteriv(texture uint32, pname uint32, param *int32) {
+ C.glowTextureParameteriv(gpTextureParameteriv, (C.GLuint)(texture), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(param)))
+}
+func TextureParameterivEXT(texture uint32, target uint32, pname uint32, params *int32) {
+ C.glowTextureParameterivEXT(gpTextureParameterivEXT, (C.GLuint)(texture), (C.GLenum)(target), (C.GLenum)(pname), (*C.GLint)(unsafe.Pointer(params)))
+}
+func TextureRenderbufferEXT(texture uint32, target uint32, renderbuffer uint32) {
+ C.glowTextureRenderbufferEXT(gpTextureRenderbufferEXT, (C.GLuint)(texture), (C.GLenum)(target), (C.GLuint)(renderbuffer))
+}
+
+// simultaneously specify storage for all levels of a one-dimensional texture
+func TextureStorage1D(texture uint32, levels int32, internalformat uint32, width int32) {
+ C.glowTextureStorage1D(gpTextureStorage1D, (C.GLuint)(texture), (C.GLsizei)(levels), (C.GLenum)(internalformat), (C.GLsizei)(width))
+}
+func TextureStorage1DEXT(texture uint32, target uint32, levels int32, internalformat uint32, width int32) {
+ C.glowTextureStorage1DEXT(gpTextureStorage1DEXT, (C.GLuint)(texture), (C.GLenum)(target), (C.GLsizei)(levels), (C.GLenum)(internalformat), (C.GLsizei)(width))
+}
+
+// simultaneously specify storage for all levels of a two-dimensional or one-dimensional array texture
+func TextureStorage2D(texture uint32, levels int32, internalformat uint32, width int32, height int32) {
+ C.glowTextureStorage2D(gpTextureStorage2D, (C.GLuint)(texture), (C.GLsizei)(levels), (C.GLenum)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height))
+}
+func TextureStorage2DEXT(texture uint32, target uint32, levels int32, internalformat uint32, width int32, height int32) {
+ C.glowTextureStorage2DEXT(gpTextureStorage2DEXT, (C.GLuint)(texture), (C.GLenum)(target), (C.GLsizei)(levels), (C.GLenum)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height))
+}
+
+// specify storage for a two-dimensional multisample texture
+func TextureStorage2DMultisample(texture uint32, samples int32, internalformat uint32, width int32, height int32, fixedsamplelocations bool) {
+ C.glowTextureStorage2DMultisample(gpTextureStorage2DMultisample, (C.GLuint)(texture), (C.GLsizei)(samples), (C.GLenum)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLboolean)(boolToInt(fixedsamplelocations)))
+}
+func TextureStorage2DMultisampleEXT(texture uint32, target uint32, samples int32, internalformat uint32, width int32, height int32, fixedsamplelocations bool) {
+ C.glowTextureStorage2DMultisampleEXT(gpTextureStorage2DMultisampleEXT, (C.GLuint)(texture), (C.GLenum)(target), (C.GLsizei)(samples), (C.GLenum)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLboolean)(boolToInt(fixedsamplelocations)))
+}
+
+// simultaneously specify storage for all levels of a three-dimensional, two-dimensional array or cube-map array texture
+func TextureStorage3D(texture uint32, levels int32, internalformat uint32, width int32, height int32, depth int32) {
+ C.glowTextureStorage3D(gpTextureStorage3D, (C.GLuint)(texture), (C.GLsizei)(levels), (C.GLenum)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth))
+}
+func TextureStorage3DEXT(texture uint32, target uint32, levels int32, internalformat uint32, width int32, height int32, depth int32) {
+ C.glowTextureStorage3DEXT(gpTextureStorage3DEXT, (C.GLuint)(texture), (C.GLenum)(target), (C.GLsizei)(levels), (C.GLenum)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth))
+}
+
+// specify storage for a two-dimensional multisample array texture
+func TextureStorage3DMultisample(texture uint32, samples int32, internalformat uint32, width int32, height int32, depth int32, fixedsamplelocations bool) {
+ C.glowTextureStorage3DMultisample(gpTextureStorage3DMultisample, (C.GLuint)(texture), (C.GLsizei)(samples), (C.GLenum)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLboolean)(boolToInt(fixedsamplelocations)))
+}
+func TextureStorage3DMultisampleEXT(texture uint32, target uint32, samples int32, internalformat uint32, width int32, height int32, depth int32, fixedsamplelocations bool) {
+ C.glowTextureStorage3DMultisampleEXT(gpTextureStorage3DMultisampleEXT, (C.GLuint)(texture), (C.GLenum)(target), (C.GLsizei)(samples), (C.GLenum)(internalformat), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLboolean)(boolToInt(fixedsamplelocations)))
+}
+
+// specify a one-dimensional texture subimage
+func TextureSubImage1D(texture uint32, level int32, xoffset int32, width int32, format uint32, xtype uint32, pixels unsafe.Pointer) {
+ C.glowTextureSubImage1D(gpTextureSubImage1D, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLsizei)(width), (C.GLenum)(format), (C.GLenum)(xtype), pixels)
+}
+func TextureSubImage1DEXT(texture uint32, target uint32, level int32, xoffset int32, width int32, format uint32, xtype uint32, pixels unsafe.Pointer) {
+ C.glowTextureSubImage1DEXT(gpTextureSubImage1DEXT, (C.GLuint)(texture), (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLsizei)(width), (C.GLenum)(format), (C.GLenum)(xtype), pixels)
+}
+
+// specify a two-dimensional texture subimage
+func TextureSubImage2D(texture uint32, level int32, xoffset int32, yoffset int32, width int32, height int32, format uint32, xtype uint32, pixels unsafe.Pointer) {
+ C.glowTextureSubImage2D(gpTextureSubImage2D, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLenum)(format), (C.GLenum)(xtype), pixels)
+}
+func TextureSubImage2DEXT(texture uint32, target uint32, level int32, xoffset int32, yoffset int32, width int32, height int32, format uint32, xtype uint32, pixels unsafe.Pointer) {
+ C.glowTextureSubImage2DEXT(gpTextureSubImage2DEXT, (C.GLuint)(texture), (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLenum)(format), (C.GLenum)(xtype), pixels)
+}
+
+// specify a three-dimensional texture subimage
+func TextureSubImage3D(texture uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, format uint32, xtype uint32, pixels unsafe.Pointer) {
+ C.glowTextureSubImage3D(gpTextureSubImage3D, (C.GLuint)(texture), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLenum)(format), (C.GLenum)(xtype), pixels)
+}
+func TextureSubImage3DEXT(texture uint32, target uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, format uint32, xtype uint32, pixels unsafe.Pointer) {
+ C.glowTextureSubImage3DEXT(gpTextureSubImage3DEXT, (C.GLuint)(texture), (C.GLenum)(target), (C.GLint)(level), (C.GLint)(xoffset), (C.GLint)(yoffset), (C.GLint)(zoffset), (C.GLsizei)(width), (C.GLsizei)(height), (C.GLsizei)(depth), (C.GLenum)(format), (C.GLenum)(xtype), pixels)
+}
+
+// initialize a texture as a data alias of another texture's data store
+func TextureView(texture uint32, target uint32, origtexture uint32, internalformat uint32, minlevel uint32, numlevels uint32, minlayer uint32, numlayers uint32) {
+ C.glowTextureView(gpTextureView, (C.GLuint)(texture), (C.GLenum)(target), (C.GLuint)(origtexture), (C.GLenum)(internalformat), (C.GLuint)(minlevel), (C.GLuint)(numlevels), (C.GLuint)(minlayer), (C.GLuint)(numlayers))
+}
+
+// bind a buffer object to a transform feedback buffer object
+func TransformFeedbackBufferBase(xfb uint32, index uint32, buffer uint32) {
+ C.glowTransformFeedbackBufferBase(gpTransformFeedbackBufferBase, (C.GLuint)(xfb), (C.GLuint)(index), (C.GLuint)(buffer))
+}
+
+// bind a range within a buffer object to a transform feedback buffer object
+func TransformFeedbackBufferRange(xfb uint32, index uint32, buffer uint32, offset int, size int) {
+ C.glowTransformFeedbackBufferRange(gpTransformFeedbackBufferRange, (C.GLuint)(xfb), (C.GLuint)(index), (C.GLuint)(buffer), (C.GLintptr)(offset), (C.GLsizeiptr)(size))
+}
+
+// specify values to record in transform feedback buffers
+func TransformFeedbackVaryings(program uint32, count int32, varyings **uint8, bufferMode uint32) {
+ C.glowTransformFeedbackVaryings(gpTransformFeedbackVaryings, (C.GLuint)(program), (C.GLsizei)(count), (**C.GLchar)(unsafe.Pointer(varyings)), (C.GLenum)(bufferMode))
+}
+func TransformPathNV(resultPath uint32, srcPath uint32, transformType uint32, transformValues *float32) {
+ C.glowTransformPathNV(gpTransformPathNV, (C.GLuint)(resultPath), (C.GLuint)(srcPath), (C.GLenum)(transformType), (*C.GLfloat)(unsafe.Pointer(transformValues)))
+}
+func Uniform1d(location int32, x float64) {
+ C.glowUniform1d(gpUniform1d, (C.GLint)(location), (C.GLdouble)(x))
+}
+func Uniform1dv(location int32, count int32, value *float64) {
+ C.glowUniform1dv(gpUniform1dv, (C.GLint)(location), (C.GLsizei)(count), (*C.GLdouble)(unsafe.Pointer(value)))
+}
+
+// Specify the value of a uniform variable for the current program object
+func Uniform1f(location int32, v0 float32) {
+ C.glowUniform1f(gpUniform1f, (C.GLint)(location), (C.GLfloat)(v0))
+}
+
+// Specify the value of a uniform variable for the current program object
+func Uniform1fv(location int32, count int32, value *float32) {
+ C.glowUniform1fv(gpUniform1fv, (C.GLint)(location), (C.GLsizei)(count), (*C.GLfloat)(unsafe.Pointer(value)))
+}
+
+// Specify the value of a uniform variable for the current program object
+func Uniform1i(location int32, v0 int32) {
+ C.glowUniform1i(gpUniform1i, (C.GLint)(location), (C.GLint)(v0))
+}
+func Uniform1i64ARB(location int32, x int64) {
+ C.glowUniform1i64ARB(gpUniform1i64ARB, (C.GLint)(location), (C.GLint64)(x))
+}
+func Uniform1i64NV(location int32, x int64) {
+ C.glowUniform1i64NV(gpUniform1i64NV, (C.GLint)(location), (C.GLint64EXT)(x))
+}
+func Uniform1i64vARB(location int32, count int32, value *int64) {
+ C.glowUniform1i64vARB(gpUniform1i64vARB, (C.GLint)(location), (C.GLsizei)(count), (*C.GLint64)(unsafe.Pointer(value)))
+}
+func Uniform1i64vNV(location int32, count int32, value *int64) {
+ C.glowUniform1i64vNV(gpUniform1i64vNV, (C.GLint)(location), (C.GLsizei)(count), (*C.GLint64EXT)(unsafe.Pointer(value)))
+}
+
+// Specify the value of a uniform variable for the current program object
+func Uniform1iv(location int32, count int32, value *int32) {
+ C.glowUniform1iv(gpUniform1iv, (C.GLint)(location), (C.GLsizei)(count), (*C.GLint)(unsafe.Pointer(value)))
+}
+
+// Specify the value of a uniform variable for the current program object
+func Uniform1ui(location int32, v0 uint32) {
+ C.glowUniform1ui(gpUniform1ui, (C.GLint)(location), (C.GLuint)(v0))
+}
+func Uniform1ui64ARB(location int32, x uint64) {
+ C.glowUniform1ui64ARB(gpUniform1ui64ARB, (C.GLint)(location), (C.GLuint64)(x))
+}
+func Uniform1ui64NV(location int32, x uint64) {
+ C.glowUniform1ui64NV(gpUniform1ui64NV, (C.GLint)(location), (C.GLuint64EXT)(x))
+}
+func Uniform1ui64vARB(location int32, count int32, value *uint64) {
+ C.glowUniform1ui64vARB(gpUniform1ui64vARB, (C.GLint)(location), (C.GLsizei)(count), (*C.GLuint64)(unsafe.Pointer(value)))
+}
+func Uniform1ui64vNV(location int32, count int32, value *uint64) {
+ C.glowUniform1ui64vNV(gpUniform1ui64vNV, (C.GLint)(location), (C.GLsizei)(count), (*C.GLuint64EXT)(unsafe.Pointer(value)))
+}
+
+// Specify the value of a uniform variable for the current program object
+func Uniform1uiv(location int32, count int32, value *uint32) {
+ C.glowUniform1uiv(gpUniform1uiv, (C.GLint)(location), (C.GLsizei)(count), (*C.GLuint)(unsafe.Pointer(value)))
+}
+func Uniform2d(location int32, x float64, y float64) {
+ C.glowUniform2d(gpUniform2d, (C.GLint)(location), (C.GLdouble)(x), (C.GLdouble)(y))
+}
+func Uniform2dv(location int32, count int32, value *float64) {
+ C.glowUniform2dv(gpUniform2dv, (C.GLint)(location), (C.GLsizei)(count), (*C.GLdouble)(unsafe.Pointer(value)))
+}
+
+// Specify the value of a uniform variable for the current program object
+func Uniform2f(location int32, v0 float32, v1 float32) {
+ C.glowUniform2f(gpUniform2f, (C.GLint)(location), (C.GLfloat)(v0), (C.GLfloat)(v1))
+}
+
+// Specify the value of a uniform variable for the current program object
+func Uniform2fv(location int32, count int32, value *float32) {
+ C.glowUniform2fv(gpUniform2fv, (C.GLint)(location), (C.GLsizei)(count), (*C.GLfloat)(unsafe.Pointer(value)))
+}
+
+// Specify the value of a uniform variable for the current program object
+func Uniform2i(location int32, v0 int32, v1 int32) {
+ C.glowUniform2i(gpUniform2i, (C.GLint)(location), (C.GLint)(v0), (C.GLint)(v1))
+}
+func Uniform2i64ARB(location int32, x int64, y int64) {
+ C.glowUniform2i64ARB(gpUniform2i64ARB, (C.GLint)(location), (C.GLint64)(x), (C.GLint64)(y))
+}
+func Uniform2i64NV(location int32, x int64, y int64) {
+ C.glowUniform2i64NV(gpUniform2i64NV, (C.GLint)(location), (C.GLint64EXT)(x), (C.GLint64EXT)(y))
+}
+func Uniform2i64vARB(location int32, count int32, value *int64) {
+ C.glowUniform2i64vARB(gpUniform2i64vARB, (C.GLint)(location), (C.GLsizei)(count), (*C.GLint64)(unsafe.Pointer(value)))
+}
+func Uniform2i64vNV(location int32, count int32, value *int64) {
+ C.glowUniform2i64vNV(gpUniform2i64vNV, (C.GLint)(location), (C.GLsizei)(count), (*C.GLint64EXT)(unsafe.Pointer(value)))
+}
+
+// Specify the value of a uniform variable for the current program object
+func Uniform2iv(location int32, count int32, value *int32) {
+ C.glowUniform2iv(gpUniform2iv, (C.GLint)(location), (C.GLsizei)(count), (*C.GLint)(unsafe.Pointer(value)))
+}
+
+// Specify the value of a uniform variable for the current program object
+func Uniform2ui(location int32, v0 uint32, v1 uint32) {
+ C.glowUniform2ui(gpUniform2ui, (C.GLint)(location), (C.GLuint)(v0), (C.GLuint)(v1))
+}
+func Uniform2ui64ARB(location int32, x uint64, y uint64) {
+ C.glowUniform2ui64ARB(gpUniform2ui64ARB, (C.GLint)(location), (C.GLuint64)(x), (C.GLuint64)(y))
+}
+func Uniform2ui64NV(location int32, x uint64, y uint64) {
+ C.glowUniform2ui64NV(gpUniform2ui64NV, (C.GLint)(location), (C.GLuint64EXT)(x), (C.GLuint64EXT)(y))
+}
+func Uniform2ui64vARB(location int32, count int32, value *uint64) {
+ C.glowUniform2ui64vARB(gpUniform2ui64vARB, (C.GLint)(location), (C.GLsizei)(count), (*C.GLuint64)(unsafe.Pointer(value)))
+}
+func Uniform2ui64vNV(location int32, count int32, value *uint64) {
+ C.glowUniform2ui64vNV(gpUniform2ui64vNV, (C.GLint)(location), (C.GLsizei)(count), (*C.GLuint64EXT)(unsafe.Pointer(value)))
+}
+
+// Specify the value of a uniform variable for the current program object
+func Uniform2uiv(location int32, count int32, value *uint32) {
+ C.glowUniform2uiv(gpUniform2uiv, (C.GLint)(location), (C.GLsizei)(count), (*C.GLuint)(unsafe.Pointer(value)))
+}
+func Uniform3d(location int32, x float64, y float64, z float64) {
+ C.glowUniform3d(gpUniform3d, (C.GLint)(location), (C.GLdouble)(x), (C.GLdouble)(y), (C.GLdouble)(z))
+}
+func Uniform3dv(location int32, count int32, value *float64) {
+ C.glowUniform3dv(gpUniform3dv, (C.GLint)(location), (C.GLsizei)(count), (*C.GLdouble)(unsafe.Pointer(value)))
+}
+
+// Specify the value of a uniform variable for the current program object
+func Uniform3f(location int32, v0 float32, v1 float32, v2 float32) {
+ C.glowUniform3f(gpUniform3f, (C.GLint)(location), (C.GLfloat)(v0), (C.GLfloat)(v1), (C.GLfloat)(v2))
+}
+
+// Specify the value of a uniform variable for the current program object
+func Uniform3fv(location int32, count int32, value *float32) {
+ C.glowUniform3fv(gpUniform3fv, (C.GLint)(location), (C.GLsizei)(count), (*C.GLfloat)(unsafe.Pointer(value)))
+}
+
+// Specify the value of a uniform variable for the current program object
+func Uniform3i(location int32, v0 int32, v1 int32, v2 int32) {
+ C.glowUniform3i(gpUniform3i, (C.GLint)(location), (C.GLint)(v0), (C.GLint)(v1), (C.GLint)(v2))
+}
+func Uniform3i64ARB(location int32, x int64, y int64, z int64) {
+ C.glowUniform3i64ARB(gpUniform3i64ARB, (C.GLint)(location), (C.GLint64)(x), (C.GLint64)(y), (C.GLint64)(z))
+}
+func Uniform3i64NV(location int32, x int64, y int64, z int64) {
+ C.glowUniform3i64NV(gpUniform3i64NV, (C.GLint)(location), (C.GLint64EXT)(x), (C.GLint64EXT)(y), (C.GLint64EXT)(z))
+}
+func Uniform3i64vARB(location int32, count int32, value *int64) {
+ C.glowUniform3i64vARB(gpUniform3i64vARB, (C.GLint)(location), (C.GLsizei)(count), (*C.GLint64)(unsafe.Pointer(value)))
+}
+func Uniform3i64vNV(location int32, count int32, value *int64) {
+ C.glowUniform3i64vNV(gpUniform3i64vNV, (C.GLint)(location), (C.GLsizei)(count), (*C.GLint64EXT)(unsafe.Pointer(value)))
+}
+
+// Specify the value of a uniform variable for the current program object
+func Uniform3iv(location int32, count int32, value *int32) {
+ C.glowUniform3iv(gpUniform3iv, (C.GLint)(location), (C.GLsizei)(count), (*C.GLint)(unsafe.Pointer(value)))
+}
+
+// Specify the value of a uniform variable for the current program object
+func Uniform3ui(location int32, v0 uint32, v1 uint32, v2 uint32) {
+ C.glowUniform3ui(gpUniform3ui, (C.GLint)(location), (C.GLuint)(v0), (C.GLuint)(v1), (C.GLuint)(v2))
+}
+func Uniform3ui64ARB(location int32, x uint64, y uint64, z uint64) {
+ C.glowUniform3ui64ARB(gpUniform3ui64ARB, (C.GLint)(location), (C.GLuint64)(x), (C.GLuint64)(y), (C.GLuint64)(z))
+}
+func Uniform3ui64NV(location int32, x uint64, y uint64, z uint64) {
+ C.glowUniform3ui64NV(gpUniform3ui64NV, (C.GLint)(location), (C.GLuint64EXT)(x), (C.GLuint64EXT)(y), (C.GLuint64EXT)(z))
+}
+func Uniform3ui64vARB(location int32, count int32, value *uint64) {
+ C.glowUniform3ui64vARB(gpUniform3ui64vARB, (C.GLint)(location), (C.GLsizei)(count), (*C.GLuint64)(unsafe.Pointer(value)))
+}
+func Uniform3ui64vNV(location int32, count int32, value *uint64) {
+ C.glowUniform3ui64vNV(gpUniform3ui64vNV, (C.GLint)(location), (C.GLsizei)(count), (*C.GLuint64EXT)(unsafe.Pointer(value)))
+}
+
+// Specify the value of a uniform variable for the current program object
+func Uniform3uiv(location int32, count int32, value *uint32) {
+ C.glowUniform3uiv(gpUniform3uiv, (C.GLint)(location), (C.GLsizei)(count), (*C.GLuint)(unsafe.Pointer(value)))
+}
+func Uniform4d(location int32, x float64, y float64, z float64, w float64) {
+ C.glowUniform4d(gpUniform4d, (C.GLint)(location), (C.GLdouble)(x), (C.GLdouble)(y), (C.GLdouble)(z), (C.GLdouble)(w))
+}
+func Uniform4dv(location int32, count int32, value *float64) {
+ C.glowUniform4dv(gpUniform4dv, (C.GLint)(location), (C.GLsizei)(count), (*C.GLdouble)(unsafe.Pointer(value)))
+}
+
+// Specify the value of a uniform variable for the current program object
+func Uniform4f(location int32, v0 float32, v1 float32, v2 float32, v3 float32) {
+ C.glowUniform4f(gpUniform4f, (C.GLint)(location), (C.GLfloat)(v0), (C.GLfloat)(v1), (C.GLfloat)(v2), (C.GLfloat)(v3))
+}
+
+// Specify the value of a uniform variable for the current program object
+func Uniform4fv(location int32, count int32, value *float32) {
+ C.glowUniform4fv(gpUniform4fv, (C.GLint)(location), (C.GLsizei)(count), (*C.GLfloat)(unsafe.Pointer(value)))
+}
+
+// Specify the value of a uniform variable for the current program object
+func Uniform4i(location int32, v0 int32, v1 int32, v2 int32, v3 int32) {
+ C.glowUniform4i(gpUniform4i, (C.GLint)(location), (C.GLint)(v0), (C.GLint)(v1), (C.GLint)(v2), (C.GLint)(v3))
+}
+func Uniform4i64ARB(location int32, x int64, y int64, z int64, w int64) {
+ C.glowUniform4i64ARB(gpUniform4i64ARB, (C.GLint)(location), (C.GLint64)(x), (C.GLint64)(y), (C.GLint64)(z), (C.GLint64)(w))
+}
+func Uniform4i64NV(location int32, x int64, y int64, z int64, w int64) {
+ C.glowUniform4i64NV(gpUniform4i64NV, (C.GLint)(location), (C.GLint64EXT)(x), (C.GLint64EXT)(y), (C.GLint64EXT)(z), (C.GLint64EXT)(w))
+}
+func Uniform4i64vARB(location int32, count int32, value *int64) {
+ C.glowUniform4i64vARB(gpUniform4i64vARB, (C.GLint)(location), (C.GLsizei)(count), (*C.GLint64)(unsafe.Pointer(value)))
+}
+func Uniform4i64vNV(location int32, count int32, value *int64) {
+ C.glowUniform4i64vNV(gpUniform4i64vNV, (C.GLint)(location), (C.GLsizei)(count), (*C.GLint64EXT)(unsafe.Pointer(value)))
+}
+
+// Specify the value of a uniform variable for the current program object
+func Uniform4iv(location int32, count int32, value *int32) {
+ C.glowUniform4iv(gpUniform4iv, (C.GLint)(location), (C.GLsizei)(count), (*C.GLint)(unsafe.Pointer(value)))
+}
+
+// Specify the value of a uniform variable for the current program object
+func Uniform4ui(location int32, v0 uint32, v1 uint32, v2 uint32, v3 uint32) {
+ C.glowUniform4ui(gpUniform4ui, (C.GLint)(location), (C.GLuint)(v0), (C.GLuint)(v1), (C.GLuint)(v2), (C.GLuint)(v3))
+}
+func Uniform4ui64ARB(location int32, x uint64, y uint64, z uint64, w uint64) {
+ C.glowUniform4ui64ARB(gpUniform4ui64ARB, (C.GLint)(location), (C.GLuint64)(x), (C.GLuint64)(y), (C.GLuint64)(z), (C.GLuint64)(w))
+}
+func Uniform4ui64NV(location int32, x uint64, y uint64, z uint64, w uint64) {
+ C.glowUniform4ui64NV(gpUniform4ui64NV, (C.GLint)(location), (C.GLuint64EXT)(x), (C.GLuint64EXT)(y), (C.GLuint64EXT)(z), (C.GLuint64EXT)(w))
+}
+func Uniform4ui64vARB(location int32, count int32, value *uint64) {
+ C.glowUniform4ui64vARB(gpUniform4ui64vARB, (C.GLint)(location), (C.GLsizei)(count), (*C.GLuint64)(unsafe.Pointer(value)))
+}
+func Uniform4ui64vNV(location int32, count int32, value *uint64) {
+ C.glowUniform4ui64vNV(gpUniform4ui64vNV, (C.GLint)(location), (C.GLsizei)(count), (*C.GLuint64EXT)(unsafe.Pointer(value)))
+}
+
+// Specify the value of a uniform variable for the current program object
+func Uniform4uiv(location int32, count int32, value *uint32) {
+ C.glowUniform4uiv(gpUniform4uiv, (C.GLint)(location), (C.GLsizei)(count), (*C.GLuint)(unsafe.Pointer(value)))
+}
+
+// assign a binding point to an active uniform block
+func UniformBlockBinding(program uint32, uniformBlockIndex uint32, uniformBlockBinding uint32) {
+ C.glowUniformBlockBinding(gpUniformBlockBinding, (C.GLuint)(program), (C.GLuint)(uniformBlockIndex), (C.GLuint)(uniformBlockBinding))
+}
+func UniformHandleui64ARB(location int32, value uint64) {
+ C.glowUniformHandleui64ARB(gpUniformHandleui64ARB, (C.GLint)(location), (C.GLuint64)(value))
+}
+func UniformHandleui64NV(location int32, value uint64) {
+ C.glowUniformHandleui64NV(gpUniformHandleui64NV, (C.GLint)(location), (C.GLuint64)(value))
+}
+func UniformHandleui64vARB(location int32, count int32, value *uint64) {
+ C.glowUniformHandleui64vARB(gpUniformHandleui64vARB, (C.GLint)(location), (C.GLsizei)(count), (*C.GLuint64)(unsafe.Pointer(value)))
+}
+func UniformHandleui64vNV(location int32, count int32, value *uint64) {
+ C.glowUniformHandleui64vNV(gpUniformHandleui64vNV, (C.GLint)(location), (C.GLsizei)(count), (*C.GLuint64)(unsafe.Pointer(value)))
+}
+func UniformMatrix2dv(location int32, count int32, transpose bool, value *float64) {
+ C.glowUniformMatrix2dv(gpUniformMatrix2dv, (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLdouble)(unsafe.Pointer(value)))
+}
+
+// Specify the value of a uniform variable for the current program object
+func UniformMatrix2fv(location int32, count int32, transpose bool, value *float32) {
+ C.glowUniformMatrix2fv(gpUniformMatrix2fv, (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLfloat)(unsafe.Pointer(value)))
+}
+func UniformMatrix2x3dv(location int32, count int32, transpose bool, value *float64) {
+ C.glowUniformMatrix2x3dv(gpUniformMatrix2x3dv, (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLdouble)(unsafe.Pointer(value)))
+}
+
+// Specify the value of a uniform variable for the current program object
+func UniformMatrix2x3fv(location int32, count int32, transpose bool, value *float32) {
+ C.glowUniformMatrix2x3fv(gpUniformMatrix2x3fv, (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLfloat)(unsafe.Pointer(value)))
+}
+func UniformMatrix2x4dv(location int32, count int32, transpose bool, value *float64) {
+ C.glowUniformMatrix2x4dv(gpUniformMatrix2x4dv, (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLdouble)(unsafe.Pointer(value)))
+}
+
+// Specify the value of a uniform variable for the current program object
+func UniformMatrix2x4fv(location int32, count int32, transpose bool, value *float32) {
+ C.glowUniformMatrix2x4fv(gpUniformMatrix2x4fv, (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLfloat)(unsafe.Pointer(value)))
+}
+func UniformMatrix3dv(location int32, count int32, transpose bool, value *float64) {
+ C.glowUniformMatrix3dv(gpUniformMatrix3dv, (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLdouble)(unsafe.Pointer(value)))
+}
+
+// Specify the value of a uniform variable for the current program object
+func UniformMatrix3fv(location int32, count int32, transpose bool, value *float32) {
+ C.glowUniformMatrix3fv(gpUniformMatrix3fv, (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLfloat)(unsafe.Pointer(value)))
+}
+func UniformMatrix3x2dv(location int32, count int32, transpose bool, value *float64) {
+ C.glowUniformMatrix3x2dv(gpUniformMatrix3x2dv, (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLdouble)(unsafe.Pointer(value)))
+}
+
+// Specify the value of a uniform variable for the current program object
+func UniformMatrix3x2fv(location int32, count int32, transpose bool, value *float32) {
+ C.glowUniformMatrix3x2fv(gpUniformMatrix3x2fv, (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLfloat)(unsafe.Pointer(value)))
+}
+func UniformMatrix3x4dv(location int32, count int32, transpose bool, value *float64) {
+ C.glowUniformMatrix3x4dv(gpUniformMatrix3x4dv, (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLdouble)(unsafe.Pointer(value)))
+}
+
+// Specify the value of a uniform variable for the current program object
+func UniformMatrix3x4fv(location int32, count int32, transpose bool, value *float32) {
+ C.glowUniformMatrix3x4fv(gpUniformMatrix3x4fv, (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLfloat)(unsafe.Pointer(value)))
+}
+func UniformMatrix4dv(location int32, count int32, transpose bool, value *float64) {
+ C.glowUniformMatrix4dv(gpUniformMatrix4dv, (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLdouble)(unsafe.Pointer(value)))
+}
+
+// Specify the value of a uniform variable for the current program object
+func UniformMatrix4fv(location int32, count int32, transpose bool, value *float32) {
+ C.glowUniformMatrix4fv(gpUniformMatrix4fv, (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLfloat)(unsafe.Pointer(value)))
+}
+func UniformMatrix4x2dv(location int32, count int32, transpose bool, value *float64) {
+ C.glowUniformMatrix4x2dv(gpUniformMatrix4x2dv, (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLdouble)(unsafe.Pointer(value)))
+}
+
+// Specify the value of a uniform variable for the current program object
+func UniformMatrix4x2fv(location int32, count int32, transpose bool, value *float32) {
+ C.glowUniformMatrix4x2fv(gpUniformMatrix4x2fv, (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLfloat)(unsafe.Pointer(value)))
+}
+func UniformMatrix4x3dv(location int32, count int32, transpose bool, value *float64) {
+ C.glowUniformMatrix4x3dv(gpUniformMatrix4x3dv, (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLdouble)(unsafe.Pointer(value)))
+}
+
+// Specify the value of a uniform variable for the current program object
+func UniformMatrix4x3fv(location int32, count int32, transpose bool, value *float32) {
+ C.glowUniformMatrix4x3fv(gpUniformMatrix4x3fv, (C.GLint)(location), (C.GLsizei)(count), (C.GLboolean)(boolToInt(transpose)), (*C.GLfloat)(unsafe.Pointer(value)))
+}
+func UniformSubroutinesuiv(shadertype uint32, count int32, indices *uint32) {
+ C.glowUniformSubroutinesuiv(gpUniformSubroutinesuiv, (C.GLenum)(shadertype), (C.GLsizei)(count), (*C.GLuint)(unsafe.Pointer(indices)))
+}
+func Uniformui64NV(location int32, value uint64) {
+ C.glowUniformui64NV(gpUniformui64NV, (C.GLint)(location), (C.GLuint64EXT)(value))
+}
+func Uniformui64vNV(location int32, count int32, value *uint64) {
+ C.glowUniformui64vNV(gpUniformui64vNV, (C.GLint)(location), (C.GLsizei)(count), (*C.GLuint64EXT)(unsafe.Pointer(value)))
+}
+
+// release the mapping of a buffer object's data store into the client's address space
+func UnmapBuffer(target uint32) bool {
+ ret := C.glowUnmapBuffer(gpUnmapBuffer, (C.GLenum)(target))
+ return ret == TRUE
+}
+
+// release the mapping of a buffer object's data store into the client's address space
+func UnmapNamedBuffer(buffer uint32) bool {
+ ret := C.glowUnmapNamedBuffer(gpUnmapNamedBuffer, (C.GLuint)(buffer))
+ return ret == TRUE
+}
+func UnmapNamedBufferEXT(buffer uint32) bool {
+ ret := C.glowUnmapNamedBufferEXT(gpUnmapNamedBufferEXT, (C.GLuint)(buffer))
+ return ret == TRUE
+}
+
+// Installs a program object as part of current rendering state
+func UseProgram(program uint32) {
+ C.glowUseProgram(gpUseProgram, (C.GLuint)(program))
+}
+
+// bind stages of a program object to a program pipeline
+func UseProgramStages(pipeline uint32, stages uint32, program uint32) {
+ C.glowUseProgramStages(gpUseProgramStages, (C.GLuint)(pipeline), (C.GLbitfield)(stages), (C.GLuint)(program))
+}
+func UseProgramStagesEXT(pipeline uint32, stages uint32, program uint32) {
+ C.glowUseProgramStagesEXT(gpUseProgramStagesEXT, (C.GLuint)(pipeline), (C.GLbitfield)(stages), (C.GLuint)(program))
+}
+func UseShaderProgramEXT(xtype uint32, program uint32) {
+ C.glowUseShaderProgramEXT(gpUseShaderProgramEXT, (C.GLenum)(xtype), (C.GLuint)(program))
+}
+
+// Validates a program object
+func ValidateProgram(program uint32) {
+ C.glowValidateProgram(gpValidateProgram, (C.GLuint)(program))
+}
+
+// validate a program pipeline object against current GL state
+func ValidateProgramPipeline(pipeline uint32) {
+ C.glowValidateProgramPipeline(gpValidateProgramPipeline, (C.GLuint)(pipeline))
+}
+func ValidateProgramPipelineEXT(pipeline uint32) {
+ C.glowValidateProgramPipelineEXT(gpValidateProgramPipelineEXT, (C.GLuint)(pipeline))
+}
+func VertexArrayAttribBinding(vaobj uint32, attribindex uint32, bindingindex uint32) {
+ C.glowVertexArrayAttribBinding(gpVertexArrayAttribBinding, (C.GLuint)(vaobj), (C.GLuint)(attribindex), (C.GLuint)(bindingindex))
+}
+
+// specify the organization of vertex arrays
+func VertexArrayAttribFormat(vaobj uint32, attribindex uint32, size int32, xtype uint32, normalized bool, relativeoffset uint32) {
+ C.glowVertexArrayAttribFormat(gpVertexArrayAttribFormat, (C.GLuint)(vaobj), (C.GLuint)(attribindex), (C.GLint)(size), (C.GLenum)(xtype), (C.GLboolean)(boolToInt(normalized)), (C.GLuint)(relativeoffset))
+}
+func VertexArrayAttribIFormat(vaobj uint32, attribindex uint32, size int32, xtype uint32, relativeoffset uint32) {
+ C.glowVertexArrayAttribIFormat(gpVertexArrayAttribIFormat, (C.GLuint)(vaobj), (C.GLuint)(attribindex), (C.GLint)(size), (C.GLenum)(xtype), (C.GLuint)(relativeoffset))
+}
+func VertexArrayAttribLFormat(vaobj uint32, attribindex uint32, size int32, xtype uint32, relativeoffset uint32) {
+ C.glowVertexArrayAttribLFormat(gpVertexArrayAttribLFormat, (C.GLuint)(vaobj), (C.GLuint)(attribindex), (C.GLint)(size), (C.GLenum)(xtype), (C.GLuint)(relativeoffset))
+}
+func VertexArrayBindVertexBufferEXT(vaobj uint32, bindingindex uint32, buffer uint32, offset int, stride int32) {
+ C.glowVertexArrayBindVertexBufferEXT(gpVertexArrayBindVertexBufferEXT, (C.GLuint)(vaobj), (C.GLuint)(bindingindex), (C.GLuint)(buffer), (C.GLintptr)(offset), (C.GLsizei)(stride))
+}
+
+// modify the rate at which generic vertex attributes advance
+func VertexArrayBindingDivisor(vaobj uint32, bindingindex uint32, divisor uint32) {
+ C.glowVertexArrayBindingDivisor(gpVertexArrayBindingDivisor, (C.GLuint)(vaobj), (C.GLuint)(bindingindex), (C.GLuint)(divisor))
+}
+func VertexArrayColorOffsetEXT(vaobj uint32, buffer uint32, size int32, xtype uint32, stride int32, offset int) {
+ C.glowVertexArrayColorOffsetEXT(gpVertexArrayColorOffsetEXT, (C.GLuint)(vaobj), (C.GLuint)(buffer), (C.GLint)(size), (C.GLenum)(xtype), (C.GLsizei)(stride), (C.GLintptr)(offset))
+}
+func VertexArrayEdgeFlagOffsetEXT(vaobj uint32, buffer uint32, stride int32, offset int) {
+ C.glowVertexArrayEdgeFlagOffsetEXT(gpVertexArrayEdgeFlagOffsetEXT, (C.GLuint)(vaobj), (C.GLuint)(buffer), (C.GLsizei)(stride), (C.GLintptr)(offset))
+}
+
+// configures element array buffer binding of a vertex array object
+func VertexArrayElementBuffer(vaobj uint32, buffer uint32) {
+ C.glowVertexArrayElementBuffer(gpVertexArrayElementBuffer, (C.GLuint)(vaobj), (C.GLuint)(buffer))
+}
+func VertexArrayFogCoordOffsetEXT(vaobj uint32, buffer uint32, xtype uint32, stride int32, offset int) {
+ C.glowVertexArrayFogCoordOffsetEXT(gpVertexArrayFogCoordOffsetEXT, (C.GLuint)(vaobj), (C.GLuint)(buffer), (C.GLenum)(xtype), (C.GLsizei)(stride), (C.GLintptr)(offset))
+}
+func VertexArrayIndexOffsetEXT(vaobj uint32, buffer uint32, xtype uint32, stride int32, offset int) {
+ C.glowVertexArrayIndexOffsetEXT(gpVertexArrayIndexOffsetEXT, (C.GLuint)(vaobj), (C.GLuint)(buffer), (C.GLenum)(xtype), (C.GLsizei)(stride), (C.GLintptr)(offset))
+}
+func VertexArrayMultiTexCoordOffsetEXT(vaobj uint32, buffer uint32, texunit uint32, size int32, xtype uint32, stride int32, offset int) {
+ C.glowVertexArrayMultiTexCoordOffsetEXT(gpVertexArrayMultiTexCoordOffsetEXT, (C.GLuint)(vaobj), (C.GLuint)(buffer), (C.GLenum)(texunit), (C.GLint)(size), (C.GLenum)(xtype), (C.GLsizei)(stride), (C.GLintptr)(offset))
+}
+func VertexArrayNormalOffsetEXT(vaobj uint32, buffer uint32, xtype uint32, stride int32, offset int) {
+ C.glowVertexArrayNormalOffsetEXT(gpVertexArrayNormalOffsetEXT, (C.GLuint)(vaobj), (C.GLuint)(buffer), (C.GLenum)(xtype), (C.GLsizei)(stride), (C.GLintptr)(offset))
+}
+func VertexArraySecondaryColorOffsetEXT(vaobj uint32, buffer uint32, size int32, xtype uint32, stride int32, offset int) {
+ C.glowVertexArraySecondaryColorOffsetEXT(gpVertexArraySecondaryColorOffsetEXT, (C.GLuint)(vaobj), (C.GLuint)(buffer), (C.GLint)(size), (C.GLenum)(xtype), (C.GLsizei)(stride), (C.GLintptr)(offset))
+}
+func VertexArrayTexCoordOffsetEXT(vaobj uint32, buffer uint32, size int32, xtype uint32, stride int32, offset int) {
+ C.glowVertexArrayTexCoordOffsetEXT(gpVertexArrayTexCoordOffsetEXT, (C.GLuint)(vaobj), (C.GLuint)(buffer), (C.GLint)(size), (C.GLenum)(xtype), (C.GLsizei)(stride), (C.GLintptr)(offset))
+}
+func VertexArrayVertexAttribBindingEXT(vaobj uint32, attribindex uint32, bindingindex uint32) {
+ C.glowVertexArrayVertexAttribBindingEXT(gpVertexArrayVertexAttribBindingEXT, (C.GLuint)(vaobj), (C.GLuint)(attribindex), (C.GLuint)(bindingindex))
+}
+func VertexArrayVertexAttribDivisorEXT(vaobj uint32, index uint32, divisor uint32) {
+ C.glowVertexArrayVertexAttribDivisorEXT(gpVertexArrayVertexAttribDivisorEXT, (C.GLuint)(vaobj), (C.GLuint)(index), (C.GLuint)(divisor))
+}
+func VertexArrayVertexAttribFormatEXT(vaobj uint32, attribindex uint32, size int32, xtype uint32, normalized bool, relativeoffset uint32) {
+ C.glowVertexArrayVertexAttribFormatEXT(gpVertexArrayVertexAttribFormatEXT, (C.GLuint)(vaobj), (C.GLuint)(attribindex), (C.GLint)(size), (C.GLenum)(xtype), (C.GLboolean)(boolToInt(normalized)), (C.GLuint)(relativeoffset))
+}
+func VertexArrayVertexAttribIFormatEXT(vaobj uint32, attribindex uint32, size int32, xtype uint32, relativeoffset uint32) {
+ C.glowVertexArrayVertexAttribIFormatEXT(gpVertexArrayVertexAttribIFormatEXT, (C.GLuint)(vaobj), (C.GLuint)(attribindex), (C.GLint)(size), (C.GLenum)(xtype), (C.GLuint)(relativeoffset))
+}
+func VertexArrayVertexAttribIOffsetEXT(vaobj uint32, buffer uint32, index uint32, size int32, xtype uint32, stride int32, offset int) {
+ C.glowVertexArrayVertexAttribIOffsetEXT(gpVertexArrayVertexAttribIOffsetEXT, (C.GLuint)(vaobj), (C.GLuint)(buffer), (C.GLuint)(index), (C.GLint)(size), (C.GLenum)(xtype), (C.GLsizei)(stride), (C.GLintptr)(offset))
+}
+func VertexArrayVertexAttribLFormatEXT(vaobj uint32, attribindex uint32, size int32, xtype uint32, relativeoffset uint32) {
+ C.glowVertexArrayVertexAttribLFormatEXT(gpVertexArrayVertexAttribLFormatEXT, (C.GLuint)(vaobj), (C.GLuint)(attribindex), (C.GLint)(size), (C.GLenum)(xtype), (C.GLuint)(relativeoffset))
+}
+func VertexArrayVertexAttribLOffsetEXT(vaobj uint32, buffer uint32, index uint32, size int32, xtype uint32, stride int32, offset int) {
+ C.glowVertexArrayVertexAttribLOffsetEXT(gpVertexArrayVertexAttribLOffsetEXT, (C.GLuint)(vaobj), (C.GLuint)(buffer), (C.GLuint)(index), (C.GLint)(size), (C.GLenum)(xtype), (C.GLsizei)(stride), (C.GLintptr)(offset))
+}
+func VertexArrayVertexAttribOffsetEXT(vaobj uint32, buffer uint32, index uint32, size int32, xtype uint32, normalized bool, stride int32, offset int) {
+ C.glowVertexArrayVertexAttribOffsetEXT(gpVertexArrayVertexAttribOffsetEXT, (C.GLuint)(vaobj), (C.GLuint)(buffer), (C.GLuint)(index), (C.GLint)(size), (C.GLenum)(xtype), (C.GLboolean)(boolToInt(normalized)), (C.GLsizei)(stride), (C.GLintptr)(offset))
+}
+func VertexArrayVertexBindingDivisorEXT(vaobj uint32, bindingindex uint32, divisor uint32) {
+ C.glowVertexArrayVertexBindingDivisorEXT(gpVertexArrayVertexBindingDivisorEXT, (C.GLuint)(vaobj), (C.GLuint)(bindingindex), (C.GLuint)(divisor))
+}
+
+// bind a buffer to a vertex buffer bind point
+func VertexArrayVertexBuffer(vaobj uint32, bindingindex uint32, buffer uint32, offset int, stride int32) {
+ C.glowVertexArrayVertexBuffer(gpVertexArrayVertexBuffer, (C.GLuint)(vaobj), (C.GLuint)(bindingindex), (C.GLuint)(buffer), (C.GLintptr)(offset), (C.GLsizei)(stride))
+}
+
+// attach multiple buffer objects to a vertex array object
+func VertexArrayVertexBuffers(vaobj uint32, first uint32, count int32, buffers *uint32, offsets *int, strides *int32) {
+ C.glowVertexArrayVertexBuffers(gpVertexArrayVertexBuffers, (C.GLuint)(vaobj), (C.GLuint)(first), (C.GLsizei)(count), (*C.GLuint)(unsafe.Pointer(buffers)), (*C.GLintptr)(unsafe.Pointer(offsets)), (*C.GLsizei)(unsafe.Pointer(strides)))
+}
+func VertexArrayVertexOffsetEXT(vaobj uint32, buffer uint32, size int32, xtype uint32, stride int32, offset int) {
+ C.glowVertexArrayVertexOffsetEXT(gpVertexArrayVertexOffsetEXT, (C.GLuint)(vaobj), (C.GLuint)(buffer), (C.GLint)(size), (C.GLenum)(xtype), (C.GLsizei)(stride), (C.GLintptr)(offset))
+}
+func VertexAttrib1d(index uint32, x float64) {
+ C.glowVertexAttrib1d(gpVertexAttrib1d, (C.GLuint)(index), (C.GLdouble)(x))
+}
+func VertexAttrib1dv(index uint32, v *float64) {
+ C.glowVertexAttrib1dv(gpVertexAttrib1dv, (C.GLuint)(index), (*C.GLdouble)(unsafe.Pointer(v)))
+}
+func VertexAttrib1f(index uint32, x float32) {
+ C.glowVertexAttrib1f(gpVertexAttrib1f, (C.GLuint)(index), (C.GLfloat)(x))
+}
+func VertexAttrib1fv(index uint32, v *float32) {
+ C.glowVertexAttrib1fv(gpVertexAttrib1fv, (C.GLuint)(index), (*C.GLfloat)(unsafe.Pointer(v)))
+}
+func VertexAttrib1s(index uint32, x int16) {
+ C.glowVertexAttrib1s(gpVertexAttrib1s, (C.GLuint)(index), (C.GLshort)(x))
+}
+func VertexAttrib1sv(index uint32, v *int16) {
+ C.glowVertexAttrib1sv(gpVertexAttrib1sv, (C.GLuint)(index), (*C.GLshort)(unsafe.Pointer(v)))
+}
+func VertexAttrib2d(index uint32, x float64, y float64) {
+ C.glowVertexAttrib2d(gpVertexAttrib2d, (C.GLuint)(index), (C.GLdouble)(x), (C.GLdouble)(y))
+}
+func VertexAttrib2dv(index uint32, v *float64) {
+ C.glowVertexAttrib2dv(gpVertexAttrib2dv, (C.GLuint)(index), (*C.GLdouble)(unsafe.Pointer(v)))
+}
+func VertexAttrib2f(index uint32, x float32, y float32) {
+ C.glowVertexAttrib2f(gpVertexAttrib2f, (C.GLuint)(index), (C.GLfloat)(x), (C.GLfloat)(y))
+}
+func VertexAttrib2fv(index uint32, v *float32) {
+ C.glowVertexAttrib2fv(gpVertexAttrib2fv, (C.GLuint)(index), (*C.GLfloat)(unsafe.Pointer(v)))
+}
+func VertexAttrib2s(index uint32, x int16, y int16) {
+ C.glowVertexAttrib2s(gpVertexAttrib2s, (C.GLuint)(index), (C.GLshort)(x), (C.GLshort)(y))
+}
+func VertexAttrib2sv(index uint32, v *int16) {
+ C.glowVertexAttrib2sv(gpVertexAttrib2sv, (C.GLuint)(index), (*C.GLshort)(unsafe.Pointer(v)))
+}
+func VertexAttrib3d(index uint32, x float64, y float64, z float64) {
+ C.glowVertexAttrib3d(gpVertexAttrib3d, (C.GLuint)(index), (C.GLdouble)(x), (C.GLdouble)(y), (C.GLdouble)(z))
+}
+func VertexAttrib3dv(index uint32, v *float64) {
+ C.glowVertexAttrib3dv(gpVertexAttrib3dv, (C.GLuint)(index), (*C.GLdouble)(unsafe.Pointer(v)))
+}
+func VertexAttrib3f(index uint32, x float32, y float32, z float32) {
+ C.glowVertexAttrib3f(gpVertexAttrib3f, (C.GLuint)(index), (C.GLfloat)(x), (C.GLfloat)(y), (C.GLfloat)(z))
+}
+func VertexAttrib3fv(index uint32, v *float32) {
+ C.glowVertexAttrib3fv(gpVertexAttrib3fv, (C.GLuint)(index), (*C.GLfloat)(unsafe.Pointer(v)))
+}
+func VertexAttrib3s(index uint32, x int16, y int16, z int16) {
+ C.glowVertexAttrib3s(gpVertexAttrib3s, (C.GLuint)(index), (C.GLshort)(x), (C.GLshort)(y), (C.GLshort)(z))
+}
+func VertexAttrib3sv(index uint32, v *int16) {
+ C.glowVertexAttrib3sv(gpVertexAttrib3sv, (C.GLuint)(index), (*C.GLshort)(unsafe.Pointer(v)))
+}
+func VertexAttrib4Nbv(index uint32, v *int8) {
+ C.glowVertexAttrib4Nbv(gpVertexAttrib4Nbv, (C.GLuint)(index), (*C.GLbyte)(unsafe.Pointer(v)))
+}
+func VertexAttrib4Niv(index uint32, v *int32) {
+ C.glowVertexAttrib4Niv(gpVertexAttrib4Niv, (C.GLuint)(index), (*C.GLint)(unsafe.Pointer(v)))
+}
+func VertexAttrib4Nsv(index uint32, v *int16) {
+ C.glowVertexAttrib4Nsv(gpVertexAttrib4Nsv, (C.GLuint)(index), (*C.GLshort)(unsafe.Pointer(v)))
+}
+func VertexAttrib4Nub(index uint32, x uint8, y uint8, z uint8, w uint8) {
+ C.glowVertexAttrib4Nub(gpVertexAttrib4Nub, (C.GLuint)(index), (C.GLubyte)(x), (C.GLubyte)(y), (C.GLubyte)(z), (C.GLubyte)(w))
+}
+func VertexAttrib4Nubv(index uint32, v *uint8) {
+ C.glowVertexAttrib4Nubv(gpVertexAttrib4Nubv, (C.GLuint)(index), (*C.GLubyte)(unsafe.Pointer(v)))
+}
+func VertexAttrib4Nuiv(index uint32, v *uint32) {
+ C.glowVertexAttrib4Nuiv(gpVertexAttrib4Nuiv, (C.GLuint)(index), (*C.GLuint)(unsafe.Pointer(v)))
+}
+func VertexAttrib4Nusv(index uint32, v *uint16) {
+ C.glowVertexAttrib4Nusv(gpVertexAttrib4Nusv, (C.GLuint)(index), (*C.GLushort)(unsafe.Pointer(v)))
+}
+func VertexAttrib4bv(index uint32, v *int8) {
+ C.glowVertexAttrib4bv(gpVertexAttrib4bv, (C.GLuint)(index), (*C.GLbyte)(unsafe.Pointer(v)))
+}
+func VertexAttrib4d(index uint32, x float64, y float64, z float64, w float64) {
+ C.glowVertexAttrib4d(gpVertexAttrib4d, (C.GLuint)(index), (C.GLdouble)(x), (C.GLdouble)(y), (C.GLdouble)(z), (C.GLdouble)(w))
+}
+func VertexAttrib4dv(index uint32, v *float64) {
+ C.glowVertexAttrib4dv(gpVertexAttrib4dv, (C.GLuint)(index), (*C.GLdouble)(unsafe.Pointer(v)))
+}
+func VertexAttrib4f(index uint32, x float32, y float32, z float32, w float32) {
+ C.glowVertexAttrib4f(gpVertexAttrib4f, (C.GLuint)(index), (C.GLfloat)(x), (C.GLfloat)(y), (C.GLfloat)(z), (C.GLfloat)(w))
+}
+func VertexAttrib4fv(index uint32, v *float32) {
+ C.glowVertexAttrib4fv(gpVertexAttrib4fv, (C.GLuint)(index), (*C.GLfloat)(unsafe.Pointer(v)))
+}
+func VertexAttrib4iv(index uint32, v *int32) {
+ C.glowVertexAttrib4iv(gpVertexAttrib4iv, (C.GLuint)(index), (*C.GLint)(unsafe.Pointer(v)))
+}
+func VertexAttrib4s(index uint32, x int16, y int16, z int16, w int16) {
+ C.glowVertexAttrib4s(gpVertexAttrib4s, (C.GLuint)(index), (C.GLshort)(x), (C.GLshort)(y), (C.GLshort)(z), (C.GLshort)(w))
+}
+func VertexAttrib4sv(index uint32, v *int16) {
+ C.glowVertexAttrib4sv(gpVertexAttrib4sv, (C.GLuint)(index), (*C.GLshort)(unsafe.Pointer(v)))
+}
+func VertexAttrib4ubv(index uint32, v *uint8) {
+ C.glowVertexAttrib4ubv(gpVertexAttrib4ubv, (C.GLuint)(index), (*C.GLubyte)(unsafe.Pointer(v)))
+}
+func VertexAttrib4uiv(index uint32, v *uint32) {
+ C.glowVertexAttrib4uiv(gpVertexAttrib4uiv, (C.GLuint)(index), (*C.GLuint)(unsafe.Pointer(v)))
+}
+func VertexAttrib4usv(index uint32, v *uint16) {
+ C.glowVertexAttrib4usv(gpVertexAttrib4usv, (C.GLuint)(index), (*C.GLushort)(unsafe.Pointer(v)))
+}
+
+// associate a vertex attribute and a vertex buffer binding for a vertex array object
+func VertexAttribBinding(attribindex uint32, bindingindex uint32) {
+ C.glowVertexAttribBinding(gpVertexAttribBinding, (C.GLuint)(attribindex), (C.GLuint)(bindingindex))
+}
+
+// modify the rate at which generic vertex attributes advance during instanced rendering
+func VertexAttribDivisor(index uint32, divisor uint32) {
+ C.glowVertexAttribDivisor(gpVertexAttribDivisor, (C.GLuint)(index), (C.GLuint)(divisor))
+}
+func VertexAttribDivisorARB(index uint32, divisor uint32) {
+ C.glowVertexAttribDivisorARB(gpVertexAttribDivisorARB, (C.GLuint)(index), (C.GLuint)(divisor))
+}
+
+// specify the organization of vertex arrays
+func VertexAttribFormat(attribindex uint32, size int32, xtype uint32, normalized bool, relativeoffset uint32) {
+ C.glowVertexAttribFormat(gpVertexAttribFormat, (C.GLuint)(attribindex), (C.GLint)(size), (C.GLenum)(xtype), (C.GLboolean)(boolToInt(normalized)), (C.GLuint)(relativeoffset))
+}
+func VertexAttribFormatNV(index uint32, size int32, xtype uint32, normalized bool, stride int32) {
+ C.glowVertexAttribFormatNV(gpVertexAttribFormatNV, (C.GLuint)(index), (C.GLint)(size), (C.GLenum)(xtype), (C.GLboolean)(boolToInt(normalized)), (C.GLsizei)(stride))
+}
+func VertexAttribI1i(index uint32, x int32) {
+ C.glowVertexAttribI1i(gpVertexAttribI1i, (C.GLuint)(index), (C.GLint)(x))
+}
+func VertexAttribI1iv(index uint32, v *int32) {
+ C.glowVertexAttribI1iv(gpVertexAttribI1iv, (C.GLuint)(index), (*C.GLint)(unsafe.Pointer(v)))
+}
+func VertexAttribI1ui(index uint32, x uint32) {
+ C.glowVertexAttribI1ui(gpVertexAttribI1ui, (C.GLuint)(index), (C.GLuint)(x))
+}
+func VertexAttribI1uiv(index uint32, v *uint32) {
+ C.glowVertexAttribI1uiv(gpVertexAttribI1uiv, (C.GLuint)(index), (*C.GLuint)(unsafe.Pointer(v)))
+}
+func VertexAttribI2i(index uint32, x int32, y int32) {
+ C.glowVertexAttribI2i(gpVertexAttribI2i, (C.GLuint)(index), (C.GLint)(x), (C.GLint)(y))
+}
+func VertexAttribI2iv(index uint32, v *int32) {
+ C.glowVertexAttribI2iv(gpVertexAttribI2iv, (C.GLuint)(index), (*C.GLint)(unsafe.Pointer(v)))
+}
+func VertexAttribI2ui(index uint32, x uint32, y uint32) {
+ C.glowVertexAttribI2ui(gpVertexAttribI2ui, (C.GLuint)(index), (C.GLuint)(x), (C.GLuint)(y))
+}
+func VertexAttribI2uiv(index uint32, v *uint32) {
+ C.glowVertexAttribI2uiv(gpVertexAttribI2uiv, (C.GLuint)(index), (*C.GLuint)(unsafe.Pointer(v)))
+}
+func VertexAttribI3i(index uint32, x int32, y int32, z int32) {
+ C.glowVertexAttribI3i(gpVertexAttribI3i, (C.GLuint)(index), (C.GLint)(x), (C.GLint)(y), (C.GLint)(z))
+}
+func VertexAttribI3iv(index uint32, v *int32) {
+ C.glowVertexAttribI3iv(gpVertexAttribI3iv, (C.GLuint)(index), (*C.GLint)(unsafe.Pointer(v)))
+}
+func VertexAttribI3ui(index uint32, x uint32, y uint32, z uint32) {
+ C.glowVertexAttribI3ui(gpVertexAttribI3ui, (C.GLuint)(index), (C.GLuint)(x), (C.GLuint)(y), (C.GLuint)(z))
+}
+func VertexAttribI3uiv(index uint32, v *uint32) {
+ C.glowVertexAttribI3uiv(gpVertexAttribI3uiv, (C.GLuint)(index), (*C.GLuint)(unsafe.Pointer(v)))
+}
+func VertexAttribI4bv(index uint32, v *int8) {
+ C.glowVertexAttribI4bv(gpVertexAttribI4bv, (C.GLuint)(index), (*C.GLbyte)(unsafe.Pointer(v)))
+}
+func VertexAttribI4i(index uint32, x int32, y int32, z int32, w int32) {
+ C.glowVertexAttribI4i(gpVertexAttribI4i, (C.GLuint)(index), (C.GLint)(x), (C.GLint)(y), (C.GLint)(z), (C.GLint)(w))
+}
+func VertexAttribI4iv(index uint32, v *int32) {
+ C.glowVertexAttribI4iv(gpVertexAttribI4iv, (C.GLuint)(index), (*C.GLint)(unsafe.Pointer(v)))
+}
+func VertexAttribI4sv(index uint32, v *int16) {
+ C.glowVertexAttribI4sv(gpVertexAttribI4sv, (C.GLuint)(index), (*C.GLshort)(unsafe.Pointer(v)))
+}
+func VertexAttribI4ubv(index uint32, v *uint8) {
+ C.glowVertexAttribI4ubv(gpVertexAttribI4ubv, (C.GLuint)(index), (*C.GLubyte)(unsafe.Pointer(v)))
+}
+func VertexAttribI4ui(index uint32, x uint32, y uint32, z uint32, w uint32) {
+ C.glowVertexAttribI4ui(gpVertexAttribI4ui, (C.GLuint)(index), (C.GLuint)(x), (C.GLuint)(y), (C.GLuint)(z), (C.GLuint)(w))
+}
+func VertexAttribI4uiv(index uint32, v *uint32) {
+ C.glowVertexAttribI4uiv(gpVertexAttribI4uiv, (C.GLuint)(index), (*C.GLuint)(unsafe.Pointer(v)))
+}
+func VertexAttribI4usv(index uint32, v *uint16) {
+ C.glowVertexAttribI4usv(gpVertexAttribI4usv, (C.GLuint)(index), (*C.GLushort)(unsafe.Pointer(v)))
+}
+func VertexAttribIFormat(attribindex uint32, size int32, xtype uint32, relativeoffset uint32) {
+ C.glowVertexAttribIFormat(gpVertexAttribIFormat, (C.GLuint)(attribindex), (C.GLint)(size), (C.GLenum)(xtype), (C.GLuint)(relativeoffset))
+}
+func VertexAttribIFormatNV(index uint32, size int32, xtype uint32, stride int32) {
+ C.glowVertexAttribIFormatNV(gpVertexAttribIFormatNV, (C.GLuint)(index), (C.GLint)(size), (C.GLenum)(xtype), (C.GLsizei)(stride))
+}
+func VertexAttribIPointer(index uint32, size int32, xtype uint32, stride int32, pointer unsafe.Pointer) {
+ C.glowVertexAttribIPointer(gpVertexAttribIPointer, (C.GLuint)(index), (C.GLint)(size), (C.GLenum)(xtype), (C.GLsizei)(stride), pointer)
+}
+func VertexAttribIPointerWithOffset(index uint32, size int32, xtype uint32, stride int32, offset uintptr) {
+ C.glowVertexAttribIPointerWithOffset(gpVertexAttribIPointer, (C.GLuint)(index), (C.GLint)(size), (C.GLenum)(xtype), (C.GLsizei)(stride), (C.uintptr_t)(offset))
+}
+func VertexAttribL1d(index uint32, x float64) {
+ C.glowVertexAttribL1d(gpVertexAttribL1d, (C.GLuint)(index), (C.GLdouble)(x))
+}
+func VertexAttribL1dv(index uint32, v *float64) {
+ C.glowVertexAttribL1dv(gpVertexAttribL1dv, (C.GLuint)(index), (*C.GLdouble)(unsafe.Pointer(v)))
+}
+func VertexAttribL1i64NV(index uint32, x int64) {
+ C.glowVertexAttribL1i64NV(gpVertexAttribL1i64NV, (C.GLuint)(index), (C.GLint64EXT)(x))
+}
+func VertexAttribL1i64vNV(index uint32, v *int64) {
+ C.glowVertexAttribL1i64vNV(gpVertexAttribL1i64vNV, (C.GLuint)(index), (*C.GLint64EXT)(unsafe.Pointer(v)))
+}
+func VertexAttribL1ui64ARB(index uint32, x uint64) {
+ C.glowVertexAttribL1ui64ARB(gpVertexAttribL1ui64ARB, (C.GLuint)(index), (C.GLuint64EXT)(x))
+}
+func VertexAttribL1ui64NV(index uint32, x uint64) {
+ C.glowVertexAttribL1ui64NV(gpVertexAttribL1ui64NV, (C.GLuint)(index), (C.GLuint64EXT)(x))
+}
+func VertexAttribL1ui64vARB(index uint32, v *uint64) {
+ C.glowVertexAttribL1ui64vARB(gpVertexAttribL1ui64vARB, (C.GLuint)(index), (*C.GLuint64EXT)(unsafe.Pointer(v)))
+}
+func VertexAttribL1ui64vNV(index uint32, v *uint64) {
+ C.glowVertexAttribL1ui64vNV(gpVertexAttribL1ui64vNV, (C.GLuint)(index), (*C.GLuint64EXT)(unsafe.Pointer(v)))
+}
+func VertexAttribL2d(index uint32, x float64, y float64) {
+ C.glowVertexAttribL2d(gpVertexAttribL2d, (C.GLuint)(index), (C.GLdouble)(x), (C.GLdouble)(y))
+}
+func VertexAttribL2dv(index uint32, v *float64) {
+ C.glowVertexAttribL2dv(gpVertexAttribL2dv, (C.GLuint)(index), (*C.GLdouble)(unsafe.Pointer(v)))
+}
+func VertexAttribL2i64NV(index uint32, x int64, y int64) {
+ C.glowVertexAttribL2i64NV(gpVertexAttribL2i64NV, (C.GLuint)(index), (C.GLint64EXT)(x), (C.GLint64EXT)(y))
+}
+func VertexAttribL2i64vNV(index uint32, v *int64) {
+ C.glowVertexAttribL2i64vNV(gpVertexAttribL2i64vNV, (C.GLuint)(index), (*C.GLint64EXT)(unsafe.Pointer(v)))
+}
+func VertexAttribL2ui64NV(index uint32, x uint64, y uint64) {
+ C.glowVertexAttribL2ui64NV(gpVertexAttribL2ui64NV, (C.GLuint)(index), (C.GLuint64EXT)(x), (C.GLuint64EXT)(y))
+}
+func VertexAttribL2ui64vNV(index uint32, v *uint64) {
+ C.glowVertexAttribL2ui64vNV(gpVertexAttribL2ui64vNV, (C.GLuint)(index), (*C.GLuint64EXT)(unsafe.Pointer(v)))
+}
+func VertexAttribL3d(index uint32, x float64, y float64, z float64) {
+ C.glowVertexAttribL3d(gpVertexAttribL3d, (C.GLuint)(index), (C.GLdouble)(x), (C.GLdouble)(y), (C.GLdouble)(z))
+}
+func VertexAttribL3dv(index uint32, v *float64) {
+ C.glowVertexAttribL3dv(gpVertexAttribL3dv, (C.GLuint)(index), (*C.GLdouble)(unsafe.Pointer(v)))
+}
+func VertexAttribL3i64NV(index uint32, x int64, y int64, z int64) {
+ C.glowVertexAttribL3i64NV(gpVertexAttribL3i64NV, (C.GLuint)(index), (C.GLint64EXT)(x), (C.GLint64EXT)(y), (C.GLint64EXT)(z))
+}
+func VertexAttribL3i64vNV(index uint32, v *int64) {
+ C.glowVertexAttribL3i64vNV(gpVertexAttribL3i64vNV, (C.GLuint)(index), (*C.GLint64EXT)(unsafe.Pointer(v)))
+}
+func VertexAttribL3ui64NV(index uint32, x uint64, y uint64, z uint64) {
+ C.glowVertexAttribL3ui64NV(gpVertexAttribL3ui64NV, (C.GLuint)(index), (C.GLuint64EXT)(x), (C.GLuint64EXT)(y), (C.GLuint64EXT)(z))
+}
+func VertexAttribL3ui64vNV(index uint32, v *uint64) {
+ C.glowVertexAttribL3ui64vNV(gpVertexAttribL3ui64vNV, (C.GLuint)(index), (*C.GLuint64EXT)(unsafe.Pointer(v)))
+}
+func VertexAttribL4d(index uint32, x float64, y float64, z float64, w float64) {
+ C.glowVertexAttribL4d(gpVertexAttribL4d, (C.GLuint)(index), (C.GLdouble)(x), (C.GLdouble)(y), (C.GLdouble)(z), (C.GLdouble)(w))
+}
+func VertexAttribL4dv(index uint32, v *float64) {
+ C.glowVertexAttribL4dv(gpVertexAttribL4dv, (C.GLuint)(index), (*C.GLdouble)(unsafe.Pointer(v)))
+}
+func VertexAttribL4i64NV(index uint32, x int64, y int64, z int64, w int64) {
+ C.glowVertexAttribL4i64NV(gpVertexAttribL4i64NV, (C.GLuint)(index), (C.GLint64EXT)(x), (C.GLint64EXT)(y), (C.GLint64EXT)(z), (C.GLint64EXT)(w))
+}
+func VertexAttribL4i64vNV(index uint32, v *int64) {
+ C.glowVertexAttribL4i64vNV(gpVertexAttribL4i64vNV, (C.GLuint)(index), (*C.GLint64EXT)(unsafe.Pointer(v)))
+}
+func VertexAttribL4ui64NV(index uint32, x uint64, y uint64, z uint64, w uint64) {
+ C.glowVertexAttribL4ui64NV(gpVertexAttribL4ui64NV, (C.GLuint)(index), (C.GLuint64EXT)(x), (C.GLuint64EXT)(y), (C.GLuint64EXT)(z), (C.GLuint64EXT)(w))
+}
+func VertexAttribL4ui64vNV(index uint32, v *uint64) {
+ C.glowVertexAttribL4ui64vNV(gpVertexAttribL4ui64vNV, (C.GLuint)(index), (*C.GLuint64EXT)(unsafe.Pointer(v)))
+}
+func VertexAttribLFormat(attribindex uint32, size int32, xtype uint32, relativeoffset uint32) {
+ C.glowVertexAttribLFormat(gpVertexAttribLFormat, (C.GLuint)(attribindex), (C.GLint)(size), (C.GLenum)(xtype), (C.GLuint)(relativeoffset))
+}
+func VertexAttribLFormatNV(index uint32, size int32, xtype uint32, stride int32) {
+ C.glowVertexAttribLFormatNV(gpVertexAttribLFormatNV, (C.GLuint)(index), (C.GLint)(size), (C.GLenum)(xtype), (C.GLsizei)(stride))
+}
+func VertexAttribLPointer(index uint32, size int32, xtype uint32, stride int32, pointer unsafe.Pointer) {
+ C.glowVertexAttribLPointer(gpVertexAttribLPointer, (C.GLuint)(index), (C.GLint)(size), (C.GLenum)(xtype), (C.GLsizei)(stride), pointer)
+}
+func VertexAttribLPointerWithOffset(index uint32, size int32, xtype uint32, stride int32, offset uintptr) {
+ C.glowVertexAttribLPointerWithOffset(gpVertexAttribLPointer, (C.GLuint)(index), (C.GLint)(size), (C.GLenum)(xtype), (C.GLsizei)(stride), (C.uintptr_t)(offset))
+}
+func VertexAttribP1ui(index uint32, xtype uint32, normalized bool, value uint32) {
+ C.glowVertexAttribP1ui(gpVertexAttribP1ui, (C.GLuint)(index), (C.GLenum)(xtype), (C.GLboolean)(boolToInt(normalized)), (C.GLuint)(value))
+}
+func VertexAttribP1uiv(index uint32, xtype uint32, normalized bool, value *uint32) {
+ C.glowVertexAttribP1uiv(gpVertexAttribP1uiv, (C.GLuint)(index), (C.GLenum)(xtype), (C.GLboolean)(boolToInt(normalized)), (*C.GLuint)(unsafe.Pointer(value)))
+}
+func VertexAttribP2ui(index uint32, xtype uint32, normalized bool, value uint32) {
+ C.glowVertexAttribP2ui(gpVertexAttribP2ui, (C.GLuint)(index), (C.GLenum)(xtype), (C.GLboolean)(boolToInt(normalized)), (C.GLuint)(value))
+}
+func VertexAttribP2uiv(index uint32, xtype uint32, normalized bool, value *uint32) {
+ C.glowVertexAttribP2uiv(gpVertexAttribP2uiv, (C.GLuint)(index), (C.GLenum)(xtype), (C.GLboolean)(boolToInt(normalized)), (*C.GLuint)(unsafe.Pointer(value)))
+}
+func VertexAttribP3ui(index uint32, xtype uint32, normalized bool, value uint32) {
+ C.glowVertexAttribP3ui(gpVertexAttribP3ui, (C.GLuint)(index), (C.GLenum)(xtype), (C.GLboolean)(boolToInt(normalized)), (C.GLuint)(value))
+}
+func VertexAttribP3uiv(index uint32, xtype uint32, normalized bool, value *uint32) {
+ C.glowVertexAttribP3uiv(gpVertexAttribP3uiv, (C.GLuint)(index), (C.GLenum)(xtype), (C.GLboolean)(boolToInt(normalized)), (*C.GLuint)(unsafe.Pointer(value)))
+}
+func VertexAttribP4ui(index uint32, xtype uint32, normalized bool, value uint32) {
+ C.glowVertexAttribP4ui(gpVertexAttribP4ui, (C.GLuint)(index), (C.GLenum)(xtype), (C.GLboolean)(boolToInt(normalized)), (C.GLuint)(value))
+}
+func VertexAttribP4uiv(index uint32, xtype uint32, normalized bool, value *uint32) {
+ C.glowVertexAttribP4uiv(gpVertexAttribP4uiv, (C.GLuint)(index), (C.GLenum)(xtype), (C.GLboolean)(boolToInt(normalized)), (*C.GLuint)(unsafe.Pointer(value)))
+}
+
+// define an array of generic vertex attribute data
+func VertexAttribPointer(index uint32, size int32, xtype uint32, normalized bool, stride int32, pointer unsafe.Pointer) {
+ C.glowVertexAttribPointer(gpVertexAttribPointer, (C.GLuint)(index), (C.GLint)(size), (C.GLenum)(xtype), (C.GLboolean)(boolToInt(normalized)), (C.GLsizei)(stride), pointer)
+}
+func VertexAttribPointerWithOffset(index uint32, size int32, xtype uint32, normalized bool, stride int32, offset uintptr) {
+ C.glowVertexAttribPointerWithOffset(gpVertexAttribPointer, (C.GLuint)(index), (C.GLint)(size), (C.GLenum)(xtype), (C.GLboolean)(boolToInt(normalized)), (C.GLsizei)(stride), (C.uintptr_t)(offset))
+}
+
+// modify the rate at which generic vertex attributes advance
+func VertexBindingDivisor(bindingindex uint32, divisor uint32) {
+ C.glowVertexBindingDivisor(gpVertexBindingDivisor, (C.GLuint)(bindingindex), (C.GLuint)(divisor))
+}
+func VertexFormatNV(size int32, xtype uint32, stride int32) {
+ C.glowVertexFormatNV(gpVertexFormatNV, (C.GLint)(size), (C.GLenum)(xtype), (C.GLsizei)(stride))
+}
+
+// set the viewport
+func Viewport(x int32, y int32, width int32, height int32) {
+ C.glowViewport(gpViewport, (C.GLint)(x), (C.GLint)(y), (C.GLsizei)(width), (C.GLsizei)(height))
+}
+func ViewportArrayv(first uint32, count int32, v *float32) {
+ C.glowViewportArrayv(gpViewportArrayv, (C.GLuint)(first), (C.GLsizei)(count), (*C.GLfloat)(unsafe.Pointer(v)))
+}
+func ViewportIndexedf(index uint32, x float32, y float32, w float32, h float32) {
+ C.glowViewportIndexedf(gpViewportIndexedf, (C.GLuint)(index), (C.GLfloat)(x), (C.GLfloat)(y), (C.GLfloat)(w), (C.GLfloat)(h))
+}
+func ViewportIndexedfv(index uint32, v *float32) {
+ C.glowViewportIndexedfv(gpViewportIndexedfv, (C.GLuint)(index), (*C.GLfloat)(unsafe.Pointer(v)))
+}
+func ViewportPositionWScaleNV(index uint32, xcoeff float32, ycoeff float32) {
+ C.glowViewportPositionWScaleNV(gpViewportPositionWScaleNV, (C.GLuint)(index), (C.GLfloat)(xcoeff), (C.GLfloat)(ycoeff))
+}
+func ViewportSwizzleNV(index uint32, swizzlex uint32, swizzley uint32, swizzlez uint32, swizzlew uint32) {
+ C.glowViewportSwizzleNV(gpViewportSwizzleNV, (C.GLuint)(index), (C.GLenum)(swizzlex), (C.GLenum)(swizzley), (C.GLenum)(swizzlez), (C.GLenum)(swizzlew))
+}
+
+// instruct the GL server to block until the specified sync object becomes signaled
+func WaitSync(sync uintptr, flags uint32, timeout uint64) {
+ C.glowWaitSync(gpWaitSync, (C.GLsync)(sync), (C.GLbitfield)(flags), (C.GLuint64)(timeout))
+}
+func WaitVkSemaphoreNV(vkSemaphore uint64) {
+ C.glowWaitVkSemaphoreNV(gpWaitVkSemaphoreNV, (C.GLuint64)(vkSemaphore))
+}
+func WeightPathsNV(resultPath uint32, numPaths int32, paths *uint32, weights *float32) {
+ C.glowWeightPathsNV(gpWeightPathsNV, (C.GLuint)(resultPath), (C.GLsizei)(numPaths), (*C.GLuint)(unsafe.Pointer(paths)), (*C.GLfloat)(unsafe.Pointer(weights)))
+}
+func WindowRectanglesEXT(mode uint32, count int32, box *int32) {
+ C.glowWindowRectanglesEXT(gpWindowRectanglesEXT, (C.GLenum)(mode), (C.GLsizei)(count), (*C.GLint)(unsafe.Pointer(box)))
+}
+
+// Init initializes the OpenGL bindings by loading the function pointers (for
+// each OpenGL function) from the active OpenGL context.
+//
+// It must be called under the presence of an active OpenGL context, e.g.,
+// always after calling window.MakeContextCurrent() and always before calling
+// any OpenGL functions exported by this package.
+//
+// On Windows, Init loads pointers that are context-specific (and hence you
+// must re-init if switching between OpenGL contexts, although not calling Init
+// again after switching between OpenGL contexts may work if the contexts belong
+// to the same graphics driver/device).
+//
+// On macOS and the other POSIX systems, the behavior is different, but code
+// written compatible with the Windows behavior is compatible with macOS and the
+// other POSIX systems. That is, always Init under an active OpenGL context, and
+// always re-init after switching graphics contexts.
+//
+// For information about caveats of Init, you should read the "Platform Specific
+// Function Retrieval" section of https://www.opengl.org/wiki/Load_OpenGL_Functions.
+func Init() error {
+ return InitWithProcAddrFunc(getProcAddress)
+}
+
+// InitWithProcAddrFunc intializes the package using the specified OpenGL
+// function pointer loading function. For more cases Init should be used
+// instead.
+func InitWithProcAddrFunc(getProcAddr func(name string) unsafe.Pointer) error {
+ gpActiveProgramEXT = (C.GPACTIVEPROGRAMEXT)(getProcAddr("glActiveProgramEXT"))
+ gpActiveShaderProgram = (C.GPACTIVESHADERPROGRAM)(getProcAddr("glActiveShaderProgram"))
+ gpActiveShaderProgramEXT = (C.GPACTIVESHADERPROGRAMEXT)(getProcAddr("glActiveShaderProgramEXT"))
+ gpActiveTexture = (C.GPACTIVETEXTURE)(getProcAddr("glActiveTexture"))
+ if gpActiveTexture == nil {
+ return errors.New("glActiveTexture")
+ }
+ gpApplyFramebufferAttachmentCMAAINTEL = (C.GPAPPLYFRAMEBUFFERATTACHMENTCMAAINTEL)(getProcAddr("glApplyFramebufferAttachmentCMAAINTEL"))
+ gpAttachShader = (C.GPATTACHSHADER)(getProcAddr("glAttachShader"))
+ if gpAttachShader == nil {
+ return errors.New("glAttachShader")
+ }
+ gpBeginConditionalRender = (C.GPBEGINCONDITIONALRENDER)(getProcAddr("glBeginConditionalRender"))
+ if gpBeginConditionalRender == nil {
+ return errors.New("glBeginConditionalRender")
+ }
+ gpBeginConditionalRenderNV = (C.GPBEGINCONDITIONALRENDERNV)(getProcAddr("glBeginConditionalRenderNV"))
+ gpBeginPerfMonitorAMD = (C.GPBEGINPERFMONITORAMD)(getProcAddr("glBeginPerfMonitorAMD"))
+ gpBeginPerfQueryINTEL = (C.GPBEGINPERFQUERYINTEL)(getProcAddr("glBeginPerfQueryINTEL"))
+ gpBeginQuery = (C.GPBEGINQUERY)(getProcAddr("glBeginQuery"))
+ if gpBeginQuery == nil {
+ return errors.New("glBeginQuery")
+ }
+ gpBeginQueryIndexed = (C.GPBEGINQUERYINDEXED)(getProcAddr("glBeginQueryIndexed"))
+ gpBeginTransformFeedback = (C.GPBEGINTRANSFORMFEEDBACK)(getProcAddr("glBeginTransformFeedback"))
+ if gpBeginTransformFeedback == nil {
+ return errors.New("glBeginTransformFeedback")
+ }
+ gpBindAttribLocation = (C.GPBINDATTRIBLOCATION)(getProcAddr("glBindAttribLocation"))
+ if gpBindAttribLocation == nil {
+ return errors.New("glBindAttribLocation")
+ }
+ gpBindBuffer = (C.GPBINDBUFFER)(getProcAddr("glBindBuffer"))
+ if gpBindBuffer == nil {
+ return errors.New("glBindBuffer")
+ }
+ gpBindBufferBase = (C.GPBINDBUFFERBASE)(getProcAddr("glBindBufferBase"))
+ if gpBindBufferBase == nil {
+ return errors.New("glBindBufferBase")
+ }
+ gpBindBufferRange = (C.GPBINDBUFFERRANGE)(getProcAddr("glBindBufferRange"))
+ if gpBindBufferRange == nil {
+ return errors.New("glBindBufferRange")
+ }
+ gpBindBuffersBase = (C.GPBINDBUFFERSBASE)(getProcAddr("glBindBuffersBase"))
+ gpBindBuffersRange = (C.GPBINDBUFFERSRANGE)(getProcAddr("glBindBuffersRange"))
+ gpBindFragDataLocation = (C.GPBINDFRAGDATALOCATION)(getProcAddr("glBindFragDataLocation"))
+ if gpBindFragDataLocation == nil {
+ return errors.New("glBindFragDataLocation")
+ }
+ gpBindFragDataLocationIndexed = (C.GPBINDFRAGDATALOCATIONINDEXED)(getProcAddr("glBindFragDataLocationIndexed"))
+ if gpBindFragDataLocationIndexed == nil {
+ return errors.New("glBindFragDataLocationIndexed")
+ }
+ gpBindFramebuffer = (C.GPBINDFRAMEBUFFER)(getProcAddr("glBindFramebuffer"))
+ if gpBindFramebuffer == nil {
+ return errors.New("glBindFramebuffer")
+ }
+ gpBindImageTexture = (C.GPBINDIMAGETEXTURE)(getProcAddr("glBindImageTexture"))
+ gpBindImageTextures = (C.GPBINDIMAGETEXTURES)(getProcAddr("glBindImageTextures"))
+ gpBindMultiTextureEXT = (C.GPBINDMULTITEXTUREEXT)(getProcAddr("glBindMultiTextureEXT"))
+ gpBindProgramPipeline = (C.GPBINDPROGRAMPIPELINE)(getProcAddr("glBindProgramPipeline"))
+ gpBindProgramPipelineEXT = (C.GPBINDPROGRAMPIPELINEEXT)(getProcAddr("glBindProgramPipelineEXT"))
+ gpBindRenderbuffer = (C.GPBINDRENDERBUFFER)(getProcAddr("glBindRenderbuffer"))
+ if gpBindRenderbuffer == nil {
+ return errors.New("glBindRenderbuffer")
+ }
+ gpBindSampler = (C.GPBINDSAMPLER)(getProcAddr("glBindSampler"))
+ if gpBindSampler == nil {
+ return errors.New("glBindSampler")
+ }
+ gpBindSamplers = (C.GPBINDSAMPLERS)(getProcAddr("glBindSamplers"))
+ gpBindShadingRateImageNV = (C.GPBINDSHADINGRATEIMAGENV)(getProcAddr("glBindShadingRateImageNV"))
+ gpBindTexture = (C.GPBINDTEXTURE)(getProcAddr("glBindTexture"))
+ if gpBindTexture == nil {
+ return errors.New("glBindTexture")
+ }
+ gpBindTextureUnit = (C.GPBINDTEXTUREUNIT)(getProcAddr("glBindTextureUnit"))
+ gpBindTextures = (C.GPBINDTEXTURES)(getProcAddr("glBindTextures"))
+ gpBindTransformFeedback = (C.GPBINDTRANSFORMFEEDBACK)(getProcAddr("glBindTransformFeedback"))
+ gpBindVertexArray = (C.GPBINDVERTEXARRAY)(getProcAddr("glBindVertexArray"))
+ if gpBindVertexArray == nil {
+ return errors.New("glBindVertexArray")
+ }
+ gpBindVertexBuffer = (C.GPBINDVERTEXBUFFER)(getProcAddr("glBindVertexBuffer"))
+ gpBindVertexBuffers = (C.GPBINDVERTEXBUFFERS)(getProcAddr("glBindVertexBuffers"))
+ gpBlendBarrierKHR = (C.GPBLENDBARRIERKHR)(getProcAddr("glBlendBarrierKHR"))
+ gpBlendBarrierNV = (C.GPBLENDBARRIERNV)(getProcAddr("glBlendBarrierNV"))
+ gpBlendColor = (C.GPBLENDCOLOR)(getProcAddr("glBlendColor"))
+ if gpBlendColor == nil {
+ return errors.New("glBlendColor")
+ }
+ gpBlendEquation = (C.GPBLENDEQUATION)(getProcAddr("glBlendEquation"))
+ if gpBlendEquation == nil {
+ return errors.New("glBlendEquation")
+ }
+ gpBlendEquationSeparate = (C.GPBLENDEQUATIONSEPARATE)(getProcAddr("glBlendEquationSeparate"))
+ if gpBlendEquationSeparate == nil {
+ return errors.New("glBlendEquationSeparate")
+ }
+ gpBlendEquationSeparateiARB = (C.GPBLENDEQUATIONSEPARATEIARB)(getProcAddr("glBlendEquationSeparateiARB"))
+ gpBlendEquationiARB = (C.GPBLENDEQUATIONIARB)(getProcAddr("glBlendEquationiARB"))
+ gpBlendFunc = (C.GPBLENDFUNC)(getProcAddr("glBlendFunc"))
+ if gpBlendFunc == nil {
+ return errors.New("glBlendFunc")
+ }
+ gpBlendFuncSeparate = (C.GPBLENDFUNCSEPARATE)(getProcAddr("glBlendFuncSeparate"))
+ if gpBlendFuncSeparate == nil {
+ return errors.New("glBlendFuncSeparate")
+ }
+ gpBlendFuncSeparateiARB = (C.GPBLENDFUNCSEPARATEIARB)(getProcAddr("glBlendFuncSeparateiARB"))
+ gpBlendFunciARB = (C.GPBLENDFUNCIARB)(getProcAddr("glBlendFunciARB"))
+ gpBlendParameteriNV = (C.GPBLENDPARAMETERINV)(getProcAddr("glBlendParameteriNV"))
+ gpBlitFramebuffer = (C.GPBLITFRAMEBUFFER)(getProcAddr("glBlitFramebuffer"))
+ if gpBlitFramebuffer == nil {
+ return errors.New("glBlitFramebuffer")
+ }
+ gpBlitNamedFramebuffer = (C.GPBLITNAMEDFRAMEBUFFER)(getProcAddr("glBlitNamedFramebuffer"))
+ gpBufferAddressRangeNV = (C.GPBUFFERADDRESSRANGENV)(getProcAddr("glBufferAddressRangeNV"))
+ gpBufferAttachMemoryNV = (C.GPBUFFERATTACHMEMORYNV)(getProcAddr("glBufferAttachMemoryNV"))
+ gpBufferData = (C.GPBUFFERDATA)(getProcAddr("glBufferData"))
+ if gpBufferData == nil {
+ return errors.New("glBufferData")
+ }
+ gpBufferPageCommitmentARB = (C.GPBUFFERPAGECOMMITMENTARB)(getProcAddr("glBufferPageCommitmentARB"))
+ gpBufferPageCommitmentMemNV = (C.GPBUFFERPAGECOMMITMENTMEMNV)(getProcAddr("glBufferPageCommitmentMemNV"))
+ gpBufferStorage = (C.GPBUFFERSTORAGE)(getProcAddr("glBufferStorage"))
+ gpBufferSubData = (C.GPBUFFERSUBDATA)(getProcAddr("glBufferSubData"))
+ if gpBufferSubData == nil {
+ return errors.New("glBufferSubData")
+ }
+ gpCallCommandListNV = (C.GPCALLCOMMANDLISTNV)(getProcAddr("glCallCommandListNV"))
+ gpCheckFramebufferStatus = (C.GPCHECKFRAMEBUFFERSTATUS)(getProcAddr("glCheckFramebufferStatus"))
+ if gpCheckFramebufferStatus == nil {
+ return errors.New("glCheckFramebufferStatus")
+ }
+ gpCheckNamedFramebufferStatus = (C.GPCHECKNAMEDFRAMEBUFFERSTATUS)(getProcAddr("glCheckNamedFramebufferStatus"))
+ gpCheckNamedFramebufferStatusEXT = (C.GPCHECKNAMEDFRAMEBUFFERSTATUSEXT)(getProcAddr("glCheckNamedFramebufferStatusEXT"))
+ gpClampColor = (C.GPCLAMPCOLOR)(getProcAddr("glClampColor"))
+ if gpClampColor == nil {
+ return errors.New("glClampColor")
+ }
+ gpClear = (C.GPCLEAR)(getProcAddr("glClear"))
+ if gpClear == nil {
+ return errors.New("glClear")
+ }
+ gpClearBufferData = (C.GPCLEARBUFFERDATA)(getProcAddr("glClearBufferData"))
+ gpClearBufferSubData = (C.GPCLEARBUFFERSUBDATA)(getProcAddr("glClearBufferSubData"))
+ gpClearBufferfi = (C.GPCLEARBUFFERFI)(getProcAddr("glClearBufferfi"))
+ if gpClearBufferfi == nil {
+ return errors.New("glClearBufferfi")
+ }
+ gpClearBufferfv = (C.GPCLEARBUFFERFV)(getProcAddr("glClearBufferfv"))
+ if gpClearBufferfv == nil {
+ return errors.New("glClearBufferfv")
+ }
+ gpClearBufferiv = (C.GPCLEARBUFFERIV)(getProcAddr("glClearBufferiv"))
+ if gpClearBufferiv == nil {
+ return errors.New("glClearBufferiv")
+ }
+ gpClearBufferuiv = (C.GPCLEARBUFFERUIV)(getProcAddr("glClearBufferuiv"))
+ if gpClearBufferuiv == nil {
+ return errors.New("glClearBufferuiv")
+ }
+ gpClearColor = (C.GPCLEARCOLOR)(getProcAddr("glClearColor"))
+ if gpClearColor == nil {
+ return errors.New("glClearColor")
+ }
+ gpClearDepth = (C.GPCLEARDEPTH)(getProcAddr("glClearDepth"))
+ if gpClearDepth == nil {
+ return errors.New("glClearDepth")
+ }
+ gpClearDepthdNV = (C.GPCLEARDEPTHDNV)(getProcAddr("glClearDepthdNV"))
+ gpClearDepthf = (C.GPCLEARDEPTHF)(getProcAddr("glClearDepthf"))
+ gpClearNamedBufferData = (C.GPCLEARNAMEDBUFFERDATA)(getProcAddr("glClearNamedBufferData"))
+ gpClearNamedBufferDataEXT = (C.GPCLEARNAMEDBUFFERDATAEXT)(getProcAddr("glClearNamedBufferDataEXT"))
+ gpClearNamedBufferSubData = (C.GPCLEARNAMEDBUFFERSUBDATA)(getProcAddr("glClearNamedBufferSubData"))
+ gpClearNamedBufferSubDataEXT = (C.GPCLEARNAMEDBUFFERSUBDATAEXT)(getProcAddr("glClearNamedBufferSubDataEXT"))
+ gpClearNamedFramebufferfi = (C.GPCLEARNAMEDFRAMEBUFFERFI)(getProcAddr("glClearNamedFramebufferfi"))
+ gpClearNamedFramebufferfv = (C.GPCLEARNAMEDFRAMEBUFFERFV)(getProcAddr("glClearNamedFramebufferfv"))
+ gpClearNamedFramebufferiv = (C.GPCLEARNAMEDFRAMEBUFFERIV)(getProcAddr("glClearNamedFramebufferiv"))
+ gpClearNamedFramebufferuiv = (C.GPCLEARNAMEDFRAMEBUFFERUIV)(getProcAddr("glClearNamedFramebufferuiv"))
+ gpClearStencil = (C.GPCLEARSTENCIL)(getProcAddr("glClearStencil"))
+ if gpClearStencil == nil {
+ return errors.New("glClearStencil")
+ }
+ gpClearTexImage = (C.GPCLEARTEXIMAGE)(getProcAddr("glClearTexImage"))
+ gpClearTexSubImage = (C.GPCLEARTEXSUBIMAGE)(getProcAddr("glClearTexSubImage"))
+ gpClientAttribDefaultEXT = (C.GPCLIENTATTRIBDEFAULTEXT)(getProcAddr("glClientAttribDefaultEXT"))
+ gpClientWaitSync = (C.GPCLIENTWAITSYNC)(getProcAddr("glClientWaitSync"))
+ if gpClientWaitSync == nil {
+ return errors.New("glClientWaitSync")
+ }
+ gpClipControl = (C.GPCLIPCONTROL)(getProcAddr("glClipControl"))
+ gpColorFormatNV = (C.GPCOLORFORMATNV)(getProcAddr("glColorFormatNV"))
+ gpColorMask = (C.GPCOLORMASK)(getProcAddr("glColorMask"))
+ if gpColorMask == nil {
+ return errors.New("glColorMask")
+ }
+ gpColorMaski = (C.GPCOLORMASKI)(getProcAddr("glColorMaski"))
+ if gpColorMaski == nil {
+ return errors.New("glColorMaski")
+ }
+ gpCommandListSegmentsNV = (C.GPCOMMANDLISTSEGMENTSNV)(getProcAddr("glCommandListSegmentsNV"))
+ gpCompileCommandListNV = (C.GPCOMPILECOMMANDLISTNV)(getProcAddr("glCompileCommandListNV"))
+ gpCompileShader = (C.GPCOMPILESHADER)(getProcAddr("glCompileShader"))
+ if gpCompileShader == nil {
+ return errors.New("glCompileShader")
+ }
+ gpCompileShaderIncludeARB = (C.GPCOMPILESHADERINCLUDEARB)(getProcAddr("glCompileShaderIncludeARB"))
+ gpCompressedMultiTexImage1DEXT = (C.GPCOMPRESSEDMULTITEXIMAGE1DEXT)(getProcAddr("glCompressedMultiTexImage1DEXT"))
+ gpCompressedMultiTexImage2DEXT = (C.GPCOMPRESSEDMULTITEXIMAGE2DEXT)(getProcAddr("glCompressedMultiTexImage2DEXT"))
+ gpCompressedMultiTexImage3DEXT = (C.GPCOMPRESSEDMULTITEXIMAGE3DEXT)(getProcAddr("glCompressedMultiTexImage3DEXT"))
+ gpCompressedMultiTexSubImage1DEXT = (C.GPCOMPRESSEDMULTITEXSUBIMAGE1DEXT)(getProcAddr("glCompressedMultiTexSubImage1DEXT"))
+ gpCompressedMultiTexSubImage2DEXT = (C.GPCOMPRESSEDMULTITEXSUBIMAGE2DEXT)(getProcAddr("glCompressedMultiTexSubImage2DEXT"))
+ gpCompressedMultiTexSubImage3DEXT = (C.GPCOMPRESSEDMULTITEXSUBIMAGE3DEXT)(getProcAddr("glCompressedMultiTexSubImage3DEXT"))
+ gpCompressedTexImage1D = (C.GPCOMPRESSEDTEXIMAGE1D)(getProcAddr("glCompressedTexImage1D"))
+ if gpCompressedTexImage1D == nil {
+ return errors.New("glCompressedTexImage1D")
+ }
+ gpCompressedTexImage2D = (C.GPCOMPRESSEDTEXIMAGE2D)(getProcAddr("glCompressedTexImage2D"))
+ if gpCompressedTexImage2D == nil {
+ return errors.New("glCompressedTexImage2D")
+ }
+ gpCompressedTexImage3D = (C.GPCOMPRESSEDTEXIMAGE3D)(getProcAddr("glCompressedTexImage3D"))
+ if gpCompressedTexImage3D == nil {
+ return errors.New("glCompressedTexImage3D")
+ }
+ gpCompressedTexSubImage1D = (C.GPCOMPRESSEDTEXSUBIMAGE1D)(getProcAddr("glCompressedTexSubImage1D"))
+ if gpCompressedTexSubImage1D == nil {
+ return errors.New("glCompressedTexSubImage1D")
+ }
+ gpCompressedTexSubImage2D = (C.GPCOMPRESSEDTEXSUBIMAGE2D)(getProcAddr("glCompressedTexSubImage2D"))
+ if gpCompressedTexSubImage2D == nil {
+ return errors.New("glCompressedTexSubImage2D")
+ }
+ gpCompressedTexSubImage3D = (C.GPCOMPRESSEDTEXSUBIMAGE3D)(getProcAddr("glCompressedTexSubImage3D"))
+ if gpCompressedTexSubImage3D == nil {
+ return errors.New("glCompressedTexSubImage3D")
+ }
+ gpCompressedTextureImage1DEXT = (C.GPCOMPRESSEDTEXTUREIMAGE1DEXT)(getProcAddr("glCompressedTextureImage1DEXT"))
+ gpCompressedTextureImage2DEXT = (C.GPCOMPRESSEDTEXTUREIMAGE2DEXT)(getProcAddr("glCompressedTextureImage2DEXT"))
+ gpCompressedTextureImage3DEXT = (C.GPCOMPRESSEDTEXTUREIMAGE3DEXT)(getProcAddr("glCompressedTextureImage3DEXT"))
+ gpCompressedTextureSubImage1D = (C.GPCOMPRESSEDTEXTURESUBIMAGE1D)(getProcAddr("glCompressedTextureSubImage1D"))
+ gpCompressedTextureSubImage1DEXT = (C.GPCOMPRESSEDTEXTURESUBIMAGE1DEXT)(getProcAddr("glCompressedTextureSubImage1DEXT"))
+ gpCompressedTextureSubImage2D = (C.GPCOMPRESSEDTEXTURESUBIMAGE2D)(getProcAddr("glCompressedTextureSubImage2D"))
+ gpCompressedTextureSubImage2DEXT = (C.GPCOMPRESSEDTEXTURESUBIMAGE2DEXT)(getProcAddr("glCompressedTextureSubImage2DEXT"))
+ gpCompressedTextureSubImage3D = (C.GPCOMPRESSEDTEXTURESUBIMAGE3D)(getProcAddr("glCompressedTextureSubImage3D"))
+ gpCompressedTextureSubImage3DEXT = (C.GPCOMPRESSEDTEXTURESUBIMAGE3DEXT)(getProcAddr("glCompressedTextureSubImage3DEXT"))
+ gpConservativeRasterParameterfNV = (C.GPCONSERVATIVERASTERPARAMETERFNV)(getProcAddr("glConservativeRasterParameterfNV"))
+ gpConservativeRasterParameteriNV = (C.GPCONSERVATIVERASTERPARAMETERINV)(getProcAddr("glConservativeRasterParameteriNV"))
+ gpCopyBufferSubData = (C.GPCOPYBUFFERSUBDATA)(getProcAddr("glCopyBufferSubData"))
+ if gpCopyBufferSubData == nil {
+ return errors.New("glCopyBufferSubData")
+ }
+ gpCopyImageSubData = (C.GPCOPYIMAGESUBDATA)(getProcAddr("glCopyImageSubData"))
+ gpCopyMultiTexImage1DEXT = (C.GPCOPYMULTITEXIMAGE1DEXT)(getProcAddr("glCopyMultiTexImage1DEXT"))
+ gpCopyMultiTexImage2DEXT = (C.GPCOPYMULTITEXIMAGE2DEXT)(getProcAddr("glCopyMultiTexImage2DEXT"))
+ gpCopyMultiTexSubImage1DEXT = (C.GPCOPYMULTITEXSUBIMAGE1DEXT)(getProcAddr("glCopyMultiTexSubImage1DEXT"))
+ gpCopyMultiTexSubImage2DEXT = (C.GPCOPYMULTITEXSUBIMAGE2DEXT)(getProcAddr("glCopyMultiTexSubImage2DEXT"))
+ gpCopyMultiTexSubImage3DEXT = (C.GPCOPYMULTITEXSUBIMAGE3DEXT)(getProcAddr("glCopyMultiTexSubImage3DEXT"))
+ gpCopyNamedBufferSubData = (C.GPCOPYNAMEDBUFFERSUBDATA)(getProcAddr("glCopyNamedBufferSubData"))
+ gpCopyPathNV = (C.GPCOPYPATHNV)(getProcAddr("glCopyPathNV"))
+ gpCopyTexImage1D = (C.GPCOPYTEXIMAGE1D)(getProcAddr("glCopyTexImage1D"))
+ if gpCopyTexImage1D == nil {
+ return errors.New("glCopyTexImage1D")
+ }
+ gpCopyTexImage2D = (C.GPCOPYTEXIMAGE2D)(getProcAddr("glCopyTexImage2D"))
+ if gpCopyTexImage2D == nil {
+ return errors.New("glCopyTexImage2D")
+ }
+ gpCopyTexSubImage1D = (C.GPCOPYTEXSUBIMAGE1D)(getProcAddr("glCopyTexSubImage1D"))
+ if gpCopyTexSubImage1D == nil {
+ return errors.New("glCopyTexSubImage1D")
+ }
+ gpCopyTexSubImage2D = (C.GPCOPYTEXSUBIMAGE2D)(getProcAddr("glCopyTexSubImage2D"))
+ if gpCopyTexSubImage2D == nil {
+ return errors.New("glCopyTexSubImage2D")
+ }
+ gpCopyTexSubImage3D = (C.GPCOPYTEXSUBIMAGE3D)(getProcAddr("glCopyTexSubImage3D"))
+ if gpCopyTexSubImage3D == nil {
+ return errors.New("glCopyTexSubImage3D")
+ }
+ gpCopyTextureImage1DEXT = (C.GPCOPYTEXTUREIMAGE1DEXT)(getProcAddr("glCopyTextureImage1DEXT"))
+ gpCopyTextureImage2DEXT = (C.GPCOPYTEXTUREIMAGE2DEXT)(getProcAddr("glCopyTextureImage2DEXT"))
+ gpCopyTextureSubImage1D = (C.GPCOPYTEXTURESUBIMAGE1D)(getProcAddr("glCopyTextureSubImage1D"))
+ gpCopyTextureSubImage1DEXT = (C.GPCOPYTEXTURESUBIMAGE1DEXT)(getProcAddr("glCopyTextureSubImage1DEXT"))
+ gpCopyTextureSubImage2D = (C.GPCOPYTEXTURESUBIMAGE2D)(getProcAddr("glCopyTextureSubImage2D"))
+ gpCopyTextureSubImage2DEXT = (C.GPCOPYTEXTURESUBIMAGE2DEXT)(getProcAddr("glCopyTextureSubImage2DEXT"))
+ gpCopyTextureSubImage3D = (C.GPCOPYTEXTURESUBIMAGE3D)(getProcAddr("glCopyTextureSubImage3D"))
+ gpCopyTextureSubImage3DEXT = (C.GPCOPYTEXTURESUBIMAGE3DEXT)(getProcAddr("glCopyTextureSubImage3DEXT"))
+ gpCoverFillPathInstancedNV = (C.GPCOVERFILLPATHINSTANCEDNV)(getProcAddr("glCoverFillPathInstancedNV"))
+ gpCoverFillPathNV = (C.GPCOVERFILLPATHNV)(getProcAddr("glCoverFillPathNV"))
+ gpCoverStrokePathInstancedNV = (C.GPCOVERSTROKEPATHINSTANCEDNV)(getProcAddr("glCoverStrokePathInstancedNV"))
+ gpCoverStrokePathNV = (C.GPCOVERSTROKEPATHNV)(getProcAddr("glCoverStrokePathNV"))
+ gpCoverageModulationNV = (C.GPCOVERAGEMODULATIONNV)(getProcAddr("glCoverageModulationNV"))
+ gpCoverageModulationTableNV = (C.GPCOVERAGEMODULATIONTABLENV)(getProcAddr("glCoverageModulationTableNV"))
+ gpCreateBuffers = (C.GPCREATEBUFFERS)(getProcAddr("glCreateBuffers"))
+ gpCreateCommandListsNV = (C.GPCREATECOMMANDLISTSNV)(getProcAddr("glCreateCommandListsNV"))
+ gpCreateFramebuffers = (C.GPCREATEFRAMEBUFFERS)(getProcAddr("glCreateFramebuffers"))
+ gpCreatePerfQueryINTEL = (C.GPCREATEPERFQUERYINTEL)(getProcAddr("glCreatePerfQueryINTEL"))
+ gpCreateProgram = (C.GPCREATEPROGRAM)(getProcAddr("glCreateProgram"))
+ if gpCreateProgram == nil {
+ return errors.New("glCreateProgram")
+ }
+ gpCreateProgramPipelines = (C.GPCREATEPROGRAMPIPELINES)(getProcAddr("glCreateProgramPipelines"))
+ gpCreateQueries = (C.GPCREATEQUERIES)(getProcAddr("glCreateQueries"))
+ gpCreateRenderbuffers = (C.GPCREATERENDERBUFFERS)(getProcAddr("glCreateRenderbuffers"))
+ gpCreateSamplers = (C.GPCREATESAMPLERS)(getProcAddr("glCreateSamplers"))
+ gpCreateShader = (C.GPCREATESHADER)(getProcAddr("glCreateShader"))
+ if gpCreateShader == nil {
+ return errors.New("glCreateShader")
+ }
+ gpCreateShaderProgramEXT = (C.GPCREATESHADERPROGRAMEXT)(getProcAddr("glCreateShaderProgramEXT"))
+ gpCreateShaderProgramv = (C.GPCREATESHADERPROGRAMV)(getProcAddr("glCreateShaderProgramv"))
+ gpCreateShaderProgramvEXT = (C.GPCREATESHADERPROGRAMVEXT)(getProcAddr("glCreateShaderProgramvEXT"))
+ gpCreateStatesNV = (C.GPCREATESTATESNV)(getProcAddr("glCreateStatesNV"))
+ gpCreateSyncFromCLeventARB = (C.GPCREATESYNCFROMCLEVENTARB)(getProcAddr("glCreateSyncFromCLeventARB"))
+ gpCreateTextures = (C.GPCREATETEXTURES)(getProcAddr("glCreateTextures"))
+ gpCreateTransformFeedbacks = (C.GPCREATETRANSFORMFEEDBACKS)(getProcAddr("glCreateTransformFeedbacks"))
+ gpCreateVertexArrays = (C.GPCREATEVERTEXARRAYS)(getProcAddr("glCreateVertexArrays"))
+ gpCullFace = (C.GPCULLFACE)(getProcAddr("glCullFace"))
+ if gpCullFace == nil {
+ return errors.New("glCullFace")
+ }
+ gpDebugMessageCallback = (C.GPDEBUGMESSAGECALLBACK)(getProcAddr("glDebugMessageCallback"))
+ gpDebugMessageCallbackARB = (C.GPDEBUGMESSAGECALLBACKARB)(getProcAddr("glDebugMessageCallbackARB"))
+ gpDebugMessageCallbackKHR = (C.GPDEBUGMESSAGECALLBACKKHR)(getProcAddr("glDebugMessageCallbackKHR"))
+ gpDebugMessageControl = (C.GPDEBUGMESSAGECONTROL)(getProcAddr("glDebugMessageControl"))
+ gpDebugMessageControlARB = (C.GPDEBUGMESSAGECONTROLARB)(getProcAddr("glDebugMessageControlARB"))
+ gpDebugMessageControlKHR = (C.GPDEBUGMESSAGECONTROLKHR)(getProcAddr("glDebugMessageControlKHR"))
+ gpDebugMessageInsert = (C.GPDEBUGMESSAGEINSERT)(getProcAddr("glDebugMessageInsert"))
+ gpDebugMessageInsertARB = (C.GPDEBUGMESSAGEINSERTARB)(getProcAddr("glDebugMessageInsertARB"))
+ gpDebugMessageInsertKHR = (C.GPDEBUGMESSAGEINSERTKHR)(getProcAddr("glDebugMessageInsertKHR"))
+ gpDeleteBuffers = (C.GPDELETEBUFFERS)(getProcAddr("glDeleteBuffers"))
+ if gpDeleteBuffers == nil {
+ return errors.New("glDeleteBuffers")
+ }
+ gpDeleteCommandListsNV = (C.GPDELETECOMMANDLISTSNV)(getProcAddr("glDeleteCommandListsNV"))
+ gpDeleteFramebuffers = (C.GPDELETEFRAMEBUFFERS)(getProcAddr("glDeleteFramebuffers"))
+ if gpDeleteFramebuffers == nil {
+ return errors.New("glDeleteFramebuffers")
+ }
+ gpDeleteNamedStringARB = (C.GPDELETENAMEDSTRINGARB)(getProcAddr("glDeleteNamedStringARB"))
+ gpDeletePathsNV = (C.GPDELETEPATHSNV)(getProcAddr("glDeletePathsNV"))
+ gpDeletePerfMonitorsAMD = (C.GPDELETEPERFMONITORSAMD)(getProcAddr("glDeletePerfMonitorsAMD"))
+ gpDeletePerfQueryINTEL = (C.GPDELETEPERFQUERYINTEL)(getProcAddr("glDeletePerfQueryINTEL"))
+ gpDeleteProgram = (C.GPDELETEPROGRAM)(getProcAddr("glDeleteProgram"))
+ if gpDeleteProgram == nil {
+ return errors.New("glDeleteProgram")
+ }
+ gpDeleteProgramPipelines = (C.GPDELETEPROGRAMPIPELINES)(getProcAddr("glDeleteProgramPipelines"))
+ gpDeleteProgramPipelinesEXT = (C.GPDELETEPROGRAMPIPELINESEXT)(getProcAddr("glDeleteProgramPipelinesEXT"))
+ gpDeleteQueries = (C.GPDELETEQUERIES)(getProcAddr("glDeleteQueries"))
+ if gpDeleteQueries == nil {
+ return errors.New("glDeleteQueries")
+ }
+ gpDeleteRenderbuffers = (C.GPDELETERENDERBUFFERS)(getProcAddr("glDeleteRenderbuffers"))
+ if gpDeleteRenderbuffers == nil {
+ return errors.New("glDeleteRenderbuffers")
+ }
+ gpDeleteSamplers = (C.GPDELETESAMPLERS)(getProcAddr("glDeleteSamplers"))
+ if gpDeleteSamplers == nil {
+ return errors.New("glDeleteSamplers")
+ }
+ gpDeleteShader = (C.GPDELETESHADER)(getProcAddr("glDeleteShader"))
+ if gpDeleteShader == nil {
+ return errors.New("glDeleteShader")
+ }
+ gpDeleteStatesNV = (C.GPDELETESTATESNV)(getProcAddr("glDeleteStatesNV"))
+ gpDeleteSync = (C.GPDELETESYNC)(getProcAddr("glDeleteSync"))
+ if gpDeleteSync == nil {
+ return errors.New("glDeleteSync")
+ }
+ gpDeleteTextures = (C.GPDELETETEXTURES)(getProcAddr("glDeleteTextures"))
+ if gpDeleteTextures == nil {
+ return errors.New("glDeleteTextures")
+ }
+ gpDeleteTransformFeedbacks = (C.GPDELETETRANSFORMFEEDBACKS)(getProcAddr("glDeleteTransformFeedbacks"))
+ gpDeleteVertexArrays = (C.GPDELETEVERTEXARRAYS)(getProcAddr("glDeleteVertexArrays"))
+ if gpDeleteVertexArrays == nil {
+ return errors.New("glDeleteVertexArrays")
+ }
+ gpDepthBoundsdNV = (C.GPDEPTHBOUNDSDNV)(getProcAddr("glDepthBoundsdNV"))
+ gpDepthFunc = (C.GPDEPTHFUNC)(getProcAddr("glDepthFunc"))
+ if gpDepthFunc == nil {
+ return errors.New("glDepthFunc")
+ }
+ gpDepthMask = (C.GPDEPTHMASK)(getProcAddr("glDepthMask"))
+ if gpDepthMask == nil {
+ return errors.New("glDepthMask")
+ }
+ gpDepthRange = (C.GPDEPTHRANGE)(getProcAddr("glDepthRange"))
+ if gpDepthRange == nil {
+ return errors.New("glDepthRange")
+ }
+ gpDepthRangeArraydvNV = (C.GPDEPTHRANGEARRAYDVNV)(getProcAddr("glDepthRangeArraydvNV"))
+ gpDepthRangeArrayv = (C.GPDEPTHRANGEARRAYV)(getProcAddr("glDepthRangeArrayv"))
+ gpDepthRangeIndexed = (C.GPDEPTHRANGEINDEXED)(getProcAddr("glDepthRangeIndexed"))
+ gpDepthRangeIndexeddNV = (C.GPDEPTHRANGEINDEXEDDNV)(getProcAddr("glDepthRangeIndexeddNV"))
+ gpDepthRangedNV = (C.GPDEPTHRANGEDNV)(getProcAddr("glDepthRangedNV"))
+ gpDepthRangef = (C.GPDEPTHRANGEF)(getProcAddr("glDepthRangef"))
+ gpDetachShader = (C.GPDETACHSHADER)(getProcAddr("glDetachShader"))
+ if gpDetachShader == nil {
+ return errors.New("glDetachShader")
+ }
+ gpDisable = (C.GPDISABLE)(getProcAddr("glDisable"))
+ if gpDisable == nil {
+ return errors.New("glDisable")
+ }
+ gpDisableClientStateIndexedEXT = (C.GPDISABLECLIENTSTATEINDEXEDEXT)(getProcAddr("glDisableClientStateIndexedEXT"))
+ gpDisableClientStateiEXT = (C.GPDISABLECLIENTSTATEIEXT)(getProcAddr("glDisableClientStateiEXT"))
+ gpDisableIndexedEXT = (C.GPDISABLEINDEXEDEXT)(getProcAddr("glDisableIndexedEXT"))
+ gpDisableVertexArrayAttrib = (C.GPDISABLEVERTEXARRAYATTRIB)(getProcAddr("glDisableVertexArrayAttrib"))
+ gpDisableVertexArrayAttribEXT = (C.GPDISABLEVERTEXARRAYATTRIBEXT)(getProcAddr("glDisableVertexArrayAttribEXT"))
+ gpDisableVertexArrayEXT = (C.GPDISABLEVERTEXARRAYEXT)(getProcAddr("glDisableVertexArrayEXT"))
+ gpDisableVertexAttribArray = (C.GPDISABLEVERTEXATTRIBARRAY)(getProcAddr("glDisableVertexAttribArray"))
+ if gpDisableVertexAttribArray == nil {
+ return errors.New("glDisableVertexAttribArray")
+ }
+ gpDisablei = (C.GPDISABLEI)(getProcAddr("glDisablei"))
+ if gpDisablei == nil {
+ return errors.New("glDisablei")
+ }
+ gpDispatchCompute = (C.GPDISPATCHCOMPUTE)(getProcAddr("glDispatchCompute"))
+ gpDispatchComputeGroupSizeARB = (C.GPDISPATCHCOMPUTEGROUPSIZEARB)(getProcAddr("glDispatchComputeGroupSizeARB"))
+ gpDispatchComputeIndirect = (C.GPDISPATCHCOMPUTEINDIRECT)(getProcAddr("glDispatchComputeIndirect"))
+ gpDrawArrays = (C.GPDRAWARRAYS)(getProcAddr("glDrawArrays"))
+ if gpDrawArrays == nil {
+ return errors.New("glDrawArrays")
+ }
+ gpDrawArraysIndirect = (C.GPDRAWARRAYSINDIRECT)(getProcAddr("glDrawArraysIndirect"))
+ gpDrawArraysInstanced = (C.GPDRAWARRAYSINSTANCED)(getProcAddr("glDrawArraysInstanced"))
+ if gpDrawArraysInstanced == nil {
+ return errors.New("glDrawArraysInstanced")
+ }
+ gpDrawArraysInstancedARB = (C.GPDRAWARRAYSINSTANCEDARB)(getProcAddr("glDrawArraysInstancedARB"))
+ gpDrawArraysInstancedBaseInstance = (C.GPDRAWARRAYSINSTANCEDBASEINSTANCE)(getProcAddr("glDrawArraysInstancedBaseInstance"))
+ gpDrawArraysInstancedEXT = (C.GPDRAWARRAYSINSTANCEDEXT)(getProcAddr("glDrawArraysInstancedEXT"))
+ gpDrawBuffer = (C.GPDRAWBUFFER)(getProcAddr("glDrawBuffer"))
+ if gpDrawBuffer == nil {
+ return errors.New("glDrawBuffer")
+ }
+ gpDrawBuffers = (C.GPDRAWBUFFERS)(getProcAddr("glDrawBuffers"))
+ if gpDrawBuffers == nil {
+ return errors.New("glDrawBuffers")
+ }
+ gpDrawCommandsAddressNV = (C.GPDRAWCOMMANDSADDRESSNV)(getProcAddr("glDrawCommandsAddressNV"))
+ gpDrawCommandsNV = (C.GPDRAWCOMMANDSNV)(getProcAddr("glDrawCommandsNV"))
+ gpDrawCommandsStatesAddressNV = (C.GPDRAWCOMMANDSSTATESADDRESSNV)(getProcAddr("glDrawCommandsStatesAddressNV"))
+ gpDrawCommandsStatesNV = (C.GPDRAWCOMMANDSSTATESNV)(getProcAddr("glDrawCommandsStatesNV"))
+ gpDrawElements = (C.GPDRAWELEMENTS)(getProcAddr("glDrawElements"))
+ if gpDrawElements == nil {
+ return errors.New("glDrawElements")
+ }
+ gpDrawElementsBaseVertex = (C.GPDRAWELEMENTSBASEVERTEX)(getProcAddr("glDrawElementsBaseVertex"))
+ if gpDrawElementsBaseVertex == nil {
+ return errors.New("glDrawElementsBaseVertex")
+ }
+ gpDrawElementsIndirect = (C.GPDRAWELEMENTSINDIRECT)(getProcAddr("glDrawElementsIndirect"))
+ gpDrawElementsInstanced = (C.GPDRAWELEMENTSINSTANCED)(getProcAddr("glDrawElementsInstanced"))
+ if gpDrawElementsInstanced == nil {
+ return errors.New("glDrawElementsInstanced")
+ }
+ gpDrawElementsInstancedARB = (C.GPDRAWELEMENTSINSTANCEDARB)(getProcAddr("glDrawElementsInstancedARB"))
+ gpDrawElementsInstancedBaseInstance = (C.GPDRAWELEMENTSINSTANCEDBASEINSTANCE)(getProcAddr("glDrawElementsInstancedBaseInstance"))
+ gpDrawElementsInstancedBaseVertex = (C.GPDRAWELEMENTSINSTANCEDBASEVERTEX)(getProcAddr("glDrawElementsInstancedBaseVertex"))
+ if gpDrawElementsInstancedBaseVertex == nil {
+ return errors.New("glDrawElementsInstancedBaseVertex")
+ }
+ gpDrawElementsInstancedBaseVertexBaseInstance = (C.GPDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCE)(getProcAddr("glDrawElementsInstancedBaseVertexBaseInstance"))
+ gpDrawElementsInstancedEXT = (C.GPDRAWELEMENTSINSTANCEDEXT)(getProcAddr("glDrawElementsInstancedEXT"))
+ gpDrawMeshTasksIndirectNV = (C.GPDRAWMESHTASKSINDIRECTNV)(getProcAddr("glDrawMeshTasksIndirectNV"))
+ gpDrawMeshTasksNV = (C.GPDRAWMESHTASKSNV)(getProcAddr("glDrawMeshTasksNV"))
+ gpDrawRangeElements = (C.GPDRAWRANGEELEMENTS)(getProcAddr("glDrawRangeElements"))
+ if gpDrawRangeElements == nil {
+ return errors.New("glDrawRangeElements")
+ }
+ gpDrawRangeElementsBaseVertex = (C.GPDRAWRANGEELEMENTSBASEVERTEX)(getProcAddr("glDrawRangeElementsBaseVertex"))
+ if gpDrawRangeElementsBaseVertex == nil {
+ return errors.New("glDrawRangeElementsBaseVertex")
+ }
+ gpDrawTransformFeedback = (C.GPDRAWTRANSFORMFEEDBACK)(getProcAddr("glDrawTransformFeedback"))
+ gpDrawTransformFeedbackInstanced = (C.GPDRAWTRANSFORMFEEDBACKINSTANCED)(getProcAddr("glDrawTransformFeedbackInstanced"))
+ gpDrawTransformFeedbackStream = (C.GPDRAWTRANSFORMFEEDBACKSTREAM)(getProcAddr("glDrawTransformFeedbackStream"))
+ gpDrawTransformFeedbackStreamInstanced = (C.GPDRAWTRANSFORMFEEDBACKSTREAMINSTANCED)(getProcAddr("glDrawTransformFeedbackStreamInstanced"))
+ gpDrawVkImageNV = (C.GPDRAWVKIMAGENV)(getProcAddr("glDrawVkImageNV"))
+ gpEGLImageTargetTexStorageEXT = (C.GPEGLIMAGETARGETTEXSTORAGEEXT)(getProcAddr("glEGLImageTargetTexStorageEXT"))
+ gpEGLImageTargetTextureStorageEXT = (C.GPEGLIMAGETARGETTEXTURESTORAGEEXT)(getProcAddr("glEGLImageTargetTextureStorageEXT"))
+ gpEdgeFlagFormatNV = (C.GPEDGEFLAGFORMATNV)(getProcAddr("glEdgeFlagFormatNV"))
+ gpEnable = (C.GPENABLE)(getProcAddr("glEnable"))
+ if gpEnable == nil {
+ return errors.New("glEnable")
+ }
+ gpEnableClientStateIndexedEXT = (C.GPENABLECLIENTSTATEINDEXEDEXT)(getProcAddr("glEnableClientStateIndexedEXT"))
+ gpEnableClientStateiEXT = (C.GPENABLECLIENTSTATEIEXT)(getProcAddr("glEnableClientStateiEXT"))
+ gpEnableIndexedEXT = (C.GPENABLEINDEXEDEXT)(getProcAddr("glEnableIndexedEXT"))
+ gpEnableVertexArrayAttrib = (C.GPENABLEVERTEXARRAYATTRIB)(getProcAddr("glEnableVertexArrayAttrib"))
+ gpEnableVertexArrayAttribEXT = (C.GPENABLEVERTEXARRAYATTRIBEXT)(getProcAddr("glEnableVertexArrayAttribEXT"))
+ gpEnableVertexArrayEXT = (C.GPENABLEVERTEXARRAYEXT)(getProcAddr("glEnableVertexArrayEXT"))
+ gpEnableVertexAttribArray = (C.GPENABLEVERTEXATTRIBARRAY)(getProcAddr("glEnableVertexAttribArray"))
+ if gpEnableVertexAttribArray == nil {
+ return errors.New("glEnableVertexAttribArray")
+ }
+ gpEnablei = (C.GPENABLEI)(getProcAddr("glEnablei"))
+ if gpEnablei == nil {
+ return errors.New("glEnablei")
+ }
+ gpEndConditionalRender = (C.GPENDCONDITIONALRENDER)(getProcAddr("glEndConditionalRender"))
+ if gpEndConditionalRender == nil {
+ return errors.New("glEndConditionalRender")
+ }
+ gpEndConditionalRenderNV = (C.GPENDCONDITIONALRENDERNV)(getProcAddr("glEndConditionalRenderNV"))
+ gpEndPerfMonitorAMD = (C.GPENDPERFMONITORAMD)(getProcAddr("glEndPerfMonitorAMD"))
+ gpEndPerfQueryINTEL = (C.GPENDPERFQUERYINTEL)(getProcAddr("glEndPerfQueryINTEL"))
+ gpEndQuery = (C.GPENDQUERY)(getProcAddr("glEndQuery"))
+ if gpEndQuery == nil {
+ return errors.New("glEndQuery")
+ }
+ gpEndQueryIndexed = (C.GPENDQUERYINDEXED)(getProcAddr("glEndQueryIndexed"))
+ gpEndTransformFeedback = (C.GPENDTRANSFORMFEEDBACK)(getProcAddr("glEndTransformFeedback"))
+ if gpEndTransformFeedback == nil {
+ return errors.New("glEndTransformFeedback")
+ }
+ gpEvaluateDepthValuesARB = (C.GPEVALUATEDEPTHVALUESARB)(getProcAddr("glEvaluateDepthValuesARB"))
+ gpFenceSync = (C.GPFENCESYNC)(getProcAddr("glFenceSync"))
+ if gpFenceSync == nil {
+ return errors.New("glFenceSync")
+ }
+ gpFinish = (C.GPFINISH)(getProcAddr("glFinish"))
+ if gpFinish == nil {
+ return errors.New("glFinish")
+ }
+ gpFlush = (C.GPFLUSH)(getProcAddr("glFlush"))
+ if gpFlush == nil {
+ return errors.New("glFlush")
+ }
+ gpFlushMappedBufferRange = (C.GPFLUSHMAPPEDBUFFERRANGE)(getProcAddr("glFlushMappedBufferRange"))
+ if gpFlushMappedBufferRange == nil {
+ return errors.New("glFlushMappedBufferRange")
+ }
+ gpFlushMappedNamedBufferRange = (C.GPFLUSHMAPPEDNAMEDBUFFERRANGE)(getProcAddr("glFlushMappedNamedBufferRange"))
+ gpFlushMappedNamedBufferRangeEXT = (C.GPFLUSHMAPPEDNAMEDBUFFERRANGEEXT)(getProcAddr("glFlushMappedNamedBufferRangeEXT"))
+ gpFogCoordFormatNV = (C.GPFOGCOORDFORMATNV)(getProcAddr("glFogCoordFormatNV"))
+ gpFragmentCoverageColorNV = (C.GPFRAGMENTCOVERAGECOLORNV)(getProcAddr("glFragmentCoverageColorNV"))
+ gpFramebufferDrawBufferEXT = (C.GPFRAMEBUFFERDRAWBUFFEREXT)(getProcAddr("glFramebufferDrawBufferEXT"))
+ gpFramebufferDrawBuffersEXT = (C.GPFRAMEBUFFERDRAWBUFFERSEXT)(getProcAddr("glFramebufferDrawBuffersEXT"))
+ gpFramebufferFetchBarrierEXT = (C.GPFRAMEBUFFERFETCHBARRIEREXT)(getProcAddr("glFramebufferFetchBarrierEXT"))
+ gpFramebufferParameteri = (C.GPFRAMEBUFFERPARAMETERI)(getProcAddr("glFramebufferParameteri"))
+ gpFramebufferParameteriMESA = (C.GPFRAMEBUFFERPARAMETERIMESA)(getProcAddr("glFramebufferParameteriMESA"))
+ gpFramebufferReadBufferEXT = (C.GPFRAMEBUFFERREADBUFFEREXT)(getProcAddr("glFramebufferReadBufferEXT"))
+ gpFramebufferRenderbuffer = (C.GPFRAMEBUFFERRENDERBUFFER)(getProcAddr("glFramebufferRenderbuffer"))
+ if gpFramebufferRenderbuffer == nil {
+ return errors.New("glFramebufferRenderbuffer")
+ }
+ gpFramebufferSampleLocationsfvARB = (C.GPFRAMEBUFFERSAMPLELOCATIONSFVARB)(getProcAddr("glFramebufferSampleLocationsfvARB"))
+ gpFramebufferSampleLocationsfvNV = (C.GPFRAMEBUFFERSAMPLELOCATIONSFVNV)(getProcAddr("glFramebufferSampleLocationsfvNV"))
+ gpFramebufferTexture = (C.GPFRAMEBUFFERTEXTURE)(getProcAddr("glFramebufferTexture"))
+ if gpFramebufferTexture == nil {
+ return errors.New("glFramebufferTexture")
+ }
+ gpFramebufferTexture1D = (C.GPFRAMEBUFFERTEXTURE1D)(getProcAddr("glFramebufferTexture1D"))
+ if gpFramebufferTexture1D == nil {
+ return errors.New("glFramebufferTexture1D")
+ }
+ gpFramebufferTexture2D = (C.GPFRAMEBUFFERTEXTURE2D)(getProcAddr("glFramebufferTexture2D"))
+ if gpFramebufferTexture2D == nil {
+ return errors.New("glFramebufferTexture2D")
+ }
+ gpFramebufferTexture3D = (C.GPFRAMEBUFFERTEXTURE3D)(getProcAddr("glFramebufferTexture3D"))
+ if gpFramebufferTexture3D == nil {
+ return errors.New("glFramebufferTexture3D")
+ }
+ gpFramebufferTextureARB = (C.GPFRAMEBUFFERTEXTUREARB)(getProcAddr("glFramebufferTextureARB"))
+ gpFramebufferTextureFaceARB = (C.GPFRAMEBUFFERTEXTUREFACEARB)(getProcAddr("glFramebufferTextureFaceARB"))
+ gpFramebufferTextureLayer = (C.GPFRAMEBUFFERTEXTURELAYER)(getProcAddr("glFramebufferTextureLayer"))
+ if gpFramebufferTextureLayer == nil {
+ return errors.New("glFramebufferTextureLayer")
+ }
+ gpFramebufferTextureLayerARB = (C.GPFRAMEBUFFERTEXTURELAYERARB)(getProcAddr("glFramebufferTextureLayerARB"))
+ gpFramebufferTextureMultiviewOVR = (C.GPFRAMEBUFFERTEXTUREMULTIVIEWOVR)(getProcAddr("glFramebufferTextureMultiviewOVR"))
+ gpFrontFace = (C.GPFRONTFACE)(getProcAddr("glFrontFace"))
+ if gpFrontFace == nil {
+ return errors.New("glFrontFace")
+ }
+ gpGenBuffers = (C.GPGENBUFFERS)(getProcAddr("glGenBuffers"))
+ if gpGenBuffers == nil {
+ return errors.New("glGenBuffers")
+ }
+ gpGenFramebuffers = (C.GPGENFRAMEBUFFERS)(getProcAddr("glGenFramebuffers"))
+ if gpGenFramebuffers == nil {
+ return errors.New("glGenFramebuffers")
+ }
+ gpGenPathsNV = (C.GPGENPATHSNV)(getProcAddr("glGenPathsNV"))
+ gpGenPerfMonitorsAMD = (C.GPGENPERFMONITORSAMD)(getProcAddr("glGenPerfMonitorsAMD"))
+ gpGenProgramPipelines = (C.GPGENPROGRAMPIPELINES)(getProcAddr("glGenProgramPipelines"))
+ gpGenProgramPipelinesEXT = (C.GPGENPROGRAMPIPELINESEXT)(getProcAddr("glGenProgramPipelinesEXT"))
+ gpGenQueries = (C.GPGENQUERIES)(getProcAddr("glGenQueries"))
+ if gpGenQueries == nil {
+ return errors.New("glGenQueries")
+ }
+ gpGenRenderbuffers = (C.GPGENRENDERBUFFERS)(getProcAddr("glGenRenderbuffers"))
+ if gpGenRenderbuffers == nil {
+ return errors.New("glGenRenderbuffers")
+ }
+ gpGenSamplers = (C.GPGENSAMPLERS)(getProcAddr("glGenSamplers"))
+ if gpGenSamplers == nil {
+ return errors.New("glGenSamplers")
+ }
+ gpGenTextures = (C.GPGENTEXTURES)(getProcAddr("glGenTextures"))
+ if gpGenTextures == nil {
+ return errors.New("glGenTextures")
+ }
+ gpGenTransformFeedbacks = (C.GPGENTRANSFORMFEEDBACKS)(getProcAddr("glGenTransformFeedbacks"))
+ gpGenVertexArrays = (C.GPGENVERTEXARRAYS)(getProcAddr("glGenVertexArrays"))
+ if gpGenVertexArrays == nil {
+ return errors.New("glGenVertexArrays")
+ }
+ gpGenerateMipmap = (C.GPGENERATEMIPMAP)(getProcAddr("glGenerateMipmap"))
+ if gpGenerateMipmap == nil {
+ return errors.New("glGenerateMipmap")
+ }
+ gpGenerateMultiTexMipmapEXT = (C.GPGENERATEMULTITEXMIPMAPEXT)(getProcAddr("glGenerateMultiTexMipmapEXT"))
+ gpGenerateTextureMipmap = (C.GPGENERATETEXTUREMIPMAP)(getProcAddr("glGenerateTextureMipmap"))
+ gpGenerateTextureMipmapEXT = (C.GPGENERATETEXTUREMIPMAPEXT)(getProcAddr("glGenerateTextureMipmapEXT"))
+ gpGetActiveAtomicCounterBufferiv = (C.GPGETACTIVEATOMICCOUNTERBUFFERIV)(getProcAddr("glGetActiveAtomicCounterBufferiv"))
+ gpGetActiveAttrib = (C.GPGETACTIVEATTRIB)(getProcAddr("glGetActiveAttrib"))
+ if gpGetActiveAttrib == nil {
+ return errors.New("glGetActiveAttrib")
+ }
+ gpGetActiveSubroutineName = (C.GPGETACTIVESUBROUTINENAME)(getProcAddr("glGetActiveSubroutineName"))
+ gpGetActiveSubroutineUniformName = (C.GPGETACTIVESUBROUTINEUNIFORMNAME)(getProcAddr("glGetActiveSubroutineUniformName"))
+ gpGetActiveSubroutineUniformiv = (C.GPGETACTIVESUBROUTINEUNIFORMIV)(getProcAddr("glGetActiveSubroutineUniformiv"))
+ gpGetActiveUniform = (C.GPGETACTIVEUNIFORM)(getProcAddr("glGetActiveUniform"))
+ if gpGetActiveUniform == nil {
+ return errors.New("glGetActiveUniform")
+ }
+ gpGetActiveUniformBlockName = (C.GPGETACTIVEUNIFORMBLOCKNAME)(getProcAddr("glGetActiveUniformBlockName"))
+ if gpGetActiveUniformBlockName == nil {
+ return errors.New("glGetActiveUniformBlockName")
+ }
+ gpGetActiveUniformBlockiv = (C.GPGETACTIVEUNIFORMBLOCKIV)(getProcAddr("glGetActiveUniformBlockiv"))
+ if gpGetActiveUniformBlockiv == nil {
+ return errors.New("glGetActiveUniformBlockiv")
+ }
+ gpGetActiveUniformName = (C.GPGETACTIVEUNIFORMNAME)(getProcAddr("glGetActiveUniformName"))
+ if gpGetActiveUniformName == nil {
+ return errors.New("glGetActiveUniformName")
+ }
+ gpGetActiveUniformsiv = (C.GPGETACTIVEUNIFORMSIV)(getProcAddr("glGetActiveUniformsiv"))
+ if gpGetActiveUniformsiv == nil {
+ return errors.New("glGetActiveUniformsiv")
+ }
+ gpGetAttachedShaders = (C.GPGETATTACHEDSHADERS)(getProcAddr("glGetAttachedShaders"))
+ if gpGetAttachedShaders == nil {
+ return errors.New("glGetAttachedShaders")
+ }
+ gpGetAttribLocation = (C.GPGETATTRIBLOCATION)(getProcAddr("glGetAttribLocation"))
+ if gpGetAttribLocation == nil {
+ return errors.New("glGetAttribLocation")
+ }
+ gpGetBooleanIndexedvEXT = (C.GPGETBOOLEANINDEXEDVEXT)(getProcAddr("glGetBooleanIndexedvEXT"))
+ gpGetBooleani_v = (C.GPGETBOOLEANI_V)(getProcAddr("glGetBooleani_v"))
+ if gpGetBooleani_v == nil {
+ return errors.New("glGetBooleani_v")
+ }
+ gpGetBooleanv = (C.GPGETBOOLEANV)(getProcAddr("glGetBooleanv"))
+ if gpGetBooleanv == nil {
+ return errors.New("glGetBooleanv")
+ }
+ gpGetBufferParameteri64v = (C.GPGETBUFFERPARAMETERI64V)(getProcAddr("glGetBufferParameteri64v"))
+ if gpGetBufferParameteri64v == nil {
+ return errors.New("glGetBufferParameteri64v")
+ }
+ gpGetBufferParameteriv = (C.GPGETBUFFERPARAMETERIV)(getProcAddr("glGetBufferParameteriv"))
+ if gpGetBufferParameteriv == nil {
+ return errors.New("glGetBufferParameteriv")
+ }
+ gpGetBufferParameterui64vNV = (C.GPGETBUFFERPARAMETERUI64VNV)(getProcAddr("glGetBufferParameterui64vNV"))
+ gpGetBufferPointerv = (C.GPGETBUFFERPOINTERV)(getProcAddr("glGetBufferPointerv"))
+ if gpGetBufferPointerv == nil {
+ return errors.New("glGetBufferPointerv")
+ }
+ gpGetBufferSubData = (C.GPGETBUFFERSUBDATA)(getProcAddr("glGetBufferSubData"))
+ if gpGetBufferSubData == nil {
+ return errors.New("glGetBufferSubData")
+ }
+ gpGetCommandHeaderNV = (C.GPGETCOMMANDHEADERNV)(getProcAddr("glGetCommandHeaderNV"))
+ gpGetCompressedMultiTexImageEXT = (C.GPGETCOMPRESSEDMULTITEXIMAGEEXT)(getProcAddr("glGetCompressedMultiTexImageEXT"))
+ gpGetCompressedTexImage = (C.GPGETCOMPRESSEDTEXIMAGE)(getProcAddr("glGetCompressedTexImage"))
+ if gpGetCompressedTexImage == nil {
+ return errors.New("glGetCompressedTexImage")
+ }
+ gpGetCompressedTextureImage = (C.GPGETCOMPRESSEDTEXTUREIMAGE)(getProcAddr("glGetCompressedTextureImage"))
+ gpGetCompressedTextureImageEXT = (C.GPGETCOMPRESSEDTEXTUREIMAGEEXT)(getProcAddr("glGetCompressedTextureImageEXT"))
+ gpGetCompressedTextureSubImage = (C.GPGETCOMPRESSEDTEXTURESUBIMAGE)(getProcAddr("glGetCompressedTextureSubImage"))
+ gpGetCoverageModulationTableNV = (C.GPGETCOVERAGEMODULATIONTABLENV)(getProcAddr("glGetCoverageModulationTableNV"))
+ gpGetDebugMessageLog = (C.GPGETDEBUGMESSAGELOG)(getProcAddr("glGetDebugMessageLog"))
+ gpGetDebugMessageLogARB = (C.GPGETDEBUGMESSAGELOGARB)(getProcAddr("glGetDebugMessageLogARB"))
+ gpGetDebugMessageLogKHR = (C.GPGETDEBUGMESSAGELOGKHR)(getProcAddr("glGetDebugMessageLogKHR"))
+ gpGetDoubleIndexedvEXT = (C.GPGETDOUBLEINDEXEDVEXT)(getProcAddr("glGetDoubleIndexedvEXT"))
+ gpGetDoublei_v = (C.GPGETDOUBLEI_V)(getProcAddr("glGetDoublei_v"))
+ gpGetDoublei_vEXT = (C.GPGETDOUBLEI_VEXT)(getProcAddr("glGetDoublei_vEXT"))
+ gpGetDoublev = (C.GPGETDOUBLEV)(getProcAddr("glGetDoublev"))
+ if gpGetDoublev == nil {
+ return errors.New("glGetDoublev")
+ }
+ gpGetError = (C.GPGETERROR)(getProcAddr("glGetError"))
+ if gpGetError == nil {
+ return errors.New("glGetError")
+ }
+ gpGetFirstPerfQueryIdINTEL = (C.GPGETFIRSTPERFQUERYIDINTEL)(getProcAddr("glGetFirstPerfQueryIdINTEL"))
+ gpGetFloatIndexedvEXT = (C.GPGETFLOATINDEXEDVEXT)(getProcAddr("glGetFloatIndexedvEXT"))
+ gpGetFloati_v = (C.GPGETFLOATI_V)(getProcAddr("glGetFloati_v"))
+ gpGetFloati_vEXT = (C.GPGETFLOATI_VEXT)(getProcAddr("glGetFloati_vEXT"))
+ gpGetFloatv = (C.GPGETFLOATV)(getProcAddr("glGetFloatv"))
+ if gpGetFloatv == nil {
+ return errors.New("glGetFloatv")
+ }
+ gpGetFragDataIndex = (C.GPGETFRAGDATAINDEX)(getProcAddr("glGetFragDataIndex"))
+ if gpGetFragDataIndex == nil {
+ return errors.New("glGetFragDataIndex")
+ }
+ gpGetFragDataLocation = (C.GPGETFRAGDATALOCATION)(getProcAddr("glGetFragDataLocation"))
+ if gpGetFragDataLocation == nil {
+ return errors.New("glGetFragDataLocation")
+ }
+ gpGetFramebufferAttachmentParameteriv = (C.GPGETFRAMEBUFFERATTACHMENTPARAMETERIV)(getProcAddr("glGetFramebufferAttachmentParameteriv"))
+ if gpGetFramebufferAttachmentParameteriv == nil {
+ return errors.New("glGetFramebufferAttachmentParameteriv")
+ }
+ gpGetFramebufferParameteriv = (C.GPGETFRAMEBUFFERPARAMETERIV)(getProcAddr("glGetFramebufferParameteriv"))
+ gpGetFramebufferParameterivEXT = (C.GPGETFRAMEBUFFERPARAMETERIVEXT)(getProcAddr("glGetFramebufferParameterivEXT"))
+ gpGetFramebufferParameterivMESA = (C.GPGETFRAMEBUFFERPARAMETERIVMESA)(getProcAddr("glGetFramebufferParameterivMESA"))
+ gpGetGraphicsResetStatus = (C.GPGETGRAPHICSRESETSTATUS)(getProcAddr("glGetGraphicsResetStatus"))
+ gpGetGraphicsResetStatusARB = (C.GPGETGRAPHICSRESETSTATUSARB)(getProcAddr("glGetGraphicsResetStatusARB"))
+ gpGetGraphicsResetStatusKHR = (C.GPGETGRAPHICSRESETSTATUSKHR)(getProcAddr("glGetGraphicsResetStatusKHR"))
+ gpGetImageHandleARB = (C.GPGETIMAGEHANDLEARB)(getProcAddr("glGetImageHandleARB"))
+ gpGetImageHandleNV = (C.GPGETIMAGEHANDLENV)(getProcAddr("glGetImageHandleNV"))
+ gpGetInteger64i_v = (C.GPGETINTEGER64I_V)(getProcAddr("glGetInteger64i_v"))
+ if gpGetInteger64i_v == nil {
+ return errors.New("glGetInteger64i_v")
+ }
+ gpGetInteger64v = (C.GPGETINTEGER64V)(getProcAddr("glGetInteger64v"))
+ if gpGetInteger64v == nil {
+ return errors.New("glGetInteger64v")
+ }
+ gpGetIntegerIndexedvEXT = (C.GPGETINTEGERINDEXEDVEXT)(getProcAddr("glGetIntegerIndexedvEXT"))
+ gpGetIntegeri_v = (C.GPGETINTEGERI_V)(getProcAddr("glGetIntegeri_v"))
+ if gpGetIntegeri_v == nil {
+ return errors.New("glGetIntegeri_v")
+ }
+ gpGetIntegerui64i_vNV = (C.GPGETINTEGERUI64I_VNV)(getProcAddr("glGetIntegerui64i_vNV"))
+ gpGetIntegerui64vNV = (C.GPGETINTEGERUI64VNV)(getProcAddr("glGetIntegerui64vNV"))
+ gpGetIntegerv = (C.GPGETINTEGERV)(getProcAddr("glGetIntegerv"))
+ if gpGetIntegerv == nil {
+ return errors.New("glGetIntegerv")
+ }
+ gpGetInternalformatSampleivNV = (C.GPGETINTERNALFORMATSAMPLEIVNV)(getProcAddr("glGetInternalformatSampleivNV"))
+ gpGetInternalformati64v = (C.GPGETINTERNALFORMATI64V)(getProcAddr("glGetInternalformati64v"))
+ gpGetInternalformativ = (C.GPGETINTERNALFORMATIV)(getProcAddr("glGetInternalformativ"))
+ gpGetMemoryObjectDetachedResourcesuivNV = (C.GPGETMEMORYOBJECTDETACHEDRESOURCESUIVNV)(getProcAddr("glGetMemoryObjectDetachedResourcesuivNV"))
+ gpGetMultiTexEnvfvEXT = (C.GPGETMULTITEXENVFVEXT)(getProcAddr("glGetMultiTexEnvfvEXT"))
+ gpGetMultiTexEnvivEXT = (C.GPGETMULTITEXENVIVEXT)(getProcAddr("glGetMultiTexEnvivEXT"))
+ gpGetMultiTexGendvEXT = (C.GPGETMULTITEXGENDVEXT)(getProcAddr("glGetMultiTexGendvEXT"))
+ gpGetMultiTexGenfvEXT = (C.GPGETMULTITEXGENFVEXT)(getProcAddr("glGetMultiTexGenfvEXT"))
+ gpGetMultiTexGenivEXT = (C.GPGETMULTITEXGENIVEXT)(getProcAddr("glGetMultiTexGenivEXT"))
+ gpGetMultiTexImageEXT = (C.GPGETMULTITEXIMAGEEXT)(getProcAddr("glGetMultiTexImageEXT"))
+ gpGetMultiTexLevelParameterfvEXT = (C.GPGETMULTITEXLEVELPARAMETERFVEXT)(getProcAddr("glGetMultiTexLevelParameterfvEXT"))
+ gpGetMultiTexLevelParameterivEXT = (C.GPGETMULTITEXLEVELPARAMETERIVEXT)(getProcAddr("glGetMultiTexLevelParameterivEXT"))
+ gpGetMultiTexParameterIivEXT = (C.GPGETMULTITEXPARAMETERIIVEXT)(getProcAddr("glGetMultiTexParameterIivEXT"))
+ gpGetMultiTexParameterIuivEXT = (C.GPGETMULTITEXPARAMETERIUIVEXT)(getProcAddr("glGetMultiTexParameterIuivEXT"))
+ gpGetMultiTexParameterfvEXT = (C.GPGETMULTITEXPARAMETERFVEXT)(getProcAddr("glGetMultiTexParameterfvEXT"))
+ gpGetMultiTexParameterivEXT = (C.GPGETMULTITEXPARAMETERIVEXT)(getProcAddr("glGetMultiTexParameterivEXT"))
+ gpGetMultisamplefv = (C.GPGETMULTISAMPLEFV)(getProcAddr("glGetMultisamplefv"))
+ if gpGetMultisamplefv == nil {
+ return errors.New("glGetMultisamplefv")
+ }
+ gpGetNamedBufferParameteri64v = (C.GPGETNAMEDBUFFERPARAMETERI64V)(getProcAddr("glGetNamedBufferParameteri64v"))
+ gpGetNamedBufferParameteriv = (C.GPGETNAMEDBUFFERPARAMETERIV)(getProcAddr("glGetNamedBufferParameteriv"))
+ gpGetNamedBufferParameterivEXT = (C.GPGETNAMEDBUFFERPARAMETERIVEXT)(getProcAddr("glGetNamedBufferParameterivEXT"))
+ gpGetNamedBufferParameterui64vNV = (C.GPGETNAMEDBUFFERPARAMETERUI64VNV)(getProcAddr("glGetNamedBufferParameterui64vNV"))
+ gpGetNamedBufferPointerv = (C.GPGETNAMEDBUFFERPOINTERV)(getProcAddr("glGetNamedBufferPointerv"))
+ gpGetNamedBufferPointervEXT = (C.GPGETNAMEDBUFFERPOINTERVEXT)(getProcAddr("glGetNamedBufferPointervEXT"))
+ gpGetNamedBufferSubData = (C.GPGETNAMEDBUFFERSUBDATA)(getProcAddr("glGetNamedBufferSubData"))
+ gpGetNamedBufferSubDataEXT = (C.GPGETNAMEDBUFFERSUBDATAEXT)(getProcAddr("glGetNamedBufferSubDataEXT"))
+ gpGetNamedFramebufferAttachmentParameteriv = (C.GPGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIV)(getProcAddr("glGetNamedFramebufferAttachmentParameteriv"))
+ gpGetNamedFramebufferAttachmentParameterivEXT = (C.GPGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXT)(getProcAddr("glGetNamedFramebufferAttachmentParameterivEXT"))
+ gpGetNamedFramebufferParameteriv = (C.GPGETNAMEDFRAMEBUFFERPARAMETERIV)(getProcAddr("glGetNamedFramebufferParameteriv"))
+ gpGetNamedFramebufferParameterivEXT = (C.GPGETNAMEDFRAMEBUFFERPARAMETERIVEXT)(getProcAddr("glGetNamedFramebufferParameterivEXT"))
+ gpGetNamedProgramLocalParameterIivEXT = (C.GPGETNAMEDPROGRAMLOCALPARAMETERIIVEXT)(getProcAddr("glGetNamedProgramLocalParameterIivEXT"))
+ gpGetNamedProgramLocalParameterIuivEXT = (C.GPGETNAMEDPROGRAMLOCALPARAMETERIUIVEXT)(getProcAddr("glGetNamedProgramLocalParameterIuivEXT"))
+ gpGetNamedProgramLocalParameterdvEXT = (C.GPGETNAMEDPROGRAMLOCALPARAMETERDVEXT)(getProcAddr("glGetNamedProgramLocalParameterdvEXT"))
+ gpGetNamedProgramLocalParameterfvEXT = (C.GPGETNAMEDPROGRAMLOCALPARAMETERFVEXT)(getProcAddr("glGetNamedProgramLocalParameterfvEXT"))
+ gpGetNamedProgramStringEXT = (C.GPGETNAMEDPROGRAMSTRINGEXT)(getProcAddr("glGetNamedProgramStringEXT"))
+ gpGetNamedProgramivEXT = (C.GPGETNAMEDPROGRAMIVEXT)(getProcAddr("glGetNamedProgramivEXT"))
+ gpGetNamedRenderbufferParameteriv = (C.GPGETNAMEDRENDERBUFFERPARAMETERIV)(getProcAddr("glGetNamedRenderbufferParameteriv"))
+ gpGetNamedRenderbufferParameterivEXT = (C.GPGETNAMEDRENDERBUFFERPARAMETERIVEXT)(getProcAddr("glGetNamedRenderbufferParameterivEXT"))
+ gpGetNamedStringARB = (C.GPGETNAMEDSTRINGARB)(getProcAddr("glGetNamedStringARB"))
+ gpGetNamedStringivARB = (C.GPGETNAMEDSTRINGIVARB)(getProcAddr("glGetNamedStringivARB"))
+ gpGetNextPerfQueryIdINTEL = (C.GPGETNEXTPERFQUERYIDINTEL)(getProcAddr("glGetNextPerfQueryIdINTEL"))
+ gpGetObjectLabel = (C.GPGETOBJECTLABEL)(getProcAddr("glGetObjectLabel"))
+ gpGetObjectLabelEXT = (C.GPGETOBJECTLABELEXT)(getProcAddr("glGetObjectLabelEXT"))
+ gpGetObjectLabelKHR = (C.GPGETOBJECTLABELKHR)(getProcAddr("glGetObjectLabelKHR"))
+ gpGetObjectPtrLabel = (C.GPGETOBJECTPTRLABEL)(getProcAddr("glGetObjectPtrLabel"))
+ gpGetObjectPtrLabelKHR = (C.GPGETOBJECTPTRLABELKHR)(getProcAddr("glGetObjectPtrLabelKHR"))
+ gpGetPathCommandsNV = (C.GPGETPATHCOMMANDSNV)(getProcAddr("glGetPathCommandsNV"))
+ gpGetPathCoordsNV = (C.GPGETPATHCOORDSNV)(getProcAddr("glGetPathCoordsNV"))
+ gpGetPathDashArrayNV = (C.GPGETPATHDASHARRAYNV)(getProcAddr("glGetPathDashArrayNV"))
+ gpGetPathLengthNV = (C.GPGETPATHLENGTHNV)(getProcAddr("glGetPathLengthNV"))
+ gpGetPathMetricRangeNV = (C.GPGETPATHMETRICRANGENV)(getProcAddr("glGetPathMetricRangeNV"))
+ gpGetPathMetricsNV = (C.GPGETPATHMETRICSNV)(getProcAddr("glGetPathMetricsNV"))
+ gpGetPathParameterfvNV = (C.GPGETPATHPARAMETERFVNV)(getProcAddr("glGetPathParameterfvNV"))
+ gpGetPathParameterivNV = (C.GPGETPATHPARAMETERIVNV)(getProcAddr("glGetPathParameterivNV"))
+ gpGetPathSpacingNV = (C.GPGETPATHSPACINGNV)(getProcAddr("glGetPathSpacingNV"))
+ gpGetPerfCounterInfoINTEL = (C.GPGETPERFCOUNTERINFOINTEL)(getProcAddr("glGetPerfCounterInfoINTEL"))
+ gpGetPerfMonitorCounterDataAMD = (C.GPGETPERFMONITORCOUNTERDATAAMD)(getProcAddr("glGetPerfMonitorCounterDataAMD"))
+ gpGetPerfMonitorCounterInfoAMD = (C.GPGETPERFMONITORCOUNTERINFOAMD)(getProcAddr("glGetPerfMonitorCounterInfoAMD"))
+ gpGetPerfMonitorCounterStringAMD = (C.GPGETPERFMONITORCOUNTERSTRINGAMD)(getProcAddr("glGetPerfMonitorCounterStringAMD"))
+ gpGetPerfMonitorCountersAMD = (C.GPGETPERFMONITORCOUNTERSAMD)(getProcAddr("glGetPerfMonitorCountersAMD"))
+ gpGetPerfMonitorGroupStringAMD = (C.GPGETPERFMONITORGROUPSTRINGAMD)(getProcAddr("glGetPerfMonitorGroupStringAMD"))
+ gpGetPerfMonitorGroupsAMD = (C.GPGETPERFMONITORGROUPSAMD)(getProcAddr("glGetPerfMonitorGroupsAMD"))
+ gpGetPerfQueryDataINTEL = (C.GPGETPERFQUERYDATAINTEL)(getProcAddr("glGetPerfQueryDataINTEL"))
+ gpGetPerfQueryIdByNameINTEL = (C.GPGETPERFQUERYIDBYNAMEINTEL)(getProcAddr("glGetPerfQueryIdByNameINTEL"))
+ gpGetPerfQueryInfoINTEL = (C.GPGETPERFQUERYINFOINTEL)(getProcAddr("glGetPerfQueryInfoINTEL"))
+ gpGetPointerIndexedvEXT = (C.GPGETPOINTERINDEXEDVEXT)(getProcAddr("glGetPointerIndexedvEXT"))
+ gpGetPointeri_vEXT = (C.GPGETPOINTERI_VEXT)(getProcAddr("glGetPointeri_vEXT"))
+ gpGetPointerv = (C.GPGETPOINTERV)(getProcAddr("glGetPointerv"))
+ gpGetPointervKHR = (C.GPGETPOINTERVKHR)(getProcAddr("glGetPointervKHR"))
+ gpGetProgramBinary = (C.GPGETPROGRAMBINARY)(getProcAddr("glGetProgramBinary"))
+ gpGetProgramInfoLog = (C.GPGETPROGRAMINFOLOG)(getProcAddr("glGetProgramInfoLog"))
+ if gpGetProgramInfoLog == nil {
+ return errors.New("glGetProgramInfoLog")
+ }
+ gpGetProgramInterfaceiv = (C.GPGETPROGRAMINTERFACEIV)(getProcAddr("glGetProgramInterfaceiv"))
+ gpGetProgramPipelineInfoLog = (C.GPGETPROGRAMPIPELINEINFOLOG)(getProcAddr("glGetProgramPipelineInfoLog"))
+ gpGetProgramPipelineInfoLogEXT = (C.GPGETPROGRAMPIPELINEINFOLOGEXT)(getProcAddr("glGetProgramPipelineInfoLogEXT"))
+ gpGetProgramPipelineiv = (C.GPGETPROGRAMPIPELINEIV)(getProcAddr("glGetProgramPipelineiv"))
+ gpGetProgramPipelineivEXT = (C.GPGETPROGRAMPIPELINEIVEXT)(getProcAddr("glGetProgramPipelineivEXT"))
+ gpGetProgramResourceIndex = (C.GPGETPROGRAMRESOURCEINDEX)(getProcAddr("glGetProgramResourceIndex"))
+ gpGetProgramResourceLocation = (C.GPGETPROGRAMRESOURCELOCATION)(getProcAddr("glGetProgramResourceLocation"))
+ gpGetProgramResourceLocationIndex = (C.GPGETPROGRAMRESOURCELOCATIONINDEX)(getProcAddr("glGetProgramResourceLocationIndex"))
+ gpGetProgramResourceName = (C.GPGETPROGRAMRESOURCENAME)(getProcAddr("glGetProgramResourceName"))
+ gpGetProgramResourcefvNV = (C.GPGETPROGRAMRESOURCEFVNV)(getProcAddr("glGetProgramResourcefvNV"))
+ gpGetProgramResourceiv = (C.GPGETPROGRAMRESOURCEIV)(getProcAddr("glGetProgramResourceiv"))
+ gpGetProgramStageiv = (C.GPGETPROGRAMSTAGEIV)(getProcAddr("glGetProgramStageiv"))
+ gpGetProgramiv = (C.GPGETPROGRAMIV)(getProcAddr("glGetProgramiv"))
+ if gpGetProgramiv == nil {
+ return errors.New("glGetProgramiv")
+ }
+ gpGetQueryBufferObjecti64v = (C.GPGETQUERYBUFFEROBJECTI64V)(getProcAddr("glGetQueryBufferObjecti64v"))
+ gpGetQueryBufferObjectiv = (C.GPGETQUERYBUFFEROBJECTIV)(getProcAddr("glGetQueryBufferObjectiv"))
+ gpGetQueryBufferObjectui64v = (C.GPGETQUERYBUFFEROBJECTUI64V)(getProcAddr("glGetQueryBufferObjectui64v"))
+ gpGetQueryBufferObjectuiv = (C.GPGETQUERYBUFFEROBJECTUIV)(getProcAddr("glGetQueryBufferObjectuiv"))
+ gpGetQueryIndexediv = (C.GPGETQUERYINDEXEDIV)(getProcAddr("glGetQueryIndexediv"))
+ gpGetQueryObjecti64v = (C.GPGETQUERYOBJECTI64V)(getProcAddr("glGetQueryObjecti64v"))
+ if gpGetQueryObjecti64v == nil {
+ return errors.New("glGetQueryObjecti64v")
+ }
+ gpGetQueryObjectiv = (C.GPGETQUERYOBJECTIV)(getProcAddr("glGetQueryObjectiv"))
+ if gpGetQueryObjectiv == nil {
+ return errors.New("glGetQueryObjectiv")
+ }
+ gpGetQueryObjectui64v = (C.GPGETQUERYOBJECTUI64V)(getProcAddr("glGetQueryObjectui64v"))
+ if gpGetQueryObjectui64v == nil {
+ return errors.New("glGetQueryObjectui64v")
+ }
+ gpGetQueryObjectuiv = (C.GPGETQUERYOBJECTUIV)(getProcAddr("glGetQueryObjectuiv"))
+ if gpGetQueryObjectuiv == nil {
+ return errors.New("glGetQueryObjectuiv")
+ }
+ gpGetQueryiv = (C.GPGETQUERYIV)(getProcAddr("glGetQueryiv"))
+ if gpGetQueryiv == nil {
+ return errors.New("glGetQueryiv")
+ }
+ gpGetRenderbufferParameteriv = (C.GPGETRENDERBUFFERPARAMETERIV)(getProcAddr("glGetRenderbufferParameteriv"))
+ if gpGetRenderbufferParameteriv == nil {
+ return errors.New("glGetRenderbufferParameteriv")
+ }
+ gpGetSamplerParameterIiv = (C.GPGETSAMPLERPARAMETERIIV)(getProcAddr("glGetSamplerParameterIiv"))
+ if gpGetSamplerParameterIiv == nil {
+ return errors.New("glGetSamplerParameterIiv")
+ }
+ gpGetSamplerParameterIuiv = (C.GPGETSAMPLERPARAMETERIUIV)(getProcAddr("glGetSamplerParameterIuiv"))
+ if gpGetSamplerParameterIuiv == nil {
+ return errors.New("glGetSamplerParameterIuiv")
+ }
+ gpGetSamplerParameterfv = (C.GPGETSAMPLERPARAMETERFV)(getProcAddr("glGetSamplerParameterfv"))
+ if gpGetSamplerParameterfv == nil {
+ return errors.New("glGetSamplerParameterfv")
+ }
+ gpGetSamplerParameteriv = (C.GPGETSAMPLERPARAMETERIV)(getProcAddr("glGetSamplerParameteriv"))
+ if gpGetSamplerParameteriv == nil {
+ return errors.New("glGetSamplerParameteriv")
+ }
+ gpGetShaderInfoLog = (C.GPGETSHADERINFOLOG)(getProcAddr("glGetShaderInfoLog"))
+ if gpGetShaderInfoLog == nil {
+ return errors.New("glGetShaderInfoLog")
+ }
+ gpGetShaderPrecisionFormat = (C.GPGETSHADERPRECISIONFORMAT)(getProcAddr("glGetShaderPrecisionFormat"))
+ gpGetShaderSource = (C.GPGETSHADERSOURCE)(getProcAddr("glGetShaderSource"))
+ if gpGetShaderSource == nil {
+ return errors.New("glGetShaderSource")
+ }
+ gpGetShaderiv = (C.GPGETSHADERIV)(getProcAddr("glGetShaderiv"))
+ if gpGetShaderiv == nil {
+ return errors.New("glGetShaderiv")
+ }
+ gpGetShadingRateImagePaletteNV = (C.GPGETSHADINGRATEIMAGEPALETTENV)(getProcAddr("glGetShadingRateImagePaletteNV"))
+ gpGetShadingRateSampleLocationivNV = (C.GPGETSHADINGRATESAMPLELOCATIONIVNV)(getProcAddr("glGetShadingRateSampleLocationivNV"))
+ gpGetStageIndexNV = (C.GPGETSTAGEINDEXNV)(getProcAddr("glGetStageIndexNV"))
+ gpGetString = (C.GPGETSTRING)(getProcAddr("glGetString"))
+ if gpGetString == nil {
+ return errors.New("glGetString")
+ }
+ gpGetStringi = (C.GPGETSTRINGI)(getProcAddr("glGetStringi"))
+ if gpGetStringi == nil {
+ return errors.New("glGetStringi")
+ }
+ gpGetSubroutineIndex = (C.GPGETSUBROUTINEINDEX)(getProcAddr("glGetSubroutineIndex"))
+ gpGetSubroutineUniformLocation = (C.GPGETSUBROUTINEUNIFORMLOCATION)(getProcAddr("glGetSubroutineUniformLocation"))
+ gpGetSynciv = (C.GPGETSYNCIV)(getProcAddr("glGetSynciv"))
+ if gpGetSynciv == nil {
+ return errors.New("glGetSynciv")
+ }
+ gpGetTexImage = (C.GPGETTEXIMAGE)(getProcAddr("glGetTexImage"))
+ if gpGetTexImage == nil {
+ return errors.New("glGetTexImage")
+ }
+ gpGetTexLevelParameterfv = (C.GPGETTEXLEVELPARAMETERFV)(getProcAddr("glGetTexLevelParameterfv"))
+ if gpGetTexLevelParameterfv == nil {
+ return errors.New("glGetTexLevelParameterfv")
+ }
+ gpGetTexLevelParameteriv = (C.GPGETTEXLEVELPARAMETERIV)(getProcAddr("glGetTexLevelParameteriv"))
+ if gpGetTexLevelParameteriv == nil {
+ return errors.New("glGetTexLevelParameteriv")
+ }
+ gpGetTexParameterIiv = (C.GPGETTEXPARAMETERIIV)(getProcAddr("glGetTexParameterIiv"))
+ if gpGetTexParameterIiv == nil {
+ return errors.New("glGetTexParameterIiv")
+ }
+ gpGetTexParameterIuiv = (C.GPGETTEXPARAMETERIUIV)(getProcAddr("glGetTexParameterIuiv"))
+ if gpGetTexParameterIuiv == nil {
+ return errors.New("glGetTexParameterIuiv")
+ }
+ gpGetTexParameterfv = (C.GPGETTEXPARAMETERFV)(getProcAddr("glGetTexParameterfv"))
+ if gpGetTexParameterfv == nil {
+ return errors.New("glGetTexParameterfv")
+ }
+ gpGetTexParameteriv = (C.GPGETTEXPARAMETERIV)(getProcAddr("glGetTexParameteriv"))
+ if gpGetTexParameteriv == nil {
+ return errors.New("glGetTexParameteriv")
+ }
+ gpGetTextureHandleARB = (C.GPGETTEXTUREHANDLEARB)(getProcAddr("glGetTextureHandleARB"))
+ gpGetTextureHandleNV = (C.GPGETTEXTUREHANDLENV)(getProcAddr("glGetTextureHandleNV"))
+ gpGetTextureImage = (C.GPGETTEXTUREIMAGE)(getProcAddr("glGetTextureImage"))
+ gpGetTextureImageEXT = (C.GPGETTEXTUREIMAGEEXT)(getProcAddr("glGetTextureImageEXT"))
+ gpGetTextureLevelParameterfv = (C.GPGETTEXTURELEVELPARAMETERFV)(getProcAddr("glGetTextureLevelParameterfv"))
+ gpGetTextureLevelParameterfvEXT = (C.GPGETTEXTURELEVELPARAMETERFVEXT)(getProcAddr("glGetTextureLevelParameterfvEXT"))
+ gpGetTextureLevelParameteriv = (C.GPGETTEXTURELEVELPARAMETERIV)(getProcAddr("glGetTextureLevelParameteriv"))
+ gpGetTextureLevelParameterivEXT = (C.GPGETTEXTURELEVELPARAMETERIVEXT)(getProcAddr("glGetTextureLevelParameterivEXT"))
+ gpGetTextureParameterIiv = (C.GPGETTEXTUREPARAMETERIIV)(getProcAddr("glGetTextureParameterIiv"))
+ gpGetTextureParameterIivEXT = (C.GPGETTEXTUREPARAMETERIIVEXT)(getProcAddr("glGetTextureParameterIivEXT"))
+ gpGetTextureParameterIuiv = (C.GPGETTEXTUREPARAMETERIUIV)(getProcAddr("glGetTextureParameterIuiv"))
+ gpGetTextureParameterIuivEXT = (C.GPGETTEXTUREPARAMETERIUIVEXT)(getProcAddr("glGetTextureParameterIuivEXT"))
+ gpGetTextureParameterfv = (C.GPGETTEXTUREPARAMETERFV)(getProcAddr("glGetTextureParameterfv"))
+ gpGetTextureParameterfvEXT = (C.GPGETTEXTUREPARAMETERFVEXT)(getProcAddr("glGetTextureParameterfvEXT"))
+ gpGetTextureParameteriv = (C.GPGETTEXTUREPARAMETERIV)(getProcAddr("glGetTextureParameteriv"))
+ gpGetTextureParameterivEXT = (C.GPGETTEXTUREPARAMETERIVEXT)(getProcAddr("glGetTextureParameterivEXT"))
+ gpGetTextureSamplerHandleARB = (C.GPGETTEXTURESAMPLERHANDLEARB)(getProcAddr("glGetTextureSamplerHandleARB"))
+ gpGetTextureSamplerHandleNV = (C.GPGETTEXTURESAMPLERHANDLENV)(getProcAddr("glGetTextureSamplerHandleNV"))
+ gpGetTextureSubImage = (C.GPGETTEXTURESUBIMAGE)(getProcAddr("glGetTextureSubImage"))
+ gpGetTransformFeedbackVarying = (C.GPGETTRANSFORMFEEDBACKVARYING)(getProcAddr("glGetTransformFeedbackVarying"))
+ if gpGetTransformFeedbackVarying == nil {
+ return errors.New("glGetTransformFeedbackVarying")
+ }
+ gpGetTransformFeedbacki64_v = (C.GPGETTRANSFORMFEEDBACKI64_V)(getProcAddr("glGetTransformFeedbacki64_v"))
+ gpGetTransformFeedbacki_v = (C.GPGETTRANSFORMFEEDBACKI_V)(getProcAddr("glGetTransformFeedbacki_v"))
+ gpGetTransformFeedbackiv = (C.GPGETTRANSFORMFEEDBACKIV)(getProcAddr("glGetTransformFeedbackiv"))
+ gpGetUniformBlockIndex = (C.GPGETUNIFORMBLOCKINDEX)(getProcAddr("glGetUniformBlockIndex"))
+ if gpGetUniformBlockIndex == nil {
+ return errors.New("glGetUniformBlockIndex")
+ }
+ gpGetUniformIndices = (C.GPGETUNIFORMINDICES)(getProcAddr("glGetUniformIndices"))
+ if gpGetUniformIndices == nil {
+ return errors.New("glGetUniformIndices")
+ }
+ gpGetUniformLocation = (C.GPGETUNIFORMLOCATION)(getProcAddr("glGetUniformLocation"))
+ if gpGetUniformLocation == nil {
+ return errors.New("glGetUniformLocation")
+ }
+ gpGetUniformSubroutineuiv = (C.GPGETUNIFORMSUBROUTINEUIV)(getProcAddr("glGetUniformSubroutineuiv"))
+ gpGetUniformdv = (C.GPGETUNIFORMDV)(getProcAddr("glGetUniformdv"))
+ gpGetUniformfv = (C.GPGETUNIFORMFV)(getProcAddr("glGetUniformfv"))
+ if gpGetUniformfv == nil {
+ return errors.New("glGetUniformfv")
+ }
+ gpGetUniformi64vARB = (C.GPGETUNIFORMI64VARB)(getProcAddr("glGetUniformi64vARB"))
+ gpGetUniformi64vNV = (C.GPGETUNIFORMI64VNV)(getProcAddr("glGetUniformi64vNV"))
+ gpGetUniformiv = (C.GPGETUNIFORMIV)(getProcAddr("glGetUniformiv"))
+ if gpGetUniformiv == nil {
+ return errors.New("glGetUniformiv")
+ }
+ gpGetUniformui64vARB = (C.GPGETUNIFORMUI64VARB)(getProcAddr("glGetUniformui64vARB"))
+ gpGetUniformui64vNV = (C.GPGETUNIFORMUI64VNV)(getProcAddr("glGetUniformui64vNV"))
+ gpGetUniformuiv = (C.GPGETUNIFORMUIV)(getProcAddr("glGetUniformuiv"))
+ if gpGetUniformuiv == nil {
+ return errors.New("glGetUniformuiv")
+ }
+ gpGetVertexArrayIndexed64iv = (C.GPGETVERTEXARRAYINDEXED64IV)(getProcAddr("glGetVertexArrayIndexed64iv"))
+ gpGetVertexArrayIndexediv = (C.GPGETVERTEXARRAYINDEXEDIV)(getProcAddr("glGetVertexArrayIndexediv"))
+ gpGetVertexArrayIntegeri_vEXT = (C.GPGETVERTEXARRAYINTEGERI_VEXT)(getProcAddr("glGetVertexArrayIntegeri_vEXT"))
+ gpGetVertexArrayIntegervEXT = (C.GPGETVERTEXARRAYINTEGERVEXT)(getProcAddr("glGetVertexArrayIntegervEXT"))
+ gpGetVertexArrayPointeri_vEXT = (C.GPGETVERTEXARRAYPOINTERI_VEXT)(getProcAddr("glGetVertexArrayPointeri_vEXT"))
+ gpGetVertexArrayPointervEXT = (C.GPGETVERTEXARRAYPOINTERVEXT)(getProcAddr("glGetVertexArrayPointervEXT"))
+ gpGetVertexArrayiv = (C.GPGETVERTEXARRAYIV)(getProcAddr("glGetVertexArrayiv"))
+ gpGetVertexAttribIiv = (C.GPGETVERTEXATTRIBIIV)(getProcAddr("glGetVertexAttribIiv"))
+ if gpGetVertexAttribIiv == nil {
+ return errors.New("glGetVertexAttribIiv")
+ }
+ gpGetVertexAttribIuiv = (C.GPGETVERTEXATTRIBIUIV)(getProcAddr("glGetVertexAttribIuiv"))
+ if gpGetVertexAttribIuiv == nil {
+ return errors.New("glGetVertexAttribIuiv")
+ }
+ gpGetVertexAttribLdv = (C.GPGETVERTEXATTRIBLDV)(getProcAddr("glGetVertexAttribLdv"))
+ gpGetVertexAttribLi64vNV = (C.GPGETVERTEXATTRIBLI64VNV)(getProcAddr("glGetVertexAttribLi64vNV"))
+ gpGetVertexAttribLui64vARB = (C.GPGETVERTEXATTRIBLUI64VARB)(getProcAddr("glGetVertexAttribLui64vARB"))
+ gpGetVertexAttribLui64vNV = (C.GPGETVERTEXATTRIBLUI64VNV)(getProcAddr("glGetVertexAttribLui64vNV"))
+ gpGetVertexAttribPointerv = (C.GPGETVERTEXATTRIBPOINTERV)(getProcAddr("glGetVertexAttribPointerv"))
+ if gpGetVertexAttribPointerv == nil {
+ return errors.New("glGetVertexAttribPointerv")
+ }
+ gpGetVertexAttribdv = (C.GPGETVERTEXATTRIBDV)(getProcAddr("glGetVertexAttribdv"))
+ if gpGetVertexAttribdv == nil {
+ return errors.New("glGetVertexAttribdv")
+ }
+ gpGetVertexAttribfv = (C.GPGETVERTEXATTRIBFV)(getProcAddr("glGetVertexAttribfv"))
+ if gpGetVertexAttribfv == nil {
+ return errors.New("glGetVertexAttribfv")
+ }
+ gpGetVertexAttribiv = (C.GPGETVERTEXATTRIBIV)(getProcAddr("glGetVertexAttribiv"))
+ if gpGetVertexAttribiv == nil {
+ return errors.New("glGetVertexAttribiv")
+ }
+ gpGetVkProcAddrNV = (C.GPGETVKPROCADDRNV)(getProcAddr("glGetVkProcAddrNV"))
+ gpGetnCompressedTexImageARB = (C.GPGETNCOMPRESSEDTEXIMAGEARB)(getProcAddr("glGetnCompressedTexImageARB"))
+ gpGetnTexImageARB = (C.GPGETNTEXIMAGEARB)(getProcAddr("glGetnTexImageARB"))
+ gpGetnUniformdvARB = (C.GPGETNUNIFORMDVARB)(getProcAddr("glGetnUniformdvARB"))
+ gpGetnUniformfv = (C.GPGETNUNIFORMFV)(getProcAddr("glGetnUniformfv"))
+ gpGetnUniformfvARB = (C.GPGETNUNIFORMFVARB)(getProcAddr("glGetnUniformfvARB"))
+ gpGetnUniformfvKHR = (C.GPGETNUNIFORMFVKHR)(getProcAddr("glGetnUniformfvKHR"))
+ gpGetnUniformi64vARB = (C.GPGETNUNIFORMI64VARB)(getProcAddr("glGetnUniformi64vARB"))
+ gpGetnUniformiv = (C.GPGETNUNIFORMIV)(getProcAddr("glGetnUniformiv"))
+ gpGetnUniformivARB = (C.GPGETNUNIFORMIVARB)(getProcAddr("glGetnUniformivARB"))
+ gpGetnUniformivKHR = (C.GPGETNUNIFORMIVKHR)(getProcAddr("glGetnUniformivKHR"))
+ gpGetnUniformui64vARB = (C.GPGETNUNIFORMUI64VARB)(getProcAddr("glGetnUniformui64vARB"))
+ gpGetnUniformuiv = (C.GPGETNUNIFORMUIV)(getProcAddr("glGetnUniformuiv"))
+ gpGetnUniformuivARB = (C.GPGETNUNIFORMUIVARB)(getProcAddr("glGetnUniformuivARB"))
+ gpGetnUniformuivKHR = (C.GPGETNUNIFORMUIVKHR)(getProcAddr("glGetnUniformuivKHR"))
+ gpHint = (C.GPHINT)(getProcAddr("glHint"))
+ if gpHint == nil {
+ return errors.New("glHint")
+ }
+ gpIndexFormatNV = (C.GPINDEXFORMATNV)(getProcAddr("glIndexFormatNV"))
+ gpInsertEventMarkerEXT = (C.GPINSERTEVENTMARKEREXT)(getProcAddr("glInsertEventMarkerEXT"))
+ gpInterpolatePathsNV = (C.GPINTERPOLATEPATHSNV)(getProcAddr("glInterpolatePathsNV"))
+ gpInvalidateBufferData = (C.GPINVALIDATEBUFFERDATA)(getProcAddr("glInvalidateBufferData"))
+ gpInvalidateBufferSubData = (C.GPINVALIDATEBUFFERSUBDATA)(getProcAddr("glInvalidateBufferSubData"))
+ gpInvalidateFramebuffer = (C.GPINVALIDATEFRAMEBUFFER)(getProcAddr("glInvalidateFramebuffer"))
+ gpInvalidateNamedFramebufferData = (C.GPINVALIDATENAMEDFRAMEBUFFERDATA)(getProcAddr("glInvalidateNamedFramebufferData"))
+ gpInvalidateNamedFramebufferSubData = (C.GPINVALIDATENAMEDFRAMEBUFFERSUBDATA)(getProcAddr("glInvalidateNamedFramebufferSubData"))
+ gpInvalidateSubFramebuffer = (C.GPINVALIDATESUBFRAMEBUFFER)(getProcAddr("glInvalidateSubFramebuffer"))
+ gpInvalidateTexImage = (C.GPINVALIDATETEXIMAGE)(getProcAddr("glInvalidateTexImage"))
+ gpInvalidateTexSubImage = (C.GPINVALIDATETEXSUBIMAGE)(getProcAddr("glInvalidateTexSubImage"))
+ gpIsBuffer = (C.GPISBUFFER)(getProcAddr("glIsBuffer"))
+ if gpIsBuffer == nil {
+ return errors.New("glIsBuffer")
+ }
+ gpIsBufferResidentNV = (C.GPISBUFFERRESIDENTNV)(getProcAddr("glIsBufferResidentNV"))
+ gpIsCommandListNV = (C.GPISCOMMANDLISTNV)(getProcAddr("glIsCommandListNV"))
+ gpIsEnabled = (C.GPISENABLED)(getProcAddr("glIsEnabled"))
+ if gpIsEnabled == nil {
+ return errors.New("glIsEnabled")
+ }
+ gpIsEnabledIndexedEXT = (C.GPISENABLEDINDEXEDEXT)(getProcAddr("glIsEnabledIndexedEXT"))
+ gpIsEnabledi = (C.GPISENABLEDI)(getProcAddr("glIsEnabledi"))
+ if gpIsEnabledi == nil {
+ return errors.New("glIsEnabledi")
+ }
+ gpIsFramebuffer = (C.GPISFRAMEBUFFER)(getProcAddr("glIsFramebuffer"))
+ if gpIsFramebuffer == nil {
+ return errors.New("glIsFramebuffer")
+ }
+ gpIsImageHandleResidentARB = (C.GPISIMAGEHANDLERESIDENTARB)(getProcAddr("glIsImageHandleResidentARB"))
+ gpIsImageHandleResidentNV = (C.GPISIMAGEHANDLERESIDENTNV)(getProcAddr("glIsImageHandleResidentNV"))
+ gpIsNamedBufferResidentNV = (C.GPISNAMEDBUFFERRESIDENTNV)(getProcAddr("glIsNamedBufferResidentNV"))
+ gpIsNamedStringARB = (C.GPISNAMEDSTRINGARB)(getProcAddr("glIsNamedStringARB"))
+ gpIsPathNV = (C.GPISPATHNV)(getProcAddr("glIsPathNV"))
+ gpIsPointInFillPathNV = (C.GPISPOINTINFILLPATHNV)(getProcAddr("glIsPointInFillPathNV"))
+ gpIsPointInStrokePathNV = (C.GPISPOINTINSTROKEPATHNV)(getProcAddr("glIsPointInStrokePathNV"))
+ gpIsProgram = (C.GPISPROGRAM)(getProcAddr("glIsProgram"))
+ if gpIsProgram == nil {
+ return errors.New("glIsProgram")
+ }
+ gpIsProgramPipeline = (C.GPISPROGRAMPIPELINE)(getProcAddr("glIsProgramPipeline"))
+ gpIsProgramPipelineEXT = (C.GPISPROGRAMPIPELINEEXT)(getProcAddr("glIsProgramPipelineEXT"))
+ gpIsQuery = (C.GPISQUERY)(getProcAddr("glIsQuery"))
+ if gpIsQuery == nil {
+ return errors.New("glIsQuery")
+ }
+ gpIsRenderbuffer = (C.GPISRENDERBUFFER)(getProcAddr("glIsRenderbuffer"))
+ if gpIsRenderbuffer == nil {
+ return errors.New("glIsRenderbuffer")
+ }
+ gpIsSampler = (C.GPISSAMPLER)(getProcAddr("glIsSampler"))
+ if gpIsSampler == nil {
+ return errors.New("glIsSampler")
+ }
+ gpIsShader = (C.GPISSHADER)(getProcAddr("glIsShader"))
+ if gpIsShader == nil {
+ return errors.New("glIsShader")
+ }
+ gpIsStateNV = (C.GPISSTATENV)(getProcAddr("glIsStateNV"))
+ gpIsSync = (C.GPISSYNC)(getProcAddr("glIsSync"))
+ if gpIsSync == nil {
+ return errors.New("glIsSync")
+ }
+ gpIsTexture = (C.GPISTEXTURE)(getProcAddr("glIsTexture"))
+ if gpIsTexture == nil {
+ return errors.New("glIsTexture")
+ }
+ gpIsTextureHandleResidentARB = (C.GPISTEXTUREHANDLERESIDENTARB)(getProcAddr("glIsTextureHandleResidentARB"))
+ gpIsTextureHandleResidentNV = (C.GPISTEXTUREHANDLERESIDENTNV)(getProcAddr("glIsTextureHandleResidentNV"))
+ gpIsTransformFeedback = (C.GPISTRANSFORMFEEDBACK)(getProcAddr("glIsTransformFeedback"))
+ gpIsVertexArray = (C.GPISVERTEXARRAY)(getProcAddr("glIsVertexArray"))
+ if gpIsVertexArray == nil {
+ return errors.New("glIsVertexArray")
+ }
+ gpLabelObjectEXT = (C.GPLABELOBJECTEXT)(getProcAddr("glLabelObjectEXT"))
+ gpLineWidth = (C.GPLINEWIDTH)(getProcAddr("glLineWidth"))
+ if gpLineWidth == nil {
+ return errors.New("glLineWidth")
+ }
+ gpLinkProgram = (C.GPLINKPROGRAM)(getProcAddr("glLinkProgram"))
+ if gpLinkProgram == nil {
+ return errors.New("glLinkProgram")
+ }
+ gpListDrawCommandsStatesClientNV = (C.GPLISTDRAWCOMMANDSSTATESCLIENTNV)(getProcAddr("glListDrawCommandsStatesClientNV"))
+ gpLogicOp = (C.GPLOGICOP)(getProcAddr("glLogicOp"))
+ if gpLogicOp == nil {
+ return errors.New("glLogicOp")
+ }
+ gpMakeBufferNonResidentNV = (C.GPMAKEBUFFERNONRESIDENTNV)(getProcAddr("glMakeBufferNonResidentNV"))
+ gpMakeBufferResidentNV = (C.GPMAKEBUFFERRESIDENTNV)(getProcAddr("glMakeBufferResidentNV"))
+ gpMakeImageHandleNonResidentARB = (C.GPMAKEIMAGEHANDLENONRESIDENTARB)(getProcAddr("glMakeImageHandleNonResidentARB"))
+ gpMakeImageHandleNonResidentNV = (C.GPMAKEIMAGEHANDLENONRESIDENTNV)(getProcAddr("glMakeImageHandleNonResidentNV"))
+ gpMakeImageHandleResidentARB = (C.GPMAKEIMAGEHANDLERESIDENTARB)(getProcAddr("glMakeImageHandleResidentARB"))
+ gpMakeImageHandleResidentNV = (C.GPMAKEIMAGEHANDLERESIDENTNV)(getProcAddr("glMakeImageHandleResidentNV"))
+ gpMakeNamedBufferNonResidentNV = (C.GPMAKENAMEDBUFFERNONRESIDENTNV)(getProcAddr("glMakeNamedBufferNonResidentNV"))
+ gpMakeNamedBufferResidentNV = (C.GPMAKENAMEDBUFFERRESIDENTNV)(getProcAddr("glMakeNamedBufferResidentNV"))
+ gpMakeTextureHandleNonResidentARB = (C.GPMAKETEXTUREHANDLENONRESIDENTARB)(getProcAddr("glMakeTextureHandleNonResidentARB"))
+ gpMakeTextureHandleNonResidentNV = (C.GPMAKETEXTUREHANDLENONRESIDENTNV)(getProcAddr("glMakeTextureHandleNonResidentNV"))
+ gpMakeTextureHandleResidentARB = (C.GPMAKETEXTUREHANDLERESIDENTARB)(getProcAddr("glMakeTextureHandleResidentARB"))
+ gpMakeTextureHandleResidentNV = (C.GPMAKETEXTUREHANDLERESIDENTNV)(getProcAddr("glMakeTextureHandleResidentNV"))
+ gpMapBuffer = (C.GPMAPBUFFER)(getProcAddr("glMapBuffer"))
+ if gpMapBuffer == nil {
+ return errors.New("glMapBuffer")
+ }
+ gpMapBufferRange = (C.GPMAPBUFFERRANGE)(getProcAddr("glMapBufferRange"))
+ if gpMapBufferRange == nil {
+ return errors.New("glMapBufferRange")
+ }
+ gpMapNamedBuffer = (C.GPMAPNAMEDBUFFER)(getProcAddr("glMapNamedBuffer"))
+ gpMapNamedBufferEXT = (C.GPMAPNAMEDBUFFEREXT)(getProcAddr("glMapNamedBufferEXT"))
+ gpMapNamedBufferRange = (C.GPMAPNAMEDBUFFERRANGE)(getProcAddr("glMapNamedBufferRange"))
+ gpMapNamedBufferRangeEXT = (C.GPMAPNAMEDBUFFERRANGEEXT)(getProcAddr("glMapNamedBufferRangeEXT"))
+ gpMatrixFrustumEXT = (C.GPMATRIXFRUSTUMEXT)(getProcAddr("glMatrixFrustumEXT"))
+ gpMatrixLoad3x2fNV = (C.GPMATRIXLOAD3X2FNV)(getProcAddr("glMatrixLoad3x2fNV"))
+ gpMatrixLoad3x3fNV = (C.GPMATRIXLOAD3X3FNV)(getProcAddr("glMatrixLoad3x3fNV"))
+ gpMatrixLoadIdentityEXT = (C.GPMATRIXLOADIDENTITYEXT)(getProcAddr("glMatrixLoadIdentityEXT"))
+ gpMatrixLoadTranspose3x3fNV = (C.GPMATRIXLOADTRANSPOSE3X3FNV)(getProcAddr("glMatrixLoadTranspose3x3fNV"))
+ gpMatrixLoadTransposedEXT = (C.GPMATRIXLOADTRANSPOSEDEXT)(getProcAddr("glMatrixLoadTransposedEXT"))
+ gpMatrixLoadTransposefEXT = (C.GPMATRIXLOADTRANSPOSEFEXT)(getProcAddr("glMatrixLoadTransposefEXT"))
+ gpMatrixLoaddEXT = (C.GPMATRIXLOADDEXT)(getProcAddr("glMatrixLoaddEXT"))
+ gpMatrixLoadfEXT = (C.GPMATRIXLOADFEXT)(getProcAddr("glMatrixLoadfEXT"))
+ gpMatrixMult3x2fNV = (C.GPMATRIXMULT3X2FNV)(getProcAddr("glMatrixMult3x2fNV"))
+ gpMatrixMult3x3fNV = (C.GPMATRIXMULT3X3FNV)(getProcAddr("glMatrixMult3x3fNV"))
+ gpMatrixMultTranspose3x3fNV = (C.GPMATRIXMULTTRANSPOSE3X3FNV)(getProcAddr("glMatrixMultTranspose3x3fNV"))
+ gpMatrixMultTransposedEXT = (C.GPMATRIXMULTTRANSPOSEDEXT)(getProcAddr("glMatrixMultTransposedEXT"))
+ gpMatrixMultTransposefEXT = (C.GPMATRIXMULTTRANSPOSEFEXT)(getProcAddr("glMatrixMultTransposefEXT"))
+ gpMatrixMultdEXT = (C.GPMATRIXMULTDEXT)(getProcAddr("glMatrixMultdEXT"))
+ gpMatrixMultfEXT = (C.GPMATRIXMULTFEXT)(getProcAddr("glMatrixMultfEXT"))
+ gpMatrixOrthoEXT = (C.GPMATRIXORTHOEXT)(getProcAddr("glMatrixOrthoEXT"))
+ gpMatrixPopEXT = (C.GPMATRIXPOPEXT)(getProcAddr("glMatrixPopEXT"))
+ gpMatrixPushEXT = (C.GPMATRIXPUSHEXT)(getProcAddr("glMatrixPushEXT"))
+ gpMatrixRotatedEXT = (C.GPMATRIXROTATEDEXT)(getProcAddr("glMatrixRotatedEXT"))
+ gpMatrixRotatefEXT = (C.GPMATRIXROTATEFEXT)(getProcAddr("glMatrixRotatefEXT"))
+ gpMatrixScaledEXT = (C.GPMATRIXSCALEDEXT)(getProcAddr("glMatrixScaledEXT"))
+ gpMatrixScalefEXT = (C.GPMATRIXSCALEFEXT)(getProcAddr("glMatrixScalefEXT"))
+ gpMatrixTranslatedEXT = (C.GPMATRIXTRANSLATEDEXT)(getProcAddr("glMatrixTranslatedEXT"))
+ gpMatrixTranslatefEXT = (C.GPMATRIXTRANSLATEFEXT)(getProcAddr("glMatrixTranslatefEXT"))
+ gpMaxShaderCompilerThreadsARB = (C.GPMAXSHADERCOMPILERTHREADSARB)(getProcAddr("glMaxShaderCompilerThreadsARB"))
+ gpMaxShaderCompilerThreadsKHR = (C.GPMAXSHADERCOMPILERTHREADSKHR)(getProcAddr("glMaxShaderCompilerThreadsKHR"))
+ gpMemoryBarrier = (C.GPMEMORYBARRIER)(getProcAddr("glMemoryBarrier"))
+ gpMemoryBarrierByRegion = (C.GPMEMORYBARRIERBYREGION)(getProcAddr("glMemoryBarrierByRegion"))
+ gpMinSampleShadingARB = (C.GPMINSAMPLESHADINGARB)(getProcAddr("glMinSampleShadingARB"))
+ gpMultiDrawArrays = (C.GPMULTIDRAWARRAYS)(getProcAddr("glMultiDrawArrays"))
+ if gpMultiDrawArrays == nil {
+ return errors.New("glMultiDrawArrays")
+ }
+ gpMultiDrawArraysIndirect = (C.GPMULTIDRAWARRAYSINDIRECT)(getProcAddr("glMultiDrawArraysIndirect"))
+ gpMultiDrawArraysIndirectBindlessCountNV = (C.GPMULTIDRAWARRAYSINDIRECTBINDLESSCOUNTNV)(getProcAddr("glMultiDrawArraysIndirectBindlessCountNV"))
+ gpMultiDrawArraysIndirectBindlessNV = (C.GPMULTIDRAWARRAYSINDIRECTBINDLESSNV)(getProcAddr("glMultiDrawArraysIndirectBindlessNV"))
+ gpMultiDrawArraysIndirectCountARB = (C.GPMULTIDRAWARRAYSINDIRECTCOUNTARB)(getProcAddr("glMultiDrawArraysIndirectCountARB"))
+ gpMultiDrawElements = (C.GPMULTIDRAWELEMENTS)(getProcAddr("glMultiDrawElements"))
+ if gpMultiDrawElements == nil {
+ return errors.New("glMultiDrawElements")
+ }
+ gpMultiDrawElementsBaseVertex = (C.GPMULTIDRAWELEMENTSBASEVERTEX)(getProcAddr("glMultiDrawElementsBaseVertex"))
+ if gpMultiDrawElementsBaseVertex == nil {
+ return errors.New("glMultiDrawElementsBaseVertex")
+ }
+ gpMultiDrawElementsIndirect = (C.GPMULTIDRAWELEMENTSINDIRECT)(getProcAddr("glMultiDrawElementsIndirect"))
+ gpMultiDrawElementsIndirectBindlessCountNV = (C.GPMULTIDRAWELEMENTSINDIRECTBINDLESSCOUNTNV)(getProcAddr("glMultiDrawElementsIndirectBindlessCountNV"))
+ gpMultiDrawElementsIndirectBindlessNV = (C.GPMULTIDRAWELEMENTSINDIRECTBINDLESSNV)(getProcAddr("glMultiDrawElementsIndirectBindlessNV"))
+ gpMultiDrawElementsIndirectCountARB = (C.GPMULTIDRAWELEMENTSINDIRECTCOUNTARB)(getProcAddr("glMultiDrawElementsIndirectCountARB"))
+ gpMultiDrawMeshTasksIndirectCountNV = (C.GPMULTIDRAWMESHTASKSINDIRECTCOUNTNV)(getProcAddr("glMultiDrawMeshTasksIndirectCountNV"))
+ gpMultiDrawMeshTasksIndirectNV = (C.GPMULTIDRAWMESHTASKSINDIRECTNV)(getProcAddr("glMultiDrawMeshTasksIndirectNV"))
+ gpMultiTexBufferEXT = (C.GPMULTITEXBUFFEREXT)(getProcAddr("glMultiTexBufferEXT"))
+ gpMultiTexCoordPointerEXT = (C.GPMULTITEXCOORDPOINTEREXT)(getProcAddr("glMultiTexCoordPointerEXT"))
+ gpMultiTexEnvfEXT = (C.GPMULTITEXENVFEXT)(getProcAddr("glMultiTexEnvfEXT"))
+ gpMultiTexEnvfvEXT = (C.GPMULTITEXENVFVEXT)(getProcAddr("glMultiTexEnvfvEXT"))
+ gpMultiTexEnviEXT = (C.GPMULTITEXENVIEXT)(getProcAddr("glMultiTexEnviEXT"))
+ gpMultiTexEnvivEXT = (C.GPMULTITEXENVIVEXT)(getProcAddr("glMultiTexEnvivEXT"))
+ gpMultiTexGendEXT = (C.GPMULTITEXGENDEXT)(getProcAddr("glMultiTexGendEXT"))
+ gpMultiTexGendvEXT = (C.GPMULTITEXGENDVEXT)(getProcAddr("glMultiTexGendvEXT"))
+ gpMultiTexGenfEXT = (C.GPMULTITEXGENFEXT)(getProcAddr("glMultiTexGenfEXT"))
+ gpMultiTexGenfvEXT = (C.GPMULTITEXGENFVEXT)(getProcAddr("glMultiTexGenfvEXT"))
+ gpMultiTexGeniEXT = (C.GPMULTITEXGENIEXT)(getProcAddr("glMultiTexGeniEXT"))
+ gpMultiTexGenivEXT = (C.GPMULTITEXGENIVEXT)(getProcAddr("glMultiTexGenivEXT"))
+ gpMultiTexImage1DEXT = (C.GPMULTITEXIMAGE1DEXT)(getProcAddr("glMultiTexImage1DEXT"))
+ gpMultiTexImage2DEXT = (C.GPMULTITEXIMAGE2DEXT)(getProcAddr("glMultiTexImage2DEXT"))
+ gpMultiTexImage3DEXT = (C.GPMULTITEXIMAGE3DEXT)(getProcAddr("glMultiTexImage3DEXT"))
+ gpMultiTexParameterIivEXT = (C.GPMULTITEXPARAMETERIIVEXT)(getProcAddr("glMultiTexParameterIivEXT"))
+ gpMultiTexParameterIuivEXT = (C.GPMULTITEXPARAMETERIUIVEXT)(getProcAddr("glMultiTexParameterIuivEXT"))
+ gpMultiTexParameterfEXT = (C.GPMULTITEXPARAMETERFEXT)(getProcAddr("glMultiTexParameterfEXT"))
+ gpMultiTexParameterfvEXT = (C.GPMULTITEXPARAMETERFVEXT)(getProcAddr("glMultiTexParameterfvEXT"))
+ gpMultiTexParameteriEXT = (C.GPMULTITEXPARAMETERIEXT)(getProcAddr("glMultiTexParameteriEXT"))
+ gpMultiTexParameterivEXT = (C.GPMULTITEXPARAMETERIVEXT)(getProcAddr("glMultiTexParameterivEXT"))
+ gpMultiTexRenderbufferEXT = (C.GPMULTITEXRENDERBUFFEREXT)(getProcAddr("glMultiTexRenderbufferEXT"))
+ gpMultiTexSubImage1DEXT = (C.GPMULTITEXSUBIMAGE1DEXT)(getProcAddr("glMultiTexSubImage1DEXT"))
+ gpMultiTexSubImage2DEXT = (C.GPMULTITEXSUBIMAGE2DEXT)(getProcAddr("glMultiTexSubImage2DEXT"))
+ gpMultiTexSubImage3DEXT = (C.GPMULTITEXSUBIMAGE3DEXT)(getProcAddr("glMultiTexSubImage3DEXT"))
+ gpNamedBufferAttachMemoryNV = (C.GPNAMEDBUFFERATTACHMEMORYNV)(getProcAddr("glNamedBufferAttachMemoryNV"))
+ gpNamedBufferData = (C.GPNAMEDBUFFERDATA)(getProcAddr("glNamedBufferData"))
+ gpNamedBufferDataEXT = (C.GPNAMEDBUFFERDATAEXT)(getProcAddr("glNamedBufferDataEXT"))
+ gpNamedBufferPageCommitmentARB = (C.GPNAMEDBUFFERPAGECOMMITMENTARB)(getProcAddr("glNamedBufferPageCommitmentARB"))
+ gpNamedBufferPageCommitmentEXT = (C.GPNAMEDBUFFERPAGECOMMITMENTEXT)(getProcAddr("glNamedBufferPageCommitmentEXT"))
+ gpNamedBufferPageCommitmentMemNV = (C.GPNAMEDBUFFERPAGECOMMITMENTMEMNV)(getProcAddr("glNamedBufferPageCommitmentMemNV"))
+ gpNamedBufferStorage = (C.GPNAMEDBUFFERSTORAGE)(getProcAddr("glNamedBufferStorage"))
+ gpNamedBufferStorageEXT = (C.GPNAMEDBUFFERSTORAGEEXT)(getProcAddr("glNamedBufferStorageEXT"))
+ gpNamedBufferSubData = (C.GPNAMEDBUFFERSUBDATA)(getProcAddr("glNamedBufferSubData"))
+ gpNamedBufferSubDataEXT = (C.GPNAMEDBUFFERSUBDATAEXT)(getProcAddr("glNamedBufferSubDataEXT"))
+ gpNamedCopyBufferSubDataEXT = (C.GPNAMEDCOPYBUFFERSUBDATAEXT)(getProcAddr("glNamedCopyBufferSubDataEXT"))
+ gpNamedFramebufferDrawBuffer = (C.GPNAMEDFRAMEBUFFERDRAWBUFFER)(getProcAddr("glNamedFramebufferDrawBuffer"))
+ gpNamedFramebufferDrawBuffers = (C.GPNAMEDFRAMEBUFFERDRAWBUFFERS)(getProcAddr("glNamedFramebufferDrawBuffers"))
+ gpNamedFramebufferParameteri = (C.GPNAMEDFRAMEBUFFERPARAMETERI)(getProcAddr("glNamedFramebufferParameteri"))
+ gpNamedFramebufferParameteriEXT = (C.GPNAMEDFRAMEBUFFERPARAMETERIEXT)(getProcAddr("glNamedFramebufferParameteriEXT"))
+ gpNamedFramebufferReadBuffer = (C.GPNAMEDFRAMEBUFFERREADBUFFER)(getProcAddr("glNamedFramebufferReadBuffer"))
+ gpNamedFramebufferRenderbuffer = (C.GPNAMEDFRAMEBUFFERRENDERBUFFER)(getProcAddr("glNamedFramebufferRenderbuffer"))
+ gpNamedFramebufferRenderbufferEXT = (C.GPNAMEDFRAMEBUFFERRENDERBUFFEREXT)(getProcAddr("glNamedFramebufferRenderbufferEXT"))
+ gpNamedFramebufferSampleLocationsfvARB = (C.GPNAMEDFRAMEBUFFERSAMPLELOCATIONSFVARB)(getProcAddr("glNamedFramebufferSampleLocationsfvARB"))
+ gpNamedFramebufferSampleLocationsfvNV = (C.GPNAMEDFRAMEBUFFERSAMPLELOCATIONSFVNV)(getProcAddr("glNamedFramebufferSampleLocationsfvNV"))
+ gpNamedFramebufferTexture = (C.GPNAMEDFRAMEBUFFERTEXTURE)(getProcAddr("glNamedFramebufferTexture"))
+ gpNamedFramebufferTexture1DEXT = (C.GPNAMEDFRAMEBUFFERTEXTURE1DEXT)(getProcAddr("glNamedFramebufferTexture1DEXT"))
+ gpNamedFramebufferTexture2DEXT = (C.GPNAMEDFRAMEBUFFERTEXTURE2DEXT)(getProcAddr("glNamedFramebufferTexture2DEXT"))
+ gpNamedFramebufferTexture3DEXT = (C.GPNAMEDFRAMEBUFFERTEXTURE3DEXT)(getProcAddr("glNamedFramebufferTexture3DEXT"))
+ gpNamedFramebufferTextureEXT = (C.GPNAMEDFRAMEBUFFERTEXTUREEXT)(getProcAddr("glNamedFramebufferTextureEXT"))
+ gpNamedFramebufferTextureFaceEXT = (C.GPNAMEDFRAMEBUFFERTEXTUREFACEEXT)(getProcAddr("glNamedFramebufferTextureFaceEXT"))
+ gpNamedFramebufferTextureLayer = (C.GPNAMEDFRAMEBUFFERTEXTURELAYER)(getProcAddr("glNamedFramebufferTextureLayer"))
+ gpNamedFramebufferTextureLayerEXT = (C.GPNAMEDFRAMEBUFFERTEXTURELAYEREXT)(getProcAddr("glNamedFramebufferTextureLayerEXT"))
+ gpNamedProgramLocalParameter4dEXT = (C.GPNAMEDPROGRAMLOCALPARAMETER4DEXT)(getProcAddr("glNamedProgramLocalParameter4dEXT"))
+ gpNamedProgramLocalParameter4dvEXT = (C.GPNAMEDPROGRAMLOCALPARAMETER4DVEXT)(getProcAddr("glNamedProgramLocalParameter4dvEXT"))
+ gpNamedProgramLocalParameter4fEXT = (C.GPNAMEDPROGRAMLOCALPARAMETER4FEXT)(getProcAddr("glNamedProgramLocalParameter4fEXT"))
+ gpNamedProgramLocalParameter4fvEXT = (C.GPNAMEDPROGRAMLOCALPARAMETER4FVEXT)(getProcAddr("glNamedProgramLocalParameter4fvEXT"))
+ gpNamedProgramLocalParameterI4iEXT = (C.GPNAMEDPROGRAMLOCALPARAMETERI4IEXT)(getProcAddr("glNamedProgramLocalParameterI4iEXT"))
+ gpNamedProgramLocalParameterI4ivEXT = (C.GPNAMEDPROGRAMLOCALPARAMETERI4IVEXT)(getProcAddr("glNamedProgramLocalParameterI4ivEXT"))
+ gpNamedProgramLocalParameterI4uiEXT = (C.GPNAMEDPROGRAMLOCALPARAMETERI4UIEXT)(getProcAddr("glNamedProgramLocalParameterI4uiEXT"))
+ gpNamedProgramLocalParameterI4uivEXT = (C.GPNAMEDPROGRAMLOCALPARAMETERI4UIVEXT)(getProcAddr("glNamedProgramLocalParameterI4uivEXT"))
+ gpNamedProgramLocalParameters4fvEXT = (C.GPNAMEDPROGRAMLOCALPARAMETERS4FVEXT)(getProcAddr("glNamedProgramLocalParameters4fvEXT"))
+ gpNamedProgramLocalParametersI4ivEXT = (C.GPNAMEDPROGRAMLOCALPARAMETERSI4IVEXT)(getProcAddr("glNamedProgramLocalParametersI4ivEXT"))
+ gpNamedProgramLocalParametersI4uivEXT = (C.GPNAMEDPROGRAMLOCALPARAMETERSI4UIVEXT)(getProcAddr("glNamedProgramLocalParametersI4uivEXT"))
+ gpNamedProgramStringEXT = (C.GPNAMEDPROGRAMSTRINGEXT)(getProcAddr("glNamedProgramStringEXT"))
+ gpNamedRenderbufferStorage = (C.GPNAMEDRENDERBUFFERSTORAGE)(getProcAddr("glNamedRenderbufferStorage"))
+ gpNamedRenderbufferStorageEXT = (C.GPNAMEDRENDERBUFFERSTORAGEEXT)(getProcAddr("glNamedRenderbufferStorageEXT"))
+ gpNamedRenderbufferStorageMultisample = (C.GPNAMEDRENDERBUFFERSTORAGEMULTISAMPLE)(getProcAddr("glNamedRenderbufferStorageMultisample"))
+ gpNamedRenderbufferStorageMultisampleAdvancedAMD = (C.GPNAMEDRENDERBUFFERSTORAGEMULTISAMPLEADVANCEDAMD)(getProcAddr("glNamedRenderbufferStorageMultisampleAdvancedAMD"))
+ gpNamedRenderbufferStorageMultisampleCoverageEXT = (C.GPNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXT)(getProcAddr("glNamedRenderbufferStorageMultisampleCoverageEXT"))
+ gpNamedRenderbufferStorageMultisampleEXT = (C.GPNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXT)(getProcAddr("glNamedRenderbufferStorageMultisampleEXT"))
+ gpNamedStringARB = (C.GPNAMEDSTRINGARB)(getProcAddr("glNamedStringARB"))
+ gpNormalFormatNV = (C.GPNORMALFORMATNV)(getProcAddr("glNormalFormatNV"))
+ gpObjectLabel = (C.GPOBJECTLABEL)(getProcAddr("glObjectLabel"))
+ gpObjectLabelKHR = (C.GPOBJECTLABELKHR)(getProcAddr("glObjectLabelKHR"))
+ gpObjectPtrLabel = (C.GPOBJECTPTRLABEL)(getProcAddr("glObjectPtrLabel"))
+ gpObjectPtrLabelKHR = (C.GPOBJECTPTRLABELKHR)(getProcAddr("glObjectPtrLabelKHR"))
+ gpPatchParameterfv = (C.GPPATCHPARAMETERFV)(getProcAddr("glPatchParameterfv"))
+ gpPatchParameteri = (C.GPPATCHPARAMETERI)(getProcAddr("glPatchParameteri"))
+ gpPathCommandsNV = (C.GPPATHCOMMANDSNV)(getProcAddr("glPathCommandsNV"))
+ gpPathCoordsNV = (C.GPPATHCOORDSNV)(getProcAddr("glPathCoordsNV"))
+ gpPathCoverDepthFuncNV = (C.GPPATHCOVERDEPTHFUNCNV)(getProcAddr("glPathCoverDepthFuncNV"))
+ gpPathDashArrayNV = (C.GPPATHDASHARRAYNV)(getProcAddr("glPathDashArrayNV"))
+ gpPathGlyphIndexArrayNV = (C.GPPATHGLYPHINDEXARRAYNV)(getProcAddr("glPathGlyphIndexArrayNV"))
+ gpPathGlyphIndexRangeNV = (C.GPPATHGLYPHINDEXRANGENV)(getProcAddr("glPathGlyphIndexRangeNV"))
+ gpPathGlyphRangeNV = (C.GPPATHGLYPHRANGENV)(getProcAddr("glPathGlyphRangeNV"))
+ gpPathGlyphsNV = (C.GPPATHGLYPHSNV)(getProcAddr("glPathGlyphsNV"))
+ gpPathMemoryGlyphIndexArrayNV = (C.GPPATHMEMORYGLYPHINDEXARRAYNV)(getProcAddr("glPathMemoryGlyphIndexArrayNV"))
+ gpPathParameterfNV = (C.GPPATHPARAMETERFNV)(getProcAddr("glPathParameterfNV"))
+ gpPathParameterfvNV = (C.GPPATHPARAMETERFVNV)(getProcAddr("glPathParameterfvNV"))
+ gpPathParameteriNV = (C.GPPATHPARAMETERINV)(getProcAddr("glPathParameteriNV"))
+ gpPathParameterivNV = (C.GPPATHPARAMETERIVNV)(getProcAddr("glPathParameterivNV"))
+ gpPathStencilDepthOffsetNV = (C.GPPATHSTENCILDEPTHOFFSETNV)(getProcAddr("glPathStencilDepthOffsetNV"))
+ gpPathStencilFuncNV = (C.GPPATHSTENCILFUNCNV)(getProcAddr("glPathStencilFuncNV"))
+ gpPathStringNV = (C.GPPATHSTRINGNV)(getProcAddr("glPathStringNV"))
+ gpPathSubCommandsNV = (C.GPPATHSUBCOMMANDSNV)(getProcAddr("glPathSubCommandsNV"))
+ gpPathSubCoordsNV = (C.GPPATHSUBCOORDSNV)(getProcAddr("glPathSubCoordsNV"))
+ gpPauseTransformFeedback = (C.GPPAUSETRANSFORMFEEDBACK)(getProcAddr("glPauseTransformFeedback"))
+ gpPixelStoref = (C.GPPIXELSTOREF)(getProcAddr("glPixelStoref"))
+ if gpPixelStoref == nil {
+ return errors.New("glPixelStoref")
+ }
+ gpPixelStorei = (C.GPPIXELSTOREI)(getProcAddr("glPixelStorei"))
+ if gpPixelStorei == nil {
+ return errors.New("glPixelStorei")
+ }
+ gpPointAlongPathNV = (C.GPPOINTALONGPATHNV)(getProcAddr("glPointAlongPathNV"))
+ gpPointParameterf = (C.GPPOINTPARAMETERF)(getProcAddr("glPointParameterf"))
+ if gpPointParameterf == nil {
+ return errors.New("glPointParameterf")
+ }
+ gpPointParameterfv = (C.GPPOINTPARAMETERFV)(getProcAddr("glPointParameterfv"))
+ if gpPointParameterfv == nil {
+ return errors.New("glPointParameterfv")
+ }
+ gpPointParameteri = (C.GPPOINTPARAMETERI)(getProcAddr("glPointParameteri"))
+ if gpPointParameteri == nil {
+ return errors.New("glPointParameteri")
+ }
+ gpPointParameteriv = (C.GPPOINTPARAMETERIV)(getProcAddr("glPointParameteriv"))
+ if gpPointParameteriv == nil {
+ return errors.New("glPointParameteriv")
+ }
+ gpPointSize = (C.GPPOINTSIZE)(getProcAddr("glPointSize"))
+ if gpPointSize == nil {
+ return errors.New("glPointSize")
+ }
+ gpPolygonMode = (C.GPPOLYGONMODE)(getProcAddr("glPolygonMode"))
+ if gpPolygonMode == nil {
+ return errors.New("glPolygonMode")
+ }
+ gpPolygonOffset = (C.GPPOLYGONOFFSET)(getProcAddr("glPolygonOffset"))
+ if gpPolygonOffset == nil {
+ return errors.New("glPolygonOffset")
+ }
+ gpPolygonOffsetClamp = (C.GPPOLYGONOFFSETCLAMP)(getProcAddr("glPolygonOffsetClamp"))
+ gpPolygonOffsetClampEXT = (C.GPPOLYGONOFFSETCLAMPEXT)(getProcAddr("glPolygonOffsetClampEXT"))
+ gpPopDebugGroup = (C.GPPOPDEBUGGROUP)(getProcAddr("glPopDebugGroup"))
+ gpPopDebugGroupKHR = (C.GPPOPDEBUGGROUPKHR)(getProcAddr("glPopDebugGroupKHR"))
+ gpPopGroupMarkerEXT = (C.GPPOPGROUPMARKEREXT)(getProcAddr("glPopGroupMarkerEXT"))
+ gpPrimitiveBoundingBoxARB = (C.GPPRIMITIVEBOUNDINGBOXARB)(getProcAddr("glPrimitiveBoundingBoxARB"))
+ gpPrimitiveRestartIndex = (C.GPPRIMITIVERESTARTINDEX)(getProcAddr("glPrimitiveRestartIndex"))
+ if gpPrimitiveRestartIndex == nil {
+ return errors.New("glPrimitiveRestartIndex")
+ }
+ gpProgramBinary = (C.GPPROGRAMBINARY)(getProcAddr("glProgramBinary"))
+ gpProgramParameteri = (C.GPPROGRAMPARAMETERI)(getProcAddr("glProgramParameteri"))
+ gpProgramParameteriARB = (C.GPPROGRAMPARAMETERIARB)(getProcAddr("glProgramParameteriARB"))
+ gpProgramParameteriEXT = (C.GPPROGRAMPARAMETERIEXT)(getProcAddr("glProgramParameteriEXT"))
+ gpProgramPathFragmentInputGenNV = (C.GPPROGRAMPATHFRAGMENTINPUTGENNV)(getProcAddr("glProgramPathFragmentInputGenNV"))
+ gpProgramUniform1d = (C.GPPROGRAMUNIFORM1D)(getProcAddr("glProgramUniform1d"))
+ gpProgramUniform1dEXT = (C.GPPROGRAMUNIFORM1DEXT)(getProcAddr("glProgramUniform1dEXT"))
+ gpProgramUniform1dv = (C.GPPROGRAMUNIFORM1DV)(getProcAddr("glProgramUniform1dv"))
+ gpProgramUniform1dvEXT = (C.GPPROGRAMUNIFORM1DVEXT)(getProcAddr("glProgramUniform1dvEXT"))
+ gpProgramUniform1f = (C.GPPROGRAMUNIFORM1F)(getProcAddr("glProgramUniform1f"))
+ gpProgramUniform1fEXT = (C.GPPROGRAMUNIFORM1FEXT)(getProcAddr("glProgramUniform1fEXT"))
+ gpProgramUniform1fv = (C.GPPROGRAMUNIFORM1FV)(getProcAddr("glProgramUniform1fv"))
+ gpProgramUniform1fvEXT = (C.GPPROGRAMUNIFORM1FVEXT)(getProcAddr("glProgramUniform1fvEXT"))
+ gpProgramUniform1i = (C.GPPROGRAMUNIFORM1I)(getProcAddr("glProgramUniform1i"))
+ gpProgramUniform1i64ARB = (C.GPPROGRAMUNIFORM1I64ARB)(getProcAddr("glProgramUniform1i64ARB"))
+ gpProgramUniform1i64NV = (C.GPPROGRAMUNIFORM1I64NV)(getProcAddr("glProgramUniform1i64NV"))
+ gpProgramUniform1i64vARB = (C.GPPROGRAMUNIFORM1I64VARB)(getProcAddr("glProgramUniform1i64vARB"))
+ gpProgramUniform1i64vNV = (C.GPPROGRAMUNIFORM1I64VNV)(getProcAddr("glProgramUniform1i64vNV"))
+ gpProgramUniform1iEXT = (C.GPPROGRAMUNIFORM1IEXT)(getProcAddr("glProgramUniform1iEXT"))
+ gpProgramUniform1iv = (C.GPPROGRAMUNIFORM1IV)(getProcAddr("glProgramUniform1iv"))
+ gpProgramUniform1ivEXT = (C.GPPROGRAMUNIFORM1IVEXT)(getProcAddr("glProgramUniform1ivEXT"))
+ gpProgramUniform1ui = (C.GPPROGRAMUNIFORM1UI)(getProcAddr("glProgramUniform1ui"))
+ gpProgramUniform1ui64ARB = (C.GPPROGRAMUNIFORM1UI64ARB)(getProcAddr("glProgramUniform1ui64ARB"))
+ gpProgramUniform1ui64NV = (C.GPPROGRAMUNIFORM1UI64NV)(getProcAddr("glProgramUniform1ui64NV"))
+ gpProgramUniform1ui64vARB = (C.GPPROGRAMUNIFORM1UI64VARB)(getProcAddr("glProgramUniform1ui64vARB"))
+ gpProgramUniform1ui64vNV = (C.GPPROGRAMUNIFORM1UI64VNV)(getProcAddr("glProgramUniform1ui64vNV"))
+ gpProgramUniform1uiEXT = (C.GPPROGRAMUNIFORM1UIEXT)(getProcAddr("glProgramUniform1uiEXT"))
+ gpProgramUniform1uiv = (C.GPPROGRAMUNIFORM1UIV)(getProcAddr("glProgramUniform1uiv"))
+ gpProgramUniform1uivEXT = (C.GPPROGRAMUNIFORM1UIVEXT)(getProcAddr("glProgramUniform1uivEXT"))
+ gpProgramUniform2d = (C.GPPROGRAMUNIFORM2D)(getProcAddr("glProgramUniform2d"))
+ gpProgramUniform2dEXT = (C.GPPROGRAMUNIFORM2DEXT)(getProcAddr("glProgramUniform2dEXT"))
+ gpProgramUniform2dv = (C.GPPROGRAMUNIFORM2DV)(getProcAddr("glProgramUniform2dv"))
+ gpProgramUniform2dvEXT = (C.GPPROGRAMUNIFORM2DVEXT)(getProcAddr("glProgramUniform2dvEXT"))
+ gpProgramUniform2f = (C.GPPROGRAMUNIFORM2F)(getProcAddr("glProgramUniform2f"))
+ gpProgramUniform2fEXT = (C.GPPROGRAMUNIFORM2FEXT)(getProcAddr("glProgramUniform2fEXT"))
+ gpProgramUniform2fv = (C.GPPROGRAMUNIFORM2FV)(getProcAddr("glProgramUniform2fv"))
+ gpProgramUniform2fvEXT = (C.GPPROGRAMUNIFORM2FVEXT)(getProcAddr("glProgramUniform2fvEXT"))
+ gpProgramUniform2i = (C.GPPROGRAMUNIFORM2I)(getProcAddr("glProgramUniform2i"))
+ gpProgramUniform2i64ARB = (C.GPPROGRAMUNIFORM2I64ARB)(getProcAddr("glProgramUniform2i64ARB"))
+ gpProgramUniform2i64NV = (C.GPPROGRAMUNIFORM2I64NV)(getProcAddr("glProgramUniform2i64NV"))
+ gpProgramUniform2i64vARB = (C.GPPROGRAMUNIFORM2I64VARB)(getProcAddr("glProgramUniform2i64vARB"))
+ gpProgramUniform2i64vNV = (C.GPPROGRAMUNIFORM2I64VNV)(getProcAddr("glProgramUniform2i64vNV"))
+ gpProgramUniform2iEXT = (C.GPPROGRAMUNIFORM2IEXT)(getProcAddr("glProgramUniform2iEXT"))
+ gpProgramUniform2iv = (C.GPPROGRAMUNIFORM2IV)(getProcAddr("glProgramUniform2iv"))
+ gpProgramUniform2ivEXT = (C.GPPROGRAMUNIFORM2IVEXT)(getProcAddr("glProgramUniform2ivEXT"))
+ gpProgramUniform2ui = (C.GPPROGRAMUNIFORM2UI)(getProcAddr("glProgramUniform2ui"))
+ gpProgramUniform2ui64ARB = (C.GPPROGRAMUNIFORM2UI64ARB)(getProcAddr("glProgramUniform2ui64ARB"))
+ gpProgramUniform2ui64NV = (C.GPPROGRAMUNIFORM2UI64NV)(getProcAddr("glProgramUniform2ui64NV"))
+ gpProgramUniform2ui64vARB = (C.GPPROGRAMUNIFORM2UI64VARB)(getProcAddr("glProgramUniform2ui64vARB"))
+ gpProgramUniform2ui64vNV = (C.GPPROGRAMUNIFORM2UI64VNV)(getProcAddr("glProgramUniform2ui64vNV"))
+ gpProgramUniform2uiEXT = (C.GPPROGRAMUNIFORM2UIEXT)(getProcAddr("glProgramUniform2uiEXT"))
+ gpProgramUniform2uiv = (C.GPPROGRAMUNIFORM2UIV)(getProcAddr("glProgramUniform2uiv"))
+ gpProgramUniform2uivEXT = (C.GPPROGRAMUNIFORM2UIVEXT)(getProcAddr("glProgramUniform2uivEXT"))
+ gpProgramUniform3d = (C.GPPROGRAMUNIFORM3D)(getProcAddr("glProgramUniform3d"))
+ gpProgramUniform3dEXT = (C.GPPROGRAMUNIFORM3DEXT)(getProcAddr("glProgramUniform3dEXT"))
+ gpProgramUniform3dv = (C.GPPROGRAMUNIFORM3DV)(getProcAddr("glProgramUniform3dv"))
+ gpProgramUniform3dvEXT = (C.GPPROGRAMUNIFORM3DVEXT)(getProcAddr("glProgramUniform3dvEXT"))
+ gpProgramUniform3f = (C.GPPROGRAMUNIFORM3F)(getProcAddr("glProgramUniform3f"))
+ gpProgramUniform3fEXT = (C.GPPROGRAMUNIFORM3FEXT)(getProcAddr("glProgramUniform3fEXT"))
+ gpProgramUniform3fv = (C.GPPROGRAMUNIFORM3FV)(getProcAddr("glProgramUniform3fv"))
+ gpProgramUniform3fvEXT = (C.GPPROGRAMUNIFORM3FVEXT)(getProcAddr("glProgramUniform3fvEXT"))
+ gpProgramUniform3i = (C.GPPROGRAMUNIFORM3I)(getProcAddr("glProgramUniform3i"))
+ gpProgramUniform3i64ARB = (C.GPPROGRAMUNIFORM3I64ARB)(getProcAddr("glProgramUniform3i64ARB"))
+ gpProgramUniform3i64NV = (C.GPPROGRAMUNIFORM3I64NV)(getProcAddr("glProgramUniform3i64NV"))
+ gpProgramUniform3i64vARB = (C.GPPROGRAMUNIFORM3I64VARB)(getProcAddr("glProgramUniform3i64vARB"))
+ gpProgramUniform3i64vNV = (C.GPPROGRAMUNIFORM3I64VNV)(getProcAddr("glProgramUniform3i64vNV"))
+ gpProgramUniform3iEXT = (C.GPPROGRAMUNIFORM3IEXT)(getProcAddr("glProgramUniform3iEXT"))
+ gpProgramUniform3iv = (C.GPPROGRAMUNIFORM3IV)(getProcAddr("glProgramUniform3iv"))
+ gpProgramUniform3ivEXT = (C.GPPROGRAMUNIFORM3IVEXT)(getProcAddr("glProgramUniform3ivEXT"))
+ gpProgramUniform3ui = (C.GPPROGRAMUNIFORM3UI)(getProcAddr("glProgramUniform3ui"))
+ gpProgramUniform3ui64ARB = (C.GPPROGRAMUNIFORM3UI64ARB)(getProcAddr("glProgramUniform3ui64ARB"))
+ gpProgramUniform3ui64NV = (C.GPPROGRAMUNIFORM3UI64NV)(getProcAddr("glProgramUniform3ui64NV"))
+ gpProgramUniform3ui64vARB = (C.GPPROGRAMUNIFORM3UI64VARB)(getProcAddr("glProgramUniform3ui64vARB"))
+ gpProgramUniform3ui64vNV = (C.GPPROGRAMUNIFORM3UI64VNV)(getProcAddr("glProgramUniform3ui64vNV"))
+ gpProgramUniform3uiEXT = (C.GPPROGRAMUNIFORM3UIEXT)(getProcAddr("glProgramUniform3uiEXT"))
+ gpProgramUniform3uiv = (C.GPPROGRAMUNIFORM3UIV)(getProcAddr("glProgramUniform3uiv"))
+ gpProgramUniform3uivEXT = (C.GPPROGRAMUNIFORM3UIVEXT)(getProcAddr("glProgramUniform3uivEXT"))
+ gpProgramUniform4d = (C.GPPROGRAMUNIFORM4D)(getProcAddr("glProgramUniform4d"))
+ gpProgramUniform4dEXT = (C.GPPROGRAMUNIFORM4DEXT)(getProcAddr("glProgramUniform4dEXT"))
+ gpProgramUniform4dv = (C.GPPROGRAMUNIFORM4DV)(getProcAddr("glProgramUniform4dv"))
+ gpProgramUniform4dvEXT = (C.GPPROGRAMUNIFORM4DVEXT)(getProcAddr("glProgramUniform4dvEXT"))
+ gpProgramUniform4f = (C.GPPROGRAMUNIFORM4F)(getProcAddr("glProgramUniform4f"))
+ gpProgramUniform4fEXT = (C.GPPROGRAMUNIFORM4FEXT)(getProcAddr("glProgramUniform4fEXT"))
+ gpProgramUniform4fv = (C.GPPROGRAMUNIFORM4FV)(getProcAddr("glProgramUniform4fv"))
+ gpProgramUniform4fvEXT = (C.GPPROGRAMUNIFORM4FVEXT)(getProcAddr("glProgramUniform4fvEXT"))
+ gpProgramUniform4i = (C.GPPROGRAMUNIFORM4I)(getProcAddr("glProgramUniform4i"))
+ gpProgramUniform4i64ARB = (C.GPPROGRAMUNIFORM4I64ARB)(getProcAddr("glProgramUniform4i64ARB"))
+ gpProgramUniform4i64NV = (C.GPPROGRAMUNIFORM4I64NV)(getProcAddr("glProgramUniform4i64NV"))
+ gpProgramUniform4i64vARB = (C.GPPROGRAMUNIFORM4I64VARB)(getProcAddr("glProgramUniform4i64vARB"))
+ gpProgramUniform4i64vNV = (C.GPPROGRAMUNIFORM4I64VNV)(getProcAddr("glProgramUniform4i64vNV"))
+ gpProgramUniform4iEXT = (C.GPPROGRAMUNIFORM4IEXT)(getProcAddr("glProgramUniform4iEXT"))
+ gpProgramUniform4iv = (C.GPPROGRAMUNIFORM4IV)(getProcAddr("glProgramUniform4iv"))
+ gpProgramUniform4ivEXT = (C.GPPROGRAMUNIFORM4IVEXT)(getProcAddr("glProgramUniform4ivEXT"))
+ gpProgramUniform4ui = (C.GPPROGRAMUNIFORM4UI)(getProcAddr("glProgramUniform4ui"))
+ gpProgramUniform4ui64ARB = (C.GPPROGRAMUNIFORM4UI64ARB)(getProcAddr("glProgramUniform4ui64ARB"))
+ gpProgramUniform4ui64NV = (C.GPPROGRAMUNIFORM4UI64NV)(getProcAddr("glProgramUniform4ui64NV"))
+ gpProgramUniform4ui64vARB = (C.GPPROGRAMUNIFORM4UI64VARB)(getProcAddr("glProgramUniform4ui64vARB"))
+ gpProgramUniform4ui64vNV = (C.GPPROGRAMUNIFORM4UI64VNV)(getProcAddr("glProgramUniform4ui64vNV"))
+ gpProgramUniform4uiEXT = (C.GPPROGRAMUNIFORM4UIEXT)(getProcAddr("glProgramUniform4uiEXT"))
+ gpProgramUniform4uiv = (C.GPPROGRAMUNIFORM4UIV)(getProcAddr("glProgramUniform4uiv"))
+ gpProgramUniform4uivEXT = (C.GPPROGRAMUNIFORM4UIVEXT)(getProcAddr("glProgramUniform4uivEXT"))
+ gpProgramUniformHandleui64ARB = (C.GPPROGRAMUNIFORMHANDLEUI64ARB)(getProcAddr("glProgramUniformHandleui64ARB"))
+ gpProgramUniformHandleui64NV = (C.GPPROGRAMUNIFORMHANDLEUI64NV)(getProcAddr("glProgramUniformHandleui64NV"))
+ gpProgramUniformHandleui64vARB = (C.GPPROGRAMUNIFORMHANDLEUI64VARB)(getProcAddr("glProgramUniformHandleui64vARB"))
+ gpProgramUniformHandleui64vNV = (C.GPPROGRAMUNIFORMHANDLEUI64VNV)(getProcAddr("glProgramUniformHandleui64vNV"))
+ gpProgramUniformMatrix2dv = (C.GPPROGRAMUNIFORMMATRIX2DV)(getProcAddr("glProgramUniformMatrix2dv"))
+ gpProgramUniformMatrix2dvEXT = (C.GPPROGRAMUNIFORMMATRIX2DVEXT)(getProcAddr("glProgramUniformMatrix2dvEXT"))
+ gpProgramUniformMatrix2fv = (C.GPPROGRAMUNIFORMMATRIX2FV)(getProcAddr("glProgramUniformMatrix2fv"))
+ gpProgramUniformMatrix2fvEXT = (C.GPPROGRAMUNIFORMMATRIX2FVEXT)(getProcAddr("glProgramUniformMatrix2fvEXT"))
+ gpProgramUniformMatrix2x3dv = (C.GPPROGRAMUNIFORMMATRIX2X3DV)(getProcAddr("glProgramUniformMatrix2x3dv"))
+ gpProgramUniformMatrix2x3dvEXT = (C.GPPROGRAMUNIFORMMATRIX2X3DVEXT)(getProcAddr("glProgramUniformMatrix2x3dvEXT"))
+ gpProgramUniformMatrix2x3fv = (C.GPPROGRAMUNIFORMMATRIX2X3FV)(getProcAddr("glProgramUniformMatrix2x3fv"))
+ gpProgramUniformMatrix2x3fvEXT = (C.GPPROGRAMUNIFORMMATRIX2X3FVEXT)(getProcAddr("glProgramUniformMatrix2x3fvEXT"))
+ gpProgramUniformMatrix2x4dv = (C.GPPROGRAMUNIFORMMATRIX2X4DV)(getProcAddr("glProgramUniformMatrix2x4dv"))
+ gpProgramUniformMatrix2x4dvEXT = (C.GPPROGRAMUNIFORMMATRIX2X4DVEXT)(getProcAddr("glProgramUniformMatrix2x4dvEXT"))
+ gpProgramUniformMatrix2x4fv = (C.GPPROGRAMUNIFORMMATRIX2X4FV)(getProcAddr("glProgramUniformMatrix2x4fv"))
+ gpProgramUniformMatrix2x4fvEXT = (C.GPPROGRAMUNIFORMMATRIX2X4FVEXT)(getProcAddr("glProgramUniformMatrix2x4fvEXT"))
+ gpProgramUniformMatrix3dv = (C.GPPROGRAMUNIFORMMATRIX3DV)(getProcAddr("glProgramUniformMatrix3dv"))
+ gpProgramUniformMatrix3dvEXT = (C.GPPROGRAMUNIFORMMATRIX3DVEXT)(getProcAddr("glProgramUniformMatrix3dvEXT"))
+ gpProgramUniformMatrix3fv = (C.GPPROGRAMUNIFORMMATRIX3FV)(getProcAddr("glProgramUniformMatrix3fv"))
+ gpProgramUniformMatrix3fvEXT = (C.GPPROGRAMUNIFORMMATRIX3FVEXT)(getProcAddr("glProgramUniformMatrix3fvEXT"))
+ gpProgramUniformMatrix3x2dv = (C.GPPROGRAMUNIFORMMATRIX3X2DV)(getProcAddr("glProgramUniformMatrix3x2dv"))
+ gpProgramUniformMatrix3x2dvEXT = (C.GPPROGRAMUNIFORMMATRIX3X2DVEXT)(getProcAddr("glProgramUniformMatrix3x2dvEXT"))
+ gpProgramUniformMatrix3x2fv = (C.GPPROGRAMUNIFORMMATRIX3X2FV)(getProcAddr("glProgramUniformMatrix3x2fv"))
+ gpProgramUniformMatrix3x2fvEXT = (C.GPPROGRAMUNIFORMMATRIX3X2FVEXT)(getProcAddr("glProgramUniformMatrix3x2fvEXT"))
+ gpProgramUniformMatrix3x4dv = (C.GPPROGRAMUNIFORMMATRIX3X4DV)(getProcAddr("glProgramUniformMatrix3x4dv"))
+ gpProgramUniformMatrix3x4dvEXT = (C.GPPROGRAMUNIFORMMATRIX3X4DVEXT)(getProcAddr("glProgramUniformMatrix3x4dvEXT"))
+ gpProgramUniformMatrix3x4fv = (C.GPPROGRAMUNIFORMMATRIX3X4FV)(getProcAddr("glProgramUniformMatrix3x4fv"))
+ gpProgramUniformMatrix3x4fvEXT = (C.GPPROGRAMUNIFORMMATRIX3X4FVEXT)(getProcAddr("glProgramUniformMatrix3x4fvEXT"))
+ gpProgramUniformMatrix4dv = (C.GPPROGRAMUNIFORMMATRIX4DV)(getProcAddr("glProgramUniformMatrix4dv"))
+ gpProgramUniformMatrix4dvEXT = (C.GPPROGRAMUNIFORMMATRIX4DVEXT)(getProcAddr("glProgramUniformMatrix4dvEXT"))
+ gpProgramUniformMatrix4fv = (C.GPPROGRAMUNIFORMMATRIX4FV)(getProcAddr("glProgramUniformMatrix4fv"))
+ gpProgramUniformMatrix4fvEXT = (C.GPPROGRAMUNIFORMMATRIX4FVEXT)(getProcAddr("glProgramUniformMatrix4fvEXT"))
+ gpProgramUniformMatrix4x2dv = (C.GPPROGRAMUNIFORMMATRIX4X2DV)(getProcAddr("glProgramUniformMatrix4x2dv"))
+ gpProgramUniformMatrix4x2dvEXT = (C.GPPROGRAMUNIFORMMATRIX4X2DVEXT)(getProcAddr("glProgramUniformMatrix4x2dvEXT"))
+ gpProgramUniformMatrix4x2fv = (C.GPPROGRAMUNIFORMMATRIX4X2FV)(getProcAddr("glProgramUniformMatrix4x2fv"))
+ gpProgramUniformMatrix4x2fvEXT = (C.GPPROGRAMUNIFORMMATRIX4X2FVEXT)(getProcAddr("glProgramUniformMatrix4x2fvEXT"))
+ gpProgramUniformMatrix4x3dv = (C.GPPROGRAMUNIFORMMATRIX4X3DV)(getProcAddr("glProgramUniformMatrix4x3dv"))
+ gpProgramUniformMatrix4x3dvEXT = (C.GPPROGRAMUNIFORMMATRIX4X3DVEXT)(getProcAddr("glProgramUniformMatrix4x3dvEXT"))
+ gpProgramUniformMatrix4x3fv = (C.GPPROGRAMUNIFORMMATRIX4X3FV)(getProcAddr("glProgramUniformMatrix4x3fv"))
+ gpProgramUniformMatrix4x3fvEXT = (C.GPPROGRAMUNIFORMMATRIX4X3FVEXT)(getProcAddr("glProgramUniformMatrix4x3fvEXT"))
+ gpProgramUniformui64NV = (C.GPPROGRAMUNIFORMUI64NV)(getProcAddr("glProgramUniformui64NV"))
+ gpProgramUniformui64vNV = (C.GPPROGRAMUNIFORMUI64VNV)(getProcAddr("glProgramUniformui64vNV"))
+ gpProvokingVertex = (C.GPPROVOKINGVERTEX)(getProcAddr("glProvokingVertex"))
+ if gpProvokingVertex == nil {
+ return errors.New("glProvokingVertex")
+ }
+ gpPushClientAttribDefaultEXT = (C.GPPUSHCLIENTATTRIBDEFAULTEXT)(getProcAddr("glPushClientAttribDefaultEXT"))
+ gpPushDebugGroup = (C.GPPUSHDEBUGGROUP)(getProcAddr("glPushDebugGroup"))
+ gpPushDebugGroupKHR = (C.GPPUSHDEBUGGROUPKHR)(getProcAddr("glPushDebugGroupKHR"))
+ gpPushGroupMarkerEXT = (C.GPPUSHGROUPMARKEREXT)(getProcAddr("glPushGroupMarkerEXT"))
+ gpQueryCounter = (C.GPQUERYCOUNTER)(getProcAddr("glQueryCounter"))
+ if gpQueryCounter == nil {
+ return errors.New("glQueryCounter")
+ }
+ gpRasterSamplesEXT = (C.GPRASTERSAMPLESEXT)(getProcAddr("glRasterSamplesEXT"))
+ gpReadBuffer = (C.GPREADBUFFER)(getProcAddr("glReadBuffer"))
+ if gpReadBuffer == nil {
+ return errors.New("glReadBuffer")
+ }
+ gpReadPixels = (C.GPREADPIXELS)(getProcAddr("glReadPixels"))
+ if gpReadPixels == nil {
+ return errors.New("glReadPixels")
+ }
+ gpReadnPixels = (C.GPREADNPIXELS)(getProcAddr("glReadnPixels"))
+ gpReadnPixelsARB = (C.GPREADNPIXELSARB)(getProcAddr("glReadnPixelsARB"))
+ gpReadnPixelsKHR = (C.GPREADNPIXELSKHR)(getProcAddr("glReadnPixelsKHR"))
+ gpReleaseShaderCompiler = (C.GPRELEASESHADERCOMPILER)(getProcAddr("glReleaseShaderCompiler"))
+ gpRenderbufferStorage = (C.GPRENDERBUFFERSTORAGE)(getProcAddr("glRenderbufferStorage"))
+ if gpRenderbufferStorage == nil {
+ return errors.New("glRenderbufferStorage")
+ }
+ gpRenderbufferStorageMultisample = (C.GPRENDERBUFFERSTORAGEMULTISAMPLE)(getProcAddr("glRenderbufferStorageMultisample"))
+ if gpRenderbufferStorageMultisample == nil {
+ return errors.New("glRenderbufferStorageMultisample")
+ }
+ gpRenderbufferStorageMultisampleAdvancedAMD = (C.GPRENDERBUFFERSTORAGEMULTISAMPLEADVANCEDAMD)(getProcAddr("glRenderbufferStorageMultisampleAdvancedAMD"))
+ gpRenderbufferStorageMultisampleCoverageNV = (C.GPRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENV)(getProcAddr("glRenderbufferStorageMultisampleCoverageNV"))
+ gpResetMemoryObjectParameterNV = (C.GPRESETMEMORYOBJECTPARAMETERNV)(getProcAddr("glResetMemoryObjectParameterNV"))
+ gpResolveDepthValuesNV = (C.GPRESOLVEDEPTHVALUESNV)(getProcAddr("glResolveDepthValuesNV"))
+ gpResumeTransformFeedback = (C.GPRESUMETRANSFORMFEEDBACK)(getProcAddr("glResumeTransformFeedback"))
+ gpSampleCoverage = (C.GPSAMPLECOVERAGE)(getProcAddr("glSampleCoverage"))
+ if gpSampleCoverage == nil {
+ return errors.New("glSampleCoverage")
+ }
+ gpSampleMaski = (C.GPSAMPLEMASKI)(getProcAddr("glSampleMaski"))
+ if gpSampleMaski == nil {
+ return errors.New("glSampleMaski")
+ }
+ gpSamplerParameterIiv = (C.GPSAMPLERPARAMETERIIV)(getProcAddr("glSamplerParameterIiv"))
+ if gpSamplerParameterIiv == nil {
+ return errors.New("glSamplerParameterIiv")
+ }
+ gpSamplerParameterIuiv = (C.GPSAMPLERPARAMETERIUIV)(getProcAddr("glSamplerParameterIuiv"))
+ if gpSamplerParameterIuiv == nil {
+ return errors.New("glSamplerParameterIuiv")
+ }
+ gpSamplerParameterf = (C.GPSAMPLERPARAMETERF)(getProcAddr("glSamplerParameterf"))
+ if gpSamplerParameterf == nil {
+ return errors.New("glSamplerParameterf")
+ }
+ gpSamplerParameterfv = (C.GPSAMPLERPARAMETERFV)(getProcAddr("glSamplerParameterfv"))
+ if gpSamplerParameterfv == nil {
+ return errors.New("glSamplerParameterfv")
+ }
+ gpSamplerParameteri = (C.GPSAMPLERPARAMETERI)(getProcAddr("glSamplerParameteri"))
+ if gpSamplerParameteri == nil {
+ return errors.New("glSamplerParameteri")
+ }
+ gpSamplerParameteriv = (C.GPSAMPLERPARAMETERIV)(getProcAddr("glSamplerParameteriv"))
+ if gpSamplerParameteriv == nil {
+ return errors.New("glSamplerParameteriv")
+ }
+ gpScissor = (C.GPSCISSOR)(getProcAddr("glScissor"))
+ if gpScissor == nil {
+ return errors.New("glScissor")
+ }
+ gpScissorArrayv = (C.GPSCISSORARRAYV)(getProcAddr("glScissorArrayv"))
+ gpScissorExclusiveArrayvNV = (C.GPSCISSOREXCLUSIVEARRAYVNV)(getProcAddr("glScissorExclusiveArrayvNV"))
+ gpScissorExclusiveNV = (C.GPSCISSOREXCLUSIVENV)(getProcAddr("glScissorExclusiveNV"))
+ gpScissorIndexed = (C.GPSCISSORINDEXED)(getProcAddr("glScissorIndexed"))
+ gpScissorIndexedv = (C.GPSCISSORINDEXEDV)(getProcAddr("glScissorIndexedv"))
+ gpSecondaryColorFormatNV = (C.GPSECONDARYCOLORFORMATNV)(getProcAddr("glSecondaryColorFormatNV"))
+ gpSelectPerfMonitorCountersAMD = (C.GPSELECTPERFMONITORCOUNTERSAMD)(getProcAddr("glSelectPerfMonitorCountersAMD"))
+ gpShaderBinary = (C.GPSHADERBINARY)(getProcAddr("glShaderBinary"))
+ gpShaderSource = (C.GPSHADERSOURCE)(getProcAddr("glShaderSource"))
+ if gpShaderSource == nil {
+ return errors.New("glShaderSource")
+ }
+ gpShaderStorageBlockBinding = (C.GPSHADERSTORAGEBLOCKBINDING)(getProcAddr("glShaderStorageBlockBinding"))
+ gpShadingRateImageBarrierNV = (C.GPSHADINGRATEIMAGEBARRIERNV)(getProcAddr("glShadingRateImageBarrierNV"))
+ gpShadingRateImagePaletteNV = (C.GPSHADINGRATEIMAGEPALETTENV)(getProcAddr("glShadingRateImagePaletteNV"))
+ gpShadingRateSampleOrderCustomNV = (C.GPSHADINGRATESAMPLEORDERCUSTOMNV)(getProcAddr("glShadingRateSampleOrderCustomNV"))
+ gpShadingRateSampleOrderNV = (C.GPSHADINGRATESAMPLEORDERNV)(getProcAddr("glShadingRateSampleOrderNV"))
+ gpSignalVkFenceNV = (C.GPSIGNALVKFENCENV)(getProcAddr("glSignalVkFenceNV"))
+ gpSignalVkSemaphoreNV = (C.GPSIGNALVKSEMAPHORENV)(getProcAddr("glSignalVkSemaphoreNV"))
+ gpSpecializeShaderARB = (C.GPSPECIALIZESHADERARB)(getProcAddr("glSpecializeShaderARB"))
+ gpStateCaptureNV = (C.GPSTATECAPTURENV)(getProcAddr("glStateCaptureNV"))
+ gpStencilFillPathInstancedNV = (C.GPSTENCILFILLPATHINSTANCEDNV)(getProcAddr("glStencilFillPathInstancedNV"))
+ gpStencilFillPathNV = (C.GPSTENCILFILLPATHNV)(getProcAddr("glStencilFillPathNV"))
+ gpStencilFunc = (C.GPSTENCILFUNC)(getProcAddr("glStencilFunc"))
+ if gpStencilFunc == nil {
+ return errors.New("glStencilFunc")
+ }
+ gpStencilFuncSeparate = (C.GPSTENCILFUNCSEPARATE)(getProcAddr("glStencilFuncSeparate"))
+ if gpStencilFuncSeparate == nil {
+ return errors.New("glStencilFuncSeparate")
+ }
+ gpStencilMask = (C.GPSTENCILMASK)(getProcAddr("glStencilMask"))
+ if gpStencilMask == nil {
+ return errors.New("glStencilMask")
+ }
+ gpStencilMaskSeparate = (C.GPSTENCILMASKSEPARATE)(getProcAddr("glStencilMaskSeparate"))
+ if gpStencilMaskSeparate == nil {
+ return errors.New("glStencilMaskSeparate")
+ }
+ gpStencilOp = (C.GPSTENCILOP)(getProcAddr("glStencilOp"))
+ if gpStencilOp == nil {
+ return errors.New("glStencilOp")
+ }
+ gpStencilOpSeparate = (C.GPSTENCILOPSEPARATE)(getProcAddr("glStencilOpSeparate"))
+ if gpStencilOpSeparate == nil {
+ return errors.New("glStencilOpSeparate")
+ }
+ gpStencilStrokePathInstancedNV = (C.GPSTENCILSTROKEPATHINSTANCEDNV)(getProcAddr("glStencilStrokePathInstancedNV"))
+ gpStencilStrokePathNV = (C.GPSTENCILSTROKEPATHNV)(getProcAddr("glStencilStrokePathNV"))
+ gpStencilThenCoverFillPathInstancedNV = (C.GPSTENCILTHENCOVERFILLPATHINSTANCEDNV)(getProcAddr("glStencilThenCoverFillPathInstancedNV"))
+ gpStencilThenCoverFillPathNV = (C.GPSTENCILTHENCOVERFILLPATHNV)(getProcAddr("glStencilThenCoverFillPathNV"))
+ gpStencilThenCoverStrokePathInstancedNV = (C.GPSTENCILTHENCOVERSTROKEPATHINSTANCEDNV)(getProcAddr("glStencilThenCoverStrokePathInstancedNV"))
+ gpStencilThenCoverStrokePathNV = (C.GPSTENCILTHENCOVERSTROKEPATHNV)(getProcAddr("glStencilThenCoverStrokePathNV"))
+ gpSubpixelPrecisionBiasNV = (C.GPSUBPIXELPRECISIONBIASNV)(getProcAddr("glSubpixelPrecisionBiasNV"))
+ gpTexAttachMemoryNV = (C.GPTEXATTACHMEMORYNV)(getProcAddr("glTexAttachMemoryNV"))
+ gpTexBuffer = (C.GPTEXBUFFER)(getProcAddr("glTexBuffer"))
+ if gpTexBuffer == nil {
+ return errors.New("glTexBuffer")
+ }
+ gpTexBufferARB = (C.GPTEXBUFFERARB)(getProcAddr("glTexBufferARB"))
+ gpTexBufferRange = (C.GPTEXBUFFERRANGE)(getProcAddr("glTexBufferRange"))
+ gpTexCoordFormatNV = (C.GPTEXCOORDFORMATNV)(getProcAddr("glTexCoordFormatNV"))
+ gpTexImage1D = (C.GPTEXIMAGE1D)(getProcAddr("glTexImage1D"))
+ if gpTexImage1D == nil {
+ return errors.New("glTexImage1D")
+ }
+ gpTexImage2D = (C.GPTEXIMAGE2D)(getProcAddr("glTexImage2D"))
+ if gpTexImage2D == nil {
+ return errors.New("glTexImage2D")
+ }
+ gpTexImage2DMultisample = (C.GPTEXIMAGE2DMULTISAMPLE)(getProcAddr("glTexImage2DMultisample"))
+ if gpTexImage2DMultisample == nil {
+ return errors.New("glTexImage2DMultisample")
+ }
+ gpTexImage3D = (C.GPTEXIMAGE3D)(getProcAddr("glTexImage3D"))
+ if gpTexImage3D == nil {
+ return errors.New("glTexImage3D")
+ }
+ gpTexImage3DMultisample = (C.GPTEXIMAGE3DMULTISAMPLE)(getProcAddr("glTexImage3DMultisample"))
+ if gpTexImage3DMultisample == nil {
+ return errors.New("glTexImage3DMultisample")
+ }
+ gpTexPageCommitmentARB = (C.GPTEXPAGECOMMITMENTARB)(getProcAddr("glTexPageCommitmentARB"))
+ gpTexPageCommitmentMemNV = (C.GPTEXPAGECOMMITMENTMEMNV)(getProcAddr("glTexPageCommitmentMemNV"))
+ gpTexParameterIiv = (C.GPTEXPARAMETERIIV)(getProcAddr("glTexParameterIiv"))
+ if gpTexParameterIiv == nil {
+ return errors.New("glTexParameterIiv")
+ }
+ gpTexParameterIuiv = (C.GPTEXPARAMETERIUIV)(getProcAddr("glTexParameterIuiv"))
+ if gpTexParameterIuiv == nil {
+ return errors.New("glTexParameterIuiv")
+ }
+ gpTexParameterf = (C.GPTEXPARAMETERF)(getProcAddr("glTexParameterf"))
+ if gpTexParameterf == nil {
+ return errors.New("glTexParameterf")
+ }
+ gpTexParameterfv = (C.GPTEXPARAMETERFV)(getProcAddr("glTexParameterfv"))
+ if gpTexParameterfv == nil {
+ return errors.New("glTexParameterfv")
+ }
+ gpTexParameteri = (C.GPTEXPARAMETERI)(getProcAddr("glTexParameteri"))
+ if gpTexParameteri == nil {
+ return errors.New("glTexParameteri")
+ }
+ gpTexParameteriv = (C.GPTEXPARAMETERIV)(getProcAddr("glTexParameteriv"))
+ if gpTexParameteriv == nil {
+ return errors.New("glTexParameteriv")
+ }
+ gpTexStorage1D = (C.GPTEXSTORAGE1D)(getProcAddr("glTexStorage1D"))
+ gpTexStorage2D = (C.GPTEXSTORAGE2D)(getProcAddr("glTexStorage2D"))
+ gpTexStorage2DMultisample = (C.GPTEXSTORAGE2DMULTISAMPLE)(getProcAddr("glTexStorage2DMultisample"))
+ gpTexStorage3D = (C.GPTEXSTORAGE3D)(getProcAddr("glTexStorage3D"))
+ gpTexStorage3DMultisample = (C.GPTEXSTORAGE3DMULTISAMPLE)(getProcAddr("glTexStorage3DMultisample"))
+ gpTexSubImage1D = (C.GPTEXSUBIMAGE1D)(getProcAddr("glTexSubImage1D"))
+ if gpTexSubImage1D == nil {
+ return errors.New("glTexSubImage1D")
+ }
+ gpTexSubImage2D = (C.GPTEXSUBIMAGE2D)(getProcAddr("glTexSubImage2D"))
+ if gpTexSubImage2D == nil {
+ return errors.New("glTexSubImage2D")
+ }
+ gpTexSubImage3D = (C.GPTEXSUBIMAGE3D)(getProcAddr("glTexSubImage3D"))
+ if gpTexSubImage3D == nil {
+ return errors.New("glTexSubImage3D")
+ }
+ gpTextureAttachMemoryNV = (C.GPTEXTUREATTACHMEMORYNV)(getProcAddr("glTextureAttachMemoryNV"))
+ gpTextureBarrier = (C.GPTEXTUREBARRIER)(getProcAddr("glTextureBarrier"))
+ gpTextureBarrierNV = (C.GPTEXTUREBARRIERNV)(getProcAddr("glTextureBarrierNV"))
+ gpTextureBuffer = (C.GPTEXTUREBUFFER)(getProcAddr("glTextureBuffer"))
+ gpTextureBufferEXT = (C.GPTEXTUREBUFFEREXT)(getProcAddr("glTextureBufferEXT"))
+ gpTextureBufferRange = (C.GPTEXTUREBUFFERRANGE)(getProcAddr("glTextureBufferRange"))
+ gpTextureBufferRangeEXT = (C.GPTEXTUREBUFFERRANGEEXT)(getProcAddr("glTextureBufferRangeEXT"))
+ gpTextureImage1DEXT = (C.GPTEXTUREIMAGE1DEXT)(getProcAddr("glTextureImage1DEXT"))
+ gpTextureImage2DEXT = (C.GPTEXTUREIMAGE2DEXT)(getProcAddr("glTextureImage2DEXT"))
+ gpTextureImage3DEXT = (C.GPTEXTUREIMAGE3DEXT)(getProcAddr("glTextureImage3DEXT"))
+ gpTexturePageCommitmentEXT = (C.GPTEXTUREPAGECOMMITMENTEXT)(getProcAddr("glTexturePageCommitmentEXT"))
+ gpTexturePageCommitmentMemNV = (C.GPTEXTUREPAGECOMMITMENTMEMNV)(getProcAddr("glTexturePageCommitmentMemNV"))
+ gpTextureParameterIiv = (C.GPTEXTUREPARAMETERIIV)(getProcAddr("glTextureParameterIiv"))
+ gpTextureParameterIivEXT = (C.GPTEXTUREPARAMETERIIVEXT)(getProcAddr("glTextureParameterIivEXT"))
+ gpTextureParameterIuiv = (C.GPTEXTUREPARAMETERIUIV)(getProcAddr("glTextureParameterIuiv"))
+ gpTextureParameterIuivEXT = (C.GPTEXTUREPARAMETERIUIVEXT)(getProcAddr("glTextureParameterIuivEXT"))
+ gpTextureParameterf = (C.GPTEXTUREPARAMETERF)(getProcAddr("glTextureParameterf"))
+ gpTextureParameterfEXT = (C.GPTEXTUREPARAMETERFEXT)(getProcAddr("glTextureParameterfEXT"))
+ gpTextureParameterfv = (C.GPTEXTUREPARAMETERFV)(getProcAddr("glTextureParameterfv"))
+ gpTextureParameterfvEXT = (C.GPTEXTUREPARAMETERFVEXT)(getProcAddr("glTextureParameterfvEXT"))
+ gpTextureParameteri = (C.GPTEXTUREPARAMETERI)(getProcAddr("glTextureParameteri"))
+ gpTextureParameteriEXT = (C.GPTEXTUREPARAMETERIEXT)(getProcAddr("glTextureParameteriEXT"))
+ gpTextureParameteriv = (C.GPTEXTUREPARAMETERIV)(getProcAddr("glTextureParameteriv"))
+ gpTextureParameterivEXT = (C.GPTEXTUREPARAMETERIVEXT)(getProcAddr("glTextureParameterivEXT"))
+ gpTextureRenderbufferEXT = (C.GPTEXTURERENDERBUFFEREXT)(getProcAddr("glTextureRenderbufferEXT"))
+ gpTextureStorage1D = (C.GPTEXTURESTORAGE1D)(getProcAddr("glTextureStorage1D"))
+ gpTextureStorage1DEXT = (C.GPTEXTURESTORAGE1DEXT)(getProcAddr("glTextureStorage1DEXT"))
+ gpTextureStorage2D = (C.GPTEXTURESTORAGE2D)(getProcAddr("glTextureStorage2D"))
+ gpTextureStorage2DEXT = (C.GPTEXTURESTORAGE2DEXT)(getProcAddr("glTextureStorage2DEXT"))
+ gpTextureStorage2DMultisample = (C.GPTEXTURESTORAGE2DMULTISAMPLE)(getProcAddr("glTextureStorage2DMultisample"))
+ gpTextureStorage2DMultisampleEXT = (C.GPTEXTURESTORAGE2DMULTISAMPLEEXT)(getProcAddr("glTextureStorage2DMultisampleEXT"))
+ gpTextureStorage3D = (C.GPTEXTURESTORAGE3D)(getProcAddr("glTextureStorage3D"))
+ gpTextureStorage3DEXT = (C.GPTEXTURESTORAGE3DEXT)(getProcAddr("glTextureStorage3DEXT"))
+ gpTextureStorage3DMultisample = (C.GPTEXTURESTORAGE3DMULTISAMPLE)(getProcAddr("glTextureStorage3DMultisample"))
+ gpTextureStorage3DMultisampleEXT = (C.GPTEXTURESTORAGE3DMULTISAMPLEEXT)(getProcAddr("glTextureStorage3DMultisampleEXT"))
+ gpTextureSubImage1D = (C.GPTEXTURESUBIMAGE1D)(getProcAddr("glTextureSubImage1D"))
+ gpTextureSubImage1DEXT = (C.GPTEXTURESUBIMAGE1DEXT)(getProcAddr("glTextureSubImage1DEXT"))
+ gpTextureSubImage2D = (C.GPTEXTURESUBIMAGE2D)(getProcAddr("glTextureSubImage2D"))
+ gpTextureSubImage2DEXT = (C.GPTEXTURESUBIMAGE2DEXT)(getProcAddr("glTextureSubImage2DEXT"))
+ gpTextureSubImage3D = (C.GPTEXTURESUBIMAGE3D)(getProcAddr("glTextureSubImage3D"))
+ gpTextureSubImage3DEXT = (C.GPTEXTURESUBIMAGE3DEXT)(getProcAddr("glTextureSubImage3DEXT"))
+ gpTextureView = (C.GPTEXTUREVIEW)(getProcAddr("glTextureView"))
+ gpTransformFeedbackBufferBase = (C.GPTRANSFORMFEEDBACKBUFFERBASE)(getProcAddr("glTransformFeedbackBufferBase"))
+ gpTransformFeedbackBufferRange = (C.GPTRANSFORMFEEDBACKBUFFERRANGE)(getProcAddr("glTransformFeedbackBufferRange"))
+ gpTransformFeedbackVaryings = (C.GPTRANSFORMFEEDBACKVARYINGS)(getProcAddr("glTransformFeedbackVaryings"))
+ if gpTransformFeedbackVaryings == nil {
+ return errors.New("glTransformFeedbackVaryings")
+ }
+ gpTransformPathNV = (C.GPTRANSFORMPATHNV)(getProcAddr("glTransformPathNV"))
+ gpUniform1d = (C.GPUNIFORM1D)(getProcAddr("glUniform1d"))
+ gpUniform1dv = (C.GPUNIFORM1DV)(getProcAddr("glUniform1dv"))
+ gpUniform1f = (C.GPUNIFORM1F)(getProcAddr("glUniform1f"))
+ if gpUniform1f == nil {
+ return errors.New("glUniform1f")
+ }
+ gpUniform1fv = (C.GPUNIFORM1FV)(getProcAddr("glUniform1fv"))
+ if gpUniform1fv == nil {
+ return errors.New("glUniform1fv")
+ }
+ gpUniform1i = (C.GPUNIFORM1I)(getProcAddr("glUniform1i"))
+ if gpUniform1i == nil {
+ return errors.New("glUniform1i")
+ }
+ gpUniform1i64ARB = (C.GPUNIFORM1I64ARB)(getProcAddr("glUniform1i64ARB"))
+ gpUniform1i64NV = (C.GPUNIFORM1I64NV)(getProcAddr("glUniform1i64NV"))
+ gpUniform1i64vARB = (C.GPUNIFORM1I64VARB)(getProcAddr("glUniform1i64vARB"))
+ gpUniform1i64vNV = (C.GPUNIFORM1I64VNV)(getProcAddr("glUniform1i64vNV"))
+ gpUniform1iv = (C.GPUNIFORM1IV)(getProcAddr("glUniform1iv"))
+ if gpUniform1iv == nil {
+ return errors.New("glUniform1iv")
+ }
+ gpUniform1ui = (C.GPUNIFORM1UI)(getProcAddr("glUniform1ui"))
+ if gpUniform1ui == nil {
+ return errors.New("glUniform1ui")
+ }
+ gpUniform1ui64ARB = (C.GPUNIFORM1UI64ARB)(getProcAddr("glUniform1ui64ARB"))
+ gpUniform1ui64NV = (C.GPUNIFORM1UI64NV)(getProcAddr("glUniform1ui64NV"))
+ gpUniform1ui64vARB = (C.GPUNIFORM1UI64VARB)(getProcAddr("glUniform1ui64vARB"))
+ gpUniform1ui64vNV = (C.GPUNIFORM1UI64VNV)(getProcAddr("glUniform1ui64vNV"))
+ gpUniform1uiv = (C.GPUNIFORM1UIV)(getProcAddr("glUniform1uiv"))
+ if gpUniform1uiv == nil {
+ return errors.New("glUniform1uiv")
+ }
+ gpUniform2d = (C.GPUNIFORM2D)(getProcAddr("glUniform2d"))
+ gpUniform2dv = (C.GPUNIFORM2DV)(getProcAddr("glUniform2dv"))
+ gpUniform2f = (C.GPUNIFORM2F)(getProcAddr("glUniform2f"))
+ if gpUniform2f == nil {
+ return errors.New("glUniform2f")
+ }
+ gpUniform2fv = (C.GPUNIFORM2FV)(getProcAddr("glUniform2fv"))
+ if gpUniform2fv == nil {
+ return errors.New("glUniform2fv")
+ }
+ gpUniform2i = (C.GPUNIFORM2I)(getProcAddr("glUniform2i"))
+ if gpUniform2i == nil {
+ return errors.New("glUniform2i")
+ }
+ gpUniform2i64ARB = (C.GPUNIFORM2I64ARB)(getProcAddr("glUniform2i64ARB"))
+ gpUniform2i64NV = (C.GPUNIFORM2I64NV)(getProcAddr("glUniform2i64NV"))
+ gpUniform2i64vARB = (C.GPUNIFORM2I64VARB)(getProcAddr("glUniform2i64vARB"))
+ gpUniform2i64vNV = (C.GPUNIFORM2I64VNV)(getProcAddr("glUniform2i64vNV"))
+ gpUniform2iv = (C.GPUNIFORM2IV)(getProcAddr("glUniform2iv"))
+ if gpUniform2iv == nil {
+ return errors.New("glUniform2iv")
+ }
+ gpUniform2ui = (C.GPUNIFORM2UI)(getProcAddr("glUniform2ui"))
+ if gpUniform2ui == nil {
+ return errors.New("glUniform2ui")
+ }
+ gpUniform2ui64ARB = (C.GPUNIFORM2UI64ARB)(getProcAddr("glUniform2ui64ARB"))
+ gpUniform2ui64NV = (C.GPUNIFORM2UI64NV)(getProcAddr("glUniform2ui64NV"))
+ gpUniform2ui64vARB = (C.GPUNIFORM2UI64VARB)(getProcAddr("glUniform2ui64vARB"))
+ gpUniform2ui64vNV = (C.GPUNIFORM2UI64VNV)(getProcAddr("glUniform2ui64vNV"))
+ gpUniform2uiv = (C.GPUNIFORM2UIV)(getProcAddr("glUniform2uiv"))
+ if gpUniform2uiv == nil {
+ return errors.New("glUniform2uiv")
+ }
+ gpUniform3d = (C.GPUNIFORM3D)(getProcAddr("glUniform3d"))
+ gpUniform3dv = (C.GPUNIFORM3DV)(getProcAddr("glUniform3dv"))
+ gpUniform3f = (C.GPUNIFORM3F)(getProcAddr("glUniform3f"))
+ if gpUniform3f == nil {
+ return errors.New("glUniform3f")
+ }
+ gpUniform3fv = (C.GPUNIFORM3FV)(getProcAddr("glUniform3fv"))
+ if gpUniform3fv == nil {
+ return errors.New("glUniform3fv")
+ }
+ gpUniform3i = (C.GPUNIFORM3I)(getProcAddr("glUniform3i"))
+ if gpUniform3i == nil {
+ return errors.New("glUniform3i")
+ }
+ gpUniform3i64ARB = (C.GPUNIFORM3I64ARB)(getProcAddr("glUniform3i64ARB"))
+ gpUniform3i64NV = (C.GPUNIFORM3I64NV)(getProcAddr("glUniform3i64NV"))
+ gpUniform3i64vARB = (C.GPUNIFORM3I64VARB)(getProcAddr("glUniform3i64vARB"))
+ gpUniform3i64vNV = (C.GPUNIFORM3I64VNV)(getProcAddr("glUniform3i64vNV"))
+ gpUniform3iv = (C.GPUNIFORM3IV)(getProcAddr("glUniform3iv"))
+ if gpUniform3iv == nil {
+ return errors.New("glUniform3iv")
+ }
+ gpUniform3ui = (C.GPUNIFORM3UI)(getProcAddr("glUniform3ui"))
+ if gpUniform3ui == nil {
+ return errors.New("glUniform3ui")
+ }
+ gpUniform3ui64ARB = (C.GPUNIFORM3UI64ARB)(getProcAddr("glUniform3ui64ARB"))
+ gpUniform3ui64NV = (C.GPUNIFORM3UI64NV)(getProcAddr("glUniform3ui64NV"))
+ gpUniform3ui64vARB = (C.GPUNIFORM3UI64VARB)(getProcAddr("glUniform3ui64vARB"))
+ gpUniform3ui64vNV = (C.GPUNIFORM3UI64VNV)(getProcAddr("glUniform3ui64vNV"))
+ gpUniform3uiv = (C.GPUNIFORM3UIV)(getProcAddr("glUniform3uiv"))
+ if gpUniform3uiv == nil {
+ return errors.New("glUniform3uiv")
+ }
+ gpUniform4d = (C.GPUNIFORM4D)(getProcAddr("glUniform4d"))
+ gpUniform4dv = (C.GPUNIFORM4DV)(getProcAddr("glUniform4dv"))
+ gpUniform4f = (C.GPUNIFORM4F)(getProcAddr("glUniform4f"))
+ if gpUniform4f == nil {
+ return errors.New("glUniform4f")
+ }
+ gpUniform4fv = (C.GPUNIFORM4FV)(getProcAddr("glUniform4fv"))
+ if gpUniform4fv == nil {
+ return errors.New("glUniform4fv")
+ }
+ gpUniform4i = (C.GPUNIFORM4I)(getProcAddr("glUniform4i"))
+ if gpUniform4i == nil {
+ return errors.New("glUniform4i")
+ }
+ gpUniform4i64ARB = (C.GPUNIFORM4I64ARB)(getProcAddr("glUniform4i64ARB"))
+ gpUniform4i64NV = (C.GPUNIFORM4I64NV)(getProcAddr("glUniform4i64NV"))
+ gpUniform4i64vARB = (C.GPUNIFORM4I64VARB)(getProcAddr("glUniform4i64vARB"))
+ gpUniform4i64vNV = (C.GPUNIFORM4I64VNV)(getProcAddr("glUniform4i64vNV"))
+ gpUniform4iv = (C.GPUNIFORM4IV)(getProcAddr("glUniform4iv"))
+ if gpUniform4iv == nil {
+ return errors.New("glUniform4iv")
+ }
+ gpUniform4ui = (C.GPUNIFORM4UI)(getProcAddr("glUniform4ui"))
+ if gpUniform4ui == nil {
+ return errors.New("glUniform4ui")
+ }
+ gpUniform4ui64ARB = (C.GPUNIFORM4UI64ARB)(getProcAddr("glUniform4ui64ARB"))
+ gpUniform4ui64NV = (C.GPUNIFORM4UI64NV)(getProcAddr("glUniform4ui64NV"))
+ gpUniform4ui64vARB = (C.GPUNIFORM4UI64VARB)(getProcAddr("glUniform4ui64vARB"))
+ gpUniform4ui64vNV = (C.GPUNIFORM4UI64VNV)(getProcAddr("glUniform4ui64vNV"))
+ gpUniform4uiv = (C.GPUNIFORM4UIV)(getProcAddr("glUniform4uiv"))
+ if gpUniform4uiv == nil {
+ return errors.New("glUniform4uiv")
+ }
+ gpUniformBlockBinding = (C.GPUNIFORMBLOCKBINDING)(getProcAddr("glUniformBlockBinding"))
+ if gpUniformBlockBinding == nil {
+ return errors.New("glUniformBlockBinding")
+ }
+ gpUniformHandleui64ARB = (C.GPUNIFORMHANDLEUI64ARB)(getProcAddr("glUniformHandleui64ARB"))
+ gpUniformHandleui64NV = (C.GPUNIFORMHANDLEUI64NV)(getProcAddr("glUniformHandleui64NV"))
+ gpUniformHandleui64vARB = (C.GPUNIFORMHANDLEUI64VARB)(getProcAddr("glUniformHandleui64vARB"))
+ gpUniformHandleui64vNV = (C.GPUNIFORMHANDLEUI64VNV)(getProcAddr("glUniformHandleui64vNV"))
+ gpUniformMatrix2dv = (C.GPUNIFORMMATRIX2DV)(getProcAddr("glUniformMatrix2dv"))
+ gpUniformMatrix2fv = (C.GPUNIFORMMATRIX2FV)(getProcAddr("glUniformMatrix2fv"))
+ if gpUniformMatrix2fv == nil {
+ return errors.New("glUniformMatrix2fv")
+ }
+ gpUniformMatrix2x3dv = (C.GPUNIFORMMATRIX2X3DV)(getProcAddr("glUniformMatrix2x3dv"))
+ gpUniformMatrix2x3fv = (C.GPUNIFORMMATRIX2X3FV)(getProcAddr("glUniformMatrix2x3fv"))
+ if gpUniformMatrix2x3fv == nil {
+ return errors.New("glUniformMatrix2x3fv")
+ }
+ gpUniformMatrix2x4dv = (C.GPUNIFORMMATRIX2X4DV)(getProcAddr("glUniformMatrix2x4dv"))
+ gpUniformMatrix2x4fv = (C.GPUNIFORMMATRIX2X4FV)(getProcAddr("glUniformMatrix2x4fv"))
+ if gpUniformMatrix2x4fv == nil {
+ return errors.New("glUniformMatrix2x4fv")
+ }
+ gpUniformMatrix3dv = (C.GPUNIFORMMATRIX3DV)(getProcAddr("glUniformMatrix3dv"))
+ gpUniformMatrix3fv = (C.GPUNIFORMMATRIX3FV)(getProcAddr("glUniformMatrix3fv"))
+ if gpUniformMatrix3fv == nil {
+ return errors.New("glUniformMatrix3fv")
+ }
+ gpUniformMatrix3x2dv = (C.GPUNIFORMMATRIX3X2DV)(getProcAddr("glUniformMatrix3x2dv"))
+ gpUniformMatrix3x2fv = (C.GPUNIFORMMATRIX3X2FV)(getProcAddr("glUniformMatrix3x2fv"))
+ if gpUniformMatrix3x2fv == nil {
+ return errors.New("glUniformMatrix3x2fv")
+ }
+ gpUniformMatrix3x4dv = (C.GPUNIFORMMATRIX3X4DV)(getProcAddr("glUniformMatrix3x4dv"))
+ gpUniformMatrix3x4fv = (C.GPUNIFORMMATRIX3X4FV)(getProcAddr("glUniformMatrix3x4fv"))
+ if gpUniformMatrix3x4fv == nil {
+ return errors.New("glUniformMatrix3x4fv")
+ }
+ gpUniformMatrix4dv = (C.GPUNIFORMMATRIX4DV)(getProcAddr("glUniformMatrix4dv"))
+ gpUniformMatrix4fv = (C.GPUNIFORMMATRIX4FV)(getProcAddr("glUniformMatrix4fv"))
+ if gpUniformMatrix4fv == nil {
+ return errors.New("glUniformMatrix4fv")
+ }
+ gpUniformMatrix4x2dv = (C.GPUNIFORMMATRIX4X2DV)(getProcAddr("glUniformMatrix4x2dv"))
+ gpUniformMatrix4x2fv = (C.GPUNIFORMMATRIX4X2FV)(getProcAddr("glUniformMatrix4x2fv"))
+ if gpUniformMatrix4x2fv == nil {
+ return errors.New("glUniformMatrix4x2fv")
+ }
+ gpUniformMatrix4x3dv = (C.GPUNIFORMMATRIX4X3DV)(getProcAddr("glUniformMatrix4x3dv"))
+ gpUniformMatrix4x3fv = (C.GPUNIFORMMATRIX4X3FV)(getProcAddr("glUniformMatrix4x3fv"))
+ if gpUniformMatrix4x3fv == nil {
+ return errors.New("glUniformMatrix4x3fv")
+ }
+ gpUniformSubroutinesuiv = (C.GPUNIFORMSUBROUTINESUIV)(getProcAddr("glUniformSubroutinesuiv"))
+ gpUniformui64NV = (C.GPUNIFORMUI64NV)(getProcAddr("glUniformui64NV"))
+ gpUniformui64vNV = (C.GPUNIFORMUI64VNV)(getProcAddr("glUniformui64vNV"))
+ gpUnmapBuffer = (C.GPUNMAPBUFFER)(getProcAddr("glUnmapBuffer"))
+ if gpUnmapBuffer == nil {
+ return errors.New("glUnmapBuffer")
+ }
+ gpUnmapNamedBuffer = (C.GPUNMAPNAMEDBUFFER)(getProcAddr("glUnmapNamedBuffer"))
+ gpUnmapNamedBufferEXT = (C.GPUNMAPNAMEDBUFFEREXT)(getProcAddr("glUnmapNamedBufferEXT"))
+ gpUseProgram = (C.GPUSEPROGRAM)(getProcAddr("glUseProgram"))
+ if gpUseProgram == nil {
+ return errors.New("glUseProgram")
+ }
+ gpUseProgramStages = (C.GPUSEPROGRAMSTAGES)(getProcAddr("glUseProgramStages"))
+ gpUseProgramStagesEXT = (C.GPUSEPROGRAMSTAGESEXT)(getProcAddr("glUseProgramStagesEXT"))
+ gpUseShaderProgramEXT = (C.GPUSESHADERPROGRAMEXT)(getProcAddr("glUseShaderProgramEXT"))
+ gpValidateProgram = (C.GPVALIDATEPROGRAM)(getProcAddr("glValidateProgram"))
+ if gpValidateProgram == nil {
+ return errors.New("glValidateProgram")
+ }
+ gpValidateProgramPipeline = (C.GPVALIDATEPROGRAMPIPELINE)(getProcAddr("glValidateProgramPipeline"))
+ gpValidateProgramPipelineEXT = (C.GPVALIDATEPROGRAMPIPELINEEXT)(getProcAddr("glValidateProgramPipelineEXT"))
+ gpVertexArrayAttribBinding = (C.GPVERTEXARRAYATTRIBBINDING)(getProcAddr("glVertexArrayAttribBinding"))
+ gpVertexArrayAttribFormat = (C.GPVERTEXARRAYATTRIBFORMAT)(getProcAddr("glVertexArrayAttribFormat"))
+ gpVertexArrayAttribIFormat = (C.GPVERTEXARRAYATTRIBIFORMAT)(getProcAddr("glVertexArrayAttribIFormat"))
+ gpVertexArrayAttribLFormat = (C.GPVERTEXARRAYATTRIBLFORMAT)(getProcAddr("glVertexArrayAttribLFormat"))
+ gpVertexArrayBindVertexBufferEXT = (C.GPVERTEXARRAYBINDVERTEXBUFFEREXT)(getProcAddr("glVertexArrayBindVertexBufferEXT"))
+ gpVertexArrayBindingDivisor = (C.GPVERTEXARRAYBINDINGDIVISOR)(getProcAddr("glVertexArrayBindingDivisor"))
+ gpVertexArrayColorOffsetEXT = (C.GPVERTEXARRAYCOLOROFFSETEXT)(getProcAddr("glVertexArrayColorOffsetEXT"))
+ gpVertexArrayEdgeFlagOffsetEXT = (C.GPVERTEXARRAYEDGEFLAGOFFSETEXT)(getProcAddr("glVertexArrayEdgeFlagOffsetEXT"))
+ gpVertexArrayElementBuffer = (C.GPVERTEXARRAYELEMENTBUFFER)(getProcAddr("glVertexArrayElementBuffer"))
+ gpVertexArrayFogCoordOffsetEXT = (C.GPVERTEXARRAYFOGCOORDOFFSETEXT)(getProcAddr("glVertexArrayFogCoordOffsetEXT"))
+ gpVertexArrayIndexOffsetEXT = (C.GPVERTEXARRAYINDEXOFFSETEXT)(getProcAddr("glVertexArrayIndexOffsetEXT"))
+ gpVertexArrayMultiTexCoordOffsetEXT = (C.GPVERTEXARRAYMULTITEXCOORDOFFSETEXT)(getProcAddr("glVertexArrayMultiTexCoordOffsetEXT"))
+ gpVertexArrayNormalOffsetEXT = (C.GPVERTEXARRAYNORMALOFFSETEXT)(getProcAddr("glVertexArrayNormalOffsetEXT"))
+ gpVertexArraySecondaryColorOffsetEXT = (C.GPVERTEXARRAYSECONDARYCOLOROFFSETEXT)(getProcAddr("glVertexArraySecondaryColorOffsetEXT"))
+ gpVertexArrayTexCoordOffsetEXT = (C.GPVERTEXARRAYTEXCOORDOFFSETEXT)(getProcAddr("glVertexArrayTexCoordOffsetEXT"))
+ gpVertexArrayVertexAttribBindingEXT = (C.GPVERTEXARRAYVERTEXATTRIBBINDINGEXT)(getProcAddr("glVertexArrayVertexAttribBindingEXT"))
+ gpVertexArrayVertexAttribDivisorEXT = (C.GPVERTEXARRAYVERTEXATTRIBDIVISOREXT)(getProcAddr("glVertexArrayVertexAttribDivisorEXT"))
+ gpVertexArrayVertexAttribFormatEXT = (C.GPVERTEXARRAYVERTEXATTRIBFORMATEXT)(getProcAddr("glVertexArrayVertexAttribFormatEXT"))
+ gpVertexArrayVertexAttribIFormatEXT = (C.GPVERTEXARRAYVERTEXATTRIBIFORMATEXT)(getProcAddr("glVertexArrayVertexAttribIFormatEXT"))
+ gpVertexArrayVertexAttribIOffsetEXT = (C.GPVERTEXARRAYVERTEXATTRIBIOFFSETEXT)(getProcAddr("glVertexArrayVertexAttribIOffsetEXT"))
+ gpVertexArrayVertexAttribLFormatEXT = (C.GPVERTEXARRAYVERTEXATTRIBLFORMATEXT)(getProcAddr("glVertexArrayVertexAttribLFormatEXT"))
+ gpVertexArrayVertexAttribLOffsetEXT = (C.GPVERTEXARRAYVERTEXATTRIBLOFFSETEXT)(getProcAddr("glVertexArrayVertexAttribLOffsetEXT"))
+ gpVertexArrayVertexAttribOffsetEXT = (C.GPVERTEXARRAYVERTEXATTRIBOFFSETEXT)(getProcAddr("glVertexArrayVertexAttribOffsetEXT"))
+ gpVertexArrayVertexBindingDivisorEXT = (C.GPVERTEXARRAYVERTEXBINDINGDIVISOREXT)(getProcAddr("glVertexArrayVertexBindingDivisorEXT"))
+ gpVertexArrayVertexBuffer = (C.GPVERTEXARRAYVERTEXBUFFER)(getProcAddr("glVertexArrayVertexBuffer"))
+ gpVertexArrayVertexBuffers = (C.GPVERTEXARRAYVERTEXBUFFERS)(getProcAddr("glVertexArrayVertexBuffers"))
+ gpVertexArrayVertexOffsetEXT = (C.GPVERTEXARRAYVERTEXOFFSETEXT)(getProcAddr("glVertexArrayVertexOffsetEXT"))
+ gpVertexAttrib1d = (C.GPVERTEXATTRIB1D)(getProcAddr("glVertexAttrib1d"))
+ if gpVertexAttrib1d == nil {
+ return errors.New("glVertexAttrib1d")
+ }
+ gpVertexAttrib1dv = (C.GPVERTEXATTRIB1DV)(getProcAddr("glVertexAttrib1dv"))
+ if gpVertexAttrib1dv == nil {
+ return errors.New("glVertexAttrib1dv")
+ }
+ gpVertexAttrib1f = (C.GPVERTEXATTRIB1F)(getProcAddr("glVertexAttrib1f"))
+ if gpVertexAttrib1f == nil {
+ return errors.New("glVertexAttrib1f")
+ }
+ gpVertexAttrib1fv = (C.GPVERTEXATTRIB1FV)(getProcAddr("glVertexAttrib1fv"))
+ if gpVertexAttrib1fv == nil {
+ return errors.New("glVertexAttrib1fv")
+ }
+ gpVertexAttrib1s = (C.GPVERTEXATTRIB1S)(getProcAddr("glVertexAttrib1s"))
+ if gpVertexAttrib1s == nil {
+ return errors.New("glVertexAttrib1s")
+ }
+ gpVertexAttrib1sv = (C.GPVERTEXATTRIB1SV)(getProcAddr("glVertexAttrib1sv"))
+ if gpVertexAttrib1sv == nil {
+ return errors.New("glVertexAttrib1sv")
+ }
+ gpVertexAttrib2d = (C.GPVERTEXATTRIB2D)(getProcAddr("glVertexAttrib2d"))
+ if gpVertexAttrib2d == nil {
+ return errors.New("glVertexAttrib2d")
+ }
+ gpVertexAttrib2dv = (C.GPVERTEXATTRIB2DV)(getProcAddr("glVertexAttrib2dv"))
+ if gpVertexAttrib2dv == nil {
+ return errors.New("glVertexAttrib2dv")
+ }
+ gpVertexAttrib2f = (C.GPVERTEXATTRIB2F)(getProcAddr("glVertexAttrib2f"))
+ if gpVertexAttrib2f == nil {
+ return errors.New("glVertexAttrib2f")
+ }
+ gpVertexAttrib2fv = (C.GPVERTEXATTRIB2FV)(getProcAddr("glVertexAttrib2fv"))
+ if gpVertexAttrib2fv == nil {
+ return errors.New("glVertexAttrib2fv")
+ }
+ gpVertexAttrib2s = (C.GPVERTEXATTRIB2S)(getProcAddr("glVertexAttrib2s"))
+ if gpVertexAttrib2s == nil {
+ return errors.New("glVertexAttrib2s")
+ }
+ gpVertexAttrib2sv = (C.GPVERTEXATTRIB2SV)(getProcAddr("glVertexAttrib2sv"))
+ if gpVertexAttrib2sv == nil {
+ return errors.New("glVertexAttrib2sv")
+ }
+ gpVertexAttrib3d = (C.GPVERTEXATTRIB3D)(getProcAddr("glVertexAttrib3d"))
+ if gpVertexAttrib3d == nil {
+ return errors.New("glVertexAttrib3d")
+ }
+ gpVertexAttrib3dv = (C.GPVERTEXATTRIB3DV)(getProcAddr("glVertexAttrib3dv"))
+ if gpVertexAttrib3dv == nil {
+ return errors.New("glVertexAttrib3dv")
+ }
+ gpVertexAttrib3f = (C.GPVERTEXATTRIB3F)(getProcAddr("glVertexAttrib3f"))
+ if gpVertexAttrib3f == nil {
+ return errors.New("glVertexAttrib3f")
+ }
+ gpVertexAttrib3fv = (C.GPVERTEXATTRIB3FV)(getProcAddr("glVertexAttrib3fv"))
+ if gpVertexAttrib3fv == nil {
+ return errors.New("glVertexAttrib3fv")
+ }
+ gpVertexAttrib3s = (C.GPVERTEXATTRIB3S)(getProcAddr("glVertexAttrib3s"))
+ if gpVertexAttrib3s == nil {
+ return errors.New("glVertexAttrib3s")
+ }
+ gpVertexAttrib3sv = (C.GPVERTEXATTRIB3SV)(getProcAddr("glVertexAttrib3sv"))
+ if gpVertexAttrib3sv == nil {
+ return errors.New("glVertexAttrib3sv")
+ }
+ gpVertexAttrib4Nbv = (C.GPVERTEXATTRIB4NBV)(getProcAddr("glVertexAttrib4Nbv"))
+ if gpVertexAttrib4Nbv == nil {
+ return errors.New("glVertexAttrib4Nbv")
+ }
+ gpVertexAttrib4Niv = (C.GPVERTEXATTRIB4NIV)(getProcAddr("glVertexAttrib4Niv"))
+ if gpVertexAttrib4Niv == nil {
+ return errors.New("glVertexAttrib4Niv")
+ }
+ gpVertexAttrib4Nsv = (C.GPVERTEXATTRIB4NSV)(getProcAddr("glVertexAttrib4Nsv"))
+ if gpVertexAttrib4Nsv == nil {
+ return errors.New("glVertexAttrib4Nsv")
+ }
+ gpVertexAttrib4Nub = (C.GPVERTEXATTRIB4NUB)(getProcAddr("glVertexAttrib4Nub"))
+ if gpVertexAttrib4Nub == nil {
+ return errors.New("glVertexAttrib4Nub")
+ }
+ gpVertexAttrib4Nubv = (C.GPVERTEXATTRIB4NUBV)(getProcAddr("glVertexAttrib4Nubv"))
+ if gpVertexAttrib4Nubv == nil {
+ return errors.New("glVertexAttrib4Nubv")
+ }
+ gpVertexAttrib4Nuiv = (C.GPVERTEXATTRIB4NUIV)(getProcAddr("glVertexAttrib4Nuiv"))
+ if gpVertexAttrib4Nuiv == nil {
+ return errors.New("glVertexAttrib4Nuiv")
+ }
+ gpVertexAttrib4Nusv = (C.GPVERTEXATTRIB4NUSV)(getProcAddr("glVertexAttrib4Nusv"))
+ if gpVertexAttrib4Nusv == nil {
+ return errors.New("glVertexAttrib4Nusv")
+ }
+ gpVertexAttrib4bv = (C.GPVERTEXATTRIB4BV)(getProcAddr("glVertexAttrib4bv"))
+ if gpVertexAttrib4bv == nil {
+ return errors.New("glVertexAttrib4bv")
+ }
+ gpVertexAttrib4d = (C.GPVERTEXATTRIB4D)(getProcAddr("glVertexAttrib4d"))
+ if gpVertexAttrib4d == nil {
+ return errors.New("glVertexAttrib4d")
+ }
+ gpVertexAttrib4dv = (C.GPVERTEXATTRIB4DV)(getProcAddr("glVertexAttrib4dv"))
+ if gpVertexAttrib4dv == nil {
+ return errors.New("glVertexAttrib4dv")
+ }
+ gpVertexAttrib4f = (C.GPVERTEXATTRIB4F)(getProcAddr("glVertexAttrib4f"))
+ if gpVertexAttrib4f == nil {
+ return errors.New("glVertexAttrib4f")
+ }
+ gpVertexAttrib4fv = (C.GPVERTEXATTRIB4FV)(getProcAddr("glVertexAttrib4fv"))
+ if gpVertexAttrib4fv == nil {
+ return errors.New("glVertexAttrib4fv")
+ }
+ gpVertexAttrib4iv = (C.GPVERTEXATTRIB4IV)(getProcAddr("glVertexAttrib4iv"))
+ if gpVertexAttrib4iv == nil {
+ return errors.New("glVertexAttrib4iv")
+ }
+ gpVertexAttrib4s = (C.GPVERTEXATTRIB4S)(getProcAddr("glVertexAttrib4s"))
+ if gpVertexAttrib4s == nil {
+ return errors.New("glVertexAttrib4s")
+ }
+ gpVertexAttrib4sv = (C.GPVERTEXATTRIB4SV)(getProcAddr("glVertexAttrib4sv"))
+ if gpVertexAttrib4sv == nil {
+ return errors.New("glVertexAttrib4sv")
+ }
+ gpVertexAttrib4ubv = (C.GPVERTEXATTRIB4UBV)(getProcAddr("glVertexAttrib4ubv"))
+ if gpVertexAttrib4ubv == nil {
+ return errors.New("glVertexAttrib4ubv")
+ }
+ gpVertexAttrib4uiv = (C.GPVERTEXATTRIB4UIV)(getProcAddr("glVertexAttrib4uiv"))
+ if gpVertexAttrib4uiv == nil {
+ return errors.New("glVertexAttrib4uiv")
+ }
+ gpVertexAttrib4usv = (C.GPVERTEXATTRIB4USV)(getProcAddr("glVertexAttrib4usv"))
+ if gpVertexAttrib4usv == nil {
+ return errors.New("glVertexAttrib4usv")
+ }
+ gpVertexAttribBinding = (C.GPVERTEXATTRIBBINDING)(getProcAddr("glVertexAttribBinding"))
+ gpVertexAttribDivisor = (C.GPVERTEXATTRIBDIVISOR)(getProcAddr("glVertexAttribDivisor"))
+ if gpVertexAttribDivisor == nil {
+ return errors.New("glVertexAttribDivisor")
+ }
+ gpVertexAttribDivisorARB = (C.GPVERTEXATTRIBDIVISORARB)(getProcAddr("glVertexAttribDivisorARB"))
+ gpVertexAttribFormat = (C.GPVERTEXATTRIBFORMAT)(getProcAddr("glVertexAttribFormat"))
+ gpVertexAttribFormatNV = (C.GPVERTEXATTRIBFORMATNV)(getProcAddr("glVertexAttribFormatNV"))
+ gpVertexAttribI1i = (C.GPVERTEXATTRIBI1I)(getProcAddr("glVertexAttribI1i"))
+ if gpVertexAttribI1i == nil {
+ return errors.New("glVertexAttribI1i")
+ }
+ gpVertexAttribI1iv = (C.GPVERTEXATTRIBI1IV)(getProcAddr("glVertexAttribI1iv"))
+ if gpVertexAttribI1iv == nil {
+ return errors.New("glVertexAttribI1iv")
+ }
+ gpVertexAttribI1ui = (C.GPVERTEXATTRIBI1UI)(getProcAddr("glVertexAttribI1ui"))
+ if gpVertexAttribI1ui == nil {
+ return errors.New("glVertexAttribI1ui")
+ }
+ gpVertexAttribI1uiv = (C.GPVERTEXATTRIBI1UIV)(getProcAddr("glVertexAttribI1uiv"))
+ if gpVertexAttribI1uiv == nil {
+ return errors.New("glVertexAttribI1uiv")
+ }
+ gpVertexAttribI2i = (C.GPVERTEXATTRIBI2I)(getProcAddr("glVertexAttribI2i"))
+ if gpVertexAttribI2i == nil {
+ return errors.New("glVertexAttribI2i")
+ }
+ gpVertexAttribI2iv = (C.GPVERTEXATTRIBI2IV)(getProcAddr("glVertexAttribI2iv"))
+ if gpVertexAttribI2iv == nil {
+ return errors.New("glVertexAttribI2iv")
+ }
+ gpVertexAttribI2ui = (C.GPVERTEXATTRIBI2UI)(getProcAddr("glVertexAttribI2ui"))
+ if gpVertexAttribI2ui == nil {
+ return errors.New("glVertexAttribI2ui")
+ }
+ gpVertexAttribI2uiv = (C.GPVERTEXATTRIBI2UIV)(getProcAddr("glVertexAttribI2uiv"))
+ if gpVertexAttribI2uiv == nil {
+ return errors.New("glVertexAttribI2uiv")
+ }
+ gpVertexAttribI3i = (C.GPVERTEXATTRIBI3I)(getProcAddr("glVertexAttribI3i"))
+ if gpVertexAttribI3i == nil {
+ return errors.New("glVertexAttribI3i")
+ }
+ gpVertexAttribI3iv = (C.GPVERTEXATTRIBI3IV)(getProcAddr("glVertexAttribI3iv"))
+ if gpVertexAttribI3iv == nil {
+ return errors.New("glVertexAttribI3iv")
+ }
+ gpVertexAttribI3ui = (C.GPVERTEXATTRIBI3UI)(getProcAddr("glVertexAttribI3ui"))
+ if gpVertexAttribI3ui == nil {
+ return errors.New("glVertexAttribI3ui")
+ }
+ gpVertexAttribI3uiv = (C.GPVERTEXATTRIBI3UIV)(getProcAddr("glVertexAttribI3uiv"))
+ if gpVertexAttribI3uiv == nil {
+ return errors.New("glVertexAttribI3uiv")
+ }
+ gpVertexAttribI4bv = (C.GPVERTEXATTRIBI4BV)(getProcAddr("glVertexAttribI4bv"))
+ if gpVertexAttribI4bv == nil {
+ return errors.New("glVertexAttribI4bv")
+ }
+ gpVertexAttribI4i = (C.GPVERTEXATTRIBI4I)(getProcAddr("glVertexAttribI4i"))
+ if gpVertexAttribI4i == nil {
+ return errors.New("glVertexAttribI4i")
+ }
+ gpVertexAttribI4iv = (C.GPVERTEXATTRIBI4IV)(getProcAddr("glVertexAttribI4iv"))
+ if gpVertexAttribI4iv == nil {
+ return errors.New("glVertexAttribI4iv")
+ }
+ gpVertexAttribI4sv = (C.GPVERTEXATTRIBI4SV)(getProcAddr("glVertexAttribI4sv"))
+ if gpVertexAttribI4sv == nil {
+ return errors.New("glVertexAttribI4sv")
+ }
+ gpVertexAttribI4ubv = (C.GPVERTEXATTRIBI4UBV)(getProcAddr("glVertexAttribI4ubv"))
+ if gpVertexAttribI4ubv == nil {
+ return errors.New("glVertexAttribI4ubv")
+ }
+ gpVertexAttribI4ui = (C.GPVERTEXATTRIBI4UI)(getProcAddr("glVertexAttribI4ui"))
+ if gpVertexAttribI4ui == nil {
+ return errors.New("glVertexAttribI4ui")
+ }
+ gpVertexAttribI4uiv = (C.GPVERTEXATTRIBI4UIV)(getProcAddr("glVertexAttribI4uiv"))
+ if gpVertexAttribI4uiv == nil {
+ return errors.New("glVertexAttribI4uiv")
+ }
+ gpVertexAttribI4usv = (C.GPVERTEXATTRIBI4USV)(getProcAddr("glVertexAttribI4usv"))
+ if gpVertexAttribI4usv == nil {
+ return errors.New("glVertexAttribI4usv")
+ }
+ gpVertexAttribIFormat = (C.GPVERTEXATTRIBIFORMAT)(getProcAddr("glVertexAttribIFormat"))
+ gpVertexAttribIFormatNV = (C.GPVERTEXATTRIBIFORMATNV)(getProcAddr("glVertexAttribIFormatNV"))
+ gpVertexAttribIPointer = (C.GPVERTEXATTRIBIPOINTER)(getProcAddr("glVertexAttribIPointer"))
+ if gpVertexAttribIPointer == nil {
+ return errors.New("glVertexAttribIPointer")
+ }
+ gpVertexAttribL1d = (C.GPVERTEXATTRIBL1D)(getProcAddr("glVertexAttribL1d"))
+ gpVertexAttribL1dv = (C.GPVERTEXATTRIBL1DV)(getProcAddr("glVertexAttribL1dv"))
+ gpVertexAttribL1i64NV = (C.GPVERTEXATTRIBL1I64NV)(getProcAddr("glVertexAttribL1i64NV"))
+ gpVertexAttribL1i64vNV = (C.GPVERTEXATTRIBL1I64VNV)(getProcAddr("glVertexAttribL1i64vNV"))
+ gpVertexAttribL1ui64ARB = (C.GPVERTEXATTRIBL1UI64ARB)(getProcAddr("glVertexAttribL1ui64ARB"))
+ gpVertexAttribL1ui64NV = (C.GPVERTEXATTRIBL1UI64NV)(getProcAddr("glVertexAttribL1ui64NV"))
+ gpVertexAttribL1ui64vARB = (C.GPVERTEXATTRIBL1UI64VARB)(getProcAddr("glVertexAttribL1ui64vARB"))
+ gpVertexAttribL1ui64vNV = (C.GPVERTEXATTRIBL1UI64VNV)(getProcAddr("glVertexAttribL1ui64vNV"))
+ gpVertexAttribL2d = (C.GPVERTEXATTRIBL2D)(getProcAddr("glVertexAttribL2d"))
+ gpVertexAttribL2dv = (C.GPVERTEXATTRIBL2DV)(getProcAddr("glVertexAttribL2dv"))
+ gpVertexAttribL2i64NV = (C.GPVERTEXATTRIBL2I64NV)(getProcAddr("glVertexAttribL2i64NV"))
+ gpVertexAttribL2i64vNV = (C.GPVERTEXATTRIBL2I64VNV)(getProcAddr("glVertexAttribL2i64vNV"))
+ gpVertexAttribL2ui64NV = (C.GPVERTEXATTRIBL2UI64NV)(getProcAddr("glVertexAttribL2ui64NV"))
+ gpVertexAttribL2ui64vNV = (C.GPVERTEXATTRIBL2UI64VNV)(getProcAddr("glVertexAttribL2ui64vNV"))
+ gpVertexAttribL3d = (C.GPVERTEXATTRIBL3D)(getProcAddr("glVertexAttribL3d"))
+ gpVertexAttribL3dv = (C.GPVERTEXATTRIBL3DV)(getProcAddr("glVertexAttribL3dv"))
+ gpVertexAttribL3i64NV = (C.GPVERTEXATTRIBL3I64NV)(getProcAddr("glVertexAttribL3i64NV"))
+ gpVertexAttribL3i64vNV = (C.GPVERTEXATTRIBL3I64VNV)(getProcAddr("glVertexAttribL3i64vNV"))
+ gpVertexAttribL3ui64NV = (C.GPVERTEXATTRIBL3UI64NV)(getProcAddr("glVertexAttribL3ui64NV"))
+ gpVertexAttribL3ui64vNV = (C.GPVERTEXATTRIBL3UI64VNV)(getProcAddr("glVertexAttribL3ui64vNV"))
+ gpVertexAttribL4d = (C.GPVERTEXATTRIBL4D)(getProcAddr("glVertexAttribL4d"))
+ gpVertexAttribL4dv = (C.GPVERTEXATTRIBL4DV)(getProcAddr("glVertexAttribL4dv"))
+ gpVertexAttribL4i64NV = (C.GPVERTEXATTRIBL4I64NV)(getProcAddr("glVertexAttribL4i64NV"))
+ gpVertexAttribL4i64vNV = (C.GPVERTEXATTRIBL4I64VNV)(getProcAddr("glVertexAttribL4i64vNV"))
+ gpVertexAttribL4ui64NV = (C.GPVERTEXATTRIBL4UI64NV)(getProcAddr("glVertexAttribL4ui64NV"))
+ gpVertexAttribL4ui64vNV = (C.GPVERTEXATTRIBL4UI64VNV)(getProcAddr("glVertexAttribL4ui64vNV"))
+ gpVertexAttribLFormat = (C.GPVERTEXATTRIBLFORMAT)(getProcAddr("glVertexAttribLFormat"))
+ gpVertexAttribLFormatNV = (C.GPVERTEXATTRIBLFORMATNV)(getProcAddr("glVertexAttribLFormatNV"))
+ gpVertexAttribLPointer = (C.GPVERTEXATTRIBLPOINTER)(getProcAddr("glVertexAttribLPointer"))
+ gpVertexAttribP1ui = (C.GPVERTEXATTRIBP1UI)(getProcAddr("glVertexAttribP1ui"))
+ if gpVertexAttribP1ui == nil {
+ return errors.New("glVertexAttribP1ui")
+ }
+ gpVertexAttribP1uiv = (C.GPVERTEXATTRIBP1UIV)(getProcAddr("glVertexAttribP1uiv"))
+ if gpVertexAttribP1uiv == nil {
+ return errors.New("glVertexAttribP1uiv")
+ }
+ gpVertexAttribP2ui = (C.GPVERTEXATTRIBP2UI)(getProcAddr("glVertexAttribP2ui"))
+ if gpVertexAttribP2ui == nil {
+ return errors.New("glVertexAttribP2ui")
+ }
+ gpVertexAttribP2uiv = (C.GPVERTEXATTRIBP2UIV)(getProcAddr("glVertexAttribP2uiv"))
+ if gpVertexAttribP2uiv == nil {
+ return errors.New("glVertexAttribP2uiv")
+ }
+ gpVertexAttribP3ui = (C.GPVERTEXATTRIBP3UI)(getProcAddr("glVertexAttribP3ui"))
+ if gpVertexAttribP3ui == nil {
+ return errors.New("glVertexAttribP3ui")
+ }
+ gpVertexAttribP3uiv = (C.GPVERTEXATTRIBP3UIV)(getProcAddr("glVertexAttribP3uiv"))
+ if gpVertexAttribP3uiv == nil {
+ return errors.New("glVertexAttribP3uiv")
+ }
+ gpVertexAttribP4ui = (C.GPVERTEXATTRIBP4UI)(getProcAddr("glVertexAttribP4ui"))
+ if gpVertexAttribP4ui == nil {
+ return errors.New("glVertexAttribP4ui")
+ }
+ gpVertexAttribP4uiv = (C.GPVERTEXATTRIBP4UIV)(getProcAddr("glVertexAttribP4uiv"))
+ if gpVertexAttribP4uiv == nil {
+ return errors.New("glVertexAttribP4uiv")
+ }
+ gpVertexAttribPointer = (C.GPVERTEXATTRIBPOINTER)(getProcAddr("glVertexAttribPointer"))
+ if gpVertexAttribPointer == nil {
+ return errors.New("glVertexAttribPointer")
+ }
+ gpVertexBindingDivisor = (C.GPVERTEXBINDINGDIVISOR)(getProcAddr("glVertexBindingDivisor"))
+ gpVertexFormatNV = (C.GPVERTEXFORMATNV)(getProcAddr("glVertexFormatNV"))
+ gpViewport = (C.GPVIEWPORT)(getProcAddr("glViewport"))
+ if gpViewport == nil {
+ return errors.New("glViewport")
+ }
+ gpViewportArrayv = (C.GPVIEWPORTARRAYV)(getProcAddr("glViewportArrayv"))
+ gpViewportIndexedf = (C.GPVIEWPORTINDEXEDF)(getProcAddr("glViewportIndexedf"))
+ gpViewportIndexedfv = (C.GPVIEWPORTINDEXEDFV)(getProcAddr("glViewportIndexedfv"))
+ gpViewportPositionWScaleNV = (C.GPVIEWPORTPOSITIONWSCALENV)(getProcAddr("glViewportPositionWScaleNV"))
+ gpViewportSwizzleNV = (C.GPVIEWPORTSWIZZLENV)(getProcAddr("glViewportSwizzleNV"))
+ gpWaitSync = (C.GPWAITSYNC)(getProcAddr("glWaitSync"))
+ if gpWaitSync == nil {
+ return errors.New("glWaitSync")
+ }
+ gpWaitVkSemaphoreNV = (C.GPWAITVKSEMAPHORENV)(getProcAddr("glWaitVkSemaphoreNV"))
+ gpWeightPathsNV = (C.GPWEIGHTPATHSNV)(getProcAddr("glWeightPathsNV"))
+ gpWindowRectanglesEXT = (C.GPWINDOWRECTANGLESEXT)(getProcAddr("glWindowRectanglesEXT"))
+ return nil
+}
diff --git a/archive/vendor/github.com/go-gl/gl/v3.3-core/gl/procaddr.go b/archive/vendor/github.com/go-gl/gl/v3.3-core/gl/procaddr.go
new file mode 100644
index 0000000..4bcc6b2
--- /dev/null
+++ b/archive/vendor/github.com/go-gl/gl/v3.3-core/gl/procaddr.go
@@ -0,0 +1,75 @@
+// Code generated by glow (https://github.com/go-gl/glow). DO NOT EDIT.
+
+// This file implements GlowGetProcAddress for every supported platform. The
+// correct version is chosen automatically based on build tags:
+//
+// windows: WGL
+// darwin: CGL
+// linux freebsd netbsd openbsd: GLX
+//
+// Use of EGL instead of the platform's default (listed above) is made possible
+// via the "egl" build tag.
+//
+// It is also possible to install your own function outside this package for
+// retrieving OpenGL function pointers, to do this see InitWithProcAddrFunc.
+
+package gl
+
+/*
+#cgo windows CFLAGS: -DTAG_WINDOWS
+#cgo !gles2,windows LDFLAGS: -lopengl32
+#cgo gles2,windows LDFLAGS: -lGLESv2
+#cgo darwin CFLAGS: -DTAG_DARWIN
+#cgo !gles2,darwin LDFLAGS: -framework OpenGL
+#cgo gles2,darwin LDFLAGS: -framework OpenGLES
+#cgo linux freebsd netbsd openbsd CFLAGS: -DTAG_POSIX
+#cgo !egl,linux !egl,freebsd !egl,netbsd !egl,openbsd pkg-config: gl
+#cgo egl,linux egl,freebsd egl,netbsd egl,openbsd egl,windows CFLAGS: -DTAG_EGL
+#cgo egl,linux egl,freebsd egl,netbsd egl,openbsd pkg-config: egl
+#cgo egl,windows LDFLAGS: -lEGL
+#cgo egl,darwin LDFLAGS: -lEGL
+// Check the EGL tag first as it takes priority over the platform's default
+// configuration of WGL/GLX/CGL.
+#if defined(TAG_EGL)
+ #include
+ #include
+ static void* GlowGetProcAddress(const char* name) {
+ return eglGetProcAddress(name);
+ }
+#elif defined(TAG_WINDOWS)
+ #define WIN32_LEAN_AND_MEAN 1
+ #include
+ #include
+ static HMODULE ogl32dll = NULL;
+ static void* GlowGetProcAddress(const char* name) {
+ void* pf = wglGetProcAddress((LPCSTR) name);
+ if (pf) {
+ return pf;
+ }
+ if (ogl32dll == NULL) {
+ ogl32dll = LoadLibraryA("opengl32.dll");
+ }
+ return GetProcAddress(ogl32dll, (LPCSTR) name);
+ }
+#elif defined(TAG_DARWIN)
+ #include
+ #include
+ static void* GlowGetProcAddress(const char* name) {
+ return dlsym(RTLD_DEFAULT, name);
+ }
+#elif defined(TAG_POSIX)
+ #include
+ #include
+ static void* GlowGetProcAddress(const char* name) {
+ return glXGetProcAddress((const GLubyte *) name);
+ }
+#endif
+*/
+import "C"
+import "unsafe"
+
+func getProcAddress(namea string) unsafe.Pointer {
+ cname := C.CString(namea)
+ defer C.free(unsafe.Pointer(cname))
+ return C.GlowGetProcAddress(cname)
+}
diff --git a/archive/vendor/github.com/go-gl/mathgl/AUTHORS b/archive/vendor/github.com/go-gl/mathgl/AUTHORS
new file mode 100644
index 0000000..3de97dc
--- /dev/null
+++ b/archive/vendor/github.com/go-gl/mathgl/AUTHORS
@@ -0,0 +1,14 @@
+# This is the official list of go-gl/mathgl authors for copyright purposes.
+# This file is distinct from the CONTRIBUTORS files.
+# See the latter for an explanation.
+
+# Names should be added to this file as
+# Name or Organization
+# The email address is not required for organizations.
+
+# Please keep the list sorted.
+
+Alex Vasi
+Dmitri Shuralyov
+GlenKelley ??>
+Zoe Juozapaitis
diff --git a/archive/vendor/github.com/go-gl/mathgl/CONTRIBUTORS b/archive/vendor/github.com/go-gl/mathgl/CONTRIBUTORS
new file mode 100644
index 0000000..88569cd
--- /dev/null
+++ b/archive/vendor/github.com/go-gl/mathgl/CONTRIBUTORS
@@ -0,0 +1,21 @@
+# This is the official list of people who can contribute
+# (and typically have contributed) code to the mathgl
+# repository.
+#
+# The AUTHORS file lists the copyright holders; this file
+# lists people. For example, Google employees would be listed here
+# but not in AUTHORS, because Google would hold the copyright.
+#
+# When adding J Random Contributor's name to this file,
+# either J's name or J's organization's name should be
+# added to the AUTHORS file.
+#
+# Names should be added to this file like so:
+# Name
+#
+# Please keep the list sorted.
+
+Alex Vasi
+Dmitri Shuralyov
+GlenKelley ??>
+Zoe Juozapaitis
diff --git a/archive/vendor/github.com/go-gl/mathgl/LICENSE b/archive/vendor/github.com/go-gl/mathgl/LICENSE
new file mode 100644
index 0000000..a780cbd
--- /dev/null
+++ b/archive/vendor/github.com/go-gl/mathgl/LICENSE
@@ -0,0 +1,23 @@
+Copyright ©2013 The go-gl Authors. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the name of the gonum project nor the names of its authors and
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\ No newline at end of file
diff --git a/archive/vendor/github.com/go-gl/mathgl/mgl32/conv.go b/archive/vendor/github.com/go-gl/mathgl/mgl32/conv.go
new file mode 100644
index 0000000..b5b1775
--- /dev/null
+++ b/archive/vendor/github.com/go-gl/mathgl/mgl32/conv.go
@@ -0,0 +1,94 @@
+// Copyright 2014 The go-gl Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package mgl32
+
+import (
+ "math"
+)
+
+// CartesianToSpherical converts 3-dimensional cartesian coordinates (x,y,z) to spherical
+// coordinates with radius r, inclination theta, and azimuth phi.
+//
+// All angles are in radians.
+func CartesianToSpherical(coord Vec3) (r, theta, phi float32) {
+ r = coord.Len()
+ theta = float32(math.Acos(float64(coord[2] / r)))
+ phi = float32(math.Atan2(float64(coord[1]), float64(coord[0])))
+
+ return
+}
+
+// CartesianToCylindical converts 3-dimensional cartesian coordinates (x,y,z) to
+// cylindrical coordinates with radial distance r, azimuth phi, and height z.
+//
+// All angles are in radians.
+func CartesianToCylindical(coord Vec3) (rho, phi, z float32) {
+ rho = float32(math.Hypot(float64(coord[0]), float64(coord[1])))
+
+ phi = float32(math.Atan2(float64(coord[1]), float64(coord[0])))
+
+ z = coord[2]
+
+ return
+}
+
+// SphericalToCartesian converts spherical coordinates with radius r, inclination theta,
+// and azimuth phi to cartesian coordinates (x,y,z).
+//
+// Angles are in radians.
+func SphericalToCartesian(r, theta, phi float32) Vec3 {
+ st, ct := math.Sincos(float64(theta))
+ sp, cp := math.Sincos(float64(phi))
+
+ return Vec3{r * float32(st*cp), r * float32(st*sp), r * float32(ct)}
+}
+
+// SphericalToCylindrical converts spherical coordinates with radius r,
+// inclination theta, and azimuth phi to cylindrical coordinates with radial
+// distance r, azimuth phi, and height z.
+//
+// Angles are in radians
+func SphericalToCylindrical(r, theta, phi float32) (rho, phi2, z float32) {
+ s, c := math.Sincos(float64(theta))
+
+ rho = r * float32(s)
+ z = r * float32(c)
+ phi2 = phi
+
+ return
+}
+
+// CylindircalToSpherical converts cylindrical coordinates with radial distance
+// r, azimuth phi, and height z to spherical coordinates with radius r,
+// inclination theta, and azimuth phi.
+//
+// Angles are in radians
+func CylindircalToSpherical(rho, phi, z float32) (r, theta, phi2 float32) {
+ r = float32(math.Hypot(float64(rho), float64(z)))
+ phi2 = phi
+ theta = float32(math.Atan2(float64(rho), float64(z)))
+
+ return
+}
+
+// CylindricalToCartesian converts cylindrical coordinates with radial distance
+// r, azimuth phi, and height z to cartesian coordinates (x,y,z)
+//
+// Angles are in radians.
+func CylindricalToCartesian(rho, phi, z float32) Vec3 {
+ s, c := math.Sincos(float64(phi))
+
+ return Vec3{rho * float32(c), rho * float32(s), z}
+}
+
+// DegToRad converts degrees to radians
+func DegToRad(angle float32) float32 {
+ return angle * float32(math.Pi) / 180
+}
+
+// RadToDeg converts radians to degrees
+func RadToDeg(angle float32) float32 {
+ return angle * 180 / float32(math.Pi)
+}
diff --git a/archive/vendor/github.com/go-gl/mathgl/mgl32/doc.go b/archive/vendor/github.com/go-gl/mathgl/mgl32/doc.go
new file mode 100644
index 0000000..c7fcf9f
--- /dev/null
+++ b/archive/vendor/github.com/go-gl/mathgl/mgl32/doc.go
@@ -0,0 +1,22 @@
+// Copyright 2014 The go-gl Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+/*
+Package mgl[32|64] (an abbreviation of mathgl since the packages were split between 32 and 64-bit versions)
+is a pure Go math package specialized for 3D math, with inspiration from GLM. It provides statically-sized vectors and matrices with
+compile-time generated calculations for most basic math operations. It also provides several basic graphics utilities such as bezier curves and surfaces,
+generation of basic primitives like circles, easy creation of common matrices such as perspective or rotation, and common operations like converting
+to/from screen/OpenGL coordinates or Projecting/Unprojecting from an MVP matrix. Quaternions are also supported.
+
+The basic vectors and matrices are written with code generation, so looking directly at the source will probably be a bit confusing. I recommend looking at the Godoc
+instead, as all basic functions are documented.
+
+This package is written in Column Major Order to make it easier with OpenGL. This means for uniform blocks you can use the default ordering, and when you call
+pass-in functions you can leave the "transpose" argument as false.
+
+The package now contains variable sized vectors and matrices. Using these is discouraged. They exist for corner cases where you need "small" matrices that are still
+bigger than 4x4. An example may be a Jacobean used for inverse kinematics. Things like computer vision or general linear algebra are best left to packages
+more directly suited for that task -- OpenCV, BLAS, LAPACK, numpy, gonum (if you want to stay in Go), and so on.
+*/
+package mgl32
diff --git a/archive/vendor/github.com/go-gl/mathgl/mgl32/matmn.go b/archive/vendor/github.com/go-gl/mathgl/mgl32/matmn.go
new file mode 100644
index 0000000..82360e9
--- /dev/null
+++ b/archive/vendor/github.com/go-gl/mathgl/mgl32/matmn.go
@@ -0,0 +1,511 @@
+// Copyright 2014 The go-gl Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package mgl32
+
+import (
+ "math"
+)
+
+// MatMxN is an arbitrary mxn matrix backed by a slice of floats.
+//
+// This is emphatically not recommended for hardcore n-dimensional
+// linear algebra. For that purpose I recommend github.com/gonum/matrix or
+// well-tested C libraries such as BLAS or LAPACK.
+//
+// This is meant to complement future algorithms that may require matrices larger than
+// 4x4, but still relatively small (e.g. Jacobeans for inverse kinematics).
+//
+// It makes use of the same memory sync.Pool set that VecN does, with the same sizing rules.
+//
+// MatMN will always check if the receiver is nil on any method. Meaning MathMN(nil).Add(dst,m2)
+// should always work. Except for the Reshape function, the semantics of this is to "propogate" nils
+// forward, so if an invalid operation occurs in a long chain of matrix operations, the overall result will be nil.
+type MatMxN struct {
+ m, n int
+ dat []float32
+}
+
+// NewMatrix creates a matrix backed by a new slice of size m*n
+func NewMatrix(m, n int) (mat *MatMxN) {
+ if shouldPool {
+ return &MatMxN{m: m, n: n, dat: grabFromPool(m * n)}
+ } else {
+ return &MatMxN{m: m, n: n, dat: make([]float32, m*n)}
+ }
+}
+
+// NewMatrixFromData returns a matrix with data specified by the data in src
+//
+// For instance, to create a 3x3 MatMN from a Mat3
+//
+// m1 := mgl32.Rotate3DX(3.14159)
+// mat := mgl32.NewBackedMatrix(m1[:],3,3)
+//
+// will create an MN matrix matching the data in the original rotation matrix.
+// This matrix is NOT backed by the initial slice; it's a copy of the data
+//
+// If m*n > cap(src), this function will panic.
+func NewMatrixFromData(src []float32, m, n int) *MatMxN {
+ var internal []float32
+ if shouldPool {
+ internal = grabFromPool(m * n)
+ } else {
+ internal = make([]float32, m*n)
+ }
+ copy(internal, src[:m*n])
+
+ return &MatMxN{m: m, n: n, dat: internal}
+}
+
+// CopyMatMN copies src into dst. This Reshapes dst
+// to the same size as src.
+//
+// If dst or src is nil, this is a no-op
+func CopyMatMN(dst, src *MatMxN) {
+ if dst == nil || src == nil {
+ return
+ }
+ dst.Reshape(src.m, src.n)
+ copy(dst.dat, src.dat)
+}
+
+// IdentN stores the NxN identity matrix in dst, reallocating as necessary.
+func IdentN(dst *MatMxN, n int) *MatMxN {
+ dst = dst.Reshape(n, n)
+
+ for i := 0; i < n; i++ {
+ for j := 0; j < n; j++ {
+ if i == j {
+ dst.Set(i, j, 1)
+ } else {
+ dst.Set(i, j, 0)
+ }
+ }
+ }
+
+ return dst
+}
+
+// DiagN creates an NxN diagonal matrix seeded by the diagonal vector diag.
+// Meaning: for all entries, where i==j, dst.At(i,j) = diag[i]. Otherwise
+// dst.At(i,j) = 0
+//
+// This reshapes dst to the correct size, returning/grabbing from the memory
+// pool as necessary.
+func DiagN(dst *MatMxN, diag *VecN) *MatMxN {
+ dst = dst.Reshape(len(diag.vec), len(diag.vec))
+ n := len(diag.vec)
+
+ for i := 0; i < n; i++ {
+ for j := 0; j < n; j++ {
+ if i == j {
+ dst.Set(i, j, diag.vec[i])
+ } else {
+ dst.Set(i, j, 0)
+ }
+ }
+ }
+
+ return dst
+}
+
+// Zero reshapes the matrix to m by n and zeroes out all
+// elements.
+func (mat *MatMxN) Zero(m, n int) {
+ if mat == nil {
+ return
+ }
+
+ mat.Reshape(m, n)
+ for i := range mat.dat {
+ mat.dat[i] = 0
+ }
+}
+
+// destroy returns the underlying matrix slice to the memory pool
+func (mat *MatMxN) destroy() {
+ if mat == nil {
+ return
+ }
+
+ if shouldPool && mat.dat != nil {
+ returnToPool(mat.dat)
+ }
+ mat.m, mat.n = 0, 0
+ mat.dat = nil
+}
+
+// Reshape reshapes the matrix to the desired dimensions.
+// If the overall size of the new matrix (m*n) is bigger
+// than the current size, the underlying slice will
+// be grown, sending the current slice to the memory pool
+// and grabbing a bigger one if necessary
+//
+// If the caller is a nil pointer, the return value will be a new
+// matrix, as if NewMatrix(m,n) had been called. Otherwise it's
+// simply the caller.
+func (mat *MatMxN) Reshape(m, n int) *MatMxN {
+ if mat == nil {
+ return NewMatrix(m, n)
+ }
+
+ if m*n <= cap(mat.dat) {
+ if mat.dat != nil {
+ mat.dat = mat.dat[:m*n]
+ } else {
+ mat.dat = []float32{}
+ }
+ mat.m, mat.n = m, n
+ return mat
+ }
+
+ if shouldPool && mat.dat != nil {
+ returnToPool(mat.dat)
+ }
+ (*mat) = (*NewMatrix(m, n))
+
+ return mat
+}
+
+// InferMatrix infers an MxN matrix from a constant matrix from this package.
+// For instance, a Mat2x3 inferred with this function will work just like
+// NewMatrixFromData(m[:],2,3) where m is the Mat2x3. This uses a type switch.
+//
+// I personally recommend using NewMatrixFromData, because it avoids a
+// potentially costly type switch. However, this is also more robust and less
+// error prone if you change the size of your matrix somewhere.
+//
+// If the value passed in is not recognized, it returns an InferMatrixError.
+func (mat *MatMxN) InferMatrix(m interface{}) (*MatMxN, error) {
+ switch raw := m.(type) {
+ case Mat2:
+ return NewMatrixFromData(raw[:], 2, 2), nil
+ case Mat2x3:
+ return NewMatrixFromData(raw[:], 2, 3), nil
+ case Mat2x4:
+ return NewMatrixFromData(raw[:], 2, 4), nil
+ case Mat3:
+ return NewMatrixFromData(raw[:], 3, 3), nil
+ case Mat3x2:
+ return NewMatrixFromData(raw[:], 3, 2), nil
+ case Mat3x4:
+ return NewMatrixFromData(raw[:], 3, 4), nil
+ case Mat4:
+ return NewMatrixFromData(raw[:], 4, 4), nil
+ case Mat4x2:
+ return NewMatrixFromData(raw[:], 4, 2), nil
+ case Mat4x3:
+ return NewMatrixFromData(raw[:], 4, 3), nil
+ default:
+ return nil, InferMatrixError{}
+ }
+}
+
+// Trace returns the trace of a square matrix (sum of all diagonal elements). If
+// the matrix is nil, or not square, the result will be NaN.
+func (mat *MatMxN) Trace() float32 {
+ if mat == nil || mat.m != mat.n {
+ return float32(math.NaN())
+ }
+
+ var out float32
+ for i := 0; i < mat.m; i++ {
+ out += mat.At(i, i)
+ }
+
+ return out
+}
+
+// Transpose takes the transpose of mat and puts it in dst.
+//
+// If dst is not of the correct dimensions, it will be Reshaped,
+// if dst and mat are the same, a temporary matrix of the correct size will
+// be allocated; these resources will be released via the memory pool.
+//
+// This should be improved in the future.
+func (mat *MatMxN) Transpose(dst *MatMxN) (t *MatMxN) {
+ if mat == nil {
+ return nil
+ }
+
+ if dst == mat {
+ dst = NewMatrix(mat.n, mat.m)
+
+ // Copy data to correct matrix,
+ // delete temporary buffer,
+ // and set the return value to the
+ // correct one
+ defer func() {
+ copy(mat.dat, dst.dat)
+
+ mat.m, mat.n = mat.n, mat.m
+
+ dst.destroy()
+ t = mat
+ }()
+
+ return mat
+ } else {
+ dst = dst.Reshape(mat.n, mat.m)
+ }
+
+ for r := 0; r < mat.m; r++ {
+ for c := 0; c < mat.n; c++ {
+ dst.dat[r*dst.m+c] = mat.dat[c*mat.m+r]
+ }
+ }
+
+ return dst
+}
+
+// Raw returns the raw slice backing this matrix
+func (mat *MatMxN) Raw() []float32 {
+ if mat == nil {
+ return nil
+ }
+
+ return mat.dat
+}
+
+// NumRows returns the number of rows in this matrix
+func (mat *MatMxN) NumRows() int {
+ return mat.m
+}
+
+// NumCols returns the number of columns in this matrix
+func (mat *MatMxN) NumCols() int {
+ return mat.n
+}
+
+// NumRowCols returns the number of rows and columns in this matrix
+// as a single operation
+func (mat *MatMxN) NumRowCols() (rows, cols int) {
+ return mat.m, mat.n
+}
+
+// At returns the element at the given row and column.
+// This is garbage in/garbage out and does no bounds
+// checking. If the computation happens to lead to an invalid
+// element, it will be returned; or it may panic.
+func (mat *MatMxN) At(row, col int) float32 {
+ return mat.dat[col*mat.m+row]
+}
+
+// Set sets the element at the given row and column.
+// This is garbage in/garbage out and does no bounds
+// checking. If the computation happens to lead to an invalid
+// element, it will be set; or it may panic.
+func (mat *MatMxN) Set(row, col int, val float32) {
+ mat.dat[col*mat.m+row] = val
+}
+
+// Add is the arithemtic + operator defined on a MatMxN.
+func (mat *MatMxN) Add(dst *MatMxN, addend *MatMxN) *MatMxN {
+ if mat == nil || addend == nil || mat.m != addend.m || mat.n != addend.n {
+ return nil
+ }
+
+ dst = dst.Reshape(mat.m, mat.n)
+
+ // No need to care about rows and columns
+ // since it's element-wise anyway
+ for i, el := range mat.dat {
+ dst.dat[i] = el + addend.dat[i]
+ }
+
+ return dst
+}
+
+// Sub is the arithemtic - operator defined on a MatMxN.
+func (mat *MatMxN) Sub(dst *MatMxN, subtrahend *MatMxN) *MatMxN {
+ if mat == nil || subtrahend == nil || mat.m != subtrahend.m || mat.n != subtrahend.n {
+ return nil
+ }
+
+ dst = dst.Reshape(mat.m, mat.n)
+
+ // No need to care about rows and columns
+ // since it's element-wise anyway
+ for i, el := range mat.dat {
+ dst.dat[i] = el - subtrahend.dat[i]
+ }
+
+ return dst
+}
+
+// MulMxN performs matrix multiplication on MxN matrix mat and NxO matrix mul,
+// storing the result in dst. This returns dst, or nil if the operation is not
+// able to be performed.
+//
+// If mat == dst, or mul == dst a temporary matrix will be used.
+//
+// This uses the naive algorithm (though on smaller matrices, this can actually
+// be faster; about len(mat)+len(mul) < ~100)
+func (mat *MatMxN) MulMxN(dst *MatMxN, mul *MatMxN) *MatMxN {
+ if mat == nil || mul == nil || mat.n != mul.m {
+ return nil
+ }
+
+ if dst == mul {
+ mul = NewMatrix(mul.m, mul.n)
+ copy(mul.dat, dst.dat)
+
+ // If mat==dst==mul, we need to change
+ // mat too or we have a bug
+ if mat == dst {
+ mat = mul
+ }
+
+ defer mul.destroy()
+ } else if dst == mat {
+ mat = NewMatrix(mat.m, mat.n)
+ copy(mat.dat, dst.dat)
+
+ defer mat.destroy()
+ }
+
+ dst = dst.Reshape(mat.m, mul.n)
+ for r1 := 0; r1 < mat.m; r1++ {
+ for c2 := 0; c2 < mul.n; c2++ {
+
+ dst.dat[c2*mat.m+r1] = 0
+ for i := 0; i < mat.n; i++ {
+ dst.dat[c2*mat.m+r1] += mat.dat[i*mat.m+r1] * mul.dat[c2*mul.m+i]
+ }
+
+ }
+ }
+
+ return dst
+}
+
+// Mul performs a scalar multiplication between mat and some constant c,
+// storing the result in dst. Mat and dst can be equal. If dst is not the
+// correct size, a Reshape will occur.
+func (mat *MatMxN) Mul(dst *MatMxN, c float32) *MatMxN {
+ if mat == nil {
+ return nil
+ }
+
+ dst = dst.Reshape(mat.m, mat.n)
+
+ for i, el := range mat.dat {
+ dst.dat[i] = el * c
+ }
+
+ return dst
+}
+
+// MulNx1 multiplies the matrix by a vector of size n. If mat or v is nil, this
+// returns nil. If the number of columns in mat does not match the Size of v,
+// this also returns nil.
+//
+// Dst will be resized if it's not big enough. If dst == v; a temporary vector
+// will be allocated and returned via the realloc callback when complete.
+func (mat *MatMxN) MulNx1(dst, v *VecN) *VecN {
+ if mat == nil || v == nil || mat.n != len(v.vec) {
+ return nil
+ }
+ if dst == v {
+ v = NewVecN(len(v.vec))
+ copy(v.vec, dst.vec)
+
+ defer v.destroy()
+ }
+
+ dst = dst.Resize(mat.m)
+
+ for r := 0; r < mat.m; r++ {
+ dst.vec[r] = 0
+
+ for c := 0; c < mat.n; c++ {
+ dst.vec[r] += mat.At(r, c) * v.vec[c]
+ }
+ }
+
+ return dst
+}
+
+// ApproxEqual returns whether the two vectors are approximately equal (See
+// FloatEqual).
+func (mat *MatMxN) ApproxEqual(m2 *MatMxN) bool {
+ if mat == m2 {
+ return true
+ }
+ if mat.m != m2.m || mat.n != m2.n {
+ return false
+ }
+
+ for i, el := range mat.dat {
+ if !FloatEqual(el, m2.dat[i]) {
+ return false
+ }
+ }
+
+ return true
+}
+
+// ApproxEqualThreshold returns whether the two vectors are approximately equal
+// to within the given threshold given by "epsilon" (See ApproxEqualThreshold).
+func (mat *MatMxN) ApproxEqualThreshold(m2 *MatMxN, epsilon float32) bool {
+ if mat == m2 {
+ return true
+ }
+ if mat.m != m2.m || mat.n != m2.n {
+ return false
+ }
+
+ for i, el := range mat.dat {
+ if !FloatEqualThreshold(el, m2.dat[i], epsilon) {
+ return false
+ }
+ }
+
+ return true
+}
+
+// ApproxEqualFunc returns whether the two vectors are approximately equal,
+// given a function which compares two scalar elements.
+func (mat *MatMxN) ApproxEqualFunc(m2 *MatMxN, comp func(float32, float32) bool) bool {
+ if mat == m2 {
+ return true
+ }
+ if mat.m != m2.m || mat.n != m2.n {
+ return false
+ }
+
+ for i, el := range mat.dat {
+ if !comp(el, m2.dat[i]) {
+ return false
+ }
+ }
+
+ return true
+}
+
+// InferMatrixError may be returned by InferMatrix.
+//
+// Make sure you're using a constant matrix such as Mat3 from within the same
+// package (meaning: mgl32.MatMxN can't handle a mgl64.Mat2x3).
+type InferMatrixError struct{}
+
+func (me InferMatrixError) Error() string {
+ return "could not infer matrix. Make sure you're using a constant matrix such as Mat3 from within the same package (meaning: mgl32.MatMxN can't handle a mgl64.Mat2x3)."
+}
+
+// RectangularMatrixError is returned when a rectangular matrix was expected but
+// not given.
+type RectangularMatrixError struct{}
+
+func (mse RectangularMatrixError) Error() string {
+ return "the matrix was the wrong shape, needed a square matrix."
+}
+
+// NilMatrixError is returned when an operand to a function was unexpectedly 'nil'.
+type NilMatrixError struct{}
+
+func (me NilMatrixError) Error() string {
+ return "the matrix is nil"
+}
diff --git a/archive/vendor/github.com/go-gl/mathgl/mgl32/matrix.go b/archive/vendor/github.com/go-gl/mathgl/mgl32/matrix.go
new file mode 100644
index 0000000..8d8d25a
--- /dev/null
+++ b/archive/vendor/github.com/go-gl/mathgl/mgl32/matrix.go
@@ -0,0 +1,2430 @@
+// Copyright 2014 The go-gl/mathgl Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// This file is generated by codegen.go; DO NOT EDIT
+// Edit matrix.tmpl and run "go generate" to make changes.
+
+package mgl32
+
+import (
+ "bytes"
+ "fmt"
+ "text/tabwriter"
+)
+
+type Mat2 [2 * 2]float32
+type Mat2x3 [2 * 3]float32
+type Mat2x4 [2 * 4]float32
+type Mat3x2 [3 * 2]float32
+type Mat3 [3 * 3]float32
+type Mat3x4 [3 * 4]float32
+type Mat4x2 [4 * 2]float32
+type Mat4x3 [4 * 3]float32
+type Mat4 [4 * 4]float32
+
+func (m Mat2) Mat3() Mat3 {
+ col0, col1 := m.Cols()
+ return Mat3FromCols(
+ col0.Vec3(0),
+ col1.Vec3(0),
+ Vec3{0, 0, 1},
+ )
+}
+
+func (m Mat2) Mat4() Mat4 {
+ col0, col1 := m.Cols()
+ return Mat4FromCols(
+ col0.Vec4(0, 0),
+ col1.Vec4(0, 0),
+ Vec4{0, 0, 1, 0},
+ Vec4{0, 0, 0, 1},
+ )
+}
+
+func (m Mat3) Mat2() Mat2 {
+ col0, col1, _ := m.Cols()
+ return Mat2FromCols(
+ col0.Vec2(),
+ col1.Vec2(),
+ )
+}
+
+func (m Mat3) Mat4() Mat4 {
+ col0, col1, col2 := m.Cols()
+ return Mat4FromCols(
+ col0.Vec4(0),
+ col1.Vec4(0),
+ col2.Vec4(0),
+ Vec4{0, 0, 0, 1},
+ )
+}
+
+func (m Mat4) Mat2() Mat2 {
+ col0, col1, _, _ := m.Cols()
+ return Mat2FromCols(
+ col0.Vec2(),
+ col1.Vec2(),
+ )
+}
+
+func (m Mat4) Mat3() Mat3 {
+ col0, col1, col2, _ := m.Cols()
+ return Mat3FromCols(
+ col0.Vec3(),
+ col1.Vec3(),
+ col2.Vec3(),
+ )
+}
+
+// SetCol sets a Column within the Matrix, so it mutates the calling matrix.
+func (m *Mat2) SetCol(col int, v Vec2) {
+ m[col*2+0], m[col*2+1] = v[0], v[1]
+}
+
+// SetRow sets a Row within the Matrix, so it mutates the calling matrix.
+func (m *Mat2) SetRow(row int, v Vec2) {
+ m[row+0], m[row+2] = v[0], v[1]
+}
+
+// Diag is a basic operation on a square matrix that simply
+// returns main diagonal (meaning all elements such that row==col).
+func (m Mat2) Diag() Vec2 {
+ return Vec2{m[0], m[3]}
+}
+
+// Ident2 returns the 2x2 identity matrix.
+// The identity matrix is a square matrix with the value 1 on its
+// diagonals. The characteristic property of the identity matrix is that
+// any matrix multiplied by it is itself. (MI = M; IN = N)
+func Ident2() Mat2 {
+ return Mat2{1, 0, 0, 1}
+}
+
+// Diag2 creates a diagonal matrix from the entries of the input vector.
+// That is, for each pointer for row==col, vector[row] is the entry. Otherwise it's 0.
+//
+// Another way to think about it is that the identity is this function where the every vector element is 1.
+func Diag2(v Vec2) Mat2 {
+ var m Mat2
+ m[0], m[3] = v[0], v[1]
+ return m
+}
+
+// Mat2FromRows builds a new matrix from row vectors.
+// The resulting matrix will still be in column major order, but this can be
+// good for hand-building matrices.
+
+func Mat2FromRows(row0, row1 Vec2) Mat2 {
+ return Mat2{row0[0], row1[0], row0[1], row1[1]}
+}
+
+// Mat2FromCols builds a new matrix from column vectors.
+func Mat2FromCols(col0, col1 Vec2) Mat2 {
+ return Mat2{col0[0], col0[1], col1[0], col1[1]}
+}
+
+// Add performs an element-wise addition of two matrices, this is
+// equivalent to iterating over every element of m1 and adding the corresponding value of m2.
+func (m1 Mat2) Add(m2 Mat2) Mat2 {
+ return Mat2{m1[0] + m2[0], m1[1] + m2[1], m1[2] + m2[2], m1[3] + m2[3]}
+}
+
+// Sub performs an element-wise subtraction of two matrices, this is
+// equivalent to iterating over every element of m1 and subtracting the corresponding value of m2.
+func (m1 Mat2) Sub(m2 Mat2) Mat2 {
+ return Mat2{m1[0] - m2[0], m1[1] - m2[1], m1[2] - m2[2], m1[3] - m2[3]}
+}
+
+// Mul performs a scalar multiplcation of the matrix. This is equivalent to iterating
+// over every element of the matrix and multiply it by c.
+func (m1 Mat2) Mul(c float32) Mat2 {
+ return Mat2{m1[0] * c, m1[1] * c, m1[2] * c, m1[3] * c}
+}
+
+// Mul2x1 performs a "matrix product" between this matrix
+// and another of the given dimension. For any two matrices of dimensionality
+// MxN and NxO, the result will be MxO. For instance, Mat4 multiplied using
+// Mul4x2 will result in a Mat4x2.
+func (m1 Mat2) Mul2x1(m2 Vec2) Vec2 {
+ return Vec2{
+ m1[0]*m2[0] + m1[2]*m2[1],
+ m1[1]*m2[0] + m1[3]*m2[1],
+ }
+}
+
+// Mul2 performs a "matrix product" between this matrix
+// and another of the given dimension. For any two matrices of dimensionality
+// MxN and NxO, the result will be MxO. For instance, Mat4 multiplied using
+// Mul4x2 will result in a Mat4x2.
+func (m1 Mat2) Mul2(m2 Mat2) Mat2 {
+ return Mat2{
+ m1[0]*m2[0] + m1[2]*m2[1],
+ m1[1]*m2[0] + m1[3]*m2[1],
+ m1[0]*m2[2] + m1[2]*m2[3],
+ m1[1]*m2[2] + m1[3]*m2[3],
+ }
+}
+
+// Mul2x3 performs a "matrix product" between this matrix
+// and another of the given dimension. For any two matrices of dimensionality
+// MxN and NxO, the result will be MxO. For instance, Mat4 multiplied using
+// Mul4x2 will result in a Mat4x2.
+func (m1 Mat2) Mul2x3(m2 Mat2x3) Mat2x3 {
+ return Mat2x3{
+ m1[0]*m2[0] + m1[2]*m2[1],
+ m1[1]*m2[0] + m1[3]*m2[1],
+ m1[0]*m2[2] + m1[2]*m2[3],
+ m1[1]*m2[2] + m1[3]*m2[3],
+ m1[0]*m2[4] + m1[2]*m2[5],
+ m1[1]*m2[4] + m1[3]*m2[5],
+ }
+}
+
+// Mul2x4 performs a "matrix product" between this matrix
+// and another of the given dimension. For any two matrices of dimensionality
+// MxN and NxO, the result will be MxO. For instance, Mat4 multiplied using
+// Mul4x2 will result in a Mat4x2.
+func (m1 Mat2) Mul2x4(m2 Mat2x4) Mat2x4 {
+ return Mat2x4{
+ m1[0]*m2[0] + m1[2]*m2[1],
+ m1[1]*m2[0] + m1[3]*m2[1],
+ m1[0]*m2[2] + m1[2]*m2[3],
+ m1[1]*m2[2] + m1[3]*m2[3],
+ m1[0]*m2[4] + m1[2]*m2[5],
+ m1[1]*m2[4] + m1[3]*m2[5],
+ m1[0]*m2[6] + m1[2]*m2[7],
+ m1[1]*m2[6] + m1[3]*m2[7],
+ }
+}
+
+// Transpose produces the transpose of this matrix. For any MxN matrix
+// the transpose is an NxM matrix with the rows swapped with the columns. For instance
+// the transpose of the Mat3x2 is a Mat2x3 like so:
+//
+// [[a b]] [[a c e]]
+// [[c d]] = [[b d f]]
+// [[e f]]
+func (m1 Mat2) Transpose() Mat2 {
+ return Mat2{m1[0], m1[2], m1[1], m1[3]}
+}
+
+// Det returns the determinant of a matrix. It is a measure of a square matrix's
+// singularity and invertability, among other things. In this library, the
+// determinant is hard coded based on pre-computed cofactor expansion, and uses
+// no loops. Of course, the addition and multiplication must still be done.
+func (m Mat2) Det() float32 {
+ return m[0]*m[3] - m[1]*m[2]
+}
+
+// Inv computes the inverse of a square matrix. An inverse is a square matrix such that when multiplied by the
+// original, yields the identity.
+//
+// M_inv * M = M * M_inv = I
+//
+// In this library, the math is precomputed, and uses no loops, though the multiplications, additions, determinant calculation, and scaling
+// are still done. This can still be (relatively) expensive for a 4x4.
+//
+// This function checks the determinant to see if the matrix is invertible.
+// If the determinant is 0.0, this function returns the zero matrix. However, due to floating point errors, it is
+// entirely plausible to get a false positive or negative.
+// In the future, an alternate function may be written which takes in a pre-computed determinant.
+func (m Mat2) Inv() Mat2 {
+ det := m.Det()
+ if FloatEqual(det, float32(0.0)) {
+ return Mat2{}
+ }
+
+ retMat := Mat2{m[3], -m[1], -m[2], m[0]}
+
+ return retMat.Mul(1 / det)
+}
+
+// ApproxEqual performs an element-wise approximate equality test between two matrices,
+// as if FloatEqual had been used.
+func (m1 Mat2) ApproxEqual(m2 Mat2) bool {
+ for i := range m1 {
+ if !FloatEqual(m1[i], m2[i]) {
+ return false
+ }
+ }
+ return true
+}
+
+// ApproxEqualThreshold performs an element-wise approximate equality test between two matrices
+// with a given epsilon threshold, as if FloatEqualThreshold had been used.
+func (m1 Mat2) ApproxEqualThreshold(m2 Mat2, threshold float32) bool {
+ for i := range m1 {
+ if !FloatEqualThreshold(m1[i], m2[i], threshold) {
+ return false
+ }
+ }
+ return true
+}
+
+// ApproxFuncEqual performs an element-wise approximate equality test between two matrices
+// with a given equality functions, intended to be used with FloatEqualFunc; although and comparison
+// function may be used in practice.
+func (m1 Mat2) ApproxFuncEqual(m2 Mat2, eq func(float32, float32) bool) bool {
+ for i := range m1 {
+ if !eq(m1[i], m2[i]) {
+ return false
+ }
+ }
+ return true
+}
+
+// NumRows returns the number of rows in this matrix
+func (m Mat2) NumRows() int {
+ return 2
+}
+
+// NumCols returns the number of columns in this matrix
+func (m Mat2) NumCols() int {
+ return 2
+}
+
+// At returns the matrix element at the given row and column.
+// This is equivalent to mat[col * numRow + row] where numRow is constant
+// (E.G. for a Mat3x2 it's equal to 3)
+//
+// This method is garbage-in garbage-out. For instance, on a Mat4 asking for
+// At(5,0) will work just like At(1,1). Or it may panic if it's out of bounds.
+func (m Mat2) At(row, col int) float32 {
+ return m[col*2+row]
+}
+
+// Set sets the corresponding matrix element at the given row and column.
+// This has a pointer receiver because it mutates the matrix.
+//
+// This method is garbage-in garbage-out. For instance, on a Mat4 asking for
+// Set(5,0,val) will work just like Set(1,1,val). Or it may panic if it's out of bounds.
+func (m *Mat2) Set(row, col int, value float32) {
+ m[col*2+row] = value
+}
+
+// Index returns the index of the given row and column, to be used with direct
+// access. E.G. Index(0,0) = 0.
+//
+// This is a garbage-in garbage-out method. For instance, on a Mat4 asking for the index of
+// (5,0) will work the same as asking for (1,1). Or it may give you a value that will cause
+// a panic if you try to access the array with it if it's truly out of bounds.
+func (m Mat2) Index(row, col int) int {
+ return col*2 + row
+}
+
+// Row returns a vector representing the corresponding row (starting at row 0).
+// This package makes no distinction between row and column vectors, so it
+// will be a normal VecM for a MxN matrix.
+func (m Mat2) Row(row int) Vec2 {
+ return Vec2{m[row+0], m[row+2]}
+}
+
+// Rows decomposes a matrix into its corresponding row vectors.
+// This is equivalent to calling mat.Row for each row.
+func (m Mat2) Rows() (row0, row1 Vec2) {
+ return m.Row(0), m.Row(1)
+}
+
+// Col returns a vector representing the corresponding column (starting at col 0).
+// This package makes no distinction between row and column vectors, so it
+// will be a normal VecN for a MxN matrix.
+func (m Mat2) Col(col int) Vec2 {
+ return Vec2{m[col*2+0], m[col*2+1]}
+}
+
+// Cols decomposes a matrix into its corresponding column vectors.
+// This is equivalent to calling mat.Col for each column.
+func (m Mat2) Cols() (col0, col1 Vec2) {
+ return m.Col(0), m.Col(1)
+}
+
+// Trace is a basic operation on a square matrix that simply
+// sums up all elements on the main diagonal (meaning all elements such that row==col).
+func (m Mat2) Trace() float32 {
+ return m[0] + m[3]
+}
+
+// Abs returns the element-wise absolute value of this matrix
+func (m Mat2) Abs() Mat2 {
+ return Mat2{Abs(m[0]), Abs(m[1]), Abs(m[2]), Abs(m[3])}
+}
+
+// Pretty prints the matrix
+func (m Mat2) String() string {
+ buf := new(bytes.Buffer)
+ w := tabwriter.NewWriter(buf, 4, 4, 1, ' ', tabwriter.AlignRight)
+ for i := 0; i < 2; i++ {
+ for _, col := range m.Row(i) {
+ fmt.Fprintf(w, "%f\t", col)
+ }
+
+ fmt.Fprintln(w, "")
+ }
+ w.Flush()
+
+ return buf.String()
+}
+
+// SetCol sets a Column within the Matrix, so it mutates the calling matrix.
+func (m *Mat2x3) SetCol(col int, v Vec2) {
+ m[col*2+0], m[col*2+1] = v[0], v[1]
+}
+
+// SetRow sets a Row within the Matrix, so it mutates the calling matrix.
+func (m *Mat2x3) SetRow(row int, v Vec3) {
+ m[row+0], m[row+2], m[row+4] = v[0], v[1], v[2]
+}
+
+// Mat2x3FromRows builds a new matrix from row vectors.
+// The resulting matrix will still be in column major order, but this can be
+// good for hand-building matrices.
+
+func Mat2x3FromRows(row0, row1 Vec3) Mat2x3 {
+ return Mat2x3{row0[0], row1[0], row0[1], row1[1], row0[2], row1[2]}
+}
+
+// Mat2x3FromCols builds a new matrix from column vectors.
+func Mat2x3FromCols(col0, col1, col2 Vec2) Mat2x3 {
+ return Mat2x3{col0[0], col0[1], col1[0], col1[1], col2[0], col2[1]}
+}
+
+// Add performs an element-wise addition of two matrices, this is
+// equivalent to iterating over every element of m1 and adding the corresponding value of m2.
+func (m1 Mat2x3) Add(m2 Mat2x3) Mat2x3 {
+ return Mat2x3{m1[0] + m2[0], m1[1] + m2[1], m1[2] + m2[2], m1[3] + m2[3], m1[4] + m2[4], m1[5] + m2[5]}
+}
+
+// Sub performs an element-wise subtraction of two matrices, this is
+// equivalent to iterating over every element of m1 and subtracting the corresponding value of m2.
+func (m1 Mat2x3) Sub(m2 Mat2x3) Mat2x3 {
+ return Mat2x3{m1[0] - m2[0], m1[1] - m2[1], m1[2] - m2[2], m1[3] - m2[3], m1[4] - m2[4], m1[5] - m2[5]}
+}
+
+// Mul performs a scalar multiplcation of the matrix. This is equivalent to iterating
+// over every element of the matrix and multiply it by c.
+func (m1 Mat2x3) Mul(c float32) Mat2x3 {
+ return Mat2x3{m1[0] * c, m1[1] * c, m1[2] * c, m1[3] * c, m1[4] * c, m1[5] * c}
+}
+
+// Mul3x1 performs a "matrix product" between this matrix
+// and another of the given dimension. For any two matrices of dimensionality
+// MxN and NxO, the result will be MxO. For instance, Mat4 multiplied using
+// Mul4x2 will result in a Mat4x2.
+func (m1 Mat2x3) Mul3x1(m2 Vec3) Vec2 {
+ return Vec2{
+ m1[0]*m2[0] + m1[2]*m2[1] + m1[4]*m2[2],
+ m1[1]*m2[0] + m1[3]*m2[1] + m1[5]*m2[2],
+ }
+}
+
+// Mul3x2 performs a "matrix product" between this matrix
+// and another of the given dimension. For any two matrices of dimensionality
+// MxN and NxO, the result will be MxO. For instance, Mat4 multiplied using
+// Mul4x2 will result in a Mat4x2.
+func (m1 Mat2x3) Mul3x2(m2 Mat3x2) Mat2 {
+ return Mat2{
+ m1[0]*m2[0] + m1[2]*m2[1] + m1[4]*m2[2],
+ m1[1]*m2[0] + m1[3]*m2[1] + m1[5]*m2[2],
+ m1[0]*m2[3] + m1[2]*m2[4] + m1[4]*m2[5],
+ m1[1]*m2[3] + m1[3]*m2[4] + m1[5]*m2[5],
+ }
+}
+
+// Mul3 performs a "matrix product" between this matrix
+// and another of the given dimension. For any two matrices of dimensionality
+// MxN and NxO, the result will be MxO. For instance, Mat4 multiplied using
+// Mul4x2 will result in a Mat4x2.
+func (m1 Mat2x3) Mul3(m2 Mat3) Mat2x3 {
+ return Mat2x3{
+ m1[0]*m2[0] + m1[2]*m2[1] + m1[4]*m2[2],
+ m1[1]*m2[0] + m1[3]*m2[1] + m1[5]*m2[2],
+ m1[0]*m2[3] + m1[2]*m2[4] + m1[4]*m2[5],
+ m1[1]*m2[3] + m1[3]*m2[4] + m1[5]*m2[5],
+ m1[0]*m2[6] + m1[2]*m2[7] + m1[4]*m2[8],
+ m1[1]*m2[6] + m1[3]*m2[7] + m1[5]*m2[8],
+ }
+}
+
+// Mul3x4 performs a "matrix product" between this matrix
+// and another of the given dimension. For any two matrices of dimensionality
+// MxN and NxO, the result will be MxO. For instance, Mat4 multiplied using
+// Mul4x2 will result in a Mat4x2.
+func (m1 Mat2x3) Mul3x4(m2 Mat3x4) Mat2x4 {
+ return Mat2x4{
+ m1[0]*m2[0] + m1[2]*m2[1] + m1[4]*m2[2],
+ m1[1]*m2[0] + m1[3]*m2[1] + m1[5]*m2[2],
+ m1[0]*m2[3] + m1[2]*m2[4] + m1[4]*m2[5],
+ m1[1]*m2[3] + m1[3]*m2[4] + m1[5]*m2[5],
+ m1[0]*m2[6] + m1[2]*m2[7] + m1[4]*m2[8],
+ m1[1]*m2[6] + m1[3]*m2[7] + m1[5]*m2[8],
+ m1[0]*m2[9] + m1[2]*m2[10] + m1[4]*m2[11],
+ m1[1]*m2[9] + m1[3]*m2[10] + m1[5]*m2[11],
+ }
+}
+
+// Transpose produces the transpose of this matrix. For any MxN matrix
+// the transpose is an NxM matrix with the rows swapped with the columns. For instance
+// the transpose of the Mat3x2 is a Mat2x3 like so:
+//
+// [[a b]] [[a c e]]
+// [[c d]] = [[b d f]]
+// [[e f]]
+func (m1 Mat2x3) Transpose() Mat3x2 {
+ return Mat3x2{m1[0], m1[2], m1[4], m1[1], m1[3], m1[5]}
+}
+
+// ApproxEqual performs an element-wise approximate equality test between two matrices,
+// as if FloatEqual had been used.
+func (m1 Mat2x3) ApproxEqual(m2 Mat2x3) bool {
+ for i := range m1 {
+ if !FloatEqual(m1[i], m2[i]) {
+ return false
+ }
+ }
+ return true
+}
+
+// ApproxEqualThreshold performs an element-wise approximate equality test between two matrices
+// with a given epsilon threshold, as if FloatEqualThreshold had been used.
+func (m1 Mat2x3) ApproxEqualThreshold(m2 Mat2x3, threshold float32) bool {
+ for i := range m1 {
+ if !FloatEqualThreshold(m1[i], m2[i], threshold) {
+ return false
+ }
+ }
+ return true
+}
+
+// ApproxFuncEqual performs an element-wise approximate equality test between two matrices
+// with a given equality functions, intended to be used with FloatEqualFunc; although and comparison
+// function may be used in practice.
+func (m1 Mat2x3) ApproxFuncEqual(m2 Mat2x3, eq func(float32, float32) bool) bool {
+ for i := range m1 {
+ if !eq(m1[i], m2[i]) {
+ return false
+ }
+ }
+ return true
+}
+
+// NumRows returns the number of rows in this matrix
+func (m Mat2x3) NumRows() int {
+ return 2
+}
+
+// NumCols returns the number of columns in this matrix
+func (m Mat2x3) NumCols() int {
+ return 3
+}
+
+// At returns the matrix element at the given row and column.
+// This is equivalent to mat[col * numRow + row] where numRow is constant
+// (E.G. for a Mat3x2 it's equal to 3)
+//
+// This method is garbage-in garbage-out. For instance, on a Mat4 asking for
+// At(5,0) will work just like At(1,1). Or it may panic if it's out of bounds.
+func (m Mat2x3) At(row, col int) float32 {
+ return m[col*2+row]
+}
+
+// Set sets the corresponding matrix element at the given row and column.
+// This has a pointer receiver because it mutates the matrix.
+//
+// This method is garbage-in garbage-out. For instance, on a Mat4 asking for
+// Set(5,0,val) will work just like Set(1,1,val). Or it may panic if it's out of bounds.
+func (m *Mat2x3) Set(row, col int, value float32) {
+ m[col*2+row] = value
+}
+
+// Index returns the index of the given row and column, to be used with direct
+// access. E.G. Index(0,0) = 0.
+//
+// This is a garbage-in garbage-out method. For instance, on a Mat4 asking for the index of
+// (5,0) will work the same as asking for (1,1). Or it may give you a value that will cause
+// a panic if you try to access the array with it if it's truly out of bounds.
+func (m Mat2x3) Index(row, col int) int {
+ return col*2 + row
+}
+
+// Row returns a vector representing the corresponding row (starting at row 0).
+// This package makes no distinction between row and column vectors, so it
+// will be a normal VecM for a MxN matrix.
+func (m Mat2x3) Row(row int) Vec3 {
+ return Vec3{m[row+0], m[row+2], m[row+4]}
+}
+
+// Rows decomposes a matrix into its corresponding row vectors.
+// This is equivalent to calling mat.Row for each row.
+func (m Mat2x3) Rows() (row0, row1 Vec3) {
+ return m.Row(0), m.Row(1)
+}
+
+// Col returns a vector representing the corresponding column (starting at col 0).
+// This package makes no distinction between row and column vectors, so it
+// will be a normal VecN for a MxN matrix.
+func (m Mat2x3) Col(col int) Vec2 {
+ return Vec2{m[col*2+0], m[col*2+1]}
+}
+
+// Cols decomposes a matrix into its corresponding column vectors.
+// This is equivalent to calling mat.Col for each column.
+func (m Mat2x3) Cols() (col0, col1, col2 Vec2) {
+ return m.Col(0), m.Col(1), m.Col(2)
+}
+
+// Abs returns the element-wise absolute value of this matrix
+func (m Mat2x3) Abs() Mat2x3 {
+ return Mat2x3{Abs(m[0]), Abs(m[1]), Abs(m[2]), Abs(m[3]), Abs(m[4]), Abs(m[5])}
+}
+
+// Pretty prints the matrix
+func (m Mat2x3) String() string {
+ buf := new(bytes.Buffer)
+ w := tabwriter.NewWriter(buf, 4, 4, 1, ' ', tabwriter.AlignRight)
+ for i := 0; i < 2; i++ {
+ for _, col := range m.Row(i) {
+ fmt.Fprintf(w, "%f\t", col)
+ }
+
+ fmt.Fprintln(w, "")
+ }
+ w.Flush()
+
+ return buf.String()
+}
+
+// SetCol sets a Column within the Matrix, so it mutates the calling matrix.
+func (m *Mat2x4) SetCol(col int, v Vec2) {
+ m[col*2+0], m[col*2+1] = v[0], v[1]
+}
+
+// SetRow sets a Row within the Matrix, so it mutates the calling matrix.
+func (m *Mat2x4) SetRow(row int, v Vec4) {
+ m[row+0], m[row+2], m[row+4], m[row+6] = v[0], v[1], v[2], v[3]
+}
+
+// Mat2x4FromRows builds a new matrix from row vectors.
+// The resulting matrix will still be in column major order, but this can be
+// good for hand-building matrices.
+
+func Mat2x4FromRows(row0, row1 Vec4) Mat2x4 {
+ return Mat2x4{row0[0], row1[0], row0[1], row1[1], row0[2], row1[2], row0[3], row1[3]}
+}
+
+// Mat2x4FromCols builds a new matrix from column vectors.
+func Mat2x4FromCols(col0, col1, col2, col3 Vec2) Mat2x4 {
+ return Mat2x4{col0[0], col0[1], col1[0], col1[1], col2[0], col2[1], col3[0], col3[1]}
+}
+
+// Add performs an element-wise addition of two matrices, this is
+// equivalent to iterating over every element of m1 and adding the corresponding value of m2.
+func (m1 Mat2x4) Add(m2 Mat2x4) Mat2x4 {
+ return Mat2x4{m1[0] + m2[0], m1[1] + m2[1], m1[2] + m2[2], m1[3] + m2[3], m1[4] + m2[4], m1[5] + m2[5], m1[6] + m2[6], m1[7] + m2[7]}
+}
+
+// Sub performs an element-wise subtraction of two matrices, this is
+// equivalent to iterating over every element of m1 and subtracting the corresponding value of m2.
+func (m1 Mat2x4) Sub(m2 Mat2x4) Mat2x4 {
+ return Mat2x4{m1[0] - m2[0], m1[1] - m2[1], m1[2] - m2[2], m1[3] - m2[3], m1[4] - m2[4], m1[5] - m2[5], m1[6] - m2[6], m1[7] - m2[7]}
+}
+
+// Mul performs a scalar multiplcation of the matrix. This is equivalent to iterating
+// over every element of the matrix and multiply it by c.
+func (m1 Mat2x4) Mul(c float32) Mat2x4 {
+ return Mat2x4{m1[0] * c, m1[1] * c, m1[2] * c, m1[3] * c, m1[4] * c, m1[5] * c, m1[6] * c, m1[7] * c}
+}
+
+// Mul4x1 performs a "matrix product" between this matrix
+// and another of the given dimension. For any two matrices of dimensionality
+// MxN and NxO, the result will be MxO. For instance, Mat4 multiplied using
+// Mul4x2 will result in a Mat4x2.
+func (m1 Mat2x4) Mul4x1(m2 Vec4) Vec2 {
+ return Vec2{
+ m1[0]*m2[0] + m1[2]*m2[1] + m1[4]*m2[2] + m1[6]*m2[3],
+ m1[1]*m2[0] + m1[3]*m2[1] + m1[5]*m2[2] + m1[7]*m2[3],
+ }
+}
+
+// Mul4x2 performs a "matrix product" between this matrix
+// and another of the given dimension. For any two matrices of dimensionality
+// MxN and NxO, the result will be MxO. For instance, Mat4 multiplied using
+// Mul4x2 will result in a Mat4x2.
+func (m1 Mat2x4) Mul4x2(m2 Mat4x2) Mat2 {
+ return Mat2{
+ m1[0]*m2[0] + m1[2]*m2[1] + m1[4]*m2[2] + m1[6]*m2[3],
+ m1[1]*m2[0] + m1[3]*m2[1] + m1[5]*m2[2] + m1[7]*m2[3],
+ m1[0]*m2[4] + m1[2]*m2[5] + m1[4]*m2[6] + m1[6]*m2[7],
+ m1[1]*m2[4] + m1[3]*m2[5] + m1[5]*m2[6] + m1[7]*m2[7],
+ }
+}
+
+// Mul4x3 performs a "matrix product" between this matrix
+// and another of the given dimension. For any two matrices of dimensionality
+// MxN and NxO, the result will be MxO. For instance, Mat4 multiplied using
+// Mul4x2 will result in a Mat4x2.
+func (m1 Mat2x4) Mul4x3(m2 Mat4x3) Mat2x3 {
+ return Mat2x3{
+ m1[0]*m2[0] + m1[2]*m2[1] + m1[4]*m2[2] + m1[6]*m2[3],
+ m1[1]*m2[0] + m1[3]*m2[1] + m1[5]*m2[2] + m1[7]*m2[3],
+ m1[0]*m2[4] + m1[2]*m2[5] + m1[4]*m2[6] + m1[6]*m2[7],
+ m1[1]*m2[4] + m1[3]*m2[5] + m1[5]*m2[6] + m1[7]*m2[7],
+ m1[0]*m2[8] + m1[2]*m2[9] + m1[4]*m2[10] + m1[6]*m2[11],
+ m1[1]*m2[8] + m1[3]*m2[9] + m1[5]*m2[10] + m1[7]*m2[11],
+ }
+}
+
+// Mul4 performs a "matrix product" between this matrix
+// and another of the given dimension. For any two matrices of dimensionality
+// MxN and NxO, the result will be MxO. For instance, Mat4 multiplied using
+// Mul4x2 will result in a Mat4x2.
+func (m1 Mat2x4) Mul4(m2 Mat4) Mat2x4 {
+ return Mat2x4{
+ m1[0]*m2[0] + m1[2]*m2[1] + m1[4]*m2[2] + m1[6]*m2[3],
+ m1[1]*m2[0] + m1[3]*m2[1] + m1[5]*m2[2] + m1[7]*m2[3],
+ m1[0]*m2[4] + m1[2]*m2[5] + m1[4]*m2[6] + m1[6]*m2[7],
+ m1[1]*m2[4] + m1[3]*m2[5] + m1[5]*m2[6] + m1[7]*m2[7],
+ m1[0]*m2[8] + m1[2]*m2[9] + m1[4]*m2[10] + m1[6]*m2[11],
+ m1[1]*m2[8] + m1[3]*m2[9] + m1[5]*m2[10] + m1[7]*m2[11],
+ m1[0]*m2[12] + m1[2]*m2[13] + m1[4]*m2[14] + m1[6]*m2[15],
+ m1[1]*m2[12] + m1[3]*m2[13] + m1[5]*m2[14] + m1[7]*m2[15],
+ }
+}
+
+// Transpose produces the transpose of this matrix. For any MxN matrix
+// the transpose is an NxM matrix with the rows swapped with the columns. For instance
+// the transpose of the Mat3x2 is a Mat2x3 like so:
+//
+// [[a b]] [[a c e]]
+// [[c d]] = [[b d f]]
+// [[e f]]
+func (m1 Mat2x4) Transpose() Mat4x2 {
+ return Mat4x2{m1[0], m1[2], m1[4], m1[6], m1[1], m1[3], m1[5], m1[7]}
+}
+
+// ApproxEqual performs an element-wise approximate equality test between two matrices,
+// as if FloatEqual had been used.
+func (m1 Mat2x4) ApproxEqual(m2 Mat2x4) bool {
+ for i := range m1 {
+ if !FloatEqual(m1[i], m2[i]) {
+ return false
+ }
+ }
+ return true
+}
+
+// ApproxEqualThreshold performs an element-wise approximate equality test between two matrices
+// with a given epsilon threshold, as if FloatEqualThreshold had been used.
+func (m1 Mat2x4) ApproxEqualThreshold(m2 Mat2x4, threshold float32) bool {
+ for i := range m1 {
+ if !FloatEqualThreshold(m1[i], m2[i], threshold) {
+ return false
+ }
+ }
+ return true
+}
+
+// ApproxFuncEqual performs an element-wise approximate equality test between two matrices
+// with a given equality functions, intended to be used with FloatEqualFunc; although and comparison
+// function may be used in practice.
+func (m1 Mat2x4) ApproxFuncEqual(m2 Mat2x4, eq func(float32, float32) bool) bool {
+ for i := range m1 {
+ if !eq(m1[i], m2[i]) {
+ return false
+ }
+ }
+ return true
+}
+
+// NumRows returns the number of rows in this matrix
+func (m Mat2x4) NumRows() int {
+ return 2
+}
+
+// NumCols returns the number of columns in this matrix
+func (m Mat2x4) NumCols() int {
+ return 4
+}
+
+// At returns the matrix element at the given row and column.
+// This is equivalent to mat[col * numRow + row] where numRow is constant
+// (E.G. for a Mat3x2 it's equal to 3)
+//
+// This method is garbage-in garbage-out. For instance, on a Mat4 asking for
+// At(5,0) will work just like At(1,1). Or it may panic if it's out of bounds.
+func (m Mat2x4) At(row, col int) float32 {
+ return m[col*2+row]
+}
+
+// Set sets the corresponding matrix element at the given row and column.
+// This has a pointer receiver because it mutates the matrix.
+//
+// This method is garbage-in garbage-out. For instance, on a Mat4 asking for
+// Set(5,0,val) will work just like Set(1,1,val). Or it may panic if it's out of bounds.
+func (m *Mat2x4) Set(row, col int, value float32) {
+ m[col*2+row] = value
+}
+
+// Index returns the index of the given row and column, to be used with direct
+// access. E.G. Index(0,0) = 0.
+//
+// This is a garbage-in garbage-out method. For instance, on a Mat4 asking for the index of
+// (5,0) will work the same as asking for (1,1). Or it may give you a value that will cause
+// a panic if you try to access the array with it if it's truly out of bounds.
+func (m Mat2x4) Index(row, col int) int {
+ return col*2 + row
+}
+
+// Row returns a vector representing the corresponding row (starting at row 0).
+// This package makes no distinction between row and column vectors, so it
+// will be a normal VecM for a MxN matrix.
+func (m Mat2x4) Row(row int) Vec4 {
+ return Vec4{m[row+0], m[row+2], m[row+4], m[row+6]}
+}
+
+// Rows decomposes a matrix into its corresponding row vectors.
+// This is equivalent to calling mat.Row for each row.
+func (m Mat2x4) Rows() (row0, row1 Vec4) {
+ return m.Row(0), m.Row(1)
+}
+
+// Col returns a vector representing the corresponding column (starting at col 0).
+// This package makes no distinction between row and column vectors, so it
+// will be a normal VecN for a MxN matrix.
+func (m Mat2x4) Col(col int) Vec2 {
+ return Vec2{m[col*2+0], m[col*2+1]}
+}
+
+// Cols decomposes a matrix into its corresponding column vectors.
+// This is equivalent to calling mat.Col for each column.
+func (m Mat2x4) Cols() (col0, col1, col2, col3 Vec2) {
+ return m.Col(0), m.Col(1), m.Col(2), m.Col(3)
+}
+
+// Abs returns the element-wise absolute value of this matrix
+func (m Mat2x4) Abs() Mat2x4 {
+ return Mat2x4{Abs(m[0]), Abs(m[1]), Abs(m[2]), Abs(m[3]), Abs(m[4]), Abs(m[5]), Abs(m[6]), Abs(m[7])}
+}
+
+// Pretty prints the matrix
+func (m Mat2x4) String() string {
+ buf := new(bytes.Buffer)
+ w := tabwriter.NewWriter(buf, 4, 4, 1, ' ', tabwriter.AlignRight)
+ for i := 0; i < 2; i++ {
+ for _, col := range m.Row(i) {
+ fmt.Fprintf(w, "%f\t", col)
+ }
+
+ fmt.Fprintln(w, "")
+ }
+ w.Flush()
+
+ return buf.String()
+}
+
+// SetCol sets a Column within the Matrix, so it mutates the calling matrix.
+func (m *Mat3x2) SetCol(col int, v Vec3) {
+ m[col*3+0], m[col*3+1], m[col*3+2] = v[0], v[1], v[2]
+}
+
+// SetRow sets a Row within the Matrix, so it mutates the calling matrix.
+func (m *Mat3x2) SetRow(row int, v Vec2) {
+ m[row+0], m[row+3] = v[0], v[1]
+}
+
+// Mat3x2FromRows builds a new matrix from row vectors.
+// The resulting matrix will still be in column major order, but this can be
+// good for hand-building matrices.
+
+func Mat3x2FromRows(row0, row1, row2 Vec2) Mat3x2 {
+ return Mat3x2{row0[0], row1[0], row2[0], row0[1], row1[1], row2[1]}
+}
+
+// Mat3x2FromCols builds a new matrix from column vectors.
+func Mat3x2FromCols(col0, col1 Vec3) Mat3x2 {
+ return Mat3x2{col0[0], col0[1], col0[2], col1[0], col1[1], col1[2]}
+}
+
+// Add performs an element-wise addition of two matrices, this is
+// equivalent to iterating over every element of m1 and adding the corresponding value of m2.
+func (m1 Mat3x2) Add(m2 Mat3x2) Mat3x2 {
+ return Mat3x2{m1[0] + m2[0], m1[1] + m2[1], m1[2] + m2[2], m1[3] + m2[3], m1[4] + m2[4], m1[5] + m2[5]}
+}
+
+// Sub performs an element-wise subtraction of two matrices, this is
+// equivalent to iterating over every element of m1 and subtracting the corresponding value of m2.
+func (m1 Mat3x2) Sub(m2 Mat3x2) Mat3x2 {
+ return Mat3x2{m1[0] - m2[0], m1[1] - m2[1], m1[2] - m2[2], m1[3] - m2[3], m1[4] - m2[4], m1[5] - m2[5]}
+}
+
+// Mul performs a scalar multiplcation of the matrix. This is equivalent to iterating
+// over every element of the matrix and multiply it by c.
+func (m1 Mat3x2) Mul(c float32) Mat3x2 {
+ return Mat3x2{m1[0] * c, m1[1] * c, m1[2] * c, m1[3] * c, m1[4] * c, m1[5] * c}
+}
+
+// Mul2x1 performs a "matrix product" between this matrix
+// and another of the given dimension. For any two matrices of dimensionality
+// MxN and NxO, the result will be MxO. For instance, Mat4 multiplied using
+// Mul4x2 will result in a Mat4x2.
+func (m1 Mat3x2) Mul2x1(m2 Vec2) Vec3 {
+ return Vec3{
+ m1[0]*m2[0] + m1[3]*m2[1],
+ m1[1]*m2[0] + m1[4]*m2[1],
+ m1[2]*m2[0] + m1[5]*m2[1],
+ }
+}
+
+// Mul2 performs a "matrix product" between this matrix
+// and another of the given dimension. For any two matrices of dimensionality
+// MxN and NxO, the result will be MxO. For instance, Mat4 multiplied using
+// Mul4x2 will result in a Mat4x2.
+func (m1 Mat3x2) Mul2(m2 Mat2) Mat3x2 {
+ return Mat3x2{
+ m1[0]*m2[0] + m1[3]*m2[1],
+ m1[1]*m2[0] + m1[4]*m2[1],
+ m1[2]*m2[0] + m1[5]*m2[1],
+ m1[0]*m2[2] + m1[3]*m2[3],
+ m1[1]*m2[2] + m1[4]*m2[3],
+ m1[2]*m2[2] + m1[5]*m2[3],
+ }
+}
+
+// Mul2x3 performs a "matrix product" between this matrix
+// and another of the given dimension. For any two matrices of dimensionality
+// MxN and NxO, the result will be MxO. For instance, Mat4 multiplied using
+// Mul4x2 will result in a Mat4x2.
+func (m1 Mat3x2) Mul2x3(m2 Mat2x3) Mat3 {
+ return Mat3{
+ m1[0]*m2[0] + m1[3]*m2[1],
+ m1[1]*m2[0] + m1[4]*m2[1],
+ m1[2]*m2[0] + m1[5]*m2[1],
+ m1[0]*m2[2] + m1[3]*m2[3],
+ m1[1]*m2[2] + m1[4]*m2[3],
+ m1[2]*m2[2] + m1[5]*m2[3],
+ m1[0]*m2[4] + m1[3]*m2[5],
+ m1[1]*m2[4] + m1[4]*m2[5],
+ m1[2]*m2[4] + m1[5]*m2[5],
+ }
+}
+
+// Mul2x4 performs a "matrix product" between this matrix
+// and another of the given dimension. For any two matrices of dimensionality
+// MxN and NxO, the result will be MxO. For instance, Mat4 multiplied using
+// Mul4x2 will result in a Mat4x2.
+func (m1 Mat3x2) Mul2x4(m2 Mat2x4) Mat3x4 {
+ return Mat3x4{
+ m1[0]*m2[0] + m1[3]*m2[1],
+ m1[1]*m2[0] + m1[4]*m2[1],
+ m1[2]*m2[0] + m1[5]*m2[1],
+ m1[0]*m2[2] + m1[3]*m2[3],
+ m1[1]*m2[2] + m1[4]*m2[3],
+ m1[2]*m2[2] + m1[5]*m2[3],
+ m1[0]*m2[4] + m1[3]*m2[5],
+ m1[1]*m2[4] + m1[4]*m2[5],
+ m1[2]*m2[4] + m1[5]*m2[5],
+ m1[0]*m2[6] + m1[3]*m2[7],
+ m1[1]*m2[6] + m1[4]*m2[7],
+ m1[2]*m2[6] + m1[5]*m2[7],
+ }
+}
+
+// Transpose produces the transpose of this matrix. For any MxN matrix
+// the transpose is an NxM matrix with the rows swapped with the columns. For instance
+// the transpose of the Mat3x2 is a Mat2x3 like so:
+//
+// [[a b]] [[a c e]]
+// [[c d]] = [[b d f]]
+// [[e f]]
+func (m1 Mat3x2) Transpose() Mat2x3 {
+ return Mat2x3{m1[0], m1[3], m1[1], m1[4], m1[2], m1[5]}
+}
+
+// ApproxEqual performs an element-wise approximate equality test between two matrices,
+// as if FloatEqual had been used.
+func (m1 Mat3x2) ApproxEqual(m2 Mat3x2) bool {
+ for i := range m1 {
+ if !FloatEqual(m1[i], m2[i]) {
+ return false
+ }
+ }
+ return true
+}
+
+// ApproxEqualThreshold performs an element-wise approximate equality test between two matrices
+// with a given epsilon threshold, as if FloatEqualThreshold had been used.
+func (m1 Mat3x2) ApproxEqualThreshold(m2 Mat3x2, threshold float32) bool {
+ for i := range m1 {
+ if !FloatEqualThreshold(m1[i], m2[i], threshold) {
+ return false
+ }
+ }
+ return true
+}
+
+// ApproxFuncEqual performs an element-wise approximate equality test between two matrices
+// with a given equality functions, intended to be used with FloatEqualFunc; although and comparison
+// function may be used in practice.
+func (m1 Mat3x2) ApproxFuncEqual(m2 Mat3x2, eq func(float32, float32) bool) bool {
+ for i := range m1 {
+ if !eq(m1[i], m2[i]) {
+ return false
+ }
+ }
+ return true
+}
+
+// NumRows returns the number of rows in this matrix
+func (m Mat3x2) NumRows() int {
+ return 3
+}
+
+// NumCols returns the number of columns in this matrix
+func (m Mat3x2) NumCols() int {
+ return 2
+}
+
+// At returns the matrix element at the given row and column.
+// This is equivalent to mat[col * numRow + row] where numRow is constant
+// (E.G. for a Mat3x2 it's equal to 3)
+//
+// This method is garbage-in garbage-out. For instance, on a Mat4 asking for
+// At(5,0) will work just like At(1,1). Or it may panic if it's out of bounds.
+func (m Mat3x2) At(row, col int) float32 {
+ return m[col*3+row]
+}
+
+// Set sets the corresponding matrix element at the given row and column.
+// This has a pointer receiver because it mutates the matrix.
+//
+// This method is garbage-in garbage-out. For instance, on a Mat4 asking for
+// Set(5,0,val) will work just like Set(1,1,val). Or it may panic if it's out of bounds.
+func (m *Mat3x2) Set(row, col int, value float32) {
+ m[col*3+row] = value
+}
+
+// Index returns the index of the given row and column, to be used with direct
+// access. E.G. Index(0,0) = 0.
+//
+// This is a garbage-in garbage-out method. For instance, on a Mat4 asking for the index of
+// (5,0) will work the same as asking for (1,1). Or it may give you a value that will cause
+// a panic if you try to access the array with it if it's truly out of bounds.
+func (m Mat3x2) Index(row, col int) int {
+ return col*3 + row
+}
+
+// Row returns a vector representing the corresponding row (starting at row 0).
+// This package makes no distinction between row and column vectors, so it
+// will be a normal VecM for a MxN matrix.
+func (m Mat3x2) Row(row int) Vec2 {
+ return Vec2{m[row+0], m[row+3]}
+}
+
+// Rows decomposes a matrix into its corresponding row vectors.
+// This is equivalent to calling mat.Row for each row.
+func (m Mat3x2) Rows() (row0, row1, row2 Vec2) {
+ return m.Row(0), m.Row(1), m.Row(2)
+}
+
+// Col returns a vector representing the corresponding column (starting at col 0).
+// This package makes no distinction between row and column vectors, so it
+// will be a normal VecN for a MxN matrix.
+func (m Mat3x2) Col(col int) Vec3 {
+ return Vec3{m[col*3+0], m[col*3+1], m[col*3+2]}
+}
+
+// Cols decomposes a matrix into its corresponding column vectors.
+// This is equivalent to calling mat.Col for each column.
+func (m Mat3x2) Cols() (col0, col1 Vec3) {
+ return m.Col(0), m.Col(1)
+}
+
+// Abs returns the element-wise absolute value of this matrix
+func (m Mat3x2) Abs() Mat3x2 {
+ return Mat3x2{Abs(m[0]), Abs(m[1]), Abs(m[2]), Abs(m[3]), Abs(m[4]), Abs(m[5])}
+}
+
+// Pretty prints the matrix
+func (m Mat3x2) String() string {
+ buf := new(bytes.Buffer)
+ w := tabwriter.NewWriter(buf, 4, 4, 1, ' ', tabwriter.AlignRight)
+ for i := 0; i < 3; i++ {
+ for _, col := range m.Row(i) {
+ fmt.Fprintf(w, "%f\t", col)
+ }
+
+ fmt.Fprintln(w, "")
+ }
+ w.Flush()
+
+ return buf.String()
+}
+
+// SetCol sets a Column within the Matrix, so it mutates the calling matrix.
+func (m *Mat3) SetCol(col int, v Vec3) {
+ m[col*3+0], m[col*3+1], m[col*3+2] = v[0], v[1], v[2]
+}
+
+// SetRow sets a Row within the Matrix, so it mutates the calling matrix.
+func (m *Mat3) SetRow(row int, v Vec3) {
+ m[row+0], m[row+3], m[row+6] = v[0], v[1], v[2]
+}
+
+// Diag is a basic operation on a square matrix that simply
+// returns main diagonal (meaning all elements such that row==col).
+func (m Mat3) Diag() Vec3 {
+ return Vec3{m[0], m[4], m[8]}
+}
+
+// Ident3 returns the 3x3 identity matrix.
+// The identity matrix is a square matrix with the value 1 on its
+// diagonals. The characteristic property of the identity matrix is that
+// any matrix multiplied by it is itself. (MI = M; IN = N)
+func Ident3() Mat3 {
+ return Mat3{1, 0, 0, 0, 1, 0, 0, 0, 1}
+}
+
+// Diag3 creates a diagonal matrix from the entries of the input vector.
+// That is, for each pointer for row==col, vector[row] is the entry. Otherwise it's 0.
+//
+// Another way to think about it is that the identity is this function where the every vector element is 1.
+func Diag3(v Vec3) Mat3 {
+ var m Mat3
+ m[0], m[4], m[8] = v[0], v[1], v[2]
+ return m
+}
+
+// Mat3FromRows builds a new matrix from row vectors.
+// The resulting matrix will still be in column major order, but this can be
+// good for hand-building matrices.
+
+func Mat3FromRows(row0, row1, row2 Vec3) Mat3 {
+ return Mat3{row0[0], row1[0], row2[0], row0[1], row1[1], row2[1], row0[2], row1[2], row2[2]}
+}
+
+// Mat3FromCols builds a new matrix from column vectors.
+func Mat3FromCols(col0, col1, col2 Vec3) Mat3 {
+ return Mat3{col0[0], col0[1], col0[2], col1[0], col1[1], col1[2], col2[0], col2[1], col2[2]}
+}
+
+// Add performs an element-wise addition of two matrices, this is
+// equivalent to iterating over every element of m1 and adding the corresponding value of m2.
+func (m1 Mat3) Add(m2 Mat3) Mat3 {
+ return Mat3{m1[0] + m2[0], m1[1] + m2[1], m1[2] + m2[2], m1[3] + m2[3], m1[4] + m2[4], m1[5] + m2[5], m1[6] + m2[6], m1[7] + m2[7], m1[8] + m2[8]}
+}
+
+// Sub performs an element-wise subtraction of two matrices, this is
+// equivalent to iterating over every element of m1 and subtracting the corresponding value of m2.
+func (m1 Mat3) Sub(m2 Mat3) Mat3 {
+ return Mat3{m1[0] - m2[0], m1[1] - m2[1], m1[2] - m2[2], m1[3] - m2[3], m1[4] - m2[4], m1[5] - m2[5], m1[6] - m2[6], m1[7] - m2[7], m1[8] - m2[8]}
+}
+
+// Mul performs a scalar multiplcation of the matrix. This is equivalent to iterating
+// over every element of the matrix and multiply it by c.
+func (m1 Mat3) Mul(c float32) Mat3 {
+ return Mat3{m1[0] * c, m1[1] * c, m1[2] * c, m1[3] * c, m1[4] * c, m1[5] * c, m1[6] * c, m1[7] * c, m1[8] * c}
+}
+
+// Mul3x1 performs a "matrix product" between this matrix
+// and another of the given dimension. For any two matrices of dimensionality
+// MxN and NxO, the result will be MxO. For instance, Mat4 multiplied using
+// Mul4x2 will result in a Mat4x2.
+func (m1 Mat3) Mul3x1(m2 Vec3) Vec3 {
+ return Vec3{
+ m1[0]*m2[0] + m1[3]*m2[1] + m1[6]*m2[2],
+ m1[1]*m2[0] + m1[4]*m2[1] + m1[7]*m2[2],
+ m1[2]*m2[0] + m1[5]*m2[1] + m1[8]*m2[2],
+ }
+}
+
+// Mul3x2 performs a "matrix product" between this matrix
+// and another of the given dimension. For any two matrices of dimensionality
+// MxN and NxO, the result will be MxO. For instance, Mat4 multiplied using
+// Mul4x2 will result in a Mat4x2.
+func (m1 Mat3) Mul3x2(m2 Mat3x2) Mat3x2 {
+ return Mat3x2{
+ m1[0]*m2[0] + m1[3]*m2[1] + m1[6]*m2[2],
+ m1[1]*m2[0] + m1[4]*m2[1] + m1[7]*m2[2],
+ m1[2]*m2[0] + m1[5]*m2[1] + m1[8]*m2[2],
+ m1[0]*m2[3] + m1[3]*m2[4] + m1[6]*m2[5],
+ m1[1]*m2[3] + m1[4]*m2[4] + m1[7]*m2[5],
+ m1[2]*m2[3] + m1[5]*m2[4] + m1[8]*m2[5],
+ }
+}
+
+// Mul3 performs a "matrix product" between this matrix
+// and another of the given dimension. For any two matrices of dimensionality
+// MxN and NxO, the result will be MxO. For instance, Mat4 multiplied using
+// Mul4x2 will result in a Mat4x2.
+func (m1 Mat3) Mul3(m2 Mat3) Mat3 {
+ return Mat3{
+ m1[0]*m2[0] + m1[3]*m2[1] + m1[6]*m2[2],
+ m1[1]*m2[0] + m1[4]*m2[1] + m1[7]*m2[2],
+ m1[2]*m2[0] + m1[5]*m2[1] + m1[8]*m2[2],
+ m1[0]*m2[3] + m1[3]*m2[4] + m1[6]*m2[5],
+ m1[1]*m2[3] + m1[4]*m2[4] + m1[7]*m2[5],
+ m1[2]*m2[3] + m1[5]*m2[4] + m1[8]*m2[5],
+ m1[0]*m2[6] + m1[3]*m2[7] + m1[6]*m2[8],
+ m1[1]*m2[6] + m1[4]*m2[7] + m1[7]*m2[8],
+ m1[2]*m2[6] + m1[5]*m2[7] + m1[8]*m2[8],
+ }
+}
+
+// Mul3x4 performs a "matrix product" between this matrix
+// and another of the given dimension. For any two matrices of dimensionality
+// MxN and NxO, the result will be MxO. For instance, Mat4 multiplied using
+// Mul4x2 will result in a Mat4x2.
+func (m1 Mat3) Mul3x4(m2 Mat3x4) Mat3x4 {
+ return Mat3x4{
+ m1[0]*m2[0] + m1[3]*m2[1] + m1[6]*m2[2],
+ m1[1]*m2[0] + m1[4]*m2[1] + m1[7]*m2[2],
+ m1[2]*m2[0] + m1[5]*m2[1] + m1[8]*m2[2],
+ m1[0]*m2[3] + m1[3]*m2[4] + m1[6]*m2[5],
+ m1[1]*m2[3] + m1[4]*m2[4] + m1[7]*m2[5],
+ m1[2]*m2[3] + m1[5]*m2[4] + m1[8]*m2[5],
+ m1[0]*m2[6] + m1[3]*m2[7] + m1[6]*m2[8],
+ m1[1]*m2[6] + m1[4]*m2[7] + m1[7]*m2[8],
+ m1[2]*m2[6] + m1[5]*m2[7] + m1[8]*m2[8],
+ m1[0]*m2[9] + m1[3]*m2[10] + m1[6]*m2[11],
+ m1[1]*m2[9] + m1[4]*m2[10] + m1[7]*m2[11],
+ m1[2]*m2[9] + m1[5]*m2[10] + m1[8]*m2[11],
+ }
+}
+
+// Transpose produces the transpose of this matrix. For any MxN matrix
+// the transpose is an NxM matrix with the rows swapped with the columns. For instance
+// the transpose of the Mat3x2 is a Mat2x3 like so:
+//
+// [[a b]] [[a c e]]
+// [[c d]] = [[b d f]]
+// [[e f]]
+func (m1 Mat3) Transpose() Mat3 {
+ return Mat3{m1[0], m1[3], m1[6], m1[1], m1[4], m1[7], m1[2], m1[5], m1[8]}
+}
+
+// Det returns the determinant of a matrix. It is a measure of a square matrix's
+// singularity and invertability, among other things. In this library, the
+// determinant is hard coded based on pre-computed cofactor expansion, and uses
+// no loops. Of course, the addition and multiplication must still be done.
+func (m Mat3) Det() float32 {
+ return m[0]*m[4]*m[8] + m[3]*m[7]*m[2] + m[6]*m[1]*m[5] - m[6]*m[4]*m[2] - m[3]*m[1]*m[8] - m[0]*m[7]*m[5]
+}
+
+// Inv computes the inverse of a square matrix. An inverse is a square matrix such that when multiplied by the
+// original, yields the identity.
+//
+// M_inv * M = M * M_inv = I
+//
+// In this library, the math is precomputed, and uses no loops, though the multiplications, additions, determinant calculation, and scaling
+// are still done. This can still be (relatively) expensive for a 4x4.
+//
+// This function checks the determinant to see if the matrix is invertible.
+// If the determinant is 0.0, this function returns the zero matrix. However, due to floating point errors, it is
+// entirely plausible to get a false positive or negative.
+// In the future, an alternate function may be written which takes in a pre-computed determinant.
+func (m Mat3) Inv() Mat3 {
+ det := m.Det()
+ if FloatEqual(det, float32(0.0)) {
+ return Mat3{}
+ }
+
+ retMat := Mat3{
+ m[4]*m[8] - m[5]*m[7],
+ m[2]*m[7] - m[1]*m[8],
+ m[1]*m[5] - m[2]*m[4],
+ m[5]*m[6] - m[3]*m[8],
+ m[0]*m[8] - m[2]*m[6],
+ m[2]*m[3] - m[0]*m[5],
+ m[3]*m[7] - m[4]*m[6],
+ m[1]*m[6] - m[0]*m[7],
+ m[0]*m[4] - m[1]*m[3],
+ }
+
+ return retMat.Mul(1 / det)
+}
+
+// ApproxEqual performs an element-wise approximate equality test between two matrices,
+// as if FloatEqual had been used.
+func (m1 Mat3) ApproxEqual(m2 Mat3) bool {
+ for i := range m1 {
+ if !FloatEqual(m1[i], m2[i]) {
+ return false
+ }
+ }
+ return true
+}
+
+// ApproxEqualThreshold performs an element-wise approximate equality test between two matrices
+// with a given epsilon threshold, as if FloatEqualThreshold had been used.
+func (m1 Mat3) ApproxEqualThreshold(m2 Mat3, threshold float32) bool {
+ for i := range m1 {
+ if !FloatEqualThreshold(m1[i], m2[i], threshold) {
+ return false
+ }
+ }
+ return true
+}
+
+// ApproxFuncEqual performs an element-wise approximate equality test between two matrices
+// with a given equality functions, intended to be used with FloatEqualFunc; although and comparison
+// function may be used in practice.
+func (m1 Mat3) ApproxFuncEqual(m2 Mat3, eq func(float32, float32) bool) bool {
+ for i := range m1 {
+ if !eq(m1[i], m2[i]) {
+ return false
+ }
+ }
+ return true
+}
+
+// NumRows returns the number of rows in this matrix
+func (m Mat3) NumRows() int {
+ return 3
+}
+
+// NumCols returns the number of columns in this matrix
+func (m Mat3) NumCols() int {
+ return 3
+}
+
+// At returns the matrix element at the given row and column.
+// This is equivalent to mat[col * numRow + row] where numRow is constant
+// (E.G. for a Mat3x2 it's equal to 3)
+//
+// This method is garbage-in garbage-out. For instance, on a Mat4 asking for
+// At(5,0) will work just like At(1,1). Or it may panic if it's out of bounds.
+func (m Mat3) At(row, col int) float32 {
+ return m[col*3+row]
+}
+
+// Set sets the corresponding matrix element at the given row and column.
+// This has a pointer receiver because it mutates the matrix.
+//
+// This method is garbage-in garbage-out. For instance, on a Mat4 asking for
+// Set(5,0,val) will work just like Set(1,1,val). Or it may panic if it's out of bounds.
+func (m *Mat3) Set(row, col int, value float32) {
+ m[col*3+row] = value
+}
+
+// Index returns the index of the given row and column, to be used with direct
+// access. E.G. Index(0,0) = 0.
+//
+// This is a garbage-in garbage-out method. For instance, on a Mat4 asking for the index of
+// (5,0) will work the same as asking for (1,1). Or it may give you a value that will cause
+// a panic if you try to access the array with it if it's truly out of bounds.
+func (m Mat3) Index(row, col int) int {
+ return col*3 + row
+}
+
+// Row returns a vector representing the corresponding row (starting at row 0).
+// This package makes no distinction between row and column vectors, so it
+// will be a normal VecM for a MxN matrix.
+func (m Mat3) Row(row int) Vec3 {
+ return Vec3{m[row+0], m[row+3], m[row+6]}
+}
+
+// Rows decomposes a matrix into its corresponding row vectors.
+// This is equivalent to calling mat.Row for each row.
+func (m Mat3) Rows() (row0, row1, row2 Vec3) {
+ return m.Row(0), m.Row(1), m.Row(2)
+}
+
+// Col returns a vector representing the corresponding column (starting at col 0).
+// This package makes no distinction between row and column vectors, so it
+// will be a normal VecN for a MxN matrix.
+func (m Mat3) Col(col int) Vec3 {
+ return Vec3{m[col*3+0], m[col*3+1], m[col*3+2]}
+}
+
+// Cols decomposes a matrix into its corresponding column vectors.
+// This is equivalent to calling mat.Col for each column.
+func (m Mat3) Cols() (col0, col1, col2 Vec3) {
+ return m.Col(0), m.Col(1), m.Col(2)
+}
+
+// Trace is a basic operation on a square matrix that simply
+// sums up all elements on the main diagonal (meaning all elements such that row==col).
+func (m Mat3) Trace() float32 {
+ return m[0] + m[4] + m[8]
+}
+
+// Abs returns the element-wise absolute value of this matrix
+func (m Mat3) Abs() Mat3 {
+ return Mat3{Abs(m[0]), Abs(m[1]), Abs(m[2]), Abs(m[3]), Abs(m[4]), Abs(m[5]), Abs(m[6]), Abs(m[7]), Abs(m[8])}
+}
+
+// Pretty prints the matrix
+func (m Mat3) String() string {
+ buf := new(bytes.Buffer)
+ w := tabwriter.NewWriter(buf, 4, 4, 1, ' ', tabwriter.AlignRight)
+ for i := 0; i < 3; i++ {
+ for _, col := range m.Row(i) {
+ fmt.Fprintf(w, "%f\t", col)
+ }
+
+ fmt.Fprintln(w, "")
+ }
+ w.Flush()
+
+ return buf.String()
+}
+
+// SetCol sets a Column within the Matrix, so it mutates the calling matrix.
+func (m *Mat3x4) SetCol(col int, v Vec3) {
+ m[col*3+0], m[col*3+1], m[col*3+2] = v[0], v[1], v[2]
+}
+
+// SetRow sets a Row within the Matrix, so it mutates the calling matrix.
+func (m *Mat3x4) SetRow(row int, v Vec4) {
+ m[row+0], m[row+3], m[row+6], m[row+9] = v[0], v[1], v[2], v[3]
+}
+
+// Mat3x4FromRows builds a new matrix from row vectors.
+// The resulting matrix will still be in column major order, but this can be
+// good for hand-building matrices.
+
+func Mat3x4FromRows(row0, row1, row2 Vec4) Mat3x4 {
+ return Mat3x4{row0[0], row1[0], row2[0], row0[1], row1[1], row2[1], row0[2], row1[2], row2[2], row0[3], row1[3], row2[3]}
+}
+
+// Mat3x4FromCols builds a new matrix from column vectors.
+func Mat3x4FromCols(col0, col1, col2, col3 Vec3) Mat3x4 {
+ return Mat3x4{col0[0], col0[1], col0[2], col1[0], col1[1], col1[2], col2[0], col2[1], col2[2], col3[0], col3[1], col3[2]}
+}
+
+// Add performs an element-wise addition of two matrices, this is
+// equivalent to iterating over every element of m1 and adding the corresponding value of m2.
+func (m1 Mat3x4) Add(m2 Mat3x4) Mat3x4 {
+ return Mat3x4{m1[0] + m2[0], m1[1] + m2[1], m1[2] + m2[2], m1[3] + m2[3], m1[4] + m2[4], m1[5] + m2[5], m1[6] + m2[6], m1[7] + m2[7], m1[8] + m2[8], m1[9] + m2[9], m1[10] + m2[10], m1[11] + m2[11]}
+}
+
+// Sub performs an element-wise subtraction of two matrices, this is
+// equivalent to iterating over every element of m1 and subtracting the corresponding value of m2.
+func (m1 Mat3x4) Sub(m2 Mat3x4) Mat3x4 {
+ return Mat3x4{m1[0] - m2[0], m1[1] - m2[1], m1[2] - m2[2], m1[3] - m2[3], m1[4] - m2[4], m1[5] - m2[5], m1[6] - m2[6], m1[7] - m2[7], m1[8] - m2[8], m1[9] - m2[9], m1[10] - m2[10], m1[11] - m2[11]}
+}
+
+// Mul performs a scalar multiplcation of the matrix. This is equivalent to iterating
+// over every element of the matrix and multiply it by c.
+func (m1 Mat3x4) Mul(c float32) Mat3x4 {
+ return Mat3x4{m1[0] * c, m1[1] * c, m1[2] * c, m1[3] * c, m1[4] * c, m1[5] * c, m1[6] * c, m1[7] * c, m1[8] * c, m1[9] * c, m1[10] * c, m1[11] * c}
+}
+
+// Mul4x1 performs a "matrix product" between this matrix
+// and another of the given dimension. For any two matrices of dimensionality
+// MxN and NxO, the result will be MxO. For instance, Mat4 multiplied using
+// Mul4x2 will result in a Mat4x2.
+func (m1 Mat3x4) Mul4x1(m2 Vec4) Vec3 {
+ return Vec3{
+ m1[0]*m2[0] + m1[3]*m2[1] + m1[6]*m2[2] + m1[9]*m2[3],
+ m1[1]*m2[0] + m1[4]*m2[1] + m1[7]*m2[2] + m1[10]*m2[3],
+ m1[2]*m2[0] + m1[5]*m2[1] + m1[8]*m2[2] + m1[11]*m2[3],
+ }
+}
+
+// Mul4x2 performs a "matrix product" between this matrix
+// and another of the given dimension. For any two matrices of dimensionality
+// MxN and NxO, the result will be MxO. For instance, Mat4 multiplied using
+// Mul4x2 will result in a Mat4x2.
+func (m1 Mat3x4) Mul4x2(m2 Mat4x2) Mat3x2 {
+ return Mat3x2{
+ m1[0]*m2[0] + m1[3]*m2[1] + m1[6]*m2[2] + m1[9]*m2[3],
+ m1[1]*m2[0] + m1[4]*m2[1] + m1[7]*m2[2] + m1[10]*m2[3],
+ m1[2]*m2[0] + m1[5]*m2[1] + m1[8]*m2[2] + m1[11]*m2[3],
+ m1[0]*m2[4] + m1[3]*m2[5] + m1[6]*m2[6] + m1[9]*m2[7],
+ m1[1]*m2[4] + m1[4]*m2[5] + m1[7]*m2[6] + m1[10]*m2[7],
+ m1[2]*m2[4] + m1[5]*m2[5] + m1[8]*m2[6] + m1[11]*m2[7],
+ }
+}
+
+// Mul4x3 performs a "matrix product" between this matrix
+// and another of the given dimension. For any two matrices of dimensionality
+// MxN and NxO, the result will be MxO. For instance, Mat4 multiplied using
+// Mul4x2 will result in a Mat4x2.
+func (m1 Mat3x4) Mul4x3(m2 Mat4x3) Mat3 {
+ return Mat3{
+ m1[0]*m2[0] + m1[3]*m2[1] + m1[6]*m2[2] + m1[9]*m2[3],
+ m1[1]*m2[0] + m1[4]*m2[1] + m1[7]*m2[2] + m1[10]*m2[3],
+ m1[2]*m2[0] + m1[5]*m2[1] + m1[8]*m2[2] + m1[11]*m2[3],
+ m1[0]*m2[4] + m1[3]*m2[5] + m1[6]*m2[6] + m1[9]*m2[7],
+ m1[1]*m2[4] + m1[4]*m2[5] + m1[7]*m2[6] + m1[10]*m2[7],
+ m1[2]*m2[4] + m1[5]*m2[5] + m1[8]*m2[6] + m1[11]*m2[7],
+ m1[0]*m2[8] + m1[3]*m2[9] + m1[6]*m2[10] + m1[9]*m2[11],
+ m1[1]*m2[8] + m1[4]*m2[9] + m1[7]*m2[10] + m1[10]*m2[11],
+ m1[2]*m2[8] + m1[5]*m2[9] + m1[8]*m2[10] + m1[11]*m2[11],
+ }
+}
+
+// Mul4 performs a "matrix product" between this matrix
+// and another of the given dimension. For any two matrices of dimensionality
+// MxN and NxO, the result will be MxO. For instance, Mat4 multiplied using
+// Mul4x2 will result in a Mat4x2.
+func (m1 Mat3x4) Mul4(m2 Mat4) Mat3x4 {
+ return Mat3x4{
+ m1[0]*m2[0] + m1[3]*m2[1] + m1[6]*m2[2] + m1[9]*m2[3],
+ m1[1]*m2[0] + m1[4]*m2[1] + m1[7]*m2[2] + m1[10]*m2[3],
+ m1[2]*m2[0] + m1[5]*m2[1] + m1[8]*m2[2] + m1[11]*m2[3],
+ m1[0]*m2[4] + m1[3]*m2[5] + m1[6]*m2[6] + m1[9]*m2[7],
+ m1[1]*m2[4] + m1[4]*m2[5] + m1[7]*m2[6] + m1[10]*m2[7],
+ m1[2]*m2[4] + m1[5]*m2[5] + m1[8]*m2[6] + m1[11]*m2[7],
+ m1[0]*m2[8] + m1[3]*m2[9] + m1[6]*m2[10] + m1[9]*m2[11],
+ m1[1]*m2[8] + m1[4]*m2[9] + m1[7]*m2[10] + m1[10]*m2[11],
+ m1[2]*m2[8] + m1[5]*m2[9] + m1[8]*m2[10] + m1[11]*m2[11],
+ m1[0]*m2[12] + m1[3]*m2[13] + m1[6]*m2[14] + m1[9]*m2[15],
+ m1[1]*m2[12] + m1[4]*m2[13] + m1[7]*m2[14] + m1[10]*m2[15],
+ m1[2]*m2[12] + m1[5]*m2[13] + m1[8]*m2[14] + m1[11]*m2[15],
+ }
+}
+
+// Transpose produces the transpose of this matrix. For any MxN matrix
+// the transpose is an NxM matrix with the rows swapped with the columns. For instance
+// the transpose of the Mat3x2 is a Mat2x3 like so:
+//
+// [[a b]] [[a c e]]
+// [[c d]] = [[b d f]]
+// [[e f]]
+func (m1 Mat3x4) Transpose() Mat4x3 {
+ return Mat4x3{m1[0], m1[3], m1[6], m1[9], m1[1], m1[4], m1[7], m1[10], m1[2], m1[5], m1[8], m1[11]}
+}
+
+// ApproxEqual performs an element-wise approximate equality test between two matrices,
+// as if FloatEqual had been used.
+func (m1 Mat3x4) ApproxEqual(m2 Mat3x4) bool {
+ for i := range m1 {
+ if !FloatEqual(m1[i], m2[i]) {
+ return false
+ }
+ }
+ return true
+}
+
+// ApproxEqualThreshold performs an element-wise approximate equality test between two matrices
+// with a given epsilon threshold, as if FloatEqualThreshold had been used.
+func (m1 Mat3x4) ApproxEqualThreshold(m2 Mat3x4, threshold float32) bool {
+ for i := range m1 {
+ if !FloatEqualThreshold(m1[i], m2[i], threshold) {
+ return false
+ }
+ }
+ return true
+}
+
+// ApproxFuncEqual performs an element-wise approximate equality test between two matrices
+// with a given equality functions, intended to be used with FloatEqualFunc; although and comparison
+// function may be used in practice.
+func (m1 Mat3x4) ApproxFuncEqual(m2 Mat3x4, eq func(float32, float32) bool) bool {
+ for i := range m1 {
+ if !eq(m1[i], m2[i]) {
+ return false
+ }
+ }
+ return true
+}
+
+// NumRows returns the number of rows in this matrix
+func (m Mat3x4) NumRows() int {
+ return 3
+}
+
+// NumCols returns the number of columns in this matrix
+func (m Mat3x4) NumCols() int {
+ return 4
+}
+
+// At returns the matrix element at the given row and column.
+// This is equivalent to mat[col * numRow + row] where numRow is constant
+// (E.G. for a Mat3x2 it's equal to 3)
+//
+// This method is garbage-in garbage-out. For instance, on a Mat4 asking for
+// At(5,0) will work just like At(1,1). Or it may panic if it's out of bounds.
+func (m Mat3x4) At(row, col int) float32 {
+ return m[col*3+row]
+}
+
+// Set sets the corresponding matrix element at the given row and column.
+// This has a pointer receiver because it mutates the matrix.
+//
+// This method is garbage-in garbage-out. For instance, on a Mat4 asking for
+// Set(5,0,val) will work just like Set(1,1,val). Or it may panic if it's out of bounds.
+func (m *Mat3x4) Set(row, col int, value float32) {
+ m[col*3+row] = value
+}
+
+// Index returns the index of the given row and column, to be used with direct
+// access. E.G. Index(0,0) = 0.
+//
+// This is a garbage-in garbage-out method. For instance, on a Mat4 asking for the index of
+// (5,0) will work the same as asking for (1,1). Or it may give you a value that will cause
+// a panic if you try to access the array with it if it's truly out of bounds.
+func (m Mat3x4) Index(row, col int) int {
+ return col*3 + row
+}
+
+// Row returns a vector representing the corresponding row (starting at row 0).
+// This package makes no distinction between row and column vectors, so it
+// will be a normal VecM for a MxN matrix.
+func (m Mat3x4) Row(row int) Vec4 {
+ return Vec4{m[row+0], m[row+3], m[row+6], m[row+9]}
+}
+
+// Rows decomposes a matrix into its corresponding row vectors.
+// This is equivalent to calling mat.Row for each row.
+func (m Mat3x4) Rows() (row0, row1, row2 Vec4) {
+ return m.Row(0), m.Row(1), m.Row(2)
+}
+
+// Col returns a vector representing the corresponding column (starting at col 0).
+// This package makes no distinction between row and column vectors, so it
+// will be a normal VecN for a MxN matrix.
+func (m Mat3x4) Col(col int) Vec3 {
+ return Vec3{m[col*3+0], m[col*3+1], m[col*3+2]}
+}
+
+// Cols decomposes a matrix into its corresponding column vectors.
+// This is equivalent to calling mat.Col for each column.
+func (m Mat3x4) Cols() (col0, col1, col2, col3 Vec3) {
+ return m.Col(0), m.Col(1), m.Col(2), m.Col(3)
+}
+
+// Abs returns the element-wise absolute value of this matrix
+func (m Mat3x4) Abs() Mat3x4 {
+ return Mat3x4{Abs(m[0]), Abs(m[1]), Abs(m[2]), Abs(m[3]), Abs(m[4]), Abs(m[5]), Abs(m[6]), Abs(m[7]), Abs(m[8]), Abs(m[9]), Abs(m[10]), Abs(m[11])}
+}
+
+// Pretty prints the matrix
+func (m Mat3x4) String() string {
+ buf := new(bytes.Buffer)
+ w := tabwriter.NewWriter(buf, 4, 4, 1, ' ', tabwriter.AlignRight)
+ for i := 0; i < 3; i++ {
+ for _, col := range m.Row(i) {
+ fmt.Fprintf(w, "%f\t", col)
+ }
+
+ fmt.Fprintln(w, "")
+ }
+ w.Flush()
+
+ return buf.String()
+}
+
+// SetCol sets a Column within the Matrix, so it mutates the calling matrix.
+func (m *Mat4x2) SetCol(col int, v Vec4) {
+ m[col*4+0], m[col*4+1], m[col*4+2], m[col*4+3] = v[0], v[1], v[2], v[3]
+}
+
+// SetRow sets a Row within the Matrix, so it mutates the calling matrix.
+func (m *Mat4x2) SetRow(row int, v Vec2) {
+ m[row+0], m[row+4] = v[0], v[1]
+}
+
+// Mat4x2FromRows builds a new matrix from row vectors.
+// The resulting matrix will still be in column major order, but this can be
+// good for hand-building matrices.
+
+func Mat4x2FromRows(row0, row1, row2, row3 Vec2) Mat4x2 {
+ return Mat4x2{row0[0], row1[0], row2[0], row3[0], row0[1], row1[1], row2[1], row3[1]}
+}
+
+// Mat4x2FromCols builds a new matrix from column vectors.
+func Mat4x2FromCols(col0, col1 Vec4) Mat4x2 {
+ return Mat4x2{col0[0], col0[1], col0[2], col0[3], col1[0], col1[1], col1[2], col1[3]}
+}
+
+// Add performs an element-wise addition of two matrices, this is
+// equivalent to iterating over every element of m1 and adding the corresponding value of m2.
+func (m1 Mat4x2) Add(m2 Mat4x2) Mat4x2 {
+ return Mat4x2{m1[0] + m2[0], m1[1] + m2[1], m1[2] + m2[2], m1[3] + m2[3], m1[4] + m2[4], m1[5] + m2[5], m1[6] + m2[6], m1[7] + m2[7]}
+}
+
+// Sub performs an element-wise subtraction of two matrices, this is
+// equivalent to iterating over every element of m1 and subtracting the corresponding value of m2.
+func (m1 Mat4x2) Sub(m2 Mat4x2) Mat4x2 {
+ return Mat4x2{m1[0] - m2[0], m1[1] - m2[1], m1[2] - m2[2], m1[3] - m2[3], m1[4] - m2[4], m1[5] - m2[5], m1[6] - m2[6], m1[7] - m2[7]}
+}
+
+// Mul performs a scalar multiplcation of the matrix. This is equivalent to iterating
+// over every element of the matrix and multiply it by c.
+func (m1 Mat4x2) Mul(c float32) Mat4x2 {
+ return Mat4x2{m1[0] * c, m1[1] * c, m1[2] * c, m1[3] * c, m1[4] * c, m1[5] * c, m1[6] * c, m1[7] * c}
+}
+
+// Mul2x1 performs a "matrix product" between this matrix
+// and another of the given dimension. For any two matrices of dimensionality
+// MxN and NxO, the result will be MxO. For instance, Mat4 multiplied using
+// Mul4x2 will result in a Mat4x2.
+func (m1 Mat4x2) Mul2x1(m2 Vec2) Vec4 {
+ return Vec4{
+ m1[0]*m2[0] + m1[4]*m2[1],
+ m1[1]*m2[0] + m1[5]*m2[1],
+ m1[2]*m2[0] + m1[6]*m2[1],
+ m1[3]*m2[0] + m1[7]*m2[1],
+ }
+}
+
+// Mul2 performs a "matrix product" between this matrix
+// and another of the given dimension. For any two matrices of dimensionality
+// MxN and NxO, the result will be MxO. For instance, Mat4 multiplied using
+// Mul4x2 will result in a Mat4x2.
+func (m1 Mat4x2) Mul2(m2 Mat2) Mat4x2 {
+ return Mat4x2{
+ m1[0]*m2[0] + m1[4]*m2[1],
+ m1[1]*m2[0] + m1[5]*m2[1],
+ m1[2]*m2[0] + m1[6]*m2[1],
+ m1[3]*m2[0] + m1[7]*m2[1],
+ m1[0]*m2[2] + m1[4]*m2[3],
+ m1[1]*m2[2] + m1[5]*m2[3],
+ m1[2]*m2[2] + m1[6]*m2[3],
+ m1[3]*m2[2] + m1[7]*m2[3],
+ }
+}
+
+// Mul2x3 performs a "matrix product" between this matrix
+// and another of the given dimension. For any two matrices of dimensionality
+// MxN and NxO, the result will be MxO. For instance, Mat4 multiplied using
+// Mul4x2 will result in a Mat4x2.
+func (m1 Mat4x2) Mul2x3(m2 Mat2x3) Mat4x3 {
+ return Mat4x3{
+ m1[0]*m2[0] + m1[4]*m2[1],
+ m1[1]*m2[0] + m1[5]*m2[1],
+ m1[2]*m2[0] + m1[6]*m2[1],
+ m1[3]*m2[0] + m1[7]*m2[1],
+ m1[0]*m2[2] + m1[4]*m2[3],
+ m1[1]*m2[2] + m1[5]*m2[3],
+ m1[2]*m2[2] + m1[6]*m2[3],
+ m1[3]*m2[2] + m1[7]*m2[3],
+ m1[0]*m2[4] + m1[4]*m2[5],
+ m1[1]*m2[4] + m1[5]*m2[5],
+ m1[2]*m2[4] + m1[6]*m2[5],
+ m1[3]*m2[4] + m1[7]*m2[5],
+ }
+}
+
+// Mul2x4 performs a "matrix product" between this matrix
+// and another of the given dimension. For any two matrices of dimensionality
+// MxN and NxO, the result will be MxO. For instance, Mat4 multiplied using
+// Mul4x2 will result in a Mat4x2.
+func (m1 Mat4x2) Mul2x4(m2 Mat2x4) Mat4 {
+ return Mat4{
+ m1[0]*m2[0] + m1[4]*m2[1],
+ m1[1]*m2[0] + m1[5]*m2[1],
+ m1[2]*m2[0] + m1[6]*m2[1],
+ m1[3]*m2[0] + m1[7]*m2[1],
+ m1[0]*m2[2] + m1[4]*m2[3],
+ m1[1]*m2[2] + m1[5]*m2[3],
+ m1[2]*m2[2] + m1[6]*m2[3],
+ m1[3]*m2[2] + m1[7]*m2[3],
+ m1[0]*m2[4] + m1[4]*m2[5],
+ m1[1]*m2[4] + m1[5]*m2[5],
+ m1[2]*m2[4] + m1[6]*m2[5],
+ m1[3]*m2[4] + m1[7]*m2[5],
+ m1[0]*m2[6] + m1[4]*m2[7],
+ m1[1]*m2[6] + m1[5]*m2[7],
+ m1[2]*m2[6] + m1[6]*m2[7],
+ m1[3]*m2[6] + m1[7]*m2[7],
+ }
+}
+
+// Transpose produces the transpose of this matrix. For any MxN matrix
+// the transpose is an NxM matrix with the rows swapped with the columns. For instance
+// the transpose of the Mat3x2 is a Mat2x3 like so:
+//
+// [[a b]] [[a c e]]
+// [[c d]] = [[b d f]]
+// [[e f]]
+func (m1 Mat4x2) Transpose() Mat2x4 {
+ return Mat2x4{m1[0], m1[4], m1[1], m1[5], m1[2], m1[6], m1[3], m1[7]}
+}
+
+// ApproxEqual performs an element-wise approximate equality test between two matrices,
+// as if FloatEqual had been used.
+func (m1 Mat4x2) ApproxEqual(m2 Mat4x2) bool {
+ for i := range m1 {
+ if !FloatEqual(m1[i], m2[i]) {
+ return false
+ }
+ }
+ return true
+}
+
+// ApproxEqualThreshold performs an element-wise approximate equality test between two matrices
+// with a given epsilon threshold, as if FloatEqualThreshold had been used.
+func (m1 Mat4x2) ApproxEqualThreshold(m2 Mat4x2, threshold float32) bool {
+ for i := range m1 {
+ if !FloatEqualThreshold(m1[i], m2[i], threshold) {
+ return false
+ }
+ }
+ return true
+}
+
+// ApproxFuncEqual performs an element-wise approximate equality test between two matrices
+// with a given equality functions, intended to be used with FloatEqualFunc; although and comparison
+// function may be used in practice.
+func (m1 Mat4x2) ApproxFuncEqual(m2 Mat4x2, eq func(float32, float32) bool) bool {
+ for i := range m1 {
+ if !eq(m1[i], m2[i]) {
+ return false
+ }
+ }
+ return true
+}
+
+// NumRows returns the number of rows in this matrix
+func (m Mat4x2) NumRows() int {
+ return 4
+}
+
+// NumCols returns the number of columns in this matrix
+func (m Mat4x2) NumCols() int {
+ return 2
+}
+
+// At returns the matrix element at the given row and column.
+// This is equivalent to mat[col * numRow + row] where numRow is constant
+// (E.G. for a Mat3x2 it's equal to 3)
+//
+// This method is garbage-in garbage-out. For instance, on a Mat4 asking for
+// At(5,0) will work just like At(1,1). Or it may panic if it's out of bounds.
+func (m Mat4x2) At(row, col int) float32 {
+ return m[col*4+row]
+}
+
+// Set sets the corresponding matrix element at the given row and column.
+// This has a pointer receiver because it mutates the matrix.
+//
+// This method is garbage-in garbage-out. For instance, on a Mat4 asking for
+// Set(5,0,val) will work just like Set(1,1,val). Or it may panic if it's out of bounds.
+func (m *Mat4x2) Set(row, col int, value float32) {
+ m[col*4+row] = value
+}
+
+// Index returns the index of the given row and column, to be used with direct
+// access. E.G. Index(0,0) = 0.
+//
+// This is a garbage-in garbage-out method. For instance, on a Mat4 asking for the index of
+// (5,0) will work the same as asking for (1,1). Or it may give you a value that will cause
+// a panic if you try to access the array with it if it's truly out of bounds.
+func (m Mat4x2) Index(row, col int) int {
+ return col*4 + row
+}
+
+// Row returns a vector representing the corresponding row (starting at row 0).
+// This package makes no distinction between row and column vectors, so it
+// will be a normal VecM for a MxN matrix.
+func (m Mat4x2) Row(row int) Vec2 {
+ return Vec2{m[row+0], m[row+4]}
+}
+
+// Rows decomposes a matrix into its corresponding row vectors.
+// This is equivalent to calling mat.Row for each row.
+func (m Mat4x2) Rows() (row0, row1, row2, row3 Vec2) {
+ return m.Row(0), m.Row(1), m.Row(2), m.Row(3)
+}
+
+// Col returns a vector representing the corresponding column (starting at col 0).
+// This package makes no distinction between row and column vectors, so it
+// will be a normal VecN for a MxN matrix.
+func (m Mat4x2) Col(col int) Vec4 {
+ return Vec4{m[col*4+0], m[col*4+1], m[col*4+2], m[col*4+3]}
+}
+
+// Cols decomposes a matrix into its corresponding column vectors.
+// This is equivalent to calling mat.Col for each column.
+func (m Mat4x2) Cols() (col0, col1 Vec4) {
+ return m.Col(0), m.Col(1)
+}
+
+// Abs returns the element-wise absolute value of this matrix
+func (m Mat4x2) Abs() Mat4x2 {
+ return Mat4x2{Abs(m[0]), Abs(m[1]), Abs(m[2]), Abs(m[3]), Abs(m[4]), Abs(m[5]), Abs(m[6]), Abs(m[7])}
+}
+
+// Pretty prints the matrix
+func (m Mat4x2) String() string {
+ buf := new(bytes.Buffer)
+ w := tabwriter.NewWriter(buf, 4, 4, 1, ' ', tabwriter.AlignRight)
+ for i := 0; i < 4; i++ {
+ for _, col := range m.Row(i) {
+ fmt.Fprintf(w, "%f\t", col)
+ }
+
+ fmt.Fprintln(w, "")
+ }
+ w.Flush()
+
+ return buf.String()
+}
+
+// SetCol sets a Column within the Matrix, so it mutates the calling matrix.
+func (m *Mat4x3) SetCol(col int, v Vec4) {
+ m[col*4+0], m[col*4+1], m[col*4+2], m[col*4+3] = v[0], v[1], v[2], v[3]
+}
+
+// SetRow sets a Row within the Matrix, so it mutates the calling matrix.
+func (m *Mat4x3) SetRow(row int, v Vec3) {
+ m[row+0], m[row+4], m[row+8] = v[0], v[1], v[2]
+}
+
+// Mat4x3FromRows builds a new matrix from row vectors.
+// The resulting matrix will still be in column major order, but this can be
+// good for hand-building matrices.
+
+func Mat4x3FromRows(row0, row1, row2, row3 Vec3) Mat4x3 {
+ return Mat4x3{row0[0], row1[0], row2[0], row3[0], row0[1], row1[1], row2[1], row3[1], row0[2], row1[2], row2[2], row3[2]}
+}
+
+// Mat4x3FromCols builds a new matrix from column vectors.
+func Mat4x3FromCols(col0, col1, col2 Vec4) Mat4x3 {
+ return Mat4x3{col0[0], col0[1], col0[2], col0[3], col1[0], col1[1], col1[2], col1[3], col2[0], col2[1], col2[2], col2[3]}
+}
+
+// Add performs an element-wise addition of two matrices, this is
+// equivalent to iterating over every element of m1 and adding the corresponding value of m2.
+func (m1 Mat4x3) Add(m2 Mat4x3) Mat4x3 {
+ return Mat4x3{m1[0] + m2[0], m1[1] + m2[1], m1[2] + m2[2], m1[3] + m2[3], m1[4] + m2[4], m1[5] + m2[5], m1[6] + m2[6], m1[7] + m2[7], m1[8] + m2[8], m1[9] + m2[9], m1[10] + m2[10], m1[11] + m2[11]}
+}
+
+// Sub performs an element-wise subtraction of two matrices, this is
+// equivalent to iterating over every element of m1 and subtracting the corresponding value of m2.
+func (m1 Mat4x3) Sub(m2 Mat4x3) Mat4x3 {
+ return Mat4x3{m1[0] - m2[0], m1[1] - m2[1], m1[2] - m2[2], m1[3] - m2[3], m1[4] - m2[4], m1[5] - m2[5], m1[6] - m2[6], m1[7] - m2[7], m1[8] - m2[8], m1[9] - m2[9], m1[10] - m2[10], m1[11] - m2[11]}
+}
+
+// Mul performs a scalar multiplcation of the matrix. This is equivalent to iterating
+// over every element of the matrix and multiply it by c.
+func (m1 Mat4x3) Mul(c float32) Mat4x3 {
+ return Mat4x3{m1[0] * c, m1[1] * c, m1[2] * c, m1[3] * c, m1[4] * c, m1[5] * c, m1[6] * c, m1[7] * c, m1[8] * c, m1[9] * c, m1[10] * c, m1[11] * c}
+}
+
+// Mul3x1 performs a "matrix product" between this matrix
+// and another of the given dimension. For any two matrices of dimensionality
+// MxN and NxO, the result will be MxO. For instance, Mat4 multiplied using
+// Mul4x2 will result in a Mat4x2.
+func (m1 Mat4x3) Mul3x1(m2 Vec3) Vec4 {
+ return Vec4{
+ m1[0]*m2[0] + m1[4]*m2[1] + m1[8]*m2[2],
+ m1[1]*m2[0] + m1[5]*m2[1] + m1[9]*m2[2],
+ m1[2]*m2[0] + m1[6]*m2[1] + m1[10]*m2[2],
+ m1[3]*m2[0] + m1[7]*m2[1] + m1[11]*m2[2],
+ }
+}
+
+// Mul3x2 performs a "matrix product" between this matrix
+// and another of the given dimension. For any two matrices of dimensionality
+// MxN and NxO, the result will be MxO. For instance, Mat4 multiplied using
+// Mul4x2 will result in a Mat4x2.
+func (m1 Mat4x3) Mul3x2(m2 Mat3x2) Mat4x2 {
+ return Mat4x2{
+ m1[0]*m2[0] + m1[4]*m2[1] + m1[8]*m2[2],
+ m1[1]*m2[0] + m1[5]*m2[1] + m1[9]*m2[2],
+ m1[2]*m2[0] + m1[6]*m2[1] + m1[10]*m2[2],
+ m1[3]*m2[0] + m1[7]*m2[1] + m1[11]*m2[2],
+ m1[0]*m2[3] + m1[4]*m2[4] + m1[8]*m2[5],
+ m1[1]*m2[3] + m1[5]*m2[4] + m1[9]*m2[5],
+ m1[2]*m2[3] + m1[6]*m2[4] + m1[10]*m2[5],
+ m1[3]*m2[3] + m1[7]*m2[4] + m1[11]*m2[5],
+ }
+}
+
+// Mul3 performs a "matrix product" between this matrix
+// and another of the given dimension. For any two matrices of dimensionality
+// MxN and NxO, the result will be MxO. For instance, Mat4 multiplied using
+// Mul4x2 will result in a Mat4x2.
+func (m1 Mat4x3) Mul3(m2 Mat3) Mat4x3 {
+ return Mat4x3{
+ m1[0]*m2[0] + m1[4]*m2[1] + m1[8]*m2[2],
+ m1[1]*m2[0] + m1[5]*m2[1] + m1[9]*m2[2],
+ m1[2]*m2[0] + m1[6]*m2[1] + m1[10]*m2[2],
+ m1[3]*m2[0] + m1[7]*m2[1] + m1[11]*m2[2],
+ m1[0]*m2[3] + m1[4]*m2[4] + m1[8]*m2[5],
+ m1[1]*m2[3] + m1[5]*m2[4] + m1[9]*m2[5],
+ m1[2]*m2[3] + m1[6]*m2[4] + m1[10]*m2[5],
+ m1[3]*m2[3] + m1[7]*m2[4] + m1[11]*m2[5],
+ m1[0]*m2[6] + m1[4]*m2[7] + m1[8]*m2[8],
+ m1[1]*m2[6] + m1[5]*m2[7] + m1[9]*m2[8],
+ m1[2]*m2[6] + m1[6]*m2[7] + m1[10]*m2[8],
+ m1[3]*m2[6] + m1[7]*m2[7] + m1[11]*m2[8],
+ }
+}
+
+// Mul3x4 performs a "matrix product" between this matrix
+// and another of the given dimension. For any two matrices of dimensionality
+// MxN and NxO, the result will be MxO. For instance, Mat4 multiplied using
+// Mul4x2 will result in a Mat4x2.
+func (m1 Mat4x3) Mul3x4(m2 Mat3x4) Mat4 {
+ return Mat4{
+ m1[0]*m2[0] + m1[4]*m2[1] + m1[8]*m2[2],
+ m1[1]*m2[0] + m1[5]*m2[1] + m1[9]*m2[2],
+ m1[2]*m2[0] + m1[6]*m2[1] + m1[10]*m2[2],
+ m1[3]*m2[0] + m1[7]*m2[1] + m1[11]*m2[2],
+ m1[0]*m2[3] + m1[4]*m2[4] + m1[8]*m2[5],
+ m1[1]*m2[3] + m1[5]*m2[4] + m1[9]*m2[5],
+ m1[2]*m2[3] + m1[6]*m2[4] + m1[10]*m2[5],
+ m1[3]*m2[3] + m1[7]*m2[4] + m1[11]*m2[5],
+ m1[0]*m2[6] + m1[4]*m2[7] + m1[8]*m2[8],
+ m1[1]*m2[6] + m1[5]*m2[7] + m1[9]*m2[8],
+ m1[2]*m2[6] + m1[6]*m2[7] + m1[10]*m2[8],
+ m1[3]*m2[6] + m1[7]*m2[7] + m1[11]*m2[8],
+ m1[0]*m2[9] + m1[4]*m2[10] + m1[8]*m2[11],
+ m1[1]*m2[9] + m1[5]*m2[10] + m1[9]*m2[11],
+ m1[2]*m2[9] + m1[6]*m2[10] + m1[10]*m2[11],
+ m1[3]*m2[9] + m1[7]*m2[10] + m1[11]*m2[11],
+ }
+}
+
+// Transpose produces the transpose of this matrix. For any MxN matrix
+// the transpose is an NxM matrix with the rows swapped with the columns. For instance
+// the transpose of the Mat3x2 is a Mat2x3 like so:
+//
+// [[a b]] [[a c e]]
+// [[c d]] = [[b d f]]
+// [[e f]]
+func (m1 Mat4x3) Transpose() Mat3x4 {
+ return Mat3x4{m1[0], m1[4], m1[8], m1[1], m1[5], m1[9], m1[2], m1[6], m1[10], m1[3], m1[7], m1[11]}
+}
+
+// ApproxEqual performs an element-wise approximate equality test between two matrices,
+// as if FloatEqual had been used.
+func (m1 Mat4x3) ApproxEqual(m2 Mat4x3) bool {
+ for i := range m1 {
+ if !FloatEqual(m1[i], m2[i]) {
+ return false
+ }
+ }
+ return true
+}
+
+// ApproxEqualThreshold performs an element-wise approximate equality test between two matrices
+// with a given epsilon threshold, as if FloatEqualThreshold had been used.
+func (m1 Mat4x3) ApproxEqualThreshold(m2 Mat4x3, threshold float32) bool {
+ for i := range m1 {
+ if !FloatEqualThreshold(m1[i], m2[i], threshold) {
+ return false
+ }
+ }
+ return true
+}
+
+// ApproxFuncEqual performs an element-wise approximate equality test between two matrices
+// with a given equality functions, intended to be used with FloatEqualFunc; although and comparison
+// function may be used in practice.
+func (m1 Mat4x3) ApproxFuncEqual(m2 Mat4x3, eq func(float32, float32) bool) bool {
+ for i := range m1 {
+ if !eq(m1[i], m2[i]) {
+ return false
+ }
+ }
+ return true
+}
+
+// NumRows returns the number of rows in this matrix
+func (m Mat4x3) NumRows() int {
+ return 4
+}
+
+// NumCols returns the number of columns in this matrix
+func (m Mat4x3) NumCols() int {
+ return 3
+}
+
+// At returns the matrix element at the given row and column.
+// This is equivalent to mat[col * numRow + row] where numRow is constant
+// (E.G. for a Mat3x2 it's equal to 3)
+//
+// This method is garbage-in garbage-out. For instance, on a Mat4 asking for
+// At(5,0) will work just like At(1,1). Or it may panic if it's out of bounds.
+func (m Mat4x3) At(row, col int) float32 {
+ return m[col*4+row]
+}
+
+// Set sets the corresponding matrix element at the given row and column.
+// This has a pointer receiver because it mutates the matrix.
+//
+// This method is garbage-in garbage-out. For instance, on a Mat4 asking for
+// Set(5,0,val) will work just like Set(1,1,val). Or it may panic if it's out of bounds.
+func (m *Mat4x3) Set(row, col int, value float32) {
+ m[col*4+row] = value
+}
+
+// Index returns the index of the given row and column, to be used with direct
+// access. E.G. Index(0,0) = 0.
+//
+// This is a garbage-in garbage-out method. For instance, on a Mat4 asking for the index of
+// (5,0) will work the same as asking for (1,1). Or it may give you a value that will cause
+// a panic if you try to access the array with it if it's truly out of bounds.
+func (m Mat4x3) Index(row, col int) int {
+ return col*4 + row
+}
+
+// Row returns a vector representing the corresponding row (starting at row 0).
+// This package makes no distinction between row and column vectors, so it
+// will be a normal VecM for a MxN matrix.
+func (m Mat4x3) Row(row int) Vec3 {
+ return Vec3{m[row+0], m[row+4], m[row+8]}
+}
+
+// Rows decomposes a matrix into its corresponding row vectors.
+// This is equivalent to calling mat.Row for each row.
+func (m Mat4x3) Rows() (row0, row1, row2, row3 Vec3) {
+ return m.Row(0), m.Row(1), m.Row(2), m.Row(3)
+}
+
+// Col returns a vector representing the corresponding column (starting at col 0).
+// This package makes no distinction between row and column vectors, so it
+// will be a normal VecN for a MxN matrix.
+func (m Mat4x3) Col(col int) Vec4 {
+ return Vec4{m[col*4+0], m[col*4+1], m[col*4+2], m[col*4+3]}
+}
+
+// Cols decomposes a matrix into its corresponding column vectors.
+// This is equivalent to calling mat.Col for each column.
+func (m Mat4x3) Cols() (col0, col1, col2 Vec4) {
+ return m.Col(0), m.Col(1), m.Col(2)
+}
+
+// Abs returns the element-wise absolute value of this matrix
+func (m Mat4x3) Abs() Mat4x3 {
+ return Mat4x3{Abs(m[0]), Abs(m[1]), Abs(m[2]), Abs(m[3]), Abs(m[4]), Abs(m[5]), Abs(m[6]), Abs(m[7]), Abs(m[8]), Abs(m[9]), Abs(m[10]), Abs(m[11])}
+}
+
+// Pretty prints the matrix
+func (m Mat4x3) String() string {
+ buf := new(bytes.Buffer)
+ w := tabwriter.NewWriter(buf, 4, 4, 1, ' ', tabwriter.AlignRight)
+ for i := 0; i < 4; i++ {
+ for _, col := range m.Row(i) {
+ fmt.Fprintf(w, "%f\t", col)
+ }
+
+ fmt.Fprintln(w, "")
+ }
+ w.Flush()
+
+ return buf.String()
+}
+
+// SetCol sets a Column within the Matrix, so it mutates the calling matrix.
+func (m *Mat4) SetCol(col int, v Vec4) {
+ m[col*4+0], m[col*4+1], m[col*4+2], m[col*4+3] = v[0], v[1], v[2], v[3]
+}
+
+// SetRow sets a Row within the Matrix, so it mutates the calling matrix.
+func (m *Mat4) SetRow(row int, v Vec4) {
+ m[row+0], m[row+4], m[row+8], m[row+12] = v[0], v[1], v[2], v[3]
+}
+
+// Diag is a basic operation on a square matrix that simply
+// returns main diagonal (meaning all elements such that row==col).
+func (m Mat4) Diag() Vec4 {
+ return Vec4{m[0], m[5], m[10], m[15]}
+}
+
+// Ident4 returns the 4x4 identity matrix.
+// The identity matrix is a square matrix with the value 1 on its
+// diagonals. The characteristic property of the identity matrix is that
+// any matrix multiplied by it is itself. (MI = M; IN = N)
+func Ident4() Mat4 {
+ return Mat4{1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1}
+}
+
+// Diag4 creates a diagonal matrix from the entries of the input vector.
+// That is, for each pointer for row==col, vector[row] is the entry. Otherwise it's 0.
+//
+// Another way to think about it is that the identity is this function where the every vector element is 1.
+func Diag4(v Vec4) Mat4 {
+ var m Mat4
+ m[0], m[5], m[10], m[15] = v[0], v[1], v[2], v[3]
+ return m
+}
+
+// Mat4FromRows builds a new matrix from row vectors.
+// The resulting matrix will still be in column major order, but this can be
+// good for hand-building matrices.
+
+func Mat4FromRows(row0, row1, row2, row3 Vec4) Mat4 {
+ return Mat4{row0[0], row1[0], row2[0], row3[0], row0[1], row1[1], row2[1], row3[1], row0[2], row1[2], row2[2], row3[2], row0[3], row1[3], row2[3], row3[3]}
+}
+
+// Mat4FromCols builds a new matrix from column vectors.
+func Mat4FromCols(col0, col1, col2, col3 Vec4) Mat4 {
+ return Mat4{col0[0], col0[1], col0[2], col0[3], col1[0], col1[1], col1[2], col1[3], col2[0], col2[1], col2[2], col2[3], col3[0], col3[1], col3[2], col3[3]}
+}
+
+// Add performs an element-wise addition of two matrices, this is
+// equivalent to iterating over every element of m1 and adding the corresponding value of m2.
+func (m1 Mat4) Add(m2 Mat4) Mat4 {
+ return Mat4{m1[0] + m2[0], m1[1] + m2[1], m1[2] + m2[2], m1[3] + m2[3], m1[4] + m2[4], m1[5] + m2[5], m1[6] + m2[6], m1[7] + m2[7], m1[8] + m2[8], m1[9] + m2[9], m1[10] + m2[10], m1[11] + m2[11], m1[12] + m2[12], m1[13] + m2[13], m1[14] + m2[14], m1[15] + m2[15]}
+}
+
+// Sub performs an element-wise subtraction of two matrices, this is
+// equivalent to iterating over every element of m1 and subtracting the corresponding value of m2.
+func (m1 Mat4) Sub(m2 Mat4) Mat4 {
+ return Mat4{m1[0] - m2[0], m1[1] - m2[1], m1[2] - m2[2], m1[3] - m2[3], m1[4] - m2[4], m1[5] - m2[5], m1[6] - m2[6], m1[7] - m2[7], m1[8] - m2[8], m1[9] - m2[9], m1[10] - m2[10], m1[11] - m2[11], m1[12] - m2[12], m1[13] - m2[13], m1[14] - m2[14], m1[15] - m2[15]}
+}
+
+// Mul performs a scalar multiplcation of the matrix. This is equivalent to iterating
+// over every element of the matrix and multiply it by c.
+func (m1 Mat4) Mul(c float32) Mat4 {
+ return Mat4{m1[0] * c, m1[1] * c, m1[2] * c, m1[3] * c, m1[4] * c, m1[5] * c, m1[6] * c, m1[7] * c, m1[8] * c, m1[9] * c, m1[10] * c, m1[11] * c, m1[12] * c, m1[13] * c, m1[14] * c, m1[15] * c}
+}
+
+// Mul4x1 performs a "matrix product" between this matrix
+// and another of the given dimension. For any two matrices of dimensionality
+// MxN and NxO, the result will be MxO. For instance, Mat4 multiplied using
+// Mul4x2 will result in a Mat4x2.
+func (m1 Mat4) Mul4x1(m2 Vec4) Vec4 {
+ return Vec4{
+ m1[0]*m2[0] + m1[4]*m2[1] + m1[8]*m2[2] + m1[12]*m2[3],
+ m1[1]*m2[0] + m1[5]*m2[1] + m1[9]*m2[2] + m1[13]*m2[3],
+ m1[2]*m2[0] + m1[6]*m2[1] + m1[10]*m2[2] + m1[14]*m2[3],
+ m1[3]*m2[0] + m1[7]*m2[1] + m1[11]*m2[2] + m1[15]*m2[3],
+ }
+}
+
+// Mul4x2 performs a "matrix product" between this matrix
+// and another of the given dimension. For any two matrices of dimensionality
+// MxN and NxO, the result will be MxO. For instance, Mat4 multiplied using
+// Mul4x2 will result in a Mat4x2.
+func (m1 Mat4) Mul4x2(m2 Mat4x2) Mat4x2 {
+ return Mat4x2{
+ m1[0]*m2[0] + m1[4]*m2[1] + m1[8]*m2[2] + m1[12]*m2[3],
+ m1[1]*m2[0] + m1[5]*m2[1] + m1[9]*m2[2] + m1[13]*m2[3],
+ m1[2]*m2[0] + m1[6]*m2[1] + m1[10]*m2[2] + m1[14]*m2[3],
+ m1[3]*m2[0] + m1[7]*m2[1] + m1[11]*m2[2] + m1[15]*m2[3],
+ m1[0]*m2[4] + m1[4]*m2[5] + m1[8]*m2[6] + m1[12]*m2[7],
+ m1[1]*m2[4] + m1[5]*m2[5] + m1[9]*m2[6] + m1[13]*m2[7],
+ m1[2]*m2[4] + m1[6]*m2[5] + m1[10]*m2[6] + m1[14]*m2[7],
+ m1[3]*m2[4] + m1[7]*m2[5] + m1[11]*m2[6] + m1[15]*m2[7],
+ }
+}
+
+// Mul4x3 performs a "matrix product" between this matrix
+// and another of the given dimension. For any two matrices of dimensionality
+// MxN and NxO, the result will be MxO. For instance, Mat4 multiplied using
+// Mul4x2 will result in a Mat4x2.
+func (m1 Mat4) Mul4x3(m2 Mat4x3) Mat4x3 {
+ return Mat4x3{
+ m1[0]*m2[0] + m1[4]*m2[1] + m1[8]*m2[2] + m1[12]*m2[3],
+ m1[1]*m2[0] + m1[5]*m2[1] + m1[9]*m2[2] + m1[13]*m2[3],
+ m1[2]*m2[0] + m1[6]*m2[1] + m1[10]*m2[2] + m1[14]*m2[3],
+ m1[3]*m2[0] + m1[7]*m2[1] + m1[11]*m2[2] + m1[15]*m2[3],
+ m1[0]*m2[4] + m1[4]*m2[5] + m1[8]*m2[6] + m1[12]*m2[7],
+ m1[1]*m2[4] + m1[5]*m2[5] + m1[9]*m2[6] + m1[13]*m2[7],
+ m1[2]*m2[4] + m1[6]*m2[5] + m1[10]*m2[6] + m1[14]*m2[7],
+ m1[3]*m2[4] + m1[7]*m2[5] + m1[11]*m2[6] + m1[15]*m2[7],
+ m1[0]*m2[8] + m1[4]*m2[9] + m1[8]*m2[10] + m1[12]*m2[11],
+ m1[1]*m2[8] + m1[5]*m2[9] + m1[9]*m2[10] + m1[13]*m2[11],
+ m1[2]*m2[8] + m1[6]*m2[9] + m1[10]*m2[10] + m1[14]*m2[11],
+ m1[3]*m2[8] + m1[7]*m2[9] + m1[11]*m2[10] + m1[15]*m2[11],
+ }
+}
+
+// Mul4 performs a "matrix product" between this matrix
+// and another of the given dimension. For any two matrices of dimensionality
+// MxN and NxO, the result will be MxO. For instance, Mat4 multiplied using
+// Mul4x2 will result in a Mat4x2.
+func (m1 Mat4) Mul4(m2 Mat4) Mat4 {
+ return Mat4{
+ m1[0]*m2[0] + m1[4]*m2[1] + m1[8]*m2[2] + m1[12]*m2[3],
+ m1[1]*m2[0] + m1[5]*m2[1] + m1[9]*m2[2] + m1[13]*m2[3],
+ m1[2]*m2[0] + m1[6]*m2[1] + m1[10]*m2[2] + m1[14]*m2[3],
+ m1[3]*m2[0] + m1[7]*m2[1] + m1[11]*m2[2] + m1[15]*m2[3],
+ m1[0]*m2[4] + m1[4]*m2[5] + m1[8]*m2[6] + m1[12]*m2[7],
+ m1[1]*m2[4] + m1[5]*m2[5] + m1[9]*m2[6] + m1[13]*m2[7],
+ m1[2]*m2[4] + m1[6]*m2[5] + m1[10]*m2[6] + m1[14]*m2[7],
+ m1[3]*m2[4] + m1[7]*m2[5] + m1[11]*m2[6] + m1[15]*m2[7],
+ m1[0]*m2[8] + m1[4]*m2[9] + m1[8]*m2[10] + m1[12]*m2[11],
+ m1[1]*m2[8] + m1[5]*m2[9] + m1[9]*m2[10] + m1[13]*m2[11],
+ m1[2]*m2[8] + m1[6]*m2[9] + m1[10]*m2[10] + m1[14]*m2[11],
+ m1[3]*m2[8] + m1[7]*m2[9] + m1[11]*m2[10] + m1[15]*m2[11],
+ m1[0]*m2[12] + m1[4]*m2[13] + m1[8]*m2[14] + m1[12]*m2[15],
+ m1[1]*m2[12] + m1[5]*m2[13] + m1[9]*m2[14] + m1[13]*m2[15],
+ m1[2]*m2[12] + m1[6]*m2[13] + m1[10]*m2[14] + m1[14]*m2[15],
+ m1[3]*m2[12] + m1[7]*m2[13] + m1[11]*m2[14] + m1[15]*m2[15],
+ }
+}
+
+// Transpose produces the transpose of this matrix. For any MxN matrix
+// the transpose is an NxM matrix with the rows swapped with the columns. For instance
+// the transpose of the Mat3x2 is a Mat2x3 like so:
+//
+// [[a b]] [[a c e]]
+// [[c d]] = [[b d f]]
+// [[e f]]
+func (m1 Mat4) Transpose() Mat4 {
+ return Mat4{m1[0], m1[4], m1[8], m1[12], m1[1], m1[5], m1[9], m1[13], m1[2], m1[6], m1[10], m1[14], m1[3], m1[7], m1[11], m1[15]}
+}
+
+// Det returns the determinant of a matrix. It is a measure of a square matrix's
+// singularity and invertability, among other things. In this library, the
+// determinant is hard coded based on pre-computed cofactor expansion, and uses
+// no loops. Of course, the addition and multiplication must still be done.
+func (m Mat4) Det() float32 {
+ return m[0]*m[5]*m[10]*m[15] - m[0]*m[5]*m[11]*m[14] - m[0]*m[6]*m[9]*m[15] + m[0]*m[6]*m[11]*m[13] + m[0]*m[7]*m[9]*m[14] - m[0]*m[7]*m[10]*m[13] - m[1]*m[4]*m[10]*m[15] + m[1]*m[4]*m[11]*m[14] + m[1]*m[6]*m[8]*m[15] - m[1]*m[6]*m[11]*m[12] - m[1]*m[7]*m[8]*m[14] + m[1]*m[7]*m[10]*m[12] + m[2]*m[4]*m[9]*m[15] - m[2]*m[4]*m[11]*m[13] - m[2]*m[5]*m[8]*m[15] + m[2]*m[5]*m[11]*m[12] + m[2]*m[7]*m[8]*m[13] - m[2]*m[7]*m[9]*m[12] - m[3]*m[4]*m[9]*m[14] + m[3]*m[4]*m[10]*m[13] + m[3]*m[5]*m[8]*m[14] - m[3]*m[5]*m[10]*m[12] - m[3]*m[6]*m[8]*m[13] + m[3]*m[6]*m[9]*m[12]
+}
+
+// Inv computes the inverse of a square matrix. An inverse is a square matrix such that when multiplied by the
+// original, yields the identity.
+//
+// M_inv * M = M * M_inv = I
+//
+// In this library, the math is precomputed, and uses no loops, though the multiplications, additions, determinant calculation, and scaling
+// are still done. This can still be (relatively) expensive for a 4x4.
+//
+// This function checks the determinant to see if the matrix is invertible.
+// If the determinant is 0.0, this function returns the zero matrix. However, due to floating point errors, it is
+// entirely plausible to get a false positive or negative.
+// In the future, an alternate function may be written which takes in a pre-computed determinant.
+func (m Mat4) Inv() Mat4 {
+ det := m.Det()
+ if FloatEqual(det, float32(0.0)) {
+ return Mat4{}
+ }
+
+ retMat := Mat4{
+ -m[7]*m[10]*m[13] + m[6]*m[11]*m[13] + m[7]*m[9]*m[14] - m[5]*m[11]*m[14] - m[6]*m[9]*m[15] + m[5]*m[10]*m[15],
+ m[3]*m[10]*m[13] - m[2]*m[11]*m[13] - m[3]*m[9]*m[14] + m[1]*m[11]*m[14] + m[2]*m[9]*m[15] - m[1]*m[10]*m[15],
+ -m[3]*m[6]*m[13] + m[2]*m[7]*m[13] + m[3]*m[5]*m[14] - m[1]*m[7]*m[14] - m[2]*m[5]*m[15] + m[1]*m[6]*m[15],
+ m[3]*m[6]*m[9] - m[2]*m[7]*m[9] - m[3]*m[5]*m[10] + m[1]*m[7]*m[10] + m[2]*m[5]*m[11] - m[1]*m[6]*m[11],
+ m[7]*m[10]*m[12] - m[6]*m[11]*m[12] - m[7]*m[8]*m[14] + m[4]*m[11]*m[14] + m[6]*m[8]*m[15] - m[4]*m[10]*m[15],
+ -m[3]*m[10]*m[12] + m[2]*m[11]*m[12] + m[3]*m[8]*m[14] - m[0]*m[11]*m[14] - m[2]*m[8]*m[15] + m[0]*m[10]*m[15],
+ m[3]*m[6]*m[12] - m[2]*m[7]*m[12] - m[3]*m[4]*m[14] + m[0]*m[7]*m[14] + m[2]*m[4]*m[15] - m[0]*m[6]*m[15],
+ -m[3]*m[6]*m[8] + m[2]*m[7]*m[8] + m[3]*m[4]*m[10] - m[0]*m[7]*m[10] - m[2]*m[4]*m[11] + m[0]*m[6]*m[11],
+ -m[7]*m[9]*m[12] + m[5]*m[11]*m[12] + m[7]*m[8]*m[13] - m[4]*m[11]*m[13] - m[5]*m[8]*m[15] + m[4]*m[9]*m[15],
+ m[3]*m[9]*m[12] - m[1]*m[11]*m[12] - m[3]*m[8]*m[13] + m[0]*m[11]*m[13] + m[1]*m[8]*m[15] - m[0]*m[9]*m[15],
+ -m[3]*m[5]*m[12] + m[1]*m[7]*m[12] + m[3]*m[4]*m[13] - m[0]*m[7]*m[13] - m[1]*m[4]*m[15] + m[0]*m[5]*m[15],
+ m[3]*m[5]*m[8] - m[1]*m[7]*m[8] - m[3]*m[4]*m[9] + m[0]*m[7]*m[9] + m[1]*m[4]*m[11] - m[0]*m[5]*m[11],
+ m[6]*m[9]*m[12] - m[5]*m[10]*m[12] - m[6]*m[8]*m[13] + m[4]*m[10]*m[13] + m[5]*m[8]*m[14] - m[4]*m[9]*m[14],
+ -m[2]*m[9]*m[12] + m[1]*m[10]*m[12] + m[2]*m[8]*m[13] - m[0]*m[10]*m[13] - m[1]*m[8]*m[14] + m[0]*m[9]*m[14],
+ m[2]*m[5]*m[12] - m[1]*m[6]*m[12] - m[2]*m[4]*m[13] + m[0]*m[6]*m[13] + m[1]*m[4]*m[14] - m[0]*m[5]*m[14],
+ -m[2]*m[5]*m[8] + m[1]*m[6]*m[8] + m[2]*m[4]*m[9] - m[0]*m[6]*m[9] - m[1]*m[4]*m[10] + m[0]*m[5]*m[10],
+ }
+
+ return retMat.Mul(1 / det)
+}
+
+// ApproxEqual performs an element-wise approximate equality test between two matrices,
+// as if FloatEqual had been used.
+func (m1 Mat4) ApproxEqual(m2 Mat4) bool {
+ for i := range m1 {
+ if !FloatEqual(m1[i], m2[i]) {
+ return false
+ }
+ }
+ return true
+}
+
+// ApproxEqualThreshold performs an element-wise approximate equality test between two matrices
+// with a given epsilon threshold, as if FloatEqualThreshold had been used.
+func (m1 Mat4) ApproxEqualThreshold(m2 Mat4, threshold float32) bool {
+ for i := range m1 {
+ if !FloatEqualThreshold(m1[i], m2[i], threshold) {
+ return false
+ }
+ }
+ return true
+}
+
+// ApproxFuncEqual performs an element-wise approximate equality test between two matrices
+// with a given equality functions, intended to be used with FloatEqualFunc; although and comparison
+// function may be used in practice.
+func (m1 Mat4) ApproxFuncEqual(m2 Mat4, eq func(float32, float32) bool) bool {
+ for i := range m1 {
+ if !eq(m1[i], m2[i]) {
+ return false
+ }
+ }
+ return true
+}
+
+// NumRows returns the number of rows in this matrix
+func (m Mat4) NumRows() int {
+ return 4
+}
+
+// NumCols returns the number of columns in this matrix
+func (m Mat4) NumCols() int {
+ return 4
+}
+
+// At returns the matrix element at the given row and column.
+// This is equivalent to mat[col * numRow + row] where numRow is constant
+// (E.G. for a Mat3x2 it's equal to 3)
+//
+// This method is garbage-in garbage-out. For instance, on a Mat4 asking for
+// At(5,0) will work just like At(1,1). Or it may panic if it's out of bounds.
+func (m Mat4) At(row, col int) float32 {
+ return m[col*4+row]
+}
+
+// Set sets the corresponding matrix element at the given row and column.
+// This has a pointer receiver because it mutates the matrix.
+//
+// This method is garbage-in garbage-out. For instance, on a Mat4 asking for
+// Set(5,0,val) will work just like Set(1,1,val). Or it may panic if it's out of bounds.
+func (m *Mat4) Set(row, col int, value float32) {
+ m[col*4+row] = value
+}
+
+// Index returns the index of the given row and column, to be used with direct
+// access. E.G. Index(0,0) = 0.
+//
+// This is a garbage-in garbage-out method. For instance, on a Mat4 asking for the index of
+// (5,0) will work the same as asking for (1,1). Or it may give you a value that will cause
+// a panic if you try to access the array with it if it's truly out of bounds.
+func (m Mat4) Index(row, col int) int {
+ return col*4 + row
+}
+
+// Row returns a vector representing the corresponding row (starting at row 0).
+// This package makes no distinction between row and column vectors, so it
+// will be a normal VecM for a MxN matrix.
+func (m Mat4) Row(row int) Vec4 {
+ return Vec4{m[row+0], m[row+4], m[row+8], m[row+12]}
+}
+
+// Rows decomposes a matrix into its corresponding row vectors.
+// This is equivalent to calling mat.Row for each row.
+func (m Mat4) Rows() (row0, row1, row2, row3 Vec4) {
+ return m.Row(0), m.Row(1), m.Row(2), m.Row(3)
+}
+
+// Col returns a vector representing the corresponding column (starting at col 0).
+// This package makes no distinction between row and column vectors, so it
+// will be a normal VecN for a MxN matrix.
+func (m Mat4) Col(col int) Vec4 {
+ return Vec4{m[col*4+0], m[col*4+1], m[col*4+2], m[col*4+3]}
+}
+
+// Cols decomposes a matrix into its corresponding column vectors.
+// This is equivalent to calling mat.Col for each column.
+func (m Mat4) Cols() (col0, col1, col2, col3 Vec4) {
+ return m.Col(0), m.Col(1), m.Col(2), m.Col(3)
+}
+
+// Trace is a basic operation on a square matrix that simply
+// sums up all elements on the main diagonal (meaning all elements such that row==col).
+func (m Mat4) Trace() float32 {
+ return m[0] + m[5] + m[10] + m[15]
+}
+
+// Abs returns the element-wise absolute value of this matrix
+func (m Mat4) Abs() Mat4 {
+ return Mat4{Abs(m[0]), Abs(m[1]), Abs(m[2]), Abs(m[3]), Abs(m[4]), Abs(m[5]), Abs(m[6]), Abs(m[7]), Abs(m[8]), Abs(m[9]), Abs(m[10]), Abs(m[11]), Abs(m[12]), Abs(m[13]), Abs(m[14]), Abs(m[15])}
+}
+
+// Pretty prints the matrix
+func (m Mat4) String() string {
+ buf := new(bytes.Buffer)
+ w := tabwriter.NewWriter(buf, 4, 4, 1, ' ', tabwriter.AlignRight)
+ for i := 0; i < 4; i++ {
+ for _, col := range m.Row(i) {
+ fmt.Fprintf(w, "%f\t", col)
+ }
+
+ fmt.Fprintln(w, "")
+ }
+ w.Flush()
+
+ return buf.String()
+}
diff --git a/archive/vendor/github.com/go-gl/mathgl/mgl32/matrix.tmpl b/archive/vendor/github.com/go-gl/mathgl/mgl32/matrix.tmpl
new file mode 100644
index 0000000..54aa6b0
--- /dev/null
+++ b/archive/vendor/github.com/go-gl/mathgl/mgl32/matrix.tmpl
@@ -0,0 +1,379 @@
+// Copyright 2014 The go-gl/mathgl Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// <<.Comment>>
+// Edit <<.TemplateName>> and run "go generate" to make changes.
+
+package mgl32
+
+import (
+ "bytes"
+ "fmt"
+ "text/tabwriter"
+)
+
+type Mat2 [2*2]float32
+type Mat2x3 [2*3]float32
+type Mat2x4 [2*4]float32
+type Mat3x2 [3*2]float32
+type Mat3 [3*3]float32
+type Mat3x4 [3*4]float32
+type Mat4x2 [4*2]float32
+type Mat4x3 [4*3]float32
+type Mat4 [4*4]float32
+
+func (m Mat2) Mat3() Mat3 {
+ col0, col1 := m.Cols()
+ return Mat3FromCols(
+ col0.Vec3(0),
+ col1.Vec3(0),
+ Vec3{0, 0, 1},
+ )
+}
+
+func (m Mat2) Mat4() Mat4 {
+ col0, col1 := m.Cols()
+ return Mat4FromCols(
+ col0.Vec4(0, 0),
+ col1.Vec4(0, 0),
+ Vec4{0, 0, 1, 0},
+ Vec4{0, 0, 0, 1},
+ )
+}
+
+func (m Mat3) Mat2() Mat2 {
+ col0, col1, _ := m.Cols()
+ return Mat2FromCols(
+ col0.Vec2(),
+ col1.Vec2(),
+ )
+}
+
+func (m Mat3) Mat4() Mat4 {
+ col0, col1, col2 := m.Cols()
+ return Mat4FromCols(
+ col0.Vec4(0),
+ col1.Vec4(0),
+ col2.Vec4(0),
+ Vec4{0, 0, 0, 1},
+ )
+}
+
+func (m Mat4) Mat2() Mat2 {
+ col0, col1, _, _ := m.Cols()
+ return Mat2FromCols(
+ col0.Vec2(),
+ col1.Vec2(),
+ )
+}
+
+func (m Mat4) Mat3() Mat3 {
+ col0, col1, col2, _ := m.Cols()
+ return Mat3FromCols(
+ col0.Vec3(),
+ col1.Vec3(),
+ col2.Vec3(),
+ )
+}
+
+
+<* Common functions for all matrices */>>
+<><>
+<<$type := typename $m $n>>
+
+// SetCol sets a Column within the Matrix, so it mutates the calling matrix.
+func (m *<<$type>>) SetCol(col int, v <>) {
+ <><>m[col*<<$m>>+<<$i>>]<> = <>
+}
+
+// SetRow sets a Row within the Matrix, so it mutates the calling matrix.
+func (m *<<$type>>) SetRow(row int, v <>) {
+ <><>m[row+<>]<> = <>
+}
+
+<>
+// Diag is a basic operation on a square matrix that simply
+// returns main diagonal (meaning all elements such that row==col).
+func (m <<$type>>) Diag() <> {
+ return <>{<>m[<>],<>}
+}
+<>
+
+<>
+// Ident<<$m>> returns the <<$m>>x<<$n>> identity matrix.
+// The identity matrix is a square matrix with the value 1 on its
+// diagonals. The characteristic property of the identity matrix is that
+// any matrix multiplied by it is itself. (MI = M; IN = N)
+func Ident<<$m>>() <<$type>> {
+ return <<$type>>{<><>1<>0<>,<>}
+}
+<>
+
+<>
+// Diag<<$m>> creates a diagonal matrix from the entries of the input vector.
+// That is, for each pointer for row==col, vector[row] is the entry. Otherwise it's 0.
+//
+// Another way to think about it is that the identity is this function where the every vector element is 1.
+func Diag<<$m>>(v <>) <<$type>> {
+ var m <<$type>>
+ <><>m[<>]<> = <>
+ return m
+}
+<>
+
+// <<$type>>FromRows builds a new matrix from row vectors.
+// The resulting matrix will still be in column major order, but this can be
+// good for hand-building matrices.
+
+func <<$type>>FromRows(<><>row<<$i>><> <>) <<$type>> {
+ return <<$type>>{<>row<<$i.M>>[<<$i.N>>],<>}
+}
+
+// <<$type>>FromCols builds a new matrix from column vectors.
+func <<$type>>FromCols(<> <>) <<$type>> {
+ return <<$type>>{<>col<<$i.N>>[<<$i.M>>], <>}
+}
+
+// Add performs an element-wise addition of two matrices, this is
+// equivalent to iterating over every element of m1 and adding the corresponding value of m2.
+func (m1 <<$type>>) Add(m2 <<$type>>) <<$type>> {
+ return <<$type>>{<< range $i := matiter $m $n>>m1[<<$i>>] + m2[<<$i>>], <>}
+}
+
+// Sub performs an element-wise subtraction of two matrices, this is
+// equivalent to iterating over every element of m1 and subtracting the corresponding value of m2.
+func (m1 <<$type>>) Sub(m2 <<$type>>) <<$type>> {
+ return <<$type>>{<< range $i := matiter $m $n>>m1[<<$i>>] - m2[<<$i>>], <>}
+}
+
+// Mul performs a scalar multiplcation of the matrix. This is equivalent to iterating
+// over every element of the matrix and multiply it by c.
+func (m1 <<$type>>) Mul(c float32) <<$type>> {
+ return <<$type>>{<< range $i := matiter $m $n>>m1[<<$i>>] * c, <>}
+}
+
+<>
+// Mul<<$n>><>x<<$o>><> performs a "matrix product" between this matrix
+// and another of the given dimension. For any two matrices of dimensionality
+// MxN and NxO, the result will be MxO. For instance, Mat4 multiplied using
+// Mul4x2 will result in a Mat4x2.
+func (m1 <<$type>>) Mul<<$n>><>x<<$o>><>(m2 <>) <> {
+ return <>{<>
+ <><>m1[<>]*m2[<>]<>,<>
+ }
+}
+<>
+
+// Transpose produces the transpose of this matrix. For any MxN matrix
+// the transpose is an NxM matrix with the rows swapped with the columns. For instance
+// the transpose of the Mat3x2 is a Mat2x3 like so:
+//
+// [[a b]] [[a c e]]
+// [[c d]] = [[b d f]]
+// [[e f]]
+func (m1 <<$type>>) Transpose() <> {
+ return <>{<>m1[<>], <>}
+}
+
+<>
+// Det returns the determinant of a matrix. It is a measure of a square matrix's
+// singularity and invertability, among other things. In this library, the
+// determinant is hard coded based on pre-computed cofactor expansion, and uses
+// no loops. Of course, the addition and multiplication must still be done.
+func (m <<$type>>) Det() float32 {
+ <>
+ return m[0]*m[3] - m[1]*m[2]
+ <>
+ return m[0]*m[4]*m[8] + m[3]*m[7]*m[2] + m[6]*m[1]*m[5] - m[6]*m[4]*m[2] - m[3]*m[1]*m[8] - m[0]*m[7]*m[5]
+ <>
+ return m[0]*m[5]*m[10]*m[15] - m[0]*m[5]*m[11]*m[14] - m[0]*m[6]*m[9]*m[15] + m[0]*m[6]*m[11]*m[13] + m[0]*m[7]*m[9]*m[14] - m[0]*m[7]*m[10]*m[13] - m[1]*m[4]*m[10]*m[15] + m[1]*m[4]*m[11]*m[14] + m[1]*m[6]*m[8]*m[15] - m[1]*m[6]*m[11]*m[12] - m[1]*m[7]*m[8]*m[14] + m[1]*m[7]*m[10]*m[12] + m[2]*m[4]*m[9]*m[15] - m[2]*m[4]*m[11]*m[13] - m[2]*m[5]*m[8]*m[15] + m[2]*m[5]*m[11]*m[12] + m[2]*m[7]*m[8]*m[13] - m[2]*m[7]*m[9]*m[12] - m[3]*m[4]*m[9]*m[14] + m[3]*m[4]*m[10]*m[13] + m[3]*m[5]*m[8]*m[14] - m[3]*m[5]*m[10]*m[12] - m[3]*m[6]*m[8]*m[13] + m[3]*m[6]*m[9]*m[12]
+ <>
+}
+<>
+
+<>
+// Inv computes the inverse of a square matrix. An inverse is a square matrix such that when multiplied by the
+// original, yields the identity.
+//
+// M_inv * M = M * M_inv = I
+//
+// In this library, the math is precomputed, and uses no loops, though the multiplications, additions, determinant calculation, and scaling
+// are still done. This can still be (relatively) expensive for a 4x4.
+//
+// This function checks the determinant to see if the matrix is invertible.
+// If the determinant is 0.0, this function returns the zero matrix. However, due to floating point errors, it is
+// entirely plausible to get a false positive or negative.
+// In the future, an alternate function may be written which takes in a pre-computed determinant.
+func (m <<$type>>) Inv() <<$type>> {
+ det := m.Det()
+ if FloatEqual(det, float32(0.0)) {
+ return <<$type>>{}
+ }
+ <>
+ retMat := Mat2{m[3], -m[1], -m[2], m[0]}
+ <>
+ retMat := Mat3{
+ m[4]*m[8] - m[5]*m[7],
+ m[2]*m[7] - m[1]*m[8],
+ m[1]*m[5] - m[2]*m[4],
+ m[5]*m[6] - m[3]*m[8],
+ m[0]*m[8] - m[2]*m[6],
+ m[2]*m[3] - m[0]*m[5],
+ m[3]*m[7] - m[4]*m[6],
+ m[1]*m[6] - m[0]*m[7],
+ m[0]*m[4] - m[1]*m[3],
+ }
+ <>
+ retMat := Mat4{
+ -m[7]*m[10]*m[13] + m[6]*m[11]*m[13] + m[7]*m[9]*m[14] - m[5]*m[11]*m[14] - m[6]*m[9]*m[15] + m[5]*m[10]*m[15],
+ m[3]*m[10]*m[13] - m[2]*m[11]*m[13] - m[3]*m[9]*m[14] + m[1]*m[11]*m[14] + m[2]*m[9]*m[15] - m[1]*m[10]*m[15],
+ -m[3]*m[6]*m[13] + m[2]*m[7]*m[13] + m[3]*m[5]*m[14] - m[1]*m[7]*m[14] - m[2]*m[5]*m[15] + m[1]*m[6]*m[15],
+ m[3]*m[6]*m[9] - m[2]*m[7]*m[9] - m[3]*m[5]*m[10] + m[1]*m[7]*m[10] + m[2]*m[5]*m[11] - m[1]*m[6]*m[11],
+ m[7]*m[10]*m[12] - m[6]*m[11]*m[12] - m[7]*m[8]*m[14] + m[4]*m[11]*m[14] + m[6]*m[8]*m[15] - m[4]*m[10]*m[15],
+ -m[3]*m[10]*m[12] + m[2]*m[11]*m[12] + m[3]*m[8]*m[14] - m[0]*m[11]*m[14] - m[2]*m[8]*m[15] + m[0]*m[10]*m[15],
+ m[3]*m[6]*m[12] - m[2]*m[7]*m[12] - m[3]*m[4]*m[14] + m[0]*m[7]*m[14] + m[2]*m[4]*m[15] - m[0]*m[6]*m[15],
+ -m[3]*m[6]*m[8] + m[2]*m[7]*m[8] + m[3]*m[4]*m[10] - m[0]*m[7]*m[10] - m[2]*m[4]*m[11] + m[0]*m[6]*m[11],
+ -m[7]*m[9]*m[12] + m[5]*m[11]*m[12] + m[7]*m[8]*m[13] - m[4]*m[11]*m[13] - m[5]*m[8]*m[15] + m[4]*m[9]*m[15],
+ m[3]*m[9]*m[12] - m[1]*m[11]*m[12] - m[3]*m[8]*m[13] + m[0]*m[11]*m[13] + m[1]*m[8]*m[15] - m[0]*m[9]*m[15],
+ -m[3]*m[5]*m[12] + m[1]*m[7]*m[12] + m[3]*m[4]*m[13] - m[0]*m[7]*m[13] - m[1]*m[4]*m[15] + m[0]*m[5]*m[15],
+ m[3]*m[5]*m[8] - m[1]*m[7]*m[8] - m[3]*m[4]*m[9] + m[0]*m[7]*m[9] + m[1]*m[4]*m[11] - m[0]*m[5]*m[11],
+ m[6]*m[9]*m[12] - m[5]*m[10]*m[12] - m[6]*m[8]*m[13] + m[4]*m[10]*m[13] + m[5]*m[8]*m[14] - m[4]*m[9]*m[14],
+ -m[2]*m[9]*m[12] + m[1]*m[10]*m[12] + m[2]*m[8]*m[13] - m[0]*m[10]*m[13] - m[1]*m[8]*m[14] + m[0]*m[9]*m[14],
+ m[2]*m[5]*m[12] - m[1]*m[6]*m[12] - m[2]*m[4]*m[13] + m[0]*m[6]*m[13] + m[1]*m[4]*m[14] - m[0]*m[5]*m[14],
+ -m[2]*m[5]*m[8] + m[1]*m[6]*m[8] + m[2]*m[4]*m[9] - m[0]*m[6]*m[9] - m[1]*m[4]*m[10] + m[0]*m[5]*m[10],
+ }
+ <>
+ return retMat.Mul(1 / det)
+}
+<>
+
+// ApproxEqual performs an element-wise approximate equality test between two matrices,
+// as if FloatEqual had been used.
+func (m1 <<$type>>) ApproxEqual(m2 <<$type>>) bool {
+ for i := range m1 {
+ if !FloatEqual(m1[i], m2[i]) {
+ return false
+ }
+ }
+ return true
+}
+
+// ApproxEqualThreshold performs an element-wise approximate equality test between two matrices
+// with a given epsilon threshold, as if FloatEqualThreshold had been used.
+func (m1 <<$type>>) ApproxEqualThreshold(m2 <<$type>>, threshold float32) bool {
+ for i := range m1 {
+ if !FloatEqualThreshold(m1[i], m2[i], threshold) {
+ return false
+ }
+ }
+ return true
+}
+
+// ApproxFuncEqual performs an element-wise approximate equality test between two matrices
+// with a given equality functions, intended to be used with FloatEqualFunc; although and comparison
+// function may be used in practice.
+func (m1 <<$type>>) ApproxFuncEqual(m2 <<$type>>, eq func(float32, float32) bool) bool {
+ for i := range m1 {
+ if !eq(m1[i], m2[i]) {
+ return false
+ }
+ }
+ return true
+}
+
+// NumRows returns the number of rows in this matrix
+func (m <<$type>>) NumRows() int {
+ return <<$m>>
+}
+
+// NumCols returns the number of columns in this matrix
+func (m <<$type>>) NumCols() int {
+ return <<$n>>
+}
+
+// At returns the matrix element at the given row and column.
+// This is equivalent to mat[col * numRow + row] where numRow is constant
+// (E.G. for a Mat3x2 it's equal to 3)
+//
+// This method is garbage-in garbage-out. For instance, on a Mat4 asking for
+// At(5,0) will work just like At(1,1). Or it may panic if it's out of bounds.
+func (m <<$type>>) At(row, col int) float32 {
+ return m[col*<<$m>>+row]
+}
+
+// Set sets the corresponding matrix element at the given row and column.
+// This has a pointer receiver because it mutates the matrix.
+//
+// This method is garbage-in garbage-out. For instance, on a Mat4 asking for
+// Set(5,0,val) will work just like Set(1,1,val). Or it may panic if it's out of bounds.
+func (m *<<$type>>) Set(row, col int, value float32) {
+ m[col*<<$m>>+row] = value
+}
+
+// Index returns the index of the given row and column, to be used with direct
+// access. E.G. Index(0,0) = 0.
+//
+// This is a garbage-in garbage-out method. For instance, on a Mat4 asking for the index of
+// (5,0) will work the same as asking for (1,1). Or it may give you a value that will cause
+// a panic if you try to access the array with it if it's truly out of bounds.
+func (m <<$type>>) Index(row, col int) int {
+ return col*<<$m>> + row
+}
+
+// Row returns a vector representing the corresponding row (starting at row 0).
+// This package makes no distinction between row and column vectors, so it
+// will be a normal VecM for a MxN matrix.
+func (m <<$type>>) Row(row int) <> {
+ return <>{<>m[row+<>],<>}
+}
+
+// Rows decomposes a matrix into its corresponding row vectors.
+// This is equivalent to calling mat.Row for each row.
+func (m <<$type>>) Rows() (<> <>) {
+ return <>
+}
+
+// Col returns a vector representing the corresponding column (starting at col 0).
+// This package makes no distinction between row and column vectors, so it
+// will be a normal VecN for a MxN matrix.
+func (m <<$type>>) Col(col int) <> {
+ return <>{<>m[col*<<$m>>+<<$i>>],<>}
+}
+
+// Cols decomposes a matrix into its corresponding column vectors.
+// This is equivalent to calling mat.Col for each column.
+func (m <<$type>>) Cols() (<> <>) {
+ return <>
+}
+
+<>
+// Trace is a basic operation on a square matrix that simply
+// sums up all elements on the main diagonal (meaning all elements such that row==col).
+func (m <<$type>>) Trace() float32 {
+ return <><> m[<>]<>
+}
+<>
+
+// Abs returns the element-wise absolute value of this matrix
+func (m <<$type>>) Abs() <<$type>> {
+ return <<$type>>{<>}
+}
+
+// Pretty prints the matrix
+func (m <<$type>>) String() string {
+ buf := new(bytes.Buffer)
+ w := tabwriter.NewWriter(buf, 4, 4, 1, ' ', tabwriter.AlignRight)
+ for i := 0; i < <<$m>>; i++ {
+ for _, col := range m.Row(i) {
+ fmt.Fprintf(w, "%f\t", col)
+ }
+
+ fmt.Fprintln(w, "")
+ }
+ w.Flush()
+
+ return buf.String()
+}
+
+<><> <* range $m range $n */>>
diff --git a/archive/vendor/github.com/go-gl/mathgl/mgl32/mempool.go b/archive/vendor/github.com/go-gl/mathgl/mgl32/mempool.go
new file mode 100644
index 0000000..9c27151
--- /dev/null
+++ b/archive/vendor/github.com/go-gl/mathgl/mgl32/mempool.go
@@ -0,0 +1,121 @@
+// Copyright 2014 The go-gl Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package mgl32
+
+import (
+ "sync"
+)
+
+var (
+ slicePools []*sync.Pool
+ listLock sync.RWMutex
+)
+
+var shouldPool = true
+
+func DisableMemoryPooling() {
+ shouldPool = false
+}
+
+// Returns the given memory pool. If the pool doesn't exist, it will
+// create all pools up to element i. The number "i" corresponds to "p"
+// in most other comments. That is, it's Ceil(log_2(whatever)). So i=0
+// means you'll get the pool for slices of size 1, i=1 for size 2, i=2 for size 4,
+// and so on.
+//
+// This is concurrency safe and uses an RWMutex to protect the list expansion.
+func getPool(i int) *sync.Pool {
+ listLock.RLock()
+ if i >= len(slicePools) {
+
+ // Promote to a write lock because we now
+ // need to mutate the pool
+ listLock.RUnlock()
+ listLock.Lock()
+ defer listLock.Unlock()
+
+ for n := i - len(slicePools); n >= 0; n-- {
+ newFunc := genPoolNew(1 << uint(len(slicePools)))
+ slicePools = append(slicePools, &sync.Pool{New: newFunc})
+ }
+ } else {
+ defer listLock.RUnlock()
+ }
+
+ return slicePools[i]
+}
+
+func genPoolNew(i int) func() interface{} {
+ return func() interface{} {
+ return make([]float32, 0, i)
+ }
+}
+
+// Grabs a slice from the memory pool, such that its cap
+// is 2^p where p is Ceil(log_2(size)). It will be downsliced
+// such that the len is size.
+func grabFromPool(size int) []float32 {
+ pool, exact := binLog(size)
+
+ // Tried to grab something of size
+ // zero or less
+ if pool == -1 {
+ return nil
+ }
+
+ // If the log is not exact, we
+ // need to "overallocate" so we have
+ // log+1
+ if !exact {
+ pool++
+ }
+
+ slice := getPool(pool).Get().([]float32)
+ slice = slice[:size]
+ return slice
+}
+
+// Returns a slice to the appropriate pool. If the slice does not have a cap that's precisely
+// a power of 2, this will panic.
+func returnToPool(slice []float32) {
+ if cap(slice) == 0 {
+ return
+ }
+
+ pool, exact := binLog(cap(slice))
+
+ if !exact {
+ panic("attempt to pool slice with non-exact cap. If you're a user, please file an issue with github.com/go-gl/mathgl about this bug. This should never happen.")
+ }
+
+ getPool(pool).Put(slice)
+}
+
+// This returns the integer base 2 log of the value
+// and whether the log is exact or rounded down.
+//
+// This is only for positive integers.
+//
+// There are faster ways to do this, I'm open to suggestions. Most rely on knowing system endianness
+// which Go makes hard to do. I'm hesistant to use float conversions and the math package because of off-by-one errors.
+func binLog(val int) (int, bool) {
+ if val <= 0 {
+ return -1, false
+ }
+
+ exact := true
+ l := 0
+ for ; val > 1; val = val >> 1 {
+ // If the current lsb is 1 and the number
+ // is not equal to 1, this is not an exact
+ // log, but rather a rounding of it
+ if val&1 != 0 {
+ exact = false
+ }
+ l++
+ }
+
+ return l, exact
+}
diff --git a/archive/vendor/github.com/go-gl/mathgl/mgl32/project.go b/archive/vendor/github.com/go-gl/mathgl/mgl32/project.go
new file mode 100644
index 0000000..07c074e
--- /dev/null
+++ b/archive/vendor/github.com/go-gl/mathgl/mgl32/project.go
@@ -0,0 +1,109 @@
+// Copyright 2014 The go-gl Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package mgl32
+
+import (
+ "errors"
+ "math"
+)
+
+// Ortho generates an Ortho Matrix.
+func Ortho(left, right, bottom, top, near, far float32) Mat4 {
+ rml, tmb, fmn := (right - left), (top - bottom), (far - near)
+
+ return Mat4{float32(2. / rml), 0, 0, 0, 0, float32(2. / tmb), 0, 0, 0, 0, float32(-2. / fmn), 0, float32(-(right + left) / rml), float32(-(top + bottom) / tmb), float32(-(far + near) / fmn), 1}
+}
+
+// Ortho2D is equivalent to Ortho with the near and far planes being -1 and 1,
+// respectively.
+func Ortho2D(left, right, bottom, top float32) Mat4 {
+ return Ortho(left, right, bottom, top, -1, 1)
+}
+
+// Perspective generates a Perspective Matrix.
+func Perspective(fovy, aspect, near, far float32) Mat4 {
+ // fovy = (fovy * math.Pi) / 180.0 // convert from degrees to radians
+ nmf, f := near-far, float32(1./math.Tan(float64(fovy)/2.0))
+
+ return Mat4{float32(f / aspect), 0, 0, 0, 0, float32(f), 0, 0, 0, 0, float32((near + far) / nmf), -1, 0, 0, float32((2. * far * near) / nmf), 0}
+}
+
+// Frustum generates a Frustum Matrix.
+func Frustum(left, right, bottom, top, near, far float32) Mat4 {
+ rml, tmb, fmn := (right - left), (top - bottom), (far - near)
+ A, B, C, D := (right+left)/rml, (top+bottom)/tmb, -(far+near)/fmn, -(2*far*near)/fmn
+
+ return Mat4{float32((2. * near) / rml), 0, 0, 0, 0, float32((2. * near) / tmb), 0, 0, float32(A), float32(B), float32(C), -1, 0, 0, float32(D), 0}
+}
+
+// LookAt generates a transform matrix from world space to the given eye space.
+func LookAt(eyeX, eyeY, eyeZ, centerX, centerY, centerZ, upX, upY, upZ float32) Mat4 {
+ return LookAtV(Vec3{eyeX, eyeY, eyeZ}, Vec3{centerX, centerY, centerZ}, Vec3{upX, upY, upZ})
+}
+
+// LookAtV generates a transform matrix from world space into the specific eye
+// space.
+func LookAtV(eye, center, up Vec3) Mat4 {
+ f := center.Sub(eye).Normalize()
+ s := f.Cross(up).Normalize()
+ u := s.Cross(f)
+
+ M := Mat4{
+ s[0], u[0], -f[0], 0,
+ s[1], u[1], -f[1], 0,
+ s[2], u[2], -f[2], 0,
+ 0, 0, 0, 1,
+ }
+
+ return M.Mul4(Translate3D(float32(-eye[0]), float32(-eye[1]), float32(-eye[2])))
+}
+
+// Project transforms a set of coordinates from object space (in obj) to window
+// coordinates (with depth).
+//
+// Window coordinates are continuous, not discrete (well, as continuous as an
+// IEEE Floating Point can be), so you won't get exact pixel locations without
+// rounding or similar
+func Project(obj Vec3, modelview, projection Mat4, initialX, initialY, width, height int) (win Vec3) {
+ obj4 := obj.Vec4(1)
+
+ vpp := projection.Mul4(modelview).Mul4x1(obj4)
+ vpp = vpp.Mul(1 / vpp.W())
+ win[0] = float32(initialX) + (float32(width)*(vpp[0]+1))/2
+ win[1] = float32(initialY) + (float32(height)*(vpp[1]+1))/2
+ win[2] = (vpp[2] + 1) / 2
+
+ return win
+}
+
+// UnProject transforms a set of window coordinates to object space. If your MVP
+// (projection.Mul(modelview) matrix is not invertible, this will return an
+// error.
+//
+// Note that the projection may not be perfect if you use strict pixel locations
+// rather than the exact values given by Projectf. (It's still unlikely to be
+// perfect due to precision errors, but it will be closer)
+func UnProject(win Vec3, modelview, projection Mat4, initialX, initialY, width, height int) (obj Vec3, err error) {
+ inv := projection.Mul4(modelview).Inv()
+ var blank Mat4
+ if inv == blank {
+ return Vec3{}, errors.New("Could not find matrix inverse (projection times modelview is probably non-singular)")
+ }
+
+ obj4 := inv.Mul4x1(Vec4{
+ (2 * (win[0] - float32(initialX)) / float32(width)) - 1,
+ (2 * (win[1] - float32(initialY)) / float32(height)) - 1,
+ 2*win[2] - 1,
+ 1.0,
+ })
+ obj = obj4.Vec3()
+
+ //if obj4[3] > MinValue {}
+ obj[0] /= obj4[3]
+ obj[1] /= obj4[3]
+ obj[2] /= obj4[3]
+
+ return obj, nil
+}
diff --git a/archive/vendor/github.com/go-gl/mathgl/mgl32/quat.go b/archive/vendor/github.com/go-gl/mathgl/mgl32/quat.go
new file mode 100644
index 0000000..9825b32
--- /dev/null
+++ b/archive/vendor/github.com/go-gl/mathgl/mgl32/quat.go
@@ -0,0 +1,469 @@
+// Copyright 2014 The go-gl Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package mgl32
+
+import (
+ "math"
+)
+
+// RotationOrder is the order in which rotations will be transformed for the
+// purposes of AnglesToQuat.
+type RotationOrder int
+
+// The RotationOrder constants represent a series of rotations along the given
+// axes for the use of AnglesToQuat.
+const (
+ XYX RotationOrder = iota
+ XYZ
+ XZX
+ XZY
+ YXY
+ YXZ
+ YZY
+ YZX
+ ZYZ
+ ZYX
+ ZXZ
+ ZXY
+)
+
+// Quat represents a Quaternion, which is an extension of the imaginary numbers;
+// there's all sorts of interesting theory behind it. In 3D graphics we mostly
+// use it as a cheap way of representing rotation since quaternions are cheaper
+// to multiply by, and easier to interpolate than matrices.
+//
+// A Quaternion has two parts: W, the so-called scalar component, and "V", the
+// vector component. The vector component is considered to be the part in 3D
+// space, while W (loosely interpreted) is its 4D coordinate.
+type Quat struct {
+ W float32
+ V Vec3
+}
+
+// QuatIdent returns the quaternion identity: W=1; V=(0,0,0).
+//
+// As with all identities, multiplying any quaternion by this will yield the same
+// quaternion you started with.
+func QuatIdent() Quat {
+ return Quat{1., Vec3{0, 0, 0}}
+}
+
+// QuatRotate creates an angle from an axis and an angle relative to that axis.
+//
+// This is cheaper than HomogRotate3D.
+func QuatRotate(angle float32, axis Vec3) Quat {
+ // angle = (float32(math.Pi) * angle) / 180.0
+
+ sn, cs := math.Sincos(float64(angle / 2))
+ s, c := float32(sn), float32(cs)
+
+ return Quat{c, axis.Mul(s)}
+}
+
+// X is a convenient alias for q.V[0]
+func (q Quat) X() float32 {
+ return q.V[0]
+}
+
+// Y is a convenient alias for q.V[1]
+func (q Quat) Y() float32 {
+ return q.V[1]
+}
+
+// Z is a convenient alias for q.V[2]
+func (q Quat) Z() float32 {
+ return q.V[2]
+}
+
+// Add adds two quaternions. It's no more complicated than
+// adding their W and V components.
+func (q1 Quat) Add(q2 Quat) Quat {
+ return Quat{q1.W + q2.W, q1.V.Add(q2.V)}
+}
+
+// Sub subtracts two quaternions. It's no more complicated than
+// subtracting their W and V components.
+func (q1 Quat) Sub(q2 Quat) Quat {
+ return Quat{q1.W - q2.W, q1.V.Sub(q2.V)}
+}
+
+// Mul multiplies two quaternions. This can be seen as a rotation. Note that
+// Multiplication is NOT commutative, meaning q1.Mul(q2) does not necessarily
+// equal q2.Mul(q1).
+func (q1 Quat) Mul(q2 Quat) Quat {
+ return Quat{q1.W*q2.W - q1.V.Dot(q2.V), q1.V.Cross(q2.V).Add(q2.V.Mul(q1.W)).Add(q1.V.Mul(q2.W))}
+}
+
+// Scale every element of the quaternion by some constant factor.
+func (q1 Quat) Scale(c float32) Quat {
+ return Quat{q1.W * c, Vec3{q1.V[0] * c, q1.V[1] * c, q1.V[2] * c}}
+}
+
+// Conjugate returns the conjugate of a quaternion. Equivalent to
+// Quat{q1.W, q1.V.Mul(-1)}.
+func (q1 Quat) Conjugate() Quat {
+ return Quat{q1.W, q1.V.Mul(-1)}
+}
+
+// Len gives the Length of the quaternion, also known as its Norm. This is the
+// same thing as the Len of a Vec4.
+func (q1 Quat) Len() float32 {
+ return float32(math.Sqrt(float64(q1.W*q1.W + q1.V[0]*q1.V[0] + q1.V[1]*q1.V[1] + q1.V[2]*q1.V[2])))
+}
+
+// Norm is an alias for Len() since both are very common terms.
+func (q1 Quat) Norm() float32 {
+ return q1.Len()
+}
+
+// Normalize the quaternion, returning its versor (unit quaternion).
+//
+// This is the same as normalizing it as a Vec4.
+func (q1 Quat) Normalize() Quat {
+ length := q1.Len()
+
+ if FloatEqual(1, length) {
+ return q1
+ }
+ if length == 0 {
+ return QuatIdent()
+ }
+ if length == InfPos {
+ length = MaxValue
+ }
+
+ return Quat{q1.W * 1 / length, q1.V.Mul(1 / length)}
+}
+
+// Inverse of a quaternion. The inverse is equivalent
+// to the conjugate divided by the square of the length.
+//
+// This method computes the square norm by directly adding the sum
+// of the squares of all terms instead of actually squaring q1.Len(),
+// both for performance and precision.
+func (q1 Quat) Inverse() Quat {
+ return q1.Conjugate().Scale(1 / q1.Dot(q1))
+}
+
+// Rotate a vector by the rotation this quaternion represents.
+// This will result in a 3D vector. Strictly speaking, this is
+// equivalent to q1.v.q* where the "."" is quaternion multiplication and v is interpreted
+// as a quaternion with W 0 and V v. In code:
+// q1.Mul(Quat{0,v}).Mul(q1.Conjugate()), and
+// then retrieving the imaginary (vector) part.
+//
+// In practice, we hand-compute this in the general case and simplify
+// to save a few operations.
+func (q1 Quat) Rotate(v Vec3) Vec3 {
+ cross := q1.V.Cross(v)
+ // v + 2q_w * (q_v x v) + 2q_v x (q_v x v)
+ return v.Add(cross.Mul(2 * q1.W)).Add(q1.V.Mul(2).Cross(cross))
+}
+
+// Mat4 returns the homogeneous 3D rotation matrix corresponding to the
+// quaternion.
+func (q1 Quat) Mat4() Mat4 {
+ w, x, y, z := q1.W, q1.V[0], q1.V[1], q1.V[2]
+ return Mat4{
+ 1 - 2*y*y - 2*z*z, 2*x*y + 2*w*z, 2*x*z - 2*w*y, 0,
+ 2*x*y - 2*w*z, 1 - 2*x*x - 2*z*z, 2*y*z + 2*w*x, 0,
+ 2*x*z + 2*w*y, 2*y*z - 2*w*x, 1 - 2*x*x - 2*y*y, 0,
+ 0, 0, 0, 1,
+ }
+}
+
+// Dot product between two quaternions, equivalent to if this was a Vec4.
+func (q1 Quat) Dot(q2 Quat) float32 {
+ return q1.W*q2.W + q1.V[0]*q2.V[0] + q1.V[1]*q2.V[1] + q1.V[2]*q2.V[2]
+}
+
+// ApproxEqual returns whether the quaternions are approximately equal, as if
+// FloatEqual was called on each matching element
+func (q1 Quat) ApproxEqual(q2 Quat) bool {
+ return FloatEqual(q1.W, q2.W) && q1.V.ApproxEqual(q2.V)
+}
+
+// ApproxEqualThreshold returns whether the quaternions are approximately equal with a given tolerence, as if
+// FloatEqualThreshold was called on each matching element with the given epsilon
+func (q1 Quat) ApproxEqualThreshold(q2 Quat, epsilon float32) bool {
+ return FloatEqualThreshold(q1.W, q2.W, epsilon) && q1.V.ApproxEqualThreshold(q2.V, epsilon)
+}
+
+// ApproxEqualFunc returns whether the quaternions are approximately equal using the given comparison function, as if
+// the function had been called on each individual element
+func (q1 Quat) ApproxEqualFunc(q2 Quat, f func(float32, float32) bool) bool {
+ return f(q1.W, q2.W) && q1.V.ApproxFuncEqual(q2.V, f)
+}
+
+// OrientationEqual returns whether the quaternions represents the same orientation
+//
+// Different values can represent the same orientation (q == -q) because quaternions avoid singularities
+// and discontinuities involved with rotation in 3 dimensions by adding extra dimensions
+func (q1 Quat) OrientationEqual(q2 Quat) bool {
+ return q1.OrientationEqualThreshold(q2, Epsilon)
+}
+
+// OrientationEqualThreshold returns whether the quaternions represents the same orientation with a given tolerence
+func (q1 Quat) OrientationEqualThreshold(q2 Quat, epsilon float32) bool {
+ return Abs(q1.Normalize().Dot(q2.Normalize())) > 1-epsilon
+}
+
+// QuatSlerp is *S*pherical *L*inear Int*erp*olation, a method of interpolating
+// between two quaternions. This always takes the straightest and shortest path on the sphere between
+// the two quaternions, and maintains constant velocity.
+//
+// However, it's expensive and QuatSlerp(q1,q2) is not the same as QuatSlerp(q2,q1)
+func QuatSlerp(q1, q2 Quat, amount float32) Quat {
+ q1, q2 = q1.Normalize(), q2.Normalize()
+ dot := q1.Dot(q2)
+
+ // Make sure we take the shortest path in case dot product is negative.
+ if dot < 0.0 {
+ q2 = q2.Scale(-1)
+ dot = -dot
+ }
+
+ // If the inputs are too close for comfort, linearly interpolate and normalize the result.
+ if dot > 0.9995 {
+ return QuatNlerp(q1, q2, amount)
+ }
+
+ // This is here for precision errors, I'm perfectly aware that *technically* the dot is bound [-1,1], but since Acos will freak out if it's not (even if it's just a liiiiitle bit over due to normal error) we need to clamp it
+ dot = Clamp(dot, -1, 1)
+
+ theta := float32(math.Acos(float64(dot))) * amount
+ sn, cs := math.Sincos(float64(theta))
+ s, c := float32(sn), float32(cs)
+ rel := q2.Sub(q1.Scale(dot)).Normalize()
+
+ return q1.Scale(c).Add(rel.Scale(s))
+}
+
+// QuatLerp is a *L*inear Int*erp*olation between two Quaternions, cheap and simple.
+//
+// Not excessively useful, but uses can be found.
+func QuatLerp(q1, q2 Quat, amount float32) Quat {
+ return q1.Add(q2.Sub(q1).Scale(amount))
+}
+
+// QuatNlerp is a *Normalized* *L*inear Int*erp*olation between two Quaternions. Cheaper than Slerp
+// and usually just as good. This is literally Lerp with Normalize() called on it.
+//
+// Unlike Slerp, constant velocity isn't maintained, but it's much faster and
+// Nlerp(q1,q2) and Nlerp(q2,q1) return the same path. You should probably
+// use this more often unless you're suffering from choppiness due to the
+// non-constant velocity problem.
+func QuatNlerp(q1, q2 Quat, amount float32) Quat {
+ return QuatLerp(q1, q2, amount).Normalize()
+}
+
+// AnglesToQuat performs a rotation in the specified order. If the order is not
+// a valid RotationOrder, this function will panic
+//
+// The rotation "order" is more of an axis descriptor. For instance XZX would
+// tell the function to interpret angle1 as a rotation about the X axis, angle2 about
+// the Z axis, and angle3 about the X axis again.
+//
+// Based off the code for the Matlab function "angle2quat", though this implementation
+// only supports 3 single angles as opposed to multiple angles.
+func AnglesToQuat(angle1, angle2, angle3 float32, order RotationOrder) Quat {
+ var s [3]float64
+ var c [3]float64
+
+ s[0], c[0] = math.Sincos(float64(angle1 / 2))
+ s[1], c[1] = math.Sincos(float64(angle2 / 2))
+ s[2], c[2] = math.Sincos(float64(angle3 / 2))
+
+ ret := Quat{}
+ switch order {
+ case ZYX:
+ ret.W = float32(c[0]*c[1]*c[2] + s[0]*s[1]*s[2])
+ ret.V = Vec3{float32(c[0]*c[1]*s[2] - s[0]*s[1]*c[2]),
+ float32(c[0]*s[1]*c[2] + s[0]*c[1]*s[2]),
+ float32(s[0]*c[1]*c[2] - c[0]*s[1]*s[2]),
+ }
+ case ZYZ:
+ ret.W = float32(c[0]*c[1]*c[2] - s[0]*c[1]*s[2])
+ ret.V = Vec3{float32(c[0]*s[1]*s[2] - s[0]*s[1]*c[2]),
+ float32(c[0]*s[1]*c[2] + s[0]*s[1]*s[2]),
+ float32(s[0]*c[1]*c[2] + c[0]*c[1]*s[2]),
+ }
+ case ZXY:
+ ret.W = float32(c[0]*c[1]*c[2] - s[0]*s[1]*s[2])
+ ret.V = Vec3{float32(c[0]*s[1]*c[2] - s[0]*c[1]*s[2]),
+ float32(c[0]*c[1]*s[2] + s[0]*s[1]*c[2]),
+ float32(c[0]*s[1]*s[2] + s[0]*c[1]*c[2]),
+ }
+ case ZXZ:
+ ret.W = float32(c[0]*c[1]*c[2] - s[0]*c[1]*s[2])
+ ret.V = Vec3{float32(c[0]*s[1]*c[2] + s[0]*s[1]*s[2]),
+ float32(s[0]*s[1]*c[2] - c[0]*s[1]*s[2]),
+ float32(c[0]*c[1]*s[2] + s[0]*c[1]*c[2]),
+ }
+ case YXZ:
+ ret.W = float32(c[0]*c[1]*c[2] + s[0]*s[1]*s[2])
+ ret.V = Vec3{float32(c[0]*s[1]*c[2] + s[0]*c[1]*s[2]),
+ float32(s[0]*c[1]*c[2] - c[0]*s[1]*s[2]),
+ float32(c[0]*c[1]*s[2] - s[0]*s[1]*c[2]),
+ }
+ case YXY:
+ ret.W = float32(c[0]*c[1]*c[2] - s[0]*c[1]*s[2])
+ ret.V = Vec3{float32(c[0]*s[1]*c[2] + s[0]*s[1]*s[2]),
+ float32(s[0]*c[1]*c[2] + c[0]*c[1]*s[2]),
+ float32(c[0]*s[1]*s[2] - s[0]*s[1]*c[2]),
+ }
+ case YZX:
+ ret.W = float32(c[0]*c[1]*c[2] - s[0]*s[1]*s[2])
+ ret.V = Vec3{float32(c[0]*c[1]*s[2] + s[0]*s[1]*c[2]),
+ float32(c[0]*s[1]*s[2] + s[0]*c[1]*c[2]),
+ float32(c[0]*s[1]*c[2] - s[0]*c[1]*s[2]),
+ }
+ case YZY:
+ ret.W = float32(c[0]*c[1]*c[2] - s[0]*c[1]*s[2])
+ ret.V = Vec3{float32(s[0]*s[1]*c[2] - c[0]*s[1]*s[2]),
+ float32(c[0]*c[1]*s[2] + s[0]*c[1]*c[2]),
+ float32(c[0]*s[1]*c[2] + s[0]*s[1]*s[2]),
+ }
+ case XYZ:
+ ret.W = float32(c[0]*c[1]*c[2] - s[0]*s[1]*s[2])
+ ret.V = Vec3{float32(c[0]*s[1]*s[2] + s[0]*c[1]*c[2]),
+ float32(c[0]*s[1]*c[2] - s[0]*c[1]*s[2]),
+ float32(c[0]*c[1]*s[2] + s[0]*s[1]*c[2]),
+ }
+ case XYX:
+ ret.W = float32(c[0]*c[1]*c[2] - s[0]*c[1]*s[2])
+ ret.V = Vec3{float32(c[0]*c[1]*s[2] + s[0]*c[1]*c[2]),
+ float32(c[0]*s[1]*c[2] + s[0]*s[1]*s[2]),
+ float32(s[0]*s[1]*c[2] - c[0]*s[1]*s[2]),
+ }
+ case XZY:
+ ret.W = float32(c[0]*c[1]*c[2] + s[0]*s[1]*s[2])
+ ret.V = Vec3{float32(s[0]*c[1]*c[2] - c[0]*s[1]*s[2]),
+ float32(c[0]*c[1]*s[2] - s[0]*s[1]*c[2]),
+ float32(c[0]*s[1]*c[2] + s[0]*c[1]*s[2]),
+ }
+ case XZX:
+ ret.W = float32(c[0]*c[1]*c[2] - s[0]*c[1]*s[2])
+ ret.V = Vec3{float32(c[0]*c[1]*s[2] + s[0]*c[1]*c[2]),
+ float32(c[0]*s[1]*s[2] - s[0]*s[1]*c[2]),
+ float32(c[0]*s[1]*c[2] + s[0]*s[1]*s[2]),
+ }
+ default:
+ panic("Unsupported rotation order")
+ }
+ return ret
+}
+
+// Mat4ToQuat converts a pure rotation matrix into a quaternion
+func Mat4ToQuat(m Mat4) Quat {
+ // http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToQuaternion/index.htm
+
+ if tr := m[0] + m[5] + m[10]; tr > 0 {
+ s := float32(0.5 / math.Sqrt(float64(tr+1.0)))
+ return Quat{
+ 0.25 / s,
+ Vec3{
+ (m[6] - m[9]) * s,
+ (m[8] - m[2]) * s,
+ (m[1] - m[4]) * s,
+ },
+ }
+ }
+
+ if (m[0] > m[5]) && (m[0] > m[10]) {
+ s := float32(2.0 * math.Sqrt(float64(1.0+m[0]-m[5]-m[10])))
+ return Quat{
+ (m[6] - m[9]) / s,
+ Vec3{
+ 0.25 * s,
+ (m[4] + m[1]) / s,
+ (m[8] + m[2]) / s,
+ },
+ }
+ }
+
+ if m[5] > m[10] {
+ s := float32(2.0 * math.Sqrt(float64(1.0+m[5]-m[0]-m[10])))
+ return Quat{
+ (m[8] - m[2]) / s,
+ Vec3{
+ (m[4] + m[1]) / s,
+ 0.25 * s,
+ (m[9] + m[6]) / s,
+ },
+ }
+
+ }
+
+ s := float32(2.0 * math.Sqrt(float64(1.0+m[10]-m[0]-m[5])))
+ return Quat{
+ (m[1] - m[4]) / s,
+ Vec3{
+ (m[8] + m[2]) / s,
+ (m[9] + m[6]) / s,
+ 0.25 * s,
+ },
+ }
+}
+
+// QuatLookAtV creates a rotation from an eye vector to a center vector
+//
+// It assumes the front of the rotated object at Z- and up at Y+
+func QuatLookAtV(eye, center, up Vec3) Quat {
+ // http://www.opengl-tutorial.org/intermediate-tutorials/tutorial-17-quaternions/#I_need_an_equivalent_of_gluLookAt__How_do_I_orient_an_object_towards_a_point__
+ // https://bitbucket.org/sinbad/ogre/src/d2ef494c4a2f5d6e2f0f17d3bfb9fd936d5423bb/OgreMain/src/OgreCamera.cpp?at=default#cl-161
+
+ direction := center.Sub(eye).Normalize()
+
+ // Find the rotation between the front of the object (that we assume towards Z-,
+ // but this depends on your model) and the desired direction
+ rotDir := QuatBetweenVectors(Vec3{0, 0, -1}, direction)
+
+ // Recompute up so that it's perpendicular to the direction
+ // You can skip that part if you really want to force up
+ //right := direction.Cross(up)
+ //up = right.Cross(direction)
+
+ // Because of the 1rst rotation, the up is probably completely screwed up.
+ // Find the rotation between the "up" of the rotated object, and the desired up
+ upCur := rotDir.Rotate(Vec3{0, 1, 0})
+ rotUp := QuatBetweenVectors(upCur, up)
+
+ rotTarget := rotUp.Mul(rotDir) // remember, in reverse order.
+ return rotTarget.Inverse() // camera rotation should be inversed!
+}
+
+// QuatBetweenVectors calculates the rotation between two vectors
+func QuatBetweenVectors(start, dest Vec3) Quat {
+ // http://www.opengl-tutorial.org/intermediate-tutorials/tutorial-17-quaternions/#I_need_an_equivalent_of_gluLookAt__How_do_I_orient_an_object_towards_a_point__
+ // https://github.com/g-truc/glm/blob/0.9.5/glm/gtx/quaternion.inl#L225
+ // https://bitbucket.org/sinbad/ogre/src/d2ef494c4a2f5d6e2f0f17d3bfb9fd936d5423bb/OgreMain/include/OgreVector3.h?at=default#cl-654
+
+ start = start.Normalize()
+ dest = dest.Normalize()
+ epsilon := float32(0.001)
+
+ cosTheta := start.Dot(dest)
+ if cosTheta < -1.0+epsilon {
+ // special case when vectors in opposite directions:
+ // there is no "ideal" rotation axis
+ // So guess one; any will do as long as it's perpendicular to start
+ axis := Vec3{1, 0, 0}.Cross(start)
+ if axis.Dot(axis) < epsilon {
+ // bad luck, they were parallel, try again!
+ axis = Vec3{0, 1, 0}.Cross(start)
+ }
+
+ return QuatRotate(math.Pi, axis.Normalize())
+ }
+
+ axis := start.Cross(dest)
+ s := float32(math.Sqrt(float64(1.0+cosTheta) * 2.0))
+
+ return Quat{
+ s * 0.5,
+ axis.Mul(1.0 / s),
+ }
+}
diff --git a/archive/vendor/github.com/go-gl/mathgl/mgl32/shapes.go b/archive/vendor/github.com/go-gl/mathgl/mgl32/shapes.go
new file mode 100644
index 0000000..6e147c5
--- /dev/null
+++ b/archive/vendor/github.com/go-gl/mathgl/mgl32/shapes.go
@@ -0,0 +1,321 @@
+// Copyright 2014 The go-gl Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package mgl32
+
+import (
+ "fmt"
+ "math"
+)
+
+// Circle generates a circle centered at (0,0) with a given radius.
+// The radii are assumed to be in GL's coordinate sizing.
+//
+// Technically this draws an ellipse with two axes that match with the X and Y axes, the reason it has a radiusX and radiusY is because GL's coordinate system
+// is proportional to screen width and screen height. So if you have a non-square viewport, a single radius will appear
+// to "squash" the circle in one direction (usually the Y direction), so the X and Y radius allow for a circle to be made.
+// A good way to get the correct radii is with mathgl.ScreenToGLCoords(radius, radius, screenWidth, screenHeight) which will get you the correct
+// proportional GL coords.
+//
+// The numSlices argument specifies how many triangles you want your circle divided into, setting this
+// number to too low a value may cause problem (and too high will cause it to take a lot of memory and time to compute
+// without much gain in resolution).
+//
+// This uses discrete triangles, not a triangle fan
+func Circle(radiusX, radiusY float32, numSlices int) []Vec2 {
+ twoPi := float32(2.0 * math.Pi)
+
+ circlePoints := make([]Vec2, 0, numSlices*3)
+ center := Vec2{0.0, 0.0}
+ previous := Vec2{radiusX, 0.0}
+
+ for theta := twoPi / float32(numSlices); !FloatEqual(theta, twoPi); theta = Clamp(theta+twoPi/float32(numSlices), 0.0, twoPi) {
+ sin, cos := math.Sincos(float64(theta))
+ curr := Vec2{float32(cos) * radiusX, float32(sin) * radiusY}
+
+ circlePoints = append(circlePoints, center, previous, curr)
+ previous = curr
+ }
+
+ // Now add the final point at theta=2pi
+ circlePoints = append(circlePoints, center, previous, Vec2{radiusX, 0.0})
+ return circlePoints
+}
+
+// Rect generates a 2-triangle rectangle for use with GL_TRIANGLES. The width and height should use GL's proportions (that is, where a width of 1.0
+// is equivalent to half of the width of the render target); however, the y-coordinates grow downwards, not upwards. That is, it
+// assumes you want the origin of the rectangle with the top-left corner at (0.0,0.0).
+//
+// Keep in mind that GL's coordinate system is proportional, so width=height will not result in a square unless your viewport is square.
+// If you want to maintain proportionality regardless of screen size, use the results of w,h := ScreenToGLCoordsf(absoluteWidth, absoluteHeight, screenWidth, screenHeight);
+// w,h=w+1,h-1 in the call to this function. (The w+1,h-1 step maps the coordinates to start at 0.0 rather than -1.0)
+func Rect(width, height float32) []Vec2 {
+ return []Vec2{
+ {0.0, 0.0},
+ {0.0, -height},
+ {width, -height},
+
+ {0.0, 0.0},
+ {width, -height},
+ {width, 0.0},
+ }
+}
+
+// QuadraticBezierCurve2D interpolates the point t on the given bezier curve.
+func QuadraticBezierCurve2D(t float32, cPoint1, cPoint2, cPoint3 Vec2) Vec2 {
+ if t < 0.0 || t > 1.0 {
+ panic("Can't interpolate on bezier curve with t out of range [0.0,1.0]")
+ }
+
+ return cPoint1.Mul((1.0 - t) * (1.0 - t)).Add(cPoint2.Mul(2 * (1 - t) * t)).Add(cPoint3.Mul(t * t))
+}
+
+// QuadraticBezierCurve3D interpolates the point t on the given bezier curve.
+func QuadraticBezierCurve3D(t float32, cPoint1, cPoint2, cPoint3 Vec3) Vec3 {
+ if t < 0.0 || t > 1.0 {
+ panic("Can't interpolate on bezier curve with t out of range [0.0,1.0]")
+ }
+
+ return cPoint1.Mul((1.0 - t) * (1.0 - t)).Add(cPoint2.Mul(2 * (1 - t) * t)).Add(cPoint3.Mul(t * t))
+}
+
+// CubicBezierCurve2D interpolates the point t on the given bezier curve.
+func CubicBezierCurve2D(t float32, cPoint1, cPoint2, cPoint3, cPoint4 Vec2) Vec2 {
+ if t < 0.0 || t > 1.0 {
+ panic("Can't interpolate on bezier curve with t out of range [0.0,1.0]")
+ }
+
+ sum14 := cPoint1.Mul((1 - t) * (1 - t) * (1 - t)).Add(cPoint4.Mul(t * t * t))
+ sum23 := cPoint2.Mul(3 * (1 - t) * (1 - t) * t).Add(cPoint3.Mul(3 * (1 - t) * t * t))
+ return sum14.Add(sum23)
+}
+
+// CubicBezierCurve3D interpolates the point t on the given bezier curve.
+func CubicBezierCurve3D(t float32, cPoint1, cPoint2, cPoint3, cPoint4 Vec3) Vec3 {
+ if t < 0.0 || t > 1.0 {
+ panic("Can't interpolate on bezier curve with t out of range [0.0,1.0]")
+ }
+
+ sum14 := cPoint1.Mul((1 - t) * (1 - t) * (1 - t)).Add(cPoint4.Mul(t * t * t))
+ sum23 := cPoint2.Mul(3 * (1 - t) * (1 - t) * t).Add(cPoint3.Mul(3 * (1 - t) * t * t))
+ return sum14.Add(sum23)
+}
+
+// BezierCurve2D returns the point at point t along an n-control point Bezier curve
+//
+// t must be in the range 0.0 and 1.0 or this function will panic. Consider [0.0,1.0] to be similar to a percentage,
+// 0.0 is first control point, and the point at 1.0 is the last control point. Any point in between is how far along the path you are between 0 and 1.
+//
+// This function is not sensitive to the coordinate system of the control points. It will correctly interpolate regardless of whether they're in screen coords,
+// gl coords, or something else entirely
+func BezierCurve2D(t float32, cPoints []Vec2) Vec2 {
+ if t < 0.0 || t > 1.0 {
+ panic("Input to bezier has t not in range [0,1]. If you think this is a precision error, use mathgl.Clamp[f|d] before calling this function")
+ }
+
+ n := len(cPoints) - 1
+ point := cPoints[0].Mul(float32(math.Pow(float64(1.0-t), float64(n))))
+
+ for i := 1; i <= n; i++ {
+ point = point.Add(cPoints[i].Mul(float32(float64(choose(n, i)) * math.Pow(float64(1-t), float64(n-i)) * math.Pow(float64(t), float64(i))))) // P += P_i * nCi * (1-t)^(n-i) * t^i
+ }
+
+ return point
+}
+
+// BezierCurve3D same as the 2D version, except the line is in 3D space
+func BezierCurve3D(t float32, cPoints []Vec3) Vec3 {
+ if t < 0.0 || t > 1.0 {
+ panic("Input to bezier has t not in range [0,1]. If you think this is a precision error, use mathgl.Clamp[f|d] before calling this function")
+ }
+
+ n := len(cPoints) - 1
+ point := cPoints[0].Mul(float32(math.Pow(float64(1.0-t), float64(n))))
+
+ for i := 1; i <= n; i++ {
+ point = point.Add(cPoints[i].Mul(float32(float64(choose(n, i)) * math.Pow(float64(1-t), float64(n-i)) * math.Pow(float64(t), float64(i))))) // P += P_i * nCi * (1-t)^(n-i) * t^i
+ }
+
+ return point
+}
+
+// MakeBezierCurve2D generates a bezier curve with controlPoints cPoints. The
+// numPoints argument determines how many "samples" it makes along the line. For
+// instance, a call to this with numPoints 2 will have exactly two points: the
+// start and end points For any points above 2 it will divide it into
+// numPoints-1 chunks (which means it will generate numPoints-2 vertices other
+// than the beginning and end). So for 3 points it will divide it in half, 4
+// points into thirds, and so on.
+//
+// This is likely to get rather expensive for anything over perhaps a cubic
+// curve.
+func MakeBezierCurve2D(numPoints int, cPoints []Vec2) (line []Vec2) {
+ line = make([]Vec2, numPoints)
+ if numPoints == 0 {
+ return
+ } else if numPoints == 1 {
+ line[0] = cPoints[0]
+ return
+ } else if numPoints == 2 {
+ line[0] = cPoints[0]
+ line[1] = cPoints[len(cPoints)-1]
+ return
+ }
+
+ line[0] = cPoints[0]
+ for i := 1; i < numPoints-1; i++ {
+ line[i] = BezierCurve2D(Clamp(float32(i)/float32(numPoints-1), 0.0, 1.0), cPoints)
+ }
+ line[numPoints-1] = cPoints[len(cPoints)-1]
+
+ return
+}
+
+// MakeBezierCurve3D same as the 2D version, except with the line in 3D space.
+func MakeBezierCurve3D(numPoints int, cPoints []Vec3) (line []Vec3) {
+ line = make([]Vec3, numPoints)
+ if numPoints == 0 {
+ return
+ } else if numPoints == 1 {
+ line[0] = cPoints[0]
+ return
+ } else if numPoints == 2 {
+ line[0] = cPoints[0]
+ line[1] = cPoints[len(cPoints)-1]
+ return
+ }
+
+ line[0] = cPoints[0]
+ for i := 1; i < numPoints-1; i++ {
+ line[i] = BezierCurve3D(Clamp(float32(i)/float32(numPoints-1), 0.0, 1.0), cPoints)
+ }
+ line[numPoints-1] = cPoints[len(cPoints)-1]
+
+ return
+}
+
+// BezierSurface creates a 2-dimensional Bezier surface of arbitrary degree in
+// 3D Space Like the curve functions, if u or v are not in the range [0.0,1.0]
+// the function will panic, use Clamp[f|d] to ensure it is correct.
+//
+// The control point matrix must not be jagged, or this will end up panicking
+// from an index out of bounds exception
+func BezierSurface(u, v float32, cPoints [][]Vec3) Vec3 {
+ if u < 0.0 || u > 1.0 || v < 1.0 || v > 1.0 {
+ panic("u or v not in range [0.0,1.0] in BezierSurface")
+ }
+
+ n := len(cPoints) - 1
+ m := len(cPoints[0]) - 1
+
+ point := cPoints[0][0].Mul(float32(math.Pow(float64(1.0-u), float64(n)) * math.Pow(float64(1.0-v), float64(m))))
+
+ for i := 0; i <= n; i++ {
+ for j := 0; j <= m; j++ {
+ if i == 0 && j == 0 {
+ continue
+ }
+
+ point = point.Add(cPoints[i][j].Mul(float32(float64(choose(n, i)) * math.Pow(float64(u), float64(i)) * math.Pow(float64(1.0-u), float64(n-i)) * float64(choose(m, j)) * math.Pow(float64(v), float64(j)) * math.Pow(float64(1.0-v), float64(m-j)))))
+ }
+ }
+
+ return point
+}
+
+// BezierSplineInterpolate2D does interpolation over a spline of several bezier
+// curves. Each bezier curve must have a finite range, though the spline may be
+// disjoint. The bezier curves are not required to be in any particular order.
+//
+// If t is out of the range of all given curves, this function will panic
+func BezierSplineInterpolate2D(t float32, ranges [][2]float32, cPoints [][]Vec2) Vec2 {
+ if len(ranges) != len(cPoints) {
+ panic("Each bezier curve needs a range")
+ }
+
+ for i, curveRange := range ranges {
+ if t >= curveRange[0] && t <= curveRange[1] {
+ return BezierCurve2D((t-curveRange[0])/(curveRange[1]-curveRange[0]), cPoints[i])
+ }
+ }
+
+ panic("t is out of the range of all bezier curves in this spline")
+}
+
+// BezierSplineInterpolate3D does interpolation over a spline of several bezier
+// curves. Each bezier curve must have a finite range, though the spline may be
+// disjoint. The bezier curves are not required to be in any particular order.
+//
+// If t is out of the range of all given curves, this function will panic
+func BezierSplineInterpolate3D(t float32, ranges [][2]float32, cPoints [][]Vec3) Vec3 {
+ if len(ranges) != len(cPoints) {
+ panic("Each bezier curve needs a range")
+ }
+
+ for i, curveRange := range ranges {
+ if t >= curveRange[0] && t <= curveRange[1] {
+ return BezierCurve3D((t-curveRange[0])/(curveRange[1]-curveRange[0]), cPoints[i])
+ }
+ }
+
+ panic("t is out of the range of all bezier curves in this spline")
+}
+
+// ReticulateSplines reticulates ALL the Splines.
+//
+// For the overly serious: the function is just for fun. It does nothing except prints a Maxis reference. Technically you could "reticulate splines"
+// by joining a bunch of splines together, but that ruins the joke.
+func ReticulateSplines(ranges [][][2]float32, cPoints [][][]Vec2, withLlamas bool) {
+ if !withLlamas {
+ fmt.Println("You can't reticulate splines without llamas, silly.")
+ } else {
+ fmt.Println("Actually, you can't even reticulate splines WITH llamas")
+ }
+}
+
+// ScreenToGLCoords transforms from pixel coordinates to GL coordinates.
+//
+// This assumes that your pixel coordinate system considers its origin to be in the top left corner (GL's is in the bottom left).
+// The coordinates x and y may be out of the range [0,screenWidth-1] and [0,screeneHeight-1].
+//
+// GL's coordinate system maps [screenWidth-1,0] to [1.0,1.0] and [0,screenHeight-1] to [-1.0,-1.0]. If x and y are out of the range, they'll still
+// be mapped correctly, just off the screen. (e.g. if y = 2*(screenHeight-1) you'll get -3.0 for yOut)
+//
+// This is similar to Unproject, except for 2D cases and much simpler (especially since an inverse may always be found)
+func ScreenToGLCoords(x, y int, screenWidth, screenHeight int) (xOut, yOut float32) {
+ xOut = 2.0*float32(x)/float32(screenWidth-1) - 1.0
+ yOut = -2.0*float32(y)/float32(screenHeight-1) + 1.0
+
+ return
+}
+
+// GLToScreenCoords transforms from GL's proportional system to pixel coordinates.
+//
+// Assumes the pixel coordinate system has its origin in the top left corner. (GL's is in the bottom left)
+//
+// GL's coordinate system maps [screenWidth-1,0] to [1.0,1.0] and [0,screenHeight-1] to [-1.0,-1.0]. If x and y are out of the range, they'll still
+// be mapped correctly, just off the screen. (e.g. if y=-3.0, you'll get 2*(screenHeight-1) for yOut)
+//
+// This is similar to Project, except for 2D cases and much simpler
+func GLToScreenCoords(x, y float32, screenWidth, screenHeight int) (xOut, yOut int) {
+ xOut = int((x + 1.0) * float32(screenWidth-1) / 2.0)
+ yOut = int((1.0 - y) * float32(screenHeight-1) / 2.0)
+
+ return
+}
+
+// choose calculates the binomial coefficient C(n,k) aka nCk
+func choose(n, k int) int {
+ if k == 0 {
+ return 1
+ } else if n == 0 {
+ return 0
+ }
+ result := float32(n - (k - 1))
+ for i := 2; i <= k; i++ {
+ result *= float32(n-(k-i)) / float32(i)
+ }
+
+ return int(result)
+}
diff --git a/archive/vendor/github.com/go-gl/mathgl/mgl32/transform.go b/archive/vendor/github.com/go-gl/mathgl/mgl32/transform.go
new file mode 100644
index 0000000..a2759f4
--- /dev/null
+++ b/archive/vendor/github.com/go-gl/mathgl/mgl32/transform.go
@@ -0,0 +1,234 @@
+// Copyright 2014 The go-gl Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package mgl32
+
+import "math"
+
+// Rotate2D returns a rotation Matrix about a angle in 2-D space. Specifically about the origin.
+// It is a 2x2 matrix, if you need a 3x3 for Homogeneous math (e.g. composition with a Translation matrix)
+// see HomogRotate2D
+func Rotate2D(angle float32) Mat2 {
+ //angle = (angle * math.Pi) / 180.0
+ sn, cs := math.Sincos(float64(angle))
+ sin, cos := float32(sn), float32(cs)
+ return Mat2{cos, sin, -sin, cos}
+}
+
+// Rotate3DX returns a 3x3 (non-homogeneous) Matrix that rotates by angle about the X-axis
+//
+// Where c is cos(angle) and s is sin(angle)
+//
+// [1 0 0]
+// [0 c -s]
+// [0 s c ]
+func Rotate3DX(angle float32) Mat3 {
+ //angle = (angle * math.Pi) / 180.0
+ sn, cs := math.Sincos(float64(angle))
+ sin, cos := float32(sn), float32(cs)
+ return Mat3{1, 0, 0, 0, cos, sin, 0, -sin, cos}
+}
+
+// Rotate3DY returns a 3x3 (non-homogeneous) Matrix that rotates by angle about the Y-axis
+//
+// Where c is cos(angle) and s is sin(angle)
+//
+// [c 0 s]
+// [0 1 0]
+// [s 0 c ]
+func Rotate3DY(angle float32) Mat3 {
+ //angle = (angle * math.Pi) / 180.0
+ sn, cs := math.Sincos(float64(angle))
+ sin, cos := float32(sn), float32(cs)
+ return Mat3{cos, 0, -sin, 0, 1, 0, sin, 0, cos}
+}
+
+// Rotate3DZ returns a 3x3 (non-homogeneous) Matrix that rotates by angle about the Z-axis
+//
+// Where c is cos(angle) and s is sin(angle)
+//
+// [c -s 0]
+// [s c 0]
+// [0 0 1 ]
+func Rotate3DZ(angle float32) Mat3 {
+ //angle = (angle * math.Pi) / 180.0
+ sn, cs := math.Sincos(float64(angle))
+ sin, cos := float32(sn), float32(cs)
+ return Mat3{cos, sin, 0, -sin, cos, 0, 0, 0, 1}
+}
+
+// Translate2D returns a homogeneous (3x3 for 2D-space) Translation matrix that moves a point by Tx units in the x-direction and Ty units in the y-direction
+//
+// [[1, 0, Tx]]
+// [[0, 1, Ty]]
+// [[0, 0, 1 ]]
+func Translate2D(Tx, Ty float32) Mat3 {
+ return Mat3{1, 0, 0, 0, 1, 0, float32(Tx), float32(Ty), 1}
+}
+
+// Translate3D returns a homogeneous (4x4 for 3D-space) Translation matrix that moves a point by Tx units in the x-direction, Ty units in the y-direction,
+// and Tz units in the z-direction
+//
+// [[1, 0, 0, Tx]]
+// [[0, 1, 0, Ty]]
+// [[0, 0, 1, Tz]]
+// [[0, 0, 0, 1 ]]
+func Translate3D(Tx, Ty, Tz float32) Mat4 {
+ return Mat4{1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, float32(Tx), float32(Ty), float32(Tz), 1}
+}
+
+// HomogRotate2D is the same as Rotate2D, except homogeneous (3x3 with the extra row/col being all zeroes with a one in the bottom right)
+func HomogRotate2D(angle float32) Mat3 {
+ //angle = (angle * math.Pi) / 180.0
+ sn, cs := math.Sincos(float64(angle))
+ sin, cos := float32(sn), float32(cs)
+ return Mat3{cos, sin, 0, -sin, cos, 0, 0, 0, 1}
+}
+
+// HomogRotate3DX is the same as Rotate3DX, except homogeneous (4x4 with the extra row/col being all zeroes with a one in the bottom right)
+func HomogRotate3DX(angle float32) Mat4 {
+ //angle = (angle * math.Pi) / 180.0
+ sn, cs := math.Sincos(float64(angle))
+ sin, cos := float32(sn), float32(cs)
+
+ return Mat4{1, 0, 0, 0, 0, cos, sin, 0, 0, -sin, cos, 0, 0, 0, 0, 1}
+}
+
+// HomogRotate3DY is the same as Rotate3DY, except homogeneous (4x4 with the extra row/col being all zeroes with a one in the bottom right)
+func HomogRotate3DY(angle float32) Mat4 {
+ //angle = (angle * math.Pi) / 180.0
+ sn, cs := math.Sincos(float64(angle))
+ sin, cos := float32(sn), float32(cs)
+ return Mat4{cos, 0, -sin, 0, 0, 1, 0, 0, sin, 0, cos, 0, 0, 0, 0, 1}
+}
+
+// HomogRotate3DZ is the same as Rotate3DZ, except homogeneous (4x4 with the extra row/col being all zeroes with a one in the bottom right)
+func HomogRotate3DZ(angle float32) Mat4 {
+ //angle = (angle * math.Pi) / 180.0
+ sn, cs := math.Sincos(float64(angle))
+ sin, cos := float32(sn), float32(cs)
+ return Mat4{cos, sin, 0, 0, -sin, cos, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1}
+}
+
+// Scale3D creates a homogeneous 3D scaling matrix
+// [[ scaleX, 0 , 0 , 0 ]]
+// [[ 0 , scaleY, 0 , 0 ]]
+// [[ 0 , 0 , scaleZ, 0 ]]
+// [[ 0 , 0 , 0 , 1 ]]
+func Scale3D(scaleX, scaleY, scaleZ float32) Mat4 {
+
+ return Mat4{float32(scaleX), 0, 0, 0, 0, float32(scaleY), 0, 0, 0, 0, float32(scaleZ), 0, 0, 0, 0, 1}
+}
+
+// Scale2D creates a homogeneous 2D scaling matrix
+// [[ scaleX, 0 , 0 ]]
+// [[ 0 , scaleY, 0 ]]
+// [[ 0 , 0 , 1 ]]
+func Scale2D(scaleX, scaleY float32) Mat3 {
+ return Mat3{float32(scaleX), 0, 0, 0, float32(scaleY), 0, 0, 0, 1}
+}
+
+// ShearX2D creates a homogeneous 2D shear matrix along the X-axis
+func ShearX2D(shear float32) Mat3 {
+ return Mat3{1, 0, 0, float32(shear), 1, 0, 0, 0, 1}
+}
+
+// ShearY2D creates a homogeneous 2D shear matrix along the Y-axis
+func ShearY2D(shear float32) Mat3 {
+ return Mat3{1, float32(shear), 0, 0, 1, 0, 0, 0, 1}
+}
+
+// ShearX3D creates a homogeneous 3D shear matrix along the X-axis
+func ShearX3D(shearY, shearZ float32) Mat4 {
+
+ return Mat4{1, float32(shearY), float32(shearZ), 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1}
+}
+
+// ShearY3D creates a homogeneous 3D shear matrix along the Y-axis
+func ShearY3D(shearX, shearZ float32) Mat4 {
+ return Mat4{1, 0, 0, 0, float32(shearX), 1, float32(shearZ), 0, 0, 0, 1, 0, 0, 0, 0, 1}
+}
+
+// ShearZ3D creates a homogeneous 3D shear matrix along the Z-axis
+func ShearZ3D(shearX, shearY float32) Mat4 {
+ return Mat4{1, 0, 0, 0, 0, 1, 0, 0, float32(shearX), float32(shearY), 1, 0, 0, 0, 0, 1}
+}
+
+// HomogRotate3D creates a 3D rotation Matrix that rotates by (radian) angle about some arbitrary axis given by a normalized Vector.
+// It produces a homogeneous matrix (4x4)
+//
+// Where c is cos(angle) and s is sin(angle), and x, y, and z are the first, second, and third elements of the axis vector (respectively):
+//
+// [[ x^2(1-c)+c, xy(1-c)-zs, xz(1-c)+ys, 0 ]]
+// [[ xy(1-c)+zs, y^2(1-c)+c, yz(1-c)-xs, 0 ]]
+// [[ xz(1-c)-ys, yz(1-c)+xs, z^2(1-c)+c, 0 ]]
+// [[ 0 , 0 , 0 , 1 ]]
+func HomogRotate3D(angle float32, axis Vec3) Mat4 {
+ x, y, z := axis[0], axis[1], axis[2]
+ sn, cs := math.Sincos(float64(angle))
+ s, c := float32(sn), float32(cs)
+ k := 1 - c
+
+ return Mat4{x*x*k + c, x*y*k + z*s, x*z*k - y*s, 0, x*y*k - z*s, y*y*k + c, y*z*k + x*s, 0, x*z*k + y*s, y*z*k - x*s, z*z*k + c, 0, 0, 0, 0, 1}
+}
+
+// Extract3DScale extracts the 3d scaling from a homogeneous matrix
+func Extract3DScale(m Mat4) (x, y, z float32) {
+ return float32(math.Sqrt(float64(m[0]*m[0] + m[1]*m[1] + m[2]*m[2]))),
+ float32(math.Sqrt(float64(m[4]*m[4] + m[5]*m[5] + m[6]*m[6]))),
+ float32(math.Sqrt(float64(m[8]*m[8] + m[9]*m[9] + m[10]*m[10])))
+}
+
+// ExtractMaxScale extracts the maximum scaling from a homogeneous matrix
+func ExtractMaxScale(m Mat4) float32 {
+ scaleX := float64(m[0]*m[0] + m[1]*m[1] + m[2]*m[2])
+ scaleY := float64(m[4]*m[4] + m[5]*m[5] + m[6]*m[6])
+ scaleZ := float64(m[8]*m[8] + m[9]*m[9] + m[10]*m[10])
+
+ return float32(math.Sqrt(math.Max(scaleX, math.Max(scaleY, scaleZ))))
+}
+
+// Mat4Normal calculates the Normal of the Matrix (aka the inverse transpose)
+func Mat4Normal(m Mat4) Mat3 {
+ n := m.Inv().Transpose()
+ return Mat3{n[0], n[1], n[2], n[4], n[5], n[6], n[8], n[9], n[10]}
+}
+
+// TransformCoordinate multiplies a 3D vector by a transformation given by
+// the homogeneous 4D matrix m, applying any translation.
+// If this transformation is non-affine, it will project this
+// vector onto the plane w=1 before returning the result.
+//
+// This is similar to saying you're transforming and projecting a point.
+//
+// This is effectively equivalent to the GLSL code
+//
+// vec4 r = (m * vec4(v,1.));
+// r = r/r.w;
+// vec3 newV = r.xyz;
+func TransformCoordinate(v Vec3, m Mat4) Vec3 {
+ t := v.Vec4(1)
+ t = m.Mul4x1(t)
+ t = t.Mul(1 / t[3])
+
+ return t.Vec3()
+}
+
+// TransformNormal multiplies a 3D vector by a transformation given by
+// the homogeneous 4D matrix m, NOT applying any translations.
+//
+// This is similar to saying you're applying a transformation
+// to a direction or normal. Rotation still applies (as does scaling),
+// but translating a direction or normal is meaningless.
+//
+// This is effectively equivalent to the GLSL code
+//
+// vec4 r = (m * vec4(v,0.));
+// vec3 newV = r.xyz
+func TransformNormal(v Vec3, m Mat4) Vec3 {
+ t := v.Vec4(0)
+ t = m.Mul4x1(t)
+
+ return t.Vec3()
+}
diff --git a/archive/vendor/github.com/go-gl/mathgl/mgl32/util.go b/archive/vendor/github.com/go-gl/mathgl/mgl32/util.go
new file mode 100644
index 0000000..6b50e45
--- /dev/null
+++ b/archive/vendor/github.com/go-gl/mathgl/mgl32/util.go
@@ -0,0 +1,144 @@
+// Copyright 2014 The go-gl Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+//go:generate go run codegen.go -template vector.tmpl -output vector.go
+//go:generate go run codegen.go -template matrix.tmpl -output matrix.go
+//go:generate go run codegen.go -mgl64
+
+package mgl32
+
+import (
+ "math"
+)
+
+// Epsilon is some tiny value that determines how precisely equal we want our floats to be
+// This is exported and left as a variable in case you want to change the default threshold for the
+// purposes of certain methods (e.g. Unproject uses the default epsilon when determining
+// if the determinant is "close enough" to zero to mean there's no inverse).
+//
+// This is, obviously, not mutex protected so be **absolutely sure** that no functions using Epsilon
+// are being executed when you change this.
+var Epsilon float32 = 1e-10
+
+// Abs is a direct copy of the math package's Abs. This is here for the mgl32
+// package, to prevent rampant type conversions during equality tests.
+func Abs(a float32) float32 {
+ if a < 0 {
+ return -a
+ } else if a == 0 {
+ return 0
+ }
+
+ return a
+}
+
+// FloatEqual is a safe utility function to compare floats.
+// It's Taken from http://floating-point-gui.de/errors/comparison/
+//
+// It is slightly altered to not call Abs when not needed.
+func FloatEqual(a, b float32) bool {
+ return FloatEqualThreshold(a, b, Epsilon)
+}
+
+// FloatEqualFunc is a utility closure that will generate a function that
+// always approximately compares floats like FloatEqualThreshold with a different
+// threshold.
+func FloatEqualFunc(epsilon float32) func(float32, float32) bool {
+ return func(a, b float32) bool {
+ return FloatEqualThreshold(a, b, epsilon)
+ }
+}
+
+// Various useful constants.
+var (
+ MinNormal = float32(1.1754943508222875e-38) // 1 / 2**(127 - 1)
+ MinValue = float32(math.SmallestNonzeroFloat32)
+ MaxValue = float32(math.MaxFloat32)
+
+ InfPos = float32(math.Inf(1))
+ InfNeg = float32(math.Inf(-1))
+ NaN = float32(math.NaN())
+)
+
+// FloatEqualThreshold is a utility function to compare floats.
+// It's Taken from http://floating-point-gui.de/errors/comparison/
+//
+// It is slightly altered to not call Abs when not needed.
+//
+// This differs from FloatEqual in that it lets you pass in your comparison threshold, so that you can adjust the comparison value to your specific needs
+func FloatEqualThreshold(a, b, epsilon float32) bool {
+ if a == b { // Handles the case of inf or shortcuts the loop when no significant error has accumulated
+ return true
+ }
+
+ diff := Abs(a - b)
+ if a*b == 0 || diff < MinNormal { // If a or b are 0 or both are extremely close to it
+ return diff < epsilon*epsilon
+ }
+
+ // Else compare difference
+ return diff/(Abs(a)+Abs(b)) < epsilon
+}
+
+// Clamp takes in a value and two thresholds. If the value is smaller than the low
+// threshold, it returns the low threshold. If it's bigger than the high threshold
+// it returns the high threshold. Otherwise it returns the value.
+//
+// Useful to prevent some functions from freaking out because a value was
+// teeeeechnically out of range.
+func Clamp(a, low, high float32) float32 {
+ if a < low {
+ return low
+ } else if a > high {
+ return high
+ }
+
+ return a
+}
+
+// ClampFunc generates a closure that returns its parameter
+// clamped to the range [low,high].
+func ClampFunc(low, high float32) func(float32) float32 {
+ return func(a float32) float32 {
+ return Clamp(a, low, high)
+ }
+}
+
+// IsClamped checks if a is clamped between low and high as if
+// Clamp(a, low, high) had been called.
+//
+// In most cases it's probably better to just call Clamp
+// without checking this since it's relatively cheap.
+//
+// The IsClamped functions use strict equality (meaning: not the FloatEqual
+// function) there shouldn't be any major issues with this since clamp is often
+// used to fix minor errors
+func IsClamped(a, low, high float32) bool {
+ return a >= low && a <= high
+}
+
+// SetMin sets a to b if a > b.
+func SetMin(a, b *float32) {
+ if *b < *a {
+ *a = *b
+ }
+}
+
+// SetMax sets a to b if a < b.
+func SetMax(a, b *float32) {
+ if *a < *b {
+ *a = *b
+ }
+}
+
+// Round shortens a float32 value to a specified precision (number of digits after the decimal point)
+// with "round half up" tie-braking rule. Half-way values (23.5) are always rounded up (24).
+func Round(v float32, precision int) float32 {
+ p := float64(precision)
+ t := float64(v) * math.Pow(10, p)
+ if t >= 0 {
+ return float32(math.Floor(t+0.5) / math.Pow(10, p))
+ }
+ return float32(math.Ceil(t-0.5) / math.Pow(10, p))
+}
diff --git a/archive/vendor/github.com/go-gl/mathgl/mgl32/vecn.go b/archive/vendor/github.com/go-gl/mathgl/mgl32/vecn.go
new file mode 100644
index 0000000..26fb4e3
--- /dev/null
+++ b/archive/vendor/github.com/go-gl/mathgl/mgl32/vecn.go
@@ -0,0 +1,371 @@
+// Copyright 2014 The go-gl Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package mgl32
+
+import (
+ "math"
+)
+
+// VecN represents a vector of N elements backed by a slice.
+//
+// As with MatMxN, this is not for hardcore linear algebra with large dimensions. Use github.com/gonum/matrix
+// or something like BLAS/LAPACK for that. This is for corner cases in 3D math where you require
+// something a little bigger that 4D, but still relatively small.
+//
+// This VecN uses several sync.Pool objects as a memory pool. The rule is that for any sized vector, the backing slice
+// has CAPACITY (not length) of 2^p where p is Ceil(log_2(N)) -- or in other words, rounding up the base-2
+// log of the size of the vector. E.G. a VecN of size 17 will have a backing slice of Cap 32.
+type VecN struct {
+ vec []float32
+}
+
+// NewVecNFromData creates a new vector with a backing slice filled with the contents
+// of initial. It is NOT backed by initial, but rather a slice with cap
+// 2^p where p is Ceil(log_2(len(initial))), with the data from initial copied into
+// it.
+func NewVecNFromData(initial []float32) *VecN {
+ if initial == nil {
+ return &VecN{}
+ }
+ var internal []float32
+ if shouldPool {
+ internal = grabFromPool(len(initial))
+ } else {
+ internal = make([]float32, len(initial))
+ }
+ copy(internal, initial)
+ return &VecN{vec: internal}
+}
+
+// NewVecN creates a new vector with a backing slice of
+// 2^p where p = Ceil(log_2(n))
+func NewVecN(n int) *VecN {
+ if shouldPool {
+ return &VecN{vec: grabFromPool(n)}
+ } else {
+ return &VecN{vec: make([]float32, n)}
+ }
+}
+
+// Raw returns the raw slice backing the VecN
+//
+// This may be sent back to the memory pool at any time
+// and you aren't advised to rely on this value
+func (vn VecN) Raw() []float32 {
+ return vn.vec
+}
+
+// Get the element at index i from the vector. This does not bounds check, and
+// will panic if i is out of range.
+func (vn VecN) Get(i int) float32 {
+ return vn.vec[i]
+}
+
+// Set the element at index i to val.
+func (vn *VecN) Set(i int, val float32) {
+ vn.vec[i] = val
+}
+
+// Sends the allocated memory through the callback if it exists
+func (vn *VecN) destroy() {
+ if vn == nil || vn.vec == nil {
+ return
+ }
+
+ if shouldPool {
+ returnToPool(vn.vec)
+ }
+ vn.vec = nil
+}
+
+// Resize the underlying slice to the desired amount, reallocating or retrieving
+// from the pool if necessary. The values after a Resize cannot be expected to
+// be related to the values before a Resize.
+//
+// If the caller is a nil pointer, this returns a value as if NewVecN(n) had
+// been called, otherwise it simply returns the caller.
+func (vn *VecN) Resize(n int) *VecN {
+ if vn == nil {
+ return NewVecN(n)
+ }
+
+ if n <= cap(vn.vec) {
+ if vn.vec != nil {
+ vn.vec = vn.vec[:n]
+ } else {
+ vn.vec = []float32{}
+ }
+ return vn
+ }
+
+ if shouldPool && vn.vec != nil {
+ returnToPool(vn.vec)
+ }
+ *vn = (*NewVecN(n))
+
+ return vn
+}
+
+// SetBackingSlice sets the vector's backing slice to the given
+// new one.
+func (vn *VecN) SetBackingSlice(newSlice []float32) {
+ vn.vec = newSlice
+}
+
+// Size returns the len of the vector's underlying slice.
+// This is not titled Len because it conflicts the package's
+// convention of calling the Norm the Len.
+func (vn *VecN) Size() int {
+ return len(vn.vec)
+}
+
+// Cap Returns the cap of the vector's underlying slice.
+func (vn *VecN) Cap() int {
+ return cap(vn.vec)
+}
+
+// Zero sets the vector's size to n and zeroes out the vector.
+// If n is bigger than the vector's size, it will realloc.
+func (vn *VecN) Zero(n int) {
+ vn.Resize(n)
+ for i := range vn.vec {
+ vn.vec[i] = 0
+ }
+}
+
+// Add adds vn and addend, storing the result in dst.
+// If dst does not have sufficient size it will be resized
+// Dst may be one of the other arguments. If dst is nil, it will be allocated.
+// The value returned is dst, for easier method chaining
+//
+// If vn and addend are not the same size, this function will add min(vn.Size(), addend.Size())
+// elements.
+func (vn *VecN) Add(dst *VecN, subtrahend *VecN) *VecN {
+ if vn == nil || subtrahend == nil {
+ return nil
+ }
+ size := intMin(len(vn.vec), len(subtrahend.vec))
+ dst = dst.Resize(size)
+
+ for i := 0; i < size; i++ {
+ dst.vec[i] = vn.vec[i] + subtrahend.vec[i]
+ }
+
+ return dst
+}
+
+// Sub subtracts addend from vn, storing the result in dst.
+// If dst does not have sufficient size it will be resized
+// Dst may be one of the other arguments. If dst is nil, it will be allocated.
+// The value returned is dst, for easier method chaining
+//
+// If vn and addend are not the same size, this function will add min(vn.Size(), addend.Size())
+// elements.
+func (vn *VecN) Sub(dst *VecN, addend *VecN) *VecN {
+ if vn == nil || addend == nil {
+ return nil
+ }
+ size := intMin(len(vn.vec), len(addend.vec))
+ dst = dst.Resize(size)
+
+ for i := 0; i < size; i++ {
+ dst.vec[i] = vn.vec[i] - addend.vec[i]
+ }
+
+ return dst
+}
+
+// Cross takes the binary cross product of vn and other, and stores it in dst.
+// If either vn or other are not of size 3 this function will panic
+//
+// If dst is not of sufficient size, or is nil, a new slice is allocated.
+// Dst is permitted to be one of the other arguments
+func (vn *VecN) Cross(dst *VecN, other *VecN) *VecN {
+ if vn == nil || other == nil {
+ return nil
+ }
+ if len(vn.vec) != 3 || len(other.vec) != 3 {
+ panic("Cannot take binary cross product of non-3D elements (7D cross product not implemented)")
+ }
+
+ dst = dst.Resize(3)
+ dst.vec[0], dst.vec[1], dst.vec[2] = vn.vec[1]*other.vec[2]-vn.vec[2]*other.vec[1], vn.vec[2]*other.vec[0]-vn.vec[0]*other.vec[2], vn.vec[0]*other.vec[1]-vn.vec[1]*other.vec[0]
+
+ return dst
+}
+
+func intMin(a, b int) int {
+ if a < b {
+ return a
+ }
+
+ return b
+}
+
+// Dot computes the dot product of two VecNs, if
+// the two vectors are not of the same length -- this
+// will return NaN.
+func (vn *VecN) Dot(other *VecN) float32 {
+ if vn == nil || other == nil || len(vn.vec) != len(other.vec) {
+ return float32(math.NaN())
+ }
+
+ var result float32 = 0.0
+ for i, el := range vn.vec {
+ result += el * other.vec[i]
+ }
+
+ return result
+}
+
+// Len computes the vector length (also called the Norm) of the
+// vector. Equivalent to math.Sqrt(vn.Dot(vn)) with the appropriate
+// type conversions.
+//
+// If vn is nil, this returns NaN
+func (vn *VecN) Len() float32 {
+ if vn == nil {
+ return float32(math.NaN())
+ }
+ if len(vn.vec) == 0 {
+ return 0
+ }
+
+ return float32(math.Sqrt(float64(vn.Dot(vn))))
+}
+
+// LenSqr returns the vector's square length. This is equivalent to the sum of the squares of all elements.
+func (vn *VecN) LenSqr() float32 {
+ if vn == nil {
+ return float32(math.NaN())
+ }
+ if len(vn.vec) == 0 {
+ return 0
+ }
+
+ return vn.Dot(vn)
+}
+
+// Normalize the vector and stores the result in dst, which
+// will be returned. Dst will be appropraitely resized to the
+// size of vn.
+//
+// The destination can be vn itself and nothing will go wrong.
+//
+// This is equivalent to vn.Mul(dst, 1/vn.Len())
+func (vn *VecN) Normalize(dst *VecN) *VecN {
+ if vn == nil {
+ return nil
+ }
+
+ return vn.Mul(dst, 1/vn.Len())
+}
+
+// Mul multiplies the vector by some scalar value and stores the result in dst,
+// which will be returned. Dst will be appropriately resized to the size of vn.
+//
+// The destination can be vn itself and nothing will go wrong.
+func (vn *VecN) Mul(dst *VecN, c float32) *VecN {
+ if vn == nil {
+ return nil
+ }
+ dst = dst.Resize(len(vn.vec))
+
+ for i, el := range vn.vec {
+ dst.vec[i] = el * c
+ }
+
+ return dst
+}
+
+// OuterProd performs the vector outer product between vn and v2.
+// The outer product is like a "reverse" dot product. Where the dot product
+// aligns both vectors with the "sized" part facing "inward" (Vec3*Vec3=Mat1x3*Mat3x1=Mat1x1=Scalar).
+// The outer product multiplied them with it facing "outward"
+// (Vec3*Vec3=Mat3x1*Mat1x3=Mat3x3).
+//
+// The matrix dst will be Reshaped to the correct size, if vn or v2 are nil,
+// this returns nil.
+func (vn *VecN) OuterProd(dst *MatMxN, v2 *VecN) *MatMxN {
+ if vn == nil || v2 == nil {
+ return nil
+ }
+
+ dst = dst.Reshape(len(vn.vec), len(v2.vec))
+
+ for c, el1 := range v2.vec {
+ for r, el2 := range vn.vec {
+ dst.Set(r, c, el1*el2)
+ }
+ }
+
+ return dst
+}
+
+// ApproxEqual returns whether the two vectors are approximately equal (See
+// FloatEqual).
+func (vn *VecN) ApproxEqual(vn2 *VecN) bool {
+ if vn == nil || vn2 == nil || len(vn.vec) != len(vn2.vec) {
+ return false
+ }
+
+ for i, el := range vn.vec {
+ if !FloatEqual(el, vn2.vec[i]) {
+ return false
+ }
+ }
+
+ return true
+}
+
+// ApproxEqualThreshold returns whether the two vectors are approximately equal
+// to within the given threshold given by "epsilon" (See ApproxEqualThreshold).
+func (vn *VecN) ApproxEqualThreshold(vn2 *VecN, epsilon float32) bool {
+ if vn == nil || vn2 == nil || len(vn.vec) != len(vn2.vec) {
+ return false
+ }
+
+ for i, el := range vn.vec {
+ if !FloatEqualThreshold(el, vn2.vec[i], epsilon) {
+ return false
+ }
+ }
+
+ return true
+}
+
+// ApproxEqualFunc returns whether the two vectors are approximately equal,
+// given a function which compares two scalar elements.
+func (vn *VecN) ApproxEqualFunc(vn2 *VecN, comp func(float32, float32) bool) bool {
+ if vn == nil || vn2 == nil || len(vn.vec) != len(vn2.vec) {
+ return false
+ }
+
+ for i, el := range vn.vec {
+ if !comp(el, vn2.vec[i]) {
+ return false
+ }
+ }
+
+ return true
+}
+
+// Vec2 constructs a 2-dimensional vector by discarding coordinates.
+func (vn *VecN) Vec2() Vec2 {
+ raw := vn.Raw()
+ return Vec2{raw[0], raw[1]}
+}
+
+// Vec3 constructs a 3-dimensional vector by discarding coordinates.
+func (vn *VecN) Vec3() Vec3 {
+ raw := vn.Raw()
+ return Vec3{raw[0], raw[1], raw[2]}
+}
+
+// Vec4 constructs a 4-dimensional vector by discarding coordinates.
+func (vn *VecN) Vec4() Vec4 {
+ raw := vn.Raw()
+ return Vec4{raw[0], raw[1], raw[2], raw[3]}
+}
diff --git a/archive/vendor/github.com/go-gl/mathgl/mgl32/vector.go b/archive/vendor/github.com/go-gl/mathgl/mgl32/vector.go
new file mode 100644
index 0000000..cda68d3
--- /dev/null
+++ b/archive/vendor/github.com/go-gl/mathgl/mgl32/vector.go
@@ -0,0 +1,591 @@
+// Copyright 2014 The go-gl/mathgl Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// This file is generated by codegen.go; DO NOT EDIT
+// Edit vector.tmpl and run "go generate" to make changes.
+
+package mgl32
+
+import (
+ "math"
+)
+
+type Vec2 [2]float32
+type Vec3 [3]float32
+type Vec4 [4]float32
+
+// Vec3 constructs a 3-dimensional vector by appending the given coordinates.
+func (v Vec2) Vec3(z float32) Vec3 {
+ return Vec3{v[0], v[1], z}
+}
+
+// Vec4 constructs a 4-dimensional vector by appending the given coordinates.
+func (v Vec2) Vec4(z, w float32) Vec4 {
+ return Vec4{v[0], v[1], z, w}
+}
+
+// Vec4 constructs a 4-dimensional vector by appending the given coordinates.
+func (v Vec3) Vec4(w float32) Vec4 {
+ return Vec4{v[0], v[1], v[2], w}
+}
+
+// Vec2 constructs a 2-dimensional vector by discarding coordinates.
+func (v Vec3) Vec2() Vec2 {
+ return Vec2{v[0], v[1]}
+}
+
+// Vec2 constructs a 2-dimensional vector by discarding coordinates.
+func (v Vec4) Vec2() Vec2 {
+ return Vec2{v[0], v[1]}
+}
+
+// Vec3 constructs a 3-dimensional vector by discarding coordinates.
+func (v Vec4) Vec3() Vec3 {
+ return Vec3{v[0], v[1], v[2]}
+}
+
+// Elem extracts the elements of the vector for direct value assignment.
+func (v Vec2) Elem() (x, y float32) {
+ return v[0], v[1]
+}
+
+// Elem extracts the elements of the vector for direct value assignment.
+func (v Vec3) Elem() (x, y, z float32) {
+ return v[0], v[1], v[2]
+}
+
+// Elem extracts the elements of the vector for direct value assignment.
+func (v Vec4) Elem() (x, y, z, w float32) {
+ return v[0], v[1], v[2], v[3]
+}
+
+// Cross is the vector cross product. This operation is only defined on 3D
+// vectors. It is equivalent to Vec3{v1[1]*v2[2]-v1[2]*v2[1],
+// v1[2]*v2[0]-v1[0]*v2[2], v1[0]*v2[1] - v1[1]*v2[0]}. Another interpretation
+// is that it's the vector whose magnitude is |v1||v2|sin(theta) where theta is
+// the angle between v1 and v2.
+//
+// The cross product is most often used for finding surface normals. The cross
+// product of vectors will generate a vector that is perpendicular to the plane
+// they form.
+//
+// Technically, a generalized cross product exists as an "(N-1)ary" operation
+// (that is, the 4D cross product requires 3 4D vectors). But the binary 3D (and
+// 7D) cross product is the most important. It can be considered the area of a
+// parallelogram with sides v1 and v2.
+//
+// Like the dot product, the cross product is roughly a measure of
+// directionality. Two normalized perpendicular vectors will return a vector
+// with a magnitude of 1.0 or -1.0 and two parallel vectors will return a vector
+// with magnitude 0.0. The cross product is "anticommutative" meaning
+// v1.Cross(v2) = -v2.Cross(v1), this property can be useful to know when
+// finding normals, as taking the wrong cross product can lead to the opposite
+// normal of the one you want.
+func (v1 Vec3) Cross(v2 Vec3) Vec3 {
+ return Vec3{v1[1]*v2[2] - v1[2]*v2[1], v1[2]*v2[0] - v1[0]*v2[2], v1[0]*v2[1] - v1[1]*v2[0]}
+}
+
+// Quat reinterprets this vector as a quaternion, with the individual elements
+// staying the same.
+func (v Vec4) Quat() Quat {
+ return Quat{v[3], Vec3{v[0], v[1], v[2]}}
+}
+
+// Add performs element-wise addition between two vectors. It is equivalent to iterating
+// over every element of v1 and adding the corresponding element of v2 to it.
+func (v1 Vec2) Add(v2 Vec2) Vec2 {
+ return Vec2{v1[0] + v2[0], v1[1] + v2[1]}
+}
+
+// Sub performs element-wise subtraction between two vectors. It is equivalent to iterating
+// over every element of v1 and subtracting the corresponding element of v2 from it.
+func (v1 Vec2) Sub(v2 Vec2) Vec2 {
+ return Vec2{v1[0] - v2[0], v1[1] - v2[1]}
+}
+
+// Mul performs a scalar multiplication between the vector and some constant value
+// c. This is equivalent to iterating over every vector element and multiplying by c.
+func (v1 Vec2) Mul(c float32) Vec2 {
+ return Vec2{v1[0] * c, v1[1] * c}
+}
+
+// Dot returns the dot product of this vector with another. There are multiple ways
+// to describe this value. One is the multiplication of their lengths and cos(theta) where
+// theta is the angle between the vectors: v1.v2 = |v1||v2|cos(theta).
+//
+// The other (and what is actually done) is the sum of the element-wise multiplication of all
+// elements. So for instance, two Vec3s would yield v1.x * v2.x + v1.y * v2.y + v1.z * v2.z.
+//
+// This means that the dot product of a vector and itself is the square of its Len (within
+// the bounds of floating points error).
+//
+// The dot product is roughly a measure of how closely two vectors are to pointing in the same
+// direction. If both vectors are normalized, the value will be -1 for opposite pointing,
+// one for same pointing, and 0 for perpendicular vectors.
+func (v1 Vec2) Dot(v2 Vec2) float32 {
+ return v1[0]*v2[0] + v1[1]*v2[1]
+}
+
+// Len returns the vector's length. Note that this is NOT the dimension of
+// the vector (len(v)), but the mathematical length. This is equivalent to the square
+// root of the sum of the squares of all elements. E.G. for a Vec2 it's
+// math.Hypot(v[0], v[1]).
+func (v1 Vec2) Len() float32 {
+
+ return float32(math.Hypot(float64(v1[0]), float64(v1[1])))
+
+}
+
+// LenSqr returns the vector's square length. This is equivalent to the sum of the squares of all elements.
+func (v1 Vec2) LenSqr() float32 {
+ return v1[0]*v1[0] + v1[1]*v1[1]
+}
+
+// Normalize normalizes the vector. Normalization is (1/|v|)*v,
+// making this equivalent to v.Scale(1/v.Len()). If the len is 0.0,
+// this function will return an infinite value for all elements due
+// to how floating point division works in Go (n/0.0 = math.Inf(Sign(n))).
+//
+// Normalization makes a vector's Len become 1.0 (within the margin of floating point error),
+// while maintaining its directionality.
+//
+// (Can be seen here: http://play.golang.org/p/Aaj7SnbqIp )
+func (v1 Vec2) Normalize() Vec2 {
+ l := 1.0 / v1.Len()
+ return Vec2{v1[0] * l, v1[1] * l}
+}
+
+// ApproxEqual takes in a vector and does an element-wise approximate float
+// comparison as if FloatEqual had been used
+func (v1 Vec2) ApproxEqual(v2 Vec2) bool {
+ for i := range v1 {
+ if !FloatEqual(v1[i], v2[i]) {
+ return false
+ }
+ }
+ return true
+}
+
+// ApproxEqualThreshold takes in a threshold for comparing two floats, and uses
+// it to do an element-wise comparison of the vector to another.
+func (v1 Vec2) ApproxEqualThreshold(v2 Vec2, threshold float32) bool {
+ for i := range v1 {
+ if !FloatEqualThreshold(v1[i], v2[i], threshold) {
+ return false
+ }
+ }
+ return true
+}
+
+// ApproxFuncEqual takes in a func that compares two floats, and uses it to do an element-wise
+// comparison of the vector to another. This is intended to be used with FloatEqualFunc
+func (v1 Vec2) ApproxFuncEqual(v2 Vec2, eq func(float32, float32) bool) bool {
+ for i := range v1 {
+ if !eq(v1[i], v2[i]) {
+ return false
+ }
+ }
+ return true
+}
+
+// X is an element access func, it is equivalent to v[n] where
+// n is some valid index. The mappings are XYZW (X=0, Y=1 etc). Benchmarks
+// show that this is more or less as fast as direct acces, probably due to
+// inlining, so use v[0] or v.X() depending on personal preference.
+func (v Vec2) X() float32 {
+ return v[0]
+}
+
+// Y is an element access func, it is equivalent to v[n] where
+// n is some valid index. The mappings are XYZW (X=0, Y=1 etc). Benchmarks
+// show that this is more or less as fast as direct acces, probably due to
+// inlining, so use v[0] or v.X() depending on personal preference.
+func (v Vec2) Y() float32 {
+ return v[1]
+}
+
+// OuterProd2 does the vector outer product
+// of two vectors. The outer product produces an
+// 2x2 matrix. E.G. a Vec2 * Vec2 = Mat2.
+//
+// The outer product can be thought of as the "opposite"
+// of the Dot product. The Dot product treats both vectors like matrices
+// oriented such that the left one has N columns and the right has N rows.
+// So Vec3.Vec3 = Mat1x3*Mat3x1 = Mat1 = Scalar.
+//
+// The outer product orients it so they're facing "outward": Vec2*Vec3
+// = Mat2x1*Mat1x3 = Mat2x3.
+func (v1 Vec2) OuterProd2(v2 Vec2) Mat2 {
+ return Mat2{v1[0] * v2[0], v1[1] * v2[0], v1[0] * v2[1], v1[1] * v2[1]}
+}
+
+// OuterProd3 does the vector outer product
+// of two vectors. The outer product produces an
+// 2x3 matrix. E.G. a Vec2 * Vec3 = Mat2x3.
+//
+// The outer product can be thought of as the "opposite"
+// of the Dot product. The Dot product treats both vectors like matrices
+// oriented such that the left one has N columns and the right has N rows.
+// So Vec3.Vec3 = Mat1x3*Mat3x1 = Mat1 = Scalar.
+//
+// The outer product orients it so they're facing "outward": Vec2*Vec3
+// = Mat2x1*Mat1x3 = Mat2x3.
+func (v1 Vec2) OuterProd3(v2 Vec3) Mat2x3 {
+ return Mat2x3{v1[0] * v2[0], v1[1] * v2[0], v1[0] * v2[1], v1[1] * v2[1], v1[0] * v2[2], v1[1] * v2[2]}
+}
+
+// OuterProd4 does the vector outer product
+// of two vectors. The outer product produces an
+// 2x4 matrix. E.G. a Vec2 * Vec4 = Mat2x4.
+//
+// The outer product can be thought of as the "opposite"
+// of the Dot product. The Dot product treats both vectors like matrices
+// oriented such that the left one has N columns and the right has N rows.
+// So Vec3.Vec3 = Mat1x3*Mat3x1 = Mat1 = Scalar.
+//
+// The outer product orients it so they're facing "outward": Vec2*Vec3
+// = Mat2x1*Mat1x3 = Mat2x3.
+func (v1 Vec2) OuterProd4(v2 Vec4) Mat2x4 {
+ return Mat2x4{v1[0] * v2[0], v1[1] * v2[0], v1[0] * v2[1], v1[1] * v2[1], v1[0] * v2[2], v1[1] * v2[2], v1[0] * v2[3], v1[1] * v2[3]}
+}
+
+// Add performs element-wise addition between two vectors. It is equivalent to iterating
+// over every element of v1 and adding the corresponding element of v2 to it.
+func (v1 Vec3) Add(v2 Vec3) Vec3 {
+ return Vec3{v1[0] + v2[0], v1[1] + v2[1], v1[2] + v2[2]}
+}
+
+// Sub performs element-wise subtraction between two vectors. It is equivalent to iterating
+// over every element of v1 and subtracting the corresponding element of v2 from it.
+func (v1 Vec3) Sub(v2 Vec3) Vec3 {
+ return Vec3{v1[0] - v2[0], v1[1] - v2[1], v1[2] - v2[2]}
+}
+
+// Mul performs a scalar multiplication between the vector and some constant value
+// c. This is equivalent to iterating over every vector element and multiplying by c.
+func (v1 Vec3) Mul(c float32) Vec3 {
+ return Vec3{v1[0] * c, v1[1] * c, v1[2] * c}
+}
+
+// Dot returns the dot product of this vector with another. There are multiple ways
+// to describe this value. One is the multiplication of their lengths and cos(theta) where
+// theta is the angle between the vectors: v1.v2 = |v1||v2|cos(theta).
+//
+// The other (and what is actually done) is the sum of the element-wise multiplication of all
+// elements. So for instance, two Vec3s would yield v1.x * v2.x + v1.y * v2.y + v1.z * v2.z.
+//
+// This means that the dot product of a vector and itself is the square of its Len (within
+// the bounds of floating points error).
+//
+// The dot product is roughly a measure of how closely two vectors are to pointing in the same
+// direction. If both vectors are normalized, the value will be -1 for opposite pointing,
+// one for same pointing, and 0 for perpendicular vectors.
+func (v1 Vec3) Dot(v2 Vec3) float32 {
+ return v1[0]*v2[0] + v1[1]*v2[1] + v1[2]*v2[2]
+}
+
+// Len returns the vector's length. Note that this is NOT the dimension of
+// the vector (len(v)), but the mathematical length. This is equivalent to the square
+// root of the sum of the squares of all elements. E.G. for a Vec2 it's
+// math.Hypot(v[0], v[1]).
+func (v1 Vec3) Len() float32 {
+
+ return float32(math.Sqrt(float64(v1[0]*v1[0] + v1[1]*v1[1] + v1[2]*v1[2])))
+
+}
+
+// LenSqr returns the vector's square length. This is equivalent to the sum of the squares of all elements.
+func (v1 Vec3) LenSqr() float32 {
+ return v1[0]*v1[0] + v1[1]*v1[1] + v1[2]*v1[2]
+}
+
+// Normalize normalizes the vector. Normalization is (1/|v|)*v,
+// making this equivalent to v.Scale(1/v.Len()). If the len is 0.0,
+// this function will return an infinite value for all elements due
+// to how floating point division works in Go (n/0.0 = math.Inf(Sign(n))).
+//
+// Normalization makes a vector's Len become 1.0 (within the margin of floating point error),
+// while maintaining its directionality.
+//
+// (Can be seen here: http://play.golang.org/p/Aaj7SnbqIp )
+func (v1 Vec3) Normalize() Vec3 {
+ l := 1.0 / v1.Len()
+ return Vec3{v1[0] * l, v1[1] * l, v1[2] * l}
+}
+
+// ApproxEqual takes in a vector and does an element-wise approximate float
+// comparison as if FloatEqual had been used
+func (v1 Vec3) ApproxEqual(v2 Vec3) bool {
+ for i := range v1 {
+ if !FloatEqual(v1[i], v2[i]) {
+ return false
+ }
+ }
+ return true
+}
+
+// ApproxEqualThreshold takes in a threshold for comparing two floats, and uses
+// it to do an element-wise comparison of the vector to another.
+func (v1 Vec3) ApproxEqualThreshold(v2 Vec3, threshold float32) bool {
+ for i := range v1 {
+ if !FloatEqualThreshold(v1[i], v2[i], threshold) {
+ return false
+ }
+ }
+ return true
+}
+
+// ApproxFuncEqual takes in a func that compares two floats, and uses it to do an element-wise
+// comparison of the vector to another. This is intended to be used with FloatEqualFunc
+func (v1 Vec3) ApproxFuncEqual(v2 Vec3, eq func(float32, float32) bool) bool {
+ for i := range v1 {
+ if !eq(v1[i], v2[i]) {
+ return false
+ }
+ }
+ return true
+}
+
+// X is an element access func, it is equivalent to v[n] where
+// n is some valid index. The mappings are XYZW (X=0, Y=1 etc). Benchmarks
+// show that this is more or less as fast as direct acces, probably due to
+// inlining, so use v[0] or v.X() depending on personal preference.
+func (v Vec3) X() float32 {
+ return v[0]
+}
+
+// Y is an element access func, it is equivalent to v[n] where
+// n is some valid index. The mappings are XYZW (X=0, Y=1 etc). Benchmarks
+// show that this is more or less as fast as direct acces, probably due to
+// inlining, so use v[0] or v.X() depending on personal preference.
+func (v Vec3) Y() float32 {
+ return v[1]
+}
+
+// Z is an element access func, it is equivalent to v[n] where
+// n is some valid index. The mappings are XYZW (X=0, Y=1 etc). Benchmarks
+// show that this is more or less as fast as direct acces, probably due to
+// inlining, so use v[0] or v.X() depending on personal preference.
+func (v Vec3) Z() float32 {
+ return v[2]
+}
+
+// OuterProd2 does the vector outer product
+// of two vectors. The outer product produces an
+// 3x2 matrix. E.G. a Vec3 * Vec2 = Mat3x2.
+//
+// The outer product can be thought of as the "opposite"
+// of the Dot product. The Dot product treats both vectors like matrices
+// oriented such that the left one has N columns and the right has N rows.
+// So Vec3.Vec3 = Mat1x3*Mat3x1 = Mat1 = Scalar.
+//
+// The outer product orients it so they're facing "outward": Vec2*Vec3
+// = Mat2x1*Mat1x3 = Mat2x3.
+func (v1 Vec3) OuterProd2(v2 Vec2) Mat3x2 {
+ return Mat3x2{v1[0] * v2[0], v1[1] * v2[0], v1[2] * v2[0], v1[0] * v2[1], v1[1] * v2[1], v1[2] * v2[1]}
+}
+
+// OuterProd3 does the vector outer product
+// of two vectors. The outer product produces an
+// 3x3 matrix. E.G. a Vec3 * Vec3 = Mat3.
+//
+// The outer product can be thought of as the "opposite"
+// of the Dot product. The Dot product treats both vectors like matrices
+// oriented such that the left one has N columns and the right has N rows.
+// So Vec3.Vec3 = Mat1x3*Mat3x1 = Mat1 = Scalar.
+//
+// The outer product orients it so they're facing "outward": Vec2*Vec3
+// = Mat2x1*Mat1x3 = Mat2x3.
+func (v1 Vec3) OuterProd3(v2 Vec3) Mat3 {
+ return Mat3{v1[0] * v2[0], v1[1] * v2[0], v1[2] * v2[0], v1[0] * v2[1], v1[1] * v2[1], v1[2] * v2[1], v1[0] * v2[2], v1[1] * v2[2], v1[2] * v2[2]}
+}
+
+// OuterProd4 does the vector outer product
+// of two vectors. The outer product produces an
+// 3x4 matrix. E.G. a Vec3 * Vec4 = Mat3x4.
+//
+// The outer product can be thought of as the "opposite"
+// of the Dot product. The Dot product treats both vectors like matrices
+// oriented such that the left one has N columns and the right has N rows.
+// So Vec3.Vec3 = Mat1x3*Mat3x1 = Mat1 = Scalar.
+//
+// The outer product orients it so they're facing "outward": Vec2*Vec3
+// = Mat2x1*Mat1x3 = Mat2x3.
+func (v1 Vec3) OuterProd4(v2 Vec4) Mat3x4 {
+ return Mat3x4{v1[0] * v2[0], v1[1] * v2[0], v1[2] * v2[0], v1[0] * v2[1], v1[1] * v2[1], v1[2] * v2[1], v1[0] * v2[2], v1[1] * v2[2], v1[2] * v2[2], v1[0] * v2[3], v1[1] * v2[3], v1[2] * v2[3]}
+}
+
+// Add performs element-wise addition between two vectors. It is equivalent to iterating
+// over every element of v1 and adding the corresponding element of v2 to it.
+func (v1 Vec4) Add(v2 Vec4) Vec4 {
+ return Vec4{v1[0] + v2[0], v1[1] + v2[1], v1[2] + v2[2], v1[3] + v2[3]}
+}
+
+// Sub performs element-wise subtraction between two vectors. It is equivalent to iterating
+// over every element of v1 and subtracting the corresponding element of v2 from it.
+func (v1 Vec4) Sub(v2 Vec4) Vec4 {
+ return Vec4{v1[0] - v2[0], v1[1] - v2[1], v1[2] - v2[2], v1[3] - v2[3]}
+}
+
+// Mul performs a scalar multiplication between the vector and some constant value
+// c. This is equivalent to iterating over every vector element and multiplying by c.
+func (v1 Vec4) Mul(c float32) Vec4 {
+ return Vec4{v1[0] * c, v1[1] * c, v1[2] * c, v1[3] * c}
+}
+
+// Dot returns the dot product of this vector with another. There are multiple ways
+// to describe this value. One is the multiplication of their lengths and cos(theta) where
+// theta is the angle between the vectors: v1.v2 = |v1||v2|cos(theta).
+//
+// The other (and what is actually done) is the sum of the element-wise multiplication of all
+// elements. So for instance, two Vec3s would yield v1.x * v2.x + v1.y * v2.y + v1.z * v2.z.
+//
+// This means that the dot product of a vector and itself is the square of its Len (within
+// the bounds of floating points error).
+//
+// The dot product is roughly a measure of how closely two vectors are to pointing in the same
+// direction. If both vectors are normalized, the value will be -1 for opposite pointing,
+// one for same pointing, and 0 for perpendicular vectors.
+func (v1 Vec4) Dot(v2 Vec4) float32 {
+ return v1[0]*v2[0] + v1[1]*v2[1] + v1[2]*v2[2] + v1[3]*v2[3]
+}
+
+// Len returns the vector's length. Note that this is NOT the dimension of
+// the vector (len(v)), but the mathematical length. This is equivalent to the square
+// root of the sum of the squares of all elements. E.G. for a Vec2 it's
+// math.Hypot(v[0], v[1]).
+func (v1 Vec4) Len() float32 {
+
+ return float32(math.Sqrt(float64(v1[0]*v1[0] + v1[1]*v1[1] + v1[2]*v1[2] + v1[3]*v1[3])))
+
+}
+
+// LenSqr returns the vector's square length. This is equivalent to the sum of the squares of all elements.
+func (v1 Vec4) LenSqr() float32 {
+ return v1[0]*v1[0] + v1[1]*v1[1] + v1[2]*v1[2] + v1[3]*v1[3]
+}
+
+// Normalize normalizes the vector. Normalization is (1/|v|)*v,
+// making this equivalent to v.Scale(1/v.Len()). If the len is 0.0,
+// this function will return an infinite value for all elements due
+// to how floating point division works in Go (n/0.0 = math.Inf(Sign(n))).
+//
+// Normalization makes a vector's Len become 1.0 (within the margin of floating point error),
+// while maintaining its directionality.
+//
+// (Can be seen here: http://play.golang.org/p/Aaj7SnbqIp )
+func (v1 Vec4) Normalize() Vec4 {
+ l := 1.0 / v1.Len()
+ return Vec4{v1[0] * l, v1[1] * l, v1[2] * l, v1[3] * l}
+}
+
+// ApproxEqual takes in a vector and does an element-wise approximate float
+// comparison as if FloatEqual had been used
+func (v1 Vec4) ApproxEqual(v2 Vec4) bool {
+ for i := range v1 {
+ if !FloatEqual(v1[i], v2[i]) {
+ return false
+ }
+ }
+ return true
+}
+
+// ApproxEqualThreshold takes in a threshold for comparing two floats, and uses
+// it to do an element-wise comparison of the vector to another.
+func (v1 Vec4) ApproxEqualThreshold(v2 Vec4, threshold float32) bool {
+ for i := range v1 {
+ if !FloatEqualThreshold(v1[i], v2[i], threshold) {
+ return false
+ }
+ }
+ return true
+}
+
+// ApproxFuncEqual takes in a func that compares two floats, and uses it to do an element-wise
+// comparison of the vector to another. This is intended to be used with FloatEqualFunc
+func (v1 Vec4) ApproxFuncEqual(v2 Vec4, eq func(float32, float32) bool) bool {
+ for i := range v1 {
+ if !eq(v1[i], v2[i]) {
+ return false
+ }
+ }
+ return true
+}
+
+// X is an element access func, it is equivalent to v[n] where
+// n is some valid index. The mappings are XYZW (X=0, Y=1 etc). Benchmarks
+// show that this is more or less as fast as direct acces, probably due to
+// inlining, so use v[0] or v.X() depending on personal preference.
+func (v Vec4) X() float32 {
+ return v[0]
+}
+
+// Y is an element access func, it is equivalent to v[n] where
+// n is some valid index. The mappings are XYZW (X=0, Y=1 etc). Benchmarks
+// show that this is more or less as fast as direct acces, probably due to
+// inlining, so use v[0] or v.X() depending on personal preference.
+func (v Vec4) Y() float32 {
+ return v[1]
+}
+
+// Z is an element access func, it is equivalent to v[n] where
+// n is some valid index. The mappings are XYZW (X=0, Y=1 etc). Benchmarks
+// show that this is more or less as fast as direct acces, probably due to
+// inlining, so use v[0] or v.X() depending on personal preference.
+func (v Vec4) Z() float32 {
+ return v[2]
+}
+
+// W is an element access func, it is equivalent to v[n] where
+// n is some valid index. The mappings are XYZW (X=0, Y=1 etc). Benchmarks
+// show that this is more or less as fast as direct acces, probably due to
+// inlining, so use v[0] or v.X() depending on personal preference.
+func (v Vec4) W() float32 {
+ return v[3]
+}
+
+// OuterProd2 does the vector outer product
+// of two vectors. The outer product produces an
+// 4x2 matrix. E.G. a Vec4 * Vec2 = Mat4x2.
+//
+// The outer product can be thought of as the "opposite"
+// of the Dot product. The Dot product treats both vectors like matrices
+// oriented such that the left one has N columns and the right has N rows.
+// So Vec3.Vec3 = Mat1x3*Mat3x1 = Mat1 = Scalar.
+//
+// The outer product orients it so they're facing "outward": Vec2*Vec3
+// = Mat2x1*Mat1x3 = Mat2x3.
+func (v1 Vec4) OuterProd2(v2 Vec2) Mat4x2 {
+ return Mat4x2{v1[0] * v2[0], v1[1] * v2[0], v1[2] * v2[0], v1[3] * v2[0], v1[0] * v2[1], v1[1] * v2[1], v1[2] * v2[1], v1[3] * v2[1]}
+}
+
+// OuterProd3 does the vector outer product
+// of two vectors. The outer product produces an
+// 4x3 matrix. E.G. a Vec4 * Vec3 = Mat4x3.
+//
+// The outer product can be thought of as the "opposite"
+// of the Dot product. The Dot product treats both vectors like matrices
+// oriented such that the left one has N columns and the right has N rows.
+// So Vec3.Vec3 = Mat1x3*Mat3x1 = Mat1 = Scalar.
+//
+// The outer product orients it so they're facing "outward": Vec2*Vec3
+// = Mat2x1*Mat1x3 = Mat2x3.
+func (v1 Vec4) OuterProd3(v2 Vec3) Mat4x3 {
+ return Mat4x3{v1[0] * v2[0], v1[1] * v2[0], v1[2] * v2[0], v1[3] * v2[0], v1[0] * v2[1], v1[1] * v2[1], v1[2] * v2[1], v1[3] * v2[1], v1[0] * v2[2], v1[1] * v2[2], v1[2] * v2[2], v1[3] * v2[2]}
+}
+
+// OuterProd4 does the vector outer product
+// of two vectors. The outer product produces an
+// 4x4 matrix. E.G. a Vec4 * Vec4 = Mat4.
+//
+// The outer product can be thought of as the "opposite"
+// of the Dot product. The Dot product treats both vectors like matrices
+// oriented such that the left one has N columns and the right has N rows.
+// So Vec3.Vec3 = Mat1x3*Mat3x1 = Mat1 = Scalar.
+//
+// The outer product orients it so they're facing "outward": Vec2*Vec3
+// = Mat2x1*Mat1x3 = Mat2x3.
+func (v1 Vec4) OuterProd4(v2 Vec4) Mat4 {
+ return Mat4{v1[0] * v2[0], v1[1] * v2[0], v1[2] * v2[0], v1[3] * v2[0], v1[0] * v2[1], v1[1] * v2[1], v1[2] * v2[1], v1[3] * v2[1], v1[0] * v2[2], v1[1] * v2[2], v1[2] * v2[2], v1[3] * v2[2], v1[0] * v2[3], v1[1] * v2[3], v1[2] * v2[3], v1[3] * v2[3]}
+}
diff --git a/archive/vendor/github.com/go-gl/mathgl/mgl32/vector.tmpl b/archive/vendor/github.com/go-gl/mathgl/mgl32/vector.tmpl
new file mode 100644
index 0000000..c047bba
--- /dev/null
+++ b/archive/vendor/github.com/go-gl/mathgl/mgl32/vector.tmpl
@@ -0,0 +1,226 @@
+// Copyright 2014 The go-gl/mathgl Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// <<.Comment>>
+// Edit <<.TemplateName>> and run "go generate" to make changes.
+
+package mgl32
+
+import (
+ "math"
+)
+
+type Vec2 [2]float32
+type Vec3 [3]float32
+type Vec4 [4]float32
+
+// Vec3 constructs a 3-dimensional vector by appending the given coordinates.
+func (v Vec2) Vec3(z float32) Vec3 {
+ return Vec3{v[0], v[1], z}
+}
+
+// Vec4 constructs a 4-dimensional vector by appending the given coordinates.
+func (v Vec2) Vec4(z, w float32) Vec4 {
+ return Vec4{v[0], v[1], z, w}
+}
+
+// Vec4 constructs a 4-dimensional vector by appending the given coordinates.
+func (v Vec3) Vec4(w float32) Vec4 {
+ return Vec4{v[0], v[1], v[2], w}
+}
+
+// Vec2 constructs a 2-dimensional vector by discarding coordinates.
+func (v Vec3) Vec2() Vec2 {
+ return Vec2{v[0], v[1]}
+}
+
+// Vec2 constructs a 2-dimensional vector by discarding coordinates.
+func (v Vec4) Vec2() Vec2 {
+ return Vec2{v[0], v[1]}
+}
+
+// Vec3 constructs a 3-dimensional vector by discarding coordinates.
+func (v Vec4) Vec3() Vec3 {
+ return Vec3{v[0], v[1], v[2]}
+}
+
+// Elem extracts the elements of the vector for direct value assignment.
+func (v Vec2) Elem() (x, y float32) {
+ return v[0], v[1]
+}
+
+// Elem extracts the elements of the vector for direct value assignment.
+func (v Vec3) Elem() (x, y, z float32) {
+ return v[0], v[1], v[2]
+}
+
+// Elem extracts the elements of the vector for direct value assignment.
+func (v Vec4) Elem() (x, y, z, w float32) {
+ return v[0], v[1], v[2], v[3]
+}
+
+// Cross is the vector cross product. This operation is only defined on 3D
+// vectors. It is equivalent to Vec3{v1[1]*v2[2]-v1[2]*v2[1],
+// v1[2]*v2[0]-v1[0]*v2[2], v1[0]*v2[1] - v1[1]*v2[0]}. Another interpretation
+// is that it's the vector whose magnitude is |v1||v2|sin(theta) where theta is
+// the angle between v1 and v2.
+//
+// The cross product is most often used for finding surface normals. The cross
+// product of vectors will generate a vector that is perpendicular to the plane
+// they form.
+//
+// Technically, a generalized cross product exists as an "(N-1)ary" operation
+// (that is, the 4D cross product requires 3 4D vectors). But the binary 3D (and
+// 7D) cross product is the most important. It can be considered the area of a
+// parallelogram with sides v1 and v2.
+//
+// Like the dot product, the cross product is roughly a measure of
+// directionality. Two normalized perpendicular vectors will return a vector
+// with a magnitude of 1.0 or -1.0 and two parallel vectors will return a vector
+// with magnitude 0.0. The cross product is "anticommutative" meaning
+// v1.Cross(v2) = -v2.Cross(v1), this property can be useful to know when
+// finding normals, as taking the wrong cross product can lead to the opposite
+// normal of the one you want.
+func (v1 Vec3) Cross(v2 Vec3) Vec3 {
+ return Vec3{v1[1]*v2[2] - v1[2]*v2[1], v1[2]*v2[0] - v1[0]*v2[2], v1[0]*v2[1] - v1[1]*v2[0]}
+}
+
+// Quat reinterprets this vector as a quaternion, with the individual elements
+// staying the same.
+func (v Vec4) Quat() Quat {
+ return Quat{v[3], Vec3{v[0], v[1], v[2]}}
+}
+
+
+<* Common functions for all vectors */>>
+<>
+<<$type := typename $m 1>>
+
+// Add performs element-wise addition between two vectors. It is equivalent to iterating
+// over every element of v1 and adding the corresponding element of v2 to it.
+func (v1 <<$type>>) Add(v2 <<$type>>) <<$type>> {
+ return <<$type>>{<> v1[<<$i>>] + v2[<<$i>>], <>}
+}
+
+// Sub performs element-wise subtraction between two vectors. It is equivalent to iterating
+// over every element of v1 and subtracting the corresponding element of v2 from it.
+func (v1 <<$type>>) Sub(v2 <<$type>>) <<$type>> {
+ return <<$type>>{<> v1[<<$i>>] - v2[<<$i>>], <>}
+}
+
+// Mul performs a scalar multiplication between the vector and some constant value
+// c. This is equivalent to iterating over every vector element and multiplying by c.
+func (v1 <<$type>>) Mul(c float32) <<$type>> {
+ return <<$type>>{<> v1[<<$i>>] * c, <>}
+}
+
+// Dot returns the dot product of this vector with another. There are multiple ways
+// to describe this value. One is the multiplication of their lengths and cos(theta) where
+// theta is the angle between the vectors: v1.v2 = |v1||v2|cos(theta).
+//
+// The other (and what is actually done) is the sum of the element-wise multiplication of all
+// elements. So for instance, two Vec3s would yield v1.x * v2.x + v1.y * v2.y + v1.z * v2.z.
+//
+// This means that the dot product of a vector and itself is the square of its Len (within
+// the bounds of floating points error).
+//
+// The dot product is roughly a measure of how closely two vectors are to pointing in the same
+// direction. If both vectors are normalized, the value will be -1 for opposite pointing,
+// one for same pointing, and 0 for perpendicular vectors.
+func (v1 <<$type>>) Dot(v2 <<$type>>) float32 {
+ return <><> v1[<<$i>>]*v2[<<$i>>] <>
+}
+
+// Len returns the vector's length. Note that this is NOT the dimension of
+// the vector (len(v)), but the mathematical length. This is equivalent to the square
+// root of the sum of the squares of all elements. E.G. for a Vec2 it's
+// math.Hypot(v[0], v[1]).
+func (v1 <<$type>>) Len() float32 {
+ <>
+ return float32(math.Hypot(float64(v1[0]), float64(v1[1])))
+ <>
+ return float32(math.Sqrt(float64(<>)))
+ <>
+}
+
+// LenSqr returns the vector's square length. This is equivalent to the sum of the squares of all elements.
+func (v1 <<$type>>) LenSqr() float32 {
+ return <>
+}
+
+// Normalize normalizes the vector. Normalization is (1/|v|)*v,
+// making this equivalent to v.Scale(1/v.Len()). If the len is 0.0,
+// this function will return an infinite value for all elements due
+// to how floating point division works in Go (n/0.0 = math.Inf(Sign(n))).
+//
+// Normalization makes a vector's Len become 1.0 (within the margin of floating point error),
+// while maintaining its directionality.
+//
+// (Can be seen here: http://play.golang.org/p/Aaj7SnbqIp )
+func (v1 <<$type>>) Normalize() <<$type>> {
+ l := 1.0 / v1.Len()
+ return <<$type>>{<>v1[<<$i>>] * l,<>}
+}
+
+// ApproxEqual takes in a vector and does an element-wise approximate float
+// comparison as if FloatEqual had been used
+func (v1 <<$type>>) ApproxEqual(v2 <<$type>>) bool {
+ for i := range v1 {
+ if !FloatEqual(v1[i], v2[i]) {
+ return false
+ }
+ }
+ return true
+}
+
+// ApproxEqualThreshold takes in a threshold for comparing two floats, and uses
+// it to do an element-wise comparison of the vector to another.
+func (v1 <<$type>>) ApproxEqualThreshold(v2 <<$type>>, threshold float32) bool {
+ for i := range v1 {
+ if !FloatEqualThreshold(v1[i], v2[i], threshold) {
+ return false
+ }
+ }
+ return true
+}
+
+// ApproxFuncEqual takes in a func that compares two floats, and uses it to do an element-wise
+// comparison of the vector to another. This is intended to be used with FloatEqualFunc
+func (v1 <<$type>>) ApproxFuncEqual(v2 <<$type>>, eq func(float32, float32) bool) bool {
+ for i := range v1 {
+ if !eq(v1[i], v2[i]) {
+ return false
+ }
+ }
+ return true
+}
+
+<>
+// <> is an element access func, it is equivalent to v[n] where
+// n is some valid index. The mappings are XYZW (X=0, Y=1 etc). Benchmarks
+// show that this is more or less as fast as direct acces, probably due to
+// inlining, so use v[0] or v.X() depending on personal preference.
+func (v <<$type>>) <>() float32 {
+ return v[<<$i>>]
+}
+<>
+
+<>
+// OuterProd<<$n>> does the vector outer product
+// of two vectors. The outer product produces an
+// <<$m>>x<<$n>> matrix. E.G. a Vec<<$m>> * Vec<<$n>> = <>.
+//
+// The outer product can be thought of as the "opposite"
+// of the Dot product. The Dot product treats both vectors like matrices
+// oriented such that the left one has N columns and the right has N rows.
+// So Vec3.Vec3 = Mat1x3*Mat3x1 = Mat1 = Scalar.
+//
+// The outer product orients it so they're facing "outward": Vec2*Vec3
+// = Mat2x1*Mat1x3 = Mat2x3.
+func (v1 <<$type>>) OuterProd<<$n>>(v2 <>) <> {
+ return <>{<>v1[<<$i.M>>] * v2[<<$i.N>>], <>}
+}
+<>
+
+<> <* range $m */>>
diff --git a/archive/vendor/github.com/godbus/dbus/v5/CONTRIBUTING.md b/archive/vendor/github.com/godbus/dbus/v5/CONTRIBUTING.md
new file mode 100644
index 0000000..c88f9b2
--- /dev/null
+++ b/archive/vendor/github.com/godbus/dbus/v5/CONTRIBUTING.md
@@ -0,0 +1,50 @@
+# How to Contribute
+
+## Getting Started
+
+- Fork the repository on GitHub
+- Read the [README](README.markdown) for build and test instructions
+- Play with the project, submit bugs, submit patches!
+
+## Contribution Flow
+
+This is a rough outline of what a contributor's workflow looks like:
+
+- Create a topic branch from where you want to base your work (usually master).
+- Make commits of logical units.
+- Make sure your commit messages are in the proper format (see below).
+- Push your changes to a topic branch in your fork of the repository.
+- Make sure the tests pass, and add any new tests as appropriate.
+- Submit a pull request to the original repository.
+
+Thanks for your contributions!
+
+### Format of the Commit Message
+
+We follow a rough convention for commit messages that is designed to answer two
+questions: what changed and why. The subject line should feature the what and
+the body of the commit should describe the why.
+
+```
+scripts: add the test-cluster command
+
+this uses tmux to setup a test cluster that you can easily kill and
+start for debugging.
+
+Fixes #38
+```
+
+The format can be described more formally as follows:
+
+```
+:
+
+
+
+
+```
+
+The first line is the subject and should be no longer than 70 characters, the
+second line is always blank, and other lines should be wrapped at 80 characters.
+This allows the message to be easier to read on GitHub as well as in various
+git tools.
diff --git a/archive/vendor/github.com/godbus/dbus/v5/LICENSE b/archive/vendor/github.com/godbus/dbus/v5/LICENSE
new file mode 100644
index 0000000..670d88f
--- /dev/null
+++ b/archive/vendor/github.com/godbus/dbus/v5/LICENSE
@@ -0,0 +1,25 @@
+Copyright (c) 2013, Georg Reinke (), Google
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+1. Redistributions of source code must retain the above copyright notice,
+this list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright
+notice, this list of conditions and the following disclaimer in the
+documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/archive/vendor/github.com/godbus/dbus/v5/MAINTAINERS b/archive/vendor/github.com/godbus/dbus/v5/MAINTAINERS
new file mode 100644
index 0000000..27618c9
--- /dev/null
+++ b/archive/vendor/github.com/godbus/dbus/v5/MAINTAINERS
@@ -0,0 +1,3 @@
+Brandon Philips (@philips)
+Brian Waldon (@bcwaldon)
+John Southworth (@jsouthworth)
diff --git a/archive/vendor/github.com/godbus/dbus/v5/README.md b/archive/vendor/github.com/godbus/dbus/v5/README.md
new file mode 100644
index 0000000..5c24125
--- /dev/null
+++ b/archive/vendor/github.com/godbus/dbus/v5/README.md
@@ -0,0 +1,46 @@
+
+
+dbus
+----
+
+dbus is a simple library that implements native Go client bindings for the
+D-Bus message bus system.
+
+### Features
+
+* Complete native implementation of the D-Bus message protocol
+* Go-like API (channels for signals / asynchronous method calls, Goroutine-safe connections)
+* Subpackages that help with the introspection / property interfaces
+
+### Installation
+
+This packages requires Go 1.12 or later. It can be installed by running the command below:
+
+```
+go get github.com/godbus/dbus/v5
+```
+
+### Usage
+
+The complete package documentation and some simple examples are available at
+[godoc.org](http://godoc.org/github.com/godbus/dbus). Also, the
+[_examples](https://github.com/godbus/dbus/tree/master/_examples) directory
+gives a short overview over the basic usage.
+
+#### Projects using godbus
+- [fyne](https://github.com/fyne-io/fyne) a cross platform GUI in Go inspired by Material Design.
+- [fynedesk](https://github.com/fyne-io/fynedesk) a full desktop environment for Linux/Unix using Fyne.
+- [go-bluetooth](https://github.com/muka/go-bluetooth) provides a bluetooth client over bluez dbus API.
+- [iwd](https://github.com/shibumi/iwd) go bindings for the internet wireless daemon "iwd".
+- [notify](https://github.com/esiqveland/notify) provides desktop notifications over dbus into a library.
+- [playerbm](https://github.com/altdesktop/playerbm) a bookmark utility for media players.
+
+Please note that the API is considered unstable for now and may change without
+further notice.
+
+### License
+
+go.dbus is available under the Simplified BSD License; see LICENSE for the full
+text.
+
+Nearly all of the credit for this library goes to github.com/guelfey/go.dbus.
diff --git a/archive/vendor/github.com/godbus/dbus/v5/auth.go b/archive/vendor/github.com/godbus/dbus/v5/auth.go
new file mode 100644
index 0000000..0f3b252
--- /dev/null
+++ b/archive/vendor/github.com/godbus/dbus/v5/auth.go
@@ -0,0 +1,257 @@
+package dbus
+
+import (
+ "bufio"
+ "bytes"
+ "errors"
+ "io"
+ "os"
+ "strconv"
+)
+
+// AuthStatus represents the Status of an authentication mechanism.
+type AuthStatus byte
+
+const (
+ // AuthOk signals that authentication is finished; the next command
+ // from the server should be an OK.
+ AuthOk AuthStatus = iota
+
+ // AuthContinue signals that additional data is needed; the next command
+ // from the server should be a DATA.
+ AuthContinue
+
+ // AuthError signals an error; the server sent invalid data or some
+ // other unexpected thing happened and the current authentication
+ // process should be aborted.
+ AuthError
+)
+
+type authState byte
+
+const (
+ waitingForData authState = iota
+ waitingForOk
+ waitingForReject
+)
+
+// Auth defines the behaviour of an authentication mechanism.
+type Auth interface {
+ // Return the name of the mechanism, the argument to the first AUTH command
+ // and the next status.
+ FirstData() (name, resp []byte, status AuthStatus)
+
+ // Process the given DATA command, and return the argument to the DATA
+ // command and the next status. If len(resp) == 0, no DATA command is sent.
+ HandleData(data []byte) (resp []byte, status AuthStatus)
+}
+
+// Auth authenticates the connection, trying the given list of authentication
+// mechanisms (in that order). If nil is passed, the EXTERNAL and
+// DBUS_COOKIE_SHA1 mechanisms are tried for the current user. For private
+// connections, this method must be called before sending any messages to the
+// bus. Auth must not be called on shared connections.
+func (conn *Conn) Auth(methods []Auth) error {
+ if methods == nil {
+ uid := strconv.Itoa(os.Geteuid())
+ methods = []Auth{AuthExternal(uid), AuthCookieSha1(uid, getHomeDir())}
+ }
+ in := bufio.NewReader(conn.transport)
+ err := conn.transport.SendNullByte()
+ if err != nil {
+ return err
+ }
+ err = authWriteLine(conn.transport, []byte("AUTH"))
+ if err != nil {
+ return err
+ }
+ s, err := authReadLine(in)
+ if err != nil {
+ return err
+ }
+ if len(s) < 2 || !bytes.Equal(s[0], []byte("REJECTED")) {
+ return errors.New("dbus: authentication protocol error")
+ }
+ s = s[1:]
+ for _, v := range s {
+ for _, m := range methods {
+ if name, _, status := m.FirstData(); bytes.Equal(v, name) {
+ var ok bool
+ err = authWriteLine(conn.transport, []byte("AUTH"), v)
+ if err != nil {
+ return err
+ }
+ switch status {
+ case AuthOk:
+ err, ok = conn.tryAuth(m, waitingForOk, in)
+ case AuthContinue:
+ err, ok = conn.tryAuth(m, waitingForData, in)
+ default:
+ panic("dbus: invalid authentication status")
+ }
+ if err != nil {
+ return err
+ }
+ if ok {
+ if conn.transport.SupportsUnixFDs() {
+ err = authWriteLine(conn, []byte("NEGOTIATE_UNIX_FD"))
+ if err != nil {
+ return err
+ }
+ line, err := authReadLine(in)
+ if err != nil {
+ return err
+ }
+ switch {
+ case bytes.Equal(line[0], []byte("AGREE_UNIX_FD")):
+ conn.EnableUnixFDs()
+ conn.unixFD = true
+ case bytes.Equal(line[0], []byte("ERROR")):
+ default:
+ return errors.New("dbus: authentication protocol error")
+ }
+ }
+ err = authWriteLine(conn.transport, []byte("BEGIN"))
+ if err != nil {
+ return err
+ }
+ go conn.inWorker()
+ return nil
+ }
+ }
+ }
+ }
+ return errors.New("dbus: authentication failed")
+}
+
+// tryAuth tries to authenticate with m as the mechanism, using state as the
+// initial authState and in for reading input. It returns (nil, true) on
+// success, (nil, false) on a REJECTED and (someErr, false) if some other
+// error occurred.
+func (conn *Conn) tryAuth(m Auth, state authState, in *bufio.Reader) (error, bool) {
+ for {
+ s, err := authReadLine(in)
+ if err != nil {
+ return err, false
+ }
+ switch {
+ case state == waitingForData && string(s[0]) == "DATA":
+ if len(s) != 2 {
+ err = authWriteLine(conn.transport, []byte("ERROR"))
+ if err != nil {
+ return err, false
+ }
+ continue
+ }
+ data, status := m.HandleData(s[1])
+ switch status {
+ case AuthOk, AuthContinue:
+ if len(data) != 0 {
+ err = authWriteLine(conn.transport, []byte("DATA"), data)
+ if err != nil {
+ return err, false
+ }
+ }
+ if status == AuthOk {
+ state = waitingForOk
+ }
+ case AuthError:
+ err = authWriteLine(conn.transport, []byte("ERROR"))
+ if err != nil {
+ return err, false
+ }
+ }
+ case state == waitingForData && string(s[0]) == "REJECTED":
+ return nil, false
+ case state == waitingForData && string(s[0]) == "ERROR":
+ err = authWriteLine(conn.transport, []byte("CANCEL"))
+ if err != nil {
+ return err, false
+ }
+ state = waitingForReject
+ case state == waitingForData && string(s[0]) == "OK":
+ if len(s) != 2 {
+ err = authWriteLine(conn.transport, []byte("CANCEL"))
+ if err != nil {
+ return err, false
+ }
+ state = waitingForReject
+ } else {
+ conn.uuid = string(s[1])
+ return nil, true
+ }
+ case state == waitingForData:
+ err = authWriteLine(conn.transport, []byte("ERROR"))
+ if err != nil {
+ return err, false
+ }
+ case state == waitingForOk && string(s[0]) == "OK":
+ if len(s) != 2 {
+ err = authWriteLine(conn.transport, []byte("CANCEL"))
+ if err != nil {
+ return err, false
+ }
+ state = waitingForReject
+ } else {
+ conn.uuid = string(s[1])
+ return nil, true
+ }
+ case state == waitingForOk && string(s[0]) == "DATA":
+ err = authWriteLine(conn.transport, []byte("DATA"))
+ if err != nil {
+ return err, false
+ }
+ case state == waitingForOk && string(s[0]) == "REJECTED":
+ return nil, false
+ case state == waitingForOk && string(s[0]) == "ERROR":
+ err = authWriteLine(conn.transport, []byte("CANCEL"))
+ if err != nil {
+ return err, false
+ }
+ state = waitingForReject
+ case state == waitingForOk:
+ err = authWriteLine(conn.transport, []byte("ERROR"))
+ if err != nil {
+ return err, false
+ }
+ case state == waitingForReject && string(s[0]) == "REJECTED":
+ return nil, false
+ case state == waitingForReject:
+ return errors.New("dbus: authentication protocol error"), false
+ default:
+ panic("dbus: invalid auth state")
+ }
+ }
+}
+
+// authReadLine reads a line and separates it into its fields.
+func authReadLine(in *bufio.Reader) ([][]byte, error) {
+ data, err := in.ReadBytes('\n')
+ if err != nil {
+ return nil, err
+ }
+ data = bytes.TrimSuffix(data, []byte("\r\n"))
+ return bytes.Split(data, []byte{' '}), nil
+}
+
+// authWriteLine writes the given line in the authentication protocol format
+// (elements of data separated by a " " and terminated by "\r\n").
+func authWriteLine(out io.Writer, data ...[]byte) error {
+ buf := make([]byte, 0)
+ for i, v := range data {
+ buf = append(buf, v...)
+ if i != len(data)-1 {
+ buf = append(buf, ' ')
+ }
+ }
+ buf = append(buf, '\r')
+ buf = append(buf, '\n')
+ n, err := out.Write(buf)
+ if err != nil {
+ return err
+ }
+ if n != len(buf) {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
diff --git a/archive/vendor/github.com/godbus/dbus/v5/auth_anonymous.go b/archive/vendor/github.com/godbus/dbus/v5/auth_anonymous.go
new file mode 100644
index 0000000..75f3ad3
--- /dev/null
+++ b/archive/vendor/github.com/godbus/dbus/v5/auth_anonymous.go
@@ -0,0 +1,16 @@
+package dbus
+
+// AuthAnonymous returns an Auth that uses the ANONYMOUS mechanism.
+func AuthAnonymous() Auth {
+ return &authAnonymous{}
+}
+
+type authAnonymous struct{}
+
+func (a *authAnonymous) FirstData() (name, resp []byte, status AuthStatus) {
+ return []byte("ANONYMOUS"), nil, AuthOk
+}
+
+func (a *authAnonymous) HandleData(data []byte) (resp []byte, status AuthStatus) {
+ return nil, AuthError
+}
diff --git a/archive/vendor/github.com/godbus/dbus/v5/auth_external.go b/archive/vendor/github.com/godbus/dbus/v5/auth_external.go
new file mode 100644
index 0000000..7e376d3
--- /dev/null
+++ b/archive/vendor/github.com/godbus/dbus/v5/auth_external.go
@@ -0,0 +1,26 @@
+package dbus
+
+import (
+ "encoding/hex"
+)
+
+// AuthExternal returns an Auth that authenticates as the given user with the
+// EXTERNAL mechanism.
+func AuthExternal(user string) Auth {
+ return authExternal{user}
+}
+
+// AuthExternal implements the EXTERNAL authentication mechanism.
+type authExternal struct {
+ user string
+}
+
+func (a authExternal) FirstData() ([]byte, []byte, AuthStatus) {
+ b := make([]byte, 2*len(a.user))
+ hex.Encode(b, []byte(a.user))
+ return []byte("EXTERNAL"), b, AuthOk
+}
+
+func (a authExternal) HandleData(b []byte) ([]byte, AuthStatus) {
+ return nil, AuthError
+}
diff --git a/archive/vendor/github.com/godbus/dbus/v5/auth_sha1.go b/archive/vendor/github.com/godbus/dbus/v5/auth_sha1.go
new file mode 100644
index 0000000..8028670
--- /dev/null
+++ b/archive/vendor/github.com/godbus/dbus/v5/auth_sha1.go
@@ -0,0 +1,102 @@
+package dbus
+
+import (
+ "bufio"
+ "bytes"
+ "crypto/rand"
+ "crypto/sha1"
+ "encoding/hex"
+ "os"
+)
+
+// AuthCookieSha1 returns an Auth that authenticates as the given user with the
+// DBUS_COOKIE_SHA1 mechanism. The home parameter should specify the home
+// directory of the user.
+func AuthCookieSha1(user, home string) Auth {
+ return authCookieSha1{user, home}
+}
+
+type authCookieSha1 struct {
+ user, home string
+}
+
+func (a authCookieSha1) FirstData() ([]byte, []byte, AuthStatus) {
+ b := make([]byte, 2*len(a.user))
+ hex.Encode(b, []byte(a.user))
+ return []byte("DBUS_COOKIE_SHA1"), b, AuthContinue
+}
+
+func (a authCookieSha1) HandleData(data []byte) ([]byte, AuthStatus) {
+ challenge := make([]byte, len(data)/2)
+ _, err := hex.Decode(challenge, data)
+ if err != nil {
+ return nil, AuthError
+ }
+ b := bytes.Split(challenge, []byte{' '})
+ if len(b) != 3 {
+ return nil, AuthError
+ }
+ context := b[0]
+ id := b[1]
+ svchallenge := b[2]
+ cookie := a.getCookie(context, id)
+ if cookie == nil {
+ return nil, AuthError
+ }
+ clchallenge := a.generateChallenge()
+ if clchallenge == nil {
+ return nil, AuthError
+ }
+ hash := sha1.New()
+ hash.Write(bytes.Join([][]byte{svchallenge, clchallenge, cookie}, []byte{':'}))
+ hexhash := make([]byte, 2*hash.Size())
+ hex.Encode(hexhash, hash.Sum(nil))
+ data = append(clchallenge, ' ')
+ data = append(data, hexhash...)
+ resp := make([]byte, 2*len(data))
+ hex.Encode(resp, data)
+ return resp, AuthOk
+}
+
+// getCookie searches for the cookie identified by id in context and returns
+// the cookie content or nil. (Since HandleData can't return a specific error,
+// but only whether an error occurred, this function also doesn't bother to
+// return an error.)
+func (a authCookieSha1) getCookie(context, id []byte) []byte {
+ file, err := os.Open(a.home + "/.dbus-keyrings/" + string(context))
+ if err != nil {
+ return nil
+ }
+ defer file.Close()
+ rd := bufio.NewReader(file)
+ for {
+ line, err := rd.ReadBytes('\n')
+ if err != nil {
+ return nil
+ }
+ line = line[:len(line)-1]
+ b := bytes.Split(line, []byte{' '})
+ if len(b) != 3 {
+ return nil
+ }
+ if bytes.Equal(b[0], id) {
+ return b[2]
+ }
+ }
+}
+
+// generateChallenge returns a random, hex-encoded challenge, or nil on error
+// (see above).
+func (a authCookieSha1) generateChallenge() []byte {
+ b := make([]byte, 16)
+ n, err := rand.Read(b)
+ if err != nil {
+ return nil
+ }
+ if n != 16 {
+ return nil
+ }
+ enc := make([]byte, 32)
+ hex.Encode(enc, b)
+ return enc
+}
diff --git a/archive/vendor/github.com/godbus/dbus/v5/call.go b/archive/vendor/github.com/godbus/dbus/v5/call.go
new file mode 100644
index 0000000..b06b063
--- /dev/null
+++ b/archive/vendor/github.com/godbus/dbus/v5/call.go
@@ -0,0 +1,69 @@
+package dbus
+
+import (
+ "context"
+ "errors"
+)
+
+var errSignature = errors.New("dbus: mismatched signature")
+
+// Call represents a pending or completed method call.
+type Call struct {
+ Destination string
+ Path ObjectPath
+ Method string
+ Args []interface{}
+
+ // Strobes when the call is complete.
+ Done chan *Call
+
+ // After completion, the error status. If this is non-nil, it may be an
+ // error message from the peer (with Error as its type) or some other error.
+ Err error
+
+ // Holds the response once the call is done.
+ Body []interface{}
+
+ // ResponseSequence stores the sequence number of the DBus message containing
+ // the call response (or error). This can be compared to the sequence number
+ // of other call responses and signals on this connection to determine their
+ // relative ordering on the underlying DBus connection.
+ // For errors, ResponseSequence is populated only if the error came from a
+ // DBusMessage that was received or if there was an error receiving. In case of
+ // failure to make the call, ResponseSequence will be NoSequence.
+ ResponseSequence Sequence
+
+ // tracks context and canceler
+ ctx context.Context
+ ctxCanceler context.CancelFunc
+}
+
+func (c *Call) Context() context.Context {
+ if c.ctx == nil {
+ return context.Background()
+ }
+
+ return c.ctx
+}
+
+func (c *Call) ContextCancel() {
+ if c.ctxCanceler != nil {
+ c.ctxCanceler()
+ }
+}
+
+// Store stores the body of the reply into the provided pointers. It returns
+// an error if the signatures of the body and retvalues don't match, or if
+// the error status is not nil.
+func (c *Call) Store(retvalues ...interface{}) error {
+ if c.Err != nil {
+ return c.Err
+ }
+
+ return Store(c.Body, retvalues...)
+}
+
+func (c *Call) done() {
+ c.Done <- c
+ c.ContextCancel()
+}
diff --git a/archive/vendor/github.com/godbus/dbus/v5/conn.go b/archive/vendor/github.com/godbus/dbus/v5/conn.go
new file mode 100644
index 0000000..69978ea
--- /dev/null
+++ b/archive/vendor/github.com/godbus/dbus/v5/conn.go
@@ -0,0 +1,996 @@
+package dbus
+
+import (
+ "context"
+ "errors"
+ "io"
+ "os"
+ "strings"
+ "sync"
+)
+
+var (
+ systemBus *Conn
+ systemBusLck sync.Mutex
+ sessionBus *Conn
+ sessionBusLck sync.Mutex
+)
+
+// ErrClosed is the error returned by calls on a closed connection.
+var ErrClosed = errors.New("dbus: connection closed by user")
+
+// Conn represents a connection to a message bus (usually, the system or
+// session bus).
+//
+// Connections are either shared or private. Shared connections
+// are shared between calls to the functions that return them. As a result,
+// the methods Close, Auth and Hello must not be called on them.
+//
+// Multiple goroutines may invoke methods on a connection simultaneously.
+type Conn struct {
+ transport
+
+ ctx context.Context
+ cancelCtx context.CancelFunc
+
+ closeOnce sync.Once
+ closeErr error
+
+ busObj BusObject
+ unixFD bool
+ uuid string
+
+ handler Handler
+ signalHandler SignalHandler
+ serialGen SerialGenerator
+ inInt Interceptor
+ outInt Interceptor
+ auth []Auth
+
+ names *nameTracker
+ calls *callTracker
+ outHandler *outputHandler
+
+ eavesdropped chan<- *Message
+ eavesdroppedLck sync.Mutex
+}
+
+// SessionBus returns a shared connection to the session bus, connecting to it
+// if not already done.
+func SessionBus() (conn *Conn, err error) {
+ sessionBusLck.Lock()
+ defer sessionBusLck.Unlock()
+ if sessionBus != nil &&
+ sessionBus.Connected() {
+ return sessionBus, nil
+ }
+ defer func() {
+ if conn != nil {
+ sessionBus = conn
+ }
+ }()
+ conn, err = ConnectSessionBus()
+ return
+}
+
+func getSessionBusAddress(autolaunch bool) (string, error) {
+ if address := os.Getenv("DBUS_SESSION_BUS_ADDRESS"); address != "" && address != "autolaunch:" {
+ return address, nil
+
+ } else if address := tryDiscoverDbusSessionBusAddress(); address != "" {
+ os.Setenv("DBUS_SESSION_BUS_ADDRESS", address)
+ return address, nil
+ }
+ if !autolaunch {
+ return "", errors.New("dbus: couldn't determine address of session bus")
+ }
+ return getSessionBusPlatformAddress()
+}
+
+// SessionBusPrivate returns a new private connection to the session bus.
+func SessionBusPrivate(opts ...ConnOption) (*Conn, error) {
+ address, err := getSessionBusAddress(true)
+ if err != nil {
+ return nil, err
+ }
+
+ return Dial(address, opts...)
+}
+
+// SessionBusPrivate returns a new private connection to the session bus. If
+// the session bus is not already open, do not attempt to launch it.
+func SessionBusPrivateNoAutoStartup(opts ...ConnOption) (*Conn, error) {
+ address, err := getSessionBusAddress(false)
+ if err != nil {
+ return nil, err
+ }
+
+ return Dial(address, opts...)
+}
+
+// SessionBusPrivate returns a new private connection to the session bus.
+//
+// Deprecated: use SessionBusPrivate with options instead.
+func SessionBusPrivateHandler(handler Handler, signalHandler SignalHandler) (*Conn, error) {
+ return SessionBusPrivate(WithHandler(handler), WithSignalHandler(signalHandler))
+}
+
+// SystemBus returns a shared connection to the system bus, connecting to it if
+// not already done.
+func SystemBus() (conn *Conn, err error) {
+ systemBusLck.Lock()
+ defer systemBusLck.Unlock()
+ if systemBus != nil &&
+ systemBus.Connected() {
+ return systemBus, nil
+ }
+ defer func() {
+ if conn != nil {
+ systemBus = conn
+ }
+ }()
+ conn, err = ConnectSystemBus()
+ return
+}
+
+// ConnectSessionBus connects to the session bus.
+func ConnectSessionBus(opts ...ConnOption) (*Conn, error) {
+ address, err := getSessionBusAddress(true)
+ if err != nil {
+ return nil, err
+ }
+ return Connect(address, opts...)
+}
+
+// ConnectSystemBus connects to the system bus.
+func ConnectSystemBus(opts ...ConnOption) (*Conn, error) {
+ return Connect(getSystemBusPlatformAddress(), opts...)
+}
+
+// Connect connects to the given address.
+//
+// Returned connection is ready to use and doesn't require calling
+// Auth and Hello methods to make it usable.
+func Connect(address string, opts ...ConnOption) (*Conn, error) {
+ conn, err := Dial(address, opts...)
+ if err != nil {
+ return nil, err
+ }
+ if err = conn.Auth(conn.auth); err != nil {
+ _ = conn.Close()
+ return nil, err
+ }
+ if err = conn.Hello(); err != nil {
+ _ = conn.Close()
+ return nil, err
+ }
+ return conn, nil
+}
+
+// SystemBusPrivate returns a new private connection to the system bus.
+// Note: this connection is not ready to use. One must perform Auth and Hello
+// on the connection before it is usable.
+func SystemBusPrivate(opts ...ConnOption) (*Conn, error) {
+ return Dial(getSystemBusPlatformAddress(), opts...)
+}
+
+// SystemBusPrivateHandler returns a new private connection to the system bus, using the provided handlers.
+//
+// Deprecated: use SystemBusPrivate with options instead.
+func SystemBusPrivateHandler(handler Handler, signalHandler SignalHandler) (*Conn, error) {
+ return SystemBusPrivate(WithHandler(handler), WithSignalHandler(signalHandler))
+}
+
+// Dial establishes a new private connection to the message bus specified by address.
+func Dial(address string, opts ...ConnOption) (*Conn, error) {
+ tr, err := getTransport(address)
+ if err != nil {
+ return nil, err
+ }
+ return newConn(tr, opts...)
+}
+
+// DialHandler establishes a new private connection to the message bus specified by address, using the supplied handlers.
+//
+// Deprecated: use Dial with options instead.
+func DialHandler(address string, handler Handler, signalHandler SignalHandler) (*Conn, error) {
+ return Dial(address, WithHandler(handler), WithSignalHandler(signalHandler))
+}
+
+// ConnOption is a connection option.
+type ConnOption func(conn *Conn) error
+
+// WithHandler overrides the default handler.
+func WithHandler(handler Handler) ConnOption {
+ return func(conn *Conn) error {
+ conn.handler = handler
+ return nil
+ }
+}
+
+// WithSignalHandler overrides the default signal handler.
+func WithSignalHandler(handler SignalHandler) ConnOption {
+ return func(conn *Conn) error {
+ conn.signalHandler = handler
+ return nil
+ }
+}
+
+// WithSerialGenerator overrides the default signals generator.
+func WithSerialGenerator(gen SerialGenerator) ConnOption {
+ return func(conn *Conn) error {
+ conn.serialGen = gen
+ return nil
+ }
+}
+
+// WithAuth sets authentication methods for the auth conversation.
+func WithAuth(methods ...Auth) ConnOption {
+ return func(conn *Conn) error {
+ conn.auth = methods
+ return nil
+ }
+}
+
+// Interceptor intercepts incoming and outgoing messages.
+type Interceptor func(msg *Message)
+
+// WithIncomingInterceptor sets the given interceptor for incoming messages.
+func WithIncomingInterceptor(interceptor Interceptor) ConnOption {
+ return func(conn *Conn) error {
+ conn.inInt = interceptor
+ return nil
+ }
+}
+
+// WithOutgoingInterceptor sets the given interceptor for outgoing messages.
+func WithOutgoingInterceptor(interceptor Interceptor) ConnOption {
+ return func(conn *Conn) error {
+ conn.outInt = interceptor
+ return nil
+ }
+}
+
+// WithContext overrides the default context for the connection.
+func WithContext(ctx context.Context) ConnOption {
+ return func(conn *Conn) error {
+ conn.ctx = ctx
+ return nil
+ }
+}
+
+// NewConn creates a new private *Conn from an already established connection.
+func NewConn(conn io.ReadWriteCloser, opts ...ConnOption) (*Conn, error) {
+ return newConn(genericTransport{conn}, opts...)
+}
+
+// NewConnHandler creates a new private *Conn from an already established connection, using the supplied handlers.
+//
+// Deprecated: use NewConn with options instead.
+func NewConnHandler(conn io.ReadWriteCloser, handler Handler, signalHandler SignalHandler) (*Conn, error) {
+ return NewConn(genericTransport{conn}, WithHandler(handler), WithSignalHandler(signalHandler))
+}
+
+// newConn creates a new *Conn from a transport.
+func newConn(tr transport, opts ...ConnOption) (*Conn, error) {
+ conn := new(Conn)
+ conn.transport = tr
+ for _, opt := range opts {
+ if err := opt(conn); err != nil {
+ return nil, err
+ }
+ }
+ if conn.ctx == nil {
+ conn.ctx = context.Background()
+ }
+ conn.ctx, conn.cancelCtx = context.WithCancel(conn.ctx)
+
+ conn.calls = newCallTracker()
+ if conn.handler == nil {
+ conn.handler = NewDefaultHandler()
+ }
+ if conn.signalHandler == nil {
+ conn.signalHandler = NewDefaultSignalHandler()
+ }
+ if conn.serialGen == nil {
+ conn.serialGen = newSerialGenerator()
+ }
+ conn.outHandler = &outputHandler{conn: conn}
+ conn.names = newNameTracker()
+ conn.busObj = conn.Object("org.freedesktop.DBus", "/org/freedesktop/DBus")
+
+ go func() {
+ <-conn.ctx.Done()
+ conn.Close()
+ }()
+ return conn, nil
+}
+
+// BusObject returns the object owned by the bus daemon which handles
+// administrative requests.
+func (conn *Conn) BusObject() BusObject {
+ return conn.busObj
+}
+
+// Close closes the connection. Any blocked operations will return with errors
+// and the channels passed to Eavesdrop and Signal are closed. This method must
+// not be called on shared connections.
+func (conn *Conn) Close() error {
+ conn.closeOnce.Do(func() {
+ conn.outHandler.close()
+ if term, ok := conn.signalHandler.(Terminator); ok {
+ term.Terminate()
+ }
+
+ if term, ok := conn.handler.(Terminator); ok {
+ term.Terminate()
+ }
+
+ conn.eavesdroppedLck.Lock()
+ if conn.eavesdropped != nil {
+ close(conn.eavesdropped)
+ }
+ conn.eavesdroppedLck.Unlock()
+
+ conn.cancelCtx()
+
+ conn.closeErr = conn.transport.Close()
+ })
+ return conn.closeErr
+}
+
+// Context returns the context associated with the connection. The
+// context will be cancelled when the connection is closed.
+func (conn *Conn) Context() context.Context {
+ return conn.ctx
+}
+
+// Connected returns whether conn is connected
+func (conn *Conn) Connected() bool {
+ return conn.ctx.Err() == nil
+}
+
+// Eavesdrop causes conn to send all incoming messages to the given channel
+// without further processing. Method replies, errors and signals will not be
+// sent to the appropriate channels and method calls will not be handled. If nil
+// is passed, the normal behaviour is restored.
+//
+// The caller has to make sure that ch is sufficiently buffered;
+// if a message arrives when a write to ch is not possible, the message is
+// discarded.
+func (conn *Conn) Eavesdrop(ch chan<- *Message) {
+ conn.eavesdroppedLck.Lock()
+ conn.eavesdropped = ch
+ conn.eavesdroppedLck.Unlock()
+}
+
+// getSerial returns an unused serial.
+func (conn *Conn) getSerial() uint32 {
+ return conn.serialGen.GetSerial()
+}
+
+// Hello sends the initial org.freedesktop.DBus.Hello call. This method must be
+// called after authentication, but before sending any other messages to the
+// bus. Hello must not be called for shared connections.
+func (conn *Conn) Hello() error {
+ var s string
+ err := conn.busObj.Call("org.freedesktop.DBus.Hello", 0).Store(&s)
+ if err != nil {
+ return err
+ }
+ conn.names.acquireUniqueConnectionName(s)
+ return nil
+}
+
+// inWorker runs in an own goroutine, reading incoming messages from the
+// transport and dispatching them appropriately.
+func (conn *Conn) inWorker() {
+ sequenceGen := newSequenceGenerator()
+ for {
+ msg, err := conn.ReadMessage()
+ if err != nil {
+ if _, ok := err.(InvalidMessageError); !ok {
+ // Some read error occurred (usually EOF); we can't really do
+ // anything but to shut down all stuff and returns errors to all
+ // pending replies.
+ conn.Close()
+ conn.calls.finalizeAllWithError(sequenceGen, err)
+ return
+ }
+ // invalid messages are ignored
+ continue
+ }
+ conn.eavesdroppedLck.Lock()
+ if conn.eavesdropped != nil {
+ select {
+ case conn.eavesdropped <- msg:
+ default:
+ }
+ conn.eavesdroppedLck.Unlock()
+ continue
+ }
+ conn.eavesdroppedLck.Unlock()
+ dest, _ := msg.Headers[FieldDestination].value.(string)
+ found := dest == "" ||
+ !conn.names.uniqueNameIsKnown() ||
+ conn.names.isKnownName(dest)
+ if !found {
+ // Eavesdropped a message, but no channel for it is registered.
+ // Ignore it.
+ continue
+ }
+
+ if conn.inInt != nil {
+ conn.inInt(msg)
+ }
+ sequence := sequenceGen.next()
+ switch msg.Type {
+ case TypeError:
+ conn.serialGen.RetireSerial(conn.calls.handleDBusError(sequence, msg))
+ case TypeMethodReply:
+ conn.serialGen.RetireSerial(conn.calls.handleReply(sequence, msg))
+ case TypeSignal:
+ conn.handleSignal(sequence, msg)
+ case TypeMethodCall:
+ go conn.handleCall(msg)
+ }
+
+ }
+}
+
+func (conn *Conn) handleSignal(sequence Sequence, msg *Message) {
+ iface := msg.Headers[FieldInterface].value.(string)
+ member := msg.Headers[FieldMember].value.(string)
+ // as per http://dbus.freedesktop.org/doc/dbus-specification.html ,
+ // sender is optional for signals.
+ sender, _ := msg.Headers[FieldSender].value.(string)
+ if iface == "org.freedesktop.DBus" && sender == "org.freedesktop.DBus" {
+ if member == "NameLost" {
+ // If we lost the name on the bus, remove it from our
+ // tracking list.
+ name, ok := msg.Body[0].(string)
+ if !ok {
+ panic("Unable to read the lost name")
+ }
+ conn.names.loseName(name)
+ } else if member == "NameAcquired" {
+ // If we acquired the name on the bus, add it to our
+ // tracking list.
+ name, ok := msg.Body[0].(string)
+ if !ok {
+ panic("Unable to read the acquired name")
+ }
+ conn.names.acquireName(name)
+ }
+ }
+ signal := &Signal{
+ Sender: sender,
+ Path: msg.Headers[FieldPath].value.(ObjectPath),
+ Name: iface + "." + member,
+ Body: msg.Body,
+ Sequence: sequence,
+ }
+ conn.signalHandler.DeliverSignal(iface, member, signal)
+}
+
+// Names returns the list of all names that are currently owned by this
+// connection. The slice is always at least one element long, the first element
+// being the unique name of the connection.
+func (conn *Conn) Names() []string {
+ return conn.names.listKnownNames()
+}
+
+// Object returns the object identified by the given destination name and path.
+func (conn *Conn) Object(dest string, path ObjectPath) BusObject {
+ return &Object{conn, dest, path}
+}
+
+func (conn *Conn) sendMessageAndIfClosed(msg *Message, ifClosed func()) {
+ if msg.serial == 0 {
+ msg.serial = conn.getSerial()
+ }
+ if conn.outInt != nil {
+ conn.outInt(msg)
+ }
+ err := conn.outHandler.sendAndIfClosed(msg, ifClosed)
+ if err != nil {
+ conn.handleSendError(msg, err)
+ } else if msg.Type != TypeMethodCall {
+ conn.serialGen.RetireSerial(msg.serial)
+ }
+}
+
+func (conn *Conn) handleSendError(msg *Message, err error) {
+ if msg.Type == TypeMethodCall {
+ conn.calls.handleSendError(msg, err)
+ } else if msg.Type == TypeMethodReply {
+ if _, ok := err.(FormatError); ok {
+ conn.sendError(err, msg.Headers[FieldDestination].value.(string), msg.Headers[FieldReplySerial].value.(uint32))
+ }
+ }
+ conn.serialGen.RetireSerial(msg.serial)
+}
+
+// Send sends the given message to the message bus. You usually don't need to
+// use this; use the higher-level equivalents (Call / Go, Emit and Export)
+// instead. If msg is a method call and NoReplyExpected is not set, a non-nil
+// call is returned and the same value is sent to ch (which must be buffered)
+// once the call is complete. Otherwise, ch is ignored and a Call structure is
+// returned of which only the Err member is valid.
+func (conn *Conn) Send(msg *Message, ch chan *Call) *Call {
+ return conn.send(context.Background(), msg, ch)
+}
+
+// SendWithContext acts like Send but takes a context
+func (conn *Conn) SendWithContext(ctx context.Context, msg *Message, ch chan *Call) *Call {
+ return conn.send(ctx, msg, ch)
+}
+
+func (conn *Conn) send(ctx context.Context, msg *Message, ch chan *Call) *Call {
+ if ctx == nil {
+ panic("nil context")
+ }
+ if ch == nil {
+ ch = make(chan *Call, 1)
+ } else if cap(ch) == 0 {
+ panic("dbus: unbuffered channel passed to (*Conn).Send")
+ }
+
+ var call *Call
+ ctx, canceler := context.WithCancel(ctx)
+ msg.serial = conn.getSerial()
+ if msg.Type == TypeMethodCall && msg.Flags&FlagNoReplyExpected == 0 {
+ call = new(Call)
+ call.Destination, _ = msg.Headers[FieldDestination].value.(string)
+ call.Path, _ = msg.Headers[FieldPath].value.(ObjectPath)
+ iface, _ := msg.Headers[FieldInterface].value.(string)
+ member, _ := msg.Headers[FieldMember].value.(string)
+ call.Method = iface + "." + member
+ call.Args = msg.Body
+ call.Done = ch
+ call.ctx = ctx
+ call.ctxCanceler = canceler
+ conn.calls.track(msg.serial, call)
+ if ctx.Err() != nil {
+ // short path: don't even send the message if context already cancelled
+ conn.calls.handleSendError(msg, ctx.Err())
+ return call
+ }
+ go func() {
+ <-ctx.Done()
+ conn.calls.handleSendError(msg, ctx.Err())
+ }()
+ conn.sendMessageAndIfClosed(msg, func() {
+ conn.calls.handleSendError(msg, ErrClosed)
+ canceler()
+ })
+ } else {
+ canceler()
+ call = &Call{Err: nil, Done: ch}
+ ch <- call
+ conn.sendMessageAndIfClosed(msg, func() {
+ call = &Call{Err: ErrClosed}
+ })
+ }
+ return call
+}
+
+// sendError creates an error message corresponding to the parameters and sends
+// it to conn.out.
+func (conn *Conn) sendError(err error, dest string, serial uint32) {
+ var e *Error
+ switch em := err.(type) {
+ case Error:
+ e = &em
+ case *Error:
+ e = em
+ case DBusError:
+ name, body := em.DBusError()
+ e = NewError(name, body)
+ default:
+ e = MakeFailedError(err)
+ }
+ msg := new(Message)
+ msg.Type = TypeError
+ msg.Headers = make(map[HeaderField]Variant)
+ if dest != "" {
+ msg.Headers[FieldDestination] = MakeVariant(dest)
+ }
+ msg.Headers[FieldErrorName] = MakeVariant(e.Name)
+ msg.Headers[FieldReplySerial] = MakeVariant(serial)
+ msg.Body = e.Body
+ if len(e.Body) > 0 {
+ msg.Headers[FieldSignature] = MakeVariant(SignatureOf(e.Body...))
+ }
+ conn.sendMessageAndIfClosed(msg, nil)
+}
+
+// sendReply creates a method reply message corresponding to the parameters and
+// sends it to conn.out.
+func (conn *Conn) sendReply(dest string, serial uint32, values ...interface{}) {
+ msg := new(Message)
+ msg.Type = TypeMethodReply
+ msg.Headers = make(map[HeaderField]Variant)
+ if dest != "" {
+ msg.Headers[FieldDestination] = MakeVariant(dest)
+ }
+ msg.Headers[FieldReplySerial] = MakeVariant(serial)
+ msg.Body = values
+ if len(values) > 0 {
+ msg.Headers[FieldSignature] = MakeVariant(SignatureOf(values...))
+ }
+ conn.sendMessageAndIfClosed(msg, nil)
+}
+
+// AddMatchSignal registers the given match rule to receive broadcast
+// signals based on their contents.
+func (conn *Conn) AddMatchSignal(options ...MatchOption) error {
+ return conn.AddMatchSignalContext(context.Background(), options...)
+}
+
+// AddMatchSignalContext acts like AddMatchSignal but takes a context.
+func (conn *Conn) AddMatchSignalContext(ctx context.Context, options ...MatchOption) error {
+ options = append([]MatchOption{withMatchType("signal")}, options...)
+ return conn.busObj.CallWithContext(
+ ctx,
+ "org.freedesktop.DBus.AddMatch", 0,
+ formatMatchOptions(options),
+ ).Store()
+}
+
+// RemoveMatchSignal removes the first rule that matches previously registered with AddMatchSignal.
+func (conn *Conn) RemoveMatchSignal(options ...MatchOption) error {
+ return conn.RemoveMatchSignalContext(context.Background(), options...)
+}
+
+// RemoveMatchSignalContext acts like RemoveMatchSignal but takes a context.
+func (conn *Conn) RemoveMatchSignalContext(ctx context.Context, options ...MatchOption) error {
+ options = append([]MatchOption{withMatchType("signal")}, options...)
+ return conn.busObj.CallWithContext(
+ ctx,
+ "org.freedesktop.DBus.RemoveMatch", 0,
+ formatMatchOptions(options),
+ ).Store()
+}
+
+// Signal registers the given channel to be passed all received signal messages.
+//
+// Multiple of these channels can be registered at the same time. The channel is
+// closed if the Conn is closed; it should not be closed by the caller before
+// RemoveSignal was called on it.
+//
+// These channels are "overwritten" by Eavesdrop; i.e., if there currently is a
+// channel for eavesdropped messages, this channel receives all signals, and
+// none of the channels passed to Signal will receive any signals.
+//
+// Panics if the signal handler is not a `SignalRegistrar`.
+func (conn *Conn) Signal(ch chan<- *Signal) {
+ handler, ok := conn.signalHandler.(SignalRegistrar)
+ if !ok {
+ panic("cannot use this method with a non SignalRegistrar handler")
+ }
+ handler.AddSignal(ch)
+}
+
+// RemoveSignal removes the given channel from the list of the registered channels.
+//
+// Panics if the signal handler is not a `SignalRegistrar`.
+func (conn *Conn) RemoveSignal(ch chan<- *Signal) {
+ handler, ok := conn.signalHandler.(SignalRegistrar)
+ if !ok {
+ panic("cannot use this method with a non SignalRegistrar handler")
+ }
+ handler.RemoveSignal(ch)
+}
+
+// SupportsUnixFDs returns whether the underlying transport supports passing of
+// unix file descriptors. If this is false, method calls containing unix file
+// descriptors will return an error and emitted signals containing them will
+// not be sent.
+func (conn *Conn) SupportsUnixFDs() bool {
+ return conn.unixFD
+}
+
+// Error represents a D-Bus message of type Error.
+type Error struct {
+ Name string
+ Body []interface{}
+}
+
+func NewError(name string, body []interface{}) *Error {
+ return &Error{name, body}
+}
+
+func (e Error) Error() string {
+ if len(e.Body) >= 1 {
+ s, ok := e.Body[0].(string)
+ if ok {
+ return s
+ }
+ }
+ return e.Name
+}
+
+// Signal represents a D-Bus message of type Signal. The name member is given in
+// "interface.member" notation, e.g. org.freedesktop.D-Bus.NameLost.
+type Signal struct {
+ Sender string
+ Path ObjectPath
+ Name string
+ Body []interface{}
+ Sequence Sequence
+}
+
+// transport is a D-Bus transport.
+type transport interface {
+ // Read and Write raw data (for example, for the authentication protocol).
+ io.ReadWriteCloser
+
+ // Send the initial null byte used for the EXTERNAL mechanism.
+ SendNullByte() error
+
+ // Returns whether this transport supports passing Unix FDs.
+ SupportsUnixFDs() bool
+
+ // Signal the transport that Unix FD passing is enabled for this connection.
+ EnableUnixFDs()
+
+ // Read / send a message, handling things like Unix FDs.
+ ReadMessage() (*Message, error)
+ SendMessage(*Message) error
+}
+
+var (
+ transports = make(map[string]func(string) (transport, error))
+)
+
+func getTransport(address string) (transport, error) {
+ var err error
+ var t transport
+
+ addresses := strings.Split(address, ";")
+ for _, v := range addresses {
+ i := strings.IndexRune(v, ':')
+ if i == -1 {
+ err = errors.New("dbus: invalid bus address (no transport)")
+ continue
+ }
+ f := transports[v[:i]]
+ if f == nil {
+ err = errors.New("dbus: invalid bus address (invalid or unsupported transport)")
+ continue
+ }
+ t, err = f(v[i+1:])
+ if err == nil {
+ return t, nil
+ }
+ }
+ return nil, err
+}
+
+// getKey gets a key from a the list of keys. Returns "" on error / not found...
+func getKey(s, key string) string {
+ for _, keyEqualsValue := range strings.Split(s, ",") {
+ keyValue := strings.SplitN(keyEqualsValue, "=", 2)
+ if len(keyValue) == 2 && keyValue[0] == key {
+ val, err := UnescapeBusAddressValue(keyValue[1])
+ if err != nil {
+ // No way to return an error.
+ return ""
+ }
+ return val
+ }
+ }
+ return ""
+}
+
+type outputHandler struct {
+ conn *Conn
+ sendLck sync.Mutex
+ closed struct {
+ isClosed bool
+ lck sync.RWMutex
+ }
+}
+
+func (h *outputHandler) sendAndIfClosed(msg *Message, ifClosed func()) error {
+ h.closed.lck.RLock()
+ defer h.closed.lck.RUnlock()
+ if h.closed.isClosed {
+ if ifClosed != nil {
+ ifClosed()
+ }
+ return nil
+ }
+ h.sendLck.Lock()
+ defer h.sendLck.Unlock()
+ return h.conn.SendMessage(msg)
+}
+
+func (h *outputHandler) close() {
+ h.closed.lck.Lock()
+ defer h.closed.lck.Unlock()
+ h.closed.isClosed = true
+}
+
+type serialGenerator struct {
+ lck sync.Mutex
+ nextSerial uint32
+ serialUsed map[uint32]bool
+}
+
+func newSerialGenerator() *serialGenerator {
+ return &serialGenerator{
+ serialUsed: map[uint32]bool{0: true},
+ nextSerial: 1,
+ }
+}
+
+func (gen *serialGenerator) GetSerial() uint32 {
+ gen.lck.Lock()
+ defer gen.lck.Unlock()
+ n := gen.nextSerial
+ for gen.serialUsed[n] {
+ n++
+ }
+ gen.serialUsed[n] = true
+ gen.nextSerial = n + 1
+ return n
+}
+
+func (gen *serialGenerator) RetireSerial(serial uint32) {
+ gen.lck.Lock()
+ defer gen.lck.Unlock()
+ delete(gen.serialUsed, serial)
+}
+
+type nameTracker struct {
+ lck sync.RWMutex
+ unique string
+ names map[string]struct{}
+}
+
+func newNameTracker() *nameTracker {
+ return &nameTracker{names: map[string]struct{}{}}
+}
+func (tracker *nameTracker) acquireUniqueConnectionName(name string) {
+ tracker.lck.Lock()
+ defer tracker.lck.Unlock()
+ tracker.unique = name
+}
+func (tracker *nameTracker) acquireName(name string) {
+ tracker.lck.Lock()
+ defer tracker.lck.Unlock()
+ tracker.names[name] = struct{}{}
+}
+func (tracker *nameTracker) loseName(name string) {
+ tracker.lck.Lock()
+ defer tracker.lck.Unlock()
+ delete(tracker.names, name)
+}
+
+func (tracker *nameTracker) uniqueNameIsKnown() bool {
+ tracker.lck.RLock()
+ defer tracker.lck.RUnlock()
+ return tracker.unique != ""
+}
+func (tracker *nameTracker) isKnownName(name string) bool {
+ tracker.lck.RLock()
+ defer tracker.lck.RUnlock()
+ _, ok := tracker.names[name]
+ return ok || name == tracker.unique
+}
+func (tracker *nameTracker) listKnownNames() []string {
+ tracker.lck.RLock()
+ defer tracker.lck.RUnlock()
+ out := make([]string, 0, len(tracker.names)+1)
+ out = append(out, tracker.unique)
+ for k := range tracker.names {
+ out = append(out, k)
+ }
+ return out
+}
+
+type callTracker struct {
+ calls map[uint32]*Call
+ lck sync.RWMutex
+}
+
+func newCallTracker() *callTracker {
+ return &callTracker{calls: map[uint32]*Call{}}
+}
+
+func (tracker *callTracker) track(sn uint32, call *Call) {
+ tracker.lck.Lock()
+ tracker.calls[sn] = call
+ tracker.lck.Unlock()
+}
+
+func (tracker *callTracker) handleReply(sequence Sequence, msg *Message) uint32 {
+ serial := msg.Headers[FieldReplySerial].value.(uint32)
+ tracker.lck.RLock()
+ _, ok := tracker.calls[serial]
+ tracker.lck.RUnlock()
+ if ok {
+ tracker.finalizeWithBody(serial, sequence, msg.Body)
+ }
+ return serial
+}
+
+func (tracker *callTracker) handleDBusError(sequence Sequence, msg *Message) uint32 {
+ serial := msg.Headers[FieldReplySerial].value.(uint32)
+ tracker.lck.RLock()
+ _, ok := tracker.calls[serial]
+ tracker.lck.RUnlock()
+ if ok {
+ name, _ := msg.Headers[FieldErrorName].value.(string)
+ tracker.finalizeWithError(serial, sequence, Error{name, msg.Body})
+ }
+ return serial
+}
+
+func (tracker *callTracker) handleSendError(msg *Message, err error) {
+ if err == nil {
+ return
+ }
+ tracker.lck.RLock()
+ _, ok := tracker.calls[msg.serial]
+ tracker.lck.RUnlock()
+ if ok {
+ tracker.finalizeWithError(msg.serial, NoSequence, err)
+ }
+}
+
+// finalize was the only func that did not strobe Done
+func (tracker *callTracker) finalize(sn uint32) {
+ tracker.lck.Lock()
+ defer tracker.lck.Unlock()
+ c, ok := tracker.calls[sn]
+ if ok {
+ delete(tracker.calls, sn)
+ c.ContextCancel()
+ }
+}
+
+func (tracker *callTracker) finalizeWithBody(sn uint32, sequence Sequence, body []interface{}) {
+ tracker.lck.Lock()
+ c, ok := tracker.calls[sn]
+ if ok {
+ delete(tracker.calls, sn)
+ }
+ tracker.lck.Unlock()
+ if ok {
+ c.Body = body
+ c.ResponseSequence = sequence
+ c.done()
+ }
+}
+
+func (tracker *callTracker) finalizeWithError(sn uint32, sequence Sequence, err error) {
+ tracker.lck.Lock()
+ c, ok := tracker.calls[sn]
+ if ok {
+ delete(tracker.calls, sn)
+ }
+ tracker.lck.Unlock()
+ if ok {
+ c.Err = err
+ c.ResponseSequence = sequence
+ c.done()
+ }
+}
+
+func (tracker *callTracker) finalizeAllWithError(sequenceGen *sequenceGenerator, err error) {
+ tracker.lck.Lock()
+ closedCalls := make([]*Call, 0, len(tracker.calls))
+ for sn := range tracker.calls {
+ closedCalls = append(closedCalls, tracker.calls[sn])
+ }
+ tracker.calls = map[uint32]*Call{}
+ tracker.lck.Unlock()
+ for _, call := range closedCalls {
+ call.Err = err
+ call.ResponseSequence = sequenceGen.next()
+ call.done()
+ }
+}
diff --git a/archive/vendor/github.com/godbus/dbus/v5/conn_darwin.go b/archive/vendor/github.com/godbus/dbus/v5/conn_darwin.go
new file mode 100644
index 0000000..6e2e402
--- /dev/null
+++ b/archive/vendor/github.com/godbus/dbus/v5/conn_darwin.go
@@ -0,0 +1,37 @@
+package dbus
+
+import (
+ "errors"
+ "fmt"
+ "os"
+ "os/exec"
+)
+
+const defaultSystemBusAddress = "unix:path=/opt/local/var/run/dbus/system_bus_socket"
+
+func getSessionBusPlatformAddress() (string, error) {
+ cmd := exec.Command("launchctl", "getenv", "DBUS_LAUNCHD_SESSION_BUS_SOCKET")
+ b, err := cmd.CombinedOutput()
+
+ if err != nil {
+ return "", err
+ }
+
+ if len(b) == 0 {
+ return "", errors.New("dbus: couldn't determine address of session bus")
+ }
+
+ return "unix:path=" + string(b[:len(b)-1]), nil
+}
+
+func getSystemBusPlatformAddress() string {
+ address := os.Getenv("DBUS_LAUNCHD_SESSION_BUS_SOCKET")
+ if address != "" {
+ return fmt.Sprintf("unix:path=%s", address)
+ }
+ return defaultSystemBusAddress
+}
+
+func tryDiscoverDbusSessionBusAddress() string {
+ return ""
+}
diff --git a/archive/vendor/github.com/godbus/dbus/v5/conn_other.go b/archive/vendor/github.com/godbus/dbus/v5/conn_other.go
new file mode 100644
index 0000000..90289ca
--- /dev/null
+++ b/archive/vendor/github.com/godbus/dbus/v5/conn_other.go
@@ -0,0 +1,90 @@
+// +build !darwin
+
+package dbus
+
+import (
+ "bytes"
+ "errors"
+ "fmt"
+ "io/ioutil"
+ "os"
+ "os/exec"
+ "os/user"
+ "path"
+ "strings"
+)
+
+var execCommand = exec.Command
+
+func getSessionBusPlatformAddress() (string, error) {
+ cmd := execCommand("dbus-launch")
+ b, err := cmd.CombinedOutput()
+
+ if err != nil {
+ return "", err
+ }
+
+ i := bytes.IndexByte(b, '=')
+ j := bytes.IndexByte(b, '\n')
+
+ if i == -1 || j == -1 || i > j {
+ return "", errors.New("dbus: couldn't determine address of session bus")
+ }
+
+ env, addr := string(b[0:i]), string(b[i+1:j])
+ os.Setenv(env, addr)
+
+ return addr, nil
+}
+
+// tryDiscoverDbusSessionBusAddress tries to discover an existing dbus session
+// and return the value of its DBUS_SESSION_BUS_ADDRESS.
+// It tries different techniques employed by different operating systems,
+// returning the first valid address it finds, or an empty string.
+//
+// * /run/user//bus if this exists, it *is* the bus socket. present on
+// Ubuntu 18.04
+// * /run/user//dbus-session: if this exists, it can be parsed for the bus
+// address. present on Ubuntu 16.04
+//
+// See https://dbus.freedesktop.org/doc/dbus-launch.1.html
+func tryDiscoverDbusSessionBusAddress() string {
+ if runtimeDirectory, err := getRuntimeDirectory(); err == nil {
+
+ if runUserBusFile := path.Join(runtimeDirectory, "bus"); fileExists(runUserBusFile) {
+ // if /run/user//bus exists, that file itself
+ // *is* the unix socket, so return its path
+ return fmt.Sprintf("unix:path=%s", EscapeBusAddressValue(runUserBusFile))
+ }
+ if runUserSessionDbusFile := path.Join(runtimeDirectory, "dbus-session"); fileExists(runUserSessionDbusFile) {
+ // if /run/user//dbus-session exists, it's a
+ // text file // containing the address of the socket, e.g.:
+ // DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-E1c73yNqrG
+
+ if f, err := ioutil.ReadFile(runUserSessionDbusFile); err == nil {
+ fileContent := string(f)
+
+ prefix := "DBUS_SESSION_BUS_ADDRESS="
+
+ if strings.HasPrefix(fileContent, prefix) {
+ address := strings.TrimRight(strings.TrimPrefix(fileContent, prefix), "\n\r")
+ return address
+ }
+ }
+ }
+ }
+ return ""
+}
+
+func getRuntimeDirectory() (string, error) {
+ if currentUser, err := user.Current(); err != nil {
+ return "", err
+ } else {
+ return fmt.Sprintf("/run/user/%s", currentUser.Uid), nil
+ }
+}
+
+func fileExists(filename string) bool {
+ _, err := os.Stat(filename)
+ return !os.IsNotExist(err)
+}
diff --git a/archive/vendor/github.com/godbus/dbus/v5/conn_unix.go b/archive/vendor/github.com/godbus/dbus/v5/conn_unix.go
new file mode 100644
index 0000000..58aee7d
--- /dev/null
+++ b/archive/vendor/github.com/godbus/dbus/v5/conn_unix.go
@@ -0,0 +1,17 @@
+//+build !windows,!solaris,!darwin
+
+package dbus
+
+import (
+ "os"
+)
+
+const defaultSystemBusAddress = "unix:path=/var/run/dbus/system_bus_socket"
+
+func getSystemBusPlatformAddress() string {
+ address := os.Getenv("DBUS_SYSTEM_BUS_ADDRESS")
+ if address != "" {
+ return address
+ }
+ return defaultSystemBusAddress
+}
diff --git a/archive/vendor/github.com/godbus/dbus/v5/conn_windows.go b/archive/vendor/github.com/godbus/dbus/v5/conn_windows.go
new file mode 100644
index 0000000..4291e45
--- /dev/null
+++ b/archive/vendor/github.com/godbus/dbus/v5/conn_windows.go
@@ -0,0 +1,15 @@
+//+build windows
+
+package dbus
+
+import "os"
+
+const defaultSystemBusAddress = "tcp:host=127.0.0.1,port=12434"
+
+func getSystemBusPlatformAddress() string {
+ address := os.Getenv("DBUS_SYSTEM_BUS_ADDRESS")
+ if address != "" {
+ return address
+ }
+ return defaultSystemBusAddress
+}
diff --git a/archive/vendor/github.com/godbus/dbus/v5/dbus.go b/archive/vendor/github.com/godbus/dbus/v5/dbus.go
new file mode 100644
index 0000000..c188d10
--- /dev/null
+++ b/archive/vendor/github.com/godbus/dbus/v5/dbus.go
@@ -0,0 +1,430 @@
+package dbus
+
+import (
+ "errors"
+ "fmt"
+ "reflect"
+ "strings"
+)
+
+var (
+ byteType = reflect.TypeOf(byte(0))
+ boolType = reflect.TypeOf(false)
+ uint8Type = reflect.TypeOf(uint8(0))
+ int16Type = reflect.TypeOf(int16(0))
+ uint16Type = reflect.TypeOf(uint16(0))
+ intType = reflect.TypeOf(int(0))
+ uintType = reflect.TypeOf(uint(0))
+ int32Type = reflect.TypeOf(int32(0))
+ uint32Type = reflect.TypeOf(uint32(0))
+ int64Type = reflect.TypeOf(int64(0))
+ uint64Type = reflect.TypeOf(uint64(0))
+ float64Type = reflect.TypeOf(float64(0))
+ stringType = reflect.TypeOf("")
+ signatureType = reflect.TypeOf(Signature{""})
+ objectPathType = reflect.TypeOf(ObjectPath(""))
+ variantType = reflect.TypeOf(Variant{Signature{""}, nil})
+ interfacesType = reflect.TypeOf([]interface{}{})
+ interfaceType = reflect.TypeOf((*interface{})(nil)).Elem()
+ unixFDType = reflect.TypeOf(UnixFD(0))
+ unixFDIndexType = reflect.TypeOf(UnixFDIndex(0))
+ errType = reflect.TypeOf((*error)(nil)).Elem()
+)
+
+// An InvalidTypeError signals that a value which cannot be represented in the
+// D-Bus wire format was passed to a function.
+type InvalidTypeError struct {
+ Type reflect.Type
+}
+
+func (e InvalidTypeError) Error() string {
+ return "dbus: invalid type " + e.Type.String()
+}
+
+// Store copies the values contained in src to dest, which must be a slice of
+// pointers. It converts slices of interfaces from src to corresponding structs
+// in dest. An error is returned if the lengths of src and dest or the types of
+// their elements don't match.
+func Store(src []interface{}, dest ...interface{}) error {
+ if len(src) != len(dest) {
+ return errors.New("dbus.Store: length mismatch")
+ }
+
+ for i := range src {
+ if err := storeInterfaces(src[i], dest[i]); err != nil {
+ return err
+ }
+ }
+ return nil
+}
+
+func storeInterfaces(src, dest interface{}) error {
+ return store(reflect.ValueOf(dest), reflect.ValueOf(src))
+}
+
+func store(dest, src reflect.Value) error {
+ if dest.Kind() == reflect.Ptr {
+ if dest.IsNil() {
+ dest.Set(reflect.New(dest.Type().Elem()))
+ }
+ return store(dest.Elem(), src)
+ }
+ switch src.Kind() {
+ case reflect.Slice:
+ return storeSlice(dest, src)
+ case reflect.Map:
+ return storeMap(dest, src)
+ default:
+ return storeBase(dest, src)
+ }
+}
+
+func storeBase(dest, src reflect.Value) error {
+ return setDest(dest, src)
+}
+
+func setDest(dest, src reflect.Value) error {
+ if !isVariant(src.Type()) && isVariant(dest.Type()) {
+ //special conversion for dbus.Variant
+ dest.Set(reflect.ValueOf(MakeVariant(src.Interface())))
+ return nil
+ }
+ if isVariant(src.Type()) && !isVariant(dest.Type()) {
+ src = getVariantValue(src)
+ return store(dest, src)
+ }
+ if !src.Type().ConvertibleTo(dest.Type()) {
+ return fmt.Errorf(
+ "dbus.Store: type mismatch: cannot convert %s to %s",
+ src.Type(), dest.Type())
+ }
+ dest.Set(src.Convert(dest.Type()))
+ return nil
+}
+
+func kindsAreCompatible(dest, src reflect.Type) bool {
+ switch {
+ case isVariant(dest):
+ return true
+ case dest.Kind() == reflect.Interface:
+ return true
+ default:
+ return dest.Kind() == src.Kind()
+ }
+}
+
+func isConvertibleTo(dest, src reflect.Type) bool {
+ switch {
+ case isVariant(dest):
+ return true
+ case dest.Kind() == reflect.Interface:
+ return true
+ case dest.Kind() == reflect.Slice:
+ return src.Kind() == reflect.Slice &&
+ isConvertibleTo(dest.Elem(), src.Elem())
+ case dest.Kind() == reflect.Ptr:
+ dest = dest.Elem()
+ return isConvertibleTo(dest, src)
+ case dest.Kind() == reflect.Struct:
+ return src == interfacesType || dest.Kind() == src.Kind()
+ default:
+ return src.ConvertibleTo(dest)
+ }
+}
+
+func storeMap(dest, src reflect.Value) error {
+ switch {
+ case !kindsAreCompatible(dest.Type(), src.Type()):
+ return fmt.Errorf(
+ "dbus.Store: type mismatch: "+
+ "map: cannot store a value of %s into %s",
+ src.Type(), dest.Type())
+ case isVariant(dest.Type()):
+ return storeMapIntoVariant(dest, src)
+ case dest.Kind() == reflect.Interface:
+ return storeMapIntoInterface(dest, src)
+ case isConvertibleTo(dest.Type().Key(), src.Type().Key()) &&
+ isConvertibleTo(dest.Type().Elem(), src.Type().Elem()):
+ return storeMapIntoMap(dest, src)
+ default:
+ return fmt.Errorf(
+ "dbus.Store: type mismatch: "+
+ "map: cannot convert a value of %s into %s",
+ src.Type(), dest.Type())
+ }
+}
+
+func storeMapIntoVariant(dest, src reflect.Value) error {
+ dv := reflect.MakeMap(src.Type())
+ err := store(dv, src)
+ if err != nil {
+ return err
+ }
+ return storeBase(dest, dv)
+}
+
+func storeMapIntoInterface(dest, src reflect.Value) error {
+ var dv reflect.Value
+ if isVariant(src.Type().Elem()) {
+ //Convert variants to interface{} recursively when converting
+ //to interface{}
+ dv = reflect.MakeMap(
+ reflect.MapOf(src.Type().Key(), interfaceType))
+ } else {
+ dv = reflect.MakeMap(src.Type())
+ }
+ err := store(dv, src)
+ if err != nil {
+ return err
+ }
+ return storeBase(dest, dv)
+}
+
+func storeMapIntoMap(dest, src reflect.Value) error {
+ if dest.IsNil() {
+ dest.Set(reflect.MakeMap(dest.Type()))
+ }
+ keys := src.MapKeys()
+ for _, key := range keys {
+ dkey := key.Convert(dest.Type().Key())
+ dval := reflect.New(dest.Type().Elem()).Elem()
+ err := store(dval, getVariantValue(src.MapIndex(key)))
+ if err != nil {
+ return err
+ }
+ dest.SetMapIndex(dkey, dval)
+ }
+ return nil
+}
+
+func storeSlice(dest, src reflect.Value) error {
+ switch {
+ case src.Type() == interfacesType && dest.Kind() == reflect.Struct:
+ //The decoder always decodes structs as slices of interface{}
+ return storeStruct(dest, src)
+ case !kindsAreCompatible(dest.Type(), src.Type()):
+ return fmt.Errorf(
+ "dbus.Store: type mismatch: "+
+ "slice: cannot store a value of %s into %s",
+ src.Type(), dest.Type())
+ case isVariant(dest.Type()):
+ return storeSliceIntoVariant(dest, src)
+ case dest.Kind() == reflect.Interface:
+ return storeSliceIntoInterface(dest, src)
+ case isConvertibleTo(dest.Type().Elem(), src.Type().Elem()):
+ return storeSliceIntoSlice(dest, src)
+ default:
+ return fmt.Errorf(
+ "dbus.Store: type mismatch: "+
+ "slice: cannot convert a value of %s into %s",
+ src.Type(), dest.Type())
+ }
+}
+
+func storeStruct(dest, src reflect.Value) error {
+ if isVariant(dest.Type()) {
+ return storeBase(dest, src)
+ }
+ dval := make([]interface{}, 0, dest.NumField())
+ dtype := dest.Type()
+ for i := 0; i < dest.NumField(); i++ {
+ field := dest.Field(i)
+ ftype := dtype.Field(i)
+ if ftype.PkgPath != "" {
+ continue
+ }
+ if ftype.Tag.Get("dbus") == "-" {
+ continue
+ }
+ dval = append(dval, field.Addr().Interface())
+ }
+ if src.Len() != len(dval) {
+ return fmt.Errorf(
+ "dbus.Store: type mismatch: "+
+ "destination struct does not have "+
+ "enough fields need: %d have: %d",
+ src.Len(), len(dval))
+ }
+ return Store(src.Interface().([]interface{}), dval...)
+}
+
+func storeSliceIntoVariant(dest, src reflect.Value) error {
+ dv := reflect.MakeSlice(src.Type(), src.Len(), src.Cap())
+ err := store(dv, src)
+ if err != nil {
+ return err
+ }
+ return storeBase(dest, dv)
+}
+
+func storeSliceIntoInterface(dest, src reflect.Value) error {
+ var dv reflect.Value
+ if isVariant(src.Type().Elem()) {
+ //Convert variants to interface{} recursively when converting
+ //to interface{}
+ dv = reflect.MakeSlice(reflect.SliceOf(interfaceType),
+ src.Len(), src.Cap())
+ } else {
+ dv = reflect.MakeSlice(src.Type(), src.Len(), src.Cap())
+ }
+ err := store(dv, src)
+ if err != nil {
+ return err
+ }
+ return storeBase(dest, dv)
+}
+
+func storeSliceIntoSlice(dest, src reflect.Value) error {
+ if dest.IsNil() || dest.Len() < src.Len() {
+ dest.Set(reflect.MakeSlice(dest.Type(), src.Len(), src.Cap()))
+ } else if dest.Len() > src.Len() {
+ dest.Set(dest.Slice(0, src.Len()))
+ }
+ for i := 0; i < src.Len(); i++ {
+ err := store(dest.Index(i), getVariantValue(src.Index(i)))
+ if err != nil {
+ return err
+ }
+ }
+ return nil
+}
+
+func getVariantValue(in reflect.Value) reflect.Value {
+ if isVariant(in.Type()) {
+ return reflect.ValueOf(in.Interface().(Variant).Value())
+ }
+ return in
+}
+
+func isVariant(t reflect.Type) bool {
+ return t == variantType
+}
+
+// An ObjectPath is an object path as defined by the D-Bus spec.
+type ObjectPath string
+
+// IsValid returns whether the object path is valid.
+func (o ObjectPath) IsValid() bool {
+ s := string(o)
+ if len(s) == 0 {
+ return false
+ }
+ if s[0] != '/' {
+ return false
+ }
+ if s[len(s)-1] == '/' && len(s) != 1 {
+ return false
+ }
+ // probably not used, but technically possible
+ if s == "/" {
+ return true
+ }
+ split := strings.Split(s[1:], "/")
+ for _, v := range split {
+ if len(v) == 0 {
+ return false
+ }
+ for _, c := range v {
+ if !isMemberChar(c) {
+ return false
+ }
+ }
+ }
+ return true
+}
+
+// A UnixFD is a Unix file descriptor sent over the wire. See the package-level
+// documentation for more information about Unix file descriptor passsing.
+type UnixFD int32
+
+// A UnixFDIndex is the representation of a Unix file descriptor in a message.
+type UnixFDIndex uint32
+
+// alignment returns the alignment of values of type t.
+func alignment(t reflect.Type) int {
+ switch t {
+ case variantType:
+ return 1
+ case objectPathType:
+ return 4
+ case signatureType:
+ return 1
+ case interfacesType:
+ return 4
+ }
+ switch t.Kind() {
+ case reflect.Uint8:
+ return 1
+ case reflect.Uint16, reflect.Int16:
+ return 2
+ case reflect.Uint, reflect.Int, reflect.Uint32, reflect.Int32, reflect.String, reflect.Array, reflect.Slice, reflect.Map:
+ return 4
+ case reflect.Uint64, reflect.Int64, reflect.Float64, reflect.Struct:
+ return 8
+ case reflect.Ptr:
+ return alignment(t.Elem())
+ }
+ return 1
+}
+
+// isKeyType returns whether t is a valid type for a D-Bus dict.
+func isKeyType(t reflect.Type) bool {
+ switch t.Kind() {
+ case reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64,
+ reflect.Int16, reflect.Int32, reflect.Int64, reflect.Float64,
+ reflect.String, reflect.Uint, reflect.Int:
+
+ return true
+ }
+ return false
+}
+
+// isValidInterface returns whether s is a valid name for an interface.
+func isValidInterface(s string) bool {
+ if len(s) == 0 || len(s) > 255 || s[0] == '.' {
+ return false
+ }
+ elem := strings.Split(s, ".")
+ if len(elem) < 2 {
+ return false
+ }
+ for _, v := range elem {
+ if len(v) == 0 {
+ return false
+ }
+ if v[0] >= '0' && v[0] <= '9' {
+ return false
+ }
+ for _, c := range v {
+ if !isMemberChar(c) {
+ return false
+ }
+ }
+ }
+ return true
+}
+
+// isValidMember returns whether s is a valid name for a member.
+func isValidMember(s string) bool {
+ if len(s) == 0 || len(s) > 255 {
+ return false
+ }
+ i := strings.Index(s, ".")
+ if i != -1 {
+ return false
+ }
+ if s[0] >= '0' && s[0] <= '9' {
+ return false
+ }
+ for _, c := range s {
+ if !isMemberChar(c) {
+ return false
+ }
+ }
+ return true
+}
+
+func isMemberChar(c rune) bool {
+ return (c >= '0' && c <= '9') || (c >= 'A' && c <= 'Z') ||
+ (c >= 'a' && c <= 'z') || c == '_'
+}
diff --git a/archive/vendor/github.com/godbus/dbus/v5/decoder.go b/archive/vendor/github.com/godbus/dbus/v5/decoder.go
new file mode 100644
index 0000000..89bfed9
--- /dev/null
+++ b/archive/vendor/github.com/godbus/dbus/v5/decoder.go
@@ -0,0 +1,292 @@
+package dbus
+
+import (
+ "encoding/binary"
+ "io"
+ "reflect"
+)
+
+type decoder struct {
+ in io.Reader
+ order binary.ByteOrder
+ pos int
+ fds []int
+}
+
+// newDecoder returns a new decoder that reads values from in. The input is
+// expected to be in the given byte order.
+func newDecoder(in io.Reader, order binary.ByteOrder, fds []int) *decoder {
+ dec := new(decoder)
+ dec.in = in
+ dec.order = order
+ dec.fds = fds
+ return dec
+}
+
+// align aligns the input to the given boundary and panics on error.
+func (dec *decoder) align(n int) {
+ if dec.pos%n != 0 {
+ newpos := (dec.pos + n - 1) & ^(n - 1)
+ empty := make([]byte, newpos-dec.pos)
+ if _, err := io.ReadFull(dec.in, empty); err != nil {
+ panic(err)
+ }
+ dec.pos = newpos
+ }
+}
+
+// Calls binary.Read(dec.in, dec.order, v) and panics on read errors.
+func (dec *decoder) binread(v interface{}) {
+ if err := binary.Read(dec.in, dec.order, v); err != nil {
+ panic(err)
+ }
+}
+
+func (dec *decoder) Decode(sig Signature) (vs []interface{}, err error) {
+ defer func() {
+ var ok bool
+ v := recover()
+ if err, ok = v.(error); ok {
+ if err == io.EOF || err == io.ErrUnexpectedEOF {
+ err = FormatError("unexpected EOF")
+ }
+ }
+ }()
+ vs = make([]interface{}, 0)
+ s := sig.str
+ for s != "" {
+ err, rem := validSingle(s, &depthCounter{})
+ if err != nil {
+ return nil, err
+ }
+ v := dec.decode(s[:len(s)-len(rem)], 0)
+ vs = append(vs, v)
+ s = rem
+ }
+ return vs, nil
+}
+
+func (dec *decoder) decode(s string, depth int) interface{} {
+ dec.align(alignment(typeFor(s)))
+ switch s[0] {
+ case 'y':
+ var b [1]byte
+ if _, err := dec.in.Read(b[:]); err != nil {
+ panic(err)
+ }
+ dec.pos++
+ return b[0]
+ case 'b':
+ i := dec.decode("u", depth).(uint32)
+ switch {
+ case i == 0:
+ return false
+ case i == 1:
+ return true
+ default:
+ panic(FormatError("invalid value for boolean"))
+ }
+ case 'n':
+ var i int16
+ dec.binread(&i)
+ dec.pos += 2
+ return i
+ case 'i':
+ var i int32
+ dec.binread(&i)
+ dec.pos += 4
+ return i
+ case 'x':
+ var i int64
+ dec.binread(&i)
+ dec.pos += 8
+ return i
+ case 'q':
+ var i uint16
+ dec.binread(&i)
+ dec.pos += 2
+ return i
+ case 'u':
+ var i uint32
+ dec.binread(&i)
+ dec.pos += 4
+ return i
+ case 't':
+ var i uint64
+ dec.binread(&i)
+ dec.pos += 8
+ return i
+ case 'd':
+ var f float64
+ dec.binread(&f)
+ dec.pos += 8
+ return f
+ case 's':
+ length := dec.decode("u", depth).(uint32)
+ b := make([]byte, int(length)+1)
+ if _, err := io.ReadFull(dec.in, b); err != nil {
+ panic(err)
+ }
+ dec.pos += int(length) + 1
+ return string(b[:len(b)-1])
+ case 'o':
+ return ObjectPath(dec.decode("s", depth).(string))
+ case 'g':
+ length := dec.decode("y", depth).(byte)
+ b := make([]byte, int(length)+1)
+ if _, err := io.ReadFull(dec.in, b); err != nil {
+ panic(err)
+ }
+ dec.pos += int(length) + 1
+ sig, err := ParseSignature(string(b[:len(b)-1]))
+ if err != nil {
+ panic(err)
+ }
+ return sig
+ case 'v':
+ if depth >= 64 {
+ panic(FormatError("input exceeds container depth limit"))
+ }
+ var variant Variant
+ sig := dec.decode("g", depth).(Signature)
+ if len(sig.str) == 0 {
+ panic(FormatError("variant signature is empty"))
+ }
+ err, rem := validSingle(sig.str, &depthCounter{})
+ if err != nil {
+ panic(err)
+ }
+ if rem != "" {
+ panic(FormatError("variant signature has multiple types"))
+ }
+ variant.sig = sig
+ variant.value = dec.decode(sig.str, depth+1)
+ return variant
+ case 'h':
+ idx := dec.decode("u", depth).(uint32)
+ if int(idx) < len(dec.fds) {
+ return UnixFD(dec.fds[idx])
+ }
+ return UnixFDIndex(idx)
+ case 'a':
+ if len(s) > 1 && s[1] == '{' {
+ ksig := s[2:3]
+ vsig := s[3 : len(s)-1]
+ v := reflect.MakeMap(reflect.MapOf(typeFor(ksig), typeFor(vsig)))
+ if depth >= 63 {
+ panic(FormatError("input exceeds container depth limit"))
+ }
+ length := dec.decode("u", depth).(uint32)
+ // Even for empty maps, the correct padding must be included
+ dec.align(8)
+ spos := dec.pos
+ for dec.pos < spos+int(length) {
+ dec.align(8)
+ if !isKeyType(v.Type().Key()) {
+ panic(InvalidTypeError{v.Type()})
+ }
+ kv := dec.decode(ksig, depth+2)
+ vv := dec.decode(vsig, depth+2)
+ v.SetMapIndex(reflect.ValueOf(kv), reflect.ValueOf(vv))
+ }
+ return v.Interface()
+ }
+ if depth >= 64 {
+ panic(FormatError("input exceeds container depth limit"))
+ }
+ sig := s[1:]
+ length := dec.decode("u", depth).(uint32)
+ // capacity can be determined only for fixed-size element types
+ var capacity int
+ if s := sigByteSize(sig); s != 0 {
+ capacity = int(length) / s
+ }
+ v := reflect.MakeSlice(reflect.SliceOf(typeFor(sig)), 0, capacity)
+ // Even for empty arrays, the correct padding must be included
+ align := alignment(typeFor(s[1:]))
+ if len(s) > 1 && s[1] == '(' {
+ //Special case for arrays of structs
+ //structs decode as a slice of interface{} values
+ //but the dbus alignment does not match this
+ align = 8
+ }
+ dec.align(align)
+ spos := dec.pos
+ for dec.pos < spos+int(length) {
+ ev := dec.decode(s[1:], depth+1)
+ v = reflect.Append(v, reflect.ValueOf(ev))
+ }
+ return v.Interface()
+ case '(':
+ if depth >= 64 {
+ panic(FormatError("input exceeds container depth limit"))
+ }
+ dec.align(8)
+ v := make([]interface{}, 0)
+ s = s[1 : len(s)-1]
+ for s != "" {
+ err, rem := validSingle(s, &depthCounter{})
+ if err != nil {
+ panic(err)
+ }
+ ev := dec.decode(s[:len(s)-len(rem)], depth+1)
+ v = append(v, ev)
+ s = rem
+ }
+ return v
+ default:
+ panic(SignatureError{Sig: s})
+ }
+}
+
+// sigByteSize tries to calculates size of the given signature in bytes.
+//
+// It returns zero when it can't, for example when it contains non-fixed size
+// types such as strings, maps and arrays that require reading of the transmitted
+// data, for that we would need to implement the unread method for Decoder first.
+func sigByteSize(sig string) int {
+ var total int
+ for offset := 0; offset < len(sig); {
+ switch sig[offset] {
+ case 'y':
+ total += 1
+ offset += 1
+ case 'n', 'q':
+ total += 2
+ offset += 1
+ case 'b', 'i', 'u', 'h':
+ total += 4
+ offset += 1
+ case 'x', 't', 'd':
+ total += 8
+ offset += 1
+ case '(':
+ i := 1
+ depth := 1
+ for i < len(sig[offset:]) && depth != 0 {
+ if sig[offset+i] == '(' {
+ depth++
+ } else if sig[offset+i] == ')' {
+ depth--
+ }
+ i++
+ }
+ s := sigByteSize(sig[offset+1 : offset+i-1])
+ if s == 0 {
+ return 0
+ }
+ total += s
+ offset += i
+ default:
+ return 0
+ }
+ }
+ return total
+}
+
+// A FormatError is an error in the wire format.
+type FormatError string
+
+func (e FormatError) Error() string {
+ return "dbus: wire format error: " + string(e)
+}
diff --git a/archive/vendor/github.com/godbus/dbus/v5/default_handler.go b/archive/vendor/github.com/godbus/dbus/v5/default_handler.go
new file mode 100644
index 0000000..13132c6
--- /dev/null
+++ b/archive/vendor/github.com/godbus/dbus/v5/default_handler.go
@@ -0,0 +1,342 @@
+package dbus
+
+import (
+ "bytes"
+ "reflect"
+ "strings"
+ "sync"
+)
+
+func newIntrospectIntf(h *defaultHandler) *exportedIntf {
+ methods := make(map[string]Method)
+ methods["Introspect"] = exportedMethod{
+ reflect.ValueOf(func(msg Message) (string, *Error) {
+ path := msg.Headers[FieldPath].value.(ObjectPath)
+ return h.introspectPath(path), nil
+ }),
+ }
+ return newExportedIntf(methods, true)
+}
+
+//NewDefaultHandler returns an instance of the default
+//call handler. This is useful if you want to implement only
+//one of the two handlers but not both.
+//
+// Deprecated: this is the default value, don't use it, it will be unexported.
+func NewDefaultHandler() *defaultHandler {
+ h := &defaultHandler{
+ objects: make(map[ObjectPath]*exportedObj),
+ defaultIntf: make(map[string]*exportedIntf),
+ }
+ h.defaultIntf["org.freedesktop.DBus.Introspectable"] = newIntrospectIntf(h)
+ return h
+}
+
+type defaultHandler struct {
+ sync.RWMutex
+ objects map[ObjectPath]*exportedObj
+ defaultIntf map[string]*exportedIntf
+}
+
+func (h *defaultHandler) PathExists(path ObjectPath) bool {
+ _, ok := h.objects[path]
+ return ok
+}
+
+func (h *defaultHandler) introspectPath(path ObjectPath) string {
+ subpath := make(map[string]struct{})
+ var xml bytes.Buffer
+ xml.WriteString("")
+ for obj := range h.objects {
+ p := string(path)
+ if p != "/" {
+ p += "/"
+ }
+ if strings.HasPrefix(string(obj), p) {
+ node_name := strings.Split(string(obj[len(p):]), "/")[0]
+ subpath[node_name] = struct{}{}
+ }
+ }
+ for s := range subpath {
+ xml.WriteString("\n\t ")
+ }
+ xml.WriteString("\n ")
+ return xml.String()
+}
+
+func (h *defaultHandler) LookupObject(path ObjectPath) (ServerObject, bool) {
+ h.RLock()
+ defer h.RUnlock()
+ object, ok := h.objects[path]
+ if ok {
+ return object, ok
+ }
+
+ // If an object wasn't found for this exact path,
+ // look for a matching subtree registration
+ subtreeObject := newExportedObject()
+ path = path[:strings.LastIndex(string(path), "/")]
+ for len(path) > 0 {
+ object, ok = h.objects[path]
+ if ok {
+ for name, iface := range object.interfaces {
+ // Only include this handler if it registered for the subtree
+ if iface.isFallbackInterface() {
+ subtreeObject.interfaces[name] = iface
+ }
+ }
+ break
+ }
+
+ path = path[:strings.LastIndex(string(path), "/")]
+ }
+
+ for name, intf := range h.defaultIntf {
+ if _, exists := subtreeObject.interfaces[name]; exists {
+ continue
+ }
+ subtreeObject.interfaces[name] = intf
+ }
+
+ return subtreeObject, true
+}
+
+func (h *defaultHandler) AddObject(path ObjectPath, object *exportedObj) {
+ h.Lock()
+ h.objects[path] = object
+ h.Unlock()
+}
+
+func (h *defaultHandler) DeleteObject(path ObjectPath) {
+ h.Lock()
+ delete(h.objects, path)
+ h.Unlock()
+}
+
+type exportedMethod struct {
+ reflect.Value
+}
+
+func (m exportedMethod) Call(args ...interface{}) ([]interface{}, error) {
+ t := m.Type()
+
+ params := make([]reflect.Value, len(args))
+ for i := 0; i < len(args); i++ {
+ params[i] = reflect.ValueOf(args[i]).Elem()
+ }
+
+ ret := m.Value.Call(params)
+ var err error
+ nilErr := false // The reflection will find almost-nils, let's only pass back clean ones!
+ if t.NumOut() > 0 {
+ if e, ok := ret[t.NumOut()-1].Interface().(*Error); ok { // godbus *Error
+ nilErr = ret[t.NumOut()-1].IsNil()
+ ret = ret[:t.NumOut()-1]
+ err = e
+ } else if ret[t.NumOut()-1].Type().Implements(errType) { // Go error
+ i := ret[t.NumOut()-1].Interface()
+ if i == nil {
+ nilErr = ret[t.NumOut()-1].IsNil()
+ } else {
+ err = i.(error)
+ }
+ ret = ret[:t.NumOut()-1]
+ }
+ }
+ out := make([]interface{}, len(ret))
+ for i, val := range ret {
+ out[i] = val.Interface()
+ }
+ if nilErr || err == nil {
+ //concrete type to interface nil is a special case
+ return out, nil
+ }
+ return out, err
+}
+
+func (m exportedMethod) NumArguments() int {
+ return m.Value.Type().NumIn()
+}
+
+func (m exportedMethod) ArgumentValue(i int) interface{} {
+ return reflect.Zero(m.Type().In(i)).Interface()
+}
+
+func (m exportedMethod) NumReturns() int {
+ return m.Value.Type().NumOut()
+}
+
+func (m exportedMethod) ReturnValue(i int) interface{} {
+ return reflect.Zero(m.Type().Out(i)).Interface()
+}
+
+func newExportedObject() *exportedObj {
+ return &exportedObj{
+ interfaces: make(map[string]*exportedIntf),
+ }
+}
+
+type exportedObj struct {
+ mu sync.RWMutex
+ interfaces map[string]*exportedIntf
+}
+
+func (obj *exportedObj) LookupInterface(name string) (Interface, bool) {
+ if name == "" {
+ return obj, true
+ }
+ obj.mu.RLock()
+ defer obj.mu.RUnlock()
+ intf, exists := obj.interfaces[name]
+ return intf, exists
+}
+
+func (obj *exportedObj) AddInterface(name string, iface *exportedIntf) {
+ obj.mu.Lock()
+ defer obj.mu.Unlock()
+ obj.interfaces[name] = iface
+}
+
+func (obj *exportedObj) DeleteInterface(name string) {
+ obj.mu.Lock()
+ defer obj.mu.Unlock()
+ delete(obj.interfaces, name)
+}
+
+func (obj *exportedObj) LookupMethod(name string) (Method, bool) {
+ obj.mu.RLock()
+ defer obj.mu.RUnlock()
+ for _, intf := range obj.interfaces {
+ method, exists := intf.LookupMethod(name)
+ if exists {
+ return method, exists
+ }
+ }
+ return nil, false
+}
+
+func (obj *exportedObj) isFallbackInterface() bool {
+ return false
+}
+
+func newExportedIntf(methods map[string]Method, includeSubtree bool) *exportedIntf {
+ return &exportedIntf{
+ methods: methods,
+ includeSubtree: includeSubtree,
+ }
+}
+
+type exportedIntf struct {
+ methods map[string]Method
+
+ // Whether or not this export is for the entire subtree
+ includeSubtree bool
+}
+
+func (obj *exportedIntf) LookupMethod(name string) (Method, bool) {
+ out, exists := obj.methods[name]
+ return out, exists
+}
+
+func (obj *exportedIntf) isFallbackInterface() bool {
+ return obj.includeSubtree
+}
+
+//NewDefaultSignalHandler returns an instance of the default
+//signal handler. This is useful if you want to implement only
+//one of the two handlers but not both.
+//
+// Deprecated: this is the default value, don't use it, it will be unexported.
+func NewDefaultSignalHandler() *defaultSignalHandler {
+ return &defaultSignalHandler{}
+}
+
+type defaultSignalHandler struct {
+ mu sync.RWMutex
+ closed bool
+ signals []*signalChannelData
+}
+
+func (sh *defaultSignalHandler) DeliverSignal(intf, name string, signal *Signal) {
+ sh.mu.RLock()
+ defer sh.mu.RUnlock()
+ if sh.closed {
+ return
+ }
+ for _, scd := range sh.signals {
+ scd.deliver(signal)
+ }
+}
+
+func (sh *defaultSignalHandler) Terminate() {
+ sh.mu.Lock()
+ defer sh.mu.Unlock()
+ if sh.closed {
+ return
+ }
+
+ for _, scd := range sh.signals {
+ scd.close()
+ close(scd.ch)
+ }
+ sh.closed = true
+ sh.signals = nil
+}
+
+func (sh *defaultSignalHandler) AddSignal(ch chan<- *Signal) {
+ sh.mu.Lock()
+ defer sh.mu.Unlock()
+ if sh.closed {
+ return
+ }
+ sh.signals = append(sh.signals, &signalChannelData{
+ ch: ch,
+ done: make(chan struct{}),
+ })
+}
+
+func (sh *defaultSignalHandler) RemoveSignal(ch chan<- *Signal) {
+ sh.mu.Lock()
+ defer sh.mu.Unlock()
+ if sh.closed {
+ return
+ }
+ for i := len(sh.signals) - 1; i >= 0; i-- {
+ if ch == sh.signals[i].ch {
+ sh.signals[i].close()
+ copy(sh.signals[i:], sh.signals[i+1:])
+ sh.signals[len(sh.signals)-1] = nil
+ sh.signals = sh.signals[:len(sh.signals)-1]
+ }
+ }
+}
+
+type signalChannelData struct {
+ wg sync.WaitGroup
+ ch chan<- *Signal
+ done chan struct{}
+}
+
+func (scd *signalChannelData) deliver(signal *Signal) {
+ select {
+ case scd.ch <- signal:
+ case <-scd.done:
+ return
+ default:
+ scd.wg.Add(1)
+ go scd.deferredDeliver(signal)
+ }
+}
+
+func (scd *signalChannelData) deferredDeliver(signal *Signal) {
+ select {
+ case scd.ch <- signal:
+ case <-scd.done:
+ }
+ scd.wg.Done()
+}
+
+func (scd *signalChannelData) close() {
+ close(scd.done)
+ scd.wg.Wait() // wait until all spawned goroutines return
+}
diff --git a/archive/vendor/github.com/godbus/dbus/v5/doc.go b/archive/vendor/github.com/godbus/dbus/v5/doc.go
new file mode 100644
index 0000000..8f25a00
--- /dev/null
+++ b/archive/vendor/github.com/godbus/dbus/v5/doc.go
@@ -0,0 +1,71 @@
+/*
+Package dbus implements bindings to the D-Bus message bus system.
+
+To use the message bus API, you first need to connect to a bus (usually the
+session or system bus). The acquired connection then can be used to call methods
+on remote objects and emit or receive signals. Using the Export method, you can
+arrange D-Bus methods calls to be directly translated to method calls on a Go
+value.
+
+Conversion Rules
+
+For outgoing messages, Go types are automatically converted to the
+corresponding D-Bus types. See the official specification at
+https://dbus.freedesktop.org/doc/dbus-specification.html#type-system for more
+information on the D-Bus type system. The following types are directly encoded
+as their respective D-Bus equivalents:
+
+ Go type | D-Bus type
+ ------------+-----------
+ byte | BYTE
+ bool | BOOLEAN
+ int16 | INT16
+ uint16 | UINT16
+ int | INT32
+ uint | UINT32
+ int32 | INT32
+ uint32 | UINT32
+ int64 | INT64
+ uint64 | UINT64
+ float64 | DOUBLE
+ string | STRING
+ ObjectPath | OBJECT_PATH
+ Signature | SIGNATURE
+ Variant | VARIANT
+ interface{} | VARIANT
+ UnixFDIndex | UNIX_FD
+
+Slices and arrays encode as ARRAYs of their element type.
+
+Maps encode as DICTs, provided that their key type can be used as a key for
+a DICT.
+
+Structs other than Variant and Signature encode as a STRUCT containing their
+exported fields in order. Fields whose tags contain `dbus:"-"` and unexported
+fields will be skipped.
+
+Pointers encode as the value they're pointed to.
+
+Types convertible to one of the base types above will be mapped as the
+base type.
+
+Trying to encode any other type or a slice, map or struct containing an
+unsupported type will result in an InvalidTypeError.
+
+For incoming messages, the inverse of these rules are used, with the exception
+of STRUCTs. Incoming STRUCTS are represented as a slice of empty interfaces
+containing the struct fields in the correct order. The Store function can be
+used to convert such values to Go structs.
+
+Unix FD passing
+
+Handling Unix file descriptors deserves special mention. To use them, you should
+first check that they are supported on a connection by calling SupportsUnixFDs.
+If it returns true, all method of Connection will translate messages containing
+UnixFD's to messages that are accompanied by the given file descriptors with the
+UnixFD values being substituted by the correct indices. Similarly, the indices
+of incoming messages are automatically resolved. It shouldn't be necessary to use
+UnixFDIndex.
+
+*/
+package dbus
diff --git a/archive/vendor/github.com/godbus/dbus/v5/encoder.go b/archive/vendor/github.com/godbus/dbus/v5/encoder.go
new file mode 100644
index 0000000..015b26c
--- /dev/null
+++ b/archive/vendor/github.com/godbus/dbus/v5/encoder.go
@@ -0,0 +1,235 @@
+package dbus
+
+import (
+ "bytes"
+ "encoding/binary"
+ "io"
+ "reflect"
+ "strings"
+ "unicode/utf8"
+)
+
+// An encoder encodes values to the D-Bus wire format.
+type encoder struct {
+ out io.Writer
+ fds []int
+ order binary.ByteOrder
+ pos int
+}
+
+// NewEncoder returns a new encoder that writes to out in the given byte order.
+func newEncoder(out io.Writer, order binary.ByteOrder, fds []int) *encoder {
+ enc := newEncoderAtOffset(out, 0, order, fds)
+ return enc
+}
+
+// newEncoderAtOffset returns a new encoder that writes to out in the given
+// byte order. Specify the offset to initialize pos for proper alignment
+// computation.
+func newEncoderAtOffset(out io.Writer, offset int, order binary.ByteOrder, fds []int) *encoder {
+ enc := new(encoder)
+ enc.out = out
+ enc.order = order
+ enc.pos = offset
+ enc.fds = fds
+ return enc
+}
+
+// Aligns the next output to be on a multiple of n. Panics on write errors.
+func (enc *encoder) align(n int) {
+ pad := enc.padding(0, n)
+ if pad > 0 {
+ empty := make([]byte, pad)
+ if _, err := enc.out.Write(empty); err != nil {
+ panic(err)
+ }
+ enc.pos += pad
+ }
+}
+
+// pad returns the number of bytes of padding, based on current position and additional offset.
+// and alignment.
+func (enc *encoder) padding(offset, algn int) int {
+ abs := enc.pos + offset
+ if abs%algn != 0 {
+ newabs := (abs + algn - 1) & ^(algn - 1)
+ return newabs - abs
+ }
+ return 0
+}
+
+// Calls binary.Write(enc.out, enc.order, v) and panics on write errors.
+func (enc *encoder) binwrite(v interface{}) {
+ if err := binary.Write(enc.out, enc.order, v); err != nil {
+ panic(err)
+ }
+}
+
+// Encode encodes the given values to the underlying reader. All written values
+// are aligned properly as required by the D-Bus spec.
+func (enc *encoder) Encode(vs ...interface{}) (err error) {
+ defer func() {
+ err, _ = recover().(error)
+ }()
+ for _, v := range vs {
+ enc.encode(reflect.ValueOf(v), 0)
+ }
+ return nil
+}
+
+// encode encodes the given value to the writer and panics on error. depth holds
+// the depth of the container nesting.
+func (enc *encoder) encode(v reflect.Value, depth int) {
+ if depth > 64 {
+ panic(FormatError("input exceeds depth limitation"))
+ }
+ enc.align(alignment(v.Type()))
+ switch v.Kind() {
+ case reflect.Uint8:
+ var b [1]byte
+ b[0] = byte(v.Uint())
+ if _, err := enc.out.Write(b[:]); err != nil {
+ panic(err)
+ }
+ enc.pos++
+ case reflect.Bool:
+ if v.Bool() {
+ enc.encode(reflect.ValueOf(uint32(1)), depth)
+ } else {
+ enc.encode(reflect.ValueOf(uint32(0)), depth)
+ }
+ case reflect.Int16:
+ enc.binwrite(int16(v.Int()))
+ enc.pos += 2
+ case reflect.Uint16:
+ enc.binwrite(uint16(v.Uint()))
+ enc.pos += 2
+ case reflect.Int, reflect.Int32:
+ if v.Type() == unixFDType {
+ fd := v.Int()
+ idx := len(enc.fds)
+ enc.fds = append(enc.fds, int(fd))
+ enc.binwrite(uint32(idx))
+ } else {
+ enc.binwrite(int32(v.Int()))
+ }
+ enc.pos += 4
+ case reflect.Uint, reflect.Uint32:
+ enc.binwrite(uint32(v.Uint()))
+ enc.pos += 4
+ case reflect.Int64:
+ enc.binwrite(v.Int())
+ enc.pos += 8
+ case reflect.Uint64:
+ enc.binwrite(v.Uint())
+ enc.pos += 8
+ case reflect.Float64:
+ enc.binwrite(v.Float())
+ enc.pos += 8
+ case reflect.String:
+ str := v.String()
+ if !utf8.ValidString(str) {
+ panic(FormatError("input has a not-utf8 char in string"))
+ }
+ if strings.IndexByte(str, byte(0)) != -1 {
+ panic(FormatError("input has a null char('\\000') in string"))
+ }
+ if v.Type() == objectPathType {
+ if !ObjectPath(str).IsValid() {
+ panic(FormatError("invalid object path"))
+ }
+ }
+ enc.encode(reflect.ValueOf(uint32(len(str))), depth)
+ b := make([]byte, v.Len()+1)
+ copy(b, str)
+ b[len(b)-1] = 0
+ n, err := enc.out.Write(b)
+ if err != nil {
+ panic(err)
+ }
+ enc.pos += n
+ case reflect.Ptr:
+ enc.encode(v.Elem(), depth)
+ case reflect.Slice, reflect.Array:
+ // Lookahead offset: 4 bytes for uint32 length (with alignment),
+ // plus alignment for elements.
+ n := enc.padding(0, 4) + 4
+ offset := enc.pos + n + enc.padding(n, alignment(v.Type().Elem()))
+
+ var buf bytes.Buffer
+ bufenc := newEncoderAtOffset(&buf, offset, enc.order, enc.fds)
+
+ for i := 0; i < v.Len(); i++ {
+ bufenc.encode(v.Index(i), depth+1)
+ }
+
+ if buf.Len() > 1<<26 {
+ panic(FormatError("input exceeds array size limitation"))
+ }
+
+ enc.fds = bufenc.fds
+ enc.encode(reflect.ValueOf(uint32(buf.Len())), depth)
+ length := buf.Len()
+ enc.align(alignment(v.Type().Elem()))
+ if _, err := buf.WriteTo(enc.out); err != nil {
+ panic(err)
+ }
+ enc.pos += length
+ case reflect.Struct:
+ switch t := v.Type(); t {
+ case signatureType:
+ str := v.Field(0)
+ enc.encode(reflect.ValueOf(byte(str.Len())), depth)
+ b := make([]byte, str.Len()+1)
+ copy(b, str.String())
+ b[len(b)-1] = 0
+ n, err := enc.out.Write(b)
+ if err != nil {
+ panic(err)
+ }
+ enc.pos += n
+ case variantType:
+ variant := v.Interface().(Variant)
+ enc.encode(reflect.ValueOf(variant.sig), depth+1)
+ enc.encode(reflect.ValueOf(variant.value), depth+1)
+ default:
+ for i := 0; i < v.Type().NumField(); i++ {
+ field := t.Field(i)
+ if field.PkgPath == "" && field.Tag.Get("dbus") != "-" {
+ enc.encode(v.Field(i), depth+1)
+ }
+ }
+ }
+ case reflect.Map:
+ // Maps are arrays of structures, so they actually increase the depth by
+ // 2.
+ if !isKeyType(v.Type().Key()) {
+ panic(InvalidTypeError{v.Type()})
+ }
+ keys := v.MapKeys()
+ // Lookahead offset: 4 bytes for uint32 length (with alignment),
+ // plus 8-byte alignment
+ n := enc.padding(0, 4) + 4
+ offset := enc.pos + n + enc.padding(n, 8)
+
+ var buf bytes.Buffer
+ bufenc := newEncoderAtOffset(&buf, offset, enc.order, enc.fds)
+ for _, k := range keys {
+ bufenc.align(8)
+ bufenc.encode(k, depth+2)
+ bufenc.encode(v.MapIndex(k), depth+2)
+ }
+ enc.fds = bufenc.fds
+ enc.encode(reflect.ValueOf(uint32(buf.Len())), depth)
+ length := buf.Len()
+ enc.align(8)
+ if _, err := buf.WriteTo(enc.out); err != nil {
+ panic(err)
+ }
+ enc.pos += length
+ case reflect.Interface:
+ enc.encode(reflect.ValueOf(MakeVariant(v.Interface())), depth)
+ default:
+ panic(InvalidTypeError{v.Type()})
+ }
+}
diff --git a/archive/vendor/github.com/godbus/dbus/v5/escape.go b/archive/vendor/github.com/godbus/dbus/v5/escape.go
new file mode 100644
index 0000000..d1509d9
--- /dev/null
+++ b/archive/vendor/github.com/godbus/dbus/v5/escape.go
@@ -0,0 +1,84 @@
+package dbus
+
+import "net/url"
+
+// EscapeBusAddressValue implements a requirement to escape the values
+// in D-Bus server addresses, as defined by the D-Bus specification at
+// https://dbus.freedesktop.org/doc/dbus-specification.html#addresses.
+func EscapeBusAddressValue(val string) string {
+ toEsc := strNeedsEscape(val)
+ if toEsc == 0 {
+ // Avoid unneeded allocation/copying.
+ return val
+ }
+
+ // Avoid allocation for short paths.
+ var buf [64]byte
+ var out []byte
+ // Every to-be-escaped byte needs 2 extra bytes.
+ required := len(val) + 2*toEsc
+ if required <= len(buf) {
+ out = buf[:required]
+ } else {
+ out = make([]byte, required)
+ }
+
+ j := 0
+ for i := 0; i < len(val); i++ {
+ if ch := val[i]; needsEscape(ch) {
+ // Convert ch to %xx, where xx is hex value.
+ out[j] = '%'
+ out[j+1] = hexchar(ch >> 4)
+ out[j+2] = hexchar(ch & 0x0F)
+ j += 3
+ } else {
+ out[j] = ch
+ j++
+ }
+ }
+
+ return string(out)
+}
+
+// UnescapeBusAddressValue unescapes values in D-Bus server addresses,
+// as defined by the D-Bus specification at
+// https://dbus.freedesktop.org/doc/dbus-specification.html#addresses.
+func UnescapeBusAddressValue(val string) (string, error) {
+ // Looks like url.PathUnescape does exactly what is required.
+ return url.PathUnescape(val)
+}
+
+// hexchar returns an octal representation of a n, where n < 16.
+// For invalid values of n, the function panics.
+func hexchar(n byte) byte {
+ const hex = "0123456789abcdef"
+
+ // For n >= len(hex), runtime will panic.
+ return hex[n]
+}
+
+// needsEscape tells if a byte is NOT one of optionally-escaped bytes.
+func needsEscape(c byte) bool {
+ if 'a' <= c && c <= 'z' || 'A' <= c && c <= 'Z' || '0' <= c && c <= '9' {
+ return false
+ }
+ switch c {
+ case '-', '_', '/', '\\', '.', '*':
+ return false
+ }
+
+ return true
+}
+
+// strNeedsEscape tells how many bytes in the string need escaping.
+func strNeedsEscape(val string) int {
+ count := 0
+
+ for i := 0; i < len(val); i++ {
+ if needsEscape(val[i]) {
+ count++
+ }
+ }
+
+ return count
+}
diff --git a/archive/vendor/github.com/godbus/dbus/v5/export.go b/archive/vendor/github.com/godbus/dbus/v5/export.go
new file mode 100644
index 0000000..d3dd9f7
--- /dev/null
+++ b/archive/vendor/github.com/godbus/dbus/v5/export.go
@@ -0,0 +1,463 @@
+package dbus
+
+import (
+ "errors"
+ "fmt"
+ "os"
+ "reflect"
+ "strings"
+)
+
+var (
+ ErrMsgInvalidArg = Error{
+ "org.freedesktop.DBus.Error.InvalidArgs",
+ []interface{}{"Invalid type / number of args"},
+ }
+ ErrMsgNoObject = Error{
+ "org.freedesktop.DBus.Error.NoSuchObject",
+ []interface{}{"No such object"},
+ }
+ ErrMsgUnknownMethod = Error{
+ "org.freedesktop.DBus.Error.UnknownMethod",
+ []interface{}{"Unknown / invalid method"},
+ }
+ ErrMsgUnknownInterface = Error{
+ "org.freedesktop.DBus.Error.UnknownInterface",
+ []interface{}{"Object does not implement the interface"},
+ }
+)
+
+func MakeNoObjectError(path ObjectPath) Error {
+ return Error{
+ "org.freedesktop.DBus.Error.NoSuchObject",
+ []interface{}{fmt.Sprintf("No such object '%s'", string(path))},
+ }
+}
+
+func MakeUnknownMethodError(methodName string) Error {
+ return Error{
+ "org.freedesktop.DBus.Error.UnknownMethod",
+ []interface{}{fmt.Sprintf("Unknown / invalid method '%s'", methodName)},
+ }
+}
+
+func MakeUnknownInterfaceError(ifaceName string) Error {
+ return Error{
+ "org.freedesktop.DBus.Error.UnknownInterface",
+ []interface{}{fmt.Sprintf("Object does not implement the interface '%s'", ifaceName)},
+ }
+}
+
+func MakeFailedError(err error) *Error {
+ return &Error{
+ "org.freedesktop.DBus.Error.Failed",
+ []interface{}{err.Error()},
+ }
+}
+
+// Sender is a type which can be used in exported methods to receive the message
+// sender.
+type Sender string
+
+func computeMethodName(name string, mapping map[string]string) string {
+ newname, ok := mapping[name]
+ if ok {
+ name = newname
+ }
+ return name
+}
+
+func getMethods(in interface{}, mapping map[string]string) map[string]reflect.Value {
+ if in == nil {
+ return nil
+ }
+ methods := make(map[string]reflect.Value)
+ val := reflect.ValueOf(in)
+ typ := val.Type()
+ for i := 0; i < typ.NumMethod(); i++ {
+ methtype := typ.Method(i)
+ method := val.Method(i)
+ t := method.Type()
+ // only track valid methods must return *Error as last arg
+ // and must be exported
+ if t.NumOut() == 0 ||
+ t.Out(t.NumOut()-1) != reflect.TypeOf(&ErrMsgInvalidArg) ||
+ methtype.PkgPath != "" {
+ continue
+ }
+ // map names while building table
+ methods[computeMethodName(methtype.Name, mapping)] = method
+ }
+ return methods
+}
+
+func getAllMethods(in interface{}, mapping map[string]string) map[string]reflect.Value {
+ if in == nil {
+ return nil
+ }
+ methods := make(map[string]reflect.Value)
+ val := reflect.ValueOf(in)
+ typ := val.Type()
+ for i := 0; i < typ.NumMethod(); i++ {
+ methtype := typ.Method(i)
+ method := val.Method(i)
+ // map names while building table
+ methods[computeMethodName(methtype.Name, mapping)] = method
+ }
+ return methods
+}
+
+func standardMethodArgumentDecode(m Method, sender string, msg *Message, body []interface{}) ([]interface{}, error) {
+ pointers := make([]interface{}, m.NumArguments())
+ decode := make([]interface{}, 0, len(body))
+
+ for i := 0; i < m.NumArguments(); i++ {
+ tp := reflect.TypeOf(m.ArgumentValue(i))
+ val := reflect.New(tp)
+ pointers[i] = val.Interface()
+ if tp == reflect.TypeOf((*Sender)(nil)).Elem() {
+ val.Elem().SetString(sender)
+ } else if tp == reflect.TypeOf((*Message)(nil)).Elem() {
+ val.Elem().Set(reflect.ValueOf(*msg))
+ } else {
+ decode = append(decode, pointers[i])
+ }
+ }
+
+ if len(decode) != len(body) {
+ return nil, ErrMsgInvalidArg
+ }
+
+ if err := Store(body, decode...); err != nil {
+ return nil, ErrMsgInvalidArg
+ }
+
+ return pointers, nil
+}
+
+func (conn *Conn) decodeArguments(m Method, sender string, msg *Message) ([]interface{}, error) {
+ if decoder, ok := m.(ArgumentDecoder); ok {
+ return decoder.DecodeArguments(conn, sender, msg, msg.Body)
+ }
+ return standardMethodArgumentDecode(m, sender, msg, msg.Body)
+}
+
+// handleCall handles the given method call (i.e. looks if it's one of the
+// pre-implemented ones and searches for a corresponding handler if not).
+func (conn *Conn) handleCall(msg *Message) {
+ name := msg.Headers[FieldMember].value.(string)
+ path := msg.Headers[FieldPath].value.(ObjectPath)
+ ifaceName, _ := msg.Headers[FieldInterface].value.(string)
+ sender, hasSender := msg.Headers[FieldSender].value.(string)
+ serial := msg.serial
+
+ if len(name) == 0 {
+ conn.sendError(ErrMsgUnknownMethod, sender, serial)
+ }
+
+ if ifaceName == "org.freedesktop.DBus.Peer" {
+ switch name {
+ case "Ping":
+ conn.sendReply(sender, serial)
+ case "GetMachineId":
+ conn.sendReply(sender, serial, conn.uuid)
+ default:
+ conn.sendError(MakeUnknownMethodError(name), sender, serial)
+ }
+ return
+ }
+
+ object, ok := conn.handler.LookupObject(path)
+ if !ok {
+ conn.sendError(MakeNoObjectError(path), sender, serial)
+ return
+ }
+
+ iface, exists := object.LookupInterface(ifaceName)
+ if !exists {
+ conn.sendError(MakeUnknownInterfaceError(ifaceName), sender, serial)
+ return
+ }
+
+ m, exists := iface.LookupMethod(name)
+ if !exists {
+ conn.sendError(MakeUnknownMethodError(name), sender, serial)
+ return
+ }
+ args, err := conn.decodeArguments(m, sender, msg)
+ if err != nil {
+ conn.sendError(err, sender, serial)
+ return
+ }
+
+ ret, err := m.Call(args...)
+ if err != nil {
+ conn.sendError(err, sender, serial)
+ return
+ }
+
+ if msg.Flags&FlagNoReplyExpected == 0 {
+ reply := new(Message)
+ reply.Type = TypeMethodReply
+ reply.Headers = make(map[HeaderField]Variant)
+ if hasSender {
+ reply.Headers[FieldDestination] = msg.Headers[FieldSender]
+ }
+ reply.Headers[FieldReplySerial] = MakeVariant(msg.serial)
+ reply.Body = make([]interface{}, len(ret))
+ for i := 0; i < len(ret); i++ {
+ reply.Body[i] = ret[i]
+ }
+ reply.Headers[FieldSignature] = MakeVariant(SignatureOf(reply.Body...))
+
+ if err := reply.IsValid(); err != nil {
+ fmt.Fprintf(os.Stderr, "dbus: dropping invalid reply to %s.%s on obj %s: %s\n", ifaceName, name, path, err)
+ } else {
+ conn.sendMessageAndIfClosed(reply, nil)
+ }
+ }
+}
+
+// Emit emits the given signal on the message bus. The name parameter must be
+// formatted as "interface.member", e.g., "org.freedesktop.DBus.NameLost".
+func (conn *Conn) Emit(path ObjectPath, name string, values ...interface{}) error {
+ i := strings.LastIndex(name, ".")
+ if i == -1 {
+ return errors.New("dbus: invalid method name")
+ }
+ iface := name[:i]
+ member := name[i+1:]
+ msg := new(Message)
+ msg.Type = TypeSignal
+ msg.Headers = make(map[HeaderField]Variant)
+ msg.Headers[FieldInterface] = MakeVariant(iface)
+ msg.Headers[FieldMember] = MakeVariant(member)
+ msg.Headers[FieldPath] = MakeVariant(path)
+ msg.Body = values
+ if len(values) > 0 {
+ msg.Headers[FieldSignature] = MakeVariant(SignatureOf(values...))
+ }
+ if err := msg.IsValid(); err != nil {
+ return err
+ }
+
+ var closed bool
+ conn.sendMessageAndIfClosed(msg, func() {
+ closed = true
+ })
+ if closed {
+ return ErrClosed
+ }
+ return nil
+}
+
+// Export registers the given value to be exported as an object on the
+// message bus.
+//
+// If a method call on the given path and interface is received, an exported
+// method with the same name is called with v as the receiver if the
+// parameters match and the last return value is of type *Error. If this
+// *Error is not nil, it is sent back to the caller as an error.
+// Otherwise, a method reply is sent with the other return values as its body.
+//
+// Any parameters with the special type Sender are set to the sender of the
+// dbus message when the method is called. Parameters of this type do not
+// contribute to the dbus signature of the method (i.e. the method is exposed
+// as if the parameters of type Sender were not there).
+//
+// Similarly, any parameters with the type Message are set to the raw message
+// received on the bus. Again, parameters of this type do not contribute to the
+// dbus signature of the method.
+//
+// Every method call is executed in a new goroutine, so the method may be called
+// in multiple goroutines at once.
+//
+// Method calls on the interface org.freedesktop.DBus.Peer will be automatically
+// handled for every object.
+//
+// Passing nil as the first parameter will cause conn to cease handling calls on
+// the given combination of path and interface.
+//
+// Export returns an error if path is not a valid path name.
+func (conn *Conn) Export(v interface{}, path ObjectPath, iface string) error {
+ return conn.ExportWithMap(v, nil, path, iface)
+}
+
+// ExportAll registers all exported methods defined by the given object on
+// the message bus.
+//
+// Unlike Export there is no requirement to have the last parameter as type
+// *Error. If you want to be able to return error then you can append an error
+// type parameter to your method signature. If the error returned is not nil,
+// it is sent back to the caller as an error. Otherwise, a method reply is
+// sent with the other return values as its body.
+func (conn *Conn) ExportAll(v interface{}, path ObjectPath, iface string) error {
+ return conn.export(getAllMethods(v, nil), path, iface, false)
+}
+
+// ExportWithMap works exactly like Export but provides the ability to remap
+// method names (e.g. export a lower-case method).
+//
+// The keys in the map are the real method names (exported on the struct), and
+// the values are the method names to be exported on DBus.
+func (conn *Conn) ExportWithMap(v interface{}, mapping map[string]string, path ObjectPath, iface string) error {
+ return conn.export(getMethods(v, mapping), path, iface, false)
+}
+
+// ExportSubtree works exactly like Export but registers the given value for
+// an entire subtree rather under the root path provided.
+//
+// In order to make this useful, one parameter in each of the value's exported
+// methods should be a Message, in which case it will contain the raw message
+// (allowing one to get access to the path that caused the method to be called).
+//
+// Note that more specific export paths take precedence over less specific. For
+// example, a method call using the ObjectPath /foo/bar/baz will call a method
+// exported on /foo/bar before a method exported on /foo.
+func (conn *Conn) ExportSubtree(v interface{}, path ObjectPath, iface string) error {
+ return conn.ExportSubtreeWithMap(v, nil, path, iface)
+}
+
+// ExportSubtreeWithMap works exactly like ExportSubtree but provides the
+// ability to remap method names (e.g. export a lower-case method).
+//
+// The keys in the map are the real method names (exported on the struct), and
+// the values are the method names to be exported on DBus.
+func (conn *Conn) ExportSubtreeWithMap(v interface{}, mapping map[string]string, path ObjectPath, iface string) error {
+ return conn.export(getMethods(v, mapping), path, iface, true)
+}
+
+// ExportMethodTable like Export registers the given methods as an object
+// on the message bus. Unlike Export the it uses a method table to define
+// the object instead of a native go object.
+//
+// The method table is a map from method name to function closure
+// representing the method. This allows an object exported on the bus to not
+// necessarily be a native go object. It can be useful for generating exposed
+// methods on the fly.
+//
+// Any non-function objects in the method table are ignored.
+func (conn *Conn) ExportMethodTable(methods map[string]interface{}, path ObjectPath, iface string) error {
+ return conn.exportMethodTable(methods, path, iface, false)
+}
+
+// Like ExportSubtree, but with the same caveats as ExportMethodTable.
+func (conn *Conn) ExportSubtreeMethodTable(methods map[string]interface{}, path ObjectPath, iface string) error {
+ return conn.exportMethodTable(methods, path, iface, true)
+}
+
+func (conn *Conn) exportMethodTable(methods map[string]interface{}, path ObjectPath, iface string, includeSubtree bool) error {
+ var out map[string]reflect.Value
+ if methods != nil {
+ out = make(map[string]reflect.Value)
+ for name, method := range methods {
+ rval := reflect.ValueOf(method)
+ if rval.Kind() != reflect.Func {
+ continue
+ }
+ t := rval.Type()
+ // only track valid methods must return *Error as last arg
+ if t.NumOut() == 0 ||
+ t.Out(t.NumOut()-1) != reflect.TypeOf(&ErrMsgInvalidArg) {
+ continue
+ }
+ out[name] = rval
+ }
+ }
+ return conn.export(out, path, iface, includeSubtree)
+}
+
+func (conn *Conn) unexport(h *defaultHandler, path ObjectPath, iface string) error {
+ if h.PathExists(path) {
+ obj := h.objects[path]
+ obj.DeleteInterface(iface)
+ if len(obj.interfaces) == 0 {
+ h.DeleteObject(path)
+ }
+ }
+ return nil
+}
+
+// export is the worker function for all exports/registrations.
+func (conn *Conn) export(methods map[string]reflect.Value, path ObjectPath, iface string, includeSubtree bool) error {
+ h, ok := conn.handler.(*defaultHandler)
+ if !ok {
+ return fmt.Errorf(
+ `dbus: export only allowed on the default handler. Received: %T"`,
+ conn.handler)
+ }
+
+ if !path.IsValid() {
+ return fmt.Errorf(`dbus: Invalid path name: "%s"`, path)
+ }
+
+ // Remove a previous export if the interface is nil
+ if methods == nil {
+ return conn.unexport(h, path, iface)
+ }
+
+ // If this is the first handler for this path, make a new map to hold all
+ // handlers for this path.
+ if !h.PathExists(path) {
+ h.AddObject(path, newExportedObject())
+ }
+
+ exportedMethods := make(map[string]Method)
+ for name, method := range methods {
+ exportedMethods[name] = exportedMethod{method}
+ }
+
+ // Finally, save this handler
+ obj := h.objects[path]
+ obj.AddInterface(iface, newExportedIntf(exportedMethods, includeSubtree))
+
+ return nil
+}
+
+// ReleaseName calls org.freedesktop.DBus.ReleaseName and awaits a response.
+func (conn *Conn) ReleaseName(name string) (ReleaseNameReply, error) {
+ var r uint32
+ err := conn.busObj.Call("org.freedesktop.DBus.ReleaseName", 0, name).Store(&r)
+ if err != nil {
+ return 0, err
+ }
+ return ReleaseNameReply(r), nil
+}
+
+// RequestName calls org.freedesktop.DBus.RequestName and awaits a response.
+func (conn *Conn) RequestName(name string, flags RequestNameFlags) (RequestNameReply, error) {
+ var r uint32
+ err := conn.busObj.Call("org.freedesktop.DBus.RequestName", 0, name, flags).Store(&r)
+ if err != nil {
+ return 0, err
+ }
+ return RequestNameReply(r), nil
+}
+
+// ReleaseNameReply is the reply to a ReleaseName call.
+type ReleaseNameReply uint32
+
+const (
+ ReleaseNameReplyReleased ReleaseNameReply = 1 + iota
+ ReleaseNameReplyNonExistent
+ ReleaseNameReplyNotOwner
+)
+
+// RequestNameFlags represents the possible flags for a RequestName call.
+type RequestNameFlags uint32
+
+const (
+ NameFlagAllowReplacement RequestNameFlags = 1 << iota
+ NameFlagReplaceExisting
+ NameFlagDoNotQueue
+)
+
+// RequestNameReply is the reply to a RequestName call.
+type RequestNameReply uint32
+
+const (
+ RequestNameReplyPrimaryOwner RequestNameReply = 1 + iota
+ RequestNameReplyInQueue
+ RequestNameReplyExists
+ RequestNameReplyAlreadyOwner
+)
diff --git a/archive/vendor/github.com/godbus/dbus/v5/homedir.go b/archive/vendor/github.com/godbus/dbus/v5/homedir.go
new file mode 100644
index 0000000..c44d9b5
--- /dev/null
+++ b/archive/vendor/github.com/godbus/dbus/v5/homedir.go
@@ -0,0 +1,25 @@
+package dbus
+
+import (
+ "os"
+ "os/user"
+)
+
+// Get returns the home directory of the current user, which is usually the
+// value of HOME environment variable. In case it is not set or empty, os/user
+// package is used.
+//
+// If linking statically with cgo enabled against glibc, make sure the
+// osusergo build tag is used.
+//
+// If needing to do nss lookups, do not disable cgo or set osusergo.
+func getHomeDir() string {
+ homeDir := os.Getenv("HOME")
+ if homeDir != "" {
+ return homeDir
+ }
+ if u, err := user.Current(); err == nil {
+ return u.HomeDir
+ }
+ return "/"
+}
diff --git a/archive/vendor/github.com/godbus/dbus/v5/match.go b/archive/vendor/github.com/godbus/dbus/v5/match.go
new file mode 100644
index 0000000..5a607e5
--- /dev/null
+++ b/archive/vendor/github.com/godbus/dbus/v5/match.go
@@ -0,0 +1,89 @@
+package dbus
+
+import (
+ "strconv"
+ "strings"
+)
+
+// MatchOption specifies option for dbus routing match rule. Options can be constructed with WithMatch* helpers.
+// For full list of available options consult
+// https://dbus.freedesktop.org/doc/dbus-specification.html#message-bus-routing-match-rules
+type MatchOption struct {
+ key string
+ value string
+}
+
+func formatMatchOptions(options []MatchOption) string {
+ items := make([]string, 0, len(options))
+ for _, option := range options {
+ items = append(items, option.key+"='"+option.value+"'")
+ }
+ return strings.Join(items, ",")
+}
+
+// WithMatchOption creates match option with given key and value
+func WithMatchOption(key, value string) MatchOption {
+ return MatchOption{key, value}
+}
+
+// doesn't make sense to export this option because clients can only
+// subscribe to messages with signal type.
+func withMatchType(typ string) MatchOption {
+ return WithMatchOption("type", typ)
+}
+
+// WithMatchSender sets sender match option.
+func WithMatchSender(sender string) MatchOption {
+ return WithMatchOption("sender", sender)
+}
+
+// WithMatchSender sets interface match option.
+func WithMatchInterface(iface string) MatchOption {
+ return WithMatchOption("interface", iface)
+}
+
+// WithMatchMember sets member match option.
+func WithMatchMember(member string) MatchOption {
+ return WithMatchOption("member", member)
+}
+
+// WithMatchObjectPath creates match option that filters events based on given path
+func WithMatchObjectPath(path ObjectPath) MatchOption {
+ return WithMatchOption("path", string(path))
+}
+
+// WithMatchPathNamespace sets path_namespace match option.
+func WithMatchPathNamespace(namespace ObjectPath) MatchOption {
+ return WithMatchOption("path_namespace", string(namespace))
+}
+
+// WithMatchDestination sets destination match option.
+func WithMatchDestination(destination string) MatchOption {
+ return WithMatchOption("destination", destination)
+}
+
+// WithMatchArg sets argN match option, range of N is 0 to 63.
+func WithMatchArg(argIdx int, value string) MatchOption {
+ if argIdx < 0 || argIdx > 63 {
+ panic("range of argument index is 0 to 63")
+ }
+ return WithMatchOption("arg"+strconv.Itoa(argIdx), value)
+}
+
+// WithMatchArgPath sets argN path match option, range of N is 0 to 63.
+func WithMatchArgPath(argIdx int, path string) MatchOption {
+ if argIdx < 0 || argIdx > 63 {
+ panic("range of argument index is 0 to 63")
+ }
+ return WithMatchOption("arg"+strconv.Itoa(argIdx)+"path", path)
+}
+
+// WithMatchArg0Namespace sets arg0namespace match option.
+func WithMatchArg0Namespace(arg0Namespace string) MatchOption {
+ return WithMatchOption("arg0namespace", arg0Namespace)
+}
+
+// WithMatchEavesdrop sets eavesdrop match option.
+func WithMatchEavesdrop(eavesdrop bool) MatchOption {
+ return WithMatchOption("eavesdrop", strconv.FormatBool(eavesdrop))
+}
diff --git a/archive/vendor/github.com/godbus/dbus/v5/message.go b/archive/vendor/github.com/godbus/dbus/v5/message.go
new file mode 100644
index 0000000..bdf43fd
--- /dev/null
+++ b/archive/vendor/github.com/godbus/dbus/v5/message.go
@@ -0,0 +1,390 @@
+package dbus
+
+import (
+ "bytes"
+ "encoding/binary"
+ "errors"
+ "io"
+ "reflect"
+ "strconv"
+)
+
+const protoVersion byte = 1
+
+// Flags represents the possible flags of a D-Bus message.
+type Flags byte
+
+const (
+ // FlagNoReplyExpected signals that the message is not expected to generate
+ // a reply. If this flag is set on outgoing messages, any possible reply
+ // will be discarded.
+ FlagNoReplyExpected Flags = 1 << iota
+ // FlagNoAutoStart signals that the message bus should not automatically
+ // start an application when handling this message.
+ FlagNoAutoStart
+ // FlagAllowInteractiveAuthorization may be set on a method call
+ // message to inform the receiving side that the caller is prepared
+ // to wait for interactive authorization, which might take a
+ // considerable time to complete. For instance, if this flag is set,
+ // it would be appropriate to query the user for passwords or
+ // confirmation via Polkit or a similar framework.
+ FlagAllowInteractiveAuthorization
+)
+
+// Type represents the possible types of a D-Bus message.
+type Type byte
+
+const (
+ TypeMethodCall Type = 1 + iota
+ TypeMethodReply
+ TypeError
+ TypeSignal
+ typeMax
+)
+
+func (t Type) String() string {
+ switch t {
+ case TypeMethodCall:
+ return "method call"
+ case TypeMethodReply:
+ return "reply"
+ case TypeError:
+ return "error"
+ case TypeSignal:
+ return "signal"
+ }
+ return "invalid"
+}
+
+// HeaderField represents the possible byte codes for the headers
+// of a D-Bus message.
+type HeaderField byte
+
+const (
+ FieldPath HeaderField = 1 + iota
+ FieldInterface
+ FieldMember
+ FieldErrorName
+ FieldReplySerial
+ FieldDestination
+ FieldSender
+ FieldSignature
+ FieldUnixFDs
+ fieldMax
+)
+
+// An InvalidMessageError describes the reason why a D-Bus message is regarded as
+// invalid.
+type InvalidMessageError string
+
+func (e InvalidMessageError) Error() string {
+ return "dbus: invalid message: " + string(e)
+}
+
+// fieldType are the types of the various header fields.
+var fieldTypes = [fieldMax]reflect.Type{
+ FieldPath: objectPathType,
+ FieldInterface: stringType,
+ FieldMember: stringType,
+ FieldErrorName: stringType,
+ FieldReplySerial: uint32Type,
+ FieldDestination: stringType,
+ FieldSender: stringType,
+ FieldSignature: signatureType,
+ FieldUnixFDs: uint32Type,
+}
+
+// requiredFields lists the header fields that are required by the different
+// message types.
+var requiredFields = [typeMax][]HeaderField{
+ TypeMethodCall: {FieldPath, FieldMember},
+ TypeMethodReply: {FieldReplySerial},
+ TypeError: {FieldErrorName, FieldReplySerial},
+ TypeSignal: {FieldPath, FieldInterface, FieldMember},
+}
+
+// Message represents a single D-Bus message.
+type Message struct {
+ Type
+ Flags
+ Headers map[HeaderField]Variant
+ Body []interface{}
+
+ serial uint32
+}
+
+type header struct {
+ Field byte
+ Variant
+}
+
+func DecodeMessageWithFDs(rd io.Reader, fds []int) (msg *Message, err error) {
+ var order binary.ByteOrder
+ var hlength, length uint32
+ var typ, flags, proto byte
+ var headers []header
+
+ b := make([]byte, 1)
+ _, err = rd.Read(b)
+ if err != nil {
+ return
+ }
+ switch b[0] {
+ case 'l':
+ order = binary.LittleEndian
+ case 'B':
+ order = binary.BigEndian
+ default:
+ return nil, InvalidMessageError("invalid byte order")
+ }
+
+ dec := newDecoder(rd, order, fds)
+ dec.pos = 1
+
+ msg = new(Message)
+ vs, err := dec.Decode(Signature{"yyyuu"})
+ if err != nil {
+ return nil, err
+ }
+ if err = Store(vs, &typ, &flags, &proto, &length, &msg.serial); err != nil {
+ return nil, err
+ }
+ msg.Type = Type(typ)
+ msg.Flags = Flags(flags)
+
+ // get the header length separately because we need it later
+ b = make([]byte, 4)
+ _, err = io.ReadFull(rd, b)
+ if err != nil {
+ return nil, err
+ }
+ binary.Read(bytes.NewBuffer(b), order, &hlength)
+ if hlength+length+16 > 1<<27 {
+ return nil, InvalidMessageError("message is too long")
+ }
+ dec = newDecoder(io.MultiReader(bytes.NewBuffer(b), rd), order, fds)
+ dec.pos = 12
+ vs, err = dec.Decode(Signature{"a(yv)"})
+ if err != nil {
+ return nil, err
+ }
+ if err = Store(vs, &headers); err != nil {
+ return nil, err
+ }
+
+ msg.Headers = make(map[HeaderField]Variant)
+ for _, v := range headers {
+ msg.Headers[HeaderField(v.Field)] = v.Variant
+ }
+
+ dec.align(8)
+ body := make([]byte, int(length))
+ if length != 0 {
+ _, err := io.ReadFull(rd, body)
+ if err != nil {
+ return nil, err
+ }
+ }
+
+ if err = msg.IsValid(); err != nil {
+ return nil, err
+ }
+ sig, _ := msg.Headers[FieldSignature].value.(Signature)
+ if sig.str != "" {
+ buf := bytes.NewBuffer(body)
+ dec = newDecoder(buf, order, fds)
+ vs, err := dec.Decode(sig)
+ if err != nil {
+ return nil, err
+ }
+ msg.Body = vs
+ }
+
+ return
+}
+
+// DecodeMessage tries to decode a single message in the D-Bus wire format
+// from the given reader. The byte order is figured out from the first byte.
+// The possibly returned error can be an error of the underlying reader, an
+// InvalidMessageError or a FormatError.
+func DecodeMessage(rd io.Reader) (msg *Message, err error) {
+ return DecodeMessageWithFDs(rd, make([]int, 0))
+}
+
+type nullwriter struct{}
+
+func (nullwriter) Write(p []byte) (cnt int, err error) {
+ return len(p), nil
+}
+
+func (msg *Message) CountFds() (int, error) {
+ if len(msg.Body) == 0 {
+ return 0, nil
+ }
+ enc := newEncoder(nullwriter{}, nativeEndian, make([]int, 0))
+ err := enc.Encode(msg.Body...)
+ return len(enc.fds), err
+}
+
+func (msg *Message) EncodeToWithFDs(out io.Writer, order binary.ByteOrder) (fds []int, err error) {
+ if err := msg.validateHeader(); err != nil {
+ return nil, err
+ }
+ var vs [7]interface{}
+ switch order {
+ case binary.LittleEndian:
+ vs[0] = byte('l')
+ case binary.BigEndian:
+ vs[0] = byte('B')
+ default:
+ return nil, errors.New("dbus: invalid byte order")
+ }
+ body := new(bytes.Buffer)
+ fds = make([]int, 0)
+ enc := newEncoder(body, order, fds)
+ if len(msg.Body) != 0 {
+ err = enc.Encode(msg.Body...)
+ if err != nil {
+ return
+ }
+ }
+ vs[1] = msg.Type
+ vs[2] = msg.Flags
+ vs[3] = protoVersion
+ vs[4] = uint32(len(body.Bytes()))
+ vs[5] = msg.serial
+ headers := make([]header, 0, len(msg.Headers))
+ for k, v := range msg.Headers {
+ headers = append(headers, header{byte(k), v})
+ }
+ vs[6] = headers
+ var buf bytes.Buffer
+ enc = newEncoder(&buf, order, enc.fds)
+ err = enc.Encode(vs[:]...)
+ if err != nil {
+ return
+ }
+ enc.align(8)
+ body.WriteTo(&buf)
+ if buf.Len() > 1<<27 {
+ return make([]int, 0), InvalidMessageError("message is too long")
+ }
+ if _, err := buf.WriteTo(out); err != nil {
+ return make([]int, 0), err
+ }
+ return enc.fds, nil
+}
+
+// EncodeTo encodes and sends a message to the given writer. The byte order must
+// be either binary.LittleEndian or binary.BigEndian. If the message is not
+// valid or an error occurs when writing, an error is returned.
+func (msg *Message) EncodeTo(out io.Writer, order binary.ByteOrder) (err error) {
+ _, err = msg.EncodeToWithFDs(out, order)
+ return err
+}
+
+// IsValid checks whether msg is a valid message and returns an
+// InvalidMessageError or FormatError if it is not.
+func (msg *Message) IsValid() error {
+ var b bytes.Buffer
+ return msg.EncodeTo(&b, nativeEndian)
+}
+
+func (msg *Message) validateHeader() error {
+ if msg.Flags & ^(FlagNoAutoStart|FlagNoReplyExpected|FlagAllowInteractiveAuthorization) != 0 {
+ return InvalidMessageError("invalid flags")
+ }
+ if msg.Type == 0 || msg.Type >= typeMax {
+ return InvalidMessageError("invalid message type")
+ }
+ for k, v := range msg.Headers {
+ if k == 0 || k >= fieldMax {
+ return InvalidMessageError("invalid header")
+ }
+ if reflect.TypeOf(v.value) != fieldTypes[k] {
+ return InvalidMessageError("invalid type of header field")
+ }
+ }
+ for _, v := range requiredFields[msg.Type] {
+ if _, ok := msg.Headers[v]; !ok {
+ return InvalidMessageError("missing required header")
+ }
+ }
+ if path, ok := msg.Headers[FieldPath]; ok {
+ if !path.value.(ObjectPath).IsValid() {
+ return InvalidMessageError("invalid path name")
+ }
+ }
+ if iface, ok := msg.Headers[FieldInterface]; ok {
+ if !isValidInterface(iface.value.(string)) {
+ return InvalidMessageError("invalid interface name")
+ }
+ }
+ if member, ok := msg.Headers[FieldMember]; ok {
+ if !isValidMember(member.value.(string)) {
+ return InvalidMessageError("invalid member name")
+ }
+ }
+ if errname, ok := msg.Headers[FieldErrorName]; ok {
+ if !isValidInterface(errname.value.(string)) {
+ return InvalidMessageError("invalid error name")
+ }
+ }
+ if len(msg.Body) != 0 {
+ if _, ok := msg.Headers[FieldSignature]; !ok {
+ return InvalidMessageError("missing signature")
+ }
+ }
+
+ return nil
+}
+
+// Serial returns the message's serial number. The returned value is only valid
+// for messages received by eavesdropping.
+func (msg *Message) Serial() uint32 {
+ return msg.serial
+}
+
+// String returns a string representation of a message similar to the format of
+// dbus-monitor.
+func (msg *Message) String() string {
+ if err := msg.IsValid(); err != nil {
+ return ""
+ }
+ s := msg.Type.String()
+ if v, ok := msg.Headers[FieldSender]; ok {
+ s += " from " + v.value.(string)
+ }
+ if v, ok := msg.Headers[FieldDestination]; ok {
+ s += " to " + v.value.(string)
+ }
+ s += " serial " + strconv.FormatUint(uint64(msg.serial), 10)
+ if v, ok := msg.Headers[FieldReplySerial]; ok {
+ s += " reply_serial " + strconv.FormatUint(uint64(v.value.(uint32)), 10)
+ }
+ if v, ok := msg.Headers[FieldUnixFDs]; ok {
+ s += " unixfds " + strconv.FormatUint(uint64(v.value.(uint32)), 10)
+ }
+ if v, ok := msg.Headers[FieldPath]; ok {
+ s += " path " + string(v.value.(ObjectPath))
+ }
+ if v, ok := msg.Headers[FieldInterface]; ok {
+ s += " interface " + v.value.(string)
+ }
+ if v, ok := msg.Headers[FieldErrorName]; ok {
+ s += " error " + v.value.(string)
+ }
+ if v, ok := msg.Headers[FieldMember]; ok {
+ s += " member " + v.value.(string)
+ }
+ if len(msg.Body) != 0 {
+ s += "\n"
+ }
+ for i, v := range msg.Body {
+ s += " " + MakeVariant(v).String()
+ if i != len(msg.Body)-1 {
+ s += "\n"
+ }
+ }
+ return s
+}
diff --git a/archive/vendor/github.com/godbus/dbus/v5/object.go b/archive/vendor/github.com/godbus/dbus/v5/object.go
new file mode 100644
index 0000000..664abb7
--- /dev/null
+++ b/archive/vendor/github.com/godbus/dbus/v5/object.go
@@ -0,0 +1,174 @@
+package dbus
+
+import (
+ "context"
+ "errors"
+ "strings"
+)
+
+// BusObject is the interface of a remote object on which methods can be
+// invoked.
+type BusObject interface {
+ Call(method string, flags Flags, args ...interface{}) *Call
+ CallWithContext(ctx context.Context, method string, flags Flags, args ...interface{}) *Call
+ Go(method string, flags Flags, ch chan *Call, args ...interface{}) *Call
+ GoWithContext(ctx context.Context, method string, flags Flags, ch chan *Call, args ...interface{}) *Call
+ AddMatchSignal(iface, member string, options ...MatchOption) *Call
+ RemoveMatchSignal(iface, member string, options ...MatchOption) *Call
+ GetProperty(p string) (Variant, error)
+ StoreProperty(p string, value interface{}) error
+ SetProperty(p string, v interface{}) error
+ Destination() string
+ Path() ObjectPath
+}
+
+// Object represents a remote object on which methods can be invoked.
+type Object struct {
+ conn *Conn
+ dest string
+ path ObjectPath
+}
+
+// Call calls a method with (*Object).Go and waits for its reply.
+func (o *Object) Call(method string, flags Flags, args ...interface{}) *Call {
+ return <-o.createCall(context.Background(), method, flags, make(chan *Call, 1), args...).Done
+}
+
+// CallWithContext acts like Call but takes a context
+func (o *Object) CallWithContext(ctx context.Context, method string, flags Flags, args ...interface{}) *Call {
+ return <-o.createCall(ctx, method, flags, make(chan *Call, 1), args...).Done
+}
+
+// AddMatchSignal subscribes BusObject to signals from specified interface,
+// method (member). Additional filter rules can be added via WithMatch* option constructors.
+// Note: To filter events by object path you have to specify this path via an option.
+//
+// Deprecated: use (*Conn) AddMatchSignal instead.
+func (o *Object) AddMatchSignal(iface, member string, options ...MatchOption) *Call {
+ base := []MatchOption{
+ withMatchType("signal"),
+ WithMatchInterface(iface),
+ WithMatchMember(member),
+ }
+
+ options = append(base, options...)
+ return o.conn.BusObject().Call(
+ "org.freedesktop.DBus.AddMatch",
+ 0,
+ formatMatchOptions(options),
+ )
+}
+
+// RemoveMatchSignal unsubscribes BusObject from signals from specified interface,
+// method (member). Additional filter rules can be added via WithMatch* option constructors
+//
+// Deprecated: use (*Conn) RemoveMatchSignal instead.
+func (o *Object) RemoveMatchSignal(iface, member string, options ...MatchOption) *Call {
+ base := []MatchOption{
+ withMatchType("signal"),
+ WithMatchInterface(iface),
+ WithMatchMember(member),
+ }
+
+ options = append(base, options...)
+ return o.conn.BusObject().Call(
+ "org.freedesktop.DBus.RemoveMatch",
+ 0,
+ formatMatchOptions(options),
+ )
+}
+
+// Go calls a method with the given arguments asynchronously. It returns a
+// Call structure representing this method call. The passed channel will
+// return the same value once the call is done. If ch is nil, a new channel
+// will be allocated. Otherwise, ch has to be buffered or Go will panic.
+//
+// If the flags include FlagNoReplyExpected, ch is ignored and a Call structure
+// is returned with any error in Err and a closed channel in Done containing
+// the returned Call as it's one entry.
+//
+// If the method parameter contains a dot ('.'), the part before the last dot
+// specifies the interface on which the method is called.
+func (o *Object) Go(method string, flags Flags, ch chan *Call, args ...interface{}) *Call {
+ return o.createCall(context.Background(), method, flags, ch, args...)
+}
+
+// GoWithContext acts like Go but takes a context
+func (o *Object) GoWithContext(ctx context.Context, method string, flags Flags, ch chan *Call, args ...interface{}) *Call {
+ return o.createCall(ctx, method, flags, ch, args...)
+}
+
+func (o *Object) createCall(ctx context.Context, method string, flags Flags, ch chan *Call, args ...interface{}) *Call {
+ if ctx == nil {
+ panic("nil context")
+ }
+ iface := ""
+ i := strings.LastIndex(method, ".")
+ if i != -1 {
+ iface = method[:i]
+ }
+ method = method[i+1:]
+ msg := new(Message)
+ msg.Type = TypeMethodCall
+ msg.Flags = flags & (FlagNoAutoStart | FlagNoReplyExpected)
+ msg.Headers = make(map[HeaderField]Variant)
+ msg.Headers[FieldPath] = MakeVariant(o.path)
+ msg.Headers[FieldDestination] = MakeVariant(o.dest)
+ msg.Headers[FieldMember] = MakeVariant(method)
+ if iface != "" {
+ msg.Headers[FieldInterface] = MakeVariant(iface)
+ }
+ msg.Body = args
+ if len(args) > 0 {
+ msg.Headers[FieldSignature] = MakeVariant(SignatureOf(args...))
+ }
+ return o.conn.SendWithContext(ctx, msg, ch)
+}
+
+// GetProperty calls org.freedesktop.DBus.Properties.Get on the given
+// object. The property name must be given in interface.member notation.
+func (o *Object) GetProperty(p string) (Variant, error) {
+ var result Variant
+ err := o.StoreProperty(p, &result)
+ return result, err
+}
+
+// StoreProperty calls org.freedesktop.DBus.Properties.Get on the given
+// object. The property name must be given in interface.member notation.
+// It stores the returned property into the provided value.
+func (o *Object) StoreProperty(p string, value interface{}) error {
+ idx := strings.LastIndex(p, ".")
+ if idx == -1 || idx+1 == len(p) {
+ return errors.New("dbus: invalid property " + p)
+ }
+
+ iface := p[:idx]
+ prop := p[idx+1:]
+
+ return o.Call("org.freedesktop.DBus.Properties.Get", 0, iface, prop).
+ Store(value)
+}
+
+// SetProperty calls org.freedesktop.DBus.Properties.Set on the given
+// object. The property name must be given in interface.member notation.
+func (o *Object) SetProperty(p string, v interface{}) error {
+ idx := strings.LastIndex(p, ".")
+ if idx == -1 || idx+1 == len(p) {
+ return errors.New("dbus: invalid property " + p)
+ }
+
+ iface := p[:idx]
+ prop := p[idx+1:]
+
+ return o.Call("org.freedesktop.DBus.Properties.Set", 0, iface, prop, v).Err
+}
+
+// Destination returns the destination that calls on (o *Object) are sent to.
+func (o *Object) Destination() string {
+ return o.dest
+}
+
+// Path returns the path that calls on (o *Object") are sent to.
+func (o *Object) Path() ObjectPath {
+ return o.path
+}
diff --git a/archive/vendor/github.com/godbus/dbus/v5/sequence.go b/archive/vendor/github.com/godbus/dbus/v5/sequence.go
new file mode 100644
index 0000000..89435d3
--- /dev/null
+++ b/archive/vendor/github.com/godbus/dbus/v5/sequence.go
@@ -0,0 +1,24 @@
+package dbus
+
+// Sequence represents the value of a monotonically increasing counter.
+type Sequence uint64
+
+const (
+ // NoSequence indicates the absence of a sequence value.
+ NoSequence Sequence = 0
+)
+
+// sequenceGenerator represents a monotonically increasing counter.
+type sequenceGenerator struct {
+ nextSequence Sequence
+}
+
+func (generator *sequenceGenerator) next() Sequence {
+ result := generator.nextSequence
+ generator.nextSequence++
+ return result
+}
+
+func newSequenceGenerator() *sequenceGenerator {
+ return &sequenceGenerator{nextSequence: 1}
+}
diff --git a/archive/vendor/github.com/godbus/dbus/v5/sequential_handler.go b/archive/vendor/github.com/godbus/dbus/v5/sequential_handler.go
new file mode 100644
index 0000000..ef2fcdb
--- /dev/null
+++ b/archive/vendor/github.com/godbus/dbus/v5/sequential_handler.go
@@ -0,0 +1,125 @@
+package dbus
+
+import (
+ "sync"
+)
+
+// NewSequentialSignalHandler returns an instance of a new
+// signal handler that guarantees sequential processing of signals. It is a
+// guarantee of this signal handler that signals will be written to
+// channels in the order they are received on the DBus connection.
+func NewSequentialSignalHandler() SignalHandler {
+ return &sequentialSignalHandler{}
+}
+
+type sequentialSignalHandler struct {
+ mu sync.RWMutex
+ closed bool
+ signals []*sequentialSignalChannelData
+}
+
+func (sh *sequentialSignalHandler) DeliverSignal(intf, name string, signal *Signal) {
+ sh.mu.RLock()
+ defer sh.mu.RUnlock()
+ if sh.closed {
+ return
+ }
+ for _, scd := range sh.signals {
+ scd.deliver(signal)
+ }
+}
+
+func (sh *sequentialSignalHandler) Terminate() {
+ sh.mu.Lock()
+ defer sh.mu.Unlock()
+ if sh.closed {
+ return
+ }
+
+ for _, scd := range sh.signals {
+ scd.close()
+ close(scd.ch)
+ }
+ sh.closed = true
+ sh.signals = nil
+}
+
+func (sh *sequentialSignalHandler) AddSignal(ch chan<- *Signal) {
+ sh.mu.Lock()
+ defer sh.mu.Unlock()
+ if sh.closed {
+ return
+ }
+ sh.signals = append(sh.signals, newSequentialSignalChannelData(ch))
+}
+
+func (sh *sequentialSignalHandler) RemoveSignal(ch chan<- *Signal) {
+ sh.mu.Lock()
+ defer sh.mu.Unlock()
+ if sh.closed {
+ return
+ }
+ for i := len(sh.signals) - 1; i >= 0; i-- {
+ if ch == sh.signals[i].ch {
+ sh.signals[i].close()
+ copy(sh.signals[i:], sh.signals[i+1:])
+ sh.signals[len(sh.signals)-1] = nil
+ sh.signals = sh.signals[:len(sh.signals)-1]
+ }
+ }
+}
+
+type sequentialSignalChannelData struct {
+ ch chan<- *Signal
+ in chan *Signal
+ done chan struct{}
+}
+
+func newSequentialSignalChannelData(ch chan<- *Signal) *sequentialSignalChannelData {
+ scd := &sequentialSignalChannelData{
+ ch: ch,
+ in: make(chan *Signal),
+ done: make(chan struct{}),
+ }
+ go scd.bufferSignals()
+ return scd
+}
+
+func (scd *sequentialSignalChannelData) bufferSignals() {
+ defer close(scd.done)
+
+ // Ensure that signals are delivered to scd.ch in the same
+ // order they are received from scd.in.
+ var queue []*Signal
+ for {
+ if len(queue) == 0 {
+ signal, ok := <- scd.in
+ if !ok {
+ return
+ }
+ queue = append(queue, signal)
+ }
+ select {
+ case scd.ch <- queue[0]:
+ copy(queue, queue[1:])
+ queue[len(queue)-1] = nil
+ queue = queue[:len(queue)-1]
+ case signal, ok := <-scd.in:
+ if !ok {
+ return
+ }
+ queue = append(queue, signal)
+ }
+ }
+}
+
+func (scd *sequentialSignalChannelData) deliver(signal *Signal) {
+ scd.in <- signal
+}
+
+func (scd *sequentialSignalChannelData) close() {
+ close(scd.in)
+ // Ensure that bufferSignals() has exited and won't attempt
+ // any future sends on scd.ch
+ <-scd.done
+}
diff --git a/archive/vendor/github.com/godbus/dbus/v5/server_interfaces.go b/archive/vendor/github.com/godbus/dbus/v5/server_interfaces.go
new file mode 100644
index 0000000..e4e0389
--- /dev/null
+++ b/archive/vendor/github.com/godbus/dbus/v5/server_interfaces.go
@@ -0,0 +1,107 @@
+package dbus
+
+// Terminator allows a handler to implement a shutdown mechanism that
+// is called when the connection terminates.
+type Terminator interface {
+ Terminate()
+}
+
+// Handler is the representation of a D-Bus Application.
+//
+// The Handler must have a way to lookup objects given
+// an ObjectPath. The returned object must implement the
+// ServerObject interface.
+type Handler interface {
+ LookupObject(path ObjectPath) (ServerObject, bool)
+}
+
+// ServerObject is the representation of an D-Bus Object.
+//
+// Objects are registered at a path for a given Handler.
+// The Objects implement D-Bus interfaces. The semantics
+// of Interface lookup is up to the implementation of
+// the ServerObject. The ServerObject implementation may
+// choose to implement empty string as a valid interface
+// represeting all methods or not per the D-Bus specification.
+type ServerObject interface {
+ LookupInterface(name string) (Interface, bool)
+}
+
+// An Interface is the representation of a D-Bus Interface.
+//
+// Interfaces are a grouping of methods implemented by the Objects.
+// Interfaces are responsible for routing method calls.
+type Interface interface {
+ LookupMethod(name string) (Method, bool)
+}
+
+// A Method represents the exposed methods on D-Bus.
+type Method interface {
+ // Call requires that all arguments are decoded before being passed to it.
+ Call(args ...interface{}) ([]interface{}, error)
+ NumArguments() int
+ NumReturns() int
+ // ArgumentValue returns a representative value for the argument at position
+ // it should be of the proper type. reflect.Zero would be a good mechanism
+ // to use for this Value.
+ ArgumentValue(position int) interface{}
+ // ReturnValue returns a representative value for the return at position
+ // it should be of the proper type. reflect.Zero would be a good mechanism
+ // to use for this Value.
+ ReturnValue(position int) interface{}
+}
+
+// An Argument Decoder can decode arguments using the non-standard mechanism
+//
+// If a method implements this interface then the non-standard
+// decoder will be used.
+//
+// Method arguments must be decoded from the message.
+// The mechanism for doing this will vary based on the
+// implementation of the method. A normal approach is provided
+// as part of this library, but may be replaced with
+// any other decoding scheme.
+type ArgumentDecoder interface {
+ // To decode the arguments of a method the sender and message are
+ // provided in case the semantics of the implementer provides access
+ // to these as part of the method invocation.
+ DecodeArguments(conn *Conn, sender string, msg *Message, args []interface{}) ([]interface{}, error)
+}
+
+// A SignalHandler is responsible for delivering a signal.
+//
+// Signal delivery may be changed from the default channel
+// based approach by Handlers implementing the SignalHandler
+// interface.
+type SignalHandler interface {
+ DeliverSignal(iface, name string, signal *Signal)
+}
+
+// SignalRegistrar manages signal delivery channels.
+//
+// This is an optional set of methods for `SignalHandler`.
+type SignalRegistrar interface {
+ AddSignal(ch chan<- *Signal)
+ RemoveSignal(ch chan<- *Signal)
+}
+
+// A DBusError is used to convert a generic object to a D-Bus error.
+//
+// Any custom error mechanism may implement this interface to provide
+// a custom encoding of the error on D-Bus. By default if a normal
+// error is returned, it will be encoded as the generic
+// "org.freedesktop.DBus.Error.Failed" error. By implementing this
+// interface as well a custom encoding may be provided.
+type DBusError interface {
+ DBusError() (string, []interface{})
+}
+
+// SerialGenerator is responsible for serials generation.
+//
+// Different approaches for the serial generation can be used,
+// maintaining a map guarded with a mutex (the standard way) or
+// simply increment an atomic counter.
+type SerialGenerator interface {
+ GetSerial() uint32
+ RetireSerial(serial uint32)
+}
diff --git a/archive/vendor/github.com/godbus/dbus/v5/sig.go b/archive/vendor/github.com/godbus/dbus/v5/sig.go
new file mode 100644
index 0000000..6b9cadb
--- /dev/null
+++ b/archive/vendor/github.com/godbus/dbus/v5/sig.go
@@ -0,0 +1,293 @@
+package dbus
+
+import (
+ "fmt"
+ "reflect"
+ "strings"
+)
+
+var sigToType = map[byte]reflect.Type{
+ 'y': byteType,
+ 'b': boolType,
+ 'n': int16Type,
+ 'q': uint16Type,
+ 'i': int32Type,
+ 'u': uint32Type,
+ 'x': int64Type,
+ 't': uint64Type,
+ 'd': float64Type,
+ 's': stringType,
+ 'g': signatureType,
+ 'o': objectPathType,
+ 'v': variantType,
+ 'h': unixFDIndexType,
+}
+
+// Signature represents a correct type signature as specified by the D-Bus
+// specification. The zero value represents the empty signature, "".
+type Signature struct {
+ str string
+}
+
+// SignatureOf returns the concatenation of all the signatures of the given
+// values. It panics if one of them is not representable in D-Bus.
+func SignatureOf(vs ...interface{}) Signature {
+ var s string
+ for _, v := range vs {
+ s += getSignature(reflect.TypeOf(v), &depthCounter{})
+ }
+ return Signature{s}
+}
+
+// SignatureOfType returns the signature of the given type. It panics if the
+// type is not representable in D-Bus.
+func SignatureOfType(t reflect.Type) Signature {
+ return Signature{getSignature(t, &depthCounter{})}
+}
+
+// getSignature returns the signature of the given type and panics on unknown types.
+func getSignature(t reflect.Type, depth *depthCounter) (sig string) {
+ if !depth.Valid() {
+ panic("container nesting too deep")
+ }
+ defer func() {
+ if len(sig) > 255 {
+ panic("signature exceeds the length limitation")
+ }
+ }()
+ // handle simple types first
+ switch t.Kind() {
+ case reflect.Uint8:
+ return "y"
+ case reflect.Bool:
+ return "b"
+ case reflect.Int16:
+ return "n"
+ case reflect.Uint16:
+ return "q"
+ case reflect.Int, reflect.Int32:
+ if t == unixFDType {
+ return "h"
+ }
+ return "i"
+ case reflect.Uint, reflect.Uint32:
+ if t == unixFDIndexType {
+ return "h"
+ }
+ return "u"
+ case reflect.Int64:
+ return "x"
+ case reflect.Uint64:
+ return "t"
+ case reflect.Float64:
+ return "d"
+ case reflect.Ptr:
+ return getSignature(t.Elem(), depth)
+ case reflect.String:
+ if t == objectPathType {
+ return "o"
+ }
+ return "s"
+ case reflect.Struct:
+ if t == variantType {
+ return "v"
+ } else if t == signatureType {
+ return "g"
+ }
+ var s string
+ for i := 0; i < t.NumField(); i++ {
+ field := t.Field(i)
+ if field.PkgPath == "" && field.Tag.Get("dbus") != "-" {
+ s += getSignature(t.Field(i).Type, depth.EnterStruct())
+ }
+ }
+ if len(s) == 0 {
+ panic(InvalidTypeError{t})
+ }
+ return "(" + s + ")"
+ case reflect.Array, reflect.Slice:
+ return "a" + getSignature(t.Elem(), depth.EnterArray())
+ case reflect.Map:
+ if !isKeyType(t.Key()) {
+ panic(InvalidTypeError{t})
+ }
+ return "a{" + getSignature(t.Key(), depth.EnterArray().EnterDictEntry()) + getSignature(t.Elem(), depth.EnterArray().EnterDictEntry()) + "}"
+ case reflect.Interface:
+ return "v"
+ }
+ panic(InvalidTypeError{t})
+}
+
+// ParseSignature returns the signature represented by this string, or a
+// SignatureError if the string is not a valid signature.
+func ParseSignature(s string) (sig Signature, err error) {
+ if len(s) == 0 {
+ return
+ }
+ if len(s) > 255 {
+ return Signature{""}, SignatureError{s, "too long"}
+ }
+ sig.str = s
+ for err == nil && len(s) != 0 {
+ err, s = validSingle(s, &depthCounter{})
+ }
+ if err != nil {
+ sig = Signature{""}
+ }
+
+ return
+}
+
+// ParseSignatureMust behaves like ParseSignature, except that it panics if s
+// is not valid.
+func ParseSignatureMust(s string) Signature {
+ sig, err := ParseSignature(s)
+ if err != nil {
+ panic(err)
+ }
+ return sig
+}
+
+// Empty returns whether the signature is the empty signature.
+func (s Signature) Empty() bool {
+ return s.str == ""
+}
+
+// Single returns whether the signature represents a single, complete type.
+func (s Signature) Single() bool {
+ err, r := validSingle(s.str, &depthCounter{})
+ return err != nil && r == ""
+}
+
+// String returns the signature's string representation.
+func (s Signature) String() string {
+ return s.str
+}
+
+// A SignatureError indicates that a signature passed to a function or received
+// on a connection is not a valid signature.
+type SignatureError struct {
+ Sig string
+ Reason string
+}
+
+func (e SignatureError) Error() string {
+ return fmt.Sprintf("dbus: invalid signature: %q (%s)", e.Sig, e.Reason)
+}
+
+type depthCounter struct {
+ arrayDepth, structDepth, dictEntryDepth int
+}
+
+func (cnt *depthCounter) Valid() bool {
+ return cnt.arrayDepth <= 32 && cnt.structDepth <= 32 && cnt.dictEntryDepth <= 32
+}
+
+func (cnt depthCounter) EnterArray() *depthCounter {
+ cnt.arrayDepth++
+ return &cnt
+}
+
+func (cnt depthCounter) EnterStruct() *depthCounter {
+ cnt.structDepth++
+ return &cnt
+}
+
+func (cnt depthCounter) EnterDictEntry() *depthCounter {
+ cnt.dictEntryDepth++
+ return &cnt
+}
+
+// Try to read a single type from this string. If it was successful, err is nil
+// and rem is the remaining unparsed part. Otherwise, err is a non-nil
+// SignatureError and rem is "". depth is the current recursion depth which may
+// not be greater than 64 and should be given as 0 on the first call.
+func validSingle(s string, depth *depthCounter) (err error, rem string) {
+ if s == "" {
+ return SignatureError{Sig: s, Reason: "empty signature"}, ""
+ }
+ if !depth.Valid() {
+ return SignatureError{Sig: s, Reason: "container nesting too deep"}, ""
+ }
+ switch s[0] {
+ case 'y', 'b', 'n', 'q', 'i', 'u', 'x', 't', 'd', 's', 'g', 'o', 'v', 'h':
+ return nil, s[1:]
+ case 'a':
+ if len(s) > 1 && s[1] == '{' {
+ i := findMatching(s[1:], '{', '}')
+ if i == -1 {
+ return SignatureError{Sig: s, Reason: "unmatched '{'"}, ""
+ }
+ i++
+ rem = s[i+1:]
+ s = s[2:i]
+ if err, _ = validSingle(s[:1], depth.EnterArray().EnterDictEntry()); err != nil {
+ return err, ""
+ }
+ err, nr := validSingle(s[1:], depth.EnterArray().EnterDictEntry())
+ if err != nil {
+ return err, ""
+ }
+ if nr != "" {
+ return SignatureError{Sig: s, Reason: "too many types in dict"}, ""
+ }
+ return nil, rem
+ }
+ return validSingle(s[1:], depth.EnterArray())
+ case '(':
+ i := findMatching(s, '(', ')')
+ if i == -1 {
+ return SignatureError{Sig: s, Reason: "unmatched ')'"}, ""
+ }
+ rem = s[i+1:]
+ s = s[1:i]
+ for err == nil && s != "" {
+ err, s = validSingle(s, depth.EnterStruct())
+ }
+ if err != nil {
+ rem = ""
+ }
+ return
+ }
+ return SignatureError{Sig: s, Reason: "invalid type character"}, ""
+}
+
+func findMatching(s string, left, right rune) int {
+ n := 0
+ for i, v := range s {
+ if v == left {
+ n++
+ } else if v == right {
+ n--
+ }
+ if n == 0 {
+ return i
+ }
+ }
+ return -1
+}
+
+// typeFor returns the type of the given signature. It ignores any left over
+// characters and panics if s doesn't start with a valid type signature.
+func typeFor(s string) (t reflect.Type) {
+ err, _ := validSingle(s, &depthCounter{})
+ if err != nil {
+ panic(err)
+ }
+
+ if t, ok := sigToType[s[0]]; ok {
+ return t
+ }
+ switch s[0] {
+ case 'a':
+ if s[1] == '{' {
+ i := strings.LastIndex(s, "}")
+ t = reflect.MapOf(sigToType[s[2]], typeFor(s[3:i]))
+ } else {
+ t = reflect.SliceOf(typeFor(s[1:]))
+ }
+ case '(':
+ t = interfacesType
+ }
+ return
+}
diff --git a/archive/vendor/github.com/godbus/dbus/v5/transport_darwin.go b/archive/vendor/github.com/godbus/dbus/v5/transport_darwin.go
new file mode 100644
index 0000000..1bba0d6
--- /dev/null
+++ b/archive/vendor/github.com/godbus/dbus/v5/transport_darwin.go
@@ -0,0 +1,6 @@
+package dbus
+
+func (t *unixTransport) SendNullByte() error {
+ _, err := t.Write([]byte{0})
+ return err
+}
diff --git a/archive/vendor/github.com/godbus/dbus/v5/transport_generic.go b/archive/vendor/github.com/godbus/dbus/v5/transport_generic.go
new file mode 100644
index 0000000..a08e281
--- /dev/null
+++ b/archive/vendor/github.com/godbus/dbus/v5/transport_generic.go
@@ -0,0 +1,52 @@
+package dbus
+
+import (
+ "encoding/binary"
+ "errors"
+ "io"
+ "unsafe"
+)
+
+var nativeEndian binary.ByteOrder
+
+func detectEndianness() binary.ByteOrder {
+ var x uint32 = 0x01020304
+ if *(*byte)(unsafe.Pointer(&x)) == 0x01 {
+ return binary.BigEndian
+ }
+ return binary.LittleEndian
+}
+
+func init() {
+ nativeEndian = detectEndianness()
+}
+
+type genericTransport struct {
+ io.ReadWriteCloser
+}
+
+func (t genericTransport) SendNullByte() error {
+ _, err := t.Write([]byte{0})
+ return err
+}
+
+func (t genericTransport) SupportsUnixFDs() bool {
+ return false
+}
+
+func (t genericTransport) EnableUnixFDs() {}
+
+func (t genericTransport) ReadMessage() (*Message, error) {
+ return DecodeMessage(t)
+}
+
+func (t genericTransport) SendMessage(msg *Message) error {
+ fds, err := msg.CountFds()
+ if err != nil {
+ return err
+ }
+ if fds != 0 {
+ return errors.New("dbus: unix fd passing not enabled")
+ }
+ return msg.EncodeTo(t, nativeEndian)
+}
diff --git a/archive/vendor/github.com/godbus/dbus/v5/transport_nonce_tcp.go b/archive/vendor/github.com/godbus/dbus/v5/transport_nonce_tcp.go
new file mode 100644
index 0000000..697739e
--- /dev/null
+++ b/archive/vendor/github.com/godbus/dbus/v5/transport_nonce_tcp.go
@@ -0,0 +1,39 @@
+//+build !windows
+
+package dbus
+
+import (
+ "errors"
+ "io/ioutil"
+ "net"
+)
+
+func init() {
+ transports["nonce-tcp"] = newNonceTcpTransport
+}
+
+func newNonceTcpTransport(keys string) (transport, error) {
+ host := getKey(keys, "host")
+ port := getKey(keys, "port")
+ noncefile := getKey(keys, "noncefile")
+ if host == "" || port == "" || noncefile == "" {
+ return nil, errors.New("dbus: unsupported address (must set host, port and noncefile)")
+ }
+ protocol, err := tcpFamily(keys)
+ if err != nil {
+ return nil, err
+ }
+ socket, err := net.Dial(protocol, net.JoinHostPort(host, port))
+ if err != nil {
+ return nil, err
+ }
+ b, err := ioutil.ReadFile(noncefile)
+ if err != nil {
+ return nil, err
+ }
+ _, err = socket.Write(b)
+ if err != nil {
+ return nil, err
+ }
+ return NewConn(socket)
+}
diff --git a/archive/vendor/github.com/godbus/dbus/v5/transport_tcp.go b/archive/vendor/github.com/godbus/dbus/v5/transport_tcp.go
new file mode 100644
index 0000000..f91c9b7
--- /dev/null
+++ b/archive/vendor/github.com/godbus/dbus/v5/transport_tcp.go
@@ -0,0 +1,41 @@
+package dbus
+
+import (
+ "errors"
+ "net"
+)
+
+func init() {
+ transports["tcp"] = newTcpTransport
+}
+
+func tcpFamily(keys string) (string, error) {
+ switch getKey(keys, "family") {
+ case "":
+ return "tcp", nil
+ case "ipv4":
+ return "tcp4", nil
+ case "ipv6":
+ return "tcp6", nil
+ default:
+ return "", errors.New("dbus: invalid tcp family (must be ipv4 or ipv6)")
+ }
+}
+
+func newTcpTransport(keys string) (transport, error) {
+ host := getKey(keys, "host")
+ port := getKey(keys, "port")
+ if host == "" || port == "" {
+ return nil, errors.New("dbus: unsupported address (must set host and port)")
+ }
+
+ protocol, err := tcpFamily(keys)
+ if err != nil {
+ return nil, err
+ }
+ socket, err := net.Dial(protocol, net.JoinHostPort(host, port))
+ if err != nil {
+ return nil, err
+ }
+ return NewConn(socket)
+}
diff --git a/archive/vendor/github.com/godbus/dbus/v5/transport_unix.go b/archive/vendor/github.com/godbus/dbus/v5/transport_unix.go
new file mode 100644
index 0000000..0a8c712
--- /dev/null
+++ b/archive/vendor/github.com/godbus/dbus/v5/transport_unix.go
@@ -0,0 +1,212 @@
+//+build !windows,!solaris
+
+package dbus
+
+import (
+ "bytes"
+ "encoding/binary"
+ "errors"
+ "io"
+ "net"
+ "syscall"
+)
+
+type oobReader struct {
+ conn *net.UnixConn
+ oob []byte
+ buf [4096]byte
+}
+
+func (o *oobReader) Read(b []byte) (n int, err error) {
+ n, oobn, flags, _, err := o.conn.ReadMsgUnix(b, o.buf[:])
+ if err != nil {
+ return n, err
+ }
+ if flags&syscall.MSG_CTRUNC != 0 {
+ return n, errors.New("dbus: control data truncated (too many fds received)")
+ }
+ o.oob = append(o.oob, o.buf[:oobn]...)
+ return n, nil
+}
+
+type unixTransport struct {
+ *net.UnixConn
+ rdr *oobReader
+ hasUnixFDs bool
+}
+
+func newUnixTransport(keys string) (transport, error) {
+ var err error
+
+ t := new(unixTransport)
+ abstract := getKey(keys, "abstract")
+ path := getKey(keys, "path")
+ switch {
+ case abstract == "" && path == "":
+ return nil, errors.New("dbus: invalid address (neither path nor abstract set)")
+ case abstract != "" && path == "":
+ t.UnixConn, err = net.DialUnix("unix", nil, &net.UnixAddr{Name: "@" + abstract, Net: "unix"})
+ if err != nil {
+ return nil, err
+ }
+ return t, nil
+ case abstract == "" && path != "":
+ t.UnixConn, err = net.DialUnix("unix", nil, &net.UnixAddr{Name: path, Net: "unix"})
+ if err != nil {
+ return nil, err
+ }
+ return t, nil
+ default:
+ return nil, errors.New("dbus: invalid address (both path and abstract set)")
+ }
+}
+
+func init() {
+ transports["unix"] = newUnixTransport
+}
+
+func (t *unixTransport) EnableUnixFDs() {
+ t.hasUnixFDs = true
+}
+
+func (t *unixTransport) ReadMessage() (*Message, error) {
+ var (
+ blen, hlen uint32
+ csheader [16]byte
+ headers []header
+ order binary.ByteOrder
+ unixfds uint32
+ )
+ // To be sure that all bytes of out-of-band data are read, we use a special
+ // reader that uses ReadUnix on the underlying connection instead of Read
+ // and gathers the out-of-band data in a buffer.
+ if t.rdr == nil {
+ t.rdr = &oobReader{conn: t.UnixConn}
+ } else {
+ t.rdr.oob = nil
+ }
+
+ // read the first 16 bytes (the part of the header that has a constant size),
+ // from which we can figure out the length of the rest of the message
+ if _, err := io.ReadFull(t.rdr, csheader[:]); err != nil {
+ return nil, err
+ }
+ switch csheader[0] {
+ case 'l':
+ order = binary.LittleEndian
+ case 'B':
+ order = binary.BigEndian
+ default:
+ return nil, InvalidMessageError("invalid byte order")
+ }
+ // csheader[4:8] -> length of message body, csheader[12:16] -> length of
+ // header fields (without alignment)
+ binary.Read(bytes.NewBuffer(csheader[4:8]), order, &blen)
+ binary.Read(bytes.NewBuffer(csheader[12:]), order, &hlen)
+ if hlen%8 != 0 {
+ hlen += 8 - (hlen % 8)
+ }
+
+ // decode headers and look for unix fds
+ headerdata := make([]byte, hlen+4)
+ copy(headerdata, csheader[12:])
+ if _, err := io.ReadFull(t.rdr, headerdata[4:]); err != nil {
+ return nil, err
+ }
+ dec := newDecoder(bytes.NewBuffer(headerdata), order, make([]int, 0))
+ dec.pos = 12
+ vs, err := dec.Decode(Signature{"a(yv)"})
+ if err != nil {
+ return nil, err
+ }
+ Store(vs, &headers)
+ for _, v := range headers {
+ if v.Field == byte(FieldUnixFDs) {
+ unixfds, _ = v.Variant.value.(uint32)
+ }
+ }
+ all := make([]byte, 16+hlen+blen)
+ copy(all, csheader[:])
+ copy(all[16:], headerdata[4:])
+ if _, err := io.ReadFull(t.rdr, all[16+hlen:]); err != nil {
+ return nil, err
+ }
+ if unixfds != 0 {
+ if !t.hasUnixFDs {
+ return nil, errors.New("dbus: got unix fds on unsupported transport")
+ }
+ // read the fds from the OOB data
+ scms, err := syscall.ParseSocketControlMessage(t.rdr.oob)
+ if err != nil {
+ return nil, err
+ }
+ if len(scms) != 1 {
+ return nil, errors.New("dbus: received more than one socket control message")
+ }
+ fds, err := syscall.ParseUnixRights(&scms[0])
+ if err != nil {
+ return nil, err
+ }
+ msg, err := DecodeMessageWithFDs(bytes.NewBuffer(all), fds)
+ if err != nil {
+ return nil, err
+ }
+ // substitute the values in the message body (which are indices for the
+ // array receiver via OOB) with the actual values
+ for i, v := range msg.Body {
+ switch index := v.(type) {
+ case UnixFDIndex:
+ if uint32(index) >= unixfds {
+ return nil, InvalidMessageError("invalid index for unix fd")
+ }
+ msg.Body[i] = UnixFD(fds[index])
+ case []UnixFDIndex:
+ fdArray := make([]UnixFD, len(index))
+ for k, j := range index {
+ if uint32(j) >= unixfds {
+ return nil, InvalidMessageError("invalid index for unix fd")
+ }
+ fdArray[k] = UnixFD(fds[j])
+ }
+ msg.Body[i] = fdArray
+ }
+ }
+ return msg, nil
+ }
+ return DecodeMessage(bytes.NewBuffer(all))
+}
+
+func (t *unixTransport) SendMessage(msg *Message) error {
+ fdcnt, err := msg.CountFds()
+ if err != nil {
+ return err
+ }
+ if fdcnt != 0 {
+ if !t.hasUnixFDs {
+ return errors.New("dbus: unix fd passing not enabled")
+ }
+ msg.Headers[FieldUnixFDs] = MakeVariant(uint32(fdcnt))
+ buf := new(bytes.Buffer)
+ fds, err := msg.EncodeToWithFDs(buf, nativeEndian)
+ if err != nil {
+ return err
+ }
+ oob := syscall.UnixRights(fds...)
+ n, oobn, err := t.UnixConn.WriteMsgUnix(buf.Bytes(), oob, nil)
+ if err != nil {
+ return err
+ }
+ if n != buf.Len() || oobn != len(oob) {
+ return io.ErrShortWrite
+ }
+ } else {
+ if err := msg.EncodeTo(t, nativeEndian); err != nil {
+ return err
+ }
+ }
+ return nil
+}
+
+func (t *unixTransport) SupportsUnixFDs() bool {
+ return true
+}
diff --git a/archive/vendor/github.com/godbus/dbus/v5/transport_unixcred_dragonfly.go b/archive/vendor/github.com/godbus/dbus/v5/transport_unixcred_dragonfly.go
new file mode 100644
index 0000000..a8cd393
--- /dev/null
+++ b/archive/vendor/github.com/godbus/dbus/v5/transport_unixcred_dragonfly.go
@@ -0,0 +1,95 @@
+// The UnixCredentials system call is currently only implemented on Linux
+// http://golang.org/src/pkg/syscall/sockcmsg_linux.go
+// https://golang.org/s/go1.4-syscall
+// http://code.google.com/p/go/source/browse/unix/sockcmsg_linux.go?repo=sys
+
+// Local implementation of the UnixCredentials system call for DragonFly BSD
+
+package dbus
+
+/*
+#include
+*/
+import "C"
+
+import (
+ "io"
+ "os"
+ "syscall"
+ "unsafe"
+)
+
+// http://golang.org/src/pkg/syscall/ztypes_linux_amd64.go
+// http://golang.org/src/pkg/syscall/ztypes_dragonfly_amd64.go
+type Ucred struct {
+ Pid int32
+ Uid uint32
+ Gid uint32
+}
+
+// http://golang.org/src/pkg/syscall/types_linux.go
+// http://golang.org/src/pkg/syscall/types_dragonfly.go
+// https://github.com/DragonFlyBSD/DragonFlyBSD/blob/master/sys/sys/ucred.h
+const (
+ SizeofUcred = C.sizeof_struct_ucred
+)
+
+// http://golang.org/src/pkg/syscall/sockcmsg_unix.go
+func cmsgAlignOf(salen int) int {
+ // From http://golang.org/src/pkg/syscall/sockcmsg_unix.go
+ //salign := sizeofPtr
+ // NOTE: It seems like 64-bit Darwin and DragonFly BSD kernels
+ // still require 32-bit aligned access to network subsystem.
+ //if darwin64Bit || dragonfly64Bit {
+ // salign = 4
+ //}
+ salign := 4
+ return (salen + salign - 1) & ^(salign - 1)
+}
+
+// http://golang.org/src/pkg/syscall/sockcmsg_unix.go
+func cmsgData(h *syscall.Cmsghdr) unsafe.Pointer {
+ return unsafe.Pointer(uintptr(unsafe.Pointer(h)) + uintptr(cmsgAlignOf(syscall.SizeofCmsghdr)))
+}
+
+// http://golang.org/src/pkg/syscall/sockcmsg_linux.go
+// UnixCredentials encodes credentials into a socket control message
+// for sending to another process. This can be used for
+// authentication.
+func UnixCredentials(ucred *Ucred) []byte {
+ b := make([]byte, syscall.CmsgSpace(SizeofUcred))
+ h := (*syscall.Cmsghdr)(unsafe.Pointer(&b[0]))
+ h.Level = syscall.SOL_SOCKET
+ h.Type = syscall.SCM_CREDS
+ h.SetLen(syscall.CmsgLen(SizeofUcred))
+ *((*Ucred)(cmsgData(h))) = *ucred
+ return b
+}
+
+// http://golang.org/src/pkg/syscall/sockcmsg_linux.go
+// ParseUnixCredentials decodes a socket control message that contains
+// credentials in a Ucred structure. To receive such a message, the
+// SO_PASSCRED option must be enabled on the socket.
+func ParseUnixCredentials(m *syscall.SocketControlMessage) (*Ucred, error) {
+ if m.Header.Level != syscall.SOL_SOCKET {
+ return nil, syscall.EINVAL
+ }
+ if m.Header.Type != syscall.SCM_CREDS {
+ return nil, syscall.EINVAL
+ }
+ ucred := *(*Ucred)(unsafe.Pointer(&m.Data[0]))
+ return &ucred, nil
+}
+
+func (t *unixTransport) SendNullByte() error {
+ ucred := &Ucred{Pid: int32(os.Getpid()), Uid: uint32(os.Getuid()), Gid: uint32(os.Getgid())}
+ b := UnixCredentials(ucred)
+ _, oobn, err := t.UnixConn.WriteMsgUnix([]byte{0}, b, nil)
+ if err != nil {
+ return err
+ }
+ if oobn != len(b) {
+ return io.ErrShortWrite
+ }
+ return nil
+}
diff --git a/archive/vendor/github.com/godbus/dbus/v5/transport_unixcred_freebsd.go b/archive/vendor/github.com/godbus/dbus/v5/transport_unixcred_freebsd.go
new file mode 100644
index 0000000..1b5ed20
--- /dev/null
+++ b/archive/vendor/github.com/godbus/dbus/v5/transport_unixcred_freebsd.go
@@ -0,0 +1,92 @@
+// The UnixCredentials system call is currently only implemented on Linux
+// http://golang.org/src/pkg/syscall/sockcmsg_linux.go
+// https://golang.org/s/go1.4-syscall
+// http://code.google.com/p/go/source/browse/unix/sockcmsg_linux.go?repo=sys
+
+// Local implementation of the UnixCredentials system call for FreeBSD
+
+package dbus
+
+/*
+const int sizeofPtr = sizeof(void*);
+#define _WANT_UCRED
+#include
+#include
+*/
+import "C"
+
+import (
+ "io"
+ "os"
+ "syscall"
+ "unsafe"
+)
+
+// http://golang.org/src/pkg/syscall/ztypes_linux_amd64.go
+// https://golang.org/src/syscall/ztypes_freebsd_amd64.go
+type Ucred struct {
+ Pid int32
+ Uid uint32
+ Gid uint32
+}
+
+// http://golang.org/src/pkg/syscall/types_linux.go
+// https://golang.org/src/syscall/types_freebsd.go
+// https://github.com/freebsd/freebsd/blob/master/sys/sys/ucred.h
+const (
+ SizeofUcred = C.sizeof_struct_ucred
+)
+
+// http://golang.org/src/pkg/syscall/sockcmsg_unix.go
+func cmsgAlignOf(salen int) int {
+ salign := C.sizeofPtr
+
+ return (salen + salign - 1) & ^(salign - 1)
+}
+
+// http://golang.org/src/pkg/syscall/sockcmsg_unix.go
+func cmsgData(h *syscall.Cmsghdr) unsafe.Pointer {
+ return unsafe.Pointer(uintptr(unsafe.Pointer(h)) + uintptr(cmsgAlignOf(syscall.SizeofCmsghdr)))
+}
+
+// http://golang.org/src/pkg/syscall/sockcmsg_linux.go
+// UnixCredentials encodes credentials into a socket control message
+// for sending to another process. This can be used for
+// authentication.
+func UnixCredentials(ucred *Ucred) []byte {
+ b := make([]byte, syscall.CmsgSpace(SizeofUcred))
+ h := (*syscall.Cmsghdr)(unsafe.Pointer(&b[0]))
+ h.Level = syscall.SOL_SOCKET
+ h.Type = syscall.SCM_CREDS
+ h.SetLen(syscall.CmsgLen(SizeofUcred))
+ *((*Ucred)(cmsgData(h))) = *ucred
+ return b
+}
+
+// http://golang.org/src/pkg/syscall/sockcmsg_linux.go
+// ParseUnixCredentials decodes a socket control message that contains
+// credentials in a Ucred structure. To receive such a message, the
+// SO_PASSCRED option must be enabled on the socket.
+func ParseUnixCredentials(m *syscall.SocketControlMessage) (*Ucred, error) {
+ if m.Header.Level != syscall.SOL_SOCKET {
+ return nil, syscall.EINVAL
+ }
+ if m.Header.Type != syscall.SCM_CREDS {
+ return nil, syscall.EINVAL
+ }
+ ucred := *(*Ucred)(unsafe.Pointer(&m.Data[0]))
+ return &ucred, nil
+}
+
+func (t *unixTransport) SendNullByte() error {
+ ucred := &Ucred{Pid: int32(os.Getpid()), Uid: uint32(os.Getuid()), Gid: uint32(os.Getgid())}
+ b := UnixCredentials(ucred)
+ _, oobn, err := t.UnixConn.WriteMsgUnix([]byte{0}, b, nil)
+ if err != nil {
+ return err
+ }
+ if oobn != len(b) {
+ return io.ErrShortWrite
+ }
+ return nil
+}
diff --git a/archive/vendor/github.com/godbus/dbus/v5/transport_unixcred_linux.go b/archive/vendor/github.com/godbus/dbus/v5/transport_unixcred_linux.go
new file mode 100644
index 0000000..d9dfdf6
--- /dev/null
+++ b/archive/vendor/github.com/godbus/dbus/v5/transport_unixcred_linux.go
@@ -0,0 +1,25 @@
+// The UnixCredentials system call is currently only implemented on Linux
+// http://golang.org/src/pkg/syscall/sockcmsg_linux.go
+// https://golang.org/s/go1.4-syscall
+// http://code.google.com/p/go/source/browse/unix/sockcmsg_linux.go?repo=sys
+
+package dbus
+
+import (
+ "io"
+ "os"
+ "syscall"
+)
+
+func (t *unixTransport) SendNullByte() error {
+ ucred := &syscall.Ucred{Pid: int32(os.Getpid()), Uid: uint32(os.Getuid()), Gid: uint32(os.Getgid())}
+ b := syscall.UnixCredentials(ucred)
+ _, oobn, err := t.UnixConn.WriteMsgUnix([]byte{0}, b, nil)
+ if err != nil {
+ return err
+ }
+ if oobn != len(b) {
+ return io.ErrShortWrite
+ }
+ return nil
+}
diff --git a/archive/vendor/github.com/godbus/dbus/v5/transport_unixcred_netbsd.go b/archive/vendor/github.com/godbus/dbus/v5/transport_unixcred_netbsd.go
new file mode 100644
index 0000000..af7bafd
--- /dev/null
+++ b/archive/vendor/github.com/godbus/dbus/v5/transport_unixcred_netbsd.go
@@ -0,0 +1,14 @@
+package dbus
+
+import "io"
+
+func (t *unixTransport) SendNullByte() error {
+ n, _, err := t.UnixConn.WriteMsgUnix([]byte{0}, nil, nil)
+ if err != nil {
+ return err
+ }
+ if n != 1 {
+ return io.ErrShortWrite
+ }
+ return nil
+}
diff --git a/archive/vendor/github.com/godbus/dbus/v5/transport_unixcred_openbsd.go b/archive/vendor/github.com/godbus/dbus/v5/transport_unixcred_openbsd.go
new file mode 100644
index 0000000..af7bafd
--- /dev/null
+++ b/archive/vendor/github.com/godbus/dbus/v5/transport_unixcred_openbsd.go
@@ -0,0 +1,14 @@
+package dbus
+
+import "io"
+
+func (t *unixTransport) SendNullByte() error {
+ n, _, err := t.UnixConn.WriteMsgUnix([]byte{0}, nil, nil)
+ if err != nil {
+ return err
+ }
+ if n != 1 {
+ return io.ErrShortWrite
+ }
+ return nil
+}
diff --git a/archive/vendor/github.com/godbus/dbus/v5/transport_zos.go b/archive/vendor/github.com/godbus/dbus/v5/transport_zos.go
new file mode 100644
index 0000000..1bba0d6
--- /dev/null
+++ b/archive/vendor/github.com/godbus/dbus/v5/transport_zos.go
@@ -0,0 +1,6 @@
+package dbus
+
+func (t *unixTransport) SendNullByte() error {
+ _, err := t.Write([]byte{0})
+ return err
+}
diff --git a/archive/vendor/github.com/godbus/dbus/v5/variant.go b/archive/vendor/github.com/godbus/dbus/v5/variant.go
new file mode 100644
index 0000000..ca3dbe1
--- /dev/null
+++ b/archive/vendor/github.com/godbus/dbus/v5/variant.go
@@ -0,0 +1,150 @@
+package dbus
+
+import (
+ "bytes"
+ "fmt"
+ "reflect"
+ "sort"
+ "strconv"
+)
+
+// Variant represents the D-Bus variant type.
+type Variant struct {
+ sig Signature
+ value interface{}
+}
+
+// MakeVariant converts the given value to a Variant. It panics if v cannot be
+// represented as a D-Bus type.
+func MakeVariant(v interface{}) Variant {
+ return MakeVariantWithSignature(v, SignatureOf(v))
+}
+
+// MakeVariantWithSignature converts the given value to a Variant.
+func MakeVariantWithSignature(v interface{}, s Signature) Variant {
+ return Variant{s, v}
+}
+
+// ParseVariant parses the given string as a variant as described at
+// https://developer.gnome.org/glib/stable/gvariant-text.html. If sig is not
+// empty, it is taken to be the expected signature for the variant.
+func ParseVariant(s string, sig Signature) (Variant, error) {
+ tokens := varLex(s)
+ p := &varParser{tokens: tokens}
+ n, err := varMakeNode(p)
+ if err != nil {
+ return Variant{}, err
+ }
+ if sig.str == "" {
+ sig, err = varInfer(n)
+ if err != nil {
+ return Variant{}, err
+ }
+ }
+ v, err := n.Value(sig)
+ if err != nil {
+ return Variant{}, err
+ }
+ return MakeVariant(v), nil
+}
+
+// format returns a formatted version of v and whether this string can be parsed
+// unambiguously.
+func (v Variant) format() (string, bool) {
+ switch v.sig.str[0] {
+ case 'b', 'i':
+ return fmt.Sprint(v.value), true
+ case 'n', 'q', 'u', 'x', 't', 'd', 'h':
+ return fmt.Sprint(v.value), false
+ case 's':
+ return strconv.Quote(v.value.(string)), true
+ case 'o':
+ return strconv.Quote(string(v.value.(ObjectPath))), false
+ case 'g':
+ return strconv.Quote(v.value.(Signature).str), false
+ case 'v':
+ s, unamb := v.value.(Variant).format()
+ if !unamb {
+ return "<@" + v.value.(Variant).sig.str + " " + s + ">", true
+ }
+ return "<" + s + ">", true
+ case 'y':
+ return fmt.Sprintf("%#x", v.value.(byte)), false
+ }
+ rv := reflect.ValueOf(v.value)
+ switch rv.Kind() {
+ case reflect.Slice:
+ if rv.Len() == 0 {
+ return "[]", false
+ }
+ unamb := true
+ buf := bytes.NewBuffer([]byte("["))
+ for i := 0; i < rv.Len(); i++ {
+ // TODO: slooow
+ s, b := MakeVariant(rv.Index(i).Interface()).format()
+ unamb = unamb && b
+ buf.WriteString(s)
+ if i != rv.Len()-1 {
+ buf.WriteString(", ")
+ }
+ }
+ buf.WriteByte(']')
+ return buf.String(), unamb
+ case reflect.Map:
+ if rv.Len() == 0 {
+ return "{}", false
+ }
+ unamb := true
+ var buf bytes.Buffer
+ kvs := make([]string, rv.Len())
+ for i, k := range rv.MapKeys() {
+ s, b := MakeVariant(k.Interface()).format()
+ unamb = unamb && b
+ buf.Reset()
+ buf.WriteString(s)
+ buf.WriteString(": ")
+ s, b = MakeVariant(rv.MapIndex(k).Interface()).format()
+ unamb = unamb && b
+ buf.WriteString(s)
+ kvs[i] = buf.String()
+ }
+ buf.Reset()
+ buf.WriteByte('{')
+ sort.Strings(kvs)
+ for i, kv := range kvs {
+ if i > 0 {
+ buf.WriteString(", ")
+ }
+ buf.WriteString(kv)
+ }
+ buf.WriteByte('}')
+ return buf.String(), unamb
+ }
+ return `"INVALID"`, true
+}
+
+// Signature returns the D-Bus signature of the underlying value of v.
+func (v Variant) Signature() Signature {
+ return v.sig
+}
+
+// String returns the string representation of the underlying value of v as
+// described at https://developer.gnome.org/glib/stable/gvariant-text.html.
+func (v Variant) String() string {
+ s, unamb := v.format()
+ if !unamb {
+ return "@" + v.sig.str + " " + s
+ }
+ return s
+}
+
+// Value returns the underlying value of v.
+func (v Variant) Value() interface{} {
+ return v.value
+}
+
+// Store converts the variant into a native go type using the same
+// mechanism as the "Store" function.
+func (v Variant) Store(value interface{}) error {
+ return storeInterfaces(v.value, value)
+}
diff --git a/archive/vendor/github.com/godbus/dbus/v5/variant_lexer.go b/archive/vendor/github.com/godbus/dbus/v5/variant_lexer.go
new file mode 100644
index 0000000..bf1398c
--- /dev/null
+++ b/archive/vendor/github.com/godbus/dbus/v5/variant_lexer.go
@@ -0,0 +1,284 @@
+package dbus
+
+import (
+ "fmt"
+ "strings"
+ "unicode"
+ "unicode/utf8"
+)
+
+// Heavily inspired by the lexer from text/template.
+
+type varToken struct {
+ typ varTokenType
+ val string
+}
+
+type varTokenType byte
+
+const (
+ tokEOF varTokenType = iota
+ tokError
+ tokNumber
+ tokString
+ tokBool
+ tokArrayStart
+ tokArrayEnd
+ tokDictStart
+ tokDictEnd
+ tokVariantStart
+ tokVariantEnd
+ tokComma
+ tokColon
+ tokType
+ tokByteString
+)
+
+type varLexer struct {
+ input string
+ start int
+ pos int
+ width int
+ tokens []varToken
+}
+
+type lexState func(*varLexer) lexState
+
+func varLex(s string) []varToken {
+ l := &varLexer{input: s}
+ l.run()
+ return l.tokens
+}
+
+func (l *varLexer) accept(valid string) bool {
+ if strings.ContainsRune(valid, l.next()) {
+ return true
+ }
+ l.backup()
+ return false
+}
+
+func (l *varLexer) backup() {
+ l.pos -= l.width
+}
+
+func (l *varLexer) emit(t varTokenType) {
+ l.tokens = append(l.tokens, varToken{t, l.input[l.start:l.pos]})
+ l.start = l.pos
+}
+
+func (l *varLexer) errorf(format string, v ...interface{}) lexState {
+ l.tokens = append(l.tokens, varToken{
+ tokError,
+ fmt.Sprintf(format, v...),
+ })
+ return nil
+}
+
+func (l *varLexer) ignore() {
+ l.start = l.pos
+}
+
+func (l *varLexer) next() rune {
+ var r rune
+
+ if l.pos >= len(l.input) {
+ l.width = 0
+ return -1
+ }
+ r, l.width = utf8.DecodeRuneInString(l.input[l.pos:])
+ l.pos += l.width
+ return r
+}
+
+func (l *varLexer) run() {
+ for state := varLexNormal; state != nil; {
+ state = state(l)
+ }
+}
+
+func (l *varLexer) peek() rune {
+ r := l.next()
+ l.backup()
+ return r
+}
+
+func varLexNormal(l *varLexer) lexState {
+ for {
+ r := l.next()
+ switch {
+ case r == -1:
+ l.emit(tokEOF)
+ return nil
+ case r == '[':
+ l.emit(tokArrayStart)
+ case r == ']':
+ l.emit(tokArrayEnd)
+ case r == '{':
+ l.emit(tokDictStart)
+ case r == '}':
+ l.emit(tokDictEnd)
+ case r == '<':
+ l.emit(tokVariantStart)
+ case r == '>':
+ l.emit(tokVariantEnd)
+ case r == ':':
+ l.emit(tokColon)
+ case r == ',':
+ l.emit(tokComma)
+ case r == '\'' || r == '"':
+ l.backup()
+ return varLexString
+ case r == '@':
+ l.backup()
+ return varLexType
+ case unicode.IsSpace(r):
+ l.ignore()
+ case unicode.IsNumber(r) || r == '+' || r == '-':
+ l.backup()
+ return varLexNumber
+ case r == 'b':
+ pos := l.start
+ if n := l.peek(); n == '"' || n == '\'' {
+ return varLexByteString
+ }
+ // not a byte string; try to parse it as a type or bool below
+ l.pos = pos + 1
+ l.width = 1
+ fallthrough
+ default:
+ // either a bool or a type. Try bools first.
+ l.backup()
+ if l.pos+4 <= len(l.input) {
+ if l.input[l.pos:l.pos+4] == "true" {
+ l.pos += 4
+ l.emit(tokBool)
+ continue
+ }
+ }
+ if l.pos+5 <= len(l.input) {
+ if l.input[l.pos:l.pos+5] == "false" {
+ l.pos += 5
+ l.emit(tokBool)
+ continue
+ }
+ }
+ // must be a type.
+ return varLexType
+ }
+ }
+}
+
+var varTypeMap = map[string]string{
+ "boolean": "b",
+ "byte": "y",
+ "int16": "n",
+ "uint16": "q",
+ "int32": "i",
+ "uint32": "u",
+ "int64": "x",
+ "uint64": "t",
+ "double": "f",
+ "string": "s",
+ "objectpath": "o",
+ "signature": "g",
+}
+
+func varLexByteString(l *varLexer) lexState {
+ q := l.next()
+Loop:
+ for {
+ switch l.next() {
+ case '\\':
+ if r := l.next(); r != -1 {
+ break
+ }
+ fallthrough
+ case -1:
+ return l.errorf("unterminated bytestring")
+ case q:
+ break Loop
+ }
+ }
+ l.emit(tokByteString)
+ return varLexNormal
+}
+
+func varLexNumber(l *varLexer) lexState {
+ l.accept("+-")
+ digits := "0123456789"
+ if l.accept("0") {
+ if l.accept("x") {
+ digits = "0123456789abcdefABCDEF"
+ } else {
+ digits = "01234567"
+ }
+ }
+ for strings.ContainsRune(digits, l.next()) {
+ }
+ l.backup()
+ if l.accept(".") {
+ for strings.ContainsRune(digits, l.next()) {
+ }
+ l.backup()
+ }
+ if l.accept("eE") {
+ l.accept("+-")
+ for strings.ContainsRune("0123456789", l.next()) {
+ }
+ l.backup()
+ }
+ if r := l.peek(); unicode.IsLetter(r) {
+ l.next()
+ return l.errorf("bad number syntax: %q", l.input[l.start:l.pos])
+ }
+ l.emit(tokNumber)
+ return varLexNormal
+}
+
+func varLexString(l *varLexer) lexState {
+ q := l.next()
+Loop:
+ for {
+ switch l.next() {
+ case '\\':
+ if r := l.next(); r != -1 {
+ break
+ }
+ fallthrough
+ case -1:
+ return l.errorf("unterminated string")
+ case q:
+ break Loop
+ }
+ }
+ l.emit(tokString)
+ return varLexNormal
+}
+
+func varLexType(l *varLexer) lexState {
+ at := l.accept("@")
+ for {
+ r := l.next()
+ if r == -1 {
+ break
+ }
+ if unicode.IsSpace(r) {
+ l.backup()
+ break
+ }
+ }
+ if at {
+ if _, err := ParseSignature(l.input[l.start+1 : l.pos]); err != nil {
+ return l.errorf("%s", err)
+ }
+ } else {
+ if _, ok := varTypeMap[l.input[l.start:l.pos]]; ok {
+ l.emit(tokType)
+ return varLexNormal
+ }
+ return l.errorf("unrecognized type %q", l.input[l.start:l.pos])
+ }
+ l.emit(tokType)
+ return varLexNormal
+}
diff --git a/archive/vendor/github.com/godbus/dbus/v5/variant_parser.go b/archive/vendor/github.com/godbus/dbus/v5/variant_parser.go
new file mode 100644
index 0000000..d20f5da
--- /dev/null
+++ b/archive/vendor/github.com/godbus/dbus/v5/variant_parser.go
@@ -0,0 +1,817 @@
+package dbus
+
+import (
+ "bytes"
+ "errors"
+ "fmt"
+ "io"
+ "reflect"
+ "strconv"
+ "strings"
+ "unicode/utf8"
+)
+
+type varParser struct {
+ tokens []varToken
+ i int
+}
+
+func (p *varParser) backup() {
+ p.i--
+}
+
+func (p *varParser) next() varToken {
+ if p.i < len(p.tokens) {
+ t := p.tokens[p.i]
+ p.i++
+ return t
+ }
+ return varToken{typ: tokEOF}
+}
+
+type varNode interface {
+ Infer() (Signature, error)
+ String() string
+ Sigs() sigSet
+ Value(Signature) (interface{}, error)
+}
+
+func varMakeNode(p *varParser) (varNode, error) {
+ var sig Signature
+
+ for {
+ t := p.next()
+ switch t.typ {
+ case tokEOF:
+ return nil, io.ErrUnexpectedEOF
+ case tokError:
+ return nil, errors.New(t.val)
+ case tokNumber:
+ return varMakeNumNode(t, sig)
+ case tokString:
+ return varMakeStringNode(t, sig)
+ case tokBool:
+ if sig.str != "" && sig.str != "b" {
+ return nil, varTypeError{t.val, sig}
+ }
+ b, err := strconv.ParseBool(t.val)
+ if err != nil {
+ return nil, err
+ }
+ return boolNode(b), nil
+ case tokArrayStart:
+ return varMakeArrayNode(p, sig)
+ case tokVariantStart:
+ return varMakeVariantNode(p, sig)
+ case tokDictStart:
+ return varMakeDictNode(p, sig)
+ case tokType:
+ if sig.str != "" {
+ return nil, errors.New("unexpected type annotation")
+ }
+ if t.val[0] == '@' {
+ sig.str = t.val[1:]
+ } else {
+ sig.str = varTypeMap[t.val]
+ }
+ case tokByteString:
+ if sig.str != "" && sig.str != "ay" {
+ return nil, varTypeError{t.val, sig}
+ }
+ b, err := varParseByteString(t.val)
+ if err != nil {
+ return nil, err
+ }
+ return byteStringNode(b), nil
+ default:
+ return nil, fmt.Errorf("unexpected %q", t.val)
+ }
+ }
+}
+
+type varTypeError struct {
+ val string
+ sig Signature
+}
+
+func (e varTypeError) Error() string {
+ return fmt.Sprintf("dbus: can't parse %q as type %q", e.val, e.sig.str)
+}
+
+type sigSet map[Signature]bool
+
+func (s sigSet) Empty() bool {
+ return len(s) == 0
+}
+
+func (s sigSet) Intersect(s2 sigSet) sigSet {
+ r := make(sigSet)
+ for k := range s {
+ if s2[k] {
+ r[k] = true
+ }
+ }
+ return r
+}
+
+func (s sigSet) Single() (Signature, bool) {
+ if len(s) == 1 {
+ for k := range s {
+ return k, true
+ }
+ }
+ return Signature{}, false
+}
+
+func (s sigSet) ToArray() sigSet {
+ r := make(sigSet, len(s))
+ for k := range s {
+ r[Signature{"a" + k.str}] = true
+ }
+ return r
+}
+
+type numNode struct {
+ sig Signature
+ str string
+ val interface{}
+}
+
+var numSigSet = sigSet{
+ Signature{"y"}: true,
+ Signature{"n"}: true,
+ Signature{"q"}: true,
+ Signature{"i"}: true,
+ Signature{"u"}: true,
+ Signature{"x"}: true,
+ Signature{"t"}: true,
+ Signature{"d"}: true,
+}
+
+func (n numNode) Infer() (Signature, error) {
+ if strings.ContainsAny(n.str, ".e") {
+ return Signature{"d"}, nil
+ }
+ return Signature{"i"}, nil
+}
+
+func (n numNode) String() string {
+ return n.str
+}
+
+func (n numNode) Sigs() sigSet {
+ if n.sig.str != "" {
+ return sigSet{n.sig: true}
+ }
+ if strings.ContainsAny(n.str, ".e") {
+ return sigSet{Signature{"d"}: true}
+ }
+ return numSigSet
+}
+
+func (n numNode) Value(sig Signature) (interface{}, error) {
+ if n.sig.str != "" && n.sig != sig {
+ return nil, varTypeError{n.str, sig}
+ }
+ if n.val != nil {
+ return n.val, nil
+ }
+ return varNumAs(n.str, sig)
+}
+
+func varMakeNumNode(tok varToken, sig Signature) (varNode, error) {
+ if sig.str == "" {
+ return numNode{str: tok.val}, nil
+ }
+ num, err := varNumAs(tok.val, sig)
+ if err != nil {
+ return nil, err
+ }
+ return numNode{sig: sig, val: num}, nil
+}
+
+func varNumAs(s string, sig Signature) (interface{}, error) {
+ isUnsigned := false
+ size := 32
+ switch sig.str {
+ case "n":
+ size = 16
+ case "i":
+ case "x":
+ size = 64
+ case "y":
+ size = 8
+ isUnsigned = true
+ case "q":
+ size = 16
+ isUnsigned = true
+ case "u":
+ isUnsigned = true
+ case "t":
+ size = 64
+ isUnsigned = true
+ case "d":
+ d, err := strconv.ParseFloat(s, 64)
+ if err != nil {
+ return nil, err
+ }
+ return d, nil
+ default:
+ return nil, varTypeError{s, sig}
+ }
+ base := 10
+ if strings.HasPrefix(s, "0x") {
+ base = 16
+ s = s[2:]
+ }
+ if strings.HasPrefix(s, "0") && len(s) != 1 {
+ base = 8
+ s = s[1:]
+ }
+ if isUnsigned {
+ i, err := strconv.ParseUint(s, base, size)
+ if err != nil {
+ return nil, err
+ }
+ var v interface{} = i
+ switch sig.str {
+ case "y":
+ v = byte(i)
+ case "q":
+ v = uint16(i)
+ case "u":
+ v = uint32(i)
+ }
+ return v, nil
+ }
+ i, err := strconv.ParseInt(s, base, size)
+ if err != nil {
+ return nil, err
+ }
+ var v interface{} = i
+ switch sig.str {
+ case "n":
+ v = int16(i)
+ case "i":
+ v = int32(i)
+ }
+ return v, nil
+}
+
+type stringNode struct {
+ sig Signature
+ str string // parsed
+ val interface{} // has correct type
+}
+
+var stringSigSet = sigSet{
+ Signature{"s"}: true,
+ Signature{"g"}: true,
+ Signature{"o"}: true,
+}
+
+func (n stringNode) Infer() (Signature, error) {
+ return Signature{"s"}, nil
+}
+
+func (n stringNode) String() string {
+ return n.str
+}
+
+func (n stringNode) Sigs() sigSet {
+ if n.sig.str != "" {
+ return sigSet{n.sig: true}
+ }
+ return stringSigSet
+}
+
+func (n stringNode) Value(sig Signature) (interface{}, error) {
+ if n.sig.str != "" && n.sig != sig {
+ return nil, varTypeError{n.str, sig}
+ }
+ if n.val != nil {
+ return n.val, nil
+ }
+ switch {
+ case sig.str == "g":
+ return Signature{n.str}, nil
+ case sig.str == "o":
+ return ObjectPath(n.str), nil
+ case sig.str == "s":
+ return n.str, nil
+ default:
+ return nil, varTypeError{n.str, sig}
+ }
+}
+
+func varMakeStringNode(tok varToken, sig Signature) (varNode, error) {
+ if sig.str != "" && sig.str != "s" && sig.str != "g" && sig.str != "o" {
+ return nil, fmt.Errorf("invalid type %q for string", sig.str)
+ }
+ s, err := varParseString(tok.val)
+ if err != nil {
+ return nil, err
+ }
+ n := stringNode{str: s}
+ if sig.str == "" {
+ return stringNode{str: s}, nil
+ }
+ n.sig = sig
+ switch sig.str {
+ case "o":
+ n.val = ObjectPath(s)
+ case "g":
+ n.val = Signature{s}
+ case "s":
+ n.val = s
+ }
+ return n, nil
+}
+
+func varParseString(s string) (string, error) {
+ // quotes are guaranteed to be there
+ s = s[1 : len(s)-1]
+ buf := new(bytes.Buffer)
+ for len(s) != 0 {
+ r, size := utf8.DecodeRuneInString(s)
+ if r == utf8.RuneError && size == 1 {
+ return "", errors.New("invalid UTF-8")
+ }
+ s = s[size:]
+ if r != '\\' {
+ buf.WriteRune(r)
+ continue
+ }
+ r, size = utf8.DecodeRuneInString(s)
+ if r == utf8.RuneError && size == 1 {
+ return "", errors.New("invalid UTF-8")
+ }
+ s = s[size:]
+ switch r {
+ case 'a':
+ buf.WriteRune(0x7)
+ case 'b':
+ buf.WriteRune(0x8)
+ case 'f':
+ buf.WriteRune(0xc)
+ case 'n':
+ buf.WriteRune('\n')
+ case 'r':
+ buf.WriteRune('\r')
+ case 't':
+ buf.WriteRune('\t')
+ case '\n':
+ case 'u':
+ if len(s) < 4 {
+ return "", errors.New("short unicode escape")
+ }
+ r, err := strconv.ParseUint(s[:4], 16, 32)
+ if err != nil {
+ return "", err
+ }
+ buf.WriteRune(rune(r))
+ s = s[4:]
+ case 'U':
+ if len(s) < 8 {
+ return "", errors.New("short unicode escape")
+ }
+ r, err := strconv.ParseUint(s[:8], 16, 32)
+ if err != nil {
+ return "", err
+ }
+ buf.WriteRune(rune(r))
+ s = s[8:]
+ default:
+ buf.WriteRune(r)
+ }
+ }
+ return buf.String(), nil
+}
+
+var boolSigSet = sigSet{Signature{"b"}: true}
+
+type boolNode bool
+
+func (boolNode) Infer() (Signature, error) {
+ return Signature{"b"}, nil
+}
+
+func (b boolNode) String() string {
+ if b {
+ return "true"
+ }
+ return "false"
+}
+
+func (boolNode) Sigs() sigSet {
+ return boolSigSet
+}
+
+func (b boolNode) Value(sig Signature) (interface{}, error) {
+ if sig.str != "b" {
+ return nil, varTypeError{b.String(), sig}
+ }
+ return bool(b), nil
+}
+
+type arrayNode struct {
+ set sigSet
+ children []varNode
+ val interface{}
+}
+
+func (n arrayNode) Infer() (Signature, error) {
+ for _, v := range n.children {
+ csig, err := varInfer(v)
+ if err != nil {
+ continue
+ }
+ return Signature{"a" + csig.str}, nil
+ }
+ return Signature{}, fmt.Errorf("can't infer type for %q", n.String())
+}
+
+func (n arrayNode) String() string {
+ s := "["
+ for i, v := range n.children {
+ s += v.String()
+ if i != len(n.children)-1 {
+ s += ", "
+ }
+ }
+ return s + "]"
+}
+
+func (n arrayNode) Sigs() sigSet {
+ return n.set
+}
+
+func (n arrayNode) Value(sig Signature) (interface{}, error) {
+ if n.set.Empty() {
+ // no type information whatsoever, so this must be an empty slice
+ return reflect.MakeSlice(typeFor(sig.str), 0, 0).Interface(), nil
+ }
+ if !n.set[sig] {
+ return nil, varTypeError{n.String(), sig}
+ }
+ s := reflect.MakeSlice(typeFor(sig.str), len(n.children), len(n.children))
+ for i, v := range n.children {
+ rv, err := v.Value(Signature{sig.str[1:]})
+ if err != nil {
+ return nil, err
+ }
+ s.Index(i).Set(reflect.ValueOf(rv))
+ }
+ return s.Interface(), nil
+}
+
+func varMakeArrayNode(p *varParser, sig Signature) (varNode, error) {
+ var n arrayNode
+ if sig.str != "" {
+ n.set = sigSet{sig: true}
+ }
+ if t := p.next(); t.typ == tokArrayEnd {
+ return n, nil
+ } else {
+ p.backup()
+ }
+Loop:
+ for {
+ t := p.next()
+ switch t.typ {
+ case tokEOF:
+ return nil, io.ErrUnexpectedEOF
+ case tokError:
+ return nil, errors.New(t.val)
+ }
+ p.backup()
+ cn, err := varMakeNode(p)
+ if err != nil {
+ return nil, err
+ }
+ if cset := cn.Sigs(); !cset.Empty() {
+ if n.set.Empty() {
+ n.set = cset.ToArray()
+ } else {
+ nset := cset.ToArray().Intersect(n.set)
+ if nset.Empty() {
+ return nil, fmt.Errorf("can't parse %q with given type information", cn.String())
+ }
+ n.set = nset
+ }
+ }
+ n.children = append(n.children, cn)
+ switch t := p.next(); t.typ {
+ case tokEOF:
+ return nil, io.ErrUnexpectedEOF
+ case tokError:
+ return nil, errors.New(t.val)
+ case tokArrayEnd:
+ break Loop
+ case tokComma:
+ continue
+ default:
+ return nil, fmt.Errorf("unexpected %q", t.val)
+ }
+ }
+ return n, nil
+}
+
+type variantNode struct {
+ n varNode
+}
+
+var variantSet = sigSet{
+ Signature{"v"}: true,
+}
+
+func (variantNode) Infer() (Signature, error) {
+ return Signature{"v"}, nil
+}
+
+func (n variantNode) String() string {
+ return "<" + n.n.String() + ">"
+}
+
+func (variantNode) Sigs() sigSet {
+ return variantSet
+}
+
+func (n variantNode) Value(sig Signature) (interface{}, error) {
+ if sig.str != "v" {
+ return nil, varTypeError{n.String(), sig}
+ }
+ sig, err := varInfer(n.n)
+ if err != nil {
+ return nil, err
+ }
+ v, err := n.n.Value(sig)
+ if err != nil {
+ return nil, err
+ }
+ return MakeVariant(v), nil
+}
+
+func varMakeVariantNode(p *varParser, sig Signature) (varNode, error) {
+ n, err := varMakeNode(p)
+ if err != nil {
+ return nil, err
+ }
+ if t := p.next(); t.typ != tokVariantEnd {
+ return nil, fmt.Errorf("unexpected %q", t.val)
+ }
+ vn := variantNode{n}
+ if sig.str != "" && sig.str != "v" {
+ return nil, varTypeError{vn.String(), sig}
+ }
+ return variantNode{n}, nil
+}
+
+type dictEntry struct {
+ key, val varNode
+}
+
+type dictNode struct {
+ kset, vset sigSet
+ children []dictEntry
+ val interface{}
+}
+
+func (n dictNode) Infer() (Signature, error) {
+ for _, v := range n.children {
+ ksig, err := varInfer(v.key)
+ if err != nil {
+ continue
+ }
+ vsig, err := varInfer(v.val)
+ if err != nil {
+ continue
+ }
+ return Signature{"a{" + ksig.str + vsig.str + "}"}, nil
+ }
+ return Signature{}, fmt.Errorf("can't infer type for %q", n.String())
+}
+
+func (n dictNode) String() string {
+ s := "{"
+ for i, v := range n.children {
+ s += v.key.String() + ": " + v.val.String()
+ if i != len(n.children)-1 {
+ s += ", "
+ }
+ }
+ return s + "}"
+}
+
+func (n dictNode) Sigs() sigSet {
+ r := sigSet{}
+ for k := range n.kset {
+ for v := range n.vset {
+ sig := "a{" + k.str + v.str + "}"
+ r[Signature{sig}] = true
+ }
+ }
+ return r
+}
+
+func (n dictNode) Value(sig Signature) (interface{}, error) {
+ set := n.Sigs()
+ if set.Empty() {
+ // no type information -> empty dict
+ return reflect.MakeMap(typeFor(sig.str)).Interface(), nil
+ }
+ if !set[sig] {
+ return nil, varTypeError{n.String(), sig}
+ }
+ m := reflect.MakeMap(typeFor(sig.str))
+ ksig := Signature{sig.str[2:3]}
+ vsig := Signature{sig.str[3 : len(sig.str)-1]}
+ for _, v := range n.children {
+ kv, err := v.key.Value(ksig)
+ if err != nil {
+ return nil, err
+ }
+ vv, err := v.val.Value(vsig)
+ if err != nil {
+ return nil, err
+ }
+ m.SetMapIndex(reflect.ValueOf(kv), reflect.ValueOf(vv))
+ }
+ return m.Interface(), nil
+}
+
+func varMakeDictNode(p *varParser, sig Signature) (varNode, error) {
+ var n dictNode
+
+ if sig.str != "" {
+ if len(sig.str) < 5 {
+ return nil, fmt.Errorf("invalid signature %q for dict type", sig)
+ }
+ ksig := Signature{string(sig.str[2])}
+ vsig := Signature{sig.str[3 : len(sig.str)-1]}
+ n.kset = sigSet{ksig: true}
+ n.vset = sigSet{vsig: true}
+ }
+ if t := p.next(); t.typ == tokDictEnd {
+ return n, nil
+ } else {
+ p.backup()
+ }
+Loop:
+ for {
+ t := p.next()
+ switch t.typ {
+ case tokEOF:
+ return nil, io.ErrUnexpectedEOF
+ case tokError:
+ return nil, errors.New(t.val)
+ }
+ p.backup()
+ kn, err := varMakeNode(p)
+ if err != nil {
+ return nil, err
+ }
+ if kset := kn.Sigs(); !kset.Empty() {
+ if n.kset.Empty() {
+ n.kset = kset
+ } else {
+ n.kset = kset.Intersect(n.kset)
+ if n.kset.Empty() {
+ return nil, fmt.Errorf("can't parse %q with given type information", kn.String())
+ }
+ }
+ }
+ t = p.next()
+ switch t.typ {
+ case tokEOF:
+ return nil, io.ErrUnexpectedEOF
+ case tokError:
+ return nil, errors.New(t.val)
+ case tokColon:
+ default:
+ return nil, fmt.Errorf("unexpected %q", t.val)
+ }
+ t = p.next()
+ switch t.typ {
+ case tokEOF:
+ return nil, io.ErrUnexpectedEOF
+ case tokError:
+ return nil, errors.New(t.val)
+ }
+ p.backup()
+ vn, err := varMakeNode(p)
+ if err != nil {
+ return nil, err
+ }
+ if vset := vn.Sigs(); !vset.Empty() {
+ if n.vset.Empty() {
+ n.vset = vset
+ } else {
+ n.vset = n.vset.Intersect(vset)
+ if n.vset.Empty() {
+ return nil, fmt.Errorf("can't parse %q with given type information", vn.String())
+ }
+ }
+ }
+ n.children = append(n.children, dictEntry{kn, vn})
+ t = p.next()
+ switch t.typ {
+ case tokEOF:
+ return nil, io.ErrUnexpectedEOF
+ case tokError:
+ return nil, errors.New(t.val)
+ case tokDictEnd:
+ break Loop
+ case tokComma:
+ continue
+ default:
+ return nil, fmt.Errorf("unexpected %q", t.val)
+ }
+ }
+ return n, nil
+}
+
+type byteStringNode []byte
+
+var byteStringSet = sigSet{
+ Signature{"ay"}: true,
+}
+
+func (byteStringNode) Infer() (Signature, error) {
+ return Signature{"ay"}, nil
+}
+
+func (b byteStringNode) String() string {
+ return string(b)
+}
+
+func (b byteStringNode) Sigs() sigSet {
+ return byteStringSet
+}
+
+func (b byteStringNode) Value(sig Signature) (interface{}, error) {
+ if sig.str != "ay" {
+ return nil, varTypeError{b.String(), sig}
+ }
+ return []byte(b), nil
+}
+
+func varParseByteString(s string) ([]byte, error) {
+ // quotes and b at start are guaranteed to be there
+ b := make([]byte, 0, 1)
+ s = s[2 : len(s)-1]
+ for len(s) != 0 {
+ c := s[0]
+ s = s[1:]
+ if c != '\\' {
+ b = append(b, c)
+ continue
+ }
+ c = s[0]
+ s = s[1:]
+ switch c {
+ case 'a':
+ b = append(b, 0x7)
+ case 'b':
+ b = append(b, 0x8)
+ case 'f':
+ b = append(b, 0xc)
+ case 'n':
+ b = append(b, '\n')
+ case 'r':
+ b = append(b, '\r')
+ case 't':
+ b = append(b, '\t')
+ case 'x':
+ if len(s) < 2 {
+ return nil, errors.New("short escape")
+ }
+ n, err := strconv.ParseUint(s[:2], 16, 8)
+ if err != nil {
+ return nil, err
+ }
+ b = append(b, byte(n))
+ s = s[2:]
+ case '0':
+ if len(s) < 3 {
+ return nil, errors.New("short escape")
+ }
+ n, err := strconv.ParseUint(s[:3], 8, 8)
+ if err != nil {
+ return nil, err
+ }
+ b = append(b, byte(n))
+ s = s[3:]
+ default:
+ b = append(b, c)
+ }
+ }
+ return append(b, 0), nil
+}
+
+func varInfer(n varNode) (Signature, error) {
+ if sig, ok := n.Sigs().Single(); ok {
+ return sig, nil
+ }
+ return n.Infer()
+}
diff --git a/archive/vendor/github.com/google/uuid/.travis.yml b/archive/vendor/github.com/google/uuid/.travis.yml
new file mode 100644
index 0000000..d8156a6
--- /dev/null
+++ b/archive/vendor/github.com/google/uuid/.travis.yml
@@ -0,0 +1,9 @@
+language: go
+
+go:
+ - 1.4.3
+ - 1.5.3
+ - tip
+
+script:
+ - go test -v ./...
diff --git a/archive/vendor/github.com/google/uuid/CONTRIBUTING.md b/archive/vendor/github.com/google/uuid/CONTRIBUTING.md
new file mode 100644
index 0000000..04fdf09
--- /dev/null
+++ b/archive/vendor/github.com/google/uuid/CONTRIBUTING.md
@@ -0,0 +1,10 @@
+# How to contribute
+
+We definitely welcome patches and contribution to this project!
+
+### Legal requirements
+
+In order to protect both you and ourselves, you will need to sign the
+[Contributor License Agreement](https://cla.developers.google.com/clas).
+
+You may have already signed it for other Google projects.
diff --git a/archive/vendor/github.com/google/uuid/CONTRIBUTORS b/archive/vendor/github.com/google/uuid/CONTRIBUTORS
new file mode 100644
index 0000000..b4bb97f
--- /dev/null
+++ b/archive/vendor/github.com/google/uuid/CONTRIBUTORS
@@ -0,0 +1,9 @@
+Paul Borman
+bmatsuo
+shawnps
+theory
+jboverfelt
+dsymonds
+cd1
+wallclockbuilder
+dansouza
diff --git a/archive/vendor/github.com/google/uuid/LICENSE b/archive/vendor/github.com/google/uuid/LICENSE
new file mode 100644
index 0000000..5dc6826
--- /dev/null
+++ b/archive/vendor/github.com/google/uuid/LICENSE
@@ -0,0 +1,27 @@
+Copyright (c) 2009,2014 Google Inc. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+ * Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+copyright notice, this list of conditions and the following disclaimer
+in the documentation and/or other materials provided with the
+distribution.
+ * Neither the name of Google Inc. nor the names of its
+contributors may be used to endorse or promote products derived from
+this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/archive/vendor/github.com/google/uuid/README.md b/archive/vendor/github.com/google/uuid/README.md
new file mode 100644
index 0000000..f765a46
--- /dev/null
+++ b/archive/vendor/github.com/google/uuid/README.md
@@ -0,0 +1,19 @@
+# uuid 
+The uuid package generates and inspects UUIDs based on
+[RFC 4122](http://tools.ietf.org/html/rfc4122)
+and DCE 1.1: Authentication and Security Services.
+
+This package is based on the github.com/pborman/uuid package (previously named
+code.google.com/p/go-uuid). It differs from these earlier packages in that
+a UUID is a 16 byte array rather than a byte slice. One loss due to this
+change is the ability to represent an invalid UUID (vs a NIL UUID).
+
+###### Install
+`go get github.com/google/uuid`
+
+###### Documentation
+[](http://godoc.org/github.com/google/uuid)
+
+Full `go doc` style documentation for the package can be viewed online without
+installing this package by using the GoDoc site here:
+http://pkg.go.dev/github.com/google/uuid
diff --git a/archive/vendor/github.com/google/uuid/dce.go b/archive/vendor/github.com/google/uuid/dce.go
new file mode 100644
index 0000000..fa820b9
--- /dev/null
+++ b/archive/vendor/github.com/google/uuid/dce.go
@@ -0,0 +1,80 @@
+// Copyright 2016 Google Inc. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package uuid
+
+import (
+ "encoding/binary"
+ "fmt"
+ "os"
+)
+
+// A Domain represents a Version 2 domain
+type Domain byte
+
+// Domain constants for DCE Security (Version 2) UUIDs.
+const (
+ Person = Domain(0)
+ Group = Domain(1)
+ Org = Domain(2)
+)
+
+// NewDCESecurity returns a DCE Security (Version 2) UUID.
+//
+// The domain should be one of Person, Group or Org.
+// On a POSIX system the id should be the users UID for the Person
+// domain and the users GID for the Group. The meaning of id for
+// the domain Org or on non-POSIX systems is site defined.
+//
+// For a given domain/id pair the same token may be returned for up to
+// 7 minutes and 10 seconds.
+func NewDCESecurity(domain Domain, id uint32) (UUID, error) {
+ uuid, err := NewUUID()
+ if err == nil {
+ uuid[6] = (uuid[6] & 0x0f) | 0x20 // Version 2
+ uuid[9] = byte(domain)
+ binary.BigEndian.PutUint32(uuid[0:], id)
+ }
+ return uuid, err
+}
+
+// NewDCEPerson returns a DCE Security (Version 2) UUID in the person
+// domain with the id returned by os.Getuid.
+//
+// NewDCESecurity(Person, uint32(os.Getuid()))
+func NewDCEPerson() (UUID, error) {
+ return NewDCESecurity(Person, uint32(os.Getuid()))
+}
+
+// NewDCEGroup returns a DCE Security (Version 2) UUID in the group
+// domain with the id returned by os.Getgid.
+//
+// NewDCESecurity(Group, uint32(os.Getgid()))
+func NewDCEGroup() (UUID, error) {
+ return NewDCESecurity(Group, uint32(os.Getgid()))
+}
+
+// Domain returns the domain for a Version 2 UUID. Domains are only defined
+// for Version 2 UUIDs.
+func (uuid UUID) Domain() Domain {
+ return Domain(uuid[9])
+}
+
+// ID returns the id for a Version 2 UUID. IDs are only defined for Version 2
+// UUIDs.
+func (uuid UUID) ID() uint32 {
+ return binary.BigEndian.Uint32(uuid[0:4])
+}
+
+func (d Domain) String() string {
+ switch d {
+ case Person:
+ return "Person"
+ case Group:
+ return "Group"
+ case Org:
+ return "Org"
+ }
+ return fmt.Sprintf("Domain%d", int(d))
+}
diff --git a/archive/vendor/github.com/google/uuid/doc.go b/archive/vendor/github.com/google/uuid/doc.go
new file mode 100644
index 0000000..5b8a4b9
--- /dev/null
+++ b/archive/vendor/github.com/google/uuid/doc.go
@@ -0,0 +1,12 @@
+// Copyright 2016 Google Inc. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Package uuid generates and inspects UUIDs.
+//
+// UUIDs are based on RFC 4122 and DCE 1.1: Authentication and Security
+// Services.
+//
+// A UUID is a 16 byte (128 bit) array. UUIDs may be used as keys to
+// maps or compared directly.
+package uuid
diff --git a/archive/vendor/github.com/google/uuid/hash.go b/archive/vendor/github.com/google/uuid/hash.go
new file mode 100644
index 0000000..b404f4b
--- /dev/null
+++ b/archive/vendor/github.com/google/uuid/hash.go
@@ -0,0 +1,53 @@
+// Copyright 2016 Google Inc. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package uuid
+
+import (
+ "crypto/md5"
+ "crypto/sha1"
+ "hash"
+)
+
+// Well known namespace IDs and UUIDs
+var (
+ NameSpaceDNS = Must(Parse("6ba7b810-9dad-11d1-80b4-00c04fd430c8"))
+ NameSpaceURL = Must(Parse("6ba7b811-9dad-11d1-80b4-00c04fd430c8"))
+ NameSpaceOID = Must(Parse("6ba7b812-9dad-11d1-80b4-00c04fd430c8"))
+ NameSpaceX500 = Must(Parse("6ba7b814-9dad-11d1-80b4-00c04fd430c8"))
+ Nil UUID // empty UUID, all zeros
+)
+
+// NewHash returns a new UUID derived from the hash of space concatenated with
+// data generated by h. The hash should be at least 16 byte in length. The
+// first 16 bytes of the hash are used to form the UUID. The version of the
+// UUID will be the lower 4 bits of version. NewHash is used to implement
+// NewMD5 and NewSHA1.
+func NewHash(h hash.Hash, space UUID, data []byte, version int) UUID {
+ h.Reset()
+ h.Write(space[:]) //nolint:errcheck
+ h.Write(data) //nolint:errcheck
+ s := h.Sum(nil)
+ var uuid UUID
+ copy(uuid[:], s)
+ uuid[6] = (uuid[6] & 0x0f) | uint8((version&0xf)<<4)
+ uuid[8] = (uuid[8] & 0x3f) | 0x80 // RFC 4122 variant
+ return uuid
+}
+
+// NewMD5 returns a new MD5 (Version 3) UUID based on the
+// supplied name space and data. It is the same as calling:
+//
+// NewHash(md5.New(), space, data, 3)
+func NewMD5(space UUID, data []byte) UUID {
+ return NewHash(md5.New(), space, data, 3)
+}
+
+// NewSHA1 returns a new SHA1 (Version 5) UUID based on the
+// supplied name space and data. It is the same as calling:
+//
+// NewHash(sha1.New(), space, data, 5)
+func NewSHA1(space UUID, data []byte) UUID {
+ return NewHash(sha1.New(), space, data, 5)
+}
diff --git a/archive/vendor/github.com/google/uuid/marshal.go b/archive/vendor/github.com/google/uuid/marshal.go
new file mode 100644
index 0000000..14bd340
--- /dev/null
+++ b/archive/vendor/github.com/google/uuid/marshal.go
@@ -0,0 +1,38 @@
+// Copyright 2016 Google Inc. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package uuid
+
+import "fmt"
+
+// MarshalText implements encoding.TextMarshaler.
+func (uuid UUID) MarshalText() ([]byte, error) {
+ var js [36]byte
+ encodeHex(js[:], uuid)
+ return js[:], nil
+}
+
+// UnmarshalText implements encoding.TextUnmarshaler.
+func (uuid *UUID) UnmarshalText(data []byte) error {
+ id, err := ParseBytes(data)
+ if err != nil {
+ return err
+ }
+ *uuid = id
+ return nil
+}
+
+// MarshalBinary implements encoding.BinaryMarshaler.
+func (uuid UUID) MarshalBinary() ([]byte, error) {
+ return uuid[:], nil
+}
+
+// UnmarshalBinary implements encoding.BinaryUnmarshaler.
+func (uuid *UUID) UnmarshalBinary(data []byte) error {
+ if len(data) != 16 {
+ return fmt.Errorf("invalid UUID (got %d bytes)", len(data))
+ }
+ copy(uuid[:], data)
+ return nil
+}
diff --git a/archive/vendor/github.com/google/uuid/node.go b/archive/vendor/github.com/google/uuid/node.go
new file mode 100644
index 0000000..d651a2b
--- /dev/null
+++ b/archive/vendor/github.com/google/uuid/node.go
@@ -0,0 +1,90 @@
+// Copyright 2016 Google Inc. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package uuid
+
+import (
+ "sync"
+)
+
+var (
+ nodeMu sync.Mutex
+ ifname string // name of interface being used
+ nodeID [6]byte // hardware for version 1 UUIDs
+ zeroID [6]byte // nodeID with only 0's
+)
+
+// NodeInterface returns the name of the interface from which the NodeID was
+// derived. The interface "user" is returned if the NodeID was set by
+// SetNodeID.
+func NodeInterface() string {
+ defer nodeMu.Unlock()
+ nodeMu.Lock()
+ return ifname
+}
+
+// SetNodeInterface selects the hardware address to be used for Version 1 UUIDs.
+// If name is "" then the first usable interface found will be used or a random
+// Node ID will be generated. If a named interface cannot be found then false
+// is returned.
+//
+// SetNodeInterface never fails when name is "".
+func SetNodeInterface(name string) bool {
+ defer nodeMu.Unlock()
+ nodeMu.Lock()
+ return setNodeInterface(name)
+}
+
+func setNodeInterface(name string) bool {
+ iname, addr := getHardwareInterface(name) // null implementation for js
+ if iname != "" && addr != nil {
+ ifname = iname
+ copy(nodeID[:], addr)
+ return true
+ }
+
+ // We found no interfaces with a valid hardware address. If name
+ // does not specify a specific interface generate a random Node ID
+ // (section 4.1.6)
+ if name == "" {
+ ifname = "random"
+ randomBits(nodeID[:])
+ return true
+ }
+ return false
+}
+
+// NodeID returns a slice of a copy of the current Node ID, setting the Node ID
+// if not already set.
+func NodeID() []byte {
+ defer nodeMu.Unlock()
+ nodeMu.Lock()
+ if nodeID == zeroID {
+ setNodeInterface("")
+ }
+ nid := nodeID
+ return nid[:]
+}
+
+// SetNodeID sets the Node ID to be used for Version 1 UUIDs. The first 6 bytes
+// of id are used. If id is less than 6 bytes then false is returned and the
+// Node ID is not set.
+func SetNodeID(id []byte) bool {
+ if len(id) < 6 {
+ return false
+ }
+ defer nodeMu.Unlock()
+ nodeMu.Lock()
+ copy(nodeID[:], id)
+ ifname = "user"
+ return true
+}
+
+// NodeID returns the 6 byte node id encoded in uuid. It returns nil if uuid is
+// not valid. The NodeID is only well defined for version 1 and 2 UUIDs.
+func (uuid UUID) NodeID() []byte {
+ var node [6]byte
+ copy(node[:], uuid[10:])
+ return node[:]
+}
diff --git a/archive/vendor/github.com/google/uuid/node_js.go b/archive/vendor/github.com/google/uuid/node_js.go
new file mode 100644
index 0000000..24b78ed
--- /dev/null
+++ b/archive/vendor/github.com/google/uuid/node_js.go
@@ -0,0 +1,12 @@
+// Copyright 2017 Google Inc. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// +build js
+
+package uuid
+
+// getHardwareInterface returns nil values for the JS version of the code.
+// This remvoves the "net" dependency, because it is not used in the browser.
+// Using the "net" library inflates the size of the transpiled JS code by 673k bytes.
+func getHardwareInterface(name string) (string, []byte) { return "", nil }
diff --git a/archive/vendor/github.com/google/uuid/node_net.go b/archive/vendor/github.com/google/uuid/node_net.go
new file mode 100644
index 0000000..0cbbcdd
--- /dev/null
+++ b/archive/vendor/github.com/google/uuid/node_net.go
@@ -0,0 +1,33 @@
+// Copyright 2017 Google Inc. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// +build !js
+
+package uuid
+
+import "net"
+
+var interfaces []net.Interface // cached list of interfaces
+
+// getHardwareInterface returns the name and hardware address of interface name.
+// If name is "" then the name and hardware address of one of the system's
+// interfaces is returned. If no interfaces are found (name does not exist or
+// there are no interfaces) then "", nil is returned.
+//
+// Only addresses of at least 6 bytes are returned.
+func getHardwareInterface(name string) (string, []byte) {
+ if interfaces == nil {
+ var err error
+ interfaces, err = net.Interfaces()
+ if err != nil {
+ return "", nil
+ }
+ }
+ for _, ifs := range interfaces {
+ if len(ifs.HardwareAddr) >= 6 && (name == "" || name == ifs.Name) {
+ return ifs.Name, ifs.HardwareAddr
+ }
+ }
+ return "", nil
+}
diff --git a/archive/vendor/github.com/google/uuid/null.go b/archive/vendor/github.com/google/uuid/null.go
new file mode 100644
index 0000000..d7fcbf2
--- /dev/null
+++ b/archive/vendor/github.com/google/uuid/null.go
@@ -0,0 +1,118 @@
+// Copyright 2021 Google Inc. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package uuid
+
+import (
+ "bytes"
+ "database/sql/driver"
+ "encoding/json"
+ "fmt"
+)
+
+var jsonNull = []byte("null")
+
+// NullUUID represents a UUID that may be null.
+// NullUUID implements the SQL driver.Scanner interface so
+// it can be used as a scan destination:
+//
+// var u uuid.NullUUID
+// err := db.QueryRow("SELECT name FROM foo WHERE id=?", id).Scan(&u)
+// ...
+// if u.Valid {
+// // use u.UUID
+// } else {
+// // NULL value
+// }
+//
+type NullUUID struct {
+ UUID UUID
+ Valid bool // Valid is true if UUID is not NULL
+}
+
+// Scan implements the SQL driver.Scanner interface.
+func (nu *NullUUID) Scan(value interface{}) error {
+ if value == nil {
+ nu.UUID, nu.Valid = Nil, false
+ return nil
+ }
+
+ err := nu.UUID.Scan(value)
+ if err != nil {
+ nu.Valid = false
+ return err
+ }
+
+ nu.Valid = true
+ return nil
+}
+
+// Value implements the driver Valuer interface.
+func (nu NullUUID) Value() (driver.Value, error) {
+ if !nu.Valid {
+ return nil, nil
+ }
+ // Delegate to UUID Value function
+ return nu.UUID.Value()
+}
+
+// MarshalBinary implements encoding.BinaryMarshaler.
+func (nu NullUUID) MarshalBinary() ([]byte, error) {
+ if nu.Valid {
+ return nu.UUID[:], nil
+ }
+
+ return []byte(nil), nil
+}
+
+// UnmarshalBinary implements encoding.BinaryUnmarshaler.
+func (nu *NullUUID) UnmarshalBinary(data []byte) error {
+ if len(data) != 16 {
+ return fmt.Errorf("invalid UUID (got %d bytes)", len(data))
+ }
+ copy(nu.UUID[:], data)
+ nu.Valid = true
+ return nil
+}
+
+// MarshalText implements encoding.TextMarshaler.
+func (nu NullUUID) MarshalText() ([]byte, error) {
+ if nu.Valid {
+ return nu.UUID.MarshalText()
+ }
+
+ return jsonNull, nil
+}
+
+// UnmarshalText implements encoding.TextUnmarshaler.
+func (nu *NullUUID) UnmarshalText(data []byte) error {
+ id, err := ParseBytes(data)
+ if err != nil {
+ nu.Valid = false
+ return err
+ }
+ nu.UUID = id
+ nu.Valid = true
+ return nil
+}
+
+// MarshalJSON implements json.Marshaler.
+func (nu NullUUID) MarshalJSON() ([]byte, error) {
+ if nu.Valid {
+ return json.Marshal(nu.UUID)
+ }
+
+ return jsonNull, nil
+}
+
+// UnmarshalJSON implements json.Unmarshaler.
+func (nu *NullUUID) UnmarshalJSON(data []byte) error {
+ if bytes.Equal(data, jsonNull) {
+ *nu = NullUUID{}
+ return nil // valid null UUID
+ }
+ err := json.Unmarshal(data, &nu.UUID)
+ nu.Valid = err == nil
+ return err
+}
diff --git a/archive/vendor/github.com/google/uuid/sql.go b/archive/vendor/github.com/google/uuid/sql.go
new file mode 100644
index 0000000..2e02ec0
--- /dev/null
+++ b/archive/vendor/github.com/google/uuid/sql.go
@@ -0,0 +1,59 @@
+// Copyright 2016 Google Inc. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package uuid
+
+import (
+ "database/sql/driver"
+ "fmt"
+)
+
+// Scan implements sql.Scanner so UUIDs can be read from databases transparently.
+// Currently, database types that map to string and []byte are supported. Please
+// consult database-specific driver documentation for matching types.
+func (uuid *UUID) Scan(src interface{}) error {
+ switch src := src.(type) {
+ case nil:
+ return nil
+
+ case string:
+ // if an empty UUID comes from a table, we return a null UUID
+ if src == "" {
+ return nil
+ }
+
+ // see Parse for required string format
+ u, err := Parse(src)
+ if err != nil {
+ return fmt.Errorf("Scan: %v", err)
+ }
+
+ *uuid = u
+
+ case []byte:
+ // if an empty UUID comes from a table, we return a null UUID
+ if len(src) == 0 {
+ return nil
+ }
+
+ // assumes a simple slice of bytes if 16 bytes
+ // otherwise attempts to parse
+ if len(src) != 16 {
+ return uuid.Scan(string(src))
+ }
+ copy((*uuid)[:], src)
+
+ default:
+ return fmt.Errorf("Scan: unable to scan type %T into UUID", src)
+ }
+
+ return nil
+}
+
+// Value implements sql.Valuer so that UUIDs can be written to databases
+// transparently. Currently, UUIDs map to strings. Please consult
+// database-specific driver documentation for matching types.
+func (uuid UUID) Value() (driver.Value, error) {
+ return uuid.String(), nil
+}
diff --git a/archive/vendor/github.com/google/uuid/time.go b/archive/vendor/github.com/google/uuid/time.go
new file mode 100644
index 0000000..e6ef06c
--- /dev/null
+++ b/archive/vendor/github.com/google/uuid/time.go
@@ -0,0 +1,123 @@
+// Copyright 2016 Google Inc. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package uuid
+
+import (
+ "encoding/binary"
+ "sync"
+ "time"
+)
+
+// A Time represents a time as the number of 100's of nanoseconds since 15 Oct
+// 1582.
+type Time int64
+
+const (
+ lillian = 2299160 // Julian day of 15 Oct 1582
+ unix = 2440587 // Julian day of 1 Jan 1970
+ epoch = unix - lillian // Days between epochs
+ g1582 = epoch * 86400 // seconds between epochs
+ g1582ns100 = g1582 * 10000000 // 100s of a nanoseconds between epochs
+)
+
+var (
+ timeMu sync.Mutex
+ lasttime uint64 // last time we returned
+ clockSeq uint16 // clock sequence for this run
+
+ timeNow = time.Now // for testing
+)
+
+// UnixTime converts t the number of seconds and nanoseconds using the Unix
+// epoch of 1 Jan 1970.
+func (t Time) UnixTime() (sec, nsec int64) {
+ sec = int64(t - g1582ns100)
+ nsec = (sec % 10000000) * 100
+ sec /= 10000000
+ return sec, nsec
+}
+
+// GetTime returns the current Time (100s of nanoseconds since 15 Oct 1582) and
+// clock sequence as well as adjusting the clock sequence as needed. An error
+// is returned if the current time cannot be determined.
+func GetTime() (Time, uint16, error) {
+ defer timeMu.Unlock()
+ timeMu.Lock()
+ return getTime()
+}
+
+func getTime() (Time, uint16, error) {
+ t := timeNow()
+
+ // If we don't have a clock sequence already, set one.
+ if clockSeq == 0 {
+ setClockSequence(-1)
+ }
+ now := uint64(t.UnixNano()/100) + g1582ns100
+
+ // If time has gone backwards with this clock sequence then we
+ // increment the clock sequence
+ if now <= lasttime {
+ clockSeq = ((clockSeq + 1) & 0x3fff) | 0x8000
+ }
+ lasttime = now
+ return Time(now), clockSeq, nil
+}
+
+// ClockSequence returns the current clock sequence, generating one if not
+// already set. The clock sequence is only used for Version 1 UUIDs.
+//
+// The uuid package does not use global static storage for the clock sequence or
+// the last time a UUID was generated. Unless SetClockSequence is used, a new
+// random clock sequence is generated the first time a clock sequence is
+// requested by ClockSequence, GetTime, or NewUUID. (section 4.2.1.1)
+func ClockSequence() int {
+ defer timeMu.Unlock()
+ timeMu.Lock()
+ return clockSequence()
+}
+
+func clockSequence() int {
+ if clockSeq == 0 {
+ setClockSequence(-1)
+ }
+ return int(clockSeq & 0x3fff)
+}
+
+// SetClockSequence sets the clock sequence to the lower 14 bits of seq. Setting to
+// -1 causes a new sequence to be generated.
+func SetClockSequence(seq int) {
+ defer timeMu.Unlock()
+ timeMu.Lock()
+ setClockSequence(seq)
+}
+
+func setClockSequence(seq int) {
+ if seq == -1 {
+ var b [2]byte
+ randomBits(b[:]) // clock sequence
+ seq = int(b[0])<<8 | int(b[1])
+ }
+ oldSeq := clockSeq
+ clockSeq = uint16(seq&0x3fff) | 0x8000 // Set our variant
+ if oldSeq != clockSeq {
+ lasttime = 0
+ }
+}
+
+// Time returns the time in 100s of nanoseconds since 15 Oct 1582 encoded in
+// uuid. The time is only defined for version 1 and 2 UUIDs.
+func (uuid UUID) Time() Time {
+ time := int64(binary.BigEndian.Uint32(uuid[0:4]))
+ time |= int64(binary.BigEndian.Uint16(uuid[4:6])) << 32
+ time |= int64(binary.BigEndian.Uint16(uuid[6:8])&0xfff) << 48
+ return Time(time)
+}
+
+// ClockSequence returns the clock sequence encoded in uuid.
+// The clock sequence is only well defined for version 1 and 2 UUIDs.
+func (uuid UUID) ClockSequence() int {
+ return int(binary.BigEndian.Uint16(uuid[8:10])) & 0x3fff
+}
diff --git a/archive/vendor/github.com/google/uuid/util.go b/archive/vendor/github.com/google/uuid/util.go
new file mode 100644
index 0000000..5ea6c73
--- /dev/null
+++ b/archive/vendor/github.com/google/uuid/util.go
@@ -0,0 +1,43 @@
+// Copyright 2016 Google Inc. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package uuid
+
+import (
+ "io"
+)
+
+// randomBits completely fills slice b with random data.
+func randomBits(b []byte) {
+ if _, err := io.ReadFull(rander, b); err != nil {
+ panic(err.Error()) // rand should never fail
+ }
+}
+
+// xvalues returns the value of a byte as a hexadecimal digit or 255.
+var xvalues = [256]byte{
+ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 255, 255, 255, 255, 255, 255,
+ 255, 10, 11, 12, 13, 14, 15, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255, 10, 11, 12, 13, 14, 15, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+}
+
+// xtob converts hex characters x1 and x2 into a byte.
+func xtob(x1, x2 byte) (byte, bool) {
+ b1 := xvalues[x1]
+ b2 := xvalues[x2]
+ return (b1 << 4) | b2, b1 != 255 && b2 != 255
+}
diff --git a/archive/vendor/github.com/google/uuid/uuid.go b/archive/vendor/github.com/google/uuid/uuid.go
new file mode 100644
index 0000000..a57207a
--- /dev/null
+++ b/archive/vendor/github.com/google/uuid/uuid.go
@@ -0,0 +1,294 @@
+// Copyright 2018 Google Inc. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package uuid
+
+import (
+ "bytes"
+ "crypto/rand"
+ "encoding/hex"
+ "errors"
+ "fmt"
+ "io"
+ "strings"
+ "sync"
+)
+
+// A UUID is a 128 bit (16 byte) Universal Unique IDentifier as defined in RFC
+// 4122.
+type UUID [16]byte
+
+// A Version represents a UUID's version.
+type Version byte
+
+// A Variant represents a UUID's variant.
+type Variant byte
+
+// Constants returned by Variant.
+const (
+ Invalid = Variant(iota) // Invalid UUID
+ RFC4122 // The variant specified in RFC4122
+ Reserved // Reserved, NCS backward compatibility.
+ Microsoft // Reserved, Microsoft Corporation backward compatibility.
+ Future // Reserved for future definition.
+)
+
+const randPoolSize = 16 * 16
+
+var (
+ rander = rand.Reader // random function
+ poolEnabled = false
+ poolMu sync.Mutex
+ poolPos = randPoolSize // protected with poolMu
+ pool [randPoolSize]byte // protected with poolMu
+)
+
+type invalidLengthError struct{ len int }
+
+func (err invalidLengthError) Error() string {
+ return fmt.Sprintf("invalid UUID length: %d", err.len)
+}
+
+// IsInvalidLengthError is matcher function for custom error invalidLengthError
+func IsInvalidLengthError(err error) bool {
+ _, ok := err.(invalidLengthError)
+ return ok
+}
+
+// Parse decodes s into a UUID or returns an error. Both the standard UUID
+// forms of xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx and
+// urn:uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx are decoded as well as the
+// Microsoft encoding {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} and the raw hex
+// encoding: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.
+func Parse(s string) (UUID, error) {
+ var uuid UUID
+ switch len(s) {
+ // xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
+ case 36:
+
+ // urn:uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
+ case 36 + 9:
+ if strings.ToLower(s[:9]) != "urn:uuid:" {
+ return uuid, fmt.Errorf("invalid urn prefix: %q", s[:9])
+ }
+ s = s[9:]
+
+ // {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}
+ case 36 + 2:
+ s = s[1:]
+
+ // xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ case 32:
+ var ok bool
+ for i := range uuid {
+ uuid[i], ok = xtob(s[i*2], s[i*2+1])
+ if !ok {
+ return uuid, errors.New("invalid UUID format")
+ }
+ }
+ return uuid, nil
+ default:
+ return uuid, invalidLengthError{len(s)}
+ }
+ // s is now at least 36 bytes long
+ // it must be of the form xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
+ if s[8] != '-' || s[13] != '-' || s[18] != '-' || s[23] != '-' {
+ return uuid, errors.New("invalid UUID format")
+ }
+ for i, x := range [16]int{
+ 0, 2, 4, 6,
+ 9, 11,
+ 14, 16,
+ 19, 21,
+ 24, 26, 28, 30, 32, 34} {
+ v, ok := xtob(s[x], s[x+1])
+ if !ok {
+ return uuid, errors.New("invalid UUID format")
+ }
+ uuid[i] = v
+ }
+ return uuid, nil
+}
+
+// ParseBytes is like Parse, except it parses a byte slice instead of a string.
+func ParseBytes(b []byte) (UUID, error) {
+ var uuid UUID
+ switch len(b) {
+ case 36: // xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
+ case 36 + 9: // urn:uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
+ if !bytes.Equal(bytes.ToLower(b[:9]), []byte("urn:uuid:")) {
+ return uuid, fmt.Errorf("invalid urn prefix: %q", b[:9])
+ }
+ b = b[9:]
+ case 36 + 2: // {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}
+ b = b[1:]
+ case 32: // xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ var ok bool
+ for i := 0; i < 32; i += 2 {
+ uuid[i/2], ok = xtob(b[i], b[i+1])
+ if !ok {
+ return uuid, errors.New("invalid UUID format")
+ }
+ }
+ return uuid, nil
+ default:
+ return uuid, invalidLengthError{len(b)}
+ }
+ // s is now at least 36 bytes long
+ // it must be of the form xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
+ if b[8] != '-' || b[13] != '-' || b[18] != '-' || b[23] != '-' {
+ return uuid, errors.New("invalid UUID format")
+ }
+ for i, x := range [16]int{
+ 0, 2, 4, 6,
+ 9, 11,
+ 14, 16,
+ 19, 21,
+ 24, 26, 28, 30, 32, 34} {
+ v, ok := xtob(b[x], b[x+1])
+ if !ok {
+ return uuid, errors.New("invalid UUID format")
+ }
+ uuid[i] = v
+ }
+ return uuid, nil
+}
+
+// MustParse is like Parse but panics if the string cannot be parsed.
+// It simplifies safe initialization of global variables holding compiled UUIDs.
+func MustParse(s string) UUID {
+ uuid, err := Parse(s)
+ if err != nil {
+ panic(`uuid: Parse(` + s + `): ` + err.Error())
+ }
+ return uuid
+}
+
+// FromBytes creates a new UUID from a byte slice. Returns an error if the slice
+// does not have a length of 16. The bytes are copied from the slice.
+func FromBytes(b []byte) (uuid UUID, err error) {
+ err = uuid.UnmarshalBinary(b)
+ return uuid, err
+}
+
+// Must returns uuid if err is nil and panics otherwise.
+func Must(uuid UUID, err error) UUID {
+ if err != nil {
+ panic(err)
+ }
+ return uuid
+}
+
+// String returns the string form of uuid, xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
+// , or "" if uuid is invalid.
+func (uuid UUID) String() string {
+ var buf [36]byte
+ encodeHex(buf[:], uuid)
+ return string(buf[:])
+}
+
+// URN returns the RFC 2141 URN form of uuid,
+// urn:uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx, or "" if uuid is invalid.
+func (uuid UUID) URN() string {
+ var buf [36 + 9]byte
+ copy(buf[:], "urn:uuid:")
+ encodeHex(buf[9:], uuid)
+ return string(buf[:])
+}
+
+func encodeHex(dst []byte, uuid UUID) {
+ hex.Encode(dst, uuid[:4])
+ dst[8] = '-'
+ hex.Encode(dst[9:13], uuid[4:6])
+ dst[13] = '-'
+ hex.Encode(dst[14:18], uuid[6:8])
+ dst[18] = '-'
+ hex.Encode(dst[19:23], uuid[8:10])
+ dst[23] = '-'
+ hex.Encode(dst[24:], uuid[10:])
+}
+
+// Variant returns the variant encoded in uuid.
+func (uuid UUID) Variant() Variant {
+ switch {
+ case (uuid[8] & 0xc0) == 0x80:
+ return RFC4122
+ case (uuid[8] & 0xe0) == 0xc0:
+ return Microsoft
+ case (uuid[8] & 0xe0) == 0xe0:
+ return Future
+ default:
+ return Reserved
+ }
+}
+
+// Version returns the version of uuid.
+func (uuid UUID) Version() Version {
+ return Version(uuid[6] >> 4)
+}
+
+func (v Version) String() string {
+ if v > 15 {
+ return fmt.Sprintf("BAD_VERSION_%d", v)
+ }
+ return fmt.Sprintf("VERSION_%d", v)
+}
+
+func (v Variant) String() string {
+ switch v {
+ case RFC4122:
+ return "RFC4122"
+ case Reserved:
+ return "Reserved"
+ case Microsoft:
+ return "Microsoft"
+ case Future:
+ return "Future"
+ case Invalid:
+ return "Invalid"
+ }
+ return fmt.Sprintf("BadVariant%d", int(v))
+}
+
+// SetRand sets the random number generator to r, which implements io.Reader.
+// If r.Read returns an error when the package requests random data then
+// a panic will be issued.
+//
+// Calling SetRand with nil sets the random number generator to the default
+// generator.
+func SetRand(r io.Reader) {
+ if r == nil {
+ rander = rand.Reader
+ return
+ }
+ rander = r
+}
+
+// EnableRandPool enables internal randomness pool used for Random
+// (Version 4) UUID generation. The pool contains random bytes read from
+// the random number generator on demand in batches. Enabling the pool
+// may improve the UUID generation throughput significantly.
+//
+// Since the pool is stored on the Go heap, this feature may be a bad fit
+// for security sensitive applications.
+//
+// Both EnableRandPool and DisableRandPool are not thread-safe and should
+// only be called when there is no possibility that New or any other
+// UUID Version 4 generation function will be called concurrently.
+func EnableRandPool() {
+ poolEnabled = true
+}
+
+// DisableRandPool disables the randomness pool if it was previously
+// enabled with EnableRandPool.
+//
+// Both EnableRandPool and DisableRandPool are not thread-safe and should
+// only be called when there is no possibility that New or any other
+// UUID Version 4 generation function will be called concurrently.
+func DisableRandPool() {
+ poolEnabled = false
+ defer poolMu.Unlock()
+ poolMu.Lock()
+ poolPos = randPoolSize
+}
diff --git a/archive/vendor/github.com/google/uuid/version1.go b/archive/vendor/github.com/google/uuid/version1.go
new file mode 100644
index 0000000..4631096
--- /dev/null
+++ b/archive/vendor/github.com/google/uuid/version1.go
@@ -0,0 +1,44 @@
+// Copyright 2016 Google Inc. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package uuid
+
+import (
+ "encoding/binary"
+)
+
+// NewUUID returns a Version 1 UUID based on the current NodeID and clock
+// sequence, and the current time. If the NodeID has not been set by SetNodeID
+// or SetNodeInterface then it will be set automatically. If the NodeID cannot
+// be set NewUUID returns nil. If clock sequence has not been set by
+// SetClockSequence then it will be set automatically. If GetTime fails to
+// return the current NewUUID returns nil and an error.
+//
+// In most cases, New should be used.
+func NewUUID() (UUID, error) {
+ var uuid UUID
+ now, seq, err := GetTime()
+ if err != nil {
+ return uuid, err
+ }
+
+ timeLow := uint32(now & 0xffffffff)
+ timeMid := uint16((now >> 32) & 0xffff)
+ timeHi := uint16((now >> 48) & 0x0fff)
+ timeHi |= 0x1000 // Version 1
+
+ binary.BigEndian.PutUint32(uuid[0:], timeLow)
+ binary.BigEndian.PutUint16(uuid[4:], timeMid)
+ binary.BigEndian.PutUint16(uuid[6:], timeHi)
+ binary.BigEndian.PutUint16(uuid[8:], seq)
+
+ nodeMu.Lock()
+ if nodeID == zeroID {
+ setNodeInterface("")
+ }
+ copy(uuid[10:], nodeID[:])
+ nodeMu.Unlock()
+
+ return uuid, nil
+}
diff --git a/archive/vendor/github.com/google/uuid/version4.go b/archive/vendor/github.com/google/uuid/version4.go
new file mode 100644
index 0000000..7697802
--- /dev/null
+++ b/archive/vendor/github.com/google/uuid/version4.go
@@ -0,0 +1,76 @@
+// Copyright 2016 Google Inc. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package uuid
+
+import "io"
+
+// New creates a new random UUID or panics. New is equivalent to
+// the expression
+//
+// uuid.Must(uuid.NewRandom())
+func New() UUID {
+ return Must(NewRandom())
+}
+
+// NewString creates a new random UUID and returns it as a string or panics.
+// NewString is equivalent to the expression
+//
+// uuid.New().String()
+func NewString() string {
+ return Must(NewRandom()).String()
+}
+
+// NewRandom returns a Random (Version 4) UUID.
+//
+// The strength of the UUIDs is based on the strength of the crypto/rand
+// package.
+//
+// Uses the randomness pool if it was enabled with EnableRandPool.
+//
+// A note about uniqueness derived from the UUID Wikipedia entry:
+//
+// Randomly generated UUIDs have 122 random bits. One's annual risk of being
+// hit by a meteorite is estimated to be one chance in 17 billion, that
+// means the probability is about 0.00000000006 (6 × 10−11),
+// equivalent to the odds of creating a few tens of trillions of UUIDs in a
+// year and having one duplicate.
+func NewRandom() (UUID, error) {
+ if !poolEnabled {
+ return NewRandomFromReader(rander)
+ }
+ return newRandomFromPool()
+}
+
+// NewRandomFromReader returns a UUID based on bytes read from a given io.Reader.
+func NewRandomFromReader(r io.Reader) (UUID, error) {
+ var uuid UUID
+ _, err := io.ReadFull(r, uuid[:])
+ if err != nil {
+ return Nil, err
+ }
+ uuid[6] = (uuid[6] & 0x0f) | 0x40 // Version 4
+ uuid[8] = (uuid[8] & 0x3f) | 0x80 // Variant is 10
+ return uuid, nil
+}
+
+func newRandomFromPool() (UUID, error) {
+ var uuid UUID
+ poolMu.Lock()
+ if poolPos == randPoolSize {
+ _, err := io.ReadFull(rander, pool[:])
+ if err != nil {
+ poolMu.Unlock()
+ return Nil, err
+ }
+ poolPos = 0
+ }
+ copy(uuid[:], pool[poolPos:(poolPos+16)])
+ poolPos += 16
+ poolMu.Unlock()
+
+ uuid[6] = (uuid[6] & 0x0f) | 0x40 // Version 4
+ uuid[8] = (uuid[8] & 0x3f) | 0x80 // Variant is 10
+ return uuid, nil
+}
diff --git a/archive/vendor/github.com/jinzhu/inflection/LICENSE b/archive/vendor/github.com/jinzhu/inflection/LICENSE
new file mode 100644
index 0000000..a1ca9a0
--- /dev/null
+++ b/archive/vendor/github.com/jinzhu/inflection/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2015 - Jinzhu
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/archive/vendor/github.com/jinzhu/inflection/README.md b/archive/vendor/github.com/jinzhu/inflection/README.md
new file mode 100644
index 0000000..a3de336
--- /dev/null
+++ b/archive/vendor/github.com/jinzhu/inflection/README.md
@@ -0,0 +1,55 @@
+# Inflection
+
+Inflection pluralizes and singularizes English nouns
+
+[](https://app.wercker.com/project/byKey/f8c7432b097d1f4ce636879670be0930)
+
+## Basic Usage
+
+```go
+inflection.Plural("person") => "people"
+inflection.Plural("Person") => "People"
+inflection.Plural("PERSON") => "PEOPLE"
+inflection.Plural("bus") => "buses"
+inflection.Plural("BUS") => "BUSES"
+inflection.Plural("Bus") => "Buses"
+
+inflection.Singular("people") => "person"
+inflection.Singular("People") => "Person"
+inflection.Singular("PEOPLE") => "PERSON"
+inflection.Singular("buses") => "bus"
+inflection.Singular("BUSES") => "BUS"
+inflection.Singular("Buses") => "Bus"
+
+inflection.Plural("FancyPerson") => "FancyPeople"
+inflection.Singular("FancyPeople") => "FancyPerson"
+```
+
+## Register Rules
+
+Standard rules are from Rails's ActiveSupport (https://github.com/rails/rails/blob/master/activesupport/lib/active_support/inflections.rb)
+
+If you want to register more rules, follow:
+
+```
+inflection.AddUncountable("fish")
+inflection.AddIrregular("person", "people")
+inflection.AddPlural("(bu)s$", "${1}ses") # "bus" => "buses" / "BUS" => "BUSES" / "Bus" => "Buses"
+inflection.AddSingular("(bus)(es)?$", "${1}") # "buses" => "bus" / "Buses" => "Bus" / "BUSES" => "BUS"
+```
+
+## Contributing
+
+You can help to make the project better, check out [http://gorm.io/contribute.html](http://gorm.io/contribute.html) for things you can do.
+
+## Author
+
+**jinzhu**
+
+*
+*
+*
+
+## License
+
+Released under the [MIT License](http://www.opensource.org/licenses/MIT).
diff --git a/archive/vendor/github.com/jinzhu/inflection/inflections.go b/archive/vendor/github.com/jinzhu/inflection/inflections.go
new file mode 100644
index 0000000..606263b
--- /dev/null
+++ b/archive/vendor/github.com/jinzhu/inflection/inflections.go
@@ -0,0 +1,273 @@
+/*
+Package inflection pluralizes and singularizes English nouns.
+
+ inflection.Plural("person") => "people"
+ inflection.Plural("Person") => "People"
+ inflection.Plural("PERSON") => "PEOPLE"
+
+ inflection.Singular("people") => "person"
+ inflection.Singular("People") => "Person"
+ inflection.Singular("PEOPLE") => "PERSON"
+
+ inflection.Plural("FancyPerson") => "FancydPeople"
+ inflection.Singular("FancyPeople") => "FancydPerson"
+
+Standard rules are from Rails's ActiveSupport (https://github.com/rails/rails/blob/master/activesupport/lib/active_support/inflections.rb)
+
+If you want to register more rules, follow:
+
+ inflection.AddUncountable("fish")
+ inflection.AddIrregular("person", "people")
+ inflection.AddPlural("(bu)s$", "${1}ses") # "bus" => "buses" / "BUS" => "BUSES" / "Bus" => "Buses"
+ inflection.AddSingular("(bus)(es)?$", "${1}") # "buses" => "bus" / "Buses" => "Bus" / "BUSES" => "BUS"
+*/
+package inflection
+
+import (
+ "regexp"
+ "strings"
+)
+
+type inflection struct {
+ regexp *regexp.Regexp
+ replace string
+}
+
+// Regular is a regexp find replace inflection
+type Regular struct {
+ find string
+ replace string
+}
+
+// Irregular is a hard replace inflection,
+// containing both singular and plural forms
+type Irregular struct {
+ singular string
+ plural string
+}
+
+// RegularSlice is a slice of Regular inflections
+type RegularSlice []Regular
+
+// IrregularSlice is a slice of Irregular inflections
+type IrregularSlice []Irregular
+
+var pluralInflections = RegularSlice{
+ {"([a-z])$", "${1}s"},
+ {"s$", "s"},
+ {"^(ax|test)is$", "${1}es"},
+ {"(octop|vir)us$", "${1}i"},
+ {"(octop|vir)i$", "${1}i"},
+ {"(alias|status)$", "${1}es"},
+ {"(bu)s$", "${1}ses"},
+ {"(buffal|tomat)o$", "${1}oes"},
+ {"([ti])um$", "${1}a"},
+ {"([ti])a$", "${1}a"},
+ {"sis$", "ses"},
+ {"(?:([^f])fe|([lr])f)$", "${1}${2}ves"},
+ {"(hive)$", "${1}s"},
+ {"([^aeiouy]|qu)y$", "${1}ies"},
+ {"(x|ch|ss|sh)$", "${1}es"},
+ {"(matr|vert|ind)(?:ix|ex)$", "${1}ices"},
+ {"^(m|l)ouse$", "${1}ice"},
+ {"^(m|l)ice$", "${1}ice"},
+ {"^(ox)$", "${1}en"},
+ {"^(oxen)$", "${1}"},
+ {"(quiz)$", "${1}zes"},
+}
+
+var singularInflections = RegularSlice{
+ {"s$", ""},
+ {"(ss)$", "${1}"},
+ {"(n)ews$", "${1}ews"},
+ {"([ti])a$", "${1}um"},
+ {"((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)(sis|ses)$", "${1}sis"},
+ {"(^analy)(sis|ses)$", "${1}sis"},
+ {"([^f])ves$", "${1}fe"},
+ {"(hive)s$", "${1}"},
+ {"(tive)s$", "${1}"},
+ {"([lr])ves$", "${1}f"},
+ {"([^aeiouy]|qu)ies$", "${1}y"},
+ {"(s)eries$", "${1}eries"},
+ {"(m)ovies$", "${1}ovie"},
+ {"(c)ookies$", "${1}ookie"},
+ {"(x|ch|ss|sh)es$", "${1}"},
+ {"^(m|l)ice$", "${1}ouse"},
+ {"(bus)(es)?$", "${1}"},
+ {"(o)es$", "${1}"},
+ {"(shoe)s$", "${1}"},
+ {"(cris|test)(is|es)$", "${1}is"},
+ {"^(a)x[ie]s$", "${1}xis"},
+ {"(octop|vir)(us|i)$", "${1}us"},
+ {"(alias|status)(es)?$", "${1}"},
+ {"^(ox)en", "${1}"},
+ {"(vert|ind)ices$", "${1}ex"},
+ {"(matr)ices$", "${1}ix"},
+ {"(quiz)zes$", "${1}"},
+ {"(database)s$", "${1}"},
+}
+
+var irregularInflections = IrregularSlice{
+ {"person", "people"},
+ {"man", "men"},
+ {"child", "children"},
+ {"sex", "sexes"},
+ {"move", "moves"},
+ {"mombie", "mombies"},
+}
+
+var uncountableInflections = []string{"equipment", "information", "rice", "money", "species", "series", "fish", "sheep", "jeans", "police"}
+
+var compiledPluralMaps []inflection
+var compiledSingularMaps []inflection
+
+func compile() {
+ compiledPluralMaps = []inflection{}
+ compiledSingularMaps = []inflection{}
+ for _, uncountable := range uncountableInflections {
+ inf := inflection{
+ regexp: regexp.MustCompile("^(?i)(" + uncountable + ")$"),
+ replace: "${1}",
+ }
+ compiledPluralMaps = append(compiledPluralMaps, inf)
+ compiledSingularMaps = append(compiledSingularMaps, inf)
+ }
+
+ for _, value := range irregularInflections {
+ infs := []inflection{
+ inflection{regexp: regexp.MustCompile(strings.ToUpper(value.singular) + "$"), replace: strings.ToUpper(value.plural)},
+ inflection{regexp: regexp.MustCompile(strings.Title(value.singular) + "$"), replace: strings.Title(value.plural)},
+ inflection{regexp: regexp.MustCompile(value.singular + "$"), replace: value.plural},
+ }
+ compiledPluralMaps = append(compiledPluralMaps, infs...)
+ }
+
+ for _, value := range irregularInflections {
+ infs := []inflection{
+ inflection{regexp: regexp.MustCompile(strings.ToUpper(value.plural) + "$"), replace: strings.ToUpper(value.singular)},
+ inflection{regexp: regexp.MustCompile(strings.Title(value.plural) + "$"), replace: strings.Title(value.singular)},
+ inflection{regexp: regexp.MustCompile(value.plural + "$"), replace: value.singular},
+ }
+ compiledSingularMaps = append(compiledSingularMaps, infs...)
+ }
+
+ for i := len(pluralInflections) - 1; i >= 0; i-- {
+ value := pluralInflections[i]
+ infs := []inflection{
+ inflection{regexp: regexp.MustCompile(strings.ToUpper(value.find)), replace: strings.ToUpper(value.replace)},
+ inflection{regexp: regexp.MustCompile(value.find), replace: value.replace},
+ inflection{regexp: regexp.MustCompile("(?i)" + value.find), replace: value.replace},
+ }
+ compiledPluralMaps = append(compiledPluralMaps, infs...)
+ }
+
+ for i := len(singularInflections) - 1; i >= 0; i-- {
+ value := singularInflections[i]
+ infs := []inflection{
+ inflection{regexp: regexp.MustCompile(strings.ToUpper(value.find)), replace: strings.ToUpper(value.replace)},
+ inflection{regexp: regexp.MustCompile(value.find), replace: value.replace},
+ inflection{regexp: regexp.MustCompile("(?i)" + value.find), replace: value.replace},
+ }
+ compiledSingularMaps = append(compiledSingularMaps, infs...)
+ }
+}
+
+func init() {
+ compile()
+}
+
+// AddPlural adds a plural inflection
+func AddPlural(find, replace string) {
+ pluralInflections = append(pluralInflections, Regular{find, replace})
+ compile()
+}
+
+// AddSingular adds a singular inflection
+func AddSingular(find, replace string) {
+ singularInflections = append(singularInflections, Regular{find, replace})
+ compile()
+}
+
+// AddIrregular adds an irregular inflection
+func AddIrregular(singular, plural string) {
+ irregularInflections = append(irregularInflections, Irregular{singular, plural})
+ compile()
+}
+
+// AddUncountable adds an uncountable inflection
+func AddUncountable(values ...string) {
+ uncountableInflections = append(uncountableInflections, values...)
+ compile()
+}
+
+// GetPlural retrieves the plural inflection values
+func GetPlural() RegularSlice {
+ plurals := make(RegularSlice, len(pluralInflections))
+ copy(plurals, pluralInflections)
+ return plurals
+}
+
+// GetSingular retrieves the singular inflection values
+func GetSingular() RegularSlice {
+ singulars := make(RegularSlice, len(singularInflections))
+ copy(singulars, singularInflections)
+ return singulars
+}
+
+// GetIrregular retrieves the irregular inflection values
+func GetIrregular() IrregularSlice {
+ irregular := make(IrregularSlice, len(irregularInflections))
+ copy(irregular, irregularInflections)
+ return irregular
+}
+
+// GetUncountable retrieves the uncountable inflection values
+func GetUncountable() []string {
+ uncountables := make([]string, len(uncountableInflections))
+ copy(uncountables, uncountableInflections)
+ return uncountables
+}
+
+// SetPlural sets the plural inflections slice
+func SetPlural(inflections RegularSlice) {
+ pluralInflections = inflections
+ compile()
+}
+
+// SetSingular sets the singular inflections slice
+func SetSingular(inflections RegularSlice) {
+ singularInflections = inflections
+ compile()
+}
+
+// SetIrregular sets the irregular inflections slice
+func SetIrregular(inflections IrregularSlice) {
+ irregularInflections = inflections
+ compile()
+}
+
+// SetUncountable sets the uncountable inflections slice
+func SetUncountable(inflections []string) {
+ uncountableInflections = inflections
+ compile()
+}
+
+// Plural converts a word to its plural form
+func Plural(str string) string {
+ for _, inflection := range compiledPluralMaps {
+ if inflection.regexp.MatchString(str) {
+ return inflection.regexp.ReplaceAllString(str, inflection.replace)
+ }
+ }
+ return str
+}
+
+// Singular converts a word to its singular form
+func Singular(str string) string {
+ for _, inflection := range compiledSingularMaps {
+ if inflection.regexp.MatchString(str) {
+ return inflection.regexp.ReplaceAllString(str, inflection.replace)
+ }
+ }
+ return str
+}
diff --git a/archive/vendor/github.com/jinzhu/inflection/wercker.yml b/archive/vendor/github.com/jinzhu/inflection/wercker.yml
new file mode 100644
index 0000000..5e6ce98
--- /dev/null
+++ b/archive/vendor/github.com/jinzhu/inflection/wercker.yml
@@ -0,0 +1,23 @@
+box: golang
+
+build:
+ steps:
+ - setup-go-workspace
+
+ # Gets the dependencies
+ - script:
+ name: go get
+ code: |
+ go get
+
+ # Build the project
+ - script:
+ name: go build
+ code: |
+ go build ./...
+
+ # Test the project
+ - script:
+ name: go test
+ code: |
+ go test ./...
diff --git a/archive/vendor/github.com/jinzhu/now/Guardfile b/archive/vendor/github.com/jinzhu/now/Guardfile
new file mode 100644
index 0000000..0b860b0
--- /dev/null
+++ b/archive/vendor/github.com/jinzhu/now/Guardfile
@@ -0,0 +1,3 @@
+guard 'gotest' do
+ watch(%r{\.go$})
+end
diff --git a/archive/vendor/github.com/jinzhu/now/License b/archive/vendor/github.com/jinzhu/now/License
new file mode 100644
index 0000000..037e165
--- /dev/null
+++ b/archive/vendor/github.com/jinzhu/now/License
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2013-NOW Jinzhu
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/archive/vendor/github.com/jinzhu/now/README.md b/archive/vendor/github.com/jinzhu/now/README.md
new file mode 100644
index 0000000..e81d31d
--- /dev/null
+++ b/archive/vendor/github.com/jinzhu/now/README.md
@@ -0,0 +1,137 @@
+## Now
+
+Now is a time toolkit for golang
+
+[](https://goreportcard.com/report/github.com/jinzhu/now)
+[](https://github.com/jinzhu/now/actions)
+[](https://opensource.org/licenses/MIT)
+
+## Install
+
+```
+go get -u github.com/jinzhu/now
+```
+
+## Usage
+
+Calculating time based on current time
+
+```go
+import "github.com/jinzhu/now"
+
+time.Now() // 2013-11-18 17:51:49.123456789 Mon
+
+now.BeginningOfMinute() // 2013-11-18 17:51:00 Mon
+now.BeginningOfHour() // 2013-11-18 17:00:00 Mon
+now.BeginningOfDay() // 2013-11-18 00:00:00 Mon
+now.BeginningOfWeek() // 2013-11-17 00:00:00 Sun
+now.BeginningOfMonth() // 2013-11-01 00:00:00 Fri
+now.BeginningOfQuarter() // 2013-10-01 00:00:00 Tue
+now.BeginningOfYear() // 2013-01-01 00:00:00 Tue
+
+now.EndOfMinute() // 2013-11-18 17:51:59.999999999 Mon
+now.EndOfHour() // 2013-11-18 17:59:59.999999999 Mon
+now.EndOfDay() // 2013-11-18 23:59:59.999999999 Mon
+now.EndOfWeek() // 2013-11-23 23:59:59.999999999 Sat
+now.EndOfMonth() // 2013-11-30 23:59:59.999999999 Sat
+now.EndOfQuarter() // 2013-12-31 23:59:59.999999999 Tue
+now.EndOfYear() // 2013-12-31 23:59:59.999999999 Tue
+
+now.WeekStartDay = time.Monday // Set Monday as first day, default is Sunday
+now.EndOfWeek() // 2013-11-24 23:59:59.999999999 Sun
+```
+
+Calculating time based on another time
+
+```go
+t := time.Date(2013, 02, 18, 17, 51, 49, 123456789, time.Now().Location())
+now.With(t).EndOfMonth() // 2013-02-28 23:59:59.999999999 Thu
+```
+
+Calculating time based on configuration
+
+```go
+location, err := time.LoadLocation("Asia/Shanghai")
+
+myConfig := &now.Config{
+ WeekStartDay: time.Monday,
+ TimeLocation: location,
+ TimeFormats: []string{"2006-01-02 15:04:05"},
+}
+
+t := time.Date(2013, 11, 18, 17, 51, 49, 123456789, time.Now().Location()) // // 2013-11-18 17:51:49.123456789 Mon
+myConfig.With(t).BeginningOfWeek() // 2013-11-18 00:00:00 Mon
+
+myConfig.Parse("2002-10-12 22:14:01") // 2002-10-12 22:14:01
+myConfig.Parse("2002-10-12 22:14") // returns error 'can't parse string as time: 2002-10-12 22:14'
+```
+
+### Monday/Sunday
+
+Don't be bothered with the `WeekStartDay` setting, you can use `Monday`, `Sunday`
+
+```go
+now.Monday() // 2013-11-18 00:00:00 Mon
+now.Monday("17:44") // 2013-11-18 17:44:00 Mon
+now.Sunday() // 2013-11-24 00:00:00 Sun (Next Sunday)
+now.Sunday("18:19:24") // 2013-11-24 18:19:24 Sun (Next Sunday)
+now.EndOfSunday() // 2013-11-24 23:59:59.999999999 Sun (End of next Sunday)
+
+t := time.Date(2013, 11, 24, 17, 51, 49, 123456789, time.Now().Location()) // 2013-11-24 17:51:49.123456789 Sun
+now.With(t).Monday() // 2013-11-18 00:00:00 Mon (Last Monday if today is Sunday)
+now.With(t).Monday("17:44") // 2013-11-18 17:44:00 Mon (Last Monday if today is Sunday)
+now.With(t).Sunday() // 2013-11-24 00:00:00 Sun (Beginning Of Today if today is Sunday)
+now.With(t).Sunday("18:19:24") // 2013-11-24 18:19:24 Sun (Beginning Of Today if today is Sunday)
+now.With(t).EndOfSunday() // 2013-11-24 23:59:59.999999999 Sun (End of Today if today is Sunday)
+```
+
+### Parse String to Time
+
+```go
+time.Now() // 2013-11-18 17:51:49.123456789 Mon
+
+// Parse(string) (time.Time, error)
+t, err := now.Parse("2017") // 2017-01-01 00:00:00, nil
+t, err := now.Parse("2017-10") // 2017-10-01 00:00:00, nil
+t, err := now.Parse("2017-10-13") // 2017-10-13 00:00:00, nil
+t, err := now.Parse("1999-12-12 12") // 1999-12-12 12:00:00, nil
+t, err := now.Parse("1999-12-12 12:20") // 1999-12-12 12:20:00, nil
+t, err := now.Parse("1999-12-12 12:20:21") // 1999-12-12 12:20:21, nil
+t, err := now.Parse("10-13") // 2013-10-13 00:00:00, nil
+t, err := now.Parse("12:20") // 2013-11-18 12:20:00, nil
+t, err := now.Parse("12:20:13") // 2013-11-18 12:20:13, nil
+t, err := now.Parse("14") // 2013-11-18 14:00:00, nil
+t, err := now.Parse("99:99") // 2013-11-18 12:20:00, Can't parse string as time: 99:99
+
+// MustParse must parse string to time or it will panic
+now.MustParse("2013-01-13") // 2013-01-13 00:00:00
+now.MustParse("02-17") // 2013-02-17 00:00:00
+now.MustParse("2-17") // 2013-02-17 00:00:00
+now.MustParse("8") // 2013-11-18 08:00:00
+now.MustParse("2002-10-12 22:14") // 2002-10-12 22:14:00
+now.MustParse("99:99") // panic: Can't parse string as time: 99:99
+```
+
+Extend `now` to support more formats is quite easy, just update `now.TimeFormats` with other time layouts, e.g:
+
+```go
+now.TimeFormats = append(now.TimeFormats, "02 Jan 2006 15:04")
+```
+
+Please send me pull requests if you want a format to be supported officially
+
+## Contributing
+
+You can help to make the project better, check out [http://gorm.io/contribute.html](http://gorm.io/contribute.html) for things you can do.
+
+# Author
+
+**jinzhu**
+
+*
+*
+*
+
+## License
+
+Released under the [MIT License](http://www.opensource.org/licenses/MIT).
diff --git a/archive/vendor/github.com/jinzhu/now/main.go b/archive/vendor/github.com/jinzhu/now/main.go
new file mode 100644
index 0000000..8f78bc7
--- /dev/null
+++ b/archive/vendor/github.com/jinzhu/now/main.go
@@ -0,0 +1,200 @@
+// Package now is a time toolkit for golang.
+//
+// More details README here: https://github.com/jinzhu/now
+//
+// import "github.com/jinzhu/now"
+//
+// now.BeginningOfMinute() // 2013-11-18 17:51:00 Mon
+// now.BeginningOfDay() // 2013-11-18 00:00:00 Mon
+// now.EndOfDay() // 2013-11-18 23:59:59.999999999 Mon
+package now
+
+import "time"
+
+// WeekStartDay set week start day, default is sunday
+var WeekStartDay = time.Sunday
+
+// TimeFormats default time formats will be parsed as
+var TimeFormats = []string{
+ "2006", "2006-1", "2006-1-2", "2006-1-2 15", "2006-1-2 15:4", "2006-1-2 15:4:5", "1-2",
+ "15:4:5", "15:4", "15",
+ "15:4:5 Jan 2, 2006 MST", "2006-01-02 15:04:05.999999999 -0700 MST", "2006-01-02T15:04:05Z0700", "2006-01-02T15:04:05Z07",
+ "2006.1.2", "2006.1.2 15:04:05", "2006.01.02", "2006.01.02 15:04:05", "2006.01.02 15:04:05.999999999",
+ "1/2/2006", "1/2/2006 15:4:5", "2006/01/02", "20060102", "2006/01/02 15:04:05",
+ time.ANSIC, time.UnixDate, time.RubyDate, time.RFC822, time.RFC822Z, time.RFC850,
+ time.RFC1123, time.RFC1123Z, time.RFC3339, time.RFC3339Nano,
+ time.Kitchen, time.Stamp, time.StampMilli, time.StampMicro, time.StampNano,
+}
+
+// Config configuration for now package
+type Config struct {
+ WeekStartDay time.Weekday
+ TimeLocation *time.Location
+ TimeFormats []string
+}
+
+// DefaultConfig default config
+var DefaultConfig *Config
+
+// New initialize Now based on configuration
+func (config *Config) With(t time.Time) *Now {
+ return &Now{Time: t, Config: config}
+}
+
+// Parse parse string to time based on configuration
+func (config *Config) Parse(strs ...string) (time.Time, error) {
+ if config.TimeLocation == nil {
+ return config.With(time.Now()).Parse(strs...)
+ } else {
+ return config.With(time.Now().In(config.TimeLocation)).Parse(strs...)
+ }
+}
+
+// MustParse must parse string to time or will panic
+func (config *Config) MustParse(strs ...string) time.Time {
+ if config.TimeLocation == nil {
+ return config.With(time.Now()).MustParse(strs...)
+ } else {
+ return config.With(time.Now().In(config.TimeLocation)).MustParse(strs...)
+ }
+}
+
+// Now now struct
+type Now struct {
+ time.Time
+ *Config
+}
+
+// With initialize Now with time
+func With(t time.Time) *Now {
+ config := DefaultConfig
+ if config == nil {
+ config = &Config{
+ WeekStartDay: WeekStartDay,
+ TimeFormats: TimeFormats,
+ }
+ }
+
+ return &Now{Time: t, Config: config}
+}
+
+// New initialize Now with time
+func New(t time.Time) *Now {
+ return With(t)
+}
+
+// BeginningOfMinute beginning of minute
+func BeginningOfMinute() time.Time {
+ return With(time.Now()).BeginningOfMinute()
+}
+
+// BeginningOfHour beginning of hour
+func BeginningOfHour() time.Time {
+ return With(time.Now()).BeginningOfHour()
+}
+
+// BeginningOfDay beginning of day
+func BeginningOfDay() time.Time {
+ return With(time.Now()).BeginningOfDay()
+}
+
+// BeginningOfWeek beginning of week
+func BeginningOfWeek() time.Time {
+ return With(time.Now()).BeginningOfWeek()
+}
+
+// BeginningOfMonth beginning of month
+func BeginningOfMonth() time.Time {
+ return With(time.Now()).BeginningOfMonth()
+}
+
+// BeginningOfQuarter beginning of quarter
+func BeginningOfQuarter() time.Time {
+ return With(time.Now()).BeginningOfQuarter()
+}
+
+// BeginningOfYear beginning of year
+func BeginningOfYear() time.Time {
+ return With(time.Now()).BeginningOfYear()
+}
+
+// EndOfMinute end of minute
+func EndOfMinute() time.Time {
+ return With(time.Now()).EndOfMinute()
+}
+
+// EndOfHour end of hour
+func EndOfHour() time.Time {
+ return With(time.Now()).EndOfHour()
+}
+
+// EndOfDay end of day
+func EndOfDay() time.Time {
+ return With(time.Now()).EndOfDay()
+}
+
+// EndOfWeek end of week
+func EndOfWeek() time.Time {
+ return With(time.Now()).EndOfWeek()
+}
+
+// EndOfMonth end of month
+func EndOfMonth() time.Time {
+ return With(time.Now()).EndOfMonth()
+}
+
+// EndOfQuarter end of quarter
+func EndOfQuarter() time.Time {
+ return With(time.Now()).EndOfQuarter()
+}
+
+// EndOfYear end of year
+func EndOfYear() time.Time {
+ return With(time.Now()).EndOfYear()
+}
+
+// Monday monday
+
+func Monday(strs ...string) time.Time {
+ return With(time.Now()).Monday(strs...)
+}
+
+// Sunday sunday
+func Sunday(strs ...string) time.Time {
+ return With(time.Now()).Sunday(strs...)
+}
+
+// EndOfSunday end of sunday
+func EndOfSunday() time.Time {
+ return With(time.Now()).EndOfSunday()
+}
+
+// Quarter returns the yearly quarter
+func Quarter() uint {
+ return With(time.Now()).Quarter()
+}
+
+// Parse parse string to time
+func Parse(strs ...string) (time.Time, error) {
+ return With(time.Now()).Parse(strs...)
+}
+
+// ParseInLocation parse string to time in location
+func ParseInLocation(loc *time.Location, strs ...string) (time.Time, error) {
+ return With(time.Now().In(loc)).Parse(strs...)
+}
+
+// MustParse must parse string to time or will panic
+func MustParse(strs ...string) time.Time {
+ return With(time.Now()).MustParse(strs...)
+}
+
+// MustParseInLocation must parse string to time in location or will panic
+func MustParseInLocation(loc *time.Location, strs ...string) time.Time {
+ return With(time.Now().In(loc)).MustParse(strs...)
+}
+
+// Between check now between the begin, end time or not
+func Between(time1, time2 string) bool {
+ return With(time.Now()).Between(time1, time2)
+}
diff --git a/archive/vendor/github.com/jinzhu/now/now.go b/archive/vendor/github.com/jinzhu/now/now.go
new file mode 100644
index 0000000..2f524cc
--- /dev/null
+++ b/archive/vendor/github.com/jinzhu/now/now.go
@@ -0,0 +1,245 @@
+package now
+
+import (
+ "errors"
+ "regexp"
+ "time"
+)
+
+// BeginningOfMinute beginning of minute
+func (now *Now) BeginningOfMinute() time.Time {
+ return now.Truncate(time.Minute)
+}
+
+// BeginningOfHour beginning of hour
+func (now *Now) BeginningOfHour() time.Time {
+ y, m, d := now.Date()
+ return time.Date(y, m, d, now.Time.Hour(), 0, 0, 0, now.Time.Location())
+}
+
+// BeginningOfDay beginning of day
+func (now *Now) BeginningOfDay() time.Time {
+ y, m, d := now.Date()
+ return time.Date(y, m, d, 0, 0, 0, 0, now.Time.Location())
+}
+
+// BeginningOfWeek beginning of week
+func (now *Now) BeginningOfWeek() time.Time {
+ t := now.BeginningOfDay()
+ weekday := int(t.Weekday())
+
+ if now.WeekStartDay != time.Sunday {
+ weekStartDayInt := int(now.WeekStartDay)
+
+ if weekday < weekStartDayInt {
+ weekday = weekday + 7 - weekStartDayInt
+ } else {
+ weekday = weekday - weekStartDayInt
+ }
+ }
+ return t.AddDate(0, 0, -weekday)
+}
+
+// BeginningOfMonth beginning of month
+func (now *Now) BeginningOfMonth() time.Time {
+ y, m, _ := now.Date()
+ return time.Date(y, m, 1, 0, 0, 0, 0, now.Location())
+}
+
+// BeginningOfQuarter beginning of quarter
+func (now *Now) BeginningOfQuarter() time.Time {
+ month := now.BeginningOfMonth()
+ offset := (int(month.Month()) - 1) % 3
+ return month.AddDate(0, -offset, 0)
+}
+
+// BeginningOfHalf beginning of half year
+func (now *Now) BeginningOfHalf() time.Time {
+ month := now.BeginningOfMonth()
+ offset := (int(month.Month()) - 1) % 6
+ return month.AddDate(0, -offset, 0)
+}
+
+// BeginningOfYear BeginningOfYear beginning of year
+func (now *Now) BeginningOfYear() time.Time {
+ y, _, _ := now.Date()
+ return time.Date(y, time.January, 1, 0, 0, 0, 0, now.Location())
+}
+
+// EndOfMinute end of minute
+func (now *Now) EndOfMinute() time.Time {
+ return now.BeginningOfMinute().Add(time.Minute - time.Nanosecond)
+}
+
+// EndOfHour end of hour
+func (now *Now) EndOfHour() time.Time {
+ return now.BeginningOfHour().Add(time.Hour - time.Nanosecond)
+}
+
+// EndOfDay end of day
+func (now *Now) EndOfDay() time.Time {
+ y, m, d := now.Date()
+ return time.Date(y, m, d, 23, 59, 59, int(time.Second-time.Nanosecond), now.Location())
+}
+
+// EndOfWeek end of week
+func (now *Now) EndOfWeek() time.Time {
+ return now.BeginningOfWeek().AddDate(0, 0, 7).Add(-time.Nanosecond)
+}
+
+// EndOfMonth end of month
+func (now *Now) EndOfMonth() time.Time {
+ return now.BeginningOfMonth().AddDate(0, 1, 0).Add(-time.Nanosecond)
+}
+
+// EndOfQuarter end of quarter
+func (now *Now) EndOfQuarter() time.Time {
+ return now.BeginningOfQuarter().AddDate(0, 3, 0).Add(-time.Nanosecond)
+}
+
+// EndOfHalf end of half year
+func (now *Now) EndOfHalf() time.Time {
+ return now.BeginningOfHalf().AddDate(0, 6, 0).Add(-time.Nanosecond)
+}
+
+// EndOfYear end of year
+func (now *Now) EndOfYear() time.Time {
+ return now.BeginningOfYear().AddDate(1, 0, 0).Add(-time.Nanosecond)
+}
+
+// Monday monday
+/*
+func (now *Now) Monday() time.Time {
+ t := now.BeginningOfDay()
+ weekday := int(t.Weekday())
+ if weekday == 0 {
+ weekday = 7
+ }
+ return t.AddDate(0, 0, -weekday+1)
+}
+*/
+
+func (now *Now) Monday(strs ...string) time.Time {
+ var parseTime time.Time
+ var err error
+ if len(strs) > 0 {
+ parseTime, err = now.Parse(strs...)
+ if err != nil {
+ panic(err)
+ }
+ } else {
+ parseTime = now.BeginningOfDay()
+ }
+ weekday := int(parseTime.Weekday())
+ if weekday == 0 {
+ weekday = 7
+ }
+ return parseTime.AddDate(0, 0, -weekday+1)
+}
+
+func (now *Now) Sunday(strs ...string) time.Time {
+ var parseTime time.Time
+ var err error
+ if len(strs) > 0 {
+ parseTime, err = now.Parse(strs...)
+ if err != nil {
+ panic(err)
+ }
+ } else {
+ parseTime = now.BeginningOfDay()
+ }
+ weekday := int(parseTime.Weekday())
+ if weekday == 0 {
+ weekday = 7
+ }
+ return parseTime.AddDate(0, 0, (7 - weekday))
+}
+
+// EndOfSunday end of sunday
+func (now *Now) EndOfSunday() time.Time {
+ return New(now.Sunday()).EndOfDay()
+}
+
+// Quarter returns the yearly quarter
+func (now *Now) Quarter() uint {
+ return (uint(now.Month())-1)/3 + 1
+}
+
+func (now *Now) parseWithFormat(str string, location *time.Location) (t time.Time, err error) {
+ for _, format := range now.TimeFormats {
+ t, err = time.ParseInLocation(format, str, location)
+
+ if err == nil {
+ return
+ }
+ }
+ err = errors.New("Can't parse string as time: " + str)
+ return
+}
+
+var hasTimeRegexp = regexp.MustCompile(`(\s+|^\s*|T)\d{1,2}((:\d{1,2})*|((:\d{1,2}){2}\.(\d{3}|\d{6}|\d{9})))(\s*$|[Z+-])`) // match 15:04:05, 15:04:05.000, 15:04:05.000000 15, 2017-01-01 15:04, 2021-07-20T00:59:10Z, 2021-07-20T00:59:10+08:00, 2021-07-20T00:00:10-07:00 etc
+var onlyTimeRegexp = regexp.MustCompile(`^\s*\d{1,2}((:\d{1,2})*|((:\d{1,2}){2}\.(\d{3}|\d{6}|\d{9})))\s*$`) // match 15:04:05, 15, 15:04:05.000, 15:04:05.000000, etc
+
+// Parse parse string to time
+func (now *Now) Parse(strs ...string) (t time.Time, err error) {
+ var (
+ setCurrentTime bool
+ parseTime []int
+ currentLocation = now.Location()
+ onlyTimeInStr = true
+ currentTime = formatTimeToList(now.Time)
+ )
+
+ for _, str := range strs {
+ hasTimeInStr := hasTimeRegexp.MatchString(str) // match 15:04:05, 15
+ onlyTimeInStr = hasTimeInStr && onlyTimeInStr && onlyTimeRegexp.MatchString(str)
+ if t, err = now.parseWithFormat(str, currentLocation); err == nil {
+ location := t.Location()
+ parseTime = formatTimeToList(t)
+
+ for i, v := range parseTime {
+ // Don't reset hour, minute, second if current time str including time
+ if hasTimeInStr && i <= 3 {
+ continue
+ }
+
+ // If value is zero, replace it with current time
+ if v == 0 {
+ if setCurrentTime {
+ parseTime[i] = currentTime[i]
+ }
+ } else {
+ setCurrentTime = true
+ }
+
+ // if current time only includes time, should change day, month to current time
+ if onlyTimeInStr {
+ if i == 4 || i == 5 {
+ parseTime[i] = currentTime[i]
+ continue
+ }
+ }
+ }
+
+ t = time.Date(parseTime[6], time.Month(parseTime[5]), parseTime[4], parseTime[3], parseTime[2], parseTime[1], parseTime[0], location)
+ currentTime = formatTimeToList(t)
+ }
+ }
+ return
+}
+
+// MustParse must parse string to time or it will panic
+func (now *Now) MustParse(strs ...string) (t time.Time) {
+ t, err := now.Parse(strs...)
+ if err != nil {
+ panic(err)
+ }
+ return t
+}
+
+// Between check time between the begin, end time or not
+func (now *Now) Between(begin, end string) bool {
+ beginTime := now.MustParse(begin)
+ endTime := now.MustParse(end)
+ return now.After(beginTime) && now.Before(endTime)
+}
diff --git a/archive/vendor/github.com/jinzhu/now/time.go b/archive/vendor/github.com/jinzhu/now/time.go
new file mode 100644
index 0000000..52dd8b2
--- /dev/null
+++ b/archive/vendor/github.com/jinzhu/now/time.go
@@ -0,0 +1,9 @@
+package now
+
+import "time"
+
+func formatTimeToList(t time.Time) []int {
+ hour, min, sec := t.Clock()
+ year, month, day := t.Date()
+ return []int{t.Nanosecond(), sec, min, hour, day, int(month), year}
+}
diff --git a/archive/vendor/github.com/mattn/go-sqlite3/.codecov.yml b/archive/vendor/github.com/mattn/go-sqlite3/.codecov.yml
new file mode 100644
index 0000000..35cde5c
--- /dev/null
+++ b/archive/vendor/github.com/mattn/go-sqlite3/.codecov.yml
@@ -0,0 +1,4 @@
+coverage:
+ status:
+ project: off
+ patch: off
diff --git a/archive/vendor/github.com/mattn/go-sqlite3/.gitignore b/archive/vendor/github.com/mattn/go-sqlite3/.gitignore
new file mode 100644
index 0000000..fa0e6b5
--- /dev/null
+++ b/archive/vendor/github.com/mattn/go-sqlite3/.gitignore
@@ -0,0 +1,14 @@
+*.db
+*.exe
+*.dll
+*.o
+
+# VSCode
+.vscode
+
+# Exclude from upgrade
+upgrade/*.c
+upgrade/*.h
+
+# Exclude upgrade binary
+upgrade/upgrade
diff --git a/archive/vendor/github.com/mattn/go-sqlite3/LICENSE b/archive/vendor/github.com/mattn/go-sqlite3/LICENSE
new file mode 100644
index 0000000..ca458bb
--- /dev/null
+++ b/archive/vendor/github.com/mattn/go-sqlite3/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2014 Yasuhiro Matsumoto
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/archive/vendor/github.com/mattn/go-sqlite3/README.md b/archive/vendor/github.com/mattn/go-sqlite3/README.md
new file mode 100644
index 0000000..76f49ba
--- /dev/null
+++ b/archive/vendor/github.com/mattn/go-sqlite3/README.md
@@ -0,0 +1,600 @@
+go-sqlite3
+==========
+
+[](https://pkg.go.dev/github.com/mattn/go-sqlite3)
+[](https://github.com/mattn/go-sqlite3/actions?query=workflow%3AGo)
+[](https://opencollective.com/mattn-go-sqlite3)
+[](https://codecov.io/gh/mattn/go-sqlite3)
+[](https://goreportcard.com/report/github.com/mattn/go-sqlite3)
+
+Latest stable version is v1.14 or later, not v2.
+
+~~**NOTE:** The increase to v2 was an accident. There were no major changes or features.~~
+
+# Description
+
+A sqlite3 driver that conforms to the built-in database/sql interface.
+
+Supported Golang version: See [.github/workflows/go.yaml](./.github/workflows/go.yaml).
+
+This package follows the official [Golang Release Policy](https://golang.org/doc/devel/release.html#policy).
+
+### Overview
+
+- [go-sqlite3](#go-sqlite3)
+- [Description](#description)
+ - [Overview](#overview)
+- [Installation](#installation)
+- [API Reference](#api-reference)
+- [Connection String](#connection-string)
+ - [DSN Examples](#dsn-examples)
+- [Features](#features)
+ - [Usage](#usage)
+ - [Feature / Extension List](#feature--extension-list)
+- [Compilation](#compilation)
+ - [Android](#android)
+- [ARM](#arm)
+- [Cross Compile](#cross-compile)
+- [Compiling](#compiling)
+ - [Linux](#linux)
+ - [Alpine](#alpine)
+ - [Fedora](#fedora)
+ - [Ubuntu](#ubuntu)
+ - [macOS](#mac-osx)
+ - [Windows](#windows)
+ - [Errors](#errors)
+- [User Authentication](#user-authentication)
+ - [Compile](#compile)
+ - [Usage](#usage-1)
+ - [Create protected database](#create-protected-database)
+ - [Password Encoding](#password-encoding)
+ - [Available Encoders](#available-encoders)
+ - [Restrictions](#restrictions)
+ - [Support](#support)
+ - [User Management](#user-management)
+ - [SQL](#sql)
+ - [Examples](#examples)
+ - [*SQLiteConn](#sqliteconn)
+ - [Attached database](#attached-database)
+- [Extensions](#extensions)
+ - [Spatialite](#spatialite)
+- [FAQ](#faq)
+- [License](#license)
+- [Author](#author)
+
+# Installation
+
+This package can be installed with the `go get` command:
+
+ go get github.com/mattn/go-sqlite3
+
+_go-sqlite3_ is *cgo* package.
+If you want to build your app using go-sqlite3, you need gcc.
+
+***Important: because this is a `CGO` enabled package, you are required to set the environment variable `CGO_ENABLED=1` and have a `gcc` compiler present within your path.***
+
+# API Reference
+
+API documentation can be found [here](http://godoc.org/github.com/mattn/go-sqlite3).
+
+Examples can be found under the [examples](./_example) directory.
+
+# Connection String
+
+When creating a new SQLite database or connection to an existing one, with the file name additional options can be given.
+This is also known as a DSN (Data Source Name) string.
+
+Options are append after the filename of the SQLite database.
+The database filename and options are separated by an `?` (Question Mark).
+Options should be URL-encoded (see [url.QueryEscape](https://golang.org/pkg/net/url/#QueryEscape)).
+
+This also applies when using an in-memory database instead of a file.
+
+Options can be given using the following format: `KEYWORD=VALUE` and multiple options can be combined with the `&` ampersand.
+
+This library supports DSN options of SQLite itself and provides additional options.
+
+Boolean values can be one of:
+* `0` `no` `false` `off`
+* `1` `yes` `true` `on`
+
+| Name | Key | Value(s) | Description |
+|------|-----|----------|-------------|
+| UA - Create | `_auth` | - | Create User Authentication, for more information see [User Authentication](#user-authentication) |
+| UA - Username | `_auth_user` | `string` | Username for User Authentication, for more information see [User Authentication](#user-authentication) |
+| UA - Password | `_auth_pass` | `string` | Password for User Authentication, for more information see [User Authentication](#user-authentication) |
+| UA - Crypt | `_auth_crypt` | SHA1 SSHA1 SHA256 SSHA256 SHA384 SSHA384 SHA512 SSHA512 | Password encoder to use for User Authentication, for more information see [User Authentication](#user-authentication) |
+| UA - Salt | `_auth_salt` | `string` | Salt to use if the configure password encoder requires a salt, for User Authentication, for more information see [User Authentication](#user-authentication) |
+| Auto Vacuum | `_auto_vacuum` \| `_vacuum` | `0` \| `none` `1` \| `full` `2` \| `incremental` | For more information see [PRAGMA auto_vacuum](https://www.sqlite.org/pragma.html#pragma_auto_vacuum) |
+| Busy Timeout | `_busy_timeout` \| `_timeout` | `int` | Specify value for sqlite3_busy_timeout. For more information see [PRAGMA busy_timeout](https://www.sqlite.org/pragma.html#pragma_busy_timeout) |
+| Case Sensitive LIKE | `_case_sensitive_like` \| `_cslike` | `boolean` | For more information see [PRAGMA case_sensitive_like](https://www.sqlite.org/pragma.html#pragma_case_sensitive_like) |
+| Defer Foreign Keys | `_defer_foreign_keys` \| `_defer_fk` | `boolean` | For more information see [PRAGMA defer_foreign_keys](https://www.sqlite.org/pragma.html#pragma_defer_foreign_keys) |
+| Foreign Keys | `_foreign_keys` \| `_fk` | `boolean` | For more information see [PRAGMA foreign_keys](https://www.sqlite.org/pragma.html#pragma_foreign_keys) |
+| Ignore CHECK Constraints | `_ignore_check_constraints` | `boolean` | For more information see [PRAGMA ignore_check_constraints](https://www.sqlite.org/pragma.html#pragma_ignore_check_constraints) |
+| Immutable | `immutable` | `boolean` | For more information see [Immutable](https://www.sqlite.org/c3ref/open.html) |
+| Journal Mode | `_journal_mode` \| `_journal` | DELETE TRUNCATE PERSIST MEMORY WAL OFF | For more information see [PRAGMA journal_mode](https://www.sqlite.org/pragma.html#pragma_journal_mode) |
+| Locking Mode | `_locking_mode` \| `_locking` | | For more information see [PRAGMA locking_mode](https://www.sqlite.org/pragma.html#pragma_locking_mode) |
+| Mode | `mode` | | Access Mode of the database. For more information see [SQLite Open](https://www.sqlite.org/c3ref/open.html) |
+| Mutex Locking | `_mutex` | | Specify mutex mode. |
+| Query Only | `_query_only` | `boolean` | For more information see [PRAGMA query_only](https://www.sqlite.org/pragma.html#pragma_query_only) |
+| Recursive Triggers | `_recursive_triggers` \| `_rt` | `boolean` | For more information see [PRAGMA recursive_triggers](https://www.sqlite.org/pragma.html#pragma_recursive_triggers) |
+| Secure Delete | `_secure_delete` | `boolean` \| `FAST` | For more information see [PRAGMA secure_delete](https://www.sqlite.org/pragma.html#pragma_secure_delete) |
+| Shared-Cache Mode | `cache` | | Set cache mode for more information see [sqlite.org](https://www.sqlite.org/sharedcache.html) |
+| Synchronous | `_synchronous` \| `_sync` | 0 \| OFF 1 \| NORMAL 2 \| FULL 3 \| EXTRA | For more information see [PRAGMA synchronous](https://www.sqlite.org/pragma.html#pragma_synchronous) |
+| Time Zone Location | `_loc` | auto | Specify location of time format. |
+| Transaction Lock | `_txlock` | immediate deferred exclusive | Specify locking behavior for transactions. |
+| Writable Schema | `_writable_schema` | `Boolean` | When this pragma is on, the SQLITE_MASTER tables in which database can be changed using ordinary UPDATE, INSERT, and DELETE statements. Warning: misuse of this pragma can easily result in a corrupt database file. |
+| Cache Size | `_cache_size` | `int` | Maximum cache size; default is 2000K (2M). See [PRAGMA cache_size](https://sqlite.org/pragma.html#pragma_cache_size) |
+
+
+## DSN Examples
+
+```
+file:test.db?cache=shared&mode=memory
+```
+
+# Features
+
+This package allows additional configuration of features available within SQLite3 to be enabled or disabled by golang build constraints also known as build `tags`.
+
+Click [here](https://golang.org/pkg/go/build/#hdr-Build_Constraints) for more information about build tags / constraints.
+
+### Usage
+
+If you wish to build this library with additional extensions / features, use the following command:
+
+```bash
+go build -tags ""
+```
+
+For available features, see the extension list.
+When using multiple build tags, all the different tags should be space delimited.
+
+Example:
+
+```bash
+go build -tags "icu json1 fts5 secure_delete"
+```
+
+### Feature / Extension List
+
+| Extension | Build Tag | Description |
+|-----------|-----------|-------------|
+| Additional Statistics | sqlite_stat4 | This option adds additional logic to the ANALYZE command and to the query planner that can help SQLite to chose a better query plan under certain situations. The ANALYZE command is enhanced to collect histogram data from all columns of every index and store that data in the sqlite_stat4 table. The query planner will then use the histogram data to help it make better index choices. The downside of this compile-time option is that it violates the query planner stability guarantee making it more difficult to ensure consistent performance in mass-produced applications. SQLITE_ENABLE_STAT4 is an enhancement of SQLITE_ENABLE_STAT3. STAT3 only recorded histogram data for the left-most column of each index whereas the STAT4 enhancement records histogram data from all columns of each index. The SQLITE_ENABLE_STAT3 compile-time option is a no-op and is ignored if the SQLITE_ENABLE_STAT4 compile-time option is used |
+| Allow URI Authority | sqlite_allow_uri_authority | URI filenames normally throws an error if the authority section is not either empty or "localhost". However, if SQLite is compiled with the SQLITE_ALLOW_URI_AUTHORITY compile-time option, then the URI is converted into a Uniform Naming Convention (UNC) filename and passed down to the underlying operating system that way |
+| App Armor | sqlite_app_armor | When defined, this C-preprocessor macro activates extra code that attempts to detect misuse of the SQLite API, such as passing in NULL pointers to required parameters or using objects after they have been destroyed. App Armor is not available under `Windows`. |
+| Disable Load Extensions | sqlite_omit_load_extension | Loading of external extensions is enabled by default. To disable extension loading add the build tag `sqlite_omit_load_extension`. |
+| Enable Serialization with `libsqlite3` | sqlite_serialize | Serialization and deserialization of a SQLite database is available by default, unless the build tag `libsqlite3` is set. To enable this functionality even if `libsqlite3` is set, add the build tag `sqlite_serialize`. |
+| Foreign Keys | sqlite_foreign_keys | This macro determines whether enforcement of foreign key constraints is enabled or disabled by default for new database connections. Each database connection can always turn enforcement of foreign key constraints on and off and run-time using the foreign_keys pragma. Enforcement of foreign key constraints is normally off by default, but if this compile-time parameter is set to 1, enforcement of foreign key constraints will be on by default |
+| Full Auto Vacuum | sqlite_vacuum_full | Set the default auto vacuum to full |
+| Incremental Auto Vacuum | sqlite_vacuum_incr | Set the default auto vacuum to incremental |
+| Full Text Search Engine | sqlite_fts5 | When this option is defined in the amalgamation, versions 5 of the full-text search engine (fts5) is added to the build automatically |
+| International Components for Unicode | sqlite_icu | This option causes the International Components for Unicode or "ICU" extension to SQLite to be added to the build |
+| Introspect PRAGMAS | sqlite_introspect | This option adds some extra PRAGMA statements. PRAGMA function_list PRAGMA module_list PRAGMA pragma_list |
+| JSON SQL Functions | sqlite_json | When this option is defined in the amalgamation, the JSON SQL functions are added to the build automatically |
+| Math Functions | sqlite_math_functions | This compile-time option enables built-in scalar math functions. For more information see [Built-In Mathematical SQL Functions](https://www.sqlite.org/lang_mathfunc.html) |
+| OS Trace | sqlite_os_trace | This option enables OSTRACE() debug logging. This can be verbose and should not be used in production. |
+| Pre Update Hook | sqlite_preupdate_hook | Registers a callback function that is invoked prior to each INSERT, UPDATE, and DELETE operation on a database table. |
+| Secure Delete | sqlite_secure_delete | This compile-time option changes the default setting of the secure_delete pragma. When this option is not used, secure_delete defaults to off. When this option is present, secure_delete defaults to on. The secure_delete setting causes deleted content to be overwritten with zeros. There is a small performance penalty since additional I/O must occur. On the other hand, secure_delete can prevent fragments of sensitive information from lingering in unused parts of the database file after it has been deleted. See the documentation on the secure_delete pragma for additional information |
+| Secure Delete (FAST) | sqlite_secure_delete_fast | For more information see [PRAGMA secure_delete](https://www.sqlite.org/pragma.html#pragma_secure_delete) |
+| Tracing / Debug | sqlite_trace | Activate trace functions |
+| User Authentication | sqlite_userauth | SQLite User Authentication see [User Authentication](#user-authentication) for more information. |
+| Virtual Tables | sqlite_vtable | SQLite Virtual Tables see [SQLite Official VTABLE Documentation](https://www.sqlite.org/vtab.html) for more information, and a [full example here](https://github.com/mattn/go-sqlite3/tree/master/_example/vtable) |
+
+# Compilation
+
+This package requires the `CGO_ENABLED=1` environment variable if not set by default, and the presence of the `gcc` compiler.
+
+If you need to add additional CFLAGS or LDFLAGS to the build command, and do not want to modify this package, then this can be achieved by using the `CGO_CFLAGS` and `CGO_LDFLAGS` environment variables.
+
+## Android
+
+This package can be compiled for android.
+Compile with:
+
+```bash
+go build -tags "android"
+```
+
+For more information see [#201](https://github.com/mattn/go-sqlite3/issues/201)
+
+# ARM
+
+To compile for `ARM` use the following environment:
+
+```bash
+env CC=arm-linux-gnueabihf-gcc CXX=arm-linux-gnueabihf-g++ \
+ CGO_ENABLED=1 GOOS=linux GOARCH=arm GOARM=7 \
+ go build -v
+```
+
+Additional information:
+- [#242](https://github.com/mattn/go-sqlite3/issues/242)
+- [#504](https://github.com/mattn/go-sqlite3/issues/504)
+
+# Cross Compile
+
+This library can be cross-compiled.
+
+In some cases you are required to the `CC` environment variable with the cross compiler.
+
+## Cross Compiling from macOS
+The simplest way to cross compile from macOS is to use [xgo](https://github.com/karalabe/xgo).
+
+Steps:
+- Install [musl-cross](https://github.com/FiloSottile/homebrew-musl-cross) (`brew install FiloSottile/musl-cross/musl-cross`).
+- Run `CC=x86_64-linux-musl-gcc CXX=x86_64-linux-musl-g++ GOARCH=amd64 GOOS=linux CGO_ENABLED=1 go build -ldflags "-linkmode external -extldflags -static"`.
+
+Please refer to the project's [README](https://github.com/FiloSottile/homebrew-musl-cross#readme) for further information.
+
+# Compiling
+
+## Linux
+
+To compile this package on Linux, you must install the development tools for your linux distribution.
+
+To compile under linux use the build tag `linux`.
+
+```bash
+go build -tags "linux"
+```
+
+If you wish to link directly to libsqlite3 then you can use the `libsqlite3` build tag.
+
+```
+go build -tags "libsqlite3 linux"
+```
+
+### Alpine
+
+When building in an `alpine` container run the following command before building:
+
+```
+apk add --update gcc musl-dev
+```
+
+### Fedora
+
+```bash
+sudo yum groupinstall "Development Tools" "Development Libraries"
+```
+
+### Ubuntu
+
+```bash
+sudo apt-get install build-essential
+```
+
+## macOS
+
+macOS should have all the tools present to compile this package. If not, install XCode to add all the developers tools.
+
+Required dependency:
+
+```bash
+brew install sqlite3
+```
+
+For macOS, there is an additional package to install which is required if you wish to build the `icu` extension.
+
+This additional package can be installed with `homebrew`:
+
+```bash
+brew upgrade icu4c
+```
+
+To compile for macOS on x86:
+
+```bash
+go build -tags "darwin amd64"
+```
+
+To compile for macOS on ARM chips:
+
+```bash
+go build -tags "darwin arm64"
+```
+
+If you wish to link directly to libsqlite3, use the `libsqlite3` build tag:
+
+```
+# x86
+go build -tags "libsqlite3 darwin amd64"
+# ARM
+go build -tags "libsqlite3 darwin arm64"
+```
+
+Additional information:
+- [#206](https://github.com/mattn/go-sqlite3/issues/206)
+- [#404](https://github.com/mattn/go-sqlite3/issues/404)
+
+## Windows
+
+To compile this package on Windows, you must have the `gcc` compiler installed.
+
+1) Install a Windows `gcc` toolchain.
+2) Add the `bin` folder to the Windows path, if the installer did not do this by default.
+3) Open a terminal for the TDM-GCC toolchain, which can be found in the Windows Start menu.
+4) Navigate to your project folder and run the `go build ...` command for this package.
+
+For example the TDM-GCC Toolchain can be found [here](https://jmeubank.github.io/tdm-gcc/).
+
+## Errors
+
+- Compile error: `can not be used when making a shared object; recompile with -fPIC`
+
+ When receiving a compile time error referencing recompile with `-FPIC` then you
+ are probably using a hardend system.
+
+ You can compile the library on a hardend system with the following command.
+
+ ```bash
+ go build -ldflags '-extldflags=-fno-PIC'
+ ```
+
+ More details see [#120](https://github.com/mattn/go-sqlite3/issues/120)
+
+- Can't build go-sqlite3 on windows 64bit.
+
+ > Probably, you are using go 1.0, go1.0 has a problem when it comes to compiling/linking on windows 64bit.
+ > See: [#27](https://github.com/mattn/go-sqlite3/issues/27)
+
+- `go get github.com/mattn/go-sqlite3` throws compilation error.
+
+ `gcc` throws: `internal compiler error`
+
+ Remove the download repository from your disk and try re-install with:
+
+ ```bash
+ go install github.com/mattn/go-sqlite3
+ ```
+
+# User Authentication
+
+***This is deprecated***
+
+This package supports the SQLite User Authentication module.
+
+## Compile
+
+To use the User authentication module, the package has to be compiled with the tag `sqlite_userauth`. See [Features](#features).
+
+## Usage
+
+### Create protected database
+
+To create a database protected by user authentication, provide the following argument to the connection string `_auth`.
+This will enable user authentication within the database. This option however requires two additional arguments:
+
+- `_auth_user`
+- `_auth_pass`
+
+When `_auth` is present in the connection string user authentication will be enabled and the provided user will be created
+as an `admin` user. After initial creation, the parameter `_auth` has no effect anymore and can be omitted from the connection string.
+
+Example connection strings:
+
+Create an user authentication database with user `admin` and password `admin`:
+
+`file:test.s3db?_auth&_auth_user=admin&_auth_pass=admin`
+
+Create an user authentication database with user `admin` and password `admin` and use `SHA1` for the password encoding:
+
+`file:test.s3db?_auth&_auth_user=admin&_auth_pass=admin&_auth_crypt=sha1`
+
+### Password Encoding
+
+The passwords within the user authentication module of SQLite are encoded with the SQLite function `sqlite_cryp`.
+This function uses a ceasar-cypher which is quite insecure.
+This library provides several additional password encoders which can be configured through the connection string.
+
+The password cypher can be configured with the key `_auth_crypt`. And if the configured password encoder also requires an
+salt this can be configured with `_auth_salt`.
+
+#### Available Encoders
+
+- SHA1
+- SSHA1 (Salted SHA1)
+- SHA256
+- SSHA256 (salted SHA256)
+- SHA384
+- SSHA384 (salted SHA384)
+- SHA512
+- SSHA512 (salted SHA512)
+
+### Restrictions
+
+Operations on the database regarding user management can only be preformed by an administrator user.
+
+### Support
+
+The user authentication supports two kinds of users:
+
+- administrators
+- regular users
+
+### User Management
+
+User management can be done by directly using the `*SQLiteConn` or by SQL.
+
+#### SQL
+
+The following sql functions are available for user management:
+
+| Function | Arguments | Description |
+|----------|-----------|-------------|
+| `authenticate` | username `string`, password `string` | Will authenticate an user, this is done by the connection; and should not be used manually. |
+| `auth_user_add` | username `string`, password `string`, admin `int` | This function will add an user to the database. if the database is not protected by user authentication it will enable it. Argument `admin` is an integer identifying if the added user should be an administrator. Only Administrators can add administrators. |
+| `auth_user_change` | username `string`, password `string`, admin `int` | Function to modify an user. Users can change their own password, but only an administrator can change the administrator flag. |
+| `authUserDelete` | username `string` | Delete an user from the database. Can only be used by an administrator. The current logged in administrator cannot be deleted. This is to make sure their is always an administrator remaining. |
+
+These functions will return an integer:
+
+- 0 (SQLITE_OK)
+- 23 (SQLITE_AUTH) Failed to perform due to authentication or insufficient privileges
+
+##### Examples
+
+```sql
+// Autheticate user
+// Create Admin User
+SELECT auth_user_add('admin2', 'admin2', 1);
+
+// Change password for user
+SELECT auth_user_change('user', 'userpassword', 0);
+
+// Delete user
+SELECT user_delete('user');
+```
+
+#### *SQLiteConn
+
+The following functions are available for User authentication from the `*SQLiteConn`:
+
+| Function | Description |
+|----------|-------------|
+| `Authenticate(username, password string) error` | Authenticate user |
+| `AuthUserAdd(username, password string, admin bool) error` | Add user |
+| `AuthUserChange(username, password string, admin bool) error` | Modify user |
+| `AuthUserDelete(username string) error` | Delete user |
+
+### Attached database
+
+When using attached databases, SQLite will use the authentication from the `main` database for the attached database(s).
+
+# Extensions
+
+If you want your own extension to be listed here, or you want to add a reference to an extension; please submit an Issue for this.
+
+## Spatialite
+
+Spatialite is available as an extension to SQLite, and can be used in combination with this repository.
+For an example, see [shaxbee/go-spatialite](https://github.com/shaxbee/go-spatialite).
+
+## extension-functions.c from SQLite3 Contrib
+
+extension-functions.c is available as an extension to SQLite, and provides the following functions:
+
+- Math: acos, asin, atan, atn2, atan2, acosh, asinh, atanh, difference, degrees, radians, cos, sin, tan, cot, cosh, sinh, tanh, coth, exp, log, log10, power, sign, sqrt, square, ceil, floor, pi.
+- String: replicate, charindex, leftstr, rightstr, ltrim, rtrim, trim, replace, reverse, proper, padl, padr, padc, strfilter.
+- Aggregate: stdev, variance, mode, median, lower_quartile, upper_quartile
+
+For an example, see [dinedal/go-sqlite3-extension-functions](https://github.com/dinedal/go-sqlite3-extension-functions).
+
+# FAQ
+
+- Getting insert error while query is opened.
+
+ > You can pass some arguments into the connection string, for example, a URI.
+ > See: [#39](https://github.com/mattn/go-sqlite3/issues/39)
+
+- Do you want to cross compile? mingw on Linux or Mac?
+
+ > See: [#106](https://github.com/mattn/go-sqlite3/issues/106)
+ > See also: http://www.limitlessfx.com/cross-compile-golang-app-for-windows-from-linux.html
+
+- Want to get time.Time with current locale
+
+ Use `_loc=auto` in SQLite3 filename schema like `file:foo.db?_loc=auto`.
+
+- Can I use this in multiple routines concurrently?
+
+ Yes for readonly. But not for writable. See [#50](https://github.com/mattn/go-sqlite3/issues/50), [#51](https://github.com/mattn/go-sqlite3/issues/51), [#209](https://github.com/mattn/go-sqlite3/issues/209), [#274](https://github.com/mattn/go-sqlite3/issues/274).
+
+- Why I'm getting `no such table` error?
+
+ Why is it racy if I use a `sql.Open("sqlite3", ":memory:")` database?
+
+ Each connection to `":memory:"` opens a brand new in-memory sql database, so if
+ the stdlib's sql engine happens to open another connection and you've only
+ specified `":memory:"`, that connection will see a brand new database. A
+ workaround is to use `"file::memory:?cache=shared"` (or `"file:foobar?mode=memory&cache=shared"`). Every
+ connection to this string will point to the same in-memory database.
+
+ Note that if the last database connection in the pool closes, the in-memory database is deleted. Make sure the [max idle connection limit](https://golang.org/pkg/database/sql/#DB.SetMaxIdleConns) is > 0, and the [connection lifetime](https://golang.org/pkg/database/sql/#DB.SetConnMaxLifetime) is infinite.
+
+ For more information see:
+ * [#204](https://github.com/mattn/go-sqlite3/issues/204)
+ * [#511](https://github.com/mattn/go-sqlite3/issues/511)
+ * https://www.sqlite.org/sharedcache.html#shared_cache_and_in_memory_databases
+ * https://www.sqlite.org/inmemorydb.html#sharedmemdb
+
+- Reading from database with large amount of goroutines fails on OSX.
+
+ OS X limits OS-wide to not have more than 1000 files open simultaneously by default.
+
+ For more information, see [#289](https://github.com/mattn/go-sqlite3/issues/289)
+
+- Trying to execute a `.` (dot) command throws an error.
+
+ Error: `Error: near ".": syntax error`
+ Dot command are part of SQLite3 CLI, not of this library.
+
+ You need to implement the feature or call the sqlite3 cli.
+
+ More information see [#305](https://github.com/mattn/go-sqlite3/issues/305).
+
+- Error: `database is locked`
+
+ When you get a database is locked, please use the following options.
+
+ Add to DSN: `cache=shared`
+
+ Example:
+ ```go
+ db, err := sql.Open("sqlite3", "file:locked.sqlite?cache=shared")
+ ```
+
+ Next, please set the database connections of the SQL package to 1:
+
+ ```go
+ db.SetMaxOpenConns(1)
+ ```
+
+ For more information, see [#209](https://github.com/mattn/go-sqlite3/issues/209).
+
+## Contributors
+
+### Code Contributors
+
+This project exists thanks to all the people who [[contribute](CONTRIBUTING.md)].
+
+
+### Financial Contributors
+
+Become a financial contributor and help us sustain our community. [[Contribute here](https://opencollective.com/mattn-go-sqlite3/contribute)].
+
+#### Individuals
+
+
+
+#### Organizations
+
+Support this project with your organization. Your logo will show up here with a link to your website. [[Contribute](https://opencollective.com/mattn-go-sqlite3/contribute)]
+
+
+
+
+
+
+
+
+
+
+
+
+# License
+
+MIT: http://mattn.mit-license.org/2018
+
+sqlite3-binding.c, sqlite3-binding.h, sqlite3ext.h
+
+The -binding suffix was added to avoid build failures under gccgo.
+
+In this repository, those files are an amalgamation of code that was copied from SQLite3. The license of that code is the same as the license of SQLite3.
+
+# Author
+
+Yasuhiro Matsumoto (a.k.a mattn)
+
+G.J.R. Timmer
diff --git a/archive/vendor/github.com/mattn/go-sqlite3/backup.go b/archive/vendor/github.com/mattn/go-sqlite3/backup.go
new file mode 100644
index 0000000..ecbb469
--- /dev/null
+++ b/archive/vendor/github.com/mattn/go-sqlite3/backup.go
@@ -0,0 +1,85 @@
+// Copyright (C) 2019 Yasuhiro Matsumoto .
+//
+// Use of this source code is governed by an MIT-style
+// license that can be found in the LICENSE file.
+
+package sqlite3
+
+/*
+#ifndef USE_LIBSQLITE3
+#include "sqlite3-binding.h"
+#else
+#include
+#endif
+#include
+*/
+import "C"
+import (
+ "runtime"
+ "unsafe"
+)
+
+// SQLiteBackup implement interface of Backup.
+type SQLiteBackup struct {
+ b *C.sqlite3_backup
+}
+
+// Backup make backup from src to dest.
+func (destConn *SQLiteConn) Backup(dest string, srcConn *SQLiteConn, src string) (*SQLiteBackup, error) {
+ destptr := C.CString(dest)
+ defer C.free(unsafe.Pointer(destptr))
+ srcptr := C.CString(src)
+ defer C.free(unsafe.Pointer(srcptr))
+
+ if b := C.sqlite3_backup_init(destConn.db, destptr, srcConn.db, srcptr); b != nil {
+ bb := &SQLiteBackup{b: b}
+ runtime.SetFinalizer(bb, (*SQLiteBackup).Finish)
+ return bb, nil
+ }
+ return nil, destConn.lastError()
+}
+
+// Step to backs up for one step. Calls the underlying `sqlite3_backup_step`
+// function. This function returns a boolean indicating if the backup is done
+// and an error signalling any other error. Done is returned if the underlying
+// C function returns SQLITE_DONE (Code 101)
+func (b *SQLiteBackup) Step(p int) (bool, error) {
+ ret := C.sqlite3_backup_step(b.b, C.int(p))
+ if ret == C.SQLITE_DONE {
+ return true, nil
+ } else if ret != 0 && ret != C.SQLITE_LOCKED && ret != C.SQLITE_BUSY {
+ return false, Error{Code: ErrNo(ret)}
+ }
+ return false, nil
+}
+
+// Remaining return whether have the rest for backup.
+func (b *SQLiteBackup) Remaining() int {
+ return int(C.sqlite3_backup_remaining(b.b))
+}
+
+// PageCount return count of pages.
+func (b *SQLiteBackup) PageCount() int {
+ return int(C.sqlite3_backup_pagecount(b.b))
+}
+
+// Finish close backup.
+func (b *SQLiteBackup) Finish() error {
+ return b.Close()
+}
+
+// Close close backup.
+func (b *SQLiteBackup) Close() error {
+ ret := C.sqlite3_backup_finish(b.b)
+
+ // sqlite3_backup_finish() never fails, it just returns the
+ // error code from previous operations, so clean up before
+ // checking and returning an error
+ b.b = nil
+ runtime.SetFinalizer(b, nil)
+
+ if ret != 0 {
+ return Error{Code: ErrNo(ret)}
+ }
+ return nil
+}
diff --git a/archive/vendor/github.com/mattn/go-sqlite3/callback.go b/archive/vendor/github.com/mattn/go-sqlite3/callback.go
new file mode 100644
index 0000000..0c518fa
--- /dev/null
+++ b/archive/vendor/github.com/mattn/go-sqlite3/callback.go
@@ -0,0 +1,412 @@
+// Copyright (C) 2019 Yasuhiro Matsumoto .
+//
+// Use of this source code is governed by an MIT-style
+// license that can be found in the LICENSE file.
+
+package sqlite3
+
+// You can't export a Go function to C and have definitions in the C
+// preamble in the same file, so we have to have callbackTrampoline in
+// its own file. Because we need a separate file anyway, the support
+// code for SQLite custom functions is in here.
+
+/*
+#ifndef USE_LIBSQLITE3
+#include "sqlite3-binding.h"
+#else
+#include
+#endif
+#include
+
+void _sqlite3_result_text(sqlite3_context* ctx, const char* s);
+void _sqlite3_result_blob(sqlite3_context* ctx, const void* b, int l);
+*/
+import "C"
+
+import (
+ "errors"
+ "fmt"
+ "math"
+ "reflect"
+ "sync"
+ "unsafe"
+)
+
+//export callbackTrampoline
+func callbackTrampoline(ctx *C.sqlite3_context, argc int, argv **C.sqlite3_value) {
+ args := (*[(math.MaxInt32 - 1) / unsafe.Sizeof((*C.sqlite3_value)(nil))]*C.sqlite3_value)(unsafe.Pointer(argv))[:argc:argc]
+ fi := lookupHandle(C.sqlite3_user_data(ctx)).(*functionInfo)
+ fi.Call(ctx, args)
+}
+
+//export stepTrampoline
+func stepTrampoline(ctx *C.sqlite3_context, argc C.int, argv **C.sqlite3_value) {
+ args := (*[(math.MaxInt32 - 1) / unsafe.Sizeof((*C.sqlite3_value)(nil))]*C.sqlite3_value)(unsafe.Pointer(argv))[:int(argc):int(argc)]
+ ai := lookupHandle(C.sqlite3_user_data(ctx)).(*aggInfo)
+ ai.Step(ctx, args)
+}
+
+//export doneTrampoline
+func doneTrampoline(ctx *C.sqlite3_context) {
+ ai := lookupHandle(C.sqlite3_user_data(ctx)).(*aggInfo)
+ ai.Done(ctx)
+}
+
+//export compareTrampoline
+func compareTrampoline(handlePtr unsafe.Pointer, la C.int, a *C.char, lb C.int, b *C.char) C.int {
+ cmp := lookupHandle(handlePtr).(func(string, string) int)
+ return C.int(cmp(C.GoStringN(a, la), C.GoStringN(b, lb)))
+}
+
+//export commitHookTrampoline
+func commitHookTrampoline(handle unsafe.Pointer) int {
+ callback := lookupHandle(handle).(func() int)
+ return callback()
+}
+
+//export rollbackHookTrampoline
+func rollbackHookTrampoline(handle unsafe.Pointer) {
+ callback := lookupHandle(handle).(func())
+ callback()
+}
+
+//export updateHookTrampoline
+func updateHookTrampoline(handle unsafe.Pointer, op int, db *C.char, table *C.char, rowid int64) {
+ callback := lookupHandle(handle).(func(int, string, string, int64))
+ callback(op, C.GoString(db), C.GoString(table), rowid)
+}
+
+//export authorizerTrampoline
+func authorizerTrampoline(handle unsafe.Pointer, op int, arg1 *C.char, arg2 *C.char, arg3 *C.char) int {
+ callback := lookupHandle(handle).(func(int, string, string, string) int)
+ return callback(op, C.GoString(arg1), C.GoString(arg2), C.GoString(arg3))
+}
+
+//export preUpdateHookTrampoline
+func preUpdateHookTrampoline(handle unsafe.Pointer, dbHandle uintptr, op int, db *C.char, table *C.char, oldrowid int64, newrowid int64) {
+ hval := lookupHandleVal(handle)
+ data := SQLitePreUpdateData{
+ Conn: hval.db,
+ Op: op,
+ DatabaseName: C.GoString(db),
+ TableName: C.GoString(table),
+ OldRowID: oldrowid,
+ NewRowID: newrowid,
+ }
+ callback := hval.val.(func(SQLitePreUpdateData))
+ callback(data)
+}
+
+// Use handles to avoid passing Go pointers to C.
+type handleVal struct {
+ db *SQLiteConn
+ val any
+}
+
+var handleLock sync.Mutex
+var handleVals = make(map[unsafe.Pointer]handleVal)
+
+func newHandle(db *SQLiteConn, v any) unsafe.Pointer {
+ handleLock.Lock()
+ defer handleLock.Unlock()
+ val := handleVal{db: db, val: v}
+ var p unsafe.Pointer = C.malloc(C.size_t(1))
+ if p == nil {
+ panic("can't allocate 'cgo-pointer hack index pointer': ptr == nil")
+ }
+ handleVals[p] = val
+ return p
+}
+
+func lookupHandleVal(handle unsafe.Pointer) handleVal {
+ handleLock.Lock()
+ defer handleLock.Unlock()
+ return handleVals[handle]
+}
+
+func lookupHandle(handle unsafe.Pointer) any {
+ return lookupHandleVal(handle).val
+}
+
+func deleteHandles(db *SQLiteConn) {
+ handleLock.Lock()
+ defer handleLock.Unlock()
+ for handle, val := range handleVals {
+ if val.db == db {
+ delete(handleVals, handle)
+ C.free(handle)
+ }
+ }
+}
+
+// This is only here so that tests can refer to it.
+type callbackArgRaw C.sqlite3_value
+
+type callbackArgConverter func(*C.sqlite3_value) (reflect.Value, error)
+
+type callbackArgCast struct {
+ f callbackArgConverter
+ typ reflect.Type
+}
+
+func (c callbackArgCast) Run(v *C.sqlite3_value) (reflect.Value, error) {
+ val, err := c.f(v)
+ if err != nil {
+ return reflect.Value{}, err
+ }
+ if !val.Type().ConvertibleTo(c.typ) {
+ return reflect.Value{}, fmt.Errorf("cannot convert %s to %s", val.Type(), c.typ)
+ }
+ return val.Convert(c.typ), nil
+}
+
+func callbackArgInt64(v *C.sqlite3_value) (reflect.Value, error) {
+ if C.sqlite3_value_type(v) != C.SQLITE_INTEGER {
+ return reflect.Value{}, fmt.Errorf("argument must be an INTEGER")
+ }
+ return reflect.ValueOf(int64(C.sqlite3_value_int64(v))), nil
+}
+
+func callbackArgBool(v *C.sqlite3_value) (reflect.Value, error) {
+ if C.sqlite3_value_type(v) != C.SQLITE_INTEGER {
+ return reflect.Value{}, fmt.Errorf("argument must be an INTEGER")
+ }
+ i := int64(C.sqlite3_value_int64(v))
+ val := false
+ if i != 0 {
+ val = true
+ }
+ return reflect.ValueOf(val), nil
+}
+
+func callbackArgFloat64(v *C.sqlite3_value) (reflect.Value, error) {
+ if C.sqlite3_value_type(v) != C.SQLITE_FLOAT {
+ return reflect.Value{}, fmt.Errorf("argument must be a FLOAT")
+ }
+ return reflect.ValueOf(float64(C.sqlite3_value_double(v))), nil
+}
+
+func callbackArgBytes(v *C.sqlite3_value) (reflect.Value, error) {
+ switch C.sqlite3_value_type(v) {
+ case C.SQLITE_BLOB:
+ l := C.sqlite3_value_bytes(v)
+ p := C.sqlite3_value_blob(v)
+ return reflect.ValueOf(C.GoBytes(p, l)), nil
+ case C.SQLITE_TEXT:
+ l := C.sqlite3_value_bytes(v)
+ c := unsafe.Pointer(C.sqlite3_value_text(v))
+ return reflect.ValueOf(C.GoBytes(c, l)), nil
+ default:
+ return reflect.Value{}, fmt.Errorf("argument must be BLOB or TEXT")
+ }
+}
+
+func callbackArgString(v *C.sqlite3_value) (reflect.Value, error) {
+ switch C.sqlite3_value_type(v) {
+ case C.SQLITE_BLOB:
+ l := C.sqlite3_value_bytes(v)
+ p := (*C.char)(C.sqlite3_value_blob(v))
+ return reflect.ValueOf(C.GoStringN(p, l)), nil
+ case C.SQLITE_TEXT:
+ c := (*C.char)(unsafe.Pointer(C.sqlite3_value_text(v)))
+ return reflect.ValueOf(C.GoString(c)), nil
+ default:
+ return reflect.Value{}, fmt.Errorf("argument must be BLOB or TEXT")
+ }
+}
+
+func callbackArgGeneric(v *C.sqlite3_value) (reflect.Value, error) {
+ switch C.sqlite3_value_type(v) {
+ case C.SQLITE_INTEGER:
+ return callbackArgInt64(v)
+ case C.SQLITE_FLOAT:
+ return callbackArgFloat64(v)
+ case C.SQLITE_TEXT:
+ return callbackArgString(v)
+ case C.SQLITE_BLOB:
+ return callbackArgBytes(v)
+ case C.SQLITE_NULL:
+ // Interpret NULL as a nil byte slice.
+ var ret []byte
+ return reflect.ValueOf(ret), nil
+ default:
+ panic("unreachable")
+ }
+}
+
+func callbackArg(typ reflect.Type) (callbackArgConverter, error) {
+ switch typ.Kind() {
+ case reflect.Interface:
+ if typ.NumMethod() != 0 {
+ return nil, errors.New("the only supported interface type is any")
+ }
+ return callbackArgGeneric, nil
+ case reflect.Slice:
+ if typ.Elem().Kind() != reflect.Uint8 {
+ return nil, errors.New("the only supported slice type is []byte")
+ }
+ return callbackArgBytes, nil
+ case reflect.String:
+ return callbackArgString, nil
+ case reflect.Bool:
+ return callbackArgBool, nil
+ case reflect.Int64:
+ return callbackArgInt64, nil
+ case reflect.Int8, reflect.Int16, reflect.Int32, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Int, reflect.Uint:
+ c := callbackArgCast{callbackArgInt64, typ}
+ return c.Run, nil
+ case reflect.Float64:
+ return callbackArgFloat64, nil
+ case reflect.Float32:
+ c := callbackArgCast{callbackArgFloat64, typ}
+ return c.Run, nil
+ default:
+ return nil, fmt.Errorf("don't know how to convert to %s", typ)
+ }
+}
+
+func callbackConvertArgs(argv []*C.sqlite3_value, converters []callbackArgConverter, variadic callbackArgConverter) ([]reflect.Value, error) {
+ var args []reflect.Value
+
+ if len(argv) < len(converters) {
+ return nil, fmt.Errorf("function requires at least %d arguments", len(converters))
+ }
+
+ for i, arg := range argv[:len(converters)] {
+ v, err := converters[i](arg)
+ if err != nil {
+ return nil, err
+ }
+ args = append(args, v)
+ }
+
+ if variadic != nil {
+ for _, arg := range argv[len(converters):] {
+ v, err := variadic(arg)
+ if err != nil {
+ return nil, err
+ }
+ args = append(args, v)
+ }
+ }
+ return args, nil
+}
+
+type callbackRetConverter func(*C.sqlite3_context, reflect.Value) error
+
+func callbackRetInteger(ctx *C.sqlite3_context, v reflect.Value) error {
+ switch v.Type().Kind() {
+ case reflect.Int64:
+ case reflect.Int8, reflect.Int16, reflect.Int32, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Int, reflect.Uint:
+ v = v.Convert(reflect.TypeOf(int64(0)))
+ case reflect.Bool:
+ b := v.Interface().(bool)
+ if b {
+ v = reflect.ValueOf(int64(1))
+ } else {
+ v = reflect.ValueOf(int64(0))
+ }
+ default:
+ return fmt.Errorf("cannot convert %s to INTEGER", v.Type())
+ }
+
+ C.sqlite3_result_int64(ctx, C.sqlite3_int64(v.Interface().(int64)))
+ return nil
+}
+
+func callbackRetFloat(ctx *C.sqlite3_context, v reflect.Value) error {
+ switch v.Type().Kind() {
+ case reflect.Float64:
+ case reflect.Float32:
+ v = v.Convert(reflect.TypeOf(float64(0)))
+ default:
+ return fmt.Errorf("cannot convert %s to FLOAT", v.Type())
+ }
+
+ C.sqlite3_result_double(ctx, C.double(v.Interface().(float64)))
+ return nil
+}
+
+func callbackRetBlob(ctx *C.sqlite3_context, v reflect.Value) error {
+ if v.Type().Kind() != reflect.Slice || v.Type().Elem().Kind() != reflect.Uint8 {
+ return fmt.Errorf("cannot convert %s to BLOB", v.Type())
+ }
+ i := v.Interface()
+ if i == nil || len(i.([]byte)) == 0 {
+ C.sqlite3_result_null(ctx)
+ } else {
+ bs := i.([]byte)
+ C._sqlite3_result_blob(ctx, unsafe.Pointer(&bs[0]), C.int(len(bs)))
+ }
+ return nil
+}
+
+func callbackRetText(ctx *C.sqlite3_context, v reflect.Value) error {
+ if v.Type().Kind() != reflect.String {
+ return fmt.Errorf("cannot convert %s to TEXT", v.Type())
+ }
+ cstr := C.CString(v.Interface().(string))
+ C._sqlite3_result_text(ctx, cstr)
+ return nil
+}
+
+func callbackRetNil(ctx *C.sqlite3_context, v reflect.Value) error {
+ return nil
+}
+
+func callbackRetGeneric(ctx *C.sqlite3_context, v reflect.Value) error {
+ if v.IsNil() {
+ C.sqlite3_result_null(ctx)
+ return nil
+ }
+
+ cb, err := callbackRet(v.Elem().Type())
+ if err != nil {
+ return err
+ }
+
+ return cb(ctx, v.Elem())
+}
+
+func callbackRet(typ reflect.Type) (callbackRetConverter, error) {
+ switch typ.Kind() {
+ case reflect.Interface:
+ errorInterface := reflect.TypeOf((*error)(nil)).Elem()
+ if typ.Implements(errorInterface) {
+ return callbackRetNil, nil
+ }
+
+ if typ.NumMethod() == 0 {
+ return callbackRetGeneric, nil
+ }
+
+ fallthrough
+ case reflect.Slice:
+ if typ.Elem().Kind() != reflect.Uint8 {
+ return nil, errors.New("the only supported slice type is []byte")
+ }
+ return callbackRetBlob, nil
+ case reflect.String:
+ return callbackRetText, nil
+ case reflect.Bool, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Int, reflect.Uint:
+ return callbackRetInteger, nil
+ case reflect.Float32, reflect.Float64:
+ return callbackRetFloat, nil
+ default:
+ return nil, fmt.Errorf("don't know how to convert to %s", typ)
+ }
+}
+
+func callbackError(ctx *C.sqlite3_context, err error) {
+ cstr := C.CString(err.Error())
+ defer C.free(unsafe.Pointer(cstr))
+ C.sqlite3_result_error(ctx, cstr, C.int(-1))
+}
+
+// Test support code. Tests are not allowed to import "C", so we can't
+// declare any functions that use C.sqlite3_value.
+func callbackSyntheticForTests(v reflect.Value, err error) callbackArgConverter {
+ return func(*C.sqlite3_value) (reflect.Value, error) {
+ return v, err
+ }
+}
diff --git a/archive/vendor/github.com/mattn/go-sqlite3/convert.go b/archive/vendor/github.com/mattn/go-sqlite3/convert.go
new file mode 100644
index 0000000..f7a9dcd
--- /dev/null
+++ b/archive/vendor/github.com/mattn/go-sqlite3/convert.go
@@ -0,0 +1,299 @@
+// Extracted from Go database/sql source code
+
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Type conversions for Scan.
+
+package sqlite3
+
+import (
+ "database/sql"
+ "database/sql/driver"
+ "errors"
+ "fmt"
+ "reflect"
+ "strconv"
+ "time"
+)
+
+var errNilPtr = errors.New("destination pointer is nil") // embedded in descriptive error
+
+// convertAssign copies to dest the value in src, converting it if possible.
+// An error is returned if the copy would result in loss of information.
+// dest should be a pointer type.
+func convertAssign(dest, src any) error {
+ // Common cases, without reflect.
+ switch s := src.(type) {
+ case string:
+ switch d := dest.(type) {
+ case *string:
+ if d == nil {
+ return errNilPtr
+ }
+ *d = s
+ return nil
+ case *[]byte:
+ if d == nil {
+ return errNilPtr
+ }
+ *d = []byte(s)
+ return nil
+ case *sql.RawBytes:
+ if d == nil {
+ return errNilPtr
+ }
+ *d = append((*d)[:0], s...)
+ return nil
+ }
+ case []byte:
+ switch d := dest.(type) {
+ case *string:
+ if d == nil {
+ return errNilPtr
+ }
+ *d = string(s)
+ return nil
+ case *any:
+ if d == nil {
+ return errNilPtr
+ }
+ *d = cloneBytes(s)
+ return nil
+ case *[]byte:
+ if d == nil {
+ return errNilPtr
+ }
+ *d = cloneBytes(s)
+ return nil
+ case *sql.RawBytes:
+ if d == nil {
+ return errNilPtr
+ }
+ *d = s
+ return nil
+ }
+ case time.Time:
+ switch d := dest.(type) {
+ case *time.Time:
+ *d = s
+ return nil
+ case *string:
+ *d = s.Format(time.RFC3339Nano)
+ return nil
+ case *[]byte:
+ if d == nil {
+ return errNilPtr
+ }
+ *d = []byte(s.Format(time.RFC3339Nano))
+ return nil
+ case *sql.RawBytes:
+ if d == nil {
+ return errNilPtr
+ }
+ *d = s.AppendFormat((*d)[:0], time.RFC3339Nano)
+ return nil
+ }
+ case nil:
+ switch d := dest.(type) {
+ case *any:
+ if d == nil {
+ return errNilPtr
+ }
+ *d = nil
+ return nil
+ case *[]byte:
+ if d == nil {
+ return errNilPtr
+ }
+ *d = nil
+ return nil
+ case *sql.RawBytes:
+ if d == nil {
+ return errNilPtr
+ }
+ *d = nil
+ return nil
+ }
+ }
+
+ var sv reflect.Value
+
+ switch d := dest.(type) {
+ case *string:
+ sv = reflect.ValueOf(src)
+ switch sv.Kind() {
+ case reflect.Bool,
+ reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64,
+ reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64,
+ reflect.Float32, reflect.Float64:
+ *d = asString(src)
+ return nil
+ }
+ case *[]byte:
+ sv = reflect.ValueOf(src)
+ if b, ok := asBytes(nil, sv); ok {
+ *d = b
+ return nil
+ }
+ case *sql.RawBytes:
+ sv = reflect.ValueOf(src)
+ if b, ok := asBytes([]byte(*d)[:0], sv); ok {
+ *d = sql.RawBytes(b)
+ return nil
+ }
+ case *bool:
+ bv, err := driver.Bool.ConvertValue(src)
+ if err == nil {
+ *d = bv.(bool)
+ }
+ return err
+ case *any:
+ *d = src
+ return nil
+ }
+
+ if scanner, ok := dest.(sql.Scanner); ok {
+ return scanner.Scan(src)
+ }
+
+ dpv := reflect.ValueOf(dest)
+ if dpv.Kind() != reflect.Ptr {
+ return errors.New("destination not a pointer")
+ }
+ if dpv.IsNil() {
+ return errNilPtr
+ }
+
+ if !sv.IsValid() {
+ sv = reflect.ValueOf(src)
+ }
+
+ dv := reflect.Indirect(dpv)
+ if sv.IsValid() && sv.Type().AssignableTo(dv.Type()) {
+ switch b := src.(type) {
+ case []byte:
+ dv.Set(reflect.ValueOf(cloneBytes(b)))
+ default:
+ dv.Set(sv)
+ }
+ return nil
+ }
+
+ if dv.Kind() == sv.Kind() && sv.Type().ConvertibleTo(dv.Type()) {
+ dv.Set(sv.Convert(dv.Type()))
+ return nil
+ }
+
+ // The following conversions use a string value as an intermediate representation
+ // to convert between various numeric types.
+ //
+ // This also allows scanning into user defined types such as "type Int int64".
+ // For symmetry, also check for string destination types.
+ switch dv.Kind() {
+ case reflect.Ptr:
+ if src == nil {
+ dv.Set(reflect.Zero(dv.Type()))
+ return nil
+ }
+ dv.Set(reflect.New(dv.Type().Elem()))
+ return convertAssign(dv.Interface(), src)
+ case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
+ s := asString(src)
+ i64, err := strconv.ParseInt(s, 10, dv.Type().Bits())
+ if err != nil {
+ err = strconvErr(err)
+ return fmt.Errorf("converting driver.Value type %T (%q) to a %s: %v", src, s, dv.Kind(), err)
+ }
+ dv.SetInt(i64)
+ return nil
+ case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:
+ s := asString(src)
+ u64, err := strconv.ParseUint(s, 10, dv.Type().Bits())
+ if err != nil {
+ err = strconvErr(err)
+ return fmt.Errorf("converting driver.Value type %T (%q) to a %s: %v", src, s, dv.Kind(), err)
+ }
+ dv.SetUint(u64)
+ return nil
+ case reflect.Float32, reflect.Float64:
+ s := asString(src)
+ f64, err := strconv.ParseFloat(s, dv.Type().Bits())
+ if err != nil {
+ err = strconvErr(err)
+ return fmt.Errorf("converting driver.Value type %T (%q) to a %s: %v", src, s, dv.Kind(), err)
+ }
+ dv.SetFloat(f64)
+ return nil
+ case reflect.String:
+ switch v := src.(type) {
+ case string:
+ dv.SetString(v)
+ return nil
+ case []byte:
+ dv.SetString(string(v))
+ return nil
+ }
+ }
+
+ return fmt.Errorf("unsupported Scan, storing driver.Value type %T into type %T", src, dest)
+}
+
+func strconvErr(err error) error {
+ if ne, ok := err.(*strconv.NumError); ok {
+ return ne.Err
+ }
+ return err
+}
+
+func cloneBytes(b []byte) []byte {
+ if b == nil {
+ return nil
+ }
+ c := make([]byte, len(b))
+ copy(c, b)
+ return c
+}
+
+func asString(src any) string {
+ switch v := src.(type) {
+ case string:
+ return v
+ case []byte:
+ return string(v)
+ }
+ rv := reflect.ValueOf(src)
+ switch rv.Kind() {
+ case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
+ return strconv.FormatInt(rv.Int(), 10)
+ case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:
+ return strconv.FormatUint(rv.Uint(), 10)
+ case reflect.Float64:
+ return strconv.FormatFloat(rv.Float(), 'g', -1, 64)
+ case reflect.Float32:
+ return strconv.FormatFloat(rv.Float(), 'g', -1, 32)
+ case reflect.Bool:
+ return strconv.FormatBool(rv.Bool())
+ }
+ return fmt.Sprintf("%v", src)
+}
+
+func asBytes(buf []byte, rv reflect.Value) (b []byte, ok bool) {
+ switch rv.Kind() {
+ case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
+ return strconv.AppendInt(buf, rv.Int(), 10), true
+ case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:
+ return strconv.AppendUint(buf, rv.Uint(), 10), true
+ case reflect.Float32:
+ return strconv.AppendFloat(buf, rv.Float(), 'g', -1, 32), true
+ case reflect.Float64:
+ return strconv.AppendFloat(buf, rv.Float(), 'g', -1, 64), true
+ case reflect.Bool:
+ return strconv.AppendBool(buf, rv.Bool()), true
+ case reflect.String:
+ s := rv.String()
+ return append(buf, s...), true
+ }
+ return
+}
diff --git a/archive/vendor/github.com/mattn/go-sqlite3/doc.go b/archive/vendor/github.com/mattn/go-sqlite3/doc.go
new file mode 100644
index 0000000..a3bcebb
--- /dev/null
+++ b/archive/vendor/github.com/mattn/go-sqlite3/doc.go
@@ -0,0 +1,134 @@
+/*
+Package sqlite3 provides interface to SQLite3 databases.
+
+This works as a driver for database/sql.
+
+Installation
+
+ go get github.com/mattn/go-sqlite3
+
+# Supported Types
+
+Currently, go-sqlite3 supports the following data types.
+
+ +------------------------------+
+ |go | sqlite3 |
+ |----------|-------------------|
+ |nil | null |
+ |int | integer |
+ |int64 | integer |
+ |float64 | float |
+ |bool | integer |
+ |[]byte | blob |
+ |string | text |
+ |time.Time | timestamp/datetime|
+ +------------------------------+
+
+# SQLite3 Extension
+
+You can write your own extension module for sqlite3. For example, below is an
+extension for a Regexp matcher operation.
+
+ #include
+ #include
+ #include
+ #include
+
+ SQLITE_EXTENSION_INIT1
+ static void regexp_func(sqlite3_context *context, int argc, sqlite3_value **argv) {
+ if (argc >= 2) {
+ const char *target = (const char *)sqlite3_value_text(argv[1]);
+ const char *pattern = (const char *)sqlite3_value_text(argv[0]);
+ const char* errstr = NULL;
+ int erroff = 0;
+ int vec[500];
+ int n, rc;
+ pcre* re = pcre_compile(pattern, 0, &errstr, &erroff, NULL);
+ rc = pcre_exec(re, NULL, target, strlen(target), 0, 0, vec, 500);
+ if (rc <= 0) {
+ sqlite3_result_error(context, errstr, 0);
+ return;
+ }
+ sqlite3_result_int(context, 1);
+ }
+ }
+
+ #ifdef _WIN32
+ __declspec(dllexport)
+ #endif
+ int sqlite3_extension_init(sqlite3 *db, char **errmsg,
+ const sqlite3_api_routines *api) {
+ SQLITE_EXTENSION_INIT2(api);
+ return sqlite3_create_function(db, "regexp", 2, SQLITE_UTF8,
+ (void*)db, regexp_func, NULL, NULL);
+ }
+
+It needs to be built as a so/dll shared library. And you need to register
+the extension module like below.
+
+ sql.Register("sqlite3_with_extensions",
+ &sqlite3.SQLiteDriver{
+ Extensions: []string{
+ "sqlite3_mod_regexp",
+ },
+ })
+
+Then, you can use this extension.
+
+ rows, err := db.Query("select text from mytable where name regexp '^golang'")
+
+# Connection Hook
+
+You can hook and inject your code when the connection is established by setting
+ConnectHook to get the SQLiteConn.
+
+ sql.Register("sqlite3_with_hook_example",
+ &sqlite3.SQLiteDriver{
+ ConnectHook: func(conn *sqlite3.SQLiteConn) error {
+ sqlite3conn = append(sqlite3conn, conn)
+ return nil
+ },
+ })
+
+You can also use database/sql.Conn.Raw (Go >= 1.13):
+
+ conn, err := db.Conn(context.Background())
+ // if err != nil { ... }
+ defer conn.Close()
+ err = conn.Raw(func (driverConn any) error {
+ sqliteConn := driverConn.(*sqlite3.SQLiteConn)
+ // ... use sqliteConn
+ })
+ // if err != nil { ... }
+
+# Go SQlite3 Extensions
+
+If you want to register Go functions as SQLite extension functions
+you can make a custom driver by calling RegisterFunction from
+ConnectHook.
+
+ regex = func(re, s string) (bool, error) {
+ return regexp.MatchString(re, s)
+ }
+ sql.Register("sqlite3_extended",
+ &sqlite3.SQLiteDriver{
+ ConnectHook: func(conn *sqlite3.SQLiteConn) error {
+ return conn.RegisterFunc("regexp", regex, true)
+ },
+ })
+
+You can then use the custom driver by passing its name to sql.Open.
+
+ var i int
+ conn, err := sql.Open("sqlite3_extended", "./foo.db")
+ if err != nil {
+ panic(err)
+ }
+ err = db.QueryRow(`SELECT regexp("foo.*", "seafood")`).Scan(&i)
+ if err != nil {
+ panic(err)
+ }
+
+See the documentation of RegisterFunc for more details.
+*/
+package sqlite3
diff --git a/archive/vendor/github.com/mattn/go-sqlite3/error.go b/archive/vendor/github.com/mattn/go-sqlite3/error.go
new file mode 100644
index 0000000..58ab252
--- /dev/null
+++ b/archive/vendor/github.com/mattn/go-sqlite3/error.go
@@ -0,0 +1,150 @@
+// Copyright (C) 2019 Yasuhiro Matsumoto .
+//
+// Use of this source code is governed by an MIT-style
+// license that can be found in the LICENSE file.
+
+package sqlite3
+
+/*
+#ifndef USE_LIBSQLITE3
+#include "sqlite3-binding.h"
+#else
+#include
+#endif
+*/
+import "C"
+import "syscall"
+
+// ErrNo inherit errno.
+type ErrNo int
+
+// ErrNoMask is mask code.
+const ErrNoMask C.int = 0xff
+
+// ErrNoExtended is extended errno.
+type ErrNoExtended int
+
+// Error implement sqlite error code.
+type Error struct {
+ Code ErrNo /* The error code returned by SQLite */
+ ExtendedCode ErrNoExtended /* The extended error code returned by SQLite */
+ SystemErrno syscall.Errno /* The system errno returned by the OS through SQLite, if applicable */
+ err string /* The error string returned by sqlite3_errmsg(),
+ this usually contains more specific details. */
+}
+
+// result codes from http://www.sqlite.org/c3ref/c_abort.html
+var (
+ ErrError = ErrNo(1) /* SQL error or missing database */
+ ErrInternal = ErrNo(2) /* Internal logic error in SQLite */
+ ErrPerm = ErrNo(3) /* Access permission denied */
+ ErrAbort = ErrNo(4) /* Callback routine requested an abort */
+ ErrBusy = ErrNo(5) /* The database file is locked */
+ ErrLocked = ErrNo(6) /* A table in the database is locked */
+ ErrNomem = ErrNo(7) /* A malloc() failed */
+ ErrReadonly = ErrNo(8) /* Attempt to write a readonly database */
+ ErrInterrupt = ErrNo(9) /* Operation terminated by sqlite3_interrupt() */
+ ErrIoErr = ErrNo(10) /* Some kind of disk I/O error occurred */
+ ErrCorrupt = ErrNo(11) /* The database disk image is malformed */
+ ErrNotFound = ErrNo(12) /* Unknown opcode in sqlite3_file_control() */
+ ErrFull = ErrNo(13) /* Insertion failed because database is full */
+ ErrCantOpen = ErrNo(14) /* Unable to open the database file */
+ ErrProtocol = ErrNo(15) /* Database lock protocol error */
+ ErrEmpty = ErrNo(16) /* Database is empty */
+ ErrSchema = ErrNo(17) /* The database schema changed */
+ ErrTooBig = ErrNo(18) /* String or BLOB exceeds size limit */
+ ErrConstraint = ErrNo(19) /* Abort due to constraint violation */
+ ErrMismatch = ErrNo(20) /* Data type mismatch */
+ ErrMisuse = ErrNo(21) /* Library used incorrectly */
+ ErrNoLFS = ErrNo(22) /* Uses OS features not supported on host */
+ ErrAuth = ErrNo(23) /* Authorization denied */
+ ErrFormat = ErrNo(24) /* Auxiliary database format error */
+ ErrRange = ErrNo(25) /* 2nd parameter to sqlite3_bind out of range */
+ ErrNotADB = ErrNo(26) /* File opened that is not a database file */
+ ErrNotice = ErrNo(27) /* Notifications from sqlite3_log() */
+ ErrWarning = ErrNo(28) /* Warnings from sqlite3_log() */
+)
+
+// Error return error message from errno.
+func (err ErrNo) Error() string {
+ return Error{Code: err}.Error()
+}
+
+// Extend return extended errno.
+func (err ErrNo) Extend(by int) ErrNoExtended {
+ return ErrNoExtended(int(err) | (by << 8))
+}
+
+// Error return error message that is extended code.
+func (err ErrNoExtended) Error() string {
+ return Error{Code: ErrNo(C.int(err) & ErrNoMask), ExtendedCode: err}.Error()
+}
+
+func (err Error) Error() string {
+ var str string
+ if err.err != "" {
+ str = err.err
+ } else {
+ str = C.GoString(C.sqlite3_errstr(C.int(err.Code)))
+ }
+ if err.SystemErrno != 0 {
+ str += ": " + err.SystemErrno.Error()
+ }
+ return str
+}
+
+// result codes from http://www.sqlite.org/c3ref/c_abort_rollback.html
+var (
+ ErrIoErrRead = ErrIoErr.Extend(1)
+ ErrIoErrShortRead = ErrIoErr.Extend(2)
+ ErrIoErrWrite = ErrIoErr.Extend(3)
+ ErrIoErrFsync = ErrIoErr.Extend(4)
+ ErrIoErrDirFsync = ErrIoErr.Extend(5)
+ ErrIoErrTruncate = ErrIoErr.Extend(6)
+ ErrIoErrFstat = ErrIoErr.Extend(7)
+ ErrIoErrUnlock = ErrIoErr.Extend(8)
+ ErrIoErrRDlock = ErrIoErr.Extend(9)
+ ErrIoErrDelete = ErrIoErr.Extend(10)
+ ErrIoErrBlocked = ErrIoErr.Extend(11)
+ ErrIoErrNoMem = ErrIoErr.Extend(12)
+ ErrIoErrAccess = ErrIoErr.Extend(13)
+ ErrIoErrCheckReservedLock = ErrIoErr.Extend(14)
+ ErrIoErrLock = ErrIoErr.Extend(15)
+ ErrIoErrClose = ErrIoErr.Extend(16)
+ ErrIoErrDirClose = ErrIoErr.Extend(17)
+ ErrIoErrSHMOpen = ErrIoErr.Extend(18)
+ ErrIoErrSHMSize = ErrIoErr.Extend(19)
+ ErrIoErrSHMLock = ErrIoErr.Extend(20)
+ ErrIoErrSHMMap = ErrIoErr.Extend(21)
+ ErrIoErrSeek = ErrIoErr.Extend(22)
+ ErrIoErrDeleteNoent = ErrIoErr.Extend(23)
+ ErrIoErrMMap = ErrIoErr.Extend(24)
+ ErrIoErrGetTempPath = ErrIoErr.Extend(25)
+ ErrIoErrConvPath = ErrIoErr.Extend(26)
+ ErrLockedSharedCache = ErrLocked.Extend(1)
+ ErrBusyRecovery = ErrBusy.Extend(1)
+ ErrBusySnapshot = ErrBusy.Extend(2)
+ ErrCantOpenNoTempDir = ErrCantOpen.Extend(1)
+ ErrCantOpenIsDir = ErrCantOpen.Extend(2)
+ ErrCantOpenFullPath = ErrCantOpen.Extend(3)
+ ErrCantOpenConvPath = ErrCantOpen.Extend(4)
+ ErrCorruptVTab = ErrCorrupt.Extend(1)
+ ErrReadonlyRecovery = ErrReadonly.Extend(1)
+ ErrReadonlyCantLock = ErrReadonly.Extend(2)
+ ErrReadonlyRollback = ErrReadonly.Extend(3)
+ ErrReadonlyDbMoved = ErrReadonly.Extend(4)
+ ErrAbortRollback = ErrAbort.Extend(2)
+ ErrConstraintCheck = ErrConstraint.Extend(1)
+ ErrConstraintCommitHook = ErrConstraint.Extend(2)
+ ErrConstraintForeignKey = ErrConstraint.Extend(3)
+ ErrConstraintFunction = ErrConstraint.Extend(4)
+ ErrConstraintNotNull = ErrConstraint.Extend(5)
+ ErrConstraintPrimaryKey = ErrConstraint.Extend(6)
+ ErrConstraintTrigger = ErrConstraint.Extend(7)
+ ErrConstraintUnique = ErrConstraint.Extend(8)
+ ErrConstraintVTab = ErrConstraint.Extend(9)
+ ErrConstraintRowID = ErrConstraint.Extend(10)
+ ErrNoticeRecoverWAL = ErrNotice.Extend(1)
+ ErrNoticeRecoverRollback = ErrNotice.Extend(2)
+ ErrWarningAutoIndex = ErrWarning.Extend(1)
+)
diff --git a/archive/vendor/github.com/mattn/go-sqlite3/sqlite3-binding.c b/archive/vendor/github.com/mattn/go-sqlite3/sqlite3-binding.c
new file mode 100644
index 0000000..78b6f5b
--- /dev/null
+++ b/archive/vendor/github.com/mattn/go-sqlite3/sqlite3-binding.c
@@ -0,0 +1,262904 @@
+#ifndef USE_LIBSQLITE3
+/******************************************************************************
+** This file is an amalgamation of many separate C source files from SQLite
+** version 3.50.4. By combining all the individual C code files into this
+** single large file, the entire code can be compiled as a single translation
+** unit. This allows many compilers to do optimizations that would not be
+** possible if the files were compiled separately. Performance improvements
+** of 5% or more are commonly seen when SQLite is compiled as a single
+** translation unit.
+**
+** This file is all you need to compile SQLite. To use SQLite in other
+** programs, you need this file and the "sqlite3.h" header file that defines
+** the programming interface to the SQLite library. (If you do not have
+** the "sqlite3.h" header file at hand, you will find a copy embedded within
+** the text of this file. Search for "Begin file sqlite3.h" to find the start
+** of the embedded sqlite3.h header file.) Additional code files may be needed
+** if you want a wrapper to interface SQLite with your choice of programming
+** language. The code for the "sqlite3" command-line shell is also in a
+** separate file. This file contains only code for the core SQLite library.
+**
+** The content in this amalgamation comes from Fossil check-in
+** 4d8adfb30e03f9cf27f800a2c1ba3c48fb4c with changes in files:
+**
+**
+*/
+#ifndef SQLITE_AMALGAMATION
+#define SQLITE_CORE 1
+#define SQLITE_AMALGAMATION 1
+#ifndef SQLITE_PRIVATE
+# define SQLITE_PRIVATE static
+#endif
+/************** Begin file sqliteInt.h ***************************************/
+/*
+** 2001 September 15
+**
+** The author disclaims copyright to this source code. In place of
+** a legal notice, here is a blessing:
+**
+** May you do good and not evil.
+** May you find forgiveness for yourself and forgive others.
+** May you share freely, never taking more than you give.
+**
+*************************************************************************
+** Internal interface definitions for SQLite.
+**
+*/
+#ifndef SQLITEINT_H
+#define SQLITEINT_H
+
+/* Special Comments:
+**
+** Some comments have special meaning to the tools that measure test
+** coverage:
+**
+** NO_TEST - The branches on this line are not
+** measured by branch coverage. This is
+** used on lines of code that actually
+** implement parts of coverage testing.
+**
+** OPTIMIZATION-IF-TRUE - This branch is allowed to always be false
+** and the correct answer is still obtained,
+** though perhaps more slowly.
+**
+** OPTIMIZATION-IF-FALSE - This branch is allowed to always be true
+** and the correct answer is still obtained,
+** though perhaps more slowly.
+**
+** PREVENTS-HARMLESS-OVERREAD - This branch prevents a buffer overread
+** that would be harmless and undetectable
+** if it did occur.
+**
+** In all cases, the special comment must be enclosed in the usual
+** slash-asterisk...asterisk-slash comment marks, with no spaces between the
+** asterisks and the comment text.
+*/
+
+/*
+** Make sure the Tcl calling convention macro is defined. This macro is
+** only used by test code and Tcl integration code.
+*/
+#ifndef SQLITE_TCLAPI
+# define SQLITE_TCLAPI
+#endif
+
+/*
+** Include the header file used to customize the compiler options for MSVC.
+** This should be done first so that it can successfully prevent spurious
+** compiler warnings due to subsequent content in this file and other files
+** that are included by this file.
+*/
+/************** Include msvc.h in the middle of sqliteInt.h ******************/
+/************** Begin file msvc.h ********************************************/
+/*
+** 2015 January 12
+**
+** The author disclaims copyright to this source code. In place of
+** a legal notice, here is a blessing:
+**
+** May you do good and not evil.
+** May you find forgiveness for yourself and forgive others.
+** May you share freely, never taking more than you give.
+**
+******************************************************************************
+**
+** This file contains code that is specific to MSVC.
+*/
+#ifndef SQLITE_MSVC_H
+#define SQLITE_MSVC_H
+
+#if defined(_MSC_VER)
+#pragma warning(disable : 4054)
+#pragma warning(disable : 4055)
+#pragma warning(disable : 4100)
+#pragma warning(disable : 4127)
+#pragma warning(disable : 4130)
+#pragma warning(disable : 4152)
+#pragma warning(disable : 4189)
+#pragma warning(disable : 4206)
+#pragma warning(disable : 4210)
+#pragma warning(disable : 4232)
+#pragma warning(disable : 4244)
+#pragma warning(disable : 4305)
+#pragma warning(disable : 4306)
+#pragma warning(disable : 4702)
+#pragma warning(disable : 4706)
+#endif /* defined(_MSC_VER) */
+
+#if defined(_MSC_VER) && !defined(_WIN64)
+#undef SQLITE_4_BYTE_ALIGNED_MALLOC
+#define SQLITE_4_BYTE_ALIGNED_MALLOC
+#endif /* defined(_MSC_VER) && !defined(_WIN64) */
+
+#if !defined(HAVE_LOG2) && defined(_MSC_VER) && _MSC_VER<1800
+#define HAVE_LOG2 0
+#endif /* !defined(HAVE_LOG2) && defined(_MSC_VER) && _MSC_VER<1800 */
+
+#endif /* SQLITE_MSVC_H */
+
+/************** End of msvc.h ************************************************/
+/************** Continuing where we left off in sqliteInt.h ******************/
+
+/*
+** Special setup for VxWorks
+*/
+/************** Include vxworks.h in the middle of sqliteInt.h ***************/
+/************** Begin file vxworks.h *****************************************/
+/*
+** 2015-03-02
+**
+** The author disclaims copyright to this source code. In place of
+** a legal notice, here is a blessing:
+**
+** May you do good and not evil.
+** May you find forgiveness for yourself and forgive others.
+** May you share freely, never taking more than you give.
+**
+******************************************************************************
+**
+** This file contains code that is specific to Wind River's VxWorks
+*/
+#if defined(__RTP__) || defined(_WRS_KERNEL)
+/* This is VxWorks. Set up things specially for that OS
+*/
+#include
+#include /* amalgamator: dontcache */
+#define OS_VXWORKS 1
+#define SQLITE_OS_OTHER 0
+#define SQLITE_HOMEGROWN_RECURSIVE_MUTEX 1
+#define SQLITE_OMIT_LOAD_EXTENSION 1
+#define SQLITE_ENABLE_LOCKING_STYLE 0
+#define HAVE_UTIME 1
+#else
+/* This is not VxWorks. */
+#define OS_VXWORKS 0
+#define HAVE_FCHOWN 1
+#define HAVE_READLINK 1
+#define HAVE_LSTAT 1
+#endif /* defined(_WRS_KERNEL) */
+
+/************** End of vxworks.h *********************************************/
+/************** Continuing where we left off in sqliteInt.h ******************/
+
+/*
+** These #defines should enable >2GB file support on POSIX if the
+** underlying operating system supports it. If the OS lacks
+** large file support, or if the OS is windows, these should be no-ops.
+**
+** Ticket #2739: The _LARGEFILE_SOURCE macro must appear before any
+** system #includes. Hence, this block of code must be the very first
+** code in all source files.
+**
+** Large file support can be disabled using the -DSQLITE_DISABLE_LFS switch
+** on the compiler command line. This is necessary if you are compiling
+** on a recent machine (ex: Red Hat 7.2) but you want your code to work
+** on an older machine (ex: Red Hat 6.0). If you compile on Red Hat 7.2
+** without this option, LFS is enable. But LFS does not exist in the kernel
+** in Red Hat 6.0, so the code won't work. Hence, for maximum binary
+** portability you should omit LFS.
+**
+** The previous paragraph was written in 2005. (This paragraph is written
+** on 2008-11-28.) These days, all Linux kernels support large files, so
+** you should probably leave LFS enabled. But some embedded platforms might
+** lack LFS in which case the SQLITE_DISABLE_LFS macro might still be useful.
+**
+** Similar is true for Mac OS X. LFS is only supported on Mac OS X 9 and later.
+*/
+#ifndef SQLITE_DISABLE_LFS
+# define _LARGE_FILE 1
+# ifndef _FILE_OFFSET_BITS
+# define _FILE_OFFSET_BITS 64
+# endif
+# define _LARGEFILE_SOURCE 1
+#endif
+
+/* The GCC_VERSION and MSVC_VERSION macros are used to
+** conditionally include optimizations for each of these compilers. A
+** value of 0 means that compiler is not being used. The
+** SQLITE_DISABLE_INTRINSIC macro means do not use any compiler-specific
+** optimizations, and hence set all compiler macros to 0
+**
+** There was once also a CLANG_VERSION macro. However, we learn that the
+** version numbers in clang are for "marketing" only and are inconsistent
+** and unreliable. Fortunately, all versions of clang also recognize the
+** gcc version numbers and have reasonable settings for gcc version numbers,
+** so the GCC_VERSION macro will be set to a correct non-zero value even
+** when compiling with clang.
+*/
+#if defined(__GNUC__) && !defined(SQLITE_DISABLE_INTRINSIC)
+# define GCC_VERSION (__GNUC__*1000000+__GNUC_MINOR__*1000+__GNUC_PATCHLEVEL__)
+#else
+# define GCC_VERSION 0
+#endif
+#if defined(_MSC_VER) && !defined(SQLITE_DISABLE_INTRINSIC)
+# define MSVC_VERSION _MSC_VER
+#else
+# define MSVC_VERSION 0
+#endif
+
+/*
+** Some C99 functions in "math.h" are only present for MSVC when its version
+** is associated with Visual Studio 2013 or higher.
+*/
+#ifndef SQLITE_HAVE_C99_MATH_FUNCS
+# if MSVC_VERSION==0 || MSVC_VERSION>=1800
+# define SQLITE_HAVE_C99_MATH_FUNCS (1)
+# else
+# define SQLITE_HAVE_C99_MATH_FUNCS (0)
+# endif
+#endif
+
+/* Needed for various definitions... */
+#if defined(__GNUC__) && !defined(_GNU_SOURCE)
+# define _GNU_SOURCE
+#endif
+
+#if defined(__OpenBSD__) && !defined(_BSD_SOURCE)
+# define _BSD_SOURCE
+#endif
+
+/*
+** Macro to disable warnings about missing "break" at the end of a "case".
+*/
+#if defined(__has_attribute)
+# if __has_attribute(fallthrough)
+# define deliberate_fall_through __attribute__((fallthrough));
+# endif
+#endif
+#if !defined(deliberate_fall_through)
+# define deliberate_fall_through
+#endif
+
+/*
+** For MinGW, check to see if we can include the header file containing its
+** version information, among other things. Normally, this internal MinGW
+** header file would [only] be included automatically by other MinGW header
+** files; however, the contained version information is now required by this
+** header file to work around binary compatibility issues (see below) and
+** this is the only known way to reliably obtain it. This entire #if block
+** would be completely unnecessary if there was any other way of detecting
+** MinGW via their preprocessor (e.g. if they customized their GCC to define
+** some MinGW-specific macros). When compiling for MinGW, either the
+** _HAVE_MINGW_H or _HAVE__MINGW_H (note the extra underscore) macro must be
+** defined; otherwise, detection of conditions specific to MinGW will be
+** disabled.
+*/
+#if defined(_HAVE_MINGW_H)
+# include "mingw.h"
+#elif defined(_HAVE__MINGW_H)
+# include "_mingw.h"
+#endif
+
+/*
+** For MinGW version 4.x (and higher), check to see if the _USE_32BIT_TIME_T
+** define is required to maintain binary compatibility with the MSVC runtime
+** library in use (e.g. for Windows XP).
+*/
+#if !defined(_USE_32BIT_TIME_T) && !defined(_USE_64BIT_TIME_T) && \
+ defined(_WIN32) && !defined(_WIN64) && \
+ defined(__MINGW_MAJOR_VERSION) && __MINGW_MAJOR_VERSION >= 4 && \
+ defined(__MSVCRT__)
+# define _USE_32BIT_TIME_T
+#endif
+
+/* Optionally #include a user-defined header, whereby compilation options
+** may be set prior to where they take effect, but after platform setup.
+** If SQLITE_CUSTOM_INCLUDE=? is defined, its value names the #include
+** file.
+*/
+#ifdef SQLITE_CUSTOM_INCLUDE
+# define INC_STRINGIFY_(f) #f
+# define INC_STRINGIFY(f) INC_STRINGIFY_(f)
+# include INC_STRINGIFY(SQLITE_CUSTOM_INCLUDE)
+#endif
+
+/* The public SQLite interface. The _FILE_OFFSET_BITS macro must appear
+** first in QNX. Also, the _USE_32BIT_TIME_T macro must appear first for
+** MinGW.
+*/
+/************** Include sqlite3.h in the middle of sqliteInt.h ***************/
+/************** Begin file sqlite3.h *****************************************/
+/*
+** 2001-09-15
+**
+** The author disclaims copyright to this source code. In place of
+** a legal notice, here is a blessing:
+**
+** May you do good and not evil.
+** May you find forgiveness for yourself and forgive others.
+** May you share freely, never taking more than you give.
+**
+*************************************************************************
+** This header file defines the interface that the SQLite library
+** presents to client programs. If a C-function, structure, datatype,
+** or constant definition does not appear in this file, then it is
+** not a published API of SQLite, is subject to change without
+** notice, and should not be referenced by programs that use SQLite.
+**
+** Some of the definitions that are in this file are marked as
+** "experimental". Experimental interfaces are normally new
+** features recently added to SQLite. We do not anticipate changes
+** to experimental interfaces but reserve the right to make minor changes
+** if experience from use "in the wild" suggest such changes are prudent.
+**
+** The official C-language API documentation for SQLite is derived
+** from comments in this file. This file is the authoritative source
+** on how SQLite interfaces are supposed to operate.
+**
+** The name of this file under configuration management is "sqlite.h.in".
+** The makefile makes some minor changes to this file (such as inserting
+** the version number) and changes its name to "sqlite3.h" as
+** part of the build process.
+*/
+#ifndef SQLITE3_H
+#define SQLITE3_H
+#include /* Needed for the definition of va_list */
+
+/*
+** Make sure we can call this stuff from C++.
+*/
+#if 0
+extern "C" {
+#endif
+
+
+/*
+** Facilitate override of interface linkage and calling conventions.
+** Be aware that these macros may not be used within this particular
+** translation of the amalgamation and its associated header file.
+**
+** The SQLITE_EXTERN and SQLITE_API macros are used to instruct the
+** compiler that the target identifier should have external linkage.
+**
+** The SQLITE_CDECL macro is used to set the calling convention for
+** public functions that accept a variable number of arguments.
+**
+** The SQLITE_APICALL macro is used to set the calling convention for
+** public functions that accept a fixed number of arguments.
+**
+** The SQLITE_STDCALL macro is no longer used and is now deprecated.
+**
+** The SQLITE_CALLBACK macro is used to set the calling convention for
+** function pointers.
+**
+** The SQLITE_SYSAPI macro is used to set the calling convention for
+** functions provided by the operating system.
+**
+** Currently, the SQLITE_CDECL, SQLITE_APICALL, SQLITE_CALLBACK, and
+** SQLITE_SYSAPI macros are used only when building for environments
+** that require non-default calling conventions.
+*/
+#ifndef SQLITE_EXTERN
+# define SQLITE_EXTERN extern
+#endif
+#ifndef SQLITE_API
+# define SQLITE_API
+#endif
+#ifndef SQLITE_CDECL
+# define SQLITE_CDECL
+#endif
+#ifndef SQLITE_APICALL
+# define SQLITE_APICALL
+#endif
+#ifndef SQLITE_STDCALL
+# define SQLITE_STDCALL SQLITE_APICALL
+#endif
+#ifndef SQLITE_CALLBACK
+# define SQLITE_CALLBACK
+#endif
+#ifndef SQLITE_SYSAPI
+# define SQLITE_SYSAPI
+#endif
+
+/*
+** These no-op macros are used in front of interfaces to mark those
+** interfaces as either deprecated or experimental. New applications
+** should not use deprecated interfaces - they are supported for backwards
+** compatibility only. Application writers should be aware that
+** experimental interfaces are subject to change in point releases.
+**
+** These macros used to resolve to various kinds of compiler magic that
+** would generate warning messages when they were used. But that
+** compiler magic ended up generating such a flurry of bug reports
+** that we have taken it all out and gone back to using simple
+** noop macros.
+*/
+#define SQLITE_DEPRECATED
+#define SQLITE_EXPERIMENTAL
+
+/*
+** Ensure these symbols were not defined by some previous header file.
+*/
+#ifdef SQLITE_VERSION
+# undef SQLITE_VERSION
+#endif
+#ifdef SQLITE_VERSION_NUMBER
+# undef SQLITE_VERSION_NUMBER
+#endif
+
+/*
+** CAPI3REF: Compile-Time Library Version Numbers
+**
+** ^(The [SQLITE_VERSION] C preprocessor macro in the sqlite3.h header
+** evaluates to a string literal that is the SQLite version in the
+** format "X.Y.Z" where X is the major version number (always 3 for
+** SQLite3) and Y is the minor version number and Z is the release number.)^
+** ^(The [SQLITE_VERSION_NUMBER] C preprocessor macro resolves to an integer
+** with the value (X*1000000 + Y*1000 + Z) where X, Y, and Z are the same
+** numbers used in [SQLITE_VERSION].)^
+** The SQLITE_VERSION_NUMBER for any given release of SQLite will also
+** be larger than the release from which it is derived. Either Y will
+** be held constant and Z will be incremented or else Y will be incremented
+** and Z will be reset to zero.
+**
+** Since [version 3.6.18] ([dateof:3.6.18]),
+** SQLite source code has been stored in the
+** Fossil configuration management
+** system . ^The SQLITE_SOURCE_ID macro evaluates to
+** a string which identifies a particular check-in of SQLite
+** within its configuration management system. ^The SQLITE_SOURCE_ID
+** string contains the date and time of the check-in (UTC) and a SHA1
+** or SHA3-256 hash of the entire source tree. If the source code has
+** been edited in any way since it was last checked in, then the last
+** four hexadecimal digits of the hash may be modified.
+**
+** See also: [sqlite3_libversion()],
+** [sqlite3_libversion_number()], [sqlite3_sourceid()],
+** [sqlite_version()] and [sqlite_source_id()].
+*/
+#define SQLITE_VERSION "3.50.4"
+#define SQLITE_VERSION_NUMBER 3050004
+#define SQLITE_SOURCE_ID "2025-07-30 19:33:53 4d8adfb30e03f9cf27f800a2c1ba3c48fb4ca1b08b0f5ed59a4d5ecbf45e20a3"
+
+/*
+** CAPI3REF: Run-Time Library Version Numbers
+** KEYWORDS: sqlite3_version sqlite3_sourceid
+**
+** These interfaces provide the same information as the [SQLITE_VERSION],
+** [SQLITE_VERSION_NUMBER], and [SQLITE_SOURCE_ID] C preprocessor macros
+** but are associated with the library instead of the header file. ^(Cautious
+** programmers might include assert() statements in their application to
+** verify that values returned by these interfaces match the macros in
+** the header, and thus ensure that the application is
+** compiled with matching library and header files.
+**
+**
+** assert( sqlite3_libversion_number()==SQLITE_VERSION_NUMBER );
+** assert( strncmp(sqlite3_sourceid(),SQLITE_SOURCE_ID,80)==0 );
+** assert( strcmp(sqlite3_libversion(),SQLITE_VERSION)==0 );
+** )^
+**
+** ^The sqlite3_version[] string constant contains the text of [SQLITE_VERSION]
+** macro. ^The sqlite3_libversion() function returns a pointer to the
+** to the sqlite3_version[] string constant. The sqlite3_libversion()
+** function is provided for use in DLLs since DLL users usually do not have
+** direct access to string constants within the DLL. ^The
+** sqlite3_libversion_number() function returns an integer equal to
+** [SQLITE_VERSION_NUMBER]. ^(The sqlite3_sourceid() function returns
+** a pointer to a string constant whose value is the same as the
+** [SQLITE_SOURCE_ID] C preprocessor macro. Except if SQLite is built
+** using an edited copy of [the amalgamation], then the last four characters
+** of the hash might be different from [SQLITE_SOURCE_ID].)^
+**
+** See also: [sqlite_version()] and [sqlite_source_id()].
+*/
+SQLITE_API const char sqlite3_version[] = SQLITE_VERSION;
+SQLITE_API const char *sqlite3_libversion(void);
+SQLITE_API const char *sqlite3_sourceid(void);
+SQLITE_API int sqlite3_libversion_number(void);
+
+/*
+** CAPI3REF: Run-Time Library Compilation Options Diagnostics
+**
+** ^The sqlite3_compileoption_used() function returns 0 or 1
+** indicating whether the specified option was defined at
+** compile time. ^The SQLITE_ prefix may be omitted from the
+** option name passed to sqlite3_compileoption_used().
+**
+** ^The sqlite3_compileoption_get() function allows iterating
+** over the list of options that were defined at compile time by
+** returning the N-th compile time option string. ^If N is out of range,
+** sqlite3_compileoption_get() returns a NULL pointer. ^The SQLITE_
+** prefix is omitted from any strings returned by
+** sqlite3_compileoption_get().
+**
+** ^Support for the diagnostic functions sqlite3_compileoption_used()
+** and sqlite3_compileoption_get() may be omitted by specifying the
+** [SQLITE_OMIT_COMPILEOPTION_DIAGS] option at compile time.
+**
+** See also: SQL functions [sqlite_compileoption_used()] and
+** [sqlite_compileoption_get()] and the [compile_options pragma].
+*/
+#ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS
+SQLITE_API int sqlite3_compileoption_used(const char *zOptName);
+SQLITE_API const char *sqlite3_compileoption_get(int N);
+#else
+# define sqlite3_compileoption_used(X) 0
+# define sqlite3_compileoption_get(X) ((void*)0)
+#endif
+
+/*
+** CAPI3REF: Test To See If The Library Is Threadsafe
+**
+** ^The sqlite3_threadsafe() function returns zero if and only if
+** SQLite was compiled with mutexing code omitted due to the
+** [SQLITE_THREADSAFE] compile-time option being set to 0.
+**
+** SQLite can be compiled with or without mutexes. When
+** the [SQLITE_THREADSAFE] C preprocessor macro is 1 or 2, mutexes
+** are enabled and SQLite is threadsafe. When the
+** [SQLITE_THREADSAFE] macro is 0,
+** the mutexes are omitted. Without the mutexes, it is not safe
+** to use SQLite concurrently from more than one thread.
+**
+** Enabling mutexes incurs a measurable performance penalty.
+** So if speed is of utmost importance, it makes sense to disable
+** the mutexes. But for maximum safety, mutexes should be enabled.
+** ^The default behavior is for mutexes to be enabled.
+**
+** This interface can be used by an application to make sure that the
+** version of SQLite that it is linking against was compiled with
+** the desired setting of the [SQLITE_THREADSAFE] macro.
+**
+** This interface only reports on the compile-time mutex setting
+** of the [SQLITE_THREADSAFE] flag. If SQLite is compiled with
+** SQLITE_THREADSAFE=1 or =2 then mutexes are enabled by default but
+** can be fully or partially disabled using a call to [sqlite3_config()]
+** with the verbs [SQLITE_CONFIG_SINGLETHREAD], [SQLITE_CONFIG_MULTITHREAD],
+** or [SQLITE_CONFIG_SERIALIZED]. ^(The return value of the
+** sqlite3_threadsafe() function shows only the compile-time setting of
+** thread safety, not any run-time changes to that setting made by
+** sqlite3_config(). In other words, the return value from sqlite3_threadsafe()
+** is unchanged by calls to sqlite3_config().)^
+**
+** See the [threading mode] documentation for additional information.
+*/
+SQLITE_API int sqlite3_threadsafe(void);
+
+/*
+** CAPI3REF: Database Connection Handle
+** KEYWORDS: {database connection} {database connections}
+**
+** Each open SQLite database is represented by a pointer to an instance of
+** the opaque structure named "sqlite3". It is useful to think of an sqlite3
+** pointer as an object. The [sqlite3_open()], [sqlite3_open16()], and
+** [sqlite3_open_v2()] interfaces are its constructors, and [sqlite3_close()]
+** and [sqlite3_close_v2()] are its destructors. There are many other
+** interfaces (such as
+** [sqlite3_prepare_v2()], [sqlite3_create_function()], and
+** [sqlite3_busy_timeout()] to name but three) that are methods on an
+** sqlite3 object.
+*/
+typedef struct sqlite3 sqlite3;
+
+/*
+** CAPI3REF: 64-Bit Integer Types
+** KEYWORDS: sqlite_int64 sqlite_uint64
+**
+** Because there is no cross-platform way to specify 64-bit integer types
+** SQLite includes typedefs for 64-bit signed and unsigned integers.
+**
+** The sqlite3_int64 and sqlite3_uint64 are the preferred type definitions.
+** The sqlite_int64 and sqlite_uint64 types are supported for backwards
+** compatibility only.
+**
+** ^The sqlite3_int64 and sqlite_int64 types can store integer values
+** between -9223372036854775808 and +9223372036854775807 inclusive. ^The
+** sqlite3_uint64 and sqlite_uint64 types can store integer values
+** between 0 and +18446744073709551615 inclusive.
+*/
+#ifdef SQLITE_INT64_TYPE
+ typedef SQLITE_INT64_TYPE sqlite_int64;
+# ifdef SQLITE_UINT64_TYPE
+ typedef SQLITE_UINT64_TYPE sqlite_uint64;
+# else
+ typedef unsigned SQLITE_INT64_TYPE sqlite_uint64;
+# endif
+#elif defined(_MSC_VER) || defined(__BORLANDC__)
+ typedef __int64 sqlite_int64;
+ typedef unsigned __int64 sqlite_uint64;
+#else
+ typedef long long int sqlite_int64;
+ typedef unsigned long long int sqlite_uint64;
+#endif
+typedef sqlite_int64 sqlite3_int64;
+typedef sqlite_uint64 sqlite3_uint64;
+
+/*
+** If compiling for a processor that lacks floating point support,
+** substitute integer for floating-point.
+*/
+#ifdef SQLITE_OMIT_FLOATING_POINT
+# define double sqlite3_int64
+#endif
+
+/*
+** CAPI3REF: Closing A Database Connection
+** DESTRUCTOR: sqlite3
+**
+** ^The sqlite3_close() and sqlite3_close_v2() routines are destructors
+** for the [sqlite3] object.
+** ^Calls to sqlite3_close() and sqlite3_close_v2() return [SQLITE_OK] if
+** the [sqlite3] object is successfully destroyed and all associated
+** resources are deallocated.
+**
+** Ideally, applications should [sqlite3_finalize | finalize] all
+** [prepared statements], [sqlite3_blob_close | close] all [BLOB handles], and
+** [sqlite3_backup_finish | finish] all [sqlite3_backup] objects associated
+** with the [sqlite3] object prior to attempting to close the object.
+** ^If the database connection is associated with unfinalized prepared
+** statements, BLOB handlers, and/or unfinished sqlite3_backup objects then
+** sqlite3_close() will leave the database connection open and return
+** [SQLITE_BUSY]. ^If sqlite3_close_v2() is called with unfinalized prepared
+** statements, unclosed BLOB handlers, and/or unfinished sqlite3_backups,
+** it returns [SQLITE_OK] regardless, but instead of deallocating the database
+** connection immediately, it marks the database connection as an unusable
+** "zombie" and makes arrangements to automatically deallocate the database
+** connection after all prepared statements are finalized, all BLOB handles
+** are closed, and all backups have finished. The sqlite3_close_v2() interface
+** is intended for use with host languages that are garbage collected, and
+** where the order in which destructors are called is arbitrary.
+**
+** ^If an [sqlite3] object is destroyed while a transaction is open,
+** the transaction is automatically rolled back.
+**
+** The C parameter to [sqlite3_close(C)] and [sqlite3_close_v2(C)]
+** must be either a NULL
+** pointer or an [sqlite3] object pointer obtained
+** from [sqlite3_open()], [sqlite3_open16()], or
+** [sqlite3_open_v2()], and not previously closed.
+** ^Calling sqlite3_close() or sqlite3_close_v2() with a NULL pointer
+** argument is a harmless no-op.
+*/
+SQLITE_API int sqlite3_close(sqlite3*);
+SQLITE_API int sqlite3_close_v2(sqlite3*);
+
+/*
+** The type for a callback function.
+** This is legacy and deprecated. It is included for historical
+** compatibility and is not documented.
+*/
+typedef int (*sqlite3_callback)(void*,int,char**, char**);
+
+/*
+** CAPI3REF: One-Step Query Execution Interface
+** METHOD: sqlite3
+**
+** The sqlite3_exec() interface is a convenience wrapper around
+** [sqlite3_prepare_v2()], [sqlite3_step()], and [sqlite3_finalize()],
+** that allows an application to run multiple statements of SQL
+** without having to use a lot of C code.
+**
+** ^The sqlite3_exec() interface runs zero or more UTF-8 encoded,
+** semicolon-separate SQL statements passed into its 2nd argument,
+** in the context of the [database connection] passed in as its 1st
+** argument. ^If the callback function of the 3rd argument to
+** sqlite3_exec() is not NULL, then it is invoked for each result row
+** coming out of the evaluated SQL statements. ^The 4th argument to
+** sqlite3_exec() is relayed through to the 1st argument of each
+** callback invocation. ^If the callback pointer to sqlite3_exec()
+** is NULL, then no callback is ever invoked and result rows are
+** ignored.
+**
+** ^If an error occurs while evaluating the SQL statements passed into
+** sqlite3_exec(), then execution of the current statement stops and
+** subsequent statements are skipped. ^If the 5th parameter to sqlite3_exec()
+** is not NULL then any error message is written into memory obtained
+** from [sqlite3_malloc()] and passed back through the 5th parameter.
+** To avoid memory leaks, the application should invoke [sqlite3_free()]
+** on error message strings returned through the 5th parameter of
+** sqlite3_exec() after the error message string is no longer needed.
+** ^If the 5th parameter to sqlite3_exec() is not NULL and no errors
+** occur, then sqlite3_exec() sets the pointer in its 5th parameter to
+** NULL before returning.
+**
+** ^If an sqlite3_exec() callback returns non-zero, the sqlite3_exec()
+** routine returns SQLITE_ABORT without invoking the callback again and
+** without running any subsequent SQL statements.
+**
+** ^The 2nd argument to the sqlite3_exec() callback function is the
+** number of columns in the result. ^The 3rd argument to the sqlite3_exec()
+** callback is an array of pointers to strings obtained as if from
+** [sqlite3_column_text()], one for each column. ^If an element of a
+** result row is NULL then the corresponding string pointer for the
+** sqlite3_exec() callback is a NULL pointer. ^The 4th argument to the
+** sqlite3_exec() callback is an array of pointers to strings where each
+** entry represents the name of corresponding result column as obtained
+** from [sqlite3_column_name()].
+**
+** ^If the 2nd parameter to sqlite3_exec() is a NULL pointer, a pointer
+** to an empty string, or a pointer that contains only whitespace and/or
+** SQL comments, then no SQL statements are evaluated and the database
+** is not changed.
+**
+** Restrictions:
+**
+**
+** The application must ensure that the 1st parameter to sqlite3_exec()
+** is a valid and open [database connection].
+** The application must not close the [database connection] specified by
+** the 1st parameter to sqlite3_exec() while sqlite3_exec() is running.
+** The application must not modify the SQL statement text passed into
+** the 2nd parameter of sqlite3_exec() while sqlite3_exec() is running.
+** The application must not dereference the arrays or string pointers
+** passed as the 3rd and 4th callback parameters after it returns.
+**
+*/
+SQLITE_API int sqlite3_exec(
+ sqlite3*, /* An open database */
+ const char *sql, /* SQL to be evaluated */
+ int (*callback)(void*,int,char**,char**), /* Callback function */
+ void *, /* 1st argument to callback */
+ char **errmsg /* Error msg written here */
+);
+
+/*
+** CAPI3REF: Result Codes
+** KEYWORDS: {result code definitions}
+**
+** Many SQLite functions return an integer result code from the set shown
+** here in order to indicate success or failure.
+**
+** New error codes may be added in future versions of SQLite.
+**
+** See also: [extended result code definitions]
+*/
+#define SQLITE_OK 0 /* Successful result */
+/* beginning-of-error-codes */
+#define SQLITE_ERROR 1 /* Generic error */
+#define SQLITE_INTERNAL 2 /* Internal logic error in SQLite */
+#define SQLITE_PERM 3 /* Access permission denied */
+#define SQLITE_ABORT 4 /* Callback routine requested an abort */
+#define SQLITE_BUSY 5 /* The database file is locked */
+#define SQLITE_LOCKED 6 /* A table in the database is locked */
+#define SQLITE_NOMEM 7 /* A malloc() failed */
+#define SQLITE_READONLY 8 /* Attempt to write a readonly database */
+#define SQLITE_INTERRUPT 9 /* Operation terminated by sqlite3_interrupt()*/
+#define SQLITE_IOERR 10 /* Some kind of disk I/O error occurred */
+#define SQLITE_CORRUPT 11 /* The database disk image is malformed */
+#define SQLITE_NOTFOUND 12 /* Unknown opcode in sqlite3_file_control() */
+#define SQLITE_FULL 13 /* Insertion failed because database is full */
+#define SQLITE_CANTOPEN 14 /* Unable to open the database file */
+#define SQLITE_PROTOCOL 15 /* Database lock protocol error */
+#define SQLITE_EMPTY 16 /* Internal use only */
+#define SQLITE_SCHEMA 17 /* The database schema changed */
+#define SQLITE_TOOBIG 18 /* String or BLOB exceeds size limit */
+#define SQLITE_CONSTRAINT 19 /* Abort due to constraint violation */
+#define SQLITE_MISMATCH 20 /* Data type mismatch */
+#define SQLITE_MISUSE 21 /* Library used incorrectly */
+#define SQLITE_NOLFS 22 /* Uses OS features not supported on host */
+#define SQLITE_AUTH 23 /* Authorization denied */
+#define SQLITE_FORMAT 24 /* Not used */
+#define SQLITE_RANGE 25 /* 2nd parameter to sqlite3_bind out of range */
+#define SQLITE_NOTADB 26 /* File opened that is not a database file */
+#define SQLITE_NOTICE 27 /* Notifications from sqlite3_log() */
+#define SQLITE_WARNING 28 /* Warnings from sqlite3_log() */
+#define SQLITE_ROW 100 /* sqlite3_step() has another row ready */
+#define SQLITE_DONE 101 /* sqlite3_step() has finished executing */
+/* end-of-error-codes */
+
+/*
+** CAPI3REF: Extended Result Codes
+** KEYWORDS: {extended result code definitions}
+**
+** In its default configuration, SQLite API routines return one of 30 integer
+** [result codes]. However, experience has shown that many of
+** these result codes are too coarse-grained. They do not provide as
+** much information about problems as programmers might like. In an effort to
+** address this, newer versions of SQLite (version 3.3.8 [dateof:3.3.8]
+** and later) include
+** support for additional result codes that provide more detailed information
+** about errors. These [extended result codes] are enabled or disabled
+** on a per database connection basis using the
+** [sqlite3_extended_result_codes()] API. Or, the extended code for
+** the most recent error can be obtained using
+** [sqlite3_extended_errcode()].
+*/
+#define SQLITE_ERROR_MISSING_COLLSEQ (SQLITE_ERROR | (1<<8))
+#define SQLITE_ERROR_RETRY (SQLITE_ERROR | (2<<8))
+#define SQLITE_ERROR_SNAPSHOT (SQLITE_ERROR | (3<<8))
+#define SQLITE_IOERR_READ (SQLITE_IOERR | (1<<8))
+#define SQLITE_IOERR_SHORT_READ (SQLITE_IOERR | (2<<8))
+#define SQLITE_IOERR_WRITE (SQLITE_IOERR | (3<<8))
+#define SQLITE_IOERR_FSYNC (SQLITE_IOERR | (4<<8))
+#define SQLITE_IOERR_DIR_FSYNC (SQLITE_IOERR | (5<<8))
+#define SQLITE_IOERR_TRUNCATE (SQLITE_IOERR | (6<<8))
+#define SQLITE_IOERR_FSTAT (SQLITE_IOERR | (7<<8))
+#define SQLITE_IOERR_UNLOCK (SQLITE_IOERR | (8<<8))
+#define SQLITE_IOERR_RDLOCK (SQLITE_IOERR | (9<<8))
+#define SQLITE_IOERR_DELETE (SQLITE_IOERR | (10<<8))
+#define SQLITE_IOERR_BLOCKED (SQLITE_IOERR | (11<<8))
+#define SQLITE_IOERR_NOMEM (SQLITE_IOERR | (12<<8))
+#define SQLITE_IOERR_ACCESS (SQLITE_IOERR | (13<<8))
+#define SQLITE_IOERR_CHECKRESERVEDLOCK (SQLITE_IOERR | (14<<8))
+#define SQLITE_IOERR_LOCK (SQLITE_IOERR | (15<<8))
+#define SQLITE_IOERR_CLOSE (SQLITE_IOERR | (16<<8))
+#define SQLITE_IOERR_DIR_CLOSE (SQLITE_IOERR | (17<<8))
+#define SQLITE_IOERR_SHMOPEN (SQLITE_IOERR | (18<<8))
+#define SQLITE_IOERR_SHMSIZE (SQLITE_IOERR | (19<<8))
+#define SQLITE_IOERR_SHMLOCK (SQLITE_IOERR | (20<<8))
+#define SQLITE_IOERR_SHMMAP (SQLITE_IOERR | (21<<8))
+#define SQLITE_IOERR_SEEK (SQLITE_IOERR | (22<<8))
+#define SQLITE_IOERR_DELETE_NOENT (SQLITE_IOERR | (23<<8))
+#define SQLITE_IOERR_MMAP (SQLITE_IOERR | (24<<8))
+#define SQLITE_IOERR_GETTEMPPATH (SQLITE_IOERR | (25<<8))
+#define SQLITE_IOERR_CONVPATH (SQLITE_IOERR | (26<<8))
+#define SQLITE_IOERR_VNODE (SQLITE_IOERR | (27<<8))
+#define SQLITE_IOERR_AUTH (SQLITE_IOERR | (28<<8))
+#define SQLITE_IOERR_BEGIN_ATOMIC (SQLITE_IOERR | (29<<8))
+#define SQLITE_IOERR_COMMIT_ATOMIC (SQLITE_IOERR | (30<<8))
+#define SQLITE_IOERR_ROLLBACK_ATOMIC (SQLITE_IOERR | (31<<8))
+#define SQLITE_IOERR_DATA (SQLITE_IOERR | (32<<8))
+#define SQLITE_IOERR_CORRUPTFS (SQLITE_IOERR | (33<<8))
+#define SQLITE_IOERR_IN_PAGE (SQLITE_IOERR | (34<<8))
+#define SQLITE_LOCKED_SHAREDCACHE (SQLITE_LOCKED | (1<<8))
+#define SQLITE_LOCKED_VTAB (SQLITE_LOCKED | (2<<8))
+#define SQLITE_BUSY_RECOVERY (SQLITE_BUSY | (1<<8))
+#define SQLITE_BUSY_SNAPSHOT (SQLITE_BUSY | (2<<8))
+#define SQLITE_BUSY_TIMEOUT (SQLITE_BUSY | (3<<8))
+#define SQLITE_CANTOPEN_NOTEMPDIR (SQLITE_CANTOPEN | (1<<8))
+#define SQLITE_CANTOPEN_ISDIR (SQLITE_CANTOPEN | (2<<8))
+#define SQLITE_CANTOPEN_FULLPATH (SQLITE_CANTOPEN | (3<<8))
+#define SQLITE_CANTOPEN_CONVPATH (SQLITE_CANTOPEN | (4<<8))
+#define SQLITE_CANTOPEN_DIRTYWAL (SQLITE_CANTOPEN | (5<<8)) /* Not Used */
+#define SQLITE_CANTOPEN_SYMLINK (SQLITE_CANTOPEN | (6<<8))
+#define SQLITE_CORRUPT_VTAB (SQLITE_CORRUPT | (1<<8))
+#define SQLITE_CORRUPT_SEQUENCE (SQLITE_CORRUPT | (2<<8))
+#define SQLITE_CORRUPT_INDEX (SQLITE_CORRUPT | (3<<8))
+#define SQLITE_READONLY_RECOVERY (SQLITE_READONLY | (1<<8))
+#define SQLITE_READONLY_CANTLOCK (SQLITE_READONLY | (2<<8))
+#define SQLITE_READONLY_ROLLBACK (SQLITE_READONLY | (3<<8))
+#define SQLITE_READONLY_DBMOVED (SQLITE_READONLY | (4<<8))
+#define SQLITE_READONLY_CANTINIT (SQLITE_READONLY | (5<<8))
+#define SQLITE_READONLY_DIRECTORY (SQLITE_READONLY | (6<<8))
+#define SQLITE_ABORT_ROLLBACK (SQLITE_ABORT | (2<<8))
+#define SQLITE_CONSTRAINT_CHECK (SQLITE_CONSTRAINT | (1<<8))
+#define SQLITE_CONSTRAINT_COMMITHOOK (SQLITE_CONSTRAINT | (2<<8))
+#define SQLITE_CONSTRAINT_FOREIGNKEY (SQLITE_CONSTRAINT | (3<<8))
+#define SQLITE_CONSTRAINT_FUNCTION (SQLITE_CONSTRAINT | (4<<8))
+#define SQLITE_CONSTRAINT_NOTNULL (SQLITE_CONSTRAINT | (5<<8))
+#define SQLITE_CONSTRAINT_PRIMARYKEY (SQLITE_CONSTRAINT | (6<<8))
+#define SQLITE_CONSTRAINT_TRIGGER (SQLITE_CONSTRAINT | (7<<8))
+#define SQLITE_CONSTRAINT_UNIQUE (SQLITE_CONSTRAINT | (8<<8))
+#define SQLITE_CONSTRAINT_VTAB (SQLITE_CONSTRAINT | (9<<8))
+#define SQLITE_CONSTRAINT_ROWID (SQLITE_CONSTRAINT |(10<<8))
+#define SQLITE_CONSTRAINT_PINNED (SQLITE_CONSTRAINT |(11<<8))
+#define SQLITE_CONSTRAINT_DATATYPE (SQLITE_CONSTRAINT |(12<<8))
+#define SQLITE_NOTICE_RECOVER_WAL (SQLITE_NOTICE | (1<<8))
+#define SQLITE_NOTICE_RECOVER_ROLLBACK (SQLITE_NOTICE | (2<<8))
+#define SQLITE_NOTICE_RBU (SQLITE_NOTICE | (3<<8))
+#define SQLITE_WARNING_AUTOINDEX (SQLITE_WARNING | (1<<8))
+#define SQLITE_AUTH_USER (SQLITE_AUTH | (1<<8))
+#define SQLITE_OK_LOAD_PERMANENTLY (SQLITE_OK | (1<<8))
+#define SQLITE_OK_SYMLINK (SQLITE_OK | (2<<8)) /* internal use only */
+
+/*
+** CAPI3REF: Flags For File Open Operations
+**
+** These bit values are intended for use in the
+** 3rd parameter to the [sqlite3_open_v2()] interface and
+** in the 4th parameter to the [sqlite3_vfs.xOpen] method.
+**
+** Only those flags marked as "Ok for sqlite3_open_v2()" may be
+** used as the third argument to the [sqlite3_open_v2()] interface.
+** The other flags have historically been ignored by sqlite3_open_v2(),
+** though future versions of SQLite might change so that an error is
+** raised if any of the disallowed bits are passed into sqlite3_open_v2().
+** Applications should not depend on the historical behavior.
+**
+** Note in particular that passing the SQLITE_OPEN_EXCLUSIVE flag into
+** [sqlite3_open_v2()] does *not* cause the underlying database file
+** to be opened using O_EXCL. Passing SQLITE_OPEN_EXCLUSIVE into
+** [sqlite3_open_v2()] has historically be a no-op and might become an
+** error in future versions of SQLite.
+*/
+#define SQLITE_OPEN_READONLY 0x00000001 /* Ok for sqlite3_open_v2() */
+#define SQLITE_OPEN_READWRITE 0x00000002 /* Ok for sqlite3_open_v2() */
+#define SQLITE_OPEN_CREATE 0x00000004 /* Ok for sqlite3_open_v2() */
+#define SQLITE_OPEN_DELETEONCLOSE 0x00000008 /* VFS only */
+#define SQLITE_OPEN_EXCLUSIVE 0x00000010 /* VFS only */
+#define SQLITE_OPEN_AUTOPROXY 0x00000020 /* VFS only */
+#define SQLITE_OPEN_URI 0x00000040 /* Ok for sqlite3_open_v2() */
+#define SQLITE_OPEN_MEMORY 0x00000080 /* Ok for sqlite3_open_v2() */
+#define SQLITE_OPEN_MAIN_DB 0x00000100 /* VFS only */
+#define SQLITE_OPEN_TEMP_DB 0x00000200 /* VFS only */
+#define SQLITE_OPEN_TRANSIENT_DB 0x00000400 /* VFS only */
+#define SQLITE_OPEN_MAIN_JOURNAL 0x00000800 /* VFS only */
+#define SQLITE_OPEN_TEMP_JOURNAL 0x00001000 /* VFS only */
+#define SQLITE_OPEN_SUBJOURNAL 0x00002000 /* VFS only */
+#define SQLITE_OPEN_SUPER_JOURNAL 0x00004000 /* VFS only */
+#define SQLITE_OPEN_NOMUTEX 0x00008000 /* Ok for sqlite3_open_v2() */
+#define SQLITE_OPEN_FULLMUTEX 0x00010000 /* Ok for sqlite3_open_v2() */
+#define SQLITE_OPEN_SHAREDCACHE 0x00020000 /* Ok for sqlite3_open_v2() */
+#define SQLITE_OPEN_PRIVATECACHE 0x00040000 /* Ok for sqlite3_open_v2() */
+#define SQLITE_OPEN_WAL 0x00080000 /* VFS only */
+#define SQLITE_OPEN_NOFOLLOW 0x01000000 /* Ok for sqlite3_open_v2() */
+#define SQLITE_OPEN_EXRESCODE 0x02000000 /* Extended result codes */
+
+/* Reserved: 0x00F00000 */
+/* Legacy compatibility: */
+#define SQLITE_OPEN_MASTER_JOURNAL 0x00004000 /* VFS only */
+
+
+/*
+** CAPI3REF: Device Characteristics
+**
+** The xDeviceCharacteristics method of the [sqlite3_io_methods]
+** object returns an integer which is a vector of these
+** bit values expressing I/O characteristics of the mass storage
+** device that holds the file that the [sqlite3_io_methods]
+** refers to.
+**
+** The SQLITE_IOCAP_ATOMIC property means that all writes of
+** any size are atomic. The SQLITE_IOCAP_ATOMICnnn values
+** mean that writes of blocks that are nnn bytes in size and
+** are aligned to an address which is an integer multiple of
+** nnn are atomic. The SQLITE_IOCAP_SAFE_APPEND value means
+** that when data is appended to a file, the data is appended
+** first then the size of the file is extended, never the other
+** way around. The SQLITE_IOCAP_SEQUENTIAL property means that
+** information is written to disk in the same order as calls
+** to xWrite(). The SQLITE_IOCAP_POWERSAFE_OVERWRITE property means that
+** after reboot following a crash or power loss, the only bytes in a
+** file that were written at the application level might have changed
+** and that adjacent bytes, even bytes within the same sector are
+** guaranteed to be unchanged. The SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN
+** flag indicates that a file cannot be deleted when open. The
+** SQLITE_IOCAP_IMMUTABLE flag indicates that the file is on
+** read-only media and cannot be changed even by processes with
+** elevated privileges.
+**
+** The SQLITE_IOCAP_BATCH_ATOMIC property means that the underlying
+** filesystem supports doing multiple write operations atomically when those
+** write operations are bracketed by [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE] and
+** [SQLITE_FCNTL_COMMIT_ATOMIC_WRITE].
+**
+** The SQLITE_IOCAP_SUBPAGE_READ property means that it is ok to read
+** from the database file in amounts that are not a multiple of the
+** page size and that do not begin at a page boundary. Without this
+** property, SQLite is careful to only do full-page reads and write
+** on aligned pages, with the one exception that it will do a sub-page
+** read of the first page to access the database header.
+*/
+#define SQLITE_IOCAP_ATOMIC 0x00000001
+#define SQLITE_IOCAP_ATOMIC512 0x00000002
+#define SQLITE_IOCAP_ATOMIC1K 0x00000004
+#define SQLITE_IOCAP_ATOMIC2K 0x00000008
+#define SQLITE_IOCAP_ATOMIC4K 0x00000010
+#define SQLITE_IOCAP_ATOMIC8K 0x00000020
+#define SQLITE_IOCAP_ATOMIC16K 0x00000040
+#define SQLITE_IOCAP_ATOMIC32K 0x00000080
+#define SQLITE_IOCAP_ATOMIC64K 0x00000100
+#define SQLITE_IOCAP_SAFE_APPEND 0x00000200
+#define SQLITE_IOCAP_SEQUENTIAL 0x00000400
+#define SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN 0x00000800
+#define SQLITE_IOCAP_POWERSAFE_OVERWRITE 0x00001000
+#define SQLITE_IOCAP_IMMUTABLE 0x00002000
+#define SQLITE_IOCAP_BATCH_ATOMIC 0x00004000
+#define SQLITE_IOCAP_SUBPAGE_READ 0x00008000
+
+/*
+** CAPI3REF: File Locking Levels
+**
+** SQLite uses one of these integer values as the second
+** argument to calls it makes to the xLock() and xUnlock() methods
+** of an [sqlite3_io_methods] object. These values are ordered from
+** lest restrictive to most restrictive.
+**
+** The argument to xLock() is always SHARED or higher. The argument to
+** xUnlock is either SHARED or NONE.
+*/
+#define SQLITE_LOCK_NONE 0 /* xUnlock() only */
+#define SQLITE_LOCK_SHARED 1 /* xLock() or xUnlock() */
+#define SQLITE_LOCK_RESERVED 2 /* xLock() only */
+#define SQLITE_LOCK_PENDING 3 /* xLock() only */
+#define SQLITE_LOCK_EXCLUSIVE 4 /* xLock() only */
+
+/*
+** CAPI3REF: Synchronization Type Flags
+**
+** When SQLite invokes the xSync() method of an
+** [sqlite3_io_methods] object it uses a combination of
+** these integer values as the second argument.
+**
+** When the SQLITE_SYNC_DATAONLY flag is used, it means that the
+** sync operation only needs to flush data to mass storage. Inode
+** information need not be flushed. If the lower four bits of the flag
+** equal SQLITE_SYNC_NORMAL, that means to use normal fsync() semantics.
+** If the lower four bits equal SQLITE_SYNC_FULL, that means
+** to use Mac OS X style fullsync instead of fsync().
+**
+** Do not confuse the SQLITE_SYNC_NORMAL and SQLITE_SYNC_FULL flags
+** with the [PRAGMA synchronous]=NORMAL and [PRAGMA synchronous]=FULL
+** settings. The [synchronous pragma] determines when calls to the
+** xSync VFS method occur and applies uniformly across all platforms.
+** The SQLITE_SYNC_NORMAL and SQLITE_SYNC_FULL flags determine how
+** energetic or rigorous or forceful the sync operations are and
+** only make a difference on Mac OSX for the default SQLite code.
+** (Third-party VFS implementations might also make the distinction
+** between SQLITE_SYNC_NORMAL and SQLITE_SYNC_FULL, but among the
+** operating systems natively supported by SQLite, only Mac OSX
+** cares about the difference.)
+*/
+#define SQLITE_SYNC_NORMAL 0x00002
+#define SQLITE_SYNC_FULL 0x00003
+#define SQLITE_SYNC_DATAONLY 0x00010
+
+/*
+** CAPI3REF: OS Interface Open File Handle
+**
+** An [sqlite3_file] object represents an open file in the
+** [sqlite3_vfs | OS interface layer]. Individual OS interface
+** implementations will
+** want to subclass this object by appending additional fields
+** for their own use. The pMethods entry is a pointer to an
+** [sqlite3_io_methods] object that defines methods for performing
+** I/O operations on the open file.
+*/
+typedef struct sqlite3_file sqlite3_file;
+struct sqlite3_file {
+ const struct sqlite3_io_methods *pMethods; /* Methods for an open file */
+};
+
+/*
+** CAPI3REF: OS Interface File Virtual Methods Object
+**
+** Every file opened by the [sqlite3_vfs.xOpen] method populates an
+** [sqlite3_file] object (or, more commonly, a subclass of the
+** [sqlite3_file] object) with a pointer to an instance of this object.
+** This object defines the methods used to perform various operations
+** against the open file represented by the [sqlite3_file] object.
+**
+** If the [sqlite3_vfs.xOpen] method sets the sqlite3_file.pMethods element
+** to a non-NULL pointer, then the sqlite3_io_methods.xClose method
+** may be invoked even if the [sqlite3_vfs.xOpen] reported that it failed. The
+** only way to prevent a call to xClose following a failed [sqlite3_vfs.xOpen]
+** is for the [sqlite3_vfs.xOpen] to set the sqlite3_file.pMethods element
+** to NULL.
+**
+** The flags argument to xSync may be one of [SQLITE_SYNC_NORMAL] or
+** [SQLITE_SYNC_FULL]. The first choice is the normal fsync().
+** The second choice is a Mac OS X style fullsync. The [SQLITE_SYNC_DATAONLY]
+** flag may be ORed in to indicate that only the data of the file
+** and not its inode needs to be synced.
+**
+** The integer values to xLock() and xUnlock() are one of
+**
+** [SQLITE_LOCK_NONE],
+** [SQLITE_LOCK_SHARED],
+** [SQLITE_LOCK_RESERVED],
+** [SQLITE_LOCK_PENDING], or
+** [SQLITE_LOCK_EXCLUSIVE].
+**
+** xLock() upgrades the database file lock. In other words, xLock() moves the
+** database file lock in the direction NONE toward EXCLUSIVE. The argument to
+** xLock() is always one of SHARED, RESERVED, PENDING, or EXCLUSIVE, never
+** SQLITE_LOCK_NONE. If the database file lock is already at or above the
+** requested lock, then the call to xLock() is a no-op.
+** xUnlock() downgrades the database file lock to either SHARED or NONE.
+** If the lock is already at or below the requested lock state, then the call
+** to xUnlock() is a no-op.
+** The xCheckReservedLock() method checks whether any database connection,
+** either in this process or in some other process, is holding a RESERVED,
+** PENDING, or EXCLUSIVE lock on the file. It returns, via its output
+** pointer parameter, true if such a lock exists and false otherwise.
+**
+** The xFileControl() method is a generic interface that allows custom
+** VFS implementations to directly control an open file using the
+** [sqlite3_file_control()] interface. The second "op" argument is an
+** integer opcode. The third argument is a generic pointer intended to
+** point to a structure that may contain arguments or space in which to
+** write return values. Potential uses for xFileControl() might be
+** functions to enable blocking locks with timeouts, to change the
+** locking strategy (for example to use dot-file locks), to inquire
+** about the status of a lock, or to break stale locks. The SQLite
+** core reserves all opcodes less than 100 for its own use.
+** A [file control opcodes | list of opcodes] less than 100 is available.
+** Applications that define a custom xFileControl method should use opcodes
+** greater than 100 to avoid conflicts. VFS implementations should
+** return [SQLITE_NOTFOUND] for file control opcodes that they do not
+** recognize.
+**
+** The xSectorSize() method returns the sector size of the
+** device that underlies the file. The sector size is the
+** minimum write that can be performed without disturbing
+** other bytes in the file. The xDeviceCharacteristics()
+** method returns a bit vector describing behaviors of the
+** underlying device:
+**
+**
+** [SQLITE_IOCAP_ATOMIC]
+** [SQLITE_IOCAP_ATOMIC512]
+** [SQLITE_IOCAP_ATOMIC1K]
+** [SQLITE_IOCAP_ATOMIC2K]
+** [SQLITE_IOCAP_ATOMIC4K]
+** [SQLITE_IOCAP_ATOMIC8K]
+** [SQLITE_IOCAP_ATOMIC16K]
+** [SQLITE_IOCAP_ATOMIC32K]
+** [SQLITE_IOCAP_ATOMIC64K]
+** [SQLITE_IOCAP_SAFE_APPEND]
+** [SQLITE_IOCAP_SEQUENTIAL]
+** [SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN]
+** [SQLITE_IOCAP_POWERSAFE_OVERWRITE]
+** [SQLITE_IOCAP_IMMUTABLE]
+** [SQLITE_IOCAP_BATCH_ATOMIC]
+** [SQLITE_IOCAP_SUBPAGE_READ]
+**
+**
+** The SQLITE_IOCAP_ATOMIC property means that all writes of
+** any size are atomic. The SQLITE_IOCAP_ATOMICnnn values
+** mean that writes of blocks that are nnn bytes in size and
+** are aligned to an address which is an integer multiple of
+** nnn are atomic. The SQLITE_IOCAP_SAFE_APPEND value means
+** that when data is appended to a file, the data is appended
+** first then the size of the file is extended, never the other
+** way around. The SQLITE_IOCAP_SEQUENTIAL property means that
+** information is written to disk in the same order as calls
+** to xWrite().
+**
+** If xRead() returns SQLITE_IOERR_SHORT_READ it must also fill
+** in the unread portions of the buffer with zeros. A VFS that
+** fails to zero-fill short reads might seem to work. However,
+** failure to zero-fill short reads will eventually lead to
+** database corruption.
+*/
+typedef struct sqlite3_io_methods sqlite3_io_methods;
+struct sqlite3_io_methods {
+ int iVersion;
+ int (*xClose)(sqlite3_file*);
+ int (*xRead)(sqlite3_file*, void*, int iAmt, sqlite3_int64 iOfst);
+ int (*xWrite)(sqlite3_file*, const void*, int iAmt, sqlite3_int64 iOfst);
+ int (*xTruncate)(sqlite3_file*, sqlite3_int64 size);
+ int (*xSync)(sqlite3_file*, int flags);
+ int (*xFileSize)(sqlite3_file*, sqlite3_int64 *pSize);
+ int (*xLock)(sqlite3_file*, int);
+ int (*xUnlock)(sqlite3_file*, int);
+ int (*xCheckReservedLock)(sqlite3_file*, int *pResOut);
+ int (*xFileControl)(sqlite3_file*, int op, void *pArg);
+ int (*xSectorSize)(sqlite3_file*);
+ int (*xDeviceCharacteristics)(sqlite3_file*);
+ /* Methods above are valid for version 1 */
+ int (*xShmMap)(sqlite3_file*, int iPg, int pgsz, int, void volatile**);
+ int (*xShmLock)(sqlite3_file*, int offset, int n, int flags);
+ void (*xShmBarrier)(sqlite3_file*);
+ int (*xShmUnmap)(sqlite3_file*, int deleteFlag);
+ /* Methods above are valid for version 2 */
+ int (*xFetch)(sqlite3_file*, sqlite3_int64 iOfst, int iAmt, void **pp);
+ int (*xUnfetch)(sqlite3_file*, sqlite3_int64 iOfst, void *p);
+ /* Methods above are valid for version 3 */
+ /* Additional methods may be added in future releases */
+};
+
+/*
+** CAPI3REF: Standard File Control Opcodes
+** KEYWORDS: {file control opcodes} {file control opcode}
+**
+** These integer constants are opcodes for the xFileControl method
+** of the [sqlite3_io_methods] object and for the [sqlite3_file_control()]
+** interface.
+**
+**
+** [[SQLITE_FCNTL_LOCKSTATE]]
+** The [SQLITE_FCNTL_LOCKSTATE] opcode is used for debugging. This
+** opcode causes the xFileControl method to write the current state of
+** the lock (one of [SQLITE_LOCK_NONE], [SQLITE_LOCK_SHARED],
+** [SQLITE_LOCK_RESERVED], [SQLITE_LOCK_PENDING], or [SQLITE_LOCK_EXCLUSIVE])
+** into an integer that the pArg argument points to.
+** This capability is only available if SQLite is compiled with [SQLITE_DEBUG].
+**
+** [[SQLITE_FCNTL_SIZE_HINT]]
+** The [SQLITE_FCNTL_SIZE_HINT] opcode is used by SQLite to give the VFS
+** layer a hint of how large the database file will grow to be during the
+** current transaction. This hint is not guaranteed to be accurate but it
+** is often close. The underlying VFS might choose to preallocate database
+** file space based on this hint in order to help writes to the database
+** file run faster.
+**
+** [[SQLITE_FCNTL_SIZE_LIMIT]]
+** The [SQLITE_FCNTL_SIZE_LIMIT] opcode is used by in-memory VFS that
+** implements [sqlite3_deserialize()] to set an upper bound on the size
+** of the in-memory database. The argument is a pointer to a [sqlite3_int64].
+** If the integer pointed to is negative, then it is filled in with the
+** current limit. Otherwise the limit is set to the larger of the value
+** of the integer pointed to and the current database size. The integer
+** pointed to is set to the new limit.
+**
+** [[SQLITE_FCNTL_CHUNK_SIZE]]
+** The [SQLITE_FCNTL_CHUNK_SIZE] opcode is used to request that the VFS
+** extends and truncates the database file in chunks of a size specified
+** by the user. The fourth argument to [sqlite3_file_control()] should
+** point to an integer (type int) containing the new chunk-size to use
+** for the nominated database. Allocating database file space in large
+** chunks (say 1MB at a time), may reduce file-system fragmentation and
+** improve performance on some systems.
+**
+** [[SQLITE_FCNTL_FILE_POINTER]]
+** The [SQLITE_FCNTL_FILE_POINTER] opcode is used to obtain a pointer
+** to the [sqlite3_file] object associated with a particular database
+** connection. See also [SQLITE_FCNTL_JOURNAL_POINTER].
+**
+** [[SQLITE_FCNTL_JOURNAL_POINTER]]
+** The [SQLITE_FCNTL_JOURNAL_POINTER] opcode is used to obtain a pointer
+** to the [sqlite3_file] object associated with the journal file (either
+** the [rollback journal] or the [write-ahead log]) for a particular database
+** connection. See also [SQLITE_FCNTL_FILE_POINTER].
+**
+** [[SQLITE_FCNTL_SYNC_OMITTED]]
+** No longer in use.
+**
+** [[SQLITE_FCNTL_SYNC]]
+** The [SQLITE_FCNTL_SYNC] opcode is generated internally by SQLite and
+** sent to the VFS immediately before the xSync method is invoked on a
+** database file descriptor. Or, if the xSync method is not invoked
+** because the user has configured SQLite with
+** [PRAGMA synchronous | PRAGMA synchronous=OFF] it is invoked in place
+** of the xSync method. In most cases, the pointer argument passed with
+** this file-control is NULL. However, if the database file is being synced
+** as part of a multi-database commit, the argument points to a nul-terminated
+** string containing the transactions super-journal file name. VFSes that
+** do not need this signal should silently ignore this opcode. Applications
+** should not call [sqlite3_file_control()] with this opcode as doing so may
+** disrupt the operation of the specialized VFSes that do require it.
+**
+** [[SQLITE_FCNTL_COMMIT_PHASETWO]]
+** The [SQLITE_FCNTL_COMMIT_PHASETWO] opcode is generated internally by SQLite
+** and sent to the VFS after a transaction has been committed immediately
+** but before the database is unlocked. VFSes that do not need this signal
+** should silently ignore this opcode. Applications should not call
+** [sqlite3_file_control()] with this opcode as doing so may disrupt the
+** operation of the specialized VFSes that do require it.
+**
+** [[SQLITE_FCNTL_WIN32_AV_RETRY]]
+** ^The [SQLITE_FCNTL_WIN32_AV_RETRY] opcode is used to configure automatic
+** retry counts and intervals for certain disk I/O operations for the
+** windows [VFS] in order to provide robustness in the presence of
+** anti-virus programs. By default, the windows VFS will retry file read,
+** file write, and file delete operations up to 10 times, with a delay
+** of 25 milliseconds before the first retry and with the delay increasing
+** by an additional 25 milliseconds with each subsequent retry. This
+** opcode allows these two values (10 retries and 25 milliseconds of delay)
+** to be adjusted. The values are changed for all database connections
+** within the same process. The argument is a pointer to an array of two
+** integers where the first integer is the new retry count and the second
+** integer is the delay. If either integer is negative, then the setting
+** is not changed but instead the prior value of that setting is written
+** into the array entry, allowing the current retry settings to be
+** interrogated. The zDbName parameter is ignored.
+**
+** [[SQLITE_FCNTL_PERSIST_WAL]]
+** ^The [SQLITE_FCNTL_PERSIST_WAL] opcode is used to set or query the
+** persistent [WAL | Write Ahead Log] setting. By default, the auxiliary
+** write ahead log ([WAL file]) and shared memory
+** files used for transaction control
+** are automatically deleted when the latest connection to the database
+** closes. Setting persistent WAL mode causes those files to persist after
+** close. Persisting the files is useful when other processes that do not
+** have write permission on the directory containing the database file want
+** to read the database file, as the WAL and shared memory files must exist
+** in order for the database to be readable. The fourth parameter to
+** [sqlite3_file_control()] for this opcode should be a pointer to an integer.
+** That integer is 0 to disable persistent WAL mode or 1 to enable persistent
+** WAL mode. If the integer is -1, then it is overwritten with the current
+** WAL persistence setting.
+**
+** [[SQLITE_FCNTL_POWERSAFE_OVERWRITE]]
+** ^The [SQLITE_FCNTL_POWERSAFE_OVERWRITE] opcode is used to set or query the
+** persistent "powersafe-overwrite" or "PSOW" setting. The PSOW setting
+** determines the [SQLITE_IOCAP_POWERSAFE_OVERWRITE] bit of the
+** xDeviceCharacteristics methods. The fourth parameter to
+** [sqlite3_file_control()] for this opcode should be a pointer to an integer.
+** That integer is 0 to disable zero-damage mode or 1 to enable zero-damage
+** mode. If the integer is -1, then it is overwritten with the current
+** zero-damage mode setting.
+**
+** [[SQLITE_FCNTL_OVERWRITE]]
+** ^The [SQLITE_FCNTL_OVERWRITE] opcode is invoked by SQLite after opening
+** a write transaction to indicate that, unless it is rolled back for some
+** reason, the entire database file will be overwritten by the current
+** transaction. This is used by VACUUM operations.
+**
+** [[SQLITE_FCNTL_VFSNAME]]
+** ^The [SQLITE_FCNTL_VFSNAME] opcode can be used to obtain the names of
+** all [VFSes] in the VFS stack. The names are of all VFS shims and the
+** final bottom-level VFS are written into memory obtained from
+** [sqlite3_malloc()] and the result is stored in the char* variable
+** that the fourth parameter of [sqlite3_file_control()] points to.
+** The caller is responsible for freeing the memory when done. As with
+** all file-control actions, there is no guarantee that this will actually
+** do anything. Callers should initialize the char* variable to a NULL
+** pointer in case this file-control is not implemented. This file-control
+** is intended for diagnostic use only.
+**
+** [[SQLITE_FCNTL_VFS_POINTER]]
+** ^The [SQLITE_FCNTL_VFS_POINTER] opcode finds a pointer to the top-level
+** [VFSes] currently in use. ^(The argument X in
+** sqlite3_file_control(db,SQLITE_FCNTL_VFS_POINTER,X) must be
+** of type "[sqlite3_vfs] **". This opcodes will set *X
+** to a pointer to the top-level VFS.)^
+** ^When there are multiple VFS shims in the stack, this opcode finds the
+** upper-most shim only.
+**
+** [[SQLITE_FCNTL_PRAGMA]]
+** ^Whenever a [PRAGMA] statement is parsed, an [SQLITE_FCNTL_PRAGMA]
+** file control is sent to the open [sqlite3_file] object corresponding
+** to the database file to which the pragma statement refers. ^The argument
+** to the [SQLITE_FCNTL_PRAGMA] file control is an array of
+** pointers to strings (char**) in which the second element of the array
+** is the name of the pragma and the third element is the argument to the
+** pragma or NULL if the pragma has no argument. ^The handler for an
+** [SQLITE_FCNTL_PRAGMA] file control can optionally make the first element
+** of the char** argument point to a string obtained from [sqlite3_mprintf()]
+** or the equivalent and that string will become the result of the pragma or
+** the error message if the pragma fails. ^If the
+** [SQLITE_FCNTL_PRAGMA] file control returns [SQLITE_NOTFOUND], then normal
+** [PRAGMA] processing continues. ^If the [SQLITE_FCNTL_PRAGMA]
+** file control returns [SQLITE_OK], then the parser assumes that the
+** VFS has handled the PRAGMA itself and the parser generates a no-op
+** prepared statement if result string is NULL, or that returns a copy
+** of the result string if the string is non-NULL.
+** ^If the [SQLITE_FCNTL_PRAGMA] file control returns
+** any result code other than [SQLITE_OK] or [SQLITE_NOTFOUND], that means
+** that the VFS encountered an error while handling the [PRAGMA] and the
+** compilation of the PRAGMA fails with an error. ^The [SQLITE_FCNTL_PRAGMA]
+** file control occurs at the beginning of pragma statement analysis and so
+** it is able to override built-in [PRAGMA] statements.
+**
+** [[SQLITE_FCNTL_BUSYHANDLER]]
+** ^The [SQLITE_FCNTL_BUSYHANDLER]
+** file-control may be invoked by SQLite on the database file handle
+** shortly after it is opened in order to provide a custom VFS with access
+** to the connection's busy-handler callback. The argument is of type (void**)
+** - an array of two (void *) values. The first (void *) actually points
+** to a function of type (int (*)(void *)). In order to invoke the connection's
+** busy-handler, this function should be invoked with the second (void *) in
+** the array as the only argument. If it returns non-zero, then the operation
+** should be retried. If it returns zero, the custom VFS should abandon the
+** current operation.
+**
+** [[SQLITE_FCNTL_TEMPFILENAME]]
+** ^Applications can invoke the [SQLITE_FCNTL_TEMPFILENAME] file-control
+** to have SQLite generate a
+** temporary filename using the same algorithm that is followed to generate
+** temporary filenames for TEMP tables and other internal uses. The
+** argument should be a char** which will be filled with the filename
+** written into memory obtained from [sqlite3_malloc()]. The caller should
+** invoke [sqlite3_free()] on the result to avoid a memory leak.
+**
+** [[SQLITE_FCNTL_MMAP_SIZE]]
+** The [SQLITE_FCNTL_MMAP_SIZE] file control is used to query or set the
+** maximum number of bytes that will be used for memory-mapped I/O.
+** The argument is a pointer to a value of type sqlite3_int64 that
+** is an advisory maximum number of bytes in the file to memory map. The
+** pointer is overwritten with the old value. The limit is not changed if
+** the value originally pointed to is negative, and so the current limit
+** can be queried by passing in a pointer to a negative number. This
+** file-control is used internally to implement [PRAGMA mmap_size].
+**
+** [[SQLITE_FCNTL_TRACE]]
+** The [SQLITE_FCNTL_TRACE] file control provides advisory information
+** to the VFS about what the higher layers of the SQLite stack are doing.
+** This file control is used by some VFS activity tracing [shims].
+** The argument is a zero-terminated string. Higher layers in the
+** SQLite stack may generate instances of this file control if
+** the [SQLITE_USE_FCNTL_TRACE] compile-time option is enabled.
+**
+** [[SQLITE_FCNTL_HAS_MOVED]]
+** The [SQLITE_FCNTL_HAS_MOVED] file control interprets its argument as a
+** pointer to an integer and it writes a boolean into that integer depending
+** on whether or not the file has been renamed, moved, or deleted since it
+** was first opened.
+**
+** [[SQLITE_FCNTL_WIN32_GET_HANDLE]]
+** The [SQLITE_FCNTL_WIN32_GET_HANDLE] opcode can be used to obtain the
+** underlying native file handle associated with a file handle. This file
+** control interprets its argument as a pointer to a native file handle and
+** writes the resulting value there.
+**
+** [[SQLITE_FCNTL_WIN32_SET_HANDLE]]
+** The [SQLITE_FCNTL_WIN32_SET_HANDLE] opcode is used for debugging. This
+** opcode causes the xFileControl method to swap the file handle with the one
+** pointed to by the pArg argument. This capability is used during testing
+** and only needs to be supported when SQLITE_TEST is defined.
+**
+** [[SQLITE_FCNTL_NULL_IO]]
+** The [SQLITE_FCNTL_NULL_IO] opcode sets the low-level file descriptor
+** or file handle for the [sqlite3_file] object such that it will no longer
+** read or write to the database file.
+**
+** [[SQLITE_FCNTL_WAL_BLOCK]]
+** The [SQLITE_FCNTL_WAL_BLOCK] is a signal to the VFS layer that it might
+** be advantageous to block on the next WAL lock if the lock is not immediately
+** available. The WAL subsystem issues this signal during rare
+** circumstances in order to fix a problem with priority inversion.
+** Applications should not use this file-control.
+**
+** [[SQLITE_FCNTL_ZIPVFS]]
+** The [SQLITE_FCNTL_ZIPVFS] opcode is implemented by zipvfs only. All other
+** VFS should return SQLITE_NOTFOUND for this opcode.
+**
+** [[SQLITE_FCNTL_RBU]]
+** The [SQLITE_FCNTL_RBU] opcode is implemented by the special VFS used by
+** the RBU extension only. All other VFS should return SQLITE_NOTFOUND for
+** this opcode.
+**
+** [[SQLITE_FCNTL_BEGIN_ATOMIC_WRITE]]
+** If the [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE] opcode returns SQLITE_OK, then
+** the file descriptor is placed in "batch write mode", which
+** means all subsequent write operations will be deferred and done
+** atomically at the next [SQLITE_FCNTL_COMMIT_ATOMIC_WRITE]. Systems
+** that do not support batch atomic writes will return SQLITE_NOTFOUND.
+** ^Following a successful SQLITE_FCNTL_BEGIN_ATOMIC_WRITE and prior to
+** the closing [SQLITE_FCNTL_COMMIT_ATOMIC_WRITE] or
+** [SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE], SQLite will make
+** no VFS interface calls on the same [sqlite3_file] file descriptor
+** except for calls to the xWrite method and the xFileControl method
+** with [SQLITE_FCNTL_SIZE_HINT].
+**
+** [[SQLITE_FCNTL_COMMIT_ATOMIC_WRITE]]
+** The [SQLITE_FCNTL_COMMIT_ATOMIC_WRITE] opcode causes all write
+** operations since the previous successful call to
+** [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE] to be performed atomically.
+** This file control returns [SQLITE_OK] if and only if the writes were
+** all performed successfully and have been committed to persistent storage.
+** ^Regardless of whether or not it is successful, this file control takes
+** the file descriptor out of batch write mode so that all subsequent
+** write operations are independent.
+** ^SQLite will never invoke SQLITE_FCNTL_COMMIT_ATOMIC_WRITE without
+** a prior successful call to [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE].
+**
+** [[SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE]]
+** The [SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE] opcode causes all write
+** operations since the previous successful call to
+** [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE] to be rolled back.
+** ^This file control takes the file descriptor out of batch write mode
+** so that all subsequent write operations are independent.
+** ^SQLite will never invoke SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE without
+** a prior successful call to [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE].
+**
+** [[SQLITE_FCNTL_LOCK_TIMEOUT]]
+** The [SQLITE_FCNTL_LOCK_TIMEOUT] opcode is used to configure a VFS
+** to block for up to M milliseconds before failing when attempting to
+** obtain a file lock using the xLock or xShmLock methods of the VFS.
+** The parameter is a pointer to a 32-bit signed integer that contains
+** the value that M is to be set to. Before returning, the 32-bit signed
+** integer is overwritten with the previous value of M.
+**
+** [[SQLITE_FCNTL_BLOCK_ON_CONNECT]]
+** The [SQLITE_FCNTL_BLOCK_ON_CONNECT] opcode is used to configure the
+** VFS to block when taking a SHARED lock to connect to a wal mode database.
+** This is used to implement the functionality associated with
+** SQLITE_SETLK_BLOCK_ON_CONNECT.
+**
+** [[SQLITE_FCNTL_DATA_VERSION]]
+** The [SQLITE_FCNTL_DATA_VERSION] opcode is used to detect changes to
+** a database file. The argument is a pointer to a 32-bit unsigned integer.
+** The "data version" for the pager is written into the pointer. The
+** "data version" changes whenever any change occurs to the corresponding
+** database file, either through SQL statements on the same database
+** connection or through transactions committed by separate database
+** connections possibly in other processes. The [sqlite3_total_changes()]
+** interface can be used to find if any database on the connection has changed,
+** but that interface responds to changes on TEMP as well as MAIN and does
+** not provide a mechanism to detect changes to MAIN only. Also, the
+** [sqlite3_total_changes()] interface responds to internal changes only and
+** omits changes made by other database connections. The
+** [PRAGMA data_version] command provides a mechanism to detect changes to
+** a single attached database that occur due to other database connections,
+** but omits changes implemented by the database connection on which it is
+** called. This file control is the only mechanism to detect changes that
+** happen either internally or externally and that are associated with
+** a particular attached database.
+**
+** [[SQLITE_FCNTL_CKPT_START]]
+** The [SQLITE_FCNTL_CKPT_START] opcode is invoked from within a checkpoint
+** in wal mode before the client starts to copy pages from the wal
+** file to the database file.
+**
+** [[SQLITE_FCNTL_CKPT_DONE]]
+** The [SQLITE_FCNTL_CKPT_DONE] opcode is invoked from within a checkpoint
+** in wal mode after the client has finished copying pages from the wal
+** file to the database file, but before the *-shm file is updated to
+** record the fact that the pages have been checkpointed.
+**
+** [[SQLITE_FCNTL_EXTERNAL_READER]]
+** The EXPERIMENTAL [SQLITE_FCNTL_EXTERNAL_READER] opcode is used to detect
+** whether or not there is a database client in another process with a wal-mode
+** transaction open on the database or not. It is only available on unix.The
+** (void*) argument passed with this file-control should be a pointer to a
+** value of type (int). The integer value is set to 1 if the database is a wal
+** mode database and there exists at least one client in another process that
+** currently has an SQL transaction open on the database. It is set to 0 if
+** the database is not a wal-mode db, or if there is no such connection in any
+** other process. This opcode cannot be used to detect transactions opened
+** by clients within the current process, only within other processes.
+**
+** [[SQLITE_FCNTL_CKSM_FILE]]
+** The [SQLITE_FCNTL_CKSM_FILE] opcode is for use internally by the
+** [checksum VFS shim] only.
+**
+** [[SQLITE_FCNTL_RESET_CACHE]]
+** If there is currently no transaction open on the database, and the
+** database is not a temp db, then the [SQLITE_FCNTL_RESET_CACHE] file-control
+** purges the contents of the in-memory page cache. If there is an open
+** transaction, or if the db is a temp-db, this opcode is a no-op, not an error.
+**
+*/
+#define SQLITE_FCNTL_LOCKSTATE 1
+#define SQLITE_FCNTL_GET_LOCKPROXYFILE 2
+#define SQLITE_FCNTL_SET_LOCKPROXYFILE 3
+#define SQLITE_FCNTL_LAST_ERRNO 4
+#define SQLITE_FCNTL_SIZE_HINT 5
+#define SQLITE_FCNTL_CHUNK_SIZE 6
+#define SQLITE_FCNTL_FILE_POINTER 7
+#define SQLITE_FCNTL_SYNC_OMITTED 8
+#define SQLITE_FCNTL_WIN32_AV_RETRY 9
+#define SQLITE_FCNTL_PERSIST_WAL 10
+#define SQLITE_FCNTL_OVERWRITE 11
+#define SQLITE_FCNTL_VFSNAME 12
+#define SQLITE_FCNTL_POWERSAFE_OVERWRITE 13
+#define SQLITE_FCNTL_PRAGMA 14
+#define SQLITE_FCNTL_BUSYHANDLER 15
+#define SQLITE_FCNTL_TEMPFILENAME 16
+#define SQLITE_FCNTL_MMAP_SIZE 18
+#define SQLITE_FCNTL_TRACE 19
+#define SQLITE_FCNTL_HAS_MOVED 20
+#define SQLITE_FCNTL_SYNC 21
+#define SQLITE_FCNTL_COMMIT_PHASETWO 22
+#define SQLITE_FCNTL_WIN32_SET_HANDLE 23
+#define SQLITE_FCNTL_WAL_BLOCK 24
+#define SQLITE_FCNTL_ZIPVFS 25
+#define SQLITE_FCNTL_RBU 26
+#define SQLITE_FCNTL_VFS_POINTER 27
+#define SQLITE_FCNTL_JOURNAL_POINTER 28
+#define SQLITE_FCNTL_WIN32_GET_HANDLE 29
+#define SQLITE_FCNTL_PDB 30
+#define SQLITE_FCNTL_BEGIN_ATOMIC_WRITE 31
+#define SQLITE_FCNTL_COMMIT_ATOMIC_WRITE 32
+#define SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE 33
+#define SQLITE_FCNTL_LOCK_TIMEOUT 34
+#define SQLITE_FCNTL_DATA_VERSION 35
+#define SQLITE_FCNTL_SIZE_LIMIT 36
+#define SQLITE_FCNTL_CKPT_DONE 37
+#define SQLITE_FCNTL_RESERVE_BYTES 38
+#define SQLITE_FCNTL_CKPT_START 39
+#define SQLITE_FCNTL_EXTERNAL_READER 40
+#define SQLITE_FCNTL_CKSM_FILE 41
+#define SQLITE_FCNTL_RESET_CACHE 42
+#define SQLITE_FCNTL_NULL_IO 43
+#define SQLITE_FCNTL_BLOCK_ON_CONNECT 44
+
+/* deprecated names */
+#define SQLITE_GET_LOCKPROXYFILE SQLITE_FCNTL_GET_LOCKPROXYFILE
+#define SQLITE_SET_LOCKPROXYFILE SQLITE_FCNTL_SET_LOCKPROXYFILE
+#define SQLITE_LAST_ERRNO SQLITE_FCNTL_LAST_ERRNO
+
+
+/*
+** CAPI3REF: Mutex Handle
+**
+** The mutex module within SQLite defines [sqlite3_mutex] to be an
+** abstract type for a mutex object. The SQLite core never looks
+** at the internal representation of an [sqlite3_mutex]. It only
+** deals with pointers to the [sqlite3_mutex] object.
+**
+** Mutexes are created using [sqlite3_mutex_alloc()].
+*/
+typedef struct sqlite3_mutex sqlite3_mutex;
+
+/*
+** CAPI3REF: Loadable Extension Thunk
+**
+** A pointer to the opaque sqlite3_api_routines structure is passed as
+** the third parameter to entry points of [loadable extensions]. This
+** structure must be typedefed in order to work around compiler warnings
+** on some platforms.
+*/
+typedef struct sqlite3_api_routines sqlite3_api_routines;
+
+/*
+** CAPI3REF: File Name
+**
+** Type [sqlite3_filename] is used by SQLite to pass filenames to the
+** xOpen method of a [VFS]. It may be cast to (const char*) and treated
+** as a normal, nul-terminated, UTF-8 buffer containing the filename, but
+** may also be passed to special APIs such as:
+**
+**
+** sqlite3_filename_database()
+** sqlite3_filename_journal()
+** sqlite3_filename_wal()
+** sqlite3_uri_parameter()
+** sqlite3_uri_boolean()
+** sqlite3_uri_int64()
+** sqlite3_uri_key()
+**
+*/
+typedef const char *sqlite3_filename;
+
+/*
+** CAPI3REF: OS Interface Object
+**
+** An instance of the sqlite3_vfs object defines the interface between
+** the SQLite core and the underlying operating system. The "vfs"
+** in the name of the object stands for "virtual file system". See
+** the [VFS | VFS documentation] for further information.
+**
+** The VFS interface is sometimes extended by adding new methods onto
+** the end. Each time such an extension occurs, the iVersion field
+** is incremented. The iVersion value started out as 1 in
+** SQLite [version 3.5.0] on [dateof:3.5.0], then increased to 2
+** with SQLite [version 3.7.0] on [dateof:3.7.0], and then increased
+** to 3 with SQLite [version 3.7.6] on [dateof:3.7.6]. Additional fields
+** may be appended to the sqlite3_vfs object and the iVersion value
+** may increase again in future versions of SQLite.
+** Note that due to an oversight, the structure
+** of the sqlite3_vfs object changed in the transition from
+** SQLite [version 3.5.9] to [version 3.6.0] on [dateof:3.6.0]
+** and yet the iVersion field was not increased.
+**
+** The szOsFile field is the size of the subclassed [sqlite3_file]
+** structure used by this VFS. mxPathname is the maximum length of
+** a pathname in this VFS.
+**
+** Registered sqlite3_vfs objects are kept on a linked list formed by
+** the pNext pointer. The [sqlite3_vfs_register()]
+** and [sqlite3_vfs_unregister()] interfaces manage this list
+** in a thread-safe way. The [sqlite3_vfs_find()] interface
+** searches the list. Neither the application code nor the VFS
+** implementation should use the pNext pointer.
+**
+** The pNext field is the only field in the sqlite3_vfs
+** structure that SQLite will ever modify. SQLite will only access
+** or modify this field while holding a particular static mutex.
+** The application should never modify anything within the sqlite3_vfs
+** object once the object has been registered.
+**
+** The zName field holds the name of the VFS module. The name must
+** be unique across all VFS modules.
+**
+** [[sqlite3_vfs.xOpen]]
+** ^SQLite guarantees that the zFilename parameter to xOpen
+** is either a NULL pointer or string obtained
+** from xFullPathname() with an optional suffix added.
+** ^If a suffix is added to the zFilename parameter, it will
+** consist of a single "-" character followed by no more than
+** 11 alphanumeric and/or "-" characters.
+** ^SQLite further guarantees that
+** the string will be valid and unchanged until xClose() is
+** called. Because of the previous sentence,
+** the [sqlite3_file] can safely store a pointer to the
+** filename if it needs to remember the filename for some reason.
+** If the zFilename parameter to xOpen is a NULL pointer then xOpen
+** must invent its own temporary name for the file. ^Whenever the
+** xFilename parameter is NULL it will also be the case that the
+** flags parameter will include [SQLITE_OPEN_DELETEONCLOSE].
+**
+** The flags argument to xOpen() includes all bits set in
+** the flags argument to [sqlite3_open_v2()]. Or if [sqlite3_open()]
+** or [sqlite3_open16()] is used, then flags includes at least
+** [SQLITE_OPEN_READWRITE] | [SQLITE_OPEN_CREATE].
+** If xOpen() opens a file read-only then it sets *pOutFlags to
+** include [SQLITE_OPEN_READONLY]. Other bits in *pOutFlags may be set.
+**
+** ^(SQLite will also add one of the following flags to the xOpen()
+** call, depending on the object being opened:
+**
+**
+** [SQLITE_OPEN_MAIN_DB]
+** [SQLITE_OPEN_MAIN_JOURNAL]
+** [SQLITE_OPEN_TEMP_DB]
+** [SQLITE_OPEN_TEMP_JOURNAL]
+** [SQLITE_OPEN_TRANSIENT_DB]
+** [SQLITE_OPEN_SUBJOURNAL]
+** [SQLITE_OPEN_SUPER_JOURNAL]
+** [SQLITE_OPEN_WAL]
+** )^
+**
+** The file I/O implementation can use the object type flags to
+** change the way it deals with files. For example, an application
+** that does not care about crash recovery or rollback might make
+** the open of a journal file a no-op. Writes to this journal would
+** also be no-ops, and any attempt to read the journal would return
+** SQLITE_IOERR. Or the implementation might recognize that a database
+** file will be doing page-aligned sector reads and writes in a random
+** order and set up its I/O subsystem accordingly.
+**
+** SQLite might also add one of the following flags to the xOpen method:
+**
+**
+** [SQLITE_OPEN_DELETEONCLOSE]
+** [SQLITE_OPEN_EXCLUSIVE]
+**
+**
+** The [SQLITE_OPEN_DELETEONCLOSE] flag means the file should be
+** deleted when it is closed. ^The [SQLITE_OPEN_DELETEONCLOSE]
+** will be set for TEMP databases and their journals, transient
+** databases, and subjournals.
+**
+** ^The [SQLITE_OPEN_EXCLUSIVE] flag is always used in conjunction
+** with the [SQLITE_OPEN_CREATE] flag, which are both directly
+** analogous to the O_EXCL and O_CREAT flags of the POSIX open()
+** API. The SQLITE_OPEN_EXCLUSIVE flag, when paired with the
+** SQLITE_OPEN_CREATE, is used to indicate that file should always
+** be created, and that it is an error if it already exists.
+** It is not used to indicate the file should be opened
+** for exclusive access.
+**
+** ^At least szOsFile bytes of memory are allocated by SQLite
+** to hold the [sqlite3_file] structure passed as the third
+** argument to xOpen. The xOpen method does not have to
+** allocate the structure; it should just fill it in. Note that
+** the xOpen method must set the sqlite3_file.pMethods to either
+** a valid [sqlite3_io_methods] object or to NULL. xOpen must do
+** this even if the open fails. SQLite expects that the sqlite3_file.pMethods
+** element will be valid after xOpen returns regardless of the success
+** or failure of the xOpen call.
+**
+** [[sqlite3_vfs.xAccess]]
+** ^The flags argument to xAccess() may be [SQLITE_ACCESS_EXISTS]
+** to test for the existence of a file, or [SQLITE_ACCESS_READWRITE] to
+** test whether a file is readable and writable, or [SQLITE_ACCESS_READ]
+** to test whether a file is at least readable. The SQLITE_ACCESS_READ
+** flag is never actually used and is not implemented in the built-in
+** VFSes of SQLite. The file is named by the second argument and can be a
+** directory. The xAccess method returns [SQLITE_OK] on success or some
+** non-zero error code if there is an I/O error or if the name of
+** the file given in the second argument is illegal. If SQLITE_OK
+** is returned, then non-zero or zero is written into *pResOut to indicate
+** whether or not the file is accessible.
+**
+** ^SQLite will always allocate at least mxPathname+1 bytes for the
+** output buffer xFullPathname. The exact size of the output buffer
+** is also passed as a parameter to both methods. If the output buffer
+** is not large enough, [SQLITE_CANTOPEN] should be returned. Since this is
+** handled as a fatal error by SQLite, vfs implementations should endeavor
+** to prevent this by setting mxPathname to a sufficiently large value.
+**
+** The xRandomness(), xSleep(), xCurrentTime(), and xCurrentTimeInt64()
+** interfaces are not strictly a part of the filesystem, but they are
+** included in the VFS structure for completeness.
+** The xRandomness() function attempts to return nBytes bytes
+** of good-quality randomness into zOut. The return value is
+** the actual number of bytes of randomness obtained.
+** The xSleep() method causes the calling thread to sleep for at
+** least the number of microseconds given. ^The xCurrentTime()
+** method returns a Julian Day Number for the current date and time as
+** a floating point value.
+** ^The xCurrentTimeInt64() method returns, as an integer, the Julian
+** Day Number multiplied by 86400000 (the number of milliseconds in
+** a 24-hour day).
+** ^SQLite will use the xCurrentTimeInt64() method to get the current
+** date and time if that method is available (if iVersion is 2 or
+** greater and the function pointer is not NULL) and will fall back
+** to xCurrentTime() if xCurrentTimeInt64() is unavailable.
+**
+** ^The xSetSystemCall(), xGetSystemCall(), and xNestSystemCall() interfaces
+** are not used by the SQLite core. These optional interfaces are provided
+** by some VFSes to facilitate testing of the VFS code. By overriding
+** system calls with functions under its control, a test program can
+** simulate faults and error conditions that would otherwise be difficult
+** or impossible to induce. The set of system calls that can be overridden
+** varies from one VFS to another, and from one version of the same VFS to the
+** next. Applications that use these interfaces must be prepared for any
+** or all of these interfaces to be NULL or for their behavior to change
+** from one release to the next. Applications must not attempt to access
+** any of these methods if the iVersion of the VFS is less than 3.
+*/
+typedef struct sqlite3_vfs sqlite3_vfs;
+typedef void (*sqlite3_syscall_ptr)(void);
+struct sqlite3_vfs {
+ int iVersion; /* Structure version number (currently 3) */
+ int szOsFile; /* Size of subclassed sqlite3_file */
+ int mxPathname; /* Maximum file pathname length */
+ sqlite3_vfs *pNext; /* Next registered VFS */
+ const char *zName; /* Name of this virtual file system */
+ void *pAppData; /* Pointer to application-specific data */
+ int (*xOpen)(sqlite3_vfs*, sqlite3_filename zName, sqlite3_file*,
+ int flags, int *pOutFlags);
+ int (*xDelete)(sqlite3_vfs*, const char *zName, int syncDir);
+ int (*xAccess)(sqlite3_vfs*, const char *zName, int flags, int *pResOut);
+ int (*xFullPathname)(sqlite3_vfs*, const char *zName, int nOut, char *zOut);
+ void *(*xDlOpen)(sqlite3_vfs*, const char *zFilename);
+ void (*xDlError)(sqlite3_vfs*, int nByte, char *zErrMsg);
+ void (*(*xDlSym)(sqlite3_vfs*,void*, const char *zSymbol))(void);
+ void (*xDlClose)(sqlite3_vfs*, void*);
+ int (*xRandomness)(sqlite3_vfs*, int nByte, char *zOut);
+ int (*xSleep)(sqlite3_vfs*, int microseconds);
+ int (*xCurrentTime)(sqlite3_vfs*, double*);
+ int (*xGetLastError)(sqlite3_vfs*, int, char *);
+ /*
+ ** The methods above are in version 1 of the sqlite_vfs object
+ ** definition. Those that follow are added in version 2 or later
+ */
+ int (*xCurrentTimeInt64)(sqlite3_vfs*, sqlite3_int64*);
+ /*
+ ** The methods above are in versions 1 and 2 of the sqlite_vfs object.
+ ** Those below are for version 3 and greater.
+ */
+ int (*xSetSystemCall)(sqlite3_vfs*, const char *zName, sqlite3_syscall_ptr);
+ sqlite3_syscall_ptr (*xGetSystemCall)(sqlite3_vfs*, const char *zName);
+ const char *(*xNextSystemCall)(sqlite3_vfs*, const char *zName);
+ /*
+ ** The methods above are in versions 1 through 3 of the sqlite_vfs object.
+ ** New fields may be appended in future versions. The iVersion
+ ** value will increment whenever this happens.
+ */
+};
+
+/*
+** CAPI3REF: Flags for the xAccess VFS method
+**
+** These integer constants can be used as the third parameter to
+** the xAccess method of an [sqlite3_vfs] object. They determine
+** what kind of permissions the xAccess method is looking for.
+** With SQLITE_ACCESS_EXISTS, the xAccess method
+** simply checks whether the file exists.
+** With SQLITE_ACCESS_READWRITE, the xAccess method
+** checks whether the named directory is both readable and writable
+** (in other words, if files can be added, removed, and renamed within
+** the directory).
+** The SQLITE_ACCESS_READWRITE constant is currently used only by the
+** [temp_store_directory pragma], though this could change in a future
+** release of SQLite.
+** With SQLITE_ACCESS_READ, the xAccess method
+** checks whether the file is readable. The SQLITE_ACCESS_READ constant is
+** currently unused, though it might be used in a future release of
+** SQLite.
+*/
+#define SQLITE_ACCESS_EXISTS 0
+#define SQLITE_ACCESS_READWRITE 1 /* Used by PRAGMA temp_store_directory */
+#define SQLITE_ACCESS_READ 2 /* Unused */
+
+/*
+** CAPI3REF: Flags for the xShmLock VFS method
+**
+** These integer constants define the various locking operations
+** allowed by the xShmLock method of [sqlite3_io_methods]. The
+** following are the only legal combinations of flags to the
+** xShmLock method:
+**
+**
+** SQLITE_SHM_LOCK | SQLITE_SHM_SHARED
+** SQLITE_SHM_LOCK | SQLITE_SHM_EXCLUSIVE
+** SQLITE_SHM_UNLOCK | SQLITE_SHM_SHARED
+** SQLITE_SHM_UNLOCK | SQLITE_SHM_EXCLUSIVE
+**
+**
+** When unlocking, the same SHARED or EXCLUSIVE flag must be supplied as
+** was given on the corresponding lock.
+**
+** The xShmLock method can transition between unlocked and SHARED or
+** between unlocked and EXCLUSIVE. It cannot transition between SHARED
+** and EXCLUSIVE.
+*/
+#define SQLITE_SHM_UNLOCK 1
+#define SQLITE_SHM_LOCK 2
+#define SQLITE_SHM_SHARED 4
+#define SQLITE_SHM_EXCLUSIVE 8
+
+/*
+** CAPI3REF: Maximum xShmLock index
+**
+** The xShmLock method on [sqlite3_io_methods] may use values
+** between 0 and this upper bound as its "offset" argument.
+** The SQLite core will never attempt to acquire or release a
+** lock outside of this range
+*/
+#define SQLITE_SHM_NLOCK 8
+
+
+/*
+** CAPI3REF: Initialize The SQLite Library
+**
+** ^The sqlite3_initialize() routine initializes the
+** SQLite library. ^The sqlite3_shutdown() routine
+** deallocates any resources that were allocated by sqlite3_initialize().
+** These routines are designed to aid in process initialization and
+** shutdown on embedded systems. Workstation applications using
+** SQLite normally do not need to invoke either of these routines.
+**
+** A call to sqlite3_initialize() is an "effective" call if it is
+** the first time sqlite3_initialize() is invoked during the lifetime of
+** the process, or if it is the first time sqlite3_initialize() is invoked
+** following a call to sqlite3_shutdown(). ^(Only an effective call
+** of sqlite3_initialize() does any initialization. All other calls
+** are harmless no-ops.)^
+**
+** A call to sqlite3_shutdown() is an "effective" call if it is the first
+** call to sqlite3_shutdown() since the last sqlite3_initialize(). ^(Only
+** an effective call to sqlite3_shutdown() does any deinitialization.
+** All other valid calls to sqlite3_shutdown() are harmless no-ops.)^
+**
+** The sqlite3_initialize() interface is threadsafe, but sqlite3_shutdown()
+** is not. The sqlite3_shutdown() interface must only be called from a
+** single thread. All open [database connections] must be closed and all
+** other SQLite resources must be deallocated prior to invoking
+** sqlite3_shutdown().
+**
+** Among other things, ^sqlite3_initialize() will invoke
+** sqlite3_os_init(). Similarly, ^sqlite3_shutdown()
+** will invoke sqlite3_os_end().
+**
+** ^The sqlite3_initialize() routine returns [SQLITE_OK] on success.
+** ^If for some reason, sqlite3_initialize() is unable to initialize
+** the library (perhaps it is unable to allocate a needed resource such
+** as a mutex) it returns an [error code] other than [SQLITE_OK].
+**
+** ^The sqlite3_initialize() routine is called internally by many other
+** SQLite interfaces so that an application usually does not need to
+** invoke sqlite3_initialize() directly. For example, [sqlite3_open()]
+** calls sqlite3_initialize() so the SQLite library will be automatically
+** initialized when [sqlite3_open()] is called if it has not be initialized
+** already. ^However, if SQLite is compiled with the [SQLITE_OMIT_AUTOINIT]
+** compile-time option, then the automatic calls to sqlite3_initialize()
+** are omitted and the application must call sqlite3_initialize() directly
+** prior to using any other SQLite interface. For maximum portability,
+** it is recommended that applications always invoke sqlite3_initialize()
+** directly prior to using any other SQLite interface. Future releases
+** of SQLite may require this. In other words, the behavior exhibited
+** when SQLite is compiled with [SQLITE_OMIT_AUTOINIT] might become the
+** default behavior in some future release of SQLite.
+**
+** The sqlite3_os_init() routine does operating-system specific
+** initialization of the SQLite library. The sqlite3_os_end()
+** routine undoes the effect of sqlite3_os_init(). Typical tasks
+** performed by these routines include allocation or deallocation
+** of static resources, initialization of global variables,
+** setting up a default [sqlite3_vfs] module, or setting up
+** a default configuration using [sqlite3_config()].
+**
+** The application should never invoke either sqlite3_os_init()
+** or sqlite3_os_end() directly. The application should only invoke
+** sqlite3_initialize() and sqlite3_shutdown(). The sqlite3_os_init()
+** interface is called automatically by sqlite3_initialize() and
+** sqlite3_os_end() is called by sqlite3_shutdown(). Appropriate
+** implementations for sqlite3_os_init() and sqlite3_os_end()
+** are built into SQLite when it is compiled for Unix, Windows, or OS/2.
+** When [custom builds | built for other platforms]
+** (using the [SQLITE_OS_OTHER=1] compile-time
+** option) the application must supply a suitable implementation for
+** sqlite3_os_init() and sqlite3_os_end(). An application-supplied
+** implementation of sqlite3_os_init() or sqlite3_os_end()
+** must return [SQLITE_OK] on success and some other [error code] upon
+** failure.
+*/
+SQLITE_API int sqlite3_initialize(void);
+SQLITE_API int sqlite3_shutdown(void);
+SQLITE_API int sqlite3_os_init(void);
+SQLITE_API int sqlite3_os_end(void);
+
+/*
+** CAPI3REF: Configuring The SQLite Library
+**
+** The sqlite3_config() interface is used to make global configuration
+** changes to SQLite in order to tune SQLite to the specific needs of
+** the application. The default configuration is recommended for most
+** applications and so this routine is usually not necessary. It is
+** provided to support rare applications with unusual needs.
+**
+** The sqlite3_config() interface is not threadsafe. The application
+** must ensure that no other SQLite interfaces are invoked by other
+** threads while sqlite3_config() is running.
+**
+** The first argument to sqlite3_config() is an integer
+** [configuration option] that determines
+** what property of SQLite is to be configured. Subsequent arguments
+** vary depending on the [configuration option]
+** in the first argument.
+**
+** For most configuration options, the sqlite3_config() interface
+** may only be invoked prior to library initialization using
+** [sqlite3_initialize()] or after shutdown by [sqlite3_shutdown()].
+** The exceptional configuration options that may be invoked at any time
+** are called "anytime configuration options".
+** ^If sqlite3_config() is called after [sqlite3_initialize()] and before
+** [sqlite3_shutdown()] with a first argument that is not an anytime
+** configuration option, then the sqlite3_config() call will return SQLITE_MISUSE.
+** Note, however, that ^sqlite3_config() can be called as part of the
+** implementation of an application-defined [sqlite3_os_init()].
+**
+** ^When a configuration option is set, sqlite3_config() returns [SQLITE_OK].
+** ^If the option is unknown or SQLite is unable to set the option
+** then this routine returns a non-zero [error code].
+*/
+SQLITE_API int sqlite3_config(int, ...);
+
+/*
+** CAPI3REF: Configure database connections
+** METHOD: sqlite3
+**
+** The sqlite3_db_config() interface is used to make configuration
+** changes to a [database connection]. The interface is similar to
+** [sqlite3_config()] except that the changes apply to a single
+** [database connection] (specified in the first argument).
+**
+** The second argument to sqlite3_db_config(D,V,...) is the
+** [SQLITE_DBCONFIG_LOOKASIDE | configuration verb] - an integer code
+** that indicates what aspect of the [database connection] is being configured.
+** Subsequent arguments vary depending on the configuration verb.
+**
+** ^Calls to sqlite3_db_config() return SQLITE_OK if and only if
+** the call is considered successful.
+*/
+SQLITE_API int sqlite3_db_config(sqlite3*, int op, ...);
+
+/*
+** CAPI3REF: Memory Allocation Routines
+**
+** An instance of this object defines the interface between SQLite
+** and low-level memory allocation routines.
+**
+** This object is used in only one place in the SQLite interface.
+** A pointer to an instance of this object is the argument to
+** [sqlite3_config()] when the configuration option is
+** [SQLITE_CONFIG_MALLOC] or [SQLITE_CONFIG_GETMALLOC].
+** By creating an instance of this object
+** and passing it to [sqlite3_config]([SQLITE_CONFIG_MALLOC])
+** during configuration, an application can specify an alternative
+** memory allocation subsystem for SQLite to use for all of its
+** dynamic memory needs.
+**
+** Note that SQLite comes with several [built-in memory allocators]
+** that are perfectly adequate for the overwhelming majority of applications
+** and that this object is only useful to a tiny minority of applications
+** with specialized memory allocation requirements. This object is
+** also used during testing of SQLite in order to specify an alternative
+** memory allocator that simulates memory out-of-memory conditions in
+** order to verify that SQLite recovers gracefully from such
+** conditions.
+**
+** The xMalloc, xRealloc, and xFree methods must work like the
+** malloc(), realloc() and free() functions from the standard C library.
+** ^SQLite guarantees that the second argument to
+** xRealloc is always a value returned by a prior call to xRoundup.
+**
+** xSize should return the allocated size of a memory allocation
+** previously obtained from xMalloc or xRealloc. The allocated size
+** is always at least as big as the requested size but may be larger.
+**
+** The xRoundup method returns what would be the allocated size of
+** a memory allocation given a particular requested size. Most memory
+** allocators round up memory allocations at least to the next multiple
+** of 8. Some allocators round up to a larger multiple or to a power of 2.
+** Every memory allocation request coming in through [sqlite3_malloc()]
+** or [sqlite3_realloc()] first calls xRoundup. If xRoundup returns 0,
+** that causes the corresponding memory allocation to fail.
+**
+** The xInit method initializes the memory allocator. For example,
+** it might allocate any required mutexes or initialize internal data
+** structures. The xShutdown method is invoked (indirectly) by
+** [sqlite3_shutdown()] and should deallocate any resources acquired
+** by xInit. The pAppData pointer is used as the only parameter to
+** xInit and xShutdown.
+**
+** SQLite holds the [SQLITE_MUTEX_STATIC_MAIN] mutex when it invokes
+** the xInit method, so the xInit method need not be threadsafe. The
+** xShutdown method is only called from [sqlite3_shutdown()] so it does
+** not need to be threadsafe either. For all other methods, SQLite
+** holds the [SQLITE_MUTEX_STATIC_MEM] mutex as long as the
+** [SQLITE_CONFIG_MEMSTATUS] configuration option is turned on (which
+** it is by default) and so the methods are automatically serialized.
+** However, if [SQLITE_CONFIG_MEMSTATUS] is disabled, then the other
+** methods must be threadsafe or else make their own arrangements for
+** serialization.
+**
+** SQLite will never invoke xInit() more than once without an intervening
+** call to xShutdown().
+*/
+typedef struct sqlite3_mem_methods sqlite3_mem_methods;
+struct sqlite3_mem_methods {
+ void *(*xMalloc)(int); /* Memory allocation function */
+ void (*xFree)(void*); /* Free a prior allocation */
+ void *(*xRealloc)(void*,int); /* Resize an allocation */
+ int (*xSize)(void*); /* Return the size of an allocation */
+ int (*xRoundup)(int); /* Round up request size to allocation size */
+ int (*xInit)(void*); /* Initialize the memory allocator */
+ void (*xShutdown)(void*); /* Deinitialize the memory allocator */
+ void *pAppData; /* Argument to xInit() and xShutdown() */
+};
+
+/*
+** CAPI3REF: Configuration Options
+** KEYWORDS: {configuration option}
+**
+** These constants are the available integer configuration options that
+** can be passed as the first argument to the [sqlite3_config()] interface.
+**
+** Most of the configuration options for sqlite3_config()
+** will only work if invoked prior to [sqlite3_initialize()] or after
+** [sqlite3_shutdown()]. The few exceptions to this rule are called
+** "anytime configuration options".
+** ^Calling [sqlite3_config()] with a first argument that is not an
+** anytime configuration option in between calls to [sqlite3_initialize()] and
+** [sqlite3_shutdown()] is a no-op that returns SQLITE_MISUSE.
+**
+** The set of anytime configuration options can change (by insertions
+** and/or deletions) from one release of SQLite to the next.
+** As of SQLite version 3.42.0, the complete set of anytime configuration
+** options is:
+**
+** SQLITE_CONFIG_LOG
+** SQLITE_CONFIG_PCACHE_HDRSZ
+**
+**
+** New configuration options may be added in future releases of SQLite.
+** Existing configuration options might be discontinued. Applications
+** should check the return code from [sqlite3_config()] to make sure that
+** the call worked. The [sqlite3_config()] interface will return a
+** non-zero [error code] if a discontinued or unsupported configuration option
+** is invoked.
+**
+**
+** [[SQLITE_CONFIG_SINGLETHREAD]] SQLITE_CONFIG_SINGLETHREAD
+** There are no arguments to this option. ^This option sets the
+** [threading mode] to Single-thread. In other words, it disables
+** all mutexing and puts SQLite into a mode where it can only be used
+** by a single thread. ^If SQLite is compiled with
+** the [SQLITE_THREADSAFE | SQLITE_THREADSAFE=0] compile-time option then
+** it is not possible to change the [threading mode] from its default
+** value of Single-thread and so [sqlite3_config()] will return
+** [SQLITE_ERROR] if called with the SQLITE_CONFIG_SINGLETHREAD
+** configuration option.
+**
+** [[SQLITE_CONFIG_MULTITHREAD]] SQLITE_CONFIG_MULTITHREAD
+** There are no arguments to this option. ^This option sets the
+** [threading mode] to Multi-thread. In other words, it disables
+** mutexing on [database connection] and [prepared statement] objects.
+** The application is responsible for serializing access to
+** [database connections] and [prepared statements]. But other mutexes
+** are enabled so that SQLite will be safe to use in a multi-threaded
+** environment as long as no two threads attempt to use the same
+** [database connection] at the same time. ^If SQLite is compiled with
+** the [SQLITE_THREADSAFE | SQLITE_THREADSAFE=0] compile-time option then
+** it is not possible to set the Multi-thread [threading mode] and
+** [sqlite3_config()] will return [SQLITE_ERROR] if called with the
+** SQLITE_CONFIG_MULTITHREAD configuration option.
+**
+** [[SQLITE_CONFIG_SERIALIZED]] SQLITE_CONFIG_SERIALIZED
+** There are no arguments to this option. ^This option sets the
+** [threading mode] to Serialized. In other words, this option enables
+** all mutexes including the recursive
+** mutexes on [database connection] and [prepared statement] objects.
+** In this mode (which is the default when SQLite is compiled with
+** [SQLITE_THREADSAFE=1]) the SQLite library will itself serialize access
+** to [database connections] and [prepared statements] so that the
+** application is free to use the same [database connection] or the
+** same [prepared statement] in different threads at the same time.
+** ^If SQLite is compiled with
+** the [SQLITE_THREADSAFE | SQLITE_THREADSAFE=0] compile-time option then
+** it is not possible to set the Serialized [threading mode] and
+** [sqlite3_config()] will return [SQLITE_ERROR] if called with the
+** SQLITE_CONFIG_SERIALIZED configuration option.
+**
+** [[SQLITE_CONFIG_MALLOC]] SQLITE_CONFIG_MALLOC
+** ^(The SQLITE_CONFIG_MALLOC option takes a single argument which is
+** a pointer to an instance of the [sqlite3_mem_methods] structure.
+** The argument specifies
+** alternative low-level memory allocation routines to be used in place of
+** the memory allocation routines built into SQLite.)^ ^SQLite makes
+** its own private copy of the content of the [sqlite3_mem_methods] structure
+** before the [sqlite3_config()] call returns.
+**
+** [[SQLITE_CONFIG_GETMALLOC]] SQLITE_CONFIG_GETMALLOC
+** ^(The SQLITE_CONFIG_GETMALLOC option takes a single argument which
+** is a pointer to an instance of the [sqlite3_mem_methods] structure.
+** The [sqlite3_mem_methods]
+** structure is filled with the currently defined memory allocation routines.)^
+** This option can be used to overload the default memory allocation
+** routines with a wrapper that simulations memory allocation failure or
+** tracks memory usage, for example.
+**
+** [[SQLITE_CONFIG_SMALL_MALLOC]] SQLITE_CONFIG_SMALL_MALLOC
+** ^The SQLITE_CONFIG_SMALL_MALLOC option takes single argument of
+** type int, interpreted as a boolean, which if true provides a hint to
+** SQLite that it should avoid large memory allocations if possible.
+** SQLite will run faster if it is free to make large memory allocations,
+** but some application might prefer to run slower in exchange for
+** guarantees about memory fragmentation that are possible if large
+** allocations are avoided. This hint is normally off.
+**
+**
+** [[SQLITE_CONFIG_MEMSTATUS]] SQLITE_CONFIG_MEMSTATUS
+** ^The SQLITE_CONFIG_MEMSTATUS option takes single argument of type int,
+** interpreted as a boolean, which enables or disables the collection of
+** memory allocation statistics. ^(When memory allocation statistics are
+** disabled, the following SQLite interfaces become non-operational:
+**
+** [sqlite3_hard_heap_limit64()]
+** [sqlite3_memory_used()]
+** [sqlite3_memory_highwater()]
+** [sqlite3_soft_heap_limit64()]
+** [sqlite3_status64()]
+** )^
+** ^Memory allocation statistics are enabled by default unless SQLite is
+** compiled with [SQLITE_DEFAULT_MEMSTATUS]=0 in which case memory
+** allocation statistics are disabled by default.
+**
+**
+** [[SQLITE_CONFIG_SCRATCH]] SQLITE_CONFIG_SCRATCH
+** The SQLITE_CONFIG_SCRATCH option is no longer used.
+**
+**
+** [[SQLITE_CONFIG_PAGECACHE]] SQLITE_CONFIG_PAGECACHE
+** ^The SQLITE_CONFIG_PAGECACHE option specifies a memory pool
+** that SQLite can use for the database page cache with the default page
+** cache implementation.
+** This configuration option is a no-op if an application-defined page
+** cache implementation is loaded using the [SQLITE_CONFIG_PCACHE2].
+** ^There are three arguments to SQLITE_CONFIG_PAGECACHE: A pointer to
+** 8-byte aligned memory (pMem), the size of each page cache line (sz),
+** and the number of cache lines (N).
+** The sz argument should be the size of the largest database page
+** (a power of two between 512 and 65536) plus some extra bytes for each
+** page header. ^The number of extra bytes needed by the page header
+** can be determined using [SQLITE_CONFIG_PCACHE_HDRSZ].
+** ^It is harmless, apart from the wasted memory,
+** for the sz parameter to be larger than necessary. The pMem
+** argument must be either a NULL pointer or a pointer to an 8-byte
+** aligned block of memory of at least sz*N bytes, otherwise
+** subsequent behavior is undefined.
+** ^When pMem is not NULL, SQLite will strive to use the memory provided
+** to satisfy page cache needs, falling back to [sqlite3_malloc()] if
+** a page cache line is larger than sz bytes or if all of the pMem buffer
+** is exhausted.
+** ^If pMem is NULL and N is non-zero, then each database connection
+** does an initial bulk allocation for page cache memory
+** from [sqlite3_malloc()] sufficient for N cache lines if N is positive or
+** of -1024*N bytes if N is negative, . ^If additional
+** page cache memory is needed beyond what is provided by the initial
+** allocation, then SQLite goes to [sqlite3_malloc()] separately for each
+** additional cache line.
+**
+** [[SQLITE_CONFIG_HEAP]] SQLITE_CONFIG_HEAP
+** ^The SQLITE_CONFIG_HEAP option specifies a static memory buffer
+** that SQLite will use for all of its dynamic memory allocation needs
+** beyond those provided for by [SQLITE_CONFIG_PAGECACHE].
+** ^The SQLITE_CONFIG_HEAP option is only available if SQLite is compiled
+** with either [SQLITE_ENABLE_MEMSYS3] or [SQLITE_ENABLE_MEMSYS5] and returns
+** [SQLITE_ERROR] if invoked otherwise.
+** ^There are three arguments to SQLITE_CONFIG_HEAP:
+** An 8-byte aligned pointer to the memory,
+** the number of bytes in the memory buffer, and the minimum allocation size.
+** ^If the first pointer (the memory pointer) is NULL, then SQLite reverts
+** to using its default memory allocator (the system malloc() implementation),
+** undoing any prior invocation of [SQLITE_CONFIG_MALLOC]. ^If the
+** memory pointer is not NULL then the alternative memory
+** allocator is engaged to handle all of SQLites memory allocation needs.
+** The first pointer (the memory pointer) must be aligned to an 8-byte
+** boundary or subsequent behavior of SQLite will be undefined.
+** The minimum allocation size is capped at 2**12. Reasonable values
+** for the minimum allocation size are 2**5 through 2**8.
+**
+** [[SQLITE_CONFIG_MUTEX]] SQLITE_CONFIG_MUTEX
+** ^(The SQLITE_CONFIG_MUTEX option takes a single argument which is a
+** pointer to an instance of the [sqlite3_mutex_methods] structure.
+** The argument specifies alternative low-level mutex routines to be used
+** in place the mutex routines built into SQLite.)^ ^SQLite makes a copy of
+** the content of the [sqlite3_mutex_methods] structure before the call to
+** [sqlite3_config()] returns. ^If SQLite is compiled with
+** the [SQLITE_THREADSAFE | SQLITE_THREADSAFE=0] compile-time option then
+** the entire mutexing subsystem is omitted from the build and hence calls to
+** [sqlite3_config()] with the SQLITE_CONFIG_MUTEX configuration option will
+** return [SQLITE_ERROR].
+**
+** [[SQLITE_CONFIG_GETMUTEX]] SQLITE_CONFIG_GETMUTEX
+** ^(The SQLITE_CONFIG_GETMUTEX option takes a single argument which
+** is a pointer to an instance of the [sqlite3_mutex_methods] structure. The
+** [sqlite3_mutex_methods]
+** structure is filled with the currently defined mutex routines.)^
+** This option can be used to overload the default mutex allocation
+** routines with a wrapper used to track mutex usage for performance
+** profiling or testing, for example. ^If SQLite is compiled with
+** the [SQLITE_THREADSAFE | SQLITE_THREADSAFE=0] compile-time option then
+** the entire mutexing subsystem is omitted from the build and hence calls to
+** [sqlite3_config()] with the SQLITE_CONFIG_GETMUTEX configuration option will
+** return [SQLITE_ERROR].
+**
+** [[SQLITE_CONFIG_LOOKASIDE]] SQLITE_CONFIG_LOOKASIDE
+** ^(The SQLITE_CONFIG_LOOKASIDE option takes two arguments that determine
+** the default size of [lookaside memory] on each [database connection].
+** The first argument is the
+** size of each lookaside buffer slot ("sz") and the second is the number of
+** slots allocated to each database connection ("cnt").)^
+** ^(SQLITE_CONFIG_LOOKASIDE sets the default lookaside size.
+** The [SQLITE_DBCONFIG_LOOKASIDE] option to [sqlite3_db_config()] can
+** be used to change the lookaside configuration on individual connections.)^
+** The [-DSQLITE_DEFAULT_LOOKASIDE] option can be used to change the
+** default lookaside configuration at compile-time.
+**
+**
+** [[SQLITE_CONFIG_PCACHE2]] SQLITE_CONFIG_PCACHE2
+** ^(The SQLITE_CONFIG_PCACHE2 option takes a single argument which is
+** a pointer to an [sqlite3_pcache_methods2] object. This object specifies
+** the interface to a custom page cache implementation.)^
+** ^SQLite makes a copy of the [sqlite3_pcache_methods2] object.
+**
+** [[SQLITE_CONFIG_GETPCACHE2]] SQLITE_CONFIG_GETPCACHE2
+** ^(The SQLITE_CONFIG_GETPCACHE2 option takes a single argument which
+** is a pointer to an [sqlite3_pcache_methods2] object. SQLite copies of
+** the current page cache implementation into that object.)^
+**
+** [[SQLITE_CONFIG_LOG]] SQLITE_CONFIG_LOG
+** The SQLITE_CONFIG_LOG option is used to configure the SQLite
+** global [error log].
+** (^The SQLITE_CONFIG_LOG option takes two arguments: a pointer to a
+** function with a call signature of void(*)(void*,int,const char*),
+** and a pointer to void. ^If the function pointer is not NULL, it is
+** invoked by [sqlite3_log()] to process each logging event. ^If the
+** function pointer is NULL, the [sqlite3_log()] interface becomes a no-op.
+** ^The void pointer that is the second argument to SQLITE_CONFIG_LOG is
+** passed through as the first parameter to the application-defined logger
+** function whenever that function is invoked. ^The second parameter to
+** the logger function is a copy of the first parameter to the corresponding
+** [sqlite3_log()] call and is intended to be a [result code] or an
+** [extended result code]. ^The third parameter passed to the logger is
+** log message after formatting via [sqlite3_snprintf()].
+** The SQLite logging interface is not reentrant; the logger function
+** supplied by the application must not invoke any SQLite interface.
+** In a multi-threaded application, the application-defined logger
+** function must be threadsafe.
+**
+** [[SQLITE_CONFIG_URI]] SQLITE_CONFIG_URI
+** ^(The SQLITE_CONFIG_URI option takes a single argument of type int.
+** If non-zero, then URI handling is globally enabled. If the parameter is zero,
+** then URI handling is globally disabled.)^ ^If URI handling is globally
+** enabled, all filenames passed to [sqlite3_open()], [sqlite3_open_v2()],
+** [sqlite3_open16()] or
+** specified as part of [ATTACH] commands are interpreted as URIs, regardless
+** of whether or not the [SQLITE_OPEN_URI] flag is set when the database
+** connection is opened. ^If it is globally disabled, filenames are
+** only interpreted as URIs if the SQLITE_OPEN_URI flag is set when the
+** database connection is opened. ^(By default, URI handling is globally
+** disabled. The default value may be changed by compiling with the
+** [SQLITE_USE_URI] symbol defined.)^
+**
+** [[SQLITE_CONFIG_COVERING_INDEX_SCAN]] SQLITE_CONFIG_COVERING_INDEX_SCAN
+** ^The SQLITE_CONFIG_COVERING_INDEX_SCAN option takes a single integer
+** argument which is interpreted as a boolean in order to enable or disable
+** the use of covering indices for full table scans in the query optimizer.
+** ^The default setting is determined
+** by the [SQLITE_ALLOW_COVERING_INDEX_SCAN] compile-time option, or is "on"
+** if that compile-time option is omitted.
+** The ability to disable the use of covering indices for full table scans
+** is because some incorrectly coded legacy applications might malfunction
+** when the optimization is enabled. Providing the ability to
+** disable the optimization allows the older, buggy application code to work
+** without change even with newer versions of SQLite.
+**
+** [[SQLITE_CONFIG_PCACHE]] [[SQLITE_CONFIG_GETPCACHE]]
+** SQLITE_CONFIG_PCACHE and SQLITE_CONFIG_GETPCACHE
+** These options are obsolete and should not be used by new code.
+** They are retained for backwards compatibility but are now no-ops.
+**
+**
+** [[SQLITE_CONFIG_SQLLOG]]
+** SQLITE_CONFIG_SQLLOG
+** This option is only available if sqlite is compiled with the
+** [SQLITE_ENABLE_SQLLOG] pre-processor macro defined. The first argument should
+** be a pointer to a function of type void(*)(void*,sqlite3*,const char*, int).
+** The second should be of type (void*). The callback is invoked by the library
+** in three separate circumstances, identified by the value passed as the
+** fourth parameter. If the fourth parameter is 0, then the database connection
+** passed as the second argument has just been opened. The third argument
+** points to a buffer containing the name of the main database file. If the
+** fourth parameter is 1, then the SQL statement that the third parameter
+** points to has just been executed. Or, if the fourth parameter is 2, then
+** the connection being passed as the second parameter is being closed. The
+** third parameter is passed NULL In this case. An example of using this
+** configuration option can be seen in the "test_sqllog.c" source file in
+** the canonical SQLite source tree.
+**
+** [[SQLITE_CONFIG_MMAP_SIZE]]
+** SQLITE_CONFIG_MMAP_SIZE
+** ^SQLITE_CONFIG_MMAP_SIZE takes two 64-bit integer (sqlite3_int64) values
+** that are the default mmap size limit (the default setting for
+** [PRAGMA mmap_size]) and the maximum allowed mmap size limit.
+** ^The default setting can be overridden by each database connection using
+** either the [PRAGMA mmap_size] command, or by using the
+** [SQLITE_FCNTL_MMAP_SIZE] file control. ^(The maximum allowed mmap size
+** will be silently truncated if necessary so that it does not exceed the
+** compile-time maximum mmap size set by the
+** [SQLITE_MAX_MMAP_SIZE] compile-time option.)^
+** ^If either argument to this option is negative, then that argument is
+** changed to its compile-time default.
+**
+** [[SQLITE_CONFIG_WIN32_HEAPSIZE]]
+** SQLITE_CONFIG_WIN32_HEAPSIZE
+** ^The SQLITE_CONFIG_WIN32_HEAPSIZE option is only available if SQLite is
+** compiled for Windows with the [SQLITE_WIN32_MALLOC] pre-processor macro
+** defined. ^SQLITE_CONFIG_WIN32_HEAPSIZE takes a 32-bit unsigned integer value
+** that specifies the maximum size of the created heap.
+**
+** [[SQLITE_CONFIG_PCACHE_HDRSZ]]
+** SQLITE_CONFIG_PCACHE_HDRSZ
+** ^The SQLITE_CONFIG_PCACHE_HDRSZ option takes a single parameter which
+** is a pointer to an integer and writes into that integer the number of extra
+** bytes per page required for each page in [SQLITE_CONFIG_PAGECACHE].
+** The amount of extra space required can change depending on the compiler,
+** target platform, and SQLite version.
+**
+** [[SQLITE_CONFIG_PMASZ]]
+** SQLITE_CONFIG_PMASZ
+** ^The SQLITE_CONFIG_PMASZ option takes a single parameter which
+** is an unsigned integer and sets the "Minimum PMA Size" for the multithreaded
+** sorter to that integer. The default minimum PMA Size is set by the
+** [SQLITE_SORTER_PMASZ] compile-time option. New threads are launched
+** to help with sort operations when multithreaded sorting
+** is enabled (using the [PRAGMA threads] command) and the amount of content
+** to be sorted exceeds the page size times the minimum of the
+** [PRAGMA cache_size] setting and this value.
+**
+** [[SQLITE_CONFIG_STMTJRNL_SPILL]]
+** SQLITE_CONFIG_STMTJRNL_SPILL
+** ^The SQLITE_CONFIG_STMTJRNL_SPILL option takes a single parameter which
+** becomes the [statement journal] spill-to-disk threshold.
+** [Statement journals] are held in memory until their size (in bytes)
+** exceeds this threshold, at which point they are written to disk.
+** Or if the threshold is -1, statement journals are always held
+** exclusively in memory.
+** Since many statement journals never become large, setting the spill
+** threshold to a value such as 64KiB can greatly reduce the amount of
+** I/O required to support statement rollback.
+** The default value for this setting is controlled by the
+** [SQLITE_STMTJRNL_SPILL] compile-time option.
+**
+** [[SQLITE_CONFIG_SORTERREF_SIZE]]
+** SQLITE_CONFIG_SORTERREF_SIZE
+** The SQLITE_CONFIG_SORTERREF_SIZE option accepts a single parameter
+** of type (int) - the new value of the sorter-reference size threshold.
+** Usually, when SQLite uses an external sort to order records according
+** to an ORDER BY clause, all fields required by the caller are present in the
+** sorted records. However, if SQLite determines based on the declared type
+** of a table column that its values are likely to be very large - larger
+** than the configured sorter-reference size threshold - then a reference
+** is stored in each sorted record and the required column values loaded
+** from the database as records are returned in sorted order. The default
+** value for this option is to never use this optimization. Specifying a
+** negative value for this option restores the default behavior.
+** This option is only available if SQLite is compiled with the
+** [SQLITE_ENABLE_SORTER_REFERENCES] compile-time option.
+**
+** [[SQLITE_CONFIG_MEMDB_MAXSIZE]]
+** SQLITE_CONFIG_MEMDB_MAXSIZE
+** The SQLITE_CONFIG_MEMDB_MAXSIZE option accepts a single parameter
+** [sqlite3_int64] parameter which is the default maximum size for an in-memory
+** database created using [sqlite3_deserialize()]. This default maximum
+** size can be adjusted up or down for individual databases using the
+** [SQLITE_FCNTL_SIZE_LIMIT] [sqlite3_file_control|file-control]. If this
+** configuration setting is never used, then the default maximum is determined
+** by the [SQLITE_MEMDB_DEFAULT_MAXSIZE] compile-time option. If that
+** compile-time option is not set, then the default maximum is 1073741824.
+**
+** [[SQLITE_CONFIG_ROWID_IN_VIEW]]
+** SQLITE_CONFIG_ROWID_IN_VIEW
+** The SQLITE_CONFIG_ROWID_IN_VIEW option enables or disables the ability
+** for VIEWs to have a ROWID. The capability can only be enabled if SQLite is
+** compiled with -DSQLITE_ALLOW_ROWID_IN_VIEW, in which case the capability
+** defaults to on. This configuration option queries the current setting or
+** changes the setting to off or on. The argument is a pointer to an integer.
+** If that integer initially holds a value of 1, then the ability for VIEWs to
+** have ROWIDs is activated. If the integer initially holds zero, then the
+** ability is deactivated. Any other initial value for the integer leaves the
+** setting unchanged. After changes, if any, the integer is written with
+** a 1 or 0, if the ability for VIEWs to have ROWIDs is on or off. If SQLite
+** is compiled without -DSQLITE_ALLOW_ROWID_IN_VIEW (which is the usual and
+** recommended case) then the integer is always filled with zero, regardless
+** if its initial value.
+**
+*/
+#define SQLITE_CONFIG_SINGLETHREAD 1 /* nil */
+#define SQLITE_CONFIG_MULTITHREAD 2 /* nil */
+#define SQLITE_CONFIG_SERIALIZED 3 /* nil */
+#define SQLITE_CONFIG_MALLOC 4 /* sqlite3_mem_methods* */
+#define SQLITE_CONFIG_GETMALLOC 5 /* sqlite3_mem_methods* */
+#define SQLITE_CONFIG_SCRATCH 6 /* No longer used */
+#define SQLITE_CONFIG_PAGECACHE 7 /* void*, int sz, int N */
+#define SQLITE_CONFIG_HEAP 8 /* void*, int nByte, int min */
+#define SQLITE_CONFIG_MEMSTATUS 9 /* boolean */
+#define SQLITE_CONFIG_MUTEX 10 /* sqlite3_mutex_methods* */
+#define SQLITE_CONFIG_GETMUTEX 11 /* sqlite3_mutex_methods* */
+/* previously SQLITE_CONFIG_CHUNKALLOC 12 which is now unused. */
+#define SQLITE_CONFIG_LOOKASIDE 13 /* int int */
+#define SQLITE_CONFIG_PCACHE 14 /* no-op */
+#define SQLITE_CONFIG_GETPCACHE 15 /* no-op */
+#define SQLITE_CONFIG_LOG 16 /* xFunc, void* */
+#define SQLITE_CONFIG_URI 17 /* int */
+#define SQLITE_CONFIG_PCACHE2 18 /* sqlite3_pcache_methods2* */
+#define SQLITE_CONFIG_GETPCACHE2 19 /* sqlite3_pcache_methods2* */
+#define SQLITE_CONFIG_COVERING_INDEX_SCAN 20 /* int */
+#define SQLITE_CONFIG_SQLLOG 21 /* xSqllog, void* */
+#define SQLITE_CONFIG_MMAP_SIZE 22 /* sqlite3_int64, sqlite3_int64 */
+#define SQLITE_CONFIG_WIN32_HEAPSIZE 23 /* int nByte */
+#define SQLITE_CONFIG_PCACHE_HDRSZ 24 /* int *psz */
+#define SQLITE_CONFIG_PMASZ 25 /* unsigned int szPma */
+#define SQLITE_CONFIG_STMTJRNL_SPILL 26 /* int nByte */
+#define SQLITE_CONFIG_SMALL_MALLOC 27 /* boolean */
+#define SQLITE_CONFIG_SORTERREF_SIZE 28 /* int nByte */
+#define SQLITE_CONFIG_MEMDB_MAXSIZE 29 /* sqlite3_int64 */
+#define SQLITE_CONFIG_ROWID_IN_VIEW 30 /* int* */
+
+/*
+** CAPI3REF: Database Connection Configuration Options
+**
+** These constants are the available integer configuration options that
+** can be passed as the second parameter to the [sqlite3_db_config()] interface.
+**
+** The [sqlite3_db_config()] interface is a var-args functions. It takes a
+** variable number of parameters, though always at least two. The number of
+** parameters passed into sqlite3_db_config() depends on which of these
+** constants is given as the second parameter. This documentation page
+** refers to parameters beyond the second as "arguments". Thus, when this
+** page says "the N-th argument" it means "the N-th parameter past the
+** configuration option" or "the (N+2)-th parameter to sqlite3_db_config()".
+**
+** New configuration options may be added in future releases of SQLite.
+** Existing configuration options might be discontinued. Applications
+** should check the return code from [sqlite3_db_config()] to make sure that
+** the call worked. ^The [sqlite3_db_config()] interface will return a
+** non-zero [error code] if a discontinued or unsupported configuration option
+** is invoked.
+**
+**
+** [[SQLITE_DBCONFIG_LOOKASIDE]]
+** SQLITE_DBCONFIG_LOOKASIDE
+** The SQLITE_DBCONFIG_LOOKASIDE option is used to adjust the
+** configuration of the [lookaside memory allocator] within a database
+** connection.
+** The arguments to the SQLITE_DBCONFIG_LOOKASIDE option are not
+** in the [DBCONFIG arguments|usual format].
+** The SQLITE_DBCONFIG_LOOKASIDE option takes three arguments, not two,
+** so that a call to [sqlite3_db_config()] that uses SQLITE_DBCONFIG_LOOKASIDE
+** should have a total of five parameters.
+**
+** The first argument ("buf") is a
+** pointer to a memory buffer to use for lookaside memory.
+** The first argument may be NULL in which case SQLite will allocate the
+** lookaside buffer itself using [sqlite3_malloc()].
+**
The second argument ("sz") is the
+** size of each lookaside buffer slot. Lookaside is disabled if "sz"
+** is less than 8. The "sz" argument should be a multiple of 8 less than
+** 65536. If "sz" does not meet this constraint, it is reduced in size until
+** it does.
+**
The third argument ("cnt") is the number of slots. Lookaside is disabled
+** if "cnt"is less than 1. The "cnt" value will be reduced, if necessary, so
+** that the product of "sz" and "cnt" does not exceed 2,147,418,112. The "cnt"
+** parameter is usually chosen so that the product of "sz" and "cnt" is less
+** than 1,000,000.
+**
+** If the "buf" argument is not NULL, then it must
+** point to a memory buffer with a size that is greater than
+** or equal to the product of "sz" and "cnt".
+** The buffer must be aligned to an 8-byte boundary.
+** The lookaside memory
+** configuration for a database connection can only be changed when that
+** connection is not currently using lookaside memory, or in other words
+** when the value returned by [SQLITE_DBSTATUS_LOOKASIDE_USED] is zero.
+** Any attempt to change the lookaside memory configuration when lookaside
+** memory is in use leaves the configuration unchanged and returns
+** [SQLITE_BUSY].
+** If the "buf" argument is NULL and an attempt
+** to allocate memory based on "sz" and "cnt" fails, then
+** lookaside is silently disabled.
+**
+** The [SQLITE_CONFIG_LOOKASIDE] configuration option can be used to set the
+** default lookaside configuration at initialization. The
+** [-DSQLITE_DEFAULT_LOOKASIDE] option can be used to set the default lookaside
+** configuration at compile-time. Typical values for lookaside are 1200 for
+** "sz" and 40 to 100 for "cnt".
+**
+**
+** [[SQLITE_DBCONFIG_ENABLE_FKEY]]
+** SQLITE_DBCONFIG_ENABLE_FKEY
+** ^This option is used to enable or disable the enforcement of
+** [foreign key constraints]. This is the same setting that is
+** enabled or disabled by the [PRAGMA foreign_keys] statement.
+** The first argument is an integer which is 0 to disable FK enforcement,
+** positive to enable FK enforcement or negative to leave FK enforcement
+** unchanged. The second parameter is a pointer to an integer into which
+** is written 0 or 1 to indicate whether FK enforcement is off or on
+** following this call. The second parameter may be a NULL pointer, in
+** which case the FK enforcement setting is not reported back.
+**
+** [[SQLITE_DBCONFIG_ENABLE_TRIGGER]]
+** SQLITE_DBCONFIG_ENABLE_TRIGGER
+** ^This option is used to enable or disable [CREATE TRIGGER | triggers].
+** There should be two additional arguments.
+** The first argument is an integer which is 0 to disable triggers,
+** positive to enable triggers or negative to leave the setting unchanged.
+** The second parameter is a pointer to an integer into which
+** is written 0 or 1 to indicate whether triggers are disabled or enabled
+** following this call. The second parameter may be a NULL pointer, in
+** which case the trigger setting is not reported back.
+**
+** Originally this option disabled all triggers. ^(However, since
+** SQLite version 3.35.0, TEMP triggers are still allowed even if
+** this option is off. So, in other words, this option now only disables
+** triggers in the main database schema or in the schemas of [ATTACH]-ed
+** databases.)^
+**
+** [[SQLITE_DBCONFIG_ENABLE_VIEW]]
+** SQLITE_DBCONFIG_ENABLE_VIEW
+** ^This option is used to enable or disable [CREATE VIEW | views].
+** There must be two additional arguments.
+** The first argument is an integer which is 0 to disable views,
+** positive to enable views or negative to leave the setting unchanged.
+** The second parameter is a pointer to an integer into which
+** is written 0 or 1 to indicate whether views are disabled or enabled
+** following this call. The second parameter may be a NULL pointer, in
+** which case the view setting is not reported back.
+**
+** Originally this option disabled all views. ^(However, since
+** SQLite version 3.35.0, TEMP views are still allowed even if
+** this option is off. So, in other words, this option now only disables
+** views in the main database schema or in the schemas of ATTACH-ed
+** databases.)^
+**
+** [[SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER]]
+** SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER
+** ^This option is used to enable or disable the
+** [fts3_tokenizer()] function which is part of the
+** [FTS3] full-text search engine extension.
+** There must be two additional arguments.
+** The first argument is an integer which is 0 to disable fts3_tokenizer() or
+** positive to enable fts3_tokenizer() or negative to leave the setting
+** unchanged.
+** The second parameter is a pointer to an integer into which
+** is written 0 or 1 to indicate whether fts3_tokenizer is disabled or enabled
+** following this call. The second parameter may be a NULL pointer, in
+** which case the new setting is not reported back.
+**
+** [[SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION]]
+** SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION
+** ^This option is used to enable or disable the [sqlite3_load_extension()]
+** interface independently of the [load_extension()] SQL function.
+** The [sqlite3_enable_load_extension()] API enables or disables both the
+** C-API [sqlite3_load_extension()] and the SQL function [load_extension()].
+** There must be two additional arguments.
+** When the first argument to this interface is 1, then only the C-API is
+** enabled and the SQL function remains disabled. If the first argument to
+** this interface is 0, then both the C-API and the SQL function are disabled.
+** If the first argument is -1, then no changes are made to state of either the
+** C-API or the SQL function.
+** The second parameter is a pointer to an integer into which
+** is written 0 or 1 to indicate whether [sqlite3_load_extension()] interface
+** is disabled or enabled following this call. The second parameter may
+** be a NULL pointer, in which case the new setting is not reported back.
+**
+**
+** [[SQLITE_DBCONFIG_MAINDBNAME]] SQLITE_DBCONFIG_MAINDBNAME
+** ^This option is used to change the name of the "main" database
+** schema. This option does not follow the
+** [DBCONFIG arguments|usual SQLITE_DBCONFIG argument format].
+** This option takes exactly one additional argument so that the
+** [sqlite3_db_config()] call has a total of three parameters. The
+** extra argument must be a pointer to a constant UTF8 string which
+** will become the new schema name in place of "main". ^SQLite does
+** not make a copy of the new main schema name string, so the application
+** must ensure that the argument passed into SQLITE_DBCONFIG MAINDBNAME
+** is unchanged until after the database connection closes.
+**
+**
+** [[SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE]]
+** SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE
+** Usually, when a database in [WAL mode] is closed or detached from a
+** database handle, SQLite checks if if there are other connections to the
+** same database, and if there are no other database connection (if the
+** connection being closed is the last open connection to the database),
+** then SQLite performs a [checkpoint] before closing the connection and
+** deletes the WAL file. The SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE option can
+** be used to override that behavior. The first argument passed to this
+** operation (the third parameter to [sqlite3_db_config()]) is an integer
+** which is positive to disable checkpoints-on-close, or zero (the default)
+** to enable them, and negative to leave the setting unchanged.
+** The second argument (the fourth parameter) is a pointer to an integer
+** into which is written 0 or 1 to indicate whether checkpoints-on-close
+** have been disabled - 0 if they are not disabled, 1 if they are.
+**
+**
+** [[SQLITE_DBCONFIG_ENABLE_QPSG]] SQLITE_DBCONFIG_ENABLE_QPSG
+** ^(The SQLITE_DBCONFIG_ENABLE_QPSG option activates or deactivates
+** the [query planner stability guarantee] (QPSG). When the QPSG is active,
+** a single SQL query statement will always use the same algorithm regardless
+** of values of [bound parameters].)^ The QPSG disables some query optimizations
+** that look at the values of bound parameters, which can make some queries
+** slower. But the QPSG has the advantage of more predictable behavior. With
+** the QPSG active, SQLite will always use the same query plan in the field as
+** was used during testing in the lab.
+** The first argument to this setting is an integer which is 0 to disable
+** the QPSG, positive to enable QPSG, or negative to leave the setting
+** unchanged. The second parameter is a pointer to an integer into which
+** is written 0 or 1 to indicate whether the QPSG is disabled or enabled
+** following this call.
+**
+**
+** [[SQLITE_DBCONFIG_TRIGGER_EQP]] SQLITE_DBCONFIG_TRIGGER_EQP
+** By default, the output of EXPLAIN QUERY PLAN commands does not
+** include output for any operations performed by trigger programs. This
+** option is used to set or clear (the default) a flag that governs this
+** behavior. The first parameter passed to this operation is an integer -
+** positive to enable output for trigger programs, or zero to disable it,
+** or negative to leave the setting unchanged.
+** The second parameter is a pointer to an integer into which is written
+** 0 or 1 to indicate whether output-for-triggers has been disabled - 0 if
+** it is not disabled, 1 if it is.
+**
+**
+** [[SQLITE_DBCONFIG_RESET_DATABASE]] SQLITE_DBCONFIG_RESET_DATABASE
+** Set the SQLITE_DBCONFIG_RESET_DATABASE flag and then run
+** [VACUUM] in order to reset a database back to an empty database
+** with no schema and no content. The following process works even for
+** a badly corrupted database file:
+**
+** If the database connection is newly opened, make sure it has read the
+** database schema by preparing then discarding some query against the
+** database, or calling sqlite3_table_column_metadata(), ignoring any
+** errors. This step is only necessary if the application desires to keep
+** the database in WAL mode after the reset if it was in WAL mode before
+** the reset.
+** sqlite3_db_config(db, SQLITE_DBCONFIG_RESET_DATABASE, 1, 0);
+** [sqlite3_exec](db, "[VACUUM]", 0, 0, 0);
+** sqlite3_db_config(db, SQLITE_DBCONFIG_RESET_DATABASE, 0, 0);
+**
+** Because resetting a database is destructive and irreversible, the
+** process requires the use of this obscure API and multiple steps to
+** help ensure that it does not happen by accident. Because this
+** feature must be capable of resetting corrupt databases, and
+** shutting down virtual tables may require access to that corrupt
+** storage, the library must abandon any installed virtual tables
+** without calling their xDestroy() methods.
+**
+** [[SQLITE_DBCONFIG_DEFENSIVE]] SQLITE_DBCONFIG_DEFENSIVE
+** The SQLITE_DBCONFIG_DEFENSIVE option activates or deactivates the
+** "defensive" flag for a database connection. When the defensive
+** flag is enabled, language features that allow ordinary SQL to
+** deliberately corrupt the database file are disabled. The disabled
+** features include but are not limited to the following:
+**
+** The [PRAGMA writable_schema=ON] statement.
+** The [PRAGMA journal_mode=OFF] statement.
+** The [PRAGMA schema_version=N] statement.
+** Writes to the [sqlite_dbpage] virtual table.
+** Direct writes to [shadow tables].
+**
+**
+**
+** [[SQLITE_DBCONFIG_WRITABLE_SCHEMA]] SQLITE_DBCONFIG_WRITABLE_SCHEMA
+** The SQLITE_DBCONFIG_WRITABLE_SCHEMA option activates or deactivates the
+** "writable_schema" flag. This has the same effect and is logically equivalent
+** to setting [PRAGMA writable_schema=ON] or [PRAGMA writable_schema=OFF].
+** The first argument to this setting is an integer which is 0 to disable
+** the writable_schema, positive to enable writable_schema, or negative to
+** leave the setting unchanged. The second parameter is a pointer to an
+** integer into which is written 0 or 1 to indicate whether the writable_schema
+** is enabled or disabled following this call.
+**
+**
+** [[SQLITE_DBCONFIG_LEGACY_ALTER_TABLE]]
+** SQLITE_DBCONFIG_LEGACY_ALTER_TABLE
+** The SQLITE_DBCONFIG_LEGACY_ALTER_TABLE option activates or deactivates
+** the legacy behavior of the [ALTER TABLE RENAME] command such it
+** behaves as it did prior to [version 3.24.0] (2018-06-04). See the
+** "Compatibility Notice" on the [ALTER TABLE RENAME documentation] for
+** additional information. This feature can also be turned on and off
+** using the [PRAGMA legacy_alter_table] statement.
+**
+**
+** [[SQLITE_DBCONFIG_DQS_DML]]
+** SQLITE_DBCONFIG_DQS_DML
+** The SQLITE_DBCONFIG_DQS_DML option activates or deactivates
+** the legacy [double-quoted string literal] misfeature for DML statements
+** only, that is DELETE, INSERT, SELECT, and UPDATE statements. The
+** default value of this setting is determined by the [-DSQLITE_DQS]
+** compile-time option.
+**
+**
+** [[SQLITE_DBCONFIG_DQS_DDL]]
+** SQLITE_DBCONFIG_DQS_DDL
+** The SQLITE_DBCONFIG_DQS option activates or deactivates
+** the legacy [double-quoted string literal] misfeature for DDL statements,
+** such as CREATE TABLE and CREATE INDEX. The
+** default value of this setting is determined by the [-DSQLITE_DQS]
+** compile-time option.
+**
+**
+** [[SQLITE_DBCONFIG_TRUSTED_SCHEMA]]
+** SQLITE_DBCONFIG_TRUSTED_SCHEMA
+** The SQLITE_DBCONFIG_TRUSTED_SCHEMA option tells SQLite to
+** assume that database schemas are untainted by malicious content.
+** When the SQLITE_DBCONFIG_TRUSTED_SCHEMA option is disabled, SQLite
+** takes additional defensive steps to protect the application from harm
+** including:
+**
+** Prohibit the use of SQL functions inside triggers, views,
+** CHECK constraints, DEFAULT clauses, expression indexes,
+** partial indexes, or generated columns
+** unless those functions are tagged with [SQLITE_INNOCUOUS].
+** Prohibit the use of virtual tables inside of triggers or views
+** unless those virtual tables are tagged with [SQLITE_VTAB_INNOCUOUS].
+**
+** This setting defaults to "on" for legacy compatibility, however
+** all applications are advised to turn it off if possible. This setting
+** can also be controlled using the [PRAGMA trusted_schema] statement.
+**
+**
+** [[SQLITE_DBCONFIG_LEGACY_FILE_FORMAT]]
+** SQLITE_DBCONFIG_LEGACY_FILE_FORMAT
+** The SQLITE_DBCONFIG_LEGACY_FILE_FORMAT option activates or deactivates
+** the legacy file format flag. When activated, this flag causes all newly
+** created database file to have a schema format version number (the 4-byte
+** integer found at offset 44 into the database header) of 1. This in turn
+** means that the resulting database file will be readable and writable by
+** any SQLite version back to 3.0.0 ([dateof:3.0.0]). Without this setting,
+** newly created databases are generally not understandable by SQLite versions
+** prior to 3.3.0 ([dateof:3.3.0]). As these words are written, there
+** is now scarcely any need to generate database files that are compatible
+** all the way back to version 3.0.0, and so this setting is of little
+** practical use, but is provided so that SQLite can continue to claim the
+** ability to generate new database files that are compatible with version
+** 3.0.0.
+** Note that when the SQLITE_DBCONFIG_LEGACY_FILE_FORMAT setting is on,
+** the [VACUUM] command will fail with an obscure error when attempting to
+** process a table with generated columns and a descending index. This is
+** not considered a bug since SQLite versions 3.3.0 and earlier do not support
+** either generated columns or descending indexes.
+**
+**
+** [[SQLITE_DBCONFIG_STMT_SCANSTATUS]]
+** SQLITE_DBCONFIG_STMT_SCANSTATUS
+** The SQLITE_DBCONFIG_STMT_SCANSTATUS option is only useful in
+** SQLITE_ENABLE_STMT_SCANSTATUS builds. In this case, it sets or clears
+** a flag that enables collection of the sqlite3_stmt_scanstatus_v2()
+** statistics. For statistics to be collected, the flag must be set on
+** the database handle both when the SQL statement is prepared and when it
+** is stepped. The flag is set (collection of statistics is enabled)
+** by default. This option takes two arguments: an integer and a pointer to
+** an integer.. The first argument is 1, 0, or -1 to enable, disable, or
+** leave unchanged the statement scanstatus option. If the second argument
+** is not NULL, then the value of the statement scanstatus setting after
+** processing the first argument is written into the integer that the second
+** argument points to.
+**
+**
+** [[SQLITE_DBCONFIG_REVERSE_SCANORDER]]
+** SQLITE_DBCONFIG_REVERSE_SCANORDER
+** The SQLITE_DBCONFIG_REVERSE_SCANORDER option changes the default order
+** in which tables and indexes are scanned so that the scans start at the end
+** and work toward the beginning rather than starting at the beginning and
+** working toward the end. Setting SQLITE_DBCONFIG_REVERSE_SCANORDER is the
+** same as setting [PRAGMA reverse_unordered_selects]. This option takes
+** two arguments which are an integer and a pointer to an integer. The first
+** argument is 1, 0, or -1 to enable, disable, or leave unchanged the
+** reverse scan order flag, respectively. If the second argument is not NULL,
+** then 0 or 1 is written into the integer that the second argument points to
+** depending on if the reverse scan order flag is set after processing the
+** first argument.
+**
+**
+** [[SQLITE_DBCONFIG_ENABLE_ATTACH_CREATE]]
+** SQLITE_DBCONFIG_ENABLE_ATTACH_CREATE
+** The SQLITE_DBCONFIG_ENABLE_ATTACH_CREATE option enables or disables
+** the ability of the [ATTACH DATABASE] SQL command to create a new database
+** file if the database filed named in the ATTACH command does not already
+** exist. This ability of ATTACH to create a new database is enabled by
+** default. Applications can disable or reenable the ability for ATTACH to
+** create new database files using this DBCONFIG option.
+** This option takes two arguments which are an integer and a pointer
+** to an integer. The first argument is 1, 0, or -1 to enable, disable, or
+** leave unchanged the attach-create flag, respectively. If the second
+** argument is not NULL, then 0 or 1 is written into the integer that the
+** second argument points to depending on if the attach-create flag is set
+** after processing the first argument.
+**
+**
+** [[SQLITE_DBCONFIG_ENABLE_ATTACH_WRITE]]
+** SQLITE_DBCONFIG_ENABLE_ATTACH_WRITE
+** The SQLITE_DBCONFIG_ENABLE_ATTACH_WRITE option enables or disables the
+** ability of the [ATTACH DATABASE] SQL command to open a database for writing.
+** This capability is enabled by default. Applications can disable or
+** reenable this capability using the current DBCONFIG option. If the
+** the this capability is disabled, the [ATTACH] command will still work,
+** but the database will be opened read-only. If this option is disabled,
+** then the ability to create a new database using [ATTACH] is also disabled,
+** regardless of the value of the [SQLITE_DBCONFIG_ENABLE_ATTACH_CREATE]
+** option.
+** This option takes two arguments which are an integer and a pointer
+** to an integer. The first argument is 1, 0, or -1 to enable, disable, or
+** leave unchanged the ability to ATTACH another database for writing,
+** respectively. If the second argument is not NULL, then 0 or 1 is written
+** into the integer to which the second argument points, depending on whether
+** the ability to ATTACH a read/write database is enabled or disabled
+** after processing the first argument.
+**
+**
+** [[SQLITE_DBCONFIG_ENABLE_COMMENTS]]
+** SQLITE_DBCONFIG_ENABLE_COMMENTS
+** The SQLITE_DBCONFIG_ENABLE_COMMENTS option enables or disables the
+** ability to include comments in SQL text. Comments are enabled by default.
+** An application can disable or reenable comments in SQL text using this
+** DBCONFIG option.
+** This option takes two arguments which are an integer and a pointer
+** to an integer. The first argument is 1, 0, or -1 to enable, disable, or
+** leave unchanged the ability to use comments in SQL text,
+** respectively. If the second argument is not NULL, then 0 or 1 is written
+** into the integer that the second argument points to depending on if
+** comments are allowed in SQL text after processing the first argument.
+**
+**
+**
+**
+** [[DBCONFIG arguments]] Arguments To SQLITE_DBCONFIG Options
+**
+** Most of the SQLITE_DBCONFIG options take two arguments, so that the
+** overall call to [sqlite3_db_config()] has a total of four parameters.
+** The first argument (the third parameter to sqlite3_db_config()) is a integer.
+** The second argument is a pointer to an integer. If the first argument is 1,
+** then the option becomes enabled. If the first integer argument is 0, then the
+** option is disabled. If the first argument is -1, then the option setting
+** is unchanged. The second argument, the pointer to an integer, may be NULL.
+** If the second argument is not NULL, then a value of 0 or 1 is written into
+** the integer to which the second argument points, depending on whether the
+** setting is disabled or enabled after applying any changes specified by
+** the first argument.
+**
+**
While most SQLITE_DBCONFIG options use the argument format
+** described in the previous paragraph, the [SQLITE_DBCONFIG_MAINDBNAME]
+** and [SQLITE_DBCONFIG_LOOKASIDE] options are different. See the
+** documentation of those exceptional options for details.
+*/
+#define SQLITE_DBCONFIG_MAINDBNAME 1000 /* const char* */
+#define SQLITE_DBCONFIG_LOOKASIDE 1001 /* void* int int */
+#define SQLITE_DBCONFIG_ENABLE_FKEY 1002 /* int int* */
+#define SQLITE_DBCONFIG_ENABLE_TRIGGER 1003 /* int int* */
+#define SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER 1004 /* int int* */
+#define SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION 1005 /* int int* */
+#define SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE 1006 /* int int* */
+#define SQLITE_DBCONFIG_ENABLE_QPSG 1007 /* int int* */
+#define SQLITE_DBCONFIG_TRIGGER_EQP 1008 /* int int* */
+#define SQLITE_DBCONFIG_RESET_DATABASE 1009 /* int int* */
+#define SQLITE_DBCONFIG_DEFENSIVE 1010 /* int int* */
+#define SQLITE_DBCONFIG_WRITABLE_SCHEMA 1011 /* int int* */
+#define SQLITE_DBCONFIG_LEGACY_ALTER_TABLE 1012 /* int int* */
+#define SQLITE_DBCONFIG_DQS_DML 1013 /* int int* */
+#define SQLITE_DBCONFIG_DQS_DDL 1014 /* int int* */
+#define SQLITE_DBCONFIG_ENABLE_VIEW 1015 /* int int* */
+#define SQLITE_DBCONFIG_LEGACY_FILE_FORMAT 1016 /* int int* */
+#define SQLITE_DBCONFIG_TRUSTED_SCHEMA 1017 /* int int* */
+#define SQLITE_DBCONFIG_STMT_SCANSTATUS 1018 /* int int* */
+#define SQLITE_DBCONFIG_REVERSE_SCANORDER 1019 /* int int* */
+#define SQLITE_DBCONFIG_ENABLE_ATTACH_CREATE 1020 /* int int* */
+#define SQLITE_DBCONFIG_ENABLE_ATTACH_WRITE 1021 /* int int* */
+#define SQLITE_DBCONFIG_ENABLE_COMMENTS 1022 /* int int* */
+#define SQLITE_DBCONFIG_MAX 1022 /* Largest DBCONFIG */
+
+/*
+** CAPI3REF: Enable Or Disable Extended Result Codes
+** METHOD: sqlite3
+**
+** ^The sqlite3_extended_result_codes() routine enables or disables the
+** [extended result codes] feature of SQLite. ^The extended result
+** codes are disabled by default for historical compatibility.
+*/
+SQLITE_API int sqlite3_extended_result_codes(sqlite3*, int onoff);
+
+/*
+** CAPI3REF: Last Insert Rowid
+** METHOD: sqlite3
+**
+** ^Each entry in most SQLite tables (except for [WITHOUT ROWID] tables)
+** has a unique 64-bit signed
+** integer key called the [ROWID | "rowid"]. ^The rowid is always available
+** as an undeclared column named ROWID, OID, or _ROWID_ as long as those
+** names are not also used by explicitly declared columns. ^If
+** the table has a column of type [INTEGER PRIMARY KEY] then that column
+** is another alias for the rowid.
+**
+** ^The sqlite3_last_insert_rowid(D) interface usually returns the [rowid] of
+** the most recent successful [INSERT] into a rowid table or [virtual table]
+** on database connection D. ^Inserts into [WITHOUT ROWID] tables are not
+** recorded. ^If no successful [INSERT]s into rowid tables have ever occurred
+** on the database connection D, then sqlite3_last_insert_rowid(D) returns
+** zero.
+**
+** As well as being set automatically as rows are inserted into database
+** tables, the value returned by this function may be set explicitly by
+** [sqlite3_set_last_insert_rowid()]
+**
+** Some virtual table implementations may INSERT rows into rowid tables as
+** part of committing a transaction (e.g. to flush data accumulated in memory
+** to disk). In this case subsequent calls to this function return the rowid
+** associated with these internal INSERT operations, which leads to
+** unintuitive results. Virtual table implementations that do write to rowid
+** tables in this way can avoid this problem by restoring the original
+** rowid value using [sqlite3_set_last_insert_rowid()] before returning
+** control to the user.
+**
+** ^(If an [INSERT] occurs within a trigger then this routine will
+** return the [rowid] of the inserted row as long as the trigger is
+** running. Once the trigger program ends, the value returned
+** by this routine reverts to what it was before the trigger was fired.)^
+**
+** ^An [INSERT] that fails due to a constraint violation is not a
+** successful [INSERT] and does not change the value returned by this
+** routine. ^Thus INSERT OR FAIL, INSERT OR IGNORE, INSERT OR ROLLBACK,
+** and INSERT OR ABORT make no changes to the return value of this
+** routine when their insertion fails. ^(When INSERT OR REPLACE
+** encounters a constraint violation, it does not fail. The
+** INSERT continues to completion after deleting rows that caused
+** the constraint problem so INSERT OR REPLACE will always change
+** the return value of this interface.)^
+**
+** ^For the purposes of this routine, an [INSERT] is considered to
+** be successful even if it is subsequently rolled back.
+**
+** This function is accessible to SQL statements via the
+** [last_insert_rowid() SQL function].
+**
+** If a separate thread performs a new [INSERT] on the same
+** database connection while the [sqlite3_last_insert_rowid()]
+** function is running and thus changes the last insert [rowid],
+** then the value returned by [sqlite3_last_insert_rowid()] is
+** unpredictable and might not equal either the old or the new
+** last insert [rowid].
+*/
+SQLITE_API sqlite3_int64 sqlite3_last_insert_rowid(sqlite3*);
+
+/*
+** CAPI3REF: Set the Last Insert Rowid value.
+** METHOD: sqlite3
+**
+** The sqlite3_set_last_insert_rowid(D, R) method allows the application to
+** set the value returned by calling sqlite3_last_insert_rowid(D) to R
+** without inserting a row into the database.
+*/
+SQLITE_API void sqlite3_set_last_insert_rowid(sqlite3*,sqlite3_int64);
+
+/*
+** CAPI3REF: Count The Number Of Rows Modified
+** METHOD: sqlite3
+**
+** ^These functions return the number of rows modified, inserted or
+** deleted by the most recently completed INSERT, UPDATE or DELETE
+** statement on the database connection specified by the only parameter.
+** The two functions are identical except for the type of the return value
+** and that if the number of rows modified by the most recent INSERT, UPDATE,
+** or DELETE is greater than the maximum value supported by type "int", then
+** the return value of sqlite3_changes() is undefined. ^Executing any other
+** type of SQL statement does not modify the value returned by these functions.
+** For the purposes of this interface, a CREATE TABLE AS SELECT statement
+** does not count as an INSERT, UPDATE or DELETE statement and hence the rows
+** added to the new table by the CREATE TABLE AS SELECT statement are not
+** counted.
+**
+** ^Only changes made directly by the INSERT, UPDATE or DELETE statement are
+** considered - auxiliary changes caused by [CREATE TRIGGER | triggers],
+** [foreign key actions] or [REPLACE] constraint resolution are not counted.
+**
+** Changes to a view that are intercepted by
+** [INSTEAD OF trigger | INSTEAD OF triggers] are not counted. ^The value
+** returned by sqlite3_changes() immediately after an INSERT, UPDATE or
+** DELETE statement run on a view is always zero. Only changes made to real
+** tables are counted.
+**
+** Things are more complicated if the sqlite3_changes() function is
+** executed while a trigger program is running. This may happen if the
+** program uses the [changes() SQL function], or if some other callback
+** function invokes sqlite3_changes() directly. Essentially:
+**
+**
+** ^(Before entering a trigger program the value returned by
+** sqlite3_changes() function is saved. After the trigger program
+** has finished, the original value is restored.)^
+**
+** ^(Within a trigger program each INSERT, UPDATE and DELETE
+** statement sets the value returned by sqlite3_changes()
+** upon completion as normal. Of course, this value will not include
+** any changes performed by sub-triggers, as the sqlite3_changes()
+** value will be saved and restored after each sub-trigger has run.)^
+**
+**
+** ^This means that if the changes() SQL function (or similar) is used
+** by the first INSERT, UPDATE or DELETE statement within a trigger, it
+** returns the value as set when the calling statement began executing.
+** ^If it is used by the second or subsequent such statement within a trigger
+** program, the value returned reflects the number of rows modified by the
+** previous INSERT, UPDATE or DELETE statement within the same trigger.
+**
+** If a separate thread makes changes on the same database connection
+** while [sqlite3_changes()] is running then the value returned
+** is unpredictable and not meaningful.
+**
+** See also:
+**
+** the [sqlite3_total_changes()] interface
+** the [count_changes pragma]
+** the [changes() SQL function]
+** the [data_version pragma]
+**
+*/
+SQLITE_API int sqlite3_changes(sqlite3*);
+SQLITE_API sqlite3_int64 sqlite3_changes64(sqlite3*);
+
+/*
+** CAPI3REF: Total Number Of Rows Modified
+** METHOD: sqlite3
+**
+** ^These functions return the total number of rows inserted, modified or
+** deleted by all [INSERT], [UPDATE] or [DELETE] statements completed
+** since the database connection was opened, including those executed as
+** part of trigger programs. The two functions are identical except for the
+** type of the return value and that if the number of rows modified by the
+** connection exceeds the maximum value supported by type "int", then
+** the return value of sqlite3_total_changes() is undefined. ^Executing
+** any other type of SQL statement does not affect the value returned by
+** sqlite3_total_changes().
+**
+** ^Changes made as part of [foreign key actions] are included in the
+** count, but those made as part of REPLACE constraint resolution are
+** not. ^Changes to a view that are intercepted by INSTEAD OF triggers
+** are not counted.
+**
+** The [sqlite3_total_changes(D)] interface only reports the number
+** of rows that changed due to SQL statement run against database
+** connection D. Any changes by other database connections are ignored.
+** To detect changes against a database file from other database
+** connections use the [PRAGMA data_version] command or the
+** [SQLITE_FCNTL_DATA_VERSION] [file control].
+**
+** If a separate thread makes changes on the same database connection
+** while [sqlite3_total_changes()] is running then the value
+** returned is unpredictable and not meaningful.
+**
+** See also:
+**
+** the [sqlite3_changes()] interface
+** the [count_changes pragma]
+** the [changes() SQL function]
+** the [data_version pragma]
+** the [SQLITE_FCNTL_DATA_VERSION] [file control]
+**
+*/
+SQLITE_API int sqlite3_total_changes(sqlite3*);
+SQLITE_API sqlite3_int64 sqlite3_total_changes64(sqlite3*);
+
+/*
+** CAPI3REF: Interrupt A Long-Running Query
+** METHOD: sqlite3
+**
+** ^This function causes any pending database operation to abort and
+** return at its earliest opportunity. This routine is typically
+** called in response to a user action such as pressing "Cancel"
+** or Ctrl-C where the user wants a long query operation to halt
+** immediately.
+**
+** ^It is safe to call this routine from a thread different from the
+** thread that is currently running the database operation. But it
+** is not safe to call this routine with a [database connection] that
+** is closed or might close before sqlite3_interrupt() returns.
+**
+** ^If an SQL operation is very nearly finished at the time when
+** sqlite3_interrupt() is called, then it might not have an opportunity
+** to be interrupted and might continue to completion.
+**
+** ^An SQL operation that is interrupted will return [SQLITE_INTERRUPT].
+** ^If the interrupted SQL operation is an INSERT, UPDATE, or DELETE
+** that is inside an explicit transaction, then the entire transaction
+** will be rolled back automatically.
+**
+** ^The sqlite3_interrupt(D) call is in effect until all currently running
+** SQL statements on [database connection] D complete. ^Any new SQL statements
+** that are started after the sqlite3_interrupt() call and before the
+** running statement count reaches zero are interrupted as if they had been
+** running prior to the sqlite3_interrupt() call. ^New SQL statements
+** that are started after the running statement count reaches zero are
+** not effected by the sqlite3_interrupt().
+** ^A call to sqlite3_interrupt(D) that occurs when there are no running
+** SQL statements is a no-op and has no effect on SQL statements
+** that are started after the sqlite3_interrupt() call returns.
+**
+** ^The [sqlite3_is_interrupted(D)] interface can be used to determine whether
+** or not an interrupt is currently in effect for [database connection] D.
+** It returns 1 if an interrupt is currently in effect, or 0 otherwise.
+*/
+SQLITE_API void sqlite3_interrupt(sqlite3*);
+SQLITE_API int sqlite3_is_interrupted(sqlite3*);
+
+/*
+** CAPI3REF: Determine If An SQL Statement Is Complete
+**
+** These routines are useful during command-line input to determine if the
+** currently entered text seems to form a complete SQL statement or
+** if additional input is needed before sending the text into
+** SQLite for parsing. ^These routines return 1 if the input string
+** appears to be a complete SQL statement. ^A statement is judged to be
+** complete if it ends with a semicolon token and is not a prefix of a
+** well-formed CREATE TRIGGER statement. ^Semicolons that are embedded within
+** string literals or quoted identifier names or comments are not
+** independent tokens (they are part of the token in which they are
+** embedded) and thus do not count as a statement terminator. ^Whitespace
+** and comments that follow the final semicolon are ignored.
+**
+** ^These routines return 0 if the statement is incomplete. ^If a
+** memory allocation fails, then SQLITE_NOMEM is returned.
+**
+** ^These routines do not parse the SQL statements thus
+** will not detect syntactically incorrect SQL.
+**
+** ^(If SQLite has not been initialized using [sqlite3_initialize()] prior
+** to invoking sqlite3_complete16() then sqlite3_initialize() is invoked
+** automatically by sqlite3_complete16(). If that initialization fails,
+** then the return value from sqlite3_complete16() will be non-zero
+** regardless of whether or not the input SQL is complete.)^
+**
+** The input to [sqlite3_complete()] must be a zero-terminated
+** UTF-8 string.
+**
+** The input to [sqlite3_complete16()] must be a zero-terminated
+** UTF-16 string in native byte order.
+*/
+SQLITE_API int sqlite3_complete(const char *sql);
+SQLITE_API int sqlite3_complete16(const void *sql);
+
+/*
+** CAPI3REF: Register A Callback To Handle SQLITE_BUSY Errors
+** KEYWORDS: {busy-handler callback} {busy handler}
+** METHOD: sqlite3
+**
+** ^The sqlite3_busy_handler(D,X,P) routine sets a callback function X
+** that might be invoked with argument P whenever
+** an attempt is made to access a database table associated with
+** [database connection] D when another thread
+** or process has the table locked.
+** The sqlite3_busy_handler() interface is used to implement
+** [sqlite3_busy_timeout()] and [PRAGMA busy_timeout].
+**
+** ^If the busy callback is NULL, then [SQLITE_BUSY]
+** is returned immediately upon encountering the lock. ^If the busy callback
+** is not NULL, then the callback might be invoked with two arguments.
+**
+** ^The first argument to the busy handler is a copy of the void* pointer which
+** is the third argument to sqlite3_busy_handler(). ^The second argument to
+** the busy handler callback is the number of times that the busy handler has
+** been invoked previously for the same locking event. ^If the
+** busy callback returns 0, then no additional attempts are made to
+** access the database and [SQLITE_BUSY] is returned
+** to the application.
+** ^If the callback returns non-zero, then another attempt
+** is made to access the database and the cycle repeats.
+**
+** The presence of a busy handler does not guarantee that it will be invoked
+** when there is lock contention. ^If SQLite determines that invoking the busy
+** handler could result in a deadlock, it will go ahead and return [SQLITE_BUSY]
+** to the application instead of invoking the
+** busy handler.
+** Consider a scenario where one process is holding a read lock that
+** it is trying to promote to a reserved lock and
+** a second process is holding a reserved lock that it is trying
+** to promote to an exclusive lock. The first process cannot proceed
+** because it is blocked by the second and the second process cannot
+** proceed because it is blocked by the first. If both processes
+** invoke the busy handlers, neither will make any progress. Therefore,
+** SQLite returns [SQLITE_BUSY] for the first process, hoping that this
+** will induce the first process to release its read lock and allow
+** the second process to proceed.
+**
+** ^The default busy callback is NULL.
+**
+** ^(There can only be a single busy handler defined for each
+** [database connection]. Setting a new busy handler clears any
+** previously set handler.)^ ^Note that calling [sqlite3_busy_timeout()]
+** or evaluating [PRAGMA busy_timeout=N] will change the
+** busy handler and thus clear any previously set busy handler.
+**
+** The busy callback should not take any actions which modify the
+** database connection that invoked the busy handler. In other words,
+** the busy handler is not reentrant. Any such actions
+** result in undefined behavior.
+**
+** A busy handler must not close the database connection
+** or [prepared statement] that invoked the busy handler.
+*/
+SQLITE_API int sqlite3_busy_handler(sqlite3*,int(*)(void*,int),void*);
+
+/*
+** CAPI3REF: Set A Busy Timeout
+** METHOD: sqlite3
+**
+** ^This routine sets a [sqlite3_busy_handler | busy handler] that sleeps
+** for a specified amount of time when a table is locked. ^The handler
+** will sleep multiple times until at least "ms" milliseconds of sleeping
+** have accumulated. ^After at least "ms" milliseconds of sleeping,
+** the handler returns 0 which causes [sqlite3_step()] to return
+** [SQLITE_BUSY].
+**
+** ^Calling this routine with an argument less than or equal to zero
+** turns off all busy handlers.
+**
+** ^(There can only be a single busy handler for a particular
+** [database connection] at any given moment. If another busy handler
+** was defined (using [sqlite3_busy_handler()]) prior to calling
+** this routine, that other busy handler is cleared.)^
+**
+** See also: [PRAGMA busy_timeout]
+*/
+SQLITE_API int sqlite3_busy_timeout(sqlite3*, int ms);
+
+/*
+** CAPI3REF: Set the Setlk Timeout
+** METHOD: sqlite3
+**
+** This routine is only useful in SQLITE_ENABLE_SETLK_TIMEOUT builds. If
+** the VFS supports blocking locks, it sets the timeout in ms used by
+** eligible locks taken on wal mode databases by the specified database
+** handle. In non-SQLITE_ENABLE_SETLK_TIMEOUT builds, or if the VFS does
+** not support blocking locks, this function is a no-op.
+**
+** Passing 0 to this function disables blocking locks altogether. Passing
+** -1 to this function requests that the VFS blocks for a long time -
+** indefinitely if possible. The results of passing any other negative value
+** are undefined.
+**
+** Internally, each SQLite database handle store two timeout values - the
+** busy-timeout (used for rollback mode databases, or if the VFS does not
+** support blocking locks) and the setlk-timeout (used for blocking locks
+** on wal-mode databases). The sqlite3_busy_timeout() method sets both
+** values, this function sets only the setlk-timeout value. Therefore,
+** to configure separate busy-timeout and setlk-timeout values for a single
+** database handle, call sqlite3_busy_timeout() followed by this function.
+**
+** Whenever the number of connections to a wal mode database falls from
+** 1 to 0, the last connection takes an exclusive lock on the database,
+** then checkpoints and deletes the wal file. While it is doing this, any
+** new connection that tries to read from the database fails with an
+** SQLITE_BUSY error. Or, if the SQLITE_SETLK_BLOCK_ON_CONNECT flag is
+** passed to this API, the new connection blocks until the exclusive lock
+** has been released.
+*/
+SQLITE_API int sqlite3_setlk_timeout(sqlite3*, int ms, int flags);
+
+/*
+** CAPI3REF: Flags for sqlite3_setlk_timeout()
+*/
+#define SQLITE_SETLK_BLOCK_ON_CONNECT 0x01
+
+/*
+** CAPI3REF: Convenience Routines For Running Queries
+** METHOD: sqlite3
+**
+** This is a legacy interface that is preserved for backwards compatibility.
+** Use of this interface is not recommended.
+**
+** Definition: A result table is memory data structure created by the
+** [sqlite3_get_table()] interface. A result table records the
+** complete query results from one or more queries.
+**
+** The table conceptually has a number of rows and columns. But
+** these numbers are not part of the result table itself. These
+** numbers are obtained separately. Let N be the number of rows
+** and M be the number of columns.
+**
+** A result table is an array of pointers to zero-terminated UTF-8 strings.
+** There are (N+1)*M elements in the array. The first M pointers point
+** to zero-terminated strings that contain the names of the columns.
+** The remaining entries all point to query results. NULL values result
+** in NULL pointers. All other values are in their UTF-8 zero-terminated
+** string representation as returned by [sqlite3_column_text()].
+**
+** A result table might consist of one or more memory allocations.
+** It is not safe to pass a result table directly to [sqlite3_free()].
+** A result table should be deallocated using [sqlite3_free_table()].
+**
+** ^(As an example of the result table format, suppose a query result
+** is as follows:
+**
+**
+** Name | Age
+** -----------------------
+** Alice | 43
+** Bob | 28
+** Cindy | 21
+**
+**
+** There are two columns (M==2) and three rows (N==3). Thus the
+** result table has 8 entries. Suppose the result table is stored
+** in an array named azResult. Then azResult holds this content:
+**
+**
+** azResult[0] = "Name";
+** azResult[1] = "Age";
+** azResult[2] = "Alice";
+** azResult[3] = "43";
+** azResult[4] = "Bob";
+** azResult[5] = "28";
+** azResult[6] = "Cindy";
+** azResult[7] = "21";
+** )^
+**
+** ^The sqlite3_get_table() function evaluates one or more
+** semicolon-separated SQL statements in the zero-terminated UTF-8
+** string of its 2nd parameter and returns a result table to the
+** pointer given in its 3rd parameter.
+**
+** After the application has finished with the result from sqlite3_get_table(),
+** it must pass the result table pointer to sqlite3_free_table() in order to
+** release the memory that was malloced. Because of the way the
+** [sqlite3_malloc()] happens within sqlite3_get_table(), the calling
+** function must not try to call [sqlite3_free()] directly. Only
+** [sqlite3_free_table()] is able to release the memory properly and safely.
+**
+** The sqlite3_get_table() interface is implemented as a wrapper around
+** [sqlite3_exec()]. The sqlite3_get_table() routine does not have access
+** to any internal data structures of SQLite. It uses only the public
+** interface defined here. As a consequence, errors that occur in the
+** wrapper layer outside of the internal [sqlite3_exec()] call are not
+** reflected in subsequent calls to [sqlite3_errcode()] or
+** [sqlite3_errmsg()].
+*/
+SQLITE_API int sqlite3_get_table(
+ sqlite3 *db, /* An open database */
+ const char *zSql, /* SQL to be evaluated */
+ char ***pazResult, /* Results of the query */
+ int *pnRow, /* Number of result rows written here */
+ int *pnColumn, /* Number of result columns written here */
+ char **pzErrmsg /* Error msg written here */
+);
+SQLITE_API void sqlite3_free_table(char **result);
+
+/*
+** CAPI3REF: Formatted String Printing Functions
+**
+** These routines are work-alikes of the "printf()" family of functions
+** from the standard C library.
+** These routines understand most of the common formatting options from
+** the standard library printf()
+** plus some additional non-standard formats ([%q], [%Q], [%w], and [%z]).
+** See the [built-in printf()] documentation for details.
+**
+** ^The sqlite3_mprintf() and sqlite3_vmprintf() routines write their
+** results into memory obtained from [sqlite3_malloc64()].
+** The strings returned by these two routines should be
+** released by [sqlite3_free()]. ^Both routines return a
+** NULL pointer if [sqlite3_malloc64()] is unable to allocate enough
+** memory to hold the resulting string.
+**
+** ^(The sqlite3_snprintf() routine is similar to "snprintf()" from
+** the standard C library. The result is written into the
+** buffer supplied as the second parameter whose size is given by
+** the first parameter. Note that the order of the
+** first two parameters is reversed from snprintf().)^ This is an
+** historical accident that cannot be fixed without breaking
+** backwards compatibility. ^(Note also that sqlite3_snprintf()
+** returns a pointer to its buffer instead of the number of
+** characters actually written into the buffer.)^ We admit that
+** the number of characters written would be a more useful return
+** value but we cannot change the implementation of sqlite3_snprintf()
+** now without breaking compatibility.
+**
+** ^As long as the buffer size is greater than zero, sqlite3_snprintf()
+** guarantees that the buffer is always zero-terminated. ^The first
+** parameter "n" is the total size of the buffer, including space for
+** the zero terminator. So the longest string that can be completely
+** written will be n-1 characters.
+**
+** ^The sqlite3_vsnprintf() routine is a varargs version of sqlite3_snprintf().
+**
+** See also: [built-in printf()], [printf() SQL function]
+*/
+SQLITE_API char *sqlite3_mprintf(const char*,...);
+SQLITE_API char *sqlite3_vmprintf(const char*, va_list);
+SQLITE_API char *sqlite3_snprintf(int,char*,const char*, ...);
+SQLITE_API char *sqlite3_vsnprintf(int,char*,const char*, va_list);
+
+/*
+** CAPI3REF: Memory Allocation Subsystem
+**
+** The SQLite core uses these three routines for all of its own
+** internal memory allocation needs. "Core" in the previous sentence
+** does not include operating-system specific [VFS] implementation. The
+** Windows VFS uses native malloc() and free() for some operations.
+**
+** ^The sqlite3_malloc() routine returns a pointer to a block
+** of memory at least N bytes in length, where N is the parameter.
+** ^If sqlite3_malloc() is unable to obtain sufficient free
+** memory, it returns a NULL pointer. ^If the parameter N to
+** sqlite3_malloc() is zero or negative then sqlite3_malloc() returns
+** a NULL pointer.
+**
+** ^The sqlite3_malloc64(N) routine works just like
+** sqlite3_malloc(N) except that N is an unsigned 64-bit integer instead
+** of a signed 32-bit integer.
+**
+** ^Calling sqlite3_free() with a pointer previously returned
+** by sqlite3_malloc() or sqlite3_realloc() releases that memory so
+** that it might be reused. ^The sqlite3_free() routine is
+** a no-op if is called with a NULL pointer. Passing a NULL pointer
+** to sqlite3_free() is harmless. After being freed, memory
+** should neither be read nor written. Even reading previously freed
+** memory might result in a segmentation fault or other severe error.
+** Memory corruption, a segmentation fault, or other severe error
+** might result if sqlite3_free() is called with a non-NULL pointer that
+** was not obtained from sqlite3_malloc() or sqlite3_realloc().
+**
+** ^The sqlite3_realloc(X,N) interface attempts to resize a
+** prior memory allocation X to be at least N bytes.
+** ^If the X parameter to sqlite3_realloc(X,N)
+** is a NULL pointer then its behavior is identical to calling
+** sqlite3_malloc(N).
+** ^If the N parameter to sqlite3_realloc(X,N) is zero or
+** negative then the behavior is exactly the same as calling
+** sqlite3_free(X).
+** ^sqlite3_realloc(X,N) returns a pointer to a memory allocation
+** of at least N bytes in size or NULL if insufficient memory is available.
+** ^If M is the size of the prior allocation, then min(N,M) bytes
+** of the prior allocation are copied into the beginning of buffer returned
+** by sqlite3_realloc(X,N) and the prior allocation is freed.
+** ^If sqlite3_realloc(X,N) returns NULL and N is positive, then the
+** prior allocation is not freed.
+**
+** ^The sqlite3_realloc64(X,N) interfaces works the same as
+** sqlite3_realloc(X,N) except that N is a 64-bit unsigned integer instead
+** of a 32-bit signed integer.
+**
+** ^If X is a memory allocation previously obtained from sqlite3_malloc(),
+** sqlite3_malloc64(), sqlite3_realloc(), or sqlite3_realloc64(), then
+** sqlite3_msize(X) returns the size of that memory allocation in bytes.
+** ^The value returned by sqlite3_msize(X) might be larger than the number
+** of bytes requested when X was allocated. ^If X is a NULL pointer then
+** sqlite3_msize(X) returns zero. If X points to something that is not
+** the beginning of memory allocation, or if it points to a formerly
+** valid memory allocation that has now been freed, then the behavior
+** of sqlite3_msize(X) is undefined and possibly harmful.
+**
+** ^The memory returned by sqlite3_malloc(), sqlite3_realloc(),
+** sqlite3_malloc64(), and sqlite3_realloc64()
+** is always aligned to at least an 8 byte boundary, or to a
+** 4 byte boundary if the [SQLITE_4_BYTE_ALIGNED_MALLOC] compile-time
+** option is used.
+**
+** The pointer arguments to [sqlite3_free()] and [sqlite3_realloc()]
+** must be either NULL or else pointers obtained from a prior
+** invocation of [sqlite3_malloc()] or [sqlite3_realloc()] that have
+** not yet been released.
+**
+** The application must not read or write any part of
+** a block of memory after it has been released using
+** [sqlite3_free()] or [sqlite3_realloc()].
+*/
+SQLITE_API void *sqlite3_malloc(int);
+SQLITE_API void *sqlite3_malloc64(sqlite3_uint64);
+SQLITE_API void *sqlite3_realloc(void*, int);
+SQLITE_API void *sqlite3_realloc64(void*, sqlite3_uint64);
+SQLITE_API void sqlite3_free(void*);
+SQLITE_API sqlite3_uint64 sqlite3_msize(void*);
+
+/*
+** CAPI3REF: Memory Allocator Statistics
+**
+** SQLite provides these two interfaces for reporting on the status
+** of the [sqlite3_malloc()], [sqlite3_free()], and [sqlite3_realloc()]
+** routines, which form the built-in memory allocation subsystem.
+**
+** ^The [sqlite3_memory_used()] routine returns the number of bytes
+** of memory currently outstanding (malloced but not freed).
+** ^The [sqlite3_memory_highwater()] routine returns the maximum
+** value of [sqlite3_memory_used()] since the high-water mark
+** was last reset. ^The values returned by [sqlite3_memory_used()] and
+** [sqlite3_memory_highwater()] include any overhead
+** added by SQLite in its implementation of [sqlite3_malloc()],
+** but not overhead added by the any underlying system library
+** routines that [sqlite3_malloc()] may call.
+**
+** ^The memory high-water mark is reset to the current value of
+** [sqlite3_memory_used()] if and only if the parameter to
+** [sqlite3_memory_highwater()] is true. ^The value returned
+** by [sqlite3_memory_highwater(1)] is the high-water mark
+** prior to the reset.
+*/
+SQLITE_API sqlite3_int64 sqlite3_memory_used(void);
+SQLITE_API sqlite3_int64 sqlite3_memory_highwater(int resetFlag);
+
+/*
+** CAPI3REF: Pseudo-Random Number Generator
+**
+** SQLite contains a high-quality pseudo-random number generator (PRNG) used to
+** select random [ROWID | ROWIDs] when inserting new records into a table that
+** already uses the largest possible [ROWID]. The PRNG is also used for
+** the built-in random() and randomblob() SQL functions. This interface allows
+** applications to access the same PRNG for other purposes.
+**
+** ^A call to this routine stores N bytes of randomness into buffer P.
+** ^The P parameter can be a NULL pointer.
+**
+** ^If this routine has not been previously called or if the previous
+** call had N less than one or a NULL pointer for P, then the PRNG is
+** seeded using randomness obtained from the xRandomness method of
+** the default [sqlite3_vfs] object.
+** ^If the previous call to this routine had an N of 1 or more and a
+** non-NULL P then the pseudo-randomness is generated
+** internally and without recourse to the [sqlite3_vfs] xRandomness
+** method.
+*/
+SQLITE_API void sqlite3_randomness(int N, void *P);
+
+/*
+** CAPI3REF: Compile-Time Authorization Callbacks
+** METHOD: sqlite3
+** KEYWORDS: {authorizer callback}
+**
+** ^This routine registers an authorizer callback with a particular
+** [database connection], supplied in the first argument.
+** ^The authorizer callback is invoked as SQL statements are being compiled
+** by [sqlite3_prepare()] or its variants [sqlite3_prepare_v2()],
+** [sqlite3_prepare_v3()], [sqlite3_prepare16()], [sqlite3_prepare16_v2()],
+** and [sqlite3_prepare16_v3()]. ^At various
+** points during the compilation process, as logic is being created
+** to perform various actions, the authorizer callback is invoked to
+** see if those actions are allowed. ^The authorizer callback should
+** return [SQLITE_OK] to allow the action, [SQLITE_IGNORE] to disallow the
+** specific action but allow the SQL statement to continue to be
+** compiled, or [SQLITE_DENY] to cause the entire SQL statement to be
+** rejected with an error. ^If the authorizer callback returns
+** any value other than [SQLITE_IGNORE], [SQLITE_OK], or [SQLITE_DENY]
+** then the [sqlite3_prepare_v2()] or equivalent call that triggered
+** the authorizer will fail with an error message.
+**
+** When the callback returns [SQLITE_OK], that means the operation
+** requested is ok. ^When the callback returns [SQLITE_DENY], the
+** [sqlite3_prepare_v2()] or equivalent call that triggered the
+** authorizer will fail with an error message explaining that
+** access is denied.
+**
+** ^The first parameter to the authorizer callback is a copy of the third
+** parameter to the sqlite3_set_authorizer() interface. ^The second parameter
+** to the callback is an integer [SQLITE_COPY | action code] that specifies
+** the particular action to be authorized. ^The third through sixth parameters
+** to the callback are either NULL pointers or zero-terminated strings
+** that contain additional details about the action to be authorized.
+** Applications must always be prepared to encounter a NULL pointer in any
+** of the third through the sixth parameters of the authorization callback.
+**
+** ^If the action code is [SQLITE_READ]
+** and the callback returns [SQLITE_IGNORE] then the
+** [prepared statement] statement is constructed to substitute
+** a NULL value in place of the table column that would have
+** been read if [SQLITE_OK] had been returned. The [SQLITE_IGNORE]
+** return can be used to deny an untrusted user access to individual
+** columns of a table.
+** ^When a table is referenced by a [SELECT] but no column values are
+** extracted from that table (for example in a query like
+** "SELECT count(*) FROM tab") then the [SQLITE_READ] authorizer callback
+** is invoked once for that table with a column name that is an empty string.
+** ^If the action code is [SQLITE_DELETE] and the callback returns
+** [SQLITE_IGNORE] then the [DELETE] operation proceeds but the
+** [truncate optimization] is disabled and all rows are deleted individually.
+**
+** An authorizer is used when [sqlite3_prepare | preparing]
+** SQL statements from an untrusted source, to ensure that the SQL statements
+** do not try to access data they are not allowed to see, or that they do not
+** try to execute malicious statements that damage the database. For
+** example, an application may allow a user to enter arbitrary
+** SQL queries for evaluation by a database. But the application does
+** not want the user to be able to make arbitrary changes to the
+** database. An authorizer could then be put in place while the
+** user-entered SQL is being [sqlite3_prepare | prepared] that
+** disallows everything except [SELECT] statements.
+**
+** Applications that need to process SQL from untrusted sources
+** might also consider lowering resource limits using [sqlite3_limit()]
+** and limiting database size using the [max_page_count] [PRAGMA]
+** in addition to using an authorizer.
+**
+** ^(Only a single authorizer can be in place on a database connection
+** at a time. Each call to sqlite3_set_authorizer overrides the
+** previous call.)^ ^Disable the authorizer by installing a NULL callback.
+** The authorizer is disabled by default.
+**
+** The authorizer callback must not do anything that will modify
+** the database connection that invoked the authorizer callback.
+** Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their
+** database connections for the meaning of "modify" in this paragraph.
+**
+** ^When [sqlite3_prepare_v2()] is used to prepare a statement, the
+** statement might be re-prepared during [sqlite3_step()] due to a
+** schema change. Hence, the application should ensure that the
+** correct authorizer callback remains in place during the [sqlite3_step()].
+**
+** ^Note that the authorizer callback is invoked only during
+** [sqlite3_prepare()] or its variants. Authorization is not
+** performed during statement evaluation in [sqlite3_step()], unless
+** as stated in the previous paragraph, sqlite3_step() invokes
+** sqlite3_prepare_v2() to reprepare a statement after a schema change.
+*/
+SQLITE_API int sqlite3_set_authorizer(
+ sqlite3*,
+ int (*xAuth)(void*,int,const char*,const char*,const char*,const char*),
+ void *pUserData
+);
+
+/*
+** CAPI3REF: Authorizer Return Codes
+**
+** The [sqlite3_set_authorizer | authorizer callback function] must
+** return either [SQLITE_OK] or one of these two constants in order
+** to signal SQLite whether or not the action is permitted. See the
+** [sqlite3_set_authorizer | authorizer documentation] for additional
+** information.
+**
+** Note that SQLITE_IGNORE is also used as a [conflict resolution mode]
+** returned from the [sqlite3_vtab_on_conflict()] interface.
+*/
+#define SQLITE_DENY 1 /* Abort the SQL statement with an error */
+#define SQLITE_IGNORE 2 /* Don't allow access, but don't generate an error */
+
+/*
+** CAPI3REF: Authorizer Action Codes
+**
+** The [sqlite3_set_authorizer()] interface registers a callback function
+** that is invoked to authorize certain SQL statement actions. The
+** second parameter to the callback is an integer code that specifies
+** what action is being authorized. These are the integer action codes that
+** the authorizer callback may be passed.
+**
+** These action code values signify what kind of operation is to be
+** authorized. The 3rd and 4th parameters to the authorization
+** callback function will be parameters or NULL depending on which of these
+** codes is used as the second parameter. ^(The 5th parameter to the
+** authorizer callback is the name of the database ("main", "temp",
+** etc.) if applicable.)^ ^The 6th parameter to the authorizer callback
+** is the name of the inner-most trigger or view that is responsible for
+** the access attempt or NULL if this access attempt is directly from
+** top-level SQL code.
+*/
+/******************************************* 3rd ************ 4th ***********/
+#define SQLITE_CREATE_INDEX 1 /* Index Name Table Name */
+#define SQLITE_CREATE_TABLE 2 /* Table Name NULL */
+#define SQLITE_CREATE_TEMP_INDEX 3 /* Index Name Table Name */
+#define SQLITE_CREATE_TEMP_TABLE 4 /* Table Name NULL */
+#define SQLITE_CREATE_TEMP_TRIGGER 5 /* Trigger Name Table Name */
+#define SQLITE_CREATE_TEMP_VIEW 6 /* View Name NULL */
+#define SQLITE_CREATE_TRIGGER 7 /* Trigger Name Table Name */
+#define SQLITE_CREATE_VIEW 8 /* View Name NULL */
+#define SQLITE_DELETE 9 /* Table Name NULL */
+#define SQLITE_DROP_INDEX 10 /* Index Name Table Name */
+#define SQLITE_DROP_TABLE 11 /* Table Name NULL */
+#define SQLITE_DROP_TEMP_INDEX 12 /* Index Name Table Name */
+#define SQLITE_DROP_TEMP_TABLE 13 /* Table Name NULL */
+#define SQLITE_DROP_TEMP_TRIGGER 14 /* Trigger Name Table Name */
+#define SQLITE_DROP_TEMP_VIEW 15 /* View Name NULL */
+#define SQLITE_DROP_TRIGGER 16 /* Trigger Name Table Name */
+#define SQLITE_DROP_VIEW 17 /* View Name NULL */
+#define SQLITE_INSERT 18 /* Table Name NULL */
+#define SQLITE_PRAGMA 19 /* Pragma Name 1st arg or NULL */
+#define SQLITE_READ 20 /* Table Name Column Name */
+#define SQLITE_SELECT 21 /* NULL NULL */
+#define SQLITE_TRANSACTION 22 /* Operation NULL */
+#define SQLITE_UPDATE 23 /* Table Name Column Name */
+#define SQLITE_ATTACH 24 /* Filename NULL */
+#define SQLITE_DETACH 25 /* Database Name NULL */
+#define SQLITE_ALTER_TABLE 26 /* Database Name Table Name */
+#define SQLITE_REINDEX 27 /* Index Name NULL */
+#define SQLITE_ANALYZE 28 /* Table Name NULL */
+#define SQLITE_CREATE_VTABLE 29 /* Table Name Module Name */
+#define SQLITE_DROP_VTABLE 30 /* Table Name Module Name */
+#define SQLITE_FUNCTION 31 /* NULL Function Name */
+#define SQLITE_SAVEPOINT 32 /* Operation Savepoint Name */
+#define SQLITE_COPY 0 /* No longer used */
+#define SQLITE_RECURSIVE 33 /* NULL NULL */
+
+/*
+** CAPI3REF: Deprecated Tracing And Profiling Functions
+** DEPRECATED
+**
+** These routines are deprecated. Use the [sqlite3_trace_v2()] interface
+** instead of the routines described here.
+**
+** These routines register callback functions that can be used for
+** tracing and profiling the execution of SQL statements.
+**
+** ^The callback function registered by sqlite3_trace() is invoked at
+** various times when an SQL statement is being run by [sqlite3_step()].
+** ^The sqlite3_trace() callback is invoked with a UTF-8 rendering of the
+** SQL statement text as the statement first begins executing.
+** ^(Additional sqlite3_trace() callbacks might occur
+** as each triggered subprogram is entered. The callbacks for triggers
+** contain a UTF-8 SQL comment that identifies the trigger.)^
+**
+** The [SQLITE_TRACE_SIZE_LIMIT] compile-time option can be used to limit
+** the length of [bound parameter] expansion in the output of sqlite3_trace().
+**
+** ^The callback function registered by sqlite3_profile() is invoked
+** as each SQL statement finishes. ^The profile callback contains
+** the original statement text and an estimate of wall-clock time
+** of how long that statement took to run. ^The profile callback
+** time is in units of nanoseconds, however the current implementation
+** is only capable of millisecond resolution so the six least significant
+** digits in the time are meaningless. Future versions of SQLite
+** might provide greater resolution on the profiler callback. Invoking
+** either [sqlite3_trace()] or [sqlite3_trace_v2()] will cancel the
+** profile callback.
+*/
+SQLITE_API SQLITE_DEPRECATED void *sqlite3_trace(sqlite3*,
+ void(*xTrace)(void*,const char*), void*);
+SQLITE_API SQLITE_DEPRECATED void *sqlite3_profile(sqlite3*,
+ void(*xProfile)(void*,const char*,sqlite3_uint64), void*);
+
+/*
+** CAPI3REF: SQL Trace Event Codes
+** KEYWORDS: SQLITE_TRACE
+**
+** These constants identify classes of events that can be monitored
+** using the [sqlite3_trace_v2()] tracing logic. The M argument
+** to [sqlite3_trace_v2(D,M,X,P)] is an OR-ed combination of one or more of
+** the following constants. ^The first argument to the trace callback
+** is one of the following constants.
+**
+** New tracing constants may be added in future releases.
+**
+** ^A trace callback has four arguments: xCallback(T,C,P,X).
+** ^The T argument is one of the integer type codes above.
+** ^The C argument is a copy of the context pointer passed in as the
+** fourth argument to [sqlite3_trace_v2()].
+** The P and X arguments are pointers whose meanings depend on T.
+**
+**
+** [[SQLITE_TRACE_STMT]] SQLITE_TRACE_STMT
+** ^An SQLITE_TRACE_STMT callback is invoked when a prepared statement
+** first begins running and possibly at other times during the
+** execution of the prepared statement, such as at the start of each
+** trigger subprogram. ^The P argument is a pointer to the
+** [prepared statement]. ^The X argument is a pointer to a string which
+** is the unexpanded SQL text of the prepared statement or an SQL comment
+** that indicates the invocation of a trigger. ^The callback can compute
+** the same text that would have been returned by the legacy [sqlite3_trace()]
+** interface by using the X argument when X begins with "--" and invoking
+** [sqlite3_expanded_sql(P)] otherwise.
+**
+** [[SQLITE_TRACE_PROFILE]] SQLITE_TRACE_PROFILE
+** ^An SQLITE_TRACE_PROFILE callback provides approximately the same
+** information as is provided by the [sqlite3_profile()] callback.
+** ^The P argument is a pointer to the [prepared statement] and the
+** X argument points to a 64-bit integer which is approximately
+** the number of nanoseconds that the prepared statement took to run.
+** ^The SQLITE_TRACE_PROFILE callback is invoked when the statement finishes.
+**
+** [[SQLITE_TRACE_ROW]] SQLITE_TRACE_ROW
+** ^An SQLITE_TRACE_ROW callback is invoked whenever a prepared
+** statement generates a single row of result.
+** ^The P argument is a pointer to the [prepared statement] and the
+** X argument is unused.
+**
+** [[SQLITE_TRACE_CLOSE]] SQLITE_TRACE_CLOSE
+** ^An SQLITE_TRACE_CLOSE callback is invoked when a database
+** connection closes.
+** ^The P argument is a pointer to the [database connection] object
+** and the X argument is unused.
+**
+*/
+#define SQLITE_TRACE_STMT 0x01
+#define SQLITE_TRACE_PROFILE 0x02
+#define SQLITE_TRACE_ROW 0x04
+#define SQLITE_TRACE_CLOSE 0x08
+
+/*
+** CAPI3REF: SQL Trace Hook
+** METHOD: sqlite3
+**
+** ^The sqlite3_trace_v2(D,M,X,P) interface registers a trace callback
+** function X against [database connection] D, using property mask M
+** and context pointer P. ^If the X callback is
+** NULL or if the M mask is zero, then tracing is disabled. The
+** M argument should be the bitwise OR-ed combination of
+** zero or more [SQLITE_TRACE] constants.
+**
+** ^Each call to either sqlite3_trace(D,X,P) or sqlite3_trace_v2(D,M,X,P)
+** overrides (cancels) all prior calls to sqlite3_trace(D,X,P) or
+** sqlite3_trace_v2(D,M,X,P) for the [database connection] D. Each
+** database connection may have at most one trace callback.
+**
+** ^The X callback is invoked whenever any of the events identified by
+** mask M occur. ^The integer return value from the callback is currently
+** ignored, though this may change in future releases. Callback
+** implementations should return zero to ensure future compatibility.
+**
+** ^A trace callback is invoked with four arguments: callback(T,C,P,X).
+** ^The T argument is one of the [SQLITE_TRACE]
+** constants to indicate why the callback was invoked.
+** ^The C argument is a copy of the context pointer.
+** The P and X arguments are pointers whose meanings depend on T.
+**
+** The sqlite3_trace_v2() interface is intended to replace the legacy
+** interfaces [sqlite3_trace()] and [sqlite3_profile()], both of which
+** are deprecated.
+*/
+SQLITE_API int sqlite3_trace_v2(
+ sqlite3*,
+ unsigned uMask,
+ int(*xCallback)(unsigned,void*,void*,void*),
+ void *pCtx
+);
+
+/*
+** CAPI3REF: Query Progress Callbacks
+** METHOD: sqlite3
+**
+** ^The sqlite3_progress_handler(D,N,X,P) interface causes the callback
+** function X to be invoked periodically during long running calls to
+** [sqlite3_step()] and [sqlite3_prepare()] and similar for
+** database connection D. An example use for this
+** interface is to keep a GUI updated during a large query.
+**
+** ^The parameter P is passed through as the only parameter to the
+** callback function X. ^The parameter N is the approximate number of
+** [virtual machine instructions] that are evaluated between successive
+** invocations of the callback X. ^If N is less than one then the progress
+** handler is disabled.
+**
+** ^Only a single progress handler may be defined at one time per
+** [database connection]; setting a new progress handler cancels the
+** old one. ^Setting parameter X to NULL disables the progress handler.
+** ^The progress handler is also disabled by setting N to a value less
+** than 1.
+**
+** ^If the progress callback returns non-zero, the operation is
+** interrupted. This feature can be used to implement a
+** "Cancel" button on a GUI progress dialog box.
+**
+** The progress handler callback must not do anything that will modify
+** the database connection that invoked the progress handler.
+** Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their
+** database connections for the meaning of "modify" in this paragraph.
+**
+** The progress handler callback would originally only be invoked from the
+** bytecode engine. It still might be invoked during [sqlite3_prepare()]
+** and similar because those routines might force a reparse of the schema
+** which involves running the bytecode engine. However, beginning with
+** SQLite version 3.41.0, the progress handler callback might also be
+** invoked directly from [sqlite3_prepare()] while analyzing and generating
+** code for complex queries.
+*/
+SQLITE_API void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*);
+
+/*
+** CAPI3REF: Opening A New Database Connection
+** CONSTRUCTOR: sqlite3
+**
+** ^These routines open an SQLite database file as specified by the
+** filename argument. ^The filename argument is interpreted as UTF-8 for
+** sqlite3_open() and sqlite3_open_v2() and as UTF-16 in the native byte
+** order for sqlite3_open16(). ^(A [database connection] handle is usually
+** returned in *ppDb, even if an error occurs. The only exception is that
+** if SQLite is unable to allocate memory to hold the [sqlite3] object,
+** a NULL will be written into *ppDb instead of a pointer to the [sqlite3]
+** object.)^ ^(If the database is opened (and/or created) successfully, then
+** [SQLITE_OK] is returned. Otherwise an [error code] is returned.)^ ^The
+** [sqlite3_errmsg()] or [sqlite3_errmsg16()] routines can be used to obtain
+** an English language description of the error following a failure of any
+** of the sqlite3_open() routines.
+**
+** ^The default encoding will be UTF-8 for databases created using
+** sqlite3_open() or sqlite3_open_v2(). ^The default encoding for databases
+** created using sqlite3_open16() will be UTF-16 in the native byte order.
+**
+** Whether or not an error occurs when it is opened, resources
+** associated with the [database connection] handle should be released by
+** passing it to [sqlite3_close()] when it is no longer required.
+**
+** The sqlite3_open_v2() interface works like sqlite3_open()
+** except that it accepts two additional parameters for additional control
+** over the new database connection. ^(The flags parameter to
+** sqlite3_open_v2() must include, at a minimum, one of the following
+** three flag combinations:)^
+**
+**
+** ^([SQLITE_OPEN_READONLY]
+** The database is opened in read-only mode. If the database does
+** not already exist, an error is returned. )^
+**
+** ^([SQLITE_OPEN_READWRITE]
+** The database is opened for reading and writing if possible, or
+** reading only if the file is write protected by the operating
+** system. In either case the database must already exist, otherwise
+** an error is returned. For historical reasons, if opening in
+** read-write mode fails due to OS-level permissions, an attempt is
+** made to open it in read-only mode. [sqlite3_db_readonly()] can be
+** used to determine whether the database is actually
+** read-write. )^
+**
+** ^([SQLITE_OPEN_READWRITE] | [SQLITE_OPEN_CREATE]
+** The database is opened for reading and writing, and is created if
+** it does not already exist. This is the behavior that is always used for
+** sqlite3_open() and sqlite3_open16(). )^
+**
+**
+** In addition to the required flags, the following optional flags are
+** also supported:
+**
+**
+** ^([SQLITE_OPEN_URI]
+** The filename can be interpreted as a URI if this flag is set. )^
+**
+** ^([SQLITE_OPEN_MEMORY]
+** The database will be opened as an in-memory database. The database
+** is named by the "filename" argument for the purposes of cache-sharing,
+** if shared cache mode is enabled, but the "filename" is otherwise ignored.
+** )^
+**
+** ^([SQLITE_OPEN_NOMUTEX]
+** The new database connection will use the "multi-thread"
+** [threading mode].)^ This means that separate threads are allowed
+** to use SQLite at the same time, as long as each thread is using
+** a different [database connection].
+**
+** ^( [SQLITE_OPEN_FULLMUTEX]
+** The new database connection will use the "serialized"
+** [threading mode].)^ This means the multiple threads can safely
+** attempt to use the same database connection at the same time.
+** (Mutexes will block any actual concurrency, but in this mode
+** there is no harm in trying.)
+**
+** ^( [SQLITE_OPEN_SHAREDCACHE]
+** The database is opened [shared cache] enabled, overriding
+** the default shared cache setting provided by
+** [sqlite3_enable_shared_cache()].)^
+** The [use of shared cache mode is discouraged] and hence shared cache
+** capabilities may be omitted from many builds of SQLite. In such cases,
+** this option is a no-op.
+**
+** ^( [SQLITE_OPEN_PRIVATECACHE]
+** The database is opened [shared cache] disabled, overriding
+** the default shared cache setting provided by
+** [sqlite3_enable_shared_cache()].)^
+**
+** [[OPEN_EXRESCODE]] ^( [SQLITE_OPEN_EXRESCODE]
+** The database connection comes up in "extended result code mode".
+** In other words, the database behaves as if
+** [sqlite3_extended_result_codes(db,1)] were called on the database
+** connection as soon as the connection is created. In addition to setting
+** the extended result code mode, this flag also causes [sqlite3_open_v2()]
+** to return an extended result code.
+**
+** [[OPEN_NOFOLLOW]] ^([SQLITE_OPEN_NOFOLLOW]
+** The database filename is not allowed to contain a symbolic link
+** )^
+**
+** If the 3rd parameter to sqlite3_open_v2() is not one of the
+** required combinations shown above optionally combined with other
+** [SQLITE_OPEN_READONLY | SQLITE_OPEN_* bits]
+** then the behavior is undefined. Historic versions of SQLite
+** have silently ignored surplus bits in the flags parameter to
+** sqlite3_open_v2(), however that behavior might not be carried through
+** into future versions of SQLite and so applications should not rely
+** upon it. Note in particular that the SQLITE_OPEN_EXCLUSIVE flag is a no-op
+** for sqlite3_open_v2(). The SQLITE_OPEN_EXCLUSIVE does *not* cause
+** the open to fail if the database already exists. The SQLITE_OPEN_EXCLUSIVE
+** flag is intended for use by the [sqlite3_vfs|VFS interface] only, and not
+** by sqlite3_open_v2().
+**
+** ^The fourth parameter to sqlite3_open_v2() is the name of the
+** [sqlite3_vfs] object that defines the operating system interface that
+** the new database connection should use. ^If the fourth parameter is
+** a NULL pointer then the default [sqlite3_vfs] object is used.
+**
+** ^If the filename is ":memory:", then a private, temporary in-memory database
+** is created for the connection. ^This in-memory database will vanish when
+** the database connection is closed. Future versions of SQLite might
+** make use of additional special filenames that begin with the ":" character.
+** It is recommended that when a database filename actually does begin with
+** a ":" character you should prefix the filename with a pathname such as
+** "./" to avoid ambiguity.
+**
+** ^If the filename is an empty string, then a private, temporary
+** on-disk database will be created. ^This private database will be
+** automatically deleted as soon as the database connection is closed.
+**
+** [[URI filenames in sqlite3_open()]] URI Filenames
+**
+** ^If [URI filename] interpretation is enabled, and the filename argument
+** begins with "file:", then the filename is interpreted as a URI. ^URI
+** filename interpretation is enabled if the [SQLITE_OPEN_URI] flag is
+** set in the third argument to sqlite3_open_v2(), or if it has
+** been enabled globally using the [SQLITE_CONFIG_URI] option with the
+** [sqlite3_config()] method or by the [SQLITE_USE_URI] compile-time option.
+** URI filename interpretation is turned off
+** by default, but future releases of SQLite might enable URI filename
+** interpretation by default. See "[URI filenames]" for additional
+** information.
+**
+** URI filenames are parsed according to RFC 3986. ^If the URI contains an
+** authority, then it must be either an empty string or the string
+** "localhost". ^If the authority is not an empty string or "localhost", an
+** error is returned to the caller. ^The fragment component of a URI, if
+** present, is ignored.
+**
+** ^SQLite uses the path component of the URI as the name of the disk file
+** which contains the database. ^If the path begins with a '/' character,
+** then it is interpreted as an absolute path. ^If the path does not begin
+** with a '/' (meaning that the authority section is omitted from the URI)
+** then the path is interpreted as a relative path.
+** ^(On windows, the first component of an absolute path
+** is a drive specification (e.g. "C:").)^
+**
+** [[core URI query parameters]]
+** The query component of a URI may contain parameters that are interpreted
+** either by SQLite itself, or by a [VFS | custom VFS implementation].
+** SQLite and its built-in [VFSes] interpret the
+** following query parameters:
+**
+**
+** vfs : ^The "vfs" parameter may be used to specify the name of
+** a VFS object that provides the operating system interface that should
+** be used to access the database file on disk. ^If this option is set to
+** an empty string the default VFS object is used. ^Specifying an unknown
+** VFS is an error. ^If sqlite3_open_v2() is used and the vfs option is
+** present, then the VFS specified by the option takes precedence over
+** the value passed as the fourth parameter to sqlite3_open_v2().
+**
+** mode : ^(The mode parameter may be set to either "ro", "rw",
+** "rwc", or "memory". Attempting to set it to any other value is
+** an error)^.
+** ^If "ro" is specified, then the database is opened for read-only
+** access, just as if the [SQLITE_OPEN_READONLY] flag had been set in the
+** third argument to sqlite3_open_v2(). ^If the mode option is set to
+** "rw", then the database is opened for read-write (but not create)
+** access, as if SQLITE_OPEN_READWRITE (but not SQLITE_OPEN_CREATE) had
+** been set. ^Value "rwc" is equivalent to setting both
+** SQLITE_OPEN_READWRITE and SQLITE_OPEN_CREATE. ^If the mode option is
+** set to "memory" then a pure [in-memory database] that never reads
+** or writes from disk is used. ^It is an error to specify a value for
+** the mode parameter that is less restrictive than that specified by
+** the flags passed in the third parameter to sqlite3_open_v2().
+**
+** cache : ^The cache parameter may be set to either "shared" or
+** "private". ^Setting it to "shared" is equivalent to setting the
+** SQLITE_OPEN_SHAREDCACHE bit in the flags argument passed to
+** sqlite3_open_v2(). ^Setting the cache parameter to "private" is
+** equivalent to setting the SQLITE_OPEN_PRIVATECACHE bit.
+** ^If sqlite3_open_v2() is used and the "cache" parameter is present in
+** a URI filename, its value overrides any behavior requested by setting
+** SQLITE_OPEN_PRIVATECACHE or SQLITE_OPEN_SHAREDCACHE flag.
+**
+** psow : ^The psow parameter indicates whether or not the
+** [powersafe overwrite] property does or does not apply to the
+** storage media on which the database file resides.
+**
+** nolock : ^The nolock parameter is a boolean query parameter
+** which if set disables file locking in rollback journal modes. This
+** is useful for accessing a database on a filesystem that does not
+** support locking. Caution: Database corruption might result if two
+** or more processes write to the same database and any one of those
+** processes uses nolock=1.
+**
+** immutable : ^The immutable parameter is a boolean query
+** parameter that indicates that the database file is stored on
+** read-only media. ^When immutable is set, SQLite assumes that the
+** database file cannot be changed, even by a process with higher
+** privilege, and so the database is opened read-only and all locking
+** and change detection is disabled. Caution: Setting the immutable
+** property on a database file that does in fact change can result
+** in incorrect query results and/or [SQLITE_CORRUPT] errors.
+** See also: [SQLITE_IOCAP_IMMUTABLE].
+**
+**
+**
+** ^Specifying an unknown parameter in the query component of a URI is not an
+** error. Future versions of SQLite might understand additional query
+** parameters. See "[query parameters with special meaning to SQLite]" for
+** additional information.
+**
+** [[URI filename examples]] URI filename examples
+**
+**
+** URI filenames Results
+** file:data.db
+** Open the file "data.db" in the current directory.
+** file:/home/fred/data.db
+** file:///home/fred/data.db
+** file://localhost/home/fred/data.db
+** Open the database file "/home/fred/data.db".
+** file://darkstar/home/fred/data.db
+** An error. "darkstar" is not a recognized authority.
+**
+** file:///C:/Documents%20and%20Settings/fred/Desktop/data.db
+** Windows only: Open the file "data.db" on fred's desktop on drive
+** C:. Note that the %20 escaping in this example is not strictly
+** necessary - space characters can be used literally
+** in URI filenames.
+** file:data.db?mode=ro&cache=private
+** Open file "data.db" in the current directory for read-only access.
+** Regardless of whether or not shared-cache mode is enabled by
+** default, use a private cache.
+** file:/home/fred/data.db?vfs=unix-dotfile
+** Open file "/home/fred/data.db". Use the special VFS "unix-dotfile"
+** that uses dot-files in place of posix advisory locking.
+** file:data.db?mode=readonly
+** An error. "readonly" is not a valid option for the "mode" parameter.
+** Use "ro" instead: "file:data.db?mode=ro".
+**
+**
+** ^URI hexadecimal escape sequences (%HH) are supported within the path and
+** query components of a URI. A hexadecimal escape sequence consists of a
+** percent sign - "%" - followed by exactly two hexadecimal digits
+** specifying an octet value. ^Before the path or query components of a
+** URI filename are interpreted, they are encoded using UTF-8 and all
+** hexadecimal escape sequences replaced by a single byte containing the
+** corresponding octet. If this process generates an invalid UTF-8 encoding,
+** the results are undefined.
+**
+** Note to Windows users: The encoding used for the filename argument
+** of sqlite3_open() and sqlite3_open_v2() must be UTF-8, not whatever
+** codepage is currently defined. Filenames containing international
+** characters must be converted to UTF-8 prior to passing them into
+** sqlite3_open() or sqlite3_open_v2().
+**
+** Note to Windows Runtime users: The temporary directory must be set
+** prior to calling sqlite3_open() or sqlite3_open_v2(). Otherwise, various
+** features that require the use of temporary files may fail.
+**
+** See also: [sqlite3_temp_directory]
+*/
+SQLITE_API int sqlite3_open(
+ const char *filename, /* Database filename (UTF-8) */
+ sqlite3 **ppDb /* OUT: SQLite db handle */
+);
+SQLITE_API int sqlite3_open16(
+ const void *filename, /* Database filename (UTF-16) */
+ sqlite3 **ppDb /* OUT: SQLite db handle */
+);
+SQLITE_API int sqlite3_open_v2(
+ const char *filename, /* Database filename (UTF-8) */
+ sqlite3 **ppDb, /* OUT: SQLite db handle */
+ int flags, /* Flags */
+ const char *zVfs /* Name of VFS module to use */
+);
+
+/*
+** CAPI3REF: Obtain Values For URI Parameters
+**
+** These are utility routines, useful to [VFS|custom VFS implementations],
+** that check if a database file was a URI that contained a specific query
+** parameter, and if so obtains the value of that query parameter.
+**
+** The first parameter to these interfaces (hereafter referred to
+** as F) must be one of:
+**
+** A database filename pointer created by the SQLite core and
+** passed into the xOpen() method of a VFS implementation, or
+** A filename obtained from [sqlite3_db_filename()], or
+** A new filename constructed using [sqlite3_create_filename()].
+**
+** If the F parameter is not one of the above, then the behavior is
+** undefined and probably undesirable. Older versions of SQLite were
+** more tolerant of invalid F parameters than newer versions.
+**
+** If F is a suitable filename (as described in the previous paragraph)
+** and if P is the name of the query parameter, then
+** sqlite3_uri_parameter(F,P) returns the value of the P
+** parameter if it exists or a NULL pointer if P does not appear as a
+** query parameter on F. If P is a query parameter of F and it
+** has no explicit value, then sqlite3_uri_parameter(F,P) returns
+** a pointer to an empty string.
+**
+** The sqlite3_uri_boolean(F,P,B) routine assumes that P is a boolean
+** parameter and returns true (1) or false (0) according to the value
+** of P. The sqlite3_uri_boolean(F,P,B) routine returns true (1) if the
+** value of query parameter P is one of "yes", "true", or "on" in any
+** case or if the value begins with a non-zero number. The
+** sqlite3_uri_boolean(F,P,B) routines returns false (0) if the value of
+** query parameter P is one of "no", "false", or "off" in any case or
+** if the value begins with a numeric zero. If P is not a query
+** parameter on F or if the value of P does not match any of the
+** above, then sqlite3_uri_boolean(F,P,B) returns (B!=0).
+**
+** The sqlite3_uri_int64(F,P,D) routine converts the value of P into a
+** 64-bit signed integer and returns that integer, or D if P does not
+** exist. If the value of P is something other than an integer, then
+** zero is returned.
+**
+** The sqlite3_uri_key(F,N) returns a pointer to the name (not
+** the value) of the N-th query parameter for filename F, or a NULL
+** pointer if N is less than zero or greater than the number of query
+** parameters minus 1. The N value is zero-based so N should be 0 to obtain
+** the name of the first query parameter, 1 for the second parameter, and
+** so forth.
+**
+** If F is a NULL pointer, then sqlite3_uri_parameter(F,P) returns NULL and
+** sqlite3_uri_boolean(F,P,B) returns B. If F is not a NULL pointer and
+** is not a database file pathname pointer that the SQLite core passed
+** into the xOpen VFS method, then the behavior of this routine is undefined
+** and probably undesirable.
+**
+** Beginning with SQLite [version 3.31.0] ([dateof:3.31.0]) the input F
+** parameter can also be the name of a rollback journal file or WAL file
+** in addition to the main database file. Prior to version 3.31.0, these
+** routines would only work if F was the name of the main database file.
+** When the F parameter is the name of the rollback journal or WAL file,
+** it has access to all the same query parameters as were found on the
+** main database file.
+**
+** See the [URI filename] documentation for additional information.
+*/
+SQLITE_API const char *sqlite3_uri_parameter(sqlite3_filename z, const char *zParam);
+SQLITE_API int sqlite3_uri_boolean(sqlite3_filename z, const char *zParam, int bDefault);
+SQLITE_API sqlite3_int64 sqlite3_uri_int64(sqlite3_filename, const char*, sqlite3_int64);
+SQLITE_API const char *sqlite3_uri_key(sqlite3_filename z, int N);
+
+/*
+** CAPI3REF: Translate filenames
+**
+** These routines are available to [VFS|custom VFS implementations] for
+** translating filenames between the main database file, the journal file,
+** and the WAL file.
+**
+** If F is the name of an sqlite database file, journal file, or WAL file
+** passed by the SQLite core into the VFS, then sqlite3_filename_database(F)
+** returns the name of the corresponding database file.
+**
+** If F is the name of an sqlite database file, journal file, or WAL file
+** passed by the SQLite core into the VFS, or if F is a database filename
+** obtained from [sqlite3_db_filename()], then sqlite3_filename_journal(F)
+** returns the name of the corresponding rollback journal file.
+**
+** If F is the name of an sqlite database file, journal file, or WAL file
+** that was passed by the SQLite core into the VFS, or if F is a database
+** filename obtained from [sqlite3_db_filename()], then
+** sqlite3_filename_wal(F) returns the name of the corresponding
+** WAL file.
+**
+** In all of the above, if F is not the name of a database, journal or WAL
+** filename passed into the VFS from the SQLite core and F is not the
+** return value from [sqlite3_db_filename()], then the result is
+** undefined and is likely a memory access violation.
+*/
+SQLITE_API const char *sqlite3_filename_database(sqlite3_filename);
+SQLITE_API const char *sqlite3_filename_journal(sqlite3_filename);
+SQLITE_API const char *sqlite3_filename_wal(sqlite3_filename);
+
+/*
+** CAPI3REF: Database File Corresponding To A Journal
+**
+** ^If X is the name of a rollback or WAL-mode journal file that is
+** passed into the xOpen method of [sqlite3_vfs], then
+** sqlite3_database_file_object(X) returns a pointer to the [sqlite3_file]
+** object that represents the main database file.
+**
+** This routine is intended for use in custom [VFS] implementations
+** only. It is not a general-purpose interface.
+** The argument sqlite3_file_object(X) must be a filename pointer that
+** has been passed into [sqlite3_vfs].xOpen method where the
+** flags parameter to xOpen contains one of the bits
+** [SQLITE_OPEN_MAIN_JOURNAL] or [SQLITE_OPEN_WAL]. Any other use
+** of this routine results in undefined and probably undesirable
+** behavior.
+*/
+SQLITE_API sqlite3_file *sqlite3_database_file_object(const char*);
+
+/*
+** CAPI3REF: Create and Destroy VFS Filenames
+**
+** These interfaces are provided for use by [VFS shim] implementations and
+** are not useful outside of that context.
+**
+** The sqlite3_create_filename(D,J,W,N,P) allocates memory to hold a version of
+** database filename D with corresponding journal file J and WAL file W and
+** an array P of N URI Key/Value pairs. The result from
+** sqlite3_create_filename(D,J,W,N,P) is a pointer to a database filename that
+** is safe to pass to routines like:
+**
+** [sqlite3_uri_parameter()],
+** [sqlite3_uri_boolean()],
+** [sqlite3_uri_int64()],
+** [sqlite3_uri_key()],
+** [sqlite3_filename_database()],
+** [sqlite3_filename_journal()], or
+** [sqlite3_filename_wal()].
+**
+** If a memory allocation error occurs, sqlite3_create_filename() might
+** return a NULL pointer. The memory obtained from sqlite3_create_filename(X)
+** must be released by a corresponding call to sqlite3_free_filename(Y).
+**
+** The P parameter in sqlite3_create_filename(D,J,W,N,P) should be an array
+** of 2*N pointers to strings. Each pair of pointers in this array corresponds
+** to a key and value for a query parameter. The P parameter may be a NULL
+** pointer if N is zero. None of the 2*N pointers in the P array may be
+** NULL pointers and key pointers should not be empty strings.
+** None of the D, J, or W parameters to sqlite3_create_filename(D,J,W,N,P) may
+** be NULL pointers, though they can be empty strings.
+**
+** The sqlite3_free_filename(Y) routine releases a memory allocation
+** previously obtained from sqlite3_create_filename(). Invoking
+** sqlite3_free_filename(Y) where Y is a NULL pointer is a harmless no-op.
+**
+** If the Y parameter to sqlite3_free_filename(Y) is anything other
+** than a NULL pointer or a pointer previously acquired from
+** sqlite3_create_filename(), then bad things such as heap
+** corruption or segfaults may occur. The value Y should not be
+** used again after sqlite3_free_filename(Y) has been called. This means
+** that if the [sqlite3_vfs.xOpen()] method of a VFS has been called using Y,
+** then the corresponding [sqlite3_module.xClose() method should also be
+** invoked prior to calling sqlite3_free_filename(Y).
+*/
+SQLITE_API sqlite3_filename sqlite3_create_filename(
+ const char *zDatabase,
+ const char *zJournal,
+ const char *zWal,
+ int nParam,
+ const char **azParam
+);
+SQLITE_API void sqlite3_free_filename(sqlite3_filename);
+
+/*
+** CAPI3REF: Error Codes And Messages
+** METHOD: sqlite3
+**
+** ^If the most recent sqlite3_* API call associated with
+** [database connection] D failed, then the sqlite3_errcode(D) interface
+** returns the numeric [result code] or [extended result code] for that
+** API call.
+** ^The sqlite3_extended_errcode()
+** interface is the same except that it always returns the
+** [extended result code] even when extended result codes are
+** disabled.
+**
+** The values returned by sqlite3_errcode() and/or
+** sqlite3_extended_errcode() might change with each API call.
+** Except, there are some interfaces that are guaranteed to never
+** change the value of the error code. The error-code preserving
+** interfaces include the following:
+**
+**
+** sqlite3_errcode()
+** sqlite3_extended_errcode()
+** sqlite3_errmsg()
+** sqlite3_errmsg16()
+** sqlite3_error_offset()
+**
+**
+** ^The sqlite3_errmsg() and sqlite3_errmsg16() return English-language
+** text that describes the error, as either UTF-8 or UTF-16 respectively,
+** or NULL if no error message is available.
+** (See how SQLite handles [invalid UTF] for exceptions to this rule.)
+** ^(Memory to hold the error message string is managed internally.
+** The application does not need to worry about freeing the result.
+** However, the error string might be overwritten or deallocated by
+** subsequent calls to other SQLite interface functions.)^
+**
+** ^The sqlite3_errstr(E) interface returns the English-language text
+** that describes the [result code] E, as UTF-8, or NULL if E is not an
+** result code for which a text error message is available.
+** ^(Memory to hold the error message string is managed internally
+** and must not be freed by the application)^.
+**
+** ^If the most recent error references a specific token in the input
+** SQL, the sqlite3_error_offset() interface returns the byte offset
+** of the start of that token. ^The byte offset returned by
+** sqlite3_error_offset() assumes that the input SQL is UTF8.
+** ^If the most recent error does not reference a specific token in the input
+** SQL, then the sqlite3_error_offset() function returns -1.
+**
+** When the serialized [threading mode] is in use, it might be the
+** case that a second error occurs on a separate thread in between
+** the time of the first error and the call to these interfaces.
+** When that happens, the second error will be reported since these
+** interfaces always report the most recent result. To avoid
+** this, each thread can obtain exclusive use of the [database connection] D
+** by invoking [sqlite3_mutex_enter]([sqlite3_db_mutex](D)) before beginning
+** to use D and invoking [sqlite3_mutex_leave]([sqlite3_db_mutex](D)) after
+** all calls to the interfaces listed here are completed.
+**
+** If an interface fails with SQLITE_MISUSE, that means the interface
+** was invoked incorrectly by the application. In that case, the
+** error code and message may or may not be set.
+*/
+SQLITE_API int sqlite3_errcode(sqlite3 *db);
+SQLITE_API int sqlite3_extended_errcode(sqlite3 *db);
+SQLITE_API const char *sqlite3_errmsg(sqlite3*);
+SQLITE_API const void *sqlite3_errmsg16(sqlite3*);
+SQLITE_API const char *sqlite3_errstr(int);
+SQLITE_API int sqlite3_error_offset(sqlite3 *db);
+
+/*
+** CAPI3REF: Prepared Statement Object
+** KEYWORDS: {prepared statement} {prepared statements}
+**
+** An instance of this object represents a single SQL statement that
+** has been compiled into binary form and is ready to be evaluated.
+**
+** Think of each SQL statement as a separate computer program. The
+** original SQL text is source code. A prepared statement object
+** is the compiled object code. All SQL must be converted into a
+** prepared statement before it can be run.
+**
+** The life-cycle of a prepared statement object usually goes like this:
+**
+**
+** Create the prepared statement object using [sqlite3_prepare_v2()].
+** Bind values to [parameters] using the sqlite3_bind_*()
+** interfaces.
+** Run the SQL by calling [sqlite3_step()] one or more times.
+** Reset the prepared statement using [sqlite3_reset()] then go back
+** to step 2. Do this zero or more times.
+** Destroy the object using [sqlite3_finalize()].
+**
+*/
+typedef struct sqlite3_stmt sqlite3_stmt;
+
+/*
+** CAPI3REF: Run-time Limits
+** METHOD: sqlite3
+**
+** ^(This interface allows the size of various constructs to be limited
+** on a connection by connection basis. The first parameter is the
+** [database connection] whose limit is to be set or queried. The
+** second parameter is one of the [limit categories] that define a
+** class of constructs to be size limited. The third parameter is the
+** new limit for that construct.)^
+**
+** ^If the new limit is a negative number, the limit is unchanged.
+** ^(For each limit category SQLITE_LIMIT_NAME there is a
+** [limits | hard upper bound]
+** set at compile-time by a C preprocessor macro called
+** [limits | SQLITE_MAX_NAME ].
+** (The "_LIMIT_" in the name is changed to "_MAX_".))^
+** ^Attempts to increase a limit above its hard upper bound are
+** silently truncated to the hard upper bound.
+**
+** ^Regardless of whether or not the limit was changed, the
+** [sqlite3_limit()] interface returns the prior value of the limit.
+** ^Hence, to find the current value of a limit without changing it,
+** simply invoke this interface with the third parameter set to -1.
+**
+** Run-time limits are intended for use in applications that manage
+** both their own internal database and also databases that are controlled
+** by untrusted external sources. An example application might be a
+** web browser that has its own databases for storing history and
+** separate databases controlled by JavaScript applications downloaded
+** off the Internet. The internal databases can be given the
+** large, default limits. Databases managed by external sources can
+** be given much smaller limits designed to prevent a denial of service
+** attack. Developers might also want to use the [sqlite3_set_authorizer()]
+** interface to further control untrusted SQL. The size of the database
+** created by an untrusted script can be contained using the
+** [max_page_count] [PRAGMA].
+**
+** New run-time limit categories may be added in future releases.
+*/
+SQLITE_API int sqlite3_limit(sqlite3*, int id, int newVal);
+
+/*
+** CAPI3REF: Run-Time Limit Categories
+** KEYWORDS: {limit category} {*limit categories}
+**
+** These constants define various performance limits
+** that can be lowered at run-time using [sqlite3_limit()].
+** The synopsis of the meanings of the various limits is shown below.
+** Additional information is available at [limits | Limits in SQLite].
+**
+**
+** [[SQLITE_LIMIT_LENGTH]] ^(SQLITE_LIMIT_LENGTH
+** The maximum size of any string or BLOB or table row, in bytes.)^
+**
+** [[SQLITE_LIMIT_SQL_LENGTH]] ^( SQLITE_LIMIT_SQL_LENGTH
+** The maximum length of an SQL statement, in bytes. )^
+**
+** [[SQLITE_LIMIT_COLUMN]] ^(SQLITE_LIMIT_COLUMN
+** The maximum number of columns in a table definition or in the
+** result set of a [SELECT] or the maximum number of columns in an index
+** or in an ORDER BY or GROUP BY clause. )^
+**
+** [[SQLITE_LIMIT_EXPR_DEPTH]] ^(SQLITE_LIMIT_EXPR_DEPTH
+** The maximum depth of the parse tree on any expression. )^
+**
+** [[SQLITE_LIMIT_COMPOUND_SELECT]] ^(SQLITE_LIMIT_COMPOUND_SELECT
+** The maximum number of terms in a compound SELECT statement. )^
+**
+** [[SQLITE_LIMIT_VDBE_OP]] ^(SQLITE_LIMIT_VDBE_OP
+** The maximum number of instructions in a virtual machine program
+** used to implement an SQL statement. If [sqlite3_prepare_v2()] or
+** the equivalent tries to allocate space for more than this many opcodes
+** in a single prepared statement, an SQLITE_NOMEM error is returned. )^
+**
+** [[SQLITE_LIMIT_FUNCTION_ARG]] ^(SQLITE_LIMIT_FUNCTION_ARG
+** The maximum number of arguments on a function. )^
+**
+** [[SQLITE_LIMIT_ATTACHED]] ^(SQLITE_LIMIT_ATTACHED
+** The maximum number of [ATTACH | attached databases].)^
+**
+** [[SQLITE_LIMIT_LIKE_PATTERN_LENGTH]]
+** ^(SQLITE_LIMIT_LIKE_PATTERN_LENGTH
+** The maximum length of the pattern argument to the [LIKE] or
+** [GLOB] operators. )^
+**
+** [[SQLITE_LIMIT_VARIABLE_NUMBER]]
+** ^(SQLITE_LIMIT_VARIABLE_NUMBER
+** The maximum index number of any [parameter] in an SQL statement.)^
+**
+** [[SQLITE_LIMIT_TRIGGER_DEPTH]] ^( SQLITE_LIMIT_TRIGGER_DEPTH
+** The maximum depth of recursion for triggers. )^
+**
+** [[SQLITE_LIMIT_WORKER_THREADS]] ^(SQLITE_LIMIT_WORKER_THREADS
+** The maximum number of auxiliary worker threads that a single
+** [prepared statement] may start. )^
+**
+*/
+#define SQLITE_LIMIT_LENGTH 0
+#define SQLITE_LIMIT_SQL_LENGTH 1
+#define SQLITE_LIMIT_COLUMN 2
+#define SQLITE_LIMIT_EXPR_DEPTH 3
+#define SQLITE_LIMIT_COMPOUND_SELECT 4
+#define SQLITE_LIMIT_VDBE_OP 5
+#define SQLITE_LIMIT_FUNCTION_ARG 6
+#define SQLITE_LIMIT_ATTACHED 7
+#define SQLITE_LIMIT_LIKE_PATTERN_LENGTH 8
+#define SQLITE_LIMIT_VARIABLE_NUMBER 9
+#define SQLITE_LIMIT_TRIGGER_DEPTH 10
+#define SQLITE_LIMIT_WORKER_THREADS 11
+
+/*
+** CAPI3REF: Prepare Flags
+**
+** These constants define various flags that can be passed into
+** "prepFlags" parameter of the [sqlite3_prepare_v3()] and
+** [sqlite3_prepare16_v3()] interfaces.
+**
+** New flags may be added in future releases of SQLite.
+**
+**
+** [[SQLITE_PREPARE_PERSISTENT]] ^(SQLITE_PREPARE_PERSISTENT
+** The SQLITE_PREPARE_PERSISTENT flag is a hint to the query planner
+** that the prepared statement will be retained for a long time and
+** probably reused many times.)^ ^Without this flag, [sqlite3_prepare_v3()]
+** and [sqlite3_prepare16_v3()] assume that the prepared statement will
+** be used just once or at most a few times and then destroyed using
+** [sqlite3_finalize()] relatively soon. The current implementation acts
+** on this hint by avoiding the use of [lookaside memory] so as not to
+** deplete the limited store of lookaside memory. Future versions of
+** SQLite may act on this hint differently.
+**
+** [[SQLITE_PREPARE_NORMALIZE]] SQLITE_PREPARE_NORMALIZE
+** The SQLITE_PREPARE_NORMALIZE flag is a no-op. This flag used
+** to be required for any prepared statement that wanted to use the
+** [sqlite3_normalized_sql()] interface. However, the
+** [sqlite3_normalized_sql()] interface is now available to all
+** prepared statements, regardless of whether or not they use this
+** flag.
+**
+** [[SQLITE_PREPARE_NO_VTAB]] SQLITE_PREPARE_NO_VTAB
+** The SQLITE_PREPARE_NO_VTAB flag causes the SQL compiler
+** to return an error (error code SQLITE_ERROR) if the statement uses
+** any virtual tables.
+**
+** [[SQLITE_PREPARE_DONT_LOG]] SQLITE_PREPARE_DONT_LOG
+** The SQLITE_PREPARE_DONT_LOG flag prevents SQL compiler
+** errors from being sent to the error log defined by
+** [SQLITE_CONFIG_LOG]. This can be used, for example, to do test
+** compiles to see if some SQL syntax is well-formed, without generating
+** messages on the global error log when it is not. If the test compile
+** fails, the sqlite3_prepare_v3() call returns the same error indications
+** with or without this flag; it just omits the call to [sqlite3_log()] that
+** logs the error.
+**
+*/
+#define SQLITE_PREPARE_PERSISTENT 0x01
+#define SQLITE_PREPARE_NORMALIZE 0x02
+#define SQLITE_PREPARE_NO_VTAB 0x04
+#define SQLITE_PREPARE_DONT_LOG 0x10
+
+/*
+** CAPI3REF: Compiling An SQL Statement
+** KEYWORDS: {SQL statement compiler}
+** METHOD: sqlite3
+** CONSTRUCTOR: sqlite3_stmt
+**
+** To execute an SQL statement, it must first be compiled into a byte-code
+** program using one of these routines. Or, in other words, these routines
+** are constructors for the [prepared statement] object.
+**
+** The preferred routine to use is [sqlite3_prepare_v2()]. The
+** [sqlite3_prepare()] interface is legacy and should be avoided.
+** [sqlite3_prepare_v3()] has an extra "prepFlags" option that is used
+** for special purposes.
+**
+** The use of the UTF-8 interfaces is preferred, as SQLite currently
+** does all parsing using UTF-8. The UTF-16 interfaces are provided
+** as a convenience. The UTF-16 interfaces work by converting the
+** input text into UTF-8, then invoking the corresponding UTF-8 interface.
+**
+** The first argument, "db", is a [database connection] obtained from a
+** prior successful call to [sqlite3_open()], [sqlite3_open_v2()] or
+** [sqlite3_open16()]. The database connection must not have been closed.
+**
+** The second argument, "zSql", is the statement to be compiled, encoded
+** as either UTF-8 or UTF-16. The sqlite3_prepare(), sqlite3_prepare_v2(),
+** and sqlite3_prepare_v3()
+** interfaces use UTF-8, and sqlite3_prepare16(), sqlite3_prepare16_v2(),
+** and sqlite3_prepare16_v3() use UTF-16.
+**
+** ^If the nByte argument is negative, then zSql is read up to the
+** first zero terminator. ^If nByte is positive, then it is the maximum
+** number of bytes read from zSql. When nByte is positive, zSql is read
+** up to the first zero terminator or until the nByte bytes have been read,
+** whichever comes first. ^If nByte is zero, then no prepared
+** statement is generated.
+** If the caller knows that the supplied string is nul-terminated, then
+** there is a small performance advantage to passing an nByte parameter that
+** is the number of bytes in the input string including
+** the nul-terminator.
+** Note that nByte measure the length of the input in bytes, not
+** characters, even for the UTF-16 interfaces.
+**
+** ^If pzTail is not NULL then *pzTail is made to point to the first byte
+** past the end of the first SQL statement in zSql. These routines only
+** compile the first statement in zSql, so *pzTail is left pointing to
+** what remains uncompiled.
+**
+** ^*ppStmt is left pointing to a compiled [prepared statement] that can be
+** executed using [sqlite3_step()]. ^If there is an error, *ppStmt is set
+** to NULL. ^If the input text contains no SQL (if the input is an empty
+** string or a comment) then *ppStmt is set to NULL.
+** The calling procedure is responsible for deleting the compiled
+** SQL statement using [sqlite3_finalize()] after it has finished with it.
+** ppStmt may not be NULL.
+**
+** ^On success, the sqlite3_prepare() family of routines return [SQLITE_OK];
+** otherwise an [error code] is returned.
+**
+** The sqlite3_prepare_v2(), sqlite3_prepare_v3(), sqlite3_prepare16_v2(),
+** and sqlite3_prepare16_v3() interfaces are recommended for all new programs.
+** The older interfaces (sqlite3_prepare() and sqlite3_prepare16())
+** are retained for backwards compatibility, but their use is discouraged.
+** ^In the "vX" interfaces, the prepared statement
+** that is returned (the [sqlite3_stmt] object) contains a copy of the
+** original SQL text. This causes the [sqlite3_step()] interface to
+** behave differently in three ways:
+**
+**
+**
+** ^If the database schema changes, instead of returning [SQLITE_SCHEMA] as it
+** always used to do, [sqlite3_step()] will automatically recompile the SQL
+** statement and try to run it again. As many as [SQLITE_MAX_SCHEMA_RETRY]
+** retries will occur before sqlite3_step() gives up and returns an error.
+**
+**
+**
+** ^When an error occurs, [sqlite3_step()] will return one of the detailed
+** [error codes] or [extended error codes]. ^The legacy behavior was that
+** [sqlite3_step()] would only return a generic [SQLITE_ERROR] result code
+** and the application would have to make a second call to [sqlite3_reset()]
+** in order to find the underlying cause of the problem. With the "v2" prepare
+** interfaces, the underlying reason for the error is returned immediately.
+**
+**
+**
+** ^If the specific value bound to a [parameter | host parameter] in the
+** WHERE clause might influence the choice of query plan for a statement,
+** then the statement will be automatically recompiled, as if there had been
+** a schema change, on the first [sqlite3_step()] call following any change
+** to the [sqlite3_bind_text | bindings] of that [parameter].
+** ^The specific value of a WHERE-clause [parameter] might influence the
+** choice of query plan if the parameter is the left-hand side of a [LIKE]
+** or [GLOB] operator or if the parameter is compared to an indexed column
+** and the [SQLITE_ENABLE_STAT4] compile-time option is enabled.
+**
+**
+**
+** ^sqlite3_prepare_v3() differs from sqlite3_prepare_v2() only in having
+** the extra prepFlags parameter, which is a bit array consisting of zero or
+** more of the [SQLITE_PREPARE_PERSISTENT|SQLITE_PREPARE_*] flags. ^The
+** sqlite3_prepare_v2() interface works exactly the same as
+** sqlite3_prepare_v3() with a zero prepFlags parameter.
+*/
+SQLITE_API int sqlite3_prepare(
+ sqlite3 *db, /* Database handle */
+ const char *zSql, /* SQL statement, UTF-8 encoded */
+ int nByte, /* Maximum length of zSql in bytes. */
+ sqlite3_stmt **ppStmt, /* OUT: Statement handle */
+ const char **pzTail /* OUT: Pointer to unused portion of zSql */
+);
+SQLITE_API int sqlite3_prepare_v2(
+ sqlite3 *db, /* Database handle */
+ const char *zSql, /* SQL statement, UTF-8 encoded */
+ int nByte, /* Maximum length of zSql in bytes. */
+ sqlite3_stmt **ppStmt, /* OUT: Statement handle */
+ const char **pzTail /* OUT: Pointer to unused portion of zSql */
+);
+SQLITE_API int sqlite3_prepare_v3(
+ sqlite3 *db, /* Database handle */
+ const char *zSql, /* SQL statement, UTF-8 encoded */
+ int nByte, /* Maximum length of zSql in bytes. */
+ unsigned int prepFlags, /* Zero or more SQLITE_PREPARE_ flags */
+ sqlite3_stmt **ppStmt, /* OUT: Statement handle */
+ const char **pzTail /* OUT: Pointer to unused portion of zSql */
+);
+SQLITE_API int sqlite3_prepare16(
+ sqlite3 *db, /* Database handle */
+ const void *zSql, /* SQL statement, UTF-16 encoded */
+ int nByte, /* Maximum length of zSql in bytes. */
+ sqlite3_stmt **ppStmt, /* OUT: Statement handle */
+ const void **pzTail /* OUT: Pointer to unused portion of zSql */
+);
+SQLITE_API int sqlite3_prepare16_v2(
+ sqlite3 *db, /* Database handle */
+ const void *zSql, /* SQL statement, UTF-16 encoded */
+ int nByte, /* Maximum length of zSql in bytes. */
+ sqlite3_stmt **ppStmt, /* OUT: Statement handle */
+ const void **pzTail /* OUT: Pointer to unused portion of zSql */
+);
+SQLITE_API int sqlite3_prepare16_v3(
+ sqlite3 *db, /* Database handle */
+ const void *zSql, /* SQL statement, UTF-16 encoded */
+ int nByte, /* Maximum length of zSql in bytes. */
+ unsigned int prepFlags, /* Zero or more SQLITE_PREPARE_ flags */
+ sqlite3_stmt **ppStmt, /* OUT: Statement handle */
+ const void **pzTail /* OUT: Pointer to unused portion of zSql */
+);
+
+/*
+** CAPI3REF: Retrieving Statement SQL
+** METHOD: sqlite3_stmt
+**
+** ^The sqlite3_sql(P) interface returns a pointer to a copy of the UTF-8
+** SQL text used to create [prepared statement] P if P was
+** created by [sqlite3_prepare_v2()], [sqlite3_prepare_v3()],
+** [sqlite3_prepare16_v2()], or [sqlite3_prepare16_v3()].
+** ^The sqlite3_expanded_sql(P) interface returns a pointer to a UTF-8
+** string containing the SQL text of prepared statement P with
+** [bound parameters] expanded.
+** ^The sqlite3_normalized_sql(P) interface returns a pointer to a UTF-8
+** string containing the normalized SQL text of prepared statement P. The
+** semantics used to normalize a SQL statement are unspecified and subject
+** to change. At a minimum, literal values will be replaced with suitable
+** placeholders.
+**
+** ^(For example, if a prepared statement is created using the SQL
+** text "SELECT $abc,:xyz" and if parameter $abc is bound to integer 2345
+** and parameter :xyz is unbound, then sqlite3_sql() will return
+** the original string, "SELECT $abc,:xyz" but sqlite3_expanded_sql()
+** will return "SELECT 2345,NULL".)^
+**
+** ^The sqlite3_expanded_sql() interface returns NULL if insufficient memory
+** is available to hold the result, or if the result would exceed the
+** the maximum string length determined by the [SQLITE_LIMIT_LENGTH].
+**
+** ^The [SQLITE_TRACE_SIZE_LIMIT] compile-time option limits the size of
+** bound parameter expansions. ^The [SQLITE_OMIT_TRACE] compile-time
+** option causes sqlite3_expanded_sql() to always return NULL.
+**
+** ^The strings returned by sqlite3_sql(P) and sqlite3_normalized_sql(P)
+** are managed by SQLite and are automatically freed when the prepared
+** statement is finalized.
+** ^The string returned by sqlite3_expanded_sql(P), on the other hand,
+** is obtained from [sqlite3_malloc()] and must be freed by the application
+** by passing it to [sqlite3_free()].
+**
+** ^The sqlite3_normalized_sql() interface is only available if
+** the [SQLITE_ENABLE_NORMALIZE] compile-time option is defined.
+*/
+SQLITE_API const char *sqlite3_sql(sqlite3_stmt *pStmt);
+SQLITE_API char *sqlite3_expanded_sql(sqlite3_stmt *pStmt);
+#ifdef SQLITE_ENABLE_NORMALIZE
+SQLITE_API const char *sqlite3_normalized_sql(sqlite3_stmt *pStmt);
+#endif
+
+/*
+** CAPI3REF: Determine If An SQL Statement Writes The Database
+** METHOD: sqlite3_stmt
+**
+** ^The sqlite3_stmt_readonly(X) interface returns true (non-zero) if
+** and only if the [prepared statement] X makes no direct changes to
+** the content of the database file.
+**
+** Note that [application-defined SQL functions] or
+** [virtual tables] might change the database indirectly as a side effect.
+** ^(For example, if an application defines a function "eval()" that
+** calls [sqlite3_exec()], then the following SQL statement would
+** change the database file through side-effects:
+**
+**
+** SELECT eval('DELETE FROM t1') FROM t2;
+**
+**
+** But because the [SELECT] statement does not change the database file
+** directly, sqlite3_stmt_readonly() would still return true.)^
+**
+** ^Transaction control statements such as [BEGIN], [COMMIT], [ROLLBACK],
+** [SAVEPOINT], and [RELEASE] cause sqlite3_stmt_readonly() to return true,
+** since the statements themselves do not actually modify the database but
+** rather they control the timing of when other statements modify the
+** database. ^The [ATTACH] and [DETACH] statements also cause
+** sqlite3_stmt_readonly() to return true since, while those statements
+** change the configuration of a database connection, they do not make
+** changes to the content of the database files on disk.
+** ^The sqlite3_stmt_readonly() interface returns true for [BEGIN] since
+** [BEGIN] merely sets internal flags, but the [BEGIN|BEGIN IMMEDIATE] and
+** [BEGIN|BEGIN EXCLUSIVE] commands do touch the database and so
+** sqlite3_stmt_readonly() returns false for those commands.
+**
+** ^This routine returns false if there is any possibility that the
+** statement might change the database file. ^A false return does
+** not guarantee that the statement will change the database file.
+** ^For example, an UPDATE statement might have a WHERE clause that
+** makes it a no-op, but the sqlite3_stmt_readonly() result would still
+** be false. ^Similarly, a CREATE TABLE IF NOT EXISTS statement is a
+** read-only no-op if the table already exists, but
+** sqlite3_stmt_readonly() still returns false for such a statement.
+**
+** ^If prepared statement X is an [EXPLAIN] or [EXPLAIN QUERY PLAN]
+** statement, then sqlite3_stmt_readonly(X) returns the same value as
+** if the EXPLAIN or EXPLAIN QUERY PLAN prefix were omitted.
+*/
+SQLITE_API int sqlite3_stmt_readonly(sqlite3_stmt *pStmt);
+
+/*
+** CAPI3REF: Query The EXPLAIN Setting For A Prepared Statement
+** METHOD: sqlite3_stmt
+**
+** ^The sqlite3_stmt_isexplain(S) interface returns 1 if the
+** prepared statement S is an EXPLAIN statement, or 2 if the
+** statement S is an EXPLAIN QUERY PLAN.
+** ^The sqlite3_stmt_isexplain(S) interface returns 0 if S is
+** an ordinary statement or a NULL pointer.
+*/
+SQLITE_API int sqlite3_stmt_isexplain(sqlite3_stmt *pStmt);
+
+/*
+** CAPI3REF: Change The EXPLAIN Setting For A Prepared Statement
+** METHOD: sqlite3_stmt
+**
+** The sqlite3_stmt_explain(S,E) interface changes the EXPLAIN
+** setting for [prepared statement] S. If E is zero, then S becomes
+** a normal prepared statement. If E is 1, then S behaves as if
+** its SQL text began with "[EXPLAIN]". If E is 2, then S behaves as if
+** its SQL text began with "[EXPLAIN QUERY PLAN]".
+**
+** Calling sqlite3_stmt_explain(S,E) might cause S to be reprepared.
+** SQLite tries to avoid a reprepare, but a reprepare might be necessary
+** on the first transition into EXPLAIN or EXPLAIN QUERY PLAN mode.
+**
+** Because of the potential need to reprepare, a call to
+** sqlite3_stmt_explain(S,E) will fail with SQLITE_ERROR if S cannot be
+** reprepared because it was created using [sqlite3_prepare()] instead of
+** the newer [sqlite3_prepare_v2()] or [sqlite3_prepare_v3()] interfaces and
+** hence has no saved SQL text with which to reprepare.
+**
+** Changing the explain setting for a prepared statement does not change
+** the original SQL text for the statement. Hence, if the SQL text originally
+** began with EXPLAIN or EXPLAIN QUERY PLAN, but sqlite3_stmt_explain(S,0)
+** is called to convert the statement into an ordinary statement, the EXPLAIN
+** or EXPLAIN QUERY PLAN keywords will still appear in the sqlite3_sql(S)
+** output, even though the statement now acts like a normal SQL statement.
+**
+** This routine returns SQLITE_OK if the explain mode is successfully
+** changed, or an error code if the explain mode could not be changed.
+** The explain mode cannot be changed while a statement is active.
+** Hence, it is good practice to call [sqlite3_reset(S)]
+** immediately prior to calling sqlite3_stmt_explain(S,E).
+*/
+SQLITE_API int sqlite3_stmt_explain(sqlite3_stmt *pStmt, int eMode);
+
+/*
+** CAPI3REF: Determine If A Prepared Statement Has Been Reset
+** METHOD: sqlite3_stmt
+**
+** ^The sqlite3_stmt_busy(S) interface returns true (non-zero) if the
+** [prepared statement] S has been stepped at least once using
+** [sqlite3_step(S)] but has neither run to completion (returned
+** [SQLITE_DONE] from [sqlite3_step(S)]) nor
+** been reset using [sqlite3_reset(S)]. ^The sqlite3_stmt_busy(S)
+** interface returns false if S is a NULL pointer. If S is not a
+** NULL pointer and is not a pointer to a valid [prepared statement]
+** object, then the behavior is undefined and probably undesirable.
+**
+** This interface can be used in combination [sqlite3_next_stmt()]
+** to locate all prepared statements associated with a database
+** connection that are in need of being reset. This can be used,
+** for example, in diagnostic routines to search for prepared
+** statements that are holding a transaction open.
+*/
+SQLITE_API int sqlite3_stmt_busy(sqlite3_stmt*);
+
+/*
+** CAPI3REF: Dynamically Typed Value Object
+** KEYWORDS: {protected sqlite3_value} {unprotected sqlite3_value}
+**
+** SQLite uses the sqlite3_value object to represent all values
+** that can be stored in a database table. SQLite uses dynamic typing
+** for the values it stores. ^Values stored in sqlite3_value objects
+** can be integers, floating point values, strings, BLOBs, or NULL.
+**
+** An sqlite3_value object may be either "protected" or "unprotected".
+** Some interfaces require a protected sqlite3_value. Other interfaces
+** will accept either a protected or an unprotected sqlite3_value.
+** Every interface that accepts sqlite3_value arguments specifies
+** whether or not it requires a protected sqlite3_value. The
+** [sqlite3_value_dup()] interface can be used to construct a new
+** protected sqlite3_value from an unprotected sqlite3_value.
+**
+** The terms "protected" and "unprotected" refer to whether or not
+** a mutex is held. An internal mutex is held for a protected
+** sqlite3_value object but no mutex is held for an unprotected
+** sqlite3_value object. If SQLite is compiled to be single-threaded
+** (with [SQLITE_THREADSAFE=0] and with [sqlite3_threadsafe()] returning 0)
+** or if SQLite is run in one of reduced mutex modes
+** [SQLITE_CONFIG_SINGLETHREAD] or [SQLITE_CONFIG_MULTITHREAD]
+** then there is no distinction between protected and unprotected
+** sqlite3_value objects and they can be used interchangeably. However,
+** for maximum code portability it is recommended that applications
+** still make the distinction between protected and unprotected
+** sqlite3_value objects even when not strictly required.
+**
+** ^The sqlite3_value objects that are passed as parameters into the
+** implementation of [application-defined SQL functions] are protected.
+** ^The sqlite3_value objects returned by [sqlite3_vtab_rhs_value()]
+** are protected.
+** ^The sqlite3_value object returned by
+** [sqlite3_column_value()] is unprotected.
+** Unprotected sqlite3_value objects may only be used as arguments
+** to [sqlite3_result_value()], [sqlite3_bind_value()], and
+** [sqlite3_value_dup()].
+** The [sqlite3_value_blob | sqlite3_value_type()] family of
+** interfaces require protected sqlite3_value objects.
+*/
+typedef struct sqlite3_value sqlite3_value;
+
+/*
+** CAPI3REF: SQL Function Context Object
+**
+** The context in which an SQL function executes is stored in an
+** sqlite3_context object. ^A pointer to an sqlite3_context object
+** is always first parameter to [application-defined SQL functions].
+** The application-defined SQL function implementation will pass this
+** pointer through into calls to [sqlite3_result_int | sqlite3_result()],
+** [sqlite3_aggregate_context()], [sqlite3_user_data()],
+** [sqlite3_context_db_handle()], [sqlite3_get_auxdata()],
+** and/or [sqlite3_set_auxdata()].
+*/
+typedef struct sqlite3_context sqlite3_context;
+
+/*
+** CAPI3REF: Binding Values To Prepared Statements
+** KEYWORDS: {host parameter} {host parameters} {host parameter name}
+** KEYWORDS: {SQL parameter} {SQL parameters} {parameter binding}
+** METHOD: sqlite3_stmt
+**
+** ^(In the SQL statement text input to [sqlite3_prepare_v2()] and its variants,
+** literals may be replaced by a [parameter] that matches one of the following
+** templates:
+**
+**
+** ?
+** ?NNN
+** :VVV
+** @VVV
+** $VVV
+**
+**
+** In the templates above, NNN represents an integer literal,
+** and VVV represents an alphanumeric identifier.)^ ^The values of these
+** parameters (also called "host parameter names" or "SQL parameters")
+** can be set using the sqlite3_bind_*() routines defined here.
+**
+** ^The first argument to the sqlite3_bind_*() routines is always
+** a pointer to the [sqlite3_stmt] object returned from
+** [sqlite3_prepare_v2()] or its variants.
+**
+** ^The second argument is the index of the SQL parameter to be set.
+** ^The leftmost SQL parameter has an index of 1. ^When the same named
+** SQL parameter is used more than once, second and subsequent
+** occurrences have the same index as the first occurrence.
+** ^The index for named parameters can be looked up using the
+** [sqlite3_bind_parameter_index()] API if desired. ^The index
+** for "?NNN" parameters is the value of NNN.
+** ^The NNN value must be between 1 and the [sqlite3_limit()]
+** parameter [SQLITE_LIMIT_VARIABLE_NUMBER] (default value: 32766).
+**
+** ^The third argument is the value to bind to the parameter.
+** ^If the third parameter to sqlite3_bind_text() or sqlite3_bind_text16()
+** or sqlite3_bind_blob() is a NULL pointer then the fourth parameter
+** is ignored and the end result is the same as sqlite3_bind_null().
+** ^If the third parameter to sqlite3_bind_text() is not NULL, then
+** it should be a pointer to well-formed UTF8 text.
+** ^If the third parameter to sqlite3_bind_text16() is not NULL, then
+** it should be a pointer to well-formed UTF16 text.
+** ^If the third parameter to sqlite3_bind_text64() is not NULL, then
+** it should be a pointer to a well-formed unicode string that is
+** either UTF8 if the sixth parameter is SQLITE_UTF8, or UTF16
+** otherwise.
+**
+** [[byte-order determination rules]] ^The byte-order of
+** UTF16 input text is determined by the byte-order mark (BOM, U+FEFF)
+** found in the first character, which is removed, or in the absence of a BOM
+** the byte order is the native byte order of the host
+** machine for sqlite3_bind_text16() or the byte order specified in
+** the 6th parameter for sqlite3_bind_text64().)^
+** ^If UTF16 input text contains invalid unicode
+** characters, then SQLite might change those invalid characters
+** into the unicode replacement character: U+FFFD.
+**
+** ^(In those routines that have a fourth argument, its value is the
+** number of bytes in the parameter. To be clear: the value is the
+** number of bytes in the value, not the number of characters.)^
+** ^If the fourth parameter to sqlite3_bind_text() or sqlite3_bind_text16()
+** is negative, then the length of the string is
+** the number of bytes up to the first zero terminator.
+** If the fourth parameter to sqlite3_bind_blob() is negative, then
+** the behavior is undefined.
+** If a non-negative fourth parameter is provided to sqlite3_bind_text()
+** or sqlite3_bind_text16() or sqlite3_bind_text64() then
+** that parameter must be the byte offset
+** where the NUL terminator would occur assuming the string were NUL
+** terminated. If any NUL characters occur at byte offsets less than
+** the value of the fourth parameter then the resulting string value will
+** contain embedded NULs. The result of expressions involving strings
+** with embedded NULs is undefined.
+**
+** ^The fifth argument to the BLOB and string binding interfaces controls
+** or indicates the lifetime of the object referenced by the third parameter.
+** These three options exist:
+** ^ (1) A destructor to dispose of the BLOB or string after SQLite has finished
+** with it may be passed. ^It is called to dispose of the BLOB or string even
+** if the call to the bind API fails, except the destructor is not called if
+** the third parameter is a NULL pointer or the fourth parameter is negative.
+** ^ (2) The special constant, [SQLITE_STATIC], may be passed to indicate that
+** the application remains responsible for disposing of the object. ^In this
+** case, the object and the provided pointer to it must remain valid until
+** either the prepared statement is finalized or the same SQL parameter is
+** bound to something else, whichever occurs sooner.
+** ^ (3) The constant, [SQLITE_TRANSIENT], may be passed to indicate that the
+** object is to be copied prior to the return from sqlite3_bind_*(). ^The
+** object and pointer to it must remain valid until then. ^SQLite will then
+** manage the lifetime of its private copy.
+**
+** ^The sixth argument to sqlite3_bind_text64() must be one of
+** [SQLITE_UTF8], [SQLITE_UTF16], [SQLITE_UTF16BE], or [SQLITE_UTF16LE]
+** to specify the encoding of the text in the third parameter. If
+** the sixth argument to sqlite3_bind_text64() is not one of the
+** allowed values shown above, or if the text encoding is different
+** from the encoding specified by the sixth parameter, then the behavior
+** is undefined.
+**
+** ^The sqlite3_bind_zeroblob() routine binds a BLOB of length N that
+** is filled with zeroes. ^A zeroblob uses a fixed amount of memory
+** (just an integer to hold its size) while it is being processed.
+** Zeroblobs are intended to serve as placeholders for BLOBs whose
+** content is later written using
+** [sqlite3_blob_open | incremental BLOB I/O] routines.
+** ^A negative value for the zeroblob results in a zero-length BLOB.
+**
+** ^The sqlite3_bind_pointer(S,I,P,T,D) routine causes the I-th parameter in
+** [prepared statement] S to have an SQL value of NULL, but to also be
+** associated with the pointer P of type T. ^D is either a NULL pointer or
+** a pointer to a destructor function for P. ^SQLite will invoke the
+** destructor D with a single argument of P when it is finished using
+** P. The T parameter should be a static string, preferably a string
+** literal. The sqlite3_bind_pointer() routine is part of the
+** [pointer passing interface] added for SQLite 3.20.0.
+**
+** ^If any of the sqlite3_bind_*() routines are called with a NULL pointer
+** for the [prepared statement] or with a prepared statement for which
+** [sqlite3_step()] has been called more recently than [sqlite3_reset()],
+** then the call will return [SQLITE_MISUSE]. If any sqlite3_bind_()
+** routine is passed a [prepared statement] that has been finalized, the
+** result is undefined and probably harmful.
+**
+** ^Bindings are not cleared by the [sqlite3_reset()] routine.
+** ^Unbound parameters are interpreted as NULL.
+**
+** ^The sqlite3_bind_* routines return [SQLITE_OK] on success or an
+** [error code] if anything goes wrong.
+** ^[SQLITE_TOOBIG] might be returned if the size of a string or BLOB
+** exceeds limits imposed by [sqlite3_limit]([SQLITE_LIMIT_LENGTH]) or
+** [SQLITE_MAX_LENGTH].
+** ^[SQLITE_RANGE] is returned if the parameter
+** index is out of range. ^[SQLITE_NOMEM] is returned if malloc() fails.
+**
+** See also: [sqlite3_bind_parameter_count()],
+** [sqlite3_bind_parameter_name()], and [sqlite3_bind_parameter_index()].
+*/
+SQLITE_API int sqlite3_bind_blob(sqlite3_stmt*, int, const void*, int n, void(*)(void*));
+SQLITE_API int sqlite3_bind_blob64(sqlite3_stmt*, int, const void*, sqlite3_uint64,
+ void(*)(void*));
+SQLITE_API int sqlite3_bind_double(sqlite3_stmt*, int, double);
+SQLITE_API int sqlite3_bind_int(sqlite3_stmt*, int, int);
+SQLITE_API int sqlite3_bind_int64(sqlite3_stmt*, int, sqlite3_int64);
+SQLITE_API int sqlite3_bind_null(sqlite3_stmt*, int);
+SQLITE_API int sqlite3_bind_text(sqlite3_stmt*,int,const char*,int,void(*)(void*));
+SQLITE_API int sqlite3_bind_text16(sqlite3_stmt*, int, const void*, int, void(*)(void*));
+SQLITE_API int sqlite3_bind_text64(sqlite3_stmt*, int, const char*, sqlite3_uint64,
+ void(*)(void*), unsigned char encoding);
+SQLITE_API int sqlite3_bind_value(sqlite3_stmt*, int, const sqlite3_value*);
+SQLITE_API int sqlite3_bind_pointer(sqlite3_stmt*, int, void*, const char*,void(*)(void*));
+SQLITE_API int sqlite3_bind_zeroblob(sqlite3_stmt*, int, int n);
+SQLITE_API int sqlite3_bind_zeroblob64(sqlite3_stmt*, int, sqlite3_uint64);
+
+/*
+** CAPI3REF: Number Of SQL Parameters
+** METHOD: sqlite3_stmt
+**
+** ^This routine can be used to find the number of [SQL parameters]
+** in a [prepared statement]. SQL parameters are tokens of the
+** form "?", "?NNN", ":AAA", "$AAA", or "@AAA" that serve as
+** placeholders for values that are [sqlite3_bind_blob | bound]
+** to the parameters at a later time.
+**
+** ^(This routine actually returns the index of the largest (rightmost)
+** parameter. For all forms except ?NNN, this will correspond to the
+** number of unique parameters. If parameters of the ?NNN form are used,
+** there may be gaps in the list.)^
+**
+** See also: [sqlite3_bind_blob|sqlite3_bind()],
+** [sqlite3_bind_parameter_name()], and
+** [sqlite3_bind_parameter_index()].
+*/
+SQLITE_API int sqlite3_bind_parameter_count(sqlite3_stmt*);
+
+/*
+** CAPI3REF: Name Of A Host Parameter
+** METHOD: sqlite3_stmt
+**
+** ^The sqlite3_bind_parameter_name(P,N) interface returns
+** the name of the N-th [SQL parameter] in the [prepared statement] P.
+** ^(SQL parameters of the form "?NNN" or ":AAA" or "@AAA" or "$AAA"
+** have a name which is the string "?NNN" or ":AAA" or "@AAA" or "$AAA"
+** respectively.
+** In other words, the initial ":" or "$" or "@" or "?"
+** is included as part of the name.)^
+** ^Parameters of the form "?" without a following integer have no name
+** and are referred to as "nameless" or "anonymous parameters".
+**
+** ^The first host parameter has an index of 1, not 0.
+**
+** ^If the value N is out of range or if the N-th parameter is
+** nameless, then NULL is returned. ^The returned string is
+** always in UTF-8 encoding even if the named parameter was
+** originally specified as UTF-16 in [sqlite3_prepare16()],
+** [sqlite3_prepare16_v2()], or [sqlite3_prepare16_v3()].
+**
+** See also: [sqlite3_bind_blob|sqlite3_bind()],
+** [sqlite3_bind_parameter_count()], and
+** [sqlite3_bind_parameter_index()].
+*/
+SQLITE_API const char *sqlite3_bind_parameter_name(sqlite3_stmt*, int);
+
+/*
+** CAPI3REF: Index Of A Parameter With A Given Name
+** METHOD: sqlite3_stmt
+**
+** ^Return the index of an SQL parameter given its name. ^The
+** index value returned is suitable for use as the second
+** parameter to [sqlite3_bind_blob|sqlite3_bind()]. ^A zero
+** is returned if no matching parameter is found. ^The parameter
+** name must be given in UTF-8 even if the original statement
+** was prepared from UTF-16 text using [sqlite3_prepare16_v2()] or
+** [sqlite3_prepare16_v3()].
+**
+** See also: [sqlite3_bind_blob|sqlite3_bind()],
+** [sqlite3_bind_parameter_count()], and
+** [sqlite3_bind_parameter_name()].
+*/
+SQLITE_API int sqlite3_bind_parameter_index(sqlite3_stmt*, const char *zName);
+
+/*
+** CAPI3REF: Reset All Bindings On A Prepared Statement
+** METHOD: sqlite3_stmt
+**
+** ^Contrary to the intuition of many, [sqlite3_reset()] does not reset
+** the [sqlite3_bind_blob | bindings] on a [prepared statement].
+** ^Use this routine to reset all host parameters to NULL.
+*/
+SQLITE_API int sqlite3_clear_bindings(sqlite3_stmt*);
+
+/*
+** CAPI3REF: Number Of Columns In A Result Set
+** METHOD: sqlite3_stmt
+**
+** ^Return the number of columns in the result set returned by the
+** [prepared statement]. ^If this routine returns 0, that means the
+** [prepared statement] returns no data (for example an [UPDATE]).
+** ^However, just because this routine returns a positive number does not
+** mean that one or more rows of data will be returned. ^A SELECT statement
+** will always have a positive sqlite3_column_count() but depending on the
+** WHERE clause constraints and the table content, it might return no rows.
+**
+** See also: [sqlite3_data_count()]
+*/
+SQLITE_API int sqlite3_column_count(sqlite3_stmt *pStmt);
+
+/*
+** CAPI3REF: Column Names In A Result Set
+** METHOD: sqlite3_stmt
+**
+** ^These routines return the name assigned to a particular column
+** in the result set of a [SELECT] statement. ^The sqlite3_column_name()
+** interface returns a pointer to a zero-terminated UTF-8 string
+** and sqlite3_column_name16() returns a pointer to a zero-terminated
+** UTF-16 string. ^The first parameter is the [prepared statement]
+** that implements the [SELECT] statement. ^The second parameter is the
+** column number. ^The leftmost column is number 0.
+**
+** ^The returned string pointer is valid until either the [prepared statement]
+** is destroyed by [sqlite3_finalize()] or until the statement is automatically
+** reprepared by the first call to [sqlite3_step()] for a particular run
+** or until the next call to
+** sqlite3_column_name() or sqlite3_column_name16() on the same column.
+**
+** ^If sqlite3_malloc() fails during the processing of either routine
+** (for example during a conversion from UTF-8 to UTF-16) then a
+** NULL pointer is returned.
+**
+** ^The name of a result column is the value of the "AS" clause for
+** that column, if there is an AS clause. If there is no AS clause
+** then the name of the column is unspecified and may change from
+** one release of SQLite to the next.
+*/
+SQLITE_API const char *sqlite3_column_name(sqlite3_stmt*, int N);
+SQLITE_API const void *sqlite3_column_name16(sqlite3_stmt*, int N);
+
+/*
+** CAPI3REF: Source Of Data In A Query Result
+** METHOD: sqlite3_stmt
+**
+** ^These routines provide a means to determine the database, table, and
+** table column that is the origin of a particular result column in a
+** [SELECT] statement.
+** ^The name of the database or table or column can be returned as
+** either a UTF-8 or UTF-16 string. ^The _database_ routines return
+** the database name, the _table_ routines return the table name, and
+** the origin_ routines return the column name.
+** ^The returned string is valid until the [prepared statement] is destroyed
+** using [sqlite3_finalize()] or until the statement is automatically
+** reprepared by the first call to [sqlite3_step()] for a particular run
+** or until the same information is requested
+** again in a different encoding.
+**
+** ^The names returned are the original un-aliased names of the
+** database, table, and column.
+**
+** ^The first argument to these interfaces is a [prepared statement].
+** ^These functions return information about the Nth result column returned by
+** the statement, where N is the second function argument.
+** ^The left-most column is column 0 for these routines.
+**
+** ^If the Nth column returned by the statement is an expression or
+** subquery and is not a column value, then all of these functions return
+** NULL. ^These routines might also return NULL if a memory allocation error
+** occurs. ^Otherwise, they return the name of the attached database, table,
+** or column that query result column was extracted from.
+**
+** ^As with all other SQLite APIs, those whose names end with "16" return
+** UTF-16 encoded strings and the other functions return UTF-8.
+**
+** ^These APIs are only available if the library was compiled with the
+** [SQLITE_ENABLE_COLUMN_METADATA] C-preprocessor symbol.
+**
+** If two or more threads call one or more
+** [sqlite3_column_database_name | column metadata interfaces]
+** for the same [prepared statement] and result column
+** at the same time then the results are undefined.
+*/
+SQLITE_API const char *sqlite3_column_database_name(sqlite3_stmt*,int);
+SQLITE_API const void *sqlite3_column_database_name16(sqlite3_stmt*,int);
+SQLITE_API const char *sqlite3_column_table_name(sqlite3_stmt*,int);
+SQLITE_API const void *sqlite3_column_table_name16(sqlite3_stmt*,int);
+SQLITE_API const char *sqlite3_column_origin_name(sqlite3_stmt*,int);
+SQLITE_API const void *sqlite3_column_origin_name16(sqlite3_stmt*,int);
+
+/*
+** CAPI3REF: Declared Datatype Of A Query Result
+** METHOD: sqlite3_stmt
+**
+** ^(The first parameter is a [prepared statement].
+** If this statement is a [SELECT] statement and the Nth column of the
+** returned result set of that [SELECT] is a table column (not an
+** expression or subquery) then the declared type of the table
+** column is returned.)^ ^If the Nth column of the result set is an
+** expression or subquery, then a NULL pointer is returned.
+** ^The returned string is always UTF-8 encoded.
+**
+** ^(For example, given the database schema:
+**
+** CREATE TABLE t1(c1 VARIANT);
+**
+** and the following statement to be compiled:
+**
+** SELECT c1 + 1, c1 FROM t1;
+**
+** this routine would return the string "VARIANT" for the second result
+** column (i==1), and a NULL pointer for the first result column (i==0).)^
+**
+** ^SQLite uses dynamic run-time typing. ^So just because a column
+** is declared to contain a particular type does not mean that the
+** data stored in that column is of the declared type. SQLite is
+** strongly typed, but the typing is dynamic not static. ^Type
+** is associated with individual values, not with the containers
+** used to hold those values.
+*/
+SQLITE_API const char *sqlite3_column_decltype(sqlite3_stmt*,int);
+SQLITE_API const void *sqlite3_column_decltype16(sqlite3_stmt*,int);
+
+/*
+** CAPI3REF: Evaluate An SQL Statement
+** METHOD: sqlite3_stmt
+**
+** After a [prepared statement] has been prepared using any of
+** [sqlite3_prepare_v2()], [sqlite3_prepare_v3()], [sqlite3_prepare16_v2()],
+** or [sqlite3_prepare16_v3()] or one of the legacy
+** interfaces [sqlite3_prepare()] or [sqlite3_prepare16()], this function
+** must be called one or more times to evaluate the statement.
+**
+** The details of the behavior of the sqlite3_step() interface depend
+** on whether the statement was prepared using the newer "vX" interfaces
+** [sqlite3_prepare_v3()], [sqlite3_prepare_v2()], [sqlite3_prepare16_v3()],
+** [sqlite3_prepare16_v2()] or the older legacy
+** interfaces [sqlite3_prepare()] and [sqlite3_prepare16()]. The use of the
+** new "vX" interface is recommended for new applications but the legacy
+** interface will continue to be supported.
+**
+** ^In the legacy interface, the return value will be either [SQLITE_BUSY],
+** [SQLITE_DONE], [SQLITE_ROW], [SQLITE_ERROR], or [SQLITE_MISUSE].
+** ^With the "v2" interface, any of the other [result codes] or
+** [extended result codes] might be returned as well.
+**
+** ^[SQLITE_BUSY] means that the database engine was unable to acquire the
+** database locks it needs to do its job. ^If the statement is a [COMMIT]
+** or occurs outside of an explicit transaction, then you can retry the
+** statement. If the statement is not a [COMMIT] and occurs within an
+** explicit transaction then you should rollback the transaction before
+** continuing.
+**
+** ^[SQLITE_DONE] means that the statement has finished executing
+** successfully. sqlite3_step() should not be called again on this virtual
+** machine without first calling [sqlite3_reset()] to reset the virtual
+** machine back to its initial state.
+**
+** ^If the SQL statement being executed returns any data, then [SQLITE_ROW]
+** is returned each time a new row of data is ready for processing by the
+** caller. The values may be accessed using the [column access functions].
+** sqlite3_step() is called again to retrieve the next row of data.
+**
+** ^[SQLITE_ERROR] means that a run-time error (such as a constraint
+** violation) has occurred. sqlite3_step() should not be called again on
+** the VM. More information may be found by calling [sqlite3_errmsg()].
+** ^With the legacy interface, a more specific error code (for example,
+** [SQLITE_INTERRUPT], [SQLITE_SCHEMA], [SQLITE_CORRUPT], and so forth)
+** can be obtained by calling [sqlite3_reset()] on the
+** [prepared statement]. ^In the "v2" interface,
+** the more specific error code is returned directly by sqlite3_step().
+**
+** [SQLITE_MISUSE] means that the this routine was called inappropriately.
+** Perhaps it was called on a [prepared statement] that has
+** already been [sqlite3_finalize | finalized] or on one that had
+** previously returned [SQLITE_ERROR] or [SQLITE_DONE]. Or it could
+** be the case that the same database connection is being used by two or
+** more threads at the same moment in time.
+**
+** For all versions of SQLite up to and including 3.6.23.1, a call to
+** [sqlite3_reset()] was required after sqlite3_step() returned anything
+** other than [SQLITE_ROW] before any subsequent invocation of
+** sqlite3_step(). Failure to reset the prepared statement using
+** [sqlite3_reset()] would result in an [SQLITE_MISUSE] return from
+** sqlite3_step(). But after [version 3.6.23.1] ([dateof:3.6.23.1]),
+** sqlite3_step() began
+** calling [sqlite3_reset()] automatically in this circumstance rather
+** than returning [SQLITE_MISUSE]. This is not considered a compatibility
+** break because any application that ever receives an SQLITE_MISUSE error
+** is broken by definition. The [SQLITE_OMIT_AUTORESET] compile-time option
+** can be used to restore the legacy behavior.
+**
+** Goofy Interface Alert: In the legacy interface, the sqlite3_step()
+** API always returns a generic error code, [SQLITE_ERROR], following any
+** error other than [SQLITE_BUSY] and [SQLITE_MISUSE]. You must call
+** [sqlite3_reset()] or [sqlite3_finalize()] in order to find one of the
+** specific [error codes] that better describes the error.
+** We admit that this is a goofy design. The problem has been fixed
+** with the "v2" interface. If you prepare all of your SQL statements
+** using [sqlite3_prepare_v3()] or [sqlite3_prepare_v2()]
+** or [sqlite3_prepare16_v2()] or [sqlite3_prepare16_v3()] instead
+** of the legacy [sqlite3_prepare()] and [sqlite3_prepare16()] interfaces,
+** then the more specific [error codes] are returned directly
+** by sqlite3_step(). The use of the "vX" interfaces is recommended.
+*/
+SQLITE_API int sqlite3_step(sqlite3_stmt*);
+
+/*
+** CAPI3REF: Number of columns in a result set
+** METHOD: sqlite3_stmt
+**
+** ^The sqlite3_data_count(P) interface returns the number of columns in the
+** current row of the result set of [prepared statement] P.
+** ^If prepared statement P does not have results ready to return
+** (via calls to the [sqlite3_column_int | sqlite3_column()] family of
+** interfaces) then sqlite3_data_count(P) returns 0.
+** ^The sqlite3_data_count(P) routine also returns 0 if P is a NULL pointer.
+** ^The sqlite3_data_count(P) routine returns 0 if the previous call to
+** [sqlite3_step](P) returned [SQLITE_DONE]. ^The sqlite3_data_count(P)
+** will return non-zero if previous call to [sqlite3_step](P) returned
+** [SQLITE_ROW], except in the case of the [PRAGMA incremental_vacuum]
+** where it always returns zero since each step of that multi-step
+** pragma returns 0 columns of data.
+**
+** See also: [sqlite3_column_count()]
+*/
+SQLITE_API int sqlite3_data_count(sqlite3_stmt *pStmt);
+
+/*
+** CAPI3REF: Fundamental Datatypes
+** KEYWORDS: SQLITE_TEXT
+**
+** ^(Every value in SQLite has one of five fundamental datatypes:
+**
+**
+** 64-bit signed integer
+** 64-bit IEEE floating point number
+** string
+** BLOB
+** NULL
+** )^
+**
+** These constants are codes for each of those types.
+**
+** Note that the SQLITE_TEXT constant was also used in SQLite version 2
+** for a completely different meaning. Software that links against both
+** SQLite version 2 and SQLite version 3 should use SQLITE3_TEXT, not
+** SQLITE_TEXT.
+*/
+#define SQLITE_INTEGER 1
+#define SQLITE_FLOAT 2
+#define SQLITE_BLOB 4
+#define SQLITE_NULL 5
+#ifdef SQLITE_TEXT
+# undef SQLITE_TEXT
+#else
+# define SQLITE_TEXT 3
+#endif
+#define SQLITE3_TEXT 3
+
+/*
+** CAPI3REF: Result Values From A Query
+** KEYWORDS: {column access functions}
+** METHOD: sqlite3_stmt
+**
+** Summary:
+**
+** sqlite3_column_blob → BLOB result
+** sqlite3_column_double → REAL result
+** sqlite3_column_int → 32-bit INTEGER result
+** sqlite3_column_int64 → 64-bit INTEGER result
+** sqlite3_column_text → UTF-8 TEXT result
+** sqlite3_column_text16 → UTF-16 TEXT result
+** sqlite3_column_value → The result as an
+** [sqlite3_value|unprotected sqlite3_value] object.
+**
+** sqlite3_column_bytes → Size of a BLOB
+** or a UTF-8 TEXT result in bytes
+** sqlite3_column_bytes16
+** → Size of UTF-16
+** TEXT in bytes
+** sqlite3_column_type → Default
+** datatype of the result
+**
+**
+** Details:
+**
+** ^These routines return information about a single column of the current
+** result row of a query. ^In every case the first argument is a pointer
+** to the [prepared statement] that is being evaluated (the [sqlite3_stmt*]
+** that was returned from [sqlite3_prepare_v2()] or one of its variants)
+** and the second argument is the index of the column for which information
+** should be returned. ^The leftmost column of the result set has the index 0.
+** ^The number of columns in the result can be determined using
+** [sqlite3_column_count()].
+**
+** If the SQL statement does not currently point to a valid row, or if the
+** column index is out of range, the result is undefined.
+** These routines may only be called when the most recent call to
+** [sqlite3_step()] has returned [SQLITE_ROW] and neither
+** [sqlite3_reset()] nor [sqlite3_finalize()] have been called subsequently.
+** If any of these routines are called after [sqlite3_reset()] or
+** [sqlite3_finalize()] or after [sqlite3_step()] has returned
+** something other than [SQLITE_ROW], the results are undefined.
+** If [sqlite3_step()] or [sqlite3_reset()] or [sqlite3_finalize()]
+** are called from a different thread while any of these routines
+** are pending, then the results are undefined.
+**
+** The first six interfaces (_blob, _double, _int, _int64, _text, and _text16)
+** each return the value of a result column in a specific data format. If
+** the result column is not initially in the requested format (for example,
+** if the query returns an integer but the sqlite3_column_text() interface
+** is used to extract the value) then an automatic type conversion is performed.
+**
+** ^The sqlite3_column_type() routine returns the
+** [SQLITE_INTEGER | datatype code] for the initial data type
+** of the result column. ^The returned value is one of [SQLITE_INTEGER],
+** [SQLITE_FLOAT], [SQLITE_TEXT], [SQLITE_BLOB], or [SQLITE_NULL].
+** The return value of sqlite3_column_type() can be used to decide which
+** of the first six interface should be used to extract the column value.
+** The value returned by sqlite3_column_type() is only meaningful if no
+** automatic type conversions have occurred for the value in question.
+** After a type conversion, the result of calling sqlite3_column_type()
+** is undefined, though harmless. Future
+** versions of SQLite may change the behavior of sqlite3_column_type()
+** following a type conversion.
+**
+** If the result is a BLOB or a TEXT string, then the sqlite3_column_bytes()
+** or sqlite3_column_bytes16() interfaces can be used to determine the size
+** of that BLOB or string.
+**
+** ^If the result is a BLOB or UTF-8 string then the sqlite3_column_bytes()
+** routine returns the number of bytes in that BLOB or string.
+** ^If the result is a UTF-16 string, then sqlite3_column_bytes() converts
+** the string to UTF-8 and then returns the number of bytes.
+** ^If the result is a numeric value then sqlite3_column_bytes() uses
+** [sqlite3_snprintf()] to convert that value to a UTF-8 string and returns
+** the number of bytes in that string.
+** ^If the result is NULL, then sqlite3_column_bytes() returns zero.
+**
+** ^If the result is a BLOB or UTF-16 string then the sqlite3_column_bytes16()
+** routine returns the number of bytes in that BLOB or string.
+** ^If the result is a UTF-8 string, then sqlite3_column_bytes16() converts
+** the string to UTF-16 and then returns the number of bytes.
+** ^If the result is a numeric value then sqlite3_column_bytes16() uses
+** [sqlite3_snprintf()] to convert that value to a UTF-16 string and returns
+** the number of bytes in that string.
+** ^If the result is NULL, then sqlite3_column_bytes16() returns zero.
+**
+** ^The values returned by [sqlite3_column_bytes()] and
+** [sqlite3_column_bytes16()] do not include the zero terminators at the end
+** of the string. ^For clarity: the values returned by
+** [sqlite3_column_bytes()] and [sqlite3_column_bytes16()] are the number of
+** bytes in the string, not the number of characters.
+**
+** ^Strings returned by sqlite3_column_text() and sqlite3_column_text16(),
+** even empty strings, are always zero-terminated. ^The return
+** value from sqlite3_column_blob() for a zero-length BLOB is a NULL pointer.
+**
+** ^Strings returned by sqlite3_column_text16() always have the endianness
+** which is native to the platform, regardless of the text encoding set
+** for the database.
+**
+** Warning: ^The object returned by [sqlite3_column_value()] is an
+** [unprotected sqlite3_value] object. In a multithreaded environment,
+** an unprotected sqlite3_value object may only be used safely with
+** [sqlite3_bind_value()] and [sqlite3_result_value()].
+** If the [unprotected sqlite3_value] object returned by
+** [sqlite3_column_value()] is used in any other way, including calls
+** to routines like [sqlite3_value_int()], [sqlite3_value_text()],
+** or [sqlite3_value_bytes()], the behavior is not threadsafe.
+** Hence, the sqlite3_column_value() interface
+** is normally only useful within the implementation of
+** [application-defined SQL functions] or [virtual tables], not within
+** top-level application code.
+**
+** These routines may attempt to convert the datatype of the result.
+** ^For example, if the internal representation is FLOAT and a text result
+** is requested, [sqlite3_snprintf()] is used internally to perform the
+** conversion automatically. ^(The following table details the conversions
+** that are applied:
+**
+**
+**
+** Internal Type Requested Type Conversion
+**
+** NULL INTEGER Result is 0
+** NULL FLOAT Result is 0.0
+** NULL TEXT Result is a NULL pointer
+** NULL BLOB Result is a NULL pointer
+** INTEGER FLOAT Convert from integer to float
+** INTEGER TEXT ASCII rendering of the integer
+** INTEGER BLOB Same as INTEGER->TEXT
+** FLOAT INTEGER [CAST] to INTEGER
+** FLOAT TEXT ASCII rendering of the float
+** FLOAT BLOB [CAST] to BLOB
+** TEXT INTEGER [CAST] to INTEGER
+** TEXT FLOAT [CAST] to REAL
+** TEXT BLOB No change
+** BLOB INTEGER [CAST] to INTEGER
+** BLOB FLOAT [CAST] to REAL
+** BLOB TEXT [CAST] to TEXT, ensure zero terminator
+**
+** )^
+**
+** Note that when type conversions occur, pointers returned by prior
+** calls to sqlite3_column_blob(), sqlite3_column_text(), and/or
+** sqlite3_column_text16() may be invalidated.
+** Type conversions and pointer invalidations might occur
+** in the following cases:
+**
+**
+** The initial content is a BLOB and sqlite3_column_text() or
+** sqlite3_column_text16() is called. A zero-terminator might
+** need to be added to the string.
+** The initial content is UTF-8 text and sqlite3_column_bytes16() or
+** sqlite3_column_text16() is called. The content must be converted
+** to UTF-16.
+** The initial content is UTF-16 text and sqlite3_column_bytes() or
+** sqlite3_column_text() is called. The content must be converted
+** to UTF-8.
+**
+**
+** ^Conversions between UTF-16be and UTF-16le are always done in place and do
+** not invalidate a prior pointer, though of course the content of the buffer
+** that the prior pointer references will have been modified. Other kinds
+** of conversion are done in place when it is possible, but sometimes they
+** are not possible and in those cases prior pointers are invalidated.
+**
+** The safest policy is to invoke these routines
+** in one of the following ways:
+**
+**
+** sqlite3_column_text() followed by sqlite3_column_bytes()
+** sqlite3_column_blob() followed by sqlite3_column_bytes()
+** sqlite3_column_text16() followed by sqlite3_column_bytes16()
+**
+**
+** In other words, you should call sqlite3_column_text(),
+** sqlite3_column_blob(), or sqlite3_column_text16() first to force the result
+** into the desired format, then invoke sqlite3_column_bytes() or
+** sqlite3_column_bytes16() to find the size of the result. Do not mix calls
+** to sqlite3_column_text() or sqlite3_column_blob() with calls to
+** sqlite3_column_bytes16(), and do not mix calls to sqlite3_column_text16()
+** with calls to sqlite3_column_bytes().
+**
+** ^The pointers returned are valid until a type conversion occurs as
+** described above, or until [sqlite3_step()] or [sqlite3_reset()] or
+** [sqlite3_finalize()] is called. ^The memory space used to hold strings
+** and BLOBs is freed automatically. Do not pass the pointers returned
+** from [sqlite3_column_blob()], [sqlite3_column_text()], etc. into
+** [sqlite3_free()].
+**
+** As long as the input parameters are correct, these routines will only
+** fail if an out-of-memory error occurs during a format conversion.
+** Only the following subset of interfaces are subject to out-of-memory
+** errors:
+**
+**
+** sqlite3_column_blob()
+** sqlite3_column_text()
+** sqlite3_column_text16()
+** sqlite3_column_bytes()
+** sqlite3_column_bytes16()
+**
+**
+** If an out-of-memory error occurs, then the return value from these
+** routines is the same as if the column had contained an SQL NULL value.
+** Valid SQL NULL returns can be distinguished from out-of-memory errors
+** by invoking the [sqlite3_errcode()] immediately after the suspect
+** return value is obtained and before any
+** other SQLite interface is called on the same [database connection].
+*/
+SQLITE_API const void *sqlite3_column_blob(sqlite3_stmt*, int iCol);
+SQLITE_API double sqlite3_column_double(sqlite3_stmt*, int iCol);
+SQLITE_API int sqlite3_column_int(sqlite3_stmt*, int iCol);
+SQLITE_API sqlite3_int64 sqlite3_column_int64(sqlite3_stmt*, int iCol);
+SQLITE_API const unsigned char *sqlite3_column_text(sqlite3_stmt*, int iCol);
+SQLITE_API const void *sqlite3_column_text16(sqlite3_stmt*, int iCol);
+SQLITE_API sqlite3_value *sqlite3_column_value(sqlite3_stmt*, int iCol);
+SQLITE_API int sqlite3_column_bytes(sqlite3_stmt*, int iCol);
+SQLITE_API int sqlite3_column_bytes16(sqlite3_stmt*, int iCol);
+SQLITE_API int sqlite3_column_type(sqlite3_stmt*, int iCol);
+
+/*
+** CAPI3REF: Destroy A Prepared Statement Object
+** DESTRUCTOR: sqlite3_stmt
+**
+** ^The sqlite3_finalize() function is called to delete a [prepared statement].
+** ^If the most recent evaluation of the statement encountered no errors
+** or if the statement is never been evaluated, then sqlite3_finalize() returns
+** SQLITE_OK. ^If the most recent evaluation of statement S failed, then
+** sqlite3_finalize(S) returns the appropriate [error code] or
+** [extended error code].
+**
+** ^The sqlite3_finalize(S) routine can be called at any point during
+** the life cycle of [prepared statement] S:
+** before statement S is ever evaluated, after
+** one or more calls to [sqlite3_reset()], or after any call
+** to [sqlite3_step()] regardless of whether or not the statement has
+** completed execution.
+**
+** ^Invoking sqlite3_finalize() on a NULL pointer is a harmless no-op.
+**
+** The application must finalize every [prepared statement] in order to avoid
+** resource leaks. It is a grievous error for the application to try to use
+** a prepared statement after it has been finalized. Any use of a prepared
+** statement after it has been finalized can result in undefined and
+** undesirable behavior such as segfaults and heap corruption.
+*/
+SQLITE_API int sqlite3_finalize(sqlite3_stmt *pStmt);
+
+/*
+** CAPI3REF: Reset A Prepared Statement Object
+** METHOD: sqlite3_stmt
+**
+** The sqlite3_reset() function is called to reset a [prepared statement]
+** object back to its initial state, ready to be re-executed.
+** ^Any SQL statement variables that had values bound to them using
+** the [sqlite3_bind_blob | sqlite3_bind_*() API] retain their values.
+** Use [sqlite3_clear_bindings()] to reset the bindings.
+**
+** ^The [sqlite3_reset(S)] interface resets the [prepared statement] S
+** back to the beginning of its program.
+**
+** ^The return code from [sqlite3_reset(S)] indicates whether or not
+** the previous evaluation of prepared statement S completed successfully.
+** ^If [sqlite3_step(S)] has never before been called on S or if
+** [sqlite3_step(S)] has not been called since the previous call
+** to [sqlite3_reset(S)], then [sqlite3_reset(S)] will return
+** [SQLITE_OK].
+**
+** ^If the most recent call to [sqlite3_step(S)] for the
+** [prepared statement] S indicated an error, then
+** [sqlite3_reset(S)] returns an appropriate [error code].
+** ^The [sqlite3_reset(S)] interface might also return an [error code]
+** if there were no prior errors but the process of resetting
+** the prepared statement caused a new error. ^For example, if an
+** [INSERT] statement with a [RETURNING] clause is only stepped one time,
+** that one call to [sqlite3_step(S)] might return SQLITE_ROW but
+** the overall statement might still fail and the [sqlite3_reset(S)] call
+** might return SQLITE_BUSY if locking constraints prevent the
+** database change from committing. Therefore, it is important that
+** applications check the return code from [sqlite3_reset(S)] even if
+** no prior call to [sqlite3_step(S)] indicated a problem.
+**
+** ^The [sqlite3_reset(S)] interface does not change the values
+** of any [sqlite3_bind_blob|bindings] on the [prepared statement] S.
+*/
+SQLITE_API int sqlite3_reset(sqlite3_stmt *pStmt);
+
+
+/*
+** CAPI3REF: Create Or Redefine SQL Functions
+** KEYWORDS: {function creation routines}
+** METHOD: sqlite3
+**
+** ^These functions (collectively known as "function creation routines")
+** are used to add SQL functions or aggregates or to redefine the behavior
+** of existing SQL functions or aggregates. The only differences between
+** the three "sqlite3_create_function*" routines are the text encoding
+** expected for the second parameter (the name of the function being
+** created) and the presence or absence of a destructor callback for
+** the application data pointer. Function sqlite3_create_window_function()
+** is similar, but allows the user to supply the extra callback functions
+** needed by [aggregate window functions].
+**
+** ^The first parameter is the [database connection] to which the SQL
+** function is to be added. ^If an application uses more than one database
+** connection then application-defined SQL functions must be added
+** to each database connection separately.
+**
+** ^The second parameter is the name of the SQL function to be created or
+** redefined. ^The length of the name is limited to 255 bytes in a UTF-8
+** representation, exclusive of the zero-terminator. ^Note that the name
+** length limit is in UTF-8 bytes, not characters nor UTF-16 bytes.
+** ^Any attempt to create a function with a longer name
+** will result in [SQLITE_MISUSE] being returned.
+**
+** ^The third parameter (nArg)
+** is the number of arguments that the SQL function or
+** aggregate takes. ^If this parameter is -1, then the SQL function or
+** aggregate may take any number of arguments between 0 and the limit
+** set by [sqlite3_limit]([SQLITE_LIMIT_FUNCTION_ARG]). If the third
+** parameter is less than -1 or greater than 127 then the behavior is
+** undefined.
+**
+** ^The fourth parameter, eTextRep, specifies what
+** [SQLITE_UTF8 | text encoding] this SQL function prefers for
+** its parameters. The application should set this parameter to
+** [SQLITE_UTF16LE] if the function implementation invokes
+** [sqlite3_value_text16le()] on an input, or [SQLITE_UTF16BE] if the
+** implementation invokes [sqlite3_value_text16be()] on an input, or
+** [SQLITE_UTF16] if [sqlite3_value_text16()] is used, or [SQLITE_UTF8]
+** otherwise. ^The same SQL function may be registered multiple times using
+** different preferred text encodings, with different implementations for
+** each encoding.
+** ^When multiple implementations of the same function are available, SQLite
+** will pick the one that involves the least amount of data conversion.
+**
+** ^The fourth parameter may optionally be ORed with [SQLITE_DETERMINISTIC]
+** to signal that the function will always return the same result given
+** the same inputs within a single SQL statement. Most SQL functions are
+** deterministic. The built-in [random()] SQL function is an example of a
+** function that is not deterministic. The SQLite query planner is able to
+** perform additional optimizations on deterministic functions, so use
+** of the [SQLITE_DETERMINISTIC] flag is recommended where possible.
+**
+** ^The fourth parameter may also optionally include the [SQLITE_DIRECTONLY]
+** flag, which if present prevents the function from being invoked from
+** within VIEWs, TRIGGERs, CHECK constraints, generated column expressions,
+** index expressions, or the WHERE clause of partial indexes.
+**
+** For best security, the [SQLITE_DIRECTONLY] flag is recommended for
+** all application-defined SQL functions that do not need to be
+** used inside of triggers, views, CHECK constraints, or other elements of
+** the database schema. This flag is especially recommended for SQL
+** functions that have side effects or reveal internal application state.
+** Without this flag, an attacker might be able to modify the schema of
+** a database file to include invocations of the function with parameters
+** chosen by the attacker, which the application will then execute when
+** the database file is opened and read.
+**
+** ^(The fifth parameter is an arbitrary pointer. The implementation of the
+** function can gain access to this pointer using [sqlite3_user_data()].)^
+**
+** ^The sixth, seventh and eighth parameters passed to the three
+** "sqlite3_create_function*" functions, xFunc, xStep and xFinal, are
+** pointers to C-language functions that implement the SQL function or
+** aggregate. ^A scalar SQL function requires an implementation of the xFunc
+** callback only; NULL pointers must be passed as the xStep and xFinal
+** parameters. ^An aggregate SQL function requires an implementation of xStep
+** and xFinal and NULL pointer must be passed for xFunc. ^To delete an existing
+** SQL function or aggregate, pass NULL pointers for all three function
+** callbacks.
+**
+** ^The sixth, seventh, eighth and ninth parameters (xStep, xFinal, xValue
+** and xInverse) passed to sqlite3_create_window_function are pointers to
+** C-language callbacks that implement the new function. xStep and xFinal
+** must both be non-NULL. xValue and xInverse may either both be NULL, in
+** which case a regular aggregate function is created, or must both be
+** non-NULL, in which case the new function may be used as either an aggregate
+** or aggregate window function. More details regarding the implementation
+** of aggregate window functions are
+** [user-defined window functions|available here].
+**
+** ^(If the final parameter to sqlite3_create_function_v2() or
+** sqlite3_create_window_function() is not NULL, then it is the destructor for
+** the application data pointer. The destructor is invoked when the function
+** is deleted, either by being overloaded or when the database connection
+** closes.)^ ^The destructor is also invoked if the call to
+** sqlite3_create_function_v2() fails. ^When the destructor callback is
+** invoked, it is passed a single argument which is a copy of the application
+** data pointer which was the fifth parameter to sqlite3_create_function_v2().
+**
+** ^It is permitted to register multiple implementations of the same
+** functions with the same name but with either differing numbers of
+** arguments or differing preferred text encodings. ^SQLite will use
+** the implementation that most closely matches the way in which the
+** SQL function is used. ^A function implementation with a non-negative
+** nArg parameter is a better match than a function implementation with
+** a negative nArg. ^A function where the preferred text encoding
+** matches the database encoding is a better
+** match than a function where the encoding is different.
+** ^A function where the encoding difference is between UTF16le and UTF16be
+** is a closer match than a function where the encoding difference is
+** between UTF8 and UTF16.
+**
+** ^Built-in functions may be overloaded by new application-defined functions.
+**
+** ^An application-defined function is permitted to call other
+** SQLite interfaces. However, such calls must not
+** close the database connection nor finalize or reset the prepared
+** statement in which the function is running.
+*/
+SQLITE_API int sqlite3_create_function(
+ sqlite3 *db,
+ const char *zFunctionName,
+ int nArg,
+ int eTextRep,
+ void *pApp,
+ void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
+ void (*xStep)(sqlite3_context*,int,sqlite3_value**),
+ void (*xFinal)(sqlite3_context*)
+);
+SQLITE_API int sqlite3_create_function16(
+ sqlite3 *db,
+ const void *zFunctionName,
+ int nArg,
+ int eTextRep,
+ void *pApp,
+ void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
+ void (*xStep)(sqlite3_context*,int,sqlite3_value**),
+ void (*xFinal)(sqlite3_context*)
+);
+SQLITE_API int sqlite3_create_function_v2(
+ sqlite3 *db,
+ const char *zFunctionName,
+ int nArg,
+ int eTextRep,
+ void *pApp,
+ void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
+ void (*xStep)(sqlite3_context*,int,sqlite3_value**),
+ void (*xFinal)(sqlite3_context*),
+ void(*xDestroy)(void*)
+);
+SQLITE_API int sqlite3_create_window_function(
+ sqlite3 *db,
+ const char *zFunctionName,
+ int nArg,
+ int eTextRep,
+ void *pApp,
+ void (*xStep)(sqlite3_context*,int,sqlite3_value**),
+ void (*xFinal)(sqlite3_context*),
+ void (*xValue)(sqlite3_context*),
+ void (*xInverse)(sqlite3_context*,int,sqlite3_value**),
+ void(*xDestroy)(void*)
+);
+
+/*
+** CAPI3REF: Text Encodings
+**
+** These constant define integer codes that represent the various
+** text encodings supported by SQLite.
+*/
+#define SQLITE_UTF8 1 /* IMP: R-37514-35566 */
+#define SQLITE_UTF16LE 2 /* IMP: R-03371-37637 */
+#define SQLITE_UTF16BE 3 /* IMP: R-51971-34154 */
+#define SQLITE_UTF16 4 /* Use native byte order */
+#define SQLITE_ANY 5 /* Deprecated */
+#define SQLITE_UTF16_ALIGNED 8 /* sqlite3_create_collation only */
+
+/*
+** CAPI3REF: Function Flags
+**
+** These constants may be ORed together with the
+** [SQLITE_UTF8 | preferred text encoding] as the fourth argument
+** to [sqlite3_create_function()], [sqlite3_create_function16()], or
+** [sqlite3_create_function_v2()].
+**
+**
+** [[SQLITE_DETERMINISTIC]] SQLITE_DETERMINISTIC
+** The SQLITE_DETERMINISTIC flag means that the new function always gives
+** the same output when the input parameters are the same.
+** The [abs|abs() function] is deterministic, for example, but
+** [randomblob|randomblob()] is not. Functions must
+** be deterministic in order to be used in certain contexts such as
+** with the WHERE clause of [partial indexes] or in [generated columns].
+** SQLite might also optimize deterministic functions by factoring them
+** out of inner loops.
+**
+**
+** [[SQLITE_DIRECTONLY]] SQLITE_DIRECTONLY
+** The SQLITE_DIRECTONLY flag means that the function may only be invoked
+** from top-level SQL, and cannot be used in VIEWs or TRIGGERs nor in
+** schema structures such as [CHECK constraints], [DEFAULT clauses],
+** [expression indexes], [partial indexes], or [generated columns].
+**
+** The SQLITE_DIRECTONLY flag is recommended for any
+** [application-defined SQL function]
+** that has side-effects or that could potentially leak sensitive information.
+** This will prevent attacks in which an application is tricked
+** into using a database file that has had its schema surreptitiously
+** modified to invoke the application-defined function in ways that are
+** harmful.
+**
+** Some people say it is good practice to set SQLITE_DIRECTONLY on all
+** [application-defined SQL functions], regardless of whether or not they
+** are security sensitive, as doing so prevents those functions from being used
+** inside of the database schema, and thus ensures that the database
+** can be inspected and modified using generic tools (such as the [CLI])
+** that do not have access to the application-defined functions.
+**
+**
+** [[SQLITE_INNOCUOUS]] SQLITE_INNOCUOUS
+** The SQLITE_INNOCUOUS flag means that the function is unlikely
+** to cause problems even if misused. An innocuous function should have
+** no side effects and should not depend on any values other than its
+** input parameters. The [abs|abs() function] is an example of an
+** innocuous function.
+** The [load_extension() SQL function] is not innocuous because of its
+** side effects.
+** SQLITE_INNOCUOUS is similar to SQLITE_DETERMINISTIC, but is not
+** exactly the same. The [random|random() function] is an example of a
+** function that is innocuous but not deterministic.
+**
Some heightened security settings
+** ([SQLITE_DBCONFIG_TRUSTED_SCHEMA] and [PRAGMA trusted_schema=OFF])
+** disable the use of SQL functions inside views and triggers and in
+** schema structures such as [CHECK constraints], [DEFAULT clauses],
+** [expression indexes], [partial indexes], and [generated columns] unless
+** the function is tagged with SQLITE_INNOCUOUS. Most built-in functions
+** are innocuous. Developers are advised to avoid using the
+** SQLITE_INNOCUOUS flag for application-defined functions unless the
+** function has been carefully audited and found to be free of potentially
+** security-adverse side-effects and information-leaks.
+**
+**
+** [[SQLITE_SUBTYPE]] SQLITE_SUBTYPE
+** The SQLITE_SUBTYPE flag indicates to SQLite that a function might call
+** [sqlite3_value_subtype()] to inspect the sub-types of its arguments.
+** This flag instructs SQLite to omit some corner-case optimizations that
+** might disrupt the operation of the [sqlite3_value_subtype()] function,
+** causing it to return zero rather than the correct subtype().
+** All SQL functions that invoke [sqlite3_value_subtype()] should have this
+** property. If the SQLITE_SUBTYPE property is omitted, then the return
+** value from [sqlite3_value_subtype()] might sometimes be zero even though
+** a non-zero subtype was specified by the function argument expression.
+**
+** [[SQLITE_RESULT_SUBTYPE]] SQLITE_RESULT_SUBTYPE
+** The SQLITE_RESULT_SUBTYPE flag indicates to SQLite that a function might call
+** [sqlite3_result_subtype()] to cause a sub-type to be associated with its
+** result.
+** Every function that invokes [sqlite3_result_subtype()] should have this
+** property. If it does not, then the call to [sqlite3_result_subtype()]
+** might become a no-op if the function is used as term in an
+** [expression index]. On the other hand, SQL functions that never invoke
+** [sqlite3_result_subtype()] should avoid setting this property, as the
+** purpose of this property is to disable certain optimizations that are
+** incompatible with subtypes.
+**
+** [[SQLITE_SELFORDER1]] SQLITE_SELFORDER1
+** The SQLITE_SELFORDER1 flag indicates that the function is an aggregate
+** that internally orders the values provided to the first argument. The
+** ordered-set aggregate SQL notation with a single ORDER BY term can be
+** used to invoke this function. If the ordered-set aggregate notation is
+** used on a function that lacks this flag, then an error is raised. Note
+** that the ordered-set aggregate syntax is only available if SQLite is
+** built using the -DSQLITE_ENABLE_ORDERED_SET_AGGREGATES compile-time option.
+**
+**
+*/
+#define SQLITE_DETERMINISTIC 0x000000800
+#define SQLITE_DIRECTONLY 0x000080000
+#define SQLITE_SUBTYPE 0x000100000
+#define SQLITE_INNOCUOUS 0x000200000
+#define SQLITE_RESULT_SUBTYPE 0x001000000
+#define SQLITE_SELFORDER1 0x002000000
+
+/*
+** CAPI3REF: Deprecated Functions
+** DEPRECATED
+**
+** These functions are [deprecated]. In order to maintain
+** backwards compatibility with older code, these functions continue
+** to be supported. However, new applications should avoid
+** the use of these functions. To encourage programmers to avoid
+** these functions, we will not explain what they do.
+*/
+#ifndef SQLITE_OMIT_DEPRECATED
+SQLITE_API SQLITE_DEPRECATED int sqlite3_aggregate_count(sqlite3_context*);
+SQLITE_API SQLITE_DEPRECATED int sqlite3_expired(sqlite3_stmt*);
+SQLITE_API SQLITE_DEPRECATED int sqlite3_transfer_bindings(sqlite3_stmt*, sqlite3_stmt*);
+SQLITE_API SQLITE_DEPRECATED int sqlite3_global_recover(void);
+SQLITE_API SQLITE_DEPRECATED void sqlite3_thread_cleanup(void);
+SQLITE_API SQLITE_DEPRECATED int sqlite3_memory_alarm(void(*)(void*,sqlite3_int64,int),
+ void*,sqlite3_int64);
+#endif
+
+/*
+** CAPI3REF: Obtaining SQL Values
+** METHOD: sqlite3_value
+**
+** Summary:
+**
+** sqlite3_value_blob → BLOB value
+** sqlite3_value_double → REAL value
+** sqlite3_value_int → 32-bit INTEGER value
+** sqlite3_value_int64 → 64-bit INTEGER value
+** sqlite3_value_pointer → Pointer value
+** sqlite3_value_text → UTF-8 TEXT value
+** sqlite3_value_text16 → UTF-16 TEXT value in
+** the native byteorder
+** sqlite3_value_text16be → UTF-16be TEXT value
+** sqlite3_value_text16le → UTF-16le TEXT value
+**
+** sqlite3_value_bytes → Size of a BLOB
+** or a UTF-8 TEXT in bytes
+** sqlite3_value_bytes16
+** → Size of UTF-16
+** TEXT in bytes
+** sqlite3_value_type → Default
+** datatype of the value
+** sqlite3_value_numeric_type
+** → Best numeric datatype of the value
+** sqlite3_value_nochange
+** → True if the column is unchanged in an UPDATE
+** against a virtual table.
+** sqlite3_value_frombind
+** → True if value originated from a [bound parameter]
+**
+**
+** Details:
+**
+** These routines extract type, size, and content information from
+** [protected sqlite3_value] objects. Protected sqlite3_value objects
+** are used to pass parameter information into the functions that
+** implement [application-defined SQL functions] and [virtual tables].
+**
+** These routines work only with [protected sqlite3_value] objects.
+** Any attempt to use these routines on an [unprotected sqlite3_value]
+** is not threadsafe.
+**
+** ^These routines work just like the corresponding [column access functions]
+** except that these routines take a single [protected sqlite3_value] object
+** pointer instead of a [sqlite3_stmt*] pointer and an integer column number.
+**
+** ^The sqlite3_value_text16() interface extracts a UTF-16 string
+** in the native byte-order of the host machine. ^The
+** sqlite3_value_text16be() and sqlite3_value_text16le() interfaces
+** extract UTF-16 strings as big-endian and little-endian respectively.
+**
+** ^If [sqlite3_value] object V was initialized
+** using [sqlite3_bind_pointer(S,I,P,X,D)] or [sqlite3_result_pointer(C,P,X,D)]
+** and if X and Y are strings that compare equal according to strcmp(X,Y),
+** then sqlite3_value_pointer(V,Y) will return the pointer P. ^Otherwise,
+** sqlite3_value_pointer(V,Y) returns a NULL. The sqlite3_bind_pointer()
+** routine is part of the [pointer passing interface] added for SQLite 3.20.0.
+**
+** ^(The sqlite3_value_type(V) interface returns the
+** [SQLITE_INTEGER | datatype code] for the initial datatype of the
+** [sqlite3_value] object V. The returned value is one of [SQLITE_INTEGER],
+** [SQLITE_FLOAT], [SQLITE_TEXT], [SQLITE_BLOB], or [SQLITE_NULL].)^
+** Other interfaces might change the datatype for an sqlite3_value object.
+** For example, if the datatype is initially SQLITE_INTEGER and
+** sqlite3_value_text(V) is called to extract a text value for that
+** integer, then subsequent calls to sqlite3_value_type(V) might return
+** SQLITE_TEXT. Whether or not a persistent internal datatype conversion
+** occurs is undefined and may change from one release of SQLite to the next.
+**
+** ^(The sqlite3_value_numeric_type() interface attempts to apply
+** numeric affinity to the value. This means that an attempt is
+** made to convert the value to an integer or floating point. If
+** such a conversion is possible without loss of information (in other
+** words, if the value is a string that looks like a number)
+** then the conversion is performed. Otherwise no conversion occurs.
+** The [SQLITE_INTEGER | datatype] after conversion is returned.)^
+**
+** ^Within the [xUpdate] method of a [virtual table], the
+** sqlite3_value_nochange(X) interface returns true if and only if
+** the column corresponding to X is unchanged by the UPDATE operation
+** that the xUpdate method call was invoked to implement and if
+** and the prior [xColumn] method call that was invoked to extracted
+** the value for that column returned without setting a result (probably
+** because it queried [sqlite3_vtab_nochange()] and found that the column
+** was unchanging). ^Within an [xUpdate] method, any value for which
+** sqlite3_value_nochange(X) is true will in all other respects appear
+** to be a NULL value. If sqlite3_value_nochange(X) is invoked anywhere other
+** than within an [xUpdate] method call for an UPDATE statement, then
+** the return value is arbitrary and meaningless.
+**
+** ^The sqlite3_value_frombind(X) interface returns non-zero if the
+** value X originated from one of the [sqlite3_bind_int|sqlite3_bind()]
+** interfaces. ^If X comes from an SQL literal value, or a table column,
+** or an expression, then sqlite3_value_frombind(X) returns zero.
+**
+** Please pay particular attention to the fact that the pointer returned
+** from [sqlite3_value_blob()], [sqlite3_value_text()], or
+** [sqlite3_value_text16()] can be invalidated by a subsequent call to
+** [sqlite3_value_bytes()], [sqlite3_value_bytes16()], [sqlite3_value_text()],
+** or [sqlite3_value_text16()].
+**
+** These routines must be called from the same thread as
+** the SQL function that supplied the [sqlite3_value*] parameters.
+**
+** As long as the input parameter is correct, these routines can only
+** fail if an out-of-memory error occurs during a format conversion.
+** Only the following subset of interfaces are subject to out-of-memory
+** errors:
+**
+**
+** sqlite3_value_blob()
+** sqlite3_value_text()
+** sqlite3_value_text16()
+** sqlite3_value_text16le()
+** sqlite3_value_text16be()
+** sqlite3_value_bytes()
+** sqlite3_value_bytes16()
+**
+**
+** If an out-of-memory error occurs, then the return value from these
+** routines is the same as if the column had contained an SQL NULL value.
+** Valid SQL NULL returns can be distinguished from out-of-memory errors
+** by invoking the [sqlite3_errcode()] immediately after the suspect
+** return value is obtained and before any
+** other SQLite interface is called on the same [database connection].
+*/
+SQLITE_API const void *sqlite3_value_blob(sqlite3_value*);
+SQLITE_API double sqlite3_value_double(sqlite3_value*);
+SQLITE_API int sqlite3_value_int(sqlite3_value*);
+SQLITE_API sqlite3_int64 sqlite3_value_int64(sqlite3_value*);
+SQLITE_API void *sqlite3_value_pointer(sqlite3_value*, const char*);
+SQLITE_API const unsigned char *sqlite3_value_text(sqlite3_value*);
+SQLITE_API const void *sqlite3_value_text16(sqlite3_value*);
+SQLITE_API const void *sqlite3_value_text16le(sqlite3_value*);
+SQLITE_API const void *sqlite3_value_text16be(sqlite3_value*);
+SQLITE_API int sqlite3_value_bytes(sqlite3_value*);
+SQLITE_API int sqlite3_value_bytes16(sqlite3_value*);
+SQLITE_API int sqlite3_value_type(sqlite3_value*);
+SQLITE_API int sqlite3_value_numeric_type(sqlite3_value*);
+SQLITE_API int sqlite3_value_nochange(sqlite3_value*);
+SQLITE_API int sqlite3_value_frombind(sqlite3_value*);
+
+/*
+** CAPI3REF: Report the internal text encoding state of an sqlite3_value object
+** METHOD: sqlite3_value
+**
+** ^(The sqlite3_value_encoding(X) interface returns one of [SQLITE_UTF8],
+** [SQLITE_UTF16BE], or [SQLITE_UTF16LE] according to the current text encoding
+** of the value X, assuming that X has type TEXT.)^ If sqlite3_value_type(X)
+** returns something other than SQLITE_TEXT, then the return value from
+** sqlite3_value_encoding(X) is meaningless. ^Calls to
+** [sqlite3_value_text(X)], [sqlite3_value_text16(X)], [sqlite3_value_text16be(X)],
+** [sqlite3_value_text16le(X)], [sqlite3_value_bytes(X)], or
+** [sqlite3_value_bytes16(X)] might change the encoding of the value X and
+** thus change the return from subsequent calls to sqlite3_value_encoding(X).
+**
+** This routine is intended for used by applications that test and validate
+** the SQLite implementation. This routine is inquiring about the opaque
+** internal state of an [sqlite3_value] object. Ordinary applications should
+** not need to know what the internal state of an sqlite3_value object is and
+** hence should not need to use this interface.
+*/
+SQLITE_API int sqlite3_value_encoding(sqlite3_value*);
+
+/*
+** CAPI3REF: Finding The Subtype Of SQL Values
+** METHOD: sqlite3_value
+**
+** The sqlite3_value_subtype(V) function returns the subtype for
+** an [application-defined SQL function] argument V. The subtype
+** information can be used to pass a limited amount of context from
+** one SQL function to another. Use the [sqlite3_result_subtype()]
+** routine to set the subtype for the return value of an SQL function.
+**
+** Every [application-defined SQL function] that invokes this interface
+** should include the [SQLITE_SUBTYPE] property in the text
+** encoding argument when the function is [sqlite3_create_function|registered].
+** If the [SQLITE_SUBTYPE] property is omitted, then sqlite3_value_subtype()
+** might return zero instead of the upstream subtype in some corner cases.
+*/
+SQLITE_API unsigned int sqlite3_value_subtype(sqlite3_value*);
+
+/*
+** CAPI3REF: Copy And Free SQL Values
+** METHOD: sqlite3_value
+**
+** ^The sqlite3_value_dup(V) interface makes a copy of the [sqlite3_value]
+** object V and returns a pointer to that copy. ^The [sqlite3_value] returned
+** is a [protected sqlite3_value] object even if the input is not.
+** ^The sqlite3_value_dup(V) interface returns NULL if V is NULL or if a
+** memory allocation fails. ^If V is a [pointer value], then the result
+** of sqlite3_value_dup(V) is a NULL value.
+**
+** ^The sqlite3_value_free(V) interface frees an [sqlite3_value] object
+** previously obtained from [sqlite3_value_dup()]. ^If V is a NULL pointer
+** then sqlite3_value_free(V) is a harmless no-op.
+*/
+SQLITE_API sqlite3_value *sqlite3_value_dup(const sqlite3_value*);
+SQLITE_API void sqlite3_value_free(sqlite3_value*);
+
+/*
+** CAPI3REF: Obtain Aggregate Function Context
+** METHOD: sqlite3_context
+**
+** Implementations of aggregate SQL functions use this
+** routine to allocate memory for storing their state.
+**
+** ^The first time the sqlite3_aggregate_context(C,N) routine is called
+** for a particular aggregate function, SQLite allocates
+** N bytes of memory, zeroes out that memory, and returns a pointer
+** to the new memory. ^On second and subsequent calls to
+** sqlite3_aggregate_context() for the same aggregate function instance,
+** the same buffer is returned. Sqlite3_aggregate_context() is normally
+** called once for each invocation of the xStep callback and then one
+** last time when the xFinal callback is invoked. ^(When no rows match
+** an aggregate query, the xStep() callback of the aggregate function
+** implementation is never called and xFinal() is called exactly once.
+** In those cases, sqlite3_aggregate_context() might be called for the
+** first time from within xFinal().)^
+**
+** ^The sqlite3_aggregate_context(C,N) routine returns a NULL pointer
+** when first called if N is less than or equal to zero or if a memory
+** allocation error occurs.
+**
+** ^(The amount of space allocated by sqlite3_aggregate_context(C,N) is
+** determined by the N parameter on the first successful call. Changing the
+** value of N in any subsequent call to sqlite3_aggregate_context() within
+** the same aggregate function instance will not resize the memory
+** allocation.)^ Within the xFinal callback, it is customary to set
+** N=0 in calls to sqlite3_aggregate_context(C,N) so that no
+** pointless memory allocations occur.
+**
+** ^SQLite automatically frees the memory allocated by
+** sqlite3_aggregate_context() when the aggregate query concludes.
+**
+** The first parameter must be a copy of the
+** [sqlite3_context | SQL function context] that is the first parameter
+** to the xStep or xFinal callback routine that implements the aggregate
+** function.
+**
+** This routine must be called from the same thread in which
+** the aggregate SQL function is running.
+*/
+SQLITE_API void *sqlite3_aggregate_context(sqlite3_context*, int nBytes);
+
+/*
+** CAPI3REF: User Data For Functions
+** METHOD: sqlite3_context
+**
+** ^The sqlite3_user_data() interface returns a copy of
+** the pointer that was the pUserData parameter (the 5th parameter)
+** of the [sqlite3_create_function()]
+** and [sqlite3_create_function16()] routines that originally
+** registered the application defined function.
+**
+** This routine must be called from the same thread in which
+** the application-defined function is running.
+*/
+SQLITE_API void *sqlite3_user_data(sqlite3_context*);
+
+/*
+** CAPI3REF: Database Connection For Functions
+** METHOD: sqlite3_context
+**
+** ^The sqlite3_context_db_handle() interface returns a copy of
+** the pointer to the [database connection] (the 1st parameter)
+** of the [sqlite3_create_function()]
+** and [sqlite3_create_function16()] routines that originally
+** registered the application defined function.
+*/
+SQLITE_API sqlite3 *sqlite3_context_db_handle(sqlite3_context*);
+
+/*
+** CAPI3REF: Function Auxiliary Data
+** METHOD: sqlite3_context
+**
+** These functions may be used by (non-aggregate) SQL functions to
+** associate auxiliary data with argument values. If the same argument
+** value is passed to multiple invocations of the same SQL function during
+** query execution, under some circumstances the associated auxiliary data
+** might be preserved. An example of where this might be useful is in a
+** regular-expression matching function. The compiled version of the regular
+** expression can be stored as auxiliary data associated with the pattern string.
+** Then as long as the pattern string remains the same,
+** the compiled regular expression can be reused on multiple
+** invocations of the same function.
+**
+** ^The sqlite3_get_auxdata(C,N) interface returns a pointer to the auxiliary data
+** associated by the sqlite3_set_auxdata(C,N,P,X) function with the Nth argument
+** value to the application-defined function. ^N is zero for the left-most
+** function argument. ^If there is no auxiliary data
+** associated with the function argument, the sqlite3_get_auxdata(C,N) interface
+** returns a NULL pointer.
+**
+** ^The sqlite3_set_auxdata(C,N,P,X) interface saves P as auxiliary data for the
+** N-th argument of the application-defined function. ^Subsequent
+** calls to sqlite3_get_auxdata(C,N) return P from the most recent
+** sqlite3_set_auxdata(C,N,P,X) call if the auxiliary data is still valid or
+** NULL if the auxiliary data has been discarded.
+** ^After each call to sqlite3_set_auxdata(C,N,P,X) where X is not NULL,
+** SQLite will invoke the destructor function X with parameter P exactly
+** once, when the auxiliary data is discarded.
+** SQLite is free to discard the auxiliary data at any time, including:
+** ^(when the corresponding function parameter changes)^, or
+** ^(when [sqlite3_reset()] or [sqlite3_finalize()] is called for the
+** SQL statement)^, or
+** ^(when sqlite3_set_auxdata() is invoked again on the same
+** parameter)^, or
+** ^(during the original sqlite3_set_auxdata() call when a memory
+** allocation error occurs.)^
+** ^(during the original sqlite3_set_auxdata() call if the function
+** is evaluated during query planning instead of during query execution,
+** as sometimes happens with [SQLITE_ENABLE_STAT4].)^
+**
+** Note the last two bullets in particular. The destructor X in
+** sqlite3_set_auxdata(C,N,P,X) might be called immediately, before the
+** sqlite3_set_auxdata() interface even returns. Hence sqlite3_set_auxdata()
+** should be called near the end of the function implementation and the
+** function implementation should not make any use of P after
+** sqlite3_set_auxdata() has been called. Furthermore, a call to
+** sqlite3_get_auxdata() that occurs immediately after a corresponding call
+** to sqlite3_set_auxdata() might still return NULL if an out-of-memory
+** condition occurred during the sqlite3_set_auxdata() call or if the
+** function is being evaluated during query planning rather than during
+** query execution.
+**
+** ^(In practice, auxiliary data is preserved between function calls for
+** function parameters that are compile-time constants, including literal
+** values and [parameters] and expressions composed from the same.)^
+**
+** The value of the N parameter to these interfaces should be non-negative.
+** Future enhancements may make use of negative N values to define new
+** kinds of function caching behavior.
+**
+** These routines must be called from the same thread in which
+** the SQL function is running.
+**
+** See also: [sqlite3_get_clientdata()] and [sqlite3_set_clientdata()].
+*/
+SQLITE_API void *sqlite3_get_auxdata(sqlite3_context*, int N);
+SQLITE_API void sqlite3_set_auxdata(sqlite3_context*, int N, void*, void (*)(void*));
+
+/*
+** CAPI3REF: Database Connection Client Data
+** METHOD: sqlite3
+**
+** These functions are used to associate one or more named pointers
+** with a [database connection].
+** A call to sqlite3_set_clientdata(D,N,P,X) causes the pointer P
+** to be attached to [database connection] D using name N. Subsequent
+** calls to sqlite3_get_clientdata(D,N) will return a copy of pointer P
+** or a NULL pointer if there were no prior calls to
+** sqlite3_set_clientdata() with the same values of D and N.
+** Names are compared using strcmp() and are thus case sensitive.
+**
+** If P and X are both non-NULL, then the destructor X is invoked with
+** argument P on the first of the following occurrences:
+**
+** An out-of-memory error occurs during the call to
+** sqlite3_set_clientdata() which attempts to register pointer P.
+** A subsequent call to sqlite3_set_clientdata(D,N,P,X) is made
+** with the same D and N parameters.
+** The database connection closes. SQLite does not make any guarantees
+** about the order in which destructors are called, only that all
+** destructors will be called exactly once at some point during the
+** database connection closing process.
+**
+**
+** SQLite does not do anything with client data other than invoke
+** destructors on the client data at the appropriate time. The intended
+** use for client data is to provide a mechanism for wrapper libraries
+** to store additional information about an SQLite database connection.
+**
+** There is no limit (other than available memory) on the number of different
+** client data pointers (with different names) that can be attached to a
+** single database connection. However, the implementation is optimized
+** for the case of having only one or two different client data names.
+** Applications and wrapper libraries are discouraged from using more than
+** one client data name each.
+**
+** There is no way to enumerate the client data pointers
+** associated with a database connection. The N parameter can be thought
+** of as a secret key such that only code that knows the secret key is able
+** to access the associated data.
+**
+** Security Warning: These interfaces should not be exposed in scripting
+** languages or in other circumstances where it might be possible for an
+** attacker to invoke them. Any agent that can invoke these interfaces
+** can probably also take control of the process.
+**
+** Database connection client data is only available for SQLite
+** version 3.44.0 ([dateof:3.44.0]) and later.
+**
+** See also: [sqlite3_set_auxdata()] and [sqlite3_get_auxdata()].
+*/
+SQLITE_API void *sqlite3_get_clientdata(sqlite3*,const char*);
+SQLITE_API int sqlite3_set_clientdata(sqlite3*, const char*, void*, void(*)(void*));
+
+/*
+** CAPI3REF: Constants Defining Special Destructor Behavior
+**
+** These are special values for the destructor that is passed in as the
+** final argument to routines like [sqlite3_result_blob()]. ^If the destructor
+** argument is SQLITE_STATIC, it means that the content pointer is constant
+** and will never change. It does not need to be destroyed. ^The
+** SQLITE_TRANSIENT value means that the content will likely change in
+** the near future and that SQLite should make its own private copy of
+** the content before returning.
+**
+** The typedef is necessary to work around problems in certain
+** C++ compilers.
+*/
+typedef void (*sqlite3_destructor_type)(void*);
+#define SQLITE_STATIC ((sqlite3_destructor_type)0)
+#define SQLITE_TRANSIENT ((sqlite3_destructor_type)-1)
+
+/*
+** CAPI3REF: Setting The Result Of An SQL Function
+** METHOD: sqlite3_context
+**
+** These routines are used by the xFunc or xFinal callbacks that
+** implement SQL functions and aggregates. See
+** [sqlite3_create_function()] and [sqlite3_create_function16()]
+** for additional information.
+**
+** These functions work very much like the [parameter binding] family of
+** functions used to bind values to host parameters in prepared statements.
+** Refer to the [SQL parameter] documentation for additional information.
+**
+** ^The sqlite3_result_blob() interface sets the result from
+** an application-defined function to be the BLOB whose content is pointed
+** to by the second parameter and which is N bytes long where N is the
+** third parameter.
+**
+** ^The sqlite3_result_zeroblob(C,N) and sqlite3_result_zeroblob64(C,N)
+** interfaces set the result of the application-defined function to be
+** a BLOB containing all zero bytes and N bytes in size.
+**
+** ^The sqlite3_result_double() interface sets the result from
+** an application-defined function to be a floating point value specified
+** by its 2nd argument.
+**
+** ^The sqlite3_result_error() and sqlite3_result_error16() functions
+** cause the implemented SQL function to throw an exception.
+** ^SQLite uses the string pointed to by the
+** 2nd parameter of sqlite3_result_error() or sqlite3_result_error16()
+** as the text of an error message. ^SQLite interprets the error
+** message string from sqlite3_result_error() as UTF-8. ^SQLite
+** interprets the string from sqlite3_result_error16() as UTF-16 using
+** the same [byte-order determination rules] as [sqlite3_bind_text16()].
+** ^If the third parameter to sqlite3_result_error()
+** or sqlite3_result_error16() is negative then SQLite takes as the error
+** message all text up through the first zero character.
+** ^If the third parameter to sqlite3_result_error() or
+** sqlite3_result_error16() is non-negative then SQLite takes that many
+** bytes (not characters) from the 2nd parameter as the error message.
+** ^The sqlite3_result_error() and sqlite3_result_error16()
+** routines make a private copy of the error message text before
+** they return. Hence, the calling function can deallocate or
+** modify the text after they return without harm.
+** ^The sqlite3_result_error_code() function changes the error code
+** returned by SQLite as a result of an error in a function. ^By default,
+** the error code is SQLITE_ERROR. ^A subsequent call to sqlite3_result_error()
+** or sqlite3_result_error16() resets the error code to SQLITE_ERROR.
+**
+** ^The sqlite3_result_error_toobig() interface causes SQLite to throw an
+** error indicating that a string or BLOB is too long to represent.
+**
+** ^The sqlite3_result_error_nomem() interface causes SQLite to throw an
+** error indicating that a memory allocation failed.
+**
+** ^The sqlite3_result_int() interface sets the return value
+** of the application-defined function to be the 32-bit signed integer
+** value given in the 2nd argument.
+** ^The sqlite3_result_int64() interface sets the return value
+** of the application-defined function to be the 64-bit signed integer
+** value given in the 2nd argument.
+**
+** ^The sqlite3_result_null() interface sets the return value
+** of the application-defined function to be NULL.
+**
+** ^The sqlite3_result_text(), sqlite3_result_text16(),
+** sqlite3_result_text16le(), and sqlite3_result_text16be() interfaces
+** set the return value of the application-defined function to be
+** a text string which is represented as UTF-8, UTF-16 native byte order,
+** UTF-16 little endian, or UTF-16 big endian, respectively.
+** ^The sqlite3_result_text64() interface sets the return value of an
+** application-defined function to be a text string in an encoding
+** specified by the fifth (and last) parameter, which must be one
+** of [SQLITE_UTF8], [SQLITE_UTF16], [SQLITE_UTF16BE], or [SQLITE_UTF16LE].
+** ^SQLite takes the text result from the application from
+** the 2nd parameter of the sqlite3_result_text* interfaces.
+** ^If the 3rd parameter to any of the sqlite3_result_text* interfaces
+** other than sqlite3_result_text64() is negative, then SQLite computes
+** the string length itself by searching the 2nd parameter for the first
+** zero character.
+** ^If the 3rd parameter to the sqlite3_result_text* interfaces
+** is non-negative, then as many bytes (not characters) of the text
+** pointed to by the 2nd parameter are taken as the application-defined
+** function result. If the 3rd parameter is non-negative, then it
+** must be the byte offset into the string where the NUL terminator would
+** appear if the string were NUL terminated. If any NUL characters occur
+** in the string at a byte offset that is less than the value of the 3rd
+** parameter, then the resulting string will contain embedded NULs and the
+** result of expressions operating on strings with embedded NULs is undefined.
+** ^If the 4th parameter to the sqlite3_result_text* interfaces
+** or sqlite3_result_blob is a non-NULL pointer, then SQLite calls that
+** function as the destructor on the text or BLOB result when it has
+** finished using that result.
+** ^If the 4th parameter to the sqlite3_result_text* interfaces or to
+** sqlite3_result_blob is the special constant SQLITE_STATIC, then SQLite
+** assumes that the text or BLOB result is in constant space and does not
+** copy the content of the parameter nor call a destructor on the content
+** when it has finished using that result.
+** ^If the 4th parameter to the sqlite3_result_text* interfaces
+** or sqlite3_result_blob is the special constant SQLITE_TRANSIENT
+** then SQLite makes a copy of the result into space obtained
+** from [sqlite3_malloc()] before it returns.
+**
+** ^For the sqlite3_result_text16(), sqlite3_result_text16le(), and
+** sqlite3_result_text16be() routines, and for sqlite3_result_text64()
+** when the encoding is not UTF8, if the input UTF16 begins with a
+** byte-order mark (BOM, U+FEFF) then the BOM is removed from the
+** string and the rest of the string is interpreted according to the
+** byte-order specified by the BOM. ^The byte-order specified by
+** the BOM at the beginning of the text overrides the byte-order
+** specified by the interface procedure. ^So, for example, if
+** sqlite3_result_text16le() is invoked with text that begins
+** with bytes 0xfe, 0xff (a big-endian byte-order mark) then the
+** first two bytes of input are skipped and the remaining input
+** is interpreted as UTF16BE text.
+**
+** ^For UTF16 input text to the sqlite3_result_text16(),
+** sqlite3_result_text16be(), sqlite3_result_text16le(), and
+** sqlite3_result_text64() routines, if the text contains invalid
+** UTF16 characters, the invalid characters might be converted
+** into the unicode replacement character, U+FFFD.
+**
+** ^The sqlite3_result_value() interface sets the result of
+** the application-defined function to be a copy of the
+** [unprotected sqlite3_value] object specified by the 2nd parameter. ^The
+** sqlite3_result_value() interface makes a copy of the [sqlite3_value]
+** so that the [sqlite3_value] specified in the parameter may change or
+** be deallocated after sqlite3_result_value() returns without harm.
+** ^A [protected sqlite3_value] object may always be used where an
+** [unprotected sqlite3_value] object is required, so either
+** kind of [sqlite3_value] object can be used with this interface.
+**
+** ^The sqlite3_result_pointer(C,P,T,D) interface sets the result to an
+** SQL NULL value, just like [sqlite3_result_null(C)], except that it
+** also associates the host-language pointer P or type T with that
+** NULL value such that the pointer can be retrieved within an
+** [application-defined SQL function] using [sqlite3_value_pointer()].
+** ^If the D parameter is not NULL, then it is a pointer to a destructor
+** for the P parameter. ^SQLite invokes D with P as its only argument
+** when SQLite is finished with P. The T parameter should be a static
+** string and preferably a string literal. The sqlite3_result_pointer()
+** routine is part of the [pointer passing interface] added for SQLite 3.20.0.
+**
+** If these routines are called from within a different thread
+** than the one containing the application-defined function that received
+** the [sqlite3_context] pointer, the results are undefined.
+*/
+SQLITE_API void sqlite3_result_blob(sqlite3_context*, const void*, int, void(*)(void*));
+SQLITE_API void sqlite3_result_blob64(sqlite3_context*,const void*,
+ sqlite3_uint64,void(*)(void*));
+SQLITE_API void sqlite3_result_double(sqlite3_context*, double);
+SQLITE_API void sqlite3_result_error(sqlite3_context*, const char*, int);
+SQLITE_API void sqlite3_result_error16(sqlite3_context*, const void*, int);
+SQLITE_API void sqlite3_result_error_toobig(sqlite3_context*);
+SQLITE_API void sqlite3_result_error_nomem(sqlite3_context*);
+SQLITE_API void sqlite3_result_error_code(sqlite3_context*, int);
+SQLITE_API void sqlite3_result_int(sqlite3_context*, int);
+SQLITE_API void sqlite3_result_int64(sqlite3_context*, sqlite3_int64);
+SQLITE_API void sqlite3_result_null(sqlite3_context*);
+SQLITE_API void sqlite3_result_text(sqlite3_context*, const char*, int, void(*)(void*));
+SQLITE_API void sqlite3_result_text64(sqlite3_context*, const char*,sqlite3_uint64,
+ void(*)(void*), unsigned char encoding);
+SQLITE_API void sqlite3_result_text16(sqlite3_context*, const void*, int, void(*)(void*));
+SQLITE_API void sqlite3_result_text16le(sqlite3_context*, const void*, int,void(*)(void*));
+SQLITE_API void sqlite3_result_text16be(sqlite3_context*, const void*, int,void(*)(void*));
+SQLITE_API void sqlite3_result_value(sqlite3_context*, sqlite3_value*);
+SQLITE_API void sqlite3_result_pointer(sqlite3_context*, void*,const char*,void(*)(void*));
+SQLITE_API void sqlite3_result_zeroblob(sqlite3_context*, int n);
+SQLITE_API int sqlite3_result_zeroblob64(sqlite3_context*, sqlite3_uint64 n);
+
+
+/*
+** CAPI3REF: Setting The Subtype Of An SQL Function
+** METHOD: sqlite3_context
+**
+** The sqlite3_result_subtype(C,T) function causes the subtype of
+** the result from the [application-defined SQL function] with
+** [sqlite3_context] C to be the value T. Only the lower 8 bits
+** of the subtype T are preserved in current versions of SQLite;
+** higher order bits are discarded.
+** The number of subtype bytes preserved by SQLite might increase
+** in future releases of SQLite.
+**
+** Every [application-defined SQL function] that invokes this interface
+** should include the [SQLITE_RESULT_SUBTYPE] property in its
+** text encoding argument when the SQL function is
+** [sqlite3_create_function|registered]. If the [SQLITE_RESULT_SUBTYPE]
+** property is omitted from the function that invokes sqlite3_result_subtype(),
+** then in some cases the sqlite3_result_subtype() might fail to set
+** the result subtype.
+**
+** If SQLite is compiled with -DSQLITE_STRICT_SUBTYPE=1, then any
+** SQL function that invokes the sqlite3_result_subtype() interface
+** and that does not have the SQLITE_RESULT_SUBTYPE property will raise
+** an error. Future versions of SQLite might enable -DSQLITE_STRICT_SUBTYPE=1
+** by default.
+*/
+SQLITE_API void sqlite3_result_subtype(sqlite3_context*,unsigned int);
+
+/*
+** CAPI3REF: Define New Collating Sequences
+** METHOD: sqlite3
+**
+** ^These functions add, remove, or modify a [collation] associated
+** with the [database connection] specified as the first argument.
+**
+** ^The name of the collation is a UTF-8 string
+** for sqlite3_create_collation() and sqlite3_create_collation_v2()
+** and a UTF-16 string in native byte order for sqlite3_create_collation16().
+** ^Collation names that compare equal according to [sqlite3_strnicmp()] are
+** considered to be the same name.
+**
+** ^(The third argument (eTextRep) must be one of the constants:
+**
+** [SQLITE_UTF8],
+** [SQLITE_UTF16LE],
+** [SQLITE_UTF16BE],
+** [SQLITE_UTF16], or
+** [SQLITE_UTF16_ALIGNED].
+** )^
+** ^The eTextRep argument determines the encoding of strings passed
+** to the collating function callback, xCompare.
+** ^The [SQLITE_UTF16] and [SQLITE_UTF16_ALIGNED] values for eTextRep
+** force strings to be UTF16 with native byte order.
+** ^The [SQLITE_UTF16_ALIGNED] value for eTextRep forces strings to begin
+** on an even byte address.
+**
+** ^The fourth argument, pArg, is an application data pointer that is passed
+** through as the first argument to the collating function callback.
+**
+** ^The fifth argument, xCompare, is a pointer to the collating function.
+** ^Multiple collating functions can be registered using the same name but
+** with different eTextRep parameters and SQLite will use whichever
+** function requires the least amount of data transformation.
+** ^If the xCompare argument is NULL then the collating function is
+** deleted. ^When all collating functions having the same name are deleted,
+** that collation is no longer usable.
+**
+** ^The collating function callback is invoked with a copy of the pArg
+** application data pointer and with two strings in the encoding specified
+** by the eTextRep argument. The two integer parameters to the collating
+** function callback are the length of the two strings, in bytes. The collating
+** function must return an integer that is negative, zero, or positive
+** if the first string is less than, equal to, or greater than the second,
+** respectively. A collating function must always return the same answer
+** given the same inputs. If two or more collating functions are registered
+** to the same collation name (using different eTextRep values) then all
+** must give an equivalent answer when invoked with equivalent strings.
+** The collating function must obey the following properties for all
+** strings A, B, and C:
+**
+**
+** If A==B then B==A.
+** If A==B and B==C then A==C.
+** If A<B THEN B>A.
+** If A<B and B<C then A<C.
+**
+**
+** If a collating function fails any of the above constraints and that
+** collating function is registered and used, then the behavior of SQLite
+** is undefined.
+**
+** ^The sqlite3_create_collation_v2() works like sqlite3_create_collation()
+** with the addition that the xDestroy callback is invoked on pArg when
+** the collating function is deleted.
+** ^Collating functions are deleted when they are overridden by later
+** calls to the collation creation functions or when the
+** [database connection] is closed using [sqlite3_close()].
+**
+** ^The xDestroy callback is not called if the
+** sqlite3_create_collation_v2() function fails. Applications that invoke
+** sqlite3_create_collation_v2() with a non-NULL xDestroy argument should
+** check the return code and dispose of the application data pointer
+** themselves rather than expecting SQLite to deal with it for them.
+** This is different from every other SQLite interface. The inconsistency
+** is unfortunate but cannot be changed without breaking backwards
+** compatibility.
+**
+** See also: [sqlite3_collation_needed()] and [sqlite3_collation_needed16()].
+*/
+SQLITE_API int sqlite3_create_collation(
+ sqlite3*,
+ const char *zName,
+ int eTextRep,
+ void *pArg,
+ int(*xCompare)(void*,int,const void*,int,const void*)
+);
+SQLITE_API int sqlite3_create_collation_v2(
+ sqlite3*,
+ const char *zName,
+ int eTextRep,
+ void *pArg,
+ int(*xCompare)(void*,int,const void*,int,const void*),
+ void(*xDestroy)(void*)
+);
+SQLITE_API int sqlite3_create_collation16(
+ sqlite3*,
+ const void *zName,
+ int eTextRep,
+ void *pArg,
+ int(*xCompare)(void*,int,const void*,int,const void*)
+);
+
+/*
+** CAPI3REF: Collation Needed Callbacks
+** METHOD: sqlite3
+**
+** ^To avoid having to register all collation sequences before a database
+** can be used, a single callback function may be registered with the
+** [database connection] to be invoked whenever an undefined collation
+** sequence is required.
+**
+** ^If the function is registered using the sqlite3_collation_needed() API,
+** then it is passed the names of undefined collation sequences as strings
+** encoded in UTF-8. ^If sqlite3_collation_needed16() is used,
+** the names are passed as UTF-16 in machine native byte order.
+** ^A call to either function replaces the existing collation-needed callback.
+**
+** ^(When the callback is invoked, the first argument passed is a copy
+** of the second argument to sqlite3_collation_needed() or
+** sqlite3_collation_needed16(). The second argument is the database
+** connection. The third argument is one of [SQLITE_UTF8], [SQLITE_UTF16BE],
+** or [SQLITE_UTF16LE], indicating the most desirable form of the collation
+** sequence function required. The fourth parameter is the name of the
+** required collation sequence.)^
+**
+** The callback function should register the desired collation using
+** [sqlite3_create_collation()], [sqlite3_create_collation16()], or
+** [sqlite3_create_collation_v2()].
+*/
+SQLITE_API int sqlite3_collation_needed(
+ sqlite3*,
+ void*,
+ void(*)(void*,sqlite3*,int eTextRep,const char*)
+);
+SQLITE_API int sqlite3_collation_needed16(
+ sqlite3*,
+ void*,
+ void(*)(void*,sqlite3*,int eTextRep,const void*)
+);
+
+#ifdef SQLITE_ENABLE_CEROD
+/*
+** Specify the activation key for a CEROD database. Unless
+** activated, none of the CEROD routines will work.
+*/
+SQLITE_API void sqlite3_activate_cerod(
+ const char *zPassPhrase /* Activation phrase */
+);
+#endif
+
+/*
+** CAPI3REF: Suspend Execution For A Short Time
+**
+** The sqlite3_sleep() function causes the current thread to suspend execution
+** for at least a number of milliseconds specified in its parameter.
+**
+** If the operating system does not support sleep requests with
+** millisecond time resolution, then the time will be rounded up to
+** the nearest second. The number of milliseconds of sleep actually
+** requested from the operating system is returned.
+**
+** ^SQLite implements this interface by calling the xSleep()
+** method of the default [sqlite3_vfs] object. If the xSleep() method
+** of the default VFS is not implemented correctly, or not implemented at
+** all, then the behavior of sqlite3_sleep() may deviate from the description
+** in the previous paragraphs.
+**
+** If a negative argument is passed to sqlite3_sleep() the results vary by
+** VFS and operating system. Some system treat a negative argument as an
+** instruction to sleep forever. Others understand it to mean do not sleep
+** at all. ^In SQLite version 3.42.0 and later, a negative
+** argument passed into sqlite3_sleep() is changed to zero before it is relayed
+** down into the xSleep method of the VFS.
+*/
+SQLITE_API int sqlite3_sleep(int);
+
+/*
+** CAPI3REF: Name Of The Folder Holding Temporary Files
+**
+** ^(If this global variable is made to point to a string which is
+** the name of a folder (a.k.a. directory), then all temporary files
+** created by SQLite when using a built-in [sqlite3_vfs | VFS]
+** will be placed in that directory.)^ ^If this variable
+** is a NULL pointer, then SQLite performs a search for an appropriate
+** temporary file directory.
+**
+** Applications are strongly discouraged from using this global variable.
+** It is required to set a temporary folder on Windows Runtime (WinRT).
+** But for all other platforms, it is highly recommended that applications
+** neither read nor write this variable. This global variable is a relic
+** that exists for backwards compatibility of legacy applications and should
+** be avoided in new projects.
+**
+** It is not safe to read or modify this variable in more than one
+** thread at a time. It is not safe to read or modify this variable
+** if a [database connection] is being used at the same time in a separate
+** thread.
+** It is intended that this variable be set once
+** as part of process initialization and before any SQLite interface
+** routines have been called and that this variable remain unchanged
+** thereafter.
+**
+** ^The [temp_store_directory pragma] may modify this variable and cause
+** it to point to memory obtained from [sqlite3_malloc]. ^Furthermore,
+** the [temp_store_directory pragma] always assumes that any string
+** that this variable points to is held in memory obtained from
+** [sqlite3_malloc] and the pragma may attempt to free that memory
+** using [sqlite3_free].
+** Hence, if this variable is modified directly, either it should be
+** made NULL or made to point to memory obtained from [sqlite3_malloc]
+** or else the use of the [temp_store_directory pragma] should be avoided.
+** Except when requested by the [temp_store_directory pragma], SQLite
+** does not free the memory that sqlite3_temp_directory points to. If
+** the application wants that memory to be freed, it must do
+** so itself, taking care to only do so after all [database connection]
+** objects have been destroyed.
+**
+** Note to Windows Runtime users: The temporary directory must be set
+** prior to calling [sqlite3_open] or [sqlite3_open_v2]. Otherwise, various
+** features that require the use of temporary files may fail. Here is an
+** example of how to do this using C++ with the Windows Runtime:
+**
+**
+** LPCWSTR zPath = Windows::Storage::ApplicationData::Current->
+** TemporaryFolder->Path->Data();
+** char zPathBuf[MAX_PATH + 1];
+** memset(zPathBuf, 0, sizeof(zPathBuf));
+** WideCharToMultiByte(CP_UTF8, 0, zPath, -1, zPathBuf, sizeof(zPathBuf),
+** NULL, NULL);
+** sqlite3_temp_directory = sqlite3_mprintf("%s", zPathBuf);
+**
+*/
+SQLITE_API char *sqlite3_temp_directory;
+
+/*
+** CAPI3REF: Name Of The Folder Holding Database Files
+**
+** ^(If this global variable is made to point to a string which is
+** the name of a folder (a.k.a. directory), then all database files
+** specified with a relative pathname and created or accessed by
+** SQLite when using a built-in windows [sqlite3_vfs | VFS] will be assumed
+** to be relative to that directory.)^ ^If this variable is a NULL
+** pointer, then SQLite assumes that all database files specified
+** with a relative pathname are relative to the current directory
+** for the process. Only the windows VFS makes use of this global
+** variable; it is ignored by the unix VFS.
+**
+** Changing the value of this variable while a database connection is
+** open can result in a corrupt database.
+**
+** It is not safe to read or modify this variable in more than one
+** thread at a time. It is not safe to read or modify this variable
+** if a [database connection] is being used at the same time in a separate
+** thread.
+** It is intended that this variable be set once
+** as part of process initialization and before any SQLite interface
+** routines have been called and that this variable remain unchanged
+** thereafter.
+**
+** ^The [data_store_directory pragma] may modify this variable and cause
+** it to point to memory obtained from [sqlite3_malloc]. ^Furthermore,
+** the [data_store_directory pragma] always assumes that any string
+** that this variable points to is held in memory obtained from
+** [sqlite3_malloc] and the pragma may attempt to free that memory
+** using [sqlite3_free].
+** Hence, if this variable is modified directly, either it should be
+** made NULL or made to point to memory obtained from [sqlite3_malloc]
+** or else the use of the [data_store_directory pragma] should be avoided.
+*/
+SQLITE_API char *sqlite3_data_directory;
+
+/*
+** CAPI3REF: Win32 Specific Interface
+**
+** These interfaces are available only on Windows. The
+** [sqlite3_win32_set_directory] interface is used to set the value associated
+** with the [sqlite3_temp_directory] or [sqlite3_data_directory] variable, to
+** zValue, depending on the value of the type parameter. The zValue parameter
+** should be NULL to cause the previous value to be freed via [sqlite3_free];
+** a non-NULL value will be copied into memory obtained from [sqlite3_malloc]
+** prior to being used. The [sqlite3_win32_set_directory] interface returns
+** [SQLITE_OK] to indicate success, [SQLITE_ERROR] if the type is unsupported,
+** or [SQLITE_NOMEM] if memory could not be allocated. The value of the
+** [sqlite3_data_directory] variable is intended to act as a replacement for
+** the current directory on the sub-platforms of Win32 where that concept is
+** not present, e.g. WinRT and UWP. The [sqlite3_win32_set_directory8] and
+** [sqlite3_win32_set_directory16] interfaces behave exactly the same as the
+** sqlite3_win32_set_directory interface except the string parameter must be
+** UTF-8 or UTF-16, respectively.
+*/
+SQLITE_API int sqlite3_win32_set_directory(
+ unsigned long type, /* Identifier for directory being set or reset */
+ void *zValue /* New value for directory being set or reset */
+);
+SQLITE_API int sqlite3_win32_set_directory8(unsigned long type, const char *zValue);
+SQLITE_API int sqlite3_win32_set_directory16(unsigned long type, const void *zValue);
+
+/*
+** CAPI3REF: Win32 Directory Types
+**
+** These macros are only available on Windows. They define the allowed values
+** for the type argument to the [sqlite3_win32_set_directory] interface.
+*/
+#define SQLITE_WIN32_DATA_DIRECTORY_TYPE 1
+#define SQLITE_WIN32_TEMP_DIRECTORY_TYPE 2
+
+/*
+** CAPI3REF: Test For Auto-Commit Mode
+** KEYWORDS: {autocommit mode}
+** METHOD: sqlite3
+**
+** ^The sqlite3_get_autocommit() interface returns non-zero or
+** zero if the given database connection is or is not in autocommit mode,
+** respectively. ^Autocommit mode is on by default.
+** ^Autocommit mode is disabled by a [BEGIN] statement.
+** ^Autocommit mode is re-enabled by a [COMMIT] or [ROLLBACK].
+**
+** If certain kinds of errors occur on a statement within a multi-statement
+** transaction (errors including [SQLITE_FULL], [SQLITE_IOERR],
+** [SQLITE_NOMEM], [SQLITE_BUSY], and [SQLITE_INTERRUPT]) then the
+** transaction might be rolled back automatically. The only way to
+** find out whether SQLite automatically rolled back the transaction after
+** an error is to use this function.
+**
+** If another thread changes the autocommit status of the database
+** connection while this routine is running, then the return value
+** is undefined.
+*/
+SQLITE_API int sqlite3_get_autocommit(sqlite3*);
+
+/*
+** CAPI3REF: Find The Database Handle Of A Prepared Statement
+** METHOD: sqlite3_stmt
+**
+** ^The sqlite3_db_handle interface returns the [database connection] handle
+** to which a [prepared statement] belongs. ^The [database connection]
+** returned by sqlite3_db_handle is the same [database connection]
+** that was the first argument
+** to the [sqlite3_prepare_v2()] call (or its variants) that was used to
+** create the statement in the first place.
+*/
+SQLITE_API sqlite3 *sqlite3_db_handle(sqlite3_stmt*);
+
+/*
+** CAPI3REF: Return The Schema Name For A Database Connection
+** METHOD: sqlite3
+**
+** ^The sqlite3_db_name(D,N) interface returns a pointer to the schema name
+** for the N-th database on database connection D, or a NULL pointer if N is
+** out of range. An N value of 0 means the main database file. An N of 1 is
+** the "temp" schema. Larger values of N correspond to various ATTACH-ed
+** databases.
+**
+** Space to hold the string that is returned by sqlite3_db_name() is managed
+** by SQLite itself. The string might be deallocated by any operation that
+** changes the schema, including [ATTACH] or [DETACH] or calls to
+** [sqlite3_serialize()] or [sqlite3_deserialize()], even operations that
+** occur on a different thread. Applications that need to
+** remember the string long-term should make their own copy. Applications that
+** are accessing the same database connection simultaneously on multiple
+** threads should mutex-protect calls to this API and should make their own
+** private copy of the result prior to releasing the mutex.
+*/
+SQLITE_API const char *sqlite3_db_name(sqlite3 *db, int N);
+
+/*
+** CAPI3REF: Return The Filename For A Database Connection
+** METHOD: sqlite3
+**
+** ^The sqlite3_db_filename(D,N) interface returns a pointer to the filename
+** associated with database N of connection D.
+** ^If there is no attached database N on the database
+** connection D, or if database N is a temporary or in-memory database, then
+** this function will return either a NULL pointer or an empty string.
+**
+** ^The string value returned by this routine is owned and managed by
+** the database connection. ^The value will be valid until the database N
+** is [DETACH]-ed or until the database connection closes.
+**
+** ^The filename returned by this function is the output of the
+** xFullPathname method of the [VFS]. ^In other words, the filename
+** will be an absolute pathname, even if the filename used
+** to open the database originally was a URI or relative pathname.
+**
+** If the filename pointer returned by this routine is not NULL, then it
+** can be used as the filename input parameter to these routines:
+**
+** [sqlite3_uri_parameter()]
+** [sqlite3_uri_boolean()]
+** [sqlite3_uri_int64()]
+** [sqlite3_filename_database()]
+** [sqlite3_filename_journal()]
+** [sqlite3_filename_wal()]
+**
+*/
+SQLITE_API sqlite3_filename sqlite3_db_filename(sqlite3 *db, const char *zDbName);
+
+/*
+** CAPI3REF: Determine if a database is read-only
+** METHOD: sqlite3
+**
+** ^The sqlite3_db_readonly(D,N) interface returns 1 if the database N
+** of connection D is read-only, 0 if it is read/write, or -1 if N is not
+** the name of a database on connection D.
+*/
+SQLITE_API int sqlite3_db_readonly(sqlite3 *db, const char *zDbName);
+
+/*
+** CAPI3REF: Determine the transaction state of a database
+** METHOD: sqlite3
+**
+** ^The sqlite3_txn_state(D,S) interface returns the current
+** [transaction state] of schema S in database connection D. ^If S is NULL,
+** then the highest transaction state of any schema on database connection D
+** is returned. Transaction states are (in order of lowest to highest):
+**
+** SQLITE_TXN_NONE
+** SQLITE_TXN_READ
+** SQLITE_TXN_WRITE
+**
+** ^If the S argument to sqlite3_txn_state(D,S) is not the name of
+** a valid schema, then -1 is returned.
+*/
+SQLITE_API int sqlite3_txn_state(sqlite3*,const char *zSchema);
+
+/*
+** CAPI3REF: Allowed return values from sqlite3_txn_state()
+** KEYWORDS: {transaction state}
+**
+** These constants define the current transaction state of a database file.
+** ^The [sqlite3_txn_state(D,S)] interface returns one of these
+** constants in order to describe the transaction state of schema S
+** in [database connection] D.
+**
+**
+** [[SQLITE_TXN_NONE]] SQLITE_TXN_NONE
+** The SQLITE_TXN_NONE state means that no transaction is currently
+** pending.
+**
+** [[SQLITE_TXN_READ]] SQLITE_TXN_READ
+** The SQLITE_TXN_READ state means that the database is currently
+** in a read transaction. Content has been read from the database file
+** but nothing in the database file has changed. The transaction state
+** will be advanced to SQLITE_TXN_WRITE if any changes occur and there are
+** no other conflicting concurrent write transactions. The transaction
+** state will revert to SQLITE_TXN_NONE following a [ROLLBACK] or
+** [COMMIT].
+**
+** [[SQLITE_TXN_WRITE]] SQLITE_TXN_WRITE
+** The SQLITE_TXN_WRITE state means that the database is currently
+** in a write transaction. Content has been written to the database file
+** but has not yet committed. The transaction state will change to
+** SQLITE_TXN_NONE at the next [ROLLBACK] or [COMMIT].
+*/
+#define SQLITE_TXN_NONE 0
+#define SQLITE_TXN_READ 1
+#define SQLITE_TXN_WRITE 2
+
+/*
+** CAPI3REF: Find the next prepared statement
+** METHOD: sqlite3
+**
+** ^This interface returns a pointer to the next [prepared statement] after
+** pStmt associated with the [database connection] pDb. ^If pStmt is NULL
+** then this interface returns a pointer to the first prepared statement
+** associated with the database connection pDb. ^If no prepared statement
+** satisfies the conditions of this routine, it returns NULL.
+**
+** The [database connection] pointer D in a call to
+** [sqlite3_next_stmt(D,S)] must refer to an open database
+** connection and in particular must not be a NULL pointer.
+*/
+SQLITE_API sqlite3_stmt *sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt);
+
+/*
+** CAPI3REF: Commit And Rollback Notification Callbacks
+** METHOD: sqlite3
+**
+** ^The sqlite3_commit_hook() interface registers a callback
+** function to be invoked whenever a transaction is [COMMIT | committed].
+** ^Any callback set by a previous call to sqlite3_commit_hook()
+** for the same database connection is overridden.
+** ^The sqlite3_rollback_hook() interface registers a callback
+** function to be invoked whenever a transaction is [ROLLBACK | rolled back].
+** ^Any callback set by a previous call to sqlite3_rollback_hook()
+** for the same database connection is overridden.
+** ^The pArg argument is passed through to the callback.
+** ^If the callback on a commit hook function returns non-zero,
+** then the commit is converted into a rollback.
+**
+** ^The sqlite3_commit_hook(D,C,P) and sqlite3_rollback_hook(D,C,P) functions
+** return the P argument from the previous call of the same function
+** on the same [database connection] D, or NULL for
+** the first call for each function on D.
+**
+** The commit and rollback hook callbacks are not reentrant.
+** The callback implementation must not do anything that will modify
+** the database connection that invoked the callback. Any actions
+** to modify the database connection must be deferred until after the
+** completion of the [sqlite3_step()] call that triggered the commit
+** or rollback hook in the first place.
+** Note that running any other SQL statements, including SELECT statements,
+** or merely calling [sqlite3_prepare_v2()] and [sqlite3_step()] will modify
+** the database connections for the meaning of "modify" in this paragraph.
+**
+** ^Registering a NULL function disables the callback.
+**
+** ^When the commit hook callback routine returns zero, the [COMMIT]
+** operation is allowed to continue normally. ^If the commit hook
+** returns non-zero, then the [COMMIT] is converted into a [ROLLBACK].
+** ^The rollback hook is invoked on a rollback that results from a commit
+** hook returning non-zero, just as it would be with any other rollback.
+**
+** ^For the purposes of this API, a transaction is said to have been
+** rolled back if an explicit "ROLLBACK" statement is executed, or
+** an error or constraint causes an implicit rollback to occur.
+** ^The rollback callback is not invoked if a transaction is
+** automatically rolled back because the database connection is closed.
+**
+** See also the [sqlite3_update_hook()] interface.
+*/
+SQLITE_API void *sqlite3_commit_hook(sqlite3*, int(*)(void*), void*);
+SQLITE_API void *sqlite3_rollback_hook(sqlite3*, void(*)(void *), void*);
+
+/*
+** CAPI3REF: Autovacuum Compaction Amount Callback
+** METHOD: sqlite3
+**
+** ^The sqlite3_autovacuum_pages(D,C,P,X) interface registers a callback
+** function C that is invoked prior to each autovacuum of the database
+** file. ^The callback is passed a copy of the generic data pointer (P),
+** the schema-name of the attached database that is being autovacuumed,
+** the size of the database file in pages, the number of free pages,
+** and the number of bytes per page, respectively. The callback should
+** return the number of free pages that should be removed by the
+** autovacuum. ^If the callback returns zero, then no autovacuum happens.
+** ^If the value returned is greater than or equal to the number of
+** free pages, then a complete autovacuum happens.
+**
+** ^If there are multiple ATTACH-ed database files that are being
+** modified as part of a transaction commit, then the autovacuum pages
+** callback is invoked separately for each file.
+**
+**
The callback is not reentrant. The callback function should
+** not attempt to invoke any other SQLite interface. If it does, bad
+** things may happen, including segmentation faults and corrupt database
+** files. The callback function should be a simple function that
+** does some arithmetic on its input parameters and returns a result.
+**
+** ^The X parameter to sqlite3_autovacuum_pages(D,C,P,X) is an optional
+** destructor for the P parameter. ^If X is not NULL, then X(P) is
+** invoked whenever the database connection closes or when the callback
+** is overwritten by another invocation of sqlite3_autovacuum_pages().
+**
+**
^There is only one autovacuum pages callback per database connection.
+** ^Each call to the sqlite3_autovacuum_pages() interface overrides all
+** previous invocations for that database connection. ^If the callback
+** argument (C) to sqlite3_autovacuum_pages(D,C,P,X) is a NULL pointer,
+** then the autovacuum steps callback is canceled. The return value
+** from sqlite3_autovacuum_pages() is normally SQLITE_OK, but might
+** be some other error code if something goes wrong. The current
+** implementation will only return SQLITE_OK or SQLITE_MISUSE, but other
+** return codes might be added in future releases.
+**
+**
If no autovacuum pages callback is specified (the usual case) or
+** a NULL pointer is provided for the callback,
+** then the default behavior is to vacuum all free pages. So, in other
+** words, the default behavior is the same as if the callback function
+** were something like this:
+**
+**
+** unsigned int demonstration_autovac_pages_callback(
+** void *pClientData,
+** const char *zSchema,
+** unsigned int nDbPage,
+** unsigned int nFreePage,
+** unsigned int nBytePerPage
+** ){
+** return nFreePage;
+** }
+**
+*/
+SQLITE_API int sqlite3_autovacuum_pages(
+ sqlite3 *db,
+ unsigned int(*)(void*,const char*,unsigned int,unsigned int,unsigned int),
+ void*,
+ void(*)(void*)
+);
+
+
+/*
+** CAPI3REF: Data Change Notification Callbacks
+** METHOD: sqlite3
+**
+** ^The sqlite3_update_hook() interface registers a callback function
+** with the [database connection] identified by the first argument
+** to be invoked whenever a row is updated, inserted or deleted in
+** a [rowid table].
+** ^Any callback set by a previous call to this function
+** for the same database connection is overridden.
+**
+** ^The second argument is a pointer to the function to invoke when a
+** row is updated, inserted or deleted in a rowid table.
+** ^The update hook is disabled by invoking sqlite3_update_hook()
+** with a NULL pointer as the second parameter.
+** ^The first argument to the callback is a copy of the third argument
+** to sqlite3_update_hook().
+** ^The second callback argument is one of [SQLITE_INSERT], [SQLITE_DELETE],
+** or [SQLITE_UPDATE], depending on the operation that caused the callback
+** to be invoked.
+** ^The third and fourth arguments to the callback contain pointers to the
+** database and table name containing the affected row.
+** ^The final callback parameter is the [rowid] of the row.
+** ^In the case of an update, this is the [rowid] after the update takes place.
+**
+** ^(The update hook is not invoked when internal system tables are
+** modified (i.e. sqlite_sequence).)^
+** ^The update hook is not invoked when [WITHOUT ROWID] tables are modified.
+**
+** ^In the current implementation, the update hook
+** is not invoked when conflicting rows are deleted because of an
+** [ON CONFLICT | ON CONFLICT REPLACE] clause. ^Nor is the update hook
+** invoked when rows are deleted using the [truncate optimization].
+** The exceptions defined in this paragraph might change in a future
+** release of SQLite.
+**
+** Whether the update hook is invoked before or after the
+** corresponding change is currently unspecified and may differ
+** depending on the type of change. Do not rely on the order of the
+** hook call with regards to the final result of the operation which
+** triggers the hook.
+**
+** The update hook implementation must not do anything that will modify
+** the database connection that invoked the update hook. Any actions
+** to modify the database connection must be deferred until after the
+** completion of the [sqlite3_step()] call that triggered the update hook.
+** Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their
+** database connections for the meaning of "modify" in this paragraph.
+**
+** ^The sqlite3_update_hook(D,C,P) function
+** returns the P argument from the previous call
+** on the same [database connection] D, or NULL for
+** the first call on D.
+**
+** See also the [sqlite3_commit_hook()], [sqlite3_rollback_hook()],
+** and [sqlite3_preupdate_hook()] interfaces.
+*/
+SQLITE_API void *sqlite3_update_hook(
+ sqlite3*,
+ void(*)(void *,int ,char const *,char const *,sqlite3_int64),
+ void*
+);
+
+/*
+** CAPI3REF: Enable Or Disable Shared Pager Cache
+**
+** ^(This routine enables or disables the sharing of the database cache
+** and schema data structures between [database connection | connections]
+** to the same database. Sharing is enabled if the argument is true
+** and disabled if the argument is false.)^
+**
+** This interface is omitted if SQLite is compiled with
+** [-DSQLITE_OMIT_SHARED_CACHE]. The [-DSQLITE_OMIT_SHARED_CACHE]
+** compile-time option is recommended because the
+** [use of shared cache mode is discouraged].
+**
+** ^Cache sharing is enabled and disabled for an entire process.
+** This is a change as of SQLite [version 3.5.0] ([dateof:3.5.0]).
+** In prior versions of SQLite,
+** sharing was enabled or disabled for each thread separately.
+**
+** ^(The cache sharing mode set by this interface effects all subsequent
+** calls to [sqlite3_open()], [sqlite3_open_v2()], and [sqlite3_open16()].
+** Existing database connections continue to use the sharing mode
+** that was in effect at the time they were opened.)^
+**
+** ^(This routine returns [SQLITE_OK] if shared cache was enabled or disabled
+** successfully. An [error code] is returned otherwise.)^
+**
+** ^Shared cache is disabled by default. It is recommended that it stay
+** that way. In other words, do not use this routine. This interface
+** continues to be provided for historical compatibility, but its use is
+** discouraged. Any use of shared cache is discouraged. If shared cache
+** must be used, it is recommended that shared cache only be enabled for
+** individual database connections using the [sqlite3_open_v2()] interface
+** with the [SQLITE_OPEN_SHAREDCACHE] flag.
+**
+** Note: This method is disabled on MacOS X 10.7 and iOS version 5.0
+** and will always return SQLITE_MISUSE. On those systems,
+** shared cache mode should be enabled per-database connection via
+** [sqlite3_open_v2()] with [SQLITE_OPEN_SHAREDCACHE].
+**
+** This interface is threadsafe on processors where writing a
+** 32-bit integer is atomic.
+**
+** See Also: [SQLite Shared-Cache Mode]
+*/
+SQLITE_API int sqlite3_enable_shared_cache(int);
+
+/*
+** CAPI3REF: Attempt To Free Heap Memory
+**
+** ^The sqlite3_release_memory() interface attempts to free N bytes
+** of heap memory by deallocating non-essential memory allocations
+** held by the database library. Memory used to cache database
+** pages to improve performance is an example of non-essential memory.
+** ^sqlite3_release_memory() returns the number of bytes actually freed,
+** which might be more or less than the amount requested.
+** ^The sqlite3_release_memory() routine is a no-op returning zero
+** if SQLite is not compiled with [SQLITE_ENABLE_MEMORY_MANAGEMENT].
+**
+** See also: [sqlite3_db_release_memory()]
+*/
+SQLITE_API int sqlite3_release_memory(int);
+
+/*
+** CAPI3REF: Free Memory Used By A Database Connection
+** METHOD: sqlite3
+**
+** ^The sqlite3_db_release_memory(D) interface attempts to free as much heap
+** memory as possible from database connection D. Unlike the
+** [sqlite3_release_memory()] interface, this interface is in effect even
+** when the [SQLITE_ENABLE_MEMORY_MANAGEMENT] compile-time option is
+** omitted.
+**
+** See also: [sqlite3_release_memory()]
+*/
+SQLITE_API int sqlite3_db_release_memory(sqlite3*);
+
+/*
+** CAPI3REF: Impose A Limit On Heap Size
+**
+** These interfaces impose limits on the amount of heap memory that will be
+** used by all database connections within a single process.
+**
+** ^The sqlite3_soft_heap_limit64() interface sets and/or queries the
+** soft limit on the amount of heap memory that may be allocated by SQLite.
+** ^SQLite strives to keep heap memory utilization below the soft heap
+** limit by reducing the number of pages held in the page cache
+** as heap memory usages approaches the limit.
+** ^The soft heap limit is "soft" because even though SQLite strives to stay
+** below the limit, it will exceed the limit rather than generate
+** an [SQLITE_NOMEM] error. In other words, the soft heap limit
+** is advisory only.
+**
+** ^The sqlite3_hard_heap_limit64(N) interface sets a hard upper bound of
+** N bytes on the amount of memory that will be allocated. ^The
+** sqlite3_hard_heap_limit64(N) interface is similar to
+** sqlite3_soft_heap_limit64(N) except that memory allocations will fail
+** when the hard heap limit is reached.
+**
+** ^The return value from both sqlite3_soft_heap_limit64() and
+** sqlite3_hard_heap_limit64() is the size of
+** the heap limit prior to the call, or negative in the case of an
+** error. ^If the argument N is negative
+** then no change is made to the heap limit. Hence, the current
+** size of heap limits can be determined by invoking
+** sqlite3_soft_heap_limit64(-1) or sqlite3_hard_heap_limit(-1).
+**
+** ^Setting the heap limits to zero disables the heap limiter mechanism.
+**
+** ^The soft heap limit may not be greater than the hard heap limit.
+** ^If the hard heap limit is enabled and if sqlite3_soft_heap_limit(N)
+** is invoked with a value of N that is greater than the hard heap limit,
+** the soft heap limit is set to the value of the hard heap limit.
+** ^The soft heap limit is automatically enabled whenever the hard heap
+** limit is enabled. ^When sqlite3_hard_heap_limit64(N) is invoked and
+** the soft heap limit is outside the range of 1..N, then the soft heap
+** limit is set to N. ^Invoking sqlite3_soft_heap_limit64(0) when the
+** hard heap limit is enabled makes the soft heap limit equal to the
+** hard heap limit.
+**
+** The memory allocation limits can also be adjusted using
+** [PRAGMA soft_heap_limit] and [PRAGMA hard_heap_limit].
+**
+** ^(The heap limits are not enforced in the current implementation
+** if one or more of following conditions are true:
+**
+**
+** The limit value is set to zero.
+** Memory accounting is disabled using a combination of the
+** [sqlite3_config]([SQLITE_CONFIG_MEMSTATUS],...) start-time option and
+** the [SQLITE_DEFAULT_MEMSTATUS] compile-time option.
+** An alternative page cache implementation is specified using
+** [sqlite3_config]([SQLITE_CONFIG_PCACHE2],...).
+** The page cache allocates from its own memory pool supplied
+** by [sqlite3_config]([SQLITE_CONFIG_PAGECACHE],...) rather than
+** from the heap.
+** )^
+**
+** The circumstances under which SQLite will enforce the heap limits may
+** change in future releases of SQLite.
+*/
+SQLITE_API sqlite3_int64 sqlite3_soft_heap_limit64(sqlite3_int64 N);
+SQLITE_API sqlite3_int64 sqlite3_hard_heap_limit64(sqlite3_int64 N);
+
+/*
+** CAPI3REF: Deprecated Soft Heap Limit Interface
+** DEPRECATED
+**
+** This is a deprecated version of the [sqlite3_soft_heap_limit64()]
+** interface. This routine is provided for historical compatibility
+** only. All new applications should use the
+** [sqlite3_soft_heap_limit64()] interface rather than this one.
+*/
+SQLITE_API SQLITE_DEPRECATED void sqlite3_soft_heap_limit(int N);
+
+
+/*
+** CAPI3REF: Extract Metadata About A Column Of A Table
+** METHOD: sqlite3
+**
+** ^(The sqlite3_table_column_metadata(X,D,T,C,....) routine returns
+** information about column C of table T in database D
+** on [database connection] X.)^ ^The sqlite3_table_column_metadata()
+** interface returns SQLITE_OK and fills in the non-NULL pointers in
+** the final five arguments with appropriate values if the specified
+** column exists. ^The sqlite3_table_column_metadata() interface returns
+** SQLITE_ERROR if the specified column does not exist.
+** ^If the column-name parameter to sqlite3_table_column_metadata() is a
+** NULL pointer, then this routine simply checks for the existence of the
+** table and returns SQLITE_OK if the table exists and SQLITE_ERROR if it
+** does not. If the table name parameter T in a call to
+** sqlite3_table_column_metadata(X,D,T,C,...) is NULL then the result is
+** undefined behavior.
+**
+** ^The column is identified by the second, third and fourth parameters to
+** this function. ^(The second parameter is either the name of the database
+** (i.e. "main", "temp", or an attached database) containing the specified
+** table or NULL.)^ ^If it is NULL, then all attached databases are searched
+** for the table using the same algorithm used by the database engine to
+** resolve unqualified table references.
+**
+** ^The third and fourth parameters to this function are the table and column
+** name of the desired column, respectively.
+**
+** ^Metadata is returned by writing to the memory locations passed as the 5th
+** and subsequent parameters to this function. ^Any of these arguments may be
+** NULL, in which case the corresponding element of metadata is omitted.
+**
+** ^(
+**
+** Parameter Output Type Description
+**
+** 5th const char* Data type
+** 6th const char* Name of default collation sequence
+** 7th int True if column has a NOT NULL constraint
+** 8th int True if column is part of the PRIMARY KEY
+** 9th int True if column is [AUTOINCREMENT]
+**
+** )^
+**
+** ^The memory pointed to by the character pointers returned for the
+** declaration type and collation sequence is valid until the next
+** call to any SQLite API function.
+**
+** ^If the specified table is actually a view, an [error code] is returned.
+**
+** ^If the specified column is "rowid", "oid" or "_rowid_" and the table
+** is not a [WITHOUT ROWID] table and an
+** [INTEGER PRIMARY KEY] column has been explicitly declared, then the output
+** parameters are set for the explicitly declared column. ^(If there is no
+** [INTEGER PRIMARY KEY] column, then the outputs
+** for the [rowid] are set as follows:
+**
+**
+** data type: "INTEGER"
+** collation sequence: "BINARY"
+** not null: 0
+** primary key: 1
+** auto increment: 0
+** )^
+**
+** ^This function causes all database schemas to be read from disk and
+** parsed, if that has not already been done, and returns an error if
+** any errors are encountered while loading the schema.
+*/
+SQLITE_API int sqlite3_table_column_metadata(
+ sqlite3 *db, /* Connection handle */
+ const char *zDbName, /* Database name or NULL */
+ const char *zTableName, /* Table name */
+ const char *zColumnName, /* Column name */
+ char const **pzDataType, /* OUTPUT: Declared data type */
+ char const **pzCollSeq, /* OUTPUT: Collation sequence name */
+ int *pNotNull, /* OUTPUT: True if NOT NULL constraint exists */
+ int *pPrimaryKey, /* OUTPUT: True if column part of PK */
+ int *pAutoinc /* OUTPUT: True if column is auto-increment */
+);
+
+/*
+** CAPI3REF: Load An Extension
+** METHOD: sqlite3
+**
+** ^This interface loads an SQLite extension library from the named file.
+**
+** ^The sqlite3_load_extension() interface attempts to load an
+** [SQLite extension] library contained in the file zFile. If
+** the file cannot be loaded directly, attempts are made to load
+** with various operating-system specific extensions added.
+** So for example, if "samplelib" cannot be loaded, then names like
+** "samplelib.so" or "samplelib.dylib" or "samplelib.dll" might
+** be tried also.
+**
+** ^The entry point is zProc.
+** ^(zProc may be 0, in which case SQLite will try to come up with an
+** entry point name on its own. It first tries "sqlite3_extension_init".
+** If that does not work, it constructs a name "sqlite3_X_init" where
+** X consists of the lower-case equivalent of all ASCII alphabetic
+** characters in the filename from the last "/" to the first following
+** "." and omitting any initial "lib".)^
+** ^The sqlite3_load_extension() interface returns
+** [SQLITE_OK] on success and [SQLITE_ERROR] if something goes wrong.
+** ^If an error occurs and pzErrMsg is not 0, then the
+** [sqlite3_load_extension()] interface shall attempt to
+** fill *pzErrMsg with error message text stored in memory
+** obtained from [sqlite3_malloc()]. The calling function
+** should free this memory by calling [sqlite3_free()].
+**
+** ^Extension loading must be enabled using
+** [sqlite3_enable_load_extension()] or
+** [sqlite3_db_config](db,[SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION],1,NULL)
+** prior to calling this API,
+** otherwise an error will be returned.
+**
+** Security warning: It is recommended that the
+** [SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION] method be used to enable only this
+** interface. The use of the [sqlite3_enable_load_extension()] interface
+** should be avoided. This will keep the SQL function [load_extension()]
+** disabled and prevent SQL injections from giving attackers
+** access to extension loading capabilities.
+**
+** See also the [load_extension() SQL function].
+*/
+SQLITE_API int sqlite3_load_extension(
+ sqlite3 *db, /* Load the extension into this database connection */
+ const char *zFile, /* Name of the shared library containing extension */
+ const char *zProc, /* Entry point. Derived from zFile if 0 */
+ char **pzErrMsg /* Put error message here if not 0 */
+);
+
+/*
+** CAPI3REF: Enable Or Disable Extension Loading
+** METHOD: sqlite3
+**
+** ^So as not to open security holes in older applications that are
+** unprepared to deal with [extension loading], and as a means of disabling
+** [extension loading] while evaluating user-entered SQL, the following API
+** is provided to turn the [sqlite3_load_extension()] mechanism on and off.
+**
+** ^Extension loading is off by default.
+** ^Call the sqlite3_enable_load_extension() routine with onoff==1
+** to turn extension loading on and call it with onoff==0 to turn
+** it back off again.
+**
+** ^This interface enables or disables both the C-API
+** [sqlite3_load_extension()] and the SQL function [load_extension()].
+** ^(Use [sqlite3_db_config](db,[SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION],..)
+** to enable or disable only the C-API.)^
+**
+** Security warning: It is recommended that extension loading
+** be enabled using the [SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION] method
+** rather than this interface, so the [load_extension()] SQL function
+** remains disabled. This will prevent SQL injections from giving attackers
+** access to extension loading capabilities.
+*/
+SQLITE_API int sqlite3_enable_load_extension(sqlite3 *db, int onoff);
+
+/*
+** CAPI3REF: Automatically Load Statically Linked Extensions
+**
+** ^This interface causes the xEntryPoint() function to be invoked for
+** each new [database connection] that is created. The idea here is that
+** xEntryPoint() is the entry point for a statically linked [SQLite extension]
+** that is to be automatically loaded into all new database connections.
+**
+** ^(Even though the function prototype shows that xEntryPoint() takes
+** no arguments and returns void, SQLite invokes xEntryPoint() with three
+** arguments and expects an integer result as if the signature of the
+** entry point were as follows:
+**
+**
+** int xEntryPoint(
+** sqlite3 *db,
+** const char **pzErrMsg,
+** const struct sqlite3_api_routines *pThunk
+** );
+** )^
+**
+** If the xEntryPoint routine encounters an error, it should make *pzErrMsg
+** point to an appropriate error message (obtained from [sqlite3_mprintf()])
+** and return an appropriate [error code]. ^SQLite ensures that *pzErrMsg
+** is NULL before calling the xEntryPoint(). ^SQLite will invoke
+** [sqlite3_free()] on *pzErrMsg after xEntryPoint() returns. ^If any
+** xEntryPoint() returns an error, the [sqlite3_open()], [sqlite3_open16()],
+** or [sqlite3_open_v2()] call that provoked the xEntryPoint() will fail.
+**
+** ^Calling sqlite3_auto_extension(X) with an entry point X that is already
+** on the list of automatic extensions is a harmless no-op. ^No entry point
+** will be called more than once for each database connection that is opened.
+**
+** See also: [sqlite3_reset_auto_extension()]
+** and [sqlite3_cancel_auto_extension()]
+*/
+SQLITE_API int sqlite3_auto_extension(void(*xEntryPoint)(void));
+
+/*
+** CAPI3REF: Cancel Automatic Extension Loading
+**
+** ^The [sqlite3_cancel_auto_extension(X)] interface unregisters the
+** initialization routine X that was registered using a prior call to
+** [sqlite3_auto_extension(X)]. ^The [sqlite3_cancel_auto_extension(X)]
+** routine returns 1 if initialization routine X was successfully
+** unregistered and it returns 0 if X was not on the list of initialization
+** routines.
+*/
+SQLITE_API int sqlite3_cancel_auto_extension(void(*xEntryPoint)(void));
+
+/*
+** CAPI3REF: Reset Automatic Extension Loading
+**
+** ^This interface disables all automatic extensions previously
+** registered using [sqlite3_auto_extension()].
+*/
+SQLITE_API void sqlite3_reset_auto_extension(void);
+
+/*
+** Structures used by the virtual table interface
+*/
+typedef struct sqlite3_vtab sqlite3_vtab;
+typedef struct sqlite3_index_info sqlite3_index_info;
+typedef struct sqlite3_vtab_cursor sqlite3_vtab_cursor;
+typedef struct sqlite3_module sqlite3_module;
+
+/*
+** CAPI3REF: Virtual Table Object
+** KEYWORDS: sqlite3_module {virtual table module}
+**
+** This structure, sometimes called a "virtual table module",
+** defines the implementation of a [virtual table].
+** This structure consists mostly of methods for the module.
+**
+** ^A virtual table module is created by filling in a persistent
+** instance of this structure and passing a pointer to that instance
+** to [sqlite3_create_module()] or [sqlite3_create_module_v2()].
+** ^The registration remains valid until it is replaced by a different
+** module or until the [database connection] closes. The content
+** of this structure must not change while it is registered with
+** any database connection.
+*/
+struct sqlite3_module {
+ int iVersion;
+ int (*xCreate)(sqlite3*, void *pAux,
+ int argc, const char *const*argv,
+ sqlite3_vtab **ppVTab, char**);
+ int (*xConnect)(sqlite3*, void *pAux,
+ int argc, const char *const*argv,
+ sqlite3_vtab **ppVTab, char**);
+ int (*xBestIndex)(sqlite3_vtab *pVTab, sqlite3_index_info*);
+ int (*xDisconnect)(sqlite3_vtab *pVTab);
+ int (*xDestroy)(sqlite3_vtab *pVTab);
+ int (*xOpen)(sqlite3_vtab *pVTab, sqlite3_vtab_cursor **ppCursor);
+ int (*xClose)(sqlite3_vtab_cursor*);
+ int (*xFilter)(sqlite3_vtab_cursor*, int idxNum, const char *idxStr,
+ int argc, sqlite3_value **argv);
+ int (*xNext)(sqlite3_vtab_cursor*);
+ int (*xEof)(sqlite3_vtab_cursor*);
+ int (*xColumn)(sqlite3_vtab_cursor*, sqlite3_context*, int);
+ int (*xRowid)(sqlite3_vtab_cursor*, sqlite3_int64 *pRowid);
+ int (*xUpdate)(sqlite3_vtab *, int, sqlite3_value **, sqlite3_int64 *);
+ int (*xBegin)(sqlite3_vtab *pVTab);
+ int (*xSync)(sqlite3_vtab *pVTab);
+ int (*xCommit)(sqlite3_vtab *pVTab);
+ int (*xRollback)(sqlite3_vtab *pVTab);
+ int (*xFindFunction)(sqlite3_vtab *pVtab, int nArg, const char *zName,
+ void (**pxFunc)(sqlite3_context*,int,sqlite3_value**),
+ void **ppArg);
+ int (*xRename)(sqlite3_vtab *pVtab, const char *zNew);
+ /* The methods above are in version 1 of the sqlite_module object. Those
+ ** below are for version 2 and greater. */
+ int (*xSavepoint)(sqlite3_vtab *pVTab, int);
+ int (*xRelease)(sqlite3_vtab *pVTab, int);
+ int (*xRollbackTo)(sqlite3_vtab *pVTab, int);
+ /* The methods above are in versions 1 and 2 of the sqlite_module object.
+ ** Those below are for version 3 and greater. */
+ int (*xShadowName)(const char*);
+ /* The methods above are in versions 1 through 3 of the sqlite_module object.
+ ** Those below are for version 4 and greater. */
+ int (*xIntegrity)(sqlite3_vtab *pVTab, const char *zSchema,
+ const char *zTabName, int mFlags, char **pzErr);
+};
+
+/*
+** CAPI3REF: Virtual Table Indexing Information
+** KEYWORDS: sqlite3_index_info
+**
+** The sqlite3_index_info structure and its substructures is used as part
+** of the [virtual table] interface to
+** pass information into and receive the reply from the [xBestIndex]
+** method of a [virtual table module]. The fields under **Inputs** are the
+** inputs to xBestIndex and are read-only. xBestIndex inserts its
+** results into the **Outputs** fields.
+**
+** ^(The aConstraint[] array records WHERE clause constraints of the form:
+**
+** column OP expr
+**
+** where OP is =, <, <=, >, or >=.)^ ^(The particular operator is
+** stored in aConstraint[].op using one of the
+** [SQLITE_INDEX_CONSTRAINT_EQ | SQLITE_INDEX_CONSTRAINT_ values].)^
+** ^(The index of the column is stored in
+** aConstraint[].iColumn.)^ ^(aConstraint[].usable is TRUE if the
+** expr on the right-hand side can be evaluated (and thus the constraint
+** is usable) and false if it cannot.)^
+**
+** ^The optimizer automatically inverts terms of the form "expr OP column"
+** and makes other simplifications to the WHERE clause in an attempt to
+** get as many WHERE clause terms into the form shown above as possible.
+** ^The aConstraint[] array only reports WHERE clause terms that are
+** relevant to the particular virtual table being queried.
+**
+** ^Information about the ORDER BY clause is stored in aOrderBy[].
+** ^Each term of aOrderBy records a column of the ORDER BY clause.
+**
+** The colUsed field indicates which columns of the virtual table may be
+** required by the current scan. Virtual table columns are numbered from
+** zero in the order in which they appear within the CREATE TABLE statement
+** passed to sqlite3_declare_vtab(). For the first 63 columns (columns 0-62),
+** the corresponding bit is set within the colUsed mask if the column may be
+** required by SQLite. If the table has at least 64 columns and any column
+** to the right of the first 63 is required, then bit 63 of colUsed is also
+** set. In other words, column iCol may be required if the expression
+** (colUsed & ((sqlite3_uint64)1 << (iCol>=63 ? 63 : iCol))) evaluates to
+** non-zero.
+**
+** The [xBestIndex] method must fill aConstraintUsage[] with information
+** about what parameters to pass to xFilter. ^If argvIndex>0 then
+** the right-hand side of the corresponding aConstraint[] is evaluated
+** and becomes the argvIndex-th entry in argv. ^(If aConstraintUsage[].omit
+** is true, then the constraint is assumed to be fully handled by the
+** virtual table and might not be checked again by the byte code.)^ ^(The
+** aConstraintUsage[].omit flag is an optimization hint. When the omit flag
+** is left in its default setting of false, the constraint will always be
+** checked separately in byte code. If the omit flag is changed to true, then
+** the constraint may or may not be checked in byte code. In other words,
+** when the omit flag is true there is no guarantee that the constraint will
+** not be checked again using byte code.)^
+**
+** ^The idxNum and idxStr values are recorded and passed into the
+** [xFilter] method.
+** ^[sqlite3_free()] is used to free idxStr if and only if
+** needToFreeIdxStr is true.
+**
+** ^The orderByConsumed means that output from [xFilter]/[xNext] will occur in
+** the correct order to satisfy the ORDER BY clause so that no separate
+** sorting step is required.
+**
+** ^The estimatedCost value is an estimate of the cost of a particular
+** strategy. A cost of N indicates that the cost of the strategy is similar
+** to a linear scan of an SQLite table with N rows. A cost of log(N)
+** indicates that the expense of the operation is similar to that of a
+** binary search on a unique indexed field of an SQLite table with N rows.
+**
+** ^The estimatedRows value is an estimate of the number of rows that
+** will be returned by the strategy.
+**
+** The xBestIndex method may optionally populate the idxFlags field with a
+** mask of SQLITE_INDEX_SCAN_* flags. One such flag is
+** [SQLITE_INDEX_SCAN_HEX], which if set causes the [EXPLAIN QUERY PLAN]
+** output to show the idxNum as hex instead of as decimal. Another flag is
+** SQLITE_INDEX_SCAN_UNIQUE, which if set indicates that the query plan will
+** return at most one row.
+**
+** Additionally, if xBestIndex sets the SQLITE_INDEX_SCAN_UNIQUE flag, then
+** SQLite also assumes that if a call to the xUpdate() method is made as
+** part of the same statement to delete or update a virtual table row and the
+** implementation returns SQLITE_CONSTRAINT, then there is no need to rollback
+** any database changes. In other words, if the xUpdate() returns
+** SQLITE_CONSTRAINT, the database contents must be exactly as they were
+** before xUpdate was called. By contrast, if SQLITE_INDEX_SCAN_UNIQUE is not
+** set and xUpdate returns SQLITE_CONSTRAINT, any database changes made by
+** the xUpdate method are automatically rolled back by SQLite.
+**
+** IMPORTANT: The estimatedRows field was added to the sqlite3_index_info
+** structure for SQLite [version 3.8.2] ([dateof:3.8.2]).
+** If a virtual table extension is
+** used with an SQLite version earlier than 3.8.2, the results of attempting
+** to read or write the estimatedRows field are undefined (but are likely
+** to include crashing the application). The estimatedRows field should
+** therefore only be used if [sqlite3_libversion_number()] returns a
+** value greater than or equal to 3008002. Similarly, the idxFlags field
+** was added for [version 3.9.0] ([dateof:3.9.0]).
+** It may therefore only be used if
+** sqlite3_libversion_number() returns a value greater than or equal to
+** 3009000.
+*/
+struct sqlite3_index_info {
+ /* Inputs */
+ int nConstraint; /* Number of entries in aConstraint */
+ struct sqlite3_index_constraint {
+ int iColumn; /* Column constrained. -1 for ROWID */
+ unsigned char op; /* Constraint operator */
+ unsigned char usable; /* True if this constraint is usable */
+ int iTermOffset; /* Used internally - xBestIndex should ignore */
+ } *aConstraint; /* Table of WHERE clause constraints */
+ int nOrderBy; /* Number of terms in the ORDER BY clause */
+ struct sqlite3_index_orderby {
+ int iColumn; /* Column number */
+ unsigned char desc; /* True for DESC. False for ASC. */
+ } *aOrderBy; /* The ORDER BY clause */
+ /* Outputs */
+ struct sqlite3_index_constraint_usage {
+ int argvIndex; /* if >0, constraint is part of argv to xFilter */
+ unsigned char omit; /* Do not code a test for this constraint */
+ } *aConstraintUsage;
+ int idxNum; /* Number used to identify the index */
+ char *idxStr; /* String, possibly obtained from sqlite3_malloc */
+ int needToFreeIdxStr; /* Free idxStr using sqlite3_free() if true */
+ int orderByConsumed; /* True if output is already ordered */
+ double estimatedCost; /* Estimated cost of using this index */
+ /* Fields below are only available in SQLite 3.8.2 and later */
+ sqlite3_int64 estimatedRows; /* Estimated number of rows returned */
+ /* Fields below are only available in SQLite 3.9.0 and later */
+ int idxFlags; /* Mask of SQLITE_INDEX_SCAN_* flags */
+ /* Fields below are only available in SQLite 3.10.0 and later */
+ sqlite3_uint64 colUsed; /* Input: Mask of columns used by statement */
+};
+
+/*
+** CAPI3REF: Virtual Table Scan Flags
+**
+** Virtual table implementations are allowed to set the
+** [sqlite3_index_info].idxFlags field to some combination of
+** these bits.
+*/
+#define SQLITE_INDEX_SCAN_UNIQUE 0x00000001 /* Scan visits at most 1 row */
+#define SQLITE_INDEX_SCAN_HEX 0x00000002 /* Display idxNum as hex */
+ /* in EXPLAIN QUERY PLAN */
+
+/*
+** CAPI3REF: Virtual Table Constraint Operator Codes
+**
+** These macros define the allowed values for the
+** [sqlite3_index_info].aConstraint[].op field. Each value represents
+** an operator that is part of a constraint term in the WHERE clause of
+** a query that uses a [virtual table].
+**
+** ^The left-hand operand of the operator is given by the corresponding
+** aConstraint[].iColumn field. ^An iColumn of -1 indicates the left-hand
+** operand is the rowid.
+** The SQLITE_INDEX_CONSTRAINT_LIMIT and SQLITE_INDEX_CONSTRAINT_OFFSET
+** operators have no left-hand operand, and so for those operators the
+** corresponding aConstraint[].iColumn is meaningless and should not be
+** used.
+**
+** All operator values from SQLITE_INDEX_CONSTRAINT_FUNCTION through
+** value 255 are reserved to represent functions that are overloaded
+** by the [xFindFunction|xFindFunction method] of the virtual table
+** implementation.
+**
+** The right-hand operands for each constraint might be accessible using
+** the [sqlite3_vtab_rhs_value()] interface. Usually the right-hand
+** operand is only available if it appears as a single constant literal
+** in the input SQL. If the right-hand operand is another column or an
+** expression (even a constant expression) or a parameter, then the
+** sqlite3_vtab_rhs_value() probably will not be able to extract it.
+** ^The SQLITE_INDEX_CONSTRAINT_ISNULL and
+** SQLITE_INDEX_CONSTRAINT_ISNOTNULL operators have no right-hand operand
+** and hence calls to sqlite3_vtab_rhs_value() for those operators will
+** always return SQLITE_NOTFOUND.
+**
+** The collating sequence to be used for comparison can be found using
+** the [sqlite3_vtab_collation()] interface. For most real-world virtual
+** tables, the collating sequence of constraints does not matter (for example
+** because the constraints are numeric) and so the sqlite3_vtab_collation()
+** interface is not commonly needed.
+*/
+#define SQLITE_INDEX_CONSTRAINT_EQ 2
+#define SQLITE_INDEX_CONSTRAINT_GT 4
+#define SQLITE_INDEX_CONSTRAINT_LE 8
+#define SQLITE_INDEX_CONSTRAINT_LT 16
+#define SQLITE_INDEX_CONSTRAINT_GE 32
+#define SQLITE_INDEX_CONSTRAINT_MATCH 64
+#define SQLITE_INDEX_CONSTRAINT_LIKE 65
+#define SQLITE_INDEX_CONSTRAINT_GLOB 66
+#define SQLITE_INDEX_CONSTRAINT_REGEXP 67
+#define SQLITE_INDEX_CONSTRAINT_NE 68
+#define SQLITE_INDEX_CONSTRAINT_ISNOT 69
+#define SQLITE_INDEX_CONSTRAINT_ISNOTNULL 70
+#define SQLITE_INDEX_CONSTRAINT_ISNULL 71
+#define SQLITE_INDEX_CONSTRAINT_IS 72
+#define SQLITE_INDEX_CONSTRAINT_LIMIT 73
+#define SQLITE_INDEX_CONSTRAINT_OFFSET 74
+#define SQLITE_INDEX_CONSTRAINT_FUNCTION 150
+
+/*
+** CAPI3REF: Register A Virtual Table Implementation
+** METHOD: sqlite3
+**
+** ^These routines are used to register a new [virtual table module] name.
+** ^Module names must be registered before
+** creating a new [virtual table] using the module and before using a
+** preexisting [virtual table] for the module.
+**
+** ^The module name is registered on the [database connection] specified
+** by the first parameter. ^The name of the module is given by the
+** second parameter. ^The third parameter is a pointer to
+** the implementation of the [virtual table module]. ^The fourth
+** parameter is an arbitrary client data pointer that is passed through
+** into the [xCreate] and [xConnect] methods of the virtual table module
+** when a new virtual table is being created or reinitialized.
+**
+** ^The sqlite3_create_module_v2() interface has a fifth parameter which
+** is a pointer to a destructor for the pClientData. ^SQLite will
+** invoke the destructor function (if it is not NULL) when SQLite
+** no longer needs the pClientData pointer. ^The destructor will also
+** be invoked if the call to sqlite3_create_module_v2() fails.
+** ^The sqlite3_create_module()
+** interface is equivalent to sqlite3_create_module_v2() with a NULL
+** destructor.
+**
+** ^If the third parameter (the pointer to the sqlite3_module object) is
+** NULL then no new module is created and any existing modules with the
+** same name are dropped.
+**
+** See also: [sqlite3_drop_modules()]
+*/
+SQLITE_API int sqlite3_create_module(
+ sqlite3 *db, /* SQLite connection to register module with */
+ const char *zName, /* Name of the module */
+ const sqlite3_module *p, /* Methods for the module */
+ void *pClientData /* Client data for xCreate/xConnect */
+);
+SQLITE_API int sqlite3_create_module_v2(
+ sqlite3 *db, /* SQLite connection to register module with */
+ const char *zName, /* Name of the module */
+ const sqlite3_module *p, /* Methods for the module */
+ void *pClientData, /* Client data for xCreate/xConnect */
+ void(*xDestroy)(void*) /* Module destructor function */
+);
+
+/*
+** CAPI3REF: Remove Unnecessary Virtual Table Implementations
+** METHOD: sqlite3
+**
+** ^The sqlite3_drop_modules(D,L) interface removes all virtual
+** table modules from database connection D except those named on list L.
+** The L parameter must be either NULL or a pointer to an array of pointers
+** to strings where the array is terminated by a single NULL pointer.
+** ^If the L parameter is NULL, then all virtual table modules are removed.
+**
+** See also: [sqlite3_create_module()]
+*/
+SQLITE_API int sqlite3_drop_modules(
+ sqlite3 *db, /* Remove modules from this connection */
+ const char **azKeep /* Except, do not remove the ones named here */
+);
+
+/*
+** CAPI3REF: Virtual Table Instance Object
+** KEYWORDS: sqlite3_vtab
+**
+** Every [virtual table module] implementation uses a subclass
+** of this object to describe a particular instance
+** of the [virtual table]. Each subclass will
+** be tailored to the specific needs of the module implementation.
+** The purpose of this superclass is to define certain fields that are
+** common to all module implementations.
+**
+** ^Virtual tables methods can set an error message by assigning a
+** string obtained from [sqlite3_mprintf()] to zErrMsg. The method should
+** take care that any prior string is freed by a call to [sqlite3_free()]
+** prior to assigning a new string to zErrMsg. ^After the error message
+** is delivered up to the client application, the string will be automatically
+** freed by sqlite3_free() and the zErrMsg field will be zeroed.
+*/
+struct sqlite3_vtab {
+ const sqlite3_module *pModule; /* The module for this virtual table */
+ int nRef; /* Number of open cursors */
+ char *zErrMsg; /* Error message from sqlite3_mprintf() */
+ /* Virtual table implementations will typically add additional fields */
+};
+
+/*
+** CAPI3REF: Virtual Table Cursor Object
+** KEYWORDS: sqlite3_vtab_cursor {virtual table cursor}
+**
+** Every [virtual table module] implementation uses a subclass of the
+** following structure to describe cursors that point into the
+** [virtual table] and are used
+** to loop through the virtual table. Cursors are created using the
+** [sqlite3_module.xOpen | xOpen] method of the module and are destroyed
+** by the [sqlite3_module.xClose | xClose] method. Cursors are used
+** by the [xFilter], [xNext], [xEof], [xColumn], and [xRowid] methods
+** of the module. Each module implementation will define
+** the content of a cursor structure to suit its own needs.
+**
+** This superclass exists in order to define fields of the cursor that
+** are common to all implementations.
+*/
+struct sqlite3_vtab_cursor {
+ sqlite3_vtab *pVtab; /* Virtual table of this cursor */
+ /* Virtual table implementations will typically add additional fields */
+};
+
+/*
+** CAPI3REF: Declare The Schema Of A Virtual Table
+**
+** ^The [xCreate] and [xConnect] methods of a
+** [virtual table module] call this interface
+** to declare the format (the names and datatypes of the columns) of
+** the virtual tables they implement.
+*/
+SQLITE_API int sqlite3_declare_vtab(sqlite3*, const char *zSQL);
+
+/*
+** CAPI3REF: Overload A Function For A Virtual Table
+** METHOD: sqlite3
+**
+** ^(Virtual tables can provide alternative implementations of functions
+** using the [xFindFunction] method of the [virtual table module].
+** But global versions of those functions
+** must exist in order to be overloaded.)^
+**
+** ^(This API makes sure a global version of a function with a particular
+** name and number of parameters exists. If no such function exists
+** before this API is called, a new function is created.)^ ^The implementation
+** of the new function always causes an exception to be thrown. So
+** the new function is not good for anything by itself. Its only
+** purpose is to be a placeholder function that can be overloaded
+** by a [virtual table].
+*/
+SQLITE_API int sqlite3_overload_function(sqlite3*, const char *zFuncName, int nArg);
+
+/*
+** CAPI3REF: A Handle To An Open BLOB
+** KEYWORDS: {BLOB handle} {BLOB handles}
+**
+** An instance of this object represents an open BLOB on which
+** [sqlite3_blob_open | incremental BLOB I/O] can be performed.
+** ^Objects of this type are created by [sqlite3_blob_open()]
+** and destroyed by [sqlite3_blob_close()].
+** ^The [sqlite3_blob_read()] and [sqlite3_blob_write()] interfaces
+** can be used to read or write small subsections of the BLOB.
+** ^The [sqlite3_blob_bytes()] interface returns the size of the BLOB in bytes.
+*/
+typedef struct sqlite3_blob sqlite3_blob;
+
+/*
+** CAPI3REF: Open A BLOB For Incremental I/O
+** METHOD: sqlite3
+** CONSTRUCTOR: sqlite3_blob
+**
+** ^(This interfaces opens a [BLOB handle | handle] to the BLOB located
+** in row iRow, column zColumn, table zTable in database zDb;
+** in other words, the same BLOB that would be selected by:
+**
+**
+** SELECT zColumn FROM zDb.zTable WHERE [rowid] = iRow;
+** )^
+**
+** ^(Parameter zDb is not the filename that contains the database, but
+** rather the symbolic name of the database. For attached databases, this is
+** the name that appears after the AS keyword in the [ATTACH] statement.
+** For the main database file, the database name is "main". For TEMP
+** tables, the database name is "temp".)^
+**
+** ^If the flags parameter is non-zero, then the BLOB is opened for read
+** and write access. ^If the flags parameter is zero, the BLOB is opened for
+** read-only access.
+**
+** ^(On success, [SQLITE_OK] is returned and the new [BLOB handle] is stored
+** in *ppBlob. Otherwise an [error code] is returned and, unless the error
+** code is SQLITE_MISUSE, *ppBlob is set to NULL.)^ ^This means that, provided
+** the API is not misused, it is always safe to call [sqlite3_blob_close()]
+** on *ppBlob after this function returns.
+**
+** This function fails with SQLITE_ERROR if any of the following are true:
+**
+** ^(Database zDb does not exist)^,
+** ^(Table zTable does not exist within database zDb)^,
+** ^(Table zTable is a WITHOUT ROWID table)^,
+** ^(Column zColumn does not exist)^,
+** ^(Row iRow is not present in the table)^,
+** ^(The specified column of row iRow contains a value that is not
+** a TEXT or BLOB value)^,
+** ^(Column zColumn is part of an index, PRIMARY KEY or UNIQUE
+** constraint and the blob is being opened for read/write access)^,
+** ^([foreign key constraints | Foreign key constraints] are enabled,
+** column zColumn is part of a [child key] definition and the blob is
+** being opened for read/write access)^.
+**
+**
+** ^Unless it returns SQLITE_MISUSE, this function sets the
+** [database connection] error code and message accessible via
+** [sqlite3_errcode()] and [sqlite3_errmsg()] and related functions.
+**
+** A BLOB referenced by sqlite3_blob_open() may be read using the
+** [sqlite3_blob_read()] interface and modified by using
+** [sqlite3_blob_write()]. The [BLOB handle] can be moved to a
+** different row of the same table using the [sqlite3_blob_reopen()]
+** interface. However, the column, table, or database of a [BLOB handle]
+** cannot be changed after the [BLOB handle] is opened.
+**
+** ^(If the row that a BLOB handle points to is modified by an
+** [UPDATE], [DELETE], or by [ON CONFLICT] side-effects
+** then the BLOB handle is marked as "expired".
+** This is true if any column of the row is changed, even a column
+** other than the one the BLOB handle is open on.)^
+** ^Calls to [sqlite3_blob_read()] and [sqlite3_blob_write()] for
+** an expired BLOB handle fail with a return code of [SQLITE_ABORT].
+** ^(Changes written into a BLOB prior to the BLOB expiring are not
+** rolled back by the expiration of the BLOB. Such changes will eventually
+** commit if the transaction continues to completion.)^
+**
+** ^Use the [sqlite3_blob_bytes()] interface to determine the size of
+** the opened blob. ^The size of a blob may not be changed by this
+** interface. Use the [UPDATE] SQL command to change the size of a
+** blob.
+**
+** ^The [sqlite3_bind_zeroblob()] and [sqlite3_result_zeroblob()] interfaces
+** and the built-in [zeroblob] SQL function may be used to create a
+** zero-filled blob to read or write using the incremental-blob interface.
+**
+** To avoid a resource leak, every open [BLOB handle] should eventually
+** be released by a call to [sqlite3_blob_close()].
+**
+** See also: [sqlite3_blob_close()],
+** [sqlite3_blob_reopen()], [sqlite3_blob_read()],
+** [sqlite3_blob_bytes()], [sqlite3_blob_write()].
+*/
+SQLITE_API int sqlite3_blob_open(
+ sqlite3*,
+ const char *zDb,
+ const char *zTable,
+ const char *zColumn,
+ sqlite3_int64 iRow,
+ int flags,
+ sqlite3_blob **ppBlob
+);
+
+/*
+** CAPI3REF: Move a BLOB Handle to a New Row
+** METHOD: sqlite3_blob
+**
+** ^This function is used to move an existing [BLOB handle] so that it points
+** to a different row of the same database table. ^The new row is identified
+** by the rowid value passed as the second argument. Only the row can be
+** changed. ^The database, table and column on which the blob handle is open
+** remain the same. Moving an existing [BLOB handle] to a new row is
+** faster than closing the existing handle and opening a new one.
+**
+** ^(The new row must meet the same criteria as for [sqlite3_blob_open()] -
+** it must exist and there must be either a blob or text value stored in
+** the nominated column.)^ ^If the new row is not present in the table, or if
+** it does not contain a blob or text value, or if another error occurs, an
+** SQLite error code is returned and the blob handle is considered aborted.
+** ^All subsequent calls to [sqlite3_blob_read()], [sqlite3_blob_write()] or
+** [sqlite3_blob_reopen()] on an aborted blob handle immediately return
+** SQLITE_ABORT. ^Calling [sqlite3_blob_bytes()] on an aborted blob handle
+** always returns zero.
+**
+** ^This function sets the database handle error code and message.
+*/
+SQLITE_API int sqlite3_blob_reopen(sqlite3_blob *, sqlite3_int64);
+
+/*
+** CAPI3REF: Close A BLOB Handle
+** DESTRUCTOR: sqlite3_blob
+**
+** ^This function closes an open [BLOB handle]. ^(The BLOB handle is closed
+** unconditionally. Even if this routine returns an error code, the
+** handle is still closed.)^
+**
+** ^If the blob handle being closed was opened for read-write access, and if
+** the database is in auto-commit mode and there are no other open read-write
+** blob handles or active write statements, the current transaction is
+** committed. ^If an error occurs while committing the transaction, an error
+** code is returned and the transaction rolled back.
+**
+** Calling this function with an argument that is not a NULL pointer or an
+** open blob handle results in undefined behavior. ^Calling this routine
+** with a null pointer (such as would be returned by a failed call to
+** [sqlite3_blob_open()]) is a harmless no-op. ^Otherwise, if this function
+** is passed a valid open blob handle, the values returned by the
+** sqlite3_errcode() and sqlite3_errmsg() functions are set before returning.
+*/
+SQLITE_API int sqlite3_blob_close(sqlite3_blob *);
+
+/*
+** CAPI3REF: Return The Size Of An Open BLOB
+** METHOD: sqlite3_blob
+**
+** ^Returns the size in bytes of the BLOB accessible via the
+** successfully opened [BLOB handle] in its only argument. ^The
+** incremental blob I/O routines can only read or overwrite existing
+** blob content; they cannot change the size of a blob.
+**
+** This routine only works on a [BLOB handle] which has been created
+** by a prior successful call to [sqlite3_blob_open()] and which has not
+** been closed by [sqlite3_blob_close()]. Passing any other pointer in
+** to this routine results in undefined and probably undesirable behavior.
+*/
+SQLITE_API int sqlite3_blob_bytes(sqlite3_blob *);
+
+/*
+** CAPI3REF: Read Data From A BLOB Incrementally
+** METHOD: sqlite3_blob
+**
+** ^(This function is used to read data from an open [BLOB handle] into a
+** caller-supplied buffer. N bytes of data are copied into buffer Z
+** from the open BLOB, starting at offset iOffset.)^
+**
+** ^If offset iOffset is less than N bytes from the end of the BLOB,
+** [SQLITE_ERROR] is returned and no data is read. ^If N or iOffset is
+** less than zero, [SQLITE_ERROR] is returned and no data is read.
+** ^The size of the blob (and hence the maximum value of N+iOffset)
+** can be determined using the [sqlite3_blob_bytes()] interface.
+**
+** ^An attempt to read from an expired [BLOB handle] fails with an
+** error code of [SQLITE_ABORT].
+**
+** ^(On success, sqlite3_blob_read() returns SQLITE_OK.
+** Otherwise, an [error code] or an [extended error code] is returned.)^
+**
+** This routine only works on a [BLOB handle] which has been created
+** by a prior successful call to [sqlite3_blob_open()] and which has not
+** been closed by [sqlite3_blob_close()]. Passing any other pointer in
+** to this routine results in undefined and probably undesirable behavior.
+**
+** See also: [sqlite3_blob_write()].
+*/
+SQLITE_API int sqlite3_blob_read(sqlite3_blob *, void *Z, int N, int iOffset);
+
+/*
+** CAPI3REF: Write Data Into A BLOB Incrementally
+** METHOD: sqlite3_blob
+**
+** ^(This function is used to write data into an open [BLOB handle] from a
+** caller-supplied buffer. N bytes of data are copied from the buffer Z
+** into the open BLOB, starting at offset iOffset.)^
+**
+** ^(On success, sqlite3_blob_write() returns SQLITE_OK.
+** Otherwise, an [error code] or an [extended error code] is returned.)^
+** ^Unless SQLITE_MISUSE is returned, this function sets the
+** [database connection] error code and message accessible via
+** [sqlite3_errcode()] and [sqlite3_errmsg()] and related functions.
+**
+** ^If the [BLOB handle] passed as the first argument was not opened for
+** writing (the flags parameter to [sqlite3_blob_open()] was zero),
+** this function returns [SQLITE_READONLY].
+**
+** This function may only modify the contents of the BLOB; it is
+** not possible to increase the size of a BLOB using this API.
+** ^If offset iOffset is less than N bytes from the end of the BLOB,
+** [SQLITE_ERROR] is returned and no data is written. The size of the
+** BLOB (and hence the maximum value of N+iOffset) can be determined
+** using the [sqlite3_blob_bytes()] interface. ^If N or iOffset are less
+** than zero [SQLITE_ERROR] is returned and no data is written.
+**
+** ^An attempt to write to an expired [BLOB handle] fails with an
+** error code of [SQLITE_ABORT]. ^Writes to the BLOB that occurred
+** before the [BLOB handle] expired are not rolled back by the
+** expiration of the handle, though of course those changes might
+** have been overwritten by the statement that expired the BLOB handle
+** or by other independent statements.
+**
+** This routine only works on a [BLOB handle] which has been created
+** by a prior successful call to [sqlite3_blob_open()] and which has not
+** been closed by [sqlite3_blob_close()]. Passing any other pointer in
+** to this routine results in undefined and probably undesirable behavior.
+**
+** See also: [sqlite3_blob_read()].
+*/
+SQLITE_API int sqlite3_blob_write(sqlite3_blob *, const void *z, int n, int iOffset);
+
+/*
+** CAPI3REF: Virtual File System Objects
+**
+** A virtual filesystem (VFS) is an [sqlite3_vfs] object
+** that SQLite uses to interact
+** with the underlying operating system. Most SQLite builds come with a
+** single default VFS that is appropriate for the host computer.
+** New VFSes can be registered and existing VFSes can be unregistered.
+** The following interfaces are provided.
+**
+** ^The sqlite3_vfs_find() interface returns a pointer to a VFS given its name.
+** ^Names are case sensitive.
+** ^Names are zero-terminated UTF-8 strings.
+** ^If there is no match, a NULL pointer is returned.
+** ^If zVfsName is NULL then the default VFS is returned.
+**
+** ^New VFSes are registered with sqlite3_vfs_register().
+** ^Each new VFS becomes the default VFS if the makeDflt flag is set.
+** ^The same VFS can be registered multiple times without injury.
+** ^To make an existing VFS into the default VFS, register it again
+** with the makeDflt flag set. If two different VFSes with the
+** same name are registered, the behavior is undefined. If a
+** VFS is registered with a name that is NULL or an empty string,
+** then the behavior is undefined.
+**
+** ^Unregister a VFS with the sqlite3_vfs_unregister() interface.
+** ^(If the default VFS is unregistered, another VFS is chosen as
+** the default. The choice for the new VFS is arbitrary.)^
+*/
+SQLITE_API sqlite3_vfs *sqlite3_vfs_find(const char *zVfsName);
+SQLITE_API int sqlite3_vfs_register(sqlite3_vfs*, int makeDflt);
+SQLITE_API int sqlite3_vfs_unregister(sqlite3_vfs*);
+
+/*
+** CAPI3REF: Mutexes
+**
+** The SQLite core uses these routines for thread
+** synchronization. Though they are intended for internal
+** use by SQLite, code that links against SQLite is
+** permitted to use any of these routines.
+**
+** The SQLite source code contains multiple implementations
+** of these mutex routines. An appropriate implementation
+** is selected automatically at compile-time. The following
+** implementations are available in the SQLite core:
+**
+**
+** SQLITE_MUTEX_PTHREADS
+** SQLITE_MUTEX_W32
+** SQLITE_MUTEX_NOOP
+**
+**
+** The SQLITE_MUTEX_NOOP implementation is a set of routines
+** that does no real locking and is appropriate for use in
+** a single-threaded application. The SQLITE_MUTEX_PTHREADS and
+** SQLITE_MUTEX_W32 implementations are appropriate for use on Unix
+** and Windows.
+**
+** If SQLite is compiled with the SQLITE_MUTEX_APPDEF preprocessor
+** macro defined (with "-DSQLITE_MUTEX_APPDEF=1"), then no mutex
+** implementation is included with the library. In this case the
+** application must supply a custom mutex implementation using the
+** [SQLITE_CONFIG_MUTEX] option of the sqlite3_config() function
+** before calling sqlite3_initialize() or any other public sqlite3_
+** function that calls sqlite3_initialize().
+**
+** ^The sqlite3_mutex_alloc() routine allocates a new
+** mutex and returns a pointer to it. ^The sqlite3_mutex_alloc()
+** routine returns NULL if it is unable to allocate the requested
+** mutex. The argument to sqlite3_mutex_alloc() must be one of these
+** integer constants:
+**
+**
+** SQLITE_MUTEX_FAST
+** SQLITE_MUTEX_RECURSIVE
+** SQLITE_MUTEX_STATIC_MAIN
+** SQLITE_MUTEX_STATIC_MEM
+** SQLITE_MUTEX_STATIC_OPEN
+** SQLITE_MUTEX_STATIC_PRNG
+** SQLITE_MUTEX_STATIC_LRU
+** SQLITE_MUTEX_STATIC_PMEM
+** SQLITE_MUTEX_STATIC_APP1
+** SQLITE_MUTEX_STATIC_APP2
+** SQLITE_MUTEX_STATIC_APP3
+** SQLITE_MUTEX_STATIC_VFS1
+** SQLITE_MUTEX_STATIC_VFS2
+** SQLITE_MUTEX_STATIC_VFS3
+**
+**
+** ^The first two constants (SQLITE_MUTEX_FAST and SQLITE_MUTEX_RECURSIVE)
+** cause sqlite3_mutex_alloc() to create
+** a new mutex. ^The new mutex is recursive when SQLITE_MUTEX_RECURSIVE
+** is used but not necessarily so when SQLITE_MUTEX_FAST is used.
+** The mutex implementation does not need to make a distinction
+** between SQLITE_MUTEX_RECURSIVE and SQLITE_MUTEX_FAST if it does
+** not want to. SQLite will only request a recursive mutex in
+** cases where it really needs one. If a faster non-recursive mutex
+** implementation is available on the host platform, the mutex subsystem
+** might return such a mutex in response to SQLITE_MUTEX_FAST.
+**
+** ^The other allowed parameters to sqlite3_mutex_alloc() (anything other
+** than SQLITE_MUTEX_FAST and SQLITE_MUTEX_RECURSIVE) each return
+** a pointer to a static preexisting mutex. ^Nine static mutexes are
+** used by the current version of SQLite. Future versions of SQLite
+** may add additional static mutexes. Static mutexes are for internal
+** use by SQLite only. Applications that use SQLite mutexes should
+** use only the dynamic mutexes returned by SQLITE_MUTEX_FAST or
+** SQLITE_MUTEX_RECURSIVE.
+**
+** ^Note that if one of the dynamic mutex parameters (SQLITE_MUTEX_FAST
+** or SQLITE_MUTEX_RECURSIVE) is used then sqlite3_mutex_alloc()
+** returns a different mutex on every call. ^For the static
+** mutex types, the same mutex is returned on every call that has
+** the same type number.
+**
+** ^The sqlite3_mutex_free() routine deallocates a previously
+** allocated dynamic mutex. Attempting to deallocate a static
+** mutex results in undefined behavior.
+**
+** ^The sqlite3_mutex_enter() and sqlite3_mutex_try() routines attempt
+** to enter a mutex. ^If another thread is already within the mutex,
+** sqlite3_mutex_enter() will block and sqlite3_mutex_try() will return
+** SQLITE_BUSY. ^The sqlite3_mutex_try() interface returns [SQLITE_OK]
+** upon successful entry. ^(Mutexes created using
+** SQLITE_MUTEX_RECURSIVE can be entered multiple times by the same thread.
+** In such cases, the
+** mutex must be exited an equal number of times before another thread
+** can enter.)^ If the same thread tries to enter any mutex other
+** than an SQLITE_MUTEX_RECURSIVE more than once, the behavior is undefined.
+**
+** ^(Some systems (for example, Windows 95) do not support the operation
+** implemented by sqlite3_mutex_try(). On those systems, sqlite3_mutex_try()
+** will always return SQLITE_BUSY. In most cases the SQLite core only uses
+** sqlite3_mutex_try() as an optimization, so this is acceptable
+** behavior. The exceptions are unix builds that set the
+** SQLITE_ENABLE_SETLK_TIMEOUT build option. In that case a working
+** sqlite3_mutex_try() is required.)^
+**
+** ^The sqlite3_mutex_leave() routine exits a mutex that was
+** previously entered by the same thread. The behavior
+** is undefined if the mutex is not currently entered by the
+** calling thread or is not currently allocated.
+**
+** ^If the argument to sqlite3_mutex_enter(), sqlite3_mutex_try(),
+** sqlite3_mutex_leave(), or sqlite3_mutex_free() is a NULL pointer,
+** then any of the four routines behaves as a no-op.
+**
+** See also: [sqlite3_mutex_held()] and [sqlite3_mutex_notheld()].
+*/
+SQLITE_API sqlite3_mutex *sqlite3_mutex_alloc(int);
+SQLITE_API void sqlite3_mutex_free(sqlite3_mutex*);
+SQLITE_API void sqlite3_mutex_enter(sqlite3_mutex*);
+SQLITE_API int sqlite3_mutex_try(sqlite3_mutex*);
+SQLITE_API void sqlite3_mutex_leave(sqlite3_mutex*);
+
+/*
+** CAPI3REF: Mutex Methods Object
+**
+** An instance of this structure defines the low-level routines
+** used to allocate and use mutexes.
+**
+** Usually, the default mutex implementations provided by SQLite are
+** sufficient, however the application has the option of substituting a custom
+** implementation for specialized deployments or systems for which SQLite
+** does not provide a suitable implementation. In this case, the application
+** creates and populates an instance of this structure to pass
+** to sqlite3_config() along with the [SQLITE_CONFIG_MUTEX] option.
+** Additionally, an instance of this structure can be used as an
+** output variable when querying the system for the current mutex
+** implementation, using the [SQLITE_CONFIG_GETMUTEX] option.
+**
+** ^The xMutexInit method defined by this structure is invoked as
+** part of system initialization by the sqlite3_initialize() function.
+** ^The xMutexInit routine is called by SQLite exactly once for each
+** effective call to [sqlite3_initialize()].
+**
+** ^The xMutexEnd method defined by this structure is invoked as
+** part of system shutdown by the sqlite3_shutdown() function. The
+** implementation of this method is expected to release all outstanding
+** resources obtained by the mutex methods implementation, especially
+** those obtained by the xMutexInit method. ^The xMutexEnd()
+** interface is invoked exactly once for each call to [sqlite3_shutdown()].
+**
+** ^(The remaining seven methods defined by this structure (xMutexAlloc,
+** xMutexFree, xMutexEnter, xMutexTry, xMutexLeave, xMutexHeld and
+** xMutexNotheld) implement the following interfaces (respectively):
+**
+**
+** [sqlite3_mutex_alloc()]
+** [sqlite3_mutex_free()]
+** [sqlite3_mutex_enter()]
+** [sqlite3_mutex_try()]
+** [sqlite3_mutex_leave()]
+** [sqlite3_mutex_held()]
+** [sqlite3_mutex_notheld()]
+** )^
+**
+** The only difference is that the public sqlite3_XXX functions enumerated
+** above silently ignore any invocations that pass a NULL pointer instead
+** of a valid mutex handle. The implementations of the methods defined
+** by this structure are not required to handle this case. The results
+** of passing a NULL pointer instead of a valid mutex handle are undefined
+** (i.e. it is acceptable to provide an implementation that segfaults if
+** it is passed a NULL pointer).
+**
+** The xMutexInit() method must be threadsafe. It must be harmless to
+** invoke xMutexInit() multiple times within the same process and without
+** intervening calls to xMutexEnd(). Second and subsequent calls to
+** xMutexInit() must be no-ops.
+**
+** xMutexInit() must not use SQLite memory allocation ([sqlite3_malloc()]
+** and its associates). Similarly, xMutexAlloc() must not use SQLite memory
+** allocation for a static mutex. ^However xMutexAlloc() may use SQLite
+** memory allocation for a fast or recursive mutex.
+**
+** ^SQLite will invoke the xMutexEnd() method when [sqlite3_shutdown()] is
+** called, but only if the prior call to xMutexInit returned SQLITE_OK.
+** If xMutexInit fails in any way, it is expected to clean up after itself
+** prior to returning.
+*/
+typedef struct sqlite3_mutex_methods sqlite3_mutex_methods;
+struct sqlite3_mutex_methods {
+ int (*xMutexInit)(void);
+ int (*xMutexEnd)(void);
+ sqlite3_mutex *(*xMutexAlloc)(int);
+ void (*xMutexFree)(sqlite3_mutex *);
+ void (*xMutexEnter)(sqlite3_mutex *);
+ int (*xMutexTry)(sqlite3_mutex *);
+ void (*xMutexLeave)(sqlite3_mutex *);
+ int (*xMutexHeld)(sqlite3_mutex *);
+ int (*xMutexNotheld)(sqlite3_mutex *);
+};
+
+/*
+** CAPI3REF: Mutex Verification Routines
+**
+** The sqlite3_mutex_held() and sqlite3_mutex_notheld() routines
+** are intended for use inside assert() statements. The SQLite core
+** never uses these routines except inside an assert() and applications
+** are advised to follow the lead of the core. The SQLite core only
+** provides implementations for these routines when it is compiled
+** with the SQLITE_DEBUG flag. External mutex implementations
+** are only required to provide these routines if SQLITE_DEBUG is
+** defined and if NDEBUG is not defined.
+**
+** These routines should return true if the mutex in their argument
+** is held or not held, respectively, by the calling thread.
+**
+** The implementation is not required to provide versions of these
+** routines that actually work. If the implementation does not provide working
+** versions of these routines, it should at least provide stubs that always
+** return true so that one does not get spurious assertion failures.
+**
+** If the argument to sqlite3_mutex_held() is a NULL pointer then
+** the routine should return 1. This seems counter-intuitive since
+** clearly the mutex cannot be held if it does not exist. But
+** the reason the mutex does not exist is because the build is not
+** using mutexes. And we do not want the assert() containing the
+** call to sqlite3_mutex_held() to fail, so a non-zero return is
+** the appropriate thing to do. The sqlite3_mutex_notheld()
+** interface should also return 1 when given a NULL pointer.
+*/
+#ifndef NDEBUG
+SQLITE_API int sqlite3_mutex_held(sqlite3_mutex*);
+SQLITE_API int sqlite3_mutex_notheld(sqlite3_mutex*);
+#endif
+
+/*
+** CAPI3REF: Mutex Types
+**
+** The [sqlite3_mutex_alloc()] interface takes a single argument
+** which is one of these integer constants.
+**
+** The set of static mutexes may change from one SQLite release to the
+** next. Applications that override the built-in mutex logic must be
+** prepared to accommodate additional static mutexes.
+*/
+#define SQLITE_MUTEX_FAST 0
+#define SQLITE_MUTEX_RECURSIVE 1
+#define SQLITE_MUTEX_STATIC_MAIN 2
+#define SQLITE_MUTEX_STATIC_MEM 3 /* sqlite3_malloc() */
+#define SQLITE_MUTEX_STATIC_MEM2 4 /* NOT USED */
+#define SQLITE_MUTEX_STATIC_OPEN 4 /* sqlite3BtreeOpen() */
+#define SQLITE_MUTEX_STATIC_PRNG 5 /* sqlite3_randomness() */
+#define SQLITE_MUTEX_STATIC_LRU 6 /* lru page list */
+#define SQLITE_MUTEX_STATIC_LRU2 7 /* NOT USED */
+#define SQLITE_MUTEX_STATIC_PMEM 7 /* sqlite3PageMalloc() */
+#define SQLITE_MUTEX_STATIC_APP1 8 /* For use by application */
+#define SQLITE_MUTEX_STATIC_APP2 9 /* For use by application */
+#define SQLITE_MUTEX_STATIC_APP3 10 /* For use by application */
+#define SQLITE_MUTEX_STATIC_VFS1 11 /* For use by built-in VFS */
+#define SQLITE_MUTEX_STATIC_VFS2 12 /* For use by extension VFS */
+#define SQLITE_MUTEX_STATIC_VFS3 13 /* For use by application VFS */
+
+/* Legacy compatibility: */
+#define SQLITE_MUTEX_STATIC_MASTER 2
+
+
+/*
+** CAPI3REF: Retrieve the mutex for a database connection
+** METHOD: sqlite3
+**
+** ^This interface returns a pointer to the [sqlite3_mutex] object that
+** serializes access to the [database connection] given in the argument
+** when the [threading mode] is Serialized.
+** ^If the [threading mode] is Single-thread or Multi-thread then this
+** routine returns a NULL pointer.
+*/
+SQLITE_API sqlite3_mutex *sqlite3_db_mutex(sqlite3*);
+
+/*
+** CAPI3REF: Low-Level Control Of Database Files
+** METHOD: sqlite3
+** KEYWORDS: {file control}
+**
+** ^The [sqlite3_file_control()] interface makes a direct call to the
+** xFileControl method for the [sqlite3_io_methods] object associated
+** with a particular database identified by the second argument. ^The
+** name of the database is "main" for the main database or "temp" for the
+** TEMP database, or the name that appears after the AS keyword for
+** databases that are added using the [ATTACH] SQL command.
+** ^A NULL pointer can be used in place of "main" to refer to the
+** main database file.
+** ^The third and fourth parameters to this routine
+** are passed directly through to the second and third parameters of
+** the xFileControl method. ^The return value of the xFileControl
+** method becomes the return value of this routine.
+**
+** A few opcodes for [sqlite3_file_control()] are handled directly
+** by the SQLite core and never invoke the
+** sqlite3_io_methods.xFileControl method.
+** ^The [SQLITE_FCNTL_FILE_POINTER] value for the op parameter causes
+** a pointer to the underlying [sqlite3_file] object to be written into
+** the space pointed to by the 4th parameter. The
+** [SQLITE_FCNTL_JOURNAL_POINTER] works similarly except that it returns
+** the [sqlite3_file] object associated with the journal file instead of
+** the main database. The [SQLITE_FCNTL_VFS_POINTER] opcode returns
+** a pointer to the underlying [sqlite3_vfs] object for the file.
+** The [SQLITE_FCNTL_DATA_VERSION] returns the data version counter
+** from the pager.
+**
+** ^If the second parameter (zDbName) does not match the name of any
+** open database file, then SQLITE_ERROR is returned. ^This error
+** code is not remembered and will not be recalled by [sqlite3_errcode()]
+** or [sqlite3_errmsg()]. The underlying xFileControl method might
+** also return SQLITE_ERROR. There is no way to distinguish between
+** an incorrect zDbName and an SQLITE_ERROR return from the underlying
+** xFileControl method.
+**
+** See also: [file control opcodes]
+*/
+SQLITE_API int sqlite3_file_control(sqlite3*, const char *zDbName, int op, void*);
+
+/*
+** CAPI3REF: Testing Interface
+**
+** ^The sqlite3_test_control() interface is used to read out internal
+** state of SQLite and to inject faults into SQLite for testing
+** purposes. ^The first parameter is an operation code that determines
+** the number, meaning, and operation of all subsequent parameters.
+**
+** This interface is not for use by applications. It exists solely
+** for verifying the correct operation of the SQLite library. Depending
+** on how the SQLite library is compiled, this interface might not exist.
+**
+** The details of the operation codes, their meanings, the parameters
+** they take, and what they do are all subject to change without notice.
+** Unlike most of the SQLite API, this function is not guaranteed to
+** operate consistently from one release to the next.
+*/
+SQLITE_API int sqlite3_test_control(int op, ...);
+
+/*
+** CAPI3REF: Testing Interface Operation Codes
+**
+** These constants are the valid operation code parameters used
+** as the first argument to [sqlite3_test_control()].
+**
+** These parameters and their meanings are subject to change
+** without notice. These values are for testing purposes only.
+** Applications should not use any of these parameters or the
+** [sqlite3_test_control()] interface.
+*/
+#define SQLITE_TESTCTRL_FIRST 5
+#define SQLITE_TESTCTRL_PRNG_SAVE 5
+#define SQLITE_TESTCTRL_PRNG_RESTORE 6
+#define SQLITE_TESTCTRL_PRNG_RESET 7 /* NOT USED */
+#define SQLITE_TESTCTRL_FK_NO_ACTION 7
+#define SQLITE_TESTCTRL_BITVEC_TEST 8
+#define SQLITE_TESTCTRL_FAULT_INSTALL 9
+#define SQLITE_TESTCTRL_BENIGN_MALLOC_HOOKS 10
+#define SQLITE_TESTCTRL_PENDING_BYTE 11
+#define SQLITE_TESTCTRL_ASSERT 12
+#define SQLITE_TESTCTRL_ALWAYS 13
+#define SQLITE_TESTCTRL_RESERVE 14 /* NOT USED */
+#define SQLITE_TESTCTRL_JSON_SELFCHECK 14
+#define SQLITE_TESTCTRL_OPTIMIZATIONS 15
+#define SQLITE_TESTCTRL_ISKEYWORD 16 /* NOT USED */
+#define SQLITE_TESTCTRL_GETOPT 16
+#define SQLITE_TESTCTRL_SCRATCHMALLOC 17 /* NOT USED */
+#define SQLITE_TESTCTRL_INTERNAL_FUNCTIONS 17
+#define SQLITE_TESTCTRL_LOCALTIME_FAULT 18
+#define SQLITE_TESTCTRL_EXPLAIN_STMT 19 /* NOT USED */
+#define SQLITE_TESTCTRL_ONCE_RESET_THRESHOLD 19
+#define SQLITE_TESTCTRL_NEVER_CORRUPT 20
+#define SQLITE_TESTCTRL_VDBE_COVERAGE 21
+#define SQLITE_TESTCTRL_BYTEORDER 22
+#define SQLITE_TESTCTRL_ISINIT 23
+#define SQLITE_TESTCTRL_SORTER_MMAP 24
+#define SQLITE_TESTCTRL_IMPOSTER 25
+#define SQLITE_TESTCTRL_PARSER_COVERAGE 26
+#define SQLITE_TESTCTRL_RESULT_INTREAL 27
+#define SQLITE_TESTCTRL_PRNG_SEED 28
+#define SQLITE_TESTCTRL_EXTRA_SCHEMA_CHECKS 29
+#define SQLITE_TESTCTRL_SEEK_COUNT 30
+#define SQLITE_TESTCTRL_TRACEFLAGS 31
+#define SQLITE_TESTCTRL_TUNE 32
+#define SQLITE_TESTCTRL_LOGEST 33
+#define SQLITE_TESTCTRL_USELONGDOUBLE 34 /* NOT USED */
+#define SQLITE_TESTCTRL_LAST 34 /* Largest TESTCTRL */
+
+/*
+** CAPI3REF: SQL Keyword Checking
+**
+** These routines provide access to the set of SQL language keywords
+** recognized by SQLite. Applications can use these routines to determine
+** whether or not a specific identifier needs to be escaped (for example,
+** by enclosing in double-quotes) so as not to confuse the parser.
+**
+** The sqlite3_keyword_count() interface returns the number of distinct
+** keywords understood by SQLite.
+**
+** The sqlite3_keyword_name(N,Z,L) interface finds the 0-based N-th keyword and
+** makes *Z point to that keyword expressed as UTF8 and writes the number
+** of bytes in the keyword into *L. The string that *Z points to is not
+** zero-terminated. The sqlite3_keyword_name(N,Z,L) routine returns
+** SQLITE_OK if N is within bounds and SQLITE_ERROR if not. If either Z
+** or L are NULL or invalid pointers then calls to
+** sqlite3_keyword_name(N,Z,L) result in undefined behavior.
+**
+** The sqlite3_keyword_check(Z,L) interface checks to see whether or not
+** the L-byte UTF8 identifier that Z points to is a keyword, returning non-zero
+** if it is and zero if not.
+**
+** The parser used by SQLite is forgiving. It is often possible to use
+** a keyword as an identifier as long as such use does not result in a
+** parsing ambiguity. For example, the statement
+** "CREATE TABLE BEGIN(REPLACE,PRAGMA,END);" is accepted by SQLite, and
+** creates a new table named "BEGIN" with three columns named
+** "REPLACE", "PRAGMA", and "END". Nevertheless, best practice is to avoid
+** using keywords as identifiers. Common techniques used to avoid keyword
+** name collisions include:
+**
+** Put all identifier names inside double-quotes. This is the official
+** SQL way to escape identifier names.
+** Put identifier names inside [...]. This is not standard SQL,
+** but it is what SQL Server does and so lots of programmers use this
+** technique.
+** Begin every identifier with the letter "Z" as no SQL keywords start
+** with "Z".
+** Include a digit somewhere in every identifier name.
+**
+**
+** Note that the number of keywords understood by SQLite can depend on
+** compile-time options. For example, "VACUUM" is not a keyword if
+** SQLite is compiled with the [-DSQLITE_OMIT_VACUUM] option. Also,
+** new keywords may be added to future releases of SQLite.
+*/
+SQLITE_API int sqlite3_keyword_count(void);
+SQLITE_API int sqlite3_keyword_name(int,const char**,int*);
+SQLITE_API int sqlite3_keyword_check(const char*,int);
+
+/*
+** CAPI3REF: Dynamic String Object
+** KEYWORDS: {dynamic string}
+**
+** An instance of the sqlite3_str object contains a dynamically-sized
+** string under construction.
+**
+** The lifecycle of an sqlite3_str object is as follows:
+**
+** ^The sqlite3_str object is created using [sqlite3_str_new()].
+** ^Text is appended to the sqlite3_str object using various
+** methods, such as [sqlite3_str_appendf()].
+** ^The sqlite3_str object is destroyed and the string it created
+** is returned using the [sqlite3_str_finish()] interface.
+**
+*/
+typedef struct sqlite3_str sqlite3_str;
+
+/*
+** CAPI3REF: Create A New Dynamic String Object
+** CONSTRUCTOR: sqlite3_str
+**
+** ^The [sqlite3_str_new(D)] interface allocates and initializes
+** a new [sqlite3_str] object. To avoid memory leaks, the object returned by
+** [sqlite3_str_new()] must be freed by a subsequent call to
+** [sqlite3_str_finish(X)].
+**
+** ^The [sqlite3_str_new(D)] interface always returns a pointer to a
+** valid [sqlite3_str] object, though in the event of an out-of-memory
+** error the returned object might be a special singleton that will
+** silently reject new text, always return SQLITE_NOMEM from
+** [sqlite3_str_errcode()], always return 0 for
+** [sqlite3_str_length()], and always return NULL from
+** [sqlite3_str_finish(X)]. It is always safe to use the value
+** returned by [sqlite3_str_new(D)] as the sqlite3_str parameter
+** to any of the other [sqlite3_str] methods.
+**
+** The D parameter to [sqlite3_str_new(D)] may be NULL. If the
+** D parameter in [sqlite3_str_new(D)] is not NULL, then the maximum
+** length of the string contained in the [sqlite3_str] object will be
+** the value set for [sqlite3_limit](D,[SQLITE_LIMIT_LENGTH]) instead
+** of [SQLITE_MAX_LENGTH].
+*/
+SQLITE_API sqlite3_str *sqlite3_str_new(sqlite3*);
+
+/*
+** CAPI3REF: Finalize A Dynamic String
+** DESTRUCTOR: sqlite3_str
+**
+** ^The [sqlite3_str_finish(X)] interface destroys the sqlite3_str object X
+** and returns a pointer to a memory buffer obtained from [sqlite3_malloc64()]
+** that contains the constructed string. The calling application should
+** pass the returned value to [sqlite3_free()] to avoid a memory leak.
+** ^The [sqlite3_str_finish(X)] interface may return a NULL pointer if any
+** errors were encountered during construction of the string. ^The
+** [sqlite3_str_finish(X)] interface will also return a NULL pointer if the
+** string in [sqlite3_str] object X is zero bytes long.
+*/
+SQLITE_API char *sqlite3_str_finish(sqlite3_str*);
+
+/*
+** CAPI3REF: Add Content To A Dynamic String
+** METHOD: sqlite3_str
+**
+** These interfaces add content to an sqlite3_str object previously obtained
+** from [sqlite3_str_new()].
+**
+** ^The [sqlite3_str_appendf(X,F,...)] and
+** [sqlite3_str_vappendf(X,F,V)] interfaces uses the [built-in printf]
+** functionality of SQLite to append formatted text onto the end of
+** [sqlite3_str] object X.
+**
+** ^The [sqlite3_str_append(X,S,N)] method appends exactly N bytes from string S
+** onto the end of the [sqlite3_str] object X. N must be non-negative.
+** S must contain at least N non-zero bytes of content. To append a
+** zero-terminated string in its entirety, use the [sqlite3_str_appendall()]
+** method instead.
+**
+** ^The [sqlite3_str_appendall(X,S)] method appends the complete content of
+** zero-terminated string S onto the end of [sqlite3_str] object X.
+**
+** ^The [sqlite3_str_appendchar(X,N,C)] method appends N copies of the
+** single-byte character C onto the end of [sqlite3_str] object X.
+** ^This method can be used, for example, to add whitespace indentation.
+**
+** ^The [sqlite3_str_reset(X)] method resets the string under construction
+** inside [sqlite3_str] object X back to zero bytes in length.
+**
+** These methods do not return a result code. ^If an error occurs, that fact
+** is recorded in the [sqlite3_str] object and can be recovered by a
+** subsequent call to [sqlite3_str_errcode(X)].
+*/
+SQLITE_API void sqlite3_str_appendf(sqlite3_str*, const char *zFormat, ...);
+SQLITE_API void sqlite3_str_vappendf(sqlite3_str*, const char *zFormat, va_list);
+SQLITE_API void sqlite3_str_append(sqlite3_str*, const char *zIn, int N);
+SQLITE_API void sqlite3_str_appendall(sqlite3_str*, const char *zIn);
+SQLITE_API void sqlite3_str_appendchar(sqlite3_str*, int N, char C);
+SQLITE_API void sqlite3_str_reset(sqlite3_str*);
+
+/*
+** CAPI3REF: Status Of A Dynamic String
+** METHOD: sqlite3_str
+**
+** These interfaces return the current status of an [sqlite3_str] object.
+**
+** ^If any prior errors have occurred while constructing the dynamic string
+** in sqlite3_str X, then the [sqlite3_str_errcode(X)] method will return
+** an appropriate error code. ^The [sqlite3_str_errcode(X)] method returns
+** [SQLITE_NOMEM] following any out-of-memory error, or
+** [SQLITE_TOOBIG] if the size of the dynamic string exceeds
+** [SQLITE_MAX_LENGTH], or [SQLITE_OK] if there have been no errors.
+**
+** ^The [sqlite3_str_length(X)] method returns the current length, in bytes,
+** of the dynamic string under construction in [sqlite3_str] object X.
+** ^The length returned by [sqlite3_str_length(X)] does not include the
+** zero-termination byte.
+**
+** ^The [sqlite3_str_value(X)] method returns a pointer to the current
+** content of the dynamic string under construction in X. The value
+** returned by [sqlite3_str_value(X)] is managed by the sqlite3_str object X
+** and might be freed or altered by any subsequent method on the same
+** [sqlite3_str] object. Applications must not use the pointer returned by
+** [sqlite3_str_value(X)] after any subsequent method call on the same
+** object. ^Applications may change the content of the string returned
+** by [sqlite3_str_value(X)] as long as they do not write into any bytes
+** outside the range of 0 to [sqlite3_str_length(X)] and do not read or
+** write any byte after any subsequent sqlite3_str method call.
+*/
+SQLITE_API int sqlite3_str_errcode(sqlite3_str*);
+SQLITE_API int sqlite3_str_length(sqlite3_str*);
+SQLITE_API char *sqlite3_str_value(sqlite3_str*);
+
+/*
+** CAPI3REF: SQLite Runtime Status
+**
+** ^These interfaces are used to retrieve runtime status information
+** about the performance of SQLite, and optionally to reset various
+** highwater marks. ^The first argument is an integer code for
+** the specific parameter to measure. ^(Recognized integer codes
+** are of the form [status parameters | SQLITE_STATUS_...].)^
+** ^The current value of the parameter is returned into *pCurrent.
+** ^The highest recorded value is returned in *pHighwater. ^If the
+** resetFlag is true, then the highest record value is reset after
+** *pHighwater is written. ^(Some parameters do not record the highest
+** value. For those parameters
+** nothing is written into *pHighwater and the resetFlag is ignored.)^
+** ^(Other parameters record only the highwater mark and not the current
+** value. For these latter parameters nothing is written into *pCurrent.)^
+**
+** ^The sqlite3_status() and sqlite3_status64() routines return
+** SQLITE_OK on success and a non-zero [error code] on failure.
+**
+** If either the current value or the highwater mark is too large to
+** be represented by a 32-bit integer, then the values returned by
+** sqlite3_status() are undefined.
+**
+** See also: [sqlite3_db_status()]
+*/
+SQLITE_API int sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag);
+SQLITE_API int sqlite3_status64(
+ int op,
+ sqlite3_int64 *pCurrent,
+ sqlite3_int64 *pHighwater,
+ int resetFlag
+);
+
+
+/*
+** CAPI3REF: Status Parameters
+** KEYWORDS: {status parameters}
+**
+** These integer constants designate various run-time status parameters
+** that can be returned by [sqlite3_status()].
+**
+**
+** [[SQLITE_STATUS_MEMORY_USED]] ^(SQLITE_STATUS_MEMORY_USED
+** This parameter is the current amount of memory checked out
+** using [sqlite3_malloc()], either directly or indirectly. The
+** figure includes calls made to [sqlite3_malloc()] by the application
+** and internal memory usage by the SQLite library. Auxiliary page-cache
+** memory controlled by [SQLITE_CONFIG_PAGECACHE] is not included in
+** this parameter. The amount returned is the sum of the allocation
+** sizes as reported by the xSize method in [sqlite3_mem_methods]. )^
+**
+** [[SQLITE_STATUS_MALLOC_SIZE]] ^(SQLITE_STATUS_MALLOC_SIZE
+** This parameter records the largest memory allocation request
+** handed to [sqlite3_malloc()] or [sqlite3_realloc()] (or their
+** internal equivalents). Only the value returned in the
+** *pHighwater parameter to [sqlite3_status()] is of interest.
+** The value written into the *pCurrent parameter is undefined. )^
+**
+** [[SQLITE_STATUS_MALLOC_COUNT]] ^(SQLITE_STATUS_MALLOC_COUNT
+** This parameter records the number of separate memory allocations
+** currently checked out. )^
+**
+** [[SQLITE_STATUS_PAGECACHE_USED]] ^(SQLITE_STATUS_PAGECACHE_USED
+** This parameter returns the number of pages used out of the
+** [pagecache memory allocator] that was configured using
+** [SQLITE_CONFIG_PAGECACHE]. The
+** value returned is in pages, not in bytes. )^
+**
+** [[SQLITE_STATUS_PAGECACHE_OVERFLOW]]
+** ^(SQLITE_STATUS_PAGECACHE_OVERFLOW
+** This parameter returns the number of bytes of page cache
+** allocation which could not be satisfied by the [SQLITE_CONFIG_PAGECACHE]
+** buffer and where forced to overflow to [sqlite3_malloc()]. The
+** returned value includes allocations that overflowed because they
+** were too large (they were larger than the "sz" parameter to
+** [SQLITE_CONFIG_PAGECACHE]) and allocations that overflowed because
+** no space was left in the page cache. )^
+**
+** [[SQLITE_STATUS_PAGECACHE_SIZE]] ^(SQLITE_STATUS_PAGECACHE_SIZE
+** This parameter records the largest memory allocation request
+** handed to the [pagecache memory allocator]. Only the value returned in the
+** *pHighwater parameter to [sqlite3_status()] is of interest.
+** The value written into the *pCurrent parameter is undefined. )^
+**
+** [[SQLITE_STATUS_SCRATCH_USED]] SQLITE_STATUS_SCRATCH_USED
+** No longer used.
+**
+** [[SQLITE_STATUS_SCRATCH_OVERFLOW]] ^(SQLITE_STATUS_SCRATCH_OVERFLOW
+** No longer used.
+**
+** [[SQLITE_STATUS_SCRATCH_SIZE]] SQLITE_STATUS_SCRATCH_SIZE
+** No longer used.
+**
+** [[SQLITE_STATUS_PARSER_STACK]] ^(SQLITE_STATUS_PARSER_STACK
+** The *pHighwater parameter records the deepest parser stack.
+** The *pCurrent value is undefined. The *pHighwater value is only
+** meaningful if SQLite is compiled with [YYTRACKMAXSTACKDEPTH]. )^
+**
+**
+** New status parameters may be added from time to time.
+*/
+#define SQLITE_STATUS_MEMORY_USED 0
+#define SQLITE_STATUS_PAGECACHE_USED 1
+#define SQLITE_STATUS_PAGECACHE_OVERFLOW 2
+#define SQLITE_STATUS_SCRATCH_USED 3 /* NOT USED */
+#define SQLITE_STATUS_SCRATCH_OVERFLOW 4 /* NOT USED */
+#define SQLITE_STATUS_MALLOC_SIZE 5
+#define SQLITE_STATUS_PARSER_STACK 6
+#define SQLITE_STATUS_PAGECACHE_SIZE 7
+#define SQLITE_STATUS_SCRATCH_SIZE 8 /* NOT USED */
+#define SQLITE_STATUS_MALLOC_COUNT 9
+
+/*
+** CAPI3REF: Database Connection Status
+** METHOD: sqlite3
+**
+** ^This interface is used to retrieve runtime status information
+** about a single [database connection]. ^The first argument is the
+** database connection object to be interrogated. ^The second argument
+** is an integer constant, taken from the set of
+** [SQLITE_DBSTATUS options], that
+** determines the parameter to interrogate. The set of
+** [SQLITE_DBSTATUS options] is likely
+** to grow in future releases of SQLite.
+**
+** ^The current value of the requested parameter is written into *pCur
+** and the highest instantaneous value is written into *pHiwtr. ^If
+** the resetFlg is true, then the highest instantaneous value is
+** reset back down to the current value.
+**
+** ^The sqlite3_db_status() routine returns SQLITE_OK on success and a
+** non-zero [error code] on failure.
+**
+** See also: [sqlite3_status()] and [sqlite3_stmt_status()].
+*/
+SQLITE_API int sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int resetFlg);
+
+/*
+** CAPI3REF: Status Parameters for database connections
+** KEYWORDS: {SQLITE_DBSTATUS options}
+**
+** These constants are the available integer "verbs" that can be passed as
+** the second argument to the [sqlite3_db_status()] interface.
+**
+** New verbs may be added in future releases of SQLite. Existing verbs
+** might be discontinued. Applications should check the return code from
+** [sqlite3_db_status()] to make sure that the call worked.
+** The [sqlite3_db_status()] interface will return a non-zero error code
+** if a discontinued or unsupported verb is invoked.
+**
+**
+** [[SQLITE_DBSTATUS_LOOKASIDE_USED]] ^(SQLITE_DBSTATUS_LOOKASIDE_USED
+** This parameter returns the number of lookaside memory slots currently
+** checked out. )^
+**
+** [[SQLITE_DBSTATUS_LOOKASIDE_HIT]] ^(SQLITE_DBSTATUS_LOOKASIDE_HIT
+** This parameter returns the number of malloc attempts that were
+** satisfied using lookaside memory. Only the high-water value is meaningful;
+** the current value is always zero. )^
+**
+** [[SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE]]
+** ^(SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE
+** This parameter returns the number of malloc attempts that might have
+** been satisfied using lookaside memory but failed due to the amount of
+** memory requested being larger than the lookaside slot size.
+** Only the high-water value is meaningful;
+** the current value is always zero. )^
+**
+** [[SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL]]
+** ^(SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL
+** This parameter returns the number of malloc attempts that might have
+** been satisfied using lookaside memory but failed due to all lookaside
+** memory already being in use.
+** Only the high-water value is meaningful;
+** the current value is always zero. )^
+**
+** [[SQLITE_DBSTATUS_CACHE_USED]] ^(SQLITE_DBSTATUS_CACHE_USED
+** This parameter returns the approximate number of bytes of heap
+** memory used by all pager caches associated with the database connection.)^
+** ^The highwater mark associated with SQLITE_DBSTATUS_CACHE_USED is always 0.
+**
+**
+** [[SQLITE_DBSTATUS_CACHE_USED_SHARED]]
+** ^(SQLITE_DBSTATUS_CACHE_USED_SHARED
+** This parameter is similar to DBSTATUS_CACHE_USED, except that if a
+** pager cache is shared between two or more connections the bytes of heap
+** memory used by that pager cache is divided evenly between the attached
+** connections.)^ In other words, if none of the pager caches associated
+** with the database connection are shared, this request returns the same
+** value as DBSTATUS_CACHE_USED. Or, if one or more of the pager caches are
+** shared, the value returned by this call will be smaller than that returned
+** by DBSTATUS_CACHE_USED. ^The highwater mark associated with
+** SQLITE_DBSTATUS_CACHE_USED_SHARED is always 0.
+**
+** [[SQLITE_DBSTATUS_SCHEMA_USED]] ^(SQLITE_DBSTATUS_SCHEMA_USED
+** This parameter returns the approximate number of bytes of heap
+** memory used to store the schema for all databases associated
+** with the connection - main, temp, and any [ATTACH]-ed databases.)^
+** ^The full amount of memory used by the schemas is reported, even if the
+** schema memory is shared with other database connections due to
+** [shared cache mode] being enabled.
+** ^The highwater mark associated with SQLITE_DBSTATUS_SCHEMA_USED is always 0.
+**
+**
+** [[SQLITE_DBSTATUS_STMT_USED]] ^(SQLITE_DBSTATUS_STMT_USED
+** This parameter returns the approximate number of bytes of heap
+** and lookaside memory used by all prepared statements associated with
+** the database connection.)^
+** ^The highwater mark associated with SQLITE_DBSTATUS_STMT_USED is always 0.
+**
+**
+** [[SQLITE_DBSTATUS_CACHE_HIT]] ^(SQLITE_DBSTATUS_CACHE_HIT
+** This parameter returns the number of pager cache hits that have
+** occurred.)^ ^The highwater mark associated with SQLITE_DBSTATUS_CACHE_HIT
+** is always 0.
+**
+**
+** [[SQLITE_DBSTATUS_CACHE_MISS]] ^(SQLITE_DBSTATUS_CACHE_MISS
+** This parameter returns the number of pager cache misses that have
+** occurred.)^ ^The highwater mark associated with SQLITE_DBSTATUS_CACHE_MISS
+** is always 0.
+**
+**
+** [[SQLITE_DBSTATUS_CACHE_WRITE]] ^(SQLITE_DBSTATUS_CACHE_WRITE
+** This parameter returns the number of dirty cache entries that have
+** been written to disk. Specifically, the number of pages written to the
+** wal file in wal mode databases, or the number of pages written to the
+** database file in rollback mode databases. Any pages written as part of
+** transaction rollback or database recovery operations are not included.
+** If an IO or other error occurs while writing a page to disk, the effect
+** on subsequent SQLITE_DBSTATUS_CACHE_WRITE requests is undefined.)^ ^The
+** highwater mark associated with SQLITE_DBSTATUS_CACHE_WRITE is always 0.
+**
+**
+** [[SQLITE_DBSTATUS_CACHE_SPILL]] ^(SQLITE_DBSTATUS_CACHE_SPILL
+** This parameter returns the number of dirty cache entries that have
+** been written to disk in the middle of a transaction due to the page
+** cache overflowing. Transactions are more efficient if they are written
+** to disk all at once. When pages spill mid-transaction, that introduces
+** additional overhead. This parameter can be used to help identify
+** inefficiencies that can be resolved by increasing the cache size.
+**
+**
+** [[SQLITE_DBSTATUS_DEFERRED_FKS]] ^(SQLITE_DBSTATUS_DEFERRED_FKS
+** This parameter returns zero for the current value if and only if
+** all foreign key constraints (deferred or immediate) have been
+** resolved.)^ ^The highwater mark is always 0.
+**
+**
+*/
+#define SQLITE_DBSTATUS_LOOKASIDE_USED 0
+#define SQLITE_DBSTATUS_CACHE_USED 1
+#define SQLITE_DBSTATUS_SCHEMA_USED 2
+#define SQLITE_DBSTATUS_STMT_USED 3
+#define SQLITE_DBSTATUS_LOOKASIDE_HIT 4
+#define SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE 5
+#define SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL 6
+#define SQLITE_DBSTATUS_CACHE_HIT 7
+#define SQLITE_DBSTATUS_CACHE_MISS 8
+#define SQLITE_DBSTATUS_CACHE_WRITE 9
+#define SQLITE_DBSTATUS_DEFERRED_FKS 10
+#define SQLITE_DBSTATUS_CACHE_USED_SHARED 11
+#define SQLITE_DBSTATUS_CACHE_SPILL 12
+#define SQLITE_DBSTATUS_MAX 12 /* Largest defined DBSTATUS */
+
+
+/*
+** CAPI3REF: Prepared Statement Status
+** METHOD: sqlite3_stmt
+**
+** ^(Each prepared statement maintains various
+** [SQLITE_STMTSTATUS counters] that measure the number
+** of times it has performed specific operations.)^ These counters can
+** be used to monitor the performance characteristics of the prepared
+** statements. For example, if the number of table steps greatly exceeds
+** the number of table searches or result rows, that would tend to indicate
+** that the prepared statement is using a full table scan rather than
+** an index.
+**
+** ^(This interface is used to retrieve and reset counter values from
+** a [prepared statement]. The first argument is the prepared statement
+** object to be interrogated. The second argument
+** is an integer code for a specific [SQLITE_STMTSTATUS counter]
+** to be interrogated.)^
+** ^The current value of the requested counter is returned.
+** ^If the resetFlg is true, then the counter is reset to zero after this
+** interface call returns.
+**
+** See also: [sqlite3_status()] and [sqlite3_db_status()].
+*/
+SQLITE_API int sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg);
+
+/*
+** CAPI3REF: Status Parameters for prepared statements
+** KEYWORDS: {SQLITE_STMTSTATUS counter} {SQLITE_STMTSTATUS counters}
+**
+** These preprocessor macros define integer codes that name counter
+** values associated with the [sqlite3_stmt_status()] interface.
+** The meanings of the various counters are as follows:
+**
+**
+** [[SQLITE_STMTSTATUS_FULLSCAN_STEP]] SQLITE_STMTSTATUS_FULLSCAN_STEP
+** ^This is the number of times that SQLite has stepped forward in
+** a table as part of a full table scan. Large numbers for this counter
+** may indicate opportunities for performance improvement through
+** careful use of indices.
+**
+** [[SQLITE_STMTSTATUS_SORT]] SQLITE_STMTSTATUS_SORT
+** ^This is the number of sort operations that have occurred.
+** A non-zero value in this counter may indicate an opportunity to
+** improve performance through careful use of indices.
+**
+** [[SQLITE_STMTSTATUS_AUTOINDEX]] SQLITE_STMTSTATUS_AUTOINDEX
+** ^This is the number of rows inserted into transient indices that
+** were created automatically in order to help joins run faster.
+** A non-zero value in this counter may indicate an opportunity to
+** improve performance by adding permanent indices that do not
+** need to be reinitialized each time the statement is run.
+**
+** [[SQLITE_STMTSTATUS_VM_STEP]] SQLITE_STMTSTATUS_VM_STEP
+** ^This is the number of virtual machine operations executed
+** by the prepared statement if that number is less than or equal
+** to 2147483647. The number of virtual machine operations can be
+** used as a proxy for the total work done by the prepared statement.
+** If the number of virtual machine operations exceeds 2147483647
+** then the value returned by this statement status code is undefined.
+**
+** [[SQLITE_STMTSTATUS_REPREPARE]] SQLITE_STMTSTATUS_REPREPARE
+** ^This is the number of times that the prepare statement has been
+** automatically regenerated due to schema changes or changes to
+** [bound parameters] that might affect the query plan.
+**
+** [[SQLITE_STMTSTATUS_RUN]] SQLITE_STMTSTATUS_RUN
+** ^This is the number of times that the prepared statement has
+** been run. A single "run" for the purposes of this counter is one
+** or more calls to [sqlite3_step()] followed by a call to [sqlite3_reset()].
+** The counter is incremented on the first [sqlite3_step()] call of each
+** cycle.
+**
+** [[SQLITE_STMTSTATUS_FILTER_MISS]]
+** [[SQLITE_STMTSTATUS_FILTER HIT]]
+** SQLITE_STMTSTATUS_FILTER_HIT
+** SQLITE_STMTSTATUS_FILTER_MISS
+** ^SQLITE_STMTSTATUS_FILTER_HIT is the number of times that a join
+** step was bypassed because a Bloom filter returned not-found. The
+** corresponding SQLITE_STMTSTATUS_FILTER_MISS value is the number of
+** times that the Bloom filter returned a find, and thus the join step
+** had to be processed as normal.
+**
+** [[SQLITE_STMTSTATUS_MEMUSED]] SQLITE_STMTSTATUS_MEMUSED
+** ^This is the approximate number of bytes of heap memory
+** used to store the prepared statement. ^This value is not actually
+** a counter, and so the resetFlg parameter to sqlite3_stmt_status()
+** is ignored when the opcode is SQLITE_STMTSTATUS_MEMUSED.
+**
+**
+*/
+#define SQLITE_STMTSTATUS_FULLSCAN_STEP 1
+#define SQLITE_STMTSTATUS_SORT 2
+#define SQLITE_STMTSTATUS_AUTOINDEX 3
+#define SQLITE_STMTSTATUS_VM_STEP 4
+#define SQLITE_STMTSTATUS_REPREPARE 5
+#define SQLITE_STMTSTATUS_RUN 6
+#define SQLITE_STMTSTATUS_FILTER_MISS 7
+#define SQLITE_STMTSTATUS_FILTER_HIT 8
+#define SQLITE_STMTSTATUS_MEMUSED 99
+
+/*
+** CAPI3REF: Custom Page Cache Object
+**
+** The sqlite3_pcache type is opaque. It is implemented by
+** the pluggable module. The SQLite core has no knowledge of
+** its size or internal structure and never deals with the
+** sqlite3_pcache object except by holding and passing pointers
+** to the object.
+**
+** See [sqlite3_pcache_methods2] for additional information.
+*/
+typedef struct sqlite3_pcache sqlite3_pcache;
+
+/*
+** CAPI3REF: Custom Page Cache Object
+**
+** The sqlite3_pcache_page object represents a single page in the
+** page cache. The page cache will allocate instances of this
+** object. Various methods of the page cache use pointers to instances
+** of this object as parameters or as their return value.
+**
+** See [sqlite3_pcache_methods2] for additional information.
+*/
+typedef struct sqlite3_pcache_page sqlite3_pcache_page;
+struct sqlite3_pcache_page {
+ void *pBuf; /* The content of the page */
+ void *pExtra; /* Extra information associated with the page */
+};
+
+/*
+** CAPI3REF: Application Defined Page Cache.
+** KEYWORDS: {page cache}
+**
+** ^(The [sqlite3_config]([SQLITE_CONFIG_PCACHE2], ...) interface can
+** register an alternative page cache implementation by passing in an
+** instance of the sqlite3_pcache_methods2 structure.)^
+** In many applications, most of the heap memory allocated by
+** SQLite is used for the page cache.
+** By implementing a
+** custom page cache using this API, an application can better control
+** the amount of memory consumed by SQLite, the way in which
+** that memory is allocated and released, and the policies used to
+** determine exactly which parts of a database file are cached and for
+** how long.
+**
+** The alternative page cache mechanism is an
+** extreme measure that is only needed by the most demanding applications.
+** The built-in page cache is recommended for most uses.
+**
+** ^(The contents of the sqlite3_pcache_methods2 structure are copied to an
+** internal buffer by SQLite within the call to [sqlite3_config]. Hence
+** the application may discard the parameter after the call to
+** [sqlite3_config()] returns.)^
+**
+** [[the xInit() page cache method]]
+** ^(The xInit() method is called once for each effective
+** call to [sqlite3_initialize()])^
+** (usually only once during the lifetime of the process). ^(The xInit()
+** method is passed a copy of the sqlite3_pcache_methods2.pArg value.)^
+** The intent of the xInit() method is to set up global data structures
+** required by the custom page cache implementation.
+** ^(If the xInit() method is NULL, then the
+** built-in default page cache is used instead of the application defined
+** page cache.)^
+**
+** [[the xShutdown() page cache method]]
+** ^The xShutdown() method is called by [sqlite3_shutdown()].
+** It can be used to clean up
+** any outstanding resources before process shutdown, if required.
+** ^The xShutdown() method may be NULL.
+**
+** ^SQLite automatically serializes calls to the xInit method,
+** so the xInit method need not be threadsafe. ^The
+** xShutdown method is only called from [sqlite3_shutdown()] so it does
+** not need to be threadsafe either. All other methods must be threadsafe
+** in multithreaded applications.
+**
+** ^SQLite will never invoke xInit() more than once without an intervening
+** call to xShutdown().
+**
+** [[the xCreate() page cache methods]]
+** ^SQLite invokes the xCreate() method to construct a new cache instance.
+** SQLite will typically create one cache instance for each open database file,
+** though this is not guaranteed. ^The
+** first parameter, szPage, is the size in bytes of the pages that must
+** be allocated by the cache. ^szPage will always be a power of two. ^The
+** second parameter szExtra is a number of bytes of extra storage
+** associated with each page cache entry. ^The szExtra parameter will be
+** a number less than 250. SQLite will use the
+** extra szExtra bytes on each page to store metadata about the underlying
+** database page on disk. The value passed into szExtra depends
+** on the SQLite version, the target platform, and how SQLite was compiled.
+** ^The third argument to xCreate(), bPurgeable, is true if the cache being
+** created will be used to cache database pages of a file stored on disk, or
+** false if it is used for an in-memory database. The cache implementation
+** does not have to do anything special based upon the value of bPurgeable;
+** it is purely advisory. ^On a cache where bPurgeable is false, SQLite will
+** never invoke xUnpin() except to deliberately delete a page.
+** ^In other words, calls to xUnpin() on a cache with bPurgeable set to
+** false will always have the "discard" flag set to true.
+** ^Hence, a cache created with bPurgeable set to false will
+** never contain any unpinned pages.
+**
+** [[the xCachesize() page cache method]]
+** ^(The xCachesize() method may be called at any time by SQLite to set the
+** suggested maximum cache-size (number of pages stored) for the cache
+** instance passed as the first argument. This is the value configured using
+** the SQLite "[PRAGMA cache_size]" command.)^ As with the bPurgeable
+** parameter, the implementation is not required to do anything with this
+** value; it is advisory only.
+**
+** [[the xPagecount() page cache methods]]
+** The xPagecount() method must return the number of pages currently
+** stored in the cache, both pinned and unpinned.
+**
+** [[the xFetch() page cache methods]]
+** The xFetch() method locates a page in the cache and returns a pointer to
+** an sqlite3_pcache_page object associated with that page, or a NULL pointer.
+** The pBuf element of the returned sqlite3_pcache_page object will be a
+** pointer to a buffer of szPage bytes used to store the content of a
+** single database page. The pExtra element of sqlite3_pcache_page will be
+** a pointer to the szExtra bytes of extra storage that SQLite has requested
+** for each entry in the page cache.
+**
+** The page to be fetched is determined by the key. ^The minimum key value
+** is 1. After it has been retrieved using xFetch, the page is considered
+** to be "pinned".
+**
+** If the requested page is already in the page cache, then the page cache
+** implementation must return a pointer to the page buffer with its content
+** intact. If the requested page is not already in the cache, then the
+** cache implementation should use the value of the createFlag
+** parameter to help it determine what action to take:
+**
+**
+** createFlag Behavior when page is not already in cache
+** 0 Do not allocate a new page. Return NULL.
+** 1 Allocate a new page if it is easy and convenient to do so.
+** Otherwise return NULL.
+** 2 Make every effort to allocate a new page. Only return
+** NULL if allocating a new page is effectively impossible.
+**
+**
+** ^(SQLite will normally invoke xFetch() with a createFlag of 0 or 1. SQLite
+** will only use a createFlag of 2 after a prior call with a createFlag of 1
+** failed.)^ In between the xFetch() calls, SQLite may
+** attempt to unpin one or more cache pages by spilling the content of
+** pinned pages to disk and synching the operating system disk cache.
+**
+** [[the xUnpin() page cache method]]
+** ^xUnpin() is called by SQLite with a pointer to a currently pinned page
+** as its second argument. If the third parameter, discard, is non-zero,
+** then the page must be evicted from the cache.
+** ^If the discard parameter is
+** zero, then the page may be discarded or retained at the discretion of the
+** page cache implementation. ^The page cache implementation
+** may choose to evict unpinned pages at any time.
+**
+** The cache must not perform any reference counting. A single
+** call to xUnpin() unpins the page regardless of the number of prior calls
+** to xFetch().
+**
+** [[the xRekey() page cache methods]]
+** The xRekey() method is used to change the key value associated with the
+** page passed as the second argument. If the cache
+** previously contains an entry associated with newKey, it must be
+** discarded. ^Any prior cache entry associated with newKey is guaranteed not
+** to be pinned.
+**
+** When SQLite calls the xTruncate() method, the cache must discard all
+** existing cache entries with page numbers (keys) greater than or equal
+** to the value of the iLimit parameter passed to xTruncate(). If any
+** of these pages are pinned, they become implicitly unpinned, meaning that
+** they can be safely discarded.
+**
+** [[the xDestroy() page cache method]]
+** ^The xDestroy() method is used to delete a cache allocated by xCreate().
+** All resources associated with the specified cache should be freed. ^After
+** calling the xDestroy() method, SQLite considers the [sqlite3_pcache*]
+** handle invalid, and will not use it with any other sqlite3_pcache_methods2
+** functions.
+**
+** [[the xShrink() page cache method]]
+** ^SQLite invokes the xShrink() method when it wants the page cache to
+** free up as much of heap memory as possible. The page cache implementation
+** is not obligated to free any memory, but well-behaved implementations should
+** do their best.
+*/
+typedef struct sqlite3_pcache_methods2 sqlite3_pcache_methods2;
+struct sqlite3_pcache_methods2 {
+ int iVersion;
+ void *pArg;
+ int (*xInit)(void*);
+ void (*xShutdown)(void*);
+ sqlite3_pcache *(*xCreate)(int szPage, int szExtra, int bPurgeable);
+ void (*xCachesize)(sqlite3_pcache*, int nCachesize);
+ int (*xPagecount)(sqlite3_pcache*);
+ sqlite3_pcache_page *(*xFetch)(sqlite3_pcache*, unsigned key, int createFlag);
+ void (*xUnpin)(sqlite3_pcache*, sqlite3_pcache_page*, int discard);
+ void (*xRekey)(sqlite3_pcache*, sqlite3_pcache_page*,
+ unsigned oldKey, unsigned newKey);
+ void (*xTruncate)(sqlite3_pcache*, unsigned iLimit);
+ void (*xDestroy)(sqlite3_pcache*);
+ void (*xShrink)(sqlite3_pcache*);
+};
+
+/*
+** This is the obsolete pcache_methods object that has now been replaced
+** by sqlite3_pcache_methods2. This object is not used by SQLite. It is
+** retained in the header file for backwards compatibility only.
+*/
+typedef struct sqlite3_pcache_methods sqlite3_pcache_methods;
+struct sqlite3_pcache_methods {
+ void *pArg;
+ int (*xInit)(void*);
+ void (*xShutdown)(void*);
+ sqlite3_pcache *(*xCreate)(int szPage, int bPurgeable);
+ void (*xCachesize)(sqlite3_pcache*, int nCachesize);
+ int (*xPagecount)(sqlite3_pcache*);
+ void *(*xFetch)(sqlite3_pcache*, unsigned key, int createFlag);
+ void (*xUnpin)(sqlite3_pcache*, void*, int discard);
+ void (*xRekey)(sqlite3_pcache*, void*, unsigned oldKey, unsigned newKey);
+ void (*xTruncate)(sqlite3_pcache*, unsigned iLimit);
+ void (*xDestroy)(sqlite3_pcache*);
+};
+
+
+/*
+** CAPI3REF: Online Backup Object
+**
+** The sqlite3_backup object records state information about an ongoing
+** online backup operation. ^The sqlite3_backup object is created by
+** a call to [sqlite3_backup_init()] and is destroyed by a call to
+** [sqlite3_backup_finish()].
+**
+** See Also: [Using the SQLite Online Backup API]
+*/
+typedef struct sqlite3_backup sqlite3_backup;
+
+/*
+** CAPI3REF: Online Backup API.
+**
+** The backup API copies the content of one database into another.
+** It is useful either for creating backups of databases or
+** for copying in-memory databases to or from persistent files.
+**
+** See Also: [Using the SQLite Online Backup API]
+**
+** ^SQLite holds a write transaction open on the destination database file
+** for the duration of the backup operation.
+** ^The source database is read-locked only while it is being read;
+** it is not locked continuously for the entire backup operation.
+** ^Thus, the backup may be performed on a live source database without
+** preventing other database connections from
+** reading or writing to the source database while the backup is underway.
+**
+** ^(To perform a backup operation:
+**
+** sqlite3_backup_init() is called once to initialize the
+** backup,
+** sqlite3_backup_step() is called one or more times to transfer
+** the data between the two databases, and finally
+** sqlite3_backup_finish() is called to release all resources
+** associated with the backup operation.
+** )^
+** There should be exactly one call to sqlite3_backup_finish() for each
+** successful call to sqlite3_backup_init().
+**
+** [[sqlite3_backup_init()]] sqlite3_backup_init()
+**
+** ^The D and N arguments to sqlite3_backup_init(D,N,S,M) are the
+** [database connection] associated with the destination database
+** and the database name, respectively.
+** ^The database name is "main" for the main database, "temp" for the
+** temporary database, or the name specified after the AS keyword in
+** an [ATTACH] statement for an attached database.
+** ^The S and M arguments passed to
+** sqlite3_backup_init(D,N,S,M) identify the [database connection]
+** and database name of the source database, respectively.
+** ^The source and destination [database connections] (parameters S and D)
+** must be different or else sqlite3_backup_init(D,N,S,M) will fail with
+** an error.
+**
+** ^A call to sqlite3_backup_init() will fail, returning NULL, if
+** there is already a read or read-write transaction open on the
+** destination database.
+**
+** ^If an error occurs within sqlite3_backup_init(D,N,S,M), then NULL is
+** returned and an error code and error message are stored in the
+** destination [database connection] D.
+** ^The error code and message for the failed call to sqlite3_backup_init()
+** can be retrieved using the [sqlite3_errcode()], [sqlite3_errmsg()], and/or
+** [sqlite3_errmsg16()] functions.
+** ^A successful call to sqlite3_backup_init() returns a pointer to an
+** [sqlite3_backup] object.
+** ^The [sqlite3_backup] object may be used with the sqlite3_backup_step() and
+** sqlite3_backup_finish() functions to perform the specified backup
+** operation.
+**
+** [[sqlite3_backup_step()]] sqlite3_backup_step()
+**
+** ^Function sqlite3_backup_step(B,N) will copy up to N pages between
+** the source and destination databases specified by [sqlite3_backup] object B.
+** ^If N is negative, all remaining source pages are copied.
+** ^If sqlite3_backup_step(B,N) successfully copies N pages and there
+** are still more pages to be copied, then the function returns [SQLITE_OK].
+** ^If sqlite3_backup_step(B,N) successfully finishes copying all pages
+** from source to destination, then it returns [SQLITE_DONE].
+** ^If an error occurs while running sqlite3_backup_step(B,N),
+** then an [error code] is returned. ^As well as [SQLITE_OK] and
+** [SQLITE_DONE], a call to sqlite3_backup_step() may return [SQLITE_READONLY],
+** [SQLITE_NOMEM], [SQLITE_BUSY], [SQLITE_LOCKED], or an
+** [SQLITE_IOERR_ACCESS | SQLITE_IOERR_XXX] extended error code.
+**
+** ^(The sqlite3_backup_step() might return [SQLITE_READONLY] if
+**
+** the destination database was opened read-only, or
+** the destination database is using write-ahead-log journaling
+** and the destination and source page sizes differ, or
+** the destination database is an in-memory database and the
+** destination and source page sizes differ.
+** )^
+**
+** ^If sqlite3_backup_step() cannot obtain a required file-system lock, then
+** the [sqlite3_busy_handler | busy-handler function]
+** is invoked (if one is specified). ^If the
+** busy-handler returns non-zero before the lock is available, then
+** [SQLITE_BUSY] is returned to the caller. ^In this case the call to
+** sqlite3_backup_step() can be retried later. ^If the source
+** [database connection]
+** is being used to write to the source database when sqlite3_backup_step()
+** is called, then [SQLITE_LOCKED] is returned immediately. ^Again, in this
+** case the call to sqlite3_backup_step() can be retried later on. ^(If
+** [SQLITE_IOERR_ACCESS | SQLITE_IOERR_XXX], [SQLITE_NOMEM], or
+** [SQLITE_READONLY] is returned, then
+** there is no point in retrying the call to sqlite3_backup_step(). These
+** errors are considered fatal.)^ The application must accept
+** that the backup operation has failed and pass the backup operation handle
+** to the sqlite3_backup_finish() to release associated resources.
+**
+** ^The first call to sqlite3_backup_step() obtains an exclusive lock
+** on the destination file. ^The exclusive lock is not released until either
+** sqlite3_backup_finish() is called or the backup operation is complete
+** and sqlite3_backup_step() returns [SQLITE_DONE]. ^Every call to
+** sqlite3_backup_step() obtains a [shared lock] on the source database that
+** lasts for the duration of the sqlite3_backup_step() call.
+** ^Because the source database is not locked between calls to
+** sqlite3_backup_step(), the source database may be modified mid-way
+** through the backup process. ^If the source database is modified by an
+** external process or via a database connection other than the one being
+** used by the backup operation, then the backup will be automatically
+** restarted by the next call to sqlite3_backup_step(). ^If the source
+** database is modified by using the same database connection as is used
+** by the backup operation, then the backup database is automatically
+** updated at the same time.
+**
+** [[sqlite3_backup_finish()]] sqlite3_backup_finish()
+**
+** When sqlite3_backup_step() has returned [SQLITE_DONE], or when the
+** application wishes to abandon the backup operation, the application
+** should destroy the [sqlite3_backup] by passing it to sqlite3_backup_finish().
+** ^The sqlite3_backup_finish() interfaces releases all
+** resources associated with the [sqlite3_backup] object.
+** ^If sqlite3_backup_step() has not yet returned [SQLITE_DONE], then any
+** active write-transaction on the destination database is rolled back.
+** The [sqlite3_backup] object is invalid
+** and may not be used following a call to sqlite3_backup_finish().
+**
+** ^The value returned by sqlite3_backup_finish is [SQLITE_OK] if no
+** sqlite3_backup_step() errors occurred, regardless of whether or not
+** sqlite3_backup_step() completed.
+** ^If an out-of-memory condition or IO error occurred during any prior
+** sqlite3_backup_step() call on the same [sqlite3_backup] object, then
+** sqlite3_backup_finish() returns the corresponding [error code].
+**
+** ^A return of [SQLITE_BUSY] or [SQLITE_LOCKED] from sqlite3_backup_step()
+** is not a permanent error and does not affect the return value of
+** sqlite3_backup_finish().
+**
+** [[sqlite3_backup_remaining()]] [[sqlite3_backup_pagecount()]]
+** sqlite3_backup_remaining() and sqlite3_backup_pagecount()
+**
+** ^The sqlite3_backup_remaining() routine returns the number of pages still
+** to be backed up at the conclusion of the most recent sqlite3_backup_step().
+** ^The sqlite3_backup_pagecount() routine returns the total number of pages
+** in the source database at the conclusion of the most recent
+** sqlite3_backup_step().
+** ^(The values returned by these functions are only updated by
+** sqlite3_backup_step(). If the source database is modified in a way that
+** changes the size of the source database or the number of pages remaining,
+** those changes are not reflected in the output of sqlite3_backup_pagecount()
+** and sqlite3_backup_remaining() until after the next
+** sqlite3_backup_step().)^
+**
+** Concurrent Usage of Database Handles
+**
+** ^The source [database connection] may be used by the application for other
+** purposes while a backup operation is underway or being initialized.
+** ^If SQLite is compiled and configured to support threadsafe database
+** connections, then the source database connection may be used concurrently
+** from within other threads.
+**
+** However, the application must guarantee that the destination
+** [database connection] is not passed to any other API (by any thread) after
+** sqlite3_backup_init() is called and before the corresponding call to
+** sqlite3_backup_finish(). SQLite does not currently check to see
+** if the application incorrectly accesses the destination [database connection]
+** and so no error code is reported, but the operations may malfunction
+** nevertheless. Use of the destination database connection while a
+** backup is in progress might also cause a mutex deadlock.
+**
+** If running in [shared cache mode], the application must
+** guarantee that the shared cache used by the destination database
+** is not accessed while the backup is running. In practice this means
+** that the application must guarantee that the disk file being
+** backed up to is not accessed by any connection within the process,
+** not just the specific connection that was passed to sqlite3_backup_init().
+**
+** The [sqlite3_backup] object itself is partially threadsafe. Multiple
+** threads may safely make multiple concurrent calls to sqlite3_backup_step().
+** However, the sqlite3_backup_remaining() and sqlite3_backup_pagecount()
+** APIs are not strictly speaking threadsafe. If they are invoked at the
+** same time as another thread is invoking sqlite3_backup_step() it is
+** possible that they return invalid values.
+**
+** Alternatives To Using The Backup API
+**
+** Other techniques for safely creating a consistent backup of an SQLite
+** database include:
+**
+**
+** The [VACUUM INTO] command.
+** The [sqlite3_rsync] utility program.
+**
+*/
+SQLITE_API sqlite3_backup *sqlite3_backup_init(
+ sqlite3 *pDest, /* Destination database handle */
+ const char *zDestName, /* Destination database name */
+ sqlite3 *pSource, /* Source database handle */
+ const char *zSourceName /* Source database name */
+);
+SQLITE_API int sqlite3_backup_step(sqlite3_backup *p, int nPage);
+SQLITE_API int sqlite3_backup_finish(sqlite3_backup *p);
+SQLITE_API int sqlite3_backup_remaining(sqlite3_backup *p);
+SQLITE_API int sqlite3_backup_pagecount(sqlite3_backup *p);
+
+/*
+** CAPI3REF: Unlock Notification
+** METHOD: sqlite3
+**
+** ^When running in shared-cache mode, a database operation may fail with
+** an [SQLITE_LOCKED] error if the required locks on the shared-cache or
+** individual tables within the shared-cache cannot be obtained. See
+** [SQLite Shared-Cache Mode] for a description of shared-cache locking.
+** ^This API may be used to register a callback that SQLite will invoke
+** when the connection currently holding the required lock relinquishes it.
+** ^This API is only available if the library was compiled with the
+** [SQLITE_ENABLE_UNLOCK_NOTIFY] C-preprocessor symbol defined.
+**
+** See Also: [Using the SQLite Unlock Notification Feature].
+**
+** ^Shared-cache locks are released when a database connection concludes
+** its current transaction, either by committing it or rolling it back.
+**
+** ^When a connection (known as the blocked connection) fails to obtain a
+** shared-cache lock and SQLITE_LOCKED is returned to the caller, the
+** identity of the database connection (the blocking connection) that
+** has locked the required resource is stored internally. ^After an
+** application receives an SQLITE_LOCKED error, it may call the
+** sqlite3_unlock_notify() method with the blocked connection handle as
+** the first argument to register for a callback that will be invoked
+** when the blocking connection's current transaction is concluded. ^The
+** callback is invoked from within the [sqlite3_step] or [sqlite3_close]
+** call that concludes the blocking connection's transaction.
+**
+** ^(If sqlite3_unlock_notify() is called in a multi-threaded application,
+** there is a chance that the blocking connection will have already
+** concluded its transaction by the time sqlite3_unlock_notify() is invoked.
+** If this happens, then the specified callback is invoked immediately,
+** from within the call to sqlite3_unlock_notify().)^
+**
+** ^If the blocked connection is attempting to obtain a write-lock on a
+** shared-cache table, and more than one other connection currently holds
+** a read-lock on the same table, then SQLite arbitrarily selects one of
+** the other connections to use as the blocking connection.
+**
+** ^(There may be at most one unlock-notify callback registered by a
+** blocked connection. If sqlite3_unlock_notify() is called when the
+** blocked connection already has a registered unlock-notify callback,
+** then the new callback replaces the old.)^ ^If sqlite3_unlock_notify() is
+** called with a NULL pointer as its second argument, then any existing
+** unlock-notify callback is canceled. ^The blocked connection's
+** unlock-notify callback may also be canceled by closing the blocked
+** connection using [sqlite3_close()].
+**
+** The unlock-notify callback is not reentrant. If an application invokes
+** any sqlite3_xxx API functions from within an unlock-notify callback, a
+** crash or deadlock may be the result.
+**
+** ^Unless deadlock is detected (see below), sqlite3_unlock_notify() always
+** returns SQLITE_OK.
+**
+** Callback Invocation Details
+**
+** When an unlock-notify callback is registered, the application provides a
+** single void* pointer that is passed to the callback when it is invoked.
+** However, the signature of the callback function allows SQLite to pass
+** it an array of void* context pointers. The first argument passed to
+** an unlock-notify callback is a pointer to an array of void* pointers,
+** and the second is the number of entries in the array.
+**
+** When a blocking connection's transaction is concluded, there may be
+** more than one blocked connection that has registered for an unlock-notify
+** callback. ^If two or more such blocked connections have specified the
+** same callback function, then instead of invoking the callback function
+** multiple times, it is invoked once with the set of void* context pointers
+** specified by the blocked connections bundled together into an array.
+** This gives the application an opportunity to prioritize any actions
+** related to the set of unblocked database connections.
+**
+** Deadlock Detection
+**
+** Assuming that after registering for an unlock-notify callback a
+** database waits for the callback to be issued before taking any further
+** action (a reasonable assumption), then using this API may cause the
+** application to deadlock. For example, if connection X is waiting for
+** connection Y's transaction to be concluded, and similarly connection
+** Y is waiting on connection X's transaction, then neither connection
+** will proceed and the system may remain deadlocked indefinitely.
+**
+** To avoid this scenario, the sqlite3_unlock_notify() performs deadlock
+** detection. ^If a given call to sqlite3_unlock_notify() would put the
+** system in a deadlocked state, then SQLITE_LOCKED is returned and no
+** unlock-notify callback is registered. The system is said to be in
+** a deadlocked state if connection A has registered for an unlock-notify
+** callback on the conclusion of connection B's transaction, and connection
+** B has itself registered for an unlock-notify callback when connection
+** A's transaction is concluded. ^Indirect deadlock is also detected, so
+** the system is also considered to be deadlocked if connection B has
+** registered for an unlock-notify callback on the conclusion of connection
+** C's transaction, where connection C is waiting on connection A. ^Any
+** number of levels of indirection are allowed.
+**
+** The "DROP TABLE" Exception
+**
+** When a call to [sqlite3_step()] returns SQLITE_LOCKED, it is almost
+** always appropriate to call sqlite3_unlock_notify(). There is however,
+** one exception. When executing a "DROP TABLE" or "DROP INDEX" statement,
+** SQLite checks if there are any currently executing SELECT statements
+** that belong to the same connection. If there are, SQLITE_LOCKED is
+** returned. In this case there is no "blocking connection", so invoking
+** sqlite3_unlock_notify() results in the unlock-notify callback being
+** invoked immediately. If the application then re-attempts the "DROP TABLE"
+** or "DROP INDEX" query, an infinite loop might be the result.
+**
+** One way around this problem is to check the extended error code returned
+** by an sqlite3_step() call. ^(If there is a blocking connection, then the
+** extended error code is set to SQLITE_LOCKED_SHAREDCACHE. Otherwise, in
+** the special "DROP TABLE/INDEX" case, the extended error code is just
+** SQLITE_LOCKED.)^
+*/
+SQLITE_API int sqlite3_unlock_notify(
+ sqlite3 *pBlocked, /* Waiting connection */
+ void (*xNotify)(void **apArg, int nArg), /* Callback function to invoke */
+ void *pNotifyArg /* Argument to pass to xNotify */
+);
+
+
+/*
+** CAPI3REF: String Comparison
+**
+** ^The [sqlite3_stricmp()] and [sqlite3_strnicmp()] APIs allow applications
+** and extensions to compare the contents of two buffers containing UTF-8
+** strings in a case-independent fashion, using the same definition of "case
+** independence" that SQLite uses internally when comparing identifiers.
+*/
+SQLITE_API int sqlite3_stricmp(const char *, const char *);
+SQLITE_API int sqlite3_strnicmp(const char *, const char *, int);
+
+/*
+** CAPI3REF: String Globbing
+*
+** ^The [sqlite3_strglob(P,X)] interface returns zero if and only if
+** string X matches the [GLOB] pattern P.
+** ^The definition of [GLOB] pattern matching used in
+** [sqlite3_strglob(P,X)] is the same as for the "X GLOB P" operator in the
+** SQL dialect understood by SQLite. ^The [sqlite3_strglob(P,X)] function
+** is case sensitive.
+**
+** Note that this routine returns zero on a match and non-zero if the strings
+** do not match, the same as [sqlite3_stricmp()] and [sqlite3_strnicmp()].
+**
+** See also: [sqlite3_strlike()].
+*/
+SQLITE_API int sqlite3_strglob(const char *zGlob, const char *zStr);
+
+/*
+** CAPI3REF: String LIKE Matching
+*
+** ^The [sqlite3_strlike(P,X,E)] interface returns zero if and only if
+** string X matches the [LIKE] pattern P with escape character E.
+** ^The definition of [LIKE] pattern matching used in
+** [sqlite3_strlike(P,X,E)] is the same as for the "X LIKE P ESCAPE E"
+** operator in the SQL dialect understood by SQLite. ^For "X LIKE P" without
+** the ESCAPE clause, set the E parameter of [sqlite3_strlike(P,X,E)] to 0.
+** ^As with the LIKE operator, the [sqlite3_strlike(P,X,E)] function is case
+** insensitive - equivalent upper and lower case ASCII characters match
+** one another.
+**
+** ^The [sqlite3_strlike(P,X,E)] function matches Unicode characters, though
+** only ASCII characters are case folded.
+**
+** Note that this routine returns zero on a match and non-zero if the strings
+** do not match, the same as [sqlite3_stricmp()] and [sqlite3_strnicmp()].
+**
+** See also: [sqlite3_strglob()].
+*/
+SQLITE_API int sqlite3_strlike(const char *zGlob, const char *zStr, unsigned int cEsc);
+
+/*
+** CAPI3REF: Error Logging Interface
+**
+** ^The [sqlite3_log()] interface writes a message into the [error log]
+** established by the [SQLITE_CONFIG_LOG] option to [sqlite3_config()].
+** ^If logging is enabled, the zFormat string and subsequent arguments are
+** used with [sqlite3_snprintf()] to generate the final output string.
+**
+** The sqlite3_log() interface is intended for use by extensions such as
+** virtual tables, collating functions, and SQL functions. While there is
+** nothing to prevent an application from calling sqlite3_log(), doing so
+** is considered bad form.
+**
+** The zFormat string must not be NULL.
+**
+** To avoid deadlocks and other threading problems, the sqlite3_log() routine
+** will not use dynamically allocated memory. The log message is stored in
+** a fixed-length buffer on the stack. If the log message is longer than
+** a few hundred characters, it will be truncated to the length of the
+** buffer.
+*/
+SQLITE_API void sqlite3_log(int iErrCode, const char *zFormat, ...);
+
+/*
+** CAPI3REF: Write-Ahead Log Commit Hook
+** METHOD: sqlite3
+**
+** ^The [sqlite3_wal_hook()] function is used to register a callback that
+** is invoked each time data is committed to a database in wal mode.
+**
+** ^(The callback is invoked by SQLite after the commit has taken place and
+** the associated write-lock on the database released)^, so the implementation
+** may read, write or [checkpoint] the database as required.
+**
+** ^The first parameter passed to the callback function when it is invoked
+** is a copy of the third parameter passed to sqlite3_wal_hook() when
+** registering the callback. ^The second is a copy of the database handle.
+** ^The third parameter is the name of the database that was written to -
+** either "main" or the name of an [ATTACH]-ed database. ^The fourth parameter
+** is the number of pages currently in the write-ahead log file,
+** including those that were just committed.
+**
+** The callback function should normally return [SQLITE_OK]. ^If an error
+** code is returned, that error will propagate back up through the
+** SQLite code base to cause the statement that provoked the callback
+** to report an error, though the commit will have still occurred. If the
+** callback returns [SQLITE_ROW] or [SQLITE_DONE], or if it returns a value
+** that does not correspond to any valid SQLite error code, the results
+** are undefined.
+**
+** A single database handle may have at most a single write-ahead log callback
+** registered at one time. ^Calling [sqlite3_wal_hook()] replaces any
+** previously registered write-ahead log callback. ^The return value is
+** a copy of the third parameter from the previous call, if any, or 0.
+** ^Note that the [sqlite3_wal_autocheckpoint()] interface and the
+** [wal_autocheckpoint pragma] both invoke [sqlite3_wal_hook()] and will
+** overwrite any prior [sqlite3_wal_hook()] settings.
+*/
+SQLITE_API void *sqlite3_wal_hook(
+ sqlite3*,
+ int(*)(void *,sqlite3*,const char*,int),
+ void*
+);
+
+/*
+** CAPI3REF: Configure an auto-checkpoint
+** METHOD: sqlite3
+**
+** ^The [sqlite3_wal_autocheckpoint(D,N)] is a wrapper around
+** [sqlite3_wal_hook()] that causes any database on [database connection] D
+** to automatically [checkpoint]
+** after committing a transaction if there are N or
+** more frames in the [write-ahead log] file. ^Passing zero or
+** a negative value as the nFrame parameter disables automatic
+** checkpoints entirely.
+**
+** ^The callback registered by this function replaces any existing callback
+** registered using [sqlite3_wal_hook()]. ^Likewise, registering a callback
+** using [sqlite3_wal_hook()] disables the automatic checkpoint mechanism
+** configured by this function.
+**
+** ^The [wal_autocheckpoint pragma] can be used to invoke this interface
+** from SQL.
+**
+** ^Checkpoints initiated by this mechanism are
+** [sqlite3_wal_checkpoint_v2|PASSIVE].
+**
+** ^Every new [database connection] defaults to having the auto-checkpoint
+** enabled with a threshold of 1000 or [SQLITE_DEFAULT_WAL_AUTOCHECKPOINT]
+** pages. The use of this interface
+** is only necessary if the default setting is found to be suboptimal
+** for a particular application.
+*/
+SQLITE_API int sqlite3_wal_autocheckpoint(sqlite3 *db, int N);
+
+/*
+** CAPI3REF: Checkpoint a database
+** METHOD: sqlite3
+**
+** ^(The sqlite3_wal_checkpoint(D,X) is equivalent to
+** [sqlite3_wal_checkpoint_v2](D,X,[SQLITE_CHECKPOINT_PASSIVE],0,0).)^
+**
+** In brief, sqlite3_wal_checkpoint(D,X) causes the content in the
+** [write-ahead log] for database X on [database connection] D to be
+** transferred into the database file and for the write-ahead log to
+** be reset. See the [checkpointing] documentation for addition
+** information.
+**
+** This interface used to be the only way to cause a checkpoint to
+** occur. But then the newer and more powerful [sqlite3_wal_checkpoint_v2()]
+** interface was added. This interface is retained for backwards
+** compatibility and as a convenience for applications that need to manually
+** start a callback but which do not need the full power (and corresponding
+** complication) of [sqlite3_wal_checkpoint_v2()].
+*/
+SQLITE_API int sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb);
+
+/*
+** CAPI3REF: Checkpoint a database
+** METHOD: sqlite3
+**
+** ^(The sqlite3_wal_checkpoint_v2(D,X,M,L,C) interface runs a checkpoint
+** operation on database X of [database connection] D in mode M. Status
+** information is written back into integers pointed to by L and C.)^
+** ^(The M parameter must be a valid [checkpoint mode]:)^
+**
+**
+** SQLITE_CHECKPOINT_PASSIVE
+** ^Checkpoint as many frames as possible without waiting for any database
+** readers or writers to finish, then sync the database file if all frames
+** in the log were checkpointed. ^The [busy-handler callback]
+** is never invoked in the SQLITE_CHECKPOINT_PASSIVE mode.
+** ^On the other hand, passive mode might leave the checkpoint unfinished
+** if there are concurrent readers or writers.
+**
+** SQLITE_CHECKPOINT_FULL
+** ^This mode blocks (it invokes the
+** [sqlite3_busy_handler|busy-handler callback]) until there is no
+** database writer and all readers are reading from the most recent database
+** snapshot. ^It then checkpoints all frames in the log file and syncs the
+** database file. ^This mode blocks new database writers while it is pending,
+** but new database readers are allowed to continue unimpeded.
+**
+** SQLITE_CHECKPOINT_RESTART
+** ^This mode works the same way as SQLITE_CHECKPOINT_FULL with the addition
+** that after checkpointing the log file it blocks (calls the
+** [busy-handler callback])
+** until all readers are reading from the database file only. ^This ensures
+** that the next writer will restart the log file from the beginning.
+** ^Like SQLITE_CHECKPOINT_FULL, this mode blocks new
+** database writer attempts while it is pending, but does not impede readers.
+**
+** SQLITE_CHECKPOINT_TRUNCATE
+** ^This mode works the same way as SQLITE_CHECKPOINT_RESTART with the
+** addition that it also truncates the log file to zero bytes just prior
+** to a successful return.
+**
+**
+** ^If pnLog is not NULL, then *pnLog is set to the total number of frames in
+** the log file or to -1 if the checkpoint could not run because
+** of an error or because the database is not in [WAL mode]. ^If pnCkpt is not
+** NULL,then *pnCkpt is set to the total number of checkpointed frames in the
+** log file (including any that were already checkpointed before the function
+** was called) or to -1 if the checkpoint could not run due to an error or
+** because the database is not in WAL mode. ^Note that upon successful
+** completion of an SQLITE_CHECKPOINT_TRUNCATE, the log file will have been
+** truncated to zero bytes and so both *pnLog and *pnCkpt will be set to zero.
+**
+** ^All calls obtain an exclusive "checkpoint" lock on the database file. ^If
+** any other process is running a checkpoint operation at the same time, the
+** lock cannot be obtained and SQLITE_BUSY is returned. ^Even if there is a
+** busy-handler configured, it will not be invoked in this case.
+**
+** ^The SQLITE_CHECKPOINT_FULL, RESTART and TRUNCATE modes also obtain the
+** exclusive "writer" lock on the database file. ^If the writer lock cannot be
+** obtained immediately, and a busy-handler is configured, it is invoked and
+** the writer lock retried until either the busy-handler returns 0 or the lock
+** is successfully obtained. ^The busy-handler is also invoked while waiting for
+** database readers as described above. ^If the busy-handler returns 0 before
+** the writer lock is obtained or while waiting for database readers, the
+** checkpoint operation proceeds from that point in the same way as
+** SQLITE_CHECKPOINT_PASSIVE - checkpointing as many frames as possible
+** without blocking any further. ^SQLITE_BUSY is returned in this case.
+**
+** ^If parameter zDb is NULL or points to a zero length string, then the
+** specified operation is attempted on all WAL databases [attached] to
+** [database connection] db. In this case the
+** values written to output parameters *pnLog and *pnCkpt are undefined. ^If
+** an SQLITE_BUSY error is encountered when processing one or more of the
+** attached WAL databases, the operation is still attempted on any remaining
+** attached databases and SQLITE_BUSY is returned at the end. ^If any other
+** error occurs while processing an attached database, processing is abandoned
+** and the error code is returned to the caller immediately. ^If no error
+** (SQLITE_BUSY or otherwise) is encountered while processing the attached
+** databases, SQLITE_OK is returned.
+**
+** ^If database zDb is the name of an attached database that is not in WAL
+** mode, SQLITE_OK is returned and both *pnLog and *pnCkpt set to -1. ^If
+** zDb is not NULL (or a zero length string) and is not the name of any
+** attached database, SQLITE_ERROR is returned to the caller.
+**
+** ^Unless it returns SQLITE_MISUSE,
+** the sqlite3_wal_checkpoint_v2() interface
+** sets the error information that is queried by
+** [sqlite3_errcode()] and [sqlite3_errmsg()].
+**
+** ^The [PRAGMA wal_checkpoint] command can be used to invoke this interface
+** from SQL.
+*/
+SQLITE_API int sqlite3_wal_checkpoint_v2(
+ sqlite3 *db, /* Database handle */
+ const char *zDb, /* Name of attached database (or NULL) */
+ int eMode, /* SQLITE_CHECKPOINT_* value */
+ int *pnLog, /* OUT: Size of WAL log in frames */
+ int *pnCkpt /* OUT: Total number of frames checkpointed */
+);
+
+/*
+** CAPI3REF: Checkpoint Mode Values
+** KEYWORDS: {checkpoint mode}
+**
+** These constants define all valid values for the "checkpoint mode" passed
+** as the third parameter to the [sqlite3_wal_checkpoint_v2()] interface.
+** See the [sqlite3_wal_checkpoint_v2()] documentation for details on the
+** meaning of each of these checkpoint modes.
+*/
+#define SQLITE_CHECKPOINT_PASSIVE 0 /* Do as much as possible w/o blocking */
+#define SQLITE_CHECKPOINT_FULL 1 /* Wait for writers, then checkpoint */
+#define SQLITE_CHECKPOINT_RESTART 2 /* Like FULL but wait for readers */
+#define SQLITE_CHECKPOINT_TRUNCATE 3 /* Like RESTART but also truncate WAL */
+
+/*
+** CAPI3REF: Virtual Table Interface Configuration
+**
+** This function may be called by either the [xConnect] or [xCreate] method
+** of a [virtual table] implementation to configure
+** various facets of the virtual table interface.
+**
+** If this interface is invoked outside the context of an xConnect or
+** xCreate virtual table method then the behavior is undefined.
+**
+** In the call sqlite3_vtab_config(D,C,...) the D parameter is the
+** [database connection] in which the virtual table is being created and
+** which is passed in as the first argument to the [xConnect] or [xCreate]
+** method that is invoking sqlite3_vtab_config(). The C parameter is one
+** of the [virtual table configuration options]. The presence and meaning
+** of parameters after C depend on which [virtual table configuration option]
+** is used.
+*/
+SQLITE_API int sqlite3_vtab_config(sqlite3*, int op, ...);
+
+/*
+** CAPI3REF: Virtual Table Configuration Options
+** KEYWORDS: {virtual table configuration options}
+** KEYWORDS: {virtual table configuration option}
+**
+** These macros define the various options to the
+** [sqlite3_vtab_config()] interface that [virtual table] implementations
+** can use to customize and optimize their behavior.
+**
+**
+** [[SQLITE_VTAB_CONSTRAINT_SUPPORT]]
+** SQLITE_VTAB_CONSTRAINT_SUPPORT
+** Calls of the form
+** [sqlite3_vtab_config](db,SQLITE_VTAB_CONSTRAINT_SUPPORT,X) are supported,
+** where X is an integer. If X is zero, then the [virtual table] whose
+** [xCreate] or [xConnect] method invoked [sqlite3_vtab_config()] does not
+** support constraints. In this configuration (which is the default) if
+** a call to the [xUpdate] method returns [SQLITE_CONSTRAINT], then the entire
+** statement is rolled back as if [ON CONFLICT | OR ABORT] had been
+** specified as part of the user's SQL statement, regardless of the actual
+** ON CONFLICT mode specified.
+**
+** If X is non-zero, then the virtual table implementation guarantees
+** that if [xUpdate] returns [SQLITE_CONSTRAINT], it will do so before
+** any modifications to internal or persistent data structures have been made.
+** If the [ON CONFLICT] mode is ABORT, FAIL, IGNORE or ROLLBACK, SQLite
+** is able to roll back a statement or database transaction, and abandon
+** or continue processing the current SQL statement as appropriate.
+** If the ON CONFLICT mode is REPLACE and the [xUpdate] method returns
+** [SQLITE_CONSTRAINT], SQLite handles this as if the ON CONFLICT mode
+** had been ABORT.
+**
+** Virtual table implementations that are required to handle OR REPLACE
+** must do so within the [xUpdate] method. If a call to the
+** [sqlite3_vtab_on_conflict()] function indicates that the current ON
+** CONFLICT policy is REPLACE, the virtual table implementation should
+** silently replace the appropriate rows within the xUpdate callback and
+** return SQLITE_OK. Or, if this is not possible, it may return
+** SQLITE_CONSTRAINT, in which case SQLite falls back to OR ABORT
+** constraint handling.
+**
+**
+** [[SQLITE_VTAB_DIRECTONLY]]SQLITE_VTAB_DIRECTONLY
+** Calls of the form
+** [sqlite3_vtab_config](db,SQLITE_VTAB_DIRECTONLY) from within the
+** the [xConnect] or [xCreate] methods of a [virtual table] implementation
+** prohibits that virtual table from being used from within triggers and
+** views.
+**
+**
+** [[SQLITE_VTAB_INNOCUOUS]]SQLITE_VTAB_INNOCUOUS
+** Calls of the form
+** [sqlite3_vtab_config](db,SQLITE_VTAB_INNOCUOUS) from within the
+** [xConnect] or [xCreate] methods of a [virtual table] implementation
+** identify that virtual table as being safe to use from within triggers
+** and views. Conceptually, the SQLITE_VTAB_INNOCUOUS tag means that the
+** virtual table can do no serious harm even if it is controlled by a
+** malicious hacker. Developers should avoid setting the SQLITE_VTAB_INNOCUOUS
+** flag unless absolutely necessary.
+**
+**
+** [[SQLITE_VTAB_USES_ALL_SCHEMAS]]SQLITE_VTAB_USES_ALL_SCHEMAS
+** Calls of the form
+** [sqlite3_vtab_config](db,SQLITE_VTAB_USES_ALL_SCHEMA) from within the
+** the [xConnect] or [xCreate] methods of a [virtual table] implementation
+** instruct the query planner to begin at least a read transaction on
+** all schemas ("main", "temp", and any ATTACH-ed databases) whenever the
+** virtual table is used.
+**
+**
+*/
+#define SQLITE_VTAB_CONSTRAINT_SUPPORT 1
+#define SQLITE_VTAB_INNOCUOUS 2
+#define SQLITE_VTAB_DIRECTONLY 3
+#define SQLITE_VTAB_USES_ALL_SCHEMAS 4
+
+/*
+** CAPI3REF: Determine The Virtual Table Conflict Policy
+**
+** This function may only be called from within a call to the [xUpdate] method
+** of a [virtual table] implementation for an INSERT or UPDATE operation. ^The
+** value returned is one of [SQLITE_ROLLBACK], [SQLITE_IGNORE], [SQLITE_FAIL],
+** [SQLITE_ABORT], or [SQLITE_REPLACE], according to the [ON CONFLICT] mode
+** of the SQL statement that triggered the call to the [xUpdate] method of the
+** [virtual table].
+*/
+SQLITE_API int sqlite3_vtab_on_conflict(sqlite3 *);
+
+/*
+** CAPI3REF: Determine If Virtual Table Column Access Is For UPDATE
+**
+** If the sqlite3_vtab_nochange(X) routine is called within the [xColumn]
+** method of a [virtual table], then it might return true if the
+** column is being fetched as part of an UPDATE operation during which the
+** column value will not change. The virtual table implementation can use
+** this hint as permission to substitute a return value that is less
+** expensive to compute and that the corresponding
+** [xUpdate] method understands as a "no-change" value.
+**
+** If the [xColumn] method calls sqlite3_vtab_nochange() and finds that
+** the column is not changed by the UPDATE statement, then the xColumn
+** method can optionally return without setting a result, without calling
+** any of the [sqlite3_result_int|sqlite3_result_xxxxx() interfaces].
+** In that case, [sqlite3_value_nochange(X)] will return true for the
+** same column in the [xUpdate] method.
+**
+** The sqlite3_vtab_nochange() routine is an optimization. Virtual table
+** implementations should continue to give a correct answer even if the
+** sqlite3_vtab_nochange() interface were to always return false. In the
+** current implementation, the sqlite3_vtab_nochange() interface does always
+** returns false for the enhanced [UPDATE FROM] statement.
+*/
+SQLITE_API int sqlite3_vtab_nochange(sqlite3_context*);
+
+/*
+** CAPI3REF: Determine The Collation For a Virtual Table Constraint
+** METHOD: sqlite3_index_info
+**
+** This function may only be called from within a call to the [xBestIndex]
+** method of a [virtual table]. This function returns a pointer to a string
+** that is the name of the appropriate collation sequence to use for text
+** comparisons on the constraint identified by its arguments.
+**
+** The first argument must be the pointer to the [sqlite3_index_info] object
+** that is the first parameter to the xBestIndex() method. The second argument
+** must be an index into the aConstraint[] array belonging to the
+** sqlite3_index_info structure passed to xBestIndex.
+**
+** Important:
+** The first parameter must be the same pointer that is passed into the
+** xBestMethod() method. The first parameter may not be a pointer to a
+** different [sqlite3_index_info] object, even an exact copy.
+**
+** The return value is computed as follows:
+**
+**
+** If the constraint comes from a WHERE clause expression that contains
+** a [COLLATE operator], then the name of the collation specified by
+** that COLLATE operator is returned.
+**
If there is no COLLATE operator, but the column that is the subject
+** of the constraint specifies an alternative collating sequence via
+** a [COLLATE clause] on the column definition within the CREATE TABLE
+** statement that was passed into [sqlite3_declare_vtab()], then the
+** name of that alternative collating sequence is returned.
+**
Otherwise, "BINARY" is returned.
+**
+*/
+SQLITE_API const char *sqlite3_vtab_collation(sqlite3_index_info*,int);
+
+/*
+** CAPI3REF: Determine if a virtual table query is DISTINCT
+** METHOD: sqlite3_index_info
+**
+** This API may only be used from within an [xBestIndex|xBestIndex method]
+** of a [virtual table] implementation. The result of calling this
+** interface from outside of xBestIndex() is undefined and probably harmful.
+**
+** ^The sqlite3_vtab_distinct() interface returns an integer between 0 and
+** 3. The integer returned by sqlite3_vtab_distinct()
+** gives the virtual table additional information about how the query
+** planner wants the output to be ordered. As long as the virtual table
+** can meet the ordering requirements of the query planner, it may set
+** the "orderByConsumed" flag.
+**
+**
+** ^If the sqlite3_vtab_distinct() interface returns 0, that means
+** that the query planner needs the virtual table to return all rows in the
+** sort order defined by the "nOrderBy" and "aOrderBy" fields of the
+** [sqlite3_index_info] object. This is the default expectation. If the
+** virtual table outputs all rows in sorted order, then it is always safe for
+** the xBestIndex method to set the "orderByConsumed" flag, regardless of
+** the return value from sqlite3_vtab_distinct().
+**
+** ^(If the sqlite3_vtab_distinct() interface returns 1, that means
+** that the query planner does not need the rows to be returned in sorted order
+** as long as all rows with the same values in all columns identified by the
+** "aOrderBy" field are adjacent.)^ This mode is used when the query planner
+** is doing a GROUP BY.
+**
+** ^(If the sqlite3_vtab_distinct() interface returns 2, that means
+** that the query planner does not need the rows returned in any particular
+** order, as long as rows with the same values in all columns identified
+** by "aOrderBy" are adjacent.)^ ^(Furthermore, when two or more rows
+** contain the same values for all columns identified by "colUsed", all but
+** one such row may optionally be omitted from the result.)^
+** The virtual table is not required to omit rows that are duplicates
+** over the "colUsed" columns, but if the virtual table can do that without
+** too much extra effort, it could potentially help the query to run faster.
+** This mode is used for a DISTINCT query.
+**
+** ^(If the sqlite3_vtab_distinct() interface returns 3, that means the
+** virtual table must return rows in the order defined by "aOrderBy" as
+** if the sqlite3_vtab_distinct() interface had returned 0. However if
+** two or more rows in the result have the same values for all columns
+** identified by "colUsed", then all but one such row may optionally be
+** omitted.)^ Like when the return value is 2, the virtual table
+** is not required to omit rows that are duplicates over the "colUsed"
+** columns, but if the virtual table can do that without
+** too much extra effort, it could potentially help the query to run faster.
+** This mode is used for queries
+** that have both DISTINCT and ORDER BY clauses.
+**
+**
+** The following table summarizes the conditions under which the
+** virtual table is allowed to set the "orderByConsumed" flag based on
+** the value returned by sqlite3_vtab_distinct(). This table is a
+** restatement of the previous four paragraphs:
+**
+**
+**
+** sqlite3_vtab_distinct() return value
+** Rows are returned in aOrderBy order
+** Rows with the same value in all aOrderBy columns are adjacent
+** Duplicates over all colUsed columns may be omitted
+** 0 yes yes no
+** 1 no yes no
+** 2 no yes yes
+** 3 yes yes yes
+**
+**
+** ^For the purposes of comparing virtual table output values to see if the
+** values are the same value for sorting purposes, two NULL values are considered
+** to be the same. In other words, the comparison operator is "IS"
+** (or "IS NOT DISTINCT FROM") and not "==".
+**
+** If a virtual table implementation is unable to meet the requirements
+** specified above, then it must not set the "orderByConsumed" flag in the
+** [sqlite3_index_info] object or an incorrect answer may result.
+**
+** ^A virtual table implementation is always free to return rows in any order
+** it wants, as long as the "orderByConsumed" flag is not set. ^When the
+** "orderByConsumed" flag is unset, the query planner will add extra
+** [bytecode] to ensure that the final results returned by the SQL query are
+** ordered correctly. The use of the "orderByConsumed" flag and the
+** sqlite3_vtab_distinct() interface is merely an optimization. ^Careful
+** use of the sqlite3_vtab_distinct() interface and the "orderByConsumed"
+** flag might help queries against a virtual table to run faster. Being
+** overly aggressive and setting the "orderByConsumed" flag when it is not
+** valid to do so, on the other hand, might cause SQLite to return incorrect
+** results.
+*/
+SQLITE_API int sqlite3_vtab_distinct(sqlite3_index_info*);
+
+/*
+** CAPI3REF: Identify and handle IN constraints in xBestIndex
+**
+** This interface may only be used from within an
+** [xBestIndex|xBestIndex() method] of a [virtual table] implementation.
+** The result of invoking this interface from any other context is
+** undefined and probably harmful.
+**
+** ^(A constraint on a virtual table of the form
+** "[IN operator|column IN (...)]" is
+** communicated to the xBestIndex method as a
+** [SQLITE_INDEX_CONSTRAINT_EQ] constraint.)^ If xBestIndex wants to use
+** this constraint, it must set the corresponding
+** aConstraintUsage[].argvIndex to a positive integer. ^(Then, under
+** the usual mode of handling IN operators, SQLite generates [bytecode]
+** that invokes the [xFilter|xFilter() method] once for each value
+** on the right-hand side of the IN operator.)^ Thus the virtual table
+** only sees a single value from the right-hand side of the IN operator
+** at a time.
+**
+** In some cases, however, it would be advantageous for the virtual
+** table to see all values on the right-hand of the IN operator all at
+** once. The sqlite3_vtab_in() interfaces facilitates this in two ways:
+**
+**
+**
+** ^A call to sqlite3_vtab_in(P,N,-1) will return true (non-zero)
+** if and only if the [sqlite3_index_info|P->aConstraint][N] constraint
+** is an [IN operator] that can be processed all at once. ^In other words,
+** sqlite3_vtab_in() with -1 in the third argument is a mechanism
+** by which the virtual table can ask SQLite if all-at-once processing
+** of the IN operator is even possible.
+**
+**
+** ^A call to sqlite3_vtab_in(P,N,F) with F==1 or F==0 indicates
+** to SQLite that the virtual table does or does not want to process
+** the IN operator all-at-once, respectively. ^Thus when the third
+** parameter (F) is non-negative, this interface is the mechanism by
+** which the virtual table tells SQLite how it wants to process the
+** IN operator.
+**
+**
+** ^The sqlite3_vtab_in(P,N,F) interface can be invoked multiple times
+** within the same xBestIndex method call. ^For any given P,N pair,
+** the return value from sqlite3_vtab_in(P,N,F) will always be the same
+** within the same xBestIndex call. ^If the interface returns true
+** (non-zero), that means that the constraint is an IN operator
+** that can be processed all-at-once. ^If the constraint is not an IN
+** operator or cannot be processed all-at-once, then the interface returns
+** false.
+**
+** ^(All-at-once processing of the IN operator is selected if both of the
+** following conditions are met:
+**
+**
+** The P->aConstraintUsage[N].argvIndex value is set to a positive
+** integer. This is how the virtual table tells SQLite that it wants to
+** use the N-th constraint.
+**
+**
The last call to sqlite3_vtab_in(P,N,F) for which F was
+** non-negative had F>=1.
+**
)^
+**
+** ^If either or both of the conditions above are false, then SQLite uses
+** the traditional one-at-a-time processing strategy for the IN constraint.
+** ^If both conditions are true, then the argvIndex-th parameter to the
+** xFilter method will be an [sqlite3_value] that appears to be NULL,
+** but which can be passed to [sqlite3_vtab_in_first()] and
+** [sqlite3_vtab_in_next()] to find all values on the right-hand side
+** of the IN constraint.
+*/
+SQLITE_API int sqlite3_vtab_in(sqlite3_index_info*, int iCons, int bHandle);
+
+/*
+** CAPI3REF: Find all elements on the right-hand side of an IN constraint.
+**
+** These interfaces are only useful from within the
+** [xFilter|xFilter() method] of a [virtual table] implementation.
+** The result of invoking these interfaces from any other context
+** is undefined and probably harmful.
+**
+** The X parameter in a call to sqlite3_vtab_in_first(X,P) or
+** sqlite3_vtab_in_next(X,P) should be one of the parameters to the
+** xFilter method which invokes these routines, and specifically
+** a parameter that was previously selected for all-at-once IN constraint
+** processing using the [sqlite3_vtab_in()] interface in the
+** [xBestIndex|xBestIndex method]. ^(If the X parameter is not
+** an xFilter argument that was selected for all-at-once IN constraint
+** processing, then these routines return [SQLITE_ERROR].)^
+**
+** ^(Use these routines to access all values on the right-hand side
+** of the IN constraint using code like the following:
+**
+**
+** for(rc=sqlite3_vtab_in_first(pList, &pVal);
+** rc==SQLITE_OK && pVal;
+** rc=sqlite3_vtab_in_next(pList, &pVal)
+** ){
+** // do something with pVal
+** }
+** if( rc!=SQLITE_OK ){
+** // an error has occurred
+** }
+** )^
+**
+** ^On success, the sqlite3_vtab_in_first(X,P) and sqlite3_vtab_in_next(X,P)
+** routines return SQLITE_OK and set *P to point to the first or next value
+** on the RHS of the IN constraint. ^If there are no more values on the
+** right hand side of the IN constraint, then *P is set to NULL and these
+** routines return [SQLITE_DONE]. ^The return value might be
+** some other value, such as SQLITE_NOMEM, in the event of a malfunction.
+**
+** The *ppOut values returned by these routines are only valid until the
+** next call to either of these routines or until the end of the xFilter
+** method from which these routines were called. If the virtual table
+** implementation needs to retain the *ppOut values for longer, it must make
+** copies. The *ppOut values are [protected sqlite3_value|protected].
+*/
+SQLITE_API int sqlite3_vtab_in_first(sqlite3_value *pVal, sqlite3_value **ppOut);
+SQLITE_API int sqlite3_vtab_in_next(sqlite3_value *pVal, sqlite3_value **ppOut);
+
+/*
+** CAPI3REF: Constraint values in xBestIndex()
+** METHOD: sqlite3_index_info
+**
+** This API may only be used from within the [xBestIndex|xBestIndex method]
+** of a [virtual table] implementation. The result of calling this interface
+** from outside of an xBestIndex method are undefined and probably harmful.
+**
+** ^When the sqlite3_vtab_rhs_value(P,J,V) interface is invoked from within
+** the [xBestIndex] method of a [virtual table] implementation, with P being
+** a copy of the [sqlite3_index_info] object pointer passed into xBestIndex and
+** J being a 0-based index into P->aConstraint[], then this routine
+** attempts to set *V to the value of the right-hand operand of
+** that constraint if the right-hand operand is known. ^If the
+** right-hand operand is not known, then *V is set to a NULL pointer.
+** ^The sqlite3_vtab_rhs_value(P,J,V) interface returns SQLITE_OK if
+** and only if *V is set to a value. ^The sqlite3_vtab_rhs_value(P,J,V)
+** inteface returns SQLITE_NOTFOUND if the right-hand side of the J-th
+** constraint is not available. ^The sqlite3_vtab_rhs_value() interface
+** can return a result code other than SQLITE_OK or SQLITE_NOTFOUND if
+** something goes wrong.
+**
+** The sqlite3_vtab_rhs_value() interface is usually only successful if
+** the right-hand operand of a constraint is a literal value in the original
+** SQL statement. If the right-hand operand is an expression or a reference
+** to some other column or a [host parameter], then sqlite3_vtab_rhs_value()
+** will probably return [SQLITE_NOTFOUND].
+**
+** ^(Some constraints, such as [SQLITE_INDEX_CONSTRAINT_ISNULL] and
+** [SQLITE_INDEX_CONSTRAINT_ISNOTNULL], have no right-hand operand. For such
+** constraints, sqlite3_vtab_rhs_value() always returns SQLITE_NOTFOUND.)^
+**
+** ^The [sqlite3_value] object returned in *V is a protected sqlite3_value
+** and remains valid for the duration of the xBestIndex method call.
+** ^When xBestIndex returns, the sqlite3_value object returned by
+** sqlite3_vtab_rhs_value() is automatically deallocated.
+**
+** The "_rhs_" in the name of this routine is an abbreviation for
+** "Right-Hand Side".
+*/
+SQLITE_API int sqlite3_vtab_rhs_value(sqlite3_index_info*, int, sqlite3_value **ppVal);
+
+/*
+** CAPI3REF: Conflict resolution modes
+** KEYWORDS: {conflict resolution mode}
+**
+** These constants are returned by [sqlite3_vtab_on_conflict()] to
+** inform a [virtual table] implementation of the [ON CONFLICT] mode
+** for the SQL statement being evaluated.
+**
+** Note that the [SQLITE_IGNORE] constant is also used as a potential
+** return value from the [sqlite3_set_authorizer()] callback and that
+** [SQLITE_ABORT] is also a [result code].
+*/
+#define SQLITE_ROLLBACK 1
+/* #define SQLITE_IGNORE 2 // Also used by sqlite3_authorizer() callback */
+#define SQLITE_FAIL 3
+/* #define SQLITE_ABORT 4 // Also an error code */
+#define SQLITE_REPLACE 5
+
+/*
+** CAPI3REF: Prepared Statement Scan Status Opcodes
+** KEYWORDS: {scanstatus options}
+**
+** The following constants can be used for the T parameter to the
+** [sqlite3_stmt_scanstatus(S,X,T,V)] interface. Each constant designates a
+** different metric for sqlite3_stmt_scanstatus() to return.
+**
+** When the value returned to V is a string, space to hold that string is
+** managed by the prepared statement S and will be automatically freed when
+** S is finalized.
+**
+** Not all values are available for all query elements. When a value is
+** not available, the output variable is set to -1 if the value is numeric,
+** or to NULL if it is a string (SQLITE_SCANSTAT_NAME).
+**
+**
+** [[SQLITE_SCANSTAT_NLOOP]] SQLITE_SCANSTAT_NLOOP
+** ^The [sqlite3_int64] variable pointed to by the V parameter will be
+** set to the total number of times that the X-th loop has run.
+**
+** [[SQLITE_SCANSTAT_NVISIT]] SQLITE_SCANSTAT_NVISIT
+** ^The [sqlite3_int64] variable pointed to by the V parameter will be set
+** to the total number of rows examined by all iterations of the X-th loop.
+**
+** [[SQLITE_SCANSTAT_EST]] SQLITE_SCANSTAT_EST
+** ^The "double" variable pointed to by the V parameter will be set to the
+** query planner's estimate for the average number of rows output from each
+** iteration of the X-th loop. If the query planner's estimate was accurate,
+** then this value will approximate the quotient NVISIT/NLOOP and the
+** product of this value for all prior loops with the same SELECTID will
+** be the NLOOP value for the current loop.
+**
+** [[SQLITE_SCANSTAT_NAME]] SQLITE_SCANSTAT_NAME
+** ^The "const char *" variable pointed to by the V parameter will be set
+** to a zero-terminated UTF-8 string containing the name of the index or table
+** used for the X-th loop.
+**
+** [[SQLITE_SCANSTAT_EXPLAIN]] SQLITE_SCANSTAT_EXPLAIN
+** ^The "const char *" variable pointed to by the V parameter will be set
+** to a zero-terminated UTF-8 string containing the [EXPLAIN QUERY PLAN]
+** description for the X-th loop.
+**
+** [[SQLITE_SCANSTAT_SELECTID]] SQLITE_SCANSTAT_SELECTID
+** ^The "int" variable pointed to by the V parameter will be set to the
+** id for the X-th query plan element. The id value is unique within the
+** statement. The select-id is the same value as is output in the first
+** column of an [EXPLAIN QUERY PLAN] query.
+**
+** [[SQLITE_SCANSTAT_PARENTID]] SQLITE_SCANSTAT_PARENTID
+** The "int" variable pointed to by the V parameter will be set to the
+** id of the parent of the current query element, if applicable, or
+** to zero if the query element has no parent. This is the same value as
+** returned in the second column of an [EXPLAIN QUERY PLAN] query.
+**
+** [[SQLITE_SCANSTAT_NCYCLE]] SQLITE_SCANSTAT_NCYCLE
+** The sqlite3_int64 output value is set to the number of cycles,
+** according to the processor time-stamp counter, that elapsed while the
+** query element was being processed. This value is not available for
+** all query elements - if it is unavailable the output variable is
+** set to -1.
+**
+*/
+#define SQLITE_SCANSTAT_NLOOP 0
+#define SQLITE_SCANSTAT_NVISIT 1
+#define SQLITE_SCANSTAT_EST 2
+#define SQLITE_SCANSTAT_NAME 3
+#define SQLITE_SCANSTAT_EXPLAIN 4
+#define SQLITE_SCANSTAT_SELECTID 5
+#define SQLITE_SCANSTAT_PARENTID 6
+#define SQLITE_SCANSTAT_NCYCLE 7
+
+/*
+** CAPI3REF: Prepared Statement Scan Status
+** METHOD: sqlite3_stmt
+**
+** These interfaces return information about the predicted and measured
+** performance for pStmt. Advanced applications can use this
+** interface to compare the predicted and the measured performance and
+** issue warnings and/or rerun [ANALYZE] if discrepancies are found.
+**
+** Since this interface is expected to be rarely used, it is only
+** available if SQLite is compiled using the [SQLITE_ENABLE_STMT_SCANSTATUS]
+** compile-time option.
+**
+** The "iScanStatusOp" parameter determines which status information to return.
+** The "iScanStatusOp" must be one of the [scanstatus options] or the behavior
+** of this interface is undefined. ^The requested measurement is written into
+** a variable pointed to by the "pOut" parameter.
+**
+** The "flags" parameter must be passed a mask of flags. At present only
+** one flag is defined - SQLITE_SCANSTAT_COMPLEX. If SQLITE_SCANSTAT_COMPLEX
+** is specified, then status information is available for all elements
+** of a query plan that are reported by "EXPLAIN QUERY PLAN" output. If
+** SQLITE_SCANSTAT_COMPLEX is not specified, then only query plan elements
+** that correspond to query loops (the "SCAN..." and "SEARCH..." elements of
+** the EXPLAIN QUERY PLAN output) are available. Invoking API
+** sqlite3_stmt_scanstatus() is equivalent to calling
+** sqlite3_stmt_scanstatus_v2() with a zeroed flags parameter.
+**
+** Parameter "idx" identifies the specific query element to retrieve statistics
+** for. Query elements are numbered starting from zero. A value of -1 may
+** retrieve statistics for the entire query. ^If idx is out of range
+** - less than -1 or greater than or equal to the total number of query
+** elements used to implement the statement - a non-zero value is returned and
+** the variable that pOut points to is unchanged.
+**
+** See also: [sqlite3_stmt_scanstatus_reset()]
+*/
+SQLITE_API int sqlite3_stmt_scanstatus(
+ sqlite3_stmt *pStmt, /* Prepared statement for which info desired */
+ int idx, /* Index of loop to report on */
+ int iScanStatusOp, /* Information desired. SQLITE_SCANSTAT_* */
+ void *pOut /* Result written here */
+);
+SQLITE_API int sqlite3_stmt_scanstatus_v2(
+ sqlite3_stmt *pStmt, /* Prepared statement for which info desired */
+ int idx, /* Index of loop to report on */
+ int iScanStatusOp, /* Information desired. SQLITE_SCANSTAT_* */
+ int flags, /* Mask of flags defined below */
+ void *pOut /* Result written here */
+);
+
+/*
+** CAPI3REF: Prepared Statement Scan Status
+** KEYWORDS: {scan status flags}
+*/
+#define SQLITE_SCANSTAT_COMPLEX 0x0001
+
+/*
+** CAPI3REF: Zero Scan-Status Counters
+** METHOD: sqlite3_stmt
+**
+** ^Zero all [sqlite3_stmt_scanstatus()] related event counters.
+**
+** This API is only available if the library is built with pre-processor
+** symbol [SQLITE_ENABLE_STMT_SCANSTATUS] defined.
+*/
+SQLITE_API void sqlite3_stmt_scanstatus_reset(sqlite3_stmt*);
+
+/*
+** CAPI3REF: Flush caches to disk mid-transaction
+** METHOD: sqlite3
+**
+** ^If a write-transaction is open on [database connection] D when the
+** [sqlite3_db_cacheflush(D)] interface is invoked, any dirty
+** pages in the pager-cache that are not currently in use are written out
+** to disk. A dirty page may be in use if a database cursor created by an
+** active SQL statement is reading from it, or if it is page 1 of a database
+** file (page 1 is always "in use"). ^The [sqlite3_db_cacheflush(D)]
+** interface flushes caches for all schemas - "main", "temp", and
+** any [attached] databases.
+**
+** ^If this function needs to obtain extra database locks before dirty pages
+** can be flushed to disk, it does so. ^If those locks cannot be obtained
+** immediately and there is a busy-handler callback configured, it is invoked
+** in the usual manner. ^If the required lock still cannot be obtained, then
+** the database is skipped and an attempt made to flush any dirty pages
+** belonging to the next (if any) database. ^If any databases are skipped
+** because locks cannot be obtained, but no other error occurs, this
+** function returns SQLITE_BUSY.
+**
+** ^If any other error occurs while flushing dirty pages to disk (for
+** example an IO error or out-of-memory condition), then processing is
+** abandoned and an SQLite [error code] is returned to the caller immediately.
+**
+** ^Otherwise, if no error occurs, [sqlite3_db_cacheflush()] returns SQLITE_OK.
+**
+** ^This function does not set the database handle error code or message
+** returned by the [sqlite3_errcode()] and [sqlite3_errmsg()] functions.
+*/
+SQLITE_API int sqlite3_db_cacheflush(sqlite3*);
+
+/*
+** CAPI3REF: The pre-update hook.
+** METHOD: sqlite3
+**
+** ^These interfaces are only available if SQLite is compiled using the
+** [SQLITE_ENABLE_PREUPDATE_HOOK] compile-time option.
+**
+** ^The [sqlite3_preupdate_hook()] interface registers a callback function
+** that is invoked prior to each [INSERT], [UPDATE], and [DELETE] operation
+** on a database table.
+** ^At most one preupdate hook may be registered at a time on a single
+** [database connection]; each call to [sqlite3_preupdate_hook()] overrides
+** the previous setting.
+** ^The preupdate hook is disabled by invoking [sqlite3_preupdate_hook()]
+** with a NULL pointer as the second parameter.
+** ^The third parameter to [sqlite3_preupdate_hook()] is passed through as
+** the first parameter to callbacks.
+**
+** ^The preupdate hook only fires for changes to real database tables; the
+** preupdate hook is not invoked for changes to [virtual tables] or to
+** system tables like sqlite_sequence or sqlite_stat1.
+**
+** ^The second parameter to the preupdate callback is a pointer to
+** the [database connection] that registered the preupdate hook.
+** ^The third parameter to the preupdate callback is one of the constants
+** [SQLITE_INSERT], [SQLITE_DELETE], or [SQLITE_UPDATE] to identify the
+** kind of update operation that is about to occur.
+** ^(The fourth parameter to the preupdate callback is the name of the
+** database within the database connection that is being modified. This
+** will be "main" for the main database or "temp" for TEMP tables or
+** the name given after the AS keyword in the [ATTACH] statement for attached
+** databases.)^
+** ^The fifth parameter to the preupdate callback is the name of the
+** table that is being modified.
+**
+** For an UPDATE or DELETE operation on a [rowid table], the sixth
+** parameter passed to the preupdate callback is the initial [rowid] of the
+** row being modified or deleted. For an INSERT operation on a rowid table,
+** or any operation on a WITHOUT ROWID table, the value of the sixth
+** parameter is undefined. For an INSERT or UPDATE on a rowid table the
+** seventh parameter is the final rowid value of the row being inserted
+** or updated. The value of the seventh parameter passed to the callback
+** function is not defined for operations on WITHOUT ROWID tables, or for
+** DELETE operations on rowid tables.
+**
+** ^The sqlite3_preupdate_hook(D,C,P) function returns the P argument from
+** the previous call on the same [database connection] D, or NULL for
+** the first call on D.
+**
+** The [sqlite3_preupdate_old()], [sqlite3_preupdate_new()],
+** [sqlite3_preupdate_count()], and [sqlite3_preupdate_depth()] interfaces
+** provide additional information about a preupdate event. These routines
+** may only be called from within a preupdate callback. Invoking any of
+** these routines from outside of a preupdate callback or with a
+** [database connection] pointer that is different from the one supplied
+** to the preupdate callback results in undefined and probably undesirable
+** behavior.
+**
+** ^The [sqlite3_preupdate_count(D)] interface returns the number of columns
+** in the row that is being inserted, updated, or deleted.
+**
+** ^The [sqlite3_preupdate_old(D,N,P)] interface writes into P a pointer to
+** a [protected sqlite3_value] that contains the value of the Nth column of
+** the table row before it is updated. The N parameter must be between 0
+** and one less than the number of columns or the behavior will be
+** undefined. This must only be used within SQLITE_UPDATE and SQLITE_DELETE
+** preupdate callbacks; if it is used by an SQLITE_INSERT callback then the
+** behavior is undefined. The [sqlite3_value] that P points to
+** will be destroyed when the preupdate callback returns.
+**
+** ^The [sqlite3_preupdate_new(D,N,P)] interface writes into P a pointer to
+** a [protected sqlite3_value] that contains the value of the Nth column of
+** the table row after it is updated. The N parameter must be between 0
+** and one less than the number of columns or the behavior will be
+** undefined. This must only be used within SQLITE_INSERT and SQLITE_UPDATE
+** preupdate callbacks; if it is used by an SQLITE_DELETE callback then the
+** behavior is undefined. The [sqlite3_value] that P points to
+** will be destroyed when the preupdate callback returns.
+**
+** ^The [sqlite3_preupdate_depth(D)] interface returns 0 if the preupdate
+** callback was invoked as a result of a direct insert, update, or delete
+** operation; or 1 for inserts, updates, or deletes invoked by top-level
+** triggers; or 2 for changes resulting from triggers called by top-level
+** triggers; and so forth.
+**
+** When the [sqlite3_blob_write()] API is used to update a blob column,
+** the pre-update hook is invoked with SQLITE_DELETE, because
+** the new values are not yet available. In this case, when a
+** callback made with op==SQLITE_DELETE is actually a write using the
+** sqlite3_blob_write() API, the [sqlite3_preupdate_blobwrite()] returns
+** the index of the column being written. In other cases, where the
+** pre-update hook is being invoked for some other reason, including a
+** regular DELETE, sqlite3_preupdate_blobwrite() returns -1.
+**
+** See also: [sqlite3_update_hook()]
+*/
+#if defined(SQLITE_ENABLE_PREUPDATE_HOOK)
+SQLITE_API void *sqlite3_preupdate_hook(
+ sqlite3 *db,
+ void(*xPreUpdate)(
+ void *pCtx, /* Copy of third arg to preupdate_hook() */
+ sqlite3 *db, /* Database handle */
+ int op, /* SQLITE_UPDATE, DELETE or INSERT */
+ char const *zDb, /* Database name */
+ char const *zName, /* Table name */
+ sqlite3_int64 iKey1, /* Rowid of row about to be deleted/updated */
+ sqlite3_int64 iKey2 /* New rowid value (for a rowid UPDATE) */
+ ),
+ void*
+);
+SQLITE_API int sqlite3_preupdate_old(sqlite3 *, int, sqlite3_value **);
+SQLITE_API int sqlite3_preupdate_count(sqlite3 *);
+SQLITE_API int sqlite3_preupdate_depth(sqlite3 *);
+SQLITE_API int sqlite3_preupdate_new(sqlite3 *, int, sqlite3_value **);
+SQLITE_API int sqlite3_preupdate_blobwrite(sqlite3 *);
+#endif
+
+/*
+** CAPI3REF: Low-level system error code
+** METHOD: sqlite3
+**
+** ^Attempt to return the underlying operating system error code or error
+** number that caused the most recent I/O error or failure to open a file.
+** The return value is OS-dependent. For example, on unix systems, after
+** [sqlite3_open_v2()] returns [SQLITE_CANTOPEN], this interface could be
+** called to get back the underlying "errno" that caused the problem, such
+** as ENOSPC, EAUTH, EISDIR, and so forth.
+*/
+SQLITE_API int sqlite3_system_errno(sqlite3*);
+
+/*
+** CAPI3REF: Database Snapshot
+** KEYWORDS: {snapshot} {sqlite3_snapshot}
+**
+** An instance of the snapshot object records the state of a [WAL mode]
+** database for some specific point in history.
+**
+** In [WAL mode], multiple [database connections] that are open on the
+** same database file can each be reading a different historical version
+** of the database file. When a [database connection] begins a read
+** transaction, that connection sees an unchanging copy of the database
+** as it existed for the point in time when the transaction first started.
+** Subsequent changes to the database from other connections are not seen
+** by the reader until a new read transaction is started.
+**
+** The sqlite3_snapshot object records state information about an historical
+** version of the database file so that it is possible to later open a new read
+** transaction that sees that historical version of the database rather than
+** the most recent version.
+*/
+typedef struct sqlite3_snapshot {
+ unsigned char hidden[48];
+} sqlite3_snapshot;
+
+/*
+** CAPI3REF: Record A Database Snapshot
+** CONSTRUCTOR: sqlite3_snapshot
+**
+** ^The [sqlite3_snapshot_get(D,S,P)] interface attempts to make a
+** new [sqlite3_snapshot] object that records the current state of
+** schema S in database connection D. ^On success, the
+** [sqlite3_snapshot_get(D,S,P)] interface writes a pointer to the newly
+** created [sqlite3_snapshot] object into *P and returns SQLITE_OK.
+** If there is not already a read-transaction open on schema S when
+** this function is called, one is opened automatically.
+**
+** If a read-transaction is opened by this function, then it is guaranteed
+** that the returned snapshot object may not be invalidated by a database
+** writer or checkpointer until after the read-transaction is closed. This
+** is not guaranteed if a read-transaction is already open when this
+** function is called. In that case, any subsequent write or checkpoint
+** operation on the database may invalidate the returned snapshot handle,
+** even while the read-transaction remains open.
+**
+** The following must be true for this function to succeed. If any of
+** the following statements are false when sqlite3_snapshot_get() is
+** called, SQLITE_ERROR is returned. The final value of *P is undefined
+** in this case.
+**
+**
+** The database handle must not be in [autocommit mode].
+**
+** Schema S of [database connection] D must be a [WAL mode] database.
+**
+** There must not be a write transaction open on schema S of database
+** connection D.
+**
+** One or more transactions must have been written to the current wal
+** file since it was created on disk (by any connection). This means
+** that a snapshot cannot be taken on a wal mode database with no wal
+** file immediately after it is first opened. At least one transaction
+** must be written to it first.
+**
+**
+** This function may also return SQLITE_NOMEM. If it is called with the
+** database handle in autocommit mode but fails for some other reason,
+** whether or not a read transaction is opened on schema S is undefined.
+**
+** The [sqlite3_snapshot] object returned from a successful call to
+** [sqlite3_snapshot_get()] must be freed using [sqlite3_snapshot_free()]
+** to avoid a memory leak.
+**
+** The [sqlite3_snapshot_get()] interface is only available when the
+** [SQLITE_ENABLE_SNAPSHOT] compile-time option is used.
+*/
+SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_snapshot_get(
+ sqlite3 *db,
+ const char *zSchema,
+ sqlite3_snapshot **ppSnapshot
+);
+
+/*
+** CAPI3REF: Start a read transaction on an historical snapshot
+** METHOD: sqlite3_snapshot
+**
+** ^The [sqlite3_snapshot_open(D,S,P)] interface either starts a new read
+** transaction or upgrades an existing one for schema S of
+** [database connection] D such that the read transaction refers to
+** historical [snapshot] P, rather than the most recent change to the
+** database. ^The [sqlite3_snapshot_open()] interface returns SQLITE_OK
+** on success or an appropriate [error code] if it fails.
+**
+** ^In order to succeed, the database connection must not be in
+** [autocommit mode] when [sqlite3_snapshot_open(D,S,P)] is called. If there
+** is already a read transaction open on schema S, then the database handle
+** must have no active statements (SELECT statements that have been passed
+** to sqlite3_step() but not sqlite3_reset() or sqlite3_finalize()).
+** SQLITE_ERROR is returned if either of these conditions is violated, or
+** if schema S does not exist, or if the snapshot object is invalid.
+**
+** ^A call to sqlite3_snapshot_open() will fail to open if the specified
+** snapshot has been overwritten by a [checkpoint]. In this case
+** SQLITE_ERROR_SNAPSHOT is returned.
+**
+** If there is already a read transaction open when this function is
+** invoked, then the same read transaction remains open (on the same
+** database snapshot) if SQLITE_ERROR, SQLITE_BUSY or SQLITE_ERROR_SNAPSHOT
+** is returned. If another error code - for example SQLITE_PROTOCOL or an
+** SQLITE_IOERR error code - is returned, then the final state of the
+** read transaction is undefined. If SQLITE_OK is returned, then the
+** read transaction is now open on database snapshot P.
+**
+** ^(A call to [sqlite3_snapshot_open(D,S,P)] will fail if the
+** database connection D does not know that the database file for
+** schema S is in [WAL mode]. A database connection might not know
+** that the database file is in [WAL mode] if there has been no prior
+** I/O on that database connection, or if the database entered [WAL mode]
+** after the most recent I/O on the database connection.)^
+** (Hint: Run "[PRAGMA application_id]" against a newly opened
+** database connection in order to make it ready to use snapshots.)
+**
+** The [sqlite3_snapshot_open()] interface is only available when the
+** [SQLITE_ENABLE_SNAPSHOT] compile-time option is used.
+*/
+SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_snapshot_open(
+ sqlite3 *db,
+ const char *zSchema,
+ sqlite3_snapshot *pSnapshot
+);
+
+/*
+** CAPI3REF: Destroy a snapshot
+** DESTRUCTOR: sqlite3_snapshot
+**
+** ^The [sqlite3_snapshot_free(P)] interface destroys [sqlite3_snapshot] P.
+** The application must eventually free every [sqlite3_snapshot] object
+** using this routine to avoid a memory leak.
+**
+** The [sqlite3_snapshot_free()] interface is only available when the
+** [SQLITE_ENABLE_SNAPSHOT] compile-time option is used.
+*/
+SQLITE_API SQLITE_EXPERIMENTAL void sqlite3_snapshot_free(sqlite3_snapshot*);
+
+/*
+** CAPI3REF: Compare the ages of two snapshot handles.
+** METHOD: sqlite3_snapshot
+**
+** The sqlite3_snapshot_cmp(P1, P2) interface is used to compare the ages
+** of two valid snapshot handles.
+**
+** If the two snapshot handles are not associated with the same database
+** file, the result of the comparison is undefined.
+**
+** Additionally, the result of the comparison is only valid if both of the
+** snapshot handles were obtained by calling sqlite3_snapshot_get() since the
+** last time the wal file was deleted. The wal file is deleted when the
+** database is changed back to rollback mode or when the number of database
+** clients drops to zero. If either snapshot handle was obtained before the
+** wal file was last deleted, the value returned by this function
+** is undefined.
+**
+** Otherwise, this API returns a negative value if P1 refers to an older
+** snapshot than P2, zero if the two handles refer to the same database
+** snapshot, and a positive value if P1 is a newer snapshot than P2.
+**
+** This interface is only available if SQLite is compiled with the
+** [SQLITE_ENABLE_SNAPSHOT] option.
+*/
+SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_snapshot_cmp(
+ sqlite3_snapshot *p1,
+ sqlite3_snapshot *p2
+);
+
+/*
+** CAPI3REF: Recover snapshots from a wal file
+** METHOD: sqlite3_snapshot
+**
+** If a [WAL file] remains on disk after all database connections close
+** (either through the use of the [SQLITE_FCNTL_PERSIST_WAL] [file control]
+** or because the last process to have the database opened exited without
+** calling [sqlite3_close()]) and a new connection is subsequently opened
+** on that database and [WAL file], the [sqlite3_snapshot_open()] interface
+** will only be able to open the last transaction added to the WAL file
+** even though the WAL file contains other valid transactions.
+**
+** This function attempts to scan the WAL file associated with database zDb
+** of database handle db and make all valid snapshots available to
+** sqlite3_snapshot_open(). It is an error if there is already a read
+** transaction open on the database, or if the database is not a WAL mode
+** database.
+**
+** SQLITE_OK is returned if successful, or an SQLite error code otherwise.
+**
+** This interface is only available if SQLite is compiled with the
+** [SQLITE_ENABLE_SNAPSHOT] option.
+*/
+SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_snapshot_recover(sqlite3 *db, const char *zDb);
+
+/*
+** CAPI3REF: Serialize a database
+**
+** The sqlite3_serialize(D,S,P,F) interface returns a pointer to
+** memory that is a serialization of the S database on
+** [database connection] D. If S is a NULL pointer, the main database is used.
+** If P is not a NULL pointer, then the size of the database in bytes
+** is written into *P.
+**
+** For an ordinary on-disk database file, the serialization is just a
+** copy of the disk file. For an in-memory database or a "TEMP" database,
+** the serialization is the same sequence of bytes which would be written
+** to disk if that database were backed up to disk.
+**
+** The usual case is that sqlite3_serialize() copies the serialization of
+** the database into memory obtained from [sqlite3_malloc64()] and returns
+** a pointer to that memory. The caller is responsible for freeing the
+** returned value to avoid a memory leak. However, if the F argument
+** contains the SQLITE_SERIALIZE_NOCOPY bit, then no memory allocations
+** are made, and the sqlite3_serialize() function will return a pointer
+** to the contiguous memory representation of the database that SQLite
+** is currently using for that database, or NULL if no such contiguous
+** memory representation of the database exists. A contiguous memory
+** representation of the database will usually only exist if there has
+** been a prior call to [sqlite3_deserialize(D,S,...)] with the same
+** values of D and S.
+** The size of the database is written into *P even if the
+** SQLITE_SERIALIZE_NOCOPY bit is set but no contiguous copy
+** of the database exists.
+**
+** After the call, if the SQLITE_SERIALIZE_NOCOPY bit had been set,
+** the returned buffer content will remain accessible and unchanged
+** until either the next write operation on the connection or when
+** the connection is closed, and applications must not modify the
+** buffer. If the bit had been clear, the returned buffer will not
+** be accessed by SQLite after the call.
+**
+** A call to sqlite3_serialize(D,S,P,F) might return NULL even if the
+** SQLITE_SERIALIZE_NOCOPY bit is omitted from argument F if a memory
+** allocation error occurs.
+**
+** This interface is omitted if SQLite is compiled with the
+** [SQLITE_OMIT_DESERIALIZE] option.
+*/
+SQLITE_API unsigned char *sqlite3_serialize(
+ sqlite3 *db, /* The database connection */
+ const char *zSchema, /* Which DB to serialize. ex: "main", "temp", ... */
+ sqlite3_int64 *piSize, /* Write size of the DB here, if not NULL */
+ unsigned int mFlags /* Zero or more SQLITE_SERIALIZE_* flags */
+);
+
+/*
+** CAPI3REF: Flags for sqlite3_serialize
+**
+** Zero or more of the following constants can be OR-ed together for
+** the F argument to [sqlite3_serialize(D,S,P,F)].
+**
+** SQLITE_SERIALIZE_NOCOPY means that [sqlite3_serialize()] will return
+** a pointer to contiguous in-memory database that it is currently using,
+** without making a copy of the database. If SQLite is not currently using
+** a contiguous in-memory database, then this option causes
+** [sqlite3_serialize()] to return a NULL pointer. SQLite will only be
+** using a contiguous in-memory database if it has been initialized by a
+** prior call to [sqlite3_deserialize()].
+*/
+#define SQLITE_SERIALIZE_NOCOPY 0x001 /* Do no memory allocations */
+
+/*
+** CAPI3REF: Deserialize a database
+**
+** The sqlite3_deserialize(D,S,P,N,M,F) interface causes the
+** [database connection] D to disconnect from database S and then
+** reopen S as an in-memory database based on the serialization contained
+** in P. The serialized database P is N bytes in size. M is the size of
+** the buffer P, which might be larger than N. If M is larger than N, and
+** the SQLITE_DESERIALIZE_READONLY bit is not set in F, then SQLite is
+** permitted to add content to the in-memory database as long as the total
+** size does not exceed M bytes.
+**
+** If the SQLITE_DESERIALIZE_FREEONCLOSE bit is set in F, then SQLite will
+** invoke sqlite3_free() on the serialization buffer when the database
+** connection closes. If the SQLITE_DESERIALIZE_RESIZEABLE bit is set, then
+** SQLite will try to increase the buffer size using sqlite3_realloc64()
+** if writes on the database cause it to grow larger than M bytes.
+**
+** Applications must not modify the buffer P or invalidate it before
+** the database connection D is closed.
+**
+** The sqlite3_deserialize() interface will fail with SQLITE_BUSY if the
+** database is currently in a read transaction or is involved in a backup
+** operation.
+**
+** It is not possible to deserialize into the TEMP database. If the
+** S argument to sqlite3_deserialize(D,S,P,N,M,F) is "temp" then the
+** function returns SQLITE_ERROR.
+**
+** The deserialized database should not be in [WAL mode]. If the database
+** is in WAL mode, then any attempt to use the database file will result
+** in an [SQLITE_CANTOPEN] error. The application can set the
+** [file format version numbers] (bytes 18 and 19) of the input database P
+** to 0x01 prior to invoking sqlite3_deserialize(D,S,P,N,M,F) to force the
+** database file into rollback mode and work around this limitation.
+**
+** If sqlite3_deserialize(D,S,P,N,M,F) fails for any reason and if the
+** SQLITE_DESERIALIZE_FREEONCLOSE bit is set in argument F, then
+** [sqlite3_free()] is invoked on argument P prior to returning.
+**
+** This interface is omitted if SQLite is compiled with the
+** [SQLITE_OMIT_DESERIALIZE] option.
+*/
+SQLITE_API int sqlite3_deserialize(
+ sqlite3 *db, /* The database connection */
+ const char *zSchema, /* Which DB to reopen with the deserialization */
+ unsigned char *pData, /* The serialized database content */
+ sqlite3_int64 szDb, /* Number of bytes in the deserialization */
+ sqlite3_int64 szBuf, /* Total size of buffer pData[] */
+ unsigned mFlags /* Zero or more SQLITE_DESERIALIZE_* flags */
+);
+
+/*
+** CAPI3REF: Flags for sqlite3_deserialize()
+**
+** The following are allowed values for the 6th argument (the F argument) to
+** the [sqlite3_deserialize(D,S,P,N,M,F)] interface.
+**
+** The SQLITE_DESERIALIZE_FREEONCLOSE means that the database serialization
+** in the P argument is held in memory obtained from [sqlite3_malloc64()]
+** and that SQLite should take ownership of this memory and automatically
+** free it when it has finished using it. Without this flag, the caller
+** is responsible for freeing any dynamically allocated memory.
+**
+** The SQLITE_DESERIALIZE_RESIZEABLE flag means that SQLite is allowed to
+** grow the size of the database using calls to [sqlite3_realloc64()]. This
+** flag should only be used if SQLITE_DESERIALIZE_FREEONCLOSE is also used.
+** Without this flag, the deserialized database cannot increase in size beyond
+** the number of bytes specified by the M parameter.
+**
+** The SQLITE_DESERIALIZE_READONLY flag means that the deserialized database
+** should be treated as read-only.
+*/
+#define SQLITE_DESERIALIZE_FREEONCLOSE 1 /* Call sqlite3_free() on close */
+#define SQLITE_DESERIALIZE_RESIZEABLE 2 /* Resize using sqlite3_realloc64() */
+#define SQLITE_DESERIALIZE_READONLY 4 /* Database is read-only */
+
+/*
+** Undo the hack that converts floating point types to integer for
+** builds on processors without floating point support.
+*/
+#ifdef SQLITE_OMIT_FLOATING_POINT
+# undef double
+#endif
+
+#if defined(__wasi__)
+# undef SQLITE_WASI
+# define SQLITE_WASI 1
+# ifndef SQLITE_OMIT_LOAD_EXTENSION
+# define SQLITE_OMIT_LOAD_EXTENSION
+# endif
+# ifndef SQLITE_THREADSAFE
+# define SQLITE_THREADSAFE 0
+# endif
+#endif
+
+#if 0
+} /* End of the 'extern "C"' block */
+#endif
+/* #endif for SQLITE3_H will be added by mksqlite3.tcl */
+
+/******** Begin file sqlite3rtree.h *********/
+/*
+** 2010 August 30
+**
+** The author disclaims copyright to this source code. In place of
+** a legal notice, here is a blessing:
+**
+** May you do good and not evil.
+** May you find forgiveness for yourself and forgive others.
+** May you share freely, never taking more than you give.
+**
+*************************************************************************
+*/
+
+#ifndef _SQLITE3RTREE_H_
+#define _SQLITE3RTREE_H_
+
+
+#if 0
+extern "C" {
+#endif
+
+typedef struct sqlite3_rtree_geometry sqlite3_rtree_geometry;
+typedef struct sqlite3_rtree_query_info sqlite3_rtree_query_info;
+
+/* The double-precision datatype used by RTree depends on the
+** SQLITE_RTREE_INT_ONLY compile-time option.
+*/
+#ifdef SQLITE_RTREE_INT_ONLY
+ typedef sqlite3_int64 sqlite3_rtree_dbl;
+#else
+ typedef double sqlite3_rtree_dbl;
+#endif
+
+/*
+** Register a geometry callback named zGeom that can be used as part of an
+** R-Tree geometry query as follows:
+**
+** SELECT ... FROM WHERE MATCH $zGeom(... params ...)
+*/
+SQLITE_API int sqlite3_rtree_geometry_callback(
+ sqlite3 *db,
+ const char *zGeom,
+ int (*xGeom)(sqlite3_rtree_geometry*, int, sqlite3_rtree_dbl*,int*),
+ void *pContext
+);
+
+
+/*
+** A pointer to a structure of the following type is passed as the first
+** argument to callbacks registered using rtree_geometry_callback().
+*/
+struct sqlite3_rtree_geometry {
+ void *pContext; /* Copy of pContext passed to s_r_g_c() */
+ int nParam; /* Size of array aParam[] */
+ sqlite3_rtree_dbl *aParam; /* Parameters passed to SQL geom function */
+ void *pUser; /* Callback implementation user data */
+ void (*xDelUser)(void *); /* Called by SQLite to clean up pUser */
+};
+
+/*
+** Register a 2nd-generation geometry callback named zScore that can be
+** used as part of an R-Tree geometry query as follows:
+**
+** SELECT ... FROM WHERE MATCH $zQueryFunc(... params ...)
+*/
+SQLITE_API int sqlite3_rtree_query_callback(
+ sqlite3 *db,
+ const char *zQueryFunc,
+ int (*xQueryFunc)(sqlite3_rtree_query_info*),
+ void *pContext,
+ void (*xDestructor)(void*)
+);
+
+
+/*
+** A pointer to a structure of the following type is passed as the
+** argument to scored geometry callback registered using
+** sqlite3_rtree_query_callback().
+**
+** Note that the first 5 fields of this structure are identical to
+** sqlite3_rtree_geometry. This structure is a subclass of
+** sqlite3_rtree_geometry.
+*/
+struct sqlite3_rtree_query_info {
+ void *pContext; /* pContext from when function registered */
+ int nParam; /* Number of function parameters */
+ sqlite3_rtree_dbl *aParam; /* value of function parameters */
+ void *pUser; /* callback can use this, if desired */
+ void (*xDelUser)(void*); /* function to free pUser */
+ sqlite3_rtree_dbl *aCoord; /* Coordinates of node or entry to check */
+ unsigned int *anQueue; /* Number of pending entries in the queue */
+ int nCoord; /* Number of coordinates */
+ int iLevel; /* Level of current node or entry */
+ int mxLevel; /* The largest iLevel value in the tree */
+ sqlite3_int64 iRowid; /* Rowid for current entry */
+ sqlite3_rtree_dbl rParentScore; /* Score of parent node */
+ int eParentWithin; /* Visibility of parent node */
+ int eWithin; /* OUT: Visibility */
+ sqlite3_rtree_dbl rScore; /* OUT: Write the score here */
+ /* The following fields are only available in 3.8.11 and later */
+ sqlite3_value **apSqlParam; /* Original SQL values of parameters */
+};
+
+/*
+** Allowed values for sqlite3_rtree_query.eWithin and .eParentWithin.
+*/
+#define NOT_WITHIN 0 /* Object completely outside of query region */
+#define PARTLY_WITHIN 1 /* Object partially overlaps query region */
+#define FULLY_WITHIN 2 /* Object fully contained within query region */
+
+
+#if 0
+} /* end of the 'extern "C"' block */
+#endif
+
+#endif /* ifndef _SQLITE3RTREE_H_ */
+
+/******** End of sqlite3rtree.h *********/
+/******** Begin file sqlite3session.h *********/
+
+#if !defined(__SQLITESESSION_H_) && defined(SQLITE_ENABLE_SESSION)
+#define __SQLITESESSION_H_ 1
+
+/*
+** Make sure we can call this stuff from C++.
+*/
+#if 0
+extern "C" {
+#endif
+
+
+/*
+** CAPI3REF: Session Object Handle
+**
+** An instance of this object is a [session] that can be used to
+** record changes to a database.
+*/
+typedef struct sqlite3_session sqlite3_session;
+
+/*
+** CAPI3REF: Changeset Iterator Handle
+**
+** An instance of this object acts as a cursor for iterating
+** over the elements of a [changeset] or [patchset].
+*/
+typedef struct sqlite3_changeset_iter sqlite3_changeset_iter;
+
+/*
+** CAPI3REF: Create A New Session Object
+** CONSTRUCTOR: sqlite3_session
+**
+** Create a new session object attached to database handle db. If successful,
+** a pointer to the new object is written to *ppSession and SQLITE_OK is
+** returned. If an error occurs, *ppSession is set to NULL and an SQLite
+** error code (e.g. SQLITE_NOMEM) is returned.
+**
+** It is possible to create multiple session objects attached to a single
+** database handle.
+**
+** Session objects created using this function should be deleted using the
+** [sqlite3session_delete()] function before the database handle that they
+** are attached to is itself closed. If the database handle is closed before
+** the session object is deleted, then the results of calling any session
+** module function, including [sqlite3session_delete()] on the session object
+** are undefined.
+**
+** Because the session module uses the [sqlite3_preupdate_hook()] API, it
+** is not possible for an application to register a pre-update hook on a
+** database handle that has one or more session objects attached. Nor is
+** it possible to create a session object attached to a database handle for
+** which a pre-update hook is already defined. The results of attempting
+** either of these things are undefined.
+**
+** The session object will be used to create changesets for tables in
+** database zDb, where zDb is either "main", or "temp", or the name of an
+** attached database. It is not an error if database zDb is not attached
+** to the database when the session object is created.
+*/
+SQLITE_API int sqlite3session_create(
+ sqlite3 *db, /* Database handle */
+ const char *zDb, /* Name of db (e.g. "main") */
+ sqlite3_session **ppSession /* OUT: New session object */
+);
+
+/*
+** CAPI3REF: Delete A Session Object
+** DESTRUCTOR: sqlite3_session
+**
+** Delete a session object previously allocated using
+** [sqlite3session_create()]. Once a session object has been deleted, the
+** results of attempting to use pSession with any other session module
+** function are undefined.
+**
+** Session objects must be deleted before the database handle to which they
+** are attached is closed. Refer to the documentation for
+** [sqlite3session_create()] for details.
+*/
+SQLITE_API void sqlite3session_delete(sqlite3_session *pSession);
+
+/*
+** CAPI3REF: Configure a Session Object
+** METHOD: sqlite3_session
+**
+** This method is used to configure a session object after it has been
+** created. At present the only valid values for the second parameter are
+** [SQLITE_SESSION_OBJCONFIG_SIZE] and [SQLITE_SESSION_OBJCONFIG_ROWID].
+**
+*/
+SQLITE_API int sqlite3session_object_config(sqlite3_session*, int op, void *pArg);
+
+/*
+** CAPI3REF: Options for sqlite3session_object_config
+**
+** The following values may passed as the the 2nd parameter to
+** sqlite3session_object_config().
+**
+** SQLITE_SESSION_OBJCONFIG_SIZE
+** This option is used to set, clear or query the flag that enables
+** the [sqlite3session_changeset_size()] API. Because it imposes some
+** computational overhead, this API is disabled by default. Argument
+** pArg must point to a value of type (int). If the value is initially
+** 0, then the sqlite3session_changeset_size() API is disabled. If it
+** is greater than 0, then the same API is enabled. Or, if the initial
+** value is less than zero, no change is made. In all cases the (int)
+** variable is set to 1 if the sqlite3session_changeset_size() API is
+** enabled following the current call, or 0 otherwise.
+**
+** It is an error (SQLITE_MISUSE) to attempt to modify this setting after
+** the first table has been attached to the session object.
+**
+** SQLITE_SESSION_OBJCONFIG_ROWID
+** This option is used to set, clear or query the flag that enables
+** collection of data for tables with no explicit PRIMARY KEY.
+**
+** Normally, tables with no explicit PRIMARY KEY are simply ignored
+** by the sessions module. However, if this flag is set, it behaves
+** as if such tables have a column "_rowid_ INTEGER PRIMARY KEY" inserted
+** as their leftmost columns.
+**
+** It is an error (SQLITE_MISUSE) to attempt to modify this setting after
+** the first table has been attached to the session object.
+*/
+#define SQLITE_SESSION_OBJCONFIG_SIZE 1
+#define SQLITE_SESSION_OBJCONFIG_ROWID 2
+
+/*
+** CAPI3REF: Enable Or Disable A Session Object
+** METHOD: sqlite3_session
+**
+** Enable or disable the recording of changes by a session object. When
+** enabled, a session object records changes made to the database. When
+** disabled - it does not. A newly created session object is enabled.
+** Refer to the documentation for [sqlite3session_changeset()] for further
+** details regarding how enabling and disabling a session object affects
+** the eventual changesets.
+**
+** Passing zero to this function disables the session. Passing a value
+** greater than zero enables it. Passing a value less than zero is a
+** no-op, and may be used to query the current state of the session.
+**
+** The return value indicates the final state of the session object: 0 if
+** the session is disabled, or 1 if it is enabled.
+*/
+SQLITE_API int sqlite3session_enable(sqlite3_session *pSession, int bEnable);
+
+/*
+** CAPI3REF: Set Or Clear the Indirect Change Flag
+** METHOD: sqlite3_session
+**
+** Each change recorded by a session object is marked as either direct or
+** indirect. A change is marked as indirect if either:
+**
+**
+** The session object "indirect" flag is set when the change is
+** made, or
+** The change is made by an SQL trigger or foreign key action
+** instead of directly as a result of a users SQL statement.
+**
+**
+** If a single row is affected by more than one operation within a session,
+** then the change is considered indirect if all operations meet the criteria
+** for an indirect change above, or direct otherwise.
+**
+** This function is used to set, clear or query the session object indirect
+** flag. If the second argument passed to this function is zero, then the
+** indirect flag is cleared. If it is greater than zero, the indirect flag
+** is set. Passing a value less than zero does not modify the current value
+** of the indirect flag, and may be used to query the current state of the
+** indirect flag for the specified session object.
+**
+** The return value indicates the final state of the indirect flag: 0 if
+** it is clear, or 1 if it is set.
+*/
+SQLITE_API int sqlite3session_indirect(sqlite3_session *pSession, int bIndirect);
+
+/*
+** CAPI3REF: Attach A Table To A Session Object
+** METHOD: sqlite3_session
+**
+** If argument zTab is not NULL, then it is the name of a table to attach
+** to the session object passed as the first argument. All subsequent changes
+** made to the table while the session object is enabled will be recorded. See
+** documentation for [sqlite3session_changeset()] for further details.
+**
+** Or, if argument zTab is NULL, then changes are recorded for all tables
+** in the database. If additional tables are added to the database (by
+** executing "CREATE TABLE" statements) after this call is made, changes for
+** the new tables are also recorded.
+**
+** Changes can only be recorded for tables that have a PRIMARY KEY explicitly
+** defined as part of their CREATE TABLE statement. It does not matter if the
+** PRIMARY KEY is an "INTEGER PRIMARY KEY" (rowid alias) or not. The PRIMARY
+** KEY may consist of a single column, or may be a composite key.
+**
+** It is not an error if the named table does not exist in the database. Nor
+** is it an error if the named table does not have a PRIMARY KEY. However,
+** no changes will be recorded in either of these scenarios.
+**
+** Changes are not recorded for individual rows that have NULL values stored
+** in one or more of their PRIMARY KEY columns.
+**
+** SQLITE_OK is returned if the call completes without error. Or, if an error
+** occurs, an SQLite error code (e.g. SQLITE_NOMEM) is returned.
+**
+** Special sqlite_stat1 Handling
+**
+** As of SQLite version 3.22.0, the "sqlite_stat1" table is an exception to
+** some of the rules above. In SQLite, the schema of sqlite_stat1 is:
+**
+** CREATE TABLE sqlite_stat1(tbl,idx,stat)
+**
+**
+** Even though sqlite_stat1 does not have a PRIMARY KEY, changes are
+** recorded for it as if the PRIMARY KEY is (tbl,idx). Additionally, changes
+** are recorded for rows for which (idx IS NULL) is true. However, for such
+** rows a zero-length blob (SQL value X'') is stored in the changeset or
+** patchset instead of a NULL value. This allows such changesets to be
+** manipulated by legacy implementations of sqlite3changeset_invert(),
+** concat() and similar.
+**
+** The sqlite3changeset_apply() function automatically converts the
+** zero-length blob back to a NULL value when updating the sqlite_stat1
+** table. However, if the application calls sqlite3changeset_new(),
+** sqlite3changeset_old() or sqlite3changeset_conflict on a changeset
+** iterator directly (including on a changeset iterator passed to a
+** conflict-handler callback) then the X'' value is returned. The application
+** must translate X'' to NULL itself if required.
+**
+** Legacy (older than 3.22.0) versions of the sessions module cannot capture
+** changes made to the sqlite_stat1 table. Legacy versions of the
+** sqlite3changeset_apply() function silently ignore any modifications to the
+** sqlite_stat1 table that are part of a changeset or patchset.
+*/
+SQLITE_API int sqlite3session_attach(
+ sqlite3_session *pSession, /* Session object */
+ const char *zTab /* Table name */
+);
+
+/*
+** CAPI3REF: Set a table filter on a Session Object.
+** METHOD: sqlite3_session
+**
+** The second argument (xFilter) is the "filter callback". For changes to rows
+** in tables that are not attached to the Session object, the filter is called
+** to determine whether changes to the table's rows should be tracked or not.
+** If xFilter returns 0, changes are not tracked. Note that once a table is
+** attached, xFilter will not be called again.
+*/
+SQLITE_API void sqlite3session_table_filter(
+ sqlite3_session *pSession, /* Session object */
+ int(*xFilter)(
+ void *pCtx, /* Copy of third arg to _filter_table() */
+ const char *zTab /* Table name */
+ ),
+ void *pCtx /* First argument passed to xFilter */
+);
+
+/*
+** CAPI3REF: Generate A Changeset From A Session Object
+** METHOD: sqlite3_session
+**
+** Obtain a changeset containing changes to the tables attached to the
+** session object passed as the first argument. If successful,
+** set *ppChangeset to point to a buffer containing the changeset
+** and *pnChangeset to the size of the changeset in bytes before returning
+** SQLITE_OK. If an error occurs, set both *ppChangeset and *pnChangeset to
+** zero and return an SQLite error code.
+**
+** A changeset consists of zero or more INSERT, UPDATE and/or DELETE changes,
+** each representing a change to a single row of an attached table. An INSERT
+** change contains the values of each field of a new database row. A DELETE
+** contains the original values of each field of a deleted database row. An
+** UPDATE change contains the original values of each field of an updated
+** database row along with the updated values for each updated non-primary-key
+** column. It is not possible for an UPDATE change to represent a change that
+** modifies the values of primary key columns. If such a change is made, it
+** is represented in a changeset as a DELETE followed by an INSERT.
+**
+** Changes are not recorded for rows that have NULL values stored in one or
+** more of their PRIMARY KEY columns. If such a row is inserted or deleted,
+** no corresponding change is present in the changesets returned by this
+** function. If an existing row with one or more NULL values stored in
+** PRIMARY KEY columns is updated so that all PRIMARY KEY columns are non-NULL,
+** only an INSERT is appears in the changeset. Similarly, if an existing row
+** with non-NULL PRIMARY KEY values is updated so that one or more of its
+** PRIMARY KEY columns are set to NULL, the resulting changeset contains a
+** DELETE change only.
+**
+** The contents of a changeset may be traversed using an iterator created
+** using the [sqlite3changeset_start()] API. A changeset may be applied to
+** a database with a compatible schema using the [sqlite3changeset_apply()]
+** API.
+**
+** Within a changeset generated by this function, all changes related to a
+** single table are grouped together. In other words, when iterating through
+** a changeset or when applying a changeset to a database, all changes related
+** to a single table are processed before moving on to the next table. Tables
+** are sorted in the same order in which they were attached (or auto-attached)
+** to the sqlite3_session object. The order in which the changes related to
+** a single table are stored is undefined.
+**
+** Following a successful call to this function, it is the responsibility of
+** the caller to eventually free the buffer that *ppChangeset points to using
+** [sqlite3_free()].
+**
+** Changeset Generation
+**
+** Once a table has been attached to a session object, the session object
+** records the primary key values of all new rows inserted into the table.
+** It also records the original primary key and other column values of any
+** deleted or updated rows. For each unique primary key value, data is only
+** recorded once - the first time a row with said primary key is inserted,
+** updated or deleted in the lifetime of the session.
+**
+** There is one exception to the previous paragraph: when a row is inserted,
+** updated or deleted, if one or more of its primary key columns contain a
+** NULL value, no record of the change is made.
+**
+** The session object therefore accumulates two types of records - those
+** that consist of primary key values only (created when the user inserts
+** a new record) and those that consist of the primary key values and the
+** original values of other table columns (created when the users deletes
+** or updates a record).
+**
+** When this function is called, the requested changeset is created using
+** both the accumulated records and the current contents of the database
+** file. Specifically:
+**
+**
+** For each record generated by an insert, the database is queried
+** for a row with a matching primary key. If one is found, an INSERT
+** change is added to the changeset. If no such row is found, no change
+** is added to the changeset.
+**
+** For each record generated by an update or delete, the database is
+** queried for a row with a matching primary key. If such a row is
+** found and one or more of the non-primary key fields have been
+** modified from their original values, an UPDATE change is added to
+** the changeset. Or, if no such row is found in the table, a DELETE
+** change is added to the changeset. If there is a row with a matching
+** primary key in the database, but all fields contain their original
+** values, no change is added to the changeset.
+**
+**
+** This means, amongst other things, that if a row is inserted and then later
+** deleted while a session object is active, neither the insert nor the delete
+** will be present in the changeset. Or if a row is deleted and then later a
+** row with the same primary key values inserted while a session object is
+** active, the resulting changeset will contain an UPDATE change instead of
+** a DELETE and an INSERT.
+**
+** When a session object is disabled (see the [sqlite3session_enable()] API),
+** it does not accumulate records when rows are inserted, updated or deleted.
+** This may appear to have some counter-intuitive effects if a single row
+** is written to more than once during a session. For example, if a row
+** is inserted while a session object is enabled, then later deleted while
+** the same session object is disabled, no INSERT record will appear in the
+** changeset, even though the delete took place while the session was disabled.
+** Or, if one field of a row is updated while a session is enabled, and
+** then another field of the same row is updated while the session is disabled,
+** the resulting changeset will contain an UPDATE change that updates both
+** fields.
+*/
+SQLITE_API int sqlite3session_changeset(
+ sqlite3_session *pSession, /* Session object */
+ int *pnChangeset, /* OUT: Size of buffer at *ppChangeset */
+ void **ppChangeset /* OUT: Buffer containing changeset */
+);
+
+/*
+** CAPI3REF: Return An Upper-limit For The Size Of The Changeset
+** METHOD: sqlite3_session
+**
+** By default, this function always returns 0. For it to return
+** a useful result, the sqlite3_session object must have been configured
+** to enable this API using sqlite3session_object_config() with the
+** SQLITE_SESSION_OBJCONFIG_SIZE verb.
+**
+** When enabled, this function returns an upper limit, in bytes, for the size
+** of the changeset that might be produced if sqlite3session_changeset() were
+** called. The final changeset size might be equal to or smaller than the
+** size in bytes returned by this function.
+*/
+SQLITE_API sqlite3_int64 sqlite3session_changeset_size(sqlite3_session *pSession);
+
+/*
+** CAPI3REF: Load The Difference Between Tables Into A Session
+** METHOD: sqlite3_session
+**
+** If it is not already attached to the session object passed as the first
+** argument, this function attaches table zTbl in the same manner as the
+** [sqlite3session_attach()] function. If zTbl does not exist, or if it
+** does not have a primary key, this function is a no-op (but does not return
+** an error).
+**
+** Argument zFromDb must be the name of a database ("main", "temp" etc.)
+** attached to the same database handle as the session object that contains
+** a table compatible with the table attached to the session by this function.
+** A table is considered compatible if it:
+**
+**
+** Has the same name,
+** Has the same set of columns declared in the same order, and
+** Has the same PRIMARY KEY definition.
+**
+**
+** If the tables are not compatible, SQLITE_SCHEMA is returned. If the tables
+** are compatible but do not have any PRIMARY KEY columns, it is not an error
+** but no changes are added to the session object. As with other session
+** APIs, tables without PRIMARY KEYs are simply ignored.
+**
+** This function adds a set of changes to the session object that could be
+** used to update the table in database zFrom (call this the "from-table")
+** so that its content is the same as the table attached to the session
+** object (call this the "to-table"). Specifically:
+**
+**
+** For each row (primary key) that exists in the to-table but not in
+** the from-table, an INSERT record is added to the session object.
+**
+** For each row (primary key) that exists in the to-table but not in
+** the from-table, a DELETE record is added to the session object.
+**
+** For each row (primary key) that exists in both tables, but features
+** different non-PK values in each, an UPDATE record is added to the
+** session.
+**
+**
+** To clarify, if this function is called and then a changeset constructed
+** using [sqlite3session_changeset()], then after applying that changeset to
+** database zFrom the contents of the two compatible tables would be
+** identical.
+**
+** Unless the call to this function is a no-op as described above, it is an
+** error if database zFrom does not exist or does not contain the required
+** compatible table.
+**
+** If the operation is successful, SQLITE_OK is returned. Otherwise, an SQLite
+** error code. In this case, if argument pzErrMsg is not NULL, *pzErrMsg
+** may be set to point to a buffer containing an English language error
+** message. It is the responsibility of the caller to free this buffer using
+** sqlite3_free().
+*/
+SQLITE_API int sqlite3session_diff(
+ sqlite3_session *pSession,
+ const char *zFromDb,
+ const char *zTbl,
+ char **pzErrMsg
+);
+
+
+/*
+** CAPI3REF: Generate A Patchset From A Session Object
+** METHOD: sqlite3_session
+**
+** The differences between a patchset and a changeset are that:
+**
+**
+** DELETE records consist of the primary key fields only. The
+** original values of other fields are omitted.
+** The original values of any modified fields are omitted from
+** UPDATE records.
+**
+**
+** A patchset blob may be used with up to date versions of all
+** sqlite3changeset_xxx API functions except for sqlite3changeset_invert(),
+** which returns SQLITE_CORRUPT if it is passed a patchset. Similarly,
+** attempting to use a patchset blob with old versions of the
+** sqlite3changeset_xxx APIs also provokes an SQLITE_CORRUPT error.
+**
+** Because the non-primary key "old.*" fields are omitted, no
+** SQLITE_CHANGESET_DATA conflicts can be detected or reported if a patchset
+** is passed to the sqlite3changeset_apply() API. Other conflict types work
+** in the same way as for changesets.
+**
+** Changes within a patchset are ordered in the same way as for changesets
+** generated by the sqlite3session_changeset() function (i.e. all changes for
+** a single table are grouped together, tables appear in the order in which
+** they were attached to the session object).
+*/
+SQLITE_API int sqlite3session_patchset(
+ sqlite3_session *pSession, /* Session object */
+ int *pnPatchset, /* OUT: Size of buffer at *ppPatchset */
+ void **ppPatchset /* OUT: Buffer containing patchset */
+);
+
+/*
+** CAPI3REF: Test if a changeset has recorded any changes.
+**
+** Return non-zero if no changes to attached tables have been recorded by
+** the session object passed as the first argument. Otherwise, if one or
+** more changes have been recorded, return zero.
+**
+** Even if this function returns zero, it is possible that calling
+** [sqlite3session_changeset()] on the session handle may still return a
+** changeset that contains no changes. This can happen when a row in
+** an attached table is modified and then later on the original values
+** are restored. However, if this function returns non-zero, then it is
+** guaranteed that a call to sqlite3session_changeset() will return a
+** changeset containing zero changes.
+*/
+SQLITE_API int sqlite3session_isempty(sqlite3_session *pSession);
+
+/*
+** CAPI3REF: Query for the amount of heap memory used by a session object.
+**
+** This API returns the total amount of heap memory in bytes currently
+** used by the session object passed as the only argument.
+*/
+SQLITE_API sqlite3_int64 sqlite3session_memory_used(sqlite3_session *pSession);
+
+/*
+** CAPI3REF: Create An Iterator To Traverse A Changeset
+** CONSTRUCTOR: sqlite3_changeset_iter
+**
+** Create an iterator used to iterate through the contents of a changeset.
+** If successful, *pp is set to point to the iterator handle and SQLITE_OK
+** is returned. Otherwise, if an error occurs, *pp is set to zero and an
+** SQLite error code is returned.
+**
+** The following functions can be used to advance and query a changeset
+** iterator created by this function:
+**
+**
+** [sqlite3changeset_next()]
+** [sqlite3changeset_op()]
+** [sqlite3changeset_new()]
+** [sqlite3changeset_old()]
+**
+**
+** It is the responsibility of the caller to eventually destroy the iterator
+** by passing it to [sqlite3changeset_finalize()]. The buffer containing the
+** changeset (pChangeset) must remain valid until after the iterator is
+** destroyed.
+**
+** Assuming the changeset blob was created by one of the
+** [sqlite3session_changeset()], [sqlite3changeset_concat()] or
+** [sqlite3changeset_invert()] functions, all changes within the changeset
+** that apply to a single table are grouped together. This means that when
+** an application iterates through a changeset using an iterator created by
+** this function, all changes that relate to a single table are visited
+** consecutively. There is no chance that the iterator will visit a change
+** the applies to table X, then one for table Y, and then later on visit
+** another change for table X.
+**
+** The behavior of sqlite3changeset_start_v2() and its streaming equivalent
+** may be modified by passing a combination of
+** [SQLITE_CHANGESETSTART_INVERT | supported flags] as the 4th parameter.
+**
+** Note that the sqlite3changeset_start_v2() API is still experimental
+** and therefore subject to change.
+*/
+SQLITE_API int sqlite3changeset_start(
+ sqlite3_changeset_iter **pp, /* OUT: New changeset iterator handle */
+ int nChangeset, /* Size of changeset blob in bytes */
+ void *pChangeset /* Pointer to blob containing changeset */
+);
+SQLITE_API int sqlite3changeset_start_v2(
+ sqlite3_changeset_iter **pp, /* OUT: New changeset iterator handle */
+ int nChangeset, /* Size of changeset blob in bytes */
+ void *pChangeset, /* Pointer to blob containing changeset */
+ int flags /* SESSION_CHANGESETSTART_* flags */
+);
+
+/*
+** CAPI3REF: Flags for sqlite3changeset_start_v2
+**
+** The following flags may passed via the 4th parameter to
+** [sqlite3changeset_start_v2] and [sqlite3changeset_start_v2_strm]:
+**
+** SQLITE_CHANGESETSTART_INVERT
+** Invert the changeset while iterating through it. This is equivalent to
+** inverting a changeset using sqlite3changeset_invert() before applying it.
+** It is an error to specify this flag with a patchset.
+*/
+#define SQLITE_CHANGESETSTART_INVERT 0x0002
+
+
+/*
+** CAPI3REF: Advance A Changeset Iterator
+** METHOD: sqlite3_changeset_iter
+**
+** This function may only be used with iterators created by the function
+** [sqlite3changeset_start()]. If it is called on an iterator passed to
+** a conflict-handler callback by [sqlite3changeset_apply()], SQLITE_MISUSE
+** is returned and the call has no effect.
+**
+** Immediately after an iterator is created by sqlite3changeset_start(), it
+** does not point to any change in the changeset. Assuming the changeset
+** is not empty, the first call to this function advances the iterator to
+** point to the first change in the changeset. Each subsequent call advances
+** the iterator to point to the next change in the changeset (if any). If
+** no error occurs and the iterator points to a valid change after a call
+** to sqlite3changeset_next() has advanced it, SQLITE_ROW is returned.
+** Otherwise, if all changes in the changeset have already been visited,
+** SQLITE_DONE is returned.
+**
+** If an error occurs, an SQLite error code is returned. Possible error
+** codes include SQLITE_CORRUPT (if the changeset buffer is corrupt) or
+** SQLITE_NOMEM.
+*/
+SQLITE_API int sqlite3changeset_next(sqlite3_changeset_iter *pIter);
+
+/*
+** CAPI3REF: Obtain The Current Operation From A Changeset Iterator
+** METHOD: sqlite3_changeset_iter
+**
+** The pIter argument passed to this function may either be an iterator
+** passed to a conflict-handler by [sqlite3changeset_apply()], or an iterator
+** created by [sqlite3changeset_start()]. In the latter case, the most recent
+** call to [sqlite3changeset_next()] must have returned [SQLITE_ROW]. If this
+** is not the case, this function returns [SQLITE_MISUSE].
+**
+** Arguments pOp, pnCol and pzTab may not be NULL. Upon return, three
+** outputs are set through these pointers:
+**
+** *pOp is set to one of [SQLITE_INSERT], [SQLITE_DELETE] or [SQLITE_UPDATE],
+** depending on the type of change that the iterator currently points to;
+**
+** *pnCol is set to the number of columns in the table affected by the change; and
+**
+** *pzTab is set to point to a nul-terminated utf-8 encoded string containing
+** the name of the table affected by the current change. The buffer remains
+** valid until either sqlite3changeset_next() is called on the iterator
+** or until the conflict-handler function returns.
+**
+** If pbIndirect is not NULL, then *pbIndirect is set to true (1) if the change
+** is an indirect change, or false (0) otherwise. See the documentation for
+** [sqlite3session_indirect()] for a description of direct and indirect
+** changes.
+**
+** If no error occurs, SQLITE_OK is returned. If an error does occur, an
+** SQLite error code is returned. The values of the output variables may not
+** be trusted in this case.
+*/
+SQLITE_API int sqlite3changeset_op(
+ sqlite3_changeset_iter *pIter, /* Iterator object */
+ const char **pzTab, /* OUT: Pointer to table name */
+ int *pnCol, /* OUT: Number of columns in table */
+ int *pOp, /* OUT: SQLITE_INSERT, DELETE or UPDATE */
+ int *pbIndirect /* OUT: True for an 'indirect' change */
+);
+
+/*
+** CAPI3REF: Obtain The Primary Key Definition Of A Table
+** METHOD: sqlite3_changeset_iter
+**
+** For each modified table, a changeset includes the following:
+**
+**
+** The number of columns in the table, and
+** Which of those columns make up the tables PRIMARY KEY.
+**
+**
+** This function is used to find which columns comprise the PRIMARY KEY of
+** the table modified by the change that iterator pIter currently points to.
+** If successful, *pabPK is set to point to an array of nCol entries, where
+** nCol is the number of columns in the table. Elements of *pabPK are set to
+** 0x01 if the corresponding column is part of the tables primary key, or
+** 0x00 if it is not.
+**
+** If argument pnCol is not NULL, then *pnCol is set to the number of columns
+** in the table.
+**
+** If this function is called when the iterator does not point to a valid
+** entry, SQLITE_MISUSE is returned and the output variables zeroed. Otherwise,
+** SQLITE_OK is returned and the output variables populated as described
+** above.
+*/
+SQLITE_API int sqlite3changeset_pk(
+ sqlite3_changeset_iter *pIter, /* Iterator object */
+ unsigned char **pabPK, /* OUT: Array of boolean - true for PK cols */
+ int *pnCol /* OUT: Number of entries in output array */
+);
+
+/*
+** CAPI3REF: Obtain old.* Values From A Changeset Iterator
+** METHOD: sqlite3_changeset_iter
+**
+** The pIter argument passed to this function may either be an iterator
+** passed to a conflict-handler by [sqlite3changeset_apply()], or an iterator
+** created by [sqlite3changeset_start()]. In the latter case, the most recent
+** call to [sqlite3changeset_next()] must have returned SQLITE_ROW.
+** Furthermore, it may only be called if the type of change that the iterator
+** currently points to is either [SQLITE_DELETE] or [SQLITE_UPDATE]. Otherwise,
+** this function returns [SQLITE_MISUSE] and sets *ppValue to NULL.
+**
+** Argument iVal must be greater than or equal to 0, and less than the number
+** of columns in the table affected by the current change. Otherwise,
+** [SQLITE_RANGE] is returned and *ppValue is set to NULL.
+**
+** If successful, this function sets *ppValue to point to a protected
+** sqlite3_value object containing the iVal'th value from the vector of
+** original row values stored as part of the UPDATE or DELETE change and
+** returns SQLITE_OK. The name of the function comes from the fact that this
+** is similar to the "old.*" columns available to update or delete triggers.
+**
+** If some other error occurs (e.g. an OOM condition), an SQLite error code
+** is returned and *ppValue is set to NULL.
+*/
+SQLITE_API int sqlite3changeset_old(
+ sqlite3_changeset_iter *pIter, /* Changeset iterator */
+ int iVal, /* Column number */
+ sqlite3_value **ppValue /* OUT: Old value (or NULL pointer) */
+);
+
+/*
+** CAPI3REF: Obtain new.* Values From A Changeset Iterator
+** METHOD: sqlite3_changeset_iter
+**
+** The pIter argument passed to this function may either be an iterator
+** passed to a conflict-handler by [sqlite3changeset_apply()], or an iterator
+** created by [sqlite3changeset_start()]. In the latter case, the most recent
+** call to [sqlite3changeset_next()] must have returned SQLITE_ROW.
+** Furthermore, it may only be called if the type of change that the iterator
+** currently points to is either [SQLITE_UPDATE] or [SQLITE_INSERT]. Otherwise,
+** this function returns [SQLITE_MISUSE] and sets *ppValue to NULL.
+**
+** Argument iVal must be greater than or equal to 0, and less than the number
+** of columns in the table affected by the current change. Otherwise,
+** [SQLITE_RANGE] is returned and *ppValue is set to NULL.
+**
+** If successful, this function sets *ppValue to point to a protected
+** sqlite3_value object containing the iVal'th value from the vector of
+** new row values stored as part of the UPDATE or INSERT change and
+** returns SQLITE_OK. If the change is an UPDATE and does not include
+** a new value for the requested column, *ppValue is set to NULL and
+** SQLITE_OK returned. The name of the function comes from the fact that
+** this is similar to the "new.*" columns available to update or delete
+** triggers.
+**
+** If some other error occurs (e.g. an OOM condition), an SQLite error code
+** is returned and *ppValue is set to NULL.
+*/
+SQLITE_API int sqlite3changeset_new(
+ sqlite3_changeset_iter *pIter, /* Changeset iterator */
+ int iVal, /* Column number */
+ sqlite3_value **ppValue /* OUT: New value (or NULL pointer) */
+);
+
+/*
+** CAPI3REF: Obtain Conflicting Row Values From A Changeset Iterator
+** METHOD: sqlite3_changeset_iter
+**
+** This function should only be used with iterator objects passed to a
+** conflict-handler callback by [sqlite3changeset_apply()] with either
+** [SQLITE_CHANGESET_DATA] or [SQLITE_CHANGESET_CONFLICT]. If this function
+** is called on any other iterator, [SQLITE_MISUSE] is returned and *ppValue
+** is set to NULL.
+**
+** Argument iVal must be greater than or equal to 0, and less than the number
+** of columns in the table affected by the current change. Otherwise,
+** [SQLITE_RANGE] is returned and *ppValue is set to NULL.
+**
+** If successful, this function sets *ppValue to point to a protected
+** sqlite3_value object containing the iVal'th value from the
+** "conflicting row" associated with the current conflict-handler callback
+** and returns SQLITE_OK.
+**
+** If some other error occurs (e.g. an OOM condition), an SQLite error code
+** is returned and *ppValue is set to NULL.
+*/
+SQLITE_API int sqlite3changeset_conflict(
+ sqlite3_changeset_iter *pIter, /* Changeset iterator */
+ int iVal, /* Column number */
+ sqlite3_value **ppValue /* OUT: Value from conflicting row */
+);
+
+/*
+** CAPI3REF: Determine The Number Of Foreign Key Constraint Violations
+** METHOD: sqlite3_changeset_iter
+**
+** This function may only be called with an iterator passed to an
+** SQLITE_CHANGESET_FOREIGN_KEY conflict handler callback. In this case
+** it sets the output variable to the total number of known foreign key
+** violations in the destination database and returns SQLITE_OK.
+**
+** In all other cases this function returns SQLITE_MISUSE.
+*/
+SQLITE_API int sqlite3changeset_fk_conflicts(
+ sqlite3_changeset_iter *pIter, /* Changeset iterator */
+ int *pnOut /* OUT: Number of FK violations */
+);
+
+
+/*
+** CAPI3REF: Finalize A Changeset Iterator
+** METHOD: sqlite3_changeset_iter
+**
+** This function is used to finalize an iterator allocated with
+** [sqlite3changeset_start()].
+**
+** This function should only be called on iterators created using the
+** [sqlite3changeset_start()] function. If an application calls this
+** function with an iterator passed to a conflict-handler by
+** [sqlite3changeset_apply()], [SQLITE_MISUSE] is immediately returned and the
+** call has no effect.
+**
+** If an error was encountered within a call to an sqlite3changeset_xxx()
+** function (for example an [SQLITE_CORRUPT] in [sqlite3changeset_next()] or an
+** [SQLITE_NOMEM] in [sqlite3changeset_new()]) then an error code corresponding
+** to that error is returned by this function. Otherwise, SQLITE_OK is
+** returned. This is to allow the following pattern (pseudo-code):
+**
+**
+** sqlite3changeset_start();
+** while( SQLITE_ROW==sqlite3changeset_next() ){
+** // Do something with change.
+** }
+** rc = sqlite3changeset_finalize();
+** if( rc!=SQLITE_OK ){
+** // An error has occurred
+** }
+**
+*/
+SQLITE_API int sqlite3changeset_finalize(sqlite3_changeset_iter *pIter);
+
+/*
+** CAPI3REF: Invert A Changeset
+**
+** This function is used to "invert" a changeset object. Applying an inverted
+** changeset to a database reverses the effects of applying the uninverted
+** changeset. Specifically:
+**
+**
+** Each DELETE change is changed to an INSERT, and
+** Each INSERT change is changed to a DELETE, and
+** For each UPDATE change, the old.* and new.* values are exchanged.
+**
+**
+** This function does not change the order in which changes appear within
+** the changeset. It merely reverses the sense of each individual change.
+**
+** If successful, a pointer to a buffer containing the inverted changeset
+** is stored in *ppOut, the size of the same buffer is stored in *pnOut, and
+** SQLITE_OK is returned. If an error occurs, both *pnOut and *ppOut are
+** zeroed and an SQLite error code returned.
+**
+** It is the responsibility of the caller to eventually call sqlite3_free()
+** on the *ppOut pointer to free the buffer allocation following a successful
+** call to this function.
+**
+** WARNING/TODO: This function currently assumes that the input is a valid
+** changeset. If it is not, the results are undefined.
+*/
+SQLITE_API int sqlite3changeset_invert(
+ int nIn, const void *pIn, /* Input changeset */
+ int *pnOut, void **ppOut /* OUT: Inverse of input */
+);
+
+/*
+** CAPI3REF: Concatenate Two Changeset Objects
+**
+** This function is used to concatenate two changesets, A and B, into a
+** single changeset. The result is a changeset equivalent to applying
+** changeset A followed by changeset B.
+**
+** This function combines the two input changesets using an
+** sqlite3_changegroup object. Calling it produces similar results as the
+** following code fragment:
+**
+**
+** sqlite3_changegroup *pGrp;
+** rc = sqlite3_changegroup_new(&pGrp);
+** if( rc==SQLITE_OK ) rc = sqlite3changegroup_add(pGrp, nA, pA);
+** if( rc==SQLITE_OK ) rc = sqlite3changegroup_add(pGrp, nB, pB);
+** if( rc==SQLITE_OK ){
+** rc = sqlite3changegroup_output(pGrp, pnOut, ppOut);
+** }else{
+** *ppOut = 0;
+** *pnOut = 0;
+** }
+**
+**
+** Refer to the sqlite3_changegroup documentation below for details.
+*/
+SQLITE_API int sqlite3changeset_concat(
+ int nA, /* Number of bytes in buffer pA */
+ void *pA, /* Pointer to buffer containing changeset A */
+ int nB, /* Number of bytes in buffer pB */
+ void *pB, /* Pointer to buffer containing changeset B */
+ int *pnOut, /* OUT: Number of bytes in output changeset */
+ void **ppOut /* OUT: Buffer containing output changeset */
+);
+
+/*
+** CAPI3REF: Changegroup Handle
+**
+** A changegroup is an object used to combine two or more
+** [changesets] or [patchsets]
+*/
+typedef struct sqlite3_changegroup sqlite3_changegroup;
+
+/*
+** CAPI3REF: Create A New Changegroup Object
+** CONSTRUCTOR: sqlite3_changegroup
+**
+** An sqlite3_changegroup object is used to combine two or more changesets
+** (or patchsets) into a single changeset (or patchset). A single changegroup
+** object may combine changesets or patchsets, but not both. The output is
+** always in the same format as the input.
+**
+** If successful, this function returns SQLITE_OK and populates (*pp) with
+** a pointer to a new sqlite3_changegroup object before returning. The caller
+** should eventually free the returned object using a call to
+** sqlite3changegroup_delete(). If an error occurs, an SQLite error code
+** (i.e. SQLITE_NOMEM) is returned and *pp is set to NULL.
+**
+** The usual usage pattern for an sqlite3_changegroup object is as follows:
+**
+**
+** It is created using a call to sqlite3changegroup_new().
+**
+** Zero or more changesets (or patchsets) are added to the object
+** by calling sqlite3changegroup_add().
+**
+** The result of combining all input changesets together is obtained
+** by the application via a call to sqlite3changegroup_output().
+**
+** The object is deleted using a call to sqlite3changegroup_delete().
+**
+**
+** Any number of calls to add() and output() may be made between the calls to
+** new() and delete(), and in any order.
+**
+** As well as the regular sqlite3changegroup_add() and
+** sqlite3changegroup_output() functions, also available are the streaming
+** versions sqlite3changegroup_add_strm() and sqlite3changegroup_output_strm().
+*/
+SQLITE_API int sqlite3changegroup_new(sqlite3_changegroup **pp);
+
+/*
+** CAPI3REF: Add a Schema to a Changegroup
+** METHOD: sqlite3_changegroup_schema
+**
+** This method may be used to optionally enforce the rule that the changesets
+** added to the changegroup handle must match the schema of database zDb
+** ("main", "temp", or the name of an attached database). If
+** sqlite3changegroup_add() is called to add a changeset that is not compatible
+** with the configured schema, SQLITE_SCHEMA is returned and the changegroup
+** object is left in an undefined state.
+**
+** A changeset schema is considered compatible with the database schema in
+** the same way as for sqlite3changeset_apply(). Specifically, for each
+** table in the changeset, there exists a database table with:
+**
+**
+** The name identified by the changeset, and
+** at least as many columns as recorded in the changeset, and
+** the primary key columns in the same position as recorded in
+** the changeset.
+**
+**
+** The output of the changegroup object always has the same schema as the
+** database nominated using this function. In cases where changesets passed
+** to sqlite3changegroup_add() have fewer columns than the corresponding table
+** in the database schema, these are filled in using the default column
+** values from the database schema. This makes it possible to combined
+** changesets that have different numbers of columns for a single table
+** within a changegroup, provided that they are otherwise compatible.
+*/
+SQLITE_API int sqlite3changegroup_schema(sqlite3_changegroup*, sqlite3*, const char *zDb);
+
+/*
+** CAPI3REF: Add A Changeset To A Changegroup
+** METHOD: sqlite3_changegroup
+**
+** Add all changes within the changeset (or patchset) in buffer pData (size
+** nData bytes) to the changegroup.
+**
+** If the buffer contains a patchset, then all prior calls to this function
+** on the same changegroup object must also have specified patchsets. Or, if
+** the buffer contains a changeset, so must have the earlier calls to this
+** function. Otherwise, SQLITE_ERROR is returned and no changes are added
+** to the changegroup.
+**
+** Rows within the changeset and changegroup are identified by the values in
+** their PRIMARY KEY columns. A change in the changeset is considered to
+** apply to the same row as a change already present in the changegroup if
+** the two rows have the same primary key.
+**
+** Changes to rows that do not already appear in the changegroup are
+** simply copied into it. Or, if both the new changeset and the changegroup
+** contain changes that apply to a single row, the final contents of the
+** changegroup depends on the type of each change, as follows:
+**
+**
+** Existing Change
+** New Change
+** Output Change
+** INSERT INSERT
+** The new change is ignored. This case does not occur if the new
+** changeset was recorded immediately after the changesets already
+** added to the changegroup.
+** INSERT UPDATE
+** The INSERT change remains in the changegroup. The values in the
+** INSERT change are modified as if the row was inserted by the
+** existing change and then updated according to the new change.
+** INSERT DELETE
+** The existing INSERT is removed from the changegroup. The DELETE is
+** not added.
+** UPDATE INSERT
+** The new change is ignored. This case does not occur if the new
+** changeset was recorded immediately after the changesets already
+** added to the changegroup.
+** UPDATE UPDATE
+** The existing UPDATE remains within the changegroup. It is amended
+** so that the accompanying values are as if the row was updated once
+** by the existing change and then again by the new change.
+** UPDATE DELETE
+** The existing UPDATE is replaced by the new DELETE within the
+** changegroup.
+** DELETE INSERT
+** If one or more of the column values in the row inserted by the
+** new change differ from those in the row deleted by the existing
+** change, the existing DELETE is replaced by an UPDATE within the
+** changegroup. Otherwise, if the inserted row is exactly the same
+** as the deleted row, the existing DELETE is simply discarded.
+** DELETE UPDATE
+** The new change is ignored. This case does not occur if the new
+** changeset was recorded immediately after the changesets already
+** added to the changegroup.
+** DELETE DELETE
+** The new change is ignored. This case does not occur if the new
+** changeset was recorded immediately after the changesets already
+** added to the changegroup.
+**
+**
+** If the new changeset contains changes to a table that is already present
+** in the changegroup, then the number of columns and the position of the
+** primary key columns for the table must be consistent. If this is not the
+** case, this function fails with SQLITE_SCHEMA. Except, if the changegroup
+** object has been configured with a database schema using the
+** sqlite3changegroup_schema() API, then it is possible to combine changesets
+** with different numbers of columns for a single table, provided that
+** they are otherwise compatible.
+**
+** If the input changeset appears to be corrupt and the corruption is
+** detected, SQLITE_CORRUPT is returned. Or, if an out-of-memory condition
+** occurs during processing, this function returns SQLITE_NOMEM.
+**
+** In all cases, if an error occurs the state of the final contents of the
+** changegroup is undefined. If no error occurs, SQLITE_OK is returned.
+*/
+SQLITE_API int sqlite3changegroup_add(sqlite3_changegroup*, int nData, void *pData);
+
+/*
+** CAPI3REF: Add A Single Change To A Changegroup
+** METHOD: sqlite3_changegroup
+**
+** This function adds the single change currently indicated by the iterator
+** passed as the second argument to the changegroup object. The rules for
+** adding the change are just as described for [sqlite3changegroup_add()].
+**
+** If the change is successfully added to the changegroup, SQLITE_OK is
+** returned. Otherwise, an SQLite error code is returned.
+**
+** The iterator must point to a valid entry when this function is called.
+** If it does not, SQLITE_ERROR is returned and no change is added to the
+** changegroup. Additionally, the iterator must not have been opened with
+** the SQLITE_CHANGESETAPPLY_INVERT flag. In this case SQLITE_ERROR is also
+** returned.
+*/
+SQLITE_API int sqlite3changegroup_add_change(
+ sqlite3_changegroup*,
+ sqlite3_changeset_iter*
+);
+
+
+
+/*
+** CAPI3REF: Obtain A Composite Changeset From A Changegroup
+** METHOD: sqlite3_changegroup
+**
+** Obtain a buffer containing a changeset (or patchset) representing the
+** current contents of the changegroup. If the inputs to the changegroup
+** were themselves changesets, the output is a changeset. Or, if the
+** inputs were patchsets, the output is also a patchset.
+**
+** As with the output of the sqlite3session_changeset() and
+** sqlite3session_patchset() functions, all changes related to a single
+** table are grouped together in the output of this function. Tables appear
+** in the same order as for the very first changeset added to the changegroup.
+** If the second or subsequent changesets added to the changegroup contain
+** changes for tables that do not appear in the first changeset, they are
+** appended onto the end of the output changeset, again in the order in
+** which they are first encountered.
+**
+** If an error occurs, an SQLite error code is returned and the output
+** variables (*pnData) and (*ppData) are set to 0. Otherwise, SQLITE_OK
+** is returned and the output variables are set to the size of and a
+** pointer to the output buffer, respectively. In this case it is the
+** responsibility of the caller to eventually free the buffer using a
+** call to sqlite3_free().
+*/
+SQLITE_API int sqlite3changegroup_output(
+ sqlite3_changegroup*,
+ int *pnData, /* OUT: Size of output buffer in bytes */
+ void **ppData /* OUT: Pointer to output buffer */
+);
+
+/*
+** CAPI3REF: Delete A Changegroup Object
+** DESTRUCTOR: sqlite3_changegroup
+*/
+SQLITE_API void sqlite3changegroup_delete(sqlite3_changegroup*);
+
+/*
+** CAPI3REF: Apply A Changeset To A Database
+**
+** Apply a changeset or patchset to a database. These functions attempt to
+** update the "main" database attached to handle db with the changes found in
+** the changeset passed via the second and third arguments.
+**
+** The fourth argument (xFilter) passed to these functions is the "filter
+** callback". If it is not NULL, then for each table affected by at least one
+** change in the changeset, the filter callback is invoked with
+** the table name as the second argument, and a copy of the context pointer
+** passed as the sixth argument as the first. If the "filter callback"
+** returns zero, then no attempt is made to apply any changes to the table.
+** Otherwise, if the return value is non-zero or the xFilter argument to
+** is NULL, all changes related to the table are attempted.
+**
+** For each table that is not excluded by the filter callback, this function
+** tests that the target database contains a compatible table. A table is
+** considered compatible if all of the following are true:
+**
+**
+** The table has the same name as the name recorded in the
+** changeset, and
+** The table has at least as many columns as recorded in the
+** changeset, and
+** The table has primary key columns in the same position as
+** recorded in the changeset.
+**
+**
+** If there is no compatible table, it is not an error, but none of the
+** changes associated with the table are applied. A warning message is issued
+** via the sqlite3_log() mechanism with the error code SQLITE_SCHEMA. At most
+** one such warning is issued for each table in the changeset.
+**
+** For each change for which there is a compatible table, an attempt is made
+** to modify the table contents according to the UPDATE, INSERT or DELETE
+** change. If a change cannot be applied cleanly, the conflict handler
+** function passed as the fifth argument to sqlite3changeset_apply() may be
+** invoked. A description of exactly when the conflict handler is invoked for
+** each type of change is below.
+**
+** Unlike the xFilter argument, xConflict may not be passed NULL. The results
+** of passing anything other than a valid function pointer as the xConflict
+** argument are undefined.
+**
+** Each time the conflict handler function is invoked, it must return one
+** of [SQLITE_CHANGESET_OMIT], [SQLITE_CHANGESET_ABORT] or
+** [SQLITE_CHANGESET_REPLACE]. SQLITE_CHANGESET_REPLACE may only be returned
+** if the second argument passed to the conflict handler is either
+** SQLITE_CHANGESET_DATA or SQLITE_CHANGESET_CONFLICT. If the conflict-handler
+** returns an illegal value, any changes already made are rolled back and
+** the call to sqlite3changeset_apply() returns SQLITE_MISUSE. Different
+** actions are taken by sqlite3changeset_apply() depending on the value
+** returned by each invocation of the conflict-handler function. Refer to
+** the documentation for the three
+** [SQLITE_CHANGESET_OMIT|available return values] for details.
+**
+**
+** DELETE Changes
+** For each DELETE change, the function checks if the target database
+** contains a row with the same primary key value (or values) as the
+** original row values stored in the changeset. If it does, and the values
+** stored in all non-primary key columns also match the values stored in
+** the changeset the row is deleted from the target database.
+**
+** If a row with matching primary key values is found, but one or more of
+** the non-primary key fields contains a value different from the original
+** row value stored in the changeset, the conflict-handler function is
+** invoked with [SQLITE_CHANGESET_DATA] as the second argument. If the
+** database table has more columns than are recorded in the changeset,
+** only the values of those non-primary key fields are compared against
+** the current database contents - any trailing database table columns
+** are ignored.
+**
+** If no row with matching primary key values is found in the database,
+** the conflict-handler function is invoked with [SQLITE_CHANGESET_NOTFOUND]
+** passed as the second argument.
+**
+** If the DELETE operation is attempted, but SQLite returns SQLITE_CONSTRAINT
+** (which can only happen if a foreign key constraint is violated), the
+** conflict-handler function is invoked with [SQLITE_CHANGESET_CONSTRAINT]
+** passed as the second argument. This includes the case where the DELETE
+** operation is attempted because an earlier call to the conflict handler
+** function returned [SQLITE_CHANGESET_REPLACE].
+**
+** INSERT Changes
+** For each INSERT change, an attempt is made to insert the new row into
+** the database. If the changeset row contains fewer fields than the
+** database table, the trailing fields are populated with their default
+** values.
+**
+** If the attempt to insert the row fails because the database already
+** contains a row with the same primary key values, the conflict handler
+** function is invoked with the second argument set to
+** [SQLITE_CHANGESET_CONFLICT].
+**
+** If the attempt to insert the row fails because of some other constraint
+** violation (e.g. NOT NULL or UNIQUE), the conflict handler function is
+** invoked with the second argument set to [SQLITE_CHANGESET_CONSTRAINT].
+** This includes the case where the INSERT operation is re-attempted because
+** an earlier call to the conflict handler function returned
+** [SQLITE_CHANGESET_REPLACE].
+**
+** UPDATE Changes
+** For each UPDATE change, the function checks if the target database
+** contains a row with the same primary key value (or values) as the
+** original row values stored in the changeset. If it does, and the values
+** stored in all modified non-primary key columns also match the values
+** stored in the changeset the row is updated within the target database.
+**
+** If a row with matching primary key values is found, but one or more of
+** the modified non-primary key fields contains a value different from an
+** original row value stored in the changeset, the conflict-handler function
+** is invoked with [SQLITE_CHANGESET_DATA] as the second argument. Since
+** UPDATE changes only contain values for non-primary key fields that are
+** to be modified, only those fields need to match the original values to
+** avoid the SQLITE_CHANGESET_DATA conflict-handler callback.
+**
+** If no row with matching primary key values is found in the database,
+** the conflict-handler function is invoked with [SQLITE_CHANGESET_NOTFOUND]
+** passed as the second argument.
+**
+** If the UPDATE operation is attempted, but SQLite returns
+** SQLITE_CONSTRAINT, the conflict-handler function is invoked with
+** [SQLITE_CHANGESET_CONSTRAINT] passed as the second argument.
+** This includes the case where the UPDATE operation is attempted after
+** an earlier call to the conflict handler function returned
+** [SQLITE_CHANGESET_REPLACE].
+**
+**
+** It is safe to execute SQL statements, including those that write to the
+** table that the callback related to, from within the xConflict callback.
+** This can be used to further customize the application's conflict
+** resolution strategy.
+**
+** All changes made by these functions are enclosed in a savepoint transaction.
+** If any other error (aside from a constraint failure when attempting to
+** write to the target database) occurs, then the savepoint transaction is
+** rolled back, restoring the target database to its original state, and an
+** SQLite error code returned.
+**
+** If the output parameters (ppRebase) and (pnRebase) are non-NULL and
+** the input is a changeset (not a patchset), then sqlite3changeset_apply_v2()
+** may set (*ppRebase) to point to a "rebase" that may be used with the
+** sqlite3_rebaser APIs buffer before returning. In this case (*pnRebase)
+** is set to the size of the buffer in bytes. It is the responsibility of the
+** caller to eventually free any such buffer using sqlite3_free(). The buffer
+** is only allocated and populated if one or more conflicts were encountered
+** while applying the patchset. See comments surrounding the sqlite3_rebaser
+** APIs for further details.
+**
+** The behavior of sqlite3changeset_apply_v2() and its streaming equivalent
+** may be modified by passing a combination of
+** [SQLITE_CHANGESETAPPLY_NOSAVEPOINT | supported flags] as the 9th parameter.
+**
+** Note that the sqlite3changeset_apply_v2() API is still experimental
+** and therefore subject to change.
+*/
+SQLITE_API int sqlite3changeset_apply(
+ sqlite3 *db, /* Apply change to "main" db of this handle */
+ int nChangeset, /* Size of changeset in bytes */
+ void *pChangeset, /* Changeset blob */
+ int(*xFilter)(
+ void *pCtx, /* Copy of sixth arg to _apply() */
+ const char *zTab /* Table name */
+ ),
+ int(*xConflict)(
+ void *pCtx, /* Copy of sixth arg to _apply() */
+ int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */
+ sqlite3_changeset_iter *p /* Handle describing change and conflict */
+ ),
+ void *pCtx /* First argument passed to xConflict */
+);
+SQLITE_API int sqlite3changeset_apply_v2(
+ sqlite3 *db, /* Apply change to "main" db of this handle */
+ int nChangeset, /* Size of changeset in bytes */
+ void *pChangeset, /* Changeset blob */
+ int(*xFilter)(
+ void *pCtx, /* Copy of sixth arg to _apply() */
+ const char *zTab /* Table name */
+ ),
+ int(*xConflict)(
+ void *pCtx, /* Copy of sixth arg to _apply() */
+ int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */
+ sqlite3_changeset_iter *p /* Handle describing change and conflict */
+ ),
+ void *pCtx, /* First argument passed to xConflict */
+ void **ppRebase, int *pnRebase, /* OUT: Rebase data */
+ int flags /* SESSION_CHANGESETAPPLY_* flags */
+);
+
+/*
+** CAPI3REF: Flags for sqlite3changeset_apply_v2
+**
+** The following flags may passed via the 9th parameter to
+** [sqlite3changeset_apply_v2] and [sqlite3changeset_apply_v2_strm]:
+**
+**
+** SQLITE_CHANGESETAPPLY_NOSAVEPOINT
+** Usually, the sessions module encloses all operations performed by
+** a single call to apply_v2() or apply_v2_strm() in a [SAVEPOINT]. The
+** SAVEPOINT is committed if the changeset or patchset is successfully
+** applied, or rolled back if an error occurs. Specifying this flag
+** causes the sessions module to omit this savepoint. In this case, if the
+** caller has an open transaction or savepoint when apply_v2() is called,
+** it may revert the partially applied changeset by rolling it back.
+**
+** SQLITE_CHANGESETAPPLY_INVERT
+** Invert the changeset before applying it. This is equivalent to inverting
+** a changeset using sqlite3changeset_invert() before applying it. It is
+** an error to specify this flag with a patchset.
+**
+** SQLITE_CHANGESETAPPLY_IGNORENOOP
+** Do not invoke the conflict handler callback for any changes that
+** would not actually modify the database even if they were applied.
+** Specifically, this means that the conflict handler is not invoked
+** for:
+**
+** a delete change if the row being deleted cannot be found,
+** an update change if the modified fields are already set to
+** their new values in the conflicting row, or
+** an insert change if all fields of the conflicting row match
+** the row being inserted.
+**
+**
+** SQLITE_CHANGESETAPPLY_FKNOACTION
+** If this flag it set, then all foreign key constraints in the target
+** database behave as if they were declared with "ON UPDATE NO ACTION ON
+** DELETE NO ACTION", even if they are actually CASCADE, RESTRICT, SET NULL
+** or SET DEFAULT.
+*/
+#define SQLITE_CHANGESETAPPLY_NOSAVEPOINT 0x0001
+#define SQLITE_CHANGESETAPPLY_INVERT 0x0002
+#define SQLITE_CHANGESETAPPLY_IGNORENOOP 0x0004
+#define SQLITE_CHANGESETAPPLY_FKNOACTION 0x0008
+
+/*
+** CAPI3REF: Constants Passed To The Conflict Handler
+**
+** Values that may be passed as the second argument to a conflict-handler.
+**
+**
+** SQLITE_CHANGESET_DATA
+** The conflict handler is invoked with CHANGESET_DATA as the second argument
+** when processing a DELETE or UPDATE change if a row with the required
+** PRIMARY KEY fields is present in the database, but one or more other
+** (non primary-key) fields modified by the update do not contain the
+** expected "before" values.
+**
+** The conflicting row, in this case, is the database row with the matching
+** primary key.
+**
+** SQLITE_CHANGESET_NOTFOUND
+** The conflict handler is invoked with CHANGESET_NOTFOUND as the second
+** argument when processing a DELETE or UPDATE change if a row with the
+** required PRIMARY KEY fields is not present in the database.
+**
+** There is no conflicting row in this case. The results of invoking the
+** sqlite3changeset_conflict() API are undefined.
+**
+** SQLITE_CHANGESET_CONFLICT
+** CHANGESET_CONFLICT is passed as the second argument to the conflict
+** handler while processing an INSERT change if the operation would result
+** in duplicate primary key values.
+**
+** The conflicting row in this case is the database row with the matching
+** primary key.
+**
+** SQLITE_CHANGESET_FOREIGN_KEY
+** If foreign key handling is enabled, and applying a changeset leaves the
+** database in a state containing foreign key violations, the conflict
+** handler is invoked with CHANGESET_FOREIGN_KEY as the second argument
+** exactly once before the changeset is committed. If the conflict handler
+** returns CHANGESET_OMIT, the changes, including those that caused the
+** foreign key constraint violation, are committed. Or, if it returns
+** CHANGESET_ABORT, the changeset is rolled back.
+**
+** No current or conflicting row information is provided. The only function
+** it is possible to call on the supplied sqlite3_changeset_iter handle
+** is sqlite3changeset_fk_conflicts().
+**
+** SQLITE_CHANGESET_CONSTRAINT
+** If any other constraint violation occurs while applying a change (i.e.
+** a UNIQUE, CHECK or NOT NULL constraint), the conflict handler is
+** invoked with CHANGESET_CONSTRAINT as the second argument.
+**
+** There is no conflicting row in this case. The results of invoking the
+** sqlite3changeset_conflict() API are undefined.
+**
+**
+*/
+#define SQLITE_CHANGESET_DATA 1
+#define SQLITE_CHANGESET_NOTFOUND 2
+#define SQLITE_CHANGESET_CONFLICT 3
+#define SQLITE_CHANGESET_CONSTRAINT 4
+#define SQLITE_CHANGESET_FOREIGN_KEY 5
+
+/*
+** CAPI3REF: Constants Returned By The Conflict Handler
+**
+** A conflict handler callback must return one of the following three values.
+**
+**
+** SQLITE_CHANGESET_OMIT
+** If a conflict handler returns this value no special action is taken. The
+** change that caused the conflict is not applied. The session module
+** continues to the next change in the changeset.
+**
+** SQLITE_CHANGESET_REPLACE
+** This value may only be returned if the second argument to the conflict
+** handler was SQLITE_CHANGESET_DATA or SQLITE_CHANGESET_CONFLICT. If this
+** is not the case, any changes applied so far are rolled back and the
+** call to sqlite3changeset_apply() returns SQLITE_MISUSE.
+**
+** If CHANGESET_REPLACE is returned by an SQLITE_CHANGESET_DATA conflict
+** handler, then the conflicting row is either updated or deleted, depending
+** on the type of change.
+**
+** If CHANGESET_REPLACE is returned by an SQLITE_CHANGESET_CONFLICT conflict
+** handler, then the conflicting row is removed from the database and a
+** second attempt to apply the change is made. If this second attempt fails,
+** the original row is restored to the database before continuing.
+**
+** SQLITE_CHANGESET_ABORT
+** If this value is returned, any changes applied so far are rolled back
+** and the call to sqlite3changeset_apply() returns SQLITE_ABORT.
+**
+*/
+#define SQLITE_CHANGESET_OMIT 0
+#define SQLITE_CHANGESET_REPLACE 1
+#define SQLITE_CHANGESET_ABORT 2
+
+/*
+** CAPI3REF: Rebasing changesets
+** EXPERIMENTAL
+**
+** Suppose there is a site hosting a database in state S0. And that
+** modifications are made that move that database to state S1 and a
+** changeset recorded (the "local" changeset). Then, a changeset based
+** on S0 is received from another site (the "remote" changeset) and
+** applied to the database. The database is then in state
+** (S1+"remote"), where the exact state depends on any conflict
+** resolution decisions (OMIT or REPLACE) made while applying "remote".
+** Rebasing a changeset is to update it to take those conflict
+** resolution decisions into account, so that the same conflicts
+** do not have to be resolved elsewhere in the network.
+**
+** For example, if both the local and remote changesets contain an
+** INSERT of the same key on "CREATE TABLE t1(a PRIMARY KEY, b)":
+**
+** local: INSERT INTO t1 VALUES(1, 'v1');
+** remote: INSERT INTO t1 VALUES(1, 'v2');
+**
+** and the conflict resolution is REPLACE, then the INSERT change is
+** removed from the local changeset (it was overridden). Or, if the
+** conflict resolution was "OMIT", then the local changeset is modified
+** to instead contain:
+**
+** UPDATE t1 SET b = 'v2' WHERE a=1;
+**
+** Changes within the local changeset are rebased as follows:
+**
+**
+** Local INSERT
+** This may only conflict with a remote INSERT. If the conflict
+** resolution was OMIT, then add an UPDATE change to the rebased
+** changeset. Or, if the conflict resolution was REPLACE, add
+** nothing to the rebased changeset.
+**
+** Local DELETE
+** This may conflict with a remote UPDATE or DELETE. In both cases the
+** only possible resolution is OMIT. If the remote operation was a
+** DELETE, then add no change to the rebased changeset. If the remote
+** operation was an UPDATE, then the old.* fields of change are updated
+** to reflect the new.* values in the UPDATE.
+**
+** Local UPDATE
+** This may conflict with a remote UPDATE or DELETE. If it conflicts
+** with a DELETE, and the conflict resolution was OMIT, then the update
+** is changed into an INSERT. Any undefined values in the new.* record
+** from the update change are filled in using the old.* values from
+** the conflicting DELETE. Or, if the conflict resolution was REPLACE,
+** the UPDATE change is simply omitted from the rebased changeset.
+**
+** If conflict is with a remote UPDATE and the resolution is OMIT, then
+** the old.* values are rebased using the new.* values in the remote
+** change. Or, if the resolution is REPLACE, then the change is copied
+** into the rebased changeset with updates to columns also updated by
+** the conflicting remote UPDATE removed. If this means no columns would
+** be updated, the change is omitted.
+**
+**
+** A local change may be rebased against multiple remote changes
+** simultaneously. If a single key is modified by multiple remote
+** changesets, they are combined as follows before the local changeset
+** is rebased:
+**
+**
+** If there has been one or more REPLACE resolutions on a
+** key, it is rebased according to a REPLACE.
+**
+** If there have been no REPLACE resolutions on a key, then
+** the local changeset is rebased according to the most recent
+** of the OMIT resolutions.
+**
+**
+** Note that conflict resolutions from multiple remote changesets are
+** combined on a per-field basis, not per-row. This means that in the
+** case of multiple remote UPDATE operations, some fields of a single
+** local change may be rebased for REPLACE while others are rebased for
+** OMIT.
+**
+** In order to rebase a local changeset, the remote changeset must first
+** be applied to the local database using sqlite3changeset_apply_v2() and
+** the buffer of rebase information captured. Then:
+**
+**
+** An sqlite3_rebaser object is created by calling
+** sqlite3rebaser_create().
+** The new object is configured with the rebase buffer obtained from
+** sqlite3changeset_apply_v2() by calling sqlite3rebaser_configure().
+** If the local changeset is to be rebased against multiple remote
+** changesets, then sqlite3rebaser_configure() should be called
+** multiple times, in the same order that the multiple
+** sqlite3changeset_apply_v2() calls were made.
+** Each local changeset is rebased by calling sqlite3rebaser_rebase().
+** The sqlite3_rebaser object is deleted by calling
+** sqlite3rebaser_delete().
+**
+*/
+typedef struct sqlite3_rebaser sqlite3_rebaser;
+
+/*
+** CAPI3REF: Create a changeset rebaser object.
+** EXPERIMENTAL
+**
+** Allocate a new changeset rebaser object. If successful, set (*ppNew) to
+** point to the new object and return SQLITE_OK. Otherwise, if an error
+** occurs, return an SQLite error code (e.g. SQLITE_NOMEM) and set (*ppNew)
+** to NULL.
+*/
+SQLITE_API int sqlite3rebaser_create(sqlite3_rebaser **ppNew);
+
+/*
+** CAPI3REF: Configure a changeset rebaser object.
+** EXPERIMENTAL
+**
+** Configure the changeset rebaser object to rebase changesets according
+** to the conflict resolutions described by buffer pRebase (size nRebase
+** bytes), which must have been obtained from a previous call to
+** sqlite3changeset_apply_v2().
+*/
+SQLITE_API int sqlite3rebaser_configure(
+ sqlite3_rebaser*,
+ int nRebase, const void *pRebase
+);
+
+/*
+** CAPI3REF: Rebase a changeset
+** EXPERIMENTAL
+**
+** Argument pIn must point to a buffer containing a changeset nIn bytes
+** in size. This function allocates and populates a buffer with a copy
+** of the changeset rebased according to the configuration of the
+** rebaser object passed as the first argument. If successful, (*ppOut)
+** is set to point to the new buffer containing the rebased changeset and
+** (*pnOut) to its size in bytes and SQLITE_OK returned. It is the
+** responsibility of the caller to eventually free the new buffer using
+** sqlite3_free(). Otherwise, if an error occurs, (*ppOut) and (*pnOut)
+** are set to zero and an SQLite error code returned.
+*/
+SQLITE_API int sqlite3rebaser_rebase(
+ sqlite3_rebaser*,
+ int nIn, const void *pIn,
+ int *pnOut, void **ppOut
+);
+
+/*
+** CAPI3REF: Delete a changeset rebaser object.
+** EXPERIMENTAL
+**
+** Delete the changeset rebaser object and all associated resources. There
+** should be one call to this function for each successful invocation
+** of sqlite3rebaser_create().
+*/
+SQLITE_API void sqlite3rebaser_delete(sqlite3_rebaser *p);
+
+/*
+** CAPI3REF: Streaming Versions of API functions.
+**
+** The six streaming API xxx_strm() functions serve similar purposes to the
+** corresponding non-streaming API functions:
+**
+**
+** Streaming function Non-streaming equivalent
+** sqlite3changeset_apply_strm [sqlite3changeset_apply]
+** sqlite3changeset_apply_strm_v2 [sqlite3changeset_apply_v2]
+** sqlite3changeset_concat_strm [sqlite3changeset_concat]
+** sqlite3changeset_invert_strm [sqlite3changeset_invert]
+** sqlite3changeset_start_strm [sqlite3changeset_start]
+** sqlite3session_changeset_strm [sqlite3session_changeset]
+** sqlite3session_patchset_strm [sqlite3session_patchset]
+**
+**
+** Non-streaming functions that accept changesets (or patchsets) as input
+** require that the entire changeset be stored in a single buffer in memory.
+** Similarly, those that return a changeset or patchset do so by returning
+** a pointer to a single large buffer allocated using sqlite3_malloc().
+** Normally this is convenient. However, if an application running in a
+** low-memory environment is required to handle very large changesets, the
+** large contiguous memory allocations required can become onerous.
+**
+** In order to avoid this problem, instead of a single large buffer, input
+** is passed to a streaming API functions by way of a callback function that
+** the sessions module invokes to incrementally request input data as it is
+** required. In all cases, a pair of API function parameters such as
+**
+**
+** int nChangeset,
+** void *pChangeset,
+**
+**
+** Is replaced by:
+**
+**
+** int (*xInput)(void *pIn, void *pData, int *pnData),
+** void *pIn,
+**
+**
+** Each time the xInput callback is invoked by the sessions module, the first
+** argument passed is a copy of the supplied pIn context pointer. The second
+** argument, pData, points to a buffer (*pnData) bytes in size. Assuming no
+** error occurs the xInput method should copy up to (*pnData) bytes of data
+** into the buffer and set (*pnData) to the actual number of bytes copied
+** before returning SQLITE_OK. If the input is completely exhausted, (*pnData)
+** should be set to zero to indicate this. Or, if an error occurs, an SQLite
+** error code should be returned. In all cases, if an xInput callback returns
+** an error, all processing is abandoned and the streaming API function
+** returns a copy of the error code to the caller.
+**
+** In the case of sqlite3changeset_start_strm(), the xInput callback may be
+** invoked by the sessions module at any point during the lifetime of the
+** iterator. If such an xInput callback returns an error, the iterator enters
+** an error state, whereby all subsequent calls to iterator functions
+** immediately fail with the same error code as returned by xInput.
+**
+** Similarly, streaming API functions that return changesets (or patchsets)
+** return them in chunks by way of a callback function instead of via a
+** pointer to a single large buffer. In this case, a pair of parameters such
+** as:
+**
+**
+** int *pnChangeset,
+** void **ppChangeset,
+**
+**
+** Is replaced by:
+**
+**
+** int (*xOutput)(void *pOut, const void *pData, int nData),
+** void *pOut
+**
+**
+** The xOutput callback is invoked zero or more times to return data to
+** the application. The first parameter passed to each call is a copy of the
+** pOut pointer supplied by the application. The second parameter, pData,
+** points to a buffer nData bytes in size containing the chunk of output
+** data being returned. If the xOutput callback successfully processes the
+** supplied data, it should return SQLITE_OK to indicate success. Otherwise,
+** it should return some other SQLite error code. In this case processing
+** is immediately abandoned and the streaming API function returns a copy
+** of the xOutput error code to the application.
+**
+** The sessions module never invokes an xOutput callback with the third
+** parameter set to a value less than or equal to zero. Other than this,
+** no guarantees are made as to the size of the chunks of data returned.
+*/
+SQLITE_API int sqlite3changeset_apply_strm(
+ sqlite3 *db, /* Apply change to "main" db of this handle */
+ int (*xInput)(void *pIn, void *pData, int *pnData), /* Input function */
+ void *pIn, /* First arg for xInput */
+ int(*xFilter)(
+ void *pCtx, /* Copy of sixth arg to _apply() */
+ const char *zTab /* Table name */
+ ),
+ int(*xConflict)(
+ void *pCtx, /* Copy of sixth arg to _apply() */
+ int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */
+ sqlite3_changeset_iter *p /* Handle describing change and conflict */
+ ),
+ void *pCtx /* First argument passed to xConflict */
+);
+SQLITE_API int sqlite3changeset_apply_v2_strm(
+ sqlite3 *db, /* Apply change to "main" db of this handle */
+ int (*xInput)(void *pIn, void *pData, int *pnData), /* Input function */
+ void *pIn, /* First arg for xInput */
+ int(*xFilter)(
+ void *pCtx, /* Copy of sixth arg to _apply() */
+ const char *zTab /* Table name */
+ ),
+ int(*xConflict)(
+ void *pCtx, /* Copy of sixth arg to _apply() */
+ int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */
+ sqlite3_changeset_iter *p /* Handle describing change and conflict */
+ ),
+ void *pCtx, /* First argument passed to xConflict */
+ void **ppRebase, int *pnRebase,
+ int flags
+);
+SQLITE_API int sqlite3changeset_concat_strm(
+ int (*xInputA)(void *pIn, void *pData, int *pnData),
+ void *pInA,
+ int (*xInputB)(void *pIn, void *pData, int *pnData),
+ void *pInB,
+ int (*xOutput)(void *pOut, const void *pData, int nData),
+ void *pOut
+);
+SQLITE_API int sqlite3changeset_invert_strm(
+ int (*xInput)(void *pIn, void *pData, int *pnData),
+ void *pIn,
+ int (*xOutput)(void *pOut, const void *pData, int nData),
+ void *pOut
+);
+SQLITE_API int sqlite3changeset_start_strm(
+ sqlite3_changeset_iter **pp,
+ int (*xInput)(void *pIn, void *pData, int *pnData),
+ void *pIn
+);
+SQLITE_API int sqlite3changeset_start_v2_strm(
+ sqlite3_changeset_iter **pp,
+ int (*xInput)(void *pIn, void *pData, int *pnData),
+ void *pIn,
+ int flags
+);
+SQLITE_API int sqlite3session_changeset_strm(
+ sqlite3_session *pSession,
+ int (*xOutput)(void *pOut, const void *pData, int nData),
+ void *pOut
+);
+SQLITE_API int sqlite3session_patchset_strm(
+ sqlite3_session *pSession,
+ int (*xOutput)(void *pOut, const void *pData, int nData),
+ void *pOut
+);
+SQLITE_API int sqlite3changegroup_add_strm(sqlite3_changegroup*,
+ int (*xInput)(void *pIn, void *pData, int *pnData),
+ void *pIn
+);
+SQLITE_API int sqlite3changegroup_output_strm(sqlite3_changegroup*,
+ int (*xOutput)(void *pOut, const void *pData, int nData),
+ void *pOut
+);
+SQLITE_API int sqlite3rebaser_rebase_strm(
+ sqlite3_rebaser *pRebaser,
+ int (*xInput)(void *pIn, void *pData, int *pnData),
+ void *pIn,
+ int (*xOutput)(void *pOut, const void *pData, int nData),
+ void *pOut
+);
+
+/*
+** CAPI3REF: Configure global parameters
+**
+** The sqlite3session_config() interface is used to make global configuration
+** changes to the sessions module in order to tune it to the specific needs
+** of the application.
+**
+** The sqlite3session_config() interface is not threadsafe. If it is invoked
+** while any other thread is inside any other sessions method then the
+** results are undefined. Furthermore, if it is invoked after any sessions
+** related objects have been created, the results are also undefined.
+**
+** The first argument to the sqlite3session_config() function must be one
+** of the SQLITE_SESSION_CONFIG_XXX constants defined below. The
+** interpretation of the (void*) value passed as the second parameter and
+** the effect of calling this function depends on the value of the first
+** parameter.
+**
+**
+** SQLITE_SESSION_CONFIG_STRMSIZE
+** By default, the sessions module streaming interfaces attempt to input
+** and output data in approximately 1 KiB chunks. This operand may be used
+** to set and query the value of this configuration setting. The pointer
+** passed as the second argument must point to a value of type (int).
+** If this value is greater than 0, it is used as the new streaming data
+** chunk size for both input and output. Before returning, the (int) value
+** pointed to by pArg is set to the final value of the streaming interface
+** chunk size.
+**
+**
+** This function returns SQLITE_OK if successful, or an SQLite error code
+** otherwise.
+*/
+SQLITE_API int sqlite3session_config(int op, void *pArg);
+
+/*
+** CAPI3REF: Values for sqlite3session_config().
+*/
+#define SQLITE_SESSION_CONFIG_STRMSIZE 1
+
+/*
+** Make sure we can call this stuff from C++.
+*/
+#if 0
+}
+#endif
+
+#endif /* !defined(__SQLITESESSION_H_) && defined(SQLITE_ENABLE_SESSION) */
+
+/******** End of sqlite3session.h *********/
+/******** Begin file fts5.h *********/
+/*
+** 2014 May 31
+**
+** The author disclaims copyright to this source code. In place of
+** a legal notice, here is a blessing:
+**
+** May you do good and not evil.
+** May you find forgiveness for yourself and forgive others.
+** May you share freely, never taking more than you give.
+**
+******************************************************************************
+**
+** Interfaces to extend FTS5. Using the interfaces defined in this file,
+** FTS5 may be extended with:
+**
+** * custom tokenizers, and
+** * custom auxiliary functions.
+*/
+
+
+#ifndef _FTS5_H
+#define _FTS5_H
+
+
+#if 0
+extern "C" {
+#endif
+
+/*************************************************************************
+** CUSTOM AUXILIARY FUNCTIONS
+**
+** Virtual table implementations may overload SQL functions by implementing
+** the sqlite3_module.xFindFunction() method.
+*/
+
+typedef struct Fts5ExtensionApi Fts5ExtensionApi;
+typedef struct Fts5Context Fts5Context;
+typedef struct Fts5PhraseIter Fts5PhraseIter;
+
+typedef void (*fts5_extension_function)(
+ const Fts5ExtensionApi *pApi, /* API offered by current FTS version */
+ Fts5Context *pFts, /* First arg to pass to pApi functions */
+ sqlite3_context *pCtx, /* Context for returning result/error */
+ int nVal, /* Number of values in apVal[] array */
+ sqlite3_value **apVal /* Array of trailing arguments */
+);
+
+struct Fts5PhraseIter {
+ const unsigned char *a;
+ const unsigned char *b;
+};
+
+/*
+** EXTENSION API FUNCTIONS
+**
+** xUserData(pFts):
+** Return a copy of the pUserData pointer passed to the xCreateFunction()
+** API when the extension function was registered.
+**
+** xColumnTotalSize(pFts, iCol, pnToken):
+** If parameter iCol is less than zero, set output variable *pnToken
+** to the total number of tokens in the FTS5 table. Or, if iCol is
+** non-negative but less than the number of columns in the table, return
+** the total number of tokens in column iCol, considering all rows in
+** the FTS5 table.
+**
+** If parameter iCol is greater than or equal to the number of columns
+** in the table, SQLITE_RANGE is returned. Or, if an error occurs (e.g.
+** an OOM condition or IO error), an appropriate SQLite error code is
+** returned.
+**
+** xColumnCount(pFts):
+** Return the number of columns in the table.
+**
+** xColumnSize(pFts, iCol, pnToken):
+** If parameter iCol is less than zero, set output variable *pnToken
+** to the total number of tokens in the current row. Or, if iCol is
+** non-negative but less than the number of columns in the table, set
+** *pnToken to the number of tokens in column iCol of the current row.
+**
+** If parameter iCol is greater than or equal to the number of columns
+** in the table, SQLITE_RANGE is returned. Or, if an error occurs (e.g.
+** an OOM condition or IO error), an appropriate SQLite error code is
+** returned.
+**
+** This function may be quite inefficient if used with an FTS5 table
+** created with the "columnsize=0" option.
+**
+** xColumnText:
+** If parameter iCol is less than zero, or greater than or equal to the
+** number of columns in the table, SQLITE_RANGE is returned.
+**
+** Otherwise, this function attempts to retrieve the text of column iCol of
+** the current document. If successful, (*pz) is set to point to a buffer
+** containing the text in utf-8 encoding, (*pn) is set to the size in bytes
+** (not characters) of the buffer and SQLITE_OK is returned. Otherwise,
+** if an error occurs, an SQLite error code is returned and the final values
+** of (*pz) and (*pn) are undefined.
+**
+** xPhraseCount:
+** Returns the number of phrases in the current query expression.
+**
+** xPhraseSize:
+** If parameter iCol is less than zero, or greater than or equal to the
+** number of phrases in the current query, as returned by xPhraseCount,
+** 0 is returned. Otherwise, this function returns the number of tokens in
+** phrase iPhrase of the query. Phrases are numbered starting from zero.
+**
+** xInstCount:
+** Set *pnInst to the total number of occurrences of all phrases within
+** the query within the current row. Return SQLITE_OK if successful, or
+** an error code (i.e. SQLITE_NOMEM) if an error occurs.
+**
+** This API can be quite slow if used with an FTS5 table created with the
+** "detail=none" or "detail=column" option. If the FTS5 table is created
+** with either "detail=none" or "detail=column" and "content=" option
+** (i.e. if it is a contentless table), then this API always returns 0.
+**
+** xInst:
+** Query for the details of phrase match iIdx within the current row.
+** Phrase matches are numbered starting from zero, so the iIdx argument
+** should be greater than or equal to zero and smaller than the value
+** output by xInstCount(). If iIdx is less than zero or greater than
+** or equal to the value returned by xInstCount(), SQLITE_RANGE is returned.
+**
+** Otherwise, output parameter *piPhrase is set to the phrase number, *piCol
+** to the column in which it occurs and *piOff the token offset of the
+** first token of the phrase. SQLITE_OK is returned if successful, or an
+** error code (i.e. SQLITE_NOMEM) if an error occurs.
+**
+** This API can be quite slow if used with an FTS5 table created with the
+** "detail=none" or "detail=column" option.
+**
+** xRowid:
+** Returns the rowid of the current row.
+**
+** xTokenize:
+** Tokenize text using the tokenizer belonging to the FTS5 table.
+**
+** xQueryPhrase(pFts5, iPhrase, pUserData, xCallback):
+** This API function is used to query the FTS table for phrase iPhrase
+** of the current query. Specifically, a query equivalent to:
+**
+** ... FROM ftstable WHERE ftstable MATCH $p ORDER BY rowid
+**
+** with $p set to a phrase equivalent to the phrase iPhrase of the
+** current query is executed. Any column filter that applies to
+** phrase iPhrase of the current query is included in $p. For each
+** row visited, the callback function passed as the fourth argument
+** is invoked. The context and API objects passed to the callback
+** function may be used to access the properties of each matched row.
+** Invoking Api.xUserData() returns a copy of the pointer passed as
+** the third argument to pUserData.
+**
+** If parameter iPhrase is less than zero, or greater than or equal to
+** the number of phrases in the query, as returned by xPhraseCount(),
+** this function returns SQLITE_RANGE.
+**
+** If the callback function returns any value other than SQLITE_OK, the
+** query is abandoned and the xQueryPhrase function returns immediately.
+** If the returned value is SQLITE_DONE, xQueryPhrase returns SQLITE_OK.
+** Otherwise, the error code is propagated upwards.
+**
+** If the query runs to completion without incident, SQLITE_OK is returned.
+** Or, if some error occurs before the query completes or is aborted by
+** the callback, an SQLite error code is returned.
+**
+**
+** xSetAuxdata(pFts5, pAux, xDelete)
+**
+** Save the pointer passed as the second argument as the extension function's
+** "auxiliary data". The pointer may then be retrieved by the current or any
+** future invocation of the same fts5 extension function made as part of
+** the same MATCH query using the xGetAuxdata() API.
+**
+** Each extension function is allocated a single auxiliary data slot for
+** each FTS query (MATCH expression). If the extension function is invoked
+** more than once for a single FTS query, then all invocations share a
+** single auxiliary data context.
+**
+** If there is already an auxiliary data pointer when this function is
+** invoked, then it is replaced by the new pointer. If an xDelete callback
+** was specified along with the original pointer, it is invoked at this
+** point.
+**
+** The xDelete callback, if one is specified, is also invoked on the
+** auxiliary data pointer after the FTS5 query has finished.
+**
+** If an error (e.g. an OOM condition) occurs within this function,
+** the auxiliary data is set to NULL and an error code returned. If the
+** xDelete parameter was not NULL, it is invoked on the auxiliary data
+** pointer before returning.
+**
+**
+** xGetAuxdata(pFts5, bClear)
+**
+** Returns the current auxiliary data pointer for the fts5 extension
+** function. See the xSetAuxdata() method for details.
+**
+** If the bClear argument is non-zero, then the auxiliary data is cleared
+** (set to NULL) before this function returns. In this case the xDelete,
+** if any, is not invoked.
+**
+**
+** xRowCount(pFts5, pnRow)
+**
+** This function is used to retrieve the total number of rows in the table.
+** In other words, the same value that would be returned by:
+**
+** SELECT count(*) FROM ftstable;
+**
+** xPhraseFirst()
+** This function is used, along with type Fts5PhraseIter and the xPhraseNext
+** method, to iterate through all instances of a single query phrase within
+** the current row. This is the same information as is accessible via the
+** xInstCount/xInst APIs. While the xInstCount/xInst APIs are more convenient
+** to use, this API may be faster under some circumstances. To iterate
+** through instances of phrase iPhrase, use the following code:
+**
+** Fts5PhraseIter iter;
+** int iCol, iOff;
+** for(pApi->xPhraseFirst(pFts, iPhrase, &iter, &iCol, &iOff);
+** iCol>=0;
+** pApi->xPhraseNext(pFts, &iter, &iCol, &iOff)
+** ){
+** // An instance of phrase iPhrase at offset iOff of column iCol
+** }
+**
+** The Fts5PhraseIter structure is defined above. Applications should not
+** modify this structure directly - it should only be used as shown above
+** with the xPhraseFirst() and xPhraseNext() API methods (and by
+** xPhraseFirstColumn() and xPhraseNextColumn() as illustrated below).
+**
+** This API can be quite slow if used with an FTS5 table created with the
+** "detail=none" or "detail=column" option. If the FTS5 table is created
+** with either "detail=none" or "detail=column" and "content=" option
+** (i.e. if it is a contentless table), then this API always iterates
+** through an empty set (all calls to xPhraseFirst() set iCol to -1).
+**
+** In all cases, matches are visited in (column ASC, offset ASC) order.
+** i.e. all those in column 0, sorted by offset, followed by those in
+** column 1, etc.
+**
+** xPhraseNext()
+** See xPhraseFirst above.
+**
+** xPhraseFirstColumn()
+** This function and xPhraseNextColumn() are similar to the xPhraseFirst()
+** and xPhraseNext() APIs described above. The difference is that instead
+** of iterating through all instances of a phrase in the current row, these
+** APIs are used to iterate through the set of columns in the current row
+** that contain one or more instances of a specified phrase. For example:
+**
+** Fts5PhraseIter iter;
+** int iCol;
+** for(pApi->xPhraseFirstColumn(pFts, iPhrase, &iter, &iCol);
+** iCol>=0;
+** pApi->xPhraseNextColumn(pFts, &iter, &iCol)
+** ){
+** // Column iCol contains at least one instance of phrase iPhrase
+** }
+**
+** This API can be quite slow if used with an FTS5 table created with the
+** "detail=none" option. If the FTS5 table is created with either
+** "detail=none" "content=" option (i.e. if it is a contentless table),
+** then this API always iterates through an empty set (all calls to
+** xPhraseFirstColumn() set iCol to -1).
+**
+** The information accessed using this API and its companion
+** xPhraseFirstColumn() may also be obtained using xPhraseFirst/xPhraseNext
+** (or xInst/xInstCount). The chief advantage of this API is that it is
+** significantly more efficient than those alternatives when used with
+** "detail=column" tables.
+**
+** xPhraseNextColumn()
+** See xPhraseFirstColumn above.
+**
+** xQueryToken(pFts5, iPhrase, iToken, ppToken, pnToken)
+** This is used to access token iToken of phrase iPhrase of the current
+** query. Before returning, output parameter *ppToken is set to point
+** to a buffer containing the requested token, and *pnToken to the
+** size of this buffer in bytes.
+**
+** If iPhrase or iToken are less than zero, or if iPhrase is greater than
+** or equal to the number of phrases in the query as reported by
+** xPhraseCount(), or if iToken is equal to or greater than the number of
+** tokens in the phrase, SQLITE_RANGE is returned and *ppToken and *pnToken
+ are both zeroed.
+**
+** The output text is not a copy of the query text that specified the
+** token. It is the output of the tokenizer module. For tokendata=1
+** tables, this includes any embedded 0x00 and trailing data.
+**
+** xInstToken(pFts5, iIdx, iToken, ppToken, pnToken)
+** This is used to access token iToken of phrase hit iIdx within the
+** current row. If iIdx is less than zero or greater than or equal to the
+** value returned by xInstCount(), SQLITE_RANGE is returned. Otherwise,
+** output variable (*ppToken) is set to point to a buffer containing the
+** matching document token, and (*pnToken) to the size of that buffer in
+** bytes.
+**
+** The output text is not a copy of the document text that was tokenized.
+** It is the output of the tokenizer module. For tokendata=1 tables, this
+** includes any embedded 0x00 and trailing data.
+**
+** This API may be slow in some cases if the token identified by parameters
+** iIdx and iToken matched a prefix token in the query. In most cases, the
+** first call to this API for each prefix token in the query is forced
+** to scan the portion of the full-text index that matches the prefix
+** token to collect the extra data required by this API. If the prefix
+** token matches a large number of token instances in the document set,
+** this may be a performance problem.
+**
+** If the user knows in advance that a query may use this API for a
+** prefix token, FTS5 may be configured to collect all required data as part
+** of the initial querying of the full-text index, avoiding the second scan
+** entirely. This also causes prefix queries that do not use this API to
+** run more slowly and use more memory. FTS5 may be configured in this way
+** either on a per-table basis using the [FTS5 insttoken | 'insttoken']
+** option, or on a per-query basis using the
+** [fts5_insttoken | fts5_insttoken()] user function.
+**
+** This API can be quite slow if used with an FTS5 table created with the
+** "detail=none" or "detail=column" option.
+**
+** xColumnLocale(pFts5, iIdx, pzLocale, pnLocale)
+** If parameter iCol is less than zero, or greater than or equal to the
+** number of columns in the table, SQLITE_RANGE is returned.
+**
+** Otherwise, this function attempts to retrieve the locale associated
+** with column iCol of the current row. Usually, there is no associated
+** locale, and output parameters (*pzLocale) and (*pnLocale) are set
+** to NULL and 0, respectively. However, if the fts5_locale() function
+** was used to associate a locale with the value when it was inserted
+** into the fts5 table, then (*pzLocale) is set to point to a nul-terminated
+** buffer containing the name of the locale in utf-8 encoding. (*pnLocale)
+** is set to the size in bytes of the buffer, not including the
+** nul-terminator.
+**
+** If successful, SQLITE_OK is returned. Or, if an error occurs, an
+** SQLite error code is returned. The final value of the output parameters
+** is undefined in this case.
+**
+** xTokenize_v2:
+** Tokenize text using the tokenizer belonging to the FTS5 table. This
+** API is the same as the xTokenize() API, except that it allows a tokenizer
+** locale to be specified.
+*/
+struct Fts5ExtensionApi {
+ int iVersion; /* Currently always set to 4 */
+
+ void *(*xUserData)(Fts5Context*);
+
+ int (*xColumnCount)(Fts5Context*);
+ int (*xRowCount)(Fts5Context*, sqlite3_int64 *pnRow);
+ int (*xColumnTotalSize)(Fts5Context*, int iCol, sqlite3_int64 *pnToken);
+
+ int (*xTokenize)(Fts5Context*,
+ const char *pText, int nText, /* Text to tokenize */
+ void *pCtx, /* Context passed to xToken() */
+ int (*xToken)(void*, int, const char*, int, int, int) /* Callback */
+ );
+
+ int (*xPhraseCount)(Fts5Context*);
+ int (*xPhraseSize)(Fts5Context*, int iPhrase);
+
+ int (*xInstCount)(Fts5Context*, int *pnInst);
+ int (*xInst)(Fts5Context*, int iIdx, int *piPhrase, int *piCol, int *piOff);
+
+ sqlite3_int64 (*xRowid)(Fts5Context*);
+ int (*xColumnText)(Fts5Context*, int iCol, const char **pz, int *pn);
+ int (*xColumnSize)(Fts5Context*, int iCol, int *pnToken);
+
+ int (*xQueryPhrase)(Fts5Context*, int iPhrase, void *pUserData,
+ int(*)(const Fts5ExtensionApi*,Fts5Context*,void*)
+ );
+ int (*xSetAuxdata)(Fts5Context*, void *pAux, void(*xDelete)(void*));
+ void *(*xGetAuxdata)(Fts5Context*, int bClear);
+
+ int (*xPhraseFirst)(Fts5Context*, int iPhrase, Fts5PhraseIter*, int*, int*);
+ void (*xPhraseNext)(Fts5Context*, Fts5PhraseIter*, int *piCol, int *piOff);
+
+ int (*xPhraseFirstColumn)(Fts5Context*, int iPhrase, Fts5PhraseIter*, int*);
+ void (*xPhraseNextColumn)(Fts5Context*, Fts5PhraseIter*, int *piCol);
+
+ /* Below this point are iVersion>=3 only */
+ int (*xQueryToken)(Fts5Context*,
+ int iPhrase, int iToken,
+ const char **ppToken, int *pnToken
+ );
+ int (*xInstToken)(Fts5Context*, int iIdx, int iToken, const char**, int*);
+
+ /* Below this point are iVersion>=4 only */
+ int (*xColumnLocale)(Fts5Context*, int iCol, const char **pz, int *pn);
+ int (*xTokenize_v2)(Fts5Context*,
+ const char *pText, int nText, /* Text to tokenize */
+ const char *pLocale, int nLocale, /* Locale to pass to tokenizer */
+ void *pCtx, /* Context passed to xToken() */
+ int (*xToken)(void*, int, const char*, int, int, int) /* Callback */
+ );
+};
+
+/*
+** CUSTOM AUXILIARY FUNCTIONS
+*************************************************************************/
+
+/*************************************************************************
+** CUSTOM TOKENIZERS
+**
+** Applications may also register custom tokenizer types. A tokenizer
+** is registered by providing fts5 with a populated instance of the
+** following structure. All structure methods must be defined, setting
+** any member of the fts5_tokenizer struct to NULL leads to undefined
+** behaviour. The structure methods are expected to function as follows:
+**
+** xCreate:
+** This function is used to allocate and initialize a tokenizer instance.
+** A tokenizer instance is required to actually tokenize text.
+**
+** The first argument passed to this function is a copy of the (void*)
+** pointer provided by the application when the fts5_tokenizer_v2 object
+** was registered with FTS5 (the third argument to xCreateTokenizer()).
+** The second and third arguments are an array of nul-terminated strings
+** containing the tokenizer arguments, if any, specified following the
+** tokenizer name as part of the CREATE VIRTUAL TABLE statement used
+** to create the FTS5 table.
+**
+** The final argument is an output variable. If successful, (*ppOut)
+** should be set to point to the new tokenizer handle and SQLITE_OK
+** returned. If an error occurs, some value other than SQLITE_OK should
+** be returned. In this case, fts5 assumes that the final value of *ppOut
+** is undefined.
+**
+** xDelete:
+** This function is invoked to delete a tokenizer handle previously
+** allocated using xCreate(). Fts5 guarantees that this function will
+** be invoked exactly once for each successful call to xCreate().
+**
+** xTokenize:
+** This function is expected to tokenize the nText byte string indicated
+** by argument pText. pText may or may not be nul-terminated. The first
+** argument passed to this function is a pointer to an Fts5Tokenizer object
+** returned by an earlier call to xCreate().
+**
+** The third argument indicates the reason that FTS5 is requesting
+** tokenization of the supplied text. This is always one of the following
+** four values:
+**
+** FTS5_TOKENIZE_DOCUMENT - A document is being inserted into
+** or removed from the FTS table. The tokenizer is being invoked to
+** determine the set of tokens to add to (or delete from) the
+** FTS index.
+**
+** FTS5_TOKENIZE_QUERY - A MATCH query is being executed
+** against the FTS index. The tokenizer is being called to tokenize
+** a bareword or quoted string specified as part of the query.
+**
+** (FTS5_TOKENIZE_QUERY | FTS5_TOKENIZE_PREFIX) - Same as
+** FTS5_TOKENIZE_QUERY, except that the bareword or quoted string is
+** followed by a "*" character, indicating that the last token
+** returned by the tokenizer will be treated as a token prefix.
+**
+** FTS5_TOKENIZE_AUX - The tokenizer is being invoked to
+** satisfy an fts5_api.xTokenize() request made by an auxiliary
+** function. Or an fts5_api.xColumnSize() request made by the same
+** on a columnsize=0 database.
+**
+**
+** The sixth and seventh arguments passed to xTokenize() - pLocale and
+** nLocale - are a pointer to a buffer containing the locale to use for
+** tokenization (e.g. "en_US") and its size in bytes, respectively. The
+** pLocale buffer is not nul-terminated. pLocale may be passed NULL (in
+** which case nLocale is always 0) to indicate that the tokenizer should
+** use its default locale.
+**
+** For each token in the input string, the supplied callback xToken() must
+** be invoked. The first argument to it should be a copy of the pointer
+** passed as the second argument to xTokenize(). The third and fourth
+** arguments are a pointer to a buffer containing the token text, and the
+** size of the token in bytes. The 4th and 5th arguments are the byte offsets
+** of the first byte of and first byte immediately following the text from
+** which the token is derived within the input.
+**
+** The second argument passed to the xToken() callback ("tflags") should
+** normally be set to 0. The exception is if the tokenizer supports
+** synonyms. In this case see the discussion below for details.
+**
+** FTS5 assumes the xToken() callback is invoked for each token in the
+** order that they occur within the input text.
+**
+** If an xToken() callback returns any value other than SQLITE_OK, then
+** the tokenization should be abandoned and the xTokenize() method should
+** immediately return a copy of the xToken() return value. Or, if the
+** input buffer is exhausted, xTokenize() should return SQLITE_OK. Finally,
+** if an error occurs with the xTokenize() implementation itself, it
+** may abandon the tokenization and return any error code other than
+** SQLITE_OK or SQLITE_DONE.
+**
+** If the tokenizer is registered using an fts5_tokenizer_v2 object,
+** then the xTokenize() method has two additional arguments - pLocale
+** and nLocale. These specify the locale that the tokenizer should use
+** for the current request. If pLocale and nLocale are both 0, then the
+** tokenizer should use its default locale. Otherwise, pLocale points to
+** an nLocale byte buffer containing the name of the locale to use as utf-8
+** text. pLocale is not nul-terminated.
+**
+** FTS5_TOKENIZER
+**
+** There is also an fts5_tokenizer object. This is an older, deprecated,
+** version of fts5_tokenizer_v2. It is similar except that:
+**
+**
+** There is no "iVersion" field, and
+** The xTokenize() method does not take a locale argument.
+**
+**
+** Legacy fts5_tokenizer tokenizers must be registered using the
+** legacy xCreateTokenizer() function, instead of xCreateTokenizer_v2().
+**
+** Tokenizer implementations registered using either API may be retrieved
+** using both xFindTokenizer() and xFindTokenizer_v2().
+**
+** SYNONYM SUPPORT
+**
+** Custom tokenizers may also support synonyms. Consider a case in which a
+** user wishes to query for a phrase such as "first place". Using the
+** built-in tokenizers, the FTS5 query 'first + place' will match instances
+** of "first place" within the document set, but not alternative forms
+** such as "1st place". In some applications, it would be better to match
+** all instances of "first place" or "1st place" regardless of which form
+** the user specified in the MATCH query text.
+**
+** There are several ways to approach this in FTS5:
+**
+** By mapping all synonyms to a single token. In this case, using
+** the above example, this means that the tokenizer returns the
+** same token for inputs "first" and "1st". Say that token is in
+** fact "first", so that when the user inserts the document "I won
+** 1st place" entries are added to the index for tokens "i", "won",
+** "first" and "place". If the user then queries for '1st + place',
+** the tokenizer substitutes "first" for "1st" and the query works
+** as expected.
+**
+** By querying the index for all synonyms of each query term
+** separately. In this case, when tokenizing query text, the
+** tokenizer may provide multiple synonyms for a single term
+** within the document. FTS5 then queries the index for each
+** synonym individually. For example, faced with the query:
+**
+**
+** ... MATCH 'first place'
+**
+** the tokenizer offers both "1st" and "first" as synonyms for the
+** first token in the MATCH query and FTS5 effectively runs a query
+** similar to:
+**
+**
+** ... MATCH '(first OR 1st) place'
+**
+** except that, for the purposes of auxiliary functions, the query
+** still appears to contain just two phrases - "(first OR 1st)"
+** being treated as a single phrase.
+**
+** By adding multiple synonyms for a single term to the FTS index.
+** Using this method, when tokenizing document text, the tokenizer
+** provides multiple synonyms for each token. So that when a
+** document such as "I won first place" is tokenized, entries are
+** added to the FTS index for "i", "won", "first", "1st" and
+** "place".
+**
+** This way, even if the tokenizer does not provide synonyms
+** when tokenizing query text (it should not - to do so would be
+** inefficient), it doesn't matter if the user queries for
+** 'first + place' or '1st + place', as there are entries in the
+** FTS index corresponding to both forms of the first token.
+**
+**
+** Whether it is parsing document or query text, any call to xToken that
+** specifies a tflags argument with the FTS5_TOKEN_COLOCATED bit
+** is considered to supply a synonym for the previous token. For example,
+** when parsing the document "I won first place", a tokenizer that supports
+** synonyms would call xToken() 5 times, as follows:
+**
+**
+** xToken(pCtx, 0, "i", 1, 0, 1);
+** xToken(pCtx, 0, "won", 3, 2, 5);
+** xToken(pCtx, 0, "first", 5, 6, 11);
+** xToken(pCtx, FTS5_TOKEN_COLOCATED, "1st", 3, 6, 11);
+** xToken(pCtx, 0, "place", 5, 12, 17);
+**
+**
+** It is an error to specify the FTS5_TOKEN_COLOCATED flag the first time
+** xToken() is called. Multiple synonyms may be specified for a single token
+** by making multiple calls to xToken(FTS5_TOKEN_COLOCATED) in sequence.
+** There is no limit to the number of synonyms that may be provided for a
+** single token.
+**
+** In many cases, method (1) above is the best approach. It does not add
+** extra data to the FTS index or require FTS5 to query for multiple terms,
+** so it is efficient in terms of disk space and query speed. However, it
+** does not support prefix queries very well. If, as suggested above, the
+** token "first" is substituted for "1st" by the tokenizer, then the query:
+**
+**
+** ... MATCH '1s*'
+**
+** will not match documents that contain the token "1st" (as the tokenizer
+** will probably not map "1s" to any prefix of "first").
+**
+** For full prefix support, method (3) may be preferred. In this case,
+** because the index contains entries for both "first" and "1st", prefix
+** queries such as 'fi*' or '1s*' will match correctly. However, because
+** extra entries are added to the FTS index, this method uses more space
+** within the database.
+**
+** Method (2) offers a midpoint between (1) and (3). Using this method,
+** a query such as '1s*' will match documents that contain the literal
+** token "1st", but not "first" (assuming the tokenizer is not able to
+** provide synonyms for prefixes). However, a non-prefix query like '1st'
+** will match against "1st" and "first". This method does not require
+** extra disk space, as no extra entries are added to the FTS index.
+** On the other hand, it may require more CPU cycles to run MATCH queries,
+** as separate queries of the FTS index are required for each synonym.
+**
+** When using methods (2) or (3), it is important that the tokenizer only
+** provide synonyms when tokenizing document text (method (3)) or query
+** text (method (2)), not both. Doing so will not cause any errors, but is
+** inefficient.
+*/
+typedef struct Fts5Tokenizer Fts5Tokenizer;
+typedef struct fts5_tokenizer_v2 fts5_tokenizer_v2;
+struct fts5_tokenizer_v2 {
+ int iVersion; /* Currently always 2 */
+
+ int (*xCreate)(void*, const char **azArg, int nArg, Fts5Tokenizer **ppOut);
+ void (*xDelete)(Fts5Tokenizer*);
+ int (*xTokenize)(Fts5Tokenizer*,
+ void *pCtx,
+ int flags, /* Mask of FTS5_TOKENIZE_* flags */
+ const char *pText, int nText,
+ const char *pLocale, int nLocale,
+ int (*xToken)(
+ void *pCtx, /* Copy of 2nd argument to xTokenize() */
+ int tflags, /* Mask of FTS5_TOKEN_* flags */
+ const char *pToken, /* Pointer to buffer containing token */
+ int nToken, /* Size of token in bytes */
+ int iStart, /* Byte offset of token within input text */
+ int iEnd /* Byte offset of end of token within input text */
+ )
+ );
+};
+
+/*
+** New code should use the fts5_tokenizer_v2 type to define tokenizer
+** implementations. The following type is included for legacy applications
+** that still use it.
+*/
+typedef struct fts5_tokenizer fts5_tokenizer;
+struct fts5_tokenizer {
+ int (*xCreate)(void*, const char **azArg, int nArg, Fts5Tokenizer **ppOut);
+ void (*xDelete)(Fts5Tokenizer*);
+ int (*xTokenize)(Fts5Tokenizer*,
+ void *pCtx,
+ int flags, /* Mask of FTS5_TOKENIZE_* flags */
+ const char *pText, int nText,
+ int (*xToken)(
+ void *pCtx, /* Copy of 2nd argument to xTokenize() */
+ int tflags, /* Mask of FTS5_TOKEN_* flags */
+ const char *pToken, /* Pointer to buffer containing token */
+ int nToken, /* Size of token in bytes */
+ int iStart, /* Byte offset of token within input text */
+ int iEnd /* Byte offset of end of token within input text */
+ )
+ );
+};
+
+
+/* Flags that may be passed as the third argument to xTokenize() */
+#define FTS5_TOKENIZE_QUERY 0x0001
+#define FTS5_TOKENIZE_PREFIX 0x0002
+#define FTS5_TOKENIZE_DOCUMENT 0x0004
+#define FTS5_TOKENIZE_AUX 0x0008
+
+/* Flags that may be passed by the tokenizer implementation back to FTS5
+** as the third argument to the supplied xToken callback. */
+#define FTS5_TOKEN_COLOCATED 0x0001 /* Same position as prev. token */
+
+/*
+** END OF CUSTOM TOKENIZERS
+*************************************************************************/
+
+/*************************************************************************
+** FTS5 EXTENSION REGISTRATION API
+*/
+typedef struct fts5_api fts5_api;
+struct fts5_api {
+ int iVersion; /* Currently always set to 3 */
+
+ /* Create a new tokenizer */
+ int (*xCreateTokenizer)(
+ fts5_api *pApi,
+ const char *zName,
+ void *pUserData,
+ fts5_tokenizer *pTokenizer,
+ void (*xDestroy)(void*)
+ );
+
+ /* Find an existing tokenizer */
+ int (*xFindTokenizer)(
+ fts5_api *pApi,
+ const char *zName,
+ void **ppUserData,
+ fts5_tokenizer *pTokenizer
+ );
+
+ /* Create a new auxiliary function */
+ int (*xCreateFunction)(
+ fts5_api *pApi,
+ const char *zName,
+ void *pUserData,
+ fts5_extension_function xFunction,
+ void (*xDestroy)(void*)
+ );
+
+ /* APIs below this point are only available if iVersion>=3 */
+
+ /* Create a new tokenizer */
+ int (*xCreateTokenizer_v2)(
+ fts5_api *pApi,
+ const char *zName,
+ void *pUserData,
+ fts5_tokenizer_v2 *pTokenizer,
+ void (*xDestroy)(void*)
+ );
+
+ /* Find an existing tokenizer */
+ int (*xFindTokenizer_v2)(
+ fts5_api *pApi,
+ const char *zName,
+ void **ppUserData,
+ fts5_tokenizer_v2 **ppTokenizer
+ );
+};
+
+/*
+** END OF REGISTRATION API
+*************************************************************************/
+
+#if 0
+} /* end of the 'extern "C"' block */
+#endif
+
+#endif /* _FTS5_H */
+
+/******** End of fts5.h *********/
+#endif /* SQLITE3_H */
+
+/************** End of sqlite3.h *********************************************/
+/************** Continuing where we left off in sqliteInt.h ******************/
+
+/*
+** Reuse the STATIC_LRU for mutex access to sqlite3_temp_directory.
+*/
+#define SQLITE_MUTEX_STATIC_TEMPDIR SQLITE_MUTEX_STATIC_VFS1
+
+/*
+** Include the configuration header output by 'configure' if we're using the
+** autoconf-based build
+*/
+#if defined(_HAVE_SQLITE_CONFIG_H) && !defined(SQLITECONFIG_H)
+#include "sqlite_cfg.h"
+#define SQLITECONFIG_H 1
+#endif
+
+/************** Include sqliteLimit.h in the middle of sqliteInt.h ***********/
+/************** Begin file sqliteLimit.h *************************************/
+/*
+** 2007 May 7
+**
+** The author disclaims copyright to this source code. In place of
+** a legal notice, here is a blessing:
+**
+** May you do good and not evil.
+** May you find forgiveness for yourself and forgive others.
+** May you share freely, never taking more than you give.
+**
+*************************************************************************
+**
+** This file defines various limits of what SQLite can process.
+*/
+
+/*
+** The maximum length of a TEXT or BLOB in bytes. This also
+** limits the size of a row in a table or index.
+**
+** The hard limit is the ability of a 32-bit signed integer
+** to count the size: 2^31-1 or 2147483647.
+*/
+#ifndef SQLITE_MAX_LENGTH
+# define SQLITE_MAX_LENGTH 1000000000
+#endif
+#define SQLITE_MIN_LENGTH 30 /* Minimum value for the length limit */
+
+/*
+** This is the maximum number of
+**
+** * Columns in a table
+** * Columns in an index
+** * Columns in a view
+** * Terms in the SET clause of an UPDATE statement
+** * Terms in the result set of a SELECT statement
+** * Terms in the GROUP BY or ORDER BY clauses of a SELECT statement.
+** * Terms in the VALUES clause of an INSERT statement
+**
+** The hard upper limit here is 32767. Most database people will
+** tell you that in a well-normalized database, you usually should
+** not have more than a dozen or so columns in any table. And if
+** that is the case, there is no point in having more than a few
+** dozen values in any of the other situations described above.
+**
+** An index can only have SQLITE_MAX_COLUMN columns from the user
+** point of view, but the underlying b-tree that implements the index
+** might have up to twice as many columns in a WITHOUT ROWID table,
+** since must also store the primary key at the end. Hence the
+** column count for Index is u16 instead of i16.
+*/
+#if !defined(SQLITE_MAX_COLUMN)
+# define SQLITE_MAX_COLUMN 2000
+#elif SQLITE_MAX_COLUMN>32767
+# error SQLITE_MAX_COLUMN may not exceed 32767
+#endif
+
+/*
+** The maximum length of a single SQL statement in bytes.
+**
+** It used to be the case that setting this value to zero would
+** turn the limit off. That is no longer true. It is not possible
+** to turn this limit off.
+*/
+#ifndef SQLITE_MAX_SQL_LENGTH
+# define SQLITE_MAX_SQL_LENGTH 1000000000
+#endif
+
+/*
+** The maximum depth of an expression tree. This is limited to
+** some extent by SQLITE_MAX_SQL_LENGTH. But sometime you might
+** want to place more severe limits on the complexity of an
+** expression. A value of 0 means that there is no limit.
+*/
+#ifndef SQLITE_MAX_EXPR_DEPTH
+# define SQLITE_MAX_EXPR_DEPTH 1000
+#endif
+
+/*
+** The maximum number of terms in a compound SELECT statement.
+** The code generator for compound SELECT statements does one
+** level of recursion for each term. A stack overflow can result
+** if the number of terms is too large. In practice, most SQL
+** never has more than 3 or 4 terms. Use a value of 0 to disable
+** any limit on the number of terms in a compound SELECT.
+*/
+#ifndef SQLITE_MAX_COMPOUND_SELECT
+# define SQLITE_MAX_COMPOUND_SELECT 500
+#endif
+
+/*
+** The maximum number of opcodes in a VDBE program.
+** Not currently enforced.
+*/
+#ifndef SQLITE_MAX_VDBE_OP
+# define SQLITE_MAX_VDBE_OP 250000000
+#endif
+
+/*
+** The maximum number of arguments to an SQL function.
+**
+** This value has a hard upper limit of 32767 due to storage
+** constraints (it needs to fit inside a i16). We keep it
+** lower than that to prevent abuse.
+*/
+#ifndef SQLITE_MAX_FUNCTION_ARG
+# define SQLITE_MAX_FUNCTION_ARG 1000
+#endif
+
+/*
+** The suggested maximum number of in-memory pages to use for
+** the main database table and for temporary tables.
+**
+** IMPLEMENTATION-OF: R-30185-15359 The default suggested cache size is -2000,
+** which means the cache size is limited to 2048000 bytes of memory.
+** IMPLEMENTATION-OF: R-48205-43578 The default suggested cache size can be
+** altered using the SQLITE_DEFAULT_CACHE_SIZE compile-time options.
+*/
+#ifndef SQLITE_DEFAULT_CACHE_SIZE
+# define SQLITE_DEFAULT_CACHE_SIZE -2000
+#endif
+
+/*
+** The default number of frames to accumulate in the log file before
+** checkpointing the database in WAL mode.
+*/
+#ifndef SQLITE_DEFAULT_WAL_AUTOCHECKPOINT
+# define SQLITE_DEFAULT_WAL_AUTOCHECKPOINT 1000
+#endif
+
+/*
+** The maximum number of attached databases. This must be between 0
+** and 125. The upper bound of 125 is because the attached databases are
+** counted using a signed 8-bit integer which has a maximum value of 127
+** and we have to allow 2 extra counts for the "main" and "temp" databases.
+*/
+#ifndef SQLITE_MAX_ATTACHED
+# define SQLITE_MAX_ATTACHED 10
+#endif
+
+
+/*
+** The maximum value of a ?nnn wildcard that the parser will accept.
+** If the value exceeds 32767 then extra space is required for the Expr
+** structure. But otherwise, we believe that the number can be as large
+** as a signed 32-bit integer can hold.
+*/
+#ifndef SQLITE_MAX_VARIABLE_NUMBER
+# define SQLITE_MAX_VARIABLE_NUMBER 32766
+#endif
+
+/* Maximum page size. The upper bound on this value is 65536. This a limit
+** imposed by the use of 16-bit offsets within each page.
+**
+** Earlier versions of SQLite allowed the user to change this value at
+** compile time. This is no longer permitted, on the grounds that it creates
+** a library that is technically incompatible with an SQLite library
+** compiled with a different limit. If a process operating on a database
+** with a page-size of 65536 bytes crashes, then an instance of SQLite
+** compiled with the default page-size limit will not be able to rollback
+** the aborted transaction. This could lead to database corruption.
+*/
+#ifdef SQLITE_MAX_PAGE_SIZE
+# undef SQLITE_MAX_PAGE_SIZE
+#endif
+#define SQLITE_MAX_PAGE_SIZE 65536
+
+
+/*
+** The default size of a database page.
+*/
+#ifndef SQLITE_DEFAULT_PAGE_SIZE
+# define SQLITE_DEFAULT_PAGE_SIZE 4096
+#endif
+#if SQLITE_DEFAULT_PAGE_SIZE>SQLITE_MAX_PAGE_SIZE
+# undef SQLITE_DEFAULT_PAGE_SIZE
+# define SQLITE_DEFAULT_PAGE_SIZE SQLITE_MAX_PAGE_SIZE
+#endif
+
+/*
+** Ordinarily, if no value is explicitly provided, SQLite creates databases
+** with page size SQLITE_DEFAULT_PAGE_SIZE. However, based on certain
+** device characteristics (sector-size and atomic write() support),
+** SQLite may choose a larger value. This constant is the maximum value
+** SQLite will choose on its own.
+*/
+#ifndef SQLITE_MAX_DEFAULT_PAGE_SIZE
+# define SQLITE_MAX_DEFAULT_PAGE_SIZE 8192
+#endif
+#if SQLITE_MAX_DEFAULT_PAGE_SIZE>SQLITE_MAX_PAGE_SIZE
+# undef SQLITE_MAX_DEFAULT_PAGE_SIZE
+# define SQLITE_MAX_DEFAULT_PAGE_SIZE SQLITE_MAX_PAGE_SIZE
+#endif
+
+
+/*
+** Maximum number of pages in one database file.
+**
+** This is really just the default value for the max_page_count pragma.
+** This value can be lowered (or raised) at run-time using that the
+** max_page_count macro.
+*/
+#ifndef SQLITE_MAX_PAGE_COUNT
+# define SQLITE_MAX_PAGE_COUNT 0xfffffffe /* 4294967294 */
+#endif
+
+/*
+** Maximum length (in bytes) of the pattern in a LIKE or GLOB
+** operator.
+*/
+#ifndef SQLITE_MAX_LIKE_PATTERN_LENGTH
+# define SQLITE_MAX_LIKE_PATTERN_LENGTH 50000
+#endif
+
+/*
+** Maximum depth of recursion for triggers.
+**
+** A value of 1 means that a trigger program will not be able to itself
+** fire any triggers. A value of 0 means that no trigger programs at all
+** may be executed.
+*/
+#ifndef SQLITE_MAX_TRIGGER_DEPTH
+# define SQLITE_MAX_TRIGGER_DEPTH 1000
+#endif
+
+/************** End of sqliteLimit.h *****************************************/
+/************** Continuing where we left off in sqliteInt.h ******************/
+
+/* Disable nuisance warnings on Borland compilers */
+#if defined(__BORLANDC__)
+#pragma warn -rch /* unreachable code */
+#pragma warn -ccc /* Condition is always true or false */
+#pragma warn -aus /* Assigned value is never used */
+#pragma warn -csu /* Comparing signed and unsigned */
+#pragma warn -spa /* Suspicious pointer arithmetic */
+#endif
+
+/*
+** A few places in the code require atomic load/store of aligned
+** integer values.
+*/
+#ifndef __has_extension
+# define __has_extension(x) 0 /* compatibility with non-clang compilers */
+#endif
+#if GCC_VERSION>=4007000 || __has_extension(c_atomic)
+# define SQLITE_ATOMIC_INTRINSICS 1
+# define AtomicLoad(PTR) __atomic_load_n((PTR),__ATOMIC_RELAXED)
+# define AtomicStore(PTR,VAL) __atomic_store_n((PTR),(VAL),__ATOMIC_RELAXED)
+#else
+# define SQLITE_ATOMIC_INTRINSICS 0
+# define AtomicLoad(PTR) (*(PTR))
+# define AtomicStore(PTR,VAL) (*(PTR) = (VAL))
+#endif
+
+/*
+** Include standard header files as necessary
+*/
+#ifdef HAVE_STDINT_H
+#include
+#endif
+#ifdef HAVE_INTTYPES_H
+#include
+#endif
+
+/*
+** The following macros are used to cast pointers to integers and
+** integers to pointers. The way you do this varies from one compiler
+** to the next, so we have developed the following set of #if statements
+** to generate appropriate macros for a wide range of compilers.
+**
+** The correct "ANSI" way to do this is to use the intptr_t type.
+** Unfortunately, that typedef is not available on all compilers, or
+** if it is available, it requires an #include of specific headers
+** that vary from one machine to the next.
+**
+** Ticket #3860: The llvm-gcc-4.2 compiler from Apple chokes on
+** the ((void*)&((char*)0)[X]) construct. But MSVC chokes on ((void*)(X)).
+** So we have to define the macros in different ways depending on the
+** compiler.
+*/
+#if defined(HAVE_STDINT_H) /* Use this case if we have ANSI headers */
+# define SQLITE_INT_TO_PTR(X) ((void*)(intptr_t)(X))
+# define SQLITE_PTR_TO_INT(X) ((int)(intptr_t)(X))
+#elif defined(__PTRDIFF_TYPE__) /* This case should work for GCC */
+# define SQLITE_INT_TO_PTR(X) ((void*)(__PTRDIFF_TYPE__)(X))
+# define SQLITE_PTR_TO_INT(X) ((int)(__PTRDIFF_TYPE__)(X))
+#elif !defined(__GNUC__) /* Works for compilers other than LLVM */
+# define SQLITE_INT_TO_PTR(X) ((void*)&((char*)0)[X])
+# define SQLITE_PTR_TO_INT(X) ((int)(((char*)X)-(char*)0))
+#else /* Generates a warning - but it always works */
+# define SQLITE_INT_TO_PTR(X) ((void*)(X))
+# define SQLITE_PTR_TO_INT(X) ((int)(X))
+#endif
+
+/*
+** Macros to hint to the compiler that a function should or should not be
+** inlined.
+*/
+#if defined(__GNUC__)
+# define SQLITE_NOINLINE __attribute__((noinline))
+# define SQLITE_INLINE __attribute__((always_inline)) inline
+#elif defined(_MSC_VER) && _MSC_VER>=1310
+# define SQLITE_NOINLINE __declspec(noinline)
+# define SQLITE_INLINE __forceinline
+#else
+# define SQLITE_NOINLINE
+# define SQLITE_INLINE
+#endif
+#if defined(SQLITE_COVERAGE_TEST) || defined(__STRICT_ANSI__)
+# undef SQLITE_INLINE
+# define SQLITE_INLINE
+#endif
+
+/*
+** Make sure that the compiler intrinsics we desire are enabled when
+** compiling with an appropriate version of MSVC unless prevented by
+** the SQLITE_DISABLE_INTRINSIC define.
+*/
+#if !defined(SQLITE_DISABLE_INTRINSIC)
+# if defined(_MSC_VER) && _MSC_VER>=1400
+# if !defined(_WIN32_WCE)
+# include
+# pragma intrinsic(_byteswap_ushort)
+# pragma intrinsic(_byteswap_ulong)
+# pragma intrinsic(_byteswap_uint64)
+# pragma intrinsic(_ReadWriteBarrier)
+# else
+# include
+# endif
+# endif
+#endif
+
+/*
+** Enable SQLITE_USE_SEH by default on MSVC builds. Only omit
+** SEH support if the -DSQLITE_OMIT_SEH option is given.
+*/
+#if defined(_MSC_VER) && !defined(SQLITE_OMIT_SEH)
+# define SQLITE_USE_SEH 1
+#else
+# undef SQLITE_USE_SEH
+#endif
+
+/*
+** Enable SQLITE_DIRECT_OVERFLOW_READ, unless the build explicitly
+** disables it using -DSQLITE_DIRECT_OVERFLOW_READ=0
+*/
+#if defined(SQLITE_DIRECT_OVERFLOW_READ) && SQLITE_DIRECT_OVERFLOW_READ+1==1
+ /* Disable if -DSQLITE_DIRECT_OVERFLOW_READ=0 */
+# undef SQLITE_DIRECT_OVERFLOW_READ
+#else
+ /* In all other cases, enable */
+# define SQLITE_DIRECT_OVERFLOW_READ 1
+#endif
+
+
+/*
+** The SQLITE_THREADSAFE macro must be defined as 0, 1, or 2.
+** 0 means mutexes are permanently disable and the library is never
+** threadsafe. 1 means the library is serialized which is the highest
+** level of threadsafety. 2 means the library is multithreaded - multiple
+** threads can use SQLite as long as no two threads try to use the same
+** database connection at the same time.
+**
+** Older versions of SQLite used an optional THREADSAFE macro.
+** We support that for legacy.
+**
+** To ensure that the correct value of "THREADSAFE" is reported when querying
+** for compile-time options at runtime (e.g. "PRAGMA compile_options"), this
+** logic is partially replicated in ctime.c. If it is updated here, it should
+** also be updated there.
+*/
+#if !defined(SQLITE_THREADSAFE)
+# if defined(THREADSAFE)
+# define SQLITE_THREADSAFE THREADSAFE
+# else
+# define SQLITE_THREADSAFE 1 /* IMP: R-07272-22309 */
+# endif
+#endif
+
+/*
+** Powersafe overwrite is on by default. But can be turned off using
+** the -DSQLITE_POWERSAFE_OVERWRITE=0 command-line option.
+*/
+#ifndef SQLITE_POWERSAFE_OVERWRITE
+# define SQLITE_POWERSAFE_OVERWRITE 1
+#endif
+
+/*
+** EVIDENCE-OF: R-25715-37072 Memory allocation statistics are enabled by
+** default unless SQLite is compiled with SQLITE_DEFAULT_MEMSTATUS=0 in
+** which case memory allocation statistics are disabled by default.
+*/
+#if !defined(SQLITE_DEFAULT_MEMSTATUS)
+# define SQLITE_DEFAULT_MEMSTATUS 1
+#endif
+
+/*
+** Exactly one of the following macros must be defined in order to
+** specify which memory allocation subsystem to use.
+**
+** SQLITE_SYSTEM_MALLOC // Use normal system malloc()
+** SQLITE_WIN32_MALLOC // Use Win32 native heap API
+** SQLITE_ZERO_MALLOC // Use a stub allocator that always fails
+** SQLITE_MEMDEBUG // Debugging version of system malloc()
+**
+** On Windows, if the SQLITE_WIN32_MALLOC_VALIDATE macro is defined and the
+** assert() macro is enabled, each call into the Win32 native heap subsystem
+** will cause HeapValidate to be called. If heap validation should fail, an
+** assertion will be triggered.
+**
+** If none of the above are defined, then set SQLITE_SYSTEM_MALLOC as
+** the default.
+*/
+#if defined(SQLITE_SYSTEM_MALLOC) \
+ + defined(SQLITE_WIN32_MALLOC) \
+ + defined(SQLITE_ZERO_MALLOC) \
+ + defined(SQLITE_MEMDEBUG)>1
+# error "Two or more of the following compile-time configuration options\
+ are defined but at most one is allowed:\
+ SQLITE_SYSTEM_MALLOC, SQLITE_WIN32_MALLOC, SQLITE_MEMDEBUG,\
+ SQLITE_ZERO_MALLOC"
+#endif
+#if defined(SQLITE_SYSTEM_MALLOC) \
+ + defined(SQLITE_WIN32_MALLOC) \
+ + defined(SQLITE_ZERO_MALLOC) \
+ + defined(SQLITE_MEMDEBUG)==0
+# define SQLITE_SYSTEM_MALLOC 1
+#endif
+
+/*
+** If SQLITE_MALLOC_SOFT_LIMIT is not zero, then try to keep the
+** sizes of memory allocations below this value where possible.
+*/
+#if !defined(SQLITE_MALLOC_SOFT_LIMIT)
+# define SQLITE_MALLOC_SOFT_LIMIT 1024
+#endif
+
+/*
+** We need to define _XOPEN_SOURCE as follows in order to enable
+** recursive mutexes on most Unix systems and fchmod() on OpenBSD.
+** But _XOPEN_SOURCE define causes problems for Mac OS X, so omit
+** it.
+*/
+#if !defined(_XOPEN_SOURCE) && !defined(__DARWIN__) && !defined(__APPLE__)
+# define _XOPEN_SOURCE 600
+#endif
+
+/*
+** NDEBUG and SQLITE_DEBUG are opposites. It should always be true that
+** defined(NDEBUG)==!defined(SQLITE_DEBUG). If this is not currently true,
+** make it true by defining or undefining NDEBUG.
+**
+** Setting NDEBUG makes the code smaller and faster by disabling the
+** assert() statements in the code. So we want the default action
+** to be for NDEBUG to be set and NDEBUG to be undefined only if SQLITE_DEBUG
+** is set. Thus NDEBUG becomes an opt-in rather than an opt-out
+** feature.
+*/
+#if !defined(NDEBUG) && !defined(SQLITE_DEBUG)
+# define NDEBUG 1
+#endif
+#if defined(NDEBUG) && defined(SQLITE_DEBUG)
+# undef NDEBUG
+#endif
+
+/*
+** Enable SQLITE_ENABLE_EXPLAIN_COMMENTS if SQLITE_DEBUG is turned on.
+*/
+#if !defined(SQLITE_ENABLE_EXPLAIN_COMMENTS) && defined(SQLITE_DEBUG)
+# define SQLITE_ENABLE_EXPLAIN_COMMENTS 1
+#endif
+
+/*
+** The testcase() macro is used to aid in coverage testing. When
+** doing coverage testing, the condition inside the argument to
+** testcase() must be evaluated both true and false in order to
+** get full branch coverage. The testcase() macro is inserted
+** to help ensure adequate test coverage in places where simple
+** condition/decision coverage is inadequate. For example, testcase()
+** can be used to make sure boundary values are tested. For
+** bitmask tests, testcase() can be used to make sure each bit
+** is significant and used at least once. On switch statements
+** where multiple cases go to the same block of code, testcase()
+** can insure that all cases are evaluated.
+*/
+#if defined(SQLITE_COVERAGE_TEST) || defined(SQLITE_DEBUG)
+# ifndef SQLITE_AMALGAMATION
+ extern unsigned int sqlite3CoverageCounter;
+# endif
+# define testcase(X) if( X ){ sqlite3CoverageCounter += (unsigned)__LINE__; }
+#else
+# define testcase(X)
+#endif
+
+/*
+** The TESTONLY macro is used to enclose variable declarations or
+** other bits of code that are needed to support the arguments
+** within testcase() and assert() macros.
+*/
+#if !defined(NDEBUG) || defined(SQLITE_COVERAGE_TEST)
+# define TESTONLY(X) X
+#else
+# define TESTONLY(X)
+#endif
+
+/*
+** Sometimes we need a small amount of code such as a variable initialization
+** to setup for a later assert() statement. We do not want this code to
+** appear when assert() is disabled. The following macro is therefore
+** used to contain that setup code. The "VVA" acronym stands for
+** "Verification, Validation, and Accreditation". In other words, the
+** code within VVA_ONLY() will only run during verification processes.
+*/
+#ifndef NDEBUG
+# define VVA_ONLY(X) X
+#else
+# define VVA_ONLY(X)
+#endif
+
+/*
+** Disable ALWAYS() and NEVER() (make them pass-throughs) for coverage
+** and mutation testing
+*/
+#if defined(SQLITE_COVERAGE_TEST) || defined(SQLITE_MUTATION_TEST)
+# define SQLITE_OMIT_AUXILIARY_SAFETY_CHECKS 1
+#endif
+
+/*
+** The ALWAYS and NEVER macros surround boolean expressions which
+** are intended to always be true or false, respectively. Such
+** expressions could be omitted from the code completely. But they
+** are included in a few cases in order to enhance the resilience
+** of SQLite to unexpected behavior - to make the code "self-healing"
+** or "ductile" rather than being "brittle" and crashing at the first
+** hint of unplanned behavior.
+**
+** In other words, ALWAYS and NEVER are added for defensive code.
+**
+** When doing coverage testing ALWAYS and NEVER are hard-coded to
+** be true and false so that the unreachable code they specify will
+** not be counted as untested code.
+*/
+#if defined(SQLITE_OMIT_AUXILIARY_SAFETY_CHECKS)
+# define ALWAYS(X) (1)
+# define NEVER(X) (0)
+#elif !defined(NDEBUG)
+# define ALWAYS(X) ((X)?1:(assert(0),0))
+# define NEVER(X) ((X)?(assert(0),1):0)
+#else
+# define ALWAYS(X) (X)
+# define NEVER(X) (X)
+#endif
+
+/*
+** Some conditionals are optimizations only. In other words, if the
+** conditionals are replaced with a constant 1 (true) or 0 (false) then
+** the correct answer is still obtained, though perhaps not as quickly.
+**
+** The following macros mark these optimizations conditionals.
+*/
+#if defined(SQLITE_MUTATION_TEST)
+# define OK_IF_ALWAYS_TRUE(X) (1)
+# define OK_IF_ALWAYS_FALSE(X) (0)
+#else
+# define OK_IF_ALWAYS_TRUE(X) (X)
+# define OK_IF_ALWAYS_FALSE(X) (X)
+#endif
+
+/*
+** Some malloc failures are only possible if SQLITE_TEST_REALLOC_STRESS is
+** defined. We need to defend against those failures when testing with
+** SQLITE_TEST_REALLOC_STRESS, but we don't want the unreachable branches
+** during a normal build. The following macro can be used to disable tests
+** that are always false except when SQLITE_TEST_REALLOC_STRESS is set.
+*/
+#if defined(SQLITE_TEST_REALLOC_STRESS)
+# define ONLY_IF_REALLOC_STRESS(X) (X)
+#elif !defined(NDEBUG)
+# define ONLY_IF_REALLOC_STRESS(X) ((X)?(assert(0),1):0)
+#else
+# define ONLY_IF_REALLOC_STRESS(X) (0)
+#endif
+
+/*
+** Declarations used for tracing the operating system interfaces.
+*/
+#if defined(SQLITE_FORCE_OS_TRACE) || defined(SQLITE_TEST) || \
+ (defined(SQLITE_DEBUG) && SQLITE_OS_WIN)
+ extern int sqlite3OSTrace;
+# define OSTRACE(X) if( sqlite3OSTrace ) sqlite3DebugPrintf X
+# define SQLITE_HAVE_OS_TRACE
+#else
+# define OSTRACE(X)
+# undef SQLITE_HAVE_OS_TRACE
+#endif
+
+/*
+** Is the sqlite3ErrName() function needed in the build? Currently,
+** it is needed by "mutex_w32.c" (when debugging), "os_win.c" (when
+** OSTRACE is enabled), and by several "test*.c" files (which are
+** compiled using SQLITE_TEST).
+*/
+#if defined(SQLITE_HAVE_OS_TRACE) || defined(SQLITE_TEST) || \
+ (defined(SQLITE_DEBUG) && SQLITE_OS_WIN)
+# define SQLITE_NEED_ERR_NAME
+#else
+# undef SQLITE_NEED_ERR_NAME
+#endif
+
+/*
+** SQLITE_ENABLE_EXPLAIN_COMMENTS is incompatible with SQLITE_OMIT_EXPLAIN
+*/
+#ifdef SQLITE_OMIT_EXPLAIN
+# undef SQLITE_ENABLE_EXPLAIN_COMMENTS
+#endif
+
+/*
+** SQLITE_OMIT_VIRTUALTABLE implies SQLITE_OMIT_ALTERTABLE
+*/
+#if defined(SQLITE_OMIT_VIRTUALTABLE) && !defined(SQLITE_OMIT_ALTERTABLE)
+# define SQLITE_OMIT_ALTERTABLE
+#endif
+
+#define SQLITE_DIGIT_SEPARATOR '_'
+
+/*
+** Return true (non-zero) if the input is an integer that is too large
+** to fit in 32-bits. This macro is used inside of various testcase()
+** macros to verify that we have tested SQLite for large-file support.
+*/
+#define IS_BIG_INT(X) (((X)&~(i64)0xffffffff)!=0)
+
+/*
+** The macro unlikely() is a hint that surrounds a boolean
+** expression that is usually false. Macro likely() surrounds
+** a boolean expression that is usually true. These hints could,
+** in theory, be used by the compiler to generate better code, but
+** currently they are just comments for human readers.
+*/
+#define likely(X) (X)
+#define unlikely(X) (X)
+
+/************** Include hash.h in the middle of sqliteInt.h ******************/
+/************** Begin file hash.h ********************************************/
+/*
+** 2001 September 22
+**
+** The author disclaims copyright to this source code. In place of
+** a legal notice, here is a blessing:
+**
+** May you do good and not evil.
+** May you find forgiveness for yourself and forgive others.
+** May you share freely, never taking more than you give.
+**
+*************************************************************************
+** This is the header file for the generic hash-table implementation
+** used in SQLite.
+*/
+#ifndef SQLITE_HASH_H
+#define SQLITE_HASH_H
+
+/* Forward declarations of structures. */
+typedef struct Hash Hash;
+typedef struct HashElem HashElem;
+
+/* A complete hash table is an instance of the following structure.
+** The internals of this structure are intended to be opaque -- client
+** code should not attempt to access or modify the fields of this structure
+** directly. Change this structure only by using the routines below.
+** However, some of the "procedures" and "functions" for modifying and
+** accessing this structure are really macros, so we can't really make
+** this structure opaque.
+**
+** All elements of the hash table are on a single doubly-linked list.
+** Hash.first points to the head of this list.
+**
+** There are Hash.htsize buckets. Each bucket points to a spot in
+** the global doubly-linked list. The contents of the bucket are the
+** element pointed to plus the next _ht.count-1 elements in the list.
+**
+** Hash.htsize and Hash.ht may be zero. In that case lookup is done
+** by a linear search of the global list. For small tables, the
+** Hash.ht table is never allocated because if there are few elements
+** in the table, it is faster to do a linear search than to manage
+** the hash table.
+*/
+struct Hash {
+ unsigned int htsize; /* Number of buckets in the hash table */
+ unsigned int count; /* Number of entries in this table */
+ HashElem *first; /* The first element of the array */
+ struct _ht { /* the hash table */
+ unsigned int count; /* Number of entries with this hash */
+ HashElem *chain; /* Pointer to first entry with this hash */
+ } *ht;
+};
+
+/* Each element in the hash table is an instance of the following
+** structure. All elements are stored on a single doubly-linked list.
+**
+** Again, this structure is intended to be opaque, but it can't really
+** be opaque because it is used by macros.
+*/
+struct HashElem {
+ HashElem *next, *prev; /* Next and previous elements in the table */
+ void *data; /* Data associated with this element */
+ const char *pKey; /* Key associated with this element */
+ unsigned int h; /* hash for pKey */
+};
+
+/*
+** Access routines. To delete, insert a NULL pointer.
+*/
+SQLITE_PRIVATE void sqlite3HashInit(Hash*);
+SQLITE_PRIVATE void *sqlite3HashInsert(Hash*, const char *pKey, void *pData);
+SQLITE_PRIVATE void *sqlite3HashFind(const Hash*, const char *pKey);
+SQLITE_PRIVATE void sqlite3HashClear(Hash*);
+
+/*
+** Macros for looping over all elements of a hash table. The idiom is
+** like this:
+**
+** Hash h;
+** HashElem *p;
+** ...
+** for(p=sqliteHashFirst(&h); p; p=sqliteHashNext(p)){
+** SomeStructure *pData = sqliteHashData(p);
+** // do something with pData
+** }
+*/
+#define sqliteHashFirst(H) ((H)->first)
+#define sqliteHashNext(E) ((E)->next)
+#define sqliteHashData(E) ((E)->data)
+/* #define sqliteHashKey(E) ((E)->pKey) // NOT USED */
+/* #define sqliteHashKeysize(E) ((E)->nKey) // NOT USED */
+
+/*
+** Number of entries in a hash table
+*/
+#define sqliteHashCount(H) ((H)->count)
+
+#endif /* SQLITE_HASH_H */
+
+/************** End of hash.h ************************************************/
+/************** Continuing where we left off in sqliteInt.h ******************/
+/************** Include parse.h in the middle of sqliteInt.h *****************/
+/************** Begin file parse.h *******************************************/
+#define TK_SEMI 1
+#define TK_EXPLAIN 2
+#define TK_QUERY 3
+#define TK_PLAN 4
+#define TK_BEGIN 5
+#define TK_TRANSACTION 6
+#define TK_DEFERRED 7
+#define TK_IMMEDIATE 8
+#define TK_EXCLUSIVE 9
+#define TK_COMMIT 10
+#define TK_END 11
+#define TK_ROLLBACK 12
+#define TK_SAVEPOINT 13
+#define TK_RELEASE 14
+#define TK_TO 15
+#define TK_TABLE 16
+#define TK_CREATE 17
+#define TK_IF 18
+#define TK_NOT 19
+#define TK_EXISTS 20
+#define TK_TEMP 21
+#define TK_LP 22
+#define TK_RP 23
+#define TK_AS 24
+#define TK_COMMA 25
+#define TK_WITHOUT 26
+#define TK_ABORT 27
+#define TK_ACTION 28
+#define TK_AFTER 29
+#define TK_ANALYZE 30
+#define TK_ASC 31
+#define TK_ATTACH 32
+#define TK_BEFORE 33
+#define TK_BY 34
+#define TK_CASCADE 35
+#define TK_CAST 36
+#define TK_CONFLICT 37
+#define TK_DATABASE 38
+#define TK_DESC 39
+#define TK_DETACH 40
+#define TK_EACH 41
+#define TK_FAIL 42
+#define TK_OR 43
+#define TK_AND 44
+#define TK_IS 45
+#define TK_ISNOT 46
+#define TK_MATCH 47
+#define TK_LIKE_KW 48
+#define TK_BETWEEN 49
+#define TK_IN 50
+#define TK_ISNULL 51
+#define TK_NOTNULL 52
+#define TK_NE 53
+#define TK_EQ 54
+#define TK_GT 55
+#define TK_LE 56
+#define TK_LT 57
+#define TK_GE 58
+#define TK_ESCAPE 59
+#define TK_ID 60
+#define TK_COLUMNKW 61
+#define TK_DO 62
+#define TK_FOR 63
+#define TK_IGNORE 64
+#define TK_INITIALLY 65
+#define TK_INSTEAD 66
+#define TK_NO 67
+#define TK_KEY 68
+#define TK_OF 69
+#define TK_OFFSET 70
+#define TK_PRAGMA 71
+#define TK_RAISE 72
+#define TK_RECURSIVE 73
+#define TK_REPLACE 74
+#define TK_RESTRICT 75
+#define TK_ROW 76
+#define TK_ROWS 77
+#define TK_TRIGGER 78
+#define TK_VACUUM 79
+#define TK_VIEW 80
+#define TK_VIRTUAL 81
+#define TK_WITH 82
+#define TK_NULLS 83
+#define TK_FIRST 84
+#define TK_LAST 85
+#define TK_CURRENT 86
+#define TK_FOLLOWING 87
+#define TK_PARTITION 88
+#define TK_PRECEDING 89
+#define TK_RANGE 90
+#define TK_UNBOUNDED 91
+#define TK_EXCLUDE 92
+#define TK_GROUPS 93
+#define TK_OTHERS 94
+#define TK_TIES 95
+#define TK_GENERATED 96
+#define TK_ALWAYS 97
+#define TK_MATERIALIZED 98
+#define TK_REINDEX 99
+#define TK_RENAME 100
+#define TK_CTIME_KW 101
+#define TK_ANY 102
+#define TK_BITAND 103
+#define TK_BITOR 104
+#define TK_LSHIFT 105
+#define TK_RSHIFT 106
+#define TK_PLUS 107
+#define TK_MINUS 108
+#define TK_STAR 109
+#define TK_SLASH 110
+#define TK_REM 111
+#define TK_CONCAT 112
+#define TK_PTR 113
+#define TK_COLLATE 114
+#define TK_BITNOT 115
+#define TK_ON 116
+#define TK_INDEXED 117
+#define TK_STRING 118
+#define TK_JOIN_KW 119
+#define TK_CONSTRAINT 120
+#define TK_DEFAULT 121
+#define TK_NULL 122
+#define TK_PRIMARY 123
+#define TK_UNIQUE 124
+#define TK_CHECK 125
+#define TK_REFERENCES 126
+#define TK_AUTOINCR 127
+#define TK_INSERT 128
+#define TK_DELETE 129
+#define TK_UPDATE 130
+#define TK_SET 131
+#define TK_DEFERRABLE 132
+#define TK_FOREIGN 133
+#define TK_DROP 134
+#define TK_UNION 135
+#define TK_ALL 136
+#define TK_EXCEPT 137
+#define TK_INTERSECT 138
+#define TK_SELECT 139
+#define TK_VALUES 140
+#define TK_DISTINCT 141
+#define TK_DOT 142
+#define TK_FROM 143
+#define TK_JOIN 144
+#define TK_USING 145
+#define TK_ORDER 146
+#define TK_GROUP 147
+#define TK_HAVING 148
+#define TK_LIMIT 149
+#define TK_WHERE 150
+#define TK_RETURNING 151
+#define TK_INTO 152
+#define TK_NOTHING 153
+#define TK_FLOAT 154
+#define TK_BLOB 155
+#define TK_INTEGER 156
+#define TK_VARIABLE 157
+#define TK_CASE 158
+#define TK_WHEN 159
+#define TK_THEN 160
+#define TK_ELSE 161
+#define TK_INDEX 162
+#define TK_ALTER 163
+#define TK_ADD 164
+#define TK_WINDOW 165
+#define TK_OVER 166
+#define TK_FILTER 167
+#define TK_COLUMN 168
+#define TK_AGG_FUNCTION 169
+#define TK_AGG_COLUMN 170
+#define TK_TRUEFALSE 171
+#define TK_FUNCTION 172
+#define TK_UPLUS 173
+#define TK_UMINUS 174
+#define TK_TRUTH 175
+#define TK_REGISTER 176
+#define TK_VECTOR 177
+#define TK_SELECT_COLUMN 178
+#define TK_IF_NULL_ROW 179
+#define TK_ASTERISK 180
+#define TK_SPAN 181
+#define TK_ERROR 182
+#define TK_QNUMBER 183
+#define TK_SPACE 184
+#define TK_COMMENT 185
+#define TK_ILLEGAL 186
+
+/************** End of parse.h ***********************************************/
+/************** Continuing where we left off in sqliteInt.h ******************/
+#include
+#include
+#include
+#include
+#include
+#include
+
+/*
+** Use a macro to replace memcpy() if compiled with SQLITE_INLINE_MEMCPY.
+** This allows better measurements of where memcpy() is used when running
+** cachegrind. But this macro version of memcpy() is very slow so it
+** should not be used in production. This is a performance measurement
+** hack only.
+*/
+#ifdef SQLITE_INLINE_MEMCPY
+# define memcpy(D,S,N) {char*xxd=(char*)(D);const char*xxs=(const char*)(S);\
+ int xxn=(N);while(xxn-->0)*(xxd++)=*(xxs++);}
+#endif
+
+/*
+** If compiling for a processor that lacks floating point support,
+** substitute integer for floating-point
+*/
+#ifdef SQLITE_OMIT_FLOATING_POINT
+# define double sqlite_int64
+# define float sqlite_int64
+# define fabs(X) ((X)<0?-(X):(X))
+# define sqlite3IsOverflow(X) 0
+# ifndef SQLITE_BIG_DBL
+# define SQLITE_BIG_DBL (((sqlite3_int64)1)<<50)
+# endif
+# define SQLITE_OMIT_DATETIME_FUNCS 1
+# define SQLITE_OMIT_TRACE 1
+# undef SQLITE_MIXED_ENDIAN_64BIT_FLOAT
+# undef SQLITE_HAVE_ISNAN
+#endif
+#ifndef SQLITE_BIG_DBL
+# define SQLITE_BIG_DBL (1e99)
+#endif
+
+/*
+** OMIT_TEMPDB is set to 1 if SQLITE_OMIT_TEMPDB is defined, or 0
+** afterward. Having this macro allows us to cause the C compiler
+** to omit code used by TEMP tables without messy #ifndef statements.
+*/
+#ifdef SQLITE_OMIT_TEMPDB
+#define OMIT_TEMPDB 1
+#else
+#define OMIT_TEMPDB 0
+#endif
+
+/*
+** The "file format" number is an integer that is incremented whenever
+** the VDBE-level file format changes. The following macros define the
+** the default file format for new databases and the maximum file format
+** that the library can read.
+*/
+#define SQLITE_MAX_FILE_FORMAT 4
+#ifndef SQLITE_DEFAULT_FILE_FORMAT
+# define SQLITE_DEFAULT_FILE_FORMAT 4
+#endif
+
+/*
+** Determine whether triggers are recursive by default. This can be
+** changed at run-time using a pragma.
+*/
+#ifndef SQLITE_DEFAULT_RECURSIVE_TRIGGERS
+# define SQLITE_DEFAULT_RECURSIVE_TRIGGERS 0
+#endif
+
+/*
+** Provide a default value for SQLITE_TEMP_STORE in case it is not specified
+** on the command-line
+*/
+#ifndef SQLITE_TEMP_STORE
+# define SQLITE_TEMP_STORE 1
+#endif
+
+/*
+** If no value has been provided for SQLITE_MAX_WORKER_THREADS, or if
+** SQLITE_TEMP_STORE is set to 3 (never use temporary files), set it
+** to zero.
+*/
+#if SQLITE_TEMP_STORE==3 || SQLITE_THREADSAFE==0
+# undef SQLITE_MAX_WORKER_THREADS
+# define SQLITE_MAX_WORKER_THREADS 0
+#endif
+#ifndef SQLITE_MAX_WORKER_THREADS
+# define SQLITE_MAX_WORKER_THREADS 8
+#endif
+#ifndef SQLITE_DEFAULT_WORKER_THREADS
+# define SQLITE_DEFAULT_WORKER_THREADS 0
+#endif
+#if SQLITE_DEFAULT_WORKER_THREADS>SQLITE_MAX_WORKER_THREADS
+# undef SQLITE_MAX_WORKER_THREADS
+# define SQLITE_MAX_WORKER_THREADS SQLITE_DEFAULT_WORKER_THREADS
+#endif
+
+/*
+** The default initial allocation for the pagecache when using separate
+** pagecaches for each database connection. A positive number is the
+** number of pages. A negative number N translations means that a buffer
+** of -1024*N bytes is allocated and used for as many pages as it will hold.
+**
+** The default value of "20" was chosen to minimize the run-time of the
+** speedtest1 test program with options: --shrink-memory --reprepare
+*/
+#ifndef SQLITE_DEFAULT_PCACHE_INITSZ
+# define SQLITE_DEFAULT_PCACHE_INITSZ 20
+#endif
+
+/*
+** Default value for the SQLITE_CONFIG_SORTERREF_SIZE option.
+*/
+#ifndef SQLITE_DEFAULT_SORTERREF_SIZE
+# define SQLITE_DEFAULT_SORTERREF_SIZE 0x7fffffff
+#endif
+
+/*
+** The compile-time options SQLITE_MMAP_READWRITE and
+** SQLITE_ENABLE_BATCH_ATOMIC_WRITE are not compatible with one another.
+** You must choose one or the other (or neither) but not both.
+*/
+#if defined(SQLITE_MMAP_READWRITE) && defined(SQLITE_ENABLE_BATCH_ATOMIC_WRITE)
+#error Cannot use both SQLITE_MMAP_READWRITE and SQLITE_ENABLE_BATCH_ATOMIC_WRITE
+#endif
+
+/*
+** GCC does not define the offsetof() macro so we'll have to do it
+** ourselves.
+*/
+#ifndef offsetof
+#define offsetof(STRUCTURE,FIELD) ((size_t)((char*)&((STRUCTURE*)0)->FIELD))
+#endif
+
+/*
+** Work around C99 "flex-array" syntax for pre-C99 compilers, so as
+** to avoid complaints from -fsanitize=strict-bounds.
+*/
+#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
+# define FLEXARRAY
+#else
+# define FLEXARRAY 1
+#endif
+
+/*
+** Macros to compute minimum and maximum of two numbers.
+*/
+#ifndef MIN
+# define MIN(A,B) ((A)<(B)?(A):(B))
+#endif
+#ifndef MAX
+# define MAX(A,B) ((A)>(B)?(A):(B))
+#endif
+
+/*
+** Swap two objects of type TYPE.
+*/
+#define SWAP(TYPE,A,B) {TYPE t=A; A=B; B=t;}
+
+/*
+** Check to see if this machine uses EBCDIC. (Yes, believe it or
+** not, there are still machines out there that use EBCDIC.)
+*/
+#if 'A' == '\301'
+# define SQLITE_EBCDIC 1
+#else
+# define SQLITE_ASCII 1
+#endif
+
+/*
+** Integers of known sizes. These typedefs might change for architectures
+** where the sizes very. Preprocessor macros are available so that the
+** types can be conveniently redefined at compile-type. Like this:
+**
+** cc '-DUINTPTR_TYPE=long long int' ...
+*/
+#ifndef UINT32_TYPE
+# ifdef HAVE_UINT32_T
+# define UINT32_TYPE uint32_t
+# else
+# define UINT32_TYPE unsigned int
+# endif
+#endif
+#ifndef UINT16_TYPE
+# ifdef HAVE_UINT16_T
+# define UINT16_TYPE uint16_t
+# else
+# define UINT16_TYPE unsigned short int
+# endif
+#endif
+#ifndef INT16_TYPE
+# ifdef HAVE_INT16_T
+# define INT16_TYPE int16_t
+# else
+# define INT16_TYPE short int
+# endif
+#endif
+#ifndef UINT8_TYPE
+# ifdef HAVE_UINT8_T
+# define UINT8_TYPE uint8_t
+# else
+# define UINT8_TYPE unsigned char
+# endif
+#endif
+#ifndef INT8_TYPE
+# ifdef HAVE_INT8_T
+# define INT8_TYPE int8_t
+# else
+# define INT8_TYPE signed char
+# endif
+#endif
+typedef sqlite_int64 i64; /* 8-byte signed integer */
+typedef sqlite_uint64 u64; /* 8-byte unsigned integer */
+typedef UINT32_TYPE u32; /* 4-byte unsigned integer */
+typedef UINT16_TYPE u16; /* 2-byte unsigned integer */
+typedef INT16_TYPE i16; /* 2-byte signed integer */
+typedef UINT8_TYPE u8; /* 1-byte unsigned integer */
+typedef INT8_TYPE i8; /* 1-byte signed integer */
+
+/* A bitfield type for use inside of structures. Always follow with :N where
+** N is the number of bits.
+*/
+typedef unsigned bft; /* Bit Field Type */
+
+/*
+** SQLITE_MAX_U32 is a u64 constant that is the maximum u64 value
+** that can be stored in a u32 without loss of data. The value
+** is 0x00000000ffffffff. But because of quirks of some compilers, we
+** have to specify the value in the less intuitive manner shown:
+*/
+#define SQLITE_MAX_U32 ((((u64)1)<<32)-1)
+
+/*
+** The datatype used to store estimates of the number of rows in a
+** table or index.
+*/
+typedef u64 tRowcnt;
+
+/*
+** Estimated quantities used for query planning are stored as 16-bit
+** logarithms. For quantity X, the value stored is 10*log2(X). This
+** gives a possible range of values of approximately 1.0e986 to 1e-986.
+** But the allowed values are "grainy". Not every value is representable.
+** For example, quantities 16 and 17 are both represented by a LogEst
+** of 40. However, since LogEst quantities are suppose to be estimates,
+** not exact values, this imprecision is not a problem.
+**
+** "LogEst" is short for "Logarithmic Estimate".
+**
+** Examples:
+** 1 -> 0 20 -> 43 10000 -> 132
+** 2 -> 10 25 -> 46 25000 -> 146
+** 3 -> 16 100 -> 66 1000000 -> 199
+** 4 -> 20 1000 -> 99 1048576 -> 200
+** 10 -> 33 1024 -> 100 4294967296 -> 320
+**
+** The LogEst can be negative to indicate fractional values.
+** Examples:
+**
+** 0.5 -> -10 0.1 -> -33 0.0625 -> -40
+*/
+typedef INT16_TYPE LogEst;
+#define LOGEST_MIN (-32768)
+#define LOGEST_MAX (32767)
+
+/*
+** Set the SQLITE_PTRSIZE macro to the number of bytes in a pointer
+*/
+#ifndef SQLITE_PTRSIZE
+# if defined(__SIZEOF_POINTER__)
+# define SQLITE_PTRSIZE __SIZEOF_POINTER__
+# elif defined(i386) || defined(__i386__) || defined(_M_IX86) || \
+ defined(_M_ARM) || defined(__arm__) || defined(__x86) || \
+ (defined(__APPLE__) && defined(__ppc__)) || \
+ (defined(__TOS_AIX__) && !defined(__64BIT__))
+# define SQLITE_PTRSIZE 4
+# else
+# define SQLITE_PTRSIZE 8
+# endif
+#endif
+
+/* The uptr type is an unsigned integer large enough to hold a pointer
+*/
+#if defined(HAVE_STDINT_H)
+ typedef uintptr_t uptr;
+#elif SQLITE_PTRSIZE==4
+ typedef u32 uptr;
+#else
+ typedef u64 uptr;
+#endif
+
+/*
+** The SQLITE_WITHIN(P,S,E) macro checks to see if pointer P points to
+** something between S (inclusive) and E (exclusive).
+**
+** In other words, S is a buffer and E is a pointer to the first byte after
+** the end of buffer S. This macro returns true if P points to something
+** contained within the buffer S.
+*/
+#define SQLITE_WITHIN(P,S,E) (((uptr)(P)>=(uptr)(S))&&((uptr)(P)<(uptr)(E)))
+
+/*
+** P is one byte past the end of a large buffer. Return true if a span of bytes
+** between S..E crosses the end of that buffer. In other words, return true
+** if the sub-buffer S..E-1 overflows the buffer whose last byte is P-1.
+**
+** S is the start of the span. E is one byte past the end of end of span.
+**
+** P
+** |-----------------| FALSE
+** |-------|
+** S E
+**
+** P
+** |-----------------|
+** |-------| TRUE
+** S E
+**
+** P
+** |-----------------|
+** |-------| FALSE
+** S E
+*/
+#define SQLITE_OVERFLOW(P,S,E) (((uptr)(S)<(uptr)(P))&&((uptr)(E)>(uptr)(P)))
+
+/*
+** Macros to determine whether the machine is big or little endian,
+** and whether or not that determination is run-time or compile-time.
+**
+** For best performance, an attempt is made to guess at the byte-order
+** using C-preprocessor macros. If that is unsuccessful, or if
+** -DSQLITE_BYTEORDER=0 is set, then byte-order is determined
+** at run-time.
+**
+** If you are building SQLite on some obscure platform for which the
+** following ifdef magic does not work, you can always include either:
+**
+** -DSQLITE_BYTEORDER=1234
+**
+** or
+**
+** -DSQLITE_BYTEORDER=4321
+**
+** to cause the build to work for little-endian or big-endian processors,
+** respectively.
+*/
+#ifndef SQLITE_BYTEORDER /* Replicate changes at tag-20230904a */
+# if defined(__BYTE_ORDER__) && __BYTE_ORDER__==__ORDER_BIG_ENDIAN__
+# define SQLITE_BYTEORDER 4321
+# elif defined(__BYTE_ORDER__) && __BYTE_ORDER__==__ORDER_LITTLE_ENDIAN__
+# define SQLITE_BYTEORDER 1234
+# elif defined(__BIG_ENDIAN__) && __BIG_ENDIAN__==1
+# define SQLITE_BYTEORDER 4321
+# elif defined(i386) || defined(__i386__) || defined(_M_IX86) || \
+ defined(__x86_64) || defined(__x86_64__) || defined(_M_X64) || \
+ defined(_M_AMD64) || defined(_M_ARM) || defined(__x86) || \
+ defined(__ARMEL__) || defined(__AARCH64EL__) || defined(_M_ARM64)
+# define SQLITE_BYTEORDER 1234
+# elif defined(sparc) || defined(__ARMEB__) || defined(__AARCH64EB__)
+# define SQLITE_BYTEORDER 4321
+# else
+# define SQLITE_BYTEORDER 0
+# endif
+#endif
+#if SQLITE_BYTEORDER==4321
+# define SQLITE_BIGENDIAN 1
+# define SQLITE_LITTLEENDIAN 0
+# define SQLITE_UTF16NATIVE SQLITE_UTF16BE
+#elif SQLITE_BYTEORDER==1234
+# define SQLITE_BIGENDIAN 0
+# define SQLITE_LITTLEENDIAN 1
+# define SQLITE_UTF16NATIVE SQLITE_UTF16LE
+#else
+# ifdef SQLITE_AMALGAMATION
+ const int sqlite3one = 1;
+# else
+ extern const int sqlite3one;
+# endif
+# define SQLITE_BIGENDIAN (*(char *)(&sqlite3one)==0)
+# define SQLITE_LITTLEENDIAN (*(char *)(&sqlite3one)==1)
+# define SQLITE_UTF16NATIVE (SQLITE_BIGENDIAN?SQLITE_UTF16BE:SQLITE_UTF16LE)
+#endif
+
+/*
+** Constants for the largest and smallest possible 64-bit signed integers.
+** These macros are designed to work correctly on both 32-bit and 64-bit
+** compilers.
+*/
+#define LARGEST_INT64 (0xffffffff|(((i64)0x7fffffff)<<32))
+#define LARGEST_UINT64 (0xffffffff|(((u64)0xffffffff)<<32))
+#define SMALLEST_INT64 (((i64)-1) - LARGEST_INT64)
+
+/*
+** Macro SMXV(n) return the maximum value that can be held in variable n,
+** assuming n is a signed integer type. UMXV(n) is similar for unsigned
+** integer types.
+*/
+#define SMXV(n) ((((i64)1)<<(sizeof(n)*8-1))-1)
+#define UMXV(n) ((((i64)1)<<(sizeof(n)*8))-1)
+
+/*
+** Round up a number to the next larger multiple of 8. This is used
+** to force 8-byte alignment on 64-bit architectures.
+**
+** ROUND8() always does the rounding, for any argument.
+**
+** ROUND8P() assumes that the argument is already an integer number of
+** pointers in size, and so it is a no-op on systems where the pointer
+** size is 8.
+*/
+#define ROUND8(x) (((x)+7)&~7)
+#if SQLITE_PTRSIZE==8
+# define ROUND8P(x) (x)
+#else
+# define ROUND8P(x) (((x)+7)&~7)
+#endif
+
+/*
+** Round down to the nearest multiple of 8
+*/
+#define ROUNDDOWN8(x) ((x)&~7)
+
+/*
+** Assert that the pointer X is aligned to an 8-byte boundary. This
+** macro is used only within assert() to verify that the code gets
+** all alignment restrictions correct.
+**
+** Except, if SQLITE_4_BYTE_ALIGNED_MALLOC is defined, then the
+** underlying malloc() implementation might return us 4-byte aligned
+** pointers. In that case, only verify 4-byte alignment.
+*/
+#ifdef SQLITE_4_BYTE_ALIGNED_MALLOC
+# define EIGHT_BYTE_ALIGNMENT(X) ((((uptr)(X) - (uptr)0)&3)==0)
+#else
+# define EIGHT_BYTE_ALIGNMENT(X) ((((uptr)(X) - (uptr)0)&7)==0)
+#endif
+
+/*
+** Disable MMAP on platforms where it is known to not work
+*/
+#if defined(__OpenBSD__) || defined(__QNXNTO__)
+# undef SQLITE_MAX_MMAP_SIZE
+# define SQLITE_MAX_MMAP_SIZE 0
+#endif
+
+/*
+** Default maximum size of memory used by memory-mapped I/O in the VFS
+*/
+#ifdef __APPLE__
+# include
+#endif
+#ifndef SQLITE_MAX_MMAP_SIZE
+# if defined(__linux__) \
+ || defined(_WIN32) \
+ || (defined(__APPLE__) && defined(__MACH__)) \
+ || defined(__sun) \
+ || defined(__FreeBSD__) \
+ || defined(__DragonFly__)
+# define SQLITE_MAX_MMAP_SIZE 0x7fff0000 /* 2147418112 */
+# else
+# define SQLITE_MAX_MMAP_SIZE 0
+# endif
+#endif
+
+/*
+** The default MMAP_SIZE is zero on all platforms. Or, even if a larger
+** default MMAP_SIZE is specified at compile-time, make sure that it does
+** not exceed the maximum mmap size.
+*/
+#ifndef SQLITE_DEFAULT_MMAP_SIZE
+# define SQLITE_DEFAULT_MMAP_SIZE 0
+#endif
+#if SQLITE_DEFAULT_MMAP_SIZE>SQLITE_MAX_MMAP_SIZE
+# undef SQLITE_DEFAULT_MMAP_SIZE
+# define SQLITE_DEFAULT_MMAP_SIZE SQLITE_MAX_MMAP_SIZE
+#endif
+
+/*
+** TREETRACE_ENABLED will be either 1 or 0 depending on whether or not
+** the Abstract Syntax Tree tracing logic is turned on.
+*/
+#if !defined(SQLITE_AMALGAMATION)
+SQLITE_PRIVATE u32 sqlite3TreeTrace;
+#endif
+#if defined(SQLITE_DEBUG) \
+ && (defined(SQLITE_TEST) || defined(SQLITE_ENABLE_SELECTTRACE) \
+ || defined(SQLITE_ENABLE_TREETRACE))
+# define TREETRACE_ENABLED 1
+# define TREETRACE(K,P,S,X) \
+ if(sqlite3TreeTrace&(K)) \
+ sqlite3DebugPrintf("%u/%d/%p: ",(S)->selId,(P)->addrExplain,(S)),\
+ sqlite3DebugPrintf X
+#else
+# define TREETRACE(K,P,S,X)
+# define TREETRACE_ENABLED 0
+#endif
+
+/* TREETRACE flag meanings:
+**
+** 0x00000001 Beginning and end of SELECT processing
+** 0x00000002 WHERE clause processing
+** 0x00000004 Query flattener
+** 0x00000008 Result-set wildcard expansion
+** 0x00000010 Query name resolution
+** 0x00000020 Aggregate analysis
+** 0x00000040 Window functions
+** 0x00000080 Generated column names
+** 0x00000100 Move HAVING terms into WHERE
+** 0x00000200 Count-of-view optimization
+** 0x00000400 Compound SELECT processing
+** 0x00000800 Drop superfluous ORDER BY
+** 0x00001000 LEFT JOIN simplifies to JOIN
+** 0x00002000 Constant propagation
+** 0x00004000 Push-down optimization
+** 0x00008000 After all FROM-clause analysis
+** 0x00010000 Beginning of DELETE/INSERT/UPDATE processing
+** 0x00020000 Transform DISTINCT into GROUP BY
+** 0x00040000 SELECT tree dump after all code has been generated
+** 0x00080000 NOT NULL strength reduction
+*/
+
+/*
+** Macros for "wheretrace"
+*/
+SQLITE_PRIVATE u32 sqlite3WhereTrace;
+#if defined(SQLITE_DEBUG) \
+ && (defined(SQLITE_TEST) || defined(SQLITE_ENABLE_WHERETRACE))
+# define WHERETRACE(K,X) if(sqlite3WhereTrace&(K)) sqlite3DebugPrintf X
+# define WHERETRACE_ENABLED 1
+#else
+# define WHERETRACE(K,X)
+#endif
+
+/*
+** Bits for the sqlite3WhereTrace mask:
+**
+** (---any--) Top-level block structure
+** 0x-------F High-level debug messages
+** 0x----FFF- More detail
+** 0xFFFF---- Low-level debug messages
+**
+** 0x00000001 Code generation
+** 0x00000002 Solver (Use 0x40000 for less detail)
+** 0x00000004 Solver costs
+** 0x00000008 WhereLoop inserts
+**
+** 0x00000010 Display sqlite3_index_info xBestIndex calls
+** 0x00000020 Range an equality scan metrics
+** 0x00000040 IN operator decisions
+** 0x00000080 WhereLoop cost adjustments
+** 0x00000100
+** 0x00000200 Covering index decisions
+** 0x00000400 OR optimization
+** 0x00000800 Index scanner
+** 0x00001000 More details associated with code generation
+** 0x00002000
+** 0x00004000 Show all WHERE terms at key points
+** 0x00008000 Show the full SELECT statement at key places
+**
+** 0x00010000 Show more detail when printing WHERE terms
+** 0x00020000 Show WHERE terms returned from whereScanNext()
+** 0x00040000 Solver overview messages
+** 0x00080000 Star-query heuristic
+*/
+
+
+/*
+** An instance of the following structure is used to store the busy-handler
+** callback for a given sqlite handle.
+**
+** The sqlite.busyHandler member of the sqlite struct contains the busy
+** callback for the database handle. Each pager opened via the sqlite
+** handle is passed a pointer to sqlite.busyHandler. The busy-handler
+** callback is currently invoked only from within pager.c.
+*/
+typedef struct BusyHandler BusyHandler;
+struct BusyHandler {
+ int (*xBusyHandler)(void *,int); /* The busy callback */
+ void *pBusyArg; /* First arg to busy callback */
+ int nBusy; /* Incremented with each busy call */
+};
+
+/*
+** Name of table that holds the database schema.
+**
+** The PREFERRED names are used wherever possible. But LEGACY is also
+** used for backwards compatibility.
+**
+** 1. Queries can use either the PREFERRED or the LEGACY names
+** 2. The sqlite3_set_authorizer() callback uses the LEGACY name
+** 3. The PRAGMA table_list statement uses the PREFERRED name
+**
+** The LEGACY names are stored in the internal symbol hash table
+** in support of (2). Names are translated using sqlite3PreferredTableName()
+** for (3). The sqlite3FindTable() function takes care of translating
+** names for (1).
+**
+** Note that "sqlite_temp_schema" can also be called "temp.sqlite_schema".
+*/
+#define LEGACY_SCHEMA_TABLE "sqlite_master"
+#define LEGACY_TEMP_SCHEMA_TABLE "sqlite_temp_master"
+#define PREFERRED_SCHEMA_TABLE "sqlite_schema"
+#define PREFERRED_TEMP_SCHEMA_TABLE "sqlite_temp_schema"
+
+
+/*
+** The root-page of the schema table.
+*/
+#define SCHEMA_ROOT 1
+
+/*
+** The name of the schema table. The name is different for TEMP.
+*/
+#define SCHEMA_TABLE(x) \
+ ((!OMIT_TEMPDB)&&(x==1)?LEGACY_TEMP_SCHEMA_TABLE:LEGACY_SCHEMA_TABLE)
+
+/*
+** A convenience macro that returns the number of elements in
+** an array.
+*/
+#define ArraySize(X) ((int)(sizeof(X)/sizeof(X[0])))
+
+/*
+** Determine if the argument is a power of two
+*/
+#define IsPowerOfTwo(X) (((X)&((X)-1))==0)
+
+/*
+** The following value as a destructor means to use sqlite3DbFree().
+** The sqlite3DbFree() routine requires two parameters instead of the
+** one parameter that destructors normally want. So we have to introduce
+** this magic value that the code knows to handle differently. Any
+** pointer will work here as long as it is distinct from SQLITE_STATIC
+** and SQLITE_TRANSIENT.
+*/
+#define SQLITE_DYNAMIC ((sqlite3_destructor_type)sqlite3OomClear)
+
+/*
+** When SQLITE_OMIT_WSD is defined, it means that the target platform does
+** not support Writable Static Data (WSD) such as global and static variables.
+** All variables must either be on the stack or dynamically allocated from
+** the heap. When WSD is unsupported, the variable declarations scattered
+** throughout the SQLite code must become constants instead. The SQLITE_WSD
+** macro is used for this purpose. And instead of referencing the variable
+** directly, we use its constant as a key to lookup the run-time allocated
+** buffer that holds real variable. The constant is also the initializer
+** for the run-time allocated buffer.
+**
+** In the usual case where WSD is supported, the SQLITE_WSD and GLOBAL
+** macros become no-ops and have zero performance impact.
+*/
+#ifdef SQLITE_OMIT_WSD
+ #define SQLITE_WSD const
+ #define GLOBAL(t,v) (*(t*)sqlite3_wsd_find((void*)&(v), sizeof(v)))
+ #define sqlite3GlobalConfig GLOBAL(struct Sqlite3Config, sqlite3Config)
+SQLITE_API int sqlite3_wsd_init(int N, int J);
+SQLITE_API void *sqlite3_wsd_find(void *K, int L);
+#else
+ #define SQLITE_WSD
+ #define GLOBAL(t,v) v
+ #define sqlite3GlobalConfig sqlite3Config
+#endif
+
+/*
+** The following macros are used to suppress compiler warnings and to
+** make it clear to human readers when a function parameter is deliberately
+** left unused within the body of a function. This usually happens when
+** a function is called via a function pointer. For example the
+** implementation of an SQL aggregate step callback may not use the
+** parameter indicating the number of arguments passed to the aggregate,
+** if it knows that this is enforced elsewhere.
+**
+** When a function parameter is not used at all within the body of a function,
+** it is generally named "NotUsed" or "NotUsed2" to make things even clearer.
+** However, these macros may also be used to suppress warnings related to
+** parameters that may or may not be used depending on compilation options.
+** For example those parameters only used in assert() statements. In these
+** cases the parameters are named as per the usual conventions.
+*/
+#define UNUSED_PARAMETER(x) (void)(x)
+#define UNUSED_PARAMETER2(x,y) UNUSED_PARAMETER(x),UNUSED_PARAMETER(y)
+
+/*
+** Forward references to structures
+*/
+typedef struct AggInfo AggInfo;
+typedef struct AuthContext AuthContext;
+typedef struct AutoincInfo AutoincInfo;
+typedef struct Bitvec Bitvec;
+typedef struct CollSeq CollSeq;
+typedef struct Column Column;
+typedef struct Cte Cte;
+typedef struct CteUse CteUse;
+typedef struct Db Db;
+typedef struct DbClientData DbClientData;
+typedef struct DbFixer DbFixer;
+typedef struct Schema Schema;
+typedef struct Expr Expr;
+typedef struct ExprList ExprList;
+typedef struct FKey FKey;
+typedef struct FpDecode FpDecode;
+typedef struct FuncDestructor FuncDestructor;
+typedef struct FuncDef FuncDef;
+typedef struct FuncDefHash FuncDefHash;
+typedef struct IdList IdList;
+typedef struct Index Index;
+typedef struct IndexedExpr IndexedExpr;
+typedef struct IndexSample IndexSample;
+typedef struct KeyClass KeyClass;
+typedef struct KeyInfo KeyInfo;
+typedef struct Lookaside Lookaside;
+typedef struct LookasideSlot LookasideSlot;
+typedef struct Module Module;
+typedef struct NameContext NameContext;
+typedef struct OnOrUsing OnOrUsing;
+typedef struct Parse Parse;
+typedef struct ParseCleanup ParseCleanup;
+typedef struct PreUpdate PreUpdate;
+typedef struct PrintfArguments PrintfArguments;
+typedef struct RCStr RCStr;
+typedef struct RenameToken RenameToken;
+typedef struct Returning Returning;
+typedef struct RowSet RowSet;
+typedef struct Savepoint Savepoint;
+typedef struct Select Select;
+typedef struct SQLiteThread SQLiteThread;
+typedef struct SelectDest SelectDest;
+typedef struct Subquery Subquery;
+typedef struct SrcItem SrcItem;
+typedef struct SrcList SrcList;
+typedef struct sqlite3_str StrAccum; /* Internal alias for sqlite3_str */
+typedef struct Table Table;
+typedef struct TableLock TableLock;
+typedef struct Token Token;
+typedef struct TreeView TreeView;
+typedef struct Trigger Trigger;
+typedef struct TriggerPrg TriggerPrg;
+typedef struct TriggerStep TriggerStep;
+typedef struct UnpackedRecord UnpackedRecord;
+typedef struct Upsert Upsert;
+typedef struct VTable VTable;
+typedef struct VtabCtx VtabCtx;
+typedef struct Walker Walker;
+typedef struct WhereInfo WhereInfo;
+typedef struct Window Window;
+typedef struct With With;
+
+
+/*
+** The bitmask datatype defined below is used for various optimizations.
+**
+** Changing this from a 64-bit to a 32-bit type limits the number of
+** tables in a join to 32 instead of 64. But it also reduces the size
+** of the library by 738 bytes on ix86.
+*/
+#ifdef SQLITE_BITMASK_TYPE
+ typedef SQLITE_BITMASK_TYPE Bitmask;
+#else
+ typedef u64 Bitmask;
+#endif
+
+/*
+** The number of bits in a Bitmask. "BMS" means "BitMask Size".
+*/
+#define BMS ((int)(sizeof(Bitmask)*8))
+
+/*
+** A bit in a Bitmask
+*/
+#define MASKBIT(n) (((Bitmask)1)<<(n))
+#define MASKBIT64(n) (((u64)1)<<(n))
+#define MASKBIT32(n) (((unsigned int)1)<<(n))
+#define SMASKBIT32(n) ((n)<=31?((unsigned int)1)<<(n):0)
+#define ALLBITS ((Bitmask)-1)
+#define TOPBIT (((Bitmask)1)<<(BMS-1))
+
+/* A VList object records a mapping between parameters/variables/wildcards
+** in the SQL statement (such as $abc, @pqr, or :xyz) and the integer
+** variable number associated with that parameter. See the format description
+** on the sqlite3VListAdd() routine for more information. A VList is really
+** just an array of integers.
+*/
+typedef int VList;
+
+/*
+** Defer sourcing vdbe.h and btree.h until after the "u8" and
+** "BusyHandler" typedefs. vdbe.h also requires a few of the opaque
+** pointer types (i.e. FuncDef) defined above.
+*/
+/************** Include os.h in the middle of sqliteInt.h ********************/
+/************** Begin file os.h **********************************************/
+/*
+** 2001 September 16
+**
+** The author disclaims copyright to this source code. In place of
+** a legal notice, here is a blessing:
+**
+** May you do good and not evil.
+** May you find forgiveness for yourself and forgive others.
+** May you share freely, never taking more than you give.
+**
+******************************************************************************
+**
+** This header file (together with is companion C source-code file
+** "os.c") attempt to abstract the underlying operating system so that
+** the SQLite library will work on both POSIX and windows systems.
+**
+** This header file is #include-ed by sqliteInt.h and thus ends up
+** being included by every source file.
+*/
+#ifndef _SQLITE_OS_H_
+#define _SQLITE_OS_H_
+
+/*
+** Attempt to automatically detect the operating system and setup the
+** necessary pre-processor macros for it.
+*/
+/************** Include os_setup.h in the middle of os.h *********************/
+/************** Begin file os_setup.h ****************************************/
+/*
+** 2013 November 25
+**
+** The author disclaims copyright to this source code. In place of
+** a legal notice, here is a blessing:
+**
+** May you do good and not evil.
+** May you find forgiveness for yourself and forgive others.
+** May you share freely, never taking more than you give.
+**
+******************************************************************************
+**
+** This file contains pre-processor directives related to operating system
+** detection and/or setup.
+*/
+#ifndef SQLITE_OS_SETUP_H
+#define SQLITE_OS_SETUP_H
+
+/*
+** Figure out if we are dealing with Unix, Windows, or some other operating
+** system.
+**
+** After the following block of preprocess macros, all of
+**
+** SQLITE_OS_KV
+** SQLITE_OS_OTHER
+** SQLITE_OS_UNIX
+** SQLITE_OS_WIN
+**
+** will defined to either 1 or 0. One of them will be 1. The others will be 0.
+** If none of the macros are initially defined, then select either
+** SQLITE_OS_UNIX or SQLITE_OS_WIN depending on the target platform.
+**
+** If SQLITE_OS_OTHER=1 is specified at compile-time, then the application
+** must provide its own VFS implementation together with sqlite3_os_init()
+** and sqlite3_os_end() routines.
+*/
+#if !defined(SQLITE_OS_KV) && !defined(SQLITE_OS_OTHER) && \
+ !defined(SQLITE_OS_UNIX) && !defined(SQLITE_OS_WIN)
+# if defined(_WIN32) || defined(WIN32) || defined(__CYGWIN__) || \
+ defined(__MINGW32__) || defined(__BORLANDC__)
+# define SQLITE_OS_WIN 1
+# define SQLITE_OS_UNIX 0
+# else
+# define SQLITE_OS_WIN 0
+# define SQLITE_OS_UNIX 1
+# endif
+#endif
+#if SQLITE_OS_OTHER+1>1
+# undef SQLITE_OS_KV
+# define SQLITE_OS_KV 0
+# undef SQLITE_OS_UNIX
+# define SQLITE_OS_UNIX 0
+# undef SQLITE_OS_WIN
+# define SQLITE_OS_WIN 0
+#endif
+#if SQLITE_OS_KV+1>1
+# undef SQLITE_OS_OTHER
+# define SQLITE_OS_OTHER 0
+# undef SQLITE_OS_UNIX
+# define SQLITE_OS_UNIX 0
+# undef SQLITE_OS_WIN
+# define SQLITE_OS_WIN 0
+# define SQLITE_OMIT_LOAD_EXTENSION 1
+# define SQLITE_OMIT_WAL 1
+# define SQLITE_OMIT_DEPRECATED 1
+# undef SQLITE_TEMP_STORE
+# define SQLITE_TEMP_STORE 3 /* Always use memory for temporary storage */
+# define SQLITE_DQS 0
+# define SQLITE_OMIT_SHARED_CACHE 1
+# define SQLITE_OMIT_AUTOINIT 1
+#endif
+#if SQLITE_OS_UNIX+1>1
+# undef SQLITE_OS_KV
+# define SQLITE_OS_KV 0
+# undef SQLITE_OS_OTHER
+# define SQLITE_OS_OTHER 0
+# undef SQLITE_OS_WIN
+# define SQLITE_OS_WIN 0
+#endif
+#if SQLITE_OS_WIN+1>1
+# undef SQLITE_OS_KV
+# define SQLITE_OS_KV 0
+# undef SQLITE_OS_OTHER
+# define SQLITE_OS_OTHER 0
+# undef SQLITE_OS_UNIX
+# define SQLITE_OS_UNIX 0
+#endif
+
+
+#endif /* SQLITE_OS_SETUP_H */
+
+/************** End of os_setup.h ********************************************/
+/************** Continuing where we left off in os.h *************************/
+
+/* If the SET_FULLSYNC macro is not defined above, then make it
+** a no-op
+*/
+#ifndef SET_FULLSYNC
+# define SET_FULLSYNC(x,y)
+#endif
+
+/* Maximum pathname length. Note: FILENAME_MAX defined by stdio.h
+*/
+#ifndef SQLITE_MAX_PATHLEN
+# define SQLITE_MAX_PATHLEN FILENAME_MAX
+#endif
+
+/* Maximum number of symlinks that will be resolved while trying to
+** expand a filename in xFullPathname() in the VFS.
+*/
+#ifndef SQLITE_MAX_SYMLINK
+# define SQLITE_MAX_SYMLINK 200
+#endif
+
+/*
+** The default size of a disk sector
+*/
+#ifndef SQLITE_DEFAULT_SECTOR_SIZE
+# define SQLITE_DEFAULT_SECTOR_SIZE 4096
+#endif
+
+/*
+** Temporary files are named starting with this prefix followed by 16 random
+** alphanumeric characters, and no file extension. They are stored in the
+** OS's standard temporary file directory, and are deleted prior to exit.
+** If sqlite is being embedded in another program, you may wish to change the
+** prefix to reflect your program's name, so that if your program exits
+** prematurely, old temporary files can be easily identified. This can be done
+** using -DSQLITE_TEMP_FILE_PREFIX=myprefix_ on the compiler command line.
+**
+** 2006-10-31: The default prefix used to be "sqlite_". But then
+** Mcafee started using SQLite in their anti-virus product and it
+** started putting files with the "sqlite" name in the c:/temp folder.
+** This annoyed many windows users. Those users would then do a
+** Google search for "sqlite", find the telephone numbers of the
+** developers and call to wake them up at night and complain.
+** For this reason, the default name prefix is changed to be "sqlite"
+** spelled backwards. So the temp files are still identified, but
+** anybody smart enough to figure out the code is also likely smart
+** enough to know that calling the developer will not help get rid
+** of the file.
+*/
+#ifndef SQLITE_TEMP_FILE_PREFIX
+# define SQLITE_TEMP_FILE_PREFIX "etilqs_"
+#endif
+
+/*
+** The following values may be passed as the second argument to
+** sqlite3OsLock(). The various locks exhibit the following semantics:
+**
+** SHARED: Any number of processes may hold a SHARED lock simultaneously.
+** RESERVED: A single process may hold a RESERVED lock on a file at
+** any time. Other processes may hold and obtain new SHARED locks.
+** PENDING: A single process may hold a PENDING lock on a file at
+** any one time. Existing SHARED locks may persist, but no new
+** SHARED locks may be obtained by other processes.
+** EXCLUSIVE: An EXCLUSIVE lock precludes all other locks.
+**
+** PENDING_LOCK may not be passed directly to sqlite3OsLock(). Instead, a
+** process that requests an EXCLUSIVE lock may actually obtain a PENDING
+** lock. This can be upgraded to an EXCLUSIVE lock by a subsequent call to
+** sqlite3OsLock().
+*/
+#define NO_LOCK 0
+#define SHARED_LOCK 1
+#define RESERVED_LOCK 2
+#define PENDING_LOCK 3
+#define EXCLUSIVE_LOCK 4
+
+/*
+** File Locking Notes: (Mostly about windows but also some info for Unix)
+**
+** We cannot use LockFileEx() or UnlockFileEx() on Win95/98/ME because
+** those functions are not available. So we use only LockFile() and
+** UnlockFile().
+**
+** LockFile() prevents not just writing but also reading by other processes.
+** A SHARED_LOCK is obtained by locking a single randomly-chosen
+** byte out of a specific range of bytes. The lock byte is obtained at
+** random so two separate readers can probably access the file at the
+** same time, unless they are unlucky and choose the same lock byte.
+** An EXCLUSIVE_LOCK is obtained by locking all bytes in the range.
+** There can only be one writer. A RESERVED_LOCK is obtained by locking
+** a single byte of the file that is designated as the reserved lock byte.
+** A PENDING_LOCK is obtained by locking a designated byte different from
+** the RESERVED_LOCK byte.
+**
+** On WinNT/2K/XP systems, LockFileEx() and UnlockFileEx() are available,
+** which means we can use reader/writer locks. When reader/writer locks
+** are used, the lock is placed on the same range of bytes that is used
+** for probabilistic locking in Win95/98/ME. Hence, the locking scheme
+** will support two or more Win95 readers or two or more WinNT readers.
+** But a single Win95 reader will lock out all WinNT readers and a single
+** WinNT reader will lock out all other Win95 readers.
+**
+** The following #defines specify the range of bytes used for locking.
+** SHARED_SIZE is the number of bytes available in the pool from which
+** a random byte is selected for a shared lock. The pool of bytes for
+** shared locks begins at SHARED_FIRST.
+**
+** The same locking strategy and
+** byte ranges are used for Unix. This leaves open the possibility of having
+** clients on win95, winNT, and unix all talking to the same shared file
+** and all locking correctly. To do so would require that samba (or whatever
+** tool is being used for file sharing) implements locks correctly between
+** windows and unix. I'm guessing that isn't likely to happen, but by
+** using the same locking range we are at least open to the possibility.
+**
+** Locking in windows is manditory. For this reason, we cannot store
+** actual data in the bytes used for locking. The pager never allocates
+** the pages involved in locking therefore. SHARED_SIZE is selected so
+** that all locks will fit on a single page even at the minimum page size.
+** PENDING_BYTE defines the beginning of the locks. By default PENDING_BYTE
+** is set high so that we don't have to allocate an unused page except
+** for very large databases. But one should test the page skipping logic
+** by setting PENDING_BYTE low and running the entire regression suite.
+**
+** Changing the value of PENDING_BYTE results in a subtly incompatible
+** file format. Depending on how it is changed, you might not notice
+** the incompatibility right away, even running a full regression test.
+** The default location of PENDING_BYTE is the first byte past the
+** 1GB boundary.
+**
+*/
+#ifdef SQLITE_OMIT_WSD
+# define PENDING_BYTE (0x40000000)
+#else
+# define PENDING_BYTE sqlite3PendingByte
+#endif
+#define RESERVED_BYTE (PENDING_BYTE+1)
+#define SHARED_FIRST (PENDING_BYTE+2)
+#define SHARED_SIZE 510
+
+/*
+** Wrapper around OS specific sqlite3_os_init() function.
+*/
+SQLITE_PRIVATE int sqlite3OsInit(void);
+
+/*
+** Functions for accessing sqlite3_file methods
+*/
+SQLITE_PRIVATE void sqlite3OsClose(sqlite3_file*);
+SQLITE_PRIVATE int sqlite3OsRead(sqlite3_file*, void*, int amt, i64 offset);
+SQLITE_PRIVATE int sqlite3OsWrite(sqlite3_file*, const void*, int amt, i64 offset);
+SQLITE_PRIVATE int sqlite3OsTruncate(sqlite3_file*, i64 size);
+SQLITE_PRIVATE int sqlite3OsSync(sqlite3_file*, int);
+SQLITE_PRIVATE int sqlite3OsFileSize(sqlite3_file*, i64 *pSize);
+SQLITE_PRIVATE int sqlite3OsLock(sqlite3_file*, int);
+SQLITE_PRIVATE int sqlite3OsUnlock(sqlite3_file*, int);
+SQLITE_PRIVATE int sqlite3OsCheckReservedLock(sqlite3_file *id, int *pResOut);
+SQLITE_PRIVATE int sqlite3OsFileControl(sqlite3_file*,int,void*);
+SQLITE_PRIVATE void sqlite3OsFileControlHint(sqlite3_file*,int,void*);
+#define SQLITE_FCNTL_DB_UNCHANGED 0xca093fa0
+SQLITE_PRIVATE int sqlite3OsSectorSize(sqlite3_file *id);
+SQLITE_PRIVATE int sqlite3OsDeviceCharacteristics(sqlite3_file *id);
+#ifndef SQLITE_OMIT_WAL
+SQLITE_PRIVATE int sqlite3OsShmMap(sqlite3_file *,int,int,int,void volatile **);
+SQLITE_PRIVATE int sqlite3OsShmLock(sqlite3_file *id, int, int, int);
+SQLITE_PRIVATE void sqlite3OsShmBarrier(sqlite3_file *id);
+SQLITE_PRIVATE int sqlite3OsShmUnmap(sqlite3_file *id, int);
+#endif /* SQLITE_OMIT_WAL */
+SQLITE_PRIVATE int sqlite3OsFetch(sqlite3_file *id, i64, int, void **);
+SQLITE_PRIVATE int sqlite3OsUnfetch(sqlite3_file *, i64, void *);
+
+
+/*
+** Functions for accessing sqlite3_vfs methods
+*/
+SQLITE_PRIVATE int sqlite3OsOpen(sqlite3_vfs *, const char *, sqlite3_file*, int, int *);
+SQLITE_PRIVATE int sqlite3OsDelete(sqlite3_vfs *, const char *, int);
+SQLITE_PRIVATE int sqlite3OsAccess(sqlite3_vfs *, const char *, int, int *pResOut);
+SQLITE_PRIVATE int sqlite3OsFullPathname(sqlite3_vfs *, const char *, int, char *);
+#ifndef SQLITE_OMIT_LOAD_EXTENSION
+SQLITE_PRIVATE void *sqlite3OsDlOpen(sqlite3_vfs *, const char *);
+SQLITE_PRIVATE void sqlite3OsDlError(sqlite3_vfs *, int, char *);
+SQLITE_PRIVATE void (*sqlite3OsDlSym(sqlite3_vfs *, void *, const char *))(void);
+SQLITE_PRIVATE void sqlite3OsDlClose(sqlite3_vfs *, void *);
+#endif /* SQLITE_OMIT_LOAD_EXTENSION */
+SQLITE_PRIVATE int sqlite3OsRandomness(sqlite3_vfs *, int, char *);
+SQLITE_PRIVATE int sqlite3OsSleep(sqlite3_vfs *, int);
+SQLITE_PRIVATE int sqlite3OsGetLastError(sqlite3_vfs*);
+SQLITE_PRIVATE int sqlite3OsCurrentTimeInt64(sqlite3_vfs *, sqlite3_int64*);
+
+/*
+** Convenience functions for opening and closing files using
+** sqlite3_malloc() to obtain space for the file-handle structure.
+*/
+SQLITE_PRIVATE int sqlite3OsOpenMalloc(sqlite3_vfs *, const char *, sqlite3_file **, int,int*);
+SQLITE_PRIVATE void sqlite3OsCloseFree(sqlite3_file *);
+
+#endif /* _SQLITE_OS_H_ */
+
+/************** End of os.h **************************************************/
+/************** Continuing where we left off in sqliteInt.h ******************/
+/************** Include pager.h in the middle of sqliteInt.h *****************/
+/************** Begin file pager.h *******************************************/
+/*
+** 2001 September 15
+**
+** The author disclaims copyright to this source code. In place of
+** a legal notice, here is a blessing:
+**
+** May you do good and not evil.
+** May you find forgiveness for yourself and forgive others.
+** May you share freely, never taking more than you give.
+**
+*************************************************************************
+** This header file defines the interface that the sqlite page cache
+** subsystem. The page cache subsystem reads and writes a file a page
+** at a time and provides a journal for rollback.
+*/
+
+#ifndef SQLITE_PAGER_H
+#define SQLITE_PAGER_H
+
+/*
+** Default maximum size for persistent journal files. A negative
+** value means no limit. This value may be overridden using the
+** sqlite3PagerJournalSizeLimit() API. See also "PRAGMA journal_size_limit".
+*/
+#ifndef SQLITE_DEFAULT_JOURNAL_SIZE_LIMIT
+ #define SQLITE_DEFAULT_JOURNAL_SIZE_LIMIT -1
+#endif
+
+/*
+** The type used to represent a page number. The first page in a file
+** is called page 1. 0 is used to represent "not a page".
+*/
+typedef u32 Pgno;
+
+/*
+** Each open file is managed by a separate instance of the "Pager" structure.
+*/
+typedef struct Pager Pager;
+
+/*
+** Handle type for pages.
+*/
+typedef struct PgHdr DbPage;
+
+/*
+** Page number PAGER_SJ_PGNO is never used in an SQLite database (it is
+** reserved for working around a windows/posix incompatibility). It is
+** used in the journal to signify that the remainder of the journal file
+** is devoted to storing a super-journal name - there are no more pages to
+** roll back. See comments for function writeSuperJournal() in pager.c
+** for details.
+*/
+#define PAGER_SJ_PGNO_COMPUTED(x) ((Pgno)((PENDING_BYTE/((x)->pageSize))+1))
+#define PAGER_SJ_PGNO(x) ((x)->lckPgno)
+
+/*
+** Allowed values for the flags parameter to sqlite3PagerOpen().
+**
+** NOTE: These values must match the corresponding BTREE_ values in btree.h.
+*/
+#define PAGER_OMIT_JOURNAL 0x0001 /* Do not use a rollback journal */
+#define PAGER_MEMORY 0x0002 /* In-memory database */
+
+/*
+** Valid values for the second argument to sqlite3PagerLockingMode().
+*/
+#define PAGER_LOCKINGMODE_QUERY -1
+#define PAGER_LOCKINGMODE_NORMAL 0
+#define PAGER_LOCKINGMODE_EXCLUSIVE 1
+
+/*
+** Numeric constants that encode the journalmode.
+**
+** The numeric values encoded here (other than PAGER_JOURNALMODE_QUERY)
+** are exposed in the API via the "PRAGMA journal_mode" command and
+** therefore cannot be changed without a compatibility break.
+*/
+#define PAGER_JOURNALMODE_QUERY (-1) /* Query the value of journalmode */
+#define PAGER_JOURNALMODE_DELETE 0 /* Commit by deleting journal file */
+#define PAGER_JOURNALMODE_PERSIST 1 /* Commit by zeroing journal header */
+#define PAGER_JOURNALMODE_OFF 2 /* Journal omitted. */
+#define PAGER_JOURNALMODE_TRUNCATE 3 /* Commit by truncating journal */
+#define PAGER_JOURNALMODE_MEMORY 4 /* In-memory journal file */
+#define PAGER_JOURNALMODE_WAL 5 /* Use write-ahead logging */
+
+#define isWalMode(x) ((x)==PAGER_JOURNALMODE_WAL)
+
+/*
+** The argument to this macro is a file descriptor (type sqlite3_file*).
+** Return 0 if it is not open, or non-zero (but not 1) if it is.
+**
+** This is so that expressions can be written as:
+**
+** if( isOpen(pPager->jfd) ){ ...
+**
+** instead of
+**
+** if( pPager->jfd->pMethods ){ ...
+*/
+#define isOpen(pFd) ((pFd)->pMethods!=0)
+
+/*
+** Flags that make up the mask passed to sqlite3PagerGet().
+*/
+#define PAGER_GET_NOCONTENT 0x01 /* Do not load data from disk */
+#define PAGER_GET_READONLY 0x02 /* Read-only page is acceptable */
+
+/*
+** Flags for sqlite3PagerSetFlags()
+**
+** Value constraints (enforced via assert()):
+** PAGER_FULLFSYNC == SQLITE_FullFSync
+** PAGER_CKPT_FULLFSYNC == SQLITE_CkptFullFSync
+** PAGER_CACHE_SPILL == SQLITE_CacheSpill
+*/
+#define PAGER_SYNCHRONOUS_OFF 0x01 /* PRAGMA synchronous=OFF */
+#define PAGER_SYNCHRONOUS_NORMAL 0x02 /* PRAGMA synchronous=NORMAL */
+#define PAGER_SYNCHRONOUS_FULL 0x03 /* PRAGMA synchronous=FULL */
+#define PAGER_SYNCHRONOUS_EXTRA 0x04 /* PRAGMA synchronous=EXTRA */
+#define PAGER_SYNCHRONOUS_MASK 0x07 /* Mask for four values above */
+#define PAGER_FULLFSYNC 0x08 /* PRAGMA fullfsync=ON */
+#define PAGER_CKPT_FULLFSYNC 0x10 /* PRAGMA checkpoint_fullfsync=ON */
+#define PAGER_CACHESPILL 0x20 /* PRAGMA cache_spill=ON */
+#define PAGER_FLAGS_MASK 0x38 /* All above except SYNCHRONOUS */
+
+/*
+** The remainder of this file contains the declarations of the functions
+** that make up the Pager sub-system API. See source code comments for
+** a detailed description of each routine.
+*/
+
+/* Open and close a Pager connection. */
+SQLITE_PRIVATE int sqlite3PagerOpen(
+ sqlite3_vfs*,
+ Pager **ppPager,
+ const char*,
+ int,
+ int,
+ int,
+ void(*)(DbPage*)
+);
+SQLITE_PRIVATE int sqlite3PagerClose(Pager *pPager, sqlite3*);
+SQLITE_PRIVATE int sqlite3PagerReadFileheader(Pager*, int, unsigned char*);
+
+/* Functions used to configure a Pager object. */
+SQLITE_PRIVATE void sqlite3PagerSetBusyHandler(Pager*, int(*)(void *), void *);
+SQLITE_PRIVATE int sqlite3PagerSetPagesize(Pager*, u32*, int);
+SQLITE_PRIVATE Pgno sqlite3PagerMaxPageCount(Pager*, Pgno);
+SQLITE_PRIVATE void sqlite3PagerSetCachesize(Pager*, int);
+SQLITE_PRIVATE int sqlite3PagerSetSpillsize(Pager*, int);
+SQLITE_PRIVATE void sqlite3PagerSetMmapLimit(Pager *, sqlite3_int64);
+SQLITE_PRIVATE void sqlite3PagerShrink(Pager*);
+SQLITE_PRIVATE void sqlite3PagerSetFlags(Pager*,unsigned);
+SQLITE_PRIVATE int sqlite3PagerLockingMode(Pager *, int);
+SQLITE_PRIVATE int sqlite3PagerSetJournalMode(Pager *, int);
+SQLITE_PRIVATE int sqlite3PagerGetJournalMode(Pager*);
+SQLITE_PRIVATE int sqlite3PagerOkToChangeJournalMode(Pager*);
+SQLITE_PRIVATE i64 sqlite3PagerJournalSizeLimit(Pager *, i64);
+SQLITE_PRIVATE sqlite3_backup **sqlite3PagerBackupPtr(Pager*);
+SQLITE_PRIVATE int sqlite3PagerFlush(Pager*);
+
+/* Functions used to obtain and release page references. */
+SQLITE_PRIVATE int sqlite3PagerGet(Pager *pPager, Pgno pgno, DbPage **ppPage, int clrFlag);
+SQLITE_PRIVATE DbPage *sqlite3PagerLookup(Pager *pPager, Pgno pgno);
+SQLITE_PRIVATE void sqlite3PagerRef(DbPage*);
+SQLITE_PRIVATE void sqlite3PagerUnref(DbPage*);
+SQLITE_PRIVATE void sqlite3PagerUnrefNotNull(DbPage*);
+SQLITE_PRIVATE void sqlite3PagerUnrefPageOne(DbPage*);
+
+/* Operations on page references. */
+SQLITE_PRIVATE int sqlite3PagerWrite(DbPage*);
+SQLITE_PRIVATE void sqlite3PagerDontWrite(DbPage*);
+SQLITE_PRIVATE int sqlite3PagerMovepage(Pager*,DbPage*,Pgno,int);
+SQLITE_PRIVATE int sqlite3PagerPageRefcount(DbPage*);
+SQLITE_PRIVATE void *sqlite3PagerGetData(DbPage *);
+SQLITE_PRIVATE void *sqlite3PagerGetExtra(DbPage *);
+
+/* Functions used to manage pager transactions and savepoints. */
+SQLITE_PRIVATE void sqlite3PagerPagecount(Pager*, int*);
+SQLITE_PRIVATE int sqlite3PagerBegin(Pager*, int exFlag, int);
+SQLITE_PRIVATE int sqlite3PagerCommitPhaseOne(Pager*,const char *zSuper, int);
+SQLITE_PRIVATE int sqlite3PagerExclusiveLock(Pager*);
+SQLITE_PRIVATE int sqlite3PagerSync(Pager *pPager, const char *zSuper);
+SQLITE_PRIVATE int sqlite3PagerCommitPhaseTwo(Pager*);
+SQLITE_PRIVATE int sqlite3PagerRollback(Pager*);
+SQLITE_PRIVATE int sqlite3PagerOpenSavepoint(Pager *pPager, int n);
+SQLITE_PRIVATE int sqlite3PagerSavepoint(Pager *pPager, int op, int iSavepoint);
+SQLITE_PRIVATE int sqlite3PagerSharedLock(Pager *pPager);
+
+#ifndef SQLITE_OMIT_WAL
+SQLITE_PRIVATE int sqlite3PagerCheckpoint(Pager *pPager, sqlite3*, int, int*, int*);
+SQLITE_PRIVATE int sqlite3PagerWalSupported(Pager *pPager);
+SQLITE_PRIVATE int sqlite3PagerWalCallback(Pager *pPager);
+SQLITE_PRIVATE int sqlite3PagerOpenWal(Pager *pPager, int *pisOpen);
+SQLITE_PRIVATE int sqlite3PagerCloseWal(Pager *pPager, sqlite3*);
+# ifdef SQLITE_ENABLE_SNAPSHOT
+SQLITE_PRIVATE int sqlite3PagerSnapshotGet(Pager*, sqlite3_snapshot **ppSnapshot);
+SQLITE_PRIVATE int sqlite3PagerSnapshotOpen(Pager*, sqlite3_snapshot *pSnapshot);
+SQLITE_PRIVATE int sqlite3PagerSnapshotRecover(Pager *pPager);
+SQLITE_PRIVATE int sqlite3PagerSnapshotCheck(Pager *pPager, sqlite3_snapshot *pSnapshot);
+SQLITE_PRIVATE void sqlite3PagerSnapshotUnlock(Pager *pPager);
+# endif
+#endif
+
+#if !defined(SQLITE_OMIT_WAL) && defined(SQLITE_ENABLE_SETLK_TIMEOUT)
+SQLITE_PRIVATE int sqlite3PagerWalWriteLock(Pager*, int);
+SQLITE_PRIVATE void sqlite3PagerWalDb(Pager*, sqlite3*);
+#else
+# define sqlite3PagerWalWriteLock(y,z) SQLITE_OK
+# define sqlite3PagerWalDb(x,y)
+#endif
+
+#ifdef SQLITE_DIRECT_OVERFLOW_READ
+SQLITE_PRIVATE int sqlite3PagerDirectReadOk(Pager *pPager, Pgno pgno);
+#endif
+
+#ifdef SQLITE_ENABLE_ZIPVFS
+SQLITE_PRIVATE int sqlite3PagerWalFramesize(Pager *pPager);
+#endif
+
+/* Functions used to query pager state and configuration. */
+SQLITE_PRIVATE u8 sqlite3PagerIsreadonly(Pager*);
+SQLITE_PRIVATE u32 sqlite3PagerDataVersion(Pager*);
+#ifdef SQLITE_DEBUG
+SQLITE_PRIVATE int sqlite3PagerRefcount(Pager*);
+#endif
+SQLITE_PRIVATE int sqlite3PagerMemUsed(Pager*);
+SQLITE_PRIVATE const char *sqlite3PagerFilename(const Pager*, int);
+SQLITE_PRIVATE sqlite3_vfs *sqlite3PagerVfs(Pager*);
+SQLITE_PRIVATE sqlite3_file *sqlite3PagerFile(Pager*);
+SQLITE_PRIVATE sqlite3_file *sqlite3PagerJrnlFile(Pager*);
+SQLITE_PRIVATE const char *sqlite3PagerJournalname(Pager*);
+SQLITE_PRIVATE void *sqlite3PagerTempSpace(Pager*);
+SQLITE_PRIVATE int sqlite3PagerIsMemdb(Pager*);
+SQLITE_PRIVATE void sqlite3PagerCacheStat(Pager *, int, int, u64*);
+SQLITE_PRIVATE void sqlite3PagerClearCache(Pager*);
+SQLITE_PRIVATE int sqlite3SectorSize(sqlite3_file *);
+
+/* Functions used to truncate the database file. */
+SQLITE_PRIVATE void sqlite3PagerTruncateImage(Pager*,Pgno);
+
+SQLITE_PRIVATE void sqlite3PagerRekey(DbPage*, Pgno, u16);
+
+/* Functions to support testing and debugging. */
+#if !defined(NDEBUG) || defined(SQLITE_TEST)
+SQLITE_PRIVATE Pgno sqlite3PagerPagenumber(DbPage*);
+SQLITE_PRIVATE int sqlite3PagerIswriteable(DbPage*);
+#endif
+#ifdef SQLITE_TEST
+SQLITE_PRIVATE int *sqlite3PagerStats(Pager*);
+SQLITE_PRIVATE void sqlite3PagerRefdump(Pager*);
+ void disable_simulated_io_errors(void);
+ void enable_simulated_io_errors(void);
+#else
+# define disable_simulated_io_errors()
+# define enable_simulated_io_errors()
+#endif
+
+#if defined(SQLITE_USE_SEH) && !defined(SQLITE_OMIT_WAL)
+SQLITE_PRIVATE int sqlite3PagerWalSystemErrno(Pager*);
+#endif
+
+#endif /* SQLITE_PAGER_H */
+
+/************** End of pager.h ***********************************************/
+/************** Continuing where we left off in sqliteInt.h ******************/
+/************** Include btree.h in the middle of sqliteInt.h *****************/
+/************** Begin file btree.h *******************************************/
+/*
+** 2001 September 15
+**
+** The author disclaims copyright to this source code. In place of
+** a legal notice, here is a blessing:
+**
+** May you do good and not evil.
+** May you find forgiveness for yourself and forgive others.
+** May you share freely, never taking more than you give.
+**
+*************************************************************************
+** This header file defines the interface that the sqlite B-Tree file
+** subsystem. See comments in the source code for a detailed description
+** of what each interface routine does.
+*/
+#ifndef SQLITE_BTREE_H
+#define SQLITE_BTREE_H
+
+/* TODO: This definition is just included so other modules compile. It
+** needs to be revisited.
+*/
+#define SQLITE_N_BTREE_META 16
+
+/*
+** If defined as non-zero, auto-vacuum is enabled by default. Otherwise
+** it must be turned on for each database using "PRAGMA auto_vacuum = 1".
+*/
+#ifndef SQLITE_DEFAULT_AUTOVACUUM
+ #define SQLITE_DEFAULT_AUTOVACUUM 0
+#endif
+
+#define BTREE_AUTOVACUUM_NONE 0 /* Do not do auto-vacuum */
+#define BTREE_AUTOVACUUM_FULL 1 /* Do full auto-vacuum */
+#define BTREE_AUTOVACUUM_INCR 2 /* Incremental vacuum */
+
+/*
+** Forward declarations of structure
+*/
+typedef struct Btree Btree;
+typedef struct BtCursor BtCursor;
+typedef struct BtShared BtShared;
+typedef struct BtreePayload BtreePayload;
+
+
+SQLITE_PRIVATE int sqlite3BtreeOpen(
+ sqlite3_vfs *pVfs, /* VFS to use with this b-tree */
+ const char *zFilename, /* Name of database file to open */
+ sqlite3 *db, /* Associated database connection */
+ Btree **ppBtree, /* Return open Btree* here */
+ int flags, /* Flags */
+ int vfsFlags /* Flags passed through to VFS open */
+);
+
+/* The flags parameter to sqlite3BtreeOpen can be the bitwise or of the
+** following values.
+**
+** NOTE: These values must match the corresponding PAGER_ values in
+** pager.h.
+*/
+#define BTREE_OMIT_JOURNAL 1 /* Do not create or use a rollback journal */
+#define BTREE_MEMORY 2 /* This is an in-memory DB */
+#define BTREE_SINGLE 4 /* The file contains at most 1 b-tree */
+#define BTREE_UNORDERED 8 /* Use of a hash implementation is OK */
+
+SQLITE_PRIVATE int sqlite3BtreeClose(Btree*);
+SQLITE_PRIVATE int sqlite3BtreeSetCacheSize(Btree*,int);
+SQLITE_PRIVATE int sqlite3BtreeSetSpillSize(Btree*,int);
+#if SQLITE_MAX_MMAP_SIZE>0
+SQLITE_PRIVATE int sqlite3BtreeSetMmapLimit(Btree*,sqlite3_int64);
+#endif
+SQLITE_PRIVATE int sqlite3BtreeSetPagerFlags(Btree*,unsigned);
+SQLITE_PRIVATE int sqlite3BtreeSetPageSize(Btree *p, int nPagesize, int nReserve, int eFix);
+SQLITE_PRIVATE int sqlite3BtreeGetPageSize(Btree*);
+SQLITE_PRIVATE Pgno sqlite3BtreeMaxPageCount(Btree*,Pgno);
+SQLITE_PRIVATE Pgno sqlite3BtreeLastPage(Btree*);
+SQLITE_PRIVATE int sqlite3BtreeSecureDelete(Btree*,int);
+SQLITE_PRIVATE int sqlite3BtreeGetRequestedReserve(Btree*);
+SQLITE_PRIVATE int sqlite3BtreeGetReserveNoMutex(Btree *p);
+SQLITE_PRIVATE int sqlite3BtreeSetAutoVacuum(Btree *, int);
+SQLITE_PRIVATE int sqlite3BtreeGetAutoVacuum(Btree *);
+SQLITE_PRIVATE int sqlite3BtreeBeginTrans(Btree*,int,int*);
+SQLITE_PRIVATE int sqlite3BtreeCommitPhaseOne(Btree*, const char*);
+SQLITE_PRIVATE int sqlite3BtreeCommitPhaseTwo(Btree*, int);
+SQLITE_PRIVATE int sqlite3BtreeCommit(Btree*);
+SQLITE_PRIVATE int sqlite3BtreeRollback(Btree*,int,int);
+SQLITE_PRIVATE int sqlite3BtreeBeginStmt(Btree*,int);
+SQLITE_PRIVATE int sqlite3BtreeCreateTable(Btree*, Pgno*, int flags);
+SQLITE_PRIVATE int sqlite3BtreeTxnState(Btree*);
+SQLITE_PRIVATE int sqlite3BtreeIsInBackup(Btree*);
+
+SQLITE_PRIVATE void *sqlite3BtreeSchema(Btree *, int, void(*)(void *));
+SQLITE_PRIVATE int sqlite3BtreeSchemaLocked(Btree *pBtree);
+#ifndef SQLITE_OMIT_SHARED_CACHE
+SQLITE_PRIVATE int sqlite3BtreeLockTable(Btree *pBtree, int iTab, u8 isWriteLock);
+#endif
+
+/* Savepoints are named, nestable SQL transactions mostly implemented */
+/* in vdbe.c and pager.c See https://sqlite.org/lang_savepoint.html */
+SQLITE_PRIVATE int sqlite3BtreeSavepoint(Btree *, int, int);
+
+/* "Checkpoint" only refers to WAL. See https://sqlite.org/wal.html#ckpt */
+#ifndef SQLITE_OMIT_WAL
+SQLITE_PRIVATE int sqlite3BtreeCheckpoint(Btree*, int, int *, int *);
+#endif
+
+SQLITE_PRIVATE const char *sqlite3BtreeGetFilename(Btree *);
+SQLITE_PRIVATE const char *sqlite3BtreeGetJournalname(Btree *);
+SQLITE_PRIVATE int sqlite3BtreeCopyFile(Btree *, Btree *);
+
+SQLITE_PRIVATE int sqlite3BtreeIncrVacuum(Btree *);
+
+/* The flags parameter to sqlite3BtreeCreateTable can be the bitwise OR
+** of the flags shown below.
+**
+** Every SQLite table must have either BTREE_INTKEY or BTREE_BLOBKEY set.
+** With BTREE_INTKEY, the table key is a 64-bit integer and arbitrary data
+** is stored in the leaves. (BTREE_INTKEY is used for SQL tables.) With
+** BTREE_BLOBKEY, the key is an arbitrary BLOB and no content is stored
+** anywhere - the key is the content. (BTREE_BLOBKEY is used for SQL
+** indices.)
+*/
+#define BTREE_INTKEY 1 /* Table has only 64-bit signed integer keys */
+#define BTREE_BLOBKEY 2 /* Table has keys only - no data */
+
+SQLITE_PRIVATE int sqlite3BtreeDropTable(Btree*, int, int*);
+SQLITE_PRIVATE int sqlite3BtreeClearTable(Btree*, int, i64*);
+SQLITE_PRIVATE int sqlite3BtreeClearTableOfCursor(BtCursor*);
+SQLITE_PRIVATE int sqlite3BtreeTripAllCursors(Btree*, int, int);
+
+SQLITE_PRIVATE void sqlite3BtreeGetMeta(Btree *pBtree, int idx, u32 *pValue);
+SQLITE_PRIVATE int sqlite3BtreeUpdateMeta(Btree*, int idx, u32 value);
+
+SQLITE_PRIVATE int sqlite3BtreeNewDb(Btree *p);
+
+/*
+** The second parameter to sqlite3BtreeGetMeta or sqlite3BtreeUpdateMeta
+** should be one of the following values. The integer values are assigned
+** to constants so that the offset of the corresponding field in an
+** SQLite database header may be found using the following formula:
+**
+** offset = 36 + (idx * 4)
+**
+** For example, the free-page-count field is located at byte offset 36 of
+** the database file header. The incr-vacuum-flag field is located at
+** byte offset 64 (== 36+4*7).
+**
+** The BTREE_DATA_VERSION value is not really a value stored in the header.
+** It is a read-only number computed by the pager. But we merge it with
+** the header value access routines since its access pattern is the same.
+** Call it a "virtual meta value".
+*/
+#define BTREE_FREE_PAGE_COUNT 0
+#define BTREE_SCHEMA_VERSION 1
+#define BTREE_FILE_FORMAT 2
+#define BTREE_DEFAULT_CACHE_SIZE 3
+#define BTREE_LARGEST_ROOT_PAGE 4
+#define BTREE_TEXT_ENCODING 5
+#define BTREE_USER_VERSION 6
+#define BTREE_INCR_VACUUM 7
+#define BTREE_APPLICATION_ID 8
+#define BTREE_DATA_VERSION 15 /* A virtual meta-value */
+
+/*
+** Kinds of hints that can be passed into the sqlite3BtreeCursorHint()
+** interface.
+**
+** BTREE_HINT_RANGE (arguments: Expr*, Mem*)
+**
+** The first argument is an Expr* (which is guaranteed to be constant for
+** the lifetime of the cursor) that defines constraints on which rows
+** might be fetched with this cursor. The Expr* tree may contain
+** TK_REGISTER nodes that refer to values stored in the array of registers
+** passed as the second parameter. In other words, if Expr.op==TK_REGISTER
+** then the value of the node is the value in Mem[pExpr.iTable]. Any
+** TK_COLUMN node in the expression tree refers to the Expr.iColumn-th
+** column of the b-tree of the cursor. The Expr tree will not contain
+** any function calls nor subqueries nor references to b-trees other than
+** the cursor being hinted.
+**
+** The design of the _RANGE hint is aid b-tree implementations that try
+** to prefetch content from remote machines - to provide those
+** implementations with limits on what needs to be prefetched and thereby
+** reduce network bandwidth.
+**
+** Note that BTREE_HINT_FLAGS with BTREE_BULKLOAD is the only hint used by
+** standard SQLite. The other hints are provided for extensions that use
+** the SQLite parser and code generator but substitute their own storage
+** engine.
+*/
+#define BTREE_HINT_RANGE 0 /* Range constraints on queries */
+
+/*
+** Values that may be OR'd together to form the argument to the
+** BTREE_HINT_FLAGS hint for sqlite3BtreeCursorHint():
+**
+** The BTREE_BULKLOAD flag is set on index cursors when the index is going
+** to be filled with content that is already in sorted order.
+**
+** The BTREE_SEEK_EQ flag is set on cursors that will get OP_SeekGE or
+** OP_SeekLE opcodes for a range search, but where the range of entries
+** selected will all have the same key. In other words, the cursor will
+** be used only for equality key searches.
+**
+*/
+#define BTREE_BULKLOAD 0x00000001 /* Used to full index in sorted order */
+#define BTREE_SEEK_EQ 0x00000002 /* EQ seeks only - no range seeks */
+
+/*
+** Flags passed as the third argument to sqlite3BtreeCursor().
+**
+** For read-only cursors the wrFlag argument is always zero. For read-write
+** cursors it may be set to either (BTREE_WRCSR|BTREE_FORDELETE) or just
+** (BTREE_WRCSR). If the BTREE_FORDELETE bit is set, then the cursor will
+** only be used by SQLite for the following:
+**
+** * to seek to and then delete specific entries, and/or
+**
+** * to read values that will be used to create keys that other
+** BTREE_FORDELETE cursors will seek to and delete.
+**
+** The BTREE_FORDELETE flag is an optimization hint. It is not used by
+** by this, the native b-tree engine of SQLite, but it is available to
+** alternative storage engines that might be substituted in place of this
+** b-tree system. For alternative storage engines in which a delete of
+** the main table row automatically deletes corresponding index rows,
+** the FORDELETE flag hint allows those alternative storage engines to
+** skip a lot of work. Namely: FORDELETE cursors may treat all SEEK
+** and DELETE operations as no-ops, and any READ operation against a
+** FORDELETE cursor may return a null row: 0x01 0x00.
+*/
+#define BTREE_WRCSR 0x00000004 /* read-write cursor */
+#define BTREE_FORDELETE 0x00000008 /* Cursor is for seek/delete only */
+
+SQLITE_PRIVATE int sqlite3BtreeCursor(
+ Btree*, /* BTree containing table to open */
+ Pgno iTable, /* Index of root page */
+ int wrFlag, /* 1 for writing. 0 for read-only */
+ struct KeyInfo*, /* First argument to compare function */
+ BtCursor *pCursor /* Space to write cursor structure */
+);
+SQLITE_PRIVATE BtCursor *sqlite3BtreeFakeValidCursor(void);
+SQLITE_PRIVATE int sqlite3BtreeCursorSize(void);
+#ifdef SQLITE_DEBUG
+SQLITE_PRIVATE int sqlite3BtreeClosesWithCursor(Btree*,BtCursor*);
+#endif
+SQLITE_PRIVATE void sqlite3BtreeCursorZero(BtCursor*);
+SQLITE_PRIVATE void sqlite3BtreeCursorHintFlags(BtCursor*, unsigned);
+#ifdef SQLITE_ENABLE_CURSOR_HINTS
+SQLITE_PRIVATE void sqlite3BtreeCursorHint(BtCursor*, int, ...);
+#endif
+
+SQLITE_PRIVATE int sqlite3BtreeCloseCursor(BtCursor*);
+SQLITE_PRIVATE int sqlite3BtreeTableMoveto(
+ BtCursor*,
+ i64 intKey,
+ int bias,
+ int *pRes
+);
+SQLITE_PRIVATE int sqlite3BtreeIndexMoveto(
+ BtCursor*,
+ UnpackedRecord *pUnKey,
+ int *pRes
+);
+SQLITE_PRIVATE int sqlite3BtreeCursorHasMoved(BtCursor*);
+SQLITE_PRIVATE int sqlite3BtreeCursorRestore(BtCursor*, int*);
+SQLITE_PRIVATE int sqlite3BtreeDelete(BtCursor*, u8 flags);
+
+/* Allowed flags for sqlite3BtreeDelete() and sqlite3BtreeInsert() */
+#define BTREE_SAVEPOSITION 0x02 /* Leave cursor pointing at NEXT or PREV */
+#define BTREE_AUXDELETE 0x04 /* not the primary delete operation */
+#define BTREE_APPEND 0x08 /* Insert is likely an append */
+#define BTREE_PREFORMAT 0x80 /* Inserted data is a preformated cell */
+
+/* An instance of the BtreePayload object describes the content of a single
+** entry in either an index or table btree.
+**
+** Index btrees (used for indexes and also WITHOUT ROWID tables) contain
+** an arbitrary key and no data. These btrees have pKey,nKey set to the
+** key and the pData,nData,nZero fields are uninitialized. The aMem,nMem
+** fields give an array of Mem objects that are a decomposition of the key.
+** The nMem field might be zero, indicating that no decomposition is available.
+**
+** Table btrees (used for rowid tables) contain an integer rowid used as
+** the key and passed in the nKey field. The pKey field is zero.
+** pData,nData hold the content of the new entry. nZero extra zero bytes
+** are appended to the end of the content when constructing the entry.
+** The aMem,nMem fields are uninitialized for table btrees.
+**
+** Field usage summary:
+**
+** Table BTrees Index Btrees
+**
+** pKey always NULL encoded key
+** nKey the ROWID length of pKey
+** pData data not used
+** aMem not used decomposed key value
+** nMem not used entries in aMem
+** nData length of pData not used
+** nZero extra zeros after pData not used
+**
+** This object is used to pass information into sqlite3BtreeInsert(). The
+** same information used to be passed as five separate parameters. But placing
+** the information into this object helps to keep the interface more
+** organized and understandable, and it also helps the resulting code to
+** run a little faster by using fewer registers for parameter passing.
+*/
+struct BtreePayload {
+ const void *pKey; /* Key content for indexes. NULL for tables */
+ sqlite3_int64 nKey; /* Size of pKey for indexes. PRIMARY KEY for tabs */
+ const void *pData; /* Data for tables. */
+ sqlite3_value *aMem; /* First of nMem value in the unpacked pKey */
+ u16 nMem; /* Number of aMem[] value. Might be zero */
+ int nData; /* Size of pData. 0 if none. */
+ int nZero; /* Extra zero data appended after pData,nData */
+};
+
+SQLITE_PRIVATE int sqlite3BtreeInsert(BtCursor*, const BtreePayload *pPayload,
+ int flags, int seekResult);
+SQLITE_PRIVATE int sqlite3BtreeFirst(BtCursor*, int *pRes);
+SQLITE_PRIVATE int sqlite3BtreeLast(BtCursor*, int *pRes);
+SQLITE_PRIVATE int sqlite3BtreeNext(BtCursor*, int flags);
+SQLITE_PRIVATE int sqlite3BtreeEof(BtCursor*);
+SQLITE_PRIVATE int sqlite3BtreePrevious(BtCursor*, int flags);
+SQLITE_PRIVATE i64 sqlite3BtreeIntegerKey(BtCursor*);
+SQLITE_PRIVATE void sqlite3BtreeCursorPin(BtCursor*);
+SQLITE_PRIVATE void sqlite3BtreeCursorUnpin(BtCursor*);
+SQLITE_PRIVATE i64 sqlite3BtreeOffset(BtCursor*);
+SQLITE_PRIVATE int sqlite3BtreePayload(BtCursor*, u32 offset, u32 amt, void*);
+SQLITE_PRIVATE const void *sqlite3BtreePayloadFetch(BtCursor*, u32 *pAmt);
+SQLITE_PRIVATE u32 sqlite3BtreePayloadSize(BtCursor*);
+SQLITE_PRIVATE sqlite3_int64 sqlite3BtreeMaxRecordSize(BtCursor*);
+
+SQLITE_PRIVATE int sqlite3BtreeIntegrityCheck(
+ sqlite3 *db, /* Database connection that is running the check */
+ Btree *p, /* The btree to be checked */
+ Pgno *aRoot, /* An array of root pages numbers for individual trees */
+ sqlite3_value *aCnt, /* OUT: entry counts for each btree in aRoot[] */
+ int nRoot, /* Number of entries in aRoot[] */
+ int mxErr, /* Stop reporting errors after this many */
+ int *pnErr, /* OUT: Write number of errors seen to this variable */
+ char **pzOut /* OUT: Write the error message string here */
+);
+SQLITE_PRIVATE struct Pager *sqlite3BtreePager(Btree*);
+SQLITE_PRIVATE i64 sqlite3BtreeRowCountEst(BtCursor*);
+
+#ifndef SQLITE_OMIT_INCRBLOB
+SQLITE_PRIVATE int sqlite3BtreePayloadChecked(BtCursor*, u32 offset, u32 amt, void*);
+SQLITE_PRIVATE int sqlite3BtreePutData(BtCursor*, u32 offset, u32 amt, void*);
+SQLITE_PRIVATE void sqlite3BtreeIncrblobCursor(BtCursor *);
+#endif
+SQLITE_PRIVATE void sqlite3BtreeClearCursor(BtCursor *);
+SQLITE_PRIVATE int sqlite3BtreeSetVersion(Btree *pBt, int iVersion);
+SQLITE_PRIVATE int sqlite3BtreeCursorHasHint(BtCursor*, unsigned int mask);
+SQLITE_PRIVATE int sqlite3BtreeIsReadonly(Btree *pBt);
+SQLITE_PRIVATE int sqlite3HeaderSizeBtree(void);
+
+#ifdef SQLITE_DEBUG
+SQLITE_PRIVATE sqlite3_uint64 sqlite3BtreeSeekCount(Btree*);
+#else
+# define sqlite3BtreeSeekCount(X) 0
+#endif
+
+#ifndef NDEBUG
+SQLITE_PRIVATE int sqlite3BtreeCursorIsValid(BtCursor*);
+#endif
+SQLITE_PRIVATE int sqlite3BtreeCursorIsValidNN(BtCursor*);
+
+SQLITE_PRIVATE int sqlite3BtreeCount(sqlite3*, BtCursor*, i64*);
+
+#ifdef SQLITE_TEST
+SQLITE_PRIVATE int sqlite3BtreeCursorInfo(BtCursor*, int*, int);
+SQLITE_PRIVATE void sqlite3BtreeCursorList(Btree*);
+#endif
+
+#ifndef SQLITE_OMIT_WAL
+SQLITE_PRIVATE int sqlite3BtreeCheckpoint(Btree*, int, int *, int *);
+#endif
+
+SQLITE_PRIVATE int sqlite3BtreeTransferRow(BtCursor*, BtCursor*, i64);
+
+SQLITE_PRIVATE void sqlite3BtreeClearCache(Btree*);
+
+/*
+** If we are not using shared cache, then there is no need to
+** use mutexes to access the BtShared structures. So make the
+** Enter and Leave procedures no-ops.
+*/
+#ifndef SQLITE_OMIT_SHARED_CACHE
+SQLITE_PRIVATE void sqlite3BtreeEnter(Btree*);
+SQLITE_PRIVATE void sqlite3BtreeEnterAll(sqlite3*);
+SQLITE_PRIVATE int sqlite3BtreeSharable(Btree*);
+SQLITE_PRIVATE void sqlite3BtreeEnterCursor(BtCursor*);
+SQLITE_PRIVATE int sqlite3BtreeConnectionCount(Btree*);
+#else
+# define sqlite3BtreeEnter(X)
+# define sqlite3BtreeEnterAll(X)
+# define sqlite3BtreeSharable(X) 0
+# define sqlite3BtreeEnterCursor(X)
+# define sqlite3BtreeConnectionCount(X) 1
+#endif
+
+#if !defined(SQLITE_OMIT_SHARED_CACHE) && SQLITE_THREADSAFE
+SQLITE_PRIVATE void sqlite3BtreeLeave(Btree*);
+SQLITE_PRIVATE void sqlite3BtreeLeaveCursor(BtCursor*);
+SQLITE_PRIVATE void sqlite3BtreeLeaveAll(sqlite3*);
+#ifndef NDEBUG
+ /* These routines are used inside assert() statements only. */
+SQLITE_PRIVATE int sqlite3BtreeHoldsMutex(Btree*);
+SQLITE_PRIVATE int sqlite3BtreeHoldsAllMutexes(sqlite3*);
+SQLITE_PRIVATE int sqlite3SchemaMutexHeld(sqlite3*,int,Schema*);
+#endif
+#else
+
+# define sqlite3BtreeLeave(X)
+# define sqlite3BtreeLeaveCursor(X)
+# define sqlite3BtreeLeaveAll(X)
+
+# define sqlite3BtreeHoldsMutex(X) 1
+# define sqlite3BtreeHoldsAllMutexes(X) 1
+# define sqlite3SchemaMutexHeld(X,Y,Z) 1
+#endif
+
+
+#endif /* SQLITE_BTREE_H */
+
+/************** End of btree.h ***********************************************/
+/************** Continuing where we left off in sqliteInt.h ******************/
+/************** Include vdbe.h in the middle of sqliteInt.h ******************/
+/************** Begin file vdbe.h ********************************************/
+/*
+** 2001 September 15
+**
+** The author disclaims copyright to this source code. In place of
+** a legal notice, here is a blessing:
+**
+** May you do good and not evil.
+** May you find forgiveness for yourself and forgive others.
+** May you share freely, never taking more than you give.
+**
+*************************************************************************
+** Header file for the Virtual DataBase Engine (VDBE)
+**
+** This header defines the interface to the virtual database engine
+** or VDBE. The VDBE implements an abstract machine that runs a
+** simple program to access and modify the underlying database.
+*/
+#ifndef SQLITE_VDBE_H
+#define SQLITE_VDBE_H
+/* #include */
+
+/*
+** A single VDBE is an opaque structure named "Vdbe". Only routines
+** in the source file sqliteVdbe.c are allowed to see the insides
+** of this structure.
+*/
+typedef struct Vdbe Vdbe;
+
+/*
+** The names of the following types declared in vdbeInt.h are required
+** for the VdbeOp definition.
+*/
+typedef struct sqlite3_value Mem;
+typedef struct SubProgram SubProgram;
+typedef struct SubrtnSig SubrtnSig;
+
+/*
+** A signature for a reusable subroutine that materializes the RHS of
+** an IN operator.
+*/
+struct SubrtnSig {
+ int selId; /* SELECT-id for the SELECT statement on the RHS */
+ u8 bComplete; /* True if fully coded and available for reusable */
+ char *zAff; /* Affinity of the overall IN expression */
+ int iTable; /* Ephemeral table generated by the subroutine */
+ int iAddr; /* Subroutine entry address */
+ int regReturn; /* Register used to hold return address */
+};
+
+/*
+** A single instruction of the virtual machine has an opcode
+** and as many as three operands. The instruction is recorded
+** as an instance of the following structure:
+*/
+struct VdbeOp {
+ u8 opcode; /* What operation to perform */
+ signed char p4type; /* One of the P4_xxx constants for p4 */
+ u16 p5; /* Fifth parameter is an unsigned 16-bit integer */
+ int p1; /* First operand */
+ int p2; /* Second parameter (often the jump destination) */
+ int p3; /* The third parameter */
+ union p4union { /* fourth parameter */
+ int i; /* Integer value if p4type==P4_INT32 */
+ void *p; /* Generic pointer */
+ char *z; /* Pointer to data for string (char array) types */
+ i64 *pI64; /* Used when p4type is P4_INT64 */
+ double *pReal; /* Used when p4type is P4_REAL */
+ FuncDef *pFunc; /* Used when p4type is P4_FUNCDEF */
+ sqlite3_context *pCtx; /* Used when p4type is P4_FUNCCTX */
+ CollSeq *pColl; /* Used when p4type is P4_COLLSEQ */
+ Mem *pMem; /* Used when p4type is P4_MEM */
+ VTable *pVtab; /* Used when p4type is P4_VTAB */
+ KeyInfo *pKeyInfo; /* Used when p4type is P4_KEYINFO */
+ u32 *ai; /* Used when p4type is P4_INTARRAY */
+ SubProgram *pProgram; /* Used when p4type is P4_SUBPROGRAM */
+ Table *pTab; /* Used when p4type is P4_TABLE */
+ SubrtnSig *pSubrtnSig; /* Used when p4type is P4_SUBRTNSIG */
+#ifdef SQLITE_ENABLE_CURSOR_HINTS
+ Expr *pExpr; /* Used when p4type is P4_EXPR */
+#endif
+ } p4;
+#ifdef SQLITE_ENABLE_EXPLAIN_COMMENTS
+ char *zComment; /* Comment to improve readability */
+#endif
+#ifdef SQLITE_VDBE_COVERAGE
+ u32 iSrcLine; /* Source-code line that generated this opcode
+ ** with flags in the upper 8 bits */
+#endif
+#if defined(SQLITE_ENABLE_STMT_SCANSTATUS) || defined(VDBE_PROFILE)
+ u64 nExec;
+ u64 nCycle;
+#endif
+};
+typedef struct VdbeOp VdbeOp;
+
+
+/*
+** A sub-routine used to implement a trigger program.
+*/
+struct SubProgram {
+ VdbeOp *aOp; /* Array of opcodes for sub-program */
+ int nOp; /* Elements in aOp[] */
+ int nMem; /* Number of memory cells required */
+ int nCsr; /* Number of cursors required */
+ u8 *aOnce; /* Array of OP_Once flags */
+ void *token; /* id that may be used to recursive triggers */
+ SubProgram *pNext; /* Next sub-program already visited */
+};
+
+/*
+** A smaller version of VdbeOp used for the VdbeAddOpList() function because
+** it takes up less space.
+*/
+struct VdbeOpList {
+ u8 opcode; /* What operation to perform */
+ signed char p1; /* First operand */
+ signed char p2; /* Second parameter (often the jump destination) */
+ signed char p3; /* Third parameter */
+};
+typedef struct VdbeOpList VdbeOpList;
+
+/*
+** Allowed values of VdbeOp.p4type
+*/
+#define P4_NOTUSED 0 /* The P4 parameter is not used */
+#define P4_TRANSIENT 0 /* P4 is a pointer to a transient string */
+#define P4_STATIC (-1) /* Pointer to a static string */
+#define P4_COLLSEQ (-2) /* P4 is a pointer to a CollSeq structure */
+#define P4_INT32 (-3) /* P4 is a 32-bit signed integer */
+#define P4_SUBPROGRAM (-4) /* P4 is a pointer to a SubProgram structure */
+#define P4_TABLE (-5) /* P4 is a pointer to a Table structure */
+/* Above do not own any resources. Must free those below */
+#define P4_FREE_IF_LE (-6)
+#define P4_DYNAMIC (-6) /* Pointer to memory from sqliteMalloc() */
+#define P4_FUNCDEF (-7) /* P4 is a pointer to a FuncDef structure */
+#define P4_KEYINFO (-8) /* P4 is a pointer to a KeyInfo structure */
+#define P4_EXPR (-9) /* P4 is a pointer to an Expr tree */
+#define P4_MEM (-10) /* P4 is a pointer to a Mem* structure */
+#define P4_VTAB (-11) /* P4 is a pointer to an sqlite3_vtab structure */
+#define P4_REAL (-12) /* P4 is a 64-bit floating point value */
+#define P4_INT64 (-13) /* P4 is a 64-bit signed integer */
+#define P4_INTARRAY (-14) /* P4 is a vector of 32-bit integers */
+#define P4_FUNCCTX (-15) /* P4 is a pointer to an sqlite3_context object */
+#define P4_TABLEREF (-16) /* Like P4_TABLE, but reference counted */
+#define P4_SUBRTNSIG (-17) /* P4 is a SubrtnSig pointer */
+
+/* Error message codes for OP_Halt */
+#define P5_ConstraintNotNull 1
+#define P5_ConstraintUnique 2
+#define P5_ConstraintCheck 3
+#define P5_ConstraintFK 4
+
+/*
+** The Vdbe.aColName array contains 5n Mem structures, where n is the
+** number of columns of data returned by the statement.
+*/
+#define COLNAME_NAME 0
+#define COLNAME_DECLTYPE 1
+#define COLNAME_DATABASE 2
+#define COLNAME_TABLE 3
+#define COLNAME_COLUMN 4
+#ifdef SQLITE_ENABLE_COLUMN_METADATA
+# define COLNAME_N 5 /* Number of COLNAME_xxx symbols */
+#else
+# ifdef SQLITE_OMIT_DECLTYPE
+# define COLNAME_N 1 /* Store only the name */
+# else
+# define COLNAME_N 2 /* Store the name and decltype */
+# endif
+#endif
+
+/*
+** The following macro converts a label returned by sqlite3VdbeMakeLabel()
+** into an index into the Parse.aLabel[] array that contains the resolved
+** address of that label.
+*/
+#define ADDR(X) (~(X))
+
+/*
+** The makefile scans the vdbe.c source file and creates the "opcodes.h"
+** header file that defines a number for each opcode used by the VDBE.
+*/
+/************** Include opcodes.h in the middle of vdbe.h ********************/
+/************** Begin file opcodes.h *****************************************/
+/* Automatically generated. Do not edit */
+/* See the tool/mkopcodeh.tcl script for details */
+#define OP_Savepoint 0
+#define OP_AutoCommit 1
+#define OP_Transaction 2
+#define OP_Checkpoint 3
+#define OP_JournalMode 4
+#define OP_Vacuum 5
+#define OP_VFilter 6 /* jump, synopsis: iplan=r[P3] zplan='P4' */
+#define OP_VUpdate 7 /* synopsis: data=r[P3@P2] */
+#define OP_Init 8 /* jump0, synopsis: Start at P2 */
+#define OP_Goto 9 /* jump */
+#define OP_Gosub 10 /* jump */
+#define OP_InitCoroutine 11 /* jump0 */
+#define OP_Yield 12 /* jump0 */
+#define OP_MustBeInt 13 /* jump0 */
+#define OP_Jump 14 /* jump */
+#define OP_Once 15 /* jump */
+#define OP_If 16 /* jump */
+#define OP_IfNot 17 /* jump */
+#define OP_IsType 18 /* jump, synopsis: if typeof(P1.P3) in P5 goto P2 */
+#define OP_Not 19 /* same as TK_NOT, synopsis: r[P2]= !r[P1] */
+#define OP_IfNullRow 20 /* jump, synopsis: if P1.nullRow then r[P3]=NULL, goto P2 */
+#define OP_SeekLT 21 /* jump0, synopsis: key=r[P3@P4] */
+#define OP_SeekLE 22 /* jump0, synopsis: key=r[P3@P4] */
+#define OP_SeekGE 23 /* jump0, synopsis: key=r[P3@P4] */
+#define OP_SeekGT 24 /* jump0, synopsis: key=r[P3@P4] */
+#define OP_IfNotOpen 25 /* jump, synopsis: if( !csr[P1] ) goto P2 */
+#define OP_IfNoHope 26 /* jump, synopsis: key=r[P3@P4] */
+#define OP_NoConflict 27 /* jump, synopsis: key=r[P3@P4] */
+#define OP_NotFound 28 /* jump, synopsis: key=r[P3@P4] */
+#define OP_Found 29 /* jump, synopsis: key=r[P3@P4] */
+#define OP_SeekRowid 30 /* jump0, synopsis: intkey=r[P3] */
+#define OP_NotExists 31 /* jump, synopsis: intkey=r[P3] */
+#define OP_Last 32 /* jump0 */
+#define OP_IfSizeBetween 33 /* jump */
+#define OP_SorterSort 34 /* jump */
+#define OP_Sort 35 /* jump */
+#define OP_Rewind 36 /* jump0 */
+#define OP_SorterNext 37 /* jump */
+#define OP_Prev 38 /* jump */
+#define OP_Next 39 /* jump */
+#define OP_IdxLE 40 /* jump, synopsis: key=r[P3@P4] */
+#define OP_IdxGT 41 /* jump, synopsis: key=r[P3@P4] */
+#define OP_IdxLT 42 /* jump, synopsis: key=r[P3@P4] */
+#define OP_Or 43 /* same as TK_OR, synopsis: r[P3]=(r[P1] || r[P2]) */
+#define OP_And 44 /* same as TK_AND, synopsis: r[P3]=(r[P1] && r[P2]) */
+#define OP_IdxGE 45 /* jump, synopsis: key=r[P3@P4] */
+#define OP_RowSetRead 46 /* jump, synopsis: r[P3]=rowset(P1) */
+#define OP_RowSetTest 47 /* jump, synopsis: if r[P3] in rowset(P1) goto P2 */
+#define OP_Program 48 /* jump0 */
+#define OP_FkIfZero 49 /* jump, synopsis: if fkctr[P1]==0 goto P2 */
+#define OP_IfPos 50 /* jump, synopsis: if r[P1]>0 then r[P1]-=P3, goto P2 */
+#define OP_IsNull 51 /* jump, same as TK_ISNULL, synopsis: if r[P1]==NULL goto P2 */
+#define OP_NotNull 52 /* jump, same as TK_NOTNULL, synopsis: if r[P1]!=NULL goto P2 */
+#define OP_Ne 53 /* jump, same as TK_NE, synopsis: IF r[P3]!=r[P1] */
+#define OP_Eq 54 /* jump, same as TK_EQ, synopsis: IF r[P3]==r[P1] */
+#define OP_Gt 55 /* jump, same as TK_GT, synopsis: IF r[P3]>r[P1] */
+#define OP_Le 56 /* jump, same as TK_LE, synopsis: IF r[P3]<=r[P1] */
+#define OP_Lt 57 /* jump, same as TK_LT, synopsis: IF r[P3]=r[P1] */
+#define OP_ElseEq 59 /* jump, same as TK_ESCAPE */
+#define OP_IfNotZero 60 /* jump, synopsis: if r[P1]!=0 then r[P1]--, goto P2 */
+#define OP_DecrJumpZero 61 /* jump, synopsis: if (--r[P1])==0 goto P2 */
+#define OP_IncrVacuum 62 /* jump */
+#define OP_VNext 63 /* jump */
+#define OP_Filter 64 /* jump, synopsis: if key(P3@P4) not in filter(P1) goto P2 */
+#define OP_PureFunc 65 /* synopsis: r[P3]=func(r[P2@NP]) */
+#define OP_Function 66 /* synopsis: r[P3]=func(r[P2@NP]) */
+#define OP_Return 67
+#define OP_EndCoroutine 68
+#define OP_HaltIfNull 69 /* synopsis: if r[P3]=null halt */
+#define OP_Halt 70
+#define OP_Integer 71 /* synopsis: r[P2]=P1 */
+#define OP_Int64 72 /* synopsis: r[P2]=P4 */
+#define OP_String 73 /* synopsis: r[P2]='P4' (len=P1) */
+#define OP_BeginSubrtn 74 /* synopsis: r[P2]=NULL */
+#define OP_Null 75 /* synopsis: r[P2..P3]=NULL */
+#define OP_SoftNull 76 /* synopsis: r[P1]=NULL */
+#define OP_Blob 77 /* synopsis: r[P2]=P4 (len=P1) */
+#define OP_Variable 78 /* synopsis: r[P2]=parameter(P1) */
+#define OP_Move 79 /* synopsis: r[P2@P3]=r[P1@P3] */
+#define OP_Copy 80 /* synopsis: r[P2@P3+1]=r[P1@P3+1] */
+#define OP_SCopy 81 /* synopsis: r[P2]=r[P1] */
+#define OP_IntCopy 82 /* synopsis: r[P2]=r[P1] */
+#define OP_FkCheck 83
+#define OP_ResultRow 84 /* synopsis: output=r[P1@P2] */
+#define OP_CollSeq 85
+#define OP_AddImm 86 /* synopsis: r[P1]=r[P1]+P2 */
+#define OP_RealAffinity 87
+#define OP_Cast 88 /* synopsis: affinity(r[P1]) */
+#define OP_Permutation 89
+#define OP_Compare 90 /* synopsis: r[P1@P3] <-> r[P2@P3] */
+#define OP_IsTrue 91 /* synopsis: r[P2] = coalesce(r[P1]==TRUE,P3) ^ P4 */
+#define OP_ZeroOrNull 92 /* synopsis: r[P2] = 0 OR NULL */
+#define OP_Offset 93 /* synopsis: r[P3] = sqlite_offset(P1) */
+#define OP_Column 94 /* synopsis: r[P3]=PX cursor P1 column P2 */
+#define OP_TypeCheck 95 /* synopsis: typecheck(r[P1@P2]) */
+#define OP_Affinity 96 /* synopsis: affinity(r[P1@P2]) */
+#define OP_MakeRecord 97 /* synopsis: r[P3]=mkrec(r[P1@P2]) */
+#define OP_Count 98 /* synopsis: r[P2]=count() */
+#define OP_ReadCookie 99
+#define OP_SetCookie 100
+#define OP_ReopenIdx 101 /* synopsis: root=P2 iDb=P3 */
+#define OP_OpenRead 102 /* synopsis: root=P2 iDb=P3 */
+#define OP_BitAnd 103 /* same as TK_BITAND, synopsis: r[P3]=r[P1]&r[P2] */
+#define OP_BitOr 104 /* same as TK_BITOR, synopsis: r[P3]=r[P1]|r[P2] */
+#define OP_ShiftLeft 105 /* same as TK_LSHIFT, synopsis: r[P3]=r[P2]<>r[P1] */
+#define OP_Add 107 /* same as TK_PLUS, synopsis: r[P3]=r[P1]+r[P2] */
+#define OP_Subtract 108 /* same as TK_MINUS, synopsis: r[P3]=r[P2]-r[P1] */
+#define OP_Multiply 109 /* same as TK_STAR, synopsis: r[P3]=r[P1]*r[P2] */
+#define OP_Divide 110 /* same as TK_SLASH, synopsis: r[P3]=r[P2]/r[P1] */
+#define OP_Remainder 111 /* same as TK_REM, synopsis: r[P3]=r[P2]%r[P1] */
+#define OP_Concat 112 /* same as TK_CONCAT, synopsis: r[P3]=r[P2]+r[P1] */
+#define OP_OpenWrite 113 /* synopsis: root=P2 iDb=P3 */
+#define OP_OpenDup 114
+#define OP_BitNot 115 /* same as TK_BITNOT, synopsis: r[P2]= ~r[P1] */
+#define OP_OpenAutoindex 116 /* synopsis: nColumn=P2 */
+#define OP_OpenEphemeral 117 /* synopsis: nColumn=P2 */
+#define OP_String8 118 /* same as TK_STRING, synopsis: r[P2]='P4' */
+#define OP_SorterOpen 119
+#define OP_SequenceTest 120 /* synopsis: if( cursor[P1].ctr++ ) pc = P2 */
+#define OP_OpenPseudo 121 /* synopsis: P3 columns in r[P2] */
+#define OP_Close 122
+#define OP_ColumnsUsed 123
+#define OP_SeekScan 124 /* synopsis: Scan-ahead up to P1 rows */
+#define OP_SeekHit 125 /* synopsis: set P2<=seekHit<=P3 */
+#define OP_Sequence 126 /* synopsis: r[P2]=cursor[P1].ctr++ */
+#define OP_NewRowid 127 /* synopsis: r[P2]=rowid */
+#define OP_Insert 128 /* synopsis: intkey=r[P3] data=r[P2] */
+#define OP_RowCell 129
+#define OP_Delete 130
+#define OP_ResetCount 131
+#define OP_SorterCompare 132 /* synopsis: if key(P1)!=trim(r[P3],P4) goto P2 */
+#define OP_SorterData 133 /* synopsis: r[P2]=data */
+#define OP_RowData 134 /* synopsis: r[P2]=data */
+#define OP_Rowid 135 /* synopsis: r[P2]=PX rowid of P1 */
+#define OP_NullRow 136
+#define OP_SeekEnd 137
+#define OP_IdxInsert 138 /* synopsis: key=r[P2] */
+#define OP_SorterInsert 139 /* synopsis: key=r[P2] */
+#define OP_IdxDelete 140 /* synopsis: key=r[P2@P3] */
+#define OP_DeferredSeek 141 /* synopsis: Move P3 to P1.rowid if needed */
+#define OP_IdxRowid 142 /* synopsis: r[P2]=rowid */
+#define OP_FinishSeek 143
+#define OP_Destroy 144
+#define OP_Clear 145
+#define OP_ResetSorter 146
+#define OP_CreateBtree 147 /* synopsis: r[P2]=root iDb=P1 flags=P3 */
+#define OP_SqlExec 148
+#define OP_ParseSchema 149
+#define OP_LoadAnalysis 150
+#define OP_DropTable 151
+#define OP_DropIndex 152
+#define OP_DropTrigger 153
+#define OP_Real 154 /* same as TK_FLOAT, synopsis: r[P2]=P4 */
+#define OP_IntegrityCk 155
+#define OP_RowSetAdd 156 /* synopsis: rowset(P1)=r[P2] */
+#define OP_Param 157
+#define OP_FkCounter 158 /* synopsis: fkctr[P1]+=P2 */
+#define OP_MemMax 159 /* synopsis: r[P1]=max(r[P1],r[P2]) */
+#define OP_OffsetLimit 160 /* synopsis: if r[P1]>0 then r[P2]=r[P1]+max(0,r[P3]) else r[P2]=(-1) */
+#define OP_AggInverse 161 /* synopsis: accum=r[P3] inverse(r[P2@P5]) */
+#define OP_AggStep 162 /* synopsis: accum=r[P3] step(r[P2@P5]) */
+#define OP_AggStep1 163 /* synopsis: accum=r[P3] step(r[P2@P5]) */
+#define OP_AggValue 164 /* synopsis: r[P3]=value N=P2 */
+#define OP_AggFinal 165 /* synopsis: accum=r[P1] N=P2 */
+#define OP_Expire 166
+#define OP_CursorLock 167
+#define OP_CursorUnlock 168
+#define OP_TableLock 169 /* synopsis: iDb=P1 root=P2 write=P3 */
+#define OP_VBegin 170
+#define OP_VCreate 171
+#define OP_VDestroy 172
+#define OP_VOpen 173
+#define OP_VCheck 174
+#define OP_VInitIn 175 /* synopsis: r[P2]=ValueList(P1,P3) */
+#define OP_VColumn 176 /* synopsis: r[P3]=vcolumn(P2) */
+#define OP_VRename 177
+#define OP_Pagecount 178
+#define OP_MaxPgcnt 179
+#define OP_ClrSubtype 180 /* synopsis: r[P1].subtype = 0 */
+#define OP_GetSubtype 181 /* synopsis: r[P2] = r[P1].subtype */
+#define OP_SetSubtype 182 /* synopsis: r[P2].subtype = r[P1] */
+#define OP_FilterAdd 183 /* synopsis: filter(P1) += key(P3@P4) */
+#define OP_Trace 184
+#define OP_CursorHint 185
+#define OP_ReleaseReg 186 /* synopsis: release r[P1@P2] mask P3 */
+#define OP_Noop 187
+#define OP_Explain 188
+#define OP_Abortable 189
+
+/* Properties such as "out2" or "jump" that are specified in
+** comments following the "case" for each opcode in the vdbe.c
+** are encoded into bitvectors as follows:
+*/
+#define OPFLG_JUMP 0x01 /* jump: P2 holds jmp target */
+#define OPFLG_IN1 0x02 /* in1: P1 is an input */
+#define OPFLG_IN2 0x04 /* in2: P2 is an input */
+#define OPFLG_IN3 0x08 /* in3: P3 is an input */
+#define OPFLG_OUT2 0x10 /* out2: P2 is an output */
+#define OPFLG_OUT3 0x20 /* out3: P3 is an output */
+#define OPFLG_NCYCLE 0x40 /* ncycle:Cycles count against P1 */
+#define OPFLG_JUMP0 0x80 /* jump0: P2 might be zero */
+#define OPFLG_INITIALIZER {\
+/* 0 */ 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x41, 0x00,\
+/* 8 */ 0x81, 0x01, 0x01, 0x81, 0x83, 0x83, 0x01, 0x01,\
+/* 16 */ 0x03, 0x03, 0x01, 0x12, 0x01, 0xc9, 0xc9, 0xc9,\
+/* 24 */ 0xc9, 0x01, 0x49, 0x49, 0x49, 0x49, 0xc9, 0x49,\
+/* 32 */ 0xc1, 0x01, 0x41, 0x41, 0xc1, 0x01, 0x41, 0x41,\
+/* 40 */ 0x41, 0x41, 0x41, 0x26, 0x26, 0x41, 0x23, 0x0b,\
+/* 48 */ 0x81, 0x01, 0x03, 0x03, 0x03, 0x0b, 0x0b, 0x0b,\
+/* 56 */ 0x0b, 0x0b, 0x0b, 0x01, 0x03, 0x03, 0x01, 0x41,\
+/* 64 */ 0x01, 0x00, 0x00, 0x02, 0x02, 0x08, 0x00, 0x10,\
+/* 72 */ 0x10, 0x10, 0x00, 0x10, 0x00, 0x10, 0x10, 0x00,\
+/* 80 */ 0x00, 0x10, 0x10, 0x00, 0x00, 0x00, 0x02, 0x02,\
+/* 88 */ 0x02, 0x00, 0x00, 0x12, 0x1e, 0x20, 0x40, 0x00,\
+/* 96 */ 0x00, 0x00, 0x10, 0x10, 0x00, 0x40, 0x40, 0x26,\
+/* 104 */ 0x26, 0x26, 0x26, 0x26, 0x26, 0x26, 0x26, 0x26,\
+/* 112 */ 0x26, 0x00, 0x40, 0x12, 0x40, 0x40, 0x10, 0x00,\
+/* 120 */ 0x00, 0x00, 0x40, 0x00, 0x40, 0x40, 0x10, 0x10,\
+/* 128 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x50,\
+/* 136 */ 0x00, 0x40, 0x04, 0x04, 0x00, 0x40, 0x50, 0x40,\
+/* 144 */ 0x10, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00,\
+/* 152 */ 0x00, 0x00, 0x10, 0x00, 0x06, 0x10, 0x00, 0x04,\
+/* 160 */ 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
+/* 168 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x10, 0x50,\
+/* 176 */ 0x40, 0x00, 0x10, 0x10, 0x02, 0x12, 0x12, 0x00,\
+/* 184 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,}
+
+/* The resolve3P2Values() routine is able to run faster if it knows
+** the value of the largest JUMP opcode. The smaller the maximum
+** JUMP opcode the better, so the mkopcodeh.tcl script that
+** generated this include file strives to group all JUMP opcodes
+** together near the beginning of the list.
+*/
+#define SQLITE_MX_JUMP_OPCODE 64 /* Maximum JUMP opcode */
+
+/************** End of opcodes.h *********************************************/
+/************** Continuing where we left off in vdbe.h ***********************/
+
+/*
+** Additional non-public SQLITE_PREPARE_* flags
+*/
+#define SQLITE_PREPARE_SAVESQL 0x80 /* Preserve SQL text */
+#define SQLITE_PREPARE_MASK 0x1f /* Mask of public flags */
+
+/*
+** Prototypes for the VDBE interface. See comments on the implementation
+** for a description of what each of these routines does.
+*/
+SQLITE_PRIVATE Vdbe *sqlite3VdbeCreate(Parse*);
+SQLITE_PRIVATE Parse *sqlite3VdbeParser(Vdbe*);
+SQLITE_PRIVATE int sqlite3VdbeAddOp0(Vdbe*,int);
+SQLITE_PRIVATE int sqlite3VdbeAddOp1(Vdbe*,int,int);
+SQLITE_PRIVATE int sqlite3VdbeAddOp2(Vdbe*,int,int,int);
+SQLITE_PRIVATE int sqlite3VdbeGoto(Vdbe*,int);
+SQLITE_PRIVATE int sqlite3VdbeLoadString(Vdbe*,int,const char*);
+SQLITE_PRIVATE void sqlite3VdbeMultiLoad(Vdbe*,int,const char*,...);
+SQLITE_PRIVATE int sqlite3VdbeAddOp3(Vdbe*,int,int,int,int);
+SQLITE_PRIVATE int sqlite3VdbeAddOp4(Vdbe*,int,int,int,int,const char *zP4,int);
+SQLITE_PRIVATE int sqlite3VdbeAddOp4Dup8(Vdbe*,int,int,int,int,const u8*,int);
+SQLITE_PRIVATE int sqlite3VdbeAddOp4Int(Vdbe*,int,int,int,int,int);
+SQLITE_PRIVATE int sqlite3VdbeAddFunctionCall(Parse*,int,int,int,int,const FuncDef*,int);
+SQLITE_PRIVATE void sqlite3VdbeEndCoroutine(Vdbe*,int);
+#if defined(SQLITE_DEBUG) && !defined(SQLITE_TEST_REALLOC_STRESS)
+SQLITE_PRIVATE void sqlite3VdbeVerifyNoMallocRequired(Vdbe *p, int N);
+SQLITE_PRIVATE void sqlite3VdbeVerifyNoResultRow(Vdbe *p);
+#else
+# define sqlite3VdbeVerifyNoMallocRequired(A,B)
+# define sqlite3VdbeVerifyNoResultRow(A)
+#endif
+#if defined(SQLITE_DEBUG)
+SQLITE_PRIVATE void sqlite3VdbeVerifyAbortable(Vdbe *p, int);
+SQLITE_PRIVATE void sqlite3VdbeNoJumpsOutsideSubrtn(Vdbe*,int,int,int);
+#else
+# define sqlite3VdbeVerifyAbortable(A,B)
+# define sqlite3VdbeNoJumpsOutsideSubrtn(A,B,C,D)
+#endif
+SQLITE_PRIVATE VdbeOp *sqlite3VdbeAddOpList(Vdbe*, int nOp, VdbeOpList const *aOp,int iLineno);
+#ifndef SQLITE_OMIT_EXPLAIN
+SQLITE_PRIVATE int sqlite3VdbeExplain(Parse*,u8,const char*,...);
+SQLITE_PRIVATE void sqlite3VdbeExplainPop(Parse*);
+SQLITE_PRIVATE int sqlite3VdbeExplainParent(Parse*);
+# define ExplainQueryPlan(P) sqlite3VdbeExplain P
+# ifdef SQLITE_ENABLE_STMT_SCANSTATUS
+# define ExplainQueryPlan2(V,P) (V = sqlite3VdbeExplain P)
+# else
+# define ExplainQueryPlan2(V,P) ExplainQueryPlan(P)
+# endif
+# define ExplainQueryPlanPop(P) sqlite3VdbeExplainPop(P)
+# define ExplainQueryPlanParent(P) sqlite3VdbeExplainParent(P)
+#else
+# define ExplainQueryPlan(P)
+# define ExplainQueryPlan2(V,P)
+# define ExplainQueryPlanPop(P)
+# define ExplainQueryPlanParent(P) 0
+# define sqlite3ExplainBreakpoint(A,B) /*no-op*/
+#endif
+#if defined(SQLITE_DEBUG) && !defined(SQLITE_OMIT_EXPLAIN)
+SQLITE_PRIVATE void sqlite3ExplainBreakpoint(const char*,const char*);
+#else
+# define sqlite3ExplainBreakpoint(A,B) /*no-op*/
+#endif
+SQLITE_PRIVATE void sqlite3VdbeAddParseSchemaOp(Vdbe*, int, char*, u16);
+SQLITE_PRIVATE void sqlite3VdbeChangeOpcode(Vdbe*, int addr, u8);
+SQLITE_PRIVATE void sqlite3VdbeChangeP1(Vdbe*, int addr, int P1);
+SQLITE_PRIVATE void sqlite3VdbeChangeP2(Vdbe*, int addr, int P2);
+SQLITE_PRIVATE void sqlite3VdbeChangeP3(Vdbe*, int addr, int P3);
+SQLITE_PRIVATE void sqlite3VdbeChangeP5(Vdbe*, u16 P5);
+SQLITE_PRIVATE void sqlite3VdbeTypeofColumn(Vdbe*, int);
+SQLITE_PRIVATE void sqlite3VdbeJumpHere(Vdbe*, int addr);
+SQLITE_PRIVATE void sqlite3VdbeJumpHereOrPopInst(Vdbe*, int addr);
+SQLITE_PRIVATE int sqlite3VdbeChangeToNoop(Vdbe*, int addr);
+SQLITE_PRIVATE int sqlite3VdbeDeletePriorOpcode(Vdbe*, u8 op);
+#ifdef SQLITE_DEBUG
+SQLITE_PRIVATE void sqlite3VdbeReleaseRegisters(Parse*,int addr, int n, u32 mask, int);
+#else
+# define sqlite3VdbeReleaseRegisters(P,A,N,M,F)
+#endif
+SQLITE_PRIVATE void sqlite3VdbeChangeP4(Vdbe*, int addr, const char *zP4, int N);
+SQLITE_PRIVATE void sqlite3VdbeAppendP4(Vdbe*, void *pP4, int p4type);
+SQLITE_PRIVATE void sqlite3VdbeSetP4KeyInfo(Parse*, Index*);
+SQLITE_PRIVATE void sqlite3VdbeUsesBtree(Vdbe*, int);
+SQLITE_PRIVATE VdbeOp *sqlite3VdbeGetOp(Vdbe*, int);
+SQLITE_PRIVATE VdbeOp *sqlite3VdbeGetLastOp(Vdbe*);
+SQLITE_PRIVATE int sqlite3VdbeMakeLabel(Parse*);
+SQLITE_PRIVATE void sqlite3VdbeRunOnlyOnce(Vdbe*);
+SQLITE_PRIVATE void sqlite3VdbeReusable(Vdbe*);
+SQLITE_PRIVATE void sqlite3VdbeDelete(Vdbe*);
+SQLITE_PRIVATE void sqlite3VdbeMakeReady(Vdbe*,Parse*);
+SQLITE_PRIVATE int sqlite3VdbeFinalize(Vdbe*);
+SQLITE_PRIVATE void sqlite3VdbeResolveLabel(Vdbe*, int);
+SQLITE_PRIVATE int sqlite3VdbeCurrentAddr(Vdbe*);
+#ifdef SQLITE_DEBUG
+SQLITE_PRIVATE int sqlite3VdbeAssertMayAbort(Vdbe *, int);
+#endif
+SQLITE_PRIVATE void sqlite3VdbeResetStepResult(Vdbe*);
+SQLITE_PRIVATE void sqlite3VdbeRewind(Vdbe*);
+SQLITE_PRIVATE int sqlite3VdbeReset(Vdbe*);
+SQLITE_PRIVATE void sqlite3VdbeSetNumCols(Vdbe*,int);
+SQLITE_PRIVATE int sqlite3VdbeSetColName(Vdbe*, int, int, const char *, void(*)(void*));
+SQLITE_PRIVATE void sqlite3VdbeCountChanges(Vdbe*);
+SQLITE_PRIVATE sqlite3 *sqlite3VdbeDb(Vdbe*);
+SQLITE_PRIVATE u8 sqlite3VdbePrepareFlags(Vdbe*);
+SQLITE_PRIVATE void sqlite3VdbeSetSql(Vdbe*, const char *z, int n, u8);
+#ifdef SQLITE_ENABLE_NORMALIZE
+SQLITE_PRIVATE void sqlite3VdbeAddDblquoteStr(sqlite3*,Vdbe*,const char*);
+SQLITE_PRIVATE int sqlite3VdbeUsesDoubleQuotedString(Vdbe*,const char*);
+#endif
+SQLITE_PRIVATE void sqlite3VdbeSwap(Vdbe*,Vdbe*);
+SQLITE_PRIVATE VdbeOp *sqlite3VdbeTakeOpArray(Vdbe*, int*, int*);
+SQLITE_PRIVATE sqlite3_value *sqlite3VdbeGetBoundValue(Vdbe*, int, u8);
+SQLITE_PRIVATE void sqlite3VdbeSetVarmask(Vdbe*, int);
+#ifndef SQLITE_OMIT_TRACE
+SQLITE_PRIVATE char *sqlite3VdbeExpandSql(Vdbe*, const char*);
+#endif
+SQLITE_PRIVATE int sqlite3MemCompare(const Mem*, const Mem*, const CollSeq*);
+SQLITE_PRIVATE int sqlite3BlobCompare(const Mem*, const Mem*);
+
+SQLITE_PRIVATE void sqlite3VdbeRecordUnpack(KeyInfo*,int,const void*,UnpackedRecord*);
+SQLITE_PRIVATE int sqlite3VdbeRecordCompare(int,const void*,UnpackedRecord*);
+SQLITE_PRIVATE int sqlite3VdbeRecordCompareWithSkip(int, const void *, UnpackedRecord *, int);
+SQLITE_PRIVATE UnpackedRecord *sqlite3VdbeAllocUnpackedRecord(KeyInfo*);
+
+typedef int (*RecordCompare)(int,const void*,UnpackedRecord*);
+SQLITE_PRIVATE RecordCompare sqlite3VdbeFindCompare(UnpackedRecord*);
+
+SQLITE_PRIVATE void sqlite3VdbeLinkSubProgram(Vdbe *, SubProgram *);
+SQLITE_PRIVATE int sqlite3VdbeHasSubProgram(Vdbe*);
+
+SQLITE_PRIVATE void sqlite3MemSetArrayInt64(sqlite3_value *aMem, int iIdx, i64 val);
+
+SQLITE_PRIVATE int sqlite3NotPureFunc(sqlite3_context*);
+#ifdef SQLITE_ENABLE_BYTECODE_VTAB
+SQLITE_PRIVATE int sqlite3VdbeBytecodeVtabInit(sqlite3*);
+#endif
+
+/* Use SQLITE_ENABLE_EXPLAIN_COMMENTS to enable generation of extra
+** comments on each VDBE opcode.
+**
+** Use the SQLITE_ENABLE_MODULE_COMMENTS macro to see some extra no-op
+** comments in VDBE programs that show key decision points in the code
+** generator.
+*/
+#ifdef SQLITE_ENABLE_EXPLAIN_COMMENTS
+SQLITE_PRIVATE void sqlite3VdbeComment(Vdbe*, const char*, ...);
+# define VdbeComment(X) sqlite3VdbeComment X
+SQLITE_PRIVATE void sqlite3VdbeNoopComment(Vdbe*, const char*, ...);
+# define VdbeNoopComment(X) sqlite3VdbeNoopComment X
+# ifdef SQLITE_ENABLE_MODULE_COMMENTS
+# define VdbeModuleComment(X) sqlite3VdbeNoopComment X
+# else
+# define VdbeModuleComment(X)
+# endif
+#else
+# define VdbeComment(X)
+# define VdbeNoopComment(X)
+# define VdbeModuleComment(X)
+#endif
+
+/*
+** The VdbeCoverage macros are used to set a coverage testing point
+** for VDBE branch instructions. The coverage testing points are line
+** numbers in the sqlite3.c source file. VDBE branch coverage testing
+** only works with an amalgamation build. That's ok since a VDBE branch
+** coverage build designed for testing the test suite only. No application
+** should ever ship with VDBE branch coverage measuring turned on.
+**
+** VdbeCoverage(v) // Mark the previously coded instruction
+** // as a branch
+**
+** VdbeCoverageIf(v, conditional) // Mark previous if conditional true
+**
+** VdbeCoverageAlwaysTaken(v) // Previous branch is always taken
+**
+** VdbeCoverageNeverTaken(v) // Previous branch is never taken
+**
+** VdbeCoverageNeverNull(v) // Previous three-way branch is only
+** // taken on the first two ways. The
+** // NULL option is not possible
+**
+** VdbeCoverageEqNe(v) // Previous OP_Jump is only interested
+** // in distinguishing equal and not-equal.
+**
+** Every VDBE branch operation must be tagged with one of the macros above.
+** If not, then when "make test" is run with -DSQLITE_VDBE_COVERAGE and
+** -DSQLITE_DEBUG then an ALWAYS() will fail in the vdbeTakeBranch()
+** routine in vdbe.c, alerting the developer to the missed tag.
+**
+** During testing, the test application will invoke
+** sqlite3_test_control(SQLITE_TESTCTRL_VDBE_COVERAGE,...) to set a callback
+** routine that is invoked as each bytecode branch is taken. The callback
+** contains the sqlite3.c source line number of the VdbeCoverage macro and
+** flags to indicate whether or not the branch was taken. The test application
+** is responsible for keeping track of this and reporting byte-code branches
+** that are never taken.
+**
+** See the VdbeBranchTaken() macro and vdbeTakeBranch() function in the
+** vdbe.c source file for additional information.
+*/
+#ifdef SQLITE_VDBE_COVERAGE
+SQLITE_PRIVATE void sqlite3VdbeSetLineNumber(Vdbe*,int);
+# define VdbeCoverage(v) sqlite3VdbeSetLineNumber(v,__LINE__)
+# define VdbeCoverageIf(v,x) if(x)sqlite3VdbeSetLineNumber(v,__LINE__)
+# define VdbeCoverageAlwaysTaken(v) \
+ sqlite3VdbeSetLineNumber(v,__LINE__|0x5000000);
+# define VdbeCoverageNeverTaken(v) \
+ sqlite3VdbeSetLineNumber(v,__LINE__|0x6000000);
+# define VdbeCoverageNeverNull(v) \
+ sqlite3VdbeSetLineNumber(v,__LINE__|0x4000000);
+# define VdbeCoverageNeverNullIf(v,x) \
+ if(x)sqlite3VdbeSetLineNumber(v,__LINE__|0x4000000);
+# define VdbeCoverageEqNe(v) \
+ sqlite3VdbeSetLineNumber(v,__LINE__|0x8000000);
+# define VDBE_OFFSET_LINENO(x) (__LINE__+x)
+#else
+# define VdbeCoverage(v)
+# define VdbeCoverageIf(v,x)
+# define VdbeCoverageAlwaysTaken(v)
+# define VdbeCoverageNeverTaken(v)
+# define VdbeCoverageNeverNull(v)
+# define VdbeCoverageNeverNullIf(v,x)
+# define VdbeCoverageEqNe(v)
+# define VDBE_OFFSET_LINENO(x) 0
+#endif
+
+#ifdef SQLITE_ENABLE_STMT_SCANSTATUS
+SQLITE_PRIVATE void sqlite3VdbeScanStatus(Vdbe*, int, int, int, LogEst, const char*);
+SQLITE_PRIVATE void sqlite3VdbeScanStatusRange(Vdbe*, int, int, int);
+SQLITE_PRIVATE void sqlite3VdbeScanStatusCounters(Vdbe*, int, int, int);
+#else
+# define sqlite3VdbeScanStatus(a,b,c,d,e,f)
+# define sqlite3VdbeScanStatusRange(a,b,c,d)
+# define sqlite3VdbeScanStatusCounters(a,b,c,d)
+#endif
+
+#if defined(SQLITE_DEBUG) || defined(VDBE_PROFILE)
+SQLITE_PRIVATE void sqlite3VdbePrintOp(FILE*, int, VdbeOp*);
+#endif
+
+#if defined(SQLITE_ENABLE_CURSOR_HINTS) && defined(SQLITE_DEBUG)
+SQLITE_PRIVATE int sqlite3CursorRangeHintExprCheck(Walker *pWalker, Expr *pExpr);
+#endif
+
+#endif /* SQLITE_VDBE_H */
+
+/************** End of vdbe.h ************************************************/
+/************** Continuing where we left off in sqliteInt.h ******************/
+/************** Include pcache.h in the middle of sqliteInt.h ****************/
+/************** Begin file pcache.h ******************************************/
+/*
+** 2008 August 05
+**
+** The author disclaims copyright to this source code. In place of
+** a legal notice, here is a blessing:
+**
+** May you do good and not evil.
+** May you find forgiveness for yourself and forgive others.
+** May you share freely, never taking more than you give.
+**
+*************************************************************************
+** This header file defines the interface that the sqlite page cache
+** subsystem.
+*/
+
+#ifndef _PCACHE_H_
+
+typedef struct PgHdr PgHdr;
+typedef struct PCache PCache;
+
+/*
+** Every page in the cache is controlled by an instance of the following
+** structure.
+*/
+struct PgHdr {
+ sqlite3_pcache_page *pPage; /* Pcache object page handle */
+ void *pData; /* Page data */
+ void *pExtra; /* Extra content */
+ PCache *pCache; /* PRIVATE: Cache that owns this page */
+ PgHdr *pDirty; /* Transient list of dirty sorted by pgno */
+ Pager *pPager; /* The pager this page is part of */
+ Pgno pgno; /* Page number for this page */
+#ifdef SQLITE_CHECK_PAGES
+ u32 pageHash; /* Hash of page content */
+#endif
+ u16 flags; /* PGHDR flags defined below */
+
+ /**********************************************************************
+ ** Elements above, except pCache, are public. All that follow are
+ ** private to pcache.c and should not be accessed by other modules.
+ ** pCache is grouped with the public elements for efficiency.
+ */
+ i64 nRef; /* Number of users of this page */
+ PgHdr *pDirtyNext; /* Next element in list of dirty pages */
+ PgHdr *pDirtyPrev; /* Previous element in list of dirty pages */
+ /* NB: pDirtyNext and pDirtyPrev are undefined if the
+ ** PgHdr object is not dirty */
+};
+
+/* Bit values for PgHdr.flags */
+#define PGHDR_CLEAN 0x001 /* Page not on the PCache.pDirty list */
+#define PGHDR_DIRTY 0x002 /* Page is on the PCache.pDirty list */
+#define PGHDR_WRITEABLE 0x004 /* Journaled and ready to modify */
+#define PGHDR_NEED_SYNC 0x008 /* Fsync the rollback journal before
+ ** writing this page to the database */
+#define PGHDR_DONT_WRITE 0x010 /* Do not write content to disk */
+#define PGHDR_MMAP 0x020 /* This is an mmap page object */
+
+#define PGHDR_WAL_APPEND 0x040 /* Appended to wal file */
+
+/* Initialize and shutdown the page cache subsystem */
+SQLITE_PRIVATE int sqlite3PcacheInitialize(void);
+SQLITE_PRIVATE void sqlite3PcacheShutdown(void);
+
+/* Page cache buffer management:
+** These routines implement SQLITE_CONFIG_PAGECACHE.
+*/
+SQLITE_PRIVATE void sqlite3PCacheBufferSetup(void *, int sz, int n);
+
+/* Create a new pager cache.
+** Under memory stress, invoke xStress to try to make pages clean.
+** Only clean and unpinned pages can be reclaimed.
+*/
+SQLITE_PRIVATE int sqlite3PcacheOpen(
+ int szPage, /* Size of every page */
+ int szExtra, /* Extra space associated with each page */
+ int bPurgeable, /* True if pages are on backing store */
+ int (*xStress)(void*, PgHdr*), /* Call to try to make pages clean */
+ void *pStress, /* Argument to xStress */
+ PCache *pToInit /* Preallocated space for the PCache */
+);
+
+/* Modify the page-size after the cache has been created. */
+SQLITE_PRIVATE int sqlite3PcacheSetPageSize(PCache *, int);
+
+/* Return the size in bytes of a PCache object. Used to preallocate
+** storage space.
+*/
+SQLITE_PRIVATE int sqlite3PcacheSize(void);
+
+/* One release per successful fetch. Page is pinned until released.
+** Reference counted.
+*/
+SQLITE_PRIVATE sqlite3_pcache_page *sqlite3PcacheFetch(PCache*, Pgno, int createFlag);
+SQLITE_PRIVATE int sqlite3PcacheFetchStress(PCache*, Pgno, sqlite3_pcache_page**);
+SQLITE_PRIVATE PgHdr *sqlite3PcacheFetchFinish(PCache*, Pgno, sqlite3_pcache_page *pPage);
+SQLITE_PRIVATE void sqlite3PcacheRelease(PgHdr*);
+
+SQLITE_PRIVATE void sqlite3PcacheDrop(PgHdr*); /* Remove page from cache */
+SQLITE_PRIVATE void sqlite3PcacheMakeDirty(PgHdr*); /* Make sure page is marked dirty */
+SQLITE_PRIVATE void sqlite3PcacheMakeClean(PgHdr*); /* Mark a single page as clean */
+SQLITE_PRIVATE void sqlite3PcacheCleanAll(PCache*); /* Mark all dirty list pages as clean */
+SQLITE_PRIVATE void sqlite3PcacheClearWritable(PCache*);
+
+/* Change a page number. Used by incr-vacuum. */
+SQLITE_PRIVATE void sqlite3PcacheMove(PgHdr*, Pgno);
+
+/* Remove all pages with pgno>x. Reset the cache if x==0 */
+SQLITE_PRIVATE void sqlite3PcacheTruncate(PCache*, Pgno x);
+
+/* Get a list of all dirty pages in the cache, sorted by page number */
+SQLITE_PRIVATE PgHdr *sqlite3PcacheDirtyList(PCache*);
+
+/* Reset and close the cache object */
+SQLITE_PRIVATE void sqlite3PcacheClose(PCache*);
+
+/* Clear flags from pages of the page cache */
+SQLITE_PRIVATE void sqlite3PcacheClearSyncFlags(PCache *);
+
+/* Discard the contents of the cache */
+SQLITE_PRIVATE void sqlite3PcacheClear(PCache*);
+
+/* Return the total number of outstanding page references */
+SQLITE_PRIVATE i64 sqlite3PcacheRefCount(PCache*);
+
+/* Increment the reference count of an existing page */
+SQLITE_PRIVATE void sqlite3PcacheRef(PgHdr*);
+
+SQLITE_PRIVATE i64 sqlite3PcachePageRefcount(PgHdr*);
+
+/* Return the total number of pages stored in the cache */
+SQLITE_PRIVATE int sqlite3PcachePagecount(PCache*);
+
+#if defined(SQLITE_CHECK_PAGES) || defined(SQLITE_DEBUG)
+/* Iterate through all dirty pages currently stored in the cache. This
+** interface is only available if SQLITE_CHECK_PAGES is defined when the
+** library is built.
+*/
+SQLITE_PRIVATE void sqlite3PcacheIterateDirty(PCache *pCache, void (*xIter)(PgHdr *));
+#endif
+
+#if defined(SQLITE_DEBUG)
+/* Check invariants on a PgHdr object */
+SQLITE_PRIVATE int sqlite3PcachePageSanity(PgHdr*);
+#endif
+
+/* Set and get the suggested cache-size for the specified pager-cache.
+**
+** If no global maximum is configured, then the system attempts to limit
+** the total number of pages cached by purgeable pager-caches to the sum
+** of the suggested cache-sizes.
+*/
+SQLITE_PRIVATE void sqlite3PcacheSetCachesize(PCache *, int);
+#ifdef SQLITE_TEST
+SQLITE_PRIVATE int sqlite3PcacheGetCachesize(PCache *);
+#endif
+
+/* Set or get the suggested spill-size for the specified pager-cache.
+**
+** The spill-size is the minimum number of pages in cache before the cache
+** will attempt to spill dirty pages by calling xStress.
+*/
+SQLITE_PRIVATE int sqlite3PcacheSetSpillsize(PCache *, int);
+
+/* Free up as much memory as possible from the page cache */
+SQLITE_PRIVATE void sqlite3PcacheShrink(PCache*);
+
+#ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
+/* Try to return memory used by the pcache module to the main memory heap */
+SQLITE_PRIVATE int sqlite3PcacheReleaseMemory(int);
+#endif
+
+#ifdef SQLITE_TEST
+SQLITE_PRIVATE void sqlite3PcacheStats(int*,int*,int*,int*);
+#endif
+
+SQLITE_PRIVATE void sqlite3PCacheSetDefault(void);
+
+/* Return the header size */
+SQLITE_PRIVATE int sqlite3HeaderSizePcache(void);
+SQLITE_PRIVATE int sqlite3HeaderSizePcache1(void);
+
+/* Number of dirty pages as a percentage of the configured cache size */
+SQLITE_PRIVATE int sqlite3PCachePercentDirty(PCache*);
+
+#ifdef SQLITE_DIRECT_OVERFLOW_READ
+SQLITE_PRIVATE int sqlite3PCacheIsDirty(PCache *pCache);
+#endif
+
+#endif /* _PCACHE_H_ */
+
+/************** End of pcache.h **********************************************/
+/************** Continuing where we left off in sqliteInt.h ******************/
+/************** Include mutex.h in the middle of sqliteInt.h *****************/
+/************** Begin file mutex.h *******************************************/
+/*
+** 2007 August 28
+**
+** The author disclaims copyright to this source code. In place of
+** a legal notice, here is a blessing:
+**
+** May you do good and not evil.
+** May you find forgiveness for yourself and forgive others.
+** May you share freely, never taking more than you give.
+**
+*************************************************************************
+**
+** This file contains the common header for all mutex implementations.
+** The sqliteInt.h header #includes this file so that it is available
+** to all source files. We break it out in an effort to keep the code
+** better organized.
+**
+** NOTE: source files should *not* #include this header file directly.
+** Source files should #include the sqliteInt.h file and let that file
+** include this one indirectly.
+*/
+
+
+/*
+** Figure out what version of the code to use. The choices are
+**
+** SQLITE_MUTEX_OMIT No mutex logic. Not even stubs. The
+** mutexes implementation cannot be overridden
+** at start-time.
+**
+** SQLITE_MUTEX_NOOP For single-threaded applications. No
+** mutual exclusion is provided. But this
+** implementation can be overridden at
+** start-time.
+**
+** SQLITE_MUTEX_PTHREADS For multi-threaded applications on Unix.
+**
+** SQLITE_MUTEX_W32 For multi-threaded applications on Win32.
+*/
+#if !SQLITE_THREADSAFE
+# define SQLITE_MUTEX_OMIT
+#endif
+#if SQLITE_THREADSAFE && !defined(SQLITE_MUTEX_NOOP)
+# if SQLITE_OS_UNIX
+# define SQLITE_MUTEX_PTHREADS
+# elif SQLITE_OS_WIN
+# define SQLITE_MUTEX_W32
+# else
+# define SQLITE_MUTEX_NOOP
+# endif
+#endif
+
+#ifdef SQLITE_MUTEX_OMIT
+/*
+** If this is a no-op implementation, implement everything as macros.
+*/
+#define sqlite3_mutex_alloc(X) ((sqlite3_mutex*)8)
+#define sqlite3_mutex_free(X)
+#define sqlite3_mutex_enter(X)
+#define sqlite3_mutex_try(X) SQLITE_OK
+#define sqlite3_mutex_leave(X)
+#define sqlite3_mutex_held(X) ((void)(X),1)
+#define sqlite3_mutex_notheld(X) ((void)(X),1)
+#define sqlite3MutexAlloc(X) ((sqlite3_mutex*)8)
+#define sqlite3MutexInit() SQLITE_OK
+#define sqlite3MutexEnd()
+#define MUTEX_LOGIC(X)
+#else
+#define MUTEX_LOGIC(X) X
+SQLITE_API int sqlite3_mutex_held(sqlite3_mutex*);
+#endif /* defined(SQLITE_MUTEX_OMIT) */
+
+/************** End of mutex.h ***********************************************/
+/************** Continuing where we left off in sqliteInt.h ******************/
+
+/* The SQLITE_EXTRA_DURABLE compile-time option used to set the default
+** synchronous setting to EXTRA. It is no longer supported.
+*/
+#ifdef SQLITE_EXTRA_DURABLE
+# warning Use SQLITE_DEFAULT_SYNCHRONOUS=3 instead of SQLITE_EXTRA_DURABLE
+# define SQLITE_DEFAULT_SYNCHRONOUS 3
+#endif
+
+/*
+** Default synchronous levels.
+**
+** Note that (for historical reasons) the PAGER_SYNCHRONOUS_* macros differ
+** from the SQLITE_DEFAULT_SYNCHRONOUS value by 1.
+**
+** PAGER_SYNCHRONOUS DEFAULT_SYNCHRONOUS
+** OFF 1 0
+** NORMAL 2 1
+** FULL 3 2
+** EXTRA 4 3
+**
+** The "PRAGMA synchronous" statement also uses the zero-based numbers.
+** In other words, the zero-based numbers are used for all external interfaces
+** and the one-based values are used internally.
+*/
+#ifndef SQLITE_DEFAULT_SYNCHRONOUS
+# define SQLITE_DEFAULT_SYNCHRONOUS 2
+#endif
+#ifndef SQLITE_DEFAULT_WAL_SYNCHRONOUS
+# define SQLITE_DEFAULT_WAL_SYNCHRONOUS SQLITE_DEFAULT_SYNCHRONOUS
+#endif
+
+/*
+** Each database file to be accessed by the system is an instance
+** of the following structure. There are normally two of these structures
+** in the sqlite.aDb[] array. aDb[0] is the main database file and
+** aDb[1] is the database file used to hold temporary tables. Additional
+** databases may be attached.
+*/
+struct Db {
+ char *zDbSName; /* Name of this database. (schema name, not filename) */
+ Btree *pBt; /* The B*Tree structure for this database file */
+ u8 safety_level; /* How aggressive at syncing data to disk */
+ u8 bSyncSet; /* True if "PRAGMA synchronous=N" has been run */
+ Schema *pSchema; /* Pointer to database schema (possibly shared) */
+};
+
+/*
+** An instance of the following structure stores a database schema.
+**
+** Most Schema objects are associated with a Btree. The exception is
+** the Schema for the TEMP database (sqlite3.aDb[1]) which is free-standing.
+** In shared cache mode, a single Schema object can be shared by multiple
+** Btrees that refer to the same underlying BtShared object.
+**
+** Schema objects are automatically deallocated when the last Btree that
+** references them is destroyed. The TEMP Schema is manually freed by
+** sqlite3_close().
+*
+** A thread must be holding a mutex on the corresponding Btree in order
+** to access Schema content. This implies that the thread must also be
+** holding a mutex on the sqlite3 connection pointer that owns the Btree.
+** For a TEMP Schema, only the connection mutex is required.
+*/
+struct Schema {
+ int schema_cookie; /* Database schema version number for this file */
+ int iGeneration; /* Generation counter. Incremented with each change */
+ Hash tblHash; /* All tables indexed by name */
+ Hash idxHash; /* All (named) indices indexed by name */
+ Hash trigHash; /* All triggers indexed by name */
+ Hash fkeyHash; /* All foreign keys by referenced table name */
+ Table *pSeqTab; /* The sqlite_sequence table used by AUTOINCREMENT */
+ u8 file_format; /* Schema format version for this file */
+ u8 enc; /* Text encoding used by this database */
+ u16 schemaFlags; /* Flags associated with this schema */
+ int cache_size; /* Number of pages to use in the cache */
+};
+
+/*
+** These macros can be used to test, set, or clear bits in the
+** Db.pSchema->flags field.
+*/
+#define DbHasProperty(D,I,P) (((D)->aDb[I].pSchema->schemaFlags&(P))==(P))
+#define DbHasAnyProperty(D,I,P) (((D)->aDb[I].pSchema->schemaFlags&(P))!=0)
+#define DbSetProperty(D,I,P) (D)->aDb[I].pSchema->schemaFlags|=(P)
+#define DbClearProperty(D,I,P) (D)->aDb[I].pSchema->schemaFlags&=~(P)
+
+/*
+** Allowed values for the DB.pSchema->flags field.
+**
+** The DB_SchemaLoaded flag is set after the database schema has been
+** read into internal hash tables.
+**
+** DB_UnresetViews means that one or more views have column names that
+** have been filled out. If the schema changes, these column names might
+** changes and so the view will need to be reset.
+*/
+#define DB_SchemaLoaded 0x0001 /* The schema has been loaded */
+#define DB_UnresetViews 0x0002 /* Some views have defined column names */
+#define DB_ResetWanted 0x0008 /* Reset the schema when nSchemaLock==0 */
+
+/*
+** The number of different kinds of things that can be limited
+** using the sqlite3_limit() interface.
+*/
+#define SQLITE_N_LIMIT (SQLITE_LIMIT_WORKER_THREADS+1)
+
+/*
+** Lookaside malloc is a set of fixed-size buffers that can be used
+** to satisfy small transient memory allocation requests for objects
+** associated with a particular database connection. The use of
+** lookaside malloc provides a significant performance enhancement
+** (approx 10%) by avoiding numerous malloc/free requests while parsing
+** SQL statements.
+**
+** The Lookaside structure holds configuration information about the
+** lookaside malloc subsystem. Each available memory allocation in
+** the lookaside subsystem is stored on a linked list of LookasideSlot
+** objects.
+**
+** Lookaside allocations are only allowed for objects that are associated
+** with a particular database connection. Hence, schema information cannot
+** be stored in lookaside because in shared cache mode the schema information
+** is shared by multiple database connections. Therefore, while parsing
+** schema information, the Lookaside.bEnabled flag is cleared so that
+** lookaside allocations are not used to construct the schema objects.
+**
+** New lookaside allocations are only allowed if bDisable==0. When
+** bDisable is greater than zero, sz is set to zero which effectively
+** disables lookaside without adding a new test for the bDisable flag
+** in a performance-critical path. sz should be set by to szTrue whenever
+** bDisable changes back to zero.
+**
+** Lookaside buffers are initially held on the pInit list. As they are
+** used and freed, they are added back to the pFree list. New allocations
+** come off of pFree first, then pInit as a fallback. This dual-list
+** allows use to compute a high-water mark - the maximum number of allocations
+** outstanding at any point in the past - by subtracting the number of
+** allocations on the pInit list from the total number of allocations.
+**
+** Enhancement on 2019-12-12: Two-size-lookaside
+** The default lookaside configuration is 100 slots of 1200 bytes each.
+** The larger slot sizes are important for performance, but they waste
+** a lot of space, as most lookaside allocations are less than 128 bytes.
+** The two-size-lookaside enhancement breaks up the lookaside allocation
+** into two pools: One of 128-byte slots and the other of the default size
+** (1200-byte) slots. Allocations are filled from the small-pool first,
+** failing over to the full-size pool if that does not work. Thus more
+** lookaside slots are available while also using less memory.
+** This enhancement can be omitted by compiling with
+** SQLITE_OMIT_TWOSIZE_LOOKASIDE.
+*/
+struct Lookaside {
+ u32 bDisable; /* Only operate the lookaside when zero */
+ u16 sz; /* Size of each buffer in bytes */
+ u16 szTrue; /* True value of sz, even if disabled */
+ u8 bMalloced; /* True if pStart obtained from sqlite3_malloc() */
+ u32 nSlot; /* Number of lookaside slots allocated */
+ u32 anStat[3]; /* 0: hits. 1: size misses. 2: full misses */
+ LookasideSlot *pInit; /* List of buffers not previously used */
+ LookasideSlot *pFree; /* List of available buffers */
+#ifndef SQLITE_OMIT_TWOSIZE_LOOKASIDE
+ LookasideSlot *pSmallInit; /* List of small buffers not previously used */
+ LookasideSlot *pSmallFree; /* List of available small buffers */
+ void *pMiddle; /* First byte past end of full-size buffers and
+ ** the first byte of LOOKASIDE_SMALL buffers */
+#endif /* SQLITE_OMIT_TWOSIZE_LOOKASIDE */
+ void *pStart; /* First byte of available memory space */
+ void *pEnd; /* First byte past end of available space */
+ void *pTrueEnd; /* True value of pEnd, when db->pnBytesFreed!=0 */
+};
+struct LookasideSlot {
+ LookasideSlot *pNext; /* Next buffer in the list of free buffers */
+};
+
+#define DisableLookaside db->lookaside.bDisable++;db->lookaside.sz=0
+#define EnableLookaside db->lookaside.bDisable--;\
+ db->lookaside.sz=db->lookaside.bDisable?0:db->lookaside.szTrue
+
+/* Size of the smaller allocations in two-size lookaside */
+#ifdef SQLITE_OMIT_TWOSIZE_LOOKASIDE
+# define LOOKASIDE_SMALL 0
+#else
+# define LOOKASIDE_SMALL 128
+#endif
+
+/*
+** A hash table for built-in function definitions. (Application-defined
+** functions use a regular table table from hash.h.)
+**
+** Hash each FuncDef structure into one of the FuncDefHash.a[] slots.
+** Collisions are on the FuncDef.u.pHash chain. Use the SQLITE_FUNC_HASH()
+** macro to compute a hash on the function name.
+*/
+#define SQLITE_FUNC_HASH_SZ 23
+struct FuncDefHash {
+ FuncDef *a[SQLITE_FUNC_HASH_SZ]; /* Hash table for functions */
+};
+#define SQLITE_FUNC_HASH(C,L) (((C)+(L))%SQLITE_FUNC_HASH_SZ)
+
+/*
+** typedef for the authorization callback function.
+*/
+typedef int (*sqlite3_xauth)(void*,int,const char*,const char*,const char*,
+ const char*);
+
+#ifndef SQLITE_OMIT_DEPRECATED
+/* This is an extra SQLITE_TRACE macro that indicates "legacy" tracing
+** in the style of sqlite3_trace()
+*/
+#define SQLITE_TRACE_LEGACY 0x40 /* Use the legacy xTrace */
+#define SQLITE_TRACE_XPROFILE 0x80 /* Use the legacy xProfile */
+#else
+#define SQLITE_TRACE_LEGACY 0
+#define SQLITE_TRACE_XPROFILE 0
+#endif /* SQLITE_OMIT_DEPRECATED */
+#define SQLITE_TRACE_NONLEGACY_MASK 0x0f /* Normal flags */
+
+/*
+** Maximum number of sqlite3.aDb[] entries. This is the number of attached
+** databases plus 2 for "main" and "temp".
+*/
+#define SQLITE_MAX_DB (SQLITE_MAX_ATTACHED+2)
+
+/*
+** Each database connection is an instance of the following structure.
+*/
+struct sqlite3 {
+ sqlite3_vfs *pVfs; /* OS Interface */
+ struct Vdbe *pVdbe; /* List of active virtual machines */
+ CollSeq *pDfltColl; /* BINARY collseq for the database encoding */
+ sqlite3_mutex *mutex; /* Connection mutex */
+ Db *aDb; /* All backends */
+ int nDb; /* Number of backends currently in use */
+ u32 mDbFlags; /* flags recording internal state */
+ u64 flags; /* flags settable by pragmas. See below */
+ i64 lastRowid; /* ROWID of most recent insert (see above) */
+ i64 szMmap; /* Default mmap_size setting */
+ u32 nSchemaLock; /* Do not reset the schema when non-zero */
+ unsigned int openFlags; /* Flags passed to sqlite3_vfs.xOpen() */
+ int errCode; /* Most recent error code (SQLITE_*) */
+ int errByteOffset; /* Byte offset of error in SQL statement */
+ int errMask; /* & result codes with this before returning */
+ int iSysErrno; /* Errno value from last system error */
+ u32 dbOptFlags; /* Flags to enable/disable optimizations */
+ u8 enc; /* Text encoding */
+ u8 autoCommit; /* The auto-commit flag. */
+ u8 temp_store; /* 1: file 2: memory 0: default */
+ u8 mallocFailed; /* True if we have seen a malloc failure */
+ u8 bBenignMalloc; /* Do not require OOMs if true */
+ u8 dfltLockMode; /* Default locking-mode for attached dbs */
+ signed char nextAutovac; /* Autovac setting after VACUUM if >=0 */
+ u8 suppressErr; /* Do not issue error messages if true */
+ u8 vtabOnConflict; /* Value to return for s3_vtab_on_conflict() */
+ u8 isTransactionSavepoint; /* True if the outermost savepoint is a TS */
+ u8 mTrace; /* zero or more SQLITE_TRACE flags */
+ u8 noSharedCache; /* True if no shared-cache backends */
+ u8 nSqlExec; /* Number of pending OP_SqlExec opcodes */
+ u8 eOpenState; /* Current condition of the connection */
+ int nextPagesize; /* Pagesize after VACUUM if >0 */
+ i64 nChange; /* Value returned by sqlite3_changes() */
+ i64 nTotalChange; /* Value returned by sqlite3_total_changes() */
+ int aLimit[SQLITE_N_LIMIT]; /* Limits */
+ int nMaxSorterMmap; /* Maximum size of regions mapped by sorter */
+ struct sqlite3InitInfo { /* Information used during initialization */
+ Pgno newTnum; /* Rootpage of table being initialized */
+ u8 iDb; /* Which db file is being initialized */
+ u8 busy; /* TRUE if currently initializing */
+ unsigned orphanTrigger : 1; /* Last statement is orphaned TEMP trigger */
+ unsigned imposterTable : 1; /* Building an imposter table */
+ unsigned reopenMemdb : 1; /* ATTACH is really a reopen using MemDB */
+ const char **azInit; /* "type", "name", and "tbl_name" columns */
+ } init;
+ int nVdbeActive; /* Number of VDBEs currently running */
+ int nVdbeRead; /* Number of active VDBEs that read or write */
+ int nVdbeWrite; /* Number of active VDBEs that read and write */
+ int nVdbeExec; /* Number of nested calls to VdbeExec() */
+ int nVDestroy; /* Number of active OP_VDestroy operations */
+ int nExtension; /* Number of loaded extensions */
+ void **aExtension; /* Array of shared library handles */
+ union {
+ void (*xLegacy)(void*,const char*); /* mTrace==SQLITE_TRACE_LEGACY */
+ int (*xV2)(u32,void*,void*,void*); /* All other mTrace values */
+ } trace;
+ void *pTraceArg; /* Argument to the trace function */
+#ifndef SQLITE_OMIT_DEPRECATED
+ void (*xProfile)(void*,const char*,u64); /* Profiling function */
+ void *pProfileArg; /* Argument to profile function */
+#endif
+ void *pCommitArg; /* Argument to xCommitCallback() */
+ int (*xCommitCallback)(void*); /* Invoked at every commit. */
+ void *pRollbackArg; /* Argument to xRollbackCallback() */
+ void (*xRollbackCallback)(void*); /* Invoked at every commit. */
+ void *pUpdateArg;
+ void (*xUpdateCallback)(void*,int, const char*,const char*,sqlite_int64);
+ void *pAutovacPagesArg; /* Client argument to autovac_pages */
+ void (*xAutovacDestr)(void*); /* Destructor for pAutovacPAgesArg */
+ unsigned int (*xAutovacPages)(void*,const char*,u32,u32,u32);
+ Parse *pParse; /* Current parse */
+#ifdef SQLITE_ENABLE_PREUPDATE_HOOK
+ void *pPreUpdateArg; /* First argument to xPreUpdateCallback */
+ void (*xPreUpdateCallback)( /* Registered using sqlite3_preupdate_hook() */
+ void*,sqlite3*,int,char const*,char const*,sqlite3_int64,sqlite3_int64
+ );
+ PreUpdate *pPreUpdate; /* Context for active pre-update callback */
+#endif /* SQLITE_ENABLE_PREUPDATE_HOOK */
+#ifndef SQLITE_OMIT_WAL
+ int (*xWalCallback)(void *, sqlite3 *, const char *, int);
+ void *pWalArg;
+#endif
+ void(*xCollNeeded)(void*,sqlite3*,int eTextRep,const char*);
+ void(*xCollNeeded16)(void*,sqlite3*,int eTextRep,const void*);
+ void *pCollNeededArg;
+ sqlite3_value *pErr; /* Most recent error message */
+ union {
+ volatile int isInterrupted; /* True if sqlite3_interrupt has been called */
+ double notUsed1; /* Spacer */
+ } u1;
+ Lookaside lookaside; /* Lookaside malloc configuration */
+#ifndef SQLITE_OMIT_AUTHORIZATION
+ sqlite3_xauth xAuth; /* Access authorization function */
+ void *pAuthArg; /* 1st argument to the access auth function */
+#endif
+#ifndef SQLITE_OMIT_PROGRESS_CALLBACK
+ int (*xProgress)(void *); /* The progress callback */
+ void *pProgressArg; /* Argument to the progress callback */
+ unsigned nProgressOps; /* Number of opcodes for progress callback */
+#endif
+#ifndef SQLITE_OMIT_VIRTUALTABLE
+ int nVTrans; /* Allocated size of aVTrans */
+ Hash aModule; /* populated by sqlite3_create_module() */
+ VtabCtx *pVtabCtx; /* Context for active vtab connect/create */
+ VTable **aVTrans; /* Virtual tables with open transactions */
+ VTable *pDisconnect; /* Disconnect these in next sqlite3_prepare() */
+#endif
+ Hash aFunc; /* Hash table of connection functions */
+ Hash aCollSeq; /* All collating sequences */
+ BusyHandler busyHandler; /* Busy callback */
+ Db aDbStatic[2]; /* Static space for the 2 default backends */
+ Savepoint *pSavepoint; /* List of active savepoints */
+ int nAnalysisLimit; /* Number of index rows to ANALYZE */
+ int busyTimeout; /* Busy handler timeout, in msec */
+#ifdef SQLITE_ENABLE_SETLK_TIMEOUT
+ int setlkTimeout; /* Blocking lock timeout, in msec. -1 -> inf. */
+ int setlkFlags; /* Flags passed to setlk_timeout() */
+#endif
+ int nSavepoint; /* Number of non-transaction savepoints */
+ int nStatement; /* Number of nested statement-transactions */
+ i64 nDeferredCons; /* Net deferred constraints this transaction. */
+ i64 nDeferredImmCons; /* Net deferred immediate constraints */
+ int *pnBytesFreed; /* If not NULL, increment this in DbFree() */
+ DbClientData *pDbData; /* sqlite3_set_clientdata() content */
+#ifdef SQLITE_ENABLE_UNLOCK_NOTIFY
+ /* The following variables are all protected by the STATIC_MAIN
+ ** mutex, not by sqlite3.mutex. They are used by code in notify.c.
+ **
+ ** When X.pUnlockConnection==Y, that means that X is waiting for Y to
+ ** unlock so that it can proceed.
+ **
+ ** When X.pBlockingConnection==Y, that means that something that X tried
+ ** tried to do recently failed with an SQLITE_LOCKED error due to locks
+ ** held by Y.
+ */
+ sqlite3 *pBlockingConnection; /* Connection that caused SQLITE_LOCKED */
+ sqlite3 *pUnlockConnection; /* Connection to watch for unlock */
+ void *pUnlockArg; /* Argument to xUnlockNotify */
+ void (*xUnlockNotify)(void **, int); /* Unlock notify callback */
+ sqlite3 *pNextBlocked; /* Next in list of all blocked connections */
+#endif
+};
+
+/*
+** A macro to discover the encoding of a database.
+*/
+#define SCHEMA_ENC(db) ((db)->aDb[0].pSchema->enc)
+#define ENC(db) ((db)->enc)
+
+/*
+** A u64 constant where the lower 32 bits are all zeros. Only the
+** upper 32 bits are included in the argument. Necessary because some
+** C-compilers still do not accept LL integer literals.
+*/
+#define HI(X) ((u64)(X)<<32)
+
+/*
+** Possible values for the sqlite3.flags.
+**
+** Value constraints (enforced via assert()):
+** SQLITE_FullFSync == PAGER_FULLFSYNC
+** SQLITE_CkptFullFSync == PAGER_CKPT_FULLFSYNC
+** SQLITE_CacheSpill == PAGER_CACHE_SPILL
+*/
+#define SQLITE_WriteSchema 0x00000001 /* OK to update SQLITE_SCHEMA */
+#define SQLITE_LegacyFileFmt 0x00000002 /* Create new databases in format 1 */
+#define SQLITE_FullColNames 0x00000004 /* Show full column names on SELECT */
+#define SQLITE_FullFSync 0x00000008 /* Use full fsync on the backend */
+#define SQLITE_CkptFullFSync 0x00000010 /* Use full fsync for checkpoint */
+#define SQLITE_CacheSpill 0x00000020 /* OK to spill pager cache */
+#define SQLITE_ShortColNames 0x00000040 /* Show short columns names */
+#define SQLITE_TrustedSchema 0x00000080 /* Allow unsafe functions and
+ ** vtabs in the schema definition */
+#define SQLITE_NullCallback 0x00000100 /* Invoke the callback once if the */
+ /* result set is empty */
+#define SQLITE_IgnoreChecks 0x00000200 /* Do not enforce check constraints */
+#define SQLITE_StmtScanStatus 0x00000400 /* Enable stmt_scanstats() counters */
+#define SQLITE_NoCkptOnClose 0x00000800 /* No checkpoint on close()/DETACH */
+#define SQLITE_ReverseOrder 0x00001000 /* Reverse unordered SELECTs */
+#define SQLITE_RecTriggers 0x00002000 /* Enable recursive triggers */
+#define SQLITE_ForeignKeys 0x00004000 /* Enforce foreign key constraints */
+#define SQLITE_AutoIndex 0x00008000 /* Enable automatic indexes */
+#define SQLITE_LoadExtension 0x00010000 /* Enable load_extension */
+#define SQLITE_LoadExtFunc 0x00020000 /* Enable load_extension() SQL func */
+#define SQLITE_EnableTrigger 0x00040000 /* True to enable triggers */
+#define SQLITE_DeferFKs 0x00080000 /* Defer all FK constraints */
+#define SQLITE_QueryOnly 0x00100000 /* Disable database changes */
+#define SQLITE_CellSizeCk 0x00200000 /* Check btree cell sizes on load */
+#define SQLITE_Fts3Tokenizer 0x00400000 /* Enable fts3_tokenizer(2) */
+#define SQLITE_EnableQPSG 0x00800000 /* Query Planner Stability Guarantee*/
+#define SQLITE_TriggerEQP 0x01000000 /* Show trigger EXPLAIN QUERY PLAN */
+#define SQLITE_ResetDatabase 0x02000000 /* Reset the database */
+#define SQLITE_LegacyAlter 0x04000000 /* Legacy ALTER TABLE behaviour */
+#define SQLITE_NoSchemaError 0x08000000 /* Do not report schema parse errors*/
+#define SQLITE_Defensive 0x10000000 /* Input SQL is likely hostile */
+#define SQLITE_DqsDDL 0x20000000 /* dbl-quoted strings allowed in DDL*/
+#define SQLITE_DqsDML 0x40000000 /* dbl-quoted strings allowed in DML*/
+#define SQLITE_EnableView 0x80000000 /* Enable the use of views */
+#define SQLITE_CountRows HI(0x00001) /* Count rows changed by INSERT, */
+ /* DELETE, or UPDATE and return */
+ /* the count using a callback. */
+#define SQLITE_CorruptRdOnly HI(0x00002) /* Prohibit writes due to error */
+#define SQLITE_ReadUncommit HI(0x00004) /* READ UNCOMMITTED in shared-cache */
+#define SQLITE_FkNoAction HI(0x00008) /* Treat all FK as NO ACTION */
+#define SQLITE_AttachCreate HI(0x00010) /* ATTACH allowed to create new dbs */
+#define SQLITE_AttachWrite HI(0x00020) /* ATTACH allowed to open for write */
+#define SQLITE_Comments HI(0x00040) /* Enable SQL comments */
+
+/* Flags used only if debugging */
+#ifdef SQLITE_DEBUG
+#define SQLITE_SqlTrace HI(0x0100000) /* Debug print SQL as it executes */
+#define SQLITE_VdbeListing HI(0x0200000) /* Debug listings of VDBE progs */
+#define SQLITE_VdbeTrace HI(0x0400000) /* True to trace VDBE execution */
+#define SQLITE_VdbeAddopTrace HI(0x0800000) /* Trace sqlite3VdbeAddOp() calls */
+#define SQLITE_VdbeEQP HI(0x1000000) /* Debug EXPLAIN QUERY PLAN */
+#define SQLITE_ParserTrace HI(0x2000000) /* PRAGMA parser_trace=ON */
+#endif
+
+/*
+** Allowed values for sqlite3.mDbFlags
+*/
+#define DBFLAG_SchemaChange 0x0001 /* Uncommitted Hash table changes */
+#define DBFLAG_PreferBuiltin 0x0002 /* Preference to built-in funcs */
+#define DBFLAG_Vacuum 0x0004 /* Currently in a VACUUM */
+#define DBFLAG_VacuumInto 0x0008 /* Currently running VACUUM INTO */
+#define DBFLAG_SchemaKnownOk 0x0010 /* Schema is known to be valid */
+#define DBFLAG_InternalFunc 0x0020 /* Allow use of internal functions */
+#define DBFLAG_EncodingFixed 0x0040 /* No longer possible to change enc. */
+
+/*
+** Bits of the sqlite3.dbOptFlags field that are used by the
+** sqlite3_test_control(SQLITE_TESTCTRL_OPTIMIZATIONS,...) interface to
+** selectively disable various optimizations.
+*/
+#define SQLITE_QueryFlattener 0x00000001 /* Query flattening */
+#define SQLITE_WindowFunc 0x00000002 /* Use xInverse for window functions */
+#define SQLITE_GroupByOrder 0x00000004 /* GROUPBY cover of ORDERBY */
+#define SQLITE_FactorOutConst 0x00000008 /* Constant factoring */
+#define SQLITE_DistinctOpt 0x00000010 /* DISTINCT using indexes */
+#define SQLITE_CoverIdxScan 0x00000020 /* Covering index scans */
+#define SQLITE_OrderByIdxJoin 0x00000040 /* ORDER BY of joins via index */
+#define SQLITE_Transitive 0x00000080 /* Transitive constraints */
+#define SQLITE_OmitNoopJoin 0x00000100 /* Omit unused tables in joins */
+#define SQLITE_CountOfView 0x00000200 /* The count-of-view optimization */
+#define SQLITE_CursorHints 0x00000400 /* Add OP_CursorHint opcodes */
+#define SQLITE_Stat4 0x00000800 /* Use STAT4 data */
+ /* TH3 expects this value ^^^^^^^^^^ to be 0x0000800. Don't change it */
+#define SQLITE_PushDown 0x00001000 /* WHERE-clause push-down opt */
+#define SQLITE_SimplifyJoin 0x00002000 /* Convert LEFT JOIN to JOIN */
+#define SQLITE_SkipScan 0x00004000 /* Skip-scans */
+#define SQLITE_PropagateConst 0x00008000 /* The constant propagation opt */
+#define SQLITE_MinMaxOpt 0x00010000 /* The min/max optimization */
+#define SQLITE_SeekScan 0x00020000 /* The OP_SeekScan optimization */
+#define SQLITE_OmitOrderBy 0x00040000 /* Omit pointless ORDER BY */
+ /* TH3 expects this value ^^^^^^^^^^ to be 0x40000. Coordinate any change */
+#define SQLITE_BloomFilter 0x00080000 /* Use a Bloom filter on searches */
+#define SQLITE_BloomPulldown 0x00100000 /* Run Bloom filters early */
+#define SQLITE_BalancedMerge 0x00200000 /* Balance multi-way merges */
+#define SQLITE_ReleaseReg 0x00400000 /* Use OP_ReleaseReg for testing */
+#define SQLITE_FlttnUnionAll 0x00800000 /* Disable the UNION ALL flattener */
+ /* TH3 expects this value ^^^^^^^^^^ See flatten04.test */
+#define SQLITE_IndexedExpr 0x01000000 /* Pull exprs from index when able */
+#define SQLITE_Coroutines 0x02000000 /* Co-routines for subqueries */
+#define SQLITE_NullUnusedCols 0x04000000 /* NULL unused columns in subqueries */
+#define SQLITE_OnePass 0x08000000 /* Single-pass DELETE and UPDATE */
+#define SQLITE_OrderBySubq 0x10000000 /* ORDER BY in subquery helps outer */
+#define SQLITE_StarQuery 0x20000000 /* Heurists for star queries */
+#define SQLITE_AllOpts 0xffffffff /* All optimizations */
+
+/*
+** Macros for testing whether or not optimizations are enabled or disabled.
+*/
+#define OptimizationDisabled(db, mask) (((db)->dbOptFlags&(mask))!=0)
+#define OptimizationEnabled(db, mask) (((db)->dbOptFlags&(mask))==0)
+
+/*
+** Return true if it OK to factor constant expressions into the initialization
+** code. The argument is a Parse object for the code generator.
+*/
+#define ConstFactorOk(P) ((P)->okConstFactor)
+
+/* Possible values for the sqlite3.eOpenState field.
+** The numbers are randomly selected such that a minimum of three bits must
+** change to convert any number to another or to zero
+*/
+#define SQLITE_STATE_OPEN 0x76 /* Database is open */
+#define SQLITE_STATE_CLOSED 0xce /* Database is closed */
+#define SQLITE_STATE_SICK 0xba /* Error and awaiting close */
+#define SQLITE_STATE_BUSY 0x6d /* Database currently in use */
+#define SQLITE_STATE_ERROR 0xd5 /* An SQLITE_MISUSE error occurred */
+#define SQLITE_STATE_ZOMBIE 0xa7 /* Close with last statement close */
+
+/*
+** Each SQL function is defined by an instance of the following
+** structure. For global built-in functions (ex: substr(), max(), count())
+** a pointer to this structure is held in the sqlite3BuiltinFunctions object.
+** For per-connection application-defined functions, a pointer to this
+** structure is held in the db->aHash hash table.
+**
+** The u.pHash field is used by the global built-ins. The u.pDestructor
+** field is used by per-connection app-def functions.
+*/
+struct FuncDef {
+ i16 nArg; /* Number of arguments. -1 means unlimited */
+ u32 funcFlags; /* Some combination of SQLITE_FUNC_* */
+ void *pUserData; /* User data parameter */
+ FuncDef *pNext; /* Next function with same name */
+ void (*xSFunc)(sqlite3_context*,int,sqlite3_value**); /* func or agg-step */
+ void (*xFinalize)(sqlite3_context*); /* Agg finalizer */
+ void (*xValue)(sqlite3_context*); /* Current agg value */
+ void (*xInverse)(sqlite3_context*,int,sqlite3_value**); /* inverse agg-step */
+ const char *zName; /* SQL name of the function. */
+ union {
+ FuncDef *pHash; /* Next with a different name but the same hash */
+ FuncDestructor *pDestructor; /* Reference counted destructor function */
+ } u; /* pHash if SQLITE_FUNC_BUILTIN, pDestructor otherwise */
+};
+
+/*
+** This structure encapsulates a user-function destructor callback (as
+** configured using create_function_v2()) and a reference counter. When
+** create_function_v2() is called to create a function with a destructor,
+** a single object of this type is allocated. FuncDestructor.nRef is set to
+** the number of FuncDef objects created (either 1 or 3, depending on whether
+** or not the specified encoding is SQLITE_ANY). The FuncDef.pDestructor
+** member of each of the new FuncDef objects is set to point to the allocated
+** FuncDestructor.
+**
+** Thereafter, when one of the FuncDef objects is deleted, the reference
+** count on this object is decremented. When it reaches 0, the destructor
+** is invoked and the FuncDestructor structure freed.
+*/
+struct FuncDestructor {
+ int nRef;
+ void (*xDestroy)(void *);
+ void *pUserData;
+};
+
+/*
+** Possible values for FuncDef.flags. Note that the _LENGTH and _TYPEOF
+** values must correspond to OPFLAG_LENGTHARG and OPFLAG_TYPEOFARG. And
+** SQLITE_FUNC_CONSTANT must be the same as SQLITE_DETERMINISTIC. There
+** are assert() statements in the code to verify this.
+**
+** Value constraints (enforced via assert()):
+** SQLITE_FUNC_MINMAX == NC_MinMaxAgg == SF_MinMaxAgg
+** SQLITE_FUNC_ANYORDER == NC_OrderAgg == SF_OrderByReqd
+** SQLITE_FUNC_LENGTH == OPFLAG_LENGTHARG
+** SQLITE_FUNC_TYPEOF == OPFLAG_TYPEOFARG
+** SQLITE_FUNC_BYTELEN == OPFLAG_BYTELENARG
+** SQLITE_FUNC_CONSTANT == SQLITE_DETERMINISTIC from the API
+** SQLITE_FUNC_DIRECT == SQLITE_DIRECTONLY from the API
+** SQLITE_FUNC_UNSAFE == SQLITE_INNOCUOUS -- opposite meanings!!!
+** SQLITE_FUNC_ENCMASK depends on SQLITE_UTF* macros in the API
+**
+** Note that even though SQLITE_FUNC_UNSAFE and SQLITE_INNOCUOUS have the
+** same bit value, their meanings are inverted. SQLITE_FUNC_UNSAFE is
+** used internally and if set means that the function has side effects.
+** SQLITE_INNOCUOUS is used by application code and means "not unsafe".
+** See multiple instances of tag-20230109-1.
+*/
+#define SQLITE_FUNC_ENCMASK 0x0003 /* SQLITE_UTF8, SQLITE_UTF16BE or UTF16LE */
+#define SQLITE_FUNC_LIKE 0x0004 /* Candidate for the LIKE optimization */
+#define SQLITE_FUNC_CASE 0x0008 /* Case-sensitive LIKE-type function */
+#define SQLITE_FUNC_EPHEM 0x0010 /* Ephemeral. Delete with VDBE */
+#define SQLITE_FUNC_NEEDCOLL 0x0020 /* sqlite3GetFuncCollSeq() might be called*/
+#define SQLITE_FUNC_LENGTH 0x0040 /* Built-in length() function */
+#define SQLITE_FUNC_TYPEOF 0x0080 /* Built-in typeof() function */
+#define SQLITE_FUNC_BYTELEN 0x00c0 /* Built-in octet_length() function */
+#define SQLITE_FUNC_COUNT 0x0100 /* Built-in count(*) aggregate */
+/* 0x0200 -- available for reuse */
+#define SQLITE_FUNC_UNLIKELY 0x0400 /* Built-in unlikely() function */
+#define SQLITE_FUNC_CONSTANT 0x0800 /* Constant inputs give a constant output */
+#define SQLITE_FUNC_MINMAX 0x1000 /* True for min() and max() aggregates */
+#define SQLITE_FUNC_SLOCHNG 0x2000 /* "Slow Change". Value constant during a
+ ** single query - might change over time */
+#define SQLITE_FUNC_TEST 0x4000 /* Built-in testing functions */
+#define SQLITE_FUNC_RUNONLY 0x8000 /* Cannot be used by valueFromFunction */
+#define SQLITE_FUNC_WINDOW 0x00010000 /* Built-in window-only function */
+#define SQLITE_FUNC_INTERNAL 0x00040000 /* For use by NestedParse() only */
+#define SQLITE_FUNC_DIRECT 0x00080000 /* Not for use in TRIGGERs or VIEWs */
+/* SQLITE_SUBTYPE 0x00100000 // Consumer of subtypes */
+#define SQLITE_FUNC_UNSAFE 0x00200000 /* Function has side effects */
+#define SQLITE_FUNC_INLINE 0x00400000 /* Functions implemented in-line */
+#define SQLITE_FUNC_BUILTIN 0x00800000 /* This is a built-in function */
+/* SQLITE_RESULT_SUBTYPE 0x01000000 // Generator of subtypes */
+#define SQLITE_FUNC_ANYORDER 0x08000000 /* count/min/max aggregate */
+
+/* Identifier numbers for each in-line function */
+#define INLINEFUNC_coalesce 0
+#define INLINEFUNC_implies_nonnull_row 1
+#define INLINEFUNC_expr_implies_expr 2
+#define INLINEFUNC_expr_compare 3
+#define INLINEFUNC_affinity 4
+#define INLINEFUNC_iif 5
+#define INLINEFUNC_sqlite_offset 6
+#define INLINEFUNC_unlikely 99 /* Default case */
+
+/*
+** The following three macros, FUNCTION(), LIKEFUNC() and AGGREGATE() are
+** used to create the initializers for the FuncDef structures.
+**
+** FUNCTION(zName, nArg, iArg, bNC, xFunc)
+** Used to create a scalar function definition of a function zName
+** implemented by C function xFunc that accepts nArg arguments. The
+** value passed as iArg is cast to a (void*) and made available
+** as the user-data (sqlite3_user_data()) for the function. If
+** argument bNC is true, then the SQLITE_FUNC_NEEDCOLL flag is set.
+**
+** VFUNCTION(zName, nArg, iArg, bNC, xFunc)
+** Like FUNCTION except it omits the SQLITE_FUNC_CONSTANT flag.
+**
+** SFUNCTION(zName, nArg, iArg, bNC, xFunc)
+** Like FUNCTION except it omits the SQLITE_FUNC_CONSTANT flag and
+** adds the SQLITE_DIRECTONLY flag.
+**
+** INLINE_FUNC(zName, nArg, iFuncId, mFlags)
+** zName is the name of a function that is implemented by in-line
+** byte code rather than by the usual callbacks. The iFuncId
+** parameter determines the function id. The mFlags parameter is
+** optional SQLITE_FUNC_ flags for this function.
+**
+** TEST_FUNC(zName, nArg, iFuncId, mFlags)
+** zName is the name of a test-only function implemented by in-line
+** byte code rather than by the usual callbacks. The iFuncId
+** parameter determines the function id. The mFlags parameter is
+** optional SQLITE_FUNC_ flags for this function.
+**
+** DFUNCTION(zName, nArg, iArg, bNC, xFunc)
+** Like FUNCTION except it omits the SQLITE_FUNC_CONSTANT flag and
+** adds the SQLITE_FUNC_SLOCHNG flag. Used for date & time functions
+** and functions like sqlite_version() that can change, but not during
+** a single query. The iArg is ignored. The user-data is always set
+** to a NULL pointer. The bNC parameter is not used.
+**
+** MFUNCTION(zName, nArg, xPtr, xFunc)
+** For math-library functions. xPtr is an arbitrary pointer.
+**
+** PURE_DATE(zName, nArg, iArg, bNC, xFunc)
+** Used for "pure" date/time functions, this macro is like DFUNCTION
+** except that it does set the SQLITE_FUNC_CONSTANT flags. iArg is
+** ignored and the user-data for these functions is set to an
+** arbitrary non-NULL pointer. The bNC parameter is not used.
+**
+** AGGREGATE(zName, nArg, iArg, bNC, xStep, xFinal)
+** Used to create an aggregate function definition implemented by
+** the C functions xStep and xFinal. The first four parameters
+** are interpreted in the same way as the first 4 parameters to
+** FUNCTION().
+**
+** WAGGREGATE(zName, nArg, iArg, xStep, xFinal, xValue, xInverse)
+** Used to create an aggregate function definition implemented by
+** the C functions xStep and xFinal. The first four parameters
+** are interpreted in the same way as the first 4 parameters to
+** FUNCTION().
+**
+** LIKEFUNC(zName, nArg, pArg, flags)
+** Used to create a scalar function definition of a function zName
+** that accepts nArg arguments and is implemented by a call to C
+** function likeFunc. Argument pArg is cast to a (void *) and made
+** available as the function user-data (sqlite3_user_data()). The
+** FuncDef.flags variable is set to the value passed as the flags
+** parameter.
+*/
+#define FUNCTION(zName, nArg, iArg, bNC, xFunc) \
+ {nArg, SQLITE_FUNC_BUILTIN|\
+ SQLITE_FUNC_CONSTANT|SQLITE_UTF8|(bNC*SQLITE_FUNC_NEEDCOLL), \
+ SQLITE_INT_TO_PTR(iArg), 0, xFunc, 0, 0, 0, #zName, {0} }
+#define VFUNCTION(zName, nArg, iArg, bNC, xFunc) \
+ {nArg, SQLITE_FUNC_BUILTIN|SQLITE_UTF8|(bNC*SQLITE_FUNC_NEEDCOLL), \
+ SQLITE_INT_TO_PTR(iArg), 0, xFunc, 0, 0, 0, #zName, {0} }
+#define SFUNCTION(zName, nArg, iArg, bNC, xFunc) \
+ {nArg, SQLITE_FUNC_BUILTIN|SQLITE_UTF8|SQLITE_DIRECTONLY|SQLITE_FUNC_UNSAFE, \
+ SQLITE_INT_TO_PTR(iArg), 0, xFunc, 0, 0, 0, #zName, {0} }
+#define MFUNCTION(zName, nArg, xPtr, xFunc) \
+ {nArg, SQLITE_FUNC_BUILTIN|SQLITE_FUNC_CONSTANT|SQLITE_UTF8, \
+ xPtr, 0, xFunc, 0, 0, 0, #zName, {0} }
+#define JFUNCTION(zName, nArg, bUseCache, bWS, bRS, bJsonB, iArg, xFunc) \
+ {nArg, SQLITE_FUNC_BUILTIN|SQLITE_DETERMINISTIC|SQLITE_FUNC_CONSTANT|\
+ SQLITE_UTF8|((bUseCache)*SQLITE_FUNC_RUNONLY)|\
+ ((bRS)*SQLITE_SUBTYPE)|((bWS)*SQLITE_RESULT_SUBTYPE), \
+ SQLITE_INT_TO_PTR(iArg|((bJsonB)*JSON_BLOB)),0,xFunc,0, 0, 0, #zName, {0} }
+#define INLINE_FUNC(zName, nArg, iArg, mFlags) \
+ {nArg, SQLITE_FUNC_BUILTIN|\
+ SQLITE_UTF8|SQLITE_FUNC_INLINE|SQLITE_FUNC_CONSTANT|(mFlags), \
+ SQLITE_INT_TO_PTR(iArg), 0, noopFunc, 0, 0, 0, #zName, {0} }
+#define TEST_FUNC(zName, nArg, iArg, mFlags) \
+ {nArg, SQLITE_FUNC_BUILTIN|\
+ SQLITE_UTF8|SQLITE_FUNC_INTERNAL|SQLITE_FUNC_TEST| \
+ SQLITE_FUNC_INLINE|SQLITE_FUNC_CONSTANT|(mFlags), \
+ SQLITE_INT_TO_PTR(iArg), 0, noopFunc, 0, 0, 0, #zName, {0} }
+#define DFUNCTION(zName, nArg, iArg, bNC, xFunc) \
+ {nArg, SQLITE_FUNC_BUILTIN|SQLITE_FUNC_SLOCHNG|SQLITE_UTF8, \
+ 0, 0, xFunc, 0, 0, 0, #zName, {0} }
+#define PURE_DATE(zName, nArg, iArg, bNC, xFunc) \
+ {nArg, SQLITE_FUNC_BUILTIN|\
+ SQLITE_FUNC_SLOCHNG|SQLITE_UTF8|SQLITE_FUNC_CONSTANT, \
+ (void*)&sqlite3Config, 0, xFunc, 0, 0, 0, #zName, {0} }
+#define FUNCTION2(zName, nArg, iArg, bNC, xFunc, extraFlags) \
+ {nArg, SQLITE_FUNC_BUILTIN|\
+ SQLITE_FUNC_CONSTANT|SQLITE_UTF8|(bNC*SQLITE_FUNC_NEEDCOLL)|extraFlags,\
+ SQLITE_INT_TO_PTR(iArg), 0, xFunc, 0, 0, 0, #zName, {0} }
+#define STR_FUNCTION(zName, nArg, pArg, bNC, xFunc) \
+ {nArg, SQLITE_FUNC_BUILTIN|\
+ SQLITE_FUNC_SLOCHNG|SQLITE_UTF8|(bNC*SQLITE_FUNC_NEEDCOLL), \
+ pArg, 0, xFunc, 0, 0, 0, #zName, }
+#define LIKEFUNC(zName, nArg, arg, flags) \
+ {nArg, SQLITE_FUNC_BUILTIN|SQLITE_FUNC_CONSTANT|SQLITE_UTF8|flags, \
+ (void *)arg, 0, likeFunc, 0, 0, 0, #zName, {0} }
+#define WAGGREGATE(zName, nArg, arg, nc, xStep, xFinal, xValue, xInverse, f) \
+ {nArg, SQLITE_FUNC_BUILTIN|SQLITE_UTF8|(nc*SQLITE_FUNC_NEEDCOLL)|f, \
+ SQLITE_INT_TO_PTR(arg), 0, xStep,xFinal,xValue,xInverse,#zName, {0}}
+#define INTERNAL_FUNCTION(zName, nArg, xFunc) \
+ {nArg, SQLITE_FUNC_BUILTIN|\
+ SQLITE_FUNC_INTERNAL|SQLITE_UTF8|SQLITE_FUNC_CONSTANT, \
+ 0, 0, xFunc, 0, 0, 0, #zName, {0} }
+
+
+/*
+** All current savepoints are stored in a linked list starting at
+** sqlite3.pSavepoint. The first element in the list is the most recently
+** opened savepoint. Savepoints are added to the list by the vdbe
+** OP_Savepoint instruction.
+*/
+struct Savepoint {
+ char *zName; /* Savepoint name (nul-terminated) */
+ i64 nDeferredCons; /* Number of deferred fk violations */
+ i64 nDeferredImmCons; /* Number of deferred imm fk. */
+ Savepoint *pNext; /* Parent savepoint (if any) */
+};
+
+/*
+** The following are used as the second parameter to sqlite3Savepoint(),
+** and as the P1 argument to the OP_Savepoint instruction.
+*/
+#define SAVEPOINT_BEGIN 0
+#define SAVEPOINT_RELEASE 1
+#define SAVEPOINT_ROLLBACK 2
+
+
+/*
+** Each SQLite module (virtual table definition) is defined by an
+** instance of the following structure, stored in the sqlite3.aModule
+** hash table.
+*/
+struct Module {
+ const sqlite3_module *pModule; /* Callback pointers */
+ const char *zName; /* Name passed to create_module() */
+ int nRefModule; /* Number of pointers to this object */
+ void *pAux; /* pAux passed to create_module() */
+ void (*xDestroy)(void *); /* Module destructor function */
+ Table *pEpoTab; /* Eponymous table for this module */
+};
+
+/*
+** Information about each column of an SQL table is held in an instance
+** of the Column structure, in the Table.aCol[] array.
+**
+** Definitions:
+**
+** "table column index" This is the index of the column in the
+** Table.aCol[] array, and also the index of
+** the column in the original CREATE TABLE stmt.
+**
+** "storage column index" This is the index of the column in the
+** record BLOB generated by the OP_MakeRecord
+** opcode. The storage column index is less than
+** or equal to the table column index. It is
+** equal if and only if there are no VIRTUAL
+** columns to the left.
+**
+** Notes on zCnName:
+** The zCnName field stores the name of the column, the datatype of the
+** column, and the collating sequence for the column, in that order, all in
+** a single allocation. Each string is 0x00 terminated. The datatype
+** is only included if the COLFLAG_HASTYPE bit of colFlags is set and the
+** collating sequence name is only included if the COLFLAG_HASCOLL bit is
+** set.
+*/
+struct Column {
+ char *zCnName; /* Name of this column */
+ unsigned notNull :4; /* An OE_ code for handling a NOT NULL constraint */
+ unsigned eCType :4; /* One of the standard types */
+ char affinity; /* One of the SQLITE_AFF_... values */
+ u8 szEst; /* Est size of value in this column. sizeof(INT)==1 */
+ u8 hName; /* Column name hash for faster lookup */
+ u16 iDflt; /* 1-based index of DEFAULT. 0 means "none" */
+ u16 colFlags; /* Boolean properties. See COLFLAG_ defines below */
+};
+
+/* Allowed values for Column.eCType.
+**
+** Values must match entries in the global constant arrays
+** sqlite3StdTypeLen[] and sqlite3StdType[]. Each value is one more
+** than the offset into these arrays for the corresponding name.
+** Adjust the SQLITE_N_STDTYPE value if adding or removing entries.
+*/
+#define COLTYPE_CUSTOM 0 /* Type appended to zName */
+#define COLTYPE_ANY 1
+#define COLTYPE_BLOB 2
+#define COLTYPE_INT 3
+#define COLTYPE_INTEGER 4
+#define COLTYPE_REAL 5
+#define COLTYPE_TEXT 6
+#define SQLITE_N_STDTYPE 6 /* Number of standard types */
+
+/* Allowed values for Column.colFlags.
+**
+** Constraints:
+** TF_HasVirtual == COLFLAG_VIRTUAL
+** TF_HasStored == COLFLAG_STORED
+** TF_HasHidden == COLFLAG_HIDDEN
+*/
+#define COLFLAG_PRIMKEY 0x0001 /* Column is part of the primary key */
+#define COLFLAG_HIDDEN 0x0002 /* A hidden column in a virtual table */
+#define COLFLAG_HASTYPE 0x0004 /* Type name follows column name */
+#define COLFLAG_UNIQUE 0x0008 /* Column def contains "UNIQUE" or "PK" */
+#define COLFLAG_SORTERREF 0x0010 /* Use sorter-refs with this column */
+#define COLFLAG_VIRTUAL 0x0020 /* GENERATED ALWAYS AS ... VIRTUAL */
+#define COLFLAG_STORED 0x0040 /* GENERATED ALWAYS AS ... STORED */
+#define COLFLAG_NOTAVAIL 0x0080 /* STORED column not yet calculated */
+#define COLFLAG_BUSY 0x0100 /* Blocks recursion on GENERATED columns */
+#define COLFLAG_HASCOLL 0x0200 /* Has collating sequence name in zCnName */
+#define COLFLAG_NOEXPAND 0x0400 /* Omit this column when expanding "*" */
+#define COLFLAG_GENERATED 0x0060 /* Combo: _STORED, _VIRTUAL */
+#define COLFLAG_NOINSERT 0x0062 /* Combo: _HIDDEN, _STORED, _VIRTUAL */
+
+/*
+** A "Collating Sequence" is defined by an instance of the following
+** structure. Conceptually, a collating sequence consists of a name and
+** a comparison routine that defines the order of that sequence.
+**
+** If CollSeq.xCmp is NULL, it means that the
+** collating sequence is undefined. Indices built on an undefined
+** collating sequence may not be read or written.
+*/
+struct CollSeq {
+ char *zName; /* Name of the collating sequence, UTF-8 encoded */
+ u8 enc; /* Text encoding handled by xCmp() */
+ void *pUser; /* First argument to xCmp() */
+ int (*xCmp)(void*,int, const void*, int, const void*);
+ void (*xDel)(void*); /* Destructor for pUser */
+};
+
+/*
+** A sort order can be either ASC or DESC.
+*/
+#define SQLITE_SO_ASC 0 /* Sort in ascending order */
+#define SQLITE_SO_DESC 1 /* Sort in ascending order */
+#define SQLITE_SO_UNDEFINED -1 /* No sort order specified */
+
+/*
+** Column affinity types.
+**
+** These used to have mnemonic name like 'i' for SQLITE_AFF_INTEGER and
+** 't' for SQLITE_AFF_TEXT. But we can save a little space and improve
+** the speed a little by numbering the values consecutively.
+**
+** But rather than start with 0 or 1, we begin with 'A'. That way,
+** when multiple affinity types are concatenated into a string and
+** used as the P4 operand, they will be more readable.
+**
+** Note also that the numeric types are grouped together so that testing
+** for a numeric type is a single comparison. And the BLOB type is first.
+*/
+#define SQLITE_AFF_NONE 0x40 /* '@' */
+#define SQLITE_AFF_BLOB 0x41 /* 'A' */
+#define SQLITE_AFF_TEXT 0x42 /* 'B' */
+#define SQLITE_AFF_NUMERIC 0x43 /* 'C' */
+#define SQLITE_AFF_INTEGER 0x44 /* 'D' */
+#define SQLITE_AFF_REAL 0x45 /* 'E' */
+#define SQLITE_AFF_FLEXNUM 0x46 /* 'F' */
+#define SQLITE_AFF_DEFER 0x58 /* 'X' - defer computation until later */
+
+#define sqlite3IsNumericAffinity(X) ((X)>=SQLITE_AFF_NUMERIC)
+
+/*
+** The SQLITE_AFF_MASK values masks off the significant bits of an
+** affinity value.
+*/
+#define SQLITE_AFF_MASK 0x47
+
+/*
+** Additional bit values that can be ORed with an affinity without
+** changing the affinity.
+**
+** The SQLITE_NOTNULL flag is a combination of NULLEQ and JUMPIFNULL.
+** It causes an assert() to fire if either operand to a comparison
+** operator is NULL. It is added to certain comparison operators to
+** prove that the operands are always NOT NULL.
+*/
+#define SQLITE_JUMPIFNULL 0x10 /* jumps if either operand is NULL */
+#define SQLITE_NULLEQ 0x80 /* NULL=NULL */
+#define SQLITE_NOTNULL 0x90 /* Assert that operands are never NULL */
+
+/*
+** An object of this type is created for each virtual table present in
+** the database schema.
+**
+** If the database schema is shared, then there is one instance of this
+** structure for each database connection (sqlite3*) that uses the shared
+** schema. This is because each database connection requires its own unique
+** instance of the sqlite3_vtab* handle used to access the virtual table
+** implementation. sqlite3_vtab* handles can not be shared between
+** database connections, even when the rest of the in-memory database
+** schema is shared, as the implementation often stores the database
+** connection handle passed to it via the xConnect() or xCreate() method
+** during initialization internally. This database connection handle may
+** then be used by the virtual table implementation to access real tables
+** within the database. So that they appear as part of the callers
+** transaction, these accesses need to be made via the same database
+** connection as that used to execute SQL operations on the virtual table.
+**
+** All VTable objects that correspond to a single table in a shared
+** database schema are initially stored in a linked-list pointed to by
+** the Table.pVTable member variable of the corresponding Table object.
+** When an sqlite3_prepare() operation is required to access the virtual
+** table, it searches the list for the VTable that corresponds to the
+** database connection doing the preparing so as to use the correct
+** sqlite3_vtab* handle in the compiled query.
+**
+** When an in-memory Table object is deleted (for example when the
+** schema is being reloaded for some reason), the VTable objects are not
+** deleted and the sqlite3_vtab* handles are not xDisconnect()ed
+** immediately. Instead, they are moved from the Table.pVTable list to
+** another linked list headed by the sqlite3.pDisconnect member of the
+** corresponding sqlite3 structure. They are then deleted/xDisconnected
+** next time a statement is prepared using said sqlite3*. This is done
+** to avoid deadlock issues involving multiple sqlite3.mutex mutexes.
+** Refer to comments above function sqlite3VtabUnlockList() for an
+** explanation as to why it is safe to add an entry to an sqlite3.pDisconnect
+** list without holding the corresponding sqlite3.mutex mutex.
+**
+** The memory for objects of this type is always allocated by
+** sqlite3DbMalloc(), using the connection handle stored in VTable.db as
+** the first argument.
+*/
+struct VTable {
+ sqlite3 *db; /* Database connection associated with this table */
+ Module *pMod; /* Pointer to module implementation */
+ sqlite3_vtab *pVtab; /* Pointer to vtab instance */
+ int nRef; /* Number of pointers to this structure */
+ u8 bConstraint; /* True if constraints are supported */
+ u8 bAllSchemas; /* True if might use any attached schema */
+ u8 eVtabRisk; /* Riskiness of allowing hacker access */
+ int iSavepoint; /* Depth of the SAVEPOINT stack */
+ VTable *pNext; /* Next in linked list (see above) */
+};
+
+/* Allowed values for VTable.eVtabRisk
+*/
+#define SQLITE_VTABRISK_Low 0
+#define SQLITE_VTABRISK_Normal 1
+#define SQLITE_VTABRISK_High 2
+
+/*
+** The schema for each SQL table, virtual table, and view is represented
+** in memory by an instance of the following structure.
+*/
+struct Table {
+ char *zName; /* Name of the table or view */
+ Column *aCol; /* Information about each column */
+ Index *pIndex; /* List of SQL indexes on this table. */
+ char *zColAff; /* String defining the affinity of each column */
+ ExprList *pCheck; /* All CHECK constraints */
+ /* ... also used as column name list in a VIEW */
+ Pgno tnum; /* Root BTree page for this table */
+ u32 nTabRef; /* Number of pointers to this Table */
+ u32 tabFlags; /* Mask of TF_* values */
+ i16 iPKey; /* If not negative, use aCol[iPKey] as the rowid */
+ i16 nCol; /* Number of columns in this table */
+ i16 nNVCol; /* Number of columns that are not VIRTUAL */
+ LogEst nRowLogEst; /* Estimated rows in table - from sqlite_stat1 table */
+ LogEst szTabRow; /* Estimated size of each table row in bytes */
+#ifdef SQLITE_ENABLE_COSTMULT
+ LogEst costMult; /* Cost multiplier for using this table */
+#endif
+ u8 keyConf; /* What to do in case of uniqueness conflict on iPKey */
+ u8 eTabType; /* 0: normal, 1: virtual, 2: view */
+ union {
+ struct { /* Used by ordinary tables: */
+ int addColOffset; /* Offset in CREATE TABLE stmt to add a new column */
+ FKey *pFKey; /* Linked list of all foreign keys in this table */
+ ExprList *pDfltList; /* DEFAULT clauses on various columns.
+ ** Or the AS clause for generated columns. */
+ } tab;
+ struct { /* Used by views: */
+ Select *pSelect; /* View definition */
+ } view;
+ struct { /* Used by virtual tables only: */
+ int nArg; /* Number of arguments to the module */
+ char **azArg; /* 0: module 1: schema 2: vtab name 3...: args */
+ VTable *p; /* List of VTable objects. */
+ } vtab;
+ } u;
+ Trigger *pTrigger; /* List of triggers on this object */
+ Schema *pSchema; /* Schema that contains this table */
+ u8 aHx[16]; /* Column aHt[K%sizeof(aHt)] might have hash K */
+};
+
+/*
+** Allowed values for Table.tabFlags.
+**
+** TF_OOOHidden applies to tables or view that have hidden columns that are
+** followed by non-hidden columns. Example: "CREATE VIRTUAL TABLE x USING
+** vtab1(a HIDDEN, b);". Since "b" is a non-hidden column but "a" is hidden,
+** the TF_OOOHidden attribute would apply in this case. Such tables require
+** special handling during INSERT processing. The "OOO" means "Out Of Order".
+**
+** Constraints:
+**
+** TF_HasVirtual == COLFLAG_VIRTUAL
+** TF_HasStored == COLFLAG_STORED
+** TF_HasHidden == COLFLAG_HIDDEN
+*/
+#define TF_Readonly 0x00000001 /* Read-only system table */
+#define TF_HasHidden 0x00000002 /* Has one or more hidden columns */
+#define TF_HasPrimaryKey 0x00000004 /* Table has a primary key */
+#define TF_Autoincrement 0x00000008 /* Integer primary key is autoincrement */
+#define TF_HasStat1 0x00000010 /* nRowLogEst set from sqlite_stat1 */
+#define TF_HasVirtual 0x00000020 /* Has one or more VIRTUAL columns */
+#define TF_HasStored 0x00000040 /* Has one or more STORED columns */
+#define TF_HasGenerated 0x00000060 /* Combo: HasVirtual + HasStored */
+#define TF_WithoutRowid 0x00000080 /* No rowid. PRIMARY KEY is the key */
+#define TF_MaybeReanalyze 0x00000100 /* Maybe run ANALYZE on this table */
+#define TF_NoVisibleRowid 0x00000200 /* No user-visible "rowid" column */
+#define TF_OOOHidden 0x00000400 /* Out-of-Order hidden columns */
+#define TF_HasNotNull 0x00000800 /* Contains NOT NULL constraints */
+#define TF_Shadow 0x00001000 /* True for a shadow table */
+#define TF_HasStat4 0x00002000 /* STAT4 info available for this table */
+#define TF_Ephemeral 0x00004000 /* An ephemeral table */
+#define TF_Eponymous 0x00008000 /* An eponymous virtual table */
+#define TF_Strict 0x00010000 /* STRICT mode */
+
+/*
+** Allowed values for Table.eTabType
+*/
+#define TABTYP_NORM 0 /* Ordinary table */
+#define TABTYP_VTAB 1 /* Virtual table */
+#define TABTYP_VIEW 2 /* A view */
+
+#define IsView(X) ((X)->eTabType==TABTYP_VIEW)
+#define IsOrdinaryTable(X) ((X)->eTabType==TABTYP_NORM)
+
+/*
+** Test to see whether or not a table is a virtual table. This is
+** done as a macro so that it will be optimized out when virtual
+** table support is omitted from the build.
+*/
+#ifndef SQLITE_OMIT_VIRTUALTABLE
+# define IsVirtual(X) ((X)->eTabType==TABTYP_VTAB)
+# define ExprIsVtab(X) \
+ ((X)->op==TK_COLUMN && (X)->y.pTab->eTabType==TABTYP_VTAB)
+#else
+# define IsVirtual(X) 0
+# define ExprIsVtab(X) 0
+#endif
+
+/*
+** Macros to determine if a column is hidden. IsOrdinaryHiddenColumn()
+** only works for non-virtual tables (ordinary tables and views) and is
+** always false unless SQLITE_ENABLE_HIDDEN_COLUMNS is defined. The
+** IsHiddenColumn() macro is general purpose.
+*/
+#if defined(SQLITE_ENABLE_HIDDEN_COLUMNS)
+# define IsHiddenColumn(X) (((X)->colFlags & COLFLAG_HIDDEN)!=0)
+# define IsOrdinaryHiddenColumn(X) (((X)->colFlags & COLFLAG_HIDDEN)!=0)
+#elif !defined(SQLITE_OMIT_VIRTUALTABLE)
+# define IsHiddenColumn(X) (((X)->colFlags & COLFLAG_HIDDEN)!=0)
+# define IsOrdinaryHiddenColumn(X) 0
+#else
+# define IsHiddenColumn(X) 0
+# define IsOrdinaryHiddenColumn(X) 0
+#endif
+
+
+/* Does the table have a rowid */
+#define HasRowid(X) (((X)->tabFlags & TF_WithoutRowid)==0)
+#define VisibleRowid(X) (((X)->tabFlags & TF_NoVisibleRowid)==0)
+
+/* Macro is true if the SQLITE_ALLOW_ROWID_IN_VIEW (mis-)feature is
+** available. By default, this macro is false
+*/
+#ifndef SQLITE_ALLOW_ROWID_IN_VIEW
+# define ViewCanHaveRowid 0
+#else
+# define ViewCanHaveRowid (sqlite3Config.mNoVisibleRowid==0)
+#endif
+
+/*
+** Each foreign key constraint is an instance of the following structure.
+**
+** A foreign key is associated with two tables. The "from" table is
+** the table that contains the REFERENCES clause that creates the foreign
+** key. The "to" table is the table that is named in the REFERENCES clause.
+** Consider this example:
+**
+** CREATE TABLE ex1(
+** a INTEGER PRIMARY KEY,
+** b INTEGER CONSTRAINT fk1 REFERENCES ex2(x)
+** );
+**
+** For foreign key "fk1", the from-table is "ex1" and the to-table is "ex2".
+** Equivalent names:
+**
+** from-table == child-table
+** to-table == parent-table
+**
+** Each REFERENCES clause generates an instance of the following structure
+** which is attached to the from-table. The to-table need not exist when
+** the from-table is created. The existence of the to-table is not checked.
+**
+** The list of all parents for child Table X is held at X.pFKey.
+**
+** A list of all children for a table named Z (which might not even exist)
+** is held in Schema.fkeyHash with a hash key of Z.
+*/
+struct FKey {
+ Table *pFrom; /* Table containing the REFERENCES clause (aka: Child) */
+ FKey *pNextFrom; /* Next FKey with the same in pFrom. Next parent of pFrom */
+ char *zTo; /* Name of table that the key points to (aka: Parent) */
+ FKey *pNextTo; /* Next with the same zTo. Next child of zTo. */
+ FKey *pPrevTo; /* Previous with the same zTo */
+ int nCol; /* Number of columns in this key */
+ /* EV: R-30323-21917 */
+ u8 isDeferred; /* True if constraint checking is deferred till COMMIT */
+ u8 aAction[2]; /* ON DELETE and ON UPDATE actions, respectively */
+ Trigger *apTrigger[2];/* Triggers for aAction[] actions */
+ struct sColMap { /* Mapping of columns in pFrom to columns in zTo */
+ int iFrom; /* Index of column in pFrom */
+ char *zCol; /* Name of column in zTo. If NULL use PRIMARY KEY */
+ } aCol[FLEXARRAY]; /* One entry for each of nCol columns */
+};
+
+/* The size (in bytes) of an FKey object holding N columns. The answer
+** does NOT include space to hold the zTo name. */
+#define SZ_FKEY(N) (offsetof(FKey,aCol)+(N)*sizeof(struct sColMap))
+
+/*
+** SQLite supports many different ways to resolve a constraint
+** error. ROLLBACK processing means that a constraint violation
+** causes the operation in process to fail and for the current transaction
+** to be rolled back. ABORT processing means the operation in process
+** fails and any prior changes from that one operation are backed out,
+** but the transaction is not rolled back. FAIL processing means that
+** the operation in progress stops and returns an error code. But prior
+** changes due to the same operation are not backed out and no rollback
+** occurs. IGNORE means that the particular row that caused the constraint
+** error is not inserted or updated. Processing continues and no error
+** is returned. REPLACE means that preexisting database rows that caused
+** a UNIQUE constraint violation are removed so that the new insert or
+** update can proceed. Processing continues and no error is reported.
+** UPDATE applies to insert operations only and means that the insert
+** is omitted and the DO UPDATE clause of an upsert is run instead.
+**
+** RESTRICT, SETNULL, SETDFLT, and CASCADE actions apply only to foreign keys.
+** RESTRICT is the same as ABORT for IMMEDIATE foreign keys and the
+** same as ROLLBACK for DEFERRED keys. SETNULL means that the foreign
+** key is set to NULL. SETDFLT means that the foreign key is set
+** to its default value. CASCADE means that a DELETE or UPDATE of the
+** referenced table row is propagated into the row that holds the
+** foreign key.
+**
+** The OE_Default value is a place holder that means to use whatever
+** conflict resolution algorithm is required from context.
+**
+** The following symbolic values are used to record which type
+** of conflict resolution action to take.
+*/
+#define OE_None 0 /* There is no constraint to check */
+#define OE_Rollback 1 /* Fail the operation and rollback the transaction */
+#define OE_Abort 2 /* Back out changes but do no rollback transaction */
+#define OE_Fail 3 /* Stop the operation but leave all prior changes */
+#define OE_Ignore 4 /* Ignore the error. Do not do the INSERT or UPDATE */
+#define OE_Replace 5 /* Delete existing record, then do INSERT or UPDATE */
+#define OE_Update 6 /* Process as a DO UPDATE in an upsert */
+#define OE_Restrict 7 /* OE_Abort for IMMEDIATE, OE_Rollback for DEFERRED */
+#define OE_SetNull 8 /* Set the foreign key value to NULL */
+#define OE_SetDflt 9 /* Set the foreign key value to its default */
+#define OE_Cascade 10 /* Cascade the changes */
+#define OE_Default 11 /* Do whatever the default action is */
+
+
+/*
+** An instance of the following structure is passed as the first
+** argument to sqlite3VdbeKeyCompare and is used to control the
+** comparison of the two index keys.
+**
+** Note that aSortOrder[] and aColl[] have nField+1 slots. There
+** are nField slots for the columns of an index then one extra slot
+** for the rowid at the end.
+*/
+struct KeyInfo {
+ u32 nRef; /* Number of references to this KeyInfo object */
+ u8 enc; /* Text encoding - one of the SQLITE_UTF* values */
+ u16 nKeyField; /* Number of key columns in the index */
+ u16 nAllField; /* Total columns, including key plus others */
+ sqlite3 *db; /* The database connection */
+ u8 *aSortFlags; /* Sort order for each column. */
+ CollSeq *aColl[FLEXARRAY]; /* Collating sequence for each term of the key */
+};
+
+/* The size (in bytes) of a KeyInfo object with up to N fields */
+#define SZ_KEYINFO(N) (offsetof(KeyInfo,aColl) + (N)*sizeof(CollSeq*))
+
+/*
+** Allowed bit values for entries in the KeyInfo.aSortFlags[] array.
+*/
+#define KEYINFO_ORDER_DESC 0x01 /* DESC sort order */
+#define KEYINFO_ORDER_BIGNULL 0x02 /* NULL is larger than any other value */
+
+/*
+** This object holds a record which has been parsed out into individual
+** fields, for the purposes of doing a comparison.
+**
+** A record is an object that contains one or more fields of data.
+** Records are used to store the content of a table row and to store
+** the key of an index. A blob encoding of a record is created by
+** the OP_MakeRecord opcode of the VDBE and is disassembled by the
+** OP_Column opcode.
+**
+** An instance of this object serves as a "key" for doing a search on
+** an index b+tree. The goal of the search is to find the entry that
+** is closed to the key described by this object. This object might hold
+** just a prefix of the key. The number of fields is given by
+** pKeyInfo->nField.
+**
+** The r1 and r2 fields are the values to return if this key is less than
+** or greater than a key in the btree, respectively. These are normally
+** -1 and +1 respectively, but might be inverted to +1 and -1 if the b-tree
+** is in DESC order.
+**
+** The key comparison functions actually return default_rc when they find
+** an equals comparison. default_rc can be -1, 0, or +1. If there are
+** multiple entries in the b-tree with the same key (when only looking
+** at the first pKeyInfo->nFields,) then default_rc can be set to -1 to
+** cause the search to find the last match, or +1 to cause the search to
+** find the first match.
+**
+** The key comparison functions will set eqSeen to true if they ever
+** get and equal results when comparing this structure to a b-tree record.
+** When default_rc!=0, the search might end up on the record immediately
+** before the first match or immediately after the last match. The
+** eqSeen field will indicate whether or not an exact match exists in the
+** b-tree.
+*/
+struct UnpackedRecord {
+ KeyInfo *pKeyInfo; /* Collation and sort-order information */
+ Mem *aMem; /* Values */
+ union {
+ char *z; /* Cache of aMem[0].z for vdbeRecordCompareString() */
+ i64 i; /* Cache of aMem[0].u.i for vdbeRecordCompareInt() */
+ } u;
+ int n; /* Cache of aMem[0].n used by vdbeRecordCompareString() */
+ u16 nField; /* Number of entries in apMem[] */
+ i8 default_rc; /* Comparison result if keys are equal */
+ u8 errCode; /* Error detected by xRecordCompare (CORRUPT or NOMEM) */
+ i8 r1; /* Value to return if (lhs < rhs) */
+ i8 r2; /* Value to return if (lhs > rhs) */
+ u8 eqSeen; /* True if an equality comparison has been seen */
+};
+
+
+/*
+** Each SQL index is represented in memory by an
+** instance of the following structure.
+**
+** The columns of the table that are to be indexed are described
+** by the aiColumn[] field of this structure. For example, suppose
+** we have the following table and index:
+**
+** CREATE TABLE Ex1(c1 int, c2 int, c3 text);
+** CREATE INDEX Ex2 ON Ex1(c3,c1);
+**
+** In the Table structure describing Ex1, nCol==3 because there are
+** three columns in the table. In the Index structure describing
+** Ex2, nColumn==2 since 2 of the 3 columns of Ex1 are indexed.
+** The value of aiColumn is {2, 0}. aiColumn[0]==2 because the
+** first column to be indexed (c3) has an index of 2 in Ex1.aCol[].
+** The second column to be indexed (c1) has an index of 0 in
+** Ex1.aCol[], hence Ex2.aiColumn[1]==0.
+**
+** The Index.onError field determines whether or not the indexed columns
+** must be unique and what to do if they are not. When Index.onError=OE_None,
+** it means this is not a unique index. Otherwise it is a unique index
+** and the value of Index.onError indicates which conflict resolution
+** algorithm to employ when an attempt is made to insert a non-unique
+** element.
+**
+** The colNotIdxed bitmask is used in combination with SrcItem.colUsed
+** for a fast test to see if an index can serve as a covering index.
+** colNotIdxed has a 1 bit for every column of the original table that
+** is *not* available in the index. Thus the expression
+** "colUsed & colNotIdxed" will be non-zero if the index is not a
+** covering index. The most significant bit of of colNotIdxed will always
+** be true (note-20221022-a). If a column beyond the 63rd column of the
+** table is used, the "colUsed & colNotIdxed" test will always be non-zero
+** and we have to assume either that the index is not covering, or use
+** an alternative (slower) algorithm to determine whether or not
+** the index is covering.
+**
+** While parsing a CREATE TABLE or CREATE INDEX statement in order to
+** generate VDBE code (as opposed to parsing one read from an sqlite_schema
+** table as part of parsing an existing database schema), transient instances
+** of this structure may be created. In this case the Index.tnum variable is
+** used to store the address of a VDBE instruction, not a database page
+** number (it cannot - the database page is not allocated until the VDBE
+** program is executed). See convertToWithoutRowidTable() for details.
+*/
+struct Index {
+ char *zName; /* Name of this index */
+ i16 *aiColumn; /* Which columns are used by this index. 1st is 0 */
+ LogEst *aiRowLogEst; /* From ANALYZE: Est. rows selected by each column */
+ Table *pTable; /* The SQL table being indexed */
+ char *zColAff; /* String defining the affinity of each column */
+ Index *pNext; /* The next index associated with the same table */
+ Schema *pSchema; /* Schema containing this index */
+ u8 *aSortOrder; /* for each column: True==DESC, False==ASC */
+ const char **azColl; /* Array of collation sequence names for index */
+ Expr *pPartIdxWhere; /* WHERE clause for partial indices */
+ ExprList *aColExpr; /* Column expressions */
+ Pgno tnum; /* DB Page containing root of this index */
+ LogEst szIdxRow; /* Estimated average row size in bytes */
+ u16 nKeyCol; /* Number of columns forming the key */
+ u16 nColumn; /* Nr columns in btree. Can be 2*Table.nCol */
+ u8 onError; /* OE_Abort, OE_Ignore, OE_Replace, or OE_None */
+ unsigned idxType:2; /* 0:Normal 1:UNIQUE, 2:PRIMARY KEY, 3:IPK */
+ unsigned bUnordered:1; /* Use this index for == or IN queries only */
+ unsigned uniqNotNull:1; /* True if UNIQUE and NOT NULL for all columns */
+ unsigned isResized:1; /* True if resizeIndexObject() has been called */
+ unsigned isCovering:1; /* True if this is a covering index */
+ unsigned noSkipScan:1; /* Do not try to use skip-scan if true */
+ unsigned hasStat1:1; /* aiRowLogEst values come from sqlite_stat1 */
+ unsigned bNoQuery:1; /* Do not use this index to optimize queries */
+ unsigned bAscKeyBug:1; /* True if the bba7b69f9849b5bf bug applies */
+ unsigned bHasVCol:1; /* Index references one or more VIRTUAL columns */
+ unsigned bHasExpr:1; /* Index contains an expression, either a literal
+ ** expression, or a reference to a VIRTUAL column */
+#ifdef SQLITE_ENABLE_STAT4
+ int nSample; /* Number of elements in aSample[] */
+ int mxSample; /* Number of slots allocated to aSample[] */
+ int nSampleCol; /* Size of IndexSample.anEq[] and so on */
+ tRowcnt *aAvgEq; /* Average nEq values for keys not in aSample */
+ IndexSample *aSample; /* Samples of the left-most key */
+ tRowcnt *aiRowEst; /* Non-logarithmic stat1 data for this index */
+ tRowcnt nRowEst0; /* Non-logarithmic number of rows in the index */
+#endif
+ Bitmask colNotIdxed; /* Unindexed columns in pTab */
+};
+
+/*
+** Allowed values for Index.idxType
+*/
+#define SQLITE_IDXTYPE_APPDEF 0 /* Created using CREATE INDEX */
+#define SQLITE_IDXTYPE_UNIQUE 1 /* Implements a UNIQUE constraint */
+#define SQLITE_IDXTYPE_PRIMARYKEY 2 /* Is the PRIMARY KEY for the table */
+#define SQLITE_IDXTYPE_IPK 3 /* INTEGER PRIMARY KEY index */
+
+/* Return true if index X is a PRIMARY KEY index */
+#define IsPrimaryKeyIndex(X) ((X)->idxType==SQLITE_IDXTYPE_PRIMARYKEY)
+
+/* Return true if index X is a UNIQUE index */
+#define IsUniqueIndex(X) ((X)->onError!=OE_None)
+
+/* The Index.aiColumn[] values are normally positive integer. But
+** there are some negative values that have special meaning:
+*/
+#define XN_ROWID (-1) /* Indexed column is the rowid */
+#define XN_EXPR (-2) /* Indexed column is an expression */
+
+/*
+** Each sample stored in the sqlite_stat4 table is represented in memory
+** using a structure of this type. See documentation at the top of the
+** analyze.c source file for additional information.
+*/
+struct IndexSample {
+ void *p; /* Pointer to sampled record */
+ int n; /* Size of record in bytes */
+ tRowcnt *anEq; /* Est. number of rows where the key equals this sample */
+ tRowcnt *anLt; /* Est. number of rows where key is less than this sample */
+ tRowcnt *anDLt; /* Est. number of distinct keys less than this sample */
+};
+
+/*
+** Possible values to use within the flags argument to sqlite3GetToken().
+*/
+#define SQLITE_TOKEN_QUOTED 0x1 /* Token is a quoted identifier. */
+#define SQLITE_TOKEN_KEYWORD 0x2 /* Token is a keyword. */
+
+/*
+** Each token coming out of the lexer is an instance of
+** this structure. Tokens are also used as part of an expression.
+**
+** The memory that "z" points to is owned by other objects. Take care
+** that the owner of the "z" string does not deallocate the string before
+** the Token goes out of scope! Very often, the "z" points to some place
+** in the middle of the Parse.zSql text. But it might also point to a
+** static string.
+*/
+struct Token {
+ const char *z; /* Text of the token. Not NULL-terminated! */
+ unsigned int n; /* Number of characters in this token */
+};
+
+/*
+** An instance of this structure contains information needed to generate
+** code for a SELECT that contains aggregate functions.
+**
+** If Expr.op==TK_AGG_COLUMN or TK_AGG_FUNCTION then Expr.pAggInfo is a
+** pointer to this structure. The Expr.iAgg field is the index in
+** AggInfo.aCol[] or AggInfo.aFunc[] of information needed to generate
+** code for that node.
+**
+** AggInfo.pGroupBy and AggInfo.aFunc.pExpr point to fields within the
+** original Select structure that describes the SELECT statement. These
+** fields do not need to be freed when deallocating the AggInfo structure.
+*/
+struct AggInfo {
+ u8 directMode; /* Direct rendering mode means take data directly
+ ** from source tables rather than from accumulators */
+ u8 useSortingIdx; /* In direct mode, reference the sorting index rather
+ ** than the source table */
+ u32 nSortingColumn; /* Number of columns in the sorting index */
+ int sortingIdx; /* Cursor number of the sorting index */
+ int sortingIdxPTab; /* Cursor number of pseudo-table */
+ int iFirstReg; /* First register in range for aCol[] and aFunc[] */
+ ExprList *pGroupBy; /* The group by clause */
+ struct AggInfo_col { /* For each column used in source tables */
+ Table *pTab; /* Source table */
+ Expr *pCExpr; /* The original expression */
+ int iTable; /* Cursor number of the source table */
+ int iColumn; /* Column number within the source table */
+ int iSorterColumn; /* Column number in the sorting index */
+ } *aCol;
+ int nColumn; /* Number of used entries in aCol[] */
+ int nAccumulator; /* Number of columns that show through to the output.
+ ** Additional columns are used only as parameters to
+ ** aggregate functions */
+ struct AggInfo_func { /* For each aggregate function */
+ Expr *pFExpr; /* Expression encoding the function */
+ FuncDef *pFunc; /* The aggregate function implementation */
+ int iDistinct; /* Ephemeral table used to enforce DISTINCT */
+ int iDistAddr; /* Address of OP_OpenEphemeral */
+ int iOBTab; /* Ephemeral table to implement ORDER BY */
+ u8 bOBPayload; /* iOBTab has payload columns separate from key */
+ u8 bOBUnique; /* Enforce uniqueness on iOBTab keys */
+ u8 bUseSubtype; /* Transfer subtype info through sorter */
+ } *aFunc;
+ int nFunc; /* Number of entries in aFunc[] */
+ u32 selId; /* Select to which this AggInfo belongs */
+#ifdef SQLITE_DEBUG
+ Select *pSelect; /* SELECT statement that this AggInfo supports */
+#endif
+};
+
+/*
+** Macros to compute aCol[] and aFunc[] register numbers.
+**
+** These macros should not be used prior to the call to
+** assignAggregateRegisters() that computes the value of pAggInfo->iFirstReg.
+** The assert()s that are part of this macro verify that constraint.
+*/
+#ifndef NDEBUG
+#define AggInfoColumnReg(A,I) (assert((A)->iFirstReg),(A)->iFirstReg+(I))
+#define AggInfoFuncReg(A,I) \
+ (assert((A)->iFirstReg),(A)->iFirstReg+(A)->nColumn+(I))
+#else
+#define AggInfoColumnReg(A,I) ((A)->iFirstReg+(I))
+#define AggInfoFuncReg(A,I) \
+ ((A)->iFirstReg+(A)->nColumn+(I))
+#endif
+
+/*
+** The datatype ynVar is a signed integer, either 16-bit or 32-bit.
+** Usually it is 16-bits. But if SQLITE_MAX_VARIABLE_NUMBER is greater
+** than 32767 we have to make it 32-bit. 16-bit is preferred because
+** it uses less memory in the Expr object, which is a big memory user
+** in systems with lots of prepared statements. And few applications
+** need more than about 10 or 20 variables. But some extreme users want
+** to have prepared statements with over 32766 variables, and for them
+** the option is available (at compile-time).
+*/
+#if SQLITE_MAX_VARIABLE_NUMBER<32767
+typedef i16 ynVar;
+#else
+typedef int ynVar;
+#endif
+
+/*
+** Each node of an expression in the parse tree is an instance
+** of this structure.
+**
+** Expr.op is the opcode. The integer parser token codes are reused
+** as opcodes here. For example, the parser defines TK_GE to be an integer
+** code representing the ">=" operator. This same integer code is reused
+** to represent the greater-than-or-equal-to operator in the expression
+** tree.
+**
+** If the expression is an SQL literal (TK_INTEGER, TK_FLOAT, TK_BLOB,
+** or TK_STRING), then Expr.u.zToken contains the text of the SQL literal. If
+** the expression is a variable (TK_VARIABLE), then Expr.u.zToken contains the
+** variable name. Finally, if the expression is an SQL function (TK_FUNCTION),
+** then Expr.u.zToken contains the name of the function.
+**
+** Expr.pRight and Expr.pLeft are the left and right subexpressions of a
+** binary operator. Either or both may be NULL.
+**
+** Expr.x.pList is a list of arguments if the expression is an SQL function,
+** a CASE expression or an IN expression of the form " IN (, ...)".
+** Expr.x.pSelect is used if the expression is a sub-select or an expression of
+** the form " IN (SELECT ...)". If the EP_xIsSelect bit is set in the
+** Expr.flags mask, then Expr.x.pSelect is valid. Otherwise, Expr.x.pList is
+** valid.
+**
+** An expression of the form ID or ID.ID refers to a column in a table.
+** For such expressions, Expr.op is set to TK_COLUMN and Expr.iTable is
+** the integer cursor number of a VDBE cursor pointing to that table and
+** Expr.iColumn is the column number for the specific column. If the
+** expression is used as a result in an aggregate SELECT, then the
+** value is also stored in the Expr.iAgg column in the aggregate so that
+** it can be accessed after all aggregates are computed.
+**
+** If the expression is an unbound variable marker (a question mark
+** character '?' in the original SQL) then the Expr.iTable holds the index
+** number for that variable.
+**
+** If the expression is a subquery then Expr.iColumn holds an integer
+** register number containing the result of the subquery. If the
+** subquery gives a constant result, then iTable is -1. If the subquery
+** gives a different answer at different times during statement processing
+** then iTable is the address of a subroutine that computes the subquery.
+**
+** If the Expr is of type OP_Column, and the table it is selecting from
+** is a disk table or the "old.*" pseudo-table, then pTab points to the
+** corresponding table definition.
+**
+** ALLOCATION NOTES:
+**
+** Expr objects can use a lot of memory space in database schema. To
+** help reduce memory requirements, sometimes an Expr object will be
+** truncated. And to reduce the number of memory allocations, sometimes
+** two or more Expr objects will be stored in a single memory allocation,
+** together with Expr.u.zToken strings.
+**
+** If the EP_Reduced and EP_TokenOnly flags are set when
+** an Expr object is truncated. When EP_Reduced is set, then all
+** the child Expr objects in the Expr.pLeft and Expr.pRight subtrees
+** are contained within the same memory allocation. Note, however, that
+** the subtrees in Expr.x.pList or Expr.x.pSelect are always separately
+** allocated, regardless of whether or not EP_Reduced is set.
+*/
+struct Expr {
+ u8 op; /* Operation performed by this node */
+ char affExpr; /* affinity, or RAISE type */
+ u8 op2; /* TK_REGISTER/TK_TRUTH: original value of Expr.op
+ ** TK_COLUMN: the value of p5 for OP_Column
+ ** TK_AGG_FUNCTION: nesting depth
+ ** TK_FUNCTION: NC_SelfRef flag if needs OP_PureFunc */
+#ifdef SQLITE_DEBUG
+ u8 vvaFlags; /* Verification flags. */
+#endif
+ u32 flags; /* Various flags. EP_* See below */
+ union {
+ char *zToken; /* Token value. Zero terminated and dequoted */
+ int iValue; /* Non-negative integer value if EP_IntValue */
+ } u;
+
+ /* If the EP_TokenOnly flag is set in the Expr.flags mask, then no
+ ** space is allocated for the fields below this point. An attempt to
+ ** access them will result in a segfault or malfunction.
+ *********************************************************************/
+
+ Expr *pLeft; /* Left subnode */
+ Expr *pRight; /* Right subnode */
+ union {
+ ExprList *pList; /* op = IN, EXISTS, SELECT, CASE, FUNCTION, BETWEEN */
+ Select *pSelect; /* EP_xIsSelect and op = IN, EXISTS, SELECT */
+ } x;
+
+ /* If the EP_Reduced flag is set in the Expr.flags mask, then no
+ ** space is allocated for the fields below this point. An attempt to
+ ** access them will result in a segfault or malfunction.
+ *********************************************************************/
+
+#if SQLITE_MAX_EXPR_DEPTH>0
+ int nHeight; /* Height of the tree headed by this node */
+#endif
+ int iTable; /* TK_COLUMN: cursor number of table holding column
+ ** TK_REGISTER: register number
+ ** TK_TRIGGER: 1 -> new, 0 -> old
+ ** EP_Unlikely: 134217728 times likelihood
+ ** TK_IN: ephemeral table holding RHS
+ ** TK_SELECT_COLUMN: Number of columns on the LHS
+ ** TK_SELECT: 1st register of result vector */
+ ynVar iColumn; /* TK_COLUMN: column index. -1 for rowid.
+ ** TK_VARIABLE: variable number (always >= 1).
+ ** TK_SELECT_COLUMN: column of the result vector */
+ i16 iAgg; /* Which entry in pAggInfo->aCol[] or ->aFunc[] */
+ union {
+ int iJoin; /* If EP_OuterON or EP_InnerON, the right table */
+ int iOfst; /* else: start of token from start of statement */
+ } w;
+ AggInfo *pAggInfo; /* Used by TK_AGG_COLUMN and TK_AGG_FUNCTION */
+ union {
+ Table *pTab; /* TK_COLUMN: Table containing column. Can be NULL
+ ** for a column of an index on an expression */
+ Window *pWin; /* EP_WinFunc: Window/Filter defn for a function */
+ int nReg; /* TK_NULLS: Number of registers to NULL out */
+ struct { /* TK_IN, TK_SELECT, and TK_EXISTS */
+ int iAddr; /* Subroutine entry address */
+ int regReturn; /* Register used to hold return address */
+ } sub;
+ } y;
+};
+
+/* The following are the meanings of bits in the Expr.flags field.
+** Value restrictions:
+**
+** EP_Agg == NC_HasAgg == SF_HasAgg
+** EP_Win == NC_HasWin
+*/
+#define EP_OuterON 0x000001 /* Originates in ON/USING clause of outer join */
+#define EP_InnerON 0x000002 /* Originates in ON/USING of an inner join */
+#define EP_Distinct 0x000004 /* Aggregate function with DISTINCT keyword */
+#define EP_HasFunc 0x000008 /* Contains one or more functions of any kind */
+#define EP_Agg 0x000010 /* Contains one or more aggregate functions */
+#define EP_FixedCol 0x000020 /* TK_Column with a known fixed value */
+#define EP_VarSelect 0x000040 /* pSelect is correlated, not constant */
+#define EP_DblQuoted 0x000080 /* token.z was originally in "..." */
+#define EP_InfixFunc 0x000100 /* True for an infix function: LIKE, GLOB, etc */
+#define EP_Collate 0x000200 /* Tree contains a TK_COLLATE operator */
+#define EP_Commuted 0x000400 /* Comparison operator has been commuted */
+#define EP_IntValue 0x000800 /* Integer value contained in u.iValue */
+#define EP_xIsSelect 0x001000 /* x.pSelect is valid (otherwise x.pList is) */
+#define EP_Skip 0x002000 /* Operator does not contribute to affinity */
+#define EP_Reduced 0x004000 /* Expr struct EXPR_REDUCEDSIZE bytes only */
+#define EP_Win 0x008000 /* Contains window functions */
+#define EP_TokenOnly 0x010000 /* Expr struct EXPR_TOKENONLYSIZE bytes only */
+#define EP_FullSize 0x020000 /* Expr structure must remain full sized */
+#define EP_IfNullRow 0x040000 /* The TK_IF_NULL_ROW opcode */
+#define EP_Unlikely 0x080000 /* unlikely() or likelihood() function */
+#define EP_ConstFunc 0x100000 /* A SQLITE_FUNC_CONSTANT or _SLOCHNG function */
+#define EP_CanBeNull 0x200000 /* Can be null despite NOT NULL constraint */
+#define EP_Subquery 0x400000 /* Tree contains a TK_SELECT operator */
+#define EP_Leaf 0x800000 /* Expr.pLeft, .pRight, .u.pSelect all NULL */
+#define EP_WinFunc 0x1000000 /* TK_FUNCTION with Expr.y.pWin set */
+#define EP_Subrtn 0x2000000 /* Uses Expr.y.sub. TK_IN, _SELECT, or _EXISTS */
+#define EP_Quoted 0x4000000 /* TK_ID was originally quoted */
+#define EP_Static 0x8000000 /* Held in memory not obtained from malloc() */
+#define EP_IsTrue 0x10000000 /* Always has boolean value of TRUE */
+#define EP_IsFalse 0x20000000 /* Always has boolean value of FALSE */
+#define EP_FromDDL 0x40000000 /* Originates from sqlite_schema */
+#define EP_SubtArg 0x80000000 /* Is argument to SQLITE_SUBTYPE function */
+
+/* The EP_Propagate mask is a set of properties that automatically propagate
+** upwards into parent nodes.
+*/
+#define EP_Propagate (EP_Collate|EP_Subquery|EP_HasFunc)
+
+/* Macros can be used to test, set, or clear bits in the
+** Expr.flags field.
+*/
+#define ExprHasProperty(E,P) (((E)->flags&(u32)(P))!=0)
+#define ExprHasAllProperty(E,P) (((E)->flags&(u32)(P))==(u32)(P))
+#define ExprSetProperty(E,P) (E)->flags|=(u32)(P)
+#define ExprClearProperty(E,P) (E)->flags&=~(u32)(P)
+#define ExprAlwaysTrue(E) (((E)->flags&(EP_OuterON|EP_IsTrue))==EP_IsTrue)
+#define ExprAlwaysFalse(E) (((E)->flags&(EP_OuterON|EP_IsFalse))==EP_IsFalse)
+#define ExprIsFullSize(E) (((E)->flags&(EP_Reduced|EP_TokenOnly))==0)
+
+/* Macros used to ensure that the correct members of unions are accessed
+** in Expr.
+*/
+#define ExprUseUToken(E) (((E)->flags&EP_IntValue)==0)
+#define ExprUseUValue(E) (((E)->flags&EP_IntValue)!=0)
+#define ExprUseWOfst(E) (((E)->flags&(EP_InnerON|EP_OuterON))==0)
+#define ExprUseWJoin(E) (((E)->flags&(EP_InnerON|EP_OuterON))!=0)
+#define ExprUseXList(E) (((E)->flags&EP_xIsSelect)==0)
+#define ExprUseXSelect(E) (((E)->flags&EP_xIsSelect)!=0)
+#define ExprUseYTab(E) (((E)->flags&(EP_WinFunc|EP_Subrtn))==0)
+#define ExprUseYWin(E) (((E)->flags&EP_WinFunc)!=0)
+#define ExprUseYSub(E) (((E)->flags&EP_Subrtn)!=0)
+
+/* Flags for use with Expr.vvaFlags
+*/
+#define EP_NoReduce 0x01 /* Cannot EXPRDUP_REDUCE this Expr */
+#define EP_Immutable 0x02 /* Do not change this Expr node */
+
+/* The ExprSetVVAProperty() macro is used for Verification, Validation,
+** and Accreditation only. It works like ExprSetProperty() during VVA
+** processes but is a no-op for delivery.
+*/
+#ifdef SQLITE_DEBUG
+# define ExprSetVVAProperty(E,P) (E)->vvaFlags|=(P)
+# define ExprHasVVAProperty(E,P) (((E)->vvaFlags&(P))!=0)
+# define ExprClearVVAProperties(E) (E)->vvaFlags = 0
+#else
+# define ExprSetVVAProperty(E,P)
+# define ExprHasVVAProperty(E,P) 0
+# define ExprClearVVAProperties(E)
+#endif
+
+/*
+** Macros to determine the number of bytes required by a normal Expr
+** struct, an Expr struct with the EP_Reduced flag set in Expr.flags
+** and an Expr struct with the EP_TokenOnly flag set.
+*/
+#define EXPR_FULLSIZE sizeof(Expr) /* Full size */
+#define EXPR_REDUCEDSIZE offsetof(Expr,iTable) /* Common features */
+#define EXPR_TOKENONLYSIZE offsetof(Expr,pLeft) /* Fewer features */
+
+/*
+** Flags passed to the sqlite3ExprDup() function. See the header comment
+** above sqlite3ExprDup() for details.
+*/
+#define EXPRDUP_REDUCE 0x0001 /* Used reduced-size Expr nodes */
+
+/*
+** True if the expression passed as an argument was a function with
+** an OVER() clause (a window function).
+*/
+#ifdef SQLITE_OMIT_WINDOWFUNC
+# define IsWindowFunc(p) 0
+#else
+# define IsWindowFunc(p) ( \
+ ExprHasProperty((p), EP_WinFunc) && p->y.pWin->eFrmType!=TK_FILTER \
+ )
+#endif
+
+/*
+** A list of expressions. Each expression may optionally have a
+** name. An expr/name combination can be used in several ways, such
+** as the list of "expr AS ID" fields following a "SELECT" or in the
+** list of "ID = expr" items in an UPDATE. A list of expressions can
+** also be used as the argument to a function, in which case the a.zName
+** field is not used.
+**
+** In order to try to keep memory usage down, the Expr.a.zEName field
+** is used for multiple purposes:
+**
+** eEName Usage
+** ---------- -------------------------
+** ENAME_NAME (1) the AS of result set column
+** (2) COLUMN= of an UPDATE
+**
+** ENAME_TAB DB.TABLE.NAME used to resolve names
+** of subqueries
+**
+** ENAME_SPAN Text of the original result set
+** expression.
+*/
+struct ExprList {
+ int nExpr; /* Number of expressions on the list */
+ int nAlloc; /* Number of a[] slots allocated */
+ struct ExprList_item { /* For each expression in the list */
+ Expr *pExpr; /* The parse tree for this expression */
+ char *zEName; /* Token associated with this expression */
+ struct {
+ u8 sortFlags; /* Mask of KEYINFO_ORDER_* flags */
+ unsigned eEName :2; /* Meaning of zEName */
+ unsigned done :1; /* Indicates when processing is finished */
+ unsigned reusable :1; /* Constant expression is reusable */
+ unsigned bSorterRef :1; /* Defer evaluation until after sorting */
+ unsigned bNulls :1; /* True if explicit "NULLS FIRST/LAST" */
+ unsigned bUsed :1; /* This column used in a SF_NestedFrom subquery */
+ unsigned bUsingTerm:1; /* Term from the USING clause of a NestedFrom */
+ unsigned bNoExpand: 1; /* Term is an auxiliary in NestedFrom and should
+ ** not be expanded by "*" in parent queries */
+ } fg;
+ union {
+ struct { /* Used by any ExprList other than Parse.pConsExpr */
+ u16 iOrderByCol; /* For ORDER BY, column number in result set */
+ u16 iAlias; /* Index into Parse.aAlias[] for zName */
+ } x;
+ int iConstExprReg; /* Register in which Expr value is cached. Used only
+ ** by Parse.pConstExpr */
+ } u;
+ } a[FLEXARRAY]; /* One slot for each expression in the list */
+};
+
+/* The size (in bytes) of an ExprList object that is big enough to hold
+** as many as N expressions. */
+#define SZ_EXPRLIST(N) \
+ (offsetof(ExprList,a) + (N)*sizeof(struct ExprList_item))
+
+/*
+** Allowed values for Expr.a.eEName
+*/
+#define ENAME_NAME 0 /* The AS clause of a result set */
+#define ENAME_SPAN 1 /* Complete text of the result set expression */
+#define ENAME_TAB 2 /* "DB.TABLE.NAME" for the result set */
+#define ENAME_ROWID 3 /* "DB.TABLE._rowid_" for * expansion of rowid */
+
+/*
+** An instance of this structure can hold a simple list of identifiers,
+** such as the list "a,b,c" in the following statements:
+**
+** INSERT INTO t(a,b,c) VALUES ...;
+** CREATE INDEX idx ON t(a,b,c);
+** CREATE TRIGGER trig BEFORE UPDATE ON t(a,b,c) ...;
+**
+** The IdList.a.idx field is used when the IdList represents the list of
+** column names after a table name in an INSERT statement. In the statement
+**
+** INSERT INTO t(a,b,c) ...
+**
+** If "a" is the k-th column of table "t", then IdList.a[0].idx==k.
+*/
+struct IdList {
+ int nId; /* Number of identifiers on the list */
+ struct IdList_item {
+ char *zName; /* Name of the identifier */
+ } a[FLEXARRAY];
+};
+
+/* The size (in bytes) of an IdList object that can hold up to N IDs. */
+#define SZ_IDLIST(N) (offsetof(IdList,a)+(N)*sizeof(struct IdList_item))
+
+/*
+** Allowed values for IdList.eType, which determines which value of the a.u4
+** is valid.
+*/
+#define EU4_NONE 0 /* Does not use IdList.a.u4 */
+#define EU4_IDX 1 /* Uses IdList.a.u4.idx */
+#define EU4_EXPR 2 /* Uses IdList.a.u4.pExpr -- NOT CURRENTLY USED */
+
+/*
+** Details of the implementation of a subquery.
+*/
+struct Subquery {
+ Select *pSelect; /* A SELECT statement used in place of a table name */
+ int addrFillSub; /* Address of subroutine to initialize a subquery */
+ int regReturn; /* Register holding return address of addrFillSub */
+ int regResult; /* Registers holding results of a co-routine */
+};
+
+/*
+** The SrcItem object represents a single term in the FROM clause of a query.
+** The SrcList object is mostly an array of SrcItems.
+**
+** The jointype starts out showing the join type between the current table
+** and the next table on the list. The parser builds the list this way.
+** But sqlite3SrcListShiftJoinType() later shifts the jointypes so that each
+** jointype expresses the join between the table and the previous table.
+**
+** In the colUsed field, the high-order bit (bit 63) is set if the table
+** contains more than 63 columns and the 64-th or later column is used.
+**
+** Aggressive use of "union" helps keep the size of the object small. This
+** has been shown to boost performance, in addition to saving memory.
+** Access to union elements is gated by the following rules which should
+** always be checked, either by an if-statement or by an assert().
+**
+** Field Only access if this is true
+** --------------- -----------------------------------
+** u1.zIndexedBy fg.isIndexedBy
+** u1.pFuncArg fg.isTabFunc
+** u1.nRow !fg.isTabFunc && !fg.isIndexedBy
+**
+** u2.pIBIndex fg.isIndexedBy
+** u2.pCteUse fg.isCte
+**
+** u3.pOn !fg.isUsing
+** u3.pUsing fg.isUsing
+**
+** u4.zDatabase !fg.fixedSchema && !fg.isSubquery
+** u4.pSchema fg.fixedSchema
+** u4.pSubq fg.isSubquery
+**
+** See also the sqlite3SrcListDelete() routine for assert() statements that
+** check invariants on the fields of this object, especially the flags
+** inside the fg struct.
+*/
+struct SrcItem {
+ char *zName; /* Name of the table */
+ char *zAlias; /* The "B" part of a "A AS B" phrase. zName is the "A" */
+ Table *pSTab; /* Table object for zName. Mnemonic: Srcitem-TABle */
+ struct {
+ u8 jointype; /* Type of join between this table and the previous */
+ unsigned notIndexed :1; /* True if there is a NOT INDEXED clause */
+ unsigned isIndexedBy :1; /* True if there is an INDEXED BY clause */
+ unsigned isSubquery :1; /* True if this term is a subquery */
+ unsigned isTabFunc :1; /* True if table-valued-function syntax */
+ unsigned isCorrelated :1; /* True if sub-query is correlated */
+ unsigned isMaterialized:1; /* This is a materialized view */
+ unsigned viaCoroutine :1; /* Implemented as a co-routine */
+ unsigned isRecursive :1; /* True for recursive reference in WITH */
+ unsigned fromDDL :1; /* Comes from sqlite_schema */
+ unsigned isCte :1; /* This is a CTE */
+ unsigned notCte :1; /* This item may not match a CTE */
+ unsigned isUsing :1; /* u3.pUsing is valid */
+ unsigned isOn :1; /* u3.pOn was once valid and non-NULL */
+ unsigned isSynthUsing :1; /* u3.pUsing is synthesized from NATURAL */
+ unsigned isNestedFrom :1; /* pSelect is a SF_NestedFrom subquery */
+ unsigned rowidUsed :1; /* The ROWID of this table is referenced */
+ unsigned fixedSchema :1; /* Uses u4.pSchema, not u4.zDatabase */
+ unsigned hadSchema :1; /* Had u4.zDatabase before u4.pSchema */
+ } fg;
+ int iCursor; /* The VDBE cursor number used to access this table */
+ Bitmask colUsed; /* Bit N set if column N used. Details above for N>62 */
+ union {
+ char *zIndexedBy; /* Identifier from "INDEXED BY " clause */
+ ExprList *pFuncArg; /* Arguments to table-valued-function */
+ u32 nRow; /* Number of rows in a VALUES clause */
+ } u1;
+ union {
+ Index *pIBIndex; /* Index structure corresponding to u1.zIndexedBy */
+ CteUse *pCteUse; /* CTE Usage info when fg.isCte is true */
+ } u2;
+ union {
+ Expr *pOn; /* fg.isUsing==0 => The ON clause of a join */
+ IdList *pUsing; /* fg.isUsing==1 => The USING clause of a join */
+ } u3;
+ union {
+ Schema *pSchema; /* Schema to which this item is fixed */
+ char *zDatabase; /* Name of database holding this table */
+ Subquery *pSubq; /* Description of a subquery */
+ } u4;
+};
+
+/*
+** The OnOrUsing object represents either an ON clause or a USING clause.
+** It can never be both at the same time, but it can be neither.
+*/
+struct OnOrUsing {
+ Expr *pOn; /* The ON clause of a join */
+ IdList *pUsing; /* The USING clause of a join */
+};
+
+/*
+** This object represents one or more tables that are the source of
+** content for an SQL statement. For example, a single SrcList object
+** is used to hold the FROM clause of a SELECT statement. SrcList also
+** represents the target tables for DELETE, INSERT, and UPDATE statements.
+**
+*/
+struct SrcList {
+ int nSrc; /* Number of tables or subqueries in the FROM clause */
+ u32 nAlloc; /* Number of entries allocated in a[] below */
+ SrcItem a[FLEXARRAY]; /* One entry for each identifier on the list */
+};
+
+/* Size (in bytes) of a SrcList object that can hold as many as N
+** SrcItem objects. */
+#define SZ_SRCLIST(N) (offsetof(SrcList,a)+(N)*sizeof(SrcItem))
+
+/* Size (in bytes( of a SrcList object that holds 1 SrcItem. This is a
+** special case of SZ_SRCITEM(1) that comes up often. */
+#define SZ_SRCLIST_1 (offsetof(SrcList,a)+sizeof(SrcItem))
+
+/*
+** Permitted values of the SrcList.a.jointype field
+*/
+#define JT_INNER 0x01 /* Any kind of inner or cross join */
+#define JT_CROSS 0x02 /* Explicit use of the CROSS keyword */
+#define JT_NATURAL 0x04 /* True for a "natural" join */
+#define JT_LEFT 0x08 /* Left outer join */
+#define JT_RIGHT 0x10 /* Right outer join */
+#define JT_OUTER 0x20 /* The "OUTER" keyword is present */
+#define JT_LTORJ 0x40 /* One of the LEFT operands of a RIGHT JOIN
+ ** Mnemonic: Left Table Of Right Join */
+#define JT_ERROR 0x80 /* unknown or unsupported join type */
+
+/*
+** Flags appropriate for the wctrlFlags parameter of sqlite3WhereBegin()
+** and the WhereInfo.wctrlFlags member.
+**
+** Value constraints (enforced via assert()):
+** WHERE_USE_LIMIT == SF_FixedLimit
+*/
+#define WHERE_ORDERBY_NORMAL 0x0000 /* No-op */
+#define WHERE_ORDERBY_MIN 0x0001 /* ORDER BY processing for min() func */
+#define WHERE_ORDERBY_MAX 0x0002 /* ORDER BY processing for max() func */
+#define WHERE_ONEPASS_DESIRED 0x0004 /* Want to do one-pass UPDATE/DELETE */
+#define WHERE_ONEPASS_MULTIROW 0x0008 /* ONEPASS is ok with multiple rows */
+#define WHERE_DUPLICATES_OK 0x0010 /* Ok to return a row more than once */
+#define WHERE_OR_SUBCLAUSE 0x0020 /* Processing a sub-WHERE as part of
+ ** the OR optimization */
+#define WHERE_GROUPBY 0x0040 /* pOrderBy is really a GROUP BY */
+#define WHERE_DISTINCTBY 0x0080 /* pOrderby is really a DISTINCT clause */
+#define WHERE_WANT_DISTINCT 0x0100 /* All output needs to be distinct */
+#define WHERE_SORTBYGROUP 0x0200 /* Support sqlite3WhereIsSorted() */
+#define WHERE_AGG_DISTINCT 0x0400 /* Query is "SELECT agg(DISTINCT ...)" */
+#define WHERE_ORDERBY_LIMIT 0x0800 /* ORDERBY+LIMIT on the inner loop */
+#define WHERE_RIGHT_JOIN 0x1000 /* Processing a RIGHT JOIN */
+#define WHERE_KEEP_ALL_JOINS 0x2000 /* Do not do the omit-noop-join opt */
+#define WHERE_USE_LIMIT 0x4000 /* Use the LIMIT in cost estimates */
+ /* 0x8000 not currently used */
+
+/* Allowed return values from sqlite3WhereIsDistinct()
+*/
+#define WHERE_DISTINCT_NOOP 0 /* DISTINCT keyword not used */
+#define WHERE_DISTINCT_UNIQUE 1 /* No duplicates */
+#define WHERE_DISTINCT_ORDERED 2 /* All duplicates are adjacent */
+#define WHERE_DISTINCT_UNORDERED 3 /* Duplicates are scattered */
+
+/*
+** A NameContext defines a context in which to resolve table and column
+** names. The context consists of a list of tables (the pSrcList) field and
+** a list of named expression (pEList). The named expression list may
+** be NULL. The pSrc corresponds to the FROM clause of a SELECT or
+** to the table being operated on by INSERT, UPDATE, or DELETE. The
+** pEList corresponds to the result set of a SELECT and is NULL for
+** other statements.
+**
+** NameContexts can be nested. When resolving names, the inner-most
+** context is searched first. If no match is found, the next outer
+** context is checked. If there is still no match, the next context
+** is checked. This process continues until either a match is found
+** or all contexts are check. When a match is found, the nRef member of
+** the context containing the match is incremented.
+**
+** Each subquery gets a new NameContext. The pNext field points to the
+** NameContext in the parent query. Thus the process of scanning the
+** NameContext list corresponds to searching through successively outer
+** subqueries looking for a match.
+*/
+struct NameContext {
+ Parse *pParse; /* The parser */
+ SrcList *pSrcList; /* One or more tables used to resolve names */
+ union {
+ ExprList *pEList; /* Optional list of result-set columns */
+ AggInfo *pAggInfo; /* Information about aggregates at this level */
+ Upsert *pUpsert; /* ON CONFLICT clause information from an upsert */
+ int iBaseReg; /* For TK_REGISTER when parsing RETURNING */
+ } uNC;
+ NameContext *pNext; /* Next outer name context. NULL for outermost */
+ int nRef; /* Number of names resolved by this context */
+ int nNcErr; /* Number of errors encountered while resolving names */
+ int ncFlags; /* Zero or more NC_* flags defined below */
+ u32 nNestedSelect; /* Number of nested selects using this NC */
+ Select *pWinSelect; /* SELECT statement for any window functions */
+};
+
+/*
+** Allowed values for the NameContext, ncFlags field.
+**
+** Value constraints (all checked via assert()):
+** NC_HasAgg == SF_HasAgg == EP_Agg
+** NC_MinMaxAgg == SF_MinMaxAgg == SQLITE_FUNC_MINMAX
+** NC_OrderAgg == SF_OrderByReqd == SQLITE_FUNC_ANYORDER
+** NC_HasWin == EP_Win
+**
+*/
+#define NC_AllowAgg 0x000001 /* Aggregate functions are allowed here */
+#define NC_PartIdx 0x000002 /* True if resolving a partial index WHERE */
+#define NC_IsCheck 0x000004 /* True if resolving a CHECK constraint */
+#define NC_GenCol 0x000008 /* True for a GENERATED ALWAYS AS clause */
+#define NC_HasAgg 0x000010 /* One or more aggregate functions seen */
+#define NC_IdxExpr 0x000020 /* True if resolving columns of CREATE INDEX */
+#define NC_SelfRef 0x00002e /* Combo: PartIdx, isCheck, GenCol, and IdxExpr */
+#define NC_Subquery 0x000040 /* A subquery has been seen */
+#define NC_UEList 0x000080 /* True if uNC.pEList is used */
+#define NC_UAggInfo 0x000100 /* True if uNC.pAggInfo is used */
+#define NC_UUpsert 0x000200 /* True if uNC.pUpsert is used */
+#define NC_UBaseReg 0x000400 /* True if uNC.iBaseReg is used */
+#define NC_MinMaxAgg 0x001000 /* min/max aggregates seen. See note above */
+/* 0x002000 // available for reuse */
+#define NC_AllowWin 0x004000 /* Window functions are allowed here */
+#define NC_HasWin 0x008000 /* One or more window functions seen */
+#define NC_IsDDL 0x010000 /* Resolving names in a CREATE statement */
+#define NC_InAggFunc 0x020000 /* True if analyzing arguments to an agg func */
+#define NC_FromDDL 0x040000 /* SQL text comes from sqlite_schema */
+#define NC_NoSelect 0x080000 /* Do not descend into sub-selects */
+#define NC_Where 0x100000 /* Processing WHERE clause of a SELECT */
+#define NC_OrderAgg 0x8000000 /* Has an aggregate other than count/min/max */
+
+/*
+** An instance of the following object describes a single ON CONFLICT
+** clause in an upsert.
+**
+** The pUpsertTarget field is only set if the ON CONFLICT clause includes
+** conflict-target clause. (In "ON CONFLICT(a,b)" the "(a,b)" is the
+** conflict-target clause.) The pUpsertTargetWhere is the optional
+** WHERE clause used to identify partial unique indexes.
+**
+** pUpsertSet is the list of column=expr terms of the UPDATE statement.
+** The pUpsertSet field is NULL for a ON CONFLICT DO NOTHING. The
+** pUpsertWhere is the WHERE clause for the UPDATE and is NULL if the
+** WHERE clause is omitted.
+*/
+struct Upsert {
+ ExprList *pUpsertTarget; /* Optional description of conflict target */
+ Expr *pUpsertTargetWhere; /* WHERE clause for partial index targets */
+ ExprList *pUpsertSet; /* The SET clause from an ON CONFLICT UPDATE */
+ Expr *pUpsertWhere; /* WHERE clause for the ON CONFLICT UPDATE */
+ Upsert *pNextUpsert; /* Next ON CONFLICT clause in the list */
+ u8 isDoUpdate; /* True for DO UPDATE. False for DO NOTHING */
+ u8 isDup; /* True if 2nd or later with same pUpsertIdx */
+ /* Above this point is the parse tree for the ON CONFLICT clauses.
+ ** The next group of fields stores intermediate data. */
+ void *pToFree; /* Free memory when deleting the Upsert object */
+ /* All fields above are owned by the Upsert object and must be freed
+ ** when the Upsert is destroyed. The fields below are used to transfer
+ ** information from the INSERT processing down into the UPDATE processing
+ ** while generating code. The fields below are owned by the INSERT
+ ** statement and will be freed by INSERT processing. */
+ Index *pUpsertIdx; /* UNIQUE constraint specified by pUpsertTarget */
+ SrcList *pUpsertSrc; /* Table to be updated */
+ int regData; /* First register holding array of VALUES */
+ int iDataCur; /* Index of the data cursor */
+ int iIdxCur; /* Index of the first index cursor */
+};
+
+/*
+** An instance of the following structure contains all information
+** needed to generate code for a single SELECT statement.
+**
+** See the header comment on the computeLimitRegisters() routine for a
+** detailed description of the meaning of the iLimit and iOffset fields.
+**
+** addrOpenEphm[] entries contain the address of OP_OpenEphemeral opcodes.
+** These addresses must be stored so that we can go back and fill in
+** the P4_KEYINFO and P2 parameters later. Neither the KeyInfo nor
+** the number of columns in P2 can be computed at the same time
+** as the OP_OpenEphm instruction is coded because not
+** enough information about the compound query is known at that point.
+** The KeyInfo for addrOpenTran[0] and [1] contains collating sequences
+** for the result set. The KeyInfo for addrOpenEphm[2] contains collating
+** sequences for the ORDER BY clause.
+*/
+struct Select {
+ u8 op; /* One of: TK_UNION TK_ALL TK_INTERSECT TK_EXCEPT */
+ LogEst nSelectRow; /* Estimated number of result rows */
+ u32 selFlags; /* Various SF_* values */
+ int iLimit, iOffset; /* Memory registers holding LIMIT & OFFSET counters */
+ u32 selId; /* Unique identifier number for this SELECT */
+ int addrOpenEphm[2]; /* OP_OpenEphem opcodes related to this select */
+ ExprList *pEList; /* The fields of the result */
+ SrcList *pSrc; /* The FROM clause */
+ Expr *pWhere; /* The WHERE clause */
+ ExprList *pGroupBy; /* The GROUP BY clause */
+ Expr *pHaving; /* The HAVING clause */
+ ExprList *pOrderBy; /* The ORDER BY clause */
+ Select *pPrior; /* Prior select in a compound select statement */
+ Select *pNext; /* Next select to the left in a compound */
+ Expr *pLimit; /* LIMIT expression. NULL means not used. */
+ With *pWith; /* WITH clause attached to this select. Or NULL. */
+#ifndef SQLITE_OMIT_WINDOWFUNC
+ Window *pWin; /* List of window functions */
+ Window *pWinDefn; /* List of named window definitions */
+#endif
+};
+
+/*
+** Allowed values for Select.selFlags. The "SF" prefix stands for
+** "Select Flag".
+**
+** Value constraints (all checked via assert())
+** SF_HasAgg == NC_HasAgg
+** SF_MinMaxAgg == NC_MinMaxAgg == SQLITE_FUNC_MINMAX
+** SF_OrderByReqd == NC_OrderAgg == SQLITE_FUNC_ANYORDER
+** SF_FixedLimit == WHERE_USE_LIMIT
+*/
+#define SF_Distinct 0x0000001 /* Output should be DISTINCT */
+#define SF_All 0x0000002 /* Includes the ALL keyword */
+#define SF_Resolved 0x0000004 /* Identifiers have been resolved */
+#define SF_Aggregate 0x0000008 /* Contains agg functions or a GROUP BY */
+#define SF_HasAgg 0x0000010 /* Contains aggregate functions */
+#define SF_UsesEphemeral 0x0000020 /* Uses the OpenEphemeral opcode */
+#define SF_Expanded 0x0000040 /* sqlite3SelectExpand() called on this */
+#define SF_HasTypeInfo 0x0000080 /* FROM subqueries have Table metadata */
+#define SF_Compound 0x0000100 /* Part of a compound query */
+#define SF_Values 0x0000200 /* Synthesized from VALUES clause */
+#define SF_MultiValue 0x0000400 /* Single VALUES term with multiple rows */
+#define SF_NestedFrom 0x0000800 /* Part of a parenthesized FROM clause */
+#define SF_MinMaxAgg 0x0001000 /* Aggregate containing min() or max() */
+#define SF_Recursive 0x0002000 /* The recursive part of a recursive CTE */
+#define SF_FixedLimit 0x0004000 /* nSelectRow set by a constant LIMIT */
+#define SF_MaybeConvert 0x0008000 /* Need convertCompoundSelectToSubquery() */
+#define SF_Converted 0x0010000 /* By convertCompoundSelectToSubquery() */
+#define SF_IncludeHidden 0x0020000 /* Include hidden columns in output */
+#define SF_ComplexResult 0x0040000 /* Result contains subquery or function */
+#define SF_WhereBegin 0x0080000 /* Really a WhereBegin() call. Debug Only */
+#define SF_WinRewrite 0x0100000 /* Window function rewrite accomplished */
+#define SF_View 0x0200000 /* SELECT statement is a view */
+#define SF_NoopOrderBy 0x0400000 /* ORDER BY is ignored for this query */
+#define SF_UFSrcCheck 0x0800000 /* Check pSrc as required by UPDATE...FROM */
+#define SF_PushDown 0x1000000 /* Modified by WHERE-clause push-down opt */
+#define SF_MultiPart 0x2000000 /* Has multiple incompatible PARTITIONs */
+#define SF_CopyCte 0x4000000 /* SELECT statement is a copy of a CTE */
+#define SF_OrderByReqd 0x8000000 /* The ORDER BY clause may not be omitted */
+#define SF_UpdateFrom 0x10000000 /* Query originates with UPDATE FROM */
+#define SF_Correlated 0x20000000 /* True if references the outer context */
+
+/* True if SrcItem X is a subquery that has SF_NestedFrom */
+#define IsNestedFrom(X) \
+ ((X)->fg.isSubquery && \
+ ((X)->u4.pSubq->pSelect->selFlags&SF_NestedFrom)!=0)
+
+/*
+** The results of a SELECT can be distributed in several ways, as defined
+** by one of the following macros. The "SRT" prefix means "SELECT Result
+** Type".
+**
+** SRT_Union Store results as a key in a temporary index
+** identified by pDest->iSDParm.
+**
+** SRT_Except Remove results from the temporary index pDest->iSDParm.
+**
+** SRT_Exists Store a 1 in memory cell pDest->iSDParm if the result
+** set is not empty.
+**
+** SRT_Discard Throw the results away. This is used by SELECT
+** statements within triggers whose only purpose is
+** the side-effects of functions.
+**
+** SRT_Output Generate a row of output (using the OP_ResultRow
+** opcode) for each row in the result set.
+**
+** SRT_Mem Only valid if the result is a single column.
+** Store the first column of the first result row
+** in register pDest->iSDParm then abandon the rest
+** of the query. This destination implies "LIMIT 1".
+**
+** SRT_Set The result must be a single column. Store each
+** row of result as the key in table pDest->iSDParm.
+** Apply the affinity pDest->affSdst before storing
+** results. if pDest->iSDParm2 is positive, then it is
+** a register holding a Bloom filter for the IN operator
+** that should be populated in addition to the
+** pDest->iSDParm table. This SRT is used to
+** implement "IN (SELECT ...)".
+**
+** SRT_EphemTab Create an temporary table pDest->iSDParm and store
+** the result there. The cursor is left open after
+** returning. This is like SRT_Table except that
+** this destination uses OP_OpenEphemeral to create
+** the table first.
+**
+** SRT_Coroutine Generate a co-routine that returns a new row of
+** results each time it is invoked. The entry point
+** of the co-routine is stored in register pDest->iSDParm
+** and the result row is stored in pDest->nDest registers
+** starting with pDest->iSdst.
+**
+** SRT_Table Store results in temporary table pDest->iSDParm.
+** SRT_Fifo This is like SRT_EphemTab except that the table
+** is assumed to already be open. SRT_Fifo has
+** the additional property of being able to ignore
+** the ORDER BY clause.
+**
+** SRT_DistFifo Store results in a temporary table pDest->iSDParm.
+** But also use temporary table pDest->iSDParm+1 as
+** a record of all prior results and ignore any duplicate
+** rows. Name means: "Distinct Fifo".
+**
+** SRT_Queue Store results in priority queue pDest->iSDParm (really
+** an index). Append a sequence number so that all entries
+** are distinct.
+**
+** SRT_DistQueue Store results in priority queue pDest->iSDParm only if
+** the same record has never been stored before. The
+** index at pDest->iSDParm+1 hold all prior stores.
+**
+** SRT_Upfrom Store results in the temporary table already opened by
+** pDest->iSDParm. If (pDest->iSDParm<0), then the temp
+** table is an intkey table - in this case the first
+** column returned by the SELECT is used as the integer
+** key. If (pDest->iSDParm>0), then the table is an index
+** table. (pDest->iSDParm) is the number of key columns in
+** each index record in this case.
+*/
+#define SRT_Union 1 /* Store result as keys in an index */
+#define SRT_Except 2 /* Remove result from a UNION index */
+#define SRT_Exists 3 /* Store 1 if the result is not empty */
+#define SRT_Discard 4 /* Do not save the results anywhere */
+#define SRT_DistFifo 5 /* Like SRT_Fifo, but unique results only */
+#define SRT_DistQueue 6 /* Like SRT_Queue, but unique results only */
+
+/* The DISTINCT clause is ignored for all of the above. Not that
+** IgnorableDistinct() implies IgnorableOrderby() */
+#define IgnorableDistinct(X) ((X->eDest)<=SRT_DistQueue)
+
+#define SRT_Queue 7 /* Store result in an queue */
+#define SRT_Fifo 8 /* Store result as data with an automatic rowid */
+
+/* The ORDER BY clause is ignored for all of the above */
+#define IgnorableOrderby(X) ((X->eDest)<=SRT_Fifo)
+
+#define SRT_Output 9 /* Output each row of result */
+#define SRT_Mem 10 /* Store result in a memory cell */
+#define SRT_Set 11 /* Store results as keys in an index */
+#define SRT_EphemTab 12 /* Create transient tab and store like SRT_Table */
+#define SRT_Coroutine 13 /* Generate a single row of result */
+#define SRT_Table 14 /* Store result as data with an automatic rowid */
+#define SRT_Upfrom 15 /* Store result as data with rowid */
+
+/*
+** An instance of this object describes where to put of the results of
+** a SELECT statement.
+*/
+struct SelectDest {
+ u8 eDest; /* How to dispose of the results. One of SRT_* above. */
+ int iSDParm; /* A parameter used by the eDest disposal method */
+ int iSDParm2; /* A second parameter for the eDest disposal method */
+ int iSdst; /* Base register where results are written */
+ int nSdst; /* Number of registers allocated */
+ char *zAffSdst; /* Affinity used for SRT_Set */
+ ExprList *pOrderBy; /* Key columns for SRT_Queue and SRT_DistQueue */
+};
+
+/*
+** During code generation of statements that do inserts into AUTOINCREMENT
+** tables, the following information is attached to the Table.u.autoInc.p
+** pointer of each autoincrement table to record some side information that
+** the code generator needs. We have to keep per-table autoincrement
+** information in case inserts are done within triggers. Triggers do not
+** normally coordinate their activities, but we do need to coordinate the
+** loading and saving of autoincrement information.
+*/
+struct AutoincInfo {
+ AutoincInfo *pNext; /* Next info block in a list of them all */
+ Table *pTab; /* Table this info block refers to */
+ int iDb; /* Index in sqlite3.aDb[] of database holding pTab */
+ int regCtr; /* Memory register holding the rowid counter */
+};
+
+/*
+** At least one instance of the following structure is created for each
+** trigger that may be fired while parsing an INSERT, UPDATE or DELETE
+** statement. All such objects are stored in the linked list headed at
+** Parse.pTriggerPrg and deleted once statement compilation has been
+** completed.
+**
+** A Vdbe sub-program that implements the body and WHEN clause of trigger
+** TriggerPrg.pTrigger, assuming a default ON CONFLICT clause of
+** TriggerPrg.orconf, is stored in the TriggerPrg.pProgram variable.
+** The Parse.pTriggerPrg list never contains two entries with the same
+** values for both pTrigger and orconf.
+**
+** The TriggerPrg.aColmask[0] variable is set to a mask of old.* columns
+** accessed (or set to 0 for triggers fired as a result of INSERT
+** statements). Similarly, the TriggerPrg.aColmask[1] variable is set to
+** a mask of new.* columns used by the program.
+*/
+struct TriggerPrg {
+ Trigger *pTrigger; /* Trigger this program was coded from */
+ TriggerPrg *pNext; /* Next entry in Parse.pTriggerPrg list */
+ SubProgram *pProgram; /* Program implementing pTrigger/orconf */
+ int orconf; /* Default ON CONFLICT policy */
+ u32 aColmask[2]; /* Masks of old.*, new.* columns accessed */
+};
+
+/*
+** The yDbMask datatype for the bitmask of all attached databases.
+*/
+#if SQLITE_MAX_ATTACHED>30
+ typedef unsigned char yDbMask[(SQLITE_MAX_ATTACHED+9)/8];
+# define DbMaskTest(M,I) (((M)[(I)/8]&(1<<((I)&7)))!=0)
+# define DbMaskZero(M) memset((M),0,sizeof(M))
+# define DbMaskSet(M,I) (M)[(I)/8]|=(1<<((I)&7))
+# define DbMaskAllZero(M) sqlite3DbMaskAllZero(M)
+# define DbMaskNonZero(M) (sqlite3DbMaskAllZero(M)==0)
+#else
+ typedef unsigned int yDbMask;
+# define DbMaskTest(M,I) (((M)&(((yDbMask)1)<<(I)))!=0)
+# define DbMaskZero(M) ((M)=0)
+# define DbMaskSet(M,I) ((M)|=(((yDbMask)1)<<(I)))
+# define DbMaskAllZero(M) ((M)==0)
+# define DbMaskNonZero(M) ((M)!=0)
+#endif
+
+/*
+** For each index X that has as one of its arguments either an expression
+** or the name of a virtual generated column, and if X is in scope such that
+** the value of the expression can simply be read from the index, then
+** there is an instance of this object on the Parse.pIdxExpr list.
+**
+** During code generation, while generating code to evaluate expressions,
+** this list is consulted and if a matching expression is found, the value
+** is read from the index rather than being recomputed.
+*/
+struct IndexedExpr {
+ Expr *pExpr; /* The expression contained in the index */
+ int iDataCur; /* The data cursor associated with the index */
+ int iIdxCur; /* The index cursor */
+ int iIdxCol; /* The index column that contains value of pExpr */
+ u8 bMaybeNullRow; /* True if we need an OP_IfNullRow check */
+ u8 aff; /* Affinity of the pExpr expression */
+ IndexedExpr *pIENext; /* Next in a list of all indexed expressions */
+#ifdef SQLITE_ENABLE_EXPLAIN_COMMENTS
+ const char *zIdxName; /* Name of index, used only for bytecode comments */
+#endif
+};
+
+/*
+** An instance of the ParseCleanup object specifies an operation that
+** should be performed after parsing to deallocation resources obtained
+** during the parse and which are no longer needed.
+*/
+struct ParseCleanup {
+ ParseCleanup *pNext; /* Next cleanup task */
+ void *pPtr; /* Pointer to object to deallocate */
+ void (*xCleanup)(sqlite3*,void*); /* Deallocation routine */
+};
+
+/*
+** An SQL parser context. A copy of this structure is passed through
+** the parser and down into all the parser action routine in order to
+** carry around information that is global to the entire parse.
+**
+** The structure is divided into two parts. When the parser and code
+** generate call themselves recursively, the first part of the structure
+** is constant but the second part is reset at the beginning and end of
+** each recursion.
+**
+** The nTableLock and aTableLock variables are only used if the shared-cache
+** feature is enabled (if sqlite3Tsd()->useSharedData is true). They are
+** used to store the set of table-locks required by the statement being
+** compiled. Function sqlite3TableLock() is used to add entries to the
+** list.
+*/
+struct Parse {
+ sqlite3 *db; /* The main database structure */
+ char *zErrMsg; /* An error message */
+ Vdbe *pVdbe; /* An engine for executing database bytecode */
+ int rc; /* Return code from execution */
+ LogEst nQueryLoop; /* Est number of iterations of a query (10*log2(N)) */
+ u8 nested; /* Number of nested calls to the parser/code generator */
+ u8 nTempReg; /* Number of temporary registers in aTempReg[] */
+ u8 isMultiWrite; /* True if statement may modify/insert multiple rows */
+ u8 mayAbort; /* True if statement may throw an ABORT exception */
+ u8 hasCompound; /* Need to invoke convertCompoundSelectToSubquery() */
+ u8 disableLookaside; /* Number of times lookaside has been disabled */
+ u8 prepFlags; /* SQLITE_PREPARE_* flags */
+ u8 withinRJSubrtn; /* Nesting level for RIGHT JOIN body subroutines */
+ u8 mSubrtnSig; /* mini Bloom filter on available SubrtnSig.selId */
+ u8 eTriggerOp; /* TK_UPDATE, TK_INSERT or TK_DELETE */
+ u8 bReturning; /* Coding a RETURNING trigger */
+ u8 eOrconf; /* Default ON CONFLICT policy for trigger steps */
+ u8 disableTriggers; /* True to disable triggers */
+#if defined(SQLITE_DEBUG) || defined(SQLITE_COVERAGE_TEST)
+ u8 earlyCleanup; /* OOM inside sqlite3ParserAddCleanup() */
+#endif
+#ifdef SQLITE_DEBUG
+ u8 ifNotExists; /* Might be true if IF NOT EXISTS. Assert()s only */
+ u8 isCreate; /* CREATE TABLE, INDEX, or VIEW (but not TRIGGER)
+ ** and ALTER TABLE ADD COLUMN. */
+#endif
+ bft colNamesSet :1; /* TRUE after OP_ColumnName has been issued to pVdbe */
+ bft bHasWith :1; /* True if statement contains WITH */
+ bft okConstFactor :1; /* OK to factor out constants */
+ bft checkSchema :1; /* Causes schema cookie check after an error */
+ int nRangeReg; /* Size of the temporary register block */
+ int iRangeReg; /* First register in temporary register block */
+ int nErr; /* Number of errors seen */
+ int nTab; /* Number of previously allocated VDBE cursors */
+ int nMem; /* Number of memory cells used so far */
+ int szOpAlloc; /* Bytes of memory space allocated for Vdbe.aOp[] */
+ int iSelfTab; /* Table associated with an index on expr, or negative
+ ** of the base register during check-constraint eval */
+ int nLabel; /* The *negative* of the number of labels used */
+ int nLabelAlloc; /* Number of slots in aLabel */
+ int *aLabel; /* Space to hold the labels */
+ ExprList *pConstExpr;/* Constant expressions */
+ IndexedExpr *pIdxEpr;/* List of expressions used by active indexes */
+ IndexedExpr *pIdxPartExpr; /* Exprs constrained by index WHERE clauses */
+ yDbMask writeMask; /* Start a write transaction on these databases */
+ yDbMask cookieMask; /* Bitmask of schema verified databases */
+ int nMaxArg; /* Max args to xUpdate and xFilter vtab methods */
+ int nSelect; /* Number of SELECT stmts. Counter for Select.selId */
+#ifndef SQLITE_OMIT_PROGRESS_CALLBACK
+ u32 nProgressSteps; /* xProgress steps taken during sqlite3_prepare() */
+#endif
+#ifndef SQLITE_OMIT_SHARED_CACHE
+ int nTableLock; /* Number of locks in aTableLock */
+ TableLock *aTableLock; /* Required table locks for shared-cache mode */
+#endif
+ AutoincInfo *pAinc; /* Information about AUTOINCREMENT counters */
+ Parse *pToplevel; /* Parse structure for main program (or NULL) */
+ Table *pTriggerTab; /* Table triggers are being coded for */
+ TriggerPrg *pTriggerPrg; /* Linked list of coded triggers */
+ ParseCleanup *pCleanup; /* List of cleanup operations to run after parse */
+
+ /**************************************************************************
+ ** Fields above must be initialized to zero. The fields that follow,
+ ** down to the beginning of the recursive section, do not need to be
+ ** initialized as they will be set before being used. The boundary is
+ ** determined by offsetof(Parse,aTempReg).
+ **************************************************************************/
+
+ int aTempReg[8]; /* Holding area for temporary registers */
+ Parse *pOuterParse; /* Outer Parse object when nested */
+ Token sNameToken; /* Token with unqualified schema object name */
+ u32 oldmask; /* Mask of old.* columns referenced */
+ u32 newmask; /* Mask of new.* columns referenced */
+ union {
+ struct { /* These fields available when isCreate is true */
+ int addrCrTab; /* Address of OP_CreateBtree on CREATE TABLE */
+ int regRowid; /* Register holding rowid of CREATE TABLE entry */
+ int regRoot; /* Register holding root page for new objects */
+ Token constraintName; /* Name of the constraint currently being parsed */
+ } cr;
+ struct { /* These fields available to all other statements */
+ Returning *pReturning; /* The RETURNING clause */
+ } d;
+ } u1;
+
+ /************************************************************************
+ ** Above is constant between recursions. Below is reset before and after
+ ** each recursion. The boundary between these two regions is determined
+ ** using offsetof(Parse,sLastToken) so the sLastToken field must be the
+ ** first field in the recursive region.
+ ************************************************************************/
+
+ Token sLastToken; /* The last token parsed */
+ ynVar nVar; /* Number of '?' variables seen in the SQL so far */
+ u8 iPkSortOrder; /* ASC or DESC for INTEGER PRIMARY KEY */
+ u8 explain; /* True if the EXPLAIN flag is found on the query */
+ u8 eParseMode; /* PARSE_MODE_XXX constant */
+#ifndef SQLITE_OMIT_VIRTUALTABLE
+ int nVtabLock; /* Number of virtual tables to lock */
+#endif
+ int nHeight; /* Expression tree height of current sub-select */
+ int addrExplain; /* Address of current OP_Explain opcode */
+ VList *pVList; /* Mapping between variable names and numbers */
+ Vdbe *pReprepare; /* VM being reprepared (sqlite3Reprepare()) */
+ const char *zTail; /* All SQL text past the last semicolon parsed */
+ Table *pNewTable; /* A table being constructed by CREATE TABLE */
+ Index *pNewIndex; /* An index being constructed by CREATE INDEX.
+ ** Also used to hold redundant UNIQUE constraints
+ ** during a RENAME COLUMN */
+ Trigger *pNewTrigger; /* Trigger under construct by a CREATE TRIGGER */
+ const char *zAuthContext; /* The 6th parameter to db->xAuth callbacks */
+#ifndef SQLITE_OMIT_VIRTUALTABLE
+ Token sArg; /* Complete text of a module argument */
+ Table **apVtabLock; /* Pointer to virtual tables needing locking */
+#endif
+ With *pWith; /* Current WITH clause, or NULL */
+#ifndef SQLITE_OMIT_ALTERTABLE
+ RenameToken *pRename; /* Tokens subject to renaming by ALTER TABLE */
+#endif
+};
+
+/* Allowed values for Parse.eParseMode
+*/
+#define PARSE_MODE_NORMAL 0
+#define PARSE_MODE_DECLARE_VTAB 1
+#define PARSE_MODE_RENAME 2
+#define PARSE_MODE_UNMAP 3
+
+/*
+** Sizes and pointers of various parts of the Parse object.
+*/
+#define PARSE_HDR(X) (((char*)(X))+offsetof(Parse,zErrMsg))
+#define PARSE_HDR_SZ (offsetof(Parse,aTempReg)-offsetof(Parse,zErrMsg)) /* Recursive part w/o aColCache*/
+#define PARSE_RECURSE_SZ offsetof(Parse,sLastToken) /* Recursive part */
+#define PARSE_TAIL_SZ (sizeof(Parse)-PARSE_RECURSE_SZ) /* Non-recursive part */
+#define PARSE_TAIL(X) (((char*)(X))+PARSE_RECURSE_SZ) /* Pointer to tail */
+
+/*
+** Return true if currently inside an sqlite3_declare_vtab() call.
+*/
+#ifdef SQLITE_OMIT_VIRTUALTABLE
+ #define IN_DECLARE_VTAB 0
+#else
+ #define IN_DECLARE_VTAB (pParse->eParseMode==PARSE_MODE_DECLARE_VTAB)
+#endif
+
+#if defined(SQLITE_OMIT_ALTERTABLE)
+ #define IN_RENAME_OBJECT 0
+#else
+ #define IN_RENAME_OBJECT (pParse->eParseMode>=PARSE_MODE_RENAME)
+#endif
+
+#if defined(SQLITE_OMIT_VIRTUALTABLE) && defined(SQLITE_OMIT_ALTERTABLE)
+ #define IN_SPECIAL_PARSE 0
+#else
+ #define IN_SPECIAL_PARSE (pParse->eParseMode!=PARSE_MODE_NORMAL)
+#endif
+
+/*
+** An instance of the following structure can be declared on a stack and used
+** to save the Parse.zAuthContext value so that it can be restored later.
+*/
+struct AuthContext {
+ const char *zAuthContext; /* Put saved Parse.zAuthContext here */
+ Parse *pParse; /* The Parse structure */
+};
+
+/*
+** Bitfield flags for P5 value in various opcodes.
+**
+** Value constraints (enforced via assert()):
+** OPFLAG_LENGTHARG == SQLITE_FUNC_LENGTH
+** OPFLAG_TYPEOFARG == SQLITE_FUNC_TYPEOF
+** OPFLAG_BULKCSR == BTREE_BULKLOAD
+** OPFLAG_SEEKEQ == BTREE_SEEK_EQ
+** OPFLAG_FORDELETE == BTREE_FORDELETE
+** OPFLAG_SAVEPOSITION == BTREE_SAVEPOSITION
+** OPFLAG_AUXDELETE == BTREE_AUXDELETE
+*/
+#define OPFLAG_NCHANGE 0x01 /* OP_Insert: Set to update db->nChange */
+ /* Also used in P2 (not P5) of OP_Delete */
+#define OPFLAG_NOCHNG 0x01 /* OP_VColumn nochange for UPDATE */
+#define OPFLAG_EPHEM 0x01 /* OP_Column: Ephemeral output is ok */
+#define OPFLAG_LASTROWID 0x20 /* Set to update db->lastRowid */
+#define OPFLAG_ISUPDATE 0x04 /* This OP_Insert is an sql UPDATE */
+#define OPFLAG_APPEND 0x08 /* This is likely to be an append */
+#define OPFLAG_USESEEKRESULT 0x10 /* Try to avoid a seek in BtreeInsert() */
+#define OPFLAG_ISNOOP 0x40 /* OP_Delete does pre-update-hook only */
+#define OPFLAG_LENGTHARG 0x40 /* OP_Column only used for length() */
+#define OPFLAG_TYPEOFARG 0x80 /* OP_Column only used for typeof() */
+#define OPFLAG_BYTELENARG 0xc0 /* OP_Column only for octet_length() */
+#define OPFLAG_BULKCSR 0x01 /* OP_Open** used to open bulk cursor */
+#define OPFLAG_SEEKEQ 0x02 /* OP_Open** cursor uses EQ seek only */
+#define OPFLAG_FORDELETE 0x08 /* OP_Open should use BTREE_FORDELETE */
+#define OPFLAG_P2ISREG 0x10 /* P2 to OP_Open** is a register number */
+#define OPFLAG_PERMUTE 0x01 /* OP_Compare: use the permutation */
+#define OPFLAG_SAVEPOSITION 0x02 /* OP_Delete/Insert: save cursor pos */
+#define OPFLAG_AUXDELETE 0x04 /* OP_Delete: index in a DELETE op */
+#define OPFLAG_NOCHNG_MAGIC 0x6d /* OP_MakeRecord: serialtype 10 is ok */
+#define OPFLAG_PREFORMAT 0x80 /* OP_Insert uses preformatted cell */
+
+/*
+** Each trigger present in the database schema is stored as an instance of
+** struct Trigger.
+**
+** Pointers to instances of struct Trigger are stored in two ways.
+** 1. In the "trigHash" hash table (part of the sqlite3* that represents the
+** database). This allows Trigger structures to be retrieved by name.
+** 2. All triggers associated with a single table form a linked list, using the
+** pNext member of struct Trigger. A pointer to the first element of the
+** linked list is stored as the "pTrigger" member of the associated
+** struct Table.
+**
+** The "step_list" member points to the first element of a linked list
+** containing the SQL statements specified as the trigger program.
+*/
+struct Trigger {
+ char *zName; /* The name of the trigger */
+ char *table; /* The table or view to which the trigger applies */
+ u8 op; /* One of TK_DELETE, TK_UPDATE, TK_INSERT */
+ u8 tr_tm; /* One of TRIGGER_BEFORE, TRIGGER_AFTER */
+ u8 bReturning; /* This trigger implements a RETURNING clause */
+ Expr *pWhen; /* The WHEN clause of the expression (may be NULL) */
+ IdList *pColumns; /* If this is an UPDATE OF trigger,
+ the is stored here */
+ Schema *pSchema; /* Schema containing the trigger */
+ Schema *pTabSchema; /* Schema containing the table */
+ TriggerStep *step_list; /* Link list of trigger program steps */
+ Trigger *pNext; /* Next trigger associated with the table */
+};
+
+/*
+** A trigger is either a BEFORE or an AFTER trigger. The following constants
+** determine which.
+**
+** If there are multiple triggers, you might of some BEFORE and some AFTER.
+** In that cases, the constants below can be ORed together.
+*/
+#define TRIGGER_BEFORE 1
+#define TRIGGER_AFTER 2
+
+/*
+** An instance of struct TriggerStep is used to store a single SQL statement
+** that is a part of a trigger-program.
+**
+** Instances of struct TriggerStep are stored in a singly linked list (linked
+** using the "pNext" member) referenced by the "step_list" member of the
+** associated struct Trigger instance. The first element of the linked list is
+** the first step of the trigger-program.
+**
+** The "op" member indicates whether this is a "DELETE", "INSERT", "UPDATE" or
+** "SELECT" statement. The meanings of the other members is determined by the
+** value of "op" as follows:
+**
+** (op == TK_INSERT)
+** orconf -> stores the ON CONFLICT algorithm
+** pSelect -> The content to be inserted - either a SELECT statement or
+** a VALUES clause.
+** zTarget -> Dequoted name of the table to insert into.
+** pIdList -> If this is an INSERT INTO ... () VALUES ...
+** statement, then this stores the column-names to be
+** inserted into.
+** pUpsert -> The ON CONFLICT clauses for an Upsert
+**
+** (op == TK_DELETE)
+** zTarget -> Dequoted name of the table to delete from.
+** pWhere -> The WHERE clause of the DELETE statement if one is specified.
+** Otherwise NULL.
+**
+** (op == TK_UPDATE)
+** zTarget -> Dequoted name of the table to update.
+** pWhere -> The WHERE clause of the UPDATE statement if one is specified.
+** Otherwise NULL.
+** pExprList -> A list of the columns to update and the expressions to update
+** them to. See sqlite3Update() documentation of "pChanges"
+** argument.
+**
+** (op == TK_SELECT)
+** pSelect -> The SELECT statement
+**
+** (op == TK_RETURNING)
+** pExprList -> The list of expressions that follow the RETURNING keyword.
+**
+*/
+struct TriggerStep {
+ u8 op; /* One of TK_DELETE, TK_UPDATE, TK_INSERT, TK_SELECT,
+ ** or TK_RETURNING */
+ u8 orconf; /* OE_Rollback etc. */
+ Trigger *pTrig; /* The trigger that this step is a part of */
+ Select *pSelect; /* SELECT statement or RHS of INSERT INTO SELECT ... */
+ char *zTarget; /* Target table for DELETE, UPDATE, INSERT */
+ SrcList *pFrom; /* FROM clause for UPDATE statement (if any) */
+ Expr *pWhere; /* The WHERE clause for DELETE or UPDATE steps */
+ ExprList *pExprList; /* SET clause for UPDATE, or RETURNING clause */
+ IdList *pIdList; /* Column names for INSERT */
+ Upsert *pUpsert; /* Upsert clauses on an INSERT */
+ char *zSpan; /* Original SQL text of this command */
+ TriggerStep *pNext; /* Next in the link-list */
+ TriggerStep *pLast; /* Last element in link-list. Valid for 1st elem only */
+};
+
+/*
+** Information about a RETURNING clause
+*/
+struct Returning {
+ Parse *pParse; /* The parse that includes the RETURNING clause */
+ ExprList *pReturnEL; /* List of expressions to return */
+ Trigger retTrig; /* The transient trigger that implements RETURNING */
+ TriggerStep retTStep; /* The trigger step */
+ int iRetCur; /* Transient table holding RETURNING results */
+ int nRetCol; /* Number of in pReturnEL after expansion */
+ int iRetReg; /* Register array for holding a row of RETURNING */
+ char zName[40]; /* Name of trigger: "sqlite_returning_%p" */
+};
+
+/*
+** An object used to accumulate the text of a string where we
+** do not necessarily know how big the string will be in the end.
+*/
+struct sqlite3_str {
+ sqlite3 *db; /* Optional database for lookaside. Can be NULL */
+ char *zText; /* The string collected so far */
+ u32 nAlloc; /* Amount of space allocated in zText */
+ u32 mxAlloc; /* Maximum allowed allocation. 0 for no malloc usage */
+ u32 nChar; /* Length of the string so far */
+ u8 accError; /* SQLITE_NOMEM or SQLITE_TOOBIG */
+ u8 printfFlags; /* SQLITE_PRINTF flags below */
+};
+#define SQLITE_PRINTF_INTERNAL 0x01 /* Internal-use-only converters allowed */
+#define SQLITE_PRINTF_SQLFUNC 0x02 /* SQL function arguments to VXPrintf */
+#define SQLITE_PRINTF_MALLOCED 0x04 /* True if zText is allocated space */
+
+#define isMalloced(X) (((X)->printfFlags & SQLITE_PRINTF_MALLOCED)!=0)
+
+/*
+** The following object is the header for an "RCStr" or "reference-counted
+** string". An RCStr is passed around and used like any other char*
+** that has been dynamically allocated. The important interface
+** differences:
+**
+** 1. RCStr strings are reference counted. They are deallocated
+** when the reference count reaches zero.
+**
+** 2. Use sqlite3RCStrUnref() to free an RCStr string rather than
+** sqlite3_free()
+**
+** 3. Make a (read-only) copy of a read-only RCStr string using
+** sqlite3RCStrRef().
+**
+** "String" is in the name, but an RCStr object can also be used to hold
+** binary data.
+*/
+struct RCStr {
+ u64 nRCRef; /* Number of references */
+ /* Total structure size should be a multiple of 8 bytes for alignment */
+};
+
+/*
+** A pointer to this structure is used to communicate information
+** from sqlite3Init and OP_ParseSchema into the sqlite3InitCallback.
+*/
+typedef struct {
+ sqlite3 *db; /* The database being initialized */
+ char **pzErrMsg; /* Error message stored here */
+ int iDb; /* 0 for main database. 1 for TEMP, 2.. for ATTACHed */
+ int rc; /* Result code stored here */
+ u32 mInitFlags; /* Flags controlling error messages */
+ u32 nInitRow; /* Number of rows processed */
+ Pgno mxPage; /* Maximum page number. 0 for no limit. */
+} InitData;
+
+/*
+** Allowed values for mInitFlags
+*/
+#define INITFLAG_AlterMask 0x0003 /* Types of ALTER */
+#define INITFLAG_AlterRename 0x0001 /* Reparse after a RENAME */
+#define INITFLAG_AlterDrop 0x0002 /* Reparse after a DROP COLUMN */
+#define INITFLAG_AlterAdd 0x0003 /* Reparse after an ADD COLUMN */
+
+/* Tuning parameters are set using SQLITE_TESTCTRL_TUNE and are controlled
+** on debug-builds of the CLI using ".testctrl tune ID VALUE". Tuning
+** parameters are for temporary use during development, to help find
+** optimal values for parameters in the query planner. The should not
+** be used on trunk check-ins. They are a temporary mechanism available
+** for transient development builds only.
+**
+** Tuning parameters are numbered starting with 1.
+*/
+#define SQLITE_NTUNE 6 /* Should be zero for all trunk check-ins */
+#ifdef SQLITE_DEBUG
+# define Tuning(X) (sqlite3Config.aTune[(X)-1])
+#else
+# define Tuning(X) 0
+#endif
+
+/*
+** Structure containing global configuration data for the SQLite library.
+**
+** This structure also contains some state information.
+*/
+struct Sqlite3Config {
+ int bMemstat; /* True to enable memory status */
+ u8 bCoreMutex; /* True to enable core mutexing */
+ u8 bFullMutex; /* True to enable full mutexing */
+ u8 bOpenUri; /* True to interpret filenames as URIs */
+ u8 bUseCis; /* Use covering indices for full-scans */
+ u8 bSmallMalloc; /* Avoid large memory allocations if true */
+ u8 bExtraSchemaChecks; /* Verify type,name,tbl_name in schema */
+#ifdef SQLITE_DEBUG
+ u8 bJsonSelfcheck; /* Double-check JSON parsing */
+#endif
+ int mxStrlen; /* Maximum string length */
+ int neverCorrupt; /* Database is always well-formed */
+ int szLookaside; /* Default lookaside buffer size */
+ int nLookaside; /* Default lookaside buffer count */
+ int nStmtSpill; /* Stmt-journal spill-to-disk threshold */
+ sqlite3_mem_methods m; /* Low-level memory allocation interface */
+ sqlite3_mutex_methods mutex; /* Low-level mutex interface */
+ sqlite3_pcache_methods2 pcache2; /* Low-level page-cache interface */
+ void *pHeap; /* Heap storage space */
+ int nHeap; /* Size of pHeap[] */
+ int mnReq, mxReq; /* Min and max heap requests sizes */
+ sqlite3_int64 szMmap; /* mmap() space per open file */
+ sqlite3_int64 mxMmap; /* Maximum value for szMmap */
+ void *pPage; /* Page cache memory */
+ int szPage; /* Size of each page in pPage[] */
+ int nPage; /* Number of pages in pPage[] */
+ int mxParserStack; /* maximum depth of the parser stack */
+ int sharedCacheEnabled; /* true if shared-cache mode enabled */
+ u32 szPma; /* Maximum Sorter PMA size */
+ /* The above might be initialized to non-zero. The following need to always
+ ** initially be zero, however. */
+ int isInit; /* True after initialization has finished */
+ int inProgress; /* True while initialization in progress */
+ int isMutexInit; /* True after mutexes are initialized */
+ int isMallocInit; /* True after malloc is initialized */
+ int isPCacheInit; /* True after malloc is initialized */
+ int nRefInitMutex; /* Number of users of pInitMutex */
+ sqlite3_mutex *pInitMutex; /* Mutex used by sqlite3_initialize() */
+ void (*xLog)(void*,int,const char*); /* Function for logging */
+ void *pLogArg; /* First argument to xLog() */
+#ifdef SQLITE_ENABLE_SQLLOG
+ void(*xSqllog)(void*,sqlite3*,const char*, int);
+ void *pSqllogArg;
+#endif
+#ifdef SQLITE_VDBE_COVERAGE
+ /* The following callback (if not NULL) is invoked on every VDBE branch
+ ** operation. Set the callback using SQLITE_TESTCTRL_VDBE_COVERAGE.
+ */
+ void (*xVdbeBranch)(void*,unsigned iSrcLine,u8 eThis,u8 eMx); /* Callback */
+ void *pVdbeBranchArg; /* 1st argument */
+#endif
+#ifndef SQLITE_OMIT_DESERIALIZE
+ sqlite3_int64 mxMemdbSize; /* Default max memdb size */
+#endif
+#ifndef SQLITE_UNTESTABLE
+ int (*xTestCallback)(int); /* Invoked by sqlite3FaultSim() */
+#endif
+#ifdef SQLITE_ALLOW_ROWID_IN_VIEW
+ u32 mNoVisibleRowid; /* TF_NoVisibleRowid if the ROWID_IN_VIEW
+ ** feature is disabled. 0 if rowids can
+ ** occur in views. */
+#endif
+ int bLocaltimeFault; /* True to fail localtime() calls */
+ int (*xAltLocaltime)(const void*,void*); /* Alternative localtime() routine */
+ int iOnceResetThreshold; /* When to reset OP_Once counters */
+ u32 szSorterRef; /* Min size in bytes to use sorter-refs */
+ unsigned int iPrngSeed; /* Alternative fixed seed for the PRNG */
+ /* vvvv--- must be last ---vvv */
+#ifdef SQLITE_DEBUG
+ sqlite3_int64 aTune[SQLITE_NTUNE]; /* Tuning parameters */
+#endif
+};
+
+/*
+** This macro is used inside of assert() statements to indicate that
+** the assert is only valid on a well-formed database. Instead of:
+**
+** assert( X );
+**
+** One writes:
+**
+** assert( X || CORRUPT_DB );
+**
+** CORRUPT_DB is true during normal operation. CORRUPT_DB does not indicate
+** that the database is definitely corrupt, only that it might be corrupt.
+** For most test cases, CORRUPT_DB is set to false using a special
+** sqlite3_test_control(). This enables assert() statements to prove
+** things that are always true for well-formed databases.
+*/
+#define CORRUPT_DB (sqlite3Config.neverCorrupt==0)
+
+/*
+** Context pointer passed down through the tree-walk.
+*/
+struct Walker {
+ Parse *pParse; /* Parser context. */
+ int (*xExprCallback)(Walker*, Expr*); /* Callback for expressions */
+ int (*xSelectCallback)(Walker*,Select*); /* Callback for SELECTs */
+ void (*xSelectCallback2)(Walker*,Select*);/* Second callback for SELECTs */
+ int walkerDepth; /* Number of subqueries */
+ u16 eCode; /* A small processing code */
+ u16 mWFlags; /* Use-dependent flags */
+ union { /* Extra data for callback */
+ NameContext *pNC; /* Naming context */
+ int n; /* A counter */
+ int iCur; /* A cursor number */
+ SrcList *pSrcList; /* FROM clause */
+ struct CCurHint *pCCurHint; /* Used by codeCursorHint() */
+ struct RefSrcList *pRefSrcList; /* sqlite3ReferencesSrcList() */
+ int *aiCol; /* array of column indexes */
+ struct IdxCover *pIdxCover; /* Check for index coverage */
+ ExprList *pGroupBy; /* GROUP BY clause */
+ Select *pSelect; /* HAVING to WHERE clause ctx */
+ struct WindowRewrite *pRewrite; /* Window rewrite context */
+ struct WhereConst *pConst; /* WHERE clause constants */
+ struct RenameCtx *pRename; /* RENAME COLUMN context */
+ struct Table *pTab; /* Table of generated column */
+ struct CoveringIndexCheck *pCovIdxCk; /* Check for covering index */
+ SrcItem *pSrcItem; /* A single FROM clause item */
+ DbFixer *pFix; /* See sqlite3FixSelect() */
+ Mem *aMem; /* See sqlite3BtreeCursorHint() */
+ } u;
+};
+
+/*
+** The following structure contains information used by the sqliteFix...
+** routines as they walk the parse tree to make database references
+** explicit.
+*/
+struct DbFixer {
+ Parse *pParse; /* The parsing context. Error messages written here */
+ Walker w; /* Walker object */
+ Schema *pSchema; /* Fix items to this schema */
+ u8 bTemp; /* True for TEMP schema entries */
+ const char *zDb; /* Make sure all objects are contained in this database */
+ const char *zType; /* Type of the container - used for error messages */
+ const Token *pName; /* Name of the container - used for error messages */
+};
+
+/* Forward declarations */
+SQLITE_PRIVATE int sqlite3WalkExpr(Walker*, Expr*);
+SQLITE_PRIVATE int sqlite3WalkExprNN(Walker*, Expr*);
+SQLITE_PRIVATE int sqlite3WalkExprList(Walker*, ExprList*);
+SQLITE_PRIVATE int sqlite3WalkSelect(Walker*, Select*);
+SQLITE_PRIVATE int sqlite3WalkSelectExpr(Walker*, Select*);
+SQLITE_PRIVATE int sqlite3WalkSelectFrom(Walker*, Select*);
+SQLITE_PRIVATE int sqlite3ExprWalkNoop(Walker*, Expr*);
+SQLITE_PRIVATE int sqlite3SelectWalkNoop(Walker*, Select*);
+SQLITE_PRIVATE int sqlite3SelectWalkFail(Walker*, Select*);
+SQLITE_PRIVATE int sqlite3WalkerDepthIncrease(Walker*,Select*);
+SQLITE_PRIVATE void sqlite3WalkerDepthDecrease(Walker*,Select*);
+SQLITE_PRIVATE void sqlite3WalkWinDefnDummyCallback(Walker*,Select*);
+
+#ifdef SQLITE_DEBUG
+SQLITE_PRIVATE void sqlite3SelectWalkAssert2(Walker*, Select*);
+#endif
+
+#ifndef SQLITE_OMIT_CTE
+SQLITE_PRIVATE void sqlite3SelectPopWith(Walker*, Select*);
+#else
+# define sqlite3SelectPopWith 0
+#endif
+
+/*
+** Return code from the parse-tree walking primitives and their
+** callbacks.
+*/
+#define WRC_Continue 0 /* Continue down into children */
+#define WRC_Prune 1 /* Omit children but continue walking siblings */
+#define WRC_Abort 2 /* Abandon the tree walk */
+
+/*
+** A single common table expression
+*/
+struct Cte {
+ char *zName; /* Name of this CTE */
+ ExprList *pCols; /* List of explicit column names, or NULL */
+ Select *pSelect; /* The definition of this CTE */
+ const char *zCteErr; /* Error message for circular references */
+ CteUse *pUse; /* Usage information for this CTE */
+ u8 eM10d; /* The MATERIALIZED flag */
+};
+
+/*
+** Allowed values for the materialized flag (eM10d):
+*/
+#define M10d_Yes 0 /* AS MATERIALIZED */
+#define M10d_Any 1 /* Not specified. Query planner's choice */
+#define M10d_No 2 /* AS NOT MATERIALIZED */
+
+/*
+** An instance of the With object represents a WITH clause containing
+** one or more CTEs (common table expressions).
+*/
+struct With {
+ int nCte; /* Number of CTEs in the WITH clause */
+ int bView; /* Belongs to the outermost Select of a view */
+ With *pOuter; /* Containing WITH clause, or NULL */
+ Cte a[FLEXARRAY]; /* For each CTE in the WITH clause.... */
+};
+
+/* The size (in bytes) of a With object that can hold as many
+** as N different CTEs. */
+#define SZ_WITH(N) (offsetof(With,a) + (N)*sizeof(Cte))
+
+/*
+** The Cte object is not guaranteed to persist for the entire duration
+** of code generation. (The query flattener or other parser tree
+** edits might delete it.) The following object records information
+** about each Common Table Expression that must be preserved for the
+** duration of the parse.
+**
+** The CteUse objects are freed using sqlite3ParserAddCleanup() rather
+** than sqlite3SelectDelete(), which is what enables them to persist
+** until the end of code generation.
+*/
+struct CteUse {
+ int nUse; /* Number of users of this CTE */
+ int addrM9e; /* Start of subroutine to compute materialization */
+ int regRtn; /* Return address register for addrM9e subroutine */
+ int iCur; /* Ephemeral table holding the materialization */
+ LogEst nRowEst; /* Estimated number of rows in the table */
+ u8 eM10d; /* The MATERIALIZED flag */
+};
+
+
+/* Client data associated with sqlite3_set_clientdata() and
+** sqlite3_get_clientdata().
+*/
+struct DbClientData {
+ DbClientData *pNext; /* Next in a linked list */
+ void *pData; /* The data */
+ void (*xDestructor)(void*); /* Destructor. Might be NULL */
+ char zName[FLEXARRAY]; /* Name of this client data. MUST BE LAST */
+};
+
+/* The size (in bytes) of a DbClientData object that can has a name
+** that is N bytes long, including the zero-terminator. */
+#define SZ_DBCLIENTDATA(N) (offsetof(DbClientData,zName)+(N))
+
+#ifdef SQLITE_DEBUG
+/*
+** An instance of the TreeView object is used for printing the content of
+** data structures on sqlite3DebugPrintf() using a tree-like view.
+*/
+struct TreeView {
+ int iLevel; /* Which level of the tree we are on */
+ u8 bLine[100]; /* Draw vertical in column i if bLine[i] is true */
+};
+#endif /* SQLITE_DEBUG */
+
+/*
+** This object is used in various ways, most (but not all) related to window
+** functions.
+**
+** (1) A single instance of this structure is attached to the
+** the Expr.y.pWin field for each window function in an expression tree.
+** This object holds the information contained in the OVER clause,
+** plus additional fields used during code generation.
+**
+** (2) All window functions in a single SELECT form a linked-list
+** attached to Select.pWin. The Window.pFunc and Window.pExpr
+** fields point back to the expression that is the window function.
+**
+** (3) The terms of the WINDOW clause of a SELECT are instances of this
+** object on a linked list attached to Select.pWinDefn.
+**
+** (4) For an aggregate function with a FILTER clause, an instance
+** of this object is stored in Expr.y.pWin with eFrmType set to
+** TK_FILTER. In this case the only field used is Window.pFilter.
+**
+** The uses (1) and (2) are really the same Window object that just happens
+** to be accessible in two different ways. Use case (3) are separate objects.
+*/
+struct Window {
+ char *zName; /* Name of window (may be NULL) */
+ char *zBase; /* Name of base window for chaining (may be NULL) */
+ ExprList *pPartition; /* PARTITION BY clause */
+ ExprList *pOrderBy; /* ORDER BY clause */
+ u8 eFrmType; /* TK_RANGE, TK_GROUPS, TK_ROWS, or 0 */
+ u8 eStart; /* UNBOUNDED, CURRENT, PRECEDING or FOLLOWING */
+ u8 eEnd; /* UNBOUNDED, CURRENT, PRECEDING or FOLLOWING */
+ u8 bImplicitFrame; /* True if frame was implicitly specified */
+ u8 eExclude; /* TK_NO, TK_CURRENT, TK_TIES, TK_GROUP, or 0 */
+ Expr *pStart; /* Expression for " PRECEDING" */
+ Expr *pEnd; /* Expression for " FOLLOWING" */
+ Window **ppThis; /* Pointer to this object in Select.pWin list */
+ Window *pNextWin; /* Next window function belonging to this SELECT */
+ Expr *pFilter; /* The FILTER expression */
+ FuncDef *pWFunc; /* The function */
+ int iEphCsr; /* Partition buffer or Peer buffer */
+ int regAccum; /* Accumulator */
+ int regResult; /* Interim result */
+ int csrApp; /* Function cursor (used by min/max) */
+ int regApp; /* Function register (also used by min/max) */
+ int regPart; /* Array of registers for PARTITION BY values */
+ Expr *pOwner; /* Expression object this window is attached to */
+ int nBufferCol; /* Number of columns in buffer table */
+ int iArgCol; /* Offset of first argument for this function */
+ int regOne; /* Register containing constant value 1 */
+ int regStartRowid;
+ int regEndRowid;
+ u8 bExprArgs; /* Defer evaluation of window function arguments
+ ** due to the SQLITE_SUBTYPE flag */
+};
+
+SQLITE_PRIVATE Select *sqlite3MultiValues(Parse *pParse, Select *pLeft, ExprList *pRow);
+SQLITE_PRIVATE void sqlite3MultiValuesEnd(Parse *pParse, Select *pVal);
+
+#ifndef SQLITE_OMIT_WINDOWFUNC
+SQLITE_PRIVATE void sqlite3WindowDelete(sqlite3*, Window*);
+SQLITE_PRIVATE void sqlite3WindowUnlinkFromSelect(Window*);
+SQLITE_PRIVATE void sqlite3WindowListDelete(sqlite3 *db, Window *p);
+SQLITE_PRIVATE Window *sqlite3WindowAlloc(Parse*, int, int, Expr*, int , Expr*, u8);
+SQLITE_PRIVATE void sqlite3WindowAttach(Parse*, Expr*, Window*);
+SQLITE_PRIVATE void sqlite3WindowLink(Select *pSel, Window *pWin);
+SQLITE_PRIVATE int sqlite3WindowCompare(const Parse*, const Window*, const Window*, int);
+SQLITE_PRIVATE void sqlite3WindowCodeInit(Parse*, Select*);
+SQLITE_PRIVATE void sqlite3WindowCodeStep(Parse*, Select*, WhereInfo*, int, int);
+SQLITE_PRIVATE int sqlite3WindowRewrite(Parse*, Select*);
+SQLITE_PRIVATE void sqlite3WindowUpdate(Parse*, Window*, Window*, FuncDef*);
+SQLITE_PRIVATE Window *sqlite3WindowDup(sqlite3 *db, Expr *pOwner, Window *p);
+SQLITE_PRIVATE Window *sqlite3WindowListDup(sqlite3 *db, Window *p);
+SQLITE_PRIVATE void sqlite3WindowFunctions(void);
+SQLITE_PRIVATE void sqlite3WindowChain(Parse*, Window*, Window*);
+SQLITE_PRIVATE Window *sqlite3WindowAssemble(Parse*, Window*, ExprList*, ExprList*, Token*);
+#else
+# define sqlite3WindowDelete(a,b)
+# define sqlite3WindowFunctions()
+# define sqlite3WindowAttach(a,b,c)
+#endif
+
+/*
+** Assuming zIn points to the first byte of a UTF-8 character,
+** advance zIn to point to the first byte of the next UTF-8 character.
+*/
+#define SQLITE_SKIP_UTF8(zIn) { \
+ if( (*(zIn++))>=0xc0 ){ \
+ while( (*zIn & 0xc0)==0x80 ){ zIn++; } \
+ } \
+}
+
+/*
+** The SQLITE_*_BKPT macros are substitutes for the error codes with
+** the same name but without the _BKPT suffix. These macros invoke
+** routines that report the line-number on which the error originated
+** using sqlite3_log(). The routines also provide a convenient place
+** to set a debugger breakpoint.
+*/
+SQLITE_PRIVATE int sqlite3ReportError(int iErr, int lineno, const char *zType);
+SQLITE_PRIVATE int sqlite3CorruptError(int);
+SQLITE_PRIVATE int sqlite3MisuseError(int);
+SQLITE_PRIVATE int sqlite3CantopenError(int);
+#define SQLITE_CORRUPT_BKPT sqlite3CorruptError(__LINE__)
+#define SQLITE_MISUSE_BKPT sqlite3MisuseError(__LINE__)
+#define SQLITE_CANTOPEN_BKPT sqlite3CantopenError(__LINE__)
+#ifdef SQLITE_DEBUG
+SQLITE_PRIVATE int sqlite3NomemError(int);
+SQLITE_PRIVATE int sqlite3IoerrnomemError(int);
+# define SQLITE_NOMEM_BKPT sqlite3NomemError(__LINE__)
+# define SQLITE_IOERR_NOMEM_BKPT sqlite3IoerrnomemError(__LINE__)
+#else
+# define SQLITE_NOMEM_BKPT SQLITE_NOMEM
+# define SQLITE_IOERR_NOMEM_BKPT SQLITE_IOERR_NOMEM
+#endif
+#if defined(SQLITE_DEBUG) || defined(SQLITE_ENABLE_CORRUPT_PGNO)
+SQLITE_PRIVATE int sqlite3CorruptPgnoError(int,Pgno);
+# define SQLITE_CORRUPT_PGNO(P) sqlite3CorruptPgnoError(__LINE__,(P))
+#else
+# define SQLITE_CORRUPT_PGNO(P) sqlite3CorruptError(__LINE__)
+#endif
+
+/*
+** FTS3 and FTS4 both require virtual table support
+*/
+#if defined(SQLITE_OMIT_VIRTUALTABLE)
+# undef SQLITE_ENABLE_FTS3
+# undef SQLITE_ENABLE_FTS4
+#endif
+
+/*
+** FTS4 is really an extension for FTS3. It is enabled using the
+** SQLITE_ENABLE_FTS3 macro. But to avoid confusion we also call
+** the SQLITE_ENABLE_FTS4 macro to serve as an alias for SQLITE_ENABLE_FTS3.
+*/
+#if defined(SQLITE_ENABLE_FTS4) && !defined(SQLITE_ENABLE_FTS3)
+# define SQLITE_ENABLE_FTS3 1
+#endif
+
+/*
+** The following macros mimic the standard library functions toupper(),
+** isspace(), isalnum(), isdigit() and isxdigit(), respectively. The
+** sqlite versions only work for ASCII characters, regardless of locale.
+*/
+#ifdef SQLITE_ASCII
+# define sqlite3Toupper(x) ((x)&~(sqlite3CtypeMap[(unsigned char)(x)]&0x20))
+# define sqlite3Isspace(x) (sqlite3CtypeMap[(unsigned char)(x)]&0x01)
+# define sqlite3Isalnum(x) (sqlite3CtypeMap[(unsigned char)(x)]&0x06)
+# define sqlite3Isalpha(x) (sqlite3CtypeMap[(unsigned char)(x)]&0x02)
+# define sqlite3Isdigit(x) (sqlite3CtypeMap[(unsigned char)(x)]&0x04)
+# define sqlite3Isxdigit(x) (sqlite3CtypeMap[(unsigned char)(x)]&0x08)
+# define sqlite3Tolower(x) (sqlite3UpperToLower[(unsigned char)(x)])
+# define sqlite3Isquote(x) (sqlite3CtypeMap[(unsigned char)(x)]&0x80)
+# define sqlite3JsonId1(x) (sqlite3CtypeMap[(unsigned char)(x)]&0x42)
+# define sqlite3JsonId2(x) (sqlite3CtypeMap[(unsigned char)(x)]&0x46)
+#else
+# define sqlite3Toupper(x) toupper((unsigned char)(x))
+# define sqlite3Isspace(x) isspace((unsigned char)(x))
+# define sqlite3Isalnum(x) isalnum((unsigned char)(x))
+# define sqlite3Isalpha(x) isalpha((unsigned char)(x))
+# define sqlite3Isdigit(x) isdigit((unsigned char)(x))
+# define sqlite3Isxdigit(x) isxdigit((unsigned char)(x))
+# define sqlite3Tolower(x) tolower((unsigned char)(x))
+# define sqlite3Isquote(x) ((x)=='"'||(x)=='\''||(x)=='['||(x)=='`')
+# define sqlite3JsonId1(x) (sqlite3IsIdChar(x)&&(x)<'0')
+# define sqlite3JsonId2(x) sqlite3IsIdChar(x)
+#endif
+SQLITE_PRIVATE int sqlite3IsIdChar(u8);
+
+/*
+** Internal function prototypes
+*/
+SQLITE_PRIVATE int sqlite3StrICmp(const char*,const char*);
+SQLITE_PRIVATE int sqlite3Strlen30(const char*);
+#define sqlite3Strlen30NN(C) (strlen(C)&0x3fffffff)
+SQLITE_PRIVATE char *sqlite3ColumnType(Column*,char*);
+#define sqlite3StrNICmp sqlite3_strnicmp
+
+SQLITE_PRIVATE int sqlite3MallocInit(void);
+SQLITE_PRIVATE void sqlite3MallocEnd(void);
+SQLITE_PRIVATE void *sqlite3Malloc(u64);
+SQLITE_PRIVATE void *sqlite3MallocZero(u64);
+SQLITE_PRIVATE void *sqlite3DbMallocZero(sqlite3*, u64);
+SQLITE_PRIVATE void *sqlite3DbMallocRaw(sqlite3*, u64);
+SQLITE_PRIVATE void *sqlite3DbMallocRawNN(sqlite3*, u64);
+SQLITE_PRIVATE char *sqlite3DbStrDup(sqlite3*,const char*);
+SQLITE_PRIVATE char *sqlite3DbStrNDup(sqlite3*,const char*, u64);
+SQLITE_PRIVATE char *sqlite3DbSpanDup(sqlite3*,const char*,const char*);
+SQLITE_PRIVATE void *sqlite3Realloc(void*, u64);
+SQLITE_PRIVATE void *sqlite3DbReallocOrFree(sqlite3 *, void *, u64);
+SQLITE_PRIVATE void *sqlite3DbRealloc(sqlite3 *, void *, u64);
+SQLITE_PRIVATE void sqlite3DbFree(sqlite3*, void*);
+SQLITE_PRIVATE void sqlite3DbFreeNN(sqlite3*, void*);
+SQLITE_PRIVATE void sqlite3DbNNFreeNN(sqlite3*, void*);
+SQLITE_PRIVATE int sqlite3MallocSize(const void*);
+SQLITE_PRIVATE int sqlite3DbMallocSize(sqlite3*, const void*);
+SQLITE_PRIVATE void *sqlite3PageMalloc(int);
+SQLITE_PRIVATE void sqlite3PageFree(void*);
+SQLITE_PRIVATE void sqlite3MemSetDefault(void);
+#ifndef SQLITE_UNTESTABLE
+SQLITE_PRIVATE void sqlite3BenignMallocHooks(void (*)(void), void (*)(void));
+#endif
+SQLITE_PRIVATE int sqlite3HeapNearlyFull(void);
+
+/*
+** On systems with ample stack space and that support alloca(), make
+** use of alloca() to obtain space for large automatic objects. By default,
+** obtain space from malloc().
+**
+** The alloca() routine never returns NULL. This will cause code paths
+** that deal with sqlite3StackAlloc() failures to be unreachable.
+*/
+#ifdef SQLITE_USE_ALLOCA
+# define sqlite3StackAllocRaw(D,N) alloca(N)
+# define sqlite3StackAllocRawNN(D,N) alloca(N)
+# define sqlite3StackFree(D,P)
+# define sqlite3StackFreeNN(D,P)
+#else
+# define sqlite3StackAllocRaw(D,N) sqlite3DbMallocRaw(D,N)
+# define sqlite3StackAllocRawNN(D,N) sqlite3DbMallocRawNN(D,N)
+# define sqlite3StackFree(D,P) sqlite3DbFree(D,P)
+# define sqlite3StackFreeNN(D,P) sqlite3DbFreeNN(D,P)
+#endif
+
+/* Do not allow both MEMSYS5 and MEMSYS3 to be defined together. If they
+** are, disable MEMSYS3
+*/
+#ifdef SQLITE_ENABLE_MEMSYS5
+SQLITE_PRIVATE const sqlite3_mem_methods *sqlite3MemGetMemsys5(void);
+#undef SQLITE_ENABLE_MEMSYS3
+#endif
+#ifdef SQLITE_ENABLE_MEMSYS3
+SQLITE_PRIVATE const sqlite3_mem_methods *sqlite3MemGetMemsys3(void);
+#endif
+
+
+#ifndef SQLITE_MUTEX_OMIT
+SQLITE_PRIVATE sqlite3_mutex_methods const *sqlite3DefaultMutex(void);
+SQLITE_PRIVATE sqlite3_mutex_methods const *sqlite3NoopMutex(void);
+SQLITE_PRIVATE sqlite3_mutex *sqlite3MutexAlloc(int);
+SQLITE_PRIVATE int sqlite3MutexInit(void);
+SQLITE_PRIVATE int sqlite3MutexEnd(void);
+#endif
+#if !defined(SQLITE_MUTEX_OMIT) && !defined(SQLITE_MUTEX_NOOP)
+SQLITE_PRIVATE void sqlite3MemoryBarrier(void);
+#else
+# define sqlite3MemoryBarrier()
+#endif
+
+SQLITE_PRIVATE sqlite3_int64 sqlite3StatusValue(int);
+SQLITE_PRIVATE void sqlite3StatusUp(int, int);
+SQLITE_PRIVATE void sqlite3StatusDown(int, int);
+SQLITE_PRIVATE void sqlite3StatusHighwater(int, int);
+SQLITE_PRIVATE int sqlite3LookasideUsed(sqlite3*,int*);
+
+/* Access to mutexes used by sqlite3_status() */
+SQLITE_PRIVATE sqlite3_mutex *sqlite3Pcache1Mutex(void);
+SQLITE_PRIVATE sqlite3_mutex *sqlite3MallocMutex(void);
+
+#if defined(SQLITE_ENABLE_MULTITHREADED_CHECKS) && !defined(SQLITE_MUTEX_OMIT)
+SQLITE_PRIVATE void sqlite3MutexWarnOnContention(sqlite3_mutex*);
+#else
+# define sqlite3MutexWarnOnContention(x)
+#endif
+
+#ifndef SQLITE_OMIT_FLOATING_POINT
+# define EXP754 (((u64)0x7ff)<<52)
+# define MAN754 ((((u64)1)<<52)-1)
+# define IsNaN(X) (((X)&EXP754)==EXP754 && ((X)&MAN754)!=0)
+# define IsOvfl(X) (((X)&EXP754)==EXP754)
+SQLITE_PRIVATE int sqlite3IsNaN(double);
+SQLITE_PRIVATE int sqlite3IsOverflow(double);
+#else
+# define IsNaN(X) 0
+# define sqlite3IsNaN(X) 0
+# define sqlite3IsOVerflow(X) 0
+#endif
+
+/*
+** An instance of the following structure holds information about SQL
+** functions arguments that are the parameters to the printf() function.
+*/
+struct PrintfArguments {
+ int nArg; /* Total number of arguments */
+ int nUsed; /* Number of arguments used so far */
+ sqlite3_value **apArg; /* The argument values */
+};
+
+/*
+** An instance of this object receives the decoding of a floating point
+** value into an approximate decimal representation.
+*/
+struct FpDecode {
+ char sign; /* '+' or '-' */
+ char isSpecial; /* 1: Infinity 2: NaN */
+ int n; /* Significant digits in the decode */
+ int iDP; /* Location of the decimal point */
+ char *z; /* Start of significant digits */
+ char zBuf[24]; /* Storage for significant digits */
+};
+
+SQLITE_PRIVATE void sqlite3FpDecode(FpDecode*,double,int,int);
+SQLITE_PRIVATE char *sqlite3MPrintf(sqlite3*,const char*, ...);
+SQLITE_PRIVATE char *sqlite3VMPrintf(sqlite3*,const char*, va_list);
+#if defined(SQLITE_DEBUG) || defined(SQLITE_HAVE_OS_TRACE)
+SQLITE_PRIVATE void sqlite3DebugPrintf(const char*, ...);
+#endif
+#if defined(SQLITE_TEST)
+SQLITE_PRIVATE void *sqlite3TestTextToPtr(const char*);
+#endif
+
+#if defined(SQLITE_DEBUG)
+SQLITE_PRIVATE void sqlite3TreeViewLine(TreeView*, const char *zFormat, ...);
+SQLITE_PRIVATE void sqlite3TreeViewExpr(TreeView*, const Expr*, u8);
+SQLITE_PRIVATE void sqlite3TreeViewBareExprList(TreeView*, const ExprList*, const char*);
+SQLITE_PRIVATE void sqlite3TreeViewExprList(TreeView*, const ExprList*, u8, const char*);
+SQLITE_PRIVATE void sqlite3TreeViewBareIdList(TreeView*, const IdList*, const char*);
+SQLITE_PRIVATE void sqlite3TreeViewIdList(TreeView*, const IdList*, u8, const char*);
+SQLITE_PRIVATE void sqlite3TreeViewColumnList(TreeView*, const Column*, int, u8);
+SQLITE_PRIVATE void sqlite3TreeViewSrcList(TreeView*, const SrcList*);
+SQLITE_PRIVATE void sqlite3TreeViewSelect(TreeView*, const Select*, u8);
+SQLITE_PRIVATE void sqlite3TreeViewWith(TreeView*, const With*, u8);
+SQLITE_PRIVATE void sqlite3TreeViewUpsert(TreeView*, const Upsert*, u8);
+#if TREETRACE_ENABLED
+SQLITE_PRIVATE void sqlite3TreeViewDelete(const With*, const SrcList*, const Expr*,
+ const ExprList*,const Expr*, const Trigger*);
+SQLITE_PRIVATE void sqlite3TreeViewInsert(const With*, const SrcList*,
+ const IdList*, const Select*, const ExprList*,
+ int, const Upsert*, const Trigger*);
+SQLITE_PRIVATE void sqlite3TreeViewUpdate(const With*, const SrcList*, const ExprList*,
+ const Expr*, int, const ExprList*, const Expr*,
+ const Upsert*, const Trigger*);
+#endif
+#ifndef SQLITE_OMIT_TRIGGER
+SQLITE_PRIVATE void sqlite3TreeViewTriggerStep(TreeView*, const TriggerStep*, u8, u8);
+SQLITE_PRIVATE void sqlite3TreeViewTrigger(TreeView*, const Trigger*, u8, u8);
+#endif
+#ifndef SQLITE_OMIT_WINDOWFUNC
+SQLITE_PRIVATE void sqlite3TreeViewWindow(TreeView*, const Window*, u8);
+SQLITE_PRIVATE void sqlite3TreeViewWinFunc(TreeView*, const Window*, u8);
+#endif
+SQLITE_PRIVATE void sqlite3ShowExpr(const Expr*);
+SQLITE_PRIVATE void sqlite3ShowExprList(const ExprList*);
+SQLITE_PRIVATE void sqlite3ShowIdList(const IdList*);
+SQLITE_PRIVATE void sqlite3ShowSrcList(const SrcList*);
+SQLITE_PRIVATE void sqlite3ShowSelect(const Select*);
+SQLITE_PRIVATE void sqlite3ShowWith(const With*);
+SQLITE_PRIVATE void sqlite3ShowUpsert(const Upsert*);
+#ifndef SQLITE_OMIT_TRIGGER
+SQLITE_PRIVATE void sqlite3ShowTriggerStep(const TriggerStep*);
+SQLITE_PRIVATE void sqlite3ShowTriggerStepList(const TriggerStep*);
+SQLITE_PRIVATE void sqlite3ShowTrigger(const Trigger*);
+SQLITE_PRIVATE void sqlite3ShowTriggerList(const Trigger*);
+#endif
+#ifndef SQLITE_OMIT_WINDOWFUNC
+SQLITE_PRIVATE void sqlite3ShowWindow(const Window*);
+SQLITE_PRIVATE void sqlite3ShowWinFunc(const Window*);
+#endif
+#endif
+
+SQLITE_PRIVATE void sqlite3SetString(char **, sqlite3*, const char*);
+SQLITE_PRIVATE void sqlite3ProgressCheck(Parse*);
+SQLITE_PRIVATE void sqlite3ErrorMsg(Parse*, const char*, ...);
+SQLITE_PRIVATE int sqlite3ErrorToParser(sqlite3*,int);
+SQLITE_PRIVATE void sqlite3Dequote(char*);
+SQLITE_PRIVATE void sqlite3DequoteExpr(Expr*);
+SQLITE_PRIVATE void sqlite3DequoteToken(Token*);
+SQLITE_PRIVATE void sqlite3DequoteNumber(Parse*, Expr*);
+SQLITE_PRIVATE void sqlite3TokenInit(Token*,char*);
+SQLITE_PRIVATE int sqlite3KeywordCode(const unsigned char*, int);
+SQLITE_PRIVATE int sqlite3RunParser(Parse*, const char*);
+SQLITE_PRIVATE void sqlite3FinishCoding(Parse*);
+SQLITE_PRIVATE int sqlite3GetTempReg(Parse*);
+SQLITE_PRIVATE void sqlite3ReleaseTempReg(Parse*,int);
+SQLITE_PRIVATE int sqlite3GetTempRange(Parse*,int);
+SQLITE_PRIVATE void sqlite3ReleaseTempRange(Parse*,int,int);
+SQLITE_PRIVATE void sqlite3ClearTempRegCache(Parse*);
+SQLITE_PRIVATE void sqlite3TouchRegister(Parse*,int);
+#if defined(SQLITE_ENABLE_STAT4) || defined(SQLITE_DEBUG)
+SQLITE_PRIVATE int sqlite3FirstAvailableRegister(Parse*,int);
+#endif
+#ifdef SQLITE_DEBUG
+SQLITE_PRIVATE int sqlite3NoTempsInRange(Parse*,int,int);
+#endif
+SQLITE_PRIVATE Expr *sqlite3ExprAlloc(sqlite3*,int,const Token*,int);
+SQLITE_PRIVATE Expr *sqlite3Expr(sqlite3*,int,const char*);
+SQLITE_PRIVATE void sqlite3ExprAttachSubtrees(sqlite3*,Expr*,Expr*,Expr*);
+SQLITE_PRIVATE Expr *sqlite3PExpr(Parse*, int, Expr*, Expr*);
+SQLITE_PRIVATE void sqlite3PExprAddSelect(Parse*, Expr*, Select*);
+SQLITE_PRIVATE Expr *sqlite3ExprAnd(Parse*,Expr*, Expr*);
+SQLITE_PRIVATE Expr *sqlite3ExprSimplifiedAndOr(Expr*);
+SQLITE_PRIVATE Expr *sqlite3ExprFunction(Parse*,ExprList*, const Token*, int);
+SQLITE_PRIVATE void sqlite3ExprAddFunctionOrderBy(Parse*,Expr*,ExprList*);
+SQLITE_PRIVATE void sqlite3ExprOrderByAggregateError(Parse*,Expr*);
+SQLITE_PRIVATE void sqlite3ExprFunctionUsable(Parse*,const Expr*,const FuncDef*);
+SQLITE_PRIVATE void sqlite3ExprAssignVarNumber(Parse*, Expr*, u32);
+SQLITE_PRIVATE void sqlite3ExprDelete(sqlite3*, Expr*);
+SQLITE_PRIVATE void sqlite3ExprDeleteGeneric(sqlite3*,void*);
+SQLITE_PRIVATE int sqlite3ExprDeferredDelete(Parse*, Expr*);
+SQLITE_PRIVATE void sqlite3ExprUnmapAndDelete(Parse*, Expr*);
+SQLITE_PRIVATE ExprList *sqlite3ExprListAppend(Parse*,ExprList*,Expr*);
+SQLITE_PRIVATE ExprList *sqlite3ExprListAppendVector(Parse*,ExprList*,IdList*,Expr*);
+SQLITE_PRIVATE Select *sqlite3ExprListToValues(Parse*, int, ExprList*);
+SQLITE_PRIVATE void sqlite3ExprListSetSortOrder(ExprList*,int,int);
+SQLITE_PRIVATE void sqlite3ExprListSetName(Parse*,ExprList*,const Token*,int);
+SQLITE_PRIVATE void sqlite3ExprListSetSpan(Parse*,ExprList*,const char*,const char*);
+SQLITE_PRIVATE void sqlite3ExprListDelete(sqlite3*, ExprList*);
+SQLITE_PRIVATE void sqlite3ExprListDeleteGeneric(sqlite3*,void*);
+SQLITE_PRIVATE u32 sqlite3ExprListFlags(const ExprList*);
+SQLITE_PRIVATE int sqlite3IndexHasDuplicateRootPage(Index*);
+SQLITE_PRIVATE int sqlite3Init(sqlite3*, char**);
+SQLITE_PRIVATE int sqlite3InitCallback(void*, int, char**, char**);
+SQLITE_PRIVATE int sqlite3InitOne(sqlite3*, int, char**, u32);
+SQLITE_PRIVATE void sqlite3Pragma(Parse*,Token*,Token*,Token*,int);
+#ifndef SQLITE_OMIT_VIRTUALTABLE
+SQLITE_PRIVATE Module *sqlite3PragmaVtabRegister(sqlite3*,const char *zName);
+#endif
+SQLITE_PRIVATE void sqlite3ResetAllSchemasOfConnection(sqlite3*);
+SQLITE_PRIVATE void sqlite3ResetOneSchema(sqlite3*,int);
+SQLITE_PRIVATE void sqlite3CollapseDatabaseArray(sqlite3*);
+SQLITE_PRIVATE void sqlite3CommitInternalChanges(sqlite3*);
+SQLITE_PRIVATE void sqlite3ColumnSetExpr(Parse*,Table*,Column*,Expr*);
+SQLITE_PRIVATE Expr *sqlite3ColumnExpr(Table*,Column*);
+SQLITE_PRIVATE void sqlite3ColumnSetColl(sqlite3*,Column*,const char*zColl);
+SQLITE_PRIVATE const char *sqlite3ColumnColl(Column*);
+SQLITE_PRIVATE void sqlite3DeleteColumnNames(sqlite3*,Table*);
+SQLITE_PRIVATE void sqlite3GenerateColumnNames(Parse *pParse, Select *pSelect);
+SQLITE_PRIVATE int sqlite3ColumnsFromExprList(Parse*,ExprList*,i16*,Column**);
+SQLITE_PRIVATE void sqlite3SubqueryColumnTypes(Parse*,Table*,Select*,char);
+SQLITE_PRIVATE Table *sqlite3ResultSetOfSelect(Parse*,Select*,char);
+SQLITE_PRIVATE void sqlite3OpenSchemaTable(Parse *, int);
+SQLITE_PRIVATE Index *sqlite3PrimaryKeyIndex(Table*);
+SQLITE_PRIVATE int sqlite3TableColumnToIndex(Index*, int);
+#ifdef SQLITE_OMIT_GENERATED_COLUMNS
+# define sqlite3TableColumnToStorage(T,X) (X) /* No-op pass-through */
+# define sqlite3StorageColumnToTable(T,X) (X) /* No-op pass-through */
+#else
+SQLITE_PRIVATE i16 sqlite3TableColumnToStorage(Table*, i16);
+SQLITE_PRIVATE i16 sqlite3StorageColumnToTable(Table*, i16);
+#endif
+SQLITE_PRIVATE void sqlite3StartTable(Parse*,Token*,Token*,int,int,int,int);
+#if SQLITE_ENABLE_HIDDEN_COLUMNS
+SQLITE_PRIVATE void sqlite3ColumnPropertiesFromName(Table*, Column*);
+#else
+# define sqlite3ColumnPropertiesFromName(T,C) /* no-op */
+#endif
+SQLITE_PRIVATE void sqlite3AddColumn(Parse*,Token,Token);
+SQLITE_PRIVATE void sqlite3AddNotNull(Parse*, int);
+SQLITE_PRIVATE void sqlite3AddPrimaryKey(Parse*, ExprList*, int, int, int);
+SQLITE_PRIVATE void sqlite3AddCheckConstraint(Parse*, Expr*, const char*, const char*);
+SQLITE_PRIVATE void sqlite3AddDefaultValue(Parse*,Expr*,const char*,const char*);
+SQLITE_PRIVATE void sqlite3AddCollateType(Parse*, Token*);
+SQLITE_PRIVATE void sqlite3AddGenerated(Parse*,Expr*,Token*);
+SQLITE_PRIVATE void sqlite3EndTable(Parse*,Token*,Token*,u32,Select*);
+SQLITE_PRIVATE void sqlite3AddReturning(Parse*,ExprList*);
+SQLITE_PRIVATE int sqlite3ParseUri(const char*,const char*,unsigned int*,
+ sqlite3_vfs**,char**,char **);
+#define sqlite3CodecQueryParameters(A,B,C) 0
+SQLITE_PRIVATE Btree *sqlite3DbNameToBtree(sqlite3*,const char*);
+
+#ifdef SQLITE_UNTESTABLE
+# define sqlite3FaultSim(X) SQLITE_OK
+#else
+SQLITE_PRIVATE int sqlite3FaultSim(int);
+#endif
+
+SQLITE_PRIVATE Bitvec *sqlite3BitvecCreate(u32);
+SQLITE_PRIVATE int sqlite3BitvecTest(Bitvec*, u32);
+SQLITE_PRIVATE int sqlite3BitvecTestNotNull(Bitvec*, u32);
+SQLITE_PRIVATE int sqlite3BitvecSet(Bitvec*, u32);
+SQLITE_PRIVATE void sqlite3BitvecClear(Bitvec*, u32, void*);
+SQLITE_PRIVATE void sqlite3BitvecDestroy(Bitvec*);
+SQLITE_PRIVATE u32 sqlite3BitvecSize(Bitvec*);
+#ifndef SQLITE_UNTESTABLE
+SQLITE_PRIVATE int sqlite3BitvecBuiltinTest(int,int*);
+#endif
+
+SQLITE_PRIVATE RowSet *sqlite3RowSetInit(sqlite3*);
+SQLITE_PRIVATE void sqlite3RowSetDelete(void*);
+SQLITE_PRIVATE void sqlite3RowSetClear(void*);
+SQLITE_PRIVATE void sqlite3RowSetInsert(RowSet*, i64);
+SQLITE_PRIVATE int sqlite3RowSetTest(RowSet*, int iBatch, i64);
+SQLITE_PRIVATE int sqlite3RowSetNext(RowSet*, i64*);
+
+SQLITE_PRIVATE void sqlite3CreateView(Parse*,Token*,Token*,Token*,ExprList*,Select*,int,int);
+
+#if !defined(SQLITE_OMIT_VIEW) || !defined(SQLITE_OMIT_VIRTUALTABLE)
+SQLITE_PRIVATE int sqlite3ViewGetColumnNames(Parse*,Table*);
+#else
+# define sqlite3ViewGetColumnNames(A,B) 0
+#endif
+
+#if SQLITE_MAX_ATTACHED>30
+SQLITE_PRIVATE int sqlite3DbMaskAllZero(yDbMask);
+#endif
+SQLITE_PRIVATE void sqlite3DropTable(Parse*, SrcList*, int, int);
+SQLITE_PRIVATE void sqlite3CodeDropTable(Parse*, Table*, int, int);
+SQLITE_PRIVATE void sqlite3DeleteTable(sqlite3*, Table*);
+SQLITE_PRIVATE void sqlite3DeleteTableGeneric(sqlite3*, void*);
+SQLITE_PRIVATE void sqlite3FreeIndex(sqlite3*, Index*);
+#ifndef SQLITE_OMIT_AUTOINCREMENT
+SQLITE_PRIVATE void sqlite3AutoincrementBegin(Parse *pParse);
+SQLITE_PRIVATE void sqlite3AutoincrementEnd(Parse *pParse);
+#else
+# define sqlite3AutoincrementBegin(X)
+# define sqlite3AutoincrementEnd(X)
+#endif
+SQLITE_PRIVATE void sqlite3Insert(Parse*, SrcList*, Select*, IdList*, int, Upsert*);
+#ifndef SQLITE_OMIT_GENERATED_COLUMNS
+SQLITE_PRIVATE void sqlite3ComputeGeneratedColumns(Parse*, int, Table*);
+#endif
+SQLITE_PRIVATE void *sqlite3ArrayAllocate(sqlite3*,void*,int,int*,int*);
+SQLITE_PRIVATE IdList *sqlite3IdListAppend(Parse*, IdList*, Token*);
+SQLITE_PRIVATE int sqlite3IdListIndex(IdList*,const char*);
+SQLITE_PRIVATE SrcList *sqlite3SrcListEnlarge(Parse*, SrcList*, int, int);
+SQLITE_PRIVATE SrcList *sqlite3SrcListAppendList(Parse *pParse, SrcList *p1, SrcList *p2);
+SQLITE_PRIVATE SrcList *sqlite3SrcListAppend(Parse*, SrcList*, Token*, Token*);
+SQLITE_PRIVATE void sqlite3SubqueryDelete(sqlite3*,Subquery*);
+SQLITE_PRIVATE Select *sqlite3SubqueryDetach(sqlite3*,SrcItem*);
+SQLITE_PRIVATE int sqlite3SrcItemAttachSubquery(Parse*, SrcItem*, Select*, int);
+SQLITE_PRIVATE SrcList *sqlite3SrcListAppendFromTerm(Parse*, SrcList*, Token*, Token*,
+ Token*, Select*, OnOrUsing*);
+SQLITE_PRIVATE void sqlite3SrcListIndexedBy(Parse *, SrcList *, Token *);
+SQLITE_PRIVATE void sqlite3SrcListFuncArgs(Parse*, SrcList*, ExprList*);
+SQLITE_PRIVATE int sqlite3IndexedByLookup(Parse *, SrcItem *);
+SQLITE_PRIVATE void sqlite3SrcListShiftJoinType(Parse*,SrcList*);
+SQLITE_PRIVATE void sqlite3SrcListAssignCursors(Parse*, SrcList*);
+SQLITE_PRIVATE void sqlite3IdListDelete(sqlite3*, IdList*);
+SQLITE_PRIVATE void sqlite3ClearOnOrUsing(sqlite3*, OnOrUsing*);
+SQLITE_PRIVATE void sqlite3SrcListDelete(sqlite3*, SrcList*);
+SQLITE_PRIVATE Index *sqlite3AllocateIndexObject(sqlite3*,int,int,char**);
+SQLITE_PRIVATE void sqlite3CreateIndex(Parse*,Token*,Token*,SrcList*,ExprList*,int,Token*,
+ Expr*, int, int, u8);
+SQLITE_PRIVATE void sqlite3DropIndex(Parse*, SrcList*, int);
+SQLITE_PRIVATE int sqlite3Select(Parse*, Select*, SelectDest*);
+SQLITE_PRIVATE Select *sqlite3SelectNew(Parse*,ExprList*,SrcList*,Expr*,ExprList*,
+ Expr*,ExprList*,u32,Expr*);
+SQLITE_PRIVATE void sqlite3SelectDelete(sqlite3*, Select*);
+SQLITE_PRIVATE void sqlite3SelectDeleteGeneric(sqlite3*,void*);
+SQLITE_PRIVATE Table *sqlite3SrcListLookup(Parse*, SrcList*);
+SQLITE_PRIVATE int sqlite3IsReadOnly(Parse*, Table*, Trigger*);
+SQLITE_PRIVATE void sqlite3OpenTable(Parse*, int iCur, int iDb, Table*, int);
+#if defined(SQLITE_ENABLE_UPDATE_DELETE_LIMIT) && !defined(SQLITE_OMIT_SUBQUERY)
+SQLITE_PRIVATE Expr *sqlite3LimitWhere(Parse*,SrcList*,Expr*,ExprList*,Expr*,char*);
+#endif
+SQLITE_PRIVATE void sqlite3CodeChangeCount(Vdbe*,int,const char*);
+SQLITE_PRIVATE void sqlite3DeleteFrom(Parse*, SrcList*, Expr*, ExprList*, Expr*);
+SQLITE_PRIVATE void sqlite3Update(Parse*, SrcList*, ExprList*,Expr*,int,ExprList*,Expr*,
+ Upsert*);
+SQLITE_PRIVATE WhereInfo *sqlite3WhereBegin(Parse*,SrcList*,Expr*,ExprList*,
+ ExprList*,Select*,u16,int);
+SQLITE_PRIVATE void sqlite3WhereEnd(WhereInfo*);
+SQLITE_PRIVATE LogEst sqlite3WhereOutputRowCount(WhereInfo*);
+SQLITE_PRIVATE int sqlite3WhereIsDistinct(WhereInfo*);
+SQLITE_PRIVATE int sqlite3WhereIsOrdered(WhereInfo*);
+SQLITE_PRIVATE int sqlite3WhereOrderByLimitOptLabel(WhereInfo*);
+SQLITE_PRIVATE void sqlite3WhereMinMaxOptEarlyOut(Vdbe*,WhereInfo*);
+SQLITE_PRIVATE int sqlite3WhereIsSorted(WhereInfo*);
+SQLITE_PRIVATE int sqlite3WhereContinueLabel(WhereInfo*);
+SQLITE_PRIVATE int sqlite3WhereBreakLabel(WhereInfo*);
+SQLITE_PRIVATE int sqlite3WhereOkOnePass(WhereInfo*, int*);
+#define ONEPASS_OFF 0 /* Use of ONEPASS not allowed */
+#define ONEPASS_SINGLE 1 /* ONEPASS valid for a single row update */
+#define ONEPASS_MULTI 2 /* ONEPASS is valid for multiple rows */
+SQLITE_PRIVATE int sqlite3WhereUsesDeferredSeek(WhereInfo*);
+SQLITE_PRIVATE void sqlite3ExprCodeLoadIndexColumn(Parse*, Index*, int, int, int);
+SQLITE_PRIVATE int sqlite3ExprCodeGetColumn(Parse*, Table*, int, int, int, u8);
+SQLITE_PRIVATE void sqlite3ExprCodeGetColumnOfTable(Vdbe*, Table*, int, int, int);
+SQLITE_PRIVATE void sqlite3ExprCodeMove(Parse*, int, int, int);
+SQLITE_PRIVATE void sqlite3ExprToRegister(Expr *pExpr, int iReg);
+SQLITE_PRIVATE void sqlite3ExprCode(Parse*, Expr*, int);
+#ifndef SQLITE_OMIT_GENERATED_COLUMNS
+SQLITE_PRIVATE void sqlite3ExprCodeGeneratedColumn(Parse*, Table*, Column*, int);
+#endif
+SQLITE_PRIVATE void sqlite3ExprCodeCopy(Parse*, Expr*, int);
+SQLITE_PRIVATE void sqlite3ExprCodeFactorable(Parse*, Expr*, int);
+SQLITE_PRIVATE int sqlite3ExprCodeRunJustOnce(Parse*, Expr*, int);
+SQLITE_PRIVATE void sqlite3ExprNullRegisterRange(Parse*, int, int);
+SQLITE_PRIVATE int sqlite3ExprCodeTemp(Parse*, Expr*, int*);
+SQLITE_PRIVATE int sqlite3ExprCodeTarget(Parse*, Expr*, int);
+SQLITE_PRIVATE int sqlite3ExprCodeExprList(Parse*, ExprList*, int, int, u8);
+#define SQLITE_ECEL_DUP 0x01 /* Deep, not shallow copies */
+#define SQLITE_ECEL_FACTOR 0x02 /* Factor out constant terms */
+#define SQLITE_ECEL_REF 0x04 /* Use ExprList.u.x.iOrderByCol */
+#define SQLITE_ECEL_OMITREF 0x08 /* Omit if ExprList.u.x.iOrderByCol */
+SQLITE_PRIVATE void sqlite3ExprIfTrue(Parse*, Expr*, int, int);
+SQLITE_PRIVATE void sqlite3ExprIfFalse(Parse*, Expr*, int, int);
+SQLITE_PRIVATE void sqlite3ExprIfFalseDup(Parse*, Expr*, int, int);
+SQLITE_PRIVATE Table *sqlite3FindTable(sqlite3*,const char*, const char*);
+#define LOCATE_VIEW 0x01
+#define LOCATE_NOERR 0x02
+SQLITE_PRIVATE Table *sqlite3LocateTable(Parse*,u32 flags,const char*, const char*);
+SQLITE_PRIVATE const char *sqlite3PreferredTableName(const char*);
+SQLITE_PRIVATE Table *sqlite3LocateTableItem(Parse*,u32 flags,SrcItem *);
+SQLITE_PRIVATE Index *sqlite3FindIndex(sqlite3*,const char*, const char*);
+SQLITE_PRIVATE void sqlite3UnlinkAndDeleteTable(sqlite3*,int,const char*);
+SQLITE_PRIVATE void sqlite3UnlinkAndDeleteIndex(sqlite3*,int,const char*);
+SQLITE_PRIVATE void sqlite3Vacuum(Parse*,Token*,Expr*);
+SQLITE_PRIVATE int sqlite3RunVacuum(char**, sqlite3*, int, sqlite3_value*);
+SQLITE_PRIVATE char *sqlite3NameFromToken(sqlite3*, const Token*);
+SQLITE_PRIVATE int sqlite3ExprCompare(const Parse*,const Expr*,const Expr*, int);
+SQLITE_PRIVATE int sqlite3ExprCompareSkip(Expr*,Expr*,int);
+SQLITE_PRIVATE int sqlite3ExprListCompare(const ExprList*,const ExprList*, int);
+SQLITE_PRIVATE int sqlite3ExprImpliesExpr(const Parse*,const Expr*,const Expr*, int);
+SQLITE_PRIVATE int sqlite3ExprImpliesNonNullRow(Expr*,int,int);
+SQLITE_PRIVATE void sqlite3AggInfoPersistWalkerInit(Walker*,Parse*);
+SQLITE_PRIVATE void sqlite3ExprAnalyzeAggregates(NameContext*, Expr*);
+SQLITE_PRIVATE void sqlite3ExprAnalyzeAggList(NameContext*,ExprList*);
+SQLITE_PRIVATE int sqlite3ExprCoveredByIndex(Expr*, int iCur, Index *pIdx);
+SQLITE_PRIVATE int sqlite3ReferencesSrcList(Parse*, Expr*, SrcList*);
+SQLITE_PRIVATE Vdbe *sqlite3GetVdbe(Parse*);
+#ifndef SQLITE_UNTESTABLE
+SQLITE_PRIVATE void sqlite3PrngSaveState(void);
+SQLITE_PRIVATE void sqlite3PrngRestoreState(void);
+#endif
+SQLITE_PRIVATE void sqlite3RollbackAll(sqlite3*,int);
+SQLITE_PRIVATE void sqlite3CodeVerifySchema(Parse*, int);
+SQLITE_PRIVATE void sqlite3CodeVerifyNamedSchema(Parse*, const char *zDb);
+SQLITE_PRIVATE void sqlite3BeginTransaction(Parse*, int);
+SQLITE_PRIVATE void sqlite3EndTransaction(Parse*,int);
+SQLITE_PRIVATE void sqlite3Savepoint(Parse*, int, Token*);
+SQLITE_PRIVATE void sqlite3CloseSavepoints(sqlite3 *);
+SQLITE_PRIVATE void sqlite3LeaveMutexAndCloseZombie(sqlite3*);
+SQLITE_PRIVATE u32 sqlite3IsTrueOrFalse(const char*);
+SQLITE_PRIVATE int sqlite3ExprIdToTrueFalse(Expr*);
+SQLITE_PRIVATE int sqlite3ExprTruthValue(const Expr*);
+SQLITE_PRIVATE int sqlite3ExprIsConstant(Parse*,Expr*);
+SQLITE_PRIVATE int sqlite3ExprIsConstantOrFunction(Expr*, u8);
+SQLITE_PRIVATE int sqlite3ExprIsConstantOrGroupBy(Parse*, Expr*, ExprList*);
+SQLITE_PRIVATE int sqlite3ExprIsSingleTableConstraint(Expr*,const SrcList*,int,int);
+#ifdef SQLITE_ENABLE_CURSOR_HINTS
+SQLITE_PRIVATE int sqlite3ExprContainsSubquery(Expr*);
+#endif
+SQLITE_PRIVATE int sqlite3ExprIsInteger(const Expr*, int*, Parse*);
+SQLITE_PRIVATE int sqlite3ExprCanBeNull(const Expr*);
+SQLITE_PRIVATE int sqlite3ExprNeedsNoAffinityChange(const Expr*, char);
+SQLITE_PRIVATE int sqlite3IsRowid(const char*);
+SQLITE_PRIVATE const char *sqlite3RowidAlias(Table *pTab);
+SQLITE_PRIVATE void sqlite3GenerateRowDelete(
+ Parse*,Table*,Trigger*,int,int,int,i16,u8,u8,u8,int);
+SQLITE_PRIVATE void sqlite3GenerateRowIndexDelete(Parse*, Table*, int, int, int*, int);
+SQLITE_PRIVATE int sqlite3GenerateIndexKey(Parse*, Index*, int, int, int, int*,Index*,int);
+SQLITE_PRIVATE void sqlite3ResolvePartIdxLabel(Parse*,int);
+SQLITE_PRIVATE int sqlite3ExprReferencesUpdatedColumn(Expr*,int*,int);
+SQLITE_PRIVATE void sqlite3GenerateConstraintChecks(Parse*,Table*,int*,int,int,int,int,
+ u8,u8,int,int*,int*,Upsert*);
+#ifdef SQLITE_ENABLE_NULL_TRIM
+SQLITE_PRIVATE void sqlite3SetMakeRecordP5(Vdbe*,Table*);
+#else
+# define sqlite3SetMakeRecordP5(A,B)
+#endif
+SQLITE_PRIVATE void sqlite3CompleteInsertion(Parse*,Table*,int,int,int,int*,int,int,int);
+SQLITE_PRIVATE int sqlite3OpenTableAndIndices(Parse*, Table*, int, u8, int, u8*, int*, int*);
+SQLITE_PRIVATE void sqlite3BeginWriteOperation(Parse*, int, int);
+SQLITE_PRIVATE void sqlite3MultiWrite(Parse*);
+SQLITE_PRIVATE void sqlite3MayAbort(Parse*);
+SQLITE_PRIVATE void sqlite3HaltConstraint(Parse*, int, int, char*, i8, u8);
+SQLITE_PRIVATE void sqlite3UniqueConstraint(Parse*, int, Index*);
+SQLITE_PRIVATE void sqlite3RowidConstraint(Parse*, int, Table*);
+SQLITE_PRIVATE Expr *sqlite3ExprDup(sqlite3*,const Expr*,int);
+SQLITE_PRIVATE ExprList *sqlite3ExprListDup(sqlite3*,const ExprList*,int);
+SQLITE_PRIVATE SrcList *sqlite3SrcListDup(sqlite3*,const SrcList*,int);
+SQLITE_PRIVATE IdList *sqlite3IdListDup(sqlite3*,const IdList*);
+SQLITE_PRIVATE Select *sqlite3SelectDup(sqlite3*,const Select*,int);
+SQLITE_PRIVATE FuncDef *sqlite3FunctionSearch(int,const char*);
+SQLITE_PRIVATE void sqlite3InsertBuiltinFuncs(FuncDef*,int);
+SQLITE_PRIVATE FuncDef *sqlite3FindFunction(sqlite3*,const char*,int,u8,u8);
+SQLITE_PRIVATE void sqlite3QuoteValue(StrAccum*,sqlite3_value*,int);
+SQLITE_PRIVATE int sqlite3AppendOneUtf8Character(char*, u32);
+SQLITE_PRIVATE void sqlite3RegisterBuiltinFunctions(void);
+SQLITE_PRIVATE void sqlite3RegisterDateTimeFunctions(void);
+SQLITE_PRIVATE void sqlite3RegisterJsonFunctions(void);
+SQLITE_PRIVATE void sqlite3RegisterPerConnectionBuiltinFunctions(sqlite3*);
+#if !defined(SQLITE_OMIT_VIRTUALTABLE) && !defined(SQLITE_OMIT_JSON)
+SQLITE_PRIVATE int sqlite3JsonTableFunctions(sqlite3*);
+#endif
+SQLITE_PRIVATE int sqlite3SafetyCheckOk(sqlite3*);
+SQLITE_PRIVATE int sqlite3SafetyCheckSickOrOk(sqlite3*);
+SQLITE_PRIVATE void sqlite3ChangeCookie(Parse*, int);
+SQLITE_PRIVATE With *sqlite3WithDup(sqlite3 *db, With *p);
+
+#if !defined(SQLITE_OMIT_VIEW) && !defined(SQLITE_OMIT_TRIGGER)
+SQLITE_PRIVATE void sqlite3MaterializeView(Parse*, Table*, Expr*, ExprList*,Expr*,int);
+#endif
+
+#ifndef SQLITE_OMIT_TRIGGER
+SQLITE_PRIVATE void sqlite3BeginTrigger(Parse*, Token*,Token*,int,int,IdList*,SrcList*,
+ Expr*,int, int);
+SQLITE_PRIVATE void sqlite3FinishTrigger(Parse*, TriggerStep*, Token*);
+SQLITE_PRIVATE void sqlite3DropTrigger(Parse*, SrcList*, int);
+SQLITE_PRIVATE void sqlite3DropTriggerPtr(Parse*, Trigger*);
+SQLITE_PRIVATE Trigger *sqlite3TriggersExist(Parse *, Table*, int, ExprList*, int *pMask);
+SQLITE_PRIVATE Trigger *sqlite3TriggerList(Parse *, Table *);
+SQLITE_PRIVATE void sqlite3CodeRowTrigger(Parse*, Trigger *, int, ExprList*, int, Table *,
+ int, int, int);
+SQLITE_PRIVATE void sqlite3CodeRowTriggerDirect(Parse *, Trigger *, Table *, int, int, int);
+ void sqliteViewTriggers(Parse*, Table*, Expr*, int, ExprList*);
+SQLITE_PRIVATE void sqlite3DeleteTriggerStep(sqlite3*, TriggerStep*);
+SQLITE_PRIVATE TriggerStep *sqlite3TriggerSelectStep(sqlite3*,Select*,
+ const char*,const char*);
+SQLITE_PRIVATE TriggerStep *sqlite3TriggerInsertStep(Parse*,Token*, IdList*,
+ Select*,u8,Upsert*,
+ const char*,const char*);
+SQLITE_PRIVATE TriggerStep *sqlite3TriggerUpdateStep(Parse*,Token*,SrcList*,ExprList*,
+ Expr*, u8, const char*,const char*);
+SQLITE_PRIVATE TriggerStep *sqlite3TriggerDeleteStep(Parse*,Token*, Expr*,
+ const char*,const char*);
+SQLITE_PRIVATE void sqlite3DeleteTrigger(sqlite3*, Trigger*);
+SQLITE_PRIVATE void sqlite3UnlinkAndDeleteTrigger(sqlite3*,int,const char*);
+SQLITE_PRIVATE u32 sqlite3TriggerColmask(Parse*,Trigger*,ExprList*,int,int,Table*,int);
+SQLITE_PRIVATE SrcList *sqlite3TriggerStepSrc(Parse*, TriggerStep*);
+# define sqlite3ParseToplevel(p) ((p)->pToplevel ? (p)->pToplevel : (p))
+# define sqlite3IsToplevel(p) ((p)->pToplevel==0)
+#else
+# define sqlite3TriggersExist(B,C,D,E,F) 0
+# define sqlite3DeleteTrigger(A,B)
+# define sqlite3DropTriggerPtr(A,B)
+# define sqlite3UnlinkAndDeleteTrigger(A,B,C)
+# define sqlite3CodeRowTrigger(A,B,C,D,E,F,G,H,I)
+# define sqlite3CodeRowTriggerDirect(A,B,C,D,E,F)
+# define sqlite3TriggerList(X, Y) 0
+# define sqlite3ParseToplevel(p) p
+# define sqlite3IsToplevel(p) 1
+# define sqlite3TriggerColmask(A,B,C,D,E,F,G) 0
+# define sqlite3TriggerStepSrc(A,B) 0
+#endif
+
+SQLITE_PRIVATE int sqlite3JoinType(Parse*, Token*, Token*, Token*);
+SQLITE_PRIVATE int sqlite3ColumnIndex(Table *pTab, const char *zCol);
+SQLITE_PRIVATE void sqlite3SrcItemColumnUsed(SrcItem*,int);
+SQLITE_PRIVATE void sqlite3SetJoinExpr(Expr*,int,u32);
+SQLITE_PRIVATE void sqlite3CreateForeignKey(Parse*, ExprList*, Token*, ExprList*, int);
+SQLITE_PRIVATE void sqlite3DeferForeignKey(Parse*, int);
+#ifndef SQLITE_OMIT_AUTHORIZATION
+SQLITE_PRIVATE void sqlite3AuthRead(Parse*,Expr*,Schema*,SrcList*);
+SQLITE_PRIVATE int sqlite3AuthCheck(Parse*,int, const char*, const char*, const char*);
+SQLITE_PRIVATE void sqlite3AuthContextPush(Parse*, AuthContext*, const char*);
+SQLITE_PRIVATE void sqlite3AuthContextPop(AuthContext*);
+SQLITE_PRIVATE int sqlite3AuthReadCol(Parse*, const char *, const char *, int);
+#else
+# define sqlite3AuthRead(a,b,c,d)
+# define sqlite3AuthCheck(a,b,c,d,e) SQLITE_OK
+# define sqlite3AuthContextPush(a,b,c)
+# define sqlite3AuthContextPop(a) ((void)(a))
+#endif
+SQLITE_PRIVATE int sqlite3DbIsNamed(sqlite3 *db, int iDb, const char *zName);
+SQLITE_PRIVATE void sqlite3Attach(Parse*, Expr*, Expr*, Expr*);
+SQLITE_PRIVATE void sqlite3Detach(Parse*, Expr*);
+SQLITE_PRIVATE void sqlite3FixInit(DbFixer*, Parse*, int, const char*, const Token*);
+SQLITE_PRIVATE int sqlite3FixSrcList(DbFixer*, SrcList*);
+SQLITE_PRIVATE int sqlite3FixSelect(DbFixer*, Select*);
+SQLITE_PRIVATE int sqlite3FixExpr(DbFixer*, Expr*);
+SQLITE_PRIVATE int sqlite3FixTriggerStep(DbFixer*, TriggerStep*);
+
+SQLITE_PRIVATE int sqlite3RealSameAsInt(double,sqlite3_int64);
+SQLITE_PRIVATE i64 sqlite3RealToI64(double);
+SQLITE_PRIVATE int sqlite3Int64ToText(i64,char*);
+SQLITE_PRIVATE int sqlite3AtoF(const char *z, double*, int, u8);
+SQLITE_PRIVATE int sqlite3GetInt32(const char *, int*);
+SQLITE_PRIVATE int sqlite3GetUInt32(const char*, u32*);
+SQLITE_PRIVATE int sqlite3Atoi(const char*);
+#ifndef SQLITE_OMIT_UTF16
+SQLITE_PRIVATE int sqlite3Utf16ByteLen(const void *pData, int nByte, int nChar);
+#endif
+SQLITE_PRIVATE int sqlite3Utf8CharLen(const char *pData, int nByte);
+SQLITE_PRIVATE u32 sqlite3Utf8Read(const u8**);
+SQLITE_PRIVATE int sqlite3Utf8ReadLimited(const u8*, int, u32*);
+SQLITE_PRIVATE LogEst sqlite3LogEst(u64);
+SQLITE_PRIVATE LogEst sqlite3LogEstAdd(LogEst,LogEst);
+SQLITE_PRIVATE LogEst sqlite3LogEstFromDouble(double);
+SQLITE_PRIVATE u64 sqlite3LogEstToInt(LogEst);
+SQLITE_PRIVATE VList *sqlite3VListAdd(sqlite3*,VList*,const char*,int,int);
+SQLITE_PRIVATE const char *sqlite3VListNumToName(VList*,int);
+SQLITE_PRIVATE int sqlite3VListNameToNum(VList*,const char*,int);
+
+/*
+** Routines to read and write variable-length integers. These used to
+** be defined locally, but now we use the varint routines in the util.c
+** file.
+*/
+SQLITE_PRIVATE int sqlite3PutVarint(unsigned char*, u64);
+SQLITE_PRIVATE u8 sqlite3GetVarint(const unsigned char *, u64 *);
+SQLITE_PRIVATE u8 sqlite3GetVarint32(const unsigned char *, u32 *);
+SQLITE_PRIVATE int sqlite3VarintLen(u64 v);
+
+/*
+** The common case is for a varint to be a single byte. They following
+** macros handle the common case without a procedure call, but then call
+** the procedure for larger varints.
+*/
+#define getVarint32(A,B) \
+ (u8)((*(A)<(u8)0x80)?((B)=(u32)*(A)),1:sqlite3GetVarint32((A),(u32 *)&(B)))
+#define getVarint32NR(A,B) \
+ B=(u32)*(A);if(B>=0x80)sqlite3GetVarint32((A),(u32*)&(B))
+#define putVarint32(A,B) \
+ (u8)(((u32)(B)<(u32)0x80)?(*(A)=(unsigned char)(B)),1:\
+ sqlite3PutVarint((A),(B)))
+#define getVarint sqlite3GetVarint
+#define putVarint sqlite3PutVarint
+
+
+SQLITE_PRIVATE const char *sqlite3IndexAffinityStr(sqlite3*, Index*);
+SQLITE_PRIVATE char *sqlite3TableAffinityStr(sqlite3*,const Table*);
+SQLITE_PRIVATE void sqlite3TableAffinity(Vdbe*, Table*, int);
+SQLITE_PRIVATE char sqlite3CompareAffinity(const Expr *pExpr, char aff2);
+SQLITE_PRIVATE int sqlite3IndexAffinityOk(const Expr *pExpr, char idx_affinity);
+SQLITE_PRIVATE char sqlite3TableColumnAffinity(const Table*,int);
+SQLITE_PRIVATE char sqlite3ExprAffinity(const Expr *pExpr);
+SQLITE_PRIVATE int sqlite3ExprDataType(const Expr *pExpr);
+SQLITE_PRIVATE int sqlite3Atoi64(const char*, i64*, int, u8);
+SQLITE_PRIVATE int sqlite3DecOrHexToI64(const char*, i64*);
+SQLITE_PRIVATE void sqlite3ErrorWithMsg(sqlite3*, int, const char*,...);
+SQLITE_PRIVATE void sqlite3Error(sqlite3*,int);
+SQLITE_PRIVATE void sqlite3ErrorClear(sqlite3*);
+SQLITE_PRIVATE void sqlite3SystemError(sqlite3*,int);
+#if !defined(SQLITE_OMIT_BLOB_LITERAL)
+SQLITE_PRIVATE void *sqlite3HexToBlob(sqlite3*, const char *z, int n);
+#endif
+SQLITE_PRIVATE u8 sqlite3HexToInt(int h);
+SQLITE_PRIVATE int sqlite3TwoPartName(Parse *, Token *, Token *, Token **);
+
+#if defined(SQLITE_NEED_ERR_NAME)
+SQLITE_PRIVATE const char *sqlite3ErrName(int);
+#endif
+
+#ifndef SQLITE_OMIT_DESERIALIZE
+SQLITE_PRIVATE int sqlite3MemdbInit(void);
+SQLITE_PRIVATE int sqlite3IsMemdb(const sqlite3_vfs*);
+#else
+# define sqlite3IsMemdb(X) 0
+#endif
+
+SQLITE_PRIVATE const char *sqlite3ErrStr(int);
+SQLITE_PRIVATE int sqlite3ReadSchema(Parse *pParse);
+SQLITE_PRIVATE CollSeq *sqlite3FindCollSeq(sqlite3*,u8 enc, const char*,int);
+SQLITE_PRIVATE int sqlite3IsBinary(const CollSeq*);
+SQLITE_PRIVATE CollSeq *sqlite3LocateCollSeq(Parse *pParse, const char*zName);
+SQLITE_PRIVATE void sqlite3SetTextEncoding(sqlite3 *db, u8);
+SQLITE_PRIVATE CollSeq *sqlite3ExprCollSeq(Parse *pParse, const Expr *pExpr);
+SQLITE_PRIVATE CollSeq *sqlite3ExprNNCollSeq(Parse *pParse, const Expr *pExpr);
+SQLITE_PRIVATE int sqlite3ExprCollSeqMatch(Parse*,const Expr*,const Expr*);
+SQLITE_PRIVATE Expr *sqlite3ExprAddCollateToken(const Parse *pParse, Expr*, const Token*, int);
+SQLITE_PRIVATE Expr *sqlite3ExprAddCollateString(const Parse*,Expr*,const char*);
+SQLITE_PRIVATE Expr *sqlite3ExprSkipCollate(Expr*);
+SQLITE_PRIVATE Expr *sqlite3ExprSkipCollateAndLikely(Expr*);
+SQLITE_PRIVATE int sqlite3CheckCollSeq(Parse *, CollSeq *);
+SQLITE_PRIVATE int sqlite3WritableSchema(sqlite3*);
+SQLITE_PRIVATE int sqlite3CheckObjectName(Parse*, const char*,const char*,const char*);
+SQLITE_PRIVATE void sqlite3VdbeSetChanges(sqlite3 *, i64);
+SQLITE_PRIVATE int sqlite3AddInt64(i64*,i64);
+SQLITE_PRIVATE int sqlite3SubInt64(i64*,i64);
+SQLITE_PRIVATE int sqlite3MulInt64(i64*,i64);
+SQLITE_PRIVATE int sqlite3AbsInt32(int);
+#ifdef SQLITE_ENABLE_8_3_NAMES
+SQLITE_PRIVATE void sqlite3FileSuffix3(const char*, char*);
+#else
+# define sqlite3FileSuffix3(X,Y)
+#endif
+SQLITE_PRIVATE u8 sqlite3GetBoolean(const char *z,u8);
+
+SQLITE_PRIVATE const void *sqlite3ValueText(sqlite3_value*, u8);
+SQLITE_PRIVATE int sqlite3ValueIsOfClass(const sqlite3_value*, void(*)(void*));
+SQLITE_PRIVATE int sqlite3ValueBytes(sqlite3_value*, u8);
+SQLITE_PRIVATE void sqlite3ValueSetStr(sqlite3_value*, int, const void *,u8,
+ void(*)(void*));
+SQLITE_PRIVATE void sqlite3ValueSetNull(sqlite3_value*);
+SQLITE_PRIVATE void sqlite3ValueFree(sqlite3_value*);
+#ifndef SQLITE_UNTESTABLE
+SQLITE_PRIVATE void sqlite3ResultIntReal(sqlite3_context*);
+#endif
+SQLITE_PRIVATE sqlite3_value *sqlite3ValueNew(sqlite3 *);
+#ifndef SQLITE_OMIT_UTF16
+SQLITE_PRIVATE char *sqlite3Utf16to8(sqlite3 *, const void*, int, u8);
+#endif
+SQLITE_PRIVATE int sqlite3ValueFromExpr(sqlite3 *, const Expr *, u8, u8, sqlite3_value **);
+SQLITE_PRIVATE void sqlite3ValueApplyAffinity(sqlite3_value *, u8, u8);
+#ifndef SQLITE_AMALGAMATION
+SQLITE_PRIVATE const unsigned char sqlite3OpcodeProperty[];
+SQLITE_PRIVATE const char sqlite3StrBINARY[];
+SQLITE_PRIVATE const unsigned char sqlite3StdTypeLen[];
+SQLITE_PRIVATE const char sqlite3StdTypeAffinity[];
+SQLITE_PRIVATE const char *sqlite3StdType[];
+SQLITE_PRIVATE const unsigned char sqlite3UpperToLower[];
+SQLITE_PRIVATE const unsigned char *sqlite3aLTb;
+SQLITE_PRIVATE const unsigned char *sqlite3aEQb;
+SQLITE_PRIVATE const unsigned char *sqlite3aGTb;
+SQLITE_PRIVATE const unsigned char sqlite3CtypeMap[];
+SQLITE_PRIVATE SQLITE_WSD struct Sqlite3Config sqlite3Config;
+SQLITE_PRIVATE FuncDefHash sqlite3BuiltinFunctions;
+#ifndef SQLITE_OMIT_WSD
+SQLITE_PRIVATE int sqlite3PendingByte;
+#endif
+#endif /* SQLITE_AMALGAMATION */
+#ifdef VDBE_PROFILE
+SQLITE_PRIVATE sqlite3_uint64 sqlite3NProfileCnt;
+#endif
+SQLITE_PRIVATE void sqlite3RootPageMoved(sqlite3*, int, Pgno, Pgno);
+SQLITE_PRIVATE void sqlite3Reindex(Parse*, Token*, Token*);
+SQLITE_PRIVATE void sqlite3AlterFunctions(void);
+SQLITE_PRIVATE void sqlite3AlterRenameTable(Parse*, SrcList*, Token*);
+SQLITE_PRIVATE void sqlite3AlterRenameColumn(Parse*, SrcList*, Token*, Token*);
+SQLITE_PRIVATE int sqlite3GetToken(const unsigned char *, int *);
+SQLITE_PRIVATE void sqlite3NestedParse(Parse*, const char*, ...);
+SQLITE_PRIVATE void sqlite3ExpirePreparedStatements(sqlite3*, int);
+SQLITE_PRIVATE void sqlite3CodeRhsOfIN(Parse*, Expr*, int);
+SQLITE_PRIVATE int sqlite3CodeSubselect(Parse*, Expr*);
+SQLITE_PRIVATE void sqlite3SelectPrep(Parse*, Select*, NameContext*);
+SQLITE_PRIVATE int sqlite3ExpandSubquery(Parse*, SrcItem*);
+SQLITE_PRIVATE void sqlite3SelectWrongNumTermsError(Parse *pParse, Select *p);
+SQLITE_PRIVATE int sqlite3MatchEName(
+ const struct ExprList_item*,
+ const char*,
+ const char*,
+ const char*,
+ int*
+);
+SQLITE_PRIVATE Bitmask sqlite3ExprColUsed(Expr*);
+SQLITE_PRIVATE u8 sqlite3StrIHash(const char*);
+SQLITE_PRIVATE int sqlite3ResolveExprNames(NameContext*, Expr*);
+SQLITE_PRIVATE int sqlite3ResolveExprListNames(NameContext*, ExprList*);
+SQLITE_PRIVATE void sqlite3ResolveSelectNames(Parse*, Select*, NameContext*);
+SQLITE_PRIVATE int sqlite3ResolveSelfReference(Parse*,Table*,int,Expr*,ExprList*);
+SQLITE_PRIVATE int sqlite3ResolveOrderGroupBy(Parse*, Select*, ExprList*, const char*);
+SQLITE_PRIVATE void sqlite3ColumnDefault(Vdbe *, Table *, int, int);
+SQLITE_PRIVATE void sqlite3AlterFinishAddColumn(Parse *, Token *);
+SQLITE_PRIVATE void sqlite3AlterBeginAddColumn(Parse *, SrcList *);
+SQLITE_PRIVATE void sqlite3AlterDropColumn(Parse*, SrcList*, const Token*);
+SQLITE_PRIVATE const void *sqlite3RenameTokenMap(Parse*, const void*, const Token*);
+SQLITE_PRIVATE void sqlite3RenameTokenRemap(Parse*, const void *pTo, const void *pFrom);
+SQLITE_PRIVATE void sqlite3RenameExprUnmap(Parse*, Expr*);
+SQLITE_PRIVATE void sqlite3RenameExprlistUnmap(Parse*, ExprList*);
+SQLITE_PRIVATE CollSeq *sqlite3GetCollSeq(Parse*, u8, CollSeq *, const char*);
+SQLITE_PRIVATE char sqlite3AffinityType(const char*, Column*);
+SQLITE_PRIVATE void sqlite3Analyze(Parse*, Token*, Token*);
+SQLITE_PRIVATE int sqlite3InvokeBusyHandler(BusyHandler*);
+SQLITE_PRIVATE int sqlite3FindDb(sqlite3*, Token*);
+SQLITE_PRIVATE int sqlite3FindDbName(sqlite3 *, const char *);
+SQLITE_PRIVATE int sqlite3AnalysisLoad(sqlite3*,int iDB);
+SQLITE_PRIVATE void sqlite3DeleteIndexSamples(sqlite3*,Index*);
+SQLITE_PRIVATE void sqlite3DefaultRowEst(Index*);
+SQLITE_PRIVATE void sqlite3RegisterLikeFunctions(sqlite3*, int);
+SQLITE_PRIVATE int sqlite3IsLikeFunction(sqlite3*,Expr*,int*,char*);
+SQLITE_PRIVATE void sqlite3SchemaClear(void *);
+SQLITE_PRIVATE Schema *sqlite3SchemaGet(sqlite3 *, Btree *);
+SQLITE_PRIVATE int sqlite3SchemaToIndex(sqlite3 *db, Schema *);
+SQLITE_PRIVATE KeyInfo *sqlite3KeyInfoAlloc(sqlite3*,int,int);
+SQLITE_PRIVATE void sqlite3KeyInfoUnref(KeyInfo*);
+SQLITE_PRIVATE KeyInfo *sqlite3KeyInfoRef(KeyInfo*);
+SQLITE_PRIVATE KeyInfo *sqlite3KeyInfoOfIndex(Parse*, Index*);
+SQLITE_PRIVATE KeyInfo *sqlite3KeyInfoFromExprList(Parse*, ExprList*, int, int);
+SQLITE_PRIVATE const char *sqlite3SelectOpName(int);
+SQLITE_PRIVATE int sqlite3HasExplicitNulls(Parse*, ExprList*);
+
+#ifdef SQLITE_DEBUG
+SQLITE_PRIVATE int sqlite3KeyInfoIsWriteable(KeyInfo*);
+#endif
+SQLITE_PRIVATE int sqlite3CreateFunc(sqlite3 *, const char *, int, int, void *,
+ void (*)(sqlite3_context*,int,sqlite3_value **),
+ void (*)(sqlite3_context*,int,sqlite3_value **),
+ void (*)(sqlite3_context*),
+ void (*)(sqlite3_context*),
+ void (*)(sqlite3_context*,int,sqlite3_value **),
+ FuncDestructor *pDestructor
+);
+SQLITE_PRIVATE void sqlite3NoopDestructor(void*);
+SQLITE_PRIVATE void *sqlite3OomFault(sqlite3*);
+SQLITE_PRIVATE void sqlite3OomClear(sqlite3*);
+SQLITE_PRIVATE int sqlite3ApiExit(sqlite3 *db, int);
+SQLITE_PRIVATE int sqlite3OpenTempDatabase(Parse *);
+
+SQLITE_PRIVATE char *sqlite3RCStrRef(char*);
+SQLITE_PRIVATE void sqlite3RCStrUnref(void*);
+SQLITE_PRIVATE char *sqlite3RCStrNew(u64);
+SQLITE_PRIVATE char *sqlite3RCStrResize(char*,u64);
+
+SQLITE_PRIVATE void sqlite3StrAccumInit(StrAccum*, sqlite3*, char*, int, int);
+SQLITE_PRIVATE int sqlite3StrAccumEnlarge(StrAccum*, i64);
+SQLITE_PRIVATE char *sqlite3StrAccumFinish(StrAccum*);
+SQLITE_PRIVATE void sqlite3StrAccumSetError(StrAccum*, u8);
+SQLITE_PRIVATE void sqlite3ResultStrAccum(sqlite3_context*,StrAccum*);
+SQLITE_PRIVATE void sqlite3SelectDestInit(SelectDest*,int,int);
+SQLITE_PRIVATE Expr *sqlite3CreateColumnExpr(sqlite3 *, SrcList *, int, int);
+SQLITE_PRIVATE void sqlite3RecordErrorByteOffset(sqlite3*,const char*);
+SQLITE_PRIVATE void sqlite3RecordErrorOffsetOfExpr(sqlite3*,const Expr*);
+
+SQLITE_PRIVATE void sqlite3BackupRestart(sqlite3_backup *);
+SQLITE_PRIVATE void sqlite3BackupUpdate(sqlite3_backup *, Pgno, const u8 *);
+
+#ifndef SQLITE_OMIT_SUBQUERY
+SQLITE_PRIVATE int sqlite3ExprCheckIN(Parse*, Expr*);
+#else
+# define sqlite3ExprCheckIN(x,y) SQLITE_OK
+#endif
+
+#ifdef SQLITE_ENABLE_STAT4
+SQLITE_PRIVATE int sqlite3Stat4ProbeSetValue(
+ Parse*,Index*,UnpackedRecord**,Expr*,int,int,int*);
+SQLITE_PRIVATE int sqlite3Stat4ValueFromExpr(Parse*, Expr*, u8, sqlite3_value**);
+SQLITE_PRIVATE void sqlite3Stat4ProbeFree(UnpackedRecord*);
+SQLITE_PRIVATE int sqlite3Stat4Column(sqlite3*, const void*, int, int, sqlite3_value**);
+SQLITE_PRIVATE char sqlite3IndexColumnAffinity(sqlite3*, Index*, int);
+#endif
+
+/*
+** The interface to the LEMON-generated parser
+*/
+#ifndef SQLITE_AMALGAMATION
+SQLITE_PRIVATE void *sqlite3ParserAlloc(void*(*)(u64), Parse*);
+SQLITE_PRIVATE void sqlite3ParserFree(void*, void(*)(void*));
+#endif
+SQLITE_PRIVATE void sqlite3Parser(void*, int, Token);
+SQLITE_PRIVATE int sqlite3ParserFallback(int);
+#ifdef YYTRACKMAXSTACKDEPTH
+SQLITE_PRIVATE int sqlite3ParserStackPeak(void*);
+#endif
+
+SQLITE_PRIVATE void sqlite3AutoLoadExtensions(sqlite3*);
+#ifndef SQLITE_OMIT_LOAD_EXTENSION
+SQLITE_PRIVATE void sqlite3CloseExtensions(sqlite3*);
+#else
+# define sqlite3CloseExtensions(X)
+#endif
+
+#ifndef SQLITE_OMIT_SHARED_CACHE
+SQLITE_PRIVATE void sqlite3TableLock(Parse *, int, Pgno, u8, const char *);
+#else
+ #define sqlite3TableLock(v,w,x,y,z)
+#endif
+
+#ifdef SQLITE_TEST
+SQLITE_PRIVATE int sqlite3Utf8To8(unsigned char*);
+#endif
+
+#ifdef SQLITE_OMIT_VIRTUALTABLE
+# define sqlite3VtabClear(D,T)
+# define sqlite3VtabSync(X,Y) SQLITE_OK
+# define sqlite3VtabRollback(X)
+# define sqlite3VtabCommit(X)
+# define sqlite3VtabInSync(db) 0
+# define sqlite3VtabLock(X)
+# define sqlite3VtabUnlock(X)
+# define sqlite3VtabModuleUnref(D,X)
+# define sqlite3VtabUnlockList(X)
+# define sqlite3VtabSavepoint(X, Y, Z) SQLITE_OK
+# define sqlite3GetVTable(X,Y) ((VTable*)0)
+#else
+SQLITE_PRIVATE void sqlite3VtabClear(sqlite3 *db, Table*);
+SQLITE_PRIVATE void sqlite3VtabDisconnect(sqlite3 *db, Table *p);
+SQLITE_PRIVATE int sqlite3VtabSync(sqlite3 *db, Vdbe*);
+SQLITE_PRIVATE int sqlite3VtabRollback(sqlite3 *db);
+SQLITE_PRIVATE int sqlite3VtabCommit(sqlite3 *db);
+SQLITE_PRIVATE void sqlite3VtabLock(VTable *);
+SQLITE_PRIVATE void sqlite3VtabUnlock(VTable *);
+SQLITE_PRIVATE void sqlite3VtabModuleUnref(sqlite3*,Module*);
+SQLITE_PRIVATE void sqlite3VtabUnlockList(sqlite3*);
+SQLITE_PRIVATE int sqlite3VtabSavepoint(sqlite3 *, int, int);
+SQLITE_PRIVATE void sqlite3VtabImportErrmsg(Vdbe*, sqlite3_vtab*);
+SQLITE_PRIVATE VTable *sqlite3GetVTable(sqlite3*, Table*);
+SQLITE_PRIVATE Module *sqlite3VtabCreateModule(
+ sqlite3*,
+ const char*,
+ const sqlite3_module*,
+ void*,
+ void(*)(void*)
+ );
+# define sqlite3VtabInSync(db) ((db)->nVTrans>0 && (db)->aVTrans==0)
+#endif
+SQLITE_PRIVATE int sqlite3ReadOnlyShadowTables(sqlite3 *db);
+#ifndef SQLITE_OMIT_VIRTUALTABLE
+SQLITE_PRIVATE int sqlite3ShadowTableName(sqlite3 *db, const char *zName);
+SQLITE_PRIVATE int sqlite3IsShadowTableOf(sqlite3*,Table*,const char*);
+SQLITE_PRIVATE void sqlite3MarkAllShadowTablesOf(sqlite3*, Table*);
+#else
+# define sqlite3ShadowTableName(A,B) 0
+# define sqlite3IsShadowTableOf(A,B,C) 0
+# define sqlite3MarkAllShadowTablesOf(A,B)
+#endif
+SQLITE_PRIVATE int sqlite3VtabEponymousTableInit(Parse*,Module*);
+SQLITE_PRIVATE void sqlite3VtabEponymousTableClear(sqlite3*,Module*);
+SQLITE_PRIVATE void sqlite3VtabMakeWritable(Parse*,Table*);
+SQLITE_PRIVATE void sqlite3VtabBeginParse(Parse*, Token*, Token*, Token*, int);
+SQLITE_PRIVATE void sqlite3VtabFinishParse(Parse*, Token*);
+SQLITE_PRIVATE void sqlite3VtabArgInit(Parse*);
+SQLITE_PRIVATE void sqlite3VtabArgExtend(Parse*, Token*);
+SQLITE_PRIVATE int sqlite3VtabCallCreate(sqlite3*, int, const char *, char **);
+SQLITE_PRIVATE int sqlite3VtabCallConnect(Parse*, Table*);
+SQLITE_PRIVATE int sqlite3VtabCallDestroy(sqlite3*, int, const char *);
+SQLITE_PRIVATE int sqlite3VtabBegin(sqlite3 *, VTable *);
+
+SQLITE_PRIVATE FuncDef *sqlite3VtabOverloadFunction(sqlite3 *,FuncDef*, int nArg, Expr*);
+SQLITE_PRIVATE void sqlite3VtabUsesAllSchemas(Parse*);
+SQLITE_PRIVATE sqlite3_int64 sqlite3StmtCurrentTime(sqlite3_context*);
+SQLITE_PRIVATE int sqlite3VdbeParameterIndex(Vdbe*, const char*, int);
+SQLITE_PRIVATE int sqlite3TransferBindings(sqlite3_stmt *, sqlite3_stmt *);
+SQLITE_PRIVATE void sqlite3ParseObjectInit(Parse*,sqlite3*);
+SQLITE_PRIVATE void sqlite3ParseObjectReset(Parse*);
+SQLITE_PRIVATE void *sqlite3ParserAddCleanup(Parse*,void(*)(sqlite3*,void*),void*);
+#ifdef SQLITE_ENABLE_NORMALIZE
+SQLITE_PRIVATE char *sqlite3Normalize(Vdbe*, const char*);
+#endif
+SQLITE_PRIVATE int sqlite3Reprepare(Vdbe*);
+SQLITE_PRIVATE void sqlite3ExprListCheckLength(Parse*, ExprList*, const char*);
+SQLITE_PRIVATE CollSeq *sqlite3ExprCompareCollSeq(Parse*,const Expr*);
+SQLITE_PRIVATE CollSeq *sqlite3BinaryCompareCollSeq(Parse *, const Expr*, const Expr*);
+SQLITE_PRIVATE int sqlite3TempInMemory(const sqlite3*);
+SQLITE_PRIVATE const char *sqlite3JournalModename(int);
+#ifndef SQLITE_OMIT_WAL
+SQLITE_PRIVATE int sqlite3Checkpoint(sqlite3*, int, int, int*, int*);
+SQLITE_PRIVATE int sqlite3WalDefaultHook(void*,sqlite3*,const char*,int);
+#endif
+#ifndef SQLITE_OMIT_CTE
+SQLITE_PRIVATE Cte *sqlite3CteNew(Parse*,Token*,ExprList*,Select*,u8);
+SQLITE_PRIVATE void sqlite3CteDelete(sqlite3*,Cte*);
+SQLITE_PRIVATE With *sqlite3WithAdd(Parse*,With*,Cte*);
+SQLITE_PRIVATE void sqlite3WithDelete(sqlite3*,With*);
+SQLITE_PRIVATE void sqlite3WithDeleteGeneric(sqlite3*,void*);
+SQLITE_PRIVATE With *sqlite3WithPush(Parse*, With*, u8);
+#else
+# define sqlite3CteNew(P,T,E,S) ((void*)0)
+# define sqlite3CteDelete(D,C)
+# define sqlite3CteWithAdd(P,W,C) ((void*)0)
+# define sqlite3WithDelete(x,y)
+# define sqlite3WithPush(x,y,z) ((void*)0)
+#endif
+#ifndef SQLITE_OMIT_UPSERT
+SQLITE_PRIVATE Upsert *sqlite3UpsertNew(sqlite3*,ExprList*,Expr*,ExprList*,Expr*,Upsert*);
+SQLITE_PRIVATE void sqlite3UpsertDelete(sqlite3*,Upsert*);
+SQLITE_PRIVATE Upsert *sqlite3UpsertDup(sqlite3*,Upsert*);
+SQLITE_PRIVATE int sqlite3UpsertAnalyzeTarget(Parse*,SrcList*,Upsert*,Upsert*);
+SQLITE_PRIVATE void sqlite3UpsertDoUpdate(Parse*,Upsert*,Table*,Index*,int);
+SQLITE_PRIVATE Upsert *sqlite3UpsertOfIndex(Upsert*,Index*);
+SQLITE_PRIVATE int sqlite3UpsertNextIsIPK(Upsert*);
+#else
+#define sqlite3UpsertNew(u,v,w,x,y,z) ((Upsert*)0)
+#define sqlite3UpsertDelete(x,y)
+#define sqlite3UpsertDup(x,y) ((Upsert*)0)
+#define sqlite3UpsertOfIndex(x,y) ((Upsert*)0)
+#define sqlite3UpsertNextIsIPK(x) 0
+#endif
+
+
+/* Declarations for functions in fkey.c. All of these are replaced by
+** no-op macros if OMIT_FOREIGN_KEY is defined. In this case no foreign
+** key functionality is available. If OMIT_TRIGGER is defined but
+** OMIT_FOREIGN_KEY is not, only some of the functions are no-oped. In
+** this case foreign keys are parsed, but no other functionality is
+** provided (enforcement of FK constraints requires the triggers sub-system).
+*/
+#if !defined(SQLITE_OMIT_FOREIGN_KEY) && !defined(SQLITE_OMIT_TRIGGER)
+SQLITE_PRIVATE void sqlite3FkCheck(Parse*, Table*, int, int, int*, int);
+SQLITE_PRIVATE void sqlite3FkDropTable(Parse*, SrcList *, Table*);
+SQLITE_PRIVATE void sqlite3FkActions(Parse*, Table*, ExprList*, int, int*, int);
+SQLITE_PRIVATE int sqlite3FkRequired(Parse*, Table*, int*, int);
+SQLITE_PRIVATE u32 sqlite3FkOldmask(Parse*, Table*);
+SQLITE_PRIVATE FKey *sqlite3FkReferences(Table *);
+SQLITE_PRIVATE void sqlite3FkClearTriggerCache(sqlite3*,int);
+#else
+ #define sqlite3FkActions(a,b,c,d,e,f)
+ #define sqlite3FkCheck(a,b,c,d,e,f)
+ #define sqlite3FkDropTable(a,b,c)
+ #define sqlite3FkOldmask(a,b) 0
+ #define sqlite3FkRequired(a,b,c,d) 0
+ #define sqlite3FkReferences(a) 0
+ #define sqlite3FkClearTriggerCache(a,b)
+#endif
+#ifndef SQLITE_OMIT_FOREIGN_KEY
+SQLITE_PRIVATE void sqlite3FkDelete(sqlite3 *, Table*);
+SQLITE_PRIVATE int sqlite3FkLocateIndex(Parse*,Table*,FKey*,Index**,int**);
+#else
+ #define sqlite3FkDelete(a,b)
+ #define sqlite3FkLocateIndex(a,b,c,d,e)
+#endif
+
+
+/*
+** Available fault injectors. Should be numbered beginning with 0.
+*/
+#define SQLITE_FAULTINJECTOR_MALLOC 0
+#define SQLITE_FAULTINJECTOR_COUNT 1
+
+/*
+** The interface to the code in fault.c used for identifying "benign"
+** malloc failures. This is only present if SQLITE_UNTESTABLE
+** is not defined.
+*/
+#ifndef SQLITE_UNTESTABLE
+SQLITE_PRIVATE void sqlite3BeginBenignMalloc(void);
+SQLITE_PRIVATE void sqlite3EndBenignMalloc(void);
+#else
+ #define sqlite3BeginBenignMalloc()
+ #define sqlite3EndBenignMalloc()
+#endif
+
+/*
+** Allowed return values from sqlite3FindInIndex()
+*/
+#define IN_INDEX_ROWID 1 /* Search the rowid of the table */
+#define IN_INDEX_EPH 2 /* Search an ephemeral b-tree */
+#define IN_INDEX_INDEX_ASC 3 /* Existing index ASCENDING */
+#define IN_INDEX_INDEX_DESC 4 /* Existing index DESCENDING */
+#define IN_INDEX_NOOP 5 /* No table available. Use comparisons */
+/*
+** Allowed flags for the 3rd parameter to sqlite3FindInIndex().
+*/
+#define IN_INDEX_NOOP_OK 0x0001 /* OK to return IN_INDEX_NOOP */
+#define IN_INDEX_MEMBERSHIP 0x0002 /* IN operator used for membership test */
+#define IN_INDEX_LOOP 0x0004 /* IN operator used as a loop */
+SQLITE_PRIVATE int sqlite3FindInIndex(Parse *, Expr *, u32, int*, int*, int*);
+
+SQLITE_PRIVATE int sqlite3JournalOpen(sqlite3_vfs *, const char *, sqlite3_file *, int, int);
+SQLITE_PRIVATE int sqlite3JournalSize(sqlite3_vfs *);
+#if defined(SQLITE_ENABLE_ATOMIC_WRITE) \
+ || defined(SQLITE_ENABLE_BATCH_ATOMIC_WRITE)
+SQLITE_PRIVATE int sqlite3JournalCreate(sqlite3_file *);
+#endif
+
+SQLITE_PRIVATE int sqlite3JournalIsInMemory(sqlite3_file *p);
+SQLITE_PRIVATE void sqlite3MemJournalOpen(sqlite3_file *);
+
+SQLITE_PRIVATE void sqlite3ExprSetHeightAndFlags(Parse *pParse, Expr *p);
+#if SQLITE_MAX_EXPR_DEPTH>0
+SQLITE_PRIVATE int sqlite3SelectExprHeight(const Select *);
+SQLITE_PRIVATE int sqlite3ExprCheckHeight(Parse*, int);
+#else
+ #define sqlite3SelectExprHeight(x) 0
+ #define sqlite3ExprCheckHeight(x,y)
+#endif
+SQLITE_PRIVATE void sqlite3ExprSetErrorOffset(Expr*,int);
+
+SQLITE_PRIVATE u32 sqlite3Get4byte(const u8*);
+SQLITE_PRIVATE void sqlite3Put4byte(u8*, u32);
+
+#ifdef SQLITE_ENABLE_UNLOCK_NOTIFY
+SQLITE_PRIVATE void sqlite3ConnectionBlocked(sqlite3 *, sqlite3 *);
+SQLITE_PRIVATE void sqlite3ConnectionUnlocked(sqlite3 *db);
+SQLITE_PRIVATE void sqlite3ConnectionClosed(sqlite3 *db);
+#else
+ #define sqlite3ConnectionBlocked(x,y)
+ #define sqlite3ConnectionUnlocked(x)
+ #define sqlite3ConnectionClosed(x)
+#endif
+
+#ifdef SQLITE_DEBUG
+SQLITE_PRIVATE void sqlite3ParserTrace(FILE*, char *);
+#endif
+#if defined(YYCOVERAGE)
+SQLITE_PRIVATE int sqlite3ParserCoverage(FILE*);
+#endif
+
+/*
+** If the SQLITE_ENABLE IOTRACE exists then the global variable
+** sqlite3IoTrace is a pointer to a printf-like routine used to
+** print I/O tracing messages.
+*/
+#ifdef SQLITE_ENABLE_IOTRACE
+# define IOTRACE(A) if( sqlite3IoTrace ){ sqlite3IoTrace A; }
+SQLITE_PRIVATE void sqlite3VdbeIOTraceSql(Vdbe*);
+SQLITE_API SQLITE_EXTERN void (SQLITE_CDECL *sqlite3IoTrace)(const char*,...);
+#else
+# define IOTRACE(A)
+# define sqlite3VdbeIOTraceSql(X)
+#endif
+
+/*
+** These routines are available for the mem2.c debugging memory allocator
+** only. They are used to verify that different "types" of memory
+** allocations are properly tracked by the system.
+**
+** sqlite3MemdebugSetType() sets the "type" of an allocation to one of
+** the MEMTYPE_* macros defined below. The type must be a bitmask with
+** a single bit set.
+**
+** sqlite3MemdebugHasType() returns true if any of the bits in its second
+** argument match the type set by the previous sqlite3MemdebugSetType().
+** sqlite3MemdebugHasType() is intended for use inside assert() statements.
+**
+** sqlite3MemdebugNoType() returns true if none of the bits in its second
+** argument match the type set by the previous sqlite3MemdebugSetType().
+**
+** Perhaps the most important point is the difference between MEMTYPE_HEAP
+** and MEMTYPE_LOOKASIDE. If an allocation is MEMTYPE_LOOKASIDE, that means
+** it might have been allocated by lookaside, except the allocation was
+** too large or lookaside was already full. It is important to verify
+** that allocations that might have been satisfied by lookaside are not
+** passed back to non-lookaside free() routines. Asserts such as the
+** example above are placed on the non-lookaside free() routines to verify
+** this constraint.
+**
+** All of this is no-op for a production build. It only comes into
+** play when the SQLITE_MEMDEBUG compile-time option is used.
+*/
+#ifdef SQLITE_MEMDEBUG
+SQLITE_PRIVATE void sqlite3MemdebugSetType(void*,u8);
+SQLITE_PRIVATE int sqlite3MemdebugHasType(const void*,u8);
+SQLITE_PRIVATE int sqlite3MemdebugNoType(const void*,u8);
+#else
+# define sqlite3MemdebugSetType(X,Y) /* no-op */
+# define sqlite3MemdebugHasType(X,Y) 1
+# define sqlite3MemdebugNoType(X,Y) 1
+#endif
+#define MEMTYPE_HEAP 0x01 /* General heap allocations */
+#define MEMTYPE_LOOKASIDE 0x02 /* Heap that might have been lookaside */
+#define MEMTYPE_PCACHE 0x04 /* Page cache allocations */
+
+/*
+** Threading interface
+*/
+#if SQLITE_MAX_WORKER_THREADS>0
+SQLITE_PRIVATE int sqlite3ThreadCreate(SQLiteThread**,void*(*)(void*),void*);
+SQLITE_PRIVATE int sqlite3ThreadJoin(SQLiteThread*, void**);
+#endif
+
+#if defined(SQLITE_ENABLE_DBPAGE_VTAB) || defined(SQLITE_TEST)
+SQLITE_PRIVATE int sqlite3DbpageRegister(sqlite3*);
+#endif
+#if defined(SQLITE_ENABLE_DBSTAT_VTAB) || defined(SQLITE_TEST)
+SQLITE_PRIVATE int sqlite3DbstatRegister(sqlite3*);
+#endif
+
+SQLITE_PRIVATE int sqlite3ExprVectorSize(const Expr *pExpr);
+SQLITE_PRIVATE int sqlite3ExprIsVector(const Expr *pExpr);
+SQLITE_PRIVATE Expr *sqlite3VectorFieldSubexpr(Expr*, int);
+SQLITE_PRIVATE Expr *sqlite3ExprForVectorField(Parse*,Expr*,int,int);
+SQLITE_PRIVATE void sqlite3VectorErrorMsg(Parse*, Expr*);
+
+#ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS
+SQLITE_PRIVATE const char **sqlite3CompileOptions(int *pnOpt);
+#endif
+
+#if SQLITE_OS_UNIX && defined(SQLITE_OS_KV_OPTIONAL)
+SQLITE_PRIVATE int sqlite3KvvfsInit(void);
+#endif
+
+#if defined(VDBE_PROFILE) \
+ || defined(SQLITE_PERFORMANCE_TRACE) \
+ || defined(SQLITE_ENABLE_STMT_SCANSTATUS)
+SQLITE_PRIVATE sqlite3_uint64 sqlite3Hwtime(void);
+#endif
+
+#ifdef SQLITE_ENABLE_STMT_SCANSTATUS
+# define IS_STMT_SCANSTATUS(db) (db->flags & SQLITE_StmtScanStatus)
+#else
+# define IS_STMT_SCANSTATUS(db) 0
+#endif
+
+#endif /* SQLITEINT_H */
+
+/************** End of sqliteInt.h *******************************************/
+/************** Begin file os_common.h ***************************************/
+/*
+** 2004 May 22
+**
+** The author disclaims copyright to this source code. In place of
+** a legal notice, here is a blessing:
+**
+** May you do good and not evil.
+** May you find forgiveness for yourself and forgive others.
+** May you share freely, never taking more than you give.
+**
+******************************************************************************
+**
+** This file contains macros and a little bit of code that is common to
+** all of the platform-specific files (os_*.c) and is #included into those
+** files.
+**
+** This file should be #included by the os_*.c files only. It is not a
+** general purpose header file.
+*/
+#ifndef _OS_COMMON_H_
+#define _OS_COMMON_H_
+
+/*
+** At least two bugs have slipped in because we changed the MEMORY_DEBUG
+** macro to SQLITE_DEBUG and some older makefiles have not yet made the
+** switch. The following code should catch this problem at compile-time.
+*/
+#ifdef MEMORY_DEBUG
+# error "The MEMORY_DEBUG macro is obsolete. Use SQLITE_DEBUG instead."
+#endif
+
+/*
+** Macros for performance tracing. Normally turned off. Only works
+** on i486 hardware.
+*/
+#ifdef SQLITE_PERFORMANCE_TRACE
+
+static sqlite_uint64 g_start;
+static sqlite_uint64 g_elapsed;
+#define TIMER_START g_start=sqlite3Hwtime()
+#define TIMER_END g_elapsed=sqlite3Hwtime()-g_start
+#define TIMER_ELAPSED g_elapsed
+#else
+#define TIMER_START
+#define TIMER_END
+#define TIMER_ELAPSED ((sqlite_uint64)0)
+#endif
+
+/*
+** If we compile with the SQLITE_TEST macro set, then the following block
+** of code will give us the ability to simulate a disk I/O error. This
+** is used for testing the I/O recovery logic.
+*/
+#if defined(SQLITE_TEST)
+SQLITE_API extern int sqlite3_io_error_hit;
+SQLITE_API extern int sqlite3_io_error_hardhit;
+SQLITE_API extern int sqlite3_io_error_pending;
+SQLITE_API extern int sqlite3_io_error_persist;
+SQLITE_API extern int sqlite3_io_error_benign;
+SQLITE_API extern int sqlite3_diskfull_pending;
+SQLITE_API extern int sqlite3_diskfull;
+#define SimulateIOErrorBenign(X) sqlite3_io_error_benign=(X)
+#define SimulateIOError(CODE) \
+ if( (sqlite3_io_error_persist && sqlite3_io_error_hit) \
+ || sqlite3_io_error_pending-- == 1 ) \
+ { local_ioerr(); CODE; }
+static void local_ioerr(){
+ IOTRACE(("IOERR\n"));
+ sqlite3_io_error_hit++;
+ if( !sqlite3_io_error_benign ) sqlite3_io_error_hardhit++;
+}
+#define SimulateDiskfullError(CODE) \
+ if( sqlite3_diskfull_pending ){ \
+ if( sqlite3_diskfull_pending == 1 ){ \
+ local_ioerr(); \
+ sqlite3_diskfull = 1; \
+ sqlite3_io_error_hit = 1; \
+ CODE; \
+ }else{ \
+ sqlite3_diskfull_pending--; \
+ } \
+ }
+#else
+#define SimulateIOErrorBenign(X)
+#define SimulateIOError(A)
+#define SimulateDiskfullError(A)
+#endif /* defined(SQLITE_TEST) */
+
+/*
+** When testing, keep a count of the number of open files.
+*/
+#if defined(SQLITE_TEST)
+SQLITE_API extern int sqlite3_open_file_count;
+#define OpenCounter(X) sqlite3_open_file_count+=(X)
+#else
+#define OpenCounter(X)
+#endif /* defined(SQLITE_TEST) */
+
+#endif /* !defined(_OS_COMMON_H_) */
+
+/************** End of os_common.h *******************************************/
+/************** Begin file ctime.c *******************************************/
+/* DO NOT EDIT!
+** This file is automatically generated by the script in the canonical
+** SQLite source tree at tool/mkctimec.tcl.
+**
+** To modify this header, edit any of the various lists in that script
+** which specify categories of generated conditionals in this file.
+*/
+
+/*
+** 2010 February 23
+**
+** The author disclaims copyright to this source code. In place of
+** a legal notice, here is a blessing:
+**
+** May you do good and not evil.
+** May you find forgiveness for yourself and forgive others.
+** May you share freely, never taking more than you give.
+**
+*************************************************************************
+**
+** This file implements routines used to report what compile-time options
+** SQLite was built with.
+*/
+#ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS /* IMP: R-16824-07538 */
+
+/*
+** Include the configuration header output by 'configure' if we're using the
+** autoconf-based build
+*/
+#if defined(_HAVE_SQLITE_CONFIG_H) && !defined(SQLITECONFIG_H)
+/* #include "sqlite_cfg.h" */
+#define SQLITECONFIG_H 1
+#endif
+
+/* These macros are provided to "stringify" the value of the define
+** for those options in which the value is meaningful. */
+#define CTIMEOPT_VAL_(opt) #opt
+#define CTIMEOPT_VAL(opt) CTIMEOPT_VAL_(opt)
+
+/* Like CTIMEOPT_VAL, but especially for SQLITE_DEFAULT_LOOKASIDE. This
+** option requires a separate macro because legal values contain a single
+** comma. e.g. (-DSQLITE_DEFAULT_LOOKASIDE="100,100") */
+#define CTIMEOPT_VAL2_(opt1,opt2) #opt1 "," #opt2
+#define CTIMEOPT_VAL2(opt) CTIMEOPT_VAL2_(opt)
+/* #include "sqliteInt.h" */
+
+/*
+** An array of names of all compile-time options. This array should
+** be sorted A-Z.
+**
+** This array looks large, but in a typical installation actually uses
+** only a handful of compile-time options, so most times this array is usually
+** rather short and uses little memory space.
+*/
+static const char * const sqlite3azCompileOpt[] = {
+
+#ifdef SQLITE_32BIT_ROWID
+ "32BIT_ROWID",
+#endif
+#ifdef SQLITE_4_BYTE_ALIGNED_MALLOC
+ "4_BYTE_ALIGNED_MALLOC",
+#endif
+#ifdef SQLITE_ALLOW_COVERING_INDEX_SCAN
+# if SQLITE_ALLOW_COVERING_INDEX_SCAN != 1
+ "ALLOW_COVERING_INDEX_SCAN=" CTIMEOPT_VAL(SQLITE_ALLOW_COVERING_INDEX_SCAN),
+# endif
+#endif
+#ifdef SQLITE_ALLOW_ROWID_IN_VIEW
+ "ALLOW_ROWID_IN_VIEW",
+#endif
+#ifdef SQLITE_ALLOW_URI_AUTHORITY
+ "ALLOW_URI_AUTHORITY",
+#endif
+#ifdef SQLITE_ATOMIC_INTRINSICS
+ "ATOMIC_INTRINSICS=" CTIMEOPT_VAL(SQLITE_ATOMIC_INTRINSICS),
+#endif
+#ifdef SQLITE_BITMASK_TYPE
+ "BITMASK_TYPE=" CTIMEOPT_VAL(SQLITE_BITMASK_TYPE),
+#endif
+#ifdef SQLITE_BUG_COMPATIBLE_20160819
+ "BUG_COMPATIBLE_20160819",
+#endif
+#ifdef SQLITE_BUG_COMPATIBLE_20250510
+ "BUG_COMPATIBLE_20250510",
+#endif
+#ifdef SQLITE_CASE_SENSITIVE_LIKE
+ "CASE_SENSITIVE_LIKE",
+#endif
+#ifdef SQLITE_CHECK_PAGES
+ "CHECK_PAGES",
+#endif
+#if defined(__clang__) && defined(__clang_major__)
+ "COMPILER=clang-" CTIMEOPT_VAL(__clang_major__) "."
+ CTIMEOPT_VAL(__clang_minor__) "."
+ CTIMEOPT_VAL(__clang_patchlevel__),
+#elif defined(_MSC_VER)
+ "COMPILER=msvc-" CTIMEOPT_VAL(_MSC_VER),
+#elif defined(__GNUC__) && defined(__VERSION__)
+ "COMPILER=gcc-" __VERSION__,
+#endif
+#ifdef SQLITE_COVERAGE_TEST
+ "COVERAGE_TEST",
+#endif
+#ifdef SQLITE_DEBUG
+ "DEBUG",
+#endif
+#ifdef SQLITE_DEFAULT_AUTOMATIC_INDEX
+ "DEFAULT_AUTOMATIC_INDEX",
+#endif
+#ifdef SQLITE_DEFAULT_AUTOVACUUM
+ "DEFAULT_AUTOVACUUM",
+#endif
+#ifdef SQLITE_DEFAULT_CACHE_SIZE
+ "DEFAULT_CACHE_SIZE=" CTIMEOPT_VAL(SQLITE_DEFAULT_CACHE_SIZE),
+#endif
+#ifdef SQLITE_DEFAULT_CKPTFULLFSYNC
+ "DEFAULT_CKPTFULLFSYNC",
+#endif
+#ifdef SQLITE_DEFAULT_FILE_FORMAT
+ "DEFAULT_FILE_FORMAT=" CTIMEOPT_VAL(SQLITE_DEFAULT_FILE_FORMAT),
+#endif
+#ifdef SQLITE_DEFAULT_FILE_PERMISSIONS
+ "DEFAULT_FILE_PERMISSIONS=" CTIMEOPT_VAL(SQLITE_DEFAULT_FILE_PERMISSIONS),
+#endif
+#ifdef SQLITE_DEFAULT_FOREIGN_KEYS
+ "DEFAULT_FOREIGN_KEYS",
+#endif
+#ifdef SQLITE_DEFAULT_JOURNAL_SIZE_LIMIT
+ "DEFAULT_JOURNAL_SIZE_LIMIT=" CTIMEOPT_VAL(SQLITE_DEFAULT_JOURNAL_SIZE_LIMIT),
+#endif
+#ifdef SQLITE_DEFAULT_LOCKING_MODE
+ "DEFAULT_LOCKING_MODE=" CTIMEOPT_VAL(SQLITE_DEFAULT_LOCKING_MODE),
+#endif
+#ifdef SQLITE_DEFAULT_LOOKASIDE
+ "DEFAULT_LOOKASIDE=" CTIMEOPT_VAL2(SQLITE_DEFAULT_LOOKASIDE),
+#endif
+#ifdef SQLITE_DEFAULT_MEMSTATUS
+# if SQLITE_DEFAULT_MEMSTATUS != 1
+ "DEFAULT_MEMSTATUS=" CTIMEOPT_VAL(SQLITE_DEFAULT_MEMSTATUS),
+# endif
+#endif
+#ifdef SQLITE_DEFAULT_MMAP_SIZE
+ "DEFAULT_MMAP_SIZE=" CTIMEOPT_VAL(SQLITE_DEFAULT_MMAP_SIZE),
+#endif
+#ifdef SQLITE_DEFAULT_PAGE_SIZE
+ "DEFAULT_PAGE_SIZE=" CTIMEOPT_VAL(SQLITE_DEFAULT_PAGE_SIZE),
+#endif
+#ifdef SQLITE_DEFAULT_PCACHE_INITSZ
+ "DEFAULT_PCACHE_INITSZ=" CTIMEOPT_VAL(SQLITE_DEFAULT_PCACHE_INITSZ),
+#endif
+#ifdef SQLITE_DEFAULT_PROXYDIR_PERMISSIONS
+ "DEFAULT_PROXYDIR_PERMISSIONS=" CTIMEOPT_VAL(SQLITE_DEFAULT_PROXYDIR_PERMISSIONS),
+#endif
+#ifdef SQLITE_DEFAULT_RECURSIVE_TRIGGERS
+ "DEFAULT_RECURSIVE_TRIGGERS",
+#endif
+#ifdef SQLITE_DEFAULT_ROWEST
+ "DEFAULT_ROWEST=" CTIMEOPT_VAL(SQLITE_DEFAULT_ROWEST),
+#endif
+#ifdef SQLITE_DEFAULT_SECTOR_SIZE
+ "DEFAULT_SECTOR_SIZE=" CTIMEOPT_VAL(SQLITE_DEFAULT_SECTOR_SIZE),
+#endif
+#ifdef SQLITE_DEFAULT_SYNCHRONOUS
+ "DEFAULT_SYNCHRONOUS=" CTIMEOPT_VAL(SQLITE_DEFAULT_SYNCHRONOUS),
+#endif
+#ifdef SQLITE_DEFAULT_WAL_AUTOCHECKPOINT
+ "DEFAULT_WAL_AUTOCHECKPOINT=" CTIMEOPT_VAL(SQLITE_DEFAULT_WAL_AUTOCHECKPOINT),
+#endif
+#ifdef SQLITE_DEFAULT_WAL_SYNCHRONOUS
+ "DEFAULT_WAL_SYNCHRONOUS=" CTIMEOPT_VAL(SQLITE_DEFAULT_WAL_SYNCHRONOUS),
+#endif
+#ifdef SQLITE_DEFAULT_WORKER_THREADS
+ "DEFAULT_WORKER_THREADS=" CTIMEOPT_VAL(SQLITE_DEFAULT_WORKER_THREADS),
+#endif
+#ifdef SQLITE_DIRECT_OVERFLOW_READ
+ "DIRECT_OVERFLOW_READ",
+#endif
+#ifdef SQLITE_DISABLE_DIRSYNC
+ "DISABLE_DIRSYNC",
+#endif
+#ifdef SQLITE_DISABLE_FTS3_UNICODE
+ "DISABLE_FTS3_UNICODE",
+#endif
+#ifdef SQLITE_DISABLE_FTS4_DEFERRED
+ "DISABLE_FTS4_DEFERRED",
+#endif
+#ifdef SQLITE_DISABLE_INTRINSIC
+ "DISABLE_INTRINSIC",
+#endif
+#ifdef SQLITE_DISABLE_LFS
+ "DISABLE_LFS",
+#endif
+#ifdef SQLITE_DISABLE_PAGECACHE_OVERFLOW_STATS
+ "DISABLE_PAGECACHE_OVERFLOW_STATS",
+#endif
+#ifdef SQLITE_DISABLE_SKIPAHEAD_DISTINCT
+ "DISABLE_SKIPAHEAD_DISTINCT",
+#endif
+#ifdef SQLITE_DQS
+ "DQS=" CTIMEOPT_VAL(SQLITE_DQS),
+#endif
+#ifdef SQLITE_ENABLE_8_3_NAMES
+ "ENABLE_8_3_NAMES=" CTIMEOPT_VAL(SQLITE_ENABLE_8_3_NAMES),
+#endif
+#ifdef SQLITE_ENABLE_API_ARMOR
+ "ENABLE_API_ARMOR",
+#endif
+#ifdef SQLITE_ENABLE_ATOMIC_WRITE
+ "ENABLE_ATOMIC_WRITE",
+#endif
+#ifdef SQLITE_ENABLE_BATCH_ATOMIC_WRITE
+ "ENABLE_BATCH_ATOMIC_WRITE",
+#endif
+#ifdef SQLITE_ENABLE_BYTECODE_VTAB
+ "ENABLE_BYTECODE_VTAB",
+#endif
+#ifdef SQLITE_ENABLE_CEROD
+ "ENABLE_CEROD=" CTIMEOPT_VAL(SQLITE_ENABLE_CEROD),
+#endif
+#ifdef SQLITE_ENABLE_COLUMN_METADATA
+ "ENABLE_COLUMN_METADATA",
+#endif
+#ifdef SQLITE_ENABLE_COLUMN_USED_MASK
+ "ENABLE_COLUMN_USED_MASK",
+#endif
+#ifdef SQLITE_ENABLE_COSTMULT
+ "ENABLE_COSTMULT",
+#endif
+#ifdef SQLITE_ENABLE_CURSOR_HINTS
+ "ENABLE_CURSOR_HINTS",
+#endif
+#ifdef SQLITE_ENABLE_DBPAGE_VTAB
+ "ENABLE_DBPAGE_VTAB",
+#endif
+#ifdef SQLITE_ENABLE_DBSTAT_VTAB
+ "ENABLE_DBSTAT_VTAB",
+#endif
+#ifdef SQLITE_ENABLE_EXPENSIVE_ASSERT
+ "ENABLE_EXPENSIVE_ASSERT",
+#endif
+#ifdef SQLITE_ENABLE_EXPLAIN_COMMENTS
+ "ENABLE_EXPLAIN_COMMENTS",
+#endif
+#ifdef SQLITE_ENABLE_FTS3
+ "ENABLE_FTS3",
+#endif
+#ifdef SQLITE_ENABLE_FTS3_PARENTHESIS
+ "ENABLE_FTS3_PARENTHESIS",
+#endif
+#ifdef SQLITE_ENABLE_FTS3_TOKENIZER
+ "ENABLE_FTS3_TOKENIZER",
+#endif
+#ifdef SQLITE_ENABLE_FTS4
+ "ENABLE_FTS4",
+#endif
+#ifdef SQLITE_ENABLE_FTS5
+ "ENABLE_FTS5",
+#endif
+#ifdef SQLITE_ENABLE_GEOPOLY
+ "ENABLE_GEOPOLY",
+#endif
+#ifdef SQLITE_ENABLE_HIDDEN_COLUMNS
+ "ENABLE_HIDDEN_COLUMNS",
+#endif
+#ifdef SQLITE_ENABLE_ICU
+ "ENABLE_ICU",
+#endif
+#ifdef SQLITE_ENABLE_IOTRACE
+ "ENABLE_IOTRACE",
+#endif
+#ifdef SQLITE_ENABLE_LOAD_EXTENSION
+ "ENABLE_LOAD_EXTENSION",
+#endif
+#ifdef SQLITE_ENABLE_LOCKING_STYLE
+ "ENABLE_LOCKING_STYLE=" CTIMEOPT_VAL(SQLITE_ENABLE_LOCKING_STYLE),
+#endif
+#ifdef SQLITE_ENABLE_MATH_FUNCTIONS
+ "ENABLE_MATH_FUNCTIONS",
+#endif
+#ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
+ "ENABLE_MEMORY_MANAGEMENT",
+#endif
+#ifdef SQLITE_ENABLE_MEMSYS3
+ "ENABLE_MEMSYS3",
+#endif
+#ifdef SQLITE_ENABLE_MEMSYS5
+ "ENABLE_MEMSYS5",
+#endif
+#ifdef SQLITE_ENABLE_MULTIPLEX
+ "ENABLE_MULTIPLEX",
+#endif
+#ifdef SQLITE_ENABLE_NORMALIZE
+ "ENABLE_NORMALIZE",
+#endif
+#ifdef SQLITE_ENABLE_NULL_TRIM
+ "ENABLE_NULL_TRIM",
+#endif
+#ifdef SQLITE_ENABLE_OFFSET_SQL_FUNC
+ "ENABLE_OFFSET_SQL_FUNC",
+#endif
+#ifdef SQLITE_ENABLE_ORDERED_SET_AGGREGATES
+ "ENABLE_ORDERED_SET_AGGREGATES",
+#endif
+#ifdef SQLITE_ENABLE_OVERSIZE_CELL_CHECK
+ "ENABLE_OVERSIZE_CELL_CHECK",
+#endif
+#ifdef SQLITE_ENABLE_PREUPDATE_HOOK
+ "ENABLE_PREUPDATE_HOOK",
+#endif
+#ifdef SQLITE_ENABLE_QPSG
+ "ENABLE_QPSG",
+#endif
+#ifdef SQLITE_ENABLE_RBU
+ "ENABLE_RBU",
+#endif
+#ifdef SQLITE_ENABLE_RTREE
+ "ENABLE_RTREE",
+#endif
+#ifdef SQLITE_ENABLE_SESSION
+ "ENABLE_SESSION",
+#endif
+#ifdef SQLITE_ENABLE_SETLK_TIMEOUT
+ "ENABLE_SETLK_TIMEOUT",
+#endif
+#ifdef SQLITE_ENABLE_SNAPSHOT
+ "ENABLE_SNAPSHOT",
+#endif
+#ifdef SQLITE_ENABLE_SORTER_REFERENCES
+ "ENABLE_SORTER_REFERENCES",
+#endif
+#ifdef SQLITE_ENABLE_SQLLOG
+ "ENABLE_SQLLOG",
+#endif
+#ifdef SQLITE_ENABLE_STAT4
+ "ENABLE_STAT4",
+#endif
+#ifdef SQLITE_ENABLE_STMTVTAB
+ "ENABLE_STMTVTAB",
+#endif
+#ifdef SQLITE_ENABLE_STMT_SCANSTATUS
+ "ENABLE_STMT_SCANSTATUS",
+#endif
+#ifdef SQLITE_ENABLE_TREETRACE
+ "ENABLE_TREETRACE",
+#endif
+#ifdef SQLITE_ENABLE_UNKNOWN_SQL_FUNCTION
+ "ENABLE_UNKNOWN_SQL_FUNCTION",
+#endif
+#ifdef SQLITE_ENABLE_UNLOCK_NOTIFY
+ "ENABLE_UNLOCK_NOTIFY",
+#endif
+#ifdef SQLITE_ENABLE_UPDATE_DELETE_LIMIT
+ "ENABLE_UPDATE_DELETE_LIMIT",
+#endif
+#ifdef SQLITE_ENABLE_URI_00_ERROR
+ "ENABLE_URI_00_ERROR",
+#endif
+#ifdef SQLITE_ENABLE_VFSTRACE
+ "ENABLE_VFSTRACE",
+#endif
+#ifdef SQLITE_ENABLE_WHERETRACE
+ "ENABLE_WHERETRACE",
+#endif
+#ifdef SQLITE_ENABLE_ZIPVFS
+ "ENABLE_ZIPVFS",
+#endif
+#ifdef SQLITE_EXPLAIN_ESTIMATED_ROWS
+ "EXPLAIN_ESTIMATED_ROWS",
+#endif
+#ifdef SQLITE_EXTRA_AUTOEXT
+ "EXTRA_AUTOEXT=" CTIMEOPT_VAL(SQLITE_EXTRA_AUTOEXT),
+#endif
+#ifdef SQLITE_EXTRA_IFNULLROW
+ "EXTRA_IFNULLROW",
+#endif
+#ifdef SQLITE_EXTRA_INIT
+ "EXTRA_INIT=" CTIMEOPT_VAL(SQLITE_EXTRA_INIT),
+#endif
+#ifdef SQLITE_EXTRA_INIT_MUTEXED
+ "EXTRA_INIT_MUTEXED=" CTIMEOPT_VAL(SQLITE_EXTRA_INIT_MUTEXED),
+#endif
+#ifdef SQLITE_EXTRA_SHUTDOWN
+ "EXTRA_SHUTDOWN=" CTIMEOPT_VAL(SQLITE_EXTRA_SHUTDOWN),
+#endif
+#ifdef SQLITE_FTS3_MAX_EXPR_DEPTH
+ "FTS3_MAX_EXPR_DEPTH=" CTIMEOPT_VAL(SQLITE_FTS3_MAX_EXPR_DEPTH),
+#endif
+#ifdef SQLITE_FTS5_ENABLE_TEST_MI
+ "FTS5_ENABLE_TEST_MI",
+#endif
+#ifdef SQLITE_FTS5_NO_WITHOUT_ROWID
+ "FTS5_NO_WITHOUT_ROWID",
+#endif
+#if HAVE_ISNAN || SQLITE_HAVE_ISNAN
+ "HAVE_ISNAN",
+#endif
+#ifdef SQLITE_HOMEGROWN_RECURSIVE_MUTEX
+# if SQLITE_HOMEGROWN_RECURSIVE_MUTEX != 1
+ "HOMEGROWN_RECURSIVE_MUTEX=" CTIMEOPT_VAL(SQLITE_HOMEGROWN_RECURSIVE_MUTEX),
+# endif
+#endif
+#ifdef SQLITE_IGNORE_AFP_LOCK_ERRORS
+ "IGNORE_AFP_LOCK_ERRORS",
+#endif
+#ifdef SQLITE_IGNORE_FLOCK_LOCK_ERRORS
+ "IGNORE_FLOCK_LOCK_ERRORS",
+#endif
+#ifdef SQLITE_INLINE_MEMCPY
+ "INLINE_MEMCPY",
+#endif
+#ifdef SQLITE_INT64_TYPE
+ "INT64_TYPE",
+#endif
+#ifdef SQLITE_INTEGRITY_CHECK_ERROR_MAX
+ "INTEGRITY_CHECK_ERROR_MAX=" CTIMEOPT_VAL(SQLITE_INTEGRITY_CHECK_ERROR_MAX),
+#endif
+#ifdef SQLITE_LEGACY_JSON_VALID
+ "LEGACY_JSON_VALID",
+#endif
+#ifdef SQLITE_LIKE_DOESNT_MATCH_BLOBS
+ "LIKE_DOESNT_MATCH_BLOBS",
+#endif
+#ifdef SQLITE_LOCK_TRACE
+ "LOCK_TRACE",
+#endif
+#ifdef SQLITE_LOG_CACHE_SPILL
+ "LOG_CACHE_SPILL",
+#endif
+#ifdef SQLITE_MALLOC_SOFT_LIMIT
+ "MALLOC_SOFT_LIMIT=" CTIMEOPT_VAL(SQLITE_MALLOC_SOFT_LIMIT),
+#endif
+#ifdef SQLITE_MAX_ATTACHED
+ "MAX_ATTACHED=" CTIMEOPT_VAL(SQLITE_MAX_ATTACHED),
+#endif
+#ifdef SQLITE_MAX_COLUMN
+ "MAX_COLUMN=" CTIMEOPT_VAL(SQLITE_MAX_COLUMN),
+#endif
+#ifdef SQLITE_MAX_COMPOUND_SELECT
+ "MAX_COMPOUND_SELECT=" CTIMEOPT_VAL(SQLITE_MAX_COMPOUND_SELECT),
+#endif
+#ifdef SQLITE_MAX_DEFAULT_PAGE_SIZE
+ "MAX_DEFAULT_PAGE_SIZE=" CTIMEOPT_VAL(SQLITE_MAX_DEFAULT_PAGE_SIZE),
+#endif
+#ifdef SQLITE_MAX_EXPR_DEPTH
+ "MAX_EXPR_DEPTH=" CTIMEOPT_VAL(SQLITE_MAX_EXPR_DEPTH),
+#endif
+#ifdef SQLITE_MAX_FUNCTION_ARG
+ "MAX_FUNCTION_ARG=" CTIMEOPT_VAL(SQLITE_MAX_FUNCTION_ARG),
+#endif
+#ifdef SQLITE_MAX_LENGTH
+ "MAX_LENGTH=" CTIMEOPT_VAL(SQLITE_MAX_LENGTH),
+#endif
+#ifdef SQLITE_MAX_LIKE_PATTERN_LENGTH
+ "MAX_LIKE_PATTERN_LENGTH=" CTIMEOPT_VAL(SQLITE_MAX_LIKE_PATTERN_LENGTH),
+#endif
+#ifdef SQLITE_MAX_MEMORY
+ "MAX_MEMORY=" CTIMEOPT_VAL(SQLITE_MAX_MEMORY),
+#endif
+#ifdef SQLITE_MAX_MMAP_SIZE
+ "MAX_MMAP_SIZE=" CTIMEOPT_VAL(SQLITE_MAX_MMAP_SIZE),
+#endif
+#ifdef SQLITE_MAX_MMAP_SIZE_
+ "MAX_MMAP_SIZE_=" CTIMEOPT_VAL(SQLITE_MAX_MMAP_SIZE_),
+#endif
+#ifdef SQLITE_MAX_PAGE_COUNT
+ "MAX_PAGE_COUNT=" CTIMEOPT_VAL(SQLITE_MAX_PAGE_COUNT),
+#endif
+#ifdef SQLITE_MAX_PAGE_SIZE
+ "MAX_PAGE_SIZE=" CTIMEOPT_VAL(SQLITE_MAX_PAGE_SIZE),
+#endif
+#ifdef SQLITE_MAX_SCHEMA_RETRY
+ "MAX_SCHEMA_RETRY=" CTIMEOPT_VAL(SQLITE_MAX_SCHEMA_RETRY),
+#endif
+#ifdef SQLITE_MAX_SQL_LENGTH
+ "MAX_SQL_LENGTH=" CTIMEOPT_VAL(SQLITE_MAX_SQL_LENGTH),
+#endif
+#ifdef SQLITE_MAX_TRIGGER_DEPTH
+ "MAX_TRIGGER_DEPTH=" CTIMEOPT_VAL(SQLITE_MAX_TRIGGER_DEPTH),
+#endif
+#ifdef SQLITE_MAX_VARIABLE_NUMBER
+ "MAX_VARIABLE_NUMBER=" CTIMEOPT_VAL(SQLITE_MAX_VARIABLE_NUMBER),
+#endif
+#ifdef SQLITE_MAX_VDBE_OP
+ "MAX_VDBE_OP=" CTIMEOPT_VAL(SQLITE_MAX_VDBE_OP),
+#endif
+#ifdef SQLITE_MAX_WORKER_THREADS
+ "MAX_WORKER_THREADS=" CTIMEOPT_VAL(SQLITE_MAX_WORKER_THREADS),
+#endif
+#ifdef SQLITE_MEMDEBUG
+ "MEMDEBUG",
+#endif
+#ifdef SQLITE_MIXED_ENDIAN_64BIT_FLOAT
+ "MIXED_ENDIAN_64BIT_FLOAT",
+#endif
+#ifdef SQLITE_MMAP_READWRITE
+ "MMAP_READWRITE",
+#endif
+#ifdef SQLITE_MUTEX_NOOP
+ "MUTEX_NOOP",
+#endif
+#ifdef SQLITE_MUTEX_OMIT
+ "MUTEX_OMIT",
+#endif
+#ifdef SQLITE_MUTEX_PTHREADS
+ "MUTEX_PTHREADS",
+#endif
+#ifdef SQLITE_MUTEX_W32
+ "MUTEX_W32",
+#endif
+#ifdef SQLITE_NEED_ERR_NAME
+ "NEED_ERR_NAME",
+#endif
+#ifdef SQLITE_NO_SYNC
+ "NO_SYNC",
+#endif
+#ifdef SQLITE_OMIT_ALTERTABLE
+ "OMIT_ALTERTABLE",
+#endif
+#ifdef SQLITE_OMIT_ANALYZE
+ "OMIT_ANALYZE",
+#endif
+#ifdef SQLITE_OMIT_ATTACH
+ "OMIT_ATTACH",
+#endif
+#ifdef SQLITE_OMIT_AUTHORIZATION
+ "OMIT_AUTHORIZATION",
+#endif
+#ifdef SQLITE_OMIT_AUTOINCREMENT
+ "OMIT_AUTOINCREMENT",
+#endif
+#ifdef SQLITE_OMIT_AUTOINIT
+ "OMIT_AUTOINIT",
+#endif
+#ifdef SQLITE_OMIT_AUTOMATIC_INDEX
+ "OMIT_AUTOMATIC_INDEX",
+#endif
+#ifdef SQLITE_OMIT_AUTORESET
+ "OMIT_AUTORESET",
+#endif
+#ifdef SQLITE_OMIT_AUTOVACUUM
+ "OMIT_AUTOVACUUM",
+#endif
+#ifdef SQLITE_OMIT_BETWEEN_OPTIMIZATION
+ "OMIT_BETWEEN_OPTIMIZATION",
+#endif
+#ifdef SQLITE_OMIT_BLOB_LITERAL
+ "OMIT_BLOB_LITERAL",
+#endif
+#ifdef SQLITE_OMIT_CAST
+ "OMIT_CAST",
+#endif
+#ifdef SQLITE_OMIT_CHECK
+ "OMIT_CHECK",
+#endif
+#ifdef SQLITE_OMIT_COMPLETE
+ "OMIT_COMPLETE",
+#endif
+#ifdef SQLITE_OMIT_COMPOUND_SELECT
+ "OMIT_COMPOUND_SELECT",
+#endif
+#ifdef SQLITE_OMIT_CONFLICT_CLAUSE
+ "OMIT_CONFLICT_CLAUSE",
+#endif
+#ifdef SQLITE_OMIT_CTE
+ "OMIT_CTE",
+#endif
+#if defined(SQLITE_OMIT_DATETIME_FUNCS) || defined(SQLITE_OMIT_FLOATING_POINT)
+ "OMIT_DATETIME_FUNCS",
+#endif
+#ifdef SQLITE_OMIT_DECLTYPE
+ "OMIT_DECLTYPE",
+#endif
+#ifdef SQLITE_OMIT_DEPRECATED
+ "OMIT_DEPRECATED",
+#endif
+#ifdef SQLITE_OMIT_DESERIALIZE
+ "OMIT_DESERIALIZE",
+#endif
+#ifdef SQLITE_OMIT_DISKIO
+ "OMIT_DISKIO",
+#endif
+#ifdef SQLITE_OMIT_EXPLAIN
+ "OMIT_EXPLAIN",
+#endif
+#ifdef SQLITE_OMIT_FLAG_PRAGMAS
+ "OMIT_FLAG_PRAGMAS",
+#endif
+#ifdef SQLITE_OMIT_FLOATING_POINT
+ "OMIT_FLOATING_POINT",
+#endif
+#ifdef SQLITE_OMIT_FOREIGN_KEY
+ "OMIT_FOREIGN_KEY",
+#endif
+#ifdef SQLITE_OMIT_GET_TABLE
+ "OMIT_GET_TABLE",
+#endif
+#ifdef SQLITE_OMIT_HEX_INTEGER
+ "OMIT_HEX_INTEGER",
+#endif
+#ifdef SQLITE_OMIT_INCRBLOB
+ "OMIT_INCRBLOB",
+#endif
+#ifdef SQLITE_OMIT_INTEGRITY_CHECK
+ "OMIT_INTEGRITY_CHECK",
+#endif
+#ifdef SQLITE_OMIT_INTROSPECTION_PRAGMAS
+ "OMIT_INTROSPECTION_PRAGMAS",
+#endif
+#ifdef SQLITE_OMIT_JSON
+ "OMIT_JSON",
+#endif
+#ifdef SQLITE_OMIT_LIKE_OPTIMIZATION
+ "OMIT_LIKE_OPTIMIZATION",
+#endif
+#ifdef SQLITE_OMIT_LOAD_EXTENSION
+ "OMIT_LOAD_EXTENSION",
+#endif
+#ifdef SQLITE_OMIT_LOCALTIME
+ "OMIT_LOCALTIME",
+#endif
+#ifdef SQLITE_OMIT_LOOKASIDE
+ "OMIT_LOOKASIDE",
+#endif
+#ifdef SQLITE_OMIT_MEMORYDB
+ "OMIT_MEMORYDB",
+#endif
+#ifdef SQLITE_OMIT_OR_OPTIMIZATION
+ "OMIT_OR_OPTIMIZATION",
+#endif
+#ifdef SQLITE_OMIT_PAGER_PRAGMAS
+ "OMIT_PAGER_PRAGMAS",
+#endif
+#ifdef SQLITE_OMIT_PARSER_TRACE
+ "OMIT_PARSER_TRACE",
+#endif
+#ifdef SQLITE_OMIT_POPEN
+ "OMIT_POPEN",
+#endif
+#ifdef SQLITE_OMIT_PRAGMA
+ "OMIT_PRAGMA",
+#endif
+#ifdef SQLITE_OMIT_PROGRESS_CALLBACK
+ "OMIT_PROGRESS_CALLBACK",
+#endif
+#ifdef SQLITE_OMIT_QUICKBALANCE
+ "OMIT_QUICKBALANCE",
+#endif
+#ifdef SQLITE_OMIT_REINDEX
+ "OMIT_REINDEX",
+#endif
+#ifdef SQLITE_OMIT_SCHEMA_PRAGMAS
+ "OMIT_SCHEMA_PRAGMAS",
+#endif
+#ifdef SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS
+ "OMIT_SCHEMA_VERSION_PRAGMAS",
+#endif
+#ifdef SQLITE_OMIT_SEH
+ "OMIT_SEH",
+#endif
+#ifdef SQLITE_OMIT_SHARED_CACHE
+ "OMIT_SHARED_CACHE",
+#endif
+#ifdef SQLITE_OMIT_SHUTDOWN_DIRECTORIES
+ "OMIT_SHUTDOWN_DIRECTORIES",
+#endif
+#ifdef SQLITE_OMIT_SUBQUERY
+ "OMIT_SUBQUERY",
+#endif
+#ifdef SQLITE_OMIT_TCL_VARIABLE
+ "OMIT_TCL_VARIABLE",
+#endif
+#ifdef SQLITE_OMIT_TEMPDB
+ "OMIT_TEMPDB",
+#endif
+#ifdef SQLITE_OMIT_TEST_CONTROL
+ "OMIT_TEST_CONTROL",
+#endif
+#ifdef SQLITE_OMIT_TRACE
+# if SQLITE_OMIT_TRACE != 1
+ "OMIT_TRACE=" CTIMEOPT_VAL(SQLITE_OMIT_TRACE),
+# endif
+#endif
+#ifdef SQLITE_OMIT_TRIGGER
+ "OMIT_TRIGGER",
+#endif
+#ifdef SQLITE_OMIT_TRUNCATE_OPTIMIZATION
+ "OMIT_TRUNCATE_OPTIMIZATION",
+#endif
+#ifdef SQLITE_OMIT_UTF16
+ "OMIT_UTF16",
+#endif
+#ifdef SQLITE_OMIT_VACUUM
+ "OMIT_VACUUM",
+#endif
+#ifdef SQLITE_OMIT_VIEW
+ "OMIT_VIEW",
+#endif
+#ifdef SQLITE_OMIT_VIRTUALTABLE
+ "OMIT_VIRTUALTABLE",
+#endif
+#ifdef SQLITE_OMIT_WAL
+ "OMIT_WAL",
+#endif
+#ifdef SQLITE_OMIT_WSD
+ "OMIT_WSD",
+#endif
+#ifdef SQLITE_OMIT_XFER_OPT
+ "OMIT_XFER_OPT",
+#endif
+#ifdef SQLITE_PERFORMANCE_TRACE
+ "PERFORMANCE_TRACE",
+#endif
+#ifdef SQLITE_POWERSAFE_OVERWRITE
+# if SQLITE_POWERSAFE_OVERWRITE != 1
+ "POWERSAFE_OVERWRITE=" CTIMEOPT_VAL(SQLITE_POWERSAFE_OVERWRITE),
+# endif
+#endif
+#ifdef SQLITE_PREFER_PROXY_LOCKING
+ "PREFER_PROXY_LOCKING",
+#endif
+#ifdef SQLITE_PROXY_DEBUG
+ "PROXY_DEBUG",
+#endif
+#ifdef SQLITE_REVERSE_UNORDERED_SELECTS
+ "REVERSE_UNORDERED_SELECTS",
+#endif
+#ifdef SQLITE_RTREE_INT_ONLY
+ "RTREE_INT_ONLY",
+#endif
+#ifdef SQLITE_SECURE_DELETE
+ "SECURE_DELETE",
+#endif
+#ifdef SQLITE_SMALL_STACK
+ "SMALL_STACK",
+#endif
+#ifdef SQLITE_SORTER_PMASZ
+ "SORTER_PMASZ=" CTIMEOPT_VAL(SQLITE_SORTER_PMASZ),
+#endif
+#ifdef SQLITE_SOUNDEX
+ "SOUNDEX",
+#endif
+#ifdef SQLITE_STAT4_SAMPLES
+ "STAT4_SAMPLES=" CTIMEOPT_VAL(SQLITE_STAT4_SAMPLES),
+#endif
+#ifdef SQLITE_STMTJRNL_SPILL
+ "STMTJRNL_SPILL=" CTIMEOPT_VAL(SQLITE_STMTJRNL_SPILL),
+#endif
+#ifdef SQLITE_SUBSTR_COMPATIBILITY
+ "SUBSTR_COMPATIBILITY",
+#endif
+#if (!defined(SQLITE_WIN32_MALLOC) \
+ && !defined(SQLITE_ZERO_MALLOC) \
+ && !defined(SQLITE_MEMDEBUG) \
+ ) || defined(SQLITE_SYSTEM_MALLOC)
+ "SYSTEM_MALLOC",
+#endif
+#ifdef SQLITE_TCL
+ "TCL",
+#endif
+#ifdef SQLITE_TEMP_STORE
+ "TEMP_STORE=" CTIMEOPT_VAL(SQLITE_TEMP_STORE),
+#endif
+#ifdef SQLITE_TEST
+ "TEST",
+#endif
+#if defined(SQLITE_THREADSAFE)
+ "THREADSAFE=" CTIMEOPT_VAL(SQLITE_THREADSAFE),
+#elif defined(THREADSAFE)
+ "THREADSAFE=" CTIMEOPT_VAL(THREADSAFE),
+#else
+ "THREADSAFE=1",
+#endif
+#ifdef SQLITE_UNLINK_AFTER_CLOSE
+ "UNLINK_AFTER_CLOSE",
+#endif
+#ifdef SQLITE_UNTESTABLE
+ "UNTESTABLE",
+#endif
+#ifdef SQLITE_USE_ALLOCA
+ "USE_ALLOCA",
+#endif
+#ifdef SQLITE_USE_FCNTL_TRACE
+ "USE_FCNTL_TRACE",
+#endif
+#ifdef SQLITE_USE_URI
+ "USE_URI",
+#endif
+#ifdef SQLITE_VDBE_COVERAGE
+ "VDBE_COVERAGE",
+#endif
+#ifdef SQLITE_WIN32_MALLOC
+ "WIN32_MALLOC",
+#endif
+#ifdef SQLITE_ZERO_MALLOC
+ "ZERO_MALLOC",
+#endif
+
+} ;
+
+SQLITE_PRIVATE const char **sqlite3CompileOptions(int *pnOpt){
+ *pnOpt = sizeof(sqlite3azCompileOpt) / sizeof(sqlite3azCompileOpt[0]);
+ return (const char**)sqlite3azCompileOpt;
+}
+
+#endif /* SQLITE_OMIT_COMPILEOPTION_DIAGS */
+
+/************** End of ctime.c ***********************************************/
+/************** Begin file global.c ******************************************/
+/*
+** 2008 June 13
+**
+** The author disclaims copyright to this source code. In place of
+** a legal notice, here is a blessing:
+**
+** May you do good and not evil.
+** May you find forgiveness for yourself and forgive others.
+** May you share freely, never taking more than you give.
+**
+*************************************************************************
+**
+** This file contains definitions of global variables and constants.
+*/
+/* #include "sqliteInt.h" */
+
+/* An array to map all upper-case characters into their corresponding
+** lower-case character.
+**
+** SQLite only considers US-ASCII (or EBCDIC) characters. We do not
+** handle case conversions for the UTF character set since the tables
+** involved are nearly as big or bigger than SQLite itself.
+*/
+SQLITE_PRIVATE const unsigned char sqlite3UpperToLower[] = {
+#ifdef SQLITE_ASCII
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
+ 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
+ 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
+ 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 97, 98, 99,100,101,102,103,
+ 104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,
+ 122, 91, 92, 93, 94, 95, 96, 97, 98, 99,100,101,102,103,104,105,106,107,
+ 108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,
+ 126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,
+ 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,
+ 162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,
+ 180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,
+ 198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,
+ 216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,
+ 234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,
+ 252,253,254,255,
+#endif
+#ifdef SQLITE_EBCDIC
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, /* 0x */
+ 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, /* 1x */
+ 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, /* 2x */
+ 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, /* 3x */
+ 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, /* 4x */
+ 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, /* 5x */
+ 96, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111, /* 6x */
+ 112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127, /* 7x */
+ 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, /* 8x */
+ 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, /* 9x */
+ 160,161,162,163,164,165,166,167,168,169,170,171,140,141,142,175, /* Ax */
+ 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, /* Bx */
+ 192,129,130,131,132,133,134,135,136,137,202,203,204,205,206,207, /* Cx */
+ 208,145,146,147,148,149,150,151,152,153,218,219,220,221,222,223, /* Dx */
+ 224,225,162,163,164,165,166,167,168,169,234,235,236,237,238,239, /* Ex */
+ 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255, /* Fx */
+#endif
+/* All of the upper-to-lower conversion data is above. The following
+** 18 integers are completely unrelated. They are appended to the
+** sqlite3UpperToLower[] array to avoid UBSAN warnings. Here's what is
+** going on:
+**
+** The SQL comparison operators (<>, =, >, <=, <, and >=) are implemented
+** by invoking sqlite3MemCompare(A,B) which compares values A and B and
+** returns negative, zero, or positive if A is less then, equal to, or
+** greater than B, respectively. Then the true false results is found by
+** consulting sqlite3aLTb[opcode], sqlite3aEQb[opcode], or
+** sqlite3aGTb[opcode] depending on whether the result of compare(A,B)
+** is negative, zero, or positive, where opcode is the specific opcode.
+** The only works because the comparison opcodes are consecutive and in
+** this order: NE EQ GT LE LT GE. Various assert()s throughout the code
+** ensure that is the case.
+**
+** These elements must be appended to another array. Otherwise the
+** index (here shown as [256-OP_Ne]) would be out-of-bounds and thus
+** be undefined behavior. That's goofy, but the C-standards people thought
+** it was a good idea, so here we are.
+*/
+/* NE EQ GT LE LT GE */
+ 1, 0, 0, 1, 1, 0, /* aLTb[]: Use when compare(A,B) less than zero */
+ 0, 1, 0, 1, 0, 1, /* aEQb[]: Use when compare(A,B) equals zero */
+ 1, 0, 1, 0, 0, 1 /* aGTb[]: Use when compare(A,B) greater than zero*/
+};
+SQLITE_PRIVATE const unsigned char *sqlite3aLTb = &sqlite3UpperToLower[256-OP_Ne];
+SQLITE_PRIVATE const unsigned char *sqlite3aEQb = &sqlite3UpperToLower[256+6-OP_Ne];
+SQLITE_PRIVATE const unsigned char *sqlite3aGTb = &sqlite3UpperToLower[256+12-OP_Ne];
+
+/*
+** The following 256 byte lookup table is used to support SQLites built-in
+** equivalents to the following standard library functions:
+**
+** isspace() 0x01
+** isalpha() 0x02
+** isdigit() 0x04
+** isalnum() 0x06
+** isxdigit() 0x08
+** toupper() 0x20
+** SQLite identifier character 0x40 $, _, or non-ascii
+** Quote character 0x80
+**
+** Bit 0x20 is set if the mapped character requires translation to upper
+** case. i.e. if the character is a lower-case ASCII character.
+** If x is a lower-case ASCII character, then its upper-case equivalent
+** is (x - 0x20). Therefore toupper() can be implemented as:
+**
+** (x & ~(map[x]&0x20))
+**
+** The equivalent of tolower() is implemented using the sqlite3UpperToLower[]
+** array. tolower() is used more often than toupper() by SQLite.
+**
+** Bit 0x40 is set if the character is non-alphanumeric and can be used in an
+** SQLite identifier. Identifiers are alphanumerics, "_", "$", and any
+** non-ASCII UTF character. Hence the test for whether or not a character is
+** part of an identifier is 0x46.
+*/
+SQLITE_PRIVATE const unsigned char sqlite3CtypeMap[256] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 00..07 ........ */
+ 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, /* 08..0f ........ */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 10..17 ........ */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 18..1f ........ */
+ 0x01, 0x00, 0x80, 0x00, 0x40, 0x00, 0x00, 0x80, /* 20..27 !"#$%&' */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 28..2f ()*+,-./ */
+ 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, /* 30..37 01234567 */
+ 0x0c, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 38..3f 89:;<=>? */
+
+ 0x00, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x02, /* 40..47 @ABCDEFG */
+ 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* 48..4f HIJKLMNO */
+ 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* 50..57 PQRSTUVW */
+ 0x02, 0x02, 0x02, 0x80, 0x00, 0x00, 0x00, 0x40, /* 58..5f XYZ[\]^_ */
+ 0x80, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x22, /* 60..67 `abcdefg */
+ 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, /* 68..6f hijklmno */
+ 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, /* 70..77 pqrstuvw */
+ 0x22, 0x22, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, /* 78..7f xyz{|}~. */
+
+ 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, /* 80..87 ........ */
+ 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, /* 88..8f ........ */
+ 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, /* 90..97 ........ */
+ 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, /* 98..9f ........ */
+ 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, /* a0..a7 ........ */
+ 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, /* a8..af ........ */
+ 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, /* b0..b7 ........ */
+ 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, /* b8..bf ........ */
+
+ 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, /* c0..c7 ........ */
+ 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, /* c8..cf ........ */
+ 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, /* d0..d7 ........ */
+ 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, /* d8..df ........ */
+ 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, /* e0..e7 ........ */
+ 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, /* e8..ef ........ */
+ 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, /* f0..f7 ........ */
+ 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 /* f8..ff ........ */
+};
+
+/* EVIDENCE-OF: R-02982-34736 In order to maintain full backwards
+** compatibility for legacy applications, the URI filename capability is
+** disabled by default.
+**
+** EVIDENCE-OF: R-38799-08373 URI filenames can be enabled or disabled
+** using the SQLITE_USE_URI=1 or SQLITE_USE_URI=0 compile-time options.
+**
+** EVIDENCE-OF: R-43642-56306 By default, URI handling is globally
+** disabled. The default value may be changed by compiling with the
+** SQLITE_USE_URI symbol defined.
+*/
+#ifndef SQLITE_USE_URI
+# define SQLITE_USE_URI 0
+#endif
+
+/* EVIDENCE-OF: R-38720-18127 The default setting is determined by the
+** SQLITE_ALLOW_COVERING_INDEX_SCAN compile-time option, or is "on" if
+** that compile-time option is omitted.
+*/
+#if !defined(SQLITE_ALLOW_COVERING_INDEX_SCAN)
+# define SQLITE_ALLOW_COVERING_INDEX_SCAN 1
+#else
+# if !SQLITE_ALLOW_COVERING_INDEX_SCAN
+# error "Compile-time disabling of covering index scan using the\
+ -DSQLITE_ALLOW_COVERING_INDEX_SCAN=0 option is deprecated.\
+ Contact SQLite developers if this is a problem for you, and\
+ delete this #error macro to continue with your build."
+# endif
+#endif
+
+/* The minimum PMA size is set to this value multiplied by the database
+** page size in bytes.
+*/
+#ifndef SQLITE_SORTER_PMASZ
+# define SQLITE_SORTER_PMASZ 250
+#endif
+
+/* Statement journals spill to disk when their size exceeds the following
+** threshold (in bytes). 0 means that statement journals are created and
+** written to disk immediately (the default behavior for SQLite versions
+** before 3.12.0). -1 means always keep the entire statement journal in
+** memory. (The statement journal is also always held entirely in memory
+** if journal_mode=MEMORY or if temp_store=MEMORY, regardless of this
+** setting.)
+*/
+#ifndef SQLITE_STMTJRNL_SPILL
+# define SQLITE_STMTJRNL_SPILL (64*1024)
+#endif
+
+/*
+** The default lookaside-configuration, the format "SZ,N". SZ is the
+** number of bytes in each lookaside slot (should be a multiple of 8)
+** and N is the number of slots. The lookaside-configuration can be
+** changed as start-time using sqlite3_config(SQLITE_CONFIG_LOOKASIDE)
+** or at run-time for an individual database connection using
+** sqlite3_db_config(db, SQLITE_DBCONFIG_LOOKASIDE);
+**
+** With the two-size-lookaside enhancement, less lookaside is required.
+** The default configuration of 1200,40 actually provides 30 1200-byte slots
+** and 93 128-byte slots, which is more lookaside than is available
+** using the older 1200,100 configuration without two-size-lookaside.
+*/
+#ifndef SQLITE_DEFAULT_LOOKASIDE
+# ifdef SQLITE_OMIT_TWOSIZE_LOOKASIDE
+# define SQLITE_DEFAULT_LOOKASIDE 1200,100 /* 120KB of memory */
+# else
+# define SQLITE_DEFAULT_LOOKASIDE 1200,40 /* 48KB of memory */
+# endif
+#endif
+
+
+/* The default maximum size of an in-memory database created using
+** sqlite3_deserialize()
+*/
+#ifndef SQLITE_MEMDB_DEFAULT_MAXSIZE
+# define SQLITE_MEMDB_DEFAULT_MAXSIZE 1073741824
+#endif
+
+/*
+** The following singleton contains the global configuration for
+** the SQLite library.
+*/
+SQLITE_PRIVATE SQLITE_WSD struct Sqlite3Config sqlite3Config = {
+ SQLITE_DEFAULT_MEMSTATUS, /* bMemstat */
+ 1, /* bCoreMutex */
+ SQLITE_THREADSAFE==1, /* bFullMutex */
+ SQLITE_USE_URI, /* bOpenUri */
+ SQLITE_ALLOW_COVERING_INDEX_SCAN, /* bUseCis */
+ 0, /* bSmallMalloc */
+ 1, /* bExtraSchemaChecks */
+#ifdef SQLITE_DEBUG
+ 0, /* bJsonSelfcheck */
+#endif
+ 0x7ffffffe, /* mxStrlen */
+ 0, /* neverCorrupt */
+ SQLITE_DEFAULT_LOOKASIDE, /* szLookaside, nLookaside */
+ SQLITE_STMTJRNL_SPILL, /* nStmtSpill */
+ {0,0,0,0,0,0,0,0}, /* m */
+ {0,0,0,0,0,0,0,0,0}, /* mutex */
+ {0,0,0,0,0,0,0,0,0,0,0,0,0},/* pcache2 */
+ (void*)0, /* pHeap */
+ 0, /* nHeap */
+ 0, 0, /* mnHeap, mxHeap */
+ SQLITE_DEFAULT_MMAP_SIZE, /* szMmap */
+ SQLITE_MAX_MMAP_SIZE, /* mxMmap */
+ (void*)0, /* pPage */
+ 0, /* szPage */
+ SQLITE_DEFAULT_PCACHE_INITSZ, /* nPage */
+ 0, /* mxParserStack */
+ 0, /* sharedCacheEnabled */
+ SQLITE_SORTER_PMASZ, /* szPma */
+ /* All the rest should always be initialized to zero */
+ 0, /* isInit */
+ 0, /* inProgress */
+ 0, /* isMutexInit */
+ 0, /* isMallocInit */
+ 0, /* isPCacheInit */
+ 0, /* nRefInitMutex */
+ 0, /* pInitMutex */
+ 0, /* xLog */
+ 0, /* pLogArg */
+#ifdef SQLITE_ENABLE_SQLLOG
+ 0, /* xSqllog */
+ 0, /* pSqllogArg */
+#endif
+#ifdef SQLITE_VDBE_COVERAGE
+ 0, /* xVdbeBranch */
+ 0, /* pVbeBranchArg */
+#endif
+#ifndef SQLITE_OMIT_DESERIALIZE
+ SQLITE_MEMDB_DEFAULT_MAXSIZE, /* mxMemdbSize */
+#endif
+#ifndef SQLITE_UNTESTABLE
+ 0, /* xTestCallback */
+#endif
+#ifdef SQLITE_ALLOW_ROWID_IN_VIEW
+ 0, /* mNoVisibleRowid. 0 == allow rowid-in-view */
+#endif
+ 0, /* bLocaltimeFault */
+ 0, /* xAltLocaltime */
+ 0x7ffffffe, /* iOnceResetThreshold */
+ SQLITE_DEFAULT_SORTERREF_SIZE, /* szSorterRef */
+ 0, /* iPrngSeed */
+#ifdef SQLITE_DEBUG
+ {0,0,0,0,0,0}, /* aTune */
+#endif
+};
+
+/*
+** Hash table for global functions - functions common to all
+** database connections. After initialization, this table is
+** read-only.
+*/
+SQLITE_PRIVATE FuncDefHash sqlite3BuiltinFunctions;
+
+#if defined(SQLITE_COVERAGE_TEST) || defined(SQLITE_DEBUG)
+/*
+** Counter used for coverage testing. Does not come into play for
+** release builds.
+**
+** Access to this global variable is not mutex protected. This might
+** result in TSAN warnings. But as the variable does not exist in
+** release builds, that should not be a concern.
+*/
+SQLITE_PRIVATE unsigned int sqlite3CoverageCounter;
+#endif /* SQLITE_COVERAGE_TEST || SQLITE_DEBUG */
+
+#ifdef VDBE_PROFILE
+/*
+** The following performance counter can be used in place of
+** sqlite3Hwtime() for profiling. This is a no-op on standard builds.
+*/
+SQLITE_PRIVATE sqlite3_uint64 sqlite3NProfileCnt = 0;
+#endif
+
+/*
+** The value of the "pending" byte must be 0x40000000 (1 byte past the
+** 1-gibabyte boundary) in a compatible database. SQLite never uses
+** the database page that contains the pending byte. It never attempts
+** to read or write that page. The pending byte page is set aside
+** for use by the VFS layers as space for managing file locks.
+**
+** During testing, it is often desirable to move the pending byte to
+** a different position in the file. This allows code that has to
+** deal with the pending byte to run on files that are much smaller
+** than 1 GiB. The sqlite3_test_control() interface can be used to
+** move the pending byte.
+**
+** IMPORTANT: Changing the pending byte to any value other than
+** 0x40000000 results in an incompatible database file format!
+** Changing the pending byte during operation will result in undefined
+** and incorrect behavior.
+*/
+#ifndef SQLITE_OMIT_WSD
+SQLITE_PRIVATE int sqlite3PendingByte = 0x40000000;
+#endif
+
+/*
+** Tracing flags set by SQLITE_TESTCTRL_TRACEFLAGS.
+*/
+SQLITE_PRIVATE u32 sqlite3TreeTrace = 0;
+SQLITE_PRIVATE u32 sqlite3WhereTrace = 0;
+
+/* #include "opcodes.h" */
+/*
+** Properties of opcodes. The OPFLG_INITIALIZER macro is
+** created by mkopcodeh.awk during compilation. Data is obtained
+** from the comments following the "case OP_xxxx:" statements in
+** the vdbe.c file.
+*/
+SQLITE_PRIVATE const unsigned char sqlite3OpcodeProperty[] = OPFLG_INITIALIZER;
+
+/*
+** Name of the default collating sequence
+*/
+SQLITE_PRIVATE const char sqlite3StrBINARY[] = "BINARY";
+
+/*
+** Standard typenames. These names must match the COLTYPE_* definitions.
+** Adjust the SQLITE_N_STDTYPE value if adding or removing entries.
+**
+** sqlite3StdType[] The actual names of the datatypes.
+**
+** sqlite3StdTypeLen[] The length (in bytes) of each entry
+** in sqlite3StdType[].
+**
+** sqlite3StdTypeAffinity[] The affinity associated with each entry
+** in sqlite3StdType[].
+*/
+SQLITE_PRIVATE const unsigned char sqlite3StdTypeLen[] = { 3, 4, 3, 7, 4, 4 };
+SQLITE_PRIVATE const char sqlite3StdTypeAffinity[] = {
+ SQLITE_AFF_NUMERIC,
+ SQLITE_AFF_BLOB,
+ SQLITE_AFF_INTEGER,
+ SQLITE_AFF_INTEGER,
+ SQLITE_AFF_REAL,
+ SQLITE_AFF_TEXT
+};
+SQLITE_PRIVATE const char *sqlite3StdType[] = {
+ "ANY",
+ "BLOB",
+ "INT",
+ "INTEGER",
+ "REAL",
+ "TEXT"
+};
+
+/************** End of global.c **********************************************/
+/************** Begin file status.c ******************************************/
+/*
+** 2008 June 18
+**
+** The author disclaims copyright to this source code. In place of
+** a legal notice, here is a blessing:
+**
+** May you do good and not evil.
+** May you find forgiveness for yourself and forgive others.
+** May you share freely, never taking more than you give.
+**
+*************************************************************************
+**
+** This module implements the sqlite3_status() interface and related
+** functionality.
+*/
+/* #include "sqliteInt.h" */
+/************** Include vdbeInt.h in the middle of status.c ******************/
+/************** Begin file vdbeInt.h *****************************************/
+/*
+** 2003 September 6
+**
+** The author disclaims copyright to this source code. In place of
+** a legal notice, here is a blessing:
+**
+** May you do good and not evil.
+** May you find forgiveness for yourself and forgive others.
+** May you share freely, never taking more than you give.
+**
+*************************************************************************
+** This is the header file for information that is private to the
+** VDBE. This information used to all be at the top of the single
+** source code file "vdbe.c". When that file became too big (over
+** 6000 lines long) it was split up into several smaller files and
+** this header information was factored out.
+*/
+#ifndef SQLITE_VDBEINT_H
+#define SQLITE_VDBEINT_H
+
+/*
+** The maximum number of times that a statement will try to reparse
+** itself before giving up and returning SQLITE_SCHEMA.
+*/
+#ifndef SQLITE_MAX_SCHEMA_RETRY
+# define SQLITE_MAX_SCHEMA_RETRY 50
+#endif
+
+/*
+** VDBE_DISPLAY_P4 is true or false depending on whether or not the
+** "explain" P4 display logic is enabled.
+*/
+#if !defined(SQLITE_OMIT_EXPLAIN) || !defined(NDEBUG) \
+ || defined(VDBE_PROFILE) || defined(SQLITE_DEBUG) \
+ || defined(SQLITE_ENABLE_BYTECODE_VTAB)
+# define VDBE_DISPLAY_P4 1
+#else
+# define VDBE_DISPLAY_P4 0
+#endif
+
+/*
+** SQL is translated into a sequence of instructions to be
+** executed by a virtual machine. Each instruction is an instance
+** of the following structure.
+*/
+typedef struct VdbeOp Op;
+
+/*
+** Boolean values
+*/
+typedef unsigned Bool;
+
+/* Opaque type used by code in vdbesort.c */
+typedef struct VdbeSorter VdbeSorter;
+
+/* Elements of the linked list at Vdbe.pAuxData */
+typedef struct AuxData AuxData;
+
+/* A cache of large TEXT or BLOB values in a VdbeCursor */
+typedef struct VdbeTxtBlbCache VdbeTxtBlbCache;
+
+/* Types of VDBE cursors */
+#define CURTYPE_BTREE 0
+#define CURTYPE_SORTER 1
+#define CURTYPE_VTAB 2
+#define CURTYPE_PSEUDO 3
+
+/*
+** A VdbeCursor is an superclass (a wrapper) for various cursor objects:
+**
+** * A b-tree cursor
+** - In the main database or in an ephemeral database
+** - On either an index or a table
+** * A sorter
+** * A virtual table
+** * A one-row "pseudotable" stored in a single register
+*/
+typedef struct VdbeCursor VdbeCursor;
+struct VdbeCursor {
+ u8 eCurType; /* One of the CURTYPE_* values above */
+ i8 iDb; /* Index of cursor database in db->aDb[] */
+ u8 nullRow; /* True if pointing to a row with no data */
+ u8 deferredMoveto; /* A call to sqlite3BtreeMoveto() is needed */
+ u8 isTable; /* True for rowid tables. False for indexes */
+#ifdef SQLITE_DEBUG
+ u8 seekOp; /* Most recent seek operation on this cursor */
+ u8 wrFlag; /* The wrFlag argument to sqlite3BtreeCursor() */
+#endif
+ Bool isEphemeral:1; /* True for an ephemeral table */
+ Bool useRandomRowid:1; /* Generate new record numbers semi-randomly */
+ Bool isOrdered:1; /* True if the table is not BTREE_UNORDERED */
+ Bool noReuse:1; /* OpenEphemeral may not reuse this cursor */
+ Bool colCache:1; /* pCache pointer is initialized and non-NULL */
+ u16 seekHit; /* See the OP_SeekHit and OP_IfNoHope opcodes */
+ union { /* pBtx for isEphermeral. pAltMap otherwise */
+ Btree *pBtx; /* Separate file holding temporary table */
+ u32 *aAltMap; /* Mapping from table to index column numbers */
+ } ub;
+ i64 seqCount; /* Sequence counter */
+
+ /* Cached OP_Column parse information is only valid if cacheStatus matches
+ ** Vdbe.cacheCtr. Vdbe.cacheCtr will never take on the value of
+ ** CACHE_STALE (0) and so setting cacheStatus=CACHE_STALE guarantees that
+ ** the cache is out of date. */
+ u32 cacheStatus; /* Cache is valid if this matches Vdbe.cacheCtr */
+ int seekResult; /* Result of previous sqlite3BtreeMoveto() or 0
+ ** if there have been no prior seeks on the cursor. */
+ /* seekResult does not distinguish between "no seeks have ever occurred
+ ** on this cursor" and "the most recent seek was an exact match".
+ ** For CURTYPE_PSEUDO, seekResult is the register holding the record */
+
+ /* When a new VdbeCursor is allocated, only the fields above are zeroed.
+ ** The fields that follow are uninitialized, and must be individually
+ ** initialized prior to first use. */
+ VdbeCursor *pAltCursor; /* Associated index cursor from which to read */
+ union {
+ BtCursor *pCursor; /* CURTYPE_BTREE or _PSEUDO. Btree cursor */
+ sqlite3_vtab_cursor *pVCur; /* CURTYPE_VTAB. Vtab cursor */
+ VdbeSorter *pSorter; /* CURTYPE_SORTER. Sorter object */
+ } uc;
+ KeyInfo *pKeyInfo; /* Info about index keys needed by index cursors */
+ u32 iHdrOffset; /* Offset to next unparsed byte of the header */
+ Pgno pgnoRoot; /* Root page of the open btree cursor */
+ i16 nField; /* Number of fields in the header */
+ u16 nHdrParsed; /* Number of header fields parsed so far */
+ i64 movetoTarget; /* Argument to the deferred sqlite3BtreeMoveto() */
+ u32 *aOffset; /* Pointer to aType[nField] */
+ const u8 *aRow; /* Data for the current row, if all on one page */
+ u32 payloadSize; /* Total number of bytes in the record */
+ u32 szRow; /* Byte available in aRow */
+#ifdef SQLITE_ENABLE_COLUMN_USED_MASK
+ u64 maskUsed; /* Mask of columns used by this cursor */
+#endif
+ VdbeTxtBlbCache *pCache; /* Cache of large TEXT or BLOB values */
+
+ /* Space is allocated for aType to hold at least 2*nField+1 entries:
+ ** nField slots for aType[] and nField+1 array slots for aOffset[] */
+ u32 aType[FLEXARRAY]; /* Type values record decode. MUST BE LAST */
+};
+
+/*
+** The size (in bytes) of a VdbeCursor object that has an nField value of N
+** or less. The value of SZ_VDBECURSOR(n) is guaranteed to be a multiple
+** of 8.
+*/
+#define SZ_VDBECURSOR(N) \
+ (ROUND8(offsetof(VdbeCursor,aType)) + ((N)+1)*sizeof(u64))
+
+/* Return true if P is a null-only cursor
+*/
+#define IsNullCursor(P) \
+ ((P)->eCurType==CURTYPE_PSEUDO && (P)->nullRow && (P)->seekResult==0)
+
+/*
+** A value for VdbeCursor.cacheStatus that means the cache is always invalid.
+*/
+#define CACHE_STALE 0
+
+/*
+** Large TEXT or BLOB values can be slow to load, so we want to avoid
+** loading them more than once. For that reason, large TEXT and BLOB values
+** can be stored in a cache defined by this object, and attached to the
+** VdbeCursor using the pCache field.
+*/
+struct VdbeTxtBlbCache {
+ char *pCValue; /* A RCStr buffer to hold the value */
+ i64 iOffset; /* File offset of the row being cached */
+ int iCol; /* Column for which the cache is valid */
+ u32 cacheStatus; /* Vdbe.cacheCtr value */
+ u32 colCacheCtr; /* Column cache counter */
+};
+
+/*
+** When a sub-program is executed (OP_Program), a structure of this type
+** is allocated to store the current value of the program counter, as
+** well as the current memory cell array and various other frame specific
+** values stored in the Vdbe struct. When the sub-program is finished,
+** these values are copied back to the Vdbe from the VdbeFrame structure,
+** restoring the state of the VM to as it was before the sub-program
+** began executing.
+**
+** The memory for a VdbeFrame object is allocated and managed by a memory
+** cell in the parent (calling) frame. When the memory cell is deleted or
+** overwritten, the VdbeFrame object is not freed immediately. Instead, it
+** is linked into the Vdbe.pDelFrame list. The contents of the Vdbe.pDelFrame
+** list is deleted when the VM is reset in VdbeHalt(). The reason for doing
+** this instead of deleting the VdbeFrame immediately is to avoid recursive
+** calls to sqlite3VdbeMemRelease() when the memory cells belonging to the
+** child frame are released.
+**
+** The currently executing frame is stored in Vdbe.pFrame. Vdbe.pFrame is
+** set to NULL if the currently executing frame is the main program.
+*/
+typedef struct VdbeFrame VdbeFrame;
+struct VdbeFrame {
+ Vdbe *v; /* VM this frame belongs to */
+ VdbeFrame *pParent; /* Parent of this frame, or NULL if parent is main */
+ Op *aOp; /* Program instructions for parent frame */
+ Mem *aMem; /* Array of memory cells for parent frame */
+ VdbeCursor **apCsr; /* Array of Vdbe cursors for parent frame */
+ u8 *aOnce; /* Bitmask used by OP_Once */
+ void *token; /* Copy of SubProgram.token */
+ i64 lastRowid; /* Last insert rowid (sqlite3.lastRowid) */
+ AuxData *pAuxData; /* Linked list of auxdata allocations */
+#if SQLITE_DEBUG
+ u32 iFrameMagic; /* magic number for sanity checking */
+#endif
+ int nCursor; /* Number of entries in apCsr */
+ int pc; /* Program Counter in parent (calling) frame */
+ int nOp; /* Size of aOp array */
+ int nMem; /* Number of entries in aMem */
+ int nChildMem; /* Number of memory cells for child frame */
+ int nChildCsr; /* Number of cursors for child frame */
+ i64 nChange; /* Statement changes (Vdbe.nChange) */
+ i64 nDbChange; /* Value of db->nChange */
+};
+
+/* Magic number for sanity checking on VdbeFrame objects */
+#define SQLITE_FRAME_MAGIC 0x879fb71e
+
+/*
+** Return a pointer to the array of registers allocated for use
+** by a VdbeFrame.
+*/
+#define VdbeFrameMem(p) ((Mem *)&((u8 *)p)[ROUND8(sizeof(VdbeFrame))])
+
+/*
+** Internally, the vdbe manipulates nearly all SQL values as Mem
+** structures. Each Mem struct may cache multiple representations (string,
+** integer etc.) of the same value.
+*/
+struct sqlite3_value {
+ union MemValue {
+ double r; /* Real value used when MEM_Real is set in flags */
+ i64 i; /* Integer value used when MEM_Int is set in flags */
+ int nZero; /* Extra zero bytes when MEM_Zero and MEM_Blob set */
+ const char *zPType; /* Pointer type when MEM_Term|MEM_Subtype|MEM_Null */
+ FuncDef *pDef; /* Used only when flags==MEM_Agg */
+ } u;
+ char *z; /* String or BLOB value */
+ int n; /* Number of characters in string value, excluding '\0' */
+ u16 flags; /* Some combination of MEM_Null, MEM_Str, MEM_Dyn, etc. */
+ u8 enc; /* SQLITE_UTF8, SQLITE_UTF16BE, SQLITE_UTF16LE */
+ u8 eSubtype; /* Subtype for this value */
+ /* ShallowCopy only needs to copy the information above */
+ sqlite3 *db; /* The associated database connection */
+ int szMalloc; /* Size of the zMalloc allocation */
+ u32 uTemp; /* Transient storage for serial_type in OP_MakeRecord */
+ char *zMalloc; /* Space to hold MEM_Str or MEM_Blob if szMalloc>0 */
+ void (*xDel)(void*);/* Destructor for Mem.z - only valid if MEM_Dyn */
+#ifdef SQLITE_DEBUG
+ Mem *pScopyFrom; /* This Mem is a shallow copy of pScopyFrom */
+ u16 mScopyFlags; /* flags value immediately after the shallow copy */
+ u8 bScopy; /* The pScopyFrom of some other Mem *might* point here */
+#endif
+};
+
+/*
+** Size of struct Mem not including the Mem.zMalloc member or anything that
+** follows.
+*/
+#define MEMCELLSIZE offsetof(Mem,db)
+
+/* One or more of the following flags are set to indicate the
+** representations of the value stored in the Mem struct.
+**
+** * MEM_Null An SQL NULL value
+**
+** * MEM_Null|MEM_Zero An SQL NULL with the virtual table
+** UPDATE no-change flag set
+**
+** * MEM_Null|MEM_Term| An SQL NULL, but also contains a
+** MEM_Subtype pointer accessible using
+** sqlite3_value_pointer().
+**
+** * MEM_Null|MEM_Cleared Special SQL NULL that compares non-equal
+** to other NULLs even using the IS operator.
+**
+** * MEM_Str A string, stored in Mem.z with
+** length Mem.n. Zero-terminated if
+** MEM_Term is set. This flag is
+** incompatible with MEM_Blob and
+** MEM_Null, but can appear with MEM_Int,
+** MEM_Real, and MEM_IntReal.
+**
+** * MEM_Blob A blob, stored in Mem.z length Mem.n.
+** Incompatible with MEM_Str, MEM_Null,
+** MEM_Int, MEM_Real, and MEM_IntReal.
+**
+** * MEM_Blob|MEM_Zero A blob in Mem.z of length Mem.n plus
+** MEM.u.i extra 0x00 bytes at the end.
+**
+** * MEM_Int Integer stored in Mem.u.i.
+**
+** * MEM_Real Real stored in Mem.u.r.
+**
+** * MEM_IntReal Real stored as an integer in Mem.u.i.
+**
+** If the MEM_Null flag is set, then the value is an SQL NULL value.
+** For a pointer type created using sqlite3_bind_pointer() or
+** sqlite3_result_pointer() the MEM_Term and MEM_Subtype flags are also set.
+**
+** If the MEM_Str flag is set then Mem.z points at a string representation.
+** Usually this is encoded in the same unicode encoding as the main
+** database (see below for exceptions). If the MEM_Term flag is also
+** set, then the string is nul terminated. The MEM_Int and MEM_Real
+** flags may coexist with the MEM_Str flag.
+*/
+#define MEM_Undefined 0x0000 /* Value is undefined */
+#define MEM_Null 0x0001 /* Value is NULL (or a pointer) */
+#define MEM_Str 0x0002 /* Value is a string */
+#define MEM_Int 0x0004 /* Value is an integer */
+#define MEM_Real 0x0008 /* Value is a real number */
+#define MEM_Blob 0x0010 /* Value is a BLOB */
+#define MEM_IntReal 0x0020 /* MEM_Int that stringifies like MEM_Real */
+#define MEM_AffMask 0x003f /* Mask of affinity bits */
+
+/* Extra bits that modify the meanings of the core datatypes above
+*/
+#define MEM_FromBind 0x0040 /* Value originates from sqlite3_bind() */
+ /* 0x0080 // Available */
+#define MEM_Cleared 0x0100 /* NULL set by OP_Null, not from data */
+#define MEM_Term 0x0200 /* String in Mem.z is zero terminated */
+#define MEM_Zero 0x0400 /* Mem.i contains count of 0s appended to blob */
+#define MEM_Subtype 0x0800 /* Mem.eSubtype is valid */
+#define MEM_TypeMask 0x0dbf /* Mask of type bits */
+
+/* Bits that determine the storage for Mem.z for a string or blob or
+** aggregate accumulator.
+*/
+#define MEM_Dyn 0x1000 /* Need to call Mem.xDel() on Mem.z */
+#define MEM_Static 0x2000 /* Mem.z points to a static string */
+#define MEM_Ephem 0x4000 /* Mem.z points to an ephemeral string */
+#define MEM_Agg 0x8000 /* Mem.z points to an agg function context */
+
+/* Return TRUE if Mem X contains dynamically allocated content - anything
+** that needs to be deallocated to avoid a leak.
+*/
+#define VdbeMemDynamic(X) \
+ (((X)->flags&(MEM_Agg|MEM_Dyn))!=0)
+
+/*
+** Clear any existing type flags from a Mem and replace them with f
+*/
+#define MemSetTypeFlag(p, f) \
+ ((p)->flags = ((p)->flags&~(MEM_TypeMask|MEM_Zero))|f)
+
+/*
+** True if Mem X is a NULL-nochng type.
+*/
+#define MemNullNochng(X) \
+ (((X)->flags&MEM_TypeMask)==(MEM_Null|MEM_Zero) \
+ && (X)->n==0 && (X)->u.nZero==0)
+
+/*
+** Return true if a memory cell has been initialized and is valid.
+** is for use inside assert() statements only.
+**
+** A Memory cell is initialized if at least one of the
+** MEM_Null, MEM_Str, MEM_Int, MEM_Real, MEM_Blob, or MEM_IntReal bits
+** is set. It is "undefined" if all those bits are zero.
+*/
+#ifdef SQLITE_DEBUG
+#define memIsValid(M) ((M)->flags & MEM_AffMask)!=0
+#endif
+
+/*
+** Each auxiliary data pointer stored by a user defined function
+** implementation calling sqlite3_set_auxdata() is stored in an instance
+** of this structure. All such structures associated with a single VM
+** are stored in a linked list headed at Vdbe.pAuxData. All are destroyed
+** when the VM is halted (if not before).
+*/
+struct AuxData {
+ int iAuxOp; /* Instruction number of OP_Function opcode */
+ int iAuxArg; /* Index of function argument. */
+ void *pAux; /* Aux data pointer */
+ void (*xDeleteAux)(void*); /* Destructor for the aux data */
+ AuxData *pNextAux; /* Next element in list */
+};
+
+/*
+** The "context" argument for an installable function. A pointer to an
+** instance of this structure is the first argument to the routines used
+** implement the SQL functions.
+**
+** There is a typedef for this structure in sqlite.h. So all routines,
+** even the public interface to SQLite, can use a pointer to this structure.
+** But this file is the only place where the internal details of this
+** structure are known.
+**
+** This structure is defined inside of vdbeInt.h because it uses substructures
+** (Mem) which are only defined there.
+*/
+struct sqlite3_context {
+ Mem *pOut; /* The return value is stored here */
+ FuncDef *pFunc; /* Pointer to function information */
+ Mem *pMem; /* Memory cell used to store aggregate context */
+ Vdbe *pVdbe; /* The VM that owns this context */
+ int iOp; /* Instruction number of OP_Function */
+ int isError; /* Error code returned by the function. */
+ u8 enc; /* Encoding to use for results */
+ u8 skipFlag; /* Skip accumulator loading if true */
+ u16 argc; /* Number of arguments */
+ sqlite3_value *argv[FLEXARRAY]; /* Argument set */
+};
+
+/*
+** The size (in bytes) of an sqlite3_context object that holds N
+** argv[] arguments.
+*/
+#define SZ_CONTEXT(N) \
+ (offsetof(sqlite3_context,argv)+(N)*sizeof(sqlite3_value*))
+
+
+/* The ScanStatus object holds a single value for the
+** sqlite3_stmt_scanstatus() interface.
+**
+** aAddrRange[]:
+** This array is used by ScanStatus elements associated with EQP
+** notes that make an SQLITE_SCANSTAT_NCYCLE value available. It is
+** an array of up to 3 ranges of VM addresses for which the Vdbe.anCycle[]
+** values should be summed to calculate the NCYCLE value. Each pair of
+** integer addresses is a start and end address (both inclusive) for a range
+** instructions. A start value of 0 indicates an empty range.
+*/
+typedef struct ScanStatus ScanStatus;
+struct ScanStatus {
+ int addrExplain; /* OP_Explain for loop */
+ int aAddrRange[6];
+ int addrLoop; /* Address of "loops" counter */
+ int addrVisit; /* Address of "rows visited" counter */
+ int iSelectID; /* The "Select-ID" for this loop */
+ LogEst nEst; /* Estimated output rows per loop */
+ char *zName; /* Name of table or index */
+};
+
+/* The DblquoteStr object holds the text of a double-quoted
+** string for a prepared statement. A linked list of these objects
+** is constructed during statement parsing and is held on Vdbe.pDblStr.
+** When computing a normalized SQL statement for an SQL statement, that
+** list is consulted for each double-quoted identifier to see if the
+** identifier should really be a string literal.
+*/
+typedef struct DblquoteStr DblquoteStr;
+struct DblquoteStr {
+ DblquoteStr *pNextStr; /* Next string literal in the list */
+ char z[8]; /* Dequoted value for the string */
+};
+
+/*
+** An instance of the virtual machine. This structure contains the complete
+** state of the virtual machine.
+**
+** The "sqlite3_stmt" structure pointer that is returned by sqlite3_prepare()
+** is really a pointer to an instance of this structure.
+*/
+struct Vdbe {
+ sqlite3 *db; /* The database connection that owns this statement */
+ Vdbe **ppVPrev,*pVNext; /* Linked list of VDBEs with the same Vdbe.db */
+ Parse *pParse; /* Parsing context used to create this Vdbe */
+ ynVar nVar; /* Number of entries in aVar[] */
+ int nMem; /* Number of memory locations currently allocated */
+ int nCursor; /* Number of slots in apCsr[] */
+ u32 cacheCtr; /* VdbeCursor row cache generation counter */
+ int pc; /* The program counter */
+ int rc; /* Value to return */
+ i64 nChange; /* Number of db changes made since last reset */
+ int iStatement; /* Statement number (or 0 if has no opened stmt) */
+ i64 iCurrentTime; /* Value of julianday('now') for this statement */
+ i64 nFkConstraint; /* Number of imm. FK constraints this VM */
+ i64 nStmtDefCons; /* Number of def. constraints when stmt started */
+ i64 nStmtDefImmCons; /* Number of def. imm constraints when stmt started */
+ Mem *aMem; /* The memory locations */
+ Mem **apArg; /* Arguments xUpdate and xFilter vtab methods */
+ VdbeCursor **apCsr; /* One element of this array for each open cursor */
+ Mem *aVar; /* Values for the OP_Variable opcode. */
+
+ /* When allocating a new Vdbe object, all of the fields below should be
+ ** initialized to zero or NULL */
+
+ Op *aOp; /* Space to hold the virtual machine's program */
+ int nOp; /* Number of instructions in the program */
+ int nOpAlloc; /* Slots allocated for aOp[] */
+ Mem *aColName; /* Column names to return */
+ Mem *pResultRow; /* Current output row */
+ char *zErrMsg; /* Error message written here */
+ VList *pVList; /* Name of variables */
+#ifndef SQLITE_OMIT_TRACE
+ i64 startTime; /* Time when query started - used for profiling */
+#endif
+#ifdef SQLITE_DEBUG
+ int rcApp; /* errcode set by sqlite3_result_error_code() */
+ u32 nWrite; /* Number of write operations that have occurred */
+ int napArg; /* Size of the apArg[] array */
+#endif
+ u16 nResColumn; /* Number of columns in one row of the result set */
+ u16 nResAlloc; /* Column slots allocated to aColName[] */
+ u8 errorAction; /* Recovery action to do in case of an error */
+ u8 minWriteFileFormat; /* Minimum file format for writable database files */
+ u8 prepFlags; /* SQLITE_PREPARE_* flags */
+ u8 eVdbeState; /* On of the VDBE_*_STATE values */
+ bft expired:2; /* 1: recompile VM immediately 2: when convenient */
+ bft explain:2; /* 0: normal, 1: EXPLAIN, 2: EXPLAIN QUERY PLAN */
+ bft changeCntOn:1; /* True to update the change-counter */
+ bft usesStmtJournal:1; /* True if uses a statement journal */
+ bft readOnly:1; /* True for statements that do not write */
+ bft bIsReader:1; /* True for statements that read */
+ bft haveEqpOps:1; /* Bytecode supports EXPLAIN QUERY PLAN */
+ yDbMask btreeMask; /* Bitmask of db->aDb[] entries referenced */
+ yDbMask lockMask; /* Subset of btreeMask that requires a lock */
+ u32 aCounter[9]; /* Counters used by sqlite3_stmt_status() */
+ char *zSql; /* Text of the SQL statement that generated this */
+#ifdef SQLITE_ENABLE_NORMALIZE
+ char *zNormSql; /* Normalization of the associated SQL statement */
+ DblquoteStr *pDblStr; /* List of double-quoted string literals */
+#endif
+ void *pFree; /* Free this when deleting the vdbe */
+ VdbeFrame *pFrame; /* Parent frame */
+ VdbeFrame *pDelFrame; /* List of frame objects to free on VM reset */
+ int nFrame; /* Number of frames in pFrame list */
+ u32 expmask; /* Binding to these vars invalidates VM */
+ SubProgram *pProgram; /* Linked list of all sub-programs used by VM */
+ AuxData *pAuxData; /* Linked list of auxdata allocations */
+#ifdef SQLITE_ENABLE_STMT_SCANSTATUS
+ int nScan; /* Entries in aScan[] */
+ ScanStatus *aScan; /* Scan definitions for sqlite3_stmt_scanstatus() */
+#endif
+};
+
+/*
+** The following are allowed values for Vdbe.eVdbeState
+*/
+#define VDBE_INIT_STATE 0 /* Prepared statement under construction */
+#define VDBE_READY_STATE 1 /* Ready to run but not yet started */
+#define VDBE_RUN_STATE 2 /* Run in progress */
+#define VDBE_HALT_STATE 3 /* Finished. Need reset() or finalize() */
+
+/*
+** Structure used to store the context required by the
+** sqlite3_preupdate_*() API functions.
+*/
+struct PreUpdate {
+ Vdbe *v;
+ VdbeCursor *pCsr; /* Cursor to read old values from */
+ int op; /* One of SQLITE_INSERT, UPDATE, DELETE */
+ u8 *aRecord; /* old.* database record */
+ KeyInfo *pKeyinfo; /* Key information */
+ UnpackedRecord *pUnpacked; /* Unpacked version of aRecord[] */
+ UnpackedRecord *pNewUnpacked; /* Unpacked version of new.* record */
+ int iNewReg; /* Register for new.* values */
+ int iBlobWrite; /* Value returned by preupdate_blobwrite() */
+ i64 iKey1; /* First key value passed to hook */
+ i64 iKey2; /* Second key value passed to hook */
+ Mem oldipk; /* Memory cell holding "old" IPK value */
+ Mem *aNew; /* Array of new.* values */
+ Table *pTab; /* Schema object being updated */
+ Index *pPk; /* PK index if pTab is WITHOUT ROWID */
+ sqlite3_value **apDflt; /* Array of default values, if required */
+ u8 keyinfoSpace[SZ_KEYINFO(0)]; /* Space to hold pKeyinfo[0] content */
+};
+
+/*
+** An instance of this object is used to pass an vector of values into
+** OP_VFilter, the xFilter method of a virtual table. The vector is the
+** set of values on the right-hand side of an IN constraint.
+**
+** The value as passed into xFilter is an sqlite3_value with a "pointer"
+** type, such as is generated by sqlite3_result_pointer() and read by
+** sqlite3_value_pointer. Such values have MEM_Term|MEM_Subtype|MEM_Null
+** and a subtype of 'p'. The sqlite3_vtab_in_first() and _next() interfaces
+** know how to use this object to step through all the values in the
+** right operand of the IN constraint.
+*/
+typedef struct ValueList ValueList;
+struct ValueList {
+ BtCursor *pCsr; /* An ephemeral table holding all values */
+ sqlite3_value *pOut; /* Register to hold each decoded output value */
+};
+
+/* Size of content associated with serial types that fit into a
+** single-byte varint.
+*/
+#ifndef SQLITE_AMALGAMATION
+SQLITE_PRIVATE const u8 sqlite3SmallTypeSizes[];
+#endif
+
+/*
+** Function prototypes
+*/
+SQLITE_PRIVATE void sqlite3VdbeError(Vdbe*, const char *, ...);
+SQLITE_PRIVATE void sqlite3VdbeFreeCursor(Vdbe *, VdbeCursor*);
+SQLITE_PRIVATE void sqlite3VdbeFreeCursorNN(Vdbe*,VdbeCursor*);
+void sqliteVdbePopStack(Vdbe*,int);
+SQLITE_PRIVATE int SQLITE_NOINLINE sqlite3VdbeHandleMovedCursor(VdbeCursor *p);
+SQLITE_PRIVATE int SQLITE_NOINLINE sqlite3VdbeFinishMoveto(VdbeCursor*);
+SQLITE_PRIVATE int sqlite3VdbeCursorRestore(VdbeCursor*);
+SQLITE_PRIVATE u32 sqlite3VdbeSerialTypeLen(u32);
+SQLITE_PRIVATE u8 sqlite3VdbeOneByteSerialTypeLen(u8);
+#ifdef SQLITE_MIXED_ENDIAN_64BIT_FLOAT
+SQLITE_PRIVATE u64 sqlite3FloatSwap(u64 in);
+# define swapMixedEndianFloat(X) X = sqlite3FloatSwap(X)
+#else
+# define swapMixedEndianFloat(X)
+#endif
+SQLITE_PRIVATE void sqlite3VdbeSerialGet(const unsigned char*, u32, Mem*);
+SQLITE_PRIVATE void sqlite3VdbeDeleteAuxData(sqlite3*, AuxData**, int, int);
+
+int sqlite2BtreeKeyCompare(BtCursor *, const void *, int, int, int *);
+SQLITE_PRIVATE int sqlite3VdbeIdxKeyCompare(sqlite3*,VdbeCursor*,UnpackedRecord*,int*);
+SQLITE_PRIVATE int sqlite3VdbeIdxRowid(sqlite3*, BtCursor*, i64*);
+SQLITE_PRIVATE int sqlite3VdbeExec(Vdbe*);
+#if !defined(SQLITE_OMIT_EXPLAIN) || defined(SQLITE_ENABLE_BYTECODE_VTAB)
+SQLITE_PRIVATE int sqlite3VdbeNextOpcode(Vdbe*,Mem*,int,int*,int*,Op**);
+SQLITE_PRIVATE char *sqlite3VdbeDisplayP4(sqlite3*,Op*);
+#endif
+#if defined(SQLITE_ENABLE_EXPLAIN_COMMENTS)
+SQLITE_PRIVATE char *sqlite3VdbeDisplayComment(sqlite3*,const Op*,const char*);
+#endif
+#if !defined(SQLITE_OMIT_EXPLAIN)
+SQLITE_PRIVATE int sqlite3VdbeList(Vdbe*);
+#endif
+SQLITE_PRIVATE int sqlite3VdbeHalt(Vdbe*);
+SQLITE_PRIVATE int sqlite3VdbeChangeEncoding(Mem *, int);
+SQLITE_PRIVATE int sqlite3VdbeMemTooBig(Mem*);
+SQLITE_PRIVATE int sqlite3VdbeMemCopy(Mem*, const Mem*);
+SQLITE_PRIVATE void sqlite3VdbeMemShallowCopy(Mem*, const Mem*, int);
+SQLITE_PRIVATE void sqlite3VdbeMemMove(Mem*, Mem*);
+SQLITE_PRIVATE int sqlite3VdbeMemNulTerminate(Mem*);
+SQLITE_PRIVATE int sqlite3VdbeMemSetStr(Mem*, const char*, i64, u8, void(*)(void*));
+SQLITE_PRIVATE void sqlite3VdbeMemSetInt64(Mem*, i64);
+#ifdef SQLITE_OMIT_FLOATING_POINT
+# define sqlite3VdbeMemSetDouble sqlite3VdbeMemSetInt64
+#else
+SQLITE_PRIVATE void sqlite3VdbeMemSetDouble(Mem*, double);
+#endif
+SQLITE_PRIVATE void sqlite3VdbeMemSetPointer(Mem*, void*, const char*, void(*)(void*));
+SQLITE_PRIVATE void sqlite3VdbeMemInit(Mem*,sqlite3*,u16);
+SQLITE_PRIVATE void sqlite3VdbeMemSetNull(Mem*);
+#ifndef SQLITE_OMIT_INCRBLOB
+SQLITE_PRIVATE void sqlite3VdbeMemSetZeroBlob(Mem*,int);
+#else
+SQLITE_PRIVATE int sqlite3VdbeMemSetZeroBlob(Mem*,int);
+#endif
+#ifdef SQLITE_DEBUG
+SQLITE_PRIVATE int sqlite3VdbeMemIsRowSet(const Mem*);
+#endif
+SQLITE_PRIVATE int sqlite3VdbeMemSetRowSet(Mem*);
+SQLITE_PRIVATE void sqlite3VdbeMemZeroTerminateIfAble(Mem*);
+SQLITE_PRIVATE int sqlite3VdbeMemMakeWriteable(Mem*);
+SQLITE_PRIVATE int sqlite3VdbeMemStringify(Mem*, u8, u8);
+SQLITE_PRIVATE int sqlite3IntFloatCompare(i64,double);
+SQLITE_PRIVATE i64 sqlite3VdbeIntValue(const Mem*);
+SQLITE_PRIVATE int sqlite3VdbeMemIntegerify(Mem*);
+SQLITE_PRIVATE double sqlite3VdbeRealValue(Mem*);
+SQLITE_PRIVATE int sqlite3VdbeBooleanValue(Mem*, int ifNull);
+SQLITE_PRIVATE void sqlite3VdbeIntegerAffinity(Mem*);
+SQLITE_PRIVATE int sqlite3VdbeMemRealify(Mem*);
+SQLITE_PRIVATE int sqlite3VdbeMemNumerify(Mem*);
+SQLITE_PRIVATE int sqlite3VdbeMemCast(Mem*,u8,u8);
+SQLITE_PRIVATE int sqlite3VdbeMemFromBtree(BtCursor*,u32,u32,Mem*);
+SQLITE_PRIVATE int sqlite3VdbeMemFromBtreeZeroOffset(BtCursor*,u32,Mem*);
+SQLITE_PRIVATE void sqlite3VdbeMemRelease(Mem *p);
+SQLITE_PRIVATE void sqlite3VdbeMemReleaseMalloc(Mem*p);
+SQLITE_PRIVATE int sqlite3VdbeMemFinalize(Mem*, FuncDef*);
+#ifndef SQLITE_OMIT_WINDOWFUNC
+SQLITE_PRIVATE int sqlite3VdbeMemAggValue(Mem*, Mem*, FuncDef*);
+#endif
+#if !defined(SQLITE_OMIT_EXPLAIN) || defined(SQLITE_ENABLE_BYTECODE_VTAB)
+SQLITE_PRIVATE const char *sqlite3OpcodeName(int);
+#endif
+SQLITE_PRIVATE int sqlite3VdbeMemGrow(Mem *pMem, int n, int preserve);
+SQLITE_PRIVATE int sqlite3VdbeMemClearAndResize(Mem *pMem, int n);
+SQLITE_PRIVATE int sqlite3VdbeCloseStatement(Vdbe *, int);
+#ifdef SQLITE_DEBUG
+SQLITE_PRIVATE int sqlite3VdbeFrameIsValid(VdbeFrame*);
+#endif
+SQLITE_PRIVATE void sqlite3VdbeFrameMemDel(void*); /* Destructor on Mem */
+SQLITE_PRIVATE void sqlite3VdbeFrameDelete(VdbeFrame*); /* Actually deletes the Frame */
+SQLITE_PRIVATE int sqlite3VdbeFrameRestore(VdbeFrame *);
+#ifdef SQLITE_ENABLE_PREUPDATE_HOOK
+SQLITE_PRIVATE void sqlite3VdbePreUpdateHook(
+ Vdbe*,VdbeCursor*,int,const char*,Table*,i64,int,int);
+#endif
+SQLITE_PRIVATE int sqlite3VdbeTransferError(Vdbe *p);
+
+SQLITE_PRIVATE int sqlite3VdbeSorterInit(sqlite3 *, int, VdbeCursor *);
+SQLITE_PRIVATE void sqlite3VdbeSorterReset(sqlite3 *, VdbeSorter *);
+SQLITE_PRIVATE void sqlite3VdbeSorterClose(sqlite3 *, VdbeCursor *);
+SQLITE_PRIVATE int sqlite3VdbeSorterRowkey(const VdbeCursor *, Mem *);
+SQLITE_PRIVATE int sqlite3VdbeSorterNext(sqlite3 *, const VdbeCursor *);
+SQLITE_PRIVATE int sqlite3VdbeSorterRewind(const VdbeCursor *, int *);
+SQLITE_PRIVATE int sqlite3VdbeSorterWrite(const VdbeCursor *, Mem *);
+SQLITE_PRIVATE int sqlite3VdbeSorterCompare(const VdbeCursor *, Mem *, int, int *);
+
+SQLITE_PRIVATE void sqlite3VdbeValueListFree(void*);
+
+#ifdef SQLITE_DEBUG
+SQLITE_PRIVATE void sqlite3VdbeIncrWriteCounter(Vdbe*, VdbeCursor*);
+SQLITE_PRIVATE void sqlite3VdbeAssertAbortable(Vdbe*);
+#else
+# define sqlite3VdbeIncrWriteCounter(V,C)
+# define sqlite3VdbeAssertAbortable(V)
+#endif
+
+#if !defined(SQLITE_OMIT_SHARED_CACHE)
+SQLITE_PRIVATE void sqlite3VdbeEnter(Vdbe*);
+#else
+# define sqlite3VdbeEnter(X)
+#endif
+
+#if !defined(SQLITE_OMIT_SHARED_CACHE) && SQLITE_THREADSAFE>0
+SQLITE_PRIVATE void sqlite3VdbeLeave(Vdbe*);
+#else
+# define sqlite3VdbeLeave(X)
+#endif
+
+#ifdef SQLITE_DEBUG
+SQLITE_PRIVATE void sqlite3VdbeMemAboutToChange(Vdbe*,Mem*);
+SQLITE_PRIVATE int sqlite3VdbeCheckMemInvariants(Mem*);
+#endif
+
+#ifndef SQLITE_OMIT_FOREIGN_KEY
+SQLITE_PRIVATE int sqlite3VdbeCheckFk(Vdbe *, int);
+#else
+# define sqlite3VdbeCheckFk(p,i) 0
+#endif
+
+#ifdef SQLITE_DEBUG
+SQLITE_PRIVATE void sqlite3VdbePrintSql(Vdbe*);
+SQLITE_PRIVATE void sqlite3VdbeMemPrettyPrint(Mem *pMem, StrAccum *pStr);
+#endif
+#ifndef SQLITE_OMIT_UTF16
+SQLITE_PRIVATE int sqlite3VdbeMemTranslate(Mem*, u8);
+SQLITE_PRIVATE int sqlite3VdbeMemHandleBom(Mem *pMem);
+#endif
+
+#ifndef SQLITE_OMIT_INCRBLOB
+SQLITE_PRIVATE int sqlite3VdbeMemExpandBlob(Mem *);
+ #define ExpandBlob(P) (((P)->flags&MEM_Zero)?sqlite3VdbeMemExpandBlob(P):0)
+#else
+ #define sqlite3VdbeMemExpandBlob(x) SQLITE_OK
+ #define ExpandBlob(P) SQLITE_OK
+#endif
+
+#endif /* !defined(SQLITE_VDBEINT_H) */
+
+/************** End of vdbeInt.h *********************************************/
+/************** Continuing where we left off in status.c *********************/
+
+/*
+** Variables in which to record status information.
+*/
+#if SQLITE_PTRSIZE>4
+typedef sqlite3_int64 sqlite3StatValueType;
+#else
+typedef u32 sqlite3StatValueType;
+#endif
+typedef struct sqlite3StatType sqlite3StatType;
+static SQLITE_WSD struct sqlite3StatType {
+ sqlite3StatValueType nowValue[10]; /* Current value */
+ sqlite3StatValueType mxValue[10]; /* Maximum value */
+} sqlite3Stat = { {0,}, {0,} };
+
+/*
+** Elements of sqlite3Stat[] are protected by either the memory allocator
+** mutex, or by the pcache1 mutex. The following array determines which.
+*/
+static const char statMutex[] = {
+ 0, /* SQLITE_STATUS_MEMORY_USED */
+ 1, /* SQLITE_STATUS_PAGECACHE_USED */
+ 1, /* SQLITE_STATUS_PAGECACHE_OVERFLOW */
+ 0, /* SQLITE_STATUS_SCRATCH_USED */
+ 0, /* SQLITE_STATUS_SCRATCH_OVERFLOW */
+ 0, /* SQLITE_STATUS_MALLOC_SIZE */
+ 0, /* SQLITE_STATUS_PARSER_STACK */
+ 1, /* SQLITE_STATUS_PAGECACHE_SIZE */
+ 0, /* SQLITE_STATUS_SCRATCH_SIZE */
+ 0, /* SQLITE_STATUS_MALLOC_COUNT */
+};
+
+
+/* The "wsdStat" macro will resolve to the status information
+** state vector. If writable static data is unsupported on the target,
+** we have to locate the state vector at run-time. In the more common
+** case where writable static data is supported, wsdStat can refer directly
+** to the "sqlite3Stat" state vector declared above.
+*/
+#ifdef SQLITE_OMIT_WSD
+# define wsdStatInit sqlite3StatType *x = &GLOBAL(sqlite3StatType,sqlite3Stat)
+# define wsdStat x[0]
+#else
+# define wsdStatInit
+# define wsdStat sqlite3Stat
+#endif
+
+/*
+** Return the current value of a status parameter. The caller must
+** be holding the appropriate mutex.
+*/
+SQLITE_PRIVATE sqlite3_int64 sqlite3StatusValue(int op){
+ wsdStatInit;
+ assert( op>=0 && op=0 && op=0 && op=0 && opwsdStat.mxValue[op] ){
+ wsdStat.mxValue[op] = wsdStat.nowValue[op];
+ }
+}
+SQLITE_PRIVATE void sqlite3StatusDown(int op, int N){
+ wsdStatInit;
+ assert( N>=0 );
+ assert( op>=0 && op=0 && op=0 );
+ newValue = (sqlite3StatValueType)X;
+ assert( op>=0 && op=0 && opwsdStat.mxValue[op] ){
+ wsdStat.mxValue[op] = newValue;
+ }
+}
+
+/*
+** Query status information.
+*/
+SQLITE_API int sqlite3_status64(
+ int op,
+ sqlite3_int64 *pCurrent,
+ sqlite3_int64 *pHighwater,
+ int resetFlag
+){
+ sqlite3_mutex *pMutex;
+ wsdStatInit;
+ if( op<0 || op>=ArraySize(wsdStat.nowValue) ){
+ return SQLITE_MISUSE_BKPT;
+ }
+#ifdef SQLITE_ENABLE_API_ARMOR
+ if( pCurrent==0 || pHighwater==0 ) return SQLITE_MISUSE_BKPT;
+#endif
+ pMutex = statMutex[op] ? sqlite3Pcache1Mutex() : sqlite3MallocMutex();
+ sqlite3_mutex_enter(pMutex);
+ *pCurrent = wsdStat.nowValue[op];
+ *pHighwater = wsdStat.mxValue[op];
+ if( resetFlag ){
+ wsdStat.mxValue[op] = wsdStat.nowValue[op];
+ }
+ sqlite3_mutex_leave(pMutex);
+ (void)pMutex; /* Prevent warning when SQLITE_THREADSAFE=0 */
+ return SQLITE_OK;
+}
+SQLITE_API int sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag){
+ sqlite3_int64 iCur = 0, iHwtr = 0;
+ int rc;
+#ifdef SQLITE_ENABLE_API_ARMOR
+ if( pCurrent==0 || pHighwater==0 ) return SQLITE_MISUSE_BKPT;
+#endif
+ rc = sqlite3_status64(op, &iCur, &iHwtr, resetFlag);
+ if( rc==0 ){
+ *pCurrent = (int)iCur;
+ *pHighwater = (int)iHwtr;
+ }
+ return rc;
+}
+
+/*
+** Return the number of LookasideSlot elements on the linked list
+*/
+static u32 countLookasideSlots(LookasideSlot *p){
+ u32 cnt = 0;
+ while( p ){
+ p = p->pNext;
+ cnt++;
+ }
+ return cnt;
+}
+
+/*
+** Count the number of slots of lookaside memory that are outstanding
+*/
+SQLITE_PRIVATE int sqlite3LookasideUsed(sqlite3 *db, int *pHighwater){
+ u32 nInit = countLookasideSlots(db->lookaside.pInit);
+ u32 nFree = countLookasideSlots(db->lookaside.pFree);
+#ifndef SQLITE_OMIT_TWOSIZE_LOOKASIDE
+ nInit += countLookasideSlots(db->lookaside.pSmallInit);
+ nFree += countLookasideSlots(db->lookaside.pSmallFree);
+#endif /* SQLITE_OMIT_TWOSIZE_LOOKASIDE */
+ assert( db->lookaside.nSlot >= nInit+nFree );
+ if( pHighwater ) *pHighwater = (int)(db->lookaside.nSlot - nInit);
+ return (int)(db->lookaside.nSlot - (nInit+nFree));
+}
+
+/*
+** Query status information for a single database connection
+*/
+SQLITE_API int sqlite3_db_status(
+ sqlite3 *db, /* The database connection whose status is desired */
+ int op, /* Status verb */
+ int *pCurrent, /* Write current value here */
+ int *pHighwater, /* Write high-water mark here */
+ int resetFlag /* Reset high-water mark if true */
+){
+ int rc = SQLITE_OK; /* Return code */
+#ifdef SQLITE_ENABLE_API_ARMOR
+ if( !sqlite3SafetyCheckOk(db) || pCurrent==0|| pHighwater==0 ){
+ return SQLITE_MISUSE_BKPT;
+ }
+#endif
+ sqlite3_mutex_enter(db->mutex);
+ switch( op ){
+ case SQLITE_DBSTATUS_LOOKASIDE_USED: {
+ *pCurrent = sqlite3LookasideUsed(db, pHighwater);
+ if( resetFlag ){
+ LookasideSlot *p = db->lookaside.pFree;
+ if( p ){
+ while( p->pNext ) p = p->pNext;
+ p->pNext = db->lookaside.pInit;
+ db->lookaside.pInit = db->lookaside.pFree;
+ db->lookaside.pFree = 0;
+ }
+#ifndef SQLITE_OMIT_TWOSIZE_LOOKASIDE
+ p = db->lookaside.pSmallFree;
+ if( p ){
+ while( p->pNext ) p = p->pNext;
+ p->pNext = db->lookaside.pSmallInit;
+ db->lookaside.pSmallInit = db->lookaside.pSmallFree;
+ db->lookaside.pSmallFree = 0;
+ }
+#endif
+ }
+ break;
+ }
+
+ case SQLITE_DBSTATUS_LOOKASIDE_HIT:
+ case SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE:
+ case SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL: {
+ testcase( op==SQLITE_DBSTATUS_LOOKASIDE_HIT );
+ testcase( op==SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE );
+ testcase( op==SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL );
+ assert( (op-SQLITE_DBSTATUS_LOOKASIDE_HIT)>=0 );
+ assert( (op-SQLITE_DBSTATUS_LOOKASIDE_HIT)<3 );
+ *pCurrent = 0;
+ *pHighwater = (int)db->lookaside.anStat[op-SQLITE_DBSTATUS_LOOKASIDE_HIT];
+ if( resetFlag ){
+ db->lookaside.anStat[op - SQLITE_DBSTATUS_LOOKASIDE_HIT] = 0;
+ }
+ break;
+ }
+
+ /*
+ ** Return an approximation for the amount of memory currently used
+ ** by all pagers associated with the given database connection. The
+ ** highwater mark is meaningless and is returned as zero.
+ */
+ case SQLITE_DBSTATUS_CACHE_USED_SHARED:
+ case SQLITE_DBSTATUS_CACHE_USED: {
+ int totalUsed = 0;
+ int i;
+ sqlite3BtreeEnterAll(db);
+ for(i=0; inDb; i++){
+ Btree *pBt = db->aDb[i].pBt;
+ if( pBt ){
+ Pager *pPager = sqlite3BtreePager(pBt);
+ int nByte = sqlite3PagerMemUsed(pPager);
+ if( op==SQLITE_DBSTATUS_CACHE_USED_SHARED ){
+ nByte = nByte / sqlite3BtreeConnectionCount(pBt);
+ }
+ totalUsed += nByte;
+ }
+ }
+ sqlite3BtreeLeaveAll(db);
+ *pCurrent = totalUsed;
+ *pHighwater = 0;
+ break;
+ }
+
+ /*
+ ** *pCurrent gets an accurate estimate of the amount of memory used
+ ** to store the schema for all databases (main, temp, and any ATTACHed
+ ** databases. *pHighwater is set to zero.
+ */
+ case SQLITE_DBSTATUS_SCHEMA_USED: {
+ int i; /* Used to iterate through schemas */
+ int nByte = 0; /* Used to accumulate return value */
+
+ sqlite3BtreeEnterAll(db);
+ db->pnBytesFreed = &nByte;
+ assert( db->lookaside.pEnd==db->lookaside.pTrueEnd );
+ db->lookaside.pEnd = db->lookaside.pStart;
+ for(i=0; inDb; i++){
+ Schema *pSchema = db->aDb[i].pSchema;
+ if( ALWAYS(pSchema!=0) ){
+ HashElem *p;
+
+ nByte += sqlite3GlobalConfig.m.xRoundup(sizeof(HashElem)) * (
+ pSchema->tblHash.count
+ + pSchema->trigHash.count
+ + pSchema->idxHash.count
+ + pSchema->fkeyHash.count
+ );
+ nByte += sqlite3_msize(pSchema->tblHash.ht);
+ nByte += sqlite3_msize(pSchema->trigHash.ht);
+ nByte += sqlite3_msize(pSchema->idxHash.ht);
+ nByte += sqlite3_msize(pSchema->fkeyHash.ht);
+
+ for(p=sqliteHashFirst(&pSchema->trigHash); p; p=sqliteHashNext(p)){
+ sqlite3DeleteTrigger(db, (Trigger*)sqliteHashData(p));
+ }
+ for(p=sqliteHashFirst(&pSchema->tblHash); p; p=sqliteHashNext(p)){
+ sqlite3DeleteTable(db, (Table *)sqliteHashData(p));
+ }
+ }
+ }
+ db->pnBytesFreed = 0;
+ db->lookaside.pEnd = db->lookaside.pTrueEnd;
+ sqlite3BtreeLeaveAll(db);
+
+ *pHighwater = 0;
+ *pCurrent = nByte;
+ break;
+ }
+
+ /*
+ ** *pCurrent gets an accurate estimate of the amount of memory used
+ ** to store all prepared statements.
+ ** *pHighwater is set to zero.
+ */
+ case SQLITE_DBSTATUS_STMT_USED: {
+ struct Vdbe *pVdbe; /* Used to iterate through VMs */
+ int nByte = 0; /* Used to accumulate return value */
+
+ db->pnBytesFreed = &nByte;
+ assert( db->lookaside.pEnd==db->lookaside.pTrueEnd );
+ db->lookaside.pEnd = db->lookaside.pStart;
+ for(pVdbe=db->pVdbe; pVdbe; pVdbe=pVdbe->pVNext){
+ sqlite3VdbeDelete(pVdbe);
+ }
+ db->lookaside.pEnd = db->lookaside.pTrueEnd;
+ db->pnBytesFreed = 0;
+
+ *pHighwater = 0; /* IMP: R-64479-57858 */
+ *pCurrent = nByte;
+
+ break;
+ }
+
+ /*
+ ** Set *pCurrent to the total cache hits or misses encountered by all
+ ** pagers the database handle is connected to. *pHighwater is always set
+ ** to zero.
+ */
+ case SQLITE_DBSTATUS_CACHE_SPILL:
+ op = SQLITE_DBSTATUS_CACHE_WRITE+1;
+ /* no break */ deliberate_fall_through
+ case SQLITE_DBSTATUS_CACHE_HIT:
+ case SQLITE_DBSTATUS_CACHE_MISS:
+ case SQLITE_DBSTATUS_CACHE_WRITE:{
+ int i;
+ u64 nRet = 0;
+ assert( SQLITE_DBSTATUS_CACHE_MISS==SQLITE_DBSTATUS_CACHE_HIT+1 );
+ assert( SQLITE_DBSTATUS_CACHE_WRITE==SQLITE_DBSTATUS_CACHE_HIT+2 );
+
+ for(i=0; inDb; i++){
+ if( db->aDb[i].pBt ){
+ Pager *pPager = sqlite3BtreePager(db->aDb[i].pBt);
+ sqlite3PagerCacheStat(pPager, op, resetFlag, &nRet);
+ }
+ }
+ *pHighwater = 0; /* IMP: R-42420-56072 */
+ /* IMP: R-54100-20147 */
+ /* IMP: R-29431-39229 */
+ *pCurrent = (int)nRet & 0x7fffffff;
+ break;
+ }
+
+ /* Set *pCurrent to non-zero if there are unresolved deferred foreign
+ ** key constraints. Set *pCurrent to zero if all foreign key constraints
+ ** have been satisfied. The *pHighwater is always set to zero.
+ */
+ case SQLITE_DBSTATUS_DEFERRED_FKS: {
+ *pHighwater = 0; /* IMP: R-11967-56545 */
+ *pCurrent = db->nDeferredImmCons>0 || db->nDeferredCons>0;
+ break;
+ }
+
+ default: {
+ rc = SQLITE_ERROR;
+ }
+ }
+ sqlite3_mutex_leave(db->mutex);
+ return rc;
+}
+
+/************** End of status.c **********************************************/
+/************** Begin file date.c ********************************************/
+/*
+** 2003 October 31
+**
+** The author disclaims copyright to this source code. In place of
+** a legal notice, here is a blessing:
+**
+** May you do good and not evil.
+** May you find forgiveness for yourself and forgive others.
+** May you share freely, never taking more than you give.
+**
+*************************************************************************
+** This file contains the C functions that implement date and time
+** functions for SQLite.
+**
+** There is only one exported symbol in this file - the function
+** sqlite3RegisterDateTimeFunctions() found at the bottom of the file.
+** All other code has file scope.
+**
+** SQLite processes all times and dates as julian day numbers. The
+** dates and times are stored as the number of days since noon
+** in Greenwich on November 24, 4714 B.C. according to the Gregorian
+** calendar system.
+**
+** 1970-01-01 00:00:00 is JD 2440587.5
+** 2000-01-01 00:00:00 is JD 2451544.5
+**
+** This implementation requires years to be expressed as a 4-digit number
+** which means that only dates between 0000-01-01 and 9999-12-31 can
+** be represented, even though julian day numbers allow a much wider
+** range of dates.
+**
+** The Gregorian calendar system is used for all dates and times,
+** even those that predate the Gregorian calendar. Historians usually
+** use the julian calendar for dates prior to 1582-10-15 and for some
+** dates afterwards, depending on locale. Beware of this difference.
+**
+** The conversion algorithms are implemented based on descriptions
+** in the following text:
+**
+** Jean Meeus
+** Astronomical Algorithms, 2nd Edition, 1998
+** ISBN 0-943396-61-1
+** Willmann-Bell, Inc
+** Richmond, Virginia (USA)
+*/
+/* #include "sqliteInt.h" */
+/* #include */
+/* #include */
+#include
+
+#ifndef SQLITE_OMIT_DATETIME_FUNCS
+
+/*
+** The MSVC CRT on Windows CE may not have a localtime() function.
+** So declare a substitute. The substitute function itself is
+** defined in "os_win.c".
+*/
+#if !defined(SQLITE_OMIT_LOCALTIME) && defined(_WIN32_WCE) && \
+ (!defined(SQLITE_MSVC_LOCALTIME_API) || !SQLITE_MSVC_LOCALTIME_API)
+struct tm *__cdecl localtime(const time_t *);
+#endif
+
+/*
+** A structure for holding a single date and time.
+*/
+typedef struct DateTime DateTime;
+struct DateTime {
+ sqlite3_int64 iJD; /* The julian day number times 86400000 */
+ int Y, M, D; /* Year, month, and day */
+ int h, m; /* Hour and minutes */
+ int tz; /* Timezone offset in minutes */
+ double s; /* Seconds */
+ char validJD; /* True (1) if iJD is valid */
+ char validYMD; /* True (1) if Y,M,D are valid */
+ char validHMS; /* True (1) if h,m,s are valid */
+ char nFloor; /* Days to implement "floor" */
+ unsigned rawS : 1; /* Raw numeric value stored in s */
+ unsigned isError : 1; /* An overflow has occurred */
+ unsigned useSubsec : 1; /* Display subsecond precision */
+ unsigned isUtc : 1; /* Time is known to be UTC */
+ unsigned isLocal : 1; /* Time is known to be localtime */
+};
+
+
+/*
+** Convert zDate into one or more integers according to the conversion
+** specifier zFormat.
+**
+** zFormat[] contains 4 characters for each integer converted, except for
+** the last integer which is specified by three characters. The meaning
+** of a four-character format specifiers ABCD is:
+**
+** A: number of digits to convert. Always "2" or "4".
+** B: minimum value. Always "0" or "1".
+** C: maximum value, decoded as:
+** a: 12
+** b: 14
+** c: 24
+** d: 31
+** e: 59
+** f: 9999
+** D: the separator character, or \000 to indicate this is the
+** last number to convert.
+**
+** Example: To translate an ISO-8601 date YYYY-MM-DD, the format would
+** be "40f-21a-20c". The "40f-" indicates the 4-digit year followed by "-".
+** The "21a-" indicates the 2-digit month followed by "-". The "20c" indicates
+** the 2-digit day which is the last integer in the set.
+**
+** The function returns the number of successful conversions.
+*/
+static int getDigits(const char *zDate, const char *zFormat, ...){
+ /* The aMx[] array translates the 3rd character of each format
+ ** spec into a max size: a b c d e f */
+ static const u16 aMx[] = { 12, 14, 24, 31, 59, 14712 };
+ va_list ap;
+ int cnt = 0;
+ char nextC;
+ va_start(ap, zFormat);
+ do{
+ char N = zFormat[0] - '0';
+ char min = zFormat[1] - '0';
+ int val = 0;
+ u16 max;
+
+ assert( zFormat[2]>='a' && zFormat[2]<='f' );
+ max = aMx[zFormat[2] - 'a'];
+ nextC = zFormat[3];
+ val = 0;
+ while( N-- ){
+ if( !sqlite3Isdigit(*zDate) ){
+ goto end_getDigits;
+ }
+ val = val*10 + *zDate - '0';
+ zDate++;
+ }
+ if( val<(int)min || val>(int)max || (nextC!=0 && nextC!=*zDate) ){
+ goto end_getDigits;
+ }
+ *va_arg(ap,int*) = val;
+ zDate++;
+ cnt++;
+ zFormat += 4;
+ }while( nextC );
+end_getDigits:
+ va_end(ap);
+ return cnt;
+}
+
+/*
+** Parse a timezone extension on the end of a date-time.
+** The extension is of the form:
+**
+** (+/-)HH:MM
+**
+** Or the "zulu" notation:
+**
+** Z
+**
+** If the parse is successful, write the number of minutes
+** of change in p->tz and return 0. If a parser error occurs,
+** return non-zero.
+**
+** A missing specifier is not considered an error.
+*/
+static int parseTimezone(const char *zDate, DateTime *p){
+ int sgn = 0;
+ int nHr, nMn;
+ int c;
+ while( sqlite3Isspace(*zDate) ){ zDate++; }
+ p->tz = 0;
+ c = *zDate;
+ if( c=='-' ){
+ sgn = -1;
+ }else if( c=='+' ){
+ sgn = +1;
+ }else if( c=='Z' || c=='z' ){
+ zDate++;
+ p->isLocal = 0;
+ p->isUtc = 1;
+ goto zulu_time;
+ }else{
+ return c!=0;
+ }
+ zDate++;
+ if( getDigits(zDate, "20b:20e", &nHr, &nMn)!=2 ){
+ return 1;
+ }
+ zDate += 5;
+ p->tz = sgn*(nMn + nHr*60);
+zulu_time:
+ while( sqlite3Isspace(*zDate) ){ zDate++; }
+ return *zDate!=0;
+}
+
+/*
+** Parse times of the form HH:MM or HH:MM:SS or HH:MM:SS.FFFF.
+** The HH, MM, and SS must each be exactly 2 digits. The
+** fractional seconds FFFF can be one or more digits.
+**
+** Return 1 if there is a parsing error and 0 on success.
+*/
+static int parseHhMmSs(const char *zDate, DateTime *p){
+ int h, m, s;
+ double ms = 0.0;
+ if( getDigits(zDate, "20c:20e", &h, &m)!=2 ){
+ return 1;
+ }
+ zDate += 5;
+ if( *zDate==':' ){
+ zDate++;
+ if( getDigits(zDate, "20e", &s)!=1 ){
+ return 1;
+ }
+ zDate += 2;
+ if( *zDate=='.' && sqlite3Isdigit(zDate[1]) ){
+ double rScale = 1.0;
+ zDate++;
+ while( sqlite3Isdigit(*zDate) ){
+ ms = ms*10.0 + *zDate - '0';
+ rScale *= 10.0;
+ zDate++;
+ }
+ ms /= rScale;
+ /* Truncate to avoid problems with sub-milliseconds
+ ** rounding. https://sqlite.org/forum/forumpost/766a2c9231 */
+ if( ms>0.999 ) ms = 0.999;
+ }
+ }else{
+ s = 0;
+ }
+ p->validJD = 0;
+ p->rawS = 0;
+ p->validHMS = 1;
+ p->h = h;
+ p->m = m;
+ p->s = s + ms;
+ if( parseTimezone(zDate, p) ) return 1;
+ return 0;
+}
+
+/*
+** Put the DateTime object into its error state.
+*/
+static void datetimeError(DateTime *p){
+ memset(p, 0, sizeof(*p));
+ p->isError = 1;
+}
+
+/*
+** Convert from YYYY-MM-DD HH:MM:SS to julian day. We always assume
+** that the YYYY-MM-DD is according to the Gregorian calendar.
+**
+** Reference: Meeus page 61
+*/
+static void computeJD(DateTime *p){
+ int Y, M, D, A, B, X1, X2;
+
+ if( p->validJD ) return;
+ if( p->validYMD ){
+ Y = p->Y;
+ M = p->M;
+ D = p->D;
+ }else{
+ Y = 2000; /* If no YMD specified, assume 2000-Jan-01 */
+ M = 1;
+ D = 1;
+ }
+ if( Y<-4713 || Y>9999 || p->rawS ){
+ datetimeError(p);
+ return;
+ }
+ if( M<=2 ){
+ Y--;
+ M += 12;
+ }
+ A = (Y+4800)/100;
+ B = 38 - A + (A/4);
+ X1 = 36525*(Y+4716)/100;
+ X2 = 306001*(M+1)/10000;
+ p->iJD = (sqlite3_int64)((X1 + X2 + D + B - 1524.5 ) * 86400000);
+ p->validJD = 1;
+ if( p->validHMS ){
+ p->iJD += p->h*3600000 + p->m*60000 + (sqlite3_int64)(p->s*1000 + 0.5);
+ if( p->tz ){
+ p->iJD -= p->tz*60000;
+ p->validYMD = 0;
+ p->validHMS = 0;
+ p->tz = 0;
+ p->isUtc = 1;
+ p->isLocal = 0;
+ }
+ }
+}
+
+/*
+** Given the YYYY-MM-DD information current in p, determine if there
+** is day-of-month overflow and set nFloor to the number of days that
+** would need to be subtracted from the date in order to bring the
+** date back to the end of the month.
+*/
+static void computeFloor(DateTime *p){
+ assert( p->validYMD || p->isError );
+ assert( p->D>=0 && p->D<=31 );
+ assert( p->M>=0 && p->M<=12 );
+ if( p->D<=28 ){
+ p->nFloor = 0;
+ }else if( (1<M) & 0x15aa ){
+ p->nFloor = 0;
+ }else if( p->M!=2 ){
+ p->nFloor = (p->D==31);
+ }else if( p->Y%4!=0 || (p->Y%100==0 && p->Y%400!=0) ){
+ p->nFloor = p->D - 28;
+ }else{
+ p->nFloor = p->D - 29;
+ }
+}
+
+/*
+** Parse dates of the form
+**
+** YYYY-MM-DD HH:MM:SS.FFF
+** YYYY-MM-DD HH:MM:SS
+** YYYY-MM-DD HH:MM
+** YYYY-MM-DD
+**
+** Write the result into the DateTime structure and return 0
+** on success and 1 if the input string is not a well-formed
+** date.
+*/
+static int parseYyyyMmDd(const char *zDate, DateTime *p){
+ int Y, M, D, neg;
+
+ if( zDate[0]=='-' ){
+ zDate++;
+ neg = 1;
+ }else{
+ neg = 0;
+ }
+ if( getDigits(zDate, "40f-21a-21d", &Y, &M, &D)!=3 ){
+ return 1;
+ }
+ zDate += 10;
+ while( sqlite3Isspace(*zDate) || 'T'==*(u8*)zDate ){ zDate++; }
+ if( parseHhMmSs(zDate, p)==0 ){
+ /* We got the time */
+ }else if( *zDate==0 ){
+ p->validHMS = 0;
+ }else{
+ return 1;
+ }
+ p->validJD = 0;
+ p->validYMD = 1;
+ p->Y = neg ? -Y : Y;
+ p->M = M;
+ p->D = D;
+ computeFloor(p);
+ if( p->tz ){
+ computeJD(p);
+ }
+ return 0;
+}
+
+
+static void clearYMD_HMS_TZ(DateTime *p); /* Forward declaration */
+
+/*
+** Set the time to the current time reported by the VFS.
+**
+** Return the number of errors.
+*/
+static int setDateTimeToCurrent(sqlite3_context *context, DateTime *p){
+ p->iJD = sqlite3StmtCurrentTime(context);
+ if( p->iJD>0 ){
+ p->validJD = 1;
+ p->isUtc = 1;
+ p->isLocal = 0;
+ clearYMD_HMS_TZ(p);
+ return 0;
+ }else{
+ return 1;
+ }
+}
+
+/*
+** Input "r" is a numeric quantity which might be a julian day number,
+** or the number of seconds since 1970. If the value if r is within
+** range of a julian day number, install it as such and set validJD.
+** If the value is a valid unix timestamp, put it in p->s and set p->rawS.
+*/
+static void setRawDateNumber(DateTime *p, double r){
+ p->s = r;
+ p->rawS = 1;
+ if( r>=0.0 && r<5373484.5 ){
+ p->iJD = (sqlite3_int64)(r*86400000.0 + 0.5);
+ p->validJD = 1;
+ }
+}
+
+/*
+** Attempt to parse the given string into a julian day number. Return
+** the number of errors.
+**
+** The following are acceptable forms for the input string:
+**
+** YYYY-MM-DD HH:MM:SS.FFF +/-HH:MM
+** DDDD.DD
+** now
+**
+** In the first form, the +/-HH:MM is always optional. The fractional
+** seconds extension (the ".FFF") is optional. The seconds portion
+** (":SS.FFF") is option. The year and date can be omitted as long
+** as there is a time string. The time string can be omitted as long
+** as there is a year and date.
+*/
+static int parseDateOrTime(
+ sqlite3_context *context,
+ const char *zDate,
+ DateTime *p
+){
+ double r;
+ if( parseYyyyMmDd(zDate,p)==0 ){
+ return 0;
+ }else if( parseHhMmSs(zDate, p)==0 ){
+ return 0;
+ }else if( sqlite3StrICmp(zDate,"now")==0 && sqlite3NotPureFunc(context) ){
+ return setDateTimeToCurrent(context, p);
+ }else if( sqlite3AtoF(zDate, &r, sqlite3Strlen30(zDate), SQLITE_UTF8)>0 ){
+ setRawDateNumber(p, r);
+ return 0;
+ }else if( (sqlite3StrICmp(zDate,"subsec")==0
+ || sqlite3StrICmp(zDate,"subsecond")==0)
+ && sqlite3NotPureFunc(context) ){
+ p->useSubsec = 1;
+ return setDateTimeToCurrent(context, p);
+ }
+ return 1;
+}
+
+/* The julian day number for 9999-12-31 23:59:59.999 is 5373484.4999999.
+** Multiplying this by 86400000 gives 464269060799999 as the maximum value
+** for DateTime.iJD.
+**
+** But some older compilers (ex: gcc 4.2.1 on older Macs) cannot deal with
+** such a large integer literal, so we have to encode it.
+*/
+#define INT_464269060799999 ((((i64)0x1a640)<<32)|0x1072fdff)
+
+/*
+** Return TRUE if the given julian day number is within range.
+**
+** The input is the JulianDay times 86400000.
+*/
+static int validJulianDay(sqlite3_int64 iJD){
+ return iJD>=0 && iJD<=INT_464269060799999;
+}
+
+/*
+** Compute the Year, Month, and Day from the julian day number.
+*/
+static void computeYMD(DateTime *p){
+ int Z, alpha, A, B, C, D, E, X1;
+ if( p->validYMD ) return;
+ if( !p->validJD ){
+ p->Y = 2000;
+ p->M = 1;
+ p->D = 1;
+ }else if( !validJulianDay(p->iJD) ){
+ datetimeError(p);
+ return;
+ }else{
+ Z = (int)((p->iJD + 43200000)/86400000);
+ alpha = (int)((Z + 32044.75)/36524.25) - 52;
+ A = Z + 1 + alpha - ((alpha+100)/4) + 25;
+ B = A + 1524;
+ C = (int)((B - 122.1)/365.25);
+ D = (36525*(C&32767))/100;
+ E = (int)((B-D)/30.6001);
+ X1 = (int)(30.6001*E);
+ p->D = B - D - X1;
+ p->M = E<14 ? E-1 : E-13;
+ p->Y = p->M>2 ? C - 4716 : C - 4715;
+ }
+ p->validYMD = 1;
+}
+
+/*
+** Compute the Hour, Minute, and Seconds from the julian day number.
+*/
+static void computeHMS(DateTime *p){
+ int day_ms, day_min; /* milliseconds, minutes into the day */
+ if( p->validHMS ) return;
+ computeJD(p);
+ day_ms = (int)((p->iJD + 43200000) % 86400000);
+ p->s = (day_ms % 60000)/1000.0;
+ day_min = day_ms/60000;
+ p->m = day_min % 60;
+ p->h = day_min / 60;
+ p->rawS = 0;
+ p->validHMS = 1;
+}
+
+/*
+** Compute both YMD and HMS
+*/
+static void computeYMD_HMS(DateTime *p){
+ computeYMD(p);
+ computeHMS(p);
+}
+
+/*
+** Clear the YMD and HMS and the TZ
+*/
+static void clearYMD_HMS_TZ(DateTime *p){
+ p->validYMD = 0;
+ p->validHMS = 0;
+ p->tz = 0;
+}
+
+#ifndef SQLITE_OMIT_LOCALTIME
+/*
+** On recent Windows platforms, the localtime_s() function is available
+** as part of the "Secure CRT". It is essentially equivalent to
+** localtime_r() available under most POSIX platforms, except that the
+** order of the parameters is reversed.
+**
+** See http://msdn.microsoft.com/en-us/library/a442x3ye(VS.80).aspx.
+**
+** If the user has not indicated to use localtime_r() or localtime_s()
+** already, check for an MSVC build environment that provides
+** localtime_s().
+*/
+#if !HAVE_LOCALTIME_R && !HAVE_LOCALTIME_S \
+ && defined(_MSC_VER) && defined(_CRT_INSECURE_DEPRECATE)
+#undef HAVE_LOCALTIME_S
+#define HAVE_LOCALTIME_S 1
+#endif
+
+/*
+** The following routine implements the rough equivalent of localtime_r()
+** using whatever operating-system specific localtime facility that
+** is available. This routine returns 0 on success and
+** non-zero on any kind of error.
+**
+** If the sqlite3GlobalConfig.bLocaltimeFault variable is non-zero then this
+** routine will always fail. If bLocaltimeFault is nonzero and
+** sqlite3GlobalConfig.xAltLocaltime is not NULL, then xAltLocaltime() is
+** invoked in place of the OS-defined localtime() function.
+**
+** EVIDENCE-OF: R-62172-00036 In this implementation, the standard C
+** library function localtime_r() is used to assist in the calculation of
+** local time.
+*/
+static int osLocaltime(time_t *t, struct tm *pTm){
+ int rc;
+#if !HAVE_LOCALTIME_R && !HAVE_LOCALTIME_S
+ struct tm *pX;
+#if SQLITE_THREADSAFE>0
+ sqlite3_mutex *mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MAIN);
+#endif
+ sqlite3_mutex_enter(mutex);
+ pX = localtime(t);
+#ifndef SQLITE_UNTESTABLE
+ if( sqlite3GlobalConfig.bLocaltimeFault ){
+ if( sqlite3GlobalConfig.xAltLocaltime!=0
+ && 0==sqlite3GlobalConfig.xAltLocaltime((const void*)t,(void*)pTm)
+ ){
+ pX = pTm;
+ }else{
+ pX = 0;
+ }
+ }
+#endif
+ if( pX ) *pTm = *pX;
+#if SQLITE_THREADSAFE>0
+ sqlite3_mutex_leave(mutex);
+#endif
+ rc = pX==0;
+#else
+#ifndef SQLITE_UNTESTABLE
+ if( sqlite3GlobalConfig.bLocaltimeFault ){
+ if( sqlite3GlobalConfig.xAltLocaltime!=0 ){
+ return sqlite3GlobalConfig.xAltLocaltime((const void*)t,(void*)pTm);
+ }else{
+ return 1;
+ }
+ }
+#endif
+#if HAVE_LOCALTIME_R
+ rc = localtime_r(t, pTm)==0;
+#else
+ rc = localtime_s(pTm, t);
+#endif /* HAVE_LOCALTIME_R */
+#endif /* HAVE_LOCALTIME_R || HAVE_LOCALTIME_S */
+ return rc;
+}
+#endif /* SQLITE_OMIT_LOCALTIME */
+
+
+#ifndef SQLITE_OMIT_LOCALTIME
+/*
+** Assuming the input DateTime is UTC, move it to its localtime equivalent.
+*/
+static int toLocaltime(
+ DateTime *p, /* Date at which to calculate offset */
+ sqlite3_context *pCtx /* Write error here if one occurs */
+){
+ time_t t;
+ struct tm sLocal;
+ int iYearDiff;
+
+ /* Initialize the contents of sLocal to avoid a compiler warning. */
+ memset(&sLocal, 0, sizeof(sLocal));
+
+ computeJD(p);
+ if( p->iJD<2108667600*(i64)100000 /* 1970-01-01 */
+ || p->iJD>2130141456*(i64)100000 /* 2038-01-18 */
+ ){
+ /* EVIDENCE-OF: R-55269-29598 The localtime_r() C function normally only
+ ** works for years between 1970 and 2037. For dates outside this range,
+ ** SQLite attempts to map the year into an equivalent year within this
+ ** range, do the calculation, then map the year back.
+ */
+ DateTime x = *p;
+ computeYMD_HMS(&x);
+ iYearDiff = (2000 + x.Y%4) - x.Y;
+ x.Y += iYearDiff;
+ x.validJD = 0;
+ computeJD(&x);
+ t = (time_t)(x.iJD/1000 - 21086676*(i64)10000);
+ }else{
+ iYearDiff = 0;
+ t = (time_t)(p->iJD/1000 - 21086676*(i64)10000);
+ }
+ if( osLocaltime(&t, &sLocal) ){
+ sqlite3_result_error(pCtx, "local time unavailable", -1);
+ return SQLITE_ERROR;
+ }
+ p->Y = sLocal.tm_year + 1900 - iYearDiff;
+ p->M = sLocal.tm_mon + 1;
+ p->D = sLocal.tm_mday;
+ p->h = sLocal.tm_hour;
+ p->m = sLocal.tm_min;
+ p->s = sLocal.tm_sec + (p->iJD%1000)*0.001;
+ p->validYMD = 1;
+ p->validHMS = 1;
+ p->validJD = 0;
+ p->rawS = 0;
+ p->tz = 0;
+ p->isError = 0;
+ return SQLITE_OK;
+}
+#endif /* SQLITE_OMIT_LOCALTIME */
+
+/*
+** The following table defines various date transformations of the form
+**
+** 'NNN days'
+**
+** Where NNN is an arbitrary floating-point number and "days" can be one
+** of several units of time.
+*/
+static const struct {
+ u8 nName; /* Length of the name */
+ char zName[7]; /* Name of the transformation */
+ float rLimit; /* Maximum NNN value for this transform */
+ float rXform; /* Constant used for this transform */
+} aXformType[] = {
+ /* 0 */ { 6, "second", 4.6427e+14, 1.0 },
+ /* 1 */ { 6, "minute", 7.7379e+12, 60.0 },
+ /* 2 */ { 4, "hour", 1.2897e+11, 3600.0 },
+ /* 3 */ { 3, "day", 5373485.0, 86400.0 },
+ /* 4 */ { 5, "month", 176546.0, 2592000.0 },
+ /* 5 */ { 4, "year", 14713.0, 31536000.0 },
+};
+
+/*
+** If the DateTime p is raw number, try to figure out if it is
+** a julian day number of a unix timestamp. Set the p value
+** appropriately.
+*/
+static void autoAdjustDate(DateTime *p){
+ if( !p->rawS || p->validJD ){
+ p->rawS = 0;
+ }else if( p->s>=-21086676*(i64)10000 /* -4713-11-24 12:00:00 */
+ && p->s<=(25340230*(i64)10000)+799 /* 9999-12-31 23:59:59 */
+ ){
+ double r = p->s*1000.0 + 210866760000000.0;
+ clearYMD_HMS_TZ(p);
+ p->iJD = (sqlite3_int64)(r + 0.5);
+ p->validJD = 1;
+ p->rawS = 0;
+ }
+}
+
+/*
+** Process a modifier to a date-time stamp. The modifiers are
+** as follows:
+**
+** NNN days
+** NNN hours
+** NNN minutes
+** NNN.NNNN seconds
+** NNN months
+** NNN years
+** +/-YYYY-MM-DD HH:MM:SS.SSS
+** ceiling
+** floor
+** start of month
+** start of year
+** start of week
+** start of day
+** weekday N
+** unixepoch
+** auto
+** localtime
+** utc
+** subsec
+** subsecond
+**
+** Return 0 on success and 1 if there is any kind of error. If the error
+** is in a system call (i.e. localtime()), then an error message is written
+** to context pCtx. If the error is an unrecognized modifier, no error is
+** written to pCtx.
+*/
+static int parseModifier(
+ sqlite3_context *pCtx, /* Function context */
+ const char *z, /* The text of the modifier */
+ int n, /* Length of zMod in bytes */
+ DateTime *p, /* The date/time value to be modified */
+ int idx /* Parameter index of the modifier */
+){
+ int rc = 1;
+ double r;
+ switch(sqlite3UpperToLower[(u8)z[0]] ){
+ case 'a': {
+ /*
+ ** auto
+ **
+ ** If rawS is available, then interpret as a julian day number, or
+ ** a unix timestamp, depending on its magnitude.
+ */
+ if( sqlite3_stricmp(z, "auto")==0 ){
+ if( idx>1 ) return 1; /* IMP: R-33611-57934 */
+ autoAdjustDate(p);
+ rc = 0;
+ }
+ break;
+ }
+ case 'c': {
+ /*
+ ** ceiling
+ **
+ ** Resolve day-of-month overflow by rolling forward into the next
+ ** month. As this is the default action, this modifier is really
+ ** a no-op that is only included for symmetry. See "floor".
+ */
+ if( sqlite3_stricmp(z, "ceiling")==0 ){
+ computeJD(p);
+ clearYMD_HMS_TZ(p);
+ rc = 0;
+ p->nFloor = 0;
+ }
+ break;
+ }
+ case 'f': {
+ /*
+ ** floor
+ **
+ ** Resolve day-of-month overflow by rolling back to the end of the
+ ** previous month.
+ */
+ if( sqlite3_stricmp(z, "floor")==0 ){
+ computeJD(p);
+ p->iJD -= p->nFloor*86400000;
+ clearYMD_HMS_TZ(p);
+ rc = 0;
+ }
+ break;
+ }
+ case 'j': {
+ /*
+ ** julianday
+ **
+ ** Always interpret the prior number as a julian-day value. If this
+ ** is not the first modifier, or if the prior argument is not a numeric
+ ** value in the allowed range of julian day numbers understood by
+ ** SQLite (0..5373484.5) then the result will be NULL.
+ */
+ if( sqlite3_stricmp(z, "julianday")==0 ){
+ if( idx>1 ) return 1; /* IMP: R-31176-64601 */
+ if( p->validJD && p->rawS ){
+ rc = 0;
+ p->rawS = 0;
+ }
+ }
+ break;
+ }
+#ifndef SQLITE_OMIT_LOCALTIME
+ case 'l': {
+ /* localtime
+ **
+ ** Assuming the current time value is UTC (a.k.a. GMT), shift it to
+ ** show local time.
+ */
+ if( sqlite3_stricmp(z, "localtime")==0 && sqlite3NotPureFunc(pCtx) ){
+ rc = p->isLocal ? SQLITE_OK : toLocaltime(p, pCtx);
+ p->isUtc = 0;
+ p->isLocal = 1;
+ }
+ break;
+ }
+#endif
+ case 'u': {
+ /*
+ ** unixepoch
+ **
+ ** Treat the current value of p->s as the number of
+ ** seconds since 1970. Convert to a real julian day number.
+ */
+ if( sqlite3_stricmp(z, "unixepoch")==0 && p->rawS ){
+ if( idx>1 ) return 1; /* IMP: R-49255-55373 */
+ r = p->s*1000.0 + 210866760000000.0;
+ if( r>=0.0 && r<464269060800000.0 ){
+ clearYMD_HMS_TZ(p);
+ p->iJD = (sqlite3_int64)(r + 0.5);
+ p->validJD = 1;
+ p->rawS = 0;
+ rc = 0;
+ }
+ }
+#ifndef SQLITE_OMIT_LOCALTIME
+ else if( sqlite3_stricmp(z, "utc")==0 && sqlite3NotPureFunc(pCtx) ){
+ if( p->isUtc==0 ){
+ i64 iOrigJD; /* Original localtime */
+ i64 iGuess; /* Guess at the corresponding utc time */
+ int cnt = 0; /* Safety to prevent infinite loop */
+ i64 iErr; /* Guess is off by this much */
+
+ computeJD(p);
+ iGuess = iOrigJD = p->iJD;
+ iErr = 0;
+ do{
+ DateTime new;
+ memset(&new, 0, sizeof(new));
+ iGuess -= iErr;
+ new.iJD = iGuess;
+ new.validJD = 1;
+ rc = toLocaltime(&new, pCtx);
+ if( rc ) return rc;
+ computeJD(&new);
+ iErr = new.iJD - iOrigJD;
+ }while( iErr && cnt++<3 );
+ memset(p, 0, sizeof(*p));
+ p->iJD = iGuess;
+ p->validJD = 1;
+ p->isUtc = 1;
+ p->isLocal = 0;
+ }
+ rc = SQLITE_OK;
+ }
+#endif
+ break;
+ }
+ case 'w': {
+ /*
+ ** weekday N
+ **
+ ** Move the date to the same time on the next occurrence of
+ ** weekday N where 0==Sunday, 1==Monday, and so forth. If the
+ ** date is already on the appropriate weekday, this is a no-op.
+ */
+ if( sqlite3_strnicmp(z, "weekday ", 8)==0
+ && sqlite3AtoF(&z[8], &r, sqlite3Strlen30(&z[8]), SQLITE_UTF8)>0
+ && r>=0.0 && r<7.0 && (n=(int)r)==r ){
+ sqlite3_int64 Z;
+ computeYMD_HMS(p);
+ p->tz = 0;
+ p->validJD = 0;
+ computeJD(p);
+ Z = ((p->iJD + 129600000)/86400000) % 7;
+ if( Z>n ) Z -= 7;
+ p->iJD += (n - Z)*86400000;
+ clearYMD_HMS_TZ(p);
+ rc = 0;
+ }
+ break;
+ }
+ case 's': {
+ /*
+ ** start of TTTTT
+ **
+ ** Move the date backwards to the beginning of the current day,
+ ** or month or year.
+ **
+ ** subsecond
+ ** subsec
+ **
+ ** Show subsecond precision in the output of datetime() and
+ ** unixepoch() and strftime('%s').
+ */
+ if( sqlite3_strnicmp(z, "start of ", 9)!=0 ){
+ if( sqlite3_stricmp(z, "subsec")==0
+ || sqlite3_stricmp(z, "subsecond")==0
+ ){
+ p->useSubsec = 1;
+ rc = 0;
+ }
+ break;
+ }
+ if( !p->validJD && !p->validYMD && !p->validHMS ) break;
+ z += 9;
+ computeYMD(p);
+ p->validHMS = 1;
+ p->h = p->m = 0;
+ p->s = 0.0;
+ p->rawS = 0;
+ p->tz = 0;
+ p->validJD = 0;
+ if( sqlite3_stricmp(z,"month")==0 ){
+ p->D = 1;
+ rc = 0;
+ }else if( sqlite3_stricmp(z,"year")==0 ){
+ p->M = 1;
+ p->D = 1;
+ rc = 0;
+ }else if( sqlite3_stricmp(z,"day")==0 ){
+ rc = 0;
+ }
+ break;
+ }
+ case '+':
+ case '-':
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': {
+ double rRounder;
+ int i;
+ int Y,M,D,h,m,x;
+ const char *z2 = z;
+ char z0 = z[0];
+ for(n=1; z[n]; n++){
+ if( z[n]==':' ) break;
+ if( sqlite3Isspace(z[n]) ) break;
+ if( z[n]=='-' ){
+ if( n==5 && getDigits(&z[1], "40f", &Y)==1 ) break;
+ if( n==6 && getDigits(&z[1], "50f", &Y)==1 ) break;
+ }
+ }
+ if( sqlite3AtoF(z, &r, n, SQLITE_UTF8)<=0 ){
+ assert( rc==1 );
+ break;
+ }
+ if( z[n]=='-' ){
+ /* A modifier of the form (+|-)YYYY-MM-DD adds or subtracts the
+ ** specified number of years, months, and days. MM is limited to
+ ** the range 0-11 and DD is limited to 0-30.
+ */
+ if( z0!='+' && z0!='-' ) break; /* Must start with +/- */
+ if( n==5 ){
+ if( getDigits(&z[1], "40f-20a-20d", &Y, &M, &D)!=3 ) break;
+ }else{
+ assert( n==6 );
+ if( getDigits(&z[1], "50f-20a-20d", &Y, &M, &D)!=3 ) break;
+ z++;
+ }
+ if( M>=12 ) break; /* M range 0..11 */
+ if( D>=31 ) break; /* D range 0..30 */
+ computeYMD_HMS(p);
+ p->validJD = 0;
+ if( z0=='-' ){
+ p->Y -= Y;
+ p->M -= M;
+ D = -D;
+ }else{
+ p->Y += Y;
+ p->M += M;
+ }
+ x = p->M>0 ? (p->M-1)/12 : (p->M-12)/12;
+ p->Y += x;
+ p->M -= x*12;
+ computeFloor(p);
+ computeJD(p);
+ p->validHMS = 0;
+ p->validYMD = 0;
+ p->iJD += (i64)D*86400000;
+ if( z[11]==0 ){
+ rc = 0;
+ break;
+ }
+ if( sqlite3Isspace(z[11])
+ && getDigits(&z[12], "20c:20e", &h, &m)==2
+ ){
+ z2 = &z[12];
+ n = 2;
+ }else{
+ break;
+ }
+ }
+ if( z2[n]==':' ){
+ /* A modifier of the form (+|-)HH:MM:SS.FFF adds (or subtracts) the
+ ** specified number of hours, minutes, seconds, and fractional seconds
+ ** to the time. The ".FFF" may be omitted. The ":SS.FFF" may be
+ ** omitted.
+ */
+
+ DateTime tx;
+ sqlite3_int64 day;
+ if( !sqlite3Isdigit(*z2) ) z2++;
+ memset(&tx, 0, sizeof(tx));
+ if( parseHhMmSs(z2, &tx) ) break;
+ computeJD(&tx);
+ tx.iJD -= 43200000;
+ day = tx.iJD/86400000;
+ tx.iJD -= day*86400000;
+ if( z0=='-' ) tx.iJD = -tx.iJD;
+ computeJD(p);
+ clearYMD_HMS_TZ(p);
+ p->iJD += tx.iJD;
+ rc = 0;
+ break;
+ }
+
+ /* If control reaches this point, it means the transformation is
+ ** one of the forms like "+NNN days". */
+ z += n;
+ while( sqlite3Isspace(*z) ) z++;
+ n = sqlite3Strlen30(z);
+ if( n<3 || n>10 ) break;
+ if( sqlite3UpperToLower[(u8)z[n-1]]=='s' ) n--;
+ computeJD(p);
+ assert( rc==1 );
+ rRounder = r<0 ? -0.5 : +0.5;
+ p->nFloor = 0;
+ for(i=0; i-aXformType[i].rLimit && rM += (int)r;
+ x = p->M>0 ? (p->M-1)/12 : (p->M-12)/12;
+ p->Y += x;
+ p->M -= x*12;
+ computeFloor(p);
+ p->validJD = 0;
+ r -= (int)r;
+ break;
+ }
+ case 5: { /* Special processing to add years */
+ int y = (int)r;
+ assert( strcmp(aXformType[5].zName,"year")==0 );
+ computeYMD_HMS(p);
+ assert( p->M>=0 && p->M<=12 );
+ p->Y += y;
+ computeFloor(p);
+ p->validJD = 0;
+ r -= (int)r;
+ break;
+ }
+ }
+ computeJD(p);
+ p->iJD += (sqlite3_int64)(r*1000.0*aXformType[i].rXform + rRounder);
+ rc = 0;
+ break;
+ }
+ }
+ clearYMD_HMS_TZ(p);
+ break;
+ }
+ default: {
+ break;
+ }
+ }
+ return rc;
+}
+
+/*
+** Process time function arguments. argv[0] is a date-time stamp.
+** argv[1] and following are modifiers. Parse them all and write
+** the resulting time into the DateTime structure p. Return 0
+** on success and 1 if there are any errors.
+**
+** If there are zero parameters (if even argv[0] is undefined)
+** then assume a default value of "now" for argv[0].
+*/
+static int isDate(
+ sqlite3_context *context,
+ int argc,
+ sqlite3_value **argv,
+ DateTime *p
+){
+ int i, n;
+ const unsigned char *z;
+ int eType;
+ memset(p, 0, sizeof(*p));
+ if( argc==0 ){
+ if( !sqlite3NotPureFunc(context) ) return 1;
+ return setDateTimeToCurrent(context, p);
+ }
+ if( (eType = sqlite3_value_type(argv[0]))==SQLITE_FLOAT
+ || eType==SQLITE_INTEGER ){
+ setRawDateNumber(p, sqlite3_value_double(argv[0]));
+ }else{
+ z = sqlite3_value_text(argv[0]);
+ if( !z || parseDateOrTime(context, (char*)z, p) ){
+ return 1;
+ }
+ }
+ for(i=1; iisError || !validJulianDay(p->iJD) ) return 1;
+ if( argc==1 && p->validYMD && p->D>28 ){
+ /* Make sure a YYYY-MM-DD is normalized.
+ ** Example: 2023-02-31 -> 2023-03-03 */
+ assert( p->validJD );
+ p->validYMD = 0;
+ }
+ return 0;
+}
+
+
+/*
+** The following routines implement the various date and time functions
+** of SQLite.
+*/
+
+/*
+** julianday( TIMESTRING, MOD, MOD, ...)
+**
+** Return the julian day number of the date specified in the arguments
+*/
+static void juliandayFunc(
+ sqlite3_context *context,
+ int argc,
+ sqlite3_value **argv
+){
+ DateTime x;
+ if( isDate(context, argc, argv, &x)==0 ){
+ computeJD(&x);
+ sqlite3_result_double(context, x.iJD/86400000.0);
+ }
+}
+
+/*
+** unixepoch( TIMESTRING, MOD, MOD, ...)
+**
+** Return the number of seconds (including fractional seconds) since
+** the unix epoch of 1970-01-01 00:00:00 GMT.
+*/
+static void unixepochFunc(
+ sqlite3_context *context,
+ int argc,
+ sqlite3_value **argv
+){
+ DateTime x;
+ if( isDate(context, argc, argv, &x)==0 ){
+ computeJD(&x);
+ if( x.useSubsec ){
+ sqlite3_result_double(context, (x.iJD - 21086676*(i64)10000000)/1000.0);
+ }else{
+ sqlite3_result_int64(context, x.iJD/1000 - 21086676*(i64)10000);
+ }
+ }
+}
+
+/*
+** datetime( TIMESTRING, MOD, MOD, ...)
+**
+** Return YYYY-MM-DD HH:MM:SS
+*/
+static void datetimeFunc(
+ sqlite3_context *context,
+ int argc,
+ sqlite3_value **argv
+){
+ DateTime x;
+ if( isDate(context, argc, argv, &x)==0 ){
+ int Y, s, n;
+ char zBuf[32];
+ computeYMD_HMS(&x);
+ Y = x.Y;
+ if( Y<0 ) Y = -Y;
+ zBuf[1] = '0' + (Y/1000)%10;
+ zBuf[2] = '0' + (Y/100)%10;
+ zBuf[3] = '0' + (Y/10)%10;
+ zBuf[4] = '0' + (Y)%10;
+ zBuf[5] = '-';
+ zBuf[6] = '0' + (x.M/10)%10;
+ zBuf[7] = '0' + (x.M)%10;
+ zBuf[8] = '-';
+ zBuf[9] = '0' + (x.D/10)%10;
+ zBuf[10] = '0' + (x.D)%10;
+ zBuf[11] = ' ';
+ zBuf[12] = '0' + (x.h/10)%10;
+ zBuf[13] = '0' + (x.h)%10;
+ zBuf[14] = ':';
+ zBuf[15] = '0' + (x.m/10)%10;
+ zBuf[16] = '0' + (x.m)%10;
+ zBuf[17] = ':';
+ if( x.useSubsec ){
+ s = (int)(1000.0*x.s + 0.5);
+ zBuf[18] = '0' + (s/10000)%10;
+ zBuf[19] = '0' + (s/1000)%10;
+ zBuf[20] = '.';
+ zBuf[21] = '0' + (s/100)%10;
+ zBuf[22] = '0' + (s/10)%10;
+ zBuf[23] = '0' + (s)%10;
+ zBuf[24] = 0;
+ n = 24;
+ }else{
+ s = (int)x.s;
+ zBuf[18] = '0' + (s/10)%10;
+ zBuf[19] = '0' + (s)%10;
+ zBuf[20] = 0;
+ n = 20;
+ }
+ if( x.Y<0 ){
+ zBuf[0] = '-';
+ sqlite3_result_text(context, zBuf, n, SQLITE_TRANSIENT);
+ }else{
+ sqlite3_result_text(context, &zBuf[1], n-1, SQLITE_TRANSIENT);
+ }
+ }
+}
+
+/*
+** time( TIMESTRING, MOD, MOD, ...)
+**
+** Return HH:MM:SS
+*/
+static void timeFunc(
+ sqlite3_context *context,
+ int argc,
+ sqlite3_value **argv
+){
+ DateTime x;
+ if( isDate(context, argc, argv, &x)==0 ){
+ int s, n;
+ char zBuf[16];
+ computeHMS(&x);
+ zBuf[0] = '0' + (x.h/10)%10;
+ zBuf[1] = '0' + (x.h)%10;
+ zBuf[2] = ':';
+ zBuf[3] = '0' + (x.m/10)%10;
+ zBuf[4] = '0' + (x.m)%10;
+ zBuf[5] = ':';
+ if( x.useSubsec ){
+ s = (int)(1000.0*x.s + 0.5);
+ zBuf[6] = '0' + (s/10000)%10;
+ zBuf[7] = '0' + (s/1000)%10;
+ zBuf[8] = '.';
+ zBuf[9] = '0' + (s/100)%10;
+ zBuf[10] = '0' + (s/10)%10;
+ zBuf[11] = '0' + (s)%10;
+ zBuf[12] = 0;
+ n = 12;
+ }else{
+ s = (int)x.s;
+ zBuf[6] = '0' + (s/10)%10;
+ zBuf[7] = '0' + (s)%10;
+ zBuf[8] = 0;
+ n = 8;
+ }
+ sqlite3_result_text(context, zBuf, n, SQLITE_TRANSIENT);
+ }
+}
+
+/*
+** date( TIMESTRING, MOD, MOD, ...)
+**
+** Return YYYY-MM-DD
+*/
+static void dateFunc(
+ sqlite3_context *context,
+ int argc,
+ sqlite3_value **argv
+){
+ DateTime x;
+ if( isDate(context, argc, argv, &x)==0 ){
+ int Y;
+ char zBuf[16];
+ computeYMD(&x);
+ Y = x.Y;
+ if( Y<0 ) Y = -Y;
+ zBuf[1] = '0' + (Y/1000)%10;
+ zBuf[2] = '0' + (Y/100)%10;
+ zBuf[3] = '0' + (Y/10)%10;
+ zBuf[4] = '0' + (Y)%10;
+ zBuf[5] = '-';
+ zBuf[6] = '0' + (x.M/10)%10;
+ zBuf[7] = '0' + (x.M)%10;
+ zBuf[8] = '-';
+ zBuf[9] = '0' + (x.D/10)%10;
+ zBuf[10] = '0' + (x.D)%10;
+ zBuf[11] = 0;
+ if( x.Y<0 ){
+ zBuf[0] = '-';
+ sqlite3_result_text(context, zBuf, 11, SQLITE_TRANSIENT);
+ }else{
+ sqlite3_result_text(context, &zBuf[1], 10, SQLITE_TRANSIENT);
+ }
+ }
+}
+
+/*
+** Compute the number of days after the most recent January 1.
+**
+** In other words, compute the zero-based day number for the
+** current year:
+**
+** Jan01 = 0, Jan02 = 1, ..., Jan31 = 30, Feb01 = 31, ...
+** Dec31 = 364 or 365.
+*/
+static int daysAfterJan01(DateTime *pDate){
+ DateTime jan01 = *pDate;
+ assert( jan01.validYMD );
+ assert( jan01.validHMS );
+ assert( pDate->validJD );
+ jan01.validJD = 0;
+ jan01.M = 1;
+ jan01.D = 1;
+ computeJD(&jan01);
+ return (int)((pDate->iJD-jan01.iJD+43200000)/86400000);
+}
+
+/*
+** Return the number of days after the most recent Monday.
+**
+** In other words, return the day of the week according
+** to this code:
+**
+** 0=Monday, 1=Tuesday, 2=Wednesday, ..., 6=Sunday.
+*/
+static int daysAfterMonday(DateTime *pDate){
+ assert( pDate->validJD );
+ return (int)((pDate->iJD+43200000)/86400000) % 7;
+}
+
+/*
+** Return the number of days after the most recent Sunday.
+**
+** In other words, return the day of the week according
+** to this code:
+**
+** 0=Sunday, 1=Monday, 2=Tuesday, ..., 6=Saturday
+*/
+static int daysAfterSunday(DateTime *pDate){
+ assert( pDate->validJD );
+ return (int)((pDate->iJD+129600000)/86400000) % 7;
+}
+
+/*
+** strftime( FORMAT, TIMESTRING, MOD, MOD, ...)
+**
+** Return a string described by FORMAT. Conversions as follows:
+**
+** %d day of month 01-31
+** %e day of month 1-31
+** %f ** fractional seconds SS.SSS
+** %F ISO date. YYYY-MM-DD
+** %G ISO year corresponding to %V 0000-9999.
+** %g 2-digit ISO year corresponding to %V 00-99
+** %H hour 00-24
+** %k hour 0-24 (leading zero converted to space)
+** %I hour 01-12
+** %j day of year 001-366
+** %J ** julian day number
+** %l hour 1-12 (leading zero converted to space)
+** %m month 01-12
+** %M minute 00-59
+** %p "am" or "pm"
+** %P "AM" or "PM"
+** %R time as HH:MM
+** %s seconds since 1970-01-01
+** %S seconds 00-59
+** %T time as HH:MM:SS
+** %u day of week 1-7 Monday==1, Sunday==7
+** %w day of week 0-6 Sunday==0, Monday==1
+** %U week of year 00-53 (First Sunday is start of week 01)
+** %V week of year 01-53 (First week containing Thursday is week 01)
+** %W week of year 00-53 (First Monday is start of week 01)
+** %Y year 0000-9999
+** %% %
+*/
+static void strftimeFunc(
+ sqlite3_context *context,
+ int argc,
+ sqlite3_value **argv
+){
+ DateTime x;
+ size_t i,j;
+ sqlite3 *db;
+ const char *zFmt;
+ sqlite3_str sRes;
+
+
+ if( argc==0 ) return;
+ zFmt = (const char*)sqlite3_value_text(argv[0]);
+ if( zFmt==0 || isDate(context, argc-1, argv+1, &x) ) return;
+ db = sqlite3_context_db_handle(context);
+ sqlite3StrAccumInit(&sRes, 0, 0, 0, db->aLimit[SQLITE_LIMIT_LENGTH]);
+
+ computeJD(&x);
+ computeYMD_HMS(&x);
+ for(i=j=0; zFmt[i]; i++){
+ char cf;
+ if( zFmt[i]!='%' ) continue;
+ if( j59.999) ) s = 59.999;
+ sqlite3_str_appendf(&sRes, "%06.3f", s);
+ break;
+ }
+ case 'F': {
+ sqlite3_str_appendf(&sRes, "%04d-%02d-%02d", x.Y, x.M, x.D);
+ break;
+ }
+ case 'G': /* Fall thru */
+ case 'g': {
+ DateTime y = x;
+ assert( y.validJD );
+ /* Move y so that it is the Thursday in the same week as x */
+ y.iJD += (3 - daysAfterMonday(&x))*86400000;
+ y.validYMD = 0;
+ computeYMD(&y);
+ if( cf=='g' ){
+ sqlite3_str_appendf(&sRes, "%02d", y.Y%100);
+ }else{
+ sqlite3_str_appendf(&sRes, "%04d", y.Y);
+ }
+ break;
+ }
+ case 'H':
+ case 'k': {
+ sqlite3_str_appendf(&sRes, cf=='H' ? "%02d" : "%2d", x.h);
+ break;
+ }
+ case 'I': /* Fall thru */
+ case 'l': {
+ int h = x.h;
+ if( h>12 ) h -= 12;
+ if( h==0 ) h = 12;
+ sqlite3_str_appendf(&sRes, cf=='I' ? "%02d" : "%2d", h);
+ break;
+ }
+ case 'j': { /* Day of year. Jan01==1, Jan02==2, and so forth */
+ sqlite3_str_appendf(&sRes,"%03d",daysAfterJan01(&x)+1);
+ break;
+ }
+ case 'J': { /* Julian day number. (Non-standard) */
+ sqlite3_str_appendf(&sRes,"%.16g",x.iJD/86400000.0);
+ break;
+ }
+ case 'm': {
+ sqlite3_str_appendf(&sRes,"%02d",x.M);
+ break;
+ }
+ case 'M': {
+ sqlite3_str_appendf(&sRes,"%02d",x.m);
+ break;
+ }
+ case 'p': /* Fall thru */
+ case 'P': {
+ if( x.h>=12 ){
+ sqlite3_str_append(&sRes, cf=='p' ? "PM" : "pm", 2);
+ }else{
+ sqlite3_str_append(&sRes, cf=='p' ? "AM" : "am", 2);
+ }
+ break;
+ }
+ case 'R': {
+ sqlite3_str_appendf(&sRes, "%02d:%02d", x.h, x.m);
+ break;
+ }
+ case 's': {
+ if( x.useSubsec ){
+ sqlite3_str_appendf(&sRes,"%.3f",
+ (x.iJD - 21086676*(i64)10000000)/1000.0);
+ }else{
+ i64 iS = (i64)(x.iJD/1000 - 21086676*(i64)10000);
+ sqlite3_str_appendf(&sRes,"%lld",iS);
+ }
+ break;
+ }
+ case 'S': {
+ sqlite3_str_appendf(&sRes,"%02d",(int)x.s);
+ break;
+ }
+ case 'T': {
+ sqlite3_str_appendf(&sRes,"%02d:%02d:%02d", x.h, x.m, (int)x.s);
+ break;
+ }
+ case 'u': /* Day of week. 1 to 7. Monday==1, Sunday==7 */
+ case 'w': { /* Day of week. 0 to 6. Sunday==0, Monday==1 */
+ char c = (char)daysAfterSunday(&x) + '0';
+ if( c=='0' && cf=='u' ) c = '7';
+ sqlite3_str_appendchar(&sRes, 1, c);
+ break;
+ }
+ case 'U': { /* Week num. 00-53. First Sun of the year is week 01 */
+ sqlite3_str_appendf(&sRes,"%02d",
+ (daysAfterJan01(&x)-daysAfterSunday(&x)+7)/7);
+ break;
+ }
+ case 'V': { /* Week num. 01-53. First week with a Thur is week 01 */
+ DateTime y = x;
+ /* Adjust y so that is the Thursday in the same week as x */
+ assert( y.validJD );
+ y.iJD += (3 - daysAfterMonday(&x))*86400000;
+ y.validYMD = 0;
+ computeYMD(&y);
+ sqlite3_str_appendf(&sRes,"%02d", daysAfterJan01(&y)/7+1);
+ break;
+ }
+ case 'W': { /* Week num. 00-53. First Mon of the year is week 01 */
+ sqlite3_str_appendf(&sRes,"%02d",
+ (daysAfterJan01(&x)-daysAfterMonday(&x)+7)/7);
+ break;
+ }
+ case 'Y': {
+ sqlite3_str_appendf(&sRes,"%04d",x.Y);
+ break;
+ }
+ case '%': {
+ sqlite3_str_appendchar(&sRes, 1, '%');
+ break;
+ }
+ default: {
+ sqlite3_str_reset(&sRes);
+ return;
+ }
+ }
+ }
+ if( j