File: gif.h

package info (click to toggle)
xli 1.17.0+20061110-5
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 1,540 kB
  • sloc: ansic: 25,840; makefile: 11
file content (108 lines) | stat: -rw-r--r-- 3,358 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
/* #ident	"@(#)x11:contrib/clients/xloadimage/gif.h 6.9 93/07/23 Labtam" */
/* gif.h:
 *
 * gifin.h
 * kirk johnson
 * november 1989
 * external interface to gifin.c
 *
 * Copyright 1989 Kirk L. Johnson (see the included file
 * "kljcpyrght.h" for complete copyright information)
 */

/*
 * gifin return codes
 */
#define GIFIN_SUCCESS       0   /* success */
#define GIFIN_DONE          1   /* no more images */

#define GIFIN_ERR_BAD_SD   -1   /* bad screen descriptor */
#define GIFIN_ERR_BAD_SEP  -2   /* bad image separator */
#define GIFIN_ERR_BAD_SIG  -3   /* bad signature */
#define GIFIN_ERR_EOD      -4   /* unexpected end of raster data */
#define GIFIN_ERR_EOF      -5   /* unexpected end of input stream */
#define GIFIN_ERR_FAO      -6   /* file already open */
#define GIFIN_ERR_IAO      -7   /* image already open */
#define GIFIN_ERR_NFO      -8   /* no file open */
#define GIFIN_ERR_NIO      -9   /* no image open */
#define GIFIN_ERR_PSO      -10  /* pixel stack overflow */
#define GIFIN_ERR_TAO      -11  /* table overflow */
#define GIFIN_ERR_BAD_DES  -12  /* bad image descriptor */

#define GIFIN_ERR_BAD_SD_STR   "Bad screen descriptor"
#define GIFIN_ERR_BAD_SEP_STR  "Bad image separator"
#define GIFIN_ERR_BAD_SIG_STR  "Bad signature"
#define GIFIN_ERR_EOD_STR      "Unexpected end of raster data"
#define GIFIN_ERR_EOF_STR      "Unexpected end of input stream"
#define GIFIN_ERR_FAO_STR      "File already open"
#define GIFIN_ERR_IAO_STR      "Image already open"
#define GIFIN_ERR_NFO_STR      "No file open"
#define GIFIN_ERR_NIO_STR      "No image open"
#define GIFIN_ERR_PSO_STR      "Pixel stack overflow"
#define GIFIN_ERR_TAO_STR      "Table overflow"
#define GIFIN_ERR_BAD_DES_STR  "Bad image descriptor"

typedef struct {
    int err_no;
    char *name;
    } gif_err_string;

#ifdef GIF_C
gif_err_string gif_err_strings[] = {
	{GIFIN_ERR_BAD_SD, GIFIN_ERR_BAD_SD_STR},
	{GIFIN_ERR_BAD_SEP, GIFIN_ERR_BAD_SEP_STR},
	{GIFIN_ERR_BAD_SIG, GIFIN_ERR_BAD_SIG_STR},
	{GIFIN_ERR_EOD, GIFIN_ERR_EOD_STR},
	{GIFIN_ERR_EOF, GIFIN_ERR_EOF_STR},
	{GIFIN_ERR_FAO, GIFIN_ERR_FAO_STR},
	{GIFIN_ERR_IAO, GIFIN_ERR_IAO_STR},
	{GIFIN_ERR_NFO, GIFIN_ERR_NFO_STR},
	{GIFIN_ERR_NIO, GIFIN_ERR_NIO_STR},
	{GIFIN_ERR_PSO, GIFIN_ERR_PSO_STR},
	{GIFIN_ERR_TAO, GIFIN_ERR_TAO_STR},
	{GIFIN_ERR_BAD_DES, GIFIN_ERR_BAD_DES_STR},
	{0}
    };
#endif

/*
 * colormap indices 
 */

#define GIF_RED  0
#define GIF_GRN  1
#define GIF_BLU  2

/*
 * typedef BYTE for convenience
 */

typedef unsigned char BYTE;

/* #defines, typedefs, and such */

#define GIF_SIG      "GIF87a"
#define GIF_SIG_89   "GIF89a"

#define GIF87a 0                /* Gif file version type */
#define GIF89a 1                /* Gif file version type */

#define GIF_SIG_LEN  6          /* GIF signature length */
#define GIF_SD_SIZE  7          /* GIF screen descriptor size */
#define GIF_ID_SIZE  9          /* GIF image descriptor size */

#define GIF_SEPARATOR   ','     /* GIF image separator */
#define GIF_EXTENSION   '!'     /* GIF extension block marker */
#define GIF_TERMINATOR  ';'     /* GIF terminator */

#define STAB_SIZE  4096         /* string table size */
#define PSTK_SIZE  4096         /* pixel stack size */

#define NULL_CODE  -1           /* string table null code */

#ifdef GIF_C
char *gif_version_name[] = {
    GIF_SIG,
    GIF_SIG_89
    };
#endif