/* GLIB - Library of useful routines for C programming
 * Copyright (C) 1995-1997, 2002  Peter Mattis, Red Hat, Inc.
 *
 * 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
 * version 2 of the License, or (at your option) any later version.
 *
 * 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
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 */

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include "glib.h"
#include "gprintf.h"
#include "gprintfint.h"

gint
g_printf (gchar const *fmt,
	  ...)
{
  va_list args;
  gint retval;

  va_start (args, fmt);
  retval = g_vprintf (fmt, args);
  va_end (args);
  
  return retval;
}

gint
g_fprintf (FILE *file, 
           gchar const *fmt,
	   ...)
{
  va_list args;
  gint retval;

  va_start (args, fmt);
  retval = g_vfprintf (file, fmt, args);
  va_end (args);
  
  return retval;
}


gint
g_sprintf (gchar	*str,
	   gchar const *fmt,
	   ...)
{
  va_list args;
  gint retval;

  va_start (args, fmt);
  retval = g_vsprintf (str, fmt, args);
  va_end (args);
  
  return retval;
}

gint
g_snprintf (gchar	*str,
	    gulong	 n,
	    gchar const *fmt,
	    ...)
{
  va_list args;
  gint retval;

  va_start (args, fmt);
  retval = g_vsnprintf (str, n, fmt, args);
  va_end (args);
  
  return retval;
}

gint
g_vprintf (gchar const *fmt,
	   va_list      args)
{
  g_return_val_if_fail (fmt != NULL, 0);

  return _g_vprintf (fmt, args);
}

gint
g_vfprintf (FILE *file,
            gchar const *fmt,
	    va_list      args)
{
  g_return_val_if_fail (fmt != NULL, 0);

  return _g_vfprintf (file, fmt, args);
}

gint
g_vsprintf (gchar	 *str,
	    gchar const *fmt,
	    va_list      args)
{
  g_return_val_if_fail (str != NULL, 0);
  g_return_val_if_fail (fmt != NULL, 0);

  return _g_vsprintf (str, fmt, args);
}

gint
g_vsnprintf (gchar	 *str,
	     gulong	  n,
	     gchar const *fmt,
	     va_list      args)
{
  g_return_val_if_fail (n == 0 || str != NULL, 0);
  g_return_val_if_fail (fmt != NULL, 0);

  return _g_vsnprintf (str, n, fmt, args);
}



