"Fossies" - the Fresh Open Source Software Archive

Member "epstool-3.08/src/clzw.h" (10 Jun 2005, 1691 Bytes) of package /linux/misc/old/ghost/ghostgum/epstool-3.08-os2.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 /* Copyright (C) 2004 Ghostgum Software Pty Ltd.  All rights reserved.
    2 
    3   This software is provided AS-IS with no warranty, either express or
    4   implied.
    5 
    6   This software is distributed under licence and may not be copied,
    7   modified or distributed except as expressly authorised under the terms
    8   of the licence contained in the file LICENCE in this distribution.
    9 
   10   For more information about licensing, please refer to
   11   http://www.ghostgum.com.au/ or contact Ghostsgum Software Pty Ltd, 
   12   218 Gallaghers Rd, Glen Waverley VIC 3150, AUSTRALIA, 
   13   Fax +61 3 9886 6616.
   14 */
   15 
   16 /* $Id: clzw.h,v 1.1 2004/07/08 09:14:34 ghostgum Exp $ */
   17 /* LZW compression, compatible with PostScript LZWDecode filter */
   18 
   19 /* Structure for holding LZW compressor state */
   20 typedef struct lzw_state_s lzw_state_t;
   21 
   22 /* allocate and initialise an LZW compressor */ 
   23 lzw_state_t *lzw_new(void);
   24 
   25 /*
   26  * Compress a buffer with LZW.
   27  * Inputs:
   28  *   inbuf is input buffer
   29  *   *inlen is count of bytes in the input buffer
   30  *   outbuf is output buffer
   31  *   *outlen is the length of the output buffer
   32  * Outputs:
   33  *   *inlen is count of used input bytes
   34  *   *outlen is the count of output bytes produced
   35  * If the output *inlen is not equal to the input *inlen,
   36  * then output buffer is full and lzw_compress should
   37  * be called again with the remaining input bytes
   38  * and another output buffer.
   39  * To signal EOD, call with *inlen = 0.
   40  */
   41 void lzw_compress(lzw_state_t *state,
   42     const unsigned char *inbuf, int *inlen,
   43     unsigned char *outbuf, int *outlen);
   44 
   45 /* 
   46  * Free the LZW structure
   47  * You must first have signalled EOD to lzw_compress, 
   48  * otherwise you will lose data.
   49  */
   50 void lzw_free(lzw_state_t *state);
   51