private.h 651 B

1234567891011121314151617181920212223242526272829303132
  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. char *line;
  18. unsigned argc;
  19. lub_arg_t *argv;
  20. };
  21. /*-------------------------------------
  22. * PRIVATE META FUNCTIONS
  23. *------------------------------------- */
  24. const char *
  25. lub_argv_nextword(
  26. const char *string,
  27. size_t *len,
  28. size_t *offset,
  29. bool_t *quoted
  30. );