private.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. * plugin private.h
  3. */
  4. #include "lub/list.h"
  5. #include "clish/plugin.h"
  6. /*---------------------------------------------------------
  7. * PRIVATE TYPES
  8. *--------------------------------------------------------- */
  9. struct clish_sym_s {
  10. char *name; /* Symbol name */
  11. const void *func; /* Function address */
  12. int type; /* Function type */
  13. clish_sym_api_e api; /* Function API */
  14. bool_t permanent; /* If permanent the dry-run can't switch it off */
  15. tri_t expand; /* If action scripts should be expanded */
  16. clish_plugin_t *plugin; /* Parent plugin */
  17. };
  18. struct clish_plugin_s {
  19. char *name; /* Plugin name. */
  20. char *alias; /* User defined plugin name. Can be used in builtin ref. */
  21. char *file; /* Shared object file name. */
  22. bool_t builtin_flag; /* If plugin is built into binary */
  23. char *conf; /* The content of <PLUGIN>...</PLUGIN> */
  24. lub_list_t *syms; /* List of plugin symbols */
  25. void *dlhan; /* Handler of dlopen() */
  26. clish_plugin_init_t *init; /* Init function (constructor) != NULL */
  27. clish_plugin_fini_t *fini; /* Fini function (destructor) */
  28. bool_t rtld_global; /* RTLD_GLOBAL flag for dlopen() */
  29. void *userdata; /* Arbitrary userdata to pass to ini and fini functions */
  30. };