Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

snprintf.c File Reference

#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:

Include dependency graph

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)

Define Documentation

#define breakeven_point   6 /* some reasonable one-size-fits-all value */
 

#define fast_memcpy d,
s,
 ) 
 

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++; } }

#define fast_memset d,
c,
 ) 
 

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; } }

#define isdigit  )     ((c) >= '0' && (c) <= '9')
 

#define PORTABLE_SNPRINTF_VERSION_MAJOR   2
 

#define PORTABLE_SNPRINTF_VERSION_MINOR   2
 


Function Documentation

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
 


Generated on Sat Sep 17 10:29:33 2005 for XconqKernel by doxygen 1.3.6