Navigation

Operators and Keywords

Function List:

C++ API

vasnprintf.c File Reference

#include <config.h>
#include <alloca.h>
#include "vasnprintf.h"
#include <locale.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <limits.h>
#include <float.h>
#include "printf-parse.h"
#include "xsize.h"
#include "verify.h"
Include dependency graph for vasnprintf.c:

Defines

#define VASNPRINTF   vasnprintf
#define FCHAR_T   char
#define DCHAR_T   char
#define TCHAR_T   char
#define DCHAR_IS_TCHAR   1
#define DIRECTIVE   char_directive
#define DIRECTIVES   char_directives
#define PRINTF_PARSE   printf_parse
#define DCHAR_CPY   memcpy
#define DCHAR_SET   memset
#define USE_SNPRINTF   1
#define SNPRINTF   snprintf
#define IF_LINT(Code)
#define exp   expo
#define remainder   rem
#define CLEANUP()
#define ENSURE_ALLOCATION(needed)
#define prec_ourselves   0
#define pad_ourselves   0
#define TCHARS_PER_DCHAR   (sizeof (DCHAR_T) / sizeof (TCHAR_T))
#define SNPRINTF_BUF(arg)

Functions

DCHAR_T * VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, const FCHAR_T *format, va_list args)

Define Documentation

#define CLEANUP (  ) 
Value:
if (d.dir != d.direct_alloc_dir)                                      \
    free (d.dir);                                                       \
  if (a.arg != a.direct_alloc_arg)                                      \
    free (a.arg);
#define DCHAR_CPY   memcpy
#define DCHAR_IS_TCHAR   1
#define DCHAR_SET   memset
#define DCHAR_T   char
#define DIRECTIVE   char_directive
#define DIRECTIVES   char_directives
#define ENSURE_ALLOCATION (   needed  ) 
Value:
if ((needed) > allocated)                                                \
      {                                                                      \
        size_t memory_size;                                                  \
        DCHAR_T *memory;                                                     \
                                                                             \
        allocated = (allocated > 0 ? xtimes (allocated, 2) : 12);            \
        if ((needed) > allocated)                                            \
          allocated = (needed);                                              \
        memory_size = xtimes (allocated, sizeof (DCHAR_T));                  \
        if (size_overflow_p (memory_size))                                   \
          goto out_of_memory;                                                \
        if (result == resultbuf || result == NULL)                           \
          memory = (DCHAR_T *) malloc (memory_size);                         \
        else                                                                 \
          memory = (DCHAR_T *) realloc (result, memory_size);                \
        if (memory == NULL)                                                  \
          goto out_of_memory;                                                \
        if (result == resultbuf && length > 0)                               \
          DCHAR_CPY (memory, result, length);                                \
        result = memory;                                                     \
      }
#define exp   expo
#define FCHAR_T   char
#define IF_LINT (   Code  ) 
#define pad_ourselves   0
#define prec_ourselves   0
#define PRINTF_PARSE   printf_parse
#define remainder   rem
#define SNPRINTF   snprintf
#define SNPRINTF_BUF (   arg  ) 
Value:
switch (prefix_count)                                   \
                      {                                                     \
                      case 0:                                               \
                        retcount = SNPRINTF ((TCHAR_T *) (result + length), \
                                             maxlen, buf,                   \
                                             arg, &count);                  \
                        break;                                              \
                      case 1:                                               \
                        retcount = SNPRINTF ((TCHAR_T *) (result + length), \
                                             maxlen, buf,                   \
                                             prefixes[0], arg, &count);     \
                        break;                                              \
                      case 2:                                               \
                        retcount = SNPRINTF ((TCHAR_T *) (result + length), \
                                             maxlen, buf,                   \
                                             prefixes[0], prefixes[1], arg, \
                                             &count);                       \
                        break;                                              \
                      default:                                              \
                        abort ();                                           \
                      }
#define TCHAR_T   char
#define TCHARS_PER_DCHAR   (sizeof (DCHAR_T) / sizeof (TCHAR_T))
#define USE_SNPRINTF   1
#define VASNPRINTF   vasnprintf

Function Documentation

DCHAR_T* VASNPRINTF ( DCHAR_T *  resultbuf,
size_t *  lengthp,
const FCHAR_T *  format,
va_list  args 
)
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines