summaryrefslogtreecommitdiff
path: root/src/argent.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/argent.c')
-rw-r--r--src/argent.c28
1 files changed, 24 insertions, 4 deletions
diff --git a/src/argent.c b/src/argent.c
index c42161a..7426394 100644
--- a/src/argent.c
+++ b/src/argent.c
@@ -3,10 +3,14 @@
#include <lauxlib.h>
#include "honeysuckle.h"
-#include "md4c-html.h"
-#include "tinydir.h"
#include "options.h"
+#include "bindings.h"
+
+
+struct settings {
+ const char *template_dir;
+};
int main(int argc, char **argv)
@@ -25,11 +29,27 @@ int main(int argc, char **argv)
lua_State *L = luaL_newstate();
luaL_openlibs(L);
- error = luaL_dofile(L, opts.conf_filename);
+ hs_create_table
+ (L,
+ hs_str_cfunc("markdown", markdown)
+ );
+ lua_setglobal(L, "argent");
+
+ error = luaL_loadfile(L, opts.conf_filename);
+ if (error != 0) {
+ fprintf(stderr, "error: %s\n", lua_tostring(L, -1));
+ lua_close(L);
+ return error;
+ }
+ error = hs_call(L, 0, 1);
if (error != 0) {
fprintf(stderr, "error: %s\n", lua_tostring(L, -1));
+ lua_close(L);
+ return error;
}
-
+
+ printf("here!\n");
+
lua_close(L);
return 0;
}