mtree.bmx 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. ' Copyright (c) 2022 Bruce A Henderson
  2. ' All rights reserved.
  3. '
  4. ' Redistribution and use in source and binary forms, with or without
  5. ' modification, are permitted provided that the following conditions are met:
  6. ' * Redistributions of source code must retain the above copyright
  7. ' notice, this list of conditions and the following disclaimer.
  8. ' * Redistributions in binary form must reproduce the above copyright
  9. ' notice, this list of conditions and the following disclaimer in the
  10. ' documentation and/or other materials provided with the distribution.
  11. '
  12. ' THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER ``AS IS'' AND ANY
  13. ' EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  14. ' WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  15. ' DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
  16. ' DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  17. ' (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  18. ' LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  19. ' ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  20. ' (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  21. ' SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  22. '
  23. SuperStrict
  24. Module Archive.MTree
  25. ModuleInfo "CC_OPTS: -DARCHIVE_CRYPTO_MD5_LIBMD"
  26. ModuleInfo "CC_OPTS: -DARCHIVE_CRYPTO_SHA1_LIBMD"
  27. ModuleInfo "CC_OPTS: -DARCHIVE_CRYPTO_SHA256_LIBMD"
  28. ModuleInfo "CC_OPTS: -DARCHIVE_CRYPTO_SHA512_LIBMD"
  29. ModuleInfo "CC_OPTS: -DHAVE_CONFIG_H -D_FILE_OFFSET_BITS=64"
  30. ?win32
  31. ModuleInfo "CC_OPTS: -DLIBARCHIVE_STATIC"
  32. ?
  33. Import Archive.Core
  34. Import "common.bmx"
  35. Private
  36. Type TMTreeArchiveFormat Extends TArchiveFormat
  37. Method AddReadFormat:Int(archive:Byte Ptr, format:EArchiveFormat)
  38. If format = EArchiveFormat.MTREE Then
  39. archive_read_support_format_mtree(archive)
  40. Return True
  41. End If
  42. End Method
  43. Method AddWriteFormat:Int(archive:Byte Ptr, format:EArchiveFormat)
  44. If format = EArchiveFormat.MTREE Then
  45. archive_write_set_format_mtree(archive)
  46. Return True
  47. End If
  48. End Method
  49. Method AddReadFilter:Int(archive:Byte Ptr, filter:EArchiveFilter)
  50. Return False
  51. End Method
  52. Method AddWriteFilter:Int(archive:Byte Ptr, filter:EArchiveFilter)
  53. Return False
  54. End Method
  55. End Type
  56. New TMTreeArchiveFormat