tobogganSe connecter

louise

Clone avec HTTPS, un jeton personnel en mot de passe, ou avec SSH, une clé ajoutée dans vos paramètres.

72 lignes · 2118 octetsBrut · Historique
1/* Every shape `louise bindgen` binds, and some it reports and skips. */
2#ifndef KITCHEN_H
3#define KITCHEN_H
4
5#include <stdbool.h>
6#include <stddef.h>
7#include <stdint.h>
8
9#define API
10#define KITCHEN_MAX(a, b) \
11 ((a) > (b) ? (a) : (b))
12
13#ifdef __cplusplus
14extern "C" {
15#endif
16
17/* Scalars. */
18int k_add(int a, int b);
19unsigned long k_hash(uint64_t seed, short salt);
20long long k_wide(long long x);
21double k_scale(double x, float by);
22bool k_is_even(int64_t n);
23void k_reset(void);
24typedef int32_t k_code;
25k_code k_last_error(void);
26
27/* Strings: with a length, alone, and returned. */
28size_t k_count(const char *text, size_t text_len, char c);
29int k_parse(const char *s);
30const char *k_name(int code);
31
32/* Opaque types, with and without a typedef. */
33typedef struct k_map k_map;
34struct k_buf;
35k_map *k_map_new(size_t capacity);
36k_map *k_map_copy(const k_map *m);
37void k_map_free(k_map *m);
38bool k_map_put(k_map *m, const char *key, int64_t value);
39k_map *k_map_parent(k_map *m);
40struct k_buf *k_buf_create(void);
41void k_buf_append(struct k_buf *b, const char *bytes, size_t n);
42
43/* Callbacks: inline, through a typedef, with every argument kind. */
44void k_map_each(k_map *m, void (*visit)(const char *key, int64_t value, void *env), void *env);
45typedef double (*k_weight)(void *env, double x, bool heavy);
46double k_integrate(k_weight f, void *data, double from, double to);
47
48/* Reported and skipped. */
49typedef struct k_point { int x, y; } k_point;
50k_point k_origin(void);
51double k_norm(const k_point *p);
52void k_sort(void *base, size_t n, int (*cmp)(const void *, const void *));
53void k_both(int (*f)(void *), int (*g)(void *), void *env);
54void k_untyped(void *p);
55void k_fill(char *out, size_t n);
56int k_printf(const char *fmt, ...);
57void k_matrix(double m[4]);
58int k_tables(const char **names);
59enum k_color { K_RED, K_GREEN };
60enum k_color k_favourite(void);
61API int k_macro_declared(void);
62static inline int k_inline(void) { return 1; }
63int K_Shout(void);
64int match(int x);
65k_map *k_map_find(k_map *m, bool (*keep)(int64_t value, void *env), void *env);
66extern int k_counter;
67
68#ifdef __cplusplus
69}
70#endif
71
72#endif