#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"
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 CLEANUP | ( | ) |
#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 | ) |
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 | ) |
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 |
DCHAR_T* VASNPRINTF | ( | DCHAR_T * | resultbuf, | |
size_t * | lengthp, | |||
const FCHAR_T * | format, | |||
va_list | args | |||
) |