]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/cats/cats.h
Fix get_basename() -- rewrite
[bacula/bacula] / bacula / src / cats / cats.h
index 6105fa2b67dd8671cdfe753b53974b34a7844c81..b61d748c1e2493def02707506cf9789dc8d7e90e 100644 (file)
@@ -1,7 +1,7 @@
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2000-2011 Free Software Foundation Europe e.V.
+   Copyright (C) 2000-2012 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.
@@ -213,6 +213,7 @@ struct FILE_DBR {
    DBId_t FilenameId;
    DBId_t PathId;
    JobId_t  MarkId;
+   uint32_t DeltaSeq;
    char LStat[256];
    char Digest[BASE64_SIZE(CRYPTO_DIGEST_MAX_SIZE)];
    int DigestType;                    /* NO_SIG/MD5_SIG/SHA1_SIG */
@@ -281,7 +282,13 @@ public:
 
 
 /* Media record -- same as the database */
-struct MEDIA_DBR {
+class MEDIA_DBR {
+public:
+   MEDIA_DBR() { memset(this, 0, sizeof(MEDIA_DBR)); };
+   ~MEDIA_DBR() {  };
+   void clear() { memset(this, 0, sizeof(MEDIA_DBR)); };
+   void copy(MEDIA_DBR *omr) { memcpy(this, omr, sizeof(MEDIA_DBR)); };
+
    DBId_t MediaId;                    /* Unique volume id */
    char VolumeName[MAX_NAME_LENGTH];  /* Volume name */
    char MediaType[MAX_NAME_LENGTH];   /* Media type */
@@ -370,9 +377,16 @@ struct FILESET_DBR {
 };
 
 /* Call back context for getting a 32/64 bit value from the database */
-struct db_int64_ctx {
+class db_int64_ctx {
+public:
    int64_t value;                     /* value returned */
    int count;                         /* number of values seen */
+
+   db_int64_ctx() : value(0), count(0) {};
+   ~db_int64_ctx() {};
+private:
+   db_int64_ctx(const db_int64_ctx&);            /* prohibit pass by value */
+   db_int64_ctx &operator=(const db_int64_ctx&); /* prohibit class assignment */
 };
 
 /* Call back context for getting a list of comma separated strings from the
@@ -430,7 +444,7 @@ typedef int (DB_RESULT_HANDLER)(void *, int, char **);
 #define db_unlock(mdb) mdb->_db_unlock(__FILE__, __LINE__)
 
 /* Current database version number for all drivers */
-#define BDB_VERSION 13
+#define BDB_VERSION 14
 
 class B_DB: public SMARTALLOC {
 protected:
@@ -450,6 +464,7 @@ protected:
    char *m_db_password;                   /* database password */
    int m_db_port;                         /* port for host name address */
    bool m_disabled_batch_insert;          /* explicitly disabled batch insert mode ? */
+   bool m_dedicated;                      /* is this connection dedicated? */
 
 public:
    POOLMEM *errmsg;                       /* nicely edited error message */
@@ -506,7 +521,7 @@ public:
 };
 
 /* sql_query Query Flags */
-#define QF_STORE_RESULT        0x01
+#define QF_STORE_RESULT 0x01
 
 /* Use for better error location printing */
 #define UPDATE_DB(jcr, db, cmd) UpdateDB(__FILE__, __LINE__, jcr, db, cmd)
@@ -558,6 +573,7 @@ public:
  * Some functions exported by sql.c for use within the cats directory.
  */
 int list_result(void *vctx, int cols, char **row);
+int list_result(JCR *jcr, B_DB *mdb, DB_LIST_HANDLER *send, void *ctx, e_list_type type);
 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);