FD.io VPP  v21.10.1-2-g0a485f517
Vector Packet Processing
format.h File Reference
+ Include dependency graph for format.h:

Go to the source code of this file.

Macros

#define UNFORMAT_END_OF_INPUT   (~0)
 
#define UNFORMAT_MORE_INPUT   0
 
#define unformat_parse_error(input)   clib_error_return (0, "parse error `%U'", format_unformat_error, input)
 

Typedefs

typedef u8 *() format_function_t(u8 *s, va_list *args)
 
typedef struct _unformat_input_t unformat_input_t
 
typedef uword() unformat_function_t(unformat_input_t *input, va_list *args)
 

Functions

u8va_format (u8 *s, const char *format, va_list *args)
 
u8format (u8 *s, const char *format,...)
 
word va_fformat (FILE *f, char *fmt, va_list *va)
 
word fformat (FILE *f, char *fmt,...)
 
word fdformat (int fd, char *fmt,...)
 
static u32 format_get_indent (u8 *s)
 
static void unformat_init (unformat_input_t *i, uword(*fill_buffer)(unformat_input_t *), void *fill_buffer_arg)
 
static void unformat_free (unformat_input_t *i)
 
static uword unformat_check_input (unformat_input_t *i)
 
static uword unformat_is_eof (unformat_input_t *input)
 
static uword unformat_get_input (unformat_input_t *input)
 
static void unformat_put_input (unformat_input_t *input)
 
static uword unformat_peek_input (unformat_input_t *input)
 
static void unformat_skip_line (unformat_input_t *i)
 
uword unformat_skip_white_space (unformat_input_t *input)
 
uword unformat (unformat_input_t *i, const char *fmt,...)
 
uword unformat_user (unformat_input_t *input, unformat_function_t *func,...)
 
uword va_unformat (unformat_input_t *i, const char *fmt, va_list *args)
 
void unformat_init_command_line (unformat_input_t *input, char *argv[])
 
void unformat_init_string (unformat_input_t *input, char *string, int string_len)
 
static void unformat_init_cstring (unformat_input_t *input, char *string)
 
void unformat_init_vector (unformat_input_t *input, u8 *vector_string)
 
u8format_unformat_error (u8 *s, va_list *va)
 
u8format_unformat_input (u8 *s, va_list *va)
 
u8format_memory_size (u8 *s, va_list *va)
 
u8format_log2_page_size (u8 *s, va_list *va)
 
u8format_c_identifier (u8 *s, va_list *va)
 
u8format_hexdump (u8 *s, va_list *va)
 
void unformat_init_clib_file (unformat_input_t *input, int file_descriptor)
 
uword unformat_init_unix_env (unformat_input_t *input, char *var)
 
uword unformat_data_size (unformat_input_t *input, va_list *args)
 
int test_format_main (unformat_input_t *input)
 
int test_unformat_main (unformat_input_t *input)
 
int test_vec_main (unformat_input_t *input)
 

Variables

unformat_function_t unformat_input
 
unformat_function_t unformat_line
 
unformat_function_t unformat_line_input
 
unformat_function_t unformat_token
 
unformat_function_t unformat_hex_string
 
unformat_function_t unformat_eof
 
unformat_function_t unformat_memory_size
 
unformat_function_t unformat_log2_page_size
 
unformat_function_t unformat_unix_gid
 

Macro Definition Documentation

◆ UNFORMAT_END_OF_INPUT

#define UNFORMAT_END_OF_INPUT   (~0)

Definition at line 137 of file format.h.

◆ UNFORMAT_MORE_INPUT

#define UNFORMAT_MORE_INPUT   0

Definition at line 138 of file format.h.

◆ unformat_parse_error

#define unformat_parse_error (   input)    clib_error_return (0, "parse error `%U'", format_unformat_error, input)

Definition at line 261 of file format.h.

Typedef Documentation

◆ format_function_t

typedef u8*() format_function_t(u8 *s, va_list *args)

Definition at line 48 of file format.h.

◆ unformat_function_t

typedef uword() unformat_function_t(unformat_input_t *input, va_list *args)

Definition at line 225 of file format.h.

◆ unformat_input_t

typedef struct _unformat_input_t unformat_input_t

Function Documentation

◆ fdformat()

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

Definition at line 491 of file format.c.

+ Here is the call graph for this function:

◆ fformat()

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

Definition at line 466 of file format.c.

+ Here is the call graph for this function:

◆ format()

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

Definition at line 428 of file format.c.

+ Here is the call graph for this function:

◆ format_c_identifier()

u8* format_c_identifier ( u8 s,
va_list *  va 
)

Definition at line 329 of file std-formats.c.

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

◆ format_get_indent()

static u32 format_get_indent ( u8 s)
inlinestatic

Definition at line 72 of file format.h.

◆ format_hexdump()

u8* format_hexdump ( u8 s,
va_list *  va 
)

Definition at line 352 of file std-formats.c.

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

◆ format_log2_page_size()

u8* format_log2_page_size ( u8 s,
va_list *  va 
)

Definition at line 273 of file std-formats.c.

+ Here is the caller graph for this function:

◆ format_memory_size()

u8* format_memory_size ( u8 s,
va_list *  va 
)

Definition at line 209 of file std-formats.c.

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

◆ format_unformat_error()

u8* format_unformat_error ( u8 s,
va_list *  va 
)

Definition at line 91 of file unformat.c.

+ Here is the call graph for this function:

◆ format_unformat_input()

u8* format_unformat_input ( u8 s,
va_list *  va 
)

Definition at line 143 of file unformat.c.

+ Here is the caller graph for this function:

◆ test_format_main()

int test_format_main ( unformat_input_t input)

◆ test_unformat_main()

int test_unformat_main ( unformat_input_t input)

◆ test_vec_main()

int test_vec_main ( unformat_input_t input)

◆ unformat()

uword unformat ( unformat_input_t i,
const char *  fmt,
  ... 
)

Definition at line 978 of file unformat.c.

+ Here is the call graph for this function:

◆ unformat_check_input()

static uword unformat_check_input ( unformat_input_t i)
inlinestatic

Definition at line 163 of file format.h.

◆ unformat_data_size()

uword unformat_data_size ( unformat_input_t input,
va_list *  args 
)

Definition at line 1081 of file unformat.c.

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

◆ unformat_free()

static void unformat_free ( unformat_input_t i)
inlinestatic

Definition at line 155 of file format.h.

+ Here is the call graph for this function:

◆ unformat_get_input()

static uword unformat_get_input ( unformat_input_t input)
inlinestatic

Definition at line 184 of file format.h.

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

◆ unformat_init()

static void unformat_init ( unformat_input_t i,
uword(*)(unformat_input_t *)  fill_buffer,
void *  fill_buffer_arg 
)
inlinestatic

Definition at line 145 of file format.h.

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

◆ unformat_init_clib_file()

void unformat_init_clib_file ( unformat_input_t input,
int  file_descriptor 
)

Definition at line 1064 of file unformat.c.

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

◆ unformat_init_command_line()

void unformat_init_command_line ( unformat_input_t input,
char *  argv[] 
)

Definition at line 1013 of file unformat.c.

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

◆ unformat_init_cstring()

static void unformat_init_cstring ( unformat_input_t input,
char *  string 
)
inlinestatic

Definition at line 249 of file format.h.

+ Here is the call graph for this function:

◆ unformat_init_string()

void unformat_init_string ( unformat_input_t input,
char *  string,
int  string_len 
)

Definition at line 1029 of file unformat.c.

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

◆ unformat_init_unix_env()

uword unformat_init_unix_env ( unformat_input_t input,
char *  var 
)

Definition at line 1072 of file unformat.c.

+ Here is the call graph for this function:

◆ unformat_init_vector()

void unformat_init_vector ( unformat_input_t input,
u8 vector_string 
)

Definition at line 1037 of file unformat.c.

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

◆ unformat_is_eof()

static uword unformat_is_eof ( unformat_input_t input)
inlinestatic

Definition at line 176 of file format.h.

+ Here is the call graph for this function:

◆ unformat_peek_input()

static uword unformat_peek_input ( unformat_input_t input)
inlinestatic

Definition at line 204 of file format.h.

+ Here is the call graph for this function:

◆ unformat_put_input()

static void unformat_put_input ( unformat_input_t input)
inlinestatic

Definition at line 197 of file format.h.

+ Here is the caller graph for this function:

◆ unformat_skip_line()

static void unformat_skip_line ( unformat_input_t i)
inlinestatic

Definition at line 214 of file format.h.

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

◆ unformat_skip_white_space()

uword unformat_skip_white_space ( unformat_input_t input)

Definition at line 821 of file unformat.c.

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

◆ unformat_user()

uword unformat_user ( unformat_input_t input,
unformat_function_t func,
  ... 
)

Definition at line 989 of file unformat.c.

◆ va_fformat()

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

Definition at line 442 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 *  format,
va_list *  args 
)

Definition at line 391 of file format.c.

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

◆ va_unformat()

uword va_unformat ( unformat_input_t i,
const char *  fmt,
va_list *  args 
)

Definition at line 839 of file unformat.c.

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

Variable Documentation

◆ unformat_eof

unformat_function_t unformat_eof

Definition at line 285 of file format.h.

◆ unformat_hex_string

unformat_function_t unformat_hex_string

Definition at line 281 of file format.h.

◆ unformat_input

unformat_function_t unformat_input

Definition at line 269 of file format.h.

◆ unformat_line

unformat_function_t unformat_line

Definition at line 272 of file format.h.

◆ unformat_line_input

unformat_function_t unformat_line_input

Definition at line 275 of file format.h.

◆ unformat_log2_page_size

unformat_function_t unformat_log2_page_size

Definition at line 294 of file format.h.

◆ unformat_memory_size

unformat_function_t unformat_memory_size

Definition at line 288 of file format.h.

◆ unformat_token

unformat_function_t unformat_token

Definition at line 278 of file format.h.

◆ unformat_unix_gid

unformat_function_t unformat_unix_gid

Definition at line 315 of file format.h.