2 * Amanda, The Advanced Maryland Automatic Network Disk Archiver
3 * Copyright (c) 1991-1998 University of Maryland at College Park
6 * Permission to use, copy, modify, distribute, and sell this software and its
7 * documentation for any purpose is hereby granted without fee, provided that
8 * the above copyright notice appear in all copies and that both that
9 * copyright notice and this permission notice appear in supporting
10 * documentation, and that the name of U.M. not be used in advertising or
11 * publicity pertaining to distribution of the software without specific,
12 * written prior permission. U.M. makes no representations about the
13 * suitability of this software for any purpose. It is provided "as is"
14 * without express or implied warranty.
16 * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
17 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M.
18 * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
19 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
20 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
21 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
23 * Authors: the Amanda Development Team. Its members are listed in a
24 * file named AUTHORS, in the root directory of this distribution.
27 * $Id: restore.h,v 1.8 2006/06/22 17:16:39 martinea Exp $
35 #include "fileheader.h"
37 #include "amfeatures.h"
40 #define CREAT_MODE 0640
42 typedef struct rst_flags_s {
43 unsigned int inline_assemble:1;
44 unsigned int delay_assemble:1;
45 unsigned int compress:1;
46 unsigned int leave_comp:1;
48 unsigned int headers:1;
49 unsigned int isafile:1;
50 unsigned int wait_tape_prompt:1; /* for interactive console use */
51 unsigned int amidxtaped:1; /* for client-daemon use */
52 unsigned int check_labels:1;
53 unsigned int mask_splits:1;
64 enum { HOLDING_MODE, DEVICE_MODE} restore_mode;
72 typedef struct seentapes_s seentapes_t;
74 char *make_filename(dumpfile_t *file);
75 ssize_t read_file_header(dumpfile_t *file, int tapefd, int isafile,
77 void restore(RestoreSource * source, rst_flags_t * flags);
78 gboolean restore_holding_disk(FILE * prompt_out,
80 am_feature_t * features,
84 dumpfile_t * this_header,
85 dumpfile_t * last_header);
87 gboolean search_a_tape(Device * device, FILE *prompt_out, rst_flags_t *flags,
88 am_feature_t *their_features,
89 tapelist_t *desired_tape, GSList *dumpspecs,
90 seentapes_t **tape_seen,
91 dumpfile_t * first_restored_file, int tape_count,
94 void flush_open_outputs(int reassemble, dumpfile_t *only_file);
95 void search_tapes(FILE *prompt_out, FILE *prompt_in, int use_changer,
96 tapelist_t *tapelist, GSList *dumpspecs,
97 rst_flags_t *flags, am_feature_t *their_features);
98 int have_all_parts(dumpfile_t *file, int upto);
99 rst_flags_t *new_rst_flags(void);
100 int check_rst_flags(rst_flags_t *flags);
101 void free_rst_flags(rst_flags_t *flags);
102 int lock_logfile(void);
103 void send_message(FILE *prompt_out, rst_flags_t *flags,
104 am_feature_t *their_features,
105 char * format, ...) G_GNUC_PRINTF(4,5);
106 gboolean set_restore_device_read_buffer_size(Device *device, rst_flags_t *flags);
108 #endif /* RESTORE_H */