SDL_error.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /*
  2. SDL - Simple DirectMedia Layer
  3. Copyright (C) 1997-2011 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. [email protected]
  17. */
  18. /**
  19. * \file SDL_error.h
  20. *
  21. * Simple error message routines for SDL.
  22. */
  23. #ifndef _SDL_error_h
  24. #define _SDL_error_h
  25. #include "SDL_stdinc.h"
  26. #include "begin_code.h"
  27. /* Set up for C function definitions, even when using C++ */
  28. #ifdef __cplusplus
  29. /* *INDENT-OFF* */
  30. extern "C" {
  31. /* *INDENT-ON* */
  32. #endif
  33. /* Public functions */
  34. extern DECLSPEC void SDLCALL SDL_SetError(const char *fmt, ...);
  35. extern DECLSPEC const char *SDLCALL SDL_GetError(void);
  36. extern DECLSPEC void SDLCALL SDL_ClearError(void);
  37. /**
  38. * \name Internal error functions
  39. *
  40. * \internal
  41. * Private error reporting function - used internally.
  42. */
  43. /*@{*/
  44. #define SDL_OutOfMemory() SDL_Error(SDL_ENOMEM)
  45. #define SDL_Unsupported() SDL_Error(SDL_UNSUPPORTED)
  46. typedef enum
  47. {
  48. SDL_ENOMEM,
  49. SDL_EFREAD,
  50. SDL_EFWRITE,
  51. SDL_EFSEEK,
  52. SDL_UNSUPPORTED,
  53. SDL_LASTERROR
  54. } SDL_errorcode;
  55. extern DECLSPEC void SDLCALL SDL_Error(SDL_errorcode code);
  56. /*@}*//*Internal error functions*/
  57. /* Ends C function definitions when using C++ */
  58. #ifdef __cplusplus
  59. /* *INDENT-OFF* */
  60. }
  61. /* *INDENT-ON* */
  62. #endif
  63. #include "close_code.h"
  64. #endif /* _SDL_error_h */
  65. /* vi: set ts=4 sw=4 expandtab: */