ziplib.h 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. ;----------------------------------------------------------------------------
  2. ; check_cmem()
  3. ;
  4. ; Function: Checks if there are enough memory free for
  5. ; compression ( 2560 B needed ) **AND** for evaluating
  6. ; compressed size ( 1140 needed )
  7. ;
  8. ; Input: A0 = Pointer to data which will be compressed
  9. ; D0.W = Length of data which will be compressed
  10. ;
  11. ; Output: D0.W = 0 if NOT enough memory
  12. ; NO OTHER REGISTERS DESTROYED
  13. ;
  14. ;----------------------------------------------------------------------------
  15. ziplib::check_cmem equ ziplib@0000
  16. ;----------------------------------------------------------------------------
  17. ; check_emem()
  18. ;
  19. ; Function: Checks if there are enough memory free for
  20. ; extraction (same command as Hufflib's : check_mem)
  21. ;
  22. ; Input: A0 = Pointer to compressed data
  23. ;
  24. ; Output: D0.W = 0 if NOT enough memory
  25. ; NO OTHER REGISTERS DESTROYED
  26. ;----------------------------------------------------------------------------
  27. ziplib::check_emem equ ziplib@0001
  28. ;----------------------------------------------------------------------------
  29. ; eval_cmem()
  30. ;
  31. ; Function: Evaluates the mem size of the compressed file.
  32. ;
  33. ; Input: A0 = Pointer to datas which will be compressed
  34. ; D0.L = Length of datas which will be compressed
  35. ;
  36. ; Output: D0.W = mem size of datas when they will be compressed
  37. ; NO OTHER REGISTERS DESTROYED
  38. ;----------------------------------------------------------------------------
  39. ziplib::eval_cmem equ ziplib@0002
  40. ;----------------------------------------------------------------------------
  41. ; eval_emem()
  42. ;
  43. ; Function: Evaluates the mem size of the extracted file.
  44. ; (works only with single file archive)
  45. ;
  46. ; Input: A0 = Pointer to datas which will be uncompressed
  47. ;
  48. ; Output: D0.W = mem size of datas when they will be uncompressed
  49. ; NO OTHER REGISTERS DESTROYED
  50. ;----------------------------------------------------------------------------
  51. ziplib::eval_emem equ ziplib@0003
  52. ;----------------------------------------------------------------------------
  53. ; compress()
  54. ;
  55. ; Function: compress data
  56. ;
  57. ; Input: A0 = Pointer to uncompressed data
  58. ; A1 = Pointer to where the compressed data should be stored
  59. ; D0.W = Length of datas which will be compressed
  60. ;----------------------------------------------------------------------------
  61. ziplib::compress equ ziplib@0004
  62. ;----------------------------------------------------------------------------
  63. ; extract()
  64. ;
  65. ; Function: Extracts data ( in fact same routine as hufflib's one )
  66. ;
  67. ; Input: A0 = Pointer to compressed data
  68. ; A1 = Pointer to where the uncompressed data should be stored
  69. ; D3.W = File number to extract (not necessary if not multifile)
  70. ;----------------------------------------------------------------------------
  71. ziplib::extract equ ziplib@0005
  72. ;----------------------------------------------------------------------------
  73. ; zipfile()
  74. ;
  75. ; Function: Compress or Extract a file
  76. ;
  77. ; Input: A0 = Pointer to file in the VAT
  78. ; D0.B = 0 disable commentary
  79. ; 1 semi-commentary (error displayed)
  80. ; else enable commentary (Windows, Confirmations,...)
  81. ;
  82. ; Output: D0.B = 0 no error
  83. ; 1 can't manipulate because file is archived
  84. ; 2 compressed file bigger than original
  85. ; 3 not enough memory
  86. ; 4 Program running
  87. ; NO OTHER REGISTERS DESTROYED
  88. ;----------------------------------------------------------------------------
  89. ziplib::zipfile equ ziplib@0006
  90. ;----------------------------------------------------------------------------
  91. ; iscomp()
  92. ;
  93. ; Function: Test if a file is compressed
  94. ;
  95. ; Input: A0 = Pointer to file in the VAT
  96. ;
  97. ; Output: D0.W = 0 compressed
  98. ; 1 uncompressed
  99. ;
  100. ; NO OTHER REGISTERS DESTROYED
  101. ;----------------------------------------------------------------------------
  102. ziplib::iscomp equ ziplib@000B
  103. ;----------------------------------------------------------------------------
  104. ; tempfile()
  105. ;
  106. ; Function: Extract a compressed file to a temporary handle
  107. ;
  108. ; Input: A0 = Pointer to file in the VAT
  109. ; D0.B = 0 disable commentary
  110. ; 1 semi-commentary (error displayed)
  111. ; else enable commentary (Windows, Confirmations,...)
  112. ;
  113. ; Output: D0.B = 0 no error
  114. ; 1 can't manipulate because file is archived, locked or hidden
  115. ; 3 not enough memory
  116. ; 5 File is not a compressed file
  117. ; D1.W = handle of the temporary file
  118. ; NO OTHER REGISTERS DESTROYED
  119. ;----------------------------------------------------------------------------
  120. ziplib::tempfile equ ziplib@0007
  121. ;----------------------------------------------------------------------------
  122. ; extract_string()
  123. ;
  124. ; Function: Extracts a string from huffman compressed data
  125. ;
  126. ; Input: A0 = Pointer to huffman compressed data
  127. ; A1 = Pointer to where the string should be stored
  128. ; D3.W = File number to extract (not necessary if not multifile)
  129. ; D4.W = String number. First string = number 0
  130. ;----------------------------------------------------------------------------
  131. ziplib::extract_string equ ziplib@0008
  132. ;----------------------------------------------------------------------------
  133. ; write_string()
  134. ;
  135. ; Function: Writes a compressed string with the current font. The string
  136. ; should not be longer than 80 characters.
  137. ;
  138. ; Input: A0 = Pointer to huffman compressed data
  139. ; D0.W = x location
  140. ; D1.W = y location
  141. ; D3.W = File number to extract (not necessary if not multifile)
  142. ; D4.W = String number. First string = number 0
  143. ;----------------------------------------------------------------------------
  144. ziplib::write_string equ ziplib@0009
  145. ;----------------------------------------------------------------------------
  146. ; write_string_inv()
  147. ;
  148. ; Function: Writes a compressed string with the current font (inverted color)
  149. ; The string should not be longer than 80 characters.
  150. ;
  151. ; Input: A0 = Pointer to huffman compressed data
  152. ; D0.W = x location
  153. ; D1.W = y location
  154. ; D3.W = File number to extract (not necessary if not multifile)
  155. ; D4.W = String number. First string = number 0
  156. ;----------------------------------------------------------------------------
  157. ziplib::write_string_inv equ ziplib@000A