bcb4e51a409d94ae670de96afb8483a4f7855294Stephan Bosch/* Copyright (c) 2017-2018 Dovecot authors, see the included COPYING file */
e9068f1c3326de0265d0ef542a0d7723f5f01bc8Timo Sirainenvoid stats_event_category_register(const char *name,
e9068f1c3326de0265d0ef542a0d7723f5f01bc8Timo Sirainen p_new(categories_pool, struct event_category, 1);
e9068f1c3326de0265d0ef542a0d7723f5f01bc8Timo Sirainen category->name = p_strdup(categories_pool, name);
e9068f1c3326de0265d0ef542a0d7723f5f01bc8Timo Sirainen /* Create a temporary event to register the category. A bit slower
e9068f1c3326de0265d0ef542a0d7723f5f01bc8Timo Sirainen than necessary, but this code won't be called often. */
e9068f1c3326de0265d0ef542a0d7723f5f01bc8Timo Sirainen struct event_category *categories[] = { category, NULL };
e9068f1c3326de0265d0ef542a0d7723f5f01bc8Timo Sirainen categories_pool = pool_alloconly_create("categories", 1024);