]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/cats/cats.h
Tweak mutex order for SD
[bacula/bacula] / bacula / src / cats / cats.h
index 8c18ce7f89d50fc5c10c0dc85696e20d121d9d96..8c0d4f90c45129e786595a2c2f06fd2254f98a79 100644 (file)
@@ -1,7 +1,7 @@
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2000-2008 Free Software Foundation Europe e.V.
+   Copyright (C) 2000-2009 Free Software Foundation Europe e.V.
 
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
@@ -87,6 +87,7 @@ typedef int (DB_RESULT_HANDLER)(void *, int, char **);
 
 #if defined(BUILDING_CATS)
 #ifdef HAVE_SQLITE
+#error "SQLite2 is now deprecated, use SQLite3 instead."
 
 #define BDB_VERSION 11
 
@@ -835,7 +836,7 @@ struct JOBMEDIA_DBR {
    uint32_t EndFile;                  /* End file on Volume */
    uint32_t StartBlock;               /* start block on tape */
    uint32_t EndBlock;                 /* last block */
-   uint32_t Copy;                     /* identical copy */
+// uint32_t Copy;                     /* identical copy */
 };
 
 
@@ -866,6 +867,7 @@ struct ATTR_DBR {
    char *attr;                        /* attributes statp */
    uint32_t FileIndex;
    uint32_t Stream;
+   uint32_t FileType;
    JobId_t  JobId;
    DBId_t ClientId;
    DBId_t PathId;
@@ -901,6 +903,7 @@ struct POOL_DBR {
    int32_t AcceptAnyVolume;           /* set to accept any volume sequence */
    int32_t AutoPrune;                 /* set to prune automatically */
    int32_t Recycle;                   /* default Vol recycle flag */
+   uint32_t ActionOnPurge;            /* action on purge, e.g. truncate the disk volume */
    utime_t  VolRetention;             /* retention period in seconds */
    utime_t  VolUseDuration;           /* time in secs volume can be used */
    uint32_t MaxVolJobs;               /* Max Jobs on Volume */
@@ -976,6 +979,7 @@ struct MEDIA_DBR {
    uint64_t VolWriteTime;             /* time spent writing volume */
    utime_t  VolRetention;             /* Volume retention in seconds */
    utime_t  VolUseDuration;           /* time in secs volume can be used */
+   uint32_t ActionOnPurge;            /* action on purge, e.g. truncate the disk volume */
    uint32_t MaxVolJobs;               /* Max Jobs on Volume */
    uint32_t MaxVolFiles;              /* Max files on Volume */
    int32_t  Recycle;                  /* recycle yes/no */
@@ -1044,6 +1048,22 @@ struct db_int64_ctx {
    int count;                         /* number of values seen */
 };
 
+/* Call back context for getting a list of comma separated strings from the
+ * database 
+ */
+class db_list_ctx {
+public:
+   POOLMEM *list;                     /* list */
+   int count;                         /* number of values seen */
+
+   db_list_ctx() { list = get_pool_memory(PM_FNAME); *list = 0; count = 0; }
+   ~db_list_ctx() { free_pool_memory(list); list = NULL; }
+
+private:
+   db_list_ctx(const db_list_ctx&);            /* prohibit pass by value */
+   db_list_ctx &operator=(const db_list_ctx&); /* prohibit class assignment */
+};
+
 
 #include "protos.h"
 #include "jcr.h"
@@ -1052,7 +1072,7 @@ struct db_int64_ctx {
 /*
  * Exported globals from sql.c
  */
-extern int DLL_IMP_EXP db_type;        /* SQL engine type index */
+extern int CATS_IMP_EXP db_type;        /* SQL engine type index */
 
 /*
  * Some functions exported by sql.c for use within the
@@ -1062,6 +1082,7 @@ void list_result(JCR *jcr, B_DB *mdb, DB_LIST_HANDLER *send, void *ctx, e_list_t
 void list_dashes(B_DB *mdb, DB_LIST_HANDLER *send, void *ctx);
 int get_sql_record_max(JCR *jcr, B_DB *mdb);
 bool check_tables_version(JCR *jcr, B_DB *mdb);
+bool db_check_max_connections(JCR *jcr, B_DB *mdb, uint32_t nb);
 void _db_unlock(const char *file, int line, B_DB *mdb);
 void _db_lock(const char *file, int line, B_DB *mdb);
 const char *db_get_type(void);