]> git.sur5r.net Git - bacula/bacula/commitdiff
Make mark run *MUCH* faster in restore tree + update copyright on changed files
authorKern Sibbald <kern@sibbald.com>
Tue, 13 Jan 2004 14:09:41 +0000 (14:09 +0000)
committerKern Sibbald <kern@sibbald.com>
Tue, 13 Jan 2004 14:09:41 +0000 (14:09 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1010 91ce42f0-d328-0410-95d8-f526ca767f89

55 files changed:
bacula/src/baconfig.h
bacula/src/bacula.h
bacula/src/c
bacula/src/cats/cats.h
bacula/src/cats/mysql.c
bacula/src/cats/postgresql.c
bacula/src/cats/sql.c
bacula/src/cats/sql_find.c
bacula/src/cats/sql_update.c
bacula/src/cats/sqlite.c
bacula/src/cl
bacula/src/console/conio.c
bacula/src/dird/dird.c
bacula/src/dird/dird_conf.c
bacula/src/dird/job.c
bacula/src/dird/msgchan.c
bacula/src/dird/recycle.c
bacula/src/dird/scheduler.c
bacula/src/dird/sql_cmds.c
bacula/src/dird/ua_cmds.c
bacula/src/dird/ua_purge.c
bacula/src/dird/ua_restore.c
bacula/src/dird/ua_tree.c
bacula/src/filed/filed.c
bacula/src/filed/job.c
bacula/src/filed/win32/winres.rc
bacula/src/findlib/attribs.c
bacula/src/findlib/create_file.c
bacula/src/findlib/protos.h
bacula/src/host.h.in
bacula/src/jcr.h
bacula/src/lib/bsock.h
bacula/src/lib/btime.c
bacula/src/lib/dlist.c
bacula/src/lib/tree.h
bacula/src/lib/var.c
bacula/src/lib/watchdog.c
bacula/src/lib/watchdog.h
bacula/src/stored/askdir.c
bacula/src/stored/bcopy.c
bacula/src/stored/bextract.c
bacula/src/stored/block.c
bacula/src/stored/bls.c
bacula/src/stored/bscan.c
bacula/src/stored/btape.c
bacula/src/stored/dev.c
bacula/src/stored/dev.h
bacula/src/stored/device.c
bacula/src/stored/dircmd.c
bacula/src/stored/mount.c
bacula/src/stored/status.c
bacula/src/stored/stored.c
bacula/src/stored/stored_conf.c
bacula/src/stored/stored_conf.h
bacula/src/tools/bsmtp.c

index b9c6cd9719aa991451e76117d4f956ca2cb13ca0..95205cfb5cf43b21100b22ae0a509af225995416 100644 (file)
@@ -5,7 +5,7 @@
  *   Version $Id$
  */
 /*
-   Copyright (C) 2000, 2001, 2002 Kern Sibbald and John Walker
+   Copyright (C) 2000-2004 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
index 80d6eba43c2862ffefffc51e35db1dd19ae38ea2..c1ab1928664483631c6c9fe3a19cf68634ed5b8a 100644 (file)
@@ -5,7 +5,7 @@
  */
 
 /*
-   Copyright (C) 2000, 2001, 2002 Kern Sibbald and John Walker
+   Copyright (C) 2000-2004 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
index d57a7ad9ed30a37bb50332f5dfc7d2bec1fa7f0a..c910dbd8ec2c725fe43c84290b0db4bdda481b00 100644 (file)
@@ -1,5 +1,5 @@
 /*
-   Copyright (C) 2000-2003 Kern Sibbald and John Walker
+   Copyright (C) 2000-2004 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
index 21a9ad199efc1cc1ad142a1349f9f1b00cfcf0f7..10fd0c5f45223dc0fd75681d87362e0e2ed92303 100644 (file)
@@ -15,7 +15,7 @@
  */
 
 /*
-   Copyright (C) 2000-2003 Kern Sibbald and John Walker
+   Copyright (C) 2000-2004 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
@@ -57,71 +57,71 @@ struct sqlite {
    char dummy;
 };
 
-#define IS_NUM(x)             ((x) == 1)
-#define IS_NOT_NULL(x)        ((x) == 1)
+#define IS_NUM(x)            ((x) == 1)
+#define IS_NOT_NULL(x)       ((x) == 1)
 
 typedef struct s_sql_field {
-   char *name;                        /* name of column */
-   int length;                        /* length */
-   int max_length;                    /* max length */
-   uint32_t type;                     /* type */
-   uint32_t flags;                    /* flags */
+   char *name;                       /* name of column */
+   int length;                       /* length */
+   int max_length;                   /* max length */
+   uint32_t type;                    /* type */
+   uint32_t flags;                   /* flags */
 } SQL_FIELD;
 
 /*
  * This is the "real" definition that should only be
  * used inside sql.c and associated database interface
  * subroutines.
- *                    S Q L I T E
+ *                   S Q L I T E
  */
 typedef struct s_db {
-   BQUEUE bq;                         /* queue control */
-   brwlock_t lock;                    /* transaction lock */
+   BQUEUE bq;                        /* queue control */
+   brwlock_t lock;                   /* transaction lock */
    struct sqlite *db;
    char **result;
    int status;
-   int nrow;                          /* nrow returned from sqlite */
-   int ncolumn;                       /* ncolum returned from sqlite */
-   int num_rows;                      /* used by code */
-   int row;                           /* seek row */
-   int have_insert_id;                /* do not have insert id */
-   int fields_defined;                /* set when fields defined */
-   int field;                         /* seek field */
-   SQL_FIELD **fields;                /* defined fields */
+   int nrow;                         /* nrow returned from sqlite */
+   int ncolumn;                      /* ncolum returned from sqlite */
+   int num_rows;                     /* used by code */
+   int row;                          /* seek row */
+   int have_insert_id;               /* do not have insert id */
+   int fields_defined;               /* set when fields defined */
+   int field;                        /* seek field */
+   SQL_FIELD **fields;               /* defined fields */
    int ref_count;
    char *db_name;
    char *db_user;
-   char *db_address;                  /* host name address */
-   char *db_socket;                   /* socket for local access */
+   char *db_address;                 /* host name address */
+   char *db_socket;                  /* socket for local access */
    char *db_password;
-   int  db_port;                      /* port for host name address */
+   int db_port;                      /* port for host name address */
    int connected;
-   char *sqlite_errmsg;               /* error message returned by sqlite */
-   POOLMEM *errmsg;                   /* nicely edited error message */
-   POOLMEM *cmd;                      /* SQL command string */
-   POOLMEM *cached_path;              /* cached path name */
-   int cached_path_len;               /* length of cached path */
-   uint32_t cached_path_id;           /* cached path id */
-   int transaction;                   /* transaction started */
-   int changes;                       /* changes during transaction */
-   POOLMEM *fname;                    /* Filename only */
-   POOLMEM *path;                     /* Path only */
-   POOLMEM *esc_name;                 /* Escaped file/path name */
-   int fnl;                           /* file name length */
-   int pnl;                           /* path name length */
+   char *sqlite_errmsg;              /* error message returned by sqlite */
+   POOLMEM *errmsg;                  /* nicely edited error message */
+   POOLMEM *cmd;                     /* SQL command string */
+   POOLMEM *cached_path;             /* cached path name */
+   int cached_path_len;              /* length of cached path */
+   uint32_t cached_path_id;          /* cached path id */
+   int transaction;                  /* transaction started */
+   int changes;                      /* changes during transaction */
+   POOLMEM *fname;                   /* Filename only */
+   POOLMEM *path;                    /* Path only */
+   POOLMEM *esc_name;                /* Escaped file/path name */
+   int fnl;                          /* file name length */
+   int pnl;                          /* path name length */
 } B_DB;
 
 
 /* 
  * "Generic" names for easier conversion   
  *
- *                    S Q L I T E
+ *                   S Q L I T E
  */
 #define sql_store_result(x)   (x)->result
 #define sql_free_result(x)    my_sqlite_free_table(x)
 #define sql_fetch_row(x)      my_sqlite_fetch_row(x)
 #define sql_query(x, y)       my_sqlite_query((x), (y))
-#define sql_close(x)          sqlite_close((x)->db)  
+#define sql_close(x)         sqlite_close((x)->db)  
 #define sql_strerror(x)       (x)->sqlite_errmsg?(x)->sqlite_errmsg:"unknown"
 #define sql_num_rows(x)       (x)->nrow
 #define sql_data_seek(x, i)   (x)->row = (i)
@@ -130,15 +130,15 @@ typedef struct s_db {
 #define sql_field_seek(x, y)  my_sqlite_field_seek((x), (y))
 #define sql_fetch_field(x)    my_sqlite_fetch_field(x)
 #define sql_num_fields(x)     ((x)->ncolumn)
-#define SQL_ROW               char**   
+#define SQL_ROW              char**   
 
 
 
 /* In cats/sqlite.c */
-void       my_sqlite_free_table(B_DB *mdb);
+void      my_sqlite_free_table(B_DB *mdb);
 SQL_ROW    my_sqlite_fetch_row(B_DB *mdb);
-int        my_sqlite_query(B_DB *mdb, char *cmd);
-void       my_sqlite_field_seek(B_DB *mdb, int field);
+int       my_sqlite_query(B_DB *mdb, char *cmd);
+void      my_sqlite_field_seek(B_DB *mdb, int field);
 SQL_FIELD *my_sqlite_fetch_field(B_DB *mdb);
 
 
@@ -155,11 +155,11 @@ SQL_FIELD *my_sqlite_fetch_field(B_DB *mdb);
  * used inside sql.c and associated database interface
  * subroutines.
  *
- *                     M Y S Q L
+ *                    M Y S Q L
  */
 typedef struct s_db {
-   BQUEUE bq;                         /* queue control */
-   brwlock_t lock;                    /* transaction lock */
+   BQUEUE bq;                        /* queue control */
+   brwlock_t lock;                   /* transaction lock */
    MYSQL mysql;
    MYSQL *db;
    MYSQL_RES *result;
@@ -169,22 +169,22 @@ typedef struct s_db {
    char *db_name;
    char *db_user;
    char *db_password;
-   char *db_address;                  /* host address */
-   char *db_socket;                   /* socket for local access */
-   int db_port;                       /* port of host address */
-   int have_insert_id;                /* do have insert_id() */
+   char *db_address;                 /* host address */
+   char *db_socket;                  /* socket for local access */
+   int db_port;                      /* port of host address */
+   int have_insert_id;               /* do have insert_id() */
    int connected;
-   POOLMEM *errmsg;                   /* nicely edited error message */
-   POOLMEM *cmd;                      /* SQL command string */
+   POOLMEM *errmsg;                  /* nicely edited error message */
+   POOLMEM *cmd;                     /* SQL command string */
    POOLMEM *cached_path;
-   int cached_path_len;               /* length of cached path */
+   int cached_path_len;              /* length of cached path */
    uint32_t cached_path_id;
-   int changes;                       /* changes made to db */
-   POOLMEM *fname;                    /* Filename only */
-   POOLMEM *path;                     /* Path only */
-   POOLMEM *esc_name;                 /* Escaped file/path name */
-   int fnl;                           /* file name length */
-   int pnl;                           /* path name length */
+   int changes;                      /* changes made to db */
+   POOLMEM *fname;                   /* Filename only */
+   POOLMEM *path;                    /* Path only */
+   POOLMEM *esc_name;                /* Escaped file/path name */
+   int fnl;                          /* file name length */
+   int pnl;                          /* path name length */
 } B_DB;
 
 #define DB_STATUS int
@@ -194,7 +194,7 @@ typedef struct s_db {
 #define sql_free_result(x)    mysql_free_result((x)->result)
 #define sql_fetch_row(x)      mysql_fetch_row((x)->result)
 #define sql_query(x, y)       mysql_query((x)->db, (y))
-#define sql_close(x)          mysql_close((x)->db)  
+#define sql_close(x)         mysql_close((x)->db)  
 #define sql_strerror(x)       mysql_error((x)->db)
 #define sql_num_rows(x)       mysql_num_rows((x)->result)
 #define sql_data_seek(x, i)   mysql_data_seek((x)->result, (i))
@@ -203,8 +203,8 @@ typedef struct s_db {
 #define sql_field_seek(x, y)  mysql_field_seek((x)->result, (y))
 #define sql_fetch_field(x)    mysql_fetch_field((x)->result)
 #define sql_num_fields(x)     (int)mysql_num_fields((x)->result)
-#define SQL_ROW               MYSQL_ROW
-#define SQL_FIELD             MYSQL_FIELD
+#define SQL_ROW              MYSQL_ROW
+#define SQL_FIELD            MYSQL_FIELD
 
 #else
 
@@ -215,15 +215,15 @@ typedef struct s_db {
 #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;
 
 
@@ -232,11 +232,11 @@ typedef struct pg_field {
  * used inside sql.c and associated database interface
  * subroutines.
  *
- *                     P O S T G R E S Q L
+ *                    P O S T G R E S Q L
  */
 typedef struct s_db {
-   BQUEUE bq;                         /* queue control */
-   brwlock_t lock;                    /* transaction lock */
+   BQUEUE bq;                        /* queue control */
+   brwlock_t lock;                   /* transaction lock */
    PGconn *db;
    PGresult *result;
    int status;
@@ -244,36 +244,36 @@ typedef struct s_db {
    POSTGRESQL_FIELD *fields;
    int num_rows;
    int num_fields;
-   int row_number;            /* what row number did we get via my_postgresql_data_seek? */
-   int field_number;          /* what field number did we get via my_postgresql_field_seek? */
+   int row_number;           /* what row number did we get via my_postgresql_data_seek? */
+   int field_number;         /* what field number did we get via my_postgresql_field_seek? */
    int ref_count;
    char *db_name;
    char *db_user;
    char *db_password;
-   char *db_address;              /* host address */
-   char *db_socket;               /* socket for local access */
-   int db_port;                   /* port of host address */
-   int have_insert_id;            /* do have insert_id() */
+   char *db_address;             /* host address */
+   char *db_socket;              /* socket for local access */
+   int db_port;                  /* port of host address */
+   int have_insert_id;           /* do have insert_id() */
    int connected;
-   POOLMEM *errmsg;               /* nicely edited error message */
-   POOLMEM *cmd;                  /* SQL command string */
+   POOLMEM *errmsg;              /* nicely edited error message */
+   POOLMEM *cmd;                 /* SQL command string */
    POOLMEM *cached_path;
-   int cached_path_len;           /* length of cached path */
+   int cached_path_len;          /* length of cached path */
    uint32_t cached_path_id;
-   int changes;                   /* changes made to db */
-   POOLMEM *fname;                /* Filename only */
-   POOLMEM *path;                 /* Path only */
-   POOLMEM *esc_name;             /* Escaped file/path name */
-   int fnl;                       /* file name length */
-   int pnl;                       /* path name length */
+   int changes;                  /* changes made to db */
+   POOLMEM *fname;               /* Filename only */
+   POOLMEM *path;                /* Path only */
+   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);
-int                my_postgresql_query      (B_DB *mdb, char *query);
-void               my_postgresql_data_seek  (B_DB *mdb, int row);
-int                my_postgresql_currval    (B_DB *mdb, char *table_name);
-void               my_postgresql_field_seek (B_DB *mdb, int row);
+void              my_postgresql_free_result(B_DB *mdb);
+POSTGRESQL_ROW    my_postgresql_fetch_row  (B_DB *mdb);
+int               my_postgresql_query      (B_DB *mdb, char *query);
+void              my_postgresql_data_seek  (B_DB *mdb, int row);
+int               my_postgresql_currval    (B_DB *mdb, char *table_name);
+void              my_postgresql_field_seek (B_DB *mdb, int row);
 POSTGRESQL_FIELD * my_postgresql_fetch_field(B_DB *mdb);
 
 
@@ -282,7 +282,7 @@ POSTGRESQL_FIELD * my_postgresql_fetch_field(B_DB *mdb);
 #define sql_free_result(x)    my_postgresql_free_result(x)
 #define sql_fetch_row(x)      my_postgresql_fetch_row(x)
 #define sql_query(x, y)       my_postgresql_query((x), (y))
-#define sql_close(x)          PQfinish((x)->db)  
+#define sql_close(x)         PQfinish((x)->db)  
 #define sql_strerror(x)       PQresultErrorMessage((x)->result)
 #define sql_num_rows(x)       ((unsigned) PQntuples((x)->result))
 #define sql_data_seek(x, i)   my_postgresql_data_seek((x), (i))
@@ -291,8 +291,8 @@ POSTGRESQL_FIELD * my_postgresql_fetch_field(B_DB *mdb);
 #define sql_field_seek(x, y)  my_postgresql_field_seek((x), (y))
 #define sql_fetch_field(x)    my_postgresql_fetch_field(x)
 #define sql_num_fields(x)     ((x)->num_fields)
-#define SQL_ROW               POSTGRESQL_ROW
-#define SQL_FIELD             POSTGRESQL_FIELD
+#define SQL_ROW              POSTGRESQL_ROW
+#define SQL_FIELD            POSTGRESQL_FIELD
 
 #else  /* USE BACULA DB routines */
 
@@ -301,17 +301,17 @@ POSTGRESQL_FIELD * my_postgresql_fetch_field(B_DB *mdb);
 /* Change this each time there is some incompatible
  * file format change!!!!
  */
-#define BDB_VERSION 12                /* file version number */
+#define BDB_VERSION 12               /* file version number */
 
 struct s_control {
-   int bdb_version;                   /* Version number */
-   uint32_t JobId;                    /* next Job Id */
-   uint32_t PoolId;                   /* next Pool Id */
-   uint32_t MediaId;                  /* next Media Id */
-   uint32_t JobMediaId;               /* next JobMedia Id */
-   uint32_t ClientId;                 /* next Client Id */
-   uint32_t FileSetId;                /* nest FileSet Id */
-   time_t time;                       /* time file written */
+   int bdb_version;                  /* Version number */
+   uint32_t JobId;                   /* next Job Id */
+   uint32_t PoolId;                  /* next Pool Id */
+   uint32_t MediaId;                 /* next Media Id */
+   uint32_t JobMediaId;              /* next JobMedia Id */
+   uint32_t ClientId;                /* next Client Id */
+   uint32_t FileSetId;               /* nest FileSet Id */
+   time_t time;                      /* time file written */
 };
 
 
@@ -319,23 +319,23 @@ struct s_control {
  *  Bacula internal DB
  */
 typedef struct s_db {
-   BQUEUE bq;                         /* queue control */
-/* pthread_mutex_t mutex;  */         /* single thread lock */
-   brwlock_t lock;                    /* transaction lock */
-   int ref_count;                     /* number of times opened */
-   struct s_control control;          /* control file structure */
-   int cfd;                           /* control file device */
-   FILE *jobfd;                       /* Jobs records file descriptor */
-   FILE *poolfd;                      /* Pool records fd */
-   FILE *mediafd;                     /* Media records fd */
-   FILE *jobmediafd;                  /* JobMedia records fd */
-   FILE *clientfd;                    /* Client records fd */
-   FILE *filesetfd;                   /* FileSet records fd */
-   char *db_name;                     /* name of database */
-   POOLMEM *errmsg;                   /* nicely edited error message */
-   POOLMEM *cmd;                      /* Command string */
+   BQUEUE bq;                        /* queue control */
+/* pthread_mutex_t mutex;  */        /* single thread lock */
+   brwlock_t lock;                   /* transaction lock */
+   int ref_count;                    /* number of times opened */
+   struct s_control control;         /* control file structure */
+   int cfd;                          /* control file device */
+   FILE *jobfd;                      /* Jobs records file descriptor */
+   FILE *poolfd;                     /* Pool records fd */
+   FILE *mediafd;                    /* Media records fd */
+   FILE *jobmediafd;                 /* JobMedia records fd */
+   FILE *clientfd;                   /* Client records fd */
+   FILE *filesetfd;                  /* FileSet records fd */
+   char *db_name;                    /* name of database */
+   POOLMEM *errmsg;                  /* nicely edited error message */
+   POOLMEM *cmd;                     /* Command string */
    POOLMEM *cached_path;
-   int cached_path_len;               /* length of cached path */
+   int cached_path_len;              /* length of cached path */
    uint32_t cached_path_id;
 } B_DB;
 
@@ -350,12 +350,12 @@ typedef struct s_db {
 #define DELETE_DB(jcr, db, cmd) DeleteDB(__FILE__, __LINE__, jcr, db, cmd)
 
 
-#else    /* not __SQL_C */
+#else   /* not __SQL_C */
 
 /* This is a "dummy" definition for use outside of sql.c
  */
-typedef struct s_db {     
-   int dummy;                         /* for SunOS compiler */
+typedef struct s_db {    
+   int dummy;                        /* for SunOS compiler */
 } B_DB;  
 
 #endif /*  __SQL_C */
@@ -366,7 +366,7 @@ extern uint32_t bacula_db_version;
  *  but at the current time, this breaks MySQL.
  */
 typedef uint32_t FileId_t;
-typedef uint32_t DBId_t;              /* general DB id type */
+typedef uint32_t DBId_t;             /* general DB id type */
 typedef uint32_t JobId_t;
       
 #define faddr_t long
@@ -380,18 +380,18 @@ typedef uint32_t JobId_t;
 /* Job record */
 struct JOB_DBR {
    JobId_t JobId;
-   char Job[MAX_NAME_LENGTH];         /* Job unique name */
-   char Name[MAX_NAME_LENGTH];        /* Job base name */
-   int Type;                          /* actually char(1) */
-   int Level;                         /* actually char(1) */
-   int JobStatus;                     /* actually char(1) */
-   uint32_t ClientId;                 /* Id of client */
-   uint32_t PoolId;                   /* Id of pool */
-   uint32_t FileSetId;                /* Id of FileSet */
-   time_t SchedTime;                  /* Time job scheduled */
-   time_t StartTime;                  /* Job start time */
-   time_t EndTime;                    /* Job termination time */
-   utime_t JobTDate;                  /* Backup time/date in seconds */
+   char Job[MAX_NAME_LENGTH];        /* Job unique name */
+   char Name[MAX_NAME_LENGTH];       /* Job base name */
+   int Type;                         /* actually char(1) */
+   int Level;                        /* actually char(1) */
+   int JobStatus;                    /* actually char(1) */
+   uint32_t ClientId;                /* Id of client */
+   uint32_t PoolId;                  /* Id of pool */
+   uint32_t FileSetId;               /* Id of FileSet */
+   time_t SchedTime;                 /* Time job scheduled */
+   time_t StartTime;                 /* Job start time */
+   time_t EndTime;                   /* Job termination time */
+   utime_t JobTDate;                 /* Backup time/date in seconds */
    uint32_t VolSessionId;
    uint32_t VolSessionTime;
    uint32_t JobFiles;
@@ -402,8 +402,8 @@ struct JOB_DBR {
    /* Note, FirstIndex, LastIndex, Start/End File and Block
     * are only used in the JobMedia record.
     */
-   uint32_t FirstIndex;               /* First index this Volume */
-   uint32_t LastIndex;                /* Last index this Volume */
+   uint32_t FirstIndex;              /* First index this Volume */
+   uint32_t LastIndex;               /* Last index this Volume */
    uint32_t StartFile;
    uint32_t EndFile;
    uint32_t StartBlock;
@@ -421,28 +421,28 @@ struct JOB_DBR {
  */
 /* JobMedia record */
 struct JOBMEDIA_DBR {
-   uint32_t JobMediaId;               /* record id */
-   JobId_t  JobId;                    /* JobId */
-   uint32_t MediaId;                  /* MediaId */
-   uint32_t FirstIndex;               /* First index this Volume */
-   uint32_t LastIndex;                /* Last index this Volume */
-   uint32_t StartFile;                /* File for start of data */
-   uint32_t EndFile;                  /* End file on Volume */
-   uint32_t StartBlock;               /* start block on tape */
-   uint32_t EndBlock;                 /* last block */
+   uint32_t JobMediaId;              /* record id */
+   JobId_t  JobId;                   /* JobId */
+   uint32_t MediaId;                 /* MediaId */
+   uint32_t FirstIndex;              /* First index this Volume */
+   uint32_t LastIndex;               /* Last index this Volume */
+   uint32_t StartFile;               /* File for start of data */
+   uint32_t EndFile;                 /* End file on Volume */
+   uint32_t StartBlock;              /* start block on tape */
+   uint32_t EndBlock;                /* last block */
 };
 
 
 /* Volume Parameter structure */
 struct VOL_PARAMS {
    char VolumeName[MAX_NAME_LENGTH];  /* Volume name */
-   uint32_t VolIndex;                 /* Volume seqence no. */ 
-   uint32_t FirstIndex;               /* First index this Volume */
-   uint32_t LastIndex;                /* Last index this Volume */
-   uint32_t StartFile;                /* File for start of data */
-   uint32_t EndFile;                  /* End file on Volume */
-   uint32_t StartBlock;               /* start block on tape */
-   uint32_t EndBlock;                 /* last block */
+   uint32_t VolIndex;                /* Volume seqence no. */ 
+   uint32_t FirstIndex;              /* First index this Volume */
+   uint32_t LastIndex;               /* Last index this Volume */
+   uint32_t StartFile;               /* File for start of data */
+   uint32_t EndFile;                 /* End file on Volume */
+   uint32_t StartBlock;              /* start block on tape */
+   uint32_t EndBlock;                /* last block */
 };
 
 
@@ -451,9 +451,9 @@ struct VOL_PARAMS {
  *  records (e.g. pathname, filename, fileattributes).
  */
 struct ATTR_DBR {
-   char *fname;                       /* full path & filename */
-   char *link;                        /* link if any */
-   char *attr;                        /* attributes statp */
+   char *fname;                      /* full path & filename */
+   char *link;                       /* link if any */
+   char *attr;                       /* attributes statp */
    uint32_t FileIndex;
    uint32_t Stream;
    JobId_t  JobId;
@@ -475,26 +475,26 @@ struct FILE_DBR {
    char LStat[256];
 /*   int Status; */
    char SIG[50];
-   int SigType;                       /* NO_SIG/MD5_SIG/SHA1_SIG */
+   int SigType;                      /* NO_SIG/MD5_SIG/SHA1_SIG */
 };
 
 /* Pool record -- same format as database */
 struct POOL_DBR {
    uint32_t PoolId;
-   char Name[MAX_NAME_LENGTH];        /* Pool name */
-   uint32_t NumVols;                  /* total number of volumes */
-   uint32_t MaxVols;                  /* max allowed volumes */
-   int32_t UseOnce;                   /* set to use once only */
-   int32_t UseCatalog;                /* set to use catalog */
-   int32_t AcceptAnyVolume;           /* set to accept any volume sequence */
-   int32_t AutoPrune;                 /* set to prune automatically */
-   int32_t Recycle;                   /* default Vol recycle flag */
-   utime_t  VolRetention;             /* retention period in seconds */
-   utime_t  VolUseDuration;           /* time in secs volume can be used */
-   uint32_t MaxVolJobs;               /* Max Jobs on Volume */
-   uint32_t MaxVolFiles;              /* Max files on Volume */
-   uint64_t MaxVolBytes;              /* Max bytes on Volume */
-   char PoolType[MAX_NAME_LENGTH];             
+   char Name[MAX_NAME_LENGTH];       /* Pool name */
+   uint32_t NumVols;                 /* total number of volumes */
+   uint32_t MaxVols;                 /* max allowed volumes */
+   int32_t UseOnce;                  /* set to use once only */
+   int32_t UseCatalog;               /* set to use catalog */
+   int32_t AcceptAnyVolume;          /* set to accept any volume sequence */
+   int32_t AutoPrune;                /* set to prune automatically */
+   int32_t Recycle;                  /* default Vol recycle flag */
+   utime_t  VolRetention;            /* retention period in seconds */
+   utime_t  VolUseDuration;          /* time in secs volume can be used */
+   uint32_t MaxVolJobs;              /* Max Jobs on Volume */
+   uint32_t MaxVolFiles;             /* Max files on Volume */
+   uint64_t MaxVolBytes;             /* Max bytes on Volume */
+   char PoolType[MAX_NAME_LENGTH];            
    char LabelFormat[MAX_NAME_LENGTH];
    /* Extra stuff not in DB */
    faddr_t rec_addr;
@@ -502,37 +502,37 @@ struct POOL_DBR {
 
 /* Media record -- same as the database */
 struct MEDIA_DBR {
-   uint32_t MediaId;                  /* Unique volume id */
+   uint32_t MediaId;                 /* Unique volume id */
    char VolumeName[MAX_NAME_LENGTH];  /* Volume name */
    char MediaType[MAX_NAME_LENGTH];   /* Media type */
-   uint32_t PoolId;                   /* Pool id */
-   time_t   FirstWritten;             /* Time Volume first written */
-   time_t   LastWritten;              /* Time Volume last written */
-   time_t   LabelDate;                /* Date/Time Volume labeled */
-   uint32_t VolJobs;                  /* number of jobs on this medium */
-   uint32_t VolFiles;                 /* Number of files */
-   uint32_t VolBlocks;                /* Number of blocks */
-   uint32_t VolMounts;                /* Number of times mounted */
-   uint32_t VolErrors;                /* Number of read/write errors */
-   uint32_t VolWrites;                /* Number of writes */
-   uint32_t VolReads;                 /* Number of reads */
-   uint64_t VolBytes;                 /* Number of bytes written */
-   uint64_t MaxVolBytes;              /* Max bytes to write to Volume */
-   uint64_t VolCapacityBytes;         /* capacity estimate */
-   uint64_t VolReadTime;              /* time spent reading volume */
-   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 MaxVolJobs;               /* Max Jobs on Volume */
-   uint32_t MaxVolFiles;              /* Max files on Volume */
-   int32_t  Recycle;                  /* recycle yes/no */
-   int32_t  Slot;                     /* slot in changer */
-   int32_t  InChanger;                /* Volume currently in changer */
-   char VolStatus[20];                /* Volume status */
+   uint32_t PoolId;                  /* Pool id */
+   time_t   FirstWritten;            /* Time Volume first written */
+   time_t   LastWritten;             /* Time Volume last written */
+   time_t   LabelDate;               /* Date/Time Volume labeled */
+   uint32_t VolJobs;                 /* number of jobs on this medium */
+   uint32_t VolFiles;                /* Number of files */
+   uint32_t VolBlocks;               /* Number of blocks */
+   uint32_t VolMounts;               /* Number of times mounted */
+   uint32_t VolErrors;               /* Number of read/write errors */
+   uint32_t VolWrites;               /* Number of writes */
+   uint32_t VolReads;                /* Number of reads */
+   uint64_t VolBytes;                /* Number of bytes written */
+   uint64_t MaxVolBytes;             /* Max bytes to write to Volume */
+   uint64_t VolCapacityBytes;        /* capacity estimate */
+   uint64_t VolReadTime;             /* time spent reading volume */
+   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 MaxVolJobs;              /* Max Jobs on Volume */
+   uint32_t MaxVolFiles;             /* Max files on Volume */
+   int32_t  Recycle;                 /* recycle yes/no */
+   int32_t  Slot;                    /* slot in changer */
+   int32_t  InChanger;               /* Volume currently in changer */
+   char VolStatus[20];               /* Volume status */
    /* Extra stuff not in DB */
-   faddr_t rec_addr;                  /* found record address */
+   faddr_t rec_addr;                 /* found record address */
    /* Since the database returns times as strings, this is how we pass
-    *   them back.
+    *  them back.
     */
    char    cFirstWritten[MAX_TIME_LENGTH]; /* FirstWritten returned from DB */
    char    cLastWritten[MAX_TIME_LENGTH];  /* LastWritten returned from DB */
@@ -541,12 +541,12 @@ struct MEDIA_DBR {
 
 /* Client record -- same as the database */
 struct CLIENT_DBR {
-   uint32_t ClientId;                 /* Unique Client id */
+   uint32_t ClientId;                /* Unique Client id */
    int AutoPrune;
    utime_t FileRetention;
    utime_t JobRetention;
-   char Name[MAX_NAME_LENGTH];        /* Client name */
-   char Uname[256];                   /* Uname for client */
+   char Name[MAX_NAME_LENGTH];       /* Client name */
+   char Uname[256];                  /* Uname for client */
 };
 
 /* Counter record as in database */
@@ -561,16 +561,16 @@ struct COUNTER_DBR {
 
 /* FileSet record -- same as the database */
 struct FILESET_DBR {
-   uint32_t FileSetId;                /* Unique FileSet id */
+   uint32_t FileSetId;               /* Unique FileSet id */
    char FileSet[MAX_NAME_LENGTH];     /* FileSet name */
-   char MD5[50];                      /* MD5 signature of include/exclude */
-   time_t CreateTime;                 /* date created */
+   char MD5[50];                     /* MD5 signature of include/exclude */
+   time_t CreateTime;                /* date created */
    /*
     * This is where we return CreateTime
     */
    char cCreateTime[MAX_TIME_LENGTH]; /* CreateTime as returned from DB */
    /* Not in DB but returned by db_create_fileset() */
-   bool created;                      /* set when record newly created */
+   bool created;                     /* set when record newly created */
 };
 
 
index b67cfb89ce9a257ee45c7d6c225be9d2cfbc4673..48843840b51adc7e434b27da7275644271e20667 100644 (file)
@@ -9,7 +9,7 @@
  */
 
 /*
-   Copyright (C) 2000-2003 Kern Sibbald and John Walker
+   Copyright (C) 2000-2004 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
index 64e76b168c9c091094324d03ef1cc828c899a70b..91b4493743c9973da88369173b8f5bb850b504cd 100644 (file)
@@ -9,7 +9,7 @@
  */
 
 /*
-   Copyright (C) 2000-2003 Kern Sibbald and John Walker
+   Copyright (C) 2000-2004 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
index 8df73cc7682e26732c26f2b3c3b5cde85b1d2315..51b09347a4bf7037aea970577647da5391343a13 100644 (file)
@@ -10,7 +10,7 @@
  */
 
 /*
-   Copyright (C) 2000-2003 Kern Sibbald and John Walker
+   Copyright (C) 2000-2004 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
index 5d239532c604ffcb8dd5f1302b3c958fc7c4e697..c7050f8a3c107917068f5c25f528c605c9e19ee4 100644 (file)
@@ -11,7 +11,7 @@
  */
 
 /*
-   Copyright (C) 2000-2003 Kern Sibbald and John Walker
+   Copyright (C) 2000-2004 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
index d00249e0b7f4aa522601c11d738d3ce0fd113bcb..3c428742e805186dfa9f4286f2abcdb6a1ea7114 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 /*
-   Copyright (C) 2000-2003 Kern Sibbald and John Walker
+   Copyright (C) 2000-2004 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
@@ -303,26 +303,26 @@ db_update_media_record(JCR *jcr, B_DB *mdb, MEDIA_DBR *mr)
            "VolWrites=%u,MaxVolBytes=%s,LastWritten='%s',VolStatus='%s',"
            "Slot=%d,InChanger=%d,VolReadTime=%s,VolWriteTime=%s "
            " WHERE VolumeName='%s'",
-           mr->VolJobs, mr->VolFiles, mr->VolBlocks, edit_uint64(mr->VolBytes, ed1),
-           mr->VolMounts, mr->VolErrors, mr->VolWrites, 
-           edit_uint64(mr->MaxVolBytes, ed2), dt, 
-           mr->VolStatus, mr->Slot, mr->InChanger, 
-           edit_uint64(mr->VolReadTime, ed3),
-           edit_uint64(mr->VolWriteTime, ed4),
-           mr->VolumeName);
+          mr->VolJobs, mr->VolFiles, mr->VolBlocks, edit_uint64(mr->VolBytes, ed1),
+          mr->VolMounts, mr->VolErrors, mr->VolWrites, 
+          edit_uint64(mr->MaxVolBytes, ed2), dt, 
+          mr->VolStatus, mr->Slot, mr->InChanger, 
+          edit_uint64(mr->VolReadTime, ed3),
+          edit_uint64(mr->VolWriteTime, ed4),
+          mr->VolumeName);
    } else {
       Mmsg(&mdb->cmd, "UPDATE Media SET VolJobs=%u,"
            "VolFiles=%u,VolBlocks=%u,VolBytes=%s,VolMounts=%u,VolErrors=%u,"
            "VolWrites=%u,MaxVolBytes=%s,VolStatus='%s',"
            "Slot=%d,InChanger=%d,VolReadTime=%s,VolWriteTime=%s "
            " WHERE VolumeName='%s'",
-           mr->VolJobs, mr->VolFiles, mr->VolBlocks, edit_uint64(mr->VolBytes, ed1),
-           mr->VolMounts, mr->VolErrors, mr->VolWrites, 
-           edit_uint64(mr->MaxVolBytes, ed2), 
-           mr->VolStatus, mr->Slot, mr->InChanger, 
-           edit_uint64(mr->VolReadTime, ed3),
-           edit_uint64(mr->VolWriteTime, ed4),
-           mr->VolumeName);
+          mr->VolJobs, mr->VolFiles, mr->VolBlocks, edit_uint64(mr->VolBytes, ed1),
+          mr->VolMounts, mr->VolErrors, mr->VolWrites, 
+          edit_uint64(mr->MaxVolBytes, ed2), 
+          mr->VolStatus, mr->Slot, mr->InChanger, 
+          edit_uint64(mr->VolReadTime, ed3),
+          edit_uint64(mr->VolWriteTime, ed4),
+          mr->VolumeName);
    }
 
    Dmsg1(400, "%s\n", mdb->cmd);
index c382e1c5688830802faaf2164483204cf5d9572b..6d6d2330ccfa26a224ce29a5c47bc661eabdb7a2 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 /*
-   Copyright (C) 2002-2003 Kern Sibbald and John Walker
+   Copyright (C) 2002-2004 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
index 7e525864ce578b7491d0ef513860f429e7fcba6c..54da62d29d1af2745047fc8438269d3585bada0e 100644 (file)
@@ -1,5 +1,5 @@
 /*
-   Copyright (C) 2000-2003 Kern Sibbald and John Walker
+   Copyright (C) 2000-2004 Kern Sibbald and John Walker
 
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
index d40aef88bb605f1e7cf5f0008b9c74ea97f70b4e..c2f7003e45eb391851b644bcd2330f13723016c7 100755 (executable)
@@ -9,7 +9,7 @@
         
 */
 /*
-   Copyright (C) 2000-2003 Kern Sibbald and John Walker
+   Copyright (C) 1981-2004 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
index 8afc685041b221cf93077c2fc8eb82c34fa9afa1..8842bc62677abd99767c82b57b15c6959b17cec3 100644 (file)
@@ -7,7 +7,7 @@
  *   Version $Id$
  */
 /*
-   Copyright (C) 2000-2003 Kern Sibbald and John Walker
+   Copyright (C) 2000-2004 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
index 740f3b2757cd48024dacfc061e715b00d48fdba0..3f4303b8a5871a780f7e3cc12fcf4dda03006429 100644 (file)
@@ -22,7 +22,7 @@
  *     Version $Id$
  */
 /*
-   Copyright (C) 2000-2003 Kern Sibbald and John Walker
+   Copyright (C) 2000-2004 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
index 80d2ba0dabdb3483660190fddd0ae9217e5805c7..71d15ff44ad054bd33d5fda2684450667df05018 100644 (file)
@@ -7,7 +7,7 @@
  *    Version $Id$
  */
 /*
-   Copyright (C) 2000-2003 Kern Sibbald and John Walker
+   Copyright (C) 2000-2004 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
index 94b8c664f84fcae492d283aa9b83133f4c264678..0b5e476e4ec67a88adc716c7acac1ae25bca762c 100644 (file)
@@ -16,7 +16,7 @@
  *   Version $Id$
  */
 /*
-   Copyright (C) 2000-2003 Kern Sibbald and John Walker
+   Copyright (C) 2000-2004 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
index f04fc057faff80b04eefdbb65408c7c96cb66f4f..c12969c97f205ec5932f3374c0b29dd0855b583b 100644 (file)
@@ -9,7 +9,7 @@
  */
 
 /*
-   Copyright (C) 2002 Kern Sibbald and John Walker
+   Copyright (C) 2002-2004 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
index 1d2821c63e956ae83b16e1c4db5343346280d156..974783556719bb4b454c94d5d64416fe8b37646d 100644 (file)
@@ -10,7 +10,7 @@
  *   Version $Id$
  */
 /*
-   Copyright (C) 2000-2003 Kern Sibbald and John Walker
+   Copyright (C) 2000-2004 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
index c91580148868fb993128f005297258bd3959e20c..e5f8983aceb003aa4046543ac8fa8ee079a07d4e 100644 (file)
@@ -8,7 +8,7 @@
  */
 
 /*
-   Copyright (C) 2002-200 Kern Sibbald and John Walker
+   Copyright (C) 2002-2004 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
@@ -177,9 +177,9 @@ char *uar_file =
 
 
 char *uar_sel_files = 
-   "SELECT Path.Path,Filename.Name,FileIndex,JobId "
+   "SELECT Path.Path,Filename.Name,FileIndex,JobId,LStat "
    "FROM File,Filename,Path "
-   "WHERE File.JobId=%d AND Filename.FilenameId=File.FilenameId "
+   "WHERE File.JobId=%u AND Filename.FilenameId=File.FilenameId "
    "AND Path.PathId=File.PathId";
 
 char *uar_del_temp  = "DROP TABLE temp";
index 6b4455c5ef5c1d69fb89c8b80e5a1083cc284826..c71a1341b4ff8a1e8077217d68ef229e3379880d 100644 (file)
@@ -8,7 +8,7 @@
  */
 
 /*
-   Copyright (C) 2000-2003 Kern Sibbald and John Walker
+   Copyright (C) 2000-2004 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
index 19c7ed4cf102dcc4a735da1d117a03a459eaef99..569a5f7b76fc16c8eccbf7cb3f7506c29d320ac3 100644 (file)
@@ -12,7 +12,7 @@
  */
 
 /*
-   Copyright (C) 2002 Kern Sibbald and John Walker
+   Copyright (C) 2002-2004 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
index 754d53216a14225db26e15cbbdd7d8d9aa6cd98e..9b4d29a262520eb0a0f17de8a32fb5e7aeafcd77 100644 (file)
@@ -14,7 +14,7 @@
  */
 
 /*
-   Copyright (C) 2002-2003 Kern Sibbald and John Walker
+   Copyright (C) 2002-2004 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
@@ -42,10 +42,10 @@ extern int run_cmd(UAContext *ua, char *cmd);
 extern void print_bsr(UAContext *ua, RBSR *bsr);
 
 /* Imported variables */
-extern char *uar_list_jobs,      *uar_file,        *uar_sel_files;
-extern char *uar_del_temp,       *uar_del_temp1,   *uar_create_temp;
-extern char *uar_create_temp1,   *uar_last_full,   *uar_full;
-extern char *uar_inc_dec,        *uar_list_temp,   *uar_sel_jobid_temp;
+extern char *uar_list_jobs,     *uar_file,        *uar_sel_files;
+extern char *uar_del_temp,      *uar_del_temp1,   *uar_create_temp;
+extern char *uar_create_temp1,  *uar_last_full,   *uar_full;
+extern char *uar_inc_dec,       *uar_list_temp,   *uar_sel_jobid_temp;
 extern char *uar_sel_all_temp1,  *uar_sel_fileset, *uar_mediatype;
 extern char *uar_jobid_fileindex;
 
index 0a87e265ecf157caf80296d624a91477aee1beaa..93a8f8a2188c208d5019e6de6e948884e78374f7 100644 (file)
@@ -10,7 +10,7 @@
  */
 
 /*
-   Copyright (C) 2002-2003 Kern Sibbald and John Walker
+   Copyright (C) 2002-2004 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
@@ -132,6 +132,10 @@ void user_select_files_from_tree(TREE_CTX *tree)
  *  this routine is called once for each file. We do not allow
  *  duplicate filenames, but instead keep the info from the most
  *  recent file entered (i.e. the JobIds are assumed to be sorted)
+ *
+ *   See uar_sel_files in sql_cmds.c for query that calls us.
+ *     row[0]=Path, row[1]=Filename, row[2]=FileIndex
+ *     row[3]=JobId row[4]=LStat
  */
 int insert_tree_handler(void *ctx, int num_fields, char **row)
 {
@@ -166,9 +170,11 @@ int insert_tree_handler(void *ctx, int num_fields, char **row)
       tree->avail_node = NULL;
    }
    new_node->FileIndex = atoi(row[2]);
-   new_node->JobId = atoi(row[3]);
+   new_node->JobId = (JobId_t)str_to_int64(row[3]);
    new_node->type = type;
    new_node->extract = true;         /* extract all by default */
+   new_node->extract_dir = true;      /* if dir, extract it */
+   new_node->have_link = (decode_LinkFI(row[4]) != 0);
    tree->cnt++;
    return 0;
 }
@@ -197,14 +203,15 @@ static int set_extract(UAContext *ua, TREE_NODE *node, TREE_CTX *tree, bool extr
       }
    } else if (extract) {
       char cwd[2000];
-      /* Ordinary file, we get the full path, look up the
+      /*
+       * Ordinary file, we get the full path, look up the
        * attributes, decode them, and if we are hard linked to
        * a file that was saved, we must load that file too.
        */
       tree_getpath(node, cwd, sizeof(cwd));
       fdbr.FileId = 0;
       fdbr.JobId = node->JobId;
-      if (db_get_file_attributes_record(ua->jcr, ua->db, cwd, NULL, &fdbr)) {
+      if (node->have_link && db_get_file_attributes_record(ua->jcr, ua->db, cwd, NULL, &fdbr)) {
         int32_t LinkFI;
         decode_stat(fdbr.LStat, &statp, &LinkFI); /* decode stat pkt */
         /*
index 02165f8a251deda43035a53dbaad3c9ec6bf8018..10c98fed25d56ceb6b13ba7379a1470c141bc704 100644 (file)
@@ -7,7 +7,7 @@
  *
  */
 /*
-   Copyright (C) 2000, 2001, 2002 Kern Sibbald and John Walker
+   Copyright (C) 2000-2004 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
index 23796405bd665c26cbdc1c76ed5b69c4b1bcf59c..b5f05c13b1e66f344b2465af43149e2ad496cf1a 100644 (file)
@@ -7,7 +7,7 @@
  *
  */
 /*
-   Copyright (C) 2000-2003 Kern Sibbald and John Walker
+   Copyright (C) 2000-2004 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
index 8ddb8e1a8b7bff4653ed9b04e32323b499a7e4f8..df3c35874ef05bdcf2b0a200c02c6e739d116ae0 100644 (file)
@@ -64,7 +64,7 @@ BEGIN
             VALUE "FileDescription", "Bacula File daemon for Win32\0"
             VALUE "FileVersion", VERSION "\0"
             VALUE "InternalName", "Bacula\0"
-            VALUE "LegalCopyright", "Copyright Kern Sibbald, 1999-2003\0"
+            VALUE "LegalCopyright", "Copyright Kern Sibbald, 1999-2004\0"
             VALUE "LegalTrademarks", "Licensed under GNU GPL 2.0\0"
             VALUE "OriginalFilename", "filed.exe\0"
             VALUE "PrivateBuild", "\0"
@@ -139,7 +139,7 @@ BEGIN
                     IDC_WWW,90,60,239,10
     LTEXT           "                                    ",
                     IDC_WWW,90,70,239,10
-    LTEXT           "Copyright (C) 1999-2003, Kern Sibbald",
+    LTEXT           "Copyright (C) 1999-2004, Kern Sibbald",
                     IDC_COPYRIGHT,7,120,175,10
     LTEXT           "Licensed under GNU GPL 2.0.",
                     IDC_TRADEMARK,7,130,175,10
index f0d65be64cebafa9eb498af37b99a9763de1e6e9..d16c3ec9644a6d6afdb2c0ba3ce7458ca8046cc6 100755 (executable)
@@ -9,7 +9,7 @@
  *
  */
 /*
-   Copyright (C) 2000-2003 Kern Sibbald and John Walker
+   Copyright (C) 2000-2004 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
@@ -220,6 +220,47 @@ int decode_stat(char *buf, struct stat *statp, int32_t *LinkFI)
    return (int)val;
 }
 
+/* Decode a LinkFI field of encoded stat packet */
+int32_t decode_LinkFI(char *buf) 
+{
+   char *p = buf;
+   int64_t val;
+
+   skip_nonspaces(&p);               /* st_dev */
+   p++;                              /* skip space */
+   skip_nonspaces(&p);               /* st_ino */
+   p++;
+   skip_nonspaces(&p);               /* st_mode */
+   p++;
+   skip_nonspaces(&p);               /* st_nlink */
+   p++;
+   skip_nonspaces(&p);               /* st_uid */
+   p++;
+   skip_nonspaces(&p);               /* st_gid */
+   p++;
+   skip_nonspaces(&p);               /* st_rdev */
+   p++;
+   skip_nonspaces(&p);               /* st_size */
+   p++;
+   skip_nonspaces(&p);               /* st_blksize */
+   p++;
+   skip_nonspaces(&p);               /* st_blocks */
+   p++;
+   skip_nonspaces(&p);               /* st_atime */
+   p++;
+   skip_nonspaces(&p);               /* st_mtime */
+   p++;
+   skip_nonspaces(&p);               /* st_ctime */
+
+   /* Optional FileIndex of hard linked file data */
+   if (*p == ' ' || (*p != 0 && *(p+1) == ' ')) {
+      p++;
+      p += from_base64(&val, p);
+      return (int32_t)val;
+   }
+   return 0;
+}
+
 /*
  * Set file modes, permissions and times
  *
index 766120df91609dea4be2a6347c58609c9b6a9501..edc38ccf1a8b019d33667184014638fcf967e7fd 100644 (file)
@@ -7,7 +7,7 @@
  *
  */
 /*
-   Copyright (C) 2000-2003 Kern Sibbald and John Walker
+   Copyright (C) 2000-2004 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
index 0ea272357e5b8880ff76dfb5d6f82ac0315b7234..618b0f0d64c66a25b0f5049ff967b691d18222b9 100644 (file)
  */
 
 /* from attribs.c */
-void   encode_stat       (char *buf, FF_PKT *ff_pkt, int data_stream);
-int    decode_stat       (char *buf, struct stat *statp, int32_t *LinkFI);
-int    encode_attribsEx  (JCR *jcr, char *attribsEx, FF_PKT *ff_pkt);
-int    set_attributes    (JCR *jcr, ATTR *attr, BFILE *ofd);
-int    select_data_stream(FF_PKT *ff_pkt);
+void   encode_stat       (char *buf, FF_PKT *ff_pkt, int data_stream);
+int    decode_stat       (char *buf, struct stat *statp, int32_t *LinkFI);
+int32_t decode_LinkFI    (char *buf);
+int    encode_attribsEx  (JCR *jcr, char *attribsEx, FF_PKT *ff_pkt);
+int    set_attributes    (JCR *jcr, ATTR *attr, BFILE *ofd);
+int    select_data_stream(FF_PKT *ff_pkt);
 
 /* from create_file.c */
-int    create_file       (JCR *jcr, ATTR *attr, BFILE *ofd, int replace);
+int    create_file      (JCR *jcr, ATTR *attr, BFILE *ofd, int replace);
 
 /* From find.c */
 FF_PKT *init_find_files();
@@ -47,11 +48,11 @@ void  add_fname_to_exclude_list(FF_PKT *ff, char *fname);
 int   file_is_excluded(FF_PKT *ff, char *file);
 int   file_is_included(FF_PKT *ff, char *file);
 struct s_included_file *get_next_included_file(FF_PKT *ff, 
-                           struct s_included_file *inc);
+                          struct s_included_file *inc);
 
 /* From find_one.c */
 int   find_one_file(JCR *jcr, FF_PKT *ff, int handle_file(FF_PKT *ff_pkt, void *hpkt), 
-               void *pkt, char *p, dev_t parent_device, int top_level);
+              void *pkt, char *p, dev_t parent_device, int top_level);
 int   term_find_one(FF_PKT *ff);
 
 
@@ -61,7 +62,7 @@ int enable_backup_privileges(JCR *jcr, int ignore_errors);
 
 /* from makepath.c */
 int make_path(JCR *jcr, const char *argpath, int mode,
-           int parent_mode, uid_t owner, gid_t group,
-           int preserve_existing, char *verbose_fmt_string);
+          int parent_mode, uid_t owner, gid_t group,
+          int preserve_existing, char *verbose_fmt_string);
 
 /* from bfile.c -- see bfile.h */
index e9c2cd00f48f6117a381a2b263fa2fb4226b820a..dfe93bf042a29350ed4b348a10ca292357f66c21 100644 (file)
@@ -5,7 +5,7 @@
  *
  */
 /*
-   Copyright (C) 2000, 2001, 2002 Kern Sibbald and John Walker
+   Copyright (C) 2000-2004 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
index 6f8994fe518caf6b1c5ab075d0f7d19ad49fa605..3cd1702fe5ff0dac0c1777db21204a77b597f4b4 100644 (file)
@@ -10,7 +10,7 @@
  */
 
 /*
-   Copyright (C) 2000, 2001, 2002 Kern Sibbald and John Walker
+   Copyright (C) 2000-2004 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
index 4d4b49dd84bc142cffca1a181113106ac6129c54..14a813a0f2cd4ca9a4455ddce06ba0771616f1c0 100644 (file)
@@ -12,7 +12,7 @@
  *   Version $Id$
  */
 /*
-   Copyright (C) 2000, 2001, 2002 Kern Sibbald and John Walker
+   Copyright (C) 2000-2004 Kern Sibbald and John Walker
 
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
index 4972a9c9a446c946e74a9af438304c5300259016..f5e3a99b2cf3af1ef0eda3629a5688022c42dfb9 100644 (file)
@@ -4,7 +4,7 @@
  *   Version $Id$
  */
 /*
-   Copyright (C) 2000-2003 Kern Sibbald and John Walker
+   Copyright (C) 2000-2004 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
index ffc35c52cb5f4db1e5b7a16c4e96a545e692132c..bf860c2fc9d0d0df6fd39409fadd00343f8322f5 100644 (file)
@@ -10,7 +10,7 @@
  *
  */
 /*
-   Copyright (C) 2000-2003 Kern Sibbald and John Walker
+   Copyright (C) 2000-2004 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
index e92c567216b24996776dcd5c922427b1b244aa80..838f920966587f3eb3da49818c6583fd997e6a69 100644 (file)
@@ -5,7 +5,7 @@
  *
 */
 /*
-   Copyright (C) 2002,2003 Kern Sibbald and John Walker
+   Copyright (C) 2002-2004 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
@@ -39,9 +39,11 @@ struct s_tree_node {
    char *fname;                       /* file name */
    int32_t FileIndex;                 /* file index */
    uint32_t JobId;                    /* JobId */
-   uint16_t fname_len;                /* length of string */
-   uint8_t type;                      /* node type */
-   bool extract;                      /* set if extracting */
+   uint16_t fname_len;                /* filename length */
+   unsigned int type: 8;              /* node type */
+   unsigned int extract: 1;           /* extract item */
+   unsigned int extract_dir: 1;       /* extract dir entry only */
+   unsigned int have_link: 1;         /* set if have hard link */
    struct s_tree_node *parent;
    struct s_tree_node *sibling;
    struct s_tree_node *child;
@@ -53,9 +55,11 @@ struct s_tree_root {
    char *fname;                       /* file name */
    int32_t FileIndex;                 /* file index */
    uint32_t JobId;                    /* JobId */
-   uint16_t fname_len;                /* length of string */
-   uint8_t type;                      /* node type */
-   bool extract;                      /* set if extracting */
+   uint16_t fname_len;                /* filename length */
+   unsigned int type: 8;              /* node type */
+   unsigned int extract: 1;           /* extract item */
+   unsigned int extract_dir: 1;       /* extract dir entry only */
+   unsigned int have_link: 1;         /* set if have hard link */
    struct s_tree_node *parent;
    struct s_tree_node *sibling;
    struct s_tree_node *child;
index ffdbc5c8327fb9fbcfe78c95a5a06da698fdb1f3..52d147c787d99f7766d5680d93180f7ae48b7fc4 100644 (file)
@@ -18,7 +18,7 @@
  *  Adapted by Kern Sibbald to Bacula June 2003
  */
 /*
-   Copyright (C) 2000-2003 Kern Sibbald and John Walker
+   Copyright (C) 2000-2004 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
index 8ab21c438d312b0939506eaa5cf13c135717493c..3c216f1410f88acbeacf409a2352bbd1497cd776 100755 (executable)
@@ -8,7 +8,7 @@
  *
  */
 /*
-   Copyright (C) 2000-2003 Kern Sibbald and John Walker
+   Copyright (C) 2000-2004 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
index 724bfe92399e5c3c83f05c0aadc8a60f80b05903..c7ac6889e17a33d26daa8c6879026fcdeef897dc 100644 (file)
@@ -5,7 +5,7 @@
  *
 */
 /*
-   Copyright (C) 2002 Kern Sibbald and John Walker
+   Copyright (C) 2002-2004 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
index 81138f046550caf59467cd6e5cc135f0f76ff5c3..5ab474a756786620b900c027c64c36cf2c32c192 100644 (file)
@@ -7,7 +7,7 @@
  *   Version $Id$
  */
 /*
-   Copyright (C) 2000-2003 Kern Sibbald and John Walker
+   Copyright (C) 2000-2004 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
index 6255e65247374be8bff6a586496d8b06f305d299..0de1527978335e6382bf02177523fba1ada5367a 100644 (file)
@@ -8,7 +8,7 @@
  *   Version $Id$
  */
 /*
-   Copyright (C) 2001, 2002 Kern Sibbald and John Walker
+   Copyright (C) 2002-2004 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
index 950ff5bbb2a2385f3f6206e17627a7a8d1240c2b..d594de8cdf8cd262c23c1006c5717bec5c22238b 100644 (file)
@@ -2,13 +2,13 @@
  *
  *  Dumb program to extract files from a Bacula backup.
  *
- *   Kern E. Sibbald
+ *   Kern E. Sibbald, 2000
  *
  *   Version $Id$
  *
  */
 /*
-   Copyright (C) 2000, 2001, 2002 Kern Sibbald and John Walker
+   Copyright (C) 2000-2004 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
index 585f89ca3446950db72827dc16dcde7f1cfefbc8..5a3028403e38d761e5ee2e8feb7d31f26784e93a 100644 (file)
@@ -9,7 +9,7 @@
  *
  */
 /*
-   Copyright (C) 2000-2003 Kern Sibbald and John Walker
+   Copyright (C) 2000-2004 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
index 0525a4af7984103a6e726138880a5ad2b39d7d49..69c75b58ff50cce1f11bfbff68361ecd2a16fce8 100644 (file)
@@ -5,7 +5,7 @@
  *   Version $Id$
  */
 /*
-   Copyright (C) 2000-2003 Kern Sibbald and John Walker
+   Copyright (C) 2000-2004 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
index 4eaf150c39b6d6ca68ba402da3e115d790935443..193a03452b3126317b99759348de2cf675dff493 100644 (file)
@@ -10,7 +10,7 @@
  *   Version $Id$
  */
 /*
-   Copyright (C) 2001, 2002 Kern Sibbald and John Walker
+   Copyright (C) 2001-2004 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
index 4c586c694abd199dcc26a5905acd8919ffa58723..1a812d5efa7abda0a37b6b1079ecfc37fd0e7d4b 100644 (file)
@@ -14,7 +14,7 @@
  *
  */
 /*
-   Copyright (C) 2000-2003 Kern Sibbald and John Walker
+   Copyright (C) 2000-2004 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
index 0140d4211c33858bf770465ac611f2f1ad1175c1..57a612dab32d6984c9f8094ea4619bcabc75d99d 100644 (file)
@@ -29,7 +29,7 @@
  *   Version $Id$
  */
 /*
-   Copyright (C) 2000-2003 Kern Sibbald and John Walker
+   Copyright (C) 2000-2004 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
index 78d9d7b5148c8f774c2096669c67dbeebe8bdf19..c1ffd586681057f65e3a787ec52a6ad8be2726fc 100644 (file)
@@ -6,7 +6,7 @@
  *
  */
 /*
-   Copyright (C) 2000-2003 Kern Sibbald and John Walker
+   Copyright (C) 2000-2004 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
@@ -31,9 +31,9 @@
 
 /* #define NEW_LOCK 1 */
 
-#define new_lock_device(dev)             _new_lock_device(__FILE__, __LINE__, (dev)) 
+#define new_lock_device(dev)            _new_lock_device(__FILE__, __LINE__, (dev)) 
 #define new_lock_device_state(dev,state) _new_lock_device(__FILE__, __LINE__, (dev), (state))
-#define new_unlock_device(dev)           _new_unlock_device(__FILE__, __LINE__, (dev))
+#define new_unlock_device(dev)          _new_unlock_device(__FILE__, __LINE__, (dev))
 
 #define lock_device(d) _lock_device(__FILE__, __LINE__, (d))
 #define unlock_device(d) _unlock_device(__FILE__, __LINE__, (d))
 #define give_back_device_lock(d, p) _give_back_device_lock(__FILE__, __LINE__, (d), (p))
 
 /* Arguments to open_dev() */
-#define READ_WRITE       0
-#define READ_ONLY        1
+#define READ_WRITE      0
+#define READ_ONLY       1
 #define OPEN_READ_WRITE  0
-#define OPEN_READ_ONLY   1
+#define OPEN_READ_ONLY  1
 #define OPEN_WRITE_ONLY  2
 
 /* Generic status bits returned from status_dev() */
-#define BMT_TAPE           (1<<0)     /* is tape device */
-#define BMT_EOF            (1<<1)     /* just read EOF */
-#define BMT_BOT            (1<<2)     /* at beginning of tape */
-#define BMT_EOT            (1<<3)     /* end of tape reached */
-#define BMT_SM             (1<<4)     /* DDS setmark */
-#define BMT_EOD            (1<<5)     /* DDS at end of data */
-#define BMT_WR_PROT        (1<<6)     /* tape write protected */
-#define BMT_ONLINE         (1<<7)     /* tape online */
-#define BMT_DR_OPEN        (1<<8)     /* tape door open */
-#define BMT_IM_REP_EN      (1<<9)     /* immediate report enabled */
+#define BMT_TAPE          (1<<0)     /* is tape device */
+#define BMT_EOF           (1<<1)     /* just read EOF */
+#define BMT_BOT           (1<<2)     /* at beginning of tape */
+#define BMT_EOT           (1<<3)     /* end of tape reached */
+#define BMT_SM            (1<<4)     /* DDS setmark */
+#define BMT_EOD           (1<<5)     /* DDS at end of data */
+#define BMT_WR_PROT       (1<<6)     /* tape write protected */
+#define BMT_ONLINE        (1<<7)     /* tape online */
+#define BMT_DR_OPEN       (1<<8)     /* tape door open */
+#define BMT_IM_REP_EN     (1<<9)     /* immediate report enabled */
 
 
 /* Test capabilities */
 #define dev_cap(dev, cap) ((dev)->capabilities & (cap))
 
 /* Bits for device capabilities */
-#define CAP_EOF            (1<<0)     /* has MTWEOF */
-#define CAP_BSR            (1<<1)     /* has MTBSR */
-#define CAP_BSF            (1<<2)     /* has MTBSF */
-#define CAP_FSR            (1<<3)     /* has MTFSR */
-#define CAP_FSF            (1<<4)     /* has MTFSF */
-#define CAP_EOM            (1<<5)     /* has MTEOM */
-#define CAP_REM            (1<<6)     /* is removable media */
-#define CAP_RACCESS        (1<<7)     /* is random access device */
-#define CAP_AUTOMOUNT      (1<<8)     /* Read device at start to see what is there */
-#define CAP_LABEL          (1<<9)     /* Label blank tapes */
-#define CAP_ANONVOLS       (1<<10)    /* Mount without knowing volume name */
-#define CAP_ALWAYSOPEN     (1<<11)    /* always keep device open */
+#define CAP_EOF           (1<<0)     /* has MTWEOF */
+#define CAP_BSR           (1<<1)     /* has MTBSR */
+#define CAP_BSF           (1<<2)     /* has MTBSF */
+#define CAP_FSR           (1<<3)     /* has MTFSR */
+#define CAP_FSF           (1<<4)     /* has MTFSF */
+#define CAP_EOM           (1<<5)     /* has MTEOM */
+#define CAP_REM           (1<<6)     /* is removable media */
+#define CAP_RACCESS       (1<<7)     /* is random access device */
+#define CAP_AUTOMOUNT     (1<<8)     /* Read device at start to see what is there */
+#define CAP_LABEL         (1<<9)     /* Label blank tapes */
+#define CAP_ANONVOLS      (1<<10)    /* Mount without knowing volume name */
+#define CAP_ALWAYSOPEN    (1<<11)    /* always keep device open */
 #define CAP_AUTOCHANGER    (1<<12)    /* AutoChanger */
 #define CAP_OFFLINEUNMOUNT (1<<13)    /* Offline before unmount */
-#define CAP_STREAM         (1<<14)    /* Stream device */
-#define CAP_BSFATEOM       (1<<15)    /* Backspace file at EOM */
-#define CAP_FASTFSF        (1<<16)    /* Fast forward space file */
-#define CAP_TWOEOF         (1<<17)    /* Write two eofs for EOM */
+#define CAP_STREAM        (1<<14)    /* Stream device */
+#define CAP_BSFATEOM      (1<<15)    /* Backspace file at EOM */
+#define CAP_FASTFSF       (1<<16)    /* Fast forward space file */
+#define CAP_TWOEOF        (1<<17)    /* Write two eofs for EOM */
 
 /* Test state */
 #define dev_state(dev, st_state) ((dev)->state & (st_state))
 
 /* Device state bits */
-#define ST_OPENED          (1<<0)     /* set when device opened */
-#define ST_TAPE            (1<<1)     /* is a tape device */  
-#define ST_FILE            (1<<2)     /* is a file device */
-#define ST_FIFO            (1<<3)     /* is a fifo device */
-#define ST_PROG            (1<<4)     /* is a program device */
-#define ST_LABEL           (1<<5)     /* label found */
+#define ST_OPENED         (1<<0)     /* set when device opened */
+#define ST_TAPE           (1<<1)     /* is a tape device */  
+#define ST_FILE           (1<<2)     /* is a file device */
+#define ST_FIFO           (1<<3)     /* is a fifo device */
+#define ST_PROG           (1<<4)     /* is a program device */
+#define ST_LABEL          (1<<5)     /* label found */
 #define ST_MALLOC          (1<<6)     /* dev packet malloc'ed in init_dev() */
-#define ST_APPEND          (1<<7)     /* ready for Bacula append */
-#define ST_READ            (1<<8)     /* ready for Bacula read */
-#define ST_EOT             (1<<9)     /* at end of tape */
-#define ST_WEOT            (1<<10)    /* Got EOT on write */
-#define ST_EOF             (1<<11)    /* Read EOF i.e. zero bytes */
-#define ST_NEXTVOL         (1<<12)    /* Start writing on next volume */
-#define ST_SHORT           (1<<13)    /* Short block read */
+#define ST_APPEND         (1<<7)     /* ready for Bacula append */
+#define ST_READ           (1<<8)     /* ready for Bacula read */
+#define ST_EOT            (1<<9)     /* at end of tape */
+#define ST_WEOT           (1<<10)    /* Got EOT on write */
+#define ST_EOF            (1<<11)    /* Read EOF i.e. zero bytes */
+#define ST_NEXTVOL        (1<<12)    /* Start writing on next volume */
+#define ST_SHORT          (1<<13)    /* Short block read */
 
 /* dev_blocked states (mutually exclusive) */
 #define BST_NOT_BLOCKED       0       /* not blocked */
-#define BST_UNMOUNTED         1       /* User unmounted device */
+#define BST_UNMOUNTED        1       /* User unmounted device */
 #define BST_WAITING_FOR_SYSOP 2       /* Waiting for operator to mount tape */
 #define BST_DOING_ACQUIRE     3       /* Opening/validating/moving tape */
 #define BST_WRITING_LABEL     4       /* Labeling a tape */  
 #define BST_UNMOUNTED_WAITING_FOR_SYSOP 5 /* Closed by user during mount request */
-#define BST_MOUNT             6       /* Mount request */
+#define BST_MOUNT            6       /* Mount request */
 
 /* Volume Catalog Information structure definition */
 struct VOLUME_CAT_INFO {
    /* Media info for the current Volume */
-   uint32_t VolCatJobs;               /* number of jobs on this Volume */
-   uint32_t VolCatFiles;              /* Number of files */
-   uint32_t VolCatBlocks;             /* Number of blocks */
-   uint64_t VolCatBytes;              /* Number of bytes written */
-   uint32_t VolCatMounts;             /* Number of mounts this volume */
-   uint32_t VolCatErrors;             /* Number of errors this volume */
-   uint32_t VolCatWrites;             /* Number of writes this volume */
-   uint32_t VolCatReads;              /* Number of reads this volume */
-   uint64_t VolCatRBytes;             /* Number of bytes read */
-   uint32_t VolCatRecycles;           /* Number of recycles this volume */
-   int32_t  Slot;                     /* Slot in changer */
-   bool     InChanger;                /* Set if vol in current magazine */
-   uint32_t VolCatMaxJobs;            /* Maximum Jobs to write to volume */
-   uint32_t VolCatMaxFiles;           /* Maximum files to write to volume */
-   uint64_t VolCatMaxBytes;           /* Max bytes to write to volume */
+   uint32_t VolCatJobs;              /* number of jobs on this Volume */
+   uint32_t VolCatFiles;             /* Number of files */
+   uint32_t VolCatBlocks;            /* Number of blocks */
+   uint64_t VolCatBytes;             /* Number of bytes written */
+   uint32_t VolCatMounts;            /* Number of mounts this volume */
+   uint32_t VolCatErrors;            /* Number of errors this volume */
+   uint32_t VolCatWrites;            /* Number of writes this volume */
+   uint32_t VolCatReads;             /* Number of reads this volume */
+   uint64_t VolCatRBytes;            /* Number of bytes read */
+   uint32_t VolCatRecycles;          /* Number of recycles this volume */
+   int32_t  Slot;                    /* Slot in changer */
+   bool     InChanger;               /* Set if vol in current magazine */
+   uint32_t VolCatMaxJobs;           /* Maximum Jobs to write to volume */
+   uint32_t VolCatMaxFiles;          /* Maximum files to write to volume */
+   uint64_t VolCatMaxBytes;          /* Max bytes to write to volume */
    uint64_t VolCatCapacityBytes;      /* capacity estimate */
-   uint64_t VolReadTime;              /* time spent reading */
-   uint64_t VolWriteTime;             /* time spent writing this Volume */
-   char VolCatStatus[20];             /* Volume status */
+   uint64_t VolReadTime;             /* time spent reading */
+   uint64_t VolWriteTime;            /* time spent writing this Volume */
+   char VolCatStatus[20];            /* Volume status */
    char VolCatName[MAX_NAME_LENGTH];  /* Desired volume to mount */
-};                
+};               
 
 
 typedef struct s_steal_lock {
-   pthread_t         no_wait_id;      /* id of no wait thread */
-   int               dev_blocked;     /* state */
-   int               dev_prev_blocked; /* previous blocked state */
+   pthread_t        no_wait_id;      /* id of no wait thread */
+   int              dev_blocked;     /* state */
+   int              dev_prev_blocked; /* previous blocked state */
 } bsteal_lock_t;
 
-struct DEVRES;                        /* Device resource defined in stored_conf.h */
+struct DEVRES;                       /* Device resource defined in stored_conf.h */
 
 /* Device structure definition */
 struct DEVICE {
 public:
-   DEVICE *next;                      /* pointer to next open device */
-   DEVICE *prev;                      /* pointer to prev open device */
-   JCR *attached_jcrs;                /* attached JCR list */
-   pthread_mutex_t mutex;             /* access control */
-   pthread_cond_t wait;               /* thread wait variable */
+   DEVICE *next;                     /* pointer to next open device */
+   DEVICE *prev;                     /* pointer to prev open device */
+   JCR *attached_jcrs;               /* attached JCR list */
+   pthread_mutex_t mutex;            /* access control */
+   pthread_cond_t wait;              /* thread wait variable */
    pthread_cond_t wait_next_vol;      /* wait for tape to be mounted */
-   pthread_t no_wait_id;              /* this thread must not wait */
-   int dev_blocked;                   /* set if we must wait (i.e. change tape) */
-   int dev_prev_blocked;              /* previous blocked state */
-   int num_waiting;                   /* number of threads waiting */
-   int num_writers;                   /* number of writing threads */
-   int use_count;                     /* usage count on this device */
-   int fd;                            /* file descriptor */
-   int capabilities;                  /* capabilities mask */
-   int state;                         /* state mask */
-   int dev_errno;                     /* Our own errno */
-   int mode;                          /* read/write modes */
-   char *dev_name;                    /* device name */
-   char *errmsg;                      /* nicely edited error message */
-   uint32_t block_num;                /* current block number base 0 */
-   uint32_t file;                     /* current file number base 0 */
-   uint64_t file_addr;                /* Current file read/write address */
-   uint32_t EndBlock;                 /* last block written */
-   uint32_t EndFile;                  /* last file written */
-   uint32_t min_block_size;           /* min block size */
-   uint32_t max_block_size;           /* max block size */
-   uint64_t max_volume_size;          /* max bytes to put on one volume */
-   uint64_t max_file_size;            /* max file size to put in one file on volume */
-   uint64_t volume_capacity;          /* advisory capacity */
-   uint32_t max_rewind_wait;          /* max secs to allow for rewind */
-   uint32_t max_open_wait;            /* max secs to allow for open */
-   uint32_t max_open_vols;            /* max simultaneous open volumes */
-   utime_t  vol_poll_interval;        /* interval between polling Vol mount */
-   DEVRES *device;                    /* pointer to Device Resource */
-   btimer_id tid;                     /* timer id */
-
-   VOLUME_CAT_INFO VolCatInfo;        /* Volume Catalog Information */
-   VOLUME_LABEL VolHdr;               /* Actual volume label */
+   pthread_t no_wait_id;             /* this thread must not wait */
+   int dev_blocked;                  /* set if we must wait (i.e. change tape) */
+   int dev_prev_blocked;             /* previous blocked state */
+   int num_waiting;                  /* number of threads waiting */
+   int num_writers;                  /* number of writing threads */
+   int use_count;                    /* usage count on this device */
+   int fd;                           /* file descriptor */
+   int capabilities;                 /* capabilities mask */
+   int state;                        /* state mask */
+   int dev_errno;                    /* Our own errno */
+   int mode;                         /* read/write modes */
+   char *dev_name;                   /* device name */
+   char *errmsg;                     /* nicely edited error message */
+   uint32_t block_num;               /* current block number base 0 */
+   uint32_t file;                    /* current file number base 0 */
+   uint64_t file_addr;               /* Current file read/write address */
+   uint32_t EndBlock;                /* last block written */
+   uint32_t EndFile;                 /* last file written */
+   uint32_t min_block_size;          /* min block size */
+   uint32_t max_block_size;          /* max block size */
+   uint64_t max_volume_size;         /* max bytes to put on one volume */
+   uint64_t max_file_size;           /* max file size to put in one file on volume */
+   uint64_t volume_capacity;         /* advisory capacity */
+   uint32_t max_rewind_wait;         /* max secs to allow for rewind */
+   uint32_t max_open_wait;           /* max secs to allow for open */
+   uint32_t max_open_vols;           /* max simultaneous open volumes */
+   utime_t  vol_poll_interval;       /* interval between polling Vol mount */
+   DEVRES *device;                   /* pointer to Device Resource */
+   btimer_id tid;                    /* timer id */
+
+   VOLUME_CAT_INFO VolCatInfo;       /* Volume Catalog Information */
+   VOLUME_LABEL VolHdr;              /* Actual volume label */
    
    /* Device wait times ***FIXME*** look at durations */
    char BadVolName[MAX_NAME_LENGTH];  /* Last wrong Volume mounted */
-   bool poll;                         /* set to poll Volume */
+   bool poll;                        /* set to poll Volume */
    int min_wait;
    int max_wait;
    int max_num_wait;
@@ -206,7 +206,7 @@ public:
  *  dependent. Arrgggg!
  */
 #ifndef MTEOM
-#ifdef  MTSEOD
+#ifdef MTSEOD
 #define MTEOM MTSEOD
 #endif
 #ifdef MTEOD
index 46ffd38ace86113d2eeb606a7ca8b148090e0b0f..115a9d5ae270d53e70341b31435b611677ed79d1 100644 (file)
@@ -29,7 +29,7 @@
  *   Version $Id$
  */
 /*
-   Copyright (C) 2000-2003 Kern Sibbald and John Walker
+   Copyright (C) 2000-2004 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
index efc3343bcf0eed840dd431d283da19ae73bfa692..b3ddd6341821d2953b4798ea5bc9f2824509bf80 100644 (file)
@@ -19,7 +19,7 @@
  *  
  */
 /*
-   Copyright (C) 2000-2003 Kern Sibbald and John Walker
+   Copyright (C) 2000-2004 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
index 0ba90a615f75db19fe8ae73dbd1627131b0b2a21..ba1063bc043c5c26a605a0f9c2281ca78e5f881c 100644 (file)
@@ -8,7 +8,7 @@
  *   Version $Id$
  */
 /*
-   Copyright (C) 2000-2003 Kern Sibbald and John Walker
+   Copyright (C) 2000-2004 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
index a50611ddc66c5d90a73cbbd1f7e0d1b017ea126f..c2682b2786789af37860c22cb8008550a34437e6 100644 (file)
@@ -7,7 +7,7 @@
  *  
  */
 /*
-   Copyright (C) 2000-2003 Kern Sibbald and John Walker
+   Copyright (C) 2000-2004 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
index 0c81761050b24064b329461cdc0ad6fccddb89da..568f4529f0c2e35d2d5f31e5678a8fbf78a3320a 100644 (file)
@@ -10,7 +10,7 @@
  * 
  */
 /*
-   Copyright (C) 2000-2003 Kern Sibbald and John Walker
+   Copyright (C) 2000-2004 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
index f2006f339d6dea4db11409c12bbf588239417a9e..14541d328b957c0e7b2a24ab89b8cf95fafc3a4c 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 /*
-   Copyright (C) 2000, 2001, 2002 Kern Sibbald and John Walker
+   Copyright (C) 2000-2004 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
index 7540e06215b44c7a8e67e9633d683e216df018a2..65438b93bd475fed189d46d47dd175b56e0b5c8b 100644 (file)
@@ -4,7 +4,7 @@
  *   Version $Id$
  */
 /*
-   Copyright (C) 2000-2003 Kern Sibbald and John Walker
+   Copyright (C) 2000-2004 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
 
  */
 
-#define R_FIRST                       3001
+#define R_FIRST                      3001
 
-#define R_DIRECTOR                    3001
-#define R_STORAGE                     3002
-#define R_DEVICE                      3003
-#define R_MSGS                        3004
+#define R_DIRECTOR                   3001
+#define R_STORAGE                    3002
+#define R_DEVICE                     3003
+#define R_MSGS                       3004
 
-#define R_LAST                        R_MSGS
+#define R_LAST                       R_MSGS
 
 
-#define R_NAME                        3020
-#define R_ADDRESS                     3021
-#define R_PASSWORD                    3022
-#define R_TYPE                        3023
-#define R_BACKUP                      3024
+#define R_NAME                       3020
+#define R_ADDRESS                    3021
+#define R_PASSWORD                   3022
+#define R_TYPE                       3023
+#define R_BACKUP                     3024
 
 /* Definition of the contents of each Resource */
 struct DIRRES {
-   RES   hdr;
+   RES  hdr;
 
-   char *password;                    /* Director password */
-   char *address;                     /* Director IP address or zero */
-   int enable_ssl;                    /* Use SSL with this Director */
+   char *password;                   /* Director password */
+   char *address;                    /* Director IP address or zero */
+   int enable_ssl;                   /* Use SSL with this Director */
 };
 
 
 /* Storage daemon "global" definitions */
 struct s_res_store {
-   RES   hdr;
+   RES  hdr;
 
-   char *address;                     /* deprecated */
-   char *SDaddr;                      /* bind address */
-   int   SDport;                      /* Where we listen for Directors */
+   char *address;                    /* deprecated */
+   char *SDaddr;                     /* bind address */
+   int  SDport;                      /* Where we listen for Directors */
    int   SDDport;                     /* "Data" port where we listen for File daemons */
-   char *working_directory;           /* working directory for checkpoints */
+   char *working_directory;          /* working directory for checkpoints */
    char *pid_directory;
    char *subsys_directory;
-   int require_ssl;                   /* Require SSL on all connections */
+   int require_ssl;                  /* Require SSL on all connections */
    uint32_t max_concurrent_jobs;      /* maximum concurrent jobs to run */
-   MSGS *messages;                    /* Daemon message handler */
-   utime_t heartbeat_interval;        /* Interval to send hb to FD */
+   MSGS *messages;                   /* Daemon message handler */
+   utime_t heartbeat_interval;       /* Interval to send hb to FD */
 };
 typedef struct s_res_store STORES;
 
 /* Device specific definitions */
 struct DEVRES {
-   RES   hdr;
-
-   char *media_type;                  /* User assigned media type */
-   char *device_name;                 /* Archive device name */
-   char *changer_name;                /* Changer device name */
-   char *changer_command;             /* Changer command  -- external program */
-   uint32_t cap_bits;                 /* Capabilities of this device */
-   uint32_t max_changer_wait;         /* Changer timeout */
-   uint32_t max_rewind_wait;          /* maximum secs to wait for rewind */
-   uint32_t max_open_wait;            /* maximum secs to wait for open */
-   uint32_t max_open_vols;            /* maximum simultaneous open volumes */
-   uint32_t min_block_size;           /* min block size */
-   uint32_t max_block_size;           /* max block size */
-   uint32_t max_volume_jobs;          /* max jobs to put on one volume */
-   utime_t  vol_poll_interval;        /* interval between polling volume during mount */
-   int64_t max_volume_files;          /* max files to put on one volume */
-   int64_t max_volume_size;           /* max bytes to put on one volume */
-   int64_t max_file_size;             /* max file size in bytes */
-   int64_t volume_capacity;           /* advisory capacity */
-   DEVICE *dev;                       /* Pointer to phyical dev -- set at runtime */
+   RES  hdr;
+
+   char *media_type;                 /* User assigned media type */
+   char *device_name;                /* Archive device name */
+   char *changer_name;               /* Changer device name */
+   char *changer_command;            /* Changer command  -- external program */
+   uint32_t cap_bits;                /* Capabilities of this device */
+   uint32_t max_changer_wait;        /* Changer timeout */
+   uint32_t max_rewind_wait;         /* maximum secs to wait for rewind */
+   uint32_t max_open_wait;           /* maximum secs to wait for open */
+   uint32_t max_open_vols;           /* maximum simultaneous open volumes */
+   uint32_t min_block_size;          /* min block size */
+   uint32_t max_block_size;          /* max block size */
+   uint32_t max_volume_jobs;         /* max jobs to put on one volume */
+   utime_t  vol_poll_interval;       /* interval between polling volume during mount */
+   int64_t max_volume_files;         /* max files to put on one volume */
+   int64_t max_volume_size;          /* max bytes to put on one volume */
+   int64_t max_file_size;            /* max file size in bytes */
+   int64_t volume_capacity;          /* advisory capacity */
+   DEVICE *dev;                      /* Pointer to phyical dev -- set at runtime */
 };
 
 union URES {
@@ -96,5 +96,5 @@ union URES {
    STORES res_store;
    DEVRES res_dev;
    MSGS   res_msgs;
-   RES    hdr;
+   RES   hdr;
 };
index 3c5eba25a1e364290a9d0d39911fc4f95fd943ef..22d868247d9ccc8ce7dd29abeea2cbd1a279ad2f 100644 (file)
@@ -1,5 +1,5 @@
 /*
-   Copyright (C) 2000-2003 Kern Sibbald and John Walker
+   Copyright (C) 2000-2004 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