1 /* GLIB - Library of useful routines for C programming
2  * Copyright (C) 2006-2019 Free Software Foundation, Inc.
3  *
4  * This file is not part of the GNU gettext program, but is used with
5  * GNU gettext.
6  *
7  * The original copyright notice is as follows:
8  */
9 
10 /* GLIB - Library of useful routines for C programming
11  * Copyright (C) 1995-1997  Peter Mattis, Spencer Kimball and Josh MacDonald
12  *
13  * This library is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU General Public
15  * License as published by the Free Software Foundation; either
16  * version 3 of the License, or (at your option) any later version.
17  *
18  * This library is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the GNU
21  * General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public
24  * License along with this library; if not, write to the
25  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
26  * Boston, MA 02111-1307, USA.
27  */
28 
29 /*
30  * Modified by the GLib Team and others 1997-2000.  See the AUTHORS
31  * file for a list of people on the GLib Team.  See the ChangeLog
32  * files for a list of changes.  These files are distributed with
33  * GLib at ftp://ftp.gtk.org/pub/gtk/.
34  */
35 
36 /*
37  * Modified by Bruno Haible for use as a gnulib module.
38  */
39 
40 #include "config.h"
41 
42 #include "glib.h"
43 #include "xvasprintf.h"
44 #include <stdio.h>
45 
46 void
g_printerr(const gchar * format,...)47 g_printerr (const gchar *format, ...)
48 {
49   va_list args;
50 
51   va_start (args, format);
52   vfprintf (stderr, format, args);
53   va_end (args);
54 }
55 
56 void
g_warning(const gchar * format,...)57 g_warning (const gchar *format, ...)
58 {
59   va_list args;
60   char *msg;
61 
62   va_start (args, format);
63   msg = xvasprintf (format, args);
64   va_end (args);
65 
66   fprintf (stderr, "warning: %s", msg);
67 }
68 
69 void
g_log(const char * domain,int level,const char * format,...)70 g_log (const char *domain, int level, const char *format, ...)
71 {
72   va_list args;
73 
74   va_start (args, format);
75   vfprintf (stderr, format, args);
76   va_end (args);
77 }
78