00001 /* libIntegra multimedia module definition interface 00002 * 00003 * Copyright (C) 2007 Jamie Bullock, Henrik Frisk 00004 * 00005 * This program is free software; you can redistribute it and/or modify 00006 * it under the terms of the GNU General Public License as published by 00007 * the Free Software Foundation; either version 2 of the License, or 00008 * (at your option) any later version. 00009 * 00010 * This program is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 * GNU General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU General Public License 00016 * along with this program; if not, write to the Free Software 00017 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 00018 * USA. 00019 */ 00020 00021 #ifndef INTEGRA_ERROR_H 00022 #define INTEGRA_ERROR_H 00023 00024 #ifdef __cplusplus 00025 extern "C" { 00026 #endif 00027 00028 #ifdef HAVE_CONFIG_H 00029 #include "config.h" 00030 #endif 00031 00032 /* 00033 * Return error codes. 00034 */ 00035 typedef enum ntg_error_code_ { 00036 /* malloc failed - NULL pointer returned */ 00037 /* FIX: use perror() ? */ 00038 // NTG_MEMORY_ALLOCATION_ERROR = -10, /* not sure why -10 was used? -jb */ 00039 NTG_MEMORY_ALLOCATION_ERROR, 00040 /* free failed - something went wrong */ 00041 NTG_MEMORY_FREE_ERROR, 00042 /* Downstream error. e.g. the called function failed */ 00043 NTG_FAILED, 00044 /* Upstream error. e.g. the caller passed invalid parameters */ 00045 NTG_ERROR, 00046 /* Erroneous or incorrect data type */ 00047 NTG_TYPE_ERROR, 00048 /* Erroneous or incorrect path */ 00049 NTG_PATH_ERROR, 00050 /* No error at all */ 00051 NTG_NO_ERROR 00052 } ntg_error_code; 00053 00055 void ntg_print_error(const char *fmt, ...); 00056 00058 char *ntg_error_text(ntg_error_code error_code); 00059 00060 #ifdef __cplusplus 00061 } 00062 #endif 00063 00064 #endif