⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 libmng_trace.c

📁 一款最完整的工业组态软源代码
💻 C
📖 第 1 页 / 共 5 页
字号:
/* ************************************************************************** */
/* *             For conditions of distribution and use,                    * */
/* *                see copyright notice in libmng.h                        * */
/* ************************************************************************** */
/* *                                                                        * */
/* * project   : libmng                                                     * */
/* * file      : libmng_trace.c            copyright (c) 2000-2004 G.Juyn   * */
/* * version   : 1.0.8                                                      * */
/* *                                                                        * */
/* * purpose   : Trace functions (implementation)                           * */
/* *                                                                        * */
/* * author    : G.Juyn                                                     * */
/* *                                                                        * */
/* * comment   : implementation of the trace functions                      * */
/* *                                                                        * */
/* * changes   : 0.5.1 - 05/08/2000 - G.Juyn                                * */
/* *             - changed strict-ANSI stuff                                * */
/* *             0.5.1 - 05/12/2000 - G.Juyn                                * */
/* *             - added callback error-reporting support                   * */
/* *                                                                        * */
/* *             0.5.2 - 05/23/2000 - G.Juyn                                * */
/* *             - added trace telltale reporting                           * */
/* *             0.5.2 - 05/24/2000 - G.Juyn                                * */
/* *             - added tracestrings for global animation color-chunks     * */
/* *             - added tracestrings for get/set of default ZLIB/IJG parms * */
/* *             - added tracestrings for global PLTE,tRNS,bKGD             * */
/* *             0.5.2 - 05/30/2000 - G.Juyn                                * */
/* *             - added tracestrings for image-object promotion            * */
/* *             - added tracestrings for delta-image processing            * */
/* *             0.5.2 - 06/02/2000 - G.Juyn                                * */
/* *             - added tracestrings for getalphaline callback             * */
/* *             0.5.2 - 06/05/2000 - G.Juyn                                * */
/* *             - added tracestring for RGB8_A8 canvasstyle                * */
/* *             0.5.2 - 06/06/2000 - G.Juyn                                * */
/* *             - added tracestring for mng_read_resume HLAPI function     * */
/* *                                                                        * */
/* *             0.5.3 - 06/21/2000 - G.Juyn                                * */
/* *             - added tracestrings for get/set speedtype                 * */
/* *             - added tracestring for get imagelevel                     * */
/* *             0.5.3 - 06/22/2000 - G.Juyn                                * */
/* *             - added tracestring for delta-image processing             * */
/* *             - added tracestrings for PPLT chunk processing             * */
/* *                                                                        * */
/* *             0.9.1 - 07/07/2000 - G.Juyn                                * */
/* *             - added tracecodes for special display processing          * */
/* *             0.9.1 - 07/08/2000 - G.Juyn                                * */
/* *             - added tracestring for get/set suspensionmode             * */
/* *             - added tracestrings for get/set display variables         * */
/* *             - added tracecode for read_databuffer (I/O-suspension)     * */
/* *             0.9.1 - 07/15/2000 - G.Juyn                                * */
/* *             - added tracestrings for SAVE/SEEK callbacks               * */
/* *             - added tracestrings for get/set sectionbreaks             * */
/* *             - added tracestring for special error routine              * */
/* *             0.9.1 - 07/19/2000 - G.Juyn                                * */
/* *             - added tracestring for updatemngheader                    * */
/* *                                                                        * */
/* *             0.9.2 - 07/31/2000 - G.Juyn                                * */
/* *             - added tracestrings for status_xxxxx functions            * */
/* *             0.9.2 - 08/05/2000 - G.Juyn                                * */
/* *             - changed file-prefixes                                    * */
/* *             - added tracestring for updatemngsimplicity                * */
/* *                                                                        * */
/* *             0.9.3 - 08/26/2000 - G.Juyn                                * */
/* *             - added MAGN chunk                                         * */
/* *             0.9.3 - 09/07/2000 - G.Juyn                                * */
/* *             - added support for new filter_types                       * */
/* *             0.9.3 - 10/10/2000 - G.Juyn                                * */
/* *             - added support for alpha-depth prediction                 * */
/* *             0.9.3 - 10/11/2000 - G.Juyn                                * */
/* *             - added JDAA chunk                                         * */
/* *             - added support for nEED                                   * */
/* *             0.9.3 - 10/16/2000 - G.Juyn                                * */
/* *             - added functions to retrieve PNG/JNG specific header-info * */
/* *             - added optional support for bKGD for PNG images           * */
/* *             0.9.3 - 10/17/2000 - G.Juyn                                * */
/* *             - added callback to process non-critical unknown chunks    * */
/* *             - added routine to discard "invalid" objects               * */
/* *             0.9.3 - 10/19/2000 - G.Juyn                                * */
/* *             - implemented delayed delta-processing                     * */
/* *             0.9.3 - 10/20/2000 - G.Juyn                                * */
/* *             - added get/set for bKGD preference setting                * */
/* *             0.9.3 - 10/21/2000 - G.Juyn                                * */
/* *             - added get function for interlace/progressive display     * */
/* *                                                                        * */
/* *             0.9.4 -  1/18/2001 - G.Juyn                                * */
/* *             - added "new" MAGN methods 3, 4 & 5                        * */
/* *                                                                        * */
/* *             1.0.1 - 02/08/2001 - G.Juyn                                * */
/* *             - added MEND processing callback                           * */
/* *             1.0.1 - 04/21/2001 - G.Juyn (code by G.Kelly)              * */
/* *             - added BGRA8 canvas with premultiplied alpha              * */
/* *             1.0.1 - 05/02/2001 - G.Juyn                                * */
/* *             - added "default" sRGB generation (Thanks Marti!)          * */
/* *                                                                        * */
/* *             1.0.2 - 06/23/2001 - G.Juyn                                * */
/* *             - added optimization option for MNG-video playback         * */
/* *             - added processterm callback                               * */
/* *             1.0.2 - 06/25/2001 - G.Juyn                                * */
/* *             - added option to turn off progressive refresh             * */
/* *                                                                        * */
/* *             1.0.3 - 08/06/2001 - G.Juyn                                * */
/* *             - added get function for last processed BACK chunk         * */
/* *                                                                        * */
/* *             1.0.5 - 08/15/2002 - G.Juyn                                * */
/* *             - completed PROM support                                   * */
/* *             - completed delta-image support                            * */
/* *             1.0.5 - 08/19/2002 - G.Juyn                                * */
/* *             - B597134 - libmng pollutes the linker namespace           * */
/* *             - added HLAPI function to copy chunks                      * */
/* *             1.0.5 - 09/14/2002 - G.Juyn                                * */
/* *             - added event handling for dynamic MNG                     * */
/* *             1.0.5 - 09/20/2002 - G.Juyn                                * */
/* *             - added support for PAST                                   * */
/* *             1.0.5 - 09/22/2002 - G.Juyn                                * */
/* *             - added bgrx8 canvas (filler byte)                         * */
/* *             1.0.5 - 09/23/2002 - G.Juyn                                * */
/* *             - added in-memory color-correction of abstract images      * */
/* *             - added compose over/under routines for PAST processing    * */
/* *             - added flip & tile routines for PAST processing           * */
/* *             1.0.5 - 10/09/2002 - G.Juyn                                * */
/* *             - fixed trace-constants for PAST chunk                     * */
/* *             1.0.5 - 11/07/2002 - G.Juyn                                * */
/* *             - added support to get totals after mng_read()             * */
/* *                                                                        * */
/* *             1.0.6 - 07/07/2003 - G.R-P                                 * */
/* *             - added conditionals around JNG and Delta-PNG code         * */
/* *             1.0.6 - 07/14/2003 - G.R-P                                 * */
/* *             - added conditionals around various unused functions       * */
/* *             1.0.6 - 07/29/2003 - G.R-P                                 * */
/* *             - added conditionals around PAST chunk support             * */
/* *                                                                        * */
/* *             1.0.7 - 11/27/2003 - R.A                                   * */
/* *             - added CANVAS_RGB565 and CANVAS_BGR565                    * */
/* *             1.0.7 - 01/25/2004 - J.S                                   * */
/* *             - added premultiplied alpha canvas' for RGBA, ARGB, ABGR   * */
/* *             1.0.7 - 03/07/2004 - G. Randers-Pehrson                    * */
/* *             - put gamma, cms-related declarations inside #ifdef        * */
/* *             1.0.7 - 03/10/2004 - G.R-P                                 * */
/* *             - added conditionals around openstream/closestream         * */
/* *                                                                        * */
/* *             1.0.8 - 04/02/2004 - G.Juyn                                * */
/* *             - added CRC existence & checking flags                     * */
/* *             1.0.8 - 04/11/2004 - G.Juyn                                * */
/* *             - added data-push mechanisms for specialized decoders      * */
/* *                                                                        * */
/* ************************************************************************** */

#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_TRACE_PROCS

/* ************************************************************************** */

#ifdef MNG_INCLUDE_TRACE_STRINGS
MNG_LOCAL mng_trace_entry const trace_table [] =
  {
    {MNG_FN_INITIALIZE,                "initialize"},
    {MNG_FN_RESET,                     "reset"},
    {MNG_FN_CLEANUP,                   "cleanup"},
    {MNG_FN_READ,                      "read"},
    {MNG_FN_WRITE,                     "write"},
    {MNG_FN_CREATE,                    "create"},
    {MNG_FN_READDISPLAY,               "readdisplay"},
    {MNG_FN_DISPLAY,                   "display"},
    {MNG_FN_DISPLAY_RESUME,            "display_resume"},
    {MNG_FN_DISPLAY_FREEZE,            "display_freeze"},
    {MNG_FN_DISPLAY_RESET,             "display_reset"},
#ifndef MNG_NO_DISPLAY_GO_SUPPORTED
    {MNG_FN_DISPLAY_GOFRAME,           "display_goframe"},
    {MNG_FN_DISPLAY_GOLAYER,           "display_golayer"},
    {MNG_FN_DISPLAY_GOTIME,            "display_gotime"},
#endif
    {MNG_FN_GETLASTERROR,              "getlasterror"},
    {MNG_FN_READ_RESUME,               "read_resume"},
    {MNG_FN_TRAPEVENT,                 "trapevent"},
    {MNG_FN_READ_PUSHDATA,             "read_pushdata"},
    {MNG_FN_READ_PUSHSIG,              "read_pushsig"},
    {MNG_FN_READ_PUSHCHUNK,            "read_pushchunk"},

    {MNG_FN_SETCB_MEMALLOC,            "setcb_memalloc"},
    {MNG_FN_SETCB_MEMFREE,             "setcb_memfree"},
    {MNG_FN_SETCB_READDATA,            "setcb_readdata"},
    {MNG_FN_SETCB_WRITEDATA,           "setcb_writedata"},
    {MNG_FN_SETCB_ERRORPROC,           "setcb_errorproc"},
    {MNG_FN_SETCB_TRACEPROC,           "setcb_traceproc"},
    {MNG_FN_SETCB_PROCESSHEADER,       "setcb_processheader"},
    {MNG_FN_SETCB_PROCESSTEXT,         "setcb_processtext"},
    {MNG_FN_SETCB_GETCANVASLINE,       "setcb_getcanvasline"},
    {MNG_FN_SETCB_GETBKGDLINE,         "setcb_getbkgdline"},
    {MNG_FN_SETCB_REFRESH,             "setcb_refresh"},
    {MNG_FN_SETCB_GETTICKCOUNT,        "setcb_gettickcount"},
    {MNG_FN_SETCB_SETTIMER,            "setcb_settimer"},
    {MNG_FN_SETCB_PROCESSGAMMA,        "setcb_processgamma"},
    {MNG_FN_SETCB_PROCESSCHROMA,       "setcb_processchroma"},
    {MNG_FN_SETCB_PROCESSSRGB,         "setcb_processsrgb"},
    {MNG_FN_SETCB_PROCESSICCP,         "setcb_processiccp"},
    {MNG_FN_SETCB_PROCESSAROW,         "setcb_processarow"},
#ifndef MNG_NO_OPEN_CLOSE_STREAM
    {MNG_FN_SETCB_OPENSTREAM,          "setcb_openstream"},
    {MNG_FN_SETCB_CLOSESTREAM,         "setcb_closestream"},
#endif
    {MNG_FN_SETCB_GETALPHALINE,        "setcb_getalphaline"},
    {MNG_FN_SETCB_PROCESSSAVE,         "setcb_processsave"},
    {MNG_FN_SETCB_PROCESSSEEK,         "setcb_processseek"},
    {MNG_FN_SETCB_PROCESSNEED,         "setcb_processneed"},
    {MNG_FN_SETCB_PROCESSUNKNOWN,      "setcb_processunknown"},
    {MNG_FN_SETCB_PROCESSMEND,         "setcb_processmend"},
    {MNG_FN_SETCB_PROCESSTERM,         "setcb_processterm"},
    {MNG_FN_SETCB_RELEASEDATA,         "setcb_releasedata"},

    {MNG_FN_GETCB_MEMALLOC,            "getcb_memalloc"},
    {MNG_FN_GETCB_MEMFREE,             "getcb_memfree"},
    {MNG_FN_GETCB_READDATA,            "getcb_readdata,"},
    {MNG_FN_GETCB_WRITEDATA,           "getcb_writedata"},
    {MNG_FN_GETCB_ERRORPROC,           "getcb_errorproc"},
    {MNG_FN_GETCB_TRACEPROC,           "getcb_traceproc"},
    {MNG_FN_GETCB_PROCESSHEADER,       "getcb_processheader"},
    {MNG_FN_GETCB_PROCESSTEXT,         "getcb_processtext"},
    {MNG_FN_GETCB_GETCANVASLINE,       "getcb_getcanvasline"},
    {MNG_FN_GETCB_GETBKGDLINE,         "getcb_getbkgdline"},
    {MNG_FN_GETCB_REFRESH,             "getcb_refresh"},
    {MNG_FN_GETCB_GETTICKCOUNT,        "getcb_gettickcount"},
    {MNG_FN_GETCB_SETTIMER,            "getcb_settimer"},
    {MNG_FN_GETCB_PROCESSGAMMA,        "getcb_processgamma"},
    {MNG_FN_GETCB_PROCESSCHROMA,       "getcb_processchroma"},
    {MNG_FN_GETCB_PROCESSSRGB,         "getcb_processsrgb"},
    {MNG_FN_GETCB_PROCESSICCP,         "getcb_processiccp"},
    {MNG_FN_GETCB_PROCESSAROW,         "getcb_processarow"},
#ifndef MNG_NO_OPEN_CLOSE_STREAM
    {MNG_FN_GETCB_OPENSTREAM,          "getcb_openstream"},
    {MNG_FN_GETCB_CLOSESTREAM,         "getcb_closestream"},
#endif
    {MNG_FN_GETCB_GETALPHALINE,        "getcb_getalphaline"},
    {MNG_FN_GETCB_PROCESSSAVE,         "getcb_processsave"},
    {MNG_FN_GETCB_PROCESSSEEK,         "getcb_processseek"},
    {MNG_FN_GETCB_PROCESSNEED,         "getcb_processneed"},
    {MNG_FN_GETCB_PROCESSUNKNOWN,      "getcb_processunknown"},
    {MNG_FN_GETCB_PROCESSMEND,         "getcb_processmend"},
    {MNG_FN_GETCB_PROCESSTERM,         "getcb_processterm"},
    {MNG_FN_GETCB_RELEASEDATA,         "getcb_releasedata"},

    {MNG_FN_SET_USERDATA,              "set_userdata"},
    {MNG_FN_SET_CANVASSTYLE,           "set_canvasstyle"},
    {MNG_FN_SET_BKGDSTYLE,             "set_bkgdstyle"},

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -