From 228e03d2629e012fce5951f8e75314892377b986 Mon Sep 17 00:00:00 2001 From: bloodstalker Date: Wed, 8 Aug 2018 15:57:13 +0430 Subject: added readme --- README.md | 46 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) (limited to 'README.md') diff --git a/README.md b/README.md index 328d764..343a413 100644 --- a/README.md +++ b/README.md @@ -1 +1,45 @@ -# luatablegen \ No newline at end of file +# luatablegen + +`luatablegen` takes a list of C structures and generates lua tables in C.
+The input is in the form of a JSON file that describes the C structure and the Lua types you want.
+Each structure will have it's own pair of C source and header. There is an option for an aggregate header which will include all the headers and in has a function that registers all the tables with Lua.
+`luatablegen` will generate a lua file that includes default constructors for all tables which you can use in Lua with `require`. luatablegen will also generate a markdown file listing the methods for the tables.
+For an example you can look under the test directory.
+ +## table gen file + +Each entry in the JSON file should have the following fields:
+* field_name: a list of the names of the C structure field names.
+* field_type: a list of the names of the C types for the C structure fields.
+* lua_type: a list of the names of the lua types that the Lua table fields corresponding to the C structure fields will have.
+* methods: a list of the methods that will be generated for the Lua table corresponding to the C structure.
+ +## Options + +```bash + -h, --help show this help message and exit + --out OUT output directory + --tbg TBG the table gen file + --pre PRE path to source code file to add after header + guard/extern c + --post POST path to source code file to add before header + guard/extern c end + --luaheader LUAHEADER + path to lua header files + --dbg debug + --singlefile should all the generated code be added to a single + file + --makemacro generate a makefile containing all objects in a macro + to be included by another makefile + --outfile OUTFILE name of the output file if signlefile is set, ignored + otherwise + --headeraggr HEADERAGGR + header aggregate file name + --lualibpath LUALIBPATH + where the lua module file will be placed + --docpath DOCPATH where the doc file will be placed +``` + +## TODO +* fields should be able to reference each other.
+* add more options for the table fileds.
-- cgit v1.2.3