SDL_error.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*
  2. SDL - Simple DirectMedia Layer
  3. Copyright (C) 1997-2012 Sam Lantinga
  4. This library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Lesser General Public
  6. License as published by the Free Software Foundation; either
  7. version 2.1 of the License, or (at your option) any later version.
  8. This library is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Lesser General Public License for more details.
  12. You should have received a copy of the GNU Lesser General Public
  13. License along with this library; if not, write to the Free Software
  14. Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  15. Sam Lantinga
  16. slouken@libsdl.org
  17. */
  18. /**
  19. * @file SDL_error.h
  20. * Simple error message routines for SDL
  21. */
  22. #ifndef _SDL_error_h
  23. #define _SDL_error_h
  24. #include "SDL_stdinc.h"
  25. #include "begin_code.h"
  26. /* Set up for C function definitions, even when using C++ */
  27. #ifdef __cplusplus
  28. extern "C" {
  29. #endif
  30. /**
  31. * @name Public functions
  32. */
  33. /*@{*/
  34. extern DECLSPEC void SDLCALL SDL_SetError(const char *fmt, ...);
  35. extern DECLSPEC char * SDLCALL SDL_GetError(void);
  36. extern DECLSPEC void SDLCALL SDL_ClearError(void);
  37. /*@}*/
  38. /**
  39. * @name Private functions
  40. * @internal Private error message function - used internally
  41. */
  42. /*@{*/
  43. #define SDL_OutOfMemory() SDL_Error(SDL_ENOMEM)
  44. #define SDL_Unsupported() SDL_Error(SDL_UNSUPPORTED)
  45. typedef enum {
  46. SDL_ENOMEM,
  47. SDL_EFREAD,
  48. SDL_EFWRITE,
  49. SDL_EFSEEK,
  50. SDL_UNSUPPORTED,
  51. SDL_LASTERROR
  52. } SDL_errorcode;
  53. extern DECLSPEC void SDLCALL SDL_Error(SDL_errorcode code);
  54. /*@}*/
  55. /* Ends C function definitions when using C++ */
  56. #ifdef __cplusplus
  57. }
  58. #endif
  59. #include "close_code.h"
  60. #endif /* _SDL_error_h */