Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/src/java.desktop/share/native/libsplashscreen/giflib/gif_err.c
41153 views
1
/*
2
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3
*
4
* This code is free software; you can redistribute it and/or modify it
5
* under the terms of the GNU General Public License version 2 only, as
6
* published by the Free Software Foundation. Oracle designates this
7
* particular file as subject to the "Classpath" exception as provided
8
* by Oracle in the LICENSE file that accompanied this code.
9
*
10
* This code is distributed in the hope that it will be useful, but WITHOUT
11
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13
* version 2 for more details (a copy is included in the LICENSE file that
14
* accompanied this code).
15
*
16
* You should have received a copy of the GNU General Public License version
17
* 2 along with this work; if not, write to the Free Software Foundation,
18
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19
*
20
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21
* or visit www.oracle.com if you need additional information or have any
22
* questions.
23
*/
24
25
/*****************************************************************************
26
27
gif_err.c - handle error reporting for the GIF library.
28
29
SPDX-License-Identifier: MIT
30
31
****************************************************************************/
32
33
#include <stdio.h>
34
35
#include "gif_lib.h"
36
#include "gif_lib_private.h"
37
38
/*****************************************************************************
39
Return a string description of the last GIF error
40
*****************************************************************************/
41
const char *
42
GifErrorString(int ErrorCode)
43
{
44
const char *Err;
45
46
switch (ErrorCode) {
47
case E_GIF_ERR_OPEN_FAILED:
48
Err = "Failed to open given file";
49
break;
50
case E_GIF_ERR_WRITE_FAILED:
51
Err = "Failed to write to given file";
52
break;
53
case E_GIF_ERR_HAS_SCRN_DSCR:
54
Err = "Screen descriptor has already been set";
55
break;
56
case E_GIF_ERR_HAS_IMAG_DSCR:
57
Err = "Image descriptor is still active";
58
break;
59
case E_GIF_ERR_NO_COLOR_MAP:
60
Err = "Neither global nor local color map";
61
break;
62
case E_GIF_ERR_DATA_TOO_BIG:
63
Err = "Number of pixels bigger than width * height";
64
break;
65
case E_GIF_ERR_NOT_ENOUGH_MEM:
66
Err = "Failed to allocate required memory";
67
break;
68
case E_GIF_ERR_DISK_IS_FULL:
69
Err = "Write failed (disk full?)";
70
break;
71
case E_GIF_ERR_CLOSE_FAILED:
72
Err = "Failed to close given file";
73
break;
74
case E_GIF_ERR_NOT_WRITEABLE:
75
Err = "Given file was not opened for write";
76
break;
77
case D_GIF_ERR_OPEN_FAILED:
78
Err = "Failed to open given file";
79
break;
80
case D_GIF_ERR_READ_FAILED:
81
Err = "Failed to read from given file";
82
break;
83
case D_GIF_ERR_NOT_GIF_FILE:
84
Err = "Data is not in GIF format";
85
break;
86
case D_GIF_ERR_NO_SCRN_DSCR:
87
Err = "No screen descriptor detected";
88
break;
89
case D_GIF_ERR_NO_IMAG_DSCR:
90
Err = "No Image Descriptor detected";
91
break;
92
case D_GIF_ERR_NO_COLOR_MAP:
93
Err = "Neither global nor local color map";
94
break;
95
case D_GIF_ERR_WRONG_RECORD:
96
Err = "Wrong record type detected";
97
break;
98
case D_GIF_ERR_DATA_TOO_BIG:
99
Err = "Number of pixels bigger than width * height";
100
break;
101
case D_GIF_ERR_NOT_ENOUGH_MEM:
102
Err = "Failed to allocate required memory";
103
break;
104
case D_GIF_ERR_CLOSE_FAILED:
105
Err = "Failed to close given file";
106
break;
107
case D_GIF_ERR_NOT_READABLE:
108
Err = "Given file was not opened for read";
109
break;
110
case D_GIF_ERR_IMAGE_DEFECT:
111
Err = "Image is defective, decoding aborted";
112
break;
113
case D_GIF_ERR_EOF_TOO_SOON:
114
Err = "Image EOF detected before image complete";
115
break;
116
default:
117
Err = NULL;
118
break;
119
}
120
return Err;
121
}
122
123
/* end */
124
125