link "c" link "m" pub extern func acos(x: f64) f64; pub extern func acosf(x: f32) f32; pub extern func asin(x: f64) f64; pub extern func asinf(x: f32) f32; pub extern func atan(x: f64) f64; pub extern func atanf(x: f32) f32; pub extern func atan2(x: f64,y: f64) f64; pub extern func atan2f(x: f32,y: f32) f32; pub extern func cos(x: f64) f64; pub extern func cosf(x: f32) f32; pub extern func cosh(x: f64) f64; pub extern func coshf(x: f32) f32; pub extern func sin(x: f64) f64; pub extern func sinf(x: f32) f32; pub extern func tan(x: f64) f64; pub extern func tanf(x: f32) f32; pub extern func sqrt(x: f64) f64; pub extern func sqrtf(x: f32) f32; pub extern func floor(x: f64) f64; pub extern func floorl(x: i64) i64; pub extern func ceil(x: f64) f64; pub extern func pow(x: f64,k: f64) f64; // stdio.h link "havostd" constexpr SEEK_SET = 0 constexpr SEEK_CUR = 1 constexpr SEEK_END = 2 constexpr BUFSIZ = 2 constexpr EOF = (-1) constexpr FILENAME_MAX = 250 constexpr FOPEN_MAX = 20 constexpr TMP_MAX = 32767 constexpr PROT_EXEC = 4 constexpr PROT_WRITE = 2 constexpr PROT_READ = 1 constexpr PROT_NONE = 0 constexpr MAP_ANON = 0x0020 constexpr MAP_ANONYMUS = 0x0020 constexpr MAP_PRIVATE = 0x0002 pub struct FILE { ptr: *u8, cnt: i32, base: *u8, flag: i32, file: i32, charbuf: i32, bufsiz: i32, tmpfname: *char } pub extern func get_stdin() *FILE; pub extern func get_stderr() *FILE; pub extern func get_stdout() *FILE; pub extern var stdin: *FILE; pub extern var stdout: *FILE; pub extern var stderr: *FILE; constexpr STDIN = stdin constexpr STDERR = stderr constexpr STDOUT = stdout pub extern func remove(file: *char) i32; pub extern func rename(file: *char,to: *char) i32; pub extern func tmpfile() *FILE; pub extern func fclose(f: *FILE) i32; pub extern func fflush(f: *FILE) i32; pub extern func fopen(file: *char,mode: *char) *FILE; pub extern func freopen(file: *char,mode: *char,f: *FILE) *FILE; pub extern func fgetc(f: *FILE) char; pub extern func fgets(dst: *char,count: i32,file: *FILE) *char; pub extern func fputs(s: *char,f: *FILE) void; pub extern func putchar(c: char) void; pub extern func getc(f: *FILE) char; pub extern func putc(c: char,f: *FILE) i32; pub extern func puts(c: *char) i32; pub extern func gets(c: *char) *char; pub extern func fread(ptr: *u8,a0: usize,a1: usize,f: *FILE) i32; pub extern func fwrite(ptr: *u8,a0: usize,a1: usize,f: *FILE) i32; pub extern func fgetpos(f:* FILE,out: *i64) i32; pub extern func fseek(f: *FILE,x: i32,y: i32) i32; pub extern func fsetpos(f: *FILE,v: *i64) i32; pub extern func printf(fmt: *char,...) i32; pub extern func fprintf(f: *FILE,fmt: *char,...) i32; pub extern func sprintf(out: *char,in: *char,...) i32; pub extern func scanf(in: *char,...) i32; pub extern func fscanf(f: *FILE,c: *char,...) i32; pub extern func sscanf(c: *char,c1: *char,...) i32; // stdlib.h pub extern func malloc(size: usize) *u8; pub extern func calloc(c: i32,size: usize) *u8; pub extern func free(p: *u8) void; pub extern func realloc(p: *u8,size: usize) *u8; pub extern func exit(i: i32) void; pub extern func system(c: *char) i32; pub extern func rand() u64; pub extern func get_rand_max() i32; pub extern func srand(s: i32) void; constexpr RAND_MAX = get_rand_max() pub extern func memcpy(dst: *u8,src: *u8,count: usize) *u8; pub extern func memmove(dst: *u8,src: *u8,count: usize) *u8; pub extern func strlen(c: *char) i32; pub extern func memset(dst: *u8,b: u8,c: usize) *u8; pub extern func usleep(i: i32) void; pub extern func mmap(addr: *u8,len: usize,prot: i32,flags: i32,fd: i32,offset:i64) *u8; pub extern func ltoa(num: i64,str: *char,radix: i32) *char; pub extern func ultoa(num: u64,str: *char,radix: i32) *char; pub extern func itoa(num: i32,str: *char,radix: i32) *char; pub extern func ftoa(num: f32,str: *char,precision: u8) *char; pub extern func time(t: *u64) u64; pub extern func srand(v: u64) void;