home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1998 #6 / amigamamagazinepolishissue1998.iso / packery / xpkilzr / source / xpkenco.c < prev    next >
C/C++ Source or Header  |  1977-12-31  |  2KB  |  99 lines

  1. /*
  2.  * This library is mainly intended to demonstrate how to program an
  3.  * encryption sub library/
  4.  */
  5.  
  6. char ver[]="$VER: ENCO 1.1 ("__DATE__")";
  7.  
  8. #define NO_SUB_PRAGMAS
  9.  
  10. #include <libraries/xpksub.h>
  11.  
  12. #define A3000 XPKMF_A3000SPEED
  13.  
  14. XMINFO EncoMode = {
  15.     NULL,    // next
  16.     100,     // upto
  17.     A3000,   // flags
  18.     0,       // packmem
  19.     0,       // unpackmem
  20.     393,     // packspeed,   K/sec
  21.     393,     // unpackspeed, K/sec
  22.     45,      // ratio,      *0.1%
  23.     0,       // reserved
  24.     "normal" // description
  25. };
  26.  
  27. static struct XpkInfo EncoInfo = {
  28.         1,               /* info version */
  29.         0,               /* lib  version */
  30.         0,               /* master vers  */
  31.         0,               /* pad          */
  32.         "ENCO",          /* short name   */
  33.         "Encoder 0.1",   /* long name    */
  34.         "Totally unsafe encryption", /* description*/
  35.         'ENCO',          /* 4 letter ID  */
  36.         XPKIF_PK_CHUNK  |/* flags        */
  37.         XPKIF_UP_CHUNK  ,
  38.         500000,          /* max in chunk */
  39.         0,               /* min in chunk */
  40.         50000,           /* def in chunk */
  41.         "Encoding",      /* pk message   */
  42.         "Decoding",      /* up message   */
  43.         "Encoded",       /* pk past msg  */
  44.         "Decoded",       /* up past msg  */
  45.         50,              /* def mode     */
  46.         0,               /* pad          */
  47.         &EncoMode        /* modes        */
  48. };
  49.  
  50. /*
  51.  * Returns an info structure about our packer
  52.  */
  53. struct XpkInfo * __saveds __asm
  54. XpksPackerInfo( void )
  55. {
  56.     return &EncoInfo;
  57. }
  58.  
  59.  
  60. void __saveds __asm
  61. XpksPackFree( REG __a0 XPARAMS* xpar )
  62. {
  63.   strcpy( xpar->OutBuf , "PackFree" );
  64. }
  65.  
  66. /*
  67.  * This forces the next chunk to be uncompressable independent from the
  68.  * previous one. This is always the case in RLEN.
  69.  */
  70. long __saveds __asm
  71. XpksPackReset( REG __a0 XPARAMS* xpar )
  72. {
  73.   strcat( xpar->OutBuf , "PackReset" );
  74.     return 0;
  75. }
  76.  
  77.  
  78. void __saveds __asm
  79. XpksUnpackFree( REG __a0 XPARAMS* xpar )
  80. {
  81. }
  82.  
  83. long __saveds __asm
  84. XpksPackChunk( REG __a0 XPARAMS *xpar )
  85. {
  86.   ((char *)xpar->OutBuf)[10]=0;
  87.   strcat( xpar->OutBuf , "PackChunck1" );
  88.   strcat( xpar->OutBuf , "PackChunck2" );
  89.   xpar->OutLen = 100;
  90.     return 0;
  91. }
  92.  
  93.  
  94. long __saveds __asm
  95. XpksUnpackChunk( REG __a0 XPARAMS* xpar )
  96. {
  97.     return 0;
  98. }
  99.