--[[
    Templates for the generated files.
--]]

Templates = {}

Templates['headerStart'] =
[[
/* File generated by lgob.codegen on %s - do not modify */

#ifndef %s_INCLUDED
#define %s_INCLUDED

#include "%s.c"
]]

Templates['headerEnd'] =
[[

#endif
]]

Templates['functionItem'] =
[[
static int %s(lua_State* L)
{
    %s
}
]]

Templates['enum'] = [[  lua_pushliteral(L, "%s"); lua_pushinteger(L, %i); lua_rawset(L, -3);]]

Templates['reg'] =
[[
static const struct luaL_reg _st_%s [] =
{
    %s
};
]]

Templates['regadd'] = [[    register_class(L, %s, %s, _st_%s);]]

Templates['mainStart'] = [[int luaopen_lgob_%s(lua_State* L)
{
    _wrap_%s_init(L);
]]

Templates['mainEnd'] = [[

    _wrap_%s_ret(L);
    
    return 1;
}]]

Templates['specialType'] = [[

    if(luaL_newmetatable(L, "%s"))
    {
        lua_getfield(L, LUA_REGISTRYINDEX, "lgobRegisterSpecial");
        lua_pushvalue(L, -2);
        lua_pushliteral(L, "%s");
        lua_pushliteral(L, "%s");
        %s
        lua_call(L, %i, 0);
    }
    lua_pop(L, 1);
]]

Templates['lineComment'] = [[   /* %s */]]

Templates['regcpy'] = [[    lua_pushcfunction(L, %s); lua_setfield(L, LUA_REGISTRYINDEX, "%s");]]

Templates['ifacecpy'] = [[  copy_interface(L, "%s", "%s", _st_%s);]]
