@external("env", "_g") export declare function _g(id: i32, maxiter: i32): i64 @external("env", "accept") export declare function accept(read_ptr: string, read_len: i32, err: i64): i64 @external("env", "trace") export declare function TRACE(mread_ptr: string, mread_len: i32, dread_ptr: string, dread_len: i32, as_hex: i32): i64 //////////////////////// function LOG (text: string): void { TRACE(text, text.length * 2, text, text.length * 2, 0) } export function hook(reserved: i32 = 0): i64 { LOG("Accept.c: Called."); accept('', 0, 0); _g(1,1); // every hook needs to import guard function and use it at least once // unreachable return 0; }