00001 /* 00002 SDL - Simple DirectMedia Layer 00003 Copyright (C) 1997-2009 Sam Lantinga 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Lesser General Public 00007 License as published by the Free Software Foundation; either 00008 version 2.1 of the License, or (at your option) any later version. 00009 00010 This library is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 Lesser General Public License for more details. 00014 00015 You should have received a copy of the GNU Lesser General Public 00016 License along with this library; if not, write to the Free Software 00017 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00018 00019 Sam Lantinga 00020 slouken@libsdl.org 00021 */ 00022 00028 #ifndef _SDL_error_h 00029 #define _SDL_error_h 00030 00031 #include "SDL_stdinc.h" 00032 00033 #include "begin_code.h" 00034 /* Set up for C function definitions, even when using C++ */ 00035 #ifdef __cplusplus 00036 /* *INDENT-OFF* */ 00037 extern "C" { 00038 /* *INDENT-ON* */ 00039 #endif 00040 00041 /* Public functions */ 00042 extern DECLSPEC void SDLCALL SDL_SetError(const char *fmt, ...); 00043 extern DECLSPEC char *SDLCALL SDL_GetError(void); 00044 extern DECLSPEC void SDLCALL SDL_ClearError(void); 00045 00046 /* Private error message function - used internally */ 00047 #define SDL_OutOfMemory() SDL_Error(SDL_ENOMEM) 00048 #define SDL_Unsupported() SDL_Error(SDL_UNSUPPORTED) 00049 typedef enum 00050 { 00051 SDL_ENOMEM, 00052 SDL_EFREAD, 00053 SDL_EFWRITE, 00054 SDL_EFSEEK, 00055 SDL_UNSUPPORTED, 00056 SDL_LASTERROR 00057 } SDL_errorcode; 00058 extern DECLSPEC void SDLCALL SDL_Error(SDL_errorcode code); 00059 00060 00061 /* Ends C function definitions when using C++ */ 00062 #ifdef __cplusplus 00063 /* *INDENT-OFF* */ 00064 } 00065 /* *INDENT-ON* */ 00066 #endif 00067 #include "close_code.h" 00068 00069 #endif /* _SDL_error_h */ 00070 00071 /* vi: set ts=4 sw=4 expandtab: */