修复了大量存在的问题,增加了假鸭子类型等等机制
This commit is contained in:
12
Test/BuddyTest/App/main.py
Normal file
12
Test/BuddyTest/App/main.py
Normal file
@@ -0,0 +1,12 @@
|
||||
from stdint import *
|
||||
import w32.win32console
|
||||
import t, c
|
||||
from t import CInt, CExport
|
||||
import mbuddytest
|
||||
|
||||
|
||||
def main() -> CInt | CExport:
|
||||
w32.win32console.SetConsoleCP(65001)
|
||||
w32.win32console.SetConsoleOutputCP(65001)
|
||||
|
||||
return mbuddytest.mbuddy_main()
|
||||
535
Test/BuddyTest/App/mbuddytest.py
Normal file
535
Test/BuddyTest/App/mbuddytest.py
Normal file
@@ -0,0 +1,535 @@
|
||||
import t, c
|
||||
from t import CInt, CPtr, CChar, CUInt8T, CUInt32T, CUInt64T, CSizeT
|
||||
import viperlib
|
||||
import viperio
|
||||
import stdlib
|
||||
import mbuddy
|
||||
import string
|
||||
import testcheck
|
||||
import w32.win32process
|
||||
import w32.win32sync
|
||||
import w32.win32base
|
||||
|
||||
|
||||
# 线程函数: 在共享 MBuddy 上执行 alloc/free (测试 spinlock 线程安全)
|
||||
def _thread_alloc_free(param: t.CVoid | t.CPtr) -> t.CUInt32T:
|
||||
bd: mbuddy.MBuddy | t.CPtr = (mbuddy.MBuddy | t.CPtr)(param)
|
||||
i: CInt
|
||||
for i in range(100):
|
||||
p: bytes = bd.alloc(32)
|
||||
if p != None:
|
||||
p_c: CUInt8T | CPtr = CPtr(p)
|
||||
p_c[0] = CUInt8T(i & 0xFF)
|
||||
bd.free(p)
|
||||
return 0
|
||||
|
||||
|
||||
def mbuddy_main() -> CInt:
|
||||
buf: bytes = stdlib.malloc(256)
|
||||
|
||||
testcheck.begin("BuddyTest: 伙伴系统内存分配器测试")
|
||||
|
||||
# === 基础 alloc/free 测试 ===
|
||||
testcheck.section("基础 alloc/free")
|
||||
arena: bytes = stdlib.malloc(65536)
|
||||
bd: mbuddy.MBuddy | CPtr = mbuddy.MBuddy(arena, 65536)
|
||||
|
||||
viperlib.snprintf(buf, 256, "stats=%lu, free_count=%lu", bd.stats(), bd.free_count())
|
||||
testcheck.info(buf)
|
||||
|
||||
p1: bytes = bd.alloc(16)
|
||||
p2: bytes = bd.alloc(64)
|
||||
p3: bytes = bd.alloc(256)
|
||||
testcheck.check(p1 != None and p2 != None and p3 != None,
|
||||
"3 allocs OK", "alloc FAILED")
|
||||
|
||||
# 写入数据验证指针可用
|
||||
p_c: CUInt8T | CPtr = CPtr(p1)
|
||||
p_c[0] = CUInt8T(0xAB)
|
||||
p_c[1] = CUInt8T(0xCD)
|
||||
viperlib.snprintf(buf, 256, "p1[0]=0x%x p1[1]=0x%x", p_c[0], p_c[1])
|
||||
testcheck.info(buf)
|
||||
testcheck.check(p_c[0] == CUInt8T(0xAB) and p_c[1] == CUInt8T(0xCD),
|
||||
"write/read OK", "write/read FAILED")
|
||||
|
||||
bd.free(p1)
|
||||
bd.free(p2)
|
||||
bd.free(p3)
|
||||
testcheck.ok("3 frees OK")
|
||||
|
||||
# 释放后验证合并: free_count 应回到 1 (单个大块)
|
||||
testcheck.check(bd.free_count() == 1,
|
||||
"coalesce: free_count=1 OK", "coalesce: free_count != 1")
|
||||
|
||||
# 合并后应能分配大块
|
||||
big: bytes = bd.alloc(16000)
|
||||
testcheck.check(big != None, "big alloc OK", "big alloc FAILED")
|
||||
bd.free(big)
|
||||
|
||||
stdlib.free(arena)
|
||||
|
||||
# === calloc 测试 (验证清零) ===
|
||||
testcheck.section("calloc 清零")
|
||||
arena2: bytes = stdlib.malloc(4096)
|
||||
bd2: mbuddy.MBuddy | CPtr = mbuddy.MBuddy(arena2, 4096)
|
||||
|
||||
dirty: bytes = bd2.alloc(64)
|
||||
d_c: CUInt8T | CPtr = CPtr(dirty)
|
||||
i: CInt
|
||||
for i in range(64):
|
||||
d_c[i] = CUInt8T(0xFF)
|
||||
bd2.free(dirty)
|
||||
|
||||
cl: bytes = bd2.calloc(8, 8)
|
||||
if cl != None:
|
||||
cl_c: CUInt8T | CPtr = CPtr(cl)
|
||||
all_zero: CInt = 1
|
||||
j: CInt
|
||||
for j in range(64):
|
||||
if cl_c[j] != 0:
|
||||
all_zero = 0
|
||||
break
|
||||
testcheck.check(all_zero == 1, "calloc zeroed OK", "calloc NOT zeroed")
|
||||
bd2.free(cl)
|
||||
else:
|
||||
testcheck.fail("calloc FAILED")
|
||||
|
||||
stdlib.free(arena2)
|
||||
|
||||
# === realloc 扩展测试 ===
|
||||
testcheck.section("realloc 扩展")
|
||||
arena3: bytes = stdlib.malloc(4096)
|
||||
bd3: mbuddy.MBuddy | CPtr = mbuddy.MBuddy(arena3, 4096)
|
||||
|
||||
rp: bytes = bd3.alloc(32)
|
||||
rp_c: CUInt8T | CPtr = CPtr(rp)
|
||||
k: CInt
|
||||
for k in range(32):
|
||||
rp_c[k] = CUInt8T(k + 1)
|
||||
|
||||
rp2: bytes = bd3.realloc(rp, 128)
|
||||
if rp2 != None:
|
||||
rp2_c: CUInt8T | CPtr = CPtr(rp2)
|
||||
ok: CInt = 1
|
||||
m: CInt
|
||||
for m in range(32):
|
||||
if rp2_c[m] != CUInt8T(m + 1):
|
||||
ok = 0
|
||||
break
|
||||
testcheck.check(ok == 1, "realloc grow data preserved OK", "realloc grow data LOST")
|
||||
bd3.free(rp2)
|
||||
else:
|
||||
testcheck.fail("realloc grow FAILED")
|
||||
|
||||
stdlib.free(arena3)
|
||||
|
||||
# === 原地收缩测试 (验证无泄漏) ===
|
||||
testcheck.section("原地收缩 (realloc shrink)")
|
||||
arena_shrink: bytes = stdlib.malloc(4096)
|
||||
bds: mbuddy.MBuddy | CPtr = mbuddy.MBuddy(arena_shrink, 4096)
|
||||
|
||||
sp: bytes = bds.alloc(256)
|
||||
testcheck.check(sp != None, "alloc 256 OK", "alloc 256 FAILED")
|
||||
|
||||
fc_before: CSizeT = bds.free_count()
|
||||
# realloc 到更小尺寸: 256+8=264 -> order 4 (512); 32+8=40 -> order 1 (64)
|
||||
# new_order(1) <= old_order(4), 应原地返回同一指针
|
||||
sp2: bytes = bds.realloc(sp, 32)
|
||||
fc_after: CSizeT = bds.free_count()
|
||||
|
||||
testcheck.check(sp2 == sp, "shrink same ptr OK", "shrink ptr changed")
|
||||
testcheck.check(fc_after == fc_before, "shrink no leak OK", "shrink LEAKED blocks")
|
||||
|
||||
# 验证数据仍可读写
|
||||
sp_c: CUInt8T | CPtr = CPtr(sp2)
|
||||
sp_c[0] = CUInt8T(0x42)
|
||||
testcheck.check(sp_c[0] == CUInt8T(0x42), "shrink data OK", "shrink data FAILED")
|
||||
|
||||
bds.free(sp2)
|
||||
testcheck.check(bds.free_count() == 1, "shrink+free coalesce OK", "shrink+free coalesce FAILED")
|
||||
|
||||
stdlib.free(arena_shrink)
|
||||
|
||||
# === 边界情况测试 ===
|
||||
testcheck.section("边界情况")
|
||||
arena4: bytes = stdlib.malloc(4096)
|
||||
bd4: mbuddy.MBuddy | CPtr = mbuddy.MBuddy(arena4, 4096)
|
||||
|
||||
# alloc(0) 应返回 None
|
||||
z: bytes = bd4.alloc(0)
|
||||
testcheck.check(z == None, "alloc(0)=None OK", "alloc(0) should be None")
|
||||
|
||||
# free(None) 应安全
|
||||
bd4.free(None)
|
||||
testcheck.ok("free(None) safe")
|
||||
|
||||
# realloc(None, size) 等价于 alloc
|
||||
rn: bytes = bd4.realloc(None, 32)
|
||||
testcheck.check(rn != None, "realloc(None)=alloc OK", "realloc(None) FAILED")
|
||||
bd4.free(rn)
|
||||
|
||||
# realloc(ptr, 0) 等价于 free
|
||||
rz: bytes = bd4.alloc(32)
|
||||
rz2: bytes = bd4.realloc(rz, 0)
|
||||
testcheck.check(rz2 == None, "realloc(ptr,0)=free OK", "realloc(ptr,0) should be None")
|
||||
|
||||
stdlib.free(arena4)
|
||||
|
||||
# === 非法指针防护测试 ===
|
||||
testcheck.section("非法指针防护")
|
||||
arena5: bytes = stdlib.malloc(4096)
|
||||
bd5: mbuddy.MBuddy | CPtr = mbuddy.MBuddy(arena5, 4096)
|
||||
|
||||
valid: bytes = bd5.alloc(32)
|
||||
testcheck.check(valid != None, "alloc for illegal test OK", "alloc FAILED")
|
||||
|
||||
# 1. free 随机地址 (地址 1)
|
||||
bd5.free(t.CVoid(t.CUInt64T(1), t.CPtr))
|
||||
testcheck.ok("free(addr=1) ignored")
|
||||
|
||||
# 2. free NULL
|
||||
bd5.free(None)
|
||||
testcheck.ok("free(NULL) ignored")
|
||||
|
||||
# 3. free 越界指针 (arena 之前)
|
||||
bd5.free(t.CVoid(t.CUInt64T(arena5), t.CPtr))
|
||||
testcheck.ok("free(before arena) ignored")
|
||||
|
||||
# 4. free 越界指针 (arena 之后)
|
||||
bd5.free(t.CVoid(t.CUInt64T(arena5) + 99999, t.CPtr))
|
||||
testcheck.ok("free(after arena) ignored")
|
||||
|
||||
# 5. free 未对齐指针 (arena + 1, 在 mem 区域内但不对齐)
|
||||
bd5.free(t.CVoid(t.CUInt64T(bd5.mem) + 1, t.CPtr))
|
||||
testcheck.ok("free(misaligned) ignored")
|
||||
|
||||
# 6. 验证合法 free 仍正常工作 (释放后应能再次分配)
|
||||
bd5.free(valid)
|
||||
retry5: bytes = bd5.alloc(32)
|
||||
testcheck.check(retry5 != None, "valid free still works OK", "valid free BROKEN")
|
||||
if retry5 != None:
|
||||
bd5.free(retry5)
|
||||
|
||||
# 7. realloc 非法指针应返回 None
|
||||
r_illegal: bytes = bd5.realloc(t.CVoid(t.CUInt64T(1), t.CPtr), 64)
|
||||
testcheck.check(r_illegal == None, "realloc(illegal)=None OK", "realloc(illegal) should be None")
|
||||
|
||||
stdlib.free(arena5)
|
||||
|
||||
# === OOM 内存耗尽测试 ===
|
||||
testcheck.section("OOM 内存耗尽")
|
||||
arena6: bytes = stdlib.malloc(4096)
|
||||
bd6: mbuddy.MBuddy | CPtr = mbuddy.MBuddy(arena6, 4096)
|
||||
|
||||
# 持续分配直到失败
|
||||
alloc_count: CInt = 0
|
||||
ptrs_arr: bytes = stdlib.malloc(8 * 256) # 存储指针的数组
|
||||
ptrs: CUInt64T | CPtr = CPtr(ptrs_arr)
|
||||
|
||||
while alloc_count < 256:
|
||||
p: bytes = bd6.alloc(32)
|
||||
if p == None:
|
||||
break
|
||||
ptrs[alloc_count] = t.CUInt64T(p)
|
||||
alloc_count += 1
|
||||
|
||||
viperlib.snprintf(buf, 256, "allocated %d blocks before OOM", alloc_count)
|
||||
testcheck.info(buf)
|
||||
testcheck.check(alloc_count > 0, "OOM: got some allocs OK", "OOM: no allocs at all")
|
||||
|
||||
# 尝试再分配应失败
|
||||
oom_p: bytes = bd6.alloc(32)
|
||||
testcheck.check(oom_p == None, "OOM: alloc fails OK", "OOM: alloc should fail")
|
||||
|
||||
# 释放一个块后应能再次分配
|
||||
if alloc_count > 0:
|
||||
first_ptr: bytes = t.CVoid(ptrs[0], t.CPtr)
|
||||
bd6.free(first_ptr)
|
||||
retry: bytes = bd6.alloc(32)
|
||||
testcheck.check(retry != None, "OOM: free+alloc OK", "OOM: free+alloc FAILED")
|
||||
if retry != None:
|
||||
bd6.free(retry)
|
||||
|
||||
# 释放所有块
|
||||
idx: CInt = 1
|
||||
while idx < alloc_count:
|
||||
cur_p: bytes = t.CVoid(ptrs[idx], t.CPtr)
|
||||
bd6.free(cur_p)
|
||||
idx += 1
|
||||
|
||||
# 全部释放后应能合并回单个大块
|
||||
testcheck.check(bd6.free_count() == 1,
|
||||
"OOM: full coalesce OK", "OOM: free_count != 1 after full free")
|
||||
|
||||
stdlib.free(ptrs_arr)
|
||||
stdlib.free(arena6)
|
||||
|
||||
# === 空闲链表状态测试 ===
|
||||
testcheck.section("空闲链表状态")
|
||||
arena7: bytes = stdlib.malloc(4096)
|
||||
bd7: mbuddy.MBuddy | CPtr = mbuddy.MBuddy(arena7, 4096)
|
||||
|
||||
# 初始: 1 个大块
|
||||
testcheck.check(bd7.free_count() == 1, "init: 1 free block OK", "init: free_count != 1")
|
||||
|
||||
# 分配后: 空闲块数应增加 (分裂产生多个小块)
|
||||
a1: bytes = bd7.alloc(32)
|
||||
fc1: CSizeT = bd7.free_count()
|
||||
viperlib.snprintf(buf, 256, "after alloc(32): free_count=%lu", fc1)
|
||||
testcheck.info(buf)
|
||||
testcheck.check(fc1 > 1, "after alloc: split OK", "after alloc: no split")
|
||||
|
||||
# 再分配
|
||||
a2: bytes = bd7.alloc(32)
|
||||
fc2: CSizeT = bd7.free_count()
|
||||
testcheck.check(fc2 >= 1, "after 2nd alloc: free >= 1 OK", "after 2nd alloc: free < 1")
|
||||
|
||||
# 释放 a1: 空闲块数应增加
|
||||
bd7.free(a1)
|
||||
fc3: CSizeT = bd7.free_count()
|
||||
testcheck.check(fc3 > fc2, "after free a1: free increased OK", "after free a1: free not increased")
|
||||
|
||||
# 释放 a2: 应合并, 空闲块数回到 1
|
||||
bd7.free(a2)
|
||||
testcheck.check(bd7.free_count() == 1,
|
||||
"after free all: coalesced to 1 OK", "after free all: free_count != 1")
|
||||
|
||||
stdlib.free(arena7)
|
||||
|
||||
# === with 上下文管理器测试 ===
|
||||
testcheck.section("with 上下文管理器")
|
||||
arena8: bytes = stdlib.malloc(4096)
|
||||
with mbuddy.MBuddy(arena8, 4096) as wbd:
|
||||
wp1: bytes = wbd.alloc(32)
|
||||
wp2: bytes = wbd.alloc(64)
|
||||
testcheck.check(wp1 != None and wp2 != None,
|
||||
"with: allocs OK", "with: allocs FAILED")
|
||||
# 退出 with 块时 __exit__ 自动 reset
|
||||
|
||||
# 退出后重新进入,验证 reset 生效
|
||||
with mbuddy.MBuddy(arena8, 4096) as wbd2:
|
||||
wp3: bytes = wbd2.alloc(1024)
|
||||
testcheck.check(wp3 != None, "with: reset+realloc OK", "with: reset+realloc FAILED")
|
||||
|
||||
stdlib.free(arena8)
|
||||
|
||||
# === 双重 free 检测测试 ===
|
||||
testcheck.section("双重 free 检测")
|
||||
arena_df: bytes = stdlib.malloc(4096)
|
||||
bd_df: mbuddy.MBuddy | CPtr = mbuddy.MBuddy(arena_df, 4096)
|
||||
|
||||
df: bytes = bd_df.alloc(64)
|
||||
testcheck.check(df != None, "df: alloc OK", "df: alloc FAILED")
|
||||
|
||||
# 第一次 free
|
||||
bd_df.free(df)
|
||||
fc_df1: CSizeT = bd_df.free_count()
|
||||
testcheck.ok("first free OK")
|
||||
|
||||
# 第二次 free (双重 free) — 应被静默拒绝
|
||||
bd_df.free(df)
|
||||
fc_df2: CSizeT = bd_df.free_count()
|
||||
testcheck.check(fc_df2 == fc_df1, "double free rejected OK", "double free CORRUPTED state")
|
||||
|
||||
# 验证分配器仍正常工作
|
||||
df2: bytes = bd_df.alloc(64)
|
||||
testcheck.check(df2 != None, "df: alloc after double-free OK", "df: alloc after double-free FAILED")
|
||||
if df2 != None:
|
||||
bd_df.free(df2)
|
||||
|
||||
stdlib.free(arena_df)
|
||||
|
||||
# === 自检功能测试 ===
|
||||
testcheck.section("自检功能")
|
||||
arena_sc: bytes = stdlib.malloc(4096)
|
||||
bd_sc: mbuddy.MBuddy | CPtr = mbuddy.MBuddy(arena_sc, 4096)
|
||||
|
||||
# 初始状态自检
|
||||
testcheck.check(bd_sc.self_check() == 0, "self_check init OK", "self_check init FAILED")
|
||||
|
||||
# 分配后自检
|
||||
sc_p1: bytes = bd_sc.alloc(32)
|
||||
sc_p2: bytes = bd_sc.alloc(128)
|
||||
testcheck.check(bd_sc.self_check() == 0, "self_check after alloc OK", "self_check after alloc FAILED")
|
||||
|
||||
# 部分释放后自检
|
||||
bd_sc.free(sc_p1)
|
||||
testcheck.check(bd_sc.self_check() == 0, "self_check after partial free OK", "self_check after partial free FAILED")
|
||||
|
||||
# 全部释放后自检 (应合并回单个大块)
|
||||
bd_sc.free(sc_p2)
|
||||
testcheck.check(bd_sc.self_check() == 0, "self_check after full free OK", "self_check after full free FAILED")
|
||||
|
||||
# 双重 free 后自检 (验证状态未损坏)
|
||||
sc_p3: bytes = bd_sc.alloc(64)
|
||||
bd_sc.free(sc_p3)
|
||||
bd_sc.free(sc_p3) # 双重 free,应被拒绝
|
||||
testcheck.check(bd_sc.self_check() == 0, "self_check after double-free OK", "self_check after double-free CORRUPTED")
|
||||
|
||||
stdlib.free(arena_sc)
|
||||
|
||||
# === 并发多线程测试 (spinlock) ===
|
||||
testcheck.section("并发多线程 (spinlock)")
|
||||
arena_mt: bytes = stdlib.malloc(65536)
|
||||
bd_mt: mbuddy.MBuddy | CPtr = mbuddy.MBuddy(arena_mt, 65536)
|
||||
|
||||
NUM_THREADS: CInt = 4
|
||||
handles_arr: bytes = stdlib.malloc(8 * 4)
|
||||
handles: CUInt64T | CPtr = CPtr(handles_arr)
|
||||
tid: CUInt32T = 0
|
||||
|
||||
# 创建 4 个线程并发 alloc/free
|
||||
t_idx: CInt
|
||||
for t_idx in range(NUM_THREADS):
|
||||
h: bytes = w32.win32process.CreateThread(None, 0, _thread_alloc_free, t.CVoid(t.CUInt64T(bd_mt), t.CPtr), 0, c.Addr(tid))
|
||||
handles[t_idx] = CUInt64T(h)
|
||||
|
||||
# 等待所有线程完成
|
||||
for t_idx in range(NUM_THREADS):
|
||||
h: bytes = t.CVoid(handles[t_idx], t.CPtr)
|
||||
w32.win32sync.WaitForSingleObject(h, w32.win32base.INFINITE)
|
||||
w32.win32base.CloseHandle(h)
|
||||
|
||||
# 验证分配器状态: 自检通过,所有块已合并
|
||||
testcheck.check(bd_mt.self_check() == 0, "mt: self_check OK", "mt: self_check FAILED")
|
||||
testcheck.check(bd_mt.free_count() == 1, "mt: free_count=1 OK", "mt: free_count != 1 (leaked)")
|
||||
|
||||
viperlib.snprintf(buf, 256, "mt: free_count=%lu", bd_mt.free_count())
|
||||
testcheck.info(buf)
|
||||
|
||||
stdlib.free(handles_arr)
|
||||
stdlib.free(arena_mt)
|
||||
|
||||
# === 极端边界测试 ===
|
||||
testcheck.section("极端边界")
|
||||
|
||||
# 1. 分配尺寸恰巧是块边界
|
||||
arena_ex: bytes = stdlib.malloc(4096)
|
||||
bd_ex: mbuddy.MBuddy | CPtr = mbuddy.MBuddy(arena_ex, 4096)
|
||||
|
||||
# 24 + 8 = 32 = MIN_BLOCK, 恰好填满 order 0 块
|
||||
exact_fit: bytes = bd_ex.alloc(24)
|
||||
testcheck.check(exact_fit != None, "exact fit order 0 OK", "exact fit order 0 FAILED")
|
||||
|
||||
# 25 + 8 = 33 > 32, 需要 order 1 (64 字节)
|
||||
over_fit: bytes = bd_ex.alloc(25)
|
||||
testcheck.check(over_fit != None, "over by 1 byte OK", "over by 1 byte FAILED")
|
||||
|
||||
bd_ex.free(exact_fit)
|
||||
bd_ex.free(over_fit)
|
||||
testcheck.check(bd_ex.free_count() == 1, "boundary: coalesce OK", "boundary: coalesce FAILED")
|
||||
|
||||
# 2. 单次分配接近 arena 上限
|
||||
max_usable: CSizeT = bd_ex.mem_size - 8
|
||||
viperlib.snprintf(buf, 256, "mem_size=%lu, max_usable=%lu", bd_ex.mem_size, max_usable)
|
||||
testcheck.info(buf)
|
||||
|
||||
# 恰好用完整个 arena
|
||||
exact_max: bytes = bd_ex.alloc(max_usable)
|
||||
testcheck.check(exact_max != None, "exact max alloc OK", "exact max alloc FAILED")
|
||||
testcheck.check(bd_ex.free_count() == 0, "max alloc: arena full OK", "max alloc: arena not full")
|
||||
|
||||
bd_ex.free(exact_max)
|
||||
testcheck.check(bd_ex.free_count() == 1, "max free: coalesce OK", "max free: coalesce FAILED")
|
||||
|
||||
# 再次分配同样大小 — 验证合并后可再次使用
|
||||
exact_max2: bytes = bd_ex.alloc(max_usable)
|
||||
testcheck.check(exact_max2 != None, "exact max re-alloc OK", "exact max re-alloc FAILED")
|
||||
bd_ex.free(exact_max2)
|
||||
|
||||
# 3. 分配超过 arena 上限 — 应失败
|
||||
over_max: bytes = bd_ex.alloc(bd_ex.mem_size)
|
||||
testcheck.check(over_max == None, "over max: fails OK", "over max: should fail")
|
||||
|
||||
over_max2: bytes = bd_ex.alloc(max_usable + 1)
|
||||
testcheck.check(over_max2 == None, "max+1: fails OK", "max+1: should fail")
|
||||
|
||||
stdlib.free(arena_ex)
|
||||
|
||||
# 4. Arena 太小 (仅够 free_lists 开销, 264 字节)
|
||||
arena_tiny: bytes = stdlib.malloc(264)
|
||||
bd_tiny: mbuddy.MBuddy | CPtr = mbuddy.MBuddy(arena_tiny, 264)
|
||||
testcheck.check(bd_tiny.stats() == 0, "tiny arena: stats=0 OK", "tiny arena: stats != 0")
|
||||
tiny_p: bytes = bd_tiny.alloc(32)
|
||||
testcheck.check(tiny_p == None, "tiny arena: alloc fails OK", "tiny arena: should fail")
|
||||
stdlib.free(arena_tiny)
|
||||
|
||||
# 5. Arena 刚好够一个最小块 (264 + 32 = 296)
|
||||
arena_one: bytes = stdlib.malloc(296)
|
||||
bd_one: mbuddy.MBuddy | CPtr = mbuddy.MBuddy(arena_one, 296)
|
||||
testcheck.check(bd_one.stats() == 32, "one block: stats=32 OK", "one block: stats != 32")
|
||||
|
||||
one_p: bytes = bd_one.alloc(24)
|
||||
testcheck.check(one_p != None, "one block: alloc OK", "one block: alloc FAILED")
|
||||
|
||||
one_p2: bytes = bd_one.alloc(24)
|
||||
testcheck.check(one_p2 == None, "one block: OOM OK", "one block: should be OOM")
|
||||
|
||||
bd_one.free(one_p)
|
||||
testcheck.check(bd_one.free_count() == 1, "one block: free OK", "one block: free FAILED")
|
||||
stdlib.free(arena_one)
|
||||
|
||||
# 6. 2 的幂 arena vs 非 2 的幂 arena
|
||||
arena_pow2: bytes = stdlib.malloc(512)
|
||||
bd_pow2: mbuddy.MBuddy | CPtr = mbuddy.MBuddy(arena_pow2, 512)
|
||||
# 512 - 264 = 248, largest_pow2(248) = 128
|
||||
testcheck.check(bd_pow2.stats() == 128, "pow2 arena: stats=128 OK", "pow2 arena: stats != 128")
|
||||
stdlib.free(arena_pow2)
|
||||
|
||||
arena_non2: bytes = stdlib.malloc(500)
|
||||
bd_non2: mbuddy.MBuddy | CPtr = mbuddy.MBuddy(arena_non2, 500)
|
||||
# 500 - 264 = 236, largest_pow2(236) = 128
|
||||
testcheck.check(bd_non2.stats() == 128, "non-pow2 arena: stats=128 OK", "non-pow2 arena: stats != 128")
|
||||
stdlib.free(arena_non2)
|
||||
|
||||
# 7. 压力测试: 反复 alloc/free 同一尺寸 1000 次
|
||||
arena_stress: bytes = stdlib.malloc(4096)
|
||||
bd_stress: mbuddy.MBuddy | CPtr = mbuddy.MBuddy(arena_stress, 4096)
|
||||
|
||||
s: CInt
|
||||
for s in range(1000):
|
||||
sp: bytes = bd_stress.alloc(64)
|
||||
if sp != None:
|
||||
sp_c: CUInt8T | CPtr = CPtr(sp)
|
||||
sp_c[0] = CUInt8T(s & 0xFF)
|
||||
bd_stress.free(sp)
|
||||
|
||||
testcheck.check(bd_stress.self_check() == 0, "stress: self_check OK", "stress: self_check FAILED")
|
||||
testcheck.check(bd_stress.free_count() == 1, "stress: free_count=1 OK", "stress: leaked")
|
||||
stdlib.free(arena_stress)
|
||||
|
||||
# 8. 分配全部最小块然后全部释放
|
||||
arena_fill: bytes = stdlib.malloc(4096)
|
||||
bd_fill: mbuddy.MBuddy | CPtr = mbuddy.MBuddy(arena_fill, 4096)
|
||||
|
||||
fill_count: CInt = 0
|
||||
fill_ptrs_arr: bytes = stdlib.malloc(8 * 256)
|
||||
fill_ptrs: CUInt64T | CPtr = CPtr(fill_ptrs_arr)
|
||||
|
||||
fc: CInt
|
||||
for fc in range(256):
|
||||
fp: bytes = bd_fill.alloc(24)
|
||||
if fp == None:
|
||||
break
|
||||
fill_ptrs[fill_count] = t.CUInt64T(fp)
|
||||
fill_count += 1
|
||||
|
||||
viperlib.snprintf(buf, 256, "fill: %d min blocks allocated", fill_count)
|
||||
testcheck.info(buf)
|
||||
testcheck.check(fill_count > 0, "fill: got blocks OK", "fill: no blocks")
|
||||
testcheck.check(bd_fill.self_check() == 0, "fill: self_check OK", "fill: self_check FAILED")
|
||||
|
||||
# 全部释放
|
||||
fi: CInt
|
||||
for fi in range(fill_count):
|
||||
fp2: bytes = t.CVoid(fill_ptrs[fi], t.CPtr)
|
||||
bd_fill.free(fp2)
|
||||
|
||||
testcheck.check(bd_fill.free_count() == 1, "fill: all freed OK", "fill: leaked after free all")
|
||||
testcheck.check(bd_fill.self_check() == 0, "fill: self_check after free OK", "fill: self_check FAILED")
|
||||
|
||||
stdlib.free(fill_ptrs_arr)
|
||||
stdlib.free(arena_fill)
|
||||
|
||||
stdlib.free(buf)
|
||||
return testcheck.end()
|
||||
1
Test/BuddyTest/output/067c78e9f121dce3.deps.json
Normal file
1
Test/BuddyTest/output/067c78e9f121dce3.deps.json
Normal file
@@ -0,0 +1 @@
|
||||
{"w32.win32process": "067c78e9f121dce3", "win32process": "067c78e9f121dce3", "atom": "271ea3decb810db2", "w32.win32sync": "29813d57621099a9", "win32sync": "29813d57621099a9", "stdint": "49bd8cba55979f76", "w32.win32base": "5a6a2137958c28c5", "win32base": "5a6a2137958c28c5", "main": "5e430ae5bf7af3a2", "stdlib": "6c2029b306556c00", "viperlib": "70b580331b822117", "stdarg": "71e0a3ffcb3ebfad", "stdio": "73edbcf76e32d00b", "testcheck": "9dbecd0942a39782", "string": "b5f1dc665c52a1bd", "w32.win32console": "bbdf3bbd4c3bc28c", "win32console": "bbdf3bbd4c3bc28c", "mbuddytest": "c53a157505aa8081", "viperio": "c9f4be41ca1cc2b4", "mbuddy": "e1937873ebfba8c3", "w32.win32file": "abf9ce3160c9279e", "win32file": "abf9ce3160c9279e", "w32.fileio": "fa3691e66b426950", "fileio": "fa3691e66b426950", "w32.win32memory": "72e2d5ccb7cedcf1", "win32memory": "72e2d5ccb7cedcf1"}
|
||||
1
Test/BuddyTest/output/271ea3decb810db2.deps.json
Normal file
1
Test/BuddyTest/output/271ea3decb810db2.deps.json
Normal file
@@ -0,0 +1 @@
|
||||
{"w32.win32process": "067c78e9f121dce3", "win32process": "067c78e9f121dce3", "atom": "271ea3decb810db2", "w32.win32sync": "29813d57621099a9", "win32sync": "29813d57621099a9", "stdint": "49bd8cba55979f76", "w32.win32base": "5a6a2137958c28c5", "win32base": "5a6a2137958c28c5", "main": "5e430ae5bf7af3a2", "stdlib": "6c2029b306556c00", "viperlib": "70b580331b822117", "stdarg": "71e0a3ffcb3ebfad", "stdio": "73edbcf76e32d00b", "testcheck": "9dbecd0942a39782", "string": "b5f1dc665c52a1bd", "w32.win32console": "bbdf3bbd4c3bc28c", "win32console": "bbdf3bbd4c3bc28c", "mbuddytest": "c53a157505aa8081", "viperio": "c9f4be41ca1cc2b4", "mbuddy": "e1937873ebfba8c3"}
|
||||
1
Test/BuddyTest/output/29813d57621099a9.deps.json
Normal file
1
Test/BuddyTest/output/29813d57621099a9.deps.json
Normal file
@@ -0,0 +1 @@
|
||||
{"w32.win32process": "067c78e9f121dce3", "win32process": "067c78e9f121dce3", "atom": "271ea3decb810db2", "w32.win32sync": "29813d57621099a9", "win32sync": "29813d57621099a9", "stdint": "49bd8cba55979f76", "w32.win32base": "5a6a2137958c28c5", "win32base": "5a6a2137958c28c5", "main": "5e430ae5bf7af3a2", "stdlib": "6c2029b306556c00", "viperlib": "70b580331b822117", "stdarg": "71e0a3ffcb3ebfad", "stdio": "73edbcf76e32d00b", "testcheck": "9dbecd0942a39782", "string": "b5f1dc665c52a1bd", "w32.win32console": "bbdf3bbd4c3bc28c", "win32console": "bbdf3bbd4c3bc28c", "mbuddytest": "c53a157505aa8081", "viperio": "c9f4be41ca1cc2b4", "mbuddy": "e1937873ebfba8c3", "w32.win32file": "abf9ce3160c9279e", "win32file": "abf9ce3160c9279e", "w32.fileio": "fa3691e66b426950", "fileio": "fa3691e66b426950", "w32.win32memory": "72e2d5ccb7cedcf1", "win32memory": "72e2d5ccb7cedcf1"}
|
||||
1
Test/BuddyTest/output/5a6a2137958c28c5.deps.json
Normal file
1
Test/BuddyTest/output/5a6a2137958c28c5.deps.json
Normal file
@@ -0,0 +1 @@
|
||||
{"w32.win32process": "067c78e9f121dce3", "win32process": "067c78e9f121dce3", "atom": "271ea3decb810db2", "w32.win32sync": "29813d57621099a9", "win32sync": "29813d57621099a9", "stdint": "49bd8cba55979f76", "w32.win32base": "5a6a2137958c28c5", "win32base": "5a6a2137958c28c5", "main": "5e430ae5bf7af3a2", "stdlib": "6c2029b306556c00", "viperlib": "70b580331b822117", "stdarg": "71e0a3ffcb3ebfad", "stdio": "73edbcf76e32d00b", "testcheck": "9dbecd0942a39782", "string": "b5f1dc665c52a1bd", "w32.win32console": "bbdf3bbd4c3bc28c", "win32console": "bbdf3bbd4c3bc28c", "mbuddytest": "c53a157505aa8081", "viperio": "c9f4be41ca1cc2b4", "mbuddy": "e1937873ebfba8c3"}
|
||||
1
Test/BuddyTest/output/5e430ae5bf7af3a2.deps.json
Normal file
1
Test/BuddyTest/output/5e430ae5bf7af3a2.deps.json
Normal file
@@ -0,0 +1 @@
|
||||
{"w32.win32process": "067c78e9f121dce3", "win32process": "067c78e9f121dce3", "atom": "271ea3decb810db2", "w32.win32sync": "29813d57621099a9", "win32sync": "29813d57621099a9", "stdint": "49bd8cba55979f76", "w32.win32base": "5a6a2137958c28c5", "win32base": "5a6a2137958c28c5", "stdlib": "6c2029b306556c00", "viperlib": "70b580331b822117", "stdarg": "71e0a3ffcb3ebfad", "stdio": "73edbcf76e32d00b", "testcheck": "9dbecd0942a39782", "string": "b5f1dc665c52a1bd", "w32.win32console": "bbdf3bbd4c3bc28c", "win32console": "bbdf3bbd4c3bc28c", "mbuddytest": "c53a157505aa8081", "viperio": "c9f4be41ca1cc2b4", "mbuddy": "e1937873ebfba8c3"}
|
||||
1
Test/BuddyTest/output/70b580331b822117.deps.json
Normal file
1
Test/BuddyTest/output/70b580331b822117.deps.json
Normal file
@@ -0,0 +1 @@
|
||||
{"w32.win32process": "067c78e9f121dce3", "win32process": "067c78e9f121dce3", "atom": "271ea3decb810db2", "w32.win32sync": "29813d57621099a9", "win32sync": "29813d57621099a9", "stdint": "49bd8cba55979f76", "w32.win32base": "5a6a2137958c28c5", "win32base": "5a6a2137958c28c5", "main": "5e430ae5bf7af3a2", "stdlib": "6c2029b306556c00", "viperlib": "70b580331b822117", "stdarg": "71e0a3ffcb3ebfad", "stdio": "73edbcf76e32d00b", "testcheck": "9dbecd0942a39782", "string": "b5f1dc665c52a1bd", "w32.win32console": "bbdf3bbd4c3bc28c", "win32console": "bbdf3bbd4c3bc28c", "mbuddytest": "c53a157505aa8081", "viperio": "c9f4be41ca1cc2b4", "mbuddy": "e1937873ebfba8c3"}
|
||||
1
Test/BuddyTest/output/72e2d5ccb7cedcf1.deps.json
Normal file
1
Test/BuddyTest/output/72e2d5ccb7cedcf1.deps.json
Normal file
@@ -0,0 +1 @@
|
||||
{"w32.win32process": "067c78e9f121dce3", "win32process": "067c78e9f121dce3", "atom": "271ea3decb810db2", "w32.win32sync": "29813d57621099a9", "win32sync": "29813d57621099a9", "stdint": "49bd8cba55979f76", "w32.win32base": "5a6a2137958c28c5", "win32base": "5a6a2137958c28c5", "main": "5e430ae5bf7af3a2", "stdlib": "6c2029b306556c00", "viperlib": "70b580331b822117", "stdarg": "71e0a3ffcb3ebfad", "stdio": "73edbcf76e32d00b", "testcheck": "9dbecd0942a39782", "string": "b5f1dc665c52a1bd", "w32.win32console": "bbdf3bbd4c3bc28c", "win32console": "bbdf3bbd4c3bc28c", "mbuddytest": "c53a157505aa8081", "viperio": "c9f4be41ca1cc2b4", "mbuddy": "e1937873ebfba8c3", "w32.win32file": "abf9ce3160c9279e", "win32file": "abf9ce3160c9279e", "w32.fileio": "fa3691e66b426950", "fileio": "fa3691e66b426950", "w32.win32memory": "72e2d5ccb7cedcf1", "win32memory": "72e2d5ccb7cedcf1"}
|
||||
1
Test/BuddyTest/output/9dbecd0942a39782.deps.json
Normal file
1
Test/BuddyTest/output/9dbecd0942a39782.deps.json
Normal file
@@ -0,0 +1 @@
|
||||
{"w32.win32process": "067c78e9f121dce3", "win32process": "067c78e9f121dce3", "atom": "271ea3decb810db2", "w32.win32sync": "29813d57621099a9", "win32sync": "29813d57621099a9", "stdint": "49bd8cba55979f76", "w32.win32base": "5a6a2137958c28c5", "win32base": "5a6a2137958c28c5", "main": "5e430ae5bf7af3a2", "stdlib": "6c2029b306556c00", "viperlib": "70b580331b822117", "stdarg": "71e0a3ffcb3ebfad", "stdio": "73edbcf76e32d00b", "testcheck": "9dbecd0942a39782", "string": "b5f1dc665c52a1bd", "w32.win32console": "bbdf3bbd4c3bc28c", "win32console": "bbdf3bbd4c3bc28c", "mbuddytest": "c53a157505aa8081", "viperio": "c9f4be41ca1cc2b4", "mbuddy": "e1937873ebfba8c3"}
|
||||
1
Test/BuddyTest/output/abf9ce3160c9279e.deps.json
Normal file
1
Test/BuddyTest/output/abf9ce3160c9279e.deps.json
Normal file
@@ -0,0 +1 @@
|
||||
{"w32.win32process": "067c78e9f121dce3", "win32process": "067c78e9f121dce3", "atom": "271ea3decb810db2", "w32.win32sync": "29813d57621099a9", "win32sync": "29813d57621099a9", "stdint": "49bd8cba55979f76", "w32.win32base": "5a6a2137958c28c5", "win32base": "5a6a2137958c28c5", "main": "5e430ae5bf7af3a2", "stdlib": "6c2029b306556c00", "viperlib": "70b580331b822117", "stdarg": "71e0a3ffcb3ebfad", "stdio": "73edbcf76e32d00b", "testcheck": "9dbecd0942a39782", "string": "b5f1dc665c52a1bd", "w32.win32console": "bbdf3bbd4c3bc28c", "win32console": "bbdf3bbd4c3bc28c", "mbuddytest": "c53a157505aa8081", "viperio": "c9f4be41ca1cc2b4", "mbuddy": "e1937873ebfba8c3", "w32.win32file": "abf9ce3160c9279e", "win32file": "abf9ce3160c9279e"}
|
||||
1
Test/BuddyTest/output/b5f1dc665c52a1bd.deps.json
Normal file
1
Test/BuddyTest/output/b5f1dc665c52a1bd.deps.json
Normal file
@@ -0,0 +1 @@
|
||||
{"w32.win32process": "067c78e9f121dce3", "win32process": "067c78e9f121dce3", "atom": "271ea3decb810db2", "w32.win32sync": "29813d57621099a9", "win32sync": "29813d57621099a9", "stdint": "49bd8cba55979f76", "w32.win32base": "5a6a2137958c28c5", "win32base": "5a6a2137958c28c5", "main": "5e430ae5bf7af3a2", "stdlib": "6c2029b306556c00", "viperlib": "70b580331b822117", "stdarg": "71e0a3ffcb3ebfad", "stdio": "73edbcf76e32d00b", "testcheck": "9dbecd0942a39782", "string": "b5f1dc665c52a1bd", "w32.win32console": "bbdf3bbd4c3bc28c", "win32console": "bbdf3bbd4c3bc28c", "mbuddytest": "c53a157505aa8081", "viperio": "c9f4be41ca1cc2b4", "mbuddy": "e1937873ebfba8c3"}
|
||||
1
Test/BuddyTest/output/bbdf3bbd4c3bc28c.deps.json
Normal file
1
Test/BuddyTest/output/bbdf3bbd4c3bc28c.deps.json
Normal file
@@ -0,0 +1 @@
|
||||
{"w32.win32process": "067c78e9f121dce3", "win32process": "067c78e9f121dce3", "atom": "271ea3decb810db2", "w32.win32sync": "29813d57621099a9", "win32sync": "29813d57621099a9", "stdint": "49bd8cba55979f76", "w32.win32base": "5a6a2137958c28c5", "win32base": "5a6a2137958c28c5", "main": "5e430ae5bf7af3a2", "stdlib": "6c2029b306556c00", "viperlib": "70b580331b822117", "stdarg": "71e0a3ffcb3ebfad", "stdio": "73edbcf76e32d00b", "testcheck": "9dbecd0942a39782", "string": "b5f1dc665c52a1bd", "w32.win32console": "bbdf3bbd4c3bc28c", "win32console": "bbdf3bbd4c3bc28c", "mbuddytest": "c53a157505aa8081", "viperio": "c9f4be41ca1cc2b4", "mbuddy": "e1937873ebfba8c3"}
|
||||
1
Test/BuddyTest/output/c53a157505aa8081.deps.json
Normal file
1
Test/BuddyTest/output/c53a157505aa8081.deps.json
Normal file
@@ -0,0 +1 @@
|
||||
{"w32.win32process": "067c78e9f121dce3", "win32process": "067c78e9f121dce3", "atom": "271ea3decb810db2", "w32.win32sync": "29813d57621099a9", "win32sync": "29813d57621099a9", "stdint": "49bd8cba55979f76", "w32.win32base": "5a6a2137958c28c5", "win32base": "5a6a2137958c28c5", "main": "5e430ae5bf7af3a2", "stdlib": "6c2029b306556c00", "viperlib": "70b580331b822117", "stdarg": "71e0a3ffcb3ebfad", "stdio": "73edbcf76e32d00b", "testcheck": "9dbecd0942a39782", "string": "b5f1dc665c52a1bd", "w32.win32console": "bbdf3bbd4c3bc28c", "win32console": "bbdf3bbd4c3bc28c", "viperio": "c9f4be41ca1cc2b4", "mbuddy": "e1937873ebfba8c3"}
|
||||
1
Test/BuddyTest/output/c9f4be41ca1cc2b4.deps.json
Normal file
1
Test/BuddyTest/output/c9f4be41ca1cc2b4.deps.json
Normal file
@@ -0,0 +1 @@
|
||||
{"w32.win32process": "067c78e9f121dce3", "win32process": "067c78e9f121dce3", "atom": "271ea3decb810db2", "w32.win32sync": "29813d57621099a9", "win32sync": "29813d57621099a9", "stdint": "49bd8cba55979f76", "w32.win32base": "5a6a2137958c28c5", "win32base": "5a6a2137958c28c5", "main": "5e430ae5bf7af3a2", "stdlib": "6c2029b306556c00", "viperlib": "70b580331b822117", "stdarg": "71e0a3ffcb3ebfad", "stdio": "73edbcf76e32d00b", "testcheck": "9dbecd0942a39782", "string": "b5f1dc665c52a1bd", "w32.win32console": "bbdf3bbd4c3bc28c", "win32console": "bbdf3bbd4c3bc28c", "mbuddytest": "c53a157505aa8081", "viperio": "c9f4be41ca1cc2b4", "mbuddy": "e1937873ebfba8c3"}
|
||||
1
Test/BuddyTest/output/e1937873ebfba8c3.deps.json
Normal file
1
Test/BuddyTest/output/e1937873ebfba8c3.deps.json
Normal file
@@ -0,0 +1 @@
|
||||
{"w32.win32process": "067c78e9f121dce3", "win32process": "067c78e9f121dce3", "atom": "271ea3decb810db2", "w32.win32sync": "29813d57621099a9", "win32sync": "29813d57621099a9", "stdint": "49bd8cba55979f76", "w32.win32base": "5a6a2137958c28c5", "win32base": "5a6a2137958c28c5", "main": "5e430ae5bf7af3a2", "stdlib": "6c2029b306556c00", "viperlib": "70b580331b822117", "stdarg": "71e0a3ffcb3ebfad", "stdio": "73edbcf76e32d00b", "testcheck": "9dbecd0942a39782", "string": "b5f1dc665c52a1bd", "w32.win32console": "bbdf3bbd4c3bc28c", "win32console": "bbdf3bbd4c3bc28c", "mbuddytest": "c53a157505aa8081", "viperio": "c9f4be41ca1cc2b4", "mbuddy": "e1937873ebfba8c3"}
|
||||
1
Test/BuddyTest/output/fa3691e66b426950.deps.json
Normal file
1
Test/BuddyTest/output/fa3691e66b426950.deps.json
Normal file
@@ -0,0 +1 @@
|
||||
{"w32.win32process": "067c78e9f121dce3", "win32process": "067c78e9f121dce3", "atom": "271ea3decb810db2", "w32.win32sync": "29813d57621099a9", "win32sync": "29813d57621099a9", "stdint": "49bd8cba55979f76", "w32.win32base": "5a6a2137958c28c5", "win32base": "5a6a2137958c28c5", "main": "5e430ae5bf7af3a2", "stdlib": "6c2029b306556c00", "viperlib": "70b580331b822117", "stdarg": "71e0a3ffcb3ebfad", "stdio": "73edbcf76e32d00b", "testcheck": "9dbecd0942a39782", "string": "b5f1dc665c52a1bd", "w32.win32console": "bbdf3bbd4c3bc28c", "win32console": "bbdf3bbd4c3bc28c", "mbuddytest": "c53a157505aa8081", "viperio": "c9f4be41ca1cc2b4", "mbuddy": "e1937873ebfba8c3", "w32.win32file": "abf9ce3160c9279e", "win32file": "abf9ce3160c9279e", "w32.fileio": "fa3691e66b426950", "fileio": "fa3691e66b426950"}
|
||||
29
Test/BuddyTest/project.json
Normal file
29
Test/BuddyTest/project.json
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"$schema": "https://raw.githubusercontent.com/TermiNexus/TransPyC/main/schemas/project-schema.json",
|
||||
"name": "BuddyTest",
|
||||
"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": ["-lmsvcrt", "-lucrt", "-lpthread", "-lmingwex", "-lkernel32", "-Wl,--allow-multiple-definition"],
|
||||
"output": "BuddyTest.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
|
||||
}
|
||||
}
|
||||
136
Test/BuddyTest/temp/067c78e9f121dce3.pyi
Normal file
136
Test/BuddyTest/temp/067c78e9f121dce3.pyi
Normal 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
|
||||
26
Test/BuddyTest/temp/271ea3decb810db2.pyi
Normal file
26
Test/BuddyTest/temp/271ea3decb810db2.pyi
Normal file
@@ -0,0 +1,26 @@
|
||||
"""
|
||||
Auto-generated Python stub file from atom.py
|
||||
Module: atom
|
||||
"""
|
||||
|
||||
|
||||
import t, c
|
||||
|
||||
ATOMIC_RELAXED: t.CDefine = 0
|
||||
ATOMIC_CONSUME: t.CDefine = 1
|
||||
ATOMIC_ACQUIRE: t.CDefine = 2
|
||||
ATOMIC_RELEASE: t.CDefine = 3
|
||||
ATOMIC_ACQ_REL: t.CDefine = 4
|
||||
ATOMIC_SEQ_CST: t.CDefine = 5
|
||||
|
||||
def __atomic_test_and_set(ptr: t.CUInt64T | t.CPtr, order: t.CInt) -> t.CBool: pass
|
||||
|
||||
def __atomic_clear(ptr: t.CUInt64T | t.CPtr, order: t.CInt) -> t.CVoid: pass
|
||||
|
||||
def __atomic_thread_fence(order: t.CInt) -> t.CVoid: pass
|
||||
|
||||
def __atomic_signal_fence(order: t.CInt) -> t.CVoid: pass
|
||||
|
||||
def __atomic_always_lock_free(size: t.CSizeT, ptr: t.CVoid | t.CPtr) -> t.CBool: pass
|
||||
|
||||
def __atomic_is_lock_free(size: t.CSizeT, ptr: t.CVoid | t.CPtr) -> t.CBool: pass
|
||||
85
Test/BuddyTest/temp/29813d57621099a9.pyi
Normal file
85
Test/BuddyTest/temp/29813d57621099a9.pyi
Normal 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
|
||||
75
Test/BuddyTest/temp/49bd8cba55979f76.pyi
Normal file
75
Test/BuddyTest/temp/49bd8cba55979f76.pyi
Normal file
@@ -0,0 +1,75 @@
|
||||
"""
|
||||
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
|
||||
i8: t.CTypedef = t.CInt8T
|
||||
i16: t.CTypedef = t.CInt16T
|
||||
i32: t.CTypedef = t.CInt32T
|
||||
i64: t.CTypedef = t.CInt64T
|
||||
u8: t.CTypedef = t.CUInt8T
|
||||
u16: t.CTypedef = t.CUInt16T
|
||||
u32: t.CTypedef = t.CUInt32T
|
||||
u64: t.CTypedef = t.CUInt64T
|
||||
98
Test/BuddyTest/temp/5a6a2137958c28c5.pyi
Normal file
98
Test/BuddyTest/temp/5a6a2137958c28c5.pyi
Normal 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
|
||||
13
Test/BuddyTest/temp/5e430ae5bf7af3a2.pyi
Normal file
13
Test/BuddyTest/temp/5e430ae5bf7af3a2.pyi
Normal file
@@ -0,0 +1,13 @@
|
||||
"""
|
||||
Auto-generated Python stub file from main.py
|
||||
Module: main
|
||||
"""
|
||||
|
||||
|
||||
from stdint import *
|
||||
import w32.win32console
|
||||
import t, c
|
||||
from t import CInt, CExport
|
||||
import mbuddytest
|
||||
|
||||
def main() -> CInt | CExport: pass
|
||||
18
Test/BuddyTest/temp/6c2029b306556c00.pyi
Normal file
18
Test/BuddyTest/temp/6c2029b306556c00.pyi
Normal file
@@ -0,0 +1,18 @@
|
||||
"""
|
||||
Auto-generated Python stub file from stdlib.py
|
||||
Module: stdlib
|
||||
"""
|
||||
|
||||
import c
|
||||
|
||||
|
||||
from stdint import *
|
||||
import t
|
||||
|
||||
def malloc(size: t.CSizeT) -> t.CVoid | t.CPtr | t.State | t.CExtern | t.CExport: pass
|
||||
|
||||
def calloc(nmemb: t.CSizeT, size: t.CSizeT) -> t.CVoid | t.CPtr | t.State | t.CExtern | t.CExport: pass
|
||||
|
||||
def realloc(p: t.CVoid | t.CPtr, size: t.CSizeT) -> t.CVoid | t.CPtr | t.State | t.CExtern | t.CExport: pass
|
||||
|
||||
def free(p: t.CVoid | t.CPtr) -> None | t.State | t.CExtern | t.CExport: pass
|
||||
19
Test/BuddyTest/temp/70b580331b822117.pyi
Normal file
19
Test/BuddyTest/temp/70b580331b822117.pyi
Normal file
@@ -0,0 +1,19 @@
|
||||
"""
|
||||
Auto-generated Python stub file from viperlib.py
|
||||
Module: viperlib
|
||||
"""
|
||||
|
||||
|
||||
import t, c
|
||||
import viperio
|
||||
from stdarg import arg
|
||||
|
||||
TEMP_BUF_SIZE: t.CDefine = 24
|
||||
|
||||
def get_digit_count(num: t.CUnsignedInt, base: t.CInt) -> t.CStatic | t.CInt | t.State: pass
|
||||
|
||||
def sprintf(buf: t.CChar | t.CPtr, rule: str, *args) -> t.CVoid | t.State: pass
|
||||
|
||||
def vsprintf(buf: t.CChar | t.CPtr, rule: str, *args) -> t.CInt | t.State: pass
|
||||
|
||||
def snprintf(buf: t.CChar | t.CPtr, size: t.CSizeT, fmt: str, *args) -> t.CInt | t.State: pass
|
||||
20
Test/BuddyTest/temp/71e0a3ffcb3ebfad.pyi
Normal file
20
Test/BuddyTest/temp/71e0a3ffcb3ebfad.pyi
Normal file
@@ -0,0 +1,20 @@
|
||||
"""
|
||||
Auto-generated Python stub file from stdarg.py
|
||||
Module: stdarg
|
||||
"""
|
||||
|
||||
import c
|
||||
|
||||
|
||||
import t
|
||||
|
||||
def va_start(args: t.CPtr, last_arg: t.CPtr) -> t.State: pass
|
||||
|
||||
def va_arg(args: t.CPtr, type: t.CPtr) -> t.CPtr | t.State: pass
|
||||
|
||||
def va_end(args: t.CPtr) -> t.State | t.State: pass
|
||||
|
||||
|
||||
va_list: t.CTypedef = t.CUnsignedChar | t.CPtr
|
||||
|
||||
def arg(type: t.CType) -> t.State: pass
|
||||
91
Test/BuddyTest/temp/72e2d5ccb7cedcf1.pyi
Normal file
91
Test/BuddyTest/temp/72e2d5ccb7cedcf1.pyi
Normal 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
|
||||
28
Test/BuddyTest/temp/73edbcf76e32d00b.pyi
Normal file
28
Test/BuddyTest/temp/73edbcf76e32d00b.pyi
Normal 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
|
||||
25
Test/BuddyTest/temp/9dbecd0942a39782.pyi
Normal file
25
Test/BuddyTest/temp/9dbecd0942a39782.pyi
Normal file
@@ -0,0 +1,25 @@
|
||||
"""
|
||||
Auto-generated Python stub file from testcheck.py
|
||||
Module: testcheck
|
||||
"""
|
||||
|
||||
|
||||
import t, c
|
||||
import stdio
|
||||
|
||||
_pass_count: t.CExtern | t.CInt
|
||||
_fail_count: t.CExtern | t.CInt
|
||||
|
||||
def begin(name: str) -> t.CInt: pass
|
||||
|
||||
def section(name: str) -> t.CInt: pass
|
||||
|
||||
def ok(msg: str) -> t.CInt: pass
|
||||
|
||||
def fail(msg: str) -> t.CInt: pass
|
||||
|
||||
def check(cond: t.CInt, ok_msg: str, fail_msg: str) -> t.CInt: pass
|
||||
|
||||
def info(msg: str) -> t.CInt: pass
|
||||
|
||||
def end() -> t.CInt: pass
|
||||
16
Test/BuddyTest/temp/_sha1_map.txt
Normal file
16
Test/BuddyTest/temp/_sha1_map.txt
Normal file
@@ -0,0 +1,16 @@
|
||||
067c78e9f121dce3:includes/w32\win32process.py
|
||||
271ea3decb810db2:includes/atom.py
|
||||
29813d57621099a9:includes/w32\win32sync.py
|
||||
49bd8cba55979f76:includes/stdint.py
|
||||
5a6a2137958c28c5:includes/w32\win32base.py
|
||||
5e430ae5bf7af3a2:main.py
|
||||
6c2029b306556c00:includes/stdlib.py
|
||||
70b580331b822117:includes/viperlib.py
|
||||
71e0a3ffcb3ebfad:includes/stdarg.py
|
||||
73edbcf76e32d00b:includes/stdio.py
|
||||
9dbecd0942a39782:includes/testcheck.py
|
||||
b5f1dc665c52a1bd:includes/string.py
|
||||
bbdf3bbd4c3bc28c:includes/w32\win32console.py
|
||||
c53a157505aa8081:mbuddytest.py
|
||||
c9f4be41ca1cc2b4:includes/viperio.py
|
||||
e1937873ebfba8c3:includes/mbuddy.py
|
||||
0
Test/BuddyTest/temp/_shared_sym.json
Normal file
0
Test/BuddyTest/temp/_shared_sym.json
Normal file
179
Test/BuddyTest/temp/abf9ce3160c9279e.pyi
Normal file
179
Test/BuddyTest/temp/abf9ce3160c9279e.pyi
Normal 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
|
||||
44
Test/BuddyTest/temp/b5f1dc665c52a1bd.pyi
Normal file
44
Test/BuddyTest/temp/b5f1dc665c52a1bd.pyi
Normal 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: t.CArray[str]) -> int: pass
|
||||
138
Test/BuddyTest/temp/bbdf3bbd4c3bc28c.pyi
Normal file
138
Test/BuddyTest/temp/bbdf3bbd4c3bc28c.pyi
Normal 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
|
||||
21
Test/BuddyTest/temp/c53a157505aa8081.pyi
Normal file
21
Test/BuddyTest/temp/c53a157505aa8081.pyi
Normal file
@@ -0,0 +1,21 @@
|
||||
"""
|
||||
Auto-generated Python stub file from mbuddytest.py
|
||||
Module: mbuddytest
|
||||
"""
|
||||
|
||||
|
||||
import t, c
|
||||
from t import CInt, CPtr, CChar, CUInt8T, CUInt32T, CUInt64T, CSizeT
|
||||
import viperlib
|
||||
import viperio
|
||||
import stdlib
|
||||
import mbuddy
|
||||
import string
|
||||
import testcheck
|
||||
import w32.win32process
|
||||
import w32.win32sync
|
||||
import w32.win32base
|
||||
|
||||
def _thread_alloc_free(param: t.CVoid | t.CPtr) -> t.CUInt32T: pass
|
||||
|
||||
def mbuddy_main() -> CInt: pass
|
||||
22
Test/BuddyTest/temp/c9f4be41ca1cc2b4.pyi
Normal file
22
Test/BuddyTest/temp/c9f4be41ca1cc2b4.pyi
Normal 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
|
||||
48
Test/BuddyTest/temp/e1937873ebfba8c3.pyi
Normal file
48
Test/BuddyTest/temp/e1937873ebfba8c3.pyi
Normal file
@@ -0,0 +1,48 @@
|
||||
"""
|
||||
Auto-generated Python stub file from mbuddy.py
|
||||
Module: mbuddy
|
||||
"""
|
||||
|
||||
|
||||
import t, c
|
||||
from stdint import *
|
||||
import string
|
||||
import atom
|
||||
|
||||
MBUDDY_MIN_BLOCK: t.CDefine = 32 # 最小块大小 (字节),需 >= 16 以容纳链表指针
|
||||
MBUDDY_MAX_ORDERS: t.CDefine = 32 # 最大阶数数量
|
||||
MBUDDY_HEADER_SIZE: t.CDefine = 8 # 块头大小 (存储阶数)
|
||||
|
||||
def _largest_pow2_le(val: t.CSizeT) -> t.CSizeT: pass
|
||||
|
||||
def _block_size_at_order(order: t.CInt) -> t.CSizeT: pass
|
||||
|
||||
|
||||
class MBuddy:
|
||||
mem: t.CVoid | t.CPtr
|
||||
mem_size: t.CSizeT
|
||||
max_order: t.CInt
|
||||
free_lists: t.CUInt64T | t.CPtr
|
||||
lock_val: t.CVolatile | t.CInt
|
||||
def __init__(self: MBuddy, arena: t.CVoid | t.CPtr, arena_size: t.CSizeT) -> t.CInt: pass
|
||||
def __enter__(self: MBuddy) -> 'MBuddy' | t.CPtr: pass
|
||||
def __exit__(self: MBuddy) -> t.CInt: pass
|
||||
def reset(self: MBuddy) -> t.CInt: pass
|
||||
def _fl_push(self: MBuddy, order: t.CInt, block: t.CVoid | t.CPtr) -> t.CInt: pass
|
||||
def _fl_pop(self: MBuddy, order: t.CInt) -> t.CVoid | t.CPtr: pass
|
||||
def _fl_find_and_remove(self: MBuddy, order: t.CInt, target: t.CVoid | t.CPtr) -> t.CInt: pass
|
||||
def _buddy_of(self: MBuddy, block: t.CVoid | t.CPtr, order: t.CInt) -> t.CVoid | t.CPtr: pass
|
||||
def _order_for_size(self: MBuddy, size: t.CSizeT) -> t.CInt: pass
|
||||
def _split_to_order(self: MBuddy, to_order: t.CInt) -> t.CVoid | t.CPtr: pass
|
||||
def _coalesce(self: MBuddy, block: t.CVoid | t.CPtr, order: t.CInt) -> t.CInt: pass
|
||||
def _is_valid_ptr(self: MBuddy, ptr: t.CVoid | t.CPtr) -> t.CInt: pass
|
||||
def _fl_count(self: MBuddy, order: t.CInt) -> t.CSizeT: pass
|
||||
def _lock(self: MBuddy) -> t.CInt: pass
|
||||
def _unlock(self: MBuddy) -> t.CInt: pass
|
||||
def alloc(self: MBuddy, size: t.CSizeT) -> t.CVoid | t.CPtr: pass
|
||||
def free(self: MBuddy, ptr: t.CVoid | t.CPtr) -> t.CInt: pass
|
||||
def calloc(self: MBuddy, count: t.CSizeT, size: t.CSizeT) -> t.CVoid | t.CPtr: pass
|
||||
def realloc(self: MBuddy, ptr: t.CVoid | t.CPtr, new_size: t.CSizeT) -> t.CVoid | t.CPtr: pass
|
||||
def stats(self: MBuddy) -> t.CSizeT: pass
|
||||
def free_count(self: MBuddy) -> t.CSizeT: pass
|
||||
def self_check(self: MBuddy) -> t.CInt: pass
|
||||
80
Test/BuddyTest/temp/fa3691e66b426950.pyi
Normal file
80
Test/BuddyTest/temp/fa3691e66b426950.pyi
Normal 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
|
||||
Reference in New Issue
Block a user