private.h 635 B

12345678910111213141516171819202122232425262728293031
  1. /*
  2. * private.h
  3. *
  4. * Class to deal with splitting a command line into multiple arguments.
  5. * This class deals with full quoted text "like this" as a single argument.
  6. */
  7. #include "lub/argv.h"
  8. typedef struct lub_arg_s lub_arg_t;
  9. struct lub_arg_s
  10. {
  11. char *arg;
  12. size_t offset;
  13. bool_t quoted;
  14. };
  15. struct lub_argv_s
  16. {
  17. unsigned argc;
  18. lub_arg_t *argv;
  19. };
  20. /*-------------------------------------
  21. * PRIVATE META FUNCTIONS
  22. *------------------------------------- */
  23. const char *
  24. lub_argv_nextword(
  25. const char *string,
  26. size_t *len,
  27. size_t *offset,
  28. bool_t *quoted
  29. );