45 u32 *v = va_arg (*va,
u32 *);
46 char *fmt = va_arg (*va,
char *);
48 for (i = 0; i <
vec_len (v); i++)
61 char *fmt = va_arg (*va,
char *);
63 for (i = 0; i <
vec_len (v); i++)
76 u8 *v = va_arg (*va,
u8 *);
86 u8 *bytes = va_arg (*va,
u8 *);
87 int n_bytes = va_arg (*va,
int);
91 uword short_form = n_bytes <= 32;
97 for (i = 0; i < n_bytes; i++)
99 if (!short_form && (i % 32) == 0)
100 s =
format (s,
"%08x: ", i);
102 s =
format (s,
"%02x", bytes[i]);
104 if (!short_form && ((i + 1) % 32) == 0 && (i + 1) < n_bytes)
115 u32 n = va_arg (*va,
u32);
124 u8 *fmt = va_arg (*args,
u8 *);
125 f64 t = va_arg (*args,
f64);
128 const f64 seconds_per_minute = 60;
129 const f64 seconds_per_hour = 60 * seconds_per_minute;
130 const f64 seconds_per_day = 24 * seconds_per_hour;
131 uword days, hours, minutes, secs, msecs, usecs;
133 days = t / seconds_per_day;
134 t -= days * seconds_per_day;
136 hours = t / seconds_per_hour;
137 t -= hours * seconds_per_hour;
139 minutes = t / seconds_per_minute;
140 t -= minutes * seconds_per_minute;
148 for (f = fmt; *f; f++)
151 char *what_fmt =
"%d";
185 s =
format (s, what_fmt, what);
208 u = (
uword) 1 << log_u;
212 s =
format (s,
"%d", size >> log_u);
215 s =
format (s,
"%c",
" kmg"[log_u / 10]);
227 if (!
unformat (input,
"%wd%_", &amount))
251 *result = amount << shift;
260 u8 *
id = va_arg (*va,
u8 *);
268 for (i = 0;
id[
i] != 0 && i < l; i++)
283 u8 *data = va_arg (*args,
u8 *);
286 const int line_len = 16;
294 for (i = 0; i <
len; i++)
296 line_hex =
format (line_hex,
"%02x ", data[i]);
297 line_str =
format (line_str,
"%c", isprint (data[i]) ? data[i] :
'.');
298 if (!((i + 1) % line_len))
300 s =
format (s,
"%U%05x: %v[%v]",
302 index, line_hex, line_str);
311 while (i++ % line_len)
312 line_hex =
format (line_hex,
" ");
315 s =
format (s,
"%U%05x: %v[%v]",
317 index, line_hex, line_str);
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
static uword min_log2(uword x)
#define vec_reset_length(v)
Reset vector length to zero NULL-pointer tolerant.
#define vec_add(V, E, N)
Add N elements to end of vector V (no header, unspecified alignment)
#define vec_free(V)
Free vector's memory (no header).
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
static uword clib_mem_is_vec(void *v)
Predicate function, says whether the supplied vector is a clib heap object.