Path: blob/master/src/java.desktop/share/native/libsplashscreen/giflib/gif_lib_private.h
41153 views
/*1* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.2*3* This code is free software; you can redistribute it and/or modify it4* under the terms of the GNU General Public License version 2 only, as5* published by the Free Software Foundation. Oracle designates this6* particular file as subject to the "Classpath" exception as provided7* by Oracle in the LICENSE file that accompanied this code.8*9* This code is distributed in the hope that it will be useful, but WITHOUT10* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or11* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License12* version 2 for more details (a copy is included in the LICENSE file that13* accompanied this code).14*15* You should have received a copy of the GNU General Public License version16* 2 along with this work; if not, write to the Free Software Foundation,17* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.18*19* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA20* or visit www.oracle.com if you need additional information or have any21* questions.22*/2324/****************************************************************************2526gif_lib_private.h - internal giflib routines and structures2728SPDX-License-Identifier: MIT2930****************************************************************************/3132#ifndef _GIF_LIB_PRIVATE_H33#define _GIF_LIB_PRIVATE_H3435#include "gif_lib.h"36#include "gif_hash.h"3738#ifndef SIZE_MAX39#define SIZE_MAX UINTPTR_MAX40#endif4142#define EXTENSION_INTRODUCER 0x2143#define DESCRIPTOR_INTRODUCER 0x2c44#define TERMINATOR_INTRODUCER 0x3b4546#define LZ_MAX_CODE 4095 /* Biggest code possible in 12 bits. */47#define LZ_BITS 124849#define FLUSH_OUTPUT 4096 /* Impossible code, to signal flush. */50#define FIRST_CODE 4097 /* Impossible code, to signal first. */51#define NO_SUCH_CODE 4098 /* Impossible code, to signal empty. */5253#define FILE_STATE_WRITE 0x0154#define FILE_STATE_SCREEN 0x0255#define FILE_STATE_IMAGE 0x0456#define FILE_STATE_READ 0x085758#define IS_READABLE(Private) (Private->FileState & FILE_STATE_READ)59#define IS_WRITEABLE(Private) (Private->FileState & FILE_STATE_WRITE)6061typedef struct GifFilePrivateType {62GifWord FileState, FileHandle, /* Where all this data goes to! */63BitsPerPixel, /* Bits per pixel (Codes uses at least this + 1). */64ClearCode, /* The CLEAR LZ code. */65EOFCode, /* The EOF LZ code. */66RunningCode, /* The next code algorithm can generate. */67RunningBits, /* The number of bits required to represent RunningCode. */68MaxCode1, /* 1 bigger than max. possible code, in RunningBits bits. */69LastCode, /* The code before the current code. */70CrntCode, /* Current algorithm code. */71StackPtr, /* For character stack (see below). */72CrntShiftState; /* Number of bits in CrntShiftDWord. */73unsigned long CrntShiftDWord; /* For bytes decomposition into codes. */74unsigned long PixelCount; /* Number of pixels in image. */75FILE *File; /* File as stream. */76InputFunc Read; /* function to read gif input (TVT) */77OutputFunc Write; /* function to write gif output (MRB) */78GifByteType Buf[256]; /* Compressed input is buffered here. */79GifByteType Stack[LZ_MAX_CODE]; /* Decoded pixels are stacked here. */80GifByteType Suffix[LZ_MAX_CODE + 1]; /* So we can trace the codes. */81GifPrefixType Prefix[LZ_MAX_CODE + 1];82GifHashTableType *HashTable;83bool gif89;84} GifFilePrivateType;8586#ifndef HAVE_REALLOCARRAY87extern void *openbsd_reallocarray(void *optr, size_t nmemb, size_t size);88#define reallocarray openbsd_reallocarray89#endif9091#endif /* _GIF_LIB_PRIVATE_H */9293/* end */949596