plugin_init.c 501 B

123456789101112131415161718192021222324252627
  1. #include <lub/ini.h>
  2. #include <lub/string.h>
  3. #include "private.h"
  4. CLISH_PLUGIN_INIT
  5. {
  6. lub_ini_t *ini;
  7. char *conf = clish_plugin__get_conf(plugin);
  8. if (conf) {
  9. ini = lub_ini_new();
  10. lub_ini_parse_str(ini, conf);
  11. scripts_path =
  12. lub_string_dup(lub_ini_find(ini, LUA_SCRIPTS_DIR));
  13. lub_ini_free(ini);
  14. }
  15. if(clish_plugin_init_lua(clish_shell))
  16. return (-1);
  17. clish_plugin__set_name(plugin, LUA_PLUGIN_NAME);
  18. clish_plugin_add_sym(plugin, clish_plugin_lua_action, "lua");
  19. return 0;
  20. }