; Assembler header file for Zipper
; Written by DefMod (Dec  9 2012) on Sun Dec  9 15:44:04 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.

        [       :LNOT: :DEF: Zipper_Hdr
        GBLS    Zipper_Hdr

        [       :LNOT: :DEF: Get_Types
        GBLS    Get_Types
        ]
        [       :LNOT: :DEF: Types_Hdr
Get_Types                       SETS    "GET oslib/Types.Hdr"
        |
Get_Types                       SETS    ""
        ]
        $Get_Types

        [       :LNOT: :DEF: Get_FileSwitch
        GBLS    Get_FileSwitch
        ]
        [       :LNOT: :DEF: FileSwitch_Hdr
Get_FileSwitch                  SETS    "GET oslib/FileSwitch.Hdr"
        |
Get_FileSwitch                  SETS    ""
        ]
        $Get_FileSwitch

;Symbols for constants
ZipperOpenFlags_Append          *       &1
ZipperOpenFlags_NoDiscard       *       &80000000
ZipperEnumerateFlags_CreatorVersionNumber *       &1
ZipperEnumerateFlags_GeneralPurposeFlags *       &2
ZipperEnumerateFlags_CompressionMethod *       &4
ZipperEnumerateFlags_CompressedSize *       &8
ZipperEnumerateFlags_ExpandedSize *       &10
ZipperEnumerateFlags_InternalAttributes *       &20
ZipperEnumerateFlags_ExternalAttributes *       &40
ZipperEnumerateFlags_Timestamp  *       &80
ZipperEnumerateFlags_LoadAndExecAddress *       &100
ZipperEnumerateFlags_ROExpandedSize *       &200
ZipperEnumerateFlags_ROAttributes *       &400
ZipperEnumerateFlags_ROObjectType *       &800
ZipperEnumerateFlags_ROFileType *       &1000
ZipperEnumerateFlags_GBPBFilenameLen *       &2000
ZipperEnumerateFlags_FilenameLen *       &4000
ZipperEnumerateFlags_ExtraInfoLen *       &8000
ZipperEnumerateFlags_FileCommentLen *       &10000
ZipperFileOpenFlags_ROStyleTimeSpecifier *       &1
ZipperFileOpenFlags_ObjIsDir    *       &2
ZipperFileOpenFlags_ObjIsText   *       &4
ZipperFileOpenFlags_ExtraField  *       &8
ZipperFileOpenFlags_CommentField *       &10
ZipperFileOpenFlags_FileAttributes *       &20
Zipper_CompressionMethod        *       &FF
Zipper_CompressionMethodShift   *       0
Zipper_CompressionLevel         *       &F00
Zipper_CompressionLevelShift    *       8
Zipper_CompressionMethodStore   *       &0
Zipper_CompressionMethodDeflate *       &8
Zipper_CompressionLevelMinimum  *       &1
Zipper_CompressionLevelMaximum  *       &9

;Symbols for structure offsets and sizes
Zipper_UnZipHandle              *       4 ;abstract type
Zipper_ZipHandle                *       4 ;abstract type
        ^       0
        #       Bits
Zipper_OpenFlags                *       @

        ^       0
        #       Bits
Zipper_CloseFlags               *       @

        ^       0
        #       Bits
Zipper_InfoFlags                *       @

        ^       0
        #       Bits
Zipper_EnumerateFlags           *       @

        ^       0
        #       Bits
Zipper_UnZipFileOpenFlags       *       @

        ^       0
        #       Bits
Zipper_UnZipFileCloseFlags      *       @

        ^       0
        #       Bits
Zipper_UnZipFileReadFlags       *       @

        ^       0
        #       Bits
Zipper_UnZipFileEOFFlags        *       @

        ^       0
        #       Bits
Zipper_ZipFileOpenFlags         *       @

        ^       0
        #       Bits
Zipper_ZipFileCloseFlags        *       @

        ^       0
        #       Bits
Zipper_ZipFileWriteFlags        *       @

        ^       0
        #       Bits
Zipper_CompressionDetails       *       @

        ^       0
Zipper_TimeSpecifier_riscos_style_load_addr #       Bits
Zipper_TimeSpecifier_riscos_style_exec_addr #       Bits
Zipper_TimeSpecifier_riscos_style_attr #       FileSwitch_Attr
        ^       0
Zipper_TimeSpecifier_zip_style_centiseconds #       Int
Zipper_TimeSpecifier_zip_style_seconds #       Int
Zipper_TimeSpecifier_zip_style_minutes #       Int
Zipper_TimeSpecifier_zip_style_hours #       Int
Zipper_TimeSpecifier_zip_style_date #       Int
Zipper_TimeSpecifier_zip_style_month #       Int
Zipper_TimeSpecifier_zip_style_year #       Int
Zipper_TimeSpecifier            *       @

        ^       0
Zipper_FileAttributes_internal  #       Bits
Zipper_FileAttributes_external  #       Bits
Zipper_FileAttributes           *       @


;Symbols for SWI's and SWI reason codes
XZipper_UnZipOpen               *       &759C0
Zipper_UnZipOpen                *       &559C0
   ;Entry
   ;  R0 = flags (Zipper_OpenFlags)
   ;  R1 -> filename (Char)
   ;Exit
   ;  R0 = handle (Zipper_UnZipHandle)

XZipper_UnZipClose              *       &759C1
Zipper_UnZipClose               *       &559C1
   ;Entry
   ;  R0 = flags (Zipper_CloseFlags)
   ;  R1 = handle (Zipper_UnZipHandle)

XZipper_UnZipInfo               *       &759C2
Zipper_UnZipInfo                *       &559C2

Zipper_UnZipInfoObjectCount     *       &0
   ;Entry
   ;  R0 = &0 :OR: flags (Zipper_InfoFlags)
   ;  R1 = handle (Zipper_UnZipHandle)
   ;Exit
   ;  R0 = objects (Int)

Zipper_UnZipInfoArchiveComment  *       &1
   ;Entry
   ;  R0 = &1 :OR: flags (Zipper_InfoFlags)
   ;  R1 = handle (Zipper_UnZipHandle)
   ;  R2 = buffer (pointer to data)
   ;  R3 = buffer_size (Int)
   ;Exit
   ;  R0 = read (Int)

XZipper_UnZipEnumerate          *       &759C3
Zipper_UnZipEnumerate           *       &559C3
   ;Entry
   ;  R0 = flags (Zipper_EnumerateFlags)
   ;  R1 = handle (Zipper_UnZipHandle)
   ;  R2 = buffer (pointer to data)
   ;  R3 = objects (Int)
   ;  R4 = offset (Int)
   ;  R5 = buffer_size (Int)
   ;Exit
   ;  R3 = objects_read (Int)
   ;  R4 = next_offset (Int)
   ;  R5 = buffer_unused (Int)

XZipper_UnZipFileInfoToBuffer   *       &759C4
Zipper_UnZipFileInfoToBuffer    *       &559C4
   ;Entry
   ;  R0 = flags (Zipper_EnumerateFlags)
   ;  R1 = handle (Zipper_UnZipHandle)
   ;  R2 -> filename (Char)
   ;  R3 = data (pointer to data)
   ;  R4 = data_size (Int)
   ;Exit
   ;  R3 = data_end (pointer to data)
   ;  R4 = data_unused (Int)

Zipper_UnZipFileInfoToRegisters *       &0
   ;Entry
   ;  R0 = &0
   ;  R1 = handle (Zipper_UnZipHandle)
   ;  R2 -> filename (Char)
   ;Exit
   ;  R0 = obj_type (FileSwitch_ObjectType)
   ;  R2 = load_address (Bits)
   ;  R3 = exec_address (Bits)
   ;  R4 = size (Int)
   ;  R5 = attr (FileSwitch_Attr)

XZipper_UnZipFileOpen           *       &759C5
Zipper_UnZipFileOpen            *       &559C5
   ;Entry
   ;  R0 = flags (Zipper_UnZipFileOpenFlags)
   ;  R1 = handle (Zipper_UnZipHandle)
   ;  R2 -> filename (Char)

XZipper_UnZipFileClose          *       &759C6
Zipper_UnZipFileClose           *       &559C6
   ;Entry
   ;  R0 = flags (Zipper_UnZipFileCloseFlags)
   ;  R1 = handle (Zipper_UnZipHandle)

XZipper_UnZipFileRead           *       &759C7
Zipper_UnZipFileRead            *       &559C7
   ;Entry
   ;  R0 = flags (Zipper_UnZipFileReadFlags)
   ;  R1 = handle (Zipper_UnZipHandle)
   ;  R2 = data (pointer to data)
   ;  R3 = size (Int)
   ;Exit
   ;  R0 = read (Int)

XZipper_UnZipFileEOF            *       &759C8
Zipper_UnZipFileEOF             *       &559C8
   ;Entry
   ;  R0 = flags (Zipper_UnZipFileEOFFlags)
   ;  R1 = handle (Zipper_UnZipHandle)
   ;Exit
   ;  R0 = eof (Bool)

XZipper_ZipOpen                 *       &759D0
Zipper_ZipOpen                  *       &559D0
   ;Entry
   ;  R0 = flags (Zipper_OpenFlags)
   ;  R1 -> filename (Char)
   ;Exit
   ;  R0 = handle (Zipper_ZipHandle)

XZipper_ZipClose                *       &759D1
Zipper_ZipClose                 *       &559D1
   ;Entry
   ;  R0 = flags (Zipper_CloseFlags)
   ;  R1 = handle (Zipper_ZipHandle)

XZipper_ZipFileOpen             *       &759D2
Zipper_ZipFileOpen              *       &559D2
   ;Entry
   ;  R0 = flags (Zipper_ZipFileOpenFlags)
   ;  R1 = handle (Zipper_ZipHandle)
   ;  R2 -> filename (Char)
   ;  R3 = compression_details (Zipper_CompressionDetails)
   ;  R4 -> time_specifier (Zipper_TimeSpecifier)
   ;  R5 -> extra (data)
   ;  R6 = extra_size (Int)
   ;  R7 -> comment (Char)
   ;  R8 -> attr (Zipper_FileAttributes)

XZipper_ZipFileClose            *       &759D3
Zipper_ZipFileClose             *       &559D3
   ;Entry
   ;  R0 = flags (Zipper_ZipFileCloseFlags)
   ;  R1 = handle (Zipper_ZipHandle)
   ;Exit
   ;  R0 = uncompressed_size (Int)
   ;  R1 = compressed_size (Int)

XZipper_ZipFileWrite            *       &759D4
Zipper_ZipFileWrite             *       &559D4
   ;Entry
   ;  R0 = flags (Zipper_ZipFileWriteFlags)
   ;  R1 = handle (Zipper_ZipHandle)
   ;  R2 = data (pointer to data)
   ;  R3 = size (Int)

        ]
        END
