snapshot before regression test
This commit is contained in:
205
Test/ArgparseTest/App/main.py
Normal file
205
Test/ArgparseTest/App/main.py
Normal file
@@ -0,0 +1,205 @@
|
||||
import t, c
|
||||
from stdint import *
|
||||
import stdio
|
||||
import stdlib
|
||||
import string
|
||||
import memhub
|
||||
import argparse
|
||||
import testcheck
|
||||
|
||||
|
||||
# 全局 MBuddy 指针
|
||||
_mbuddy: memhub.MemBuddy | t.CPtr
|
||||
|
||||
|
||||
@t.CExport
|
||||
def main() -> int:
|
||||
testcheck.begin("ArgparseTest: 命令行参数解析")
|
||||
|
||||
# 初始化内存管理器
|
||||
arena: bytes = stdlib.malloc(16 * 1024 * 1024)
|
||||
if arena is None:
|
||||
testcheck.fail("malloc arena failed")
|
||||
return 1
|
||||
|
||||
_mbuddy = memhub.MemBuddy(arena, 16 * 1024 * 1024)
|
||||
argparse._mbuddy = _mbuddy
|
||||
|
||||
# 构造模拟 argv: myprog --input test.txt -c 42 --verbose output.dat
|
||||
argv_buf: bytes = _mbuddy.alloc(8 * 7) # 7 个指针
|
||||
argv: str | t.CPtr = argv_buf
|
||||
|
||||
# argv[0] = "myprog"
|
||||
s0: bytes = _mbuddy.alloc(16)
|
||||
string.strcpy(s0, "myprog")
|
||||
argv0: str | t.CPtr = t.CPtr(t.CUInt64T(argv))
|
||||
argv0[0] = s0
|
||||
|
||||
# argv[1] = "--input"
|
||||
s1: bytes = _mbuddy.alloc(16)
|
||||
string.strcpy(s1, "--input")
|
||||
argv1: str | t.CPtr = t.CPtr(t.CUInt64T(argv) + 8)
|
||||
argv1[0] = s1
|
||||
|
||||
# argv[2] = "test.txt"
|
||||
s2: bytes = _mbuddy.alloc(16)
|
||||
string.strcpy(s2, "test.txt")
|
||||
argv2: str | t.CPtr = t.CPtr(t.CUInt64T(argv) + 16)
|
||||
argv2[0] = s2
|
||||
|
||||
# argv[3] = "-c"
|
||||
s3: bytes = _mbuddy.alloc(8)
|
||||
string.strcpy(s3, "-c")
|
||||
argv3: str | t.CPtr = t.CPtr(t.CUInt64T(argv) + 24)
|
||||
argv3[0] = s3
|
||||
|
||||
# argv[4] = "42"
|
||||
s4: bytes = _mbuddy.alloc(8)
|
||||
string.strcpy(s4, "42")
|
||||
argv4: str | t.CPtr = t.CPtr(t.CUInt64T(argv) + 32)
|
||||
argv4[0] = s4
|
||||
|
||||
# argv[5] = "--verbose"
|
||||
s5: bytes = _mbuddy.alloc(16)
|
||||
string.strcpy(s5, "--verbose")
|
||||
argv5: str | t.CPtr = t.CPtr(t.CUInt64T(argv) + 40)
|
||||
argv5[0] = s5
|
||||
|
||||
# argv[6] = "output.dat"
|
||||
s6: bytes = _mbuddy.alloc(16)
|
||||
string.strcpy(s6, "output.dat")
|
||||
argv6: str | t.CPtr = t.CPtr(t.CUInt64T(argv) + 48)
|
||||
argv6[0] = s6
|
||||
|
||||
argc: INT = 7
|
||||
|
||||
# ============================================================
|
||||
# Test 1: 基本解析 (--input, -c, --verbose, output)
|
||||
# ============================================================
|
||||
testcheck.section("Test 1: 基本解析")
|
||||
parser = argparse.ArgumentParser("myprog", "A test program for argparse", pool=_mbuddy)
|
||||
parser.add_argument("--input", "-i", argparse.STRING, 0, None, True, argparse.STORE, "input file path")
|
||||
parser.add_argument("--count", "-c", argparse.INT, 1, None, False, argparse.STORE, "repeat count")
|
||||
parser.add_argument("--verbose", "-v", argparse.BOOL, 0, None, False, argparse.STORE_TRUE, "enable verbose output")
|
||||
parser.add_argument("output", None, argparse.STRING, 0, None, False, argparse.STORE, "output file path")
|
||||
|
||||
args = parser.parse_args(argc, argv)
|
||||
if args is not None:
|
||||
testcheck.ok("parse_args returned non-NULL")
|
||||
inp: str = args.get_str("input")
|
||||
cnt: INT = args.get_int("count")
|
||||
verb: INT = args.get_bool("verbose")
|
||||
out: str = args.get_str("output")
|
||||
stdio.printf("[DBG] has(verbose)=%d, get_bool(verbose)=%d\n", 1 if args.has("verbose") else 0, 1 if verb else 0)
|
||||
testcheck.check(string.strcmp(inp, "test.txt") == 0, "input = test.txt", "input mismatch")
|
||||
testcheck.check(cnt == 42, "count = 42", "count mismatch")
|
||||
testcheck.check(verb == True, "verbose = True", "verbose mismatch")
|
||||
testcheck.check(string.strcmp(out, "output.dat") == 0, "output = output.dat", "output mismatch")
|
||||
argparse.release(args)
|
||||
else:
|
||||
testcheck.fail("parse_args returned NULL")
|
||||
|
||||
# ============================================================
|
||||
# Test 2: --name=value 语法
|
||||
# ============================================================
|
||||
testcheck.section("Test 2: --name=value 语法")
|
||||
|
||||
argv2_buf: bytes = _mbuddy.alloc(8 * 3)
|
||||
argv2: str | t.CPtr = argv2_buf
|
||||
|
||||
a0: bytes = _mbuddy.alloc(16)
|
||||
string.strcpy(a0, "myprog")
|
||||
a0_ptr: str | t.CPtr = t.CPtr(t.CUInt64T(argv2))
|
||||
a0_ptr[0] = a0
|
||||
|
||||
a1: bytes = _mbuddy.alloc(32)
|
||||
string.strcpy(a1, "--input=hello.txt")
|
||||
a1_ptr: str | t.CPtr = t.CPtr(t.CUInt64T(argv2) + 8)
|
||||
a1_ptr[0] = a1
|
||||
|
||||
a2: bytes = _mbuddy.alloc(16)
|
||||
string.strcpy(a2, "output2.dat")
|
||||
a2_ptr: str | t.CPtr = t.CPtr(t.CUInt64T(argv2) + 16)
|
||||
a2_ptr[0] = a2
|
||||
|
||||
args2 = parser.parse_args(3, argv2)
|
||||
if args2 is not None:
|
||||
testcheck.ok("parse_args returned non-NULL")
|
||||
inp2: str = args2.get_str("input")
|
||||
cnt2: INT = args2.get_int("count")
|
||||
out2: str = args2.get_str("output")
|
||||
testcheck.check(string.strcmp(inp2, "hello.txt") == 0, "input = hello.txt", "input mismatch")
|
||||
testcheck.check(cnt2 == 1, "count = 1 (default)", "count mismatch")
|
||||
testcheck.check(string.strcmp(out2, "output2.dat") == 0, "output = output2.dat", "output mismatch")
|
||||
argparse.release(args2)
|
||||
else:
|
||||
testcheck.fail("parse_args returned NULL")
|
||||
|
||||
# ============================================================
|
||||
# Test 3: -v COUNT 计数动作
|
||||
# ============================================================
|
||||
testcheck.section("Test 3: COUNT 计数动作")
|
||||
|
||||
argv3_buf: bytes = _mbuddy.alloc(8 * 4)
|
||||
argv3_arr: str | t.CPtr = argv3_buf
|
||||
|
||||
b0: bytes = _mbuddy.alloc(8)
|
||||
string.strcpy(b0, "myprog")
|
||||
b0_ptr: str | t.CPtr = t.CPtr(t.CUInt64T(argv3_arr))
|
||||
b0_ptr[0] = b0
|
||||
|
||||
b1: bytes = _mbuddy.alloc(8)
|
||||
string.strcpy(b1, "-v")
|
||||
b1_ptr: str | t.CPtr = t.CPtr(t.CUInt64T(argv3_arr) + 8)
|
||||
b1_ptr[0] = b1
|
||||
|
||||
b2: bytes = _mbuddy.alloc(8)
|
||||
string.strcpy(b2, "-v")
|
||||
b2_ptr: str | t.CPtr = t.CPtr(t.CUInt64T(argv3_arr) + 16)
|
||||
b2_ptr[0] = b2
|
||||
|
||||
b3: bytes = _mbuddy.alloc(16)
|
||||
string.strcpy(b3, "output3.dat")
|
||||
b3_ptr: str | t.CPtr = t.CPtr(t.CUInt64T(argv3_arr) + 24)
|
||||
b3_ptr[0] = b3
|
||||
|
||||
parser2 = argparse.ArgumentParser("myprog", "Count test", pool=_mbuddy)
|
||||
parser2.add_argument("--verbose", "-v", argparse.BOOL, 0, None, False, argparse.COUNT, "verbosity level")
|
||||
parser2.add_argument("output", None, argparse.STRING, 0, None, False, argparse.STORE, "output file")
|
||||
|
||||
args3 = parser2.parse_args(4, argv3_arr)
|
||||
if args3 is not None:
|
||||
testcheck.ok("parse_args returned non-NULL")
|
||||
verb3: INT = args3.get_int("verbose")
|
||||
out3: str = args3.get_str("output")
|
||||
testcheck.check(verb3 == 2, "verbose = 2 (counted)", "verbose count mismatch")
|
||||
testcheck.check(string.strcmp(out3, "output3.dat") == 0, "output = output3.dat", "output mismatch")
|
||||
argparse.release(args3)
|
||||
else:
|
||||
testcheck.fail("parse_args returned NULL")
|
||||
|
||||
# ============================================================
|
||||
# Test 4: 关键字参数调用 add_argument
|
||||
# ============================================================
|
||||
testcheck.section("Test 4: 关键字参数")
|
||||
|
||||
parser3 = argparse.ArgumentParser("myprog", "Keyword arg test", pool=_mbuddy)
|
||||
parser3.add_argument("--input", short="-i", arg_type=argparse.STRING, default=0, default_str=None, required=False, action=argparse.STORE, help="input file")
|
||||
parser3.add_argument("--count", short="-c", arg_type=argparse.INT, default=1, required=False, action=argparse.STORE, help="count")
|
||||
parser3.add_argument("--verbose", short="-v", arg_type=argparse.BOOL, default=0, required=False, action=argparse.STORE_TRUE, help="verbose")
|
||||
parser3.add_argument("output", arg_type=argparse.STRING, default=0, required=False, action=argparse.STORE, help="output file")
|
||||
|
||||
args4 = parser3.parse_args(argc, argv)
|
||||
if args4 is not None:
|
||||
testcheck.ok("parse_args returned non-NULL")
|
||||
inp4: str = args4.get_str("input")
|
||||
cnt4: INT = args4.get_int("count")
|
||||
out4: str = args4.get_str("output")
|
||||
testcheck.check(string.strcmp(inp4, "test.txt") == 0, "input = test.txt", "input mismatch")
|
||||
testcheck.check(cnt4 == 42, "count = 42", "count mismatch")
|
||||
testcheck.check(string.strcmp(out4, "output.dat") == 0, "output = output.dat", "output mismatch")
|
||||
argparse.release(args4)
|
||||
else:
|
||||
testcheck.fail("parse_args returned NULL")
|
||||
|
||||
return testcheck.end()
|
||||
1
Test/ArgparseTest/output/08ea5281873244fd.deps.json
Normal file
1
Test/ArgparseTest/output/08ea5281873244fd.deps.json
Normal file
@@ -0,0 +1 @@
|
||||
{"atom": "271ea3decb810db2", "stdio": "6f62fe05c5ea1ceb", "w32.win32base": "7e529fe7a078cfef", "win32base": "7e529fe7a078cfef", "stdlib": "90c53dd6db8d41cf", "string": "ab6e54ba9a669f76", "argparse": "aba439b7882ad9d6", "hashtable": "b8c66c8ff44eb874", "w32.win32console": "bbdf3bbd4c3bc28c", "win32console": "bbdf3bbd4c3bc28c", "viperio": "c9f4be41ca1cc2b4", "testcheck": "dd3002730623424b", "memhub": "ee084e9fc6ee413a", "stdint": "f5522571bcce7bcb"}
|
||||
30
Test/ArgparseTest/project.json
Normal file
30
Test/ArgparseTest/project.json
Normal file
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"$schema": "https://raw.githubusercontent.com/TermiNexus/TransPyC/main/schemas/project-schema.json",
|
||||
"name": "ArgparseTest",
|
||||
"version": "1.0.0",
|
||||
"source_dir": "./App",
|
||||
"temp_dir": "./temp",
|
||||
"output_dir": "./output",
|
||||
"compiler": {
|
||||
"cmd": "llc",
|
||||
"flags": ["-filetype=obj", "-relocation-model=pic"]
|
||||
},
|
||||
"linker": {
|
||||
"cmd": "clang++",
|
||||
"flags": ["-Wl,--allow-multiple-definition", "-lmsvcrt", "-lucrt", "-lpthread", "-lmingwex", "-lkernel32"],
|
||||
"output": "ArgparseTest.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,
|
||||
"startup": false
|
||||
}
|
||||
}
|
||||
1
Test/ArgparseTest/temp/08ea5281873244fd.doc.json
Normal file
1
Test/ArgparseTest/temp/08ea5281873244fd.doc.json
Normal file
@@ -0,0 +1 @@
|
||||
{}
|
||||
19
Test/ArgparseTest/temp/08ea5281873244fd.pyi
Normal file
19
Test/ArgparseTest/temp/08ea5281873244fd.pyi
Normal file
@@ -0,0 +1,19 @@
|
||||
"""
|
||||
Auto-generated Python stub file from main.py
|
||||
Module: main
|
||||
"""
|
||||
|
||||
|
||||
import t, c
|
||||
from stdint import *
|
||||
import stdio
|
||||
import stdlib
|
||||
import string
|
||||
import memhub
|
||||
import argparse
|
||||
import testcheck
|
||||
|
||||
_mbuddy: t.CExtern | memhub.MemBuddy | t.CPtr
|
||||
|
||||
@t.CExport
|
||||
def main() -> int: pass
|
||||
26
Test/ArgparseTest/temp/271ea3decb810db2.pyi
Normal file
26
Test/ArgparseTest/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
|
||||
28
Test/ArgparseTest/temp/6f62fe05c5ea1ceb.pyi
Normal file
28
Test/ArgparseTest/temp/6f62fe05c5ea1ceb.pyi
Normal file
@@ -0,0 +1,28 @@
|
||||
"""
|
||||
Auto-generated Python stub file from stdio.py
|
||||
Module: stdio
|
||||
"""
|
||||
|
||||
|
||||
import t, c
|
||||
|
||||
def printf(fmt: t.CConst | str, *args) -> t.CInt | t.State: pass
|
||||
|
||||
def fprintf(stream: bytes, fmt: t.CConst | str, *args) -> t.CInt | t.State: pass
|
||||
|
||||
def sprintf(buf: bytes, fmt: t.CConst | str, *args) -> t.CInt | t.State: pass
|
||||
|
||||
def snprintf(buf: bytes, size: t.CSizeT, fmt: t.CConst | str, *args) -> t.CInt | t.State: pass
|
||||
|
||||
def puts(s: t.CConst | str) -> t.CInt | t.State: pass
|
||||
|
||||
def fputs(s: t.CConst | str, stream: bytes) -> t.CInt | t.State: pass
|
||||
|
||||
def fgets(buf: bytes, size: t.CInt, stream: bytes) -> bytes | t.State: pass
|
||||
|
||||
def fflush(stream: bytes) -> t.CInt | t.State: pass
|
||||
|
||||
|
||||
stdin: t.CExtern | bytes
|
||||
stdout: t.CExtern | bytes
|
||||
stderr: t.CExtern | bytes
|
||||
100
Test/ArgparseTest/temp/7e529fe7a078cfef.pyi
Normal file
100
Test/ArgparseTest/temp/7e529fe7a078cfef.pyi
Normal file
@@ -0,0 +1,100 @@
|
||||
"""
|
||||
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
|
||||
|
||||
def GetCommandLineA() -> CHARPTR | t.State: pass
|
||||
20
Test/ArgparseTest/temp/90c53dd6db8d41cf.pyi
Normal file
20
Test/ArgparseTest/temp/90c53dd6db8d41cf.pyi
Normal file
@@ -0,0 +1,20 @@
|
||||
"""
|
||||
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: pass
|
||||
|
||||
def calloc(nmemb: t.CSizeT, size: t.CSizeT) -> t.CVoid | t.CPtr | t.State: pass
|
||||
|
||||
def realloc(p: t.CVoid | t.CPtr, size: t.CSizeT) -> t.CVoid | t.CPtr | t.State: pass
|
||||
|
||||
def free(p: t.CVoid | t.CPtr) -> t.State: pass
|
||||
|
||||
def system(cmd: t.CConst | t.CChar | t.CPtr) -> INT | t.State: pass
|
||||
1
Test/ArgparseTest/temp/_phase1_manifest.json
Normal file
1
Test/ArgparseTest/temp/_phase1_manifest.json
Normal file
@@ -0,0 +1 @@
|
||||
{"D:\\Users\\TermiNexus\\Desktop\\TransPyC\\Test\\ArgparseTest\\App\\main.py": {"sha1": "08ea5281873244fd", "mtime": 1783074740.4694562, "size": 8086}, "D:\\Users\\TermiNexus\\Desktop\\TransPyC\\includes\\argparse.py": {"sha1": "aba439b7882ad9d6", "mtime": 1783072446.3366802, "size": 16968}, "D:\\Users\\TermiNexus\\Desktop\\TransPyC\\includes\\atom.py": {"sha1": "271ea3decb810db2", "mtime": 1782226548.693161, "size": 1290}, "D:\\Users\\TermiNexus\\Desktop\\TransPyC\\includes\\hashtable.py": {"sha1": "b8c66c8ff44eb874", "mtime": 1782826619.490043, "size": 9385}, "D:\\Users\\TermiNexus\\Desktop\\TransPyC\\includes\\memhub.py": {"sha1": "ee084e9fc6ee413a", "mtime": 1784214242.4485993, "size": 17765}, "D:\\Users\\TermiNexus\\Desktop\\TransPyC\\includes\\stdint.py": {"sha1": "f5522571bcce7bcb", "mtime": 1782383975.8824987, "size": 4356}, "D:\\Users\\TermiNexus\\Desktop\\TransPyC\\includes\\stdio.py": {"sha1": "6f62fe05c5ea1ceb", "mtime": 1783239556.0959673, "size": 714}, "D:\\Users\\TermiNexus\\Desktop\\TransPyC\\includes\\stdlib.py": {"sha1": "90c53dd6db8d41cf", "mtime": 1783874975.3597875, "size": 375}, "D:\\Users\\TermiNexus\\Desktop\\TransPyC\\includes\\string.py": {"sha1": "ab6e54ba9a669f76", "mtime": 1783933178.7264287, "size": 9922}, "D:\\Users\\TermiNexus\\Desktop\\TransPyC\\includes\\testcheck.py": {"sha1": "dd3002730623424b", "mtime": 1783927513.1159866, "size": 1818}, "D:\\Users\\TermiNexus\\Desktop\\TransPyC\\includes\\viperio.py": {"sha1": "c9f4be41ca1cc2b4", "mtime": 1782812279.506002, "size": 1556}, "D:\\Users\\TermiNexus\\Desktop\\TransPyC\\includes\\w32\\win32base.py": {"sha1": "7e529fe7a078cfef", "mtime": 1782488356.7736557, "size": 2662}, "D:\\Users\\TermiNexus\\Desktop\\TransPyC\\includes\\w32\\win32console.py": {"sha1": "bbdf3bbd4c3bc28c", "mtime": 1781200703.5338137, "size": 5604}}
|
||||
13
Test/ArgparseTest/temp/_sha1_map.txt
Normal file
13
Test/ArgparseTest/temp/_sha1_map.txt
Normal file
@@ -0,0 +1,13 @@
|
||||
08ea5281873244fd:main.py
|
||||
271ea3decb810db2:includes/atom.py
|
||||
6f62fe05c5ea1ceb:includes/stdio.py
|
||||
7e529fe7a078cfef:includes/w32\win32base.py
|
||||
90c53dd6db8d41cf:includes/stdlib.py
|
||||
ab6e54ba9a669f76:includes/string.py
|
||||
aba439b7882ad9d6:includes/argparse.py
|
||||
b8c66c8ff44eb874:includes/hashtable.py
|
||||
bbdf3bbd4c3bc28c:includes/w32\win32console.py
|
||||
c9f4be41ca1cc2b4:includes/viperio.py
|
||||
dd3002730623424b:includes/testcheck.py
|
||||
ee084e9fc6ee413a:includes/memhub.py
|
||||
f5522571bcce7bcb:includes/stdint.py
|
||||
48
Test/ArgparseTest/temp/ab6e54ba9a669f76.pyi
Normal file
48
Test/ArgparseTest/temp/ab6e54ba9a669f76.pyi
Normal file
@@ -0,0 +1,48 @@
|
||||
"""
|
||||
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 strcat(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 strstr(s: str, needle: str) -> 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
|
||||
67
Test/ArgparseTest/temp/aba439b7882ad9d6.pyi
Normal file
67
Test/ArgparseTest/temp/aba439b7882ad9d6.pyi
Normal file
@@ -0,0 +1,67 @@
|
||||
"""
|
||||
Auto-generated Python stub file from argparse.py
|
||||
Module: argparse
|
||||
"""
|
||||
|
||||
|
||||
import t, c
|
||||
from stdint import *
|
||||
import string
|
||||
import memhub
|
||||
import stdio
|
||||
import hashtable
|
||||
|
||||
STRING: t.CDefine = 0
|
||||
INT: t.CDefine = 1
|
||||
BOOL: t.CDefine = 2
|
||||
STORE: t.CDefine = 0
|
||||
STORE_TRUE: t.CDefine = 1
|
||||
STORE_FALSE: t.CDefine = 2
|
||||
COUNT: t.CDefine = 3
|
||||
MAX_ARGS: t.CDefine = 32
|
||||
_mbuddy: t.CExtern | memhub.MemBuddy | t.CPtr
|
||||
|
||||
class Argument:
|
||||
name: str
|
||||
short_name: str
|
||||
help_text: str
|
||||
arg_type: INT
|
||||
action: INT
|
||||
default_int: INT
|
||||
default_str: str
|
||||
required: bool
|
||||
is_positional: bool
|
||||
dest: str
|
||||
class ParsedArgs:
|
||||
_ht: hashtable.HashTable | t.CPtr
|
||||
__mbuddy__: memhub.MemBuddy | t.CPtr
|
||||
def __new__(self: ParsedArgs, mb: memhub.MemBuddy | t.CPtr) -> t.CPtr: pass
|
||||
def __init__(self: ParsedArgs, mb: memhub.MemBuddy | t.CPtr) -> t.CInt: pass
|
||||
def get_str(self: ParsedArgs, name: str) -> str: pass
|
||||
def get_int(self: ParsedArgs, name: str) -> INT: pass
|
||||
def get_bool(self: ParsedArgs, name: str) -> INT: pass
|
||||
def has(self: ParsedArgs, name: str) -> bool: pass
|
||||
def _set_str(self: ParsedArgs, name: str, val: str) -> t.CInt: pass
|
||||
def _set_int(self: ParsedArgs, name: str, val: INT) -> t.CInt: pass
|
||||
def _set_bool(self: ParsedArgs, name: str, val: bool) -> t.CInt: pass
|
||||
class ArgumentParser:
|
||||
_prog: str
|
||||
_description: str
|
||||
_args: Argument | t.CPtr
|
||||
_arg_count: INT
|
||||
__mbuddy__: memhub.MemBuddy | t.CPtr
|
||||
def __new__(self: ArgumentParser, prog: str, description: str, pool: memhub.MemBuddy | t.CPtr) -> t.CPtr: pass
|
||||
def __init__(self: ArgumentParser, prog: str, description: str, pool: memhub.MemBuddy | t.CPtr) -> t.CInt: pass
|
||||
def add_argument(self: ArgumentParser, name: str, short: str, arg_type: INT, default: INT, default_str: str, required: bool, action: INT, help: str) -> t.CInt: pass
|
||||
def _get_arg(self: ArgumentParser, idx: INT) -> Argument | t.CPtr: pass
|
||||
def _find_long(self: ArgumentParser, token: str) -> INT: pass
|
||||
def _find_long_prefix(self: ArgumentParser, token: str) -> INT: pass
|
||||
def _find_short(self: ArgumentParser, token: str) -> INT: pass
|
||||
def _find_positional(self: ArgumentParser, pos_idx: INT) -> INT: pass
|
||||
def _store_value(self: ArgumentParser, args: ParsedArgs | t.CPtr, arg: Argument | t.CPtr, value: str) -> t.CInt: pass
|
||||
def _apply_action(self: ArgumentParser, args: ParsedArgs | t.CPtr, arg: Argument | t.CPtr) -> t.CInt: pass
|
||||
def parse_args(self: ArgumentParser, argc: INT, argv: str | t.CPtr) -> ParsedArgs | t.CPtr: pass
|
||||
def print_help(self: ArgumentParser) -> t.CInt: pass
|
||||
def print_usage(self: ArgumentParser) -> t.CInt: pass
|
||||
|
||||
def release(args: ParsedArgs | t.CPtr) -> t.CInt: pass
|
||||
46
Test/ArgparseTest/temp/b8c66c8ff44eb874.pyi
Normal file
46
Test/ArgparseTest/temp/b8c66c8ff44eb874.pyi
Normal file
@@ -0,0 +1,46 @@
|
||||
"""
|
||||
Auto-generated Python stub file from hashtable.py
|
||||
Module: hashtable
|
||||
"""
|
||||
|
||||
|
||||
import t, c
|
||||
import string
|
||||
import memhub
|
||||
from stdint import *
|
||||
|
||||
_HT_EMPTY: t.CDefine = 0
|
||||
_HT_TOMBSTONE: t.CDefine = 1
|
||||
_HT_INIT_CAP: t.CDefine = 16
|
||||
_HT_SLOT_SIZE: t.CDefine = 24
|
||||
_FNV_OFFSET: t.CExtern | t.CUInt64T
|
||||
_FNV_PRIME: t.CExtern | t.CUInt64T
|
||||
|
||||
def _fnv1a_hash(key: str) -> t.CUInt64T: pass
|
||||
|
||||
|
||||
class HashTable:
|
||||
__slots__: t.CVoid | t.CPtr
|
||||
__count__: t.CSizeT = 0
|
||||
__capacity__: t.CSizeT = 16
|
||||
__tombstones__: t.CSizeT = 0
|
||||
__mbuddy__: memhub.MemBuddy | t.CPtr
|
||||
__iter_index__: t.CSizeT = 0
|
||||
def __new__(self: HashTable, mb: memhub.MemBuddy | t.CPtr) -> t.CPtr: pass
|
||||
def __init__(self: HashTable, mb: memhub.MemBuddy | t.CPtr) -> t.CInt: pass
|
||||
def _slot_hash(self: HashTable, idx: t.CSizeT) -> t.CUInt64T: pass
|
||||
def _slot_key(self: HashTable, idx: t.CSizeT) -> str: pass
|
||||
def _slot_value(self: HashTable, idx: t.CSizeT) -> t.CPtr: pass
|
||||
def _set_slot(self: HashTable, idx: t.CSizeT, h: t.CUInt64T, key: str, val: t.CPtr) -> t.CInt: pass
|
||||
def _find_slot(self: HashTable, key: str, h: t.CUInt64T) -> t.CSizeT: pass
|
||||
def _resize(self: HashTable, new_cap: t.CSizeT) -> t.CInt: pass
|
||||
def __setitem__(self: HashTable, key: str, val: t.CNeedPtr) -> t.CInt: pass
|
||||
def __getitem__(self: HashTable, key: str) -> t.CPtr: pass
|
||||
def __contains__(self: HashTable, key: str) -> t.CInt: pass
|
||||
def __delitem__(self: HashTable, key: str) -> t.CInt: pass
|
||||
def __len__(self: HashTable) -> t.CSizeT: pass
|
||||
def __iter__(self: HashTable) -> HashTable | t.CPtr: pass
|
||||
def __next__(self: HashTable) -> str: pass
|
||||
def get(self: HashTable, key: str, default: t.CPtr) -> t.CPtr: pass
|
||||
def set_int(self: HashTable, key: str, val: int) -> t.CInt: pass
|
||||
def set_str(self: HashTable, key: str, val: str) -> t.CInt: pass
|
||||
138
Test/ArgparseTest/temp/bbdf3bbd4c3bc28c.pyi
Normal file
138
Test/ArgparseTest/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
|
||||
22
Test/ArgparseTest/temp/c9f4be41ca1cc2b4.pyi
Normal file
22
Test/ArgparseTest/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
|
||||
31
Test/ArgparseTest/temp/dd3002730623424b.pyi
Normal file
31
Test/ArgparseTest/temp/dd3002730623424b.pyi
Normal file
@@ -0,0 +1,31 @@
|
||||
"""
|
||||
Auto-generated Python stub file from testcheck.py
|
||||
Module: testcheck
|
||||
"""
|
||||
|
||||
|
||||
import t, c
|
||||
import stdio
|
||||
from w32.win32console import SetConsoleOutputCP, SetConsoleCP
|
||||
|
||||
CP_UTF8: t.CDefine = 65001
|
||||
_pass_count: t.CExtern | t.CInt
|
||||
_fail_count: t.CExtern | t.CInt
|
||||
_total_pass: t.CExtern | t.CInt
|
||||
_total_fail: 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
|
||||
|
||||
def summary() -> t.CInt: pass
|
||||
81
Test/ArgparseTest/temp/ee084e9fc6ee413a.pyi
Normal file
81
Test/ArgparseTest/temp/ee084e9fc6ee413a.pyi
Normal file
@@ -0,0 +1,81 @@
|
||||
"""
|
||||
Auto-generated Python stub file from memhub.py
|
||||
Module: memhub
|
||||
"""
|
||||
|
||||
|
||||
import t, c
|
||||
from stdint import *
|
||||
import string
|
||||
import atom
|
||||
import viperio
|
||||
|
||||
MEMHUB_ALIGN: t.CDefine = 8
|
||||
MEMSLAB_MIN_BLOCK: t.CDefine = 16
|
||||
MEMSLAB_BITMAP_BYTES: t.CDefine = 256
|
||||
MEMBUDDY_MIN_BLOCK: t.CDefine = 32
|
||||
MEMBUDDY_MAX_ORDERS: t.CDefine = 32
|
||||
MEMBUDDY_HEADER_SIZE: t.CDefine = 8
|
||||
|
||||
def _align_up(val: t.CSizeT, align: t.CSizeT) -> t.CSizeT: pass
|
||||
|
||||
def _largest_pow2_le(val: t.CSizeT) -> t.CSizeT: pass
|
||||
|
||||
def _block_size_at_order(order: t.CInt) -> t.CSizeT: pass
|
||||
|
||||
|
||||
@t.CVTable
|
||||
class MemManager:
|
||||
__provides__: list[str] = ['__memmgr__']
|
||||
base: t.CVoid | t.CPtr
|
||||
size: t.CSizeT
|
||||
def __init__(self: MemManager, base: t.CVoid | t.CPtr, size: t.CSizeT) -> t.CInt: pass
|
||||
def alloc(self: MemManager, size: t.CSizeT) -> t.CVoid | t.CPtr: pass
|
||||
def free(self: MemManager, ptr: t.CVoid | t.CPtr) -> t.CInt: pass
|
||||
def reset(self: MemManager) -> t.CInt: pass
|
||||
def calloc(self: MemManager, count: t.CSizeT, size: t.CSizeT) -> t.CVoid | t.CPtr: pass
|
||||
def realloc(self: MemManager, ptr: t.CVoid | t.CPtr, old_size: t.CSizeT, new_size: t.CSizeT) -> t.CVoid | t.CPtr: pass
|
||||
def __enter__(self: MemManager) -> 'MemManager' | t.CPtr: pass
|
||||
def __exit__(self: MemManager) -> t.CInt: pass
|
||||
def alloc_buf(self: MemManager, capacity: t.CSizeT) -> viperio.Buf | t.CPtr: pass
|
||||
class MemPool(MemManager):
|
||||
offset: t.CSizeT
|
||||
high_water: t.CSizeT
|
||||
def __init__(self: MemPool, base: t.CVoid | t.CPtr, size: t.CSizeT) -> t.CInt: pass
|
||||
def alloc(self: MemPool, size: t.CSizeT) -> t.CVoid | t.CPtr: pass
|
||||
def free(self: MemPool, ptr: t.CVoid | t.CPtr) -> t.CInt: pass
|
||||
def reset(self: MemPool) -> t.CInt: pass
|
||||
class MemSlab(MemManager):
|
||||
block_size: t.CSizeT
|
||||
block_count: t.CSizeT
|
||||
used_count: t.CSizeT
|
||||
free_list: t.CVoid | t.CPtr
|
||||
alloc_map: t.CUInt8T | t.CPtr
|
||||
alloc_map_size: t.CSizeT
|
||||
usable: t.CVoid | t.CPtr
|
||||
usable_size: t.CSizeT
|
||||
def __init__(self: MemSlab, base: t.CVoid | t.CPtr, size: t.CSizeT, block_size: t.CSizeT) -> t.CInt: pass
|
||||
def alloc(self: MemSlab, size: t.CSizeT) -> t.CVoid | t.CPtr: pass
|
||||
def free(self: MemSlab, ptr: t.CVoid | t.CPtr) -> t.CInt: pass
|
||||
def reset(self: MemSlab) -> t.CInt: pass
|
||||
class MemBuddy(MemManager):
|
||||
max_order: t.CInt
|
||||
free_lists: t.CUInt64T | t.CPtr
|
||||
lock_val: t.CVolatile | t.CInt
|
||||
usable: t.CVoid | t.CPtr
|
||||
usable_size: t.CSizeT
|
||||
def __init__(self: MemBuddy, base: t.CVoid | t.CPtr, size: t.CSizeT) -> t.CInt: pass
|
||||
def _fl_push(self: MemBuddy, order: t.CInt, block: t.CVoid | t.CPtr) -> t.CInt: pass
|
||||
def _fl_pop(self: MemBuddy, order: t.CInt) -> t.CVoid | t.CPtr: pass
|
||||
def _fl_find_and_remove(self: MemBuddy, order: t.CInt, target: t.CVoid | t.CPtr) -> t.CInt: pass
|
||||
def _buddy_of(self: MemBuddy, block: t.CVoid | t.CPtr, order: t.CInt) -> t.CVoid | t.CPtr: pass
|
||||
def _order_for_size(self: MemBuddy, size: t.CSizeT) -> t.CInt: pass
|
||||
def _split_to_order(self: MemBuddy, to_order: t.CInt) -> t.CVoid | t.CPtr: pass
|
||||
def _coalesce(self: MemBuddy, block: t.CVoid | t.CPtr, order: t.CInt) -> t.CInt: pass
|
||||
def _is_valid_ptr(self: MemBuddy, ptr: t.CVoid | t.CPtr) -> t.CInt: pass
|
||||
def _lock(self: MemBuddy) -> t.CInt: pass
|
||||
def _unlock(self: MemBuddy) -> t.CInt: pass
|
||||
def alloc(self: MemBuddy, size: t.CSizeT) -> t.CVoid | t.CPtr: pass
|
||||
def free(self: MemBuddy, ptr: t.CVoid | t.CPtr) -> t.CInt: pass
|
||||
def reset(self: MemBuddy) -> t.CInt: pass
|
||||
def realloc(self: MemBuddy, ptr: t.CVoid | t.CPtr, old_size: t.CSizeT, new_size: t.CSizeT) -> t.CVoid | t.CPtr: pass
|
||||
100
Test/ArgparseTest/temp/f5522571bcce7bcb.pyi
Normal file
100
Test/ArgparseTest/temp/f5522571bcce7bcb.pyi
Normal file
@@ -0,0 +1,100 @@
|
||||
"""
|
||||
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.CLongLong
|
||||
ULONGLONG: t.CTypedef = t.CUnsignedLongLong
|
||||
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
|
||||
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
|
||||
SIZE_T: t.CTypedef = t.CSizeT
|
||||
SSIZE_T: t.CTypedef = t.CPtrDiffT
|
||||
PTRDIFF_T: t.CTypedef = t.CPtrDiffT
|
||||
int8_t: t.CTypedef = t.CInt8T
|
||||
int16_t: t.CTypedef = t.CInt16T
|
||||
int32_t: t.CTypedef = t.CInt32T
|
||||
int64_t: t.CTypedef = t.CInt64T
|
||||
uint8_t: t.CTypedef = t.CUInt8T
|
||||
uint16_t: t.CTypedef = t.CUInt16T
|
||||
uint32_t: t.CTypedef = t.CUInt32T
|
||||
uint64_t: t.CTypedef = t.CUInt64T
|
||||
size_t: t.CTypedef = t.CSizeT
|
||||
ssize_t: t.CTypedef = t.CPtrDiffT
|
||||
ptrdiff_t: t.CTypedef = t.CPtrDiffT
|
||||
intptr_t: t.CTypedef = t.CIntPtrT
|
||||
uintptr_t: t.CTypedef = t.CUIntPtrT
|
||||
wchar_t: t.CTypedef = t.CWCharT
|
||||
char8_t: t.CTypedef = t.CChar8T
|
||||
char16_t: t.CTypedef = t.CChar16T
|
||||
char32_t: t.CTypedef = t.CChar32T
|
||||
float8_t: t.CTypedef = t.CFloat8T
|
||||
float16_t: t.CTypedef = t.CFloat16T
|
||||
float32_t: t.CTypedef = t.CFloat32T
|
||||
float64_t: t.CTypedef = t.CFloat64T
|
||||
float128_t: t.CTypedef = t.CFloat128T
|
||||
_Bool: t.CTypedef = t.CBool
|
||||
Reference in New Issue
Block a user