1 /*****************************************************************************
2 * "Gif-Lib" - Yet another gif library.
4 * Written by: Gershon Elber IBM PC Ver 0.1, Jun. 1989
5 *****************************************************************************
6 * Handle error reporting for the GIF library.
7 *****************************************************************************
9 * 17 Jun 89 - Version 1.0 by Gershon Elber.
10 ****************************************************************************/
21 /*****************************************************************************
22 * Return the last GIF error (0 if none) and reset the error.
23 ****************************************************************************/
32 #ifndef _GBA_NO_FILEIO
34 /*****************************************************************************
35 * Print the last GIF error to stderr.
36 ****************************************************************************/
42 case E_GIF_ERR_OPEN_FAILED
:
43 Err
= "Failed to open given file";
45 case E_GIF_ERR_WRITE_FAILED
:
46 Err
= "Failed to Write to given file";
48 case E_GIF_ERR_HAS_SCRN_DSCR
:
49 Err
= "Screen Descriptor already been set";
51 case E_GIF_ERR_HAS_IMAG_DSCR
:
52 Err
= "Image Descriptor is still active";
54 case E_GIF_ERR_NO_COLOR_MAP
:
55 Err
= "Neither Global Nor Local color map";
57 case E_GIF_ERR_DATA_TOO_BIG
:
58 Err
= "#Pixels bigger than Width * Height";
60 case E_GIF_ERR_NOT_ENOUGH_MEM
:
61 Err
= "Fail to allocate required memory";
63 case E_GIF_ERR_DISK_IS_FULL
:
64 Err
= "Write failed (disk full?)";
66 case E_GIF_ERR_CLOSE_FAILED
:
67 Err
= "Failed to close given file";
69 case E_GIF_ERR_NOT_WRITEABLE
:
70 Err
= "Given file was not opened for write";
72 case D_GIF_ERR_OPEN_FAILED
:
73 Err
= "Failed to open given file";
75 case D_GIF_ERR_READ_FAILED
:
76 Err
= "Failed to Read from given file";
78 case D_GIF_ERR_NOT_GIF_FILE
:
79 Err
= "Given file is NOT GIF file";
81 case D_GIF_ERR_NO_SCRN_DSCR
:
82 Err
= "No Screen Descriptor detected";
84 case D_GIF_ERR_NO_IMAG_DSCR
:
85 Err
= "No Image Descriptor detected";
87 case D_GIF_ERR_NO_COLOR_MAP
:
88 Err
= "Neither Global Nor Local color map";
90 case D_GIF_ERR_WRONG_RECORD
:
91 Err
= "Wrong record type detected";
93 case D_GIF_ERR_DATA_TOO_BIG
:
94 Err
= "#Pixels bigger than Width * Height";
96 case D_GIF_ERR_NOT_ENOUGH_MEM
:
97 Err
= "Fail to allocate required memory";
99 case D_GIF_ERR_CLOSE_FAILED
:
100 Err
= "Failed to close given file";
102 case D_GIF_ERR_NOT_READABLE
:
103 Err
= "Given file was not opened for read";
105 case D_GIF_ERR_IMAGE_DEFECT
:
106 Err
= "Image is defective, decoding aborted";
108 case D_GIF_ERR_EOF_TOO_SOON
:
109 Err
= "Image EOF detected, before image complete";
116 fprintf(stderr
, "\nGIF-LIB error: %s.\n", Err
);
118 fprintf(stderr
, "\nGIF-LIB undefined error %d.\n", _GifError
);
120 #endif /* _GBA_NO_FILEIO */