if (final_ret > ret)
final_ret = ret;
+ if (params->escape_func != NULL) {
+ var = params->escape_func(var,
+ params->escape_context);
+ }
+
if (ret <= 0)
str_append(dest, var);
else {
#ifndef VAR_EXPAND_H
#define VAR_EXPAND_H
+typedef const char *var_expand_escape_t(const char *str, void *context);
+
struct var_expand_table {
char key;
const char *value;
};
struct var_expand_params {
+ /* If non-NULL, all variables are escaped with this function. */
+ var_expand_escape_t *escape_func;
+ void *escape_context;
+
/* Single table: */
const struct var_expand_table *table;
const struct var_expand_func_table *func_table;