add_bool: remove callback parameter
[vlc/asuraparaju-public.git] / src / misc / error.c
bloba11639e785f647f98e703684f591f75cfffece15
1 /*****************************************************************************
2 * error.c: error handling routine
3 *****************************************************************************
4 * Copyright (C) 2002-2004 the VideoLAN team
5 * $Id$
7 * Authors: Samuel Hocevar <sam@zoy.org>
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.
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.
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 *****************************************************************************/
24 /*****************************************************************************
25 * Preamble
26 *****************************************************************************/
27 #ifdef HAVE_CONFIG_H
28 # include "config.h"
29 #endif
31 #include <vlc_common.h>
33 /*****************************************************************************
34 * vlc_error: strerror() equivalent
35 *****************************************************************************
36 * This function returns a string describing the error code passed in the
37 * argument. A list of all errors can be found in include/vlc_common.h.
38 *****************************************************************************/
39 char const * vlc_error ( int i_err )
41 switch( i_err )
43 case VLC_SUCCESS:
44 return "no error";
46 case VLC_ENOMEM:
47 return "not enough memory";
48 case VLC_ETIMEOUT:
49 return "timeout";
51 case VLC_ENOMOD:
52 return "module not found";
54 case VLC_ENOOBJ:
55 return "object not found";
57 case VLC_ENOVAR:
58 return "variable not found";
59 case VLC_EBADVAR:
60 return "bad variable value";
62 case VLC_EEXIT:
63 return "program exited";
64 case VLC_EGENERIC:
65 return "generic error";
66 default:
67 return "unknown error";