xlua: add hlog.version with the hlog version

Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
2 files changed, 9 insertions(+), 0 deletions(-)

M docs/lua-hlog-module.md
M xlua/xlua.c
M docs/lua-hlog-module.md +3 -0
@@ 5,6 5,9 @@ Constest scripts, scripts run by run-scr
 access to the `hlog` module.  This file documents all the functions provided
 by this module.
 
+### `version`
+The version string of the running hlog code.
+
 
 hlog.adif
 ---------

          
M xlua/xlua.c +6 -0
@@ 23,6 23,8 @@ 
 #include <jeffpc/cstr.h>
 #include <jeffpc/io.h>
 
+#include <hlog/version.h>
+
 #include "xlua-impl.h"
 #include "script.h"
 

          
@@ 110,6 112,10 @@ static void xlua_register(lua_State *L)
 	xlua_pushlib_utils(L);
 	lua_settable(L, -3);
 
+	lua_pushliteral(L, "version");
+	lua_pushstring(L, version_string);
+	lua_settable(L, -3);
+
 	luaL_setfuncs(L, xlua_funcs, 0);
 
 	lua_setglobal(L, "hlog");