This repository has been archived on 2025-10-23. You can view files and clone it, but cannot push or open issues or pull requests.
Files
nub-lang-archive/example/interop/c.nub
2025-06-07 20:53:17 +02:00

22 lines
547 B
Plaintext

namespace c
extern func printf(fmt: ^u8, ...args: any)
extern func getchar(): i32
extern func puts(fmt: ^u8)
extern func malloc(size: i64): ^any
extern func calloc(num: i64, size: i64): ^any
extern func realloc(ptr: ^any, size: i64): ^any
extern func free(ptr: ^any)
extern func sin(x: f64): f64
extern func cos(x: f64): f64
extern func tan(x: f64): f64
extern func sqrt(x: f64): f64
extern func pow(x: f64, y: f64): f64
extern func abs(x: i32): i32
extern func time(t: ^i64): i64
extern func clock(): i64
extern func sleep(seconds: u32): i32