src/stored/parse_bsr.c
static bool add_restore_volume(JCR *jcr, VOL_LIST *vol, bool add_to_read_list)
{
   VOL_LIST *next = jcr->VolList;

   if (add_to_read_list) {
      /* Add volume to volume manager's read list */
      add_read_volume(jcr, vol->VolumeName);
   }

   if (!next) {                       /* list empty ? */
      jcr->VolList = vol;             /* yes, add volume */
   } else {
      /* Loop through all but last */
      for ( ; next->next; next=next->next) {
         if (strcmp(vol->VolumeName, next->VolumeName) == 0) {
            /* Save smallest start file */
            if (vol->start_file < next->start_file) {
               next->start_file = vol->start_file;
            }
            return false;              /* already in list */
         }
      }
      /* Check last volume in list */
      if (strcmp(vol->VolumeName, next->VolumeName) == 0) {
         if (vol->start_file < next->start_file) {
            next->start_file = vol->start_file;
         }
         return false;                /* already in list */
      }
      next->next = vol;               /* add volume */
   }
   return true;
}
/*
 * Add current volume to end of list, only if the Volume
 * is not already in the list.
 *
 *   returns: 1 if volume added
 *            0 if volume already in list
 */
Add current volume to end of list, only if the Volume
is not already in the list.

1 if volume added
0 if volume already in list
Add current volume to end of list only if the Volume is not already in the list . 1 if volume added 0 if volume already in list
static bool add_restore_volume(JCR *jcr, VOL_LIST *vol, bool add_to_read_list)
{
   VOL_LIST *next = jcr->VolList;
   if (add_to_read_list) {
      add_read_volume(jcr, vol->VolumeName);
   }
   if (!next) {                       
      jcr->VolList = vol;             
   } else {
      for ( ; next->next; next=next->next) {
         if (strcmp(vol->VolumeName, next->VolumeName) == 0) {
            if (vol->start_file < next->start_file) {
               next->start_file = vol->start_file;
            }
            return false;              
         }
      }
      if (strcmp(vol->VolumeName, next->VolumeName) == 0) {
         if (vol->start_file < next->start_file) {
            next->start_file = vol->start_file;
         }
         return false;                
      }
      next->next = vol;               
   }
   return true;
}
static bool add_restore_volume ( JCR * jcr , VOL_LIST * vol , bool add_to_read_list ) { VOL_LIST * next = jcr -> VolList ; if ( add_to_read_list ) { add_read_volume ( jcr , vol -> VolumeName ) ; } if ( ! next ) { jcr -> VolList = vol ; } else { for ( ; next -> next ; next = next -> next ) { if ( strcmp ( vol -> VolumeName , next -> VolumeName ) == 0 ) { if ( vol -> start_file < next -> start_file ) { next -> start_file = vol -> start_file ; } return false ; } } if ( strcmp ( vol -> VolumeName , next -> VolumeName ) == 0 ) { if ( vol -> start_file < next -> start_file ) { next -> start_file = vol -> start_file ; } return false ; } next -> next = vol ; } return true ; }
Add current volume to end of list, only if the Volume
 is not already in the list.
Add current volume to end of list only if the Volume is not already in the list .
/* Add volume to volume manager's read list */ /* list empty ? */ /* yes, add volume */ /* Loop through all but last */ /* Save smallest start file */ /* already in list */ /* Check last volume in list */ /* already in list */ /* add volume */