true.c 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /* true.c - true and false commands. */
  2. /*
  3. * GRUB -- GRand Unified Bootloader
  4. * Copyright (C) 2009 Free Software Foundation, Inc.
  5. *
  6. * GRUB is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * GRUB is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. #include <grub/dl.h>
  20. #include <grub/command.h>
  21. #include <grub/i18n.h>
  22. static grub_err_t
  23. grub_cmd_true (struct grub_command *cmd __attribute__ ((unused)),
  24. int argc __attribute__ ((unused)),
  25. char *argv[] __attribute__ ((unused)))
  26. {
  27. return 0;
  28. }
  29. static grub_err_t
  30. grub_cmd_false (struct grub_command *cmd __attribute__ ((unused)),
  31. int argc __attribute__ ((unused)),
  32. char *argv[] __attribute__ ((unused)))
  33. {
  34. return grub_error (GRUB_ERR_TEST_FAILURE, "false");
  35. }
  36. static grub_command_t cmd_true, cmd_false;
  37. GRUB_MOD_INIT(true)
  38. {
  39. cmd_true =
  40. grub_register_command ("true", grub_cmd_true,
  41. 0, N_("Do nothing, successfully."));
  42. cmd_false =
  43. grub_register_command ("false", grub_cmd_false,
  44. 0, N_("Do nothing, unsuccessfully."));
  45. }
  46. GRUB_MOD_FINI(true)
  47. {
  48. grub_unregister_command (cmd_true);
  49. grub_unregister_command (cmd_false);
  50. }