jabber/xsnprintf.c File Reference

#include "xode.h"
#include <stdio.h>
#include <ctype.h>
#include <sys/types.h>
#include <stdarg.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>

Include dependency graph for jabber/xsnprintf.c:

Go to the source code of this file.

Data Structures

struct  buf_area

Defines

#define EXPONENT_LENGTH   10
#define FALSE   0
#define FIX_PRECISION(adjust, precision, s, s_len)
#define FLOAT_DIGITS   6
#define INS_CHAR(c, sp, bep, cc)
#define INT_NULL   ((int *)0)
#define NDIG   80
#define NUL   '\0'
#define NUM(c)   ( c - '0' )
#define NUM_BUF_SIZE   512
#define PAD(width, len, ch)
#define PREFIX(str, length, ch)   *--str = ch ; length++ ; has_prefix = YES
#define S_NULL   "(null)"
#define S_NULL_LEN   6
#define STR_TO_DEC(str, num)
#define TRUE   1
#define WIDE_INT   long

Typedefs

typedef int bool_int
typedef struct buf_area buffy
typedef unsigned WIDE_INT u_wide_int
typedef WIDE_INT wide_int

Enumerations

enum  boolean_e { NO = 0, YES = 1, NO = 0, YES = 1 }

Functions

static char * ap_cvt (double arg, int ndigits, int *decpt, int *sign, int eflag)
static char * ap_ecvt (double arg, int ndigits, int *decpt, int *sign)
static char * ap_fcvt (double arg, int ndigits, int *decpt, int *sign)
static char * ap_gcvt (double number, int ndigit, char *buf)
int ap_snprintf (char *buf, size_t len, const char *format,...)
int ap_vsnprintf (char *buf, size_t len, const char *format, va_list ap)
static char * conv_10 (register wide_int num, register bool_int is_unsigned, register bool_int *is_negative, char *buf_end, register int *len)
static char * conv_fp (register char format, register double num, boolean_e add_dp, int precision, bool_int *is_negative, char *buf, int *len)
static char * conv_p2 (register u_wide_int num, register int nbits, char format, char *buf_end, register int *len)
static int format_converter (register buffy *odp, const char *fmt, va_list ap)
static void strx_printv (int *ccp, char *buf, size_t len, const char *format, va_list ap)


Define Documentation

#define EXPONENT_LENGTH   10

Definition at line 261 of file jabber/xsnprintf.c.

Referenced by conv_fp().

#define FALSE   0

#define FIX_PRECISION ( adjust,
precision,
s,
s_len   ) 

Definition at line 316 of file jabber/xsnprintf.c.

Referenced by format_converter().

#define FLOAT_DIGITS   6

Definition at line 260 of file jabber/xsnprintf.c.

Referenced by format_converter().

#define INS_CHAR ( c,
sp,
bep,
cc   ) 

Definition at line 291 of file jabber/xsnprintf.c.

Referenced by format_converter().

#define INT_NULL   ((int *)0)

Definition at line 250 of file jabber/xsnprintf.c.

#define NDIG   80

Definition at line 91 of file jabber/xsnprintf.c.

Referenced by ap_cvt().

#define NUL   '\0'

Definition at line 249 of file jabber/xsnprintf.c.

Referenced by format_converter().

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

Definition at line 300 of file jabber/xsnprintf.c.

#define NUM_BUF_SIZE   512

Definition at line 268 of file jabber/xsnprintf.c.

Referenced by format_converter().

#define PAD ( width,
len,
ch   ) 

Definition at line 328 of file jabber/xsnprintf.c.

Referenced by format_converter().

#define PREFIX ( str,
length,
ch   )     *--str = ch ; length++ ; has_prefix = YES

Definition at line 340 of file jabber/xsnprintf.c.

#define S_NULL   "(null)"

Definition at line 257 of file jabber/xsnprintf.c.

Referenced by format_converter().

#define S_NULL_LEN   6

Definition at line 258 of file jabber/xsnprintf.c.

Referenced by format_converter().

#define STR_TO_DEC ( str,
num   ) 

Definition at line 302 of file jabber/xsnprintf.c.

Referenced by format_converter().

#define TRUE   1

#define WIDE_INT   long

Definition at line 251 of file jabber/xsnprintf.c.


Typedef Documentation

typedef int bool_int

Definition at line 255 of file jabber/xsnprintf.c.

typedef struct buf_area buffy

Definition at line 279 of file jabber/xsnprintf.c.

typedef unsigned WIDE_INT u_wide_int

Definition at line 254 of file jabber/xsnprintf.c.

typedef WIDE_INT wide_int

Definition at line 253 of file jabber/xsnprintf.c.


Enumeration Type Documentation

enum boolean_e

Enumerator:
NO 
YES 
NO 
YES 

Definition at line 243 of file jabber/xsnprintf.c.


Function Documentation

static char* ap_cvt ( double  arg,
int  ndigits,
int *  decpt,
int *  sign,
int  eflag 
) [static]

Definition at line 94 of file jabber/xsnprintf.c.

References buf, and NDIG.

Referenced by ap_ecvt(), and ap_fcvt().

static char* ap_ecvt ( double  arg,
int  ndigits,
int *  decpt,
int *  sign 
) [static]

Definition at line 168 of file jabber/xsnprintf.c.

References ap_cvt().

Referenced by ap_gcvt(), and conv_fp().

static char* ap_fcvt ( double  arg,
int  ndigits,
int *  decpt,
int *  sign 
) [static]

Definition at line 174 of file jabber/xsnprintf.c.

References ap_cvt().

Referenced by conv_fp().

static char* ap_gcvt ( double  number,
int  ndigit,
char *  buf 
) [static]

Definition at line 185 of file jabber/xsnprintf.c.

References ap_ecvt().

Referenced by format_converter().

int ap_snprintf ( char *  buf,
size_t  len,
const char *  format,
  ... 
)

Definition at line 916 of file jabber/xsnprintf.c.

int ap_vsnprintf ( char *  buf,
size_t  len,
const char *  format,
va_list  ap 
)

Definition at line 928 of file jabber/xsnprintf.c.

static char* conv_10 ( register wide_int  num,
register bool_int  is_unsigned,
register bool_int is_negative,
char *  buf_end,
register int *  len 
) [static]

Definition at line 356 of file jabber/xsnprintf.c.

References FALSE.

Referenced by conv_fp(), and format_converter().

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

Definition at line 409 of file jabber/xsnprintf.c.

References ap_ecvt(), ap_fcvt(), conv_10(), EXPONENT_LENGTH, FALSE, and s.

Referenced by format_converter().

static char* conv_p2 ( register u_wide_int  num,
register int  nbits,
char  format,
char *  buf_end,
register int *  len 
) [static]

Definition at line 500 of file jabber/xsnprintf.c.

References mask.

Referenced by format_converter().

static int format_converter ( register buffy odp,
const char *  fmt,
va_list  ap 
) [static]

static void strx_printv ( int *  ccp,
char *  buf,
size_t  len,
const char *  format,
va_list  ap 
) [static]

Definition at line 891 of file jabber/xsnprintf.c.

References buf_area::buf_end, format_converter(), and buf_area::nextb.

Referenced by ap_snprintf(), and ap_vsnprintf().


Generated on Wed May 23 08:01:31 2012 for Kamailio - The Open Source SIP Server by  doxygen 1.5.6