aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--examples/translator.c4
-rw-r--r--include/csxbind.h3
-rw-r--r--src/csxbind.c9
3 files changed, 10 insertions, 6 deletions
diff --git a/examples/translator.c b/examples/translator.c
index 6854b42..eebe644 100644
--- a/examples/translator.c
+++ b/examples/translator.c
@@ -134,8 +134,8 @@ int items()
int main()
{
printf("#include <csxbind.h>\n\nint main()\n{\n");
- printf(" init();\n R(L(_do,");
+ printf(" csxbind_init();\n R(L(_do,");
items();
- printf("\n 0));\n return 0;\n}\n");
+ printf("\n 0));\n \n csxbind_free();\n return 0;\n}\n");
return 0;
}
diff --git a/include/csxbind.h b/include/csxbind.h
index 84a73d9..86f1dff 100644
--- a/include/csxbind.h
+++ b/include/csxbind.h
@@ -38,7 +38,8 @@ extern char *context;
extern char *newcontext;
extern char *_exit;
-void init();
+void csxbind_init();
+void csxbind_free();
csxpair *L(void *head, ...);
csxpair *D(void *a, void *b, void *c, ...);
diff --git a/src/csxbind.c b/src/csxbind.c
index 8e31585..a668dbf 100644
--- a/src/csxbind.c
+++ b/src/csxbind.c
@@ -38,12 +38,10 @@ char *_exit;
static csxi csx;
-static int initialised = 0;
-void init()
+void csxbind_init()
{
- initialised = 1;
csx_init(&csx);
csxbasenames *n = &csx.basenames;
name = n->name;
@@ -80,6 +78,11 @@ void init()
_exit = n->_exit;
}
+void csxbind_free()
+{
+ csx_free(&csx);
+}
+
csxpair *L(void *head, ...)
{