#include <sys/types.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
#include <assert.h>
#include <errno.h>
Include dependency graph for snprintf.c:
Defines | |
#define | PORTABLE_SNPRINTF_VERSION_MAJOR 2 |
#define | PORTABLE_SNPRINTF_VERSION_MINOR 2 |
#define | isdigit(c) ((c) >= '0' && (c) <= '9') |
#define | breakeven_point 6 /* some reasonable one-size-fits-all value */ |
#define | fast_memcpy(d, s, n) |
#define | fast_memset(d, c, n) |
Functions | |
int | portable_snprintf (char *str, size_t str_m, const char *fmt,...) |
int | portable_vsnprintf (char *str, size_t str_m, const char *fmt, va_list ap) |
|
|
|
Value: { register size_t nn = (size_t)(n); \ if (nn >= breakeven_point) memcpy((d), (s), nn); \ else if (nn > 0) { /* proc call overhead is worth only for large strings*/\ register char *dd; register const char *ss; \ for (ss=(s), dd=(d); nn>0; nn--) *dd++ = *ss++; } } |
|
Value: { register size_t nn = (size_t)(n); \ if (nn >= breakeven_point) memset((d), (int)(c), nn); \ else if (nn > 0) { /* proc call overhead is worth only for large strings*/\ register char *dd; register const int cc=(int)(c); \ for (dd=(d); nn>0; nn--) *dd++ = cc; } } |
|
|
|
|
|
|
|
|
|
|