###############################################################################
# libconfig
LIBCONFIG= libconfig.a
-LIBCONFIGOBJS= config/address.o config/bool.o config/cfgaccount.o config/command.o config/dump.o \
+LIBCONFIGOBJS= config/address.o config/bool.o config/command.o config/dump.o \
config/long.o config/magic.o config/mbtable.o config/number.o \
config/path.o config/quad.o config/regex.o config/set.o \
config/sort.o config/string.o
return a;
}
+/**
+ * account_add_config - Add some inherited Config items
+ * @param a Account to add to
+ * @param cs Parent Config set
+ * @param name Account name
+ * @param var_names Names of Config items
+ * @retval bool True, if Config was successfully added
+ */
+bool account_add_config(struct Account *a, const struct ConfigSet *cs,
+ const char *name, const char *var_names[])
+{
+ if (!a || !cs || !name || !var_names)
+ return false;
+
+ size_t count = 0;
+ for (; var_names[count]; count++)
+ ;
+
+ a->name = mutt_str_strdup(name);
+ a->cs = cs;
+ a->var_names = var_names;
+ a->vars = mutt_mem_calloc(count, sizeof(struct HashElem *));
+ a->num_vars = count;
+
+ char a_name[64];
+
+ for (size_t i = 0; i < a->num_vars; i++)
+ {
+ struct HashElem *parent = cs_get_elem(cs, a->var_names[i]);
+ if (!parent)
+ {
+ mutt_debug(LL_DEBUG1, "%s doesn't exist\n", a->var_names[i]);
+ return false;
+ }
+
+ snprintf(a_name, sizeof(a_name), "%s:%s", name, a->var_names[i]);
+ a->vars[i] = cs_inherit_variable(cs, parent, a_name);
+ if (!a->vars[i])
+ {
+ mutt_debug(LL_DEBUG1, "failed to create %s\n", a_name);
+ return false;
+ }
+ }
+
+ return true;
+}
+
+/**
+ * account_free_config - Remove an Account's Config items
+ * @param a Account
+ */
+void account_free_config(struct Account *a)
+{
+ if (!a)
+ return;
+
+ char child[128];
+ struct Buffer *err = mutt_buffer_alloc(128);
+
+ for (size_t i = 0; i < a->num_vars; i++)
+ {
+ snprintf(child, sizeof(child), "%s:%s", a->name, a->var_names[i]);
+ mutt_buffer_reset(err);
+ int result = cs_str_reset(a->cs, child, err);
+ if (CSR_RESULT(result) != CSR_SUCCESS)
+ mutt_debug(LL_DEBUG1, "reset failed for %s: %s\n", child, mutt_b2s(err));
+ mutt_hash_delete(a->cs->hash, child, NULL);
+ }
+
+ mutt_buffer_free(&err);
+ FREE(&a->name);
+ FREE(&a->vars);
+}
+
+/**
+ * account_free - Free an Account
+ * @param[out] ptr Account to free
+ */
+void account_free(struct Account **ptr)
+{
+ if (!ptr || !*ptr)
+ return;
+
+ struct Account *a = *ptr;
+ if (!TAILQ_EMPTY(&AllAccounts))
+ TAILQ_REMOVE(&AllAccounts, a, entries);
+ if (a->free_adata)
+ a->free_adata(&a->adata);
+
+ account_free_config(a);
+
+ FREE(ptr);
+}
+
/**
* account_remove_mailbox - Remove a Mailbox from an Account
* @param a Account
if (STAILQ_EMPTY(&a->mailboxes))
{
- TAILQ_REMOVE(&AllAccounts, a, entries);
- if (a->free_adata)
- a->free_adata(&a->adata);
- FREE(&a);
+ account_free(&a);
}
}
+
+/**
+ * account_set_value - Set an Account-specific config item
+ * @param a Account
+ * @param vid Value ID (index into Account's HashElem's)
+ * @param value Native pointer/value to set
+ * @param err Buffer for error messages
+ * @retval num Result, e.g. #CSR_SUCCESS
+ */
+int account_set_value(const struct Account *a, size_t vid, intptr_t value, struct Buffer *err)
+{
+ if (!a)
+ return CSR_ERR_CODE;
+ if (vid >= a->num_vars)
+ return CSR_ERR_UNKNOWN;
+
+ struct HashElem *he = a->vars[vid];
+ return cs_he_native_set(a->cs, he, value, err);
+}
+
+/**
+ * account_get_value - Get an Account-specific config item
+ * @param a Account
+ * @param vid Value ID (index into Account's HashElem's)
+ * @param result Buffer for results or error messages
+ * @retval num Result, e.g. #CSR_SUCCESS
+ */
+int account_get_value(const struct Account *a, size_t vid, struct Buffer *result)
+{
+ if (!a)
+ return CSR_ERR_CODE;
+ if (vid >= a->num_vars)
+ return CSR_ERR_UNKNOWN;
+
+ struct HashElem *he = a->vars[vid];
+
+ if ((he->type & DT_INHERITED) && (DTYPE(he->type) == 0))
+ {
+ struct Inheritance *i = he->data;
+ he = i->parent;
+ }
+
+ return cs_he_string_get(a->cs, he, result);
+}
TAILQ_ENTRY(Account) entries;
void *adata;
void (*free_adata)(void **);
+
+ char *name; ///< Name of Account
+ const struct ConfigSet *cs; ///< Parent ConfigSet
+ const char **var_names; ///< Array of the names of local config items
+ size_t num_vars; ///< Number of local config items
+ struct HashElem **vars; ///< Array of the HashElems of local config items
};
TAILQ_HEAD(AccountList, Account);
extern struct AccountList AllAccounts; ///< List of all Accounts
+bool account_add_config(struct Account *a, const struct ConfigSet *cs, const char *name, const char *var_names[]);
+void account_free(struct Account **ptr);
+void account_free_config(struct Account *a);
+int account_get_value(const struct Account *a, size_t vid, struct Buffer *result);
struct Account *account_new(void);
void account_remove_mailbox(struct Account *a, struct Mailbox *m);
+int account_set_value(const struct Account *a, size_t vid, intptr_t value, struct Buffer *err);
#endif /* MUTT_ACCOUNT_H */
+++ /dev/null
-/**
- * @file
- * A collection of account-specific config items
- *
- * @authors
- * Copyright (C) 2017-2018 Richard Russon <rich@flatcap.org>
- *
- * @copyright
- * This program is free software: you can redistribute it and/or modify it under
- * the terms of the GNU General Public License as published by the Free Software
- * Foundation, either version 2 of the License, or (at your option) any later
- * version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-/**
- * @page config_cfgaccount Account-specific config items
- *
- * A collection of account-specific config items.
- */
-
-#include "config.h"
-#include <stdbool.h>
-#include <stdio.h>
-#include "mutt/mutt.h"
-#include "cfgaccount.h"
-#include "inheritance.h"
-#include "set.h"
-#include "types.h"
-
-/**
- * ac_new - Create an CfgAccount
- * @param cs Config items
- * @param name Name of CfgAccount
- * @param var_names List of config items (NULL terminated)
- * @retval ptr New CfgAccount object
- */
-struct CfgAccount *ac_new(const struct ConfigSet *cs, const char *name,
- const char *var_names[])
-{
- if (!cs || !name || !var_names)
- return NULL;
-
- int count = 0;
- for (; var_names[count]; count++)
- ;
-
- struct CfgAccount *ac = mutt_mem_calloc(1, sizeof(*ac));
- ac->name = mutt_str_strdup(name);
- ac->cs = cs;
- ac->var_names = var_names;
- ac->vars = mutt_mem_calloc(count, sizeof(struct HashElem *));
- ac->num_vars = count;
-
- bool success = true;
- char acname[64];
-
- for (size_t i = 0; i < ac->num_vars; i++)
- {
- struct HashElem *parent = cs_get_elem(cs, ac->var_names[i]);
- if (!parent)
- {
- mutt_debug(LL_DEBUG1, "%s doesn't exist\n", ac->var_names[i]);
- success = false;
- break;
- }
-
- snprintf(acname, sizeof(acname), "%s:%s", name, ac->var_names[i]);
- ac->vars[i] = cs_inherit_variable(cs, parent, acname);
- if (!ac->vars[i])
- {
- mutt_debug(LL_DEBUG1, "failed to create %s\n", acname);
- success = false;
- break;
- }
- }
-
- if (success)
- return ac;
-
- ac_free(cs, &ac);
- return NULL;
-}
-
-/**
- * ac_free - Free an CfgAccount object
- * @param[in] cs Config items
- * @param[out] ac CfgAccount to free
- */
-void ac_free(const struct ConfigSet *cs, struct CfgAccount **ac)
-{
- if (!cs || !ac || !*ac)
- return;
-
- char child[128];
- struct Buffer *err = mutt_buffer_new();
-
- for (size_t i = 0; i < (*ac)->num_vars; i++)
- {
- snprintf(child, sizeof(child), "%s:%s", (*ac)->name, (*ac)->var_names[i]);
- mutt_buffer_reset(err);
- int result = cs_str_reset(cs, child, err);
- if (CSR_RESULT(result) != CSR_SUCCESS)
- mutt_debug(LL_DEBUG1, "reset failed for %s: %s\n", child, mutt_b2s(err));
- mutt_hash_delete(cs->hash, child, NULL);
- }
-
- mutt_buffer_free(&err);
- FREE(&(*ac)->name);
- FREE(&(*ac)->vars);
- FREE(ac);
-}
-
-/**
- * ac_set_value - Set an CfgAccount-specific config item
- * @param ac CfgAccount-specific config items
- * @param vid Value ID (index into CfgAccount's HashElem's)
- * @param value Native pointer/value to set
- * @param err Buffer for error messages
- * @retval num Result, e.g. #CSR_SUCCESS
- */
-int ac_set_value(const struct CfgAccount *ac, size_t vid, intptr_t value, struct Buffer *err)
-{
- if (!ac)
- return CSR_ERR_CODE;
- if (vid >= ac->num_vars)
- return CSR_ERR_UNKNOWN;
-
- struct HashElem *he = ac->vars[vid];
- return cs_he_native_set(ac->cs, he, value, err);
-}
-
-/**
- * ac_get_value - Get an account-specific config item
- * @param ac Account-specific config items
- * @param vid Value ID (index into CfgAccount's HashElem's)
- * @param result Buffer for results or error messages
- * @retval num Result, e.g. #CSR_SUCCESS
- */
-int ac_get_value(const struct CfgAccount *ac, size_t vid, struct Buffer *result)
-{
- if (!ac)
- return CSR_ERR_CODE;
- if (vid >= ac->num_vars)
- return CSR_ERR_UNKNOWN;
-
- struct HashElem *he = ac->vars[vid];
-
- if ((he->type & DT_INHERITED) && (DTYPE(he->type) == 0))
- {
- struct Inheritance *i = he->data;
- he = i->parent;
- }
-
- return cs_he_string_get(ac->cs, he, result);
-}
+++ /dev/null
-/**
- * @file
- * A collection of account-specific config items
- *
- * @authors
- * Copyright (C) 2017-2018 Richard Russon <rich@flatcap.org>
- *
- * @copyright
- * This program is free software: you can redistribute it and/or modify it under
- * the terms of the GNU General Public License as published by the Free Software
- * Foundation, either version 2 of the License, or (at your option) any later
- * version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef _CONFIG_ACCOUNT_H
-#define _CONFIG_ACCOUNT_H
-
-#include <stdint.h>
-#include <stdio.h>
-
-struct Buffer;
-struct ConfigSet;
-
-/**
- * struct CfgAccount - Account-local config items
- */
-struct CfgAccount
-{
- char *name; /**< Name of Account */
- const struct ConfigSet *cs; /**< Parent ConfigSet */
- const char **var_names; /**< Array of the names of local config items */
- size_t num_vars; /**< Number of local config items */
- struct HashElem **vars; /**< Array of the HashElems of local config items */
-};
-
-struct CfgAccount *ac_new(const struct ConfigSet *cs, const char *name, const char *var_names[]);
-void ac_free(const struct ConfigSet *cs, struct CfgAccount **ac);
-
-int ac_set_value(const struct CfgAccount *ac, size_t vid, intptr_t value, struct Buffer *err);
-int ac_get_value(const struct CfgAccount *ac, size_t vid, struct Buffer *result);
-
-#endif /* _CONFIG_ACCOUNT_H */
*/
struct Inheritance
{
- struct HashElem *parent; /**< HashElem of parent config item */
- const char *name; /**< Name of this config item */
- struct CfgAccount *ac; /**< CfgAccount holding this config item */
- intptr_t var; /**< (Pointer to) value, of config item */
+ struct HashElem *parent; ///< HashElem of parent config item
+ const char *name; ///< Name of this config item
+ intptr_t var; ///< (Pointer to) value, of config item
};
#endif /* MUTT_CONFIG_INHERITANCE_H */
* | :------------------ | :------------------------- |
* | config/address.c | @subpage config_address |
* | config/bool.c | @subpage config_bool |
- * | config/cfgaccount.c | @subpage config_cfgaccount |
* | config/command.c | @subpage config_command |
* | config/dump.c | @subpage config_dump |
* | config/long.c | @subpage config_long |
#include "address.h"
#include "bool.h"
-#include "cfgaccount.h"
#include "command.h"
#include "dump.h"
#include "inheritance.h"
compress.c
config/address.c
config/bool.c
-config/cfgaccount.c
config/command.c
config/dump.c
config/long.c
mutt/mbyte.c
mutt/md5.c
mutt/memory.c
+mutt/notify.c
mutt/path.c
mutt/pool.c
mutt/regex.c
ncrypt/pgpmicalg.c
ncrypt/pgppacket.c
ncrypt/smime.c
+neomutt.c
nntp/browse.c
nntp/complete.c
nntp/newsrc.c
test/config/set.o \
test/config/sort.o \
test/config/string.o \
- test/config/synonym.o
+ test/config/synonym.o \
+ account.o
DATE_OBJS = test/date/mutt_date_add_timeout.o \
test/date/mutt_date_check_month.o \
/**
* @file
- * Test code for the CfgAccount object
+ * Test code for the Account object
*
* @authors
* Copyright (C) 2017-2018 Richard Russon <rich@flatcap.org>
#include "mutt/mutt.h"
#include "config/common.h"
#include "config/lib.h"
+#include "account.h"
static short VarApple;
static short VarBanana;
NULL,
};
- struct CfgAccount *ac = ac_new(cs, account, BrokenVarStr);
- if (TEST_CHECK(!ac))
+ struct Account *a = account_new();
+ bool result = account_add_config(a, cs, account, BrokenVarStr);
+ account_free(&a);
+
+ if (TEST_CHECK(!result))
{
TEST_MSG("Expected error:\n");
}
else
{
- ac_free(cs, &ac);
TEST_MSG("This test should have failed\n");
return;
}
- const char *CfgAccountVarStr2[] = {
+ const char *AccountVarStr2[] = {
"Apple",
"Apple",
NULL,
};
TEST_MSG("Expect error for next test\n");
- ac = ac_new(cs, account, CfgAccountVarStr2);
- if (!TEST_CHECK(!ac))
+ a = account_new();
+ result = account_add_config(a, cs, account, AccountVarStr2);
+ account_free(&a);
+
+ if (!TEST_CHECK(!result))
{
- ac_free(cs, &ac);
TEST_MSG("This test should have failed\n");
return;
}
account = "fruit";
- const char *CfgAccountVarStr[] = {
+ const char *AccountVarStr[] = {
"Apple",
"Cherry",
NULL,
};
- ac = ac_new(NULL, account, CfgAccountVarStr);
- if (!TEST_CHECK(ac == NULL))
+ a = account_new();
+
+ result = account_add_config(NULL, cs, account, AccountVarStr);
+ if (!TEST_CHECK(!result))
+ return;
+
+ result = account_add_config(a, NULL, account, AccountVarStr);
+ if (!TEST_CHECK(!result))
return;
- ac = ac_new(cs, NULL, CfgAccountVarStr);
- if (!TEST_CHECK(ac == NULL))
+ result = account_add_config(a, cs, NULL, AccountVarStr);
+ if (!TEST_CHECK(!result))
return;
- ac = ac_new(cs, account, NULL);
- if (!TEST_CHECK(ac == NULL))
+ result = account_add_config(a, cs, account, NULL);
+ if (!TEST_CHECK(!result))
return;
- ac = ac_new(cs, account, CfgAccountVarStr);
- if (!TEST_CHECK(ac != NULL))
+ result = account_add_config(a, cs, account, AccountVarStr);
+ if (!TEST_CHECK(result))
return;
size_t index = 0;
mutt_buffer_reset(&err);
- int rc = ac_set_value(NULL, index, 33, &err);
+ int rc = account_set_value(NULL, index, 33, &err);
- rc = ac_set_value(ac, index, 33, &err);
+ rc = account_set_value(a, index, 33, &err);
if (!TEST_CHECK(CSR_RESULT(rc) == CSR_SUCCESS))
{
TEST_MSG("%s\n", err.data);
}
mutt_buffer_reset(&err);
- rc = ac_set_value(ac, 99, 42, &err);
+ rc = account_set_value(a, 99, 42, &err);
if (TEST_CHECK(CSR_RESULT(rc) == CSR_ERR_UNKNOWN))
{
TEST_MSG("Expected error: %s\n", err.data);
}
mutt_buffer_reset(&err);
- rc = ac_get_value(NULL, index, &err);
+ rc = account_get_value(NULL, index, &err);
if (!TEST_CHECK(CSR_RESULT(rc) == CSR_ERR_CODE))
{
TEST_MSG("%s\n", err.data);
}
- rc = ac_get_value(ac, index, &err);
+ rc = account_get_value(a, index, &err);
if (!TEST_CHECK(CSR_RESULT(rc) == CSR_SUCCESS))
{
TEST_MSG("%s\n", err.data);
}
else
{
- TEST_MSG("%s = %s\n", CfgAccountVarStr[index], err.data);
+ TEST_MSG("%s = %s\n", AccountVarStr[index], err.data);
}
index++;
mutt_buffer_reset(&err);
- rc = ac_get_value(ac, index, &err);
+ rc = account_get_value(a, index, &err);
if (!TEST_CHECK(CSR_RESULT(rc) == CSR_SUCCESS))
{
TEST_MSG("%s\n", err.data);
}
else
{
- TEST_MSG("%s = %s\n", CfgAccountVarStr[index], err.data);
+ TEST_MSG("%s = %s\n", AccountVarStr[index], err.data);
}
mutt_buffer_reset(&err);
- rc = ac_get_value(ac, 99, &err);
+ rc = account_get_value(a, 99, &err);
if (TEST_CHECK(CSR_RESULT(rc) == CSR_ERR_UNKNOWN))
{
TEST_MSG("Expected error\n");
return;
}
- ac_free(NULL, &ac);
- ac_free(cs, NULL);
+ account_free(NULL);
- ac_free(cs, &ac);
+ account_free(&a);
cs_free(&cs);
FREE(&err.data);
log_line(__func__);
#include "address/lib.h"
#include "config/common.h"
#include "config/lib.h"
+#include "account.h"
static struct Address *VarApple;
static struct Address *VarBanana;
NULL,
};
- struct CfgAccount *ac = ac_new(cs, account, AccountVarAddr);
+ struct Account *a = account_new();
+ account_add_config(a, cs, account, AccountVarAddr);
// set parent
mutt_buffer_reset(err);
log_line(__func__);
result = true;
ti_out:
- ac_free(cs, &ac);
+ account_free(&a);
return result;
}
#include "mutt/mutt.h"
#include "config/common.h"
#include "config/lib.h"
+#include "account.h"
static bool VarApple;
static bool VarBanana;
NULL,
};
- struct CfgAccount *ac = ac_new(cs, account, AccountVarStr);
+ struct Account *a = account_new();
+ account_add_config(a, cs, account, AccountVarStr);
// set parent
VarMango = false;
log_line(__func__);
result = true;
ti_out:
- ac_free(cs, &ac);
+ account_free(&a);
return result;
}
#include "mutt/mutt.h"
#include "config/common.h"
#include "config/lib.h"
+#include "account.h"
static char *VarApple;
static char *VarBanana;
NULL,
};
- struct CfgAccount *ac = ac_new(cs, account, AccountVarStr);
+ struct Account *a = account_new();
+ account_add_config(a, cs, account, AccountVarStr);
// set parent
mutt_buffer_reset(err);
log_line(__func__);
result = true;
ti_out:
- ac_free(cs, &ac);
+ account_free(&a);
return result;
}
#include "mutt/mutt.h"
#include "config/lib.h"
#include "common.h"
+#include "account.h"
const char *line = "----------------------------------------"
"----------------------------------------";
#include "mutt/mutt.h"
#include "config/common.h"
#include "config/lib.h"
+#include "account.h"
static bool VarApple;
static bool VarBanana;
#include "mutt/mutt.h"
#include "config/common.h"
#include "config/lib.h"
+#include "account.h"
static char *VarApple;
static char *VarBanana;
#include "mutt/mutt.h"
#include "config/common.h"
#include "config/lib.h"
+#include "account.h"
static long VarApple;
static long VarBanana;
NULL,
};
- struct CfgAccount *ac = ac_new(cs, account, AccountVarStr);
+ struct Account *a = account_new();
+ account_add_config(a, cs, account, AccountVarStr);
// set parent
VarOlive = 123;
log_line(__func__);
result = true;
ti_out:
- ac_free(cs, &ac);
+ account_free(&a);
return result;
}
#include "mutt/mutt.h"
#include "config/common.h"
#include "config/lib.h"
+#include "account.h"
static short VarApple;
static short VarBanana;
NULL,
};
- struct CfgAccount *ac = ac_new(cs, account, AccountVarStr);
+ struct Account *a = account_new();
+ account_add_config(a, cs, account, AccountVarStr);
// set parent
mutt_buffer_reset(err);
log_line(__func__);
result = true;
ti_out:
- ac_free(cs, &ac);
+ account_free(&a);
return result;
}
#include "mutt/mutt.h"
#include "config/common.h"
#include "config/lib.h"
+#include "account.h"
static struct MbTable *VarApple;
static struct MbTable *VarBanana;
NULL,
};
- struct CfgAccount *ac = ac_new(cs, account, AccountVarMb);
+ struct Account *a = account_new();
+ account_add_config(a, cs, account, AccountVarMb);
// set parent
mutt_buffer_reset(err);
log_line(__func__);
result = true;
ti_out:
- ac_free(cs, &ac);
+ account_free(&a);
return result;
}
#include "mutt/mutt.h"
#include "config/common.h"
#include "config/lib.h"
+#include "account.h"
static short VarApple;
static short VarBanana;
NULL,
};
- struct CfgAccount *ac = ac_new(cs, account, AccountVarStr);
+ struct Account *a = account_new();
+ account_add_config(a, cs, account, AccountVarStr);
// set parent
VarOlive = 123;
log_line(__func__);
result = true;
ti_out:
- ac_free(cs, &ac);
+ account_free(&a);
return result;
}
#include "mutt/mutt.h"
#include "config/common.h"
#include "config/lib.h"
+#include "account.h"
static char *VarApple;
static char *VarBanana;
NULL,
};
- struct CfgAccount *ac = ac_new(cs, account, AccountVarStr);
+ struct Account *a = account_new();
+ account_add_config(a, cs, account, AccountVarStr);
// set parent
mutt_buffer_reset(err);
log_line(__func__);
result = true;
ti_out:
- ac_free(cs, &ac);
+ account_free(&a);
return result;
}
#include "mutt/mutt.h"
#include "config/common.h"
#include "config/lib.h"
+#include "account.h"
static char VarApple;
static char VarBanana;
NULL,
};
- struct CfgAccount *ac = ac_new(cs, account, AccountVarStr);
+ struct Account *a = account_new();
+ account_add_config(a, cs, account, AccountVarStr);
// set parent
mutt_buffer_reset(err);
log_line(__func__);
result = true;
ti_out:
- ac_free(cs, &ac);
+ account_free(&a);
return result;
}
#include "mutt/mutt.h"
#include "config/common.h"
#include "config/lib.h"
+#include "account.h"
static struct Regex *VarApple;
static struct Regex *VarBanana;
NULL,
};
- struct CfgAccount *ac = ac_new(cs, account, AccountVarRegex);
+ struct Account *a = account_new();
+ account_add_config(a, cs, account, AccountVarRegex);
// set parent
mutt_buffer_reset(err);
log_line(__func__);
result = true;
ti_out:
- ac_free(cs, &ac);
+ account_free(&a);
return result;
}
#include "mutt/mutt.h"
#include "config/common.h"
#include "config/lib.h"
+#include "account.h"
static short VarApple;
static bool VarBanana;
#include "mutt/mutt.h"
#include "config/common.h"
#include "config/lib.h"
+#include "account.h"
static short VarApple;
static short VarBanana;
NULL,
};
- struct CfgAccount *ac = ac_new(cs, account, AccountVarStr);
+ struct Account *a = account_new();
+ account_add_config(a, cs, account, AccountVarStr);
// set parent
VarStrawberry = SORT_SUBJECT;
log_line(__func__);
result = true;
ti_out:
- ac_free(cs, &ac);
+ account_free(&a);
return result;
}
#include "mutt/mutt.h"
#include "config/common.h"
#include "config/lib.h"
+#include "account.h"
static char *VarApple;
static char *VarBanana;
NULL,
};
- struct CfgAccount *ac = ac_new(cs, account, AccountVarStr);
+ struct Account *a = account_new();
+ account_add_config(a, cs, account, AccountVarStr);
// set parent
mutt_buffer_reset(err);
log_line(__func__);
result = true;
ti_out:
- ac_free(cs, &ac);
+ account_free(&a);
return result;
}
#include "mutt/mutt.h"
#include "config/common.h"
#include "config/lib.h"
+#include "account.h"
static char *VarApple;
static char *VarCherry;