Code Overview

Entry point
The program entry point is in corsixth is the main function defined in ./CorsixTH/SrcUnshared/main.cpp

Functions for invocation of lua

 * CorsixTH_lua_main - Transfers control to CorsixTH.lua (Defined in Src/main.h)
 * CorsixTH_lua_main_no_eval - Lua initialization prior to invocation of CorsixTH.lua (Defined in Src/main.h)
 * CorsixTH_lua_panic - Displays a startup error message, if lua initialization code fails (Defined in Src/main.h)
 * CorsixTH_lua_stacktrace - Processes error statuses relating to lua initialization (Defined in Src/main.h)
 * lua_atpanic
 * lua_checkstack
 * lua_close
 * lua_getfield
 * lua_getglobal
 * lua_insert
 * lua_isfunction
 * lua_isnumber
 * lua_pcall
 * lua_pop
 * lua_pushcfunction
 * lua_pushstring
 * lua_rawgeti
 * lua_settop
 * lua_toboolean
 * lua_tostring
 * lua_touserdata
 * luaL_newstate
 * luaL_openlibs

Initial Lua Entry Point
The corsixth startup program in written in C++. As part of the initialization sequence, the startup program runs some lua preparation routines, and preloads some lua packages before transferring control to the CorsixTH.lua script.

Lua package preloading
The following lua packages are preloaded during the corsixth initialization process, before control is passed to the CorsixTH.lua startup script: