home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_disks / 600-699 / ff623.lha / PPLib / doc / pplib.doc
Text File  |  1992-03-21  |  21KB  |  625 lines

  1. TABLE OF CONTENTS
  2.  
  3. powerpacker.library/ppAllocCrunchInfo
  4. powerpacker.library/ppCalcChecksum
  5. powerpacker.library/ppCalcPasskey
  6. powerpacker.library/ppCrunchBuffer
  7. powerpacker.library/ppDecrunchBuffer
  8. powerpacker.library/ppDecrypt
  9. powerpacker.library/ppEnterPassword
  10. powerpacker.library/ppErrorMessage
  11. powerpacker.library/ppFreeCrunchInfo
  12. powerpacker.library/ppGetPassword
  13. powerpacker.library/ppLoadData
  14. powerpacker.library/ppWriteDataHeader
  15. powerpacker.library/ppAllocCrunchInfo   powerpacker.library/ppAllocCrunchInfo
  16.  
  17.   NAME  ppAllocCrunchInfo()  (V35)
  18.  
  19.     crunchinfo = ppAllocCrunchInfo (efficiency, speedup, function, userdata);
  20.  
  21.     APTR ppAllocCrunchInfo (ULONG, ULONG, BOOL (*)(), APTR);
  22.     D0                      D0     D1     A0          A1
  23.  
  24.   DESCRIPTION
  25.     Allocate all the necessary memory needed to crunch a buffer. This
  26.     function must be called before using ppCrunchBuffer.  You must pass
  27.     the crunching efficiency and the size of the speedup buffer.
  28.  
  29.     You can pass a callback function to be called during crunching. Use this
  30.     type of function:
  31.  
  32.     BOOL __stdargs myFunction (ULONG lensofar, ULONG crunlen,
  33.                                ULONG totlen, APTR userdata);
  34.  
  35.     If you do not wish to use this feature pass a NULL. The function can be
  36.     used for two things:
  37.  
  38.       o to display the percentage crunched and gain so far.
  39.       o to allow the user to abort crunching.
  40.  
  41.     Your function will be passed four arguments (on the stack, normal C
  42.     conventions):
  43.  
  44.       lensofar - length of part crunched so far.
  45.       crunlen  - crunched length of lensofar.
  46.       totlen   - total length of buffer.
  47.       userdata - the userdata you provided to ppAllocCrunchInfo().
  48.  
  49.     If your function returns a non-zero value the crunching will continue,
  50.     returning zero will abort crunching.
  51.  
  52.     SAS/C users shouldn't forget __saveds if they compiled their program with
  53.     the small data model and wish to use global data in their function.
  54.     If you write your function in assembly please preserve all registers.
  55.  
  56.     Example:
  57.  
  58.     BOOL __stdargs __saveds myfunc (ULONG sofar, ULONG crunlen,
  59.                                     ULONG totlen, APTR userdata)
  60.     {
  61.        struct IntuiMessage *msg;
  62.        UWORD code;
  63.  
  64.        if (sofar) {
  65.           sprintf (buff, "%ld%% crunched. (%ld%% gain)   ",
  66.              (sofar * 100) / totlen, 100 - (100 * crunlen) / sofar);
  67.           PrtMsg (buff, BLACK|AT_START);
  68.           }
  69.        while (msg = (struct IntuiMessage *)GetMsg (win->UserPort)) {
  70.           code = msg->Code;
  71.           ReplyMsg ((struct Message *)msg);
  72.           if (code == 0x3 /* CTRL-C */) return (FALSE);
  73.           }
  74.        return (TRUE);
  75.     }
  76.  
  77.     Finally note that you may scratch the A4 register.  This is made possible
  78.     to help people who wish to use 'userdata' to pass A4 (C data pointer).
  79.  
  80.   INPUTS
  81.     efficiency - the efficiency of the crunching. One of the
  82.                  following (defined in "libraries/ppbase.[hi]"):
  83.                     CRUN_FAST
  84.                     CRUN_MEDIOCRE
  85.                     CRUN_GOOD
  86.                     CRUN_VERYGOOD
  87.                     CRUN_BEST
  88.     speedup    - size of speedup buffer to be used. One of the
  89.                  following (defined in "libraries/ppbase.[hi]"):
  90.                     SPEEDUP_BUFFSMALL  - from 3K (fast) to 33K (best)
  91.                     SPEEDUP_BUFFMEDIUM - from 5K (fast) to 65K (best)
  92.                     SPEEDUP_BUFFLARGE  - from 196K (fast) to 256K (best)
  93.     function   - callback function to be called every so often during
  94.                  crunching. Can be used to display percentage crunched
  95.                  so far and to abort crunching.
  96.     userdata   - anything you wish. Will be passed to your callback function.
  97.  
  98.   RESULT
  99.     crunchinfo - pointer to private crunchinfo structure to be passed to
  100.                  ppCrunchBuffer (use ppFreeCrunchInfo to deallocate).
  101.  
  102.   NOTE
  103.     'crunchinfo' may be re-used to crunch several buffers.
  104.  
  105.   BUGS
  106.     none known
  107.  
  108.   SEE ALSO
  109.     ppFreeCrunchInfo(), ppCrunchBuffer()
  110.  
  111. powerpacker.library/ppCalcChecksum         powerpacker.library/ppCalcChecksum
  112.  
  113.   NAME  ppCalcChecksum()
  114.  
  115.     sum = ppCalcChecksum (string);
  116.  
  117.     ULONG ppCalcChecksum (char *);
  118.     D0:16                 A0
  119.  
  120.   DESCRIPTION
  121.     This function calculates a 16 bit checksum of a given string of
  122.     characters.
  123.  
  124.   INPUTS
  125.     string - pointer to a null terminated character string.
  126.  
  127.   RESULT
  128.     sum - checksum of 'string'.
  129.  
  130.   NOTE
  131.     Function used to check if a password is correct.
  132.     Upper 16 bits of checksum are 0.
  133.  
  134.   BUGS
  135.     none
  136.  
  137.   SEE ALSO
  138.     ppLoadData()
  139.     ppDecrunchBuffer()
  140.     ppDecrypt()
  141.     ppCalcPasskey()
  142.  
  143. powerpacker.library/ppCalcPasskey           powerpacker.library/ppCalcPasskey
  144.  
  145.   NAME  ppCalcPasskey()
  146.  
  147.     key = ppCalcPasskey (password);
  148.  
  149.     ULONG ppCalcPasskey (char *);
  150.     D0                   A0
  151.  
  152.   DESCRIPTION
  153.     This function calculates the 32 bit key associated with the given
  154.     password to encrypt/decrypt crunched files with.
  155.  
  156.   INPUTS
  157.     string - pointer to a null terminated character string.
  158.  
  159.   RESULT
  160.     key - passkey corresponding to the given password.
  161.  
  162.   NOTE
  163.     Function used to decrypt encrypted files.
  164.  
  165.   BUGS
  166.     none
  167.  
  168.   SEE ALSO
  169.     ppDecrunchBuffer()
  170.     ppDecrypt()
  171.     ppCalcChecksum()
  172.  
  173. powerpacker.library/ppCrunchBuffer         powerpacker.library/ppCrunchBuffer
  174.  
  175.   NAME  ppCrunchBuffer()  (V35)
  176.  
  177.     crunchedlen = ppCrunchBuffer (crunchinfo, buffer, len);
  178.  
  179.     ULONG ppCrunchBuffer (APTR, UBYTE *, ULONG);
  180.     D0                    A0    A1       D0
  181.  
  182.   DESCRIPTION
  183.     Crunch the buffer pointed to by 'buffer' and of length (in bytes) 'len'.
  184.     'crunchinfo' must have been previously allocated by ppAllocCrunchInfo().
  185.  
  186.     During crunching your callback function will be called (if you have
  187.     provided one).  See the autodoc for ppAllocCrunchInfo() for more
  188.     information.
  189.  
  190.     The value returned is the length of the crunched buffer.  If you wish to
  191.     save this crunched buffer as a PowerPacker data file you should first
  192.     write the data header using ppWriteDataHeader() en then write the
  193.     crunched buffer.
  194.  
  195.   INPUTS
  196.     crunchinfo  - pointer to private crunchinfo structure returned by
  197.                   ppAllocCrunchInfo().
  198.     buffer      - pointer to buffer to be crunched.
  199.     len         - length of buffer to be crunched.
  200.  
  201.   RESULT
  202.     crunchedlen - length of crunched buffer. In case of an error
  203.                   'crunchedlen' may also equal PP_CRUNCHABORTED or
  204.                   PP_BUFFEROVERFLOW.  Be sure to check this!
  205.  
  206.   NOTE
  207.     Be sure you know what you are doing when you intend to use this function.
  208.     You can easily crash your Amiga by passing wrong arguments or by writing 
  209.     a faulty callback function.
  210.  
  211.   BUGS
  212.     none known
  213.  
  214.   SEE ALSO
  215.     ppAllocCrunchInfo(), ppFreeCrunchInfo()
  216.  
  217. powerpacker.library/ppDecrunchBuffer     powerpacker.library/ppDecrunchBuffer
  218.  
  219.   NAME  ppDecrunchBuffer()
  220.  
  221.     ppDecrunchBuffer (endcrun, decrbuff, effptr, col);
  222.  
  223.     void ppDecrunchBuffer (UBYTE *, UBYTE *, ULONG *, ULONG);
  224.                            A0       A1       A2       D0
  225.  
  226.   DESCRIPTION
  227.     Function to decrunch from one memory location to another. The address of
  228.     the destination can be as close as 8 bytes after the start address of
  229.     the source, so you can decrunch a file with almost no memory overhead.
  230.  
  231.     If you wish to call this function you need to know the format of a
  232.     crunched file:
  233.  
  234.         1 longword identifier           'PP20' or 'PX20'
  235.        [1 word checksum (if 'PX20')     $ssss]
  236.         1 longword efficiency           $eeeeeeee
  237.         X longwords crunched file       $cccccccc,$cccccccc,...
  238.         1 longword decrunch info        'decrlen' << 8 | '8 bits other info'
  239.  
  240.     The following procedure must be followed to decrunch a file:
  241.  
  242.     First you must read 'decrunch info' to find the length of the decrunched
  243.     file, then you must allocate memory to decrunch it in (shift 'decrunch
  244.     info' right 8 bits and add a safety margin (8 bytes) to get the length
  245.     of this memory block).  If the file is encrypted ('PX20') you must call
  246.     ppDecrypt to decrypt the crunched part before calling ppDecrunchBuffer.
  247.  
  248.     So:
  249.     - read identifier.
  250.     - if PX20, read checksum (16 bits, not 32!).
  251.     - read efficiency.
  252.     - read the longword of decrunch info at the end of the file.
  253.     - calculate 'decrlen'.
  254.     - allocate 'decrlen' + 8 (safety margin) bytes.
  255.     - load 'crunched file' and 'decrunch info' at start of allocated memory.
  256.     - if PX20, prompt for a password (check result of ppGetPassword()!).
  257.     - if PX20, calculate the passkey (use ppCalcPasskey).
  258.     - if PX20, call ppDecrypt to decrypt 'crunched file' only.
  259.       (NOT 'decrunch info'!)
  260.     - and finally call ppDecrunchBuffer() with 'endcrun' pointing right after
  261.       'decrunch info', 'decrbuff' pointing 8 bytes after where you loaded the
  262.       file and 'effptr' pointing to the 'efficieny' longword.
  263.  
  264.     If this seems complicated that is probably because it is :-) ppLoadData
  265.     was written to make things simpler and should suffice in most cases.
  266.  
  267.     WARNING: 'effptr' is a POINTER to the efficiency longword read, NOT the
  268.              efficiency longword itself!
  269.  
  270.   INPUTS
  271.     endcrun  - pointer just after the last byte of the crunched block.
  272.     decrbuff - pointer to beginning of memory to decrunch to (this must be
  273.                at least 8 bytes behind the start of the crunched file).
  274.     effptr   - pointer to (!) efficiency table.
  275.     col      - decrunching effect (DECR_COL0, DECR_COL1, DECR_POINTER,
  276.                DECR_SCROLL, DECR_NONE).  See also ppLoadData().
  277.  
  278.   RESULT
  279.     none
  280.  
  281.   NOTE
  282.     This function is used by ppLoadData() and will probably not be used very
  283.     often on its own.
  284.  
  285.   BUGS
  286.     none known
  287.  
  288.   SEE ALSO
  289.     ppLoadData()
  290.     ppDecrypt()
  291.     ppCalcPasskey()
  292.     ppCalcChecksum()
  293.     ppGetPassword()
  294.  
  295. powerpacker.library/ppDecrypt                   powerpacker.library/ppDecrypt
  296.  
  297.   NAME  ppDecrypt()
  298.  
  299.     ppDecrypt (buffer, len, key)
  300.  
  301.     void ppDecrypt (UBYTE *, ULONG, ULONG);
  302.                     A0       D0     D1
  303.  
  304.   DESCRIPTION
  305.     This function will decrypt a memory region with a given passkey. It
  306.     must be called before calling ppDecrunchBuffer() (if the file was
  307.     encrypted).
  308.  
  309.   INPUTS
  310.     buffer - start address of memory region to decrypt (word alligned !).
  311.     len    - length in bytes of memory region to decrypt (rounded up to the
  312.              next multiple of 4).
  313.     key    - key of password as returned by ppCalcPasskey().
  314.  
  315.   RESULT
  316.     none
  317.  
  318.   NOTE
  319.     If you call this function before calling ppDecrunchBuffer make sure you
  320.     decrypt the correct memory region, don't decrypt the last longword !
  321.  
  322.   BUGS
  323.     none
  324.  
  325.   SEE ALSO
  326.     ppDecrunchBuffer()
  327.     ppCalcChecksum()
  328.     ppCalcPasskey()
  329.     ppLoadData()
  330.  
  331. powerpacker.library/ppEnterPassword       powerpacker.library/ppEnterPassword
  332.  
  333.   NAME  ppEnterPassword()  (V35)
  334.  
  335.     bool = ppEnterPassword (screen, buffer);
  336.  
  337.     BOOL ppEnterPassword (struct Screen *, char *);
  338.     D0                    A0               A1
  339.  
  340.   DESCRIPTION
  341.     reqtools.library _MUST_ be available!
  342.  
  343.     Opens a small requester to prompt the user for a password. The password
  344.     will not be visible when typed. Returns when the user has succesfully
  345.     entered a password AND a verification.
  346.  
  347.     When buffer already holds a string on entry, a 'Last' gadget will appear
  348.     in the requester so the user may re-enter his last password without
  349.     retyping it. It is up to you to support this feature. If you do not wish
  350.     to support this make sure buffer holds an empty string (buffer[0] = 0).
  351.  
  352.   INPUTS
  353.     screen - screen where the requester should appear or NULL.
  354.     buffer - buffer to hold the password. Must be at least 17 bytes big!
  355.  
  356.   RESULT
  357.     bool - TRUE if a password was entered (can be found in buffer), FALSE
  358.            if user aborted the requester.
  359.  
  360.   NOTE
  361.     The contents of the buffer will NOT change if the requester is aborted.
  362.  
  363.     Automatically adjusts the requester to the screen's font.
  364.  
  365.     ppEnterPassword() checks the pr_WindowPtr of your process to find the
  366.     screen to put the requester on (if screen == NULL).
  367.  
  368.   BUGS
  369.     none known
  370.  
  371.   SEE ALSO
  372.  
  373. powerpacker.library/ppErrorMessage         powerpacker.library/ppErrorMessage
  374.  
  375.   NAME  ppErrorMessage()  (V35)
  376.  
  377.     message = ppErrorMessage (errorcode);
  378.  
  379.     char *ppErrorMessage (ULONG);
  380.     D0                    D0
  381.  
  382.   DESCRIPTION
  383.     Returns a pointer to a null-terminated string holding a descriptive
  384.     error message for the supplied error code.
  385.  
  386.     Currently only works for error codes returned by ppLoadData().
  387.  
  388.   INPUTS
  389.     errorcode - error code returned by ppLoadData().
  390.  
  391.   RESULT
  392.     message - pointer to error message (null terminated string) associated
  393.               with error code.
  394.  
  395.   BUGS
  396.     none known
  397.  
  398.   SEE ALSO
  399.     ppLoadData()
  400.  
  401. powerpacker.library/ppFreeCrunchInfo     powerpacker.library/ppFreeCrunchInfo
  402.  
  403.   NAME  ppFreeCrunchInfo()  (V35)
  404.  
  405.     ppFreeCrunchInfo (crunchinfo);
  406.  
  407.     void ppFreeCrunchInfo (APTR);
  408.                            A0
  409.  
  410.   DESCRIPTION
  411.     Free all memory associated with the private crunchinfo structure
  412.     returned by ppAllocCrunchInfo().
  413.  
  414.   INPUTS
  415.     crunchinfo - pointer to private crunchinfo structure.
  416.  
  417.   RESULT
  418.     none
  419.  
  420.   NOTE
  421.     crunchinfo may be NULL, no action will be taken.
  422.  
  423.   BUGS
  424.     none known
  425.  
  426.   SEE ALSO
  427.     ppAllocCrunchInfo(), ppCrunchBuffer()
  428.  
  429. powerpacker.library/ppGetPassword           powerpacker.library/ppGetPassword
  430.  
  431.   NAME  ppGetPassword()
  432.  
  433.     bool = ppGetPassword (screen, buffer, maxlen, checksum);
  434.  
  435.     BOOL ppGetPassword (struct Screen *, UBYTE *, ULONG, ULONG);
  436.     D0                  A0               A1       D0     D1:16
  437.  
  438.   DESCRIPTION
  439.     reqtools.library _MUST_ be available!
  440.  
  441.     Opens a small requester to prompt the user for a password. Returns when
  442.     the user enters a password with a checksum equal to 'checksum' or when
  443.     he has failed to enter a correct password (three chances). The password
  444.     will not be visible when typed.
  445.  
  446.   INPUTS
  447.     screen   - screen where the requester should appear.
  448.     buffer   - buffer to hold correct password. Must at least 17 bytes big!
  449.     maxlen   - maximum length of password, should always be 16.
  450.     checksum - checksum of password we are looking for.
  451.  
  452.   RESULT
  453.     bool - TRUE when the correct password was entered (can be found in
  454.            buffer), FALSE when no correct password was given after three
  455.            attempts.
  456.  
  457.   NOTE
  458.     New for V35: The contents of the buffer will NOT change if the requester
  459.                  is aborted.
  460.  
  461.     This function will be used by ppLoadData() to prompt for a password when
  462.     you called it with 'func' equal to NULL.
  463.  
  464.     Automatically adjusts the requester to the screen's font.
  465.  
  466.     ppGetPassword() checks the pr_WindowPtr of your process to find the
  467.     screen to put the requester on (if screen == NULL).
  468.  
  469.   BUGS
  470.     none known
  471.  
  472.   SEE ALSO
  473.     ppLoadData()
  474.     ppDecrunchBuffer()
  475.  
  476. powerpacker.library/ppLoadData                 powerpacker.library/ppLoadData
  477.  
  478.   NAME  ppLoadData()
  479.  
  480.     error = ppLoadData (filename, col, memtype, &buffer, &len, func);
  481.  
  482.     ULONG ppLoadData (char *, ULONG, ULONG, UBYTE **, ULONG *, BOOL (*)());
  483.     D0                A0      D0     D1     A1        A2       A3
  484.  
  485.   DESCRIPTION
  486.     This function loads a file in memory. The memory necessary to load the
  487.     file will be allocated by this function. Files crunched with PowerPacker
  488.     will be decrunched, plain files will simply be loaded. If the file can't
  489.     be opened ".pp" will be appended before trying again. The address of the
  490.     loaded file will be stored in 'buffer', the length in 'len'. You must
  491.     free this memory yourself (see NOTE) !
  492.  
  493.     The 'func' argument is the address of a function to be called when
  494.     ppLoadData() needs a password to decrypt an encrypted file. If you do
  495.     not want to load encrypted files call with func equal to -1, if you want
  496.     ppLoadData() to use ppGetPassword(), call with func equal to NULL.
  497.  
  498.     If you wish to use your own password prompting function you must call
  499.     ppLoadData() with func equal to the address of this type of function:
  500.  
  501.         BOOL __stdargs myFunction (UBYTE *password, ULONG checksum);
  502.  
  503.     On entry 'password' points to a buffer to hold up to 16 characters and a
  504.     terminating zero (so 17 bytes in all), 'checksum' is the checksum of the
  505.     password we are looking for. Your function must prompt for a string and
  506.     compare the checksum with 'checksum' (use ppCalcChecksum() for this). If
  507.     they are equal you must store the string in 'password' (in C you can use
  508.     'strcpy') and return TRUE, if not you should give the user a few more
  509.     chances (usually three in all) and return FALSE if no correct password
  510.     was entered.
  511.  
  512.     The two arguments are pushed on the stack according to C convention, so
  513.     if you write your function in assembly you will find the arguments on the
  514.     stack, the pointer to the buffer at 4(a7) and the checksum at 8(a7)
  515.     (longwords!). Assembly functions must preserve all registers !
  516.  
  517.     SAS/C users shouldn't forget __saveds if they compiled their program with
  518.     the small data model and wish to use global data in their function.
  519.  
  520.   INPUTS
  521.     filename - pointer to a null terminated pathname of the file to load.
  522.     col      - the effect to be used during decrunching. One of the
  523.                following (defined in "libraries/ppbase.[hi]"):
  524.                    DECR_COL0    - flash color 0
  525.                    DECR_COL1    - flash color 1
  526.                    DECR_POINTER - flash mouse pointer
  527.                    DECR_SCROLL  - weird stuff :-)
  528.                    DECR_NONE    - no decrunching effect
  529.     memtype  - type of memory to allocate (see AllocMem()).
  530.     &buffer  - address of (!) variable to hold memory location of loaded
  531.                file.
  532.     &len     - address of (!) variable to hold length of loaded file.
  533.     func     - function to be called to prompt the user for a password,
  534.                NULL for the the default password prompt and -1 for no
  535.                password prompt.
  536.  
  537.   RESULT
  538.     error - 0 if all went ok, if not one of the following error codes will
  539.             be returned (defined in "libraries/ppbase.(h|i)"):
  540.                 PP_OPENERR   - unable to open file.
  541.                 PP_READERR   - read error.
  542.                 PP_NOMEMORY  - not enough memory to load file.
  543.                 PP_CRYPTED   - file is encrypted (only when 'func' == -1).
  544.                 PP_PASSERR   - incorrect password, 'func()' returned FALSE.
  545.                 PP_EMPTYFILE - file is empty, there is nothing to load.
  546.                 PP_UNKNOWNPP - crunched by unknown version of PowerPacker.
  547.  
  548.   NOTE
  549.     Do not forget to free the memory allocated by this function !
  550.     Use "FreeMem (buffer, len);" before quitting your program, but only if
  551.     ppLoadData() didn't return an error.
  552.  
  553.     After calling 'func()' ppLoadData() doesn't check the checksum again,
  554.     only the returned boolean. Therefore it is VERY important that your
  555.     function is correct and only returns TRUE when the entered password has
  556.     the correct checksum !
  557.     Don't forget to copy your string to the memory pointed to by 'password'
  558.     before leaving 'func()' ! This password is needed to decrypt the file !!
  559.     Note that 'password' is a C string and must be null terminated !
  560.  
  561.     In case you call ppLoadData() with 'func' equal to NULL (use automatic
  562.     password prompting) the pr_WindowPtr of your Process will be used to
  563.     find the screen to open the password requester on. If pr_WindowPtr
  564.     equals 0 or -1 the WorkBench screen will be used, otherwise the screen
  565.     of the pr_WindowPtr window will be used. Only a process can call
  566.     ppLoadData() (it uses DOS) so pr_WindowPtr exists. Set it like this:
  567.  
  568.         struct Window *yourwindow;
  569.         struct Process *proc;
  570.         APTR oldwinptr;
  571.  
  572.         /* Open your screen and window... */
  573.  
  574.         ...
  575.  
  576.         /* set pr_WindowPtr */
  577.         proc = (struct Process *)FindTask (NULL);
  578.         oldwinptr = proc->pr_WindowPtr;
  579.         proc->pr_WindowPtr = (APTR)yourwindow;
  580.  
  581.         ...
  582.  
  583.         /* restore before quitting (VERY IMPORTANT !!) */
  584.         proc->pr_WindowPtr = oldwinptr;
  585.         exit (0);
  586.  
  587.   BUGS
  588.     none known
  589.  
  590.   SEE ALSO
  591.     exec.library/AllocMem(), exec.library/FreeMem(), ppCalcChecksum(),
  592.     ppErrorMessage(), ppGetPassword()
  593.  
  594. powerpacker.library/ppWriteDataHeader   powerpacker.library/ppWriteDataHeader
  595.  
  596.   NAME  ppWriteDataHeader()  (V35)
  597.  
  598.     success = ppWriteDataHeader (lock, efficiency, crypt, checksum);
  599.  
  600.     ULONG ppWriteDataHeader (BPTR, ULONG, BOOL, ULONG);
  601.     D0                       D0    D1     D2    D3:16
  602.  
  603.   DESCRIPTION
  604.     Use this function to write the PowerPacker data header at the
  605.     beginning of a file.
  606.  
  607.   INPUTS
  608.     lock       - BCPL pointer to a DOS file handle.
  609.     efficiency - efficiency used to crunch the buffer.
  610.                  See ppAllocCrunchInfo(). (CRUN_FAST, ... ,CRUN_BEST)
  611.     crypt      - TRUE for a header of an encrypted file, FALSE otherwise.
  612.     checksum   - (if crypt = TRUE) checksum of password used to encrypt.
  613.  
  614.   RESULT
  615.     success - TRUE on success, FALSE if a write error occured.
  616.  
  617.   NOTE
  618.  
  619.   BUGS
  620.     none known
  621.  
  622.   SEE ALSO
  623.     ppAllocCrunchInfo(), ppDecrypt()
  624.  
  625.