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