options.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. Copyright (c) 2011, 2012, Simon Howard
  3. Permission to use, copy, modify, and/or distribute this software
  4. for any purpose with or without fee is hereby granted, provided
  5. that the above copyright notice and this permission notice appear
  6. in all copies.
  7. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  8. WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  9. WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  10. AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
  11. CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  12. LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
  13. NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
  14. CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  15. */
  16. #ifndef LHASA_OPTIONS_H
  17. #define LHASA_OPTIONS_H
  18. typedef enum {
  19. LHA_OVERWRITE_PROMPT,
  20. LHA_OVERWRITE_SKIP,
  21. LHA_OVERWRITE_ALL
  22. } LHAOverwritePolicy;
  23. // Options structure. Populated from command line arguments.
  24. typedef struct {
  25. // Policy to take when extracting files and a file
  26. // already exists.
  27. LHAOverwritePolicy overwrite_policy;
  28. // "Quiet" level. Normal operation is level 0.
  29. int quiet;
  30. // "Verbose" mode.
  31. int verbose;
  32. // If true, just perform a dry run of the operations that
  33. // would normally be performed, printing messages.
  34. int dry_run;
  35. // If not NULL, specifies a path into which to extract files.
  36. char *extract_path;
  37. // If true, use the directory path for files - otherwise,
  38. // the directory path is ignored.
  39. int use_path;
  40. } LHAOptions;
  41. #endif /* #ifndef LHASA_OPTIONS_H */