PageRenderTime 39ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/src/misc/error.c

https://github.com/mahaserver/MHSVLC
C | 72 lines | 32 code | 9 blank | 31 comment | 0 complexity | f59285138715c34fd5a97b27583037b9 MD5 | raw file
Possible License(s): GPL-2.0
  1. /*****************************************************************************
  2. * error.c: error handling routine
  3. *****************************************************************************
  4. * Copyright (C) 2002-2004 the VideoLAN team
  5. * $Id$
  6. *
  7. * Authors: Samuel Hocevar <sam@zoy.org>
  8. *
  9. * This program is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License as published by
  11. * the Free Software Foundation; either version 2 of the License, or
  12. * (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program; if not, write to the Free Software
  21. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  22. *****************************************************************************/
  23. /*****************************************************************************
  24. * Preamble
  25. *****************************************************************************/
  26. #ifdef HAVE_CONFIG_H
  27. # include "config.h"
  28. #endif
  29. #include <vlc_common.h>
  30. /*****************************************************************************
  31. * vlc_error: strerror() equivalent
  32. *****************************************************************************
  33. * This function returns a string describing the error code passed in the
  34. * argument. A list of all errors can be found in include/vlc_common.h.
  35. *****************************************************************************/
  36. char const * vlc_error ( int i_err )
  37. {
  38. switch( i_err )
  39. {
  40. case VLC_SUCCESS:
  41. return "no error";
  42. case VLC_ENOMEM:
  43. return "not enough memory";
  44. case VLC_ETHREAD:
  45. return "thread error";
  46. case VLC_ETIMEOUT:
  47. return "timeout";
  48. case VLC_ENOMOD:
  49. return "module not found";
  50. case VLC_ENOOBJ:
  51. return "object not found";
  52. case VLC_ENOVAR:
  53. return "variable not found";
  54. case VLC_EBADVAR:
  55. return "bad variable value";
  56. case VLC_EEXIT:
  57. return "program exited";
  58. case VLC_EGENERIC:
  59. return "generic error";
  60. default:
  61. return "unknown error";
  62. }
  63. }