hello.c 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /* vcc/plugins/hello/hello.c
  2. *
  3. * This file is part of vcc.
  4. *
  5. * vcc is free software: you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation, either version 3 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * vcc is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with vcc. If not, see <https://www.gnu.org/licenses/>
  17. */
  18. #include <stdio.h>
  19. #include <string.h>
  20. #include <vcc/vcc.h>
  21. #include <vcc/pretty.h>
  22. #include <vcc/plugin.h>
  23. #include <vcc/version.h>
  24. int do_cmd_hello(char *s);
  25. struct cmdtable hello_cmdtab[] = {
  26. { "-hello", do_cmd_hello, "Greet you. " },
  27. { NULL, NULL, NULL }
  28. };
  29. struct plugin plg_hello = {
  30. .state = 0,
  31. .name = "hello",
  32. .descr = "Greet you. ",
  33. .cmdtab = hello_cmdtab
  34. };
  35. #define this_plg (&plg_hello)
  36. int do_cmd_hello(char *s) {
  37. plg_check_enabled();
  38. (void) s;
  39. printf("hello, world\n");
  40. return 0;
  41. }