1
0

plugin_init.c 511 B

1234567891011121314151617181920212223242526
  1. #include "lub/ini.h"
  2. #include "lub/string.h"
  3. #include "private.h"
  4. CLISH_PLUGIN_INIT(lua)
  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_fini(plugin, clish_plugin_lua_fini);
  18. clish_plugin_add_sym(plugin, clish_plugin_lua_action, "lua");
  19. return 0;
  20. }