#include "lib.h"
#include "str.h"
+#include "str-parse.h"
#include "settings-parser.h"
#include "config-parser-private.h"
#include "old-set-parser.h"
if (strcmp(key, "auth_debug") == 0) {
const char *error ATTR_UNUSED;
bool auth_debug;
- if (settings_get_bool(value, &auth_debug, &error) == 0 &&
+ if (str_parse_get_bool(value, &auth_debug, &error) == 0 &&
auth_debug)
ctx->old->post_auth_debug = auth_debug;
obsolete(ctx, "%s will be removed in a future version%s",
if (strcmp(key, "disable_plaintext_auth") == 0) {
const char *error;
bool b;
- if (settings_get_bool(value, &b, &error) < 0)
+ if (str_parse_get_bool(value, &b, &error) < 0)
i_fatal("%s has bad value '%s': %s", key, value, error);
obsolete(ctx, "%s = %s has been replaced with auth_allow_cleartext = %s",
key, value, b ? "no" : "yes");
return NULL;
}
-int settings_get_bool(const char *value, bool *result_r,
- const char **error_r)
-{
- return str_parse_get_bool(value, result_r, error_r);
-}
-
static int
get_bool(struct setting_parser_context *ctx, const char *value, bool *result_r)
{
int ret;
- if ((ret = settings_get_bool(value, result_r, &ctx->error)) < 0)
+ if ((ret = str_parse_get_bool(value, result_r, &ctx->error)) < 0)
ctx->error = p_strdup(ctx->parser_pool, ctx->error);
return ret;
}
/* Parse time interval string, return as milliseconds. */
int settings_get_time_msecs(const char *str, unsigned int *msecs_r,
const char **error_r);
-/* Parse boolean string, return as boolean */
-int settings_get_bool(const char *value, bool *result_r,
- const char **error_r);
void set_config_binary(bool value);
bool is_config_binary(void);
#include "hex-binary.h"
#include "sql-api-private.h"
#include "strfuncs.h"
-#include "settings-parser.h"
+#include "str-parse.h"
#ifdef BUILD_SQLITE
#include <sqlite3.h>
return -1;
}
} else if (str_begins(*params, "readonly=", &arg)) {
- if (settings_get_bool(arg, &val, error_r) < 0) {
+ if (str_parse_get_bool(arg, &val, error_r) < 0) {
*error_r = t_strdup_printf("readonly: %s", *error_r);
return -1;
}