home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / hensa / programming / gstobjects_1 / squash / Example / test1 / bin,FFF
Encoding:
Text File  |  1994-09-14  |  2.6 KB  |  81 lines

  1. This line should be printed by the basic program.
  2. /***************************************************************************
  3.  
  4.                 (C) 1994 George Taylor
  5.                 ----------------------
  6.  
  7.  
  8.         Title:        Squash
  9.  
  10.         Purpose:    Load 'squash' format files -
  11.                 i.e. files produced with !Squash
  12.                 You can read in a file and if it's a squash file
  13.                 it will be decompressed.
  14.  
  15.         Author:        George Taylor
  16.  
  17.         Notes:        malloc() and free() are used as a storage allocator.
  18.  
  19.                 These procedures will only work in a Shared C Library
  20.                    like environment (eg call from C/Pascal).
  21.  
  22. ***************************************************************************/
  23.  
  24. #pragma include_only_once
  25.  
  26.  
  27. /* Procedure:    squash_GetSize
  28.  *
  29.  * Description:    Find out the uncompressed size in memory of a
  30.  *        squash file and the file type of the original file.
  31.  *
  32.  * Parameters:    const char *filename - name of squash format file
  33.  *        unsigned int *type
  34.  *            - if this pointer is not NULL the file type of the
  35.  *              original file is placed at *type
  36.  *            The result at *type is undefined if -1 is returned.
  37.  *
  38.  * Returns:    unsigned int - number of bytes of uncompressed data
  39.  *        Returns -1 if the file could not be opened or if the
  40.  *        file is not a squash file.
  41.  *
  42.  * Other Info:    The uncomressed size and type is found out by reading the
  43.  *        header of the squash file.
  44.  *
  45.  *        If the file exists but does not have the squash file type
  46.  *        then the size and type of the file is returned. This is
  47.  *        useful as !Squash does not squash files which get longer
  48.  *        when squashed.
  49.  */
  50. unsigned int squash_GetSize(const char *filename, unsigned int *type);
  51.  
  52.  
  53.  
  54. /* Procedure:    squash_Load
  55.  *
  56.  * Description:    Load and uncompress a squash file.
  57.  *
  58.  * Parameters:    const char *filename - name of squash format file
  59.  *        void *buf - buffer for uncompressed file contents
  60.  *                (assumed to be large enough)
  61.  *                 (must be word aligned)
  62.  *
  63.  * Returns:    int - non-zero if file loaded and uncompressed ok
  64.  *              zero if file could not be opened or if decompression
  65.  *                  failed
  66.  *
  67.  * Other Info:    malloc() is used to allocate a temporary buffer for the
  68.  *        whole (in one peice) of the input file.
  69.  *
  70.  *        The whole file is decompressed in one call to SWI
  71.  *        Squash_Decompress as this is very fast.
  72.  *
  73.  *        If the file exists but does not have the squash file type
  74.  *        then the file is simply read into the buffer. This is
  75.  *        useful as !Squash does not squash files which get longer
  76.  *        when squashed. (You can still the use buffer size as given
  77.  *        by squash_GetSize()).
  78.  */
  79. int squash_Load(const char *filename, void *buf);
  80.  
  81.