Disk ARchive  2.4.12
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines
macro_tools.hpp
Go to the documentation of this file.
00001 /*********************************************************************/
00002 // dar - disk archive - a backup/restoration program
00003 // Copyright (C) 2002-2052 Denis Corbin
00004 //
00005 // This program is free software; you can redistribute it and/or
00006 // modify it under the terms of the GNU General Public License
00007 // as published by the Free Software Foundation; either version 2
00008 // of the License, or (at your option) any later version.
00009 //
00010 // This program is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 // GNU General Public License for more details.
00014 //
00015 // You should have received a copy of the GNU General Public License
00016 // along with this program; if not, write to the Free Software
00017 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00018 //
00019 // to contact the author : http://dar.linux.free.fr/email.html
00020 /*********************************************************************/
00021 
00025 
00026 #ifndef MACRO_TOOLS_HPP
00027 #define MACRO_TOOLS_HPP
00028 
00029 #include "../my_config.h"
00030 
00031 extern "C"
00032 {
00033 #if HAVE_LIMITS_H
00034 #include <limits.h>
00035 #endif
00036 }
00037 #include <string>
00038 
00039 #include "catalogue.hpp"
00040 #include "compressor.hpp"
00041 #include "infinint.hpp"
00042 #include "header_version.hpp"
00043 #include "generic_file.hpp"
00044 #include "scrambler.hpp"
00045 #include "crypto.hpp"
00046 #include "escape.hpp"
00047 #include "pile.hpp"
00048 
00051 
00052 
00053 #define BUFFER_SIZE 102400
00054 #ifdef SSIZE_MAX
00055 #if SSIZE_MAX < BUFFER_SIZE
00056 #undef BUFFER_SIZE
00057 #define BUFFER_SIZE SSIZE_MAX
00058 #endif
00059 #endif
00060 
00061 namespace libdar
00062 {
00063 
00064     extern const archive_version macro_tools_supported_version;
00065     extern const std::string LIBDAR_STACK_LABEL_UNCOMPRESSED;
00066     extern const std::string LIBDAR_STACK_LABEL_CLEAR;
00067     extern const std::string LIBDAR_STACK_LABEL_UNCYPHERED;
00068     extern const std::string LIBDAR_STACK_LABEL_LEVEL1;
00069 
00070     extern void macro_tools_open_archive(user_interaction & dialog,
00071                                          const path &sauv_path,  // path to slices
00072                                          const std::string &basename,  // slice basename
00073                                          const infinint & min_digits,  // minimum digits for the slice number
00074                                          const std::string &extension,  // slice extensions
00075                                          crypto_algo crypto, // encryption algorithm
00076                                          const secu_string &pass, // pass key for crypto/scrambling
00077                                          U_32 crypto_size,    // crypto block size
00078                                          pile & stack, // the stack of generic_file resulting of the archive openning
00079                                          header_version &ver, // header read from raw data
00080                                          const std::string &input_pipe, // named pipe for input when basename is "-" (dar_slave)
00081                                          const std::string &output_pipe, // named pipe for output when basename is "-" (dar_slave)
00082                                          const std::string & execute, // command to execute between slices
00083                                          infinint & second_terminateur_offset, // where to start looking for the second terminateur (set to zero if there is only one terminateur).
00084                                          bool lax,  // whether we skip&warn the usual verifications
00085                                          bool sequential_read, // whether to use the escape sequence (if present) to get archive contents and proceed to sequential reading
00086                                          bool info_details); // be or not verbose about the archive openning
00087         // all allocated objects (ret1, ret2, scram), must be deleted when no more needed by the caller of this routine
00088 
00089     extern catalogue *macro_tools_get_derivated_catalogue_from(user_interaction & dialog,
00090                                                                pile & data_stack,  // where to get the files and EA from
00091                                                                pile & cata_stack,  // where to get the catalogue from
00092                                                                const header_version & ver, // version format as defined in the header of the archive to read
00093                                                                bool info_details, // verbose display (throught user_interaction)
00094                                                                infinint &cat_size, // return size of archive in file (not in memory !)
00095                                                                const infinint & second_terminateur_offset, // location of the second terminateur (zero if none exist)
00096                                                                 bool lax_mode);         // whether to do relaxed checkings
00097 
00098     extern catalogue *macro_tools_get_catalogue_from(user_interaction & dialog,
00099                                                      pile & stack,  // raw data access object
00100                                                      const header_version & ver, // version format as defined in the header of the archive to read
00101                                                      bool info_details, // verbose display (throught user_interaction)
00102                                                      infinint &cat_size, // return size of archive in file (not in memory !)
00103                                                      const infinint & second_terminateur_offset,
00104                                                      bool lax_mode);
00105 
00106     extern catalogue *macro_tools_lax_search_catalogue(user_interaction & dialog,
00107                                                        pile & stack,
00108                                                        const archive_version & edition,
00109                                                        compression compr_algo,
00110                                                        bool info_details,
00111                                                        bool even_partial_catalogues,
00112                                                        const label & layer1_data_name);
00113 
00114         // the beginning of the catalogue.
00115 
00116     extern infinint macro_tools_get_terminator_start(generic_file & f, const archive_version & reading_ver);
00117 
00118 } // end of namespace
00119 
00121 
00122 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines