@ GNU AS assembler header file for ZLib
@ Written by DefMod (Dec  9 2012) on Sun Dec  9 15:46:01 2012
@ Tom Hughes, tom@compton.nu, 22 Sep 2002

@ OSLib---efficient, type-safe, transparent, extensible,
@ register-safe API coverage of RISC OS
@ 
@ Copyright (c) 1994-2012 Jonathan Coxhead and OSLib maintainers
@ 
@ Licence:
@ 
@    OSLib is free software; you can redistribute it and/or modify
@ it under the terms of the GNU General Public License as published by
@ the Free Software Foundation; either version 1, or (at your option)
@ any later version - and this with the following clarification and
@ special exception:
@ 
@    Linking this library statically or dynamically with other modules
@ is making a combined work based on this library. Thus, the terms
@ and conditions of the GNU General Public License cover the whole
@ combination.
@ 
@    As a special exception, the copyright holders of this library
@ give you permission to link this library with independent modules
@ to produce an executable, regardless of the license terms of these
@ independent modules, and to copy and distribute the resulting
@ executable under terms of your choice, provided that you also meet,
@ for each linked independent module, the terms and conditions of the
@ license of that module. An independent module is a module which is
@ not derived from or based on this library. If you modify this
@ library, you may extend this exception to your version of the library,
@ but you are not obliged to do so. If you do not wish to do so, delete
@ this exception statement from your version.
@ 
@    OSLib is distributed in the hope that it will be useful,
@ but WITHOUT ANY WARRANTY; without even the implied warranty of
@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@ GNU General Public License for more details.
@ 
@    You should have received a copy of the GNU General Public License
@ along with this programme; if not, write to the Free Software
@ Foundation, Inc, 675 Mass Ave, Cambridge, MA 02139, USA.

#ifndef ZLib_Hdr
#  define ZLib_Hdr

#  ifndef Get_Types
#    define Get_Types
#    include "oslib/Types.Hdr"
#  endif

#  ifndef Get_FileSwitch
#    define Get_FileSwitch
#    include "oslib/FileSwitch.Hdr"
#  endif

@Symbols for constants
#  define ZLib_BinaryData 0x0
#  define ZLib_ASCIIData 0x1
#  define ZLib_UnknownData 0x2
#  define ZLib_NoFlush 0x0
#  define ZLib_PartialFlush 0x1
#  define ZLib_SyncFlush 0x2
#  define ZLib_FullFlush 0x3
#  define ZLib_Finish 0x4
#  define ZLib_NoCompression 0x0
#  define ZLib_BestSpeed 0x1
#  define ZLib_BestCompression 0x9
#  define ZLib_DefaultCompression 0xffffffff
#  define ZLib_DefaultStrategy 0x0
#  define ZLib_Filtered 0x1
#  define ZLib_HuffmanOnly 0x2
#  define ZLib_Deflated 0x8
#  define ZLib_OK 0x0
#  define ZLib_StreamEnd 0x1
#  define ZLib_NeedDict 0x2
#  define ZLib_Errno 0xffffffff
#  define ZLib_StreamError 0xfffffffe
#  define ZLib_DataError 0xfffffffd
#  define ZLib_MemError 0xfffffffc
#  define ZLib_BufError 0xfffffffb
#  define ZLib_VersionError 0xfffffffa
#  define ZLib_SeekAbsolute 0x0
#  define ZLib_SeekRelative 0x1

@Symbols for structure offsets and sizes
        .struct 0
        .skip   Int
ZLib_DataType                  : 

        .struct 0
        .skip   Int
ZLib_FlushType                 : 

        .struct 0
        .skip   Int
ZLib_CompressionLevel          : 

        .struct 0
        .skip   Int
ZLib_CompressionStrategy       : 

        .struct 0
        .skip   Int
ZLib_CompressionMethod         : 

        .struct 0
        .skip   Int
ZLib_MemoryLevel               : 

        .struct 0
        .skip   Int
ZLib_WindowBits                : 

        .struct 0
        .skip   Int
ZLib_ReturnCode                : 

        .struct 0
        .skip   Int
ZLib_SeekType                  : 

        .struct 0
ZLib_StreamControlBlock_next_in: .skip   Int
ZLib_StreamControlBlock_avail_in: .skip   Int
ZLib_StreamControlBlock_total_in: .skip   Int
ZLib_StreamControlBlock_next_out: .skip   Int
ZLib_StreamControlBlock_avail_out: .skip   Int
ZLib_StreamControlBlock_total_out: .skip   Int
ZLib_StreamControlBlock_msg    : .skip   Ptr
ZLib_StreamControlBlock_state  : .skip   Int
ZLib_StreamControlBlock_zalloc : .skip   Ptr
ZLib_StreamControlBlock_zfree  : .skip   Ptr
ZLib_StreamControlBlock_opaque : .skip   Ptr
ZLib_StreamControlBlock_data_type: .skip   ZLib_DataType
ZLib_StreamControlBlock_adler  : .skip   Int
ZLib_StreamControlBlock_reserved: .skip   Int
ZLib_StreamControlBlock        : 

@ abstract type
#  define ZLib_GZipHandle 4


@Symbols for SWI's and SWI reason codes
.set XZLib_CompressReturnSizes,0x73ac0
.set ZLib_CompressReturnSizes,0x53ac0
   @Entry
   @  R0 = &8
   @  R1 = input_size (Int)
   @Exit
   @  R0 = workspace_size (Int)
   @  R1 = output_size (Int)

.set XZLib_Compress,0x73ac0
.set ZLib_Compress,0x53ac0
   @Entry
   @  R0 = flags (Bits)
   @  R1 = workspace (pointer to data)
   @  R2 -> input (data)
   @  R3 = input_size (Int)
   @  R4 = output (pointer to data)
   @  R5 = output_size (Int)
   @Exit
   @  R0 = status (Bits)
   @  R2 -> unused_input (data)
   @  R3 = unused_input_size (Int)
   @  R4 = unused_output (pointer to data)
   @  R5 = unused_output_size (Int)

.set XZLib_DecompressReturnSizes,0x73ac1
.set ZLib_DecompressReturnSizes,0x53ac1
   @Entry
   @  R0 = &8
   @  R1 = input_size (Int)
   @Exit
   @  R0 = workspace_size (Int)
   @  R1 = output_size (Int)

.set XZLib_Decompress,0x73ac1
.set ZLib_Decompress,0x53ac1
   @Entry
   @  R0 = flags (Bits)
   @  R1 = workspace (pointer to data)
   @  R2 -> input (data)
   @  R3 = input_size (Int)
   @  R4 = output (pointer to data)
   @  R5 = output_size (Int)
   @Exit
   @  R0 = status (Bits)
   @  R2 -> unused_input (data)
   @  R3 = unused_input_size (Int)
   @  R4 = unused_output (pointer to data)
   @  R5 = unused_output_size (Int)

.set XZLib_CRC32,0x73ac2
.set ZLib_CRC32,0x53ac2
   @Entry
   @  R0 = continuation_value (Int)
   @  R1 -> data_start (data)
   @  R2 -> data_end (data)
   @Exit
   @  R0 = crc32 (Int)

.set XZLib_Adler32,0x73ac3
.set ZLib_Adler32,0x53ac3
   @Entry
   @  R0 = continuation_value (Int)
   @  R1 -> data_start (data)
   @  R2 -> data_end (data)
   @Exit
   @  R0 = crc32 (Int)

.set XZLib_Version,0x73ac4
.set ZLib_Version,0x53ac4
   @Exit
   @  R0 -> version (Char)

.set XZLib_ZCompress,0x73ac5
.set ZLib_ZCompress,0x53ac5
   @Entry
   @  R0 = output (pointer to data)
   @  R1 = output_size (Int)
   @  R2 -> input (data)
   @  R3 = input_size (Int)
   @Exit
   @  R0 = return_code (ZLib_ReturnCode)
   @  R1 = output_used (Int)

.set XZLib_ZCompress2,0x73ac6
.set ZLib_ZCompress2,0x53ac6
   @Entry
   @  R0 = output (pointer to data)
   @  R1 = output_size (Int)
   @  R2 -> input (data)
   @  R3 = input_size (Int)
   @  R4 = compression_level (ZLib_CompressionLevel)
   @Exit
   @  R0 = return_code (ZLib_ReturnCode)
   @  R1 = output_used (Int)

.set XZLib_ZUncompress,0x73ac7
.set ZLib_ZUncompress,0x53ac7
   @Entry
   @  R0 = output (pointer to data)
   @  R1 = output_size (Int)
   @  R2 -> input (data)
   @  R3 = input_size (Int)
   @Exit
   @  R0 = return_code (ZLib_ReturnCode)
   @  R1 = output_used (Int)

.set XZLib_DeflateInit,0x73ac8
.set ZLib_DeflateInit,0x53ac8
   @Entry
   @  R0 = scb (pointer to ZLib_StreamControlBlock)
   @  R1 = compression_level (ZLib_CompressionLevel)
   @  R2 -> version_expected (Char)
   @  R3 = scb_size (Int)
   @Exit
   @  R0 = return_code (ZLib_ReturnCode)

.set XZLib_InflateInit,0x73ac9
.set ZLib_InflateInit,0x53ac9
   @Entry
   @  R0 = scb (pointer to ZLib_StreamControlBlock)
   @  R1 -> version_expected (Char)
   @  R2 = scb_size (Int)
   @Exit
   @  R0 = return_code (ZLib_ReturnCode)

.set XZLib_DeflateInit2,0x73aca
.set ZLib_DeflateInit2,0x53aca
   @Entry
   @  R0 = scb (pointer to ZLib_StreamControlBlock)
   @  R1 = compression_level (ZLib_CompressionLevel)
   @  R2 = compression_method (ZLib_CompressionMethod)
   @  R3 = window_bits (ZLib_WindowBits)
   @  R4 = memory_level (ZLib_MemoryLevel)
   @  R5 = compression_strategy (ZLib_CompressionStrategy)
   @  R6 -> version_expected (Char)
   @  R7 = scb_size (Int)
   @Exit
   @  R0 = return_code (ZLib_ReturnCode)

.set XZLib_InflateInit2,0x73acb
.set ZLib_InflateInit2,0x53acb
   @Entry
   @  R0 = scb (pointer to ZLib_StreamControlBlock)
   @  R1 = window_bits (ZLib_WindowBits)
   @  R2 -> version_expected (Char)
   @  R3 = scb_size (Int)
   @Exit
   @  R0 = return_code (ZLib_ReturnCode)

.set XZLib_Deflate,0x73acc
.set ZLib_Deflate,0x53acc
   @Entry
   @  R0 = scb (pointer to ZLib_StreamControlBlock)
   @  R1 = flush_type (ZLib_FlushType)
   @Exit
   @  R0 = return_code (ZLib_ReturnCode)

.set XZLib_DeflateEnd,0x73acd
.set ZLib_DeflateEnd,0x53acd
   @Entry
   @  R0 = scb (pointer to ZLib_StreamControlBlock)
   @Exit
   @  R0 = return_code (ZLib_ReturnCode)

.set XZLib_Inflate,0x73ace
.set ZLib_Inflate,0x53ace
   @Entry
   @  R0 = scb (pointer to ZLib_StreamControlBlock)
   @  R1 = flush_type (ZLib_FlushType)
   @Exit
   @  R0 = return_code (ZLib_ReturnCode)

.set XZLib_InflateEnd,0x73acf
.set ZLib_InflateEnd,0x53acf
   @Entry
   @  R0 = scb (pointer to ZLib_StreamControlBlock)
   @Exit
   @  R0 = return_code (ZLib_ReturnCode)

.set XZLib_DeflateSetDictionary,0x73ad0
.set ZLib_DeflateSetDictionary,0x53ad0
   @Entry
   @  R0 = scb (pointer to ZLib_StreamControlBlock)
   @  R1 -> dictionary (data)
   @  R2 = dictionary_size (Int)
   @Exit
   @  R0 = return_code (ZLib_ReturnCode)

.set XZLib_DeflateCopy,0x73ad1
.set ZLib_DeflateCopy,0x53ad1
   @Entry
   @  R0 = destination (pointer to ZLib_StreamControlBlock)
   @  R1 -> source (ZLib_StreamControlBlock)
   @Exit
   @  R0 = return_code (ZLib_ReturnCode)

.set XZLib_DeflateReset,0x73ad2
.set ZLib_DeflateReset,0x53ad2
   @Entry
   @  R0 = scb (pointer to ZLib_StreamControlBlock)
   @Exit
   @  R0 = return_code (ZLib_ReturnCode)

.set XZLib_DeflateParams,0x73ad3
.set ZLib_DeflateParams,0x53ad3
   @Entry
   @  R0 = scb (pointer to ZLib_StreamControlBlock)
   @  R1 = compression_level (ZLib_CompressionLevel)
   @  R2 = compression_strategy (ZLib_CompressionStrategy)
   @Exit
   @  R0 = return_code (ZLib_ReturnCode)

.set XZLib_InflateSetDictionary,0x73ad4
.set ZLib_InflateSetDictionary,0x53ad4
   @Entry
   @  R0 = scb (pointer to ZLib_StreamControlBlock)
   @  R1 -> dictionary (data)
   @  R2 = dictionary_size (Int)
   @Exit
   @  R0 = return_code (ZLib_ReturnCode)

.set XZLib_InflateSync,0x73ad5
.set ZLib_InflateSync,0x53ad5
   @Entry
   @  R0 = scb (pointer to ZLib_StreamControlBlock)
   @Exit
   @  R0 = return_code (ZLib_ReturnCode)

.set XZLib_InflateReset,0x73ad6
.set ZLib_InflateReset,0x53ad6
   @Entry
   @  R0 = scb (pointer to ZLib_StreamControlBlock)
   @Exit
   @  R0 = return_code (ZLib_ReturnCode)

.set XZLib_GZOpen,0x73ad7
.set ZLib_GZOpen,0x53ad7
   @Entry
   @  R0 -> filename (Char)
   @  R1 -> mode (Char)
   @  R2 = load_address_in (Bits)
   @  R3 = exec_address_in (Bits)
   @  R4 = size_in (Int)
   @  R5 = attr_in (FileSwitch_Attr)
   @Exit
   @  R0 = handle (ZLib_GZipHandle)
   @  R2 = load_address_out (Bits)
   @  R3 = exec_address_out (Bits)
   @  R4 = size_out (Int)
   @  R5 = attr_out (FileSwitch_Attr)

.set XZLib_GZRead,0x73ad8
.set ZLib_GZRead,0x53ad8
   @Entry
   @  R0 = handle (ZLib_GZipHandle)
   @  R1 = data (pointer to Byte)
   @  R2 = size (Int)
   @Exit
   @  R0 = read (Int)

.set XZLib_GZWrite,0x73ad9
.set ZLib_GZWrite,0x53ad9
   @Entry
   @  R0 = handle (ZLib_GZipHandle)
   @  R1 -> data (Byte)
   @  R2 = size (Int)
   @Exit
   @  R0 = written (Int)

.set XZLib_GZFlush,0x73ada
.set ZLib_GZFlush,0x53ada
   @Entry
   @  R0 = handle (ZLib_GZipHandle)
   @  R1 = flush_type (ZLib_FlushType)
   @Exit
   @  R0 = return_code (ZLib_ReturnCode)

.set XZLib_GZClose,0x73adb
.set ZLib_GZClose,0x53adb
   @Entry
   @  R0 = handle (ZLib_GZipHandle)
   @Exit
   @  R0 = return_code (ZLib_ReturnCode)

.set XZLib_GZError,0x73adc
.set ZLib_GZError,0x53adc
   @Entry
   @  R0 = handle (ZLib_GZipHandle)
   @Exit
   @  R0 -> message (Char)
   @  R1 = return_code (ZLib_ReturnCode)

.set XZLib_GZSeek,0x73add
.set ZLib_GZSeek,0x53add
   @Entry
   @  R0 = handle (ZLib_GZipHandle)
   @  R1 = position (Int)
   @  R2 = seek_type (ZLib_SeekType)
   @Exit
   @  R0 = new_position (Int)

.set XZLib_GZTell,0x73ade
.set ZLib_GZTell,0x53ade
   @Entry
   @  R0 = handle (ZLib_GZipHandle)
   @Exit
   @  R0 = position (Int)

.set XZLib_GZEOF,0x73adf
.set ZLib_GZEOF,0x53adf
   @Entry
   @  R0 = handle (ZLib_GZipHandle)
   @Exit
   @  R0 = eof (Bool)

.set XZLib_TaskAssociate,0x73adf
.set ZLib_TaskAssociate,0x53adf
   @Entry
   @  R0 = scb (pointer to ZLib_StreamControlBlock)

#endif
