FD.io VPP  v20.05.1-5-g09f167997
Vector Packet Processing
format.c File Reference
+ Include dependency graph for format.c:

Go to the source code of this file.

Data Structures

struct  format_integer_options_t
 
struct  format_info_t
 

Macros

#define f64_down(f, sign, expon, fraction)
 

Functions

static u8format_integer (u8 *s, u64 number, format_integer_options_t *options)
 
static u8format_float (u8 *s, f64 x, uword n_digits_to_print, uword output_style)
 
static u8justify (u8 *s, format_info_t *fi, uword s_len_orig)
 
static const u8do_percent (u8 **_s, const u8 *fmt, va_list *va)
 
u8va_format (u8 *s, const char *fmt, va_list *va)
 
u8format (u8 *s, const char *fmt,...)
 
word va_fformat (FILE *f, char *fmt, va_list *va)
 
word fformat (FILE *f, char *fmt,...)
 
void fformat_append_cr (FILE *ofp, const char *fmt,...)
 
word fdformat (int fd, char *fmt,...)
 
static f64 f64_up (uword sign, word expon, u64 fraction)
 
static f64 f64_precision (int base2_expon)
 
static f64 times_power_of_ten (f64 x, int n)
 
static f64 normalize (f64 x, word *expon_return, f64 *prec_return)
 
static u8add_some_zeros (u8 *s, uword n_zeros)
 

Macro Definition Documentation

◆ f64_down

#define f64_down (   f,
  sign,
  expon,
  fraction 
)
Value:
do { \
union { u64 u; f64 f; } _f64_down_tmp; \
_f64_down_tmp.f = (f); \
(sign) = (_f64_down_tmp.u >> 63); \
(expon) = ((_f64_down_tmp.u >> 52) & 0x7ff) - 1023; \
(fraction) = ((_f64_down_tmp.u << 12) >> 12) | ((u64) 1 << 52); \
} while (0)
unsigned long u64
Definition: types.h:89
double f64
Definition: types.h:142

Definition at line 561 of file format.c.

Function Documentation

◆ add_some_zeros()

static u8* add_some_zeros ( u8 s,
uword  n_zeros 
)
static

Definition at line 690 of file format.c.

+ Here is the caller graph for this function:

◆ do_percent()

static const u8* do_percent ( u8 **  _s,
const u8 fmt,
va_list *  va 
)
static

Definition at line 155 of file format.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ f64_precision()

static f64 f64_precision ( int  base2_expon)
static

Definition at line 596 of file format.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ f64_up()

static f64 f64_up ( uword  sign,
word  expon,
u64  fraction 
)
static

Definition at line 572 of file format.c.

+ Here is the caller graph for this function:

◆ fdformat()

word fdformat ( int  fd,
char *  fmt,
  ... 
)

Definition at line 487 of file format.c.

+ Here is the call graph for this function:

◆ fformat()

word fformat ( FILE *  f,
char *  fmt,
  ... 
)

Definition at line 462 of file format.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fformat_append_cr()

void fformat_append_cr ( FILE *  ofp,
const char *  fmt,
  ... 
)

Definition at line 476 of file format.c.

+ Here is the call graph for this function:

◆ format()

u8* format ( u8 s,
const char *  fmt,
  ... 
)

Definition at line 424 of file format.c.

+ Here is the call graph for this function:

◆ format_float()

static u8 * format_float ( u8 s,
f64  x,
uword  n_digits_to_print,
uword  output_style 
)
static

Definition at line 703 of file format.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ format_integer()

static u8 * format_integer ( u8 s,
u64  number,
format_integer_options_t options 
)
static

Definition at line 505 of file format.c.

+ Here is the caller graph for this function:

◆ justify()

static u8* justify ( u8 s,
format_info_t fi,
uword  s_len_orig 
)
static

Definition at line 104 of file format.c.

+ Here is the caller graph for this function:

◆ normalize()

static f64 normalize ( f64  x,
word expon_return,
f64 prec_return 
)
static

Definition at line 646 of file format.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ times_power_of_ten()

static f64 times_power_of_ten ( f64  x,
int  n 
)
static

Definition at line 619 of file format.c.

+ Here is the caller graph for this function:

◆ va_fformat()

word va_fformat ( FILE *  f,
char *  fmt,
va_list *  va 
)

Definition at line 438 of file format.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ va_format()

u8* va_format ( u8 s,
const char *  fmt,
va_list *  va 
)

Definition at line 387 of file format.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function: