#ifdef WITH_LIBCORE
/* returns the firm root */
-lc_opt_entry_t *firm_opt_get_root(void)
-{
+lc_opt_entry_t *firm_opt_get_root(void) {
static lc_opt_entry_t *grp = NULL;
if(!grp)
grp = lc_opt_get_grp(lc_opt_root_grp(), "firm");
return grp;
}
-#endif
+
+void firm_init_options(const char *arg_prefix, int argc, const char **argv) {
+ /* parse any init files for firm */
+ lc_opts_init("firm", firm_opt_get_root(), arg_prefix, argc, argv);
+}
+#endif /* WITH_LIBCORE */
void
init_firm(const firm_parameter_t *param)
memcpy(&def_params, param, size);
}
- /* initialize firm flags */
- firm_init_flags();
+ /* initialize firm flags */
+ firm_init_flags();
/* initialize all ident stuff */
init_ident(def_params.id_if, 1024);
/* initialize Firm hooks */
/* integrated debugger extension */
firm_init_debugger();
#endif
-
-#ifdef WITH_LIBCORE
- /* parse any init files for firm */
- lc_opts_init("firm", firm_opt_get_root(), def_params.arg_prefix, def_params.argc, def_params.argv);
-#endif
}
void free_firm(void) {
* The debug info that should be used for "builtin" objects.
*/
dbg_info *builtin_dbg;
-
- /**
- * Prefix for the command line options.
- * example: if the option is -ffirm-opt-bla, then the prefix is "-f"
- * @note Only active, if libfirm is compiled with libcore.
- */
- const char *arg_prefix;
-
- /**
- * Number of arguments in the "command line".
- * @note Only active, if libfirm is compiled with libcore.
- */
- int argc;
-
- /**
- * Array of arguments.
- * @note Only active, if libfirm is compiled with libcore.
- */
- const char **argv;
-
- /**
- * Name of ini file which is initially read.
- * @note Only active, if libfirm is compiled with libcore.
- */
- const char *ini_file;
};
typedef struct _firm_parameter_t firm_parameter_t;
*/
void firm_get_version(firm_version_t *version);
+#ifdef WITH_LIBCORE
+/**
+ * Read initializations arguments from the .init file.
+ */
+void firm_init_options(const char *arg_prefix, int argc, const char **argv);
+#endif
+
#ifdef __cplusplus
}
#endif