vx11 / AGENTS.md
95 lines · 87 sloc · 6.05 KB · 6de7c1113616d30335010eea79fd03d19722b474
Raw

AGENTS.md — vx11

Project

Unix libX11 bindings for V. There is a generated raw API and a handwritten native convenience layer. Module vx11, MIT, no V package dependencies. Installed X11 headers are the source of truth.

Commands

Compiler: /home/diviocity/.local/bin/v (V 0.5.2; compiler checkout is /home/diviocity/git/v/v).

Structure

ABI and ownership rules

C int is i32; C long/unsigned long are CLong/CULong. XIDs are native C unsigned longs, not always u32. Property format 32 uses C long slots in Xlib. CLong/CULong use explicit i64/u64 or i32/u32 according to Unix target bitness. Do not alias them to V int/uint: C interop can adapt int pointers to 32-bit C int. Use C-backed typedef structs/unions; do not recreate layouts as ordinary V structs. Preserve case-distinct keysyms. Callbacks must use exact C-width argument types.

Native handles share ownership state by reference and must be released in order: GC, window, display. Close/destroy is idempotent. Returned V strings/arrays copy and free the C allocation. Raw calls retain Xlib ownership and asynchronous error semantics. New helpers should validate local inputs and document lifetime rules.

Do not edit .crush/ session data. Do not delegate to other agents by default.

Optional text libraries