Projects : gscm : gscm_usrbin

gscm/src/gscm.h

Dir - Raw

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>
10typedef 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
20extern 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
28void sc_assert_fail(const char *, unsigned long, const char *, const char *);
29
30void sc_exit(int status);
31void sc_write_error(const char *msg);
32void sc_error(const char *msg);
33void sc_error1(const char *msg, sc_value detail);
34void sc_perror(void);
35void sc_perror1(sc_value detail);
36void sc_gc(void);
37void sc_dump(sc_value v);
38void sc_init(sc_value heap_bytes);
39int sc_toplevel(int argc, char **argv);
40
41/* Internal platform-dependent functions */
42
43void sc_wide_mul(sc_value *a, sc_value *b);
44void sc_wide_mul_signed(sc_value *a, sc_value *b);
45void sc_div_extended(sc_value *a_lo, sc_value *a_hi, sc_value b);
46int sc_bit_length(sc_value a);
47
48#endif