demux: ts: proper init/clean for fmt in hotfixes
[vlc.git] / src / misc / error.c
blob7cd911483937e8f30d10d3e4e092b4cd441f642c
1 /*****************************************************************************
2 * error.c: error handling routine
3 *****************************************************************************
4 * Copyright (C) 2002-2004 VLC authors and VideoLAN
5 * $Id$
7 * Authors: Samuel Hocevar <sam@zoy.org>
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU Lesser General Public License as published by
11 * the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public License
20 * along with this program; if not, write to the Free Software Foundation,
21 * 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_EGENERIC:
63 return "generic error";
64 default:
65 return "unknown error";