]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/stored/parse_bsr.c
- Require 5 arguments to mtx-changer except list and slots
[bacula/bacula] / bacula / src / stored / parse_bsr.c
index 4aa77a03f1f8bf505322733ed1ce5d678e994019..2b82cb80be4666c084c161824143a1bceecceab2 100755 (executable)
    Copyright (C) 2002-2005 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License as
-   published by the Free Software Foundation; either version 2 of
-   the License, or (at your option) any later version.
+   modify it under the terms of the GNU General Public License
+   version 2 as amended with additional clauses defined in the
+   file LICENSE in the main source directory.
 
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-   General Public License for more details.
-
-   You should have received a copy of the GNU General Public
-   License along with this program; if not, write to the Free
-   MA 02111-1307, USA. 
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
+   the file LICENSE for additional details.
 
  */
 
@@ -417,7 +413,7 @@ static BSR *store_count(LEX *lc, BSR *bsr)
 static BSR *store_jobtype(LEX *lc, BSR *bsr)
 {
    /* *****FIXME****** */
-   Dmsg0(-1, "JobType not yet implemented\n");
+   Pmsg0(-1, "JobType not yet implemented\n");
    return bsr;
 }
 
@@ -425,7 +421,7 @@ static BSR *store_jobtype(LEX *lc, BSR *bsr)
 static BSR *store_joblevel(LEX *lc, BSR *bsr)
 {
    /* *****FIXME****** */
-   Dmsg0(-1, "JobLevel not yet implemented\n");
+   Pmsg0(-1, "JobLevel not yet implemented\n");
    return bsr;
 }
 
@@ -627,7 +623,7 @@ static BSR *store_exclude(LEX *lc, BSR *bsr)
 void dump_volfile(BSR_VOLFILE *volfile)
 {
    if (volfile) {
-      Dmsg2(-1, "VolFile     : %u-%u\n", volfile->sfile, volfile->efile);
+      Pmsg2(-1, "VolFile     : %u-%u\n", volfile->sfile, volfile->efile);
       dump_volfile(volfile->next);
    }
 }
@@ -635,7 +631,7 @@ void dump_volfile(BSR_VOLFILE *volfile)
 void dump_volblock(BSR_VOLBLOCK *volblock)
 {
    if (volblock) {
-      Dmsg2(-1, "VolBlock    : %u-%u\n", volblock->sblock, volblock->eblock);
+      Pmsg2(-1, "VolBlock    : %u-%u\n", volblock->sblock, volblock->eblock);
       dump_volblock(volblock->next);
    }
 }
@@ -645,9 +641,9 @@ void dump_findex(BSR_FINDEX *FileIndex)
 {
    if (FileIndex) {
       if (FileIndex->findex == FileIndex->findex2) {
-         Dmsg1(-1, "FileIndex   : %u\n", FileIndex->findex);
+         Pmsg1(-1, "FileIndex   : %u\n", FileIndex->findex);
       } else {
-         Dmsg2(-1, "FileIndex   : %u-%u\n", FileIndex->findex, FileIndex->findex2);
+         Pmsg2(-1, "FileIndex   : %u-%u\n", FileIndex->findex, FileIndex->findex2);
       }
       dump_findex(FileIndex->next);
    }
@@ -657,9 +653,9 @@ void dump_jobid(BSR_JOBID *jobid)
 {
    if (jobid) {
       if (jobid->JobId == jobid->JobId2) {
-         Dmsg1(-1, "JobId       : %u\n", jobid->JobId);
+         Pmsg1(-1, "JobId       : %u\n", jobid->JobId);
       } else {
-         Dmsg2(-1, "JobId       : %u-%u\n", jobid->JobId, jobid->JobId2);
+         Pmsg2(-1, "JobId       : %u-%u\n", jobid->JobId, jobid->JobId2);
       }
       dump_jobid(jobid->next);
    }
@@ -669,9 +665,9 @@ void dump_sessid(BSR_SESSID *sessid)
 {
    if (sessid) {
       if (sessid->sessid == sessid->sessid2) {
-         Dmsg1(-1, "SessId      : %u\n", sessid->sessid);
+         Pmsg1(-1, "SessId      : %u\n", sessid->sessid);
       } else {
-         Dmsg2(-1, "SessId      : %u-%u\n", sessid->sessid, sessid->sessid2);
+         Pmsg2(-1, "SessId      : %u-%u\n", sessid->sessid, sessid->sessid2);
       }
       dump_sessid(sessid->next);
    }
@@ -680,7 +676,7 @@ void dump_sessid(BSR_SESSID *sessid)
 void dump_volume(BSR_VOLUME *volume)
 {
    if (volume) {
-      Dmsg1(-1, "VolumeName  : %s\n", volume->VolumeName);
+      Pmsg1(-1, "VolumeName  : %s\n", volume->VolumeName);
       dump_volume(volume->next);
    }
 }
@@ -689,7 +685,7 @@ void dump_volume(BSR_VOLUME *volume)
 void dump_client(BSR_CLIENT *client)
 {
    if (client) {
-      Dmsg1(-1, "Client      : %s\n", client->ClientName);
+      Pmsg1(-1, "Client      : %s\n", client->ClientName);
       dump_client(client->next);
    }
 }
@@ -697,7 +693,7 @@ void dump_client(BSR_CLIENT *client)
 void dump_job(BSR_JOB *job)
 {
    if (job) {
-      Dmsg1(-1, "Job          : %s\n", job->Job);
+      Pmsg1(-1, "Job          : %s\n", job->Job);
       dump_job(job->next);
    }
 }
@@ -705,7 +701,7 @@ void dump_job(BSR_JOB *job)
 void dump_sesstime(BSR_SESSTIME *sesstime)
 {
    if (sesstime) {
-      Dmsg1(-1, "SessTime    : %u\n", sesstime->sesstime);
+      Pmsg1(-1, "SessTime    : %u\n", sesstime->sesstime);
       dump_sesstime(sesstime->next);
    }
 }
@@ -719,12 +715,12 @@ void dump_bsr(BSR *bsr, bool recurse)
    int save_debug = debug_level;
    debug_level = 1;
    if (!bsr) {
-      Dmsg0(-1, "BSR is NULL\n");
+      Pmsg0(-1, "BSR is NULL\n");
       debug_level = save_debug;
       return;
    }
-   Dmsg1(-1,    "Next        : 0x%x\n", bsr->next);
-   Dmsg1(-1,    "Root bsr    : 0x%x\n", bsr->root);
+   Pmsg1(-1,    "Next        : 0x%x\n", bsr->next);
+   Pmsg1(-1,    "Root bsr    : 0x%x\n", bsr->root);
    dump_volume(bsr->volume);
    dump_sessid(bsr->sessid);
    dump_sesstime(bsr->sesstime);
@@ -735,18 +731,18 @@ void dump_bsr(BSR *bsr, bool recurse)
    dump_job(bsr->job);
    dump_findex(bsr->FileIndex);
    if (bsr->Slot) {
-      Dmsg1(-1, "Slot        : %u\n", bsr->Slot);
+      Pmsg1(-1, "Slot        : %u\n", bsr->Slot);
    }
    if (bsr->count) {
-      Dmsg1(-1, "count       : %u\n", bsr->count);
-      Dmsg1(-1, "found       : %u\n", bsr->found);
+      Pmsg1(-1, "count       : %u\n", bsr->count);
+      Pmsg1(-1, "found       : %u\n", bsr->found);
    }
 
-   Dmsg1(-1,    "done        : %s\n", bsr->done?"yes":"no");
-   Dmsg1(-1,    "positioning : %d\n", bsr->use_positioning);
-   Dmsg1(-1,    "fast_reject : %d\n", bsr->use_fast_rejection);
+   Pmsg1(-1,    "done        : %s\n", bsr->done?"yes":"no");
+   Pmsg1(-1,    "positioning : %d\n", bsr->use_positioning);
+   Pmsg1(-1,    "fast_reject : %d\n", bsr->use_fast_rejection);
    if (recurse && bsr->next) {
-      Dmsg0(-1, "\n");
+      Pmsg0(-1, "\n");
       dump_bsr(bsr->next, true);
    }
    debug_level = save_debug;
@@ -790,7 +786,7 @@ void free_bsr(BSR *bsr)
 /*****************************************************************
  * Routines for handling volumes
  */
-VOL_LIST *new_vol()
+VOL_LIST *new_restore_volume()
 {
    VOL_LIST *vol;
    vol = (VOL_LIST *)malloc(sizeof(VOL_LIST));
@@ -805,7 +801,7 @@ VOL_LIST *new_vol()
  *   returns: 1 if volume added
  *            0 if volume already in list
  */
-int add_vol(JCR *jcr, VOL_LIST *vol)
+int add_restore_volume(JCR *jcr, VOL_LIST *vol)
 {
    VOL_LIST *next = jcr->VolList;
 
@@ -831,7 +827,7 @@ int add_vol(JCR *jcr, VOL_LIST *vol)
    return 1;
 }
 
-void free_vol_list(JCR *jcr)
+void free_restore_volume_list(JCR *jcr)
 {
    VOL_LIST *next = jcr->VolList;
    VOL_LIST *tmp;
@@ -848,7 +844,7 @@ void free_vol_list(JCR *jcr)
  * Create a list of Volumes (and Slots and Start positions) to be
  *  used in the current restore job.
  */
-void create_vol_list(JCR *jcr)
+void create_restore_volume_list(JCR *jcr)
 {
    char *p, *n;
    VOL_LIST *vol;
@@ -876,11 +872,11 @@ void create_vol_list(JCR *jcr)
          }
          /* Now add volumes for this bsr */
          for (bsrvol = bsr->volume; bsrvol; bsrvol=bsrvol->next) {
-            vol = new_vol();
+            vol = new_restore_volume();
             bstrncpy(vol->VolumeName, bsrvol->VolumeName, sizeof(vol->VolumeName));
             bstrncpy(vol->MediaType,  bsrvol->MediaType,  sizeof(vol->MediaType));
             vol->start_file = sfile;
-            if (add_vol(jcr, vol)) {
+            if (add_restore_volume(jcr, vol)) {
                jcr->NumVolumes++;
                Dmsg2(400, "Added volume=%s mediatype=%s\n", vol->VolumeName,
                   vol->MediaType);
@@ -898,10 +894,10 @@ void create_vol_list(JCR *jcr)
          if (n) {
             *n++ = 0;                    /* Terminate name */
          }
-         vol = new_vol();
+         vol = new_restore_volume();
          bstrncpy(vol->VolumeName, p, sizeof(vol->VolumeName));
          bstrncpy(vol->MediaType, jcr->dcr->media_type, sizeof(vol->MediaType));
-         if (add_vol(jcr, vol)) {
+         if (add_restore_volume(jcr, vol)) {
             jcr->NumVolumes++;
          } else {
             free((char *)vol);