]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/cats/bdb.c
Correct compile error
[bacula/bacula] / bacula / src / cats / bdb.c
index 3aa57c220da3fcc3ef086cd47e68641d0450d04c..60f57849ea8df70df7fbd1440a102eda22f16e45 100644 (file)
  *
  */
 /*
-   Copyright (C) 2000-2006 Kern Sibbald
+   Bacula® - The Network Backup Solution
 
-   This program is free software; you can redistribute it and/or
-   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.
+   Copyright (C) 2000-2006 Free Software Foundation Europe e.V.
 
-   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 
-   the file LICENSE for additional details.
+   The main author of Bacula is Kern Sibbald, with contributions from
+   many others, a complete list can be found in the file AUTHORS.
+   This program is Free Software; you can redistribute it and/or
+   modify it under the terms of version two of the GNU General Public
+   License as published by the Free Software Foundation and included
+   in the file LICENSE.
 
- */
+   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 Software
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+   02110-1301, USA.
+
+   Bacula® is a registered trademark of John Walker.
+   The licensor of Bacula is the Free Software Foundation Europe
+   (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
+   Switzerland, email:ftf@fsfeurope.org.
+*/
 
 
 /* The following is necessary so that we do not include
 
 uint32_t bacula_db_version = 0;
 
-/* Forward referenced functions */
-
-extern const char *working_directory;
-
 /* List of open databases */
 static BQUEUE db_list = {&db_list, &db_list};
 static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
@@ -63,13 +72,27 @@ static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
 #define DB_CLIENT_FILENAME   "client.db"
 #define DB_FILESET_FILENAME  "fileset.db"
 
+dbid_list::dbid_list() 
+{
+   memset(this, 0, sizeof(dbid_list));
+   max_ids = 1000;
+   DBId = (DBId_t *)malloc(max_ids * sizeof(DBId_t));
+   num_ids = num_seen = tot_ids = 0;
+   PurgedFiles = NULL;
+}
+
+dbid_list::~dbid_list() 
+{ 
+   free(DBId);
+}
+
 static POOLMEM *make_filename(B_DB *mdb, char *name)
 {
    char sep;
    POOLMEM *dbf;
 
    dbf = get_pool_memory(PM_FNAME);
-   if (working_directory[strlen(working_directory)-1] == '/') {
+   if (IsPathSeparator(working_directory[strlen(working_directory)-1])) {
       sep = 0;
    } else {
       sep = '/';
@@ -90,6 +113,15 @@ int bdb_write_control_file(B_DB *mdb)
    return 1;
 }
 
+/*
+ * Retrieve database type
+ */
+const char *
+db_get_type(void)
+{
+   return "Internal";
+}
+
 /*
  * Initialize database data structure. In principal this should
  * never have errors, or it is really fatal.
@@ -110,6 +142,7 @@ db_init_database(JCR *jcr, char const *db_name, char const *db_user, char const
          return mdb;                  /* already open */
       }
    }
+
    Dmsg0(200, "db_open first time\n");
    mdb = (B_DB *)malloc(sizeof(B_DB));
    memset(mdb, 0, sizeof(B_DB));
@@ -270,6 +303,9 @@ void db_close_database(JCR *jcr, B_DB *mdb)
    V(mutex);
 }
 
+void db_thread_cleanup()
+{ }
+
 
 void db_escape_string(char *snew, char *old, int len)
 {