plugin.h 800 B

123456789101112131415161718192021222324252627
  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. int clish_plugin_load(clish_plugin_t *instance);
  16. clish_plugin_fn_t *clish_plugin_resolve(clish_plugin_t *instance,
  17. const char *name);
  18. int clish_plugin_sym(clish_plugin_t *instance,
  19. clish_plugin_fn_t *func, const char *name);
  20. #endif /* _clish_plugin_h */
  21. /** @} clish_plugin */