import w32.win32console as w32cmd
import viperstring as string
import memhub
import stdlib
import stdio
import hello
import this
import t, c

pagecode: t.CDefine = 65001

def add(x: int, y: int): return x + y
def minus(x: int, y: int): return x - y

@t.CExport
def main() -> int:
    w32cmd.SetConsoleOutputCP(pagecode)
    w32cmd.SetConsoleCP(pagecode)
    print("你好，世界")
    # this.this()
    hello.helloworld()

    #p: bytes = stdlib.malloc(1024)
    #hub = memhub.MemSlab(p, 1024)
    #p1: bytes = hub.alloc(10)
    #p2: bytes = hub.alloc(10)
    #string.memset(p1, 0, 10)
    #string.memset(p2, 0, 10)
    #string.memcpy(p2, "11111111111111111\0", 13+5)
    #print(p1)
    #print(p2)
    #print(t.CUInt64T(p2) - t.CUInt64T(p1))

    func_p: t.Callable[[int, int], int] = add
    print(func_p(66, 4))
    func_p = minus
    print(func_p(66, 6))

    fp: t.Callable[[int, int], int] = t.CUInt64T(func_p)
    print(fp(67, 7))

    #ppp: int = 1
    #while ppp:
    #    ppp += 1
    #print(ppp)

    #lower_est: t.CUInt64T = 0
    #lower_est -= 1
    #print(lower_est)

    pass

    return 0
