system_test.c 926 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * system_test.c
  3. */
  4. #include <stdlib.h>
  5. #include "private.h"
  6. /*--------------------------------------------------------- */
  7. bool_t lub_system_test(int argc, char **argv)
  8. {
  9. return testcmd(argc, argv) ? BOOL_FALSE : BOOL_TRUE;
  10. }
  11. /*--------------------------------------------------------- */
  12. bool_t lub_system_line_test(const char *line)
  13. {
  14. bool_t res;
  15. lub_argv_t *argv;
  16. argv = lub_argv_new(line, 0);
  17. res = lub_system_argv_test(argv);
  18. lub_argv_delete(argv);
  19. return res;
  20. }
  21. /*--------------------------------------------------------- */
  22. bool_t lub_system_argv_test(const lub_argv_t * argv)
  23. {
  24. bool_t res;
  25. char **str_argv;
  26. int str_argc;
  27. /* Make args */
  28. str_argv = lub_argv__get_argv(argv, "");
  29. str_argc = lub_argv__get_count(argv) + 1;
  30. /* Test it */
  31. res = lub_system_test(str_argc, str_argv);
  32. lub_argv__free_argv(str_argv);
  33. return res;
  34. }
  35. /*--------------------------------------------------------- */