E:/PPC/XFlib/include/gif_lib_private.h

Go to the documentation of this file.
00001 #ifndef _GIF_LIB_PRIVATE_H
00002 #define _GIF_LIB_PRIVATE_H
00003 
00004 #include "gif_lib.h"
00005 #include <stdio.h>
00006 #include <stdlib.h>
00007 
00008 #define PROGRAM_NAME "LIBUNGIF"
00009 
00010 #ifdef SYSV
00011 #define VersionStr "Gif library module,\t\tEric S. Raymond\n\
00012                     (C) Copyright 1997 Eric S. Raymond\n"
00013 #else
00014 #define VersionStr PROGRAM_NAME "    IBMPC " GIF_LIB_VERSION \
00015                     "    Eric S. Raymond,    " __DATE__ ",   " \
00016                     __TIME__ "\n" "(C) Copyright 1997 Eric S. Raymond\n"
00017 #endif /* SYSV */
00018 
00019 #define LZ_MAX_CODE         4095    /* Biggest code possible in 12 bits. */
00020 #define LZ_BITS             12
00021 
00022 #define FLUSH_OUTPUT        4096    /* Impossible code, to signal flush. */
00023 #define FIRST_CODE          4097    /* Impossible code, to signal first. */
00024 #define NO_SUCH_CODE        4098    /* Impossible code, to signal empty. */
00025 
00026 #define FILE_STATE_WRITE    0x01
00027 #define FILE_STATE_SCREEN   0x02
00028 #define FILE_STATE_IMAGE    0x04
00029 #define FILE_STATE_READ     0x08
00030 
00031 #define IS_READABLE(Private)    (Private->FileState & FILE_STATE_READ)
00032 #define IS_WRITEABLE(Private)   (Private->FileState & FILE_STATE_WRITE)
00033 
00034 typedef struct GifFilePrivateType {
00035     GifWord FileState, FileHandle,  /* Where all this data goes to! */
00036       BitsPerPixel,     /* Bits per pixel (Codes uses at least this + 1). */
00037       ClearCode,   /* The CLEAR LZ code. */
00038       EOFCode,     /* The EOF LZ code. */
00039       RunningCode, /* The next code algorithm can generate. */
00040       RunningBits, /* The number of bits required to represent RunningCode. */
00041       MaxCode1,    /* 1 bigger than max. possible code, in RunningBits bits. */
00042       LastCode,    /* The code before the current code. */
00043       CrntCode,    /* Current algorithm code. */
00044       StackPtr,    /* For character stack (see below). */
00045       CrntShiftState;    /* Number of bits in CrntShiftDWord. */
00046     unsigned long CrntShiftDWord;   /* For bytes decomposition into codes. */
00047     unsigned long PixelCount;   /* Number of pixels in image. */
00048     FILE *File;    /* File as stream. */
00049     InputFunc Read;     /* function to read gif input (TVT) */
00050     OutputFunc Write;   /* function to write gif output (MRB) */
00051     GifByteType Buf[256];   /* Compressed input is buffered here. */
00052     GifByteType Stack[LZ_MAX_CODE]; /* Decoded pixels are stacked here. */
00053     GifByteType Suffix[LZ_MAX_CODE + 1];    /* So we can trace the codes. */
00054     GifPrefixType Prefix[LZ_MAX_CODE + 1];
00055 } GifFilePrivateType;
00056 
00057 extern int _GifError;
00058 
00059 #endif /* _GIF_LIB_PRIVATE_H */

Generated on Wed Dec 12 23:46:34 2007 for XFlib by  doxygen 1.5.4