version 1.221, 2019/12/26 11:04:58 |
version 1.222, 2019/12/26 14:48:29 |
|
|
void *), void *arg) |
void *), void *arg) |
{ |
{ |
struct format_entry *fe; |
struct format_entry *fe; |
static char s[64]; |
char s[64]; |
|
|
RB_FOREACH(fe, format_entry_tree, &ft->tree) { |
RB_FOREACH(fe, format_entry_tree, &ft->tree) { |
if (fe->t != 0) { |
if (fe->t != 0) { |
xsnprintf(s, sizeof s, "%lld", (long long)fe->t); |
xsnprintf(s, sizeof s, "%lld", (long long)fe->t); |
cb(fe->key, fe->value, s); |
cb(fe->key, s, arg); |
} else { |
} else { |
if (fe->value == NULL && fe->cb != NULL) { |
if (fe->value == NULL && fe->cb != NULL) { |
fe->cb(ft, fe); |
fe->cb(ft, fe); |
|
|
static void |
static void |
format_add_tv(struct format_tree *ft, const char *key, struct timeval *tv) |
format_add_tv(struct format_tree *ft, const char *key, struct timeval *tv) |
{ |
{ |
struct format_entry *fe; |
struct format_entry *fe, *fe_now; |
struct format_entry *fe_now; |
|
|
|
fe = xmalloc(sizeof *fe); |
fe = xmalloc(sizeof *fe); |
fe->key = xstrdup(key); |
fe->key = xstrdup(key); |