Split glib.h into many header files mostly according to the resp.
2000-10-12 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h, galloca.h, garray.h, gasyncqueue.h, gbacktrace.h,
gcache.h, gcompletion.h, gconvert.h, gdataset.h, gdate.h, ghash.h,
ghook.h, giochannel.h, glist.h , gmacros.h, gmain.h, gmem.h,
gmessages.h, gnode.h, gprimes.h, gquark.h, gqueue.h, grand.h,
grel.h, gscanner.h, gslist.h, gstrfuncs.h, gstring.h, gthread.h,
gthreadpool.h, gtimer.h, gtree.h, gtypes.h, gutils.h: Split glib.h
into many header files mostly according to the resp. *.c-files.
* gmacros.h: Added G_BEGIN_DECLS and G_END_DECLS to mean: 'in case
of C++: extern "C" { ... }' analogous to glibc __BEGIN_DECLS and
__END_DECLS.
* configure.in, gerror.h, gfileutils.h, gshell.h, gspawn.h,
gunicode.h, : Changed guard-macro names to something more
consistent.
* configure.in, *.h: Use G_BEGIN_DECLS and G_END_DECLS.
2000-10-12 13:52:07 +02:00
|
|
|
/* GLIB - Library of useful routines for C programming
|
|
|
|
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
2017-01-05 12:47:07 +01:00
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
Split glib.h into many header files mostly according to the resp.
2000-10-12 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h, galloca.h, garray.h, gasyncqueue.h, gbacktrace.h,
gcache.h, gcompletion.h, gconvert.h, gdataset.h, gdate.h, ghash.h,
ghook.h, giochannel.h, glist.h , gmacros.h, gmain.h, gmem.h,
gmessages.h, gnode.h, gprimes.h, gquark.h, gqueue.h, grand.h,
grel.h, gscanner.h, gslist.h, gstrfuncs.h, gstring.h, gthread.h,
gthreadpool.h, gtimer.h, gtree.h, gtypes.h, gutils.h: Split glib.h
into many header files mostly according to the resp. *.c-files.
* gmacros.h: Added G_BEGIN_DECLS and G_END_DECLS to mean: 'in case
of C++: extern "C" { ... }' analogous to glibc __BEGIN_DECLS and
__END_DECLS.
* configure.in, gerror.h, gfileutils.h, gshell.h, gspawn.h,
gunicode.h, : Changed guard-macro names to something more
consistent.
* configure.in, *.h: Use G_BEGIN_DECLS and G_END_DECLS.
2000-10-12 13:52:07 +02:00
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
2014-01-23 12:58:29 +01:00
|
|
|
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
Split glib.h into many header files mostly according to the resp.
2000-10-12 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h, galloca.h, garray.h, gasyncqueue.h, gbacktrace.h,
gcache.h, gcompletion.h, gconvert.h, gdataset.h, gdate.h, ghash.h,
ghook.h, giochannel.h, glist.h , gmacros.h, gmain.h, gmem.h,
gmessages.h, gnode.h, gprimes.h, gquark.h, gqueue.h, grand.h,
grel.h, gscanner.h, gslist.h, gstrfuncs.h, gstring.h, gthread.h,
gthreadpool.h, gtimer.h, gtree.h, gtypes.h, gutils.h: Split glib.h
into many header files mostly according to the resp. *.c-files.
* gmacros.h: Added G_BEGIN_DECLS and G_END_DECLS to mean: 'in case
of C++: extern "C" { ... }' analogous to glibc __BEGIN_DECLS and
__END_DECLS.
* configure.in, gerror.h, gfileutils.h, gshell.h, gspawn.h,
gunicode.h, : Changed guard-macro names to something more
consistent.
* configure.in, *.h: Use G_BEGIN_DECLS and G_END_DECLS.
2000-10-12 13:52:07 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Modified by the GLib Team and others 1997-2000. See the AUTHORS
|
|
|
|
* file for a list of people on the GLib Team. See the ChangeLog
|
|
|
|
* files for a list of changes. These files are distributed with
|
2008-03-14 20:30:38 +01:00
|
|
|
* GLib at ftp://ftp.gtk.org/pub/gtk/.
|
Split glib.h into many header files mostly according to the resp.
2000-10-12 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h, galloca.h, garray.h, gasyncqueue.h, gbacktrace.h,
gcache.h, gcompletion.h, gconvert.h, gdataset.h, gdate.h, ghash.h,
ghook.h, giochannel.h, glist.h , gmacros.h, gmain.h, gmem.h,
gmessages.h, gnode.h, gprimes.h, gquark.h, gqueue.h, grand.h,
grel.h, gscanner.h, gslist.h, gstrfuncs.h, gstring.h, gthread.h,
gthreadpool.h, gtimer.h, gtree.h, gtypes.h, gutils.h: Split glib.h
into many header files mostly according to the resp. *.c-files.
* gmacros.h: Added G_BEGIN_DECLS and G_END_DECLS to mean: 'in case
of C++: extern "C" { ... }' analogous to glibc __BEGIN_DECLS and
__END_DECLS.
* configure.in, gerror.h, gfileutils.h, gshell.h, gspawn.h,
gunicode.h, : Changed guard-macro names to something more
consistent.
* configure.in, *.h: Use G_BEGIN_DECLS and G_END_DECLS.
2000-10-12 13:52:07 +02:00
|
|
|
*/
|
|
|
|
|
2012-12-28 05:43:14 +01:00
|
|
|
#ifndef __G_MESSAGES_H__
|
|
|
|
#define __G_MESSAGES_H__
|
|
|
|
|
2011-10-12 06:24:46 +02:00
|
|
|
#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
|
2008-03-14 20:30:38 +01:00
|
|
|
#error "Only <glib.h> can be included directly."
|
|
|
|
#endif
|
|
|
|
|
Split glib.h into many header files mostly according to the resp.
2000-10-12 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h, galloca.h, garray.h, gasyncqueue.h, gbacktrace.h,
gcache.h, gcompletion.h, gconvert.h, gdataset.h, gdate.h, ghash.h,
ghook.h, giochannel.h, glist.h , gmacros.h, gmain.h, gmem.h,
gmessages.h, gnode.h, gprimes.h, gquark.h, gqueue.h, grand.h,
grel.h, gscanner.h, gslist.h, gstrfuncs.h, gstring.h, gthread.h,
gthreadpool.h, gtimer.h, gtree.h, gtypes.h, gutils.h: Split glib.h
into many header files mostly according to the resp. *.c-files.
* gmacros.h: Added G_BEGIN_DECLS and G_END_DECLS to mean: 'in case
of C++: extern "C" { ... }' analogous to glibc __BEGIN_DECLS and
__END_DECLS.
* configure.in, gerror.h, gfileutils.h, gshell.h, gspawn.h,
gunicode.h, : Changed guard-macro names to something more
consistent.
* configure.in, *.h: Use G_BEGIN_DECLS and G_END_DECLS.
2000-10-12 13:52:07 +02:00
|
|
|
#include <stdarg.h>
|
2001-06-26 18:01:21 +02:00
|
|
|
#include <glib/gtypes.h>
|
2002-11-20 22:50:16 +01:00
|
|
|
#include <glib/gmacros.h>
|
2016-09-09 14:06:05 +02:00
|
|
|
#include <glib/gvariant.h>
|
Split glib.h into many header files mostly according to the resp.
2000-10-12 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h, galloca.h, garray.h, gasyncqueue.h, gbacktrace.h,
gcache.h, gcompletion.h, gconvert.h, gdataset.h, gdate.h, ghash.h,
ghook.h, giochannel.h, glist.h , gmacros.h, gmain.h, gmem.h,
gmessages.h, gnode.h, gprimes.h, gquark.h, gqueue.h, grand.h,
grel.h, gscanner.h, gslist.h, gstrfuncs.h, gstring.h, gthread.h,
gthreadpool.h, gtimer.h, gtree.h, gtypes.h, gutils.h: Split glib.h
into many header files mostly according to the resp. *.c-files.
* gmacros.h: Added G_BEGIN_DECLS and G_END_DECLS to mean: 'in case
of C++: extern "C" { ... }' analogous to glibc __BEGIN_DECLS and
__END_DECLS.
* configure.in, gerror.h, gfileutils.h, gshell.h, gspawn.h,
gunicode.h, : Changed guard-macro names to something more
consistent.
* configure.in, *.h: Use G_BEGIN_DECLS and G_END_DECLS.
2000-10-12 13:52:07 +02:00
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
2003-02-06 20:57:14 +01:00
|
|
|
/* calculate a string size, guaranteed to fit format + args.
|
Split glib.h into many header files mostly according to the resp.
2000-10-12 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h, galloca.h, garray.h, gasyncqueue.h, gbacktrace.h,
gcache.h, gcompletion.h, gconvert.h, gdataset.h, gdate.h, ghash.h,
ghook.h, giochannel.h, glist.h , gmacros.h, gmain.h, gmem.h,
gmessages.h, gnode.h, gprimes.h, gquark.h, gqueue.h, grand.h,
grel.h, gscanner.h, gslist.h, gstrfuncs.h, gstring.h, gthread.h,
gthreadpool.h, gtimer.h, gtree.h, gtypes.h, gutils.h: Split glib.h
into many header files mostly according to the resp. *.c-files.
* gmacros.h: Added G_BEGIN_DECLS and G_END_DECLS to mean: 'in case
of C++: extern "C" { ... }' analogous to glibc __BEGIN_DECLS and
__END_DECLS.
* configure.in, gerror.h, gfileutils.h, gshell.h, gspawn.h,
gunicode.h, : Changed guard-macro names to something more
consistent.
* configure.in, *.h: Use G_BEGIN_DECLS and G_END_DECLS.
2000-10-12 13:52:07 +02:00
|
|
|
*/
|
2012-12-06 20:04:59 +01:00
|
|
|
GLIB_AVAILABLE_IN_ALL
|
Changes for 64-bit cleanliness, loosely based on patch from Mark Murnane.
Wed Jun 20 12:00:54 2001 Owen Taylor <otaylor@redhat.com>
Changes for 64-bit cleanliness, loosely based on patch
from Mark Murnane.
* gconvert.c (g_convert/g_convert_with_fallback): Remove
workarounds for since-fixed GNU libc bugs. Minor
doc fix.
* gconvert.[ch]: Change gint to gsize/gssize as
appropriate.
* gconvert.c (g_locale/filename_to/from_utf8): Fix incorrect
computation of bytes_read / bytes_written.
* gfileutils.[ch] (g_file_get_contents): Make length
out parameter 'gsize *len'.
* ghook.c (g_hook_compare_ids): Don't compare a
and b as 'a - b'.
* gmacros.h (GSIZE_TO_POINTER): Add GPOINTER_TO_SIZE,
GSIZE_TO_POINTER.
* gmain.c (g_timeout_prepare): Rewrite to avoid
overflows. (Fixes bug when system clock skews
backwards more than 24 days.)
* gmarkup.[ch]: Make lengths passed to callbacks
gsize, length for g_markup_parse-context_parse(),
g_markup_escape_text() gssize.
* gmessages.[ch] (g_printf_string_upper_bound): Change
return value to gsize.
* gmessages.c (printf_string_upper_bound): Remove
a ridiculous use of 'inline' on a 300 line function.
* gstring.[ch]: Represent size of string as a gsize,
not gint. Make parameters to functions take gsize,
or gssize where -1 is allowed.
* gstring.c (g_string_erase): Make
g_string_erase (string, pos, -1) a synonym for
g_string_truncate for consistency with other G*
APIs.
* gstrfuncs.[ch]: Make all functions taking a string
length, take a gsize, or gssize if -1 is allowed.
(g_strstr_len, g_strrstr_len). Also fix some boundary
conditions in g_str[r]str[_len].
* gutf8.c tests/unicode-encoding.c: Make parameters that
are byte lengths gsize, gssize as appropriate. Make
character offsets, other counts, glong.
* gasyncqueue.c gcompletion.c
timeloop.c timeloop-basic.c gutils.c gspawn.c.
Small 64 bit cleanliness fixups.
* glist.c (g_list_sort2, g_list_sort_real): Fix functions
that should have been static.
* gdate.c (g_date_fill_parse_tokens): Fix extra
declaration that was shadowing another.
* tests/module-test.c: Include string.h
Mon Jun 18 15:43:29 2001 Owen Taylor <otaylor@redhat.com>
* gutf8.c (g_get_charset): Make argument
G_CONST_RETURN char **.
2001-06-23 15:55:09 +02:00
|
|
|
gsize g_printf_string_upper_bound (const gchar* format,
|
2013-01-13 17:05:14 +01:00
|
|
|
va_list args) G_GNUC_PRINTF(1, 0);
|
Split glib.h into many header files mostly according to the resp.
2000-10-12 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h, galloca.h, garray.h, gasyncqueue.h, gbacktrace.h,
gcache.h, gcompletion.h, gconvert.h, gdataset.h, gdate.h, ghash.h,
ghook.h, giochannel.h, glist.h , gmacros.h, gmain.h, gmem.h,
gmessages.h, gnode.h, gprimes.h, gquark.h, gqueue.h, grand.h,
grel.h, gscanner.h, gslist.h, gstrfuncs.h, gstring.h, gthread.h,
gthreadpool.h, gtimer.h, gtree.h, gtypes.h, gutils.h: Split glib.h
into many header files mostly according to the resp. *.c-files.
* gmacros.h: Added G_BEGIN_DECLS and G_END_DECLS to mean: 'in case
of C++: extern "C" { ... }' analogous to glibc __BEGIN_DECLS and
__END_DECLS.
* configure.in, gerror.h, gfileutils.h, gshell.h, gspawn.h,
gunicode.h, : Changed guard-macro names to something more
consistent.
* configure.in, *.h: Use G_BEGIN_DECLS and G_END_DECLS.
2000-10-12 13:52:07 +02:00
|
|
|
|
|
|
|
/* Log level shift offset for user defined
|
|
|
|
* log levels (0-7 are used by GLib).
|
|
|
|
*/
|
|
|
|
#define G_LOG_LEVEL_USER_SHIFT (8)
|
|
|
|
|
|
|
|
/* Glib log levels and flags.
|
|
|
|
*/
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
/* log flags */
|
|
|
|
G_LOG_FLAG_RECURSION = 1 << 0,
|
|
|
|
G_LOG_FLAG_FATAL = 1 << 1,
|
|
|
|
|
|
|
|
/* GLib log levels */
|
|
|
|
G_LOG_LEVEL_ERROR = 1 << 2, /* always fatal */
|
|
|
|
G_LOG_LEVEL_CRITICAL = 1 << 3,
|
|
|
|
G_LOG_LEVEL_WARNING = 1 << 4,
|
|
|
|
G_LOG_LEVEL_MESSAGE = 1 << 5,
|
|
|
|
G_LOG_LEVEL_INFO = 1 << 6,
|
|
|
|
G_LOG_LEVEL_DEBUG = 1 << 7,
|
|
|
|
|
|
|
|
G_LOG_LEVEL_MASK = ~(G_LOG_FLAG_RECURSION | G_LOG_FLAG_FATAL)
|
|
|
|
} GLogLevelFlags;
|
|
|
|
|
|
|
|
/* GLib log levels that are considered fatal by default */
|
|
|
|
#define G_LOG_FATAL_MASK (G_LOG_FLAG_RECURSION | G_LOG_LEVEL_ERROR)
|
|
|
|
|
|
|
|
typedef void (*GLogFunc) (const gchar *log_domain,
|
|
|
|
GLogLevelFlags log_level,
|
|
|
|
const gchar *message,
|
|
|
|
gpointer user_data);
|
|
|
|
|
|
|
|
/* Logging mechanism
|
|
|
|
*/
|
2012-12-06 20:04:59 +01:00
|
|
|
GLIB_AVAILABLE_IN_ALL
|
Split glib.h into many header files mostly according to the resp.
2000-10-12 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h, galloca.h, garray.h, gasyncqueue.h, gbacktrace.h,
gcache.h, gcompletion.h, gconvert.h, gdataset.h, gdate.h, ghash.h,
ghook.h, giochannel.h, glist.h , gmacros.h, gmain.h, gmem.h,
gmessages.h, gnode.h, gprimes.h, gquark.h, gqueue.h, grand.h,
grel.h, gscanner.h, gslist.h, gstrfuncs.h, gstring.h, gthread.h,
gthreadpool.h, gtimer.h, gtree.h, gtypes.h, gutils.h: Split glib.h
into many header files mostly according to the resp. *.c-files.
* gmacros.h: Added G_BEGIN_DECLS and G_END_DECLS to mean: 'in case
of C++: extern "C" { ... }' analogous to glibc __BEGIN_DECLS and
__END_DECLS.
* configure.in, gerror.h, gfileutils.h, gshell.h, gspawn.h,
gunicode.h, : Changed guard-macro names to something more
consistent.
* configure.in, *.h: Use G_BEGIN_DECLS and G_END_DECLS.
2000-10-12 13:52:07 +02:00
|
|
|
guint g_log_set_handler (const gchar *log_domain,
|
|
|
|
GLogLevelFlags log_levels,
|
|
|
|
GLogFunc log_func,
|
|
|
|
gpointer user_data);
|
2015-06-11 07:52:40 +02:00
|
|
|
GLIB_AVAILABLE_IN_2_46
|
2014-11-29 05:31:00 +01:00
|
|
|
guint g_log_set_handler_full (const gchar *log_domain,
|
|
|
|
GLogLevelFlags log_levels,
|
|
|
|
GLogFunc log_func,
|
|
|
|
gpointer user_data,
|
|
|
|
GDestroyNotify destroy);
|
2012-12-06 20:04:59 +01:00
|
|
|
GLIB_AVAILABLE_IN_ALL
|
Split glib.h into many header files mostly according to the resp.
2000-10-12 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h, galloca.h, garray.h, gasyncqueue.h, gbacktrace.h,
gcache.h, gcompletion.h, gconvert.h, gdataset.h, gdate.h, ghash.h,
ghook.h, giochannel.h, glist.h , gmacros.h, gmain.h, gmem.h,
gmessages.h, gnode.h, gprimes.h, gquark.h, gqueue.h, grand.h,
grel.h, gscanner.h, gslist.h, gstrfuncs.h, gstring.h, gthread.h,
gthreadpool.h, gtimer.h, gtree.h, gtypes.h, gutils.h: Split glib.h
into many header files mostly according to the resp. *.c-files.
* gmacros.h: Added G_BEGIN_DECLS and G_END_DECLS to mean: 'in case
of C++: extern "C" { ... }' analogous to glibc __BEGIN_DECLS and
__END_DECLS.
* configure.in, gerror.h, gfileutils.h, gshell.h, gspawn.h,
gunicode.h, : Changed guard-macro names to something more
consistent.
* configure.in, *.h: Use G_BEGIN_DECLS and G_END_DECLS.
2000-10-12 13:52:07 +02:00
|
|
|
void g_log_remove_handler (const gchar *log_domain,
|
|
|
|
guint handler_id);
|
2012-12-06 20:04:59 +01:00
|
|
|
GLIB_AVAILABLE_IN_ALL
|
Split glib.h into many header files mostly according to the resp.
2000-10-12 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h, galloca.h, garray.h, gasyncqueue.h, gbacktrace.h,
gcache.h, gcompletion.h, gconvert.h, gdataset.h, gdate.h, ghash.h,
ghook.h, giochannel.h, glist.h , gmacros.h, gmain.h, gmem.h,
gmessages.h, gnode.h, gprimes.h, gquark.h, gqueue.h, grand.h,
grel.h, gscanner.h, gslist.h, gstrfuncs.h, gstring.h, gthread.h,
gthreadpool.h, gtimer.h, gtree.h, gtypes.h, gutils.h: Split glib.h
into many header files mostly according to the resp. *.c-files.
* gmacros.h: Added G_BEGIN_DECLS and G_END_DECLS to mean: 'in case
of C++: extern "C" { ... }' analogous to glibc __BEGIN_DECLS and
__END_DECLS.
* configure.in, gerror.h, gfileutils.h, gshell.h, gspawn.h,
gunicode.h, : Changed guard-macro names to something more
consistent.
* configure.in, *.h: Use G_BEGIN_DECLS and G_END_DECLS.
2000-10-12 13:52:07 +02:00
|
|
|
void g_log_default_handler (const gchar *log_domain,
|
|
|
|
GLogLevelFlags log_level,
|
|
|
|
const gchar *message,
|
|
|
|
gpointer unused_data);
|
2012-12-06 20:04:59 +01:00
|
|
|
GLIB_AVAILABLE_IN_ALL
|
2004-09-05 07:46:33 +02:00
|
|
|
GLogFunc g_log_set_default_handler (GLogFunc log_func,
|
|
|
|
gpointer user_data);
|
2012-12-06 20:04:59 +01:00
|
|
|
GLIB_AVAILABLE_IN_ALL
|
Split glib.h into many header files mostly according to the resp.
2000-10-12 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h, galloca.h, garray.h, gasyncqueue.h, gbacktrace.h,
gcache.h, gcompletion.h, gconvert.h, gdataset.h, gdate.h, ghash.h,
ghook.h, giochannel.h, glist.h , gmacros.h, gmain.h, gmem.h,
gmessages.h, gnode.h, gprimes.h, gquark.h, gqueue.h, grand.h,
grel.h, gscanner.h, gslist.h, gstrfuncs.h, gstring.h, gthread.h,
gthreadpool.h, gtimer.h, gtree.h, gtypes.h, gutils.h: Split glib.h
into many header files mostly according to the resp. *.c-files.
* gmacros.h: Added G_BEGIN_DECLS and G_END_DECLS to mean: 'in case
of C++: extern "C" { ... }' analogous to glibc __BEGIN_DECLS and
__END_DECLS.
* configure.in, gerror.h, gfileutils.h, gshell.h, gspawn.h,
gunicode.h, : Changed guard-macro names to something more
consistent.
* configure.in, *.h: Use G_BEGIN_DECLS and G_END_DECLS.
2000-10-12 13:52:07 +02:00
|
|
|
void g_log (const gchar *log_domain,
|
|
|
|
GLogLevelFlags log_level,
|
|
|
|
const gchar *format,
|
|
|
|
...) G_GNUC_PRINTF (3, 4);
|
2012-12-06 20:04:59 +01:00
|
|
|
GLIB_AVAILABLE_IN_ALL
|
Split glib.h into many header files mostly according to the resp.
2000-10-12 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h, galloca.h, garray.h, gasyncqueue.h, gbacktrace.h,
gcache.h, gcompletion.h, gconvert.h, gdataset.h, gdate.h, ghash.h,
ghook.h, giochannel.h, glist.h , gmacros.h, gmain.h, gmem.h,
gmessages.h, gnode.h, gprimes.h, gquark.h, gqueue.h, grand.h,
grel.h, gscanner.h, gslist.h, gstrfuncs.h, gstring.h, gthread.h,
gthreadpool.h, gtimer.h, gtree.h, gtypes.h, gutils.h: Split glib.h
into many header files mostly according to the resp. *.c-files.
* gmacros.h: Added G_BEGIN_DECLS and G_END_DECLS to mean: 'in case
of C++: extern "C" { ... }' analogous to glibc __BEGIN_DECLS and
__END_DECLS.
* configure.in, gerror.h, gfileutils.h, gshell.h, gspawn.h,
gunicode.h, : Changed guard-macro names to something more
consistent.
* configure.in, *.h: Use G_BEGIN_DECLS and G_END_DECLS.
2000-10-12 13:52:07 +02:00
|
|
|
void g_logv (const gchar *log_domain,
|
|
|
|
GLogLevelFlags log_level,
|
|
|
|
const gchar *format,
|
2013-01-13 17:05:14 +01:00
|
|
|
va_list args) G_GNUC_PRINTF(3, 0);
|
2012-12-06 20:04:59 +01:00
|
|
|
GLIB_AVAILABLE_IN_ALL
|
Split glib.h into many header files mostly according to the resp.
2000-10-12 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h, galloca.h, garray.h, gasyncqueue.h, gbacktrace.h,
gcache.h, gcompletion.h, gconvert.h, gdataset.h, gdate.h, ghash.h,
ghook.h, giochannel.h, glist.h , gmacros.h, gmain.h, gmem.h,
gmessages.h, gnode.h, gprimes.h, gquark.h, gqueue.h, grand.h,
grel.h, gscanner.h, gslist.h, gstrfuncs.h, gstring.h, gthread.h,
gthreadpool.h, gtimer.h, gtree.h, gtypes.h, gutils.h: Split glib.h
into many header files mostly according to the resp. *.c-files.
* gmacros.h: Added G_BEGIN_DECLS and G_END_DECLS to mean: 'in case
of C++: extern "C" { ... }' analogous to glibc __BEGIN_DECLS and
__END_DECLS.
* configure.in, gerror.h, gfileutils.h, gshell.h, gspawn.h,
gunicode.h, : Changed guard-macro names to something more
consistent.
* configure.in, *.h: Use G_BEGIN_DECLS and G_END_DECLS.
2000-10-12 13:52:07 +02:00
|
|
|
GLogLevelFlags g_log_set_fatal_mask (const gchar *log_domain,
|
|
|
|
GLogLevelFlags fatal_mask);
|
2012-12-06 20:04:59 +01:00
|
|
|
GLIB_AVAILABLE_IN_ALL
|
Split glib.h into many header files mostly according to the resp.
2000-10-12 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h, galloca.h, garray.h, gasyncqueue.h, gbacktrace.h,
gcache.h, gcompletion.h, gconvert.h, gdataset.h, gdate.h, ghash.h,
ghook.h, giochannel.h, glist.h , gmacros.h, gmain.h, gmem.h,
gmessages.h, gnode.h, gprimes.h, gquark.h, gqueue.h, grand.h,
grel.h, gscanner.h, gslist.h, gstrfuncs.h, gstring.h, gthread.h,
gthreadpool.h, gtimer.h, gtree.h, gtypes.h, gutils.h: Split glib.h
into many header files mostly according to the resp. *.c-files.
* gmacros.h: Added G_BEGIN_DECLS and G_END_DECLS to mean: 'in case
of C++: extern "C" { ... }' analogous to glibc __BEGIN_DECLS and
__END_DECLS.
* configure.in, gerror.h, gfileutils.h, gshell.h, gspawn.h,
gunicode.h, : Changed guard-macro names to something more
consistent.
* configure.in, *.h: Use G_BEGIN_DECLS and G_END_DECLS.
2000-10-12 13:52:07 +02:00
|
|
|
GLogLevelFlags g_log_set_always_fatal (GLogLevelFlags fatal_mask);
|
|
|
|
|
2016-02-20 13:34:29 +01:00
|
|
|
/* Structured logging mechanism. */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* GLogWriterOutput:
|
|
|
|
* @G_LOG_WRITER_HANDLED: Log writer has handled the log entry.
|
|
|
|
* @G_LOG_WRITER_UNHANDLED: Log writer could not handle the log entry.
|
|
|
|
*
|
|
|
|
* Return values from #GLogWriterFuncs to indicate whether the given log entry
|
|
|
|
* was successfully handled by the writer, or whether there was an error in
|
|
|
|
* handling it (and hence a fallback writer should be used).
|
|
|
|
*
|
|
|
|
* If a #GLogWriterFunc ignores a log entry, it should return
|
|
|
|
* %G_LOG_WRITER_HANDLED.
|
|
|
|
*
|
|
|
|
* Since: 2.50
|
|
|
|
*/
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
G_LOG_WRITER_HANDLED = 1,
|
|
|
|
G_LOG_WRITER_UNHANDLED = 0,
|
|
|
|
} GLogWriterOutput;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* GLogField:
|
|
|
|
* @key: field name (UTF-8 string)
|
|
|
|
* @value: field value (arbitrary bytes)
|
|
|
|
* @length: length of @value, in bytes, or -1 if it is nul-terminated
|
|
|
|
*
|
|
|
|
* Structure representing a single field in a structured log entry. See
|
|
|
|
* g_log_structured() for details.
|
|
|
|
*
|
|
|
|
* Log fields may contain arbitrary values, including binary with embedded nul
|
|
|
|
* bytes. If the field contains a string, the string must be UTF-8 encoded and
|
|
|
|
* have a trailing nul byte. Otherwise, @length must be set to a non-negative
|
|
|
|
* value.
|
|
|
|
*
|
|
|
|
* Since: 2.50
|
|
|
|
*/
|
2016-07-21 01:42:52 +02:00
|
|
|
typedef struct _GLogField GLogField;
|
|
|
|
struct _GLogField
|
2016-02-20 13:34:29 +01:00
|
|
|
{
|
|
|
|
const gchar *key;
|
|
|
|
gconstpointer value;
|
|
|
|
gssize length;
|
2016-07-21 01:42:52 +02:00
|
|
|
};
|
2016-02-20 13:34:29 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* GLogWriterFunc:
|
|
|
|
* @log_level: log level of the message
|
|
|
|
* @fields: (array length=n_fields): fields forming the message
|
|
|
|
* @n_fields: number of @fields
|
|
|
|
* @user_data: user data passed to g_log_set_writer_func()
|
|
|
|
*
|
|
|
|
* Writer function for log entries. A log entry is a collection of one or more
|
|
|
|
* #GLogFields, using the standard [field names from journal
|
|
|
|
* specification](https://www.freedesktop.org/software/systemd/man/systemd.journal-fields.html).
|
|
|
|
* See g_log_structured() for more information.
|
|
|
|
*
|
|
|
|
* Writer functions must ignore fields which they do not recognise, unless they
|
|
|
|
* can write arbitrary binary output, as field values may be arbitrary binary.
|
|
|
|
*
|
|
|
|
* @log_level is guaranteed to be included in @fields as the `PRIORITY` field,
|
|
|
|
* but is provided separately for convenience of deciding whether or where to
|
|
|
|
* output the log entry.
|
|
|
|
*
|
2017-06-14 10:56:13 +02:00
|
|
|
* Writer functions should return %G_LOG_WRITER_HANDLED if they handled the log
|
|
|
|
* message successfully or if they deliberately ignored it. If there was an
|
|
|
|
* error handling the message (for example, if the writer function is meant to
|
|
|
|
* send messages to a remote logging server and there is a network error), it
|
|
|
|
* should return %G_LOG_WRITER_UNHANDLED. This allows writer functions to be
|
|
|
|
* chained and fall back to simpler handlers in case of failure.
|
|
|
|
*
|
2016-02-20 13:34:29 +01:00
|
|
|
* Returns: %G_LOG_WRITER_HANDLED if the log entry was handled successfully;
|
|
|
|
* %G_LOG_WRITER_UNHANDLED otherwise
|
|
|
|
* Since: 2.50
|
|
|
|
*/
|
|
|
|
typedef GLogWriterOutput (*GLogWriterFunc) (GLogLevelFlags log_level,
|
|
|
|
const GLogField *fields,
|
|
|
|
gsize n_fields,
|
|
|
|
gpointer user_data);
|
|
|
|
|
|
|
|
GLIB_AVAILABLE_IN_2_50
|
|
|
|
void g_log_structured (const gchar *log_domain,
|
|
|
|
GLogLevelFlags log_level,
|
Redo structured logging API
It turns out that the current approach of parsing g_log_structured
varargs is unworkable, because vprintf is not guaranteed to advance
the passed-in va_list. So, we have to reshuffle the argument list
a bit; I've come up with this approach:
g_log_structured (domain, level,
key-value pairs...
"MESSAGE", format,
printf arguments);
This requires a "MESSAGE" key to always be present, and it requires
the "MESSAGE"-format pair to be last, but it avoids an extra NULL
as marker after the key-value pairs. And it can be parsed with a
single pass over the va_list, without any va_copy.
Since we have G_LOG_USE_STRUCTURED, the separate ...structured()
convenience macros are pretty pointless, and I have dropped them
for now.
2016-07-21 00:36:52 +02:00
|
|
|
...);
|
2016-02-20 13:34:29 +01:00
|
|
|
GLIB_AVAILABLE_IN_2_50
|
|
|
|
void g_log_structured_array (GLogLevelFlags log_level,
|
|
|
|
const GLogField *fields,
|
|
|
|
gsize n_fields);
|
|
|
|
|
2016-09-09 14:06:05 +02:00
|
|
|
GLIB_AVAILABLE_IN_2_50
|
|
|
|
void g_log_variant (const gchar *log_domain,
|
|
|
|
GLogLevelFlags log_level,
|
|
|
|
GVariant *fields);
|
|
|
|
|
2016-02-20 13:34:29 +01:00
|
|
|
GLIB_AVAILABLE_IN_2_50
|
|
|
|
void g_log_set_writer_func (GLogWriterFunc func,
|
|
|
|
gpointer user_data,
|
|
|
|
GDestroyNotify user_data_free);
|
|
|
|
|
2016-03-15 11:47:39 +01:00
|
|
|
GLIB_AVAILABLE_IN_2_50
|
|
|
|
gboolean g_log_writer_supports_color (gint output_fd);
|
2016-02-20 13:34:29 +01:00
|
|
|
GLIB_AVAILABLE_IN_2_50
|
|
|
|
gboolean g_log_writer_is_journald (gint output_fd);
|
|
|
|
|
|
|
|
GLIB_AVAILABLE_IN_2_50
|
|
|
|
gchar *g_log_writer_format_fields (GLogLevelFlags log_level,
|
|
|
|
const GLogField *fields,
|
2016-03-15 11:47:39 +01:00
|
|
|
gsize n_fields,
|
|
|
|
gboolean use_color);
|
2016-02-20 13:34:29 +01:00
|
|
|
|
|
|
|
GLIB_AVAILABLE_IN_2_50
|
|
|
|
GLogWriterOutput g_log_writer_journald (GLogLevelFlags log_level,
|
|
|
|
const GLogField *fields,
|
|
|
|
gsize n_fields,
|
|
|
|
gpointer user_data);
|
|
|
|
GLIB_AVAILABLE_IN_2_50
|
|
|
|
GLogWriterOutput g_log_writer_standard_streams (GLogLevelFlags log_level,
|
|
|
|
const GLogField *fields,
|
|
|
|
gsize n_fields,
|
|
|
|
gpointer user_data);
|
|
|
|
GLIB_AVAILABLE_IN_2_50
|
|
|
|
GLogWriterOutput g_log_writer_default (GLogLevelFlags log_level,
|
|
|
|
const GLogField *fields,
|
|
|
|
gsize n_fields,
|
|
|
|
gpointer user_data);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* G_DEBUG_HERE:
|
|
|
|
*
|
Redo structured logging API
It turns out that the current approach of parsing g_log_structured
varargs is unworkable, because vprintf is not guaranteed to advance
the passed-in va_list. So, we have to reshuffle the argument list
a bit; I've come up with this approach:
g_log_structured (domain, level,
key-value pairs...
"MESSAGE", format,
printf arguments);
This requires a "MESSAGE" key to always be present, and it requires
the "MESSAGE"-format pair to be last, but it avoids an extra NULL
as marker after the key-value pairs. And it can be parsed with a
single pass over the va_list, without any va_copy.
Since we have G_LOG_USE_STRUCTURED, the separate ...structured()
convenience macros are pretty pointless, and I have dropped them
for now.
2016-07-21 00:36:52 +02:00
|
|
|
* A convenience form of g_log_structured(), recommended to be added to
|
2016-02-20 13:34:29 +01:00
|
|
|
* functions when debugging. It prints the current monotonic time and the code
|
|
|
|
* location using %G_STRLOC.
|
|
|
|
*
|
|
|
|
* Since: 2.50
|
|
|
|
*/
|
Redo structured logging API
It turns out that the current approach of parsing g_log_structured
varargs is unworkable, because vprintf is not guaranteed to advance
the passed-in va_list. So, we have to reshuffle the argument list
a bit; I've come up with this approach:
g_log_structured (domain, level,
key-value pairs...
"MESSAGE", format,
printf arguments);
This requires a "MESSAGE" key to always be present, and it requires
the "MESSAGE"-format pair to be last, but it avoids an extra NULL
as marker after the key-value pairs. And it can be parsed with a
single pass over the va_list, without any va_copy.
Since we have G_LOG_USE_STRUCTURED, the separate ...structured()
convenience macros are pretty pointless, and I have dropped them
for now.
2016-07-21 00:36:52 +02:00
|
|
|
#define G_DEBUG_HERE() \
|
|
|
|
g_log_structured (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, \
|
|
|
|
"CODE_FILE", __FILE__, \
|
|
|
|
"CODE_LINE", G_STRINGIFY (__LINE__), \
|
2016-07-27 10:37:09 +02:00
|
|
|
"CODE_FUNC", G_STRFUNC, \
|
Redo structured logging API
It turns out that the current approach of parsing g_log_structured
varargs is unworkable, because vprintf is not guaranteed to advance
the passed-in va_list. So, we have to reshuffle the argument list
a bit; I've come up with this approach:
g_log_structured (domain, level,
key-value pairs...
"MESSAGE", format,
printf arguments);
This requires a "MESSAGE" key to always be present, and it requires
the "MESSAGE"-format pair to be last, but it avoids an extra NULL
as marker after the key-value pairs. And it can be parsed with a
single pass over the va_list, without any va_copy.
Since we have G_LOG_USE_STRUCTURED, the separate ...structured()
convenience macros are pretty pointless, and I have dropped them
for now.
2016-07-21 00:36:52 +02:00
|
|
|
"MESSAGE", "%" G_GINT64_FORMAT ": %s", \
|
|
|
|
g_get_monotonic_time (), G_STRLOC)
|
2016-02-20 13:34:29 +01:00
|
|
|
|
2002-03-27 18:57:30 +01:00
|
|
|
/* internal */
|
2012-11-28 18:00:40 +01:00
|
|
|
void _g_log_fallback_handler (const gchar *log_domain,
|
2007-05-17 18:36:53 +02:00
|
|
|
GLogLevelFlags log_level,
|
|
|
|
const gchar *message,
|
|
|
|
gpointer unused_data);
|
2002-03-27 18:57:30 +01:00
|
|
|
|
2004-09-30 04:02:00 +02:00
|
|
|
/* Internal functions, used to implement the following macros */
|
2012-12-06 20:04:59 +01:00
|
|
|
GLIB_AVAILABLE_IN_ALL
|
2004-09-30 00:14:49 +02:00
|
|
|
void g_return_if_fail_warning (const char *log_domain,
|
|
|
|
const char *pretty_function,
|
2013-05-14 08:49:55 +02:00
|
|
|
const char *expression) G_ANALYZER_NORETURN;
|
2012-12-06 20:04:59 +01:00
|
|
|
GLIB_AVAILABLE_IN_ALL
|
2007-12-10 15:07:42 +01:00
|
|
|
void g_warn_message (const char *domain,
|
|
|
|
const char *file,
|
|
|
|
int line,
|
|
|
|
const char *func,
|
2013-05-14 08:49:55 +02:00
|
|
|
const char *warnexpr) G_ANALYZER_NORETURN;
|
2011-11-03 05:04:15 +01:00
|
|
|
GLIB_DEPRECATED
|
2004-09-30 04:02:00 +02:00
|
|
|
void g_assert_warning (const char *log_domain,
|
|
|
|
const char *file,
|
|
|
|
const int line,
|
|
|
|
const char *pretty_function,
|
2004-10-29 04:20:02 +02:00
|
|
|
const char *expression) G_GNUC_NORETURN;
|
2004-09-30 00:14:49 +02:00
|
|
|
|
2018-02-01 14:44:08 +01:00
|
|
|
GLIB_AVAILABLE_IN_2_56
|
|
|
|
void g_log_structured_standard (const gchar *log_domain,
|
|
|
|
GLogLevelFlags log_level,
|
|
|
|
const gchar *file,
|
|
|
|
const gchar *line,
|
|
|
|
const gchar *func,
|
|
|
|
const gchar *message_format,
|
|
|
|
...) G_GNUC_PRINTF (6, 7);
|
2002-03-27 18:57:30 +01:00
|
|
|
|
Split glib.h into many header files mostly according to the resp.
2000-10-12 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h, galloca.h, garray.h, gasyncqueue.h, gbacktrace.h,
gcache.h, gcompletion.h, gconvert.h, gdataset.h, gdate.h, ghash.h,
ghook.h, giochannel.h, glist.h , gmacros.h, gmain.h, gmem.h,
gmessages.h, gnode.h, gprimes.h, gquark.h, gqueue.h, grand.h,
grel.h, gscanner.h, gslist.h, gstrfuncs.h, gstring.h, gthread.h,
gthreadpool.h, gtimer.h, gtree.h, gtypes.h, gutils.h: Split glib.h
into many header files mostly according to the resp. *.c-files.
* gmacros.h: Added G_BEGIN_DECLS and G_END_DECLS to mean: 'in case
of C++: extern "C" { ... }' analogous to glibc __BEGIN_DECLS and
__END_DECLS.
* configure.in, gerror.h, gfileutils.h, gshell.h, gspawn.h,
gunicode.h, : Changed guard-macro names to something more
consistent.
* configure.in, *.h: Use G_BEGIN_DECLS and G_END_DECLS.
2000-10-12 13:52:07 +02:00
|
|
|
#ifndef G_LOG_DOMAIN
|
|
|
|
#define G_LOG_DOMAIN ((gchar*) 0)
|
|
|
|
#endif /* G_LOG_DOMAIN */
|
2013-05-14 08:49:55 +02:00
|
|
|
|
|
|
|
#if defined(G_HAVE_ISO_VARARGS) && !G_ANALYZER_ANALYZING
|
2016-07-18 05:22:31 +02:00
|
|
|
#ifdef G_LOG_USE_STRUCTURED
|
|
|
|
#define g_error(...) G_STMT_START { \
|
2018-02-01 14:44:08 +01:00
|
|
|
g_log_structured_standard (G_LOG_DOMAIN, G_LOG_LEVEL_ERROR, \
|
|
|
|
__FILE__, G_STRINGIFY (__LINE__), \
|
|
|
|
G_STRFUNC, __VA_ARGS__); \
|
2016-07-18 05:22:31 +02:00
|
|
|
for (;;) ; \
|
|
|
|
} G_STMT_END
|
2018-02-01 14:44:08 +01:00
|
|
|
#define g_message(...) g_log_structured_standard (G_LOG_DOMAIN, G_LOG_LEVEL_MESSAGE, \
|
|
|
|
__FILE__, G_STRINGIFY (__LINE__), \
|
|
|
|
G_STRFUNC, __VA_ARGS__)
|
|
|
|
#define g_critical(...) g_log_structured_standard (G_LOG_DOMAIN, G_LOG_LEVEL_CRITICAL, \
|
|
|
|
__FILE__, G_STRINGIFY (__LINE__), \
|
|
|
|
G_STRFUNC, __VA_ARGS__)
|
|
|
|
#define g_warning(...) g_log_structured_standard (G_LOG_DOMAIN, G_LOG_LEVEL_WARNING, \
|
|
|
|
__FILE__, G_STRINGIFY (__LINE__), \
|
|
|
|
G_STRFUNC, __VA_ARGS__)
|
|
|
|
#define g_info(...) g_log_structured_standard (G_LOG_DOMAIN, G_LOG_LEVEL_INFO, \
|
|
|
|
__FILE__, G_STRINGIFY (__LINE__), \
|
|
|
|
G_STRFUNC, __VA_ARGS__)
|
|
|
|
#define g_debug(...) g_log_structured_standard (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, \
|
|
|
|
__FILE__, G_STRINGIFY (__LINE__), \
|
|
|
|
G_STRFUNC, __VA_ARGS__)
|
2016-07-18 05:22:31 +02:00
|
|
|
#else
|
2009-06-27 10:03:47 +02:00
|
|
|
/* for(;;) ; so that GCC knows that control doesn't go past g_error().
|
|
|
|
* Put space before ending semicolon to avoid C++ build warnings.
|
|
|
|
*/
|
2008-02-07 08:13:39 +01:00
|
|
|
#define g_error(...) G_STMT_START { \
|
|
|
|
g_log (G_LOG_DOMAIN, \
|
Split glib.h into many header files mostly according to the resp.
2000-10-12 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h, galloca.h, garray.h, gasyncqueue.h, gbacktrace.h,
gcache.h, gcompletion.h, gconvert.h, gdataset.h, gdate.h, ghash.h,
ghook.h, giochannel.h, glist.h , gmacros.h, gmain.h, gmem.h,
gmessages.h, gnode.h, gprimes.h, gquark.h, gqueue.h, grand.h,
grel.h, gscanner.h, gslist.h, gstrfuncs.h, gstring.h, gthread.h,
gthreadpool.h, gtimer.h, gtree.h, gtypes.h, gutils.h: Split glib.h
into many header files mostly according to the resp. *.c-files.
* gmacros.h: Added G_BEGIN_DECLS and G_END_DECLS to mean: 'in case
of C++: extern "C" { ... }' analogous to glibc __BEGIN_DECLS and
__END_DECLS.
* configure.in, gerror.h, gfileutils.h, gshell.h, gspawn.h,
gunicode.h, : Changed guard-macro names to something more
consistent.
* configure.in, *.h: Use G_BEGIN_DECLS and G_END_DECLS.
2000-10-12 13:52:07 +02:00
|
|
|
G_LOG_LEVEL_ERROR, \
|
2008-02-07 08:13:39 +01:00
|
|
|
__VA_ARGS__); \
|
2009-06-27 10:03:47 +02:00
|
|
|
for (;;) ; \
|
2008-02-07 08:13:39 +01:00
|
|
|
} G_STMT_END
|
Split glib.h into many header files mostly according to the resp.
2000-10-12 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h, galloca.h, garray.h, gasyncqueue.h, gbacktrace.h,
gcache.h, gcompletion.h, gconvert.h, gdataset.h, gdate.h, ghash.h,
ghook.h, giochannel.h, glist.h , gmacros.h, gmain.h, gmem.h,
gmessages.h, gnode.h, gprimes.h, gquark.h, gqueue.h, grand.h,
grel.h, gscanner.h, gslist.h, gstrfuncs.h, gstring.h, gthread.h,
gthreadpool.h, gtimer.h, gtree.h, gtypes.h, gutils.h: Split glib.h
into many header files mostly according to the resp. *.c-files.
* gmacros.h: Added G_BEGIN_DECLS and G_END_DECLS to mean: 'in case
of C++: extern "C" { ... }' analogous to glibc __BEGIN_DECLS and
__END_DECLS.
* configure.in, gerror.h, gfileutils.h, gshell.h, gspawn.h,
gunicode.h, : Changed guard-macro names to something more
consistent.
* configure.in, *.h: Use G_BEGIN_DECLS and G_END_DECLS.
2000-10-12 13:52:07 +02:00
|
|
|
#define g_message(...) g_log (G_LOG_DOMAIN, \
|
|
|
|
G_LOG_LEVEL_MESSAGE, \
|
|
|
|
__VA_ARGS__)
|
|
|
|
#define g_critical(...) g_log (G_LOG_DOMAIN, \
|
|
|
|
G_LOG_LEVEL_CRITICAL, \
|
|
|
|
__VA_ARGS__)
|
|
|
|
#define g_warning(...) g_log (G_LOG_DOMAIN, \
|
|
|
|
G_LOG_LEVEL_WARNING, \
|
|
|
|
__VA_ARGS__)
|
2013-10-29 21:30:06 +01:00
|
|
|
#define g_info(...) g_log (G_LOG_DOMAIN, \
|
|
|
|
G_LOG_LEVEL_INFO, \
|
|
|
|
__VA_ARGS__)
|
2004-07-06 00:52:06 +02:00
|
|
|
#define g_debug(...) g_log (G_LOG_DOMAIN, \
|
|
|
|
G_LOG_LEVEL_DEBUG, \
|
|
|
|
__VA_ARGS__)
|
2016-07-18 05:22:31 +02:00
|
|
|
#endif
|
2013-05-14 08:49:55 +02:00
|
|
|
#elif defined(G_HAVE_GNUC_VARARGS) && !G_ANALYZER_ANALYZING
|
2016-07-18 05:22:31 +02:00
|
|
|
#ifdef G_LOG_USE_STRUCTURED
|
|
|
|
#define g_error(format...) G_STMT_START { \
|
2018-02-01 14:44:08 +01:00
|
|
|
g_log_structured_standard (G_LOG_DOMAIN, G_LOG_LEVEL_ERROR, \
|
|
|
|
__FILE__, G_STRINGIFY (__LINE__), \
|
|
|
|
G_STRFUNC, format); \
|
2016-07-18 05:22:31 +02:00
|
|
|
for (;;) ; \
|
|
|
|
} G_STMT_END
|
2018-02-01 14:44:08 +01:00
|
|
|
#define g_message(format...) g_log_structured_standard (G_LOG_DOMAIN, G_LOG_LEVEL_MESSAGE, \
|
|
|
|
__FILE__, G_STRINGIFY (__LINE__), \
|
|
|
|
G_STRFUNC, format)
|
|
|
|
#define g_critical(format...) g_log_structured_standard (G_LOG_DOMAIN, G_LOG_LEVEL_CRITICAL, \
|
|
|
|
__FILE__, G_STRINGIFY (__LINE__), \
|
|
|
|
G_STRFUNC, format)
|
|
|
|
#define g_warning(format...) g_log_structured_standard (G_LOG_DOMAIN, G_LOG_LEVEL_WARNING, \
|
|
|
|
__FILE__, G_STRINGIFY (__LINE__), \
|
|
|
|
G_STRFUNC, format)
|
|
|
|
#define g_info(format...) g_log_structured_standard (G_LOG_DOMAIN, G_LOG_LEVEL_INFO, \
|
|
|
|
__FILE__, G_STRINGIFY (__LINE__), \
|
|
|
|
G_STRFUNC, format)
|
|
|
|
#define g_debug(format...) g_log_structured_standard (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, \
|
|
|
|
__FILE__, G_STRINGIFY (__LINE__), \
|
|
|
|
G_STRFUNC, format)
|
2016-07-18 05:22:31 +02:00
|
|
|
#else
|
2008-02-07 08:13:39 +01:00
|
|
|
#define g_error(format...) G_STMT_START { \
|
|
|
|
g_log (G_LOG_DOMAIN, \
|
Split glib.h into many header files mostly according to the resp.
2000-10-12 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h, galloca.h, garray.h, gasyncqueue.h, gbacktrace.h,
gcache.h, gcompletion.h, gconvert.h, gdataset.h, gdate.h, ghash.h,
ghook.h, giochannel.h, glist.h , gmacros.h, gmain.h, gmem.h,
gmessages.h, gnode.h, gprimes.h, gquark.h, gqueue.h, grand.h,
grel.h, gscanner.h, gslist.h, gstrfuncs.h, gstring.h, gthread.h,
gthreadpool.h, gtimer.h, gtree.h, gtypes.h, gutils.h: Split glib.h
into many header files mostly according to the resp. *.c-files.
* gmacros.h: Added G_BEGIN_DECLS and G_END_DECLS to mean: 'in case
of C++: extern "C" { ... }' analogous to glibc __BEGIN_DECLS and
__END_DECLS.
* configure.in, gerror.h, gfileutils.h, gshell.h, gspawn.h,
gunicode.h, : Changed guard-macro names to something more
consistent.
* configure.in, *.h: Use G_BEGIN_DECLS and G_END_DECLS.
2000-10-12 13:52:07 +02:00
|
|
|
G_LOG_LEVEL_ERROR, \
|
2008-02-07 08:13:39 +01:00
|
|
|
format); \
|
2009-06-27 10:03:47 +02:00
|
|
|
for (;;) ; \
|
2008-02-07 08:13:39 +01:00
|
|
|
} G_STMT_END
|
2016-07-18 05:22:31 +02:00
|
|
|
|
Split glib.h into many header files mostly according to the resp.
2000-10-12 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h, galloca.h, garray.h, gasyncqueue.h, gbacktrace.h,
gcache.h, gcompletion.h, gconvert.h, gdataset.h, gdate.h, ghash.h,
ghook.h, giochannel.h, glist.h , gmacros.h, gmain.h, gmem.h,
gmessages.h, gnode.h, gprimes.h, gquark.h, gqueue.h, grand.h,
grel.h, gscanner.h, gslist.h, gstrfuncs.h, gstring.h, gthread.h,
gthreadpool.h, gtimer.h, gtree.h, gtypes.h, gutils.h: Split glib.h
into many header files mostly according to the resp. *.c-files.
* gmacros.h: Added G_BEGIN_DECLS and G_END_DECLS to mean: 'in case
of C++: extern "C" { ... }' analogous to glibc __BEGIN_DECLS and
__END_DECLS.
* configure.in, gerror.h, gfileutils.h, gshell.h, gspawn.h,
gunicode.h, : Changed guard-macro names to something more
consistent.
* configure.in, *.h: Use G_BEGIN_DECLS and G_END_DECLS.
2000-10-12 13:52:07 +02:00
|
|
|
#define g_message(format...) g_log (G_LOG_DOMAIN, \
|
|
|
|
G_LOG_LEVEL_MESSAGE, \
|
|
|
|
format)
|
|
|
|
#define g_critical(format...) g_log (G_LOG_DOMAIN, \
|
|
|
|
G_LOG_LEVEL_CRITICAL, \
|
|
|
|
format)
|
|
|
|
#define g_warning(format...) g_log (G_LOG_DOMAIN, \
|
|
|
|
G_LOG_LEVEL_WARNING, \
|
|
|
|
format)
|
2013-10-29 21:30:06 +01:00
|
|
|
#define g_info(format...) g_log (G_LOG_DOMAIN, \
|
|
|
|
G_LOG_LEVEL_INFO, \
|
|
|
|
format)
|
2004-07-06 00:52:06 +02:00
|
|
|
#define g_debug(format...) g_log (G_LOG_DOMAIN, \
|
2005-04-11 03:03:37 +02:00
|
|
|
G_LOG_LEVEL_DEBUG, \
|
2004-07-06 00:52:06 +02:00
|
|
|
format)
|
2016-07-18 05:22:31 +02:00
|
|
|
#endif
|
2001-05-18 18:00:54 +02:00
|
|
|
#else /* no varargs macros */
|
2015-02-18 18:18:42 +01:00
|
|
|
static void g_error (const gchar *format, ...) G_GNUC_NORETURN G_ANALYZER_NORETURN;
|
2013-09-28 18:31:52 +02:00
|
|
|
static void g_critical (const gchar *format, ...) G_ANALYZER_NORETURN;
|
|
|
|
|
2017-11-08 14:06:29 +01:00
|
|
|
static inline void
|
Split glib.h into many header files mostly according to the resp.
2000-10-12 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h, galloca.h, garray.h, gasyncqueue.h, gbacktrace.h,
gcache.h, gcompletion.h, gconvert.h, gdataset.h, gdate.h, ghash.h,
ghook.h, giochannel.h, glist.h , gmacros.h, gmain.h, gmem.h,
gmessages.h, gnode.h, gprimes.h, gquark.h, gqueue.h, grand.h,
grel.h, gscanner.h, gslist.h, gstrfuncs.h, gstring.h, gthread.h,
gthreadpool.h, gtimer.h, gtree.h, gtypes.h, gutils.h: Split glib.h
into many header files mostly according to the resp. *.c-files.
* gmacros.h: Added G_BEGIN_DECLS and G_END_DECLS to mean: 'in case
of C++: extern "C" { ... }' analogous to glibc __BEGIN_DECLS and
__END_DECLS.
* configure.in, gerror.h, gfileutils.h, gshell.h, gspawn.h,
gunicode.h, : Changed guard-macro names to something more
consistent.
* configure.in, *.h: Use G_BEGIN_DECLS and G_END_DECLS.
2000-10-12 13:52:07 +02:00
|
|
|
g_error (const gchar *format,
|
2013-09-28 18:31:52 +02:00
|
|
|
...)
|
Split glib.h into many header files mostly according to the resp.
2000-10-12 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h, galloca.h, garray.h, gasyncqueue.h, gbacktrace.h,
gcache.h, gcompletion.h, gconvert.h, gdataset.h, gdate.h, ghash.h,
ghook.h, giochannel.h, glist.h , gmacros.h, gmain.h, gmem.h,
gmessages.h, gnode.h, gprimes.h, gquark.h, gqueue.h, grand.h,
grel.h, gscanner.h, gslist.h, gstrfuncs.h, gstring.h, gthread.h,
gthreadpool.h, gtimer.h, gtree.h, gtypes.h, gutils.h: Split glib.h
into many header files mostly according to the resp. *.c-files.
* gmacros.h: Added G_BEGIN_DECLS and G_END_DECLS to mean: 'in case
of C++: extern "C" { ... }' analogous to glibc __BEGIN_DECLS and
__END_DECLS.
* configure.in, gerror.h, gfileutils.h, gshell.h, gspawn.h,
gunicode.h, : Changed guard-macro names to something more
consistent.
* configure.in, *.h: Use G_BEGIN_DECLS and G_END_DECLS.
2000-10-12 13:52:07 +02:00
|
|
|
{
|
|
|
|
va_list args;
|
|
|
|
va_start (args, format);
|
|
|
|
g_logv (G_LOG_DOMAIN, G_LOG_LEVEL_ERROR, format, args);
|
|
|
|
va_end (args);
|
2008-02-07 08:13:39 +01:00
|
|
|
|
2009-06-27 10:03:47 +02:00
|
|
|
for(;;) ;
|
Split glib.h into many header files mostly according to the resp.
2000-10-12 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h, galloca.h, garray.h, gasyncqueue.h, gbacktrace.h,
gcache.h, gcompletion.h, gconvert.h, gdataset.h, gdate.h, ghash.h,
ghook.h, giochannel.h, glist.h , gmacros.h, gmain.h, gmem.h,
gmessages.h, gnode.h, gprimes.h, gquark.h, gqueue.h, grand.h,
grel.h, gscanner.h, gslist.h, gstrfuncs.h, gstring.h, gthread.h,
gthreadpool.h, gtimer.h, gtree.h, gtypes.h, gutils.h: Split glib.h
into many header files mostly according to the resp. *.c-files.
* gmacros.h: Added G_BEGIN_DECLS and G_END_DECLS to mean: 'in case
of C++: extern "C" { ... }' analogous to glibc __BEGIN_DECLS and
__END_DECLS.
* configure.in, gerror.h, gfileutils.h, gshell.h, gspawn.h,
gunicode.h, : Changed guard-macro names to something more
consistent.
* configure.in, *.h: Use G_BEGIN_DECLS and G_END_DECLS.
2000-10-12 13:52:07 +02:00
|
|
|
}
|
2017-11-08 14:06:29 +01:00
|
|
|
static inline void
|
Split glib.h into many header files mostly according to the resp.
2000-10-12 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h, galloca.h, garray.h, gasyncqueue.h, gbacktrace.h,
gcache.h, gcompletion.h, gconvert.h, gdataset.h, gdate.h, ghash.h,
ghook.h, giochannel.h, glist.h , gmacros.h, gmain.h, gmem.h,
gmessages.h, gnode.h, gprimes.h, gquark.h, gqueue.h, grand.h,
grel.h, gscanner.h, gslist.h, gstrfuncs.h, gstring.h, gthread.h,
gthreadpool.h, gtimer.h, gtree.h, gtypes.h, gutils.h: Split glib.h
into many header files mostly according to the resp. *.c-files.
* gmacros.h: Added G_BEGIN_DECLS and G_END_DECLS to mean: 'in case
of C++: extern "C" { ... }' analogous to glibc __BEGIN_DECLS and
__END_DECLS.
* configure.in, gerror.h, gfileutils.h, gshell.h, gspawn.h,
gunicode.h, : Changed guard-macro names to something more
consistent.
* configure.in, *.h: Use G_BEGIN_DECLS and G_END_DECLS.
2000-10-12 13:52:07 +02:00
|
|
|
g_message (const gchar *format,
|
|
|
|
...)
|
|
|
|
{
|
|
|
|
va_list args;
|
|
|
|
va_start (args, format);
|
|
|
|
g_logv (G_LOG_DOMAIN, G_LOG_LEVEL_MESSAGE, format, args);
|
|
|
|
va_end (args);
|
|
|
|
}
|
2017-11-08 14:06:29 +01:00
|
|
|
static inline void
|
Split glib.h into many header files mostly according to the resp.
2000-10-12 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h, galloca.h, garray.h, gasyncqueue.h, gbacktrace.h,
gcache.h, gcompletion.h, gconvert.h, gdataset.h, gdate.h, ghash.h,
ghook.h, giochannel.h, glist.h , gmacros.h, gmain.h, gmem.h,
gmessages.h, gnode.h, gprimes.h, gquark.h, gqueue.h, grand.h,
grel.h, gscanner.h, gslist.h, gstrfuncs.h, gstring.h, gthread.h,
gthreadpool.h, gtimer.h, gtree.h, gtypes.h, gutils.h: Split glib.h
into many header files mostly according to the resp. *.c-files.
* gmacros.h: Added G_BEGIN_DECLS and G_END_DECLS to mean: 'in case
of C++: extern "C" { ... }' analogous to glibc __BEGIN_DECLS and
__END_DECLS.
* configure.in, gerror.h, gfileutils.h, gshell.h, gspawn.h,
gunicode.h, : Changed guard-macro names to something more
consistent.
* configure.in, *.h: Use G_BEGIN_DECLS and G_END_DECLS.
2000-10-12 13:52:07 +02:00
|
|
|
g_critical (const gchar *format,
|
2013-09-28 18:31:52 +02:00
|
|
|
...)
|
Split glib.h into many header files mostly according to the resp.
2000-10-12 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h, galloca.h, garray.h, gasyncqueue.h, gbacktrace.h,
gcache.h, gcompletion.h, gconvert.h, gdataset.h, gdate.h, ghash.h,
ghook.h, giochannel.h, glist.h , gmacros.h, gmain.h, gmem.h,
gmessages.h, gnode.h, gprimes.h, gquark.h, gqueue.h, grand.h,
grel.h, gscanner.h, gslist.h, gstrfuncs.h, gstring.h, gthread.h,
gthreadpool.h, gtimer.h, gtree.h, gtypes.h, gutils.h: Split glib.h
into many header files mostly according to the resp. *.c-files.
* gmacros.h: Added G_BEGIN_DECLS and G_END_DECLS to mean: 'in case
of C++: extern "C" { ... }' analogous to glibc __BEGIN_DECLS and
__END_DECLS.
* configure.in, gerror.h, gfileutils.h, gshell.h, gspawn.h,
gunicode.h, : Changed guard-macro names to something more
consistent.
* configure.in, *.h: Use G_BEGIN_DECLS and G_END_DECLS.
2000-10-12 13:52:07 +02:00
|
|
|
{
|
|
|
|
va_list args;
|
|
|
|
va_start (args, format);
|
|
|
|
g_logv (G_LOG_DOMAIN, G_LOG_LEVEL_CRITICAL, format, args);
|
|
|
|
va_end (args);
|
|
|
|
}
|
2017-11-08 14:06:29 +01:00
|
|
|
static inline void
|
Split glib.h into many header files mostly according to the resp.
2000-10-12 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h, galloca.h, garray.h, gasyncqueue.h, gbacktrace.h,
gcache.h, gcompletion.h, gconvert.h, gdataset.h, gdate.h, ghash.h,
ghook.h, giochannel.h, glist.h , gmacros.h, gmain.h, gmem.h,
gmessages.h, gnode.h, gprimes.h, gquark.h, gqueue.h, grand.h,
grel.h, gscanner.h, gslist.h, gstrfuncs.h, gstring.h, gthread.h,
gthreadpool.h, gtimer.h, gtree.h, gtypes.h, gutils.h: Split glib.h
into many header files mostly according to the resp. *.c-files.
* gmacros.h: Added G_BEGIN_DECLS and G_END_DECLS to mean: 'in case
of C++: extern "C" { ... }' analogous to glibc __BEGIN_DECLS and
__END_DECLS.
* configure.in, gerror.h, gfileutils.h, gshell.h, gspawn.h,
gunicode.h, : Changed guard-macro names to something more
consistent.
* configure.in, *.h: Use G_BEGIN_DECLS and G_END_DECLS.
2000-10-12 13:52:07 +02:00
|
|
|
g_warning (const gchar *format,
|
|
|
|
...)
|
|
|
|
{
|
|
|
|
va_list args;
|
|
|
|
va_start (args, format);
|
|
|
|
g_logv (G_LOG_DOMAIN, G_LOG_LEVEL_WARNING, format, args);
|
|
|
|
va_end (args);
|
|
|
|
}
|
2017-11-08 14:06:29 +01:00
|
|
|
static inline void
|
2013-10-29 21:30:06 +01:00
|
|
|
g_info (const gchar *format,
|
|
|
|
...)
|
|
|
|
{
|
|
|
|
va_list args;
|
|
|
|
va_start (args, format);
|
|
|
|
g_logv (G_LOG_DOMAIN, G_LOG_LEVEL_INFO, format, args);
|
|
|
|
va_end (args);
|
|
|
|
}
|
2017-11-08 14:06:29 +01:00
|
|
|
static inline void
|
2004-07-06 00:52:06 +02:00
|
|
|
g_debug (const gchar *format,
|
|
|
|
...)
|
|
|
|
{
|
|
|
|
va_list args;
|
|
|
|
va_start (args, format);
|
|
|
|
g_logv (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, format, args);
|
|
|
|
va_end (args);
|
|
|
|
}
|
Split glib.h into many header files mostly according to the resp.
2000-10-12 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h, galloca.h, garray.h, gasyncqueue.h, gbacktrace.h,
gcache.h, gcompletion.h, gconvert.h, gdataset.h, gdate.h, ghash.h,
ghook.h, giochannel.h, glist.h , gmacros.h, gmain.h, gmem.h,
gmessages.h, gnode.h, gprimes.h, gquark.h, gqueue.h, grand.h,
grel.h, gscanner.h, gslist.h, gstrfuncs.h, gstring.h, gthread.h,
gthreadpool.h, gtimer.h, gtree.h, gtypes.h, gutils.h: Split glib.h
into many header files mostly according to the resp. *.c-files.
* gmacros.h: Added G_BEGIN_DECLS and G_END_DECLS to mean: 'in case
of C++: extern "C" { ... }' analogous to glibc __BEGIN_DECLS and
__END_DECLS.
* configure.in, gerror.h, gfileutils.h, gshell.h, gspawn.h,
gunicode.h, : Changed guard-macro names to something more
consistent.
* configure.in, *.h: Use G_BEGIN_DECLS and G_END_DECLS.
2000-10-12 13:52:07 +02:00
|
|
|
#endif /* !__GNUC__ */
|
|
|
|
|
2011-07-20 02:40:28 +02:00
|
|
|
/**
|
|
|
|
* GPrintFunc:
|
|
|
|
* @string: the message to output
|
|
|
|
*
|
|
|
|
* Specifies the type of the print handler functions.
|
|
|
|
* These are called with the complete formatted string to output.
|
|
|
|
*/
|
Split glib.h into many header files mostly according to the resp.
2000-10-12 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h, galloca.h, garray.h, gasyncqueue.h, gbacktrace.h,
gcache.h, gcompletion.h, gconvert.h, gdataset.h, gdate.h, ghash.h,
ghook.h, giochannel.h, glist.h , gmacros.h, gmain.h, gmem.h,
gmessages.h, gnode.h, gprimes.h, gquark.h, gqueue.h, grand.h,
grel.h, gscanner.h, gslist.h, gstrfuncs.h, gstring.h, gthread.h,
gthreadpool.h, gtimer.h, gtree.h, gtypes.h, gutils.h: Split glib.h
into many header files mostly according to the resp. *.c-files.
* gmacros.h: Added G_BEGIN_DECLS and G_END_DECLS to mean: 'in case
of C++: extern "C" { ... }' analogous to glibc __BEGIN_DECLS and
__END_DECLS.
* configure.in, gerror.h, gfileutils.h, gshell.h, gspawn.h,
gunicode.h, : Changed guard-macro names to something more
consistent.
* configure.in, *.h: Use G_BEGIN_DECLS and G_END_DECLS.
2000-10-12 13:52:07 +02:00
|
|
|
typedef void (*GPrintFunc) (const gchar *string);
|
2012-12-06 20:04:59 +01:00
|
|
|
GLIB_AVAILABLE_IN_ALL
|
Split glib.h into many header files mostly according to the resp.
2000-10-12 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h, galloca.h, garray.h, gasyncqueue.h, gbacktrace.h,
gcache.h, gcompletion.h, gconvert.h, gdataset.h, gdate.h, ghash.h,
ghook.h, giochannel.h, glist.h , gmacros.h, gmain.h, gmem.h,
gmessages.h, gnode.h, gprimes.h, gquark.h, gqueue.h, grand.h,
grel.h, gscanner.h, gslist.h, gstrfuncs.h, gstring.h, gthread.h,
gthreadpool.h, gtimer.h, gtree.h, gtypes.h, gutils.h: Split glib.h
into many header files mostly according to the resp. *.c-files.
* gmacros.h: Added G_BEGIN_DECLS and G_END_DECLS to mean: 'in case
of C++: extern "C" { ... }' analogous to glibc __BEGIN_DECLS and
__END_DECLS.
* configure.in, gerror.h, gfileutils.h, gshell.h, gspawn.h,
gunicode.h, : Changed guard-macro names to something more
consistent.
* configure.in, *.h: Use G_BEGIN_DECLS and G_END_DECLS.
2000-10-12 13:52:07 +02:00
|
|
|
void g_print (const gchar *format,
|
|
|
|
...) G_GNUC_PRINTF (1, 2);
|
2012-12-06 20:04:59 +01:00
|
|
|
GLIB_AVAILABLE_IN_ALL
|
Split glib.h into many header files mostly according to the resp.
2000-10-12 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h, galloca.h, garray.h, gasyncqueue.h, gbacktrace.h,
gcache.h, gcompletion.h, gconvert.h, gdataset.h, gdate.h, ghash.h,
ghook.h, giochannel.h, glist.h , gmacros.h, gmain.h, gmem.h,
gmessages.h, gnode.h, gprimes.h, gquark.h, gqueue.h, grand.h,
grel.h, gscanner.h, gslist.h, gstrfuncs.h, gstring.h, gthread.h,
gthreadpool.h, gtimer.h, gtree.h, gtypes.h, gutils.h: Split glib.h
into many header files mostly according to the resp. *.c-files.
* gmacros.h: Added G_BEGIN_DECLS and G_END_DECLS to mean: 'in case
of C++: extern "C" { ... }' analogous to glibc __BEGIN_DECLS and
__END_DECLS.
* configure.in, gerror.h, gfileutils.h, gshell.h, gspawn.h,
gunicode.h, : Changed guard-macro names to something more
consistent.
* configure.in, *.h: Use G_BEGIN_DECLS and G_END_DECLS.
2000-10-12 13:52:07 +02:00
|
|
|
GPrintFunc g_set_print_handler (GPrintFunc func);
|
2012-12-06 20:04:59 +01:00
|
|
|
GLIB_AVAILABLE_IN_ALL
|
Split glib.h into many header files mostly according to the resp.
2000-10-12 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h, galloca.h, garray.h, gasyncqueue.h, gbacktrace.h,
gcache.h, gcompletion.h, gconvert.h, gdataset.h, gdate.h, ghash.h,
ghook.h, giochannel.h, glist.h , gmacros.h, gmain.h, gmem.h,
gmessages.h, gnode.h, gprimes.h, gquark.h, gqueue.h, grand.h,
grel.h, gscanner.h, gslist.h, gstrfuncs.h, gstring.h, gthread.h,
gthreadpool.h, gtimer.h, gtree.h, gtypes.h, gutils.h: Split glib.h
into many header files mostly according to the resp. *.c-files.
* gmacros.h: Added G_BEGIN_DECLS and G_END_DECLS to mean: 'in case
of C++: extern "C" { ... }' analogous to glibc __BEGIN_DECLS and
__END_DECLS.
* configure.in, gerror.h, gfileutils.h, gshell.h, gspawn.h,
gunicode.h, : Changed guard-macro names to something more
consistent.
* configure.in, *.h: Use G_BEGIN_DECLS and G_END_DECLS.
2000-10-12 13:52:07 +02:00
|
|
|
void g_printerr (const gchar *format,
|
|
|
|
...) G_GNUC_PRINTF (1, 2);
|
2012-12-06 20:04:59 +01:00
|
|
|
GLIB_AVAILABLE_IN_ALL
|
Split glib.h into many header files mostly according to the resp.
2000-10-12 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h, galloca.h, garray.h, gasyncqueue.h, gbacktrace.h,
gcache.h, gcompletion.h, gconvert.h, gdataset.h, gdate.h, ghash.h,
ghook.h, giochannel.h, glist.h , gmacros.h, gmain.h, gmem.h,
gmessages.h, gnode.h, gprimes.h, gquark.h, gqueue.h, grand.h,
grel.h, gscanner.h, gslist.h, gstrfuncs.h, gstring.h, gthread.h,
gthreadpool.h, gtimer.h, gtree.h, gtypes.h, gutils.h: Split glib.h
into many header files mostly according to the resp. *.c-files.
* gmacros.h: Added G_BEGIN_DECLS and G_END_DECLS to mean: 'in case
of C++: extern "C" { ... }' analogous to glibc __BEGIN_DECLS and
__END_DECLS.
* configure.in, gerror.h, gfileutils.h, gshell.h, gspawn.h,
gunicode.h, : Changed guard-macro names to something more
consistent.
* configure.in, *.h: Use G_BEGIN_DECLS and G_END_DECLS.
2000-10-12 13:52:07 +02:00
|
|
|
GPrintFunc g_set_printerr_handler (GPrintFunc func);
|
|
|
|
|
2011-07-20 02:40:28 +02:00
|
|
|
/**
|
|
|
|
* g_warn_if_reached:
|
|
|
|
*
|
2015-11-26 14:26:27 +01:00
|
|
|
* Logs a warning.
|
2011-07-20 02:40:28 +02:00
|
|
|
*
|
|
|
|
* Since: 2.16
|
Split glib.h into many header files mostly according to the resp.
2000-10-12 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h, galloca.h, garray.h, gasyncqueue.h, gbacktrace.h,
gcache.h, gcompletion.h, gconvert.h, gdataset.h, gdate.h, ghash.h,
ghook.h, giochannel.h, glist.h , gmacros.h, gmain.h, gmem.h,
gmessages.h, gnode.h, gprimes.h, gquark.h, gqueue.h, grand.h,
grel.h, gscanner.h, gslist.h, gstrfuncs.h, gstring.h, gthread.h,
gthreadpool.h, gtimer.h, gtree.h, gtypes.h, gutils.h: Split glib.h
into many header files mostly according to the resp. *.c-files.
* gmacros.h: Added G_BEGIN_DECLS and G_END_DECLS to mean: 'in case
of C++: extern "C" { ... }' analogous to glibc __BEGIN_DECLS and
__END_DECLS.
* configure.in, gerror.h, gfileutils.h, gshell.h, gspawn.h,
gunicode.h, : Changed guard-macro names to something more
consistent.
* configure.in, *.h: Use G_BEGIN_DECLS and G_END_DECLS.
2000-10-12 13:52:07 +02:00
|
|
|
*/
|
2011-07-20 02:40:28 +02:00
|
|
|
#define g_warn_if_reached() \
|
|
|
|
do { \
|
|
|
|
g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, NULL); \
|
|
|
|
} while (0)
|
Split glib.h into many header files mostly according to the resp.
2000-10-12 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h, galloca.h, garray.h, gasyncqueue.h, gbacktrace.h,
gcache.h, gcompletion.h, gconvert.h, gdataset.h, gdate.h, ghash.h,
ghook.h, giochannel.h, glist.h , gmacros.h, gmain.h, gmem.h,
gmessages.h, gnode.h, gprimes.h, gquark.h, gqueue.h, grand.h,
grel.h, gscanner.h, gslist.h, gstrfuncs.h, gstring.h, gthread.h,
gthreadpool.h, gtimer.h, gtree.h, gtypes.h, gutils.h: Split glib.h
into many header files mostly according to the resp. *.c-files.
* gmacros.h: Added G_BEGIN_DECLS and G_END_DECLS to mean: 'in case
of C++: extern "C" { ... }' analogous to glibc __BEGIN_DECLS and
__END_DECLS.
* configure.in, gerror.h, gfileutils.h, gshell.h, gspawn.h,
gunicode.h, : Changed guard-macro names to something more
consistent.
* configure.in, *.h: Use G_BEGIN_DECLS and G_END_DECLS.
2000-10-12 13:52:07 +02:00
|
|
|
|
2011-07-20 02:40:28 +02:00
|
|
|
/**
|
|
|
|
* g_warn_if_fail:
|
|
|
|
* @expr: the expression to check
|
|
|
|
*
|
|
|
|
* Logs a warning if the expression is not true.
|
|
|
|
*
|
|
|
|
* Since: 2.16
|
|
|
|
*/
|
|
|
|
#define g_warn_if_fail(expr) \
|
|
|
|
do { \
|
|
|
|
if G_LIKELY (expr) ; \
|
|
|
|
else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, #expr); \
|
|
|
|
} while (0)
|
Split glib.h into many header files mostly according to the resp.
2000-10-12 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h, galloca.h, garray.h, gasyncqueue.h, gbacktrace.h,
gcache.h, gcompletion.h, gconvert.h, gdataset.h, gdate.h, ghash.h,
ghook.h, giochannel.h, glist.h , gmacros.h, gmain.h, gmem.h,
gmessages.h, gnode.h, gprimes.h, gquark.h, gqueue.h, grand.h,
grel.h, gscanner.h, gslist.h, gstrfuncs.h, gstring.h, gthread.h,
gthreadpool.h, gtimer.h, gtree.h, gtypes.h, gutils.h: Split glib.h
into many header files mostly according to the resp. *.c-files.
* gmacros.h: Added G_BEGIN_DECLS and G_END_DECLS to mean: 'in case
of C++: extern "C" { ... }' analogous to glibc __BEGIN_DECLS and
__END_DECLS.
* configure.in, gerror.h, gfileutils.h, gshell.h, gspawn.h,
gunicode.h, : Changed guard-macro names to something more
consistent.
* configure.in, *.h: Use G_BEGIN_DECLS and G_END_DECLS.
2000-10-12 13:52:07 +02:00
|
|
|
|
|
|
|
#ifdef G_DISABLE_CHECKS
|
|
|
|
|
2011-07-20 02:40:28 +02:00
|
|
|
/**
|
|
|
|
* g_return_if_fail:
|
|
|
|
* @expr: the expression to check
|
|
|
|
*
|
2014-02-06 11:19:47 +01:00
|
|
|
* Verifies that the expression @expr, usually representing a precondition,
|
|
|
|
* evaluates to %TRUE. If the function returns a value, use
|
|
|
|
* g_return_val_if_fail() instead.
|
|
|
|
*
|
|
|
|
* If @expr evaluates to %FALSE, the current function should be considered to
|
|
|
|
* have undefined behaviour (a programmer error). The only correct solution
|
|
|
|
* to such an error is to change the module that is calling the current
|
|
|
|
* function, so that it avoids this incorrect call.
|
|
|
|
*
|
|
|
|
* To make this undefined behaviour visible, if @expr evaluates to %FALSE,
|
|
|
|
* the result is usually that a critical message is logged and the current
|
|
|
|
* function returns.
|
2011-07-22 12:57:59 +02:00
|
|
|
*
|
2017-11-10 11:13:50 +01:00
|
|
|
* If `G_DISABLE_CHECKS` is defined then the check is not performed. You
|
2011-07-22 12:57:59 +02:00
|
|
|
* should therefore not depend on any side effects of @expr.
|
2017-11-10 11:26:01 +01:00
|
|
|
*
|
|
|
|
* To debug failure of a g_return_if_fail() check, run the code under a debugger
|
|
|
|
* with `G_DEBUG=fatal-criticals` or `G_DEBUG=fatal-warnings` defined in the
|
|
|
|
* environment (see [Running GLib Applications](glib-running.html)):
|
|
|
|
*
|
|
|
|
* |[
|
|
|
|
* G_DEBUG=fatal-warnings gdb ./my-program
|
|
|
|
* ]|
|
|
|
|
*
|
|
|
|
* Any unrelated failures can be skipped over in
|
|
|
|
* [gdb](https://www.gnu.org/software/gdb/) using the `continue` command.
|
2011-07-20 02:40:28 +02:00
|
|
|
*/
|
|
|
|
#define g_return_if_fail(expr) G_STMT_START{ (void)0; }G_STMT_END
|
|
|
|
|
|
|
|
/**
|
|
|
|
* g_return_val_if_fail:
|
|
|
|
* @expr: the expression to check
|
|
|
|
* @val: the value to return from the current function
|
|
|
|
* if the expression is not true
|
|
|
|
*
|
2014-02-06 11:19:47 +01:00
|
|
|
* Verifies that the expression @expr, usually representing a precondition,
|
|
|
|
* evaluates to %TRUE. If the function does not return a value, use
|
|
|
|
* g_return_if_fail() instead.
|
|
|
|
*
|
|
|
|
* If @expr evaluates to %FALSE, the current function should be considered to
|
|
|
|
* have undefined behaviour (a programmer error). The only correct solution
|
|
|
|
* to such an error is to change the module that is calling the current
|
|
|
|
* function, so that it avoids this incorrect call.
|
|
|
|
*
|
|
|
|
* To make this undefined behaviour visible, if @expr evaluates to %FALSE,
|
|
|
|
* the result is usually that a critical message is logged and @val is
|
2011-07-22 12:57:59 +02:00
|
|
|
* returned from the current function.
|
|
|
|
*
|
2017-11-10 11:13:50 +01:00
|
|
|
* If `G_DISABLE_CHECKS` is defined then the check is not performed. You
|
2011-07-22 12:57:59 +02:00
|
|
|
* should therefore not depend on any side effects of @expr.
|
2017-11-10 11:26:01 +01:00
|
|
|
*
|
|
|
|
* See g_return_if_fail() for guidance on how to debug failure of this check.
|
2011-07-20 02:40:28 +02:00
|
|
|
*/
|
|
|
|
#define g_return_val_if_fail(expr,val) G_STMT_START{ (void)0; }G_STMT_END
|
|
|
|
|
|
|
|
/**
|
|
|
|
* g_return_if_reached:
|
|
|
|
*
|
|
|
|
* Logs a critical message and returns from the current function.
|
|
|
|
* This can only be used in functions which do not return a value.
|
2017-11-10 11:26:01 +01:00
|
|
|
*
|
|
|
|
* See g_return_if_fail() for guidance on how to debug failure of this check.
|
2011-07-20 02:40:28 +02:00
|
|
|
*/
|
|
|
|
#define g_return_if_reached() G_STMT_START{ return; }G_STMT_END
|
|
|
|
|
|
|
|
/**
|
|
|
|
* g_return_val_if_reached:
|
|
|
|
* @val: the value to return from the current function
|
|
|
|
*
|
|
|
|
* Logs a critical message and returns @val.
|
2017-11-10 11:26:01 +01:00
|
|
|
*
|
|
|
|
* See g_return_if_fail() for guidance on how to debug failure of this check.
|
2011-07-20 02:40:28 +02:00
|
|
|
*/
|
|
|
|
#define g_return_val_if_reached(val) G_STMT_START{ return (val); }G_STMT_END
|
Split glib.h into many header files mostly according to the resp.
2000-10-12 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h, galloca.h, garray.h, gasyncqueue.h, gbacktrace.h,
gcache.h, gcompletion.h, gconvert.h, gdataset.h, gdate.h, ghash.h,
ghook.h, giochannel.h, glist.h , gmacros.h, gmain.h, gmem.h,
gmessages.h, gnode.h, gprimes.h, gquark.h, gqueue.h, grand.h,
grel.h, gscanner.h, gslist.h, gstrfuncs.h, gstring.h, gthread.h,
gthreadpool.h, gtimer.h, gtree.h, gtypes.h, gutils.h: Split glib.h
into many header files mostly according to the resp. *.c-files.
* gmacros.h: Added G_BEGIN_DECLS and G_END_DECLS to mean: 'in case
of C++: extern "C" { ... }' analogous to glibc __BEGIN_DECLS and
__END_DECLS.
* configure.in, gerror.h, gfileutils.h, gshell.h, gspawn.h,
gunicode.h, : Changed guard-macro names to something more
consistent.
* configure.in, *.h: Use G_BEGIN_DECLS and G_END_DECLS.
2000-10-12 13:52:07 +02:00
|
|
|
|
|
|
|
#else /* !G_DISABLE_CHECKS */
|
|
|
|
|
2018-10-03 15:45:12 +02:00
|
|
|
#define g_return_if_fail(expr) \
|
|
|
|
G_STMT_START { \
|
|
|
|
if (G_LIKELY (expr)) \
|
|
|
|
{ } \
|
|
|
|
else \
|
|
|
|
{ \
|
|
|
|
g_return_if_fail_warning (G_LOG_DOMAIN, \
|
|
|
|
G_STRFUNC, \
|
|
|
|
#expr); \
|
|
|
|
return; \
|
|
|
|
} \
|
|
|
|
} G_STMT_END
|
|
|
|
|
|
|
|
#define g_return_val_if_fail(expr, val) \
|
|
|
|
G_STMT_START { \
|
|
|
|
if (G_LIKELY (expr)) \
|
|
|
|
{ } \
|
|
|
|
else \
|
|
|
|
{ \
|
|
|
|
g_return_if_fail_warning (G_LOG_DOMAIN, \
|
|
|
|
G_STRFUNC, \
|
|
|
|
#expr); \
|
|
|
|
return (val); \
|
|
|
|
} \
|
|
|
|
} G_STMT_END
|
|
|
|
|
|
|
|
#define g_return_if_reached() \
|
|
|
|
G_STMT_START { \
|
|
|
|
g_log (G_LOG_DOMAIN, \
|
|
|
|
G_LOG_LEVEL_CRITICAL, \
|
|
|
|
"file %s: line %d (%s): should not be reached", \
|
|
|
|
__FILE__, \
|
|
|
|
__LINE__, \
|
|
|
|
G_STRFUNC); \
|
|
|
|
return; \
|
|
|
|
} G_STMT_END
|
|
|
|
|
|
|
|
#define g_return_val_if_reached(val) \
|
|
|
|
G_STMT_START { \
|
|
|
|
g_log (G_LOG_DOMAIN, \
|
|
|
|
G_LOG_LEVEL_CRITICAL, \
|
|
|
|
"file %s: line %d (%s): should not be reached", \
|
|
|
|
__FILE__, \
|
|
|
|
__LINE__, \
|
|
|
|
G_STRFUNC); \
|
|
|
|
return (val); \
|
|
|
|
} G_STMT_END
|
Split glib.h into many header files mostly according to the resp.
2000-10-12 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h, galloca.h, garray.h, gasyncqueue.h, gbacktrace.h,
gcache.h, gcompletion.h, gconvert.h, gdataset.h, gdate.h, ghash.h,
ghook.h, giochannel.h, glist.h , gmacros.h, gmain.h, gmem.h,
gmessages.h, gnode.h, gprimes.h, gquark.h, gqueue.h, grand.h,
grel.h, gscanner.h, gslist.h, gstrfuncs.h, gstring.h, gthread.h,
gthreadpool.h, gtimer.h, gtree.h, gtypes.h, gutils.h: Split glib.h
into many header files mostly according to the resp. *.c-files.
* gmacros.h: Added G_BEGIN_DECLS and G_END_DECLS to mean: 'in case
of C++: extern "C" { ... }' analogous to glibc __BEGIN_DECLS and
__END_DECLS.
* configure.in, gerror.h, gfileutils.h, gshell.h, gspawn.h,
gunicode.h, : Changed guard-macro names to something more
consistent.
* configure.in, *.h: Use G_BEGIN_DECLS and G_END_DECLS.
2000-10-12 13:52:07 +02:00
|
|
|
|
|
|
|
#endif /* !G_DISABLE_CHECKS */
|
|
|
|
|
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
#endif /* __G_MESSAGES_H__ */
|