29 int unnamed_count = 0;
39 if (!name || name[0] == 0) {
44 GB_warningf(
"Failed to rename unnamed configuration to '%s'", new_name);
53 if (name) configNames.
put(name);
93 if (!top_area || !middle_area) {
114 if (strcmp(name, oldName) != 0) error =
GBT_write_string(gb_config,
"name", name);
117 if (!error) error =
GBT_write_string(gb_config,
"middle_area", middle_area);
120 if (comment && comment[0]) {
125 if (gb_comment) error =
GB_delete(gb_comment);
145 if (config_string[parse_pos]) {
146 char label = config_string[parse_pos+1];
162 const char *start_of_name = config_string+parse_pos+2;
163 const char *behind_name = strchr(start_of_name,
'\1');
165 if (!behind_name) behind_name = strchr(start_of_name,
'\0');
175 parse_pos = behind_name-config_string;
180 const char *end_of_config = strchr(config_string+parse_pos,
'\0');
181 parse_pos = end_of_config-config_string;
182 gb_assert(config_string[parse_pos] == 0);
192 char prefix[] =
"\1?";
201 case CI_SAI: label =
'S';
break;
218 void TEST_GBT_get_configuration_names() {
225 const char *configs[] = {
"arb",
"BASIC",
"Check it",
"dummy" };
static GBDATA * findOrCreate_configuration(GBDATA *gb_main, const char *name)
GBDATA * GB_open(const char *path, const char *opent)
void put(const char *elem)
GBDATA * GB_nextEntry(GBDATA *entry)
GB_ERROR GB_end_transaction(GBDATA *gbd, GB_ERROR error)
#define TEST_EXPECT_STRARRAY_CONTAINS(strings, separator, expected)
const char * GBS_global_string(const char *templat,...)
void cat(const char *from)
char * ARB_strpartdup(const char *start, const char *end)
#define ARRAY_ELEMS(array)
GBDATA * GB_get_father(GBDATA *gbd)
GB_ERROR GB_push_transaction(GBDATA *gbd)
#define DEFAULT_CONFIGURATION
void append_to_config_string(GBS_strstruct &out) const
GB_ERROR GB_delete(GBDATA *&source)
GB_ERROR GB_export_error(const char *error)
GB_ERROR GB_await_error()
GBDATA * GB_create_container(GBDATA *father, const char *key)
char * GBT_read_string(GBDATA *gb_container, const char *fieldpath)
void GB_warningf(const char *templat,...)
long GB_number_of_subentries(GBDATA *gbd)
GBT_CONFIG_ITEM_TYPE type
static void error(const char *msg)
GB_ERROR saveAsOver(GBDATA *gb_main, const char *name, const char *oldName, bool warnIfSavingDefault) const
GBDATA * GBT_find_configuration(GBDATA *gb_main, const char *name)
GB_ERROR GBT_write_string(GBDATA *gb_container, const char *fieldpath, const char *content)
const GBT_config_item & nextItem(GB_ERROR &error)
void GBT_message(GBDATA *gb_main, const char *msg)
GBDATA * GB_find_string(GBDATA *gbd, const char *key, const char *str, GB_CASE case_sens, GB_SEARCH_TYPE gbs)
void GBT_get_configuration_names(ConstStrArray &configNames, GBDATA *gb_main)
void reserve(size_t forElems)
GB_transaction ta(gb_var)
GBDATA * GB_search(GBDATA *gbd, const char *fieldpath, GB_TYPES create)
const char * GBT_read_char_pntr(GBDATA *gb_container, const char *fieldpath)
#define TEST_EXPECT_EQUAL(expr, want)
GBDATA * GB_entry(GBDATA *father, const char *key)
char * GBS_global_string_copy(const char *templat,...)
void GB_close(GBDATA *gbd)