com_ff(): Depreciate "n-" syntax.
[paraslash.git] / lsu.h
diff --git a/lsu.h b/lsu.h
index baba14fd7fde37a54d781b3663e336a140dc9f9b..6141dfcabd408539fa82e58e664b02f9ec0fae74 100644 (file)
--- a/lsu.h
+++ b/lsu.h
@@ -5,3 +5,31 @@ int lsu_com_help(bool long_help, const struct lls_parse_result *lpr,
                const struct lls_suite *suite,
                const char *(*aux_info_cb)(unsigned cmd_num, bool verbose),
                char **result, unsigned *num_chars);
                const struct lls_suite *suite,
                const char *(*aux_info_cb)(unsigned cmd_num, bool verbose),
                char **result, unsigned *num_chars);
+
+/** Flags for \ref lsu_merge_config_file_options(). */
+enum lsu_merge_cf_flags {
+       /**
+        * Whether the options specified in the configuration file should
+        * override the currently effective options. At application startup
+        * this is usually unset so that command line options take precedence
+        * over config file options. However, if the application supports
+        * re-reading the configuration, it can make sense to enable this flag.
+        */
+       MCF_OVERRIDE = 1,
+       /**
+        * After the two lopsub parse results have been merged, the merged
+        * parse result usually becomes the effective configuration and the
+        * parse result which corresponds to the former effective options is no
+        * longer needed. Therefore \ref lsu_merge_config_file_options() frees
+        * this former parse result by default. This flag instructs the
+        * function to keep it. This is mostly useful if the application
+        * supports re-reading the config file so that the parse result which
+        * corresponds to the command line options is kept for future calls to
+        * \ref lsu_merge_config_file_options().
+        */
+       MCF_DONT_FREE = 2,
+};
+
+int lsu_merge_config_file_options(const char *path, const char *dflt,
+               struct lls_parse_result **lpr, const struct lls_command *cmd,
+               const struct lls_suite *suite, unsigned flags);