]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/cats/bdb_find.c
Eliminate bsd_queue conflict with winnt.h
[bacula/bacula] / bacula / src / cats / bdb_find.c
index d9838b0adf9d1bb4b9b8b19326136a899af0d885..f83b91e7dc4684ef576bfa578d571c12e33825a1 100644 (file)
@@ -18,7 +18,7 @@
  */
 
 /*
-   Copyright (C) 2001, 2002 Kern Sibbald and John Walker
+   Copyright (C) 2001-2003 Kern Sibbald and John Walker
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
@@ -49,7 +49,6 @@
 #ifdef HAVE_BACULA_DB
 
 /* Forward referenced functions */
-int db_find_job_start_time(B_DB *mdb, JOB_DBR *jr, char *stime);
 
 /* -----------------------------------------------------------------------
  *
@@ -66,7 +65,7 @@ int db_find_job_start_time(B_DB *mdb, JOB_DBR *jr, char *stime);
  * Returns: 0 on failure
  *         1 on success, jr unchanged, but stime set
  */
-int db_find_job_start_time(B_DB *mdb, JOB_DBR *jr, char *stime)
+int db_find_job_start_time(JCR *jcr, B_DB *mdb, JOB_DBR *jr, POOLMEM **stime)
 {
    char cmd[MAXSTRING], Name[MAX_NAME_LENGTH], StartTime[MAXSTRING];
    int Type, Level;
@@ -76,8 +75,8 @@ int db_find_job_start_time(B_DB *mdb, JOB_DBR *jr, char *stime)
    int found;
    long addr;
 
-   strcpy(stime, "0000-00-00 00:00:00");   /* default */
    db_lock(mdb);
+   pm_strcpy(stime, "0000-00-00 00:00:00");   /* default */
    if (!bdb_open_jobs_file(mdb)) {
       db_unlock(mdb);
       return 0;
@@ -124,7 +123,7 @@ StartTime=%100s", &JobId, Name, cType, cLevel, StartTime) == 5) {
            /* Reset for next read */
            fseek(mdb->jobfd, addr, SEEK_SET);
            if (found) {
-              strcpy(stime, StartTime);
+              pm_strcpy(stime, StartTime);
               stat = 1;              /* Got a candidate */
                Dmsg5(200, "Got candidate JobId=%d Type=%c Level=%c Name=%s StartTime=%s\n",
                  JobId, Type, Level, Name, StartTime);
@@ -142,10 +141,13 @@ StartTime=%100s", &JobId, Name, cType, cLevel, StartTime) == 5) {
  *
  * Find a Volume for a given PoolId, MediaType, and VolStatus
  *
+ *   Note! this does not correctly implement InChanger.          
+ *
  * Returns: 0 on failure
  *         numrows on success
- */
-int db_find_next_volume(B_DB *mdb, int item, MEDIA_DBR *mr)
+ */    
+int
+db_find_next_volume(JCR *jcr, B_DB *mdb, int item, bool InChanger, MEDIA_DBR *mr) 
 {
    MEDIA_DBR omr;
    int stat = 0;
@@ -177,7 +179,9 @@ int db_find_next_volume(B_DB *mdb, int item, MEDIA_DBR *mr)
    return stat;                
 }
 
-int db_find_last_jobid(B_DB *mdb, JOB_DBR *jr) { return 0; }
+int
+db_find_last_jobid(JCR *jcr, B_DB *mdb, char *Name, JOB_DBR *jr)
+{ return 0; }
 
 
 #endif /* HAVE_BACULA_DB */