]> git.sesse.net Git - vlc/blob - src/misc/error.c
Use var_Inherit* instead of var_CreateGet*.
[vlc] / src / misc / error.c
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 /*****************************************************************************
25  * Preamble
26  *****************************************************************************/
27 #ifdef HAVE_CONFIG_H
28 # include "config.h"
29 #endif
30
31 #include <vlc_common.h>
32
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 )
40 {
41     switch( i_err )
42     {
43         case VLC_SUCCESS:
44             return "no error";
45
46         case VLC_ENOMEM:
47             return "not enough memory";
48         case VLC_ETIMEOUT:
49             return "timeout";
50
51         case VLC_ENOMOD:
52             return "module not found";
53
54         case VLC_ENOOBJ:
55             return "object not found";
56
57         case VLC_ENOVAR:
58             return "variable not found";
59         case VLC_EBADVAR:
60             return "bad variable value";
61
62         case VLC_EEXIT:
63             return "program exited";
64         case VLC_EGENERIC:
65             return "generic error";
66         default:
67             return "unknown error";
68     }
69 }
70