home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1998 #6 / amigamamagazinepolishissue1998.iso / packery / crmv1.9t / developer / include / libraries / crm.h < prev    next >
C/C++ Source or Header  |  1980-01-10  |  4KB  |  139 lines

  1. #ifndef    LIBRARIES_CRM_H
  2. #define LIBRARIES_CRM_H
  3. /*
  4. **    $Filename: libraries/crm.h $
  5. **    $Release: 4.0 $
  6. **      $Date: 26-Sep-93 $
  7. **
  8. **    CrM.library include and definition file
  9. **
  10. **    (c) 1992-3 Thomas Schwarz
  11. **    All Rights Reserved
  12. */
  13. /*------------------------------------------------------------------------*/
  14.  
  15. #ifndef EXEC_TYPES_H
  16. #include <exec/types.h>
  17. #endif
  18.  
  19. #ifndef UTILITY_TAGITEM_H
  20. #include <utility/tagitem.h>
  21. #endif
  22.  
  23. #define    CRMNAME    "CrM.library"
  24.  
  25. #define    CRMVERSION    4
  26.  
  27. /**************
  28.  * Data Header
  29.  **************/
  30.  
  31. struct DataHeader
  32. {
  33.    ULONG    dh_ID;
  34.    WORD        dh_MinSecDist;
  35.    ULONG    dh_OriginalLen;
  36.    ULONG    dh_CrunchedLen;
  37. };
  38.  
  39. /***************
  40.  * CurrentStats
  41.  ***************/
  42. struct cmCurrentStats
  43. {
  44.    ULONG    cmcu_ToGo;
  45.    ULONG    cmcu_Len;
  46. };
  47.  
  48. /********************
  49.  ** CrunchStruct(ure)
  50.  ********************/
  51. struct cmCrunchStruct
  52. {
  53.    APTR        cmcr_Src;        /* Source Start */
  54.    ULONG    cmcr_SrcLen;        /* Source Len */
  55.    APTR        cmcr_Dest;        /* Destination Start */
  56.    ULONG    cmcr_DestLen;        /* Destination Len (maximum) */
  57.    struct DataHeader *cmcr_DataHdr;    /* DataHeader */
  58.    struct Hook *cmcr_DisplayHook;    /* Hook to display ToGo/Gain Counters */
  59.  /*** Registers hold these values when the Hook is called:                  */
  60.  /*** a0:struct Hook*  a2:struct cmCrunchStruct*  a1:struct cmCurrentStats* */
  61.  /*** you have to return TRUE/FALSE in d0 to continue/abort crunching!      */
  62.    UWORD    cmcr_DisplayStep;    /* time between 2 calls to the Hook */
  63.    /******** readonly: ********/
  64.    UWORD    cmcr_Offset;        /* desired Offset */
  65.    UWORD    cmcr_HuffSize;        /* HuffLen in KBytes */
  66.    UWORD    cmcr_Algo;        /* desired Packalgorithm */
  67.    ULONG    cmcr_MaxOffset;        /* biggest possible Offset (Buffer allocated) */
  68.    ULONG    cmcr_RealOffset;    /* currently used Offset */
  69.    ULONG    cmcr_MinSecDist;    /* MinSecDist for packed Data */
  70.    ULONG    cmcr_CrunchedLen;    /* Length of crunched Data at cmcr_Dest */
  71.    /******** private: ********/
  72.    ULONG    cmcr_HuffTabs;
  73.    ULONG    cmcr_HuffBuf;
  74.    ULONG    cmcr_HuffLen;
  75.    ULONG    cmcr_SpeedLen;
  76.    ULONG    cmcr_SpeedTab;
  77.    ULONG    cmcr_MegaSpeedTab;
  78.    UBYTE    cmcr_QuitFlag;        /* readonly: reason for failure */
  79.    UBYTE    cmcr_OverlayFlag;
  80.    UBYTE    cmcr_LEDFlashFlag;
  81.    UBYTE    cmcr_Pad;
  82.    /* CrunchStruct continues here, but LEAVE YOUR HANDS OFF!!! */
  83. };
  84.      
  85. /*************************************
  86.  ** Result Codes of cmCheckCrunched()
  87.  ** and Symbols for the CMCS_Algo Tag
  88.  *************************************/
  89. #define    cm_Normal    1
  90. #define    cm_LZH        2
  91. #define    cmB_Sample    4
  92. #define    cmF_Sample    (1<<cmB_Sample)
  93. #define    cmB_PW        5
  94. #define    cmF_PW        (1<<cmB_PW)
  95. #define    cmB_Overlay    8            /* only for the */
  96. #define    cmF_Overlay    (1<<cmB_Overlay)    /* CMCS_Algo Tag! */
  97. #define    cmB_LEDFlash    9            /* only for the */
  98. #define    cmF_LEDFlash    (1<<cmB_LEDFlash)    /* CMCS_Algo Tag! */
  99.  
  100. /** Use this mask to get the crunch algorithm without any other flags: */
  101. #define    cm_AlgoMask    0xF
  102.  
  103. /**********************************
  104.  ** Action Codes for cmProcessPW()
  105.  **********************************/
  106. #define    cm_AddPW    1
  107. #define    cm_RemovePW    2
  108. #define    cm_RemoveAll    3
  109.  
  110. /**********************************
  111.  ** Action Codes for cmCryptData()
  112.  **********************************/
  113. #define    cm_EnCrypt    4
  114. #define    cm_DeCrypt    5
  115.  
  116. /********************************************
  117.  ** Action Codes for cmProcessCrunchStruct()
  118.  ********************************************/
  119. #define    cm_AllocStruct    6
  120. #define    cm_FreeStruct    7
  121.  
  122. /************************************
  123.  ** Tags for cmProcessCrunchStruct()
  124.  ************************************/
  125. #define    CM_TagBase    TAG_USER
  126. #define    CMCS_Algo    (CM_TagBase+1)        /* default: cm_LZH */
  127. #define    CMCS_Offset    (CM_TagBase+2)        /* default: $7ffe */
  128. #define    CMCS_HuffSize    (CM_TagBase+3)        /* default: 16 */
  129.  
  130. /********************************************
  131.  ** for older Code, _DON'T_ use in new code:
  132.  ********************************************/
  133. #define    dh_OrginalLen    dh_OriginalLen
  134. #define    cm_Sample    16
  135. #define    cm_NormSamp    (cm_Normal|cm_Sample)
  136. #define    cm_LZHSamp    (cm_LZH|cm_Sample)
  137.  
  138. #endif
  139.