nengel@2: /* nengel@2: * This file is part of FFmpeg. nengel@2: * nengel@2: * FFmpeg is free software; you can redistribute it and/or nengel@2: * modify it under the terms of the GNU Lesser General Public nengel@2: * License as published by the Free Software Foundation; either nengel@2: * version 2.1 of the License, or (at your option) any later version. nengel@2: * nengel@2: * FFmpeg is distributed in the hope that it will be useful, nengel@2: * but WITHOUT ANY WARRANTY; without even the implied warranty of nengel@2: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU nengel@2: * Lesser General Public License for more details. nengel@2: * nengel@2: * You should have received a copy of the GNU Lesser General Public nengel@2: * License along with FFmpeg; if not, write to the Free Software nengel@2: * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA nengel@2: */ nengel@2: nengel@2: /** nengel@2: * @file nengel@2: * error code definitions nengel@2: */ nengel@2: nengel@2: #ifndef AVUTIL_ERROR_H nengel@2: #define AVUTIL_ERROR_H nengel@2: nengel@2: #include nengel@2: #include "common.h" nengel@2: nengel@2: /* error handling */ nengel@2: #if EDOM > 0 nengel@2: #define AVERROR(e) (-(e)) ///< Returns a negative error code from a POSIX error code, to return from library functions. nengel@2: #define AVUNERROR(e) (-(e)) ///< Returns a POSIX error code from a library function error return value. nengel@2: #else nengel@2: /* Some platforms have E* and errno already negated. */ nengel@2: #define AVERROR(e) (e) nengel@2: #define AVUNERROR(e) (e) nengel@2: #endif nengel@2: nengel@2: #define AVERROR_EOF AVERROR(EPIPE) ///< End of file nengel@2: nengel@2: nengel@2: /** nengel@2: * Puts a description of the AVERROR code errnum in errbuf. nengel@2: * In case of failure the global variable errno is set to indicate the nengel@2: * error. nengel@2: * nengel@2: * @param errbuf_size the size in bytes of errbuf nengel@2: * @return 0 on success, a negative value otherwise nengel@2: */ nengel@2: int av_strerror(int errnum, char *errbuf, size_t errbuf_size); nengel@2: nengel@2: #endif /* AVUTIL_ERROR_H */