Path: blob/main/system/include/SDL/SDL_error.h
6169 views
/*1Simple DirectMedia Layer2Copyright (C) 1997-2011 Sam Lantinga <[email protected]>34This software is provided 'as-is', without any express or implied5warranty. In no event will the authors be held liable for any damages6arising from the use of this software.78Permission is granted to anyone to use this software for any purpose,9including commercial applications, and to alter it and redistribute it10freely, subject to the following restrictions:11121. The origin of this software must not be misrepresented; you must not13claim that you wrote the original software. If you use this software14in a product, an acknowledgment in the product documentation would be15appreciated but is not required.162. Altered source versions must be plainly marked as such, and must not be17misrepresented as being the original software.183. This notice may not be removed or altered from any source distribution.19*/2021/**22* \file SDL_error.h23*24* Simple error message routines for SDL.25*/2627#ifndef _SDL_error_h28#define _SDL_error_h2930#include "SDL_stdinc.h"3132#include "begin_code.h"33/* Set up for C function definitions, even when using C++ */34#ifdef __cplusplus35/* *INDENT-OFF* */36extern "C" {37/* *INDENT-ON* */38#endif3940/* Public functions */41extern DECLSPEC void SDLCALL SDL_SetError(const char *fmt, ...);42extern DECLSPEC const char *SDLCALL SDL_GetError(void);43extern DECLSPEC void SDLCALL SDL_ClearError(void);4445/**46* \name Internal error functions47*48* \internal49* Private error reporting function - used internally.50*/51/*@{*/52#define SDL_OutOfMemory() SDL_Error(SDL_ENOMEM)53#define SDL_Unsupported() SDL_Error(SDL_UNSUPPORTED)54typedef enum55{56SDL_ENOMEM,57SDL_EFREAD,58SDL_EFWRITE,59SDL_EFSEEK,60SDL_UNSUPPORTED,61SDL_LASTERROR62} SDL_errorcode;63extern DECLSPEC void SDLCALL SDL_Error(SDL_errorcode code);64/*@}*//*Internal error functions*/6566/* Ends C function definitions when using C++ */67#ifdef __cplusplus68/* *INDENT-OFF* */69}70/* *INDENT-ON* */71#endif72#include "close_code.h"7374#endif /* _SDL_error_h */7576/* vi: set ts=4 sw=4 expandtab: */777879