macbinary.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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_MACBINARY_H
  17. #define LHASA_MACBINARY_H
  18. #include "lha_decoder.h"
  19. #include "lha_file_header.h"
  20. /**
  21. * Create a passthrough decoder to handle MacBinary headers added
  22. * by MacLHA.
  23. *
  24. * The new decoder reads from the specified decoder and filters
  25. * out the header. The contents of the MacBinary header must match
  26. * the details from the specified file header.
  27. *
  28. * @param decoder The "inner" decoder from which to read data.
  29. * @param header The file header, that the contents of the
  30. * MacBinary header must match.
  31. * @return A new decoder, which passes through the
  32. * contents of the inner decoder, stripping
  33. * off the MacBinary header and truncating
  34. * as appropriate. Both decoders must be freed
  35. * by the caller.
  36. */
  37. LHADecoder *lha_macbinary_passthrough(LHADecoder *decoder,
  38. LHAFileHeader *header);
  39. #endif /* #ifndef LHASA_MACBINARY_H */