--- source: crates/louise_bindgen/tests/generate.rs expression: b.louise --- /// Bindings for `kitchen.h`, generated by `louise bindgen` with their C shim: /// do not edit, regenerate. /// /// Not bound, or worth knowing: /// - line 34, `struct k_buf`: no finalizer found: `KBuf` resources are never freed. /// - line 37, `k_map_free`: the finalizer of `KMap`, not bound. /// - line 39, `k_map_parent`: returns a pointer it may still own: only functions named like constructors (_new, _create, _open, _copy, _clone) return a `Resource`. /// - line 49, `struct k_point`: a struct with fields. /// - line 50, `k_origin`: `k_point`: only pointers to opaque structs are supported. /// - line 51, `k_norm`: `const k_point *`: only pointers to opaque structs are supported. /// - line 52, `k_sort`: the callback `int (*)(const void *, const void *)` needs exactly one `void *` parameter, its environment. /// - line 53, `k_both`: more than one callback. /// - line 54, `k_untyped`: a `void *` parameter. /// - line 55, `k_fill`: `char *`, which C may write to (only `const char *` is supported). /// - line 56, `k_printf`: a variadic function. /// - line 57, `k_matrix`: unsupported type `double m[4]`. /// - line 58, `k_tables`: unsupported type `const char **`. /// - line 59, `enum k_color { K_RED, K_GREEN };`: not a supported declaration. /// - line 60, `k_favourite`: the enum `enum k_color`. /// - line 61, `k_macro_declared`: unknown type `API int` (macros are not expanded). /// - line 62, `static inline int k_inline(void) { return 1; }`: not a supported declaration. /// - line 63, `K_Shout`: its name is not a Louise function name. /// - line 64, `match`: its name is not a Louise function name. /// - line 65, `k_map_find`: returns a pointer it may still own: only functions named like constructors (_new, _create, _open, _copy, _clone) return a `Resource`. /// - line 66, `extern int k_counter;`: not a supported declaration. import std/ffi.{type Resource} /// `struct k_buf`, opaque. pub type KBuf /// `struct k_map`, opaque. pub type KMap /// C: `int k_add(int a, int b)` @extern c "louise_k_add" pub fn k_add :: a: Int b: Int -> Int / /// C: `unsigned long k_hash(uint64_t seed, short salt)` @extern c "louise_k_hash" pub fn k_hash :: seed: Int salt: Int -> Int / /// C: `long long k_wide(long long x)` @extern c "louise_k_wide" pub fn k_wide :: x: Int -> Int / /// C: `double k_scale(double x, float by)` @extern c "louise_k_scale" pub fn k_scale :: x: Float by: Float -> Float / /// C: `bool k_is_even(int64_t n)` @extern c "louise_k_is_even" pub fn k_is_even :: n: Int -> Bool / /// C: `void k_reset(void)` @extern c "louise_k_reset" pub fn k_reset :: -> () / /// C: `k_code k_last_error(void)` @extern c "louise_k_last_error" pub fn k_last_error :: -> Int / /// C: `size_t k_count(const char *text, size_t text_len, char c)` @extern c "louise_k_count" pub fn k_count :: text: String c: Int -> Int / /// C: `int k_parse(const char *s)` @extern c "louise_k_parse" pub fn k_parse :: s: String -> Int / /// C: `const char *k_name(int code)` @extern c "louise_k_name" pub fn k_name :: code: Int -> String / /// C: `k_map *k_map_new(size_t capacity)` @extern c "louise_k_map_new" pub fn k_map_new :: capacity: Int -> Resource / /// C: `k_map *k_map_copy(const k_map *m)` @extern c "louise_k_map_copy" pub fn k_map_copy :: m: Resource -> Resource / /// C: `bool k_map_put(k_map *m, const char *key, int64_t value)` @extern c "louise_k_map_put" pub fn k_map_put :: m: Resource key: String value: Int -> Bool / /// C: `struct k_buf *k_buf_create(void)` @extern c "louise_k_buf_create" pub fn k_buf_create :: -> Resource / /// C: `void k_buf_append(struct k_buf *b, const char *bytes, size_t n)` @extern c "louise_k_buf_append" pub fn k_buf_append :: b: Resource bytes: String -> () / /// C: `void k_map_each(k_map *m, void (*visit)(const char *key, int64_t value, void *env), void *env)` @extern c "louise_k_map_each" pub fn k_map_each :: m: Resource visit: fn(String, Int) -> () / -> () / /// C: `double k_integrate(k_weight f, void *data, double from, double to)` @extern c "louise_k_integrate" pub fn k_integrate :: f: fn(Float, Bool) -> Float / from: Float to: Float -> Float /