Path: blob/master/src/java.desktop/share/native/libsplashscreen/giflib/gif_err.c
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_err.c - handle error reporting for the GIF library.2728SPDX-License-Identifier: MIT2930****************************************************************************/3132#include <stdio.h>3334#include "gif_lib.h"35#include "gif_lib_private.h"3637/*****************************************************************************38Return a string description of the last GIF error39*****************************************************************************/40const char *41GifErrorString(int ErrorCode)42{43const char *Err;4445switch (ErrorCode) {46case E_GIF_ERR_OPEN_FAILED:47Err = "Failed to open given file";48break;49case E_GIF_ERR_WRITE_FAILED:50Err = "Failed to write to given file";51break;52case E_GIF_ERR_HAS_SCRN_DSCR:53Err = "Screen descriptor has already been set";54break;55case E_GIF_ERR_HAS_IMAG_DSCR:56Err = "Image descriptor is still active";57break;58case E_GIF_ERR_NO_COLOR_MAP:59Err = "Neither global nor local color map";60break;61case E_GIF_ERR_DATA_TOO_BIG:62Err = "Number of pixels bigger than width * height";63break;64case E_GIF_ERR_NOT_ENOUGH_MEM:65Err = "Failed to allocate required memory";66break;67case E_GIF_ERR_DISK_IS_FULL:68Err = "Write failed (disk full?)";69break;70case E_GIF_ERR_CLOSE_FAILED:71Err = "Failed to close given file";72break;73case E_GIF_ERR_NOT_WRITEABLE:74Err = "Given file was not opened for write";75break;76case D_GIF_ERR_OPEN_FAILED:77Err = "Failed to open given file";78break;79case D_GIF_ERR_READ_FAILED:80Err = "Failed to read from given file";81break;82case D_GIF_ERR_NOT_GIF_FILE:83Err = "Data is not in GIF format";84break;85case D_GIF_ERR_NO_SCRN_DSCR:86Err = "No screen descriptor detected";87break;88case D_GIF_ERR_NO_IMAG_DSCR:89Err = "No Image Descriptor detected";90break;91case D_GIF_ERR_NO_COLOR_MAP:92Err = "Neither global nor local color map";93break;94case D_GIF_ERR_WRONG_RECORD:95Err = "Wrong record type detected";96break;97case D_GIF_ERR_DATA_TOO_BIG:98Err = "Number of pixels bigger than width * height";99break;100case D_GIF_ERR_NOT_ENOUGH_MEM:101Err = "Failed to allocate required memory";102break;103case D_GIF_ERR_CLOSE_FAILED:104Err = "Failed to close given file";105break;106case D_GIF_ERR_NOT_READABLE:107Err = "Given file was not opened for read";108break;109case D_GIF_ERR_IMAGE_DEFECT:110Err = "Image is defective, decoding aborted";111break;112case D_GIF_ERR_EOF_TOO_SOON:113Err = "Image EOF detected before image complete";114break;115default:116Err = NULL;117break;118}119return Err;120}121122/* end */123124125