2
This file is part of the Free Pascal run time library.
4
A file in Amiga system run time library.
5
Copyright (c) 1998-2002 by Nils Sj�holm.
6
member of the Amiga RTL development team.
8
This is a unit for xadmaster.library
10
See the file COPYING.FPC, included in this distribution,
11
for details about the copyright.
13
This program is distributed in the hope that it will be useful,
14
but WITHOUT ANY WARRANTY; without even the implied warranty of
15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17
**********************************************************************}
19
First version of this unit.
22
nils.sjoholm@mailbox.swipnet.se Nils Sjoholm
26
{$I useamigasmartlink.inc}
27
{$ifdef use_amiga_smartlink}
29
{$endif use_amiga_smartlink}
34
USES Exec,utility,amigados;
37
XADMASTERNAME : PChar = 'xadmaster.library';
41
$VER: xadmaster.h 12.0 (24.06.2002)
42
xadmaster.library defines and structures
44
Copyright � 1998-2002 by Dirk St�cker
50
XADNAME = 'xadmaster.library';
51
{ NOTE: Nearly all structures need to be allocated using the
52
xadAllocObject function. }
55
library base structure
62
PxadMasterBase = ^txadMasterBase;
63
txadMasterBase = record
64
xmb_LibNode : tLibrary;
65
xmb_SysBase : PExecBase;
66
xmb_DOSBase : PDosLibrary;
67
xmb_UtilityBase : PUtilityBase;
68
xmb_RecogSize : ULONG; { read only }
69
xmb_DefaultName : STRPTR; { name for XADFIF_NOFILENAME (V6) }
74
tag-function call flags
77
{ input tags for xadGetInfo, only one can be specified per call }
80
XAD_INSIZE = TAG_USER + 1;
81
XAD_INFILENAME = TAG_USER + 2;
82
XAD_INFILEHANDLE = TAG_USER + 3;
83
XAD_INMEMORY = TAG_USER + 4;
84
XAD_INHOOK = TAG_USER + 5;
86
XAD_INSPLITTED = TAG_USER + 6;
88
XAD_INDISKARCHIVE = TAG_USER + 7;
90
XAD_INXADSTREAM = TAG_USER + 8;
92
XAD_INDEVICE = TAG_USER + 9;
93
{ output tags, only one can be specified per call, xadXXXXUnArc }
95
XAD_OUTSIZE = TAG_USER + 10;
96
XAD_OUTFILENAME = TAG_USER + 11;
97
XAD_OUTFILEHANDLE = TAG_USER + 12;
98
XAD_OUTMEMORY = TAG_USER + 13;
99
XAD_OUTHOOK = TAG_USER + 14;
100
XAD_OUTDEVICE = TAG_USER + 15;
102
XAD_OUTXADSTREAM = TAG_USER + 16;
103
{ object allocation tags for xadAllocObjectA }
104
{ XADOBJ_FILEINFO, size of needed name space }
105
XAD_OBJNAMESIZE = TAG_USER + 20;
106
{ XADOBJ_FILEINFO, size of needed comment space }
107
XAD_OBJCOMMENTSIZE = TAG_USER + 21;
108
{ XADOBJ_FILEINFO & XADOBJ_DISKINFO, self use size }
109
XAD_OBJPRIVINFOSIZE = TAG_USER + 22;
110
{ XADOBJ_DISKINFO, number of needed entries }
111
XAD_OBJBLOCKENTRIES = TAG_USER + 23;
112
{ tags for xadGetInfo, xadFileUnArc and xadDiskUnArc }
113
{ do not use extern clients }
114
XAD_NOEXTERN = TAG_USER + 50;
115
{ password when needed }
116
XAD_PASSWORD = TAG_USER + 51;
117
{ number of wanted entry }
118
XAD_ENTRYNUMBER = TAG_USER + 52;
119
{ the progress hook }
120
XAD_PROGRESSHOOK = TAG_USER + 53;
122
XAD_OVERWRITE = TAG_USER + 54;
123
{ create directory tree }
124
XAD_MAKEDIRECTORY = TAG_USER + 55;
125
{ ignore drive geometry ? }
126
XAD_IGNOREGEOMETRY = TAG_USER + 56;
128
XAD_LOWCYLINDER = TAG_USER + 57;
130
XAD_HIGHCYLINDER = TAG_USER + 58;
131
{ verify for disk hook }
132
XAD_VERIFY = TAG_USER + 59;
133
{ do not delete partial/corrupt files (V3.3) }
134
XAD_NOKILLPARTIAL = TAG_USER + 60;
135
{ format output device (V5) }
136
XAD_FORMAT = TAG_USER + 61;
137
{ sector labels are stored on disk (V9) }
138
XAD_USESECTORLABELS = TAG_USER + 62;
139
{ ignore the client, if certain flags are set (V11) }
140
XAD_IGNOREFLAGS = TAG_USER + 63;
141
{ ignore the client, if certain flags are NOT set (V11) }
142
XAD_ONLYFLAGS = TAG_USER + 64;
143
{ input tags for xadConvertDates, only one can be passed }
144
{ unix date variable }
145
XAD_DATEUNIX = TAG_USER + 70;
146
{ amiga date variable }
147
XAD_DATEAMIGA = TAG_USER + 71;
149
XAD_DATEDATESTAMP = TAG_USER + 72;
151
XAD_DATEXADDATE = TAG_USER + 73;
153
XAD_DATECLOCKDATA = TAG_USER + 74;
154
{ input is system time }
155
XAD_DATECURRENTTIME = TAG_USER + 75;
156
{ MS-DOS packed format (V2) }
157
XAD_DATEMSDOS = TAG_USER + 76;
158
{ Mac date variable (V8) }
159
XAD_DATEMAC = TAG_USER + 77;
160
{ CP/M data structure (V10) }
161
XAD_DATECPM = TAG_USER + 78;
162
{ CP/M data structure type 2 (V10) }
163
XAD_DATECPM2 = TAG_USER + 79;
164
{ ISO9660 date structure (V11) }
165
XAD_DATEISO9660 = TAG_USER + 300;
166
{ output tags, there can be specified multiple tags for one call }
167
{ unix date variable }
168
XAD_GETDATEUNIX = TAG_USER + 80;
169
{ amiga date variable }
170
XAD_GETDATEAMIGA = TAG_USER + 81;
172
XAD_GETDATEDATESTAMP = TAG_USER + 82;
174
XAD_GETDATEXADDATE = TAG_USER + 83;
176
XAD_GETDATECLOCKDATA = TAG_USER + 84;
177
{ MS-DOS packed format (V2) }
178
XAD_GETDATEMSDOS = TAG_USER + 86;
179
{ Mac date variable (V8) }
180
XAD_GETDATEMAC = TAG_USER + 87;
181
{ CP/M data structure (V10) }
182
XAD_GETDATECPM = TAG_USER + 88;
183
{ CP/M data structure type 2 (V10) }
184
XAD_GETDATECPM2 = TAG_USER + 89;
185
{ ISO9660 date structure (V11) }
186
XAD_GETDATEISO9660 = TAG_USER + 320;
187
{ following tags need locale.library to be installed }
188
{ make local to GMT time }
189
XAD_MAKEGMTDATE = TAG_USER + 90;
190
{ make GMT to local time }
191
XAD_MAKELOCALDATE = TAG_USER + 91;
192
{ tags for xadHookTagAccess (V3) }
193
{ the hook uses xadSkipInfo (V3) }
194
XAD_USESKIPINFO = TAG_USER + 104;
195
{ pass sector labels with XADAC_WRITE (V9) }
196
XAD_SECTORLABELS = TAG_USER + 105;
197
{ pointer to UWORD value (V3) }
198
XAD_GETCRC16 = TAG_USER + 120;
199
{ pointer to ULONG value (V3) }
200
XAD_GETCRC32 = TAG_USER + 121;
201
{ ID for crc calculation (V3) }
202
XAD_CRC16ID = TAG_USER + 130;
203
{ ID for crc calculation (V3) }
204
XAD_CRC32ID = TAG_USER + 131;
205
{ tags for xadConvertProtection (V4) }
206
{ Amiga type protection bits (V4) }
207
XAD_PROTAMIGA = TAG_USER + 160;
208
{ protection bits in UNIX mode (V4) }
209
XAD_PROTUNIX = TAG_USER + 161;
210
{ MSDOS type protection bits (V4) }
211
XAD_PROTMSDOS = TAG_USER + 162;
212
{ input is a xadFileInfo structure (V11) }
213
XAD_PROTFILEINFO = TAG_USER + 163;
214
{ return Amiga protection bits (V4) }
215
XAD_GETPROTAMIGA = TAG_USER + 170;
216
{ return UNIX protection bits (V11) }
217
XAD_GETPROTUNIX = TAG_USER + 171;
218
{ return MSDOS protection bits (V11) }
219
XAD_GETPROTMSDOS = TAG_USER + 172;
220
{ fill xadFileInfo protection fields (V11) }
221
XAD_GETPROTFILEINFO = TAG_USER + 173;
222
{ tags for xadGetDiskInfo (V7) }
223
{ the client to start with (V7) }
224
XAD_STARTCLIENT = TAG_USER + 180;
225
{ do not create XADERR_EMPTY (V8) }
226
XAD_NOEMPTYERROR = TAG_USER + 181;
227
{ tags for xadFreeHookAccess (V8) }
228
{ error occured, call abort method (V8) }
229
XAD_WASERROR = TAG_USER + 190;
230
{ tags for miscellaneous stuff }
231
{ xadArchiveInfo for stream hooks (V8) }
232
XAD_ARCHIVEINFO = TAG_USER + 200;
233
{ error code of function (V12) }
234
XAD_ERRORCODE = TAG_USER + 201;
235
{ tags for xadAddFileEntry and xadAddDiskEntry (V10) }
236
{ set xai_InPos after call (V10) }
237
XAD_SETINPOS = TAG_USER + 240;
238
{ insert dirs at list start (V10) }
239
XAD_INSERTDIRSFIRST = TAG_USER + 241;
240
{ tags for xadConvertName (V12) }
241
(* UWORD , default is {'/','\\',0} in source charset (V12) *)
242
XAD_PATHSEPERATOR = TAG_USER + 260;
243
{ the characterset of string (V12) }
244
XAD_CHARACTERSET = TAG_USER + 261;
245
{ maximum size of following (V12) }
246
XAD_STRINGSIZE = TAG_USER + 262;
247
{ zero-terminated string (V12) }
248
XAD_CSTRING = TAG_USER + 263;
249
{ lengthed Pascal string (V12) }
250
XAD_PSTRING = TAG_USER + 264;
251
{ an xad string (V12) }
252
XAD_XADSTRING = TAG_USER + 265;
253
{ default is TRUE (V12) }
254
XAD_ADDPATHSEPERATOR = TAG_USER + 266;
255
{ tags for xadGetFilename (V12) }
256
{ default is FALSE (V12) }
257
XAD_NOLEADINGPATH = TAG_USER + 280;
258
{ default is FALSE (V12) }
259
XAD_NOTRAILINGPATH = TAG_USER + 281;
260
{ default are #?()[]~% :|",1-31,127-160 (V12) }
261
XAD_MASKCHARACTERS = TAG_USER + 282;
262
{ default is '_' (V12) }
263
XAD_MASKINGCHAR = TAG_USER + 283;
264
{ pointer which should hold buf size (V12) }
265
XAD_REQUIREDBUFFERSIZE = TAG_USER + 284;
266
{ Places 300-339 used for dates! }
269
objects for xadAllocObjectA
272
{ struct xadArchiveInfo }
273
XADOBJ_ARCHIVEINFO = $0001;
274
{ struct xadFileInfo }
275
XADOBJ_FILEINFO = $0002;
276
{ struct xadDiskInfo }
277
XADOBJ_DISKINFO = $0003;
279
XADOBJ_HOOKPARAM = $0004;
280
{ struct xadDeviceInfo }
281
XADOBJ_DEVICEINFO = $0005;
282
{ struct xadProgressInfo }
283
XADOBJ_PROGRESSINFO = $0006;
284
{ struct xadTextInfo }
285
XADOBJ_TEXTINFO = $0007;
286
{ struct xadSplitFile (V2) }
287
XADOBJ_SPLITFILE = $0008;
288
{ struct xadSkipInfo (V3) }
289
XADOBJ_SKIPINFO = $0009;
290
{ struct xadImageInfo (V4) }
291
XADOBJ_IMAGEINFO = $000A;
292
{ struct xadSpecial (V11) }
293
XADOBJ_SPECIAL = $000B;
294
{ result type of xadAllocVec }
295
{ memory of requested size and type }
296
XADOBJ_MEMBLOCK = $0100;
298
{ an typed XAD string (V12) }
299
XADOBJ_STRING = $0101;
302
modes for xadCalcCRC126 and xadCalcCRC32
305
XADCRC16_ID1 = $A001;
306
XADCRC32_ID1 = $EDB88320;
312
{ read data into buffer }
314
{ write buffer data to file/memory }
318
{ initialize the hook }
320
{ end up hook work, free stuff }
322
{ an error occured, delete partial stuff }
324
{ complete input size is needed }
326
{ return disk image info (V4) }
330
PxadHookParam = ^txadHookParam;
331
txadHookParam = record
333
xhp_CommandData : LONG;
334
xhp_BufferPtr : APTR;
335
xhp_BufferSize : ULONG;
336
xhp_DataPos : ULONG; { current seek position }
337
xhp_PrivatePtr : APTR;
338
xhp_TagList : APTR; { allows to transport tags to hook (V9) }
341
{ xadHookAccess commands }
348
{ copy input to output }
350
{ seek in input file }
351
XADAC_INPUTSEEK = 13;
352
{ seek in output file }
353
XADAC_OUTPUTSEEK = 14;
359
{ Own date structure to cover all possible dates in a human friendly
360
format. xadConvertDates may be used to convert between different date
361
structures and variables. }
364
PxadDate = ^txadDate;
366
xd_Micros : ULONG; { values 0 to 999999 }
367
xd_Year : LONG; { values 1 to 2147483648 }
368
xd_Month : UBYTE; { values 1 to 12 }
369
xd_WeekDay : UBYTE; { values 1 to 7 }
370
xd_Day : UBYTE; { values 1 to 31 }
371
xd_Hour : UBYTE; { values 0 to 23 }
372
xd_Minute : UBYTE; { values 0 to 59 }
373
xd_Second : UBYTE; { values 0 to 59 }
376
{ monday is the first day and }
381
XADDAY_WEDNESDAY = 3;
385
{ sunday the last day of a week }
389
PxadDeviceInfo = ^txadDeviceInfo;
390
txadDeviceInfo = record { for XAD_OUTDEVICE tag }
391
xdi_DeviceName : STRPTR; { name of device }
392
xdi_Unit : ULONG; { unit of device }
393
xdi_DOSName : STRPTR; { instead of Device+Unit, dos name without ':' }
396
PxadSplitFile = ^txadSplitFile;
397
txadSplitFile = record { for XAD_INSPLITTED }
398
xsf_Next : PxadSplitFile;
399
xsf_Type : ULONG; { XAD_INFILENAME, XAD_INFILEHANDLE, XAD_INMEMORY, XAD_INHOOK }
400
xsf_Size : ULONG; { necessary for XAD_INMEMORY, useful for others }
401
xsf_Data : ULONG; { FileName, Filehandle, Hookpointer or Memory }
404
PxadSkipInfo = ^txadSkipInfo;
405
txadSkipInfo = record
406
xsi_Next : PxadSkipInfo;
407
xsi_Position : ULONG; { position, where it should be skipped }
408
xsi_SkipSize : ULONG; { size to skip }
411
PxadImageInfo = ^txadImageInfo;
412
txadImageInfo = record { for XADHC_IMAGEINFO }
413
xii_SectorSize : ULONG; { usually 512 }
414
xii_FirstSector : ULONG; { of the image file }
415
xii_NumSectors : ULONG; { of the image file }
416
xii_TotalSectors : ULONG; { of this device type }
420
PxadClient = ^txadClient;
422
xc_Next : PxadClient;
423
xc_Version : UWORD; { set to XADCLIENT_VERSION }
424
xc_MasterVersion : UWORD;
425
xc_ClientVersion : UWORD;
426
xc_ClientRevision : UWORD;
427
xc_RecogSize : ULONG; { needed size to recog the type }
428
xc_Flags : ULONG; { see XADCF_xxx defines }
429
xc_Identifier : ULONG; { ID of internal clients }
430
xc_ArchiverName : STRPTR;
431
xc_RecogData : function :BOOL;
432
xc_GetInfo : function :LONG;
433
xc_UnArchive : function :LONG;
434
xc_Free : procedure ;
438
ASM(BOOL) xc_RecogData(REG(d0, ULONG size), REG(a0, STRPTR data),
439
REG(a6, struct xadMasterBase xadMasterBase));
440
ASM(LONG) xc_GetInfo(REG(a0, struct xadArchiveInfo ai),
441
REG(a6, struct xadMasterBase xadMasterBase));
442
ASM(LONG) xc_UnArchive(REG(a0, struct xadArchiveInfo ai),
443
REG(a6, struct xadMasterBase xadMasterBase));
444
ASM(void) xc_Free(REG(a0, struct xadArchiveInfo ai),
445
REG(a6, struct xadMasterBase xadMasterBase));
447
{ xc_RecogData returns 1 when recognized and 0 when not, all the others
448
return 0 when ok and XADERR values on error. xc_Free has no return
451
Filesystem clients need to clear xc_RecogSize and xc_RecogData. The
452
recognition is automatically done by GetInfo. XADERR_FILESYSTEM is
453
returned in case of unknown format. If it is known detection should
454
go on and any other code may be returned, if it fails.
455
The field xc_ArchiverName means xc_FileSystemName for filesystem
460
PxadSpecialUnixDevice = ^txadSpecialUnixDevice;
461
txadSpecialUnixDevice = record
462
xfis_MajorVersion : ULONG; { major device version }
463
xfis_MinorVersion : ULONG; { minor device version }
466
PxadSpecialAmigaAddress = ^txadSpecialAmigaAddress;
467
txadSpecialAmigaAddress = record
468
xfis_JumpAddress : ULONG; { code executaion start address }
469
xfis_DecrunchAddress : ULONG; { decrunch start of code }
472
PxadSpecialCBM8bit = ^txadSpecialCBM8bit;
473
txadSpecialCBM8bit = record
474
xfis_FileType : UBYTE; { File type XADCBM8BITTYPE_xxx }
475
xfis_RecordLength : UBYTE; { record length if relative file }
479
PxadSpecial = ^txadSpecial;
481
xfis_Type : ULONG; { XADSPECIALTYPE to define type of block (V11) }
482
xfis_Next : PxadSpecial; { pointer to next entry }
485
0 : ( xfis_UnixDevice : txadSpecialUnixDevice );
486
1 : ( xfis_AmigaAddress : txadSpecialAmigaAddress );
487
2 : ( xfis_CBM8bit : txadSpecialCBM8bit );
491
{ Multiuser fields (xfi_OwnerUID, xfi_OwnerUID, xfi_UserName, xfi_GroupName)
492
and multiuser bits (see <dos/dos.h>) are currently not supported with normal
493
Amiga filesystem. But the clients support them, if archive format holds
496
The protection bits (all 3 fields) should always be set using the
497
xadConvertProtection procedure. Call it with as much protection information
498
as possible. It extracts the relevant data at best (and also sets the 2 flags).
499
DO NOT USE these fields directly, but always through xadConvertProtection
504
PxadFileInfo = ^txadFileInfo;
505
txadFileInfo = record
506
xfi_Next : PxadFileInfo;
507
xfi_EntryNumber : ULONG; { number of entry }
508
xfi_EntryInfo : STRPTR; { additional archiver text }
509
xfi_PrivateInfo : APTR; { client private, see XAD_OBJPRIVINFOSIZE }
510
xfi_Flags : ULONG; { see XADFIF_xxx defines }
511
xfi_FileName : STRPTR; { see XAD_OBJNAMESIZE tag }
512
xfi_Comment : STRPTR; { see XAD_OBJCOMMENTSIZE tag }
513
xfi_Protection : ULONG; { OS 3 bits (including multiuser) }
514
xfi_OwnerUID : ULONG; { user ID }
515
xfi_OwnerGID : ULONG; { group ID }
516
xfi_UserName : STRPTR; { user name }
517
xfi_GroupName : STRPTR; { group name }
518
xfi_Size : ULONG; { size of this file }
519
xfi_GroupCrSize : ULONG; { crunched size of group }
520
xfi_CrunchSize : ULONG; { crunched size }
521
xfi_LinkName : STRPTR; { name and path of link }
523
xfi_Generation : UWORD; { File Generation [0...0xFFFF] (V3) }
524
xfi_DataPos : ULONG; { crunched data position (V3) }
525
xfi_MacFork : PxadFileInfo; { pointer to 2nd fork for Mac (V7) }
526
xfi_UnixProtect : UWORD; { protection bits for Unix (V11) }
527
xfi_DosProtect : UBYTE; { protection bits for MS-DOS (V11) }
528
xfi_FileType : UBYTE; { XADFILETYPE to define type of exe files (V11) }
529
xfi_Special : PxadSpecial; { pointer to special data (V11) }
532
{ NOTE: the texts passed with that structure must not always be printable.
533
Although the clients should add an additional (not counted) zero at the text
534
end, the whole file may contain other unprintable stuff (e.g. for DMS).
535
So when printing this texts do it on a byte for byte base including
540
PxadTextInfo = ^txadTextInfo;
541
txadTextInfo = record
542
xti_Next : PxadTextInfo;
543
xti_Size : ULONG; { maybe zero - no text - e.g. when crypted }
544
xti_Text : STRPTR; { and there is no password in xadGetInfo() }
545
xti_Flags : ULONG; { see XADTIF_xxx defines }
550
PxadDiskInfo = ^txadDiskInfo;
551
txadDiskInfo = record
552
xdi_Next : PxadDiskInfo;
553
xdi_EntryNumber : ULONG; { number of entry }
554
xdi_EntryInfo : STRPTR; { additional archiver text }
555
xdi_PrivateInfo : APTR; { client private, see XAD_OBJPRIVINFOSIZE }
556
xdi_Flags : ULONG; { see XADDIF_xxx defines }
557
xdi_SectorSize : ULONG;
558
xdi_TotalSectors : ULONG; { see devices/trackdisk.h }
559
xdi_Cylinders : ULONG; { to find out what these }
560
xdi_CylSectors : ULONG; { fields mean, they are equal }
561
xdi_Heads : ULONG; { to struct DriveGeometry }
562
xdi_TrackSectors : ULONG;
563
xdi_LowCyl : ULONG; { lowest cylinder stored }
564
xdi_HighCyl : ULONG; { highest cylinder stored }
565
xdi_BlockInfoSize : ULONG; { number of BlockInfo entries }
566
xdi_BlockInfo : Pointer; { see XADBIF_xxx defines and XAD_OBJBLOCKENTRIES tag }
567
xdi_TextInfo : PxadTextInfo;{ linked list with info texts }
568
xdi_DataPos : ULONG; { crunched data position (V3) }
571
{ BlockInfo points to a UBYTE field for every track from first sector of
572
lowest cylinder to last sector of highest cylinder. When not used,
573
pointer must be 0. Do not use it, when there are no entries!
574
This is just for information. The applications still asks the client
575
to unarchive whole cylinders and not archived blocks are cleared for
579
{ If the image file holds total data of disk xii_TotalSectors equals
580
xii_NumSectors and xii_FirstSector is zero. Addition of xii_FirstSector
581
and xii_NumSectors cannot exceed xii_TotalSectors value!
585
information structures
588
PxadArchiveInfo = ^txadArchiveInfo;
589
txadArchiveInfo = record
590
xai_Client : PxadClient; { pointer to unarchiving client }
591
xai_PrivateClient : APTR; { private client data }
592
xai_Password : STRPTR; { password for crypted archives }
593
xai_Flags : ULONG; { read only XADAIF_ flags }
594
xai_LowCyl : ULONG; { lowest cylinder to unarchive }
595
xai_HighCyl : ULONG; { highest cylinder to unarchive }
596
xai_InPos : ULONG; { input position, read only }
597
xai_InSize : ULONG; { input size, read only }
598
xai_OutPos : ULONG; { output position, read only }
599
xai_OutSize : ULONG; { output file size, read only }
600
xai_FileInfo : PxadFileInfo; { data pointer for file arcs }
601
xai_DiskInfo : PxadDiskInfo; { data pointer for disk arcs }
602
xai_CurFile : PxadFileInfo; { data pointer for current file arc }
603
xai_CurDisk : PxadDiskInfo; { data pointer for current disk arc }
604
xai_LastError : LONG; { last error, when XADAIF_FILECORRUPT (V2) }
605
xai_MultiVolume : PULONG; { array of start offsets from parts (V2) }
606
xai_SkipInfo : PxadSkipInfo; { linked list of skip entries (V3) }
607
xai_ImageInfo : PxadImageInfo; { for filesystem clients (V5) }
608
xai_InName : STRPTR; { Input archive name if available (V7) }
613
{ This structure is nearly complete private to either xadmaster or its
614
clients. An application program may access for reading only xai_Client,
615
xai_Flags, xai_FileInfo and xai_DiskInfo. For xai_Flags only XADAIF_CRYPTED
616
and XADAIF_FILECORRUPT are useful. All the other stuff is private and should
618
{ archive entries are encrypted }
622
{ file is corrupt, but valid entries are in the list }
623
XADAIB_FILECORRUPT = 1;
624
{ unarchive file entry }
625
XADAIB_FILEARCHIVE = 2;
626
{ unarchive disk entry }
627
XADAIB_DISKARCHIVE = 3;
628
{ overwrite the file (PRIVATE) }
629
XADAIB_OVERWRITE = 4;
630
{ create directory when missing (PRIVATE) }
631
XADAIB_MAKEDIRECTORY = 5;
632
{ ignore drive geometry (PRIVATE) }
633
XADAIB_IGNOREGEOMETRY = 6;
634
{ verify is turned on for disk hook (PRIVATE) }
636
{ do not delete partial files (PRIVATE) }
637
XADAIB_NOKILLPARTIAL = 8;
638
{ is disk image extraction (V5) }
639
XADAIB_DISKIMAGE = 9;
640
{ format in disk hook (PRIVATE) }
642
{ do not create empty error (PRIVATE) }
643
XADAIB_NOEMPTYERROR = 11;
644
{ in stuff only (PRIVATE) }
646
{ out stuff only (PRIVATE) }
648
{ use SectorLabels (PRIVATE) }
649
XADAIB_USESECTORLABELS = 14;
650
XADAIF_CRYPTED = 1 shl XADAIB_CRYPTED;
651
XADAIF_FILECORRUPT = 1 shl XADAIB_FILECORRUPT;
652
XADAIF_FILEARCHIVE = 1 shl XADAIB_FILEARCHIVE;
653
XADAIF_DISKARCHIVE = 1 shl XADAIB_DISKARCHIVE;
654
XADAIF_OVERWRITE = 1 shl XADAIB_OVERWRITE;
655
XADAIF_MAKEDIRECTORY = 1 shl XADAIB_MAKEDIRECTORY;
656
XADAIF_IGNOREGEOMETRY = 1 shl XADAIB_IGNOREGEOMETRY;
657
XADAIF_VERIFY = 1 shl XADAIB_VERIFY;
658
XADAIF_NOKILLPARTIAL = 1 shl XADAIB_NOKILLPARTIAL;
659
XADAIF_DISKIMAGE = 1 shl XADAIB_DISKIMAGE;
660
XADAIF_FORMAT = 1 shl XADAIB_FORMAT;
661
XADAIF_NOEMPTYERROR = 1 shl XADAIB_NOEMPTYERROR;
662
XADAIF_ONLYIN = 1 shl XADAIB_ONLYIN;
663
XADAIF_ONLYOUT = 1 shl XADAIB_ONLYOUT;
664
XADAIF_USESECTORLABELS = 1 shl XADAIB_USESECTORLABELS;
666
{ These are used for xfi_FileType to define file type. (V11) }
667
{ infile was only one data file }
670
XADFILETYPE_DATACRUNCHER = 1;
671
{ infile was text-linked }
672
XADFILETYPE_TEXTLINKER = 2;
673
{ infile was an Amiga exe cruncher }
674
XADFILETYPE_AMIGAEXECRUNCHER = 11;
675
{ infile was an Amiga exe linker }
676
XADFILETYPE_AMIGAEXELINKER = 12;
677
{ infile was an Amiga text-exe linker }
678
XADFILETYPE_AMIGATEXTLINKER = 13;
679
{ infile was an Amiga address cruncher }
680
XADFILETYPE_AMIGAADDRESS = 14;
681
{ this file is a block device }
682
XADFILETYPE_UNIXBLOCKDEVICE = 21;
683
{ this file is a character device }
684
XADFILETYPE_UNIXCHARDEVICE = 22;
685
{ this file is a named pipe }
686
XADFILETYPE_UNIXFIFO = 23;
687
{ this file is a socket }
688
XADFILETYPE_UNIXSOCKET = 24;
689
{ infile was an MSDOS exe cruncher }
690
XADFILETYPE_MSDOSEXECRUNCHER = 31;
691
{ xadSpecial entry is xadSpecialUnixDevice }
692
XADSPECIALTYPE_UNIXDEVICE = 1;
693
{ xadSpecial entry is xadSpecialAmigaAddress }
694
XADSPECIALTYPE_AMIGAADDRESS = 2;
695
{ xadSpecial entry is xadSpecialCBM8bit }
696
XADSPECIALTYPE_CBM8BIT = 3;
703
XADCBM8BITTYPE_UNKNOWN = $00;
704
{ Tape - BASIC program file }
705
XADCBM8BITTYPE_BASIC = $01;
706
{ Tape - Data block (SEQ file) }
707
XADCBM8BITTYPE_DATA = $02;
708
{ Tape - Fixed addres program file }
709
XADCBM8BITTYPE_FIXED = $03;
710
{ Tape - Sequential data file }
711
XADCBM8BITTYPE_SEQDATA = $04;
712
{ Disk - Sequential file "SEQ" }
713
XADCBM8BITTYPE_SEQ = $81;
714
{ Disk - Program file "PRG" }
715
XADCBM8BITTYPE_PRG = $82;
716
{ Disk - User-defined file "USR" }
717
XADCBM8BITTYPE_USR = $83;
718
{ Disk - Relative records file "REL" }
719
XADCBM8BITTYPE_REL = $84;
720
{ Disk - CBM (partition) "CBM" }
721
XADCBM8BITTYPE_CBM = $85;
729
{ entry is a directory }
730
XADFIB_DIRECTORY = 1;
733
{ file is an information text }
735
{ file is in a crunch group }
737
{ crunch group ends here }
738
XADFIB_ENDOFGROUP = 5;
739
{ no date supported, CURRENT date is set }
741
{ file is marked as deleted (V3) }
743
{ before unarchiving the datapos is set (V3) }
744
XADFIB_SEEKDATAPOS = 8;
745
{ there was no filename, using internal one (V6) }
746
XADFIB_NOFILENAME = 9;
747
{ file size is unknown and thus set to zero (V6) }
748
XADFIB_NOUNCRUNCHSIZE = 10;
749
{ file is only partial (V6) }
750
XADFIB_PARTIALFILE = 11;
751
{ file is Apple data fork (V7) }
753
{ file is Apple resource fork (V7) }
754
XADFIB_MACRESOURCE = 13;
755
{ allows extract file during scanning (V10) }
756
XADFIB_EXTRACTONBUILD = 14;
757
{ UNIX protection bits are present (V11) }
758
XADFIB_UNIXPROTECTION = 15;
759
{ MSDOS protection bits are present (V11) }
760
XADFIB_DOSPROTECTION = 16;
761
{ this entry may change until GetInfo is finished (V11) }
762
XADFIB_ENTRYMAYCHANGE = 17;
763
{ the xfi_FileName fields is an XAD string (V12) }
764
XADFIB_XADSTRFILENAME = 18;
765
{ the xfi_LinkName fields is an XAD string (V12) }
766
XADFIB_XADSTRLINKNAME = 19;
767
{ the xfi_Comment fields is an XAD string (V12) }
768
XADFIB_XADSTRCOMMENT = 20;
769
XADFIF_CRYPTED = 1 shl XADFIB_CRYPTED;
770
XADFIF_DIRECTORY = 1 shl XADFIB_DIRECTORY;
771
XADFIF_LINK = 1 shl XADFIB_LINK;
772
XADFIF_INFOTEXT = 1 shl XADFIB_INFOTEXT;
773
XADFIF_GROUPED = 1 shl XADFIB_GROUPED;
774
XADFIF_ENDOFGROUP = 1 shl XADFIB_ENDOFGROUP;
775
XADFIF_NODATE = 1 shl XADFIB_NODATE;
776
XADFIF_DELETED = 1 shl XADFIB_DELETED;
777
XADFIF_SEEKDATAPOS = 1 shl XADFIB_SEEKDATAPOS;
778
XADFIF_NOFILENAME = 1 shl XADFIB_NOFILENAME;
779
XADFIF_NOUNCRUNCHSIZE = 1 shl XADFIB_NOUNCRUNCHSIZE;
780
XADFIF_PARTIALFILE = 1 shl XADFIB_PARTIALFILE;
781
XADFIF_MACDATA = 1 shl XADFIB_MACDATA;
782
XADFIF_MACRESOURCE = 1 shl XADFIB_MACRESOURCE;
783
XADFIF_EXTRACTONBUILD = 1 shl XADFIB_EXTRACTONBUILD;
784
XADFIF_UNIXPROTECTION = 1 shl XADFIB_UNIXPROTECTION;
785
XADFIF_DOSPROTECTION = 1 shl XADFIB_DOSPROTECTION;
786
XADFIF_ENTRYMAYCHANGE = 1 shl XADFIB_ENTRYMAYCHANGE;
787
XADFIF_XADSTRFILENAME = 1 shl XADFIB_XADSTRFILENAME;
788
XADFIF_XADSTRLINKNAME = 1 shl XADFIB_XADSTRLINKNAME;
789
XADFIF_XADSTRCOMMENT = 1 shl XADFIB_XADSTRCOMMENT;
793
{ entry is empty, as data was crypted }
799
{ text is a file description }
801
XADTIF_CRYPTED = 1 shl XADTIB_CRYPTED;
802
XADTIF_BANNER = 1 shl XADTIB_BANNER;
803
XADTIF_FILEDIZ = 1 shl XADTIB_FILEDIZ;
809
{ before unarchiving the datapos is set (V3) }
810
XADDIB_SEEKDATAPOS = 1;
811
{ the clients delivers sector labels (V9) }
812
XADDIB_SECTORLABELS = 2;
813
{ allows extract disk during scanning (V10) }
814
XADDIB_EXTRACTONBUILD = 3;
815
{ this entry may change until GetInfo is finished (V11) }
816
XADDIB_ENTRYMAYCHANGE = 4;
817
{ Some of the crunchers do not store all necessary information, so it
818
may be needed to guess some of them. Set the following flags in that case
819
and geometry check will ignore these fields. }
820
{ sectorsize is guessed (V10) }
821
XADDIB_GUESSSECTORSIZE = 5;
822
{ totalsectors number is guessed (V10) }
823
XADDIB_GUESSTOTALSECTORS = 6;
824
{ cylinder number is guessed }
825
XADDIB_GUESSCYLINDERS = 7;
826
{ cylsectors is guessed }
827
XADDIB_GUESSCYLSECTORS = 8;
828
{ number of heads is guessed }
829
XADDIB_GUESSHEADS = 9;
830
{ tracksectors is guessed }
831
XADDIB_GUESSTRACKSECTORS = 10;
832
{ lowcyl is guessed }
833
XADDIB_GUESSLOWCYL = 11;
834
{ highcyl is guessed }
835
XADDIB_GUESSHIGHCYL = 12;
836
{ If it is impossible to set some of the fields, you need to set some of
837
these flags. NOTE: XADDIB_NOCYLINDERS is really important, as this turns
838
of usage of lowcyl and highcyl keywords. When you have cylinder information,
839
you should not use these and instead use guess flags and calculate
840
possible values for the missing fields. }
841
{ cylinder number is not set }
842
XADDIB_NOCYLINDERS = 15;
843
{ cylsectors is not set }
844
XADDIB_NOCYLSECTORS = 16;
845
{ number of heads is not set }
847
{ tracksectors is not set }
848
XADDIB_NOTRACKSECTORS = 18;
849
{ lowcyl is not set }
850
XADDIB_NOLOWCYL = 19;
851
{ highcyl is not set }
852
XADDIB_NOHIGHCYL = 20;
853
XADDIF_CRYPTED = 1 shl XADDIB_CRYPTED;
854
XADDIF_SEEKDATAPOS = 1 shl XADDIB_SEEKDATAPOS;
855
XADDIF_SECTORLABELS = 1 shl XADDIB_SECTORLABELS;
856
XADDIF_EXTRACTONBUILD = 1 shl XADDIB_EXTRACTONBUILD;
857
XADDIF_ENTRYMAYCHANGE = 1 shl XADDIB_ENTRYMAYCHANGE;
858
XADDIF_GUESSSECTORSIZE = 1 shl XADDIB_GUESSSECTORSIZE;
859
XADDIF_GUESSTOTALSECTORS = 1 shl XADDIB_GUESSTOTALSECTORS;
860
XADDIF_GUESSCYLINDERS = 1 shl XADDIB_GUESSCYLINDERS;
861
XADDIF_GUESSCYLSECTORS = 1 shl XADDIB_GUESSCYLSECTORS;
862
XADDIF_GUESSHEADS = 1 shl XADDIB_GUESSHEADS;
863
XADDIF_GUESSTRACKSECTORS = 1 shl XADDIB_GUESSTRACKSECTORS;
864
XADDIF_GUESSLOWCYL = 1 shl XADDIB_GUESSLOWCYL;
865
XADDIF_GUESSHIGHCYL = 1 shl XADDIB_GUESSHIGHCYL;
866
XADDIF_NOCYLINDERS = 1 shl XADDIB_NOCYLINDERS;
867
XADDIF_NOCYLSECTORS = 1 shl XADDIB_NOCYLSECTORS;
868
XADDIF_NOHEADS = 1 shl XADDIB_NOHEADS;
869
XADDIF_NOTRACKSECTORS = 1 shl XADDIB_NOTRACKSECTORS;
870
XADDIF_NOLOWCYL = 1 shl XADDIB_NOLOWCYL;
871
XADDIF_NOHIGHCYL = 1 shl XADDIB_NOHIGHCYL;
872
{ defines for BlockInfo }
873
{ this block was cleared for archiving }
875
{ this block was not archived }
877
XADBIF_CLEARED = 1 shl XADBIB_CLEARED;
878
XADBIF_UNUSED = 1 shl XADBIB_UNUSED;
881
progress report stuff
884
PxadProgressInfo = ^txadProgressInfo;
885
txadProgressInfo = record
886
xpi_Mode : ULONG; { work modus }
887
xpi_Client : PxadClient; { the client doing the work }
888
xpi_DiskInfo : PxadDiskInfo; { current diskinfo, for disks }
889
xpi_FileInfo : PxadFileInfo; { current info for files }
890
xpi_CurrentSize : ULONG; { current filesize }
891
xpi_LowCyl : ULONG; { for disks only }
892
xpi_HighCyl : ULONG; { for disks only }
893
xpi_Status : ULONG; { see XADPIF flags }
894
xpi_Error : LONG; { any of the error codes }
895
xpi_FileName : STRPTR; { name of file to overwrite (V2) }
896
xpi_NewName : STRPTR; { new name buffer, passed by hook (V2) }
899
{ NOTE: For disks CurrentSize is Sector SectorSize, where SectorSize can
900
be found in xadDiskInfo structure. So you may output the sector value. }
901
{ different progress modes }
905
XADPMODE_PROGRESS = 2;
909
XADPMODE_NEWENTRY = 5;
911
XADPMODE_GETINFOEND = 6;
912
{ flags for progress hook and ProgressInfo status field }
913
{ overwrite the file }
914
XADPIB_OVERWRITE = 0;
915
{ create the directory }
916
XADPIB_MAKEDIRECTORY = 1;
917
{ ignore drive geometry }
918
XADPIB_IGNOREGEOMETRY = 2;
919
{ destination is a directory (V10) }
920
XADPIB_ISDIRECTORY = 3;
921
{ rename the file (V2) }
927
XADPIF_OVERWRITE = 1 shl XADPIB_OVERWRITE;
928
XADPIF_MAKEDIRECTORY = 1 shl XADPIB_MAKEDIRECTORY;
929
XADPIF_IGNOREGEOMETRY = 1 shl XADPIB_IGNOREGEOMETRY;
930
XADPIF_ISDIRECTORY = 1 shl XADPIB_ISDIRECTORY;
931
XADPIF_RENAME = 1 shl XADPIB_RENAME;
932
XADPIF_OK = 1 shl XADPIB_OK;
933
XADPIF_SKIP = 1 shl XADPIB_SKIP;
942
XADERR_UNKNOWN = $0001;
943
{ input data buffers border exceeded }
944
XADERR_INPUT = $0002;
945
{ output data buffers border exceeded }
946
XADERR_OUTPUT = $0003;
947
{ function called with illegal parameters }
948
XADERR_BADPARAMS = $0004;
949
{ not enough memory available }
950
XADERR_NOMEMORY = $0005;
951
{ data is corrupted }
952
XADERR_ILLEGALDATA = $0006;
953
{ command is not supported }
954
XADERR_NOTSUPPORTED = $0007;
955
{ required resource missing }
956
XADERR_RESOURCE = $0008;
957
{ error on decrunching }
958
XADERR_DECRUNCH = $0009;
959
{ unknown file type }
960
XADERR_FILETYPE = $000A;
961
{ opening file failed }
962
XADERR_OPENFILE = $000B;
963
{ file, disk has been skipped }
965
{ user break in progress hook }
966
XADERR_BREAK = $000D;
967
{ file already exists }
968
XADERR_FILEEXISTS = $000E;
969
{ missing or wrong password }
970
XADERR_PASSWORD = $000F;
971
{ could not create directory }
972
XADERR_MAKEDIR = $0010;
974
XADERR_CHECKSUM = $0011;
975
{ verify failed (disk hook) }
976
XADERR_VERIFY = $0012;
977
{ wrong drive geometry }
978
XADERR_GEOMETRY = $0013;
979
{ unknown data format }
980
XADERR_DATAFORMAT = $0014;
981
{ source contains no files }
982
XADERR_EMPTY = $0015;
983
{ unknown filesystem }
984
XADERR_FILESYSTEM = $0016;
985
{ name of file exists as directory }
986
XADERR_FILEDIR = $0017;
987
{ buffer was to short }
988
XADERR_SHORTBUFFER = $0018;
989
{ text encoding was defective }
990
XADERR_ENCODING = $0019;
993
characterset and filename conversion
996
{ this is the ONLY destination setting for clients! }
998
{ 16bit Unicode (usually no source type) }
999
CHARSET_UNICODE_UCS2_HOST = 10;
1000
{ 16bit Unicode big endian storage }
1001
CHARSET_UNICODE_UCS2_BIGENDIAN = 11;
1002
{ 16bit Unicode little endian storage }
1003
CHARSET_UNICODE_UCS2_LITTLEENDIAN = 12;
1004
{ variable size unicode encoding }
1005
CHARSET_UNICODE_UTF8 = 13;
1006
{ all the 1xx types are generic types which also maybe a bit dynamic }
1007
{ the default Amiga charset }
1008
CHARSET_AMIGA = 100;
1009
{ the default MSDOS charset }
1010
CHARSET_MSDOS = 101;
1011
{ the default MacOS charset }
1012
CHARSET_MACOS = 102;
1013
{ the default C64 charset }
1015
{ the default Atari ST charset }
1016
CHARSET_ATARI_ST = 104;
1017
{ the default Windows charset }
1018
CHARSET_WINDOWS = 105;
1019
{ all the 2xx to 9xx types are real charsets, use them whenever you know
1020
what the data really is }
1021
{ the lower 7 bits of ASCII charsets }
1022
CHARSET_ASCII = 200;
1023
{ the base charset }
1024
CHARSET_ISO_8859_1 = 201;
1025
{ Euro-sign fixed ISO variant }
1026
CHARSET_ISO_8859_15 = 215;
1027
{ Atari ST (US) charset }
1028
CHARSET_ATARI_ST_US = 300;
1029
{ C64 lower case charset }
1030
CHARSET_PETSCII_C64_LC = 301;
1031
{ IBM Codepage 437 charset }
1032
CHARSET_CODEPAGE_437 = 400;
1033
{ Windows Codepage 1252 charset }
1034
CHARSET_CODEPAGE_1252 = 401;
1037
client related stuff
1041
PxadForeman = ^txadForeman;
1042
txadForeman = record
1043
xfm_Security : ULONG; { should be XADFOREMAN_SECURITY }
1044
xfm_ID : ULONG; { must be XADFOREMAN_ID }
1045
xfm_Version : UWORD; { set to XADFOREMAN_VERSION }
1046
xfm_Reserved : UWORD;
1047
xfm_VersString : STRPTR; { pointer to $VER: string }
1048
xfm_FirstClient : PxadClient; { pointer to first client }
1051
{ MOVEQ #-1,D0 and RTS }
1054
XADFOREMAN_SECURITY = $70FF4E75;
1055
{ 'XADF' identification ID }
1056
XADFOREMAN_ID = $58414446;
1057
XADFOREMAN_VERSION = 1;
1062
XADCLIENT_VERSION = 1;
1063
{ archiver is a file archiver }
1064
XADCB_FILEARCHIVER = 0;
1065
{ archiver is a disk archiver }
1066
XADCB_DISKARCHIVER = 1;
1067
{ external client, set by xadmaster }
1069
{ filesystem clients (V5) }
1070
XADCB_FILESYSTEM = 3;
1071
{ do not check size for recog call (V6) }
1072
XADCB_NOCHECKSIZE = 4;
1073
{ file archiver is plain data file (V11) }
1074
XADCB_DATACRUNCHER = 5;
1075
{ file archiver is executable file (V11) }
1076
XADCB_EXECRUNCHER = 6;
1077
{ file archiver is address crunched file (V11) }
1078
XADCB_ADDRESSCRUNCHER = 7;
1079
{ file archiver is a linker file (V11) }
1081
{ master frees XAD strings (V12) }
1082
XADCB_FREEXADSTRINGS = 25;
1083
{ master frees xadSpecial structures (V11) }
1084
XADCB_FREESPECIALINFO = 26;
1085
{ master frees xadSkipInfo structures (V3) }
1086
XADCB_FREESKIPINFO = 27;
1087
{ master frees xadTextInfo structures (V2) }
1088
XADCB_FREETEXTINFO = 28;
1089
{ master frees xadTextInfo text block (V2) }
1090
XADCB_FREETEXTINFOTEXT = 29;
1091
{ master frees xadFileInfo structures (V2) }
1092
XADCB_FREEFILEINFO = 30;
1093
{ master frees xadDiskInfo structures (V2) }
1094
XADCB_FREEDISKINFO = 31;
1095
XADCF_FILEARCHIVER = 1 shl XADCB_FILEARCHIVER;
1096
XADCF_DISKARCHIVER = 1 shl XADCB_DISKARCHIVER;
1097
XADCF_EXTERN = 1 shl XADCB_EXTERN;
1098
XADCF_FILESYSTEM = 1 shl XADCB_FILESYSTEM;
1099
XADCF_NOCHECKSIZE = 1 shl XADCB_NOCHECKSIZE;
1100
XADCF_DATACRUNCHER = 1 shl XADCB_DATACRUNCHER;
1101
XADCF_EXECRUNCHER = 1 shl XADCB_EXECRUNCHER;
1102
XADCF_ADDRESSCRUNCHER = 1 shl XADCB_ADDRESSCRUNCHER;
1103
XADCF_LINKER = 1 shl XADCB_LINKER;
1104
XADCF_FREEXADSTRINGS = 1 shl XADCB_FREEXADSTRINGS;
1105
XADCF_FREESPECIALINFO = 1 shl XADCB_FREESPECIALINFO;
1106
XADCF_FREESKIPINFO = 1 shl XADCB_FREESKIPINFO;
1107
XADCF_FREETEXTINFO = 1 shl XADCB_FREETEXTINFO;
1108
XADCF_FREETEXTINFOTEXT = 1 shl XADCB_FREETEXTINFOTEXT;
1109
XADCF_FREEFILEINFO = 1 shl XADCB_FREEFILEINFO;
1110
XADCF_FREEDISKINFO = 1 shl XADCB_FREEDISKINFO;
1111
{ The types 5 to 9 always need XADCB_FILEARCHIVER set also. These only specify
1112
the type of the archiver somewhat better. Do not mix real archivers and these
1113
single file data clients. }
1119
{ If an external client has set the xc_Identifier field, the internal
1120
client is replaced. }
1121
{ disk archivers start with 1000 }
1122
XADCID_XMASH = 1000;
1123
XADCID_SUPERDUPER3 = 1001;
1124
XADCID_XDISK = 1002;
1125
XADCID_PACKDEV = 1003;
1127
XADCID_ZOOM5 = 1005;
1128
XADCID_CRUNCHDISK = 1006;
1129
XADCID_PACKDISK = 1007;
1131
XADCID_COMPDISK = 1009;
1132
XADCID_LHWARP = 1010;
1133
XADCID_SAVAGECOMPRESSOR = 1011;
1137
{ file archivers start with 5000 }
1139
XADCID_SDSSFX = 5001;
1141
XADCID_MXMSIMPLEARC = 5003;
1142
XADCID_LHPAK = 5004;
1143
XADCID_AMIGAPLUSUNPACK = 5005;
1144
XADCID_AMIPACK = 5006;
1146
XADCID_LHASFX = 5008;
1147
XADCID_PCOMPARC = 5009;
1148
XADCID_SOMNI = 5010;
1149
XADCID_LHSFX = 5011;
1150
XADCID_XPKARCHIVE = 5012;
1151
XADCID_SHRINK = 5013;
1152
XADCID_SPACK = 5014;
1153
XADCID_SPACKSFX = 5015;
1155
XADCID_WINZIPEXE = 5017;
1159
XADCID_LHAEXE = 5021;
1161
XADCID_ARJEXE = 5023;
1162
XADCID_ZIPEXE = 5024;
1164
XADCID_COMPRESS = 5026;
1166
XADCID_ACEEXE = 5028;
1167
XADCID_GZIPSFX = 5029;
1170
XADCID_LHAC64SFX = 5032;
1173
XADCID_SIT5EXE = 5035;
1174
XADCID_MACBINARY = 5036;
1176
XADCID_PACKIT = 5038;
1177
{ filesystem client start with 8000 }
1178
XADCID_FSAMIGA = 8000;
1179
XADCID_FSSANITYOS = 8001;
1180
XADCID_FSFAT = 8002;
1181
{ mixed archivers start with 9000 }
1183
XADCID_DMSSFX = 9001;
1185
VAR xadMasterBase : pxadMasterBase;
1188
FUNCTION xadAddDiskEntryA(di : pxadDiskInfo; ai : pxadArchiveInfo; CONST tags : pTagItem) : LONGINT;
1189
FUNCTION xadAddFileEntryA(fi : pxadFileInfo; ai : pxadArchiveInfo; CONST tags : pTagItem) : LONGINT;
1190
FUNCTION xadAllocObjectA(_type : LONGINT; CONST tags : pTagItem) : POINTER;
1191
FUNCTION xadAllocVec(size : longword; flags : longword) : POINTER;
1192
FUNCTION xadCalcCRC16(id : longword; init : longword; size : longword; buffer : pCHAR) : WORD;
1193
FUNCTION xadCalcCRC32(id : longword; init : longword; size : longword; buffer : pCHAR) : longword;
1194
FUNCTION xadConvertDatesA(CONST tags : pTagItem) : LONGINT;
1195
FUNCTION xadConvertNameA(charset : longword; CONST tags : pTagItem) : pCHAR;
1196
FUNCTION xadConvertProtectionA(CONST tags : pTagItem) : LONGINT;
1197
PROCEDURE xadCopyMem(src : POINTER; dest : POINTER; size : longword);
1198
FUNCTION xadDiskFileUnArcA(ai : pxadArchiveInfo; CONST tags : pTagItem) : LONGINT;
1199
FUNCTION xadDiskUnArcA(ai : pxadArchiveInfo; CONST tags : pTagItem) : LONGINT;
1200
FUNCTION xadFileUnArcA(ai : pxadArchiveInfo; CONST tags : pTagItem) : LONGINT;
1201
FUNCTION xadFreeHookAccessA(ai : pxadArchiveInfo; CONST tags : pTagItem) : LONGINT;
1202
PROCEDURE xadFreeInfo(ai : pxadArchiveInfo);
1203
PROCEDURE xadFreeObjectA(obj : POINTER; CONST tags : pTagItem);
1204
FUNCTION xadGetClientInfo : pxadClient;
1205
FUNCTION xadGetDiskInfoA(ai : pxadArchiveInfo; CONST tags : pTagItem) : LONGINT;
1206
FUNCTION xadGetErrorText(errnum : longword) : pCHAR;
1207
FUNCTION xadGetFilenameA(buffersize : longword; buffer : pCHAR; path : pCHAR; name : pCHAR; CONST tags : pTagItem) : LONGINT;
1208
FUNCTION xadGetHookAccessA(ai : pxadArchiveInfo; CONST tags : pTagItem) : LONGINT;
1209
FUNCTION xadGetInfoA(ai : pxadArchiveInfo; CONST tags : pTagItem) : LONGINT;
1210
FUNCTION xadHookAccess(command : longword; data : LONGINT; buffer : POINTER; ai : pxadArchiveInfo) : LONGINT;
1211
FUNCTION xadHookTagAccessA(command : longword; data : LONGINT; buffer : POINTER; ai : pxadArchiveInfo; CONST tags : pTagItem) : LONGINT;
1212
FUNCTION xadRecogFileA(size : longword; memory : POINTER; CONST tags : pTagItem) : pxadClient;
1214
Functions and procedures with array of const go here
1216
FUNCTION xadAddDiskEntry(di : pxadDiskInfo; ai : pxadArchiveInfo; const tags : Array Of Const) : LONGINT;
1217
FUNCTION xadAddFileEntry(fi : pxadFileInfo; ai : pxadArchiveInfo; const tags : Array Of Const) : LONGINT;
1218
FUNCTION xadAllocObject(_type : LONGINT; const tags : Array Of Const) : POINTER;
1219
FUNCTION xadConvertDates(const tags : Array Of Const) : LONGINT;
1220
FUNCTION xadConvertName(charset : longword; const tags : Array Of Const) : pCHAR;
1221
FUNCTION xadConvertProtection(const tags : Array Of Const) : LONGINT;
1222
FUNCTION xadDiskFileUnArc(ai : pxadArchiveInfo; const tags : Array Of Const) : LONGINT;
1223
FUNCTION xadDiskUnArc(ai : pxadArchiveInfo; const tags : Array Of Const) : LONGINT;
1224
FUNCTION xadFileUnArc(ai : pxadArchiveInfo; const tags : Array Of Const) : LONGINT;
1225
FUNCTION xadFreeHookAccess(ai : pxadArchiveInfo; const tags : Array Of Const) : LONGINT;
1226
PROCEDURE xadFreeObject(obj : POINTER; const tags : Array Of Const);
1227
FUNCTION xadGetDiskInfo(ai : pxadArchiveInfo; const tags : Array Of Const) : LONGINT;
1228
FUNCTION xadGetFilename(buffersize : longword; buffer : pCHAR; path : pCHAR; name : pCHAR; const tags : Array Of Const) : LONGINT;
1229
FUNCTION xadGetHookAccess(ai : pxadArchiveInfo; const tags : Array Of Const) : LONGINT;
1230
FUNCTION xadGetInfo(ai : pxadArchiveInfo; const tags : Array Of Const) : LONGINT;
1231
FUNCTION xadHookTagAccess(command : longword; data : LONGINT; buffer : POINTER; ai : pxadArchiveInfo; const tags : Array Of Const) : LONGINT;
1232
FUNCTION xadRecogFile(size : longword; memory : POINTER; const tags : Array Of Const) : pxadClient;
1234
{You can remove this include and use a define instead}
1235
{$I useautoopenlib.inc}
1236
{$ifdef use_init_openlib}
1237
procedure InitXADMASTERLibrary;
1238
{$endif use_init_openlib}
1240
{This is a variable that knows how the unit is compiled}
1242
XADMASTERIsCompiledHow : longint;
1247
{$ifndef dont_use_openlib}
1249
{$endif dont_use_openlib}
1254
FUNCTION xadAddDiskEntryA(di : pxadDiskInfo; ai : pxadArchiveInfo; CONST tags : pTagItem) : LONGINT;
1261
MOVEA.L xadMasterBase,A6
1268
FUNCTION xadAddFileEntryA(fi : pxadFileInfo; ai : pxadArchiveInfo; CONST tags : pTagItem) : LONGINT;
1275
MOVEA.L xadMasterBase,A6
1282
FUNCTION xadAllocObjectA(_type : LONGINT; CONST tags : pTagItem) : POINTER;
1288
MOVEA.L xadMasterBase,A6
1295
FUNCTION xadAllocVec(size : longword; flags : longword) : POINTER;
1301
MOVEA.L xadMasterBase,A6
1308
FUNCTION xadCalcCRC16(id : longword; init : longword; size : longword; buffer : pCHAR) : WORD;
1316
MOVEA.L xadMasterBase,A6
1323
FUNCTION xadCalcCRC32(id : longword; init : longword; size : longword; buffer : pCHAR) : longword;
1331
MOVEA.L xadMasterBase,A6
1338
FUNCTION xadConvertDatesA(CONST tags : pTagItem) : LONGINT;
1343
MOVEA.L xadMasterBase,A6
1350
FUNCTION xadConvertNameA(charset : longword; CONST tags : pTagItem) : pCHAR;
1356
MOVEA.L xadMasterBase,A6
1363
FUNCTION xadConvertProtectionA(CONST tags : pTagItem) : LONGINT;
1368
MOVEA.L xadMasterBase,A6
1375
PROCEDURE xadCopyMem(src : POINTER; dest : POINTER; size : longword);
1382
MOVEA.L xadMasterBase,A6
1388
FUNCTION xadDiskFileUnArcA(ai : pxadArchiveInfo; CONST tags : pTagItem) : LONGINT;
1394
MOVEA.L xadMasterBase,A6
1401
FUNCTION xadDiskUnArcA(ai : pxadArchiveInfo; CONST tags : pTagItem) : LONGINT;
1407
MOVEA.L xadMasterBase,A6
1414
FUNCTION xadFileUnArcA(ai : pxadArchiveInfo; CONST tags : pTagItem) : LONGINT;
1420
MOVEA.L xadMasterBase,A6
1427
FUNCTION xadFreeHookAccessA(ai : pxadArchiveInfo; CONST tags : pTagItem) : LONGINT;
1433
MOVEA.L xadMasterBase,A6
1440
PROCEDURE xadFreeInfo(ai : pxadArchiveInfo);
1445
MOVEA.L xadMasterBase,A6
1451
PROCEDURE xadFreeObjectA(obj : POINTER; CONST tags : pTagItem);
1457
MOVEA.L xadMasterBase,A6
1463
FUNCTION xadGetClientInfo : pxadClient;
1467
MOVEA.L xadMasterBase,A6
1474
FUNCTION xadGetDiskInfoA(ai : pxadArchiveInfo; CONST tags : pTagItem) : LONGINT;
1480
MOVEA.L xadMasterBase,A6
1487
FUNCTION xadGetErrorText(errnum : longword) : pCHAR;
1492
MOVEA.L xadMasterBase,A6
1499
FUNCTION xadGetFilenameA(buffersize : longword; buffer : pCHAR; path : pCHAR; name : pCHAR; CONST tags : pTagItem) : LONGINT;
1503
MOVE.L buffersize,D0
1508
MOVEA.L xadMasterBase,A6
1515
FUNCTION xadGetHookAccessA(ai : pxadArchiveInfo; CONST tags : pTagItem) : LONGINT;
1521
MOVEA.L xadMasterBase,A6
1528
FUNCTION xadGetInfoA(ai : pxadArchiveInfo; CONST tags : pTagItem) : LONGINT;
1534
MOVEA.L xadMasterBase,A6
1541
FUNCTION xadHookAccess(command : longword; data : LONGINT; buffer : POINTER; ai : pxadArchiveInfo) : LONGINT;
1549
MOVEA.L xadMasterBase,A6
1556
FUNCTION xadHookTagAccessA(command : longword; data : LONGINT; buffer : POINTER; ai : pxadArchiveInfo; CONST tags : pTagItem) : LONGINT;
1565
MOVEA.L xadMasterBase,A6
1572
FUNCTION xadRecogFileA(size : longword; memory : POINTER; CONST tags : pTagItem) : pxadClient;
1579
MOVEA.L xadMasterBase,A6
1587
Functions and procedures with array of const go here
1589
FUNCTION xadAddDiskEntry(di : pxadDiskInfo; ai : pxadArchiveInfo; const tags : Array Of Const) : LONGINT;
1591
xadAddDiskEntry := xadAddDiskEntryA(di , ai , readintags(tags));
1594
FUNCTION xadAddFileEntry(fi : pxadFileInfo; ai : pxadArchiveInfo; const tags : Array Of Const) : LONGINT;
1596
xadAddFileEntry := xadAddFileEntryA(fi , ai , readintags(tags));
1599
FUNCTION xadAllocObject(_type : LONGINT; const tags : Array Of Const) : POINTER;
1601
xadAllocObject := xadAllocObjectA(_type , readintags(tags));
1604
FUNCTION xadConvertDates(const tags : Array Of Const) : LONGINT;
1606
xadConvertDates := xadConvertDatesA(readintags(tags));
1609
FUNCTION xadConvertName(charset : longword; const tags : Array Of Const) : pCHAR;
1611
xadConvertName := xadConvertNameA(charset , readintags(tags));
1614
FUNCTION xadConvertProtection(const tags : Array Of Const) : LONGINT;
1616
xadConvertProtection := xadConvertProtectionA(readintags(tags));
1619
FUNCTION xadDiskFileUnArc(ai : pxadArchiveInfo; const tags : Array Of Const) : LONGINT;
1621
xadDiskFileUnArc := xadDiskFileUnArcA(ai , readintags(tags));
1624
FUNCTION xadDiskUnArc(ai : pxadArchiveInfo; const tags : Array Of Const) : LONGINT;
1626
xadDiskUnArc := xadDiskUnArcA(ai , readintags(tags));
1629
FUNCTION xadFileUnArc(ai : pxadArchiveInfo; const tags : Array Of Const) : LONGINT;
1631
xadFileUnArc := xadFileUnArcA(ai , readintags(tags));
1634
FUNCTION xadFreeHookAccess(ai : pxadArchiveInfo; const tags : Array Of Const) : LONGINT;
1636
xadFreeHookAccess := xadFreeHookAccessA(ai , readintags(tags));
1639
PROCEDURE xadFreeObject(obj : POINTER; const tags : Array Of Const);
1641
xadFreeObjectA(obj , readintags(tags));
1644
FUNCTION xadGetDiskInfo(ai : pxadArchiveInfo; const tags : Array Of Const) : LONGINT;
1646
xadGetDiskInfo := xadGetDiskInfoA(ai , readintags(tags));
1649
FUNCTION xadGetFilename(buffersize : longword; buffer : pCHAR; path : pCHAR; name : pCHAR; const tags : Array Of Const) : LONGINT;
1651
xadGetFilename := xadGetFilenameA(buffersize , buffer , path , name , readintags(tags));
1654
FUNCTION xadGetHookAccess(ai : pxadArchiveInfo; const tags : Array Of Const) : LONGINT;
1656
xadGetHookAccess := xadGetHookAccessA(ai , readintags(tags));
1659
FUNCTION xadGetInfo(ai : pxadArchiveInfo; const tags : Array Of Const) : LONGINT;
1661
xadGetInfo := xadGetInfoA(ai , readintags(tags));
1664
FUNCTION xadHookTagAccess(command : longword; data : LONGINT; buffer : POINTER; ai : pxadArchiveInfo; const tags : Array Of Const) : LONGINT;
1666
xadHookTagAccess := xadHookTagAccessA(command , data , buffer , ai , readintags(tags));
1669
FUNCTION xadRecogFile(size : longword; memory : POINTER; const tags : Array Of Const) : pxadClient;
1671
xadRecogFile := xadRecogFileA(size , memory , readintags(tags));
1675
{ Change VERSION and LIBVERSION to proper values }
1677
VERSION : string[2] = '0';
1678
LIBVERSION : longword = 0;
1680
{$ifdef use_init_openlib}
1681
{$Info Compiling initopening of xadmaster.library}
1682
{$Info don't forget to use InitXADMASTERLibrary in the beginning of your program}
1685
xadmaster_exit : Pointer;
1687
procedure ClosexadmasterLibrary;
1689
ExitProc := xadmaster_exit;
1690
if xadMasterBase <> nil then begin
1691
CloseLibrary(pLibrary(xadMasterBase));
1692
xadMasterBase := nil;
1696
procedure InitXADMASTERLibrary;
1698
xadMasterBase := nil;
1699
xadMasterBase := pxadMasterBase(OpenLibrary(XADMASTERNAME,LIBVERSION));
1700
if xadMasterBase <> nil then begin
1701
xadmaster_exit := ExitProc;
1702
ExitProc := @ClosexadmasterLibrary;
1704
MessageBox('FPC Pascal Error',
1705
'Can''t open xadmaster.library version ' + VERSION + #10 +
1706
'Deallocating resources and closing down',
1713
XADMASTERIsCompiledHow := 2;
1714
{$endif use_init_openlib}
1716
{$ifdef use_auto_openlib}
1717
{$Info Compiling autoopening of xadmaster.library}
1720
xadmaster_exit : Pointer;
1722
procedure ClosexadmasterLibrary;
1724
ExitProc := xadmaster_exit;
1725
if xadMasterBase <> nil then begin
1726
CloseLibrary(pLibrary(xadMasterBase));
1727
xadMasterBase := nil;
1732
xadMasterBase := nil;
1733
xadMasterBase := pxadMasterBase(OpenLibrary(XADMASTERNAME,LIBVERSION));
1734
if xadMasterBase <> nil then begin
1735
xadmaster_exit := ExitProc;
1736
ExitProc := @ClosexadmasterLibrary;
1737
XADMASTERIsCompiledHow := 1;
1739
MessageBox('FPC Pascal Error',
1740
'Can''t open xadmaster.library version ' + VERSION + #10 +
1741
'Deallocating resources and closing down',
1746
{$endif use_auto_openlib}
1748
{$ifdef dont_use_openlib}
1750
XADMASTERIsCompiledHow := 3;
1751
{$Warning No autoopening of xadmaster.library compiled}
1752
{$Warning Make sure you open xadmaster.library yourself}
1753
{$endif dont_use_openlib}
1756
END. (* UNIT XADMASTER *)