MloResults.h

Go to the documentation of this file.
00001 /*****************************************************************
00002 |
00003 |    MLO - Result & Error Constants
00004 |
00005 |    Copyright 2004-2006 Axiomatic Systems LLC
00006 |
00007 |    This file is part of Melo (Melo AAC Decoder).
00008 |
00009 |    Unless you have obtained Melo under a difference license,
00010 |    this version of Melo is Melo|GPL.
00011 |    Melo|GPL is free software; you can redistribute it and/or modify
00012 |    it under the terms of the GNU General Public License as published by
00013 |    the Free Software Foundation; either version 2, or (at your option)
00014 |    any later version.
00015 |
00016 |    Melo|GPL is distributed in the hope that it will be useful,
00017 |    but WITHOUT ANY WARRANTY; without even the implied warranty of
00018 |    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019 |    GNU General Public License for more details.
00020 |
00021 |    You should have received a copy of the GNU General Public License
00022 |    along with Melo|GPL; see the file COPYING.  If not, write to the
00023 |    Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
00024 |    02111-1307, USA.
00025 |
00026  ****************************************************************/
00031 #ifndef _MLO_ERRORS_H_
00032 #define _MLO_ERRORS_H_
00033 
00034 /*----------------------------------------------------------------------
00035 |    includes
00036 +---------------------------------------------------------------------*/
00037 
00038 /*----------------------------------------------------------------------
00039 |    error codes
00040 +---------------------------------------------------------------------*/
00042 #define MLO_SUCCESS      0
00043 
00045 #define MLO_FAILURE      (-1)
00046 
00047 #define MLO_FAILED(result)       ((result) != MLO_SUCCESS)
00048 #define MLO_SUCCEEDED(result)    ((result) == MLO_SUCCESS)
00049 
00050 /* Generic Errors */
00051 #define MLO_ERROR_BASE_GENERIC            (-20000)
00052 #define MLO_ERROR_INVALID_PARAMETERS      (MLO_ERROR_BASE_GENERIC-0)
00053 #define MLO_ERROR_OUT_OF_MEMORY           (MLO_ERROR_BASE_GENERIC-1)
00054 #define MLO_ERROR_OUT_OF_RANGE            (MLO_ERROR_BASE_GENERIC-2)
00055 #define MLO_ERROR_INVALID_DATA            (MLO_ERROR_BASE_GENERIC-3)
00056 
00057 /* Decoder errors */
00058 #define MLO_ERROR_BASE_DECODER            (-20100)
00059 
00060 /* BitStream errors */
00061 #define MLO_ERROR_BASE_BITSTREAM          (-20200)
00062 
00063 /* IcsInfo errors */
00064 #define MLO_ERROR_BASE_ICS_INFO           (-20300)
00065 
00066 /* IndivChnPool errors */
00067 #define MLO_ERROR_BASE_INDIV_CHN_POOL     (-20400)
00068 
00069 /* IndivChnStream errors */
00070 #define MLO_ERROR_BASE_INDIV_CHN_STREAM   (-20500)
00071 
00072 /* Huffman errors */
00073 #define MLO_ERROR_BASE_HUFFMAN            (-20600)
00074 
00075 /* ElementFil errors */
00076 #define MLO_ERROR_BASE_ELEMENT_FIL        (-20700)
00077 
00078 /* ElementFil errors */
00079 #define MLO_ERROR_BASE_SCALE_FACTOR       (-20800)
00080 
00081 /* SyntacticElements errors */
00082 #define MLO_ERROR_BASE_SYNTACTIC_ELEMENTS (-20900)
00083 
00084 /*----------------------------------------------------------------------
00085 |    macros
00086 +---------------------------------------------------------------------*/
00087 #if defined(MLO_DEBUG)
00088 #define MLO_CHECK_ARGS(_x) MLO_ASSERT(_x)
00089 #else
00090 #define MLO_CHECK_ARGS(_x) if (!(_x)) return MLO_ERROR_INVALID_PARAMETERS
00091 #endif
00092 
00093 #define MLO_CHECK_DATA(_x) if (!(_x)) return MLO_ERROR_INVALID_DATA
00094 
00095 #endif /* _MLO_ERRORS_H_ */