Imported Upstream version 2.6.0
[debian/amanda] / restore-src / restore.h
index 2dc32ca866be6074ff55debb863dad4be12b1d49..02775774c43d9aee99f425316b25fe026ddff282 100644 (file)
@@ -24,7 +24,7 @@
  * file named AUTHORS, in the root directory of this distribution.
  */
 /*
- * $Id: restore.h,v 1.5 2006/03/14 13:12:01 martinea Exp $
+ * $Id: restore.h,v 1.8 2006/06/22 17:16:39 martinea Exp $
  *
  * 
  */
 #include "fileheader.h"
 #include "tapelist.h"
 #include "amfeatures.h"
+#include "device.h"
 
 #define CREAT_MODE  0640
 
-typedef struct match_list_s {
-    char *hostname;
-    char *diskname;
-    char *datestamp;
-    char *level;
-    struct match_list_s *next;
-} match_list_t;
-
 typedef struct rst_flags_s {
     unsigned int inline_assemble:1;
     unsigned int delay_assemble:1;
@@ -58,8 +51,8 @@ typedef struct rst_flags_s {
     unsigned int amidxtaped:1; /* for client-daemon use */
     unsigned int check_labels:1;
     unsigned int mask_splits:1;
-    unsigned int fsf;
-    long blocksize;
+    off_t fsf;
+    ssize_t blocksize;
     int pipe_to_fd;
     char *restore_dir;
     char *comp_type;
@@ -67,23 +60,49 @@ typedef struct rst_flags_s {
     char *inventory_log;
 } rst_flags_t;
 
-char *make_filename P((dumpfile_t *file));
-int disk_match P((dumpfile_t *file, char *datestamp,
-                   char *hostname, char *diskname, char *level));
-void read_file_header P((dumpfile_t *file, int tapefd, int isafile,
-                        rst_flags_t *flags));
-ssize_t restore P((dumpfile_t *file, char *filename, int tapefd, int isafile,
-                       rst_flags_t *flags));
-void flush_open_outputs P((int reassemble, dumpfile_t *only_file));
-void search_tapes P((FILE *prompt_out, int use_changer, tapelist_t *tapelist,
-                        match_list_t *restorethese, rst_flags_t *flags, 
-                       am_feature_t *their_features));
-int have_all_parts P((dumpfile_t *file, int upto));
-rst_flags_t *new_rst_flags P((void));
-int check_rst_flags P((rst_flags_t *flags));
-void free_rst_flags P((rst_flags_t *flags));
-void free_match_list P((match_list_t *match_list));
-int lock_logfile P(());
+typedef struct {
+    enum { HOLDING_MODE, DEVICE_MODE} restore_mode;
+    dumpfile_t * header;
+    union {
+        int holding_fd;
+        Device * device;
+    } u;
+} RestoreSource;
+
+typedef struct seentapes_s seentapes_t;
+
+char *make_filename(dumpfile_t *file);
+ssize_t read_file_header(dumpfile_t *file, int tapefd, int isafile,
+                        rst_flags_t *flags);
+void restore(RestoreSource * source, rst_flags_t * flags);
+gboolean restore_holding_disk(FILE * prompt_out,
+                              rst_flags_t * flags,
+                              am_feature_t * features,
+                              tapelist_t * file,
+                              seentapes_t ** seen,
+                              GSList * dumpspecs,
+                              dumpfile_t * this_header,
+                              dumpfile_t * last_header);
+
+gboolean search_a_tape(Device * device, FILE *prompt_out, rst_flags_t  *flags,
+                       am_feature_t *their_features, 
+                       tapelist_t   *desired_tape, GSList *dumpspecs,
+                       seentapes_t **tape_seen,
+                       dumpfile_t * first_restored_file, int tape_count,
+                       FILE * logstream);
+
+void flush_open_outputs(int reassemble, dumpfile_t *only_file);
+void search_tapes(FILE *prompt_out, FILE *prompt_in, int use_changer,
+                 tapelist_t *tapelist, GSList *dumpspecs,
+                 rst_flags_t *flags, am_feature_t *their_features);
+int have_all_parts(dumpfile_t *file, int upto);
+rst_flags_t *new_rst_flags(void);
+int check_rst_flags(rst_flags_t *flags);
+void free_rst_flags(rst_flags_t *flags);
+int lock_logfile(void);
+void send_message(FILE *prompt_out, rst_flags_t *flags,
+                 am_feature_t *their_features,
+                 char * format, ...) G_GNUC_PRINTF(4,5);
 
 #endif /* RESTORE_H */