anplug.c 468 B

12345678910111213141516171819202122232425262728
  1. #include <stdlib.h>
  2. #include <stdio.h>
  3. #include <clish/plugin.h>
  4. CLISH_PLUGIN_SYM(anplug_fn)
  5. {
  6. printf("anplug: Another plugin\n");
  7. return 0;
  8. }
  9. CLISH_PLUGIN_INIT
  10. {
  11. printf("anplug: INIT shell = %p\n", clish_shell);
  12. /* Set a name of plugin to use in sym@plugin */
  13. clish_plugin__set_name(plugin, "another_plug");
  14. clish_plugin_add_sym(plugin, anplug_fn, "an_fn");
  15. return 0;
  16. }
  17. CLISH_PLUGIN_FINI
  18. {
  19. printf("anplug: FINI this = %p\n", clish_shell);
  20. return 0;
  21. }