private.h 563 B

123456789101112131415161718192021222324
  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. char *arg;
  11. size_t offset;
  12. bool_t quoted;
  13. };
  14. struct lub_argv_s {
  15. unsigned argc;
  16. lub_arg_t *argv;
  17. };
  18. /*-------------------------------------
  19. * PRIVATE META FUNCTIONS
  20. *------------------------------------- */
  21. const char *lub_argv_nextword(const char *string,
  22. size_t * len, size_t * offset, size_t * quoted);