root/src/misc/error.c
| Revision b501c2e0bc8160ea26ffe50cbe209bb291166e03, 2.5 kB (checked in by Rémi Denis-Courmont <rdenis@simphalempin.com>, 3 months ago) | |
|---|---|
| |
| Line | |
|---|---|
| 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_ETHREAD: |
| 49 | return "thread error"; |
| 50 | case VLC_ETIMEOUT: |
| 51 | return "timeout"; |
| 52 | |
| 53 | case VLC_ENOMOD: |
| 54 | return "module not found"; |
| 55 | |
| 56 | case VLC_ENOOBJ: |
| 57 | return "object not found"; |
| 58 | |
| 59 | case VLC_ENOVAR: |
| 60 | return "variable not found"; |
| 61 | case VLC_EBADVAR: |
| 62 | return "bad variable value"; |
| 63 | |
| 64 | case VLC_EEXIT: |
| 65 | return "program exited"; |
| 66 | case VLC_EGENERIC: |
| 67 | return "generic error"; |
| 68 | default: |
| 69 | return "unknown error"; |
| 70 | } |
| 71 | } |
| 72 |
Note: See TracBrowser for help on using the browser.
