annotate error.c @ 899:0795a743bda1 libavutil

Remove explicit filename from Doxygen @file commands. Passing an explicit filename to this command is only necessary if the documentation in the @file block refers to a file different from the one the block resides in.
author diego
date Tue, 20 Apr 2010 14:45:34 +0000
parents 3e77728d53e1
children 71ebc8b18666
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
892
3e77728d53e1 Implement av_strerror().
stefano
parents:
diff changeset
1 /*
3e77728d53e1 Implement av_strerror().
stefano
parents:
diff changeset
2 * This file is part of FFmpeg.
3e77728d53e1 Implement av_strerror().
stefano
parents:
diff changeset
3 *
3e77728d53e1 Implement av_strerror().
stefano
parents:
diff changeset
4 * FFmpeg is free software; you can redistribute it and/or
3e77728d53e1 Implement av_strerror().
stefano
parents:
diff changeset
5 * modify it under the terms of the GNU Lesser General Public
3e77728d53e1 Implement av_strerror().
stefano
parents:
diff changeset
6 * License as published by the Free Software Foundation; either
3e77728d53e1 Implement av_strerror().
stefano
parents:
diff changeset
7 * version 2.1 of the License, or (at your option) any later version.
3e77728d53e1 Implement av_strerror().
stefano
parents:
diff changeset
8 *
3e77728d53e1 Implement av_strerror().
stefano
parents:
diff changeset
9 * FFmpeg is distributed in the hope that it will be useful,
3e77728d53e1 Implement av_strerror().
stefano
parents:
diff changeset
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
3e77728d53e1 Implement av_strerror().
stefano
parents:
diff changeset
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
3e77728d53e1 Implement av_strerror().
stefano
parents:
diff changeset
12 * Lesser General Public License for more details.
3e77728d53e1 Implement av_strerror().
stefano
parents:
diff changeset
13 *
3e77728d53e1 Implement av_strerror().
stefano
parents:
diff changeset
14 * You should have received a copy of the GNU Lesser General Public
3e77728d53e1 Implement av_strerror().
stefano
parents:
diff changeset
15 * License along with FFmpeg; if not, write to the Free Software
3e77728d53e1 Implement av_strerror().
stefano
parents:
diff changeset
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
3e77728d53e1 Implement av_strerror().
stefano
parents:
diff changeset
17 */
3e77728d53e1 Implement av_strerror().
stefano
parents:
diff changeset
18
3e77728d53e1 Implement av_strerror().
stefano
parents:
diff changeset
19 #include "avutil.h"
3e77728d53e1 Implement av_strerror().
stefano
parents:
diff changeset
20 #include "avstring.h"
3e77728d53e1 Implement av_strerror().
stefano
parents:
diff changeset
21
3e77728d53e1 Implement av_strerror().
stefano
parents:
diff changeset
22 int av_strerror(int errnum, char *errbuf, size_t errbuf_size)
3e77728d53e1 Implement av_strerror().
stefano
parents:
diff changeset
23 {
3e77728d53e1 Implement av_strerror().
stefano
parents:
diff changeset
24 int ret = 0;
3e77728d53e1 Implement av_strerror().
stefano
parents:
diff changeset
25 const char *errstr = NULL;
3e77728d53e1 Implement av_strerror().
stefano
parents:
diff changeset
26
3e77728d53e1 Implement av_strerror().
stefano
parents:
diff changeset
27 switch (errnum) {
3e77728d53e1 Implement av_strerror().
stefano
parents:
diff changeset
28 case AVERROR_EOF: errstr = "End of file"; break;
3e77728d53e1 Implement av_strerror().
stefano
parents:
diff changeset
29 case AVERROR_INVALIDDATA: errstr = "Invalid data found when processing input"; break;
3e77728d53e1 Implement av_strerror().
stefano
parents:
diff changeset
30 case AVERROR_NOTSUPP: errstr = "Operation not supported"; break;
3e77728d53e1 Implement av_strerror().
stefano
parents:
diff changeset
31 case AVERROR_NUMEXPECTED: errstr = "Number syntax expected in filename"; break;
3e77728d53e1 Implement av_strerror().
stefano
parents:
diff changeset
32 case AVERROR_PATCHWELCOME: errstr = "Not yet implemented in FFmpeg, patches welcome"; break;
3e77728d53e1 Implement av_strerror().
stefano
parents:
diff changeset
33 }
3e77728d53e1 Implement av_strerror().
stefano
parents:
diff changeset
34
3e77728d53e1 Implement av_strerror().
stefano
parents:
diff changeset
35 if (errstr) {
3e77728d53e1 Implement av_strerror().
stefano
parents:
diff changeset
36 av_strlcpy(errbuf, errstr, errbuf_size);
3e77728d53e1 Implement av_strerror().
stefano
parents:
diff changeset
37 } else {
3e77728d53e1 Implement av_strerror().
stefano
parents:
diff changeset
38 #if HAVE_STRERROR_R
3e77728d53e1 Implement av_strerror().
stefano
parents:
diff changeset
39 ret = strerror_r(AVUNERROR(errnum), errbuf, errbuf_size);
3e77728d53e1 Implement av_strerror().
stefano
parents:
diff changeset
40 #else
3e77728d53e1 Implement av_strerror().
stefano
parents:
diff changeset
41 snprintf(errbuf, errbuf_size, "Error number %d occurred", errnum);
3e77728d53e1 Implement av_strerror().
stefano
parents:
diff changeset
42 #endif
3e77728d53e1 Implement av_strerror().
stefano
parents:
diff changeset
43 }
3e77728d53e1 Implement av_strerror().
stefano
parents:
diff changeset
44
3e77728d53e1 Implement av_strerror().
stefano
parents:
diff changeset
45 return ret;
3e77728d53e1 Implement av_strerror().
stefano
parents:
diff changeset
46 }