summaryrefslogtreecommitdiff
path: root/common.c
diff options
context:
space:
mode:
authorTom Harley2019-12-23 01:32:39 +0000
committerTom Harley2019-12-23 01:32:39 +0000
commit7bc67b95161a34f8eca635d4000d9602508a9243 (patch)
tree585b3778dc1967832390e5829e4b3909b4184a2c /common.c
parentAdd basics for interpreter; add CLI options (diff)
downloadsinter-7bc67b95161a34f8eca635d4000d9602508a9243.tar.gz
sinter-7bc67b95161a34f8eca635d4000d9602508a9243.zip

checkpoint

Diffstat (limited to 'common.c')
-rw-r--r--common.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/common.c b/common.c
index 5170943..100acdb 100644
--- a/common.c
+++ b/common.c
@@ -1,16 +1,22 @@
#include <stddef.h>
-#include <gc.h>
+#include <stdio.h>
-#include "debug.h"
+#include <gc.h>
void *inter_main(void);
void *debug_int(void *i) {
int *p = (int *) i;
- debug("%d\n", *p);
+ fprintf(stderr, "%d\n", *p);
return i;
}
+void *debug_func_call(void *f) {
+ char *func_id = (char *) f;
+ fprintf(stderr, "%s\n", func_id);
+ return 0;
+}
+
void *gc_alloc(int size) {
void *p = GC_MALLOC(size);
@@ -34,5 +40,7 @@ int main() {
*/
GC_INIT();
- return (int) inter_main();
+ int *ret = (int *) inter_main();
+
+ return *ret;
}