koffi 2.1.0-beta.2 → 2.1.0-beta.3

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.
Files changed (104) hide show
  1. package/ChangeLog.md +2 -2
  2. package/build/qemu/2.1.0-beta.3/koffi_darwin_arm64.tar.gz +0 -0
  3. package/build/qemu/2.1.0-beta.3/koffi_darwin_x64.tar.gz +0 -0
  4. package/build/qemu/2.1.0-beta.3/koffi_freebsd_arm64.tar.gz +0 -0
  5. package/build/qemu/2.1.0-beta.3/koffi_freebsd_ia32.tar.gz +0 -0
  6. package/build/qemu/2.1.0-beta.3/koffi_freebsd_x64.tar.gz +0 -0
  7. package/build/qemu/2.1.0-beta.3/koffi_linux_arm32hf.tar.gz +0 -0
  8. package/build/qemu/2.1.0-beta.3/koffi_linux_arm64.tar.gz +0 -0
  9. package/build/qemu/2.1.0-beta.3/koffi_linux_ia32.tar.gz +0 -0
  10. package/build/qemu/2.1.0-beta.3/koffi_linux_riscv64hf64.tar.gz +0 -0
  11. package/build/qemu/2.1.0-beta.3/koffi_linux_x64.tar.gz +0 -0
  12. package/build/qemu/2.1.0-beta.3/koffi_openbsd_ia32.tar.gz +0 -0
  13. package/build/qemu/2.1.0-beta.3/koffi_openbsd_x64.tar.gz +0 -0
  14. package/build/qemu/2.1.0-beta.3/koffi_win32_arm64.tar.gz +0 -0
  15. package/build/qemu/2.1.0-beta.3/koffi_win32_ia32.tar.gz +0 -0
  16. package/build/qemu/2.1.0-beta.3/koffi_win32_x64.tar.gz +0 -0
  17. package/doc/Makefile +1 -1
  18. package/doc/conf.py +5 -0
  19. package/doc/dist/doctrees/changes.doctree +0 -0
  20. package/doc/dist/doctrees/environment.pickle +0 -0
  21. package/doc/dist/doctrees/functions.doctree +0 -0
  22. package/doc/dist/doctrees/index.doctree +0 -0
  23. package/doc/dist/doctrees/types.doctree +0 -0
  24. package/doc/dist/html/.buildinfo +4 -0
  25. package/doc/dist/html/_sources/benchmarks.md.txt +137 -0
  26. package/doc/dist/html/_sources/changes.md.txt +161 -0
  27. package/doc/dist/html/_sources/contribute.md.txt +127 -0
  28. package/doc/dist/html/_sources/functions.md.txt +421 -0
  29. package/doc/dist/html/_sources/index.rst.txt +39 -0
  30. package/doc/dist/html/_sources/memory.md.txt +32 -0
  31. package/doc/dist/html/_sources/platforms.md.txt +31 -0
  32. package/doc/dist/html/_sources/start.md.txt +100 -0
  33. package/doc/dist/html/_sources/types.md.txt +541 -0
  34. package/doc/dist/html/_static/_sphinx_javascript_frameworks_compat.js +134 -0
  35. package/doc/dist/html/_static/basic.css +932 -0
  36. package/doc/dist/html/_static/bench_linux.png +0 -0
  37. package/doc/dist/html/_static/bench_windows.png +0 -0
  38. package/doc/dist/html/_static/custom.css +22 -0
  39. package/doc/dist/html/_static/debug.css +69 -0
  40. package/doc/dist/html/_static/doctools.js +264 -0
  41. package/doc/dist/html/_static/documentation_options.js +14 -0
  42. package/doc/dist/html/_static/file.png +0 -0
  43. package/doc/dist/html/_static/jquery-3.6.0.js +10881 -0
  44. package/doc/dist/html/_static/jquery.js +2 -0
  45. package/doc/dist/html/_static/language_data.js +199 -0
  46. package/doc/dist/html/_static/minus.png +0 -0
  47. package/doc/dist/html/_static/perf_linux_20220623.png +0 -0
  48. package/doc/dist/html/_static/perf_linux_20220623_2.png +0 -0
  49. package/doc/dist/html/_static/perf_windows_20220623.png +0 -0
  50. package/doc/dist/html/_static/perf_windows_20220623_2.png +0 -0
  51. package/doc/dist/html/_static/plus.png +0 -0
  52. package/doc/dist/html/_static/pygments.css +252 -0
  53. package/doc/dist/html/_static/scripts/furo-extensions.js +0 -0
  54. package/doc/dist/html/_static/scripts/furo.js +3 -0
  55. package/doc/dist/html/_static/scripts/furo.js.LICENSE.txt +7 -0
  56. package/doc/dist/html/_static/scripts/furo.js.map +1 -0
  57. package/doc/dist/html/_static/searchtools.js +531 -0
  58. package/doc/dist/html/_static/skeleton.css +296 -0
  59. package/doc/dist/html/_static/styles/furo-extensions.css +2 -0
  60. package/doc/dist/html/_static/styles/furo-extensions.css.map +1 -0
  61. package/doc/dist/html/_static/styles/furo.css +2 -0
  62. package/doc/dist/html/_static/styles/furo.css.map +1 -0
  63. package/doc/dist/html/_static/underscore-1.13.1.js +2042 -0
  64. package/doc/dist/html/_static/underscore.js +6 -0
  65. package/doc/dist/html/benchmarks.html +571 -0
  66. package/doc/dist/html/changes.html +686 -0
  67. package/doc/dist/html/contribute.html +403 -0
  68. package/doc/dist/html/functions.html +718 -0
  69. package/doc/dist/html/genindex.html +253 -0
  70. package/doc/dist/html/index.html +359 -0
  71. package/doc/dist/html/memory.html +346 -0
  72. package/doc/dist/html/objects.inv +0 -0
  73. package/doc/dist/html/platforms.html +371 -0
  74. package/doc/dist/html/search.html +261 -0
  75. package/doc/dist/html/searchindex.js +1 -0
  76. package/doc/dist/html/start.html +384 -0
  77. package/doc/dist/html/types.html +1061 -0
  78. package/doc/make.bat +1 -1
  79. package/doc/templates/badges.html +1 -1
  80. package/doc/types.md +2 -0
  81. package/package.json +2 -1
  82. package/src/abi_arm32.cc +142 -200
  83. package/src/abi_arm64.cc +113 -122
  84. package/src/abi_riscv64.cc +76 -92
  85. package/src/abi_x64_sysv.cc +76 -92
  86. package/src/abi_x64_win.cc +76 -92
  87. package/src/abi_x86.cc +128 -164
  88. package/test/misc.c +43 -0
  89. package/test/sync.js +81 -0
  90. package/build/qemu/2.1.0-beta.2/koffi_darwin_arm64.tar.gz +0 -0
  91. package/build/qemu/2.1.0-beta.2/koffi_darwin_x64.tar.gz +0 -0
  92. package/build/qemu/2.1.0-beta.2/koffi_freebsd_arm64.tar.gz +0 -0
  93. package/build/qemu/2.1.0-beta.2/koffi_freebsd_ia32.tar.gz +0 -0
  94. package/build/qemu/2.1.0-beta.2/koffi_freebsd_x64.tar.gz +0 -0
  95. package/build/qemu/2.1.0-beta.2/koffi_linux_arm32hf.tar.gz +0 -0
  96. package/build/qemu/2.1.0-beta.2/koffi_linux_arm64.tar.gz +0 -0
  97. package/build/qemu/2.1.0-beta.2/koffi_linux_ia32.tar.gz +0 -0
  98. package/build/qemu/2.1.0-beta.2/koffi_linux_riscv64hf64.tar.gz +0 -0
  99. package/build/qemu/2.1.0-beta.2/koffi_linux_x64.tar.gz +0 -0
  100. package/build/qemu/2.1.0-beta.2/koffi_openbsd_ia32.tar.gz +0 -0
  101. package/build/qemu/2.1.0-beta.2/koffi_openbsd_x64.tar.gz +0 -0
  102. package/build/qemu/2.1.0-beta.2/koffi_win32_arm64.tar.gz +0 -0
  103. package/build/qemu/2.1.0-beta.2/koffi_win32_ia32.tar.gz +0 -0
  104. package/build/qemu/2.1.0-beta.2/koffi_win32_x64.tar.gz +0 -0
@@ -0,0 +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", "Functions", "Koffi 2.1.0-beta.2", "Memory usage", "Requirements", "Quick start", "Data types"], "terms": {"here": [0, 2, 3, 4, 8], "quick": [0, 4], "execut": [0, 3], "time": [0, 2, 3, 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, 3, 8], "approxim": [0, 8], "pre": 0, "compil": [0, 1, 6], "static": [0, 3], "n": [0, 2, 4, 6, 7, 8], "api": [0, 1, 2, 3, 4, 6, 7, 8], "glue": 0, "code": [0, 1, 3, 4, 5], "The": [0, 1, 2, 3, 4, 5, 6, 7, 8], "first": [0, 1, 2, 3, 7, 8], "base": [0, 1, 3, 4], "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, 1, 3, 8], "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], "c": [0, 1, 2, 4, 5, 6, 7], "function": [0, 1, 2, 4, 7], "ha": [0, 1, 2, 3, 8], "one": [0, 1, 2, 3, 5, 7, 8], "refer": [0, 4, 8], "through": [0, 1, 3, 8], "an": [0, 1, 3, 5, 8], "modul": [0, 1, 4], "close": [0, 8], "limit": [0, 1, 3], "perfect": 0, "overhead": [0, 4], "js": [0, 1, 2, 3, 4, 5, 8], "us": [0, 1, 2, 3, 4, 5, 6, 7, 8], "offici": [0, 2, 6], "iter": [0, 8], "rel": 0, "perform": [0, 1, 4, 8], "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, 1, 2, 3, 6, 7, 8], "take": [0, 3, 8], "string": [0, 1, 3, 5, 7], "paramet": [0, 1, 7, 8], "javascript": [0, 4, 8], "v8": [0, 3, 5], "convers": [0, 1, 3, 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, 3], "draw": 0, "much": [0, 2], "heavier": 0, "than": [0, 1, 5], "thu": [0, 3], "reduc": [0, 1], "In": [0, 1, 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, 7], "\u00b5s": 0, "20": 0, "17": [0, 6], "raylib_node_raylib": 0, "258": 0, "9": 0, "raylib_koffi": 0, "311": 0, "6": [0, 3, 7, 8], "83": 0, "raylib_node_ffi": 0, "928": 0, "4": [0, 3, 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, 8], "ani": [0, 2, 3, 4, 5, 8], "211": 0, "8": [0, 2, 3, 4, 6, 7, 8], "25": 0, "264": 0, "318": 0, "21": 0, "1146": 0, "2": [0, 3, 5, 6, 8], "23": 0, "334": 0, "pleas": [0, 5], "note": [0, 2, 5, 8], "order": [0, 1, 2, 3], "get": [0, 1, 2, 3, 5, 7, 8], "fair": 0, "number": [0, 1, 3, 5, 8], "wa": [0, 1], "recompil": 0, "clang": [0, 1, 8], "cl": 0, "befor": [0, 1, 2, 8], "follow": [0, 1, 2, 3, 6, 8], "command": [0, 2], "cd": [0, 2], "node_modul": 0, "rmdir": 0, "s": [0, 1, 3, 8], "q": [0, 2], "bin": 0, "build": [0, 1, 4, 6, 8], "npx": 0, "cmake": [0, 2], "t": [0, 3], "clangcl": 0, "open": [0, 1, 3, 8], "consol": [0, 1, 3, 5, 8], "go": [0, 2], "cnoke": [0, 2], "do": [0, 2, 3, 7, 8], "anyth": 0, "els": [0, 8], "all": [0, 1, 3, 6, 8], "made": [0, 1, 3, 5, 8], "built": 0, "binari": [0, 1, 2, 6, 8], "prefer": [0, 2, 3], "onc": [0, 2, 3, 5, 7, 8], "everyth": [0, 2], "readi": 0, "main": [1, 3], "chang": [1, 2, 3, 5, 8], "add": [1, 2, 8], "support": [1, 2, 3, 4, 8], "polymorph": 1, "void": [1, 3, 7, 8], "endian": 1, "sensit": 1, "integ": [1, 3, 8], "intx_le_t": 1, "intx_be_t": 1, "accept": [1, 8], "arrai": [1, 2, 3, 4], "introduc": [1, 8], "replac": 1, "handl": [1, 8], "remain": 1, "until": 1, "other": [1, 3, 8], "improv": [1, 2], "global": 1, "inlin": 1, "uniti": 1, "size_t": [1, 3, 8], "primit": [1, 3, 4], "member": [1, 3, 8], "specif": [1, 2, 5, 8], "align": [1, 8], "valu": [1, 4, 7, 8], "struct": [1, 2, 4, 5, 7], "detect": [1, 3], "imposs": 1, "return": [1, 3, 8], "non": [1, 3, 8], "pointer": [1, 3, 4], "variou": [1, 2], "document": [1, 8], "fix": [1, 2, 4], "undefin": [1, 3, 8], "instead": [1, 2, 8], "null": [1, 3, 7, 8], "major": 1, "new": [1, 3, 5, 8], "featur": [1, 3, 4], "dispos": [1, 3, 4], "automat": [1, 3, 8], "heap": [1, 5, 8], "alloc": [1, 5, 8], "regist": [1, 5, 8], "can": [1, 2, 3, 4, 5, 6, 7, 8], "after": [1, 3, 8], "initi": 1, "name": [1, 2, 3], "complex": 1, "outsid": 1, "prototyp": [1, 7], "parser": [1, 2, 3], "minor": 1, "alias": 1, "alia": [1, 8], "resolv": [1, 8], "expos": [1, 8], "correctli": 1, "pass": [1, 2, 3, 8], "except": [1, 2], "thrown": [1, 3], "break": 1, "must": [1, 3, 8], "consult": [1, 3, 8], "more": [1, 2, 3, 4, 5, 6, 8], "inform": [1, 3, 4, 8], "yarn": 1, "packag": [1, 2, 6], "manag": [1, 8], "broken": 1, "pars": 1, "when": [1, 2, 3, 5, 8], "window": [1, 3, 4, 6], "x64": 1, "multipl": [1, 2], "float": [1, 3, 6, 8], "point": [1, 8], "argument": [1, 3, 7, 8], "arm32": [1, 6], "platform": [1, 3, 4, 5, 8], "possibl": [1, 2, 8], "incorrect": 1, "uint32_t": [1, 8], "prebuild": 1, "compat": [1, 2, 3], "electron": 1, "prevent": [1, 8], "reus": 1, "beyond": 1, "bti": 1, "aaarch64": 1, "harmon": 1, "few": [1, 8], "error": [1, 3, 8], "messag": [1, 7], "crash": [1, 3], "insid": [1, 3], "record": 1, "intptr_t": [1, 8], "uintptr_t": [1, 8], "str": [1, 3, 7, 8], "str16": [1, 3, 7, 8], "string16": [1, 8], "instal": [1, 2, 4, 6], "15": [1, 6, 8], "system": [1, 2, 7], "bug": [1, 4], "incompat": 1, "linux": [1, 2, 4, 6], "memori": [1, 3, 4, 8], "leak": [1, 3, 8], "mani": [1, 3, 8], "async": [1, 3], "run": [1, 3, 4, 5, 7], "configur": [1, 2], "maximum": [1, 3, 5], "max_async_cal": [1, 5], "default": [1, 2, 3, 4, 8], "stack": [1, 5], "size": [1, 2, 3, 4, 5], "openbsd": [1, 6], "i386": 1, "misconvers": 1, "sign": [1, 8], "unsign": [1, 3, 7, 8], "empti": 1, "signatur": [1, 3], "disabl": [1, 2], "unsaf": 1, "optim": [1, 2], "14": [1, 6, 8], "mode": [1, 3], "grace": 1, "degrad": 1, "older": [1, 6], "toolchain": 1, "debian": [1, 2], "prebuilt": [1, 2, 6], "rebuild": 1, "happen": [1, 3, 8], "fail": [1, 2, 3, 8], "load": [1, 3, 7, 8], "expand": 1, "move": 1, "http": [1, 2, 4], "dev": [1, 2], "typedarrai": [1, 8], "input": [1, 3, 8], "output": [1, 7, 8], "mix": [1, 2, 8], "convert": [1, 3, 8], "hint": [1, 8], "char": [1, 3, 7, 8], "char16": [1, 8], "char16_t": [1, 8], "definit": [1, 4], "long": [1, 8], "llp64": [1, 8], "model": 1, "restrict": [1, 2, 3], "abi": [1, 2, 3, 6, 8], "risc": [1, 6], "v": [1, 6], "forbid": 1, "duplic": 1, "arm64": [1, 2, 6], "now": [1, 2, 3, 7, 8], "A": [1, 3, 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], "64": [1, 3, 5, 6, 8], "lp64d": [1, 6], "lp64": [1, 6, 8], "untest": [1, 6], "set": [1, 2, 4], "usag": [1, 3, 4], "synchron": [1, 3, 5], "asynchron": [1, 5], "transpar": [1, 8], "between": [1, 3], "buffer": 1, "tent": 1, "excess": 1, "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, "pop": 1, "issu": [1, 3], "incomplet": 1, "buggi": 1, "hfa": [1, 2], "caus": [1, 3], "miss": [1, 2], "map_stack": 1, "flag": [1, 8], "sens": 1, "intern": [1, 8], "fals": [1, 8], "normal": [1, 5, 8], "make": [1, 2, 3], "sure": [1, 2], "we": [1, 2, 8], "have": [1, 2, 3, 7, 8], "redzon": 1, "architectur": [1, 2, 3, 4, 6, 8], "slower": 1, "object": [1, 2, 3, 5, 8], "wai": [1, 2, 3, 7, 8], "some": [1, 2, 3, 8], "magic": 1, "behavior": [1, 3, 8], "syntax": [1, 7], "differ": [1, 3, 6, 8], "like": [1, 2, 7, 8], "you": [1, 2, 3, 4, 6, 7, 8], "mai": [1, 2, 3], "need": [1, 2, 3, 8], "your": [1, 3, 4], "defin": [1, 3, 8], "them": [1, 3, 8], "usabl": [1, 3, 8], "directli": [1, 2, 3, 5, 8], "obscur": [1, 3, 8], "underli": [1, 3, 8], "callit": [1, 3], "callbacktyp": [1, 3], "func": [1, 3, 7, 8], "becom": [1, 3], "newer": [1, 2, 3, 6], "given": 1, "h": [1, 3, 8], "int": [1, 3, 7, 8], "transfertoj": [1, 3], "const": [1, 3, 7, 8], "ag": [1, 3], "cb": [1, 3], "buf": [1, 3], "snprintf": [1, 3], "sizeof": [1, 3, 8], "hello": [1, 3, 7, 8], "two": [1, 3, 5, 8], "illustr": [1, 2, 3, 7, 8], "transfercallback": [1, 3], "lib": [1, 3, 7, 8], "equival": [1, 3, 8], "let": [1, 3, 5, 7, 8], "ret": [1, 3, 7], "niel": [1, 3], "27": [1, 3], "log": [1, 3, 5, 8], "42": [1, 3, 8], "onli": [1, 3, 6, 8], "transient": 1, "addit": [1, 3, 8], "been": [1, 2, 3], "deprec": [1, 8], "thei": [1, 2, 3, 8], "work": [1, 4], "same": [1, 3, 5, 8], "should": [1, 2, 8], "former": 1, "eventu": [1, 8], "remov": [1, 8], "For": [1, 2, 3, 5, 6, 8], "file": [1, 2, 3, 8], "fopen": [1, 3, 8], "fclose": [1, 3, 8], "fp": [1, 3], "wb": 1, "throw": [1, 3, 8], "If": [1, 2, 3, 8], "sqlite3_open_v2": [1, 3], "singl": [1, 8], "element": [1, 8], "shown": [1, 3, 8], "sqlite3": [1, 3], "_out_": [1, 3, 7, 8], "db": [1, 3], "sqlite3_close_v2": [1, 3], "sqlite_open_readwrit": [1, 3], "0x2": [1, 3], "sqlite_open_cr": [1, 3], "0x4": [1, 3, 7], "databas": [1, 3], "ptr": [1, 3, 8], "would": 1, "still": [1, 5], "list": [1, 4, 8], "structtyp": 1, "dummi": [1, 8], "repositori": 2, "luigi": [2, 4], "monorepo": 2, "contain": [2, 8], "project": 2, "idea": 2, "github": [2, 4], "com": [2, 4], "koromix": [2, 4], "provid": [2, 3, 8], "npm": [2, 6, 7], "archiv": 2, "so": [2, 3, 7, 8], "most": [2, 3, 8], "case": [2, 3, 8], "want": [2, 7, 8], "hack": 2, "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, 3, 4, 6], "done": [2, 3, 8], "benchmark": [2, 4], "directori": 2, "what": [2, 3], "gcc": 2, "g": [2, 3, 8], "3": [2, 4, 6, 8], "gnu": [2, 4], "81": 2, "emul": 2, "acceler": 2, "qemu": 2, "even": 2, "gui": 2, "ubuntu": 2, "licens": 2, "reason": [2, 8], "avail": [2, 4, 5], "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, 8], "registri": 2, "txt": 2, "disk": 2, "content": [2, 8], "each": [2, 3, 8], "checksum": 2, "least": [2, 5], "And": [2, 7, 8], "sever": [2, 3], "help": 2, "patient": 2, "ccach": 2, "subsequ": [2, 3, 5], "step": 2, "toler": 2, "By": [2, 3, 8], "stop": 2, "But": [2, 3, 8], "ahead": 2, "shut": 2, "down": 2, "again": [2, 8], "also": [2, 3, 8], "subset": 2, "cycl": 2, "debian_x64": 2, "debian_i386": 2, "separ": 2, "shutdown": 2, "final": [2, 3, 8], "join": 2, "ssh": 2, "shortcut": [2, 3], "debug": 2, "manual": [2, 3], "procedur": [2, 3], "vnc": 2, "server": 2, "local": [2, 7], "access": [2, 3], "displai": 2, "krdc": 2, "viewer": 2, "info": 2, "port": 2, "plan": 2, "necessarili": 2, "avoid": [2, 3, 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, "type": [2, 4, 7], "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], "better": 2, "experi": 2, "program": [2, 3, 4], "It": [2, 3, 7, 8], "addon": 2, "interact": 2, "person": 2, "goe": 2, "rather": 2, "care": [2, 3, 8], "templat": 2, "mainli": 2, "littl": [2, 8], "orient": [2, 8], "i": [2, 8], "strongli": 2, "tag": [2, 3], "over": 2, "inherit": 2, "virtual": 2, "method": 2, "To": 3, "declar": [3, 7, 8], "share": [3, 7, 8], "filenam": 3, "requir": [3, 4, 7, 8], "path": 3, "extens": 3, "dll": [3, 7, 8], "dylib": 3, "etc": [3, 8], "from": [3, 4, 6, 8], "inspir": 3, "specifi": [3, 8], "its": [3, 8], "mangl": 3, "ellipsi": 3, "last": [3, 8], "printf": [3, 7], "atoi": 3, "tri": 3, "see": [3, 4, 8], "section": [3, 8], "subject": 3, "fmt": 3, "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], "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, "result": [3, 7, 8], "print": [3, 7, 8], "worker": 3, "respons": 3, "deal": [3, 8], "data": [3, 4], "multi": 3, "easili": 3, "style": [3, 4], "promis": 3, "util": [3, 4], "promisifi": 3, "cannot": [3, 5, 8], "expect": [3, 6, 8], "5": [3, 8], "doubl": [3, 6, 8], "THE": 3, "end": 3, "On": 3, "forward": [3, 6], "howev": [3, 5, 8], "simplic": 3, "semant": [3, 8], "marshal": 3, "out": [3, 8], "e": [3, 8], "timev": [3, 7], "inout": 3, "dual": 3, "msdn": 3, "qualifi": 3, "_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], "copi": [3, 8], "0": [3, 6, 8], "1": [3, 5, 6, 7, 8], "mean": [3, 6, 8], "format": [3, 7, 8], "kind": [3, 8], "place": 3, "everywher": 3, "dynam": 3, "tell": 3, "actual": 3, "read": [3, 8], "header": 3, "png": 3, "fread": [3, 8], "pngheader": 3, "pack": [3, 8], "uint8_t": [3, 8], "ihdr": 3, "length": [3, 8], "uint32_be_t": [3, 8], "chunk": 3, "width": [3, 8], "height": 3, "depth": 3, "color": 3, "compress": 3, "filter": 3, "interlac": 3, "crc": 3, "nmemb": 3, "argv": 3, "hdr": 3, "rb": 3, "try": [3, 8], "len": [3, 8], "while": [3, 8], "doe": [3, 5, 8], "know": 3, "someth": [3, 8], "freed": [3, 5], "matter": 3, "explicitli": [3, 8], "implicitli": 3, "lose": 3, "origin": 3, "deriv": 3, "anoth": [3, 7, 8], "being": 3, "anymor": 3, "omit": [3, 8], "anonym": [3, 8], "free": [3, 4, 8], "under": [3, 4], "hood": 3, "anonheapstr": 3, "namedheapstr": 3, "heapstr": 3, "thing": 3, "explicitfre": 3, "heapstr16": 3, "strdup": 3, "either": [3, 4, 8], "Be": 3, "crt": 3, "msvcrt": 3, "could": [3, 8], "malloc": [3, 8], "With": 3, "noth": 3, "examplecallback": 3, "sum": [3, 8], "adddoublefloat": 3, "f": [3, 8], "x": [3, 6, 8], "migrat": [3, 4, 8], "guid": [3, 4, 8], "predefin": 3, "trampolin": 3, "gener": [3, 4, 8], "runtim": 3, "harden": 3, "w": 3, "migit": 3, "pax": 3, "mprotect": 3, "impos": 3, "durat": 3, "distinguish": [3, 8], "invalid": 3, "though": 3, "guarante": 3, "don": 3, "unregist": 3, "exist": 3, "correct": [3, 8], "probabl": [3, 6], "qsort": 3, "progress": 3, "sqlite3_exec": 3, "part": [3, 8], "fake": 3, "handler": 3, "event": 3, "fopencooki": 3, "funopen": 3, "releas": 3, "slot": 3, "16": [3, 6, 7, 8], "failur": [3, 8], "registr": 3, "delai": 3, "g_cb1": 3, "g_cb2": 3, "registerfunct": 3, "cb1": 3, "cb2": 3, "sayit": 3, "getcallback": 3, "printcallback": 3, "kyoto": 3, "receiv": 3, "yourself": [3, 8], "catch": 3, "precis": [3, 6], "intepret": 3, "lead": 3, "mess": [3, 8], "ve": 3, "warn": 3, "fast": 4, "easi": 4, "low": 4, "aggreg": 4, "both": [4, 8], "callback": [4, 5, 6, 8], "well": 4, "popular": 4, "os": [4, 6, 8], "combin": [4, 6], "recent": [4, 6], "page": [4, 5, 8], "sourc": [4, 6], "subdirectori": 4, "special": 4, "consider": 4, "thread": 4, "safeti": 4, "x86_64": [4, 6], "contribut": 4, "request": 4, "todo": 4, "changelog": 4, "histori": 4, "softwar": 4, "redistribut": 4, "modifi": [4, 8], "term": 4, "affero": 4, "public": 4, "publish": 4, "foundat": 4, "www": 4, "org": 4, "prealloc": 5, "block": 5, "One": 5, "construct": 5, "assign": [5, 8], "mib": 5, "unless": 5, "veri": 5, "extra": 5, "dure": 5, "engin": 5, "might": 5, "config": 5, "obj": 5, "appli": [5, 8], "true": [5, 8], "unus": 5, "resid": 5, "finish": 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, "nvm": 6, "distribut": 6, "moment": 6, "isa": 6, "freebsd": 6, "ia32": 6, "ye": 6, "amd64": 6, "le": [6, 8], "fulli": 6, "green": 6, "check": 6, "mark": 6, "convent": [6, 7], "ms": 6, "hard": 6, "vfp": 6, "coprocessor": 6, "softfp": 6, "soft": 6, "theori": 6, "lp64f": 6, "languag": 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, "variad": 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, "allow": 8, "variat": 8, "enforc": 8, "signed": 8, "valid": 8, "int8": 8, "int8_t": 8, "uint8": 8, "uchar": 8, "int16": 8, "int16_t": 8, "uint16": 8, "uint16_t": 8, "short": 8, "ushort": 8, "int32": 8, "int32_t": 8, "uint32": 8, "int64": 8, "uint64": 8, "longlong": 8, "ulonglong": 8, "float32": 8, "float64": 8, "bigint": 8, "exce": 8, "rang": 8, "revers": 8, "boolean": 8, "bool": 8, "usual": 8, "ulong": 8, "intptr": 8, "uintptr": 8, "line": 8, "struct1": 8, "struct2": 8, "bunch": 8, "network": 8, "payload": 8, "int16_l": 8, "int16_le_t": 8, "int16_b": 8, "int16_be_t": 8, "uint16_l": 8, "uint16_le_t": 8, "uint16_b": 8, "uint16_be_t": 8, "int32_l": 8, "int32_le_t": 8, "int32_b": 8, "int32_be_t": 8, "uint32_l": 8, "uint32_le_t": 8, "uint32_b": 8, "int64_l": 8, "int64_le_t": 8, "int64_b": 8, "int64_be_t": 8, "uint64_l": 8, "uint64_le_t": 8, "uint64_b": 8, "uint64_be_t": 8, "vice": 8, "versa": 8, "unlik": 8, "typedef": 8, "b": 8, "d1": 8, "d2": 8, "about": 8, "rule": 8, "regard": 8, "pad": 8, "latter": 8, "function1": 8, "function2": 8, "overrid": 8, "packedstruct": 8, "18": 8, "bigstruct": 8, "pair": 8, "dedic": 8, "delet": 8, "obviou": 8, "found": 8, "stdio": 8, "manipul": 8, "ftell": 8, "look": 8, "concatnewout": 8, "describ": 8, "builder": 8, "concaten": 8, "fizzbuzz": 8, "hidden": 8, "behind": 8, "destroi": 8, "concatnew": 8, "concatfre": 8, "fpic": 8, "wall": 8, "o2": 8, "stdlib": 8, "stdbool": 8, "errno": 8, "fragment": 8, "next": 8, "concat": 8, "total": 8, "fprintf": 8, "stderr": 8, "strerror": 8, "concatappend": 8, "frag": 8, "strlen": 8, "memcpi": 8, "concatbuild": 8, "r": 8, "stupid": 8, "30": 8, "buzz": 8, "fizz": 8, "differenti": 8, "purpos": 8, "import": 8, "fall": 8, "expens": 8, "stabil": 8, "lot": 8, "termin": 8, "sentinel": 8, "getcursorpo": 8, "retriev": 8, "cursor": 8, "posit": 8, "kernel32": 8, "y": 8, "po": 8, "behav": 8, "reproduc": 8, "gethandleinform": 8, "closehandl": 8, "among": 8, "variabl": 8, "invol": 8, "list1": 8, "list2": 8, "store": 8, "addint": 8, "dest": 8, "36": 8, "just": 8, "degener": 8, "emb": 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, "ask": 8, "infer": 8, "itself": 8, "translat": 8, "proper": 8, "notion": 8, "fat": 8, "calcul": 8, "stdint": 8, "computetotallength": 8, "explor": 8, "alignof": 8, "complet": 8}, "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, "histori": 1, "koffi": [1, 4, 7], "2": [1, 4], "1": [1, 4], "0": [1, 4], "beta": [1, 4], "3": 1, "12": 1, "11": 1, "10": 1, "9": 1, "8": 1, "7": 1, "6": 1, "5": 1, "4": 1, "migrat": 1, "guid": 1, "x": 1, "callback": [1, 3], "type": [1, 3, 8], "opaqu": [1, 3, 8], "introspect": [1, 8], "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, 8], "definit": [3, 8], "classic": 3, "syntax": 3, "c": [3, 8], "like": 3, "prototyp": 3, "call": 3, "convent": 3, "asynchron": 3, "variad": 3, "special": 3, "consider": 3, "output": 3, "paramet": 3, "struct": [3, 8], "exampl": [3, 7], "polymorph": 3, "heap": 3, "alloc": 3, "valu": 3, "javascript": 3, "transient": 3, "regist": 3, "handl": 3, "except": 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, "primit": 8, "standard": 8, "endian": 8, "sensit": 8, "pointer": 8, "name": 8, "arrai": 8, "fix": 8, "size": 8, "string": 8, "buffer": 8, "dynam": 8, "dispos": 8, "util": 8, "alias": 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}})
@@ -0,0 +1,384 @@
1
+ <!doctype html>
2
+ <html class="no-js" lang="en">
3
+ <head><meta charset="utf-8"/>
4
+ <meta name="viewport" content="width=device-width,initial-scale=1"/>
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="Requirements" href="platforms" />
7
+
8
+ <meta name="generator" content="sphinx-5.0.1, furo 2022.06.04.1"/>
9
+ <title>Quick start - Koffi</title>
10
+ <link rel="stylesheet" type="text/css" href="_static/pygments.css" />
11
+ <link rel="stylesheet" type="text/css" href="_static/styles/furo.css?digest=40978830699223671f4072448e654b5958f38b89" />
12
+ <link rel="stylesheet" type="text/css" href="_static/styles/furo-extensions.css?digest=30d1aed668e5c3a91c3e3bf6a60b675221979f0e" />
13
+ <link rel="stylesheet" type="text/css" href="_static/custom.css" />
14
+
15
+
16
+
17
+
18
+ <style>
19
+ body {
20
+ --color-code-background: #f8f8f8;
21
+ --color-code-foreground: black;
22
+ --color-brand-primary: #FF6600;
23
+ --color-brand-content: #FF6600;
24
+
25
+ }
26
+ @media not print {
27
+ body[data-theme="dark"] {
28
+ --color-code-background: #202020;
29
+ --color-code-foreground: #d0d0d0;
30
+ --color-brand-primary: #FF6600;
31
+ --color-brand-content: #FF6600;
32
+
33
+ }
34
+ @media (prefers-color-scheme: dark) {
35
+ body:not([data-theme="light"]) {
36
+ --color-code-background: #202020;
37
+ --color-code-foreground: #d0d0d0;
38
+ --color-brand-primary: #FF6600;
39
+ --color-brand-content: #FF6600;
40
+
41
+ }
42
+ }
43
+ }
44
+ </style></head>
45
+ <body>
46
+
47
+ <script>
48
+ document.body.dataset.theme = localStorage.getItem("theme") || "auto";
49
+ </script>
50
+
51
+
52
+ <svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
53
+ <symbol id="svg-toc" viewBox="0 0 24 24">
54
+ <title>Contents</title>
55
+ <svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 1024 1024">
56
+ <path d="M408 442h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-8 204c0 4.4 3.6 8 8 8h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56zm504-486H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 632H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM115.4 518.9L271.7 642c5.8 4.6 14.4.5 14.4-6.9V388.9c0-7.4-8.5-11.5-14.4-6.9L115.4 505.1a8.74 8.74 0 0 0 0 13.8z"/>
57
+ </svg>
58
+ </symbol>
59
+ <symbol id="svg-menu" viewBox="0 0 24 24">
60
+ <title>Menu</title>
61
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
62
+ stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather-menu">
63
+ <line x1="3" y1="12" x2="21" y2="12"></line>
64
+ <line x1="3" y1="6" x2="21" y2="6"></line>
65
+ <line x1="3" y1="18" x2="21" y2="18"></line>
66
+ </svg>
67
+ </symbol>
68
+ <symbol id="svg-arrow-right" viewBox="0 0 24 24">
69
+ <title>Expand</title>
70
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
71
+ stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather-chevron-right">
72
+ <polyline points="9 18 15 12 9 6"></polyline>
73
+ </svg>
74
+ </symbol>
75
+ <symbol id="svg-sun" viewBox="0 0 24 24">
76
+ <title>Light mode</title>
77
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
78
+ stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="feather-sun">
79
+ <circle cx="12" cy="12" r="5"></circle>
80
+ <line x1="12" y1="1" x2="12" y2="3"></line>
81
+ <line x1="12" y1="21" x2="12" y2="23"></line>
82
+ <line x1="4.22" y1="4.22" x2="5.64" y2="5.64"></line>
83
+ <line x1="18.36" y1="18.36" x2="19.78" y2="19.78"></line>
84
+ <line x1="1" y1="12" x2="3" y2="12"></line>
85
+ <line x1="21" y1="12" x2="23" y2="12"></line>
86
+ <line x1="4.22" y1="19.78" x2="5.64" y2="18.36"></line>
87
+ <line x1="18.36" y1="5.64" x2="19.78" y2="4.22"></line>
88
+ </svg>
89
+ </symbol>
90
+ <symbol id="svg-moon" viewBox="0 0 24 24">
91
+ <title>Dark mode</title>
92
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
93
+ stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="icon-tabler-moon">
94
+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />
95
+ <path d="M12 3c.132 0 .263 0 .393 0a7.5 7.5 0 0 0 7.92 12.446a9 9 0 1 1 -8.313 -12.454z" />
96
+ </svg>
97
+ </symbol>
98
+ <symbol id="svg-sun-half" viewBox="0 0 24 24">
99
+ <title>Auto light/dark mode</title>
100
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
101
+ stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="icon-tabler-shadow">
102
+ <path stroke="none" d="M0 0h24v24H0z" fill="none"/>
103
+ <circle cx="12" cy="12" r="9" />
104
+ <path d="M13 12h5" />
105
+ <path d="M13 15h4" />
106
+ <path d="M13 18h1" />
107
+ <path d="M13 9h4" />
108
+ <path d="M13 6h1" />
109
+ </svg>
110
+ </symbol>
111
+ </svg>
112
+
113
+ <input type="checkbox" class="sidebar-toggle" name="__navigation" id="__navigation">
114
+ <input type="checkbox" class="sidebar-toggle" name="__toc" id="__toc">
115
+ <label class="overlay sidebar-overlay" for="__navigation">
116
+ <div class="visually-hidden">Hide navigation sidebar</div>
117
+ </label>
118
+ <label class="overlay toc-overlay" for="__toc">
119
+ <div class="visually-hidden">Hide table of contents sidebar</div>
120
+ </label>
121
+
122
+
123
+
124
+ <div class="page">
125
+ <header class="mobile-header">
126
+ <div class="header-left">
127
+ <label class="nav-overlay-icon" for="__navigation">
128
+ <div class="visually-hidden">Toggle site navigation sidebar</div>
129
+ <i class="icon"><svg><use href="#svg-menu"></use></svg></i>
130
+ </label>
131
+ </div>
132
+ <div class="header-center">
133
+ <a href="index"><div class="brand">Koffi</div></a>
134
+ </div>
135
+ <div class="header-right">
136
+ <div class="theme-toggle-container theme-toggle-header">
137
+ <button class="theme-toggle">
138
+ <div class="visually-hidden">Toggle Light / Dark / Auto color theme</div>
139
+ <svg class="theme-icon-when-auto"><use href="#svg-sun-half"></use></svg>
140
+ <svg class="theme-icon-when-dark"><use href="#svg-moon"></use></svg>
141
+ <svg class="theme-icon-when-light"><use href="#svg-sun"></use></svg>
142
+ </button>
143
+ </div>
144
+ <label class="toc-overlay-icon toc-header-icon" for="__toc">
145
+ <div class="visually-hidden">Toggle table of contents sidebar</div>
146
+ <i class="icon"><svg><use href="#svg-toc"></use></svg></i>
147
+ </label>
148
+ </div>
149
+ </header>
150
+ <aside class="sidebar-drawer">
151
+ <div class="sidebar-container">
152
+
153
+ <div class="sidebar-sticky"><a class="sidebar-brand" href="index">
154
+
155
+
156
+ <span class="sidebar-brand-text">Koffi</span>
157
+
158
+ </a><form class="sidebar-search-container" method="get" action="search" role="search">
159
+ <input class="sidebar-search" placeholder=Search name="q" aria-label="Search">
160
+ <input type="hidden" name="check_keywords" value="yes">
161
+ <input type="hidden" name="area" value="default">
162
+ </form>
163
+ <div id="searchbox"></div><div class="sidebar-scroll"><div class="sidebar-tree">
164
+ <ul class="current">
165
+ <li class="toctree-l1"><a class="reference internal" href="platforms">Requirements</a></li>
166
+ <li class="toctree-l1 current current-page"><a class="current reference internal" href="#">Quick start</a></li>
167
+ <li class="toctree-l1"><a class="reference internal" href="types">Data types</a></li>
168
+ <li class="toctree-l1"><a class="reference internal" href="functions">Functions</a></li>
169
+ <li class="toctree-l1"><a class="reference internal" href="memory">Memory usage</a></li>
170
+ <li class="toctree-l1"><a class="reference internal" href="benchmarks">Benchmarks</a></li>
171
+ <li class="toctree-l1"><a class="reference internal" href="contribute">Contributing</a></li>
172
+ <li class="toctree-l1"><a class="reference internal" href="changes">Changelog</a></li>
173
+ </ul>
174
+
175
+ </div>
176
+ <div style="text-align: center; margin-top: 2em;">
177
+ <a href="https://www.npmjs.com/package/koffi"><img src="https://img.shields.io/badge/NPM-2.O.1-brightgreen" alt="NPM"/></a>
178
+ <a href="https://github.com/Koromix/luigi/tree/master/koffi"><img src="https://img.shields.io/badge/GitHub-Koffi-ff6600" alt="GitHub"/></a>
179
+ </div></div>
180
+
181
+ </div>
182
+
183
+ </div>
184
+ </aside>
185
+ <div class="main">
186
+ <div class="content">
187
+ <div class="article-container">
188
+ <a href="#" class="back-to-top muted-link">
189
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
190
+ <path d="M13 20h-2V8l-5.5 5.5-1.42-1.42L12 4.16l7.92 7.92-1.42 1.42L13 8v12z"></path>
191
+ </svg>
192
+ <span>Back to top</span>
193
+ </a>
194
+ <div class="content-icon-container">
195
+ <div class="theme-toggle-container theme-toggle-content">
196
+ <button class="theme-toggle">
197
+ <div class="visually-hidden">Toggle Light / Dark / Auto color theme</div>
198
+ <svg class="theme-icon-when-auto"><use href="#svg-sun-half"></use></svg>
199
+ <svg class="theme-icon-when-dark"><use href="#svg-moon"></use></svg>
200
+ <svg class="theme-icon-when-light"><use href="#svg-sun"></use></svg>
201
+ </button>
202
+ </div>
203
+ <label class="toc-overlay-icon toc-content-icon" for="__toc">
204
+ <div class="visually-hidden">Toggle table of contents sidebar</div>
205
+ <i class="icon"><svg><use href="#svg-toc"></use></svg></i>
206
+ </label>
207
+ </div>
208
+ <article role="main">
209
+ <section id="quick-start">
210
+ <h1>Quick start<a class="headerlink" href="#quick-start" title="Permalink to this heading">#</a></h1>
211
+ <section id="install-koffi">
212
+ <h2>Install Koffi<a class="headerlink" href="#install-koffi" title="Permalink to this heading">#</a></h2>
213
+ <p>You can install Koffi with npm:</p>
214
+ <div class="highlight-sh notranslate"><div class="highlight"><pre><span></span><span class="linenos">1</span>npm install koffi
215
+ </pre></div>
216
+ </div>
217
+ <p>Once you have installed Koffi, you can start by loading it this way:</p>
218
+ <div class="highlight-js notranslate"><div class="highlight"><pre><span></span><span class="linenos">1</span><span class="kd">const</span> <span class="nx">koffi</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;koffi&#39;</span><span class="p">);</span>
219
+ </pre></div>
220
+ </div>
221
+ <p>Below you can find three examples:</p>
222
+ <ul class="simple">
223
+ <li><p>The first one runs on Linux. The functions are declared with the C-like prototype language.</p></li>
224
+ <li><p>The second one runs on Windows, and uses the node-ffi like syntax to declare functions.</p></li>
225
+ </ul>
226
+ </section>
227
+ <section id="small-linux-example">
228
+ <h2>Small Linux example<a class="headerlink" href="#small-linux-example" title="Permalink to this heading">#</a></h2>
229
+ <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>
230
+ <p>It illustrates the use of output parameters.</p>
231
+ <div class="highlight-js notranslate"><div class="highlight"><pre><span></span><span class="linenos"> 1</span><span class="kd">const</span> <span class="nx">koffi</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;koffi&#39;</span><span class="p">);</span>
232
+ <span class="linenos"> 2</span>
233
+ <span class="linenos"> 3</span><span class="c1">// Load the shared library</span>
234
+ <span class="linenos"> 4</span><span class="kd">const</span> <span class="nx">lib</span> <span class="o">=</span> <span class="nx">koffi</span><span class="p">.</span><span class="nx">load</span><span class="p">(</span><span class="s1">&#39;libc.so.6&#39;</span><span class="p">);</span>
235
+ <span class="linenos"> 5</span>
236
+ <span class="linenos"> 6</span><span class="c1">// Declare struct types</span>
237
+ <span class="linenos"> 7</span><span class="kd">const</span> <span class="nx">timeval</span> <span class="o">=</span> <span class="nx">koffi</span><span class="p">.</span><span class="nx">struct</span><span class="p">(</span><span class="s1">&#39;timeval&#39;</span><span class="p">,</span> <span class="p">{</span>
238
+ <span class="linenos"> 8</span> <span class="nx">tv_sec</span><span class="o">:</span> <span class="s1">&#39;unsigned int&#39;</span><span class="p">,</span>
239
+ <span class="linenos"> 9</span> <span class="nx">tv_usec</span><span class="o">:</span> <span class="s1">&#39;unsigned int&#39;</span>
240
+ <span class="linenos">10</span><span class="p">});</span>
241
+ <span class="linenos">11</span><span class="kd">const</span> <span class="nx">timezone</span> <span class="o">=</span> <span class="nx">koffi</span><span class="p">.</span><span class="nx">struct</span><span class="p">(</span><span class="s1">&#39;timezone&#39;</span><span class="p">,</span> <span class="p">{</span>
242
+ <span class="linenos">12</span> <span class="nx">tz_minuteswest</span><span class="o">:</span> <span class="s1">&#39;int&#39;</span><span class="p">,</span>
243
+ <span class="linenos">13</span> <span class="nx">tz_dsttime</span><span class="o">:</span> <span class="s1">&#39;int&#39;</span>
244
+ <span class="linenos">14</span><span class="p">});</span>
245
+ <span class="linenos">15</span><span class="kd">const</span> <span class="nx">time_t</span> <span class="o">=</span> <span class="nx">koffi</span><span class="p">.</span><span class="nx">struct</span><span class="p">(</span><span class="s1">&#39;time_t&#39;</span><span class="p">,</span> <span class="p">{</span> <span class="nx">value</span><span class="o">:</span> <span class="s1">&#39;int64_t&#39;</span> <span class="p">});</span>
246
+ <span class="linenos">16</span><span class="kd">const</span> <span class="nx">tm</span> <span class="o">=</span> <span class="nx">koffi</span><span class="p">.</span><span class="nx">struct</span><span class="p">(</span><span class="s1">&#39;tm&#39;</span><span class="p">,</span> <span class="p">{</span>
247
+ <span class="linenos">17</span> <span class="nx">tm_sec</span><span class="o">:</span> <span class="s1">&#39;int&#39;</span><span class="p">,</span>
248
+ <span class="linenos">18</span> <span class="nx">tm_min</span><span class="o">:</span> <span class="s1">&#39;int&#39;</span><span class="p">,</span>
249
+ <span class="linenos">19</span> <span class="nx">tm_hour</span><span class="o">:</span> <span class="s1">&#39;int&#39;</span><span class="p">,</span>
250
+ <span class="linenos">20</span> <span class="nx">tm_mday</span><span class="o">:</span> <span class="s1">&#39;int&#39;</span><span class="p">,</span>
251
+ <span class="linenos">21</span> <span class="nx">tm_mon</span><span class="o">:</span> <span class="s1">&#39;int&#39;</span><span class="p">,</span>
252
+ <span class="linenos">22</span> <span class="nx">tm_year</span><span class="o">:</span> <span class="s1">&#39;int&#39;</span><span class="p">,</span>
253
+ <span class="linenos">23</span> <span class="nx">tm_wday</span><span class="o">:</span> <span class="s1">&#39;int&#39;</span><span class="p">,</span>
254
+ <span class="linenos">24</span> <span class="nx">tm_yday</span><span class="o">:</span> <span class="s1">&#39;int&#39;</span><span class="p">,</span>
255
+ <span class="linenos">25</span> <span class="nx">tm_isdst</span><span class="o">:</span> <span class="s1">&#39;int&#39;</span>
256
+ <span class="linenos">26</span><span class="p">});</span>
257
+ <span class="linenos">27</span>
258
+ <span class="linenos">28</span><span class="c1">// Find functions</span>
259
+ <span class="linenos">29</span><span class="kd">const</span> <span class="nx">gettimeofday</span> <span class="o">=</span> <span class="nx">lib</span><span class="p">.</span><span class="nx">func</span><span class="p">(</span><span class="s1">&#39;int gettimeofday(_Out_ timeval *tv, _Out_ timezone *tz)&#39;</span><span class="p">);</span>
260
+ <span class="linenos">30</span><span class="kd">const</span> <span class="nx">localtime_r</span> <span class="o">=</span> <span class="nx">lib</span><span class="p">.</span><span class="nx">func</span><span class="p">(</span><span class="s1">&#39;tm *localtime_r(const time_t *timeval, _Out_ tm *result)&#39;</span><span class="p">);</span>
261
+ <span class="linenos">31</span><span class="kd">const</span> <span class="nx">printf</span> <span class="o">=</span> <span class="nx">lib</span><span class="p">.</span><span class="nx">func</span><span class="p">(</span><span class="s1">&#39;int printf(const char *format, ...)&#39;</span><span class="p">);</span>
262
+ <span class="linenos">32</span>
263
+ <span class="linenos">33</span><span class="c1">// Get local time</span>
264
+ <span class="linenos">34</span><span class="kd">let</span> <span class="nx">tv</span> <span class="o">=</span> <span class="p">{};</span>
265
+ <span class="linenos">35</span><span class="kd">let</span> <span class="nx">now</span> <span class="o">=</span> <span class="p">{};</span>
266
+ <span class="linenos">36</span><span class="nx">gettimeofday</span><span class="p">(</span><span class="nx">tv</span><span class="p">,</span> <span class="kc">null</span><span class="p">);</span>
267
+ <span class="linenos">37</span><span class="nx">localtime_r</span><span class="p">({</span> <span class="nx">value</span><span class="o">:</span> <span class="nx">tv</span><span class="p">.</span><span class="nx">tv_sec</span> <span class="p">},</span> <span class="nx">now</span><span class="p">);</span>
268
+ <span class="linenos">38</span>
269
+ <span class="linenos">39</span><span class="c1">// And format it with printf (variadic function)</span>
270
+ <span class="linenos">40</span><span class="nx">printf</span><span class="p">(</span><span class="s1">&#39;Hello World!\n&#39;</span><span class="p">);</span>
271
+ <span class="linenos">41</span><span class="nx">printf</span><span class="p">(</span><span class="s1">&#39;Local time: %02d:%02d:%02d\n&#39;</span><span class="p">,</span> <span class="s1">&#39;int&#39;</span><span class="p">,</span> <span class="nx">now</span><span class="p">.</span><span class="nx">tm_hour</span><span class="p">,</span> <span class="s1">&#39;int&#39;</span><span class="p">,</span> <span class="nx">now</span><span class="p">.</span><span class="nx">tm_min</span><span class="p">,</span> <span class="s1">&#39;int&#39;</span><span class="p">,</span> <span class="nx">now</span><span class="p">.</span><span class="nx">tm_sec</span><span class="p">);</span>
272
+ </pre></div>
273
+ </div>
274
+ </section>
275
+ <section id="small-windows-example">
276
+ <h2>Small Windows example<a class="headerlink" href="#small-windows-example" title="Permalink to this heading">#</a></h2>
277
+ <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>
278
+ <p>It illustrates the use of the x86 stdcall calling convention, and the use of UTF-8 and UTF-16 string arguments.</p>
279
+ <div class="highlight-js notranslate"><div class="highlight"><pre><span></span><span class="linenos"> 1</span><span class="kd">const</span> <span class="nx">koffi</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;koffi&#39;</span><span class="p">);</span>
280
+ <span class="linenos"> 2</span>
281
+ <span class="linenos"> 3</span><span class="c1">// Load the shared library</span>
282
+ <span class="linenos"> 4</span><span class="kd">const</span> <span class="nx">lib</span> <span class="o">=</span> <span class="nx">koffi</span><span class="p">.</span><span class="nx">load</span><span class="p">(</span><span class="s1">&#39;user32.dll&#39;</span><span class="p">);</span>
283
+ <span class="linenos"> 5</span>
284
+ <span class="linenos"> 6</span><span class="c1">// Declare constants</span>
285
+ <span class="linenos"> 7</span><span class="kd">const</span> <span class="nx">MB_OK</span> <span class="o">=</span> <span class="mh">0x0</span><span class="p">;</span>
286
+ <span class="linenos"> 8</span><span class="kd">const</span> <span class="nx">MB_YESNO</span> <span class="o">=</span> <span class="mh">0x4</span><span class="p">;</span>
287
+ <span class="linenos"> 9</span><span class="kd">const</span> <span class="nx">MB_ICONQUESTION</span> <span class="o">=</span> <span class="mh">0x20</span><span class="p">;</span>
288
+ <span class="linenos">10</span><span class="kd">const</span> <span class="nx">MB_ICONINFORMATION</span> <span class="o">=</span> <span class="mh">0x40</span><span class="p">;</span>
289
+ <span class="linenos">11</span><span class="kd">const</span> <span class="nx">IDOK</span> <span class="o">=</span> <span class="mf">1</span><span class="p">;</span>
290
+ <span class="linenos">12</span><span class="kd">const</span> <span class="nx">IDYES</span> <span class="o">=</span> <span class="mf">6</span><span class="p">;</span>
291
+ <span class="linenos">13</span><span class="kd">const</span> <span class="nx">IDNO</span> <span class="o">=</span> <span class="mf">7</span><span class="p">;</span>
292
+ <span class="linenos">14</span>
293
+ <span class="linenos">15</span><span class="c1">// Find functions</span>
294
+ <span class="linenos">16</span><span class="kd">const</span> <span class="nx">MessageBoxA</span> <span class="o">=</span> <span class="nx">lib</span><span class="p">.</span><span class="nx">stdcall</span><span class="p">(</span><span class="s1">&#39;MessageBoxA&#39;</span><span class="p">,</span> <span class="s1">&#39;int&#39;</span><span class="p">,</span> <span class="p">[</span><span class="s1">&#39;void *&#39;</span><span class="p">,</span> <span class="s1">&#39;str&#39;</span><span class="p">,</span> <span class="s1">&#39;str&#39;</span><span class="p">,</span> <span class="s1">&#39;uint&#39;</span><span class="p">]);</span>
295
+ <span class="linenos">17</span><span class="kd">const</span> <span class="nx">MessageBoxW</span> <span class="o">=</span> <span class="nx">lib</span><span class="p">.</span><span class="nx">stdcall</span><span class="p">(</span><span class="s1">&#39;MessageBoxW&#39;</span><span class="p">,</span> <span class="s1">&#39;int&#39;</span><span class="p">,</span> <span class="p">[</span><span class="s1">&#39;void *&#39;</span><span class="p">,</span> <span class="s1">&#39;str16&#39;</span><span class="p">,</span> <span class="s1">&#39;str16&#39;</span><span class="p">,</span> <span class="s1">&#39;uint&#39;</span><span class="p">]);</span>
296
+ <span class="linenos">18</span>
297
+ <span class="linenos">19</span><span class="kd">let</span> <span class="nx">ret</span> <span class="o">=</span> <span class="nx">MessageBoxA</span><span class="p">(</span><span class="kc">null</span><span class="p">,</span> <span class="s1">&#39;Do you want another message box?&#39;</span><span class="p">,</span> <span class="s1">&#39;Koffi&#39;</span><span class="p">,</span> <span class="nx">MB_YESNO</span> <span class="o">|</span> <span class="nx">MB_ICONQUESTION</span><span class="p">);</span>
298
+ <span class="linenos">20</span><span class="k">if</span> <span class="p">(</span><span class="nx">ret</span> <span class="o">==</span> <span class="nx">IDYES</span><span class="p">)</span>
299
+ <span class="linenos">21</span> <span class="nx">MessageBoxW</span><span class="p">(</span><span class="kc">null</span><span class="p">,</span> <span class="s1">&#39;Hello World!&#39;</span><span class="p">,</span> <span class="s1">&#39;Koffi&#39;</span><span class="p">,</span> <span class="nx">MB_ICONINFORMATION</span><span class="p">);</span>
300
+ </pre></div>
301
+ </div>
302
+ </section>
303
+ </section>
304
+
305
+ </article>
306
+ </div>
307
+ <footer>
308
+
309
+ <div class="related-pages">
310
+ <a class="next-page" href="types">
311
+ <div class="page-info">
312
+ <div class="context">
313
+ <span>Next</span>
314
+ </div>
315
+ <div class="title">Data types</div>
316
+ </div>
317
+ <svg><use href="#svg-arrow-right"></use></svg>
318
+ </a>
319
+ <a class="prev-page" href="platforms">
320
+ <svg><use href="#svg-arrow-right"></use></svg>
321
+ <div class="page-info">
322
+ <div class="context">
323
+ <span>Previous</span>
324
+ </div>
325
+
326
+ <div class="title">Requirements</div>
327
+
328
+ </div>
329
+ </a>
330
+ </div>
331
+ <div class="bottom-of-page">
332
+ <div class="left-details">
333
+ <div class="copyright">
334
+ Copyright &#169; 2022, Niels Martignène
335
+ </div>
336
+ Made with <a href="https://www.sphinx-doc.org/">Sphinx</a> and <a class="muted-link" href="https://pradyunsg.me">@pradyunsg</a>'s
337
+
338
+ <a href="https://github.com/pradyunsg/furo">Furo</a>
339
+
340
+ </div>
341
+ <div class="right-details">
342
+ <div class="icons">
343
+
344
+ </div>
345
+ </div>
346
+ </div>
347
+
348
+ </footer>
349
+ </div>
350
+ <aside class="toc-drawer">
351
+
352
+
353
+ <div class="toc-sticky toc-scroll">
354
+ <div class="toc-title-container">
355
+ <span class="toc-title">
356
+ Contents
357
+ </span>
358
+ </div>
359
+ <div class="toc-tree-container">
360
+ <div class="toc-tree">
361
+ <ul>
362
+ <li><a class="reference internal" href="#">Quick start</a><ul>
363
+ <li><a class="reference internal" href="#install-koffi">Install Koffi</a></li>
364
+ <li><a class="reference internal" href="#small-linux-example">Small Linux example</a></li>
365
+ <li><a class="reference internal" href="#small-windows-example">Small Windows example</a></li>
366
+ </ul>
367
+ </li>
368
+ </ul>
369
+
370
+ </div>
371
+ </div>
372
+ </div>
373
+
374
+
375
+ </aside>
376
+ </div>
377
+ </div><script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
378
+ <script src="_static/jquery.js"></script>
379
+ <script src="_static/underscore.js"></script>
380
+ <script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
381
+ <script src="_static/doctools.js"></script>
382
+ <script src="_static/scripts/furo.js"></script>
383
+ </body>
384
+ </html>