mc_config 33 lib/mcconfig.h void mc_config_deinit (mc_config_t * mc_config); mc_config 35 lib/mcconfig.h gboolean mc_config_has_param (const mc_config_t * mc_config, const char *group, mc_config 37 lib/mcconfig.h gboolean mc_config_has_group (mc_config_t * mc_config, const char *group); mc_config 39 lib/mcconfig.h gboolean mc_config_del_key (mc_config_t * mc_config, const char *group, const gchar * param); mc_config 40 lib/mcconfig.h gboolean mc_config_del_group (mc_config_t * mc_config, const char *group); mc_config 42 lib/mcconfig.h gboolean mc_config_read_file (mc_config_t * mc_config, const gchar * ini_path, gboolean read_only, mc_config 45 lib/mcconfig.h gboolean mc_config_save_to_file (mc_config_t * mc_config, const gchar * ini_path, mc_config 51 lib/mcconfig.h gchar **mc_config_get_groups (const mc_config_t * mc_config, gsize * len); mc_config 52 lib/mcconfig.h gchar **mc_config_get_keys (const mc_config_t * mc_config, const gchar * group, gsize * len); mc_config 54 lib/mcconfig.h gchar *mc_config_get_string (mc_config_t * mc_config, const gchar * group, const gchar * param, mc_config 56 lib/mcconfig.h MC_MOCKABLE gchar *mc_config_get_string_raw (mc_config_t * mc_config, const gchar * group, mc_config 58 lib/mcconfig.h gboolean mc_config_get_bool (mc_config_t * mc_config, const gchar * group, const gchar * param, mc_config 60 lib/mcconfig.h int mc_config_get_int (mc_config_t * mc_config, const gchar * group, const gchar * param, int def); mc_config 62 lib/mcconfig.h gchar **mc_config_get_string_list (mc_config_t * mc_config, const gchar * group, mc_config 64 lib/mcconfig.h gboolean *mc_config_get_bool_list (mc_config_t * mc_config, const gchar * group, mc_config 66 lib/mcconfig.h int *mc_config_get_int_list (mc_config_t * mc_config, const gchar * group, const gchar * param, mc_config 72 lib/mcconfig.h void mc_config_set_string_raw (mc_config_t * mc_config, const gchar * group, const gchar * param, mc_config 74 lib/mcconfig.h void mc_config_set_string_raw_value (mc_config_t * mc_config, const gchar * group, mc_config 76 lib/mcconfig.h void mc_config_set_string (mc_config_t * mc_config, const gchar * group, const gchar * param, mc_config 78 lib/mcconfig.h void mc_config_set_bool (mc_config_t * mc_config, const gchar * group, const gchar * param, mc_config 80 lib/mcconfig.h void mc_config_set_int (mc_config_t * mc_config, const gchar * group, const gchar * param, mc_config 84 lib/mcconfig.h mc_config_set_string_list (mc_config_t * mc_config, const gchar * group, const gchar * param, mc_config 86 lib/mcconfig.h void mc_config_set_bool_list (mc_config_t * mc_config, const gchar * group, const gchar * param, mc_config 88 lib/mcconfig.h void mc_config_set_int_list (mc_config_t * mc_config, const gchar * group, const gchar * param, mc_config 51 lib/mcconfig/common.c mc_config_new_or_override_file (mc_config_t *mc_config, const gchar *ini_path, GError **mcerror) mc_config 62 lib/mcconfig/common.c data = g_key_file_to_data (mc_config->handle, &len, NULL); mc_config 109 lib/mcconfig/common.c mc_config_t *mc_config; mc_config 112 lib/mcconfig/common.c mc_config = g_try_malloc0 (sizeof (mc_config_t)); mc_config 113 lib/mcconfig/common.c if (mc_config == NULL) mc_config 116 lib/mcconfig/common.c mc_config->handle = g_key_file_new (); mc_config 117 lib/mcconfig/common.c if (mc_config->handle == NULL) mc_config 119 lib/mcconfig/common.c g_free (mc_config); mc_config 124 lib/mcconfig/common.c return mc_config; mc_config 139 lib/mcconfig/common.c g_key_file_load_from_file (mc_config->handle, ini_path, flags, NULL); mc_config 144 lib/mcconfig/common.c mc_config->ini_path = g_strdup (ini_path); mc_config 145 lib/mcconfig/common.c return mc_config; mc_config 151 lib/mcconfig/common.c mc_config_deinit (mc_config_t *mc_config) mc_config 153 lib/mcconfig/common.c if (mc_config != NULL) mc_config 155 lib/mcconfig/common.c g_free (mc_config->ini_path); mc_config 156 lib/mcconfig/common.c g_key_file_free (mc_config->handle); mc_config 157 lib/mcconfig/common.c g_free (mc_config); mc_config 164 lib/mcconfig/common.c mc_config_has_param (const mc_config_t *mc_config, const char *group, const gchar *param) mc_config 169 lib/mcconfig/common.c g_return_val_if_fail (mc_config != NULL, FALSE); mc_config 171 lib/mcconfig/common.c value = g_key_file_get_value (mc_config->handle, group, param, NULL); mc_config 181 lib/mcconfig/common.c mc_config_has_group (mc_config_t *mc_config, const char *group) mc_config 183 lib/mcconfig/common.c if (mc_config == NULL || group == NULL) mc_config 186 lib/mcconfig/common.c return g_key_file_has_group (mc_config->handle, group); mc_config 192 lib/mcconfig/common.c mc_config_del_key (mc_config_t *mc_config, const char *group, const gchar *param) mc_config 194 lib/mcconfig/common.c if (mc_config == NULL || group == NULL || param == NULL) mc_config 197 lib/mcconfig/common.c return g_key_file_remove_key (mc_config->handle, group, param, NULL); mc_config 203 lib/mcconfig/common.c mc_config_del_group (mc_config_t *mc_config, const char *group) mc_config 205 lib/mcconfig/common.c if (mc_config == NULL || group == NULL) mc_config 208 lib/mcconfig/common.c return g_key_file_remove_group (mc_config->handle, group, NULL); mc_config 214 lib/mcconfig/common.c mc_config_read_file (mc_config_t *mc_config, const gchar *ini_path, gboolean read_only, mc_config 222 lib/mcconfig/common.c if (mc_config == NULL) mc_config 244 lib/mcconfig/common.c g_key_file_remove_key (mc_config->handle, *curr_grp, *curr_key, NULL); mc_config 246 lib/mcconfig/common.c g_key_file_set_value (mc_config->handle, *curr_grp, *curr_key, value); mc_config 250 lib/mcconfig/common.c g_key_file_remove_key (mc_config->handle, *curr_grp, *curr_key, NULL); mc_config 264 lib/mcconfig/common.c mc_config_save_file (mc_config_t *mc_config, GError **mcerror) mc_config 268 lib/mcconfig/common.c if (mc_config == NULL || mc_config->ini_path == NULL) mc_config 271 lib/mcconfig/common.c return mc_config_new_or_override_file (mc_config, mc_config->ini_path, mcerror); mc_config 277 lib/mcconfig/common.c mc_config_save_to_file (mc_config_t *mc_config, const gchar *ini_path, GError **mcerror) mc_config 281 lib/mcconfig/common.c if (mc_config == NULL) mc_config 284 lib/mcconfig/common.c return mc_config_new_or_override_file (mc_config, ini_path, mcerror); mc_config 49 lib/mcconfig/get.c mc_config_get_groups (const mc_config_t *mc_config, gsize *len) mc_config 53 lib/mcconfig/get.c if (mc_config != NULL) mc_config 54 lib/mcconfig/get.c ret = g_key_file_get_groups (mc_config->handle, len); mc_config 69 lib/mcconfig/get.c mc_config_get_keys (const mc_config_t *mc_config, const gchar *group, gsize *len) mc_config 73 lib/mcconfig/get.c if (mc_config != NULL && group != NULL) mc_config 74 lib/mcconfig/get.c ret = g_key_file_get_keys (mc_config->handle, group, len, NULL); mc_config 89 lib/mcconfig/get.c mc_config_get_string (mc_config_t *mc_config, const gchar *group, mc_config 97 lib/mcconfig/get.c ret = mc_config_get_string_raw (mc_config, group, param, def); mc_config 124 lib/mcconfig/get.c mc_config_get_string_raw (mc_config_t *mc_config, const gchar *group, mc_config 129 lib/mcconfig/get.c if (mc_config == NULL || group == NULL || param == NULL) mc_config 132 lib/mcconfig/get.c if (!mc_config_has_param (mc_config, group, param)) mc_config 135 lib/mcconfig/get.c mc_config_set_string (mc_config, group, param, def); mc_config 139 lib/mcconfig/get.c ret = g_key_file_get_string (mc_config->handle, group, param, NULL); mc_config 147 lib/mcconfig/get.c mc_config_get_bool (mc_config_t *mc_config, const gchar *group, const gchar *param, gboolean def) mc_config 149 lib/mcconfig/get.c if (mc_config == NULL || group == NULL || param == NULL) mc_config 152 lib/mcconfig/get.c if (!mc_config_has_param (mc_config, group, param)) mc_config 154 lib/mcconfig/get.c mc_config_set_bool (mc_config, group, param, def); mc_config 158 lib/mcconfig/get.c return g_key_file_get_boolean (mc_config->handle, group, param, NULL); mc_config 164 lib/mcconfig/get.c mc_config_get_int (mc_config_t *mc_config, const gchar *group, const gchar *param, int def) mc_config 166 lib/mcconfig/get.c if (mc_config == NULL || group == NULL || param == NULL) mc_config 169 lib/mcconfig/get.c if (!mc_config_has_param (mc_config, group, param)) mc_config 171 lib/mcconfig/get.c mc_config_set_int (mc_config, group, param, def); mc_config 175 lib/mcconfig/get.c return g_key_file_get_integer (mc_config->handle, group, param, NULL); mc_config 181 lib/mcconfig/get.c mc_config_get_string_list (mc_config_t *mc_config, const gchar *group, mc_config 184 lib/mcconfig/get.c if (mc_config == NULL || group == NULL || param == NULL) mc_config 187 lib/mcconfig/get.c return g_key_file_get_string_list (mc_config->handle, group, param, length, NULL); mc_config 193 lib/mcconfig/get.c mc_config_get_bool_list (mc_config_t *mc_config, const gchar *group, mc_config 196 lib/mcconfig/get.c if (mc_config == NULL || group == NULL || param == NULL) mc_config 199 lib/mcconfig/get.c return g_key_file_get_boolean_list (mc_config->handle, group, param, length, NULL); mc_config 205 lib/mcconfig/get.c mc_config_get_int_list (mc_config_t *mc_config, const gchar *group, mc_config 208 lib/mcconfig/get.c if (mc_config == NULL || group == NULL || param == NULL) mc_config 211 lib/mcconfig/get.c return g_key_file_get_integer_list (mc_config->handle, group, param, length, NULL); mc_config 77 lib/mcconfig/set.c mc_config_set_string_raw (mc_config_t *mc_config, const gchar *group, mc_config 80 lib/mcconfig/set.c if (mc_config != NULL && group != NULL && param != NULL && value != NULL) mc_config 81 lib/mcconfig/set.c g_key_file_set_string (mc_config->handle, group, param, value); mc_config 87 lib/mcconfig/set.c mc_config_set_string_raw_value (mc_config_t *mc_config, const gchar *group, mc_config 90 lib/mcconfig/set.c if (mc_config != NULL && group != NULL && param != NULL && value != NULL) mc_config 91 lib/mcconfig/set.c g_key_file_set_value (mc_config->handle, group, param, value); mc_config 97 lib/mcconfig/set.c mc_config_set_string (mc_config_t *mc_config, const gchar *group, mc_config 100 lib/mcconfig/set.c if (mc_config != NULL && group != NULL && param != NULL && value != NULL) mc_config 105 lib/mcconfig/set.c g_key_file_set_string (mc_config->handle, group, param, buffer); mc_config 113 lib/mcconfig/set.c mc_config_set_bool (mc_config_t *mc_config, const gchar *group, const gchar *param, gboolean value) mc_config 115 lib/mcconfig/set.c if (mc_config != NULL && group != NULL && param != NULL) mc_config 116 lib/mcconfig/set.c g_key_file_set_boolean (mc_config->handle, group, param, value); mc_config 122 lib/mcconfig/set.c mc_config_set_int (mc_config_t *mc_config, const gchar *group, const gchar *param, int value) mc_config 124 lib/mcconfig/set.c if (mc_config != NULL && group != NULL && param != NULL) mc_config 125 lib/mcconfig/set.c g_key_file_set_integer (mc_config->handle, group, param, value); mc_config 131 lib/mcconfig/set.c mc_config_set_string_list (mc_config_t *mc_config, const gchar *group, mc_config 134 lib/mcconfig/set.c if (mc_config != NULL && group != NULL && param != NULL && value != NULL && length != 0) mc_config 135 lib/mcconfig/set.c g_key_file_set_string_list (mc_config->handle, group, param, value, length); mc_config 141 lib/mcconfig/set.c mc_config_set_bool_list (mc_config_t *mc_config, const gchar *group, mc_config 144 lib/mcconfig/set.c if (mc_config != NULL && group != NULL && param != NULL && value != NULL && length != 0) mc_config 145 lib/mcconfig/set.c g_key_file_set_boolean_list (mc_config->handle, group, param, value, length); mc_config 151 lib/mcconfig/set.c mc_config_set_int_list (mc_config_t *mc_config, const gchar *group, mc_config 154 lib/mcconfig/set.c if (mc_config != NULL && group != NULL && param != NULL && value != NULL && length != 0) mc_config 155 lib/mcconfig/set.c g_key_file_set_integer_list (mc_config->handle, group, param, value, length); mc_config 35 tests/lib/mcconfig/config_string.c static mc_config_t *mc_config; mc_config 46 tests/lib/mcconfig/config_string.c mc_config = mc_config_init (ini_filename, FALSE); mc_config 56 tests/lib/mcconfig/config_string.c if (!mc_config_save_file (mc_config, &error)) mc_config 61 tests/lib/mcconfig/config_string.c mc_config_deinit (mc_config); mc_config 62 tests/lib/mcconfig/config_string.c mc_config = mc_config_init (ini_filename, FALSE); mc_config 70 tests/lib/mcconfig/config_string.c mc_config_deinit (mc_config); mc_config 175 tests/lib/mcconfig/config_string.c mc_config_set_string (mc_config, "test-group1", "test-param1", " some value "); mc_config 176 tests/lib/mcconfig/config_string.c mc_config_set_string (mc_config, "test-group1", "test-param2", mc_config 178 tests/lib/mcconfig/config_string.c mc_config_set_string (mc_config, "test-group1", "test-param3", " \tsome value2\n\nf\b\005fff "); mc_config 179 tests/lib/mcconfig/config_string.c mc_config_set_string_raw (mc_config, "test-group2", "test-param1", " some value "); mc_config 180 tests/lib/mcconfig/config_string.c mc_config_set_string_raw (mc_config, "test-group2", "test-param2", mc_config 182 tests/lib/mcconfig/config_string.c mc_config_set_string_raw (mc_config, "test-group2", "test-param3", mc_config 189 tests/lib/mcconfig/config_string.c mc_config_get_string (mc_config, data->input_group, data->input_param, mc_config 192 tests/lib/mcconfig/config_string.c mc_config_get_string_raw (mc_config, data->input_group, data->input_param, mc_config 220 tests/lib/mcconfig/config_string.c mc_config_set_string_raw (mc_config, "test-group1", "test-param1", esc_str); mc_config 227 tests/lib/mcconfig/config_string.c actual_value = mc_config_get_string_raw (mc_config, "test-group1", "test-param1", "not-exists");