7fa1924b4016 — Laurens Holst 5 years ago
Archive: Rename to GzipArchive.
3 files changed, 132 insertions(+), 132 deletions(-)

M src/Application.asm
M src/COM.asm
M src/Archive.asm => src/GzipArchive.asm
M src/Application.asm +10 -10
@@ 122,22 122,22 @@ Application_InflateToFile:
 	call Application_IsFast
 	cpl
 	push ix
-	call Archive_class.New
-	call Archive_Construct
+	call GzipArchive_class.New
+	call GzipArchive_Construct
 
 	ex (sp),ix
 	call Application_CreateFileWriter
 	call Application_PreAllocateOutput
 	pop ix
 	push de
-	call Archive_Extract
+	call GzipArchive_Extract
 
 	ex (sp),ix
 	call FileWriter_Destruct
 	call FileWriter_class.Delete
 	pop ix
-	call Archive_Destruct
-	call Archive_class.Delete
+	call GzipArchive_Destruct
+	call GzipArchive_class.Delete
 	pop ix
 	call FileReader_Destruct
 	call FileReader_class.Delete

          
@@ 153,21 153,21 @@ Application_InflateTest:
 	call Application_IsFast
 	cpl
 	push ix
-	call Archive_class.New
-	call Archive_Construct
+	call GzipArchive_class.New
+	call GzipArchive_Construct
 
 	ex (sp),ix
 	call Application_CreateNullWriter
 	pop ix
 	push de
-	call Archive_Extract
+	call GzipArchive_Extract
 
 	ex (sp),ix
 	call NullWriter_Destruct
 	call NullWriter_class.Delete
 	pop ix
-	call Archive_Destruct
-	call Archive_class.Delete
+	call GzipArchive_Destruct
+	call GzipArchive_class.Delete
 	pop ix
 	call FileReader_Destruct
 	call FileReader_class.Delete

          
M src/COM.asm +1 -1
@@ 36,7 36,7 @@ COM_Main:
 	INCLUDE "Class.asm"
 	INCLUDE "Application.asm"
 	INCLUDE "CLI.asm"
-	INCLUDE "Archive.asm"
+	INCLUDE "GzipArchive.asm"
 	INCLUDE "deflate/Inflate.asm"
 	INCLUDE "deflate/Alphabet.asm"
 	INCLUDE "deflate/AlphabetTest.asm"

          
M src/Archive.asm => src/GzipArchive.asm +121 -121
@@ 1,17 1,17 @@ 
 ;
 ; Gzip archive
 ;
-Archive_SIGNATURE_1: equ 1FH
-Archive_SIGNATURE_2: equ 8BH
-Archive_DEFLATE_ID: equ 8
-Archive_FTEXT: equ 1 << 0;
-Archive_FHCRC: equ 1 << 1;
-Archive_FEXTRA: equ 1 << 2;
-Archive_FNAME: equ 1 << 3;
-Archive_FCOMMENT: equ 1 << 4;
-Archive_RESERVED: equ 1 << 5 | 1 << 6 | 1 << 7;
+GzipArchive_SIGNATURE_1: equ 1FH
+GzipArchive_SIGNATURE_2: equ 8BH
+GzipArchive_DEFLATE_ID: equ 8
+GzipArchive_FTEXT: equ 1 << 0;
+GzipArchive_FHCRC: equ 1 << 1;
+GzipArchive_FEXTRA: equ 1 << 2;
+GzipArchive_FNAME: equ 1 << 3;
+GzipArchive_FCOMMENT: equ 1 << 4;
+GzipArchive_RESERVED: equ 1 << 5 | 1 << 6 | 1 << 7;
 
-Archive: MACRO
+GzipArchive: MACRO
 	reader:
 		dw 0
 	inflate:

          
@@ 35,34 35,34 @@ Archive: MACRO
 	_size:
 	ENDM
 
-Archive_class: Class Archive, Archive_template, Heap_main
-Archive_template: Archive
+GzipArchive_class: Class GzipArchive, GzipArchive_template, Heap_main
+GzipArchive_template: GzipArchive
 
 ; a = -1: CRC32 check enabled, 0: disabled
 ; de = reader
 ; ix = this
 ; ix <- this
 ; de <- this
-Archive_Construct:
-	ld (ix + Archive.reader),e
-	ld (ix + Archive.reader + 1),d
-	ld (ix + Archive.crc32CheckEnabled),a
-	call Archive_ReadHeader
+GzipArchive_Construct:
+	ld (ix + GzipArchive.reader),e
+	ld (ix + GzipArchive.reader + 1),d
+	ld (ix + GzipArchive.crc32CheckEnabled),a
+	call GzipArchive_ReadHeader
 	ld e,ixl
 	ld d,ixh
 	ret
 
 ; ix = this
 ; ix <- this
-Archive_Destruct:
+GzipArchive_Destruct:
 	ret
 
 ; ix = this
 ; de <- file reader
 ; iy <- file reader
-Archive_GetReaderIY:
-	ld e,(ix + Archive.reader)
-	ld d,(ix + Archive.reader + 1)
+GzipArchive_GetReaderIY:
+	ld e,(ix + GzipArchive.reader)
+	ld d,(ix + GzipArchive.reader + 1)
 	ld iyl,e
 	ld iyh,d
 	ret

          
@@ 70,134 70,134 @@ Archive_GetReaderIY:
 ; ix = this
 ; de <- Inflate implementation
 ; ix <- Inflate implementation
-Archive_GetInflate:
-	ld e,(ix + Archive.inflate)
-	ld d,(ix + Archive.inflate + 1)
+GzipArchive_GetInflate:
+	ld e,(ix + GzipArchive.inflate)
+	ld d,(ix + GzipArchive.inflate + 1)
 	ld ixl,e
 	ld ixh,d
 	ret
 
 ; ix = this
-Archive_ReadHeader:
-	call Archive_GetReaderIY
+GzipArchive_ReadHeader:
+	call GzipArchive_GetReaderIY
 	call Reader_Read_IY
-	cp Archive_SIGNATURE_1
-	ld hl,Archive_notGzipError
+	cp GzipArchive_SIGNATURE_1
+	ld hl,GzipArchive_notGzipError
 	jp nz,System_TerminateWithError
 	call Reader_Read_IY
-	cp Archive_SIGNATURE_2
-	ld hl,Archive_notGzipError
+	cp GzipArchive_SIGNATURE_2
+	ld hl,GzipArchive_notGzipError
 	jp nz,System_TerminateWithError
 	call Reader_Read_IY
-	cp Archive_DEFLATE_ID
-	ld hl,Archive_notDeflateError
+	cp GzipArchive_DEFLATE_ID
+	ld hl,GzipArchive_notDeflateError
 	jp nz,System_TerminateWithError
 
 	call Reader_Read_IY
-	ld (ix + Archive.flags),a
+	ld (ix + GzipArchive.flags),a
 	call Reader_ReadDoubleWord_IY
-	ld (ix + Archive.mtime),l
-	ld (ix + Archive.mtime + 1),h
-	ld (ix + Archive.mtime + 2),e
-	ld (ix + Archive.mtime + 3),d
+	ld (ix + GzipArchive.mtime),l
+	ld (ix + GzipArchive.mtime + 1),h
+	ld (ix + GzipArchive.mtime + 2),e
+	ld (ix + GzipArchive.mtime + 3),d
 	call Reader_Read_IY
-	ld (ix + Archive.xfl),a
+	ld (ix + GzipArchive.xfl),a
 	call Reader_Read_IY
-	ld (ix + Archive.os),a
+	ld (ix + GzipArchive.os),a
 
-	ld a,(ix + Archive.flags)
-	and Archive_RESERVED
-	ld hl,Archive_unknownFlagError
+	ld a,(ix + GzipArchive.flags)
+	and GzipArchive_RESERVED
+	ld hl,GzipArchive_unknownFlagError
 	jp nz,System_TerminateWithError
 
-	ld a,(ix + Archive.flags)
-	and Archive_FEXTRA
-	call nz,Archive_SkipExtra
+	ld a,(ix + GzipArchive.flags)
+	and GzipArchive_FEXTRA
+	call nz,GzipArchive_SkipExtra
 
-	ld a,(ix + Archive.flags)
-	and Archive_FNAME
-	call nz,Archive_SkipASCIIZ
+	ld a,(ix + GzipArchive.flags)
+	and GzipArchive_FNAME
+	call nz,GzipArchive_SkipASCIIZ
 
-	ld a,(ix + Archive.flags)
-	and Archive_FCOMMENT
-	call nz,Archive_SkipASCIIZ
+	ld a,(ix + GzipArchive.flags)
+	and GzipArchive_FCOMMENT
+	call nz,GzipArchive_SkipASCIIZ
 
-	ld a,(ix + Archive.flags)
-	and Archive_FHCRC
-	call nz,Archive_SkipHeaderCRC
+	ld a,(ix + GzipArchive.flags)
+	and GzipArchive_FHCRC
+	call nz,GzipArchive_SkipHeaderCRC
 	ret
 
 ; ix = this
-Archive_ReadFooter:
-	call Archive_GetReaderIY
+GzipArchive_ReadFooter:
+	call GzipArchive_GetReaderIY
 	call Reader_ReadDoubleWord_IY
-	ld (ix + Archive.crc32),l
-	ld (ix + Archive.crc32 + 1),h
-	ld (ix + Archive.crc32 + 2),e
-	ld (ix + Archive.crc32 + 3),d
+	ld (ix + GzipArchive.crc32),l
+	ld (ix + GzipArchive.crc32 + 1),h
+	ld (ix + GzipArchive.crc32 + 2),e
+	ld (ix + GzipArchive.crc32 + 3),d
 	call Reader_ReadDoubleWord_IY
-	ld (ix + Archive.isize),l
-	ld (ix + Archive.isize + 1),h
-	ld (ix + Archive.isize + 2),e
-	ld (ix + Archive.isize + 3),d
+	ld (ix + GzipArchive.isize),l
+	ld (ix + GzipArchive.isize + 1),h
+	ld (ix + GzipArchive.isize + 2),e
+	ld (ix + GzipArchive.isize + 3),d
 	ret
 
 ; de = writer (min 32K)
 ; ix = this
-Archive_Extract:
-	bit 0,(ix + Archive.crc32CheckEnabled)
-	call nz,Archive_CreateCRC32Checker
-	call Archive_CreateInflate
-	call Archive_Inflate
-	call Archive_ReadFooter
-	call Archive_Verify
-	call Archive_DestroyInflate
-	bit 0,(ix + Archive.crc32CheckEnabled)
-	call nz,Archive_DestroyCRC32Checker
+GzipArchive_Extract:
+	bit 0,(ix + GzipArchive.crc32CheckEnabled)
+	call nz,GzipArchive_CreateCRC32Checker
+	call GzipArchive_CreateInflate
+	call GzipArchive_Inflate
+	call GzipArchive_ReadFooter
+	call GzipArchive_Verify
+	call GzipArchive_DestroyInflate
+	bit 0,(ix + GzipArchive.crc32CheckEnabled)
+	call nz,GzipArchive_DestroyCRC32Checker
 	ret
 
 ; de = writer (min 32K)
 ; ix = this
-Archive_CreateInflate:
-	ld l,(ix + Archive.reader)
-	ld h,(ix + Archive.reader + 1)
+GzipArchive_CreateInflate:
+	ld l,(ix + GzipArchive.reader)
+	ld h,(ix + GzipArchive.reader + 1)
 	push ix
 	call Inflate_class.New
 	call Inflate_Construct
 	pop ix
-	ld (ix + Archive.inflate),e
-	ld (ix + Archive.inflate + 1),d
+	ld (ix + GzipArchive.inflate),e
+	ld (ix + GzipArchive.inflate + 1),d
 	ret
 
 ; ix = this
-Archive_DestroyInflate:
+GzipArchive_DestroyInflate:
 	push ix
-	call Archive_GetInflate
+	call GzipArchive_GetInflate
 	call Inflate_Destruct
 	call Inflate_class.Delete
 	pop ix
-	ld (ix + Archive.inflate),0
-	ld (ix + Archive.inflate + 1),0
+	ld (ix + GzipArchive.inflate),0
+	ld (ix + GzipArchive.inflate + 1),0
 	ret
 
 ; de = writer (min 32K)
 ; ix = this
-Archive_CreateCRC32Checker:
+GzipArchive_CreateCRC32Checker:
 	push de
 	push ix
 	call CRC32Checker_class.New
 	call CRC32Checker_Construct
 	pop ix
-	ld (ix + Archive.crc32Checker),e
-	ld (ix + Archive.crc32Checker + 1),d
+	ld (ix + GzipArchive.crc32Checker),e
+	ld (ix + GzipArchive.crc32Checker + 1),d
 	pop de
 	ret
 
 ; de = writer (min 32K)
 ; ix = this
-Archive_DestroyCRC32Checker:
-	ld e,(ix + Archive.crc32Checker)
-	ld d,(ix + Archive.crc32Checker + 1)
+GzipArchive_DestroyCRC32Checker:
+	ld e,(ix + GzipArchive.crc32Checker)
+	ld d,(ix + GzipArchive.crc32Checker + 1)
 	push ix
 	ld ixl,e
 	ld ixh,d

          
@@ 207,27 207,27 @@ Archive_DestroyCRC32Checker:
 	ret
 
 ; ix = this
-Archive_Inflate:
+GzipArchive_Inflate:
 	push ix
-	call Archive_GetInflate
+	call GzipArchive_GetInflate
 	call Inflate_Inflate
 	pop ix
 	ret
 
 ; ix = this
-Archive_Verify:
-	call Archive_VerifyISIZE
-	ld hl,Archive_isizeMismatchError
+GzipArchive_Verify:
+	call GzipArchive_VerifyISIZE
+	ld hl,GzipArchive_isizeMismatchError
 	jp nz,System_TerminateWithError
 
-	call Archive_VerifyCRC32
-	ld hl,Archive_crc32MismatchError
+	call GzipArchive_VerifyCRC32
+	ld hl,GzipArchive_crc32MismatchError
 	jp nz,System_TerminateWithError
 	ret
 
 ; ix = this
-Archive_SkipExtra:
-	call Archive_GetReaderIY
+GzipArchive_SkipExtra:
+	call GzipArchive_GetReaderIY
 	call Reader_ReadWord_IY
 	ld c,e
 	ld b,d

          
@@ 235,8 235,8 @@ Archive_SkipExtra:
 	ret
 
 ; ix = this
-Archive_SkipASCIIZ: PROC
-	call Archive_GetReaderIY
+GzipArchive_SkipASCIIZ: PROC
+	call GzipArchive_GetReaderIY
 Loop:
 	call Reader_Read_IY
 	and a

          
@@ 245,61 245,61 @@ Loop:
 	ENDP
 
 ; ix = this
-Archive_SkipHeaderCRC:
-	call Archive_GetReaderIY
+GzipArchive_SkipHeaderCRC:
+	call GzipArchive_GetReaderIY
 	call Reader_ReadWord_IY
 	ret
 
 ; ix = this
 ; f <- nz: mismatch
-Archive_VerifyISIZE:
+GzipArchive_VerifyISIZE:
 	push ix
-	call Archive_GetInflate
+	call GzipArchive_GetInflate
 	call Inflate_GetWriter
 	call Writer_GetCount
 	pop ix
 	ld a,e
-	cp (ix + Archive.isize)
+	cp (ix + GzipArchive.isize)
 	ret nz
 	ld a,d
-	cp (ix + Archive.isize + 1)
+	cp (ix + GzipArchive.isize + 1)
 	ret nz
 	ld a,c
-	cp (ix + Archive.isize + 2)
+	cp (ix + GzipArchive.isize + 2)
 	ret nz
 	ld a,b
-	cp (ix + Archive.isize + 3)
+	cp (ix + GzipArchive.isize + 3)
 	ret
 
 ; ix = this
 ; f <- nz: mismatch
-Archive_VerifyCRC32:
-	bit 0,(ix + Archive.crc32CheckEnabled)
+GzipArchive_VerifyCRC32:
+	bit 0,(ix + GzipArchive.crc32CheckEnabled)
 	ret z
-	ld e,(ix + Archive.crc32Checker)
-	ld d,(ix + Archive.crc32Checker + 1)
+	ld e,(ix + GzipArchive.crc32Checker)
+	ld d,(ix + GzipArchive.crc32Checker + 1)
 	push de
-	ld e,(ix + Archive.crc32)
-	ld d,(ix + Archive.crc32 + 1)
-	ld c,(ix + Archive.crc32 + 2)
-	ld b,(ix + Archive.crc32 + 3)
+	ld e,(ix + GzipArchive.crc32)
+	ld d,(ix + GzipArchive.crc32 + 1)
+	ld c,(ix + GzipArchive.crc32 + 2)
+	ld b,(ix + GzipArchive.crc32 + 3)
 	ex (sp),ix
 	call CRC32Checker_VerifyCRC32
 	pop ix
 	ret
 
 ;
-Archive_notGzipError:
+GzipArchive_notGzipError:
 	db "Not a GZIP file.",13,10,0
 
-Archive_notDeflateError:
+GzipArchive_notDeflateError:
 	db "Not compressed with DEFLATE.",13,10,0
 
-Archive_unknownFlagError:
+GzipArchive_unknownFlagError:
 	db "Unknown flag.",13,10,0
 
-Archive_isizeMismatchError:
+GzipArchive_isizeMismatchError:
 	db "Inflated size mismatch.",13,10,0
 
-Archive_crc32MismatchError:
+GzipArchive_crc32MismatchError:
 	db "Inflated CRC32 mismatch.",13,10,0