home *** CD-ROM | disk | FTP | other *** search
/ Enigma Amiga Life 113 / EnigmaAmiga113CD.iso / software / varie / xad / developer / include / autodocs / xadmaster.doc next >
Encoding:
Text File  |  2000-06-25  |  50.8 KB  |  1,317 lines

  1. TABLE OF CONTENTS
  2.  
  3. xadmaster.library/--general--
  4. xadmaster.library/xadAllocObject
  5. xadmaster.library/xadAllocVec
  6. xadmaster.library/xadCalcCRC16
  7. xadmaster.library/xadCalcCRC32
  8. xadmaster.library/xadConvertDates
  9. xadmaster.library/xadConvertProtection
  10. xadmaster.library/xadCopyMem
  11. xadmaster.library/xadDiskUnArc
  12. xadmaster.library/xadDiskFileUnArc
  13. xadmaster.library/xadFileUnArc
  14. xadmaster.library/xadFreeInfo
  15. xadmaster.library/xadFreeObject
  16. xadmaster.library/xadGetClientInfo
  17. xadmaster.library/xadGetDiskInfo
  18. xadmaster.library/xadGetErrorText
  19. xadmaster.library/xadGetInfo
  20. xadmaster.library/xadHookAccess
  21. xadmaster.library/xadHookTagAccess
  22. xadmaster.library/xadRecogFile
  23. xadmaster.library/--tags--
  24. xadmaster.library/--data hooks--
  25. xadmaster.library/--progress hooks--
  26.  
  27. VERSION
  28.         $VER: xadmaster.doc 7.0 (04.06.2000) by SDI
  29.  
  30. xadmaster.library/--general--                   xadmaster.library/--general--
  31.  
  32.     This library gives you an interface to extract data from file or disk
  33.     archives.
  34.  
  35.     When unachiving a archive you need to do following steps always
  36.     1) Allocate a "struct xadArchiveInfo" with a call to
  37.        xadAllocObjectA(XADOBJ_ARCHIVEINFO, 0). This structure is the master
  38.        interface and must not by modified in any way. Nearly all other
  39.        functions you may use need to get the pointer this this structure.
  40.        All data is passed with tags!
  41.  
  42.     2a)Call xadGetInfo() to find out if the input data is archived. If it
  43.        is, the xadArchiveInfo structure is filled with lots of information
  44.        (but the structure may contain empty lists!).
  45.        See xadGetInfo() description to see what you may read and what stuff
  46.        not. One of the input tags must be specified here to specify one 
  47.        of the allowed input stream methods.
  48.  
  49.     2b)Call xadGetDiskInfo() to find out if input data is filesystem data.
  50.  
  51.     Goto step 5 if step 2 returns error code!
  52.  
  53.     3) For every file in a file archive or every disk call xadFileUnArc() or
  54.        xadDiskUnArc() (or xadDiskFileUnArc() if you did step 2b) with one tag
  55.        XAD_ENTRYNUMBER set to wanted entry. One of the output tags must be
  56.        specified here.
  57.        Passwords and other stuff is additionally allowed and sometimes
  58.        required.
  59.  
  60.     4) Call xadFreeInfo() to free the stuff allocated with xadGetInfo() or
  61.        xadGetDiskInfo().
  62.  
  63.     5) Use xadFreeObjectA() to free the xadArchiveInfo structure.
  64.  
  65.     If using xadGetDiskInfo(), there maybe multiple filesystems on one disk.
  66.     If one is detected, do another run and use XAD_STARTCLIENT in step 2b).
  67.     If you detected disk archives, it maybe useful to scan them for file-
  68.     systems as well.
  69.  
  70.     Do not use one xadArchiveInfo file structure for multiple input files!
  71.     
  72.     ANY needed structure must be allocated with xadAllocObject()! None of
  73.     the xadmaster structures can be allocated any other way!
  74.  
  75.     There exist lots of tags, which can be passed to the functions of this
  76.     library. Some of these are repeated in the xadArchiveInfo communication
  77.     structure. Do NEVER set this flags or values directly, but always use
  78.     the corresponding tags. The handling of these elements possibly will
  79.     change, but the tags will stay valid always!
  80.  
  81.     I know there are lots of flags which have long and strange names. The
  82.     method is not so complicated as you may think. They always follow following
  83.     guideline: XADxxY_zzzzz
  84.     xx - short name of their structure (AI - xadArchiveInfo, DI - xadDiskInfo,
  85.          C - xadClient, ...)
  86.     Y  - F for flag or B for bit value
  87.     zz - The flag name itself
  88.     So XADPIF_OVERWRITE is a flag for xadProgressInfo, which is called
  89.     OVERWRITE and XADAIB_OVERWRITE is a bit value for xadArchiveInfo structure.
  90.     
  91.     Also all the structure elements cover a short prefix indicating the name
  92.     of the master structure (xfi for xadFileInfo, xc for xadClient, ...). So
  93.     you can always check if your code is valid by comparing the prefixes.
  94.  
  95. xadmaster.library/xadAllocObject             xadmaster.library/xadAllocObject
  96.  
  97.     NAME
  98.         xadAllocObject - Allocate memory for all xad related structures
  99.  
  100.     SYNOPSIS
  101.         ptr = xadAllocObjectA(type, tags)
  102.         D0                    D0    A0
  103.  
  104.         APTR xadAllocObjectA(ULONG, struct TagItem *)
  105.  
  106.         ptr = xadAllocObject(type, tag1, ...)
  107.  
  108.         APTR xadAllocObject(ULONG, Tag, ...)
  109.  
  110.     FUNCTION
  111.         This function allocates the memory of a needed xad related
  112.         structure and initializes it. You need to use this function to
  113.         allocate the structures. Any other way of allocating is not
  114.         allowed.
  115.     The structures are initialized, which means filled with zero in
  116.     nearly all cases. Fields allocated with XAD_OBJxxx are filled with
  117.     corresponding pointers and are cleared also. It is NOT necessary
  118.     to leave these pointers intact when calling xadFreeObject().
  119.  
  120.     INPUT
  121.         type    - in libraries/xadmaster.h defined XADOBJ_... types.
  122.                   For example XADOBJ_FILEINFO allocates xadFileInfo
  123.                   structure.
  124.         tags    - Pointer to an array of struct TagItem. Recognized tags: 
  125.                   XAD_OBJNAMESIZE, XAD_OBJCOMMENTSIZE, XAD_OBJBLOCKENTRIES,
  126.                   XAD_OBJPRIVINFOSIZE
  127.  
  128.     RESULT
  129.         ptr     - Pointer to required structure or 0 when an error occured.
  130.  
  131.     SEE ALSO
  132.         libraries/xadmaster.h, xadFreeObject(), tags section
  133.  
  134. xadmaster.library/xadAllocVec                   xadmaster.library/xadAllocVec
  135.  
  136.     NAME
  137.         xadAllocVec - Allocate memory for xad related stuff (V2)
  138.  
  139.     SYNOPSIS
  140.         ptr = xadAllocVec(size, flags)
  141.         D0                 D0     D1
  142.  
  143.         APTR xadAllocVec(ULONG, ULONG)
  144.  
  145.     FUNCTION
  146.         This function allocates memory for stuff related to xad. It is like
  147.         exec.library AllocVec() function, but uses xadFreeObject() to free
  148.         stuff and reduces the need for SysBase in clients. It's the prefered
  149.         method to allocate memory in clients.
  150.  
  151.     INPUT
  152.         size    - The size in bytes.
  153.         flags   - Normal MEMF_... flags defined in exec/types.h
  154.  
  155.     RESULT
  156.         ptr     - Pointer to required memory or 0 when an error occured.
  157.  
  158.     SEE ALSO
  159.         libraries/xadmaster.h, exec/types.h, exec.doc/AllocMem(),
  160.         xadFreeObject(),
  161.  
  162. xadmaster.library/xadCalcCRC16                 xadmaster.library/xadCalcCRC16
  163.  
  164.     NAME
  165.         xadCalcCRC16 - calculate a 16 bit CRC
  166.  
  167.     SYNOPSIS
  168.         crc16 = xadCalcCRC16(id, init, size, buffer)
  169.         D0                   D0   D1    D2     A0
  170.  
  171.         UWORD xadCalcCRC16(UWORD, UWORD, ULONG, STRPTR)
  172.  
  173.     FUNCTION
  174.         This function calculates a 16 bit CRC. It is possible to choose the
  175.         calculation method by parameter id.
  176.  
  177.         The CRC calculation uses a table built with following function:
  178.         void MakeCRC16(UWORD *buf, ULONG ID)
  179.         {
  180.           UWORD i, j, k;
  181.  
  182.           for(i = 0; i < 256; ++i)
  183.           {
  184.             k = i;
  185.  
  186.             for(j = 0; j < 8; ++j)
  187.             {
  188.               if(k & 1)
  189.                 k = (k >> 1) ^ ID;
  190.               else
  191.                 k >>= 1;
  192.             }
  193.             buf[i] = k;
  194.           }
  195.         }
  196.  
  197.         The used calculation routine is like that:
  198.         crc = init;
  199.         while(size--)
  200.           crc = tab[(crc ^ *buffer++) & 0xFF] ^ (crc >> 8);
  201.  
  202.         ID's defined in xadmaster.h use a default table. All others build the
  203.         table on the fly.
  204.         XADCRC16_ID1: (0xA001) - Used by DMS, Arc, ...
  205.  
  206.     INPUT
  207.         id      - The table creation ID (maybe XADCR16_ID value)
  208.         init    - The initial value for CRC calculation.
  209.         size    - The input buffer size.
  210.         buffer  - A pointer to the input buffer.
  211.  
  212.     RESULT
  213.         crc16   - The calculated CRC value.
  214.  
  215.     SEE ALSO
  216.         libraries/xadmaster.h, xadCalcCRC32
  217.  
  218. xadmaster.library/xadCalcCRC32                 xadmaster.library/xadCalcCRC32
  219.  
  220.     NAME
  221.         xadCalcCRC32 - calculate a 32 bit CRC
  222.  
  223.     SYNOPSIS
  224.         crc32 = xadCalcCRC32(id, init, size, buffer)
  225.         D0                   D0   D1    D2     A0
  226.  
  227.         ULONG xadCalcCRC32(ULONG, ULONG, ULONG, STRPTR)
  228.  
  229.     FUNCTION
  230.         This function calculates a 32 bit CRC. It is possible to choose the
  231.         calculation method by parameter id.
  232.  
  233.         The CRC calculation uses a table built with following function:
  234.         void MakeCRC32(ULONG *buf, ULONG ID)
  235.         {
  236.           ULONG i, j, k;
  237.  
  238.           for(i = 0; i < 256; ++i)
  239.           {
  240.             k = i;
  241.  
  242.             for(j = 0; j < 8; ++j)
  243.             {
  244.               if(k & 1)
  245.                 k = (k >> 1) ^ ID;
  246.               else
  247.                 k >>= 1;
  248.             }
  249.             buf[i] = k;
  250.           }
  251.         }
  252.  
  253.         The used calculation routine is like that:
  254.         crc = init;
  255.         while(size--)
  256.           crc = tab[(crc ^ *buffer++) & 0xFF] ^ (crc >> 8);
  257.  
  258.         ID's defined in xadmaster.h use a default table. All others build the
  259.         table on the fly.
  260.         XADCRC32_ID2: (0xEDB88320) - Used by Zoom, Zip, LZX, ...
  261.  
  262.     INPUT
  263.         id      - The table creation ID (maybe XADCR32_ID value)
  264.         init    - The initial value for CRC calculation.
  265.         size    - The input buffer size.
  266.         buffer  - A pointer to the input buffer.
  267.  
  268.     RESULT
  269.         crc32   - The calculated CRC value.
  270.  
  271.     SEE ALSO
  272.         libraries/xadmaster.h, xadCalcCRC16
  273.  
  274. xadmaster.library/xadConvertDates           xadmaster.library/xadConvertDates
  275.  
  276.     NAME
  277.         xadConvertDates - convert between date storage methods
  278.  
  279.     SYNOPSIS
  280.         result = xadConvertDatesA(tags)
  281.         D0                         A0
  282.  
  283.         LONG xadConvertDatesA(struct TagItem *)
  284.  
  285.         result = xadConvertDates(tag1, ...)
  286.  
  287.         LONG xadConvertDates(Tag, ...)
  288.  
  289.     FUNCTION
  290.         This function can be used to transform date and time between
  291.         different storage systems. One of the input tags must be specified.
  292.         Output tags may be specified multiple. The date information is
  293.         based on Gregorian calendar. Some systems can store a wider range
  294.         of dates than others. If a date produces an overflow or an
  295.         underflow for a special date, the highest/lowest valid date is used
  296.         (e.g. for timevalues 0x00000000 or 0xFFFFFFFF).
  297.  
  298.         The XAD_MAKEGMTDATE and XAD_MAKELOCALDATE tags need locale.library
  299.         to get the offset to local time. If locale.library cannot be opened
  300.         the offset is set to 0.
  301.  
  302.         XAD_DATECURRENTTIME can be used to get the current system date and
  303.         time.
  304.  
  305.         WeekDay information is ignored for input and always recalculated.
  306.         The calculation routines use full range of available variable space,
  307.         so f.e. a Unix date 1.1.1970 00:00:00 (value 0x00000000) with a
  308.         UTC offset of -30 min produces 31.12.1968 23:30:00 (which cannot be
  309.         stored as UNIX time value, but only as xadDate structure)!.
  310.  
  311.     INPUT
  312.         ai      - the master communication structure
  313.         tags    - Pointer to an array of struct TagItem. Recognized tags: 
  314.                   XAD_DATEUNIX, XAD_DATEAMIGA, XAD_DATEDATESTAMP,
  315.                   XAD_DATEXADDATE, XAD_DATECLOCKDATA, XAD_DATECURRENTTIME,
  316.                   XAD_DATEMSDOS, XAD_GETDATEUNIX, XAD_GETDATEAMIGA,
  317.                   XAD_GETDATEDATESTAMP, XAD_GETDATEXADDATE,
  318.                   XAD_GETDATECLOCKDATA, XAD_GETDATEMSDOS, XAD_MAKEGMTDATE,
  319.                   XAD_MAKELOCALDATE
  320.  
  321.     RESULT
  322.         result  - any of the XADERR codes or zero when all is ok.
  323.  
  324.     SEE ALSO
  325.         libraries/xadmaster.h, tags section
  326.  
  327. xadmaster.library/xadConvertProtection xadmaster.library/xadConvertProtection
  328.  
  329.     NAME
  330.         xadConvertProtection - convert between different protection bits (V4)
  331.  
  332.     SYNOPSIS
  333.         result = xadConvertProtectionA(tags)
  334.         D0                              A0
  335.  
  336.         LONG xadConvertProtectionA(struct TagItem *)
  337.  
  338.         result = xadConvertProtection(tag1, ...)
  339.  
  340.         LONG xadConvertProtection(Tag, ...)
  341.  
  342.     FUNCTION
  343.         This function can be used to transform protection bits of different
  344.         operating systems.
  345.  
  346.     The protection values are initialised with the Amiga standard values
  347.     "rwed". These bits are modified by specified XAD_PROTxxx tags, but
  348.     only the bits supported by that format (e.g. most systems do not
  349.     support "s" or "p"). You may specify multiple XAD_PROTxxx tags, if
  350.     a program stores them in different formats. As Amiga supports all
  351.     bits, it is necessary to specify XAD_PROTAMIGA as first argument in
  352.     such cases.
  353.  
  354.     The taglist must contain at least one of the XAD_GETPROTxxx tags.
  355.     Currently only XAD_GETPROTAMIGA is supported.
  356.  
  357.     The stored result is not affected by the position of the
  358.     XAD_GETPROTxxx tag in the list of tags! The result are always the
  359.     bits, which are computed of all input tags.
  360.  
  361.     INPUT
  362.         ai      - the master communication structure
  363.         tags    - Pointer to an array of struct TagItem. Recognized tags: 
  364.                   XAD_PROTAMIGA, XAD_PROTUNIX, XAD_PROTMSDOS,
  365.                   XAD_GETPROTAMIGA
  366.     RESULT
  367.         result  - any of the XADERR codes or zero when all is ok.
  368.  
  369.     SEE ALSO
  370.         libraries/xadmaster.h, tags section
  371.  
  372. xadmaster.library/xadCopyMem                     xadmaster.library/xadCopyMem
  373.  
  374.     NAME
  375.         xadCopyMem - copies one data block to another position (V2)
  376.  
  377.     SYNOPSIS
  378.         xadCopyMem(src, dest, size)
  379.                     A0   A1    D0
  380.  
  381.         void xadCopyMem(APTR, APTR, ULONG)
  382.  
  383.     FUNCTION
  384.         xadCopyMem is a general purpose memory copy function. It can deal
  385.         any length and its pointers on any alignment. It tries to optimize
  386.         the copy operation, when alignment and size allow longword copies.
  387.  
  388.         Overlapping copies are supported in both directions.
  389.  
  390.         The internal implementation of this function will change from
  391.         system to system and version to version.
  392.         This copy function is not highly optimized, but should fit any needs
  393.         around xadmaster.library!
  394.  
  395.     INPUT
  396.         src     - the source buffer
  397.         dest    - the destination buffer
  398.         size    - the size to copy
  399.  
  400.     RESULT
  401.         none
  402.  
  403.     SEE ALSO
  404.         libraries/xadmaster.h, exec.library/CopyMem()
  405.  
  406. xadmaster.library/xadDiskUnArc                 xadmaster.library/xadDiskUnArc
  407.  
  408.     NAME
  409.         xadDiskUnArc - the master function for unarchiving disks
  410.  
  411.     SYNOPSIS
  412.         result = xadDiskUnArcA(ai, tags)
  413.         D0                    A0   A1
  414.  
  415.         LONG xadDiskUnArcA(struct xadArchiveInfo *, struct TagItem *)
  416.  
  417.         result = xadDiskUnArc(ai, tag1, ...)
  418.  
  419.         LONG xadDiskUnArc(struct xadArchiveInfo *, Tag, ...)
  420.  
  421.     FUNCTION
  422.         This function dearchives a disk archive. It can be called after
  423.         a successful call to xadGetInfo(). At least the tag XAD_ENTRYNUMBER
  424.         and one of the output tags needs to be supplied. When a progress
  425.         hook is supplied, this can be used for questioning for overwriting
  426.         and ignoring of drive geometry and for status displays.
  427.         Normally disk archivers will have only one entry, but there may
  428.         be multiple disk archives.
  429.  
  430.         When this function returns, the supplied output data streams may
  431.         be used in any way (files, memory). The library does not even know
  432.         that they exist! The xadmaster.library cannot be used to rename,
  433.         protect, comment or delete that stuff!
  434.  
  435.     INPUT
  436.         ai      - the master communication structure
  437.         tags    - Pointer to an array of struct TagItem. Recognized tags: 
  438.                   XAD_ENTRYNUMBER, XAD_OUTFILEHANDLE, XAD_OUTFILENAME,
  439.                   XAD_OUTHOOK, XAD_OUTMEMORY, XAD_OUTSIZE, XAD_OVERWRITE,
  440.                   XAD_PROGRESSHOOK, XAD_IGNOREGEOMETRY, XAD_HIGHCYLINDER,
  441.                   XAD_LOWCYLINDER, XAD_OUTDEVICE, XAD_VERIFY, XAD_PASSWORD,
  442.                   XAD_NOKILLPARTIAL, XAD_FORMAT, XAD_MAKEDIRECTORY
  443.  
  444.     RESULT
  445.         result  - any of the XADERR codes or zero when all is ok.
  446.  
  447.     SEE ALSO
  448.         libraries/xadmaster.h, xadFileUnArc(), xadGetInfo(), tags section
  449.  
  450. xadmaster.library/xadDiskFileUnArc         xadmaster.library/xadDiskFileUnArc
  451.  
  452.     NAME
  453.         xadDiskFileUnArc - for unarchiving files from disk image (V4)
  454.  
  455.     SYNOPSIS
  456.         result = xadDiskFileUnArcA(ai, tags)
  457.         D0                         A0   A1
  458.  
  459.         LONG xadDiskFileUnArcA(struct xadArchiveInfo *, struct TagItem *)
  460.  
  461.         result = xadDiskFileUnArc(ai, tag1, ...)
  462.  
  463.         LONG xadDiskFileUnArc(struct xadArchiveInfo *, Tag, ...)
  464.  
  465.     FUNCTION
  466.         This function extracts a file from disk images. It can be called
  467.         after a succesful call to xadGetDiskInfo(). At least the tag
  468.         XAD_ENTRYNUMBER and one of the output tags needs to be supplied.
  469.         When a progress hook is supplied, this can be used for questioning
  470.         for overwriting and for status displays.
  471.         This function needs to be called for every file, which should be
  472.         unarchived.
  473.  
  474.         When this function returns, the supplied output data streams may
  475.         be used in any way (files, memory). The library does not even know
  476.         that they exist! The xadmaster.library cannot be used to rename,
  477.         protect, comment or delete that stuff!
  478.  
  479.     INPUT
  480.         ai      - the master communication structure
  481.         tags    - Pointer to an array of struct TagItem. Recognized tags: 
  482.                   XAD_ENTRYNUMBER, XAD_OUTFILEHANDLE, XAD_OUTFILENAME,
  483.                   XAD_OUTHOOK, XAD_OUTMEMORY, XAD_OUTSIZE, XAD_OVERWRITE,
  484.                   XAD_PROGRESSHOOK, XAD_NOKILLPARTIAL, XAD_MAKEDIRECTORY
  485.  
  486.     RESULT
  487.         result  - any of the XADERR codes or zero when all is ok.
  488.  
  489.     SEE ALSO
  490.         libraries/xadmaster.h, xadGetDiskInfo(), tags section
  491.  
  492. xadmaster.library/xadFileUnArc                 xadmaster.library/xadFileUnArc
  493.  
  494.     NAME
  495.         xadFileUnArc - the master function for unarchiving disks
  496.  
  497.     SYNOPSIS
  498.         result = xadFileUnArcA(ai, tags)
  499.         D0                    A0   A1
  500.  
  501.         LONG xadFileUnArcA(struct xadArchiveInfo *, struct TagItem *)
  502.  
  503.         result = xadFileUnArc(ai, tag1, ...)
  504.  
  505.         LONG xadFileUnArc(struct xadArchiveInfo *, Tag, ...)
  506.  
  507.     FUNCTION
  508.         This function dearchives a file archive entry. It can be called
  509.         after a succesful call to xadGetInfo(). At least the tag
  510.         XAD_ENTRYNUMBER and one of the output tags needs to be supplied.
  511.         When a progress hook is supplied, this can be used for questioning
  512.         for overwriting and for status displays.
  513.         This function needs to be called for every file, which should be
  514.         unarchived. Best is to do unarchiving in direction giving by
  515.         info structure, because some archivers crunch multiple files in one
  516.         pass and the unarchiver needs to compress and buffer the whole
  517.         pass to get one file.
  518.  
  519.         When this function returns, the supplied output data streams may
  520.         be used in any way (files, memory). The library does not even know
  521.         that they exist! The xadmaster.library cannot be used to rename,
  522.         protect, comment or delete that stuff!
  523.  
  524.     INPUT
  525.         ai      - the master communication structure
  526.         tags    - Pointer to an array of struct TagItem. Recognized tags: 
  527.                   XAD_ENTRYNUMBER, XAD_OUTFILEHANDLE, XAD_OUTFILENAME,
  528.                   XAD_OUTHOOK, XAD_OUTMEMORY, XAD_OUTSIZE, XAD_OVERWRITE,
  529.                   XAD_PROGRESSHOOK, XAD_PASSWORD, XAD_NOKILLPARTIAL,
  530.                   XAD_MAKEDIRECTORY
  531.  
  532.     RESULT
  533.         result  - any of the XADERR codes or zero when all is ok.
  534.  
  535.     SEE ALSO
  536.         libraries/xadmaster.h, xadDiskUnArc(), xadGetInfo(), tags section
  537.  
  538. xadmaster.library/xadFreeInfo                   xadmaster.library/xadFreeInfo
  539.  
  540.     NAME
  541.         xadFreeInfo - free stuff built and allocated with xadGetInfo()
  542.  
  543.     SYNOPSIS
  544.         xadFreeInfo(ai)
  545.                     A0
  546.  
  547.         void xadFreeInfo(struct xadArchiveInfo *)
  548.  
  549.     FUNCTION
  550.         Frees all the stuff built and allocated by a call to xadGetInfo() or
  551.         xadGetDiskInfo(). You always need to call this after your work with
  552.         a certain input file is finished.
  553.  
  554.     INPUTS
  555.         ai      - the master communication structure
  556.  
  557.     SEE ALSO
  558.         libraries/xadmaster.h, xadGetInfo(), xadGetDiskInfo()
  559.  
  560. xadmaster.library/xadFreeObject               xadmaster.library/xadFreeObject
  561.  
  562.     NAME
  563.         xadFreeObject - Frees structures allocated with xadAllocObject() or
  564.                         xadAllocVec()
  565.  
  566.     SYNOPSIS
  567.         xadFreeObjectA(object, tags)
  568.                          A0      A1
  569.  
  570.         void xadFreeObjectA(APTR, struct TagItem *)
  571.  
  572.         xadFreeObject(object, tag1, ...)
  573.  
  574.         void xadFreeObject(APTR, Tag, ...)
  575.  
  576.     FUNCTION
  577.         Frees object allocated by xadAllocObject() or xadAllocVec(). Do not call
  578.         for objects allocated in any other way.
  579.         This function frees ALL memory which was allocated by xadAllocObject(),
  580.         but only this memory. This means all name buffers and other related
  581.         structures are freed, but if you replace pointers, your replacements
  582.         get not freed. This function does not need the original pointers to be
  583.         in the related positions, as the buffer size is stored elsewhere.
  584.  
  585.     INPUTS
  586.         object  - object allocated with xadAllocObject() or xadAllocVec()
  587.         tags    - Pointer to an array of struct TagItem. Recognized tags: 
  588.                   currently none
  589.  
  590.     SEE ALSO
  591.         libraries/xadmaster.h, xadAllocObject(), xadAllocVec(), tags section
  592.  
  593. xadmaster.library/xadGetClientInfo         xadmaster.library/xadGetClientInfo
  594.  
  595.     NAME
  596.         xadGetClientInfo - Get list of active clients
  597.  
  598.     SYNOPSIS
  599.         ptr = xadGetClientInfo()
  600.         D0
  601.  
  602.         struct xadClient *xadGetClientInfo(void)
  603.  
  604.     FUNCTION
  605.         This function returns a list of all active clients. It can be used
  606.         to show information about the library. The list is read only and
  607.         cannot be modified!
  608.  
  609.     RESULT
  610.         ptr     - Pointer to first client in the list.
  611.  
  612.     SEE ALSO
  613.         libraries/xadmaster.h
  614.  
  615. xadmaster.library/xadGetDiskInfo             xadmaster.library/xadGetDiskInfo
  616.  
  617.     NAME
  618.         xadGetDiskInfo - get information about files from disk image (V4)
  619.  
  620.     SYNOPSIS
  621.         result = xadGetDiskInfoA(ai, tags)
  622.         D0                       A0   A1
  623.  
  624.         LONG xadGetDiskInfoA(struct xadArchiveInfo *, struct TagItem *)
  625.  
  626.         result = xadGetDiskInfo(ai, tag1, ...)
  627.  
  628.         LONG xadGetDiskInfo(struct xadArchiveInfo *, Tag, ...)
  629.  
  630.     FUNCTION
  631.         This function returns all useful information about a specified
  632.         disk image filesytem structure. The information about files,
  633.         directories and links are stored in xai_FileInfo list. You may
  634.         call xadDiskFileUnArc() to extract files from the disk image.
  635.  
  636.         The data must be freed by a call to xadFreeInfo(). After that the
  637.         xadArchiveInfo structure must be freed and NEVER be used again!
  638.  
  639.         The supplied input stream is used and must be valid and unmodified
  640.         until xadFreeInfo() is called. Only the master functions are allowed
  641.         to access the stream, but it is guaranteed to be unmodified!
  642.  
  643.     INPUT
  644.         ai      - the master communication structure
  645.         tags    - Pointer to an array of struct TagItem. Recognized tags: 
  646.                   XAD_INSIZE, XAD_INFILENAME, XAD_INFILEHANDLE,
  647.                   XAD_INMEMORY, XAD_INHOOK, XAD_INSPLITTED,
  648.                   XAD_INDISKARCHIVE, XAD_STARTCLIENT
  649.  
  650.     RESULT
  651.         result  - any of the XADERR codes or zero when all is ok.
  652.  
  653.     SEE ALSO
  654.         libraries/xadmaster.h, xadFreeInfo(), xadDiskFileUnArc(),
  655.         xadGetInfo(), tags section
  656.  
  657. xadmaster.library/xadGetErrorText           xadmaster.library/xadGetErrorText
  658.  
  659.     NAME
  660.         xadGetErrorText - Get error string from an error number
  661.  
  662.     SYNOPSIS
  663.         ptr = xadGetErrorText(errnum)
  664.         D0                    D0
  665.  
  666.         STRPTR xadGetErrorText(ULONG)
  667.  
  668.     FUNCTION
  669.         This function returns the error string related to the supplied
  670.         error number. This string is valid as long as xadmaster.library
  671.         is opened, so when needed any longer time it must be copied.
  672.  
  673.     INPUT
  674.         errnum  - in libraries/xadmaster.h defined XADERR_... numbers.
  675.  
  676.     RESULT
  677.         ptr     - Pointer to required string.
  678.  
  679.     SEE ALSO
  680.         libraries/xadmaster.h
  681.  
  682. xadmaster.library/xadGetInfo                     xadmaster.library/xadGetInfo
  683.  
  684.     NAME
  685.         xadGetInfo - get information about an archive
  686.  
  687.     SYNOPSIS
  688.         result = xadGetInfoA(ai, tags)
  689.         D0                   A0   A1
  690.  
  691.         LONG xadGetInfoA(struct xadArchiveInfo *, struct TagItem *)
  692.  
  693.         result = xadGetInfo(ai, tag1, ...)
  694.  
  695.         LONG xadGetInfo(struct xadArchiveInfo *, Tag, ...)
  696.  
  697.     FUNCTION
  698.         This function returns all useful information about a specified
  699.         archive. It opens the archive for working. You may call
  700.         xadFileUnArc() or xadDiskUnArc() for the included entries
  701.         after a successful call to xadGetInfo(). The data must be freed
  702.         by a call to xadFreeInfo(). After that the xadArchiveInfo structure
  703.         must be freed and NEVER be used again! For archives encrypting
  704.         the information parts as well, you need to specify XAD_PASSWORD.
  705.         This password can be used for all calls to a unarchiving function,
  706.         but is overwritten by XAD_PASSWORD tag argument (only for the
  707.         entry with XAD_PASSWORD specified). Check and parse the elements
  708.         xai_FileInfo and xai_DiskInfo. You may expect both lists to have
  709.         valid entries or also both to be empty. Parsing the lists is the
  710.         normal way to do anything.
  711.  
  712.         The supplied input stream is used and must be valid and unmodified
  713.         until xadFreeInfo() is called. Only the current client is allowed to
  714.         access the stream, but it is guaranteed to be unmodified!
  715.  
  716.     INPUT
  717.         ai      - the master communication structure
  718.         tags    - Pointer to an array of struct TagItem. Recognized tags: 
  719.                   XAD_INSIZE, XAD_INFILENAME, XAD_INFILEHANDLE,
  720.                   XAD_INMEMORY, XAD_INHOOK, XAD_INSPLITTED, XAD_PASSWORD
  721.  
  722.     RESULT
  723.         result  - any of the XADERR codes or zero when all is ok.
  724.  
  725.     SEE ALSO
  726.         libraries/xadmaster.h, xadFreeInfo(), xadDiskUnArc(),
  727.         xadFileUnArc(), tags section
  728.  
  729. xadmaster.library/xadHookAccess               xadmaster.library/xadHookAccess
  730.  
  731.     NAME
  732.         xadHookAccess - a client only function to get/store data
  733.  
  734.     SYNOPSIS
  735.         result = xadHookAccess(command, data, buffer, ai)
  736.         D0                       D0      D1     A0    A1
  737.  
  738.         LONG xadHookAccess(ULONG, LONG, APTR, struct xadArchiveInfo *)
  739.  
  740.     FUNCTION
  741.         This function is for external clients only. It is needed to get
  742.         data, store results and seek in input or output. There are 5
  743.         commands XADAC_READ, XADAC_WRITE, XADAC_COPY, XADAC_INPUTSEEK,
  744.         XADAC_OUTPUTSEEK to do that. This function updates the xai_InPos,
  745.         xai_OutPos and xai_OutSize fields in xadArchiveInfo structure. The
  746.         seek commands and the copy command should set buffer parameter to
  747.         zero. Seek's and reads should not exceed the file borders! The
  748.         client knows position and size, so checks are possible before doing
  749.         wrong commands.
  750.  
  751.         See also xadHookTagAccess() function, which allows to pass tags for
  752.         deeper control, which is necessary sometimes.
  753.  
  754.     INPUT
  755.         command - one of the XADAC commands to control hook
  756.         data    - the required data, mostly a size value
  757.         buffer  - the input/output buffer for read and write
  758.         ai      - the master communication structure
  759.  
  760.     RESULT
  761.         result  - any of the XADERR codes or zero when all is ok.
  762.  
  763.     SEE ALSO
  764.         libraries/xadmaster.h, xadHookTagAccess()
  765.  
  766. xadmaster.library/xadHookTagAccess         xadmaster.library/xadHookTagAccess
  767.  
  768.     NAME
  769.         xadHookTagAccess - a client only function to get/store data (V3)
  770.  
  771.     SYNOPSIS
  772.         result = xadHookTagAccessA(command, data, buffer, ai, tags)
  773.         D0                           D0      D1     A0    A1   A2
  774.  
  775.         LONG xadHookTagAccessA(ULONG, LONG, APTR, struct xadArchiveInfo *,
  776.              struct TagItem *)
  777.  
  778.         result = xadHookTagAccess(command, data, buffer, ai, tag1, ...)
  779.  
  780.         LONG xadHookTagAccess(ULONG, LONG, APTR, struct xadArchiveInfo *,
  781.              Tag, ...)
  782.  
  783.     FUNCTION
  784.         This function equals xadHookAccess() but allows to use tags to get
  785.         better control. This includes CRC creation and use of xadSkipInfo
  786.         system.
  787.  
  788.     INPUT
  789.         command - one of the XADAC commands to control hook
  790.         data    - the required data, mostly a size value
  791.         buffer  - the input/output buffer for read and write
  792.         ai      - the master communication structure
  793.         tags    - Pointer to an array of struct TagItem. Recognized tags: 
  794.                   XAD_CRC16ID, XAD_CRC32ID, XAD_GETCRC16, XAD_GETCRC32,
  795.                   XAD_USESKIPINFO
  796.  
  797.     RESULT
  798.         result  - any of the XADERR codes or zero when all is ok.
  799.  
  800.     SEE ALSO
  801.         libraries/xadmaster.h, xadHookAccess(), tags section
  802.  
  803. xadmaster.library/xadRecogFile                 xadmaster.library/xadRecogFile
  804.  
  805.     NAME
  806.         xadRecogFile - check if a file is an archive file or not
  807.  
  808.     SYNOPSIS
  809.         client = xadRecogFileA(size, memory, tags)
  810.         D0                     D0     A0     A1
  811.  
  812.         struct xadClient *xadRecogFileA(ULONG, APTR, struct TagItem *)
  813.  
  814.         client = xadRecogFile(size, memory, tag1, ...)
  815.  
  816.         struct xadClient *xadRecogFile(ULONG, APTR, Tag, ...)
  817.  
  818.     FUNCTION
  819.         This function can be used to check if a file is a archive or not.
  820.         It has only limited abilities! You need to pass a pointer to
  821.         memory of recogsize. The recogsize value can be found in
  822.         xadMasterBase. If the file is shorter, use the complete file as
  823.         buffer. Longer buffers are allowed as well. When the file is
  824.         archived, you get back a pointer to the client which detected the
  825.         file. If not, the return is zero. The only usable information
  826.         should be the name of the client. To get more information and all
  827.         archive related data you have to use xadGetInfo(), which calls
  828.         xadRecogFile internal itself.
  829.  
  830.         Normally this function is not needed by application programs. It
  831.         is used in xadList utility. This function is useful for tools
  832.         only detecting and displaying the archiver type.
  833.  
  834.     INPUT
  835.         size    - size of the memory region
  836.         memory  - pointer to the memory holding the file
  837.         tags    - Pointer to an array of struct TagItem. Recognized tags: 
  838.                   XAD_NOEXTERN
  839.  
  840.     RESULT
  841.         client  - pointer to client structure or zero when no archive
  842.  
  843.     SEE ALSO
  844.         libraries/xadmaster.h, xadGetInfo(), tags section
  845.  
  846. xadmaster.library/--tags--                         xadmaster.library/--tags--
  847.  
  848.     TAGS FOR xadAllocObject()
  849.  
  850.       XAD_OBJBLOCKENTRIES       (ULONG)
  851.         Can be specified together with XADOBJ_DISKINFO. This allocates
  852.         memory for xdi_BlockInfo. Data field of tag item contains number
  853.         of required blocks. Memory gets freed automatically, when object
  854.         is freed.
  855.  
  856.       XAD_OBJCOMMENTSIZE        (ULONG)
  857.         Like XAD_OBJNAMESIZE, but allocates memory for xfi_Comment entry.
  858.  
  859.       XAD_OBJNAMESIZE           (ULONG)
  860.         Can be specified together with XADOBJ_FILEINFO. This allocates
  861.         memory for storing file name. The required size has to be stored
  862.         in data field of tag item. The allocated memory pointer is stored
  863.         in xfi_FileName field of returned structure. Memory gets freed
  864.         automatically, when object is freed.
  865.  
  866.       XAD_OBJPRIVINFOSIZE       (ULONG)
  867.         Can be specified together with XADOBJ_FILEINFO and XADOBJ_DISKINFO.
  868.         This allocates longword aligned client private buffer, which is
  869.         stored in xfi_PrivateInfo or xdi_PrivateInfo field. The required
  870.         size has to be stored in data field of tag item. Memory gets freed
  871.         automatically, when object is freed.
  872.  
  873.     TAGS FOR xadGetInfo() and xadGetDiskInfo()
  874.  
  875.       XAD_INFILEHANDLE          (BPTR)
  876.         FileHandle to get data from. It is not necessary that the handle
  877.         is at the beginning of the file.
  878.  
  879.       XAD_INFILENAME            (STRPTR)
  880.         Name of the input file.
  881.  
  882.       XAD_INHOOK                (struct Hook *)
  883.         This enables any other way of data delivering. See special
  884.         chapter on I/O hook functions.
  885.  
  886.       XAD_INMEMORY              (STRPTR)
  887.         Pointer to a memory buffer holding the input data. You need to
  888.         specify XAD_INSIZE when using this.
  889.  
  890.       XAD_INSIZE                (ULONG)
  891.         Specify the size of input data. Must be used together with
  892.         XAD_INMEMORY. Can be used together with other hooks.
  893.  
  894.       XAD_INSPLITTED            (struct xadSplitFile *) (V2)
  895.         For multivolume archives it is necessary to supply multiple files.
  896.         This tag allows to pass multiple input streams of any type in a
  897.         linked list of xadSplitFile structures. The clients see that as
  898.         one single continous stream (except that ai->xai_MultiVolume
  899.         contains a field with size information for every part).
  900.         Each entry must contain one of the other input types and the
  901.         corresponding data. Also the size can be or must be (XAD_INMEMORY)
  902.         passed in xadSplitFile structure.
  903.         Clients could expect the parts in it correct order, but should be
  904.         able to handle missing or corrupted part.
  905.  
  906.     TAGS FOR xadGetDiskInfo()
  907.  
  908.       XAD_INDISKARCHIVE        (struct TagItem *) (V4)
  909.     This hook allows to supply a disk archive as input source for
  910.     file extraction from disk image files. You need to pass a
  911.     pointer to a tagitem list (finished with TAG_DONE!) as data.
  912.     This list is passed to xadGetInfo(). It may contain any of the
  913.     tags supported by that function and must contain any of the
  914.     input hook tags! Additionally it may contain XAD_ENTRYNUMBER
  915.     to specify the entry, which should be used! If not, the first
  916.     entry is used!
  917.  
  918.       XAD_STARTCLIENT        (struct xadClient *) (V7)
  919.     As there may be multiple filesystems on one disk image file (e.g.
  920.     standard AmigaOS filesystem hiding an other one), it is useful to
  921.     rescan the file. If you call xadGetDiskInfo() with this tagitem
  922.     set to the client which comes after the one found in previous run
  923.     (ai->xai_Client->xc_Next), you may detect such double systems also.
  924.  
  925.     TAGS FOR xadFileUnArc() and xadDiskUnArc()
  926.  
  927.       XAD_ENTRYNUMBER           (ULONG)
  928.         This flag specifies the wanted entry. You must not specify more
  929.         or less than one of that flag every call. Normally this flag equals
  930.         the element xdi_EntryNumber for currently parsed xadDiskInfo
  931.         structure and xfi_EntryNumber for currently parsed xadFileInfo
  932.         structure.
  933.  
  934.       XAD_MAKEDIRECTORY         (BOOL)
  935.         Create missing directory tree when necessary. If not set the
  936.         progress hook may get asked if directory should be created or
  937.         not (if there is one).
  938.  
  939.       XAD_NOKILLPARTIAL        (BOOL) (V3.3)
  940.     If this is set to true, partial or corrupted files get not deleted.
  941.     This has effect only for file output hook and only if the filename
  942.     was passed (and not the FileHandle pointer).
  943.  
  944.       XAD_OUTFILEHANDLE         (BPTR)
  945.         FileHandle to send data to. It is not necessary that the handle
  946.         is at the beginning of the file.
  947.  
  948.       XAD_OUTFILENAME           (STRPTR)
  949.         Name of the output file.
  950.  
  951.       XAD_OUTHOOK               (struct Hook *)
  952.         This enables any other way of data storing. See special chapter
  953.         on I/O hook functions.
  954.  
  955.       XAD_OUTMEMORY             (STRPTR)
  956.         Pointer to a memory buffer to store data in. You need to specify
  957.         XAD_OUTSIZE when using this.
  958.  
  959.       XAD_OUTSIZE               (ULONG)
  960.         Specify the maximum size of output data. Must be used together with
  961.         XAD_OUTMEMORY.
  962.  
  963.       XAD_OVERWRITE             (BOOL)
  964.         This forces the file hook to overwrite existing destination files.
  965.         If not set the progress hook may get asked if files should be
  966.         overwritten or not (if there is one).
  967.  
  968.       XAD_PROGRESSHOOK          (struct Hook *)
  969.         The progress hook for status displays. See special progress hook
  970.         chapter for more information.
  971.  
  972.     TAGS FOR xadDiskUnArc()
  973.  
  974.       XAD_IGNOREGEOMETRY        (BOOL)
  975.         This forces the device hook to use devices with different drive
  976.         geometry than the one on disk archive. Most time this will produce
  977.         useless disks. If not set the progress hook may get asked if
  978.         geometry should be ignored or not (if there is one).
  979.  
  980.       XAD_HIGHCYLINDER          (ULONG)
  981.         It specifies the highest cylinder which should be unarchived.
  982.  
  983.       XAD_LOWCYLINDER           (ULONG)
  984.         It specifies the lowest cylinder which should be unarchived.
  985.  
  986.       XAD_OUTDEVICE             (struct xadDeviceInfo *)
  987.         For disk archives it is useful to store data directly on a disk.
  988.         Use this tag to specify the device where data should be stored.
  989.         In xdi_DOSName the DOS device must be stored, which must not be
  990.         terminated with a ':' character.
  991.         Alternatively in fields xdi_DeviceName and xdi_Unit the wanted
  992.         device must be specified. The device must support TD_GETGEOMETRY
  993.         command, even if XAD_IGNOREGEOMETRY is turned on, as the hook
  994.         needs at least the blocksize for internal buffering.
  995.         NOTE: When xdi_DeviceName and xdi_Unit is used, the hook cannot
  996.         perform an Inhibit operation and thus it cannot prevent other
  997.         tasks from accessing the device. Also a DOS device is not updated,
  998.         so a DiskChange becomes necessary.
  999.         I suggest always using xdi_DOSName field!
  1000.       
  1001.       XAD_VERIFY                (BOOL)
  1002.         Turns on verify for device output. This is turned off by default.
  1003.  
  1004.       XAD_FORMAT                (BOOL) (V5)
  1005.         Turns on formating of output device. This is turned off by default.
  1006.  
  1007.     TAGS FOR xadConvertDates()
  1008.  
  1009.       XAD_DATEUNIX              (ULONG)
  1010.         Input is an UNIX date value (seconds starting with 01.01.1970).
  1011.  
  1012.       XAD_DATEAMIGA             (ULONG)
  1013.         Input as an Amiga date value (seconds starting with 01.01.1978).
  1014.  
  1015.       XAD_DATEDATESTAMP         (struct DateStamp *)
  1016.         Input is a pointer to an Amiga DateStamp structure.
  1017.  
  1018.       XAD_DATEXADDATE           (struct xadDate *)
  1019.         Input is a pointer to a xadmaster date structure.
  1020.  
  1021.       XAD_DATECLOCKDATA         (struct ClockData *)
  1022.         Input is a pointer to a ClockData structure.
  1023.  
  1024.       XAD_DATECURRENTTIME       (void)
  1025.         Current system time value should be used as input.
  1026.  
  1027.       XAD_DATEMSDOS             (ULONG) (V2)
  1028.         Input is an 32 bit packed date format used by MS-DOS. This means:
  1029.         Bit 0..4 is half second (25 = second 49 or 50), 5..10 is minute,
  1030.         11..15 is hour, 16..20 is day, 21..24 is month (1 = january) and
  1031.         25..31 is year (0 = year 1980). This format is used for archivers
  1032.         like RAR or Zip.
  1033.  
  1034.       XAD_GETDATEUNIX           (ULONG *)
  1035.         An UNIX time value should be stored in the ULONG variable, the
  1036.         supplied pointer points to.
  1037.  
  1038.       XAD_GETDATEAMIGA          (ULONG *)
  1039.         An Amiga time value should be stored in the ULONG variable, the
  1040.         supplied pointer points to.
  1041.  
  1042.       XAD_GETDATEDATESTAMP      (struct DateStamp *)
  1043.         The date should be stored in DateStamp structure the supplied
  1044.         pointer points to.
  1045.  
  1046.       XAD_GETDATEXADDATE        (struct xadDate *)
  1047.         The date should be stored in xadmaster date structure the supplied
  1048.         pointer points to.
  1049.  
  1050.       XAD_GETDATECLOCKDATA      (struct ClockData *)
  1051.         The date should be stored in ClockData structure the supplied
  1052.         pointer points to.
  1053.  
  1054.       XAD_GETDATEMSDOS          (ULONG *) (V2)
  1055.         An MS-DOS packed date value should be stored in the ULONG variable,
  1056.         the supplied pointer points to.
  1057.  
  1058.       XAD_MAKEGMTDATE           (BOOL)
  1059.         This forces the function to subtract the GMT offset supplied by
  1060.         locale.library to convert a local date to GMT date. Opening
  1061.         locale.library is required for that. When it cannot be openend or
  1062.         the offset would cause a overrun or underrun in the xd_Year field,
  1063.         no offset will be used. 
  1064.       
  1065.       XAD_MAKELOCALDATE         (BOOL)
  1066.         This forces the function to add the GMT offset supplied by
  1067.         locale.library to convert a GMT date to a local date. Opening
  1068.         locale.library is required for that. When it cannot be openend or
  1069.         the offset would cause a overrun or underrun in the xd_Year field,
  1070.         no offset will be used.
  1071.  
  1072.     TAGS FOR xadHookTagAccess() (V3)
  1073.  
  1074.       XAD_CRC16ID               (UWORD)
  1075.         This tag specifies the CRC-ID, which should be used for CRC16
  1076.         calculation. The default value is XADCRC16_ID1.
  1077.  
  1078.       XAD_CRC32ID               (ULONG)
  1079.         This tag specifies the CRC-ID, which should be used for CRC32
  1080.         calculation. The default value is XADCRC32_ID1.
  1081.  
  1082.       XAD_GETCRC16              (UWORD *)
  1083.         A pointer to a UWORD variable holding the CRC start value and after
  1084.         calling xadHookTagAccess() the final CRC value. CRC checks are done
  1085.         for XADAC_COPY, XADAC_READ and XADAC_WRITE.
  1086.  
  1087.       XAD_GETCRC32              (ULONG *)
  1088.         Like XAD_GETCRC16, but for 32 bit checksums.
  1089.  
  1090.       XAD_USESKIPINFO           (BOOL)
  1091.         The field xadSkipInfo of xadArchiveInfo structure is used to skip
  1092.         parts of the input stream for read, copy and input seek operations.
  1093.         Whenever this tag is used, then the contents of the xai_SkipInfo
  1094.         field is interpreted.
  1095.         The data parts specified in the list are skipped for read and seek
  1096.         operations, so that you get always continous data blocks. It does
  1097.         not ignore them totally, so file sizes and file position are not
  1098.         changed. So if you read 500 bytes and there is a 8 byte skip block
  1099.         in between, then file position increases by 508 byte, but you get
  1100.         500 byte data without the skipped data.
  1101.  
  1102.         xadSkipInfo information only affects operations in input stream!
  1103.  
  1104.         The entries of xadSkipInfo list must not overlap and there must be
  1105.         at least one byte between entries!
  1106.  
  1107.     TAGS FOR xadConvertProtection() (V4)
  1108.  
  1109.       XAD_GETPROTAMIGA        (ULONG *)
  1110.     This tag is used to get the computed protection bits in Amiga format
  1111.     including the multiuser bits. These can be store in xadFileInfo
  1112.     structure.
  1113.  
  1114.       XAD_PROTAMIGA        (ULONG)
  1115.     Input bits of Amiga style. This tag is useful together with other
  1116.     tags only. Archives containing Amiga protection without multiuser
  1117.     bits and Unix bits may be converted this way: "XAD_PROTAMIGA,
  1118.     amigabits, XAD_PROTUNIX, unixbits, XAD_GETPROTAMIGA, &amigabits".
  1119.     Now the multiuser bits are inluded.
  1120.     Specifying this tag always resets calculation! It may be used to
  1121.     reset the default bits as well. Specifying and XAD_PROTxxx tags
  1122.     in front of this one is really useless.
  1123.  
  1124.       XAD_PROTMSDOS        (ULONG)
  1125.     Input bits of MSDOS style: 0 = read only, 1 = hidden, 2 = system,
  1126.     3 = volumename, 4 = directory, 5 = archived
  1127.     Only "r,w,a,d" bits of Amiga style are affected.
  1128.  
  1129.       XAD_PROTUNIX        (ULONG)
  1130.     Input bits of UNIX style: 0 = other execute, 1 = other write,
  1131.     2 = other read, 3 = group execute, 4 = group write, 5 = group read,
  1132.     6 = execute, 7 = write, 8 = read
  1133.     This affects the "r,w,e" and the multiuser bits of Amiga style.
  1134.  
  1135.     TAGS FOR different functions
  1136.  
  1137.       XAD_NOEXTERN              (BOOL)
  1138.         When this is specified for xadGetInfo() or xadRecogFile(), the
  1139.         library skips any external clients. Normally this should not be
  1140.         necessary.
  1141.         Some of the main clients are external as well (for legal reasons).
  1142.  
  1143.       XAD_PASSWORD              (STRPTR)
  1144.         You may supply a password for xadGetInfo(), xadFileUnArc() and
  1145.         xadDiskUnArc() functions.
  1146.  
  1147. xadmaster.library/-- data hooks--            xadmaster.library/--data hooks--
  1148.  
  1149.     GENERAL
  1150.         You have four methods of passing data to xadmaster.library: file-
  1151.         names, filehandles, memory areas and hooks. The hooks are described
  1152.         here. The hook field h_Entry has to be standard hook functions and
  1153.         gets called with the hook itself in A0 and a pointer to a
  1154.         xadHookParam in A1. Commands are stored in xhp_Command field, data
  1155.         in the other fields. Return values are 0 or any of the XADERR codes.
  1156.         Unsupported commands are returned with XADERR_NOTSUPPORTED.
  1157.  
  1158.         You may store a pointer to private data in the field xhp_PrivatePtr.
  1159.         You always get a XADHC_FREE after work to enable you freeing your
  1160.         resources.
  1161.  
  1162.         Whenever an error occured, the hook gets called with XADHC_ABORT.
  1163.         Use this to delete partial file, free useless memory or whatever
  1164.         you used. You must not do cleanup stuff on XADHC_ABORT call, as 
  1165.         XADHC_FREE call follows after it.
  1166.         
  1167.         NOTE: Because hooks are not called in program environment, they
  1168.         cannot be used in small data model of some compilers, as register
  1169.         A4 is not passed through. So the hook either has to be compiled in
  1170.         large data model or should use __saveds keyword of some compilers.
  1171.  
  1172.     COMMANDS
  1173.       XADHC_READ                (input hooks only)
  1174.         This command is called all time xadmaster.library needs some data.
  1175.         Fill the supplied memory area with input data of needed size.
  1176.         Input:  xhp_BufferSize  size of required data
  1177.                 xhp_BufferPtr   buffer to fill
  1178.         Output: xhp_DataPos     buffer position after read
  1179.  
  1180.       XADHC_WRITE               (output hooks only)
  1181.         This function is called, if some data should be stored. Copy
  1182.         the contents of buffer to your data storing system.
  1183.         Input:  xhp_BufferSize  size of data
  1184.                 xhp_BufferPtr   pointer to memory area
  1185.         Output: xhp_DataPos     buffer position after write
  1186.  
  1187.       XADHC_SEEK                (both)
  1188.         Change the current position in your data (like dos.library Seek
  1189.         command). The offset you have to seek is always relative to
  1190.         current position. It can be negative too. Seek's with size 0 can
  1191.         be used to get current file position.
  1192.         Input:  xhp_CommandData offset you have to seek
  1193.         Output: xhp_DataPos     buffer position after seek
  1194.  
  1195.       XADHC_INIT                (both)
  1196.         The work starts. Allocate needed structures and initialize your
  1197.         stuff. Clear xhp_BufferPos.
  1198.         Input:  none
  1199.         Output: none
  1200.  
  1201.       XADHC_FREE                (both)
  1202.         You get this when work is finished, free all your stuff now. You
  1203.         need to clear all pointers you use for checking, as it may happen
  1204.         that you get multiple XADHC_FREE commands.
  1205.         Input:  none
  1206.         Output: none
  1207.  
  1208.       XADHC_ABORT               (output hooks only)
  1209.         You get this when work was aborted, because an error occured.
  1210.         Free all work stuff. Buffers must be freed by later XADHC_FREE call.
  1211.         Be prepared to get multiple XADHC_ABORT commands.
  1212.         Input:  none
  1213.         Output: none
  1214.  
  1215.       XADHC_FULLSIZE            (input hooks only)
  1216.         The hook should return complete size of input data which should be
  1217.         processed.
  1218.         Input:  none
  1219.         Output: xhp_CommandData size of input file
  1220.  
  1221.       XADHC_IMAGEINFO        (input hooks only) (V4)
  1222.     The hook should return information about disk image file. Normally
  1223.     hooks return XADERR_NOTSUPPORTED for this, like for all unsupported
  1224.     commands. Only the internal disk archive hook is able to return
  1225.     useful data.
  1226.     Input:    xhp_CommandData contains pointer to xadImageInfo structure,
  1227.         which should be filled
  1228.     Output: xadImageInfo structure in xhp_CommandData is filled with data
  1229.  
  1230. xadmaster.library/-- progress hooks--    xadmaster.library/--progress hooks--
  1231.  
  1232.     GENERAL
  1233.         This hook can be used to do display completion reports or ask the
  1234.         user. It gets a pointer to a xadProgressInfo structure. The hook
  1235.         returns a combination of XADPIF flags. A return value without
  1236.         XADPIF_OK (mostly 0) means a break command. Normally a hook should
  1237.         check for <CTRL>-<C> presses (or any other break condition) and add a
  1238.         XADPIF_OK to return value when no break condition exists.
  1239.  
  1240.         A progress hook must not support all possibilities! For example hooks
  1241.         from file unarchiving utilities never need an XADPIF_IGNOREGEOMETRY
  1242.         check. Also they need not support renaming or any other stuff. But
  1243.         the more they support, the better the user can work with the tool!
  1244.  
  1245.     MODES
  1246.       XADPMODE_ASK
  1247.         The master library has some problems, which need user interaction.
  1248.         The implementation of the user interaction depends on the
  1249.         application. The xpi_Status holds information what question needs to
  1250.         be answered. When XADPIF_OVERWRITE is set, the hook must determine if
  1251.         the file should be overwritten, renamed or not. The return flags
  1252.         must be set corresponding to this decision. Same is for
  1253.         XADPIF_IGNORGEGEOMETRY and XADPIF_MAKEDIRECTORY flag.
  1254.  
  1255.         XADPIF_IGNOREGEOEMTRY
  1256.           The hook either returns XADPIK_OK|XADPIF_IGNOREGEOMETRY or only
  1257.           XADPIF_OK, when user doesn't think geometry can be ignored.
  1258.  
  1259.         XADPIF_MAKEDIRECTORY
  1260.           The hook either returns XADPIK_OK|XADPIF_MAKEDIRECTORY or only
  1261.           XADPIF_OK, when user doesn't want to make directory.
  1262.  
  1263.         XADPIF_OVERWRITE
  1264.           The destination file already exists. The user should get 6 chances
  1265.           now (named with some standard letters).
  1266.           N - Do not do anything. The hook returns XADPIF_OK.
  1267.           Y - Turn overwrite on. The hook returns XADPIF_OK|XADPIF_OVERWRITE.
  1268.           A - Turn overwrite on for all files. The hook stores this
  1269.               information and returns XADPIF_OK|XADPIF_OVERWRITE. All
  1270.               following XADPIF_OVERWRITE requests are automatically answered
  1271.               with this return.
  1272.           S - Skip that file. The hook returns XADPIF_OK|XADPIF_SKIP.
  1273.           Q - Quit the program. The hook returns XADPIF_OK and the program
  1274.               quits before next call.
  1275.           R - The user wants to rename the file. The hook calls xadAllocVec()
  1276.               to get some memory for the name and passes this in xpi_NewName.
  1277.               This memory is freed by xadmaster.library afterwards!
  1278.               The return value is XADPIF_OK|XADPIF_RENAME.
  1279.  
  1280.       XADPMODE_END
  1281.         This is the last progress display with final results.
  1282.  
  1283.       XADPMODE_ERROR
  1284.         An error occured. The error value is in xpi_Error field.
  1285.  
  1286.       XADPMODE_PROGRESS
  1287.         Normal progress display. Depending on data type (disk/file), some
  1288.         progress information can be displayed.
  1289.  
  1290.     RETURN VALUES
  1291.       0 or anything without XADPIF_OK
  1292.         The work should be aborted. The master library returns XADERR_BREAK.
  1293.  
  1294.       XADPIF_OK
  1295.         No break condition occured. The normal return value for progress
  1296.         display. Also used when user choosed to answer NO to XADPMODE_ASK
  1297.         questions.
  1298.  
  1299.       XADPIF_OK|XADPIF_IGNOREGEOMETRY
  1300.         User choosed that drive geometry can be ignored.
  1301.  
  1302.       XADPIF_OK|XADPIF_MAKEDIRECTORY
  1303.         User choosed that directory should be created.
  1304.  
  1305.       XADPIK_OK|XADPIF_OVERWRITE
  1306.         User choosed that file should be overwritten.
  1307.  
  1308.       XADPIF_OK|XADPIF_RENAME
  1309.         User choosed that file should be renamed. The field xpi_NewName must
  1310.         contain a memory block allocated with xadAllocVec() which holds a new
  1311.         file name. This block is freed by xadmaster.library afterwards!
  1312.  
  1313.       XADPIF_OK|XADPIF_SKIP
  1314.         User choosed to skip that file. The master library returns XADERR_SKIP
  1315.         in that case.
  1316.  
  1317.