#include <sys/types.h>#include <string.h>#include <stdlib.h>#include <stdio.h>#include <stdarg.h>#include <assert.h>#include <errno.h>

Go to the source code of this file.
Defines | |
| #define | breakeven_point 6 /* some reasonable one-size-fits-all value */ |
| #define | fast_memcpy(d, s, n) |
| #define | fast_memset(d, c, n) |
| #define | isdigit(c) ((c) >= '0' && (c) <= '9') |
| #define | portable_snprintf snprintf |
| #define | PORTABLE_SNPRINTF_VERSION_MAJOR 2 |
| #define | PORTABLE_SNPRINTF_VERSION_MINOR 2 |
| #define | portable_vsnprintf vsnprintf |
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) |
Variables | |
| static char | credits [] |
| #define breakeven_point 6 /* some reasonable one-size-fits-all value */ |
Definition at line 360 of file snprintf.c.
| #define fast_memcpy | ( | d, | |
| s, | |||
| n | |||
| ) |
{ 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++; } }
Definition at line 363 of file snprintf.c.
| #define fast_memset | ( | d, | |
| c, | |||
| n | |||
| ) |
{ 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; } }
Definition at line 370 of file snprintf.c.
| #define isdigit | ( | c | ) | ((c) >= '0' && (c) <= '9') |
Definition at line 330 of file snprintf.c.
| #define portable_snprintf snprintf |
Definition at line 397 of file snprintf.c.
| #define PORTABLE_SNPRINTF_VERSION_MAJOR 2 |
Definition at line 287 of file snprintf.c.
| #define PORTABLE_SNPRINTF_VERSION_MINOR 2 |
Definition at line 288 of file snprintf.c.
| #define portable_vsnprintf vsnprintf |
Definition at line 399 of file snprintf.c.
| int portable_snprintf | ( | char * | str, |
| size_t | str_m, | ||
| const char * | fmt, | ||
| ... | |||
| ) |
Definition at line 524 of file snprintf.c.
| int portable_vsnprintf | ( | char * | str, |
| size_t | str_m, | ||
| const char * | fmt, | ||
| va_list | ap | ||
| ) |
Definition at line 538 of file snprintf.c.
char credits[] [static] |
"\n\ @(#)snprintf.c, v2.2: Mark Martinec, <mark.martinec@ijs.si>\n\ @(#)snprintf.c, v2.2: Copyright 1999, Mark Martinec. Frontier Artistic License applies.\n\ @(#)snprintf.c, v2.2: http://www.ijs.si/software/snprintf/\n"
Definition at line 412 of file snprintf.c.