home *** CD-ROM | disk | FTP | other *** search
/ Enigma Amiga Life 113 / EnigmaAmiga113CD.iso / software / varie / xad / developer / include / asm / libraries / xadmaster.i
Encoding:
Text File  |  2000-06-25  |  23.2 KB  |  589 lines

  1.     IFND    LIBRARIES_XADMASTER_I
  2. LIBRARIES_XADMASTER_I    SET    1
  3.  
  4. *
  5. *    $VER: xadmaster.i 7.0 (20.06.2000)
  6. *    xadmaster.library defines and structures
  7. *
  8. *    Copyright © 1998-2000 by Dirk Stöcker
  9. *    All Rights Reserved.
  10. *
  11.  
  12.     IFND    EXEC_LIBRARIES_I
  13.     INCLUDE    "exec/libraries.i"
  14.     ENDC
  15.  
  16.     IFND    UTILITY_TAGITEM_I
  17.     INCLUDE    "utility/tagitem.i"
  18.     ENDC
  19.  
  20. XADNAME    MACRO
  21.     DC.B  'xadmaster.library',0
  22.     ENDM
  23.  
  24. * NOTE: The structures do not have size labels, as they have no fixed
  25. * size. You always need to call xadAllocObject to get them
  26.  
  27. *************************************************************************
  28. *                                                *
  29. *    library base structure                        *
  30. *                                                *
  31. *************************************************************************
  32.  
  33.     STRUCTURE xadMasterBase,LIB_SIZE
  34.     APTR    xmb_SysBase
  35.     APTR    xmb_DOSBase
  36.     APTR    xmb_UtilityBase
  37.     ULONG    xmb_RecogSize        * read only
  38.       APTR    xmb_DefaultName        * name for XADFIF_NOFILENAME (V6)
  39.  
  40. *************************************************************************
  41. *                                                *
  42. *    tag-function call flags                               *
  43. *                                                *
  44. *************************************************************************
  45.  
  46. * input tags for xadGetInfo, only one can be specified per call
  47. XAD_INSIZE        EQU    (TAG_USER+001) * input data size
  48. XAD_INFILENAME        EQU    (TAG_USER+002)
  49. XAD_INFILEHANDLE    EQU    (TAG_USER+003)
  50. XAD_INMEMORY        EQU    (TAG_USER+004)
  51. XAD_INHOOK        EQU    (TAG_USER+005)
  52. XAD_INSPLITTED        EQU    (TAG_USER+006) * (V2)
  53. XAD_INDISKARCHIVE    EQU    (TAG_USER+007) * (V4)
  54.  
  55. * output tags, only one can be specified per call, xadXXXXUnArc
  56. XAD_OUTSIZE        EQU    (TAG_USER+010) * output data size
  57. XAD_OUTFILENAME        EQU    (TAG_USER+011)
  58. XAD_OUTFILEHANDLE    EQU    (TAG_USER+012)
  59. XAD_OUTMEMORY        EQU    (TAG_USER+013)
  60. XAD_OUTHOOK        EQU    (TAG_USER+014)
  61. XAD_OUTDEVICE        EQU    (TAG_USER+015) * for disk archives only
  62.  
  63. * object allocation tags for xadAllocObjectA
  64. XAD_OBJNAMESIZE        EQU    (TAG_USER+020) * XADOBJ_FILEINFO, size of needed name space
  65. XAD_OBJCOMMENTSIZE    EQU    (TAG_USER+021) * XADOBJ_FILEINFO, size of needed comment space
  66. XAD_OBJPRIVINFOSIZE    EQU    (TAG_USER+022) * XADOBJ_FILEINFO & XADOBJ_DISKINFO, self use size
  67. XAD_OBJBLOCKENTRIES    EQU    (TAG_USER+023) * XADOBJ_DISKINFO, number of needed entries
  68.  
  69. * tags for xadGetInfo, xadFileUnArc and xadDiskUnArc
  70. XAD_NOEXTERN        EQU    (TAG_USER+050) * do not use extern clients
  71. XAD_PASSWORD        EQU    (TAG_USER+051) * password when needed
  72. XAD_ENTRYNUMBER        EQU    (TAG_USER+052) * number of wanted entry
  73. XAD_PROGRESSHOOK    EQU    (TAG_USER+053) * the progress hook
  74. XAD_OVERWRITE        EQU    (TAG_USER+054) * overwrite file ?
  75. XAD_MAKEDIRECTORY    EQU    (TAG_USER+055) * create directory tree
  76. XAD_IGNOREGEOMETRY    EQU    (TAG_USER+056) * ignore drive geometry ?
  77. XAD_LOWCYLINDER        EQU    (TAG_USER+057) * lowest cylinder
  78. XAD_HIGHCYLINDER    EQU    (TAG_USER+058) * highest cylinder
  79. XAD_VERIFY        EQU    (TAG_USER+059) * verify for disk hook
  80. XAD_NOKILLPARTIAL    EQU    (TAG_USER+060) * do not delete partial/corrupt files (V3.3)
  81. XAD_FORMAT        EQU    (TAG_USER+061) * format output device (V5)
  82.  
  83. * input tags for xadConvertDates, only one can be passed
  84. XAD_DATEUNIX        EQU    (TAG_USER+070) * unix date variable
  85. XAD_DATEAMIGA        EQU    (TAG_USER+071) * amiga date variable
  86. XAD_DATEDATESTAMP    EQU    (TAG_USER+072) * struct DateStamp
  87. XAD_DATEXADDATE        EQU    (TAG_USER+073) * struct xadDate
  88. XAD_DATECLOCKDATA    EQU    (TAG_USER+074) * struct ClockData
  89. XAD_DATECURRENTTIME    EQU    (TAG_USER+075) * input is system time
  90. XAD_DATEMSDOS        EQU    (TAG_USER+076) * MS-DOS packed format (V2)
  91.  
  92. * output tags, there can be specified multiple tags for one call
  93. XAD_GETDATEUNIX     EQU    (TAG_USER+080) * unix date variable
  94. XAD_GETDATEAMIGA    EQU    (TAG_USER+081) * amiga date variable
  95. XAD_GETDATEDATESTAMP    EQU    (TAG_USER+082) * struct DateStamp
  96. XAD_GETDATEXADDATE    EQU    (TAG_USER+083) * struct xadDate
  97. XAD_GETDATECLOCKDATA    EQU    (TAG_USER+084) * struct ClockData
  98. XAD_GETDATEMSDOS    EQU    (TAG_USER+086) * MS-DOS packed format (V2)
  99.  
  100. * following tags need locale.library to be installed
  101. XAD_MAKEGMTDATE        EQU    (TAG_USER+090) * make local to GMT time
  102. XAD_MAKELOCALDATE    EQU    (TAG_USER+091) * make GMT to local time
  103.  
  104. * tags for xadHookTagAccess (V3)
  105. XAD_USESKIPINFO        EQU    (TAG_USER+104) * the hook uses xadSkipInfo (V3)
  106.  
  107. XAD_GETCRC16        EQU    (TAG_USER+120) * pointer to UWORD value (V3)
  108. XAD_GETCRC32        EQU    (TAG_USER+121) * pointer to ULONG value (V3)
  109.  
  110. XAD_CRC16ID        EQU    (TAG_USER+130) * ID for crc calculation (V3)
  111. XAD_CRC32ID        EQU    (TAG_USER+131) * ID for crc calculation (V3)
  112.  
  113. * tags for xadConvertProtection (V4)
  114. XAD_PROTAMIGA        EQU    (TAG_USER+160) * Amiga type protection bits (V4)
  115. XAD_PROTUNIX        EQU    (TAG_USER+161) * protection bits in UNIX mode (V4)
  116. XAD_PROTMSDOS        EQU    (TAG_USER+162) * MSDOS type protection bits (V4)
  117.  
  118. XAD_GETPROTAMIGA    EQU    (TAG_USER+170) * return Amiga protection bits (V4)
  119.  
  120. * tags for xadGetDiskInfo (V7)
  121. XAD_STARTCLIENT        EQU    (TAG_USER+180) * the client to start with (V7)
  122.  
  123. *************************************************************************
  124. *                                                *
  125. *    objects for xadAllocObjectA                           *
  126. *                                                *
  127. *************************************************************************
  128.  
  129. XADOBJ_ARCHIVEINFO    EQU    $0001 * struct xadArchiveInfo
  130. XADOBJ_FILEINFO        EQU    $0002 * struct xadFileInfo
  131. XADOBJ_DISKINFO        EQU    $0003 * struct xadDiskInfo
  132. XADOBJ_HOOKPARAM    EQU    $0004 * struct HookParam
  133. XADOBJ_DEVICEINFO    EQU    $0005 * struct xadDeviceInfo
  134. XADOBJ_PROGRESSINFO    EQU    $0006 * struct xadProgressInfo
  135. XADOBJ_TEXTINFO        EQU    $0007 * struct xadTextInfo
  136. XADOBJ_SPLITFILE    EQU    $0008 * struct xadSplitFile (V2)
  137. XADOBJ_SKIPINFO        EQU    $0009 * struct xadSkipInfo (V3)
  138. XADOBJ_IMAGEINFO    EQU    $000A * struct xadImageInfo (V4)
  139.  
  140. * result type of xadAllocVec
  141. XADOBJ_MEMBLOCK        EQU    $0100 * memory of requested size and type
  142.  
  143. *************************************************************************
  144. *                                                *
  145. *    modes for xadCalcCRC126 and xadCalcCRC32                *
  146. *                                                *
  147. *************************************************************************
  148.  
  149. XADCRC16_ID1        EQU    $A001
  150. XADCRC32_ID1        EQU    $EDB88320
  151.  
  152. *************************************************************************
  153. *                                                *
  154. *    hook related stuff                                *
  155. *                                                *
  156. *************************************************************************
  157.  
  158. XADHC_READ    EQU    1    * read data into buffer
  159. XADHC_WRITE    EQU    2    * write buffer data to file/memory
  160. XADHC_SEEK    EQU    3    * seek in file
  161. XADHC_INIT    EQU    4    * initialize the hook
  162. XADHC_FREE    EQU    5    * end up hook work, free stuff
  163. XADHC_ABORT    EQU    6    * an error occured, delete partial stuff
  164. XADHC_FULLSIZE    EQU    7    * complete input size is needed
  165. XADHC_IMAGEINFO    EQU    8    * return disk image info (V4)
  166.  
  167.     STRUCTURE xadHookParam,0
  168.       ULONG    xhp_Command
  169.     ULONG    xhp_CommandData
  170.     APTR    xhp_BufferPtr
  171.       LONG    xhp_BufferSize
  172.       LONG    xhp_DataPos    * current seek position
  173.       APTR    xhp_PrivatePtr
  174.  
  175. * xadHookAccess commands
  176. XADAC_READ        EQU    10    * get data
  177. XADAC_WRITE        EQU    11    * write data
  178. XADAC_COPY        EQU    12    * copy input to output
  179. XADAC_INPUTSEEK        EQU    13    * seek in input file
  180. XADAC_OUTPUTSEEK    EQU    14    * seek in output file
  181.  
  182. *************************************************************************
  183. *                                                *
  184. *    support structures                              *
  185. *                                                *
  186. *************************************************************************
  187.  
  188. * Own date structure to cover all possible dates in a human friendly
  189. * format. xadConvertDates may be used to convert between different date
  190. * structures and variables.
  191.     STRUCTURE xadDate,0
  192.       ULONG     xd_Micros    * values 0 to 999999
  193.       LONG      xd_Year         * values 1 to 2147483648
  194.       UBYTE     xd_Month    * values 1 to 12
  195.       UBYTE     xd_WeekDay    * values 1 to 7
  196.       UBYTE     xd_Day        * values 1 to 31
  197.       UBYTE     xd_Hour        * values 0 to 23
  198.       UBYTE     xd_Minute    * values 0 to 59
  199.       UBYTE     xd_Second    * values 0 to 59
  200.       LABEL     xadDate_SIZE
  201.  
  202. XADDAY_MONDAY        EQU    1    * monday is the first day and
  203. XADDAY_TUESDAY        EQU    2
  204. XADDAY_WEDNESDAY    EQU    3
  205. XADDAY_THURSDAY        EQU    4
  206. XADDAY_FRIDAY        EQU    5
  207. XADDAY_SATURDAY     EQU    6
  208. XADDAY_SUNDAY        EQU    7    * sunday the last day of a week
  209.  
  210.     STRUCTURE xadDeviceInfo,0    * for XAD_OUTDEVICE tag
  211.     APTR    xdi_DeviceName    * name of device
  212.     ULONG    xdi_Unit    * unit of device
  213.     APTR    xdi_DOSName    * instead of Device+Unit, dos name without ':'
  214.  
  215.     STRUCTURE xadSplitFile,0    * for XAD_INSPLITTED
  216.       APTR    xsf_Next
  217.     ULONG    xsf_Type    * XAD_INFILENAME, XAD_INFILEHANDLE, XAD_INMEMORY, XAD_INHOOK
  218.     ULONG    xsf_Size    * necessary for XAD_INMEMORY, useful for others
  219.     ULONG    xsf_Data    * FileName, Filehandle, Hookpointer or Memory
  220.  
  221.     STRUCTURE xadSkipInfo,0
  222.     APTR    xsi_Next
  223.     ULONG    xsi_Position    * position, where it should be skipped
  224.     ULONG    xsi_SkipSize    * size to skip
  225.  
  226.     STRUCTURE xadImageInfo,0    * for XADHC_IMAGEINFO
  227.     ULONG xii_SectorSize    * usually 512
  228.     ULONG xii_FirstSector    * of the image file
  229.     ULONG xii_NumSectors    * of the image file
  230.     ULONG xii_TotalSectors    * of this device type
  231.     * If the image file holds total data of disk xii_TotalSectors equals
  232.        * xii_NumSectors and xii_FirstSector is zero. Addition of xii_FirstSector
  233.     * and xii_NumSectors cannot exceed xii_TotalSectors value!
  234.  
  235. *************************************************************************
  236. *                                                *
  237. *    information structures                              *
  238. *                                                *
  239. *************************************************************************
  240.  
  241.     STRUCTURE xadArchiveInfo,0
  242.       APTR    xai_Client      * pointer to unarchiving client
  243.     APTR    xai_PrivateClient * private client data
  244.     APTR    xai_Password      * password for crypted archives
  245.     ULONG    xai_Flags        * read only XADAIF_ flags
  246.     ULONG    xai_LowCyl       * lowest cylinder to unarchive
  247.     ULONG    xai_HighCyl      * highest cylinder to unarchive
  248.     ULONG    xai_InPos        * input position, read only
  249.     ULONG    xai_InSize       * input size, read only
  250.     ULONG    xai_OutPos       * output position, read only
  251.     ULONG    xai_OutSize      * output file size, read only
  252.     APTR    xai_FileInfo      * data pointer for file arcs
  253.     APTR    xai_DiskInfo      * data pointer for disk arcs
  254.     APTR    xai_CurFile      * data pointer for current file arc
  255.     APTR    xai_CurDisk      * data pointer for current disk arc
  256.       LONG    xai_LastError      * last error, when XADAIF_FILECORRUPT (V2)
  257.     APTR    xai_MultiVolume      * array of start offsets from parts (V2)
  258.     APTR    xai_SkipInfo      * linked list of skip entries (V3)
  259.       APTR    xai_ImageInfo      * for filesystem clients (V5)
  260.     APTR    xai_InName      * Input archive name if available (V7)
  261.  
  262. * This structure is nearly complete private to either xadmaster or its
  263. * clients. An application program may access for reading only xai_Client,
  264. * xai_Flags, xai_FileInfo and xai_DiskInfo. For xai_Flags only XADAIF_CRYPTED
  265. * is useful. All the other stuff is private and should not be accessed!
  266.  
  267.     BITDEF XADAI,CRYPTED,0        * archive entries are encrypted
  268.     BITDEF XADAI,FILECORRUPT,1    * file is corrupt, but valid entries are in the list
  269.     BITDEF XADAI,FILEARCHIVE,2    * unarchive file entry
  270.     BITDEF XADAI,DISKARCHIVE,3    * unarchive disk entry
  271.     BITDEF XADAI,OVERWRITE,4    * overwrite the file (PRIVATE)
  272.     BITDEF XADAI,MAKEDIRECTORY,5    * create directory when missing (PRIVATE)
  273.     BITDEF XADAI,IGNOREGEOMETRY,6    * ignore drive geometry (PRIVATE)
  274.     BITDEF XADAI,VERIFY,7        * verify is turned on for disk hook (PRIVATE)
  275.     BITDEF XADAI,NOKILLPARTIAL,8    * do not delete partial files (PRIVATE)
  276.     BITDEF XADAI,DISKIMAGE,9    * is disk image extraction (V5)
  277.     BITDEF XADAI,FORMAT,10        * format in disk hook (PRIVATE)
  278.  
  279.     STRUCTURE xadFileInfo,0
  280.     APTR    xfi_Next
  281.     ULONG    xfi_EntryNumber    * number of entry, starts with 1
  282.     APTR    xfi_EntryInfo      * additional archiver text
  283.     APTR    xfi_PrivateInfo    * client private, see XAD_OBJPRIVINFOSIZE
  284.     ULONG    xfi_Flags          * see XADFIF_xxx defines
  285.     APTR    xfi_FileName       * see XAD_OBJNAMESIZE tag
  286.     APTR    xfi_Comment        * see XAD_OBJCOMMENTSIZE tag
  287.     ULONG      xfi_Protection     * OS 3 bits (including multiuser)
  288.     ULONG    xfi_OwnerUID       * user ID
  289.     ULONG    xfi_OwnerGID       * group ID
  290.     APTR    xfi_UserName       * user name
  291.     APTR    xfi_GroupName      * group name
  292.     ULONG   xfi_Size           * size of this file
  293.     ULONG    xfi_GroupCrSize    * crunched size of group
  294.     ULONG    xfi_CrunchSize     * crunched size
  295.     APTR    xfi_LinkName       * name and path of link
  296.     STRUCT    xfi_Date,xadDate_SIZE
  297.     UWORD   xfi_Generation  * File Generation [0...$FFFF] (V3)
  298.     ULONG    xfi_DataPos     * crunched data position (V3)
  299.     APTR    xfi_MacFork     * pointer to 2nd fork for Mac (V7)
  300.  
  301. * Multiuser fields (xfi_OwnerUID, xfi_OwnerUID, xfi_UserName, xfi_GroupName)
  302. * and multiuser bits (see <dos/dos.h>) are currently not supported with normal
  303. * Amiga filesystem. But the clients support them, if archive format holds
  304. * such information.
  305.  
  306.     BITDEF XADFI,CRYPTED,0        * entry is crypted
  307.     BITDEF XADFI,DIRECTORY,1    * entry is a directory
  308.     BITDEF XADFI,LINK,2        * entry is a link
  309.     BITDEF XADFI,INFOTEXT,3        * file is an information text
  310.     BITDEF XADFI,GROUPED,4        * file is in a crunch group
  311.     BITDEF XADFI,ENDOFGROUP,5    * crunch group ends here
  312.     BITDEF XADFI,NODATE,6        * no date supported, CURRENT date is set
  313.     BITDEF XADFI,DELETED,7        * file is marked as deleted (V3)
  314.     BITDEF XADFI,SEEKDATAPOS,8    * before unarchiving the datapos is set (V3)
  315.     BITDEF XADFI,NOFILENAME,9    * there was no filename, using internal one (V6)
  316.     BITDEF XADFI,NOUNCRUNCHSIZE,10    * file size is unknown and thus set to zero (V6)
  317.     BITDEF XADFI,PARTIALFILE,11    * file is only partial (V6)
  318.     BITDEF XADFI,MACDATA,12        * file is Apple data fork (V7)
  319.     BITDEF XADFI,MACRESOURCE,13    * file is Apple resource fork (V7)
  320.  
  321. * NOTE: the texts passed with that structure must not always be printable.
  322. * Although the clients should add an additional (not counted) zero at the text
  323. * end, the whole file may contain other unprintable stuff (e.g. for DMS).
  324. * So when printing this texts do it on a byte for byte base including
  325. * printability checks.
  326.  
  327.     STRUCT xadTextInfo,0
  328.     APTR    xti_Next
  329.     ULONG    xti_Size    * maybe zero - no text - e.g. when crypted
  330.     APTR    xti_Text    * and there is no password in xadGetInfo()
  331.     ULONG    xti_Flags    * see XADTIF_xxx defines
  332.  
  333.     BITDEF    XADTI,CRYPTED,0    * entry is empty, as data was crypted
  334.     BITDEF    XADTI,BANNER,1    * text is a banner
  335.     BITDEF    XADTI,FILEDIZ,2    * text is a file description
  336.  
  337.     STRUCT xadDiskInfo,0
  338.     APTR    xdi_Next
  339.     ULONG    xdi_EntryNumber      * number of entry, starts with 1
  340.     APTR    xdi_EntryInfo        * additional archiver text
  341.     APTR    xdi_PrivateInfo      * client private, see XAD_OBJPRIVINFOSIZE
  342.     ULONG    xdi_Flags         * see XADDIF_xxx defines
  343.     ULONG    xdi_SectorSize
  344.     ULONG    xdi_TotalSectors    * see devices/trackdisk.h
  345.     ULONG    xdi_Cylinders        * to find out what these
  346.     ULONG    xdi_CylSectors          * fields mean, they are equal
  347.     ULONG    xdi_Heads          * to struct DriveGeometry
  348.     ULONG    xdi_TrackSectors
  349.     ULONG    xdi_LowCyl           * lowest cylinder stored
  350.     ULONG    xdi_HighCyl          * highest cylinder stored
  351.     ULONG    xdi_BlockInfoSize    * number of BlockInfo entries
  352.     APTR    xdi_BlockInfo        * see XADBIF_xxx defines and XAD_OBJBLOCKENTRIES tag
  353.     APTR    xdi_TextInfo        * linked list with info texts
  354.     ULONG    xdi_DataPos        * crunched data position (V3)
  355.  
  356. * BlockInfo points to a UBYTE field for every track from first sector of
  357. * lowest cylinder to last sector of highest cylinder. When not used,
  358. * pointer must be 0. Do not use it, when there are no entries!
  359. * This is just for information. The applications still asks the client
  360. * to unarchive whole cylinders and not archived blocks are cleared for
  361. * unarchiving.
  362.     BITDEF XADDI,CRYPTED,0        * entry is crypted
  363.     BITDEF XADDI,SEEKDATAPOS,1    * before unarchiving the datapos is set (V3)
  364.  
  365. * Some of the crunchers do not store all necessary information, so it
  366. * may be needed to guess some of them. Set the following flags in that case
  367. * and geometry check will ignore these fields.
  368.     BITDEF XADDI,GUESSCYLINDERS,7      * cylinder number is guessed
  369.     BITDEF XADDI,GUESSCYLSECTORS,8      * cylsectors is guessed
  370.     BITDEF XADDI,GUESSHEADS,9      * number of heads is guessed
  371.     BITDEF XADDI,GUESSTRACKSECTORS,10 * tracksectors is guessed
  372.     BITDEF XADDI,GUESSLOWCYL,11      * lowcyl is guessed
  373.     BITDEF XADDI,GUESSHIGHCYL,12      * highcyl is guessed
  374.  
  375. * If it is impossible to set some of the fields, you need to set some of
  376. * these flags. NOTE: XADDIB_NOCYLINDERS is really important, as this turns
  377. * of usage of lowcyl and highcyl keywords. When you have cylinder information,
  378. * you should not use these and instead use guess flags and calculate
  379. * possible values for the missing fields.
  380.     BITDEF XADDI,NOCYLINDERS,15    * cylinder number is not set
  381.     BITDEF XADDI,NOCYLSECTORS,16    * cylsectors is not set
  382.     BITDEF XADDI,NOHEADS,17        * number of heads is not set
  383.     BITDEF XADDI,NOTRACKSECTORS,18    * tracksectors is not set
  384.     BITDEF XADDI,NOLOWCYL,19    * lowcyl is not set
  385.     BITDEF XADDI,NOHIGHCYL,20    * highcyl is not set
  386.  
  387. * defines for BlockInfo
  388.     BITDEF XADBI,CLEARED,0    * this block was cleared for archiving
  389.     BITDEF XADBI,UNUSED,1    * this block was not archived
  390.  
  391. *************************************************************************
  392. *                                                *
  393. *    progress report stuff                              *
  394. *                                                *
  395. *************************************************************************
  396.  
  397.     STRUCTURE xadProgressInfo,0
  398.     ULONG    xpi_Mode    * work modus
  399.     APTR    xpi_Client    * the client doing the work
  400.     APTR    xpi_DiskInfo    * current diskinfo, for disks
  401.     APTR    xpi_FileInfo    * current info for files
  402.     ULONG    xpi_CurrentSize    * current filesize
  403.     ULONG    xpi_LowCyl    * for disks only
  404.     ULONG    xpi_HighCyl    * for disks only
  405.     ULONG    xpi_Status    * see XADPIF flags
  406.     LONG    xpi_Error    * any of the error codes
  407.     APTR    xpi_FileName    * name of file to overwrite (V2)
  408.     APTR    xpi_NewName    * new name buffer, passed by hook (V2)
  409. * NOTE: For disks CurrentSize is Sector*SectorSize, where SectorSize can
  410. * be found in xadDiskInfo structure. So you may output the sector value.
  411.  
  412. * different progress modes
  413. XADPMODE_ASK        EQU    1
  414. XADPMODE_PROGRESS    EQU    2
  415. XADPMODE_END        EQU    3
  416. XADPMODE_ERROR        EQU    4
  417.  
  418. * flags for progress hook and ProgressInfo status field
  419.     BITDEF XADPI,OVERWRITE,0    * overwrite the file
  420.     BITDEF XADPI,MAKEDIRECTORY,1    * create the directory
  421.     BITDEF XADPI,IGNOREGEOMETRY,2    * ignore drive geometry
  422.     BITDEF XADPI,RENAME,10        * rename the file (V2)
  423.     BITDEF XADPI,OK,16        * all ok, proceed
  424.     BITDEF XADPI,SKIP,17        * skip file
  425.  
  426. *************************************************************************
  427. *                                                *
  428. *    errors                                       *
  429. *                                                *
  430. *************************************************************************
  431.  
  432. XADERR_OK        EQU    $0000 * no error
  433. XADERR_UNKNOWN        EQU    $0001 * unknown error
  434. XADERR_INPUT        EQU    $0002 * input data buffers border exceeded
  435. XADERR_OUTPUT        EQU    $0003 * output data buffers border exceeded
  436. XADERR_BADPARAMS    EQU    $0004 * function called with illegal parameters
  437. XADERR_NOMEMORY        EQU    $0005 * not enough memory available
  438. XADERR_ILLEGALDATA    EQU    $0006 * data is corrupted
  439. XADERR_NOTSUPPORTED    EQU    $0007 * command is not supported
  440. XADERR_RESOURCE        EQU    $0008 * required resource missing
  441. XADERR_DECRUNCH        EQU    $0009 * error on decrunching
  442. XADERR_FILETYPE        EQU    $000A * unknown file type
  443. XADERR_OPENFILE        EQU    $000B * opening file failed
  444. XADERR_SKIP        EQU    $000C * file, disk has been skipped
  445. XADERR_BREAK        EQU    $000D * user break in progress hook
  446. XADERR_FILEEXISTS    EQU    $000E * file already exists
  447. XADERR_PASSWORD        EQU    $000F * missing or wrong password
  448. XADERR_MAKEDIR        EQU    $0010 * could not create directory
  449. XADERR_CHECKSUM        EQU    $0011 * wrong checksum
  450. XADERR_VERIFY        EQU    $0012 * verify failed (disk hook)
  451. XADERR_GEOMETRY        EQU    $0013 * wrong drive geometry
  452. XADERR_DATAFORMAT    EQU    $0014 * unknown data format
  453. XADERR_EMPTY        EQU    $0015 * source file contains no files
  454. XADERR_FILESYSTEM    EQU    $0016 * unknown filesystem
  455.  
  456. *************************************************************************
  457. *                                                *
  458. *    client related stuff                           *
  459. *                                                *
  460. *************************************************************************
  461.  
  462.     STRUCTURE xadForeman,0
  463.     ULONG    xfm_Security    * should be XADFOREMAN_SECURITY
  464.     ULONG    xfm_ID              * must be XADFOREMAN_ID
  465.     UWORD    xfm_Version     * set to XADFOREMAN_VERSION
  466.     UWORD    xfm_Reserved
  467.     APTR    xfm_VersString  * pointer to $VER: string
  468.     APTR    xfm_FirstClient * pointer to first client
  469.     LABEL    xadForman_SIZE
  470.  
  471. XADFOREMAN_SECURITY    EQU    $70FF4E75 * MOVEQ #-1,D0 and RTS
  472. XADFOREMAN_ID        EQU    $58414446 * 'XADF' identification ID
  473. XADFOREMAN_VERSION    EQU    1
  474.  
  475.     STRUCTURE xadClient,0
  476.     APTR    xc_Next
  477.     UWORD    xc_Version    * set to XADCLIENT_VERSION
  478.     UWORD    xc_MasterVersion
  479.     UWORD    xc_ClientVersion
  480.     UWORD    xc_ClientRevision
  481.     ULONG    xc_RecogSize    * needed size to recog the type
  482.     ULONG    xc_Flags    * see XADCF_xxx defines
  483.     ULONG    xc_Identifier    * ID of internal clients
  484.     APTR    xc_ArchiverName
  485.     APTR    xc_RecogData
  486.     APTR    xc_GetInfo
  487.     APTR    xc_UnArchive
  488.     APTR    xc_Free
  489.     LABEL    xadClient_SIZE
  490.  
  491. * function interface
  492. * ASM(BOOL) xc_RecogData(REG(d0, ULONG size), REG(a0, STRPTR data),
  493. *        REG(a6, struct xadMasterBase *xadMasterBase))
  494. * ASM(LONG) xc_GetInfo(REG(a0, struct xadArchiveInfo *ai),
  495. *        REG(a6, struct xadMasterBase *xadMasterBase))
  496. * ASM(LONG) xc_UnArchive(REG(a0, struct xadArchiveInfo *ai),
  497. *        REG(a6, struct xadMasterBase *xadMasterBase))
  498. * ASM(void) xc_Free(REG(a0, struct xadArchiveInfo *ai),
  499. *        REG(a6, struct xadMasterBase *xadMasterBase))
  500.  
  501.  
  502. * xc_RecogData returns 1 when recognized and 0 when not, all the others
  503. * return 0 when ok and XADERR values on error. xc_Free has no return
  504. * value.
  505.  
  506. * Filesystem clients need to clear xc_RecogSize and xc_RecogData. The
  507. * recognition is automatically done by GetInfo. XADERR_FILESYSTEM is
  508. * returned in case of unknown format. If it is known detection should
  509. * go on and any other code may be returned, if it fails.
  510. * The field xc_ArchiverName means xc_FileSystemName for filesystem
  511. * clients.
  512.  
  513. XADCLIENT_VERSION    EQU    1
  514.  
  515.     BITDEF XADC,FILEARCHIVER,0    * archiver is a file archiver
  516.     BITDEF XADC,DISKARCHIVER,1    * archiver is a disk archiver
  517.     BITDEF XADC,EXTERN,2        * external client, set by xadmaster
  518.     BITDEF XADC,FILESYSTEM,3    * filesystem clients (V5)
  519.     BITDEF XADC,NOCHECKSIZE,4    * do not check size for recog call (V6)
  520.     BITDEF XADC,FREESKIPINFO,27    * master frees xadSkipInfo structures (V3)
  521.     BITDEF XADC,FREETEXTINFO,28    * master frees xadTextInfo structures (V2)
  522.     BITDEF XADC,FREETEXTINFOTEXT,29    * master frees xadTextInfo text block (V2)
  523.     BITDEF XADC,FREEFILEINFO,30    * master frees xadFileInfo structures (V2)
  524.     BITDEF XADC,FREEDISKINFO,31    * master frees xadDiskInfo structures (V2)
  525.  
  526. *************************************************************************
  527. *                                                *
  528. *    client ID's                                   *
  529. *                                                *
  530. *************************************************************************
  531.  
  532. * If an external client has set the xc_Identifier field, the internal
  533. * client is replaced.
  534.  
  535. * disk archivers start with 1000
  536. XADCID_XMASH            EQU    1000
  537. XADCID_SUPERDUPER3        EQU    1001
  538. XADCID_XDISK            EQU    1002
  539. XADCID_PACKDEV            EQU    1003
  540. XADCID_ZOOM            EQU    1004
  541. XADCID_ZOOM5            EQU    1005
  542. XADCID_CRUNCHDISK        EQU    1006
  543. XADCID_PACKDISK            EQU    1007
  544. XADCID_MDC            EQU    1008
  545. XADCID_COMPDISK            EQU    1009
  546. XADCID_LHWARP            EQU    1010
  547. XADCID_SAVAGECOMPRESSOR        EQU    1011
  548.  
  549. * file archivers start with 5000
  550. XADCID_TAR            EQU    5000
  551. XADCID_SDSSFX            EQU    5001
  552. XADCID_LZX            EQU    5002
  553. XADCID_MXMSIMPLEARC        EQU    5003
  554. XADCID_LHPAK            EQU    5004
  555. XADCID_AMIGAPLUSUNPACK        EQU    5005
  556. XADCID_AMIPACK            EQU    5006
  557. XADCID_LHA            EQU    5007
  558. XADCID_LHASFX            EQU    5008
  559. XADCID_PCOMPARC            EQU    5009
  560. XADCID_SOMNI            EQU    5010
  561. XADCID_LHSFX            EQU    5011
  562. XADCID_XPKARCHIVE        EQU    5012
  563. XADCID_SHRINK            EQU    5013
  564. XADCID_SPACK            EQU    5014
  565. XADCID_SPACKSFX            EQU    5015
  566. XADCID_ZIP            EQU    5016
  567. XADCID_WINZIPEXE        EQU    5017
  568. XADCID_GZIP            EQU    5018
  569. XADCID_ARC            EQU    5019
  570. XADCID_ZOO            EQU    5020
  571. XADCID_LHAEXE            EQU    5021
  572. XADCID_ARJ            EQU    5022
  573. XADCID_ARJEXE            EQU    5023
  574. XADCID_ZIPEXE            EQU    5024
  575. XADCID_LHF            EQU    5025
  576. XADCID_COMPRESS            EQU    5026
  577. XADCID_ACE            EQU    5027
  578. XADCID_ACEEXE            EQU    5028
  579.  
  580. * filesystem client start with 8000
  581. XADCID_FSAMIGA            EQU    8000
  582. XADCID_FSSANITYOS        EQU    8001
  583.  
  584. * mixed archivers start with 9000
  585. XADCID_DMS            EQU    9000
  586. XADCID_DMSSFX            EQU    9001
  587.  
  588.     ENDC    ; LIBRARIES_XADMASTER_I
  589.