slouken@0: /* slouken@5535: Simple DirectMedia Layer slouken@9619: Copyright (C) 1997-2015 Sam Lantinga slouken@0: slouken@5535: This software is provided 'as-is', without any express or implied slouken@5535: warranty. In no event will the authors be held liable for any damages slouken@5535: arising from the use of this software. slouken@0: slouken@5535: Permission is granted to anyone to use this software for any purpose, slouken@5535: including commercial applications, and to alter it and redistribute it slouken@5535: freely, subject to the following restrictions: slouken@0: slouken@5535: 1. The origin of this software must not be misrepresented; you must not slouken@5535: claim that you wrote the original software. If you use this software slouken@5535: in a product, an acknowledgment in the product documentation would be slouken@5535: appreciated but is not required. slouken@5535: 2. Altered source versions must be plainly marked as such, and must not be slouken@5535: misrepresented as being the original software. slouken@5535: 3. This notice may not be removed or altered from any source distribution. slouken@0: */ slouken@0: slouken@1895: /** slouken@3407: * \file SDL_error.h slouken@7191: * slouken@3407: * Simple error message routines for SDL. slouken@1895: */ slouken@0: slouken@0: #ifndef _SDL_error_h slouken@0: #define _SDL_error_h slouken@0: slouken@1356: #include "SDL_stdinc.h" slouken@1356: slouken@0: #include "begin_code.h" slouken@0: /* Set up for C function definitions, even when using C++ */ slouken@0: #ifdef __cplusplus slouken@0: extern "C" { slouken@0: #endif slouken@0: slouken@0: /* Public functions */ icculus@7037: /* SDL_SetError() unconditionally returns -1. */ slouken@8820: extern DECLSPEC int SDLCALL SDL_SetError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1); slouken@4867: extern DECLSPEC const char *SDLCALL SDL_GetError(void); slouken@337: extern DECLSPEC void SDLCALL SDL_ClearError(void); slouken@0: slouken@3407: /** slouken@3407: * \name Internal error functions slouken@7191: * slouken@7191: * \internal slouken@5221: * Private error reporting function - used internally. slouken@3407: */ gabomdq@7678: /* @{ */ slouken@7191: #define SDL_OutOfMemory() SDL_Error(SDL_ENOMEM) slouken@7191: #define SDL_Unsupported() SDL_Error(SDL_UNSUPPORTED) slouken@7191: #define SDL_InvalidParamError(param) SDL_SetError("Parameter '%s' is invalid", (param)) slouken@1895: typedef enum slouken@1895: { slouken@1895: SDL_ENOMEM, slouken@1895: SDL_EFREAD, slouken@1895: SDL_EFWRITE, slouken@1895: SDL_EFSEEK, slouken@1895: SDL_UNSUPPORTED, slouken@1895: SDL_LASTERROR slouken@0: } SDL_errorcode; icculus@7037: /* SDL_Error() unconditionally returns -1. */ icculus@7037: extern DECLSPEC int SDLCALL SDL_Error(SDL_errorcode code); gabomdq@7678: /* @} *//* Internal error functions */ slouken@0: slouken@0: /* Ends C function definitions when using C++ */ slouken@0: #ifdef __cplusplus slouken@0: } slouken@0: #endif slouken@0: #include "close_code.h" slouken@0: slouken@0: #endif /* _SDL_error_h */ slouken@1895: slouken@1895: /* vi: set ts=4 sw=4 expandtab: */