00001 /* 00002 * This file is part of the ESO SINFO 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: amodigli $ 00022 * $Date: 2006/11/21 11:56:10 $ 00023 * $Revision: 1.2 $ 00024 * $Name: HEAD $ 00025 */ 00026 #ifndef SINFO_MSG_H 00027 #define SINFO_MSG_H 00028 00029 /* 00030 #include <sinfo_utils.h> 00031 */ 00032 #include <cpl_msg.h> 00033 00034 /* Nothing bad happens if user also calls cpl_msg_info() 00035 * but prevent it as a service to the user of this module 00036 #define cpl_msg_info(...) use__sinfo_msg__instead__of__cpl_msg_info 00037 #define cpl_msg_indent() 00038 */ 00039 00040 /*----------------------------------------------------------------------------*/ 00045 /*----------------------------------------------------------------------------*/ 00049 void sinfo_msg_init(int outlevel, const char *dom); 00050 00051 00052 void sinfo_msg_set_level(int olevel); 00053 00054 const char *sinfo_msg_get_domain(void); 00055 void sinfo_msg_set_domain(const char *d); 00056 00057 00058 /* Convenience macros to save the user from typing function id */ 00059 00060 /*----------------------------------------------------------------------------*/ 00068 /*----------------------------------------------------------------------------*/ 00069 #define sinfo_msg_error(...) cpl_msg_error(cpl_func, __VA_ARGS__) 00070 00071 /*----------------------------------------------------------------------------*/ 00081 /*----------------------------------------------------------------------------*/ 00082 #define sinfo_msg_progress(i, iter, ...) \ 00083 cpl_msg_progress(cpl_func, (i), (iter), __VA_ARGS__) 00084 /*----------------------------------------------------------------------------*/ 00092 /*----------------------------------------------------------------------------*/ 00093 #define sinfo_msg_warning(...) sinfo_msg_warning_macro(cpl_func, __VA_ARGS__) 00094 /*----------------------------------------------------------------------------*/ 00102 /*----------------------------------------------------------------------------*/ 00103 #define sinfo_msg_debug(...) cpl_msg_debug(cpl_func, __VA_ARGS__) 00104 00105 /*----------------------------------------------------------------------------*/ 00110 /*----------------------------------------------------------------------------*/ 00111 #define sinfo_msg_low(...) do { \ 00112 sinfo_msg_softer(); \ 00113 sinfo_msg(__VA_ARGS__); \ 00114 sinfo_msg_louder(); \ 00115 } while (FALSE) 00116 00117 00118 00119 00120 #define sinfo_msg(...) sinfo_msg_macro(cpl_func, __VA_ARGS__) 00121 #define sinfo_msg_softer() sinfo_msg_softer_macro(cpl_func) 00122 #define sinfo_msg_louder() sinfo_msg_louder_macro(cpl_func) 00123 00124 00125 void sinfo_msg_macro(const char *fct, const char *format, ...) 00126 #ifdef __GNUC__ 00127 __attribute__((format (printf, 2, 3))) 00128 #endif 00129 ; 00130 00131 void sinfo_msg_warning_macro(const char *fct, const char *format, ...) 00132 #ifdef __GNUC__ 00133 __attribute__((format (printf, 2, 3))) 00134 #endif 00135 ; 00136 00137 int sinfo_msg_get_warnings(void); 00138 void sinfo_msg_add_warnings(int n); 00139 00140 void sinfo_msg_softer_macro(const char *fct); 00141 void sinfo_msg_louder_macro(const char *fct); 00142 00143 #endif /* SINFO_MSG_H */ 00144