Back to index

tetex-bin  3.0
Defines | Functions
printf.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "printf-args.c"
#include "printf-parse.c"
#include "vasnprintf.c"

Go to the source code of this file.

Defines

#define DLL_EXPORTED
#define STATIC   static
#define vasnprintf   libintl_vasnprintf

Functions

char * alloca ()
DLL_EXPORTED int libintl_vfprintf (FILE *stream, const char *format, va_list args)
DLL_EXPORTED int libintl_fprintf (FILE *stream, const char *format,...)
DLL_EXPORTED int libintl_vprintf (const char *format, va_list args)
DLL_EXPORTED int libintl_printf (const char *format,...)
DLL_EXPORTED int libintl_vsprintf (char *resultbuf, const char *format, va_list args)
DLL_EXPORTED int libintl_sprintf (char *resultbuf, const char *format,...)

Define Documentation

#define DLL_EXPORTED

Definition at line 59 of file printf.c.

#define STATIC   static

Definition at line 62 of file printf.c.

#define vasnprintf   libintl_vasnprintf

Definition at line 71 of file printf.c.


Function Documentation

char* alloca ( )
DLL_EXPORTED int libintl_fprintf ( FILE stream,
const char *  format,
  ... 
)

Definition at line 101 of file printf.c.

{
  va_list args;
  int retval;

  va_start (args, format);
  retval = libintl_vfprintf (stream, format, args);
  va_end (args);
  return retval;
}

Here is the call graph for this function:

DLL_EXPORTED int libintl_printf ( const char *  format,
  ... 
)

Definition at line 121 of file printf.c.

{
  va_list args;
  int retval;

  va_start (args, format);
  retval = libintl_vprintf (format, args);
  va_end (args);
  return retval;
}

Here is the call graph for this function:

DLL_EXPORTED int libintl_sprintf ( char *  resultbuf,
const char *  format,
  ... 
)

Definition at line 154 of file printf.c.

{
  va_list args;
  int retval;

  va_start (args, format);
  retval = libintl_vsprintf (resultbuf, format, args);
  va_end (args);
  return retval;
}

Here is the call graph for this function:

DLL_EXPORTED int libintl_vfprintf ( FILE stream,
const char *  format,
va_list  args 
)

Definition at line 80 of file printf.c.

{
  if (strchr (format, '$') == NULL)
    return vfprintf (stream, format, args);
  else
    {
      size_t length;
      char *result = libintl_vasnprintf (NULL, &length, format, args);
      int retval = -1;
      if (result != NULL)
       {
         if (fwrite (result, 1, length, stream) == length)
           retval = length;
         free (result);
       }
      return retval;
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

DLL_EXPORTED int libintl_vprintf ( const char *  format,
va_list  args 
)

Definition at line 114 of file printf.c.

{
  return libintl_vfprintf (stdout, format, args);
}

Here is the call graph for this function:

Here is the caller graph for this function:

DLL_EXPORTED int libintl_vsprintf ( char *  resultbuf,
const char *  format,
va_list  args 
)

Definition at line 134 of file printf.c.

{
  if (strchr (format, '$') == NULL)
    return vsprintf (resultbuf, format, args);
  else
    {
      size_t length = (size_t) ~0 / (4 * sizeof (char));
      char *result = libintl_vasnprintf (resultbuf, &length, format, args);
      if (result != resultbuf)
       {
         free (result);
         return -1;
       }
      else
       return length;
    }
}

Here is the call graph for this function:

Here is the caller graph for this function: