📄 libmng_error.c
字号:
/* ************************************************************************** */
/* * For conditions of distribution and use, * */
/* * see copyright notice in libmng.h * */
/* ************************************************************************** */
/* * * */
/* * project : libmng * */
/* * file : libmng_error.c copyright (c) 2000-2004 G.Juyn * */
/* * version : 1.0.7 * */
/* * * */
/* * purpose : Error routines (implementation) * */
/* * * */
/* * author : G.Juyn * */
/* * * */
/* * comment : implementation of the general error handling routines * */
/* * * */
/* * changes : 0.5.1 - 05/08/2000 - G.Juyn * */
/* * - changed strict-ANSI stuff * */
/* * * */
/* * 0.5.2 - 05/23/2000 - G.Juyn * */
/* * - added error telltaling * */
/* * 0.5.2 - 05/30/2000 - G.Juyn * */
/* * - added errorstrings for delta-image processing * */
/* * 0.5.2 - 05/31/2000 - G.Juyn * */
/* * - fixed up punctuation (contributed by Tim Rowley) * */
/* * 0.5.2 - 06/06/2000 - G.Juyn * */
/* * - added errorstring for delayed buffer-processing * */
/* * * */
/* * 0.9.1 - 07/06/2000 - G.Juyn * */
/* * - added MNG_NEEDTIMERWAIT errorstring * */
/* * 0.9.1 - 07/15/2000 - G.Juyn * */
/* * - added NEEDSECTIONWAIT errorstring * */
/* * - added macro + routine to set returncode without * */
/* * calling error callback * */
/* * 0.9.1 - 07/19/2000 - G.Juyn * */
/* * - added errorstring for updatemngheader if not a MNG * */
/* * * */
/* * 0.9.2 - 08/05/2000 - G.Juyn * */
/* * - changed file-prefixes * */
/* * * */
/* * 0.9.3 - 08/09/2000 - G.Juyn * */
/* * - added check for simplicity-bits in MHDR * */
/* * 0.9.3 - 10/11/2000 - G.Juyn * */
/* * - fixed processing of unknown critical chunks * */
/* * - added support for nEED * */
/* * 0.9.3 - 10/20/2000 - G.Juyn * */
/* * - added errorcode for delayed delta-processing * */
/* * * */
/* * 0.9.4 - 01/18/2001 - G.Juyn * */
/* * - added errorcode for MAGN methods * */
/* * * */
/* * 1.0.2 - 06/23/2001 - G.Juyn * */
/* * - added optimization option for MNG-video playback * */
/* * * */
/* * 1.0.5 - 07/04/2002 - G.Juyn * */
/* * - added errorcode for extreme chunk-sizes * */
/* * 1.0.5 - 08/15/2002 - G.Juyn * */
/* * - completed delta-image support * */
/* * 1.0.5 - 08/19/2002 - G.Juyn * */
/* * - B597134 - libmng pollutes the linker namespace * */
/* * 1.0.5 - 09/14/2002 - G.Juyn * */
/* * - added event handling for dynamic MNG * */
/* * 1.0.5 - 09/15/2002 - G.Juyn * */
/* * - fixed LOOP iteration=0 special case * */
/* * 1.0.5 - 09/19/2002 - G.Juyn * */
/* * - warnings are ignored by default now! * */
/* * 1.0.5 - 09/20/2002 - G.Juyn * */
/* * - added support for PAST * */
/* * 1.0.5 - 10/07/2002 - G.Juyn * */
/* * - added check for TERM placement during create/write * */
/* * * */
/* * 1.0.6 - 07/07/2003 - G. R-P * */
/* * - added MNG_SKIPCHUNK_CHNK, MNG_NO_DELTA_PNG reductions. * */
/* * - skipped more code when MNG_INCLUDE_JNG is not enabled. * */
/* * 1.0.6 - 07/29/2003 - G.R-P * */
/* * - added conditional around evNT chunk support * */
/* * * */
/* * 1.0.7 - 03/24/2004 - G.R-P * */
/* * - fixed typo on SKIPCHUNK_evNT (->PAST) * */
/* * * */
/* ************************************************************************** */
#include "libmng.h"
#include "libmng_data.h"
#include "libmng_error.h"
#include "libmng_trace.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#if defined(__BORLANDC__) && defined(MNG_STRICT_ANSI)
#pragma option -A /* force ANSI-C */
#endif
/* ************************************************************************** */
#ifdef MNG_INCLUDE_ERROR_STRINGS
MNG_LOCAL mng_error_entry const error_table [] =
{
{MNG_NOERROR, "No error"},
{MNG_OUTOFMEMORY, "Out of memory"},
{MNG_INVALIDHANDLE, "The handle is invalid"},
{MNG_NOCALLBACK, "A required callback is not defined"},
{MNG_UNEXPECTEDEOF, "Encountered unexpected end-of-file"},
{MNG_ZLIBERROR, "zlib encountered an error"},
#ifdef MNG_INCLUDE_JNG
{MNG_JPEGERROR, "ijgsrc6b encountered an error"},
#endif
{MNG_LCMSERROR, "lcms encountered an error"},
{MNG_NOOUTPUTPROFILE, "No output-profile defined for CMS"},
{MNG_NOSRGBPROFILE, "No sRGB-profile defined for CMS"},
{MNG_BUFOVERFLOW, "Internal buffer-overflow"},
{MNG_FUNCTIONINVALID, "Function is invalid at this point"},
{MNG_OUTPUTERROR, "Writing was unsuccessful; disk full?"},
{MNG_JPEGBUFTOOSMALL, "Internal buffer for JPEG processing too small"},
{MNG_NEEDMOREDATA, "Reading suspended; waiting for I/O to catch up"},
{MNG_NEEDTIMERWAIT, "Timer suspension; normal animation delay"},
{MNG_NEEDSECTIONWAIT, "SEEK suspension; application decides"},
{MNG_LOOPWITHCACHEOFF, "LOOP encountered when playback cache is turned off"},
{MNG_APPIOERROR, "Application signalled I/O error"},
{MNG_APPTIMERERROR, "Application signalled timing error"},
{MNG_APPCMSERROR, "Application signalled CMS error"},
{MNG_APPMISCERROR, "Application signalled an error"},
{MNG_APPTRACEABORT, "Application signalled error during trace-callback"},
{MNG_INTERNALERROR, "Internal error in libmng"},
{MNG_INVALIDSIG, "The signature is invalid"},
{MNG_INVALIDCRC, "The CRC for this chunk is invalid"},
{MNG_INVALIDLENGTH, "Chunk-length is invalid"},
{MNG_SEQUENCEERROR, "Chunk out of sequence"},
{MNG_CHUNKNOTALLOWED, "Chunk not allowed at this point"},
{MNG_MULTIPLEERROR, "Chunk cannot occur multiple times"},
{MNG_PLTEMISSING, "Missing PLTE chunk"},
{MNG_IDATMISSING, "Missing IDAT chunk(s)"},
{MNG_CANNOTBEEMPTY, "Chunk cannot be empty"},
{MNG_GLOBALLENGTHERR, "Global data length invalid"},
{MNG_INVALIDBITDEPTH, "The bit_depth is invalid"},
{MNG_INVALIDCOLORTYPE, "The color_type is invalid"},
{MNG_INVALIDCOMPRESS, "The compression_method is invalid"},
{MNG_INVALIDFILTER, "The filter_method or filter_type is invalid"},
{MNG_INVALIDINTERLACE, "The interlace_method is invalid"},
{MNG_NOTENOUGHIDAT, "There is not enough data in the IDAT chunk(s)"},
{MNG_PLTEINDEXERROR, "Palette-index out of bounds"},
{MNG_NULLNOTFOUND, "NULL separator not found"},
{MNG_KEYWORDNULL, "Keyword cannot be zero-length"},
{MNG_OBJECTUNKNOWN, "Object does not exist"},
{MNG_OBJECTEXISTS, "Object already exists"},
{MNG_TOOMUCHIDAT, "Too much data in IDAT chunk(s)"},
{MNG_INVSAMPLEDEPTH, "The sample_depth is invalid"},
{MNG_INVOFFSETSIZE, "The offset_type is invalid"},
{MNG_INVENTRYTYPE, "The entry_type is invalid"},
{MNG_ENDWITHNULL, "Chunk must not end with NULL byte"},
{MNG_INVIMAGETYPE, "The image_type is invalid"},
#ifndef MNG_NO_DELTA_PNG
{MNG_INVDELTATYPE, "The delta_type is invalid"},
#endif
{MNG_INVALIDINDEX, "Index-value out of bounds"},
#ifdef MNG_INCLUDE_JNG
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -