def exit_function(env, exitcode): router = ffi.from_handle(lib.GetEnvironmentRouterContext(env)) try: router.exit(exitcode) except BaseException: pass return 0
def print_function(env, name, message): router = ffi.from_handle(lib.GetEnvironmentRouterContext(env)) try: router.print(ffi.string(name).decode(), ffi.string(message).decode()) except BaseException: pass return 0
def ungetc_function(env, char, name): router = ffi.from_handle(lib.GetEnvironmentRouterContext(env)) try: router.ungetc(ffi.string(name).decode(), char) except BaseException: pass return 0
def query_function(env, name): router = ffi.from_handle(lib.GetEnvironmentRouterContext(env)) return int(router.query(ffi.string(name).decode()))