koffi 1.3.5 → 1.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CMakeLists.txt +1 -1
- package/ChangeLog.md +36 -0
- package/benchmark/atoi_koffi.js +3 -4
- package/benchmark/atoi_napi.js +2 -3
- package/benchmark/atoi_node_ffi.js +3 -4
- package/benchmark/raylib_cc.cc +3 -4
- package/benchmark/raylib_cc.js +31 -0
- package/benchmark/raylib_koffi.js +8 -9
- package/benchmark/raylib_node_ffi.js +4 -5
- package/benchmark/raylib_node_raylib.js +4 -5
- package/build/qemu/1.3.8/koffi_darwin_arm64.tar.gz +0 -0
- package/build/qemu/1.3.8/koffi_darwin_x64.tar.gz +0 -0
- package/build/qemu/1.3.8/koffi_freebsd_arm64.tar.gz +0 -0
- package/build/qemu/1.3.8/koffi_freebsd_ia32.tar.gz +0 -0
- package/build/qemu/1.3.8/koffi_freebsd_x64.tar.gz +0 -0
- package/build/qemu/1.3.8/koffi_linux_arm32hf.tar.gz +0 -0
- package/build/qemu/1.3.8/koffi_linux_arm64.tar.gz +0 -0
- package/build/qemu/1.3.8/koffi_linux_ia32.tar.gz +0 -0
- package/build/qemu/1.3.8/koffi_linux_riscv64hf64.tar.gz +0 -0
- package/build/qemu/1.3.8/koffi_linux_x64.tar.gz +0 -0
- package/build/qemu/1.3.8/koffi_openbsd_ia32.tar.gz +0 -0
- package/build/qemu/1.3.8/koffi_openbsd_x64.tar.gz +0 -0
- package/build/qemu/1.3.8/koffi_win32_arm64.tar.gz +0 -0
- package/build/qemu/1.3.8/koffi_win32_ia32.tar.gz +0 -0
- package/build/qemu/1.3.8/koffi_win32_x64.tar.gz +0 -0
- package/doc/_static/perf_linux_20220627.png +0 -0
- package/doc/_static/perf_linux_20220628.png +0 -0
- package/doc/_static/perf_windows_20220627.png +0 -0
- package/doc/_static/perf_windows_20220628.png +0 -0
- package/doc/benchmarks.md +78 -58
- package/doc/benchmarks.xlsx +0 -0
- package/doc/conf.py +1 -1
- package/doc/contribute.md +8 -11
- package/doc/dist/html/_sources/benchmarks.md.txt +78 -58
- package/doc/dist/html/_sources/contribute.md.txt +8 -11
- package/doc/dist/html/_sources/functions.md.txt +9 -8
- package/doc/dist/html/_sources/index.rst.txt +3 -0
- package/doc/dist/html/_sources/platforms.md.txt +17 -5
- package/doc/dist/html/_sources/start.md.txt +14 -3
- package/doc/dist/html/_sources/types.md.txt +15 -11
- package/doc/dist/html/_static/basic.css +12 -14
- package/doc/dist/html/_static/perf_linux_20220627.png +0 -0
- package/doc/dist/html/_static/perf_linux_20220628.png +0 -0
- package/doc/dist/html/_static/perf_windows_20220627.png +0 -0
- package/doc/dist/html/_static/perf_windows_20220628.png +0 -0
- package/doc/dist/html/benchmarks.html +148 -159
- package/doc/dist/html/changes.html +44 -2
- package/doc/dist/html/contribute.html +30 -33
- package/doc/dist/html/functions.html +19 -18
- package/doc/dist/html/genindex.html +2 -2
- package/doc/dist/html/index.html +19 -10
- package/doc/dist/html/memory.html +2 -2
- package/doc/dist/html/objects.inv +0 -0
- package/doc/dist/html/platforms.html +44 -10
- package/doc/dist/html/search.html +2 -2
- package/doc/dist/html/searchindex.js +1 -1
- package/doc/dist/html/start.html +25 -12
- package/doc/dist/html/types.html +31 -11
- package/doc/functions.md +9 -8
- package/doc/index.rst +3 -0
- package/doc/platforms.md +17 -5
- package/doc/start.md +14 -3
- package/doc/types.md +15 -11
- package/package.json +7 -4
- package/qemu/qemu.js +30 -19
- package/qemu/registry/machines.json +19 -19
- package/qemu/registry/sha256sum.txt +5 -5
- package/src/abi_arm32.cc +9 -2
- package/src/abi_arm32_fwd.S +7 -7
- package/src/abi_arm64.cc +9 -2
- package/src/abi_arm64_fwd.S +11 -7
- package/src/abi_arm64_fwd.asm +7 -7
- package/src/abi_riscv64.cc +9 -2
- package/src/abi_riscv64_fwd.S +11 -11
- package/src/abi_x64_sysv.cc +9 -2
- package/src/abi_x64_sysv_fwd.S +11 -11
- package/src/abi_x64_win.cc +9 -2
- package/src/abi_x64_win_fwd.asm +7 -7
- package/src/abi_x86.cc +9 -2
- package/src/abi_x86_fwd.S +3 -0
- package/src/abi_x86_fwd.asm +3 -0
- package/src/call.cc +20 -10
- package/src/ffi.cc +17 -8
- package/src/ffi.hh +4 -3
- package/src/util.cc +1 -1
- package/test/async.js +1 -1
- package/test/callbacks.js +25 -2
- package/test/misc.c +57 -2
- package/test/raylib.js +4 -4
- package/test/sqlite.js +5 -5
- package/test/sync.js +22 -7
- package/build/qemu/1.3.5/koffi_darwin_arm64.tar.gz +0 -0
- package/build/qemu/1.3.5/koffi_darwin_x64.tar.gz +0 -0
- package/build/qemu/1.3.5/koffi_freebsd_arm64.tar.gz +0 -0
- package/build/qemu/1.3.5/koffi_freebsd_ia32.tar.gz +0 -0
- package/build/qemu/1.3.5/koffi_freebsd_x64.tar.gz +0 -0
- package/build/qemu/1.3.5/koffi_linux_arm32hf.tar.gz +0 -0
- package/build/qemu/1.3.5/koffi_linux_arm64.tar.gz +0 -0
- package/build/qemu/1.3.5/koffi_linux_ia32.tar.gz +0 -0
- package/build/qemu/1.3.5/koffi_linux_riscv64hf64.tar.gz +0 -0
- package/build/qemu/1.3.5/koffi_linux_x64.tar.gz +0 -0
- package/build/qemu/1.3.5/koffi_openbsd_ia32.tar.gz +0 -0
- package/build/qemu/1.3.5/koffi_openbsd_x64.tar.gz +0 -0
- package/build/qemu/1.3.5/koffi_win32_arm64.tar.gz +0 -0
- package/build/qemu/1.3.5/koffi_win32_ia32.tar.gz +0 -0
- package/build/qemu/1.3.5/koffi_win32_x64.tar.gz +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
Search.setIndex({"docnames": ["benchmarks", "changes", "contribute", "functions", "index", "memory", "platforms", "start", "types"], "filenames": ["benchmarks.md", "changes.md", "contribute.md", "functions.md", "index.rst", "memory.md", "platforms.md", "start.md", "types.md"], "titles": ["Benchmarks", "Changelog", "Contributing", "Function calls", "Koffi 1.3.5", "Memory usage", "Supported platforms", "Quick start", "Data types"], "terms": {"here": [0, 2, 3, 4, 8], "quick": [0, 4], "overview": 0, "execut": [0, 3], "time": [0, 2, 5, 7], "koffi": [0, 2, 3, 5, 6, 7, 8], "call": [0, 1, 4, 5, 6, 7, 8], "three": [0, 7, 8], "where": [0, 3, 8], "compar": 0, "theoret": 0, "ideal": 0, "ffi": [0, 3, 4, 7], "implement": [0, 8], "approxim": [0, 8], "pre": 0, "compil": [0, 1, 6], "static": 0, "n": [0, 2, 6, 7, 8], "api": [0, 2, 3, 7, 8], "glue": 0, "code": [0, 1, 3, 4, 5], "The": [0, 1, 2, 3, 5, 6, 7, 8], "first": [0, 2, 3, 7, 8], "base": [0, 3, 4, 8], "second": [0, 3, 7, 8], "third": 0, "These": [0, 2, 3, 8], "ar": [0, 1, 2, 3, 5, 6, 7, 8], "detail": 0, "explain": 0, "below": [0, 1, 2, 3, 7, 8], "node": [0, 2, 3, 4, 6, 7], "napi": 0, "thi": [0, 1, 2, 3, 4, 7, 8], "test": [0, 1, 4, 6], "around": [0, 5, 8], "repeat": 0, "simpl": [0, 2, 3, 8], "standard": [0, 3, 8], "c": [0, 1, 2, 4, 5, 6, 7], "function": [0, 1, 2, 4, 7, 8], "ha": [0, 2, 3, 8], "one": [0, 3, 5, 7, 8], "refer": [0, 4, 8], "through": [0, 3, 8], "an": [0, 3, 5, 8], "modul": [0, 1, 4], "close": [0, 8], "limit": [0, 1], "perfect": 0, "overhead": [0, 4], "js": [0, 1, 2, 3, 4, 6, 8], "us": [0, 1, 2, 3, 4, 5, 6, 7, 8], "offici": [0, 2, 6], "becaus": [0, 2, 3, 8], "pretti": [0, 2], "small": [0, 3, 4], "clearli": 0, "visibl": 0, "were": 0, "measur": 0, "my": [0, 2], "machin": [0, 2], "amd": 0, "ryzen": 0, "7": 0, "4700u": 0, "iter": [0, 8], "total": [0, 8], "rel": 0, "perform": [0, 4], "rand_napi": 0, "20000000": 0, "1": [0, 2, 5, 6, 8], "44": 0, "baselin": 0, "rand_koffi": 0, "2": [0, 4, 5, 6, 8], "60": 0, "x0": 0, "55": 0, "81": [0, 2], "rand_node_ffi": 0, "107": 0, "58": 0, "01": 0, "7400": 0, "intel": 0, "core": 0, "i5": 0, "4460": 0, "10": 0, "3": [0, 2, 6, 8], "87": 0, "54": 0, "84": 0, "02": 0, "4100": 0, "similar": [0, 3], "which": [0, 2, 6, 7], "take": [0, 3, 8], "string": [0, 1, 2, 3, 5, 7], "paramet": [0, 4, 7, 8], "javascript": [0, 4, 8], "v8": [0, 3], "convers": [0, 1, 8], "slow": [0, 2], "heavi": 0, "atoi_napi": 0, "97": 0, "atoi_koffi": 0, "5": [0, 3, 8], "07": 0, "71": 0, "atoi_node_ffi": 0, "693": 0, "16": [0, 8], "005": 0, "23000": 0, "91": 0, "50": 0, "99": 0, "479": 0, "34": 0, "006": 0, "16000": 0, "cpu": 0, "imag": 0, "draw": 0, "much": [0, 2], "heavier": 0, "than": [0, 5], "thu": 0, "reduc": [0, 1], "In": [0, 3, 8], "full": [0, 2, 8], "version": [0, 1, 2, 3, 4, 6, 8], "nativ": [0, 3], "wrapper": [0, 2], "raylib_cc": 0, "100": 0, "9": [0, 1], "31": 0, "x1": 0, "17": 0, "15": [0, 8], "raylib_node_raylib": 0, "90": 0, "raylib_koffi": 0, "12": [0, 2, 6], "86": 0, "18": [0, 8], "raylib_node_ffi": 0, "35": 0, "76": 0, "30": [0, 8], "228": 0, "67": 0, "05": 0, "14": [0, 1, 8], "23": 0, "63": 0, "27": [0, 3], "270": 0, "open": [0, 3, 8], "consol": [0, 3, 5, 8], "go": [0, 2], "cnoke": [0, 2], "befor": [0, 1, 2, 8], "do": [0, 2, 3, 8], "anyth": 0, "els": [0, 8], "cd": [0, 2], "onc": [0, 2, 3, 5, 7, 8], "done": [0, 2, 3, 8], "you": [0, 2, 3, 4, 6, 7, 8], "can": [0, 1, 2, 3, 4, 5, 6, 7, 8], "each": [0, 2, 3, 8], "e": [0, 3, 8], "g": [0, 2, 3, 8], "build": [0, 1, 4, 6, 8], "option": [0, 2, 3, 4, 8], "defin": [0, 8], "custom": 0, "number": [0, 1, 5, 8], "10000000": 0, "main": [1, 3], "fix": [1, 2, 4], "possibl": [1, 2, 8], "openbsd": [1, 6], "i386": 1, "crash": [1, 3], "void": [1, 3, 7, 8], "misconvers": 1, "sign": [1, 8], "integ": [1, 3, 8], "return": [1, 3, 8], "valu": [1, 3, 4, 7, 8], "unsign": [1, 3, 7, 8], "other": [1, 3, 8], "chang": [1, 2, 3, 5, 8], "support": [1, 2, 3, 4, 8], "empti": 1, "signatur": 1, "disabl": [1, 2], "unsaf": 1, "optim": [1, 2], "variou": [1, 2], "document": [1, 8], "improv": 1, "mode": 1, "grace": 1, "degrad": 1, "older": [1, 6], "toolchain": 1, "linux": [1, 2, 4, 6], "debian": [1, 2], "prebuilt": [1, 2, 6], "binari": [1, 2, 6], "when": [1, 2, 3, 5, 8], "instal": [1, 2, 6, 7], "rebuild": 1, "happen": [1, 3, 5, 8], "fail": [1, 2, 3, 8], "load": [1, 3, 7, 8], "major": [1, 2], "expand": 1, "move": 1, "http": [1, 2, 4], "dev": [1, 2], "arrai": [1, 2, 4], "typedarrai": [1, 8], "pointer": [1, 3, 4], "argument": [1, 3, 8], "input": [1, 3, 8], "output": [1, 4, 7, 8], "mix": [1, 2, 8], "convert": [1, 3, 8], "null": [1, 3, 7, 8], "instead": [1, 2, 8], "struct": [1, 2, 4, 5, 7], "member": [1, 3, 8], "callback": [1, 4, 5, 6, 8], "default": [1, 2, 3, 4, 8], "hint": [1, 8], "char": [1, 3, 7, 8], "char16": [1, 8], "char16_t": [1, 8], "definit": [1, 4, 8], "long": [1, 8], "type": [1, 2, 3, 4, 7], "window": [1, 4, 6], "x64": 1, "llp64": [1, 8], "model": 1, "restrict": [1, 2], "automat": [1, 2, 3, 8], "detect": 1, "float": [1, 3, 6, 8], "point": [1, 8], "abi": [1, 2, 6, 8], "arm32": [1, 6], "risc": [1, 6], "v": [1, 6], "forbid": 1, "duplic": 1, "name": [1, 2, 3, 8], "new": [1, 3, 5, 8], "featur": [1, 4], "arm64": [1, 2, 6], "now": [1, 2, 7, 8], "A": [1, 6, 8], "maco": [1, 2, 6], "m1": 1, "includ": [1, 2, 3, 6, 8], "entri": 1, "sinc": [1, 4], "cdecl": [1, 3, 6], "stdcall": [1, 3, 6, 7], "all": [1, 6, 8], "platform": [1, 3, 4, 5, 8], "64": [1, 3, 5, 6, 8], "lp64d": [1, 6], "lp64": [1, 6, 8], "untest": [1, 6], "expos": [1, 8], "set": [1, 4], "memori": [1, 2, 3, 4, 8], "usag": [1, 4], "synchron": [1, 4, 5], "asynchron": [1, 4, 5], "transpar": [1, 8], "between": [1, 3], "buffer": [1, 8], "tent": 1, "excess": 1, "stack": [1, 5], "align": [1, 8], "x86": [1, 3, 6, 7], "potenti": [1, 8], "problem": 1, "big": [1, 3, 5, 8], "int64_t": [1, 7, 8], "uint64_t": [1, 8], "layout": 1, "error": [1, 3, 8], "push": [1, 8], "pop": 1, "issu": [1, 2, 3], "incomplet": 1, "buggi": 1, "hfa": [1, 2], "caus": [1, 3], "miss": [1, 2], "map_stack": 1, "flag": 1, "non": [1, 3, 8], "sens": 1, "intern": [1, 8], "fals": [1, 8], "normal": [1, 5, 8], "make": [1, 2], "sure": [1, 2], "we": [1, 2, 8], "have": [1, 2, 7, 8], "redzon": 1, "architectur": [1, 2, 3, 4, 6, 8], "slower": 1, "alloc": [1, 2, 5, 8], "object": [1, 2, 3, 5, 8], "repositori": 2, "luigi": 2, "monorepo": 2, "contain": [2, 8], "multipl": 2, "project": 2, "idea": 2, "github": 2, "com": 2, "koromix": 2, "provid": [2, 3, 8], "packag": [2, 6], "npm": [2, 6, 7], "archiv": 2, "so": [2, 3, 7, 8], "most": [2, 3, 8], "case": [2, 3, 8], "should": 2, "If": [2, 3, 8], "want": 2, "hack": 2, "specif": [2, 5], "follow": [2, 3, 6, 8], "instruct": [2, 3], "start": [2, 3, 4], "clone": 2, "git": 2, "As": 2, "said": 2, "monorepositori": 2, "conta": 2, "henc": 2, "depend": [2, 3, 8], "met": 2, "desktop": 2, "develop": 2, "workload": 2, "visual": 2, "studio": 2, "2022": 2, "2019": 2, "tool": 2, "compon": 2, "cmake": 2, "meta": 2, "system": [2, 7], "later": [2, 4, 6], "command": 2, "benchmark": [2, 4], "directori": [2, 8], "what": 2, "gcc": 2, "8": [2, 3, 8], "newer": 2, "gnu": [2, 4], "emul": 2, "acceler": 2, "qemu": 2, "need": [2, 3, 8], "even": 2, "gui": 2, "ubuntu": 2, "directli": [2, 8], "licens": 2, "size": [1, 2, 4, 5], "reason": [2, 8], "thei": [2, 3, 8], "avail": [2, 5], "file": [2, 3, 8], "For": [2, 3, 5, 6, 8], "exampl": [2, 4, 8], "wget": 2, "q": 2, "o": [2, 8], "qemu_debian_arm64": 2, "tar": 2, "zst": 2, "zstd": 2, "d": [2, 3, 8], "xv": 2, "sha256sum": 2, "ignor": [2, 3], "registri": 2, "txt": 2, "note": [2, 8], "disk": 2, "content": [2, 8], "mai": [2, 3], "checksum": 2, "been": [2, 3], "least": [2, 5], "And": [2, 7], "sever": [2, 3], "help": 2, "patient": 2, "ccach": 2, "subsequ": [2, 5], "step": 2, "get": [2, 5, 7, 8], "more": [2, 3, 4, 5, 8], "toler": 2, "By": [2, 3, 8], "stop": 2, "But": [2, 8], "ahead": 2, "without": [2, 6], "shut": 2, "down": 2, "again": 2, "everyth": 2, "also": [2, 8], "subset": 2, "cycl": 2, "debian_x64": 2, "debian_i386": 2, "separ": 2, "shutdown": 2, "final": [2, 8], "join": 2, "ssh": 2, "shortcut": 2, "some": [2, 8], "debug": 2, "ani": [2, 4, 8], "manual": 2, "procedur": [2, 3], "configur": [1, 2], "vnc": 2, "server": 2, "local": [2, 7], "access": 2, "displai": 2, "krdc": 2, "compat": 2, "viewer": 2, "info": 2, "port": 2, "after": [2, 3], "releas": 2, "0": [2, 3, 4, 8], "current": [2, 7, 8], "prioriti": 2, "next": [2, 8], "autom": 2, "aarch64": [2, 6], "how": [2, 3, 4, 8], "creat": [2, 3, 8], "real": 2, "world": [2, 3, 7, 8], "librari": [2, 3, 7, 8], "raylib": [2, 4], "sqlite": [2, 3], "libsodium": 2, "illustr": [2, 7, 8], "work": [2, 4], "plan": 2, "eventu": 2, "necessarili": 2, "order": [2, 3], "pass": [2, 3, 8], "helper": 2, "add": [1, 2, 8], "parser": [2, 3], "wai": [2, 7, 8], "encod": [2, 8], "decod": 2, "byte": [2, 5, 8], "union": 2, "better": 2, "deal": [2, 3, 8], "caller": 2, "heap": [1, 2, 5], "etc": [2, 3], "powerpc": 2, "power9": 2, "assembl": [2, 5], "unwind": 2, "cfi": 2, "direct": [2, 8], "experi": 2, "program": [2, 3, 4], "It": [2, 3, 7, 8], "addon": 2, "interact": 2, "person": 2, "prefer": [2, 3], "goe": 2, "rather": 2, "like": [2, 7, 8], "care": 2, "templat": 2, "mainli": 2, "littl": 2, "orient": [2, 8], "i": [2, 8], "strongli": 2, "tag": 2, "over": 2, "inherit": 2, "virtual": 2, "method": 2, "except": [2, 3], "To": 3, "declar": [3, 7, 8], "share": [3, 7, 8], "const": [3, 7, 8], "requir": [3, 6, 7, 8], "lib": [3, 7, 8], "path": [3, 8], "extens": 3, "dll": [3, 7, 8], "dylib": 3, "from": [3, 4, 6, 8], "two": [3, 5, 8], "inspir": 3, "specifi": [3, 8], "its": [3, 8], "mangl": 3, "ellipsi": 3, "last": [3, 8], "printf": [3, 7], "func": [3, 7, 8], "int": [3, 7, 8], "atoi": [3, 4], "tri": 3, "convent": [3, 6, 7], "see": [3, 4, 8], "section": [3, 8], "inform": [3, 4, 8], "subject": 3, "shown": 3, "fmt": 3, "onli": [3, 6, 8], "per": 3, "process": 3, "32": 3, "bit": [3, 8], "form": 3, "descript": [3, 5], "__stdcall": [3, 8], "within": 3, "win32": [3, 7, 8], "fastcal": [3, 6], "__fastcal": 3, "rare": [3, 8], "ecx": 3, "edx": 3, "thiscal": [3, 6], "__thiscal": 3, "safe": 3, "simpli": [3, 8], "find": [3, 4, 7, 8], "show": [3, 7, 8], "user32": [3, 7], "equival": [3, 8], "messageboxa_1": 3, "messageboxa": [3, 7], "uint": [3, 7, 8], "messageboxa_2": 3, "hwnd": 3, "text": 3, "caption": 3, "async": [1, 3], "err": 3, "re": 3, "libc": [3, 7], "6": [3, 7, 8], "str": [3, 8], "1257": 3, "log": [3, 5, 8], "result": [3, 4, 7, 8], "hello": [3, 7, 8], "print": [3, 7, 8], "worker": 3, "your": [3, 4], "respons": 3, "data": [3, 4], "multi": 3, "easili": 3, "style": [3, 4], "promis": 3, "util": 3, "promisifi": 3, "cannot": [3, 5, 8], "must": 3, "addit": [3, 8], "expect": [3, 6, 8], "doubl": [3, 6, 8], "THE": 3, "end": 3, "s": [3, 8], "On": 3, "forward": [3, 6], "howev": [3, 8], "mani": [1, 3, 8], "simplici": [], "semant": [3, 8], "primit": [3, 4], "marshal": 3, "out": [3, 8], "timev": [3, 7], "inout": 3, "dual": 3, "same": [3, 5, 8], "msdn": 3, "qualifi": 3, "_out_": [3, 7, 8], "_inout_": [3, 8], "posix": 3, "gettimeofdai": [3, 7], "tv_sec": [3, 7], "tv_usec": [3, 7], "timezon": [3, 7], "tz_minuteswest": [3, 7], "tz_dsttime": [3, 7], "tv": [3, 7], "tz": [3, 7], "let": [3, 5, 7, 8], "databas": 3, "sqlite3_db": 3, "copi": [3, 8], "sqlite3_open_v2": 3, "sqlite_open_readwrit": 3, "0x2": 3, "sqlite_open_cr": 3, "0x4": 3, "db": 3, "throw": [3, 8], "sqlite3_close_v2": 3, "With": 3, "noth": 3, "examplecallback": 3, "sum": [3, 8], "adddoublefloat": 3, "f": [3, 8], "them": 8, "part": 3, "h": [3, 8], "transfertoj": 3, "ag": 3, "cb": 3, "buf": 3, "snprintf": 3, "sizeof": [3, 8], "transfercallback": 3, "ret": 3, "niel": 3, "42": [3, 8], "run": [1, 3, 4, 5, 7], "precis": [3, 6], "intepret": 3, "anoth": [3, 8], "undefin": [3, 8], "behavior": [3, 8], "lead": 3, "mess": [3, 8], "fast": 4, "easi": 4, "low": 4, "aggreg": 4, "both": [4, 8], "well": 4, "popular": 4, "os": [4, 6, 8], "combin": [4, 6], "introspect": 4, "variad": [4, 7], "thread": 4, "safeti": 4, "rand": 4, "contribut": 4, "bug": 4, "request": 4, "sourc": [4, 6], "todo": 4, "list": [4, 8], "changelog": 4, "free": [4, 8], "softwar": 4, "redistribut": 4, "modifi": [4, 8], "under": 4, "term": 4, "affero": 4, "gener": [4, 8], "public": 4, "publish": 4, "foundat": 4, "either": [4, 8], "www": 4, "org": 4, "prealloc": 5, "block": 5, "One": 5, "construct": 5, "assign": [5, 8], "mib": 5, "unless": 5, "veri": 5, "page": 5, "extra": 5, "ever": 5, "dure": 5, "config": 5, "obj": 5, "appli": [5, 8], "true": [5, 8], "made": 5, "unus": 5, "resid": 5, "still": 5, "finish": 5, "freed": 5, "resident_async_pool": 5, "left": 5, "sync_stack_s": 5, "sync_heap_s": 5, "async_stack_s": 5, "512": 5, "kib": 5, "async_heap_s": 5, "pool": 5, "moment": 6, "isa": 6, "freebsd": 6, "ia32": 6, "ye": 6, "x86_64": 6, "amd64": 6, "le": [6, 8], "probabl": 6, "fulli": 6, "green": 6, "check": 6, "mark": 6, "mean": [6, 8], "earlier": 6, "nvm": 6, "recent": 6, "distribut": 6, "ms": 6, "hard": 6, "vfp": 6, "coprocessor": 6, "differ": [6, 8], "softfp": 6, "soft": 6, "theori": 6, "lp64f": 6, "prototyp": 7, "languag": 7, "syntax": 7, "time_t": 7, "tm": 7, "tm_sec": 7, "tm_min": 7, "tm_hour": 7, "tm_mdai": 7, "tm_mon": 7, "tm_year": 7, "tm_wdai": 7, "tm_ydai": 7, "tm_isdst": 7, "localtime_r": 7, "format": 7, "02d": 7, "target": 7, "messagebox": 7, "messag": 7, "user": [7, 8], "constant": 7, "mb_iconinform": 7, "0x40": 7, "foobar": [], "while": 8, "allow": 8, "variat": 8, "enforc": 8, "signed": 8, "valid": 8, "int8": 8, "int8_t": 8, "uint8": 8, "uint8_t": 8, "uchar": 8, "int16": 8, "int16_t": 8, "uint16": 8, "uint16_t": 8, "short": 8, "int32": 8, "4": [4, 8], "int32_t": 8, "uint32": 8, "uint32_t": 8, "int64": 8, "uint64": 8, "longlong": 8, "ulonglong": 8, "float32": 8, "float64": 8, "accept": 8, "bigint": 8, "exce": 8, "rang": 8, "revers": 8, "few": 8, "boolean": 8, "bool": 8, "usual": 8, "ulong": 8, "utf": 8, "string16": 8, "line": 8, "struct1": 8, "dummi": 8, "struct2": 8, "vice": 8, "versa": 8, "unlik": 8, "omit": 8, "anonym": 8, "typedef": 8, "b": 8, "d1": 8, "d2": 8, "rule": 8, "regard": 8, "pad": 8, "latter": 8, "function1": 8, "function2": 8, "differenti": 8, "purpos": 8, "import": 8, "distinguish": 8, "fall": 8, "avoid": 8, "expens": 8, "doe": 8, "sqlite3_stmt": [], "someth": 8, "stabil": 8, "prevent": 8, "dynam": 8, "termin": 8, "length": 8, "lot": 8, "getcursorpo": 8, "retriev": 8, "cursor": 8, "posit": 8, "kernel32": 8, "x": 8, "y": 8, "po": 8, "kind": 8, "pair": 8, "dedic": 8, "delet": 8, "obviou": 8, "found": 8, "stdio": 8, "fopen": 8, "fclose": 8, "manipul": 8, "fread": 8, "ftell": 8, "manag": 8, "builder": 8, "concaten": 8, "fizzbuzz": 8, "hidden": 8, "behind": 8, "destroi": 8, "concatnew": 8, "concatnewout": 8, "concatfre": 8, "clang": 8, "fpic": 8, "wall": 8, "o2": 8, "stdlib": 8, "stdbool": 8, "errno": 8, "fragment": 8, "size_t": 8, "len": 8, "concat": 8, "malloc": 8, "fprintf": 8, "stderr": 8, "strerror": 8, "concatappend": 8, "frag": 8, "strlen": 8, "memcpi": 8, "concatbuild": 8, "r": 8, "stupid": 8, "try": 8, "failur": 8, "buzz": 8, "fizz": 8, "infer": 8, "itself": 8, "sentinel": 8, "translat": 8, "proper": 8, "notion": 8, "fat": 8, "yourself": 8, "calcul": 8, "stdint": 8, "computetotallength": 8, "ptr": 8, "14n": [], "just": 8, "findfirstfilew": 8, "findnextfilew": 8, "filetim": 8, "dwlowdatetim": 8, "dwhighdatetim": 8, "win32_find_data": 8, "dwfileattribut": 8, "ftcreationtim": 8, "ftlastaccesstim": 8, "ftlastwritetim": 8, "nfilesizehigh": 8, "nfilesizelow": 8, "dwreserved0": 8, "dwreserved1": 8, "cfilenam": 8, "260": 8, "calternatefilenam": 8, "dwfiletyp": 8, "obsolet": 8, "dwcreatortyp": 8, "wfinderflag": 8, "ushort": 8, "findfirstfil": 8, "findnextfil": 8, "findclos": 8, "getlasterror": 8, "dirnam": 8, "filenam": [3, 8], "error_file_not_found": 8, "error_no_more_fil": 8, "among": 8, "variabl": 8, "invol": 8, "list1": 8, "list2": 8, "thank": 8, "singl": 8, "element": 8, "store": 8, "addint": 8, "dest": 8, "36": 8, "degener": 8, "emb": 8, "correct": 8, "uint8arrai": 8, "those": 8, "exactli": 8, "foo1": 8, "foo": 8, "a16": 8, "foo2": 8, "hypothet": 8, "returnfoo1": 8, "returnfoo": 8, "p": 8, "returnfoo2": 8, "int16arrai": 8, "fill": 8, "truncat": 8, "alwai": 8, "nul": 8, "explicitli": 8, "ask": 8, "explor": 8, "alignof": 8, "simplic": 3, "ve": 3, "warn": 3, "regist": 5, "There": 5, "max_async_cal": [1, 5], "maximum": [1, 5], "ongo": 5, "256": 5, "leak": 1}, "objects": {}, "objtypes": {}, "objnames": {}, "titleterms": {"benchmark": 0, "rand": 0, "result": 0, "linux": [0, 7], "x86_64": 0, "window": [0, 2, 7], "atoi": 0, "raylib": 0, "run": [0, 2], "changelog": 1, "koffi": [1, 4], "1": [1, 4], "3": [1, 4], "4": 1, "2": 1, "0": 1, "contribut": 2, "bug": 2, "featur": 2, "request": 2, "build": 2, "from": 2, "sourc": 2, "other": 2, "platform": [2, 6], "test": 2, "todo": 2, "list": 2, "code": 2, "style": 2, "function": 3, "call": 3, "definit": 3, "classic": 3, "syntax": 3, "c": [3, 8], "like": 3, "prototyp": 3, "synchron": 3, "asynchron": 3, "variad": 3, "output": 3, "paramet": 3, "struct": [3, 8], "exampl": [3, 7], "opaqu": [3, 8], "handl": [3, 8], "javascript": 3, "callback": 3, "thread": 3, "safeti": 3, "overview": 4, "tabl": 4, "content": 4, "licens": 4, "memori": 5, "usag": 5, "how": 5, "work": 5, "default": 5, "set": 5, "support": 6, "quick": 7, "start": 7, "small": 7, "data": 8, "type": 8, "primit": 8, "pointer": 8, "arrai": 8, "fix": 8, "size": 8, "string": 8, "introspect": 8, "5": [1, 4]}, "envversion": {"sphinx.domains.c": 2, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 6, "sphinx.domains.index": 1, "sphinx.domains.javascript": 2, "sphinx.domains.math": 2, "sphinx.domains.python": 3, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx": 56}})
|
|
1
|
+
Search.setIndex({"docnames": ["benchmarks", "changes", "contribute", "functions", "index", "memory", "platforms", "start", "types"], "filenames": ["benchmarks.md", "changes.md", "contribute.md", "functions.md", "index.rst", "memory.md", "platforms.md", "start.md", "types.md"], "titles": ["Benchmarks", "Changelog", "Contributing", "Function calls", "Koffi 1.3.8", "Memory usage", "Requirements", "Quick start", "Data types"], "terms": {"here": [0, 2, 3, 4, 8], "quick": [0, 4], "execut": [0, 3], "time": [0, 2, 5, 7], "koffi": [0, 2, 3, 5, 6, 8], "call": [0, 1, 4, 5, 6, 7, 8], "three": [0, 7, 8], "where": [0, 3, 8], "compar": 0, "theoret": 0, "ideal": 0, "ffi": [0, 1, 3, 4, 7], "implement": [0, 8], "approxim": [0, 8], "pre": 0, "compil": [0, 1, 6], "static": 0, "n": [0, 2, 4, 6, 7, 8], "api": [0, 2, 3, 4, 6, 7, 8], "glue": 0, "code": [0, 1, 3, 4, 5], "The": [0, 1, 2, 3, 5, 6, 7, 8], "first": [0, 2, 3, 7, 8], "base": [0, 3, 4, 8], "second": [0, 3, 7, 8], "third": 0, "These": [0, 2, 3, 8], "ar": [0, 1, 2, 3, 5, 6, 7, 8], "detail": 0, "explain": 0, "below": [0, 1, 2, 3, 7, 8], "node": [0, 1, 2, 3, 4, 7], "napi": 0, "present": 0, "were": 0, "measur": 0, "my": [0, 2], "machin": [0, 2], "intel": 0, "core": 0, "i5": 0, "4460": 0, "thi": [0, 1, 2, 3, 4, 7, 8], "test": [0, 1, 4, 6], "around": [0, 5, 8], "repeat": 0, "simpl": [0, 2, 3, 8], "standard": [0, 3, 8], "c": [0, 1, 2, 4, 5, 6, 7], "function": [0, 1, 2, 4, 7, 8], "ha": [0, 2, 3, 8], "one": [0, 2, 3, 5, 7, 8], "refer": [0, 4, 8], "through": [0, 3, 8], "an": [0, 3, 5, 8], "modul": [0, 1, 4], "close": [0, 8], "limit": [0, 1], "perfect": 0, "overhead": [0, 4], "js": [0, 1, 2, 3, 4, 8], "us": [0, 1, 2, 3, 4, 5, 6, 7, 8], "offici": [0, 2, 6], "iter": [0, 8], "rel": 0, "perform": [0, 4], "rand_napi": 0, "644": 0, "ns": 0, "x1": 0, "00": 0, "ref": 0, "rand_koffi": 0, "950": 0, "x0": 0, "68": 0, "48": 0, "rand_node_ffi": 0, "30350": 0, "02": 0, "4613": 0, "becaus": [0, 2, 3, 8], "pretti": [0, 2], "small": [0, 3, 4], "clearli": 0, "visibl": 0, "similar": [0, 3], "which": [0, 2, 6, 7], "take": [0, 3, 8], "string": [0, 1, 2, 3, 5, 7], "paramet": [0, 4, 7, 8], "javascript": [0, 4, 8], "v8": [0, 3], "convers": [0, 1, 8], "slow": [0, 2], "heavi": 0, "atoi_napi": 0, "1104": 0, "atoi_koffi": 0, "1778": 0, "62": 0, "61": 0, "atoi_node_ffi": 0, "125300": 0, "009": 0, "11250": 0, "cpu": 0, "imag": 0, "draw": 0, "much": [0, 2], "heavier": 0, "than": [0, 5], "thu": 0, "reduc": [0, 1], "In": [0, 3, 8], "baselin": 0, "full": [0, 2, 8], "version": [0, 1, 3, 4, 6, 8], "nativ": [0, 3], "wrapper": [0, 2], "raylib_cc": 0, "215": 0, "7": [0, 4, 7], "\u00b5s": 0, "20": 0, "17": [0, 6], "raylib_node_raylib": 0, "258": 0, "9": [0, 1], "raylib_koffi": 0, "311": 0, "6": [0, 3, 4, 7, 8], "83": 0, "raylib_node_ffi": 0, "928": 0, "4": [0, 4, 8], "28": 0, "259": 0, "965": 0, "1248": 0, "77": 0, "29": 0, "41500": 0, "4203": 0, "1393": 0, "2246": 0, "157550": 0, "11210": 0, "without": [0, 2, 6], "ani": [0, 2, 4, 8], "211": 0, "8": [0, 2, 3, 6, 7, 8], "25": 0, "264": 0, "318": 0, "21": 0, "1146": 0, "2": [0, 4, 5, 6, 8], "23": 0, "334": 0, "pleas": 0, "note": [0, 2, 8], "order": [0, 2, 3], "get": [0, 2, 5, 7, 8], "fair": 0, "number": [0, 1, 5, 8], "wa": 0, "recompil": 0, "clang": [0, 1, 8], "cl": 0, "befor": [0, 1, 2, 8], "follow": [0, 2, 3, 6, 8], "command": [0, 2], "cd": [0, 2], "node_modul": 0, "rmdir": 0, "s": [0, 3, 8], "q": [0, 2], "bin": 0, "build": [0, 1, 4, 6, 8], "npx": 0, "cmake": [0, 2], "t": 0, "clangcl": 0, "open": [0, 3, 8], "consol": [0, 3, 5, 8], "go": [0, 2], "cnoke": [0, 2], "do": [0, 2, 3, 7, 8], "anyth": 0, "els": [0, 8], "all": [0, 1, 6, 8], "made": [0, 5], "built": 0, "binari": [0, 1, 2, 6], "prefer": [0, 2, 3], "onc": [0, 2, 3, 5, 7, 8], "everyth": [0, 2], "readi": 0, "main": [1, 3], "fix": [1, 2, 4], "prevent": [1, 8], "callback": [1, 4, 5, 6, 8], "reus": 1, "beyond": 1, "increas": [], "trampolin": [], "32": 3, "other": [1, 3, 8], "chang": [1, 2, 3, 5, 8], "harmon": 1, "few": [1, 8], "error": [1, 3, 8], "messag": [1, 7], "crash": [1, 3], "when": [1, 2, 3, 5, 8], "insid": 1, "struct": [1, 2, 4, 5, 7], "support": [1, 2, 3, 4, 8], "null": [1, 3, 7, 8], "record": 1, "member": [1, 3, 8], "add": [1, 2, 8], "intptr_t": [1, 8], "uintptr_t": [1, 8], "primit": [1, 3, 4], "type": [1, 2, 3, 4, 7], "str": [1, 3, 7, 8], "str16": [1, 7, 8], "alias": 1, "string16": [1, 8], "variou": [1, 2], "document": [1, 8], "improv": [1, 2], "instal": [1, 2, 4, 6], "15": [1, 6, 8], "window": [1, 4, 6], "system": [1, 2, 7], "bug": [1, 4], "detect": 1, "incompat": 1, "prebuild": 1, "x64": 1, "linux": [1, 2, 4, 6], "memori": [1, 2, 3, 4, 8], "leak": 1, "mani": [1, 3, 8], "async": [1, 3], "run": [1, 3, 4, 5, 7], "configur": [1, 2], "maximum": [1, 5], "max_async_cal": [1, 5], "default": [1, 2, 3, 4, 8], "stack": [1, 5], "heap": [1, 2, 5], "size": [1, 2, 4, 5], "possibl": [1, 2, 8], "openbsd": [1, 6], "i386": 1, "void": [1, 3, 7, 8], "misconvers": 1, "sign": [1, 8], "integ": [1, 3, 8], "return": [1, 3, 8], "valu": [1, 3, 4, 7, 8], "unsign": [1, 3, 7, 8], "empti": 1, "signatur": 1, "disabl": [1, 2], "unsaf": 1, "optim": [1, 2], "14": [1, 6, 8], "mode": 1, "grace": 1, "degrad": 1, "older": [1, 6], "toolchain": 1, "debian": [1, 2], "prebuilt": [1, 2, 6], "rebuild": 1, "happen": [1, 3, 5, 8], "fail": [1, 2, 3, 8], "load": [1, 3, 7, 8], "major": 1, "expand": 1, "move": 1, "http": [1, 2, 4], "dev": [1, 2], "arrai": [1, 2, 4], "typedarrai": [1, 8], "pointer": [1, 3, 4], "argument": [1, 3, 7, 8], "input": [1, 3, 8], "output": [1, 4, 7, 8], "mix": [1, 2, 8], "convert": [1, 3, 8], "instead": [1, 2, 8], "hint": [1, 8], "char": [1, 3, 7, 8], "char16": [1, 8], "char16_t": [1, 8], "definit": [1, 4, 8], "long": [1, 8], "llp64": [1, 8], "model": 1, "restrict": [1, 2], "automat": [1, 2, 3, 8], "float": [1, 3, 6, 8], "point": [1, 8], "abi": [1, 2, 6, 8], "arm32": [1, 6], "risc": [1, 6], "v": [1, 6], "forbid": 1, "duplic": 1, "name": [1, 2, 3, 8], "new": [1, 3, 5, 8], "featur": [1, 4], "arm64": [1, 2, 6], "now": [1, 2, 7, 8], "A": [1, 6, 8], "maco": [1, 2, 6], "m1": 1, "includ": [1, 2, 3, 6, 8], "entri": 1, "sinc": [1, 4], "can": [1, 2, 3, 4, 5, 6, 7, 8], "cdecl": [1, 3, 6], "stdcall": [1, 3, 6, 7], "platform": [1, 3, 4, 5, 8], "64": [1, 3, 5, 6, 8], "lp64d": [1, 6], "lp64": [1, 6, 8], "untest": [1, 6], "expos": [1, 8], "set": [1, 2, 4], "usag": [1, 4], "synchron": [1, 4, 5], "asynchron": [1, 4, 5], "transpar": [1, 8], "between": [1, 3], "buffer": [1, 8], "tent": 1, "excess": 1, "align": [1, 8], "x86": [1, 3, 6, 7], "potenti": [1, 8], "problem": 1, "big": [1, 3, 5, 8], "int64_t": [1, 7, 8], "uint64_t": [1, 8], "layout": 1, "push": [1, 8], "pop": 1, "issu": [1, 2, 3], "incomplet": 1, "buggi": 1, "hfa": [1, 2], "caus": [1, 3], "miss": [1, 2], "map_stack": 1, "flag": 1, "non": [1, 3, 8], "sens": 1, "intern": [1, 8], "fals": [1, 8], "normal": [1, 5, 8], "make": [1, 2], "sure": [1, 2], "we": [1, 2, 8], "have": [1, 2, 7, 8], "redzon": 1, "architectur": [1, 2, 3, 4, 6, 8], "slower": 1, "alloc": [1, 2, 5, 8], "object": [1, 2, 3, 5, 8], "repositori": 2, "luigi": 2, "monorepo": 2, "contain": [2, 8], "multipl": 2, "project": 2, "idea": 2, "github": 2, "com": 2, "koromix": 2, "provid": [2, 3, 8], "packag": [2, 6], "npm": [2, 6, 7], "archiv": 2, "so": [2, 3, 7, 8], "most": [2, 3, 8], "case": [2, 3, 8], "should": 2, "If": [2, 3, 8], "you": [2, 3, 4, 6, 7, 8], "want": [2, 7], "hack": 2, "specif": [2, 5], "instruct": [2, 3], "start": [2, 3, 4], "clone": 2, "git": 2, "As": 2, "said": 2, "monorepositori": 2, "conta": 2, "henc": 2, "depend": [2, 3, 8], "met": 2, "desktop": 2, "develop": 2, "workload": 2, "visual": 2, "studio": 2, "2022": 2, "2019": 2, "tool": 2, "option": [2, 3, 4, 8], "compon": 2, "meta": 2, "12": [2, 6], "later": [2, 4, 6], "done": [2, 3, 8], "benchmark": [2, 4], "directori": [2, 8], "what": 2, "gcc": 2, "g": [2, 3, 8], "3": [2, 6, 8], "newer": [2, 6], "gnu": [2, 4], "81": 2, "emul": 2, "acceler": 2, "qemu": 2, "need": [2, 3, 8], "even": 2, "gui": 2, "ubuntu": 2, "directli": [2, 8], "licens": 2, "reason": [2, 8], "thei": [2, 3, 8], "avail": [2, 5], "file": [2, 3, 8], "For": [2, 3, 5, 6, 8], "exampl": [2, 4, 8], "wget": 2, "o": [2, 8], "qemu_debian_arm64": 2, "tar": 2, "zst": 2, "zstd": 2, "d": [2, 3, 8], "xv": 2, "sha256sum": 2, "ignor": [2, 3], "registri": 2, "txt": 2, "disk": 2, "content": [2, 8], "mai": [2, 3], "each": [2, 3, 8], "checksum": 2, "been": [2, 3], "least": [2, 5], "And": [2, 7], "sever": [2, 3], "help": 2, "patient": 2, "ccach": 2, "subsequ": [2, 5], "step": 2, "more": [2, 3, 4, 5, 6, 8], "toler": 2, "By": [2, 3, 8], "stop": 2, "But": [2, 8], "ahead": 2, "shut": 2, "down": 2, "again": 2, "also": [2, 8], "subset": 2, "cycl": 2, "debian_x64": 2, "debian_i386": 2, "separ": 2, "shutdown": 2, "final": [2, 8], "join": 2, "ssh": 2, "shortcut": 2, "some": [2, 8], "debug": 2, "manual": 2, "procedur": [2, 3], "vnc": 2, "server": 2, "local": [2, 7], "access": 2, "displai": 2, "krdc": 2, "compat": 2, "viewer": 2, "info": 2, "port": 2, "plan": 2, "necessarili": 2, "better": 2, "wai": [2, 7, 8], "deal": [2, 3, 8], "caller": 2, "etc": [2, 3], "pass": [2, 3, 8], "avoid": [2, 8], "properti": 2, "helper": 2, "autom": 2, "aarch64": [2, 6], "how": [2, 3, 4, 8], "thank": [2, 8], "appl": 2, "creat": [2, 3, 8], "real": 2, "world": [2, 3, 7, 8], "librari": [2, 3, 7, 8], "raylib": 2, "sqlite": [2, 3], "libsodium": 2, "illustr": [2, 7, 8], "parser": [2, 3], "encod": [2, 8], "decod": 2, "byte": [2, 5, 8], "union": 2, "powerpc": 2, "power9": 2, "assembl": [2, 5], "unwind": 2, "cfi": 2, "direct": [2, 8], "experi": 2, "program": [2, 3, 4], "It": [2, 3, 7, 8], "addon": 2, "interact": 2, "person": 2, "goe": 2, "rather": 2, "like": [2, 7, 8], "care": 2, "templat": 2, "mainli": 2, "littl": 2, "orient": [2, 8], "i": [2, 8], "strongli": 2, "tag": 2, "over": 2, "inherit": 2, "virtual": 2, "method": 2, "except": [1, 2, 3], "To": 3, "declar": [3, 7, 8], "share": [3, 7, 8], "filenam": [3, 8], "const": [3, 7, 8], "requir": [3, 4, 7, 8], "lib": [3, 7, 8], "path": [3, 8], "extens": 3, "dll": [3, 7, 8], "dylib": 3, "from": [3, 4, 6, 8], "two": [3, 5, 8], "inspir": 3, "specifi": [3, 8], "its": [3, 8], "mangl": 3, "ellipsi": 3, "last": [3, 8], "printf": [3, 7], "func": [3, 7, 8], "int": [3, 7, 8], "atoi": 3, "tri": 3, "convent": [3, 6, 7], "see": [3, 4, 8], "section": [3, 8], "inform": [3, 4, 8], "subject": 3, "shown": 3, "fmt": 3, "onli": [3, 6, 8], "per": 3, "process": 3, "bit": [3, 8], "form": 3, "descript": [3, 5], "__stdcall": [3, 8], "within": 3, "win32": [3, 7, 8], "fastcal": [3, 6], "__fastcal": 3, "rare": [3, 8], "ecx": 3, "edx": 3, "thiscal": [3, 6], "__thiscal": 3, "safe": 3, "simpli": [3, 8], "find": [3, 4, 7, 8], "show": [3, 7, 8], "user32": [3, 7], "equival": [3, 8], "messageboxa_1": 3, "messageboxa": [3, 7], "uint": [3, 7, 8], "messageboxa_2": 3, "hwnd": 3, "text": 3, "caption": 3, "err": 3, "re": 3, "libc": [3, 7], "1257": 3, "log": [3, 5, 8], "result": [3, 7, 8], "hello": [3, 7, 8], "print": [3, 7, 8], "worker": 3, "your": [3, 4], "respons": 3, "data": [3, 4], "multi": 3, "easili": 3, "style": [3, 4], "promis": 3, "util": 3, "promisifi": 3, "cannot": [3, 5, 8], "must": 3, "addit": [3, 8], "expect": [3, 6, 8], "5": [3, 4, 8], "doubl": [3, 6, 8], "THE": 3, "end": 3, "On": 3, "forward": [3, 6], "howev": [3, 8], "simplic": 3, "semant": [3, 8], "marshal": 3, "out": [3, 8], "e": [3, 8], "timev": [3, 7], "inout": 3, "dual": 3, "same": [3, 5, 8], "msdn": 3, "qualifi": 3, "_out_": [3, 7, 8], "_inout_": [3, 8], "posix": 3, "gettimeofdai": [3, 7], "tv_sec": [3, 7], "tv_usec": [3, 7], "timezon": [3, 7], "tz_minuteswest": [3, 7], "tz_dsttime": [3, 7], "tv": [3, 7], "tz": [3, 7], "let": [3, 5, 7, 8], "databas": 3, "sqlite3_db": 3, "copi": [3, 8], "after": 3, "sqlite3_open_v2": 3, "sqlite3_close_v2": 3, "sqlite_open_readwrit": 3, "0x2": 3, "sqlite_open_cr": 3, "0x4": [3, 7], "db": 3, "0": [3, 4, 6, 8], "throw": [3, 8], "With": 3, "noth": 3, "examplecallback": 3, "sum": [3, 8], "adddoublefloat": 3, "f": [3, 8], "part": 3, "h": [3, 8], "transfertoj": 3, "ag": 3, "cb": 3, "buf": 3, "snprintf": 3, "sizeof": [3, 8], "transfercallback": 3, "ret": [3, 7], "niel": 3, "27": 3, "42": [3, 8], "precis": [3, 6], "intepret": 3, "anoth": [3, 7, 8], "undefin": [3, 8], "behavior": [3, 8], "lead": 3, "mess": [3, 8], "ve": 3, "warn": 3, "fast": 4, "easi": 4, "low": 4, "aggreg": 4, "both": [4, 8], "well": 4, "popular": 4, "os": [4, 6, 8], "combin": [4, 6], "recent": [4, 6], "page": [4, 5], "introspect": 4, "variad": [4, 7], "thread": 4, "safeti": 4, "work": 4, "x86_64": [4, 6], "contribut": 4, "request": 4, "sourc": [4, 6], "todo": 4, "list": [4, 8], "changelog": 4, "free": [4, 8], "softwar": 4, "redistribut": 4, "modifi": [4, 8], "under": 4, "term": 4, "affero": 4, "gener": [4, 8], "public": 4, "publish": 4, "foundat": 4, "either": [4, 8], "www": 4, "org": 4, "prealloc": 5, "block": 5, "One": 5, "construct": 5, "assign": [5, 8], "regist": [5, 8], "1": [5, 6, 7, 8], "mib": 5, "unless": 5, "veri": 5, "extra": 5, "ever": 5, "dure": 5, "config": 5, "obj": 5, "appli": [5, 8], "true": [5, 8], "unus": 5, "resid": 5, "still": 5, "finish": 5, "freed": 5, "resident_async_pool": 5, "left": 5, "There": 5, "sync_stack_s": 5, "sync_heap_s": 5, "async_stack_s": 5, "256": 5, "kib": 5, "async_heap_s": 5, "512": 5, "pool": 5, "ongo": 5, "22": 6, "x": [6, 8], "16": [6, 7, 8], "nvm": 6, "distribut": 6, "moment": 6, "isa": 6, "freebsd": 6, "ia32": 6, "ye": 6, "amd64": 6, "le": [6, 8], "probabl": 6, "fulli": 6, "green": 6, "check": 6, "mark": 6, "mean": [6, 8], "ms": 6, "hard": 6, "vfp": 6, "coprocessor": 6, "differ": [6, 8], "softfp": 6, "soft": 6, "theori": 6, "lp64f": 6, "prototyp": 7, "languag": 7, "syntax": 7, "localtime_r": 7, "current": [7, 8], "time_t": 7, "tm": 7, "tm_sec": 7, "tm_min": 7, "tm_hour": 7, "tm_mdai": 7, "tm_mon": 7, "tm_year": 7, "tm_wdai": 7, "tm_ydai": 7, "tm_isdst": 7, "format": 7, "02d": 7, "target": 7, "messagebox": 7, "user": [7, 8], "utf": [7, 8], "constant": 7, "mb_ok": 7, "0x0": 7, "mb_yesno": 7, "mb_iconquest": 7, "0x20": 7, "mb_iconinform": 7, "0x40": 7, "idok": 7, "idy": 7, "idno": 7, "messageboxw": 7, "box": 7, "while": 8, "allow": 8, "variat": 8, "enforc": 8, "signed": 8, "valid": 8, "int8": 8, "int8_t": 8, "uint8": 8, "uint8_t": 8, "uchar": 8, "int16": 8, "int16_t": 8, "uint16": 8, "uint16_t": 8, "short": 8, "int32": 8, "int32_t": 8, "uint32": 8, "uint32_t": 8, "int64": 8, "uint64": 8, "longlong": 8, "ulonglong": 8, "float32": 8, "float64": 8, "accept": 8, "bigint": 8, "exce": 8, "rang": 8, "revers": 8, "defin": 8, "boolean": 8, "bool": 8, "usual": 8, "ulong": 8, "intptr": 8, "width": 8, "uintptr": 8, "line": 8, "struct1": 8, "dummi": 8, "struct2": 8, "vice": 8, "versa": 8, "unlik": 8, "omit": 8, "anonym": 8, "typedef": 8, "b": 8, "d1": 8, "d2": 8, "rule": 8, "regard": 8, "pad": 8, "latter": 8, "function1": 8, "function2": 8, "differenti": 8, "purpos": 8, "import": 8, "distinguish": 8, "them": 8, "fall": 8, "expens": 8, "doe": 8, "someth": 8, "stabil": 8, "dynam": 8, "termin": 8, "sentinel": 8, "length": 8, "lot": 8, "getcursorpo": 8, "retriev": 8, "cursor": 8, "posit": 8, "kernel32": 8, "y": 8, "po": 8, "kind": 8, "pair": 8, "dedic": 8, "delet": 8, "obviou": 8, "found": 8, "stdio": 8, "fopen": 8, "fclose": 8, "manipul": 8, "fread": 8, "ftell": 8, "manag": 8, "builder": 8, "concaten": 8, "fizzbuzz": 8, "hidden": 8, "behind": 8, "destroi": 8, "concatnew": 8, "concatnewout": 8, "concatfre": 8, "fpic": 8, "wall": 8, "o2": 8, "stdlib": 8, "stdbool": 8, "errno": 8, "fragment": 8, "next": 8, "size_t": 8, "len": 8, "concat": 8, "total": 8, "malloc": 8, "fprintf": 8, "stderr": 8, "strerror": 8, "concatappend": 8, "frag": 8, "strlen": 8, "memcpi": 8, "concatbuild": 8, "r": 8, "stupid": 8, "try": 8, "failur": 8, "30": 8, "buzz": 8, "fizz": 8, "infer": 8, "itself": 8, "translat": 8, "proper": 8, "notion": 8, "fat": 8, "yourself": 8, "calcul": 8, "stdint": 8, "computetotallength": 8, "ptr": 8, "just": 8, "findfirstfilew": 8, "findnextfilew": 8, "filetim": 8, "dwlowdatetim": 8, "dwhighdatetim": 8, "win32_find_data": 8, "dwfileattribut": 8, "ftcreationtim": 8, "ftlastaccesstim": 8, "ftlastwritetim": 8, "nfilesizehigh": 8, "nfilesizelow": 8, "dwreserved0": 8, "dwreserved1": 8, "cfilenam": 8, "260": 8, "calternatefilenam": 8, "dwfiletyp": 8, "obsolet": 8, "dwcreatortyp": 8, "wfinderflag": 8, "ushort": 8, "findfirstfil": 8, "findnextfil": 8, "findclos": 8, "getlasterror": 8, "dirnam": 8, "error_file_not_found": 8, "18": 8, "error_no_more_fil": 8, "among": 8, "variabl": 8, "invol": 8, "list1": 8, "list2": 8, "singl": 8, "element": 8, "store": 8, "addint": 8, "dest": 8, "36": 8, "degener": 8, "emb": 8, "correct": 8, "uint8arrai": 8, "those": 8, "exactli": 8, "foo1": 8, "foo": 8, "a16": 8, "foo2": 8, "hypothet": 8, "returnfoo1": 8, "returnfoo": 8, "p": 8, "returnfoo2": 8, "int16arrai": 8, "fill": 8, "truncat": 8, "alwai": 8, "nul": 8, "explicitli": 8, "ask": 8, "explor": 8, "alignof": 8, "bti": 1, "aaarch64": 1}, "objects": {}, "objtypes": {}, "objnames": {}, "titleterms": {"benchmark": 0, "overview": [0, 4], "linux": [0, 7], "x86_64": 0, "rand": 0, "result": 0, "atoi": 0, "raylib": 0, "window": [0, 2, 7], "run": [0, 2], "changelog": 1, "koffi": [1, 4, 7], "1": [1, 4], "3": [1, 4], "8": [1, 4], "7": 1, "6": 1, "5": 1, "4": 1, "2": 1, "0": 1, "contribut": 2, "bug": 2, "featur": 2, "request": 2, "build": 2, "from": 2, "sourc": 2, "other": 2, "platform": [2, 6], "test": 2, "todo": 2, "list": 2, "code": 2, "style": 2, "function": 3, "call": 3, "definit": 3, "classic": 3, "syntax": 3, "c": [3, 8], "like": 3, "prototyp": 3, "synchron": 3, "asynchron": 3, "variad": 3, "output": 3, "paramet": 3, "struct": [3, 8], "exampl": [3, 7], "opaqu": [3, 8], "handl": [3, 8], "javascript": 3, "callback": 3, "thread": 3, "safeti": 3, "tabl": 4, "content": 4, "licens": 4, "memori": 5, "usag": 5, "how": 5, "work": 5, "default": 5, "set": 5, "requir": 6, "node": 6, "js": 6, "support": 6, "quick": 7, "start": 7, "instal": 7, "small": 7, "data": 8, "type": 8, "primit": 8, "pointer": 8, "arrai": 8, "fix": 8, "size": 8, "string": 8, "introspect": 8}, "envversion": {"sphinx.domains.c": 2, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 6, "sphinx.domains.index": 1, "sphinx.domains.javascript": 2, "sphinx.domains.math": 2, "sphinx.domains.python": 3, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx": 56}})
|
package/doc/dist/html/start.html
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
<head><meta charset="utf-8"/>
|
|
4
4
|
<meta name="viewport" content="width=device-width,initial-scale=1"/>
|
|
5
5
|
<meta name="color-scheme" content="light dark"><meta name="generator" content="Docutils 0.18.1: http://docutils.sourceforge.net/" />
|
|
6
|
-
<link rel="index" title="Index" href="genindex" /><link rel="search" title="Search" href="search" /><link rel="next" title="Data types" href="types" /><link rel="prev" title="
|
|
6
|
+
<link rel="index" title="Index" href="genindex" /><link rel="search" title="Search" href="search" /><link rel="next" title="Data types" href="types" /><link rel="prev" title="Requirements" href="platforms" />
|
|
7
7
|
|
|
8
|
-
<meta name="generator" content="sphinx-5.0.
|
|
8
|
+
<meta name="generator" content="sphinx-5.0.2, furo 2022.06.21"/>
|
|
9
9
|
<title>Quick start - Koffi</title>
|
|
10
10
|
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
|
|
11
11
|
<link rel="stylesheet" type="text/css" href="_static/styles/furo.css?digest=40978830699223671f4072448e654b5958f38b89" />
|
|
@@ -162,7 +162,7 @@
|
|
|
162
162
|
</form>
|
|
163
163
|
<div id="searchbox"></div><div class="sidebar-scroll"><div class="sidebar-tree">
|
|
164
164
|
<ul class="current">
|
|
165
|
-
<li class="toctree-l1"><a class="reference internal" href="platforms">
|
|
165
|
+
<li class="toctree-l1"><a class="reference internal" href="platforms">Requirements</a></li>
|
|
166
166
|
<li class="toctree-l1 current current-page"><a class="current reference internal" href="#">Quick start</a></li>
|
|
167
167
|
<li class="toctree-l1"><a class="reference internal" href="types">Data types</a></li>
|
|
168
168
|
<li class="toctree-l1"><a class="reference internal" href="functions">Function calls</a></li>
|
|
@@ -205,8 +205,10 @@
|
|
|
205
205
|
<article role="main">
|
|
206
206
|
<section id="quick-start">
|
|
207
207
|
<h1>Quick start<a class="headerlink" href="#quick-start" title="Permalink to this heading">#</a></h1>
|
|
208
|
+
<section id="install-koffi">
|
|
209
|
+
<h2>Install Koffi<a class="headerlink" href="#install-koffi" title="Permalink to this heading">#</a></h2>
|
|
208
210
|
<p>You can install Koffi with npm:</p>
|
|
209
|
-
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>npm install koffi
|
|
211
|
+
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span><span class="linenos">1</span>npm install koffi
|
|
210
212
|
</pre></div>
|
|
211
213
|
</div>
|
|
212
214
|
<p>Once you have installed Koffi, you can start by loading it this way:</p>
|
|
@@ -218,6 +220,7 @@
|
|
|
218
220
|
<li><p>The first one runs on Linux. The functions are declared with the C-like prototype language.</p></li>
|
|
219
221
|
<li><p>The second one runs on Windows, and uses the node-ffi like syntax to declare functions.</p></li>
|
|
220
222
|
</ul>
|
|
223
|
+
</section>
|
|
221
224
|
<section id="small-linux-example">
|
|
222
225
|
<h2>Small Linux example<a class="headerlink" href="#small-linux-example" title="Permalink to this heading">#</a></h2>
|
|
223
226
|
<p>This is a small example for Linux systems, which uses <code class="docutils literal notranslate"><span class="pre">gettimeofday()</span></code>, <code class="docutils literal notranslate"><span class="pre">localtime_r()</span></code> and <code class="docutils literal notranslate"><span class="pre">printf()</span></code> to print the current time.</p>
|
|
@@ -269,19 +272,28 @@
|
|
|
269
272
|
<section id="small-windows-example">
|
|
270
273
|
<h2>Small Windows example<a class="headerlink" href="#small-windows-example" title="Permalink to this heading">#</a></h2>
|
|
271
274
|
<p>This is a small example targeting the Win32 API, using <code class="docutils literal notranslate"><span class="pre">MessageBox()</span></code> to show a <em>Hello World!</em> message to the user.</p>
|
|
272
|
-
<p>It illustrates the use of the x86 stdcall calling convention.</p>
|
|
275
|
+
<p>It illustrates the use of the x86 stdcall calling convention, and the use of UTF-8 and UTF-16 string arguments.</p>
|
|
273
276
|
<div class="highlight-js notranslate"><div class="highlight"><pre><span></span><span class="linenos"> 1</span><span class="kd">const</span><span class="w"> </span><span class="nx">koffi</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nx">require</span><span class="p">(</span><span class="s1">'koffi'</span><span class="p">);</span><span class="w"></span>
|
|
274
277
|
<span class="linenos"> 2</span>
|
|
275
278
|
<span class="linenos"> 3</span><span class="c1">// Load the shared library</span><span class="w"></span>
|
|
276
279
|
<span class="linenos"> 4</span><span class="kd">const</span><span class="w"> </span><span class="nx">lib</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nx">koffi</span><span class="p">.</span><span class="nx">load</span><span class="p">(</span><span class="s1">'user32.dll'</span><span class="p">);</span><span class="w"></span>
|
|
277
280
|
<span class="linenos"> 5</span>
|
|
278
281
|
<span class="linenos"> 6</span><span class="c1">// Declare constants</span><span class="w"></span>
|
|
279
|
-
<span class="linenos"> 7</span><span class="kd">const</span><span class="w"> </span><span class="nx">
|
|
280
|
-
<span class="linenos"> 8</span>
|
|
281
|
-
<span class="linenos"> 9</span><span class="
|
|
282
|
-
<span class="linenos">10</span><span class="kd">const</span><span class="w"> </span><span class="nx">
|
|
283
|
-
<span class="linenos">11</span>
|
|
284
|
-
<span class="linenos">12</span><span class="
|
|
282
|
+
<span class="linenos"> 7</span><span class="kd">const</span><span class="w"> </span><span class="nx">MB_OK</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mh">0x0</span><span class="p">;</span><span class="w"></span>
|
|
283
|
+
<span class="linenos"> 8</span><span class="kd">const</span><span class="w"> </span><span class="nx">MB_YESNO</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mh">0x4</span><span class="p">;</span><span class="w"></span>
|
|
284
|
+
<span class="linenos"> 9</span><span class="kd">const</span><span class="w"> </span><span class="nx">MB_ICONQUESTION</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mh">0x20</span><span class="p">;</span><span class="w"></span>
|
|
285
|
+
<span class="linenos">10</span><span class="kd">const</span><span class="w"> </span><span class="nx">MB_ICONINFORMATION</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mh">0x40</span><span class="p">;</span><span class="w"></span>
|
|
286
|
+
<span class="linenos">11</span><span class="kd">const</span><span class="w"> </span><span class="nx">IDOK</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mf">1</span><span class="p">;</span><span class="w"></span>
|
|
287
|
+
<span class="linenos">12</span><span class="kd">const</span><span class="w"> </span><span class="nx">IDYES</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mf">6</span><span class="p">;</span><span class="w"></span>
|
|
288
|
+
<span class="linenos">13</span><span class="kd">const</span><span class="w"> </span><span class="nx">IDNO</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mf">7</span><span class="p">;</span><span class="w"></span>
|
|
289
|
+
<span class="linenos">14</span>
|
|
290
|
+
<span class="linenos">15</span><span class="c1">// Find functions</span><span class="w"></span>
|
|
291
|
+
<span class="linenos">16</span><span class="kd">const</span><span class="w"> </span><span class="nx">MessageBoxA</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nx">lib</span><span class="p">.</span><span class="nx">stdcall</span><span class="p">(</span><span class="s1">'MessageBoxA'</span><span class="p">,</span><span class="w"> </span><span class="s1">'int'</span><span class="p">,</span><span class="w"> </span><span class="p">[</span><span class="s1">'void *'</span><span class="p">,</span><span class="w"> </span><span class="s1">'str'</span><span class="p">,</span><span class="w"> </span><span class="s1">'str'</span><span class="p">,</span><span class="w"> </span><span class="s1">'uint'</span><span class="p">]);</span><span class="w"></span>
|
|
292
|
+
<span class="linenos">17</span><span class="kd">const</span><span class="w"> </span><span class="nx">MessageBoxW</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nx">lib</span><span class="p">.</span><span class="nx">stdcall</span><span class="p">(</span><span class="s1">'MessageBoxW'</span><span class="p">,</span><span class="w"> </span><span class="s1">'int'</span><span class="p">,</span><span class="w"> </span><span class="p">[</span><span class="s1">'void *'</span><span class="p">,</span><span class="w"> </span><span class="s1">'str16'</span><span class="p">,</span><span class="w"> </span><span class="s1">'str16'</span><span class="p">,</span><span class="w"> </span><span class="s1">'uint'</span><span class="p">]);</span><span class="w"></span>
|
|
293
|
+
<span class="linenos">18</span>
|
|
294
|
+
<span class="linenos">19</span><span class="kd">let</span><span class="w"> </span><span class="nx">ret</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nx">MessageBoxA</span><span class="p">(</span><span class="kc">null</span><span class="p">,</span><span class="w"> </span><span class="s1">'Do you want another message box?'</span><span class="p">,</span><span class="w"> </span><span class="s1">'Koffi'</span><span class="p">,</span><span class="w"> </span><span class="nx">MB_YESNO</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="nx">MB_ICONQUESTION</span><span class="p">);</span><span class="w"></span>
|
|
295
|
+
<span class="linenos">20</span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="nx">ret</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="nx">IDYES</span><span class="p">)</span><span class="w"></span>
|
|
296
|
+
<span class="linenos">21</span><span class="w"> </span><span class="nx">MessageBoxW</span><span class="p">(</span><span class="kc">null</span><span class="p">,</span><span class="w"> </span><span class="s1">'Hello World!'</span><span class="p">,</span><span class="w"> </span><span class="s1">'Koffi'</span><span class="p">,</span><span class="w"> </span><span class="nx">MB_ICONINFORMATION</span><span class="p">);</span><span class="w"></span>
|
|
285
297
|
</pre></div>
|
|
286
298
|
</div>
|
|
287
299
|
</section>
|
|
@@ -308,7 +320,7 @@
|
|
|
308
320
|
<span>Previous</span>
|
|
309
321
|
</div>
|
|
310
322
|
|
|
311
|
-
<div class="title">
|
|
323
|
+
<div class="title">Requirements</div>
|
|
312
324
|
|
|
313
325
|
</div>
|
|
314
326
|
</a>
|
|
@@ -345,6 +357,7 @@
|
|
|
345
357
|
<div class="toc-tree">
|
|
346
358
|
<ul>
|
|
347
359
|
<li><a class="reference internal" href="#">Quick start</a><ul>
|
|
360
|
+
<li><a class="reference internal" href="#install-koffi">Install Koffi</a></li>
|
|
348
361
|
<li><a class="reference internal" href="#small-linux-example">Small Linux example</a></li>
|
|
349
362
|
<li><a class="reference internal" href="#small-windows-example">Small Windows example</a></li>
|
|
350
363
|
</ul>
|
package/doc/dist/html/types.html
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<meta name="color-scheme" content="light dark"><meta name="generator" content="Docutils 0.18.1: http://docutils.sourceforge.net/" />
|
|
6
6
|
<link rel="index" title="Index" href="genindex" /><link rel="search" title="Search" href="search" /><link rel="next" title="Function calls" href="functions" /><link rel="prev" title="Quick start" href="start" />
|
|
7
7
|
|
|
8
|
-
<meta name="generator" content="sphinx-5.0.
|
|
8
|
+
<meta name="generator" content="sphinx-5.0.2, furo 2022.06.21"/>
|
|
9
9
|
<title>Data types - Koffi</title>
|
|
10
10
|
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
|
|
11
11
|
<link rel="stylesheet" type="text/css" href="_static/styles/furo.css?digest=40978830699223671f4072448e654b5958f38b89" />
|
|
@@ -162,7 +162,7 @@
|
|
|
162
162
|
</form>
|
|
163
163
|
<div id="searchbox"></div><div class="sidebar-scroll"><div class="sidebar-tree">
|
|
164
164
|
<ul class="current">
|
|
165
|
-
<li class="toctree-l1"><a class="reference internal" href="platforms">
|
|
165
|
+
<li class="toctree-l1"><a class="reference internal" href="platforms">Requirements</a></li>
|
|
166
166
|
<li class="toctree-l1"><a class="reference internal" href="start">Quick start</a></li>
|
|
167
167
|
<li class="toctree-l1 current current-page"><a class="current reference internal" href="#">Data types</a></li>
|
|
168
168
|
<li class="toctree-l1"><a class="reference internal" href="functions">Function calls</a></li>
|
|
@@ -464,13 +464,33 @@
|
|
|
464
464
|
<td><p>Unsigned</p></td>
|
|
465
465
|
<td><p>4 or 8 bytes depending on platform (LP64, LLP64)</p></td>
|
|
466
466
|
</tr>
|
|
467
|
+
<tr class="row-even"><td><p>Number (integer)</p></td>
|
|
468
|
+
<td><p>intptr</p></td>
|
|
469
|
+
<td><p>Signed</p></td>
|
|
470
|
+
<td><p>4 or 8 bytes depending on register width</p></td>
|
|
471
|
+
</tr>
|
|
472
|
+
<tr class="row-odd"><td><p>Number (integer)</p></td>
|
|
473
|
+
<td><p>intptr_t</p></td>
|
|
474
|
+
<td><p>Signed</p></td>
|
|
475
|
+
<td><p>4 or 8 bytes depending on register width</p></td>
|
|
476
|
+
</tr>
|
|
477
|
+
<tr class="row-even"><td><p>Number (integer)</p></td>
|
|
478
|
+
<td><p>uintptr</p></td>
|
|
479
|
+
<td><p>Unsigned</p></td>
|
|
480
|
+
<td><p>4 or 8 bytes depending on register width</p></td>
|
|
481
|
+
</tr>
|
|
482
|
+
<tr class="row-odd"><td><p>Number (integer)</p></td>
|
|
483
|
+
<td><p>uintptr_t</p></td>
|
|
484
|
+
<td><p>Unsigned</p></td>
|
|
485
|
+
<td><p>4 or 8 bytes depending on register width</p></td>
|
|
486
|
+
</tr>
|
|
467
487
|
<tr class="row-even"><td><p>String</p></td>
|
|
468
|
-
<td><p>string</p></td>
|
|
488
|
+
<td><p>str (string)</p></td>
|
|
469
489
|
<td><p></p></td>
|
|
470
490
|
<td><p>JS strings are converted to and from UTF-8</p></td>
|
|
471
491
|
</tr>
|
|
472
492
|
<tr class="row-odd"><td><p>String</p></td>
|
|
473
|
-
<td><p>string16</p></td>
|
|
493
|
+
<td><p>str16 (string16)</p></td>
|
|
474
494
|
<td><p></p></td>
|
|
475
495
|
<td><p>JS strings are converted to and from UTF-16 (LE)</p></td>
|
|
476
496
|
</tr>
|
|
@@ -503,7 +523,7 @@
|
|
|
503
523
|
<div class="highlight-js notranslate"><div class="highlight"><pre><span></span><span class="linenos">1</span><span class="kd">const</span><span class="w"> </span><span class="nx">A</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nx">koffi</span><span class="p">.</span><span class="nx">struct</span><span class="p">(</span><span class="s1">'A'</span><span class="p">,</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
|
|
504
524
|
<span class="linenos">2</span><span class="w"> </span><span class="nx">a</span><span class="o">:</span><span class="w"> </span><span class="s1">'int'</span><span class="p">,</span><span class="w"></span>
|
|
505
525
|
<span class="linenos">3</span><span class="w"> </span><span class="nx">b</span><span class="o">:</span><span class="w"> </span><span class="s1">'char'</span><span class="p">,</span><span class="w"></span>
|
|
506
|
-
<span class="linenos">4</span><span class="w"> </span><span class="nx">c</span><span class="o">:</span><span class="w"> </span><span class="s1">'
|
|
526
|
+
<span class="linenos">4</span><span class="w"> </span><span class="nx">c</span><span class="o">:</span><span class="w"> </span><span class="s1">'str'</span><span class="p">,</span><span class="w"></span>
|
|
507
527
|
<span class="linenos">5</span><span class="w"> </span><span class="nx">d</span><span class="o">:</span><span class="w"> </span><span class="nx">koffi</span><span class="p">.</span><span class="nx">struct</span><span class="p">({</span><span class="w"></span>
|
|
508
528
|
<span class="linenos">6</span><span class="w"> </span><span class="nx">d1</span><span class="o">:</span><span class="w"> </span><span class="s1">'double'</span><span class="p">,</span><span class="w"></span>
|
|
509
529
|
<span class="linenos">7</span><span class="w"> </span><span class="nx">d2</span><span class="o">:</span><span class="w"> </span><span class="s1">'double'</span><span class="w"></span>
|
|
@@ -678,11 +698,11 @@
|
|
|
678
698
|
<span class="linenos"> 2</span><span class="kd">const</span><span class="w"> </span><span class="nx">lib</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nx">koffi</span><span class="p">.</span><span class="nx">load</span><span class="p">(</span><span class="s1">'./handles.so'</span><span class="p">);</span><span class="w"></span>
|
|
679
699
|
<span class="linenos"> 3</span>
|
|
680
700
|
<span class="linenos"> 4</span><span class="kd">const</span><span class="w"> </span><span class="nx">Concat</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nx">koffi</span><span class="p">.</span><span class="nx">handle</span><span class="p">(</span><span class="s1">'Concat'</span><span class="p">);</span><span class="w"></span>
|
|
681
|
-
<span class="linenos"> 5</span><span class="kd">const</span><span class="w"> </span><span class="nx">
|
|
682
|
-
<span class="linenos"> 6</span><span class="kd">const</span><span class="w"> </span><span class="nx">
|
|
683
|
-
<span class="linenos"> 7</span><span class="kd">const</span><span class="w"> </span><span class="nx">
|
|
684
|
-
<span class="linenos"> 8</span><span class="kd">const</span><span class="w"> </span><span class="nx">
|
|
685
|
-
<span class="linenos"> 9</span><span class="kd">const</span><span class="w"> </span><span class="nx">
|
|
701
|
+
<span class="linenos"> 5</span><span class="kd">const</span><span class="w"> </span><span class="nx">ConcatNew</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nx">lib</span><span class="p">.</span><span class="nx">func</span><span class="p">(</span><span class="s1">'Concat ConcatNew()'</span><span class="p">);</span><span class="w"></span>
|
|
702
|
+
<span class="linenos"> 6</span><span class="kd">const</span><span class="w"> </span><span class="nx">ConcatFree</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nx">lib</span><span class="p">.</span><span class="nx">func</span><span class="p">(</span><span class="s1">'void ConcatFree(Concat c)'</span><span class="p">);</span><span class="w"></span>
|
|
703
|
+
<span class="linenos"> 7</span><span class="kd">const</span><span class="w"> </span><span class="nx">ConcatAppend</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nx">lib</span><span class="p">.</span><span class="nx">func</span><span class="p">(</span><span class="s1">'bool ConcatAppend(Concat c, const char *frag)'</span><span class="p">);</span><span class="w"></span>
|
|
704
|
+
<span class="linenos"> 8</span><span class="kd">const</span><span class="w"> </span><span class="nx">ConcatBuild</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nx">lib</span><span class="p">.</span><span class="nx">func</span><span class="p">(</span><span class="s1">'const char *ConcatBuild(Concat c)'</span><span class="p">);</span><span class="w"></span>
|
|
705
|
+
<span class="linenos"> 9</span><span class="kd">const</span><span class="w"> </span><span class="nx">ConcatNewOut</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nx">lib</span><span class="p">.</span><span class="nx">func</span><span class="p">(</span><span class="s1">'bool ConcatNewOut(_Out_ Concat out)'</span><span class="p">);</span><span class="w"></span>
|
|
686
706
|
<span class="linenos">10</span>
|
|
687
707
|
<span class="linenos">11</span><span class="kd">let</span><span class="w"> </span><span class="nx">c</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nx">ConcatNew</span><span class="p">();</span><span class="w"></span>
|
|
688
708
|
<span class="linenos">12</span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="o">!</span><span class="nx">c</span><span class="p">)</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
|
|
@@ -786,7 +806,7 @@
|
|
|
786
806
|
<span class="linenos">22</span><span class="w"> </span><span class="nx">wFinderFlags</span><span class="o">:</span><span class="w"> </span><span class="s1">'ushort'</span><span class="w"> </span><span class="c1">// Obsolete. Do not use</span><span class="w"></span>
|
|
787
807
|
<span class="linenos">23</span><span class="p">});</span><span class="w"></span>
|
|
788
808
|
<span class="linenos">24</span>
|
|
789
|
-
<span class="linenos">25</span><span class="kd">const</span><span class="w"> </span><span class="nx">FindFirstFile</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nx">lib</span><span class="p">.</span><span class="nx">func</span><span class="p">(</span><span class="s1">'HANDLE __stdcall FindFirstFileW(
|
|
809
|
+
<span class="linenos">25</span><span class="kd">const</span><span class="w"> </span><span class="nx">FindFirstFile</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nx">lib</span><span class="p">.</span><span class="nx">func</span><span class="p">(</span><span class="s1">'HANDLE __stdcall FindFirstFileW(str16 path, _Out_ WIN32_FIND_DATA *data)'</span><span class="p">);</span><span class="w"></span>
|
|
790
810
|
<span class="linenos">26</span><span class="kd">const</span><span class="w"> </span><span class="nx">FindNextFile</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nx">lib</span><span class="p">.</span><span class="nx">func</span><span class="p">(</span><span class="s1">'bool __stdcall FindNextFileW(HANDLE h, _Out_ WIN32_FIND_DATA *data)'</span><span class="p">);</span><span class="w"></span>
|
|
791
811
|
<span class="linenos">27</span><span class="kd">const</span><span class="w"> </span><span class="nx">FindClose</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nx">lib</span><span class="p">.</span><span class="nx">func</span><span class="p">(</span><span class="s1">'bool __stdcall FindClose(HANDLE h)'</span><span class="p">);</span><span class="w"></span>
|
|
792
812
|
<span class="linenos">28</span><span class="kd">const</span><span class="w"> </span><span class="nx">GetLastError</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nx">lib</span><span class="p">.</span><span class="nx">func</span><span class="p">(</span><span class="s1">'uint GetLastError()'</span><span class="p">);</span><span class="w"></span>
|
package/doc/functions.md
CHANGED
|
@@ -19,8 +19,8 @@ You can use the returned object to load C functions from the library. To do so,
|
|
|
19
19
|
To declare a function, you need to specify its non-mangled name, its return type, and its parameters. Use an ellipsis as the last parameter for variadic functions.
|
|
20
20
|
|
|
21
21
|
```js
|
|
22
|
-
const printf = lib.func('printf', 'int', ['
|
|
23
|
-
const atoi = lib.func('atoi', 'int', ['
|
|
22
|
+
const printf = lib.func('printf', 'int', ['str', '...']);
|
|
23
|
+
const atoi = lib.func('atoi', 'int', ['str']);
|
|
24
24
|
```
|
|
25
25
|
|
|
26
26
|
Koffi automatically tries mangled names for non-standard x86 calling conventions. See the section [on standard calls](#synchronous-calls) for more information on this subject.
|
|
@@ -31,7 +31,7 @@ If you prefer, you can declare functions using simple C-like prototype strings,
|
|
|
31
31
|
|
|
32
32
|
```js
|
|
33
33
|
const printf = lib.func('int printf(const char *fmt, ...)');
|
|
34
|
-
const atoi = lib.func('int atoi(
|
|
34
|
+
const atoi = lib.func('int atoi(str)'); // The parameter name is not used by Koffi, and optional
|
|
35
35
|
```
|
|
36
36
|
|
|
37
37
|
You can use `()` or `(void)` for functions that take no argument.
|
|
@@ -58,8 +58,8 @@ const koffi = require('koffi');
|
|
|
58
58
|
const lib = koffi.load('user32.dll');
|
|
59
59
|
|
|
60
60
|
// The following two declarations are equivalent, and use Stdcall
|
|
61
|
-
const MessageBoxA_1 = lib.stdcall('MessageBoxA', 'int', ['void *', '
|
|
62
|
-
const MessageBoxA_2 = lib.func('int __stdcall MessageBoxA(void *hwnd,
|
|
61
|
+
const MessageBoxA_1 = lib.stdcall('MessageBoxA', 'int', ['void *', 'str', 'str', 'uint']);
|
|
62
|
+
const MessageBoxA_2 = lib.func('int __stdcall MessageBoxA(void *hwnd, str text, str caption, uint type)');
|
|
63
63
|
```
|
|
64
64
|
|
|
65
65
|
## Asynchronous calls
|
|
@@ -95,10 +95,10 @@ Variadic functions are declared with an ellipsis as the last argument.
|
|
|
95
95
|
In order to call a variadic function, you must provide two Javascript arguments for each additional C parameter, the first one is the expected type and the second one is the value.
|
|
96
96
|
|
|
97
97
|
```js
|
|
98
|
-
const printf = lib.func('printf', 'int', ['
|
|
98
|
+
const printf = lib.func('printf', 'int', ['str', '...']);
|
|
99
99
|
|
|
100
100
|
// The variadic arguments are: 6 (int), 8.5 (double), 'THE END' (const char *)
|
|
101
|
-
printf('Integer %d, double %g,
|
|
101
|
+
printf('Integer %d, double %g, str %s', 'int', 6, 'double', 8.5, 'str', 'THE END');
|
|
102
102
|
```
|
|
103
103
|
|
|
104
104
|
On x86 platforms, only the Cdecl convention can be used for variadic functions.
|
|
@@ -159,7 +159,8 @@ const lib = koffi.load('sqlite.so');
|
|
|
159
159
|
const sqlite3_db = koffi.handle('sqlite3_db');
|
|
160
160
|
|
|
161
161
|
// Use koffi.out() on a pointer to copy out (from C to JS) after the call
|
|
162
|
-
const sqlite3_open_v2 = lib.func('sqlite3_open_v2', 'int', ['
|
|
162
|
+
const sqlite3_open_v2 = lib.func('sqlite3_open_v2', 'int', ['str', koffi.out(koffi.pointer(sqlite3_db)), 'int', 'str']);
|
|
163
|
+
const sqlite3_close_v2 = lib.func('sqlite3_close_v2', 'int', [sqlite3_db]);
|
|
163
164
|
|
|
164
165
|
const SQLITE_OPEN_READWRITE = 0x2;
|
|
165
166
|
const SQLITE_OPEN_CREATE = 0x4;
|
package/doc/index.rst
CHANGED
|
@@ -11,6 +11,9 @@ Koffi is a **fast and easy-to-use C FFI module for Node.js**, featuring:
|
|
|
11
11
|
* Javascript functions can be used as C callbacks (since 1.2.0)
|
|
12
12
|
* Well-tested code base for :ref:`popular OS/architecture combinations<Supported platforms>`
|
|
13
13
|
|
|
14
|
+
|
|
15
|
+
Koffi requires a recent `Node.js <https://nodejs.org/>`_ version with N-API version 8 support, see :ref:`this page<Node.js>` for more information.
|
|
16
|
+
|
|
14
17
|
Table of contents
|
|
15
18
|
-----------------
|
|
16
19
|
|
package/doc/platforms.md
CHANGED
|
@@ -1,4 +1,18 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Requirements
|
|
2
|
+
|
|
3
|
+
## Node.js
|
|
4
|
+
|
|
5
|
+
Koffi requires a recent [Node.js](https://nodejs.org/) version with [N-API](https://nodejs.org/api/n-api.html) version 8 support:
|
|
6
|
+
|
|
7
|
+
- Node < 12.22.0 is not supported
|
|
8
|
+
- _Node 12.x_: Node 12.22.0 or newer
|
|
9
|
+
- _Node 14.x_: Node 14.17.0 or newer
|
|
10
|
+
- _Node 15.x_: Node 15.12.0 or newer
|
|
11
|
+
- Node 16.0.0 or later versions
|
|
12
|
+
|
|
13
|
+
Use [NVM](https://github.com/nvm-sh/nvm) to install more recent Node versions on older Linux distributions.
|
|
14
|
+
|
|
15
|
+
## Supported platforms
|
|
2
16
|
|
|
3
17
|
The following combinations of OS and architectures __are officially supported and tested__ at the moment:
|
|
4
18
|
|
|
@@ -10,10 +24,8 @@ ARM32 LE [^2] | ⬜️ *N/A* | ✅ Yes | ⬜️ *N/A* | 🟨 Probab
|
|
|
10
24
|
ARM64 (AArch64) LE | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | 🟨 Probably
|
|
11
25
|
RISC-V 64 [^3] | ⬜️ *N/A* | ✅ Yes | ⬜️ *N/A* | 🟨 Probably | 🟨 Probably
|
|
12
26
|
|
|
13
|
-
For all fully supported platforms (green check marks), a prebuilt binary is included in the NPM package which means you can install Koffi without a C++ compiler.
|
|
14
|
-
|
|
15
|
-
Node 12 or later is required, earlier versions are not supported. Use [NVM](https://github.com/nvm-sh/nvm) to install recent Node versions on older Linux distributions.
|
|
16
|
-
|
|
17
27
|
[^1]: The following call conventions are supported for forward calls: cdecl, stdcall, MS fastcall, thiscall. Only cdecl and stdcall can be used for C to JS callbacks.
|
|
18
28
|
[^2]: The prebuilt binary uses the hard float ABI and expects a VFP coprocessor. Build from source to use Koffi with a different ABI (softfp, soft).
|
|
19
29
|
[^3]: The prebuilt binary uses the LP64D (double-precision float) ABI. The LP64 ABI is supported in theory if you build Koffi from source (untested), the LP64F ABI is not supported.
|
|
30
|
+
|
|
31
|
+
For all fully supported platforms (green check marks), a prebuilt binary is included in the NPM package which means you can install Koffi without a C++ compiler.
|
package/doc/start.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# Quick start
|
|
2
2
|
|
|
3
|
+
## Install Koffi
|
|
4
|
+
|
|
3
5
|
You can install Koffi with npm:
|
|
4
6
|
|
|
5
7
|
```sh
|
|
@@ -71,7 +73,7 @@ printf('Local time: %02d:%02d:%02d\n', 'int', now.tm_hour, 'int', now.tm_min, 'i
|
|
|
71
73
|
|
|
72
74
|
This is a small example targeting the Win32 API, using `MessageBox()` to show a *Hello World!* message to the user.
|
|
73
75
|
|
|
74
|
-
It illustrates the use of the x86 stdcall calling convention.
|
|
76
|
+
It illustrates the use of the x86 stdcall calling convention, and the use of UTF-8 and UTF-16 string arguments.
|
|
75
77
|
|
|
76
78
|
```js
|
|
77
79
|
const koffi = require('koffi');
|
|
@@ -80,10 +82,19 @@ const koffi = require('koffi');
|
|
|
80
82
|
const lib = koffi.load('user32.dll');
|
|
81
83
|
|
|
82
84
|
// Declare constants
|
|
85
|
+
const MB_OK = 0x0;
|
|
86
|
+
const MB_YESNO = 0x4;
|
|
87
|
+
const MB_ICONQUESTION = 0x20;
|
|
83
88
|
const MB_ICONINFORMATION = 0x40;
|
|
89
|
+
const IDOK = 1;
|
|
90
|
+
const IDYES = 6;
|
|
91
|
+
const IDNO = 7;
|
|
84
92
|
|
|
85
93
|
// Find functions
|
|
86
|
-
const MessageBoxA = lib.stdcall('MessageBoxA', 'int', ['void *', '
|
|
94
|
+
const MessageBoxA = lib.stdcall('MessageBoxA', 'int', ['void *', 'str', 'str', 'uint']);
|
|
95
|
+
const MessageBoxW = lib.stdcall('MessageBoxW', 'int', ['void *', 'str16', 'str16', 'uint']);
|
|
87
96
|
|
|
88
|
-
MessageBoxA(null, '
|
|
97
|
+
let ret = MessageBoxA(null, 'Do you want another message box?', 'Koffi', MB_YESNO | MB_ICONQUESTION);
|
|
98
|
+
if (ret == IDYES)
|
|
99
|
+
MessageBoxW(null, 'Hello World!', 'Koffi', MB_ICONINFORMATION);
|
|
89
100
|
```
|
package/doc/types.md
CHANGED
|
@@ -46,14 +46,18 @@ Koffi also accepts BigInt values when converting from JS to C integers. If the v
|
|
|
46
46
|
|
|
47
47
|
Koffi defines a few more types that can change size depending on the OS and the architecture:
|
|
48
48
|
|
|
49
|
-
JS type | C type
|
|
50
|
-
---------------- |
|
|
51
|
-
Boolean | bool
|
|
52
|
-
Number (integer) | long
|
|
53
|
-
Number (integer) | ulong
|
|
54
|
-
Number (integer) | unsigned long
|
|
55
|
-
|
|
56
|
-
|
|
49
|
+
JS type | C type | Signedness | Note
|
|
50
|
+
---------------- | ---------------- | ---------- | ------------------------------------------------
|
|
51
|
+
Boolean | bool | | Usually one byte
|
|
52
|
+
Number (integer) | long | Signed | 4 or 8 bytes depending on platform (LP64, LLP64)
|
|
53
|
+
Number (integer) | ulong | Unsigned | 4 or 8 bytes depending on platform (LP64, LLP64)
|
|
54
|
+
Number (integer) | unsigned long | Unsigned | 4 or 8 bytes depending on platform (LP64, LLP64)
|
|
55
|
+
Number (integer) | intptr | Signed | 4 or 8 bytes depending on register width
|
|
56
|
+
Number (integer) | intptr_t | Signed | 4 or 8 bytes depending on register width
|
|
57
|
+
Number (integer) | uintptr | Unsigned | 4 or 8 bytes depending on register width
|
|
58
|
+
Number (integer) | uintptr_t | Unsigned | 4 or 8 bytes depending on register width
|
|
59
|
+
String | str (string) | | JS strings are converted to and from UTF-8
|
|
60
|
+
String | str16 (string16) | | JS strings are converted to and from UTF-16 (LE)
|
|
57
61
|
|
|
58
62
|
Primitive types can be specified by name (in a string) or through `koffi.types`:
|
|
59
63
|
|
|
@@ -87,7 +91,7 @@ typedef struct A {
|
|
|
87
91
|
const A = koffi.struct('A', {
|
|
88
92
|
a: 'int',
|
|
89
93
|
b: 'char',
|
|
90
|
-
c: '
|
|
94
|
+
c: 'str',
|
|
91
95
|
d: koffi.struct({
|
|
92
96
|
d1: 'double',
|
|
93
97
|
d2: 'double'
|
|
@@ -270,11 +274,11 @@ const koffi = require('koffi');
|
|
|
270
274
|
const lib = koffi.load('./handles.so');
|
|
271
275
|
|
|
272
276
|
const Concat = koffi.handle('Concat');
|
|
273
|
-
const ConcatNewOut = lib.func('bool ConcatNewOut(Concat *out)');
|
|
274
277
|
const ConcatNew = lib.func('Concat ConcatNew()');
|
|
275
278
|
const ConcatFree = lib.func('void ConcatFree(Concat c)');
|
|
276
279
|
const ConcatAppend = lib.func('bool ConcatAppend(Concat c, const char *frag)');
|
|
277
280
|
const ConcatBuild = lib.func('const char *ConcatBuild(Concat c)');
|
|
281
|
+
const ConcatNewOut = lib.func('bool ConcatNewOut(_Out_ Concat out)');
|
|
278
282
|
|
|
279
283
|
let c = ConcatNew();
|
|
280
284
|
if (!c) {
|
|
@@ -385,7 +389,7 @@ const WIN32_FIND_DATA = koffi.struct('WIN32_FIND_DATA', {
|
|
|
385
389
|
wFinderFlags: 'ushort' // Obsolete. Do not use
|
|
386
390
|
});
|
|
387
391
|
|
|
388
|
-
const FindFirstFile = lib.func('HANDLE __stdcall FindFirstFileW(
|
|
392
|
+
const FindFirstFile = lib.func('HANDLE __stdcall FindFirstFileW(str16 path, _Out_ WIN32_FIND_DATA *data)');
|
|
389
393
|
const FindNextFile = lib.func('bool __stdcall FindNextFileW(HANDLE h, _Out_ WIN32_FIND_DATA *data)');
|
|
390
394
|
const FindClose = lib.func('bool __stdcall FindClose(HANDLE h)');
|
|
391
395
|
const GetLastError = lib.func('uint GetLastError()');
|