00001 /* 00002 * This file is part of the ESO UVES Pipeline 00003 * Copyright (C) 2004,2005 European Southern Observatory 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, 51 Franklin St, Fifth Floor, Boston, MA 02111-1307 USA 00018 */ 00019 00020 /* 00021 * $Author: jmlarsen $ 00022 * $Date: 2006/02/28 09:15:22 $ 00023 * $Revision: 1.12 $ 00024 * $Name: uves-3_9_0 $ 00025 * $Log: uves_msg.h,v $ 00026 * Revision 1.12 2006/02/28 09:15:22 jmlarsen 00027 * Minor update 00028 * 00029 * Revision 1.11 2006/02/21 14:26:54 jmlarsen 00030 * Minor changes 00031 * 00032 * Revision 1.10 2005/12/19 16:17:56 jmlarsen 00033 * Replaced bool -> int 00034 * 00035 */ 00036 #ifndef UVES_MSG_H 00037 #define UVES_MSG_H 00038 00039 #include <uves_utils.h> 00040 00041 /* Nothing bad happens if user also calls cpl_msg_info() 00042 * but maybe prevent it as a service to the user of this module 00043 #define cpl_msg_info(...) use__uves_msg__instead__of__cpl_msg_info 00044 #define cpl_msg_indent() 00045 */ 00046 00047 /*----------------------------------------------------------------------------*/ 00052 /*----------------------------------------------------------------------------*/ 00055 /*----------------------------------------------------------------------------*/ 00063 /*----------------------------------------------------------------------------*/ 00064 #define uves_msg_error(...) cpl_msg_error(__func__, __VA_ARGS__) 00065 00066 /*----------------------------------------------------------------------------*/ 00076 /*----------------------------------------------------------------------------*/ 00077 #define uves_msg_progress(i, iter, ...) cpl_msg_progress(__func__, (i), (iter), __VA_ARGS__) 00078 /*----------------------------------------------------------------------------*/ 00086 /*----------------------------------------------------------------------------*/ 00087 #define uves_msg_warning(...) uves_msg_warning_macro(__func__, __VA_ARGS__) 00088 /*----------------------------------------------------------------------------*/ 00096 /*----------------------------------------------------------------------------*/ 00097 #define uves_msg_debug(...) cpl_msg_debug(__func__, __VA_ARGS__) 00098 00099 /*----------------------------------------------------------------------------*/ 00104 /*----------------------------------------------------------------------------*/ 00105 #define uves_msg_low(...) do { \ 00106 uves_msg_softer(); \ 00107 uves_msg(__VA_ARGS__); \ 00108 uves_msg_louder(); \ 00109 } while (false) 00110 00111 /*----------------------------------------------------------------------------*/ 00118 /*----------------------------------------------------------------------------*/ 00119 #define uves_msg(...) uves_msg_macro(__func__, __VA_ARGS__) 00120 00121 /*----------------------------------------------------------------------------*/ 00125 /*----------------------------------------------------------------------------*/ 00126 #define uves_msg_softer() uves_msg_softer_macro(__func__) 00127 00128 /*----------------------------------------------------------------------------*/ 00132 /*----------------------------------------------------------------------------*/ 00133 #define uves_msg_louder() uves_msg_louder_macro(__func__) 00134 00135 00136 void uves_msg_init(int olevel, const char *dom); 00137 00138 00139 void uves_msg_set_level(int olevel); 00140 00141 const char *uves_msg_get_domain(void); 00142 void uves_msg_set_domain(const char *d); 00143 void uves_msg_macro(const char *fct, const char *format, ...) 00144 #ifdef __GNUC__ 00145 __attribute__((format (printf, 2, 3))) 00146 #endif 00147 ; 00148 00149 void uves_msg_warning_macro(const char *fct, const char *format, ...) 00150 #ifdef __GNUC__ 00151 __attribute__((format (printf, 2, 3))) 00152 #endif 00153 ; 00154 00155 int uves_msg_get_warnings(void); 00156 void uves_msg_add_warnings(int n); 00157 00158 void uves_msg_softer_macro(const char *fct); 00159 void uves_msg_louder_macro(const char *fct); 00160 00161 #endif /* UVES_MSG_H */ 00162
1.5.1