Projects : gscm : gscm_usrbin
1 | /* Externally visible interface of gscm.c |
2 | * To verify: |
3 | * egrep -v '^($| |[A-Z]|}|/|#|static|typedef|__attribute__|.*:$)' gscm.c |
4 | */ |
5 | |
6 | #ifndef GSCM_H |
7 | #define GSCM_H |
8 | |
9 | #include <stddef.h> |
10 | typedef size_t sc_value; |
11 | |
12 | #ifndef __SIZEOF_POINTER__ |
13 | #if defined(__amd64__) |
14 | #define __SIZEOF_POINTER__ 8 |
15 | #elif defined(__i386__) |
16 | #define __SIZEOF_POINTER__ 4 |
17 | #endif |
18 | #endif |
19 | |
20 | extern unsigned int sc_hugepages, sc_gc_verbose, sc_gc_thrash_factor; |
21 | |
22 | #ifdef NDEBUG |
23 | #define assert(expr) (void)0 |
24 | #else |
25 | #define assert(expr) \ |
26 | ((void)((expr) || (sc_assert_fail(__FILE__, __LINE__, __func__, #expr),0))) |
27 | #endif |
28 | void sc_assert_fail(const char *, unsigned long, const char *, const char *); |
29 | |
30 | void sc_exit(int status); |
31 | void sc_write_error(const char *msg); |
32 | void sc_error(const char *msg); |
33 | void sc_error1(const char *msg, sc_value detail); |
34 | void sc_perror(void); |
35 | void sc_perror1(sc_value detail); |
36 | void sc_gc(void); |
37 | void sc_dump(sc_value v); |
38 | void sc_init(sc_value heap_bytes); |
39 | int sc_toplevel(int argc, char **argv); |
40 | |
41 | /* Internal platform-dependent functions */ |
42 | |
43 | void sc_wide_mul(sc_value *a, sc_value *b); |
44 | void sc_wide_mul_signed(sc_value *a, sc_value *b); |
45 | void sc_div_extended(sc_value *a_lo, sc_value *a_hi, sc_value b); |
46 | int sc_bit_length(sc_value a); |
47 | |
48 | #endif |