Cross Reference: stats-event-category.c
xref
: /
dovecot
/
src
/
stats
/
stats-event-category.c
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
stats-event-category.c revision e9068f1c3326de0265d0ef542a0d7723f5f01bc8
2046
N/A
/* Copyright (c) 2017 Dovecot authors, see the included COPYING file */
2046
N/A
2046
N/A
#
include
"
lib.h
"
2046
N/A
#
include
"
stats-event-category.h
"
2046
N/A
2046
N/A
static
pool_t
categories_pool
;
2046
N/A
2046
N/A
void
stats_event_category_register
(
const
char
*
name
,
2046
N/A
struct
event_category
*
parent
)
2046
N/A
{
2046
N/A
struct
event_category
*
category
=
2046
N/A
p_new
(
categories_pool
,
struct
event_category
,
1
);
2046
N/A
category
->
parent
=
parent
;
2046
N/A
category
->
name
=
p_strdup
(
categories_pool
,
name
);
2046
N/A
2046
N/A
/* Create a temporary event to register the category. A bit slower
2046
N/A
than necessary, but this code won't be called often. */
2046
N/A
struct
event
*
event
=
event_create
(
NULL
);
2046
N/A
struct
event_category
*
categories
[] = {
category
,
NULL
};
2046
N/A
event_add_categories
(
event
,
categories
);
2046
N/A
event_unref
(&
event
);
2046
N/A
}
2046
N/A
3356
N/A
void
stats_event_categories_init
(
void
)
2046
N/A
{
2046
N/A
categories_pool
=
pool_alloconly_create
(
"categories"
,
1024
);
3356
N/A
}
2046
N/A
3234
N/A
void
stats_event_categories_deinit
(
void
)
3234
N/A
{
3234
N/A
pool_unref
(&
categories_pool
);
3234
N/A
}
2046
N/A