Previous 199869 Revisions Next

r17633 Tuesday 4th September, 2012 at 13:21:17 UTC by Miodrag Milanović
Made cmd line parameter parsing going into unlimited levels (no whatsnew)
[src/emu]emuopts.c
[src/lib/util]options.c options.h

trunk/src/lib/util/options.h
r17632r17633
187187
188188   // misc
189189   static const char *unadorned(int x = 0) { return s_option_unadorned[MIN(x, MAX_UNADORNED_OPTIONS)]; }
190
190   int options_count();
191191private:
192192   // internal helpers
193193   void reset();
trunk/src/lib/util/options.c
r17632r17633
811811   curentry.set_value(data, priority);
812812   return true;
813813}
814
815//-------------------------------------------------
816//  options_count - take number of existing
817//  number of options in structure
818//-------------------------------------------------
819
820int core_options::options_count()
821{
822   int number = 0;
823   for (entry *curentry = m_entrylist; curentry != NULL; curentry = curentry->next()) number++;
824   return number;
825}
No newline at end of file
trunk/src/emu/emuopts.c
r17632r17633
377377      set_value(name, value, OPTION_PRIORITY_CMDLINE, error_string);
378378   }
379379   result = core_options::parse_command_line(argc, argv, OPTION_PRIORITY_CMDLINE, error_string);
380   update_slot_options();
381   while (add_slot_options(false));
382   add_device_options(true);
383   result = core_options::parse_command_line(argc, argv, OPTION_PRIORITY_CMDLINE, error_string);
380
381   int num = 0;
382   do {
383      num = options_count();
384      update_slot_options();
385      while (add_slot_options(false));
386      add_device_options(false);
387      result = core_options::parse_command_line(argc, argv, OPTION_PRIORITY_CMDLINE, error_string);
388   } while(num != options_count());
389
384390   return result;
385391}
386392
r17632r17633
510516      }
511517      // then add the options
512518      add_device_options(true);
513      update_slot_options();
514      while (add_slot_options(false));
515      add_device_options(true);
519      int num = 0;
520      do {
521         num = options_count();     
522         update_slot_options();
523         while (add_slot_options(false));
524         add_device_options(false);
525      } while(num != options_count());
516526   }
517527}
518528

Previous 199869 Revisions Next


© 1997-2024 The MAME Team