]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/cats/cats.h
This commit was manufactured by cvs2svn to create tag
[bacula/bacula] / bacula / src / cats / cats.h
index bcbffd527679d01f153f5db9bf15c24d516ed87f..069d9257f72e3308f6526ec601dc2f2a2c3227e0 100644 (file)
  *
  *    Version $Id$
  */
-
 /*
    Copyright (C) 2000-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
-   Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-   MA 02111-1307, USA.
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
+   the file LICENSE for additional details.
 
  */
 
@@ -73,7 +67,7 @@ typedef int (DB_RESULT_HANDLER)(void *, int, char **);
 
 #ifdef HAVE_SQLITE
 
-#define BDB_VERSION 8
+#define BDB_VERSION 9
 
 #include <sqlite.h>
 
@@ -99,7 +93,7 @@ typedef struct s_sql_field {
  * subroutines.
  *                    S Q L I T E
  */
-typedef struct s_db {
+struct B_DB {
    BQUEUE bq;                         /* queue control */
    brwlock_t lock;                    /* transaction lock */
    struct sqlite *db;
@@ -135,7 +129,7 @@ typedef struct s_db {
    POOLMEM *esc_name;                 /* Escaped file/path name */
    int fnl;                           /* file name length */
    int pnl;                           /* path name length */
-} B_DB;
+};
 
 
 /*
@@ -181,7 +175,7 @@ SQL_FIELD *my_sqlite_fetch_field(B_DB *mdb);
 #ifdef HAVE_SQLITE3
 
 
-#define BDB_VERSION 8
+#define BDB_VERSION 9
 
 #include <sqlite3.h>
 
@@ -207,7 +201,7 @@ typedef struct s_sql_field {
  * subroutines.
  *                    S Q L I T E
  */
-typedef struct s_db {
+struct B_DB {
    BQUEUE bq;                         /* queue control */
    brwlock_t lock;                    /* transaction lock */
    struct sqlite3 *db;
@@ -243,7 +237,7 @@ typedef struct s_db {
    POOLMEM *esc_name;                 /* Escaped file/path name */
    int fnl;                           /* file name length */
    int pnl;                           /* path name length */
-} B_DB;
+};
 
 /*
  * Conversion of sqlite 2 names to sqlite3
@@ -296,7 +290,7 @@ SQL_FIELD *my_sqlite_fetch_field(B_DB *mdb);
 
 #ifdef HAVE_MYSQL
 
-#define BDB_VERSION 8
+#define BDB_VERSION 9
 
 #include <mysql.h>
 
@@ -307,7 +301,7 @@ SQL_FIELD *my_sqlite_fetch_field(B_DB *mdb);
  *
  *                     M Y S Q L
  */
-typedef struct s_db {
+struct B_DB {
    BQUEUE bq;                         /* queue control */
    brwlock_t lock;                    /* transaction lock */
    MYSQL mysql;
@@ -335,7 +329,7 @@ typedef struct s_db {
    POOLMEM *esc_name;                 /* Escaped file/path name */
    int fnl;                           /* file name length */
    int pnl;                           /* path name length */
-} B_DB;
+};
 
 #define DB_STATUS int
 
@@ -360,20 +354,20 @@ typedef struct s_db {
 
 #ifdef HAVE_POSTGRESQL
 
-#define BDB_VERSION 8
+#define BDB_VERSION 9
 
 #include <libpq-fe.h>
 
 /* TEMP: the following is taken from select OID, typname from pg_type; */
-#define IS_NUM(x)             ((x) == 20 || (x) == 21 || (x) == 23 || (x) == 700 || (x) == 701)
-#define IS_NOT_NULL(x)        ((x) == 1)
+#define IS_NUM(x)        ((x) == 20 || (x) == 21 || (x) == 23 || (x) == 700 || (x) == 701)
+#define IS_NOT_NULL(x)   ((x) == 1)
 
 typedef char **POSTGRESQL_ROW;
 typedef struct pg_field {
-        char         *name;
-        int           max_length;
-        unsigned int  type;
-        unsigned int  flags;       // 1 == not null
+   char         *name;
+   int           max_length;
+   unsigned int  type;
+   unsigned int  flags;       // 1 == not null
 } POSTGRESQL_FIELD;
 
 
@@ -384,7 +378,7 @@ typedef struct pg_field {
  *
  *                     P O S T G R E S Q L
  */
-typedef struct s_db {
+struct B_DB {
    BQUEUE bq;                         /* queue control */
    brwlock_t lock;                    /* transaction lock */
    PGconn *db;
@@ -418,7 +412,7 @@ typedef struct s_db {
    POOLMEM *esc_name;             /* Escaped file/path name */
    int fnl;                       /* file name length */
    int pnl;                       /* path name length */
-} B_DB;
+};     
 
 void               my_postgresql_free_result(B_DB *mdb);
 POSTGRESQL_ROW     my_postgresql_fetch_row  (B_DB *mdb);
@@ -470,7 +464,7 @@ struct s_control {
 /* This is the REAL definition for using the
  *  Bacula internal DB
  */
-typedef struct s_db {
+struct B_DB {
    BQUEUE bq;                         /* queue control */
 /* pthread_mutex_t mutex;  */         /* single thread lock */
    brwlock_t lock;                    /* transaction lock */
@@ -489,7 +483,7 @@ typedef struct s_db {
    POOLMEM *cached_path;
    int cached_path_len;               /* length of cached path */
    uint32_t cached_path_id;
-} B_DB;
+};
 
 #endif /* HAVE_SQLITE3 */
 #endif /* HAVE_MYSQL */
@@ -507,9 +501,9 @@ typedef struct s_db {
 
 /* This is a "dummy" definition for use outside of sql.c
  */
-typedef struct s_db {
+struct B_DB {
    int dummy;                         /* for SunOS compiler */
-} B_DB;
+};     
 
 #endif /*  __SQL_C */
 
@@ -566,6 +560,7 @@ struct JOB_DBR {
    char cStartTime[MAX_TIME_LENGTH];
    char cEndTime[MAX_TIME_LENGTH];
    /* Extra stuff not in DB */
+   int limit;                         /* limit records to display */
    faddr_t rec_addr;
 };
 
@@ -583,6 +578,8 @@ 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 Stripe;                   /* RAIT strip number */
 };
 
 
@@ -597,6 +594,8 @@ struct VOL_PARAMS {
    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 Stripe;                   /* RAIT strip number */
 };
 
 
@@ -615,6 +614,8 @@ struct ATTR_DBR {
    DBId_t PathId;
    DBId_t FilenameId;
    FileId_t FileId;
+   char *Sig;
+   int SigType;
 };
 
 
@@ -676,8 +677,10 @@ class STORAGE_DBR {
 public:
    DBId_t StorageId;
    char Name[MAX_NAME_LENGTH];        /* Device name */
-   DBId_t MediaTypeId;                /* MediaType */
    int AutoChanger;                   /* Set if autochanger */
+
+   /* Not in database */
+   bool created;                      /* set if created by db_create ... */
 };
 
 class MEDIATYPE_DBR {
@@ -718,6 +721,7 @@ struct MEDIA_DBR {
    int32_t  Recycle;                  /* recycle yes/no */
    int32_t  Slot;                     /* slot in changer */
    int32_t  InChanger;                /* Volume currently in changer */
+   DBId_t   StorageId;                /* Storage record Id */
    uint32_t EndFile;                  /* Last file on volume */
    uint32_t EndBlock;                 /* Last block on volume */
    char VolStatus[20];                /* Volume status */