<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html><head><meta name="robots" content="noindex"> <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> <title>cpl_error.h Source File</title> <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body bgcolor="#ffffff"> <!-- Generated by Doxygen 1.2.3-20001105 on Sat Dec 21 14:01:57 2002 --> <center> <a class="qindex" href="index.html">Main Page</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> <a class="qindex" href="pages.html">Related Pages</a> </center> <hr><h1>cpl_error.h</h1><a href="cpl_error_h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <font class="comment">/**********************************************************************</font> 00002 <font class="comment"> * $Id: cpl_error_h-source.html,v 1.13 2002/12/21 19:13:12 warmerda Exp $</font> 00003 <font class="comment"> *</font> 00004 <font class="comment"> * Name: cpl_error.h</font> 00005 <font class="comment"> * Project: CPL - Common Portability Library</font> 00006 <font class="comment"> * Purpose: CPL Error handling</font> 00007 <font class="comment"> * Author: Daniel Morissette, danmo@videotron.ca</font> 00008 <font class="comment"> *</font> 00009 <font class="comment"> **********************************************************************</font> 00010 <font class="comment"> * Copyright (c) 1998, Daniel Morissette</font> 00011 <font class="comment"> *</font> 00012 <font class="comment"> * Permission is hereby granted, free of charge, to any person obtaining a</font> 00013 <font class="comment"> * copy of this software and associated documentation files (the "Software"),</font> 00014 <font class="comment"> * to deal in the Software without restriction, including without limitation</font> 00015 <font class="comment"> * the rights to use, copy, modify, merge, publish, distribute, sublicense,</font> 00016 <font class="comment"> * and/or sell copies of the Software, and to permit persons to whom the</font> 00017 <font class="comment"> * Software is furnished to do so, subject to the following conditions:</font> 00018 <font class="comment"> * </font> 00019 <font class="comment"> * The above copyright notice and this permission notice shall be included</font> 00020 <font class="comment"> * in all copies or substantial portions of the Software.</font> 00021 <font class="comment"> * </font> 00022 <font class="comment"> * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</font> 00023 <font class="comment"> * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</font> 00024 <font class="comment"> * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL</font> 00025 <font class="comment"> * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</font> 00026 <font class="comment"> * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING</font> 00027 <font class="comment"> * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER </font> 00028 <font class="comment"> * DEALINGS IN THE SOFTWARE.</font> 00029 <font class="comment"> **********************************************************************</font> 00030 <font class="comment"> *</font> 00031 <font class="comment"> * $Log: cpl_error_h-source.html,v $ 00031 <font class="comment"> * Revision 1.13 2002/12/21 19:13:12 warmerda 00031 <font class="comment"> * updated 00031 <font class="comment"> *</font> 00032 <font class="comment"> * Revision 1.16 2001/11/02 22:07:58 warmerda</font> 00033 <font class="comment"> * added logging error handler</font> 00034 <font class="comment"> *</font> 00035 <font class="comment"> * Revision 1.15 2001/01/19 21:16:41 warmerda</font> 00036 <font class="comment"> * expanded tabs</font> 00037 <font class="comment"> *</font> 00038 <font class="comment"> * Revision 1.14 2000/11/30 17:30:10 warmerda</font> 00039 <font class="comment"> * added CPLGetLastErrorType</font> 00040 <font class="comment"> *</font> 00041 <font class="comment"> * Revision 1.13 2000/08/24 18:08:17 warmerda</font> 00042 <font class="comment"> * made default and quiet error handlers public on windows</font> 00043 <font class="comment"> *</font> 00044 <font class="comment"> * Revision 1.12 2000/06/26 21:44:07 warmerda</font> 00045 <font class="comment"> * added CPLE_UserInterrupt for progress terminations</font> 00046 <font class="comment"> *</font> 00047 <font class="comment"> * Revision 1.11 2000/03/31 14:11:55 warmerda</font> 00048 <font class="comment"> * added CPLErrorV</font> 00049 <font class="comment"> *</font> 00050 <font class="comment"> * Revision 1.10 2000/01/10 17:35:45 warmerda</font> 00051 <font class="comment"> * added push down stack of error handlers</font> 00052 <font class="comment"> *</font> 00053 <font class="comment"> * Revision 1.9 1999/07/23 14:27:47 warmerda</font> 00054 <font class="comment"> * CPLSetErrorHandler returns old handler</font> 00055 <font class="comment"> *</font> 00056 <font class="comment"> * Revision 1.8 1999/05/20 14:59:05 warmerda</font> 00057 <font class="comment"> * added CPLDebug()</font> 00058 <font class="comment"> *</font> 00059 <font class="comment"> * Revision 1.7 1999/05/20 02:54:38 warmerda</font> 00060 <font class="comment"> * Added API documentation</font> 00061 <font class="comment"> *</font> 00062 <font class="comment"> * Revision 1.6 1999/02/17 05:40:47 danmo</font> 00063 <font class="comment"> * Fixed CPLAssert() macro to work with EGCS.</font> 00064 <font class="comment"> *</font> 00065 <font class="comment"> * Revision 1.5 1999/01/11 15:34:29 warmerda</font> 00066 <font class="comment"> * added reserved range comment</font> 00067 <font class="comment"> *</font> 00068 <font class="comment"> * Revision 1.4 1998/12/15 19:02:27 warmerda</font> 00069 <font class="comment"> * Avoid use of errno as a variable</font> 00070 <font class="comment"> *</font> 00071 <font class="comment"> * Revision 1.3 1998/12/06 22:20:42 warmerda</font> 00072 <font class="comment"> * Added error code.</font> 00073 <font class="comment"> *</font> 00074 <font class="comment"> * Revision 1.2 1998/12/06 02:52:52 warmerda</font> 00075 <font class="comment"> * Implement assert support</font> 00076 <font class="comment"> *</font> 00077 <font class="comment"> * Revision 1.1 1998/12/03 18:26:02 warmerda</font> 00078 <font class="comment"> * New</font> 00079 <font class="comment"> *</font> 00080 <font class="comment"> **********************************************************************/</font> 00081 00082 <font class="preprocessor">#ifndef _CPL_ERROR_H_INCLUDED_</font> 00083 <font class="preprocessor"></font><font class="preprocessor">#define _CPL_ERROR_H_INCLUDED_</font> 00084 <font class="preprocessor"></font> 00085 <font class="preprocessor">#include "<a class="code" href="cpl_port_h.html">cpl_port.h</a>"</font> 00086 00087 <font class="comment">/*=====================================================================</font> 00088 <font class="comment"> Error handling functions (cpl_error.c)</font> 00089 <font class="comment"> =====================================================================*/</font> 00090 00097 CPL_C_START 00098 00099 <font class="keyword">typedef</font> <font class="keyword">enum</font> 00100 { 00101 CE_None = 0, 00102 CE_Debug = 1, 00103 CE_Warning = 2, 00104 CE_Failure = 3, 00105 CE_Fatal = 4 00106 00107 } CPLErr; 00108 00109 <font class="keywordtype">void</font> CPL_DLL <a class="code" href="cpl_error_h.html#a17">CPLError</a>(CPLErr eErrClass, <font class="keywordtype">int</font> err_no, <font class="keyword">const</font> <font class="keywordtype">char</font> *fmt, ...); 00110 <font class="keywordtype">void</font> CPL_DLL CPLErrorV(CPLErr, <font class="keywordtype">int</font>, <font class="keyword">const</font> <font class="keywordtype">char</font> *, va_list ); 00111 <font class="keywordtype">void</font> CPL_DLL <a class="code" href="cpl_error_h.html#a19">CPLErrorReset</a>(); 00112 <font class="keywordtype">int</font> CPL_DLL <a class="code" href="cpl_error_h.html#a20">CPLGetLastErrorNo</a>(); 00113 CPLErr CPL_DLL <a class="code" href="cpl_error_h.html#a21">CPLGetLastErrorType</a>(); 00114 <font class="keyword">const</font> <font class="keywordtype">char</font> CPL_DLL * <a class="code" href="cpl_error_h.html#a22">CPLGetLastErrorMsg</a>(); 00115 00116 <font class="keyword">typedef</font> void (*CPLErrorHandler)(CPLErr, <font class="keywordtype">int</font>, <font class="keyword">const</font> <font class="keywordtype">char</font>*); 00117 CPLErrorHandler CPL_DLL <a class="code" href="cpl_error_h.html#a23">CPLSetErrorHandler</a>(CPLErrorHandler); 00118 <font class="keywordtype">void</font> CPL_DLL <a class="code" href="cpl_error_h.html#a24">CPLPushErrorHandler</a>( CPLErrorHandler ); 00119 <font class="keywordtype">void</font> CPL_DLL <a class="code" href="cpl_error_h.html#a25">CPLPopErrorHandler</a>(); 00120 <font class="keywordtype">void</font> CPL_DLL CPLDefaultErrorHandler( CPLErr, <font class="keywordtype">int</font>, <font class="keyword">const</font> <font class="keywordtype">char</font> * ); 00121 <font class="keywordtype">void</font> CPL_DLL CPLQuietErrorHandler( CPLErr, <font class="keywordtype">int</font>, <font class="keyword">const</font> <font class="keywordtype">char</font> * ); 00122 <font class="keywordtype">void</font> CPL_DLL CPLLoggingErrorHandler( CPLErr, <font class="keywordtype">int</font>, <font class="keyword">const</font> <font class="keywordtype">char</font> * ); 00123 00124 <font class="keywordtype">void</font> CPL_DLL <a class="code" href="cpl_error_h.html#a29">CPLDebug</a>( <font class="keyword">const</font> <font class="keywordtype">char</font> *, <font class="keyword">const</font> <font class="keywordtype">char</font> *, ... ); 00125 <font class="keywordtype">void</font> CPL_DLL <a class="code" href="cpl_error_h.html#a30">_CPLAssert</a>( <font class="keyword">const</font> <font class="keywordtype">char</font> *, <font class="keyword">const</font> <font class="keywordtype">char</font> *, <font class="keywordtype">int</font> ); 00126 00127 <font class="preprocessor">#ifdef DEBUG</font> 00128 <font class="preprocessor"></font><font class="preprocessor"># define CPLAssert(expr) ((expr) ? (void)(0) : _CPLAssert(#expr,__FILE__,__LINE__))</font> 00129 <font class="preprocessor"></font><font class="preprocessor">#else</font> 00130 <font class="preprocessor"></font><font class="preprocessor"># define CPLAssert(expr)</font> 00131 <font class="preprocessor"></font><font class="preprocessor">#endif</font> 00132 <font class="preprocessor"></font> 00133 CPL_C_END 00134 00135 <font class="comment">/* ==================================================================== */</font> 00136 <font class="comment">/* Well known error codes. */</font> 00137 <font class="comment">/* ==================================================================== */</font> 00138 00139 <font class="preprocessor">#define CPLE_None 0</font> 00140 <font class="preprocessor"></font><font class="preprocessor">#define CPLE_AppDefined 1</font> 00141 <font class="preprocessor"></font><font class="preprocessor">#define CPLE_OutOfMemory 2</font> 00142 <font class="preprocessor"></font><font class="preprocessor">#define CPLE_FileIO 3</font> 00143 <font class="preprocessor"></font><font class="preprocessor">#define CPLE_OpenFailed 4</font> 00144 <font class="preprocessor"></font><font class="preprocessor">#define CPLE_IllegalArg 5</font> 00145 <font class="preprocessor"></font><font class="preprocessor">#define CPLE_NotSupported 6</font> 00146 <font class="preprocessor"></font><font class="preprocessor">#define CPLE_AssertionFailed 7</font> 00147 <font class="preprocessor"></font><font class="preprocessor">#define CPLE_NoWriteAccess 8</font> 00148 <font class="preprocessor"></font><font class="preprocessor">#define CPLE_UserInterrupt 9</font> 00149 <font class="preprocessor"></font> 00150 <font class="comment">/* 100 - 299 reserved for GDAL */</font> 00151 00152 <font class="preprocessor">#endif </font><font class="comment">/* _CPL_ERROR_H_INCLUDED_ */</font> </div></pre><hr><address><small>Generated at Sat Dec 21 14:01:57 2002 for GDAL by <a href="http://www.stack.nl/~dimitri/doxygen/index.html"> <img src="doxygen.gif" alt="doxygen" align="middle" border=0 width=110 height=53></a>1.2.3-20001105 written by <a href="mailto:dimitri@stack.nl">Dimitri van Heesch</a>, © 1997-2000</small></address> </body> </html>