SDL_Error

Name

SDL_Error -- Sets the SDL error message to one of several predefined strings.

Synopsis

#include "SDL_error.h"

void SDL_Error(SDL_errorcode code);

Description

SDL_Error sets the SDL error message to the predefined string specified by code, which is one of the following:

SDL_errorcode

String

SDL_ENOMEM

Out of memory

SDL_EFREAD

Error reading from datastream

SDL_EFWRITE

Error writing to datastream

SDL_EFSEEK

Error seeking in datastream

SDL_UNSUPPORTED

Unknown SDL error

SDL_LASTERROR

Unknown SDL error

any other value

Unknown SDL error

SDL_LASTERROR marks the highest numbered predefined error.

Return Value

Returns nothing.

Note: SDL also defines SDL_OutOfMemory() and SDL_Unsupported() for internal use, which are equivalent to SDL_Error(SDL_ENOMEM) and SDL_Error(SDL_UNSUPPORTED) respectively.

Example

#include "SDL_error.h"

char* ptr = (char*) malloc(1024);
if (!ptr)  {
    SDL_Error(SDL_ENOMEM);
    return -1;
}

See Also

SDL_SetError, SDL_GetErrorMsg, SDL_GetError, SDL_ClearError

SDL_ErrorCZ (last edited 2008-07-18 11:58:14 by JaroslavGajdosik)