include/SDL_error.h
author David Ludwig <dludwig@pobox.com>
Mon, 01 Apr 2013 21:33:06 -0400
changeset 8453 499aa167ea79
parent 6885 700f1b25f77f
child 7037 3fedf1f25b94
permissions -rw-r--r--
WinRT: made WinRT path retrieval be available in both UCS-2 and UTF-8 flavors
slouken@0
     1
/*
slouken@5535
     2
  Simple DirectMedia Layer
slouken@6885
     3
  Copyright (C) 1997-2013 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)
aschiffler@6811
    55
#define SDL_InvalidParamError(param)	SDL_SetError("Parameter '%s' is invalid", (param))
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: */