Ticket #3660: unable to view archive content using F3.
[midnight-commander.git] / lib / mcconfig.h
blob931342e6476458daabeb0c592a7178cb7455f634
1 #ifndef MC_CONFIG_H
2 #define MC_CONFIG_H
4 #include "lib/vfs/vfs.h" /* vfs_path_t */
6 /*** typedefs(not structures) and defined constants **********************************************/
8 #define CONFIG_APP_SECTION "Midnight-Commander"
9 #define CONFIG_PANELS_SECTION "Panels"
10 #define CONFIG_LAYOUT_SECTION "Layout"
11 #define CONFIG_MISC_SECTION "Misc"
12 #define CONFIG_EXT_EDITOR_VIEWER_SECTION "External editor or viewer parameters"
14 /*** enums ***************************************************************************************/
16 /*** structures declarations (and typedefs of structures)*****************************************/
18 typedef struct mc_config_t
20 GKeyFile *handle;
21 gchar *ini_path;
22 } mc_config_t;
24 /*** global variables defined in .c file *********************************************************/
26 /*** declarations of public functions ************************************************************/
28 /* mcconfig/common.c: */
30 mc_config_t *mc_config_init (const gchar * ini_path, gboolean read_only);
31 void mc_config_deinit (mc_config_t * mc_config);
33 gboolean mc_config_del_key (mc_config_t *, const char *, const gchar *);
34 gboolean mc_config_del_group (mc_config_t *, const char *);
36 gboolean mc_config_has_param (const mc_config_t *, const char *, const gchar *);
37 gboolean mc_config_has_group (mc_config_t *, const char *);
39 gboolean mc_config_read_file (mc_config_t * mc_config, const gchar * ini_path, gboolean read_only,
40 gboolean remove_empty);
42 gboolean mc_config_save_file (mc_config_t * config, GError ** error);
44 gboolean mc_config_save_to_file (mc_config_t * config, const gchar * filename, GError ** error);
47 /* mcconfig/get.c: */
49 gchar **mc_config_get_groups (const mc_config_t * mc_config, gsize * len);
51 gchar **mc_config_get_keys (const mc_config_t * mc_config, const gchar * group, gsize * len);
53 gchar *mc_config_get_string (mc_config_t *, const gchar *, const gchar *, const gchar *);
55 gchar *mc_config_get_string_raw (const mc_config_t *, const gchar *, const gchar *, const gchar *);
57 gboolean mc_config_get_bool (mc_config_t *, const gchar *, const gchar *, gboolean);
59 int mc_config_get_int (mc_config_t *, const gchar *, const gchar *, int);
62 gchar **mc_config_get_string_list (mc_config_t * mc_config, const gchar * group,
63 const gchar * param, gsize * length);
65 gboolean *mc_config_get_bool_list (mc_config_t *, const gchar *, const gchar *, gsize *);
67 int *mc_config_get_int_list (mc_config_t *, const gchar *, const gchar *, gsize *);
70 /* mcconfig/set.c: */
72 void mc_config_set_string_raw (mc_config_t *, const gchar *, const gchar *, const gchar *);
74 void mc_config_set_string_raw_value (mc_config_t *, const gchar *, const gchar *, const gchar *);
76 void mc_config_set_string (const mc_config_t *, const gchar *, const gchar *, const gchar *);
78 void mc_config_set_bool (mc_config_t *, const gchar *, const gchar *, gboolean);
80 void mc_config_set_int (mc_config_t *, const gchar *, const gchar *, int);
82 void
83 mc_config_set_string_list (mc_config_t *, const gchar *,
84 const gchar *, const gchar * const[], gsize);
86 void mc_config_set_bool_list (mc_config_t *, const gchar *, const gchar *, gboolean[], gsize);
88 void mc_config_set_int_list (mc_config_t *, const gchar *, const gchar *, int[], gsize);
91 /* mcconfig/dialog.c: */
93 void mc_config_show_dialog (void);
96 /* mcconfig/paths.c: */
98 void mc_config_init_config_paths (GError ** error);
100 void mc_config_deinit_config_paths (void);
102 gboolean mc_config_migrate_from_old_place (GError ** error, char **msg);
104 const char *mc_config_get_data_path (void);
106 const char *mc_config_get_cache_path (void);
108 const char *mc_config_get_path (void);
110 const char *mc_config_get_home_dir (void);
112 char *mc_config_get_full_path (const char *config_name);
114 vfs_path_t *mc_config_get_full_vpath (const char *config_name);
116 /*** inline functions ****************************************************************************/
118 #endif