Full Code of leok7v/ui for AI

main 0f200aeb298c cached
166 files
2.7 MB
725.4k tokens
2729 symbols
3 requests
Download .txt
Showing preview only (2,901K chars total). Download the full file or copy to clipboard to get everything.
Repository: leok7v/ui
Branch: main
Commit: 0f200aeb298c
Files: 166
Total size: 2.7 MB

Directory structure:
gitextract_fo8u23vg/

├── .github/
│   └── workflows/
│       └── build-on-push.yml
├── .gitignore
├── LICENSE
├── README.md
├── inc/
│   ├── generics.h
│   ├── rt/
│   │   ├── rt.h
│   │   ├── rt_args.h
│   │   ├── rt_atomics.h
│   │   ├── rt_backtrace.h
│   │   ├── rt_clipboard.h
│   │   ├── rt_clock.h
│   │   ├── rt_config.h
│   │   ├── rt_core.h
│   │   ├── rt_debug.h
│   │   ├── rt_files.h
│   │   ├── rt_glyphs.h
│   │   ├── rt_heap.h
│   │   ├── rt_loader.h
│   │   ├── rt_mem.h
│   │   ├── rt_nls.h
│   │   ├── rt_num.h
│   │   ├── rt_processes.h
│   │   ├── rt_static.h
│   │   ├── rt_str.h
│   │   ├── rt_streams.h
│   │   ├── rt_threads.h
│   │   ├── rt_vigil.h
│   │   ├── rt_work.h
│   │   └── version.rc.in
│   ├── ui/
│   │   ├── ui.h
│   │   ├── ui_app.h
│   │   ├── ui_button.h
│   │   ├── ui_caption.h
│   │   ├── ui_colors.h
│   │   ├── ui_containers.h
│   │   ├── ui_core.h
│   │   ├── ui_edit_doc.h
│   │   ├── ui_edit_view.h
│   │   ├── ui_fuzzing.h
│   │   ├── ui_gdi.h
│   │   ├── ui_image.h
│   │   ├── ui_label.h
│   │   ├── ui_mbx.h
│   │   ├── ui_midi.h
│   │   ├── ui_slider.h
│   │   ├── ui_theme.h
│   │   ├── ui_toggle.h
│   │   └── ui_view.h
│   ├── ut_std.h
│   └── ut_win32.h
├── msvc2022/
│   ├── .editorconfig
│   ├── amalgamate.vcxproj
│   ├── amalgamate.vcxproj.filters
│   ├── common.props
│   ├── exclusion.dic
│   ├── groot.vcxproj
│   ├── groot.vcxproj.filters
│   ├── manifest.xml
│   ├── msvc2022.vssettings
│   ├── prebuild.vcxproj
│   ├── prebuild.vcxproj.filters
│   ├── rt.vcxproj
│   ├── rt.vcxproj.filters
│   ├── sample1.vcxproj
│   ├── sample1.vcxproj.filters
│   ├── sample2.vcxproj
│   ├── sample2.vcxproj.filters
│   ├── sample3.vcxproj
│   ├── sample3.vcxproj.filters
│   ├── sample4.vcxproj
│   ├── sample4.vcxproj.filters
│   ├── sample5.vcxproj
│   ├── sample5.vcxproj.filters
│   ├── sample6.vcxproj
│   ├── sample6.vcxproj.filters
│   ├── sample7.vcxproj
│   ├── sample7.vcxproj.filters
│   ├── sample8.vcxproj
│   ├── sample8.vcxproj.filters
│   ├── sample9.vcxproj
│   ├── sample9.vcxproj.filters
│   ├── test1.vcxproj
│   ├── test1.vcxproj.filters
│   ├── test2.vcxproj
│   ├── test2.vcxproj.filters
│   ├── ui.sln
│   ├── ui.vcxproj
│   ├── ui.vcxproj.filters
│   ├── version.vcxproj
│   └── version.vcxproj.filters
├── scripts/
│   ├── clean.bat
│   └── prebuild.bat
├── single_file_lib/
│   ├── rt/
│   │   └── rt.h
│   └── ui/
│       └── ui.h
├── src/
│   ├── rt/
│   │   ├── rt.c
│   │   ├── rt_args.c
│   │   ├── rt_atomics.c
│   │   ├── rt_backtrace.c
│   │   ├── rt_clipboard.c
│   │   ├── rt_clock.c
│   │   ├── rt_config.c
│   │   ├── rt_core.c
│   │   ├── rt_debug.c
│   │   ├── rt_files.c
│   │   ├── rt_generics.c
│   │   ├── rt_heap.c
│   │   ├── rt_loader.c
│   │   ├── rt_mem.c
│   │   ├── rt_nls.c
│   │   ├── rt_num.c
│   │   ├── rt_processes.c
│   │   ├── rt_static.c
│   │   ├── rt_str.c
│   │   ├── rt_streams.c
│   │   ├── rt_threads.c
│   │   ├── rt_vigil.c
│   │   ├── rt_win32.c
│   │   └── rt_work.c
│   ├── samples/
│   │   ├── edit.test.c
│   │   ├── groot/
│   │   │   ├── groot.c
│   │   │   ├── groot.h
│   │   │   ├── groot.rc
│   │   │   └── rocket.h
│   │   ├── i18n.h
│   │   ├── mr_blue_sky.midi
│   │   ├── rt.c
│   │   ├── sample.rc
│   │   ├── sample1.c
│   │   ├── sample2.c
│   │   ├── sample3.c
│   │   ├── sample4.c
│   │   ├── sample5.c
│   │   ├── sample6.c
│   │   ├── sample6.rc
│   │   ├── sample7.c
│   │   ├── sample8.c
│   │   ├── sample9.c
│   │   ├── stb_image.c
│   │   ├── stb_image.h
│   │   └── ui.c
│   ├── tools/
│   │   ├── amalgamate.c
│   │   ├── dirent.c
│   │   ├── dirent.h
│   │   └── version.c
│   └── ui/
│       ├── attic/
│       │   └── ui_theme.c
│       ├── ui_app.c
│       ├── ui_button.c
│       ├── ui_caption.c
│       ├── ui_colors.c
│       ├── ui_containers.c
│       ├── ui_core.c
│       ├── ui_edit_doc.c
│       ├── ui_edit_view.c
│       ├── ui_fuzzing.c
│       ├── ui_gdi.c
│       ├── ui_image.c
│       ├── ui_label.c
│       ├── ui_mbx.c
│       ├── ui_midi.c
│       ├── ui_slider.c
│       ├── ui_theme.c
│       ├── ui_toggle.c
│       └── ui_view.c
└── test/
    ├── test1.c
    ├── test1.rc
    └── test2.c

================================================
FILE CONTENTS
================================================

================================================
FILE: .github/workflows/build-on-push.yml
================================================
name: build-on-push
on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]
  workflow_dispatch:
jobs:
  build:
    runs-on: windows-latest
    permissions:
      id-token: write
      contents: read
      attestations: write
    steps:
      - uses: actions/checkout@v4
        with:
          submodules: recursive
      - name: setup msbuild
        uses: microsoft/setup-msbuild@v2
      - name: build debug
        run:  msbuild msvc2022\ui.sln -t:rebuild -verbosity:quiet -property:Configuration=debug -property:Platform=x64
      - name: build release
        run:  msbuild msvc2022\ui.sln -t:rebuild -verbosity:quiet -property:Configuration=release -property:Platform=x64
      - name: short sha
        id: vars
        run: echo "sha_short=$(git rev-parse --short HEAD)"  >> $GITHUB_OUTPUT
      - name: check short sha
        run: |
            echo "sha_short: $env:sha_short"
        env:
          sha_short: ${{ steps.vars.outputs.sha_short }}
      - name: run debug tests
        run:  bin\debug\x64\test1.exe --verbosity quiet
      - name: run release tests
        run:  bin\release\x64\test1.exe --verbosity quiet
      - name: Attest Build Provenance
        uses: actions/attest-build-provenance@v1.1.2
        with:
          subject-path: 'bin\**\*.exe'
      - name: upload release artifact
        uses: actions/upload-artifact@v4
        with:
          name: ui.release.zip
          path: |
            bin\release\**\*.exe
          retention-days: 5
      - name: upload debug artifact
        uses: actions/upload-artifact@v4
        with:
          name: ui.debug.zip
          path: |
            bin\debug\**\*.exe
          retention-days: 5


================================================
FILE: .gitignore
================================================
# User files
*.vcxproj.user
inc/rt/version.h
bin/**
build/**
lib/**
msvc2022/.vs/*


================================================
FILE: LICENSE
================================================
MIT License

Copyright (c) 2022 Leo

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.


================================================
FILE: README.md
================================================
# ui

Single header libraries for building primitive UI/UX.

Win32 only implementation for now. 
Posix/MacOS/iOS/Linux/Android - possible

[![build-on-push](https://github.com/leok7v/ut/actions/workflows/build-on-push.yml/badge.svg)](https://github.com/leok7v/ut/actions/workflows/build-on-push.yml)

# Two Namespaces:

```
rt_ for minimalistic fail fast runtime
ui_ for UI types and interfaces
```

# Minimalistic "Hello" Application Example

```c
#include "ui/ui.h"
#include "rt/rt.h"

static ui_label_t label = ui_label(0.0, "Hello");

static void opened(void) {
    ui_view.add(ui_app.view, &label, null);
}

static void init(void) {
    ui_app.title = "Sample";
    ui_app.opened = opened;
}

ui_app_t ui_app = {
    .class_name = "sample",
    .init = init,
    .window_sizing = {
        .ini_w = 4.0f, // 4x2 inches
        .ini_h = 2.0f
    }
};
```


================================================
FILE: inc/generics.h
================================================
#pragma once
#include "rt/rt_std.h"

rt_begin_c

// Most of ut/ui code is written the way of min(a,b) max(a,b)
// not having side effects on the arguments and thus evaluating
// them twice ain't a big deal. However, out of curiosity of
// usefulness of Generic() in C11 standard here is type-safe
// single evaluation of the arguments version of what could
// have been simple minimum and maximum macro definitions.
// Type safety comes with the cost of complexity in puritan
// or stoic language like C:

static inline int8_t   rt_max_int8(int8_t x, int8_t y)       { return x > y ? x : y; }
static inline int16_t  rt_max_int16(int16_t x, int16_t y)    { return x > y ? x : y; }
static inline int32_t  rt_max_int32(int32_t x, int32_t y)    { return x > y ? x : y; }
static inline int64_t  rt_max_int64(int64_t x, int64_t y)    { return x > y ? x : y; }
static inline uint8_t  rt_max_uint8(uint8_t x, uint8_t y)    { return x > y ? x : y; }
static inline uint16_t rt_max_uint16(uint16_t x, uint16_t y) { return x > y ? x : y; }
static inline uint32_t rt_max_uint32(uint32_t x, uint32_t y) { return x > y ? x : y; }
static inline uint64_t rt_max_uint64(uint64_t x, uint64_t y) { return x > y ? x : y; }
static inline fp32_t   rt_max_fp32(fp32_t x, fp32_t y)       { return x > y ? x : y; }
static inline fp64_t   rt_max_fp64(fp64_t x, fp64_t y)       { return x > y ? x : y; }

// MS cl.exe version 19.39.33523 has issues with "long":
// does not pick up int32_t/uint32_t types for "long" and "unsigned long"
// need to handle long / unsigned long separately:

static inline long          rt_max_long(long x, long y)                    { return x > y ? x : y; }
static inline unsigned long rt_max_ulong(unsigned long x, unsigned long y) { return x > y ? x : y; }

static inline int8_t   rt_min_int8(int8_t x, int8_t y)       { return x < y ? x : y; }
static inline int16_t  rt_min_int16(int16_t x, int16_t y)    { return x < y ? x : y; }
static inline int32_t  rt_min_int32(int32_t x, int32_t y)    { return x < y ? x : y; }
static inline int64_t  rt_min_int64(int64_t x, int64_t y)    { return x < y ? x : y; }
static inline uint8_t  rt_min_uint8(uint8_t x, uint8_t y)    { return x < y ? x : y; }
static inline uint16_t rt_min_uint16(uint16_t x, uint16_t y) { return x < y ? x : y; }
static inline uint32_t rt_min_uint32(uint32_t x, uint32_t y) { return x < y ? x : y; }
static inline uint64_t rt_min_uint64(uint64_t x, uint64_t y) { return x < y ? x : y; }
static inline fp32_t   rt_min_fp32(fp32_t x, fp32_t y)       { return x < y ? x : y; }
static inline fp64_t   rt_min_fp64(fp64_t x, fp64_t y)       { return x < y ? x : y; }

static inline long          rt_min_long(long x, long y)                    { return x < y ? x : y; }
static inline unsigned long rt_min_ulong(unsigned long x, unsigned long y) { return x < y ? x : y; }


static inline void rt_min_undefined(void) { }
static inline void rt_max_undefined(void) { }

#define rt_max(X, Y) _Generic((X) + (Y), \
    int8_t:   rt_max_int8,   \
    int16_t:  rt_max_int16,  \
    int32_t:  rt_max_int32,  \
    int64_t:  rt_max_int64,  \
    uint8_t:  rt_max_uint8,  \
    uint16_t: rt_max_uint16, \
    uint32_t: rt_max_uint32, \
    uint64_t: rt_max_uint64, \
    fp32_t:   rt_max_fp32,   \
    fp64_t:   rt_max_fp64,   \
    long:     rt_max_long,   \
    unsigned long: rt_max_ulong, \
    default:  rt_max_undefined)(X, Y)

#define rt_min(X, Y) _Generic((X) + (Y), \
    int8_t:   rt_min_int8,   \
    int16_t:  rt_min_int16,  \
    int32_t:  rt_min_int32,  \
    int64_t:  rt_min_int64,  \
    uint8_t:  rt_min_uint8,  \
    uint16_t: rt_min_uint16, \
    uint32_t: rt_min_uint32, \
    uint64_t: rt_min_uint64, \
    fp32_t:   rt_min_fp32,   \
    fp64_t:   rt_min_fp64,   \
    long:     rt_min_long,   \
    unsigned long: rt_min_ulong, \
    default:  rt_min_undefined)(X, Y)

// The expression (X) + (Y) is used in _Generic primarily for type promotion
// and compatibility between different types of the two operands. In C, when
// you perform an arithmetic operation like addition between two variables,
// the types of these variables undergo implicit conversions to a common type
// according to the usual arithmetic conversions defined in the C standard.
// This helps ensure that:
//
// Type Compatibility: The macro works correctly even if X and Y are of
// different types. By using (X) + (Y), both X and Y are promoted to a common
// type, which ensures that the macro selects the appropriate function
// that can handle this common type.
//
// Type Safety: It ensures that the selected function can handle the type
// resulting from the operation, thereby preventing type mismatches that
// could lead to undefined behavior or compilation errors.

typedef struct {
    void (*test)(void);
} rt_generics_if;

extern rt_generics_if rt_generics;

rt_end_c


================================================
FILE: inc/rt/rt.h
================================================
#pragma once
#include "rt/rt_std.h" // must be first
#include "rt/rt_str.h" // defines str_*_t types
// the rest is in alphabetical order (no inter dependencies)
#include "rt/rt_args.h"
#include "rt/rt_backtrace.h"
#include "rt/rt_atomics.h"
#include "rt/rt_clipboard.h"
#include "rt/rt_clock.h"
#include "rt/rt_config.h"
#include "rt/rt_core.h"
#include "rt/rt_debug.h"
#include "rt/rt_files.h"
#include "rt/rt_generics.h"
#include "rt/rt_glyphs.h"
#include "rt/rt_heap.h"
#include "rt/rt_loader.h"
#include "rt/rt_mem.h"
#include "rt/rt_nls.h"
#include "rt/rt_num.h"
#include "rt/rt_static.h"
#include "rt/rt_streams.h"
#include "rt/rt_processes.h"
#include "rt/rt_threads.h"
#include "rt/rt_vigil.h"
#include "rt/rt_work.h"


================================================
FILE: inc/rt/rt_args.h
================================================
#pragma once
#include "rt/rt_std.h"

rt_begin_c

typedef struct {
    // On Unix it is responsibility of the main() to assign these values
    int32_t c;      // argc
    const char** v; // argv[argc]
    const char** env; // rt_args.env[] is null-terminated
    void    (*main)(int32_t argc, const char* argv[], const char** env);
    void    (*WinMain)(void); // windows specific
    int32_t (*option_index)(const char* option); // e.g. option: "--verbosity" or "-v"
    void    (*remove_at)(int32_t ix);
    /* argc=3 argv={"foo", "--verbose"} -> returns true; argc=1 argv={"foo"} */
    bool    (*option_bool)(const char* option);
    /* argc=3 argv={"foo", "--n", "153"} -> value==153, true; argc=1 argv={"foo"}
       also handles negative values (e.g. "-153") and hex (e.g. 0xBADF00D)
    */
    bool    (*option_int)(const char* option, int64_t *value);
    // for argc=3 argv={"foo", "--path", "bar"}
    //     option_str("--path", option)
    // returns option: "bar" and argc=1 argv={"foo"} */
    const char* (*option_str)(const char* option);
    // basename() for argc=3 argv={"/bin/foo.exe", ...} returns "foo":
    const char* (*basename)(void);
    void (*fini)(void);
    void (*test)(void);
} rt_args_if;

extern rt_args_if rt_args;

/* Usage:

    (both main() and WinMain() could be compiled at the same time on Windows):

    static int run(void);

    int main(int argc, char* argv[], char* envp[]) { // link.exe /SUBSYSTEM:CONSOLE
        rt_args.main(argc, argv, envp); // Initialize args with command-line parameters
        int r = run();
        rt_args.fini();
        return r;
    }

    #include "rt/rt_win32.h"

    int APIENTRY WinMain(HINSTANCE inst, HINSTANCE prev, char* command, int show) {
        // link.exe /SUBSYSTEM:WINDOWS
        rt_args.WinMain();
        int r = run();
        rt_args.fini();
        return 0;
    }

    static int run(void) {
        if (rt_args.option_bool("-v")) {
            rt_debug.verbosity.level = rt_debug.verbosity.verbose;
        }
        int64_t num = 0;
        if (rt_args.option_int("--number", &num)) {
            printf("--number: %ld\n", num);
        }
        const char* path = rt_args.option_str("--path");
        if (path != null) {
            printf("--path: %s\n", path);
        }
        printf("rt_args.basename(): %s\n", rt_args.basename());
        printf("rt_args.v[0]: %s\n", rt_args.v[0]);
        for (int i = 1; i < rt_args.c; i++) {
            printf("rt_args.v[%d]: %s\n", i, rt_args.v[i]);
        }
        return 0;
    }

    // Also see: https://github.com/leok7v/ut/blob/main/test/test1.c

*/

rt_end_c


================================================
FILE: inc/rt/rt_atomics.h
================================================
#pragma once
#include "rt/rt_std.h"

// Will be deprecated soon after Microsoft fully supports <stdatomic.h>

rt_begin_c

typedef struct {
    void* (*exchange_ptr)(volatile void** a, void* v); // retuns previous value
    int32_t (*increment_int32)(volatile int32_t* a); // returns incremented
    int32_t (*decrement_int32)(volatile int32_t* a); // returns decremented
    int64_t (*increment_int64)(volatile int64_t* a); // returns incremented
    int64_t (*decrement_int64)(volatile int64_t* a); // returns decremented
    int32_t (*add_int32)(volatile int32_t* a, int32_t v); // returns result of add
    int64_t (*add_int64)(volatile int64_t* a, int64_t v); // returns result of add
    // returns the value held previously by "a" address:
    int32_t (*exchange_int32)(volatile int32_t* a, int32_t v);
    int64_t (*exchange_int64)(volatile int64_t* a, int64_t v);
    // compare_exchange functions compare the *a value with the comparand value.
    // If the *a is equal to the comparand value, the "v" value is stored in the address
    // specified by "a" otherwise, no operation is performed.
    // returns true if previous value *a was the same as "comparand"
    // false if *a was different from "comparand" and "a" was NOT modified.
    bool (*compare_exchange_int64)(volatile int64_t* a, int64_t comparand, int64_t v);
    bool (*compare_exchange_int32)(volatile int32_t* a, int32_t comparand, int32_t v);
    bool (*compare_exchange_ptr)(volatile void** a, void* comparand, void* v);
    void (*spinlock_acquire)(volatile int64_t* spinlock);
    void (*spinlock_release)(volatile int64_t* spinlock);
    int32_t (*load32)(volatile int32_t* a);
    int64_t (*load64)(volatile int64_t* a);
    void (*memory_fence)(void);
    void (*test)(void);
} rt_atomics_if;

extern rt_atomics_if rt_atomics;

rt_end_c


================================================
FILE: inc/rt/rt_backtrace.h
================================================
#pragma once
#include "rt/rt_std.h"

// "bt" stands for Stack Back Trace (not British Telecom)

rt_begin_c

enum { rt_backtrace_max_depth = 32 };    // increase if not enough
enum { rt_backtrace_max_symbol = 1024 }; // MSFT symbol size limit

typedef struct thread_s* rt_thread_t;

typedef char rt_backtrace_symbol_t[rt_backtrace_max_symbol];
typedef char rt_backtrace_file_t[512];

typedef struct rt_backtrace_s {
    int32_t frames; // 0 if capture() failed
    uint32_t hash;
    errno_t  error; // last error set by capture() or symbolize()
    void* stack[rt_backtrace_max_depth];
    rt_backtrace_symbol_t symbol[rt_backtrace_max_depth];
    rt_backtrace_file_t file[rt_backtrace_max_depth];
    int32_t line[rt_backtrace_max_depth];
    bool symbolized;
} rt_backtrace_t;

//  calling .trace(bt, /*stop:*/"*")
//  stops backtrace dumping at any of the known Microsoft runtime
//  symbols:
//    "main",
//    "WinMain",
//    "BaseThreadInitThunk",
//    "RtlUserThreadStart",
//    "mainCRTStartup",
//    "WinMainCRTStartup",
//    "invoke_main"
// .trace(bt, null)
// provides complete backtrace to the bottom of stack

typedef struct {
    void (*capture)(rt_backtrace_t *bt, int32_t skip); // number of frames to skip
    void (*context)(rt_thread_t thread, const void* context, rt_backtrace_t *bt);
    void (*symbolize)(rt_backtrace_t *bt);
    // dump backtrace into rt_println():
    void (*trace)(const rt_backtrace_t* bt, const char* stop);
    void (*trace_self)(const char* stop);
    void (*trace_all_but_self)(void); // trace all threads
    const char* (*string)(const rt_backtrace_t* bt, char* text, int32_t count);
    void (*test)(void);
} rt_backtrace_if;

extern rt_backtrace_if rt_backtrace;

#define rt_backtrace_here() do {   \
    rt_backtrace_t bt_ = {0};      \
    rt_backtrace.capture(&bt_, 0); \
    rt_backtrace.symbolize(&bt_);  \
    rt_backtrace.trace(&bt_, "*"); \
} while (0)

rt_end_c


================================================
FILE: inc/rt/rt_clipboard.h
================================================
#pragma once
#include "rt/rt_std.h"

rt_begin_c

typedef struct ui_bitmap_s ui_bitmap_t;

typedef struct {
    errno_t (*put_text)(const char* s);
    errno_t (*get_text)(char* text, int32_t* bytes);
    errno_t (*put_image)(ui_bitmap_t* image); // only for Windows apps
    void (*test)(void);
} rt_clipboard_if;

extern rt_clipboard_if rt_clipboard;

rt_end_c


================================================
FILE: inc/rt/rt_clock.h
================================================
#pragma once
#include "rt/rt_std.h"

rt_begin_c

typedef struct {
    int32_t const nsec_in_usec; // nano in micro second
    int32_t const nsec_in_msec; // nano in milli
    int32_t const nsec_in_sec;
    int32_t const usec_in_msec; // micro in milli
    int32_t const msec_in_sec;  // milli in sec
    int32_t const usec_in_sec;  // micro in sec
    fp64_t   (*seconds)(void);      // since boot
    uint64_t (*nanoseconds)(void);  // since boot overflows in about 584.5 years
    uint64_t (*unix_microseconds)(void); // since January 1, 1970
    uint64_t (*unix_seconds)(void);      // since January 1, 1970
    uint64_t (*microseconds)(void); // NOT monotonic(!) UTC since epoch January 1, 1601
    uint64_t (*localtime)(void);    // local time microseconds since epoch
    void (*utc)(uint64_t microseconds, int32_t* year, int32_t* month,
        int32_t* day, int32_t* hh, int32_t* mm, int32_t* ss, int32_t* ms,
        int32_t* mc);
    void (*local)(uint64_t microseconds, int32_t* year, int32_t* month,
        int32_t* day, int32_t* hh, int32_t* mm, int32_t* ss, int32_t* ms,
        int32_t* mc);
    void (*test)(void);
} rt_clock_if;

extern rt_clock_if rt_clock;

rt_end_c



================================================
FILE: inc/rt/rt_config.h
================================================
#pragma once
#include "rt/rt_std.h"

rt_begin_c

// Persistent storage for configuration and other small data
// related to specific application.
// on Unix-like system ~/.name/key files are used.
// On Window User registry (could be .dot files/folders).
// "name" is customary basename of "rt_args.v[0]"

typedef struct {
    errno_t (*save)(const char* name, const char* key,
                    const void* data, int32_t bytes);
    int32_t (*size)(const char* name, const char* key);
    // load() returns number of actual loaded bytes:
    int32_t (*load)(const char* name, const char* key,
                    void* data, int32_t bytes);
    errno_t (*remove)(const char* name, const char* key);
    errno_t (*clean)(const char* name); // remove all subkeys
    void (*test)(void);
} rt_config_if;

extern rt_config_if rt_config;

rt_end_c



================================================
FILE: inc/rt/rt_core.h
================================================
#pragma once
#include "rt/rt_std.h"

rt_begin_c

typedef struct {
    errno_t (*err)(void); // errno or GetLastError()
    void (*set_err)(errno_t err); // errno = err or SetLastError()
    void (*abort)(void);
    void (*exit)(int32_t exit_code); // only 8 bits on posix
    void (*test)(void);
    struct {                                // posix
        errno_t const access_denied;        // EACCES
        errno_t const bad_file;             // EBADF
        errno_t const broken_pipe;          // EPIPE
        errno_t const device_not_ready;     // ENXIO
        errno_t const directory_not_empty;  // ENOTEMPTY
        errno_t const disk_full;            // ENOSPC
        errno_t const file_exists;          // EEXIST
        errno_t const file_not_found;       // ENOENT
        errno_t const insufficient_buffer;  // E2BIG
        errno_t const interrupted;          // EINTR
        errno_t const invalid_data;         // EINVAL
        errno_t const invalid_handle;       // EBADF
        errno_t const invalid_parameter;    // EINVAL
        errno_t const io_error;             // EIO
        errno_t const more_data;            // ENOBUFS
        errno_t const name_too_long;        // ENAMETOOLONG
        errno_t const no_child_process;     // ECHILD
        errno_t const not_a_directory;      // ENOTDIR
        errno_t const not_empty;            // ENOTEMPTY
        errno_t const out_of_memory;        // ENOMEM
        errno_t const path_not_found;       // ENOENT
        errno_t const pipe_not_connected;   // EPIPE
        errno_t const read_only_file;       // EROFS
        errno_t const resource_deadlock;    // EDEADLK
        errno_t const too_many_open_files;  // EMFILE
    } const error;
} rt_core_if;

extern rt_core_if rt_core;

rt_end_c


================================================
FILE: inc/rt/rt_debug.h
================================================
#pragma once
#include "rt/rt_std.h"

rt_begin_c

// debug interface essentially is:
// vfprintf(stderr, format, va)
// fprintf(stderr, format, ...)
// with the additional convience:
// 1. writing to system log (e.g. OutputDebugString() on Windows)
// 2. always appending \n at the end of the line and thus flushing buffer
// Warning: on Windows it is not real-time and subject to 30ms delays
//          that may or may not happen on some calls

typedef struct {
    int32_t level; // global verbosity (interpretation may vary)
    int32_t const quiet;    // 0
    int32_t const info;     // 1 basic information (errors and warnings)
    int32_t const verbose;  // 2 detailed diagnostic
    int32_t const debug;    // 3 including debug messages
    int32_t const trace;    // 4 everything (may include nested calls)
} rt_verbosity_if;

typedef struct {
    rt_verbosity_if verbosity;
    int32_t (*verbosity_from_string)(const char* s);
    // "T" connector for outside write; return false to proceed with default
    bool (*tee)(const char* s, int32_t count); // return true to intercept
    void (*output)(const char* s, int32_t count);
    void (*println_va)(const char* file, int32_t line, const char* func,
        const char* format, va_list va);
    void (*println)(const char* file, int32_t line, const char* func,
        const char* format, ...);
    void (*perrno)(const char* file, int32_t line,
        const char* func, int32_t err_no, const char* format, ...);
    void (*perror)(const char* file, int32_t line,
        const char* func, int32_t error, const char* format, ...);
    bool (*is_debugger_present)(void);
    void (*breakpoint)(void); // no-op if debugger is not present
    errno_t (*raise)(uint32_t exception);
    struct  {
        uint32_t const access_violation;
        uint32_t const datatype_misalignment;
        uint32_t const breakpoint;
        uint32_t const single_step;
        uint32_t const array_bounds;
        uint32_t const float_denormal_operand;
        uint32_t const float_divide_by_zero;
        uint32_t const float_inexact_result;
        uint32_t const float_invalid_operation;
        uint32_t const float_overflow;
        uint32_t const float_stack_check;
        uint32_t const float_underflow;
        uint32_t const int_divide_by_zero;
        uint32_t const int_overflow;
        uint32_t const priv_instruction;
        uint32_t const in_page_error;
        uint32_t const illegal_instruction;
        uint32_t const noncontinuable;
        uint32_t const stack_overflow;
        uint32_t const invalid_disposition;
        uint32_t const guard_page;
        uint32_t const invalid_handle;
        uint32_t const possible_deadlock;
    } exception;
    void (*test)(void);
} rt_debug_if;

#define rt_println(...) rt_debug.println(__FILE__, __LINE__, __func__, "" __VA_ARGS__)

extern rt_debug_if rt_debug;

rt_end_c


================================================
FILE: inc/rt/rt_files.h
================================================
#pragma once
#include "rt/rt_std.h"

rt_begin_c

// space for "short" 260 utf-16 characters filename in utf-8 format:
typedef struct rt_file_name_s { char s[1024]; } rt_file_name_t;

enum { rt_files_max_path = (int32_t)sizeof(rt_file_name_t) }; // *)

typedef struct rt_file_s rt_file_t;

typedef struct rt_files_stat_s {
    uint64_t created;
    uint64_t accessed;
    uint64_t updated;
    int64_t  size; // bytes
    int64_t  type; // device / folder / symlink
} rt_files_stat_t;

typedef struct rt_folder_s {
    uint8_t data[512]; // implementation specific
} rt_folder_t;

typedef struct {
    rt_file_t* const invalid; // (rt_file_t*)-1
    // rt_files_stat_t.type:
    int32_t const type_folder;
    int32_t const type_symlink;
    int32_t const type_device;
    // seek() methods:
    int32_t const seek_set;
    int32_t const seek_cur;
    int32_t const seek_end;
    // open() flags
    int32_t const o_rd; // read only
    int32_t const o_wr; // write only
    int32_t const o_rw; // != (o_rd | o_wr)
    int32_t const o_append;
    int32_t const o_create; // opens existing or creates new
    int32_t const o_excl;   // create fails if file exists
    int32_t const o_trunc;  // open always truncates to empty
    int32_t const o_sync;
    // known folders ids:
    struct { // known folders:
        int32_t const home;      // "c:\Users\<username>" or "/users/<username>"
        int32_t const desktop;
        int32_t const documents;
        int32_t const downloads;
        int32_t const music;
        int32_t const pictures;
        int32_t const videos;
        int32_t const shared;    // "c:\Users\Public"
        int32_t const bin;       // "c:\Program Files" aka "/bin" aka "/Applications"
        int32_t const data;      // "c:\ProgramData" aka "/var" aka "/data"
    } const folder;
    errno_t (*open)(rt_file_t* *file, const char* filename, int32_t flags);
    bool    (*is_valid)(rt_file_t* file); // checks both null and invalid
    errno_t (*seek)(rt_file_t* file, int64_t *position, int32_t method);
    errno_t (*stat)(rt_file_t* file, rt_files_stat_t* stat, bool follow_symlink);
    errno_t (*read)(rt_file_t* file, void* data, int64_t bytes, int64_t *transferred);
    errno_t (*write)(rt_file_t* file, const void* data, int64_t bytes, int64_t *transferred);
    errno_t (*flush)(rt_file_t* file);
    void    (*close)(rt_file_t* file);
    errno_t (*write_fully)(const char* filename, const void* data,
                           int64_t bytes, int64_t *transferred);
    bool (*exists)(const char* pathname); // does not guarantee any access writes
    bool (*is_folder)(const char* pathname);
    bool (*is_symlink)(const char* pathname);
    const char* (*basename)(const char* pathname); // c:\foo\bar.ext -> bar.ext
    errno_t (*mkdirs)(const char* pathname); // tries to deep create all folders in pathname
    errno_t (*rmdirs)(const char* pathname); // tries to remove folder and its subtree
    errno_t (*create_tmp)(char* file, int32_t count); // create temporary file
    errno_t (*chmod777)(const char* pathname); // and whole subtree new files and folders
    errno_t (*symlink)(const char* from, const char* to); // sym link "ln -s" **)
    errno_t (*link)(const char* from, const char* to); // hard link like "ln"
    errno_t (*unlink)(const char* pathname); // delete file or empty folder
    errno_t (*copy)(const char* from, const char* to); // allows overwriting
    errno_t (*move)(const char* from, const char* to); // allows overwriting
    errno_t (*cwd)(char* folder, int32_t count); // get current working dir
    errno_t (*chdir)(const char* folder); // set working directory
    const char* (*known_folder)(int32_t kf_id);
    const char* (*bin)(void);  // Windows: "c:\Program Files" Un*x: "/bin"
    const char* (*data)(void); // Windows: "c:\ProgramData" Un*x: /data or /var
    const char* (*tmp)(void);  // temporary folder (system or user)
    // There are better, native, higher performance ways to iterate thru
    // folders in Posix, Linux and Windows. The following is minimalistic
    // approach to folder content reading:
    errno_t (*opendir)(rt_folder_t* folder, const char* folder_name);
    const char* (*readdir)(rt_folder_t* folder, rt_files_stat_t* optional);
    void (*closedir)(rt_folder_t* folder);
    void (*test)(void);
} rt_files_if;

// *) rt_files_max_path is a compromise - way longer than Windows MAX_PATH of 260
// and somewhat shorter than 32 * 1024 Windows long path.
// Use with caution understanding that it is a limitation and where it is
// important heap may and should be used. Do not to rely on thread stack size
// (default: 1MB on Windows, Android Linux 64KB, 512 KB  on MacOS, Ubuntu 8MB)
//
// **) symlink on Win32 is only allowed in Admin elevated
//     processes and in Developer mode.

extern rt_files_if rt_files;

rt_end_c


================================================
FILE: inc/rt/rt_glyphs.h
================================================
#pragma once
#include "rt/rt_std.h"

// Square Four Corners https://www.compart.com/en/unicode/U+26F6
#define rt_glyph_square_four_corners                    "\xE2\x9B\xB6"

// Circled Cross Formee
// https://codepoints.net/U+1F902
#define rt_glyph_circled_cross_formee                   "\xF0\x9F\xA4\x82"

// White Large Square https://www.compart.com/en/unicode/U+2B1C
#define rt_glyph_white_large_square                     "\xE2\xAC\x9C"

// N-Ary Times Operator https://www.compart.com/en/unicode/U+2A09
#define rt_glyph_n_ary_times_operator                   "\xE2\xA8\x89"

// Heavy Minus Sign https://www.compart.com/en/unicode/U+2796
#define rt_glyph_heavy_minus_sign                       "\xE2\x9E\x96"

// Heavy Plus Sign https://www.compart.com/en/unicode/U+2795
#define rt_glyph_heavy_plus_sign                        "\xE2\x9E\x95"

// Clockwise Rightwards and Leftwards Open Circle Arrows with Circled One Overlay
// https://www.compart.com/en/unicode/U+1F502
// rt_glyph_clockwise_rightwards_and_leftwards_open_circle_arrows_with_circled_one_overlay...
#define rt_glyph_open_circle_arrows_one_overlay         "\xF0\x9F\x94\x82"

// Halfwidth Katakana-Hiragana Prolonged Sound Mark https://www.compart.com/en/unicode/U+FF70
#define rt_glyph_prolonged_sound_mark                   "\xEF\xBD\xB0"

// Fullwidth Plus Sign https://www.compart.com/en/unicode/U+FF0B
#define rt_glyph_fullwidth_plus_sign                    "\xEF\xBC\x8B"

// Fullwidth Hyphen-Minus https://www.compart.com/en/unicode/U+FF0D
#define rt_glyph_fullwidth_hyphen_minus                 "\xEF\xBC\x8D"


// Heavy Multiplication X https://www.compart.com/en/unicode/U+2716
#define rt_glyph_heavy_multiplication_x                 "\xE2\x9C\x96"

// Multiplication Sign https://www.compart.com/en/unicode/U+00D7
#define rt_glyph_multiplication_sign                    "\xC3\x97"

// Trigram For Heaven (caption menu button) https://www.compart.com/en/unicode/U+2630
#define rt_glyph_trigram_for_heaven                     "\xE2\x98\xB0"

// (tool bar drag handle like: msvc toolbars)
// Braille Pattern Dots-12345678  https://www.compart.com/en/unicode/U+28FF
#define rt_glyph_braille_pattern_dots_12345678          "\xE2\xA3\xBF"

// White Square Containing Black Medium Square
// https://compart.com/en/unicode/U+1F795
#define rt_glyph_white_square_containing_black_medium_square "\xF0\x9F\x9E\x95"

// White Medium Square
// https://compart.com/en/unicode/U+25FB
#define rt_glyph_white_medium_square                   "\xE2\x97\xBB"

// White Square with Upper Right Quadrant
// https://compart.com/en/unicode/U+25F3
#define rt_glyph_white_square_with_upper_right_quadrant "\xE2\x97\xB3"

// White Square with Upper Left Quadrant https://www.compart.com/en/unicode/U+25F0
#define rt_glyph_white_square_with_upper_left_quadrant "\xE2\x97\xB0"

// White Square with Lower Left Quadrant https://www.compart.com/en/unicode/U+25F1
#define rt_glyph_white_square_with_lower_left_quadrant "\xE2\x97\xB1"

// White Square with Lower Right Quadrant https://www.compart.com/en/unicode/U+25F2
#define rt_glyph_white_square_with_lower_right_quadrant "\xE2\x97\xB2"

// White Square with Upper Right Quadrant https://www.compart.com/en/unicode/U+25F3
#define rt_glyph_white_square_with_upper_right_quadrant "\xE2\x97\xB3"

// White Square with Vertical Bisecting Line https://www.compart.com/en/unicode/U+25EB
#define rt_glyph_white_square_with_vertical_bisecting_line "\xE2\x97\xAB"

// (White Square with Horizontal Bisecting Line)
// Squared Minus https://www.compart.com/en/unicode/U+229F
#define rt_glyph_squared_minus                          "\xE2\x8A\x9F"

// North East and South West Arrow https://www.compart.com/en/unicode/U+2922
#define rt_glyph_north_east_and_south_west_arrow        "\xE2\xA4\xA2"

// South East Arrow to Corner https://www.compart.com/en/unicode/U+21F2
#define rt_glyph_south_east_white_arrow_to_corner       "\xE2\x87\xB2"

// North West Arrow to Corner https://www.compart.com/en/unicode/U+21F1
#define rt_glyph_north_west_white_arrow_to_corner       "\xE2\x87\xB1"

// Leftwards Arrow to Bar https://www.compart.com/en/unicode/U+21E6
#define rt_glyph_leftwards_white_arrow_to_bar           "\xE2\x87\xA6"

// Rightwards Arrow to Bar https://www.compart.com/en/unicode/U+21E8
#define rt_glyph_rightwards_white_arrow_to_bar          "\xE2\x87\xA8"

// Upwards White Arrow https://www.compart.com/en/unicode/U+21E7
#define rt_glyph_upwards_white_arrow                    "\xE2\x87\xA7"

// Downwards White Arrow https://www.compart.com/en/unicode/U+21E9
#define rt_glyph_downwards_white_arrow                  "\xE2\x87\xA9"

// Leftwards White Arrow https://www.compart.com/en/unicode/U+21E4
#define rt_glyph_leftwards_white_arrow                  "\xE2\x87\xA4"

// Rightwards White Arrow https://www.compart.com/en/unicode/U+21E5
#define rt_glyph_rightwards_white_arrow                 "\xE2\x87\xA5"

// Upwards White Arrow on Pedestal https://www.compart.com/en/unicode/U+21EB
#define rt_glyph_upwards_white_arrow_on_pedestal        "\xE2\x87\xAB"

// Braille Pattern Dots-678 https://www.compart.com/en/unicode/U+28E0
#define rt_glyph_3_dots_tiny_right_bottom_triangle      "\xE2\xA3\xA0"

// Braille Pattern Dots-2345678 https://www.compart.com/en/unicode/U+28FE
// Combining the two into:
#define rt_glyph_dotted_right_bottom_triangle           "\xE2\xA3\xA0\xE2\xA3\xBE"

// Upper Right Drop-Shadowed White Square https://www.compart.com/en/unicode/U+2750
#define rt_glyph_upper_right_drop_shadowed_white_square "\xE2\x9D\x90"

// No-Break Space (NBSP)
// https://www.compart.com/en/unicode/U+00A0
#define rt_glyph_nbsp                                   "\xC2\xA0"

// Word Joiner (WJ)
// https://compart.com/en/unicode/U+2060
#define rt_glyph_word_joiner                            "\xE2\x81\xA0"

// Zero Width Space (ZWSP)
// https://compart.com/en/unicode/U+200B
#define rt_glyph_zwsp                                   "\xE2\x80\x8B"

// Zero Width Joiner (ZWJ)
// https://compart.com/en/unicode/u+200D
#define rt_glyph_zwj                                    "\xE2\x80\x8D"

// En Quad
// https://compart.com/en/unicode/U+2000
#define rt_glyph_en_quad "\xE2\x80\x80"

// Em Quad
// https://compart.com/en/unicode/U+2001
#define rt_glyph_em_quad "\xE2\x80\x81"

// En Space
// https://compart.com/en/unicode/U+2002
#define rt_glyph_en_space "\xE2\x80\x82"

// Em Space
// https://compart.com/en/unicode/U+2003
#define rt_glyph_em_space "\xE2\x80\x83"

// Hyphen https://www.compart.com/en/unicode/U+2010
#define rt_glyph_hyphen                                "\xE2\x80\x90"

// Non-Breaking Hyphen https://www.compart.com/en/unicode/U+2011
#define rt_glyph_non_breaking_hyphen                   "\xE2\x80\x91"

// Fullwidth Low Line https://www.compart.com/en/unicode/U+FF3F
#define rt_glyph_fullwidth_low_line                    "\xEF\xBC\xBF"

// #define rt_glyph_light_horizontal                     "\xE2\x94\x80"
// Light Horizontal https://www.compart.com/en/unicode/U+2500
#define rt_glyph_light_horizontal                     "\xE2\x94\x80"

// Three-Em Dash https://www.compart.com/en/unicode/U+2E3B
#define rt_glyph_three_em_dash                         "\xE2\xB8\xBB"

// Infinity https://www.compart.com/en/unicode/U+221E
#define rt_glyph_infinity                              "\xE2\x88\x9E"

// Black Large Circle https://www.compart.com/en/unicode/U+2B24
#define rt_glyph_black_large_circle                    "\xE2\xAC\xA4"

// Large Circle https://www.compart.com/en/unicode/U+25EF
#define rt_glyph_large_circle                          "\xE2\x97\xAF"

// Heavy Leftwards Arrow with Equilateral Arrowhead https://www.compart.com/en/unicode/U+1F818
#define rt_glyph_heavy_leftwards_arrow_with_equilateral_arrowhead           "\xF0\x9F\xA0\x98"

// Heavy Rightwards Arrow with Equilateral Arrowhead https://www.compart.com/en/unicode/U+1F81A
#define rt_glyph_heavy_rightwards_arrow_with_equilateral_arrowhead          "\xF0\x9F\xA0\x9A"

// Heavy Leftwards Arrow with Large Equilateral Arrowhead https://www.compart.com/en/unicode/U+1F81C
#define rt_glyph_heavy_leftwards_arrow_with_large_equilateral_arrowhead     "\xF0\x9F\xA0\x9C"

// Heavy Rightwards Arrow with Large Equilateral Arrowhead https://www.compart.com/en/unicode/U+1F81E
#define rt_glyph_heavy_rightwards_arrow_with_large_equilateral_arrowhead    "\xF0\x9F\xA0\x9E"

// CJK Unified Ideograph-5973: Kanji Onna "Female" https://www.compart.com/en/unicode/U+5973
#define rt_glyph_kanji_onna_female                                          "\xE2\xBC\xA5"

// Leftwards Arrow https://www.compart.com/en/unicode/U+2190
#define rt_glyph_leftward_arrow                                             "\xE2\x86\x90"

// Upwards Arrow https://www.compart.com/en/unicode/U+2191
#define rt_glyph_upwards_arrow                                              "\xE2\x86\x91"

// Rightwards Arrow
// https://www.compart.com/en/unicode/U+2192
#define rt_glyph_rightwards_arrow                                           "\xE2\x86\x92"

// Downwards Arrow https://www.compart.com/en/unicode/U+2193
#define rt_glyph_downwards_arrow                                            "\xE2\x86\x93"

// Thin Space https://www.compart.com/en/unicode/U+2009
#define rt_glyph_thin_space                                                 "\xE2\x80\x89"

// Medium Mathematical Space (MMSP) https://www.compart.com/en/unicode/U+205F
#define rt_glyph_mmsp                                                       "\xE2\x81\x9F"

// Three-Per-Em Space https://www.compart.com/en/unicode/U+2004
#define rt_glyph_three_per_em                                               "\xE2\x80\x84"

// Six-Per-Em Space https://www.compart.com/en/unicode/U+2006
#define rt_glyph_six_per_em                                                 "\xE2\x80\x86"

// Punctuation Space https://www.compart.com/en/unicode/U+2008
#define rt_glyph_punctuation                                                "\xE2\x80\x88"

// Hair Space https://www.compart.com/en/unicode/U+200A
#define rt_glyph_hair_space                                                 "\xE2\x80\x8A"

// Chinese "jin4" https://www.compart.com/en/unicode/U+58F9
#define rt_glyph_chinese_jin4                                               "\xE5\xA3\xB9"

// Chinese "gong" https://www.compart.com/en/unicode/U+8D70
#define rt_glyph_chinese_gong                                                "\xE8\xB5\xB0"

// https://www.compart.com/en/unicode/U+1F9F8
#define rt_glyph_teddy_bear                                                 "\xF0\x9F\xA7\xB8"

// https://www.compart.com/en/unicode/U+1F9CA
#define rt_glyph_ice_cube                                                   "\xF0\x9F\xA7\x8A"

// Speaker https://www.compart.com/en/unicode/U+1F508
#define rt_glyph_speaker                                                    "\xF0\x9F\x94\x88"

// Speaker with Cancellation Stroke https://www.compart.com/en/unicode/U+1F507
#define rt_glyph_mute                                                       "\xF0\x9F\x94\x87"

// TODO: this is used for Font Metric Visualization

// Full Block https://www.compart.com/en/unicode/U+2588
#define rt_glyph_full_block                             "\xE2\x96\x88"

// Black Square https://www.compart.com/en/unicode/U+25A0
#define rt_glyph_black_square                           "\xE2\x96\xA0"

// the appearance of a dragon walking
// CJK Unified Ideograph-9F98 https://www.compart.com/en/unicode/U+9F98
#define rt_glyph_walking_dragon                         "\xE9\xBE\x98"

// possibly highest "diacritical marks" character (Vietnamese)
// Latin Small Letter U with Horn and Hook Above https://www.compart.com/en/unicode/U+1EED
#define rt_glyph_u_with_horn_and_hook_above             "\xC7\xAD"

// possibly "long descender" character
// Latin Small Letter Qp Digraph https://www.compart.com/en/unicode/U+0239
#define rt_glyph_qp_digraph                             "\xC9\xB9"

// another possibly "long descender" character
// Cyrillic Small Letter Shha with Descender https://www.compart.com/en/unicode/U+0527
#define rt_glyph_shha_with_descender                    "\xD4\xA7"

// a"very long descender" character
// Tibetan Mark Caret Yig Mgo Phur Shad Ma https://www.compart.com/en/unicode/U+0F06
#define rt_glyph_caret_yig_mgo_phur_shad_ma             "\xE0\xBC\x86"

// Tibetan Vowel Sign Vocalic Ll https://www.compart.com/en/unicode/U+0F79
#define rt_glyph_vocalic_ll                             "\xE0\xBD\xB9"

// https://www.compart.com/en/unicode/U+1F4A3
#define rt_glyph_bomb "\xF0\x9F\x92\xA3"

// https://www.compart.com/en/unicode/U+1F4A1
#define rt_glyph_electric_light_bulb "\xF0\x9F\x92\xA1"

// https://www.compart.com/en/unicode/U+1F4E2
#define rt_glyph_public_address_loudspeaker "\xF0\x9F\x93\xA2"

// https://www.compart.com/en/unicode/U+1F517
#define rt_glyph_link_symbol "\xF0\x9F\x94\x97"

// https://www.compart.com/en/unicode/U+1F571
#define rt_glyph_black_skull_and_crossbones "\xF0\x9F\x95\xB1"

// https://www.compart.com/en/unicode/U+1F5B5
#define rt_glyph_screen "\xF0\x9F\x96\xB5"

// https://www.compart.com/en/unicode/U+1F5D7
#define rt_glyph_overlap "\xF0\x9F\x97\x97"

// https://www.compart.com/en/unicode/U+1F5D6
#define rt_glyph_maximize "\xF0\x9F\x97\x96"

// https://www.compart.com/en/unicode/U+1F5D5
#define rt_glyph_minimize "\xF0\x9F\x97\x95"

// Desktop Window
// https://compart.com/en/unicode/U+1F5D4
#define rt_glyph_desktop_window "\xF0\x9F\x97\x94"

// https://www.compart.com/en/unicode/U+1F5D9
#define rt_glyph_cancellation_x "\xF0\x9F\x97\x99"

// https://www.compart.com/en/unicode/U+1F5DF
#define rt_glyph_page_with_circled_text "\xF0\x9F\x97\x9F"

// https://www.compart.com/en/unicode/U+1F533
#define rt_glyph_white_square_button "\xF0\x9F\x94\xB3"

// https://www.compart.com/en/unicode/U+1F532
#define rt_glyph_black_square_button "\xF0\x9F\x94\xB2"

// https://www.compart.com/en/unicode/U+1F5F9
#define rt_glyph_ballot_box_with_bold_check "\xF0\x9F\x97\xB9"

// https://www.compart.com/en/unicode/U+1F5F8
#define rt_glyph_light_check_mark "\xF0\x9F\x97\xB8"

// https://compart.com/en/unicode/U+1F4BB
#define rt_glyph_personal_computer "\xF0\x9F\x92\xBB"

// https://compart.com/en/unicode/U+1F4DC
#define rt_glyph_desktop_computer "\xF0\x9F\x93\x9C"

// https://compart.com/en/unicode/U+1F4DD
#define rt_glyph_printer "\xF0\x9F\x93\x9D"

// https://compart.com/en/unicode/U+1F4F9
#define rt_glyph_video_camera "\xF0\x9F\x93\xB9"

// https://compart.com/en/unicode/U+1F4F8
#define rt_glyph_camera "\xF0\x9F\x93\xB8"

// https://compart.com/en/unicode/U+1F505
#define rt_glyph_high_brightness "\xF0\x9F\x94\x85"

// https://compart.com/en/unicode/U+1F506
#define rt_glyph_low_brightness "\xF0\x9F\x94\x86"

// https://compart.com/en/unicode/U+1F507
#define rt_glyph_speaker_with_cancellation_stroke "\xF0\x9F\x94\x87"

// https://compart.com/en/unicode/U+1F509
#define rt_glyph_speaker_with_one_sound_wave "\xF0\x9F\x94\x89"

// Right-Pointing Magnifying Glass
// https://compart.com/en/unicode/U+1F50E
#define rt_glyph_right_pointing_magnifying_glass "\xF0\x9F\x94\x8E"

// Radio Button
// https://compart.com/en/unicode/U+1F518
#define rt_glyph_radio_button "\xF0\x9F\x94\x98"

// https://compart.com/en/unicode/U+1F525
#define rt_glyph_fire "\xF0\x9F\x94\xA5"

// Gear
// https://compart.com/en/unicode/U+2699
#define rt_glyph_gear "\xE2\x9A\x99"

// Nut and Bolt
// https://compart.com/en/unicode/U+1F529
#define rt_glyph_nut_and_bolt "\xF0\x9F\x94\xA9"

// Hammer and Wrench
// https://compart.com/en/unicode/U+1F6E0
#define rt_glyph_hammer_and_wrench "\xF0\x9F\x9B\xA0"

// https://compart.com/en/unicode/U+1F53E
#define rt_glyph_upwards_button "\xF0\x9F\x94\xBE"

// https://compart.com/en/unicode/U+1F53F
#define rt_glyph_downwards_button "\xF0\x9F\x94\xBF"

// https://compart.com/en/unicode/U+1F5C7
#define rt_glyph_litter_in_bin_sign "\xF0\x9F\x97\x87"

// Checker Board
// https://compart.com/en/unicode/U+1F67E
#define rt_glyph_checker_board "\xF0\x9F\x9A\xBE"

// Reverse Checker Board
// https://compart.com/en/unicode/U+1F67F
#define rt_glyph_reverse_checker_board "\xF0\x9F\x9A\xBF"

// Clipboard
// https://compart.com/en/unicode/U+1F4CB
#define rt_glyph_clipboard "\xF0\x9F\x93\x8B"

// Two Joined Squares https://www.compart.com/en/unicode/U+29C9
#define rt_glyph_two_joined_squares "\xE2\xA7\x89"

// White Heavy Check Mark
// https://compart.com/en/unicode/U+2705
#define rt_glyph_white_heavy_check_mark "\xE2\x9C\x85"

// Negative Squared Cross Mark
// https://compart.com/en/unicode/U+274E
#define rt_glyph_negative_squared_cross_mark "\xE2\x9D\x8E"

// Lower Right Drop-Shadowed White Square
// https://compart.com/en/unicode/U+274F
#define rt_glyph_lower_right_drop_shadowed_white_square "\xE2\x9D\x8F"

// Upper Right Drop-Shadowed White Square
// https://compart.com/en/unicode/U+2750
#define rt_glyph_upper_right_drop_shadowed_white_square "\xE2\x9D\x90"

// Lower Right Shadowed White Square
// https://compart.com/en/unicode/U+2751
#define rt_glyph_lower_right_shadowed_white_square "\xE2\x9D\x91"

// Upper Right Shadowed White Square
// https://compart.com/en/unicode/U+2752
#define rt_glyph_upper_right_shadowed_white_square "\xE2\x9D\x92"

// Left Double Wiggly Fence
// https://compart.com/en/unicode/U+29DA
#define rt_glyph_left_double_wiggly_fence "\xE2\xA7\x9A"

// Right Double Wiggly Fence
// https://compart.com/en/unicode/U+29DB
#define rt_glyph_right_double_wiggly_fence "\xE2\xA7\x9B"

// Logical Or
// https://compart.com/en/unicode/U+2228
#define rt_glyph_logical_or "\xE2\x88\xA8"

// Logical And
// https://compart.com/en/unicode/U+2227
#define rt_glyph_logical_and "\xE2\x88\xA7"

// Double Vertical Bar (Pause)
// https://compart.com/en/unicode/U+23F8
#define rt_glyph_double_vertical_bar "\xE2\x8F\xB8"

// Black Square For Stop
// https://compart.com/en/unicode/U+23F9
#define rt_glyph_black_square_for_stop "\xE2\x8F\xB9"

// Black Circle For Record
// https://compart.com/en/unicode/U+23FA
#define rt_glyph_black_circle_for_record "\xE2\x8F\xBA"

// Negative Squared Latin Capital Letter "I"
// https://compart.com/en/unicode/U+1F158
#define rt_glyph_negative_squared_latin_capital_letter_i "\xF0\x9F\x85\x98"
#define rt_glyph_info rt_glyph_negative_squared_latin_capital_letter_i

// Circled Information Source
// https://compart.com/en/unicode/U+1F6C8
#define rt_glyph_circled_information_source "\xF0\x9F\x9B\x88"

// Information Source
// https://compart.com/en/unicode/U+2139
#define rt_glyph_information_source "\xE2\x84\xB9"

// Squared Cool
// https://compart.com/en/unicode/U+1F192
#define rt_glyph_squared_cool "\xF0\x9F\x86\x92"

// Squared OK
// https://compart.com/en/unicode/U+1F197
#define rt_glyph_squared_ok "\xF0\x9F\x86\x97"

// Squared Free
// https://compart.com/en/unicode/U+1F193
#define rt_glyph_squared_free "\xF0\x9F\x86\x93"

// Squared New
// https://compart.com/en/unicode/U+1F195
#define rt_glyph_squared_new "\xF0\x9F\x86\x95"

// Lady Beetle
// https://compart.com/en/unicode/U+1F41E
#define rt_glyph_lady_beetle "\xF0\x9F\x90\x9E"

// Brain
// https://compart.com/en/unicode/U+1F9E0
#define rt_glyph_brain "\xF0\x9F\xA7\xA0"

// South West Arrow with Hook
// https://www.compart.com/en/unicode/U+2926
#define rt_glyph_south_west_arrow_with_hook "\xE2\xA4\xA6"

// North West Arrow with Hook
// https://www.compart.com/en/unicode/U+2923
#define rt_glyph_north_west_arrow_with_hook "\xE2\xA4\xA3"

// White Sun with Rays
// https://www.compart.com/en/unicode/U+263C
#define rt_glyph_white_sun_with_rays "\xE2\x98\xBC"

// Black Sun with Rays
// https://www.compart.com/en/unicode/U+2600
#define rt_glyph_black_sun_with_rays "\xE2\x98\x80"

// Sun Behind Cloud
// https://www.compart.com/en/unicode/U+26C5
#define rt_glyph_sun_behind_cloud "\xE2\x9B\x85"

// White Sun
// https://www.compart.com/en/unicode/U+1F323
#define rt_glyph_white_sun "\xF0\x9F\x8C\xA3"

// Crescent Moon
// https://www.compart.com/en/unicode/U+1F319
#define rt_glyph_crescent_moon "\xF0\x9F\x8C\x99"

// Latin Capital Letter E with Cedilla and Breve
// https://compart.com/en/unicode/U+1E1C
#define rt_glyph_E_with_cedilla_and_breve "\xE1\xB8\x9C"

// Box Drawings Heavy Vertical and Horizontal
// https://compart.com/en/unicode/U+254B
#define rt_glyph_box_drawings_heavy_vertical_and_horizontal "\xE2\x95\x8B"

// Box Drawings Light Diagonal Cross
// https://compart.com/en/unicode/U+2573
#define rt_glyph_box_drawings_light_diagonal_cross "\xE2\x95\xB3"

// Combining Enclosing Square
// https://compart.com/en/unicode/U+20DE
#define rt_glyph_combining_enclosing_square "\xE2\x83\x9E"

// Combining Enclosing Screen
// https://compart.com/en/unicode/U+20E2
#define rt_glyph_combining_enclosing_screen "\xE2\x83\xA2"

// Combining Enclosing Keycap
// https://compart.com/en/unicode/U+20E3
#define rt_glyph_combining_enclosing_keycap "\xE2\x83\xA3"

// Combining Enclosing Circle
// https://compart.com/en/unicode/U+20DD
#define rt_glyph_combining_enclosing_circle "\xE2\x83\x9D"

// Frame with Picture
// https://compart.com/en/unicode/U+1F5BC
#define rt_glyph_frame_with_picture "\xF0\x9F\x96\xBC"
// with emoji variation selector: "\xF0\x9F\x96\xBC\xEF\xB8\x8F"

// Document with Picture
// https://compart.com/en/unicode/U+1F5BB
#define rt_glyph_document_with_picture "\xF0\x9F\x96\xBB"

// Frame with Tiles
// https://compart.com/en/unicode/U+1F5BD
#define rt_glyph_frame_with_tiles "\xF0\x9F\x96\xBD"

// Frame with an X
// https://compart.com/en/unicode/U+1F5BE
#define rt_glyph_frame_with_an_x "\xF0\x9F\x96\xBE"

// Left Right Arrow
// https://compart.com/en/unicode/U+2194
#define rt_glyph_left_right_arrow "\xE2\x86\x94"

// Up Down Arrow
// https://compart.com/en/unicode/U+2195
#define rt_glyph_up_down_arrow "\xE2\x86\x95"


================================================
FILE: inc/rt/rt_heap.h
================================================
#pragma once
#include "rt/rt_std.h"

rt_begin_c

// It is absolutely OK to use posix compliant
// malloc()/calloc()/realloc()/free() function calls with understanding
// that they introduce serialization points in multi-threaded applications
// and may be induce wait states that under pressure (all cores busy) may
// result in prolonged wait which may not be acceptable for real time
// processing pipelines.
//
// heap_if.functions may or may not be faster than malloc()/free() ...
//
// Some callers may find realloc() parameters more convenient to avoid
// anti-pattern
//      void* reallocated = realloc(p, new_size);
//      if (reallocated != null) { p = reallocated; }
// and avoid never ending discussion of legality and implementation
// compliance of the situation:
//      realloc(p /* when p == null */, ...)
//
// zero: true initializes allocated or reallocated tail memory to 0x00
// be careful with zeroing heap memory. It will result in virtual
// to physical memory mapping and may be expensive.

typedef struct rt_heap_s rt_heap_t;

typedef struct { // heap == null uses process serialized LFH
    errno_t (*alloc)(void* *a, int64_t bytes);
    errno_t (*alloc_zero)(void* *a, int64_t bytes);
    errno_t (*realloc)(void* *a, int64_t bytes);
    errno_t (*realloc_zero)(void* *a, int64_t bytes);
    void    (*free)(void* a);
    // heaps:
    rt_heap_t* (*create)(bool serialized);
    errno_t (*allocate)(rt_heap_t* heap, void* *a, int64_t bytes, bool zero);
    // reallocate may return ERROR_OUTOFMEMORY w/o changing 'a' *)
    errno_t (*reallocate)(rt_heap_t* heap, void* *a, int64_t bytes, bool zero);
    void    (*deallocate)(rt_heap_t* heap, void* a);
    int64_t (*bytes)(rt_heap_t* heap, void* a); // actual allocated size
    void    (*dispose)(rt_heap_t* heap);
    void    (*test)(void);
} rt_heap_if;

extern rt_heap_if rt_heap;

// *) zero in reallocate applies to the newly appended bytes

// On Windows rt_mem.heap is based on serialized LFH returned by GetProcessHeap()
// https://learn.microsoft.com/en-us/windows/win32/memory/low-fragmentation-heap
// threads can benefit from not serialized, not LFH if they allocate and free
// memory in time critical loops.

rt_end_c



================================================
FILE: inc/rt/rt_loader.h
================================================
#pragma once
#include "rt/rt_std.h"

rt_begin_c

// see:
// https://pubs.opengroup.org/onlinepubs/7908799/xsh/dlfcn.h.html

typedef struct {
    // mode:
    int32_t const local;
    int32_t const lazy;
    int32_t const now;
    int32_t const global;
    // "If the value of file is null, dlopen() provides a handle on a global
    //  symbol object." posix
    void* (*open)(const char* filename, int32_t mode);
    void* (*sym)(void* handle, const char* name);
    void  (*close)(void* handle);
    void (*test)(void);
} rt_loader_if;

extern rt_loader_if rt_loader;

rt_end_c


================================================
FILE: inc/rt/rt_mem.h
================================================
#pragma once
#include "rt/rt_std.h"

rt_begin_c

typedef struct {
    // whole file read only
    errno_t (*map_ro)(const char* filename, void** data, int64_t* bytes);
    // whole file read-write
    errno_t (*map_rw)(const char* filename, void** data, int64_t* bytes);
    void (*unmap)(void* data, int64_t bytes);
    // map_resource() maps data from resources, do NOT unmap!
    errno_t  (*map_resource)(const char* label, void** data, int64_t* bytes);
    int32_t (*page_size)(void); // 4KB or 64KB on Windows
    int32_t (*large_page_size)(void);  // 2MB on Windows
    // allocate() contiguous reserved virtual address range,
    // if possible committed to physical memory.
    // Memory guaranteed to be aligned to page boundary.
    // Memory is guaranteed to be initialized to zero on access.
    void* (*allocate)(int64_t bytes_multiple_of_page_size);
    void  (*deallocate)(void* a, int64_t bytes_multiple_of_page_size);
    void  (*test)(void);
} rt_mem_if;

extern rt_mem_if rt_mem;

rt_end_c



================================================
FILE: inc/rt/rt_nls.h
================================================
#pragma once
#include "rt/rt_std.h"

rt_begin_c

typedef struct { // i18n national language support
    void (*init)(void);
    const char* (*locale)(void);  // "en-US" "zh-CN" etc...
    // force locale for debugging and testing:
    errno_t (*set_locale)(const char* locale); // only for calling thread
    // nls(s) is same as string(strid(s), s)
    const char* (*str)(const char* defau1t); // returns localized string
    // strid("foo") returns -1 if there is no matching
    // ENGLISH NEUTRAL STRINGTABLE entry
    int32_t (*strid)(const char* s);
    // given strid > 0 returns localized string or default value
    const char* (*string)(int32_t strid, const char* defau1t);
} rt_nls_if;

extern rt_nls_if rt_nls;

rt_end_c


================================================
FILE: inc/rt/rt_num.h
================================================
#pragma once
#include "rt/rt_std.h"

rt_begin_c

typedef struct {
    uint64_t lo;
    uint64_t hi;
} rt_num128_t; // uint128_t may be supported by compiler

typedef struct {
    rt_num128_t (*add128)(const rt_num128_t a, const rt_num128_t b);
    rt_num128_t (*sub128)(const rt_num128_t a, const rt_num128_t b);
    rt_num128_t (*mul64x64)(uint64_t a, uint64_t b);
    uint64_t (*muldiv128)(uint64_t a, uint64_t b, uint64_t d);
    uint32_t (*gcd32)(uint32_t u, uint32_t v); // greatest common denominator
    // non-crypto strong pseudo-random number generators (thread safe)
    uint32_t (*random32)(uint32_t *state); // "Mulberry32"
    uint64_t (*random64)(uint64_t *state); // "Trust"
    // "FNV-1a" hash functions (if bytes == 0 expects zero terminated string)
    uint32_t (*hash32)(const char* s, int64_t bytes);
    uint64_t (*hash64)(const char* s, int64_t bytes);
    void     (*test)(void);
} rt_num_if;

extern rt_num_if rt_num;

rt_end_c



================================================
FILE: inc/rt/rt_processes.h
================================================
#pragma once
#include "rt/rt_streams.h"

rt_begin_c

typedef struct {
    const char* command;
    rt_stream_if* in;
    rt_stream_if* out;
    rt_stream_if* err;
    uint32_t exit_code;
    fp64_t   timeout; // seconds
} rt_processes_child_t;

// Process name may be an the executable filename with
// full, partial or absent pathname.
// Case insensitive on Windows.

typedef struct {
    const char* (*name)(void); // argv[0] like but full path
    uint64_t  (*pid)(const char* name); // 0 if process not found
    errno_t   (*pids)(const char* name, uint64_t* pids/*[size]*/, int32_t size,
                      int32_t *count); // return 0, error or ERROR_MORE_DATA
    errno_t   (*nameof)(uint64_t pid, char* name, int32_t count); // pathname
    bool      (*present)(uint64_t pid);
    errno_t   (*kill)(uint64_t pid, fp64_t timeout_seconds);
    errno_t   (*kill_all)(const char* name, fp64_t timeout_seconds);
    bool      (*is_elevated)(void); // Is process running as root/ Admin / System?
    errno_t   (*restart_elevated)(void); // retuns error or exits on success
    errno_t   (*run)(rt_processes_child_t* child);
    errno_t   (*popen)(const char* command, int32_t *xc, rt_stream_if* output,
                       fp64_t timeout_seconds); // <= 0 infinite
    // popen() does NOT guarantee stream zero termination on errors
    errno_t  (*spawn)(const char* command); // spawn fully detached process
    void (*test)(void);
} rt_processes_if;

extern rt_processes_if rt_processes;

rt_end_c


================================================
FILE: inc/rt/rt_static.h
================================================
#pragma once
#include "rt/rt_std.h"

rt_begin_c

// rt_static_init(unique_name) { code_to_execute_before_main }

#if defined(_MSC_VER)

#if defined(_WIN64) || defined(_M_X64)
#define _msvc_symbol_prefix_ ""
#else
#define _msvc_symbol_prefix_ "_"
#endif

#pragma comment(linker, "/include:rt_force_symbol_reference")

void* rt_force_symbol_reference(void* symbol);

#define _msvc_ctor_(sym_prefix, func)                                    \
  void func(void);                                                        \
  int32_t (* rt_array ## func)(void);                                     \
  int32_t func ## _wrapper(void);                                         \
  int32_t func ## _wrapper(void) { func();                                \
  rt_force_symbol_reference((void*)rt_array ## func);                     \
  rt_force_symbol_reference((void*)func ## _wrapper); return 0; }         \
  extern int32_t (* rt_array ## func)(void);                              \
  __pragma(comment(linker, "/include:" sym_prefix # func "_wrapper"))     \
  __pragma(section(".CRT$XCU", read))                                     \
  __declspec(allocate(".CRT$XCU"))                                        \
    int32_t (* rt_array ## func)(void) = func ## _wrapper;

#define rt_static_init2_(func, line) _msvc_ctor_(_msvc_symbol_prefix_, \
    func ## _constructor_##line)                                       \
    void func ## _constructor_##line(void)

#define rt_static_init1_(func, line) rt_static_init2_(func, line)

#define rt_static_init(func) rt_static_init1_(func, __LINE__)

#else
#define rt_static_init(n) __attribute__((constructor)) \
        static void _init_ ## n ## __LINE__ ## _ctor(void)
#endif

void rt_static_init_test(void);

rt_end_c


================================================
FILE: inc/rt/rt_str.h
================================================
#pragma once
#include "rt/rt_std.h"

rt_begin_c

typedef struct rt_str64_t {
    char s[64];
} rt_str64_t;

typedef struct rt_str128_t {
    char s[128];
} rt_str128_t;

typedef struct rt_str1024_t {
    char s[1024];
} rt_str1024_t;

typedef struct rt_str32K_t {
    char s[32 * 1024];
} rt_str32K_t;

// truncating string printf:
// char s[100]; rt_str_printf(s, "Hello %s", "world");
// do not use with char* and char s[] parameters
// because rt_countof(s) will be sizeof(char*) not the size of the buffer.

#define rt_str_printf(s, ...) rt_str.format((s), rt_countof(s), "" __VA_ARGS__)

#define rt_strerr(r) (rt_str.error((r)).s) // use only as rt_str_printf() parameter

// The strings are expected to be UTF-8 encoded.
// Copy functions fatal fail if the destination buffer is too small.
// It is responsibility of the caller to make sure it won't happen.

typedef struct {
    char* (*drop_const)(const char* s); // because of strstr() and alike
    int32_t (*len)(const char* s);
    int32_t (*len16)(const uint16_t* utf16);
    int32_t (*utf8bytes)(const char* utf8, int32_t bytes); // 0 on error
    int32_t (*glyphs)(const char* utf8, int32_t bytes); // -1 on error
    bool (*starts)(const char* s1, const char* s2);  // s1 starts with s2
    bool (*ends)(const char* s1, const char* s2);    // s1 ends with s2
    bool (*istarts)(const char* s1, const char* s2); // ignore case
    bool (*iends)(const char* s1, const char* s2);   // ignore case
    // string truncation is fatal use strlen() to check at call site
    void (*lower)(char* d, int32_t capacity, const char* s); // ASCII only
    void (*upper)(char* d, int32_t capacity, const char* s); // ASCII only
    // utf8/utf16 conversion
    // If `chars` argument is -1, the function utf8_bytes includes the zero
    // terminating character in the conversion and the returned byte count.
    int32_t (*utf8_bytes)(const uint16_t* utf16, int32_t bytes); // bytes count
    // If `bytes` argument is -1, the function utf16_chars() includes the zero
    // terminating character in the conversion and the returned character count.
    int32_t (*utf16_chars)(const char* utf8, int32_t bytes); // chars count
    // utf8_bytes() and utf16_chars() return -1 on invalid UTF-8/UTF-16
    // utf8_bytes(L"", -1) returns 1 for zero termination
    // utf16_chars("", -1) returns 1 for zero termination
    // chars: -1 means both source and destination are zero terminated
    errno_t (*utf16to8)(char* utf8, int32_t capacity,
                        const uint16_t* utf16, int32_t chars);
    // bytes: -1 means both source and destination are zero terminated
    errno_t (*utf8to16)(uint16_t* utf16, int32_t capacity,
                        const char* utf8, int32_t bytes);
    // https://compart.com/en/unicode/U+1F41E
    // Lady Beetle: utf16 L"\xD83D\xDC1E" utf8 "\xF0\x9F\x90\x9E"
    //           surrogates:  high   low
    bool (*utf16_is_low_surrogate)(uint16_t utf16char);
    bool (*utf16_is_high_surrogate)(uint16_t utf16char);
    uint32_t (*utf32)(const char* utf8, int32_t bytes); // single codepoint
    // string formatting printf style:
    void (*format_va)(char* utf8, int32_t count, const char* format, va_list va);
    void (*format)(char* utf8, int32_t count, const char* format, ...);
    // format "dg" digit grouped; see below for known grouping separators:
    const char* (*grouping_separator)(void); // locale
    // Returned const char* pointer is short-living thread local and
    // intended to be used in the arguments list of .format() or .printf()
    // like functions, not stored or passed for prolonged call chains.
    // See implementation for details.
    rt_str64_t (*int64_dg)(int64_t v, bool uint, const char* gs);
    rt_str64_t (*int64)(int64_t v);      // with UTF-8 thin space
    rt_str64_t (*uint64)(uint64_t v);    // with UTF-8 thin space
    rt_str64_t (*int64_lc)(int64_t v);   // with locale separator
    rt_str64_t (*uint64_lc)(uint64_t v); // with locale separator
    rt_str128_t (*fp)(const char* format, fp64_t v); // respects locale
    // errors to strings
    rt_str1024_t (*error)(int32_t error);     // en-US
    rt_str1024_t (*error_nls)(int32_t error); // national locale string
    void (*test)(void);
} rt_str_if;

// Known grouping separators
// https://en.wikipedia.org/wiki/Decimal_separator#Digit_grouping
// coma "," separated decimal
// other commonly used separators:
// underscore "_" (Fortran, Kotlin)
// apostrophe "'" (C++14, Rebol, Red)
// backtick "`"
// space "\x20"
// thin_space "\xE2\x80\x89" Unicode: U+2009

extern rt_str_if rt_str;

rt_end_c


================================================
FILE: inc/rt/rt_streams.h
================================================
#pragma once
#include "rt/rt_std.h"

rt_begin_c

typedef struct rt_stream_if rt_stream_if;

typedef struct rt_stream_if {
    errno_t (*read)(rt_stream_if* s, void* data, int64_t bytes,
                    int64_t *transferred);
    errno_t (*write)(rt_stream_if* s, const void* data, int64_t bytes,
                     int64_t *transferred);
    void    (*close)(rt_stream_if* s); // optional
} rt_stream_if;

typedef struct {
    rt_stream_if   stream;
    const void* data_read;
    int64_t     bytes_read;
    int64_t     pos_read;
    void*       data_write;
    int64_t     bytes_write;
    int64_t     pos_write;
} rt_stream_memory_if;

typedef struct {
    void (*read_only)(rt_stream_memory_if* s,  const void* data, int64_t bytes);
    void (*write_only)(rt_stream_memory_if* s, void* data, int64_t bytes);
    void (*read_write)(rt_stream_memory_if* s, const void* read, int64_t read_bytes,
                                               void* write, int64_t write_bytes);
    void (*test)(void);
} rt_streams_if;

extern rt_streams_if rt_streams;

rt_end_c


================================================
FILE: inc/rt/rt_threads.h
================================================
#pragma once
#include "rt/rt_std.h"

rt_begin_c

typedef struct rt_event_s* rt_event_t;

typedef struct {
    rt_event_t (*create)(void); // never returns null
    rt_event_t (*create_manual)(void); // never returns null
    void (*set)(rt_event_t e);
    void (*reset)(rt_event_t e);
    void (*wait)(rt_event_t e);
    // returns 0 on success or -1 on timeout
    int32_t (*wait_or_timeout)(rt_event_t e, fp64_t seconds); // seconds < 0 forever
    // returns event index or -1 on timeout or -2 on abandon
    int32_t (*wait_any)(int32_t n, rt_event_t events[]); // -1 on abandon
    int32_t (*wait_any_or_timeout)(int32_t n, rt_event_t e[], fp64_t seconds);
    void (*dispose)(rt_event_t e);
    void (*test)(void);
} rt_event_if;

extern rt_event_if rt_event;

typedef struct rt_aligned_8 rt_mutex_s { uint8_t content[40]; } rt_mutex_t;

typedef struct {
    void (*init)(rt_mutex_t* m);
    void (*lock)(rt_mutex_t* m);
    void (*unlock)(rt_mutex_t* m);
    void (*dispose)(rt_mutex_t* m);
    void (*test)(void);
} rt_mutex_if;

extern rt_mutex_if rt_mutex;

typedef struct thread_s* rt_thread_t;

typedef struct {
    rt_thread_t (*start)(void (*func)(void*), void* p); // never returns null
    errno_t     (*join)(rt_thread_t thread, fp64_t timeout_seconds); // < 0 forever
    void        (*detach)(rt_thread_t thread); // closes handle. thread is not joinable
    void        (*name)(const char* name); // names the thread
    void        (*realtime)(void); // bumps calling thread priority
    void        (*yield)(void);    // pthread_yield() / Win32: SwitchToThread()
    void        (*sleep_for)(fp64_t seconds);
    uint64_t    (*id_of)(rt_thread_t t);
    uint64_t    (*id)(void); // gettid()
    rt_thread_t (*self)(void); // Pseudo Handle may differ in access to .open(.id())
    errno_t     (*open)(rt_thread_t* t, uint64_t id);
    void        (*close)(rt_thread_t t);
    void        (*test)(void);
} rt_thread_if;

extern rt_thread_if rt_thread;

rt_end_c


================================================
FILE: inc/rt/rt_vigil.h
================================================
#pragma once
#include "rt/rt_std.h"

rt_begin_c

// better rt_assert() - augmented with printf format and parameters
// rt_swear() - release configuration rt_assert() in honor of:
// https://github.com/munificent/vigil

#define rt_static_assertion(condition) static_assert(condition, #condition)

typedef struct {
    int32_t (*failed_assertion)(const char* file, int32_t line,
        const char* func, const char* condition, const char* format, ...);
    int32_t (*fatal_termination)(const char* file, int32_t line,
        const char* func, const char* condition, const char* format, ...);
    int32_t (*fatal_if_error)(const char* file, int32_t line, const char* func,
        const char* condition, errno_t r, const char* format, ...);
    void (*test)(void);
} rt_vigil_if;

extern rt_vigil_if rt_vigil;

#if defined(DEBUG)
  #define rt_assert(b, ...) rt_suppress_constant_cond_exp           \
    /* const cond */                                                \
    (void)((!!(b)) || rt_vigil.failed_assertion(__FILE__, __LINE__, \
    __func__, #b, "" __VA_ARGS__))
#else
  #define rt_assert(b, ...) ((void)0)
#endif

// rt_swear() is runtime rt_assert() for both debug and release configurations

#define rt_swear(b, ...) rt_suppress_constant_cond_exp                 \
    /* const cond */                                                \
    (void)((!!(b)) || rt_vigil.failed_assertion(__FILE__, __LINE__, \
    __func__, #b, "" __VA_ARGS__))

#define rt_fatal(...) (void)(rt_vigil.fatal_termination(            \
    __FILE__, __LINE__,  __func__, "",  "" __VA_ARGS__))

#define rt_fatal_if(b, ...) rt_suppress_constant_cond_exp           \
    /* const cond */                                                \
    (void)((!(b)) || rt_vigil.fatal_termination(__FILE__, __LINE__, \
    __func__, #b, "" __VA_ARGS__))

#define rt_fatal_if_not(b, ...) rt_suppress_constant_cond_exp        \
    /* const cond */                                                 \
    (void)((!!(b)) || rt_vigil.fatal_termination(__FILE__, __LINE__, \
    __func__, #b, "" __VA_ARGS__))

#define rt_not_null(e, ...) rt_fatal_if((e) == null, "" __VA_ARGS__)

#define rt_fatal_if_error(r, ...) rt_suppress_constant_cond_exp      \
    /* const cond */                                                 \
    (void)(rt_vigil.fatal_if_error(__FILE__, __LINE__, __func__,     \
                                   #r, r, "" __VA_ARGS__))

#define rt_fatal_win32err(c, ...) rt_suppress_constant_cond_exp      \
    /* const cond */                                                 \
    (void)(rt_vigil.fatal_if_error(__FILE__, __LINE__, __func__,     \
                                   #c, rt_b2e(c), "" __VA_ARGS__))

rt_end_c


================================================
FILE: inc/rt/rt_work.h
================================================
#pragma once
#include "rt/rt.h"

rt_begin_c

// Minimalistic "react"-like work_queue or work items and
// a thread based workers. See rt_worker_test() for usage.

typedef struct rt_event_s*     rt_event_t;
typedef struct rt_work_s       rt_work_t;
typedef struct rt_work_queue_s rt_work_queue_t;

typedef struct rt_work_s {
    rt_work_queue_t* queue; // queue where the call is or was last scheduled
    fp64_t when;       // proc() call will be made after or at this time
    void (*work)(rt_work_t* c);
    void*  data;       // extra data that will be passed to proc() call
    rt_event_t  done;  // if not null signalled after calling proc() or canceling
    rt_work_t*  next;  // next element in the queue (implementation detail)
    bool    canceled;  // set to true inside .cancel() call
} rt_work_t;

typedef struct rt_work_queue_s {
    rt_work_t* head;
    int64_t    lock; // spinlock
    rt_event_t changed; // if not null will be signaled when head changes
} rt_work_queue_t;

typedef struct rt_work_queue_if {
    void (*post)(rt_work_t* c);
    bool (*get)(rt_work_queue_t*, rt_work_t* *c);
    void (*call)(rt_work_t* c);
    void (*dispatch)(rt_work_queue_t* q); // all ready messages
    void (*cancel)(rt_work_t* c);
    void (*flush)(rt_work_queue_t* q); // cancel all requests in the queue
} rt_work_queue_if;

extern rt_work_queue_if  rt_work_queue;

typedef struct rt_worker_s {
    rt_work_queue_t queue;
    rt_thread_t     thread;
    rt_event_t      wake;
    volatile bool   quit;
} rt_worker_t;

typedef struct rt_worker_if {
    void    (*start)(rt_worker_t* tq);
    void    (*post)(rt_worker_t* tq, rt_work_t* w);
    errno_t (*join)(rt_worker_t* tq, fp64_t timeout);
    void    (*test)(void);
} rt_worker_if;

extern rt_worker_if rt_worker;

// worker thread waits for a queue's `wake` event with the timeout
// infinity or if queue is not empty delta time till the head
// item of the queue.
//
// Upon post() call the `wake` event is set and the worker thread
// wakes up and dispatches all the items with .when less then now
// calling function work() if it is not null and optionally signaling
// .done event if it is not null.
//
// When all ready items in the queue are processed worker thread locks
// the queue and if the head is present calculates next timeout based
// on .when time of the head or sets timeout to infinity if the queue
// is empty.
//
// Function .join() sets .quit to true signals .wake event and attempt
// to join the worker .thread with specified timeout.
// It is the responsibility of the caller to ensure that no other
// work is posted after calling .join() because it will be lost.

rt_end_c

/*
    Usage examples:

    // The dispatch_until() is just for testing purposes.
    // Usually rt_work_queue.dispatch(q) will be called inside each
    // iteration of message loop of a dispatch [UI] thread.

    static void dispatch_until(rt_work_queue_t* q, int32_t* i, const int32_t n);

    // simple way of passing a single pointer to call_later

    static void every_100ms(rt_work_t* w) {
        int32_t* i = (int32_t*)w->data;
        rt_println("i: %d", *i);
        (*i)++;
        w->when = rt_clock.seconds() + 0.100;
        rt_work_queue.post(w);
    }

    static void example_1(void) {
        rt_work_queue_t queue = {0};
        // if a single pointer will suffice
        int32_t i = 0;
        rt_work_t work = {
            .queue = &queue,
            .when  = rt_clock.seconds() + 0.100,
            .work  = every_100ms,
            .data  = &i
        };
        rt_work_queue.post(&work);
        dispatch_until(&queue, &i, 4);
    }

    // extending rt_work_t with extra data:

    typedef struct rt_work_ex_s {
        union {
            rt_work_t base;
            struct rt_work_s;
        };
        struct { int32_t a; int32_t b; } s;
        int32_t i;
    } rt_work_ex_t;

    static void every_200ms(rt_work_t* w) {
        rt_work_ex_t* ex = (rt_work_ex_t*)w;
        rt_println("ex { .i: %d, .s.a: %d .s.b: %d}", ex->i, ex->s.a, ex->s.b);
        ex->i++;
        const int32_t swap = ex->s.a; ex->s.a = ex->s.b; ex->s.b = swap;
        w->when = rt_clock.seconds() + 0.200;
        rt_work_queue.post(w);
    }

    static void example_2(void) {
        rt_work_queue_t queue = {0};
        rt_work_ex_t work = {
            .queue = &queue,
            .when  = rt_clock.seconds() + 0.200,
            .work  = every_200ms,
            .data  = null,
            .s = { .a = 1, .b = 2 },
            .i = 0
        };
        rt_work_queue.post(&work.base);
        dispatch_until(&queue, &work.i, 4);
    }

    static void dispatch_until(rt_work_queue_t* q, int32_t* i, const int32_t n) {
        while (q->head != null && *i < n) {
            rt_thread.sleep_for(0.0001); // 100 microseconds
            rt_work_queue.dispatch(q);
        }
        rt_work_queue.flush(q);
    }

    // worker:

    static void do_work(rt_work_t* w) {
        // TODO: something useful
    }

    static void worker_test(void) {
        rt_worker_t worker = { 0 };
        rt_worker.start(&worker);
        rt_work_t work = {
            .when  = rt_clock.seconds() + 0.010, // 10ms
            .done  = rt_event.create(),
            .work  = do_work
        };
        rt_worker.post(&worker, &work);
        rt_event.wait(work.done);    // await(work)
        rt_event.dispose(work.done); // responsibility of the caller
        rt_fatal_if_error(rt_worker.join(&worker, -1.0));
    }

    // Hint:
    // To monitor timing turn on MSVC Output / Show Timestamp (clock button)

*/


================================================
FILE: inc/rt/version.rc.in
================================================
#include "..\inc\rt\version.h"  // rc.exe does not grok forward slashes

VS_VERSION_INFO VERSIONINFO
 FILEVERSION version_yy, version_mm, version_dd, version_hh
 PRODUCTVERSION version_yy, version_mm, version_dd, version_hh
 FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
 FILEFLAGS 0x1L
#else
 FILEFLAGS 0x0L
#endif
 FILEOS 0x4L
 FILETYPE 0x1L
 FILESUBTYPE 0x0L
BEGIN
    BLOCK "StringFileInfo"
    BEGIN
        BLOCK "040904e4"
        BEGIN
            VALUE "CompanyName", company_name
            VALUE "FileDescription", file_description
            VALUE "FileVersion", version_str
            VALUE "InternalName", original_file_name
            VALUE "LegalCopyright", copyright
            VALUE "OriginalFilename", original_file_name
            VALUE "ProductName", product_name
            VALUE "ProductVersion", version_str
        END
    END
    BLOCK "VarFileInfo"
    BEGIN
        VALUE "Translation", 0x409, 1252
    END
END


================================================
FILE: inc/ui/ui.h
================================================
#pragma once
// alphabetical order is not possible because of headers interdependencies
#include "ui/rt_std.h"
#include "ui/ui_core.h"
#include "ui/ui_colors.h"
#include "ui/ui_fuzzing.h"
#include "ui/ui_gdi.h"
#include "ui/ui_view.h"
#include "ui/ui_containers.h"
#include "ui/ui_edit_doc.h"
#include "ui/ui_edit_view.h"
#include "ui/ui_label.h"
#include "ui/ui_button.h"
#include "ui/ui_image.h"
#include "ui/ui_midi.h"
#include "ui/ui_slider.h"
#include "ui/ui_theme.h"
#include "ui/ui_toggle.h"
#include "ui/ui_mbx.h"
#include "ui/ui_caption.h"
#include "ui/ui_app.h"


================================================
FILE: inc/ui/ui_app.h
================================================
#pragma once
#include "rt/rt_std.h"

rt_begin_c

// link.exe /SUBSYSTEM:WINDOWS single window application

typedef struct ui_app_message_handler_s ui_app_message_handler_t;

typedef struct ui_app_message_handler_s {
    void* that;
    ui_app_message_handler_t* next;
    bool (*callback)(ui_app_message_handler_t* handler, int32_t m, 
                     int64_t wp, int64_t lp, int64_t* rt);
} ui_app_message_handler_t;

typedef struct ui_dpi_s { // max(dpi_x, dpi_y)
    int32_t system;  // system dpi
    int32_t process; // process dpi
    // 15" diagonal monitor 3840x2160 175% scaled
    // monitor dpi effective 168, angular 248 raw 284
    int32_t monitor_effective; // effective with regard of user scaling
    int32_t monitor_raw;       // with regard of physical screen size
    int32_t monitor_angular;   // diagonal raw
    int32_t monitor_max;       // maximum of effective,raw,angular
    int32_t window;            // main window dpi
} ui_dpi_t;

// in inches (because monitors customary are)
// it is not in points (1/72 inch) like font size
// because it is awkward to express large area
// size in typography measurements.

typedef struct ui_window_sizing_s {
    fp32_t ini_w; // initial window width in inches
    fp32_t ini_h; // 0,0 means set to min_w, min_h
    fp32_t min_w; // minimum window width in inches
    fp32_t min_h; // 0,0 means - do not care use content size
    fp32_t max_w; // maximum window width in inches
    fp32_t max_h; // 0,0 means as big as user wants
    // "sizing" "estimate or measure something's dimensions."
	// initial window sizing only used on the first invocation
	// actual user sizing is stored in the configuration and used
	// on all launches except the very first.
} ui_window_sizing_t;

typedef struct ui_fms_s {
    // when font handles are re-created on system scaling change
    // metrics "em" and font geometry filled
    ui_fm_t normal; // regular UI font ~ 11-12pt
    ui_fm_t tiny;   // small UI font ~ 8pt
    ui_fm_t title;  // Largest Title font
    ui_fm_t rubric; // Subtitle font
    ui_fm_t H1;     // bolder header font
    ui_fm_t H2;
    ui_fm_t H3;
} ui_fms_t;

typedef struct { // TODO: split to ui_app_t and ui_app_if, move data after methods
    // implemented by client:
    const char* class_name;
    // called before creating main window
    void (*init)(void);
    // called instead of init() for console apps and when .no_ui=true
    int (*main)(void);
    // class_name and init must be set before main()
    void (*opened)(void);      // window has been created and shown
    void (*every_sec)(void);   // if not null called ~ once a second
    void (*every_100ms)(void); // called ~10 times per second
    // .can_close() called before window is closed and can be
    // used in a meaning of .closing()
    bool (*can_close)(void);   // window can be closed
    void (*closed)(void);      // window has been closed
    void (*fini)(void);        // called before WinMain() return
    // must be filled by application:
    const char* title;
    ui_window_sizing_t const window_sizing;
    // TODO: struct {} visibility;
    // see: ui.visibility.*
    int32_t visibility;         // initial window_visibility state
    int32_t last_visibility;    // last window_visibility state from last run
    int32_t startup_visibility; // window_visibility from parent process
    ui_canvas_t canvas;  // set by message.paint
    // ui flags:
    bool is_full_screen;
    bool no_ui;      // do not create application window at all
    bool dark_mode;  // forced dark  mode for the whole application
    bool light_mode; // forced light mode for the whole application
    bool no_decor;   // window w/o title bar, min/max close buttons
    bool no_min;     // window w/o minimize button on title bar and sys menu
    bool no_max;     // window w/o maximize button on title bar
    bool no_size;    // window w/o maximize button on title bar
    bool no_clip;    // allows to resize window above hosting monitor size
    bool hide_on_minimize; // like task manager minimize means hide
    ui_window_t window;
    ui_icon_t icon; // may be null
    uint64_t  tid; // main thread id
    int32_t   exit_code; // application exit code
    ui_dpi_t  dpi;
    ui_rect_t wrc;  // window rectangle including non-client area
    ui_rect_t crc;  // client rectangle
    ui_rect_t mrc;  // monitor rectangle
    ui_rect_t prc;  // previously invalidated paint rectangle inside crc
    ui_rect_t work_area; // current monitor work area
    int32_t   caption_height; // caption height
    ui_wh_t   border;    // frame border size
    // not to call rt_clock.seconds() too often:
    fp64_t     now;  // ssb "seconds since boot" updated on each message
    ui_view_t* root; // show_window() changes ui.hidden
    ui_view_t* content;
    ui_view_t* caption;
    ui_view_t* focus; // does not affect message routing
    struct { // font metrics and handles
        ui_fms_t prop;  // proportional fonts
        ui_fms_t mono;  // monospaced fonts
    } fm;
    // TODO: struct {} keyboard
    // keyboard state now:
    bool alt;
    bool ctrl;
    bool shift;
    // TODO: struct {} mouse
    // mouse buttons state
    bool mouse_swapped;
    bool mouse_left;   // left or if buttons are swapped - right button pressed
    bool mouse_middle; // rarely useful
    bool mouse_right;  // context button pressed
    ui_point_t mouse; // mouse/touchpad pointer
    ui_cursor_t cursor; // current cursor
    struct {
        ui_cursor_t arrow;
        ui_cursor_t wait;
        ui_cursor_t ibeam;
        ui_cursor_t size_nwse; // north west - south east
        ui_cursor_t size_nesw; // north east - south west
        ui_cursor_t size_we;   // west - east
        ui_cursor_t size_ns;   // north - south
        ui_cursor_t size_all;  // north - south
    } cursors;
    struct { // animated_groot state
        ui_view_t* view;
        ui_view_t* focused; // focused view before animated_groot started
        int32_t step;
        fp64_t time; // closing time or zero
        int32_t x; // (x,y) for tooltip (-1,y) for toast
        int32_t y; // screen coordinates for tooltip
    } animating;
    ui_app_message_handler_t* handlers;
    // post(..., delay_in_seconds, ...) can be scheduled from any thread executed
    // on UI thread
    void (*post)(rt_work_t* work); // work.when == 0 meaning ASAP
    void (*request_redraw)(void);  // very fast <2 microseconds
    void (*draw)(void); // paint window now - bad idea do not use
    // inch to pixels and reverse translation via ui_app.dpi.window
    fp32_t  (*px2in)(int32_t pixels);
    int32_t (*in2px)(fp32_t inches);
    errno_t (*set_layered_window)(ui_color_t color, float alpha);
    bool (*is_active)(void); // is application window active
    bool (*is_minimized)(void);
    bool (*is_maximized)(void);
    bool (*focused)(void); // application window has keyboard focus
    void (*activate)(void); // request application window activation
    void (*set_title)(const char* title);
    void (*capture_mouse)(bool on); // capture mouse global input on/of
    void (*move_and_resize)(const ui_rect_t* rc);
    void (*bring_to_foreground)(void); // not necessary topmost
    void (*make_topmost)(void);   // in foreground hierarchy of windows
    void (*request_focus)(void);  // request application window keyboard focus
    void (*bring_to_front)(void); // activate() + bring_to_foreground() +
                                  // make_topmost() + request_focus()
    // measure and layout:
    void (*request_layout)(void); // requests layout on UI tree before paint()
    void (*invalidate)(const ui_rect_t* rc);
    void (*full_screen)(bool on);
    void (*set_cursor)(ui_cursor_t c);
    void (*close)(void); // attempts to close (can_close() permitting)
    // forced quit() even if can_close() returns false
    void (*quit)(int32_t ec);  // ui_app.exit_code = ec; PostQuitMessage(ec);
    ui_timer_t (*set_timer)(uintptr_t id, int32_t milliseconds); // see notes
    void (*kill_timer)(ui_timer_t id);
    void (*show_window)(int32_t show); // see show_window enum
    void (*show_toast)(ui_view_t* toast, fp64_t seconds); // toast(null) to cancel
    void (*show_hint)(ui_view_t* tooltip, int32_t x, int32_t y, fp64_t seconds);
    void (*toast_va)(fp64_t seconds, const char* format, va_list va);
    void (*toast)(fp64_t seconds, const char* format, ...);
    // caret calls must be balanced by caller
    void (*create_caret)(int32_t w, int32_t h);
    void (*show_caret)(void);
    void (*move_caret)(int32_t x, int32_t y);
    void (*hide_caret)(void);
    void (*destroy_caret)(void);
    // beep sounds:
    void (*beep)(int32_t kind);
    // registry interface:
    void (*data_save)(const char* name, const void* data, int32_t bytes);
    int32_t (*data_size)(const char* name);
    int32_t (*data_load)(const char* name, void* data, int32_t bytes); // returns bytes read
    // filename dialog:
    // const char* filter[] =
    //     {"Text Files", ".txt;.doc;.ini",
    //      "Executables", ".exe",
    //      "All Files", "*"};
    // const char* fn = ui_app.open_filename("C:\\", filter, rt_countof(filter));
    const char* (*open_file)(const char* folder, const char* filter[], int32_t n);
    bool (*is_stdout_redirected)(void);
    bool (*is_console_visible)(void);
    int  (*console_attach)(void); // attempts to attach to parent terminal
    int  (*console_create)(void); // allocates new console
    void (*console_show)(bool b);
    // stats:
    int32_t paint_count; // number of paint calls
    fp64_t paint_time; // last paint duration in seconds
    fp64_t paint_max;  // max of last 128 paint
    fp64_t paint_avg;  // EMA of last 128 paints
    fp64_t paint_fps;  // EMA of last 128 paints
    fp64_t paint_last; // rt_clock.seconds() of last paint
    fp64_t paint_dt_min; // minimum time between 2 paints
} ui_app_t;

extern ui_app_t ui_app;

rt_end_c


================================================
FILE: inc/ui/ui_button.h
================================================
#pragma once
#include "rt/rt_std.h"
#include "ui/ui_view.h"

rt_begin_c

typedef ui_view_t ui_button_t;

void ui_view_init_button(ui_view_t* v);

void ui_button_init(ui_button_t* b, const char* label, fp32_t min_width_em,
    void (*callback)(ui_button_t* b));

// ui_button_clicked can only be used on static button variables

#define ui_button_clicked(name, s, min_width_em, ...)       \
    static void name ## _clicked(ui_button_t* name) {       \
        (void)name; /* no warning if unused */              \
        { __VA_ARGS__ }                                     \
    }                                                       \
    static                                                  \
    ui_button_t name = {                                    \
        .type = ui_view_button,                             \
        .init = ui_view_init_button,                        \
        .fm = &ui_app.fm.prop.normal,                       \
        .p.text = s,                                        \
        .callback = name ## _clicked,                       \
        .color_id = ui_color_id_button_text,                \
        .min_w_em = min_width_em, .min_h_em = 1.25f,        \
        .insets  = {                                        \
            .left  = ui_view_i_lr, .top    = ui_view_i_tb,  \
            .right = ui_view_i_lr, .bottom = ui_view_i_tb   \
        },                                                  \
        .padding = {                                        \
            .left  = ui_view_p_lr, .top    = ui_view_p_tb,  \
            .right = ui_view_p_lr, .bottom = ui_view_p_tb,  \
        }                                                   \
    }

#define ui_button(s, min_width_em, clicked) {               \
    .type = ui_view_button,                                 \
    .init = ui_view_init_button,                            \
    .fm = &ui_app.fm.prop.normal,                           \
    .p.text = s,                                            \
    .callback = clicked,                                    \
    .color_id = ui_color_id_button_text,                    \
    .min_w_em = min_width_em, .min_h_em = 1.25f,            \
    .insets  = {                                            \
        .left  = ui_view_i_lr, .top    = ui_view_i_tb,      \
        .right = ui_view_i_lr, .bottom = ui_view_i_tb       \
    },                                                      \
    .padding = {                                            \
        .left  = ui_view_p_lr, .top    = ui_view_p_tb,      \
        .right = ui_view_p_lr, .bottom = ui_view_p_tb,      \
    }                                                       \
}

// usage:
//
// ui_button_clicked(button, "&Button", 7.0, {
//      if (button->state.pressed) {
//          // do something on click that happens on release mouse button
//      }
// })
//
// or:
//
// static void button_flipped(ui_button_t* b) {
//      swear(b->flip == true); // 2 state button, clicked on mouse press button
//      if (b->state.pressed) {
//          // show something:
//      } else {
//          // show something else:
//      }
// }
//
// ui_button_t button = ui_button(7.0, "&Button", button_flipped);
//
// or
//
// ui_button_t button = ui_view)button(button);
// ui_view.set_text(button.text, "&Button");
// button.min_w_em = 7.0;
// button.callback = button_flipped;
//
// Note:
// ui_button_clicked(button, "&Button", 7.0, {
//      button->state.pressed = !button->state.pressed;
//      // is similar to: button.flip = true but it leads thru
//      // multiple button paint and click happens on mouse button
//      // release not press
// }


rt_end_c


================================================
FILE: inc/ui/ui_caption.h
================================================
/* Copyright (c) Dmitry "Leo" Kuznetsov 2021-24 see LICENSE for details */
#include "ui/ui.h"

rt_begin_c

typedef struct ui_caption_s {
    ui_view_t view;
    // caption`s children:
    ui_button_t icon;
    ui_label_t title;
    ui_view_t spacer;
    ui_button_t menu; // use: ui_caption.button_menu.cb := your callback
    ui_button_t mode; // switch between dark/light mode
    ui_button_t mini;
    ui_button_t maxi;
    ui_button_t full;
    ui_button_t quit;
} ui_caption_t;

extern ui_caption_t ui_caption;

rt_end_c


================================================
FILE: inc/ui/ui_colors.h
================================================
#pragma once
#include "rt/rt_std.h"

rt_begin_c

typedef uint64_t ui_color_t; // top 2 bits determine color format

/* TODO: make ui_color_t uint64_t RGBA or better yet fp32_t RGBA
         support upto 16-16-16-14(A)bit per pixel color
         components with 'transparent' aka 'hollow' bit
*/

#define ui_color_mask        ((ui_color_t)0xC000000000000000ULL)
#define ui_color_undefined   ((ui_color_t)0x8000000000000000ULL)
#define ui_color_transparent ((ui_color_t)0x4000000000000000ULL)
#define ui_color_hdr         ((ui_color_t)0xC000000000000000ULL)

#define ui_color_is_8bit(c)        ( ((c) &  ui_color_mask) == 0)
#define ui_color_is_hdr(c)         ( ((c) &  ui_color_mask) == ui_color_hdr)
#define ui_color_is_undefined(c)   ( ((c) &  ui_color_mask) == ui_color_undefined)
#define ui_color_is_transparent(c) ((((c) &  ui_color_mask) == ui_color_transparent) && \
                                   ( ((c) & ~ui_color_mask) == 0))
// if any other special colors or formats need to be introduced
// (c) & ~ui_color_mask) has 2^62 possible extensions bits

// ui_color_hdr A - 14 bit, R,G,B - 16 bit, all in range [0..0xFFFF]
#define ui_color_hdr_a(c)    ((uint16_t)((((c) >> 48) & 0x3FFF) << 2))
#define ui_color_hdr_r(c)    ((uint16_t)( ((c) >>  0) & 0xFFFF))
#define ui_color_hdr_g(c)    ((uint16_t)( ((c) >> 16) & 0xFFFF))
#define ui_color_hdr_b(c)    ((uint16_t)( ((c) >> 32) & 0xFFFF))

#define ui_color_a(c)        ((uint8_t)(((c) >> 24) & 0xFFU))
#define ui_color_r(c)        ((uint8_t)(((c) >>  0) & 0xFFU))
#define ui_color_g(c)        ((uint8_t)(((c) >>  8) & 0xFFU))
#define ui_color_b(c)        ((uint8_t)(((c) >> 16) & 0xFFU))

#define ui_color_is_rgb(c)   ((uint32_t)( (c) & 0x00FFFFFFU))
#define ui_color_is_rgba(c)  ((uint32_t)( (c) & 0xFFFFFFFFU))
#define ui_color_is_rgbFF(c) ((uint32_t)(((c) & 0x00FFFFFFU)) | 0xFF000000U)

#define ui_color_rgb(r, g, b) ((ui_color_t)(                     \
                              (((uint32_t)(uint8_t)(r))      ) | \
                              (((uint32_t)(uint8_t)(g)) <<  8) | \
                              (((uint32_t)(uint8_t)(b)) << 16)))


#define ui_color_rgba(r, g, b, a)                     \
    ( (ui_color_t)(                                   \
      (ui_color_rgb(r, g, b)) |                       \
      ((ui_color_t)((uint32_t)((uint8_t)(a))) << 24)) \
    )

enum {
    ui_color_id_undefined           =  0,
    ui_color_id_active_title        =  1,
    ui_color_id_button_face         =  2,
    ui_color_id_button_text         =  3,
    ui_color_id_gray_text           =  4,
    ui_color_id_highlight           =  5,
    ui_color_id_highlight_text      =  6,
    ui_color_id_hot_tracking        =  7,
    ui_color_id_inactive_title      =  8,
    ui_color_id_inactive_title_text =  9,
    ui_color_id_menu_highlight      = 10,
    ui_color_id_title_text          = 11,
    ui_color_id_window              = 12,
    ui_color_id_window_text         = 13,
    ui_color_id_accent              = 14
};

typedef struct ui_control_colors_s {
    ui_color_t text;
    ui_color_t background;
    ui_color_t border;
    ui_color_t accent; // aka highlight
    ui_color_t gradient_top;
    ui_color_t gradient_bottom;
} control_colors_t;

typedef struct ui_control_state_colors_s {
    control_colors_t disabled;
    control_colors_t enabled;
    control_colors_t hover;
    control_colors_t armed;
    control_colors_t pressed;
} ui_control_state_colors_t;

typedef struct ui_colors_s {
    ui_color_t (*get_color)(int32_t color_id); // ui.colors.*
    void       (*rgb_to_hsi)(fp64_t r, fp64_t g, fp64_t b, fp64_t *h, fp64_t *s, fp64_t *i);
    ui_color_t (*hsi_to_rgb)(fp64_t h, fp64_t s, fp64_t i,  uint8_t a);
    // interpolate():
    //    0.0 < multiplier < 1.0 excluding boundaries
    //    alpha is interpolated as well
    ui_color_t (*interpolate)(ui_color_t c0, ui_color_t c1, fp32_t multiplier);
    ui_color_t (*gray_with_same_intensity)(ui_color_t c);
    // multiplier ]0.0..1.0] excluding zero
    // lighten() and darken() ignore alpha (use interpolate for alpha colors)
    ui_color_t (*lighten)(ui_color_t rgb, fp32_t multiplier); // interpolate toward white
    ui_color_t (*darken)(ui_color_t  rgb, fp32_t multiplier); // interpolate toward black
    ui_color_t (*adjust_saturation)(ui_color_t c,   fp32_t multiplier);
    ui_color_t (*multiply_brightness)(ui_color_t c, fp32_t multiplier);
    ui_color_t (*multiply_saturation)(ui_color_t c, fp32_t multiplier);
    ui_control_state_colors_t* controls; // colors for UI controls
    ui_color_t const transparent;
    ui_color_t const none; // aka CLR_INVALID in wingdi.h
    ui_color_t const text;
    ui_color_t const white;
    ui_color_t const black;
    ui_color_t const red;
    ui_color_t const green;
    ui_color_t const blue;
    ui_color_t const yellow;
    ui_color_t const cyan;
    ui_color_t const magenta;
    ui_color_t const gray;
    // tone down RGB colors:
    ui_color_t const tone_white;
    ui_color_t const tone_red;
    ui_color_t const tone_green;
    ui_color_t const tone_blue;
    ui_color_t const tone_yellow;
    ui_color_t const tone_cyan;
    ui_color_t const tone_magenta;
    // miscellaneous:
    ui_color_t const orange;
    ui_color_t const dark_green;
    ui_color_t const pink;
    ui_color_t const ochre;
    ui_color_t const gold;
    ui_color_t const teal;
    ui_color_t const wheat;
    ui_color_t const tan;
    ui_color_t const brown;
    ui_color_t const maroon;
    ui_color_t const barbie_pink;
    ui_color_t const steel_pink;
    ui_color_t const salmon_pink;
    ui_color_t const gainsboro;
    ui_color_t const light_gray;
    ui_color_t const silver;
    ui_color_t const dark_gray;
    ui_color_t const dim_gray;
    ui_color_t const light_slate_gray;
    ui_color_t const slate_gray;
    /* Named colors */
    /* Main Panel Backgrounds */
    ui_color_t const ennui_black; // rgb(18, 18, 18) 0x121212
    ui_color_t const charcoal;
    ui_color_t const onyx;
    ui_color_t const gunmetal;
    ui_color_t const jet_black;
    ui_color_t const outer_space;
    ui_color_t const eerie_black;
    ui_color_t const oil;
    ui_color_t const black_coral;
    ui_color_t const obsidian;
    /* Secondary Panels or Sidebars */
    ui_color_t const raisin_black;
    ui_color_t const dark_charcoal;
    ui_color_t const dark_jungle_green;
    ui_color_t const pine_tree;
    ui_color_t const rich_black;
    ui_color_t const eclipse;
    ui_color_t const cafe_noir;
    /* Flat Buttons */
    ui_color_t const prussian_blue;
    ui_color_t const midnight_green;
    ui_color_t const charleston_green;
    ui_color_t const rich_black_fogra;
    ui_color_t const dark_liver;
    ui_color_t const dark_slate_gray;
    ui_color_t const black_olive;
    ui_color_t const cadet;
    /* Button highlights (hover) */
    ui_color_t const dark_sienna;
    ui_color_t const bistre_brown;
    ui_color_t const dark_puce;
    ui_color_t const wenge;
    /* Raised button effects */
    ui_color_t const dark_scarlet;
    ui_color_t const burnt_umber;
    ui_color_t const caput_mortuum;
    ui_color_t const barn_red;
    /* Text and Icons */
    ui_color_t const platinum;
    ui_color_t const anti_flash_white;
    ui_color_t const silver_sand;
    ui_color_t const quick_silver;
    /* Links and Selections */
    ui_color_t const dark_powder_blue;
    ui_color_t const sapphire_blue;
    ui_color_t const international_klein_blue;
    ui_color_t const zaffre;
    /* Additional Colors */
    ui_color_t const fish_belly;
    ui_color_t const rusty_red;
    ui_color_t const falu_red;
    ui_color_t const cordovan;
    ui_color_t const dark_raspberry;
    ui_color_t const deep_magenta;
    ui_color_t const byzantium;
    ui_color_t const amethyst;
    ui_color_t const wisteria;
    ui_color_t const lavender_purple;
    ui_color_t const opera_mauve;
    ui_color_t const mauve_taupe;
    ui_color_t const rich_lavender;
    ui_color_t const pansy_purple;
    ui_color_t const violet_eggplant;
    ui_color_t const jazzberry_jam;
    ui_color_t const dark_orchid;
    ui_color_t const electric_purple;
    ui_color_t const sky_magenta;
    ui_color_t const brilliant_rose;
    ui_color_t const fuchsia_purple;
    ui_color_t const french_raspberry;
    ui_color_t const wild_watermelon;
    ui_color_t const neon_carrot;
    ui_color_t const burnt_orange;
    ui_color_t const carrot_orange;
    ui_color_t const tiger_orange;
    ui_color_t const giant_onion;
    ui_color_t const rust;
    ui_color_t const copper_red;
    ui_color_t const dark_tangerine;
    ui_color_t const bright_marigold;
    ui_color_t const bone;
    /* Earthy Tones */
    ui_color_t const sienna;
    ui_color_t const sandy_brown;
    ui_color_t const golden_brown;
    ui_color_t const camel;
    ui_color_t const burnt_sienna;
    ui_color_t const khaki;
    ui_color_t const dark_khaki;
    /* Greens */
    ui_color_t const fern_green;
    ui_color_t const moss_green;
    ui_color_t const myrtle_green;
    ui_color_t const pine_green;
    ui_color_t const jungle_green;
    ui_color_t const sacramento_green;
    /* Blues */
    ui_color_t const yale_blue;
    ui_color_t const cobalt_blue;
    ui_color_t const persian_blue;
    ui_color_t const royal_blue;
    ui_color_t const iceberg;
    ui_color_t const blue_yonder;
    /* Miscellaneous */
    ui_color_t const cocoa_brown;
    ui_color_t const cinnamon_satin;
    ui_color_t const fallow;
    ui_color_t const cafe_au_lait;
    ui_color_t const liver;
    ui_color_t const shadow;
    ui_color_t const cool_grey;
    ui_color_t const payne_grey;
    /* Lighter Tones for Contrast */
    ui_color_t const timberwolf;
    ui_color_t const silver_chalice;
    ui_color_t const roman_silver;
    /* Dark Mode Specific Highlights */
    ui_color_t const electric_lavender;
    ui_color_t const magenta_haze;
    ui_color_t const cyber_grape;
    ui_color_t const purple_navy;
    ui_color_t const liberty;
    ui_color_t const purple_mountain_majesty;
    ui_color_t const ceil;
    ui_color_t const moonstone_blue;
    ui_color_t const independence;
} ui_colors_if;

extern ui_colors_if ui_colors;

// TODO:
// https://ankiewicz.com/colors/
// https://htmlcolorcodes.com/color-names/
// it would be super cool to implement a plethora of palettes
// with named colors and app "themes" that can be switched

rt_end_c


================================================
FILE: inc/ui/ui_containers.h
================================================
/* Copyright (c) Dmitry "Leo" Kuznetsov 2021-24 see LICENSE for details */
#include "ui/ui.h"

rt_begin_c

typedef struct ui_view_s ui_view_t;

// Usage:
//
// ui_view_t* stack  = ui_view(stack);
// ui_view_t* horizontal = ui_view(ui_view_span);
// ui_view_t* vertical   = ui_view(ui_view_list);
//
// containers automatically layout child views
// similar to SwiftUI HStack and VStack taking .align
// .insets and .padding into account.
//
// Container positions every child views in the center,
// top bottom left right edge or any of 4 corners
// depending on .align values.
// if child view has .max_w or .max_h set to ui.infinity == INT32_MAX
// the views are expanded to fill the container in specified
// direction. If child .max_w or .max_h is set to > .w or .h
// the child view .w .h measurement are expanded accordingly.
//
// All containers are transparent and inset by 1/4 of an "em"
// Except ui_app.root,caption,content which are also containers
// but are not inset or padded and have default background color.
//
// Application implementer can override this after
//
// void opened(void) {
//     ui_view.add(ui_app.view, ..., null);
//     ui_app.view->insets = (ui_margins_t) {
//         .left  = 0.25, .top    = 0.25,
//         .right = 0.25, .bottom = 0.25 };
//     ui_app.view->color = ui_colors.dark_scarlet;
// }

typedef struct ui_view_s ui_view_t;

#define ui_view(view_type) {            \
    .type = (ui_view_ ## view_type),    \
    .init = ui_view_init_ ## view_type, \
    .fm   = &ui_app.fm.prop.normal,     \
    .color = ui_color_transparent,      \
    .color_id = 0                       \
}

void ui_view_init_stack(ui_view_t* v);
void ui_view_init_span(ui_view_t* v);
void ui_view_init_list(ui_view_t* v);
void ui_view_init_spacer(ui_view_t* v);

rt_end_c


================================================
FILE: inc/ui/ui_core.h
================================================
#pragma once
#include "rt/rt_std.h"

rt_begin_c

typedef struct ui_point_s { int32_t x, y; } ui_point_t;
typedef struct ui_rect_s { int32_t x, y, w, h; } ui_rect_t;
typedef struct ui_ltbr_s { int32_t left, top, right, bottom; } ui_ltrb_t;
typedef struct ui_wh_s   { int32_t w, h; } ui_wh_t;

typedef struct ui_window_s*  ui_window_t;
typedef struct ui_icon_s*    ui_icon_t;
typedef struct ui_canvas_s*  ui_canvas_t;
typedef struct ui_texture_s* ui_texture_t;
typedef struct ui_font_s*    ui_font_t;
typedef struct ui_brush_s*   ui_brush_t;
typedef struct ui_pen_s*     ui_pen_t;
typedef struct ui_cursor_s*  ui_cursor_t;
typedef struct ui_region_s*  ui_region_t;

typedef uintptr_t ui_timer_t; // timer not the same as "id" in set_timer()!

typedef struct ui_bitmap_s { // TODO: ui_ namespace
    void* pixels;
    int32_t w; // width
    int32_t h; // height
    int32_t bpp;    // "components" bytes per pixel
    int32_t stride; // bytes per scanline rounded up to: (w * bpp + 3) & ~3
    ui_texture_t texture; // device allocated texture handle
} ui_bitmap_t;

// ui_margins_t are used for padding and insets and expressed
// in partial "em"s not in pixels, inches or points.
// Pay attention that "em" is not square. "M" measurement
// for most fonts are em.w = 0.5 * em.h
// .em square pixel size of glyph "m"
// https://en.wikipedia.org/wiki/Em_(typography)

typedef struct ui_gaps_s { // in partial "em"s
    fp32_t left;
    fp32_t top;
    fp32_t right;
    fp32_t bottom;
} ui_margins_t;

typedef struct ui_s {
    bool (*point_in_rect)(const ui_point_t* p, const ui_rect_t* r);
    // intersect_rect(null, r0, r1) and intersect_rect(r0, r0, r1) supported.
    bool (*intersect_rect)(ui_rect_t* destination, const ui_rect_t* r0,
                                                   const ui_rect_t* r1);
    ui_rect_t (*combine_rect)(const ui_rect_t* r0, const ui_rect_t* r1);
    const int32_t infinity; // = INT32_MAX, look better
    struct { // align bitset
        int32_t const center; // = 0, default
        int32_t const left;   // left|top, left|bottom, right|bottom
        int32_t const top;
        int32_t const right;  // right|top, right|bottom
        int32_t const bottom;
    } const align;
    struct { // window visibility
        int32_t const hide;
        int32_t const normal;   // should be use for first .show()
        int32_t const minimize; // activate and minimize
        int32_t const maximize; // activate and maximize
        int32_t const normal_na;// same as .normal but no activate
        int32_t const show;     // shows and activates in current size and position
        int32_t const min_next; // minimize and activate next window in Z order
        int32_t const min_na;   // minimize but do not activate
        int32_t const show_na;  // same as .show but no activate
        int32_t const restore;  // from min/max to normal window size/pos
        int32_t const defau1t;  // use Windows STARTUPINFO value
        int32_t const force_min;// minimize even if dispatch thread not responding
    } const visibility;
    // TODO: remove or move inside app
    struct { // message:
        int32_t const animate;
        int32_t const opening;
        int32_t const closing;
   } const message;
   // TODO: remove or move inside app
   struct { // mouse buttons bitset mask
        struct {
            int32_t const left;
            int32_t const right;
        } button;
    } const mouse;
    struct { // window decorations hit test results
        int32_t const error;            // -2
        int32_t const transparent;      // -1
        int32_t const nowhere;          // 0
        int32_t const client;           // 1
        int32_t const caption;          // 2
        int32_t const system_menu;      // 3
        int32_t const grow_box;         // 4
        int32_t const menu;             // 5
        int32_t const horizontal_scroll;// 6
        int32_t const vertical_scroll;  // 7
        int32_t const min_button;       // 8
        int32_t const max_button;       // 9
        int32_t const left;             // 10
        int32_t const right;            // 11
        int32_t const top;              // 12
        int32_t const top_left;         // 13
        int32_t const top_right;        // 14
        int32_t const bottom;           // 15
        int32_t const bottom_left;      // 16
        int32_t const bottom_right;     // 17
        int32_t const border;           // 18
        int32_t const object;           // 19
        int32_t const close;            // 20
        int32_t const help;             // 21
    } const hit_test;
    struct { // virtual keyboard keys
        int32_t const up;
        int32_t const down;
        int32_t const left;
        int32_t const right;
        int32_t const home;
        int32_t const end;
        int32_t const page_up;
        int32_t const page_down;
        int32_t const insert;
        int32_t const del;
        int32_t const back;
        int32_t const escape;
        int32_t const enter;
        int32_t const plus;
        int32_t const minus;
        int32_t const f1;
        int32_t const f2;
        int32_t const f3;
        int32_t const f4;
        int32_t const f5;
        int32_t const f6;
        int32_t const f7;
        int32_t const f8;
        int32_t const f9;
        int32_t const f10;
        int32_t const f11;
        int32_t const f12;
        int32_t const f13;
        int32_t const f14;
        int32_t const f15;
        int32_t const f16;
        int32_t const f17;
        int32_t const f18;
        int32_t const f19;
        int32_t const f20;
        int32_t const f21;
        int32_t const f22;
        int32_t const f23;
        int32_t const f24;
    } const key;
    struct {
        int32_t const ok;
        int32_t const info;
        int32_t const question;
        int32_t const warning;
        int32_t const error;
    } beep;
} ui_if;

extern ui_if ui;

// ui_margins_t in "em"s:
//
// The reason is that UI fonts may become larger smaller
// for accessibility reasons with the same display
// density in DPIs. Humanoid would expect the margins around
// larger font text to grow with font size increase.
// SwingUI and MacOS is using "pt" for padding which does
// not account to font size changes. MacOS does weird stuff
// with font increase - it actually decreases GPU resolution.
// Android uses "dp" which is pretty much the same as scaled
// "pixels" on MacOS. Windows used to use "dialog units" which
// is font size based and this is where the idea is inherited from.

rt_end_c



================================================
FILE: inc/ui/ui_edit_doc.h
================================================
#pragma once
/* Copyright (c) Dmitry "Leo" Kuznetsov 2021-24 see LICENSE for details */
#include "rt/rt.h"
#include "ui/ui.h"

rt_begin_c

typedef struct ui_edit_str_s ui_edit_str_t;

typedef struct ui_edit_doc_s ui_edit_doc_t;

typedef struct ui_edit_notify_s ui_edit_notify_t;

typedef struct ui_edit_to_do_s ui_edit_to_do_t;

typedef struct ui_edit_pg_s { // page/glyph coordinates
    // humans used to line:column coordinates in text
    int32_t pn; // zero based paragraph number ("line number")
    int32_t gp; // zero based glyph position ("column")
} ui_edit_pg_t;

typedef union rt_begin_packed ui_edit_range_s {
    struct { ui_edit_pg_t from; ui_edit_pg_t to; };
    ui_edit_pg_t a[2];
} rt_end_packed ui_edit_range_t; // "from"[0] "to"[1]

typedef struct ui_edit_text_s {
    int32_t np;   // number of paragraphs
    ui_edit_str_t* ps; // ps[np] paragraphs
} ui_edit_text_t;

typedef struct ui_edit_notify_info_s {
    bool ok; // false if ui_edit_view.replace() failed (bad utf8 or no memory)
    const ui_edit_doc_t*   const d;
    const ui_edit_range_t* const r; // range to be replaced
    const ui_edit_range_t* const x; // extended range (replacement)
    const ui_edit_text_t*  const t; // replacement text
    // d->text.np number of paragraphs may change after replace
    // before/after: [pnf..pnt] is inside [0..d->text.np-1]
    int32_t const pnf; // paragraph number from
    int32_t const pnt; // paragraph number to. (inclusive)
    // one can safely assume that ps[pnf] was modified
    // except empty range replace with empty text (which shouldn't be)
    // d->text.ps[pnf..pnf + deleted] were deleted
    // d->text.ps[pnf..pnf + inserted] were inserted
    int32_t const deleted;  // number of deleted  paragraphs (before: 0)
    int32_t const inserted; // paragraph inserted paragraphs (before: 0)
} ui_edit_notify_info_t;

typedef struct ui_edit_notify_s { // called before and after replace()
    void (*before)(ui_edit_notify_t* notify, const ui_edit_notify_info_t* ni);
    // after() is called even if replace() failed with ok: false
    void (*after)(ui_edit_notify_t* notify, const ui_edit_notify_info_t* ni);
} ui_edit_notify_t;

typedef struct ui_edit_listener_s ui_edit_listener_t;

typedef struct ui_edit_listener_s {
    ui_edit_notify_t* notify;
    ui_edit_listener_t* prev;
    ui_edit_listener_t* next;
} ui_edit_listener_t;

typedef struct ui_edit_to_do_s { // undo/redo action
    ui_edit_range_t  range;
    ui_edit_text_t   text;
    ui_edit_to_do_t* next; // inside undo or redo list
} ui_edit_to_do_t;

typedef struct ui_edit_doc_s {
    ui_edit_text_t   text;
    ui_edit_to_do_t* undo; // undo stack
    ui_edit_to_do_t* redo; // redo stack
    ui_edit_listener_t* listeners;
} ui_edit_doc_t;

typedef struct ui_edit_doc_if {
    // init(utf8, bytes, heap:false) must have longer lifetime
    // than document, otherwise use heap: true to copy
    bool    (*init)(ui_edit_doc_t* d, const char* utf8_or_null,
                    int32_t bytes, bool heap);
    bool    (*replace)(ui_edit_doc_t* d, const ui_edit_range_t* r,
                const char* utf8, int32_t bytes);
    int32_t (*bytes)(const ui_edit_doc_t* d, const ui_edit_range_t* range);
    bool    (*copy_text)(ui_edit_doc_t* d, const ui_edit_range_t* range,
                ui_edit_text_t* text); // retrieves range into string
    int32_t (*utf8bytes)(const ui_edit_doc_t* d, const ui_edit_range_t* range);
    // utf8 must be at least ui_edit_doc.utf8bytes()
    void    (*copy)(ui_edit_doc_t* d, const ui_edit_range_t* range,
                char* utf8, int32_t bytes);
    // undo() and push reverse into redo stack
    bool (*undo)(ui_edit_doc_t* d); // false if there is nothing to redo
    // redo() and push reverse into undo stack
    bool (*redo)(ui_edit_doc_t* d); // false if there is nothing to undo
    bool (*subscribe)(ui_edit_doc_t* d, ui_edit_notify_t* notify);
    void (*unsubscribe)(ui_edit_doc_t* d, ui_edit_notify_t* notify);
    void (*dispose_to_do)(ui_edit_to_do_t* to_do);
    void (*dispose)(ui_edit_doc_t* d);
    void (*test)(void);
} ui_edit_doc_if;

extern ui_edit_doc_if ui_edit_doc;

typedef struct ui_edit_range_if {
    int (*compare)(const ui_edit_pg_t pg1, const ui_edit_pg_t pg2);
    ui_edit_range_t (*order)(const ui_edit_range_t r);
    bool            (*is_valid)(const ui_edit_range_t r);
    bool            (*is_empty)(const ui_edit_range_t r);
    uint64_t        (*uint64)(const ui_edit_pg_t pg); // (p << 32 | g)
    ui_edit_pg_t    (*pg)(uint64_t ui64); // p: (ui64 >> 32) g: (int32_t)ui64
    bool            (*inside)(const ui_edit_text_t* t,
                              const ui_edit_range_t r);
    ui_edit_range_t (*intersect)(const ui_edit_range_t r1,
                                 const ui_edit_range_t r2);
    const ui_edit_range_t* const invalid_range; // {{-1,-1},{-1,-1}}
} ui_edit_range_if;

extern ui_edit_range_if ui_edit_range;

typedef struct ui_edit_text_if {
    bool    (*init)(ui_edit_text_t* t, const char* utf, int32_t b, bool heap);

    int32_t (*bytes)(const ui_edit_text_t* t, const ui_edit_range_t* r);
    // end() last paragraph, last glyph in text
    ui_edit_pg_t    (*end)(const ui_edit_text_t* t);
    ui_edit_range_t (*end_range)(const ui_edit_text_t* t);
    ui_edit_range_t (*all_on_null)(const ui_edit_text_t* t,
                                   const ui_edit_range_t* r);
    ui_edit_range_t (*ordered)(const ui_edit_text_t* t,
                               const ui_edit_range_t* r);
    bool    (*dup)(ui_edit_text_t* t, const ui_edit_text_t* s);
    bool    (*equal)(const ui_edit_text_t* t1, const ui_edit_text_t* t2);
    bool    (*copy_text)(const ui_edit_text_t* t, const ui_edit_range_t* range,
                ui_edit_text_t* to);
    void    (*copy)(const ui_edit_text_t* t, const ui_edit_range_t* range,
                char* to, int32_t bytes);
    bool    (*replace)(ui_edit_text_t* t, const ui_edit_range_t* r,
                const ui_edit_text_t* text, ui_edit_to_do_t* undo_or_null);
    bool    (*replace_utf8)(ui_edit_text_t* t, const ui_edit_range_t* r,
                const char* utf8, int32_t bytes, ui_edit_to_do_t* undo_or_null);
    void    (*dispose)(ui_edit_text_t* t);
} ui_edit_text_if;

extern ui_edit_text_if ui_edit_text;

typedef struct rt_begin_packed ui_edit_str_s {
    char* u;    // always correct utf8 bytes not zero terminated(!) sequence
    // s.g2b[s.g + 1] glyph to byte position inside s.u[]
    // s.g2b[0] == 0, s.g2b[s.glyphs] == s.bytes
    int32_t* g2b;  // g2b_0 or heap allocated glyphs to bytes indices
    int32_t  b;    // number of bytes
    int32_t  c;    // when capacity is zero .u is not heap allocated
    int32_t  g;    // number of glyphs
} rt_end_packed ui_edit_str_t;

typedef struct ui_edit_str_if {
    bool (*init)(ui_edit_str_t* s, const char* utf8, int32_t bytes, bool heap);
    void (*swap)(ui_edit_str_t* s1, ui_edit_str_t* s2);
    int32_t (*gp_to_bp)(const char* s, int32_t bytes, int32_t gp); // or -1
    int32_t (*bytes)(ui_edit_str_t* s, int32_t from, int32_t to); // glyphs
    bool (*expand)(ui_edit_str_t* s, int32_t capacity); // reallocate
    void (*shrink)(ui_edit_str_t* s); // get rid of extra heap memory
    bool (*replace)(ui_edit_str_t* s, int32_t from, int32_t to, // glyphs
                    const char* utf8, int32_t bytes); // [from..to[ exclusive
    bool (*is_zwj)(uint32_t utf32); // zero width joiner
    bool (*is_letter)(uint32_t utf32); // in European Alphabets
    bool (*is_digit)(uint32_t utf32);
    bool (*is_symbol)(uint32_t utf32);
    bool (*is_alphanumeric)(uint32_t utf32);
    bool (*is_blank)(uint32_t utf32); // white space
    bool (*is_punctuation)(uint32_t utf32);
    bool (*is_combining)(uint32_t utf32);
    bool (*is_spacing)(uint32_t utf32); // spacing modifiers
    bool (*is_cjk_or_emoji)(uint32_t utf32);
    bool (*can_break)(uint32_t cp1, uint32_t cp2);
    void (*test)(void);
    void (*free)(ui_edit_str_t* s);
    const ui_edit_str_t* const empty;
} ui_edit_str_if;

extern ui_edit_str_if ui_edit_str;

/*
    For caller convenience the bytes parameter in all calls can be set
    to -1 for zero terminated utf8 strings which results in treating
    strlen(utf8) as number of bytes.

    ui_edit_str.init()
            initializes not zero terminated utf8 string that may be
            allocated on the heap or point out to an outside memory
            location that should have longer lifetime and will be
            treated as read only. init() may return false if
            heap.alloc() returns null or the utf8 bytes sequence
            is invalid.
            s.b is number of bytes in the initialized string;
            s.c is set to heap allocated capacity is set to zero
            for strings that are not allocated on the heap;
            s.g is number of the utf8 glyphs (aka Unicode codepoints)
            in the string;
            s.g2b[] is an array of s.g + 1 integers that maps glyph
            positions to byte positions in the utf8 string. The last
            element is number of bytes in the s.u memory.
            Called must zero out the string struct before calling init().

    ui_edit_str.bytes()
            returns number of bytes in utf8 string in the exclusive
            range [from..to[ between string glyphs.

    ui_edit_str.replace()
            replaces utf8 string in the exclusive range [from..to[
            with the new utf8 string. The new string may be longer
            or shorter than the replaced string. The function returns
            false if the new string is invalid utf8 sequence or
            heap allocation fails. The called must ensure that the
            range [from..to[ is valid, failure to do so is a fatal
            error. ui_edit_str.replace() moves string content to the heap.

    ui_edit_str.free()
            deallocates all heap allocated memory and zero out string
            struct. It is incorrect to call free() on the string that
            was not initialized or already freed.

    All ui_edit_str_t keep "precise" number of utf8 bytes.
    Caller may allocate extra byte and set it to 0x00
    after retrieving and copying data from ui_edit_str if
    the string content is intended to be used by any
    other API that expects zero terminated strings.
*/


rt_end_c


================================================
FILE: inc/ui/ui_edit_view.h
================================================
#pragma once
/* Copyright (c) Dmitry "Leo" Kuznetsov 2021-24 see LICENSE for details */
#include "rt/rt.h"
#include "ui/ui.h"

rt_begin_c

// important ui_edit_view_t will refuse to layout into a box smaller than
// width 3 x fm->em.w height 1 x fm->em.h

typedef struct ui_edit_view_s ui_edit_view_t;

typedef struct ui_edit_str_s ui_edit_str_t;

typedef struct ui_edit_doc_s ui_edit_doc_t;

typedef struct ui_edit_notify_s ui_edit_notify_t;

typedef struct ui_edit_to_do_s ui_edit_to_do_t;

typedef struct ui_edit_pr_s { // page/run coordinates
    int32_t pn; // paragraph number
    int32_t rn; // run number inside paragraph
} ui_edit_pr_t;

typedef struct ui_edit_run_s {
    int32_t bp;     // position in bytes  since start of the paragraph
    int32_t gp;     // position in glyphs since start of the paragraph
    int32_t bytes;  // number of bytes in this `run`
    int32_t glyphs; // number of glyphs in this `run`
    int32_t pixels; // width in pixels
} ui_edit_run_t;

// ui_edit_paragraph_t.initially text will point to readonly memory
// with .allocated == 0; as text is modified it is copied to
// heap and reallocated there.

typedef struct ui_edit_paragraph_s { // "paragraph" view consists of wrapped runs
    int32_t runs;       // number of runs in this paragraph
    ui_edit_run_t* run; // heap allocated array[runs]
} ui_edit_paragraph_t;

typedef struct ui_edit_notify_view_s {
    ui_edit_notify_t notify;
    void*            that; // specific for listener
    uintptr_t        data; // before -> after listener data
} ui_edit_notify_view_t;

typedef struct ui_edit_view_s {
    union {
        ui_view_t view;
        struct ui_view_s;
    };
    ui_edit_doc_t* doc; // document
    ui_edit_notify_view_t listener;
    ui_edit_range_t selection; // "from" selection[0] "to" selection[1]
    ui_point_t caret; // (-1, -1) off
    int32_t caret_width; // in pixels
    ui_edit_pr_t scroll; // left top corner paragraph/run coordinates
    int32_t last_x;    // last_x for up/down caret movement
    ui_ltrb_t inside;  // inside insets space
    struct {
        int32_t w;       // inside.right - inside.left
        int32_t h;       // inside.bottom - inside.top
        int32_t buttons; // bit 0 and bit 1 for LEFT and RIGHT mouse buttons down
    } edit;
    // number of fully (not partially clipped) visible `runs' from top to bottom:
    int32_t visible_runs;
    // TODO: remove focused because it is the same as caret != (-1, -1)
    bool focused;     // is focused and created caret
    bool ro;          // Read Only
    bool sle;         // Single Line Edit
    bool hide_word_wrap; // do not paint word wrap
    int32_t shown;    // debug: caret show/hide counter 0|1
    // paragraphs memory:
    ui_edit_paragraph_t* para; // para[e->doc->text.np]
} ui_edit_view_t;

typedef struct ui_edit_view_if {
    void (*init)(ui_edit_view_t* e, ui_edit_doc_t* d);
    void (*set_font)(ui_edit_view_t* e, ui_fm_t* fm); // see notes below (*)
    void (*move)(ui_edit_view_t* e, ui_edit_pg_t pg); // move caret clear selection
    // replace selected text. If bytes < 0 text is treated as zero terminated
    void (*replace)(ui_edit_view_t* e, const char* text, int32_t bytes);
    // call save(e, null, &bytes) to retrieve number of utf8
    // bytes required to save whole text including 0x00 terminating bytes
    errno_t (*save)(ui_edit_view_t* e, char* text, int32_t* bytes);
    void (*copy)(ui_edit_view_t* e);  // to clipboard
    void (*cut)(ui_edit_view_t* e);   // to clipboard
    // replace selected text with content of clipboard:
    void (*paste)(ui_edit_view_t* e); // from clipboard
    void (*select_all)(ui_edit_view_t* e); // select whole text
    void (*erase)(ui_edit_view_t* e); // delete selected text
    // keyboard actions dispatcher:
    void (*key_down)(ui_edit_view_t* e);
    void (*key_up)(ui_edit_view_t* e);
    void (*key_left)(ui_edit_view_t* e);
    void (*key_right)(ui_edit_view_t* e);
    void (*key_page_up)(ui_edit_view_t* e);
    void (*key_page_down)(ui_edit_view_t* e);
    void (*key_home)(ui_edit_view_t* e);
    void (*key_end)(ui_edit_view_t* e);
    void (*key_delete)(ui_edit_view_t* e);
    void (*key_backspace)(ui_edit_view_t* e);
    void (*key_enter)(ui_edit_view_t* e);
    // called when ENTER keyboard key is pressed in single line mode
    void (*enter)(ui_edit_view_t* e);
    // fuzzer test:
    void (*fuzz)(ui_edit_view_t* e);      // start/stop fuzzing test
    void (*dispose)(ui_edit_view_t* e);
} ui_edit_view_if;

extern ui_edit_view_if ui_edit_view;

/*
    Notes:
    set_font()
        neither edit.view.font = font nor measure()/layout() functions
        do NOT dispose paragraphs layout unless geometry changed because
        it is quite expensive operation. But choosing different font
        on the fly needs to re-layout all paragraphs. Thus caller needs
        to set font via this function instead which also requests
        edit UI element re-layout.

    .ro
        readonly edit->ro is used to control readonly mode.
        If edit control is readonly its appearance does not change but it
        refuses to accept any changes to the rendered text.

    .wb
        wordbreak this attribute was removed as poor UX human experience
        along with single line scroll editing. See note below about .sle.

    .sle
        single line edit control.
        Edit UI element does NOT support horizontal scroll and breaking
        words semantics as it is poor UX human experience. This is not
        how humans (apart of software developers) edit text.
        If content of the edit UI element is wider than the bounding box
        width the content is broken on word boundaries and vertical scrolling
        semantics is supported. Layouts containing edit control of the single
        line height are strongly encouraged to enlarge edit control layout
        vertically on as needed basis similar to Google Search Box behavior
        change implemented in 2023.
        If multiline is set to true by the callers code the edit UI layout
        snaps text to the top of x,y,w,h box otherwise the vertical space
        is distributed evenly between single line of text and top bottom
        margins.
        IMPORTANT: SLE resizes itself vertically to accommodate for
        input that is too wide. If caller wants to limit vertical space it
        will need to hook .measure() function of SLE and do the math there.
*/

/*
    For caller convenience the bytes parameter in all calls can be set
    to -1 for zero terminated utf8 strings which results in treating
    strlen(utf8) as number of bytes.

    ui_edit_str.init()
            initializes not zero terminated utf8 string that may be
            allocated on the heap or point out to an outside memory
            location that should have longer lifetime and will be
            treated as read only. init() may return false if
            heap.alloc() returns null or the utf8 bytes sequence
            is invalid.
            s.b is number of bytes in the initialized string;
            s.c is set to heap allocated capacity is set to zero
            for strings that are not allocated on the heap;
            s.g is number of the utf8 glyphs (aka Unicode codepoints)
            in the string;
            s.g2b[] is an array of s.g + 1 integers that maps glyph
            positions to byte positions in the utf8 string. The last
            element is number of bytes in the s.u memory.
            Called must zero out the string struct before calling init().

    ui_edit_str.bytes()
            returns number of bytes in utf8 string in the exclusive
            range [from..to[ between string glyphs.

    ui_edit_str.replace()
            replaces utf8 string in the exclusive range [from..to[
            with the new utf8 string. The new string may be longer
            or shorter than the replaced string. The function returns
            false if the new string is invalid utf8 sequence or
            heap allocation fails. The called must ensure that the
            range [from..to[ is valid, failure to do so is a fatal
            error. ui_edit_str.replace() moves string content to the heap.

    ui_edit_str.free()
            deallocates all heap allocated memory and zero out string
            struct. It is incorrect to call free() on the string that
            was not initialized or already freed.

    All ui_edit_str_t keep "precise" number of utf8 bytes.
    Caller may allocate extra byte and set it to 0x00
    after retrieving and copying data from ui_edit_str if
    the string content is intended to be used by any
    other API that expects zero terminated strings.
*/

rt_end_c


================================================
FILE: inc/ui/ui_fuzzing.h
================================================
#pragma once
/* Copyright (c) Dmitry "Leo" Kuznetsov 2021-24 see LICENSE for details */
#include "rt/rt.h"
#include "ui/ui.h"

rt_begin_c

// https://en.wikipedia.org/wiki/Fuzzing
// aka "Monkey" testing

typedef struct ui_fuzzing_s {
    rt_work_t    base;
    const char*  utf8; // .character(utf8)
    int32_t      key;  // .key_pressed(key)/.key_released(key)
    ui_point_t*  pt;   // .move_move()
    // key_press and character
    bool         alt;
    bool         ctrl;
    bool         shift;
    // mouse modifiers
    bool         left; // tap() buttons:
    bool         right;
    bool         double_tap;
    bool         long_press;
    // custom
    int32_t      op;
    void*        data;
} ui_fuzzing_t;

typedef struct ui_fuzzing_if {
    void (*start)(uint32_t seed);
    bool (*is_running)(void);
    bool (*from_inside)(void); // true if called originated inside fuzzing
    void (*next_random)(ui_fuzzing_t* f); // called if `next` is null
    void (*dispatch)(ui_fuzzing_t* f);    // dispatch work
    // next() called instead of random if not null
    void (*next)(ui_fuzzing_t* f);
    // custom() called instead of dispatch() if not null
    void (*custom)(ui_fuzzing_t* f);
    void (*stop)(void);
} ui_fuzzing_if;

extern ui_fuzzing_if ui_fuzzing;

rt_end_c



================================================
FILE: inc/ui/ui_gdi.h
================================================
#pragma once
#include "rt/rt_std.h"

rt_begin_c

// Graphic Device Interface (selected parts of Windows GDI)

enum {  // TODO: into gdi int32_t const
    ui_gdi_font_quality_default = 0,
    ui_gdi_font_quality_draft = 1,
    ui_gdi_font_quality_proof = 2, // anti-aliased w/o ClearType rainbows
    ui_gdi_font_quality_nonantialiased = 3,
    ui_gdi_font_quality_antialiased = 4,
    ui_gdi_font_quality_cleartype = 5,
    ui_gdi_font_quality_cleartype_natural = 6
};

typedef struct ui_fm_s { // font metrics
    ui_font_t font;
    ui_wh_t em;        // "em" square point size expressed in pixels *)
    // https://learn.microsoft.com/en-us/windows/win32/gdi/string-widths-and-heights
    int32_t height;    // font height in pixels
    int32_t baseline;  // bottom of the glyphs sans descenders (align of multi-font text)
    int32_t ascent;    // the maximum glyphs extend above the baseline
    int32_t descent;   // maximum height of descenders
    int32_t x_height;  // small letters height
    int32_t cap_em_height;    // Capital letter "M" height
    int32_t internal_leading; // accents and diacritical marks goes there
    int32_t external_leading;
    int32_t average_char_width;
    int32_t max_char_width;
    int32_t line_gap;  // gap between lines of text
    ui_wh_t subscript; // height
    ui_point_t subscript_offset;
    ui_wh_t superscript;    // height
    ui_point_t superscript_offset;
    int32_t underscore;     // height
    int32_t underscore_position;
    int32_t strike_through; // height
    int32_t strike_through_position;
    int32_t design_units_per_em; // aka EM square ~ 2048
    ui_rect_t box; // bounding box of the glyphs in design units
    bool mono;
} ui_fm_t;

/* see: https://github.com/leok7v/ui/wiki/Typography-Line-Terms
   https://en.wikipedia.org/wiki/Typeface#Font_metrics

   Example em55x55 H1 font @ 192dpi:
    _   _                   _              ___    <- y:0
   (_)_(_)                 | |             ___ /\    "diacritics circumflex"
     / \   __ _ _   _ _ __ | |_ ___ _ __       ||
    / _ \ / _` | | | | '_ \| __/ _ \ '_ \      ||    .ascend:30
   / ___ \ (_| | |_| | |_) | ||  __/ | | |     ||     max extend above baseline
  /_/   \_\__, |\__, | .__/ \__\___|_| |_| ___ || <- .baseline:44
           __/ | __/ | |                       ||    .descend:11
          |___/ |___/|_|                   ___ \/     max height of descenders
                                                  <- .height:55
  em: 55x55
  ascender for "diacritics circumflex" is (h:55 - a:30 - d:11) = 14
*/

typedef struct ui_gdi_ta_s { // text attributes
    const ui_fm_t* fm; // font metrics
    int32_t color_id;  // <= 0 use color
    ui_color_t color;  // ui_colors.undefined() use color_id
    bool measure;      // measure only do not draw
} ui_gdi_ta_t;

typedef struct {
    struct {
        struct {
            ui_gdi_ta_t const normal;
            ui_gdi_ta_t const title;
            ui_gdi_ta_t const rubric;
            ui_gdi_ta_t const H1;
            ui_gdi_ta_t const H2;
            ui_gdi_ta_t const H3;
        } prop;
        struct {
            ui_gdi_ta_t const normal;
            ui_gdi_ta_t const title;
            ui_gdi_ta_t const rubric;
            ui_gdi_ta_t const H1;
            ui_gdi_ta_t const H2;
            ui_gdi_ta_t const H3;
        } mono;
    } const ta;
    void (*init)(void);
    void (*fini)(void);
    void (*begin)(ui_bitmap_t* bitmap_or_null);
    // all paint must be done in between
    void (*end)(void);
    // TODO: move to ui_colors
    uint32_t (*color_rgb)(ui_color_t c); // rgb color
    // bpp bytes (not bits!) per pixel. bpp = -3 or -4 does not swap RGB to BRG:
    void (*bitmap_init)(ui_bitmap_t* bitmap, int32_t w, int32_t h, int32_t bpp,
        const uint8_t* pixels);
    void (*bitmap_init_rgbx)(ui_bitmap_t* bitmap, int32_t w, int32_t h,
        int32_t bpp, const uint8_t* pixels); // sets all alphas to 0xFF
    void (*bitmap_dispose)(ui_bitmap_t* bitmap);
    void (*set_clip)(int32_t x, int32_t y, int32_t w, int32_t h);
    // use set_clip(0, 0, 0, 0) to clear clip region
    void (*pixel)(int32_t x, int32_t y, ui_color_t c);
    void (*line)(int32_t x0, int32_t y1, int32_t x2, int32_t y2,
                      ui_color_t c);
    void (*frame)(int32_t x, int32_t y, int32_t w, int32_t h,
                      ui_color_t c);
    void (*rect)(int32_t x, int32_t y, int32_t w, int32_t h,
                      ui_color_t border, ui_color_t fill);
    void (*fill)(int32_t x, int32_t y, int32_t w, int32_t h, ui_color_t c);
    void (*poly)(ui_point_t* points, int32_t count, ui_color_t c);
    void (*circle)(int32_t center_x, int32_t center_y, int32_t odd_radius,
        ui_color_t border, ui_color_t fill);
    void (*rounded)(int32_t x, int32_t y, int32_t w, int32_t h,
        int32_t odd_radius, ui_color_t border, ui_color_t fill);
    void (*gradient)(int32_t x, int32_t y, int32_t w, int32_t h,
        ui_color_t rgba_from, ui_color_t rgba_to, bool vertical);
    // dx, dy, dw, dh destination rectangle
    // ix, iy, iw, ih rectangle inside pixels[height][width]
    void (*pixels)(int32_t dx, int32_t dy, int32_t dw, int32_t dh,
        int32_t ix, int32_t iy, int32_t iw, int32_t ih,
        int32_t width, int32_t height, int32_t stride,
        int32_t bpp, const uint8_t* pixels); // bytes per pixel
    void (*greyscale)(int32_t dx, int32_t dy, int32_t dw, int32_t dh,
        int32_t ix, int32_t iy, int32_t iw, int32_t ih,
        int32_t width, int32_t height, int32_t stride, const uint8_t* pixels);
    void (*bgr)(int32_t dx, int32_t dy, int32_t dw, int32_t dh,
        int32_t ix, int32_t iy, int32_t iw, int32_t ih,
        int32_t width, int32_t height, int32_t stride, const uint8_t* pixels);
    void (*bgrx)(int32_t dx, int32_t dy, int32_t dw, int32_t dh,
        int32_t x, int32_t y, int32_t w, int32_t h,
        int32_t width, int32_t height, int32_t stride, const uint8_t* pixels);
    // alpha() blend only works with device allocated bitmaps
    void (*alpha)(int32_t dx, int32_t dy, int32_t dw, int32_t dh,
        int32_t ix, int32_t iy, int32_t iw, int32_t ih,
        ui_bitmap_t* bitmap, fp64_t alpha); // alpha blend
    // bitmap() only works with device allocated bitmaps
    void (*bitmap)(int32_t dx, int32_t dy, int32_t dw, int32_t dh,
        int32_t ix, int32_t iy, int32_t iw, int32_t ih,
        ui_bitmap_t* bitmap);
    void (*icon)(int32_t dx, int32_t dy, int32_t dw, int32_t dh,
        ui_icon_t icon);
    // text:
    void (*cleartype)(bool on); // system wide change: don't use
    void (*font_smoothing_contrast)(int32_t c); // [1000..2202] or -1 for 1400 default
    ui_font_t (*create_font)(const char* family, int32_t height, int32_t quality);
    // custom font, quality: -1 "as is"
    ui_font_t (*font)(ui_font_t f, int32_t height, int32_t quality);
    void      (*delete_font)(ui_font_t f);
    void (*dump_fm)(ui_font_t f); // dump font metrics
    void (*update_fm)(ui_fm_t* fm, ui_font_t f); // fills font metrics
    ui_wh_t (*text_va)(const ui_gdi_ta_t* ta, int32_t x, int32_t y,
        const char* format, va_list va);
    ui_wh_t (*text)(const ui_gdi_ta_t* ta, int32_t x, int32_t y,
        const char* format, ...);
    ui_wh_t (*multiline_va)(const ui_gdi_ta_t* ta, int32_t x, int32_t y,
        int32_t w, const char* format, va_list va); // "w" can be zero
    ui_wh_t (*multiline)(const ui_gdi_ta_t* ta, int32_t x, int32_t y,
        int32_t w, const char* format, ...);
    // x[rt_str.glyphs(utf8, bytes)] = {x0, x1, x2, ...}
    ui_wh_t (*glyphs_placement)(const ui_gdi_ta_t* ta, const char* utf8,
        int32_t bytes, int32_t x[/*glyphs + 1*/], int32_t glyphs);
} ui_gdi_if;

extern ui_gdi_if ui_gdi;

rt_end_c


================================================
FILE: inc/ui/ui_image.h
================================================
#include "rt/rt.h"
#include "ui/ui.h"

rt_begin_c

// "image view"

// To enable zoom/pan make view focusable:
// iv.focusable = true;

// Field .image may have .pixels pointer and .bitmap == null.
// If this is the case the direct pixels transfer to the
// device is used. RGBA bitmaps must be allocated on the
// device otherwise ui_gdi.rgbx() call is used and alpha
// is ignored.

typedef struct ui_image_s ui_image_t;

typedef struct ui_image_s {
    union {
        ui_view_t view;
        struct ui_view_s;
    };
    ui_bitmap_t image; // view does NOT own or dispose image->bitmap
    fp64_t     alpha; // for rgba images
    // actual scale() is: z = 2 ^ (zn - 1) / 2 ^ (zd - 1)
    int32_t zoom; // 0..8
    // 0=16:1 1=8:1 2=4:1 3=2:1 4=1:1 5=1:2 6=1:4 7=1:8 8=1:16
    int32_t zn; // zoom nominator (1, 2, 3, ...)
    int32_t zd; // zoom denominator (1, 2, 3, ...)
    fp64_t  sx; // shift x [0..1.0] in view coordinates
    fp64_t  sy; // shift y [0..1.0]
    struct { // only visible when focused
        ui_view_t   bar; // ui_view(span) {zoom in, zoom 1:1, zoom out, help}
        ui_button_t copy; // copy image to clipboard
        ui_button_t zoom_in;
        ui_button_t zoom_1t1; // 1:1
        ui_button_t zoom_out;
        ui_button_t fit;
        ui_button_t fill;
        ui_button_t help;
        ui_label_t  ratio;
    } tool;
    ui_point_t drag_start;
    fp64_t when; // to hide toolbar
    bool fit;    // best fit into view
    bool fill;   // fill entire view
    // fit and fill cannot be true at the same time
    // when fit: false and fill: false the zoom ratio is in effect
} ui_image_t;

typedef struct ui_image_if {
    void      (*init)(ui_image_t* iv);
    void      (*init_with)(ui_image_t* iv, const uint8_t* pixels,
                           int32_t width, int32_t height,
                           int32_t bpp, int32_t stride);
    // ration can only be: 16:1 8:1 4:1 2:1 1:1 1:2 1:4 1:8 1:16
    // but ignored if .fit or .fill is true
    void      (*ratio)(ui_image_t* iv, int32_t nominator, int32_t denominator);
    fp64_t    (*scale)(ui_image_t* iv); // 2 ^ (zn - 1) / 2 ^ (zd - 1)
    ui_rect_t (*position)(ui_image_t* iv);
} ui_image_if;

extern ui_image_if ui_image;

rt_end_c



================================================
FILE: inc/ui/ui_label.h
================================================
#pragma once
#include "rt/rt_std.h"
#include "ui/ui_view.h"

rt_begin_c

typedef ui_view_t ui_label_t;

void ui_view_init_label(ui_view_t* v);

// label insets and padding left/right are intentionally
// smaller than button/slider/toggle controls

#define ui_label(min_width_em, s) {                    \
    .type = ui_view_label, .init = ui_view_init_label, \
    .fm = &ui_app.fm.prop.normal,                      \
    .p.text = s,                                       \
    .min_w_em = min_width_em, .min_h_em = 1.25f,       \
    .insets  = {                                       \
        .left  = ui_view_i_lr, .top    = ui_view_i_tb, \
        .right = ui_view_i_lr, .bottom = ui_view_i_tb  \
    },                                                 \
    .padding = {                                       \
        .left  = ui_view_p_lr, .top    = ui_view_p_tb, \
        .right = ui_view_p_lr, .bottom = ui_view_p_tb, \
    }                                                  \
}

// text with "&" keyboard shortcuts:

void ui_label_init(ui_label_t* t, fp32_t min_w_em, const char* format, ...);
void ui_label_init_va(ui_label_t* t, fp32_t min_w_em, const char* format, va_list va);

// use this macro for initialization:
//    ui_label_t label = ui_label(min_width_em, s);
// or:
//    label = (ui_label_t)ui_label(min_width_em, s);
// which is subtle C difference of constant and
// variable initialization and I did not find universal way

rt_end_c


================================================
FILE: inc/ui/ui_mbx.h
================================================
#pragma once
#include "rt/rt_std.h"
#include "ui/ui_view.h"

rt_begin_c

// Options like:
//   "Yes"|"No"|"Abort"|"Retry"|"Ignore"|"Cancel"|"Try"|"Continue"
// maximum number of choices presentable to human is 4.

typedef struct {
    union {
        ui_view_t view;
        struct ui_view_s;
    };
    ui_label_t   label;
    ui_button_t  button[4];
    int32_t      option; // -1 or option chosen by user
    const char** options;
} ui_mbx_t;

void ui_view_init_mbx(ui_view_t* v);

void ui_mbx_init(ui_mbx_t* mx, const char* option[], const char* format, ...);

// ui_mbx_on_choice can only be used on static mbx variables


#define ui_mbx_chosen(name, s, code, ...)                        \
                                                                 \
    static char* name ## _options[] = { __VA_ARGS__, null };     \
                                                                 \
    static void name ## _chosen(ui_mbx_t* m, int32_t option) {   \
        (void)m; (void)option; /* no warnings if unused */       \
        code                                                     \
    }                                                            \
    static                                                       \
    ui_mbx_t name = {                                            \
        .view = {                                                \
            .type = ui_view_mbx,                                 \
            .init = ui_view_init_mbx,                            \
            .fm = &ui_app.fm.prop.normal,                        \
            .p.text = s,                                         \
            .callback = name ## _chosen,                         \
            .padding = { .left  = 0.125, .top    = 0.25,         \
                         .right = 0.125, .bottom = 0.25 },       \
            .insets  = { .left  = 0.125, .top    = 0.25,         \
                         .right = 0.125, .bottom = 0.25 }        \
        },                                                       \
        .options = name ## _options                              \
    }

#define ui_mbx(s, chosen, ...) {                            \
    .view = {                                               \
        .type = ui_view_mbx, .init = ui_view_init_mbx,      \
        .fm = &ui_app.fm.prop.normal,                       \
        .p.text = s,                                        \
        .callback = chosen,                                 \
        .padding = { .left  = 0.125, .top    = 0.25,        \
                     .right = 0.125, .bottom = 0.25 },      \
        .insets  = { .left  = 0.125, .top    = 0.25,        \
                     .right = 0.125, .bottom = 0.25 }       \
    },                                                      \
    .options = (const char*[]){ __VA_ARGS__, null },        \
}

rt_end_c


================================================
FILE: inc/ui/ui_midi.h
================================================
/* Copyright (c) Dmitry "Leo" Kuznetsov 2021-24 see LICENSE for details */
#include <stdint.h>
#include <errno.h>

#ifdef __cplusplus
    extern "C" {
#endif

typedef struct ui_midi_s ui_midi_t;

typedef struct ui_midi_s {
    uint8_t data[16 * 8]; // opaque implementation data
    // must return 0 if successful or error otherwise:
    int64_t (*notify)(ui_midi_t* midi, int64_t flags);
} ui_midi_t;

typedef struct {
    // flags bitset:
    int32_t const success; // when the clip is done playing
    int32_t const failure; // on error playing media
    int32_t const aborted; // on stop() call
    int32_t const superseded;
    // midi has it's own section of legacy error messages
    void    (*error)(errno_t r, char* s, int32_t count);
    errno_t (*open)(ui_midi_t* midi, const char* filename);
    errno_t (*play)(ui_midi_t* midi);
    errno_t (*rewind)(ui_midi_t* midi);
    errno_t (*stop)(ui_midi_t* midi);
    errno_t (*get_volume)(ui_midi_t* midi, fp64_t *volume);
    errno_t (*set_volume)(ui_midi_t* midi, fp64_t  volume);
    bool    (*is_open)(ui_midi_t* midi);
    bool    (*is_playing)(ui_midi_t* midi);
    void    (*close)(ui_midi_t* midi);
} ui_midi_if;

extern ui_midi_if ui_midi;


/*
    success:
    "The conditions initiating the callback function have been met."
    I guess meaning media is done playing...

    failure:
    "A device error occurred while the device was executing the command."

    aborted:
    "The device received a command that prevented the current
    conditions for initiating the callback function from
    being met. If a new command interrupts the current command
    and it also requests notification, the device sends this
    message only and not `superseded`".
    I guess meaning media is stopped playing...

    superseded:
    "The device received another command with the "notify" flag set
     and the current conditions for initiating the callback function
     have been superseded."
*/

#ifdef __cplusplus
}
#endif





================================================
FILE: inc/ui/ui_slider.h
================================================
#pragma once
#include "rt/rt_std.h"
#include "ui/ui_button.h"

rt_begin_c

typedef struct ui_slider_s ui_slider_t;

typedef struct ui_slider_s {
    union {
        ui_view_t view;
        struct ui_view_s;
    };
    int32_t step;
    fp64_t time; // time last button was pressed
    ui_wh_t wh;  // text measurement (special case for %0*d)
    ui_button_t inc; // can be hidden
    ui_button_t dec; // can be hidden
    int32_t value;  // for ui_slider_t range slider control
    int32_t value_min;
    int32_t value_max;
    // style:
    bool notched; // true if marked with a notches and has a thumb
} ui_slider_t;

void ui_view_init_slider(ui_view_t* v);

void ui_slider_init(ui_slider_t* r, const char* label, fp32_t min_w_em,
    int32_t value_min, int32_t value_max, void (*callback)(ui_view_t* r));

// ui_slider_changed can only be used on static slider variables

#define ui_slider_changed(name, s, min_width_em, mn,  mx, fmt, ...) \
    static void name ## _changed(ui_slider_t* name) {               \
        (void)name; /* no warning if unused */                      \
        { __VA_ARGS__ }                                             \
    }                                                               \
    static                                                          \
    ui_slider_t name = {                                            \
        .view = {                                                   \
            .type = ui_view_slider,                                 \
            .init = ui_view_init_slider,                            \
            .fm = &ui_app.fm.prop.normal,                           \
            .p.text = s,                                            \
            .format = fmt,                                          \
            .callback = name ## _changed,                           \
            .min_w_em = min_width_em, .min_h_em = 1.25f,            \
            .insets  = {                                            \
                .left  = ui_view_i_lr, .top    = ui_view_i_tb,      \
                .right = ui_view_i_lr, .bottom = ui_view_i_tb       \
            },                                                      \
            .padding = {                                            \
                .left  = ui_view_p_lr, .top    = ui_view_p_tb,      \
                .right = ui_view_p_lr, .bottom = ui_view_p_tb,      \
            }                                                       \
        },                                                          \
        .value_min = mn, .value_max = mx, .value = mn,              \
    }

#define ui_slider(s, min_width_em, mn, mx, fmt, changed) {          \
    .view = {                                                       \
        .type = ui_view_slider,                                     \
        .init = ui_view_init_slider,                                \
        .fm = &ui_app.fm.prop.normal,                               \
        .p.text = s,                                                \
        .callback = changed,                                        \
        .format = fmt,                                              \
        .min_w_em = min_width_em, .min_h_em = 1.25f,                \
            .insets  = {                                            \
                .left  = ui_view_i_lr, .top    = ui_view_i_tb,      \
                .right = ui_view_i_lr, .bottom = ui_view_i_tb       \
            },                                                      \
            .padding = {                                            \
                .left  = ui_view_p_lr, .top    = ui_view_p_tb,      \
                .right = ui_view_p_lr, .bottom = ui_view_p_tb,      \
            }                                                       \
    },                                                              \
    .value_min = mn, .value_max = mx, .value = mn,                  \
}

rt_end_c


================================================
FILE: inc/ui/ui_theme.h
================================================
/* Copyright (c) Dmitry "Leo" Kuznetsov 2021-24 see LICENSE for details */
#include "ui/ui.h"

rt_begin_c

enum {
    ui_theme_app_mode_default     = 0,
    ui_theme_app_mode_allow_dark  = 1,
    ui_theme_app_mode_force_dark  = 2,
    ui_theme_app_mode_force_light = 3
};

typedef struct  {
    bool (*is_app_dark)(void);
    bool (*is_system_dark)(void);
    bool (*are_apps_dark)(void);
    void (*set_preferred_app_mode)(int32_t mode);
    void (*flush_menu_themes)(void);
    void (*allow_dark_mode_for_app)(bool allow);
    void (*allow_dark_mode_for_window)(bool allow);
    void (*refresh)(void);
    void (*test)(void);
} ui_theme_if;

extern ui_theme_if ui_theme;

rt_end_c


================================================
FILE: inc/ui/ui_toggle.h
================================================
#pragma once
#include "rt/rt_std.h"
#include "ui/ui_view.h"

rt_begin_c

typedef ui_view_t ui_toggle_t;

// label may contain "___" which will be replaced with "On" / "Off"
void ui_toggle_init(ui_toggle_t* b, const char* label, fp32_t ems,
    void (*callback)(ui_toggle_t* b));

void ui_view_init_toggle(ui_view_t* v);

// ui_toggle_on_off can only be used on static toggle variables

#define ui_toggle_on_off(name, s, min_width_em, ...)        \
    static void name ## _on_off(ui_toggle_t* name) {        \
        (void)name; /* no warning if unused */              \
        { __VA_ARGS__ }                                     \
    }                                                       \
    static                                                  \
    ui_toggle_t name = {                                    \
        .type = ui_view_toggle,                             \
        .init = ui_view_init_toggle,                        \
        .fm = &ui_app.fm.prop.normal,                       \
        .min_w_em = min_width_em,  .min_h_em = 1.25f,       \
        .p.text = s,                                        \
        .callback = name ## _on_off,                        \
        .insets  = {                                        \
            .left  = 1.75f,        .top    = ui_view_i_tb,  \
            .right = ui_view_i_lr, .bottom = ui_view_i_tb   \
        },                                                  \
        .padding = {                                        \
            .left  = ui_view_p_lr, .top    = ui_view_p_tb,  \
            .right = ui_view_p_lr, .bottom = ui_view_p_tb,  \
        }                                                   \
    }

#define ui_toggle(s, min_width_em, on_off) {                \
    .type = ui_view_toggle,                                 \
    .init = ui_view_init_toggle,                            \
    .fm = &ui_app.fm.prop.normal,                           \
    .p.text = s,                                            \
    .callback = on_off,                                     \
    .min_w_em = min_width_em,  .min_h_em = 1.25f,           \
    .insets  = {                                            \
        .left  = 1.75f,        .top    = ui_view_i_tb,      \
        .right = ui_view_i_lr, .bottom = ui_view_i_tb       \
    },                                                      \
    .padding = {                                            \
        .left  = ui_view_p_lr, .top    = ui_view_p_tb,      \
        .right = ui_view_p_lr, .bottom = ui_view_p_tb,      \
    }                                                       \
}

rt_end_c


================================================
FILE: inc/ui/ui_view.h
================================================
#pragma once
#include "rt/rt_std.h"

rt_begin_c

enum ui_view_type_t {
    ui_view_stack     = 'vwst',
    ui_view_label     = 'vwlb',
    ui_view_mbx       = 'vwmb',
    ui_view_button    = 'vwbt',
    ui_view_toggle    = 'vwtg',
    ui_view_slider    = 'vwsl',
    ui_view_image     = 'vwiv',
    ui_view_text      = 'vwtx',
    ui_view_span      = 'vwhs',
    ui_view_list      = 'vwvs',
    ui_view_spacer    = 'vwsp',
    ui_view_scroll    = 'vwsc'
};

typedef struct ui_view_s ui_view_t;

typedef struct ui_view_private_s { // do not access directly
    char text[1024]; // utf8 zero terminated
    int32_t strid;    // 0 for not yet localized, -1 no localization
    fp64_t armed_until; // rt_clock.seconds() - when to release
    fp64_t hover_when;  // time in seconds when to call hovered()
    // use: ui_view.string(v) and ui_view.set_string()
} ui_view_private_t;

typedef struct ui_view_text_metrics_s { // ui_view.measure_text() fills these attributes:
    ui_wh_t    wh; // text width and height
    ui_point_t xy; // text offset inside view
    bool multiline; // text contains "\n"
} ui_view_text_metrics_t;

typedef struct ui_view_s {
    enum ui_view_type_t type;
    ui_view_private_t p; // private
    void (*init)(ui_view_t* v); // called once before first layout
    ui_view_t* parent;
    ui_view_t* child; // first child, circular doubly linked list
    ui_view_t* prev;  // left or top sibling
    ui_view_t* next;  // right or top sibling
    int32_t x;
    int32_t y;
    int32_t w;
    int32_t h;
    ui_margins_t insets;
    ui_margins_t padding;
    ui_view_text_metrics_t text;
    // see ui.alignment values
    int32_t align; // align inside parent
    int32_t text_align; // align of the text inside control
    int32_t max_w; // > 0 maximum width in pixels the view agrees to
    int32_t max_h; // > 0 maximum height in pixels
    fp32_t  min_w_em; // > 0 minimum width  of a view in "em"s
    fp32_t  min_h_em; // > 0 minimum height of a view in "em"s
    ui_icon_t icon; // used instead of text if != null
    // updated on layout() call
    const ui_fm_t* fm; // font metrics
    int32_t  shortcut; // keyboard shortcut
    void* that;  // for the application use
    void (*notify)(ui_view_t* v, void* p); // for the application use
    // two pass layout: measure() .w, .h layout() .x .y
    // first  measure() bottom up - children.layout before parent.layout
    // second layout() top down - parent.layout before children.layout
    // before methods: called before measure()/layout()/paint()
    void (*prepare)(ui_view_t* v);    // called before measure()
    void (*measure)(ui_view_t* v);    // determine w, h (bottom up)
    void (*measured)(ui_view_t* v);   // called after measure()
    void (*layout)(ui_view_t* v);     // set x, y possibly adjust w, h (top down)
    void (*composed)(ui_view_t* v);   // after layout() is done (laid out)
    void (*erase)(ui_view_t* v);      // called before paint()
    void (*paint)(ui_view_t* v);
    void (*painted)(ui_view_t* v);  // called after paint()
    // composed() is effectively called right before paint() and
    // can be used to prepare for painting w/o need to override paint()
    void (*debug_paint)(ui_view_t* v); // called if .debug is set to true
    // any message:
    bool (*message)(ui_view_t* v, int32_t message, int64_t wp, int64_t lp,
        int64_t* rt); // return true and value in rt to stop processing
    void (*click)(ui_view_t* v);    // ui click callback - view action
    void (*format)(ui_view_t* v);   // format a value to text (e.g. slider)
    void (*callback)(ui_view_t* v); // state change callback
    void (*mouse_scroll)(ui_view_t* v, ui_point_t dx_dy); // touchpad scroll
    void (*mouse_hover)(ui_view_t* v); // hover over
    void (*mouse_move)(ui_view_t* v);
    void (*double_click)(ui_view_t* v, int32_t ix);
    // tap(ui, button_index) press(ui, button_index) see note below
    // button index 0: left, 1: middle, 2: right
    // bottom up (leaves to root or children to parent)
    // return true if consumed (halts further calls up the tree)
    bool (*tap)(ui_view_t* v, int32_t ix, bool pressed); // single click/tap inside ui
    bool (*long_press)(ui_view_t* v, int32_t ix); // two finger click/tap or long press
    bool (*double_tap)(ui_view_t* v, int32_t ix); // legacy double click
    bool (*context_menu)(ui_view_t* v); // right mouse click or long press
    void (*focus_gained)(ui_view_t* v);
    void (*focus_lost)(ui_view_t* v);
    // translated from key pressed/released to utf8:
    void (*character)(ui_view_t* v, const char* utf8);
    bool (*key_pressed)(ui_view_t* v, int64_t key);  // return true to stop
    bool (*key_released)(ui_view_t* v, int64_t key); // processing
    // timer() every_100ms() and every_sec() called
    // even for hidden and disabled views
    void (*timer)(ui_view_t* v, ui_timer_t id);
    void (*every_100ms)(ui_view_t* v); // ~10 x times per second
    void (*every_sec)(ui_view_t* v); // ~once a second
    int64_t (*hit_test)(const ui_view_t* v, ui_point_t pt);
    struct {
        bool hidden;    // measure()/ layout() paint() is not called on
        bool disabled;  // mouse, keyboard, key_up/down not called on
        bool armed;     // button is pressed but not yet released
        bool hover;     // cursor is hovering over the control
        bool pressed;   // for ui_button_t and ui_toggle_t
    } state;
    // TODO: instead of flat color scheme: undefined colors for
    // border rounded gradient etc.
    bool flat;                // no-border appearance of controls
    bool flip;                // flip button pressed / released
    bool focusable;           // can be target for keyboard focus
    bool highlightable;       // paint highlight rectangle when hover over label
    ui_color_t color;         // interpretation depends on view type
    int32_t    color_id;      // 0 is default meaning use color
    ui_color_t background;    // interpretation depends on view type
    int32_t    background_id; // 0 is default meaning use background
    char hint[256]; // tooltip hint text (to be shown while hovering over view)
    struct {
        struct {
            bool prc; // paint rect
            bool mt;  // measure text
        } trace;
        struct { // after painted():
            bool call;    // v->debug_paint()
            bool margins; // call debug_paint_margins()
            bool fm;      // paint font metrics
        } paint;
        const char* id; // for debugging purposes
    } debug; // debug flags
} ui_view_t;

// tap() / press() APIs guarantee that single tap() is not coming
// before fp64_t tap/click in expense of fp64_t click delay (0.5 seconds)
// which is OK for buttons and many other UI controls but absolutely not
// OK for text editing. Thus edit uses raw mouse events to react
// on clicks and fp64_t clicks.

typedef struct ui_view_if {
    // children va_args must be null terminated
    ui_view_t* (*add)(ui_view_t* parent, ...);
    void (*add_first)(ui_view_t* parent, ui_view_t* child);
    void (*add_last)(ui_view_t*  parent, ui_view_t* child);
    void (*add_after)(ui_view_t* child,  ui_view_t* after);
    void (*add_before)(ui_view_t* child, ui_view_t* before);
    void (*remove)(ui_view_t* v); // removes view from it`s parent
    void (*remove_all)(ui_view_t* parent); // removes all children
    void (*disband)(ui_view_t* parent); // removes all children recursively
    bool (*is_parent_of)(const ui_view_t* p, const ui_view_t* c);
    bool (*inside)(const ui_view_t* v, const ui_point_t* pt);
    ui_ltrb_t (*margins)(const ui_view_t* v, const ui_margins_t* g); // to pixels
    void (*inbox)(const ui_view_t* v, ui_rect_t* r, ui_ltrb_t* insets);
    void (*outbox)(const ui_view_t* v, ui_rect_t* r, ui_ltrb_t* padding);
    void (*set_text)(ui_view_t* v, const char* format, ...);
    void (*set_text_va)(ui_view_t* v, const char* format, va_list va);
    // ui_view.invalidate() prone to 30ms delays don't use in r/t video code
    // ui_view.invalidate(v, ui_app.crc) invalidates whole client rect but
    // ui_view.redraw() (fast non blocking) is much better instead
    void (*invalidate)(const ui_view_t* v, const ui_rect_t* rect_or_null);
    bool (*is_orphan)(const ui_view_t* v);   // view parent chain has null
    bool (*is_hidden)(const ui_view_t* v);   // view or any parent is hidden
    bool (*is_disabled)(const ui_view_t* v); // view or any parent is disabled
    bool (*is_control)(const ui_view_t* v);
    bool (*is_container)(const ui_view_t* v);
    bool (*is_spacer)(const ui_view_t* v);
    const char* (*string)(ui_view_t* v);  // returns localized text
    void (*timer)(ui_view_t* v, ui_timer_t id);
    void (*every_sec)(ui_view_t* v);
    void (*every_100ms)(ui_view_t* v);
    int64_t (*hit_test)(const ui_view_t* v, ui_point_t pt);
    // key_pressed() key_released() return true to stop further processing
    bool (*key_pressed)(ui_view_t* v, int64_t v_key);
    bool (*key_released)(ui_view_t* v, int64_t v_key);
    void (*character)(ui_view_t* v, const char* utf8);
    void (*paint)(ui_view_t* v);
    bool (*has_focus)(const ui_view_t* v); // ui_app.focused() && ui_app.focus == v
    void (*set_focus)(ui_view_t* view_or_null);
    void (*lose_hidden_focus)(ui_view_t* v);
    void (*hovering)(ui_view_t* v, bool start);
    void (*mouse_hover)(ui_view_t* v); // hover over
    void (*mouse_move)(ui_view_t* v);
    void (*mouse_scroll)(ui_view_t* v, ui_point_t dx_dy); // touchpad scroll
    ui_wh_t (*text_metrics_va)(int32_t x, int32_t y, bool multiline, int32_t w,
        const ui_fm_t* fm, const char* format, va_list va);
    ui_wh_t (*text_metrics)(int32_t x, int32_t y, bool multiline, int32_t w,
        const ui_fm_t* fm, const char* format, ...);
    void (*text_measure)(ui_view_t* v, const char* s,
        ui_view_text_metrics_t* tm);
    void (*text_align)(ui_view_t* v, ui_view_text_metrics_t* tm);
    void (*measure_text)(ui_view_t* v); // fills v->text.mt and .xy
    // measure_control(): control is special case with v->text.mt and .xy
    void (*measure_control)(ui_view_t* v);
    void (*measure_children)(ui_view_t* v);
    void (*layout_children)(ui_view_t* v);
    void (*measure)(ui_view_t* v);
    void (*layout)(ui_view_t* v);
    void (*hover_changed)(ui_view_t* v);
    bool (*is_shortcut_key)(ui_view_t* v, int64_t key);
    bool (*context_menu)(ui_view_t* v);
    // `ix` 0: left 1: middle 2: right
    bool (*tap)(ui_view_t* v, int32_t ix, bool pressed);
    bool (*long_press)(ui_view_t* v, int32_t ix);
    bool (*double_tap)(ui_view_t* v, int32_t ix);
    bool (*message)(ui_view_t* v, int32_t m, int64_t wp, int64_t lp, int64_t* ret);
    void (*debug_paint_margins)(ui_view_t* v); // insets padding
    void (*debug_paint_fm)(ui_view_t* v);   // text font metrics
    void (*test)(void);
} ui_view_if;

extern ui_view_if ui_view;

// view children iterator:

#define ui_view_for_each_begin(v, it) do {       \
    ui_view_t* it = (v)->child;                  \
    if (it != null) {                            \
        do {                                     \


#define ui_view_for_each_end(v, it)              \
            it = it->next;                       \
        } while (it != (v)->child);              \
    }                                            \
} while (0)

#define ui_view_for_each(v, it, ...) \
    ui_view_for_each_begin(v, it)    \
    { __VA_ARGS__ }                  \
    ui_view_for_each_end(v, it)

#define ui_view_debug_id(v) \
    ((v)->debug.id != null ? (v)->debug.id : (v)->p.text)

// #define code(statements) statements
//
// used as:
// {
//     macro({
//        foo();
//        bar();
//     })
// }
//
// except in m4 preprocessor loses new line
// between foo() and bar() and makes debugging and
// using __LINE__ difficult to impossible.
//
// Also
// #define code(...) { __VA_ARGS__ }
// is way easier on preprocessor

// ui_view_insets (fractions of 1/2 to keep float calculations precise):
#define ui_view_i_lr (0.750f) // 3/4 of "em.w" on left and right
#define ui_view_i_tb (0.125f) // 1/8 em

// ui_view_padding
#define ui_view_p_lr (0.375f)
#define ui_view_p_tb (0.250f)

#define ui_view_call_init(v) do {                   \
    if ((v)->init != null) {                        \
        void (*_init_)(ui_view_t* _v_) = (v)->init; \
        (v)->init = null; /* before! call */        \
        _init_((v));                                \
    }                                               \
} while (0)


rt_end_c


================================================
FILE: inc/ut_std.h
================================================
#pragma once
#include <ctype.h>
#include <errno.h>
#include <float.h>
#include <limits.h>
#include <locale.h>
#include <malloc.h>
#include <signal.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define rt_stringify(x) #x
#define rt_tostring(x) rt_stringify(x)
#define rt_pragma(x) _Pragma(rt_tostring(x))

#if defined(__GNUC__) || defined(__clang__) // TODO: remove and fix code
#pragma GCC diagnostic ignored "-Wgnu-zero-variadic-macro-arguments"
#pragma GCC diagnostic ignored "-Wdeclaration-after-statement"
#pragma GCC diagnostic ignored "-Wfour-char-constants"
#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
#pragma GCC diagnostic ignored "-Wunsafe-buffer-usage"
#pragma GCC diagnostic ignored "-Wunused-function"
#pragma GCC diagnostic ignored "-Wfloat-equal"
#pragma GCC diagnostic ignored "-Wmissing-noreturn"
#pragma GCC diagnostic ignored "-Wdouble-promotion"
#pragma GCC diagnostic ignored "-Wcast-align"
#pragma GCC diagnostic ignored "-Waddress-of-packed-member"
#pragma GCC diagnostic ignored "-Wused-but-marked-unused" // because in debug only
#define rt_msvc_pragma(x)
#define rt_gcc_pragma(x) rt_pragma(x)
#else
#define rt_gcc_pragma(x)
#define rt_msvc_pragma(x) rt_pragma(x)
#endif

#ifdef _MSC_VER
    #define rt_suppress_constant_cond_exp _Pragma("warning(suppress: 4127)")
#else
    #define rt_suppress_constant_cond_exp
#endif

// Type aliases for floating-point types similar to <stdint.h>
typedef float  fp32_t;
typedef double fp64_t;
// "long fp64_t" is required by C standard but the bitness
// of it is not specified.

#ifdef __cplusplus
    #define rt_begin_c extern "C" {
    #define rt_end_c } // extern "C"
#else
    #define rt_begin_c // C headers compiled as C++
    #define rt_end_c
#endif

// rt_countof() and rt_countof() are suitable for
// small < 2^31 element arrays

#define rt_countof(a) ((int32_t)((int)(sizeof(a) / sizeof((a)[0]))))

#if defined(__GNUC__) || defined(__clang__)
    #define rt_force_inline __attribute__((always_inline))
#elif defined(_MSC_VER)
    #define rt_force_inline __forceinline
#endif

#ifndef __cplusplus
    #define null ((void*)0) // better than NULL which is zero
#else
    #define null nullptr
#endif

#if defined(_MSC_VER)
    #define rt_thread_local __declspec(thread)
#else
    #ifndef __cplusplus
        #define rt_thread_local _Thread_local // C99
    #else
        // C++ supports rt_thread_local keyword
    #endif
#endif

// rt_begin_packed rt_end_packed
// usage: typedef rt_begin_packed struct foo_s { ... } rt_end_packed foo_t;

#if defined(__GNUC__) || defined(__clang__)
#define rt_attribute_packed __attribute__((packed))
#define rt_begin_packed
#define rt_end_packed rt_attribute_packed
#else
#define rt_begin_packed rt_pragma( pack(push, 1) )
#define rt_end_packed rt_pragma( pack(pop) )
#define rt_attribute_packed
#endif

// usage: typedef struct rt_aligned_8 foo_s { ... } foo_t;

#if defined(__GNUC__) || defined(__clang__)
#define rt_aligned_8 __attribute__((aligned(8)))
#elif defined(_MSC_VER)
#define rt_aligned_8 __declspec(align(8))
#else
#define rt_aligned_8
#endif


// In callbacks the formal parameters are
// frequently unused. Also sometimes parameters
// are used in debug configuration only (e.g. rt_assert() checks)
// but not in release.
// C does not have anonymous parameters like C++
// Instead of:
//      void foo(param_type_t param) { (void)param; / *unused */ }
// use:
//      vod foo(param_type_t rt_unused(param)) { }

#if defined(__GNUC__) || defined(__clang__)
#define rt_unused(name) name __attribute__((unused))
#elif defined(_MSC_VER)
#define rt_unused(name) _Pragma("warning(suppress:  4100)") name
#else
#define rt_unused(name) name
#endif

// Because MS C compiler is unhappy about alloca() and
// does not implement (C99 optional) dynamic arrays on the stack:

#define rt_stackalloc(n) (_Pragma("warning(suppress: 6255 6263)") alloca(n))

// alloca() is messy and in general is a not a good idea.
// try to avoid if possible. Stack sizes vary from 64KB to 8MB in 2024.

================================================
FILE: inc/ut_win32.h
================================================
#pragma once
#ifdef WIN32

#pragma warning(push)
#pragma warning(disable: 4255) // no function prototype: '()' to '(void)'
#pragma warning(disable: 4459) // declaration of '...' hides global declaration

#pragma push_macro("UNICODE")
#define UNICODE // always because otherwise IME does not work

// ut:
#include <Windows.h>  // used by:
#include <Psapi.h>    // both rt_loader.c and rt_processes.c
#include <shellapi.h> // rt_processes.c
#include <winternl.h> // rt_processes.c
#include <initguid.h>     // for knownfolders
#include <KnownFolders.h> // rt_files.c
#include <AclAPI.h>       // rt_files.c
#include <ShlObj_core.h>  // rt_files.c
#include <Shlwapi.h>      // rt_files.c
// ui:
#include <commdlg.h>
#include <dbghelp.h>
#include <dwmapi.h>
#include <imm.h>
#include <ShellScalingApi.h>
#include <tlhelp32.h>
#include <VersionHelpers.h>
#include <windowsx.h>
#include <winnt.h>

#pragma pop_macro("UNICODE")

#pragma warning(pop)

#include <fcntl.h>

#define rt_export __declspec(dllexport)

// Win32 API BOOL -> errno_t translation

#define rt_b2e(call) ((errno_t)(call ? 0 : GetLastError()))

void rt_win32_close_handle(void* h);
/* translate ix to error */
errno_t rt_wait_ix2e(uint32_t r);


#endif // WIN32


================================================
FILE: msvc2022/.editorconfig
================================================
# top-most EditorConfig file for this level
root = true

[*.{c++,cc,cpp,cppm,cxx,h,h++,hh,hpp,hxx,inl,ipp,ixx,tlh,tli}]

spelling_languages = en-us
spelling_checkable_types = strings,identifiers,comments
spelling_exclusion_path = .\exclusion.dic
spelling_error_severity = hint

# Visual C++ Code Style settings

cpp_generate_documentation_comments = none

# Visual C++ Formatting settings

cpp_indent_braces = false
cpp_indent_multi_line_relative_to = innermost_parenthesis
cpp_indent_within_parentheses = indent
cpp_indent_preserve_within_parentheses = true
cpp_indent_case_contents = true
cpp_indent_case_labels = true
cpp_indent_case_contents_when_block = false
cpp_indent_lambda_braces_when_parameter = true
cpp_indent_goto_labels = one_left
cpp_indent_preprocessor = none
cpp_indent_access_specifiers = false
cpp_indent_namespace_contents = true
cpp_indent_preserve_comments = true
cpp_new_line_before_open_brace_namespace = ignore
cpp_new_line_before_open_brace_type = ignore
cpp_new_line_before_open_brace_function = ignore
cpp_new_line_before_open_brace_block = ignore
cpp_new_line_before_open_brace_lambda = ignore
cpp_new_line_scope_braces_on_separate_lines = false
cpp_new_line_close_brace_same_line_empty_type = true
cpp_new_line_close_brace_same_line_empty_function = true
cpp_new_line_before_catch = false
cpp_new_line_before_else = false
cpp_new_line_before_while_in_do_while = false
cpp_space_before_function_open_parenthesis = remove
cpp_space_within_parameter_list_parentheses = false
cpp_space_between_empty_parameter_list_parentheses = false
cpp_space_after_keywords_in_control_flow_statements = true
cpp_space_within_control_flow_statement_parentheses = false
cpp_space_before_lambda_open_parenthesis = false
cpp_space_within_cast_parentheses = false
cpp_space_after_cast_close_parenthesis = false
cpp_space_within_expression_parentheses = false
cpp_space_before_block_open_brace = true
cpp_space_between_empty_braces = false
cpp_space_before_initializer_list_open_brace = false
cpp_space_within_initializer_list_braces = true
cpp_space_preserve_in_initializer_list = true
cpp_space_before_open_square_bracket = false
cpp_space_within_square_brackets = false
cpp_space_before_empty_square_brackets = false
cpp_space_between_empty_square_brackets = false
cpp_space_group_square_brackets = true
cpp_space_within_lambda_brackets = false
cpp_space_between_empty_lambda_brackets = false
cpp_space_before_comma = false
cpp_space_after_comma = true
cpp_space_remove_around_member_operators = true
cpp_space_before_inheritance_colon = true
cpp_space_before_constructor_colon = true
cpp_space_remove_before_semicolon = true
cpp_space_after_semicolon = true
cpp_space_remove_around_unary_operator = true
cpp_space_around_binary_operator = insert
cpp_space_around_assignment_operator = insert
cpp_space_pointer_reference_alignment = left
cpp_space_around_ternary_operator = insert
cpp_use_unreal_engine_macro_formatting = true
cpp_wrap_preserve_blocks = one_liners

# Visual C++ Inlcude Cleanup settings

cpp_include_cleanup_add_missing_error_tag_type = suggestion
cpp_include_cleanup_remove_unused_error_tag_type = dimmed
cpp_include_cleanup_optimize_unused_error_tag_type = suggestion
cpp_include_cleanup_sort_after_edits = false
cpp_sort_includes_error_tag_type = none
cpp_sort_includes_priority_case_sensitive = false
cpp_sort_includes_priority_style = quoted
cpp_includes_style = default
cpp_includes_use_forward_slash = true


================================================
FILE: msvc2022/amalgamate.vcxproj
================================================
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <ItemGroup Label="ProjectConfigurations">
    <ProjectConfiguration Include="debug|arm64">
      <Configuration>debug</Configuration>
      <Platform>arm64</Platform>
    </ProjectConfiguration>
    <ProjectConfiguration Include="debug|x64">
      <Configuration>debug</Configuration>
      <Platform>x64</Platform>
    </ProjectConfiguration>
    <ProjectConfiguration Include="release|arm64">
      <Configuration>release</Configuration>
      <Platform>arm64</Platform>
    </ProjectConfiguration>
    <ProjectConfiguration Include="release|x64">
      <Configuration>release</Configuration>
      <Platform>x64</Platform>
    </ProjectConfiguration>
  </ItemGroup>
  <PropertyGroup Label="Globals">
    <ProjectGuid>{1EA9BF0C-402B-4852-BD16-644244F0D1B9}</ProjectGuid>
    <Keyword>Win32Proj</Keyword>
    <RootNamespace>amalgamate</RootNamespace>
    <ProjectName>amalgamate</ProjectName>
  </PropertyGroup>
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug|x64'" Label="Configuration">
    <PlatformToolset>v143</PlatformToolset>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug|arm64'" Label="Configuration">
    <PlatformToolset>v143</PlatformToolset>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release|x64'" Label="Configuration">
    <PlatformToolset>v143</PlatformToolset>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release|arm64'" Label="Configuration">
    <PlatformToolset>v143</PlatformToolset>
  </PropertyGroup>
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
  <ImportGroup Label="ExtensionSettings">
  </ImportGroup>
  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='debug|x64'" Label="PropertySheets">
    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
    <Import Project="common.props" />
  </ImportGroup>
  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='debug|arm64'" Label="PropertySheets">
    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
    <Import Project="common.props" />
  </ImportGroup>
  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='release|x64'" Label="PropertySheets">
    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
    <Import Project="common.props" />
  </ImportGroup>
  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='release|arm64'" Label="PropertySheets">
    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
    <Import Project="common.props" />
  </ImportGroup>
  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='debug|x64'">
    <Link>
      <SubSystem>Console</SubSystem>
    </Link>
    <PostBuildEvent>
      <Command>rem pushd $(ProjectDir).. &amp;&amp; $(TargetPath) ut &gt; $(ProjectDir)..\sfh\ut.h &amp;&amp; popd</Command>
    </PostBuildEvent>
  </ItemDefinitionGroup>
  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='debug|arm64'">
    <Link>
      <SubSystem>Console</SubSystem>
    </Link>
    <PostBuildEvent>
      <Command>rem pushd $(ProjectDir).. &amp;&amp; $(TargetPath) ut &gt; $(ProjectDir)..\sfh\ut.h &amp;&amp; popd</Command>
    </PostBuildEvent>
  </ItemDefinitionGroup>
  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='release|x64'">
    <Link>
      <SubSystem>Console</SubSystem>
    </Link>
    <PostBuildEvent>
      <Command>rem pushd $(ProjectDir).. &amp;&amp; $(TargetPath) ut &gt; $(ProjectDir)..\sfh\ut.h &amp;&amp; popd</Command>
    </PostBuildEvent>
  </ItemDefinitionGroup>
  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='release|arm64'">
    <Link>
      <SubSystem>Console</SubSystem>
    </Link>
    <PostBuildEvent>
      <Command>rem pushd $(ProjectDir).. &amp;&amp; $(TargetPath) ut &gt; $(ProjectDir)..\sfh\ut.h &amp;&amp; popd</Command>
    </PostBuildEvent>
  </ItemDefinitionGroup>
  <ItemGroup>
    <ClCompile Include="..\src\tools\amalgamate.c" />
    <ClCompile Include="..\src\tools\dirent.c" />
  </ItemGroup>
  <ItemGroup>
    <ClInclude Include="..\src\tools\dirent.h" />
  </ItemGroup>
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
</Project>

================================================
FILE: msvc2022/amalgamate.vcxproj.filters
================================================
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <ItemGroup>
    <ClCompile Include="..\src\tools\amalgamate.c" />
    <ClCompile Include="..\src\tools\dirent.c" />
  </ItemGroup>
  <ItemGroup>
    <ClInclude Include="..\src\tools\dirent.h" />
  </ItemGroup>
</Project>

================================================
FILE: msvc2022/common.props
================================================
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <ImportGroup Label="PropertySheets" />
  <ItemDefinitionGroup>
    <ClCompile>
      <AdditionalIncludeDirectories>$(ProjectDir)..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
      <AdditionalIncludeDirectories>$(ProjectDir)..\inc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
      <AdditionalIncludeDirectories>$(ProjectDir)..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
      <AdditionalIncludeDirectories>$(ProjectDir)..\src\samples;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
      <PreprocessorDefinitions>WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <PreprocessorDefinitions>WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <PreprocessorDefinitions>STRICT;%(PreprocessorDefinitions);</PreprocessorDefinitions>
      <PreprocessorDefinitions>WIN32_LEAN_AND_MEAN;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <PreprocessorDefinitions>VC_EXTRALEAN;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <PreprocessorDefinitions>_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <PreprocessorDefinitions>CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <PreprocessorDefinitions>_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <PreprocessorDefinitions>_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <WarningLevel>EnableAllWarnings</WarningLevel>
      <DisableSpecificWarnings>4710;%(DisableSpecificWarnings)</DisableSpecificWarnings>
      <!-- function not inlined -->
      <DisableSpecificWarnings>4711;%(DisableSpecificWarnings)</DisableSpecificWarnings>
      <!-- automatic inline expansion -->
      <DisableSpecificWarnings>4820;%(DisableSpecificWarnings)</DisableSpecificWarnings>
      <!-- '?' bytes padding added after data member -->
      <DisableSpecificWarnings>5045;%(DisableSpecificWarnings)</DisableSpecificWarnings>
      <!-- Spectre mitigation -->
      <DisableSpecificWarnings>6262;%(DisableSpecificWarnings)</DisableSpecificWarnings>
      <!-- EXCESSIVESTACKUSAGE -->
      <DisableSpecificWarnings>4746;%(DisableSpecificWarnings)</DisableSpecificWarnings>
      <!-- volatile access of 'var' is subject to /volatile:<iso|ms>
            setting; consider using __iso_volatile_load/store intrinsic functions -->
      <!-- Theat these warning as errors (because they are): -->
      <TreatSpecificWarningsAsErrors>4133;%(TreatSpecificWarningsAsErrors)</TreatSpecificWarningsAsErrors>
      <!-- incompatible types -->
      <TreatSpecificWarningsAsErrors>4020;%(TreatSpecificWarningsAsErrors)</TreatSpecificWarningsAsErrors>
      <!-- too many actual parameters -->
      <TreatSpecificWarningsAsErrors>4716;%(TreatSpecificWarningsAsErrors)</TreatSpecificWarningsAsErrors>
      <!-- function must return a value -->
      <TreatSpecificWarningsAsErrors>4013;%(TreatSpecificWarningsAsErrors)</TreatSpecificWarningsAsErrors>
      <!-- 'foo' undefined; assuming extern returning int -->
      <TreatSpecificWarningsAsErrors>4312;%(TreatSpecificWarningsAsErrors)</TreatSpecificWarningsAsErrors>
      <!-- conversion from '...' to '...' of greater size -->
      <TreatSpecificWarningsAsErrors>4087;%(TreatSpecificWarningsAsErrors)</TreatSpecificWarningsAsErrors>
      <!-- 'args': declared with 'void' parameter list -->
      <TreatSpecificWarningsAsErrors>4033;%(TreatSpecificWarningsAsErrors)</TreatSpecificWarningsAsErrors>
      <!-- function 'foo' must return a value -->
      <TreatSpecificWarningsAsErrors>4098;%(TreatSpecificWarningsAsErrors)</TreatSpecificWarningsAsErrors>
      <!-- 'void' function returning a value -->
      <TreatSpecificWarningsAsErrors>4047;%(TreatSpecificWarningsAsErrors)</TreatSpecificWarningsAsErrors>
      <!-- '=': '...' differs in levels of indirection -->
      <TreatSpecificWarningsAsErrors>4057;%(TreatSpecificWarningsAsErrors)</TreatSpecificWarningsAsErrors>
      <!-- function type differs in indirection to slightly different base types -->
      <TreatSpecificWarningsAsErrors>4113;%(TreatSpecificWarningsAsErrors)</TreatSpecificWarningsAsErrors>
      <!-- function '...' differs in parameter lists from '...' -->
      <TreatSpecificWarningsAsErrors>4700;%(TreatSpecificWarningsAsErrors)</TreatSpecificWarningsAsErrors>
      <!-- used uninitialized local variable '...' -->
      <TreatSpecificWarningsAsErrors>4431;%(TreatSpecificWarningsAsErrors)</TreatSpecificWarningsAsErrors>
      <!-- missing type specifier - int assumed. Note: C no longer supports default-int -->
      <DebugInformationFormat>OldStyle</DebugInformationFormat>
      <AdditionalOptions>/std:c17 /volatile:ms /experimental:c11atomics %(AdditionalOptions)</AdditionalOptions>
    </ClCompile>
    <Link>
      <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
      <AdditionalDependencies>$(CoreLibraryDependencies);%(AdditionalDependencies)</AdditionalDependencies>
    </Link>
    <ResourceCompile>
      <AdditionalIncludeDirectories>$(ProjectDir)..\inc;$(ProjectDir)..\src;$(ProjectDir)..\src\samples</AdditionalIncludeDirectories>
      <PreprocessorDefinitions>NDEBUG;$(DefineConstants);%(PreprocessorDefinitions)</PreprocessorDefinitions>
    </ResourceCompile>
  </ItemDefinitionGroup>
  <PropertyGroup Condition="'$(Configuration)'=='debug'">
    <OutDir>$(ProjectDir)..\bin\$(Configuration)\$(Platform)\</OutDir>
    <IntDir>$(ProjectDir)..\build\$(Configuration)\$(Platform)\$(ProjectName)\</IntDir>
    <GenerateManifest>false</GenerateManifest>
    <UseDebugLibraries>true</UseDebugLibraries>
    <Optimization>Disabled</Optimization>
    <CharacterSet>MultiByte</CharacterSet>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)'=='release'">
    <OutDir>$(ProjectDir)..\bin\$(Configuration)\$(Platform)\</OutDir>
    <IntDir>$(ProjectDir)..\build\$(Configuration)\$(Platform)\$(ProjectName)\</IntDir>
    <GenerateManifest>false</GenerateManifest>
    <UseDebugLibraries>false</UseDebugLibraries>
    <Optimization>Full</Optimization>
    <CharacterSet>MultiByte</CharacterSet>
  </PropertyGroup>
  <PropertyGroup>
    <LinkIncremental>false</LinkIncremental>
  </PropertyGroup>
  <ItemDefinitionGroup Condition="'$(Configuration)'=='debug'">
    <ClCompile>
      <PreprocessorDefinitions>_DEBUG;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
      <LanguageStandard_C>stdc17</LanguageStandard_C>
      <LanguageStandard>stdcpp20</LanguageStandard>
      <WholeProgramOptimization>false</WholeProgramOptimization>
      <Optimization>Disabled</Optimization>
      <SupportJustMyCode>false</SupportJustMyCode>
    </ClCompile>
    <ResourceCompile>
      <PreprocessorDefinitions>_DEBUG;DEBUG;$(DefineConstants);%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <NullTerminateStrings>true</NullTerminateStrings>
    </ResourceCompile>
    <Link>
      <OptimizeReferences>false</OptimizeReferences>
      <LinkIncremental>false</LinkIncremental>
      <AssemblyDebug>true</AssemblyDebug>
    </Link>
  </ItemDefinitionGroup>
  <ItemDefinitionGroup Condition="'$(Configuration)'=='release'">
    <ClCompile>
      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
      <LanguageStandard_C>stdc17</LanguageStandard_C>
      <LanguageStandard>stdcpp20</LanguageStandard>
      <Optimization>Full</Optimization>
      <WholeProgramOptimization>true</WholeProgramOptimization>
      <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
      <IntrinsicFunctions>true</IntrinsicFunctions>
    </ClCompile>
    <ResourceCompile>
      <PreprocessorDefinitions>NDEBUG</PreprocessorDefinitions>
      <NullTerminateStrings>true</NullTerminateStrings>
    </ResourceCompile>
    <Link>
      <LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
      <OptimizeReferences>true</OptimizeReferences>
      <LinkIncremental>false</LinkIncremental>
      <AssemblyDebug>true</AssemblyDebug>
    </Link>
  </ItemDefinitionGroup>
</Project>

================================================
FILE: msvc2022/exclusion.dic
================================================
#### .editorconfig seems to be ignored
#### merge manually for not with:
#### C:\Users\leo\AppData\Local\Microsoft\VisualStudio\17.0_0790c7c1\exclusion.dic
Dacl
Hant
Hilight
Hola
Inteli
Intelisense
Intelli
dxgi
dwrite
swapchain
rect
traceln
idof
dism
segoe
Phur
ntdll
doserrno
countof
hcore
shcore
fdips
fdip
bgra
alice
indian
navajo
tabstop
gainsboro
peru
argb
zoomer
ltrb
printfs
debugln
Kuznetsov
trols
println
perrno
muldiv
dbghelp
comctl
comdlg
dwmapi
msimg
uxtheme
Toolhelp
strpintf
Latn
defau
Formee
cleartype
rgbx
bgrx
Hilight
wingdi
prussian
charleston
fogra
klein
zaffre
falu
byzantium
jazzberry
french
sacramento
persian
timberwolf
payne
ibeam
nwse
nesw
relayout
fuzzer
advapi
psapi
shlwapi
imagehlp
posix
mkdirs
rmdirs
unmap
hwair
dword
sqlite
otms
rgrc
Intelli
egypt
sfence
respone
abcdefghi
mollit
anim
cupidatat
commodo
aute
amet
consectetur
adipiscing
elit
eiusmod
tempor
laborum
deserunt
occaecat
voluptate
veniam
quis
incididunt
nostrud
ullamco
aliqua
laboris
aliquip
consequat
irure
reprehenderit
enim
velit
proident
esse
cillum
fugiat
Excepteur
nulla
officia
pariatur
pellentesque
sapien
faucibus
quisque
pretium
duis
lacus
fringilla
vivamus
placerat
tellus
nisl
massa
iaculis
metus
egestas
bibendum
urna
curabitur
facilisi
cubilia
curae
habitasse
platea
dictumst
morbi
senectus
netus
suscipit
feugiat
tristique
accumsan
maecenas
potenti
ultricies
praesent
felis
venenatis
ultrices
proin
primis
vulputate
ornare
sagittis
vehicula
ullamcorper
rutrum
cras
eleifend
turpis
imperdiet
mollis
nullam
volutpat
porttitor
lectus
augue
arcu
dignissim
aliquam
elementum
euismod
quam
justo
congue
sollicitudin
erat
viverra
tincidunt
facilisis
dapibus
etiam
interdum
condimentum
neque
tortor
luctus
nibh
finibus
aenean
malesuada
scelerisque
nunc
posuere
hendrerit
aptent
taciti
sociosqu
litora
torquent
conubia
inceptos
himenaeos
orci
varius
purus
natoque
penatibus
magnis
montes
nascetur
ridiculus
donec
rhoncus
lobortis
molestie
mattis
eget
odio
phasellus
efficitur
laoreet
mauris
fusce
risus
blandit
suspendisse
aliquet
sodales
pgup
pgdw
istarts
iends
chinese


================================================
FILE: msvc2022/groot.vcxproj
================================================
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <ItemGroup Label="ProjectConfigurations">
    <ProjectConfiguration Include="debug|arm64">
      <Configuration>debug</Configuration>
      <Platform>arm64</Platform>
    </ProjectConfiguration>
    <ProjectConfiguration Include="debug|x64">
      <Configuration>debug</Configuration>
      <Platform>x64</Platform>
    </ProjectConfiguration>
    <ProjectConfiguration Include="release|arm64">
      <Configuration>release</Configuration>
      <Platform>arm64</Platform>
    </ProjectConfiguration>
    <ProjectConfiguration Include="release|x64">
      <Configuration>release</Configuration>
      <Platform>x64</Platform>
    </ProjectConfiguration>
  </ItemGroup>
  <PropertyGroup Label="Globals">
    <ProjectGuid>{4A21BE1F-678C-4733-ABF0-A7BFFFCF2CC3}</ProjectGuid>
    <Keyword>Win32Proj</Keyword>
    <RootNamespace>groot</RootNamespace>
    <ProjectName>groot</ProjectName>
  </PropertyGroup>
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug|x64'" Label="Configuration">
    <ConfigurationType>Application</ConfigurationType>
    <UseDebugLibraries>true</UseDebugLibraries>
    <PlatformToolset>v143</PlatformToolset>
    <CharacterSet>MultiByte</CharacterSet>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug|arm64'" Label="Configuration">
    <ConfigurationType>Application</ConfigurationType>
    <UseDebugLibraries>true</UseDebugLibraries>
    <PlatformToolset>v143</PlatformToolset>
    <CharacterSet>MultiByte</CharacterSet>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release|x64'" Label="Configuration">
    <ConfigurationType>Application</ConfigurationType>
    <UseDebugLibraries>false</UseDebugLibraries>
    <PlatformToolset>v143</PlatformToolset>
    <WholeProgramOptimization>true</WholeProgramOptimization>
    <CharacterSet>MultiByte</CharacterSet>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release|arm64'" Label="Configuration">
    <ConfigurationType>Application</ConfigurationType>
    <UseDebugLibraries>false</UseDebugLibraries>
    <PlatformToolset>v143</PlatformToolset>
    <WholeProgramOptimization>true</WholeProgramOptimization>
    <CharacterSet>MultiByte</CharacterSet>
  </PropertyGroup>
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
  <ImportGroup Label="ExtensionSettings">
  </ImportGroup>
  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='debug|x64'" Label="PropertySheets">
    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
    <Import Project="common.props" />
  </ImportGroup>
  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='debug|arm64'" Label="PropertySheets">
    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
    <Import Project="common.props" />
  </ImportGroup>
  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='release|x64'" Label="PropertySheets">
    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
    <Import Project="common.props" />
  </ImportGroup>
  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='release|arm64'" Label="PropertySheets">
    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" 
Download .txt
gitextract_fo8u23vg/

├── .github/
│   └── workflows/
│       └── build-on-push.yml
├── .gitignore
├── LICENSE
├── README.md
├── inc/
│   ├── generics.h
│   ├── rt/
│   │   ├── rt.h
│   │   ├── rt_args.h
│   │   ├── rt_atomics.h
│   │   ├── rt_backtrace.h
│   │   ├── rt_clipboard.h
│   │   ├── rt_clock.h
│   │   ├── rt_config.h
│   │   ├── rt_core.h
│   │   ├── rt_debug.h
│   │   ├── rt_files.h
│   │   ├── rt_glyphs.h
│   │   ├── rt_heap.h
│   │   ├── rt_loader.h
│   │   ├── rt_mem.h
│   │   ├── rt_nls.h
│   │   ├── rt_num.h
│   │   ├── rt_processes.h
│   │   ├── rt_static.h
│   │   ├── rt_str.h
│   │   ├── rt_streams.h
│   │   ├── rt_threads.h
│   │   ├── rt_vigil.h
│   │   ├── rt_work.h
│   │   └── version.rc.in
│   ├── ui/
│   │   ├── ui.h
│   │   ├── ui_app.h
│   │   ├── ui_button.h
│   │   ├── ui_caption.h
│   │   ├── ui_colors.h
│   │   ├── ui_containers.h
│   │   ├── ui_core.h
│   │   ├── ui_edit_doc.h
│   │   ├── ui_edit_view.h
│   │   ├── ui_fuzzing.h
│   │   ├── ui_gdi.h
│   │   ├── ui_image.h
│   │   ├── ui_label.h
│   │   ├── ui_mbx.h
│   │   ├── ui_midi.h
│   │   ├── ui_slider.h
│   │   ├── ui_theme.h
│   │   ├── ui_toggle.h
│   │   └── ui_view.h
│   ├── ut_std.h
│   └── ut_win32.h
├── msvc2022/
│   ├── .editorconfig
│   ├── amalgamate.vcxproj
│   ├── amalgamate.vcxproj.filters
│   ├── common.props
│   ├── exclusion.dic
│   ├── groot.vcxproj
│   ├── groot.vcxproj.filters
│   ├── manifest.xml
│   ├── msvc2022.vssettings
│   ├── prebuild.vcxproj
│   ├── prebuild.vcxproj.filters
│   ├── rt.vcxproj
│   ├── rt.vcxproj.filters
│   ├── sample1.vcxproj
│   ├── sample1.vcxproj.filters
│   ├── sample2.vcxproj
│   ├── sample2.vcxproj.filters
│   ├── sample3.vcxproj
│   ├── sample3.vcxproj.filters
│   ├── sample4.vcxproj
│   ├── sample4.vcxproj.filters
│   ├── sample5.vcxproj
│   ├── sample5.vcxproj.filters
│   ├── sample6.vcxproj
│   ├── sample6.vcxproj.filters
│   ├── sample7.vcxproj
│   ├── sample7.vcxproj.filters
│   ├── sample8.vcxproj
│   ├── sample8.vcxproj.filters
│   ├── sample9.vcxproj
│   ├── sample9.vcxproj.filters
│   ├── test1.vcxproj
│   ├── test1.vcxproj.filters
│   ├── test2.vcxproj
│   ├── test2.vcxproj.filters
│   ├── ui.sln
│   ├── ui.vcxproj
│   ├── ui.vcxproj.filters
│   ├── version.vcxproj
│   └── version.vcxproj.filters
├── scripts/
│   ├── clean.bat
│   └── prebuild.bat
├── single_file_lib/
│   ├── rt/
│   │   └── rt.h
│   └── ui/
│       └── ui.h
├── src/
│   ├── rt/
│   │   ├── rt.c
│   │   ├── rt_args.c
│   │   ├── rt_atomics.c
│   │   ├── rt_backtrace.c
│   │   ├── rt_clipboard.c
│   │   ├── rt_clock.c
│   │   ├── rt_config.c
│   │   ├── rt_core.c
│   │   ├── rt_debug.c
│   │   ├── rt_files.c
│   │   ├── rt_generics.c
│   │   ├── rt_heap.c
│   │   ├── rt_loader.c
│   │   ├── rt_mem.c
│   │   ├── rt_nls.c
│   │   ├── rt_num.c
│   │   ├── rt_processes.c
│   │   ├── rt_static.c
│   │   ├── rt_str.c
│   │   ├── rt_streams.c
│   │   ├── rt_threads.c
│   │   ├── rt_vigil.c
│   │   ├── rt_win32.c
│   │   └── rt_work.c
│   ├── samples/
│   │   ├── edit.test.c
│   │   ├── groot/
│   │   │   ├── groot.c
│   │   │   ├── groot.h
│   │   │   ├── groot.rc
│   │   │   └── rocket.h
│   │   ├── i18n.h
│   │   ├── mr_blue_sky.midi
│   │   ├── rt.c
│   │   ├── sample.rc
│   │   ├── sample1.c
│   │   ├── sample2.c
│   │   ├── sample3.c
│   │   ├── sample4.c
│   │   ├── sample5.c
│   │   ├── sample6.c
│   │   ├── sample6.rc
│   │   ├── sample7.c
│   │   ├── sample8.c
│   │   ├── sample9.c
│   │   ├── stb_image.c
│   │   ├── stb_image.h
│   │   └── ui.c
│   ├── tools/
│   │   ├── amalgamate.c
│   │   ├── dirent.c
│   │   ├── dirent.h
│   │   └── version.c
│   └── ui/
│       ├── attic/
│       │   └── ui_theme.c
│       ├── ui_app.c
│       ├── ui_button.c
│       ├── ui_caption.c
│       ├── ui_colors.c
│       ├── ui_containers.c
│       ├── ui_core.c
│       ├── ui_edit_doc.c
│       ├── ui_edit_view.c
│       ├── ui_fuzzing.c
│       ├── ui_gdi.c
│       ├── ui_image.c
│       ├── ui_label.c
│       ├── ui_mbx.c
│       ├── ui_midi.c
│       ├── ui_slider.c
│       ├── ui_theme.c
│       ├── ui_toggle.c
│       └── ui_view.c
└── test/
    ├── test1.c
    ├── test1.rc
    └── test2.c
Download .txt
Showing preview only (261K chars total). Download the full file or copy to clipboard to get everything.
SYMBOL INDEX (2729 symbols across 100 files)

FILE: inc/generics.h
  function rt_begin_c (line 4) | rt_begin_c
  function rt_max_int16 (line 16) | static inline int16_t  rt_max_int16(int16_t x, int16_t y)    { return x ...
  function rt_max_int32 (line 17) | static inline int32_t  rt_max_int32(int32_t x, int32_t y)    { return x ...
  function rt_max_int64 (line 18) | static inline int64_t  rt_max_int64(int64_t x, int64_t y)    { return x ...
  function rt_max_uint8 (line 19) | static inline uint8_t  rt_max_uint8(uint8_t x, uint8_t y)    { return x ...
  function rt_max_uint16 (line 20) | static inline uint16_t rt_max_uint16(uint16_t x, uint16_t y) { return x ...
  function rt_max_uint32 (line 21) | static inline uint32_t rt_max_uint32(uint32_t x, uint32_t y) { return x ...
  function rt_max_uint64 (line 22) | static inline uint64_t rt_max_uint64(uint64_t x, uint64_t y) { return x ...
  function fp32_t (line 23) | static inline fp32_t   rt_max_fp32(fp32_t x, fp32_t y)       { return x ...
  function fp64_t (line 24) | static inline fp64_t   rt_max_fp64(fp64_t x, fp64_t y)       { return x ...
  function rt_max_long (line 30) | static inline long          rt_max_long(long x, long y)                 ...
  function rt_max_ulong (line 31) | static inline unsigned long rt_max_ulong(unsigned long x, unsigned long ...
  function rt_min_int8 (line 33) | static inline int8_t   rt_min_int8(int8_t x, int8_t y)       { return x ...
  function rt_min_int16 (line 34) | static inline int16_t  rt_min_int16(int16_t x, int16_t y)    { return x ...
  function rt_min_int32 (line 35) | static inline int32_t  rt_min_int32(int32_t x, int32_t y)    { return x ...
  function rt_min_int64 (line 36) | static inline int64_t  rt_min_int64(int64_t x, int64_t y)    { return x ...
  function rt_min_uint8 (line 37) | static inline uint8_t  rt_min_uint8(uint8_t x, uint8_t y)    { return x ...
  function rt_min_uint16 (line 38) | static inline uint16_t rt_min_uint16(uint16_t x, uint16_t y) { return x ...
  function rt_min_uint32 (line 39) | static inline uint32_t rt_min_uint32(uint32_t x, uint32_t y) { return x ...
  function rt_min_uint64 (line 40) | static inline uint64_t rt_min_uint64(uint64_t x, uint64_t y) { return x ...
  function fp32_t (line 41) | static inline fp32_t   rt_min_fp32(fp32_t x, fp32_t y)       { return x ...
  function fp64_t (line 42) | static inline fp64_t   rt_min_fp64(fp64_t x, fp64_t y)       { return x ...
  function rt_min_long (line 44) | static inline long          rt_min_long(long x, long y)                 ...
  function rt_min_ulong (line 45) | static inline unsigned long rt_min_ulong(unsigned long x, unsigned long ...
  function rt_min_undefined (line 48) | static inline void rt_min_undefined(void) { }
  function rt_max_undefined (line 49) | static inline void rt_max_undefined(void) { }
  type rt_generics_if (line 97) | typedef struct {

FILE: inc/rt/rt_args.h
  function rt_begin_c (line 4) | rt_begin_c

FILE: inc/rt/rt_atomics.h
  function rt_begin_c (line 6) | rt_begin_c

FILE: inc/rt/rt_backtrace.h
  type thread_s (line 11) | struct thread_s
  type rt_backtrace_t (line 16) | typedef struct rt_backtrace_s {
  type rt_backtrace_if (line 40) | typedef struct {

FILE: inc/rt/rt_clipboard.h
  type ui_bitmap_s (line 6) | struct ui_bitmap_s
  type rt_clipboard_if (line 8) | typedef struct {

FILE: inc/rt/rt_clock.h
  function rt_begin_c (line 4) | rt_begin_c

FILE: inc/rt/rt_config.h
  function rt_begin_c (line 4) | rt_begin_c

FILE: inc/rt/rt_core.h
  function rt_begin_c (line 4) | rt_begin_c

FILE: inc/rt/rt_debug.h
  function rt_begin_c (line 4) | rt_begin_c
  type rt_debug_if (line 24) | typedef struct {

FILE: inc/rt/rt_files.h
  type rt_file_name_s (line 7) | struct rt_file_name_s { char s[1024]; }
  type rt_file_t (line 11) | typedef struct rt_file_s rt_file_t;
  type rt_files_stat_t (line 13) | typedef struct rt_files_stat_s {
  type rt_folder_t (line 21) | typedef struct rt_folder_s {
  type rt_files_if (line 25) | typedef struct {

FILE: inc/rt/rt_heap.h
  type rt_heap_s (line 27) | struct rt_heap_s
  type rt_heap_if (line 29) | typedef struct { // heap == null uses process serialized LFH

FILE: inc/rt/rt_loader.h
  function rt_begin_c (line 4) | rt_begin_c

FILE: inc/rt/rt_mem.h
  function rt_begin_c (line 4) | rt_begin_c

FILE: inc/rt/rt_nls.h
  function rt_begin_c (line 4) | rt_begin_c

FILE: inc/rt/rt_num.h
  function rt_begin_c (line 4) | rt_begin_c
  type rt_num_if (line 11) | typedef struct {

FILE: inc/rt/rt_processes.h
  function rt_begin_c (line 4) | rt_begin_c
  type rt_processes_if (line 19) | typedef struct {

FILE: inc/rt/rt_str.h
  type rt_str64_t (line 6) | struct rt_str64_t {
  type rt_str128_t (line 10) | typedef struct rt_str128_t {
  type rt_str1024_t (line 14) | typedef struct rt_str1024_t {
  type rt_str32K_t (line 18) | typedef struct rt_str32K_t {
  type rt_str_if (line 35) | typedef struct {

FILE: inc/rt/rt_streams.h
  type rt_stream_if (line 6) | struct rt_stream_if
  type rt_stream_if (line 8) | typedef struct rt_stream_if {
  type rt_stream_memory_if (line 16) | typedef struct {
  type rt_streams_if (line 26) | typedef struct {

FILE: inc/rt/rt_threads.h
  type rt_event_s (line 6) | struct rt_event_s
  type rt_event_if (line 8) | typedef struct {
  type rt_mutex_s (line 25) | typedef struct rt_aligned_8 rt_mutex_s
  type rt_mutex_if (line 27) | typedef struct {
  type thread_s (line 37) | struct thread_s
  type rt_thread_if (line 39) | typedef struct {

FILE: inc/rt/rt_vigil.h
  type rt_vigil_if (line 12) | typedef struct {

FILE: inc/rt/rt_work.h
  type rt_event_s (line 9) | struct rt_event_s
  type rt_work_t (line 10) | typedef struct rt_work_s       rt_work_t;
  type rt_work_queue_t (line 11) | typedef struct rt_work_queue_s rt_work_queue_t;
  type rt_work_t (line 13) | typedef struct rt_work_s {
  type rt_work_queue_t (line 23) | typedef struct rt_work_queue_s {
  type rt_work_queue_if (line 29) | typedef struct rt_work_queue_if {
  type rt_worker_t (line 40) | typedef struct rt_worker_s {
  type rt_worker_if (line 47) | typedef struct rt_worker_if {

FILE: inc/ui/ui_app.h
  type ui_app_message_handler_s (line 8) | struct ui_app_message_handler_s
  type ui_app_message_handler_t (line 10) | typedef struct ui_app_message_handler_s {
  type ui_dpi_t (line 17) | typedef struct ui_dpi_s { // max(dpi_x, dpi_y)
  type ui_window_sizing_t (line 34) | typedef struct ui_window_sizing_s {
  type ui_fms_t (line 47) | typedef struct ui_fms_s {
  type ui_app_t (line 59) | typedef struct { // TODO: split to ui_app_t and ui_app_if, move data aft...

FILE: inc/ui/ui_caption.h
  type ui_caption_s (line 6) | struct ui_caption_s {

FILE: inc/ui/ui_colors.h
  type control_colors_t (line 71) | typedef struct ui_control_colors_s {
  type ui_control_state_colors_t (line 80) | typedef struct ui_control_state_colors_s {
  type ui_colors_if (line 88) | typedef struct ui_colors_s {

FILE: inc/ui/ui_containers.h
  type ui_view_s (line 6) | struct ui_view_s
  type ui_view_t (line 40) | typedef struct ui_view_s ui_view_t;

FILE: inc/ui/ui_core.h
  type ui_point_s (line 6) | struct ui_point_s { int32_t x, y; }
  type ui_rect_t (line 7) | typedef struct ui_rect_s { int32_t x, y, w, h; } ui_rect_t;
  type ui_ltrb_t (line 8) | typedef struct ui_ltbr_s { int32_t left, top, right, bottom; } ui_ltrb_t;
  type ui_wh_t (line 9) | typedef struct ui_wh_s   { int32_t w, h; } ui_wh_t;
  type ui_window_s (line 11) | struct ui_window_s
  type ui_icon_s (line 12) | struct ui_icon_s
  type ui_canvas_s (line 13) | struct ui_canvas_s
  type ui_texture_s (line 14) | struct ui_texture_s
  type ui_font_s (line 15) | struct ui_font_s
  type ui_brush_s (line 16) | struct ui_brush_s
  type ui_pen_s (line 17) | struct ui_pen_s
  type ui_cursor_s (line 18) | struct ui_cursor_s
  type ui_region_s (line 19) | struct ui_region_s
  type ui_timer_t (line 21) | typedef uintptr_t ui_timer_t;
  type ui_bitmap_t (line 23) | typedef struct ui_bitmap_s { // TODO: ui_ namespace
  type ui_margins_t (line 39) | typedef struct ui_gaps_s { // in partial "em"s
  type ui_if (line 46) | typedef struct ui_s {

FILE: inc/ui/ui_edit_doc.h
  type ui_edit_str_s (line 8) | struct ui_edit_str_s
  type ui_edit_doc_t (line 10) | typedef struct ui_edit_doc_s ui_edit_doc_t;
  type ui_edit_notify_t (line 12) | typedef struct ui_edit_notify_s ui_edit_notify_t;
  type ui_edit_to_do_t (line 14) | typedef struct ui_edit_to_do_s ui_edit_to_do_t;
  type ui_edit_pg_t (line 16) | typedef struct ui_edit_pg_s { // page/glyph coordinates
  type ui_edit_range_s (line 22) | typedef union rt_begin_packed ui_edit_range_s
  type ui_edit_text_t (line 27) | typedef struct ui_edit_text_s {
  type ui_edit_notify_info_t (line 32) | typedef struct ui_edit_notify_info_s {
  type ui_edit_notify_t (line 50) | typedef struct ui_edit_notify_s { // called before and after replace()
  type ui_edit_listener_t (line 56) | typedef struct ui_edit_listener_s ui_edit_listener_t;
  type ui_edit_listener_t (line 58) | typedef struct ui_edit_listener_s {
  type ui_edit_to_do_t (line 64) | typedef struct ui_edit_to_do_s { // undo/redo action
  type ui_edit_doc_t (line 70) | typedef struct ui_edit_doc_s {
  type ui_edit_doc_if (line 77) | typedef struct ui_edit_doc_if {
  type ui_edit_range_if (line 104) | typedef struct ui_edit_range_if {
  type ui_edit_text_if (line 120) | typedef struct ui_edit_text_if {
  type ui_edit_str_s (line 146) | typedef struct rt_begin_packed ui_edit_str_s
  type ui_edit_str_if (line 156) | typedef struct ui_edit_str_if {

FILE: inc/ui/ui_edit_view.h
  type ui_edit_view_s (line 11) | struct ui_edit_view_s
  type ui_edit_str_t (line 13) | typedef struct ui_edit_str_s ui_edit_str_t;
  type ui_edit_doc_t (line 15) | typedef struct ui_edit_doc_s ui_edit_doc_t;
  type ui_edit_notify_t (line 17) | typedef struct ui_edit_notify_s ui_edit_notify_t;
  type ui_edit_to_do_t (line 19) | typedef struct ui_edit_to_do_s ui_edit_to_do_t;
  type ui_edit_pr_t (line 21) | typedef struct ui_edit_pr_s { // page/run coordinates
  type ui_edit_run_t (line 26) | typedef struct ui_edit_run_s {
  type ui_edit_paragraph_t (line 38) | typedef struct ui_edit_paragraph_s { // "paragraph" view consists of wra...
  type ui_edit_notify_view_t (line 43) | typedef struct ui_edit_notify_view_s {
  type ui_edit_view_t (line 49) | typedef struct ui_edit_view_s {
  type ui_edit_view_if (line 79) | typedef struct ui_edit_view_if {

FILE: inc/ui/ui_fuzzing.h
  type ui_fuzzing_s (line 11) | struct ui_fuzzing_s {
  type ui_fuzzing_if (line 30) | typedef struct ui_fuzzing_if {

FILE: inc/ui/ui_gdi.h
  type ui_fm_t (line 18) | typedef struct ui_fm_s { // font metrics
  type ui_gdi_ta_t (line 63) | typedef struct ui_gdi_ta_s { // text attributes
  type ui_gdi_if (line 70) | typedef struct {

FILE: inc/ui/ui_image.h
  type ui_image_s (line 17) | struct ui_image_s
  type ui_image_t (line 19) | typedef struct ui_image_s {
  type ui_image_if (line 52) | typedef struct ui_image_if {

FILE: inc/ui/ui_mbx.h
  function rt_begin_c (line 5) | rt_begin_c

FILE: inc/ui/ui_midi.h
  type ui_midi_t (line 9) | typedef struct ui_midi_s ui_midi_t;
  type ui_midi_t (line 11) | typedef struct ui_midi_s {
  type ui_midi_if (line 17) | typedef struct {

FILE: inc/ui/ui_slider.h
  type ui_slider_s (line 7) | struct ui_slider_s
  type ui_slider_t (line 9) | typedef struct ui_slider_s {

FILE: inc/ui/ui_theme.h
  type ui_theme_if (line 13) | typedef struct  {

FILE: inc/ui/ui_view.h
  function rt_begin_c (line 4) | rt_begin_c

FILE: inc/ut_std.h
  type fp32_t (line 47) | typedef float  fp32_t;
  type fp64_t (line 48) | typedef double fp64_t;

FILE: single_file_lib/rt/rt.h
  type fp32_t (line 51) | typedef float  fp32_t;
  type fp64_t (line 52) | typedef double fp64_t;
  type rt_str64_t (line 145) | struct rt_str64_t {
  type rt_str128_t (line 149) | typedef struct rt_str128_t {
  type rt_str1024_t (line 153) | typedef struct rt_str1024_t {
  type rt_str32K_t (line 157) | typedef struct rt_str32K_t {
  type rt_str_if (line 174) | typedef struct {
  type rt_args_if (line 251) | typedef struct {
  type thread_s (line 336) | struct thread_s
  type rt_backtrace_t (line 341) | typedef struct rt_backtrace_s {
  type rt_backtrace_if (line 365) | typedef struct {
  type rt_atomics_if (line 394) | typedef struct {
  type ui_bitmap_t (line 429) | typedef struct ui_bitmap_s ui_bitmap_t;
  type rt_clipboard_if (line 431) | typedef struct {
  type rt_clock_if (line 446) | typedef struct {
  type rt_config_if (line 483) | typedef struct {
  type rt_core_if (line 504) | typedef struct {
  type rt_verbosity_if (line 556) | typedef struct {
  type rt_debug_if (line 565) | typedef struct {
  type rt_file_name_t (line 621) | typedef struct rt_file_name_s { char s[1024]; } rt_file_name_t;
  type rt_file_t (line 625) | typedef struct rt_file_s rt_file_t;
  type rt_files_stat_t (line 627) | typedef struct rt_files_stat_s {
  type rt_folder_t (line 635) | typedef struct rt_folder_s {
  type rt_files_if (line 639) | typedef struct {
  function rt_max_int8 (line 735) | static inline int8_t   rt_max_int8(int8_t x, int8_t y)       { return x ...
  function rt_max_int16 (line 736) | static inline int16_t  rt_max_int16(int16_t x, int16_t y)    { return x ...
  function rt_max_int32 (line 737) | static inline int32_t  rt_max_int32(int32_t x, int32_t y)    { return x ...
  function rt_max_int64 (line 738) | static inline int64_t  rt_max_int64(int64_t x, int64_t y)    { return x ...
  function rt_max_uint8 (line 739) | static inline uint8_t  rt_max_uint8(uint8_t x, uint8_t y)    { return x ...
  function rt_max_uint16 (line 740) | static inline uint16_t rt_max_uint16(uint16_t x, uint16_t y) { return x ...
  function rt_max_uint32 (line 741) | static inline uint32_t rt_max_uint32(uint32_t x, uint32_t y) { return x ...
  function rt_max_uint64 (line 742) | static inline uint64_t rt_max_uint64(uint64_t x, uint64_t y) { return x ...
  function fp32_t (line 743) | static inline fp32_t   rt_max_fp32(fp32_t x, fp32_t y)       { return x ...
  function fp64_t (line 744) | static inline fp64_t   rt_max_fp64(fp64_t x, fp64_t y)       { return x ...
  function rt_max_long (line 750) | static inline long          rt_max_long(long x, long y)                 ...
  function rt_max_ulong (line 751) | static inline unsigned long rt_max_ulong(unsigned long x, unsigned long ...
  function rt_min_int8 (line 753) | static inline int8_t   rt_min_int8(int8_t x, int8_t y)       { return x ...
  function rt_min_int16 (line 754) | static inline int16_t  rt_min_int16(int16_t x, int16_t y)    { return x ...
  function rt_min_int32 (line 755) | static inline int32_t  rt_min_int32(int32_t x, int32_t y)    { return x ...
  function rt_min_int64 (line 756) | static inline int64_t  rt_min_int64(int64_t x, int64_t y)    { return x ...
  function rt_min_uint8 (line 757) | static inline uint8_t  rt_min_uint8(uint8_t x, uint8_t y)    { return x ...
  function rt_min_uint16 (line 758) | static inline uint16_t rt_min_uint16(uint16_t x, uint16_t y) { return x ...
  function rt_min_uint32 (line 759) | static inline uint32_t rt_min_uint32(uint32_t x, uint32_t y) { return x ...
  function rt_min_uint64 (line 760) | static inline uint64_t rt_min_uint64(uint64_t x, uint64_t y) { return x ...
  function fp32_t (line 761) | static inline fp32_t   rt_min_fp32(fp32_t x, fp32_t y)       { return x ...
  function fp64_t (line 762) | static inline fp64_t   rt_min_fp64(fp64_t x, fp64_t y)       { return x ...
  function rt_min_long (line 764) | static inline long          rt_min_long(long x, long y)                 ...
  function rt_min_ulong (line 765) | static inline unsigned long rt_min_ulong(unsigned long x, unsigned long ...
  function rt_min_undefined (line 768) | static inline void rt_min_undefined(void) { }
  function rt_max_undefined (line 769) | static inline void rt_max_undefined(void) { }
  type rt_generics_if (line 817) | typedef struct {
  type rt_heap_s (line 1415) | struct rt_heap_s
  type rt_heap_if (line 1417) | typedef struct { // heap == null uses process serialized LFH
  type rt_loader_if (line 1453) | typedef struct {
  type rt_mem_if (line 1475) | typedef struct {
  type rt_nls_if (line 1503) | typedef struct { // i18n national language support
  type rt_num128_t (line 1525) | typedef struct {
  type rt_num_if (line 1530) | typedef struct {
  type rt_stream_if (line 1602) | typedef struct rt_stream_if rt_stream_if;
  type rt_stream_if (line 1604) | typedef struct rt_stream_if {
  type rt_stream_memory_if (line 1612) | typedef struct {
  type rt_streams_if (line 1622) | typedef struct {
  type rt_processes_child_t (line 1638) | typedef struct {
  type rt_processes_if (line 1651) | typedef struct {
  type rt_event_s (line 1678) | struct rt_event_s
  type rt_event_if (line 1680) | typedef struct {
  type rt_mutex_s (line 1697) | typedef struct rt_aligned_8 rt_mutex_s
  type rt_mutex_if (line 1699) | typedef struct {
  type thread_s (line 1709) | struct thread_s
  type rt_thread_if (line 1711) | typedef struct {
  type rt_vigil_if (line 1741) | typedef struct {
  type rt_event_s (line 1806) | struct rt_event_s
  type rt_work_t (line 1807) | typedef struct rt_work_s       rt_work_t;
  type rt_work_queue_t (line 1808) | typedef struct rt_work_queue_s rt_work_queue_t;
  type rt_work_t (line 1810) | typedef struct rt_work_s {
  type rt_work_queue_t (line 1820) | typedef struct rt_work_queue_s {
  type rt_work_queue_if (line 1826) | typedef struct rt_work_queue_if {
  type rt_worker_t (line 1837) | typedef struct rt_worker_s {
  type rt_worker_if (line 1844) | typedef struct rt_worker_if {
  function rt_args_main (line 2037) | static void rt_args_main(int32_t argc, const char* argv[], const char** ...
  function rt_args_option_index (line 2045) | static int32_t rt_args_option_index(const char* option) {
  function rt_args_remove_at (line 2053) | static void rt_args_remove_at(int32_t ix) {
  function rt_args_option_bool (line 2064) | static bool rt_args_option_bool(const char* option) {
  function rt_args_option_int (line 2070) | static bool rt_args_option_int(const char* option, int64_t *value) {
  type rt_args_pair_t (line 2124) | typedef struct { const char* s; char* d; const char* e; } rt_args_pair_t;
  function rt_args_pair_t (line 2126) | static rt_args_pair_t rt_args_parse_backslashes(rt_args_pair_t p) {
  function rt_args_pair_t (line 2144) | static rt_args_pair_t rt_args_parse_quoted(rt_args_pair_t p) {
  function rt_args_parse (line 2170) | static void rt_args_parse(const char* s) {
  function rt_args_fini (line 2261) | static void rt_args_fini(void) {
  function rt_args_WinMain (line 2268) | static void rt_args_WinMain(void) {
  function rt_args_test_verify (line 2294) | static void rt_args_test_verify(const char* cl, int32_t expected, ...) {
  function rt_args_test (line 2327) | static void rt_args_test(void) {
  function rt_args_test (line 2358) | static void rt_args_test(void) {}
  function rt_atomics_increment_int32 (line 2385) | static int32_t rt_atomics_increment_int32(volatile int32_t* a) {
  function rt_atomics_decrement_int32 (line 2389) | static int32_t rt_atomics_decrement_int32(volatile int32_t* a) {
  function rt_atomics_increment_int64 (line 2393) | static int64_t rt_atomics_increment_int64(volatile int64_t* a) {
  function rt_atomics_decrement_int64 (line 2397) | static int64_t rt_atomics_decrement_int64(volatile int64_t* a) {
  function rt_atomics_add_int32 (line 2401) | static int32_t rt_atomics_add_int32(volatile int32_t* a, int32_t v) {
  function rt_atomics_add_int64 (line 2405) | static int64_t rt_atomics_add_int64(volatile int64_t* a, int64_t v) {
  function rt_atomics_exchange_int64 (line 2409) | static int64_t rt_atomics_exchange_int64(volatile int64_t* a, int64_t v) {
  function rt_atomics_exchange_int32 (line 2413) | static int32_t rt_atomics_exchange_int32(volatile int32_t* a, int32_t v) {
  function rt_atomics_compare_exchange_int64 (line 2418) | static bool rt_atomics_compare_exchange_int64(volatile int64_t* a,
  function rt_atomics_compare_exchange_int32 (line 2424) | static bool rt_atomics_compare_exchange_int32(volatile int32_t* a,
  function memory_fence (line 2430) | static void memory_fence(void) {
  function rt_atomics_increment_int32 (line 2462) | static int32_t rt_atomics_increment_int32(volatile int32_t* a) {
  function rt_atomics_decrement_int32 (line 2466) | static int32_t rt_atomics_decrement_int32(volatile int32_t* a) {
  function rt_atomics_increment_int64 (line 2470) | static int64_t rt_atomics_increment_int64(volatile int64_t* a) {
  function rt_atomics_decrement_int64 (line 2474) | static int64_t rt_atomics_decrement_int64(volatile int64_t* a) {
  function rt_atomics_add_int32 (line 2478) | static int32_t rt_atomics_add_int32(volatile int32_t* a, int32_t v) {
  function rt_atomics_add_int64 (line 2482) | static int64_t rt_atomics_add_int64(volatile int64_t* a, int64_t v) {
  function rt_atomics_exchange_int64 (line 2486) | static int64_t rt_atomics_exchange_int64(volatile int64_t* a, int64_t v) {
  function rt_atomics_exchange_int32 (line 2490) | static int32_t rt_atomics_exchange_int32(volatile int32_t* a, int32_t v) {
  function rt_atomics_compare_exchange_int64 (line 2494) | static bool rt_atomics_compare_exchange_int64(volatile int64_t* a,
  function rt_atomics_compare_exchange_int32 (line 2501) | static bool rt_atomics_compare_exchange_int32(volatile int32_t* a,
  function memory_fence (line 2507) | static void memory_fence(void) { atomic_thread_fence(memory_order_seq_cs...
  function rt_atomics_load_int32 (line 2513) | static int32_t rt_atomics_load_int32(volatile int32_t* a) {
  function rt_atomics_load_int64 (line 2517) | static int64_t rt_atomics_load_int64(volatile int64_t* a) {
  function rt_atomics_compare_exchange_ptr (line 2526) | static bool rt_atomics_compare_exchange_ptr(volatile void* *a, void* com...
  function spinlock_acquire (line 2543) | static void spinlock_acquire(volatile int64_t* spinlock) {
  function spinlock_release (line 2563) | static void spinlock_release(volatile int64_t* spinlock) {
  function rt_atomics_test (line 2570) | static void rt_atomics_test(void) {
  function rt_backtrace_init (line 2685) | static void rt_backtrace_init(void) {
  function rt_backtrace_capture (line 2708) | static void rt_backtrace_capture(rt_backtrace_t* bt, int32_t skip) {
  function rt_backtrace_function (line 2716) | static bool rt_backtrace_function(DWORD64 pc, SYMBOL_INFO* si) {
  function rt_backtrace_symbolize_inline_frame (line 2768) | static const void rt_backtrace_symbolize_inline_frame(rt_backtrace_t* bt,
  function rt_backtrace_symbolize_frame (line 2800) | static int32_t rt_backtrace_symbolize_frame(rt_backtrace_t* bt, int32_t ...
  function rt_backtrace_symbolize_backtrace (line 2860) | static void rt_backtrace_symbolize_backtrace(rt_backtrace_t* bt) {
  function rt_backtrace_symbolize (line 2876) | static void rt_backtrace_symbolize(rt_backtrace_t* bt) {
  function rt_backtrace_trace (line 2892) | static void rt_backtrace_trace(const rt_backtrace_t* bt, const char* sto...
  type rt_backtrace_thread_name_t (line 2937) | typedef struct { char name[32]; } rt_backtrace_thread_name_t;
  function rt_backtrace_thread_name_t (line 2939) | static rt_backtrace_thread_name_t rt_backtrace_thread_name(HANDLE thread) {
  function rt_backtrace_context (line 2950) | static void rt_backtrace_context(rt_thread_t thread, const void* ctx,
  function rt_backtrace_thread (line 3003) | static void rt_backtrace_thread(HANDLE thread, rt_backtrace_t* bt) {
  function rt_backtrace_trace_self (line 3018) | static void rt_backtrace_trace_self(const char* stop) {
  function rt_backtrace_trace_all_but_self (line 3025) | static void rt_backtrace_trace_all_but_self(void) {
  function rt_backtrace_tee (line 3071) | static bool rt_backtrace_tee(const char* s, int32_t count) {
  function rt_backtrace_test_thread (line 3086) | static void rt_backtrace_test_thread(void* e) {
  function rt_backtrace_test (line 3090) | static void rt_backtrace_test(void) {
  function rt_backtrace_test (line 3122) | static void rt_backtrace_test(void) { }
  function errno_t (line 3139) | static errno_t rt_clipboard_put_text(const char* utf8) {
  function errno_t (line 3184) | static errno_t rt_clipboard_get_text(char* utf8, int32_t* bytes) {
  function rt_clipboard_test (line 3221) | static void rt_clipboard_test(void) {
  function rt_clipboard_test (line 3232) | static void rt_clipboard_test(void) {
  function rt_clock_microseconds_since_epoch (line 3255) | static uint64_t rt_clock_microseconds_since_epoch(void) { // NOT monotonic
  function rt_clock_localtime (line 3265) | static uint64_t rt_clock_localtime(void) {
  function rt_clock_utc (line 3272) | static void rt_clock_utc(uint64_t microseconds,
  function rt_clock_local (line 3290) | static void rt_clock_local(uint64_t microseconds,
  function fp64_t (line 3311) | static fp64_t rt_clock_seconds(void) { // since_boot
  function rt_clock_nanoseconds (line 3344) | static uint64_t rt_clock_nanoseconds(void) {
  function rt_clock_unix_microseconds (line 3376) | static uint64_t rt_clock_unix_microseconds(void) {
  function rt_clock_unix_seconds (line 3380) | static uint64_t rt_clock_unix_seconds(void) {
  function rt_clock_test (line 3384) | static void rt_clock_test(void) {
  function errno_t (line 3428) | static errno_t rt_config_get_reg_key(const char* name, HKEY *key) {
  function errno_t (line 3440) | static errno_t rt_config_save(const char* name,
  function errno_t (line 3453) | static errno_t rt_config_remove(const char* name, const char* key) {
  function errno_t (line 3464) | static errno_t rt_config_clean(const char* name) {
  function rt_config_size (line 3475) | static int32_t rt_config_size(const char* name, const char* key) {
  function rt_config_load (line 3497) | static int32_t rt_config_load(const char* name,
  function rt_config_test (line 3524) | static void rt_config_test(void) {
  function rt_config_test (line 3544) | static void rt_config_test(void) { }
  function rt_core_abort (line 3564) | static void rt_core_abort(void) { ExitProcess(ERROR_FATAL_APP_EXIT); }
  function rt_core_exit (line 3566) | static void rt_core_exit(int32_t exit_code) { exit(exit_code); }
  function errno_t (line 3572) | static errno_t rt_core_err(void) { return (errno_t)GetLastError(); }
  function rt_core_seterr (line 3574) | static void rt_core_seterr(errno_t err) { SetLastError((DWORD)err); }
  function rt_static_init (line 3576) | rt_static_init(runtime) {
  function rt_core_test (line 3594) | static void rt_core_test(void) { // in alphabetical order
  function rt_core_test (line 3621) | static void rt_core_test(void) { }
  function rt_debug_output (line 3687) | static void rt_debug_output(const char* s, int32_t count) {
  function rt_debug_println_va (line 3702) | static void rt_debug_println_va(const char* file, int32_t line, const ch...
  function rt_debug_vprintf (line 3758) | static void rt_debug_vprintf(const char* file, int32_t line, const char*...
  function rt_debug_perrno (line 3767) | static void rt_debug_perrno(const char* file, int32_t line,
  function rt_debug_perror (line 3780) | static void rt_debug_perror(const char* file, int32_t line,
  function rt_debug_println (line 3793) | static void rt_debug_println(const char* file, int32_t line, const char*...
  function rt_debug_is_debugger_present (line 3801) | static bool rt_debug_is_debugger_present(void) { return IsDebuggerPresen...
  function rt_debug_breakpoint (line 3803) | static void rt_debug_breakpoint(void) {
  function errno_t (line 3807) | static errno_t rt_debug_raise(uint32_t exception) {
  function rt_debug_verbosity_from_string (line 3813) | static int32_t rt_debug_verbosity_from_string(const char* s) {
  function rt_debug_test (line 3835) | static void rt_debug_test(void) {
  function errno_t (line 3907) | static errno_t rt_files_open(rt_file_t* *file, const char* fn, int32_t f) {
  function rt_files_is_valid (line 3924) | static bool rt_files_is_valid(rt_file_t* file) { // both null and rt_fil...
  function errno_t (line 3928) | static errno_t rt_files_seek(rt_file_t* file, int64_t *position, int32_t...
  function rt_files_ft_to_us (line 3936) | static inline uint64_t rt_files_ft_to_us(FILETIME ft) { // us (microseco...
  function rt_files_a2t (line 3940) | static int64_t rt_files_a2t(DWORD a) {
  function get_final_path_name_by_fd (line 3956) | static int get_final_path_name_by_fd(int fd, char *buffer, int32_t bytes) {
  function errno_t (line 3968) | static errno_t rt_files_stat(rt_file_t* file, rt_files_stat_t* s,
  function errno_t (line 4009) | static errno_t rt_files_read(rt_file_t* file, void* data, int64_t bytes,...
  function errno_t (line 4025) | static errno_t rt_files_write(rt_file_t* file, const void* data, int64_t...
  function errno_t (line 4041) | static errno_t rt_files_flush(rt_file_t* file) {
  function rt_files_close (line 4045) | static void rt_files_close(rt_file_t* file) {
  function errno_t (line 4049) | static errno_t rt_files_write_fully(const char* filename, const void* data,
  function errno_t (line 4080) | static errno_t rt_files_unlink(const char* pathname) {
  function errno_t (line 4088) | static errno_t rt_files_create_tmp(char* fn, int32_t count) {
  function errno_t (line 4136) | static errno_t rt_files_acl_add_ace(ACL* acl, SID* sid, uint32_t mask,
  function errno_t (line 4181) | static errno_t rt_files_lookup_sid(ACCESS_ALLOWED_ACE* ace) {
  function errno_t (line 4200) | static errno_t rt_files_add_acl_ace(void* obj, int32_t obj_type,
  function errno_t (line 4260) | static errno_t rt_files_chmod777(const char* pathname) {
  function errno_t (line 4299) | static errno_t rt_files_mkdirs(const char* dir) {
  function errno_t (line 4348) | static errno_t rt_files_rmdirs(const char* fn) {
  function rt_files_exists (line 4404) | static bool rt_files_exists(const char* path) {
  function rt_files_is_folder (line 4408) | static bool rt_files_is_folder(const char* path) {
  function rt_files_is_symlink (line 4412) | static bool rt_files_is_symlink(const char* filename) {
  function errno_t (line 4424) | static errno_t rt_files_copy(const char* s, const char* d) {
  function errno_t (line 4428) | static errno_t rt_files_move(const char* s, const char* d) {
  function errno_t (line 4436) | static errno_t rt_files_link(const char* from, const char* to) {
  function errno_t (line 4441) | static errno_t rt_files_symlink(const char* from, const char* to) {
  function errno_t (line 4495) | static errno_t rt_files_cwd(char* fn, int32_t count) {
  function errno_t (line 4503) | static errno_t rt_files_chdir(const char* fn) {
  type rt_files_dir_t (line 4507) | typedef struct rt_files_dir_s {
  function errno_t (line 4514) | static errno_t rt_files_opendir(rt_folder_t* folder, const char* folder_...
  function rt_files_ft2us (line 4530) | static uint64_t rt_files_ft2us(FILETIME* ft) { // 100ns units to microse...
  function rt_files_closedir (line 4553) | static void rt_files_closedir(rt_folder_t* folder) {
  function folders_dump_time (line 4574) | static void folders_dump_time(const char* label, uint64_t us) {
  function folders_test (line 4588) | static void folders_test(void) {
  function rt_files_test_append_thread (line 4697) | static void rt_files_test_append_thread(void* p) {
  function rt_files_test (line 4706) | static void rt_files_test(void) {
  function rt_files_test (line 4861) | static void rt_files_test(void) {}
  function rt_generics_test (line 4938) | static void rt_generics_test(void) {
  function rt_generics_test (line 5001) | static void rt_generics_test(void) { }
  function errno_t (line 5012) | static errno_t rt_heap_alloc(void* *a, int64_t bytes) {
  function errno_t (line 5016) | static errno_t rt_heap_alloc_zero(void* *a, int64_t bytes) {
  function errno_t (line 5020) | static errno_t rt_heap_realloc(void* *a, int64_t bytes) {
  function errno_t (line 5024) | static errno_t rt_heap_realloc_zero(void* *a, int64_t bytes) {
  function rt_heap_free (line 5028) | static void rt_heap_free(void* a) {
  function rt_heap_t (line 5032) | static rt_heap_t* rt_heap_create(bool serialized) {
  function rt_heap_dispose (line 5037) | static void rt_heap_dispose(rt_heap_t* h) {
  function HANDLE (line 5041) | static inline HANDLE rt_heap_or_process_heap(rt_heap_t* h) {
  function errno_t (line 5047) | static errno_t rt_heap_allocate(rt_heap_t* h, void* *p, int64_t bytes, b...
  function errno_t (line 5061) | static errno_t rt_heap_reallocate(rt_heap_t* h, void* *p, int64_t bytes,
  function rt_heap_deallocate (line 5072) | static void rt_heap_deallocate(rt_heap_t* h, void* a) {
  function rt_heap_bytes (line 5076) | static int64_t rt_heap_bytes(rt_heap_t* h, void* a) {
  function rt_heap_test (line 5084) | static void rt_heap_test(void) {
  function rt_heap_test (line 5106) | static void rt_heap_test(void) { }
  function rt_loader_close (line 5175) | static void rt_loader_close(void* handle) {
  function rt_loader_test_exported_function (line 5195) | void rt_loader_test_exported_function(void) { rt_loader_test_calls_count...
  function rt_loader_test (line 5199) | static void rt_loader_test(void) {
  function rt_loader_test (line 5238) | static void rt_loader_test(void) {}
  function errno_t (line 5262) | static errno_t rt_mem_map_view_of_file(HANDLE file,
  function errno_t (line 5288) | static errno_t rt_mem_set_token_privilege(void* token,
  function errno_t (line 5297) | static errno_t rt_mem_adjust_process_privilege_manage_volume_name(void) {
  function errno_t (line 5311) | static errno_t rt_mem_map_file(const char* filename, void* *data,
  function errno_t (line 5349) | static errno_t rt_mem_map_ro(const char* filename, void* *data, int64_t ...
  function errno_t (line 5353) | static errno_t rt_mem_map_rw(const char* filename, void* *data, int64_t ...
  function rt_mem_unmap (line 5357) | static void rt_mem_unmap(void* data, int64_t bytes) {
  function errno_t (line 5365) | static errno_t rt_mem_map_resource(const char* label, void* *data, int64...
  function rt_mem_page_size (line 5377) | static int32_t rt_mem_page_size(void) {
  function rt_mem_large_page_size (line 5385) | static int rt_mem_large_page_size(void) {
  function rt_mem_deallocate (line 5451) | static void rt_mem_deallocate(void* a, int64_t bytes_multiple_of_page_si...
  function rt_mem_test (line 5475) | static void rt_mem_test(void) {
  function rt_nls_strid (line 5593) | static int32_t rt_nls_strid(const char* s) {
  function errno_t (line 5630) | static errno_t rt_nls_set_locale(const char* locale) {
  function rt_nls_init (line 5652) | static void rt_nls_init(void) {
  function rt_num128_t (line 5693) | static inline rt_num128_t rt_num_add128_inline(const rt_num128_t a, cons...
  function rt_num128_t (line 5701) | static inline rt_num128_t rt_num_sub128_inline(const rt_num128_t a, cons...
  function rt_num128_t (line 5709) | static rt_num128_t rt_num_add128(const rt_num128_t a, const rt_num128_t ...
  function rt_num128_t (line 5713) | static rt_num128_t rt_num_sub128(const rt_num128_t a, const rt_num128_t ...
  function rt_num128_t (line 5717) | static rt_num128_t rt_num_mul64x64(uint64_t a, uint64_t b) {
  function rt_num_shift128_left_inline (line 5737) | static inline void rt_num_shift128_left_inline(rt_num128_t* n) {
  function rt_num_shift128_right_inline (line 5743) | static inline void rt_num_shift128_right_inline(rt_num128_t* n) {
  function rt_num_less128_inline (line 5749) | static inline bool rt_num_less128_inline(const rt_num128_t a, const rt_n...
  function rt_num_uint128_high_bit (line 5753) | static inline bool rt_num_uint128_high_bit(const rt_num128_t a) {
  function rt_num_muldiv128 (line 5757) | static uint64_t rt_num_muldiv128(uint64_t a, uint64_t b, uint64_t diviso...
  function rt_num_gcd32 (line 5784) | static uint32_t rt_num_gcd32(uint32_t u, uint32_t v) {
  function rt_num_random32 (line 5810) | static uint32_t rt_num_random32(uint32_t* state) {
  function rt_num_random64 (line 5820) | static uint64_t rt_num_random64(uint64_t *state) {
  function rt_num_hash32 (line 5831) | static uint32_t rt_num_hash32(const char *data, int64_t len) {
  function rt_num_hash64 (line 5848) | static uint64_t rt_num_hash64(const char *data, int64_t len) {
  function ctz_2 (line 5865) | static uint32_t ctz_2(uint32_t x) {
  function rt_num_test (line 5875) | static void rt_num_test(void) {
  type rt_processes_pidof_lambda_t (line 5937) | typedef struct rt_processes_pidof_lambda_s rt_processes_pidof_lambda_t;
  type rt_processes_pidof_lambda_t (line 5939) | typedef struct rt_processes_pidof_lambda_s {
  function rt_processes_for_each_pidof (line 5948) | static int32_t rt_processes_for_each_pidof(const char* pname, rt_process...
  function errno_t (line 6021) | static errno_t rt_processes_nameof(uint64_t pid, char* name, int32_t cou...
  function rt_processes_present (line 6036) | static bool rt_processes_present(uint64_t pid) {
  function rt_processes_first_pid (line 6043) | static bool rt_processes_first_pid(rt_processes_pidof_lambda_t* lambda, ...
  function rt_processes_pid (line 6048) | static uint64_t rt_processes_pid(const char* pname) {
  function rt_processes_store_pid (line 6062) | static bool rt_processes_store_pid(rt_processes_pidof_lambda_t* lambda, ...
  function errno_t (line 6069) | static errno_t rt_processes_pids(const char* pname, uint64_t* pids/*[siz...
  function errno_t (line 6084) | static errno_t rt_processes_kill(uint64_t pid, fp64_t timeout) {
  function rt_processes_kill_one (line 6129) | static bool rt_processes_kill_one(rt_processes_pidof_lambda_t* lambda, u...
  function errno_t (line 6135) | static errno_t rt_processes_kill_all(const char* name, fp64_t timeout) {
  function rt_processes_is_elevated (line 6148) | static bool rt_processes_is_elevated(void) { // Is process running as Ad...
  function errno_t (line 6181) | static errno_t rt_processes_restart_elevated(void) {
  function rt_processes_close_pipes (line 6200) | static void rt_processes_close_pipes(STARTUPINFOA* si,
  function errno_t (line 6212) | static errno_t rt_processes_child_read(rt_stream_if* out, HANDLE pipe) {
  function errno_t (line 6238) | static errno_t rt_processes_child_write(rt_stream_if* in, HANDLE pipe) {
  function errno_t (line 6258) | static errno_t rt_processes_run(rt_processes_child_t* child) {
  type rt_processes_io_merge_out_and_err_if (line 6345) | typedef struct {
  function errno_t (line 6351) | static errno_t rt_processes_merge_write(rt_stream_if* stream, const void...
  function errno_t (line 6362) | static errno_t rt_processes_open(const char* command, int32_t *exit_code,
  function errno_t (line 6388) | static errno_t rt_processes_spawn(const char* command) {
  function rt_processes_test (line 6434) | static void rt_processes_test(void) {
  function rt_processes_test (line 6491) | static void rt_processes_test(void) { }
  function rt_static_init_function (line 6536) | rt_static_init_function(void) {
  function rt_static_init (line 6540) | rt_static_init(static_init_test) { rt_static_init_function(); }
  function rt_static_init_test (line 6542) | void rt_static_init_test(void) {
  function rt_static_init_test (line 6550) | void rt_static_init_test(void) {}
  function rt_str_len (line 6567) | static int32_t rt_str_len(const char* s) { return (int32_t)strlen(s); }
  function rt_str_utf16len (line 6569) | static int32_t rt_str_utf16len(const uint16_t* utf16) {
  function rt_str_utf8bytes (line 6573) | static int32_t rt_str_utf8bytes(const char* s, int32_t b) {
  function rt_str_glyphs (line 6604) | static int32_t rt_str_glyphs(const char* utf8, int32_t bytes) {
  function rt_str_lower (line 6617) | static void rt_str_lower(char* d, int32_t capacity, const char* s) {
  function rt_str_upper (line 6624) | static void rt_str_upper(char* d, int32_t capacity, const char* s) {
  function rt_str_starts (line 6631) | static bool rt_str_starts(const char* s1, const char* s2) {
  function rt_str_ends (line 6637) | static bool rt_str_ends(const char* s1, const char* s2) {
  function rt_str_i_starts (line 6643) | static bool rt_str_i_starts(const char* s1, const char* s2) {
  function rt_str_i_ends (line 6650) | static bool rt_str_i_ends(const char* s1, const char* s2) {
  function rt_str_utf8_bytes (line 6656) | static int32_t rt_str_utf8_bytes(const uint16_t* utf16, int32_t chars) {
  function rt_str_utf16_chars (line 6674) | static int32_t rt_str_utf16_chars(const char* utf8, int32_t bytes) {
  function errno_t (line 6689) | static errno_t rt_str_utf16to8(char* utf8, int32_t capacity,
  function errno_t (line 6708) | static errno_t rt_str_utf8to16(uint16_t* utf16, int32_t capacity,
  function rt_str_utf16_is_low_surrogate (line 6731) | static bool rt_str_utf16_is_low_surrogate(uint16_t utf16char) {
  function rt_str_utf16_is_high_surrogate (line 6735) | static bool rt_str_utf16_is_high_surrogate(uint16_t utf16char) {
  function rt_str_utf32 (line 6739) | static uint32_t rt_str_utf32(const char* utf8, int32_t bytes) {
  function rt_str_format_va (line 6765) | static void rt_str_format_va(char* utf8, int32_t count, const char* format,
  function rt_str_format (line 6778) | static void rt_str_format(char* utf8, int32_t count, const char* format,...
  function rt_str1024_t (line 6785) | static rt_str1024_t rt_str_error_for_language(int32_t error, LANGID lang...
  function rt_str1024_t (line 6829) | static rt_str1024_t rt_str_error(int32_t error) {
  function rt_str1024_t (line 6834) | static rt_str1024_t rt_str_error_nls(int32_t error) {
  type lconv (line 6855) | struct lconv
  function rt_str64_t (line 6883) | static rt_str64_t rt_str_int64_dg(int64_t v, // digit_grouped
  function rt_str64_t (line 6925) | static rt_str64_t rt_str_int64(int64_t v) {
  function rt_str64_t (line 6929) | static rt_str64_t rt_str_uint64(uint64_t v) {
  function rt_str64_t (line 6933) | static rt_str64_t rt_str_int64_lc(int64_t v) {
  function rt_str64_t (line 6937) | static rt_str64_t rt_str_uint64_lc(uint64_t v) {
  function rt_str128_t (line 6941) | static rt_str128_t rt_str_fp(const char* format, fp64_t v) {
  function rt_str_test (line 6977) | static void rt_str_test(void) {
  function rt_str_test (line 7072) | static void rt_str_test(void) {}
  function errno_t (line 7111) | static errno_t rt_streams_memory_read(rt_stream_if* stream, void* data, ...
  function errno_t (line 7125) | static errno_t rt_streams_memory_write(rt_stream_if* stream, const void*...
  function rt_streams_read_only (line 7140) | static void rt_streams_read_only(rt_stream_memory_if* s,
  function rt_streams_write_only (line 7152) | static void rt_streams_write_only(rt_stream_memory_if* s,
  function rt_streams_read_write (line 7164) | static void rt_streams_read_write(rt_stream_memory_if* s,
  function rt_streams_test (line 7180) | static void rt_streams_test(void) {
  function rt_streams_test (line 7207) | static void rt_streams_test(void) { }
  function rt_event_t (line 7222) | static rt_event_t rt_event_create(void) {
  function rt_event_t (line 7228) | static rt_event_t rt_event_create_manual(void) {
  function rt_event_set (line 7234) | static void rt_event_set(rt_event_t e) {
  function rt_event_reset (line 7238) | static void rt_event_reset(rt_event_t e) {
  function rt_event_wait_or_timeout (line 7242) | static int32_t rt_event_wait_or_timeout(rt_event_t e, fp64_t seconds) {
  function rt_event_wait (line 7251) | static void rt_event_wait(rt_event_t e) { rt_event_wait_or_timeout(e, -1...
  function rt_event_wait_any_or_timeout (line 7253) | static int32_t rt_event_wait_any_or_timeout(int32_t n,
  function rt_event_wait_any (line 7265) | static int32_t rt_event_wait_any(int32_t n, rt_event_t e[]) {
  function rt_event_dispose (line 7269) | static void rt_event_dispose(rt_event_t h) {
  function rt_event_test_check_time (line 7278) | static void rt_event_test_check_time(fp64_t start, fp64_t expected) {
  function rt_event_test (line 7285) | static void rt_event_test(void) {
  function rt_event_test (line 7324) | static void rt_event_test(void) { }
  function rt_mutex_init (line 7345) | static void rt_mutex_init(rt_mutex_t* m) {
  function rt_mutex_lock (line 7350) | static void rt_mutex_lock(rt_mutex_t* m) {
  function rt_mutex_unlock (line 7354) | static void rt_mutex_unlock(rt_mutex_t* m) {
  function rt_mutex_dispose (line 7358) | static void rt_mutex_dispose(rt_mutex_t* m) {
  function rt_mutex_test_check_time (line 7365) | static void rt_mutex_test_check_time(fp64_t start, fp64_t expected) {
  function rt_mutex_test_lock_unlock (line 7372) | static void rt_mutex_test_lock_unlock(void* arg) {
  function rt_mutex_test (line 7379) | static void rt_mutex_test(void) {
  function fp64_t (line 7422) | static fp64_t rt_thread_ns2ms(int64_t ns) {
  function rt_thread_set_timer_resolution (line 7426) | static void rt_thread_set_timer_resolution(uint64_t nanoseconds) {
  function rt_thread_power_throttling_disable_for_process (line 7467) | static void rt_thread_power_throttling_disable_for_process(void) {
  function rt_thread_power_throttling_disable_for_thread (line 7488) | static void rt_thread_power_throttling_disable_for_thread(HANDLE thread) {
  function rt_thread_disable_power_throttling (line 7497) | static void rt_thread_disable_power_throttling(void) {
  function rt_thread_next_physical_processor_affinity_mask (line 7516) | static uint64_t rt_thread_next_physical_processor_affinity_mask(void) {
  function rt_thread_realtime (line 7562) | static void rt_thread_realtime(void) {
  function rt_thread_yield (line 7576) | static void rt_thread_yield(void) { SwitchToThread(); }
  function rt_thread_t (line 7578) | static rt_thread_t rt_thread_start(void (*func)(void*), void* p) {
  function is_handle_valid (line 7585) | static bool is_handle_valid(void* h) {
  function errno_t (line 7590) | static errno_t rt_thread_join(rt_thread_t t, fp64_t timeout) {
  function rt_thread_detach (line 7605) | static void rt_thread_detach(rt_thread_t t) {
  function rt_thread_name (line 7611) | static void rt_thread_name(const char* name) {
  function rt_thread_sleep_for (line 7620) | static void rt_thread_sleep_for(fp64_t seconds) {
  function rt_thread_id_of (line 7641) | static uint64_t rt_thread_id_of(rt_thread_t t) {
  function rt_thread_id (line 7645) | static uint64_t rt_thread_id(void) {
  function rt_thread_t (line 7649) | static rt_thread_t rt_thread_self(void) {
  function errno_t (line 7657) | static errno_t rt_thread_open(rt_thread_t *t, uint64_t id) {
  function rt_thread_close (line 7665) | static void rt_thread_close(rt_thread_t t) {
  type rt_thread_philosophers_t (line 7674) | typedef struct rt_thread_philosophers_s rt_thread_philosophers_t;
  type rt_thread_philosopher_t (line 7676) | typedef struct {
  type rt_thread_philosophers_t (line 7685) | typedef struct rt_thread_philosophers_s {
  function rt_thread_philosopher_think (line 7700) | static void rt_thread_philosopher_think(rt_thread_philosopher_t* p) {
  function rt_thread_philosopher_eat (line 7707) | static void rt_thread_philosopher_eat(rt_thread_philosopher_t* p) {
  function rt_thread_philosopher_routine (line 7726) | static void rt_thread_philosopher_routine(void* arg) {
  function rt_thread_detached_sleep (line 7753) | static void rt_thread_detached_sleep(void* rt_unused(p)) {
  function rt_thread_detached_loop (line 7757) | static void rt_thread_detached_loop(void* rt_unused(p)) {
  function rt_thread_test (line 7764) | static void rt_thread_test(void) {
  function rt_thread_test (line 7814) | static void rt_thread_test(void) { }
  function rt_vigil_breakpoint_and_abort (line 7837) | static void rt_vigil_breakpoint_and_abort(void) {
  function rt_vigil_failed_assertion (line 7843) | static int32_t rt_vigil_failed_assertion(const char* file, int32_t line,
  function rt_vigil_fatal_termination_va (line 7856) | static int32_t rt_vigil_fatal_termination_va(const char* file, int32_t l...
  function rt_vigil_fatal_termination (line 7878) | static int32_t rt_vigil_fatal_termination(const char* file, int32_t line,
  function rt_vigil_fatal_if_error (line 7887) | static int32_t rt_vigil_fatal_if_error(const char* file, int32_t line,
  function rt_vigil_test_failed_assertion (line 7908) | static int32_t rt_vigil_test_failed_assertion(const char* file, int32_t ...
  function rt_vigil_test_fatal_termination (line 7929) | static int32_t rt_vigil_test_fatal_termination(const char* file, int32_t...
  function rt_vigil_test (line 7959) | static void rt_vigil_test(void) {
  function rt_vigil_test (line 7989) | static void rt_vigil_test(void) { }
  function rt_win32_close_handle (line 8002) | void rt_win32_close_handle(void* h) {
  function errno_t (line 8012) | errno_t rt_wait_ix2e(uint32_t r) {
  function rt_work_queue_no_duplicates (line 8026) | static void rt_work_queue_no_duplicates(rt_work_t* w) {
  function rt_work_queue_post (line 8036) | static void rt_work_queue_post(rt_work_t* w) {
  function rt_work_queue_cancel (line 8060) | static void rt_work_queue_cancel(rt_work_t* w) {
  function rt_work_queue_flush (line 8088) | static void rt_work_queue_flush(rt_work_queue_t* q) {
  function rt_work_queue_get (line 8092) | static bool rt_work_queue_get(rt_work_queue_t* q, rt_work_t* *r) {
  function rt_work_queue_call (line 8107) | static void rt_work_queue_call(rt_work_t* w) {
  function rt_work_queue_dispatch (line 8112) | static void rt_work_queue_dispatch(rt_work_queue_t* q) {
  function rt_worker_thread (line 8126) | static void rt_worker_thread(void* p) {
  function rt_worker_start (line 8147) | static void rt_worker_start(rt_worker_t* worker) {
  function errno_t (line 8156) | static errno_t rt_worker_join(rt_worker_t* worker, fp64_t to) {
  function rt_worker_post (line 8170) | static void rt_worker_post(rt_worker_t* worker, rt_work_t* w) {
  function rt_never_called (line 8194) | static void rt_never_called(rt_work_t* rt_unused(w)) {
  function rt_work_queue_test_1 (line 8198) | static void rt_work_queue_test_1(void) {
  function rt_every_millisecond (line 8240) | static void rt_every_millisecond(rt_work_t* w) {
  function rt_work_queue_test_2 (line 8254) | static void rt_work_queue_test_2(void) {
  type rt_work_ex_t (line 8280) | typedef struct rt_work_ex_s {
  function rt_every_other_millisecond (line 8291) | static void rt_every_other_millisecond(rt_work_t* w) {
  function rt_work_queue_test_3 (line 8307) | static void rt_work_queue_test_3(void) {
  function rt_work_queue_test (line 8331) | static void rt_work_queue_test(void) {
  function rt_test_do_work (line 8340) | static void rt_test_do_work(rt_work_t* rt_unused(w)) {
  function rt_worker_test (line 8344) | static void rt_worker_test(void) {
  function rt_work_queue_test (line 8379) | static void rt_work_queue_test(void) {}
  function rt_worker_test (line 8380) | static void rt_worker_test(void) {}

FILE: single_file_lib/ui/ui.h
  type fp32_t (line 54) | typedef float  fp32_t;
  type fp64_t (line 55) | typedef double fp64_t;
  type ui_point_s (line 149) | struct ui_point_s { int32_t x, y; }
  type ui_rect_t (line 150) | typedef struct ui_rect_s { int32_t x, y, w, h; } ui_rect_t;
  type ui_ltrb_t (line 151) | typedef struct ui_ltbr_s { int32_t left, top, right, bottom; } ui_ltrb_t;
  type ui_wh_t (line 152) | typedef struct ui_wh_s   { int32_t w, h; } ui_wh_t;
  type ui_window_s (line 154) | struct ui_window_s
  type ui_icon_s (line 155) | struct ui_icon_s
  type ui_canvas_s (line 156) | struct ui_canvas_s
  type ui_texture_s (line 157) | struct ui_texture_s
  type ui_font_s (line 158) | struct ui_font_s
  type ui_brush_s (line 159) | struct ui_brush_s
  type ui_pen_s (line 160) | struct ui_pen_s
  type ui_cursor_s (line 161) | struct ui_cursor_s
  type ui_region_s (line 162) | struct ui_region_s
  type ui_timer_t (line 164) | typedef uintptr_t ui_timer_t;
  type ui_bitmap_t (line 166) | typedef struct ui_bitmap_s { // TODO: ui_ namespace
  type ui_margins_t (line 182) | typedef struct ui_gaps_s { // in partial "em"s
  type ui_if (line 189) | typedef struct ui_s {
  type ui_color_t (line 328) | typedef uint64_t ui_color_t;
  type control_colors_t (line 393) | typedef struct ui_control_colors_s {
  type ui_control_state_colors_t (line 402) | typedef struct ui_control_state_colors_s {
  type ui_colors_if (line 410) | typedef struct ui_colors_s {
  function rt_begin_c (line 617) | rt_begin_c
  type ui_view_t (line 1066) | typedef struct ui_view_s ui_view_t;
  type ui_view_t (line 1100) | typedef struct ui_view_s ui_view_t;
  type ui_edit_str_t (line 1122) | typedef struct ui_edit_str_s ui_edit_str_t;
  type ui_edit_doc_t (line 1124) | typedef struct ui_edit_doc_s ui_edit_doc_t;
  type ui_edit_notify_t (line 1126) | typedef struct ui_edit_notify_s ui_edit_notify_t;
  type ui_edit_to_do_t (line 1128) | typedef struct ui_edit_to_do_s ui_edit_to_do_t;
  type ui_edit_pg_t (line 1130) | typedef struct ui_edit_pg_s { // page/glyph coordinates
  type ui_edit_range_s (line 1136) | typedef union rt_begin_packed ui_edit_range_s
  type ui_edit_text_t (line 1141) | typedef struct ui_edit_text_s {
  type ui_edit_notify_info_t (line 1146) | typedef struct ui_edit_notify_info_s {
  type ui_edit_notify_t (line 1164) | typedef struct ui_edit_notify_s { // called before and after replace()
  type ui_edit_listener_t (line 1170) | typedef struct ui_edit_listener_s ui_edit_listener_t;
  type ui_edit_listener_t (line 1172) | typedef struct ui_edit_listener_s {
  type ui_edit_to_do_t (line 1178) | typedef struct ui_edit_to_do_s { // undo/redo action
  type ui_edit_doc_t (line 1184) | typedef struct ui_edit_doc_s {
  type ui_edit_doc_if (line 1191) | typedef struct ui_edit_doc_if {
  type ui_edit_range_if (line 1218) | typedef struct ui_edit_range_if {
  type ui_edit_text_if (line 1234) | typedef struct ui_edit_text_if {
  type ui_edit_str_s (line 1260) | typedef struct rt_begin_packed ui_edit_str_s
  type ui_edit_str_if (line 1270) | typedef struct ui_edit_str_if {
  type ui_edit_view_t (line 1355) | typedef struct ui_edit_view_s ui_edit_view_t;
  type ui_edit_str_t (line 1357) | typedef struct ui_edit_str_s ui_edit_str_t;
  type ui_edit_doc_t (line 1359) | typedef struct ui_edit_doc_s ui_edit_doc_t;
  type ui_edit_notify_t (line 1361) | typedef struct ui_edit_notify_s ui_edit_notify_t;
  type ui_edit_to_do_t (line 1363) | typedef struct ui_edit_to_do_s ui_edit_to_do_t;
  type ui_edit_pr_t (line 1365) | typedef struct ui_edit_pr_s { // page/run coordinates
  type ui_edit_run_t (line 1370) | typedef struct ui_edit_run_s {
  type ui_edit_paragraph_t (line 1382) | typedef struct ui_edit_paragraph_s { // "paragraph" view consists of wra...
  type ui_edit_notify_view_t (line 1387) | typedef struct ui_edit_notify_view_s {
  type ui_edit_view_t (line 1393) | typedef struct ui_edit_view_s {
  type ui_edit_view_if (line 1423) | typedef struct ui_edit_view_if {
  type ui_view_t (line 1551) | typedef ui_view_t ui_label_t;
  type ui_view_t (line 1591) | typedef ui_view_t ui_button_t;
  type ui_image_t (line 1696) | typedef struct ui_image_s ui_image_t;
  type ui_image_t (line 1698) | typedef struct ui_image_s {
  type ui_image_if (line 1731) | typedef struct ui_image_if {
  type ui_midi_t (line 1757) | typedef struct ui_midi_s ui_midi_t;
  type ui_midi_t (line 1759) | typedef struct ui_midi_s {
  type ui_midi_if (line 1765) | typedef struct {
  type ui_slider_s (line 1820) | struct ui_slider_s
  type ui_slider_t (line 1822) | typedef struct ui_slider_s {
  type ui_theme_if (line 1908) | typedef struct  {
  type ui_view_t (line 1928) | typedef ui_view_t ui_toggle_t;
  type ui_mbx_t (line 1988) | typedef struct {
  type ui_caption_t (line 2051) | typedef struct ui_caption_s {
  type ui_app_message_handler_t (line 2075) | typedef struct ui_app_message_handler_s ui_app_message_handler_t;
  type ui_app_message_handler_t (line 2077) | typedef struct ui_app_message_handler_s {
  type ui_dpi_t (line 2084) | typedef struct ui_dpi_s { // max(dpi_x, dpi_y)
  type ui_window_sizing_t (line 2101) | typedef struct ui_window_sizing_s {
  type ui_fms_t (line 2114) | typedef struct ui_fms_s {
  type ui_app_t (line 2126) | typedef struct { // TODO: split to ui_app_t and ui_app_if, move data aft...
  type ui_fuzzing_t (line 2296) | typedef struct ui_fuzzing_s {
  type ui_fuzzing_if (line 2315) | typedef struct ui_fuzzing_if {
  function ui_app_post_message (line 2382) | static void ui_app_post_message(int32_t m, int64_t wp, int64_t lp) {
  function ui_app_update_wt_timeout (line 2387) | static void ui_app_update_wt_timeout(void) {
  function ui_app_post (line 2412) | static void ui_app_post(rt_work_t* w) {
  function ui_app_alarm_thread (line 2420) | static void ui_app_alarm_thread(void* rt_unused(p)) {
  function ui_app_redraw_thread (line 2439) | static void ui_app_redraw_thread(void* rt_unused(p)) {
  function ui_app_alt_ctrl_shift (line 2459) | static void ui_app_alt_ctrl_shift(bool down, int64_t key) {
  function ui_point_t (line 2465) | static inline ui_point_t ui_app_point2ui(const POINT* p) {
  function POINT (line 2470) | static inline POINT ui_app_ui2point(const ui_point_t* u) {
  function ui_rect_t (line 2475) | static ui_rect_t ui_app_rect2ui(const RECT* r) {
  function RECT (line 2480) | static RECT ui_app_ui2rect(const ui_rect_t* u) {
  function ui_app_update_ncm (line 2485) | static void ui_app_update_ncm(int32_t dpi) {
  function ui_app_update_monitor_dpi (line 2491) | static void ui_app_update_monitor_dpi(HMONITOR monitor, ui_dpi_t* dpi) {
  function ui_app_dump_dpi (line 2540) | static void ui_app_dump_dpi(void) {
  function ui_app_update_mi (line 2568) | static bool ui_app_update_mi(const ui_rect_t* r, uint32_t flags) {
  function ui_app_update_crc (line 2583) | static void ui_app_update_crc(void) {
  function ui_app_dispose_fonts (line 2589) | static void ui_app_dispose_fonts(void) {
  function fp64_t (line 2608) | static fp64_t ui_app_px2pt(fp64_t px) {
  function ui_app_pt2px (line 2613) | static int32_t ui_app_pt2px(fp64_t pt) { // rounded
  function ui_app_init_cursors (line 2617) | static void ui_app_init_cursors(void) {
  function ui_app_ncm_dump_fonts (line 2631) | static void ui_app_ncm_dump_fonts(void) {
  function ui_app_dump_font_size (line 2657) | static void ui_app_dump_font_size(const char* name, const LOGFONTW* lf,
  function ui_app_init_fms (line 2690) | static void ui_app_init_fms(ui_fms_t* fms, const LOGFONTW* base) {
  function ui_app_init_fonts (line 2727) | static void ui_app_init_fonts(int32_t dpi) {
  function ui_app_data_save (line 2743) | static void ui_app_data_save(const char* name, const void* data, int32_t...
  function ui_app_data_size (line 2747) | static int32_t ui_app_data_size(const char* name) {
  function ui_app_data_load (line 2751) | static int32_t ui_app_data_load(const char* name, void* data, int32_t by...
  function BOOL (line 2772) | static BOOL CALLBACK ui_app_monitor_enum_proc(HMONITOR monitor,
  function ui_app_enum_monitors (line 2789) | static void ui_app_enum_monitors(ui_app_wiw_t* wiw) {
  function ui_app_save_window_pos (line 2797) | static void ui_app_save_window_pos(ui_window_t wnd, const char* name, bo...
  function ui_app_save_console_pos (line 2843) | static void ui_app_save_console_pos(void) {
  function ui_app_is_fully_inside (line 2866) | static bool ui_app_is_fully_inside(const ui_rect_t* inner,
  function ui_app_bring_window_inside_monitor (line 2873) | static void ui_app_bring_window_inside_monitor(const ui_rect_t* mrc, ui_...
  function ui_app_load_window_pos (line 2886) | static bool ui_app_load_window_pos(ui_rect_t* rect, int32_t *visibility) {
  function ui_app_load_console_pos (line 2927) | static bool ui_app_load_console_pos(ui_rect_t* rect, int32_t *visibility) {
  function ui_app_timer_kill (line 2954) | static void ui_app_timer_kill(ui_timer_t timer) {
  function ui_timer_t (line 2958) | static ui_timer_t ui_app_timer_set(uintptr_t id, int32_t ms) {
  function ui_app_timer (line 2967) | static void ui_app_timer(ui_view_t* view, ui_timer_t id) {
  function ui_app_animate_timer (line 2973) | static void ui_app_animate_timer(void) {
  function ui_app_wm_timer (line 2978) | static void ui_app_wm_timer(ui_timer_t id) {
  function ui_app_window_dpi (line 2986) | static void ui_app_window_dpi(void) {
  function ui_app_window_opening (line 2995) | static void ui_app_window_opening(void) {
  function ui_app_window_closing (line 3021) | static void ui_app_window_closing(void) {
  function ui_app_get_min_max_info (line 3036) | static void ui_app_get_min_max_info(MINMAXINFO* mmi) {
  function ui_app_paint (line 3057) | static void ui_app_paint(ui_view_t* view) {
  function ui_app_measure_and_layout (line 3063) | static void ui_app_measure_and_layout(ui_view_t* view) {
  function ui_app_dispatch_wm_char (line 3076) | static void ui_app_dispatch_wm_char(ui_view_t* view, const uint16_t* utf...
  function ui_app_wm_char (line 3090) | static void ui_app_wm_char(ui_view_t* view, const uint16_t* utf16) {
  function ui_app_wm_key_pressed (line 3110) | static bool ui_app_wm_key_pressed(ui_view_t* v, int64_t key) {
  function ui_app_mouse (line 3118) | static bool ui_app_mouse(ui_view_t* v, int32_t m, int64_t f) {
  function ui_app_show_sys_menu (line 3175) | static void ui_app_show_sys_menu(int32_t x, int32_t y) {
  function ui_app_nc_mouse_message (line 3189) | static int32_t ui_app_nc_mouse_message(int32_t m) {
  function ui_app_nc_mouse_buttons (line 3206) | static bool ui_app_nc_mouse_buttons(int32_t m, int64_t wp, int64_t lp) {
  function ui_app_toast_paint (line 3228) | static void ui_app_toast_paint(void) {
  function ui_app_toast_cancel (line 3303) | static void ui_app_toast_cancel(void) {
  function ui_app_toast_tap (line 3330) | static bool ui_app_toast_tap(ui_view_t* v, int32_t ix, bool pressed) {
  function ui_app_toast_character (line 3350) | static void ui_app_toast_character(const char* utf8) {
  function ui_app_toast_key_pressed (line 3360) | static bool ui_app_toast_key_pressed(int64_t key) {
  function ui_app_toast_dim (line 3370) | static void ui_app_toast_dim(int32_t step) {
  function ui_app_animate_step (line 3376) | static void ui_app_animate_step(ui_app_animate_function_t f, int32_t ste...
  function ui_app_animate_start (line 3405) | static void ui_app_animate_start(ui_app_animate_function_t f, int32_t st...
  function ui_app_view_paint (line 3411) | static void ui_app_view_paint(ui_view_t* v) {
  function ui_app_view_layout (line 3422) | static void ui_app_view_layout(void) {
  function ui_app_view_active_frame_paint (line 3439) | static void ui_app_view_active_frame_paint(void) {
  function ui_app_paint_stats (line 3451) | static void ui_app_paint_stats(void) {
  function ui_app_paint_on_canvas (line 3485) | static void ui_app_paint_on_canvas(HDC hdc) {
  function ui_app_wm_paint (line 3506) | static void ui_app_wm_paint(void) {
  function ui_app_window_position_changed (line 3521) | static void ui_app_window_position_changed(const WINDOWPOS* wp) {
  function ui_app_setting_change (line 3539) | static void ui_app_setting_change(uintptr_t wp, uintptr_t lp) {
  function ui_app_show_task_bar (line 3567) | static void ui_app_show_task_bar(bool show) {
  function ui_app_click_detector (line 3575) | static bool ui_app_click_detector(uint32_t msg, WPARAM wp, LPARAM lp) {
  function ui_app_root_hit_test (line 3694) | static int64_t ui_app_root_hit_test(const ui_view_t* v, ui_point_t pt) {
  function ui_app_wm_activate (line 3735) | static void ui_app_wm_activate(int64_t wp) {
  function ui_app_update_mouse_buttons_state (line 3744) | static void ui_app_update_mouse_buttons_state(void) {
  function ui_app_wm_nc_hit_test (line 3752) | static int64_t ui_app_wm_nc_hit_test(int64_t wp, int64_t lp) {
  function ui_app_wm_sys_key_down (line 3763) | static int64_t ui_app_wm_sys_key_down(int64_t wp, int64_t lp) {
  function ui_app_wm_set_focus (line 3772) | static void ui_app_wm_set_focus(void) {
  function ui_app_wm_kill_focus (line 3781) | static void ui_app_wm_kill_focus(void) {
  function ui_app_wm_nc_calculate_size (line 3789) | static int64_t ui_app_wm_nc_calculate_size(int64_t wp, int64_t lp) {
  function ui_app_wm_get_dpi_scaled_size (line 3804) | static int64_t ui_app_wm_get_dpi_scaled_size(int64_t wp) {
  function ui_app_wm_dpi_changed (line 3827) | static void ui_app_wm_dpi_changed(void) {
  function ui_app_wm_sys_command (line 3837) | static bool ui_app_wm_sys_command(int64_t wp, int64_t lp) {
  function ui_app_wm_window_position_changing (line 3861) | static void ui_app_wm_window_position_changing(int64_t wp, int64_t lp) {
  function ui_app_wm_mouse (line 3876) | static bool ui_app_wm_mouse(int32_t m, int64_t wp, int64_t lp) {
  function ui_app_wm_mouse_wheel (line 3883) | static void ui_app_wm_mouse_wheel(bool vertical, int64_t wp) {
  function ui_app_wm_input_language_change (line 3893) | static void ui_app_wm_input_language_change(uint64_t wp) {
  function ui_app_decode_keyboard (line 3928) | static void ui_app_decode_keyboard(int32_t m, int64_t wp, int64_t lp) {
  function ui_app_ime_composition (line 3990) | static void ui_app_ime_composition(int64_t lp) {
  function LRESULT (line 4009) | static LRESULT CALLBACK ui_app_window_proc(HWND window, UINT message,
  function ui_app_get_window_long (line 4200) | static long ui_app_get_window_long(int32_t index) {
  function ui_app_set_window_long (line 4207) | static long ui_app_set_window_long(int32_t index, long value) {
  function ui_app_modify_window_style (line 4214) | static void ui_app_modify_window_style(uint32_t include, uint32_t exclud...
  function DWORD (line 4221) | static DWORD ui_app_window_style(void) {
  function errno_t (line 4228) | static errno_t ui_app_set_layered_window(ui_color_t color, fp32_t alpha) {
  function ui_app_set_dwm_attribute (line 4244) | static void ui_app_set_dwm_attribute(uint32_t mode, void* a, DWORD bytes) {
  function ui_app_init_dwm (line 4248) | static void ui_app_init_dwm(void) {
  function ui_app_swp (line 4271) | static void ui_app_swp(HWND top, int32_t x, int32_t y, int32_t w, int32_...
  function ui_app_swp_flags (line 4276) | static void ui_app_swp_flags(uint32_t f) {
  function ui_app_disable_sys_menu_item (line 4280) | static void ui_app_disable_sys_menu_item(HMENU sys_menu, uint32_t item) {
  function ui_app_init_sys_menu (line 4285) | static void ui_app_init_sys_menu(void) {
  function ui_app_create_window (line 4309) | static void ui_app_create_window(const ui_rect_t r) {
  function ui_app_full_screen (line 4353) | static void ui_app_full_screen(bool on) {
  function ui_app_set_focus (line 4379) | static bool ui_app_set_focus(ui_view_t* rt_unused(v)) { return false; }
  function ui_app_request_redraw (line 4381) | static void ui_app_request_redraw(void) {  // < 2us
  function ui_app_draw (line 4385) | static void ui_app_draw(void) {
  function ui_app_invalidate_rect (line 4390) | static void ui_app_invalidate_rect(const ui_rect_t* r) {
  function ui_app_message_loop (line 4396) | static int32_t ui_app_message_loop(void) {
  function ui_app_dispose (line 4412) | static void ui_app_dispose(void) {
  function ui_app_cursor_set (line 4418) | static void ui_app_cursor_set(ui_cursor_t c) {
  function ui_app_close_window (line 4426) | static void ui_app_close_window(void) {
  function ui_app_quit (line 4432) | static void ui_app_quit(int32_t exit_code) {
  function ui_app_show_hint_or_toast (line 4441) | static void ui_app_show_hint_or_toast(ui_view_t* v, int32_t x, int32_t y,
  function ui_app_show_toast (line 4466) | static void ui_app_show_toast(ui_view_t* view, fp64_t timeout) {
  function ui_app_show_hint (line 4470) | static void ui_app_show_hint(ui_view_t* view, int32_t x, int32_t y,
  function ui_app_formatted_toast_va (line 4480) | static void ui_app_formatted_toast_va(fp64_t timeout, const char* format...
  function ui_app_formatted_toast (line 4487) | static void ui_app_formatted_toast(fp64_t timeout, const char* format, ....
  function ui_app_create_caret (line 4500) | static void ui_app_create_caret(int32_t w, int32_t h) {
  function ui_app_invalidate_caret (line 4507) | static void ui_app_invalidate_caret(void) {
  function ui_app_show_caret (line 4518) | static void ui_app_show_caret(void) {
  function ui_app_move_caret (line 4525) | static void ui_app_move_caret(int32_t x, int32_t y) {
  function ui_app_hide_caret (line 4533) | static void ui_app_hide_caret(void) {
  function ui_app_destroy_caret (line 4540) | static void ui_app_destroy_caret(void) {
  function ui_app_beep (line 4546) | static void ui_app_beep(int32_t kind) {
  function ui_app_enable_sys_command_close (line 4553) | static void ui_app_enable_sys_command_close(void) {
  function ui_app_console_disable_close (line 4558) | static void ui_app_console_disable_close(void) {
  function ui_app_console_attach (line 4566) | static int ui_app_console_attach(void) {
  function ui_app_is_stdout_redirected (line 4576) | static bool ui_app_is_stdout_redirected(void) {
  function ui_app_is_console_visible (line 4585) | static bool ui_app_is_console_visible(void) {
  function ui_app_set_console_size (line 4590) | static int ui_app_set_console_size(int16_t w, int16_t h) {
  function ui_app_console_largest (line 4622) | static void ui_app_console_largest(void) {
  function ui_app_make_topmost (line 4655) | static void ui_app_make_topmost(void) {
  function ui_app_activate (line 4662) | static void ui_app_activate(void) {
  function ui_app_bring_to_foreground (line 4668) | static void ui_app_bring_to_foreground(void) {
  function ui_app_bring_to_front (line 4673) | static void ui_app_bring_to_front(void) {
  function ui_app_set_title (line 4682) | static void ui_app_set_title(const char* title) {
  function ui_app_capture_mouse (line 4687) | static void ui_app_capture_mouse(bool on) {
  function ui_app_move_and_resize (line 4700) | static void ui_app_move_and_resize(const ui_rect_t* rc) {
  function ui_app_set_console_title (line 4705) | static void ui_app_set_console_title(HWND cw) {
  function ui_app_restore_console (line 4716) | static void ui_app_restore_console(int32_t *visibility) {
  function ui_app_console_show (line 4748) | static void ui_app_console_show(bool b) {
  function ui_app_console_create (line 4766) | static int ui_app_console_create(void) {
  function fp32_t (line 4777) | static fp32_t ui_app_px2in(int32_t pixels) {
  function ui_app_in2px (line 4784) | static int32_t ui_app_in2px(fp32_t inches) {
  function ui_app_request_layout (line 4790) | static void ui_app_request_layout(void) {
  function ui_app_show_window (line 4795) | static void ui_app_show_window(int32_t show) {
  function errno_t (line 4871) | static errno_t ui_app_clipboard_put_image(ui_bitmap_t* im) {
  function ui_app_is_active (line 4916) | static bool ui_app_is_active(void) { return GetActiveWindow() == ui_app_...
  function ui_app_is_minimized (line 4918) | static bool ui_app_is_minimized(void) { return IsIconic(ui_app_window()); }
  function ui_app_is_maximized (line 4920) | static bool ui_app_is_maximized(void) { return IsZoomed(ui_app_window()); }
  function ui_app_focused (line 4922) | static bool ui_app_focused(void) { return GetFocus() == ui_app_window(); }
  function window_request_focus (line 4924) | static void window_request_focus(void* w) {
  function ui_app_request_focus (line 4933) | static void ui_app_request_focus(void) {
  function ui_app_init (line 4937) | static void ui_app_init(void) {
  function ui_app_set_dpi_awareness (line 5012) | static void ui_app_set_dpi_awareness(void) {
  function ui_app_init_windows (line 5041) | static void ui_app_init_windows(void) {
  function ui_rect_t (line 5058) | static ui_rect_t ui_app_window_initial_rectangle(void) {
  function ui_app_write_backtrace (line 5092) | static bool ui_app_write_backtrace(const char* s, int32_t n) {
  function LONG (line 5100) | static LONG ui_app_exception_filter(EXCEPTION_POINTERS* ep) {
  function ui_app_test_dispatch_until (line 5141) | static void ui_app_test_dispatch_until(rt_work_queue_t* q, int32_t* i,
  function ui_app_test_every_100ms (line 5152) | static void ui_app_test_every_100ms(rt_work_t* w) {
  function ui_app_test_work_queue_1 (line 5160) | static void ui_app_test_work_queue_1(void) {
  type rt_work_ex_t (line 5176) | typedef struct rt_work_ex_s {
  function ui_app_test_every_200ms (line 5185) | static void ui_app_test_every_200ms(rt_work_t* w) {
  function ui_app_test_work_queue_2 (line 5194) | static void ui_app_test_work_queue_2(void) {
  function ui_app_test_in_1_second (line 5213) | static void ui_app_test_in_1_second(rt_work_t* rt_unused(work)) {
  function ui_app_test_in_2_seconds (line 5218) | static void ui_app_test_in_2_seconds(rt_work_t* rt_unused(work)) {
  function ui_app_test_in_4_seconds (line 5230) | static void ui_app_test_in_4_seconds(rt_work_t* rt_unused(work)) {
  function ui_app_test_post (line 5246) | static void ui_app_test_post(void) {
  function ui_app_win_main (line 5269) | static int ui_app_win_main(HINSTANCE instance) {
  function WinMain (line 5349) | int WINAPI WinMain(HINSTANCE instance, HINSTANCE rt_unused(previous),
  function main (line 5378) | int main(int argc, const char* argv[], const char** envp) {
  function ui_button_every_100ms (line 5403) | static void ui_button_every_100ms(ui_view_t* v) { // every 100ms
  function ui_button_paint (line 5415) | static void ui_button_paint(ui_view_t* v) {
  function ui_button_callback (line 5477) | static void ui_button_callback(ui_button_t* b) {
  function ui_button_trigger (line 5504) | static void ui_button_trigger(ui_view_t* v) {
  function ui_button_character (line 5511) | static void ui_button_character(ui_view_t* v, const char* utf8) {
  function ui_button_key_pressed (line 5518) | static bool ui_button_key_pressed(ui_view_t* v, int64_t key) {
  function ui_button_tap (line 5525) | static bool ui_button_tap(ui_view_t* v, int32_t rt_unused(ix),
  function ui_view_init_button (line 5543) | void ui_view_init_button(ui_view_t* v) {
  function ui_button_init (line 5555) | void ui_button_init(ui_button_t* b, const char* label, fp32_t ems,
  function ui_caption_toggle_full (line 5586) | static void ui_caption_toggle_full(void) {
  function ui_caption_esc_full_screen (line 5592) | static void ui_caption_esc_full_screen(ui_view_t* v, const char utf8[]) {
  function ui_caption_quit (line 5598) | static void ui_caption_quit(ui_button_t* rt_unused(b)) {
  function ui_caption_mini (line 5602) | static void ui_caption_mini(ui_button_t* rt_unused(b)) {
  function ui_caption_mode_appearance (line 5606) | static void ui_caption_mode_appearance(void) {
  function ui_caption_mode (line 5616) | static void ui_caption_mode(ui_button_t* rt_unused(b)) {
  function ui_caption_maximize_or_restore (line 5624) | static void ui_caption_maximize_or_restore(void) {
  function ui_caption_maxi (line 5637) | static void ui_caption_maxi(ui_button_t* rt_unused(b)) {
  function ui_caption_full (line 5646) | static void ui_caption_full(ui_button_t* rt_unused(b)) {
  function ui_caption_hit_test (line 5650) | static int64_t ui_caption_hit_test(const ui_view_t* v, ui_point_t pt) {
  function ui_color_t (line 5676) | static ui_color_t ui_caption_color(void) {
  function ui_caption_button_measure (line 5687) | static void ui_caption_button_measure(ui_view_t* v) {
  function ui_caption_button_icon_paint (line 5699) | static void ui_caption_button_icon_paint(ui_view_t* v) {
  function ui_caption_prepare (line 5709) | static void ui_caption_prepare(ui_view_t* rt_unused(v)) {
  function ui_caption_measured (line 5713) | static void ui_caption_measured(ui_view_t* v) {
  function ui_caption_composed (line 5736) | static void ui_caption_composed(ui_view_t* v) {
  function ui_caption_paint (line 5741) | static void ui_caption_paint(ui_view_t* v) {
  function ui_caption_init (line 5746) | static void ui_caption_init(ui_view_t* v) {
  function ui_color_clamp_uint8 (line 5841) | static inline uint8_t ui_color_clamp_uint8(fp64_t value) {
  function fp64_t (line 5845) | static inline fp64_t ui_color_fp64_min(fp64_t x, fp64_t y) { return x < ...
  function fp64_t (line 5847) | static inline fp64_t ui_color_fp64_max(fp64_t x, fp64_t y) { return x > ...
  function ui_color_rgb_to_hsi (line 5849) | static void ui_color_rgb_to_hsi(fp64_t r, fp64_t g, fp64_t b, fp64_t *h,...
  function ui_color_t (line 5873) | static ui_color_t ui_color_hsi_to_rgb(fp64_t h, fp64_t s, fp64_t i, uint...
  function ui_color_t (line 5896) | static ui_color_t ui_color_brightness(ui_color_t c, fp32_t multiplier) {
  function ui_color_t (line 5903) | static ui_color_t ui_color_saturation(ui_color_t c, fp32_t multiplier) {
  function ui_color_t (line 5915) | static ui_color_t ui_color_interpolate(ui_color_t c0, ui_color_t c1,
  function ui_color_t (line 5935) | static ui_color_t ui_color_gray_with_same_intensity(ui_color_t c) {
  function ui_color_t (line 5954) | static ui_color_t ui_color_adjust_brightness(ui_color_t c,
  function ui_color_t (line 5962) | static ui_color_t ui_color_lighten(ui_color_t c, fp32_t multiplier) {
  function ui_color_t (line 5966) | static ui_color_t ui_color_darken(ui_color_t c, fp32_t multiplier) {
  function ui_color_t (line 5977) | static ui_color_t ui_color_adjust_saturation(ui_color_t c,
  function ui_color_t (line 6016) | static ui_color_t ui_colors_get_color(int32_t color_id) {
  function ui_span_measure (line 6287) | static void ui_span_measure(ui_view_t* p) {
  function ui_span_place_child (line 6349) | static int32_t ui_span_place_child(ui_view_t* c, ui_rect_t pbx, int32_t ...
  function ui_span_layout (line 6376) | static void ui_span_layout(ui_view_t* p) {
  function ui_list_measure (line 6471) | static void ui_list_measure(ui_view_t* p) {
  function ui_list_place_child (line 6530) | static int32_t ui_list_place_child(ui_view_t* c, ui_rect_t pbx, int32_t ...
  function ui_list_layout (line 6555) | static void ui_list_layout(ui_view_t* p) {
  function ui_stack_child_3x3 (line 6646) | static void ui_stack_child_3x3(ui_view_t* c, int32_t *row, int32_t *col) {
  function ui_stack_measure (line 6671) | static void ui_stack_measure(ui_view_t* p) {
  function ui_stack_layout (line 6724) | static void ui_stack_layout(ui_view_t* p) {
  function ui_container_paint (line 6773) | static void ui_container_paint(ui_view_t* v) {
  function ui_view_container_init (line 6782) | static void ui_view_container_init(ui_view_t* v) {
  function ui_view_init_span (line 6792) | void ui_view_init_span(ui_view_t* v) {
  function ui_view_init_list (line 6802) | void ui_view_init_list(ui_view_t* v) {
  function ui_view_init_spacer (line 6812) | void ui_view_init_spacer(ui_view_t* v) {
  function ui_view_init_stack (line 6823) | void ui_view_init_stack(ui_view_t* v) {
  function ui_point_in_rect (line 6848) | static bool ui_point_in_rect(const ui_point_t* p, const ui_rect_t* r) {
  function ui_intersect_rect (line 6853) | static bool ui_intersect_rect(ui_rect_t* i, const ui_rect_t* r0,
  function ui_rect_t (line 6869) | static ui_rect_t ui_combine_rect(const ui_rect_t* r0, const ui_rect_t* r...
  function ui_edit_range_t (line 7079) | static ui_edit_range_t ui_edit_text_all_on_null(const ui_edit_text_t* t,
  function ui_edit_range_compare (line 7094) | static int ui_edit_range_compare(const ui_edit_pg_t pg1, const ui_edit_p...
  function ui_edit_range_t (line 7100) | static ui_edit_range_t ui_edit_range_order(const ui_edit_range_t range) {
  function ui_edit_range_t (line 7114) | static ui_edit_range_t ui_edit_text_ordered(const ui_edit_text_t* t,
  function ui_edit_range_is_valid (line 7119) | static bool ui_edit_range_is_valid(const ui_edit_range_t r) {
  function ui_edit_range_is_empty (line 7129) | static bool ui_edit_range_is_empty(const ui_edit_range_t r) {
  function ui_edit_pg_t (line 7133) | static ui_edit_pg_t ui_edit_text_end(const ui_edit_text_t* t) {
  function ui_edit_range_t (line 7137) | static ui_edit_range_t ui_edit_text_end_range(const ui_edit_text_t* t) {
  function ui_edit_range_uint64 (line 7143) | static uint64_t ui_edit_range_uint64(const ui_edit_pg_t pg) {
  function ui_edit_pg_t (line 7148) | static ui_edit_pg_t ui_edit_range_pg(uint64_t uint64) {
  function ui_edit_range_inside_text (line 7153) | static bool ui_edit_range_inside_text(const ui_edit_text_t* t,
  function ui_edit_range_t (line 7161) | static ui_edit_range_t ui_edit_range_intersect(const ui_edit_range_t r1,
  function ui_edit_doc_realloc_ps_no_init (line 7200) | static bool ui_edit_doc_realloc_ps_no_init(ui_edit_str_t* *ps,
  function ui_edit_doc_realloc_ps (line 7213) | static bool ui_edit_doc_realloc_ps(ui_edit_str_t* *ps,
  function ui_edit_text_init (line 7225) | static bool ui_edit_text_init(ui_edit_text_t* t,
  function ui_edit_text_dispose (line 7294) | static void ui_edit_text_dispose(ui_edit_text_t* t) {
  function ui_edit_doc_dispose_to_do (line 7304) | static void ui_edit_doc_dispose_to_do(ui_edit_to_do_t* to_do) {
  function ui_edit_text_bytes (line 7312) | static int32_t ui_edit_text_bytes(const ui_edit_text_t* t,
  function ui_edit_doc_bytes (line 7332) | static int32_t ui_edit_doc_bytes(const ui_edit_doc_t* d,
  function ui_edit_doc_utf8bytes (line 7337) | static int32_t ui_edit_doc_utf8bytes(const ui_edit_doc_t* d,
  function ui_edit_notify_before (line 7345) | static void ui_edit_notify_before(ui_edit_doc_t* d,
  function ui_edit_notify_after (line 7356) | static void ui_edit_notify_after(ui_edit_doc_t* d,
  function ui_edit_doc_subscribe (line 7367) | static bool ui_edit_doc_subscribe(ui_edit_doc_t* t, ui_edit_notify_t* no...
  function ui_edit_doc_unsubscribe (line 7384) | static void ui_edit_doc_unsubscribe(ui_edit_doc_t* t, ui_edit_notify_t* ...
  function ui_edit_doc_copy_text (line 7402) | static bool ui_edit_doc_copy_text(const ui_edit_doc_t* d,
  function ui_edit_doc_copy (line 7437) | static void ui_edit_doc_copy(const ui_edit_doc_t* d,
  function ui_edit_text_insert_2_or_more (line 7473) | static bool ui_edit_text_insert_2_or_more(ui_edit_text_t* t, int32_t pn,
  function ui_edit_text_insert_1 (line 7515) | static bool ui_edit_text_insert_1(ui_edit_text_t* t,
  function ui_edit_substr_append (line 7527) | static bool ui_edit_substr_append(ui_edit_str_t* d, const ui_edit_str_t*...
  function ui_edit_append_substr (line 7540) | static bool ui_edit_append_substr(ui_edit_str_t* d, const ui_edit_str_t*...
  function ui_edit_text_insert (line 7554) | static bool ui_edit_text_insert(ui_edit_text_t* t, const ui_edit_pg_t ip,
  function ui_edit_text_remove_lines (line 7576) | static bool ui_edit_text_remove_lines(ui_edit_text_t* t,
  function ui_edit_text_insert_remove (line 7593) | static bool ui_edit_text_insert_remove(ui_edit_text_t* t,
  function ui_edit_text_copy_text (line 7617) | static bool ui_edit_text_copy_text(const ui_edit_text_t* t,
  function ui_edit_text_copy (line 7652) | static void ui_edit_text_copy(const ui_edit_text_t* t,
  function ui_edit_text_replace (line 7688) | static bool ui_edit_text_replace(ui_edit_text_t* t,
  function ui_edit_text_replace_utf8 (line 7714) | static bool ui_edit_text_replace_utf8(ui_edit_text_t* t,
  function ui_edit_text_dup (line 7728) | static bool ui_edit_text_dup(ui_edit_text_t* t, const ui_edit_text_t* s) {
  function ui_edit_text_equal (line 7745) | static bool ui_edit_text_equal(const ui_edit_text_t* t1,
  function ui_edit_doc_before_replace_text (line 7757) | static void ui_edit_doc_before_replace_text(ui_edit_doc_t* d,
  function ui_edit_doc_after_replace_text (line 7775) | static void ui_edit_doc_after_replace_text(ui_edit_doc_t* d,
  function ui_edit_doc_replace_text (line 7789) | static bool ui_edit_doc_replace_text(ui_edit_doc_t* d,
  function ui_edit_doc_replace_undoable (line 7800) | static bool ui_edit_doc_replace_undoable(ui_edit_doc_t* d,
  function ui_edit_utf8_to_heap_text (line 7819) | static bool ui_edit_utf8_to_heap_text(const char* u, int32_t b,
  function ui_edit_doc_coalesce_undo (line 7826) | static bool ui_edit_doc_coalesce_undo(ui_edit_doc_t* d, ui_edit_text_t* ...
  function ui_edit_doc_replace (line 7868) | static bool ui_edit_doc_replace(ui_edit_doc_t* d,
  function ui_edit_doc_do (line 7897) | static bool ui_edit_doc_do(ui_edit_doc_t* d, ui_edit_to_do_t* to_do,
  function ui_edit_doc_redo (line 7921) | static bool ui_edit_doc_redo(ui_edit_doc_t* d) {
  function ui_edit_doc_undo (line 7932) | static bool ui_edit_doc_undo(ui_edit_doc_t* d) {
  function ui_edit_doc_init (line 7943) | static bool ui_edit_doc_init(ui_edit_doc_t* d, const char* utf8,
  function ui_edit_doc_dispose (line 7968) | static void ui_edit_doc_dispose(ui_edit_doc_t* d) {
  function ui_edit_str_gp_to_bp (line 8133) | static int32_t ui_edit_str_gp_to_bp(const char* utf8, int32_t bytes, int...
  function ui_edit_str_free (line 8150) | static void ui_edit_str_free(ui_edit_str_t* s) {
  function ui_edit_str_init_g2b (line 8174) | static bool ui_edit_str_init_g2b(ui_edit_str_t* s) {
  function ui_edit_str_init (line 8203) | static bool ui_edit_str_init(ui_edit_str_t* s, const char* u, int32_t b,
  function ui_edit_str_swap (line 8238) | static void ui_edit_str_swap(ui_edit_str_t* s1, ui_edit_str_t* s2) {
  function ui_edit_str_bytes (line 8242) | static int32_t ui_edit_str_bytes(ui_edit_str_t* s,
  function ui_edit_str_move_g2b_to_heap (line 8249) | static bool ui_edit_str_move_g2b_to_heap(ui_edit_str_t* s) {
  function ui_edit_str_move_to_heap (line 8266) | static bool ui_edit_str_move_to_heap(ui_edit_str_t* s, int32_t c) {
  function ui_edit_str_expand (line 8280) | static bool ui_edit_str_expand(ui_edit_str_t* s, int32_t c) {
  function ui_edit_str_shrink (line 8293) | static void ui_edit_str_shrink(ui_edit_str_t* s) {
  function ui_edit_str_remove (line 8321) | static bool ui_edit_str_remove(ui_edit_str_t* s, int32_t f, int32_t t) {
  function ui_edit_str_replace (line 8351) | static bool ui_edit_str_replace(ui_edit_str_t* s,
  function ui_edit_str_is_zwj (line 8466) | static bool ui_edit_str_is_zwj(uint32_t utf32) {
  function ui_edit_str_is_punctuation (line 8470) | static bool ui_edit_str_is_punctuation(uint32_t utf32) {
  function ui_edit_str_is_letter (line 8493) | static bool ui_edit_str_is_letter(uint32_t utf32) {
  function ui_edit_str_is_spacing (line 8522) | static bool ui_edit_str_is_spacing(uint32_t utf32) {
  function ui_edit_str_is_combining (line 8528) | static bool ui_edit_str_is_combining(uint32_t utf32) {
  function ui_edit_str_is_blank (line 8537) | static bool ui_edit_str_is_blank(uint32_t utf32) {
  function ui_edit_str_is_symbol (line 8556) | static bool ui_edit_str_is_symbol(uint32_t utf32) {
  function ui_edit_str_is_digit (line 8582) | static bool ui_edit_str_is_digit(uint32_t utf32) {
  function ui_edit_str_is_alphanumeric (line 8606) | static bool ui_edit_str_is_alphanumeric(uint32_t utf32) {
  function ui_edit_str_is_cjk_or_emoji (line 8610) | static bool ui_edit_str_is_cjk_or_emoji(uint32_t utf32) {
  function ui_edit_str_can_break (line 8633) | static bool ui_edit_str_can_break(uint32_t cp1, uint32_t cp2) {
  function ui_edit_str_test_replace (line 8659) | static void ui_edit_str_test_replace(void) { // exhaustive permutations
  function ui_edit_str_test_glyph_bytes (line 8751) | static void ui_edit_str_test_glyph_bytes(void) {
  function ui_edit_str_test (line 8783) | static void ui_edit_str_test(void) {
  function rt_static_init (line 8860) | rt_static_init(ui_edit_str) { ui_edit_str.test(); }
  function ui_edit_doc_test_big_text (line 8865) | static void ui_edit_doc_test_big_text(void) {
  function ui_edit_doc_test_paragraphs (line 8886) | static void ui_edit_doc_test_paragraphs(void) {
  type ui_edit_doc_test_notify_t (line 8953) | typedef struct ui_edit_doc_test_notify_s {
  function ui_edit_doc_test_before (line 8959) | static void ui_edit_doc_test_before(ui_edit_notify_t* n,
  function ui_edit_doc_test_after (line 8965) | static void ui_edit_doc_test_after(ui_edit_notify_t* n,
  function ui_edit_doc_test_0 (line 8976) | static void ui_edit_doc_test_0(void) {
  function ui_edit_doc_test_1 (line 8989) | static void ui_edit_doc_test_1(void) {
  function ui_edit_doc_test_2 (line 9002) | static void ui_edit_doc_test_2(void) {
  function ui_edit_doc_test_3 (line 9084) | static void ui_edit_doc_test_3(void) {
  function ui_edit_doc_test_4 (line 9148) | static void ui_edit_doc_test_4(void) {
  function ui_edit_doc_test (line 9170) | static void ui_edit_doc_test(void) {
  function rt_static_init (line 9251) | rt_static_init(ui_edit_doc) { ui_edit_doc.test(); }
  type ui_edit_glyph_t (line 9284) | typedef  struct ui_edit_glyph_s {
  function ui_edit_invalidate_parent (line 9296) | static void ui_edit_invalidate_parent(const ui_edit_view_t* e, const ui_...
  function ui_edit_invalidate_rect (line 9307) | static void ui_edit_invalidate_rect(const ui_edit_view_t* e, const ui_re...
  function ui_edit_invalidate_view (line 9315) | static void ui_edit_invalidate_view(const ui_edit_view_t* e) {
  function ui_edit_line_height (line 9320) | static int32_t ui_edit_line_height(ui_edit_view_t* e) {
  function ui_rect_t (line 9329) | static ui_rect_t ui_edit_selection_rect(ui_edit_view_t* e) {
  function ui_edit_text_width_gp (line 9350) | static void ui_edit_text_width_gp(ui_edit_view_t* e, const char* utf8, i...
  function ui_edit_text_width (line 9360) | static int32_t ui_edit_text_width(ui_edit_view_t* e, const char* s, int3...
  function ui_edit_word_break_at (line 9377) | static int32_t ui_edit_word_break_at(ui_edit_view_t* e, int32_t pn, int3...
  function ui_edit_word_break (line 9436) | static int32_t ui_edit_word_break(ui_edit_view_t* e, int32_t pn, int32_t...
  function ui_edit_glyph_at_x (line 9440) | static int32_t ui_edit_glyph_at_x(ui_edit_view_t* e, int32_t pn, int32_t...
  function ui_edit_glyph_t (line 9451) | static ui_edit_glyph_t ui_edit_glyph_at(ui_edit_view_t* e, ui_edit_pg_t ...
  function ui_edit_run_t (line 9469) | static const ui_edit_run_t* ui_edit_paragraph_runs(ui_edit_view_t* e, in...
  function ui_edit_paragraph_run_count (line 9545) | static int32_t ui_edit_paragraph_run_count(ui_edit_view_t* e, int32_t pn) {
  function ui_edit_glyphs_in_paragraph (line 9555) | static int32_t ui_edit_glyphs_in_paragraph(ui_edit_view_t* e, int32_t pn) {
  function ui_edit_create_caret (line 9562) | static void ui_edit_create_caret(ui_edit_view_t* e) {
  function ui_edit_destroy_caret (line 9573) | static void ui_edit_destroy_caret(ui_edit_view_t* e) {
  function ui_edit_show_caret (line 9580) | static void ui_edit_show_caret(ui_edit_view_t* e) {
  function ui_edit_hide_caret (line 9598) | static void ui_edit_hide_caret(ui_edit_view_t* e) {
  function ui_edit_allocate_runs (line 9606) | static void ui_edit_allocate_runs(ui_edit_view_t* e) {
  function ui_edit_invalidate_run (line 9616) | static void ui_edit_invalidate_run(ui_edit_view_t* e, int32_t i) {
  function ui_edit_invalidate_runs (line 9627) | static void ui_edit_invalidate_runs(ui_edit_view_t* e, int32_t f, int32_...
  function ui_edit_invalidate_all_runs (line 9633) | static void ui_edit_invalidate_all_runs(ui_edit_view_t* e) {
  function ui_edit_dispose_runs (line 9638) | static void ui_edit_dispose_runs(ui_edit_view_t* e, int32_t np) {
  function ui_edit_dispose_all_runs (line 9645) | static void ui_edit_dispose_all_runs(ui_edit_view_t* e) {
  function ui_edit_layout_now (line 9649) | static void ui_edit_layout_now(ui_edit_view_t* e) {
  function ui_edit_if_sle_layout (line 9656) | static void ui_edit_if_sle_layout(ui_edit_view_t* e) {
  function ui_edit_view_set_font (line 9664) | static void ui_edit_view_set_font(ui_edit_view_t* e, ui_fm_t* f) {
  function ui_edit_pr_t (line 9674) | static ui_edit_pr_t ui_edit_pg_to_pr(ui_edit_view_t* e, const ui_edit_pg...
  function ui_edit_runs_between (line 9704) | static int32_t ui_edit_runs_between(ui_edit_view_t* e, const ui_edit_pg_...
  function ui_edit_pg_t (line 9728) | static ui_edit_pg_t ui_edit_scroll_pg(ui_edit_view_t* e) {
  function ui_edit_first_visible_run (line 9738) | static int32_t ui_edit_first_visible_run(ui_edit_view_t* e, int32_t pn) {
  function ui_point_t (line 9744) | static ui_point_t ui_edit_pg_to_xy(ui_edit_view_t* e, const ui_edit_pg_t...
  function ui_edit_glyph_width_px (line 9782) | static int32_t ui_edit_glyph_width_px(ui_edit_view_t* e, const ui_edit_p...
  function ui_edit_pg_t (line 9806) | static ui_edit_pg_t ui_edit_xy_to_pg(ui_edit_view_t* e, int32_t x, int32...
  function ui_edit_set_caret (line 9843) | static void ui_edit_set_caret(ui_edit_view_t* e, int32_t x, int32_t y) {
  function ui_edit_pg_t (line 9858) | static ui_edit_pg_t ui_edit_view_end_of_text(ui_edit_view_t* e) {
  function ui_edit_pg_t (line 9863) | static ui_edit_pg_t ui_edit_view_last_fully_visible(ui_edit_view_t* e) {
  function ui_edit_scroll_up (line 9892) | static void ui_edit_scroll_up(ui_edit_view_t* e, int32_t run_count) {
  function ui_edit_scroll_down (line 9924) | static void ui_edit_scroll_down(ui_edit_view_t* e, int32_t run_count) {
  function ui_edit_scroll_into_view (line 9944) | static void ui_edit_scroll_into_view(ui_edit_view_t* e, const ui_edit_pg...
  function ui_edit_caret_to (line 10000) | static void ui_edit_caret_to(ui_edit_view_t* e, const ui_edit_pg_t to) {
  function ui_edit_move_caret (line 10008) | static void ui_edit_move_caret(ui_edit_view_t* e, const ui_edit_pg_t pg) {
  function ui_edit_pg_t (line 10026) | static ui_edit_pg_t ui_edit_insert_inline(ui_edit_view_t* e, ui_edit_pg_...
  function ui_edit_pg_t (line 10048) | static ui_edit_pg_t ui_edit_insert_paragraph_break(ui_edit_view_t* e,
  function ui_edit_is_blank (line 10056) | static bool ui_edit_is_blank(ui_edit_glyph_t g) {
  function ui_edit_is_punctuation (line 10060) | static bool ui_edit_is_punctuation(ui_edit_glyph_t g) {
  function ui_edit_is_alphanumeric (line 10065) | static bool ui_edit_is_alphanumeric(ui_edit_glyph_t g) {
  function ui_edit_is_cjk_or_emoji_or_symbol (line 10070) | static bool ui_edit_is_cjk_or_emoji_or_symbol(ui_edit_glyph_t g) {
  function ui_edit_is_break (line 10076) | static bool ui_edit_is_break(ui_edit_glyph_t g) {
  function ui_edit_glyph_t (line 10085) | static ui_edit_glyph_t ui_edit_left_of(ui_edit_view_t* e, ui_edit_pg_t p...
  function ui_edit_glyph_t (line 10094) | static ui_edit_glyph_t ui_edit_right_of(ui_edit_view_t* e, ui_edit_pg_t ...
  function ui_edit_pg_t (line 10104) | static ui_edit_pg_t ui_edit_skip_left_blanks(ui_edit_view_t* e,
  function ui_edit_pg_t (line 10119) | static ui_edit_pg_t ui_edit_skip_right_blanks(ui_edit_view_t* e,
  function ui_edit_range_t (line 10132) | static ui_edit_range_t ui_edit_word_range(ui_edit_view_t* e, ui_edit_pg_...
  function ui_edit_ctrl_left (line 10195) | static void ui_edit_ctrl_left(ui_edit_view_t* e) {
  function ui_edit_view_key_left (line 10221) | static void ui_edit_view_key_left(ui_edit_view_t* e) {
  function ui_edit_ctrl_right (line 10243) | static void ui_edit_ctrl_right(ui_edit_view_t* e) {
  function ui_edit_view_key_right (line 10269) | static void ui_edit_view_key_right(ui_edit_view_t* e) {
  function ui_edit_reuse_last_x (line 10292) | static void ui_edit_reuse_last_x(ui_edit_view_t* e, ui_point_t* pt) {
  function ui_edit_view_key_up (line 10308) | static void ui_edit_view_key_up(ui_edit_view_t* e) {
  function ui_edit_view_key_down (line 10339) | static void ui_edit_view_key_down(ui_edit_view_t* e) {
  function ui_edit_view_key_home (line 10357) | static void ui_edit_view_key_home(ui_edit_view_t* e) {
  function ui_edit_view_key_eol (line 10393) | static void ui_edit_view_key_eol(ui_edit_view_t* e) {
  function ui_edit_view_key_end (line 10414) | static void ui_edit_view_key_end(ui_edit_view_t* e) {
  function ui_edit_view_key_page_up (line 10439) | static void ui_edit_view_key_page_up(ui_edit_view_t* e) {
  function ui_edit_view_key_page_down (line 10461) | static void ui_edit_view_key_page_down(ui_edit_view_t* e) {
  function ui_edit_view_key_delete (line 10484) | static void ui_edit_view_key_delete(ui_edit_view_t* e) {
  function ui_edit_view_key_backspace (line 10497) | static void ui_edit_view_key_backspace(ui_edit_view_t* e) {
  function ui_edit_view_key_enter (line 10508) | static void ui_edit_view_key_enter(ui_edit_view_t* e) {
  function ui_edit_view_key_pressed (line 10520) | static bool ui_edit_view_key_pressed(ui_view_t* v, int64_t key) {
  function ui_edit_undo (line 10556) | static void ui_edit_undo(ui_edit_view_t* e) {
  function ui_edit_redo (line 10563) | static void ui_edit_redo(ui_edit_view_t* e) {
  function ui_edit_character (line 10571) | static void ui_edit_character(ui_view_t* v, const char* utf8) {
  function ui_edit_select_word (line 10613) | static void ui_edit_select_word(ui_edit_view_t* e, int32_t x, int32_t y) {
  function ui_edit_select_paragraph (line 10633) | static void ui_edit_select_paragraph(ui_edit_view_t* e, int32_t x, int32...
  function ui_edit_click (line 10658) | static void ui_edit_click(ui_edit_view_t* e, int32_t x, int32_t y) {
  function ui_edit_mouse_button_down (line 10671) | static void ui_edit_mouse_button_down(ui_edit_view_t* e, int32_t ix) {
  function ui_edit_mouse_button_up (line 10675) | static void ui_edit_mouse_button_up(ui_edit_view_t* e, int32_t ix) {
  function ui_edit_tap (line 10679) | static bool ui_edit_tap(ui_view_t* v, int32_t rt_unused(ix), bool presse...
  function ui_edit_long_press (line 10699) | static bool ui_edit_long_press(ui_view_t* v, int32_t rt_unused(ix)) {
  function ui_edit_double_tap (line 10710) | static bool ui_edit_double_tap(ui_view_t* v, int32_t rt_unused(ix)) {
  function ui_edit_mouse_scroll (line 10721) | static void ui_edit_mouse_scroll(ui_view_t* v, ui_point_t dx_dy) {
  function ui_edit_focus_gained (line 10754) | static bool ui_edit_focus_gained(ui_view_t* v) {
  function ui_edit_focus_lost (line 10768) | static void ui_edit_focus_lost(ui_view_t* v) {
  function ui_edit_view_erase (line 10780) | static void ui_edit_view_erase(ui_edit_view_t* e) {
  function ui_edit_select_all (line 10794) | static void ui_edit_select_all(ui_edit_view_t* e) {
  function ui_edit_view_save (line 10799) | static int32_t ui_edit_view_save(ui_edit_view_t* e, char* text, int32_t*...
  function ui_edit_view_copy (line 10819) | static void ui_edit_view_copy(ui_edit_view_t* e) {
  function ui_edit_view_cut (line 10842) | static void ui_edit_view_cut(ui_edit_view_t* e) {
  function ui_edit_pg_t (line 10848) | static ui_edit_pg_t ui_edit_paste_text(ui_edit_view_t* e,
  function ui_edit_view_replace (line 10866) | static void ui_edit_view_replace(ui_edit_view_t* e, const char* s, int32...
  function ui_edit_view_paste (line 10876) | static void ui_edit_view_paste(ui_edit_view_t* e) {
  function ui_edit_prepare_sle (line 10900) | static void ui_edit_prepare_sle(ui_edit_view_t* e) {
  function ui_edit_insets (line 10914) | static void ui_edit_insets(ui_edit_view_t* e) {
  function ui_edit_measure (line 10929) | static void ui_edit_measure(ui_view_t* v) { // bottom up
  function ui_edit_layout (line 10942) | static void ui_edit_layout(ui_view_t* v) { // top down
  function ui_edit_paint_selection (line 10980) | static void ui_edit_paint_selection(ui_edit_view_t* e, int32_t y, const ...
  function ui_edit_paint_paragraph (line 11018) | static int32_t ui_edit_paint_paragraph(ui_edit_view_t* e,
  function ui_edit_paint (line 11044) | static void ui_edit_paint(ui_view_t* v) {
  function ui_edit_view_move (line 11073) | static void ui_edit_view_move(ui_edit_view_t* e, ui_edit_pg_t pg) {
  function ui_edit_reallocate_runs (line 11082) | static bool ui_edit_reallocate_runs(ui_edit_view_t* e, int32_t p, int32_...
  function ui_edit_before (line 11124) | static void ui_edit_before(ui_edit_notify_t* notify,
  function ui_edit_after (line 11142) | static void ui_edit_after(ui_edit_notify_t* notify,
  function ui_edit_view_init (line 11171) | static void ui_edit_view_init(ui_edit_view_t* e, ui_edit_doc_t* d) {
  function ui_edit_view_dispose (line 11211) | static void ui_edit_view_dispose(ui_edit_view_t* e) {
  type ui_fuzzing_generator_params_t (line 11335) | typedef struct {
  function ui_fuzzing_random (line 11348) | static uint32_t ui_fuzzing_random(void) {
  function fp64_t (line 11352) | static fp64_t ui_fuzzing_random_fp64(void) {
  function ui_fuzzing_generator (line 11357) | static void ui_fuzzing_generator(ui_fuzzing_generator_params_t p) {
  function ui_fuzzing_next_gibberish (line 11421) | static void ui_fuzzing_next_gibberish(int32_t number_of_characters,
  function ui_fuzzing_dispatch (line 11460) | static void ui_fuzzing_dispatch(ui_fuzzing_t* work) {
  function ui_fuzzing_do_work (line 11506) | static void ui_fuzzing_do_work(rt_work_t* p) {
  function ui_fuzzing_post (line 11520) | static void ui_fuzzing_post(void) {
  function ui_fuzzing_alt_ctrl_shift (line 11524) | static void ui_fuzzing_alt_ctrl_shift(void) {
  function ui_fuzzing_character (line 11539) | static void ui_fuzzing_character(void) {
  function ui_fuzzing_key (line 11566) | static void ui_fuzzing_key(void) {
  function ui_fuzzing_mouse (line 11593) | static void ui_fuzzing_mouse(void) {
  function ui_fuzzing_start (line 11616) | static void ui_fuzzing_start(uint32_t seed) {
  function ui_fuzzing_is_running (line 11626) | static bool ui_fuzzing_is_running(void) {
  function ui_fuzzing_from_inside (line 11630) | static bool ui_fuzzing_from_inside(void) {
  function ui_fuzzing_stop (line 11634) | static void ui_fuzzing_stop(void) {
  function ui_fuzzing_next_random (line 11638) | static void ui_fuzzing_next_random(ui_fuzzing_t* f) {
  type ui_gdi_context_t (line 11677) | typedef struct ui_gdi_context_s {
  function ui_gdi_init (line 11693) | static void ui_gdi_init(void) {
  function ui_gdi_fini (line 11699) | static void ui_gdi_fini(void) {
  function ui_pen_t (line 11706) | static ui_pen_t ui_gdi_set_pen(ui_pen_t p) {
  function ui_brush_t (line 11711) | static ui_brush_t ui_gdi_set_brush(ui_brush_t b) {
  function ui_gdi_color_rgb (line 11716) | static uint32_t ui_gdi_color_rgb(ui_color_t c) {
  function COLORREF (line 11721) | static COLORREF ui_gdi_color_ref(ui_color_t c) {
  function ui_color_t (line 11725) | static ui_color_t ui_gdi_set_text_color(ui_color_t c) {
  function ui_font_t (line 11729) | static ui_font_t ui_gdi_set_font(ui_font_t f) {
  function ui_gdi_begin (line 11734) | static void ui_gdi_begin(ui_bitmap_t* image) {
  function ui_gdi_end (line 11756) | static void ui_gdi_end(void) {
  function ui_pen_t (line 11773) | static ui_pen_t ui_gdi_set_colored_pen(ui_color_t c) {
  function ui_pen_t (line 11779) | static ui_pen_t ui_gdi_create_pen(ui_color_t c, int32_t width) {
  function ui_gdi_delete_pen (line 11786) | static void ui_gdi_delete_pen(ui_pen_t p) {
  function ui_brush_t (line 11790) | static ui_brush_t ui_gdi_create_brush(ui_color_t c) {
  function ui_gdi_delete_brush (line 11794) | static void ui_gdi_delete_brush(ui_brush_t b) {
  function ui_color_t (line 11798) | static ui_color_t ui_gdi_set_brush_color(ui_color_t c) {
  function ui_gdi_set_clip (line 11802) | static void ui_gdi_set_clip(int32_t x, int32_t y, int32_t w, int32_t h) {
  function ui_gdi_pixel (line 11811) | static void ui_gdi_pixel(int32_t x, int32_t y, ui_color_t c) {
  function ui_gdi_rectangle (line 11816) | static void ui_gdi_rectangle(int32_t x, int32_t y, int32_t w, int32_t h) {
  function ui_gdi_line (line 11820) | static void ui_gdi_line(int32_t x0, int32_t y0, int32_t x1, int32_t y1,
  function ui_gdi_frame (line 11830) | static void ui_gdi_frame(int32_t x, int32_t y, int32_t w, int32_t h,
  function ui_gdi_rect (line 11839) | static void ui_gdi_rect(int32_t x, int32_t y, int32_t w, int32_t h,
  function ui_gdi_fill (line 11854) | static void ui_gdi_fill(int32_t x, int32_t y, int32_t w, int32_t h,
  function ui_gdi_poly (line 11866) | static void ui_gdi_poly(ui_point_t* points, int32_t count, ui_color_t c) {
  function ui_gdi_circle (line 11877) | static void ui_gdi_circle(int32_t x, int32_t y, int32_t radius,
  function ui_gdi_fill_rounded (line 11904) | static void ui_gdi_fill_rounded(int32_t x, int32_t y, int32_t w, int32_t h,
  function ui_gdi_rounded_border (line 11919) | static void ui_gdi_rounded_border(int32_t x, int32_t y, int32_t w, int32...
  function ui_gdi_rounded (line 11944) | static void ui_gdi_rounded(int32_t x, int32_t y, int32_t w, int32_t h,
  function ui_gdi_gradient (line 11955) | static void ui_gdi_gradient(int32_t x, int32_t y, int32_t w, int32_t h,
  function BITMAPINFO (line 11977) | static BITMAPINFO* ui_gdi_greyscale_bitmap_info(void) {
  function ui_gdi_pixels (line 12001) | static void ui_gdi_pixels(int32_t dx, int32_t dy, int32_t dw, int32_t dh,
  function ui_gdi_greyscale (line 12016) | static void ui_gdi_greyscale(int32_t dx, int32_t dy, int32_t dw, int32_t...
  function BITMAPINFOHEADER (line 12036) | static BITMAPINFOHEADER ui_gdi_bgrx_init_bi(int32_t w, int32_t h, int32_...
  function ui_gdi_bgr (line 12056) | static void ui_gdi_bgr(int32_t dx, int32_t dy, int32_t dw, int32_t dh,
  function ui_gdi_bgrx (line 12073) | static void ui_gdi_bgrx(int32_t dx, int32_t dy, int32_t dw, int32_t dh,
  function BITMAPINFO (line 12090) | static BITMAPINFO* ui_gdi_init_bitmap_info(int32_t w, int32_t h, int32_t...
  function ui_gdi_create_dib_section (line 12103) | static void ui_gdi_create_dib_section(ui_bitmap_t* image, int32_t w, int...
  function ui_gdi_bitmap_init_rgbx (line 12119) | static void ui_gdi_bitmap_init_rgbx(ui_bitmap_t* image, int32_t w, int32...
  function ui_gdi_bitmap_init (line 12163) | static void ui_gdi_bitmap_init(ui_bitmap_t* image, int32_t w, int32_t h,...
  function ui_gdi_alpha (line 12249) | static void ui_gdi_alpha(int32_t dx, int32_t dy, int32_t dw, int32_t dh,
  function ui_gdi_bitmap (line 12277) | static void ui_gdi_bitmap(int32_t dx, int32_t dy, int32_t dw, int32_t dh,
  function ui_gdi_icon (line 12300) | static void ui_gdi_icon(int32_t x, int32_t y, int32_t w, int32_t h,
  function ui_gdi_cleartype (line 12305) | static void ui_gdi_cleartype(bool on) {
  function ui_gdi_font_smoothing_contrast (line 12314) | static void ui_gdi_font_smoothing_contrast(int32_t c) {
  function ui_font_t (line 12329) | static ui_font_t ui_gdi_create_font(const char* family, int32_t h, int32...
  function ui_font_t (line 12345) | static ui_font_t ui_gdi_font(ui_font_t f, int32_t h, int32_t q) {
  function ui_gdi_delete_font (line 12360) | static void ui_gdi_delete_font(ui_font_t f) {
  function HDC (line 12366) | static HDC ui_gdi_get_dc(void) {
  function ui_gdi_release_dc (line 12374) | static void ui_gdi_release_dc(HDC hdc) {
  function ui_gdi_dump_hdc_fm (line 12395) | static void ui_gdi_dump_hdc_fm(HDC hdc) {
  function ui_gdi_dump_fm (line 12448) | static void ui_gdi_dump_fm(ui_font_t f) {
  function ui_gdi_get_fm (line 12453) | static void ui_gdi_get_fm(HDC hdc, ui_fm_t* fm) {
  function ui_gdi_update_fm (line 12509) | static void ui_gdi_update_fm(ui_fm_t* fm, ui_font_t f) {
  function ui_gdi_draw_utf16 (line 12534) | static int32_t ui_gdi_draw_utf16(ui_font_t font, const char* s, int32_t n,
  type ui_gdi_dtp_t (line 12567) | typedef struct { // draw text parameters
  function ui_gdi_text_draw (line 12583) | static void ui_gdi_text_draw(ui_gdi_dtp_t* p) {
  function ui_wh_t (line 12617) | static ui_wh_t ui_gdi_text_with_flags(const ui_gdi_ta_t* ta,
  function ui_wh_t (line 12643) | static ui_wh_t ui_gdi_text_va(const ui_gdi_ta_t* ta,
  function ui_wh_t (line 12649) | static ui_wh_t ui_gdi_text(const ui_gdi_ta_t* ta,
  function ui_wh_t (line 12659) | static ui_wh_t ui_gdi_multiline_va(const ui_gdi_ta_t* ta,
  function ui_wh_t (line 12667) | static ui_wh_t ui_gdi_multiline(const ui_gdi_ta_t* ta,
  function ui_wh_t (line 12676) | static ui_wh_t ui_gdi_glyphs_placement(const ui_gdi_ta_t* ta,
  function ui_gdi_bitmap_dispose (line 12770) | static void ui_gdi_bitmap_dispose(ui_bitmap_t* image) {
  function fp64_t (line 12899) | static fp64_t ui_image_scale_of(int32_t nominator, int32_t denominator) {
  function fp64_t (line 12905) | static fp64_t ui_image_scale(ui_image_t* iv) {
  function ui_rect_t (line 12917) | static ui_rect_t ui_image_position(ui_image_t* iv) {
  function ui_image_paint (line 12934) | static void ui_image_paint(ui_view_t* v) {
  function ui_image_tools_background (line 12980) | static void ui_image_tools_background(ui_view_t* v) {
  function ui_image_show_tools (line 12987) | static void ui_image_show_tools(ui_image_t* iv, bool show) {
  function ui_image_fit_fill_scale (line 13003) | static void ui_image_fit_fill_scale(ui_image_t* iv) {
  function ui_image_measure (line 13015) | static void ui_image_measure(ui_view_t* v) {
  function ui_image_layout (line 13029) | static void ui_image_layout(ui_view_t* v) {
  function ui_image_every_100ms (line 13041) | static void ui_image_every_100ms(ui_view_t* v) {
  function ui_image_focus_lost (line 13048) | static void ui_image_focus_lost(ui_view_t* v) {
  function ui_image_focus_gained (line 13053) | static void ui_image_focus_gained(ui_view_t* v) {
  function ui_image_zoomed (line 13058) | static void ui_image_zoomed(ui_image_t* iv) {
  function ui_image_mouse_scroll (line 13100) | static void ui_image_mouse_scroll(ui_view_t* v, ui_point_t dx_dy) {
  function ui_image_tap (line 13120) | static bool ui_image_tap(ui_view_t* v, int32_t ix, bool pressed) {
  function ui_image_mouse_move (line 13143) | static bool ui_image_mouse_move(ui_view_t* v) {
  function ui_image_key_pressed (line 13165) | static bool ui_image_key_pressed(ui_view_t* v, int64_t vk) {
  function ui_image_zoom_in (line 13195) | static void ui_image_zoom_in(ui_button_t* b) {
  function ui_image_zoom_out (line 13203) | static void ui_image_zoom_out(ui_button_t* b) {
  function ui_image_fit (line 13211) | static void ui_image_fit(ui_button_t* b) {
  function ui_image_fill (line 13219) | static void ui_image_fill(ui_button_t* b) {
  function ui_image_zoom_1t1 (line 13227) | static void ui_image_zoom_1t1(ui_button_t* b) {
  function ui_image_help (line 13251) | static void ui_image_help(ui_button_t* rt_unused(b)) {
  function ui_image_copy_to_clipboard (line 13255) | static void ui_image_copy_to_clipboard(ui_image_t* iv) {
  function ui_image_copy (line 13271) | static void ui_image_copy(ui_button_t* b) {
  function ui_image_character (line 13276) | static void ui_image_character(ui_view_t* v, const char* utf8) {
  function ui_image_add_button (line 13303) | static void ui_image_add_button(ui_image_t* iv, ui_button_t* b,
  function ui_image_init (line 13321) | void ui_image_init(ui_image_t* iv) {
  function ui_image_init_with (line 13376) | void ui_image_init_with(ui_image_t* iv, const uint8_t* pixels,
  function ui_image_ratio (line 13387) | static void ui_image_ratio(ui_image_t* iv, int32_t zn, int32_t zd) {
  function ui_label_paint (line 13411) | static void ui_label_paint(ui_view_t* v) {
  function ui_label_context_menu (line 13437) | static bool ui_label_context_menu(ui_view_t* v) {
  function ui_label_character (line 13450) | static void ui_label_character(ui_view_t* v, const char* utf8) {
  function ui_view_init_label (line 13461) | void ui_view_init_label(ui_view_t* v) {
  function ui_label_init_va (line 13471) | void ui_label_init_va(ui_label_t* v, fp32_t min_w_em,
  function ui_label_init (line 13479) | void ui_label_init(ui_label_t* v, fp32_t min_w_em, const char* format, ....
  function ui_mbx_button (line 13489) | static void ui_mbx_button(ui_button_t* b) {
  function ui_mbx_measured (line 13507) | static void ui_mbx_measured(ui_view_t* v) {
  function ui_mbx_layout (line 13529) | static void ui_mbx_layout(ui_view_t* v) {
  function ui_view_init_mbx (line 13557) | void ui_view_init_mbx(ui_view_t* v) {
  function ui_mbx_init (line 13583) | void ui_mbx_init(ui_mbx_t* m, const char* options[],
  type ui_midi_t_ (line 13607) | typedef struct ui_midi_s_ {
  function ui_midi_error (line 13619) | static void ui_midi_error(errno_t r, char* text, int32_t count) {
  function ui_midi_warn_if_error_ (line 13623) | static void ui_midi_warn_if_error_(int r, const char* call, const char* ...
  function ui_midi_message_callback (line 13642) | static bool ui_midi_message_callback(ui_app_message_handler_t* h, int32_...
  function ui_midi_remove_handler (line 13666) | static void ui_midi_remove_handler(ui_midi_t* m) {
  function errno_t (line 13685) | static errno_t ui_midi_open(ui_midi_t* m, const char* filename) {
  function errno_t (line 13714) | static errno_t ui_midi_play(ui_midi_t* m) {
  function errno_t (line 13727) | static errno_t ui_midi_rewind(ui_midi_t* m) {
  function errno_t (line 13738) | static errno_t ui_midi_get_volume(ui_midi_t* m, fp64_t* volume) {
  function errno_t (line 13748) | static errno_t ui_midi_set_volume(ui_midi_t* m, fp64_t volume) {
  function errno_t (line 13761) | static errno_t ui_midi_stop(ui_midi_t* m) {
  function ui_midi_close (line 13771) | static void ui_midi_close(ui_midi_t* m) {
  function ui_midi_is_open (line 13785) | static bool ui_midi_is_open(ui_midi_t* m) {
  function ui_midi_is_playing (line 13790) | static bool ui_midi_is_playing(ui_midi_t* m) {
  function ui_slider_invalidate (line 13815) | static void ui_slider_invalidate(const ui_slider_t* s) {
  function ui_slider_width (line 13822) | static int32_t ui_slider_width(const ui_slider_t* s) {
  function ui_wh_t (line 13833) | static ui_wh_t measure_text(const ui_fm_t* fm, const char* format, ...) {
  function ui_wh_t (line 13842) | static ui_wh_t ui_slider_measure_text(ui_slider_t* s) {
  function ui_slider_measure (line 13886) | static void ui_slider_measure(ui_view_t* v) {
  function ui_slider_layout (line 13916) | static void ui_slider_layout(ui_view_t* v) {
  function ui_slider_paint (line 13927) | static void ui_slider_paint(ui_view_t* v) {
  function ui_slider_tap (line 13986) | static bool ui_slider_tap(ui_view_t* v, int32_t rt_unused(ix),
  function ui_slider_mouse_move (line 14014) | static void ui_slider_mouse_move(ui_view_t* v) {
  function ui_slider_inc_dec_value (line 14044) | static void ui_slider_inc_dec_value(ui_slider_t* s, int32_t sign, int32_...
  function ui_slider_inc_dec (line 14063) | static void ui_slider_inc_dec(ui_button_t* b) {
  function ui_slider_every_100ms (line 14073) | static void ui_slider_every_100ms(ui_view_t* v) { // 100ms
  function ui_view_init_slider (line 14096) | void ui_view_init_slider(ui_view_t* v) {
  function ui_slider_init (line 14145) | void ui_slider_init(ui_slider_t* s, const char* label, fp32_t min_w_em,
  function errno_t (line 14216) | static errno_t ui_theme_reg_get_uint32(HKEY root, const char* path,
  function ui_theme_use_light_theme (line 14235) | static bool ui_theme_use_light_theme(const char* key) {
  function HMODULE (line 14253) | static HMODULE ui_theme_uxtheme(void) {
  function ui_theme_set_preferred_app_mode (line 14272) | static void ui_theme_set_preferred_app_mode(int32_t mode) {
  function ui_theme_flush_menu_themes (line 14287) | static void ui_theme_flush_menu_themes(void) {
  function ui_theme_allow_dark_mode_for_app (line 14299) | static void ui_theme_allow_dark_mode_for_app(bool allow) {
  function ui_theme_allow_dark_mode_for_window (line 14312) | static void ui_theme_allow_dark_mode_for_window(bool allow) {
  function ui_theme_are_apps_dark (line 14327) | static bool ui_theme_are_apps_dark(void) {
  function ui_theme_is_system_dark (line 14331) | static bool ui_theme_is_system_dark(void) {
  function ui_theme_is_app_dark (line 14335) | static bool ui_theme_is_app_dark(void) {
  function ui_theme_refresh (line 14340) | static void ui_theme_refresh(void) {
  function ui_toggle_paint_on_off (line 14378) | static void ui_toggle_paint_on_off(ui_view_t* v) {
  function ui_toggle_measure (line 14423) | static void ui_toggle_measure(ui_view_t* v) {
  function ui_toggle_paint (line 14432) | static void ui_toggle_paint(ui_view_t* v) {
  function ui_toggle_flip (line 14446) | static void ui_toggle_flip(ui_toggle_t* t) {
  function ui_toggle_character (line 14452) | static void ui_toggle_character(ui_view_t* v, const char* utf8) {
  function ui_toggle_key_pressed (line 14459) | static bool ui_toggle_key_pressed(ui_view_t* v, int64_t key) {
  function ui_toggle_tap (line 14465) | static bool ui_toggle_tap(ui_view_t* v, int32_t rt_unused(ix),
  function ui_view_init_toggle (line 14472) | void ui_view_init_toggle(ui_view_t* v) {
  function ui_toggle_init (line 14485) | void ui_toggle_init(ui_toggle_t* t, const char* label, fp32_t ems,
  function ui_view_check_type (line 14508) | static inline void ui_view_check_type(ui_view_t* v) {
  function ui_view_verify (line 14517) | static void ui_view_verify(ui_view_t* p) {
  function ui_view_t (line 14528) | static ui_view_t* ui_view_add(ui_view_t* p, ...) {
  function ui_view_add_first (line 14543) | static void ui_view_add_first(ui_view_t* p, ui_view_t* c) {
  function ui_view_add_last (line 14560) | static void ui_view_add_last(ui_view_t* p, ui_view_t* c) {
  function ui_view_add_after (line 14578) | static void ui_view_add_after(ui_view_t* c, ui_view_t* a) {
  function ui_view_add_before (line 14592) | static void ui_view_add_before(ui_view_t* c, ui_view_t* b) {
  function ui_view_remove (line 14606) | static void ui_view_remove(ui_view_t* c) {
  function ui_view_remove_all (line 14628) | static void ui_view_remove_all(ui_view_t* p) {
  function ui_view_disband (line 14633) | static void ui_view_disband(ui_view_t* p) {
  function ui_view_invalidate (line 14644) | static void ui_view_invalidate(const ui_view_t* v, const ui_rect_t* r) {
  function ui_wh_t (line 14681) | static ui_wh_t ui_view_text_metrics_va(int32_t x, int32_t y,
  function ui_wh_t (line 14691) | static ui_wh_t ui_view_text_metrics(int32_t x, int32_t y,
  function ui_view_text_measure (line 14701) | static void ui_view_text_measure(ui_view_t* v, const char* s,
  function ui_view_text_align (line 14718) | static void ui_view_text_align(ui_view_t* v, ui_view_text_metrics_t* tm) {
  function ui_view_measure_control (line 14757) | static void ui_view_measure_control(ui_view_t* v) {
  function ui_view_measure_children (line 14796) | static void ui_view_measure_children(ui_view_t* v) {
  function ui_view_measure (line 14802) | static void ui_view_measure(ui_view_t* v) {
  function ui_layout_view (line 14815) | static void ui_layout_view(ui_view_t* rt_unused(v)) {
  function ui_view_layout_children (line 14825) | static void ui_view_layout_children(ui_view_t* v) {
  function ui_view_layout (line 14831) | static void ui_view_layout(ui_view_t* v) {
  function ui_view_inside (line 14845) | static bool ui_view_inside(const ui_view_t* v, const ui_point_t* pt) {
  function ui_view_is_parent_of (line 14851) | static bool ui_view_is_parent_of(const ui_view_t* parent,
  function ui_ltrb_t (line 14862) | static ui_ltrb_t ui_view_margins(const ui_view_t* v, const ui_margins_t*...
  function ui_view_inbox (line 14876) | static void ui_view_inbox(const ui_view_t* v, ui_rect_t* r, ui_ltrb_t* i...
  function ui_view_outbox (line 14891) | static void ui_view_outbox(const ui_view_t* v, ui_rect_t* r, ui_ltrb_t* ...
  function ui_view_update_shortcut (line 14911) | static void ui_view_update_shortcut(ui_view_t* v) {
  function ui_view_set_text_va (line 14923) | static void ui_view_set_text_va(ui_view_t* v, const char* format, va_lis...
  function ui_view_set_text (line 14936) | static void ui_view_set_text(ui_view_t* v, const char* format, ...) {
  function ui_view_show_hint (line 14943) | static void ui_view_show_hint(ui_view_t* v, ui_view_t* hint) {
  function ui_view_hovering (line 14961) | static void ui_view_hovering(ui_view_t* v, bool start) {
  function ui_view_is_shortcut_key (line 14974) | static bool ui_view_is_shortcut_key(ui_view_t* v, int64_t key) {
  function ui_view_is_orphan (line 14986) | static bool ui_view_is_orphan(const ui_view_t* v) {
  function ui_view_is_hidden (line 14991) | static bool ui_view_is_hidden(const ui_view_t* v) {
  function ui_view_is_disabled (line 15000) | static bool ui_view_is_disabled(const ui_view_t* v) {
  function ui_view_timer (line 15009) | static void ui_view_timer(ui_view_t* v, ui_timer_t id) {
  function ui_view_every_sec (line 15015) | static void ui_view_every_sec(ui_view_t* v) {
  function ui_view_every_100ms (line 15020) | static void ui_view_every_100ms(ui_view_t* v) {
  function ui_view_key_pressed (line 15025) | static bool ui_view_key_pressed(ui_view_t* v, int64_t k) {
  function ui_view_key_released (line 15042) | static bool ui_view_key_released(ui_view_t* v, int64_t k) {
  function ui_view_character (line 15058) | static void ui_view_character(ui_view_t* v, const char* utf8) {
  function ui_view_resolve_color_ids (line 15068) | static void ui_view_resolve_color_ids(ui_view_t* v) {
  function ui_view_paint (line 15077) | static void ui_view_paint(ui_view_t* v) {
  function ui_view_has_focus (line 15097) | static bool ui_view_has_focus(const ui_view_t* v) {
  function ui_view_set_focus (line 15101) | static void ui_view_set_focus(ui_view_t* v) {
  function ui_view_hit_test (line 15120) | static int64_t ui_view_hit_test(const ui_view_t* v, ui_point_t pt) {
  function ui_view_update_hover (line 15136) | static void ui_view_update_hover(ui_view_t* v, bool hidden) {
  function ui_view_mouse_hover (line 15147) | static void ui_view_mouse_hover(ui_view_t* v) {
  function ui_view_mouse_move (line 15158) | static void ui_view_mouse_move(ui_view_t* v) {
  function ui_view_double_click (line 15169) | static void ui_view_double_click(ui_view_t* v, int32_t ix) {
  function ui_view_mouse_scroll (line 15180) | static void ui_view_mouse_scroll(ui_view_t* v, ui_point_t dx_dy) {
  function ui_view_hover_changed (line 15187) | static void ui_view_hover_changed(ui_view_t* v) {
  function ui_view_lose_hidden_focus (line 15201) | static void ui_view_lose_hidden_focus(ui_view_t* v) {
  function ui_view_tap (line 15214) | static bool ui_view_tap(ui_view_t* v, int32_t ix, bool pressed) {
  function ui_view_long_press (line 15235) | static bool ui_view_long_press(ui_view_t* v, int32_t ix) {
  function ui_view_double_tap (line 15250) | static bool ui_view_double_tap(ui_view_t* v, int32_t ix) { // 0: left 1:...
  function ui_view_context_menu (line 15265) | static bool ui_view_context_menu(ui_view_t* v) {
  function ui_view_message (line 15280) | static bool ui_view_message(ui_view_t* view, int32_t m, int64_t wp, int6...
  function ui_view_is_container (line 15300) | static bool ui_view_is_container(const ui_view_t* v) {
  function ui_view_is_spacer (line 15306) | static bool ui_view_is_spacer(const ui_view_t* v) {
  function ui_view_is_control (line 15310) | static bool ui_view_is_control(const ui_view_t* v) {
  function ui_view_debug_paint_margins (line 15319) | static void ui_view_debug_paint_margins(ui_view_t* v) {
  function ui_view_debug_paint_fm (line 15359) | static void ui_view_debug_paint_fm(ui_view_t* v) {
  function ui_view_test (line 15395) | static void ui_view_test(void) {
  function rt_static_init (line 15526) | rt_static_init(ui_view) {

FILE: src/rt/rt_args.c
  function rt_args_main (line 6) | static void rt_args_main(int32_t argc, const char* argv[], const char** ...
  function rt_args_option_index (line 14) | static int32_t rt_args_option_index(const char* option) {
  function rt_args_remove_at (line 22) | static void rt_args_remove_at(int32_t ix) {
  function rt_args_option_bool (line 33) | static bool rt_args_option_bool(const char* option) {
  function rt_args_option_int (line 39) | static bool rt_args_option_int(const char* option, int64_t *value) {
  type rt_args_pair_t (line 93) | typedef struct { const char* s; char* d; const char* e; } rt_args_pair_t;
  function rt_args_pair_t (line 95) | static rt_args_pair_t rt_args_parse_backslashes(rt_args_pair_t p) {
  function rt_args_pair_t (line 113) | static rt_args_pair_t rt_args_parse_quoted(rt_args_pair_t p) {
  function rt_args_parse (line 139) | static void rt_args_parse(const char* s) {
  function rt_args_fini (line 230) | static void rt_args_fini(void) {
  function rt_args_WinMain (line 237) | static void rt_args_WinMain(void) {
  function rt_args_test_verify (line 263) | static void rt_args_test_verify(const char* cl, int32_t expected, ...) {
  function rt_args_test (line 296) | static void rt_args_test(void) {
  function rt_args_test (line 327) | static void rt_args_test(void) {}

FILE: src/rt/rt_atomics.c
  function rt_atomics_increment_int32 (line 12) | static int32_t rt_atomics_increment_int32(volatile int32_t* a) {
  function rt_atomics_decrement_int32 (line 16) | static int32_t rt_atomics_decrement_int32(volatile int32_t* a) {
  function rt_atomics_increment_int64 (line 20) | static int64_t rt_atomics_increment_int64(volatile int64_t* a) {
  function rt_atomics_decrement_int64 (line 24) | static int64_t rt_atomics_decrement_int64(volatile int64_t* a) {
  function rt_atomics_add_int32 (line 28) | static int32_t rt_atomics_add_int32(volatile int32_t* a, int32_t v) {
  function rt_atomics_add_int64 (line 32) | static int64_t rt_atomics_add_int64(volatile int64_t* a, int64_t v) {
  function rt_atomics_exchange_int64 (line 36) | static int64_t rt_atomics_exchange_int64(volatile int64_t* a, int64_t v) {
  function rt_atomics_exchange_int32 (line 40) | static int32_t rt_atomics_exchange_int32(volatile int32_t* a, int32_t v) {
  function rt_atomics_compare_exchange_int64 (line 45) | static bool rt_atomics_compare_exchange_int64(volatile int64_t* a,
  function rt_atomics_compare_exchange_int32 (line 51) | static bool rt_atomics_compare_exchange_int32(volatile int32_t* a,
  function memory_fence (line 57) | static void memory_fence(void) {
  function rt_atomics_increment_int32 (line 89) | static int32_t rt_atomics_increment_int32(volatile int32_t* a) {
  function rt_atomics_decrement_int32 (line 93) | static int32_t rt_atomics_decrement_int32(volatile int32_t* a) {
  function rt_atomics_increment_int64 (line 97) | static int64_t rt_atomics_increment_int64(volatile int64_t* a) {
  function rt_atomics_decrement_int64 (line 101) | static int64_t rt_atomics_decrement_int64(volatile int64_t* a) {
  function rt_atomics_add_int32 (line 105) | static int32_t rt_atomics_add_int32(volatile int32_t* a, int32_t v) {
  function rt_atomics_add_int64 (line 109) | static int64_t rt_atomics_add_int64(volatile int64_t* a, int64_t v) {
  function rt_atomics_exchange_int64 (line 113) | static int64_t rt_atomics_exchange_int64(volatile int64_t* a, int64_t v) {
  function rt_atomics_exchange_int32 (line 117) | static int32_t rt_atomics_exchange_int32(volatile int32_t* a, int32_t v) {
  function rt_atomics_compare_exchange_int64 (line 121) | static bool rt_atomics_compare_exchange_int64(volatile int64_t* a,
  function rt_atomics_compare_exchange_int32 (line 128) | static bool rt_atomics_compare_exchange_int32(volatile int32_t* a,
  function memory_fence (line 134) | static void memory_fence(void) { atomic_thread_fence(memory_order_seq_cs...
  function rt_atomics_load_int32 (line 140) | static int32_t rt_atomics_load_int32(volatile int32_t* a) {
  function rt_atomics_load_int64 (line 144) | static int64_t rt_atomics_load_int64(volatile int64_t* a) {
  function rt_atomics_compare_exchange_ptr (line 153) | static bool rt_atomics_compare_exchange_ptr(volatile void* *a, void* com...
  function spinlock_acquire (line 170) | static void spinlock_acquire(volatile int64_t* spinlock) {
  function spinlock_release (line 190) | static void spinlock_release(volatile int64_t* spinlock) {
  function rt_atomics_test (line 197) | static void rt_atomics_test(void) {

FILE: src/rt/rt_backtrace.c
  function rt_backtrace_init (line 19) | static void rt_backtrace_init(void) {
  function rt_backtrace_capture (line 42) | static void rt_backtrace_capture(rt_backtrace_t* bt, int32_t skip) {
  function rt_backtrace_function (line 50) | static bool rt_backtrace_function(DWORD64 pc, SYMBOL_INFO* si) {
  function rt_backtrace_symbolize_inline_frame (line 102) | static const void rt_backtrace_symbolize_inline_frame(rt_backtrace_t* bt,
  function rt_backtrace_symbolize_frame (line 134) | static int32_t rt_backtrace_symbolize_frame(rt_backtrace_t* bt, int32_t ...
  function rt_backtrace_symbolize_backtrace (line 194) | static void rt_backtrace_symbolize_backtrace(rt_backtrace_t* bt) {
  function rt_backtrace_symbolize (line 210) | static void rt_backtrace_symbolize(rt_backtrace_t* bt) {
  function rt_backtrace_trace (line 226) | static void rt_backtrace_trace(const rt_backtrace_t* bt, const char* sto...
  type rt_backtrace_thread_name_t (line 271) | typedef struct { char name[32]; } rt_backtrace_thread_name_t;
  function rt_backtrace_thread_name_t (line 273) | static rt_backtrace_thread_name_t rt_backtrace_thread_name(HANDLE thread) {
  function rt_backtrace_context (line 284) | static void rt_backtrace_context(rt_thread_t thread, const void* ctx,
  function rt_backtrace_thread (line 337) | static void rt_backtrace_thread(HANDLE thread, rt_backtrace_t* bt) {
  function rt_backtrace_trace_self (line 352) | static void rt_backtrace_trace_self(const char* stop) {
  function rt_backtrace_trace_all_but_self (line 359) | static void rt_backtrace_trace_all_but_self(void) {
  function rt_backtrace_tee (line 405) | static bool rt_backtrace_tee(const char* s, int32_t count) {
  function rt_backtrace_test_thread (line 420) | static void rt_backtrace_test_thread(void* e) {
  function rt_backtrace_test (line 424) | static void rt_backtrace_test(void) {
  function rt_backtrace_test (line 456) | static void rt_backtrace_test(void) { }

FILE: src/rt/rt_clipboard.c
  function errno_t (line 4) | static errno_t rt_clipboard_put_text(const char* utf8) {
  function errno_t (line 49) | static errno_t rt_clipboard_get_text(char* utf8, int32_t* bytes) {
  function rt_clipboard_test (line 86) | static void rt_clipboard_test(void) {
  function rt_clipboard_test (line 97) | static void rt_clipboard_test(void) {

FILE: src/rt/rt_clock.c
  function rt_clock_microseconds_since_epoch (line 13) | static uint64_t rt_clock_microseconds_since_epoch(void) { // NOT monotonic
  function rt_clock_localtime (line 23) | static uint64_t rt_clock_localtime(void) {
  function rt_clock_utc (line 30) | static void rt_clock_utc(uint64_t microseconds,
  function rt_clock_local (line 48) | static void rt_clock_local(uint64_t microseconds,
  function fp64_t (line 69) | static fp64_t rt_clock_seconds(void) { // since_boot
  function rt_clock_nanoseconds (line 102) | static uint64_t rt_clock_nanoseconds(void) {
  function rt_clock_unix_microseconds (line 134) | static uint64_t rt_clock_unix_microseconds(void) {
  function rt_clock_unix_seconds (line 138) | static uint64_t rt_clock_unix_seconds(void) {
  function rt_clock_test (line 142) | static void rt_clock_test(void) {

FILE: src/rt/rt_config.c
  function errno_t (line 13) | static errno_t rt_config_get_reg_key(const char* name, HKEY *key) {
  function errno_t (line 25) | static errno_t rt_config_save(const char* name,
  function errno_t (line 38) | static errno_t rt_config_remove(const char* name, const char* key) {
  function errno_t (line 49) | static errno_t rt_config_clean(const char* name) {
  function rt_config_size (line 60) | static int32_t rt_config_size(const char* name, const char* key) {
  function rt_config_load (line 82) | static int32_t rt_config_load(const char* name,
  function rt_config_test (line 109) | static void rt_config_test(void) {
  function rt_config_test (line 129) | static void rt_config_test(void) { }

FILE: src/rt/rt_core.c
  function rt_core_abort (line 9) | static void rt_core_abort(void) { ExitProcess(ERROR_FATAL_APP_EXIT); }
  function rt_core_exit (line 11) | static void rt_core_exit(int32_t exit_code) { exit(exit_code); }
  function errno_t (line 17) | static errno_t rt_core_err(void) { return (errno_t)GetLastError(); }
  function rt_core_seterr (line 19) | static void rt_core_seterr(errno_t err) { SetLastError((DWORD)err); }
  function rt_static_init (line 21) | rt_static_init(runtime) {
  function rt_core_test (line 39) | static void rt_core_test(void) { // in alphabetical order
  function rt_core_test (line 66) | static void rt_core_test(void) { }

FILE: src/rt/rt_debug.c
  function rt_debug_output (line 15) | static void rt_debug_output(const char* s, int32_t count) {
  function rt_debug_println_va (line 30) | static void rt_debug_println_va(const char* file, int32_t line, const ch...
  function rt_debug_vprintf (line 86) | static void rt_debug_vprintf(const char* file, int32_t line, const char*...
  function rt_debug_perrno (line 95) | static void rt_debug_perrno(const char* file, int32_t line,
  function rt_debug_perror (line 108) | static void rt_debug_perror(const char* file, int32_t line,
  function rt_debug_println (line 121) | static void rt_debug_println(const char* file, int32_t line, const char*...
  function rt_debug_is_debugger_present (line 129) | static bool rt_debug_is_debugger_present(void) { return IsDebuggerPresen...
  function rt_debug_breakpoint (line 131) | static void rt_debug_breakpoint(void) {
  function errno_t (line 135) | static errno_t rt_debug_raise(uint32_t exception) {
  function rt_debug_verbosity_from_string (line 141) | static int32_t rt_debug_verbosity_from_string(const char* s) {
  function rt_debug_test (line 163) | static void rt_debug_test(void) {

FILE: src/rt/rt_files.c
  function errno_t (line 16) | static errno_t rt_files_open(rt_file_t* *file, const char* fn, int32_t f) {
  function rt_files_is_valid (line 33) | static bool rt_files_is_valid(rt_file_t* file) { // both null and rt_fil...
  function errno_t (line 37) | static errno_t rt_files_seek(rt_file_t* file, int64_t *position, int32_t...
  function rt_files_ft_to_us (line 45) | static inline uint64_t rt_files_ft_to_us(FILETIME ft) { // us (microseco...
  function rt_files_a2t (line 49) | static int64_t rt_files_a2t(DWORD a) {
  function get_final_path_name_by_fd (line 65) | static int get_final_path_name_by_fd(int fd, char *buffer, int32_t bytes) {
  function errno_t (line 77) | static errno_t rt_files_stat(rt_file_t* file, rt_files_stat_t* s,
  function errno_t (line 118) | static errno_t rt_files_read(rt_file_t* file, void* data, int64_t bytes,...
  function errno_t (line 134) | static errno_t rt_files_write(rt_file_t* file, const void* data, int64_t...
  function errno_t (line 150) | static errno_t rt_files_flush(rt_file_t* file) {
  function rt_files_close (line 154) | static void rt_files_close(rt_file_t* file) {
  function errno_t (line 158) | static errno_t rt_files_write_fully(const char* filename, const void* data,
  function errno_t (line 189) | static errno_t rt_files_unlink(const char* pathname) {
  function errno_t (line 197) | static errno_t rt_files_create_tmp(char* fn, int32_t count) {
  function errno_t (line 245) | static errno_t rt_files_acl_add_ace(ACL* acl, SID* sid, uint32_t mask,
  function errno_t (line 290) | static errno_t rt_files_lookup_sid(ACCESS_ALLOWED_ACE* ace) {
  function errno_t (line 309) | static errno_t rt_files_add_acl_ace(void* obj, int32_t obj_type,
  function errno_t (line 369) | static errno_t rt_files_chmod777(const char* pathname) {
  function errno_t (line 408) | static errno_t rt_files_mkdirs(const char* dir) {
  function errno_t (line 457) | static errno_t rt_files_rmdirs(const char* fn) {
  function rt_files_exists (line 513) | static bool rt_files_exists(const char* path) {
  function rt_files_is_folder (line 517) | static bool rt_files_is_folder(const char* path) {
  function rt_files_is_symlink (line 521) | static bool rt_files_is_symlink(const char* filename) {
  function errno_t (line 533) | static errno_t rt_files_copy(const char* s, const char* d) {
  function errno_t (line 537) | static errno_t rt_files_move(const char* s, const char* d) {
  function errno_t (line 545) | static errno_t rt_files_link(const char* from, const char* to) {
  function errno_t (line 550) | static errno_t rt_files_symlink(const char* from, const char* to) {
  function errno_t (line 604) | static errno_t rt_files_cwd(char* fn, int32_t count) {
  function errno_t (line 612) | static errno_t rt_files_chdir(const char* fn) {
  type rt_files_dir_t (line 616) | typedef struct rt_files_dir_s {
  function errno_t (line 623) | static errno_t rt_files_opendir(rt_folder_t* folder, const char* folder_...
  function rt_files_ft2us (line 639) | static uint64_t rt_files_ft2us(FILETIME* ft) { // 100ns units to microse...
  function rt_files_closedir (line 662) | static void rt_files_closedir(rt_folder_t* folder) {
  function folders_dump_time (line 683) | static void folders_dump_time(const char* label, uint64_t us) {
  function folders_test (line 697) | static void folders_test(void) {
  function rt_files_test_append_thread (line 806) | static void rt_files_test_append_thread(void* p) {
  function rt_files_test (line 815) | static void rt_files_test(void) {
  function rt_files_test (line 970) | static void rt_files_test(void) {}

FILE: src/rt/rt_generics.c
  function rt_generics_test (line 5) | static void rt_generics_test(void) {
  function rt_generics_test (line 68) | static void rt_generics_test(void) { }

FILE: src/rt/rt_heap.c
  function errno_t (line 5) | static errno_t rt_heap_alloc(void* *a, int64_t bytes) {
  function errno_t (line 9) | static errno_t rt_heap_alloc_zero(void* *a, int64_t bytes) {
  function errno_t (line 13) | static errno_t rt_heap_realloc(void* *a, int64_t bytes) {
  function errno_t (line 17) | static errno_t rt_heap_realloc_zero(void* *a, int64_t bytes) {
  function rt_heap_free (line 21) | static void rt_heap_free(void* a) {
  function rt_heap_t (line 25) | static rt_heap_t* rt_heap_create(bool serialized) {
  function rt_heap_dispose (line 30) | static void rt_heap_dispose(rt_heap_t* h) {
  function HANDLE (line 34) | static inline HANDLE rt_heap_or_process_heap(rt_heap_t* h) {
  function errno_t (line 40) | static errno_t rt_heap_allocate(rt_heap_t* h, void* *p, int64_t bytes, b...
  function errno_t (line 54) | static errno_t rt_heap_reallocate(rt_heap_t* h, void* *p, int64_t bytes,
  function rt_heap_deallocate (line 65) | static void rt_heap_deallocate(rt_heap_t* h, void* a) {
  function rt_heap_bytes (line 69) | static int64_t rt_heap_bytes(rt_heap_t* h, void* a) {
  function rt_heap_test (line 77) | static void rt_heap_test(void) {
  function rt_heap_test (line 99) | static void rt_heap_test(void) { }

FILE: src/rt/rt_loader.c
  function rt_loader_close (line 52) | static void rt_loader_close(void* handle) {
  function rt_loader_test_exported_function (line 72) | void rt_loader_test_exported_function(void) { rt_loader_test_calls_count...
  function rt_loader_test (line 76) | static void rt_loader_test(void) {
  function rt_loader_test (line 115) | static void rt_loader_test(void) {}

FILE: src/rt/rt_mem.c
  function errno_t (line 4) | static errno_t rt_mem_map_view_of_file(HANDLE file,
  function errno_t (line 30) | static errno_t rt_mem_set_token_privilege(void* token,
  function errno_t (line 39) | static errno_t rt_mem_adjust_process_privilege_manage_volume_name(void) {
  function errno_t (line 53) | static errno_t rt_mem_map_file(const char* filename, void* *data,
  function errno_t (line 91) | static errno_t rt_mem_map_ro(const char* filename, void* *data, int64_t ...
  function errno_t (line 95) | static errno_t rt_mem_map_rw(const char* filename, void* *data, int64_t ...
  function rt_mem_unmap (line 99) | static void rt_mem_unmap(void* data, int64_t bytes) {
  function errno_t (line 107) | static errno_t rt_mem_map_resource(const char* label, void* *data, int64...
  function rt_mem_page_size (line 119) | static int32_t rt_mem_page_size(void) {
  function rt_mem_large_page_size (line 127) | static int rt_mem_large_page_size(void) {
  function rt_mem_deallocate (line 193) | static void rt_mem_deallocate(void* a, int64_t bytes_multiple_of_page_si...
  function rt_mem_test (line 217) | static void rt_mem_test(void) {

FILE: src/rt/rt_nls.c
  function rt_nls_strid (line 94) | static int32_t rt_nls_strid(const char* s) {
  function errno_t (line 131) | static errno_t rt_nls_set_locale(const char* locale) {
  function rt_nls_init (line 153) | static void rt_nls_init(void) {

FILE: src/rt/rt_num.c
  function rt_num128_t (line 5) | static inline rt_num128_t rt_num_add128_inline(const rt_num128_t a, cons...
  function rt_num128_t (line 13) | static inline rt_num128_t rt_num_sub128_inline(const rt_num128_t a, cons...
  function rt_num128_t (line 21) | static rt_num128_t rt_num_add128(const rt_num128_t a, const rt_num128_t ...
  function rt_num128_t (line 25) | static rt_num128_t rt_num_sub128(const rt_num128_t a, const rt_num128_t ...
  function rt_num128_t (line 29) | static rt_num128_t rt_num_mul64x64(uint64_t a, uint64_t b) {
  function rt_num_shift128_left_inline (line 49) | static inline void rt_num_shift128_left_inline(rt_num128_t* n) {
  function rt_num_shift128_right_inline (line 55) | static inline void rt_num_shift128_right_inline(rt_num128_t* n) {
  function rt_num_less128_inline (line 61) | static inline bool rt_num_less128_inline(const rt_num128_t a, const rt_n...
  function rt_num_uint128_high_bit (line 65) | static inline bool rt_num_uint128_high_bit(const rt_num128_t a) {
  function rt_num_muldiv128 (line 69) | static uint64_t rt_num_muldiv128(uint64_t a, uint64_t b, uint64_t diviso...
  function rt_num_gcd32 (line 96) | static uint32_t rt_num_gcd32(uint32_t u, uint32_t v) {
  function rt_num_random32 (line 122) | static uint32_t rt_num_random32(uint32_t* state) {
  function rt_num_random64 (line 132) | static uint64_t rt_num_random64(uint64_t *state) {
  function rt_num_hash32 (line 143) | static uint32_t rt_num_hash32(const char *data, int64_t len) {
  function rt_num_hash64 (line 160) | static uint64_t rt_num_hash64(const char *data, int64_t len) {
  function ctz_2 (line 177) | static uint32_t ctz_2(uint32_t x) {
  function rt_num_test (line 187) | static void rt_num_test(void) {

FILE: src/rt/rt_processes.c
  type rt_processes_pidof_lambda_t (line 4) | typedef struct rt_processes_pidof_lambda_s rt_processes_pidof_lambda_t;
  type rt_processes_pidof_lambda_t (line 6) | typedef struct rt_processes_pidof_lambda_s {
  function rt_processes_for_each_pidof (line 15) | static int32_t rt_processes_for_each_pidof(const char* pname, rt_process...
  function errno_t (line 88) | static errno_t rt_processes_nameof(uint64_t pid, char* name, int32_t cou...
  function rt_processes_present (line 103) | static bool rt_processes_present(uint64_t pid) {
  function rt_processes_first_pid (line 110) | static bool rt_processes_first_pid(rt_processes_pidof_lambda_t* lambda, ...
  function rt_processes_pid (line 115) | static uint64_t rt_processes_pid(const char* pname) {
  function rt_processes_store_pid (line 129) | static bool rt_processes_store_pid(rt_processes_pidof_lambda_t* lambda, ...
  function errno_t (line 136) | static errno_t rt_processes_pids(const char* pname, uint64_t* pids/*[siz...
  function errno_t (line 151) | static errno_t rt_processes_kill(uint64_t pid, fp64_t timeout) {
  function rt_processes_kill_one (line 196) | static bool rt_processes_kill_one(rt_processes_pidof_lambda_t* lambda, u...
  function errno_t (line 202) | static errno_t rt_processes_kill_all(const char* name, fp64_t timeout) {
  function rt_processes_is_elevated (line 215) | static bool rt_processes_is_elevated(void) { // Is process running as Ad...
  function errno_t (line 248) | static errno_t rt_processes_restart_elevated(void) {
  function rt_processes_close_pipes (line 267) | static void rt_processes_close_pipes(STARTUPINFOA* si,
  function errno_t (line 279) | static errno_t rt_processes_child_read(rt_stream_if* out, HANDLE pipe) {
  function errno_t (line 305) | static errno_t rt_processes_child_write(rt_stream_if* in, HANDLE pipe) {
  function errno_t (line 325) | static errno_t rt_processes_run(rt_processes_child_t* child) {
  type rt_processes_io_merge_out_and_err_if (line 412) | typedef struct {
  function errno_t (line 418) | static errno_t rt_processes_merge_write(rt_stream_if* stream, const void...
  function errno_t (line 429) | static errno_t rt_processes_open(const char* command, int32_t *exit_code,
  function errno_t (line 455) | static errno_t rt_processes_spawn(const char* command) {
  function rt_processes_test (line 501) | static void rt_processes_test(void) {
  function rt_processes_test (line 558) | static void rt_processes_test(void) { }

FILE: src/rt/rt_static.c
  function rt_static_init_function (line 26) | rt_static_init_function(void) {
  function rt_static_init (line 30) | rt_static_init(static_init_test) { rt_static_init_function(); }
  function rt_static_init_test (line 32) | void rt_static_init_test(void) {
  function rt_static_init_test (line 40) | void rt_static_init_test(void) {}

FILE: src/rt/rt_str.c
  function rt_str_len (line 15) | static int32_t rt_str_len(const char* s) { return (int32_t)strlen(s); }
  function rt_str_utf16len (line 17) | static int32_t rt_str_utf16len(const uint16_t* utf16) {
  function rt_str_utf8bytes (line 21) | static int32_t rt_str_utf8bytes(const char* s, int32_t b) {
  function rt_str_glyphs (line 52) | static int32_t rt_str_glyphs(const char* utf8, int32_t bytes) {
  function rt_str_lower (line 65) | static void rt_str_lower(char* d, int32_t capacity, const char* s) {
  function rt_str_upper (line 72) | static void rt_str_upper(char* d, int32_t capacity, const char* s) {
  function rt_str_starts (line 79) | static bool rt_str_starts(const char* s1, const char* s2) {
  function rt_str_ends (line 85) | static bool rt_str_ends(const char* s1, const char* s2) {
  function rt_str_i_starts (line 91) | static bool rt_str_i_starts(const char* s1, const char* s2) {
  function rt_str_i_ends (line 98) | static bool rt_str_i_ends(const char* s1, const char* s2) {
  function rt_str_utf8_bytes (line 104) | static int32_t rt_str_utf8_bytes(const uint16_t* utf16, int32_t chars) {
  function rt_str_utf16_chars (line 122) | static int32_t rt_str_utf16_chars(const char* utf8, int32_t bytes) {
  function errno_t (line 137) | static errno_t rt_str_utf16to8(char* utf8, int32_t capacity,
  function errno_t (line 156) | static errno_t rt_str_utf8to16(uint16_t* utf16, int32_t capacity,
  function rt_str_utf16_is_low_surrogate (line 179) | static bool rt_str_utf16_is_low_surrogate(uint16_t utf16char) {
  function rt_str_utf16_is_high_surrogate (line 183) | static bool rt_str_utf16_is_high_surrogate(uint16_t utf16char) {
  function rt_str_utf32 (line 187) | static uint32_t rt_str_utf32(const char* utf8, int32_t bytes) {
  function rt_str_format_va (line 213) | static void rt_str_format_va(char* utf8, int32_t count, const char* format,
  function rt_str_format (line 226) | static void rt_str_format(char* utf8, int32_t count, const char* format,...
  function rt_str1024_t (line 233) | static rt_str1024_t rt_str_error_for_language(int32_t error, LANGID lang...
  function rt_str1024_t (line 277) | static rt_str1024_t rt_str_error(int32_t error) {
  function rt_str1024_t (line 282) | static rt_str1024_t rt_str_error_nls(int32_t error) {
  type lconv (line 303) | struct lconv
  function rt_str64_t (line 331) | static rt_str64_t rt_str_int64_dg(int64_t v, // digit_grouped
  function rt_str64_t (line 373) | static rt_str64_t rt_str_int64(int64_t v) {
  function rt_str64_t (line 377) | static rt_str64_t rt_str_uint64(uint64_t v) {
  function rt_str64_t (line 381) | static rt_str64_t rt_str_int64_lc(int64_t v) {
  function rt_str64_t (line 385) | static rt_str64_t rt_str_uint64_lc(uint64_t v) {
  function rt_str128_t (line 389) | static rt_str128_t rt_str_fp(const char* format, fp64_t v) {
  function rt_str_test (line 425) | static void rt_str_test(void) {
  function rt_str_test (line 520) | static void rt_str_test(void) {}

FILE: src/rt/rt_streams.c
  function errno_t (line 4) | static errno_t rt_streams_memory_read(rt_stream_if* stream, void* data, ...
  function errno_t (line 18) | static errno_t rt_streams_memory_write(rt_stream_if* stream, const void*...
  function rt_streams_read_only (line 33) | static void rt_streams_read_only(rt_stream_memory_if* s,
  function rt_streams_write_only (line 45) | static void rt_streams_write_only(rt_stream_memory_if* s,
  function rt_streams_read_write (line 57) | static void rt_streams_read_write(rt_stream_memory_if* s,
  function rt_streams_test (line 73) | static void rt_streams_test(void) {
  function rt_streams_test (line 100) | static void rt_streams_test(void) { }

FILE: src/rt/rt_threads.c
  function rt_event_t (line 6) | static rt_event_t rt_event_create(void) {
  function rt_event_t (line 12) | static rt_event_t rt_event_create_manual(void) {
  function rt_event_set (line 18) | static void rt_event_set(rt_event_t e) {
  function rt_event_reset (line 22) | static void rt_event_reset(rt_event_t e) {
  function rt_event_wait_or_timeout (line 26) | static int32_t rt_event_wait_or_timeout(rt_event_t e, fp64_t seconds) {
  function rt_event_wait (line 35) | static void rt_event_wait(rt_event_t e) { rt_event_wait_or_timeout(e, -1...
  function rt_event_wait_any_or_timeout (line 37) | static int32_t rt_event_wait_any_or_timeout(int32_t n,
  function rt_event_wait_any (line 49) | static int32_t rt_event_wait_any(int32_t n, rt_event_t e[]) {
  function rt_event_dispose (line 53) | static void rt_event_dispose(rt_event_t h) {
  function rt_event_test_check_time (line 62) | static void rt_event_test_check_time(fp64_t start, fp64_t expected) {
  function rt_event_test (line 69) | static void rt_event_test(void) {
  function rt_event_test (line 108) | static void rt_event_test(void) { }
  function rt_mutex_init (line 129) | static void rt_mutex_init(rt_mutex_t* m) {
  function rt_mutex_lock (line 134) | static void rt_mutex_lock(rt_mutex_t* m) {
  function rt_mutex_unlock (line 138) | static void rt_mutex_unlock(rt_mutex_t* m) {
  function rt_mutex_dispose (line 142) | static void rt_mutex_dispose(rt_mutex_t* m) {
  function rt_mutex_test_check_time (line 149) | static void rt_mutex_test_check_time(fp64_t start, fp64_t expected) {
  function rt_mutex_test_lock_unlock (line 156) | static void rt_mutex_test_lock_unlock(void* arg) {
  function rt_mutex_test (line 163) | static void rt_mutex_test(void) {
  function fp64_t (line 206) | static fp64_t rt_thread_ns2ms(int64_t ns) {
  function rt_thread_set_timer_resolution (line 210) | static void rt_thread_set_timer_resolution(uint64_t nanoseconds) {
  function rt_thread_power_throttling_disable_for_process (line 251) | static void rt_thread_power_throttling_disable_for_process(void) {
  function rt_thread_power_throttling_disable_for_thread (line 272) | static void rt_thread_power_throttling_disable_for_thread(HANDLE thread) {
  function rt_thread_disable_power_throttling (line 281) | static void rt_thread_disable_power_throttling(void) {
  function rt_thread_next_physical_processor_affinity_mask (line 300) | static uint64_t rt_thread_next_physical_processor_affinity_mask(void) {
  function rt_thread_realtime (line 346) | static void rt_thread_realtime(void) {
  function rt_thread_yield (line 360) | static void rt_thread_yield(void) { SwitchToThread(); }
  function rt_thread_t (line 362) | static rt_thread_t rt_thread_start(void (*func)(void*), void* p) {
  function is_handle_valid (line 369) | static bool is_handle_valid(void* h) {
  function errno_t (line 374) | static errno_t rt_thread_join(rt_thread_t t, fp64_t timeout) {
  function rt_thread_detach (line 389) | static void rt_thread_detach(rt_thread_t t) {
  function rt_thread_name (line 395) | static void rt_thread_name(const char* name) {
  function rt_thread_sleep_for (line 404) | static void rt_thread_sleep_for(fp64_t seconds) {
  function rt_thread_id_of (line 425) | static uint64_t rt_thread_id_of(rt_thread_t t) {
  function rt_thread_id (line 429) | static uint64_t rt_thread_id(void) {
  function rt_thread_t (line 433) | static rt_thread_t rt_thread_self(void) {
  function errno_t (line 441) | static errno_t rt_thread_open(rt_thread_t *t, uint64_t id) {
  function rt_thread_close (line 449) | static void rt_thread_close(rt_thread_t t) {
  type rt_thread_philosophers_t (line 458) | typedef struct rt_thread_philosophers_s rt_thread_philosophers_t;
  type rt_thread_philosopher_t (line 460) | typedef struct {
  type rt_thread_philosophers_t (line 469) | typedef struct rt_thread_philosophers_s {
  function rt_thread_philosopher_think (line 484) | static void rt_thread_philosopher_think(rt_thread_philosopher_t* p) {
  function rt_thread_philosopher_eat (line 491) | static void rt_thread_philosopher_eat(rt_thread_philosopher_t* p) {
  function rt_thread_philosopher_routine (line 510) | static void rt_thread_philosopher_routine(void* arg) {
  function rt_thread_detached_sleep (line 537) | static void rt_thread_detached_sleep(void* rt_unused(p)) {
  function rt_thread_detached_loop (line 541) | static void rt_thread_detached_loop(void* rt_unused(p)) {
  function rt_thread_test (line 548) | static void rt_thread_test(void) {
  function rt_thread_test (line 598) | static void rt_thread_test(void) { }

FILE: src/rt/rt_vigil.c
  function rt_vigil_breakpoint_and_abort (line 5) | static void rt_vigil_breakpoint_and_abort(void) {
  function rt_vigil_failed_assertion (line 11) | static int32_t rt_vigil_failed_assertion(const char* file, int32_t line,
  function rt_vigil_fatal_termination_va (line 24) | static int32_t rt_vigil_fatal_termination_va(const char* file, int32_t l...
  function rt_vigil_fatal_termination (line 46) | static int32_t rt_vigil_fatal_termination(const char* file, int32_t line,
  function rt_vigil_fatal_if_error (line 55) | static int32_t rt_vigil_fatal_if_error(const char* file, int32_t line,
  function rt_vigil_test_failed_assertion (line 76) | static int32_t rt_vigil_test_failed_assertion(const char* file, int32_t ...
  function rt_vigil_test_fatal_termination (line 97) | static int32_t rt_vigil_test_fatal_termination(const char* file, int32_t...
  function rt_vigil_test (line 127) | static void rt_vigil_test(void) {
  function rt_vigil_test (line 157) | static void rt_vigil_test(void) { }

FILE: src/rt/rt_win32.c
  function rt_win32_close_handle (line 4) | void rt_win32_close_handle(void* h) {
  function errno_t (line 14) | errno_t rt_wait_ix2e(uint32_t r) {

FILE: src/rt/rt_work.c
  function rt_work_queue_no_duplicates (line 3) | static void rt_work_queue_no_duplicates(rt_work_t* w) {
  function rt_work_queue_post (line 13) | static void rt_work_queue_post(rt_work_t* w) {
  function rt_work_queue_cancel (line 37) | static void rt_work_queue_cancel(rt_work_t* w) {
  function rt_work_queue_flush (line 65) | static void rt_work_queue_flush(rt_work_queue_t* q) {
  function rt_work_queue_get (line 69) | static bool rt_work_queue_get(rt_work_queue_t* q, rt_work_t* *r) {
  function rt_work_queue_call (line 84) | static void rt_work_queue_call(rt_work_t* w) {
  function rt_work_queue_dispatch (line 89) | static void rt_work_queue_dispatch(rt_work_queue_t* q) {
  function rt_worker_thread (line 103) | static void rt_worker_thread(void* p) {
  function rt_worker_start (line 124) | static void rt_worker_start(rt_worker_t* worker) {
  function errno_t (line 133) | static errno_t rt_worker_join(rt_worker_t* worker, fp64_t to) {
  function rt_worker_post (line 147) | static void rt_worker_post(rt_worker_t* worker, rt_work_t* w) {
  function rt_never_called (line 171) | static void rt_never_called(rt_work_t* rt_unused(w)) {
  function rt_work_queue_test_1 (line 175) | static void rt_work_queue_test_1(void) {
  function rt_every_millisecond (line 217) | static void rt_every_millisecond(rt_work_t* w) {
  function rt_work_queue_test_2 (line 231) | static void rt_work_queue_test_2(void) {
  type rt_work_ex_t (line 257) | typedef struct rt_work_ex_s {
  function rt_every_other_millisecond (line 268) | static void rt_every_other_millisecond(rt_work_t* w) {
  function rt_work_queue_test_3 (line 284) | static void rt_work_queue_test_3(void) {
  function rt_work_queue_test (line 308) | static void rt_work_queue_test(void) {
  function rt_test_do_work (line 317) | static void rt_test_do_work(rt_work_t* rt_unused(w)) {
  function rt_worker_test (line 321) | static void rt_worker_test(void) {
  function rt_work_queue_test (line 356) | static void rt_work_queue_test(void) {}
  function rt_worker_test (line 357) | static void rt_worker_test(void) {}

FILE: src/samples/edit.test.c
  type ui_edit_lorem_ipsum_generator_params_t (line 118) | typedef struct {
  function ui_edit_lorem_ipsum_generator (line 131) | static void ui_edit_lorem_ipsum_generator(ui_edit_lorem_ipsum_generator_...
  function ui_edit_init_with_lorem_ipsum (line 194) | void ui_edit_init_with_lorem_ipsum(ui_edit_text_t* t) {

FILE: src/samples/groot/groot.c
  function init_image (line 35) | static void init_image(ui_bitmap_t* i, const uint8_t* data, int64_t byte...
  function init_gs (line 45) | static void init_gs(void) {
  function panel_erase (line 62) | static void panel_erase(ui_view_t* v) {
  function gs_erase (line 66) | static void gs_erase(ui_view_t* v) {
  function slider_format (line 70) | static void slider_format(ui_view_t* v) {
  function slider_callback (line 75) | static void slider_callback(ui_view_t* v) {
  function init_images (line 81) | static void init_images(void) {
  function init_text (line 99) | static void init_text(void) {
  function ui_view_t (line 122) | static ui_view_t* align(ui_view_t* v, int32_t align) {
  function ui_view_t (line 127) | static ui_view_t* fill_parent(ui_view_t* v) {
  function opened (line 133) | static void opened(void) {
  function closed (line 228) | static void closed(void) {

FILE: src/samples/sample1.c
  function every_sec (line 28) | static void every_sec(ui_view_t* rt_unused(v)) {
  function tap (line 36) | static bool tap(ui_view_t* v, int32_t ix, bool pressed) {
  function long_press (line 42) | static bool long_press(ui_view_t* v, int32_t ix) {
  function double_tap (line 48) | static bool double_tap(ui_view_t* v, int32_t ix) {
  function opened (line 54) | static void opened(void) {
  function init (line 65) | static void init(void) {

FILE: src/samples/sample2.c
  function hit_test (line 5) | static int64_t hit_test(const ui_view_t* v, ui_point_t pt) {
  function opened (line 20) | static void opened(void) {
  function character (line 34) | static void character(ui_view_t* rt_unused(v), const char* utf8) {
  function key_pressed (line 41) | static bool key_pressed(ui_view_t* rt_unused(v), int64_t key) {
  function init (line 47) | static void init(void) {

FILE: src/samples/sample3.c
  function toggle_full_screen (line 17) | static void toggle_full_screen(ui_button_t* b) {
  function paint (line 28) | static void paint(ui_view_t* view) {
  function request_rendering (line 46) | static void request_rendering(void) {
  function stop_rendering (line 52) | static void stop_rendering(void) {
  function measure (line 60) | static void measure(ui_view_t* view) {
  function layout (line 77) | static void layout(ui_view_t* v) {
  function character (line 84) | static void character(ui_view_t* rt_unused(view), const char* utf8) {
  function closed (line 92) | static void closed(void) {
  function fini (line 100) | static void fini(void) {
  function opened (line 107) | static void opened(void) {
  function init (line 128) | static void init(void) {
  function fp64_t (line 146) | static fp64_t scale(int32_t x, int32_t n, fp64_t low, fp64_t hi) {
  function mandelbrot (line 150) | static void mandelbrot(ui_bitmap_t* im) {
  function renderer (line 187) | static void renderer(void* unused) {

FILE: src/samples/sample4.c
  function console (line 14) | static int  console(void) {
  function load_images (line 35) | static void load_images(void) {
  function paint (line 58) | static void paint(ui_view_t* view) {
  function download (line 77) | static void download(void) {
  function init (line 92) | static void init(void) {

FILE: src/samples/sample5.c
  function focused (line 30) | static int32_t focused(void) {
  function focus_back_to_edit (line 44) | static void focus_back_to_edit(void) {
  function scaled_fonts (line 52) | static void scaled_fonts(void) {
  function font_plus (line 134) | static void font_plus(void) {
  function font_minus (line 142) | static void font_minus(void) {
  function font_reset (line 150) | static void font_reset(void) {
  function set_text (line 162) | static void set_text(int32_t ix) {
  function paint (line 184) | static void paint(ui_view_t* v) {
  function open_file (line 204) | static void open_file(const char* pathname) {
  function every_100ms (line 221) | static void every_100ms(void) {
  function key_pressed (line 228) | static bool key_pressed(ui_view_t* rt_unused(view), int64_t key) {
  function edit_enter (line 256) | static void edit_enter(ui_edit_view_t* e) {
  function can_close (line 267) | static bool can_close(void) {
  function opened (line 276) | static void opened(void) {
  function init (line 345) | static void init(void) {

FILE: src/samples/sample6.c
  type animated_gif_t (line 16) | typedef struct animated_gif_s {
  type animation_t (line 27) | typedef struct animation_s {
  function paint_groot (line 69) | static void paint_groot(animation_t* a) {
  function paint_movie (line 81) | static void paint_movie(animation_t* a) {
  function paint_mute_unmute (line 89) | static void paint_mute_unmute(ui_view_t* v) {
  function paint (line 105) | static void paint(ui_view_t* v) {
  function character (line 116) | static void character(ui_view_t* rt_unused(v), const char* utf8) {
  function tap (line 122) | static bool tap(ui_view_t* rt_unused(v), int32_t ix, bool pressed) {
  function notify (line 143) | static int64_t notify(ui_midi_t* m, int64_t f) { // f: f
  function stop_and_close (line 163) | static void stop_and_close(void) {
  function open_and_play (line 173) | static void open_and_play(void) {
  function delete_midi_file (line 188) | static void delete_midi_file(void) {
  function load_gif (line 192) | static void load_gif(animated_gif_t* g, const char* name) {
  function load_gifs (line 205) | static void load_gifs(void) {
  function schedule_next_animation (line 215) | static void schedule_next_animation(rt_work_t* work) {
  function dancing_step (line 224) | static void dancing_step(rt_work_t* work) {
  function movie_step (line 281) | static void movie_step(rt_work_t* work) {
  function animated_gifs_loader (line 299) | static void animated_gifs_loader(void* rt_unused(unused)) {
  function load_png (line 312) | static void load_png(void) { // from resources
  function start_music (line 328) | static void start_music(rt_work_t* rt_unused(w)) {
  function opened (line 332) | static void opened(void) {
  function closed (line 344) | static void closed(void) {
  function init (line 354) | static void init(void) {
  function fini (line 364) | static void fini(void) {

FILE: src/samples/sample7.c
  type time_stats_t (line 14) | typedef struct {
  function composed (line 31) | static void composed(ui_view_t* view) {
  function stats (line 36) | static void stats(int32_t ix) {
  function print (line 65) | static void print(int32_t *x, int32_t *y, const char* format, ...) {
  function println (line 72) | static void println(int32_t *x, int32_t *y, const char* format, ...) {
  function graph (line 79) | static void graph(ui_view_t* v, int ix, ui_color_t c, int y) {
  function paint (line 103) | static void paint(ui_view_t* v) {
  function timer_thread (line 131) | static void timer_thread(void* p) {
  function timer (line 144) | static void timer(ui_view_t* view, ui_timer_t id) {
  function opened (line 156) | static void opened(void) {
  function detached_sleep (line 163) | static void detached_sleep(void* rt_unused(p)) {
  function detached_loop (line 167) | static void detached_loop(void* rt_unused(p)) {
  function closed (line 176) | static void closed(void) {
  function do_not_start_minimized (line 190) | static void do_not_start_minimized(void) {
  function init (line 200) | static void init(void) {

FILE: src/samples/sample8.c
  function fini (line 30) | static void fini(void) {
  function init (line 34) | static void init(void) {
  function tools (line 62) | static void tools(ui_button_t* b) {
  function switch_view (line 72) | static void switch_view(ui_button_t* b, int32_t ix,
  function stack (line 84) | static void stack(ui_button_t* b) {
  function span (line 88) | static void span(ui_button_t* b) {
  function list (line 92) | static void list(ui_button_t* b) {
  function controls (line 96) | static void controls(ui_button_t* b) {
  function edit1 (line 100) | static void edit1(ui_button_t* b) {
  function debug (line 104) | static void debug(ui_button_t* b) {
  function about (line 141) | static void about(ui_button_t* rt_unused(b)) {
  function crash (line 147) | static void crash(ui_button_t* rt_unused(b)) {
  function insert_into_caption (line 165) | static void insert_into_caption(ui_button_t* b, const char* hint) {
  function ui_app_root_composed (line 174) | static void ui_app_root_composed(ui_view_t* rt_unused(v)) {
  function opened (line 178) | static void opened(void) {
  function ui_view_t (line 269) | static ui_view_t* align(ui_view_t* v, int32_t align) {
  function stack_test (line 274) | static void stack_test(ui_view_t* parent) {
  function span_test (line 317) | static void span_test(ui_view_t* parent) {
  function list_test (line 355) | static void list_test(ui_view_t* parent) {
  function slider_format (line 395) | static void slider_format(ui_view_t* v) {
  function slider_callback (line 400) | static void slider_callback(ui_view_t* v) {
  function controls_set_margins (line 405) | static void controls_set_margins(ui_view_t* v, bool on_off) {
  function controls_margins (line 412) | static void controls_margins(ui_view_t* v) {
  function controls_set_fm (line 418) | static void controls_set_fm(ui_view_t* v, bool on_off) {
  function controls_fm (line 425) | static void controls_fm(ui_view_t* v) {
  function controls_set_large (line 431) | static void controls_set_large(ui_view_t* v, bool on_off) {
  function controls_large (line 438) | static void controls_large(ui_view_t* v) {
  function button_pressed (line 444) | static void button_pressed(ui_view_t* v) {
  function controls_test (line 454) | static void controls_test(ui_view_t* parent) {
  function edit1_test (line 536) | static void edit1_test(ui_view_t* parent) {

FILE: src/samples/sample9.c
  function mbx_callback (line 76) | static void mbx_callback(ui_view_t* v) {
  function open_file (line 97) | static void open_file(ui_button_t* rt_unused(b)) {
  function flip_full_clicked (line 110) | static void flip_full_clicked(ui_button_t* b) {
  function flip_locale (line 121) | static void flip_locale(ui_button_t* b) {
  function about_clicked (line 130) | static void about_clicked(ui_button_t* rt_unused(b)) {
  function scroll_toggle (line 141) | static void scroll_toggle(ui_button_t* rt_unused(b)) {
  function print (line 156) | static void print(int32_t *x, int32_t *y, const char* format, ...) {
  function println (line 163) | static void println(int32_t *x, int32_t *y, const char* format, ...) {
  function after (line 170) | static void after(ui_view_t* v, const char* format, ...) {
  function panel_paint (line 180) | static void panel_paint(ui_view_t* v) {
  function right_layout (line 210) | static void right_layout(ui_view_t* v) {
  function right_paint (line 220) | static void right_paint(ui_view_t* v) {
  function center_paint (line 275) | static void center_paint(ui_view_t* view) {
  function measure (line 286) | static void measure(ui_view_t* v) {
  function layout (line 304) | static void layout(ui_view_t* rt_unused(view)) {
  function zoom_out (line 319) | static void zoom_out(void) {
  function zoom_in (line 327) | static void zoom_in(int x, int y) {
  function tap (line 337) | static bool tap(ui_view_t* rt_unused(v), int32_t ix, bool pressed) {
  function slider_format (line 354) | static void slider_format(ui_view_t* v) {
  function zoomer_callback (line 359) | static void zoomer_callback(ui_view_t* v) {
  function mouse_scroll (line 368) | static void mouse_scroll(ui_view_t* unused, ui_point_t dx_dy) {
  function character (line 377) | static void character(ui_view_t* view, const char* utf8) {
  function keyboard (line 398) | static bool keyboard(ui_view_t* view, int64_t vk) {
  function init_panel (line 418) | static void init_panel(ui_view_t* panel, const char* text, ui_color_t co...
  function opened (line 425) | static void opened(void) {
  function init (line 479) | static void init(void) {
  function fp64_t (line 484) | static fp64_t scale0to1(int v, int range, fp64_t sh, fp64_t zm) {
  function fp64_t (line 488) | static fp64_t into(fp64_t v, fp64_t lo, fp64_t hi) {
  function mandelbrot (line 493) | static void mandelbrot(ui_bitmap_t* im) {
  function refresh (line 528) | static void refresh(void) {

FILE: src/samples/stb_image.c
  function stb_free (line 30) | static void  stb_free(void* p) {

FILE: src/samples/stb_image.h
  type stbi_uc (line 386) | typedef unsigned char stbi_uc;
  type stbi_us (line 387) | typedef unsigned short stbi_us;
  type stbi_io_callbacks (line 410) | typedef struct
  type stbi__uint16 (line 641) | typedef unsigned short stbi__uint16;
  type stbi__int16 (line 642) | typedef   signed short stbi__int16;
  type stbi__uint32 (line 643) | typedef unsigned int   stbi__uint32;
  type stbi__int32 (line 644) | typedef   signed int   stbi__int32;
  type stbi__uint16 (line 647) | typedef uint16_t stbi__uint16;
  type stbi__int16 (line 648) | typedef int16_t  stbi__int16;
  type stbi__uint32 (line 649) | typedef uint32_t stbi__uint32;
  type stbi__int32 (line 650) | typedef int32_t  stbi__int32;
  function stbi__cpuid3 (line 731) | static int stbi__cpuid3(void)
  function stbi__sse2_available (line 753) | static int stbi__sse2_available(void)
  function stbi__sse2_available (line 764) | static int stbi__sse2_available(void)
  type stbi__context (line 804) | typedef struct
  function stbi__start_mem (line 825) | static void stbi__start_mem(stbi__context *s, stbi_uc const *buffer, int...
  function stbi__start_callbacks (line 835) | static void stbi__start_callbacks(stbi__context *s, stbi_io_callbacks *c...
  function stbi__stdio_read (line 849) | static int stbi__stdio_read(void *user, char *data, int size)
  function stbi__stdio_skip (line 854) | static void stbi__stdio_skip(void *user, int n)
  function stbi__stdio_eof (line 864) | static int stbi__stdio_eof(void *user)
  function stbi__start_file (line 876) | static void stbi__start_file(stbi__context *s, FILE *f)
  function stbi__rewind (line 885) | static void stbi__rewind(stbi__context *s)
  type stbi__result_info (line 900) | typedef struct
  function STBIDEF (line 971) | STBIDEF const char *stbi_failure_reason(void)
  function stbi__err (line 977) | static int stbi__err(const char *str)
  function stbi__addsizes_valid (line 1001) | static int stbi__addsizes_valid(int a, int b)
  function stbi__mul2sizes_valid (line 1013) | static int stbi__mul2sizes_valid(int a, int b)
  function stbi__mad2sizes_valid (line 1023) | static int stbi__mad2sizes_valid(int a, int b, int add)
  function stbi__mad3sizes_valid (line 1030) | static int stbi__mad3sizes_valid(int a, int b, int c, int add)
  function stbi__mad4sizes_valid (line 1038) | static int stbi__mad4sizes_valid(int a, int b, int c, int d, int add)
  function stbi__addints_valid (line 1069) | static int stbi__addints_valid(int a, int b)
  function stbi__mul2shorts_valid (line 1077) | static int stbi__mul2shorts_valid(int a, int b)
  function STBIDEF (line 1100) | STBIDEF void stbi_image_free(void *retval_from_stbi_load)
  function STBIDEF (line 1115) | STBIDEF void stbi_set_flip_vertically_on_load(int flag_true_if_should_flip)
  function STBIDEF (line 1125) | STBIDEF void stbi_set_flip_vertically_on_load_thread(int flag_true_if_sh...
  function stbi_uc (line 1189) | static stbi_uc *stbi__convert_16_to_8(stbi__uint16 *orig, int w, int h, ...
  function stbi__uint16 (line 1205) | static stbi__uint16 *stbi__convert_8_to_16(stbi_uc *orig, int w, int h, ...
  function stbi__vertical_flip (line 1221) | static void stbi__vertical_flip(void *image, int w, int h, int bytes_per...
  function stbi__vertical_flip_slices (line 1246) | static void stbi__vertical_flip_slices(void *image, int w, int h, int z,...
  function stbi__uint16 (line 1285) | static stbi__uint16 *stbi__load_and_postprocess_16bit(stbi__context *s, ...
  function stbi__float_postprocess (line 1313) | static void stbi__float_postprocess(float *result, int *x, int *y, int *...
  function STBIDEF (line 1330) | STBIDEF int stbi_convert_wchar_to_utf8(char *buffer, size_t bufferlen, c...
  function FILE (line 1336) | static FILE *stbi__fopen(char const *filename, char const *mode)
  function STBIDEF (line 1365) | STBIDEF stbi_uc *stbi_load(char const *filename, int *x, int *y, int *co...
  function STBIDEF (line 1375) | STBIDEF stbi_uc *stbi_load_from_file(FILE *f, int *x, int *y, int *comp,...
  function STBIDEF (line 1388) | STBIDEF stbi__uint16 *stbi_load_from_file_16(FILE *f, int *x, int *y, in...
  function STBIDEF (line 1401) | STBIDEF stbi_us *stbi_load_16(char const *filename, int *x, int *y, int ...
  function STBIDEF (line 1414) | STBIDEF stbi_us *stbi_load_16_from_memory(stbi_uc const *buffer, int len...
  function STBIDEF (line 1421) | STBIDEF stbi_us *stbi_load_16_from_callbacks(stbi_io_callbacks const *cl...
  function STBIDEF (line 1428) | STBIDEF stbi_uc *stbi_load_from_memory(stbi_uc const *buffer, int len, i...
  function STBIDEF (line 1435) | STBIDEF stbi_uc *stbi_load_from_callbacks(stbi_io_callbacks const *clbk,...
  function STBIDEF (line 1443) | STBIDEF stbi_uc *stbi_load_gif_from_memory(stbi_uc const *buffer, int le...
  function STBIDEF (line 1477) | STBIDEF float *stbi_loadf_from_memory(stbi_uc const *buffer, int len, in...
  function STBIDEF (line 1484) | STBIDEF float *stbi_loadf_from_callbacks(stbi_io_callbacks const *clbk, ...
  function STBIDEF (line 1492) | STBIDEF float *stbi_loadf(char const *filename, int *x, int *y, int *com...
  function STBIDEF (line 1502) | STBIDEF float *stbi_loadf_from_file(FILE *f, int *x, int *y, int *comp, ...
  function STBIDEF (line 1516) | STBIDEF int stbi_is_hdr_from_memory(stbi_uc const *buffer, int len)
  function STBIDEF (line 1530) | STBIDEF int      stbi_is_hdr          (char const *filename)
  function STBIDEF (line 1541) | STBIDEF int stbi_is_hdr_from_file(FILE *f)
  function STBIDEF (line 1558) | STBIDEF int      stbi_is_hdr_from_callbacks(stbi_io_callbacks const *clb...
  function STBIDEF (line 1574) | STBIDEF void   stbi_ldr_to_hdr_gamma(float gamma) { stbi__l2h_gamma = ga...
  function STBIDEF (line 1575) | STBIDEF void   stbi_ldr_to_hdr_scale(float scale) { stbi__l2h_scale = sc...
  function STBIDEF (line 1580) | STBIDEF void   stbi_hdr_to_ldr_gamma(float gamma) { stbi__h2l_gamma_i = ...
  function STBIDEF (line 1581) | STBIDEF void   stbi_hdr_to_ldr_scale(float scale) { stbi__h2l_scale_i = ...
  function stbi__refill_buffer (line 1596) | static void stbi__refill_buffer(stbi__context *s)
  function stbi_inline (line 1613) | stbi_inline static stbi_uc stbi__get8(stbi__context *s)
  function stbi_inline (line 1627) | stbi_inline static int stbi__at_eof(stbi__context *s)
  function stbi__skip (line 1643) | static void stbi__skip(stbi__context *s, int n)
  function stbi__getn (line 1665) | static int stbi__getn(stbi__context *s, stbi_uc *buffer, int n)
  function stbi__get16be (line 1693) | static int stbi__get16be(stbi__context *s)
  function stbi__uint32 (line 1703) | static stbi__uint32 stbi__get32be(stbi__context *s)
  function stbi__get16le (line 1713) | static int stbi__get16le(stbi__context *s)
  function stbi__uint32 (line 1721) | static stbi__uint32 stbi__get32le(stbi__context *s)
  function stbi_uc (line 1745) | static stbi_uc stbi__compute_y(int r, int g, int b)
  function stbi__uint16 (line 1802) | static stbi__uint16 stbi__compute_y_16(int r, int g, int b)
  function stbi__uint16 (line 1811) | static stbi__uint16 *stbi__convert_format16(stbi__uint16 *data, int img_...
  function stbi_uc (line 1883) | static stbi_uc *stbi__hdr_to_ldr(float   *data, int x, int y, int comp)
  type stbi__huffman (line 1937) | typedef struct
  type stbi__jpeg (line 1948) | typedef struct
  function stbi__build_huffman (line 2002) | static int stbi__build_huffman(stbi__huffman *h, int *count)
  function stbi__build_fast_ac (line 2049) | static void stbi__build_fast_ac(stbi__int16 *fast_ac, stbi__huffman *h)
  function stbi__grow_buffer_unsafe (line 2074) | static void stbi__grow_buffer_unsafe(stbi__jpeg *j)
  function stbi_inline (line 2096) | stbi_inline static int stbi__jpeg_huff_decode(stbi__jpeg *j, stbi__huffm...
  function stbi_inline (line 2152) | stbi_inline static int stbi__extend_receive(stbi__jpeg *j, int n)
  function stbi_inline (line 2168) | stbi_inline static int stbi__jpeg_get_bits(stbi__jpeg *j, int n)
  function stbi_inline (line 2180) | stbi_inline static int stbi__jpeg_get_bit(stbi__jpeg *j)
  function stbi__jpeg_decode_block (line 2209) | static int stbi__jpeg_decode_block(stbi__jpeg *j, short data[64], stbi__...
  function stbi__jpeg_decode_block_prog_dc (line 2264) | static int stbi__jpeg_decode_block_prog_dc(stbi__jpeg *j, short data[64]...
  function stbi__jpeg_decode_block_prog_ac (line 2294) | static int stbi__jpeg_decode_block_prog_ac(stbi__jpeg *j, short data[64]...
  function stbi_inline (line 2415) | stbi_inline static stbi_uc stbi__clamp(int x)
  function stbi__idct_block (line 2466) | static void stbi__idct_block(stbi_uc *out, int ort_stride, short data[64])
  function stbi__idct_simd (line 2529) | static void stbi__idct_simd(stbi_uc *out, int ort_stride, short data[64])
  function stbi__idct_simd (line 2710) | static void stbi__idct_simd(stbi_uc *out, int ort_stride, short data[64])
  function stbi_uc (line 2918) | static stbi_uc stbi__get_marker(stbi__jpeg *j)
  function stbi__jpeg_reset (line 2935) | static void stbi__jpeg_reset(stbi__jpeg *j)
  function stbi__parse_entropy_coded_data (line 2948) | static int stbi__parse_entropy_coded_data(stbi__jpeg *z)
  function stbi__jpeg_dequantize (line 3072) | static void stbi__jpeg_dequantize(short *data, stbi__uint16 *dequant)
  function stbi__jpeg_finish (line 3079) | static void stbi__jpeg_finish(stbi__jpeg *z)
  function stbi__process_marker (line 3098) | static int stbi__process_marker(stbi__jpeg *z, int m)
  function stbi__process_scan_header (line 3202) | static int stbi__process_scan_header(stbi__jpeg *z)
  function stbi__free_jpeg_components (line 3241) | static int stbi__free_jpeg_components(stbi__jpeg *z, int ncomp, int why)
  function stbi__process_frame_header (line 3263) | static int stbi__process_frame_header(stbi__jpeg *z, int scan)
  function stbi__decode_jpeg_header (line 3364) | static int stbi__decode_jpeg_header(stbi__jpeg *z, int scan)
  function stbi_uc (line 3388) | static stbi_uc stbi__skip_jpeg_junk_at_end(stbi__jpeg *j)
  function stbi__decode_jpeg_image (line 3411) | static int stbi__decode_jpeg_image(stbi__jpeg *j)
  type stbi_uc (line 3450) | typedef stbi_uc *(*resample_row_func)(stbi_uc *out, stbi_uc *in0, stbi_u...
  function stbi_uc (line 3455) | static stbi_uc *resample_row_1(stbi_uc *out, stbi_uc *in_near, stbi_uc *...
  function stbi_uc (line 3464) | static stbi_uc* stbi__resample_row_v_2(stbi_uc *out, stbi_uc *in_near, s...
  function stbi_uc (line 3474) | static stbi_uc*  stbi__resample_row_h_2(stbi_uc *out, stbi_uc *in_near, ...
  function stbi_uc (line 3504) | static stbi_uc *stbi__resample_row_hv_2(stbi_uc *out, stbi_uc *in_near, ...
  function stbi_uc (line 3529) | static stbi_uc *stbi__resample_row_hv_2_simd(stbi_uc *out, stbi_uc *in_n...
  function stbi_uc (line 3645) | static stbi_uc *stbi__resample_row_generic(stbi_uc *out, stbi_uc *in_nea...
  function stbi__YCbCr_to_RGB_row (line 3659) | static void stbi__YCbCr_to_RGB_row(stbi_uc *out, const stbi_uc *y, const...
  function stbi__YCbCr_to_RGB_simd (line 3685) | static void stbi__YCbCr_to_RGB_simd(stbi_uc *out, stbi_uc const *y, stbi...
  function stbi__setup_jpeg (line 3820) | static void stbi__setup_jpeg(stbi__jpeg *j)
  function stbi__cleanup_jpeg (line 3842) | static void stbi__cleanup_jpeg(stbi__jpeg *j)
  type stbi__resample (line 3847) | typedef struct
  function stbi_uc (line 3858) | static stbi_uc stbi__blinn_8x8(stbi_uc x, stbi_uc y)
  function stbi_uc (line 3864) | static stbi_uc *load_jpeg_image(stbi__jpeg *z, int *out_x, int *out_y, i...
  function stbi__jpeg_test (line 4041) | static int stbi__jpeg_test(stbi__context *s)
  function stbi__jpeg_info_raw (line 4055) | static int stbi__jpeg_info_raw(stbi__jpeg *j, int *x, int *y, int *comp)
  function stbi__jpeg_info (line 4067) | static int stbi__jpeg_info(stbi__context *s, int *x, int *y, int *comp)
  type stbi__zhuffman (line 4096) | typedef struct
  function stbi_inline (line 4106) | stbi_inline static int stbi__bitreverse16(int n)
  function stbi_inline (line 4115) | stbi_inline static int stbi__bit_reverse(int v, int bits)
  function stbi__zbuild_huffman (line 4123) | static int stbi__zbuild_huffman(stbi__zhuffman *z, const stbi_uc *sizeli...
  type stbi__zbuf (line 4176) | typedef struct
  function stbi_inline (line 4191) | stbi_inline static int stbi__zeof(stbi__zbuf *z)
  function stbi_inline (line 4196) | stbi_inline static stbi_uc stbi__zget8(stbi__zbuf *z)
  function stbi__fill_bits (line 4201) | static void stbi__fill_bits(stbi__zbuf *z)
  function stbi__zreceive (line 4213) | int stbi__zreceive(stbi__zbuf *z, int n)
  function stbi__zhuffman_decode_slowpath (line 4223) | static int stbi__zhuffman_decode_slowpath(stbi__zbuf *a, stbi__zhuffman *z)
  function stbi_inline (line 4242) | stbi_inline static int stbi__zhuffman_decode(stbi__zbuf *a, stbi__zhuffm...
  function stbi__zexpand (line 4272) | static int stbi__zexpand(stbi__zbuf *z, char *zout, int n)  // need to m...
  function stbi__parse_huffman_block (line 4308) | static int stbi__parse_huffman_block(stbi__zbuf *a)
  function stbi__compute_huffman_codes (line 4358) | static int stbi__compute_huffman_codes(stbi__zbuf *a)
  function stbi__parse_uncompressed_block (line 4408) | static int stbi__parse_uncompressed_block(stbi__zbuf *a)
  function stbi__parse_zlib_header (line 4437) | static int stbi__parse_zlib_header(stbi__zbuf *a)
  function stbi__parse_zlib (line 4480) | static int stbi__parse_zlib(stbi__zbuf *a, int parse_header)
  function stbi__do_zlib (line 4509) | static int stbi__do_zlib(stbi__zbuf *a, char *obuf, int olen, int exp, i...
  function STBIDEF (line 4519) | STBIDEF char *stbi_zlib_decode_malloc_guesssize(const char *buffer, int ...
  function STBIDEF (line 4535) | STBIDEF char *stbi_zlib_decode_malloc(char const *buffer, int len, int *...
  function STBIDEF (line 4540) | STBIDEF char *stbi_zlib_decode_malloc_guesssize_headerflag(const char *b...
  function STBIDEF (line 4556) | STBIDEF int stbi_zlib_decode_buffer(char *obuffer, int olen, char const ...
  function STBIDEF (line 4567) | STBIDEF char *stbi_zlib_decode_noheader_malloc(char const *buffer, int l...
  function STBIDEF (line 4583) | STBIDEF int stbi_zlib_decode_noheader_buffer(char *obuffer, int olen, co...
  type stbi__pngchunk (line 4606) | typedef struct
  function stbi__pngchunk (line 4612) | static stbi__pngchunk stbi__get_chunk_header(stbi__context *s)
  function stbi__check_png_header (line 4620) | static int stbi__check_png_header(stbi__context *s)
  type stbi__png (line 4629) | typedef struct
  function stbi__paeth (line 4656) | static int stbi__paeth(int a, int b, int c)
  function stbi__create_png_alpha_expand8 (line 4674) | static void stbi__create_png_alpha_expand8(stbi_uc *dest, stbi_uc *src, ...
  function stbi__create_png_image_raw (line 4695) | static int stbi__create_png_image_raw(stbi__png *a, stbi_uc *raw, stbi__...
  function stbi__create_png_image (line 4860) | static int stbi__create_png_image(stbi__png *a, stbi_uc *image_data, stb...
  function stbi__compute_transparency (line 4905) | static int stbi__compute_transparency(stbi__png *z, stbi_uc tc[3], int o...
  function stbi__compute_transparency16 (line 4930) | static int stbi__compute_transparency16(stbi__png *z, stbi__uint16 tc[3]...
  function stbi__expand_png_palette (line 4955) | static int stbi__expand_png_palette(stbi__png *a, stbi_uc *palette, int ...
  function STBIDEF (line 4995) | STBIDEF void stbi_set_unpremultiply_on_load(int flag_true_if_should_unpr...
  function STBIDEF (line 5000) | STBIDEF void stbi_convert_iphone_png_to_rgb(int flag_true_if_should_conv...
  function STBIDEF (line 5012) | STBIDEF void stbi_set_unpremultiply_on_load_thread(int flag_true_if_shou...
  function STBIDEF (line 5018) | STBIDEF void stbi_convert_iphone_png_to_rgb_thread(int flag_true_if_shou...
  function stbi__de_iphone (line 5032) | static void stbi__de_iphone(stbi__png *z)
  function stbi__parse_png_file (line 5077) | static int stbi__parse_png_file(stbi__png *z, int scan, int req_comp)
  function stbi__png_test (line 5299) | static int stbi__png_test(stbi__context *s)
  function stbi__png_info_raw (line 5307) | static int stbi__png_info_raw(stbi__png *p, int *x, int *y, int *comp)
  function stbi__png_info (line 5319) | static int stbi__png_info(stbi__context *s, int *x, int *y, int *comp)
  function stbi__png_is16 (line 5326) | static int stbi__png_is16(stbi__context *s)
  function stbi__bmp_test_raw (line 5343) | static int stbi__bmp_test_raw(stbi__context *s)
  function stbi__bmp_test (line 5358) | static int stbi__bmp_test(stbi__context *s)
  function stbi__high_bit (line 5367) | static int stbi__high_bit(unsigned int z)
  function stbi__bitcount (line 5379) | static int stbi__bitcount(unsigned int a)
  function stbi__shiftsigned (line 5392) | static int stbi__shiftsigned(unsigned int v, int shift, int bits)
  type stbi__bmp_data (line 5412) | typedef struct
  function stbi__bmp_set_mask_defaults (line 5419) | static int stbi__bmp_set_mask_defaults(stbi__bmp_data *info, int compress)
  function stbi__tga_get_comp (line 5736) | static int stbi__tga_get_comp(int bits_per_pixel, int is_grey, int* is_r...
  function stbi__tga_info (line 5752) | static int stbi__tga_info(stbi__context *s, int *x, int *y, int *comp)
  function stbi__tga_test (line 5817) | static int stbi__tga_test(stbi__context *s)
  function stbi__tga_read_rgb16 (line 5849) | static void stbi__tga_read_rgb16(stbi__context *s, stbi_uc* out)
  function stbi__psd_test (line 6078) | static int stbi__psd_test(stbi__context *s)
  function stbi__psd_decode_rle (line 6085) | static int stbi__psd_decode_rle(stbi__context *s, stbi_uc *p, int pixelC...
  function stbi__pic_is4 (line 6333) | static int stbi__pic_is4(stbi__context *s,const char *str)
  function stbi__pic_test_core (line 6343) | static int stbi__pic_test_core(stbi__context *s)
  type stbi__pic_packet (line 6359) | typedef struct
  function stbi_uc (line 6364) | static stbi_uc *stbi__readval(stbi__context *s, int channel, stbi_uc *dest)
  function stbi__copyval (line 6378) | static void stbi__copyval(int channel,stbi_uc *dest,const stbi_uc *src)
  function stbi_uc (line 6387) | static stbi_uc *stbi__pic_load_core(stbi__context *s,int width,int heigh...
  function stbi__pic_test (line 6538) | static int stbi__pic_test(stbi__context *s)
  type stbi__gif_lzw (line 6550) | typedef struct
  type stbi__gif (line 6557) | typedef struct
  function stbi__gif_test_raw (line 6577) | static int stbi__gif_test_raw(stbi__context *s)
  function stbi__gif_test (line 6587) | static int stbi__gif_test(stbi__context *s)
  function stbi__gif_parse_colortable (line 6594) | static void stbi__gif_parse_colortable(stbi__context *s, stbi_uc pal[256...
  function stbi__gif_header (line 6605) | static int stbi__gif_header(stbi__context *s, stbi__gif *g, int *comp, i...
  function stbi__gif_info_raw (line 6636) | static int stbi__gif_info_raw(stbi__context *s, int *x, int *y, int *comp)
  function stbi__out_gif_code (line 6651) | static void stbi__out_gif_code(stbi__gif *g, stbi__uint16 code)
  function stbi_uc (line 6688) | static stbi_uc *stbi__process_gif_raster(stbi__context *s, stbi__gif *g)
  function stbi_uc (line 6775) | static stbi_uc *stbi__gif_load_next(stbi__context *s, stbi__gif *g, int ...
  function stbi__gif_info (line 7074) | static int stbi__gif_info(stbi__context *s, int *x, int *y, int *comp)
  function stbi__hdr_test_core (line 7084) | static int stbi__hdr_test_core(stbi__context *s, const char *signature)
  function stbi__hdr_test (line 7094) | static int stbi__hdr_test(stbi__context* s)
  function stbi__hdr_convert (line 7128) | static void stbi__hdr_convert(float *output, stbi_uc *input, int req_comp)
  function stbi__hdr_info (line 7286) | static int stbi__hdr_info(stbi__context *s, int *x, int *y, int *comp)
  function stbi__bmp_info (line 7332) | static int stbi__bmp_info(stbi__context *s, int *x, int *y, int *comp)
  function stbi__psd_info (line 7356) | static int stbi__psd_info(stbi__context *s, int *x, int *y, int *comp)
  function stbi__psd_is16 (line 7391) | static int stbi__psd_is16(stbi__context *s)
  function stbi__pic_info (line 7420) | static int stbi__pic_info(stbi__context *s, int *x, int *y, int *comp)
  function stbi__pnm_test (line 7491) | static int      stbi__pnm_test(stbi__context *s)
  function stbi__pnm_isspace (line 7540) | static int      stbi__pnm_isspace(char c)
  function stbi__pnm_skip_whitespace (line 7545) | static void     stbi__pnm_skip_whitespace(stbi__context *s, char *c)
  function stbi__pnm_isdigit (line 7559) | static int      stbi__pnm_isdigit(char c)
  function stbi__pnm_getinteger (line 7564) | static int      stbi__pnm_getinteger(stbi__context *s, char *c)
  function stbi__pnm_info (line 7578) | static int      stbi__pnm_info(stbi__context *s, int *x, int *y, int *comp)
  function stbi__pnm_is16 (line 7621) | static int stbi__pnm_is16(stbi__context *s)
  function stbi__info_main (line 7629) | static int stbi__info_main(stbi__context *s, int *x, int *y, int *comp)
  function stbi__is_16_main (line 7671) | static int stbi__is_16_main(stbi__context *s)
  function STBIDEF (line 7688) | STBIDEF int stbi_info(char const *filename, int *x, int *y, int *comp)
  function STBIDEF (line 7698) | STBIDEF int stbi_info_from_file(FILE *f, int *x, int *y, int *comp)
  function STBIDEF (line 7709) | STBIDEF int stbi_is_16_bit(char const *filename)
  function STBIDEF (line 7719) | STBIDEF int stbi_is_16_bit_from_file(FILE *f)
  function STBIDEF (line 7731) | STBIDEF int stbi_info_from_memory(stbi_uc const *buffer, int len, int *x...
  function STBIDEF (line 7738) | STBIDEF int stbi_info_from_callbacks(stbi_io_callbacks const *c, void *u...
  function STBIDEF (line 7745) | STBIDEF int stbi_is_16_bit_from_memory(stbi_uc const *buffer, int len)
  function STBIDEF (line 7752) | STBIDEF int stbi_is_16_bit_from_callbacks(stbi_io_callbacks const *c, vo...

FILE: src/tools/amalgamate.c
  function ends_with (line 73) | static bool ends_with(const char* s1, const char* s2) {
  type set_t (line 79) | typedef struct { const char* a[1024]; int32_t n; } set_t;
  function set_has (line 84) | static bool set_has(set_t* set, const char* s) {
  function set_add (line 91) | static void set_add(set_t* set, const char* s) {
  function usage (line 100) | static int32_t usage(void) {
  function tail_trim (line 110) | static void tail_trim(char* s) {
  function divider (line 115) | static void divider(const char* fn) {
  function already_included (line 139) | static bool already_included(const char* s) {
  function ignore (line 147) | static bool ignore(const char* s) {
  function parse (line 151) | static void parse(const char* fn) {
  function definition (line 174) | static void definition(void) {
  function implementation (line 186) | static void implementation(void) {
  function main (line 204) | int main(int argc, const char* argv[]) {

FILE: src/tools/dirent.c
  type dir_t (line 17) | typedef struct dir_s {
  function DIR (line 23) | DIR *opendir(const char *dirname) {
  type dirent (line 38) | struct dirent
  type dirent (line 40) | struct dirent
  function closedir (line 51) | int closedir(DIR* dir) {

FILE: src/tools/dirent.h
  type DIR (line 11) | typedef struct DIR DIR;
  type dirent (line 13) | struct dirent { char d_name[NAME_MAX]; }
  type dirent (line 16) | struct dirent

FILE: src/tools/version.c
  function errno_t (line 20) | static errno_t run_command(const char* command, char* output, size_t max...
  function main (line 41) | int main(void) {

FILE: src/ui/attic/ui_theme.c
  function HMODULE (line 12) | static HMODULE ui_theme_ux_theme(void) {
  function errno_t (line 24) | static errno_t ui_theme_reg_get_uint32(HKEY root, const char* path,
  function errno_t (line 37) | static errno_t ui_theme_reg_get_bin(HKEY root, const char* path,
  type ui_theme_color_map_t (line 50) | typedef struct {
  function ui_theme_init_colors (line 75) | static void ui_theme_init_colors(void) {
  function ui_theme_use_light_theme (line 115) | static bool ui_theme_use_light_theme(const char* key) {
  function ui_theme_are_apps_light (line 122) | static bool ui_theme_are_apps_light(void) {
  function ui_theme_is_system_light (line 126) | static bool ui_theme_is_system_light(void) {
  function ui_color_t (line 130) | static ui_color_t ui_theme_get_color(int32_t color_id) {
  function ui_theme_refresh (line 148) | static void ui_theme_refresh(void* window) {
  function ui_theme_is_dark_mode_allowed_for_app (line 164) | static bool ui_theme_is_dark_mode_allowed_for_app(void) {
  function ui_theme_should_apps_use_dark_mode (line 174) | static bool ui_theme_should_apps_use_dark_mode(void) {
  function ui_theme_set_preferred_app_mode (line 184) | static void ui_theme_set_preferred_app_mode(int32_t mode) {
  function ui_theme_test (line 202) | static void ui_theme_test(void) {
  function ut_static_init (line 246) | ut_static_init(ui_theme) { ui_theme.test(); }

FILE: src/ui/ui_app.c
  function ui_app_post_message (line 46) | static void ui_app_post_message(int32_t m, int64_t wp, int64_t lp) {
  function ui_app_update_wt_timeout (line 51) | static void ui_app_update_wt_timeout(void) {
  function ui_app_post (line 76) | static void ui_app_post(rt_work_t* w) {
  function ui_app_alarm_thread (line 84) | static void ui_app_alarm_thread(void* rt_unused(p)) {
  function ui_app_redraw_thread (line 103) | static void ui_app_redraw_thread(void* rt_unused(p)) {
  function ui_app_alt_ctrl_shift (line 123) | static void ui_app_alt_ctrl_shift(bool down, int64_t key) {
  function ui_point_t (line 129) | static inline ui_point_t ui_app_point2ui(const POINT* p) {
  function POINT (line 134) | static inline POINT ui_app_ui2point(const ui_point_t* u) {
  function ui_rect_t (line 139) | static ui_rect_t ui_app_rect2ui(const RECT* r) {
  function RECT (line 144) | static RECT ui_app_ui2rect(const ui_rect_t* u) {
  function ui_app_update_ncm (line 149) | static void ui_app_update_ncm(int32_t dpi) {
  function ui_app_update_monitor_dpi (line 155) | static void ui_app_update_monitor_dpi(HMONITOR monitor, ui_dpi_t* dpi) {
  function ui_app_dump_dpi (line 204) | static void ui_app_dump_dpi(void) {
  function ui_app_update_mi (line 232) | static bool ui_app_update_mi(const ui_rect_t* r, uint32_t flags) {
  function ui_app_update_crc (line 247) | static void ui_app_update_crc(void) {
  function ui_app_dispose_fonts (line 253) | static void ui_app_dispose_fonts(void) {
  function fp64_t (line 272) | static fp64_t ui_app_px2pt(fp64_t px) {
  function ui_app_pt2px (line 277) | static int32_t ui_app_pt2px(fp64_t pt) { // rounded
  function ui_app_init_cursors (line 281) | static void ui_app_init_cursors(void) {
  function ui_app_ncm_dump_fonts (line 295) | static void ui_app_ncm_dump_fonts(void) {
  function ui_app_dump_font_size (line 321) | static void ui_app_dump_font_size(const char* name, const LOGFONTW* lf,
  function ui_app_init_fms (line 354) | static void ui_app_init_fms(ui_fms_t* fms, const LOGFONTW* base) {
  function ui_app_init_fonts (line 391) | static void ui_app_init_fonts(int32_t dpi) {
  function ui_app_data_save (line 407) | static void ui_app_data_save(const char* name, const void* data, int32_t...
  function ui_app_data_size (line 411) | static int32_t ui_app_data_size(const char* name) {
  function ui_app_data_load (line 415) | static int32_t ui_app_data_load(const char* name, void* data, int32_t by...
  function BOOL (line 436) | static BOOL CALLBACK ui_app_monitor_enum_proc(HMONITOR monitor,
  function ui_app_enum_monitors (line 453) | static void ui_app_enum_monitors(ui_app_wiw_t* wiw) {
  function ui_app_save_window_pos (line 461) | static void ui_app_save_window_pos(ui_window_t wnd, const char* name, bo...
  function ui_app_save_console_pos (line 507) | static void ui_app_save_console_pos(void) {
  function ui_app_is_fully_inside (line 530) | static bool ui_app_is_fully_inside(const ui_rect_t* inner,
  function ui_app_bring_window_inside_monitor (line 537) | static void ui_app_bring_window_inside_monitor(const ui_rect_t* mrc, ui_...
  function ui_app_load_window_pos (line 550) | static bool ui_app_load_window_pos(ui_rect_t* rect, int32_t *visibility) {
  function ui_app_load_console_pos (line 591) | static bool ui_app_load_console_pos(ui_rect_t* rect, int32_t *visibility) {
  function ui_app_timer_kill (line 618) | static void ui_app_timer_kill(ui_timer_t timer) {
  function ui_timer_t (line 622) | static ui_timer_t ui_app_timer_set(uintptr_t id, int32_t ms) {
  function ui_app_timer (line 631) | static void ui_app_timer(ui_view_t* view, ui_timer_t id) {
  function ui_app_animate_timer (line 637) | static void ui_app_animate_timer(void) {
  function ui_app_wm_timer (line 642) | static void ui_app_wm_timer(ui_timer_t id) {
  function ui_app_window_dpi (line 650) | static void ui_app_window_dpi(void) {
  function ui_app_window_opening (line 659) | static void ui_app_window_opening(void) {
  function ui_app_window_closing (line 685) | static void ui_app_window_closing(void) {
  function ui_app_get_min_max_info (line 700) | static void ui_app_get_min_max_info(MINMAXINFO* mmi) {
  function ui_app_paint (line 721) | static void ui_app_paint(ui_view_t* view) {
  function ui_app_measure_and_layout (line 727) | static void ui_app_measure_and_layout(ui_view_t* view) {
  function ui_app_dispatch_wm_char (line 740) | static void ui_app_dispatch_wm_char(ui_view_t* view, const uint16_t* utf...
  function ui_app_wm_char (line 754) | static void ui_app_wm_char(ui_view_t* view, const uint16_t* utf16) {
  function ui_app_wm_key_pressed (line 774) | static bool ui_app_wm_key_pressed(ui_view_t* v, int64_t key) {
  function ui_app_mouse (line 782) | static bool ui_app_mouse(ui_view_t* v, int32_t m, int64_t f) {
  function ui_app_show_sys_menu (line 839) | static void ui_app_show_sys_menu(int32_t x, int32_t y) {
  function ui_app_nc_mouse_message (line 853) | static int32_t ui_app_nc_mouse_message(int32_t m) {
  function ui_app_nc_mouse_buttons (line 870) | static bool ui_app_nc_mouse_buttons(int32_t m, int64_t wp, int64_t lp) {
  function ui_app_toast_paint (line 892) | static void ui_app_toast_paint(void) {
  function ui_app_toast_cancel (line 967) | static void ui_app_toast_cancel(void) {
  function ui_app_toast_tap (line 994) | static bool ui_app_toast_tap(ui_view_t* v, int32_t ix, bool pressed) {
  function ui_app_toast_character (line 1014) | static void ui_app_toast_character(const char* utf8) {
  function ui_app_toast_key_pressed (line 1024) | static bool ui_app_toast_key_pressed(int64_t key) {
  function ui_app_toast_dim (line 1034) | static void ui_app_toast_dim(int32_t step) {
  function ui_app_animate_step (line 1040) | static void ui_ap
Condensed preview — 166 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (2,989K chars).
[
  {
    "path": ".github/workflows/build-on-push.yml",
    "chars": 1698,
    "preview": "name: build-on-push\non:\n  push:\n    branches: [ main ]\n  pull_request:\n    branches: [ main ]\n  workflow_dispatch:\njobs:"
  },
  {
    "path": ".gitignore",
    "chars": 83,
    "preview": "# User files\n*.vcxproj.user\ninc/rt/version.h\nbin/**\nbuild/**\nlib/**\nmsvc2022/.vs/*\n"
  },
  {
    "path": "LICENSE",
    "chars": 1060,
    "preview": "MIT License\n\nCopyright (c) 2022 Leo\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof thi"
  },
  {
    "path": "README.md",
    "chars": 859,
    "preview": "# ui\n\nSingle header libraries for building primitive UI/UX.\n\nWin32 only implementation for now. \nPosix/MacOS/iOS/Linux/A"
  },
  {
    "path": "inc/generics.h",
    "chars": 4834,
    "preview": "#pragma once\n#include \"rt/rt_std.h\"\n\nrt_begin_c\n\n// Most of ut/ui code is written the way of min(a,b) max(a,b)\n// not ha"
  },
  {
    "path": "inc/rt/rt.h",
    "chars": 727,
    "preview": "#pragma once\n#include \"rt/rt_std.h\" // must be first\n#include \"rt/rt_str.h\" // defines str_*_t types\n// the rest is in a"
  },
  {
    "path": "inc/rt/rt_args.h",
    "chars": 2621,
    "preview": "#pragma once\n#include \"rt/rt_std.h\"\n\nrt_begin_c\n\ntypedef struct {\n    // On Unix it is responsibility of the main() to a"
  },
  {
    "path": "inc/rt/rt_atomics.h",
    "chars": 1823,
    "preview": "#pragma once\n#include \"rt/rt_std.h\"\n\n// Will be deprecated soon after Microsoft fully supports <stdatomic.h>\n\nrt_begin_c"
  },
  {
    "path": "inc/rt/rt_backtrace.h",
    "chars": 1929,
    "preview": "#pragma once\n#include \"rt/rt_std.h\"\n\n// \"bt\" stands for Stack Back Trace (not British Telecom)\n\nrt_begin_c\n\nenum { rt_ba"
  },
  {
    "path": "inc/rt/rt_clipboard.h",
    "chars": 362,
    "preview": "#pragma once\n#include \"rt/rt_std.h\"\n\nrt_begin_c\n\ntypedef struct ui_bitmap_s ui_bitmap_t;\n\ntypedef struct {\n    errno_t ("
  },
  {
    "path": "inc/rt/rt_clock.h",
    "chars": 1188,
    "preview": "#pragma once\n#include \"rt/rt_std.h\"\n\nrt_begin_c\n\ntypedef struct {\n    int32_t const nsec_in_usec; // nano in micro secon"
  },
  {
    "path": "inc/rt/rt_config.h",
    "chars": 847,
    "preview": "#pragma once\n#include \"rt/rt_std.h\"\n\nrt_begin_c\n\n// Persistent storage for configuration and other small data\n// related"
  },
  {
    "path": "inc/rt/rt_core.h",
    "chars": 1774,
    "preview": "#pragma once\n#include \"rt/rt_std.h\"\n\nrt_begin_c\n\ntypedef struct {\n    errno_t (*err)(void); // errno or GetLastError()\n "
  },
  {
    "path": "inc/rt/rt_debug.h",
    "chars": 2881,
    "preview": "#pragma once\n#include \"rt/rt_std.h\"\n\nrt_begin_c\n\n// debug interface essentially is:\n// vfprintf(stderr, format, va)\n// f"
  },
  {
    "path": "inc/rt/rt_files.h",
    "chars": 4845,
    "preview": "#pragma once\n#include \"rt/rt_std.h\"\n\nrt_begin_c\n\n// space for \"short\" 260 utf-16 characters filename in utf-8 format:\nty"
  },
  {
    "path": "inc/rt/rt_glyphs.h",
    "chars": 21688,
    "preview": "#pragma once\n#include \"rt/rt_std.h\"\n\n// Square Four Corners https://www.compart.com/en/unicode/U+26F6\n#define rt_glyph_s"
  },
  {
    "path": "inc/rt/rt_heap.h",
    "chars": 2214,
    "preview": "#pragma once\n#include \"rt/rt_std.h\"\n\nrt_begin_c\n\n// It is absolutely OK to use posix compliant\n// malloc()/calloc()/real"
  },
  {
    "path": "inc/rt/rt_loader.h",
    "chars": 580,
    "preview": "#pragma once\n#include \"rt/rt_std.h\"\n\nrt_begin_c\n\n// see:\n// https://pubs.opengroup.org/onlinepubs/7908799/xsh/dlfcn.h.ht"
  },
  {
    "path": "inc/rt/rt_mem.h",
    "chars": 1010,
    "preview": "#pragma once\n#include \"rt/rt_std.h\"\n\nrt_begin_c\n\ntypedef struct {\n    // whole file read only\n    errno_t (*map_ro)(cons"
  },
  {
    "path": "inc/rt/rt_nls.h",
    "chars": 733,
    "preview": "#pragma once\n#include \"rt/rt_std.h\"\n\nrt_begin_c\n\ntypedef struct { // i18n national language support\n    void (*init)(voi"
  },
  {
    "path": "inc/rt/rt_num.h",
    "chars": 955,
    "preview": "#pragma once\n#include \"rt/rt_std.h\"\n\nrt_begin_c\n\ntypedef struct {\n    uint64_t lo;\n    uint64_t hi;\n} rt_num128_t; // ui"
  },
  {
    "path": "inc/rt/rt_processes.h",
    "chars": 1509,
    "preview": "#pragma once\n#include \"rt/rt_streams.h\"\n\nrt_begin_c\n\ntypedef struct {\n    const char* command;\n    rt_stream_if* in;\n   "
  },
  {
    "path": "inc/rt/rt_static.h",
    "chars": 1752,
    "preview": "#pragma once\n#include \"rt/rt_std.h\"\n\nrt_begin_c\n\n// rt_static_init(unique_name) { code_to_execute_before_main }\n\n#if def"
  },
  {
    "path": "inc/rt/rt_str.h",
    "chars": 4599,
    "preview": "#pragma once\n#include \"rt/rt_std.h\"\n\nrt_begin_c\n\ntypedef struct rt_str64_t {\n    char s[64];\n} rt_str64_t;\n\ntypedef stru"
  },
  {
    "path": "inc/rt/rt_streams.h",
    "chars": 1070,
    "preview": "#pragma once\n#include \"rt/rt_std.h\"\n\nrt_begin_c\n\ntypedef struct rt_stream_if rt_stream_if;\n\ntypedef struct rt_stream_if "
  },
  {
    "path": "inc/rt/rt_threads.h",
    "chars": 1981,
    "preview": "#pragma once\n#include \"rt/rt_std.h\"\n\nrt_begin_c\n\ntypedef struct rt_event_s* rt_event_t;\n\ntypedef struct {\n    rt_event_t"
  },
  {
    "path": "inc/rt/rt_vigil.h",
    "chars": 2712,
    "preview": "#pragma once\n#include \"rt/rt_std.h\"\n\nrt_begin_c\n\n// better rt_assert() - augmented with printf format and parameters\n// "
  },
  {
    "path": "inc/rt/rt_work.h",
    "chars": 5579,
    "preview": "#pragma once\n#include \"rt/rt.h\"\n\nrt_begin_c\n\n// Minimalistic \"react\"-like work_queue or work items and\n// a thread based"
  },
  {
    "path": "inc/rt/version.rc.in",
    "chars": 934,
    "preview": "#include \"..\\inc\\rt\\version.h\"  // rc.exe does not grok forward slashes\n\nVS_VERSION_INFO VERSIONINFO\n FILEVERSION versio"
  },
  {
    "path": "inc/ui/ui.h",
    "chars": 572,
    "preview": "#pragma once\n// alphabetical order is not possible because of headers interdependencies\n#include \"ui/rt_std.h\"\n#include "
  },
  {
    "path": "inc/ui/ui_app.h",
    "chars": 9929,
    "preview": "#pragma once\n#include \"rt/rt_std.h\"\n\nrt_begin_c\n\n// link.exe /SUBSYSTEM:WINDOWS single window application\n\ntypedef struc"
  },
  {
    "path": "inc/ui/ui_button.h",
    "chars": 3682,
    "preview": "#pragma once\n#include \"rt/rt_std.h\"\n#include \"ui/ui_view.h\"\n\nrt_begin_c\n\ntypedef ui_view_t ui_button_t;\n\nvoid ui_view_in"
  },
  {
    "path": "inc/ui/ui_caption.h",
    "chars": 526,
    "preview": "/* Copyright (c) Dmitry \"Leo\" Kuznetsov 2021-24 see LICENSE for details */\n#include \"ui/ui.h\"\n\nrt_begin_c\n\ntypedef struc"
  },
  {
    "path": "inc/ui/ui_colors.h",
    "chars": 10354,
    "preview": "#pragma once\n#include \"rt/rt_std.h\"\n\nrt_begin_c\n\ntypedef uint64_t ui_color_t; // top 2 bits determine color format\n\n/* T"
  },
  {
    "path": "inc/ui/ui_containers.h",
    "chars": 1798,
    "preview": "/* Copyright (c) Dmitry \"Leo\" Kuznetsov 2021-24 see LICENSE for details */\n#include \"ui/ui.h\"\n\nrt_begin_c\n\ntypedef struc"
  },
  {
    "path": "inc/ui/ui_core.h",
    "chars": 6569,
    "preview": "#pragma once\n#include \"rt/rt_std.h\"\n\nrt_begin_c\n\ntypedef struct ui_point_s { int32_t x, y; } ui_point_t;\ntypedef struct "
  },
  {
    "path": "inc/ui/ui_edit_doc.h",
    "chars": 10323,
    "preview": "#pragma once\n/* Copyright (c) Dmitry \"Leo\" Kuznetsov 2021-24 see LICENSE for details */\n#include \"rt/rt.h\"\n#include \"ui/"
  },
  {
    "path": "inc/ui/ui_edit_view.h",
    "chars": 8714,
    "preview": "#pragma once\n/* Copyright (c) Dmitry \"Leo\" Kuznetsov 2021-24 see LICENSE for details */\n#include \"rt/rt.h\"\n#include \"ui/"
  },
  {
    "path": "inc/ui/ui_fuzzing.h",
    "chars": 1289,
    "preview": "#pragma once\n/* Copyright (c) Dmitry \"Leo\" Kuznetsov 2021-24 see LICENSE for details */\n#include \"rt/rt.h\"\n#include \"ui/"
  },
  {
    "path": "inc/ui/ui_gdi.h",
    "chars": 7727,
    "preview": "#pragma once\n#include \"rt/rt_std.h\"\n\nrt_begin_c\n\n// Graphic Device Interface (selected parts of Windows GDI)\n\nenum {  //"
  },
  {
    "path": "inc/ui/ui_image.h",
    "chars": 2236,
    "preview": "#include \"rt/rt.h\"\n#include \"ui/ui.h\"\n\nrt_begin_c\n\n// \"image view\"\n\n// To enable zoom/pan make view focusable:\n// iv.foc"
  },
  {
    "path": "inc/ui/ui_label.h",
    "chars": 1463,
    "preview": "#pragma once\n#include \"rt/rt_std.h\"\n#include \"ui/ui_view.h\"\n\nrt_begin_c\n\ntypedef ui_view_t ui_label_t;\n\nvoid ui_view_ini"
  },
  {
    "path": "inc/ui/ui_mbx.h",
    "chars": 2865,
    "preview": "#pragma once\n#include \"rt/rt_std.h\"\n#include \"ui/ui_view.h\"\n\nrt_begin_c\n\n// Options like:\n//   \"Yes\"|\"No\"|\"Abort\"|\"Retry"
  },
  {
    "path": "inc/ui/ui_midi.h",
    "chars": 1988,
    "preview": "/* Copyright (c) Dmitry \"Leo\" Kuznetsov 2021-24 see LICENSE for details */\n#include <stdint.h>\n#include <errno.h>\n\n#ifde"
  },
  {
    "path": "inc/ui/ui_slider.h",
    "chars": 3975,
    "preview": "#pragma once\n#include \"rt/rt_std.h\"\n#include \"ui/ui_button.h\"\n\nrt_begin_c\n\ntypedef struct ui_slider_s ui_slider_t;\n\ntype"
  },
  {
    "path": "inc/ui/ui_theme.h",
    "chars": 683,
    "preview": "/* Copyright (c) Dmitry \"Leo\" Kuznetsov 2021-24 see LICENSE for details */\n#include \"ui/ui.h\"\n\nrt_begin_c\n\nenum {\n    ui"
  },
  {
    "path": "inc/ui/ui_toggle.h",
    "chars": 2637,
    "preview": "#pragma once\n#include \"rt/rt_std.h\"\n#include \"ui/ui_view.h\"\n\nrt_begin_c\n\ntypedef ui_view_t ui_toggle_t;\n\n// label may co"
  },
  {
    "path": "inc/ui/ui_view.h",
    "chars": 12538,
    "preview": "#pragma once\n#include \"rt/rt_std.h\"\n\nrt_begin_c\n\nenum ui_view_type_t {\n    ui_view_stack     = 'vwst',\n    ui_view_label"
  },
  {
    "path": "inc/ut_std.h",
    "chars": 4089,
    "preview": "#pragma once\n#include <ctype.h>\n#include <errno.h>\n#include <float.h>\n#include <limits.h>\n#include <locale.h>\n#include <"
  },
  {
    "path": "inc/ut_win32.h",
    "chars": 1225,
    "preview": "#pragma once\n#ifdef WIN32\n\n#pragma warning(push)\n#pragma warning(disable: 4255) // no function prototype: '()' to '(void"
  },
  {
    "path": "msvc2022/.editorconfig",
    "chars": 3441,
    "preview": "# top-most EditorConfig file for this level\nroot = true\n\n[*.{c++,cc,cpp,cppm,cxx,h,h++,hh,hpp,hxx,inl,ipp,ixx,tlh,tli}]\n"
  },
  {
    "path": "msvc2022/amalgamate.vcxproj",
    "chars": 4851,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"15.0\" xmlns=\"http://schemas.micros"
  },
  {
    "path": "msvc2022/amalgamate.vcxproj.filters",
    "chars": 351,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuil"
  },
  {
    "path": "msvc2022/common.props",
    "chars": 8435,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild"
  },
  {
    "path": "msvc2022/exclusion.dic",
    "chars": 2070,
    "preview": "#### .editorconfig seems to be ignored\n#### merge manually for not with:\n#### C:\\Users\\leo\\AppData\\Local\\Microsoft\\Visua"
  },
  {
    "path": "msvc2022/groot.vcxproj",
    "chars": 7315,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"15.0\" xmlns=\"http://schemas.micros"
  },
  {
    "path": "msvc2022/groot.vcxproj.filters",
    "chars": 894,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuil"
  },
  {
    "path": "msvc2022/manifest.xml",
    "chars": 962,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<assembly manifestVersion=\"1.0\" xmlns=\"urn:schemas-microsoft-com"
  },
  {
    "path": "msvc2022/msvc2022.vssettings",
    "chars": 287862,
    "preview": "<UserSettings><ApplicationIdentity version=\"17.0\"/><ToolsOptions><ToolsOptionsCategory name=\"Environment\" RegisteredName"
  },
  {
    "path": "msvc2022/prebuild.vcxproj",
    "chars": 8283,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msb"
  },
  {
    "path": "msvc2022/prebuild.vcxproj.filters",
    "chars": 222,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuil"
  },
  {
    "path": "msvc2022/rt.vcxproj",
    "chars": 10308,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msb"
  },
  {
    "path": "msvc2022/rt.vcxproj.filters",
    "chars": 5644,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuil"
  },
  {
    "path": "msvc2022/sample1.vcxproj",
    "chars": 7045,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"15.0\" xmlns=\"http://schemas.micros"
  },
  {
    "path": "msvc2022/sample1.vcxproj.filters",
    "chars": 655,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuil"
  },
  {
    "path": "msvc2022/sample2.vcxproj",
    "chars": 7562,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"15.0\" xmlns=\"http://schemas.micros"
  },
  {
    "path": "msvc2022/sample2.vcxproj.filters",
    "chars": 1573,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuil"
  },
  {
    "path": "msvc2022/sample3.vcxproj",
    "chars": 7694,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"15.0\" xmlns=\"http://schemas.micros"
  },
  {
    "path": "msvc2022/sample3.vcxproj.filters",
    "chars": 1573,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuil"
  },
  {
    "path": "msvc2022/sample4.vcxproj",
    "chars": 7811,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"15.0\" xmlns=\"http://schemas.micros"
  },
  {
    "path": "msvc2022/sample4.vcxproj.filters",
    "chars": 1759,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuil"
  },
  {
    "path": "msvc2022/sample5.vcxproj",
    "chars": 7913,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"15.0\" xmlns=\"http://schemas.micros"
  },
  {
    "path": "msvc2022/sample5.vcxproj.filters",
    "chars": 1628,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuil"
  },
  {
    "path": "msvc2022/sample6.vcxproj",
    "chars": 8005,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"15.0\" xmlns=\"http://schemas.micros"
  },
  {
    "path": "msvc2022/sample6.vcxproj.filters",
    "chars": 2066,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuil"
  },
  {
    "path": "msvc2022/sample7.vcxproj",
    "chars": 7757,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"15.0\" xmlns=\"http://schemas.micros"
  },
  {
    "path": "msvc2022/sample7.vcxproj.filters",
    "chars": 1573,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuil"
  },
  {
    "path": "msvc2022/sample8.vcxproj",
    "chars": 7296,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"15.0\" xmlns=\"http://schemas.micros"
  },
  {
    "path": "msvc2022/sample8.vcxproj.filters",
    "chars": 655,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuil"
  },
  {
    "path": "msvc2022/sample9.vcxproj",
    "chars": 7664,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"15.0\" xmlns=\"http://schemas.micros"
  },
  {
    "path": "msvc2022/sample9.vcxproj.filters",
    "chars": 1573,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuil"
  },
  {
    "path": "msvc2022/test1.vcxproj",
    "chars": 6402,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"15.0\" xmlns=\"http://schemas.micros"
  },
  {
    "path": "msvc2022/test1.vcxproj.filters",
    "chars": 600,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuil"
  },
  {
    "path": "msvc2022/test2.vcxproj",
    "chars": 6283,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"15.0\" xmlns=\"http://schemas.micros"
  },
  {
    "path": "msvc2022/test2.vcxproj.filters",
    "chars": 655,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuil"
  },
  {
    "path": "msvc2022/ui.sln",
    "chars": 13959,
    "preview": "\nMicrosoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio Version 17\nVisualStudioVersion = 17.3.3280"
  },
  {
    "path": "msvc2022/ui.vcxproj",
    "chars": 8867,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msb"
  },
  {
    "path": "msvc2022/ui.vcxproj.filters",
    "chars": 4218,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuil"
  },
  {
    "path": "msvc2022/version.vcxproj",
    "chars": 4257,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"15.0\" xmlns=\"http://schemas.micros"
  },
  {
    "path": "msvc2022/version.vcxproj.filters",
    "chars": 219,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuil"
  },
  {
    "path": "scripts/clean.bat",
    "chars": 125,
    "preview": "@echo off\nrmdir /s /q ..\\bin\nrmdir /s /q ..\\build\nrmdir /s /q ..\\lib\nrmdir /s /q ..\\msvc2022\\.vs\ndel /q ..\\inc\\ut\\versio"
  },
  {
    "path": "scripts/prebuild.bat",
    "chars": 279,
    "preview": "@echo off\npushd ..\nif exist bin\\release\\%1\\version.exe (\n    bin\\release\\%1\\version.exe > inc/rt/version.h 2>nul\n    got"
  },
  {
    "path": "single_file_lib/rt/rt.h",
    "chars": 314160,
    "preview": "#ifndef rt_definition\n#define rt_definition\n\n// _________________________________ rt_std.h _____________________________"
  },
  {
    "path": "single_file_lib/ui/ui.h",
    "chars": 611824,
    "preview": "#ifndef ui_definition\n#define ui_definition\n\n// ___________________________________ ui.h _______________________________"
  },
  {
    "path": "src/rt/rt.c",
    "chars": 111,
    "preview": "#include \"rt/rt.h\"\n#include \"rt/rt_win32.h\"\n// #include \"ut/macos.h\" // TODO\n// #include \"ut/linux.h\" // TODO\n\n"
  },
  {
    "path": "src/rt/rt_args.c",
    "chars": 12417,
    "preview": "#include \"rt/rt.h\"\n#include \"rt/rt_win32.h\"\n\nstatic void* rt_args_memory;\n\nstatic void rt_args_main(int32_t argc, const "
  },
  {
    "path": "src/rt/rt_atomics.c",
    "chars": 10885,
    "preview": "#include \"rt/rt.h\"\n#include \"rt/rt_win32.h\"\n#include <stdatomic.h> // needs cl.exe /experimental:c11atomics command line"
  },
  {
    "path": "src/rt/rt_backtrace.c",
    "chars": 18305,
    "preview": "#include \"rt/rt.h\"\n#include \"rt/rt_win32.h\"\n\nstatic void* rt_backtrace_process;\nstatic DWORD rt_backtrace_pid;\n\ntypedef "
  },
  {
    "path": "src/rt/rt_clipboard.c",
    "chars": 3741,
    "preview": "#include \"rt/rt.h\"\n#include \"rt/rt_win32.h\"\n\nstatic errno_t rt_clipboard_put_text(const char* utf8) {\n    int32_t chars "
  },
  {
    "path": "src/rt/rt_clock.c",
    "chars": 6449,
    "preview": "#include \"rt/rt.h\"\n#include \"rt/rt_win32.h\"\n\nenum {\n    rt_clock_nsec_in_usec = 1000, // nano in micro\n    rt_clock_nsec"
  },
  {
    "path": "src/rt/rt_config.c",
    "chars": 4324,
    "preview": "#include \"rt/rt.h\"\n#include \"rt/rt_win32.h\"\n\n// On Unix the implementation should keep KV pairs in\n// key-named files in"
  },
  {
    "path": "src/rt/rt_core.c",
    "chars": 4467,
    "preview": "#include \"rt/rt.h\"\n#include \"rt/rt_win32.h\"\n\n// abort does NOT call atexit() functions and\n// does NOT flush rt_streams."
  },
  {
    "path": "src/rt/rt_debug.c",
    "chars": 8230,
    "preview": "#include \"rt/rt.h\"\n#include \"rt/rt_win32.h\"\n\nstatic const char* rt_debug_abbreviate(const char* file) {\n    const char* "
  },
  {
    "path": "src/rt/rt_files.c",
    "chars": 43211,
    "preview": "#include \"rt/rt.h\"\n#include \"rt/rt_win32.h\"\n\n// TODO: test FILE_APPEND_DATA\n// https://learn.microsoft.com/en-us/windows"
  },
  {
    "path": "src/rt/rt_generics.c",
    "chars": 1746,
    "preview": "#include \"rt/rt.h\"\n\n#ifdef RT_TESTS\n\nstatic void rt_generics_test(void) {\n    {\n        int8_t a = 10, b = 20;\n        r"
  },
  {
    "path": "src/rt/rt_heap.c",
    "chars": 3596,
    "preview": "#include \"rt/rt.h\"\n#include \"rt/rt_win32.h\"\n\n\nstatic errno_t rt_heap_alloc(void* *a, int64_t bytes) {\n    return rt_heap"
  },
  {
    "path": "src/rt/rt_loader.c",
    "chars": 5067,
    "preview": "#include \"rt/rt.h\"\n#include \"rt/rt_win32.h\"\n\n// This is oversimplified Win32 version completely ignoring mode.\n\n// I bit"
  },
  {
    "path": "src/rt/rt_mem.c",
    "chars": 9664,
    "preview": "#include \"rt/rt.h\"\n#include \"rt/rt_win32.h\"\n\nstatic errno_t rt_mem_map_view_of_file(HANDLE file,\n        void* *data, in"
  },
  {
    "path": "src/rt/rt_nls.c",
    "chars": 6894,
    "preview": "#include \"rt/rt.h\"\n#include \"rt/rt_win32.h\"\n\n// Simplistic Win32 implementation of national language support.\n// Windows"
  },
  {
    "path": "src/rt/rt_num.c",
    "chars": 7910,
    "preview": "#include \"rt/rt.h\"\n#include <intrin.h>\n//#include <immintrin.h> // _tzcnt_u32\n\nstatic inline rt_num128_t rt_num_add128_i"
  },
  {
    "path": "src/rt/rt_processes.c",
    "chars": 22386,
    "preview": "#include \"rt/rt.h\"\n#include \"rt/rt_win32.h\"\n\ntypedef struct rt_processes_pidof_lambda_s rt_processes_pidof_lambda_t;\n\nty"
  },
  {
    "path": "src/rt/rt_static.c",
    "chars": 1427,
    "preview": "#include \"rt/rt.h\"\n\nstatic void*   rt_static_symbol_reference[1024];\nstatic int32_t rt_static_symbol_reference_count;\n\nv"
  },
  {
    "path": "src/rt/rt_str.c",
    "chars": 20860,
    "preview": "#include \"rt/rt.h\"\n#include \"rt/rt_win32.h\"\n\nstatic char* rt_str_drop_const(const char* s) {\n    #if defined(__GNUC__) |"
  },
  {
    "path": "src/rt/rt_streams.c",
    "chars": 3722,
    "preview": "#include \"rt/rt.h\"\n#include \"rt/rt_win32.h\"\n\nstatic errno_t rt_streams_memory_read(rt_stream_if* stream, void* data, int"
  },
  {
    "path": "src/rt/rt_threads.c",
    "chars": 23085,
    "preview": "#include \"rt/rt.h\"\n#include \"rt/rt_win32.h\"\n\n// events:\n\nstatic rt_event_t rt_event_create(void) {\n    HANDLE e = Create"
  },
  {
    "path": "src/rt/rt_vigil.c",
    "chars": 6293,
    "preview": "#include \"rt/rt.h\"\n#include <stdio.h>\n#include <string.h>\n\nstatic void rt_vigil_breakpoint_and_abort(void) {\n    rt_debu"
  },
  {
    "path": "src/rt/rt_win32.c",
    "chars": 797,
    "preview": "#include \"rt/rt.h\"\n#include \"rt/rt_win32.h\"\n\nvoid rt_win32_close_handle(void* h) {\n    #pragma warning(suppress: 6001) /"
  },
  {
    "path": "src/rt/rt_work.c",
    "chars": 11177,
    "preview": "#include \"rt/rt.h\"\n\nstatic void rt_work_queue_no_duplicates(rt_work_t* w) {\n    rt_work_t* e = w->queue->head;\n    bool "
  },
  {
    "path": "src/samples/edit.test.c",
    "chars": 30671,
    "preview": "/* Copyright (c) Dmitry \"Leo\" Kuznetsov 2021-24 see LICENSE for details */\n#include \"single_file_lib/rt/rt.h\"\n#include \""
  },
  {
    "path": "src/samples/groot/groot.c",
    "chars": 8305,
    "preview": "#include \"rt/rt.h\"\n#include \"ui/ui.h\"\n#include \"rocket.h\"\n#include \"groot.h\"\n#include \"stb_image.h\"\n\n// TODO: stack(ui_t"
  },
  {
    "path": "src/samples/groot/groot.h",
    "chars": 85512,
    "preview": "#pragma once\n\nstatic unsigned char groot[] = { // groot.jpg file 64x64 rgba\n     0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1"
  },
  {
    "path": "src/samples/groot/groot.rc",
    "chars": 553,
    "preview": "#ifdef RC_INVOKED\n#ifndef _INC_WINDOWS\n#define _INC_WINDOWS\n#include \"winres.h\"           // extract from windows header"
  },
  {
    "path": "src/samples/groot/rocket.h",
    "chars": 14898,
    "preview": "#pragma once\n\nstatic unsigned char rocket[] = { // rocket.jpg file 64x72 rgb\n     0xFF, 0xD8, 0xFF, 0xE0, 0x00, 0x10, 0x"
  },
  {
    "path": "src/samples/i18n.h",
    "chars": 1459,
    "preview": "#pragma once\n\n// String ids must be sequential starting from 1 (not zero!) and\n// be compact sequential integers set (sh"
  },
  {
    "path": "src/samples/rt.c",
    "chars": 61,
    "preview": "#define rt_implementation\n#include \"single_file_lib/rt/rt.h\"\n"
  },
  {
    "path": "src/samples/sample.rc",
    "chars": 17257,
    "preview": "#ifdef RC_INVOKED\n#ifndef _INC_WINDOWS\n#define _INC_WINDOWS\n#include \"winres.h\"\n#endif\n#endif\n\n#include \"i18n.h\"\n\n1 RT_"
  },
  {
    "path": "src/samples/sample1.c",
    "chars": 3026,
    "preview": "/* Copyright (c) Dmitry \"Leo\" Kuznetsov 2021-24 see LICENSE for details */\n#include \"rt/rt.h\"\n#include \"ui/ui.h\"\n\nstatic"
  },
  {
    "path": "src/samples/sample2.c",
    "chars": 2233,
    "preview": "/* Copyright (c) Dmitry \"Leo\" Kuznetsov 2021-24 see LICENSE for details */\n#include \"single_file_lib/rt/rt.h\"\n#include \""
  },
  {
    "path": "src/samples/sample3.c",
    "chars": 6546,
    "preview": "/* Copyright (c) Dmitry \"Leo\" Kuznetsov 2021-24 see LICENSE for details */\n#include \"single_file_lib/rt/rt.h\"\n#include \""
  },
  {
    "path": "src/samples/sample4.c",
    "chars": 3298,
    "preview": "/* Copyright (c) Dmitry \"Leo\" Kuznetsov 2021-24 see LICENSE for details */\n#include \"single_file_lib/rt/rt.h\"\n#include \""
  },
  {
    "path": "src/samples/sample5.c",
    "chars": 10895,
    "preview": "/* Copyright (c) Dmitry \"Leo\" Kuznetsov 2021-24 see LICENSE for details */\n#include \"rt/rt.h\"\n#include \"ui/ui.h\"\n// #inc"
  },
  {
    "path": "src/samples/sample6.c",
    "chars": 14153,
    "preview": "/* Copyright (c) Dmitry \"Leo\" Kuznetsov 2021-24 see LICENSE for details */\n#include \"single_file_lib/rt/rt.h\"\n#include \""
  },
  {
    "path": "src/samples/sample6.rc",
    "chars": 454,
    "preview": "#include \"sample.rc\"\n\ngroot_gif        RCDATA \"groot.gif\" // animated dancing groot\ngotg_gif         RCDATA \"gotg.gif\" "
  },
  {
    "path": "src/samples/sample7.c",
    "chars": 6905,
    "preview": "/* Copyright (c) Dmitry \"Leo\" Kuznetsov 2021-24 see LICENSE for details */\n#include \"single_file_lib/rt/rt.h\"\n#include \""
  },
  {
    "path": "src/samples/sample8.c",
    "chars": 20417,
    "preview": "/* Copyright (c) Dmitry \"Leo\" Kuznetsov 2021-24 see LICENSE for details */\n#include \"rt/rt.h\"\n#include \"ui/ui.h\"\n\nstatic"
  },
  {
    "path": "src/samples/sample9.c",
    "chars": 18516,
    "preview": "/* Copyright (c) Dmitry \"Leo\" Kuznetsov 2021-24 see LICENSE for details */\n#include \"single_file_lib/rt/rt.h\"\n#include \""
  },
  {
    "path": "src/samples/stb_image.c",
    "chars": 1270,
    "preview": "#include \"rt/rt.h\"\n\nstatic void* stb_malloc(size_t n) {\n    rt_assert(n > 0);\n    void* a = null;\n    errno_t r = rt_hea"
  },
  {
    "path": "src/samples/stb_image.h",
    "chars": 282848,
    "preview": "/* stb_image - v2.29 - public domain image loader - http://nothings.org/stb\n                                  no warrant"
  },
  {
    "path": "src/samples/ui.c",
    "chars": 96,
    "preview": "#include \"single_file_lib/rt/rt.h\"\n#define ui_implementation\n#include \"single_file_lib/ui/ui.h\"\n"
  },
  {
    "path": "src/tools/amalgamate.c",
    "chars": 6701,
    "preview": "#include <assert.h>\n#include <stdbool.h>\n#include <stdint.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n"
  },
  {
    "path": "src/tools/dirent.c",
    "chars": 1583,
    "preview": "#include \"dirent.h\"\n#include <stdio.h>\n#include <malloc.h>\n#include <Windows.h>\n\n#if defined(__GNUC__) || defined(__clan"
  },
  {
    "path": "src/tools/dirent.h",
    "chars": 357,
    "preview": "#pragma once\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n// https://pubs.opengroup.org/onlinepubs/009604599/basedefs/dirent"
  },
  {
    "path": "src/tools/version.c",
    "chars": 2550,
    "preview": "#include <stdio.h>\n#include <stdint.h>\n#include <stdlib.h>\n#include <string.h>\n#include <time.h>\n\n#ifdef _MSC_FULL_VER\n#"
  },
  {
    "path": "src/ui/attic/ui_theme.c",
    "chars": 13401,
    "preview": "/* Copyright (c) Dmitry \"Leo\" Kuznetsov 2021-24 see LICENSE for details */\n#include \"ut/ut.h\"\n#include \"ui/ui.h\"\n#includ"
  },
  {
    "path": "src/ui/ui_app.c",
    "chars": 124130,
    "preview": "#include \"rt/rt.h\"\n#include \"ui/ui.h\"\n#include \"rt/rt_win32.h\"\n\n#pragma push_macro(\"ui_app_window\")\n#pragma push_macro(\""
  },
  {
    "path": "src/ui/ui_button.c",
    "chars": 6071,
    "preview": "#include \"rt/rt.h\"\n#include \"ui/ui.h\"\n\nstatic void ui_button_every_100ms(ui_view_t* v) { // every 100ms\n    if (!v->stat"
  },
  {
    "path": "src/ui/ui_caption.c",
    "chars": 10334,
    "preview": "/* Copyright (c) Dmitry \"Leo\" Kuznetsov 2021-24 see LICENSE for details */\n#include \"rt/rt.h\"\n#include \"ui/ui.h\"\n\n#pragm"
  },
  {
    "path": "src/ui/ui_colors.c",
    "chars": 19545,
    "preview": "#include \"rt/rt.h\"\n#include \"ui/ui.h\"\n\nstatic inline uint8_t ui_color_clamp_uint8(fp64_t value) {\n    return value < 0 ?"
  },
  {
    "path": "src/ui/ui_containers.c",
    "chars": 25239,
    "preview": "/* Copyright (c) Dmitry \"Leo\" Kuznetsov 2021-24 see LICENSE for details */\n#include \"rt/rt.h\"\n#include \"ui/ui.h\"\n\nstatic"
  },
  {
    "path": "src/ui/ui_core.c",
    "chars": 4860,
    "preview": "#include \"rt/rt.h\"\n#include \"ui/ui.h\"\n#include \"rt/rt_win32.h\"\n\n#define UI_WM_ANIMATE  (WM_APP + 0x7FFF)\n#define UI_WM_O"
  },
  {
    "path": "src/ui/ui_edit_doc.c",
    "chars": 88296,
    "preview": "/* Copyright (c) Dmitry \"Leo\" Kuznetsov 2021-24 see LICENSE for details */\n#include \"rt/rt.h\"\n#include \"ui/ui.h\"\n\n#undef"
  },
  {
    "path": "src/ui/ui_edit_view.c",
    "chars": 75887,
    "preview": "/* Copyright (c) Dmitry \"Leo\" Kuznetsov 2021-24 see LICENSE for details */\n#include \"rt/rt.h\"\n#include \"ui/ui.h\"\n#includ"
  },
  {
    "path": "src/ui/ui_fuzzing.c",
    "chars": 17511,
    "preview": "/* Copyright (c) Dmitry \"Leo\" Kuznetsov 2021-24 see LICENSE for details */\n#include \"rt/rt.h\"\n#include \"ui/ui.h\"\n\n// TOD"
  },
  {
    "path": "src/ui/ui_gdi.c",
    "chars": 49411,
    "preview": "#include \"rt/rt.h\"\n#include \"ui/ui.h\"\n#include \"rt/rt_win32.h\"\n\n#pragma push_macro(\"ui_gdi_with_hdc\")\n#pragma push_macro"
  },
  {
    "path": "src/ui/ui_image.c",
    "chars": 17160,
    "preview": "#include \"rt/rt.h\"\n#include \"ui/ui.h\"\n\nstatic fp64_t ui_image_scale_of(int32_t nominator, int32_t denominator) {\n    con"
  },
  {
    "path": "src/ui/ui_label.c",
    "chars": 2811,
    "preview": "#include \"rt/rt.h\"\n#include \"ui/ui.h\"\n\nstatic void ui_label_paint(ui_view_t* v) {\n    rt_assert(v->type == ui_view_label"
  },
  {
    "path": "src/ui/ui_mbx.c",
    "chars": 3518,
    "preview": "#include \"rt/rt.h\"\n#include \"ui/ui.h\"\n\nstatic void ui_mbx_button(ui_button_t* b) {\n    ui_mbx_t* m = (ui_mbx_t*)b->paren"
  },
  {
    "path": "src/ui/ui_midi.c",
    "chars": 7178,
    "preview": "/* Copyright (c) Dmitry \"Leo\" Kuznetsov 2021-24 see LICENSE for details */\n#include \"rt/rt.h\"\n#include \"rt/rt_win32.h\"\n#"
  },
  {
    "path": "src/ui/ui_slider.c",
    "chars": 14714,
    "preview": "#include \"rt/rt.h\"\n#include \"ui/ui.h\"\n\nstatic void ui_slider_invalidate(const ui_slider_t* s) {\n    const ui_view_t* v ="
  },
  {
    "path": "src/ui/ui_theme.c",
    "chars": 6458,
    "preview": "/* Copyright (c) Dmitry \"Leo\" Kuznetsov 2021-24 see LICENSE for details */\n#include \"rt/rt.h\"\n#include \"ui/ui.h\"\n#includ"
  },
  {
    "path": "src/ui/ui_toggle.c",
    "chars": 4291,
    "preview": "#include \"rt/rt.h\"\n#include \"ui/ui.h\"\n\nstatic void ui_toggle_paint_on_off(ui_view_t* v) {\n    const ui_ltrb_t i = ui_vie"
  },
  {
    "path": "src/ui/ui_view.c",
    "chars": 37402,
    "preview": "#include \"rt/rt.h\"\n#include \"ui/ui.h\"\n\nstatic const fp64_t ui_view_hover_delay = 1.5; // seconds\n\n#pragma push_macro(\"ui"
  },
  {
    "path": "test/test1.c",
    "chars": 2281,
    "preview": "#include \"rt/rt.h\"\n#include <stdio.h>\n\nstatic int usage(void) {\n    fprintf(stderr, \"Usage: %s [options]\\n\", rt_args.bas"
  },
  {
    "path": "test/test1.rc",
    "chars": 309,
    "preview": "#include <winres.h>\n\n#define company_name \"<Insert Name Here>\"\n#define copyright \"Copyright (C) 2024 `Leo` Dmitry Kuzne"
  },
  {
    "path": "test/test2.c",
    "chars": 533,
    "preview": "#define rt_implementation\n#include \"single_file_lib/rt/rt.h\"\n\nint main(int argc, char* argv[], char *envp[]) {\n    rt_ar"
  }
]

// ... and 1 more files (download for full content)

About this extraction

This page contains the full source code of the leok7v/ui GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 166 files (2.7 MB), approximately 725.4k tokens, and a symbol index with 2729 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!