00001 /* 00002 * File: l_libs.h 00003 * Summary: Library definitions for dlua. 00004 */ 00005 00006 #ifndef L_LIBS_H 00007 #define L_LIBS_H 00008 00009 #include "clua.h" 00010 00011 /* 00012 * Library loaders for clua. 00013 */ 00014 00015 void cluaopen_crawl(lua_State *ls); 00016 void cluaopen_file(lua_State *ls); 00017 void cluaopen_food(lua_State *ls); 00018 void cluaopen_item(lua_State *ls); 00019 void cluaopen_kills(lua_State *ls); // defined in kills.cc 00020 void cluaopen_moninf(lua_State *ls); 00021 void cluaopen_options(lua_State *ls); 00022 void cluaopen_travel(lua_State *ls); 00023 void cluaopen_view(lua_State *ls); 00024 void cluaopen_you(lua_State *ls); 00025 00026 void cluaopen_globals(lua_State *ls); 00027 00028 /* 00029 * (Shared) metatable names. 00030 */ 00031 00032 #define MAP_METATABLE "dgn.mtmap" 00033 #define DEVENT_METATABLE "dgn.devent" 00034 #define MAPMARK_METATABLE "dgn.mapmark" 00035 #define MAPGRD_METATABLE "dgn.mapgrd" 00036 #define MAPGRD_COL_METATABLE "dgn.mapgrdcol" 00037 #define ITEM_METATABLE "item.itemaccess" 00038 #define MONS_METATABLE "monster.monsaccess" 00039 00040 /* 00041 * Libraries and loaders for dlua, accessed from init_dungeon_lua(). 00042 * TODO: Rename these to dluaopen_*? 00043 */ 00044 00045 extern const struct luaL_reg debug_dlib[]; 00046 extern const struct luaL_reg dgn_dlib[]; 00047 extern const struct luaL_reg dgn_build_dlib[]; 00048 extern const struct luaL_reg dgn_event_dlib[]; 00049 extern const struct luaL_reg dgn_grid_dlib[]; 00050 extern const struct luaL_reg dgn_item_dlib[]; 00051 extern const struct luaL_reg dgn_level_dlib[]; 00052 extern const struct luaL_reg dgn_mons_dlib[]; 00053 extern const struct luaL_reg dgn_subvault_dlib[]; 00054 extern const struct luaL_reg dgn_tile_dlib[]; 00055 extern const struct luaL_reg feat_dlib[]; 00056 extern const struct luaL_reg spells_dlib[]; 00057 extern const struct luaL_reg los_dlib[]; 00058 extern const struct luaL_reg mapmarker_dlib[]; 00059 00060 void luaopen_dgnevent(lua_State *ls); 00061 void luaopen_mapmarker(lua_State *ls); 00062 void luaopen_ray(lua_State *ls); 00063 00064 void register_monslist(lua_State *ls); 00065 void register_itemlist(lua_State *ls); 00066 void register_builder_funcs(lua_State *ls); 00067 00068 void dluaopen_crawl(lua_State *ls); 00069 void dluaopen_file(lua_State *ls); 00070 void dluaopen_mapgrd(lua_State *ls); 00071 void dluaopen_monsters(lua_State *ls); 00072 void dluaopen_you(lua_State *ls); 00073 void dluaopen_dgn(lua_State *ls); 00074 void dluaopen_colour(lua_State *ls); 00075 00076 /* 00077 * Some shared helper functions. 00078 */ 00079 class map_lines; 00080 int dgn_map_add_transform(lua_State *ls, 00081 std::string (map_lines::*add)(const std::string &s)); 00082 00083 void clua_push_item(lua_State *ls, item_def *item); 00084 00085 struct monster_info; 00086 void lua_push_moninf(lua_State *ls, monster_info *mi); 00087 00088 #endif