plugin.h 858 B

12345678910111213141516171819202122232425262728
  1. /*
  2. * plugin.h
  3. */
  4. #ifndef _clish_plugin_h
  5. #define _clish_plugin_h
  6. #include "clish/shell.h"
  7. typedef struct clish_sym_s clish_sym_t;
  8. typedef struct clish_plugin_s clish_plugin_t;
  9. typedef int clish_plugin_fn_t(clish_context_t *context, char **out);
  10. typedef int clish_plugin_init_t(clish_plugin_t *plugin);
  11. /* Name of init function within plugin */
  12. #define CLISH_PLUGIN_INIT "clish_plugin_init"
  13. clish_plugin_t *clish_plugin_new(const char *name, const char *file);
  14. void clish_plugin_free(clish_plugin_t *instance);
  15. void *clish_plugin_load(clish_plugin_t *instance);
  16. clish_plugin_fn_t *clish_plugin_get_sym(clish_plugin_t *instance,
  17. const char *name);
  18. int clish_plugin_add_sym(clish_plugin_t *instance,
  19. clish_plugin_fn_t *func, const char *name);
  20. void clish_plugin_dump(const clish_plugin_t *this);
  21. #endif /* _clish_plugin_h */
  22. /** @} clish_plugin */