firm_init_options() is now a separate function that reads the firm.ini and might...
authorMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Thu, 5 Oct 2006 13:08:13 +0000 (13:08 +0000)
committerMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Thu, 5 Oct 2006 13:08:13 +0000 (13:08 +0000)
This is NOT anymore done in init_firm()

[r8315]

ir/common/firm.c
ir/common/firm.h

index f3809c6..34417e2 100644 (file)
 
 #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)
@@ -77,8 +81,8 @@ 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 */
@@ -129,11 +133,6 @@ init_firm(const firm_parameter_t *param)
   /* 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) {
index 4e945fe..f3cc21a 100644 (file)
@@ -198,31 +198,6 @@ struct _firm_parameter_t {
    * 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;
@@ -262,6 +237,13 @@ void free_firm(void);
  */
 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