diff options
Diffstat (limited to 'c/core.h')
| -rw-r--r-- | c/core.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/c/core.h b/c/core.h new file mode 100644 index 0000000..6668c53 --- /dev/null +++ b/c/core.h @@ -0,0 +1,29 @@ +#ifndef __MAL_CORE__ +#define __MAL_CORE__ + +#include <glib.h> + +// These are just used by step2 and step3 before then core_ns environment is +// imported + +MalVal *int_plus(MalVal *a, MalVal *b); +MalVal *int_minus(MalVal *a, MalVal *b); +MalVal *int_multiply(MalVal *a, MalVal *b); +MalVal *int_divide(MalVal *a, MalVal *b); + +// Useful for step implementation +MalVal *first(MalVal *seq); +MalVal *rest(MalVal *seq); +MalVal *last(MalVal *seq); +MalVal *hash_map(MalVal *args); + +// namespace of type functions +typedef struct { + char *name; + void *(*func)(void*); + int arg_cnt; +} core_ns_entry; + +extern core_ns_entry core_ns[50]; + +#endif |
