#include "str-sanitize.h"
#include "stats-dist.h"
#include "time-util.h"
-#include "var-expand.h"
+#include "var-expand-new.h"
#include "event-filter.h"
#include "event-exporter.h"
#include "settings.h"
if (group_by->discrete_modifier == NULL)
return value;
- const struct var_expand_table table[] = {
- { 'v', value, "value" },
- { 'd', i_strchr_to_next(value, '@'), "domain" },
- { '\0', NULL, NULL }
+ const struct var_expand_params params = {
+ .table = (const struct var_expand_table[]) {
+ { .key = "value", .value = value },
+ VAR_EXPAND_TABLE_END
+ },
};
string_t *str = t_str_new(128);
- if (var_expand_with_table(str, group_by->discrete_modifier,
- table, &error) < 0) {
+ if (var_expand_new(str, group_by->discrete_modifier, ¶ms, &error) < 0) {
i_error("Failed to expand discrete modifier for %s: %s",
group_by->field, error);
}
#include "event-exporter.h"
#include "array.h"
#include "str.h"
-#include "var-expand.h"
+#include "var-expand-new.h"
/* <settings checks> */
#include "event-filter.h"
group_by->discrete_modifier = p_strdup(pool, params[0]);
/* Check that the variables are valid */
- const struct var_expand_table table[] = {
- { 'v', "", "value" },
- { 'd', "", "domain" },
- { '\0', NULL, NULL }
+ const struct var_expand_params vparams = {
+ .table = (const struct var_expand_table[]) {
+ { .key ="value", .value = "" },
+ VAR_EXPAND_TABLE_END
+ },
};
const char *error;
string_t *str = t_str_new(128);
- if (var_expand_with_table(str, group_by->discrete_modifier,
- table, &error) <= 0) {
+ if (var_expand_new(str, group_by->discrete_modifier, &vparams, &error) < 0) {
*error_r = t_strdup_printf(
"Failed to expand discrete modifier for %s: %s",
group_by->field, error);