shell_plugin.c 584 B

12345678910111213141516171819202122232425262728
  1. /*
  2. * shell_plugin.c
  3. */
  4. #include "private.h"
  5. #include <assert.h>
  6. #include "lub/list.h"
  7. #include "clish/plugin.h"
  8. /*----------------------------------------------------------------------- */
  9. int clish_shell_load_plugins(clish_shell_t *this)
  10. {
  11. lub_list_node_t *iter;
  12. clish_plugin_t *plugin;
  13. assert(this);
  14. /* Iterate elements */
  15. for(iter = lub_list__get_head(this->plugins);
  16. iter; iter = lub_list_node__get_next(iter)) {
  17. plugin = (clish_plugin_t *)lub_list_node__get_data(iter);
  18. if (!clish_plugin_load(plugin))
  19. return -1;
  20. clish_plugin_dump(plugin);
  21. }
  22. return 0;
  23. }