1
0

shell_misc.c 700 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * shell_misc.c
  3. */
  4. #include <stdlib.h>
  5. #include <assert.h>
  6. #include "private.h"
  7. CLISH_GET_STR(shell, overview);
  8. bool_t clish_shell_is_machine_interface(const clish_shell_t *shell)
  9. {
  10. assert(shell);
  11. if (!shell)
  12. return BOOL_FALSE;
  13. return shell->machine_interface;
  14. }
  15. void clish_shell_set_machine_interface(clish_shell_t *shell)
  16. {
  17. assert(shell);
  18. if (!shell)
  19. return;
  20. shell->machine_interface = BOOL_TRUE;
  21. if (shell->tinyrl)
  22. tinyrl_set_machine_interface(shell->tinyrl);
  23. }
  24. void clish_shell_set_human_interface(clish_shell_t *shell)
  25. {
  26. assert(shell);
  27. if (!shell)
  28. return;
  29. shell->machine_interface = BOOL_FALSE;
  30. if (shell->tinyrl)
  31. tinyrl_set_human_interface(shell->tinyrl);
  32. }