home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Amiga Shareware Floppies / ma32.dms / ma32.adf / xfd-lib / include / libraries / xfdmaster.i < prev   
Text File  |  1994-03-27  |  5KB  |  130 lines

  1.     IFND    LIBRARIES_XFDMASTER_I
  2. LIBRARIES_XFDMASTER_I    SET    1
  3.  
  4. **
  5. **    $VER: xfdmaster.i 33.3 (20.3.94)
  6. **
  7. **    Copyright © 1994 by Georg Hörmann
  8. **    All Rights Reserved
  9. **
  10.  
  11.     IFND EXEC_LIBRARIES_I
  12.     include "exec/libraries.i"
  13.     ENDC
  14.  
  15. ;======================================================================
  16. ; Library Base
  17. ;======================================================================
  18.  
  19.     STRUCTURE    xfdMasterBase,LIB_SIZE
  20.     ULONG    xfdm_SegList        ; PRIVATE
  21.     APTR    xfdm_DosBase
  22.     APTR    xfdm_FirstSlave
  23.     APTR    xfdm_FirstForeman    ; PRIVATE
  24.     LABEL    xfdMasterBase_SIZE
  25.  
  26. XFDM_VERSION    EQU    33    ;for OpenLibrary()
  27.  
  28. XFDM_NAME    MACRO
  29.         dc.b    "xfdmaster.library",0
  30.         ENDM
  31.  
  32. ;======================================================================
  33. ; Buffer Info
  34. ;======================================================================
  35.  
  36.     STRUCTURE    xfdBufferInfo,0
  37.     APTR    xfdbi_SourceBuffer    ; pointer to source buffer
  38.     ULONG    xfdbi_SourceBufLen    ; length of source buffer
  39.     APTR    xfdbi_Slave        ; PRIVATE
  40.     APTR    xfdbi_PackerName    ; name of recognized packer
  41.     UWORD    xfdbi_PackerFlags    ; flags for recognized packer
  42.     LABEL    xfdbi_MaxSpecialLen    ; max. length of special info (eg. password)
  43.     UWORD    xfdbi_Error        ; error return code
  44.     APTR    xfdbi_TargetBuffer    ; pointer to target buffer
  45.     ULONG    xfdbi_TargetBufMemType    ; memtype of target buffer
  46.     ULONG    xfdbi_TargetBufLen    ; full length of buffer
  47.     ULONG    xfdbi_TargetBufSaveLen    ; used length of buffer
  48.     ULONG    xfdbi_DecrAddress    ; address to load decrunched file
  49.     ULONG    xfdbi_JmpAddress    ; address to jump in file
  50.     APTR    xfdbi_Special        ; special decrunch info (eg. password)
  51.     LABEL    xfdBufferInfo_SIZE
  52.  
  53. ;======================================================================
  54. ; Segment Info
  55. ;======================================================================
  56.  
  57.     STRUCTURE    xfdSegmentInfo,0
  58.     ULONG    xfdsi_SegList        ; value received by LoadSeg()
  59.     APTR    xfdsi_Slave        ; PRIVATE
  60.     APTR    xfdsi_PackerName    ; name of recognized packer
  61.     UWORD    xfdsi_PackerFlags    ; flags for recognized packer
  62.     LABEL    xfdsi_MaxSpecialLen    ; max. length of special info (eg. password)
  63.     UWORD    xfdsi_Error        ; error return code
  64.     APTR    xfdsi_Special        ; special decrunch info (eg. password)
  65.     LABEL    xfdSegmentInfo_SIZE
  66.  
  67. ;======================================================================
  68. ; Error Codes
  69. ;======================================================================
  70.  
  71. XFDERR_OK        EQU    0    ; no error
  72. XFDERR_NOMEMORY        EQU    1    ; error allocating memory
  73. XFDERR_NOSLAVE        EQU    2    ; no slave entry in info structure
  74. XFDERR_NOTSUPPORTED    EQU    3    ; slave doesn't support called function
  75. XFDERR_UNKNOWN        EQU    4    ; unknown file
  76. XFDERR_NOSOURCE        EQU    5    ; no sourcebuffer/seglist specified
  77. XFDERR_WRONGPASSWORD    EQU    6    ; wrong password for decrunching
  78. XFDERR_BADHUNK        EQU    7    ; bad hunk structure
  79. XFDERR_CORRUPTEDDATA    EQU    8    ; crunched data is corrupted
  80. NUM_XFDERRS        EQU    9    ; PRIVATE
  81.  
  82. ;======================================================================
  83. ; Values for xfd??_PackerFlags
  84. ;======================================================================
  85.  
  86.     BITDEF    XFDPF,RELOC,0        ; relocatible file packer
  87.     BITDEF    XFDPF,ADDR,1        ; absolute address file packer
  88.     BITDEF    XFDPF,DATA,2        ; data file packer
  89.  
  90.     BITDEF    XFDPF,PASSWORD,4    ; packer requires password
  91.  
  92. ;======================================================================
  93. ; Foreman
  94. ;======================================================================
  95.  
  96.     STRUCTURE    xfdForeman,0
  97.     STRUCT    xfdf_Security,4        ; moveq #-1,d0 : rts
  98.     STRUCT    xfdf_ID,4        ; set to XFDF_ID
  99.     UWORD    xfdf_Version        ; set to XFDF_VERSION
  100.     UWORD    xfdf_Reserved        ; not used by now, set to NULL
  101.     ULONG    xfdf_Next        ; PRIVATE
  102.     ULONG    xfdf_SegList        ; PRIVATE
  103.     APTR    xfdf_FirstSlave        ; first slave (see below)
  104.     LABEL    xfdForeman_SIZE
  105.  
  106. XFDF_ID        EQU    (("X"<<24)!("F"<<16)!("D"<<8)!("F"))
  107. XFDF_VERSION    EQU    1
  108.  
  109. ;======================================================================
  110. ; Slave
  111. ;======================================================================
  112.  
  113.     STRUCTURE    xfdSlave,0
  114.     APTR    xfds_Next        ; next slave (or NULL)
  115.     UWORD    xfds_Version        ; set to XFDS_VERSION
  116.     UWORD    xfds_MasterVersion    ; minimum XFDM_VERSION required
  117.     APTR    xfds_PackerName        ; NULL-terminated name of packer
  118.     UWORD    xfds_PackerFlags    ; flags for packer
  119.     UWORD    xfds_MaxSpecialLen    ; max. length of special info (eg. password)
  120.     FPTR    xfds_RecogBuffer    ; buffer recognition code (or NULL)
  121.     FPTR    xfds_DecrunchBuffer    ; buffer decrunch code (or NULL)
  122.     FPTR    xfds_RecogSegment    ; segment recognition code (or NULL)
  123.     FPTR    xfds_DecrunchSegment    ; segment decrunch code (or NULL)
  124.     LABEL    xfdSlave_SIZE
  125.  
  126. XFDS_VERSION    EQU    1
  127.  
  128.  
  129.     ENDC    ; LIBRARIES_XFDMASTER_I
  130.