FD.io VPP  v19.01.3-6-g70449b9b9
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_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)
 
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_unix_gid
 

Macro Definition Documentation

◆ UNFORMAT_END_OF_INPUT

#define UNFORMAT_END_OF_INPUT   (~0)

Definition at line 144 of file format.h.

◆ UNFORMAT_MORE_INPUT

#define UNFORMAT_MORE_INPUT   0

Definition at line 145 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 268 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 232 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 478 of file format.c.

+ Here is the call graph for this function:

◆ fformat()

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

Definition at line 453 of file format.c.

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

◆ format()

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

Definition at line 419 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 258 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 281 of file std-formats.c.

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

◆ format_memory_size()

u8* format_memory_size ( u8 s,
va_list *  va 
)

Definition at line 193 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 call graph for this function:
+ 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 972 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 170 of file format.h.

◆ unformat_free()

static void unformat_free ( unformat_input_t i)
inlinestatic

Definition at line 162 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 191 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 152 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 1058 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 1007 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 256 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 1023 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 1066 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 1031 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 183 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 211 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 204 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 221 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 815 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 983 of file unformat.c.

◆ va_fformat()

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

Definition at line 429 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 387 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 833 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 292 of file format.h.

◆ unformat_hex_string

unformat_function_t unformat_hex_string

Definition at line 288 of file format.h.

◆ unformat_input

unformat_function_t unformat_input

Definition at line 276 of file format.h.

◆ unformat_line

unformat_function_t unformat_line

Definition at line 279 of file format.h.

◆ unformat_line_input

unformat_function_t unformat_line_input

Definition at line 282 of file format.h.

◆ unformat_memory_size

unformat_function_t unformat_memory_size

Definition at line 295 of file format.h.

◆ unformat_token

unformat_function_t unformat_token

Definition at line 285 of file format.h.

◆ unformat_unix_gid

unformat_function_t unformat_unix_gid

Definition at line 316 of file format.h.