Cleanup, drop WRITE_SUBTITLE() macro, remove commented out code.
[geeqie.git] / src / rcfile.h
index 5fe9391..8a486e6 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Geeqie
  * (C) 2004 John Ellis
- * Copyright (C) 2008 - 2009 The Geeqie Team
+ * Copyright (C) 2008 - 2012 The Geeqie Team
  *
  * Author: John Ellis
  *
@@ -17,6 +17,7 @@
 
 void write_indent(GString *str, gint indent);
 void write_char_option(GString *str, gint indent, const gchar *label, const gchar *text);
+gboolean read_dummy_option(const gchar *option, const gchar *label, const gchar *message);
 gboolean read_char_option(const gchar *option, const gchar *label, const gchar *value, gchar **text);
 void write_color_option(GString *str, gint indent, gchar *label, GdkColor *color);
 gboolean read_color_option(const gchar *option, const gchar *label, const gchar *value, GdkColor *color);
@@ -38,9 +39,9 @@ gboolean read_bool_option(const gchar *option, const gchar *label, const gchar *
 #define WRITE_CHAR(_source_, _name_) write_char_option(outstr, indent, #_name_, (_source_)._name_)
 #define WRITE_COLOR(_source_, _name_) write_color_option(outstr, indent, #_name_, &(_source_)._name_)
 
+#define WRITE_NL() write_indent(outstr, indent)
 #define WRITE_SEPARATOR() g_string_append(outstr, "\n")
-#define WRITE_SUBTITLE(_title_) g_string_append_printf(outstr, "\n\n<!-- "_title_" -->\n\n")
-#define WRITE_STRING(_str_) do { write_indent(outstr, indent); g_string_append_printf(outstr, _str_); } while (0)
+#define WRITE_STRING(...) g_string_append_printf(outstr, __VA_ARGS__)
 
 #define READ_BOOL(_target_, _name_) read_bool_option(option, #_name_, value, &(_target_)._name_)
 #define READ_INT(_target_, _name_) read_int_option(option, #_name_, value, &(_target_)._name_)
@@ -59,8 +60,7 @@ gboolean read_bool_option(const gchar *option, const gchar *label, const gchar *
 #define READ_CHAR_FULL(_name_, _target_) read_char_option(option, _name_, value, &(_target_))
 #define READ_COLOR_FULL(_name_, _target_) read_color_option(option, _name_, value, &(_target_))
 
-
-
+#define READ_DUMMY(_target_, _name_, _msg_) read_dummy_option(option, #_name_, _msg_)
 
 typedef struct _GQParserFuncData GQParserFuncData;
 typedef struct _GQParserData GQParserData;
@@ -72,8 +72,10 @@ void options_parse_func_pop(GQParserData *parser_data);
 void options_parse_func_set_data(GQParserData *parser_data, gpointer data);
 
 
-gboolean save_options_to(const gchar *utf8_path, ConfOptions *options);
-gboolean load_options_from(const gchar *utf8_path, ConfOptions *options, gboolean startup);
+gboolean save_config_to_file(const gchar *utf8_path, ConfOptions *options);
+
+gboolean load_config_from_buf(const gchar *buf, gsize size, gboolean startup);
+gboolean load_config_from_file(const gchar *utf8_path, gboolean startup);
 
 
 #endif