This commit is contained in:
2026-06-16 16:09:42 +08:00
commit bffb0cb6b7
644 changed files with 86620 additions and 0 deletions

338
Test/JsonTest/App/main.py Normal file
View File

@@ -0,0 +1,338 @@
import t, c
from stdint import *
from stdio import printf
import mpool
import json
import string
import w32.win32memory as win32mem
# ============================================================
# 测试计数器
# ============================================================
_pass_count: t.CInt = 0
_fail_count: t.CInt = 0
def check(name: t.CChar | t.CPtr, condition: bool):
global _pass_count, _fail_count
if condition:
_pass_count += 1
printf(" [PASS] %s\n", name)
else:
_fail_count += 1
printf(" [FAIL] %s\n", name)
# ============================================================
# 测试 1构造 JSON 值(使用 mpool
# ============================================================
def test_construct(pool: mpool.MPool | t.CPtr):
printf("\n+-- Construct JsonValue (with mpool) --+\n")
# null
v1: json.JsonValue | t.CPtr = json.null(pool)
check("null is_null", v1.is_null())
# bool
v2: json.JsonValue | t.CPtr = json.bool_val(pool, True)
check("bool true is_bool", v2.is_bool())
check("bool true as_bool", v2.as_bool())
v3: json.JsonValue | t.CPtr = json.bool_val(pool, False)
check("bool false !as_bool", not v3.as_bool())
# int
v4: json.JsonValue | t.CPtr = json.int_val(pool, 42)
check("int is_int", v4.is_int())
check("int 42 == 42", v4.as_int() == 42)
v5: json.JsonValue | t.CPtr = json.int_val(pool, -100)
check("int -100 == -100", v5.as_int() == -100)
# float
v6: json.JsonValue | t.CPtr = json.float_val(pool, 3.14)
check("float is_float", v6.is_float())
check("float 3.14 ~= 3.14", v6.as_float() > 3.13 and v6.as_float() < 3.15)
# string
v7: json.JsonValue | t.CPtr = json.string_val(pool, "hello")
check("string is_string", v7.is_string())
check("string == hello", string.strcmp(v7.as_string(), "hello") == 0)
# array
v8: json.JsonValue | t.CPtr = json.array(pool)
check("array is_array", v8.is_array())
check("array empty len()==0", len(v8) == 0)
# object
v9: json.JsonValue | t.CPtr = json.object(pool)
check("object is_object", v9.is_object())
check("object empty len()==0", len(v9) == 0)
printf("+--------------------------------------------+\n")
# ============================================================
# 测试 2构造数组和对象Python风格API
# ============================================================
def test_build_structures(pool: mpool.MPool | t.CPtr):
printf("\n+-- Build Arrays and Objects (Pythonic API) --+\n")
# 构建数组 [1, 2, 3]
arr: json.JsonValue | t.CPtr = json.array(pool)
json.array_append(pool, arr, json.int_val(pool, 1))
json.array_append(pool, arr, json.int_val(pool, 2))
json.array_append(pool, arr, json.int_val(pool, 3))
check("array [1,2,3] len()==3", len(arr) == 3)
check("array get_item(0)==1", arr.get_item(0).as_int() == 1)
check("array get_item(1)==2", arr.get_item(1).as_int() == 2)
check("array get_item(2)==3", arr.get_item(2).as_int() == 3)
# 构建对象 {"name": "Viper", "version": 1}
obj: json.JsonValue | t.CPtr = json.object(pool)
json.object_set(pool, obj, "name", json.string_val(pool, "Viper"))
json.object_set(pool, obj, "version", json.int_val(pool, 1))
check("object len()==2", len(obj) == 2)
# Python风格取值obj["key"]
name_val: json.JsonValue | t.CPtr = obj["name"]
check("obj['name']==Viper", name_val != None and string.strcmp(name_val.as_string(), "Viper") == 0)
ver_val: json.JsonValue | t.CPtr = obj["version"]
check("obj['version']==1", ver_val != None and ver_val.as_int() == 1)
missing: json.JsonValue | t.CPtr = obj["missing"]
check("obj['missing']==None", missing == None)
printf("+--------------------------------------------+\n")
# ============================================================
# 测试 3JSON 解析
# ============================================================
def test_parse(pool: mpool.MPool | t.CPtr):
printf("\n+-- Parse JSON --+\n")
# 解析整数
v1: json.JsonValue | t.CPtr = json.parse(pool, "42")
check("parse int is_int", v1.is_int())
check("parse int == 42", v1.as_int() == 42)
# 解析负数
v2: json.JsonValue | t.CPtr = json.parse(pool, "-7")
check("parse neg int == -7", v2.as_int() == -7)
# 解析浮点数
v3: json.JsonValue | t.CPtr = json.parse(pool, "3.14")
check("parse float is_float", v3.is_float())
check("parse float ~= 3.14", v3.as_float() > 3.13 and v3.as_float() < 3.15)
# 解析字符串
v4: json.JsonValue | t.CPtr = json.parse(pool, '"hello world"')
check("parse string is_string", v4.is_string())
check("parse string == hello world", string.strcmp(v4.as_string(), "hello world") == 0)
# 解析布尔
v5: json.JsonValue | t.CPtr = json.parse(pool, "true")
check("parse true is_bool", v5.is_bool())
check("parse true as_bool", v5.as_bool())
v6: json.JsonValue | t.CPtr = json.parse(pool, "false")
check("parse false !as_bool", not v6.as_bool())
# 解析 null
v7: json.JsonValue | t.CPtr = json.parse(pool, "null")
check("parse null is_null", v7.is_null())
# 解析数组
v8: json.JsonValue | t.CPtr = json.parse(pool, "[1, 2, 3]")
check("parse array is_array", v8.is_array())
check("parse array len()==3", len(v8) == 3)
check("parse array get_item(0)==1", v8.get_item(0).as_int() == 1)
check("parse array get_item(2)==3", v8.get_item(2).as_int() == 3)
# 解析对象Python风格取值
v9: json.JsonValue | t.CPtr = json.parse(pool, '{"x": 10, "y": 20}')
check("parse object is_object", v9.is_object())
check("parse object len()==2", len(v9) == 2)
x_val: json.JsonValue | t.CPtr = v9["x"]
check("parse obj['x']==10", x_val != None and x_val.as_int() == 10)
y_val: json.JsonValue | t.CPtr = v9["y"]
check("parse obj['y']==20", y_val != None and y_val.as_int() == 20)
printf("+--------------------------------------------+\n")
# ============================================================
# 测试 4JSON 序列化
# ============================================================
def test_write(pool: mpool.MPool | t.CPtr):
printf("\n+-- Write JSON --+\n")
# 写整数
v1: json.JsonValue | t.CPtr = json.int_val(pool, 42)
s1: t.CChar | t.CPtr = json.write(pool, v1, False)
check("write int 42", string.strcmp(s1, "42") == 0)
# 写字符串
v2: json.JsonValue | t.CPtr = json.string_val(pool, "hello")
s2: t.CChar | t.CPtr = json.write(pool, v2, False)
check("write string hello", string.strcmp(s2, '"hello"') == 0)
# 写布尔
v3: json.JsonValue | t.CPtr = json.bool_val(pool, True)
s3: t.CChar | t.CPtr = json.write(pool, v3, False)
check("write bool true", string.strcmp(s3, "true") == 0)
v4: json.JsonValue | t.CPtr = json.bool_val(pool, False)
s4: t.CChar | t.CPtr = json.write(pool, v4, False)
check("write bool false", string.strcmp(s4, "false") == 0)
# 写 null
v5: json.JsonValue | t.CPtr = json.null(pool)
s5: t.CChar | t.CPtr = json.write(pool, v5, False)
check("write null", string.strcmp(s5, "null") == 0)
# 写数组
arr: json.JsonValue | t.CPtr = json.array(pool)
json.array_append(pool, arr, json.int_val(pool, 1))
json.array_append(pool, arr, json.int_val(pool, 2))
json.array_append(pool, arr, json.int_val(pool, 3))
s6: t.CChar | t.CPtr = json.write(pool, arr, False)
check("write array [1,2,3]", string.strcmp(s6, "[1,2,3]") == 0)
# 写对象
obj: json.JsonValue | t.CPtr = json.object(pool)
json.object_set(pool, obj, "a", json.int_val(pool, 1))
json.object_set(pool, obj, "b", json.string_val(pool, "x"))
s7: t.CChar | t.CPtr = json.write(pool, obj, False)
check("write object non-null", s7 != None)
printf("+--------------------------------------------+\n")
# ============================================================
# 测试 5解析复杂嵌套 JSONPython风格API
# ============================================================
def test_nested(pool: mpool.MPool | t.CPtr):
printf("\n+-- Parse Nested JSON (Pythonic API) --+\n")
src: t.CChar | t.CPtr = '{"name": "Viper", "version": 1, "features": ["fast", "safe", "portable"], "nested": {"key": "value", "num": 99}}'
root: json.JsonValue | t.CPtr = json.parse(pool, src)
check("nested is_object", root.is_object())
check("nested len()==4", len(root) == 4)
# Python风格取值root["name"]
name: json.JsonValue | t.CPtr = root["name"]
check("root['name']==Viper", name != None and string.strcmp(name.as_string(), "Viper") == 0)
# root["version"]
ver: json.JsonValue | t.CPtr = root["version"]
check("root['version']==1", ver != None and ver.as_int() == 1)
# root["features"] 数组
feat: json.JsonValue | t.CPtr = root["features"]
check("root['features'] is_array", feat != None and feat.is_array())
check("root['features'] len()==3", feat != None and len(feat) == 3)
check("root['features'][0]==fast", feat != None and string.strcmp(feat.get_item(0).as_string(), "fast") == 0)
check("root['features'][2]==portable", feat != None and string.strcmp(feat.get_item(2).as_string(), "portable") == 0)
# root["nested"] 对象
nested: json.JsonValue | t.CPtr = root["nested"]
check("root['nested'] is_object", nested != None and nested.is_object())
nk: json.JsonValue | t.CPtr = nested["key"] if nested != None else None
check("root['nested']['key']==value", nk != None and string.strcmp(nk.as_string(), "value") == 0)
nn: json.JsonValue | t.CPtr = nested["num"] if nested != None else None
check("root['nested']['num']==99", nn != None and nn.as_int() == 99)
printf("+--------------------------------------------+\n")
# ============================================================
# 测试 6mpool 重置后重新使用
# ============================================================
def test_mpool_reuse():
printf("\n+-- MPool Reuse --+\n")
# 分配内存
mem: t.CVoid | t.CPtr = win32mem.VirtualAlloc(t.CVoid(0, t.CPtr), 8192, 0x3000, 0x04)
check("VirtualAlloc ok", mem != None)
pool: mpool.MPool | t.CPtr = mpool.MPool(mem, 8192, 0)
# 第一次使用
v1: json.JsonValue | t.CPtr = json.int_val(pool, 100)
check("reuse round1 int==100", v1.as_int() == 100)
# 重置 mpool
pool.reset()
# 第二次使用(内存复用)
v2: json.JsonValue | t.CPtr = json.string_val(pool, "reused")
check("reuse round2 string==reused", string.strcmp(v2.as_string(), "reused") == 0)
# 重置后再解析
pool.reset()
v3: json.JsonValue | t.CPtr = json.parse(pool, '{"test": true}')
check("reuse round3 parse ok", v3.is_object())
tv: json.JsonValue | t.CPtr = v3["test"]
check("reuse round3 obj['test']==true", tv != None and tv.as_bool())
win32mem.VirtualFree(mem, 0, 0x8000)
printf("+--------------------------------------------+\n")
# ============================================================
# 测试 7转义字符解析
# ============================================================
def test_escape(pool: mpool.MPool | t.CPtr):
printf("\n+-- Escape Characters --+\n")
# 解析含转义字符的字符串
v1: json.JsonValue | t.CPtr = json.parse(pool, '"hello\\nworld"')
check("escape \\n is_string", v1.is_string())
sv1: t.CChar | t.CPtr = v1.as_string()
check("escape \\n contains newline", sv1 != None and sv1[5] == '\n')
v2: json.JsonValue | t.CPtr = json.parse(pool, '"tab\\there"')
check("escape \\t is_string", v2.is_string())
sv2: t.CChar | t.CPtr = v2.as_string()
check("escape \\t contains tab", sv2 != None and sv2[3] == '\t')
v3: json.JsonValue | t.CPtr = json.parse(pool, '"quote\\""')
check("escape \\\" is_string", v3.is_string())
printf("+--------------------------------------------+\n")
# ============================================================
# 主函数
# ============================================================
def main() -> t.CInt | t.CExport:
printf("=== JSON Library Test (Pythonic API) ===\n")
# 使用 mpool 的 bump 分配器
mem: t.CVoid | t.CPtr = win32mem.VirtualAlloc(t.CVoid(0, t.CPtr), 65536, 0x3000, 0x04)
pool: mpool.MPool | t.CPtr = mpool.MPool(mem, 65536, 0)
test_construct(pool)
pool.reset()
test_build_structures(pool)
pool.reset()
test_parse(pool)
pool.reset()
test_write(pool)
pool.reset()
test_nested(pool)
pool.reset()
test_escape(pool)
pool.reset()
test_mpool_reuse()
win32mem.VirtualFree(mem, 0, 0x8000)
printf("\n=== Results: %d passed, %d failed ===\n", _pass_count, _fail_count)
return 0

View File

@@ -0,0 +1 @@
{"main": "1dd5985fb89f7ef9", "stdint": "56cdd754a8a09347", "w32.win32base": "5a6a2137958c28c5", "win32base": "5a6a2137958c28c5", "mpool": "68c4fe4b12c908e3", "string": "6aee24fdefa3cbc0", "w32.win32memory": "72e2d5ccb7cedcf1", "win32memory": "72e2d5ccb7cedcf1", "stdio": "73edbcf76e32d00b", "json.__init__": "8ee3170049c70333", "__init__": "8ee3170049c70333", "json": "8ee3170049c70333", "json.__parser": "bd2e7db1744476fe", "__parser": "bd2e7db1744476fe", "viperio": "c9f4be41ca1cc2b4", "json.__writer": "eaf7a981f0ef5b22", "__writer": "eaf7a981f0ef5b22", "w32.fileio": "fa3691e66b426950", "fileio": "fa3691e66b426950", "w32.win32console": "bbdf3bbd4c3bc28c", "win32console": "bbdf3bbd4c3bc28c", "w32.win32file": "abf9ce3160c9279e", "win32file": "abf9ce3160c9279e", "w32.win32process": "067c78e9f121dce3", "win32process": "067c78e9f121dce3"}

View File

@@ -0,0 +1 @@
{"stdint": "56cdd754a8a09347", "w32.win32base": "5a6a2137958c28c5", "win32base": "5a6a2137958c28c5", "mpool": "68c4fe4b12c908e3", "string": "6aee24fdefa3cbc0", "w32.win32memory": "72e2d5ccb7cedcf1", "win32memory": "72e2d5ccb7cedcf1", "stdio": "73edbcf76e32d00b", "json.__init__": "8ee3170049c70333", "__init__": "8ee3170049c70333", "json": "8ee3170049c70333", "json.__parser": "bd2e7db1744476fe", "__parser": "bd2e7db1744476fe", "viperio": "c9f4be41ca1cc2b4", "json.__writer": "eaf7a981f0ef5b22", "__writer": "eaf7a981f0ef5b22"}

View File

@@ -0,0 +1 @@
{"main": "1dd5985fb89f7ef9", "stdint": "56cdd754a8a09347", "w32.win32base": "5a6a2137958c28c5", "win32base": "5a6a2137958c28c5", "mpool": "68c4fe4b12c908e3", "string": "6aee24fdefa3cbc0", "w32.win32memory": "72e2d5ccb7cedcf1", "win32memory": "72e2d5ccb7cedcf1", "stdio": "73edbcf76e32d00b", "json.__init__": "8ee3170049c70333", "__init__": "8ee3170049c70333", "json": "8ee3170049c70333", "json.__parser": "bd2e7db1744476fe", "__parser": "bd2e7db1744476fe", "viperio": "c9f4be41ca1cc2b4", "json.__writer": "eaf7a981f0ef5b22", "__writer": "eaf7a981f0ef5b22", "w32.fileio": "fa3691e66b426950", "fileio": "fa3691e66b426950", "w32.win32console": "bbdf3bbd4c3bc28c", "win32console": "bbdf3bbd4c3bc28c", "w32.win32file": "abf9ce3160c9279e", "win32file": "abf9ce3160c9279e", "w32.win32process": "067c78e9f121dce3", "win32process": "067c78e9f121dce3", "w32.win32sync": "29813d57621099a9", "win32sync": "29813d57621099a9"}

View File

@@ -0,0 +1 @@
{"main": "1dd5985fb89f7ef9", "stdint": "56cdd754a8a09347", "w32.win32base": "5a6a2137958c28c5", "win32base": "5a6a2137958c28c5", "mpool": "68c4fe4b12c908e3", "string": "6aee24fdefa3cbc0", "w32.win32memory": "72e2d5ccb7cedcf1", "win32memory": "72e2d5ccb7cedcf1", "stdio": "73edbcf76e32d00b", "json.__init__": "8ee3170049c70333", "__init__": "8ee3170049c70333", "json": "8ee3170049c70333", "json.__parser": "bd2e7db1744476fe", "__parser": "bd2e7db1744476fe", "viperio": "c9f4be41ca1cc2b4", "json.__writer": "eaf7a981f0ef5b22", "__writer": "eaf7a981f0ef5b22", "w32.fileio": "fa3691e66b426950", "fileio": "fa3691e66b426950"}

View File

@@ -0,0 +1 @@
{"main": "1dd5985fb89f7ef9", "stdint": "56cdd754a8a09347", "w32.win32base": "5a6a2137958c28c5", "win32base": "5a6a2137958c28c5", "mpool": "68c4fe4b12c908e3", "string": "6aee24fdefa3cbc0", "w32.win32memory": "72e2d5ccb7cedcf1", "win32memory": "72e2d5ccb7cedcf1", "stdio": "73edbcf76e32d00b", "json.__init__": "8ee3170049c70333", "__init__": "8ee3170049c70333", "json": "8ee3170049c70333", "json.__parser": "bd2e7db1744476fe", "__parser": "bd2e7db1744476fe", "viperio": "c9f4be41ca1cc2b4", "json.__writer": "eaf7a981f0ef5b22", "__writer": "eaf7a981f0ef5b22", "w32.fileio": "fa3691e66b426950", "fileio": "fa3691e66b426950", "w32.win32console": "bbdf3bbd4c3bc28c", "win32console": "bbdf3bbd4c3bc28c", "w32.win32file": "abf9ce3160c9279e", "win32file": "abf9ce3160c9279e", "w32.win32process": "067c78e9f121dce3", "win32process": "067c78e9f121dce3", "w32.win32sync": "29813d57621099a9", "win32sync": "29813d57621099a9"}

View File

@@ -0,0 +1 @@
{"main": "1dd5985fb89f7ef9", "stdint": "56cdd754a8a09347", "w32.win32base": "5a6a2137958c28c5", "win32base": "5a6a2137958c28c5", "mpool": "68c4fe4b12c908e3", "string": "6aee24fdefa3cbc0", "w32.win32memory": "72e2d5ccb7cedcf1", "win32memory": "72e2d5ccb7cedcf1", "stdio": "73edbcf76e32d00b", "json.__init__": "8ee3170049c70333", "__init__": "8ee3170049c70333", "json": "8ee3170049c70333", "json.__parser": "bd2e7db1744476fe", "__parser": "bd2e7db1744476fe", "viperio": "c9f4be41ca1cc2b4", "json.__writer": "eaf7a981f0ef5b22", "__writer": "eaf7a981f0ef5b22"}

View File

@@ -0,0 +1 @@
{"main": "1dd5985fb89f7ef9", "stdint": "56cdd754a8a09347", "w32.win32base": "5a6a2137958c28c5", "win32base": "5a6a2137958c28c5", "mpool": "68c4fe4b12c908e3", "string": "6aee24fdefa3cbc0", "w32.win32memory": "72e2d5ccb7cedcf1", "win32memory": "72e2d5ccb7cedcf1", "stdio": "73edbcf76e32d00b", "json.__init__": "8ee3170049c70333", "__init__": "8ee3170049c70333", "json": "8ee3170049c70333", "json.__parser": "bd2e7db1744476fe", "__parser": "bd2e7db1744476fe", "viperio": "c9f4be41ca1cc2b4", "json.__writer": "eaf7a981f0ef5b22", "__writer": "eaf7a981f0ef5b22", "w32.fileio": "fa3691e66b426950", "fileio": "fa3691e66b426950", "w32.win32console": "bbdf3bbd4c3bc28c", "win32console": "bbdf3bbd4c3bc28c", "w32.win32file": "abf9ce3160c9279e", "win32file": "abf9ce3160c9279e"}

View File

@@ -0,0 +1 @@
{"main": "1dd5985fb89f7ef9", "stdint": "56cdd754a8a09347", "w32.win32base": "5a6a2137958c28c5", "win32base": "5a6a2137958c28c5", "mpool": "68c4fe4b12c908e3", "string": "6aee24fdefa3cbc0", "w32.win32memory": "72e2d5ccb7cedcf1", "win32memory": "72e2d5ccb7cedcf1", "stdio": "73edbcf76e32d00b", "json.__init__": "8ee3170049c70333", "__init__": "8ee3170049c70333", "json": "8ee3170049c70333", "json.__parser": "bd2e7db1744476fe", "__parser": "bd2e7db1744476fe", "viperio": "c9f4be41ca1cc2b4", "json.__writer": "eaf7a981f0ef5b22", "__writer": "eaf7a981f0ef5b22", "w32.fileio": "fa3691e66b426950", "fileio": "fa3691e66b426950", "w32.win32console": "bbdf3bbd4c3bc28c", "win32console": "bbdf3bbd4c3bc28c", "w32.win32file": "abf9ce3160c9279e", "win32file": "abf9ce3160c9279e", "w32.win32process": "067c78e9f121dce3", "win32process": "067c78e9f121dce3", "w32.win32sync": "29813d57621099a9", "win32sync": "29813d57621099a9"}

View File

@@ -0,0 +1 @@
{"main": "1dd5985fb89f7ef9", "stdint": "56cdd754a8a09347", "w32.win32base": "5a6a2137958c28c5", "win32base": "5a6a2137958c28c5", "mpool": "68c4fe4b12c908e3", "string": "6aee24fdefa3cbc0", "w32.win32memory": "72e2d5ccb7cedcf1", "win32memory": "72e2d5ccb7cedcf1", "stdio": "73edbcf76e32d00b", "json.__init__": "8ee3170049c70333", "__init__": "8ee3170049c70333", "json": "8ee3170049c70333", "json.__parser": "bd2e7db1744476fe", "__parser": "bd2e7db1744476fe", "viperio": "c9f4be41ca1cc2b4", "json.__writer": "eaf7a981f0ef5b22", "__writer": "eaf7a981f0ef5b22", "w32.fileio": "fa3691e66b426950", "fileio": "fa3691e66b426950", "w32.win32console": "bbdf3bbd4c3bc28c", "win32console": "bbdf3bbd4c3bc28c", "w32.win32file": "abf9ce3160c9279e", "win32file": "abf9ce3160c9279e"}

View File

@@ -0,0 +1 @@
{"main": "1dd5985fb89f7ef9", "stdint": "56cdd754a8a09347", "w32.win32base": "5a6a2137958c28c5", "win32base": "5a6a2137958c28c5", "mpool": "68c4fe4b12c908e3", "string": "6aee24fdefa3cbc0", "w32.win32memory": "72e2d5ccb7cedcf1", "win32memory": "72e2d5ccb7cedcf1", "stdio": "73edbcf76e32d00b", "json.__init__": "8ee3170049c70333", "__init__": "8ee3170049c70333", "json": "8ee3170049c70333", "json.__parser": "bd2e7db1744476fe", "__parser": "bd2e7db1744476fe", "viperio": "c9f4be41ca1cc2b4", "json.__writer": "eaf7a981f0ef5b22", "__writer": "eaf7a981f0ef5b22", "w32.fileio": "fa3691e66b426950", "fileio": "fa3691e66b426950", "w32.win32console": "bbdf3bbd4c3bc28c", "win32console": "bbdf3bbd4c3bc28c"}

View File

@@ -0,0 +1 @@
{"main": "1dd5985fb89f7ef9", "stdint": "56cdd754a8a09347", "w32.win32base": "5a6a2137958c28c5", "win32base": "5a6a2137958c28c5", "mpool": "68c4fe4b12c908e3", "string": "6aee24fdefa3cbc0", "w32.win32memory": "72e2d5ccb7cedcf1", "win32memory": "72e2d5ccb7cedcf1", "stdio": "73edbcf76e32d00b", "json.__init__": "8ee3170049c70333", "__init__": "8ee3170049c70333", "json": "8ee3170049c70333", "json.__parser": "bd2e7db1744476fe", "__parser": "bd2e7db1744476fe", "viperio": "c9f4be41ca1cc2b4", "json.__writer": "eaf7a981f0ef5b22", "__writer": "eaf7a981f0ef5b22", "w32.fileio": "fa3691e66b426950", "fileio": "fa3691e66b426950", "w32.win32console": "bbdf3bbd4c3bc28c", "win32console": "bbdf3bbd4c3bc28c", "w32.win32file": "abf9ce3160c9279e", "win32file": "abf9ce3160c9279e", "w32.win32process": "067c78e9f121dce3", "win32process": "067c78e9f121dce3", "w32.win32sync": "29813d57621099a9", "win32sync": "29813d57621099a9"}

View File

@@ -0,0 +1 @@
{"main": "1dd5985fb89f7ef9", "stdint": "56cdd754a8a09347", "w32.win32base": "5a6a2137958c28c5", "win32base": "5a6a2137958c28c5", "mpool": "68c4fe4b12c908e3", "string": "6aee24fdefa3cbc0", "w32.win32memory": "72e2d5ccb7cedcf1", "win32memory": "72e2d5ccb7cedcf1", "stdio": "73edbcf76e32d00b", "json.__init__": "8ee3170049c70333", "__init__": "8ee3170049c70333", "json": "8ee3170049c70333", "json.__parser": "bd2e7db1744476fe", "__parser": "bd2e7db1744476fe", "viperio": "c9f4be41ca1cc2b4", "json.__writer": "eaf7a981f0ef5b22", "__writer": "eaf7a981f0ef5b22"}

View File

@@ -0,0 +1 @@
{"main": "1dd5985fb89f7ef9", "stdint": "56cdd754a8a09347", "w32.win32base": "5a6a2137958c28c5", "win32base": "5a6a2137958c28c5", "mpool": "68c4fe4b12c908e3", "string": "6aee24fdefa3cbc0", "w32.win32memory": "72e2d5ccb7cedcf1", "win32memory": "72e2d5ccb7cedcf1", "stdio": "73edbcf76e32d00b", "json.__init__": "8ee3170049c70333", "__init__": "8ee3170049c70333", "json": "8ee3170049c70333", "json.__parser": "bd2e7db1744476fe", "__parser": "bd2e7db1744476fe", "viperio": "c9f4be41ca1cc2b4", "json.__writer": "eaf7a981f0ef5b22", "__writer": "eaf7a981f0ef5b22", "w32.fileio": "fa3691e66b426950", "fileio": "fa3691e66b426950", "w32.win32console": "bbdf3bbd4c3bc28c", "win32console": "bbdf3bbd4c3bc28c", "w32.win32file": "abf9ce3160c9279e", "win32file": "abf9ce3160c9279e", "w32.win32process": "067c78e9f121dce3", "win32process": "067c78e9f121dce3", "w32.win32sync": "29813d57621099a9", "win32sync": "29813d57621099a9"}

View File

@@ -0,0 +1 @@
{"main": "1dd5985fb89f7ef9", "stdint": "56cdd754a8a09347", "w32.win32base": "5a6a2137958c28c5", "win32base": "5a6a2137958c28c5", "mpool": "68c4fe4b12c908e3", "string": "6aee24fdefa3cbc0", "w32.win32memory": "72e2d5ccb7cedcf1", "win32memory": "72e2d5ccb7cedcf1", "stdio": "73edbcf76e32d00b", "json.__init__": "8ee3170049c70333", "__init__": "8ee3170049c70333", "json": "8ee3170049c70333", "json.__parser": "bd2e7db1744476fe", "__parser": "bd2e7db1744476fe", "viperio": "c9f4be41ca1cc2b4", "json.__writer": "eaf7a981f0ef5b22", "__writer": "eaf7a981f0ef5b22", "w32.fileio": "fa3691e66b426950", "fileio": "fa3691e66b426950"}

View File

@@ -0,0 +1,28 @@
{
"name": "JsonTest",
"version": "1.0.0",
"source_dir": "./App",
"temp_dir": "./temp",
"output_dir": "./output",
"compiler": {
"cmd": "llc",
"flags": ["-filetype=obj", "-relocation-model=pic"]
},
"linker": {
"cmd": "clang++",
"flags": ["-Wl,--allow-multiple-definition", "-Wl,--unresolved-symbols=ignore-in-object-files", "-lmsvcrt", "-lucrt", "-lpthread", "-lmingwex", "-lkernel32", "-luser32", "-latomic"],
"output": "JsonTest.exe"
},
"includes": [
"../../includes"
],
"target": {
"triple": "x86_64-pc-windows-gnu",
"datalayout": "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
},
"options": {
"slice_level": 3,
"target": "llvm",
"strict_mode": true
}
}

View File

@@ -0,0 +1,136 @@
"""
Auto-generated Python stub file from w32.win32process.py
Module: w32.win32process
"""
import c
import t
from stdint import *
from w32.win32base import *
PROCESS_TERMINATE: t.CDefine = 0x0001
PROCESS_CREATE_THREAD: t.CDefine = 0x0002
PROCESS_VM_OPERATION: t.CDefine = 0x0008
PROCESS_VM_READ: t.CDefine = 0x0010
PROCESS_VM_WRITE: t.CDefine = 0x0020
PROCESS_QUERY_INFORMATION: t.CDefine = 0x0400
PROCESS_ALL_ACCESS: t.CDefine = 0x001FFFFF
THREAD_TERMINATE: t.CDefine = 0x0001
THREAD_SUSPEND_RESUME: t.CDefine = 0x0002
THREAD_GET_CONTEXT: t.CDefine = 0x0008
THREAD_SET_CONTEXT: t.CDefine = 0x0010
THREAD_QUERY_INFORMATION: t.CDefine = 0x0040
THREAD_ALL_ACCESS: t.CDefine = 0x001FFFFF
CREATE_SUSPENDED: t.CDefine = 0x00000004
CREATE_NEW_CONSOLE: t.CDefine = 0x00000010
CREATE_NEW_PROCESS_GROUP: t.CDefine = 0x00000200
CREATE_NO_WINDOW: t.CDefine = 0x08000000
DETACHED_PROCESS: t.CDefine = 0x00000008
STARTF_USESHOWWINDOW: t.CDefine = 0x00000001
STARTF_USESTDHANDLES: t.CDefine = 0x00000100
SW_HIDE: t.CDefine = 0
SW_SHOW: t.CDefine = 5
SW_MINIMIZE: t.CDefine = 6
NORMAL_PRIORITY_CLASS: t.CDefine = 0x00000020
IDLE_PRIORITY_CLASS: t.CDefine = 0x00000040
HIGH_PRIORITY_CLASS: t.CDefine = 0x00000080
REALTIME_PRIORITY_CLASS: t.CDefine = 0x00000100
BELOW_NORMAL_PRIORITY_CLASS: t.CDefine = 0x00004000
ABOVE_NORMAL_PRIORITY_CLASS: t.CDefine = 0x00008000
STILL_ACTIVE: t.CDefine = 259
class STARTUPINFOA:
cb: ULONG
lpReserved: CHARPTR
lpDesktop: CHARPTR
lpTitle: CHARPTR
dwX: ULONG
dwY: ULONG
dwXSize: ULONG
dwYSize: ULONG
dwXCountChars: ULONG
dwYCountChars: ULONG
dwFillAttribute: ULONG
dwFlags: ULONG
wShowWindow: WORD
cbReserved2: WORD
lpReserved2: VOIDPTR
hStdInput: HANDLE
hStdOutput: HANDLE
hStdError: HANDLE
class STARTUPINFOW:
cb: ULONG
lpReserved: WCHARPTR
lpDesktop: WCHARPTR
lpTitle: WCHARPTR
dwX: ULONG
dwY: ULONG
dwXSize: ULONG
dwYSize: ULONG
dwXCountChars: ULONG
dwYCountChars: ULONG
dwFillAttribute: ULONG
dwFlags: ULONG
wShowWindow: WORD
cbReserved2: WORD
lpReserved2: VOIDPTR
hStdInput: HANDLE
hStdOutput: HANDLE
hStdError: HANDLE
class PROCESS_INFORMATION:
hProcess: HANDLE
hThread: HANDLE
dwProcessId: ULONG
dwThreadId: ULONG
def CreateProcessA(lpApplicationName: LPCSTR, lpCommandLine: CHARPTR, lpProcessAttributes: SECURITY_ATTRIBUTES | t.CPtr, lpThreadAttributes: SECURITY_ATTRIBUTES | t.CPtr, bInheritHandles: BOOL, dwCreationFlags: ULONG, lpEnvironment: VOIDPTR, lpCurrentDirectory: LPCSTR, lpStartupInfo: STARTUPINFOA | t.CPtr, lpProcessInformation: PROCESS_INFORMATION | t.CPtr) -> BOOL | t.State: pass
def CreateProcessW(lpApplicationName: LPCWSTR, lpCommandLine: WCHARPTR, lpProcessAttributes: SECURITY_ATTRIBUTES | t.CPtr, lpThreadAttributes: SECURITY_ATTRIBUTES | t.CPtr, bInheritHandles: BOOL, dwCreationFlags: ULONG, lpEnvironment: VOIDPTR, lpCurrentDirectory: LPCWSTR, lpStartupInfo: STARTUPINFOW | t.CPtr, lpProcessInformation: PROCESS_INFORMATION | t.CPtr) -> BOOL | t.State: pass
def TerminateProcess(hProcess: HANDLE, uExitCode: UINT) -> BOOL | t.State: pass
def GetExitCodeProcess(hProcess: HANDLE, lpExitCode: ULONG | t.CPtr) -> BOOL | t.State: pass
def GetExitCodeThread(hThread: HANDLE, lpExitCode: ULONG | t.CPtr) -> BOOL | t.State: pass
def OpenProcess(dwDesiredAccess: ULONG, bInheritHandle: BOOL, dwProcessId: ULONG) -> HANDLE | t.State: pass
def GetCurrentProcess() -> HANDLE | t.State: pass
def GetCurrentProcessId() -> ULONG | t.State: pass
def CreateThread(lpThreadAttributes: SECURITY_ATTRIBUTES | t.CPtr, dwStackSize: t.CSizeT, lpStartAddress: VOIDPTR, lpParameter: VOIDPTR, dwCreationFlags: ULONG, lpThreadId: ULONG | t.CPtr) -> HANDLE | t.State: pass
def OpenThread(dwDesiredAccess: ULONG, bInheritHandle: BOOL, dwThreadId: ULONG) -> HANDLE | t.State: pass
def SuspendThread(hThread: HANDLE) -> ULONG | t.State: pass
def ResumeThread(hThread: HANDLE) -> ULONG | t.State: pass
def TerminateThread(hThread: HANDLE, dwExitCode: ULONG) -> BOOL | t.State: pass
def GetCurrentThread() -> HANDLE | t.State: pass
def GetCurrentThreadId() -> ULONG | t.State: pass
def GetThreadId(hThread: HANDLE) -> ULONG | t.State: pass
def GetProcessId(hProcess: HANDLE) -> ULONG | t.State: pass
def SetThreadPriority(hThread: HANDLE, nPriority: INT) -> BOOL | t.State: pass
def GetThreadPriority(hThread: HANDLE) -> INT | t.State: pass
def ExitProcess(uExitCode: UINT) -> VOID | t.State: pass
def ExitThread(dwExitCode: ULONG) -> VOID | t.State: pass
def TlsAlloc() -> ULONG | t.State: pass
def TlsFree(dwTlsIndex: ULONG) -> BOOL | t.State: pass
def TlsGetValue(dwTlsIndex: ULONG) -> VOIDPTR | t.State: pass
def TlsSetValue(dwTlsIndex: ULONG, lpTlsValue: VOIDPTR) -> BOOL | t.State: pass

View File

@@ -0,0 +1,34 @@
"""
Auto-generated Python stub file from main.py
Module: main
"""
import t, c
from stdint import *
from stdio import printf
import mpool
import json
import string
import w32.win32memory as win32mem
_pass_count: t.CExtern | t.CInt
_fail_count: t.CExtern | t.CInt
def check(name: t.CChar | t.CPtr, condition: bool) -> t.CInt: pass
def test_construct(pool: mpool.MPool | t.CPtr) -> t.CInt: pass
def test_build_structures(pool: mpool.MPool | t.CPtr) -> t.CInt: pass
def test_parse(pool: mpool.MPool | t.CPtr) -> t.CInt: pass
def test_write(pool: mpool.MPool | t.CPtr) -> t.CInt: pass
def test_nested(pool: mpool.MPool | t.CPtr) -> t.CInt: pass
def test_mpool_reuse() -> t.CInt: pass
def test_escape(pool: mpool.MPool | t.CPtr) -> t.CInt: pass
def main() -> t.CInt | t.CExport: pass

View File

@@ -0,0 +1,85 @@
"""
Auto-generated Python stub file from w32.win32sync.py
Module: w32.win32sync
"""
import c
import t
from stdint import *
from w32.win32base import *
class CRITICAL_SECTION:
DebugInfo: VOIDPTR
LockCount: LONG
RecursionCount: LONG
OwningThread: HANDLE
LockSemaphore: HANDLE
SpinCount: QWORD
def InitializeCriticalSection(lpCriticalSection: CRITICAL_SECTION | t.CPtr) -> VOID | t.State: pass
def EnterCriticalSection(lpCriticalSection: CRITICAL_SECTION | t.CPtr) -> VOID | t.State: pass
def LeaveCriticalSection(lpCriticalSection: CRITICAL_SECTION | t.CPtr) -> VOID | t.State: pass
def DeleteCriticalSection(lpCriticalSection: CRITICAL_SECTION | t.CPtr) -> VOID | t.State: pass
def TryEnterCriticalSection(lpCriticalSection: CRITICAL_SECTION | t.CPtr) -> BOOL | t.State: pass
def SetCriticalSectionSpinCount(lpCriticalSection: CRITICAL_SECTION | t.CPtr, dwSpinCount: ULONG) -> ULONG | t.State: pass
def InitializeCriticalSectionAndSpinCount(lpCriticalSection: CRITICAL_SECTION | t.CPtr, dwSpinCount: ULONG) -> BOOL | t.State: pass
def CreateMutexA(lpMutexAttributes: SECURITY_ATTRIBUTES | t.CPtr, bInitialOwner: BOOL, lpName: LPCSTR) -> HANDLE | t.State: pass
def CreateMutexW(lpMutexAttributes: SECURITY_ATTRIBUTES | t.CPtr, bInitialOwner: BOOL, lpName: LPCWSTR) -> HANDLE | t.State: pass
def OpenMutexA(dwDesiredAccess: ULONG, bInheritHandle: BOOL, lpName: LPCSTR) -> HANDLE | t.State: pass
def OpenMutexW(dwDesiredAccess: ULONG, bInheritHandle: BOOL, lpName: LPCWSTR) -> HANDLE | t.State: pass
def ReleaseMutex(hMutex: HANDLE) -> BOOL | t.State: pass
def CreateEventA(lpEventAttributes: SECURITY_ATTRIBUTES | t.CPtr, bManualReset: BOOL, bInitialState: BOOL, lpName: LPCSTR) -> HANDLE | t.State: pass
def CreateEventW(lpEventAttributes: SECURITY_ATTRIBUTES | t.CPtr, bManualReset: BOOL, bInitialState: BOOL, lpName: LPCWSTR) -> HANDLE | t.State: pass
def OpenEventA(dwDesiredAccess: ULONG, bInheritHandle: BOOL, lpName: LPCSTR) -> HANDLE | t.State: pass
def OpenEventW(dwDesiredAccess: ULONG, bInheritHandle: BOOL, lpName: LPCWSTR) -> HANDLE | t.State: pass
def SetEvent(hEvent: HANDLE) -> BOOL | t.State: pass
def ResetEvent(hEvent: HANDLE) -> BOOL | t.State: pass
def PulseEvent(hEvent: HANDLE) -> BOOL | t.State: pass
def CreateSemaphoreA(lpSemaphoreAttributes: SECURITY_ATTRIBUTES | t.CPtr, lInitialCount: LONG, lMaximumCount: LONG, lpName: LPCSTR) -> HANDLE | t.State: pass
def CreateSemaphoreW(lpSemaphoreAttributes: SECURITY_ATTRIBUTES | t.CPtr, lInitialCount: LONG, lMaximumCount: LONG, lpName: LPCWSTR) -> HANDLE | t.State: pass
def OpenSemaphoreA(dwDesiredAccess: ULONG, bInheritHandle: BOOL, lpName: LPCSTR) -> HANDLE | t.State: pass
def OpenSemaphoreW(dwDesiredAccess: ULONG, bInheritHandle: BOOL, lpName: LPCWSTR) -> HANDLE | t.State: pass
def ReleaseSemaphore(hSemaphore: HANDLE, lReleaseCount: LONG, lpPreviousCount: LONG | t.CPtr) -> BOOL | t.State: pass
def WaitForSingleObject(hHandle: HANDLE, dwMilliseconds: ULONG) -> ULONG | t.State: pass
def WaitForSingleObjectEx(hHandle: HANDLE, dwMilliseconds: ULONG, bAlertable: BOOL) -> ULONG | t.State: pass
def WaitForMultipleObjects(nCount: ULONG, lpHandles: VOIDPTR, bWaitAll: BOOL, dwMilliseconds: ULONG) -> ULONG | t.State: pass
def WaitForMultipleObjectsEx(nCount: ULONG, lpHandles: VOIDPTR, bWaitAll: BOOL, dwMilliseconds: ULONG, bAlertable: BOOL) -> ULONG | t.State: pass
def InitializeSRWLock(SRWLock: VOIDPTR) -> VOID | t.State: pass
def AcquireSRWLockExclusive(SRWLock: VOIDPTR) -> VOID | t.State: pass
def AcquireSRWLockShared(SRWLock: VOIDPTR) -> VOID | t.State: pass
def ReleaseSRWLockExclusive(SRWLock: VOIDPTR) -> VOID | t.State: pass
def ReleaseSRWLockShared(SRWLock: VOIDPTR) -> VOID | t.State: pass

View File

@@ -0,0 +1,67 @@
"""
Auto-generated Python stub file from stdint.py
Module: stdint
"""
import c
import t
INT: t.CTypedef = t.CInt
INTPTR: t.CTypedef = t.CInt | t.CPtr
BOOL: t.CTypedef = t.CInt
UINT: t.CTypedef = t.CUnsignedInt
UINTPTR: t.CTypedef = UINT | t.CPtr
BYTE: t.CTypedef = t.CUnsignedChar
BYTEPTR: t.CTypedef = BYTE | t.CPtr
WORD: t.CTypedef = t.CUInt16T
DWORD: t.CTypedef = t.CUInt32T
QWORD: t.CTypedef = t.CUInt64T
TCHAR: t.CTypedef = t.CChar
CHARLIST: t.CTypedef = str | t.CPtr
VOID: t.CTypedef = t.CVoid
SHORT: t.CTypedef = t.CShort
SHORTPTR: t.CTypedef = t.CShort | t.CPtr
USHORT: t.CTypedef = t.CUnsignedShort
USHORTPTR: t.CTypedef = t.CUnsignedShort | t.CPtr
LONGLONG: t.CTypedef = t.CLong | t.CLong
ULONGLONG: t.CTypedef = t.CUnsignedLong | t.CLong
LONG: t.CTypedef = t.CLong
ULONG: t.CTypedef = t.CUnsignedLong
WCHAR: t.CTypedef = WORD
WCHARPTR: t.CTypedef = WORD | t.CPtr
CHARPTR: t.CTypedef = t.CChar | t.CPtr
FSIZE_t: t.CTypedef = DWORD
LBA_t: t.CTypedef = DWORD
UINTPTR: t.CTypedef = t.CUnsignedInt | t.CPtr
VOIDPTR: t.CTypedef = t.CVoid | t.CPtr
FLOAT: t.CTypedef = t.CFloat
DOUBLE: t.CTypedef = t.CDouble
FLOAT8: t.CTypedef = t.CFloat8T
FLOAT16: t.CTypedef = t.CFloat16T
FLOAT32: t.CTypedef = t.CFloat32T
FLOAT64: t.CTypedef = t.CFloat64T
FLOAT128: t.CTypedef = t.CFloat128T
INT8: t.CTypedef = t.CInt8T
INT16: t.CTypedef = t.CInt16T
INT32: t.CTypedef = t.CInt32T
INT64: t.CTypedef = t.CInt64T
UINT8: t.CTypedef = t.CUInt8T
UINT16: t.CTypedef = t.CUInt16T
UINT32: t.CTypedef = t.CUInt32T
UINT64: t.CTypedef = t.CUInt64T
INT8PTR: t.CTypedef = t.CInt8T | t.CPtr
INT16PTR: t.CTypedef = t.CInt16T | t.CPtr
INT32PTR: t.CTypedef = t.CInt32T | t.CPtr
INT64PTR: t.CTypedef = t.CInt64T | t.CPtr
UINT8PTR: t.CTypedef = t.CUInt8T | t.CPtr
UINT16PTR: t.CTypedef = t.CUInt16T | t.CPtr
UINT32PTR: t.CTypedef = t.CUInt32T | t.CPtr
UINT64PTR: t.CTypedef = t.CUInt64T | t.CPtr
CHAR8: t.CTypedef = t.CChar8T
CHAR16: t.CTypedef = t.CChar16T
CHAR32: t.CTypedef = t.CChar32T
CHAR8PTR: t.CTypedef = t.CChar8T | t.CPtr
CHAR16PTR: t.CTypedef = t.CChar16T | t.CPtr
CHAR32PTR: t.CTypedef = t.CChar32T | t.CPtr

View File

@@ -0,0 +1,98 @@
"""
Auto-generated Python stub file from w32.win32base.py
Module: w32.win32base
"""
import c
import t
from stdint import *
HANDLE: t.CTypedef = VOIDPTR
LPCSTR: t.CTypedef = t.CConst | t.CChar | t.CPtr
LPCWSTR: t.CTypedef = t.CConst | t.CUnsignedShort | t.CPtr
INVALID_HANDLE_VALUE: t.CDefine = t.CVoid(-1)
NULL: t.CDefine = 0
TRUE: t.CDefine = 1
FALSE: t.CDefine = 0
INFINITE: t.CDefine = 0xFFFFFFFF
WAIT_FAILED: t.CDefine = 0xFFFFFFFF
WAIT_OBJECT_0: t.CDefine = 0
WAIT_TIMEOUT: t.CDefine = 258
WAIT_ABANDONED: t.CDefine = 0x80
MAX_PATH: t.CDefine = 260
ERROR_SUCCESS: t.CDefine = 0
ERROR_FILE_NOT_FOUND: t.CDefine = 2
ERROR_ACCESS_DENIED: t.CDefine = 5
ERROR_INSUFFICIENT_BUFFER: t.CDefine = 122
class SECURITY_ATTRIBUTES:
nLength: ULONG
lpSecurityDescriptor: VOIDPTR
bInheritHandle: BOOL
class OVERLAPPED:
Internal: ULONGLONG
InternalHigh: ULONGLONG
Offset: ULONG
OffsetHigh: ULONG
hEvent: HANDLE
class FILETIME:
dwLowDateTime: DWORD
dwHighDateTime: DWORD
class SYSTEMTIME:
wYear: WORD
wMonth: WORD
wDayOfWeek: WORD
wDay: WORD
wHour: WORD
wMinute: WORD
wSecond: WORD
wMilliseconds: WORD
class GUID:
Data1: DWORD
Data2: WORD
Data3: WORD
Data4: BYTEPTR
class LARGE_INTEGER:
QuadPart: LONGLONG
class ULARGE_INTEGER:
QuadPart: ULONGLONG
def GetLastError() -> ULONG | t.State: pass
def SetLastError(dwErrCode: ULONG) -> t.State: pass
def CloseHandle(hObject: HANDLE) -> BOOL | t.State: pass
def GetProcAddress(hModule: HANDLE, lpProcName: LPCSTR) -> VOIDPTR | t.State: pass
def GetModuleHandleA(lpModuleName: LPCSTR) -> HANDLE | t.State: pass
def GetModuleHandleW(lpModuleName: LPCWSTR) -> HANDLE | t.State: pass
def LoadLibraryA(lpLibFileName: LPCSTR) -> HANDLE | t.State: pass
def LoadLibraryW(lpLibFileName: LPCWSTR) -> HANDLE | t.State: pass
def FreeLibrary(hLibModule: HANDLE) -> BOOL | t.State: pass
def GetSystemTime(lpSystemTime: SYSTEMTIME | t.CPtr) -> t.State: pass
def GetLocalTime(lpSystemTime: SYSTEMTIME | t.CPtr) -> t.State: pass
def FileTimeToSystemTime(lpFileTime: FILETIME | t.CPtr, lpSystemTime: SYSTEMTIME | t.CPtr) -> BOOL | t.State: pass
def SystemTimeToFileTime(lpSystemTime: SYSTEMTIME | t.CPtr, lpFileTime: FILETIME | t.CPtr) -> BOOL | t.State: pass
def QueryPerformanceCounter(lpPerformanceCount: LARGE_INTEGER | t.CPtr) -> BOOL | t.State: pass
def QueryPerformanceFrequency(lpFrequency: LARGE_INTEGER | t.CPtr) -> BOOL | t.State: pass
def Sleep(dwMilliseconds: ULONG) -> t.State: pass
def SleepEx(dwMilliseconds: ULONG, bAlertable: BOOL) -> ULONG | t.State: pass
def GetTickCount() -> ULONG | t.State: pass
def GetTickCount64() -> ULONGLONG | t.State: pass

View File

@@ -0,0 +1,50 @@
"""
Auto-generated Python stub file from mpool.py
Module: mpool
"""
import t, c
from stdint import *
import viperio
import string
MPOOL_ALIGN: t.CDefine = 8
MPOOL_TYPE_SLAB: t.CDefine = 0
MPOOL_TYPE_BUMP: t.CDefine = 2
def _align_up(val: t.CSizeT, align: t.CSizeT) -> t.CSizeT: pass
class MPool:
mtype: t.CInt
mem: t.CVoid | t.CPtr
mem_size: t.CSizeT
offset: t.CSizeT
high_water: t.CSizeT
block_size: t.CSizeT
block_count: t.CSizeT
used_count: t.CSizeT
free_list: t.CVoid | t.CPtr
alloc_map: t.CUInt8T | t.CPtr
alloc_map_size: t.CSizeT
def __init__(self: MPool, mem: t.CVoid | t.CPtr, mem_size: t.CSizeT, block_size: t.CSizeT) -> t.CInt: pass
def _init_bump(self: MPool, mem: t.CVoid | t.CPtr, mem_size: t.CSizeT) -> t.CInt: pass
def _init_slab(self: MPool, mem: t.CVoid | t.CPtr, mem_size: t.CSizeT, block_size: t.CSizeT) -> t.CInt: pass
def __enter__(self: MPool) -> 'MPool' | t.CPtr: pass
def __exit__(self: MPool) -> t.CInt: pass
def _slab_reset(self: MPool) -> t.CInt: pass
def alloc(self: MPool, size: t.CSizeT) -> t.CVoid | t.CPtr: pass
def alloc_buf(self: MPool, capacity: t.CSizeT) -> viperio.Buf | t.CPtr: pass
def free(self: MPool, ptr: t.CVoid | t.CPtr) -> t.CInt: pass
def realloc(self: MPool, ptr: t.CVoid | t.CPtr, old_size: t.CSizeT, new_size: t.CSizeT) -> t.CVoid | t.CPtr: pass
def reset(self: MPool) -> t.CInt: pass
def _bump_alloc(self: MPool, size: t.CSizeT) -> t.CVoid | t.CPtr: pass
def _slab_alloc(self: MPool) -> t.CVoid | t.CPtr: pass
def _slab_free(self: MPool, ptr: t.CVoid | t.CPtr) -> t.CInt: pass
def bump_create(mem: t.CVoid | t.CPtr, mem_size: t.CSizeT) -> MPool | t.CPtr: pass
def alloc(pool: MPool | t.CPtr, size: t.CSizeT) -> t.CVoid | t.CPtr: pass
def reset(pool: MPool | t.CPtr) -> t.CInt: pass

View File

@@ -0,0 +1,44 @@
"""
Auto-generated Python stub file from string.py
Module: string
"""
from stdint import *
import t, c
def strcpy(dest: str, src: str) -> str: pass
def strncpy(dest: str, src: str, n: t.CSizeT) -> str: pass
def strlen(src: str) -> t.CSizeT | t.CExport: pass
def strcmp(str1: str, str2: str) -> t.CInt: pass
def samestr(str1: str, str2: str) -> bool: pass
def strncmp(str1: str, str2: str, n: t.CSizeT) -> t.CInt: pass
def memcmp(ptr1: t.CVoid | t.CPtr, ptr2: t.CVoid | t.CPtr, n: t.CSizeT) -> t.CInt: pass
def strchr(s: str, cr: t.CInt) -> str: pass
def strrchr(s: str, cr: t.CInt) -> str: pass
def strspn(s: str, skip: str) -> int: pass
def memset(ptr: t.CVoid | t.CPtr, value: t.CInt, num: t.CSizeT) -> t.CVoid | t.CPtr | t.CExport: pass
def memset32(ptr: t.CVoid | t.CPtr, value: t.CUInt32T, count: t.CSizeT) -> t.CVoid | t.CPtr: pass
def memcpy(dest: t.CVoid | t.CPtr, src: t.CVoid | t.CPtr, num: t.CSizeT) -> t.CVoid | t.CPtr | t.CExport: pass
def memmove(dest: t.CVoid | t.CPtr, src: t.CVoid | t.CPtr, num: t.CSizeT) -> t.CVoid | t.CPtr: pass
def atoi(src: str) -> t.CInt: pass
def atoll(src: str) -> t.CInt64T: pass
def atof(src: str) -> t.CDouble: pass
def split(s: str, delim: str, result: list[str]) -> int: pass

View File

@@ -0,0 +1,91 @@
"""
Auto-generated Python stub file from w32.win32memory.py
Module: w32.win32memory
"""
import c
import t
from stdint import *
from w32.win32base import *
MEM_COMMIT: t.CDefine = 0x00001000
MEM_RESERVE: t.CDefine = 0x00002000
MEM_DECOMMIT: t.CDefine = 0x00004000
MEM_RELEASE: t.CDefine = 0x00008000
MEM_FREE: t.CDefine = 0x00010000
MEM_RESET: t.CDefine = 0x00080000
MEM_TOP_DOWN: t.CDefine = 0x00100000
MEM_WRITE_WATCH: t.CDefine = 0x00200000
MEM_PHYSICAL: t.CDefine = 0x00400000
MEM_LARGE_PAGES: t.CDefine = 0x20000000
PAGE_NOACCESS: t.CDefine = 0x01
PAGE_READONLY: t.CDefine = 0x02
PAGE_READWRITE: t.CDefine = 0x04
PAGE_WRITECOPY: t.CDefine = 0x08
PAGE_EXECUTE: t.CDefine = 0x10
PAGE_EXECUTE_READ: t.CDefine = 0x20
PAGE_EXECUTE_READWRITE: t.CDefine = 0x40
PAGE_EXECUTE_WRITECOPY: t.CDefine = 0x80
PAGE_GUARD: t.CDefine = 0x100
PAGE_NOCACHE: t.CDefine = 0x200
PAGE_WRITECOMBINE: t.CDefine = 0x400
HEAP_NO_SERIALIZE: t.CDefine = 0x00000001
HEAP_GROWABLE: t.CDefine = 0x00000002
HEAP_GENERATE_EXCEPTIONS: t.CDefine = 0x00000004
HEAP_ZERO_MEMORY: t.CDefine = 0x00000008
HEAP_REALLOC_IN_PLACE_ONLY: t.CDefine = 0x00000010
class MEMORY_BASIC_INFORMATION:
BaseAddress: VOIDPTR
AllocationBase: VOIDPTR
AllocationProtect: ULONG
RegionSize: t.CSizeT
State: ULONG
Protect: ULONG
Type: ULONG
def VirtualAlloc(lpAddress: VOIDPTR, dwSize: t.CSizeT, flAllocationType: ULONG, flProtect: ULONG) -> VOIDPTR | t.State: pass
def VirtualFree(lpAddress: VOIDPTR, dwSize: t.CSizeT, dwFreeType: ULONG) -> BOOL | t.State: pass
def VirtualProtect(lpAddress: VOIDPTR, dwSize: t.CSizeT, flNewProtect: ULONG, lpflOldProtect: ULONG | t.CPtr) -> BOOL | t.State: pass
def VirtualQuery(lpAddress: t.CConst | VOIDPTR, lpBuffer: MEMORY_BASIC_INFORMATION | t.CPtr, dwLength: t.CSizeT) -> t.CSizeT | t.State: pass
def VirtualLock(lpAddress: VOIDPTR, dwSize: t.CSizeT) -> BOOL | t.State: pass
def VirtualUnlock(lpAddress: VOIDPTR, dwSize: t.CSizeT) -> BOOL | t.State: pass
def GetProcessHeap() -> HANDLE | t.State: pass
def HeapCreate(flOptions: ULONG, dwInitialSize: t.CSizeT, dwMaximumSize: t.CSizeT) -> HANDLE | t.State: pass
def HeapDestroy(hHeap: HANDLE) -> BOOL | t.State: pass
def HeapAlloc(hHeap: HANDLE, dwFlags: ULONG, dwBytes: t.CSizeT) -> VOIDPTR | t.State: pass
def HeapReAlloc(hHeap: HANDLE, dwFlags: ULONG, lpMem: VOIDPTR, dwBytes: t.CSizeT) -> VOIDPTR | t.State: pass
def HeapFree(hHeap: HANDLE, dwFlags: ULONG, lpMem: VOIDPTR) -> BOOL | t.State: pass
def HeapSize(hHeap: HANDLE, dwFlags: ULONG, lpMem: t.CConst | VOIDPTR) -> t.CSizeT | t.State: pass
def HeapValidate(hHeap: HANDLE, dwFlags: ULONG, lpMem: t.CConst | VOIDPTR) -> BOOL | t.State: pass
def HeapCompact(hHeap: HANDLE, dwFlags: ULONG) -> t.CSizeT | t.State: pass
def GlobalAlloc(uFlags: UINT, dwBytes: t.CSizeT) -> VOIDPTR | t.State: pass
def GlobalFree(hMem: VOIDPTR) -> VOIDPTR | t.State: pass
def GlobalLock(hMem: VOIDPTR) -> VOIDPTR | t.State: pass
def GlobalUnlock(hMem: VOIDPTR) -> BOOL | t.State: pass
def GlobalSize(hMem: VOIDPTR) -> t.CSizeT | t.State: pass
def LocalAlloc(uFlags: UINT, dwBytes: t.CSizeT) -> VOIDPTR | t.State: pass
def LocalFree(hMem: VOIDPTR) -> VOIDPTR | t.State: pass

View File

@@ -0,0 +1,28 @@
"""
Auto-generated Python stub file from stdio.py
Module: stdio
"""
import t, c
def printf(fmt: t.CChar | t.CConst | t.CPtr, *args) -> t.CInt | t.CExtern | t.CExport: pass
def fprintf(stream: t.CVoid | t.CPtr, fmt: t.CChar | t.CConst | t.CPtr, *args) -> t.CInt | t.CExtern | t.CExport: pass
def sprintf(buf: t.CChar | t.CPtr, fmt: t.CChar | t.CConst | t.CPtr, *args) -> t.CInt | t.CExtern | t.CExport: pass
def snprintf(buf: t.CChar | t.CPtr, size: t.CSizeT, fmt: t.CChar | t.CConst | t.CPtr, *args) -> t.CInt | t.CExtern | t.CExport: pass
def puts(s: t.CChar | t.CConst | t.CPtr) -> t.CInt | t.CExtern | t.CExport: pass
def fputs(s: t.CChar | t.CConst | t.CPtr, stream: t.CVoid | t.CPtr) -> t.CInt | t.CExtern | t.CExport: pass
def fgets(buf: t.CChar | t.CPtr, size: t.CInt, stream: t.CVoid | t.CPtr) -> t.CChar | t.CPtr | t.CExtern | t.CExport: pass
def fflush(stream: t.CVoid | t.CPtr) -> t.CInt | t.CExtern | t.CExport: pass
stdin: t.CExtern | t.CVoid | t.CPtr
stdout: t.CExtern | t.CVoid | t.CPtr
stderr: t.CExtern | t.CVoid | t.CPtr

View File

@@ -0,0 +1,71 @@
"""
Auto-generated Python stub file from json.__init__.py
Module: json.__init__
"""
import t, c
from stdint import *
import mpool
import string
import viperio
JSON_NULL: t.CDefine = 0
JSON_BOOL: t.CDefine = 1
JSON_INT: t.CDefine = 2
JSON_FLOAT: t.CDefine = 3
JSON_STRING: t.CDefine = 4
JSON_ARRAY: t.CDefine = 5
JSON_OBJECT: t.CDefine = 6
class JsonValue:
vtype: t.CInt
bool_val: t.CInt
int_val: t.CInt64T
float_val: t.CDouble
str_val: t.CChar | t.CPtr
next: JsonValue | t.CPtr
key: t.CChar | t.CPtr
child: JsonValue | t.CPtr
child_count: t.CSizeT
def __new__(self: JsonValue, pool: mpool.MPool | t.CPtr) -> t.CInt: pass
def type(self: JsonValue) -> t.CInt: pass
def is_null(self: JsonValue) -> bool: pass
def is_bool(self: JsonValue) -> bool: pass
def is_int(self: JsonValue) -> bool: pass
def is_float(self: JsonValue) -> bool: pass
def is_string(self: JsonValue) -> bool: pass
def is_array(self: JsonValue) -> bool: pass
def is_object(self: JsonValue) -> bool: pass
def as_bool(self: JsonValue) -> bool: pass
def as_int(self: JsonValue) -> t.CInt64T: pass
def as_float(self: JsonValue) -> t.CDouble: pass
def as_string(self: JsonValue) -> t.CChar | t.CPtr: pass
def __len__(self: JsonValue) -> t.CSizeT: pass
def __getitem__(self: JsonValue, key: t.CChar | t.CPtr) -> JsonValue | t.CPtr: pass
def __setitem__(self: JsonValue, key: t.CChar | t.CPtr, val: JsonValue | t.CPtr) -> t.CInt: pass
def get_item(self: JsonValue, index: t.CSizeT) -> JsonValue | t.CPtr: pass
def _pool_alloc(self: JsonValue, size: t.CSizeT) -> t.CChar | t.CPtr: pass
def _append_child(self: JsonValue, child: JsonValue | t.CPtr) -> t.CInt: pass
def null(pool: mpool.MPool | t.CPtr) -> JsonValue | t.CPtr: pass
def bool_val(pool: mpool.MPool | t.CPtr, val: bool) -> JsonValue | t.CPtr: pass
def int_val(pool: mpool.MPool | t.CPtr, val: t.CInt64T) -> JsonValue | t.CPtr: pass
def float_val(pool: mpool.MPool | t.CPtr, val: t.CDouble) -> JsonValue | t.CPtr: pass
def string_val(pool: mpool.MPool | t.CPtr, val: t.CChar | t.CPtr) -> JsonValue | t.CPtr: pass
def array(pool: mpool.MPool | t.CPtr) -> JsonValue | t.CPtr: pass
def object(pool: mpool.MPool | t.CPtr) -> JsonValue | t.CPtr: pass
def array_append(pool: mpool.MPool | t.CPtr, arr: JsonValue | t.CPtr, item: JsonValue | t.CPtr) -> t.CInt: pass
def object_set(pool: mpool.MPool | t.CPtr, obj: JsonValue | t.CPtr, key: t.CChar | t.CPtr, val: JsonValue | t.CPtr) -> t.CInt: pass
from .__parser import parse
from .__writer import write

View File

@@ -0,0 +1,11 @@
1dd5985fb89f7ef9:main.py
56cdd754a8a09347:includes/stdint.py
5a6a2137958c28c5:includes/w32\win32base.py
68c4fe4b12c908e3:includes/mpool.py
6aee24fdefa3cbc0:includes/string.py
72e2d5ccb7cedcf1:includes/w32\win32memory.py
73edbcf76e32d00b:includes/stdio.py
8ee3170049c70333:includes/json\__init__.py
bd2e7db1744476fe:includes/json\__parser.py
c9f4be41ca1cc2b4:includes/viperio.py
eaf7a981f0ef5b22:includes/json\__writer.py

View File

@@ -0,0 +1,179 @@
"""
Auto-generated Python stub file from w32.win32file.py
Module: w32.win32file
"""
import c
import t
from stdint import *
from w32.win32base import *
GENERIC_READ: t.CDefine = 0x80000000
GENERIC_WRITE: t.CDefine = 0x40000000
GENERIC_EXECUTE: t.CDefine = 0x20000000
GENERIC_ALL: t.CDefine = 0x10000000
FILE_SHARE_READ: t.CDefine = 0x00000001
FILE_SHARE_WRITE: t.CDefine = 0x00000002
FILE_SHARE_DELETE: t.CDefine = 0x00000004
CREATE_NEW: t.CDefine = 1
CREATE_ALWAYS: t.CDefine = 2
OPEN_EXISTING: t.CDefine = 3
OPEN_ALWAYS: t.CDefine = 4
TRUNCATE_EXISTING: t.CDefine = 5
FILE_ATTRIBUTE_READONLY: t.CDefine = 0x00000001
FILE_ATTRIBUTE_HIDDEN: t.CDefine = 0x00000002
FILE_ATTRIBUTE_SYSTEM: t.CDefine = 0x00000004
FILE_ATTRIBUTE_DIRECTORY: t.CDefine = 0x00000010
FILE_ATTRIBUTE_ARCHIVE: t.CDefine = 0x00000020
FILE_ATTRIBUTE_NORMAL: t.CDefine = 0x00000080
FILE_ATTRIBUTE_TEMPORARY: t.CDefine = 0x00000100
FILE_ATTRIBUTE_COMPRESSED: t.CDefine = 0x00000800
FILE_ATTRIBUTE_OFFLINE: t.CDefine = 0x00001000
FILE_ATTRIBUTE_ENCRYPTED: t.CDefine = 0x00004000
FILE_FLAG_WRITE_THROUGH: t.CDefine = 0x80000000
FILE_FLAG_OVERLAPPED: t.CDefine = 0x40000000
FILE_FLAG_NO_BUFFERING: t.CDefine = 0x20000000
FILE_FLAG_RANDOM_ACCESS: t.CDefine = 0x10000000
FILE_FLAG_SEQUENTIAL_SCAN: t.CDefine = 0x08000000
FILE_FLAG_DELETE_ON_CLOSE: t.CDefine = 0x04000000
FILE_FLAG_BACKUP_SEMANTICS: t.CDefine = 0x02000000
FILE_FLAG_POSIX_SEMANTICS: t.CDefine = 0x01000000
FILE_BEGIN: t.CDefine = 0
FILE_CURRENT: t.CDefine = 1
FILE_END: t.CDefine = 2
STD_INPUT_HANDLE: t.CDefine = t.CUnsignedLong(-10)
STD_OUTPUT_HANDLE: t.CDefine = t.CUnsignedLong(-11)
STD_ERROR_HANDLE: t.CDefine = t.CUnsignedLong(-12)
MOVEFILE_REPLACE_EXISTING: t.CDefine = 0x00000001
MOVEFILE_COPY_ALLOWED: t.CDefine = 0x00000002
MOVEFILE_WRITE_THROUGH: t.CDefine = 0x00000008
class BY_HANDLE_FILE_INFORMATION:
dwFileAttributes: ULONG
ftCreationTime: FILETIME
ftLastAccessTime: FILETIME
ftLastWriteTime: FILETIME
dwVolumeSerialNumber: ULONG
nFileSizeHigh: ULONG
nFileSizeLow: ULONG
nNumberOfLinks: ULONG
nFileIndexHigh: ULONG
nFileIndexLow: ULONG
class WIN32_FIND_DATAA:
dwFileAttributes: ULONG
ftCreationTime: FILETIME
ftLastAccessTime: FILETIME
ftLastWriteTime: FILETIME
nFileSizeHigh: ULONG
nFileSizeLow: ULONG
dwReserved0: ULONG
dwReserved1: ULONG
cFileName: CHARPTR
cAlternateFileName: CHARPTR
class WIN32_FIND_DATAW:
dwFileAttributes: ULONG
ftCreationTime: FILETIME
ftLastAccessTime: FILETIME
ftLastWriteTime: FILETIME
nFileSizeHigh: ULONG
nFileSizeLow: ULONG
dwReserved0: ULONG
dwReserved1: ULONG
cFileName: WCHARPTR
cAlternateFileName: WCHARPTR
def CreateFileA(lpFileName: LPCSTR, dwDesiredAccess: ULONG, dwShareMode: ULONG, lpSecurityAttributes: SECURITY_ATTRIBUTES | t.CPtr, dwCreationDisposition: ULONG, dwFlagsAndAttributes: ULONG, hTemplateFile: HANDLE) -> HANDLE | t.State: pass
def CreateFileW(lpFileName: LPCWSTR, dwDesiredAccess: ULONG, dwShareMode: ULONG, lpSecurityAttributes: SECURITY_ATTRIBUTES | t.CPtr, dwCreationDisposition: ULONG, dwFlagsAndAttributes: ULONG, hTemplateFile: HANDLE) -> HANDLE | t.State: pass
def ReadFile(hFile: HANDLE, lpBuffer: VOIDPTR, nNumberOfBytesToRead: ULONG, lpNumberOfBytesRead: ULONG | t.CPtr, lpOverlapped: OVERLAPPED | t.CPtr) -> BOOL | t.State: pass
def WriteFile(hFile: HANDLE, lpBuffer: t.CConst | VOIDPTR, nNumberOfBytesToWrite: ULONG, lpNumberOfBytesWritten: ULONG | t.CPtr, lpOverlapped: OVERLAPPED | t.CPtr) -> BOOL | t.State: pass
def SetFilePointer(hFile: HANDLE, lDistanceToMove: LONG, lpDistanceToMoveHigh: LONG | t.CPtr, dwMoveMethod: ULONG) -> LONG | t.State: pass
def SetFilePointerEx(hFile: HANDLE, liDistanceToMove: LARGE_INTEGER | t.CPtr, lpNewFilePointer: LARGE_INTEGER | t.CPtr, dwMoveMethod: ULONG) -> BOOL | t.State: pass
def GetFileSize(hFile: HANDLE, lpFileSizeHigh: ULONG | t.CPtr) -> ULONG | t.State: pass
def GetFileSizeEx(hFile: HANDLE, lpFileSize: LARGE_INTEGER | t.CPtr) -> BOOL | t.State: pass
def SetEndOfFile(hFile: HANDLE) -> BOOL | t.State: pass
def FlushFileBuffers(hFile: HANDLE) -> BOOL | t.State: pass
def GetFileType(hFile: HANDLE) -> ULONG | t.State: pass
def GetFileAttributesA(lpFileName: LPCSTR) -> ULONG | t.State: pass
def GetFileAttributesW(lpFileName: LPCWSTR) -> ULONG | t.State: pass
def SetFileAttributesA(lpFileName: LPCSTR, dwFileAttributes: ULONG) -> BOOL | t.State: pass
def SetFileAttributesW(lpFileName: LPCWSTR, dwFileAttributes: ULONG) -> BOOL | t.State: pass
def DeleteFileA(lpFileName: LPCSTR) -> BOOL | t.State: pass
def DeleteFileW(lpFileName: LPCWSTR) -> BOOL | t.State: pass
def MoveFileA(lpExistingFileName: LPCSTR, lpNewFileName: LPCSTR) -> BOOL | t.State: pass
def MoveFileW(lpExistingFileName: LPCWSTR, lpNewFileName: LPCWSTR) -> BOOL | t.State: pass
def MoveFileExA(lpExistingFileName: LPCSTR, lpNewFileName: LPCSTR, dwFlags: ULONG) -> BOOL | t.State: pass
def MoveFileExW(lpExistingFileName: LPCWSTR, lpNewFileName: LPCWSTR, dwFlags: ULONG) -> BOOL | t.State: pass
def CopyFileA(lpExistingFileName: LPCSTR, lpNewFileName: LPCSTR, bFailIfExists: BOOL) -> BOOL | t.State: pass
def CopyFileW(lpExistingFileName: LPCWSTR, lpNewFileName: LPCWSTR, bFailIfExists: BOOL) -> BOOL | t.State: pass
def CreateDirectoryA(lpPathName: LPCSTR, lpSecurityAttributes: SECURITY_ATTRIBUTES | t.CPtr) -> BOOL | t.State: pass
def CreateDirectoryW(lpPathName: LPCWSTR, lpSecurityAttributes: SECURITY_ATTRIBUTES | t.CPtr) -> BOOL | t.State: pass
def RemoveDirectoryA(lpPathName: LPCSTR) -> BOOL | t.State: pass
def RemoveDirectoryW(lpPathName: LPCWSTR) -> BOOL | t.State: pass
def FindFirstFileA(lpFileName: LPCSTR, lpFindFileData: WIN32_FIND_DATAA | t.CPtr) -> HANDLE | t.State: pass
def FindFirstFileW(lpFileName: LPCWSTR, lpFindFileData: WIN32_FIND_DATAW | t.CPtr) -> HANDLE | t.State: pass
def FindNextFileA(hFindFile: HANDLE, lpFindFileData: WIN32_FIND_DATAA | t.CPtr) -> BOOL | t.State: pass
def FindNextFileW(hFindFile: HANDLE, lpFindFileData: WIN32_FIND_DATAW | t.CPtr) -> BOOL | t.State: pass
def FindClose(hFindFile: HANDLE) -> BOOL | t.State: pass
def GetStdHandle(nStdHandle: ULONG) -> HANDLE | t.State: pass
def SetStdHandle(nStdHandle: ULONG, hHandle: HANDLE) -> BOOL | t.State: pass
def GetFileInformationByHandle(hFile: HANDLE, lpFileInformation: BY_HANDLE_FILE_INFORMATION | t.CPtr) -> BOOL | t.State: pass
def LockFile(hFile: HANDLE, dwFileOffsetLow: ULONG, dwFileOffsetHigh: ULONG, nNumberOfBytesToLockLow: ULONG, nNumberOfBytesToLockHigh: ULONG) -> BOOL | t.State: pass
def UnlockFile(hFile: HANDLE, dwFileOffsetLow: ULONG, dwFileOffsetHigh: ULONG, nNumberOfBytesToUnlockLow: ULONG, nNumberOfBytesToUnlockHigh: ULONG) -> BOOL | t.State: pass
def GetTempPathA(nBufferLength: ULONG, lpBuffer: CHARPTR) -> ULONG | t.State: pass
def GetTempPathW(nBufferLength: ULONG, lpBuffer: WCHARPTR) -> ULONG | t.State: pass
def GetTempFileNameA(lpPathName: LPCSTR, lpPrefixString: LPCSTR, uUnique: UINT, lpTempFileName: CHARPTR) -> UINT | t.State: pass
def GetTempFileNameW(lpPathName: LPCWSTR, lpPrefixString: LPCWSTR, uUnique: UINT, lpTempFileName: WCHARPTR) -> UINT | t.State: pass
def GetCurrentDirectoryA(nBufferLength: ULONG, lpBuffer: CHARPTR) -> ULONG | t.State: pass
def GetCurrentDirectoryW(nBufferLength: ULONG, lpBuffer: WCHARPTR) -> ULONG | t.State: pass
def SetCurrentDirectoryA(lpPathName: LPCSTR) -> BOOL | t.State: pass
def SetCurrentDirectoryW(lpPathName: LPCWSTR) -> BOOL | t.State: pass
def GetModuleFileNameA(hModule: HANDLE, lpFilename: CHARPTR, nSize: ULONG) -> ULONG | t.State: pass
def GetModuleFileNameW(hModule: HANDLE, lpFilename: WCHARPTR, nSize: ULONG) -> ULONG | t.State: pass

View File

@@ -0,0 +1,138 @@
"""
Auto-generated Python stub file from w32.win32console.py
Module: w32.win32console
"""
import c
import t
from stdint import *
from w32.win32base import *
ENABLE_PROCESSED_INPUT: t.CDefine = 0x0001
ENABLE_LINE_INPUT: t.CDefine = 0x0002
ENABLE_ECHO_INPUT: t.CDefine = 0x0004
ENABLE_WINDOW_INPUT: t.CDefine = 0x0008
ENABLE_MOUSE_INPUT: t.CDefine = 0x0010
ENABLE_INSERT_MODE: t.CDefine = 0x0020
ENABLE_QUICK_EDIT_MODE: t.CDefine = 0x0040
ENABLE_EXTENDED_FLAGS: t.CDefine = 0x0080
ENABLE_PROCESSED_OUTPUT: t.CDefine = 0x0001
ENABLE_WRAP_AT_EOL_OUTPUT: t.CDefine = 0x0002
ENABLE_VIRTUAL_TERMINAL_PROCESSING: t.CDefine = 0x0004
DISABLE_NEWLINE_AUTO_RETURN: t.CDefine = 0x0008
ENABLE_LVB_GRID_WORLDWIDE: t.CDefine = 0x0010
FOREGROUND_BLUE: t.CDefine = 0x0001
FOREGROUND_GREEN: t.CDefine = 0x0002
FOREGROUND_RED: t.CDefine = 0x0004
FOREGROUND_INTENSITY: t.CDefine = 0x0008
BACKGROUND_BLUE: t.CDefine = 0x0010
BACKGROUND_GREEN: t.CDefine = 0x0020
BACKGROUND_RED: t.CDefine = 0x0040
BACKGROUND_INTENSITY: t.CDefine = 0x0080
KEY_EVENT: t.CDefine = 0x0001
MOUSE_EVENT: t.CDefine = 0x0002
WINDOW_BUFFER_SIZE_EVENT: t.CDefine = 0x0004
MENU_EVENT: t.CDefine = 0x0008
FOCUS_EVENT: t.CDefine = 0x0010
class COORD:
X: SHORT
Y: SHORT
class SMALL_RECT:
Left: SHORT
Top: SHORT
Right: SHORT
Bottom: SHORT
class CONSOLE_SCREEN_BUFFER_INFO:
dwSize: COORD
dwCursorPosition: COORD
wAttributes: WORD
srWindow: SMALL_RECT
dwMaximumWindowSize: COORD
class CONSOLE_CURSOR_INFO:
dwSize: ULONG
bVisible: BOOL
class CHAR_INFO:
UnicodeChar: WCHAR
Attributes: WORD
class KEY_EVENT_RECORD:
bKeyDown: BOOL
wRepeatCount: WORD
wVirtualKeyCode: WORD
wVirtualScanCode: WORD
uChar: WCHAR
dwControlKeyState: ULONG
class MOUSE_EVENT_RECORD:
dwMousePosition: COORD
dwButtonState: ULONG
dwControlKeyState: ULONG
dwEventFlags: ULONG
class WINDOW_BUFFER_SIZE_RECORD:
dwSize: COORD
class INPUT_RECORD:
EventType: WORD
Event: KEY_EVENT_RECORD
def SetConsoleOutputCP(codepage: UINT) -> BOOL | t.State: pass
def SetConsoleCP(codepage: UINT) -> BOOL | t.State: pass
def GetConsoleCP() -> UINT | t.State: pass
def GetConsoleOutputCP() -> UINT | t.State: pass
def GetConsoleScreenBufferInfo(hConsoleOutput: HANDLE, lpConsoleScreenBufferInfo: CONSOLE_SCREEN_BUFFER_INFO | t.CPtr) -> BOOL | t.State: pass
def SetConsoleScreenBufferSize(hConsoleOutput: HANDLE, dwSize: COORD) -> BOOL | t.State: pass
def SetConsoleCursorPosition(hConsoleOutput: HANDLE, dwCursorPosition: COORD) -> BOOL | t.State: pass
def GetConsoleCursorInfo(hConsoleOutput: HANDLE, lpConsoleCursorInfo: CONSOLE_CURSOR_INFO | t.CPtr) -> BOOL | t.State: pass
def SetConsoleCursorInfo(hConsoleOutput: HANDLE, lpConsoleCursorInfo: CONSOLE_CURSOR_INFO | t.CPtr) -> BOOL | t.State: pass
def SetConsoleTextAttribute(hConsoleOutput: HANDLE, wAttributes: WORD) -> BOOL | t.State: pass
def FillConsoleOutputCharacterA(hConsoleOutput: HANDLE, cCharacter: t.CChar, nLength: ULONG, dwWriteCoord: COORD, lpNumberOfCharsWritten: ULONG | t.CPtr) -> BOOL | t.State: pass
def FillConsoleOutputCharacterW(hConsoleOutput: HANDLE, cCharacter: WCHAR, nLength: ULONG, dwWriteCoord: COORD, lpNumberOfCharsWritten: ULONG | t.CPtr) -> BOOL | t.State: pass
def FillConsoleOutputAttribute(hConsoleOutput: HANDLE, wAttribute: WORD, nLength: ULONG, dwWriteCoord: COORD, lpNumberOfAttrsWritten: ULONG | t.CPtr) -> BOOL | t.State: pass
def WriteConsoleA(hConsoleOutput: HANDLE, lpBuffer: t.CConst | VOIDPTR, nNumberOfCharsToWrite: ULONG, lpNumberOfCharsWritten: ULONG | t.CPtr, lpReserved: VOIDPTR) -> BOOL | t.State: pass
def WriteConsoleW(hConsoleOutput: HANDLE, lpBuffer: t.CConst | VOIDPTR, nNumberOfCharsToWrite: ULONG, lpNumberOfCharsWritten: ULONG | t.CPtr, lpReserved: VOIDPTR) -> BOOL | t.State: pass
def ReadConsoleA(hConsoleInput: HANDLE, lpBuffer: VOIDPTR, nNumberOfCharsToRead: ULONG, lpNumberOfCharsRead: ULONG | t.CPtr, pInputControl: VOIDPTR) -> BOOL | t.State: pass
def ReadConsoleW(hConsoleInput: HANDLE, lpBuffer: VOIDPTR, nNumberOfCharsToRead: ULONG, lpNumberOfCharsRead: ULONG | t.CPtr, pInputControl: VOIDPTR) -> BOOL | t.State: pass
def GetConsoleMode(hConsoleHandle: HANDLE, lpMode: ULONG | t.CPtr) -> BOOL | t.State: pass
def SetConsoleMode(hConsoleHandle: HANDLE, dwMode: ULONG) -> BOOL | t.State: pass
def ReadConsoleInputA(hConsoleInput: HANDLE, lpBuffer: INPUT_RECORD | t.CPtr, nLength: ULONG, lpNumberOfEventsRead: ULONG | t.CPtr) -> BOOL | t.State: pass
def ReadConsoleInputW(hConsoleInput: HANDLE, lpBuffer: INPUT_RECORD | t.CPtr, nLength: ULONG, lpNumberOfEventsRead: ULONG | t.CPtr) -> BOOL | t.State: pass
def GetNumberOfConsoleInputEvents(hConsoleInput: HANDLE, lpNumberOfEvents: ULONG | t.CPtr) -> BOOL | t.State: pass
def FlushConsoleInputBuffer(hConsoleInput: HANDLE) -> BOOL | t.State: pass
def SetConsoleTitleA(lpConsoleTitle: LPCSTR) -> BOOL | t.State: pass
def SetConsoleTitleW(lpConsoleTitle: LPCWSTR) -> BOOL | t.State: pass
def GetConsoleTitleA(lpConsoleTitle: CHARPTR, nSize: ULONG) -> ULONG | t.State: pass
def GetConsoleTitleW(lpConsoleTitle: WCHARPTR, nSize: ULONG) -> ULONG | t.State: pass
def AllocConsole() -> BOOL | t.State: pass
def FreeConsole() -> BOOL | t.State: pass
def SetConsoleWindowInfo(hConsoleOutput: HANDLE, bAbsolute: BOOL, lpConsoleWindow: SMALL_RECT | t.CPtr) -> BOOL | t.State: pass
def ScrollConsoleScreenBufferA(hConsoleOutput: HANDLE, lpScrollRectangle: SMALL_RECT | t.CPtr, lpClipRectangle: SMALL_RECT | t.CPtr, dwDestinationOrigin: COORD, lpFill: CHAR_INFO | t.CPtr) -> BOOL | t.State: pass

View File

@@ -0,0 +1,38 @@
"""
Auto-generated Python stub file from json.__parser.py
Module: json.__parser
"""
import t, c
from stdint import *
import mpool
import string
from . import JsonValue, JSON_NULL, JSON_BOOL, JSON_INT, JSON_FLOAT, JSON_STRING, JSON_ARRAY, JSON_OBJECT, null, bool_val, int_val, float_val, string_val, array, object
class ParseState:
src: t.CChar | t.CPtr
pos: t.CSizeT
len: t.CSizeT
pool: mpool.MPool | t.CPtr
def __init__(self: ParseState, src: t.CChar | t.CPtr, pool: mpool.MPool | t.CPtr) -> t.CInt: pass
def _peek(s: ParseState | t.CPtr) -> t.CChar: pass
def _advance(s: ParseState | t.CPtr) -> t.CChar: pass
def _skip_whitespace(s: ParseState | t.CPtr) -> t.CInt: pass
def _expect(s: ParseState | t.CPtr, ch: t.CChar) -> bool: pass
def _parse_string(s: ParseState | t.CPtr) -> t.CChar | t.CPtr: pass
def _parse_number(s: ParseState | t.CPtr) -> JsonValue | t.CPtr: pass
def _parse_value(s: ParseState | t.CPtr) -> JsonValue | t.CPtr: pass
def _parse_array(s: ParseState | t.CPtr) -> JsonValue | t.CPtr: pass
def _parse_object(s: ParseState | t.CPtr) -> JsonValue | t.CPtr: pass
def parse(pool: mpool.MPool | t.CPtr, src: t.CChar | t.CPtr) -> JsonValue | t.CPtr: pass

View File

@@ -0,0 +1,22 @@
"""
Auto-generated Python stub file from viperio.py
Module: viperio
"""
import t, c
from stdint import *
class Buf:
data: t.CChar | t.CPtr
length: t.CSizeT
capacity: t.CSizeT
owned: bool
def __init__(self: Buf, data: t.CChar | t.CPtr, capacity: t.CSizeT, length: t.CSizeT, owned: bool) -> t.CInt: pass
def clear(self: Buf) -> t.CInt: pass
def write(self: Buf, src: t.CChar | t.CPtr, count: t.CSizeT) -> t.CSizeT: pass
def cstr(self: Buf) -> t.CChar | t.CPtr: pass
def reset(self: Buf) -> t.CInt: pass
def __enter__(self: Buf) -> 'Buf' | t.CPtr: pass
def __exit__(self: Buf) -> t.CInt: pass
def free(self: Buf) -> t.CInt: pass

View File

@@ -0,0 +1,22 @@
"""
Auto-generated Python stub file from json.__writer.py
Module: json.__writer
"""
import t, c
from stdint import *
import mpool
import string
from stdio import snprintf
from . import JsonValue, JSON_NULL, JSON_BOOL, JSON_INT, JSON_FLOAT, JSON_STRING, JSON_ARRAY, JSON_OBJECT
def _write_char(buf: t.CChar | t.CPtr, pos: t.CSizeT, ch: t.CChar) -> t.CSizeT: pass
def _write_str(buf: t.CChar | t.CPtr, pos: t.CSizeT, s: t.CChar | t.CPtr) -> t.CSizeT: pass
def _write_string_escaped(buf: t.CChar | t.CPtr, pos: t.CSizeT, s: t.CChar | t.CPtr) -> t.CSizeT: pass
def _write_value(buf: t.CChar | t.CPtr, pos: t.CSizeT, val: JsonValue | t.CPtr, pool: mpool.MPool | t.CPtr) -> t.CSizeT: pass
def write(pool: mpool.MPool | t.CPtr, val: JsonValue | t.CPtr, pretty: bool) -> t.CChar | t.CPtr: pass

View File

@@ -0,0 +1,80 @@
"""
Auto-generated Python stub file from w32.fileio.py
Module: w32.fileio
"""
import t, c
from stdint import *
import w32.win32base
import w32.win32file
class MODE(t.CEnum):
R = 0
W = 1
A = 2
RP = 3
WP = 4
AP = 5
X = 6
XP = 7
class FRESULT(t.CEnum):
OK = 0
ERR = -1
ERR_CLOSED = -2
ERR_PERM = -3
ERR_IO = -4
ERR_NOTFOUND = -5
SEEK_SET: t.CDefine = 0
SEEK_CUR: t.CDefine = 1
SEEK_END: t.CDefine = 2
INVALID_SET_FILE_POINTER: t.CDefine = -1
SHARE_READ: t.CDefine = 0x00000001
SHARE_WRITE: t.CDefine = 0x00000002
SHARE_DELETE: t.CDefine = 0x00000004
class File:
handle: w32.win32base.HANDLE
closed: bool
can_read: bool
can_write: bool
is_append: bool
_share_mode: ULONG
def __init__(self: File, filename: str, mode: ULONG, share: ULONG) -> t.CInt: pass
def __enter__(self: File) -> 'File' | t.CPtr: pass
def __exit__(self: File) -> t.CInt: pass
def read(self: File, buf: bytes, count: ULONG) -> LONG: pass
def write(self: File, buf: bytes, count: ULONG) -> LONG: pass
def write_str(self: File, s: str) -> LONG: pass
def seek(self: File, offset: LONG, origin: ULONG) -> LONG: pass
def tell(self: File) -> LONG: pass
def close(self: File) -> LONG: pass
def flush(self: File) -> LONG: pass
def size(self: File) -> LONGLONG: pass
def readline(self: File, buf: bytes, max_count: ULONG) -> LONG: pass
def read_all(self: File, buf: bytes, max_count: ULONG) -> LONG: pass
class FileW:
handle: HANDLE
closed: bool
can_read: bool
can_write: bool
is_append: bool
_share_mode: ULONG
def __init__(self: FileW, filename: LPCWSTR, mode: ULONG, share: ULONG) -> t.CInt: pass
def __enter__(self: FileW) -> 'FileW' | t.CPtr: pass
def __exit__(self: FileW) -> t.CInt: pass
def read(self: FileW, buf: bytes, count: ULONG) -> LONG: pass
def write(self: FileW, buf: bytes, count: ULONG) -> LONG: pass
def write_str(self: FileW, s: str) -> LONG: pass
def seek(self: FileW, offset: LONG, origin: ULONG) -> LONG: pass
def tell(self: FileW) -> LONG: pass
def close(self: FileW) -> LONG: pass
def flush(self: FileW) -> LONG: pass
def size(self: FileW) -> LONGLONG: pass
def readline(self: FileW, buf: bytes, max_count: ULONG) -> LONG: pass
def read_all(self: FileW, buf: bytes, max_count: ULONG) -> LONG: pass
def open(filename: str, mode: ULONG, share: ULONG) -> File | t.CPtr: pass
def openw(filename: LPCWSTR, mode: ULONG, share: ULONG) -> FileW | t.CPtr: pass