changeset 22439:74c84176bbdc

lib-storage: added settings updating function for the mail_storage_service user
author Sergey Kitov <sergey.kitov@open-xchange.com>
date Mon, 07 Aug 2017 15:59:35 +0300
parents 1e3702379e9d
children 49e3fb105f87
files src/lib-storage/mail-storage-service.c src/lib-storage/mail-storage-service.h
diffstat 2 files changed, 15 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-storage/mail-storage-service.c	Thu Jul 20 13:24:21 2017 +0300
+++ b/src/lib-storage/mail-storage-service.c	Mon Aug 07 15:59:35 2017 +0300
@@ -1676,3 +1676,13 @@
 	} T_END;
 	return set;
 }
+
+int mail_storage_service_user_set_setting(struct mail_storage_service_user *user,
+					  const char *key,
+					  const char *value,
+					  const char **error_r)
+{
+	int ret = settings_parse_keyvalue(user->set_parser, key, value);
+	*error_r = settings_parser_get_error(user->set_parser);
+	return ret;
+}
--- a/src/lib-storage/mail-storage-service.h	Thu Jul 20 13:24:21 2017 +0300
+++ b/src/lib-storage/mail-storage-service.h	Mon Aug 07 15:59:35 2017 +0300
@@ -157,5 +157,10 @@
 						   const char *const *fields);
 /* Return the settings pointed to by set_root parameter in _init() */
 void *mail_storage_service_get_settings(struct master_service *service);
+/* Updates settings for storage service user, forwards return value of settings_parse_keyvalue() */
+int mail_storage_service_user_set_setting(struct mail_storage_service_user *user,
+					  const char *key,
+					  const char *value,
+					  const char **error_r);
 
 #endif