gimessages.h
00001 /* $Id: gimessages.h,v 1.6 2010/07/19 13:56:06 rpalsa Exp $ 00002 * 00003 * This file is part of the GIRAFFE Pipeline 00004 * Copyright (C) 2002-2006 European Southern Observatory 00005 * 00006 * This program is free software; you can redistribute it and/or modify 00007 * it under the terms of the GNU General Public License as published by 00008 * the Free Software Foundation; either version 2 of the License, or 00009 * (at your option) any later version. 00010 * 00011 * This program is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with this program; if not, write to the Free Software 00018 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00019 */ 00020 00021 /* 00022 * $Author: rpalsa $ 00023 * $Date: 2010/07/19 13:56:06 $ 00024 * $Revision: 1.6 $ 00025 * $Name: giraffe-2_8_8 $ 00026 */ 00027 00028 #ifndef GIMESSAGES_H 00029 #define GIMESSAGES_H 00030 00031 #include <stdarg.h> 00032 00033 #include <cxtypes.h> 00034 00035 #include <cpl_macros.h> 00036 00037 00038 #ifdef __cplusplus 00039 extern "C" { 00040 #endif 00041 00042 /* 00043 * Macro to allow the compiler to type-check the arguments of printf like 00044 * functions. The arguments of the macro are the position of the format and 00045 * the first argument to be checked within the argument list of the function. 00046 * The numbering of the arguments of the function start from one. 00047 * 00048 * It is only made available if gcc is used! 00049 */ 00050 00051 #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4) 00052 # define GI_GNUC_PRINTF(format_idx, arg_idx) \ 00053 __attribute__((format(__printf__, (format_idx), (arg_idx)))) 00054 #else /* !GNUC */ 00055 # define GI_GNUC_PRINTF(format_idx, arg_idx) 00056 #endif /* !GNUC */ 00057 00058 00059 #if !defined CX_LOG_DOMAIN 00060 # define CX_LOG_DOMAIN "GiraffeLib" 00061 #endif 00062 00063 00064 void gi_error(const cxchar *, ...) GI_GNUC_PRINTF(1, 2); 00065 void gi_critical(const cxchar *, ...) GI_GNUC_PRINTF(1, 2); 00066 void gi_warning(const cxchar *, ...) GI_GNUC_PRINTF(1, 2); 00067 void gi_message(const cxchar *, ...) GI_GNUC_PRINTF(1, 2); 00068 00069 00070 #ifdef __cplusplus 00071 } 00072 #endif 00073 00074 #endif /* GIMESSAGES_H */