include/SDL_error.h
author Ryan C. Gordon <icculus@icculus.org>
Wed, 21 Nov 2012 23:00:06 -0500
changeset 6680 9d3df1f5c542
parent 6138 4c64952a58fb
child 6808 3ad413bd1cd6
permissions -rw-r--r--
Removed some tab chars.
slouken@0
     1
/*
slouken@5535
     2
  Simple DirectMedia Layer
slouken@6138
     3
  Copyright (C) 1997-2012 Sam Lantinga <slouken@libsdl.org>
slouken@0
     4
slouken@5535
     5
  This software is provided 'as-is', without any express or implied
slouken@5535
     6
  warranty.  In no event will the authors be held liable for any damages
slouken@5535
     7
  arising from the use of this software.
slouken@0
     8
slouken@5535
     9
  Permission is granted to anyone to use this software for any purpose,
slouken@5535
    10
  including commercial applications, and to alter it and redistribute it
slouken@5535
    11
  freely, subject to the following restrictions:
slouken@0
    12
slouken@5535
    13
  1. The origin of this software must not be misrepresented; you must not
slouken@5535
    14
     claim that you wrote the original software. If you use this software
slouken@5535
    15
     in a product, an acknowledgment in the product documentation would be
slouken@5535
    16
     appreciated but is not required.
slouken@5535
    17
  2. Altered source versions must be plainly marked as such, and must not be
slouken@5535
    18
     misrepresented as being the original software.
slouken@5535
    19
  3. This notice may not be removed or altered from any source distribution.
slouken@0
    20
*/
slouken@0
    21
slouken@1895
    22
/**
slouken@3407
    23
 *  \file SDL_error.h
slouken@3407
    24
 *  
slouken@3407
    25
 *  Simple error message routines for SDL.
slouken@1895
    26
 */
slouken@0
    27
slouken@0
    28
#ifndef _SDL_error_h
slouken@0
    29
#define _SDL_error_h
slouken@0
    30
slouken@1356
    31
#include "SDL_stdinc.h"
slouken@1356
    32
slouken@0
    33
#include "begin_code.h"
slouken@0
    34
/* Set up for C function definitions, even when using C++ */
slouken@0
    35
#ifdef __cplusplus
slouken@1895
    36
/* *INDENT-OFF* */
slouken@0
    37
extern "C" {
slouken@1895
    38
/* *INDENT-ON* */
slouken@0
    39
#endif
slouken@0
    40
slouken@0
    41
/* Public functions */
slouken@337
    42
extern DECLSPEC void SDLCALL SDL_SetError(const char *fmt, ...);
slouken@4867
    43
extern DECLSPEC const char *SDLCALL SDL_GetError(void);
slouken@337
    44
extern DECLSPEC void SDLCALL SDL_ClearError(void);
slouken@0
    45
slouken@3407
    46
/**
slouken@3407
    47
 *  \name Internal error functions
slouken@3407
    48
 *  
slouken@3407
    49
 *  \internal 
slouken@5221
    50
 *  Private error reporting function - used internally.
slouken@3407
    51
 */
slouken@3407
    52
/*@{*/
slouken@0
    53
#define SDL_OutOfMemory()	SDL_Error(SDL_ENOMEM)
slouken@1361
    54
#define SDL_Unsupported()	SDL_Error(SDL_UNSUPPORTED)
slouken@1895
    55
typedef enum
slouken@1895
    56
{
slouken@1895
    57
    SDL_ENOMEM,
slouken@1895
    58
    SDL_EFREAD,
slouken@1895
    59
    SDL_EFWRITE,
slouken@1895
    60
    SDL_EFSEEK,
slouken@1895
    61
    SDL_UNSUPPORTED,
slouken@1895
    62
    SDL_LASTERROR
slouken@0
    63
} SDL_errorcode;
slouken@977
    64
extern DECLSPEC void SDLCALL SDL_Error(SDL_errorcode code);
slouken@3407
    65
/*@}*//*Internal error functions*/
slouken@0
    66
slouken@0
    67
/* Ends C function definitions when using C++ */
slouken@0
    68
#ifdef __cplusplus
slouken@1895
    69
/* *INDENT-OFF* */
slouken@0
    70
}
slouken@1895
    71
/* *INDENT-ON* */
slouken@0
    72
#endif
slouken@0
    73
#include "close_code.h"
slouken@0
    74
slouken@0
    75
#endif /* _SDL_error_h */
slouken@1895
    76
slouken@1895
    77
/* vi: set ts=4 sw=4 expandtab: */