GIRAFFE Pipeline Reference Manual

gimessages.h
1/*
2 * This file is part of the GIRAFFE Pipeline
3 * Copyright (C) 2002-2019 European Southern Observatory
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19
20#ifndef GIMESSAGES_H
21#define GIMESSAGES_H
22
23#include <stdarg.h>
24
25#include <cxtypes.h>
26
27#include <cpl_macros.h>
28
29
30#ifdef __cplusplus
31extern "C" {
32#endif
33
34/*
35 * Macro to allow the compiler to type-check the arguments of printf like
36 * functions. The arguments of the macro are the position of the format and
37 * the first argument to be checked within the argument list of the function.
38 * The numbering of the arguments of the function start from one.
39 *
40 * It is only made available if gcc is used!
41 */
42
43#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
44# define GI_GNUC_PRINTF(format_idx, arg_idx) \
45 __attribute__((format(__printf__, (format_idx), (arg_idx))))
46#else /* !GNUC */
47# define GI_GNUC_PRINTF(format_idx, arg_idx)
48#endif /* !GNUC */
49
50
51#if !defined CX_LOG_DOMAIN
52# define CX_LOG_DOMAIN "GiraffeLib"
53#endif
54
55
56void gi_error(const cxchar *, ...) GI_GNUC_PRINTF(1, 2);
57void gi_critical(const cxchar *, ...) GI_GNUC_PRINTF(1, 2);
58void gi_warning(const cxchar *, ...) GI_GNUC_PRINTF(1, 2);
59void gi_message(const cxchar *, ...) GI_GNUC_PRINTF(1, 2);
60
61
62#ifdef __cplusplus
63}
64#endif
65
66#endif /* GIMESSAGES_H */
void gi_error(const cxchar *format,...)
Log an error message.
Definition: gimessages.c:59

This file is part of the GIRAFFE Pipeline Reference Manual 2.17.1.
Documentation copyright © 2002-2006 European Southern Observatory.
Generated on Wed Jun 11 2025 18:00:33 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2004