lua.c
changeset 115 47bed161e3b0
parent 113 3d4f0415c8f8
child 117 592435d89510
equal deleted inserted replaced
114:81ec4182c92d 115:47bed161e3b0
    37 #include <mcabber/hooks.h>       // hk_add_handler, hk_del_handler
    37 #include <mcabber/hooks.h>       // hk_add_handler, hk_del_handler
    38 #include <mcabber/settings.h>    // settings_set, settings_del, settings_get
    38 #include <mcabber/settings.h>    // settings_set, settings_del, settings_get
    39 #include <mcabber/compl.h>       // compl_new_category, compl_add_category_word, compl_del_category_word
    39 #include <mcabber/compl.h>       // compl_new_category, compl_add_category_word, compl_del_category_word
    40 #include <mcabber/events.h>      // evs_*
    40 #include <mcabber/events.h>      // evs_*
    41 #include <mcabber/modules.h>     // module_info_t
    41 #include <mcabber/modules.h>     // module_info_t
    42 #include <mcabber/api.h>         // mcabber_branch, mcabber_api_version
    42 #include <mcabber/api.h>         // mcabber_branch, mcabber_api_version, MCABBER_API_HAVE_CMD_ID
    43 #include <mcabber/main.h>        // mcabber_version
    43 #include <mcabber/main.h>        // mcabber_version
    44 
    44 
    45 #include "config.h"
    45 #include "config.h"
    46 #include "util.h"
    46 #include "util.h"
    47 
    47 
    48 // module description
    48 // module description
    49 static void mlua_init   (void);
    49 void mlua_init   (void);
    50 static void mlua_uninit (void);
    50 void mlua_uninit (void);
    51 
    51 
    52 #ifdef LLM_LOG_HANDLER
    52 #ifdef LLM_LOG_HANDLER
    53 #define DESCRIPTION ( \
    53 #define DESCRIPTION ( \
    54 	"Lua scripting interface\n" \
    54 	"Lua scripting interface\n" \
    55 	"Recognizes options lua_init_file, lua_hook_function and lua_lm_debug\n" \
    55 	"Recognizes options lua_init_file, lua_hook_function and lua_lm_debug\n" \
  1738 		lua_close (lua);
  1738 		lua_close (lua);
  1739 		lua = NULL;
  1739 		lua = NULL;
  1740 	}
  1740 	}
  1741 }
  1741 }
  1742 
  1742 
  1743 static void mlua_init (void)
  1743 void mlua_init (void)
  1744 {
  1744 {
  1745 	luaL_openlibs (lua);
  1745 	luaL_openlibs (lua);
  1746 
  1746 
  1747 	luaL_register (lua, "main", lua_reg_main);
  1747 	luaL_register (lua, "main", lua_reg_main);
  1748 	lua_pop (lua, 1); // XXX
  1748 	lua_pop (lua, 1); // XXX
  1844 static void lua_categories_destroy (guint id, gpointer ignore)
  1844 static void lua_categories_destroy (guint id, gpointer ignore)
  1845 {
  1845 {
  1846 	compl_del_category (id);
  1846 	compl_del_category (id);
  1847 }
  1847 }
  1848 
  1848 
  1849 static void mlua_uninit (void)
  1849 void mlua_uninit (void)
  1850 {
  1850 {
  1851 	if (lua) {
  1851 	if (lua) {
  1852 		hk_arg_t args[] = {
  1852 		hk_arg_t args[] = {
  1853 			{ NULL, NULL },
  1853 			{ NULL, NULL },
  1854 		};
  1854 		};