1 /* Copyright (C) 1998-99 Martin Baulig
2    This file is part of LibGTop 1.0.
3 
4    Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
5 
6    LibGTop is free software; you can redistribute it and/or modify it
7    under the terms of the GNU General Public License as published by
8    the Free Software Foundation; either version 2 of the License,
9    or (at your option) any later version.
10 
11    LibGTop is distributed in the hope that it will be useful, but WITHOUT
12    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14    for more details.
15 
16    You should have received a copy of the GNU General Public License
17    along with LibGTop; see the file COPYING. If not, write to the
18    Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19    Boston, MA 02110-1301, USA.
20 */
21 
22 
23 /*
24  * This is private API
25  */
26 
27 #ifndef __GLIBTOP_ERROR_H__
28 #define __GLIBTOP_ERROR_H__
29 
30 #include <glibtop.h>
31 
32 G_BEGIN_DECLS
33 
34 void glibtop_error_vr (glibtop *server, const char *format, va_list args) G_GNUC_NORETURN;
35 void glibtop_warn_vr (glibtop *server, const char *format, va_list args);
36 void glibtop_error_io_vr (glibtop *server, const char *format, int, va_list args) G_GNUC_NORETURN;
37 void glibtop_warn_io_vr (glibtop *server, const char *format, int, va_list args);
38 
39 void glibtop_error_r (glibtop *server, const char *format, ...) G_GNUC_PRINTF(2, 3) G_GNUC_NORETURN;
40 void glibtop_warn_r (glibtop *server, const char *format, ...) G_GNUC_PRINTF(2, 3);
41 void glibtop_error_io_r (glibtop *server, const char *format, ...) G_GNUC_PRINTF(2, 3) G_GNUC_NORETURN;
42 void glibtop_warn_io_r (glibtop *server, const char *format, ...) G_GNUC_PRINTF(2, 3);
43 
44 void glibtop_error (const char *format, ...) G_GNUC_PRINTF(1, 2) G_GNUC_NORETURN;
45 void glibtop_warn (const char *format, ...) G_GNUC_PRINTF(1, 2);
46 void glibtop_error_io (const char *format, ...) G_GNUC_PRINTF(1, 2) G_GNUC_NORETURN;
47 void glibtop_warn_io (const char *format, ...) G_GNUC_PRINTF(1, 2);
48 
49 /* FIXME: C99 */
50 #define glibtop_debug_r(server, fmt, ...)				\
51 	G_STMT_START {							\
52 	if (LIBGTOP_ENABLE_DEBUG)					\
53 		glibtop_debug_r_real(server, "%s:%d %s(): " fmt, __FILE__, __LINE__, __func__, ##__VA_ARGS__); \
54 	} G_STMT_END
55 
56 #define glibtop_debug(...) glibtop_debug_r(glibtop_global_server, __VA_ARGS__)
57 
58 void glibtop_debug_vr (glibtop *server, const char *format, va_list args);
59 void glibtop_debug_r_real (glibtop *server, const char *format, ...) G_GNUC_PRINTF(2, 3);
60 
61 G_END_DECLS
62 
63 #endif
64