Apache HTTPD
Macros | Enumerations | Functions | Variables
apr_snprintf.c File Reference
#include "apr.h"
#include "apr_private.h"
#include "apr_lib.h"
#include "apr_strings.h"
#include "apr_network_io.h"
#include "apr_portable.h"
#include "apr_errno.h"
#include <math.h>

Go to the source code of this file.

Macros

#define NUL   '\0'
 
#define S_NULL   ((char *)null_string)
 
#define S_NULL_LEN   6
 
#define FLOAT_DIGITS   6
 
#define EXPONENT_LENGTH   10
 
#define NUM_BUF_SIZE   512
 
#define NDIG   80
 
#define INS_CHAR(c, sp, bep, cc)
 
#define NUM(c)   (c - '0')
 
#define STR_TO_DEC(str, num)
 
#define FIX_PRECISION(adjust, precision, s, s_len)
 
#define PAD(width, len, ch)
 
#define PREFIX(str, length, ch)
 

Enumerations

enum  boolean_e { NO = 0 , YES = 1 }
 

Functions

static charapr_cvt (double arg, int ndigits, int *decpt, int *sign, int eflag, char *buf)
 
static charapr_ecvt (double arg, int ndigits, int *decpt, int *sign, char *buf)
 
static charapr_fcvt (double arg, int ndigits, int *decpt, int *sign, char *buf)
 
static charapr_gcvt (double number, int ndigit, char *buf, boolean_e altform)
 
static charconv_10 (register apr_int32_t num, register int is_unsigned, register int *is_negative, char *buf_end, register apr_size_t *len)
 
static charconv_10_quad (apr_int64_t num, register int is_unsigned, register int *is_negative, char *buf_end, register apr_size_t *len)
 
static charconv_in_addr (struct in_addr *ia, char *buf_end, apr_size_t *len)
 
static charconv_apr_sockaddr (apr_sockaddr_t *sa, char *buf_end, apr_size_t *len)
 
static charconv_fp (register char format, register double num, boolean_e add_dp, int precision, int *is_negative, char *buf, apr_size_t *len)
 
static charconv_p2 (register apr_uint32_t num, register int nbits, char format, char *buf_end, register apr_size_t *len)
 
static charconv_p2_quad (apr_uint64_t num, register int nbits, char format, char *buf_end, register apr_size_t *len)
 
 APR_DECLARE (int)
 
static int snprintf_flush (apr_vformatter_buff_t *vbuff)
 
 APR_DECLARE_NONSTD (int)
 

Variables

static const char null_string [] = "(null)"
 

Macro Definition Documentation

◆ EXPONENT_LENGTH

#define EXPONENT_LENGTH   10

Definition at line 62 of file apr_snprintf.c.

◆ FIX_PRECISION

#define FIX_PRECISION (   adjust,
  precision,
  s,
  s_len 
)
Value:
if (adjust) { \
while (s_len < p) \
{ \
*--s = '0'; \
s_len++; \
} \
}
#define NUM_BUF_SIZE
apr_size_t size
const char * s
Definition apr_strings.h:95
apr_pool_t * p
Definition md_event.c:32

Definition at line 279 of file apr_snprintf.c.

◆ FLOAT_DIGITS

#define FLOAT_DIGITS   6

Definition at line 61 of file apr_snprintf.c.

◆ INS_CHAR

#define INS_CHAR (   c,
  sp,
  bep,
  cc 
)
Value:
{ \
if (sp) { \
if (sp >= bep) { \
vbuff->curpos = sp; \
if (flush_func(vbuff)) \
return -1; \
sp = vbuff->curpos; \
bep = vbuff->endpos; \
} \
*sp++ = (c); \
} \
cc++; \
}
apr_vformatter_buff_t * c
Definition apr_lib.h:175

Definition at line 244 of file apr_snprintf.c.

◆ NDIG

#define NDIG   80

Definition at line 83 of file apr_snprintf.c.

◆ NUL

#define NUL   '\0'

Definition at line 55 of file apr_snprintf.c.

◆ NUM

#define NUM (   c)    (c - '0')

Definition at line 259 of file apr_snprintf.c.

◆ NUM_BUF_SIZE

#define NUM_BUF_SIZE   512

Definition at line 69 of file apr_snprintf.c.

◆ PAD

#define PAD (   width,
  len,
  ch 
)
Value:
do \
{ \
INS_CHAR(ch, sp, bep, cc); \
width--; \
} \
const char apr_size_t len
Definition ap_regex.h:187

Definition at line 294 of file apr_snprintf.c.

◆ PREFIX

#define PREFIX (   str,
  length,
  ch 
)
Value:
*--str = ch; \
length++; \
@ YES
int apr_off_t * length
#define str

Definition at line 307 of file apr_snprintf.c.

◆ S_NULL

#define S_NULL   ((char *)null_string)

Definition at line 58 of file apr_snprintf.c.

◆ S_NULL_LEN

#define S_NULL_LEN   6

Definition at line 59 of file apr_snprintf.c.

◆ STR_TO_DEC

#define STR_TO_DEC (   str,
  num 
)
Value:
num = NUM(*str++); \
{ \
num *= 10 ; \
num += NUM(*str++); \
}
#define NUM(c)
#define apr_isdigit(c)
Definition apr_lib.h:209
apr_interval_time_t apr_int32_t * num
Definition apr_poll.h:273

Definition at line 261 of file apr_snprintf.c.

Enumeration Type Documentation

◆ boolean_e

Enumerator
NO 
YES 

Definition at line 45 of file apr_snprintf.c.

Function Documentation

◆ apr_cvt()

static char * apr_cvt ( double  arg,
int  ndigits,
int decpt,
int sign,
int  eflag,
char buf 
)
static

Definition at line 86 of file apr_snprintf.c.

◆ apr_ecvt()

static char * apr_ecvt ( double  arg,
int  ndigits,
int decpt,
int sign,
char buf 
)
static

Definition at line 160 of file apr_snprintf.c.

◆ apr_fcvt()

static char * apr_fcvt ( double  arg,
int  ndigits,
int decpt,
int sign,
char buf 
)
static

Definition at line 165 of file apr_snprintf.c.

◆ apr_gcvt()

static char * apr_gcvt ( double  number,
int  ndigit,
char buf,
boolean_e  altform 
)
static

Definition at line 175 of file apr_snprintf.c.

◆ conv_10()

static char * conv_10 ( register apr_int32_t  num,
register int  is_unsigned,
register int is_negative,
char buf_end,
register apr_size_t len 
)
static

Definition at line 329 of file apr_snprintf.c.

◆ conv_10_quad()

static char * conv_10_quad ( apr_int64_t  num,
register int  is_unsigned,
register int is_negative,
char buf_end,
register apr_size_t len 
)
static

Definition at line 372 of file apr_snprintf.c.

◆ conv_apr_sockaddr()

static char * conv_apr_sockaddr ( apr_sockaddr_t sa,
char buf_end,
apr_size_t len 
)
static

Definition at line 446 of file apr_snprintf.c.

◆ conv_fp()

static char * conv_fp ( register char  format,
register double  num,
boolean_e  add_dp,
int  precision,
int is_negative,
char buf,
apr_size_t len 
)
static

Definition at line 516 of file apr_snprintf.c.

◆ conv_in_addr()

static char * conv_in_addr ( struct in_addr ia,
char buf_end,
apr_size_t len 
)
static

Definition at line 424 of file apr_snprintf.c.

◆ conv_p2()

static char * conv_p2 ( register apr_uint32_t  num,
register int  nbits,
char  format,
char buf_end,
register apr_size_t len 
)
static

Definition at line 615 of file apr_snprintf.c.

◆ conv_p2_quad()

static char * conv_p2_quad ( apr_uint64_t  num,
register int  nbits,
char  format,
char buf_end,
register apr_size_t len 
)
static

Definition at line 634 of file apr_snprintf.c.

◆ snprintf_flush()

static int snprintf_flush ( apr_vformatter_buff_t vbuff)
static

Definition at line 1346 of file apr_snprintf.c.

Variable Documentation

◆ null_string

const char null_string[] = "(null)"
static

Definition at line 57 of file apr_snprintf.c.