include/SDL_error.h
author Bob Pendleton <bob@pendleton.com>
Thu, 09 Jul 2009 21:31:27 +0000
changeset 3216 48a80f2a7ff2
parent 2859 99210400e8b9
child 3407 d3baf5ac4e37
permissions -rw-r--r--
volitile... duh, yeah the variable need to be labeled volitile
     1 /*
     2     SDL - Simple DirectMedia Layer
     3     Copyright (C) 1997-2009 Sam Lantinga
     4 
     5     This library is free software; you can redistribute it and/or
     6     modify it under the terms of the GNU Lesser General Public
     7     License as published by the Free Software Foundation; either
     8     version 2.1 of the License, or (at your option) any later version.
     9 
    10     This library is distributed in the hope that it will be useful,
    11     but WITHOUT ANY WARRANTY; without even the implied warranty of
    12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    13     Lesser General Public License for more details.
    14 
    15     You should have received a copy of the GNU Lesser General Public
    16     License along with this library; if not, write to the Free Software
    17     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    18 
    19     Sam Lantinga
    20     slouken@libsdl.org
    21 */
    22 
    23 /**
    24  * \file SDL_error.h
    25  * Simple error message routines for SDL
    26  */
    27 
    28 #ifndef _SDL_error_h
    29 #define _SDL_error_h
    30 
    31 #include "SDL_stdinc.h"
    32 
    33 #include "begin_code.h"
    34 /* Set up for C function definitions, even when using C++ */
    35 #ifdef __cplusplus
    36 /* *INDENT-OFF* */
    37 extern "C" {
    38 /* *INDENT-ON* */
    39 #endif
    40 
    41 /* Public functions */
    42 extern DECLSPEC void SDLCALL SDL_SetError(const char *fmt, ...);
    43 extern DECLSPEC char *SDLCALL SDL_GetError(void);
    44 extern DECLSPEC void SDLCALL SDL_ClearError(void);
    45 
    46 /* Private error message function - used internally */
    47 #define SDL_OutOfMemory()	SDL_Error(SDL_ENOMEM)
    48 #define SDL_Unsupported()	SDL_Error(SDL_UNSUPPORTED)
    49 typedef enum
    50 {
    51     SDL_ENOMEM,
    52     SDL_EFREAD,
    53     SDL_EFWRITE,
    54     SDL_EFSEEK,
    55     SDL_UNSUPPORTED,
    56     SDL_LASTERROR
    57 } SDL_errorcode;
    58 extern DECLSPEC void SDLCALL SDL_Error(SDL_errorcode code);
    59 
    60 
    61 /* Ends C function definitions when using C++ */
    62 #ifdef __cplusplus
    63 /* *INDENT-OFF* */
    64 }
    65 /* *INDENT-ON* */
    66 #endif
    67 #include "close_code.h"
    68 
    69 #endif /* _SDL_error_h */
    70 
    71 /* vi: set ts=4 sw=4 expandtab: */