mcconfig.h 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. #ifndef MC_CONFIG_H
  2. #define MC_CONFIG_H
  3. /*** typedefs(not structures) and defined constants ********************/
  4. #define CONFIG_APP_SECTION "Midnight-Commander"
  5. /*** enums *************************************************************/
  6. /*** structures declarations (and typedefs of structures)***************/
  7. typedef struct mc_config_struct {
  8. GKeyFile *handle;
  9. gchar *ini_path;
  10. } mc_config_t;
  11. /*** global variables defined in .c file *******************************/
  12. extern mc_config_t *mc_main_config;
  13. extern mc_config_t *mc_panels_config;
  14. /*** declarations of public functions **********************************/
  15. /* mcconfig/common.c: */
  16. mc_config_t *mc_config_init (const gchar *);
  17. void mc_config_deinit (mc_config_t *);
  18. gboolean mc_config_del_param (mc_config_t *, const char *, const gchar *);
  19. gboolean mc_config_del_group (mc_config_t *, const char *);
  20. gboolean mc_config_has_param (mc_config_t *, const char *, const gchar *);
  21. gboolean mc_config_has_group (mc_config_t *, const char *);
  22. gboolean mc_config_read_file (mc_config_t *, const gchar *);
  23. gboolean mc_config_save_file (mc_config_t * config, GError **error);
  24. gboolean mc_config_save_to_file (mc_config_t * config, const gchar * filename,
  25. GError **error);
  26. /* mcconfig/get.c: */
  27. gchar **mc_config_get_groups (mc_config_t *, gsize *);
  28. gchar **mc_config_get_keys (mc_config_t *, const gchar *, gsize *);
  29. gchar *mc_config_get_string (mc_config_t *, const gchar *, const gchar *, const gchar *);
  30. gchar *mc_config_get_string_raw (mc_config_t *, const gchar *, const gchar *, const gchar *);
  31. gboolean mc_config_get_bool (mc_config_t *, const gchar *, const gchar *, gboolean);
  32. int mc_config_get_int (mc_config_t *, const gchar *, const gchar *, int);
  33. gchar **mc_config_get_string_list (mc_config_t *, const gchar *, const gchar *, gsize *);
  34. gboolean *mc_config_get_bool_list (mc_config_t *, const gchar *, const gchar *, gsize *);
  35. int *mc_config_get_int_list (mc_config_t *, const gchar *, const gchar *, gsize *);
  36. /* mcconfig/set.c: */
  37. void
  38. mc_config_direct_set_string (mc_config_t *, const gchar *, const gchar *, const gchar *);
  39. void
  40. mc_config_set_string (mc_config_t *, const gchar *, const gchar *, const gchar *);
  41. void
  42. mc_config_set_bool (mc_config_t *, const gchar *, const gchar *, gboolean);
  43. void mc_config_set_int (mc_config_t *, const gchar *, const gchar *, int);
  44. void
  45. mc_config_set_string_list (mc_config_t *, const gchar *,
  46. const gchar *, const gchar * const[], gsize);
  47. void
  48. mc_config_set_bool_list (mc_config_t *, const gchar *, const gchar *, gboolean[], gsize);
  49. void
  50. mc_config_set_int_list (mc_config_t *, const gchar *, const gchar *, int[], gsize);
  51. /* mcconfig/dialog.c: */
  52. void mc_config_show_dialog (void);
  53. #endif