Disk ARchive  2.4.2
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 // $Id: macro_tools.hpp,v 1.38 2011/04/09 19:55:08 edrusb Rel $
00022 //
00023 /*********************************************************************/
00024 
00028 
00029 #ifndef MACRO_TOOLS_HPP
00030 #define MACRO_TOOLS_HPP
00031 
00032 #include "../my_config.h"
00033 
00034 extern "C"
00035 {
00036 #if HAVE_LIMITS_H
00037 #include <limits.h>
00038 #endif
00039 
00040 }
00041 #include <string>
00042 
00043 #include "catalogue.hpp"
00044 #include "compressor.hpp"
00045 #include "infinint.hpp"
00046 #include "header_version.hpp"
00047 #include "generic_file.hpp"
00048 #include "scrambler.hpp"
00049 #include "crypto.hpp"
00050 #include "escape.hpp"
00051 #include "pile.hpp"
00052 
00055 
00056 
00057 #define BUFFER_SIZE 102400
00058 #ifdef SSIZE_MAX
00059 #if SSIZE_MAX < BUFFER_SIZE
00060 #undef BUFFER_SIZE
00061 #define BUFFER_SIZE SSIZE_MAX
00062 #endif
00063 #endif
00064 
00065 namespace libdar
00066 {
00067 
00068     extern const archive_version macro_tools_supported_version;
00069     extern const std::string LIBDAR_STACK_LABEL_UNCOMPRESSED;
00070     extern const std::string LIBDAR_STACK_LABEL_CLEAR;
00071     extern const std::string LIBDAR_STACK_LABEL_UNCYPHERED;
00072     extern const std::string LIBDAR_STACK_LABEL_LEVEL1;
00073 
00074     extern void macro_tools_open_archive(user_interaction & dialog,
00075                                          const path &sauv_path,  // path to slices
00076                                          const std::string &basename,  // slice basename
00077                                          const infinint & min_digits,  // minimum digits for the slice number
00078                                          const std::string &extension,  // slice extensions
00079                                          crypto_algo crypto, // encryption algorithm
00080                                          const secu_string &pass, // pass key for crypto/scrambling
00081                                          U_32 crypto_size,    // crypto block size
00082                                          pile & stack, // the stack of generic_file resulting of the archive openning
00083                                          header_version &ver, // header read from raw data
00084                                          const std::string &input_pipe, // named pipe for input when basename is "-" (dar_slave)
00085                                          const std::string &output_pipe, // named pipe for output when basename is "-" (dar_slave)
00086                                          const std::string & execute, // command to execute between slices
00087                                          infinint & second_terminateur_offset, // where to start looking for the second terminateur (set to zero if there is only one terminateur).
00088                                          bool lax,  // whether we skip&warn the usual verifications
00089                                          bool sequential_read, // whether to use the escape sequence (if present) to get archive contents and proceed to sequential reading
00090                                          bool info_details); // be or not verbose about the archive openning
00091         // all allocated objects (ret1, ret2, scram), must be deleted when no more needed by the caller of this routine
00092 
00093     extern catalogue *macro_tools_get_derivated_catalogue_from(user_interaction & dialog,
00094                                                                pile & data_stack,  // where to get the files and EA from
00095                                                                pile & cata_stack,  // where to get the catalogue from
00096                                                                const header_version & ver, // version format as defined in the header of the archive to read
00097                                                                bool info_details, // verbose display (throught user_interaction)
00098                                                                infinint &cat_size, // return size of archive in file (not in memory !)
00099                                                                const infinint & second_terminateur_offset, // location of the second terminateur (zero if none exist)
00100                                                                 bool lax_mode);         // whether to do relaxed checkings
00101 
00102     extern catalogue *macro_tools_get_catalogue_from(user_interaction & dialog,
00103                                                      pile & stack,  // raw data access object
00104                                                      const header_version & ver, // version format as defined in the header of the archive to read
00105                                                      bool info_details, // verbose display (throught user_interaction)
00106                                                      infinint &cat_size, // return size of archive in file (not in memory !)
00107                                                      const infinint & second_terminateur_offset,
00108                                                      bool lax_mode);
00109 
00110     extern catalogue *macro_tools_lax_search_catalogue(user_interaction & dialog,
00111                                                        pile & stack,
00112                                                        const archive_version & edition,
00113                                                        compression compr_algo,
00114                                                        bool info_details,
00115                                                        bool even_partial_catalogues,
00116                                                        const label & layer1_data_name);
00117 
00118         // the beginning of the catalogue.
00119 
00120     extern infinint macro_tools_get_terminator_start(generic_file & f, const archive_version & reading_ver);
00121 
00122 } // end of namespace
00123 
00125 
00126 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines