aboutsummaryrefslogtreecommitdiff
path: root/list.h
diff options
context:
space:
mode:
authorOskari Timperi <oskari.timperi@iki.fi>2014-05-14 22:27:34 +0300
committerOskari Timperi <oskari.timperi@iki.fi>2014-05-14 22:27:34 +0300
commitd45a5b21de22438c004e1db96a8f154da09cdc0e (patch)
treec2a7bd2a4d08de03ef5e11932d9a1abf85110c80 /list.h
downloadlispish-d45a5b21de22438c004e1db96a8f154da09cdc0e.tar.gz
lispish-d45a5b21de22438c004e1db96a8f154da09cdc0e.zip
Initial commit
- tokenizing, parsing and basic eval support - arithmetic (+, -, *, /) - quote - atom for checking if the arg is an atom (i.e. not a list) - eq for checking equality - > for checking order - if - some unit testing - simple repl - mem management needs improvement :-)
Diffstat (limited to 'list.h')
-rw-r--r--list.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/list.h b/list.h
new file mode 100644
index 0000000..ea82440
--- /dev/null
+++ b/list.h
@@ -0,0 +1,19 @@
+#ifndef LIST_H
+#define LIST_H
+
+struct list
+{
+ void *data;
+ struct list *next;
+};
+
+typedef void (*list_free_cb)(void *data, void *userdata);
+
+void list_init(struct list *list);
+struct list *list_new(void *data);
+struct list *list_append(struct list *list, void *data);
+struct list *list_get_last(struct list *list);
+struct list *list_pop_front(struct list **list);
+void list_free(struct list *list, list_free_cb free_cb, void *userdata);
+
+#endif