Main Page | Alphabetical List | Compound List | File List | Compound Members | File Members

Errorlog.h

Go to the documentation of this file.
00001 /****************************************************************************************/
00002 /*  ERRORLOG.H                                                                          */
00003 /*                                                                                      */
00004 /*  Author: Mike Sandige                                                                */
00005 /*  Description: Generic error logging system interface                                 */
00006 /*                                                                                      */
00007 /*  The contents of this file are subject to the Genesis3D Public License               */
00008 /*  Version 1.01 (the "License"); you may not use this file except in                   */
00009 /*  compliance with the License. You may obtain a copy of the License at                */
00010 /*  http://www.genesis3d.com                                                            */
00011 /*                                                                                      */
00012 /*  Software distributed under the License is distributed on an "AS IS"                 */
00013 /*  basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.  See                */
00014 /*  the License for the specific language governing rights and limitations              */
00015 /*  under the License.                                                                  */
00016 /*                                                                                      */
00017 /*  The Original Code is Genesis3D, released March 25, 1999.                            */
00018 /*  Genesis3D Version 1.1 released November 15, 1999                                 */
00019 /*  Copyright (C) 1999 WildTangent, Inc. All Rights Reserved           */
00020 /*                                                                                      */
00021 /****************************************************************************************/
00022 #ifndef GE_ERRORLOG_H
00023 #define GE_ERRORLOG_H
00024 
00025 #include "basetype.h"
00026 
00027 #ifndef NDEBUG 
00028         #define ERRORLOG_FULL_REPORTING
00029 #endif
00030 
00031 
00032 #ifdef __cplusplus
00033 extern "C" {
00034 #endif
00035 
00036 typedef enum
00037 {
00038         GE_ERR_INVALID_DRIVER_HANDLE,                   // Driver not supported
00039         GE_ERR_INVALID_MODE_HANDLE,                             // Mode not supported
00040         GE_ERR_DRIVER_INIT_FAILED,                              // Could not init Driver
00041         GE_ERR_DRIVER_ALLREADY_INITIALIZED,             // Driver init failure
00042         GE_ERR_DRIVER_NOT_FOUND,                                // File open error for driver
00043         GE_ERR_DRIVER_NOT_INITIALIZED,                  // Driver shutdown failure
00044         GE_ERR_INVALID_DRIVER,                                  // Wrong driver version, or bad driver
00045         GE_ERR_DRIVER_BEGIN_SCENE_FAILED,
00046         GE_ERR_DRIVER_END_SCENE_FAILED,
00047         GE_ERR_CREATE_SOUND_MANAGER_FAILED,
00048         GE_ERR_CREATE_SOUND_BUFFER_FAILED,
00049         GE_ERR_DS_ERROR,
00050         GE_ERR_INVALID_WAV,
00051         GE_ERR_NO_PERF_FREQ,
00052         GE_ERR_FILE_OPEN_ERROR,
00053         GE_ERR_FILE_READ_ERROR,
00054         GE_ERR_FILE_WRITE_ERROR,
00055         GE_ERR_PALETTE_LOAD_FAILURE,
00056         GE_ERR_GBSP_LOAD_FAILURE,
00057         GE_ERR_INVALID_PARMS,
00058         GE_ERR_INVALID_CAMERA,
00059         GE_ERR_RENDER_WORLD_FAILED,
00060         GE_ERR_BEGIN_WORLD_FAILED,
00061         GE_ERR_END_WORLD_FAILED,
00062         GE_ERR_BEGIN_MODELS_FAILED,
00063         GE_ERR_END_MODELS_FAILED,
00064         GE_ERR_BEGIN_MESHES_FAILED,
00065         GE_ERR_END_MESHES_FAILED,
00066         GE_ERR_RENDER_MESH_FAILED,
00067         GE_ERR_BAD_LMAP_EXTENTS,
00068         GE_ERR_INVALID_TEXTURE,
00069         GE_ERR_REGISTER_WORLD_TEXTURE_FAILED,
00070         GE_ERR_REGISTER_LIGHTMAPS_FAILED,
00071         GE_ERR_REGISTER_WORLD_PALETTE_FAILED,
00072         GE_ERR_REGISTER_MISC_TEXTURE_FAILED,
00073         GE_ERR_INVALID_MESH_FILE,
00074         GE_ERR_LOAD_BITMAP_FAILED,
00075         GE_ERR_MAX_MESH_DEFS,
00076         GE_ERR_MESH_MAX_NODES,
00077         GE_ERR_INVALID_MESH_MATERIAL,
00078         GE_ERR_MAX_MESH_MATERIALS,
00079         GE_ERR_MAX_MESH_CLIP_PLANES,
00080         GE_ERR_RENDERQ_OVERFLOW,
00081         GE_ERR_INVALID_LTYPE,
00082         GE_ERR_MAX_ENTITIES,
00083         GE_ERR_GET_ENTITY_DATA_ERROR,
00084         GE_ERR_INVALID_ENTITY_FIELD_TYPE,
00085         GE_ERR_MODEL_NOT_FOUND,
00086         GE_ERR_MODEL_NOT_IN_ENTITY,
00087         GE_ERR_MAX_TEXTURES,
00088         GE_ERR_MAX_DECALS,
00089         GE_ERR_MAX_VERTS,
00090         GE_ERR_OUT_OF_MEMORY,
00091         GE_ERR_INVALID_BSP_TAG,
00092         GE_ERR_INVALID_BSP_VERSION,
00093         GE_ERR_ERROR_READING_BSP_CHUNK,
00094         ERR_PATH_CREATE_ENOMEM,                         // failure to create a path (memory allocation failed)
00095         ERR_PATH_INSERT_R_KEYFRAME,                     // failure to insert a rotation keyframe
00096         ERR_PATH_INSERT_T_KEYFRAME,                     // failure to insert a translation keyframe
00097         ERR_PATH_DELETE_R_KEYFRAME,                     // failure to delete a rotation keyframe
00098         ERR_PATH_DELETE_T_KEYFRAME,                     // failure to delete a translation keyframe
00099         ERR_PATH_FILE_READ,                                     // failure to read from file
00100         ERR_PATH_FILE_VERSION,                          // tried to create path from file with wrong/bad version
00101         ERR_PATH_FILE_PARSE,                            // failure to parse file (unexpected format problem)
00102         ERR_PATH_FILE_WRITE,                            // failure to read from file
00103         ERR_MOTION_CREATE_ENOMEM,                       // failure to create (memory allocation failed)
00104         ERR_MOTION_ADDPATH_ENOMEM,                      // failure to add path into motion (memory allocation failed)
00105         ERR_MOTION_ADDPATH_PATH,                        // failure to add path into motion (path creation failed)
00106         ERR_MOTION_ADDPATH_BAD_NAME,            // failure to add path into motion due to name conflict
00107         ERR_MOTION_INSERT_EVENT,                        // failure to insert event (memory allocation failed or duplicate key)
00108         ERR_MOTION_DELETE_EVENT,                        // failure to insert event
00109         ERR_MOTION_FILE_READ,                           // failure to read from file
00110         ERR_MOTION_FILE_WRITE,                          // failure to write to file
00111         ERR_MOTION_FILE_PARSE,                          // failure to parse file (unexpected format problem)
00112         ERR_TKARRAY_INSERT_IDENTICAL,           // failure to insert into list because of existing identical key
00113         ERR_TKARRAY_INSERT_ENOMEM,                      // failure to insert into list because of memory allocation failure
00114         ERR_TKARRAY_DELETE_NOT_FOUND,           // failure to delete from list because key was not found
00115         ERR_TKARRAY_CREATE,                                     // failure to create TKArray object (out of memroy)
00116         ERR_TKARRAY_TOO_BIG,                            // TKArray object can't be added to - it's list is as big as it can get
00117         ERR_VKARRAY_INSERT,                                     // insertion to VKArray failed
00118         ERR_QKARRAY_INSERT,                                     // insertion to QKArray failed
00119         ERR_POSE_CREATE_ENOMEM,                         // Motion object failed to create (memory allocation failed)
00120         ERR_POSE_ADDJOINT_ENOMEM,                       // Motion_AddJoint failed to allocate/reallocate memory for new joint
00121         ERR_TKEVENTS_CREATE_ENOMEM,                     // failure to create TKEvents object (memory allocation failed)
00122         ERR_TKEVENTS_DELETE_NOT_FOUND,          // failure to delete from list because key was not found
00123         ERR_TKEVENTS_INSERT_ENOMEM,                     // failure to insert into list because of memory allocation failure
00124         ERR_TKEVENTS_INSERT,                            // failure to insert into list 
00125         ERR_TKEVENTS_FILE_READ,                         // failure to read from data file
00126         ERR_TKEVENTS_FILE_WRITE,                        // failure to write to data file
00127         ERR_TKEVENTS_FILE_VERSION,                      // failure to read tkevents object: file has wrong version
00128         ERR_TKEVENTS_FILE_PARSE,                        // failure to parse file (unexpected format problem)
00129         ERR_STRBLOCK_ENOMEM,                            // failure to create, insert, or append (memory allocation failed)
00130         ERR_STRBLOCK_STRLEN,                            // string too long to insert or append
00131         ERR_STRBLOCK_FILE_READ,                         // failure to read from data file
00132         ERR_STRBLOCK_FILE_WRITE,                        // failure to write to data file
00133         ERR_STRBLOCK_FILE_PARSE,                        // failure to parse reading from input file (unexpected format problem)
00134         ERR_BODY_ENOMEM,                                        // failure to create, or add (memory allocation failed)
00135         ERR_BODY_FILE_PARSE,                            // failure to parse reading from input file (unexpected format problem)
00136         ERR_BODY_FILE_READ,                                     // failure to read from data file
00137         ERR_BODY_FILE_WRITE,                            // failure to write to data file
00138         ERR_BODY_BONEXFARRAY,                           // XFArray object failed to return array, or array size doesn't match bone count
00139         ERR_XFARRAY_ENOMEM,                                     // failure to create. (memory allocation failure)
00140         ERR_PUPPET_ENOMEM,                                      // failure to create. (memory allocation failure)
00141         ERR_PUPPET_RENDER,                                      // failure to render. 
00142         ERR_PUPPET_NO_MATERIALS,                        // failure to create: associated body has no materials.
00143         ERR_PUPPET_LOAD_TEXTURE,                        // failure to load texture 
00144         ERR_TEXPOOL_ENOMEM,                                     // failure to create or add to. (memory allocation/reallocation failure)
00145         ERR_TEXPOOL_TOO_BIG,                            // failure to add to pool, pool is too large.
00146         ERR_TEXPOOL_LOAD_TEXTURE,                       // failure to load texture into pool
00147         ERR_TEXPOOL_TEXTURE_NOT_FREE,           // texture pool destroyed without first freeing all it's shared textures
00148         ERR_ACTOR_ENOMEM,                                       // failure to create. (memory allocation failure)
00149         ERR_ACTOR_RENDER_PREP,                          // failure to prepare actor for rendering (bad Body or allocation failure)
00150         ERR_ACTOR_RENDER_FAILED,                        // failure to render.  failure to get geometry from Body 
00151         ERR_ACTOR_TOO_MANY_MOTIONS,                     // failure to add motion. too many.
00152         ERR_ACTOR_FILE_READ,                            // failure to read from data file.
00153         ERR_ACTOR_FILE_PARSE,                           // failure to parse reading from input file(unexpected format problem)
00154         ERR_ACTOR_FILE_WRITE,                           // failure to write to data file.
00155         GE_ERR_INVALID_MODEL_MOTION_FILE,       // Bad model motion file (for bsp files)
00156         GE_ERR_BAD_BSP_FILE_CHUNK_SIZE,         // Chunk size does not match structure size of kind
00157 //MRB BEGIN
00158 //geSprite
00159         ERR_SPRITE_ENOMEM,                                      // failure to create. (memory allocation failure)
00160         ERR_SPRITE_INVALIDBITMAP,               // failure to use bitmap because bitmap was invalid
00161 //MRB END
00162 } geErrorLog_ErrorIDEnumType;
00163 
00164 
00165 typedef enum 
00166 {
00167         GE_ERR_MEMORY_RESOURCE,
00168         GE_ERR_DISPLAY_RESOURCE,
00169         GE_ERR_SOUND_RESOURCE,
00170         GE_ERR_SYSTEM_RESOURCE,
00171         GE_ERR_INTERNAL_RESOURCE,
00172         
00173         GE_ERR_FILEIO_OPEN,
00174         GE_ERR_FILEIO_CLOSE,
00175         GE_ERR_FILEIO_READ,
00176         GE_ERR_FILEIO_WRITE,
00177         GE_ERR_FILEIO_FORMAT,
00178         GE_ERR_FILEIO_VERSION,
00179         
00180         GE_ERR_LIST_FULL,
00181         GE_ERR_DATA_FORMAT,
00182         GE_ERR_SEARCH_FAILURE,
00183 } geErrorLog_ErrorClassType;
00184 
00185 GENESISAPI void geErrorLog_Clear(void);
00186         // clears error history
00187 
00188 GENESISAPI int  geErrorLog_Count(void);
00189         // reports size of current error log
00190 
00191 GENESISAPI void geErrorLog_AddExplicit(geErrorLog_ErrorClassType,
00192         const char *ErrorIDString,
00193         const char *ErrorFileString,
00194         int LineNumber,
00195         const char *UserString,
00196         const char *Context);
00197         // not intended to be used directly: use ErrorLog_Add or ErrorLog_AddString
00198 
00199 
00200 #ifdef ERRORLOG_FULL_REPORTING
00201         // 'Debug' version includes a textual error id, and the user string
00202 
00203         #define geErrorLog_Add(Error, Context) geErrorLog_AddExplicit(Error, #Error, __FILE__, __LINE__,"", Context)
00204                 // logs an error.  
00205 
00206         #define geErrorLog_AddString(Error,String, Context) geErrorLog_AddExplicit(Error, #Error, __FILE__,__LINE__, String, Context)
00207                 // logs an error with additional identifing string.  
00208         
00209 GENESISAPI      geBoolean geErrorLog_AppendStringToLastError(const char *String);// use geErrorLog_AppendString
00210 
00211         #define geErrorLog_AppendString(XXX) geErrorLog_AppendStringToLastError(XXX)
00212                 // adds text to the previous logged error
00213 
00214 #else
00215         // 'Release' version does not include the textual error id, or the user string
00216 
00217         #define geErrorLog_Add(Error, Context) geErrorLog_AddExplicit(Error, "", __FILE__, __LINE__,"", Context)
00218                 // logs an error.  
00219 
00220         #define geErrorLog_AddString(Error,String, Context) geErrorLog_AddExplicit(Error, "", __FILE__,__LINE__, "", Context)
00221                 // logs an error with additional identifing string.  
00222         
00223         #define geErrorLog_AppendString(XXX)
00224                 // adds text to the previous logged error
00225 
00226 #endif
00227 
00228 GENESISAPI geBoolean geErrorLog_Report(int History, geErrorLog_ErrorClassType *Error, const char **UserString);
00229         // reports from the error log.  
00230         // history is 0 for most recent,  1.. for second most recent etc.
00231         // returns GE_TRUE if report succeeded.  GE_FALSE if it failed.
00232 
00233 #ifdef __cplusplus
00234 }
00235 #endif
00236 
00237 #endif
00238 

Generated on Tue Sep 30 12:35:42 2003 for GTestAndEngine by doxygen 1.3.2