Previous 15994 Revisions Next

r11971 Thursday 16th June, 2011 at 16:03:11 UTC by Miodrag Milanović
Added handling "automount" feature (no whatsnew)
[src/emu]clifront.c

src/emu/clifront.c
r11970r11971
202202                        if (swinfo!=NULL) {     
203203                           for (software_part *swpart = software_find_part(swinfo, NULL, NULL); swpart != NULL; swpart = software_part_next(swpart))
204204                           {
205                              // loop trough all parts
206                              // search for a device with the right interface                             
207                              const device_image_interface *image = NULL;
208                              for (bool gotone = config.devicelist().first(image); gotone; gotone = image->next(image))
209                              {
210                                 const char *interface = image->image_interface();                                                                 
211                                 if (interface != NULL)
212                                 {                                   
213                                    if (!strcmp(interface, swpart->interface_))
214                                    {                                       
215                                       const char *option = m_options.value(image->brief_instance_name());
216                                       // mount only if not already mounted
217                                       if (strlen(option)==0) {
218                                          astring val;
219                                          astring error;
220                                          val.printf("%s:%s",m_options.software_name(),swpart->name);
221                                          m_options.set_value(image->brief_instance_name(), val.cstr(), OPTION_PRIORITY_CMDLINE, error);
222                                          assert(!error);                                         
205                              const char *mount = software_part_get_feature(swpart, "automount");
206                              if (mount==NULL || strcmp(mount,"no")!=0) {                             
207                                 // loop trough all parts
208                                 // search for a device with the right interface                             
209                                 const device_image_interface *image = NULL;
210                                 for (bool gotone = config.devicelist().first(image); gotone; gotone = image->next(image))
211                                 {
212                                    const char *interface = image->image_interface();                                                                 
213                                    if (interface != NULL)
214                                    {                                   
215                                       if (!strcmp(interface, swpart->interface_))
216                                       {                                       
217                                          const char *option = m_options.value(image->brief_instance_name());
218                                          // mount only if not already mounted
219                                          if (strlen(option)==0) {
220                                             astring val;
221                                             astring error;
222                                             val.printf("%s:%s",m_options.software_name(),swpart->name);
223                                             m_options.set_value(image->brief_instance_name(), val.cstr(), OPTION_PRIORITY_CMDLINE, error);
224                                             assert(!error);                                         
225                                          }
226                                          break;
223227                                       }
224                                       break;
225228                                    }
226229                                 }
227230                              }

Previous 15994 Revisions Next


© 1998-2018 The MESS Team