SDL standard library

Dependents:   H261_encoder

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers SDL_error.h Source File

SDL_error.h

Go to the documentation of this file.
00001 /*
00002   Simple DirectMedia Layer
00003   Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org>
00004 
00005   This software is provided 'as-is', without any express or implied
00006   warranty.  In no event will the authors be held liable for any damages
00007   arising from the use of this software.
00008 
00009   Permission is granted to anyone to use this software for any purpose,
00010   including commercial applications, and to alter it and redistribute it
00011   freely, subject to the following restrictions:
00012 
00013   1. The origin of this software must not be misrepresented; you must not
00014      claim that you wrote the original software. If you use this software
00015      in a product, an acknowledgment in the product documentation would be
00016      appreciated but is not required.
00017   2. Altered source versions must be plainly marked as such, and must not be
00018      misrepresented as being the original software.
00019   3. This notice may not be removed or altered from any source distribution.
00020 */
00021 
00022 /**
00023  *  \file SDL_error.h
00024  *
00025  *  Simple error message routines for SDL.
00026  */
00027 
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 extern "C" {
00037 #endif
00038 
00039 /* Public functions */
00040 /* SDL_SetError() unconditionally returns -1. */
00041 extern DECLSPEC int SDLCALL SDL_SetError(const char *fmt, ...);
00042 extern DECLSPEC const char *SDLCALL SDL_GetError(void);
00043 extern DECLSPEC void SDLCALL SDL_ClearError(void);
00044 
00045 /**
00046  *  \name Internal error functions
00047  *
00048  *  \internal
00049  *  Private error reporting function - used internally.
00050  */
00051 /* @{ */
00052 #define SDL_OutOfMemory()   SDL_Error(SDL_ENOMEM)
00053 #define SDL_Unsupported()   SDL_Error(SDL_UNSUPPORTED)
00054 #define SDL_InvalidParamError(param)    SDL_SetError("Parameter '%s' is invalid", (param))
00055 typedef enum
00056 {
00057     SDL_ENOMEM,
00058     SDL_EFREAD,
00059     SDL_EFWRITE,
00060     SDL_EFSEEK,
00061     SDL_UNSUPPORTED,
00062     SDL_LASTERROR
00063 } SDL_errorcode;
00064 /* SDL_Error() unconditionally returns -1. */
00065 extern DECLSPEC int SDLCALL SDL_Error(SDL_errorcode code);
00066 /* @} *//* Internal error functions */
00067 
00068 /* Ends C function definitions when using C++ */
00069 #ifdef __cplusplus
00070 }
00071 #endif
00072 #include "close_code.h"
00073 
00074 #endif /* _SDL_error_h */
00075 
00076 /* vi: set ts=4 sw=4 expandtab: */