补充
This commit is contained in:
391
BenchmarkProject/App/benchmark_main.py
Normal file
391
BenchmarkProject/App/benchmark_main.py
Normal file
@@ -0,0 +1,391 @@
|
||||
from stdlib import malloc, free
|
||||
from stdint import *
|
||||
import string
|
||||
import w32.win32console
|
||||
from stdarg import va_start, va_end, va_arg, va_list
|
||||
import t
|
||||
import c
|
||||
|
||||
|
||||
class Struct1:
|
||||
a: UINT
|
||||
b: UINT = 123
|
||||
|
||||
|
||||
class Item:
|
||||
data: t.CVoid | t.CPtr
|
||||
size: t.CSizeT
|
||||
|
||||
|
||||
class List:
|
||||
items: Item | t.CPtr
|
||||
count: t.CSizeT = 0
|
||||
capacity: t.CSizeT = 4
|
||||
|
||||
def __init__(self):
|
||||
self.count = 0
|
||||
self.capacity = 4
|
||||
self.items = malloc(self.capacity * Item.__sizeof__())
|
||||
|
||||
def append(self, data: t.CVoid | t.CPtr, size: t.CSizeT):
|
||||
self.count += 1
|
||||
item: Item | t.CPtr = self.items[self.count - 1]
|
||||
item.size = size
|
||||
item.data = malloc(size + 1)
|
||||
memcpy(item.data, data, size)
|
||||
|
||||
def get(self, index: t.CSizeT) -> t.CInt8T | t.CPtr:
|
||||
if index >= self.count:
|
||||
return None
|
||||
return self.items[index].data
|
||||
|
||||
def free(self):
|
||||
i: t.CSizeT = 0
|
||||
for i in range(self.count):
|
||||
if self.items[i].data != 0:
|
||||
free(self.items[i].data)
|
||||
free(self.items)
|
||||
|
||||
|
||||
class EnumTest(t.CEnum):
|
||||
A: c.State
|
||||
B: c.State
|
||||
C: c.State
|
||||
Len: c.State
|
||||
|
||||
|
||||
@t.Object
|
||||
class OOPTest:
|
||||
a: UINT
|
||||
b: UINT = 12345
|
||||
c: UINT
|
||||
|
||||
def __init__(self):
|
||||
self.a = 451
|
||||
|
||||
def set_c(self, v: UINT):
|
||||
self.c = v
|
||||
|
||||
def __call__(self, a: UINT, b: UINT) -> UINT:
|
||||
return a + b
|
||||
|
||||
def __enter__(self) -> 'OOPTest' | t.CPtr:
|
||||
return self
|
||||
|
||||
def __exit__(self):
|
||||
self.a = 99
|
||||
self.b = 99
|
||||
self.c = 99
|
||||
|
||||
def __add__(self, other: 'OOPTest' | t.CPtr) -> 'OOPTest' | t.CPtr:
|
||||
s = OOPTest()
|
||||
s.a = (self.a + other.a)
|
||||
return s
|
||||
|
||||
def __str__(self) -> str:
|
||||
return f"OOPTest ({self.a}) ({self.b}) ({self.c})"
|
||||
|
||||
def __bool__(self) -> bool:
|
||||
return bool(self.a != 0)
|
||||
|
||||
def __len__(self) -> UINT:
|
||||
return self.a
|
||||
|
||||
|
||||
@t.Object
|
||||
class RangeOOPSimulation:
|
||||
start: UINT
|
||||
end: UINT
|
||||
|
||||
def __init__(self, start: UINT, end: UINT):
|
||||
self.start = start
|
||||
self.end = end
|
||||
|
||||
def __iter__(self) -> 'RangeOOPSimulation' | t.CPtr:
|
||||
return self
|
||||
|
||||
def __next__(self) -> UINT:
|
||||
if self.start >= self.end:
|
||||
raise StopIteration
|
||||
self.start += 1
|
||||
return self.start - 1
|
||||
|
||||
|
||||
GLOBAL_VAR: t.CInt = 0
|
||||
|
||||
|
||||
def rebutnotreGLOBAL_VAR() -> t.CInt:
|
||||
GLOBAL_VAR = 100
|
||||
|
||||
|
||||
def reGLOBAL_VAR() -> t.CInt:
|
||||
global GLOBAL_VAR
|
||||
GLOBAL_VAR = 100
|
||||
|
||||
|
||||
def function2function() -> t.CInt:
|
||||
def func() -> t.CInt:
|
||||
x = 1000
|
||||
|
||||
def func2() -> t.CInt:
|
||||
nonlocal x
|
||||
x = 1000000
|
||||
|
||||
func2()
|
||||
return x
|
||||
|
||||
return func()
|
||||
|
||||
|
||||
def manyreturn() -> tuple[t.CInt, t.CInt]:
|
||||
return 114, 514
|
||||
|
||||
|
||||
def str_to_hex(s: str) -> str:
|
||||
buf: str = malloc(1024)
|
||||
out: str = buf
|
||||
hex_chars: list[t.CChar, None] = "0123456789ABCDEF"
|
||||
while c.Cast(s) != 0:
|
||||
cr: t.CUnsignedChar = c.CCast(s)
|
||||
c.Set(c.CCast(out), hex_chars[(cr >> 4) & 0xF])
|
||||
out += 1
|
||||
c.Set(c.CCast(out), hex_chars[cr & 0xF])
|
||||
out += 1
|
||||
s += 1
|
||||
c.Set(c.CCast(out), 0)
|
||||
return buf
|
||||
|
||||
|
||||
def int_to_hex(num: int) -> str:
|
||||
buf = t.CChar(malloc(128), t.CPtr)
|
||||
if not buf:
|
||||
return None
|
||||
|
||||
hex_chars: list[t.CChar, None] = "0123456789ABCDEF"
|
||||
i = 0
|
||||
|
||||
buf[i] = '0'
|
||||
buf[i + 1] = 'x'
|
||||
i += 2
|
||||
|
||||
if num == 0:
|
||||
buf[i] = '0'
|
||||
i += 1
|
||||
buf[i] = '0'
|
||||
i += 1
|
||||
buf[i] = '\0'
|
||||
return buf
|
||||
|
||||
temp: list[t.CChar, 32]
|
||||
temp_idx = 0
|
||||
|
||||
n: t.CUnsignedInt = t.CUnsignedInt(num)
|
||||
|
||||
while n > 0:
|
||||
rem: t.CInt = n & 0xF
|
||||
temp[temp_idx] = hex_chars[rem]
|
||||
temp_idx += 1
|
||||
n = n >> 4
|
||||
|
||||
while temp_idx > 0:
|
||||
temp_idx -= 1
|
||||
buf[i] = temp[temp_idx]
|
||||
i += 1
|
||||
|
||||
buf[i] = '\0'
|
||||
return buf
|
||||
|
||||
|
||||
def int_to_str(num: int) -> str:
|
||||
buf: t.CChar | t.CPtr = t.CChar(malloc(128), t.CPtr)
|
||||
if not buf:
|
||||
return None
|
||||
is_negative = 0
|
||||
i = 0
|
||||
if num == 0:
|
||||
buf[i] = '0'
|
||||
i += 1
|
||||
buf[i] = '\0'
|
||||
return buf
|
||||
if num < 0:
|
||||
is_negative = 1
|
||||
num = -num
|
||||
while num > 0:
|
||||
rem = num % 10
|
||||
buf[i] = '0' + rem
|
||||
i += 1
|
||||
num = num / 10
|
||||
if is_negative:
|
||||
buf[i] = '-'
|
||||
i += 1
|
||||
buf[i] = '\0'
|
||||
start = 0
|
||||
end = i - 1
|
||||
while start < end:
|
||||
tr: t.CChar = buf[start]
|
||||
buf[start] = buf[end]
|
||||
buf[end] = tr
|
||||
start += 1
|
||||
end -= 1
|
||||
return buf
|
||||
|
||||
|
||||
def main():
|
||||
w32.win32console.SetConsoleOutputCP(65001)
|
||||
w32.win32console.SetConsoleCP(65001)
|
||||
|
||||
print("============== BENCHMARK 1: Structures & OOP ==============")
|
||||
|
||||
print("\nTesting Struct1:")
|
||||
s1_: Struct1 = Struct1(10)
|
||||
print("s1_.a:", s1_.a)
|
||||
print("s1_.b:", s1_.b)
|
||||
|
||||
print("\nTesting OOPTest class:")
|
||||
d = OOPTest()
|
||||
d.set_c(100)
|
||||
d.a = 1
|
||||
print("d.a:", d.a)
|
||||
print("d.b:", d.b)
|
||||
print("d.c:", d.c)
|
||||
|
||||
print("\nTesting __call__ (d(1, 2)):")
|
||||
print("d(1, 2):", d(1, 2))
|
||||
|
||||
print("\nTesting __bool__:")
|
||||
if d:
|
||||
print("d is truthy (d.a != 0)")
|
||||
else:
|
||||
print("d is falsy (d.a == 0)")
|
||||
|
||||
print("\nTesting __len__:")
|
||||
print("len(d):", len(d))
|
||||
|
||||
print("\nTesting __str__:")
|
||||
print("str(d):", str(d))
|
||||
|
||||
print("\nTesting __add__:")
|
||||
l = OOPTest()
|
||||
l.a = 100
|
||||
result = d + l
|
||||
print("(d + l).a:", result.a)
|
||||
free(l)
|
||||
free(result)
|
||||
|
||||
print("\nTesting context manager (with statement):")
|
||||
with OOPTest() as d2:
|
||||
print("Inside with block, d2(1, 2):", d2(1, 2))
|
||||
print("After exit, d2.__str__():", str(d2))
|
||||
|
||||
print("\nTesting List class:")
|
||||
l = List()
|
||||
nihao = "你好!世界"
|
||||
l.append(c.Addr(114514), t.CInt.__sizeof__())
|
||||
l.append(nihao, len(nihao))
|
||||
print("List count:", l.count)
|
||||
l.free()
|
||||
|
||||
print("\n============== BENCHMARK 2: Global Variables & Functions ==============")
|
||||
|
||||
print("\nTesting global variable re-assignment:")
|
||||
print("Initial GLOBAL_VAR:", GLOBAL_VAR)
|
||||
rebutnotreGLOBAL_VAR()
|
||||
print("After rebutnotreGLOBAL_VAR():", GLOBAL_VAR)
|
||||
reGLOBAL_VAR()
|
||||
print("After reGLOBAL_VAR():", GLOBAL_VAR)
|
||||
|
||||
print("\nTesting function2function with nonlocal:")
|
||||
print("function2function():", function2function())
|
||||
|
||||
print("\nTesting tuple return:")
|
||||
a: t.CInt
|
||||
b: t.CInt
|
||||
a, b = manyreturn()
|
||||
print("manyreturn():", a, b)
|
||||
|
||||
print("\nTesting walrus operator:")
|
||||
kkkkk = 0
|
||||
if not GLOBAL_VAR or (kkkkk := 1):
|
||||
print("GLOBAL_VAR is 0, kkkkk:", kkkkk)
|
||||
print("Final kkkkk:", kkkkk)
|
||||
|
||||
print("\n============== BENCHMARK 3: Memory & Pointers ==============")
|
||||
|
||||
print("\nTesting malloc/free:")
|
||||
p2 = malloc(100)
|
||||
i: t.CInt = 0
|
||||
while i <= 100:
|
||||
p2[i] = 4
|
||||
i += 1
|
||||
all_four = 1
|
||||
for i in range(0, 100 + 1):
|
||||
if p2[i] != 4:
|
||||
all_four = 0
|
||||
break
|
||||
if all_four:
|
||||
print("All 4 - Memory write/read verified")
|
||||
free(p2)
|
||||
|
||||
print("\nTesting for loop with range:")
|
||||
add_num = 0
|
||||
for i in range(0, 100 + 1):
|
||||
add_num += 1
|
||||
print("i:", i, "add_num:", add_num)
|
||||
|
||||
print("\nTesting for loop with continue:")
|
||||
lll = 0
|
||||
for i in range(0, 10 + 1):
|
||||
if i % 2 != 0:
|
||||
continue
|
||||
lll += i
|
||||
print("Sum of even numbers 0-10:", lll)
|
||||
|
||||
print("\n============== BENCHMARK 4: Iteration & Strings ==============")
|
||||
|
||||
print("\nTesting RangeOOPSimulation (custom iterator):")
|
||||
print("Iterating RangeOOPSimulation(0, 6):")
|
||||
for i in RangeOOPSimulation(0, 6):
|
||||
print("RangeOOPSimulation item:", i)
|
||||
|
||||
print("\nTesting str_to_hex:")
|
||||
hex_str = str_to_hex("ABCDEF")
|
||||
print("hex of ABCDEF:", hex_str)
|
||||
free(hex_str)
|
||||
|
||||
print("\nTesting int_to_hex:")
|
||||
hex_num = int_to_hex(255)
|
||||
print("hex of 255:", hex_num)
|
||||
free(hex_num)
|
||||
|
||||
print("\nTesting int_to_str:")
|
||||
num_str = int_to_str(-12345)
|
||||
print("str of -12345:", num_str)
|
||||
free(num_str)
|
||||
|
||||
print("\nTesting f-string with Chinese characters:")
|
||||
chinese = "你好"
|
||||
print(f"{chinese},世界")
|
||||
|
||||
print("\n============== BENCHMARK 5: Exception Handling ==============")
|
||||
|
||||
print("\nTesting try/except/else/finally:")
|
||||
try:
|
||||
print("In try block")
|
||||
assert 1 != 1, "1 == 1"
|
||||
print("This should not print")
|
||||
except AssertionError as e:
|
||||
print("AssertionError caught:", e)
|
||||
except ValueError as e:
|
||||
print("ValueError caught:", e)
|
||||
else:
|
||||
print("No exception in try block")
|
||||
finally:
|
||||
print("Finally block executed")
|
||||
|
||||
free(d)
|
||||
free(d2)
|
||||
|
||||
print("\n============== All Benchmarks Completed ==============")
|
||||
|
||||
|
||||
main()
|
||||
25
BenchmarkProject/project.json
Normal file
25
BenchmarkProject/project.json
Normal file
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"$schema": "https://raw.githubusercontent.com/TermiNexus/TransPyC/main/schemas/project-schema.json",
|
||||
"name": "BenchmarkProject",
|
||||
"version": "1.0.0",
|
||||
"source_dir": "./App",
|
||||
"temp_dir": "./temp",
|
||||
"output_dir": "./output",
|
||||
"compiler": {
|
||||
"cmd": "llc",
|
||||
"flags": ["-filetype=obj"]
|
||||
},
|
||||
"linker": {
|
||||
"cmd": "clang++",
|
||||
"flags": ["-lmsvcrt", "-lucrt", "-lpthread"],
|
||||
"output": "BenchmarkProject.exe"
|
||||
},
|
||||
"includes": [
|
||||
"./includes"
|
||||
],
|
||||
"options": {
|
||||
"slice_level": 3,
|
||||
"target": "llvm",
|
||||
"strict_mode": true
|
||||
}
|
||||
}
|
||||
18
BenchmarkProject/temp/0a468e9defed89b4.pyi
Normal file
18
BenchmarkProject/temp/0a468e9defed89b4.pyi
Normal file
@@ -0,0 +1,18 @@
|
||||
"""
|
||||
Auto-generated Python stub file from win32.win32console.py
|
||||
Module: win32.win32console
|
||||
"""
|
||||
|
||||
|
||||
c.CIfndef(__WIN32.WIN32CONSOLE_DEFINE__)
|
||||
__WIN32.WIN32CONSOLE_DEFINE__: t.CDefine
|
||||
|
||||
from stdint import *
|
||||
import t, c
|
||||
|
||||
def SetConsoleOutputCP(codepage: UINT) -> BOOL | c.State: pass
|
||||
|
||||
def SetConsoleCP(codepage: UINT) -> BOOL | c.State: pass
|
||||
|
||||
|
||||
c.CEndif()
|
||||
60
BenchmarkProject/temp/0fe4ed83e40705a3.pyi
Normal file
60
BenchmarkProject/temp/0fe4ed83e40705a3.pyi
Normal file
@@ -0,0 +1,60 @@
|
||||
"""
|
||||
Auto-generated Python stub file from stdint.py
|
||||
Module: stdint
|
||||
"""
|
||||
|
||||
import c
|
||||
|
||||
|
||||
c.CIfndef(__STDINT_DEFINE__)
|
||||
__STDINT_DEFINE__: t.CDefine
|
||||
|
||||
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 = t.CChar | t.CPtr[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
|
||||
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
|
||||
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
|
||||
|
||||
c.CEndif()
|
||||
20
BenchmarkProject/temp/35b3672a3f08a5f6.pyi
Normal file
20
BenchmarkProject/temp/35b3672a3f08a5f6.pyi
Normal file
@@ -0,0 +1,20 @@
|
||||
"""
|
||||
Auto-generated Python stub file from stdlib.py
|
||||
Module: stdlib
|
||||
"""
|
||||
|
||||
|
||||
c.CIfndef(__STDLIB_DEFINE__)
|
||||
__STDLIB_DEFINE__: t.CDefine
|
||||
|
||||
from stdint import *
|
||||
import t, c
|
||||
|
||||
def malloc(size: UINT) -> t.CVoid | t.CPtr | c.State: pass
|
||||
|
||||
def realloc(p: str, p2: t.CLong | t.CLong) -> t.CVoid | t.CPtr | c.State: pass
|
||||
|
||||
def free(p: t.CVoid | t.CPtr) -> None | c.State: pass
|
||||
|
||||
|
||||
c.CEndif()
|
||||
21
BenchmarkProject/temp/6185874d64b55d5f.pyi
Normal file
21
BenchmarkProject/temp/6185874d64b55d5f.pyi
Normal file
@@ -0,0 +1,21 @@
|
||||
"""
|
||||
Auto-generated Python stub file from stdarg.py
|
||||
Module: stdarg
|
||||
"""
|
||||
|
||||
|
||||
c.CIfndef(__STDARG_DEFINE__)
|
||||
__STDARG_DEFINE__: t.CDefine
|
||||
|
||||
import t, c
|
||||
|
||||
def va_start(args: t.CPtr, last_arg: t.CPtr) -> c.State: pass
|
||||
|
||||
def va_arg(args: t.CPtr, type: t.CType) -> t.CType | c.State: pass
|
||||
|
||||
def va_end(args: t.CPtr) -> c.State: pass
|
||||
|
||||
|
||||
va_list: t.CTypedef = t.CUnsignedChar | t.CPtr
|
||||
|
||||
c.CEndif()
|
||||
39
BenchmarkProject/temp/89a417151096c9c8.pyi
Normal file
39
BenchmarkProject/temp/89a417151096c9c8.pyi
Normal file
@@ -0,0 +1,39 @@
|
||||
"""
|
||||
Auto-generated Python stub file from string.py
|
||||
Module: string
|
||||
"""
|
||||
|
||||
|
||||
c.CIfndef(__STRING_DEFINE__)
|
||||
__STRING_DEFINE__: t.CDefine
|
||||
|
||||
import t, c
|
||||
|
||||
def strcpy(dest: t.CChar | t.CPtr, src: t.CConst | t.CChar | t.CPtr) -> t.CChar | t.CPtr | c.State: pass
|
||||
|
||||
def strncpy(dest: t.CChar | t.CPtr, src: t.CConst | t.CChar | t.CPtr, n: t.CSizeT) -> t.CChar | t.CPtr | c.State: pass
|
||||
|
||||
def strlen(str: t.CConst | t.CChar | t.CPtr) -> t.CSizeT | c.State: pass
|
||||
|
||||
def strcmp(str1: t.CConst | t.CChar | t.CPtr, str2: t.CConst | t.CChar | t.CPtr) -> t.CInt | c.State: pass
|
||||
|
||||
def strncmp(str1: t.CConst | t.CChar | t.CPtr, str2: t.CConst | t.CChar | t.CPtr, n: t.CSizeT) -> t.CInt | c.State: pass
|
||||
|
||||
def memcmp(ptr1: t.CConst | t.CVoid | t.CPtr, ptr2: t.CConst | t.CVoid | t.CPtr, n: t.CSizeT) -> t.CInt | c.State: pass
|
||||
|
||||
def strchr(str: t.CConst | t.CChar | t.CPtr, cr: t.CInt) -> t.CChar | t.CPtr | c.State: pass
|
||||
|
||||
def strrchr(str: t.CConst | t.CChar | t.CPtr, cr: t.CInt) -> t.CChar | t.CPtr | c.State: pass
|
||||
|
||||
def memset(ptr: t.CVoid | t.CPtr, value: t.CInt, num: t.CSizeT) -> t.CVoid | t.CPtr | c.State: pass
|
||||
|
||||
def memcpy(dest: t.CVoid | t.CPtr, src: t.CConst | t.CVoid | t.CPtr, num: t.CSizeT) -> t.CVoid | t.CPtr | c.State: pass
|
||||
|
||||
def memmove(dest: t.CVoid | t.CPtr, src: t.CConst | t.CVoid | t.CPtr, num: t.CSizeT) -> t.CVoid | t.CPtr | c.State: pass
|
||||
|
||||
def atoi(s: str) -> t.CInt | c.State: pass
|
||||
|
||||
def snprintf(buf: t.CChar | t.CPtr, size: t.CSizeT, fmt: t.CConst | t.CChar | t.CPtr, *args) -> t.CInt | c.State: pass
|
||||
|
||||
|
||||
c.CEndif()
|
||||
6
BenchmarkProject/temp/_sha1_map.txt
Normal file
6
BenchmarkProject/temp/_sha1_map.txt
Normal file
@@ -0,0 +1,6 @@
|
||||
0a468e9defed89b4:includes/win32\win32console.pyi
|
||||
0fe4ed83e40705a3:includes/stdint.pyi
|
||||
35b3672a3f08a5f6:includes/stdlib.pyi
|
||||
6185874d64b55d5f:includes/stdarg.pyi
|
||||
89a417151096c9c8:includes/string.pyi
|
||||
a5c3e35ade4bf308:benchmark_main.py
|
||||
78
BenchmarkProject/temp/a5c3e35ade4bf308.pyi
Normal file
78
BenchmarkProject/temp/a5c3e35ade4bf308.pyi
Normal file
@@ -0,0 +1,78 @@
|
||||
"""
|
||||
Auto-generated Python stub file from benchmark_main.py
|
||||
Module: benchmark_main
|
||||
"""
|
||||
|
||||
|
||||
c.CIfndef(__BENCHMARK_MAIN_DEFINE__)
|
||||
__BENCHMARK_MAIN_DEFINE__: t.CDefine
|
||||
|
||||
from stdlib import malloc, free
|
||||
from stdint import *
|
||||
import string
|
||||
import win32.win32console
|
||||
from stdarg import va_start, va_end, va_arg, va_list
|
||||
import t
|
||||
import c
|
||||
|
||||
class Struct1:
|
||||
a: UINT
|
||||
b: UINT
|
||||
class Item:
|
||||
data: t.CVoid | t.CPtr
|
||||
size: t.CSizeT
|
||||
class List:
|
||||
items: Item | t.CPtr
|
||||
count: t.CSizeT
|
||||
capacity: t.CSizeT
|
||||
def __init__(self: List) -> t.CVoid | c.State: pass
|
||||
def append(self: List, data: t.CVoid | t.CPtr, size: t.CSizeT) -> t.CVoid | c.State: pass
|
||||
def get(self: List, index: t.CSizeT) -> t.CInt8T | t.CPtr | c.State: pass
|
||||
def free(self: List) -> t.CVoid | c.State: pass
|
||||
class EnumTest(t.CEnum):
|
||||
A: c.State
|
||||
B: c.State
|
||||
C: c.State
|
||||
Len: c.State
|
||||
@t.CPythonObject
|
||||
class OOPTest:
|
||||
a: UINT
|
||||
b: UINT
|
||||
c: UINT
|
||||
def __init__(self: OOPTest) -> t.CVoid | c.State: pass
|
||||
def set_c(self: OOPTest, v: UINT) -> t.CVoid | c.State: pass
|
||||
def __call__(self: OOPTest, a: UINT, b: UINT) -> UINT | c.State: pass
|
||||
def __enter__(self: OOPTest) -> 'OOPTest' | t.CPtr | c.State: pass
|
||||
def __exit__(self: OOPTest) -> t.CVoid | c.State: pass
|
||||
def __add__(self: OOPTest, other: 'OOPTest' | t.CPtr) -> 'OOPTest' | t.CPtr | c.State: pass
|
||||
def __str__(self: OOPTest) -> str | c.State: pass
|
||||
def __bool__(self: OOPTest) -> bool | c.State: pass
|
||||
def __len__(self: OOPTest) -> UINT | c.State: pass
|
||||
@t.CPythonObject
|
||||
class RangeOOPSimulation:
|
||||
start: UINT
|
||||
end: UINT
|
||||
def __init__(self: RangeOOPSimulation, start: UINT, end: UINT) -> t.CVoid | c.State: pass
|
||||
def __iter__(self: RangeOOPSimulation) -> 'RangeOOPSimulation' | t.CPtr | c.State: pass
|
||||
def __next__(self: RangeOOPSimulation) -> UINT | c.State: pass
|
||||
|
||||
GLOBAL_VAR: t.CExtern | t.CInt
|
||||
|
||||
def rebutnotreGLOBAL_VAR() -> t.CInt | c.State: pass
|
||||
|
||||
def reGLOBAL_VAR() -> t.CInt | c.State: pass
|
||||
|
||||
def function2function() -> t.CInt | c.State: pass
|
||||
|
||||
def manyreturn() -> tuple[t.CInt, t.CInt] | c.State: pass
|
||||
|
||||
def str_to_hex(s: str) -> str | c.State: pass
|
||||
|
||||
def int_to_hex(num: int) -> str | c.State: pass
|
||||
|
||||
def int_to_str(num: int) -> str | c.State: pass
|
||||
|
||||
def main() -> t.CVoid | c.State: pass
|
||||
|
||||
|
||||
c.CEndif()
|
||||
Reference in New Issue
Block a user